UNPKG

@exadel/esl

Version:

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

46 lines (45 loc) 2.03 kB
import { ESLBaseElement } from '../../esl-base-element/core'; import { ESLToggleable } from './esl-toggleable'; /** * ESLToggleableDispatcher * @author Julia Murashko, Alexey Stsefanovich (ala'n) * * ESLToggleableDispatcher - plugin component, that prevents activation of multiple ESLToggleable instances in bounds of managed container. */ export declare class ESLToggleableDispatcher extends ESLBaseElement { static readonly is = "esl-toggleable-dispatcher"; /** * Initialize ToggleableGroupDispatcher * Uses esl-toggleable-dispatcher tag and document body root by default */ static init(root?: HTMLElement, tagName?: string): void; protected _popups: Map<string, ESLToggleable>; /** Observed element */ get root(): HTMLElement | null; /** Guard-condition for targets */ protected isAcceptable(target: any): target is ESLToggleable; /** Hides active element in group */ hideActive(groupName: string, activator?: HTMLElement): void; /** Sets active element in group */ setActive(groupName: string, popup: ESLToggleable): void; /** Gets active element in group or undefined if group doesn't exist */ getActive(groupName: string): ESLToggleable | undefined; /** Deletes element from the group if passed element is currently active */ deleteActive(groupName: string, popup: ESLToggleable): void; /** Hides active element before e.target will be shown */ protected _onBeforeShow(e: CustomEvent): void; /** Updates active element after a new element is shown */ protected _onShow(e: CustomEvent): void; /** Updates group state after active element is hidden */ protected _onHide(e: CustomEvent): void; /** Updates active elements */ protected _onChangeGroup(e: CustomEvent): void; } declare global { export interface ESLLibrary { ToggleableDispatcher: typeof ESLToggleableDispatcher; } export interface HTMLElementTagNameMap { 'esl-toggleable-dispatcher': ESLToggleableDispatcher; } }