/** * Side drawer component. * * @augments IvComponent */ export class Drawer extends IvComponent { /** @type {Readonly} */ static defaults: Readonly; /** * Returns the drawer instance attached to `el`, if any. * * @param {Element} el Host element. * @returns {Drawer|undefined} The instance or `undefined`. */ static get(el: Element): Drawer | undefined; /** * Returns the existing instance or creates one. * * @param {Element} el Host element. * @param {Partial} [options] Options passed in JavaScript. * @returns {Drawer} The instance. */ static getOrCreate(el: Element, options?: Partial): Drawer; /** * Instantiates every `[data-iv-component="drawer"]` inside `root`. * * @param {ParentNode} [root] Subtree to scan. * @returns {Drawer[]} Newly created instances. */ static initAll(root?: ParentNode): Drawer[]; /** * @param {Element} el A `` element. * @param {Partial} [options] Options passed in JavaScript. * @throws {IvError} `invalid-element` when `el` is not a ``. */ constructor(el: Element, options?: Partial); /** @type {string|null} `data-iv-static` exactly as served. */ _servedStatic: string | null; /** * The host element, typed as a dialog. * * @returns {HTMLDialogElement} The `` element. */ get dialog(): HTMLDialogElement; /** * Resolved options. * * @returns {Readonly} The options. */ get options(): Readonly; /** * Side the drawer is attached to. Read-only, resolved at construction. * * @returns {"start"|"end"} The placement. */ get placement(): "start" | "end"; /** * Whether the drawer is currently open as a modal. * * @returns {boolean} `true` when open. */ get isOpen(): boolean; /** * Whether the viewport is wide enough for the drawer to be a static panel. * In that state the panel is already visible and `open()` is a no-op. * * @returns {boolean} `true` in static mode. */ get isStatic(): boolean; /** * The native `returnValue` of the dialog. * * @returns {string} The return value. */ get returnValue(): string; /** @type {Element|null} Element focus returns to on close. */ _trigger: Element | null | undefined; /** @type {DrawerReason|null} Reason of a close started by this instance. */ _closingReason: DrawerReason | null | undefined; /** @type {boolean} Whether this instance added a temporary `tabindex`. */ _addedTabindex: boolean | undefined; /** @type {boolean} Whether this instance added the placement class. */ _addedEndClass: boolean | undefined; /** @type {boolean} Whether the instance is being destroyed. */ _destroying: boolean | undefined; /** @type {EventTarget|null} Where the press behind the current click landed. */ _pressTarget: EventTarget | null | undefined; /** @type {MediaQueryList|null} Watcher of the static breakpoint. */ _mql: MediaQueryList | null | undefined; /** * Adds the placement class when the drawer sits on the inline end. * * @returns {void} */ _applyPlacement(): void; /** * Subscribes to the static breakpoint and reflects its current state. * An unknown breakpoint name is reported once and treated as `"none"`. * * @returns {void} */ _setupStatic(): void; /** * Warns once per element that the drawer stops being modal from `staticFrom` * upwards. A drawer already living in a side region (`