DialogUI
Description
Initializes the dialog UI with an overlay container, RTL layout flag, and an optional HTML sanitizer, then installs the DOM structure.
Methods
destroyDialog
dialogUI.destroyDialog()
Removes the dialog UI elements from the DOM and clears the refs.
focusDialog
dialogUI.focusDialog()
Focuses the dialog element.
getContainer
dialogUI.getContainer() ⇒ HTMLElement
Returns the dialog element.
Returns: HTMLElement - The dialog element.
getFocusableElements
dialogUI.getFocusableElements() ⇒ Array<HTMLElement>
Gets the focusable elements.
Returns: Array<HTMLElement> - The focusable elements.
hideDialog
dialogUI.hideDialog(animation) ⇒ DialogUI
Hides the dialog with optional animation.
| Param | Type | Description |
|---|---|---|
| animation | boolean | Whether to add the animation class to the dialog. |
Returns: DialogUI - The instance of the DialogUI.
install
dialogUI.install()
Creates the dialog UI elements and sets up the structure.
showDialog
dialogUI.showDialog(animation) ⇒ DialogUI
Shows the dialog with optional animation.
| Param | Type | Description |
|---|---|---|
| animation | boolean | Whether to add the animation class to the dialog. |
Returns: DialogUI - The instance of the DialogUI.
updateDialog
dialogUI.updateDialog(options) ⇒ DialogUI
Updates the dialog content and class name.
| Param | Type | Description |
|---|---|---|
| options | object | Class name update options. |
| options.isVisible | boolean | Whether the dialog is visible. |
| options.content | string HTMLElement | The content to render in the dialog. |
| options.customClassName | string | The custom class name to add to the dialog. |
| options.background | string | The background to add to the dialog. |
| options.contentBackground | boolean | Whether to show content background. |
| options.animation | boolean | Whether to add the animation class to the dialog. |
| options.a11y | object | The accessibility options for the dialog. |
Returns: DialogUI - The instance of the DialogUI.
updateWidth
dialogUI.updateWidth(width) ⇒ DialogUI
Updates the width of the dialog container to the same size as the table.
| Param | Type | Description |
|---|---|---|
| width | number | The width of the table. |
Returns: DialogUI - The instance of the DialogUI.
useDefaultTemplate
dialogUI.useDefaultTemplate()
Uses the default template for the dialog for the content option.
useTemplate
dialogUI.useTemplate(templateName, templateVars)
Uses the specified template for the dialog.
| Param | Type | Description |
|---|---|---|
| templateName | string | The name of the template to use. |
| templateVars | object | The variables to use for the template. |