UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

99 lines (98 loc) 4.44 kB
import { ESLBaseTrigger } from '../../esl-trigger/core/esl-base-trigger'; import type { ESLToggleable, ESLToggleableActionParams } from '../../esl-toggleable/core/esl-toggleable'; import type { ESLFootnotes } from './esl-footnotes'; import type { ESLTooltipActionParams } from '../../esl-tooltip/core/esl-tooltip'; import type { IMediaQueryCondition } from '../../esl-media-query/core/conditions/media-query-base'; export declare class ESLNote extends ESLBaseTrigger { static is: string; static observedAttributes: string[]; /** Timeout before activating note (to have time to show content with this note) */ static readonly activateTimeout = 100; /** Event to request acknowledgment from {@link ESLNotes} instances */ FOOTNOTE_REQUEST_EVENT: string; /** Event to acknowledge {@link ESLFootnotes} instance about footnote */ FOOTNOTE_RESPONSE_EVENT: string; /** {@link ESLMediaQuery} to specify that footnotes must ignore this note. Default: `not all` */ ignore: string; /** Tooltip content */ html: string; /** * Note label in stand-alone mode (detached from footnotes), * in the connected state it is a numeric index that is calculated automatically */ standaloneLabel: string; /** Hover event tracking media query. Default: `all` */ trackHover: string; /** Target to container element {@link ESLTraversingQuery} to define bounds of tooltip visibility (window by default) */ container: string; /** margin around the element that is used as the viewport for checking the visibility of the note tooltip */ intersectionMargin: string; /** Linked state marker */ linked: boolean; /** Standalone state marker */ standalone: boolean; protected _$footnotes: ESLFootnotes | null; protected _index: number; /** Target observable Toggleable */ get $target(): ESLToggleable; /** Marker to allow footnotes to pick up this note */ get allowFootnotes(): boolean; /** Note index in the scope content */ get index(): number; set index(value: number); /** Note index in the displayed list of footnotes */ get renderedIndex(): string; /** Note markup */ protected get renderedHTML(): string; /** Query to describe conditions to ignore note by footnotes */ get queryToIgnore(): IMediaQueryCondition; /** The text writing directionality of the element */ protected get currentDir(): string; /** The base language of the element */ protected get currentLang(): string; /** Checks that the target is in active state */ get isTargetActive(): boolean; protected connectedCallback(): void; protected disconnectedCallback(): void; protected attributeChangedCallback(attrName: string, oldVal: string, newVal: string): void; /** Revises the settings for ignoring the note */ updateIgnoredQuery(): void; /** Gets attribute value from the closest element with group behavior settings */ protected getClosestRelatedAttr(attrName: string): string | null; /** Activates note */ activate(): void; /** Highlights note */ highlight(enable?: boolean): void; /** Links note with footnotes */ link(footnotes: ESLFootnotes, index: number): void; /** Unlinks note from footnotes */ unlink(): void; /** Updates note state */ update(): void; /** Initial initialization of the element during the connection to DOM */ protected init(): void; /** Restores original note content after unlinking */ protected restore(): void; /** Merge params to pass to the toggleable */ protected mergeToggleableParams(this: ESLNote, ...params: ESLTooltipActionParams[]): ESLTooltipActionParams; /** Show target toggleable with passed params */ showTarget(params?: ESLToggleableActionParams): void; /** Actions on breakpoint changing */ protected _onIgnoreConditionChange(): void; /** Handles footnotes request event */ protected _onFootnotesReady(e: CustomEvent): void; /** Handles ESLNote state change */ protected _onTargetHide(): void; /** Handles ESLNote state change */ protected _onBeforeTargetShow(): void; /** Sends the response to footnotes */ protected _sendResponseToFootnote(): void; } declare global { export interface ESLLibrary { Note: typeof ESLNote; } export interface HTMLElementTagNameMap { 'esl-note': ESLNote; } }