@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
@@ -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 } 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';
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';
@@ -46,7 +46,7 @@ function baoColorToHex(baoColor) {
46
46
  }
47
47
 
48
48
  /*
49
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
49
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
50
50
  * Licensed under the MIT license.
51
51
  * See LICENSE file in the project root for full license information.
52
52
  */
@@ -63,6 +63,7 @@ const ICONS_DCT = {
63
63
  'icon-book': "<path fill-rule='evenodd' d='M11 7.5l-.4-.3A11 11 0 005 5.046v10.993a13 13 0 016 2.007V7.5zm2 0v10.546a13 13 0 016-2.007V5.046A11 11 0 0013.4 7.2l-.4.3zM3 7V4a1 1 0 011-1 13 13 0 017.8 2.6l.2.15.2-.15A13 13 0 0120 3a1 1 0 011 1v3h2a1 1 0 011 1v2a1 1 0 01-2 0V9h-1v8a1 1 0 01-1 1 11 11 0 00-4.583 1H22v-5a1 1 0 012 0v6a1 1 0 01-1 1H1a1 1 0 01-1-1V8a1 1 0 011-1h2zm0 2H2v10h6.583A11 11 0 004 18a1 1 0 01-1-1V9z'/>",
64
64
  'icon-briefcase': "<path fill-rule='evenodd' clip-rule='evenodd' d='M14 2h-4a3 3 0 00-3 3v1H4a3 3 0 00-3 3v2.977a1 1 0 000 .046V19a3 3 0 003 3h16a3 3 0 003-3v-3a1 1 0 10-2 0v3a1 1 0 01-1 1H4a1 1 0 01-1-1v-5.523l8.629 3.451a1 1 0 00.742 0l9.979-3.99a1.002 1.002 0 00.65-.961V9a3 3 0 00-3-3h-3V5a3 3 0 00-3-3zm7 9.323V9a1 1 0 00-1-1H4a1 1 0 00-1 1v2.323l9 3.6 9-3.6zM15 6H9V5a1 1 0 011-1h4a1 1 0 011 1v1z'/>",
65
65
  'icon-calendar': "<path fill-rule='evenodd' d='M20 10H4v9a1 1 0 001 1h14a1 1 0 001-1v-2a1 1 0 012 0v2a3 3 0 01-3 3H5a3 3 0 01-3-3V5a3 3 0 013-3h2V1a1 1 0 112 0v1h6V1a1 1 0 012 0v1h2a3 3 0 013 3v8a1 1 0 01-2 0v-3zm0-2V5a1 1 0 00-1-1h-2v1a1 1 0 01-2 0V4H9v1a1 1 0 11-2 0V4H5a1 1 0 00-1 1v3h16z'/>",
66
+ 'icon-cell-phone': "<path fill-rule='evenodd' clip-rule='evenodd' d='M4 4C4 2.34315 5.34315 1 7 1H17C18.6569 1 20 2.34315 20 4V20C20 21.6569 18.6569 23 17 23H7C5.34315 23 4 21.6569 4 20V4ZM6 4C6 3.44772 6.44772 3 7 3H17C17.5523 3 18 3.44772 18 4V20C18 20.5523 17.5523 21 17 21H7C6.44771 21 6 20.5523 6 20V4ZM12 19C12.5523 19 13 18.5523 13 18C13 17.4477 12.5523 17 12 17C11.4477 17 11 17.4477 11 18C11 18.5523 11.4477 19 12 19Z' />",
66
67
  'icon-check-circle-full': "<path fill-rule='evenodd' d='M12 23C5.925 23 1 18.075 1 12S5.925 1 12 1s11 4.925 11 11-4.925 11-11 11zm3.293-13.707L11 13.586l-1.293-1.293a1 1 0 10-1.414 1.414l2 2a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/>",
67
68
  'icon-check-circle': "<path fill-rule='evenodd' d='M21.542 17.477a1 1 0 01-1.734-.997A8.953 8.953 0 0021 12a9 9 0 10-9 9 8.953 8.953 0 004.484-1.195 1 1 0 01.998 1.733A10.953 10.953 0 0112 23C5.925 23 1 18.075 1 12S5.925 1 12 1s11 4.925 11 11c0 1.948-.508 3.824-1.458 5.477zm-6.25-8.184a1 1 0 011.415 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L11 13.586l4.293-4.293z'/>",
68
69
  'icon-check': "<path fill-rule='evenodd' d='M19.293 6.293a1 1 0 011.414 1.414l-7.947 7.948a1 1 0 01-1.415-1.415l7.948-7.947zm-9.586 11a1 1 0 11-1.414 1.414l-5-5a1 1 0 011.414-1.414l5 5z'/>",
@@ -170,7 +171,7 @@ const ICONS_DCT = {
170
171
  };
171
172
 
172
173
  /*
173
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
174
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
174
175
  * Licensed under the MIT license.
175
176
  * See LICENSE file in the project root for full license information.
176
177
  */
@@ -211,7 +212,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
211
212
  } });
212
213
 
213
214
  /*
214
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
215
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
215
216
  * Licensed under the MIT license.
216
217
  * See LICENSE file in the project root for full license information.
217
218
  */
@@ -363,7 +364,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
363
364
  }] } });
364
365
 
365
366
  /*
366
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
367
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
367
368
  * Licensed under the MIT license.
368
369
  * See LICENSE file in the project root for full license information.
369
370
  */
@@ -383,7 +384,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
383
384
  }] });
384
385
 
385
386
  /*
386
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
387
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
387
388
  * Licensed under the MIT license.
388
389
  * See LICENSE file in the project root for full license information.
389
390
  */
@@ -479,7 +480,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
479
480
  }] } });
480
481
 
481
482
  /*
482
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
483
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
483
484
  * Licensed under the MIT license.
484
485
  * See LICENSE file in the project root for full license information.
485
486
  */
@@ -499,7 +500,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
499
500
  }] });
500
501
 
501
502
  /*
502
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
503
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
503
504
  * Licensed under the MIT license.
504
505
  * See LICENSE file in the project root for full license information.
505
506
  */
@@ -656,7 +657,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
656
657
  }] } });
657
658
 
658
659
  /*
659
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
660
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
660
661
  * Licensed under the MIT license.
661
662
  * See LICENSE file in the project root for full license information.
662
663
  */
@@ -691,13 +692,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
691
692
  }] });
692
693
 
693
694
  /*
694
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
695
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
695
696
  * Licensed under the MIT license.
696
697
  * See LICENSE file in the project root for full license information.
697
698
  */
698
699
 
699
700
  /*
700
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
701
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
701
702
  * Licensed under the MIT license.
702
703
  * See LICENSE file in the project root for full license information.
703
704
  */
@@ -730,7 +731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
730
731
  }] } });
731
732
 
732
733
  /*
733
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
734
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
734
735
  * Licensed under the MIT license.
735
736
  * See LICENSE file in the project root for full license information.
736
737
  */
@@ -750,19 +751,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
750
751
  }] });
751
752
 
752
753
  /*
753
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
754
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
754
755
  * Licensed under the MIT license.
755
756
  * See LICENSE file in the project root for full license information.
756
757
  */
757
758
 
758
759
  /*
759
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
760
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
760
761
  * Licensed under the MIT license.
761
762
  * See LICENSE file in the project root for full license information.
762
763
  */
763
764
 
764
765
  /*
765
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
766
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
766
767
  * Licensed under the MIT license.
767
768
  * See LICENSE file in the project root for full license information.
768
769
  */
@@ -854,7 +855,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
854
855
  }] });
855
856
 
856
857
  /*
857
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
858
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
858
859
  * Licensed under the MIT license.
859
860
  * See LICENSE file in the project root for full license information.
860
861
  */
@@ -888,13 +889,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
888
889
  }] });
889
890
 
890
891
  /*
891
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
892
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
892
893
  * Licensed under the MIT license.
893
894
  * See LICENSE file in the project root for full license information.
894
895
  */
895
896
 
896
897
  /*
897
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
898
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
898
899
  * Licensed under the MIT license.
899
900
  * See LICENSE file in the project root for full license information.
900
901
  */
@@ -908,7 +909,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
908
909
  }] });
909
910
 
910
911
  /*
911
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
912
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
912
913
  * Licensed under the MIT license.
913
914
  * See LICENSE file in the project root for full license information.
914
915
  */
@@ -922,7 +923,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
922
923
  }] });
923
924
 
924
925
  /*
925
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
926
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
926
927
  * Licensed under the MIT license.
927
928
  * See LICENSE file in the project root for full license information.
928
929
  */
@@ -932,16 +933,16 @@ class BaoLabelTextComponent {
932
933
  }
933
934
  }
934
935
  BaoLabelTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoLabelTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
935
- BaoLabelTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoLabelTextComponent, selector: "bao-label, [bao-label]", inputs: { required: "required" }, host: { classAttribute: "bao-label" }, ngImport: i0, template: '<div class="bao-label"><ng-content></ng-content><span *ngIf="required">&nbsp;*</span></div>', isInline: true, styles: [".bao-label{color:#212529!important;font-weight:700;line-height:1.5em;font-size:1rem;margin-bottom:0}.bao-label span{color:#d3310a}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
936
+ BaoLabelTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoLabelTextComponent, selector: "bao-label, [bao-label]", inputs: { required: "required" }, host: { classAttribute: "bao-label" }, ngImport: i0, template: '<ng-content></ng-content><span *ngIf="required">&nbsp;*</span>', isInline: true, styles: [".bao-label{color:#212529!important;font-weight:700;line-height:1.5em;font-size:1rem;margin-bottom:.5rem}.bao-label span{color:#d3310a;margin:0}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
936
937
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoLabelTextComponent, decorators: [{
937
938
  type: Component,
938
- args: [{ selector: 'bao-label, [bao-label]', encapsulation: ViewEncapsulation.None, template: '<div class="bao-label"><ng-content></ng-content><span *ngIf="required">&nbsp;*</span></div>', host: { class: 'bao-label' }, styles: [".bao-label{color:#212529!important;font-weight:700;line-height:1.5em;font-size:1rem;margin-bottom:0}.bao-label span{color:#d3310a}\n"] }]
939
+ args: [{ selector: 'bao-label, [bao-label]', encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content><span *ngIf="required">&nbsp;*</span>', host: { class: 'bao-label' }, styles: [".bao-label{color:#212529!important;font-weight:700;line-height:1.5em;font-size:1rem;margin-bottom:.5rem}.bao-label span{color:#d3310a;margin:0}\n"] }]
939
940
  }], propDecorators: { required: [{
940
941
  type: Input
941
942
  }] } });
942
943
 
943
944
  /*
944
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
945
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
945
946
  * Licensed under the MIT license.
946
947
  * See LICENSE file in the project root for full license information.
947
948
  */
@@ -955,13 +956,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
955
956
  }] });
956
957
 
957
958
  /*
958
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
959
- * Licensed under the MIT license.
960
- * See LICENSE file in the project root for full license information.
961
- */
962
-
963
- /*
964
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
959
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
965
960
  * Licensed under the MIT license.
966
961
  * See LICENSE file in the project root for full license information.
967
962
  */
@@ -992,7 +987,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
992
987
  }] });
993
988
 
994
989
  /*
995
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
990
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
996
991
  * Licensed under the MIT license.
997
992
  * See LICENSE file in the project root for full license information.
998
993
  */
@@ -1347,7 +1342,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1347
1342
  }] });
1348
1343
 
1349
1344
  /*
1350
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1345
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1351
1346
  * Licensed under the MIT license.
1352
1347
  * See LICENSE file in the project root for full license information.
1353
1348
  */
@@ -1375,13 +1370,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1375
1370
  }] });
1376
1371
 
1377
1372
  /*
1378
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1373
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1374
+ * Licensed under the MIT license.
1375
+ * See LICENSE file in the project root for full license information.
1376
+ */
1377
+
1378
+ /*
1379
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1379
1380
  * Licensed under the MIT license.
1380
1381
  * See LICENSE file in the project root for full license information.
1381
1382
  */
1382
1383
 
1383
1384
  /*
1384
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1385
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1385
1386
  * Licensed under the MIT license.
1386
1387
  * See LICENSE file in the project root for full license information.
1387
1388
  */
@@ -1482,7 +1483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1482
1483
  }] });
1483
1484
 
1484
1485
  /*
1485
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1486
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1486
1487
  * Licensed under the MIT license.
1487
1488
  * See LICENSE file in the project root for full license information.
1488
1489
  */
@@ -1519,19 +1520,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1519
1520
  }] });
1520
1521
 
1521
1522
  /*
1522
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1523
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1523
1524
  * Licensed under the MIT license.
1524
1525
  * See LICENSE file in the project root for full license information.
1525
1526
  */
1526
1527
 
1527
1528
  /*
1528
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1529
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1529
1530
  * Licensed under the MIT license.
1530
1531
  * See LICENSE file in the project root for full license information.
1531
1532
  */
1532
1533
 
1533
1534
  /*
1534
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1535
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1535
1536
  * Licensed under the MIT license.
1536
1537
  * See LICENSE file in the project root for full license information.
1537
1538
  */
@@ -1602,7 +1603,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1602
1603
  }] });
1603
1604
 
1604
1605
  /*
1605
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1606
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1606
1607
  * Licensed under the MIT license.
1607
1608
  * See LICENSE file in the project root for full license information.
1608
1609
  */
@@ -1636,13 +1637,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1636
1637
  }] });
1637
1638
 
1638
1639
  /*
1639
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1640
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1640
1641
  * Licensed under the MIT license.
1641
1642
  * See LICENSE file in the project root for full license information.
1642
1643
  */
1643
1644
 
1644
1645
  /*
1645
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1646
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1646
1647
  * Licensed under the MIT license.
1647
1648
  * See LICENSE file in the project root for full license information.
1648
1649
  */
@@ -2170,7 +2171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2170
2171
  }] });
2171
2172
 
2172
2173
  /*
2173
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2174
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2174
2175
  * Licensed under the MIT license.
2175
2176
  * See LICENSE file in the project root for full license information.
2176
2177
  */
@@ -2217,13 +2218,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2217
2218
  }] });
2218
2219
 
2219
2220
  /*
2220
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2221
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2221
2222
  * Licensed under the MIT license.
2222
2223
  * See LICENSE file in the project root for full license information.
2223
2224
  */
2224
2225
 
2225
2226
  /*
2226
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2227
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2227
2228
  * Licensed under the MIT license.
2228
2229
  * See LICENSE file in the project root for full license information.
2229
2230
  */
@@ -2296,7 +2297,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2296
2297
  }] } });
2297
2298
 
2298
2299
  /*
2299
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2300
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2300
2301
  * Licensed under the MIT license.
2301
2302
  * See LICENSE file in the project root for full license information.
2302
2303
  */
@@ -2316,13 +2317,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2316
2317
  }] });
2317
2318
 
2318
2319
  /*
2319
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2320
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2320
2321
  * Licensed under the MIT license.
2321
2322
  * See LICENSE file in the project root for full license information.
2322
2323
  */
2323
2324
 
2324
2325
  /*
2325
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2326
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2326
2327
  * Licensed under the MIT license.
2327
2328
  * See LICENSE file in the project root for full license information.
2328
2329
  */
@@ -2413,7 +2414,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2413
2414
  }] });
2414
2415
 
2415
2416
  /*
2416
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2417
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2417
2418
  * Licensed under the MIT license.
2418
2419
  * See LICENSE file in the project root for full license information.
2419
2420
  */
@@ -2448,7 +2449,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2448
2449
  }] });
2449
2450
 
2450
2451
  /*
2451
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2452
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2452
2453
  * Licensed under the MIT license.
2453
2454
  * See LICENSE file in the project root for full license information.
2454
2455
  */
@@ -2479,13 +2480,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2479
2480
  }] });
2480
2481
 
2481
2482
  /*
2482
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2483
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2483
2484
  * Licensed under the MIT license.
2484
2485
  * See LICENSE file in the project root for full license information.
2485
2486
  */
2486
2487
 
2487
2488
  /*
2488
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2489
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2489
2490
  * Licensed under the MIT license.
2490
2491
  * See LICENSE file in the project root for full license information.
2491
2492
  */
@@ -2585,7 +2586,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2585
2586
  }] } });
2586
2587
 
2587
2588
  /*
2588
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2589
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2589
2590
  * Licensed under the MIT license.
2590
2591
  * See LICENSE file in the project root for full license information.
2591
2592
  */
@@ -2605,13 +2606,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2605
2606
  }] });
2606
2607
 
2607
2608
  /*
2608
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2609
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2609
2610
  * Licensed under the MIT license.
2610
2611
  * See LICENSE file in the project root for full license information.
2611
2612
  */
2612
2613
 
2613
2614
  /*
2614
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2615
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2615
2616
  * Licensed under the MIT license.
2616
2617
  * See LICENSE file in the project root for full license information.
2617
2618
  */
@@ -2904,7 +2905,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2904
2905
  }] } });
2905
2906
 
2906
2907
  /*
2907
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2908
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2908
2909
  * Licensed under the MIT license.
2909
2910
  * See LICENSE file in the project root for full license information.
2910
2911
  */
@@ -2935,13 +2936,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2935
2936
  }] });
2936
2937
 
2937
2938
  /*
2938
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2939
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2939
2940
  * Licensed under the MIT license.
2940
2941
  * See LICENSE file in the project root for full license information.
2941
2942
  */
2942
2943
 
2943
2944
  /*
2944
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2945
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2945
2946
  * Licensed under the MIT license.
2946
2947
  * See LICENSE file in the project root for full license information.
2947
2948
  */
@@ -2969,7 +2970,7 @@ const baoModalAnimations = {
2969
2970
  };
2970
2971
 
2971
2972
  /*
2972
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2973
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2973
2974
  * Licensed under the MIT license.
2974
2975
  * See LICENSE file in the project root for full license information.
2975
2976
  */
@@ -3480,7 +3481,7 @@ function _closeModalVia(ref, interactionType, result) {
3480
3481
  }
3481
3482
 
3482
3483
  /*
3483
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3484
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3484
3485
  * Licensed under the MIT license.
3485
3486
  * See LICENSE file in the project root for full license information.
3486
3487
  */
@@ -3761,7 +3762,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3761
3762
  } });
3762
3763
 
3763
3764
  /*
3764
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3765
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3765
3766
  * Licensed under the MIT license.
3766
3767
  * See LICENSE file in the project root for full license information.
3767
3768
  */
@@ -3842,7 +3843,7 @@ function getClosestDialog(element, openDialogs) {
3842
3843
  }
3843
3844
 
3844
3845
  /*
3845
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3846
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3846
3847
  * Licensed under the MIT license.
3847
3848
  * See LICENSE file in the project root for full license information.
3848
3849
  */
@@ -3879,7 +3880,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3879
3880
  }] });
3880
3881
 
3881
3882
  /*
3882
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3883
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3883
3884
  * Licensed under the MIT license.
3884
3885
  * See LICENSE file in the project root for full license information.
3885
3886
  */
@@ -3952,7 +3953,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3952
3953
  }] } });
3953
3954
 
3954
3955
  /*
3955
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3956
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3956
3957
  * Licensed under the MIT license.
3957
3958
  * See LICENSE file in the project root for full license information.
3958
3959
  */
@@ -3972,13 +3973,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3972
3973
  }] });
3973
3974
 
3974
3975
  /*
3975
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3976
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3976
3977
  * Licensed under the MIT license.
3977
3978
  * See LICENSE file in the project root for full license information.
3978
3979
  */
3979
3980
 
3980
3981
  /*
3981
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3982
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3982
3983
  * Licensed under the MIT license.
3983
3984
  * See LICENSE file in the project root for full license information.
3984
3985
  */
@@ -4376,6 +4377,13 @@ class BaoDropdownMenuTrigger {
4376
4377
  originY: 'top',
4377
4378
  overlayX: 'start',
4378
4379
  overlayY: 'bottom'
4380
+ },
4381
+ {
4382
+ // top-right of the overlay is connected to bottom-left of the origin;
4383
+ originX: 'start',
4384
+ originY: 'bottom',
4385
+ overlayX: 'end',
4386
+ overlayY: 'top'
4379
4387
  }
4380
4388
  ]),
4381
4389
  backdropClass: 'bao-overlay-transparent-backdrop',
@@ -4495,7 +4503,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4495
4503
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; } });
4496
4504
 
4497
4505
  /*
4498
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
4506
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4499
4507
  * Licensed under the MIT license.
4500
4508
  * See LICENSE file in the project root for full license information.
4501
4509
  */
@@ -4535,13 +4543,514 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4535
4543
  }] });
4536
4544
 
4537
4545
  /*
4538
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
4546
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4539
4547
  * Licensed under the MIT license.
4540
4548
  * See LICENSE file in the project root for full license information.
4541
4549
  */
4542
4550
 
4543
4551
  /*
4544
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
4552
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4553
+ * Licensed under the MIT license.
4554
+ * See LICENSE file in the project root for full license information.
4555
+ */
4556
+ const KILO_THRESHOLD = 1000;
4557
+ const MEGA_THRESHOLD = 1000000;
4558
+ class BaoFilePreviewComponent {
4559
+ constructor(elementRef, renderer) {
4560
+ this.elementRef = elementRef;
4561
+ this.renderer = renderer;
4562
+ /**
4563
+ * Is file loading
4564
+ */
4565
+ this.isLoading = false;
4566
+ /**
4567
+ * True if projected content has no icon and file does not have a thumbnail.
4568
+ */
4569
+ this.insertGenericIcon = false;
4570
+ this.thumbnailURL = '';
4571
+ }
4572
+ get nativeElement() {
4573
+ return this.elementRef.nativeElement;
4574
+ }
4575
+ get fileSize() {
4576
+ return this.formatSize(this.file.size);
4577
+ }
4578
+ ngAfterContentInit() {
4579
+ this.getThumbnail();
4580
+ this.setIcon();
4581
+ }
4582
+ setIcon() {
4583
+ // If no icon is in the projected content, generic icon is added
4584
+ const contentIcon = Array.from(this.nativeElement.children.item(0).children).find((el) => el.localName === 'bao-icon');
4585
+ if (!contentIcon) {
4586
+ this.insertGenericIcon = true;
4587
+ }
4588
+ else {
4589
+ this.renderer.addClass(contentIcon, 'bao-file-media');
4590
+ }
4591
+ }
4592
+ getThumbnail() {
4593
+ if (this.file &&
4594
+ (this.file.type === 'image/png' || this.file.type === 'image/jpeg')) {
4595
+ const reader = new FileReader();
4596
+ reader.onload = (event) => {
4597
+ this.thumbnailURL = event.target.result;
4598
+ };
4599
+ reader.onerror = () => {
4600
+ this.thumbnailURL = '';
4601
+ };
4602
+ reader.readAsDataURL(this.file);
4603
+ }
4604
+ }
4605
+ formatSize(size) {
4606
+ if (size >= KILO_THRESHOLD && size / KILO_THRESHOLD < KILO_THRESHOLD) {
4607
+ return this.getSizeAndUnit(size, KILO_THRESHOLD, 'Ko');
4608
+ }
4609
+ const sizeDividedByKoMultiplicator = size / KILO_THRESHOLD;
4610
+ if (sizeDividedByKoMultiplicator >= KILO_THRESHOLD) {
4611
+ const toFixed = sizeDividedByKoMultiplicator > 10 ? 0 : 1;
4612
+ return this.getSizeAndUnit(size, MEGA_THRESHOLD, 'Mo', toFixed);
4613
+ }
4614
+ return `${size} octets`;
4615
+ }
4616
+ getSizeAndUnit(size, multiplicator, unit, toFixed = 0) {
4617
+ return `${(size / multiplicator).toFixed(toFixed)} ${unit}`;
4618
+ }
4619
+ }
4620
+ 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:first-child{margin-top:1rem}.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
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFilePreviewComponent, decorators: [{
4623
+ type: Component,
4624
+ args: [{ selector: 'bao-file-preview, [bao-file-preview]', encapsulation: ViewEncapsulation.None, host: {
4625
+ 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:first-child{margin-top:1rem}.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
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { file: [{
4628
+ type: Input
4629
+ }], isLoading: [{
4630
+ type: Input
4631
+ }] } });
4632
+
4633
+ /*
4634
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4635
+ * Licensed under the MIT license.
4636
+ * See LICENSE file in the project root for full license information.
4637
+ */
4638
+ /**
4639
+ * To modify the labels and text displayed, create a new instance of BaoFileIntl and
4640
+ * include it in a custom provider
4641
+ */
4642
+ class BaoFileIntl {
4643
+ constructor() {
4644
+ /**
4645
+ * Stream to emit from when labels are changed. Use this to notify components when the labels have
4646
+ * changed after initialization.
4647
+ */
4648
+ this.changes = new Subject();
4649
+ /** The label for button in dropzone */
4650
+ this.dropzoneButtonLabel = 'Parcourir';
4651
+ /** The default dropzone instructions */
4652
+ this.defaultDropzoneInstructions = 'ou déposer votre fichier ici';
4653
+ /** Error message displayed when uploaded file is too large */
4654
+ this.fileTooBigErrorMessage = 'La taille de ce fichier est trop grande';
4655
+ /** Error message displayed when uploaded file has an invalid type */
4656
+ this.invalidFileTypeErrorMessage = "Ce format de fichier n'est pas autorisé";
4657
+ }
4658
+ }
4659
+ BaoFileIntl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4660
+ BaoFileIntl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntl, providedIn: 'root' });
4661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntl, decorators: [{
4662
+ type: Injectable,
4663
+ args: [{ providedIn: 'root' }]
4664
+ }] });
4665
+ class BaoFileIntlEnglish extends BaoFileIntl {
4666
+ constructor() {
4667
+ super(...arguments);
4668
+ /** The label for button in dropzone */
4669
+ this.dropzoneButtonLabel = 'Browse';
4670
+ /** The default dropzone instructions */
4671
+ this.defaultDropzoneInstructions = 'or drop your file here';
4672
+ /** Error message displayed when uploaded file is too large */
4673
+ this.fileTooBigErrorMessage = 'The size of this file is too large';
4674
+ /** Error message displayed when uploaded file has an invalid type */
4675
+ this.invalidFileTypeErrorMessage = 'The format of this file is unauthorized';
4676
+ }
4677
+ }
4678
+ BaoFileIntlEnglish.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntlEnglish, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
4679
+ BaoFileIntlEnglish.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntlEnglish });
4680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntlEnglish, decorators: [{
4681
+ type: Injectable
4682
+ }] });
4683
+ /** @docs-private */
4684
+ function BAO_FILE_INTL_PROVIDER_FACTORY(parentIntl) {
4685
+ return parentIntl || new BaoFileIntl();
4686
+ }
4687
+ /** @docs-private */
4688
+ const BAO_FILE_INTL_PROVIDER = {
4689
+ // If there is already an BaoFileIntl available, use that. Otherwise, provide a new one.
4690
+ provide: BaoFileIntl,
4691
+ deps: [[new Optional(), new SkipSelf(), BaoFileIntl]],
4692
+ useFactory: BAO_FILE_INTL_PROVIDER_FACTORY
4693
+ };
4694
+
4695
+ /*
4696
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4697
+ * Licensed under the MIT license.
4698
+ * See LICENSE file in the project root for full license information.
4699
+ */
4700
+ /**
4701
+ * Unique number to generate a unique ID
4702
+ */
4703
+ let fileInputUniqueId = 0;
4704
+ let fileTextUniqueId = 0;
4705
+ class BaoFileInputComponent {
4706
+ constructor(intl, elementRef, renderer, cdr) {
4707
+ this.intl = intl;
4708
+ this.elementRef = elementRef;
4709
+ this.renderer = renderer;
4710
+ this.cdr = cdr;
4711
+ /**
4712
+ * Size of the file input label
4713
+ */
4714
+ this.size = 'medium';
4715
+ /**
4716
+ * Maximum size accepted for uploaded files
4717
+ */
4718
+ this.maximalFileSize = -1;
4719
+ /**
4720
+ * Accepted types of files
4721
+ */
4722
+ this.acceptedMIMETypes = [];
4723
+ /**
4724
+ * Is field required
4725
+ */
4726
+ this.required = false;
4727
+ /**
4728
+ * Is field disabled
4729
+ */
4730
+ this.disabled = false;
4731
+ /**
4732
+ * File selected to be uploaded
4733
+ */
4734
+ this.uploadedFile = new EventEmitter();
4735
+ this.insertDefaultInstructions = false;
4736
+ this.isFileTooBig = false;
4737
+ this.isFileTypeInvalid = false;
4738
+ /**
4739
+ * Saves the registerOnChange function so the component can call it whenever it wants.
4740
+ */
4741
+ // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
4742
+ this.propagateChange = (_) => { };
4743
+ /**
4744
+ * Saves the registerOnTouched function so the component can call it whenever it wants.
4745
+ */
4746
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
4747
+ this.propagateTouched = () => { };
4748
+ this._intlChanges = intl.changes.subscribe(() => this.cdr.markForCheck());
4749
+ }
4750
+ get nativeElement() {
4751
+ return this.elementRef.nativeElement;
4752
+ }
4753
+ enterKeyEvent() {
4754
+ if (document.activeElement.id === this.inputId) {
4755
+ document.getElementById(this.inputId).click();
4756
+ }
4757
+ }
4758
+ tabKeyEvent() {
4759
+ if (document.activeElement.id === this.inputId) {
4760
+ this.renderer.addClass(this.dropzoneElement.nativeElement, 'dropzone-focus');
4761
+ }
4762
+ }
4763
+ shiftTabKeyEvent() {
4764
+ if (document.activeElement.id === this.inputId) {
4765
+ this.renderer.addClass(this.dropzoneElement.nativeElement, 'dropzone-focus');
4766
+ }
4767
+ }
4768
+ ngAfterContentInit() {
4769
+ this._errorForm.changes.subscribe(() => this.setErrorTextsAttribute());
4770
+ if (!this.inputId) {
4771
+ this.inputId = `file-input-${fileInputUniqueId++}`;
4772
+ }
4773
+ // If no content was added for dropzone instructions, add default text.
4774
+ const dropzoneElement = Array.from(this.nativeElement.children).find((el) => el.className === 'file-drop-zone');
4775
+ if (!Array.from(dropzoneElement.children).find(el => el.localName === 'bao-file-dropzone-instructions')) {
4776
+ this.insertDefaultInstructions = true;
4777
+ }
4778
+ this.setDescribedByAttribute();
4779
+ this._files.changes.subscribe((files) => {
4780
+ const filesList = files.map((el) => el.file);
4781
+ this.setValue(filesList);
4782
+ });
4783
+ }
4784
+ ngAfterViewInit() {
4785
+ this._errorTexts.changes.subscribe(() => this.setErrorTextsAttribute());
4786
+ }
4787
+ ngOnDestroy() {
4788
+ this._intlChanges.unsubscribe();
4789
+ }
4790
+ /**
4791
+ * Implements ControlValueAccessor interface
4792
+ */
4793
+ writeValue(obj) {
4794
+ this._value = obj;
4795
+ }
4796
+ /**
4797
+ * Implements ControlValueAccessor interface
4798
+ */
4799
+ registerOnChange(fn) {
4800
+ this.propagateChange = fn;
4801
+ }
4802
+ /**
4803
+ * Implements ControlValueAccessor interface
4804
+ */
4805
+ registerOnTouched(fn) {
4806
+ this.propagateTouched = fn;
4807
+ }
4808
+ /**
4809
+ * Implements ControlValueAccessor interface
4810
+ */
4811
+ setDisabledState(isDisabled) {
4812
+ this.disabled = isDisabled;
4813
+ }
4814
+ uploadFile(file) {
4815
+ if (!this.disabled) {
4816
+ this.isFileTypeInvalid = false;
4817
+ this.isFileTooBig = false;
4818
+ this.uploader.nativeElement.value = '';
4819
+ if (this.maximalFileSize > 0 && file.size > this.maximalFileSize) {
4820
+ this.isFileTooBig = true;
4821
+ }
4822
+ if (this.acceptedMIMETypes.length > 0 &&
4823
+ this.acceptedMIMETypes.indexOf(file.type) < 0) {
4824
+ this.isFileTypeInvalid = true;
4825
+ }
4826
+ if (!this.isFileTooBig && !this.isFileTypeInvalid) {
4827
+ this.uploadedFile.emit(file);
4828
+ }
4829
+ }
4830
+ }
4831
+ setValue(value) {
4832
+ this._value = value;
4833
+ this.propagateChange(this._value);
4834
+ this.propagateTouched();
4835
+ }
4836
+ setDescribedByAttribute() {
4837
+ const helperText = Array.from(this.nativeElement.children).find((el) => el.localName === 'bao-guiding-text').firstElementChild;
4838
+ if (helperText) {
4839
+ this._helperTextId = `bao-guiding-text-${fileTextUniqueId++}`;
4840
+ this.renderer.setAttribute(helperText, 'id', this._helperTextId);
4841
+ const inputElement = Array.from(this.nativeElement.children)
4842
+ .find((el) => el.className == 'file-drop-zone')
4843
+ .children.item(1);
4844
+ this.renderer.setAttribute(inputElement, 'aria-describedby', this._helperTextId);
4845
+ }
4846
+ }
4847
+ setErrorTextsAttribute() {
4848
+ const textsIds = [];
4849
+ const errors = Array.from(this.nativeElement.children).filter((el) => el.localName == 'bao-error');
4850
+ errors.forEach((errorText) => {
4851
+ const errorTextId = `bao-error-${fileTextUniqueId++}`;
4852
+ this.renderer.setAttribute(errorText.firstElementChild, 'id', errorTextId);
4853
+ textsIds.push(errorTextId);
4854
+ });
4855
+ const inputElement = Array.from(this.nativeElement.children)
4856
+ .find((el) => el.classList.contains('file-drop-zone'))
4857
+ .children.item(1);
4858
+ if (this._helperTextId) {
4859
+ textsIds.unshift(this._helperTextId);
4860
+ }
4861
+ this.renderer.setAttribute(inputElement, 'aria-describedby', textsIds.join(' '));
4862
+ }
4863
+ }
4864
+ BaoFileInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileInputComponent, deps: [{ token: BaoFileIntl }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
4865
+ BaoFileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaoFileInputComponent, selector: "bao-file-input, [bao-file-input]", inputs: { inputId: ["id", "inputId"], label: "label", size: "size", maximalFileSize: "maximalFileSize", acceptedMIMETypes: "acceptedMIMETypes", required: "required", disabled: "disabled" }, outputs: { uploadedFile: "uploadedFile" }, host: { listeners: { "window:keyup.enter": "enterKeyEvent()", "window:keyup.tab": "tabKeyEvent()", "window:keyup.shift.tab": "shiftTabKeyEvent()" }, properties: { "class.bao-file-label-small": "size === \"small\"", "class.bao-file-label-medium": "size === \"medium\"", "class.bao-file-input-disabled": "disabled" }, classAttribute: "bao-file-input" }, providers: [
4866
+ {
4867
+ provide: NG_VALUE_ACCESSOR,
4868
+ // tslint:disable-next-line:no-forward-ref
4869
+ useExisting: forwardRef(() => BaoFileInputComponent),
4870
+ multi: true
4871
+ }
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 });
4873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileInputComponent, decorators: [{
4874
+ type: Component,
4875
+ args: [{ selector: 'bao-file-input, [bao-file-input]', providers: [
4876
+ {
4877
+ provide: NG_VALUE_ACCESSOR,
4878
+ // tslint:disable-next-line:no-forward-ref
4879
+ useExisting: forwardRef(() => BaoFileInputComponent),
4880
+ multi: true
4881
+ }
4882
+ ], encapsulation: ViewEncapsulation.None, host: {
4883
+ class: 'bao-file-input',
4884
+ '[class.bao-file-label-small]': 'size === "small"',
4885
+ '[class.bao-file-label-medium]': 'size === "medium"',
4886
+ '[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"] }]
4888
+ }], ctorParameters: function () { return [{ type: BaoFileIntl }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputId: [{
4889
+ type: Input,
4890
+ args: ['id']
4891
+ }], label: [{
4892
+ type: Input
4893
+ }], size: [{
4894
+ type: Input
4895
+ }], maximalFileSize: [{
4896
+ type: Input
4897
+ }], acceptedMIMETypes: [{
4898
+ type: Input
4899
+ }], required: [{
4900
+ type: Input
4901
+ }], disabled: [{
4902
+ type: Input
4903
+ }], uploadedFile: [{
4904
+ type: Output
4905
+ }], _files: [{
4906
+ type: ContentChildren,
4907
+ args: [BaoFilePreviewComponent, { descendants: true }]
4908
+ }], _errorForm: [{
4909
+ type: ContentChildren,
4910
+ args: [BaoErrorTextComponent, { descendants: true }]
4911
+ }], _errorTexts: [{
4912
+ type: ViewChildren,
4913
+ args: [BaoErrorTextComponent]
4914
+ }], uploader: [{
4915
+ type: ViewChild,
4916
+ args: ['uploader', { static: false }]
4917
+ }], dropzoneElement: [{
4918
+ type: ViewChild,
4919
+ args: ['dropzone', { static: false }]
4920
+ }], enterKeyEvent: [{
4921
+ type: HostListener,
4922
+ args: ['window:keyup.enter']
4923
+ }], tabKeyEvent: [{
4924
+ type: HostListener,
4925
+ args: ['window:keyup.tab']
4926
+ }], shiftTabKeyEvent: [{
4927
+ type: HostListener,
4928
+ args: ['window:keyup.shift.tab']
4929
+ }] } });
4930
+ class BaoFileDropDirective {
4931
+ constructor() {
4932
+ this.fileDrop = new EventEmitter();
4933
+ this._isDragOver = false;
4934
+ }
4935
+ onDragOver(event) {
4936
+ this.preventAndStop(event);
4937
+ this._isDragOver = true;
4938
+ }
4939
+ onDragLeave(event) {
4940
+ this.preventAndStop(event);
4941
+ this._isDragOver = false;
4942
+ }
4943
+ onDrop(event) {
4944
+ this.preventAndStop(event);
4945
+ this._isDragOver = false;
4946
+ const transfer = this.getDataTransfer(event);
4947
+ this.fileDrop.emit(transfer.files[0]);
4948
+ }
4949
+ preventAndStop(event) {
4950
+ event.preventDefault();
4951
+ event.stopPropagation();
4952
+ }
4953
+ getDataTransfer(event) {
4954
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
4955
+ return event.dataTransfer
4956
+ ? event.dataTransfer
4957
+ : event.originalEvent.dataTransfer;
4958
+ }
4959
+ }
4960
+ BaoFileDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4961
+ BaoFileDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoFileDropDirective, selector: "[baoFileDrop]", outputs: { fileDrop: "fileDrop" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "class.drag-over": "_isDragOver == true" } }, ngImport: i0 });
4962
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropDirective, decorators: [{
4963
+ type: Directive,
4964
+ args: [{
4965
+ selector: '[baoFileDrop]',
4966
+ host: { '[class.drag-over]': '_isDragOver == true' }
4967
+ }]
4968
+ }], propDecorators: { fileDrop: [{
4969
+ type: Output
4970
+ }], onDragOver: [{
4971
+ type: HostListener,
4972
+ args: ['dragover', ['$event']]
4973
+ }], onDragLeave: [{
4974
+ type: HostListener,
4975
+ args: ['dragleave', ['$event']]
4976
+ }], onDrop: [{
4977
+ type: HostListener,
4978
+ args: ['drop', ['$event']]
4979
+ }] } });
4980
+ class BaoFileDropzoneIntructions {
4981
+ constructor(renderer, elementRef) {
4982
+ this.renderer = renderer;
4983
+ this.elementRef = elementRef;
4984
+ }
4985
+ get nativeElement() {
4986
+ return this.elementRef.nativeElement;
4987
+ }
4988
+ ngAfterContentInit() {
4989
+ this.renderer.setAttribute(this.nativeElement, 'aria-hidden', 'true');
4990
+ }
4991
+ }
4992
+ BaoFileDropzoneIntructions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropzoneIntructions, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
4993
+ BaoFileDropzoneIntructions.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaoFileDropzoneIntructions, selector: "bao-file-dropzone-instructions, [bao-file-dropzone-instructions]", host: { classAttribute: "bao-file-dropzone-instructions" }, ngImport: i0 });
4994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropzoneIntructions, decorators: [{
4995
+ type: Directive,
4996
+ args: [{
4997
+ selector: 'bao-file-dropzone-instructions, [bao-file-dropzone-instructions]',
4998
+ host: {
4999
+ class: 'bao-file-dropzone-instructions'
5000
+ }
5001
+ }]
5002
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; } });
5003
+
5004
+ /*
5005
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5006
+ * Licensed under the MIT license.
5007
+ * See LICENSE file in the project root for full license information.
5008
+ */
5009
+ const FILE_DIRECTIVES = [
5010
+ BaoFileInputComponent,
5011
+ BaoFileDropzoneIntructions,
5012
+ BaoFileDropDirective,
5013
+ BaoFilePreviewComponent
5014
+ ];
5015
+ class BaoFileModule {
5016
+ }
5017
+ BaoFileModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5018
+ BaoFileModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, declarations: [BaoFileInputComponent,
5019
+ BaoFileDropzoneIntructions,
5020
+ BaoFileDropDirective,
5021
+ BaoFilePreviewComponent], imports: [CommonModule,
5022
+ BaoDropdownMenuModule,
5023
+ BaoCommonComponentsModule,
5024
+ BaoIconModule,
5025
+ BaoButtonModule], exports: [BaoFileInputComponent,
5026
+ BaoFileDropzoneIntructions,
5027
+ BaoFileDropDirective,
5028
+ BaoFilePreviewComponent] });
5029
+ BaoFileModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, providers: [BAO_FILE_INTL_PROVIDER], imports: [[
5030
+ CommonModule,
5031
+ BaoDropdownMenuModule,
5032
+ BaoCommonComponentsModule,
5033
+ BaoIconModule,
5034
+ BaoButtonModule
5035
+ ]] });
5036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, decorators: [{
5037
+ type: NgModule,
5038
+ args: [{
5039
+ imports: [
5040
+ CommonModule,
5041
+ BaoDropdownMenuModule,
5042
+ BaoCommonComponentsModule,
5043
+ BaoIconModule,
5044
+ BaoButtonModule
5045
+ ],
5046
+ declarations: [FILE_DIRECTIVES],
5047
+ exports: [FILE_DIRECTIVES],
5048
+ providers: [BAO_FILE_INTL_PROVIDER]
5049
+ }]
5050
+ }] });
5051
+
5052
+ /*
5053
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4545
5054
  * Licensed under the MIT license.
4546
5055
  * See LICENSE file in the project root for full license information.
4547
5056
  */
@@ -4568,7 +5077,8 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
4568
5077
  BaoTabsModule,
4569
5078
  BaoModalModule,
4570
5079
  BaoHyperlinkModule,
4571
- BaoDropdownMenuModule
5080
+ BaoDropdownMenuModule,
5081
+ BaoFileModule
4572
5082
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
4573
5083
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
4574
5084
  ] });
@@ -4594,7 +5104,8 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
4594
5104
  BaoTabsModule,
4595
5105
  BaoModalModule,
4596
5106
  BaoHyperlinkModule,
4597
- BaoDropdownMenuModule
5107
+ BaoDropdownMenuModule,
5108
+ BaoFileModule
4598
5109
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
4599
5110
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
4600
5111
  ] });
@@ -4625,7 +5136,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4625
5136
  BaoTabsModule,
4626
5137
  BaoModalModule,
4627
5138
  BaoHyperlinkModule,
4628
- BaoDropdownMenuModule
5139
+ BaoDropdownMenuModule,
5140
+ BaoFileModule
4629
5141
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
4630
5142
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
4631
5143
  ]
@@ -4633,7 +5145,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4633
5145
  }] });
4634
5146
 
4635
5147
  /*
4636
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5148
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4637
5149
  * Licensed under the MIT license.
4638
5150
  * See LICENSE file in the project root for full license information.
4639
5151
  */
@@ -4658,7 +5170,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4658
5170
  }] } });
4659
5171
 
4660
5172
  /*
4661
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5173
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4662
5174
  * Licensed under the MIT license.
4663
5175
  * See LICENSE file in the project root for full license information.
4664
5176
  */
@@ -4678,25 +5190,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4678
5190
  }] });
4679
5191
 
4680
5192
  /*
4681
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5193
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5194
+ * Licensed under the MIT license.
5195
+ * See LICENSE file in the project root for full license information.
5196
+ */
5197
+
5198
+ /*
5199
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4682
5200
  * Licensed under the MIT license.
4683
5201
  * See LICENSE file in the project root for full license information.
4684
5202
  */
4685
5203
 
4686
5204
  /*
4687
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5205
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4688
5206
  * Licensed under the MIT license.
4689
5207
  * See LICENSE file in the project root for full license information.
4690
5208
  */
4691
5209
 
4692
5210
  /*
4693
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5211
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4694
5212
  * Licensed under the MIT license.
4695
5213
  * See LICENSE file in the project root for full license information.
4696
5214
  */
4697
5215
 
4698
5216
  /*
4699
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5217
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4700
5218
  * Licensed under the MIT license.
4701
5219
  * See LICENSE file in the project root for full license information.
4702
5220
  */
@@ -4705,5 +5223,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4705
5223
  * Generated bundle index. Do not edit.
4706
5224
  */
4707
5225
 
4708
- export { 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, 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 };
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 };
4709
5227
  //# sourceMappingURL=villedemontreal-angular-ui.mjs.map