@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
package/lib/bao.module.d.ts
CHANGED
|
@@ -4,21 +4,23 @@ import * as i2 from "./button/module";
|
|
|
4
4
|
import * as i3 from "./alert/module";
|
|
5
5
|
import * as i4 from "./card/module";
|
|
6
6
|
import * as i5 from "./breadcrumb/module";
|
|
7
|
-
import * as i6 from "./
|
|
8
|
-
import * as i7 from "./
|
|
9
|
-
import * as i8 from "./
|
|
10
|
-
import * as i9 from "./
|
|
11
|
-
import * as i10 from "./
|
|
12
|
-
import * as i11 from "./
|
|
13
|
-
import * as i12 from "./
|
|
14
|
-
import * as i13 from "./
|
|
15
|
-
import * as i14 from "./
|
|
16
|
-
import * as i15 from "./
|
|
7
|
+
import * as i6 from "./modal/module";
|
|
8
|
+
import * as i7 from "./tag/module";
|
|
9
|
+
import * as i8 from "./header-info/module";
|
|
10
|
+
import * as i9 from "./list/module";
|
|
11
|
+
import * as i10 from "./common-components/module";
|
|
12
|
+
import * as i11 from "./checkbox/module";
|
|
13
|
+
import * as i12 from "./radio/module";
|
|
14
|
+
import * as i13 from "./summary/module";
|
|
15
|
+
import * as i14 from "./avatar/module";
|
|
16
|
+
import * as i15 from "./tabs/module";
|
|
17
17
|
import * as i16 from "./hyperlink/module";
|
|
18
18
|
import * as i17 from "./dropdown-menu/module";
|
|
19
19
|
import * as i18 from "./file/module";
|
|
20
|
+
import * as i19 from "./snack-bar/module";
|
|
21
|
+
import * as i20 from "./system-header/module";
|
|
20
22
|
export declare class BaoModule {
|
|
21
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaoModule, never>;
|
|
22
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<BaoModule, never, [typeof i1.BaoIconModule, typeof i2.BaoButtonModule, typeof i3.BaoAlertModule, typeof i4.BaoCardModule, typeof i5.BaoBreadcrumbModule], [typeof i1.BaoIconModule, typeof i2.BaoButtonModule, typeof i3.BaoAlertModule, typeof i5.BaoBreadcrumbModule, typeof i4.BaoCardModule, typeof
|
|
24
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BaoModule, never, [typeof i1.BaoIconModule, typeof i2.BaoButtonModule, typeof i3.BaoAlertModule, typeof i4.BaoCardModule, typeof i5.BaoBreadcrumbModule, typeof i6.BaoModalModule], [typeof i1.BaoIconModule, typeof i2.BaoButtonModule, typeof i3.BaoAlertModule, typeof i5.BaoBreadcrumbModule, typeof i4.BaoCardModule, typeof i7.BaoTagModule, typeof i8.BaoHeaderInfoModule, typeof i9.BaoListModule, typeof i10.BaoCommonComponentsModule, typeof i11.BaoCheckboxModule, typeof i12.BaoRadioModule, typeof i13.BaoSummaryModule, typeof i14.BaoAvatarModule, typeof i15.BaoTabsModule, typeof i6.BaoModalModule, typeof i16.BaoHyperlinkModule, typeof i17.BaoDropdownMenuModule, typeof i18.BaoFileModule, typeof i19.BaoSnackBarModule, typeof i20.BaoSystemHeaderModule]>;
|
|
23
25
|
static ɵinj: i0.ɵɵInjectorDeclaration<BaoModule>;
|
|
24
26
|
}
|
|
@@ -10,6 +10,10 @@ export declare class BaoDropdownMenuItem implements AfterViewInit, OnChanges {
|
|
|
10
10
|
* Is the list item disabled
|
|
11
11
|
*/
|
|
12
12
|
disabled: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Emits when menu item is clicked
|
|
15
|
+
*/
|
|
16
|
+
itemClicked: EventEmitter<any>;
|
|
13
17
|
constructor(renderer: Renderer2, elementRef: ElementRef<HTMLElement>, _parent: BaoDropdownMenuComponent);
|
|
14
18
|
get nativeElement(): HTMLElement;
|
|
15
19
|
spaceKeyEvent(): void;
|
|
@@ -22,13 +26,14 @@ export declare class BaoDropdownMenuItem implements AfterViewInit, OnChanges {
|
|
|
22
26
|
private addPaddingClass;
|
|
23
27
|
private disableItem;
|
|
24
28
|
/**
|
|
25
|
-
* This method propagates a click event to menu item children with inputs (checkbox, radio button)
|
|
29
|
+
* This method propagates a click event to menu item children with inputs (checkbox, radio button).
|
|
30
|
+
* It emits event to close menu if item does not contain an input.
|
|
26
31
|
*/
|
|
27
32
|
private propagateClick;
|
|
28
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuItem, never>;
|
|
29
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuItem, "bao-dropdown-menu-item, [bao-dropdown-menu-item]", never, { "disabled": "disabled"; }, {}, never>;
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuItem, "bao-dropdown-menu-item, [bao-dropdown-menu-item]", never, { "disabled": "disabled"; }, { "itemClicked": "itemClicked"; }, never>;
|
|
30
35
|
}
|
|
31
|
-
export declare class BaoDropdownMenuComponent implements AfterViewInit {
|
|
36
|
+
export declare class BaoDropdownMenuComponent implements AfterContentInit, AfterViewInit {
|
|
32
37
|
private cdr;
|
|
33
38
|
private renderer;
|
|
34
39
|
private elementRef;
|
|
@@ -78,6 +83,7 @@ export declare class BaoDropdownMenuComponent implements AfterViewInit {
|
|
|
78
83
|
/** Prevents focus to be lost when SHIFT + TAB has reached beginning of menu */
|
|
79
84
|
shiftTabKeyEvent(): void;
|
|
80
85
|
ngAfterViewInit(): void;
|
|
86
|
+
ngAfterContentInit(): void;
|
|
81
87
|
focusFirstItem(): void;
|
|
82
88
|
open(): void;
|
|
83
89
|
close(): void;
|
|
@@ -117,7 +123,7 @@ export declare class BaoDropdownMenuTrigger implements AfterViewInit, OnDestroy
|
|
|
117
123
|
escapeKeyEvent(): void;
|
|
118
124
|
/** Enter key event triggers click event which opens menu,
|
|
119
125
|
* then focus is put on first item in the menu */
|
|
120
|
-
enterKeyEvent(): void;
|
|
126
|
+
enterKeyEvent(event: KeyboardEvent): void;
|
|
121
127
|
onClick(): void;
|
|
122
128
|
ngAfterViewInit(): void;
|
|
123
129
|
ngOnDestroy(): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AnimationEvent } from '@angular/animations';
|
|
2
1
|
import { FocusMonitor, FocusOrigin, ConfigurableFocusTrapFactory, InteractivityChecker } from '@angular/cdk/a11y';
|
|
3
2
|
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
4
3
|
import { ChangeDetectorRef, ComponentRef, ElementRef, EmbeddedViewRef, EventEmitter, NgZone } from '@angular/core';
|
|
@@ -88,18 +87,18 @@ export declare abstract class _BaoModalContainerBase extends BasePortalOutlet {
|
|
|
88
87
|
private _containsFocus;
|
|
89
88
|
/** Starts the modal exit animation. */
|
|
90
89
|
abstract _startExitAnimation(): void;
|
|
90
|
+
abstract _startOpenAnimation(): void;
|
|
91
91
|
static ɵfac: i0.ɵɵFactoryDeclaration<_BaoModalContainerBase, [null, null, null, { optional: true; }, null, null, null, null]>;
|
|
92
92
|
static ɵdir: i0.ɵɵDirectiveDeclaration<_BaoModalContainerBase, never, never, {}, {}, never>;
|
|
93
93
|
}
|
|
94
94
|
export declare class BaoModalContainer extends _BaoModalContainerBase {
|
|
95
95
|
/** State of the modal animation. */
|
|
96
96
|
_state: 'void' | 'enter' | 'exit';
|
|
97
|
-
|
|
98
|
-
_onAnimationDone({ toState, totalTime }: AnimationEvent): Promise<void>;
|
|
99
|
-
/** Callback, invoked when an animation on the host starts. */
|
|
100
|
-
_onAnimationStart({ toState, totalTime }: AnimationEvent): void;
|
|
97
|
+
_startOpenAnimation(): void;
|
|
101
98
|
/** Starts the modal exit animation. */
|
|
102
99
|
_startExitAnimation(): void;
|
|
100
|
+
private _finishDialogOpen;
|
|
101
|
+
private _openAnimationDone;
|
|
103
102
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaoModalContainer, never>;
|
|
104
103
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaoModalContainer, "bao-modal-container", never, {}, {}, never, never>;
|
|
105
104
|
}
|
package/lib/modal/modal-ref.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export declare class BaoModalRef<T, R = unknown> {
|
|
|
41
41
|
* @param modalResult Optional result to return to the modal opener.
|
|
42
42
|
*/
|
|
43
43
|
close(modalResult?: R): void;
|
|
44
|
+
startOpenAnimation(): void;
|
|
44
45
|
/**
|
|
45
46
|
* Gets an observable that is notified when the modal is finished opening.
|
|
46
47
|
*/
|
package/lib/modal/modal.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare abstract class BaoModalBase<C extends _BaoModalContainerBase> imp
|
|
|
15
15
|
private _modalRefConstructor;
|
|
16
16
|
private _modalContainerType;
|
|
17
17
|
private _modalDataToken;
|
|
18
|
-
private _animationMode?;
|
|
19
18
|
readonly afterAllClosed: Observable<void>;
|
|
20
19
|
private _openModalsAtThisLevel;
|
|
21
20
|
private readonly _afterAllClosedAtThisLevel;
|
|
@@ -24,7 +23,7 @@ export declare abstract class BaoModalBase<C extends _BaoModalContainerBase> imp
|
|
|
24
23
|
private _modalAnimatingOpen;
|
|
25
24
|
private _animationStateSubscriptions;
|
|
26
25
|
private _lastModalRef;
|
|
27
|
-
constructor(_overlay: Overlay, _injector: Injector, _parentModal: BaoModalBase<C> | undefined, _overlayContainer: OverlayContainer, _modalRefConstructor: Type<BaoModalRef<unknown>>, _modalContainerType: Type<C>, _modalDataToken: InjectionToken<unknown
|
|
26
|
+
constructor(_overlay: Overlay, _injector: Injector, _parentModal: BaoModalBase<C> | undefined, _overlayContainer: OverlayContainer, _modalRefConstructor: Type<BaoModalRef<unknown>>, _modalContainerType: Type<C>, _modalDataToken: InjectionToken<unknown>);
|
|
28
27
|
/** Keeps track of the currently-open modals. */
|
|
29
28
|
get openModals(): BaoModalRef<unknown>[];
|
|
30
29
|
/** Stream that emits when a modal has been opened. */
|
|
@@ -85,7 +84,7 @@ export declare abstract class BaoModalBase<C extends _BaoModalContainerBase> imp
|
|
|
85
84
|
* Service to open modal.
|
|
86
85
|
*/
|
|
87
86
|
export declare class BaoModal extends BaoModalBase<BaoModalContainer> {
|
|
88
|
-
constructor(overlay: Overlay, injector: Injector, parentModal: BaoModal, overlayContainer: OverlayContainer
|
|
89
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaoModal, [null, null, { optional: true; skipSelf: true; }, null
|
|
87
|
+
constructor(overlay: Overlay, injector: Injector, parentModal: BaoModal, overlayContainer: OverlayContainer);
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoModal, [null, null, { optional: true; skipSelf: true; }, null]>;
|
|
90
89
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaoModal>;
|
|
91
90
|
}
|
package/lib/modal/module.d.ts
CHANGED
|
@@ -4,9 +4,8 @@ import * as i2 from "./modal-directives";
|
|
|
4
4
|
import * as i3 from "@angular/common";
|
|
5
5
|
import * as i4 from "@angular/cdk/overlay";
|
|
6
6
|
import * as i5 from "@angular/cdk/portal";
|
|
7
|
-
import * as i6 from "@angular/platform-browser/animations";
|
|
8
7
|
export declare class BaoModalModule {
|
|
9
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaoModalModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<BaoModalModule, [typeof i1.BaoModalContainer, typeof i2.BaoModalClose], [typeof i3.CommonModule, typeof i4.OverlayModule, typeof i5.PortalModule
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BaoModalModule, [typeof i1.BaoModalContainer, typeof i2.BaoModalClose], [typeof i3.CommonModule, typeof i4.OverlayModule, typeof i5.PortalModule], [typeof i1.BaoModalContainer, typeof i2.BaoModalClose]>;
|
|
11
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<BaoModalModule>;
|
|
12
11
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./simple-snack-bar.component";
|
|
3
|
+
import * as i2 from "./snack-bar-container";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/cdk/overlay";
|
|
6
|
+
import * as i5 from "@angular/cdk/portal";
|
|
7
|
+
import * as i6 from "../button/module";
|
|
8
|
+
import * as i7 from "../icon/module";
|
|
9
|
+
export declare class BaoSnackBarModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoSnackBarModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BaoSnackBarModule, [typeof i1.BaoSimpleSnackBarComponent, typeof i2.BaoSnackBarContainerComponent], [typeof i3.CommonModule, typeof i4.OverlayModule, typeof i5.PortalModule, typeof i6.BaoButtonModule, typeof i7.BaoIconModule], [typeof i1.BaoSimpleSnackBarComponent, typeof i2.BaoSnackBarContainerComponent]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<BaoSnackBarModule>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BaoSnackBarToastType } from './snack-bar-config';
|
|
2
|
+
import { BaoSnackBarRef } from './snack-bar-ref';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for a simple snack bar component that has a message and a single action.
|
|
6
|
+
*/
|
|
7
|
+
export interface ITextOnlySnackBar {
|
|
8
|
+
data: {
|
|
9
|
+
message: string;
|
|
10
|
+
toastType: BaoSnackBarToastType;
|
|
11
|
+
actionLabelOrIcon: string;
|
|
12
|
+
showClose: boolean;
|
|
13
|
+
};
|
|
14
|
+
snackBarRef: BaoSnackBarRef<ITextOnlySnackBar>;
|
|
15
|
+
action: () => void;
|
|
16
|
+
hasAction: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A component used to open as the default snack bar, matching material spec.
|
|
20
|
+
* This should only be used internally by the snack bar service.
|
|
21
|
+
*/
|
|
22
|
+
export declare class BaoSimpleSnackBarComponent implements ITextOnlySnackBar {
|
|
23
|
+
snackBarRef: BaoSnackBarRef<BaoSimpleSnackBarComponent>;
|
|
24
|
+
showCloseTitle: string;
|
|
25
|
+
/** Data that was injected into the snack bar. */
|
|
26
|
+
data: {
|
|
27
|
+
message: string;
|
|
28
|
+
toastType: BaoSnackBarToastType;
|
|
29
|
+
actionLabelOrIcon: string;
|
|
30
|
+
showClose: boolean;
|
|
31
|
+
};
|
|
32
|
+
constructor(snackBarRef: BaoSnackBarRef<BaoSimpleSnackBarComponent>, data: any);
|
|
33
|
+
/** Returns the politeness */
|
|
34
|
+
get politeness(): string;
|
|
35
|
+
/** Returns the toast class */
|
|
36
|
+
get toastClass(): string;
|
|
37
|
+
/** Returns the toast icon */
|
|
38
|
+
get toastIcon(): string;
|
|
39
|
+
/** Returns the toast icon title */
|
|
40
|
+
get toastIconTitle(): string;
|
|
41
|
+
/** If the action button should be shown. */
|
|
42
|
+
get hasAction(): boolean;
|
|
43
|
+
/** If the action is an icon */
|
|
44
|
+
get isActionIcon(): boolean;
|
|
45
|
+
/** Performs the action on the snack bar. */
|
|
46
|
+
action(): void;
|
|
47
|
+
/** Closes the snack bar. */
|
|
48
|
+
close(): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoSimpleSnackBarComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaoSimpleSnackBarComponent, "bao-simple-snack-bar", never, {}, {}, never, never>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AriaLivePoliteness } from '@angular/cdk/a11y';
|
|
2
|
+
import { Direction } from '@angular/cdk/bidi';
|
|
3
|
+
import { InjectionToken, ViewContainerRef } from '@angular/core';
|
|
4
|
+
/** Injection token that can be used to access the data that was passed in to a snack bar. */
|
|
5
|
+
export declare const BAO_SNACK_BAR_DATA: InjectionToken<any>;
|
|
6
|
+
/** Possible values for horizontalPosition on MatSnackBarConfig. */
|
|
7
|
+
export declare type BaoSnackBarHorizontalPosition = 'start' | 'center' | 'end' | 'left' | 'right';
|
|
8
|
+
/** Possible values for verticalPosition on MatSnackBarConfig. */
|
|
9
|
+
export declare type BaoSnackBarVerticalPosition = 'top' | 'bottom';
|
|
10
|
+
/** Possible types of toast to display the snack bar */
|
|
11
|
+
export declare type BaoSnackBarToastType = 'info' | 'success' | 'danger';
|
|
12
|
+
/**
|
|
13
|
+
* Configuration used when opening a snack-bar.
|
|
14
|
+
*/
|
|
15
|
+
export declare class BaoSnackBarConfig<D = any> {
|
|
16
|
+
/** The message to display in the snackbar. */
|
|
17
|
+
message: string;
|
|
18
|
+
/** The type of snackbar template to display. */
|
|
19
|
+
toastType?: BaoSnackBarToastType;
|
|
20
|
+
/**
|
|
21
|
+
* The attached action to the snack bar. If the name of the action matches an icon provided as part of
|
|
22
|
+
* angular-ui icon dictionnary an icon will be displayed instead of text.
|
|
23
|
+
* */
|
|
24
|
+
actionLabelOrIcon?: string;
|
|
25
|
+
/** Displays the close button when set to true */
|
|
26
|
+
showClose?: boolean;
|
|
27
|
+
/** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
|
|
28
|
+
duration?: number;
|
|
29
|
+
/** The politeness level for the MatAriaLiveAnnouncer announcement. */
|
|
30
|
+
politeness?: AriaLivePoliteness;
|
|
31
|
+
/**
|
|
32
|
+
* Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
|
|
33
|
+
* component or template, the announcement message will default to the specified message.
|
|
34
|
+
*/
|
|
35
|
+
announcementMessage?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The view container that serves as the parent for the snackbar for the purposes of dependency
|
|
38
|
+
* injection. Note: this does not affect where the snackbar is inserted in the DOM.
|
|
39
|
+
*/
|
|
40
|
+
viewContainerRef?: ViewContainerRef;
|
|
41
|
+
/** Extra CSS classes to be added to the snack bar container. */
|
|
42
|
+
panelClass?: string | string[];
|
|
43
|
+
/** Text layout direction for the snack bar. */
|
|
44
|
+
direction?: Direction;
|
|
45
|
+
/** Data being injected into the child component. */
|
|
46
|
+
data?: D | null;
|
|
47
|
+
/** The horizontal position to place the snack bar. */
|
|
48
|
+
horizontalPosition?: BaoSnackBarHorizontalPosition;
|
|
49
|
+
/** The vertical position to place the snack bar. */
|
|
50
|
+
verticalPosition?: BaoSnackBarVerticalPosition;
|
|
51
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { AnimationEvent } from '@angular/animations';
|
|
2
|
+
import { AriaLivePoliteness } from '@angular/cdk/a11y';
|
|
3
|
+
import { Platform } from '@angular/cdk/platform';
|
|
4
|
+
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, DomPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
5
|
+
import { ChangeDetectorRef, ComponentRef, ElementRef, EmbeddedViewRef, NgZone, OnDestroy } from '@angular/core';
|
|
6
|
+
import { Observable, Subject } from 'rxjs';
|
|
7
|
+
import { BaoSnackBarConfig } from './snack-bar-config';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Internal interface for a snack bar container.
|
|
11
|
+
* @docs-private
|
|
12
|
+
*/
|
|
13
|
+
export interface IBaoSnackBarContainer {
|
|
14
|
+
snackBarConfig: BaoSnackBarConfig;
|
|
15
|
+
_onAnnounce: Subject<any>;
|
|
16
|
+
_onExit: Subject<any>;
|
|
17
|
+
_onEnter: Subject<any>;
|
|
18
|
+
enter: () => void;
|
|
19
|
+
exit: () => Observable<void>;
|
|
20
|
+
attachTemplatePortal: <C>(portal: TemplatePortal<C>) => EmbeddedViewRef<C>;
|
|
21
|
+
attachComponentPortal: <T>(portal: ComponentPortal<T>) => ComponentRef<T>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Internal component that wraps user-provided snack bar content.
|
|
25
|
+
* @docs-private
|
|
26
|
+
*/
|
|
27
|
+
export declare class BaoSnackBarContainerComponent extends BasePortalOutlet implements OnDestroy, IBaoSnackBarContainer {
|
|
28
|
+
private _ngZone;
|
|
29
|
+
private _elementRef;
|
|
30
|
+
private _changeDetectorRef;
|
|
31
|
+
private _platform;
|
|
32
|
+
/** The snack bar configuration. */
|
|
33
|
+
snackBarConfig: BaoSnackBarConfig;
|
|
34
|
+
/** The portal outlet inside of this container into which the snack bar content will be loaded. */
|
|
35
|
+
_portalOutlet: CdkPortalOutlet;
|
|
36
|
+
private _document;
|
|
37
|
+
private _trackedModals;
|
|
38
|
+
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
39
|
+
readonly _onAnnounce: Subject<void>;
|
|
40
|
+
/** Subject for notifying that the snack bar has exited from view. */
|
|
41
|
+
readonly _onExit: Subject<void>;
|
|
42
|
+
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
43
|
+
readonly _onEnter: Subject<void>;
|
|
44
|
+
/** The state of the snack bar animations. */
|
|
45
|
+
_animationState: string;
|
|
46
|
+
/** aria-live value for the live region. */
|
|
47
|
+
_live: AriaLivePoliteness;
|
|
48
|
+
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
49
|
+
private readonly _announceDelay;
|
|
50
|
+
/** The timeout for announcing the snack bar's content. */
|
|
51
|
+
private _announceTimeoutId;
|
|
52
|
+
/** Whether the component has been destroyed. */
|
|
53
|
+
private _destroyed;
|
|
54
|
+
/**
|
|
55
|
+
* Role of the live region. This is only for Firefox as there is a known issue where Firefox +
|
|
56
|
+
* JAWS does not read out aria-live message.
|
|
57
|
+
*/
|
|
58
|
+
_role?: 'status' | 'alert';
|
|
59
|
+
/** Unique ID of the aria-live element. */
|
|
60
|
+
readonly _liveElementId: string;
|
|
61
|
+
constructor(_ngZone: NgZone, _elementRef: ElementRef<HTMLElement>, _changeDetectorRef: ChangeDetectorRef, _platform: Platform,
|
|
62
|
+
/** The snack bar configuration. */
|
|
63
|
+
snackBarConfig: BaoSnackBarConfig);
|
|
64
|
+
/** Attach a component portal as content to this snack bar container. */
|
|
65
|
+
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
|
|
66
|
+
/** Attach a template portal as content to this snack bar container. */
|
|
67
|
+
attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
|
|
68
|
+
/**
|
|
69
|
+
* Attaches a DOM portal to the snack bar container.
|
|
70
|
+
* @deprecated To be turned into a method.
|
|
71
|
+
* @breaking-change 10.0.0
|
|
72
|
+
*/
|
|
73
|
+
attachDomPortal: (portal: DomPortal) => void;
|
|
74
|
+
/** Handle end of animations, updating the state of the snackbar. */
|
|
75
|
+
onAnimationEnd(event: AnimationEvent): void;
|
|
76
|
+
/** Begin animation of snack bar entrance into view. */
|
|
77
|
+
enter(): void;
|
|
78
|
+
/** Begin animation of the snack bar exiting from view. */
|
|
79
|
+
exit(): Observable<void>;
|
|
80
|
+
/** Makes sure the exit callbacks have been invoked when the element is destroyed. */
|
|
81
|
+
ngOnDestroy(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Waits for the zone to settle before removing the element. Helps prevent
|
|
84
|
+
* errors where we end up removing an element which is in the middle of an animation.
|
|
85
|
+
*/
|
|
86
|
+
private completeExit;
|
|
87
|
+
/** Applies the various positioning and user-configured CSS classes to the snack bar. */
|
|
88
|
+
private applySnackBarClasses;
|
|
89
|
+
/**
|
|
90
|
+
* Called after the portal contents have been attached. Can be
|
|
91
|
+
* used to modify the DOM once it's guaranteed to be in place.
|
|
92
|
+
*/
|
|
93
|
+
protected _afterPortalAttached(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Some browsers won't expose the accessibility node of the live element if there is an
|
|
96
|
+
* `aria-modal` and the live element is outside of it. This method works around the issue by
|
|
97
|
+
* pointing the `aria-owns` of all modals to the live element.
|
|
98
|
+
*/
|
|
99
|
+
private _exposeToModals;
|
|
100
|
+
/** Clears the references to the live element from any modals it was added to. */
|
|
101
|
+
private _clearFromModals;
|
|
102
|
+
/** Asserts that no content is already attached to the container. */
|
|
103
|
+
private assertNotAttached;
|
|
104
|
+
/**
|
|
105
|
+
* Starts a timeout to move the snack bar content to the live region so screen readers will
|
|
106
|
+
* announce it.
|
|
107
|
+
*/
|
|
108
|
+
private screenReaderAnnounce;
|
|
109
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoSnackBarContainerComponent, never>;
|
|
110
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaoSnackBarContainerComponent, "bao-snack-bar-container", never, {}, {}, never, never>;
|
|
111
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { IBaoSnackBarContainer } from './snack-bar-container';
|
|
4
|
+
/** Event that is emitted when a snack bar is dismissed. */
|
|
5
|
+
export interface IBaoSnackBarDismiss {
|
|
6
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
7
|
+
dismissedByAction: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reference to a snack bar dispatched from the snack bar service.
|
|
11
|
+
*/
|
|
12
|
+
export declare class BaoSnackBarRef<T> {
|
|
13
|
+
private _overlayRef;
|
|
14
|
+
/** The instance of the component making up the content of the snack bar. */
|
|
15
|
+
instance: T;
|
|
16
|
+
/**
|
|
17
|
+
* The instance of the component making up the content of the snack bar.
|
|
18
|
+
* @docs-private
|
|
19
|
+
*/
|
|
20
|
+
containerInstance: IBaoSnackBarContainer;
|
|
21
|
+
/** Subject for notifying the user that the snack bar has been dismissed. */
|
|
22
|
+
private readonly _afterDismissed;
|
|
23
|
+
/** Subject for notifying the user that the snack bar has opened and appeared. */
|
|
24
|
+
private readonly _afterOpened;
|
|
25
|
+
/** Subject for notifying the user that the snack bar action was called. */
|
|
26
|
+
private readonly _onAction;
|
|
27
|
+
/**
|
|
28
|
+
* Timeout ID for the duration setTimeout call. Used to clear the timeout if the snackbar is
|
|
29
|
+
* dismissed before the duration passes.
|
|
30
|
+
*/
|
|
31
|
+
private _durationTimeoutId;
|
|
32
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
33
|
+
private _dismissedByAction;
|
|
34
|
+
constructor(containerInstance: IBaoSnackBarContainer, _overlayRef: OverlayRef);
|
|
35
|
+
/** Dismisses the snack bar. */
|
|
36
|
+
dismiss(): void;
|
|
37
|
+
/** Marks the snackbar action clicked. */
|
|
38
|
+
dismissWithAction(): void;
|
|
39
|
+
/** Dismisses the snack bar after some duration */
|
|
40
|
+
dismissAfter(duration: number): void;
|
|
41
|
+
/** Marks the snackbar as opened */
|
|
42
|
+
open(): void;
|
|
43
|
+
/** Gets an observable that is notified when the snack bar is finished closing. */
|
|
44
|
+
afterDismissed(): Observable<IBaoSnackBarDismiss>;
|
|
45
|
+
/** Gets an observable that is notified when the snack bar has opened and appeared. */
|
|
46
|
+
afterOpened(): Observable<void>;
|
|
47
|
+
/** Gets an observable that is notified when the snack bar action is called. */
|
|
48
|
+
onAction(): Observable<void>;
|
|
49
|
+
/** Cleans up the DOM after closing. */
|
|
50
|
+
private finishDismiss;
|
|
51
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
2
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
3
|
+
import { ComponentType } from '@angular/cdk/portal';
|
|
4
|
+
import { EmbeddedViewRef, InjectionToken, Injector, OnDestroy, TemplateRef, Type } from '@angular/core';
|
|
5
|
+
import { ITextOnlySnackBar } from './simple-snack-bar.component';
|
|
6
|
+
import { BaoSnackBarConfig } from './snack-bar-config';
|
|
7
|
+
import { IBaoSnackBarContainer } from './snack-bar-container';
|
|
8
|
+
import { BaoSnackBarRef } from './snack-bar-ref';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare function baoFactory(): BaoSnackBarConfig<any>;
|
|
11
|
+
/** Injection token that can be used to specify default snack bar. */
|
|
12
|
+
export declare const BAO_SNACK_BAR_DEFAULT_OPTIONS: InjectionToken<BaoSnackBarConfig<any>>;
|
|
13
|
+
/**
|
|
14
|
+
* Service to dispatch Material Design snack bar messages.
|
|
15
|
+
*/
|
|
16
|
+
export declare class BaoSnackBarService implements OnDestroy {
|
|
17
|
+
private _overlay;
|
|
18
|
+
private _live;
|
|
19
|
+
private _injector;
|
|
20
|
+
private _parentSnackBar;
|
|
21
|
+
private _defaultConfig;
|
|
22
|
+
/** The component that should be rendered as the snack bar's simple component. */
|
|
23
|
+
protected simpleSnackBarComponent: Type<ITextOnlySnackBar>;
|
|
24
|
+
/** The container component that attaches the provided template or component. */
|
|
25
|
+
protected snackBarContainerComponent: Type<IBaoSnackBarContainer>;
|
|
26
|
+
/**
|
|
27
|
+
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
28
|
+
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
29
|
+
* via `_openedSnackBarRef`.
|
|
30
|
+
*/
|
|
31
|
+
private _snackBarRefAtThisLevel;
|
|
32
|
+
constructor(_overlay: Overlay, _live: LiveAnnouncer, _injector: Injector, _parentSnackBar: BaoSnackBarService, _defaultConfig: BaoSnackBarConfig);
|
|
33
|
+
/** Reference to the currently opened snackbar at *any* level. */
|
|
34
|
+
get _openedSnackBarRef(): BaoSnackBarRef<any> | null;
|
|
35
|
+
set _openedSnackBarRef(value: BaoSnackBarRef<any> | null);
|
|
36
|
+
/**
|
|
37
|
+
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
38
|
+
* currently opened snack bars.
|
|
39
|
+
*
|
|
40
|
+
* @param component Component to be instantiated.
|
|
41
|
+
* @param config Extra configuration for the snack bar.
|
|
42
|
+
*/
|
|
43
|
+
openFromComponent<T>(component: ComponentType<T>, config?: BaoSnackBarConfig): BaoSnackBarRef<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates and dispatches a snack bar with a custom template for the content, removing any
|
|
46
|
+
* currently opened snack bars.
|
|
47
|
+
*
|
|
48
|
+
* @param template Template to be instantiated.
|
|
49
|
+
* @param config Extra configuration for the snack bar.
|
|
50
|
+
*/
|
|
51
|
+
openFromTemplate(template: TemplateRef<any>, config?: BaoSnackBarConfig): BaoSnackBarRef<EmbeddedViewRef<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* Opens a snackbar with a message and an optional action.
|
|
54
|
+
* @param message The message to show in the snackbar.
|
|
55
|
+
* @param toastType The type of of toast to display the snackbar.
|
|
56
|
+
* @param actionLabelOrIcon The label or icon for the snackbar action.
|
|
57
|
+
* @param showClose If true, the snackbar will require user interaction to close.
|
|
58
|
+
* @param config Additional configuration options for the snackbar.
|
|
59
|
+
*/
|
|
60
|
+
open(config: BaoSnackBarConfig): BaoSnackBarRef<ITextOnlySnackBar>;
|
|
61
|
+
/**
|
|
62
|
+
* Dismisses the currently-visible snack bar.
|
|
63
|
+
*/
|
|
64
|
+
dismiss(): void;
|
|
65
|
+
ngOnDestroy(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Attaches the snack bar container component to the overlay.
|
|
68
|
+
*/
|
|
69
|
+
private attachSnackBarContainer;
|
|
70
|
+
/**
|
|
71
|
+
* Places a new component or a template as the content of the snack bar container.
|
|
72
|
+
*/
|
|
73
|
+
private attach;
|
|
74
|
+
/** Animates the old snack bar out and the new one in. */
|
|
75
|
+
private animateSnackBar;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new overlay and places it in the correct location.
|
|
78
|
+
* @param config The user-specified snack bar config.
|
|
79
|
+
*/
|
|
80
|
+
private createOverlay;
|
|
81
|
+
/**
|
|
82
|
+
* Creates an injector to be used inside of a snack bar component.
|
|
83
|
+
* @param config Config that was used to create the snack bar.
|
|
84
|
+
* @param snackBarRef Reference to the snack bar.
|
|
85
|
+
*/
|
|
86
|
+
private createInjector;
|
|
87
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoSnackBarService, [null, null, null, { optional: true; skipSelf: true; }, null]>;
|
|
88
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaoSnackBarService>;
|
|
89
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./system-header.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../icon/module";
|
|
5
|
+
export declare class BaoSystemHeaderModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoSystemHeaderModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BaoSystemHeaderModule, [typeof i1.BaoSystemHeaderComponent, typeof i1.BaoBackNavigationInsert, typeof i1.BaoBackNavigationComponent], [typeof i2.CommonModule, typeof i3.BaoIconModule], [typeof i1.BaoSystemHeaderComponent, typeof i1.BaoBackNavigationInsert, typeof i1.BaoBackNavigationComponent]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<BaoSystemHeaderModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
2
|
+
import { AfterViewInit, ElementRef, OnChanges, OnInit, Renderer2, SimpleChanges, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* This component is dynamically added to replace breadcrumb when System Header is viewed on tablet or mobile screens.
|
|
6
|
+
* Used internally by BaoSystemHeaderComponent only, not to be used by host application.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BaoBackNavigationComponent implements OnChanges {
|
|
9
|
+
private renderer;
|
|
10
|
+
private elementRef;
|
|
11
|
+
link: string;
|
|
12
|
+
constructor(renderer: Renderer2, elementRef: ElementRef<HTMLElement>);
|
|
13
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoBackNavigationComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaoBackNavigationComponent, "bao-back-navigation-component", never, { "link": "link"; }, {}, never, never>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* This directive is to mark the template where the BaoBackNavigationComponent should be dynamically inserted,
|
|
19
|
+
* when a Breadcrumb component needs to be replaced
|
|
20
|
+
*/
|
|
21
|
+
export declare class BaoBackNavigationInsert {
|
|
22
|
+
viewContainerRef: ViewContainerRef;
|
|
23
|
+
constructor(viewContainerRef: ViewContainerRef);
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoBackNavigationInsert, never>;
|
|
25
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaoBackNavigationInsert, "[backNavigationInsert]", never, {}, {}, never>;
|
|
26
|
+
}
|
|
27
|
+
export declare class BaoSystemHeaderComponent implements AfterViewInit, OnInit {
|
|
28
|
+
private breakpointObserver;
|
|
29
|
+
private renderer;
|
|
30
|
+
private textContainer;
|
|
31
|
+
private backButtonInsert;
|
|
32
|
+
screenType: 'mobile' | 'tablet' | 'desktop';
|
|
33
|
+
constructor(breakpointObserver: BreakpointObserver, renderer: Renderer2);
|
|
34
|
+
get textContainerChildren(): Element[];
|
|
35
|
+
ngOnInit(): void;
|
|
36
|
+
ngAfterViewInit(): void;
|
|
37
|
+
private formatNavigation;
|
|
38
|
+
private applySizeClass;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaoSystemHeaderComponent, never>;
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaoSystemHeaderComponent, "bao-system-header", never, {}, {}, never, ["a", "bao-breadcrumb", "h1", "bao-tag", "span", "*"]>;
|
|
41
|
+
}
|
package/package.json
CHANGED