Popup
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| modal | boolean | false | Indicates whether the popup is displayed as a modal. |
| contentAlign | AnchorAlign | Specifies the alignment direction relative to the content. Possible values: 'left top', 'left center', 'left bottom', 'right top', 'right center', 'right bottom', 'center'. | |
| coordinateMode | 'global'|'relative'|'none' | 'relative' | Sets the coordinate system for the popup. |
| anchor | string|HTMLElement | Specifies the relative position where the popup will open. Default is body. | |
| anchorAlign | AnchorAlign | Specifies the alignment direction relative to the anchor. Possible values: 'left top', 'left center', 'left bottom', 'right top', 'right center', 'right bottom', 'center'. | |
| offsetX | number | 0 | Changes the popup's X position (in pixels). |
| offsetY | number | 0 | Changes the popup's Y position (in pixels). |
| lockOutside | boolean | false | Prevents the content from extending beyond the viewport area. |
| alwaysOnTop | boolean | false | Places the popup at the highest z-index position. |
| priority | number | 0 | Defines the z-index priority when multiple popups are open. |
| nest | boolean | true | Manages nested popup structures. |
| autoFocus | boolean | true | Automatically sets focus to the content when the popup opens. |
| focusTarget | string|HTMLElement | The element that will receive focus when autoFocus is true. | |
| hitAreas | Array<HTMLElement> | [] | Sets valid areas to prevent auto-closing when clicking outside. |
| closeOnOutsideDown | boolean | false | Closes the popup when clicking outside. |
| closeOnEscape | boolean | false | Closes the popup when ESC key is pressed. |
| closeOnEvents | Array<string> | ['close'] | Closes the popup when specific events occur. |
| openDelay | number | 0 | Delay time when opening the popup (ms). |
| closeDelay | number | 0 | Delay time when closing the popup (ms). |
| openOnTrigger | AnchorTrigger | Automatically opens the popup when 'click' or 'over' events occur on the anchor element. |
Methods
| Method | Parameters | Description |
|---|---|---|
| open | data?: any | Opens the popup. Used as an argument for opening and opened callback functions. |
| close | reason?: any | Closes the popup. Used as an argument for closing and closed callback functions. |
| opening | (callback: (content: HTMLElement, data: any) => void) => PopupMethods | Called before the popup opens. |
| opened | (callback: (content: HTMLElement, data: any) => void) => PopupMethods | Called after the popup is fully opened. The data from the open method becomes the argument for the callback function. |
| closing | (callback: (reason: any) => void) => PopupMethods | Called just before the popup closes. The data from the close method becomes the reason value. |
| closed | (callback: (reason: any) => void) => PopupMethods | Called when the popup closes. The data from the close method becomes the reason value. |
| toggle | data?: any | Toggles the popup's open/close state. |
| invalidate | Refreshes the popup's position. | |
| destroy | Removes all components associated with this instance. |
Events
| Event | Type | Description |
|---|---|---|
| open | (event: Event) => void | Called when the popup opens. |
| close | (event: Event) => void | Called when the popup closes. |
| cancel-open | (event: Event) => void | Called when opening the popup is cancelled. |
| cancel-close | (event: Event) => void | Called when closing the popup is cancelled. |