@villedemontreal/angular-ui 15.0.0 → 15.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { SecurityContext, Injectable, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, NgModule, Directive, EventEmitter, Output, CUSTOM_ELEMENTS_SCHEMA, ViewChild, forwardRef, InjectionToken, ContentChildren, Optional, HostListener, ContentChild, Injector, TemplateRef, SkipSelf, ViewChildren } from '@angular/core';
2
+ import { SecurityContext, Injectable, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, NgModule, Directive, EventEmitter, Output, CUSTOM_ELEMENTS_SCHEMA, ViewChild, forwardRef, InjectionToken, ContentChildren, Optional, HostListener, ContentChild, Injector, TemplateRef, SkipSelf, ViewChildren, inject } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
5
  import * as i1 from '@angular/platform-browser';
@@ -12,11 +12,14 @@ import * as i2 from '@angular/cdk/collections';
12
12
  import * as i1$4 from '@angular/cdk/overlay';
13
13
  import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
14
14
  import * as i3 from '@angular/cdk/portal';
15
- import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, PortalModule, DomPortal } from '@angular/cdk/portal';
15
+ import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, PortalModule, DomPortal, PortalInjector } from '@angular/cdk/portal';
16
16
  import { Subject, filter, take, defer, startWith } from 'rxjs';
17
17
  import { __awaiter } from 'tslib';
18
+ import * as i1$5 from '@angular/cdk/platform';
18
19
  import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
19
20
  import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
21
+ import { take as take$1 } from 'rxjs/operators';
22
+ import { trigger, state, style, transition, animate } from '@angular/animations';
20
23
 
21
24
  function baoColorToHex(baoColor) {
22
25
  switch (baoColor) {
@@ -3234,14 +3237,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
3234
3237
  }] });
3235
3238
 
3236
3239
  // Counter for unique modal ids.
3237
- let uniqueId = 0;
3240
+ let uniqueId$1 = 0;
3238
3241
  /**
3239
3242
  * Reference to a modal opened via the BaoModalService.
3240
3243
  */
3241
3244
  class BaoModalRef {
3242
3245
  constructor(_overlayRef, _containerInstance,
3243
3246
  /** Id of the modal. */
3244
- id = `bao-modal-${uniqueId++}`) {
3247
+ id = `bao-modal-${uniqueId$1++}`) {
3245
3248
  this._overlayRef = _overlayRef;
3246
3249
  this._containerInstance = _containerInstance;
3247
3250
  this.id = id;
@@ -4976,6 +4979,774 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
4976
4979
  }]
4977
4980
  }] });
4978
4981
 
4982
+ /** Injection token that can be used to access the data that was passed in to a snack bar. */
4983
+ const BAO_SNACK_BAR_DATA = new InjectionToken('BaoSnackBarData');
4984
+ /**
4985
+ * Configuration used when opening a snack-bar.
4986
+ */
4987
+ class BaoSnackBarConfig {
4988
+ constructor() {
4989
+ /** The message to display in the snackbar. */
4990
+ this.message = 'No message';
4991
+ /** The type of snackbar template to display. */
4992
+ this.toastType = 'info';
4993
+ /**
4994
+ * The attached action to the snack bar. If the name of the action matches an icon provided as part of
4995
+ * angular-ui icon dictionnary an icon will be displayed instead of text.
4996
+ * */
4997
+ this.actionLabelOrIcon = '';
4998
+ /** Displays the close button when set to true */
4999
+ this.showClose = false;
5000
+ /** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
5001
+ this.duration = 5000;
5002
+ /** The politeness level for the MatAriaLiveAnnouncer announcement. */
5003
+ this.politeness = 'assertive';
5004
+ /**
5005
+ * Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
5006
+ * component or template, the announcement message will default to the specified message.
5007
+ */
5008
+ this.announcementMessage = '';
5009
+ /** Data being injected into the child component. */
5010
+ this.data = null;
5011
+ /** The horizontal position to place the snack bar. */
5012
+ this.horizontalPosition = 'left';
5013
+ /** The vertical position to place the snack bar. */
5014
+ this.verticalPosition = 'bottom';
5015
+ }
5016
+ }
5017
+
5018
+ /** Maximum amount of milliseconds that can be passed into setTimeout. */
5019
+ const MAX_TIMEOUT = Math.pow(2, 31) - 1;
5020
+ /**
5021
+ * Reference to a snack bar dispatched from the snack bar service.
5022
+ */
5023
+ class BaoSnackBarRef {
5024
+ constructor(containerInstance, _overlayRef) {
5025
+ this._overlayRef = _overlayRef;
5026
+ /** Subject for notifying the user that the snack bar has been dismissed. */
5027
+ this._afterDismissed = new Subject();
5028
+ /** Subject for notifying the user that the snack bar has opened and appeared. */
5029
+ this._afterOpened = new Subject();
5030
+ /** Subject for notifying the user that the snack bar action was called. */
5031
+ this._onAction = new Subject();
5032
+ /** Whether the snack bar was dismissed using the action button. */
5033
+ this._dismissedByAction = false;
5034
+ this.containerInstance = containerInstance;
5035
+ // Dismiss snackbar on action.
5036
+ this.onAction().subscribe(() => this.dismiss());
5037
+ containerInstance._onExit.subscribe(() => this.finishDismiss());
5038
+ }
5039
+ /** Dismisses the snack bar. */
5040
+ dismiss() {
5041
+ if (!this._afterDismissed.closed) {
5042
+ this.containerInstance.exit();
5043
+ }
5044
+ clearTimeout(this._durationTimeoutId);
5045
+ }
5046
+ /** Marks the snackbar action clicked. */
5047
+ dismissWithAction() {
5048
+ if (!this._onAction.closed) {
5049
+ this._dismissedByAction = true;
5050
+ this._onAction.next();
5051
+ this._onAction.complete();
5052
+ }
5053
+ }
5054
+ /** Dismisses the snack bar after some duration */
5055
+ dismissAfter(duration) {
5056
+ // Note that we need to cap the duration to the maximum value for setTimeout, because
5057
+ // it'll revert to 1 if somebody passes in something greater (e.g. `Infinity`). See #17234.
5058
+ // @TODO: window.setTimeout() ?
5059
+ this._durationTimeoutId = window.setTimeout(() => this.dismiss(), Math.min(duration, MAX_TIMEOUT));
5060
+ }
5061
+ /** Marks the snackbar as opened */
5062
+ open() {
5063
+ if (!this._afterOpened.closed) {
5064
+ this._afterOpened.next();
5065
+ this._afterOpened.complete();
5066
+ }
5067
+ }
5068
+ /** Gets an observable that is notified when the snack bar is finished closing. */
5069
+ afterDismissed() {
5070
+ return this._afterDismissed;
5071
+ }
5072
+ /** Gets an observable that is notified when the snack bar has opened and appeared. */
5073
+ afterOpened() {
5074
+ return this.containerInstance._onEnter;
5075
+ }
5076
+ /** Gets an observable that is notified when the snack bar action is called. */
5077
+ onAction() {
5078
+ return this._onAction;
5079
+ }
5080
+ /** Cleans up the DOM after closing. */
5081
+ finishDismiss() {
5082
+ this._overlayRef.dispose();
5083
+ if (!this._onAction.closed) {
5084
+ this._onAction.complete();
5085
+ }
5086
+ this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });
5087
+ this._afterDismissed.complete();
5088
+ this._dismissedByAction = false;
5089
+ }
5090
+ }
5091
+
5092
+ /*
5093
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5094
+ * Licensed under the MIT license.
5095
+ * See LICENSE file in the project root for full license information.
5096
+ */
5097
+ const toastTypeToAttributes = {
5098
+ info: {
5099
+ toastClass: 'bao-snackbar-info',
5100
+ icon: 'icon-info',
5101
+ iconTitle: 'Information',
5102
+ politeness: 'assertive'
5103
+ },
5104
+ success: {
5105
+ toastClass: 'bao-snackbar-success',
5106
+ icon: 'icon-check-circle',
5107
+ iconTitle: 'Succès',
5108
+ politeness: 'polite'
5109
+ },
5110
+ danger: {
5111
+ toastClass: 'bao-snackbar-danger',
5112
+ icon: 'icon-error',
5113
+ iconTitle: 'Erreur',
5114
+ politeness: 'assertive'
5115
+ }
5116
+ };
5117
+ /**
5118
+ * A component used to open as the default snack bar, matching material spec.
5119
+ * This should only be used internally by the snack bar service.
5120
+ */
5121
+ class BaoSimpleSnackBarComponent {
5122
+ constructor(snackBarRef, data) {
5123
+ this.snackBarRef = snackBarRef;
5124
+ this.showCloseTitle = 'Fermer le message';
5125
+ this.data = data;
5126
+ }
5127
+ /** Returns the politeness */
5128
+ get politeness() {
5129
+ var _a;
5130
+ return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.politeness) ||
5131
+ toastTypeToAttributes['info'].politeness);
5132
+ }
5133
+ /** Returns the toast class */
5134
+ get toastClass() {
5135
+ var _a;
5136
+ return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.toastClass) ||
5137
+ toastTypeToAttributes['info'].toastClass);
5138
+ }
5139
+ /** Returns the toast icon */
5140
+ get toastIcon() {
5141
+ var _a;
5142
+ return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.icon) ||
5143
+ toastTypeToAttributes['info'].icon);
5144
+ }
5145
+ /** Returns the toast icon title */
5146
+ get toastIconTitle() {
5147
+ var _a;
5148
+ return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.iconTitle) ||
5149
+ toastTypeToAttributes['info'].iconTitle);
5150
+ }
5151
+ /** If the action button should be shown. */
5152
+ get hasAction() {
5153
+ return !!this.data.actionLabelOrIcon;
5154
+ }
5155
+ /** If the action is an icon */
5156
+ get isActionIcon() {
5157
+ return !!ICONS_DCT[this.data.actionLabelOrIcon];
5158
+ }
5159
+ /** Performs the action on the snack bar. */
5160
+ action() {
5161
+ this.snackBarRef.dismissWithAction();
5162
+ }
5163
+ /** Closes the snack bar. */
5164
+ close() {
5165
+ this.snackBarRef.dismiss();
5166
+ }
5167
+ }
5168
+ BaoSimpleSnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSimpleSnackBarComponent, deps: [{ token: BaoSnackBarRef }, { token: BAO_SNACK_BAR_DATA }], target: i0.ɵɵFactoryTarget.Component });
5169
+ BaoSimpleSnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.3", type: BaoSimpleSnackBarComponent, selector: "bao-simple-snack-bar", host: { classAttribute: "bao-simple-snackbar" }, ngImport: i0, template: "<div\n class=\"bao-snackbar show\"\n [ngClass]=\"toastClass\"\n [attr.aria-live]=\"politeness\"\n aria-atomic=\"true\"\n>\n <div class=\"bao-snackbar-icon\">\n <bao-icon [svgIcon]=\"toastIcon\" [title]=\"toastIconTitle\"></bao-icon>\n </div>\n <div class=\"bao-snackbar-body\">\n {{ data.message }}\n </div>\n <div class=\"bao-snackbar-action\">\n <div *ngIf=\"hasAction\">\n <button\n bao-button\n role=\"button\"\n type=\"utility\"\n level=\"tertiary\"\n [reversed]=\"true\"\n [title]=\"data.actionLabelOrIcon\"\n (click)=\"action()\"\n >\n <bao-icon\n *ngIf=\"isActionIcon; else isActionText\"\n [svgIcon]=\"data.actionLabelOrIcon\"\n [title]=\"data.actionLabelOrIcon\"\n ></bao-icon>\n <ng-template #isActionText\n ><span>{{ data.actionLabelOrIcon }}</span></ng-template\n >\n </button>\n </div>\n <div *ngIf=\"data.showClose\">\n <button\n bao-button\n role=\"button\"\n type=\"utility\"\n level=\"tertiary\"\n [reversed]=\"true\"\n title=\"{{ showCloseTitle }}\"\n (click)=\"close()\"\n >\n <bao-icon svgIcon=\"icon-x\" title=\"{{ showCloseTitle }}\"></bao-icon>\n </button>\n </div>\n </div>\n</div>\n", styles: [".bao-container{padding-right:16px;padding-left:16px;margin-right:auto;margin-left:auto;width:100%}@media (min-width: 576px){.bao-container{max-width:576px}}@media (min-width: 768px){.bao-container{max-width:768px}}@media (min-width: 992px){.bao-container{max-width:992px}}@media (min-width: 1200px){.bao-container{max-width:1200px}}.bao-row{display:flex;flex-wrap:wrap;margin-right:-16px;margin-left:-16px}.bao-col-12,.bao-col-lg-7{position:relative;width:100%;padding-right:1rem;padding-left:1rem}@media (min-width: 992px){.bao-col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}}.bao-snackbar{overflow:hidden;font-size:.875rem;line-height:1.25rem;color:#fff;background-color:#004b7b;background-clip:padding-box;box-shadow:0 2px 8px #0000001a;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem;width:100%}.bao-snackbar:not(:last-child){margin-bottom:1rem}.bao-snackbar.showing{opacity:1}.bao-snackbar.show{display:inline-flex;opacity:1}.bao-snackbar.hide{display:none}@media (min-width: 768px){.bao-snackbar{margin:1rem;width:auto}}.bao-snackbar-icon{display:inline-flex;align-items:center;flex-grow:0;margin:1rem 0 1rem 1rem}.bao-snackbar-body{display:flex;align-items:center;padding:1rem;margin:0}.bao-snackbar-action{display:flex;align-items:center;margin-left:auto}.bao-snackbar-action:last-child{margin-right:.5rem}.bao-snackbar-info{color:#fff;background-color:#004b7b}.bao-snackbar-success{color:#fff;background-color:#025d29}.bao-snackbar-danger{color:#fff;background-color:#851a00}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BaoButtonComponent, selector: "button[bao-button]", inputs: ["displayType", "level", "size", "loading", "reversed", "loadingSpinnerAriaLabel", "fullWidth"] }, { kind: "component", type: BaoIconComponent, selector: "bao-icon", inputs: ["color", "size", "svgIcon", "title"], exportAs: ["baoIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSimpleSnackBarComponent, decorators: [{
5171
+ type: Component,
5172
+ args: [{ selector: 'bao-simple-snack-bar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
5173
+ class: 'bao-simple-snackbar'
5174
+ }, template: "<div\n class=\"bao-snackbar show\"\n [ngClass]=\"toastClass\"\n [attr.aria-live]=\"politeness\"\n aria-atomic=\"true\"\n>\n <div class=\"bao-snackbar-icon\">\n <bao-icon [svgIcon]=\"toastIcon\" [title]=\"toastIconTitle\"></bao-icon>\n </div>\n <div class=\"bao-snackbar-body\">\n {{ data.message }}\n </div>\n <div class=\"bao-snackbar-action\">\n <div *ngIf=\"hasAction\">\n <button\n bao-button\n role=\"button\"\n type=\"utility\"\n level=\"tertiary\"\n [reversed]=\"true\"\n [title]=\"data.actionLabelOrIcon\"\n (click)=\"action()\"\n >\n <bao-icon\n *ngIf=\"isActionIcon; else isActionText\"\n [svgIcon]=\"data.actionLabelOrIcon\"\n [title]=\"data.actionLabelOrIcon\"\n ></bao-icon>\n <ng-template #isActionText\n ><span>{{ data.actionLabelOrIcon }}</span></ng-template\n >\n </button>\n </div>\n <div *ngIf=\"data.showClose\">\n <button\n bao-button\n role=\"button\"\n type=\"utility\"\n level=\"tertiary\"\n [reversed]=\"true\"\n title=\"{{ showCloseTitle }}\"\n (click)=\"close()\"\n >\n <bao-icon svgIcon=\"icon-x\" title=\"{{ showCloseTitle }}\"></bao-icon>\n </button>\n </div>\n </div>\n</div>\n", styles: [".bao-container{padding-right:16px;padding-left:16px;margin-right:auto;margin-left:auto;width:100%}@media (min-width: 576px){.bao-container{max-width:576px}}@media (min-width: 768px){.bao-container{max-width:768px}}@media (min-width: 992px){.bao-container{max-width:992px}}@media (min-width: 1200px){.bao-container{max-width:1200px}}.bao-row{display:flex;flex-wrap:wrap;margin-right:-16px;margin-left:-16px}.bao-col-12,.bao-col-lg-7{position:relative;width:100%;padding-right:1rem;padding-left:1rem}@media (min-width: 992px){.bao-col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}}.bao-snackbar{overflow:hidden;font-size:.875rem;line-height:1.25rem;color:#fff;background-color:#004b7b;background-clip:padding-box;box-shadow:0 2px 8px #0000001a;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem;width:100%}.bao-snackbar:not(:last-child){margin-bottom:1rem}.bao-snackbar.showing{opacity:1}.bao-snackbar.show{display:inline-flex;opacity:1}.bao-snackbar.hide{display:none}@media (min-width: 768px){.bao-snackbar{margin:1rem;width:auto}}.bao-snackbar-icon{display:inline-flex;align-items:center;flex-grow:0;margin:1rem 0 1rem 1rem}.bao-snackbar-body{display:flex;align-items:center;padding:1rem;margin:0}.bao-snackbar-action{display:flex;align-items:center;margin-left:auto}.bao-snackbar-action:last-child{margin-right:.5rem}.bao-snackbar-info{color:#fff;background-color:#004b7b}.bao-snackbar-success{color:#fff;background-color:#025d29}.bao-snackbar-danger{color:#fff;background-color:#851a00}\n"] }]
5175
+ }], ctorParameters: function () {
5176
+ return [{ type: BaoSnackBarRef }, { type: undefined, decorators: [{
5177
+ type: Inject,
5178
+ args: [BAO_SNACK_BAR_DATA]
5179
+ }] }];
5180
+ } });
5181
+
5182
+ /*
5183
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5184
+ * Licensed under the MIT license.
5185
+ * See LICENSE file in the project root for full license information.
5186
+ */
5187
+ /**
5188
+ * Animations used by the Material snack bar.
5189
+ * @docs-private
5190
+ */
5191
+ const matSnackBarAnimations = {
5192
+ /** Animation that shows and hides a snack bar. */
5193
+ snackBarState: trigger('state', [
5194
+ state('void, hidden', style({
5195
+ transform: 'scale(0.8)',
5196
+ opacity: 0
5197
+ })),
5198
+ state('visible', style({
5199
+ transform: 'scale(1)',
5200
+ opacity: 1
5201
+ })),
5202
+ transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
5203
+ transition('* => void, * => hidden', animate('75ms cubic-bezier(0.4, 0.0, 1, 1)', style({
5204
+ opacity: 0
5205
+ })))
5206
+ ])
5207
+ };
5208
+
5209
+ let uniqueId = 0;
5210
+ /**
5211
+ * Internal component that wraps user-provided snack bar content.
5212
+ * @docs-private
5213
+ */
5214
+ class BaoSnackBarContainerComponent extends BasePortalOutlet {
5215
+ constructor(_ngZone, _elementRef, _changeDetectorRef, _platform,
5216
+ /** The snack bar configuration. */
5217
+ snackBarConfig) {
5218
+ super();
5219
+ this._ngZone = _ngZone;
5220
+ this._elementRef = _elementRef;
5221
+ this._changeDetectorRef = _changeDetectorRef;
5222
+ this._platform = _platform;
5223
+ this.snackBarConfig = snackBarConfig;
5224
+ this._document = inject(DOCUMENT);
5225
+ this._trackedModals = new Set();
5226
+ /** Subject for notifying that the snack bar has announced to screen readers. */
5227
+ this._onAnnounce = new Subject();
5228
+ /** Subject for notifying that the snack bar has exited from view. */
5229
+ this._onExit = new Subject();
5230
+ /** Subject for notifying that the snack bar has finished entering the view. */
5231
+ this._onEnter = new Subject();
5232
+ /** The state of the snack bar animations. */
5233
+ this._animationState = 'void';
5234
+ /** The number of milliseconds to wait before announcing the snack bar's content. */
5235
+ this._announceDelay = 150;
5236
+ /** Whether the component has been destroyed. */
5237
+ this._destroyed = false;
5238
+ /** Unique ID of the aria-live element. */
5239
+ this._liveElementId = `bao-snack-bar-container-live-${uniqueId++}`;
5240
+ /**
5241
+ * Attaches a DOM portal to the snack bar container.
5242
+ * @deprecated To be turned into a method.
5243
+ * @breaking-change 10.0.0
5244
+ */
5245
+ this.attachDomPortal = (portal) => {
5246
+ this.assertNotAttached();
5247
+ const result = this._portalOutlet.attachDomPortal(portal);
5248
+ this._afterPortalAttached();
5249
+ return result;
5250
+ };
5251
+ // Use aria-live rather than a live role like 'alert' or 'status'
5252
+ // because NVDA and JAWS have show inconsistent behavior with live roles.
5253
+ if (snackBarConfig.politeness === 'assertive' &&
5254
+ !snackBarConfig.announcementMessage) {
5255
+ this._live = 'assertive';
5256
+ }
5257
+ else if (snackBarConfig.politeness === 'off') {
5258
+ this._live = 'off';
5259
+ }
5260
+ else {
5261
+ this._live = 'polite';
5262
+ }
5263
+ // Only set role for Firefox. Set role based on aria-live because setting role="alert" implies
5264
+ // aria-live="assertive" which may cause issues if aria-live is set to "polite" above.
5265
+ if (this._platform.FIREFOX) {
5266
+ if (this._live === 'polite') {
5267
+ this._role = 'status';
5268
+ }
5269
+ if (this._live === 'assertive') {
5270
+ this._role = 'alert';
5271
+ }
5272
+ }
5273
+ }
5274
+ /** Attach a component portal as content to this snack bar container. */
5275
+ attachComponentPortal(portal) {
5276
+ this.assertNotAttached();
5277
+ this.applySnackBarClasses();
5278
+ const result = this._portalOutlet.attachComponentPortal(portal);
5279
+ this._afterPortalAttached();
5280
+ return result;
5281
+ }
5282
+ /** Attach a template portal as content to this snack bar container. */
5283
+ attachTemplatePortal(portal) {
5284
+ this.assertNotAttached();
5285
+ this.applySnackBarClasses();
5286
+ const result = this._portalOutlet.attachTemplatePortal(portal);
5287
+ this._afterPortalAttached();
5288
+ return result;
5289
+ }
5290
+ /** Handle end of animations, updating the state of the snackbar. */
5291
+ onAnimationEnd(event) {
5292
+ const { fromState, toState } = event;
5293
+ if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {
5294
+ this.completeExit();
5295
+ }
5296
+ if (toState === 'visible') {
5297
+ // Note: we shouldn't use `this` inside the zone callback,
5298
+ // because it can cause a memory leak.
5299
+ const onEnter = this._onEnter;
5300
+ this._ngZone.run(() => {
5301
+ onEnter.next();
5302
+ onEnter.complete();
5303
+ });
5304
+ }
5305
+ }
5306
+ /** Begin animation of snack bar entrance into view. */
5307
+ enter() {
5308
+ if (!this._destroyed) {
5309
+ this._animationState = 'visible';
5310
+ this._changeDetectorRef.detectChanges();
5311
+ this.screenReaderAnnounce();
5312
+ }
5313
+ }
5314
+ /** Begin animation of the snack bar exiting from view. */
5315
+ exit() {
5316
+ // Note: this one transitions to `hidden`, rather than `void`, in order to handle the case
5317
+ // where multiple snack bars are opened in quick succession (e.g. two consecutive calls to
5318
+ // `MatSnackBar.open`).
5319
+ this._animationState = 'hidden';
5320
+ // Mark this element with an 'exit' attribute to indicate that the snackbar has
5321
+ // been dismissed and will soon be removed from the DOM. This is used by the snackbar
5322
+ // test harness.
5323
+ this._elementRef.nativeElement.setAttribute('mat-exit', '');
5324
+ // If the snack bar hasn't been announced by the time it exits it wouldn't have been open
5325
+ // long enough to visually read it either, so clear the timeout for announcing.
5326
+ clearTimeout(this._announceTimeoutId);
5327
+ return this._onExit;
5328
+ }
5329
+ /** Makes sure the exit callbacks have been invoked when the element is destroyed. */
5330
+ ngOnDestroy() {
5331
+ this._destroyed = true;
5332
+ this.completeExit();
5333
+ }
5334
+ /**
5335
+ * Waits for the zone to settle before removing the element. Helps prevent
5336
+ * errors where we end up removing an element which is in the middle of an animation.
5337
+ */
5338
+ completeExit() {
5339
+ this._ngZone.onMicrotaskEmpty.pipe(take$1(1)).subscribe(() => {
5340
+ this._onExit.next();
5341
+ this._onExit.complete();
5342
+ });
5343
+ }
5344
+ /** Applies the various positioning and user-configured CSS classes to the snack bar. */
5345
+ applySnackBarClasses() {
5346
+ const element = this._elementRef.nativeElement;
5347
+ const panelClasses = this.snackBarConfig.panelClass;
5348
+ if (panelClasses) {
5349
+ if (Array.isArray(panelClasses)) {
5350
+ // Note that we can't use a spread here, because IE doesn't support multiple arguments.
5351
+ panelClasses.forEach(cssClass => element.classList.add(cssClass));
5352
+ }
5353
+ else {
5354
+ element.classList.add(panelClasses);
5355
+ }
5356
+ }
5357
+ if (this.snackBarConfig.horizontalPosition === 'center') {
5358
+ element.classList.add('bao-snack-bar-center');
5359
+ }
5360
+ if (this.snackBarConfig.verticalPosition === 'top') {
5361
+ element.classList.add('bao-snack-bar-top');
5362
+ }
5363
+ }
5364
+ /**
5365
+ * Called after the portal contents have been attached. Can be
5366
+ * used to modify the DOM once it's guaranteed to be in place.
5367
+ */
5368
+ _afterPortalAttached() {
5369
+ const element = this._elementRef.nativeElement;
5370
+ const panelClasses = this.snackBarConfig.panelClass;
5371
+ if (panelClasses) {
5372
+ if (Array.isArray(panelClasses)) {
5373
+ // Note that we can't use a spread here, because IE doesn't support multiple arguments.
5374
+ panelClasses.forEach(cssClass => element.classList.add(cssClass));
5375
+ }
5376
+ else {
5377
+ element.classList.add(panelClasses);
5378
+ }
5379
+ }
5380
+ this._exposeToModals();
5381
+ }
5382
+ /**
5383
+ * Some browsers won't expose the accessibility node of the live element if there is an
5384
+ * `aria-modal` and the live element is outside of it. This method works around the issue by
5385
+ * pointing the `aria-owns` of all modals to the live element.
5386
+ */
5387
+ _exposeToModals() {
5388
+ // Note that the selector here is limited to CDK overlays at the moment in order to reduce the
5389
+ // section of the DOM we need to look through. This should cover all the cases we support, but
5390
+ // the selector can be expanded if it turns out to be too narrow.
5391
+ const id = this._liveElementId;
5392
+ const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');
5393
+ for (let i = 0; i < modals.length; i++) {
5394
+ const modal = modals[i];
5395
+ const ariaOwns = modal.getAttribute('aria-owns');
5396
+ this._trackedModals.add(modal);
5397
+ if (!ariaOwns) {
5398
+ modal.setAttribute('aria-owns', id);
5399
+ }
5400
+ else if (ariaOwns.indexOf(id) === -1) {
5401
+ modal.setAttribute('aria-owns', ariaOwns + ' ' + id);
5402
+ }
5403
+ }
5404
+ }
5405
+ /** Clears the references to the live element from any modals it was added to. */
5406
+ _clearFromModals() {
5407
+ this._trackedModals.forEach(modal => {
5408
+ const ariaOwns = modal.getAttribute('aria-owns');
5409
+ if (ariaOwns) {
5410
+ const newValue = ariaOwns.replace(this._liveElementId, '').trim();
5411
+ if (newValue.length > 0) {
5412
+ modal.setAttribute('aria-owns', newValue);
5413
+ }
5414
+ else {
5415
+ modal.removeAttribute('aria-owns');
5416
+ }
5417
+ }
5418
+ });
5419
+ this._trackedModals.clear();
5420
+ }
5421
+ /** Asserts that no content is already attached to the container. */
5422
+ assertNotAttached() {
5423
+ if (this._portalOutlet.hasAttached()) {
5424
+ throw Error('Attempting to attach snack bar content after content is already attached');
5425
+ }
5426
+ }
5427
+ /**
5428
+ * Starts a timeout to move the snack bar content to the live region so screen readers will
5429
+ * announce it.
5430
+ */
5431
+ screenReaderAnnounce() {
5432
+ if (!this._announceTimeoutId) {
5433
+ this._ngZone.runOutsideAngular(() => {
5434
+ this._announceTimeoutId = window.setTimeout(() => {
5435
+ const inertElement = this._elementRef.nativeElement.querySelector('[aria-hidden]');
5436
+ const liveElement = this._elementRef.nativeElement.querySelector('[aria-live]');
5437
+ if (inertElement && liveElement) {
5438
+ // If an element in the snack bar content is focused before being moved
5439
+ // track it and restore focus after moving to the live region.
5440
+ let focusedElement = null;
5441
+ if (this._platform.isBrowser &&
5442
+ document.activeElement instanceof HTMLElement &&
5443
+ inertElement.contains(document.activeElement)) {
5444
+ focusedElement = document.activeElement;
5445
+ }
5446
+ inertElement.removeAttribute('aria-hidden');
5447
+ liveElement.appendChild(inertElement);
5448
+ focusedElement === null || focusedElement === void 0 ? void 0 : focusedElement.focus();
5449
+ this._onAnnounce.next();
5450
+ this._onAnnounce.complete();
5451
+ }
5452
+ }, this._announceDelay);
5453
+ });
5454
+ }
5455
+ }
5456
+ }
5457
+ BaoSnackBarContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarContainerComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$5.Platform }, { token: BaoSnackBarConfig }], target: i0.ɵɵFactoryTarget.Component });
5458
+ BaoSnackBarContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.3", type: BaoSnackBarContainerComponent, selector: "bao-snack-bar-container", host: { listeners: { "@state.done": "onAnimationEnd($event)" }, properties: { "@state": "_animationState" }, classAttribute: "bao-snack-bar-container" }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!-- Initialy holds the snack bar content, will be empty after announcing to screen readers. -->\n<div aria-hidden=\"true\">\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n\n<!-- Will receive the snack bar content from the non-live div, move will happen a short delay after opening -->\n<div\n [attr.aria-live]=\"_live\"\n [attr.role]=\"_role\"\n [attr.id]=\"_liveElementId\"\n></div>\n", styles: [".bao-container{padding-right:16px;padding-left:16px;margin-right:auto;margin-left:auto;width:100%}@media (min-width: 576px){.bao-container{max-width:576px}}@media (min-width: 768px){.bao-container{max-width:768px}}@media (min-width: 992px){.bao-container{max-width:992px}}@media (min-width: 1200px){.bao-container{max-width:1200px}}.bao-row{display:flex;flex-wrap:wrap;margin-right:-16px;margin-left:-16px}.bao-col-12,.bao-col-lg-7{position:relative;width:100%;padding-right:1rem;padding-left:1rem}@media (min-width: 992px){.bao-col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}}.cdk-overlay-pane{width:100%}@media (min-width: 768px){.cdk-overlay-pane{margin:0;width:auto}}.bao-snack-bar-container{border-radius:.25rem;box-sizing:border-box;display:block;margin:1rem;max-width:100vw;min-width:15rem;min-height:3rem;transform-origin:center;width:100%}\n"], dependencies: [{ kind: "directive", type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [matSnackBarAnimations.snackBarState], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
5459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarContainerComponent, decorators: [{
5460
+ type: Component,
5461
+ args: [{ selector: 'bao-snack-bar-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, animations: [matSnackBarAnimations.snackBarState], host: {
5462
+ class: 'bao-snack-bar-container',
5463
+ '[@state]': '_animationState',
5464
+ '(@state.done)': 'onAnimationEnd($event)'
5465
+ }, template: "<!-- Initialy holds the snack bar content, will be empty after announcing to screen readers. -->\n<div aria-hidden=\"true\">\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n\n<!-- Will receive the snack bar content from the non-live div, move will happen a short delay after opening -->\n<div\n [attr.aria-live]=\"_live\"\n [attr.role]=\"_role\"\n [attr.id]=\"_liveElementId\"\n></div>\n", styles: [".bao-container{padding-right:16px;padding-left:16px;margin-right:auto;margin-left:auto;width:100%}@media (min-width: 576px){.bao-container{max-width:576px}}@media (min-width: 768px){.bao-container{max-width:768px}}@media (min-width: 992px){.bao-container{max-width:992px}}@media (min-width: 1200px){.bao-container{max-width:1200px}}.bao-row{display:flex;flex-wrap:wrap;margin-right:-16px;margin-left:-16px}.bao-col-12,.bao-col-lg-7{position:relative;width:100%;padding-right:1rem;padding-left:1rem}@media (min-width: 992px){.bao-col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}}.cdk-overlay-pane{width:100%}@media (min-width: 768px){.cdk-overlay-pane{margin:0;width:auto}}.bao-snack-bar-container{border-radius:.25rem;box-sizing:border-box;display:block;margin:1rem;max-width:100vw;min-width:15rem;min-height:3rem;transform-origin:center;width:100%}\n"] }]
5466
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$5.Platform }, { type: BaoSnackBarConfig }]; }, propDecorators: { _portalOutlet: [{
5467
+ type: ViewChild,
5468
+ args: [CdkPortalOutlet, { static: true }]
5469
+ }] } });
5470
+
5471
+ function baoFactory() {
5472
+ return new BaoSnackBarConfig();
5473
+ }
5474
+ /** Injection token that can be used to specify default snack bar. */
5475
+ const BAO_SNACK_BAR_DEFAULT_OPTIONS = new InjectionToken('bao-snack-bar-default-options', {
5476
+ providedIn: 'root',
5477
+ factory: baoFactory
5478
+ });
5479
+ /**
5480
+ * Service to dispatch Material Design snack bar messages.
5481
+ */
5482
+ class BaoSnackBarService {
5483
+ constructor(_overlay, _live, _injector, _parentSnackBar, _defaultConfig) {
5484
+ this._overlay = _overlay;
5485
+ this._live = _live;
5486
+ this._injector = _injector;
5487
+ this._parentSnackBar = _parentSnackBar;
5488
+ this._defaultConfig = _defaultConfig;
5489
+ /** The component that should be rendered as the snack bar's simple component. */
5490
+ this.simpleSnackBarComponent = BaoSimpleSnackBarComponent;
5491
+ /** The container component that attaches the provided template or component. */
5492
+ this.snackBarContainerComponent = BaoSnackBarContainerComponent;
5493
+ /**
5494
+ * Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
5495
+ * If there is a parent snack-bar service, all operations should delegate to that parent
5496
+ * via `_openedSnackBarRef`.
5497
+ */
5498
+ this._snackBarRefAtThisLevel = null;
5499
+ }
5500
+ /** Reference to the currently opened snackbar at *any* level. */
5501
+ get _openedSnackBarRef() {
5502
+ const parent = this._parentSnackBar;
5503
+ return parent ? parent._openedSnackBarRef : this._snackBarRefAtThisLevel;
5504
+ }
5505
+ set _openedSnackBarRef(value) {
5506
+ if (this._parentSnackBar) {
5507
+ this._parentSnackBar._openedSnackBarRef = value;
5508
+ }
5509
+ else {
5510
+ this._snackBarRefAtThisLevel = value;
5511
+ }
5512
+ }
5513
+ /**
5514
+ * Creates and dispatches a snack bar with a custom component for the content, removing any
5515
+ * currently opened snack bars.
5516
+ *
5517
+ * @param component Component to be instantiated.
5518
+ * @param config Extra configuration for the snack bar.
5519
+ */
5520
+ openFromComponent(component, config) {
5521
+ return this.attach(component, config);
5522
+ }
5523
+ /**
5524
+ * Creates and dispatches a snack bar with a custom template for the content, removing any
5525
+ * currently opened snack bars.
5526
+ *
5527
+ * @param template Template to be instantiated.
5528
+ * @param config Extra configuration for the snack bar.
5529
+ */
5530
+ openFromTemplate(template, config) {
5531
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
5532
+ return this.attach(template, config);
5533
+ }
5534
+ /**
5535
+ * Opens a snackbar with a message and an optional action.
5536
+ * @param message The message to show in the snackbar.
5537
+ * @param toastType The type of of toast to display the snackbar.
5538
+ * @param actionLabelOrIcon The label or icon for the snackbar action.
5539
+ * @param showClose If true, the snackbar will require user interaction to close.
5540
+ * @param config Additional configuration options for the snackbar.
5541
+ */
5542
+ open(config) {
5543
+ const _config = Object.assign(Object.assign({}, this._defaultConfig), config);
5544
+ // Since the user doesn't have access to the component, we can
5545
+ // override the data to pass in our own message, action and type.
5546
+ _config.data = {
5547
+ message: _config.message,
5548
+ toastType: _config.toastType,
5549
+ actionLabelOrIcon: _config.actionLabelOrIcon,
5550
+ showClose: _config.showClose
5551
+ };
5552
+ if (_config.showClose)
5553
+ _config.duration = 0;
5554
+ if (!_config.announcementMessage) {
5555
+ _config.announcementMessage = _config.message;
5556
+ }
5557
+ return this.openFromComponent(this.simpleSnackBarComponent, _config);
5558
+ }
5559
+ /**
5560
+ * Dismisses the currently-visible snack bar.
5561
+ */
5562
+ dismiss() {
5563
+ if (this._openedSnackBarRef) {
5564
+ this._openedSnackBarRef.dismiss();
5565
+ }
5566
+ }
5567
+ ngOnDestroy() {
5568
+ // Only dismiss the snack bar at the current level on destroy.
5569
+ if (this._snackBarRefAtThisLevel) {
5570
+ this._snackBarRefAtThisLevel.dismiss();
5571
+ }
5572
+ }
5573
+ /**
5574
+ * Attaches the snack bar container component to the overlay.
5575
+ */
5576
+ attachSnackBarContainer(overlayRef, config) {
5577
+ const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
5578
+ const injector = new PortalInjector(userInjector || this._injector, new WeakMap([[BaoSnackBarConfig, config]]));
5579
+ const containerPortal = new ComponentPortal(this.snackBarContainerComponent, config.viewContainerRef, injector);
5580
+ const containerRef = overlayRef.attach(containerPortal);
5581
+ containerRef.instance.snackBarConfig = config;
5582
+ return containerRef.instance;
5583
+ }
5584
+ /**
5585
+ * Places a new component or a template as the content of the snack bar container.
5586
+ */
5587
+ attach(content, userConfig) {
5588
+ const config = Object.assign(Object.assign(Object.assign({}, new BaoSnackBarConfig()), this._defaultConfig), userConfig);
5589
+ const overlayRef = this.createOverlay(config);
5590
+ const container = this.attachSnackBarContainer(overlayRef, config);
5591
+ const snackBarRef = new BaoSnackBarRef(container, overlayRef);
5592
+ if (content instanceof TemplateRef) {
5593
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
5594
+ const portal = new TemplatePortal(content, null, {
5595
+ $implicit: config.data,
5596
+ snackBarRef
5597
+ });
5598
+ snackBarRef.instance = container.attachTemplatePortal(portal);
5599
+ }
5600
+ else {
5601
+ const injector = this.createInjector(config, snackBarRef);
5602
+ const portal = new ComponentPortal(content, undefined, injector);
5603
+ const contentRef = container.attachComponentPortal(portal);
5604
+ // We can't pass this via the injector, because the injector is created earlier.
5605
+ snackBarRef.instance = contentRef.instance;
5606
+ }
5607
+ this.animateSnackBar(snackBarRef, config);
5608
+ this._openedSnackBarRef = snackBarRef;
5609
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
5610
+ return this._openedSnackBarRef;
5611
+ }
5612
+ /** Animates the old snack bar out and the new one in. */
5613
+ animateSnackBar(snackBarRef, config) {
5614
+ // When the snackbar is dismissed, clear the reference to it.
5615
+ snackBarRef.afterDismissed().subscribe(() => {
5616
+ // Clear the snackbar ref if it hasn't already been replaced by a newer snackbar.
5617
+ // eslint-disable-next-line eqeqeq
5618
+ if (this._openedSnackBarRef == snackBarRef) {
5619
+ this._openedSnackBarRef = null;
5620
+ }
5621
+ if (config.announcementMessage) {
5622
+ this._live.clear();
5623
+ }
5624
+ });
5625
+ if (this._openedSnackBarRef) {
5626
+ // If a snack bar is already in view, dismiss it and enter the
5627
+ // new snack bar after exit animation is complete.
5628
+ this._openedSnackBarRef.afterDismissed().subscribe(() => {
5629
+ snackBarRef.containerInstance.enter();
5630
+ });
5631
+ this._openedSnackBarRef.dismiss();
5632
+ }
5633
+ else {
5634
+ // If no snack bar is in view, enter the new snack bar.
5635
+ snackBarRef.containerInstance.enter();
5636
+ }
5637
+ // If a dismiss timeout is provided, set up dismiss based on after the snackbar is opened.
5638
+ if (config.duration && config.duration > 0) {
5639
+ snackBarRef
5640
+ .afterOpened()
5641
+ .subscribe(() => snackBarRef.dismissAfter(config.duration));
5642
+ }
5643
+ if (config.announcementMessage) {
5644
+ void this._live.announce(config.announcementMessage, config.politeness);
5645
+ }
5646
+ }
5647
+ /**
5648
+ * Creates a new overlay and places it in the correct location.
5649
+ * @param config The user-specified snack bar config.
5650
+ */
5651
+ createOverlay(config) {
5652
+ const overlayConfig = new OverlayConfig();
5653
+ overlayConfig.direction = config.direction;
5654
+ const positionStrategy = this._overlay.position().global();
5655
+ // Set horizontal position.
5656
+ const isRtl = config.direction === 'rtl';
5657
+ const isLeft = config.horizontalPosition === 'left' ||
5658
+ (config.horizontalPosition === 'start' && !isRtl) ||
5659
+ (config.horizontalPosition === 'end' && isRtl);
5660
+ const isRight = !isLeft && config.horizontalPosition !== 'center';
5661
+ if (isLeft) {
5662
+ positionStrategy.left('0');
5663
+ }
5664
+ else if (isRight) {
5665
+ positionStrategy.right('0');
5666
+ }
5667
+ else {
5668
+ positionStrategy.centerHorizontally();
5669
+ }
5670
+ // Set horizontal position.
5671
+ if (config.verticalPosition === 'top') {
5672
+ positionStrategy.top('0');
5673
+ }
5674
+ else {
5675
+ positionStrategy.bottom('0');
5676
+ }
5677
+ overlayConfig.positionStrategy = positionStrategy;
5678
+ return this._overlay.create(overlayConfig);
5679
+ }
5680
+ /**
5681
+ * Creates an injector to be used inside of a snack bar component.
5682
+ * @param config Config that was used to create the snack bar.
5683
+ * @param snackBarRef Reference to the snack bar.
5684
+ */
5685
+ createInjector(config, snackBarRef) {
5686
+ const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
5687
+ return new PortalInjector(userInjector || this._injector, new WeakMap([
5688
+ [BaoSnackBarRef, snackBarRef],
5689
+ [BAO_SNACK_BAR_DATA, config.data]
5690
+ ]));
5691
+ }
5692
+ }
5693
+ BaoSnackBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarService, deps: [{ token: i1$4.Overlay }, { token: i1$3.LiveAnnouncer }, { token: i0.Injector }, { token: BaoSnackBarService, optional: true, skipSelf: true }, { token: BAO_SNACK_BAR_DEFAULT_OPTIONS }], target: i0.ɵɵFactoryTarget.Injectable });
5694
+ BaoSnackBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarService, providedIn: 'root' });
5695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarService, decorators: [{
5696
+ type: Injectable,
5697
+ args: [{ providedIn: 'root' }]
5698
+ }], ctorParameters: function () {
5699
+ return [{ type: i1$4.Overlay }, { type: i1$3.LiveAnnouncer }, { type: i0.Injector }, { type: BaoSnackBarService, decorators: [{
5700
+ type: Optional
5701
+ }, {
5702
+ type: SkipSelf
5703
+ }] }, { type: BaoSnackBarConfig, decorators: [{
5704
+ type: Inject,
5705
+ args: [BAO_SNACK_BAR_DEFAULT_OPTIONS]
5706
+ }] }];
5707
+ } });
5708
+
5709
+ /*
5710
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5711
+ * Licensed under the MIT license.
5712
+ * See LICENSE file in the project root for full license information.
5713
+ */
5714
+ const SNACKBAR_DIRECTIVES = [
5715
+ BaoSimpleSnackBarComponent,
5716
+ BaoSnackBarContainerComponent
5717
+ ];
5718
+ class BaoSnackBarModule {
5719
+ }
5720
+ BaoSnackBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5721
+ BaoSnackBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarModule, declarations: [BaoSimpleSnackBarComponent,
5722
+ BaoSnackBarContainerComponent], imports: [CommonModule,
5723
+ OverlayModule,
5724
+ PortalModule,
5725
+ BaoButtonModule,
5726
+ BaoIconModule], exports: [BaoSimpleSnackBarComponent,
5727
+ BaoSnackBarContainerComponent] });
5728
+ BaoSnackBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarModule, providers: [BaoSnackBarService, BaoSnackBarConfig], imports: [CommonModule,
5729
+ OverlayModule,
5730
+ PortalModule,
5731
+ BaoButtonModule,
5732
+ BaoIconModule] });
5733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoSnackBarModule, decorators: [{
5734
+ type: NgModule,
5735
+ args: [{
5736
+ imports: [
5737
+ CommonModule,
5738
+ OverlayModule,
5739
+ PortalModule,
5740
+ BaoButtonModule,
5741
+ BaoIconModule
5742
+ ],
5743
+ providers: [BaoSnackBarService, BaoSnackBarConfig],
5744
+ declarations: SNACKBAR_DIRECTIVES,
5745
+ exports: SNACKBAR_DIRECTIVES,
5746
+ entryComponents: [SNACKBAR_DIRECTIVES]
5747
+ }]
5748
+ }] });
5749
+
4979
5750
  /*
4980
5751
  * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4981
5752
  * Licensed under the MIT license.
@@ -5006,9 +5777,9 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
5006
5777
  BaoModalModule,
5007
5778
  BaoHyperlinkModule,
5008
5779
  BaoDropdownMenuModule,
5009
- BaoFileModule
5780
+ BaoFileModule,
5781
+ BaoSnackBarModule
5010
5782
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
5011
- // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
5012
5783
  ] });
5013
5784
  BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoModule, imports: [BaoIconModule,
5014
5785
  BaoButtonModule,
@@ -5032,9 +5803,9 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
5032
5803
  BaoModalModule,
5033
5804
  BaoHyperlinkModule,
5034
5805
  BaoDropdownMenuModule,
5035
- BaoFileModule
5806
+ BaoFileModule,
5807
+ BaoSnackBarModule
5036
5808
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
5037
- // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
5038
5809
  ] });
5039
5810
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: BaoModule, decorators: [{
5040
5811
  type: NgModule,
@@ -5065,9 +5836,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
5065
5836
  BaoModalModule,
5066
5837
  BaoHyperlinkModule,
5067
5838
  BaoDropdownMenuModule,
5068
- BaoFileModule
5839
+ BaoFileModule,
5840
+ BaoSnackBarModule
5069
5841
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
5070
- // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
5071
5842
  ]
5072
5843
  }]
5073
5844
  }] });
@@ -5147,9 +5918,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
5147
5918
  * See LICENSE file in the project root for full license information.
5148
5919
  */
5149
5920
 
5921
+ /*
5922
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5923
+ * Licensed under the MIT license.
5924
+ * See LICENSE file in the project root for full license information.
5925
+ */
5926
+
5150
5927
  /**
5151
5928
  * Generated bundle index. Do not edit.
5152
5929
  */
5153
5930
 
5154
- export { BAO_FILE_INTL_PROVIDER, BAO_FILE_INTL_PROVIDER_FACTORY, BAO_MODAL_DATA, BAO_RADIO_GROUP, BaoAlertActions, BaoAlertComponent, BaoAlertContent, BaoAlertLink, BaoAlertModule, BaoAlertTitle, BaoAvatarComponent, BaoAvatarContent, BaoAvatarModule, BaoBadgeComponent, BaoBadgeModule, BaoBreadcrumbComponent, BaoBreadcrumbModule, BaoButtonComponent, BaoButtonModule, BaoCardComponent, BaoCardContent, BaoCardHeader, BaoCardModule, BaoCardTextInterface, BaoCardTitle, BaoCheckBoxDescription, BaoCheckboxComponent, BaoCheckboxGroupComponent, BaoCheckboxModule, BaoCommonComponentsModule, BaoDropdownMenuComponent, BaoDropdownMenuDivider, BaoDropdownMenuItem, BaoDropdownMenuItemDescription, BaoDropdownMenuItemLabel, BaoDropdownMenuModule, BaoDropdownMenuSection, BaoDropdownMenuTrigger, BaoErrorTextComponent, BaoFileDropDirective, BaoFileDropzoneIntructions, BaoFileInputComponent, BaoFileIntl, BaoFileIntlEnglish, BaoFileModule, BaoFilePreviewComponent, BaoGuidingTextComponent, BaoHeaderInfoComponent, BaoHeaderInfoContent, BaoHeaderInfoModule, BaoHeaderInfoSubtitle, BaoHeaderInfoSurtitle, BaoHeaderInfoTitle, BaoHeaderInfoTitleGroupComponent, BaoHyperlinkComponent, BaoHyperlinkModule, BaoIconComponent, BaoIconModule, BaoLabelTextComponent, BaoList, BaoListItem, BaoListItemDescription, BaoListItemTitle, BaoListModule, BaoListSummary, BaoListSummaryItem, BaoModal, BaoModalBase, BaoModalClose, BaoModalContainer, BaoModalInitialConfig, BaoModalModule, BaoModalRef, BaoModule, BaoNavList, BaoRadioButtonComponent, BaoRadioButtonGroupComponent, BaoRadioDescription, BaoRadioModule, BaoSummaryComponent, BaoSummaryDescription, BaoSummaryModule, BaoTabHeader, BaoTabPanel, BaoTablistComponent, BaoTabsContainer, BaoTabsModule, BaoTagComponent, BaoTagModule, BaoTitleTextComponent, _BaoModalContainerBase, _closeModalVia, eModalDesktopWidthSize, eModalMobileWidthSize, throwBaoModalContentAlreadyAttachedError };
5931
+ export { BAO_FILE_INTL_PROVIDER, BAO_FILE_INTL_PROVIDER_FACTORY, BAO_MODAL_DATA, BAO_RADIO_GROUP, BAO_SNACK_BAR_DATA, BAO_SNACK_BAR_DEFAULT_OPTIONS, BaoAlertActions, BaoAlertComponent, BaoAlertContent, BaoAlertLink, BaoAlertModule, BaoAlertTitle, BaoAvatarComponent, BaoAvatarContent, BaoAvatarModule, BaoBadgeComponent, BaoBadgeModule, BaoBreadcrumbComponent, BaoBreadcrumbModule, BaoButtonComponent, BaoButtonModule, BaoCardComponent, BaoCardContent, BaoCardHeader, BaoCardModule, BaoCardTextInterface, BaoCardTitle, BaoCheckBoxDescription, BaoCheckboxComponent, BaoCheckboxGroupComponent, BaoCheckboxModule, BaoCommonComponentsModule, BaoDropdownMenuComponent, BaoDropdownMenuDivider, BaoDropdownMenuItem, BaoDropdownMenuItemDescription, BaoDropdownMenuItemLabel, BaoDropdownMenuModule, BaoDropdownMenuSection, BaoDropdownMenuTrigger, BaoErrorTextComponent, BaoFileDropDirective, BaoFileDropzoneIntructions, BaoFileInputComponent, BaoFileIntl, BaoFileIntlEnglish, BaoFileModule, BaoFilePreviewComponent, BaoGuidingTextComponent, BaoHeaderInfoComponent, BaoHeaderInfoContent, BaoHeaderInfoModule, BaoHeaderInfoSubtitle, BaoHeaderInfoSurtitle, BaoHeaderInfoTitle, BaoHeaderInfoTitleGroupComponent, BaoHyperlinkComponent, BaoHyperlinkModule, BaoIconComponent, BaoIconModule, BaoLabelTextComponent, BaoList, BaoListItem, BaoListItemDescription, BaoListItemTitle, BaoListModule, BaoListSummary, BaoListSummaryItem, BaoModal, BaoModalBase, BaoModalClose, BaoModalContainer, BaoModalInitialConfig, BaoModalModule, BaoModalRef, BaoModule, BaoNavList, BaoRadioButtonComponent, BaoRadioButtonGroupComponent, BaoRadioDescription, BaoRadioModule, BaoSimpleSnackBarComponent, BaoSnackBarConfig, BaoSnackBarContainerComponent, BaoSnackBarModule, BaoSnackBarRef, BaoSnackBarService, BaoSummaryComponent, BaoSummaryDescription, BaoSummaryModule, BaoTabHeader, BaoTabPanel, BaoTablistComponent, BaoTabsContainer, BaoTabsModule, BaoTagComponent, BaoTagModule, BaoTitleTextComponent, _BaoModalContainerBase, _closeModalVia, baoFactory, eModalDesktopWidthSize, eModalMobileWidthSize, throwBaoModalContentAlreadyAttachedError };
5155
5932
  //# sourceMappingURL=villedemontreal-angular-ui.mjs.map