@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';
@@ -45,7 +45,7 @@ function baoColorToHex(baoColor) {
45
45
  }
46
46
 
47
47
  /*
48
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
48
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
49
49
  * Licensed under the MIT license.
50
50
  * See LICENSE file in the project root for full license information.
51
51
  */
@@ -62,6 +62,7 @@ const ICONS_DCT = {
62
62
  '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'/>",
63
63
  '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'/>",
64
64
  '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'/>",
65
+ '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' />",
65
66
  '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'/>",
66
67
  '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'/>",
67
68
  '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'/>",
@@ -169,7 +170,7 @@ const ICONS_DCT = {
169
170
  };
170
171
 
171
172
  /*
172
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
173
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
173
174
  * Licensed under the MIT license.
174
175
  * See LICENSE file in the project root for full license information.
175
176
  */
@@ -208,7 +209,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
208
209
  }] }, { type: i1.DomSanitizer }]; } });
209
210
 
210
211
  /*
211
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
212
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
212
213
  * Licensed under the MIT license.
213
214
  * See LICENSE file in the project root for full license information.
214
215
  */
@@ -360,7 +361,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
360
361
  }] } });
361
362
 
362
363
  /*
363
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
364
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
364
365
  * Licensed under the MIT license.
365
366
  * See LICENSE file in the project root for full license information.
366
367
  */
@@ -380,7 +381,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
380
381
  }] });
381
382
 
382
383
  /*
383
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
384
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
384
385
  * Licensed under the MIT license.
385
386
  * See LICENSE file in the project root for full license information.
386
387
  */
@@ -476,7 +477,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
476
477
  }] } });
477
478
 
478
479
  /*
479
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
480
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
480
481
  * Licensed under the MIT license.
481
482
  * See LICENSE file in the project root for full license information.
482
483
  */
@@ -496,7 +497,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
496
497
  }] });
497
498
 
498
499
  /*
499
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
500
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
500
501
  * Licensed under the MIT license.
501
502
  * See LICENSE file in the project root for full license information.
502
503
  */
@@ -653,7 +654,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
653
654
  }] } });
654
655
 
655
656
  /*
656
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
657
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
657
658
  * Licensed under the MIT license.
658
659
  * See LICENSE file in the project root for full license information.
659
660
  */
@@ -688,13 +689,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
688
689
  }] });
689
690
 
690
691
  /*
691
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
692
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
692
693
  * Licensed under the MIT license.
693
694
  * See LICENSE file in the project root for full license information.
694
695
  */
695
696
 
696
697
  /*
697
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
698
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
698
699
  * Licensed under the MIT license.
699
700
  * See LICENSE file in the project root for full license information.
700
701
  */
@@ -727,7 +728,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
727
728
  }] } });
728
729
 
729
730
  /*
730
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
731
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
731
732
  * Licensed under the MIT license.
732
733
  * See LICENSE file in the project root for full license information.
733
734
  */
@@ -747,19 +748,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
747
748
  }] });
748
749
 
749
750
  /*
750
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
751
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
751
752
  * Licensed under the MIT license.
752
753
  * See LICENSE file in the project root for full license information.
753
754
  */
754
755
 
755
756
  /*
756
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
757
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
757
758
  * Licensed under the MIT license.
758
759
  * See LICENSE file in the project root for full license information.
759
760
  */
760
761
 
761
762
  /*
762
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
763
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
763
764
  * Licensed under the MIT license.
764
765
  * See LICENSE file in the project root for full license information.
765
766
  */
@@ -851,7 +852,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
851
852
  }] });
852
853
 
853
854
  /*
854
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
855
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
855
856
  * Licensed under the MIT license.
856
857
  * See LICENSE file in the project root for full license information.
857
858
  */
@@ -885,13 +886,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
885
886
  }] });
886
887
 
887
888
  /*
888
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
889
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
889
890
  * Licensed under the MIT license.
890
891
  * See LICENSE file in the project root for full license information.
891
892
  */
892
893
 
893
894
  /*
894
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
895
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
895
896
  * Licensed under the MIT license.
896
897
  * See LICENSE file in the project root for full license information.
897
898
  */
@@ -905,7 +906,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
905
906
  }] });
906
907
 
907
908
  /*
908
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
909
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
909
910
  * Licensed under the MIT license.
910
911
  * See LICENSE file in the project root for full license information.
911
912
  */
@@ -919,7 +920,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
919
920
  }] });
920
921
 
921
922
  /*
922
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
923
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
923
924
  * Licensed under the MIT license.
924
925
  * See LICENSE file in the project root for full license information.
925
926
  */
@@ -929,16 +930,16 @@ class BaoLabelTextComponent {
929
930
  }
930
931
  }
931
932
  BaoLabelTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoLabelTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
932
- 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 });
933
+ 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 });
933
934
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoLabelTextComponent, decorators: [{
934
935
  type: Component,
935
- 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"] }]
936
+ 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"] }]
936
937
  }], propDecorators: { required: [{
937
938
  type: Input
938
939
  }] } });
939
940
 
940
941
  /*
941
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
942
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
942
943
  * Licensed under the MIT license.
943
944
  * See LICENSE file in the project root for full license information.
944
945
  */
@@ -952,13 +953,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
952
953
  }] });
953
954
 
954
955
  /*
955
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
956
- * Licensed under the MIT license.
957
- * See LICENSE file in the project root for full license information.
958
- */
959
-
960
- /*
961
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
956
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
962
957
  * Licensed under the MIT license.
963
958
  * See LICENSE file in the project root for full license information.
964
959
  */
@@ -989,7 +984,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
989
984
  }] });
990
985
 
991
986
  /*
992
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
987
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
993
988
  * Licensed under the MIT license.
994
989
  * See LICENSE file in the project root for full license information.
995
990
  */
@@ -1344,7 +1339,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1344
1339
  }] });
1345
1340
 
1346
1341
  /*
1347
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1342
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1348
1343
  * Licensed under the MIT license.
1349
1344
  * See LICENSE file in the project root for full license information.
1350
1345
  */
@@ -1372,13 +1367,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1372
1367
  }] });
1373
1368
 
1374
1369
  /*
1375
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1370
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1371
+ * Licensed under the MIT license.
1372
+ * See LICENSE file in the project root for full license information.
1373
+ */
1374
+
1375
+ /*
1376
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1376
1377
  * Licensed under the MIT license.
1377
1378
  * See LICENSE file in the project root for full license information.
1378
1379
  */
1379
1380
 
1380
1381
  /*
1381
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1382
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1382
1383
  * Licensed under the MIT license.
1383
1384
  * See LICENSE file in the project root for full license information.
1384
1385
  */
@@ -1479,7 +1480,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1479
1480
  }] });
1480
1481
 
1481
1482
  /*
1482
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1483
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1483
1484
  * Licensed under the MIT license.
1484
1485
  * See LICENSE file in the project root for full license information.
1485
1486
  */
@@ -1516,19 +1517,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1516
1517
  }] });
1517
1518
 
1518
1519
  /*
1519
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1520
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1520
1521
  * Licensed under the MIT license.
1521
1522
  * See LICENSE file in the project root for full license information.
1522
1523
  */
1523
1524
 
1524
1525
  /*
1525
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1526
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1526
1527
  * Licensed under the MIT license.
1527
1528
  * See LICENSE file in the project root for full license information.
1528
1529
  */
1529
1530
 
1530
1531
  /*
1531
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1532
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1532
1533
  * Licensed under the MIT license.
1533
1534
  * See LICENSE file in the project root for full license information.
1534
1535
  */
@@ -1599,7 +1600,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1599
1600
  }] });
1600
1601
 
1601
1602
  /*
1602
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1603
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1603
1604
  * Licensed under the MIT license.
1604
1605
  * See LICENSE file in the project root for full license information.
1605
1606
  */
@@ -1633,13 +1634,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1633
1634
  }] });
1634
1635
 
1635
1636
  /*
1636
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1637
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1637
1638
  * Licensed under the MIT license.
1638
1639
  * See LICENSE file in the project root for full license information.
1639
1640
  */
1640
1641
 
1641
1642
  /*
1642
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
1643
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
1643
1644
  * Licensed under the MIT license.
1644
1645
  * See LICENSE file in the project root for full license information.
1645
1646
  */
@@ -2165,7 +2166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2165
2166
  }] });
2166
2167
 
2167
2168
  /*
2168
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2169
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2169
2170
  * Licensed under the MIT license.
2170
2171
  * See LICENSE file in the project root for full license information.
2171
2172
  */
@@ -2212,13 +2213,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2212
2213
  }] });
2213
2214
 
2214
2215
  /*
2215
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2216
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2216
2217
  * Licensed under the MIT license.
2217
2218
  * See LICENSE file in the project root for full license information.
2218
2219
  */
2219
2220
 
2220
2221
  /*
2221
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2222
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2222
2223
  * Licensed under the MIT license.
2223
2224
  * See LICENSE file in the project root for full license information.
2224
2225
  */
@@ -2291,7 +2292,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2291
2292
  }] } });
2292
2293
 
2293
2294
  /*
2294
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2295
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2295
2296
  * Licensed under the MIT license.
2296
2297
  * See LICENSE file in the project root for full license information.
2297
2298
  */
@@ -2311,13 +2312,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2311
2312
  }] });
2312
2313
 
2313
2314
  /*
2314
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2315
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2315
2316
  * Licensed under the MIT license.
2316
2317
  * See LICENSE file in the project root for full license information.
2317
2318
  */
2318
2319
 
2319
2320
  /*
2320
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2321
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2321
2322
  * Licensed under the MIT license.
2322
2323
  * See LICENSE file in the project root for full license information.
2323
2324
  */
@@ -2408,7 +2409,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2408
2409
  }] });
2409
2410
 
2410
2411
  /*
2411
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2412
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2412
2413
  * Licensed under the MIT license.
2413
2414
  * See LICENSE file in the project root for full license information.
2414
2415
  */
@@ -2443,7 +2444,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2443
2444
  }] });
2444
2445
 
2445
2446
  /*
2446
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2447
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2447
2448
  * Licensed under the MIT license.
2448
2449
  * See LICENSE file in the project root for full license information.
2449
2450
  */
@@ -2474,13 +2475,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2474
2475
  }] });
2475
2476
 
2476
2477
  /*
2477
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2478
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2478
2479
  * Licensed under the MIT license.
2479
2480
  * See LICENSE file in the project root for full license information.
2480
2481
  */
2481
2482
 
2482
2483
  /*
2483
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2484
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2484
2485
  * Licensed under the MIT license.
2485
2486
  * See LICENSE file in the project root for full license information.
2486
2487
  */
@@ -2580,7 +2581,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2580
2581
  }] } });
2581
2582
 
2582
2583
  /*
2583
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2584
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2584
2585
  * Licensed under the MIT license.
2585
2586
  * See LICENSE file in the project root for full license information.
2586
2587
  */
@@ -2600,13 +2601,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2600
2601
  }] });
2601
2602
 
2602
2603
  /*
2603
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2604
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2604
2605
  * Licensed under the MIT license.
2605
2606
  * See LICENSE file in the project root for full license information.
2606
2607
  */
2607
2608
 
2608
2609
  /*
2609
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2610
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2610
2611
  * Licensed under the MIT license.
2611
2612
  * See LICENSE file in the project root for full license information.
2612
2613
  */
@@ -2899,7 +2900,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2899
2900
  }] } });
2900
2901
 
2901
2902
  /*
2902
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2903
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2903
2904
  * Licensed under the MIT license.
2904
2905
  * See LICENSE file in the project root for full license information.
2905
2906
  */
@@ -2930,13 +2931,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2930
2931
  }] });
2931
2932
 
2932
2933
  /*
2933
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2934
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2934
2935
  * Licensed under the MIT license.
2935
2936
  * See LICENSE file in the project root for full license information.
2936
2937
  */
2937
2938
 
2938
2939
  /*
2939
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2940
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2940
2941
  * Licensed under the MIT license.
2941
2942
  * See LICENSE file in the project root for full license information.
2942
2943
  */
@@ -2964,7 +2965,7 @@ const baoModalAnimations = {
2964
2965
  };
2965
2966
 
2966
2967
  /*
2967
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
2968
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
2968
2969
  * Licensed under the MIT license.
2969
2970
  * See LICENSE file in the project root for full license information.
2970
2971
  */
@@ -3467,7 +3468,7 @@ function _closeModalVia(ref, interactionType, result) {
3467
3468
  }
3468
3469
 
3469
3470
  /*
3470
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3471
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3471
3472
  * Licensed under the MIT license.
3472
3473
  * See LICENSE file in the project root for full license information.
3473
3474
  */
@@ -3749,7 +3750,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3749
3750
  }] }]; } });
3750
3751
 
3751
3752
  /*
3752
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3753
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3753
3754
  * Licensed under the MIT license.
3754
3755
  * See LICENSE file in the project root for full license information.
3755
3756
  */
@@ -3828,7 +3829,7 @@ function getClosestDialog(element, openDialogs) {
3828
3829
  }
3829
3830
 
3830
3831
  /*
3831
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3832
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3832
3833
  * Licensed under the MIT license.
3833
3834
  * See LICENSE file in the project root for full license information.
3834
3835
  */
@@ -3865,7 +3866,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3865
3866
  }] });
3866
3867
 
3867
3868
  /*
3868
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3869
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3869
3870
  * Licensed under the MIT license.
3870
3871
  * See LICENSE file in the project root for full license information.
3871
3872
  */
@@ -3938,7 +3939,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3938
3939
  }] } });
3939
3940
 
3940
3941
  /*
3941
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3942
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3942
3943
  * Licensed under the MIT license.
3943
3944
  * See LICENSE file in the project root for full license information.
3944
3945
  */
@@ -3958,13 +3959,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3958
3959
  }] });
3959
3960
 
3960
3961
  /*
3961
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3962
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3962
3963
  * Licensed under the MIT license.
3963
3964
  * See LICENSE file in the project root for full license information.
3964
3965
  */
3965
3966
 
3966
3967
  /*
3967
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
3968
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
3968
3969
  * Licensed under the MIT license.
3969
3970
  * See LICENSE file in the project root for full license information.
3970
3971
  */
@@ -4362,6 +4363,13 @@ class BaoDropdownMenuTrigger {
4362
4363
  originY: 'top',
4363
4364
  overlayX: 'start',
4364
4365
  overlayY: 'bottom'
4366
+ },
4367
+ {
4368
+ // top-right of the overlay is connected to bottom-left of the origin;
4369
+ originX: 'start',
4370
+ originY: 'bottom',
4371
+ overlayX: 'end',
4372
+ overlayY: 'top'
4365
4373
  }
4366
4374
  ]),
4367
4375
  backdropClass: 'bao-overlay-transparent-backdrop',
@@ -4481,7 +4489,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4481
4489
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; } });
4482
4490
 
4483
4491
  /*
4484
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
4492
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4485
4493
  * Licensed under the MIT license.
4486
4494
  * See LICENSE file in the project root for full license information.
4487
4495
  */
@@ -4521,13 +4529,514 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4521
4529
  }] });
4522
4530
 
4523
4531
  /*
4524
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
4532
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4525
4533
  * Licensed under the MIT license.
4526
4534
  * See LICENSE file in the project root for full license information.
4527
4535
  */
4528
4536
 
4529
4537
  /*
4530
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
4538
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4539
+ * Licensed under the MIT license.
4540
+ * See LICENSE file in the project root for full license information.
4541
+ */
4542
+ const KILO_THRESHOLD = 1000;
4543
+ const MEGA_THRESHOLD = 1000000;
4544
+ class BaoFilePreviewComponent {
4545
+ constructor(elementRef, renderer) {
4546
+ this.elementRef = elementRef;
4547
+ this.renderer = renderer;
4548
+ /**
4549
+ * Is file loading
4550
+ */
4551
+ this.isLoading = false;
4552
+ /**
4553
+ * True if projected content has no icon and file does not have a thumbnail.
4554
+ */
4555
+ this.insertGenericIcon = false;
4556
+ this.thumbnailURL = '';
4557
+ }
4558
+ get nativeElement() {
4559
+ return this.elementRef.nativeElement;
4560
+ }
4561
+ get fileSize() {
4562
+ return this.formatSize(this.file.size);
4563
+ }
4564
+ ngAfterContentInit() {
4565
+ this.getThumbnail();
4566
+ this.setIcon();
4567
+ }
4568
+ setIcon() {
4569
+ // If no icon is in the projected content, generic icon is added
4570
+ const contentIcon = Array.from(this.nativeElement.children.item(0).children).find((el) => el.localName === 'bao-icon');
4571
+ if (!contentIcon) {
4572
+ this.insertGenericIcon = true;
4573
+ }
4574
+ else {
4575
+ this.renderer.addClass(contentIcon, 'bao-file-media');
4576
+ }
4577
+ }
4578
+ getThumbnail() {
4579
+ if (this.file &&
4580
+ (this.file.type === 'image/png' || this.file.type === 'image/jpeg')) {
4581
+ const reader = new FileReader();
4582
+ reader.onload = (event) => {
4583
+ this.thumbnailURL = event.target.result;
4584
+ };
4585
+ reader.onerror = () => {
4586
+ this.thumbnailURL = '';
4587
+ };
4588
+ reader.readAsDataURL(this.file);
4589
+ }
4590
+ }
4591
+ formatSize(size) {
4592
+ if (size >= KILO_THRESHOLD && size / KILO_THRESHOLD < KILO_THRESHOLD) {
4593
+ return this.getSizeAndUnit(size, KILO_THRESHOLD, 'Ko');
4594
+ }
4595
+ const sizeDividedByKoMultiplicator = size / KILO_THRESHOLD;
4596
+ if (sizeDividedByKoMultiplicator >= KILO_THRESHOLD) {
4597
+ const toFixed = sizeDividedByKoMultiplicator > 10 ? 0 : 1;
4598
+ return this.getSizeAndUnit(size, MEGA_THRESHOLD, 'Mo', toFixed);
4599
+ }
4600
+ return `${size} octets`;
4601
+ }
4602
+ getSizeAndUnit(size, multiplicator, unit, toFixed = 0) {
4603
+ return `${(size / multiplicator).toFixed(toFixed)} ${unit}`;
4604
+ }
4605
+ }
4606
+ 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 });
4607
+ 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 });
4608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFilePreviewComponent, decorators: [{
4609
+ type: Component,
4610
+ args: [{ selector: 'bao-file-preview, [bao-file-preview]', encapsulation: ViewEncapsulation.None, host: {
4611
+ class: 'bao-file-preview'
4612
+ }, 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"] }]
4613
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { file: [{
4614
+ type: Input
4615
+ }], isLoading: [{
4616
+ type: Input
4617
+ }] } });
4618
+
4619
+ /*
4620
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4621
+ * Licensed under the MIT license.
4622
+ * See LICENSE file in the project root for full license information.
4623
+ */
4624
+ /**
4625
+ * To modify the labels and text displayed, create a new instance of BaoFileIntl and
4626
+ * include it in a custom provider
4627
+ */
4628
+ class BaoFileIntl {
4629
+ constructor() {
4630
+ /**
4631
+ * Stream to emit from when labels are changed. Use this to notify components when the labels have
4632
+ * changed after initialization.
4633
+ */
4634
+ this.changes = new Subject();
4635
+ /** The label for button in dropzone */
4636
+ this.dropzoneButtonLabel = 'Parcourir';
4637
+ /** The default dropzone instructions */
4638
+ this.defaultDropzoneInstructions = 'ou déposer votre fichier ici';
4639
+ /** Error message displayed when uploaded file is too large */
4640
+ this.fileTooBigErrorMessage = 'La taille de ce fichier est trop grande';
4641
+ /** Error message displayed when uploaded file has an invalid type */
4642
+ this.invalidFileTypeErrorMessage = "Ce format de fichier n'est pas autorisé";
4643
+ }
4644
+ }
4645
+ BaoFileIntl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4646
+ BaoFileIntl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntl, providedIn: 'root' });
4647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntl, decorators: [{
4648
+ type: Injectable,
4649
+ args: [{ providedIn: 'root' }]
4650
+ }] });
4651
+ class BaoFileIntlEnglish extends BaoFileIntl {
4652
+ constructor() {
4653
+ super(...arguments);
4654
+ /** The label for button in dropzone */
4655
+ this.dropzoneButtonLabel = 'Browse';
4656
+ /** The default dropzone instructions */
4657
+ this.defaultDropzoneInstructions = 'or drop your file here';
4658
+ /** Error message displayed when uploaded file is too large */
4659
+ this.fileTooBigErrorMessage = 'The size of this file is too large';
4660
+ /** Error message displayed when uploaded file has an invalid type */
4661
+ this.invalidFileTypeErrorMessage = 'The format of this file is unauthorized';
4662
+ }
4663
+ }
4664
+ BaoFileIntlEnglish.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntlEnglish, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
4665
+ BaoFileIntlEnglish.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntlEnglish });
4666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileIntlEnglish, decorators: [{
4667
+ type: Injectable
4668
+ }] });
4669
+ /** @docs-private */
4670
+ function BAO_FILE_INTL_PROVIDER_FACTORY(parentIntl) {
4671
+ return parentIntl || new BaoFileIntl();
4672
+ }
4673
+ /** @docs-private */
4674
+ const BAO_FILE_INTL_PROVIDER = {
4675
+ // If there is already an BaoFileIntl available, use that. Otherwise, provide a new one.
4676
+ provide: BaoFileIntl,
4677
+ deps: [[new Optional(), new SkipSelf(), BaoFileIntl]],
4678
+ useFactory: BAO_FILE_INTL_PROVIDER_FACTORY
4679
+ };
4680
+
4681
+ /*
4682
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4683
+ * Licensed under the MIT license.
4684
+ * See LICENSE file in the project root for full license information.
4685
+ */
4686
+ /**
4687
+ * Unique number to generate a unique ID
4688
+ */
4689
+ let fileInputUniqueId = 0;
4690
+ let fileTextUniqueId = 0;
4691
+ class BaoFileInputComponent {
4692
+ constructor(intl, elementRef, renderer, cdr) {
4693
+ this.intl = intl;
4694
+ this.elementRef = elementRef;
4695
+ this.renderer = renderer;
4696
+ this.cdr = cdr;
4697
+ /**
4698
+ * Size of the file input label
4699
+ */
4700
+ this.size = 'medium';
4701
+ /**
4702
+ * Maximum size accepted for uploaded files
4703
+ */
4704
+ this.maximalFileSize = -1;
4705
+ /**
4706
+ * Accepted types of files
4707
+ */
4708
+ this.acceptedMIMETypes = [];
4709
+ /**
4710
+ * Is field required
4711
+ */
4712
+ this.required = false;
4713
+ /**
4714
+ * Is field disabled
4715
+ */
4716
+ this.disabled = false;
4717
+ /**
4718
+ * File selected to be uploaded
4719
+ */
4720
+ this.uploadedFile = new EventEmitter();
4721
+ this.insertDefaultInstructions = false;
4722
+ this.isFileTooBig = false;
4723
+ this.isFileTypeInvalid = false;
4724
+ /**
4725
+ * Saves the registerOnChange function so the component can call it whenever it wants.
4726
+ */
4727
+ // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
4728
+ this.propagateChange = (_) => { };
4729
+ /**
4730
+ * Saves the registerOnTouched function so the component can call it whenever it wants.
4731
+ */
4732
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
4733
+ this.propagateTouched = () => { };
4734
+ this._intlChanges = intl.changes.subscribe(() => this.cdr.markForCheck());
4735
+ }
4736
+ get nativeElement() {
4737
+ return this.elementRef.nativeElement;
4738
+ }
4739
+ enterKeyEvent() {
4740
+ if (document.activeElement.id === this.inputId) {
4741
+ document.getElementById(this.inputId).click();
4742
+ }
4743
+ }
4744
+ tabKeyEvent() {
4745
+ if (document.activeElement.id === this.inputId) {
4746
+ this.renderer.addClass(this.dropzoneElement.nativeElement, 'dropzone-focus');
4747
+ }
4748
+ }
4749
+ shiftTabKeyEvent() {
4750
+ if (document.activeElement.id === this.inputId) {
4751
+ this.renderer.addClass(this.dropzoneElement.nativeElement, 'dropzone-focus');
4752
+ }
4753
+ }
4754
+ ngAfterContentInit() {
4755
+ this._errorForm.changes.subscribe(() => this.setErrorTextsAttribute());
4756
+ if (!this.inputId) {
4757
+ this.inputId = `file-input-${fileInputUniqueId++}`;
4758
+ }
4759
+ // If no content was added for dropzone instructions, add default text.
4760
+ const dropzoneElement = Array.from(this.nativeElement.children).find((el) => el.className === 'file-drop-zone');
4761
+ if (!Array.from(dropzoneElement.children).find(el => el.localName === 'bao-file-dropzone-instructions')) {
4762
+ this.insertDefaultInstructions = true;
4763
+ }
4764
+ this.setDescribedByAttribute();
4765
+ this._files.changes.subscribe((files) => {
4766
+ const filesList = files.map((el) => el.file);
4767
+ this.setValue(filesList);
4768
+ });
4769
+ }
4770
+ ngAfterViewInit() {
4771
+ this._errorTexts.changes.subscribe(() => this.setErrorTextsAttribute());
4772
+ }
4773
+ ngOnDestroy() {
4774
+ this._intlChanges.unsubscribe();
4775
+ }
4776
+ /**
4777
+ * Implements ControlValueAccessor interface
4778
+ */
4779
+ writeValue(obj) {
4780
+ this._value = obj;
4781
+ }
4782
+ /**
4783
+ * Implements ControlValueAccessor interface
4784
+ */
4785
+ registerOnChange(fn) {
4786
+ this.propagateChange = fn;
4787
+ }
4788
+ /**
4789
+ * Implements ControlValueAccessor interface
4790
+ */
4791
+ registerOnTouched(fn) {
4792
+ this.propagateTouched = fn;
4793
+ }
4794
+ /**
4795
+ * Implements ControlValueAccessor interface
4796
+ */
4797
+ setDisabledState(isDisabled) {
4798
+ this.disabled = isDisabled;
4799
+ }
4800
+ uploadFile(file) {
4801
+ if (!this.disabled) {
4802
+ this.isFileTypeInvalid = false;
4803
+ this.isFileTooBig = false;
4804
+ this.uploader.nativeElement.value = '';
4805
+ if (this.maximalFileSize > 0 && file.size > this.maximalFileSize) {
4806
+ this.isFileTooBig = true;
4807
+ }
4808
+ if (this.acceptedMIMETypes.length > 0 &&
4809
+ this.acceptedMIMETypes.indexOf(file.type) < 0) {
4810
+ this.isFileTypeInvalid = true;
4811
+ }
4812
+ if (!this.isFileTooBig && !this.isFileTypeInvalid) {
4813
+ this.uploadedFile.emit(file);
4814
+ }
4815
+ }
4816
+ }
4817
+ setValue(value) {
4818
+ this._value = value;
4819
+ this.propagateChange(this._value);
4820
+ this.propagateTouched();
4821
+ }
4822
+ setDescribedByAttribute() {
4823
+ const helperText = Array.from(this.nativeElement.children).find((el) => el.localName === 'bao-guiding-text').firstElementChild;
4824
+ if (helperText) {
4825
+ this._helperTextId = `bao-guiding-text-${fileTextUniqueId++}`;
4826
+ this.renderer.setAttribute(helperText, 'id', this._helperTextId);
4827
+ const inputElement = Array.from(this.nativeElement.children)
4828
+ .find((el) => el.className == 'file-drop-zone')
4829
+ .children.item(1);
4830
+ this.renderer.setAttribute(inputElement, 'aria-describedby', this._helperTextId);
4831
+ }
4832
+ }
4833
+ setErrorTextsAttribute() {
4834
+ const textsIds = [];
4835
+ const errors = Array.from(this.nativeElement.children).filter((el) => el.localName == 'bao-error');
4836
+ errors.forEach((errorText) => {
4837
+ const errorTextId = `bao-error-${fileTextUniqueId++}`;
4838
+ this.renderer.setAttribute(errorText.firstElementChild, 'id', errorTextId);
4839
+ textsIds.push(errorTextId);
4840
+ });
4841
+ const inputElement = Array.from(this.nativeElement.children)
4842
+ .find((el) => el.classList.contains('file-drop-zone'))
4843
+ .children.item(1);
4844
+ if (this._helperTextId) {
4845
+ textsIds.unshift(this._helperTextId);
4846
+ }
4847
+ this.renderer.setAttribute(inputElement, 'aria-describedby', textsIds.join(' '));
4848
+ }
4849
+ }
4850
+ 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 });
4851
+ 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: [
4852
+ {
4853
+ provide: NG_VALUE_ACCESSOR,
4854
+ // tslint:disable-next-line:no-forward-ref
4855
+ useExisting: forwardRef(() => BaoFileInputComponent),
4856
+ multi: true
4857
+ }
4858
+ ], 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 });
4859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileInputComponent, decorators: [{
4860
+ type: Component,
4861
+ args: [{ selector: 'bao-file-input, [bao-file-input]', providers: [
4862
+ {
4863
+ provide: NG_VALUE_ACCESSOR,
4864
+ // tslint:disable-next-line:no-forward-ref
4865
+ useExisting: forwardRef(() => BaoFileInputComponent),
4866
+ multi: true
4867
+ }
4868
+ ], encapsulation: ViewEncapsulation.None, host: {
4869
+ class: 'bao-file-input',
4870
+ '[class.bao-file-label-small]': 'size === "small"',
4871
+ '[class.bao-file-label-medium]': 'size === "medium"',
4872
+ '[class.bao-file-input-disabled]': 'disabled'
4873
+ }, 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"] }]
4874
+ }], ctorParameters: function () { return [{ type: BaoFileIntl }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputId: [{
4875
+ type: Input,
4876
+ args: ['id']
4877
+ }], label: [{
4878
+ type: Input
4879
+ }], size: [{
4880
+ type: Input
4881
+ }], maximalFileSize: [{
4882
+ type: Input
4883
+ }], acceptedMIMETypes: [{
4884
+ type: Input
4885
+ }], required: [{
4886
+ type: Input
4887
+ }], disabled: [{
4888
+ type: Input
4889
+ }], uploadedFile: [{
4890
+ type: Output
4891
+ }], _files: [{
4892
+ type: ContentChildren,
4893
+ args: [BaoFilePreviewComponent, { descendants: true }]
4894
+ }], _errorForm: [{
4895
+ type: ContentChildren,
4896
+ args: [BaoErrorTextComponent, { descendants: true }]
4897
+ }], _errorTexts: [{
4898
+ type: ViewChildren,
4899
+ args: [BaoErrorTextComponent]
4900
+ }], uploader: [{
4901
+ type: ViewChild,
4902
+ args: ['uploader', { static: false }]
4903
+ }], dropzoneElement: [{
4904
+ type: ViewChild,
4905
+ args: ['dropzone', { static: false }]
4906
+ }], enterKeyEvent: [{
4907
+ type: HostListener,
4908
+ args: ['window:keyup.enter']
4909
+ }], tabKeyEvent: [{
4910
+ type: HostListener,
4911
+ args: ['window:keyup.tab']
4912
+ }], shiftTabKeyEvent: [{
4913
+ type: HostListener,
4914
+ args: ['window:keyup.shift.tab']
4915
+ }] } });
4916
+ class BaoFileDropDirective {
4917
+ constructor() {
4918
+ this.fileDrop = new EventEmitter();
4919
+ this._isDragOver = false;
4920
+ }
4921
+ onDragOver(event) {
4922
+ this.preventAndStop(event);
4923
+ this._isDragOver = true;
4924
+ }
4925
+ onDragLeave(event) {
4926
+ this.preventAndStop(event);
4927
+ this._isDragOver = false;
4928
+ }
4929
+ onDrop(event) {
4930
+ this.preventAndStop(event);
4931
+ this._isDragOver = false;
4932
+ const transfer = this.getDataTransfer(event);
4933
+ this.fileDrop.emit(transfer.files[0]);
4934
+ }
4935
+ preventAndStop(event) {
4936
+ event.preventDefault();
4937
+ event.stopPropagation();
4938
+ }
4939
+ getDataTransfer(event) {
4940
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
4941
+ return event.dataTransfer
4942
+ ? event.dataTransfer
4943
+ : event.originalEvent.dataTransfer;
4944
+ }
4945
+ }
4946
+ BaoFileDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4947
+ 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 });
4948
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropDirective, decorators: [{
4949
+ type: Directive,
4950
+ args: [{
4951
+ selector: '[baoFileDrop]',
4952
+ host: { '[class.drag-over]': '_isDragOver == true' }
4953
+ }]
4954
+ }], propDecorators: { fileDrop: [{
4955
+ type: Output
4956
+ }], onDragOver: [{
4957
+ type: HostListener,
4958
+ args: ['dragover', ['$event']]
4959
+ }], onDragLeave: [{
4960
+ type: HostListener,
4961
+ args: ['dragleave', ['$event']]
4962
+ }], onDrop: [{
4963
+ type: HostListener,
4964
+ args: ['drop', ['$event']]
4965
+ }] } });
4966
+ class BaoFileDropzoneIntructions {
4967
+ constructor(renderer, elementRef) {
4968
+ this.renderer = renderer;
4969
+ this.elementRef = elementRef;
4970
+ }
4971
+ get nativeElement() {
4972
+ return this.elementRef.nativeElement;
4973
+ }
4974
+ ngAfterContentInit() {
4975
+ this.renderer.setAttribute(this.nativeElement, 'aria-hidden', 'true');
4976
+ }
4977
+ }
4978
+ 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 });
4979
+ 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 });
4980
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileDropzoneIntructions, decorators: [{
4981
+ type: Directive,
4982
+ args: [{
4983
+ selector: 'bao-file-dropzone-instructions, [bao-file-dropzone-instructions]',
4984
+ host: {
4985
+ class: 'bao-file-dropzone-instructions'
4986
+ }
4987
+ }]
4988
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; } });
4989
+
4990
+ /*
4991
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4992
+ * Licensed under the MIT license.
4993
+ * See LICENSE file in the project root for full license information.
4994
+ */
4995
+ const FILE_DIRECTIVES = [
4996
+ BaoFileInputComponent,
4997
+ BaoFileDropzoneIntructions,
4998
+ BaoFileDropDirective,
4999
+ BaoFilePreviewComponent
5000
+ ];
5001
+ class BaoFileModule {
5002
+ }
5003
+ BaoFileModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5004
+ BaoFileModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, declarations: [BaoFileInputComponent,
5005
+ BaoFileDropzoneIntructions,
5006
+ BaoFileDropDirective,
5007
+ BaoFilePreviewComponent], imports: [CommonModule,
5008
+ BaoDropdownMenuModule,
5009
+ BaoCommonComponentsModule,
5010
+ BaoIconModule,
5011
+ BaoButtonModule], exports: [BaoFileInputComponent,
5012
+ BaoFileDropzoneIntructions,
5013
+ BaoFileDropDirective,
5014
+ BaoFilePreviewComponent] });
5015
+ BaoFileModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, providers: [BAO_FILE_INTL_PROVIDER], imports: [[
5016
+ CommonModule,
5017
+ BaoDropdownMenuModule,
5018
+ BaoCommonComponentsModule,
5019
+ BaoIconModule,
5020
+ BaoButtonModule
5021
+ ]] });
5022
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaoFileModule, decorators: [{
5023
+ type: NgModule,
5024
+ args: [{
5025
+ imports: [
5026
+ CommonModule,
5027
+ BaoDropdownMenuModule,
5028
+ BaoCommonComponentsModule,
5029
+ BaoIconModule,
5030
+ BaoButtonModule
5031
+ ],
5032
+ declarations: [FILE_DIRECTIVES],
5033
+ exports: [FILE_DIRECTIVES],
5034
+ providers: [BAO_FILE_INTL_PROVIDER]
5035
+ }]
5036
+ }] });
5037
+
5038
+ /*
5039
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4531
5040
  * Licensed under the MIT license.
4532
5041
  * See LICENSE file in the project root for full license information.
4533
5042
  */
@@ -4554,7 +5063,8 @@ BaoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
4554
5063
  BaoTabsModule,
4555
5064
  BaoModalModule,
4556
5065
  BaoHyperlinkModule,
4557
- BaoDropdownMenuModule
5066
+ BaoDropdownMenuModule,
5067
+ BaoFileModule
4558
5068
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
4559
5069
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
4560
5070
  ] });
@@ -4580,7 +5090,8 @@ BaoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
4580
5090
  BaoTabsModule,
4581
5091
  BaoModalModule,
4582
5092
  BaoHyperlinkModule,
4583
- BaoDropdownMenuModule
5093
+ BaoDropdownMenuModule,
5094
+ BaoFileModule
4584
5095
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
4585
5096
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
4586
5097
  ] });
@@ -4611,7 +5122,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4611
5122
  BaoTabsModule,
4612
5123
  BaoModalModule,
4613
5124
  BaoHyperlinkModule,
4614
- BaoDropdownMenuModule
5125
+ BaoDropdownMenuModule,
5126
+ BaoFileModule
4615
5127
  // TODO: reactivate once component does not depend on global css BaoBadgeModule,
4616
5128
  // TODO: reactivate once component does not depend on global css BaoSnackBarModule,
4617
5129
  ]
@@ -4619,7 +5131,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4619
5131
  }] });
4620
5132
 
4621
5133
  /*
4622
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5134
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4623
5135
  * Licensed under the MIT license.
4624
5136
  * See LICENSE file in the project root for full license information.
4625
5137
  */
@@ -4644,7 +5156,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4644
5156
  }] } });
4645
5157
 
4646
5158
  /*
4647
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5159
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4648
5160
  * Licensed under the MIT license.
4649
5161
  * See LICENSE file in the project root for full license information.
4650
5162
  */
@@ -4664,25 +5176,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4664
5176
  }] });
4665
5177
 
4666
5178
  /*
4667
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5179
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
5180
+ * Licensed under the MIT license.
5181
+ * See LICENSE file in the project root for full license information.
5182
+ */
5183
+
5184
+ /*
5185
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4668
5186
  * Licensed under the MIT license.
4669
5187
  * See LICENSE file in the project root for full license information.
4670
5188
  */
4671
5189
 
4672
5190
  /*
4673
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5191
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4674
5192
  * Licensed under the MIT license.
4675
5193
  * See LICENSE file in the project root for full license information.
4676
5194
  */
4677
5195
 
4678
5196
  /*
4679
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5197
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4680
5198
  * Licensed under the MIT license.
4681
5199
  * See LICENSE file in the project root for full license information.
4682
5200
  */
4683
5201
 
4684
5202
  /*
4685
- * Copyright (c) 2022 Ville de Montreal. All rights reserved.
5203
+ * Copyright (c) 2023 Ville de Montreal. All rights reserved.
4686
5204
  * Licensed under the MIT license.
4687
5205
  * See LICENSE file in the project root for full license information.
4688
5206
  */
@@ -4691,5 +5209,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4691
5209
  * Generated bundle index. Do not edit.
4692
5210
  */
4693
5211
 
4694
- 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 };
5212
+ 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 };
4695
5213
  //# sourceMappingURL=villedemontreal-angular-ui.mjs.map