Skip to content

Commit

Permalink
feat(esl-tooltip): remove disable-arrow attribute
Browse files Browse the repository at this point in the history
BREAKING CHANGES: `disable-arrow` attribute removed from ESLTooltip component
  • Loading branch information
dshovchko committed Nov 14, 2024
1 parent 780b295 commit d2f6e81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/modules/esl-tooltip/core/esl-tooltip.shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import type {ESLTooltip} from './esl-tooltip';
* Tag declaration interface of {@link ESLTooltip} element
* Used for TSX declaration
*/
export interface ESLTooltipTagShape<T extends ESLTooltip = ESLTooltip> extends ESLPopupTagShape<T> {
/** Disable arrow at Tooltip */
'disable-arrow'?: boolean;
}
export interface ESLTooltipTagShape<T extends ESLTooltip = ESLTooltip> extends ESLPopupTagShape<T> {}

declare global {
namespace JSX {
Expand Down
8 changes: 2 additions & 6 deletions src/modules/esl-tooltip/core/esl-tooltip.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ExportNs} from '../../esl-utils/environment/export-ns';
import {ESLPopup} from '../../esl-popup/core';
import {memoize, attr, boolAttr, listen, prop} from '../../esl-utils/decorators';
import {memoize, attr, listen, prop} from '../../esl-utils/decorators';
import {TAB} from '../../esl-utils/dom/keys';
import {getKeyboardFocusableElements, handleFocusChain} from '../../esl-utils/dom/focus';

Expand Down Expand Up @@ -44,9 +44,6 @@ export class ESLTooltip extends ESLPopup {
/** Tooltip behavior if it does not fit in the window ('fit' by default) */
@attr({defaultValue: 'fit'}) public override behavior: string;

/** Disable arrow at Tooltip */
@boolAttr() public disableArrow: boolean;

/** Shared instanse of Tooltip */
@memoize()
public static get sharedInstance(): ESLTooltip {
Expand Down Expand Up @@ -84,7 +81,6 @@ export class ESLTooltip extends ESLPopup {
public override connectedCallback(): void {
super.connectedCallback();
this.classList.add(ESLPopup.is);
this.classList.toggle('disable-arrow', this.disableArrow);
this.tabIndex = 0;
}

Expand All @@ -93,12 +89,12 @@ export class ESLTooltip extends ESLPopup {

/** Actions to execute on show Tooltip. */
public override onShow(params: ESLTooltipActionParams): void {
if (params.disableArrow) this.disableArrow = params.disableArrow;
if (params.text) this.innerText = params.text;
if (params.html) this.innerHTML = params.html;
if (params.text || params.html) memoize.clear(this, '$arrow');
this.dir = params.dir || '';
this.lang = params.lang || '';
this.$$cls('disable-arrow', params.disableArrow);
this.parentNode !== document.body && document.body.appendChild(this);
super.onShow(params);
}
Expand Down

0 comments on commit d2f6e81

Please sign in to comment.