@villedemontreal/angular-ui 3.2.0-pre.build.1 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/global.scss CHANGED
@@ -1,4 +1,6 @@
1
1
  @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800');
2
+ /*** IMPORTED FILE NOT FOUND ***/
3
+ @import '@angular/cdk/overlay-prebuilt.css';/*** --- ***/
2
4
 
3
5
  * {
4
6
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
@@ -4,19 +4,20 @@ 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 "./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";
7
+ import * as i6 from "./tag/module";
8
+ import * as i7 from "./header-info/module";
9
+ import * as i8 from "./list/module";
10
+ import * as i9 from "./common-components/module";
11
+ import * as i10 from "./checkbox/module";
12
+ import * as i11 from "./radio/module";
13
+ import * as i12 from "./summary/module";
14
+ import * as i13 from "./avatar/module";
15
+ import * as i14 from "./tabs/module";
16
+ import * as i15 from "./modal/module";
17
17
  import * as i16 from "./hyperlink/module";
18
+ import * as i17 from "./dropdown-menu/module";
18
19
  export declare class BaoModule {
19
20
  static ɵfac: i0.ɵɵFactoryDeclaration<BaoModule, never>;
20
- 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]>;
21
+ 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 i6.BaoTagModule, typeof i7.BaoHeaderInfoModule, typeof i8.BaoListModule, typeof i9.BaoCommonComponentsModule, typeof i10.BaoCheckboxModule, typeof i11.BaoRadioModule, typeof i12.BaoSummaryModule, typeof i13.BaoAvatarModule, typeof i14.BaoTabsModule, typeof i15.BaoModalModule, typeof i16.BaoHyperlinkModule, typeof i17.BaoDropdownMenuModule]>;
21
22
  static ɵinj: i0.ɵɵInjectorDeclaration<BaoModule>;
22
23
  }
@@ -0,0 +1,170 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { DomPortal } from '@angular/cdk/portal';
3
+ import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, QueryList, Renderer2, SimpleChanges } from '@angular/core';
4
+ import * as i0 from "@angular/core";
5
+ export declare class BaoDropdownMenuItem implements AfterViewInit, OnChanges {
6
+ private renderer;
7
+ private elementRef;
8
+ private _parent;
9
+ /**
10
+ * Is the list item disabled
11
+ */
12
+ disabled: boolean;
13
+ constructor(renderer: Renderer2, elementRef: ElementRef<HTMLElement>, _parent: BaoDropdownMenuComponent);
14
+ get nativeElement(): HTMLElement;
15
+ spaceKeyEvent(): void;
16
+ onClick(el: HTMLElement): void;
17
+ enterKeyEvent(): void;
18
+ ngAfterViewInit(): void;
19
+ ngOnChanges(changes: SimpleChanges): void;
20
+ /** Regroups label and description in a new div to help with layout */
21
+ private addContentDiv;
22
+ private addPaddingClass;
23
+ private disableItem;
24
+ /**
25
+ * This method propagates a click event to menu item children with inputs (checkbox, radio button)
26
+ */
27
+ private propagateClick;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuItem, never>;
29
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuItem, "bao-dropdown-menu-item, [bao-dropdown-menu-item]", never, { "disabled": "disabled"; }, {}, never, never, false>;
30
+ }
31
+ export declare class BaoDropdownMenuComponent implements AfterViewInit {
32
+ private cdr;
33
+ private renderer;
34
+ private elementRef;
35
+ /**
36
+ * Fired when the dropdown-menu changes its 'isOpen' value
37
+ */
38
+ isOpenChange: EventEmitter<boolean>;
39
+ /**
40
+ * Fired when menu is closed by key event triggered from menu item
41
+ */
42
+ isClosedByKeyEvent: EventEmitter<any>;
43
+ /**
44
+ * Content of menu to be loaded inside Overlay
45
+ */
46
+ _menuContent: ElementRef<HTMLElement>;
47
+ /**
48
+ * All list items inside menu
49
+ */
50
+ _listItems: QueryList<BaoDropdownMenuItem>;
51
+ /**
52
+ * Unique identifier of the dropdown menu
53
+ */
54
+ readonly menuId: string;
55
+ /**
56
+ * Is the dropwdown menu currently open
57
+ */
58
+ private _isOpen;
59
+ /**
60
+ * Reference to portal which is attached to Overlay
61
+ */
62
+ private _menuPortal;
63
+ /**
64
+ * Index of currently active list item
65
+ */
66
+ private _activeItemIndex;
67
+ constructor(cdr: ChangeDetectorRef, renderer: Renderer2, elementRef: ElementRef<HTMLElement>);
68
+ get isOpen(): boolean;
69
+ get activeItemIndex(): number;
70
+ get menuPortal(): DomPortal;
71
+ get nativeElement(): HTMLElement;
72
+ set isOpen(isOpen: boolean);
73
+ set activeItemIndex(index: number);
74
+ upKeyEvent(): void;
75
+ downKeyEvent(): void;
76
+ /** Prevents focus to be lost when TAB has reached end of menu */
77
+ tabKeyEvent(): void;
78
+ /** Prevents focus to be lost when SHIFT + TAB has reached beginning of menu */
79
+ shiftTabKeyEvent(): void;
80
+ ngAfterViewInit(): void;
81
+ focusFirstItem(): void;
82
+ open(): void;
83
+ close(): void;
84
+ /** Move the aria-current attribute to new active page */
85
+ setNavigationAttribute(activePageElement: HTMLElement): void;
86
+ private focusNextItem;
87
+ /**
88
+ * Finds the next activable tab index when navigating with up and down arrow or TAB keys
89
+ * @param currentIndex List item index which currently has focus
90
+ * @param isDown Whether the navigation is going in the down direction or not
91
+ * @param isBackward If recursive function is going backward looking for last activable item in list
92
+ * @returns Index of the next item that will receive focus
93
+ */
94
+ private getNextActivableItemIndex;
95
+ /**
96
+ * Finds if focus has reached end or beginning of list
97
+ * @param currentIndex List item index which currently has focus
98
+ * @param isDown Whether the navigation is going in the down direction or not
99
+ * @returns Can focus move to next item or not
100
+ */
101
+ private canMove;
102
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuComponent, never>;
103
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaoDropdownMenuComponent, "bao-dropdown-menu", never, {}, { "isOpenChange": "isOpenChange"; "isClosedByKeyEvent": "isClosedByKeyEvent"; }, ["_listItems"], ["*"], false>;
104
+ }
105
+ /**
106
+ * Directive to be applied on element that will trigger the opening and closing of menu.
107
+ */
108
+ export declare class BaoDropdownMenuTrigger implements AfterViewInit, OnDestroy {
109
+ private renderer;
110
+ private elementRef;
111
+ private overlay;
112
+ menu: BaoDropdownMenuComponent | null;
113
+ private _overlayRef;
114
+ private _isMenuOpen;
115
+ constructor(renderer: Renderer2, elementRef: ElementRef<HTMLElement>, overlay: Overlay);
116
+ get nativeElement(): HTMLElement;
117
+ escapeKeyEvent(): void;
118
+ /** Enter key event triggers click event which opens menu,
119
+ * then focus is put on first item in the menu */
120
+ enterKeyEvent(): void;
121
+ onClick(): void;
122
+ ngAfterViewInit(): void;
123
+ ngOnDestroy(): void;
124
+ private toggleMenu;
125
+ private closeMenu;
126
+ private openMenu;
127
+ private createOverlay;
128
+ private getOverlayConfig;
129
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuTrigger, never>;
130
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuTrigger, "bao-dropdown-menu-trigger, [bao-dropdown-menu-trigger], [baoDropdownMenuTriggerFor]", never, { "menu": "baoDropdownMenuTriggerFor"; }, {}, never, never, false>;
131
+ }
132
+ /**
133
+ * Sections of list items in menu. Apply proper styling to section's title if there is one.
134
+ */
135
+ export declare class BaoDropdownMenuSection implements AfterViewInit {
136
+ private elementRef;
137
+ private renderer;
138
+ constructor(elementRef: ElementRef<HTMLElement>, renderer: Renderer2);
139
+ get nativeElement(): HTMLElement;
140
+ ngAfterViewInit(): void;
141
+ private insertTitle;
142
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuSection, never>;
143
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuSection, "bao-dropdown-menu-section, [bao-dropdown-menu-section]", never, {}, {}, never, never, false>;
144
+ }
145
+ /**
146
+ * Label of a list item, add css class to apply proper styling.
147
+ */
148
+ export declare class BaoDropdownMenuItemLabel {
149
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuItemLabel, never>;
150
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuItemLabel, "bao-dropdown-menu-item-label, [bao-dropdown-menu-item-label]", never, {}, {}, never, never, false>;
151
+ }
152
+ /**
153
+ * Description of a list item, add css class to apply proper styling.
154
+ */
155
+ export declare class BaoDropdownMenuItemDescription {
156
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuItemDescription, never>;
157
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoDropdownMenuItemDescription, "bao-dropdown-menu-item-description, [bao-dropdown-menu-item-description]", never, {}, {}, never, never, false>;
158
+ }
159
+ /**
160
+ * Divider to separate sections.
161
+ */
162
+ export declare class BaoDropdownMenuDivider implements AfterContentInit {
163
+ private renderer;
164
+ private elementRef;
165
+ constructor(renderer: Renderer2, elementRef: ElementRef<HTMLElement>);
166
+ get nativeElement(): HTMLElement;
167
+ ngAfterContentInit(): void;
168
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuDivider, never>;
169
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaoDropdownMenuDivider, "bao-dropdown-menu-divider, [bao-dropdown-menu-divider]", never, {}, {}, never, never, false>;
170
+ }
@@ -0,0 +1,2 @@
1
+ export * from './module';
2
+ export * from './dropdown-menu.component';
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./dropdown-menu.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/cdk/observers";
5
+ import * as i4 from "@angular/cdk/overlay";
6
+ import * as i5 from "@angular/cdk/portal";
7
+ export declare class BaoDropdownMenuModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoDropdownMenuModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BaoDropdownMenuModule, [typeof i1.BaoDropdownMenuComponent, typeof i1.BaoDropdownMenuTrigger, typeof i1.BaoDropdownMenuItem, typeof i1.BaoDropdownMenuSection, typeof i1.BaoDropdownMenuItemLabel, typeof i1.BaoDropdownMenuItemDescription, typeof i1.BaoDropdownMenuDivider], [typeof i2.CommonModule, typeof i3.ObserversModule, typeof i4.OverlayModule, typeof i5.PortalModule], [typeof i1.BaoDropdownMenuComponent, typeof i1.BaoDropdownMenuTrigger, typeof i1.BaoDropdownMenuItem, typeof i1.BaoDropdownMenuSection, typeof i1.BaoDropdownMenuItemLabel, typeof i1.BaoDropdownMenuItemDescription, typeof i1.BaoDropdownMenuDivider]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<BaoDropdownMenuModule>;
11
+ }
@@ -4,8 +4,9 @@ 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";
7
8
  export declare class BaoModalModule {
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<BaoModalModule, never>;
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]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BaoModalModule, [typeof i1.BaoModalContainer, typeof i2.BaoModalClose], [typeof i3.CommonModule, typeof i4.OverlayModule, typeof i5.PortalModule, typeof i6.BrowserAnimationsModule, typeof i6.NoopAnimationsModule], [typeof i1.BaoModalContainer, typeof i2.BaoModalClose]>;
10
11
  static ɵinj: i0.ɵɵInjectorDeclaration<BaoModalModule>;
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@villedemontreal/angular-ui",
3
- "version": "3.2.0-pre.build.1",
3
+ "version": "3.3.1",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=8.0.0 <15.0.0",
6
6
  "@angular/common": ">=8.0.0 <15.0.0",
package/public-api.d.ts CHANGED
@@ -17,3 +17,4 @@ export * from './lib/avatar';
17
17
  export * from './lib/tabs';
18
18
  export * from './lib/modal';
19
19
  export * from './lib/hyperlink';
20
+ export * from './lib/dropdown-menu';