UNPKG

igniteui-webcomponents

Version:

Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.

76 lines (75 loc) 2.72 kB
import { LitElement, type PropertyValues } from 'lit'; import type { AbsolutePosition, NotificationPositioning } from '../../types.js'; export declare abstract class IgcBaseAlertLikeComponent extends LitElement { protected readonly _player: import("../../../animations/player.js").AnimationController; protected _autoHideTimeout?: ReturnType<typeof setTimeout>; /** * Whether the component is in shown state. * * @attr open * @default false */ open: boolean; /** * Determines the duration in milliseconds in which the component will be visible. * * @attr display-time * @default 4000 */ displayTime: number; /** * Determines whether the component should close after the `displayTime` is over. * * @attr keep-open * @default false */ keepOpen: boolean; /** * Sets the position of the component in the viewport. * * `bottom` - positions the component at the bottom. This is the default. * `middle` - positions the component at the center. * `top` - positions the component at the top. * * @attr position * @default 'bottom' */ position: AbsolutePosition; /** * Sets the positioning strategy of the component. * * `viewport` - positions the component relative to the viewport, ignoring any ancestor elements. This is the default behavior. * `container` - positions the component relative to the nearest visible ancestor. In this mode, the component will be constrained within the bounding box of the ancestor and will be positioned according to the `position` attribute. * * @attr positioning * @default 'viewport' */ positioning: NotificationPositioning; constructor(); connectedCallback(): void; protected update(props: PropertyValues<this>): void; private _showPopover; private _setOpenState; private _setAutoHideTimer; /** * Opens the component. * * Returns a promise that resolves to `true` if the component was successfully opened, or `false` * if it was already open or could not be shown (e.g., in `container` positioning mode with no visible ancestors). */ show(): Promise<boolean>; /** * Closes the component. * * Returns a promise that resolves to `true` if the component was successfully closed, or `false` * if it was already closed. */ hide(): Promise<boolean>; /** * Toggles the open state of the component. * * Returns a promise that resolves to `true` if the operation completed successfully, or `false` * if it was already in the desired state. */ toggle(): Promise<boolean>; }