@villedemontreal/angular-ui 15.0.0 → 15.1.1

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