@villedemontreal/angular-ui 13.1.0 → 13.3.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.
- package/esm2020/lib/bao.module.mjs +18 -10
- package/esm2020/lib/core/breakpoints.mjs +13 -0
- package/esm2020/lib/core/index.mjs +8 -0
- package/esm2020/lib/dropdown-menu/dropdown-menu.component.mjs +32 -9
- package/esm2020/lib/file/file-input.component.mjs +5 -5
- package/esm2020/lib/file/file-preview.component.mjs +2 -2
- package/esm2020/lib/modal/modal-container.mjs +18 -32
- package/esm2020/lib/modal/modal-ref.mjs +4 -1
- package/esm2020/lib/modal/modal.mjs +10 -31
- package/esm2020/lib/modal/module.mjs +4 -21
- package/esm2020/lib/snack-bar/index.mjs +12 -0
- package/esm2020/lib/snack-bar/module.mjs +54 -0
- package/esm2020/lib/snack-bar/simple-snack-bar.component.mjs +92 -0
- package/esm2020/lib/snack-bar/snack-bar-animations.mjs +28 -0
- package/esm2020/lib/snack-bar/snack-bar-config.mjs +37 -0
- package/esm2020/lib/snack-bar/snack-bar-container.mjs +272 -0
- package/esm2020/lib/snack-bar/snack-bar-ref.mjs +75 -0
- package/esm2020/lib/snack-bar/snack-bar.mjs +251 -0
- package/esm2020/lib/system-header/index.mjs +8 -0
- package/esm2020/lib/system-header/module.mjs +33 -0
- package/esm2020/lib/system-header/system-header.component.mjs +128 -0
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/villedemontreal-angular-ui.mjs +1044 -137
- package/fesm2015/villedemontreal-angular-ui.mjs.map +1 -1
- package/fesm2020/villedemontreal-angular-ui.mjs +1040 -135
- package/fesm2020/villedemontreal-angular-ui.mjs.map +1 -1
- package/lib/bao.module.d.ts +13 -11
- package/lib/core/breakpoints.d.ts +7 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/dropdown-menu/dropdown-menu.component.d.ts +10 -4
- package/lib/modal/modal-container.d.ts +4 -5
- package/lib/modal/modal-ref.d.ts +1 -0
- package/lib/modal/modal.d.ts +3 -4
- package/lib/modal/module.d.ts +1 -2
- package/lib/snack-bar/index.d.ts +6 -0
- package/lib/snack-bar/module.d.ts +13 -0
- package/lib/snack-bar/simple-snack-bar.component.d.ts +51 -0
- package/lib/snack-bar/snack-bar-animations.d.ts +8 -0
- package/lib/snack-bar/snack-bar-config.d.ts +51 -0
- package/lib/snack-bar/snack-bar-container.d.ts +111 -0
- package/lib/snack-bar/snack-bar-ref.d.ts +51 -0
- package/lib/snack-bar/snack-bar.d.ts +89 -0
- package/lib/system-header/index.d.ts +2 -0
- package/lib/system-header/module.d.ts +9 -0
- package/lib/system-header/system-header.component.d.ts +41 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/esm2020/lib/modal/modal-animations.mjs +0 -29
- package/lib/modal/modal-animations.d.ts +0 -8
|
@@ -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,12 +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';
|
|
16
|
-
import { Subject, filter, take, defer, startWith
|
|
15
|
+
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, PortalModule, DomPortal, PortalInjector } from '@angular/cdk/portal';
|
|
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
|
-
import { trigger, state, style, transition, group, animate, query, animateChild } from '@angular/animations';
|
|
19
19
|
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
20
|
-
import {
|
|
20
|
+
import { take as take$1 } from 'rxjs/operators';
|
|
21
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
22
|
+
import * as i2$1 from '@angular/cdk/layout';
|
|
21
23
|
|
|
22
24
|
function baoColorToHex(baoColor) {
|
|
23
25
|
switch (baoColor) {
|
|
@@ -2936,34 +2938,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2936
2938
|
* See LICENSE file in the project root for full license information.
|
|
2937
2939
|
*/
|
|
2938
2940
|
|
|
2939
|
-
/*
|
|
2940
|
-
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
2941
|
-
* Licensed under the MIT license.
|
|
2942
|
-
* See LICENSE file in the project root for full license information.
|
|
2943
|
-
*/
|
|
2944
|
-
/**
|
|
2945
|
-
* Animations used by MatDialog.
|
|
2946
|
-
* @docs-private
|
|
2947
|
-
*/
|
|
2948
|
-
const baoModalAnimations = {
|
|
2949
|
-
/** Animation that is applied on the modal container by default. */
|
|
2950
|
-
modalContainer: trigger('modalContainer', [
|
|
2951
|
-
// Note: The `enter` animation transitions to `transform: none`, because for some reason
|
|
2952
|
-
// specifying the transform explicitly, causes IE both to blur the modal content and
|
|
2953
|
-
// decimate the animation performance. Leaving it as `none` solves both issues.
|
|
2954
|
-
state('void, exit', style({ opacity: 0, transform: 'scale(0.7)' })),
|
|
2955
|
-
state('enter', style({ transform: 'none' })),
|
|
2956
|
-
transition('* => enter', group([
|
|
2957
|
-
animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'none', opacity: 1 })),
|
|
2958
|
-
query('@*', animateChild(), { optional: true })
|
|
2959
|
-
])),
|
|
2960
|
-
transition('* => void, * => exit', group([
|
|
2961
|
-
animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({ opacity: 0 })),
|
|
2962
|
-
query('@*', animateChild(), { optional: true })
|
|
2963
|
-
]))
|
|
2964
|
-
])
|
|
2965
|
-
};
|
|
2966
|
-
|
|
2967
2941
|
/*
|
|
2968
2942
|
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
2969
2943
|
* Licensed under the MIT license.
|
|
@@ -3227,39 +3201,29 @@ class BaoModalContainer extends _BaoModalContainerBase {
|
|
|
3227
3201
|
/** State of the modal animation. */
|
|
3228
3202
|
this._state = 'enter';
|
|
3229
3203
|
}
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
await this._trapFocus();
|
|
3234
|
-
this._animationStateChanged.next({ state: 'opened', totalTime });
|
|
3235
|
-
}
|
|
3236
|
-
else if (toState === 'exit') {
|
|
3237
|
-
this._restoreFocus();
|
|
3238
|
-
this._animationStateChanged.next({ state: 'closed', totalTime });
|
|
3239
|
-
}
|
|
3240
|
-
}
|
|
3241
|
-
/** Callback, invoked when an animation on the host starts. */
|
|
3242
|
-
_onAnimationStart({ toState, totalTime }) {
|
|
3243
|
-
if (toState === 'enter') {
|
|
3244
|
-
this._animationStateChanged.next({ state: 'opening', totalTime });
|
|
3245
|
-
}
|
|
3246
|
-
else if (toState === 'exit' || toState === 'void') {
|
|
3247
|
-
this._animationStateChanged.next({ state: 'closing', totalTime });
|
|
3248
|
-
}
|
|
3204
|
+
_startOpenAnimation() {
|
|
3205
|
+
this._animationStateChanged.emit({ state: 'opening', totalTime: 20 });
|
|
3206
|
+
void Promise.resolve().then(() => this._finishDialogOpen());
|
|
3249
3207
|
}
|
|
3250
3208
|
/** Starts the modal exit animation. */
|
|
3251
3209
|
_startExitAnimation() {
|
|
3252
|
-
this.
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
this.
|
|
3210
|
+
this._animationStateChanged.emit({ state: 'closed', totalTime: 20 });
|
|
3211
|
+
}
|
|
3212
|
+
_finishDialogOpen() {
|
|
3213
|
+
this._openAnimationDone(20);
|
|
3214
|
+
}
|
|
3215
|
+
_openAnimationDone(totalTime) {
|
|
3216
|
+
if (this._config.delayFocusTrap) {
|
|
3217
|
+
void this._trapFocus();
|
|
3218
|
+
}
|
|
3219
|
+
this._animationStateChanged.next({ state: 'opened', totalTime });
|
|
3256
3220
|
}
|
|
3257
3221
|
}
|
|
3258
3222
|
BaoModalContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalContainer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3259
|
-
BaoModalContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoModalContainer, selector: "bao-modal-container", host: { attributes: { "tabindex": "-1", "aria-modal": "true" },
|
|
3223
|
+
BaoModalContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoModalContainer, selector: "bao-modal-container", host: { attributes: { "tabindex": "-1", "aria-modal": "true" }, properties: { "id": "_id", "attr.role": "_config.role", "attr.aria-labelledby": "_config.ariaLabel ? null : _ariaLabelledBy", "attr.aria-label": "_config.ariaLabel", "attr.aria-describedby": "_config.ariaDescribedBy || null" }, classAttribute: "bao-modal-container" }, usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\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-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed;z-index:1000}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;z-index:1000;display:flex}.cdk-overlay-pane.bao-modal-mobil-full{width:100%;height:100%}.cdk-overlay-pane.bao-modal-mobil-compact{width:300px;height:100%}@media (min-width: 768px){.cdk-overlay-pane{width:500px;height:auto}.cdk-overlay-pane.bao-modal-lg{width:calc(100% - 4rem);height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-md,.cdk-overlay-pane.bao-modal-sm{width:500px;height:auto;max-height:calc(100% - 4rem)}}@media (min-width: 992px){.cdk-overlay-pane{width:500px;height:auto}.cdk-overlay-pane.bao-modal-lg{width:calc(100% - 4rem);height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-md{width:800px;height:auto;max-height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-sm{width:500px;height:auto;max-height:calc(100% - 4rem)}}.cdk-overlay-backdrop{position:absolute;inset:0;z-index:1000;pointer-events:auto;-webkit-tap-highlight-color:transparent;transition:opacity .4s cubic-bezier(.25,.8,.25,1);opacity:0}.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.5}.cdk-high-contrast-active .cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.6}.cdk-overlay-dark-backdrop{background:black}.cdk-overlay-transparent-backdrop,.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing{opacity:.5}.cdk-overlay-connected-position-bounding-box{position:absolute;z-index:1000;display:flex;flex-direction:column;min-width:1px;min-height:1px}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}.bao-modal-container{display:block;overflow:auto;min-height:inherit;max-height:inherit;background-color:#fff;background-clip:padding-box;border:0 solid rgba(0,0,0,.2);border-radius:.5rem;outline:0}.bao-modal-content{display:flex;flex-direction:column;height:100%}.bao-modal-header{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #ced4da;border-top-left-radius:.5rem;border-top-right-radius:.5rem}.bao-modal-header .bao-modal-title{font-size:1rem;line-height:1.5rem;margin:1rem 0 1rem 1rem}.bao-modal-header button{margin:.5rem}.bao-modal-body{display:block;padding:1rem;overflow:auto;flex-grow:1}@media (min-width: 768px){.bao-modal-body{padding:2rem}}.bao-modal-footer{display:flex;flex-wrap:wrap;padding:1rem;border-top:1px solid #ced4da;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.bao-modal-footer.bao-modal-footer-order{justify-content:unset;flex-direction:column-reverse}.bao-modal-footer button{text-align:center}.bao-modal-footer .bao-button-primary,.bao-modal-footer .bao-button-secondary{width:100%;display:block}.bao-modal-footer .bao-button-secondary{margin-bottom:.5rem}.bao-modal-footer .bao-button-tertiary{display:none}@media (min-width: 768px){.bao-modal-footer{justify-content:flex-end}.bao-modal-footer.bao-modal-footer-order{flex-direction:row-reverse}.bao-modal-footer .bao-button-primary{margin-left:1rem}.bao-modal-footer .bao-button-secondary{margin-bottom:0}.bao-modal-footer .bao-button-primary,.bao-modal-footer .bao-button-secondary{width:auto}.bao-modal-footer .bao-button-tertiary{display:block}}\n"], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
3260
3224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalContainer, decorators: [{
|
|
3261
3225
|
type: Component,
|
|
3262
|
-
args: [{ selector: 'bao-modal-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default,
|
|
3226
|
+
args: [{ selector: 'bao-modal-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, host: {
|
|
3263
3227
|
class: 'bao-modal-container',
|
|
3264
3228
|
tabindex: '-1',
|
|
3265
3229
|
'aria-modal': 'true',
|
|
@@ -3267,22 +3231,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3267
3231
|
'[attr.role]': '_config.role',
|
|
3268
3232
|
'[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',
|
|
3269
3233
|
'[attr.aria-label]': '_config.ariaLabel',
|
|
3270
|
-
'[attr.aria-describedby]': '_config.ariaDescribedBy || null'
|
|
3271
|
-
|
|
3272
|
-
'(@modalContainer.start)': '_onAnimationStart($event)',
|
|
3273
|
-
'(@modalContainer.done)': '_onAnimationDone($event)'
|
|
3274
|
-
}, template: "<ng-template cdkPortalOutlet></ng-template>\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-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed;z-index:1000}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;z-index:1000;display:flex}.cdk-overlay-pane.bao-modal-mobil-full{width:100%;height:100%}.cdk-overlay-pane.bao-modal-mobil-compact{width:300px;height:100%}@media (min-width: 768px){.cdk-overlay-pane{width:500px;height:auto}.cdk-overlay-pane.bao-modal-lg{width:calc(100% - 4rem);height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-md,.cdk-overlay-pane.bao-modal-sm{width:500px;height:auto}}@media (min-width: 992px){.cdk-overlay-pane{width:500px;height:auto}.cdk-overlay-pane.bao-modal-lg{width:calc(100% - 4rem);height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-md{width:800px;height:auto}.cdk-overlay-pane.bao-modal-sm{width:500px;height:auto}}.cdk-overlay-backdrop{position:absolute;inset:0;z-index:1000;pointer-events:auto;-webkit-tap-highlight-color:transparent;transition:opacity .4s cubic-bezier(.25,.8,.25,1);opacity:0}.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.5}.cdk-high-contrast-active .cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.6}.cdk-overlay-dark-backdrop{background:black}.cdk-overlay-transparent-backdrop,.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing{opacity:.5}.cdk-overlay-connected-position-bounding-box{position:absolute;z-index:1000;display:flex;flex-direction:column;min-width:1px;min-height:1px}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}.bao-modal-container{display:block;overflow:auto;width:100%;height:100%;min-height:inherit;max-height:inherit;background-color:#fff;background-clip:padding-box;border:0 solid rgba(0,0,0,.2);border-radius:.5rem;outline:0}.bao-modal-content{display:flex;flex-direction:column;height:100%}.bao-modal-header{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #ced4da;border-top-left-radius:.5rem;border-top-right-radius:.5rem}.bao-modal-header .bao-modal-title{font-size:1rem;line-height:1.5rem;margin:1rem 0 1rem 1rem}.bao-modal-header button{margin:.5rem}.bao-modal-body{display:block;padding:1rem;overflow:auto;flex-grow:1}@media (min-width: 768px){.bao-modal-body{padding:2rem}}.bao-modal-footer{display:flex;flex-wrap:wrap;padding:1rem;border-top:1px solid #ced4da;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.bao-modal-footer.bao-modal-footer-order{justify-content:unset;flex-direction:column-reverse}.bao-modal-footer button{text-align:center}.bao-modal-footer .bao-button-primary,.bao-modal-footer .bao-button-secondary{width:100%;display:block}.bao-modal-footer .bao-button-secondary{margin-bottom:.5rem}.bao-modal-footer .bao-button-tertiary{display:none}@media (min-width: 768px){.bao-modal-footer{justify-content:flex-end}.bao-modal-footer.bao-modal-footer-order{flex-direction:row-reverse}.bao-modal-footer .bao-button-primary{margin-left:1rem}.bao-modal-footer .bao-button-secondary{margin-bottom:0}.bao-modal-footer .bao-button-primary,.bao-modal-footer .bao-button-secondary{width:auto}.bao-modal-footer .bao-button-tertiary{display:block}}\n"] }]
|
|
3234
|
+
'[attr.aria-describedby]': '_config.ariaDescribedBy || null'
|
|
3235
|
+
}, template: "<ng-template cdkPortalOutlet></ng-template>\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-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed;z-index:1000}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute;z-index:1000}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;z-index:1000;display:flex}.cdk-overlay-pane.bao-modal-mobil-full{width:100%;height:100%}.cdk-overlay-pane.bao-modal-mobil-compact{width:300px;height:100%}@media (min-width: 768px){.cdk-overlay-pane{width:500px;height:auto}.cdk-overlay-pane.bao-modal-lg{width:calc(100% - 4rem);height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-md,.cdk-overlay-pane.bao-modal-sm{width:500px;height:auto;max-height:calc(100% - 4rem)}}@media (min-width: 992px){.cdk-overlay-pane{width:500px;height:auto}.cdk-overlay-pane.bao-modal-lg{width:calc(100% - 4rem);height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-md{width:800px;height:auto;max-height:calc(100% - 4rem)}.cdk-overlay-pane.bao-modal-sm{width:500px;height:auto;max-height:calc(100% - 4rem)}}.cdk-overlay-backdrop{position:absolute;inset:0;z-index:1000;pointer-events:auto;-webkit-tap-highlight-color:transparent;transition:opacity .4s cubic-bezier(.25,.8,.25,1);opacity:0}.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.5}.cdk-high-contrast-active .cdk-overlay-backdrop.cdk-overlay-backdrop-showing{opacity:.6}.cdk-overlay-dark-backdrop{background:black}.cdk-overlay-transparent-backdrop,.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing{opacity:.5}.cdk-overlay-connected-position-bounding-box{position:absolute;z-index:1000;display:flex;flex-direction:column;min-width:1px;min-height:1px}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}.bao-modal-container{display:block;overflow:auto;min-height:inherit;max-height:inherit;background-color:#fff;background-clip:padding-box;border:0 solid rgba(0,0,0,.2);border-radius:.5rem;outline:0}.bao-modal-content{display:flex;flex-direction:column;height:100%}.bao-modal-header{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #ced4da;border-top-left-radius:.5rem;border-top-right-radius:.5rem}.bao-modal-header .bao-modal-title{font-size:1rem;line-height:1.5rem;margin:1rem 0 1rem 1rem}.bao-modal-header button{margin:.5rem}.bao-modal-body{display:block;padding:1rem;overflow:auto;flex-grow:1}@media (min-width: 768px){.bao-modal-body{padding:2rem}}.bao-modal-footer{display:flex;flex-wrap:wrap;padding:1rem;border-top:1px solid #ced4da;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.bao-modal-footer.bao-modal-footer-order{justify-content:unset;flex-direction:column-reverse}.bao-modal-footer button{text-align:center}.bao-modal-footer .bao-button-primary,.bao-modal-footer .bao-button-secondary{width:100%;display:block}.bao-modal-footer .bao-button-secondary{margin-bottom:.5rem}.bao-modal-footer .bao-button-tertiary{display:none}@media (min-width: 768px){.bao-modal-footer{justify-content:flex-end}.bao-modal-footer.bao-modal-footer-order{flex-direction:row-reverse}.bao-modal-footer .bao-button-primary{margin-left:1rem}.bao-modal-footer .bao-button-secondary{margin-bottom:0}.bao-modal-footer .bao-button-primary,.bao-modal-footer .bao-button-secondary{width:auto}.bao-modal-footer .bao-button-tertiary{display:block}}\n"] }]
|
|
3275
3236
|
}] });
|
|
3276
3237
|
|
|
3277
3238
|
// Counter for unique modal ids.
|
|
3278
|
-
let uniqueId = 0;
|
|
3239
|
+
let uniqueId$1 = 0;
|
|
3279
3240
|
/**
|
|
3280
3241
|
* Reference to a modal opened via the BaoModalService.
|
|
3281
3242
|
*/
|
|
3282
3243
|
class BaoModalRef {
|
|
3283
3244
|
constructor(_overlayRef, _containerInstance,
|
|
3284
3245
|
/** Id of the modal. */
|
|
3285
|
-
id = `bao-modal-${uniqueId++}`) {
|
|
3246
|
+
id = `bao-modal-${uniqueId$1++}`) {
|
|
3286
3247
|
this._overlayRef = _overlayRef;
|
|
3287
3248
|
this._containerInstance = _containerInstance;
|
|
3288
3249
|
this.id = id;
|
|
@@ -3363,6 +3324,9 @@ class BaoModalRef {
|
|
|
3363
3324
|
this._state = 1 /* CLOSING */;
|
|
3364
3325
|
this._containerInstance._startExitAnimation();
|
|
3365
3326
|
}
|
|
3327
|
+
startOpenAnimation() {
|
|
3328
|
+
this._containerInstance._startOpenAnimation();
|
|
3329
|
+
}
|
|
3366
3330
|
/**
|
|
3367
3331
|
* Gets an observable that is notified when the modal is finished opening.
|
|
3368
3332
|
*/
|
|
@@ -3475,7 +3439,7 @@ function _closeModalVia(ref, interactionType, result) {
|
|
|
3475
3439
|
/** Injection token that can be used to access the data that was passed in to a modal. */
|
|
3476
3440
|
const BAO_MODAL_DATA = new InjectionToken('BaoModalData');
|
|
3477
3441
|
class BaoModalBase {
|
|
3478
|
-
constructor(_overlay, _injector, _parentModal, _overlayContainer, _modalRefConstructor, _modalContainerType, _modalDataToken
|
|
3442
|
+
constructor(_overlay, _injector, _parentModal, _overlayContainer, _modalRefConstructor, _modalContainerType, _modalDataToken) {
|
|
3479
3443
|
this._overlay = _overlay;
|
|
3480
3444
|
this._injector = _injector;
|
|
3481
3445
|
this._parentModal = _parentModal;
|
|
@@ -3483,7 +3447,6 @@ class BaoModalBase {
|
|
|
3483
3447
|
this._modalRefConstructor = _modalRefConstructor;
|
|
3484
3448
|
this._modalContainerType = _modalContainerType;
|
|
3485
3449
|
this._modalDataToken = _modalDataToken;
|
|
3486
|
-
this._animationMode = _animationMode;
|
|
3487
3450
|
this.afterAllClosed = defer(() => this.openModals.length
|
|
3488
3451
|
? this.getAfterAllClosed()
|
|
3489
3452
|
: this.getAfterAllClosed().pipe(startWith(undefined)));
|
|
@@ -3523,21 +3486,6 @@ class BaoModalBase {
|
|
|
3523
3486
|
}
|
|
3524
3487
|
const overlayRef = this._createOverlay(conf);
|
|
3525
3488
|
const modalContainer = this._attachModalContainer(overlayRef, conf);
|
|
3526
|
-
if (this._animationMode !== 'NoopAnimations') {
|
|
3527
|
-
const animationStateSubscription = modalContainer._animationStateChanged.subscribe(modalAnimationEvent => {
|
|
3528
|
-
if (modalAnimationEvent.state === 'opening') {
|
|
3529
|
-
this._modalAnimatingOpen = true;
|
|
3530
|
-
}
|
|
3531
|
-
if (modalAnimationEvent.state === 'opened') {
|
|
3532
|
-
this._modalAnimatingOpen = false;
|
|
3533
|
-
animationStateSubscription.unsubscribe();
|
|
3534
|
-
}
|
|
3535
|
-
});
|
|
3536
|
-
if (!this._animationStateSubscriptions) {
|
|
3537
|
-
this._animationStateSubscriptions = new Subscription();
|
|
3538
|
-
}
|
|
3539
|
-
this._animationStateSubscriptions.add(animationStateSubscription);
|
|
3540
|
-
}
|
|
3541
3489
|
const modalRef = this._attachModalContent(componentOrTemplateRef, modalContainer, overlayRef, conf);
|
|
3542
3490
|
this._lastModalRef = modalRef;
|
|
3543
3491
|
// If this is the first modal that we're opening, hide all the non-overlay content.
|
|
@@ -3608,6 +3556,7 @@ class BaoModalBase {
|
|
|
3608
3556
|
});
|
|
3609
3557
|
const containerPortal = new ComponentPortal(this._modalContainerType, config.viewContainerRef, injector);
|
|
3610
3558
|
const containerRef = overlay.attach(containerPortal);
|
|
3559
|
+
containerRef.instance._startOpenAnimation();
|
|
3611
3560
|
return containerRef.instance;
|
|
3612
3561
|
}
|
|
3613
3562
|
/**
|
|
@@ -3725,16 +3674,16 @@ BaoModalBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
|
|
|
3725
3674
|
BaoModalBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoModalBase, ngImport: i0 });
|
|
3726
3675
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalBase, decorators: [{
|
|
3727
3676
|
type: Directive
|
|
3728
|
-
}], ctorParameters: function () { return [{ type: i1$4.Overlay }, { type: i0.Injector }, { type: undefined }, { type: i1$4.OverlayContainer }, { type: i0.Type }, { type: i0.Type }, { type: i0.InjectionToken }
|
|
3677
|
+
}], ctorParameters: function () { return [{ type: i1$4.Overlay }, { type: i0.Injector }, { type: undefined }, { type: i1$4.OverlayContainer }, { type: i0.Type }, { type: i0.Type }, { type: i0.InjectionToken }]; } });
|
|
3729
3678
|
/**
|
|
3730
3679
|
* Service to open modal.
|
|
3731
3680
|
*/
|
|
3732
3681
|
class BaoModal extends BaoModalBase {
|
|
3733
|
-
constructor(overlay, injector, parentModal, overlayContainer
|
|
3734
|
-
super(overlay, injector, parentModal, overlayContainer, BaoModalRef, BaoModalContainer, BAO_MODAL_DATA
|
|
3682
|
+
constructor(overlay, injector, parentModal, overlayContainer) {
|
|
3683
|
+
super(overlay, injector, parentModal, overlayContainer, BaoModalRef, BaoModalContainer, BAO_MODAL_DATA);
|
|
3735
3684
|
}
|
|
3736
3685
|
}
|
|
3737
|
-
BaoModal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModal, deps: [{ token: i1$4.Overlay }, { token: i0.Injector }, { token: BaoModal, optional: true, skipSelf: true }, { token: i1$4.OverlayContainer }
|
|
3686
|
+
BaoModal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModal, deps: [{ token: i1$4.Overlay }, { token: i0.Injector }, { token: BaoModal, optional: true, skipSelf: true }, { token: i1$4.OverlayContainer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3738
3687
|
BaoModal.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModal });
|
|
3739
3688
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModal, decorators: [{
|
|
3740
3689
|
type: Injectable
|
|
@@ -3742,12 +3691,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3742
3691
|
type: Optional
|
|
3743
3692
|
}, {
|
|
3744
3693
|
type: SkipSelf
|
|
3745
|
-
}] }, { type: i1$4.OverlayContainer }
|
|
3746
|
-
type: Optional
|
|
3747
|
-
}, {
|
|
3748
|
-
type: Inject,
|
|
3749
|
-
args: [ANIMATION_MODULE_TYPE]
|
|
3750
|
-
}] }]; } });
|
|
3694
|
+
}] }, { type: i1$4.OverlayContainer }]; } });
|
|
3751
3695
|
|
|
3752
3696
|
/*
|
|
3753
3697
|
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
@@ -3837,28 +3781,12 @@ const MODAL_DIRECTIVES = [BaoModalContainer, BaoModalClose];
|
|
|
3837
3781
|
class BaoModalModule {
|
|
3838
3782
|
}
|
|
3839
3783
|
BaoModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3840
|
-
BaoModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, declarations: [BaoModalContainer, BaoModalClose], imports: [CommonModule,
|
|
3841
|
-
|
|
3842
|
-
PortalModule,
|
|
3843
|
-
BrowserAnimationsModule,
|
|
3844
|
-
NoopAnimationsModule], exports: [BaoModalContainer, BaoModalClose] });
|
|
3845
|
-
BaoModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, providers: [BaoModal], imports: [[
|
|
3846
|
-
CommonModule,
|
|
3847
|
-
OverlayModule,
|
|
3848
|
-
PortalModule,
|
|
3849
|
-
BrowserAnimationsModule,
|
|
3850
|
-
NoopAnimationsModule
|
|
3851
|
-
]] });
|
|
3784
|
+
BaoModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, declarations: [BaoModalContainer, BaoModalClose], imports: [CommonModule, OverlayModule, PortalModule], exports: [BaoModalContainer, BaoModalClose] });
|
|
3785
|
+
BaoModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, providers: [BaoModal], imports: [[CommonModule, OverlayModule, PortalModule]] });
|
|
3852
3786
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, decorators: [{
|
|
3853
3787
|
type: NgModule,
|
|
3854
3788
|
args: [{
|
|
3855
|
-
imports: [
|
|
3856
|
-
CommonModule,
|
|
3857
|
-
OverlayModule,
|
|
3858
|
-
PortalModule,
|
|
3859
|
-
BrowserAnimationsModule,
|
|
3860
|
-
NoopAnimationsModule
|
|
3861
|
-
],
|
|
3789
|
+
imports: [CommonModule, OverlayModule, PortalModule],
|
|
3862
3790
|
declarations: MODAL_DIRECTIVES,
|
|
3863
3791
|
exports: MODAL_DIRECTIVES,
|
|
3864
3792
|
providers: [BaoModal]
|
|
@@ -3982,6 +3910,10 @@ class BaoDropdownMenuItem {
|
|
|
3982
3910
|
* Is the list item disabled
|
|
3983
3911
|
*/
|
|
3984
3912
|
this.disabled = false;
|
|
3913
|
+
/**
|
|
3914
|
+
* Emits when menu item is clicked
|
|
3915
|
+
*/
|
|
3916
|
+
this.itemClicked = new EventEmitter();
|
|
3985
3917
|
}
|
|
3986
3918
|
get nativeElement() {
|
|
3987
3919
|
return this.elementRef.nativeElement;
|
|
@@ -4062,19 +3994,25 @@ class BaoDropdownMenuItem {
|
|
|
4062
3994
|
}
|
|
4063
3995
|
}
|
|
4064
3996
|
/**
|
|
4065
|
-
* This method propagates a click event to menu item children with inputs (checkbox, radio button)
|
|
3997
|
+
* This method propagates a click event to menu item children with inputs (checkbox, radio button).
|
|
3998
|
+
* It emits event to close menu if item does not contain an input.
|
|
4066
3999
|
*/
|
|
4067
4000
|
propagateClick() {
|
|
4001
|
+
let closeMenu = true;
|
|
4068
4002
|
for (let i = 0; i < this.nativeElement.children.length; i++) {
|
|
4069
4003
|
if (this.nativeElement.children.item(i).firstElementChild.localName ==
|
|
4070
4004
|
'input') {
|
|
4071
4005
|
this.nativeElement.children.item(i).firstElementChild.click();
|
|
4006
|
+
closeMenu = false;
|
|
4072
4007
|
}
|
|
4073
4008
|
}
|
|
4009
|
+
if (closeMenu) {
|
|
4010
|
+
this.itemClicked.emit();
|
|
4011
|
+
}
|
|
4074
4012
|
}
|
|
4075
4013
|
}
|
|
4076
4014
|
BaoDropdownMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoDropdownMenuItem, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: BaoDropdownMenuComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4077
|
-
BaoDropdownMenuItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoDropdownMenuItem, selector: "bao-dropdown-menu-item, [bao-dropdown-menu-item]", inputs: { disabled: "disabled" }, host: { listeners: { "window:keyup.space": "spaceKeyEvent()", "click": "onClick($event.target)", "window:
|
|
4015
|
+
BaoDropdownMenuItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoDropdownMenuItem, selector: "bao-dropdown-menu-item, [bao-dropdown-menu-item]", inputs: { disabled: "disabled" }, outputs: { itemClicked: "itemClicked" }, host: { listeners: { "window:keyup.space": "spaceKeyEvent()", "click": "onClick($event.target)", "window:keyup.enter": "enterKeyEvent()" }, properties: { "class.bao-dropdown-menu-item-disabled": "disabled===true" }, classAttribute: "bao-dropdown-menu-item" }, usesOnChanges: true, ngImport: i0 });
|
|
4078
4016
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoDropdownMenuItem, decorators: [{
|
|
4079
4017
|
type: Directive,
|
|
4080
4018
|
args: [{
|
|
@@ -4086,6 +4024,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4086
4024
|
}]
|
|
4087
4025
|
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: BaoDropdownMenuComponent }]; }, propDecorators: { disabled: [{
|
|
4088
4026
|
type: Input
|
|
4027
|
+
}], itemClicked: [{
|
|
4028
|
+
type: Output
|
|
4089
4029
|
}], spaceKeyEvent: [{
|
|
4090
4030
|
type: HostListener,
|
|
4091
4031
|
args: ['window:keyup.space']
|
|
@@ -4094,7 +4034,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4094
4034
|
args: ['click', ['$event.target']]
|
|
4095
4035
|
}], enterKeyEvent: [{
|
|
4096
4036
|
type: HostListener,
|
|
4097
|
-
args: ['window:
|
|
4037
|
+
args: ['window:keyup.enter']
|
|
4098
4038
|
}] } });
|
|
4099
4039
|
class BaoDropdownMenuComponent {
|
|
4100
4040
|
constructor(cdr, renderer, elementRef) {
|
|
@@ -4172,6 +4112,9 @@ class BaoDropdownMenuComponent {
|
|
|
4172
4112
|
this.renderer.setAttribute(this.nativeElement, 'id', this.menuId);
|
|
4173
4113
|
this._menuPortal = new DomPortal(this._menuContent);
|
|
4174
4114
|
}
|
|
4115
|
+
ngAfterContentInit() {
|
|
4116
|
+
this._listItems.forEach((item) => item.itemClicked.subscribe(() => this.isClosedByKeyEvent.emit()));
|
|
4117
|
+
}
|
|
4175
4118
|
focusFirstItem() {
|
|
4176
4119
|
this._activeItemIndex = 0;
|
|
4177
4120
|
this._listItems.first.nativeElement.focus();
|
|
@@ -4292,8 +4235,9 @@ class BaoDropdownMenuTrigger {
|
|
|
4292
4235
|
}
|
|
4293
4236
|
/** Enter key event triggers click event which opens menu,
|
|
4294
4237
|
* then focus is put on first item in the menu */
|
|
4295
|
-
enterKeyEvent() {
|
|
4238
|
+
enterKeyEvent(event) {
|
|
4296
4239
|
if (this._isMenuOpen && document.activeElement === this.nativeElement) {
|
|
4240
|
+
event.stopImmediatePropagation();
|
|
4297
4241
|
this.menu.focusFirstItem();
|
|
4298
4242
|
}
|
|
4299
4243
|
}
|
|
@@ -4365,11 +4309,18 @@ class BaoDropdownMenuTrigger {
|
|
|
4365
4309
|
overlayY: 'bottom'
|
|
4366
4310
|
},
|
|
4367
4311
|
{
|
|
4368
|
-
// top-right of the overlay is connected to bottom-
|
|
4369
|
-
originX: '
|
|
4312
|
+
// top-right of the overlay is connected to bottom-right of the origin;
|
|
4313
|
+
originX: 'end',
|
|
4370
4314
|
originY: 'bottom',
|
|
4371
4315
|
overlayX: 'end',
|
|
4372
4316
|
overlayY: 'top'
|
|
4317
|
+
},
|
|
4318
|
+
{
|
|
4319
|
+
// bottom-right of the overlay is connected to top-right of the origin;
|
|
4320
|
+
originX: 'end',
|
|
4321
|
+
originY: 'top',
|
|
4322
|
+
overlayX: 'end',
|
|
4323
|
+
overlayY: 'bottom'
|
|
4373
4324
|
}
|
|
4374
4325
|
]),
|
|
4375
4326
|
backdropClass: 'bao-overlay-transparent-backdrop',
|
|
@@ -4379,7 +4330,7 @@ class BaoDropdownMenuTrigger {
|
|
|
4379
4330
|
}
|
|
4380
4331
|
}
|
|
4381
4332
|
BaoDropdownMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoDropdownMenuTrigger, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1$4.Overlay }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4382
|
-
BaoDropdownMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoDropdownMenuTrigger, selector: "bao-dropdown-menu-trigger, [bao-dropdown-menu-trigger], [baoDropdownMenuTriggerFor]", inputs: { menu: ["baoDropdownMenuTriggerFor", "menu"] }, host: { listeners: { "window:keyup.escape": "escapeKeyEvent()", "window:keyup.enter": "enterKeyEvent()", "click": "onClick()" }, classAttribute: "bao-dropdown-menu-trigger" }, ngImport: i0 });
|
|
4333
|
+
BaoDropdownMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoDropdownMenuTrigger, selector: "bao-dropdown-menu-trigger, [bao-dropdown-menu-trigger], [baoDropdownMenuTriggerFor]", inputs: { menu: ["baoDropdownMenuTriggerFor", "menu"] }, host: { listeners: { "window:keyup.escape": "escapeKeyEvent()", "window:keyup.enter": "enterKeyEvent($event)", "click": "onClick()" }, classAttribute: "bao-dropdown-menu-trigger" }, ngImport: i0 });
|
|
4383
4334
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoDropdownMenuTrigger, decorators: [{
|
|
4384
4335
|
type: Directive,
|
|
4385
4336
|
args: [{
|
|
@@ -4394,7 +4345,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4394
4345
|
args: ['window:keyup.escape']
|
|
4395
4346
|
}], enterKeyEvent: [{
|
|
4396
4347
|
type: HostListener,
|
|
4397
|
-
args: ['window:keyup.enter']
|
|
4348
|
+
args: ['window:keyup.enter', ['$event']]
|
|
4398
4349
|
}], onClick: [{
|
|
4399
4350
|
type: HostListener,
|
|
4400
4351
|
args: ['click']
|
|
@@ -4604,12 +4555,12 @@ class BaoFilePreviewComponent {
|
|
|
4604
4555
|
}
|
|
4605
4556
|
}
|
|
4606
4557
|
BaoFilePreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFilePreviewComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
4607
|
-
BaoFilePreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoFilePreviewComponent, selector: "bao-file-preview, [bao-file-preview]", inputs: { file: "file", isLoading: "isLoading" }, host: { classAttribute: "bao-file-preview" }, ngImport: i0, template: "<div class=\"bao-file-info\">\n <ng-content select=\"bao-icon\"></ng-content>\n <bao-icon\n *ngIf=\"insertGenericIcon && !thumbnailURL\"\n class=\"bao-file-media\"\n svgIcon=\"icon-file\"\n >\n </bao-icon>\n <ng-container *ngIf=\"thumbnailURL && !isLoading\">\n <img\n class=\"bao-file-media\"\n [src]=\"thumbnailURL\"\n width=\"40px\"\n height=\"40px\"\n />\n </ng-container>\n <div class=\"bao-file-text\">\n <div class=\"bao-file-name\">{{ file.name }}</div>\n <div class=\"bao-file-size\">{{ fileSize }}</div>\n </div>\n</div>\n<ng-container *ngIf=\"!isLoading\">\n <ng-content select=\"button[bao-button]\"></ng-content>\n <ng-content select=\"baoDropdownTriggerFor\"></ng-content>\n</ng-container>\n<bao-icon\n *ngIf=\"isLoading\"\n class=\"loading-spinner\"\n svgIcon=\"icon-spinner\"\n title=\"chargement\"\n></bao-icon>\n", styles: [".bao-file-preview{display:flex;align-items:center;justify-content:space-between;padding-top:.625rem;padding-bottom:.625rem;list-style-type:none}.bao-file-preview
|
|
4558
|
+
BaoFilePreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoFilePreviewComponent, selector: "bao-file-preview, [bao-file-preview]", inputs: { file: "file", isLoading: "isLoading" }, host: { classAttribute: "bao-file-preview" }, ngImport: i0, template: "<div class=\"bao-file-info\">\n <ng-content select=\"bao-icon\"></ng-content>\n <bao-icon\n *ngIf=\"insertGenericIcon && !thumbnailURL\"\n class=\"bao-file-media\"\n svgIcon=\"icon-file\"\n >\n </bao-icon>\n <ng-container *ngIf=\"thumbnailURL && !isLoading\">\n <img\n class=\"bao-file-media\"\n [src]=\"thumbnailURL\"\n width=\"40px\"\n height=\"40px\"\n />\n </ng-container>\n <div class=\"bao-file-text\">\n <div class=\"bao-file-name\">{{ file.name }}</div>\n <div class=\"bao-file-size\">{{ fileSize }}</div>\n </div>\n</div>\n<ng-container *ngIf=\"!isLoading\">\n <ng-content select=\"button[bao-button]\"></ng-content>\n <ng-content select=\"baoDropdownTriggerFor\"></ng-content>\n</ng-container>\n<bao-icon\n *ngIf=\"isLoading\"\n class=\"loading-spinner\"\n svgIcon=\"icon-spinner\"\n title=\"chargement\"\n></bao-icon>\n", styles: [".bao-file-preview{display:flex;align-items:center;justify-content:space-between;padding-top:.625rem;padding-bottom:.625rem;list-style-type:none}.bao-file-preview>.bao-file-info{display:flex;align-items:center}.bao-file-preview>.bao-file-info>.bao-icon{color:#adb2bd;flex-shrink:0}.bao-file-preview>.bao-file-info>.bao-file-media{margin-right:1rem}.bao-file-preview>.bao-file-info>.bao-file-text{display:inline-flex;flex-direction:column;margin-right:1rem}.bao-file-preview>.bao-file-info>.bao-file-text>.bao-file-name{overflow:hidden;font-weight:700;font-size:.875rem;line-height:1.25rem;color:#212529}.bao-file-preview>.bao-file-info>.bao-file-text>.bao-file-size{font-weight:400;font-size:.75rem;line-height:1rem;color:#637381}.bao-file-preview .loading-spinner{color:#097d6c}.bao-file-preview .bao-dropdown-menu-container{position:absolute;margin-left:auto}\n"], components: [{ type: BaoIconComponent, selector: "bao-icon", inputs: ["color", "size", "svgIcon", "title"], exportAs: ["baoIcon"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
4608
4559
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFilePreviewComponent, decorators: [{
|
|
4609
4560
|
type: Component,
|
|
4610
4561
|
args: [{ selector: 'bao-file-preview, [bao-file-preview]', encapsulation: ViewEncapsulation.None, host: {
|
|
4611
4562
|
class: 'bao-file-preview'
|
|
4612
|
-
}, template: "<div class=\"bao-file-info\">\n <ng-content select=\"bao-icon\"></ng-content>\n <bao-icon\n *ngIf=\"insertGenericIcon && !thumbnailURL\"\n class=\"bao-file-media\"\n svgIcon=\"icon-file\"\n >\n </bao-icon>\n <ng-container *ngIf=\"thumbnailURL && !isLoading\">\n <img\n class=\"bao-file-media\"\n [src]=\"thumbnailURL\"\n width=\"40px\"\n height=\"40px\"\n />\n </ng-container>\n <div class=\"bao-file-text\">\n <div class=\"bao-file-name\">{{ file.name }}</div>\n <div class=\"bao-file-size\">{{ fileSize }}</div>\n </div>\n</div>\n<ng-container *ngIf=\"!isLoading\">\n <ng-content select=\"button[bao-button]\"></ng-content>\n <ng-content select=\"baoDropdownTriggerFor\"></ng-content>\n</ng-container>\n<bao-icon\n *ngIf=\"isLoading\"\n class=\"loading-spinner\"\n svgIcon=\"icon-spinner\"\n title=\"chargement\"\n></bao-icon>\n", styles: [".bao-file-preview{display:flex;align-items:center;justify-content:space-between;padding-top:.625rem;padding-bottom:.625rem;list-style-type:none}.bao-file-preview
|
|
4563
|
+
}, template: "<div class=\"bao-file-info\">\n <ng-content select=\"bao-icon\"></ng-content>\n <bao-icon\n *ngIf=\"insertGenericIcon && !thumbnailURL\"\n class=\"bao-file-media\"\n svgIcon=\"icon-file\"\n >\n </bao-icon>\n <ng-container *ngIf=\"thumbnailURL && !isLoading\">\n <img\n class=\"bao-file-media\"\n [src]=\"thumbnailURL\"\n width=\"40px\"\n height=\"40px\"\n />\n </ng-container>\n <div class=\"bao-file-text\">\n <div class=\"bao-file-name\">{{ file.name }}</div>\n <div class=\"bao-file-size\">{{ fileSize }}</div>\n </div>\n</div>\n<ng-container *ngIf=\"!isLoading\">\n <ng-content select=\"button[bao-button]\"></ng-content>\n <ng-content select=\"baoDropdownTriggerFor\"></ng-content>\n</ng-container>\n<bao-icon\n *ngIf=\"isLoading\"\n class=\"loading-spinner\"\n svgIcon=\"icon-spinner\"\n title=\"chargement\"\n></bao-icon>\n", styles: [".bao-file-preview{display:flex;align-items:center;justify-content:space-between;padding-top:.625rem;padding-bottom:.625rem;list-style-type:none}.bao-file-preview>.bao-file-info{display:flex;align-items:center}.bao-file-preview>.bao-file-info>.bao-icon{color:#adb2bd;flex-shrink:0}.bao-file-preview>.bao-file-info>.bao-file-media{margin-right:1rem}.bao-file-preview>.bao-file-info>.bao-file-text{display:inline-flex;flex-direction:column;margin-right:1rem}.bao-file-preview>.bao-file-info>.bao-file-text>.bao-file-name{overflow:hidden;font-weight:700;font-size:.875rem;line-height:1.25rem;color:#212529}.bao-file-preview>.bao-file-info>.bao-file-text>.bao-file-size{font-weight:400;font-size:.75rem;line-height:1rem;color:#637381}.bao-file-preview .loading-spinner{color:#097d6c}.bao-file-preview .bao-dropdown-menu-container{position:absolute;margin-left:auto}\n"] }]
|
|
4613
4564
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { file: [{
|
|
4614
4565
|
type: Input
|
|
4615
4566
|
}], isLoading: [{
|
|
@@ -4820,10 +4771,10 @@ class BaoFileInputComponent {
|
|
|
4820
4771
|
this.propagateTouched();
|
|
4821
4772
|
}
|
|
4822
4773
|
setDescribedByAttribute() {
|
|
4823
|
-
const helperText = Array.from(this.nativeElement.children).find((el) => el.localName === 'bao-guiding-text')
|
|
4774
|
+
const helperText = Array.from(this.nativeElement.children).find((el) => el.localName === 'bao-guiding-text');
|
|
4824
4775
|
if (helperText) {
|
|
4825
4776
|
this._helperTextId = `bao-guiding-text-${fileTextUniqueId++}`;
|
|
4826
|
-
this.renderer.setAttribute(helperText, 'id', this._helperTextId);
|
|
4777
|
+
this.renderer.setAttribute(helperText.firstElementChild, 'id', this._helperTextId);
|
|
4827
4778
|
const inputElement = Array.from(this.nativeElement.children)
|
|
4828
4779
|
.find((el) => el.className == 'file-drop-zone')
|
|
4829
4780
|
.children.item(1);
|
|
@@ -4855,7 +4806,7 @@ BaoFileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
4855
4806
|
useExisting: forwardRef(() => BaoFileInputComponent),
|
|
4856
4807
|
multi: true
|
|
4857
4808
|
}
|
|
4858
|
-
], queries: [{ propertyName: "_files", predicate: BaoFilePreviewComponent, descendants: true }, { propertyName: "_errorForm", predicate: BaoErrorTextComponent, descendants: true }], viewQueries: [{ propertyName: "uploader", first: true, predicate: ["uploader"], descendants: true }, { propertyName: "dropzoneElement", first: true, predicate: ["dropzone"], descendants: true }, { propertyName: "_errorTexts", predicate: BaoErrorTextComponent, descendants: true }], ngImport: i0, template: "<label bao-label [required]=\"required\" [for]=\"inputId\">{{ label }}</label>\n<ng-content select=\"bao-guiding-text\"></ng-content>\n<div\n baoFileDrop\n class=\"file-drop-zone\"\n (fileDrop)=\"uploadFile($event)\"\n #dropzone\n>\n <button\n bao-button\n type=\"button\"\n displayType=\"utility\"\n level=\"secondary\"\n [disabled]=\"disabled\"\n (click)=\"uploader.click()\"\n aria-hidden=\"true\"\n tabIndex=\"-1\"\n >\n {{ intl.dropzoneButtonLabel }}\n </button>\n <input\n [id]=\"inputId\"\n type=\"file\"\n class=\"sr-only\"\n [disabled]=\"disabled\"\n (change)=\"uploadFile($event.target.files[0])\"\n #uploader\n />\n <ng-container\n ><div #ref>\n <ng-content select=\"bao-file-dropzone-instructions\"></ng-content></div\n ></ng-container>\n <ng-container *ngIf=\"ref.childNodes.length === 0\"\n ><bao-file-dropzone-instructions>{{\n intl.defaultDropzoneInstructions\n }}</bao-file-dropzone-instructions></ng-container\n >\n</div>\n<bao-error *ngIf=\"isFileTooBig\">\n {{ intl.fileTooBigErrorMessage }}\n</bao-error>\n<bao-error *ngIf=\"isFileTypeInvalid\">\n {{ intl.invalidFileTypeErrorMessage }}\n</bao-error>\n<ng-content select=\"bao-error\"></ng-content>\n<ng-content></ng-content>\n", styles: ["bao-file-input{width:100%;display:inline-flex;flex-direction:column}bao-file-input>ul{padding:0;margin:0}bao-file-input .bao-label>span{font-size:inherit;font-weight:inherit}bao-file-input.bao-file-label-small label{font-weight:700;font-size:.875rem;line-height:1.25rem}bao-file-input.bao-file-label-medium label{font-weight:700;font-size:1rem;line-height:1.5rem}bao-file-input .bao-guiding-text{margin-bottom:.5rem}bao-file-input .file-drop-zone{padding:.5rem;background-color:#fff;border-radius:.25rem;border-style:dashed;border-color:#ced4da;border-width:1px;display:inline-flex;align-items:center}bao-file-input .file-drop-zone:focus-within.dropzone-focus{box-shadow:0 0 0 .1875rem #98bcde;background-color:#eefaf8}bao-file-input .file-drop-zone>.bao-button{margin-right:.5rem}bao-file-input .file-drop-zone.drag-over{background-color:#eefaf8;border-color:#097d6c;cursor:drag}bao-file-input .file-drop-zone.drag-over>.bao-button{background-color:#eefaf8}bao-file-input.bao-file-input-disabled .file-drop-zone{background-color:#f8f9fa;border-color:#ced4da}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button{background-color:#f8f9fa}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button:hover{background-color:#f8f9fa}bao-file-input .bao-error{margin-top:.5rem}\n"], components: [{ type: i0.forwardRef(function () { return BaoLabelTextComponent; }), selector: "bao-label, [bao-label]", inputs: ["required"] }, { type: i0.forwardRef(function () { return BaoButtonComponent; }), selector: "button[bao-button]", inputs: ["displayType", "level", "size", "loading", "reversed", "loadingSpinnerAriaLabel", "fullWidth"] }, { type: i0.forwardRef(function () { return BaoErrorTextComponent; }), selector: "bao-error, [bao-error]" }], directives: [{ type: i0.forwardRef(function () { return BaoFileDropDirective; }), selector: "[baoFileDrop]", outputs: ["fileDrop"] }, { type: i0.forwardRef(function () { return i1$1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return BaoFileDropzoneIntructions; }), selector: "bao-file-dropzone-instructions, [bao-file-dropzone-instructions]" }], encapsulation: i0.ViewEncapsulation.None });
|
|
4809
|
+
], queries: [{ propertyName: "_files", predicate: BaoFilePreviewComponent, descendants: true }, { propertyName: "_errorForm", predicate: BaoErrorTextComponent, descendants: true }], viewQueries: [{ propertyName: "uploader", first: true, predicate: ["uploader"], descendants: true }, { propertyName: "dropzoneElement", first: true, predicate: ["dropzone"], descendants: true }, { propertyName: "_errorTexts", predicate: BaoErrorTextComponent, descendants: true }], ngImport: i0, template: "<label bao-label [required]=\"required\" [for]=\"inputId\">{{ label }}</label>\n<ng-content select=\"bao-guiding-text\"></ng-content>\n<div\n baoFileDrop\n class=\"file-drop-zone\"\n (fileDrop)=\"uploadFile($event)\"\n #dropzone\n>\n <button\n bao-button\n type=\"button\"\n displayType=\"utility\"\n level=\"secondary\"\n [disabled]=\"disabled\"\n (click)=\"uploader.click()\"\n aria-hidden=\"true\"\n tabIndex=\"-1\"\n >\n {{ intl.dropzoneButtonLabel }}\n </button>\n <input\n [id]=\"inputId\"\n type=\"file\"\n class=\"sr-only\"\n [disabled]=\"disabled\"\n (change)=\"uploadFile($event.target.files[0])\"\n #uploader\n />\n <ng-container\n ><div #ref>\n <ng-content select=\"bao-file-dropzone-instructions\"></ng-content></div\n ></ng-container>\n <ng-container *ngIf=\"ref.childNodes.length === 0\"\n ><bao-file-dropzone-instructions>{{\n intl.defaultDropzoneInstructions\n }}</bao-file-dropzone-instructions></ng-container\n >\n</div>\n<bao-error *ngIf=\"isFileTooBig\">\n {{ intl.fileTooBigErrorMessage }}\n</bao-error>\n<bao-error *ngIf=\"isFileTypeInvalid\">\n {{ intl.invalidFileTypeErrorMessage }}\n</bao-error>\n<ng-content select=\"bao-error\"></ng-content>\n<ng-content></ng-content>\n", styles: ["bao-file-input{width:100%;display:inline-flex;flex-direction:column}bao-file-input>ul{padding:0;margin:0}bao-file-input .bao-label>span{font-size:inherit;font-weight:inherit}bao-file-input.bao-file-label-small label{font-weight:700;font-size:.875rem;line-height:1.25rem}bao-file-input.bao-file-label-medium label{font-weight:700;font-size:1rem;line-height:1.5rem}bao-file-input .bao-guiding-text{margin-bottom:.5rem}bao-file-input .file-drop-zone{padding:.5rem;background-color:#fff;border-radius:.25rem;border-style:dashed;border-color:#ced4da;border-width:1px;display:inline-flex;align-items:center}bao-file-input .file-drop-zone:focus-within.dropzone-focus{box-shadow:0 0 0 .1875rem #98bcde;background-color:#eefaf8}bao-file-input .file-drop-zone>.bao-button{margin-right:.5rem}bao-file-input .file-drop-zone.drag-over{background-color:#eefaf8;border-color:#097d6c;cursor:drag}bao-file-input .file-drop-zone.drag-over>.bao-button{background-color:#eefaf8}bao-file-input.bao-file-input-disabled .file-drop-zone{background-color:#f8f9fa;border-color:#ced4da}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button{background-color:#f8f9fa}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button:hover{background-color:#f8f9fa}bao-file-input .bao-file-preview:first-child{margin-top:1rem}bao-file-input .bao-error{margin-top:.5rem}\n"], components: [{ type: i0.forwardRef(function () { return BaoLabelTextComponent; }), selector: "bao-label, [bao-label]", inputs: ["required"] }, { type: i0.forwardRef(function () { return BaoButtonComponent; }), selector: "button[bao-button]", inputs: ["displayType", "level", "size", "loading", "reversed", "loadingSpinnerAriaLabel", "fullWidth"] }, { type: i0.forwardRef(function () { return BaoErrorTextComponent; }), selector: "bao-error, [bao-error]" }], directives: [{ type: i0.forwardRef(function () { return BaoFileDropDirective; }), selector: "[baoFileDrop]", outputs: ["fileDrop"] }, { type: i0.forwardRef(function () { return i1$1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return BaoFileDropzoneIntructions; }), selector: "bao-file-dropzone-instructions, [bao-file-dropzone-instructions]" }], encapsulation: i0.ViewEncapsulation.None });
|
|
4859
4810
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileInputComponent, decorators: [{
|
|
4860
4811
|
type: Component,
|
|
4861
4812
|
args: [{ selector: 'bao-file-input, [bao-file-input]', providers: [
|
|
@@ -4870,7 +4821,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4870
4821
|
'[class.bao-file-label-small]': 'size === "small"',
|
|
4871
4822
|
'[class.bao-file-label-medium]': 'size === "medium"',
|
|
4872
4823
|
'[class.bao-file-input-disabled]': 'disabled'
|
|
4873
|
-
}, template: "<label bao-label [required]=\"required\" [for]=\"inputId\">{{ label }}</label>\n<ng-content select=\"bao-guiding-text\"></ng-content>\n<div\n baoFileDrop\n class=\"file-drop-zone\"\n (fileDrop)=\"uploadFile($event)\"\n #dropzone\n>\n <button\n bao-button\n type=\"button\"\n displayType=\"utility\"\n level=\"secondary\"\n [disabled]=\"disabled\"\n (click)=\"uploader.click()\"\n aria-hidden=\"true\"\n tabIndex=\"-1\"\n >\n {{ intl.dropzoneButtonLabel }}\n </button>\n <input\n [id]=\"inputId\"\n type=\"file\"\n class=\"sr-only\"\n [disabled]=\"disabled\"\n (change)=\"uploadFile($event.target.files[0])\"\n #uploader\n />\n <ng-container\n ><div #ref>\n <ng-content select=\"bao-file-dropzone-instructions\"></ng-content></div\n ></ng-container>\n <ng-container *ngIf=\"ref.childNodes.length === 0\"\n ><bao-file-dropzone-instructions>{{\n intl.defaultDropzoneInstructions\n }}</bao-file-dropzone-instructions></ng-container\n >\n</div>\n<bao-error *ngIf=\"isFileTooBig\">\n {{ intl.fileTooBigErrorMessage }}\n</bao-error>\n<bao-error *ngIf=\"isFileTypeInvalid\">\n {{ intl.invalidFileTypeErrorMessage }}\n</bao-error>\n<ng-content select=\"bao-error\"></ng-content>\n<ng-content></ng-content>\n", styles: ["bao-file-input{width:100%;display:inline-flex;flex-direction:column}bao-file-input>ul{padding:0;margin:0}bao-file-input .bao-label>span{font-size:inherit;font-weight:inherit}bao-file-input.bao-file-label-small label{font-weight:700;font-size:.875rem;line-height:1.25rem}bao-file-input.bao-file-label-medium label{font-weight:700;font-size:1rem;line-height:1.5rem}bao-file-input .bao-guiding-text{margin-bottom:.5rem}bao-file-input .file-drop-zone{padding:.5rem;background-color:#fff;border-radius:.25rem;border-style:dashed;border-color:#ced4da;border-width:1px;display:inline-flex;align-items:center}bao-file-input .file-drop-zone:focus-within.dropzone-focus{box-shadow:0 0 0 .1875rem #98bcde;background-color:#eefaf8}bao-file-input .file-drop-zone>.bao-button{margin-right:.5rem}bao-file-input .file-drop-zone.drag-over{background-color:#eefaf8;border-color:#097d6c;cursor:drag}bao-file-input .file-drop-zone.drag-over>.bao-button{background-color:#eefaf8}bao-file-input.bao-file-input-disabled .file-drop-zone{background-color:#f8f9fa;border-color:#ced4da}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button{background-color:#f8f9fa}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button:hover{background-color:#f8f9fa}bao-file-input .bao-error{margin-top:.5rem}\n"] }]
|
|
4824
|
+
}, template: "<label bao-label [required]=\"required\" [for]=\"inputId\">{{ label }}</label>\n<ng-content select=\"bao-guiding-text\"></ng-content>\n<div\n baoFileDrop\n class=\"file-drop-zone\"\n (fileDrop)=\"uploadFile($event)\"\n #dropzone\n>\n <button\n bao-button\n type=\"button\"\n displayType=\"utility\"\n level=\"secondary\"\n [disabled]=\"disabled\"\n (click)=\"uploader.click()\"\n aria-hidden=\"true\"\n tabIndex=\"-1\"\n >\n {{ intl.dropzoneButtonLabel }}\n </button>\n <input\n [id]=\"inputId\"\n type=\"file\"\n class=\"sr-only\"\n [disabled]=\"disabled\"\n (change)=\"uploadFile($event.target.files[0])\"\n #uploader\n />\n <ng-container\n ><div #ref>\n <ng-content select=\"bao-file-dropzone-instructions\"></ng-content></div\n ></ng-container>\n <ng-container *ngIf=\"ref.childNodes.length === 0\"\n ><bao-file-dropzone-instructions>{{\n intl.defaultDropzoneInstructions\n }}</bao-file-dropzone-instructions></ng-container\n >\n</div>\n<bao-error *ngIf=\"isFileTooBig\">\n {{ intl.fileTooBigErrorMessage }}\n</bao-error>\n<bao-error *ngIf=\"isFileTypeInvalid\">\n {{ intl.invalidFileTypeErrorMessage }}\n</bao-error>\n<ng-content select=\"bao-error\"></ng-content>\n<ng-content></ng-content>\n", styles: ["bao-file-input{width:100%;display:inline-flex;flex-direction:column}bao-file-input>ul{padding:0;margin:0}bao-file-input .bao-label>span{font-size:inherit;font-weight:inherit}bao-file-input.bao-file-label-small label{font-weight:700;font-size:.875rem;line-height:1.25rem}bao-file-input.bao-file-label-medium label{font-weight:700;font-size:1rem;line-height:1.5rem}bao-file-input .bao-guiding-text{margin-bottom:.5rem}bao-file-input .file-drop-zone{padding:.5rem;background-color:#fff;border-radius:.25rem;border-style:dashed;border-color:#ced4da;border-width:1px;display:inline-flex;align-items:center}bao-file-input .file-drop-zone:focus-within.dropzone-focus{box-shadow:0 0 0 .1875rem #98bcde;background-color:#eefaf8}bao-file-input .file-drop-zone>.bao-button{margin-right:.5rem}bao-file-input .file-drop-zone.drag-over{background-color:#eefaf8;border-color:#097d6c;cursor:drag}bao-file-input .file-drop-zone.drag-over>.bao-button{background-color:#eefaf8}bao-file-input.bao-file-input-disabled .file-drop-zone{background-color:#f8f9fa;border-color:#ced4da}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button{background-color:#f8f9fa}bao-file-input.bao-file-input-disabled .file-drop-zone .bao-button:hover{background-color:#f8f9fa}bao-file-input .bao-file-preview:first-child{margin-top:1rem}bao-file-input .bao-error{margin-top:.5rem}\n"] }]
|
|
4874
4825
|
}], ctorParameters: function () { return [{ type: BaoFileIntl }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputId: [{
|
|
4875
4826
|
type: Input,
|
|
4876
4827
|
args: ['id']
|
|
@@ -5035,6 +4986,948 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5035
4986
|
}]
|
|
5036
4987
|
}] });
|
|
5037
4988
|
|
|
4989
|
+
/** Injection token that can be used to access the data that was passed in to a snack bar. */
|
|
4990
|
+
const BAO_SNACK_BAR_DATA = new InjectionToken('BaoSnackBarData');
|
|
4991
|
+
/**
|
|
4992
|
+
* Configuration used when opening a snack-bar.
|
|
4993
|
+
*/
|
|
4994
|
+
class BaoSnackBarConfig {
|
|
4995
|
+
constructor() {
|
|
4996
|
+
/** The message to display in the snackbar. */
|
|
4997
|
+
this.message = 'No message';
|
|
4998
|
+
/** The type of snackbar template to display. */
|
|
4999
|
+
this.toastType = 'info';
|
|
5000
|
+
/**
|
|
5001
|
+
* The attached action to the snack bar. If the name of the action matches an icon provided as part of
|
|
5002
|
+
* angular-ui icon dictionnary an icon will be displayed instead of text.
|
|
5003
|
+
* */
|
|
5004
|
+
this.actionLabelOrIcon = '';
|
|
5005
|
+
/** Displays the close button when set to true */
|
|
5006
|
+
this.showClose = false;
|
|
5007
|
+
/** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
|
|
5008
|
+
this.duration = 5000;
|
|
5009
|
+
/** The politeness level for the MatAriaLiveAnnouncer announcement. */
|
|
5010
|
+
this.politeness = 'assertive';
|
|
5011
|
+
/**
|
|
5012
|
+
* Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
|
|
5013
|
+
* component or template, the announcement message will default to the specified message.
|
|
5014
|
+
*/
|
|
5015
|
+
this.announcementMessage = '';
|
|
5016
|
+
/** Data being injected into the child component. */
|
|
5017
|
+
this.data = null;
|
|
5018
|
+
/** The horizontal position to place the snack bar. */
|
|
5019
|
+
this.horizontalPosition = 'left';
|
|
5020
|
+
/** The vertical position to place the snack bar. */
|
|
5021
|
+
this.verticalPosition = 'bottom';
|
|
5022
|
+
}
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
/** Maximum amount of milliseconds that can be passed into setTimeout. */
|
|
5026
|
+
const MAX_TIMEOUT = Math.pow(2, 31) - 1;
|
|
5027
|
+
/**
|
|
5028
|
+
* Reference to a snack bar dispatched from the snack bar service.
|
|
5029
|
+
*/
|
|
5030
|
+
class BaoSnackBarRef {
|
|
5031
|
+
constructor(containerInstance, _overlayRef) {
|
|
5032
|
+
this._overlayRef = _overlayRef;
|
|
5033
|
+
/** Subject for notifying the user that the snack bar has been dismissed. */
|
|
5034
|
+
this._afterDismissed = new Subject();
|
|
5035
|
+
/** Subject for notifying the user that the snack bar has opened and appeared. */
|
|
5036
|
+
this._afterOpened = new Subject();
|
|
5037
|
+
/** Subject for notifying the user that the snack bar action was called. */
|
|
5038
|
+
this._onAction = new Subject();
|
|
5039
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
5040
|
+
this._dismissedByAction = false;
|
|
5041
|
+
this.containerInstance = containerInstance;
|
|
5042
|
+
// Dismiss snackbar on action.
|
|
5043
|
+
this.onAction().subscribe(() => this.dismiss());
|
|
5044
|
+
containerInstance._onExit.subscribe(() => this.finishDismiss());
|
|
5045
|
+
}
|
|
5046
|
+
/** Dismisses the snack bar. */
|
|
5047
|
+
dismiss() {
|
|
5048
|
+
if (!this._afterDismissed.closed) {
|
|
5049
|
+
this.containerInstance.exit();
|
|
5050
|
+
}
|
|
5051
|
+
clearTimeout(this._durationTimeoutId);
|
|
5052
|
+
}
|
|
5053
|
+
/** Marks the snackbar action clicked. */
|
|
5054
|
+
dismissWithAction() {
|
|
5055
|
+
if (!this._onAction.closed) {
|
|
5056
|
+
this._dismissedByAction = true;
|
|
5057
|
+
this._onAction.next();
|
|
5058
|
+
this._onAction.complete();
|
|
5059
|
+
}
|
|
5060
|
+
}
|
|
5061
|
+
/** Dismisses the snack bar after some duration */
|
|
5062
|
+
dismissAfter(duration) {
|
|
5063
|
+
// Note that we need to cap the duration to the maximum value for setTimeout, because
|
|
5064
|
+
// it'll revert to 1 if somebody passes in something greater (e.g. `Infinity`). See #17234.
|
|
5065
|
+
// @TODO: window.setTimeout() ?
|
|
5066
|
+
this._durationTimeoutId = window.setTimeout(() => this.dismiss(), Math.min(duration, MAX_TIMEOUT));
|
|
5067
|
+
}
|
|
5068
|
+
/** Marks the snackbar as opened */
|
|
5069
|
+
open() {
|
|
5070
|
+
if (!this._afterOpened.closed) {
|
|
5071
|
+
this._afterOpened.next();
|
|
5072
|
+
this._afterOpened.complete();
|
|
5073
|
+
}
|
|
5074
|
+
}
|
|
5075
|
+
/** Gets an observable that is notified when the snack bar is finished closing. */
|
|
5076
|
+
afterDismissed() {
|
|
5077
|
+
return this._afterDismissed;
|
|
5078
|
+
}
|
|
5079
|
+
/** Gets an observable that is notified when the snack bar has opened and appeared. */
|
|
5080
|
+
afterOpened() {
|
|
5081
|
+
return this.containerInstance._onEnter;
|
|
5082
|
+
}
|
|
5083
|
+
/** Gets an observable that is notified when the snack bar action is called. */
|
|
5084
|
+
onAction() {
|
|
5085
|
+
return this._onAction;
|
|
5086
|
+
}
|
|
5087
|
+
/** Cleans up the DOM after closing. */
|
|
5088
|
+
finishDismiss() {
|
|
5089
|
+
this._overlayRef.dispose();
|
|
5090
|
+
if (!this._onAction.closed) {
|
|
5091
|
+
this._onAction.complete();
|
|
5092
|
+
}
|
|
5093
|
+
this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });
|
|
5094
|
+
this._afterDismissed.complete();
|
|
5095
|
+
this._dismissedByAction = false;
|
|
5096
|
+
}
|
|
5097
|
+
}
|
|
5098
|
+
|
|
5099
|
+
/*
|
|
5100
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5101
|
+
* Licensed under the MIT license.
|
|
5102
|
+
* See LICENSE file in the project root for full license information.
|
|
5103
|
+
*/
|
|
5104
|
+
const toastTypeToAttributes = {
|
|
5105
|
+
info: {
|
|
5106
|
+
toastClass: 'bao-snackbar-info',
|
|
5107
|
+
icon: 'icon-info',
|
|
5108
|
+
iconTitle: 'Information',
|
|
5109
|
+
politeness: 'assertive'
|
|
5110
|
+
},
|
|
5111
|
+
success: {
|
|
5112
|
+
toastClass: 'bao-snackbar-success',
|
|
5113
|
+
icon: 'icon-check-circle',
|
|
5114
|
+
iconTitle: 'Succès',
|
|
5115
|
+
politeness: 'polite'
|
|
5116
|
+
},
|
|
5117
|
+
danger: {
|
|
5118
|
+
toastClass: 'bao-snackbar-danger',
|
|
5119
|
+
icon: 'icon-error',
|
|
5120
|
+
iconTitle: 'Erreur',
|
|
5121
|
+
politeness: 'assertive'
|
|
5122
|
+
}
|
|
5123
|
+
};
|
|
5124
|
+
/**
|
|
5125
|
+
* A component used to open as the default snack bar, matching material spec.
|
|
5126
|
+
* This should only be used internally by the snack bar service.
|
|
5127
|
+
*/
|
|
5128
|
+
class BaoSimpleSnackBarComponent {
|
|
5129
|
+
constructor(snackBarRef, data) {
|
|
5130
|
+
this.snackBarRef = snackBarRef;
|
|
5131
|
+
this.showCloseTitle = 'Fermer le message';
|
|
5132
|
+
this.data = data;
|
|
5133
|
+
}
|
|
5134
|
+
/** Returns the politeness */
|
|
5135
|
+
get politeness() {
|
|
5136
|
+
return (toastTypeToAttributes[this.data.toastType]?.politeness ||
|
|
5137
|
+
toastTypeToAttributes['info'].politeness);
|
|
5138
|
+
}
|
|
5139
|
+
/** Returns the toast class */
|
|
5140
|
+
get toastClass() {
|
|
5141
|
+
return (toastTypeToAttributes[this.data.toastType]?.toastClass ||
|
|
5142
|
+
toastTypeToAttributes['info'].toastClass);
|
|
5143
|
+
}
|
|
5144
|
+
/** Returns the toast icon */
|
|
5145
|
+
get toastIcon() {
|
|
5146
|
+
return (toastTypeToAttributes[this.data.toastType]?.icon ||
|
|
5147
|
+
toastTypeToAttributes['info'].icon);
|
|
5148
|
+
}
|
|
5149
|
+
/** Returns the toast icon title */
|
|
5150
|
+
get toastIconTitle() {
|
|
5151
|
+
return (toastTypeToAttributes[this.data.toastType]?.iconTitle ||
|
|
5152
|
+
toastTypeToAttributes['info'].iconTitle);
|
|
5153
|
+
}
|
|
5154
|
+
/** If the action button should be shown. */
|
|
5155
|
+
get hasAction() {
|
|
5156
|
+
return !!this.data.actionLabelOrIcon;
|
|
5157
|
+
}
|
|
5158
|
+
/** If the action is an icon */
|
|
5159
|
+
get isActionIcon() {
|
|
5160
|
+
return !!ICONS_DCT[this.data.actionLabelOrIcon];
|
|
5161
|
+
}
|
|
5162
|
+
/** Performs the action on the snack bar. */
|
|
5163
|
+
action() {
|
|
5164
|
+
this.snackBarRef.dismissWithAction();
|
|
5165
|
+
}
|
|
5166
|
+
/** Closes the snack bar. */
|
|
5167
|
+
close() {
|
|
5168
|
+
this.snackBarRef.dismiss();
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
BaoSimpleSnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSimpleSnackBarComponent, deps: [{ token: BaoSnackBarRef }, { token: BAO_SNACK_BAR_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
5172
|
+
BaoSimpleSnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", 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"], components: [{ type: BaoIconComponent, selector: "bao-icon", inputs: ["color", "size", "svgIcon", "title"], exportAs: ["baoIcon"] }, { type: BaoButtonComponent, selector: "button[bao-button]", inputs: ["displayType", "level", "size", "loading", "reversed", "loadingSpinnerAriaLabel", "fullWidth"] }], directives: [{ type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
5173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSimpleSnackBarComponent, decorators: [{
|
|
5174
|
+
type: Component,
|
|
5175
|
+
args: [{ selector: 'bao-simple-snack-bar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5176
|
+
class: 'bao-simple-snackbar'
|
|
5177
|
+
}, 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"] }]
|
|
5178
|
+
}], ctorParameters: function () { return [{ type: BaoSnackBarRef }, { type: undefined, decorators: [{
|
|
5179
|
+
type: Inject,
|
|
5180
|
+
args: [BAO_SNACK_BAR_DATA]
|
|
5181
|
+
}] }]; } });
|
|
5182
|
+
|
|
5183
|
+
/*
|
|
5184
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5185
|
+
* Licensed under the MIT license.
|
|
5186
|
+
* See LICENSE file in the project root for full license information.
|
|
5187
|
+
*/
|
|
5188
|
+
/**
|
|
5189
|
+
* Animations used by the Material snack bar.
|
|
5190
|
+
* @docs-private
|
|
5191
|
+
*/
|
|
5192
|
+
const matSnackBarAnimations = {
|
|
5193
|
+
/** Animation that shows and hides a snack bar. */
|
|
5194
|
+
snackBarState: trigger('state', [
|
|
5195
|
+
state('void, hidden', style({
|
|
5196
|
+
transform: 'scale(0.8)',
|
|
5197
|
+
opacity: 0
|
|
5198
|
+
})),
|
|
5199
|
+
state('visible', style({
|
|
5200
|
+
transform: 'scale(1)',
|
|
5201
|
+
opacity: 1
|
|
5202
|
+
})),
|
|
5203
|
+
transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
|
|
5204
|
+
transition('* => void, * => hidden', animate('75ms cubic-bezier(0.4, 0.0, 1, 1)', style({
|
|
5205
|
+
opacity: 0
|
|
5206
|
+
})))
|
|
5207
|
+
])
|
|
5208
|
+
};
|
|
5209
|
+
|
|
5210
|
+
let uniqueId = 0;
|
|
5211
|
+
/**
|
|
5212
|
+
* Internal component that wraps user-provided snack bar content.
|
|
5213
|
+
* @docs-private
|
|
5214
|
+
*/
|
|
5215
|
+
class BaoSnackBarContainerComponent extends BasePortalOutlet {
|
|
5216
|
+
constructor(_ngZone, _elementRef, _changeDetectorRef, _platform,
|
|
5217
|
+
/** The snack bar configuration. */
|
|
5218
|
+
snackBarConfig) {
|
|
5219
|
+
super();
|
|
5220
|
+
this._ngZone = _ngZone;
|
|
5221
|
+
this._elementRef = _elementRef;
|
|
5222
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
5223
|
+
this._platform = _platform;
|
|
5224
|
+
this.snackBarConfig = snackBarConfig;
|
|
5225
|
+
this._document = inject(DOCUMENT);
|
|
5226
|
+
this._trackedModals = new Set();
|
|
5227
|
+
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
5228
|
+
this._onAnnounce = new Subject();
|
|
5229
|
+
/** Subject for notifying that the snack bar has exited from view. */
|
|
5230
|
+
this._onExit = new Subject();
|
|
5231
|
+
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
5232
|
+
this._onEnter = new Subject();
|
|
5233
|
+
/** The state of the snack bar animations. */
|
|
5234
|
+
this._animationState = 'void';
|
|
5235
|
+
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
5236
|
+
this._announceDelay = 150;
|
|
5237
|
+
/** Whether the component has been destroyed. */
|
|
5238
|
+
this._destroyed = false;
|
|
5239
|
+
/** Unique ID of the aria-live element. */
|
|
5240
|
+
this._liveElementId = `bao-snack-bar-container-live-${uniqueId++}`;
|
|
5241
|
+
/**
|
|
5242
|
+
* Attaches a DOM portal to the snack bar container.
|
|
5243
|
+
* @deprecated To be turned into a method.
|
|
5244
|
+
* @breaking-change 10.0.0
|
|
5245
|
+
*/
|
|
5246
|
+
this.attachDomPortal = (portal) => {
|
|
5247
|
+
this.assertNotAttached();
|
|
5248
|
+
const result = this._portalOutlet.attachDomPortal(portal);
|
|
5249
|
+
this._afterPortalAttached();
|
|
5250
|
+
return result;
|
|
5251
|
+
};
|
|
5252
|
+
// Use aria-live rather than a live role like 'alert' or 'status'
|
|
5253
|
+
// because NVDA and JAWS have show inconsistent behavior with live roles.
|
|
5254
|
+
if (snackBarConfig.politeness === 'assertive' &&
|
|
5255
|
+
!snackBarConfig.announcementMessage) {
|
|
5256
|
+
this._live = 'assertive';
|
|
5257
|
+
}
|
|
5258
|
+
else if (snackBarConfig.politeness === 'off') {
|
|
5259
|
+
this._live = 'off';
|
|
5260
|
+
}
|
|
5261
|
+
else {
|
|
5262
|
+
this._live = 'polite';
|
|
5263
|
+
}
|
|
5264
|
+
// Only set role for Firefox. Set role based on aria-live because setting role="alert" implies
|
|
5265
|
+
// aria-live="assertive" which may cause issues if aria-live is set to "polite" above.
|
|
5266
|
+
if (this._platform.FIREFOX) {
|
|
5267
|
+
if (this._live === 'polite') {
|
|
5268
|
+
this._role = 'status';
|
|
5269
|
+
}
|
|
5270
|
+
if (this._live === 'assertive') {
|
|
5271
|
+
this._role = 'alert';
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
}
|
|
5275
|
+
/** Attach a component portal as content to this snack bar container. */
|
|
5276
|
+
attachComponentPortal(portal) {
|
|
5277
|
+
this.assertNotAttached();
|
|
5278
|
+
this.applySnackBarClasses();
|
|
5279
|
+
const result = this._portalOutlet.attachComponentPortal(portal);
|
|
5280
|
+
this._afterPortalAttached();
|
|
5281
|
+
return result;
|
|
5282
|
+
}
|
|
5283
|
+
/** Attach a template portal as content to this snack bar container. */
|
|
5284
|
+
attachTemplatePortal(portal) {
|
|
5285
|
+
this.assertNotAttached();
|
|
5286
|
+
this.applySnackBarClasses();
|
|
5287
|
+
const result = this._portalOutlet.attachTemplatePortal(portal);
|
|
5288
|
+
this._afterPortalAttached();
|
|
5289
|
+
return result;
|
|
5290
|
+
}
|
|
5291
|
+
/** Handle end of animations, updating the state of the snackbar. */
|
|
5292
|
+
onAnimationEnd(event) {
|
|
5293
|
+
const { fromState, toState } = event;
|
|
5294
|
+
if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {
|
|
5295
|
+
this.completeExit();
|
|
5296
|
+
}
|
|
5297
|
+
if (toState === 'visible') {
|
|
5298
|
+
// Note: we shouldn't use `this` inside the zone callback,
|
|
5299
|
+
// because it can cause a memory leak.
|
|
5300
|
+
const onEnter = this._onEnter;
|
|
5301
|
+
this._ngZone.run(() => {
|
|
5302
|
+
onEnter.next();
|
|
5303
|
+
onEnter.complete();
|
|
5304
|
+
});
|
|
5305
|
+
}
|
|
5306
|
+
}
|
|
5307
|
+
/** Begin animation of snack bar entrance into view. */
|
|
5308
|
+
enter() {
|
|
5309
|
+
if (!this._destroyed) {
|
|
5310
|
+
this._animationState = 'visible';
|
|
5311
|
+
this._changeDetectorRef.detectChanges();
|
|
5312
|
+
this.screenReaderAnnounce();
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5315
|
+
/** Begin animation of the snack bar exiting from view. */
|
|
5316
|
+
exit() {
|
|
5317
|
+
// Note: this one transitions to `hidden`, rather than `void`, in order to handle the case
|
|
5318
|
+
// where multiple snack bars are opened in quick succession (e.g. two consecutive calls to
|
|
5319
|
+
// `MatSnackBar.open`).
|
|
5320
|
+
this._animationState = 'hidden';
|
|
5321
|
+
// Mark this element with an 'exit' attribute to indicate that the snackbar has
|
|
5322
|
+
// been dismissed and will soon be removed from the DOM. This is used by the snackbar
|
|
5323
|
+
// test harness.
|
|
5324
|
+
this._elementRef.nativeElement.setAttribute('mat-exit', '');
|
|
5325
|
+
// If the snack bar hasn't been announced by the time it exits it wouldn't have been open
|
|
5326
|
+
// long enough to visually read it either, so clear the timeout for announcing.
|
|
5327
|
+
clearTimeout(this._announceTimeoutId);
|
|
5328
|
+
return this._onExit;
|
|
5329
|
+
}
|
|
5330
|
+
/** Makes sure the exit callbacks have been invoked when the element is destroyed. */
|
|
5331
|
+
ngOnDestroy() {
|
|
5332
|
+
this._destroyed = true;
|
|
5333
|
+
this.completeExit();
|
|
5334
|
+
}
|
|
5335
|
+
/**
|
|
5336
|
+
* Waits for the zone to settle before removing the element. Helps prevent
|
|
5337
|
+
* errors where we end up removing an element which is in the middle of an animation.
|
|
5338
|
+
*/
|
|
5339
|
+
completeExit() {
|
|
5340
|
+
this._ngZone.onMicrotaskEmpty.pipe(take$1(1)).subscribe(() => {
|
|
5341
|
+
this._onExit.next();
|
|
5342
|
+
this._onExit.complete();
|
|
5343
|
+
});
|
|
5344
|
+
}
|
|
5345
|
+
/** Applies the various positioning and user-configured CSS classes to the snack bar. */
|
|
5346
|
+
applySnackBarClasses() {
|
|
5347
|
+
const element = this._elementRef.nativeElement;
|
|
5348
|
+
const panelClasses = this.snackBarConfig.panelClass;
|
|
5349
|
+
if (panelClasses) {
|
|
5350
|
+
if (Array.isArray(panelClasses)) {
|
|
5351
|
+
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
|
|
5352
|
+
panelClasses.forEach(cssClass => element.classList.add(cssClass));
|
|
5353
|
+
}
|
|
5354
|
+
else {
|
|
5355
|
+
element.classList.add(panelClasses);
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
if (this.snackBarConfig.horizontalPosition === 'center') {
|
|
5359
|
+
element.classList.add('bao-snack-bar-center');
|
|
5360
|
+
}
|
|
5361
|
+
if (this.snackBarConfig.verticalPosition === 'top') {
|
|
5362
|
+
element.classList.add('bao-snack-bar-top');
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
/**
|
|
5366
|
+
* Called after the portal contents have been attached. Can be
|
|
5367
|
+
* used to modify the DOM once it's guaranteed to be in place.
|
|
5368
|
+
*/
|
|
5369
|
+
_afterPortalAttached() {
|
|
5370
|
+
const element = this._elementRef.nativeElement;
|
|
5371
|
+
const panelClasses = this.snackBarConfig.panelClass;
|
|
5372
|
+
if (panelClasses) {
|
|
5373
|
+
if (Array.isArray(panelClasses)) {
|
|
5374
|
+
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
|
|
5375
|
+
panelClasses.forEach(cssClass => element.classList.add(cssClass));
|
|
5376
|
+
}
|
|
5377
|
+
else {
|
|
5378
|
+
element.classList.add(panelClasses);
|
|
5379
|
+
}
|
|
5380
|
+
}
|
|
5381
|
+
this._exposeToModals();
|
|
5382
|
+
}
|
|
5383
|
+
/**
|
|
5384
|
+
* Some browsers won't expose the accessibility node of the live element if there is an
|
|
5385
|
+
* `aria-modal` and the live element is outside of it. This method works around the issue by
|
|
5386
|
+
* pointing the `aria-owns` of all modals to the live element.
|
|
5387
|
+
*/
|
|
5388
|
+
_exposeToModals() {
|
|
5389
|
+
// Note that the selector here is limited to CDK overlays at the moment in order to reduce the
|
|
5390
|
+
// section of the DOM we need to look through. This should cover all the cases we support, but
|
|
5391
|
+
// the selector can be expanded if it turns out to be too narrow.
|
|
5392
|
+
const id = this._liveElementId;
|
|
5393
|
+
const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');
|
|
5394
|
+
for (let i = 0; i < modals.length; i++) {
|
|
5395
|
+
const modal = modals[i];
|
|
5396
|
+
const ariaOwns = modal.getAttribute('aria-owns');
|
|
5397
|
+
this._trackedModals.add(modal);
|
|
5398
|
+
if (!ariaOwns) {
|
|
5399
|
+
modal.setAttribute('aria-owns', id);
|
|
5400
|
+
}
|
|
5401
|
+
else if (ariaOwns.indexOf(id) === -1) {
|
|
5402
|
+
modal.setAttribute('aria-owns', ariaOwns + ' ' + id);
|
|
5403
|
+
}
|
|
5404
|
+
}
|
|
5405
|
+
}
|
|
5406
|
+
/** Clears the references to the live element from any modals it was added to. */
|
|
5407
|
+
_clearFromModals() {
|
|
5408
|
+
this._trackedModals.forEach(modal => {
|
|
5409
|
+
const ariaOwns = modal.getAttribute('aria-owns');
|
|
5410
|
+
if (ariaOwns) {
|
|
5411
|
+
const newValue = ariaOwns.replace(this._liveElementId, '').trim();
|
|
5412
|
+
if (newValue.length > 0) {
|
|
5413
|
+
modal.setAttribute('aria-owns', newValue);
|
|
5414
|
+
}
|
|
5415
|
+
else {
|
|
5416
|
+
modal.removeAttribute('aria-owns');
|
|
5417
|
+
}
|
|
5418
|
+
}
|
|
5419
|
+
});
|
|
5420
|
+
this._trackedModals.clear();
|
|
5421
|
+
}
|
|
5422
|
+
/** Asserts that no content is already attached to the container. */
|
|
5423
|
+
assertNotAttached() {
|
|
5424
|
+
if (this._portalOutlet.hasAttached()) {
|
|
5425
|
+
throw Error('Attempting to attach snack bar content after content is already attached');
|
|
5426
|
+
}
|
|
5427
|
+
}
|
|
5428
|
+
/**
|
|
5429
|
+
* Starts a timeout to move the snack bar content to the live region so screen readers will
|
|
5430
|
+
* announce it.
|
|
5431
|
+
*/
|
|
5432
|
+
screenReaderAnnounce() {
|
|
5433
|
+
if (!this._announceTimeoutId) {
|
|
5434
|
+
this._ngZone.runOutsideAngular(() => {
|
|
5435
|
+
this._announceTimeoutId = window.setTimeout(() => {
|
|
5436
|
+
const inertElement = this._elementRef.nativeElement.querySelector('[aria-hidden]');
|
|
5437
|
+
const liveElement = this._elementRef.nativeElement.querySelector('[aria-live]');
|
|
5438
|
+
if (inertElement && liveElement) {
|
|
5439
|
+
// If an element in the snack bar content is focused before being moved
|
|
5440
|
+
// track it and restore focus after moving to the live region.
|
|
5441
|
+
let focusedElement = null;
|
|
5442
|
+
if (this._platform.isBrowser &&
|
|
5443
|
+
document.activeElement instanceof HTMLElement &&
|
|
5444
|
+
inertElement.contains(document.activeElement)) {
|
|
5445
|
+
focusedElement = document.activeElement;
|
|
5446
|
+
}
|
|
5447
|
+
inertElement.removeAttribute('aria-hidden');
|
|
5448
|
+
liveElement.appendChild(inertElement);
|
|
5449
|
+
focusedElement?.focus();
|
|
5450
|
+
this._onAnnounce.next();
|
|
5451
|
+
this._onAnnounce.complete();
|
|
5452
|
+
}
|
|
5453
|
+
}, this._announceDelay);
|
|
5454
|
+
});
|
|
5455
|
+
}
|
|
5456
|
+
}
|
|
5457
|
+
}
|
|
5458
|
+
BaoSnackBarContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarContainerComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$5.Platform }, { token: BaoSnackBarConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
5459
|
+
BaoSnackBarContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", 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"], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [matSnackBarAnimations.snackBarState], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
5460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarContainerComponent, decorators: [{
|
|
5461
|
+
type: Component,
|
|
5462
|
+
args: [{ selector: 'bao-snack-bar-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, animations: [matSnackBarAnimations.snackBarState], host: {
|
|
5463
|
+
class: 'bao-snack-bar-container',
|
|
5464
|
+
'[@state]': '_animationState',
|
|
5465
|
+
'(@state.done)': 'onAnimationEnd($event)'
|
|
5466
|
+
}, 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"] }]
|
|
5467
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$5.Platform }, { type: BaoSnackBarConfig }]; }, propDecorators: { _portalOutlet: [{
|
|
5468
|
+
type: ViewChild,
|
|
5469
|
+
args: [CdkPortalOutlet, { static: true }]
|
|
5470
|
+
}] } });
|
|
5471
|
+
|
|
5472
|
+
function baoFactory() {
|
|
5473
|
+
return new BaoSnackBarConfig();
|
|
5474
|
+
}
|
|
5475
|
+
/** Injection token that can be used to specify default snack bar. */
|
|
5476
|
+
const BAO_SNACK_BAR_DEFAULT_OPTIONS = new InjectionToken('bao-snack-bar-default-options', {
|
|
5477
|
+
providedIn: 'root',
|
|
5478
|
+
factory: baoFactory
|
|
5479
|
+
});
|
|
5480
|
+
/**
|
|
5481
|
+
* Service to dispatch Material Design snack bar messages.
|
|
5482
|
+
*/
|
|
5483
|
+
class BaoSnackBarService {
|
|
5484
|
+
constructor(_overlay, _live, _injector, _parentSnackBar, _defaultConfig) {
|
|
5485
|
+
this._overlay = _overlay;
|
|
5486
|
+
this._live = _live;
|
|
5487
|
+
this._injector = _injector;
|
|
5488
|
+
this._parentSnackBar = _parentSnackBar;
|
|
5489
|
+
this._defaultConfig = _defaultConfig;
|
|
5490
|
+
/** The component that should be rendered as the snack bar's simple component. */
|
|
5491
|
+
this.simpleSnackBarComponent = BaoSimpleSnackBarComponent;
|
|
5492
|
+
/** The container component that attaches the provided template or component. */
|
|
5493
|
+
this.snackBarContainerComponent = BaoSnackBarContainerComponent;
|
|
5494
|
+
/**
|
|
5495
|
+
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
5496
|
+
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
5497
|
+
* via `_openedSnackBarRef`.
|
|
5498
|
+
*/
|
|
5499
|
+
this._snackBarRefAtThisLevel = null;
|
|
5500
|
+
}
|
|
5501
|
+
/** Reference to the currently opened snackbar at *any* level. */
|
|
5502
|
+
get _openedSnackBarRef() {
|
|
5503
|
+
const parent = this._parentSnackBar;
|
|
5504
|
+
return parent ? parent._openedSnackBarRef : this._snackBarRefAtThisLevel;
|
|
5505
|
+
}
|
|
5506
|
+
set _openedSnackBarRef(value) {
|
|
5507
|
+
if (this._parentSnackBar) {
|
|
5508
|
+
this._parentSnackBar._openedSnackBarRef = value;
|
|
5509
|
+
}
|
|
5510
|
+
else {
|
|
5511
|
+
this._snackBarRefAtThisLevel = value;
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
/**
|
|
5515
|
+
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
5516
|
+
* currently opened snack bars.
|
|
5517
|
+
*
|
|
5518
|
+
* @param component Component to be instantiated.
|
|
5519
|
+
* @param config Extra configuration for the snack bar.
|
|
5520
|
+
*/
|
|
5521
|
+
openFromComponent(component, config) {
|
|
5522
|
+
return this.attach(component, config);
|
|
5523
|
+
}
|
|
5524
|
+
/**
|
|
5525
|
+
* Creates and dispatches a snack bar with a custom template for the content, removing any
|
|
5526
|
+
* currently opened snack bars.
|
|
5527
|
+
*
|
|
5528
|
+
* @param template Template to be instantiated.
|
|
5529
|
+
* @param config Extra configuration for the snack bar.
|
|
5530
|
+
*/
|
|
5531
|
+
openFromTemplate(template, config) {
|
|
5532
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
5533
|
+
return this.attach(template, config);
|
|
5534
|
+
}
|
|
5535
|
+
/**
|
|
5536
|
+
* Opens a snackbar with a message and an optional action.
|
|
5537
|
+
* @param message The message to show in the snackbar.
|
|
5538
|
+
* @param toastType The type of of toast to display the snackbar.
|
|
5539
|
+
* @param actionLabelOrIcon The label or icon for the snackbar action.
|
|
5540
|
+
* @param showClose If true, the snackbar will require user interaction to close.
|
|
5541
|
+
* @param config Additional configuration options for the snackbar.
|
|
5542
|
+
*/
|
|
5543
|
+
open(config) {
|
|
5544
|
+
const _config = { ...this._defaultConfig, ...config };
|
|
5545
|
+
// Since the user doesn't have access to the component, we can
|
|
5546
|
+
// override the data to pass in our own message, action and type.
|
|
5547
|
+
_config.data = {
|
|
5548
|
+
message: _config.message,
|
|
5549
|
+
toastType: _config.toastType,
|
|
5550
|
+
actionLabelOrIcon: _config.actionLabelOrIcon,
|
|
5551
|
+
showClose: _config.showClose
|
|
5552
|
+
};
|
|
5553
|
+
if (_config.showClose)
|
|
5554
|
+
_config.duration = 0;
|
|
5555
|
+
if (!_config.announcementMessage) {
|
|
5556
|
+
_config.announcementMessage = _config.message;
|
|
5557
|
+
}
|
|
5558
|
+
return this.openFromComponent(this.simpleSnackBarComponent, _config);
|
|
5559
|
+
}
|
|
5560
|
+
/**
|
|
5561
|
+
* Dismisses the currently-visible snack bar.
|
|
5562
|
+
*/
|
|
5563
|
+
dismiss() {
|
|
5564
|
+
if (this._openedSnackBarRef) {
|
|
5565
|
+
this._openedSnackBarRef.dismiss();
|
|
5566
|
+
}
|
|
5567
|
+
}
|
|
5568
|
+
ngOnDestroy() {
|
|
5569
|
+
// Only dismiss the snack bar at the current level on destroy.
|
|
5570
|
+
if (this._snackBarRefAtThisLevel) {
|
|
5571
|
+
this._snackBarRefAtThisLevel.dismiss();
|
|
5572
|
+
}
|
|
5573
|
+
}
|
|
5574
|
+
/**
|
|
5575
|
+
* Attaches the snack bar container component to the overlay.
|
|
5576
|
+
*/
|
|
5577
|
+
attachSnackBarContainer(overlayRef, config) {
|
|
5578
|
+
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
5579
|
+
const injector = new PortalInjector(userInjector || this._injector, new WeakMap([[BaoSnackBarConfig, config]]));
|
|
5580
|
+
const containerPortal = new ComponentPortal(this.snackBarContainerComponent, config.viewContainerRef, injector);
|
|
5581
|
+
const containerRef = overlayRef.attach(containerPortal);
|
|
5582
|
+
containerRef.instance.snackBarConfig = config;
|
|
5583
|
+
return containerRef.instance;
|
|
5584
|
+
}
|
|
5585
|
+
/**
|
|
5586
|
+
* Places a new component or a template as the content of the snack bar container.
|
|
5587
|
+
*/
|
|
5588
|
+
attach(content, userConfig) {
|
|
5589
|
+
const config = {
|
|
5590
|
+
...new BaoSnackBarConfig(),
|
|
5591
|
+
...this._defaultConfig,
|
|
5592
|
+
...userConfig
|
|
5593
|
+
};
|
|
5594
|
+
const overlayRef = this.createOverlay(config);
|
|
5595
|
+
const container = this.attachSnackBarContainer(overlayRef, config);
|
|
5596
|
+
const snackBarRef = new BaoSnackBarRef(container, overlayRef);
|
|
5597
|
+
if (content instanceof TemplateRef) {
|
|
5598
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5599
|
+
const portal = new TemplatePortal(content, null, {
|
|
5600
|
+
$implicit: config.data,
|
|
5601
|
+
snackBarRef
|
|
5602
|
+
});
|
|
5603
|
+
snackBarRef.instance = container.attachTemplatePortal(portal);
|
|
5604
|
+
}
|
|
5605
|
+
else {
|
|
5606
|
+
const injector = this.createInjector(config, snackBarRef);
|
|
5607
|
+
const portal = new ComponentPortal(content, undefined, injector);
|
|
5608
|
+
const contentRef = container.attachComponentPortal(portal);
|
|
5609
|
+
// We can't pass this via the injector, because the injector is created earlier.
|
|
5610
|
+
snackBarRef.instance = contentRef.instance;
|
|
5611
|
+
}
|
|
5612
|
+
this.animateSnackBar(snackBarRef, config);
|
|
5613
|
+
this._openedSnackBarRef = snackBarRef;
|
|
5614
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
5615
|
+
return this._openedSnackBarRef;
|
|
5616
|
+
}
|
|
5617
|
+
/** Animates the old snack bar out and the new one in. */
|
|
5618
|
+
animateSnackBar(snackBarRef, config) {
|
|
5619
|
+
// When the snackbar is dismissed, clear the reference to it.
|
|
5620
|
+
snackBarRef.afterDismissed().subscribe(() => {
|
|
5621
|
+
// Clear the snackbar ref if it hasn't already been replaced by a newer snackbar.
|
|
5622
|
+
// eslint-disable-next-line eqeqeq
|
|
5623
|
+
if (this._openedSnackBarRef == snackBarRef) {
|
|
5624
|
+
this._openedSnackBarRef = null;
|
|
5625
|
+
}
|
|
5626
|
+
if (config.announcementMessage) {
|
|
5627
|
+
this._live.clear();
|
|
5628
|
+
}
|
|
5629
|
+
});
|
|
5630
|
+
if (this._openedSnackBarRef) {
|
|
5631
|
+
// If a snack bar is already in view, dismiss it and enter the
|
|
5632
|
+
// new snack bar after exit animation is complete.
|
|
5633
|
+
this._openedSnackBarRef.afterDismissed().subscribe(() => {
|
|
5634
|
+
snackBarRef.containerInstance.enter();
|
|
5635
|
+
});
|
|
5636
|
+
this._openedSnackBarRef.dismiss();
|
|
5637
|
+
}
|
|
5638
|
+
else {
|
|
5639
|
+
// If no snack bar is in view, enter the new snack bar.
|
|
5640
|
+
snackBarRef.containerInstance.enter();
|
|
5641
|
+
}
|
|
5642
|
+
// If a dismiss timeout is provided, set up dismiss based on after the snackbar is opened.
|
|
5643
|
+
if (config.duration && config.duration > 0) {
|
|
5644
|
+
snackBarRef
|
|
5645
|
+
.afterOpened()
|
|
5646
|
+
.subscribe(() => snackBarRef.dismissAfter(config.duration));
|
|
5647
|
+
}
|
|
5648
|
+
if (config.announcementMessage) {
|
|
5649
|
+
void this._live.announce(config.announcementMessage, config.politeness);
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5652
|
+
/**
|
|
5653
|
+
* Creates a new overlay and places it in the correct location.
|
|
5654
|
+
* @param config The user-specified snack bar config.
|
|
5655
|
+
*/
|
|
5656
|
+
createOverlay(config) {
|
|
5657
|
+
const overlayConfig = new OverlayConfig();
|
|
5658
|
+
overlayConfig.direction = config.direction;
|
|
5659
|
+
const positionStrategy = this._overlay.position().global();
|
|
5660
|
+
// Set horizontal position.
|
|
5661
|
+
const isRtl = config.direction === 'rtl';
|
|
5662
|
+
const isLeft = config.horizontalPosition === 'left' ||
|
|
5663
|
+
(config.horizontalPosition === 'start' && !isRtl) ||
|
|
5664
|
+
(config.horizontalPosition === 'end' && isRtl);
|
|
5665
|
+
const isRight = !isLeft && config.horizontalPosition !== 'center';
|
|
5666
|
+
if (isLeft) {
|
|
5667
|
+
positionStrategy.left('0');
|
|
5668
|
+
}
|
|
5669
|
+
else if (isRight) {
|
|
5670
|
+
positionStrategy.right('0');
|
|
5671
|
+
}
|
|
5672
|
+
else {
|
|
5673
|
+
positionStrategy.centerHorizontally();
|
|
5674
|
+
}
|
|
5675
|
+
// Set horizontal position.
|
|
5676
|
+
if (config.verticalPosition === 'top') {
|
|
5677
|
+
positionStrategy.top('0');
|
|
5678
|
+
}
|
|
5679
|
+
else {
|
|
5680
|
+
positionStrategy.bottom('0');
|
|
5681
|
+
}
|
|
5682
|
+
overlayConfig.positionStrategy = positionStrategy;
|
|
5683
|
+
return this._overlay.create(overlayConfig);
|
|
5684
|
+
}
|
|
5685
|
+
/**
|
|
5686
|
+
* Creates an injector to be used inside of a snack bar component.
|
|
5687
|
+
* @param config Config that was used to create the snack bar.
|
|
5688
|
+
* @param snackBarRef Reference to the snack bar.
|
|
5689
|
+
*/
|
|
5690
|
+
createInjector(config, snackBarRef) {
|
|
5691
|
+
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
5692
|
+
return new PortalInjector(userInjector || this._injector, new WeakMap([
|
|
5693
|
+
[BaoSnackBarRef, snackBarRef],
|
|
5694
|
+
[BAO_SNACK_BAR_DATA, config.data]
|
|
5695
|
+
]));
|
|
5696
|
+
}
|
|
5697
|
+
}
|
|
5698
|
+
BaoSnackBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", 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 });
|
|
5699
|
+
BaoSnackBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarService, providedIn: 'root' });
|
|
5700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarService, decorators: [{
|
|
5701
|
+
type: Injectable,
|
|
5702
|
+
args: [{ providedIn: 'root' }]
|
|
5703
|
+
}], ctorParameters: function () { return [{ type: i1$4.Overlay }, { type: i1$3.LiveAnnouncer }, { type: i0.Injector }, { type: BaoSnackBarService, decorators: [{
|
|
5704
|
+
type: Optional
|
|
5705
|
+
}, {
|
|
5706
|
+
type: SkipSelf
|
|
5707
|
+
}] }, { type: BaoSnackBarConfig, decorators: [{
|
|
5708
|
+
type: Inject,
|
|
5709
|
+
args: [BAO_SNACK_BAR_DEFAULT_OPTIONS]
|
|
5710
|
+
}] }]; } });
|
|
5711
|
+
|
|
5712
|
+
/*
|
|
5713
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5714
|
+
* Licensed under the MIT license.
|
|
5715
|
+
* See LICENSE file in the project root for full license information.
|
|
5716
|
+
*/
|
|
5717
|
+
const SNACKBAR_DIRECTIVES = [
|
|
5718
|
+
BaoSimpleSnackBarComponent,
|
|
5719
|
+
BaoSnackBarContainerComponent
|
|
5720
|
+
];
|
|
5721
|
+
class BaoSnackBarModule {
|
|
5722
|
+
}
|
|
5723
|
+
BaoSnackBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5724
|
+
BaoSnackBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, declarations: [BaoSimpleSnackBarComponent,
|
|
5725
|
+
BaoSnackBarContainerComponent], imports: [CommonModule,
|
|
5726
|
+
OverlayModule,
|
|
5727
|
+
PortalModule,
|
|
5728
|
+
BaoButtonModule,
|
|
5729
|
+
BaoIconModule], exports: [BaoSimpleSnackBarComponent,
|
|
5730
|
+
BaoSnackBarContainerComponent] });
|
|
5731
|
+
BaoSnackBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, providers: [BaoSnackBarService, BaoSnackBarConfig], imports: [[
|
|
5732
|
+
CommonModule,
|
|
5733
|
+
OverlayModule,
|
|
5734
|
+
PortalModule,
|
|
5735
|
+
BaoButtonModule,
|
|
5736
|
+
BaoIconModule
|
|
5737
|
+
]] });
|
|
5738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, decorators: [{
|
|
5739
|
+
type: NgModule,
|
|
5740
|
+
args: [{
|
|
5741
|
+
imports: [
|
|
5742
|
+
CommonModule,
|
|
5743
|
+
OverlayModule,
|
|
5744
|
+
PortalModule,
|
|
5745
|
+
BaoButtonModule,
|
|
5746
|
+
BaoIconModule
|
|
5747
|
+
],
|
|
5748
|
+
providers: [BaoSnackBarService, BaoSnackBarConfig],
|
|
5749
|
+
declarations: SNACKBAR_DIRECTIVES,
|
|
5750
|
+
exports: SNACKBAR_DIRECTIVES,
|
|
5751
|
+
entryComponents: [SNACKBAR_DIRECTIVES]
|
|
5752
|
+
}]
|
|
5753
|
+
}] });
|
|
5754
|
+
|
|
5755
|
+
/*
|
|
5756
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5757
|
+
* Licensed under the MIT license.
|
|
5758
|
+
* See LICENSE file in the project root for full license information.
|
|
5759
|
+
*/
|
|
5760
|
+
const Breakpoints = {
|
|
5761
|
+
XSmall: '(max-width: 575.98px)',
|
|
5762
|
+
Small: '(min-width: 576px) and (max-width: 767.98px)',
|
|
5763
|
+
Medium: '(min-width: 768px) and (max-width: 991.98px)',
|
|
5764
|
+
Large: '(min-width: 992px) and (max-width: 1199.98px)',
|
|
5765
|
+
XLarge: '(min-width: 1200px)'
|
|
5766
|
+
};
|
|
5767
|
+
|
|
5768
|
+
/*
|
|
5769
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5770
|
+
* Licensed under the MIT license.
|
|
5771
|
+
* See LICENSE file in the project root for full license information.
|
|
5772
|
+
*/
|
|
5773
|
+
|
|
5774
|
+
/**
|
|
5775
|
+
* This component is dynamically added to replace breadcrumb when System Header is viewed on tablet or mobile screens.
|
|
5776
|
+
* Used internally by BaoSystemHeaderComponent only, not to be used by host application.
|
|
5777
|
+
*/
|
|
5778
|
+
class BaoBackNavigationComponent {
|
|
5779
|
+
constructor(renderer, elementRef) {
|
|
5780
|
+
this.renderer = renderer;
|
|
5781
|
+
this.elementRef = elementRef;
|
|
5782
|
+
}
|
|
5783
|
+
ngOnChanges(changes) {
|
|
5784
|
+
if (changes['link'] && changes['link'].currentValue) {
|
|
5785
|
+
this.renderer.setAttribute(this.elementRef.nativeElement.children[0], 'href', changes['link'].currentValue);
|
|
5786
|
+
}
|
|
5787
|
+
}
|
|
5788
|
+
}
|
|
5789
|
+
BaoBackNavigationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5790
|
+
BaoBackNavigationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoBackNavigationComponent, selector: "bao-back-navigation-component", inputs: { link: "link" }, host: { classAttribute: "bao-system-header-back-button" }, usesOnChanges: true, ngImport: i0, template: ` <a>
|
|
5791
|
+
<bao-icon
|
|
5792
|
+
color="action"
|
|
5793
|
+
title="arrow-left"
|
|
5794
|
+
svgIcon="icon-arrow-left"
|
|
5795
|
+
size="x-small"
|
|
5796
|
+
></bao-icon>
|
|
5797
|
+
</a>`, isInline: true, components: [{ type: BaoIconComponent, selector: "bao-icon", inputs: ["color", "size", "svgIcon", "title"], exportAs: ["baoIcon"] }] });
|
|
5798
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationComponent, decorators: [{
|
|
5799
|
+
type: Component,
|
|
5800
|
+
args: [{
|
|
5801
|
+
selector: 'bao-back-navigation-component',
|
|
5802
|
+
template: ` <a>
|
|
5803
|
+
<bao-icon
|
|
5804
|
+
color="action"
|
|
5805
|
+
title="arrow-left"
|
|
5806
|
+
svgIcon="icon-arrow-left"
|
|
5807
|
+
size="x-small"
|
|
5808
|
+
></bao-icon>
|
|
5809
|
+
</a>`,
|
|
5810
|
+
host: {
|
|
5811
|
+
class: 'bao-system-header-back-button'
|
|
5812
|
+
}
|
|
5813
|
+
}]
|
|
5814
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { link: [{
|
|
5815
|
+
type: Input
|
|
5816
|
+
}] } });
|
|
5817
|
+
/**
|
|
5818
|
+
* This directive is to mark the template where the BaoBackNavigationComponent should be dynamically inserted,
|
|
5819
|
+
* when a Breadcrumb component needs to be replaced
|
|
5820
|
+
*/
|
|
5821
|
+
class BaoBackNavigationInsert {
|
|
5822
|
+
constructor(viewContainerRef) {
|
|
5823
|
+
this.viewContainerRef = viewContainerRef;
|
|
5824
|
+
}
|
|
5825
|
+
}
|
|
5826
|
+
BaoBackNavigationInsert.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationInsert, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5827
|
+
BaoBackNavigationInsert.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoBackNavigationInsert, selector: "[backNavigationInsert]", ngImport: i0 });
|
|
5828
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationInsert, decorators: [{
|
|
5829
|
+
type: Directive,
|
|
5830
|
+
args: [{
|
|
5831
|
+
selector: '[backNavigationInsert]'
|
|
5832
|
+
}]
|
|
5833
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
|
|
5834
|
+
class BaoSystemHeaderComponent {
|
|
5835
|
+
constructor(breakpointObserver, renderer) {
|
|
5836
|
+
this.breakpointObserver = breakpointObserver;
|
|
5837
|
+
this.renderer = renderer;
|
|
5838
|
+
this.screenType = 'desktop';
|
|
5839
|
+
}
|
|
5840
|
+
get textContainerChildren() {
|
|
5841
|
+
return Array.from(this.textContainer.nativeElement.children);
|
|
5842
|
+
}
|
|
5843
|
+
ngOnInit() {
|
|
5844
|
+
if ([Breakpoints.XSmall, Breakpoints.Small].some(size => this.breakpointObserver.isMatched(size))) {
|
|
5845
|
+
this.screenType = 'mobile';
|
|
5846
|
+
}
|
|
5847
|
+
else if (this.breakpointObserver.isMatched(Breakpoints.Medium)) {
|
|
5848
|
+
this.screenType = 'tablet';
|
|
5849
|
+
}
|
|
5850
|
+
else if ([Breakpoints.Large, Breakpoints.XLarge].some(size => this.breakpointObserver.isMatched(size))) {
|
|
5851
|
+
this.screenType = 'desktop';
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5854
|
+
ngAfterViewInit() {
|
|
5855
|
+
this.formatNavigation();
|
|
5856
|
+
this.applySizeClass();
|
|
5857
|
+
}
|
|
5858
|
+
formatNavigation() {
|
|
5859
|
+
// If view is rendered on a mobile/tablet screen
|
|
5860
|
+
if (this.screenType == 'mobile' || this.screenType == 'tablet') {
|
|
5861
|
+
if (this.textContainerChildren[0].className == 'bao-breadcrumb') {
|
|
5862
|
+
// Retrieve link of parent page
|
|
5863
|
+
const breadcrumbElementsList = this.textContainerChildren[0].children[0];
|
|
5864
|
+
const breadcrumbLength = breadcrumbElementsList.children.length;
|
|
5865
|
+
const parentLink = breadcrumbElementsList.children[breadcrumbLength - 2].attributes['href'].value;
|
|
5866
|
+
// Remove Breadcrumb component and replace it with back button
|
|
5867
|
+
this.renderer.removeChild(this.textContainer.nativeElement, this.textContainerChildren[0]);
|
|
5868
|
+
const viewContainerRef = this.backButtonInsert.viewContainerRef;
|
|
5869
|
+
viewContainerRef.clear();
|
|
5870
|
+
const componentRef = viewContainerRef.createComponent(BaoBackNavigationComponent);
|
|
5871
|
+
componentRef.instance.link = parentLink;
|
|
5872
|
+
}
|
|
5873
|
+
}
|
|
5874
|
+
}
|
|
5875
|
+
applySizeClass() {
|
|
5876
|
+
const tagInfoContainer = this.textContainer.nativeElement.childNodes[this.textContainerChildren.length - 1];
|
|
5877
|
+
if (this.screenType === 'mobile') {
|
|
5878
|
+
this.renderer.addClass(tagInfoContainer, 'mobile');
|
|
5879
|
+
}
|
|
5880
|
+
}
|
|
5881
|
+
}
|
|
5882
|
+
BaoSystemHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderComponent, deps: [{ token: i2$1.BreakpointObserver }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
5883
|
+
BaoSystemHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoSystemHeaderComponent, selector: "bao-system-header", host: { classAttribute: "bao-system-header" }, viewQueries: [{ propertyName: "textContainer", first: true, predicate: ["textContainer"], descendants: true }, { propertyName: "backButtonInsert", first: true, predicate: BaoBackNavigationInsert, descendants: true, static: true }], ngImport: i0, template: "<div class=\"left-side-content\">\n <div class=\"back-navigation-container\">\n <ng-content select=\"a\"></ng-content>\n <ng-template backNavigationInsert></ng-template>\n </div>\n <div #textContainer class=\"text-content\">\n <ng-content select=\"bao-breadcrumb\"></ng-content>\n <ng-content select=\"h1\"></ng-content>\n <div class=\"tag-info-container\">\n <ng-content select=\"bao-tag\"></ng-content>\n <span class=\"additional-info\">\n <ng-content select=\"span\"></ng-content>\n </span>\n </div>\n </div>\n</div>\n<div class=\"button-container\">\n <ng-content></ng-content>\n</div>\n", styles: ["@charset \"UTF-8\";.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-system-header{display:flex;justify-content:flex-start}.bao-system-header .left-side-content{display:inline-flex;width:75%}.bao-system-header .left-side-content .back-navigation-container a{margin-right:1.25rem;border-bottom:none}.bao-system-header .left-side-content .back-navigation-container a:hover{cursor:pointer}.bao-system-header .left-side-content .text-content{width:100%}.bao-system-header .left-side-content .text-content h1{font-weight:700;color:#212529;font-size:1.5rem;line-height:2rem;margin-bottom:.5rem}.bao-system-header .left-side-content .text-content .tag-info-container{width:100%;display:block}.bao-system-header .left-side-content .text-content .tag-info-container>span:nth-child(2):before{content:\"\\b7\";margin:0 .5rem}.bao-system-header .left-side-content .text-content .tag-info-container .additional-info>*{font-weight:400;font-size:.875rem;line-height:1.25rem}.bao-system-header .left-side-content .text-content .tag-info-container.mobile .bao-tag{margin-bottom:.25rem}.bao-system-header .left-side-content .text-content .tag-info-container.mobile .additional-info{display:block}.bao-system-header .left-side-content .text-content .tag-info-container.mobile .additional-info:before{content:none}.bao-system-header .left-side-content .text-content .tag-info-container>.bao-tag{max-width:100%}.bao-system-header .left-side-content .text-content .tag-info-container>.bao-tag>span{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bao-system-header .button-container{flex-shrink:0;margin-left:auto}.bao-system-header .button-container .bao-button{margin-left:1rem}\n"], directives: [{ type: BaoBackNavigationInsert, selector: "[backNavigationInsert]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
5884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderComponent, decorators: [{
|
|
5885
|
+
type: Component,
|
|
5886
|
+
args: [{ selector: 'bao-system-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5887
|
+
class: 'bao-system-header'
|
|
5888
|
+
}, template: "<div class=\"left-side-content\">\n <div class=\"back-navigation-container\">\n <ng-content select=\"a\"></ng-content>\n <ng-template backNavigationInsert></ng-template>\n </div>\n <div #textContainer class=\"text-content\">\n <ng-content select=\"bao-breadcrumb\"></ng-content>\n <ng-content select=\"h1\"></ng-content>\n <div class=\"tag-info-container\">\n <ng-content select=\"bao-tag\"></ng-content>\n <span class=\"additional-info\">\n <ng-content select=\"span\"></ng-content>\n </span>\n </div>\n </div>\n</div>\n<div class=\"button-container\">\n <ng-content></ng-content>\n</div>\n", styles: ["@charset \"UTF-8\";.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-system-header{display:flex;justify-content:flex-start}.bao-system-header .left-side-content{display:inline-flex;width:75%}.bao-system-header .left-side-content .back-navigation-container a{margin-right:1.25rem;border-bottom:none}.bao-system-header .left-side-content .back-navigation-container a:hover{cursor:pointer}.bao-system-header .left-side-content .text-content{width:100%}.bao-system-header .left-side-content .text-content h1{font-weight:700;color:#212529;font-size:1.5rem;line-height:2rem;margin-bottom:.5rem}.bao-system-header .left-side-content .text-content .tag-info-container{width:100%;display:block}.bao-system-header .left-side-content .text-content .tag-info-container>span:nth-child(2):before{content:\"\\b7\";margin:0 .5rem}.bao-system-header .left-side-content .text-content .tag-info-container .additional-info>*{font-weight:400;font-size:.875rem;line-height:1.25rem}.bao-system-header .left-side-content .text-content .tag-info-container.mobile .bao-tag{margin-bottom:.25rem}.bao-system-header .left-side-content .text-content .tag-info-container.mobile .additional-info{display:block}.bao-system-header .left-side-content .text-content .tag-info-container.mobile .additional-info:before{content:none}.bao-system-header .left-side-content .text-content .tag-info-container>.bao-tag{max-width:100%}.bao-system-header .left-side-content .text-content .tag-info-container>.bao-tag>span{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bao-system-header .button-container{flex-shrink:0;margin-left:auto}.bao-system-header .button-container .bao-button{margin-left:1rem}\n"] }]
|
|
5889
|
+
}], ctorParameters: function () { return [{ type: i2$1.BreakpointObserver }, { type: i0.Renderer2 }]; }, propDecorators: { textContainer: [{
|
|
5890
|
+
type: ViewChild,
|
|
5891
|
+
args: ['textContainer', { static: false }]
|
|
5892
|
+
}], backButtonInsert: [{
|
|
5893
|
+
type: ViewChild,
|
|
5894
|
+
args: [BaoBackNavigationInsert, { static: true }]
|
|
5895
|
+
}] } });
|
|
5896
|
+
|
|
5897
|
+
/*
|
|
5898
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5899
|
+
* Licensed under the MIT license.
|
|
5900
|
+
* See LICENSE file in the project root for full license information.
|
|
5901
|
+
*/
|
|
5902
|
+
const SYSTEM_HEADER_DIRECTIVES = [
|
|
5903
|
+
BaoSystemHeaderComponent,
|
|
5904
|
+
BaoBackNavigationInsert,
|
|
5905
|
+
BaoBackNavigationComponent
|
|
5906
|
+
];
|
|
5907
|
+
class BaoSystemHeaderModule {
|
|
5908
|
+
}
|
|
5909
|
+
BaoSystemHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5910
|
+
BaoSystemHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, declarations: [BaoSystemHeaderComponent,
|
|
5911
|
+
BaoBackNavigationInsert,
|
|
5912
|
+
BaoBackNavigationComponent], imports: [CommonModule, BaoIconModule], exports: [BaoSystemHeaderComponent,
|
|
5913
|
+
BaoBackNavigationInsert,
|
|
5914
|
+
BaoBackNavigationComponent] });
|
|
5915
|
+
BaoSystemHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, imports: [[CommonModule, BaoIconModule]] });
|
|
5916
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, decorators: [{
|
|
5917
|
+
type: NgModule,
|
|
5918
|
+
args: [{
|
|
5919
|
+
imports: [CommonModule, BaoIconModule],
|
|
5920
|
+
declarations: [SYSTEM_HEADER_DIRECTIVES],
|
|
5921
|
+
exports: [SYSTEM_HEADER_DIRECTIVES]
|
|
5922
|
+
}]
|
|
5923
|
+
}] });
|
|
5924
|
+
|
|
5925
|
+
/*
|
|
5926
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5927
|
+
* Licensed under the MIT license.
|
|
5928
|
+
* See LICENSE file in the project root for full license information.
|
|
5929
|
+
*/
|
|
5930
|
+
|
|
5038
5931
|
/*
|
|
5039
5932
|
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5040
5933
|
* Licensed under the MIT license.
|
|
@@ -5047,7 +5940,8 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
|
5047
5940
|
BaoButtonModule,
|
|
5048
5941
|
BaoAlertModule,
|
|
5049
5942
|
BaoCardModule,
|
|
5050
|
-
BaoBreadcrumbModule
|
|
5943
|
+
BaoBreadcrumbModule,
|
|
5944
|
+
BaoModalModule], exports: [BaoIconModule,
|
|
5051
5945
|
BaoButtonModule,
|
|
5052
5946
|
BaoAlertModule,
|
|
5053
5947
|
BaoBreadcrumbModule,
|
|
@@ -5064,16 +5958,18 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
|
5064
5958
|
BaoModalModule,
|
|
5065
5959
|
BaoHyperlinkModule,
|
|
5066
5960
|
BaoDropdownMenuModule,
|
|
5067
|
-
BaoFileModule
|
|
5961
|
+
BaoFileModule,
|
|
5962
|
+
BaoSnackBarModule,
|
|
5963
|
+
BaoSystemHeaderModule
|
|
5068
5964
|
// TODO: reactivate once component does not depend on global css BaoBadgeModule,
|
|
5069
|
-
// TODO: reactivate once component does not depend on global css BaoSnackBarModule,
|
|
5070
5965
|
] });
|
|
5071
5966
|
BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModule, imports: [[
|
|
5072
5967
|
BaoIconModule,
|
|
5073
5968
|
BaoButtonModule,
|
|
5074
5969
|
BaoAlertModule,
|
|
5075
5970
|
BaoCardModule,
|
|
5076
|
-
BaoBreadcrumbModule
|
|
5971
|
+
BaoBreadcrumbModule,
|
|
5972
|
+
BaoModalModule
|
|
5077
5973
|
], BaoIconModule,
|
|
5078
5974
|
BaoButtonModule,
|
|
5079
5975
|
BaoAlertModule,
|
|
@@ -5091,9 +5987,10 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
|
5091
5987
|
BaoModalModule,
|
|
5092
5988
|
BaoHyperlinkModule,
|
|
5093
5989
|
BaoDropdownMenuModule,
|
|
5094
|
-
BaoFileModule
|
|
5990
|
+
BaoFileModule,
|
|
5991
|
+
BaoSnackBarModule,
|
|
5992
|
+
BaoSystemHeaderModule
|
|
5095
5993
|
// TODO: reactivate once component does not depend on global css BaoBadgeModule,
|
|
5096
|
-
// TODO: reactivate once component does not depend on global css BaoSnackBarModule,
|
|
5097
5994
|
] });
|
|
5098
5995
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModule, decorators: [{
|
|
5099
5996
|
type: NgModule,
|
|
@@ -5103,7 +6000,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5103
6000
|
BaoButtonModule,
|
|
5104
6001
|
BaoAlertModule,
|
|
5105
6002
|
BaoCardModule,
|
|
5106
|
-
BaoBreadcrumbModule
|
|
6003
|
+
BaoBreadcrumbModule,
|
|
6004
|
+
BaoModalModule
|
|
5107
6005
|
],
|
|
5108
6006
|
exports: [
|
|
5109
6007
|
BaoIconModule,
|
|
@@ -5123,9 +6021,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5123
6021
|
BaoModalModule,
|
|
5124
6022
|
BaoHyperlinkModule,
|
|
5125
6023
|
BaoDropdownMenuModule,
|
|
5126
|
-
BaoFileModule
|
|
6024
|
+
BaoFileModule,
|
|
6025
|
+
BaoSnackBarModule,
|
|
6026
|
+
BaoSystemHeaderModule
|
|
5127
6027
|
// TODO: reactivate once component does not depend on global css BaoBadgeModule,
|
|
5128
|
-
// TODO: reactivate once component does not depend on global css BaoSnackBarModule,
|
|
5129
6028
|
]
|
|
5130
6029
|
}]
|
|
5131
6030
|
}] });
|
|
@@ -5205,9 +6104,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5205
6104
|
* See LICENSE file in the project root for full license information.
|
|
5206
6105
|
*/
|
|
5207
6106
|
|
|
6107
|
+
/*
|
|
6108
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
6109
|
+
* Licensed under the MIT license.
|
|
6110
|
+
* See LICENSE file in the project root for full license information.
|
|
6111
|
+
*/
|
|
6112
|
+
|
|
5208
6113
|
/**
|
|
5209
6114
|
* Generated bundle index. Do not edit.
|
|
5210
6115
|
*/
|
|
5211
6116
|
|
|
5212
|
-
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 };
|
|
6117
|
+
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, BaoBackNavigationComponent, BaoBackNavigationInsert, 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, BaoSystemHeaderComponent, BaoSystemHeaderModule, BaoTabHeader, BaoTabPanel, BaoTablistComponent, BaoTabsContainer, BaoTabsModule, BaoTagComponent, BaoTagModule, BaoTitleTextComponent, _BaoModalContainerBase, _closeModalVia, baoFactory, eModalDesktopWidthSize, eModalMobileWidthSize, throwBaoModalContentAlreadyAttachedError };
|
|
5213
6118
|
//# sourceMappingURL=villedemontreal-angular-ui.mjs.map
|