@villedemontreal/angular-ui 13.0.0 → 13.1.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.
Files changed (89) hide show
  1. package/esm2020/lib/alert/alert.component.mjs +2 -2
  2. package/esm2020/lib/alert/index.mjs +2 -2
  3. package/esm2020/lib/alert/module.mjs +2 -2
  4. package/esm2020/lib/avatar/avatar.component.mjs +2 -2
  5. package/esm2020/lib/avatar/index.mjs +2 -2
  6. package/esm2020/lib/avatar/module.mjs +2 -2
  7. package/esm2020/lib/badge/badge.component.mjs +2 -2
  8. package/esm2020/lib/badge/index.mjs +2 -2
  9. package/esm2020/lib/badge/module.mjs +2 -2
  10. package/esm2020/lib/bao.module.mjs +9 -5
  11. package/esm2020/lib/breadcrumb/breadcrumb.component.mjs +2 -2
  12. package/esm2020/lib/breadcrumb/index.mjs +2 -2
  13. package/esm2020/lib/breadcrumb/module.mjs +2 -2
  14. package/esm2020/lib/button/button.component.mjs +2 -2
  15. package/esm2020/lib/button/index.mjs +2 -2
  16. package/esm2020/lib/button/module.mjs +2 -2
  17. package/esm2020/lib/card/card.component.mjs +2 -2
  18. package/esm2020/lib/card/index.mjs +2 -2
  19. package/esm2020/lib/card/module.mjs +2 -2
  20. package/esm2020/lib/checkbox/checkbox-group.component.mjs +2 -2
  21. package/esm2020/lib/checkbox/checkbox.component.mjs +1 -1
  22. package/esm2020/lib/checkbox/index.mjs +2 -2
  23. package/esm2020/lib/checkbox/module.mjs +2 -2
  24. package/esm2020/lib/common-components/error-text/errorText.component.mjs +2 -2
  25. package/esm2020/lib/common-components/guiding-text/guidingText.component.mjs +2 -2
  26. package/esm2020/lib/common-components/index.mjs +2 -2
  27. package/esm2020/lib/common-components/label-text/labelText.component.mjs +4 -4
  28. package/esm2020/lib/common-components/module.mjs +6 -3
  29. package/esm2020/lib/common-components/title-text/titleText.component.mjs +2 -2
  30. package/esm2020/lib/core/colors.mjs +1 -1
  31. package/esm2020/lib/dropdown-menu/dropdown-menu.component.mjs +9 -2
  32. package/esm2020/lib/dropdown-menu/index.mjs +2 -2
  33. package/esm2020/lib/dropdown-menu/module.mjs +2 -2
  34. package/esm2020/lib/file/file-input.component.mjs +319 -0
  35. package/esm2020/lib/file/file-intl.mjs +65 -0
  36. package/esm2020/lib/file/file-preview.component.mjs +86 -0
  37. package/esm2020/lib/file/index.mjs +10 -0
  38. package/esm2020/lib/file/module.mjs +58 -0
  39. package/esm2020/lib/header-info/header-info.component.mjs +2 -2
  40. package/esm2020/lib/header-info/index.mjs +2 -2
  41. package/esm2020/lib/header-info/module.mjs +2 -2
  42. package/esm2020/lib/hyperlink/hyperlink.component.mjs +2 -2
  43. package/esm2020/lib/hyperlink/index.mjs +2 -2
  44. package/esm2020/lib/hyperlink/module.mjs +2 -2
  45. package/esm2020/lib/icon/bao-icon-registry.mjs +2 -2
  46. package/esm2020/lib/icon/icon.component.mjs +2 -2
  47. package/esm2020/lib/icon/icons-dictionary.mjs +3 -2
  48. package/esm2020/lib/icon/index.mjs +2 -2
  49. package/esm2020/lib/icon/module.mjs +2 -2
  50. package/esm2020/lib/list/index.mjs +2 -2
  51. package/esm2020/lib/list/list.component.mjs +2 -2
  52. package/esm2020/lib/list/module.mjs +2 -2
  53. package/esm2020/lib/modal/index.mjs +2 -2
  54. package/esm2020/lib/modal/modal-animations.mjs +2 -2
  55. package/esm2020/lib/modal/modal-config.mjs +2 -2
  56. package/esm2020/lib/modal/modal-container.mjs +1 -1
  57. package/esm2020/lib/modal/modal-directives.mjs +2 -2
  58. package/esm2020/lib/modal/modal-ref.mjs +1 -1
  59. package/esm2020/lib/modal/modal.mjs +2 -2
  60. package/esm2020/lib/modal/module.mjs +2 -2
  61. package/esm2020/lib/radio/index.mjs +2 -2
  62. package/esm2020/lib/radio/module.mjs +2 -2
  63. package/esm2020/lib/radio/radio-group.component.mjs +2 -2
  64. package/esm2020/lib/radio/radio.component.mjs +1 -1
  65. package/esm2020/lib/shared/enum/display-mode.mjs +1 -1
  66. package/esm2020/lib/shared/index.mjs +2 -2
  67. package/esm2020/lib/summary/index.mjs +2 -2
  68. package/esm2020/lib/summary/list-summary.component.mjs +2 -2
  69. package/esm2020/lib/summary/module.mjs +2 -2
  70. package/esm2020/lib/summary/summary.component.mjs +2 -2
  71. package/esm2020/lib/tabs/index.mjs +2 -2
  72. package/esm2020/lib/tabs/module.mjs +2 -2
  73. package/esm2020/lib/tabs/tabs.component.mjs +2 -2
  74. package/esm2020/lib/tag/index.mjs +2 -2
  75. package/esm2020/lib/tag/module.mjs +2 -2
  76. package/esm2020/lib/tag/tag.component.mjs +2 -2
  77. package/esm2020/public-api.mjs +3 -2
  78. package/fesm2015/villedemontreal-angular-ui.mjs +596 -78
  79. package/fesm2015/villedemontreal-angular-ui.mjs.map +1 -1
  80. package/fesm2020/villedemontreal-angular-ui.mjs +596 -78
  81. package/fesm2020/villedemontreal-angular-ui.mjs.map +1 -1
  82. package/lib/bao.module.d.ts +2 -1
  83. package/lib/file/file-input.component.d.ts +123 -0
  84. package/lib/file/file-intl.d.ts +44 -0
  85. package/lib/file/file-preview.component.d.ts +29 -0
  86. package/lib/file/index.d.ts +4 -0
  87. package/lib/file/module.d.ts +13 -0
  88. package/package.json +1 -1
  89. package/public-api.d.ts +1 -0
@@ -16,8 +16,9 @@ import * as i14 from "./tabs/module";
16
16
  import * as i15 from "./modal/module";
17
17
  import * as i16 from "./hyperlink/module";
18
18
  import * as i17 from "./dropdown-menu/module";
19
+ import * as i18 from "./file/module";
19
20
  export declare class BaoModule {
20
21
  static ɵfac: i0.ɵɵFactoryDeclaration<BaoModule, never>;
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]>;
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 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, typeof i18.BaoFileModule]>;
22
23
  static ɵinj: i0.ɵɵInjectorDeclaration<BaoModule>;
23
24
  }
@@ -0,0 +1,123 @@
1
+ import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { BaoFileIntl } from './file-intl';
4
+ import * as i0 from "@angular/core";
5
+ export declare class BaoFileInputComponent implements AfterContentInit, AfterViewInit, OnDestroy, ControlValueAccessor {
6
+ intl: BaoFileIntl;
7
+ private elementRef;
8
+ private renderer;
9
+ private cdr;
10
+ /**
11
+ * Id of the file input field
12
+ */
13
+ inputId?: string;
14
+ /**
15
+ * Label of field to be displayed above
16
+ */
17
+ label: string;
18
+ /**
19
+ * Size of the file input label
20
+ */
21
+ size: 'small' | 'medium';
22
+ /**
23
+ * Maximum size accepted for uploaded files
24
+ */
25
+ maximalFileSize: number;
26
+ /**
27
+ * Accepted types of files
28
+ */
29
+ acceptedMIMETypes: string[];
30
+ /**
31
+ * Is field required
32
+ */
33
+ required?: boolean;
34
+ /**
35
+ * Is field disabled
36
+ */
37
+ disabled?: boolean;
38
+ /**
39
+ * File selected to be uploaded
40
+ */
41
+ uploadedFile: EventEmitter<File>;
42
+ /**
43
+ * List of files that have been uploaded so far
44
+ */
45
+ private _files;
46
+ /**
47
+ * Form errors when component is used in a form
48
+ */
49
+ private _errorForm;
50
+ /**
51
+ * Error texts
52
+ */
53
+ private _errorTexts;
54
+ /**
55
+ * File input that triggers uploading when clicked
56
+ */
57
+ private uploader;
58
+ private dropzoneElement;
59
+ insertDefaultInstructions: boolean;
60
+ isFileTooBig: boolean;
61
+ isFileTypeInvalid: boolean;
62
+ private _value;
63
+ private _intlChanges;
64
+ private _helperTextId;
65
+ constructor(intl: BaoFileIntl, elementRef: ElementRef<HTMLElement>, renderer: Renderer2, cdr: ChangeDetectorRef);
66
+ get nativeElement(): HTMLElement;
67
+ enterKeyEvent(): void;
68
+ tabKeyEvent(): void;
69
+ shiftTabKeyEvent(): void;
70
+ ngAfterContentInit(): void;
71
+ ngAfterViewInit(): void;
72
+ ngOnDestroy(): void;
73
+ /**
74
+ * Implements ControlValueAccessor interface
75
+ */
76
+ writeValue(obj: any): void;
77
+ /**
78
+ * Implements ControlValueAccessor interface
79
+ */
80
+ registerOnChange(fn: (value: any) => void): void;
81
+ /**
82
+ * Implements ControlValueAccessor interface
83
+ */
84
+ registerOnTouched(fn: any): void;
85
+ /**
86
+ * Implements ControlValueAccessor interface
87
+ */
88
+ setDisabledState(isDisabled: boolean): void;
89
+ uploadFile(file: File): void;
90
+ /**
91
+ * Saves the registerOnChange function so the component can call it whenever it wants.
92
+ */
93
+ propagateChange: (_: any) => void;
94
+ /**
95
+ * Saves the registerOnTouched function so the component can call it whenever it wants.
96
+ */
97
+ propagateTouched: () => void;
98
+ private setValue;
99
+ private setDescribedByAttribute;
100
+ private setErrorTextsAttribute;
101
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFileInputComponent, never>;
102
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaoFileInputComponent, "bao-file-input, [bao-file-input]", never, { "inputId": "id"; "label": "label"; "size": "size"; "maximalFileSize": "maximalFileSize"; "acceptedMIMETypes": "acceptedMIMETypes"; "required": "required"; "disabled": "disabled"; }, { "uploadedFile": "uploadedFile"; }, ["_files", "_errorForm"], ["bao-guiding-text", "bao-file-dropzone-instructions", "bao-error", "*"]>;
103
+ }
104
+ export declare class BaoFileDropDirective {
105
+ fileDrop: EventEmitter<File>;
106
+ private _isDragOver;
107
+ onDragOver(event: DragEvent): void;
108
+ onDragLeave(event: DragEvent): void;
109
+ onDrop(event: DragEvent): void;
110
+ private preventAndStop;
111
+ private getDataTransfer;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFileDropDirective, never>;
113
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoFileDropDirective, "[baoFileDrop]", never, {}, { "fileDrop": "fileDrop"; }, never>;
114
+ }
115
+ export declare class BaoFileDropzoneIntructions implements AfterContentInit {
116
+ private renderer;
117
+ private elementRef;
118
+ constructor(renderer: Renderer2, elementRef: ElementRef<HTMLElement>);
119
+ get nativeElement(): HTMLElement;
120
+ ngAfterContentInit(): void;
121
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFileDropzoneIntructions, never>;
122
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaoFileDropzoneIntructions, "bao-file-dropzone-instructions, [bao-file-dropzone-instructions]", never, {}, {}, never>;
123
+ }
@@ -0,0 +1,44 @@
1
+ import { Optional } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * To modify the labels and text displayed, create a new instance of BaoFileIntl and
6
+ * include it in a custom provider
7
+ */
8
+ export declare class BaoFileIntl {
9
+ /**
10
+ * Stream to emit from when labels are changed. Use this to notify components when the labels have
11
+ * changed after initialization.
12
+ */
13
+ readonly changes: Subject<void>;
14
+ /** The label for button in dropzone */
15
+ dropzoneButtonLabel: string;
16
+ /** The default dropzone instructions */
17
+ defaultDropzoneInstructions: string;
18
+ /** Error message displayed when uploaded file is too large */
19
+ fileTooBigErrorMessage: string;
20
+ /** Error message displayed when uploaded file has an invalid type */
21
+ invalidFileTypeErrorMessage: string;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFileIntl, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaoFileIntl>;
24
+ }
25
+ export declare class BaoFileIntlEnglish extends BaoFileIntl {
26
+ /** The label for button in dropzone */
27
+ dropzoneButtonLabel: string;
28
+ /** The default dropzone instructions */
29
+ defaultDropzoneInstructions: string;
30
+ /** Error message displayed when uploaded file is too large */
31
+ fileTooBigErrorMessage: string;
32
+ /** Error message displayed when uploaded file has an invalid type */
33
+ invalidFileTypeErrorMessage: string;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFileIntlEnglish, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaoFileIntlEnglish>;
36
+ }
37
+ /** @docs-private */
38
+ export declare function BAO_FILE_INTL_PROVIDER_FACTORY(parentIntl: BaoFileIntl): BaoFileIntl;
39
+ /** @docs-private */
40
+ export declare const BAO_FILE_INTL_PROVIDER: {
41
+ provide: typeof BaoFileIntl;
42
+ deps: Optional[][];
43
+ useFactory: typeof BAO_FILE_INTL_PROVIDER_FACTORY;
44
+ };
@@ -0,0 +1,29 @@
1
+ import { AfterContentInit, ElementRef, Renderer2 } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class BaoFilePreviewComponent implements AfterContentInit {
4
+ private elementRef;
5
+ private renderer;
6
+ /**
7
+ * Uploaded file to display in list.
8
+ */
9
+ file: File;
10
+ /**
11
+ * Is file loading
12
+ */
13
+ isLoading: boolean;
14
+ /**
15
+ * True if projected content has no icon and file does not have a thumbnail.
16
+ */
17
+ insertGenericIcon: boolean;
18
+ thumbnailURL: string;
19
+ constructor(elementRef: ElementRef<HTMLElement>, renderer: Renderer2);
20
+ get nativeElement(): HTMLElement;
21
+ get fileSize(): string;
22
+ ngAfterContentInit(): void;
23
+ private setIcon;
24
+ private getThumbnail;
25
+ private formatSize;
26
+ private getSizeAndUnit;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFilePreviewComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaoFilePreviewComponent, "bao-file-preview, [bao-file-preview]", never, { "file": "file"; "isLoading": "isLoading"; }, {}, never, ["bao-icon", "button[bao-button]", "baoDropdownTriggerFor"]>;
29
+ }
@@ -0,0 +1,4 @@
1
+ export * from './module';
2
+ export * from './file-input.component';
3
+ export * from './file-preview.component';
4
+ export * from './file-intl';
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./file-input.component";
3
+ import * as i2 from "./file-preview.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "../dropdown-menu/module";
6
+ import * as i5 from "../common-components/module";
7
+ import * as i6 from "../icon/module";
8
+ import * as i7 from "../button/module";
9
+ export declare class BaoFileModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaoFileModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BaoFileModule, [typeof i1.BaoFileInputComponent, typeof i1.BaoFileDropzoneIntructions, typeof i1.BaoFileDropDirective, typeof i2.BaoFilePreviewComponent], [typeof i3.CommonModule, typeof i4.BaoDropdownMenuModule, typeof i5.BaoCommonComponentsModule, typeof i6.BaoIconModule, typeof i7.BaoButtonModule], [typeof i1.BaoFileInputComponent, typeof i1.BaoFileDropzoneIntructions, typeof i1.BaoFileDropDirective, typeof i2.BaoFilePreviewComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<BaoFileModule>;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@villedemontreal/angular-ui",
3
- "version": "13.0.0",
3
+ "version": "13.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=12.0.0 <14.0.0",
6
6
  "@angular/common": ">=12.0.0 <14.0.0",
package/public-api.d.ts CHANGED
@@ -18,3 +18,4 @@ export * from './lib/tabs';
18
18
  export * from './lib/modal';
19
19
  export * from './lib/hyperlink';
20
20
  export * from './lib/dropdown-menu';
21
+ export * from './lib/file';