@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,13 +12,15 @@ 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
17
|
import { __awaiter } from 'tslib';
|
|
18
|
+
import * as i1$5 from '@angular/cdk/platform';
|
|
18
19
|
import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
|
|
19
|
-
import { trigger, state, style, transition, group, animate, query, animateChild } from '@angular/animations';
|
|
20
20
|
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
21
|
-
import {
|
|
21
|
+
import { take as take$1 } from 'rxjs/operators';
|
|
22
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
23
|
+
import * as i2$1 from '@angular/cdk/layout';
|
|
22
24
|
|
|
23
25
|
function baoColorToHex(baoColor) {
|
|
24
26
|
switch (baoColor) {
|
|
@@ -2941,34 +2943,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2941
2943
|
* See LICENSE file in the project root for full license information.
|
|
2942
2944
|
*/
|
|
2943
2945
|
|
|
2944
|
-
/*
|
|
2945
|
-
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
2946
|
-
* Licensed under the MIT license.
|
|
2947
|
-
* See LICENSE file in the project root for full license information.
|
|
2948
|
-
*/
|
|
2949
|
-
/**
|
|
2950
|
-
* Animations used by MatDialog.
|
|
2951
|
-
* @docs-private
|
|
2952
|
-
*/
|
|
2953
|
-
const baoModalAnimations = {
|
|
2954
|
-
/** Animation that is applied on the modal container by default. */
|
|
2955
|
-
modalContainer: trigger('modalContainer', [
|
|
2956
|
-
// Note: The `enter` animation transitions to `transform: none`, because for some reason
|
|
2957
|
-
// specifying the transform explicitly, causes IE both to blur the modal content and
|
|
2958
|
-
// decimate the animation performance. Leaving it as `none` solves both issues.
|
|
2959
|
-
state('void, exit', style({ opacity: 0, transform: 'scale(0.7)' })),
|
|
2960
|
-
state('enter', style({ transform: 'none' })),
|
|
2961
|
-
transition('* => enter', group([
|
|
2962
|
-
animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'none', opacity: 1 })),
|
|
2963
|
-
query('@*', animateChild(), { optional: true })
|
|
2964
|
-
])),
|
|
2965
|
-
transition('* => void, * => exit', group([
|
|
2966
|
-
animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({ opacity: 0 })),
|
|
2967
|
-
query('@*', animateChild(), { optional: true })
|
|
2968
|
-
]))
|
|
2969
|
-
])
|
|
2970
|
-
};
|
|
2971
|
-
|
|
2972
2946
|
/*
|
|
2973
2947
|
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
2974
2948
|
* Licensed under the MIT license.
|
|
@@ -3238,41 +3212,29 @@ class BaoModalContainer extends _BaoModalContainerBase {
|
|
|
3238
3212
|
/** State of the modal animation. */
|
|
3239
3213
|
this._state = 'enter';
|
|
3240
3214
|
}
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
if (toState === 'enter') {
|
|
3245
|
-
yield this._trapFocus();
|
|
3246
|
-
this._animationStateChanged.next({ state: 'opened', totalTime });
|
|
3247
|
-
}
|
|
3248
|
-
else if (toState === 'exit') {
|
|
3249
|
-
this._restoreFocus();
|
|
3250
|
-
this._animationStateChanged.next({ state: 'closed', totalTime });
|
|
3251
|
-
}
|
|
3252
|
-
});
|
|
3253
|
-
}
|
|
3254
|
-
/** Callback, invoked when an animation on the host starts. */
|
|
3255
|
-
_onAnimationStart({ toState, totalTime }) {
|
|
3256
|
-
if (toState === 'enter') {
|
|
3257
|
-
this._animationStateChanged.next({ state: 'opening', totalTime });
|
|
3258
|
-
}
|
|
3259
|
-
else if (toState === 'exit' || toState === 'void') {
|
|
3260
|
-
this._animationStateChanged.next({ state: 'closing', totalTime });
|
|
3261
|
-
}
|
|
3215
|
+
_startOpenAnimation() {
|
|
3216
|
+
this._animationStateChanged.emit({ state: 'opening', totalTime: 20 });
|
|
3217
|
+
void Promise.resolve().then(() => this._finishDialogOpen());
|
|
3262
3218
|
}
|
|
3263
3219
|
/** Starts the modal exit animation. */
|
|
3264
3220
|
_startExitAnimation() {
|
|
3265
|
-
this.
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
this.
|
|
3221
|
+
this._animationStateChanged.emit({ state: 'closed', totalTime: 20 });
|
|
3222
|
+
}
|
|
3223
|
+
_finishDialogOpen() {
|
|
3224
|
+
this._openAnimationDone(20);
|
|
3225
|
+
}
|
|
3226
|
+
_openAnimationDone(totalTime) {
|
|
3227
|
+
if (this._config.delayFocusTrap) {
|
|
3228
|
+
void this._trapFocus();
|
|
3229
|
+
}
|
|
3230
|
+
this._animationStateChanged.next({ state: 'opened', totalTime });
|
|
3269
3231
|
}
|
|
3270
3232
|
}
|
|
3271
3233
|
BaoModalContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalContainer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3272
|
-
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" },
|
|
3234
|
+
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 });
|
|
3273
3235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalContainer, decorators: [{
|
|
3274
3236
|
type: Component,
|
|
3275
|
-
args: [{ selector: 'bao-modal-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default,
|
|
3237
|
+
args: [{ selector: 'bao-modal-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, host: {
|
|
3276
3238
|
class: 'bao-modal-container',
|
|
3277
3239
|
tabindex: '-1',
|
|
3278
3240
|
'aria-modal': 'true',
|
|
@@ -3280,22 +3242,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3280
3242
|
'[attr.role]': '_config.role',
|
|
3281
3243
|
'[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',
|
|
3282
3244
|
'[attr.aria-label]': '_config.ariaLabel',
|
|
3283
|
-
'[attr.aria-describedby]': '_config.ariaDescribedBy || null'
|
|
3284
|
-
|
|
3285
|
-
'(@modalContainer.start)': '_onAnimationStart($event)',
|
|
3286
|
-
'(@modalContainer.done)': '_onAnimationDone($event)'
|
|
3287
|
-
}, 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"] }]
|
|
3245
|
+
'[attr.aria-describedby]': '_config.ariaDescribedBy || null'
|
|
3246
|
+
}, 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"] }]
|
|
3288
3247
|
}] });
|
|
3289
3248
|
|
|
3290
3249
|
// Counter for unique modal ids.
|
|
3291
|
-
let uniqueId = 0;
|
|
3250
|
+
let uniqueId$1 = 0;
|
|
3292
3251
|
/**
|
|
3293
3252
|
* Reference to a modal opened via the BaoModalService.
|
|
3294
3253
|
*/
|
|
3295
3254
|
class BaoModalRef {
|
|
3296
3255
|
constructor(_overlayRef, _containerInstance,
|
|
3297
3256
|
/** Id of the modal. */
|
|
3298
|
-
id = `bao-modal-${uniqueId++}`) {
|
|
3257
|
+
id = `bao-modal-${uniqueId$1++}`) {
|
|
3299
3258
|
this._overlayRef = _overlayRef;
|
|
3300
3259
|
this._containerInstance = _containerInstance;
|
|
3301
3260
|
this.id = id;
|
|
@@ -3376,6 +3335,9 @@ class BaoModalRef {
|
|
|
3376
3335
|
this._state = 1 /* CLOSING */;
|
|
3377
3336
|
this._containerInstance._startExitAnimation();
|
|
3378
3337
|
}
|
|
3338
|
+
startOpenAnimation() {
|
|
3339
|
+
this._containerInstance._startOpenAnimation();
|
|
3340
|
+
}
|
|
3379
3341
|
/**
|
|
3380
3342
|
* Gets an observable that is notified when the modal is finished opening.
|
|
3381
3343
|
*/
|
|
@@ -3488,7 +3450,7 @@ function _closeModalVia(ref, interactionType, result) {
|
|
|
3488
3450
|
/** Injection token that can be used to access the data that was passed in to a modal. */
|
|
3489
3451
|
const BAO_MODAL_DATA = new InjectionToken('BaoModalData');
|
|
3490
3452
|
class BaoModalBase {
|
|
3491
|
-
constructor(_overlay, _injector, _parentModal, _overlayContainer, _modalRefConstructor, _modalContainerType, _modalDataToken
|
|
3453
|
+
constructor(_overlay, _injector, _parentModal, _overlayContainer, _modalRefConstructor, _modalContainerType, _modalDataToken) {
|
|
3492
3454
|
this._overlay = _overlay;
|
|
3493
3455
|
this._injector = _injector;
|
|
3494
3456
|
this._parentModal = _parentModal;
|
|
@@ -3496,7 +3458,6 @@ class BaoModalBase {
|
|
|
3496
3458
|
this._modalRefConstructor = _modalRefConstructor;
|
|
3497
3459
|
this._modalContainerType = _modalContainerType;
|
|
3498
3460
|
this._modalDataToken = _modalDataToken;
|
|
3499
|
-
this._animationMode = _animationMode;
|
|
3500
3461
|
this.afterAllClosed = defer(() => this.openModals.length
|
|
3501
3462
|
? this.getAfterAllClosed()
|
|
3502
3463
|
: this.getAfterAllClosed().pipe(startWith(undefined)));
|
|
@@ -3536,21 +3497,6 @@ class BaoModalBase {
|
|
|
3536
3497
|
}
|
|
3537
3498
|
const overlayRef = this._createOverlay(conf);
|
|
3538
3499
|
const modalContainer = this._attachModalContainer(overlayRef, conf);
|
|
3539
|
-
if (this._animationMode !== 'NoopAnimations') {
|
|
3540
|
-
const animationStateSubscription = modalContainer._animationStateChanged.subscribe(modalAnimationEvent => {
|
|
3541
|
-
if (modalAnimationEvent.state === 'opening') {
|
|
3542
|
-
this._modalAnimatingOpen = true;
|
|
3543
|
-
}
|
|
3544
|
-
if (modalAnimationEvent.state === 'opened') {
|
|
3545
|
-
this._modalAnimatingOpen = false;
|
|
3546
|
-
animationStateSubscription.unsubscribe();
|
|
3547
|
-
}
|
|
3548
|
-
});
|
|
3549
|
-
if (!this._animationStateSubscriptions) {
|
|
3550
|
-
this._animationStateSubscriptions = new Subscription();
|
|
3551
|
-
}
|
|
3552
|
-
this._animationStateSubscriptions.add(animationStateSubscription);
|
|
3553
|
-
}
|
|
3554
3500
|
const modalRef = this._attachModalContent(componentOrTemplateRef, modalContainer, overlayRef, conf);
|
|
3555
3501
|
this._lastModalRef = modalRef;
|
|
3556
3502
|
// If this is the first modal that we're opening, hide all the non-overlay content.
|
|
@@ -3621,6 +3567,7 @@ class BaoModalBase {
|
|
|
3621
3567
|
});
|
|
3622
3568
|
const containerPortal = new ComponentPortal(this._modalContainerType, config.viewContainerRef, injector);
|
|
3623
3569
|
const containerRef = overlay.attach(containerPortal);
|
|
3570
|
+
containerRef.instance._startOpenAnimation();
|
|
3624
3571
|
return containerRef.instance;
|
|
3625
3572
|
}
|
|
3626
3573
|
/**
|
|
@@ -3735,16 +3682,16 @@ BaoModalBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
|
|
|
3735
3682
|
BaoModalBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoModalBase, ngImport: i0 });
|
|
3736
3683
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalBase, decorators: [{
|
|
3737
3684
|
type: Directive
|
|
3738
|
-
}], 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 }
|
|
3685
|
+
}], 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 }]; } });
|
|
3739
3686
|
/**
|
|
3740
3687
|
* Service to open modal.
|
|
3741
3688
|
*/
|
|
3742
3689
|
class BaoModal extends BaoModalBase {
|
|
3743
|
-
constructor(overlay, injector, parentModal, overlayContainer
|
|
3744
|
-
super(overlay, injector, parentModal, overlayContainer, BaoModalRef, BaoModalContainer, BAO_MODAL_DATA
|
|
3690
|
+
constructor(overlay, injector, parentModal, overlayContainer) {
|
|
3691
|
+
super(overlay, injector, parentModal, overlayContainer, BaoModalRef, BaoModalContainer, BAO_MODAL_DATA);
|
|
3745
3692
|
}
|
|
3746
3693
|
}
|
|
3747
|
-
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 }
|
|
3694
|
+
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 });
|
|
3748
3695
|
BaoModal.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModal });
|
|
3749
3696
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModal, decorators: [{
|
|
3750
3697
|
type: Injectable
|
|
@@ -3753,12 +3700,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3753
3700
|
type: Optional
|
|
3754
3701
|
}, {
|
|
3755
3702
|
type: SkipSelf
|
|
3756
|
-
}] }, { type: i1$4.OverlayContainer }
|
|
3757
|
-
type: Optional
|
|
3758
|
-
}, {
|
|
3759
|
-
type: Inject,
|
|
3760
|
-
args: [ANIMATION_MODULE_TYPE]
|
|
3761
|
-
}] }];
|
|
3703
|
+
}] }, { type: i1$4.OverlayContainer }];
|
|
3762
3704
|
} });
|
|
3763
3705
|
|
|
3764
3706
|
/*
|
|
@@ -3851,28 +3793,12 @@ const MODAL_DIRECTIVES = [BaoModalContainer, BaoModalClose];
|
|
|
3851
3793
|
class BaoModalModule {
|
|
3852
3794
|
}
|
|
3853
3795
|
BaoModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3854
|
-
BaoModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, declarations: [BaoModalContainer, BaoModalClose], imports: [CommonModule,
|
|
3855
|
-
|
|
3856
|
-
PortalModule,
|
|
3857
|
-
BrowserAnimationsModule,
|
|
3858
|
-
NoopAnimationsModule], exports: [BaoModalContainer, BaoModalClose] });
|
|
3859
|
-
BaoModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, providers: [BaoModal], imports: [[
|
|
3860
|
-
CommonModule,
|
|
3861
|
-
OverlayModule,
|
|
3862
|
-
PortalModule,
|
|
3863
|
-
BrowserAnimationsModule,
|
|
3864
|
-
NoopAnimationsModule
|
|
3865
|
-
]] });
|
|
3796
|
+
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] });
|
|
3797
|
+
BaoModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, providers: [BaoModal], imports: [[CommonModule, OverlayModule, PortalModule]] });
|
|
3866
3798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModalModule, decorators: [{
|
|
3867
3799
|
type: NgModule,
|
|
3868
3800
|
args: [{
|
|
3869
|
-
imports: [
|
|
3870
|
-
CommonModule,
|
|
3871
|
-
OverlayModule,
|
|
3872
|
-
PortalModule,
|
|
3873
|
-
BrowserAnimationsModule,
|
|
3874
|
-
NoopAnimationsModule
|
|
3875
|
-
],
|
|
3801
|
+
imports: [CommonModule, OverlayModule, PortalModule],
|
|
3876
3802
|
declarations: MODAL_DIRECTIVES,
|
|
3877
3803
|
exports: MODAL_DIRECTIVES,
|
|
3878
3804
|
providers: [BaoModal]
|
|
@@ -3996,6 +3922,10 @@ class BaoDropdownMenuItem {
|
|
|
3996
3922
|
* Is the list item disabled
|
|
3997
3923
|
*/
|
|
3998
3924
|
this.disabled = false;
|
|
3925
|
+
/**
|
|
3926
|
+
* Emits when menu item is clicked
|
|
3927
|
+
*/
|
|
3928
|
+
this.itemClicked = new EventEmitter();
|
|
3999
3929
|
}
|
|
4000
3930
|
get nativeElement() {
|
|
4001
3931
|
return this.elementRef.nativeElement;
|
|
@@ -4076,19 +4006,25 @@ class BaoDropdownMenuItem {
|
|
|
4076
4006
|
}
|
|
4077
4007
|
}
|
|
4078
4008
|
/**
|
|
4079
|
-
* This method propagates a click event to menu item children with inputs (checkbox, radio button)
|
|
4009
|
+
* This method propagates a click event to menu item children with inputs (checkbox, radio button).
|
|
4010
|
+
* It emits event to close menu if item does not contain an input.
|
|
4080
4011
|
*/
|
|
4081
4012
|
propagateClick() {
|
|
4013
|
+
let closeMenu = true;
|
|
4082
4014
|
for (let i = 0; i < this.nativeElement.children.length; i++) {
|
|
4083
4015
|
if (this.nativeElement.children.item(i).firstElementChild.localName ==
|
|
4084
4016
|
'input') {
|
|
4085
4017
|
this.nativeElement.children.item(i).firstElementChild.click();
|
|
4018
|
+
closeMenu = false;
|
|
4086
4019
|
}
|
|
4087
4020
|
}
|
|
4021
|
+
if (closeMenu) {
|
|
4022
|
+
this.itemClicked.emit();
|
|
4023
|
+
}
|
|
4088
4024
|
}
|
|
4089
4025
|
}
|
|
4090
4026
|
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 });
|
|
4091
|
-
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:
|
|
4027
|
+
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 });
|
|
4092
4028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoDropdownMenuItem, decorators: [{
|
|
4093
4029
|
type: Directive,
|
|
4094
4030
|
args: [{
|
|
@@ -4100,6 +4036,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4100
4036
|
}]
|
|
4101
4037
|
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: BaoDropdownMenuComponent }]; }, propDecorators: { disabled: [{
|
|
4102
4038
|
type: Input
|
|
4039
|
+
}], itemClicked: [{
|
|
4040
|
+
type: Output
|
|
4103
4041
|
}], spaceKeyEvent: [{
|
|
4104
4042
|
type: HostListener,
|
|
4105
4043
|
args: ['window:keyup.space']
|
|
@@ -4108,7 +4046,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4108
4046
|
args: ['click', ['$event.target']]
|
|
4109
4047
|
}], enterKeyEvent: [{
|
|
4110
4048
|
type: HostListener,
|
|
4111
|
-
args: ['window:
|
|
4049
|
+
args: ['window:keyup.enter']
|
|
4112
4050
|
}] } });
|
|
4113
4051
|
class BaoDropdownMenuComponent {
|
|
4114
4052
|
constructor(cdr, renderer, elementRef) {
|
|
@@ -4186,6 +4124,9 @@ class BaoDropdownMenuComponent {
|
|
|
4186
4124
|
this.renderer.setAttribute(this.nativeElement, 'id', this.menuId);
|
|
4187
4125
|
this._menuPortal = new DomPortal(this._menuContent);
|
|
4188
4126
|
}
|
|
4127
|
+
ngAfterContentInit() {
|
|
4128
|
+
this._listItems.forEach((item) => item.itemClicked.subscribe(() => this.isClosedByKeyEvent.emit()));
|
|
4129
|
+
}
|
|
4189
4130
|
focusFirstItem() {
|
|
4190
4131
|
this._activeItemIndex = 0;
|
|
4191
4132
|
this._listItems.first.nativeElement.focus();
|
|
@@ -4306,8 +4247,9 @@ class BaoDropdownMenuTrigger {
|
|
|
4306
4247
|
}
|
|
4307
4248
|
/** Enter key event triggers click event which opens menu,
|
|
4308
4249
|
* then focus is put on first item in the menu */
|
|
4309
|
-
enterKeyEvent() {
|
|
4250
|
+
enterKeyEvent(event) {
|
|
4310
4251
|
if (this._isMenuOpen && document.activeElement === this.nativeElement) {
|
|
4252
|
+
event.stopImmediatePropagation();
|
|
4311
4253
|
this.menu.focusFirstItem();
|
|
4312
4254
|
}
|
|
4313
4255
|
}
|
|
@@ -4379,11 +4321,18 @@ class BaoDropdownMenuTrigger {
|
|
|
4379
4321
|
overlayY: 'bottom'
|
|
4380
4322
|
},
|
|
4381
4323
|
{
|
|
4382
|
-
// top-right of the overlay is connected to bottom-
|
|
4383
|
-
originX: '
|
|
4324
|
+
// top-right of the overlay is connected to bottom-right of the origin;
|
|
4325
|
+
originX: 'end',
|
|
4384
4326
|
originY: 'bottom',
|
|
4385
4327
|
overlayX: 'end',
|
|
4386
4328
|
overlayY: 'top'
|
|
4329
|
+
},
|
|
4330
|
+
{
|
|
4331
|
+
// bottom-right of the overlay is connected to top-right of the origin;
|
|
4332
|
+
originX: 'end',
|
|
4333
|
+
originY: 'top',
|
|
4334
|
+
overlayX: 'end',
|
|
4335
|
+
overlayY: 'bottom'
|
|
4387
4336
|
}
|
|
4388
4337
|
]),
|
|
4389
4338
|
backdropClass: 'bao-overlay-transparent-backdrop',
|
|
@@ -4393,7 +4342,7 @@ class BaoDropdownMenuTrigger {
|
|
|
4393
4342
|
}
|
|
4394
4343
|
}
|
|
4395
4344
|
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 });
|
|
4396
|
-
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 });
|
|
4345
|
+
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 });
|
|
4397
4346
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoDropdownMenuTrigger, decorators: [{
|
|
4398
4347
|
type: Directive,
|
|
4399
4348
|
args: [{
|
|
@@ -4408,7 +4357,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4408
4357
|
args: ['window:keyup.escape']
|
|
4409
4358
|
}], enterKeyEvent: [{
|
|
4410
4359
|
type: HostListener,
|
|
4411
|
-
args: ['window:keyup.enter']
|
|
4360
|
+
args: ['window:keyup.enter', ['$event']]
|
|
4412
4361
|
}], onClick: [{
|
|
4413
4362
|
type: HostListener,
|
|
4414
4363
|
args: ['click']
|
|
@@ -4618,12 +4567,12 @@ class BaoFilePreviewComponent {
|
|
|
4618
4567
|
}
|
|
4619
4568
|
}
|
|
4620
4569
|
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 });
|
|
4621
|
-
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
|
|
4570
|
+
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 });
|
|
4622
4571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFilePreviewComponent, decorators: [{
|
|
4623
4572
|
type: Component,
|
|
4624
4573
|
args: [{ selector: 'bao-file-preview, [bao-file-preview]', encapsulation: ViewEncapsulation.None, host: {
|
|
4625
4574
|
class: 'bao-file-preview'
|
|
4626
|
-
}, 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
|
|
4575
|
+
}, 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"] }]
|
|
4627
4576
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { file: [{
|
|
4628
4577
|
type: Input
|
|
4629
4578
|
}], isLoading: [{
|
|
@@ -4834,10 +4783,10 @@ class BaoFileInputComponent {
|
|
|
4834
4783
|
this.propagateTouched();
|
|
4835
4784
|
}
|
|
4836
4785
|
setDescribedByAttribute() {
|
|
4837
|
-
const helperText = Array.from(this.nativeElement.children).find((el) => el.localName === 'bao-guiding-text')
|
|
4786
|
+
const helperText = Array.from(this.nativeElement.children).find((el) => el.localName === 'bao-guiding-text');
|
|
4838
4787
|
if (helperText) {
|
|
4839
4788
|
this._helperTextId = `bao-guiding-text-${fileTextUniqueId++}`;
|
|
4840
|
-
this.renderer.setAttribute(helperText, 'id', this._helperTextId);
|
|
4789
|
+
this.renderer.setAttribute(helperText.firstElementChild, 'id', this._helperTextId);
|
|
4841
4790
|
const inputElement = Array.from(this.nativeElement.children)
|
|
4842
4791
|
.find((el) => el.className == 'file-drop-zone')
|
|
4843
4792
|
.children.item(1);
|
|
@@ -4869,7 +4818,7 @@ BaoFileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
4869
4818
|
useExisting: forwardRef(() => BaoFileInputComponent),
|
|
4870
4819
|
multi: true
|
|
4871
4820
|
}
|
|
4872
|
-
], 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 });
|
|
4821
|
+
], 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 });
|
|
4873
4822
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileInputComponent, decorators: [{
|
|
4874
4823
|
type: Component,
|
|
4875
4824
|
args: [{ selector: 'bao-file-input, [bao-file-input]', providers: [
|
|
@@ -4884,7 +4833,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4884
4833
|
'[class.bao-file-label-small]': 'size === "small"',
|
|
4885
4834
|
'[class.bao-file-label-medium]': 'size === "medium"',
|
|
4886
4835
|
'[class.bao-file-input-disabled]': 'disabled'
|
|
4887
|
-
}, 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"] }]
|
|
4836
|
+
}, 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"] }]
|
|
4888
4837
|
}], ctorParameters: function () { return [{ type: BaoFileIntl }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputId: [{
|
|
4889
4838
|
type: Input,
|
|
4890
4839
|
args: ['id']
|
|
@@ -5049,6 +4998,952 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5049
4998
|
}]
|
|
5050
4999
|
}] });
|
|
5051
5000
|
|
|
5001
|
+
/** Injection token that can be used to access the data that was passed in to a snack bar. */
|
|
5002
|
+
const BAO_SNACK_BAR_DATA = new InjectionToken('BaoSnackBarData');
|
|
5003
|
+
/**
|
|
5004
|
+
* Configuration used when opening a snack-bar.
|
|
5005
|
+
*/
|
|
5006
|
+
class BaoSnackBarConfig {
|
|
5007
|
+
constructor() {
|
|
5008
|
+
/** The message to display in the snackbar. */
|
|
5009
|
+
this.message = 'No message';
|
|
5010
|
+
/** The type of snackbar template to display. */
|
|
5011
|
+
this.toastType = 'info';
|
|
5012
|
+
/**
|
|
5013
|
+
* The attached action to the snack bar. If the name of the action matches an icon provided as part of
|
|
5014
|
+
* angular-ui icon dictionnary an icon will be displayed instead of text.
|
|
5015
|
+
* */
|
|
5016
|
+
this.actionLabelOrIcon = '';
|
|
5017
|
+
/** Displays the close button when set to true */
|
|
5018
|
+
this.showClose = false;
|
|
5019
|
+
/** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
|
|
5020
|
+
this.duration = 5000;
|
|
5021
|
+
/** The politeness level for the MatAriaLiveAnnouncer announcement. */
|
|
5022
|
+
this.politeness = 'assertive';
|
|
5023
|
+
/**
|
|
5024
|
+
* Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
|
|
5025
|
+
* component or template, the announcement message will default to the specified message.
|
|
5026
|
+
*/
|
|
5027
|
+
this.announcementMessage = '';
|
|
5028
|
+
/** Data being injected into the child component. */
|
|
5029
|
+
this.data = null;
|
|
5030
|
+
/** The horizontal position to place the snack bar. */
|
|
5031
|
+
this.horizontalPosition = 'left';
|
|
5032
|
+
/** The vertical position to place the snack bar. */
|
|
5033
|
+
this.verticalPosition = 'bottom';
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
|
|
5037
|
+
/** Maximum amount of milliseconds that can be passed into setTimeout. */
|
|
5038
|
+
const MAX_TIMEOUT = Math.pow(2, 31) - 1;
|
|
5039
|
+
/**
|
|
5040
|
+
* Reference to a snack bar dispatched from the snack bar service.
|
|
5041
|
+
*/
|
|
5042
|
+
class BaoSnackBarRef {
|
|
5043
|
+
constructor(containerInstance, _overlayRef) {
|
|
5044
|
+
this._overlayRef = _overlayRef;
|
|
5045
|
+
/** Subject for notifying the user that the snack bar has been dismissed. */
|
|
5046
|
+
this._afterDismissed = new Subject();
|
|
5047
|
+
/** Subject for notifying the user that the snack bar has opened and appeared. */
|
|
5048
|
+
this._afterOpened = new Subject();
|
|
5049
|
+
/** Subject for notifying the user that the snack bar action was called. */
|
|
5050
|
+
this._onAction = new Subject();
|
|
5051
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
5052
|
+
this._dismissedByAction = false;
|
|
5053
|
+
this.containerInstance = containerInstance;
|
|
5054
|
+
// Dismiss snackbar on action.
|
|
5055
|
+
this.onAction().subscribe(() => this.dismiss());
|
|
5056
|
+
containerInstance._onExit.subscribe(() => this.finishDismiss());
|
|
5057
|
+
}
|
|
5058
|
+
/** Dismisses the snack bar. */
|
|
5059
|
+
dismiss() {
|
|
5060
|
+
if (!this._afterDismissed.closed) {
|
|
5061
|
+
this.containerInstance.exit();
|
|
5062
|
+
}
|
|
5063
|
+
clearTimeout(this._durationTimeoutId);
|
|
5064
|
+
}
|
|
5065
|
+
/** Marks the snackbar action clicked. */
|
|
5066
|
+
dismissWithAction() {
|
|
5067
|
+
if (!this._onAction.closed) {
|
|
5068
|
+
this._dismissedByAction = true;
|
|
5069
|
+
this._onAction.next();
|
|
5070
|
+
this._onAction.complete();
|
|
5071
|
+
}
|
|
5072
|
+
}
|
|
5073
|
+
/** Dismisses the snack bar after some duration */
|
|
5074
|
+
dismissAfter(duration) {
|
|
5075
|
+
// Note that we need to cap the duration to the maximum value for setTimeout, because
|
|
5076
|
+
// it'll revert to 1 if somebody passes in something greater (e.g. `Infinity`). See #17234.
|
|
5077
|
+
// @TODO: window.setTimeout() ?
|
|
5078
|
+
this._durationTimeoutId = window.setTimeout(() => this.dismiss(), Math.min(duration, MAX_TIMEOUT));
|
|
5079
|
+
}
|
|
5080
|
+
/** Marks the snackbar as opened */
|
|
5081
|
+
open() {
|
|
5082
|
+
if (!this._afterOpened.closed) {
|
|
5083
|
+
this._afterOpened.next();
|
|
5084
|
+
this._afterOpened.complete();
|
|
5085
|
+
}
|
|
5086
|
+
}
|
|
5087
|
+
/** Gets an observable that is notified when the snack bar is finished closing. */
|
|
5088
|
+
afterDismissed() {
|
|
5089
|
+
return this._afterDismissed;
|
|
5090
|
+
}
|
|
5091
|
+
/** Gets an observable that is notified when the snack bar has opened and appeared. */
|
|
5092
|
+
afterOpened() {
|
|
5093
|
+
return this.containerInstance._onEnter;
|
|
5094
|
+
}
|
|
5095
|
+
/** Gets an observable that is notified when the snack bar action is called. */
|
|
5096
|
+
onAction() {
|
|
5097
|
+
return this._onAction;
|
|
5098
|
+
}
|
|
5099
|
+
/** Cleans up the DOM after closing. */
|
|
5100
|
+
finishDismiss() {
|
|
5101
|
+
this._overlayRef.dispose();
|
|
5102
|
+
if (!this._onAction.closed) {
|
|
5103
|
+
this._onAction.complete();
|
|
5104
|
+
}
|
|
5105
|
+
this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });
|
|
5106
|
+
this._afterDismissed.complete();
|
|
5107
|
+
this._dismissedByAction = false;
|
|
5108
|
+
}
|
|
5109
|
+
}
|
|
5110
|
+
|
|
5111
|
+
/*
|
|
5112
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5113
|
+
* Licensed under the MIT license.
|
|
5114
|
+
* See LICENSE file in the project root for full license information.
|
|
5115
|
+
*/
|
|
5116
|
+
const toastTypeToAttributes = {
|
|
5117
|
+
info: {
|
|
5118
|
+
toastClass: 'bao-snackbar-info',
|
|
5119
|
+
icon: 'icon-info',
|
|
5120
|
+
iconTitle: 'Information',
|
|
5121
|
+
politeness: 'assertive'
|
|
5122
|
+
},
|
|
5123
|
+
success: {
|
|
5124
|
+
toastClass: 'bao-snackbar-success',
|
|
5125
|
+
icon: 'icon-check-circle',
|
|
5126
|
+
iconTitle: 'Succès',
|
|
5127
|
+
politeness: 'polite'
|
|
5128
|
+
},
|
|
5129
|
+
danger: {
|
|
5130
|
+
toastClass: 'bao-snackbar-danger',
|
|
5131
|
+
icon: 'icon-error',
|
|
5132
|
+
iconTitle: 'Erreur',
|
|
5133
|
+
politeness: 'assertive'
|
|
5134
|
+
}
|
|
5135
|
+
};
|
|
5136
|
+
/**
|
|
5137
|
+
* A component used to open as the default snack bar, matching material spec.
|
|
5138
|
+
* This should only be used internally by the snack bar service.
|
|
5139
|
+
*/
|
|
5140
|
+
class BaoSimpleSnackBarComponent {
|
|
5141
|
+
constructor(snackBarRef, data) {
|
|
5142
|
+
this.snackBarRef = snackBarRef;
|
|
5143
|
+
this.showCloseTitle = 'Fermer le message';
|
|
5144
|
+
this.data = data;
|
|
5145
|
+
}
|
|
5146
|
+
/** Returns the politeness */
|
|
5147
|
+
get politeness() {
|
|
5148
|
+
var _a;
|
|
5149
|
+
return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.politeness) ||
|
|
5150
|
+
toastTypeToAttributes['info'].politeness);
|
|
5151
|
+
}
|
|
5152
|
+
/** Returns the toast class */
|
|
5153
|
+
get toastClass() {
|
|
5154
|
+
var _a;
|
|
5155
|
+
return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.toastClass) ||
|
|
5156
|
+
toastTypeToAttributes['info'].toastClass);
|
|
5157
|
+
}
|
|
5158
|
+
/** Returns the toast icon */
|
|
5159
|
+
get toastIcon() {
|
|
5160
|
+
var _a;
|
|
5161
|
+
return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.icon) ||
|
|
5162
|
+
toastTypeToAttributes['info'].icon);
|
|
5163
|
+
}
|
|
5164
|
+
/** Returns the toast icon title */
|
|
5165
|
+
get toastIconTitle() {
|
|
5166
|
+
var _a;
|
|
5167
|
+
return (((_a = toastTypeToAttributes[this.data.toastType]) === null || _a === void 0 ? void 0 : _a.iconTitle) ||
|
|
5168
|
+
toastTypeToAttributes['info'].iconTitle);
|
|
5169
|
+
}
|
|
5170
|
+
/** If the action button should be shown. */
|
|
5171
|
+
get hasAction() {
|
|
5172
|
+
return !!this.data.actionLabelOrIcon;
|
|
5173
|
+
}
|
|
5174
|
+
/** If the action is an icon */
|
|
5175
|
+
get isActionIcon() {
|
|
5176
|
+
return !!ICONS_DCT[this.data.actionLabelOrIcon];
|
|
5177
|
+
}
|
|
5178
|
+
/** Performs the action on the snack bar. */
|
|
5179
|
+
action() {
|
|
5180
|
+
this.snackBarRef.dismissWithAction();
|
|
5181
|
+
}
|
|
5182
|
+
/** Closes the snack bar. */
|
|
5183
|
+
close() {
|
|
5184
|
+
this.snackBarRef.dismiss();
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
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 });
|
|
5188
|
+
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 });
|
|
5189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSimpleSnackBarComponent, decorators: [{
|
|
5190
|
+
type: Component,
|
|
5191
|
+
args: [{ selector: 'bao-simple-snack-bar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5192
|
+
class: 'bao-simple-snackbar'
|
|
5193
|
+
}, 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"] }]
|
|
5194
|
+
}], ctorParameters: function () {
|
|
5195
|
+
return [{ type: BaoSnackBarRef }, { type: undefined, decorators: [{
|
|
5196
|
+
type: Inject,
|
|
5197
|
+
args: [BAO_SNACK_BAR_DATA]
|
|
5198
|
+
}] }];
|
|
5199
|
+
} });
|
|
5200
|
+
|
|
5201
|
+
/*
|
|
5202
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5203
|
+
* Licensed under the MIT license.
|
|
5204
|
+
* See LICENSE file in the project root for full license information.
|
|
5205
|
+
*/
|
|
5206
|
+
/**
|
|
5207
|
+
* Animations used by the Material snack bar.
|
|
5208
|
+
* @docs-private
|
|
5209
|
+
*/
|
|
5210
|
+
const matSnackBarAnimations = {
|
|
5211
|
+
/** Animation that shows and hides a snack bar. */
|
|
5212
|
+
snackBarState: trigger('state', [
|
|
5213
|
+
state('void, hidden', style({
|
|
5214
|
+
transform: 'scale(0.8)',
|
|
5215
|
+
opacity: 0
|
|
5216
|
+
})),
|
|
5217
|
+
state('visible', style({
|
|
5218
|
+
transform: 'scale(1)',
|
|
5219
|
+
opacity: 1
|
|
5220
|
+
})),
|
|
5221
|
+
transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
|
|
5222
|
+
transition('* => void, * => hidden', animate('75ms cubic-bezier(0.4, 0.0, 1, 1)', style({
|
|
5223
|
+
opacity: 0
|
|
5224
|
+
})))
|
|
5225
|
+
])
|
|
5226
|
+
};
|
|
5227
|
+
|
|
5228
|
+
let uniqueId = 0;
|
|
5229
|
+
/**
|
|
5230
|
+
* Internal component that wraps user-provided snack bar content.
|
|
5231
|
+
* @docs-private
|
|
5232
|
+
*/
|
|
5233
|
+
class BaoSnackBarContainerComponent extends BasePortalOutlet {
|
|
5234
|
+
constructor(_ngZone, _elementRef, _changeDetectorRef, _platform,
|
|
5235
|
+
/** The snack bar configuration. */
|
|
5236
|
+
snackBarConfig) {
|
|
5237
|
+
super();
|
|
5238
|
+
this._ngZone = _ngZone;
|
|
5239
|
+
this._elementRef = _elementRef;
|
|
5240
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
5241
|
+
this._platform = _platform;
|
|
5242
|
+
this.snackBarConfig = snackBarConfig;
|
|
5243
|
+
this._document = inject(DOCUMENT);
|
|
5244
|
+
this._trackedModals = new Set();
|
|
5245
|
+
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
5246
|
+
this._onAnnounce = new Subject();
|
|
5247
|
+
/** Subject for notifying that the snack bar has exited from view. */
|
|
5248
|
+
this._onExit = new Subject();
|
|
5249
|
+
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
5250
|
+
this._onEnter = new Subject();
|
|
5251
|
+
/** The state of the snack bar animations. */
|
|
5252
|
+
this._animationState = 'void';
|
|
5253
|
+
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
5254
|
+
this._announceDelay = 150;
|
|
5255
|
+
/** Whether the component has been destroyed. */
|
|
5256
|
+
this._destroyed = false;
|
|
5257
|
+
/** Unique ID of the aria-live element. */
|
|
5258
|
+
this._liveElementId = `bao-snack-bar-container-live-${uniqueId++}`;
|
|
5259
|
+
/**
|
|
5260
|
+
* Attaches a DOM portal to the snack bar container.
|
|
5261
|
+
* @deprecated To be turned into a method.
|
|
5262
|
+
* @breaking-change 10.0.0
|
|
5263
|
+
*/
|
|
5264
|
+
this.attachDomPortal = (portal) => {
|
|
5265
|
+
this.assertNotAttached();
|
|
5266
|
+
const result = this._portalOutlet.attachDomPortal(portal);
|
|
5267
|
+
this._afterPortalAttached();
|
|
5268
|
+
return result;
|
|
5269
|
+
};
|
|
5270
|
+
// Use aria-live rather than a live role like 'alert' or 'status'
|
|
5271
|
+
// because NVDA and JAWS have show inconsistent behavior with live roles.
|
|
5272
|
+
if (snackBarConfig.politeness === 'assertive' &&
|
|
5273
|
+
!snackBarConfig.announcementMessage) {
|
|
5274
|
+
this._live = 'assertive';
|
|
5275
|
+
}
|
|
5276
|
+
else if (snackBarConfig.politeness === 'off') {
|
|
5277
|
+
this._live = 'off';
|
|
5278
|
+
}
|
|
5279
|
+
else {
|
|
5280
|
+
this._live = 'polite';
|
|
5281
|
+
}
|
|
5282
|
+
// Only set role for Firefox. Set role based on aria-live because setting role="alert" implies
|
|
5283
|
+
// aria-live="assertive" which may cause issues if aria-live is set to "polite" above.
|
|
5284
|
+
if (this._platform.FIREFOX) {
|
|
5285
|
+
if (this._live === 'polite') {
|
|
5286
|
+
this._role = 'status';
|
|
5287
|
+
}
|
|
5288
|
+
if (this._live === 'assertive') {
|
|
5289
|
+
this._role = 'alert';
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5292
|
+
}
|
|
5293
|
+
/** Attach a component portal as content to this snack bar container. */
|
|
5294
|
+
attachComponentPortal(portal) {
|
|
5295
|
+
this.assertNotAttached();
|
|
5296
|
+
this.applySnackBarClasses();
|
|
5297
|
+
const result = this._portalOutlet.attachComponentPortal(portal);
|
|
5298
|
+
this._afterPortalAttached();
|
|
5299
|
+
return result;
|
|
5300
|
+
}
|
|
5301
|
+
/** Attach a template portal as content to this snack bar container. */
|
|
5302
|
+
attachTemplatePortal(portal) {
|
|
5303
|
+
this.assertNotAttached();
|
|
5304
|
+
this.applySnackBarClasses();
|
|
5305
|
+
const result = this._portalOutlet.attachTemplatePortal(portal);
|
|
5306
|
+
this._afterPortalAttached();
|
|
5307
|
+
return result;
|
|
5308
|
+
}
|
|
5309
|
+
/** Handle end of animations, updating the state of the snackbar. */
|
|
5310
|
+
onAnimationEnd(event) {
|
|
5311
|
+
const { fromState, toState } = event;
|
|
5312
|
+
if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {
|
|
5313
|
+
this.completeExit();
|
|
5314
|
+
}
|
|
5315
|
+
if (toState === 'visible') {
|
|
5316
|
+
// Note: we shouldn't use `this` inside the zone callback,
|
|
5317
|
+
// because it can cause a memory leak.
|
|
5318
|
+
const onEnter = this._onEnter;
|
|
5319
|
+
this._ngZone.run(() => {
|
|
5320
|
+
onEnter.next();
|
|
5321
|
+
onEnter.complete();
|
|
5322
|
+
});
|
|
5323
|
+
}
|
|
5324
|
+
}
|
|
5325
|
+
/** Begin animation of snack bar entrance into view. */
|
|
5326
|
+
enter() {
|
|
5327
|
+
if (!this._destroyed) {
|
|
5328
|
+
this._animationState = 'visible';
|
|
5329
|
+
this._changeDetectorRef.detectChanges();
|
|
5330
|
+
this.screenReaderAnnounce();
|
|
5331
|
+
}
|
|
5332
|
+
}
|
|
5333
|
+
/** Begin animation of the snack bar exiting from view. */
|
|
5334
|
+
exit() {
|
|
5335
|
+
// Note: this one transitions to `hidden`, rather than `void`, in order to handle the case
|
|
5336
|
+
// where multiple snack bars are opened in quick succession (e.g. two consecutive calls to
|
|
5337
|
+
// `MatSnackBar.open`).
|
|
5338
|
+
this._animationState = 'hidden';
|
|
5339
|
+
// Mark this element with an 'exit' attribute to indicate that the snackbar has
|
|
5340
|
+
// been dismissed and will soon be removed from the DOM. This is used by the snackbar
|
|
5341
|
+
// test harness.
|
|
5342
|
+
this._elementRef.nativeElement.setAttribute('mat-exit', '');
|
|
5343
|
+
// If the snack bar hasn't been announced by the time it exits it wouldn't have been open
|
|
5344
|
+
// long enough to visually read it either, so clear the timeout for announcing.
|
|
5345
|
+
clearTimeout(this._announceTimeoutId);
|
|
5346
|
+
return this._onExit;
|
|
5347
|
+
}
|
|
5348
|
+
/** Makes sure the exit callbacks have been invoked when the element is destroyed. */
|
|
5349
|
+
ngOnDestroy() {
|
|
5350
|
+
this._destroyed = true;
|
|
5351
|
+
this.completeExit();
|
|
5352
|
+
}
|
|
5353
|
+
/**
|
|
5354
|
+
* Waits for the zone to settle before removing the element. Helps prevent
|
|
5355
|
+
* errors where we end up removing an element which is in the middle of an animation.
|
|
5356
|
+
*/
|
|
5357
|
+
completeExit() {
|
|
5358
|
+
this._ngZone.onMicrotaskEmpty.pipe(take$1(1)).subscribe(() => {
|
|
5359
|
+
this._onExit.next();
|
|
5360
|
+
this._onExit.complete();
|
|
5361
|
+
});
|
|
5362
|
+
}
|
|
5363
|
+
/** Applies the various positioning and user-configured CSS classes to the snack bar. */
|
|
5364
|
+
applySnackBarClasses() {
|
|
5365
|
+
const element = this._elementRef.nativeElement;
|
|
5366
|
+
const panelClasses = this.snackBarConfig.panelClass;
|
|
5367
|
+
if (panelClasses) {
|
|
5368
|
+
if (Array.isArray(panelClasses)) {
|
|
5369
|
+
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
|
|
5370
|
+
panelClasses.forEach(cssClass => element.classList.add(cssClass));
|
|
5371
|
+
}
|
|
5372
|
+
else {
|
|
5373
|
+
element.classList.add(panelClasses);
|
|
5374
|
+
}
|
|
5375
|
+
}
|
|
5376
|
+
if (this.snackBarConfig.horizontalPosition === 'center') {
|
|
5377
|
+
element.classList.add('bao-snack-bar-center');
|
|
5378
|
+
}
|
|
5379
|
+
if (this.snackBarConfig.verticalPosition === 'top') {
|
|
5380
|
+
element.classList.add('bao-snack-bar-top');
|
|
5381
|
+
}
|
|
5382
|
+
}
|
|
5383
|
+
/**
|
|
5384
|
+
* Called after the portal contents have been attached. Can be
|
|
5385
|
+
* used to modify the DOM once it's guaranteed to be in place.
|
|
5386
|
+
*/
|
|
5387
|
+
_afterPortalAttached() {
|
|
5388
|
+
const element = this._elementRef.nativeElement;
|
|
5389
|
+
const panelClasses = this.snackBarConfig.panelClass;
|
|
5390
|
+
if (panelClasses) {
|
|
5391
|
+
if (Array.isArray(panelClasses)) {
|
|
5392
|
+
// Note that we can't use a spread here, because IE doesn't support multiple arguments.
|
|
5393
|
+
panelClasses.forEach(cssClass => element.classList.add(cssClass));
|
|
5394
|
+
}
|
|
5395
|
+
else {
|
|
5396
|
+
element.classList.add(panelClasses);
|
|
5397
|
+
}
|
|
5398
|
+
}
|
|
5399
|
+
this._exposeToModals();
|
|
5400
|
+
}
|
|
5401
|
+
/**
|
|
5402
|
+
* Some browsers won't expose the accessibility node of the live element if there is an
|
|
5403
|
+
* `aria-modal` and the live element is outside of it. This method works around the issue by
|
|
5404
|
+
* pointing the `aria-owns` of all modals to the live element.
|
|
5405
|
+
*/
|
|
5406
|
+
_exposeToModals() {
|
|
5407
|
+
// Note that the selector here is limited to CDK overlays at the moment in order to reduce the
|
|
5408
|
+
// section of the DOM we need to look through. This should cover all the cases we support, but
|
|
5409
|
+
// the selector can be expanded if it turns out to be too narrow.
|
|
5410
|
+
const id = this._liveElementId;
|
|
5411
|
+
const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');
|
|
5412
|
+
for (let i = 0; i < modals.length; i++) {
|
|
5413
|
+
const modal = modals[i];
|
|
5414
|
+
const ariaOwns = modal.getAttribute('aria-owns');
|
|
5415
|
+
this._trackedModals.add(modal);
|
|
5416
|
+
if (!ariaOwns) {
|
|
5417
|
+
modal.setAttribute('aria-owns', id);
|
|
5418
|
+
}
|
|
5419
|
+
else if (ariaOwns.indexOf(id) === -1) {
|
|
5420
|
+
modal.setAttribute('aria-owns', ariaOwns + ' ' + id);
|
|
5421
|
+
}
|
|
5422
|
+
}
|
|
5423
|
+
}
|
|
5424
|
+
/** Clears the references to the live element from any modals it was added to. */
|
|
5425
|
+
_clearFromModals() {
|
|
5426
|
+
this._trackedModals.forEach(modal => {
|
|
5427
|
+
const ariaOwns = modal.getAttribute('aria-owns');
|
|
5428
|
+
if (ariaOwns) {
|
|
5429
|
+
const newValue = ariaOwns.replace(this._liveElementId, '').trim();
|
|
5430
|
+
if (newValue.length > 0) {
|
|
5431
|
+
modal.setAttribute('aria-owns', newValue);
|
|
5432
|
+
}
|
|
5433
|
+
else {
|
|
5434
|
+
modal.removeAttribute('aria-owns');
|
|
5435
|
+
}
|
|
5436
|
+
}
|
|
5437
|
+
});
|
|
5438
|
+
this._trackedModals.clear();
|
|
5439
|
+
}
|
|
5440
|
+
/** Asserts that no content is already attached to the container. */
|
|
5441
|
+
assertNotAttached() {
|
|
5442
|
+
if (this._portalOutlet.hasAttached()) {
|
|
5443
|
+
throw Error('Attempting to attach snack bar content after content is already attached');
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
/**
|
|
5447
|
+
* Starts a timeout to move the snack bar content to the live region so screen readers will
|
|
5448
|
+
* announce it.
|
|
5449
|
+
*/
|
|
5450
|
+
screenReaderAnnounce() {
|
|
5451
|
+
if (!this._announceTimeoutId) {
|
|
5452
|
+
this._ngZone.runOutsideAngular(() => {
|
|
5453
|
+
this._announceTimeoutId = window.setTimeout(() => {
|
|
5454
|
+
const inertElement = this._elementRef.nativeElement.querySelector('[aria-hidden]');
|
|
5455
|
+
const liveElement = this._elementRef.nativeElement.querySelector('[aria-live]');
|
|
5456
|
+
if (inertElement && liveElement) {
|
|
5457
|
+
// If an element in the snack bar content is focused before being moved
|
|
5458
|
+
// track it and restore focus after moving to the live region.
|
|
5459
|
+
let focusedElement = null;
|
|
5460
|
+
if (this._platform.isBrowser &&
|
|
5461
|
+
document.activeElement instanceof HTMLElement &&
|
|
5462
|
+
inertElement.contains(document.activeElement)) {
|
|
5463
|
+
focusedElement = document.activeElement;
|
|
5464
|
+
}
|
|
5465
|
+
inertElement.removeAttribute('aria-hidden');
|
|
5466
|
+
liveElement.appendChild(inertElement);
|
|
5467
|
+
focusedElement === null || focusedElement === void 0 ? void 0 : focusedElement.focus();
|
|
5468
|
+
this._onAnnounce.next();
|
|
5469
|
+
this._onAnnounce.complete();
|
|
5470
|
+
}
|
|
5471
|
+
}, this._announceDelay);
|
|
5472
|
+
});
|
|
5473
|
+
}
|
|
5474
|
+
}
|
|
5475
|
+
}
|
|
5476
|
+
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 });
|
|
5477
|
+
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 });
|
|
5478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarContainerComponent, decorators: [{
|
|
5479
|
+
type: Component,
|
|
5480
|
+
args: [{ selector: 'bao-snack-bar-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, animations: [matSnackBarAnimations.snackBarState], host: {
|
|
5481
|
+
class: 'bao-snack-bar-container',
|
|
5482
|
+
'[@state]': '_animationState',
|
|
5483
|
+
'(@state.done)': 'onAnimationEnd($event)'
|
|
5484
|
+
}, 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"] }]
|
|
5485
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$5.Platform }, { type: BaoSnackBarConfig }]; }, propDecorators: { _portalOutlet: [{
|
|
5486
|
+
type: ViewChild,
|
|
5487
|
+
args: [CdkPortalOutlet, { static: true }]
|
|
5488
|
+
}] } });
|
|
5489
|
+
|
|
5490
|
+
function baoFactory() {
|
|
5491
|
+
return new BaoSnackBarConfig();
|
|
5492
|
+
}
|
|
5493
|
+
/** Injection token that can be used to specify default snack bar. */
|
|
5494
|
+
const BAO_SNACK_BAR_DEFAULT_OPTIONS = new InjectionToken('bao-snack-bar-default-options', {
|
|
5495
|
+
providedIn: 'root',
|
|
5496
|
+
factory: baoFactory
|
|
5497
|
+
});
|
|
5498
|
+
/**
|
|
5499
|
+
* Service to dispatch Material Design snack bar messages.
|
|
5500
|
+
*/
|
|
5501
|
+
class BaoSnackBarService {
|
|
5502
|
+
constructor(_overlay, _live, _injector, _parentSnackBar, _defaultConfig) {
|
|
5503
|
+
this._overlay = _overlay;
|
|
5504
|
+
this._live = _live;
|
|
5505
|
+
this._injector = _injector;
|
|
5506
|
+
this._parentSnackBar = _parentSnackBar;
|
|
5507
|
+
this._defaultConfig = _defaultConfig;
|
|
5508
|
+
/** The component that should be rendered as the snack bar's simple component. */
|
|
5509
|
+
this.simpleSnackBarComponent = BaoSimpleSnackBarComponent;
|
|
5510
|
+
/** The container component that attaches the provided template or component. */
|
|
5511
|
+
this.snackBarContainerComponent = BaoSnackBarContainerComponent;
|
|
5512
|
+
/**
|
|
5513
|
+
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
5514
|
+
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
5515
|
+
* via `_openedSnackBarRef`.
|
|
5516
|
+
*/
|
|
5517
|
+
this._snackBarRefAtThisLevel = null;
|
|
5518
|
+
}
|
|
5519
|
+
/** Reference to the currently opened snackbar at *any* level. */
|
|
5520
|
+
get _openedSnackBarRef() {
|
|
5521
|
+
const parent = this._parentSnackBar;
|
|
5522
|
+
return parent ? parent._openedSnackBarRef : this._snackBarRefAtThisLevel;
|
|
5523
|
+
}
|
|
5524
|
+
set _openedSnackBarRef(value) {
|
|
5525
|
+
if (this._parentSnackBar) {
|
|
5526
|
+
this._parentSnackBar._openedSnackBarRef = value;
|
|
5527
|
+
}
|
|
5528
|
+
else {
|
|
5529
|
+
this._snackBarRefAtThisLevel = value;
|
|
5530
|
+
}
|
|
5531
|
+
}
|
|
5532
|
+
/**
|
|
5533
|
+
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
5534
|
+
* currently opened snack bars.
|
|
5535
|
+
*
|
|
5536
|
+
* @param component Component to be instantiated.
|
|
5537
|
+
* @param config Extra configuration for the snack bar.
|
|
5538
|
+
*/
|
|
5539
|
+
openFromComponent(component, config) {
|
|
5540
|
+
return this.attach(component, config);
|
|
5541
|
+
}
|
|
5542
|
+
/**
|
|
5543
|
+
* Creates and dispatches a snack bar with a custom template for the content, removing any
|
|
5544
|
+
* currently opened snack bars.
|
|
5545
|
+
*
|
|
5546
|
+
* @param template Template to be instantiated.
|
|
5547
|
+
* @param config Extra configuration for the snack bar.
|
|
5548
|
+
*/
|
|
5549
|
+
openFromTemplate(template, config) {
|
|
5550
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
5551
|
+
return this.attach(template, config);
|
|
5552
|
+
}
|
|
5553
|
+
/**
|
|
5554
|
+
* Opens a snackbar with a message and an optional action.
|
|
5555
|
+
* @param message The message to show in the snackbar.
|
|
5556
|
+
* @param toastType The type of of toast to display the snackbar.
|
|
5557
|
+
* @param actionLabelOrIcon The label or icon for the snackbar action.
|
|
5558
|
+
* @param showClose If true, the snackbar will require user interaction to close.
|
|
5559
|
+
* @param config Additional configuration options for the snackbar.
|
|
5560
|
+
*/
|
|
5561
|
+
open(config) {
|
|
5562
|
+
const _config = Object.assign(Object.assign({}, this._defaultConfig), config);
|
|
5563
|
+
// Since the user doesn't have access to the component, we can
|
|
5564
|
+
// override the data to pass in our own message, action and type.
|
|
5565
|
+
_config.data = {
|
|
5566
|
+
message: _config.message,
|
|
5567
|
+
toastType: _config.toastType,
|
|
5568
|
+
actionLabelOrIcon: _config.actionLabelOrIcon,
|
|
5569
|
+
showClose: _config.showClose
|
|
5570
|
+
};
|
|
5571
|
+
if (_config.showClose)
|
|
5572
|
+
_config.duration = 0;
|
|
5573
|
+
if (!_config.announcementMessage) {
|
|
5574
|
+
_config.announcementMessage = _config.message;
|
|
5575
|
+
}
|
|
5576
|
+
return this.openFromComponent(this.simpleSnackBarComponent, _config);
|
|
5577
|
+
}
|
|
5578
|
+
/**
|
|
5579
|
+
* Dismisses the currently-visible snack bar.
|
|
5580
|
+
*/
|
|
5581
|
+
dismiss() {
|
|
5582
|
+
if (this._openedSnackBarRef) {
|
|
5583
|
+
this._openedSnackBarRef.dismiss();
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
ngOnDestroy() {
|
|
5587
|
+
// Only dismiss the snack bar at the current level on destroy.
|
|
5588
|
+
if (this._snackBarRefAtThisLevel) {
|
|
5589
|
+
this._snackBarRefAtThisLevel.dismiss();
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
/**
|
|
5593
|
+
* Attaches the snack bar container component to the overlay.
|
|
5594
|
+
*/
|
|
5595
|
+
attachSnackBarContainer(overlayRef, config) {
|
|
5596
|
+
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
5597
|
+
const injector = new PortalInjector(userInjector || this._injector, new WeakMap([[BaoSnackBarConfig, config]]));
|
|
5598
|
+
const containerPortal = new ComponentPortal(this.snackBarContainerComponent, config.viewContainerRef, injector);
|
|
5599
|
+
const containerRef = overlayRef.attach(containerPortal);
|
|
5600
|
+
containerRef.instance.snackBarConfig = config;
|
|
5601
|
+
return containerRef.instance;
|
|
5602
|
+
}
|
|
5603
|
+
/**
|
|
5604
|
+
* Places a new component or a template as the content of the snack bar container.
|
|
5605
|
+
*/
|
|
5606
|
+
attach(content, userConfig) {
|
|
5607
|
+
const config = Object.assign(Object.assign(Object.assign({}, new BaoSnackBarConfig()), this._defaultConfig), userConfig);
|
|
5608
|
+
const overlayRef = this.createOverlay(config);
|
|
5609
|
+
const container = this.attachSnackBarContainer(overlayRef, config);
|
|
5610
|
+
const snackBarRef = new BaoSnackBarRef(container, overlayRef);
|
|
5611
|
+
if (content instanceof TemplateRef) {
|
|
5612
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5613
|
+
const portal = new TemplatePortal(content, null, {
|
|
5614
|
+
$implicit: config.data,
|
|
5615
|
+
snackBarRef
|
|
5616
|
+
});
|
|
5617
|
+
snackBarRef.instance = container.attachTemplatePortal(portal);
|
|
5618
|
+
}
|
|
5619
|
+
else {
|
|
5620
|
+
const injector = this.createInjector(config, snackBarRef);
|
|
5621
|
+
const portal = new ComponentPortal(content, undefined, injector);
|
|
5622
|
+
const contentRef = container.attachComponentPortal(portal);
|
|
5623
|
+
// We can't pass this via the injector, because the injector is created earlier.
|
|
5624
|
+
snackBarRef.instance = contentRef.instance;
|
|
5625
|
+
}
|
|
5626
|
+
this.animateSnackBar(snackBarRef, config);
|
|
5627
|
+
this._openedSnackBarRef = snackBarRef;
|
|
5628
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
5629
|
+
return this._openedSnackBarRef;
|
|
5630
|
+
}
|
|
5631
|
+
/** Animates the old snack bar out and the new one in. */
|
|
5632
|
+
animateSnackBar(snackBarRef, config) {
|
|
5633
|
+
// When the snackbar is dismissed, clear the reference to it.
|
|
5634
|
+
snackBarRef.afterDismissed().subscribe(() => {
|
|
5635
|
+
// Clear the snackbar ref if it hasn't already been replaced by a newer snackbar.
|
|
5636
|
+
// eslint-disable-next-line eqeqeq
|
|
5637
|
+
if (this._openedSnackBarRef == snackBarRef) {
|
|
5638
|
+
this._openedSnackBarRef = null;
|
|
5639
|
+
}
|
|
5640
|
+
if (config.announcementMessage) {
|
|
5641
|
+
this._live.clear();
|
|
5642
|
+
}
|
|
5643
|
+
});
|
|
5644
|
+
if (this._openedSnackBarRef) {
|
|
5645
|
+
// If a snack bar is already in view, dismiss it and enter the
|
|
5646
|
+
// new snack bar after exit animation is complete.
|
|
5647
|
+
this._openedSnackBarRef.afterDismissed().subscribe(() => {
|
|
5648
|
+
snackBarRef.containerInstance.enter();
|
|
5649
|
+
});
|
|
5650
|
+
this._openedSnackBarRef.dismiss();
|
|
5651
|
+
}
|
|
5652
|
+
else {
|
|
5653
|
+
// If no snack bar is in view, enter the new snack bar.
|
|
5654
|
+
snackBarRef.containerInstance.enter();
|
|
5655
|
+
}
|
|
5656
|
+
// If a dismiss timeout is provided, set up dismiss based on after the snackbar is opened.
|
|
5657
|
+
if (config.duration && config.duration > 0) {
|
|
5658
|
+
snackBarRef
|
|
5659
|
+
.afterOpened()
|
|
5660
|
+
.subscribe(() => snackBarRef.dismissAfter(config.duration));
|
|
5661
|
+
}
|
|
5662
|
+
if (config.announcementMessage) {
|
|
5663
|
+
void this._live.announce(config.announcementMessage, config.politeness);
|
|
5664
|
+
}
|
|
5665
|
+
}
|
|
5666
|
+
/**
|
|
5667
|
+
* Creates a new overlay and places it in the correct location.
|
|
5668
|
+
* @param config The user-specified snack bar config.
|
|
5669
|
+
*/
|
|
5670
|
+
createOverlay(config) {
|
|
5671
|
+
const overlayConfig = new OverlayConfig();
|
|
5672
|
+
overlayConfig.direction = config.direction;
|
|
5673
|
+
const positionStrategy = this._overlay.position().global();
|
|
5674
|
+
// Set horizontal position.
|
|
5675
|
+
const isRtl = config.direction === 'rtl';
|
|
5676
|
+
const isLeft = config.horizontalPosition === 'left' ||
|
|
5677
|
+
(config.horizontalPosition === 'start' && !isRtl) ||
|
|
5678
|
+
(config.horizontalPosition === 'end' && isRtl);
|
|
5679
|
+
const isRight = !isLeft && config.horizontalPosition !== 'center';
|
|
5680
|
+
if (isLeft) {
|
|
5681
|
+
positionStrategy.left('0');
|
|
5682
|
+
}
|
|
5683
|
+
else if (isRight) {
|
|
5684
|
+
positionStrategy.right('0');
|
|
5685
|
+
}
|
|
5686
|
+
else {
|
|
5687
|
+
positionStrategy.centerHorizontally();
|
|
5688
|
+
}
|
|
5689
|
+
// Set horizontal position.
|
|
5690
|
+
if (config.verticalPosition === 'top') {
|
|
5691
|
+
positionStrategy.top('0');
|
|
5692
|
+
}
|
|
5693
|
+
else {
|
|
5694
|
+
positionStrategy.bottom('0');
|
|
5695
|
+
}
|
|
5696
|
+
overlayConfig.positionStrategy = positionStrategy;
|
|
5697
|
+
return this._overlay.create(overlayConfig);
|
|
5698
|
+
}
|
|
5699
|
+
/**
|
|
5700
|
+
* Creates an injector to be used inside of a snack bar component.
|
|
5701
|
+
* @param config Config that was used to create the snack bar.
|
|
5702
|
+
* @param snackBarRef Reference to the snack bar.
|
|
5703
|
+
*/
|
|
5704
|
+
createInjector(config, snackBarRef) {
|
|
5705
|
+
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
5706
|
+
return new PortalInjector(userInjector || this._injector, new WeakMap([
|
|
5707
|
+
[BaoSnackBarRef, snackBarRef],
|
|
5708
|
+
[BAO_SNACK_BAR_DATA, config.data]
|
|
5709
|
+
]));
|
|
5710
|
+
}
|
|
5711
|
+
}
|
|
5712
|
+
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 });
|
|
5713
|
+
BaoSnackBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarService, providedIn: 'root' });
|
|
5714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarService, decorators: [{
|
|
5715
|
+
type: Injectable,
|
|
5716
|
+
args: [{ providedIn: 'root' }]
|
|
5717
|
+
}], ctorParameters: function () {
|
|
5718
|
+
return [{ type: i1$4.Overlay }, { type: i1$3.LiveAnnouncer }, { type: i0.Injector }, { type: BaoSnackBarService, decorators: [{
|
|
5719
|
+
type: Optional
|
|
5720
|
+
}, {
|
|
5721
|
+
type: SkipSelf
|
|
5722
|
+
}] }, { type: BaoSnackBarConfig, decorators: [{
|
|
5723
|
+
type: Inject,
|
|
5724
|
+
args: [BAO_SNACK_BAR_DEFAULT_OPTIONS]
|
|
5725
|
+
}] }];
|
|
5726
|
+
} });
|
|
5727
|
+
|
|
5728
|
+
/*
|
|
5729
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5730
|
+
* Licensed under the MIT license.
|
|
5731
|
+
* See LICENSE file in the project root for full license information.
|
|
5732
|
+
*/
|
|
5733
|
+
const SNACKBAR_DIRECTIVES = [
|
|
5734
|
+
BaoSimpleSnackBarComponent,
|
|
5735
|
+
BaoSnackBarContainerComponent
|
|
5736
|
+
];
|
|
5737
|
+
class BaoSnackBarModule {
|
|
5738
|
+
}
|
|
5739
|
+
BaoSnackBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5740
|
+
BaoSnackBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, declarations: [BaoSimpleSnackBarComponent,
|
|
5741
|
+
BaoSnackBarContainerComponent], imports: [CommonModule,
|
|
5742
|
+
OverlayModule,
|
|
5743
|
+
PortalModule,
|
|
5744
|
+
BaoButtonModule,
|
|
5745
|
+
BaoIconModule], exports: [BaoSimpleSnackBarComponent,
|
|
5746
|
+
BaoSnackBarContainerComponent] });
|
|
5747
|
+
BaoSnackBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, providers: [BaoSnackBarService, BaoSnackBarConfig], imports: [[
|
|
5748
|
+
CommonModule,
|
|
5749
|
+
OverlayModule,
|
|
5750
|
+
PortalModule,
|
|
5751
|
+
BaoButtonModule,
|
|
5752
|
+
BaoIconModule
|
|
5753
|
+
]] });
|
|
5754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSnackBarModule, decorators: [{
|
|
5755
|
+
type: NgModule,
|
|
5756
|
+
args: [{
|
|
5757
|
+
imports: [
|
|
5758
|
+
CommonModule,
|
|
5759
|
+
OverlayModule,
|
|
5760
|
+
PortalModule,
|
|
5761
|
+
BaoButtonModule,
|
|
5762
|
+
BaoIconModule
|
|
5763
|
+
],
|
|
5764
|
+
providers: [BaoSnackBarService, BaoSnackBarConfig],
|
|
5765
|
+
declarations: SNACKBAR_DIRECTIVES,
|
|
5766
|
+
exports: SNACKBAR_DIRECTIVES,
|
|
5767
|
+
entryComponents: [SNACKBAR_DIRECTIVES]
|
|
5768
|
+
}]
|
|
5769
|
+
}] });
|
|
5770
|
+
|
|
5771
|
+
/*
|
|
5772
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5773
|
+
* Licensed under the MIT license.
|
|
5774
|
+
* See LICENSE file in the project root for full license information.
|
|
5775
|
+
*/
|
|
5776
|
+
const Breakpoints = {
|
|
5777
|
+
XSmall: '(max-width: 575.98px)',
|
|
5778
|
+
Small: '(min-width: 576px) and (max-width: 767.98px)',
|
|
5779
|
+
Medium: '(min-width: 768px) and (max-width: 991.98px)',
|
|
5780
|
+
Large: '(min-width: 992px) and (max-width: 1199.98px)',
|
|
5781
|
+
XLarge: '(min-width: 1200px)'
|
|
5782
|
+
};
|
|
5783
|
+
|
|
5784
|
+
/*
|
|
5785
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5786
|
+
* Licensed under the MIT license.
|
|
5787
|
+
* See LICENSE file in the project root for full license information.
|
|
5788
|
+
*/
|
|
5789
|
+
|
|
5790
|
+
/**
|
|
5791
|
+
* This component is dynamically added to replace breadcrumb when System Header is viewed on tablet or mobile screens.
|
|
5792
|
+
* Used internally by BaoSystemHeaderComponent only, not to be used by host application.
|
|
5793
|
+
*/
|
|
5794
|
+
class BaoBackNavigationComponent {
|
|
5795
|
+
constructor(renderer, elementRef) {
|
|
5796
|
+
this.renderer = renderer;
|
|
5797
|
+
this.elementRef = elementRef;
|
|
5798
|
+
}
|
|
5799
|
+
ngOnChanges(changes) {
|
|
5800
|
+
if (changes['link'] && changes['link'].currentValue) {
|
|
5801
|
+
this.renderer.setAttribute(this.elementRef.nativeElement.children[0], 'href', changes['link'].currentValue);
|
|
5802
|
+
}
|
|
5803
|
+
}
|
|
5804
|
+
}
|
|
5805
|
+
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 });
|
|
5806
|
+
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>
|
|
5807
|
+
<bao-icon
|
|
5808
|
+
color="action"
|
|
5809
|
+
title="arrow-left"
|
|
5810
|
+
svgIcon="icon-arrow-left"
|
|
5811
|
+
size="x-small"
|
|
5812
|
+
></bao-icon>
|
|
5813
|
+
</a>`, isInline: true, components: [{ type: BaoIconComponent, selector: "bao-icon", inputs: ["color", "size", "svgIcon", "title"], exportAs: ["baoIcon"] }] });
|
|
5814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationComponent, decorators: [{
|
|
5815
|
+
type: Component,
|
|
5816
|
+
args: [{
|
|
5817
|
+
selector: 'bao-back-navigation-component',
|
|
5818
|
+
template: ` <a>
|
|
5819
|
+
<bao-icon
|
|
5820
|
+
color="action"
|
|
5821
|
+
title="arrow-left"
|
|
5822
|
+
svgIcon="icon-arrow-left"
|
|
5823
|
+
size="x-small"
|
|
5824
|
+
></bao-icon>
|
|
5825
|
+
</a>`,
|
|
5826
|
+
host: {
|
|
5827
|
+
class: 'bao-system-header-back-button'
|
|
5828
|
+
}
|
|
5829
|
+
}]
|
|
5830
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { link: [{
|
|
5831
|
+
type: Input
|
|
5832
|
+
}] } });
|
|
5833
|
+
/**
|
|
5834
|
+
* This directive is to mark the template where the BaoBackNavigationComponent should be dynamically inserted,
|
|
5835
|
+
* when a Breadcrumb component needs to be replaced
|
|
5836
|
+
*/
|
|
5837
|
+
class BaoBackNavigationInsert {
|
|
5838
|
+
constructor(viewContainerRef) {
|
|
5839
|
+
this.viewContainerRef = viewContainerRef;
|
|
5840
|
+
}
|
|
5841
|
+
}
|
|
5842
|
+
BaoBackNavigationInsert.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationInsert, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5843
|
+
BaoBackNavigationInsert.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoBackNavigationInsert, selector: "[backNavigationInsert]", ngImport: i0 });
|
|
5844
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoBackNavigationInsert, decorators: [{
|
|
5845
|
+
type: Directive,
|
|
5846
|
+
args: [{
|
|
5847
|
+
selector: '[backNavigationInsert]'
|
|
5848
|
+
}]
|
|
5849
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
|
|
5850
|
+
class BaoSystemHeaderComponent {
|
|
5851
|
+
constructor(breakpointObserver, renderer) {
|
|
5852
|
+
this.breakpointObserver = breakpointObserver;
|
|
5853
|
+
this.renderer = renderer;
|
|
5854
|
+
this.screenType = 'desktop';
|
|
5855
|
+
}
|
|
5856
|
+
get textContainerChildren() {
|
|
5857
|
+
return Array.from(this.textContainer.nativeElement.children);
|
|
5858
|
+
}
|
|
5859
|
+
ngOnInit() {
|
|
5860
|
+
if ([Breakpoints.XSmall, Breakpoints.Small].some(size => this.breakpointObserver.isMatched(size))) {
|
|
5861
|
+
this.screenType = 'mobile';
|
|
5862
|
+
}
|
|
5863
|
+
else if (this.breakpointObserver.isMatched(Breakpoints.Medium)) {
|
|
5864
|
+
this.screenType = 'tablet';
|
|
5865
|
+
}
|
|
5866
|
+
else if ([Breakpoints.Large, Breakpoints.XLarge].some(size => this.breakpointObserver.isMatched(size))) {
|
|
5867
|
+
this.screenType = 'desktop';
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
ngAfterViewInit() {
|
|
5871
|
+
this.formatNavigation();
|
|
5872
|
+
this.applySizeClass();
|
|
5873
|
+
}
|
|
5874
|
+
formatNavigation() {
|
|
5875
|
+
// If view is rendered on a mobile/tablet screen
|
|
5876
|
+
if (this.screenType == 'mobile' || this.screenType == 'tablet') {
|
|
5877
|
+
if (this.textContainerChildren[0].className == 'bao-breadcrumb') {
|
|
5878
|
+
// Retrieve link of parent page
|
|
5879
|
+
const breadcrumbElementsList = this.textContainerChildren[0].children[0];
|
|
5880
|
+
const breadcrumbLength = breadcrumbElementsList.children.length;
|
|
5881
|
+
const parentLink = breadcrumbElementsList.children[breadcrumbLength - 2].attributes['href'].value;
|
|
5882
|
+
// Remove Breadcrumb component and replace it with back button
|
|
5883
|
+
this.renderer.removeChild(this.textContainer.nativeElement, this.textContainerChildren[0]);
|
|
5884
|
+
const viewContainerRef = this.backButtonInsert.viewContainerRef;
|
|
5885
|
+
viewContainerRef.clear();
|
|
5886
|
+
const componentRef = viewContainerRef.createComponent(BaoBackNavigationComponent);
|
|
5887
|
+
componentRef.instance.link = parentLink;
|
|
5888
|
+
}
|
|
5889
|
+
}
|
|
5890
|
+
}
|
|
5891
|
+
applySizeClass() {
|
|
5892
|
+
const tagInfoContainer = this.textContainer.nativeElement.childNodes[this.textContainerChildren.length - 1];
|
|
5893
|
+
if (this.screenType === 'mobile') {
|
|
5894
|
+
this.renderer.addClass(tagInfoContainer, 'mobile');
|
|
5895
|
+
}
|
|
5896
|
+
}
|
|
5897
|
+
}
|
|
5898
|
+
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 });
|
|
5899
|
+
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 });
|
|
5900
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderComponent, decorators: [{
|
|
5901
|
+
type: Component,
|
|
5902
|
+
args: [{ selector: 'bao-system-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5903
|
+
class: 'bao-system-header'
|
|
5904
|
+
}, 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"] }]
|
|
5905
|
+
}], ctorParameters: function () { return [{ type: i2$1.BreakpointObserver }, { type: i0.Renderer2 }]; }, propDecorators: { textContainer: [{
|
|
5906
|
+
type: ViewChild,
|
|
5907
|
+
args: ['textContainer', { static: false }]
|
|
5908
|
+
}], backButtonInsert: [{
|
|
5909
|
+
type: ViewChild,
|
|
5910
|
+
args: [BaoBackNavigationInsert, { static: true }]
|
|
5911
|
+
}] } });
|
|
5912
|
+
|
|
5913
|
+
/*
|
|
5914
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5915
|
+
* Licensed under the MIT license.
|
|
5916
|
+
* See LICENSE file in the project root for full license information.
|
|
5917
|
+
*/
|
|
5918
|
+
const SYSTEM_HEADER_DIRECTIVES = [
|
|
5919
|
+
BaoSystemHeaderComponent,
|
|
5920
|
+
BaoBackNavigationInsert,
|
|
5921
|
+
BaoBackNavigationComponent
|
|
5922
|
+
];
|
|
5923
|
+
class BaoSystemHeaderModule {
|
|
5924
|
+
}
|
|
5925
|
+
BaoSystemHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5926
|
+
BaoSystemHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, declarations: [BaoSystemHeaderComponent,
|
|
5927
|
+
BaoBackNavigationInsert,
|
|
5928
|
+
BaoBackNavigationComponent], imports: [CommonModule, BaoIconModule], exports: [BaoSystemHeaderComponent,
|
|
5929
|
+
BaoBackNavigationInsert,
|
|
5930
|
+
BaoBackNavigationComponent] });
|
|
5931
|
+
BaoSystemHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, imports: [[CommonModule, BaoIconModule]] });
|
|
5932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoSystemHeaderModule, decorators: [{
|
|
5933
|
+
type: NgModule,
|
|
5934
|
+
args: [{
|
|
5935
|
+
imports: [CommonModule, BaoIconModule],
|
|
5936
|
+
declarations: [SYSTEM_HEADER_DIRECTIVES],
|
|
5937
|
+
exports: [SYSTEM_HEADER_DIRECTIVES]
|
|
5938
|
+
}]
|
|
5939
|
+
}] });
|
|
5940
|
+
|
|
5941
|
+
/*
|
|
5942
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5943
|
+
* Licensed under the MIT license.
|
|
5944
|
+
* See LICENSE file in the project root for full license information.
|
|
5945
|
+
*/
|
|
5946
|
+
|
|
5052
5947
|
/*
|
|
5053
5948
|
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
5054
5949
|
* Licensed under the MIT license.
|
|
@@ -5061,7 +5956,8 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
|
5061
5956
|
BaoButtonModule,
|
|
5062
5957
|
BaoAlertModule,
|
|
5063
5958
|
BaoCardModule,
|
|
5064
|
-
BaoBreadcrumbModule
|
|
5959
|
+
BaoBreadcrumbModule,
|
|
5960
|
+
BaoModalModule], exports: [BaoIconModule,
|
|
5065
5961
|
BaoButtonModule,
|
|
5066
5962
|
BaoAlertModule,
|
|
5067
5963
|
BaoBreadcrumbModule,
|
|
@@ -5078,16 +5974,18 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
|
5078
5974
|
BaoModalModule,
|
|
5079
5975
|
BaoHyperlinkModule,
|
|
5080
5976
|
BaoDropdownMenuModule,
|
|
5081
|
-
BaoFileModule
|
|
5977
|
+
BaoFileModule,
|
|
5978
|
+
BaoSnackBarModule,
|
|
5979
|
+
BaoSystemHeaderModule
|
|
5082
5980
|
// TODO: reactivate once component does not depend on global css BaoBadgeModule,
|
|
5083
|
-
// TODO: reactivate once component does not depend on global css BaoSnackBarModule,
|
|
5084
5981
|
] });
|
|
5085
5982
|
BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModule, imports: [[
|
|
5086
5983
|
BaoIconModule,
|
|
5087
5984
|
BaoButtonModule,
|
|
5088
5985
|
BaoAlertModule,
|
|
5089
5986
|
BaoCardModule,
|
|
5090
|
-
BaoBreadcrumbModule
|
|
5987
|
+
BaoBreadcrumbModule,
|
|
5988
|
+
BaoModalModule
|
|
5091
5989
|
], BaoIconModule,
|
|
5092
5990
|
BaoButtonModule,
|
|
5093
5991
|
BaoAlertModule,
|
|
@@ -5105,9 +6003,10 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
|
5105
6003
|
BaoModalModule,
|
|
5106
6004
|
BaoHyperlinkModule,
|
|
5107
6005
|
BaoDropdownMenuModule,
|
|
5108
|
-
BaoFileModule
|
|
6006
|
+
BaoFileModule,
|
|
6007
|
+
BaoSnackBarModule,
|
|
6008
|
+
BaoSystemHeaderModule
|
|
5109
6009
|
// TODO: reactivate once component does not depend on global css BaoBadgeModule,
|
|
5110
|
-
// TODO: reactivate once component does not depend on global css BaoSnackBarModule,
|
|
5111
6010
|
] });
|
|
5112
6011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoModule, decorators: [{
|
|
5113
6012
|
type: NgModule,
|
|
@@ -5117,7 +6016,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5117
6016
|
BaoButtonModule,
|
|
5118
6017
|
BaoAlertModule,
|
|
5119
6018
|
BaoCardModule,
|
|
5120
|
-
BaoBreadcrumbModule
|
|
6019
|
+
BaoBreadcrumbModule,
|
|
6020
|
+
BaoModalModule
|
|
5121
6021
|
],
|
|
5122
6022
|
exports: [
|
|
5123
6023
|
BaoIconModule,
|
|
@@ -5137,9 +6037,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5137
6037
|
BaoModalModule,
|
|
5138
6038
|
BaoHyperlinkModule,
|
|
5139
6039
|
BaoDropdownMenuModule,
|
|
5140
|
-
BaoFileModule
|
|
6040
|
+
BaoFileModule,
|
|
6041
|
+
BaoSnackBarModule,
|
|
6042
|
+
BaoSystemHeaderModule
|
|
5141
6043
|
// TODO: reactivate once component does not depend on global css BaoBadgeModule,
|
|
5142
|
-
// TODO: reactivate once component does not depend on global css BaoSnackBarModule,
|
|
5143
6044
|
]
|
|
5144
6045
|
}]
|
|
5145
6046
|
}] });
|
|
@@ -5219,9 +6120,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5219
6120
|
* See LICENSE file in the project root for full license information.
|
|
5220
6121
|
*/
|
|
5221
6122
|
|
|
6123
|
+
/*
|
|
6124
|
+
* Copyright (c) 2023 Ville de Montreal. All rights reserved.
|
|
6125
|
+
* Licensed under the MIT license.
|
|
6126
|
+
* See LICENSE file in the project root for full license information.
|
|
6127
|
+
*/
|
|
6128
|
+
|
|
5222
6129
|
/**
|
|
5223
6130
|
* Generated bundle index. Do not edit.
|
|
5224
6131
|
*/
|
|
5225
6132
|
|
|
5226
|
-
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 };
|
|
6133
|
+
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 };
|
|
5227
6134
|
//# sourceMappingURL=villedemontreal-angular-ui.mjs.map
|