@anguless/angulux/dialog
Dialog
import
import { DialogModule } from '@anguless/angulux/dialog';Basic
Visibility is controlled by the visible property and its visibleChange output.
<agl-button label="Show" (onClick)="visible.set(true)" /><agl-dialog header="Edit Profile" [visible]="visible()" (visibleChange)="visible.set($event)" [style]="{ width: '25rem' }"> <p>Update your information and click Save when you are done.</p></agl-dialog>Modal
A modal dialog blocks the page behind it and traps focus until it closes.
<agl-button label="Show modal" (onClick)="visible.set(true)" /><agl-dialog header="Confirm" [visible]="visible()" (visibleChange)="visible.set($event)" [modal]="true" [style]="{ width: '25rem' }"> <p>A modal dialog blocks the page behind it and traps focus until it closes.</p> <ng-template #footer> <agl-button label="Cancel" severity="secondary" [outlined]="true" (onClick)="visible.set(false)" /> <agl-button label="Confirm" (onClick)="visible.set(false)" /> </ng-template></agl-dialog>Maximizable
Maximizable adds a header control that expands the dialog to the full viewport.
<agl-button label="Show maximizable" (onClick)="visible.set(true)" /><agl-dialog header="Report" [visible]="visible()" (visibleChange)="visible.set($event)" [modal]="true" [maximizable]="true" [style]="{ width: '30rem' }"> <p>Maximizable adds a control to the header that expands the dialog to the full viewport and back.</p></agl-dialog>API
Generated from the committed corpus, which check:corpus holds to the built library.
Dialog
componentagl-dialogDialog is a container to display content in an overlay window.
| Input | Type | Default | Description |
|---|---|---|---|
| host | string | not documented | |
| header | string | undefined | not documented | Title text of the dialog. |
| draggable | boolean | not documented | Enables dragging to change the position using header. Accessibility, a known limit: the dialog moves with the pointer only, and no key moves it. Everything inside it works from the keyboard, and nothing depends on where it sits, so a keyboard user loses a convenience, not a function. |
| resizable | boolean | not documented | Enables resizing of the content. Accessibility, a known limit: the dialog resizes with the pointer only, and no key resizes it. Give it a size that fits its content; `maximizable` adds a button, which the keyboard reaches, that makes it fill the viewport. |
| content | any | not documented | Style of the content section. |
| content | string | undefined | not documented | Style class of the content. |
| modal | boolean | not documented | Defines if background should be blocked when dialog is displayed. |
| close | boolean | not documented | Specifies if pressing escape key should hide the dialog. |
| dismissable | boolean | not documented | Specifies if clicking the modal background should hide the dialog. |
| rtl | boolean | not documented | When enabled dialog is displayed in RTL direction. |
| closable | boolean | not documented | Adds a close icon to the header to hide the dialog. |
| breakpoints | any | not documented | Object literal to define widths per screen size. |
| style | string | undefined | not documented | Style class of the component. |
| mask | string | undefined | not documented | Style class of the mask. |
| mask | { [klass: string]: any } | null | undefined | not documented | Style of the mask. |
| show | boolean | not documented | Whether to show the header or not. |
| block | boolean | not documented | Whether background scroll should be blocked when dialog is visible. |
| auto | boolean | not documented | Whether to automatically manage layering. |
| base | number | not documented | Base zIndex value to use in layering. |
| min | number | not documented | Minimum value for the left coordinate of dialog in dragging. |
| min | number | not documented | Minimum value for the top coordinate of dialog in dragging. |
| focus | boolean | not documented | When enabled, focus moves into the dialog on show: to the `initialFocus` target, else an element marked `autofocus` in the content, else the first focusable element. |
| initial | string | undefined | not documented | Names the element that receives focus when the dialog opens: a CSS selector matched inside the dialog. Use it when the first field is not the one to type into, or when a lint rule forbids the `autofocus` attribute. Applies with `focusOnShow`. |
| maximizable | boolean | not documented | Whether the dialog can be displayed full screen. |
| keep | boolean | not documented | Keeps dialog in the viewport. |
| focus | boolean | not documented | When enabled, can only focus on elements inside the dialog. |
| transition deprecated — since v21.0.0. Use `motionOptions` instead. | string | not documented | Transition options of the animation. |
| mask | MotionOptions | undefined | not documented | The motion options for the mask. |
| motion | MotionOptions | undefined | not documented | The motion options. |
| close | string | undefined | not documented | Name of the close icon. |
| close | string | undefined | not documented | Defines a string that labels the close button for accessibility. |
| close | string | not documented | Index of the close button in tabbing order. |
| minimize | string | undefined | not documented | Name of the minimize icon. |
| maximize | string | undefined | not documented | Name of the maximize icon. |
| close | ButtonProps | not documented | Used to pass all properties of the ButtonProps to the Button component. |
| maximize | ButtonProps | not documented | Used to pass all properties of the ButtonProps to the Button component. |
| visible | boolean | not documented | Specifies the visibility of the dialog. |
| style | any | not documented | Inline style of the component. |
| position | 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright' | not documented | Position of the dialog. |
| role | string | not documented | Role attribute of html element. |
| append | HTMLElement | ElementRef | TemplateRef<any> | 'self' | 'body' | null | undefined | any | 'self' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
| content property header | TemplateRef<void> | undefined | not documented | Header template. |
| content | TemplateRef<void> | undefined | not documented | Content template. |
| footer | TemplateRef<void> | undefined | not documented | Footer template. |
| close | TemplateRef<void> | undefined | not documented | Close icon template. |
| maximize | TemplateRef<void> | undefined | not documented | Maximize icon template. |
| minimize | TemplateRef<void> | undefined | not documented | Minimize icon template. |
| headless | TemplateRef<void> | undefined | not documented | Headless template. |
| Output | Type | Description |
|---|---|---|
| on | EventEmitter<any> | Callback to invoke when dialog is shown. |
| on | EventEmitter<any> | Callback to invoke when dialog is hidden. |
| visible | EventEmitter<boolean> | This EventEmitter is used to notify changes in the visibility state of a component. |
| on | EventEmitter<MouseEvent> | Callback to invoke when dialog resizing is initiated. |
| on | EventEmitter<MouseEvent> | Callback to invoke when dialog resizing is completed. |
| on | EventEmitter<DragEvent> | Callback to invoke when dialog dragging is completed. |
| on | EventEmitter<any> | Callback to invoke when dialog maximized or unmaximized. |
| Template slot | Description |
|---|---|
| <ng-template #header> | Custom header template. |
| <ng-template #content> | Custom content template. |
| <ng-template #footer> | Custom footer template. |
| <ng-template #closeicon> | Custom close icon template. |
| <ng-template #maximizeicon> | Custom maximize icon template. |
| <ng-template #minimizeicon> | Custom minimize icon template. |
| <ng-template #headless> | Custom headless template. |
Inherited from BaseComponent
inherited| Input | Type | Default | Description |
|---|---|---|---|
| dt | Object | undefined | undefined | Defines scoped design tokens of the component. |
| unstyled | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| pt | PT | undefined | undefined | Used to pass attributes to DOM elements inside the component. Keys become attributes, and a key that names a DOM property is also assigned to that property. Values the browser would execute go through Angular's sanitizer first, as in a template binding: markup in `innerHTML`, `outerHTML` and `srcdoc`, and URLs in `href`, `src`, `action`, `formaction` and `xlink:href`. To write one of those unsanitized on purpose, pass a `DomSanitizer.bypassSecurityTrustHtml` or `bypassSecurityTrustUrl` value. An `on*` key must be a function, and any other value for it is ignored. Keys themselves are applied as given, so let data from users choose values, never keys. |
| pt | PassThroughOptions | undefined | undefined | Used to configure passthrough(pt) options of the component. |