{"version":3,"file":"igniteui-angular-snackbar.mjs","names":[],"sources":["../../../projects/igniteui-angular/snackbar/src/snackbar/snackbar.component.ts","../../../projects/igniteui-angular/snackbar/src/snackbar/snackbar.component.html","../../../projects/igniteui-angular/snackbar/src/snackbar/snackbar.module.ts"],"sourcesContent":["import { useAnimation } from '@angular/animations';\nimport {\n    Component,\n    EventEmitter,\n    HostBinding,\n    Input,\n    OnInit,\n    Output,\n    ChangeDetectionStrategy,\n    ViewEncapsulation\n} from '@angular/core';\nimport { takeUntil } from 'rxjs/operators';\nimport { ContainerPositionStrategy, GlobalPositionStrategy, HorizontalAlignment,\n    PositionSettings, VerticalAlignment } from 'igniteui-angular/core';\nimport { ToggleViewEventArgs, IgxButtonDirective, IgxNotificationsDirective } from 'igniteui-angular/directives';\nimport { fadeIn, fadeOut } from 'igniteui-angular/animations';\n\nlet NEXT_ID = 0;\n/**\n * **Ignite UI for Angular Snackbar** -\n * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/snackbar.html)\n *\n * The Ignite UI Snack Bar provides feedback about an operation with a single-line message, which can\n * include a link to an action such as Undo.\n *\n * Example:\n * ```html\n * <button type=\"button\" igxButton (click)=\"snackbar.show()\">Send message</button>\n * <div>\n *   <igx-snackbar #snackbar>\n *      Message sent\n *   </igx-snackbar>\n * </div>\n * ```\n */\n@Component({\n    selector: 'igx-snackbar',\n    templateUrl: 'snackbar.component.html',\n    styleUrl: 'snackbar.component.css',\n    encapsulation: ViewEncapsulation.None,\n    changeDetection: ChangeDetectionStrategy.Eager,\n    imports: [IgxButtonDirective]\n})\nexport class IgxSnackbarComponent extends IgxNotificationsDirective\n    implements OnInit {\n    /**\n     * Sets/gets the `id` of the snackbar.\n     * If not set, the `id` of the first snackbar component  will be `\"igx-snackbar-0\"`;\n     * ```html\n     * <igx-snackbar id = \"Snackbar1\"></igx-snackbar>\n     * ```\n     * ```typescript\n     * let snackbarId = this.snackbar.id;\n     * ```\n     *\n     * @memberof IgxSnackbarComponent\n     */\n    @HostBinding('attr.id')\n    @Input()\n    public override id = `igx-snackbar-${NEXT_ID++}`;\n\n    /**\n     * The default css class applied to the component.\n     *\n     * @hidden\n     * @internal\n     */\n    @HostBinding('class.igx-snackbar')\n    public cssClass = 'igx-snackbar';\n\n    /**\n     * Sets/gets the `actionText` attribute.\n     * ```html\n     * <igx-snackbar [actionText] = \"'Action Text'\"></igx-snackbar>\n     * ```\n     */\n    @Input() public actionText?: string;\n\n    /**\n     * An event that will be emitted when the action button is clicked.\n     * Provides reference to the snackbar as an argument.\n     * ```html\n     * <igx-snackbar (clicked)=\"clickedHandler($event)\"></igx-snackbar>\n     * ```\n     */\n    @Output()\n    public clicked = new EventEmitter<IgxSnackbarComponent>();\n\n    /**\n     * An event that will be emitted when the snackbar animation starts.\n     * Provides reference to the `ToggleViewEventArgs` interface as an argument.\n     * ```html\n     * <igx-snackbar (animationStarted) = \"animationStarted($event)\"></igx-snackbar>\n     * ```\n     */\n    @Output() public animationStarted = new EventEmitter<ToggleViewEventArgs>();\n\n    /**\n     * An event that will be emitted when the snackbar animation ends.\n     * Provides reference to the `ToggleViewEventArgs` interface as an argument.\n     * ```html\n     * <igx-snackbar (animationDone) = \"animationDone($event)\"></igx-snackbar>\n     * ```\n     */\n    @Output() public animationDone = new EventEmitter<ToggleViewEventArgs>();\n\n    /**\n     * Get the position and animation settings used by the snackbar.\n     * ```typescript\n     * @ViewChild('snackbar', { static: true }) public snackbar: IgxSnackbarComponent;\n     * let currentPosition: PositionSettings = this.snackbar.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 snackbar.\n     * ```html\n     * <igx-snackbar [positionSettings]=\"newPositionSettings\"></igx-snackbar>\n     * ```\n     * ```typescript\n     * import { slideInTop, slideOutBottom } from 'igniteui-angular';\n     * ...\n     * @ViewChild('snackbar', { static: true }) public snackbar: IgxSnackbarComponent;\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     *      minSize: { height: 100, width: 100 }\n     *  };\n     * this.snackbar.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, { params: { duration: '.35s', easing: 'cubic-bezier(0.0, 0.0, 0.2, 1)',\n            fromPosition: 'translateY(100%)', toPosition: 'translateY(0)'} }),\n        closeAnimation: useAnimation(fadeOut, {  params: { duration: '.2s', easing: 'cubic-bezier(0.4, 0.0, 1, 1)',\n            fromPosition: 'translateY(0)', toPosition: 'translateY(100%)'} }),\n    };\n\n    /**\n     * Shows the snackbar and hides it after the `displayTime` is over if `autoHide` is set to `true`.\n     * ```typescript\n     * this.snackbar.open();\n     * ```\n     */\n    public override open(message?: string) {\n        if (message !== undefined) {\n            this.textMessage = message;\n        }\n\n        this.strategy = this.outlet || this.positioning === 'container' ?\n            new ContainerPositionStrategy(this.positionSettings) :\n            new GlobalPositionStrategy(this.positionSettings);\n        super.open();\n    }\n\n    /**\n     * Opens or closes the snackbar, depending on its current state.\n     *\n     * ```typescript\n     * this.snackbar.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 triggerAction(): void {\n        this.clicked.emit(this);\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.animationStarted.emit(openedEventArgs);\n        });\n\n        this.closed.pipe(takeUntil(this.destroy$)).subscribe(() => {\n            const closedEventArgs: ToggleViewEventArgs = { owner: this, id: this._overlayId };\n            this.animationDone.emit(closedEventArgs);\n        });\n    }\n}\n","<div class=\"igx-snackbar__message\" data-no-typography>\n    {{ textMessage }}\n    <ng-content></ng-content>\n</div>\n<div #customButton class=\"igx-snackbar__button\">\n    <ng-content select=\"[igxButton]\"></ng-content>\n</div>\n@if (!customButton.children.length && actionText) {\n    <button type=\"button\" igxButton (click)=\"triggerAction()\">\n        {{ actionText }}\n    </button>\n}\n","import { NgModule } from '@angular/core';\nimport { IgxSnackbarComponent } from './snackbar.component';\n\n/**\n * @hidden\n * @deprecated\n * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components\n */\n@NgModule({\n    imports: [\n        IgxSnackbarComponent\n    ],\n    exports: [\n        IgxSnackbarComponent\n    ]\n})\nexport class IgxSnackbarModule { }\n"],"mappings":";;;;;;;AAiBA,IAAI,UAAU;AA0Bd,IAAa,uBAAb,MAAa,6BAA6B,0BAAyB;CARnE,cAAA;;EAwBoB,KAAA,KAAK,gBAAgB;EAS9B,KAAA,WAAW;EAkBX,KAAA,UAAU,IAAI,aAAY;EAShB,KAAA,mBAAmB,IAAI,aAAY;EASnC,KAAA,gBAAgB,IAAI,aAAY;EAuCzC,KAAA,oBAAsC;GAC1C,qBAAqB,oBAAoB;GACzC,mBAAmB,kBAAkB;GACrC,eAAe,aAAa,QAAQ,EAAE,QAAQ;IAAE,UAAU;IAAQ,QAAQ;IACtE,cAAc;IAAoB,YAAY;GAAe,EAAC,CAAE;GACpE,gBAAgB,aAAa,SAAS,EAAG,QAAQ;IAAE,UAAU;IAAO,QAAQ;IACxE,cAAc;IAAiB,YAAY;GAAkB,EAAC,CAAE;EACvE;CAuDJ;CA5FG,IACW,mBAA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