@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
1 lines • 11.9 kB
Source Map (JSON)
{"version":3,"file":"synergy-design-system-angular-components-dialog.mjs","sources":["../../components/dialog/dialog.component.ts","../../components/dialog/synergy-design-system-angular-components-dialog.ts"],"sourcesContent":["// ---------------------------------------------------------------------\n// 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components\n// Please do not edit this file directly!\n// It will get recreated when running pnpm build.\n// ---------------------------------------------------------------------\nimport {\n Component,\n ElementRef,\n NgZone,\n Input,\n Output,\n EventEmitter,\n AfterContentInit,\n} from '@angular/core';\nimport type { SynDialog } from '@synergy-design-system/components';\nimport type { SynShowEvent } from '@synergy-design-system/components';\nimport type { SynAfterShowEvent } from '@synergy-design-system/components';\nimport type { SynHideEvent } from '@synergy-design-system/components';\nimport type { SynAfterHideEvent } from '@synergy-design-system/components';\nimport type { SynInitialFocusEvent } from '@synergy-design-system/components';\nimport type { SynRequestCloseEvent } from '@synergy-design-system/components';\nimport '@synergy-design-system/components/components/dialog/dialog.js';\n\n/**\n * @summary Dialogs, sometimes called \"modals\", appear above the page and require the user's immediate attention.\n * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-dialog--docs\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon-button\n *\n * @slot - The dialog's main content.\n * @slot label - The dialog's label. Alternatively, you can use the `label` attribute.\n * @slot header-actions - Optional actions to add to the header. Works best with `<syn-icon-button>`.\n * @slot footer - The dialog's footer, usually one or more buttons representing various options.\n *\n * @event syn-show - Emitted when the dialog opens.\n * @event syn-after-show - Emitted after the dialog opens and all animations are complete.\n * @event syn-hide - Emitted when the dialog closes.\n * @event syn-after-hide - Emitted after the dialog closes and all animations are complete.\n * @event syn-initial-focus - Emitted when the dialog opens and is ready to receive focus. Calling\n * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} syn-request-close - Emitted when the user attempts to\n * close the dialog by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the dialog open. Avoid using this unless closing the dialog will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - The component's base wrapper.\n * @csspart overlay - The overlay that covers the screen behind the dialog.\n * @csspart panel - The dialog's panel (where the dialog and its content are rendered).\n * @csspart header - The dialog's header. This element wraps the title and header actions.\n * @csspart header-actions - Optional actions to add to the header. Works best with `<syn-icon-button>`.\n * @csspart title - The dialog's title.\n * @csspart close-button - The close button, an `<syn-icon-button>`.\n * @csspart close-button__base - The close button's exported `base` part.\n * @csspart body - The dialog's body.\n * @csspart footer - The dialog's footer.\n *\n * @cssproperty --width - The preferred width of the dialog. Note that the dialog will shrink to accommodate smaller screens.\n * @cssproperty --header-spacing - The amount of padding to use for the header.\n * @cssproperty --body-spacing - The amount of padding to use for the body.\n * @cssproperty --footer-spacing - The amount of padding to use for the footer.\n *\n * @animation dialog.show - The animation to use when showing the dialog.\n * @animation dialog.hide - The animation to use when hiding the dialog.\n * @animation dialog.denyClose - The animation to use when a request to close the dialog is denied.\n * @animation dialog.overlay.show - The animation to use when showing the dialog's overlay.\n * @animation dialog.overlay.hide - The animation to use when hiding the dialog's overlay.\n *\n * @property modal - Exposes the internal modal utility that controls focus trapping. To temporarily disable focus\n * trapping and allow third-party modals spawned from an active Synergy modal, call `modal.activateExternal()` when\n * the third-party modal opens. Upon closing, call `modal.deactivateExternal()` to restore Synergy's focus trapping.\n */\n@Component({\n selector: 'syn-dialog',\n standalone: true,\n template: '<ng-content></ng-content>',\n})\nexport class SynDialogComponent {\n public nativeElement: SynDialog;\n private _ngZone: NgZone;\n\n constructor(e: ElementRef, ngZone: NgZone) {\n this.nativeElement = e.nativeElement;\n this._ngZone = ngZone;\n this.nativeElement.addEventListener('syn-show', (e: SynShowEvent) => {\n this.synShowEvent.emit(e);\n });\n this.nativeElement.addEventListener(\n 'syn-after-show',\n (e: SynAfterShowEvent) => {\n this.synAfterShowEvent.emit(e);\n },\n );\n this.nativeElement.addEventListener('syn-hide', (e: SynHideEvent) => {\n this.synHideEvent.emit(e);\n });\n this.nativeElement.addEventListener(\n 'syn-after-hide',\n (e: SynAfterHideEvent) => {\n this.synAfterHideEvent.emit(e);\n },\n );\n this.nativeElement.addEventListener(\n 'syn-initial-focus',\n (e: SynInitialFocusEvent) => {\n this.synInitialFocusEvent.emit(e);\n },\n );\n this.nativeElement.addEventListener(\n 'syn-request-close',\n (e: SynRequestCloseEvent) => {\n this.synRequestCloseEvent.emit(e);\n },\n );\n }\n\n /**\n* Indicates whether or not the dialog is open.\n* You can toggle this attribute to show and hide the dialog, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.\n */\n @Input()\n set open(v: '' | SynDialog['open']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.open = v === '' || v),\n );\n }\n get open(): SynDialog['open'] {\n return this.nativeElement.open;\n }\n\n /**\n* The dialog's label as displayed in the header.\n* You should always include a relevant label even when using\n`no-header`, as it is required for proper accessibility.\n* If you need to display HTML, use the `label` slot instead.\n */\n @Input()\n set label(v: SynDialog['label']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.label = v));\n }\n get label(): SynDialog['label'] {\n return this.nativeElement.label;\n }\n\n /**\n* Disables the header.\n* This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the dialog.\n */\n @Input()\n set noHeader(v: '' | SynDialog['noHeader']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.noHeader = v === '' || v),\n );\n }\n get noHeader(): SynDialog['noHeader'] {\n return this.nativeElement.noHeader;\n }\n\n /**\n * Emitted when the dialog opens.\n */\n @Output() synShowEvent = new EventEmitter<SynShowEvent>();\n\n /**\n * Emitted after the dialog opens and all animations are complete.\n */\n @Output() synAfterShowEvent = new EventEmitter<SynAfterShowEvent>();\n\n /**\n * Emitted when the dialog closes.\n */\n @Output() synHideEvent = new EventEmitter<SynHideEvent>();\n\n /**\n * Emitted after the dialog closes and all animations are complete.\n */\n @Output() synAfterHideEvent = new EventEmitter<SynAfterHideEvent>();\n\n /**\n * Emitted when the dialog opens and is ready to receive focus.\n * Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n */\n @Output() synInitialFocusEvent = new EventEmitter<SynInitialFocusEvent>();\n\n /**\n * Emitted when the user attempts to close the dialog by clicking the close button, clicking the overlay, or pressing escape.\n * Calling `event.preventDefault()` will keep the dialog open.\n * Avoid using this unless closing the dialog will result in destructive behavior such as data loss.\n */\n @Output() synRequestCloseEvent = new EventEmitter<SynRequestCloseEvent>();\n}\n\nexport type { SynShowEvent } from '@synergy-design-system/components';\nexport type { SynAfterShowEvent } from '@synergy-design-system/components';\nexport type { SynHideEvent } from '@synergy-design-system/components';\nexport type { SynAfterHideEvent } from '@synergy-design-system/components';\nexport type { SynInitialFocusEvent } from '@synergy-design-system/components';\nexport type { SynRequestCloseEvent } from '@synergy-design-system/components';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './dialog.component';\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDG;MAMU,kBAAkB,CAAA;AACtB,IAAA,aAAa;AACZ,IAAA,OAAO;IAEf,WAAY,CAAA,CAAa,EAAE,MAAc,EAAA;AACvC,QAAA,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,aAAa;AACpC,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM;QACrB,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAe,KAAI;AAClE,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3B,SAAC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,gBAAgB,CACjC,gBAAgB,EAChB,CAAC,CAAoB,KAAI;AACvB,YAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,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