UNPKG

@synergy-design-system/angular

Version:
147 lines (143 loc) 5.92 kB
import * as i0 from '@angular/core'; import { EventEmitter, Output, Input, Component } from '@angular/core'; import '@synergy-design-system/components/components/alert/alert.js'; // --------------------------------------------------------------------- // 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components // Please do not edit this file directly! // It will get recreated when running pnpm build. // --------------------------------------------------------------------- /** * @summary Alerts are used to display important messages inline or as toast notifications. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-alert--docs * @status stable * @since 2.0 * * @dependency syn-icon-button * * @slot - The alert's main content. * @slot icon - An icon to show in the alert. Works best with `<syn-icon>`. * * @event syn-show - Emitted when the alert opens. * @event syn-after-show - Emitted after the alert opens and all animations are complete. * @event syn-hide - Emitted when the alert closes. * @event syn-after-hide - Emitted after the alert closes and all animations are complete. * * @csspart base - The component's base wrapper. * @csspart icon - The container that wraps the optional icon. * @csspart message - The container that wraps the alert's main content. * @csspart close-button - The close button, an `<syn-icon-button>`. * @csspart close-button__base - The close button's exported `base` part. * * @animation alert.show - The animation to use when showing the alert. * @animation alert.hide - The animation to use when hiding the alert. */ class SynAlertComponent { nativeElement; _ngZone; constructor(e, ngZone) { this.nativeElement = e.nativeElement; this._ngZone = ngZone; this.nativeElement.addEventListener('syn-show', (e) => { this.synShowEvent.emit(e); }); this.nativeElement.addEventListener('syn-after-show', (e) => { this.synAfterShowEvent.emit(e); }); this.nativeElement.addEventListener('syn-hide', (e) => { this.synHideEvent.emit(e); }); this.nativeElement.addEventListener('syn-after-hide', (e) => { this.synAfterHideEvent.emit(e); }); } /** * Indicates whether or not the alert is open. * You can toggle this attribute to show and hide the alert, or you can use the `show()` and `hide()` methods and this attribute will reflect the alert's open state. */ set open(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.open = v === '' || v)); } get open() { return this.nativeElement.open; } /** * Enables a close button that allows the user to dismiss the alert. */ set closable(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.closable = v === '' || v)); } get closable() { return this.nativeElement.closable; } /** * The alert's theme variant. */ set variant(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.variant = v)); } get variant() { return this.nativeElement.variant; } /** * The length of time, in milliseconds, the alert will show before closing itself. * If the user interacts with the alert before it closes (e.g. * moves the mouse over it), the timer will restart. * Defaults to `Infinity`, meaning the alert will not close on its own. */ set duration(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.duration = v)); } get duration() { return this.nativeElement.duration; } /** * Emitted when the alert opens. */ synShowEvent = new EventEmitter(); /** * Emitted after the alert opens and all animations are complete. */ synAfterShowEvent = new EventEmitter(); /** * Emitted when the alert closes. */ synHideEvent = new EventEmitter(); /** * Emitted after the alert closes and all animations are complete. */ synAfterHideEvent = new EventEmitter(); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynAlertComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynAlertComponent, isStandalone: true, selector: "syn-alert", inputs: { open: "open", closable: "closable", variant: "variant", duration: "duration" }, outputs: { synShowEvent: "synShowEvent", synAfterShowEvent: "synAfterShowEvent", synHideEvent: "synHideEvent", synAfterHideEvent: "synAfterHideEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynAlertComponent, decorators: [{ type: Component, args: [{ selector: 'syn-alert', standalone: true, template: '<ng-content></ng-content>', }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { open: [{ type: Input }], closable: [{ type: Input }], variant: [{ type: Input }], duration: [{ type: Input }], synShowEvent: [{ type: Output }], synAfterShowEvent: [{ type: Output }], synHideEvent: [{ type: Output }], synAfterHideEvent: [{ type: Output }] } }); /** * Generated bundle index. Do not edit. */ export { SynAlertComponent }; //# sourceMappingURL=synergy-design-system-angular-components-alert.mjs.map