@villedemontreal/angular-ui 17.0.0 → 17.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,8 +20,9 @@ import * as i18 from "./file/module";
20
20
  import * as i19 from "./snack-bar/module";
21
21
  import * as i20 from "./system-header/module";
22
22
  import * as i21 from "./message-bar/module";
23
+ import * as i22 from "./pagination/module";
23
24
  export declare class BaoModule {
24
25
  static ɵfac: i0.ɵɵFactoryDeclaration<BaoModule, never>;
25
- 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, typeof i21.BaoMessageBarModule]>;
26
+ 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, typeof i21.BaoMessageBarModule, typeof i22.BaoPaginationModule]>;
26
27
  static ɵinj: i0.ɵɵInjectorDeclaration<BaoModule>;
27
28
  }
@@ -1,11 +1,16 @@
1
- import { ViewContainerRef, Injector } from '@angular/core';
2
1
  import { Direction } from '@angular/cdk/bidi';
3
2
  import { ScrollStrategy } from '@angular/cdk/overlay';
3
+ import { ElementRef, Injector, ViewContainerRef } from '@angular/core';
4
+ export declare const FILTER_MODAL_WIDTH = "360px";
4
5
  export declare enum eModalDesktopWidthSize {
5
6
  SMALL = "bao-modal-sm",// 500px
6
7
  MEDIUM = "bao-modal-md",// 800px
7
8
  LARGE = "bao-modal-lg"
8
9
  }
10
+ export declare enum eModalVariant {
11
+ GLOBAL = "global",
12
+ FILTER = "filter"
13
+ }
9
14
  export declare enum eModalMobileWidthSize {
10
15
  FULL = "bao-modal-mobil-full",// Full width on mobile screen
11
16
  COMPACT = "bao-modal-mobil-compact"
@@ -15,6 +20,8 @@ export interface BaoModalConfig {
15
20
  mobileSize?: eModalMobileWidthSize;
16
21
  data?: unknown;
17
22
  ariaLabelledBy?: string;
23
+ variant?: eModalVariant;
24
+ triggerElement?: ElementRef;
18
25
  }
19
26
  /** Options for where to set focus to automatically on dialog open */
20
27
  export type AutoFocusTarget = 'dialog' | 'modal' | 'first-tabbable' | 'first-heading';
@@ -83,6 +90,10 @@ export declare class BaoModalInitialConfig<D = unknown> {
83
90
  ariaLabelledBy?: string | null;
84
91
  /** Aria label to assign to the dialog element. */
85
92
  ariaLabel?: string | null;
93
+ /** Modal variant (default or filter). */
94
+ variant?: eModalVariant;
95
+ /** Trigger element for connected positioning (used with filter variant). */
96
+ triggerElement?: ElementRef;
86
97
  /**
87
98
  * Where the dialog should focus on open.
88
99
  */
@@ -1,9 +1,9 @@
1
+ import { ComponentType, Overlay, OverlayContainer } from '@angular/cdk/overlay';
1
2
  import { InjectionToken, Injector, OnDestroy, TemplateRef, Type } from '@angular/core';
2
3
  import { Observable, Subject } from 'rxjs';
3
- import { BaoModalContainer, _BaoModalContainerBase } from './modal-container';
4
- import { BaoModalRef } from './modal-ref';
5
4
  import { BaoModalConfig } from './modal-config';
6
- import { ComponentType, Overlay, OverlayContainer } from '@angular/cdk/overlay';
5
+ import { _BaoModalContainerBase, BaoModalContainer } from './modal-container';
6
+ import { BaoModalRef } from './modal-ref';
7
7
  import * as i0 from "@angular/core";
8
8
  /** Injection token that can be used to access the data that was passed in to a modal. */
9
9
  export declare const BAO_MODAL_DATA: InjectionToken<unknown>;
@@ -0,0 +1,2 @@
1
+ export * from './module';
2
+ export * from './pagination.component';
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./pagination.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "../icon/module";
5
+ import * as i4 from "@angular/forms";
6
+ export declare class BaoPaginationModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoPaginationModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BaoPaginationModule, [typeof i1.BaoPaginationComponent], [typeof i2.CommonModule, typeof i3.BaoIconModule, typeof i4.FormsModule], [typeof i1.BaoPaginationComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<BaoPaginationModule>;
10
+ }
@@ -0,0 +1,106 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class BaoPaginationComponent implements OnChanges, OnInit {
4
+ private cdr;
5
+ /**
6
+ * The total number of items.
7
+ */
8
+ totalItems: number;
9
+ /**
10
+ * The number of items per page as selected.
11
+ */
12
+ itemsPerPage: number;
13
+ /**
14
+ * The current page number.
15
+ */
16
+ currentPage: number;
17
+ /**
18
+ * The different page size options.
19
+ */
20
+ pageSizeOptions: number[];
21
+ /**
22
+ * The label for the type of items that are displayed on the page
23
+ */
24
+ itemLabel: string;
25
+ /**
26
+ * If selector for number of items per page should be displayed or not
27
+ */
28
+ showItemsPerPageSelector: boolean;
29
+ /**
30
+ * EventEmitter that triggers when there is a page change and emits page number (index adjusted)
31
+ */
32
+ pageChanged: EventEmitter<number>;
33
+ /**
34
+ * EventEmitter that triggers when the number of items per page is changed.
35
+ */
36
+ itemsPerPageChanged: EventEmitter<number>;
37
+ /**
38
+ * Page number list to display
39
+ */
40
+ displayedPages: number[];
41
+ /**
42
+ * Max number of pages to display
43
+ */
44
+ private _maxPages;
45
+ /**
46
+ * Number of pages in total.
47
+ */
48
+ private _totalPages;
49
+ /**
50
+ * Position of first item being displayed on current page.
51
+ */
52
+ private _startItem;
53
+ /**
54
+ * Position of last item being displayed on current page.
55
+ */
56
+ private _endItem;
57
+ constructor(cdr: ChangeDetectorRef);
58
+ get totalPages(): number;
59
+ set totalPages(value: number);
60
+ get startItem(): number;
61
+ set startItem(value: number);
62
+ get endItem(): number;
63
+ set endItem(value: number);
64
+ get rangeLabel(): string;
65
+ /**
66
+ * Flag that indicates if a previous page exists for the current list
67
+ */
68
+ get hasPrevious(): boolean;
69
+ /**
70
+ * Flag that indicates if a next page exists for the current list
71
+ */
72
+ get hasNext(): boolean;
73
+ ngOnInit(): void;
74
+ /**
75
+ * Update list of displayed pages when current page is changed.
76
+ */
77
+ ngOnChanges(changes: SimpleChanges): void;
78
+ /**
79
+ * Navigate to specific page
80
+ */
81
+ goTo(page: number): void;
82
+ /**
83
+ * Navigate to previous page
84
+ */
85
+ handlePreviousClick(): void;
86
+ /**
87
+ * Navigate to next page
88
+ */
89
+ handleNextClick(): void;
90
+ /**
91
+ * Update all required variables whenever the number of items displayed per page is changed.
92
+ * @param value New amount of items per page
93
+ */
94
+ handlePageSizeChange(value: number): void;
95
+ private updateTotalPages;
96
+ private updateStartItem;
97
+ private updateEndItem;
98
+ /**
99
+ * Generate series of page numbers to display. The list always starts with page 1
100
+ * and ends with last page.
101
+ * Adds negative numbers for ellipsis.
102
+ */
103
+ private buildPageNumbers;
104
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoPaginationComponent, never>;
105
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaoPaginationComponent, "bao-pagination", never, { "totalItems": { "alias": "totalItems"; "required": false; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "itemLabel": { "alias": "itemLabel"; "required": false; }; "showItemsPerPageSelector": { "alias": "showItemsPerPageSelector"; "required": false; }; }, { "pageChanged": "pageChanged"; "itemsPerPageChanged": "itemsPerPageChanged"; }, never, never, false, never>;
106
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@villedemontreal/angular-ui",
3
- "version": "17.0.0",
3
+ "version": "17.1.1",
4
4
  "dependencies": {
5
5
  "tslib": "^2.7.0"
6
6
  },
package/public-api.d.ts CHANGED
@@ -1,24 +1,25 @@
1
- export * from './lib/bao.module';
2
- export * from './lib/button/index';
3
- export * from './lib/icon/index';
4
1
  export * from './lib/alert/index';
2
+ export * from './lib/avatar';
3
+ export * from './lib/badge/index';
4
+ export * from './lib/bao.module';
5
5
  export * from './lib/breadcrumb/index';
6
+ export * from './lib/button/index';
6
7
  export * from './lib/card/index';
7
- export * from './lib/badge/index';
8
- export * from './lib/tag/index';
9
- export * from './lib/header-info/index';
10
- export * from './lib/list/index';
11
8
  export * from './lib/checkbox/index';
12
- export * from './lib/radio/index';
13
9
  export * from './lib/common-components/index';
14
- export * from './lib/summary/index';
15
- export * from './lib/shared';
16
- export * from './lib/avatar';
17
- export * from './lib/tabs';
18
- export * from './lib/modal';
19
- export * from './lib/hyperlink';
20
10
  export * from './lib/dropdown-menu';
21
11
  export * from './lib/file';
12
+ export * from './lib/header-info/index';
13
+ export * from './lib/hyperlink';
14
+ export * from './lib/icon/index';
15
+ export * from './lib/list/index';
16
+ export * from './lib/message-bar';
17
+ export * from './lib/modal';
18
+ export * from './lib/pagination/index';
19
+ export * from './lib/radio/index';
20
+ export * from './lib/shared';
22
21
  export * from './lib/snack-bar';
22
+ export * from './lib/summary/index';
23
23
  export * from './lib/system-header';
24
- export * from './lib/message-bar';
24
+ export * from './lib/tabs';
25
+ export * from './lib/tag/index';