UNPKG

@synergy-design-system/angular

Version:
1 lines 8.29 kB
{"version":3,"file":"synergy-design-system-angular-components-alert.mjs","sources":["../../components/alert/alert.component.ts","../../components/alert/synergy-design-system-angular-components-alert.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 { SynAlert } 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 '@synergy-design-system/components/components/alert/alert.js';\n\n/**\n * @summary Alerts are used to display important messages inline or as toast notifications.\n * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-alert--docs\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon-button\n *\n * @slot - The alert's main content.\n * @slot icon - An icon to show in the alert. Works best with `<syn-icon>`.\n *\n * @event syn-show - Emitted when the alert opens.\n * @event syn-after-show - Emitted after the alert opens and all animations are complete.\n * @event syn-hide - Emitted when the alert closes.\n * @event syn-after-hide - Emitted after the alert closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper.\n * @csspart icon - The container that wraps the optional icon.\n * @csspart message - The container that wraps the alert's main content.\n * @csspart close-button - The close button, an `<syn-icon-button>`.\n * @csspart close-button__base - The close button's exported `base` part.\n *\n * @animation alert.show - The animation to use when showing the alert.\n * @animation alert.hide - The animation to use when hiding the alert.\n */\n@Component({\n selector: 'syn-alert',\n standalone: true,\n template: '<ng-content></ng-content>',\n})\nexport class SynAlertComponent {\n public nativeElement: SynAlert;\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 }\n\n /**\n* Indicates whether or not the alert is open.\n* You can toggle this attribute to show and hide the alert, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the alert's open state.\n */\n @Input()\n set open(v: '' | SynAlert['open']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.open = v === '' || v),\n );\n }\n get open(): SynAlert['open'] {\n return this.nativeElement.open;\n }\n\n /**\n * Enables a close button that allows the user to dismiss the alert.\n */\n @Input()\n set closable(v: '' | SynAlert['closable']) {\n this._ngZone.runOutsideAngular(\n () => (this.nativeElement.closable = v === '' || v),\n );\n }\n get closable(): SynAlert['closable'] {\n return this.nativeElement.closable;\n }\n\n /**\n * The alert's theme variant.\n */\n @Input()\n set variant(v: SynAlert['variant']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.variant = v));\n }\n get variant(): SynAlert['variant'] {\n return this.nativeElement.variant;\n }\n\n /**\n* The length of time, in milliseconds, the alert will show before closing itself.\n* If the user interacts with\nthe alert before it closes (e.g.\n* moves the mouse over it), the timer will restart.\n* Defaults to `Infinity`, meaning\nthe alert will not close on its own.\n */\n @Input()\n set duration(v: SynAlert['duration']) {\n this._ngZone.runOutsideAngular(() => (this.nativeElement.duration = v));\n }\n get duration(): SynAlert['duration'] {\n return this.nativeElement.duration;\n }\n\n /**\n * Emitted when the alert opens.\n */\n @Output() synShowEvent = new EventEmitter<SynShowEvent>();\n\n /**\n * Emitted after the alert opens and all animations are complete.\n */\n @Output() synAfterShowEvent = new EventEmitter<SynAfterShowEvent>();\n\n /**\n * Emitted when the alert closes.\n */\n @Output() synHideEvent = new EventEmitter<SynHideEvent>();\n\n /**\n * Emitted after the alert closes and all animations are complete.\n */\n @Output() synAfterHideEvent = new EventEmitter<SynAfterHideEvent>();\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';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './alert.component';\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAMU,iBAAiB,CAAA;AACrB,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,SAAC,CACF;QACD,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;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