{"version":3,"file":"igniteui-angular-toast.mjs","names":[],"sources":["../../../projects/igniteui-angular/toast/src/toast/toast.component.ts","../../../projects/igniteui-angular/toast/src/toast/toast.component.html","../../../projects/igniteui-angular/toast/src/toast/toast.module.ts"],"sourcesContent":["import {\n    Component,\n    ElementRef,\n    EventEmitter,\n    HostBinding,\n    Input,\n    OnInit,\n    Output,\n    inject,\n    ChangeDetectionStrategy,\n    ViewEncapsulation,\n} from '@angular/core';\nimport { takeUntil } from 'rxjs/operators';\nimport {\n    HorizontalAlignment,\n    VerticalAlignment,\n    GlobalPositionStrategy,\n    PositionSettings\n} from 'igniteui-angular/core';\nimport { IgxNotificationsDirective, IgxNoTypographyDirective } from 'igniteui-angular/directives';\nimport { ToggleViewEventArgs } from 'igniteui-angular/directives';\nimport { useAnimation } from '@angular/animations';\nimport { fadeIn, fadeOut } from 'igniteui-angular/animations';\n\nlet NEXT_ID = 0;\n\n/**\n * **Ignite UI for Angular Toast** -\n * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/toast)\n *\n * The Ignite UI Toast provides information and warning messages that are non-interactive and cannot\n * be dismissed by the user. Toasts can be displayed at the bottom, middle, or top of the page.\n *\n * Example:\n * ```html\n * <button type=\"button\" igxButton (click)=\"toast.open()\">Show notification</button>\n * <igx-toast #toast displayTime=\"1000\">\n *      Notification displayed\n * </igx-toast>\n * ```\n */\n@Component({\n    selector: 'igx-toast',\n    templateUrl: 'toast.component.html',\n    styleUrl: 'toast.component.css',\n    encapsulation: ViewEncapsulation.None,\n    changeDetection: ChangeDetectionStrategy.Eager,\n    standalone: true,\n    hostDirectives: [IgxNoTypographyDirective]\n})\nexport class IgxToastComponent extends IgxNotificationsDirective implements OnInit {\n    private _element = inject(ElementRef);\n\n    /**\n     * @hidden\n     */\n    @HostBinding('class.igx-toast')\n    public cssClass = 'igx-toast';\n\n    /**\n     * Sets/gets the `id` of the toast.\n     * If not set, the `id` will have value `\"igx-toast-0\"`.\n     * ```html\n     * <igx-toast id = \"my-first-toast\"></igx-toast>\n     * ```\n     * ```typescript\n     * let toastId = this.toast.id;\n     * ```\n     */\n    @HostBinding('attr.id')\n    @Input()\n    public override id = `igx-toast-${NEXT_ID++}`;\n\n    /**\n     * Sets/gets the `role` attribute.\n     * If not set, `role` will have value `\"alert\"`.\n     * ```html\n     * <igx-toast [role] = \"'notify'\"></igx-toast>\n     * ```\n     * ```typescript\n     * let toastRole = this.toast.role;\n     * ```\n     *\n     * @memberof IgxToastComponent\n     */\n    @HostBinding('attr.role')\n    @Input()\n    public role = 'alert';\n\n    /**\n     * @hidden\n     */\n    @Output()\n    public isVisibleChange = new EventEmitter<ToggleViewEventArgs>();\n\n    /**\n     * Get the position and animation settings used by the toast.\n     * ```typescript\n     * @ViewChild('toast', { static: true }) public toast: IgxToastComponent;\n     * let currentPosition: PositionSettings = this.toast.positionSettings\n     * ```\n     */\n     @Input()\n     public get positionSettings(): PositionSettings {\n         return this._positionSettings;\n     }\n\n     /**\n      * Set the position and animation settings used by the toast.\n      * ```html\n      * <igx-toast [positionSettings]=\"newPositionSettings\"></igx-toast>\n      * ```\n      * ```typescript\n      * import { slideInTop, slideOutBottom } from 'igniteui-angular';\n      * ...\n      * @ViewChild('toast', { static: true }) public toast: IgxToastComponent;\n      *  public newPositionSettings: PositionSettings = {\n      *      openAnimation: useAnimation(slideInTop, { params: { duration: '1000ms', fromPosition: 'translateY(100%)'}}),\n      *      closeAnimation: useAnimation(slideOutBottom, { params: { duration: '1000ms', fromPosition: 'translateY(0)'}}),\n      *      horizontalDirection: HorizontalAlignment.Left,\n      *      verticalDirection: VerticalAlignment.Middle,\n      *      horizontalStartPoint: HorizontalAlignment.Left,\n      *      verticalStartPoint: VerticalAlignment.Middle\n      *  };\n      * this.toast.positionSettings = this.newPositionSettings;\n      * ```\n      */\n     public set positionSettings(settings: PositionSettings) {\n         this._positionSettings = settings;\n     }\n\n     private _positionSettings: PositionSettings = {\n        horizontalDirection: HorizontalAlignment.Center,\n        verticalDirection: VerticalAlignment.Bottom,\n        openAnimation: useAnimation(fadeIn),\n        closeAnimation: useAnimation(fadeOut),\n     };\n\n    /**\n     * Gets the nativeElement of the toast.\n     * ```typescript\n     * let nativeElement = this.toast.element;\n     * ```\n     *\n     * @memberof IgxToastComponent\n     */\n    public override get element() {\n        return this._element.nativeElement;\n    }\n\n    /**\n     * Shows the toast.\n     * If `autoHide` is enabled, the toast will hide after `displayTime` is over.\n     *\n     * ```typescript\n     * this.toast.open();\n     * ```\n     */\n    public override open(message?: string, settings?: PositionSettings) {\n        if (message !== undefined) {\n            this.textMessage = message;\n        }\n        if (settings !== undefined) {\n            this.positionSettings = settings;\n        }\n        this.strategy = new GlobalPositionStrategy(this.positionSettings);\n        super.open();\n    }\n\n    /**\n     * Opens or closes the toast, depending on its current state.\n     *\n     * ```typescript\n     * this.toast.toggle();\n     * ```\n     */\n     public override toggle() {\n        if (this.collapsed || this.isClosing) {\n            this.open();\n        } else {\n            this.close();\n        }\n    }\n\n    /**\n     * @hidden\n     */\n    public override ngOnInit() {\n        this.opened.pipe(takeUntil(this.destroy$)).subscribe(() => {\n            const openedEventArgs: ToggleViewEventArgs = { owner: this, id: this._overlayId };\n            this.isVisibleChange.emit(openedEventArgs);\n        });\n\n        this.closed.pipe(takeUntil(this.destroy$)).subscribe(() => {\n            const closedEventArgs: ToggleViewEventArgs = { owner: this, id: this._overlayId };\n            this.isVisibleChange.emit(closedEventArgs);\n        });\n    }\n}\n","<ng-content></ng-content>\n<span>{{ textMessage }}</span>\n\n","import { NgModule } from '@angular/core';\nimport { IgxToastComponent } from './toast.component';\n\n/**\n * @hidden\n * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components\n */\n@NgModule({\n    imports: [\n        IgxToastComponent\n    ],\n    exports: [\n        IgxToastComponent\n    ]\n})\nexport class IgxToastModule { }\n"],"mappings":";;;;;;;;AAwBA,IAAI,UAAU;AA0Bd,IAAa,oBAAb,MAAa,0BAA0B,0BAAyB;CAThE,cAAA;;EAUY,KAA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