@acpaas-ui/ngx-forms 6.1.8 → 6.1.10

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 (178) hide show
  1. package/.eslintrc.json +42 -0
  2. package/LICENSE.md +21 -0
  3. package/dist/README.md +23 -0
  4. package/dist/esm2020/lib/auto-complete/auto-complete.module.mjs +23 -0
  5. package/dist/esm2020/lib/auto-complete/components/auto-complete/auto-complete.component.mjs +265 -0
  6. package/dist/esm2020/lib/datepicker/components/datepicker/datepicker.component.mjs +232 -0
  7. package/dist/esm2020/lib/datepicker/datepicker.module.mjs +54 -0
  8. package/dist/esm2020/lib/range-slider/components/range-slider/range-slider.component.mjs +297 -0
  9. package/dist/esm2020/lib/range-slider/range-slider.module.mjs +19 -0
  10. package/dist/esm2020/lib/search-filter/components/search-filter/search-filter.component.mjs +149 -0
  11. package/dist/esm2020/lib/search-filter/search-filter.module.mjs +21 -0
  12. package/{esm2020 → dist/esm2020}/lib/shared/services/search.service.mjs +6 -6
  13. package/dist/esm2020/lib/timepicker/components/timepicker/timepicker.component.mjs +130 -0
  14. package/dist/esm2020/lib/timepicker/timepicker.module.mjs +21 -0
  15. package/dist/esm2020/lib/upload/components/upload/upload.component.mjs +69 -0
  16. package/dist/esm2020/lib/upload/components/upload-input/upload-input.component.mjs +39 -0
  17. package/dist/esm2020/lib/upload/components/upload-queue/upload-queue.component.mjs +42 -0
  18. package/dist/esm2020/lib/upload/components/upload-zone/upload-zone.component.mjs +143 -0
  19. package/dist/esm2020/lib/upload/components/validation-list/validation-list.component.mjs +33 -0
  20. package/dist/esm2020/lib/upload/services/validation-messages.service.mjs +29 -0
  21. package/dist/esm2020/lib/upload/upload.module.mjs +44 -0
  22. package/{fesm2015 → dist/fesm2015}/acpaas-ui-ngx-forms.mjs +141 -994
  23. package/dist/fesm2015/acpaas-ui-ngx-forms.mjs.map +1 -0
  24. package/dist/fesm2020/acpaas-ui-ngx-forms.mjs +1727 -0
  25. package/dist/fesm2020/acpaas-ui-ngx-forms.mjs.map +1 -0
  26. package/dist/package.json +44 -0
  27. package/karma.conf.js +38 -0
  28. package/ng-package.json +8 -0
  29. package/package.json +6 -30
  30. package/src/lib/auto-complete/README.md +148 -0
  31. package/src/lib/auto-complete/auto-complete.module.ts +15 -0
  32. package/src/lib/auto-complete/components/auto-complete/auto-complete.component.html +51 -0
  33. package/src/lib/auto-complete/components/auto-complete/auto-complete.component.scss +4 -0
  34. package/src/lib/auto-complete/components/auto-complete/auto-complete.component.spec.ts +378 -0
  35. package/src/lib/auto-complete/components/auto-complete/auto-complete.component.ts +281 -0
  36. package/src/lib/auto-complete/public-api.ts +2 -0
  37. package/src/lib/datepicker/README.md +110 -0
  38. package/src/lib/datepicker/components/datepicker/datepicker.component.html +47 -0
  39. package/src/lib/datepicker/components/datepicker/datepicker.component.scss +13 -0
  40. package/src/lib/datepicker/components/datepicker/datepicker.component.spec.ts +204 -0
  41. package/src/lib/datepicker/components/datepicker/datepicker.component.ts +251 -0
  42. package/src/lib/datepicker/datepicker.conf.ts +11 -0
  43. package/src/lib/datepicker/datepicker.module.ts +50 -0
  44. package/src/lib/datepicker/public-api.ts +8 -0
  45. package/src/lib/datepicker/types/datepicker.types.ts +8 -0
  46. package/src/lib/range-slider/README.md +56 -0
  47. package/src/lib/range-slider/components/range-slider/range-slider.component.html +46 -0
  48. package/src/lib/range-slider/components/range-slider/range-slider.component.scss +12 -0
  49. package/src/lib/range-slider/components/range-slider/range-slider.component.spec.ts +216 -0
  50. package/src/lib/range-slider/components/range-slider/range-slider.component.ts +301 -0
  51. package/src/lib/range-slider/public-api.ts +3 -0
  52. package/src/lib/range-slider/range-slider.module.ts +11 -0
  53. package/src/lib/range-slider/types/range-slider.types.ts +4 -0
  54. package/src/lib/search-filter/README.md +86 -0
  55. package/src/lib/search-filter/components/search-filter/search-filter.component.html +66 -0
  56. package/src/lib/search-filter/components/search-filter/search-filter.component.scss +23 -0
  57. package/src/lib/search-filter/components/search-filter/search-filter.component.spec.ts +264 -0
  58. package/src/lib/search-filter/components/search-filter/search-filter.component.ts +140 -0
  59. package/src/lib/search-filter/public-api.ts +3 -0
  60. package/src/lib/search-filter/search-filter.module.ts +13 -0
  61. package/src/lib/search-filter/types/search-filter.types.ts +4 -0
  62. package/src/lib/shared/services/search.service.spec.ts +78 -0
  63. package/src/lib/shared/services/search.service.ts +32 -0
  64. package/src/lib/shared/types/search.types.ts +6 -0
  65. package/src/lib/timepicker/README.md +84 -0
  66. package/src/lib/timepicker/classes/timepicker.validators.spec.ts +54 -0
  67. package/src/lib/timepicker/classes/timepicker.validators.ts +61 -0
  68. package/src/lib/timepicker/components/timepicker/timepicker.component.html +37 -0
  69. package/src/lib/timepicker/components/timepicker/timepicker.component.scss +3 -0
  70. package/src/lib/timepicker/components/timepicker/timepicker.component.spec.ts +161 -0
  71. package/src/lib/timepicker/components/timepicker/timepicker.component.ts +128 -0
  72. package/src/lib/timepicker/public-api.ts +4 -0
  73. package/src/lib/timepicker/timepicker.module.ts +13 -0
  74. package/src/lib/timepicker/types/timepicker.types.ts +5 -0
  75. package/src/lib/upload/README.md +283 -0
  76. package/src/lib/upload/classes/uploader.class.spec.ts +100 -0
  77. package/src/lib/upload/classes/uploader.class.ts +144 -0
  78. package/src/lib/upload/components/upload/upload.component.html +28 -0
  79. package/src/lib/upload/components/upload/upload.component.scss +3 -0
  80. package/src/lib/upload/components/upload/upload.component.spec.ts +117 -0
  81. package/src/lib/upload/components/upload/upload.component.ts +50 -0
  82. package/src/lib/upload/components/upload-input/upload-input.component.html +11 -0
  83. package/src/lib/upload/components/upload-input/upload-input.component.spec.ts +55 -0
  84. package/src/lib/upload/components/upload-input/upload-input.component.ts +35 -0
  85. package/src/lib/upload/components/upload-queue/upload-queue.component.html +16 -0
  86. package/src/lib/upload/components/upload-queue/upload-queue.component.spec.ts +99 -0
  87. package/src/lib/upload/components/upload-queue/upload-queue.component.ts +36 -0
  88. package/src/lib/upload/components/upload-zone/upload-zone.component.html +55 -0
  89. package/src/lib/upload/components/upload-zone/upload-zone.component.scss +3 -0
  90. package/src/lib/upload/components/upload-zone/upload-zone.component.spec.ts +144 -0
  91. package/src/lib/upload/components/upload-zone/upload-zone.component.ts +142 -0
  92. package/src/lib/upload/components/validation-list/validation-list.component.html +15 -0
  93. package/src/lib/upload/components/validation-list/validation-list.component.spec.ts +57 -0
  94. package/src/lib/upload/components/validation-list/validation-list.component.ts +29 -0
  95. package/src/lib/upload/public-api.ts +10 -0
  96. package/src/lib/upload/services/validation-messages.service.spec.ts +66 -0
  97. package/src/lib/upload/services/validation-messages.service.ts +27 -0
  98. package/src/lib/upload/types/upload.types.ts +20 -0
  99. package/src/lib/upload/upload.conf.ts +15 -0
  100. package/src/lib/upload/upload.module.ts +34 -0
  101. package/src/public-api.ts +6 -0
  102. package/src/test.ts +9 -0
  103. package/tsconfig.lib.json +26 -0
  104. package/tsconfig.spec.json +17 -0
  105. package/esm2020/lib/auto-complete/auto-complete.module.mjs +0 -24
  106. package/esm2020/lib/auto-complete/components/auto-complete/auto-complete.component.mjs +0 -347
  107. package/esm2020/lib/datepicker/components/datepicker/datepicker.component.mjs +0 -308
  108. package/esm2020/lib/datepicker/datepicker.module.mjs +0 -55
  109. package/esm2020/lib/range-slider/components/range-slider/range-slider.component.mjs +0 -349
  110. package/esm2020/lib/range-slider/range-slider.module.mjs +0 -20
  111. package/esm2020/lib/search-filter/components/search-filter/search-filter.component.mjs +0 -266
  112. package/esm2020/lib/search-filter/search-filter.module.mjs +0 -22
  113. package/esm2020/lib/timepicker/components/timepicker/timepicker.component.mjs +0 -243
  114. package/esm2020/lib/timepicker/timepicker.module.mjs +0 -22
  115. package/esm2020/lib/upload/components/upload/upload.component.mjs +0 -97
  116. package/esm2020/lib/upload/components/upload-input/upload-input.component.mjs +0 -56
  117. package/esm2020/lib/upload/components/upload-queue/upload-queue.component.mjs +0 -78
  118. package/esm2020/lib/upload/components/upload-zone/upload-zone.component.mjs +0 -252
  119. package/esm2020/lib/upload/components/validation-list/validation-list.component.mjs +0 -64
  120. package/esm2020/lib/upload/services/validation-messages.service.mjs +0 -29
  121. package/esm2020/lib/upload/upload.module.mjs +0 -45
  122. package/fesm2015/acpaas-ui-ngx-forms.mjs.map +0 -1
  123. package/fesm2020/acpaas-ui-ngx-forms.mjs +0 -2394
  124. package/fesm2020/acpaas-ui-ngx-forms.mjs.map +0 -1
  125. /package/{esm2020 → dist/esm2020}/acpaas-ui-ngx-forms.mjs +0 -0
  126. /package/{esm2020 → dist/esm2020}/lib/auto-complete/public-api.mjs +0 -0
  127. /package/{esm2020 → dist/esm2020}/lib/datepicker/datepicker.conf.mjs +0 -0
  128. /package/{esm2020 → dist/esm2020}/lib/datepicker/public-api.mjs +0 -0
  129. /package/{esm2020 → dist/esm2020}/lib/datepicker/types/datepicker.types.mjs +0 -0
  130. /package/{esm2020 → dist/esm2020}/lib/range-slider/public-api.mjs +0 -0
  131. /package/{esm2020 → dist/esm2020}/lib/range-slider/types/range-slider.types.mjs +0 -0
  132. /package/{esm2020 → dist/esm2020}/lib/search-filter/public-api.mjs +0 -0
  133. /package/{esm2020 → dist/esm2020}/lib/search-filter/types/search-filter.types.mjs +0 -0
  134. /package/{esm2020 → dist/esm2020}/lib/shared/types/search.types.mjs +0 -0
  135. /package/{esm2020 → dist/esm2020}/lib/timepicker/classes/timepicker.validators.mjs +0 -0
  136. /package/{esm2020 → dist/esm2020}/lib/timepicker/public-api.mjs +0 -0
  137. /package/{esm2020 → dist/esm2020}/lib/timepicker/types/timepicker.types.mjs +0 -0
  138. /package/{esm2020 → dist/esm2020}/lib/upload/classes/uploader.class.mjs +0 -0
  139. /package/{esm2020 → dist/esm2020}/lib/upload/public-api.mjs +0 -0
  140. /package/{esm2020 → dist/esm2020}/lib/upload/types/upload.types.mjs +0 -0
  141. /package/{esm2020 → dist/esm2020}/lib/upload/upload.conf.mjs +0 -0
  142. /package/{esm2020 → dist/esm2020}/public-api.mjs +0 -0
  143. /package/{index.d.ts → dist/index.d.ts} +0 -0
  144. /package/{lib → dist/lib}/auto-complete/auto-complete.module.d.ts +0 -0
  145. /package/{lib → dist/lib}/auto-complete/components/auto-complete/auto-complete.component.d.ts +0 -0
  146. /package/{lib → dist/lib}/auto-complete/public-api.d.ts +0 -0
  147. /package/{lib → dist/lib}/datepicker/components/datepicker/datepicker.component.d.ts +0 -0
  148. /package/{lib → dist/lib}/datepicker/datepicker.conf.d.ts +0 -0
  149. /package/{lib → dist/lib}/datepicker/datepicker.module.d.ts +0 -0
  150. /package/{lib → dist/lib}/datepicker/public-api.d.ts +0 -0
  151. /package/{lib → dist/lib}/datepicker/types/datepicker.types.d.ts +0 -0
  152. /package/{lib → dist/lib}/range-slider/components/range-slider/range-slider.component.d.ts +0 -0
  153. /package/{lib → dist/lib}/range-slider/public-api.d.ts +0 -0
  154. /package/{lib → dist/lib}/range-slider/range-slider.module.d.ts +0 -0
  155. /package/{lib → dist/lib}/range-slider/types/range-slider.types.d.ts +0 -0
  156. /package/{lib → dist/lib}/search-filter/components/search-filter/search-filter.component.d.ts +0 -0
  157. /package/{lib → dist/lib}/search-filter/public-api.d.ts +0 -0
  158. /package/{lib → dist/lib}/search-filter/search-filter.module.d.ts +0 -0
  159. /package/{lib → dist/lib}/search-filter/types/search-filter.types.d.ts +0 -0
  160. /package/{lib → dist/lib}/shared/services/search.service.d.ts +0 -0
  161. /package/{lib → dist/lib}/shared/types/search.types.d.ts +0 -0
  162. /package/{lib → dist/lib}/timepicker/classes/timepicker.validators.d.ts +0 -0
  163. /package/{lib → dist/lib}/timepicker/components/timepicker/timepicker.component.d.ts +0 -0
  164. /package/{lib → dist/lib}/timepicker/public-api.d.ts +0 -0
  165. /package/{lib → dist/lib}/timepicker/timepicker.module.d.ts +0 -0
  166. /package/{lib → dist/lib}/timepicker/types/timepicker.types.d.ts +0 -0
  167. /package/{lib → dist/lib}/upload/classes/uploader.class.d.ts +0 -0
  168. /package/{lib → dist/lib}/upload/components/upload/upload.component.d.ts +0 -0
  169. /package/{lib → dist/lib}/upload/components/upload-input/upload-input.component.d.ts +0 -0
  170. /package/{lib → dist/lib}/upload/components/upload-queue/upload-queue.component.d.ts +0 -0
  171. /package/{lib → dist/lib}/upload/components/upload-zone/upload-zone.component.d.ts +0 -0
  172. /package/{lib → dist/lib}/upload/components/validation-list/validation-list.component.d.ts +0 -0
  173. /package/{lib → dist/lib}/upload/public-api.d.ts +0 -0
  174. /package/{lib → dist/lib}/upload/services/validation-messages.service.d.ts +0 -0
  175. /package/{lib → dist/lib}/upload/types/upload.types.d.ts +0 -0
  176. /package/{lib → dist/lib}/upload/upload.conf.d.ts +0 -0
  177. /package/{lib → dist/lib}/upload/upload.module.d.ts +0 -0
  178. /package/{public-api.d.ts → dist/public-api.d.ts} +0 -0
@@ -1,2394 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, TemplateRef, forwardRef, Component, Input, Output, ViewChild, ContentChild, NgModule, InjectionToken, ChangeDetectionStrategy, Inject, HostBinding, HostListener } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i1$1 from '@angular/forms';
6
- import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
7
- import * as i4 from '@acpaas-ui/ngx-flyout';
8
- import { FlyoutDirective, FlyoutZoneDirective, FlyoutModule, FlyoutSize } from '@acpaas-ui/ngx-flyout';
9
- import * as i5 from '@acpaas-ui/ngx-selectable-list';
10
- import { SelectableListModule } from '@acpaas-ui/ngx-selectable-list';
11
- import { get, isEqual, debounce } from 'lodash-es';
12
- import { Subject, Observable } from 'rxjs';
13
- import { takeUntil } from 'rxjs/operators';
14
- import { DateHelper, IntervalBuilder } from '@acpaas-ui/ngx-utils';
15
- import { TZDate } from '@date-fns/tz';
16
- import * as i1$2 from '@acpaas-ui/ngx-calendar';
17
- import { CALENDAR_DEFAULT_MONTH_LABELS, CALENDAR_DEFAULT_WEEKDAY_LABELS, CALENDAR_MONTH_LABELS, CALENDAR_WEEKDAY_LABELS, CalendarModule } from '@acpaas-ui/ngx-calendar';
18
- import * as i4$1 from '@acpaas-ui/ngx-icon';
19
- import { IconModule } from '@acpaas-ui/ngx-icon';
20
- import * as i2 from '@acpaas-ui/ngx-progress-bar';
21
- import { ProgressBarModule } from '@acpaas-ui/ngx-progress-bar';
22
-
23
- class SearchService {
24
- constructor() {
25
- this.matchItemWithSearchString = (item, searchString) => {
26
- return String(item).toLowerCase().indexOf(searchString.toLowerCase()) > -1;
27
- };
28
- }
29
- search(data, options = {}) {
30
- const query = options.hasOwnProperty('query') ? options.query : '';
31
- const minLength = options.hasOwnProperty('minLength') ? options.minLength : 0;
32
- const key = options.hasOwnProperty('key') ? options.key : '';
33
- if ((!query && options.showAllByDefault) || query.length < minLength) {
34
- return [...data];
35
- }
36
- return [...data].filter(item => {
37
- if (key && !item.hasOwnProperty(key)) {
38
- return console.error(`"${key}" does not exist in item ${JSON.stringify(item, null, 2)}`);
39
- }
40
- if (key) {
41
- return this.matchItemWithSearchString(item[key], query);
42
- }
43
- return this.matchItemWithSearchString(item, query);
44
- });
45
- }
46
- }
47
- /** @nocollapse */ SearchService.ɵfac = function SearchService_Factory(t) { return new (t || SearchService)(); };
48
- /** @nocollapse */ SearchService.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SearchService, factory: SearchService.ɵfac });
49
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchService, [{
50
- type: Injectable
51
- }], null, null); })();
52
-
53
- function AutoCompleteComponent_div_2_span_1_Template(rf, ctx) { if (rf & 1) {
54
- i0.ɵɵelementStart(0, "span", 7);
55
- i0.ɵɵelement(1, "span", 8);
56
- i0.ɵɵelementStart(2, "span", 9);
57
- i0.ɵɵtext(3);
58
- i0.ɵɵelementEnd()();
59
- } if (rf & 2) {
60
- const ctx_r1 = i0.ɵɵnextContext(2);
61
- i0.ɵɵadvance(3);
62
- i0.ɵɵtextInterpolate(ctx_r1.loadingText);
63
- } }
64
- function AutoCompleteComponent_div_2_span_2_Template(rf, ctx) { if (rf & 1) {
65
- i0.ɵɵelementStart(0, "span", 10);
66
- i0.ɵɵtext(1);
67
- i0.ɵɵelementEnd();
68
- } if (rf & 2) {
69
- const ctx_r2 = i0.ɵɵnextContext(2);
70
- i0.ɵɵadvance(1);
71
- i0.ɵɵtextInterpolate(ctx_r2.searchIncentiveText);
72
- } }
73
- function AutoCompleteComponent_div_2_span_3_Template(rf, ctx) { if (rf & 1) {
74
- i0.ɵɵelementStart(0, "span", 10);
75
- i0.ɵɵtext(1);
76
- i0.ɵɵelementEnd();
77
- } if (rf & 2) {
78
- const ctx_r3 = i0.ɵɵnextContext(2);
79
- i0.ɵɵadvance(1);
80
- i0.ɵɵtextInterpolate(ctx_r3.noResultsText);
81
- } }
82
- function AutoCompleteComponent_div_2_aui_selectable_list_4_Template(rf, ctx) { if (rf & 1) {
83
- const _r6 = i0.ɵɵgetCurrentView();
84
- i0.ɵɵelementStart(0, "aui-selectable-list", 11);
85
- i0.ɵɵlistener("selected", function AutoCompleteComponent_div_2_aui_selectable_list_4_Template_aui_selectable_list_selected_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r5.onSelect($event)); });
86
- i0.ɵɵelementEnd();
87
- } if (rf & 2) {
88
- const ctx_r4 = i0.ɵɵnextContext(2);
89
- i0.ɵɵproperty("index", ctx_r4.index)("itemTemplate", ctx_r4.template)("items", ctx_r4.results)("label", ctx_r4.label)("search", ctx_r4.query);
90
- } }
91
- function AutoCompleteComponent_div_2_Template(rf, ctx) { if (rf & 1) {
92
- i0.ɵɵelementStart(0, "div", 3);
93
- i0.ɵɵtemplate(1, AutoCompleteComponent_div_2_span_1_Template, 4, 1, "span", 4);
94
- i0.ɵɵtemplate(2, AutoCompleteComponent_div_2_span_2_Template, 2, 1, "span", 5);
95
- i0.ɵɵtemplate(3, AutoCompleteComponent_div_2_span_3_Template, 2, 1, "span", 5);
96
- i0.ɵɵtemplate(4, AutoCompleteComponent_div_2_aui_selectable_list_4_Template, 1, 5, "aui-selectable-list", 6);
97
- i0.ɵɵelementEnd();
98
- } if (rf & 2) {
99
- const ctx_r0 = i0.ɵɵnextContext();
100
- i0.ɵɵadvance(1);
101
- i0.ɵɵproperty("ngIf", ctx_r0.focused && ctx_r0.loadingText && ctx_r0.searching);
102
- i0.ɵɵadvance(1);
103
- i0.ɵɵproperty("ngIf", ctx_r0.focused && ctx_r0.searchIncentiveText && !ctx_r0.searching && !ctx_r0.query && !ctx_r0.results.length);
104
- i0.ɵɵadvance(1);
105
- i0.ɵɵproperty("ngIf", ctx_r0.focused && ctx_r0.noResultsText && !ctx_r0.searching && ctx_r0.query && !ctx_r0.results.length);
106
- i0.ɵɵadvance(1);
107
- i0.ɵɵproperty("ngIf", ctx_r0.results.length > 0 && !(ctx_r0.focused && ctx_r0.loadingText && ctx_r0.searching));
108
- } }
109
- class AutoCompleteComponent {
110
- constructor(ref, searchService) {
111
- this.ref = ref;
112
- this.searchService = searchService;
113
- this.results = []; // The values for the selectable list
114
- this.data = []; // The values to search in when remote search is disabled
115
- this.remote = false; // Disable or enamble remote search
116
- this.minCharacters = 0;
117
- this.clearInvalid = false;
118
- this.showAllByDefault = false;
119
- this.autoComplete = 'off';
120
- // Eventemitter for searchvalue (parent object should update the results with this param)
121
- this.search = new EventEmitter();
122
- // eslint-disable-next-line @angular-eslint/no-output-native
123
- this.select = new EventEmitter();
124
- this.query = '';
125
- this.index = -1; // index for active element in selectable list, by default -1 (so it starts in the input field)
126
- this.selectedItem = null; // keep a backup of the selectedItem
127
- this.searching = false; // track remote search state
128
- this.focused = false;
129
- this.isDisabled = false;
130
- this.remoteValue = false;
131
- this.updateModel = (_) => { };
132
- }
133
- // CONTROL_VALUE_ACCESSOR interface
134
- writeValue(value = '') {
135
- if (this.value) {
136
- const selected = this.data.find((item) => item[this.value] === value);
137
- if (selected) {
138
- return (this.query = selected[this.label]);
139
- }
140
- if (this.remote && !!value) {
141
- this.remoteValue = true;
142
- }
143
- }
144
- this.query = value;
145
- }
146
- // CONTROL_VALUE_ACCESSOR interface
147
- registerOnChange(fn) {
148
- this.updateModel = fn;
149
- }
150
- // CONTROL_VALUE_ACCESSOR interface
151
- registerOnTouched() { }
152
- setDisabledState(isDisabled) {
153
- this.isDisabled = isDisabled;
154
- }
155
- ngOnInit() {
156
- if (Array.isArray(this.data) && this.data.length > 0 && !this.query && this.showAllByDefault) {
157
- this.results = [...this.data];
158
- }
159
- }
160
- // OnChanges interface
161
- ngOnChanges(changes) {
162
- if (!changes) {
163
- return;
164
- }
165
- const newData = get(changes, 'data.currentValue', []);
166
- if (!isEqual(newData, get(changes, 'data.previousValue', []))) {
167
- if (this.remote) {
168
- this.remoteSearch();
169
- }
170
- else {
171
- this.localSearch();
172
- }
173
- }
174
- if (changes.results && changes.results.currentValue) {
175
- this.searching = false;
176
- }
177
- }
178
- propagateChange(item) {
179
- this.query = item !== null ? (this.label ? item[this.label] : item) : '';
180
- this.select.emit(item);
181
- if (!item) {
182
- return;
183
- }
184
- const key = this.value ? this.value : this.label ? this.label : null;
185
- this.updateModel(key ? item[key] || '' : item);
186
- this.selectedItem = item;
187
- }
188
- /**
189
- * triggers on input value change
190
- */
191
- doSearch() {
192
- this.index = -1; // reset index
193
- this.searching = true;
194
- if (this.remote) {
195
- this.search.emit(this.query); // ask for new remote data
196
- }
197
- else {
198
- this.localSearch();
199
- }
200
- this.openFlyout(); // open the flyout when there is a change
201
- }
202
- /**
203
- * triggers on selectable-list:select -> onClick event in selectable-list
204
- */
205
- onSelect(item) {
206
- this.propagateChange(item);
207
- this.closeFlyout(); // Close the flyout manually
208
- }
209
- onFlyoutClosed() {
210
- // there is only 1 result, select it
211
- if (this.index >= 0 && this.results.length === 1) {
212
- return this.onSelect(this.results[0]);
213
- }
214
- // there is no query nor selected item, clear the selected item
215
- if (!this.query && this.index < 0) {
216
- return this.onSelect(null);
217
- }
218
- // reset the query for an invalid query if clearInvalid is true
219
- if (this.clearInvalid && this.query && !this.results.length && this.index < 0) {
220
- this.query = this.selectedItem ? (this.label ? this.selectedItem[this.label] : this.selectedItem) : '';
221
- }
222
- }
223
- onKeyArrowDown() {
224
- if (this.index < this.results.length - 1) {
225
- this.scrollList(1);
226
- }
227
- this.openFlyout();
228
- }
229
- onKeyArrowUp() {
230
- if (this.index >= 0) {
231
- this.scrollList(-1);
232
- }
233
- }
234
- onKeyEnter(event) {
235
- event.preventDefault(); // Do not submit form when selecting an item.
236
- const query = this.index >= 0 ? this.results[this.index] : this.query;
237
- this.propagateChange(query);
238
- this.closeFlyout();
239
- }
240
- onKeyEscape() {
241
- this.closeFlyout();
242
- }
243
- onFocus() {
244
- this.focused = true;
245
- this.openFlyout();
246
- }
247
- openFlyout() {
248
- if (this.flyout) {
249
- this.flyout.open();
250
- }
251
- }
252
- closeFlyout() {
253
- if (this.flyout) {
254
- this.flyout.close();
255
- }
256
- this.focused = false;
257
- }
258
- localSearch() {
259
- this.results = this.searchService.search(this.data, {
260
- minLength: this.minCharacters,
261
- key: this.label,
262
- query: this.query,
263
- showAllByDefault: this.showAllByDefault,
264
- });
265
- if (this.results.length === 1 && this.query === this.results[0][this.label]) {
266
- this.index = 0;
267
- }
268
- this.searching = false;
269
- }
270
- remoteSearch() {
271
- if (!this.remoteValue || !this.data) {
272
- return;
273
- }
274
- const selected = this.data.find((item) => {
275
- if (this.value) {
276
- return item[this.value] === this.query;
277
- }
278
- return item === this.query;
279
- });
280
- if (selected) {
281
- this.query = this.label ? selected[this.label] : selected;
282
- }
283
- else {
284
- this.query = '';
285
- }
286
- this.remoteValue = false;
287
- }
288
- scrollList(factor) {
289
- this.index += factor;
290
- if (!this.flyoutZone) {
291
- return;
292
- }
293
- const liItems = this.flyoutZone.element.getElementsByTagName('li');
294
- const liHeight = liItems[1] ? liItems[1].offsetHeight : liItems[0].offsetHeight;
295
- const zoneHeight = this.flyoutZone.element.offsetHeight;
296
- const offset = zoneHeight / liHeight / 2;
297
- this.flyoutZone.element.scrollTop = this.index * liHeight - offset * liHeight;
298
- }
299
- }
300
- /** @nocollapse */ AutoCompleteComponent.ɵfac = function AutoCompleteComponent_Factory(t) { return new (t || AutoCompleteComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(SearchService)); };
301
- /** @nocollapse */ AutoCompleteComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: AutoCompleteComponent, selectors: [["aui-auto-complete"]], contentQueries: function AutoCompleteComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
302
- i0.ɵɵcontentQuery(dirIndex, TemplateRef, 7);
303
- } if (rf & 2) {
304
- let _t;
305
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.template = _t.first);
306
- } }, viewQuery: function AutoCompleteComponent_Query(rf, ctx) { if (rf & 1) {
307
- i0.ɵɵviewQuery(FlyoutDirective, 7);
308
- i0.ɵɵviewQuery(FlyoutZoneDirective, 7);
309
- } if (rf & 2) {
310
- let _t;
311
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.flyout = _t.first);
312
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.flyoutZone = _t.first);
313
- } }, inputs: { id: "id", placeholder: "placeholder", description: "description", inputLabel: "inputLabel", results: "results", data: "data", remote: "remote", minCharacters: "minCharacters", clearInvalid: "clearInvalid", searchIncentiveText: "searchIncentiveText", loadingText: "loadingText", noResultsText: "noResultsText", showAllByDefault: "showAllByDefault", autoComplete: "autoComplete", label: "label", value: "value" }, outputs: { search: "search", select: "select" }, features: [i0.ɵɵProvidersFeature([
314
- {
315
- provide: NG_VALUE_ACCESSOR,
316
- useExisting: forwardRef((() => AutoCompleteComponent)),
317
- multi: true,
318
- },
319
- ]), i0.ɵɵNgOnChangesFeature], decls: 3, vars: 7, consts: [["aria-haspopup", "listbox", "auiFlyout", "", 1, "m-flyout", "m-flyout--scrollable", "m-flyout--full", "o-auto-complete", 3, "toggleClick", "closed"], ["aria-autocomplete", "list", "auiFlyoutAction", "", "auiSelectableActions", "", "type", "text", 1, "a-input", 3, "ngModel", "disabled", "id", "placeholder", "autocomplete", "focus", "keyArrowDown", "keyArrowUp", "keyEnter", "keyEscape", "ngModelChange"], ["auiFlyoutZone", "", 4, "ngIf"], ["auiFlyoutZone", ""], ["class", "a-spinner a-spinner--s u-margin-xs", "role", "alert", 4, "ngIf"], ["class", "o-auto-complete__info u-text-light u-margin-xs", 4, "ngIf"], [3, "index", "itemTemplate", "items", "label", "search", "selected", 4, "ngIf"], ["role", "alert", 1, "a-spinner", "a-spinner--s", "u-margin-xs"], [1, "a-spinner__circle"], [1, "a-spinner__text"], [1, "o-auto-complete__info", "u-text-light", "u-margin-xs"], [3, "index", "itemTemplate", "items", "label", "search", "selected"]], template: function AutoCompleteComponent_Template(rf, ctx) { if (rf & 1) {
320
- i0.ɵɵelementStart(0, "div", 0);
321
- i0.ɵɵlistener("closed", function AutoCompleteComponent_Template_div_closed_0_listener() { return ctx.onFlyoutClosed(); });
322
- i0.ɵɵelementStart(1, "input", 1);
323
- i0.ɵɵlistener("focus", function AutoCompleteComponent_Template_input_focus_1_listener() { return ctx.onFocus(); })("keyArrowDown", function AutoCompleteComponent_Template_input_keyArrowDown_1_listener() { return ctx.onKeyArrowDown(); })("keyArrowUp", function AutoCompleteComponent_Template_input_keyArrowUp_1_listener() { return ctx.onKeyArrowUp(); })("keyEnter", function AutoCompleteComponent_Template_input_keyEnter_1_listener($event) { return ctx.onKeyEnter($event); })("keyEscape", function AutoCompleteComponent_Template_input_keyEscape_1_listener() { return ctx.onKeyEscape(); })("ngModelChange", function AutoCompleteComponent_Template_input_ngModelChange_1_listener($event) { return ctx.query = $event; })("ngModelChange", function AutoCompleteComponent_Template_input_ngModelChange_1_listener() { return ctx.doSearch(); });
324
- i0.ɵɵelementEnd();
325
- i0.ɵɵtemplate(2, AutoCompleteComponent_div_2_Template, 5, 4, "div", 2);
326
- i0.ɵɵelementEnd();
327
- } if (rf & 2) {
328
- i0.ɵɵproperty("toggleClick", false);
329
- i0.ɵɵadvance(1);
330
- i0.ɵɵproperty("ngModel", ctx.query)("disabled", ctx.isDisabled ? true : null)("id", ctx.id)("placeholder", ctx.placeholder)("autocomplete", ctx.autoComplete);
331
- i0.ɵɵadvance(1);
332
- i0.ɵɵproperty("ngIf", !ctx.isDisabled);
333
- } }, dependencies: [i1.NgIf, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.NgModel, i4.FlyoutActionDirective, i4.FlyoutZoneDirective, i4.FlyoutDirective, i5.SelectableListComponent, i5.SelectableActionsDirective], styles: [".o-auto-complete[_ngcontent-%COMP%], .o-auto-complete__info[_ngcontent-%COMP%]{display:block}"] });
334
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AutoCompleteComponent, [{
335
- type: Component,
336
- args: [{ selector: 'aui-auto-complete', providers: [
337
- {
338
- provide: NG_VALUE_ACCESSOR,
339
- useExisting: forwardRef((() => AutoCompleteComponent)),
340
- multi: true,
341
- },
342
- ], template: "<div\n (closed)=\"onFlyoutClosed()\"\n [toggleClick]=\"false\"\n aria-haspopup=\"listbox\"\n auiFlyout\n class=\"m-flyout m-flyout--scrollable m-flyout--full o-auto-complete\"\n>\n <input\n (focus)=\"onFocus()\"\n (keyArrowDown)=\"onKeyArrowDown()\"\n (keyArrowUp)=\"onKeyArrowUp()\"\n (keyEnter)=\"onKeyEnter($event)\"\n (keyEscape)=\"onKeyEscape()\"\n [(ngModel)]=\"query\"\n (ngModelChange)=\"doSearch()\"\n [disabled]=\"isDisabled ? true : null\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n aria-autocomplete=\"list\"\n auiFlyoutAction\n auiSelectableActions\n [autocomplete]=\"autoComplete\"\n type=\"text\"\n class=\"a-input\"\n />\n <div *ngIf=\"!isDisabled\" auiFlyoutZone>\n <span *ngIf=\"focused && loadingText && searching\" class=\"a-spinner a-spinner--s u-margin-xs\" role=\"alert\">\n <span class=\"a-spinner__circle\"></span>\n <span class=\"a-spinner__text\">{{ loadingText }}</span>\n </span>\n <span\n *ngIf=\"focused && searchIncentiveText && !searching && !query && !results.length\"\n class=\"o-auto-complete__info u-text-light u-margin-xs\"\n >{{ searchIncentiveText }}</span\n >\n <span\n *ngIf=\"focused && noResultsText && !searching && query && !results.length\"\n class=\"o-auto-complete__info u-text-light u-margin-xs\"\n >{{ noResultsText }}</span\n >\n <aui-selectable-list\n (selected)=\"onSelect($event)\"\n *ngIf=\"results.length > 0 && !(focused && loadingText && searching)\"\n [index]=\"index\"\n [itemTemplate]=\"template\"\n [items]=\"results\"\n [label]=\"label\"\n [search]=\"query\"\n ></aui-selectable-list>\n </div>\n</div>\n", styles: [".o-auto-complete,.o-auto-complete__info{display:block}\n"] }]
343
- }], function () { return [{ type: i0.ElementRef }, { type: SearchService }]; }, { id: [{
344
- type: Input
345
- }], placeholder: [{
346
- type: Input
347
- }], description: [{
348
- type: Input
349
- }], inputLabel: [{
350
- type: Input
351
- }], results: [{
352
- type: Input
353
- }], data: [{
354
- type: Input
355
- }], remote: [{
356
- type: Input
357
- }], minCharacters: [{
358
- type: Input
359
- }], clearInvalid: [{
360
- type: Input
361
- }], searchIncentiveText: [{
362
- type: Input
363
- }], loadingText: [{
364
- type: Input
365
- }], noResultsText: [{
366
- type: Input
367
- }], showAllByDefault: [{
368
- type: Input
369
- }], autoComplete: [{
370
- type: Input
371
- }], label: [{
372
- type: Input
373
- }], value: [{
374
- type: Input
375
- }], search: [{
376
- type: Output
377
- }], select: [{
378
- type: Output
379
- }], flyout: [{
380
- type: ViewChild,
381
- args: [FlyoutDirective, { static: true }]
382
- }], flyoutZone: [{
383
- type: ViewChild,
384
- args: [FlyoutZoneDirective, { static: true }]
385
- }], template: [{
386
- type: ContentChild,
387
- args: [TemplateRef, { static: true }]
388
- }] }); })();
389
-
390
- class AutoCompleteModule {
391
- }
392
- /** @nocollapse */ AutoCompleteModule.ɵfac = function AutoCompleteModule_Factory(t) { return new (t || AutoCompleteModule)(); };
393
- /** @nocollapse */ AutoCompleteModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: AutoCompleteModule });
394
- /** @nocollapse */ AutoCompleteModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [SearchService], imports: [CommonModule, FormsModule, FlyoutModule, SelectableListModule] });
395
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AutoCompleteModule, [{
396
- type: NgModule,
397
- args: [{
398
- imports: [CommonModule, FormsModule, FlyoutModule, SelectableListModule],
399
- declarations: [AutoCompleteComponent],
400
- exports: [AutoCompleteComponent],
401
- providers: [SearchService],
402
- }]
403
- }], null, null); })();
404
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AutoCompleteModule, { declarations: [AutoCompleteComponent], imports: [CommonModule, FormsModule, FlyoutModule, SelectableListModule], exports: [AutoCompleteComponent] }); })();
405
-
406
- const DATEPICKER_ERROR_LABELS = new InjectionToken('errorLabels');
407
- const DATEPICKER_DEFAULT_ERROR_LABELS = {
408
- ERRORS_INVALID_DATE: 'INVALID_DATE',
409
- ERRORS_INVALID_RANGE: 'INVALID_RANGE',
410
- };
411
- const DATEPICKER_SEPARATOR_CHAR = '/';
412
-
413
- function DatepickerComponent_label_1_Template(rf, ctx) { if (rf & 1) {
414
- i0.ɵɵelementStart(0, "label", 6);
415
- i0.ɵɵtext(1);
416
- i0.ɵɵelementEnd();
417
- } if (rf & 2) {
418
- const ctx_r0 = i0.ɵɵnextContext();
419
- i0.ɵɵpropertyInterpolate("for", ctx_r0.id);
420
- i0.ɵɵadvance(1);
421
- i0.ɵɵtextInterpolate(ctx_r0.label);
422
- } }
423
- function DatepickerComponent_small_2_Template(rf, ctx) { if (rf & 1) {
424
- i0.ɵɵelementStart(0, "small", 7);
425
- i0.ɵɵtext(1);
426
- i0.ɵɵelementEnd();
427
- } if (rf & 2) {
428
- const ctx_r1 = i0.ɵɵnextContext();
429
- i0.ɵɵadvance(1);
430
- i0.ɵɵtextInterpolate1(" ", ctx_r1.description, "");
431
- } }
432
- function DatepickerComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
433
- i0.ɵɵelementContainerStart(0);
434
- i0.ɵɵelement(1, "aui-icon", 8);
435
- i0.ɵɵelementContainerEnd();
436
- } }
437
- function DatepickerComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
438
- i0.ɵɵelementContainerStart(0);
439
- i0.ɵɵelement(1, "aui-icon", 9);
440
- i0.ɵɵelementContainerEnd();
441
- } if (rf & 2) {
442
- const ctx_r3 = i0.ɵɵnextContext();
443
- i0.ɵɵadvance(1);
444
- i0.ɵɵproperty("openOnFocus", false);
445
- i0.ɵɵattribute("aria-label", ctx_r3.ariaOpenDatepickerLabel);
446
- } }
447
- function DatepickerComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
448
- const _r6 = i0.ɵɵgetCurrentView();
449
- i0.ɵɵelementContainerStart(0);
450
- i0.ɵɵelementStart(1, "div", 10)(2, "aui-calendar", 11);
451
- i0.ɵɵlistener("selectDate", function DatepickerComponent_ng_container_7_Template_aui_calendar_selectDate_2_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.selectDateFromCalendar($event)); });
452
- i0.ɵɵelementEnd()();
453
- i0.ɵɵelementContainerEnd();
454
- } if (rf & 2) {
455
- const ctx_r4 = i0.ɵɵnextContext();
456
- i0.ɵɵadvance(2);
457
- i0.ɵɵproperty("range", ctx_r4.range)("selectedDate", ctx_r4.selectedDate)("interval", ctx_r4.interval)("weekdayLabels", ctx_r4.weekdayLabels)("monthLabels", ctx_r4.monthLabels);
458
- } }
459
- class DatepickerComponent {
460
- constructor(moduleMonthLabels = CALENDAR_DEFAULT_MONTH_LABELS, moduleWeekdayLabels = CALENDAR_DEFAULT_WEEKDAY_LABELS, errorLabels = DATEPICKER_DEFAULT_ERROR_LABELS, calendarService, formBuilder, ref) {
461
- this.moduleMonthLabels = moduleMonthLabels;
462
- this.moduleWeekdayLabels = moduleWeekdayLabels;
463
- this.errorLabels = errorLabels;
464
- this.calendarService = calendarService;
465
- this.formBuilder = formBuilder;
466
- this.ref = ref;
467
- this.placeholder = 'dd/mm/yyyy';
468
- this.ariaOpenDatepickerLabel = 'Open kalender';
469
- // eslint-disable-next-line @angular-eslint/no-output-native
470
- this.blur = new EventEmitter();
471
- this.isDisabled = false;
472
- this.componentDestroyed$ = new Subject();
473
- this.onChange = () => undefined;
474
- this.onTouched = () => undefined;
475
- }
476
- ngOnInit() {
477
- this.weekdayLabels = this.weekdayLabels || this.moduleWeekdayLabels;
478
- this.monthLabels = this.monthLabels || this.moduleMonthLabels;
479
- this.createInterval();
480
- this.formControl = this.formBuilder.control({ value: '', disabled: this.isDisabled });
481
- this.formControl.valueChanges.pipe(takeUntil(this.componentDestroyed$)).subscribe((value) => {
482
- if (value) {
483
- const format = value.split(DATEPICKER_SEPARATOR_CHAR).reverse().join('-');
484
- const date = DateHelper.parseDate(format, 'yyyy-MM-dd');
485
- if (date) {
486
- this.selectedDate = date;
487
- const brusselsDate = new TZDate(date, 'Europe/Brussels');
488
- const year = brusselsDate.getFullYear();
489
- const month = brusselsDate.getMonth();
490
- const day = brusselsDate.getDate();
491
- this.onChange(DateHelper.toUtcMidnightInBrussels(year, month, day));
492
- }
493
- else {
494
- this.onChange(value);
495
- }
496
- }
497
- else {
498
- this.selectedDate = null;
499
- this.onChange('');
500
- }
501
- });
502
- }
503
- ngOnChanges(changes) {
504
- if (changes.min || changes.max) {
505
- this.createInterval();
506
- }
507
- }
508
- ngOnDestroy() {
509
- this.componentDestroyed$.next(true);
510
- this.componentDestroyed$.complete();
511
- }
512
- createInterval() {
513
- if (!this.min && !this.max) {
514
- return;
515
- }
516
- // Create an interval if min/max is filled in
517
- this.interval = IntervalBuilder.dateInterval(this.min ? new Date(this.min) : null, this.max ? new Date(this.max) : null)
518
- .not()
519
- .build();
520
- }
521
- writeValue(value) {
522
- if (typeof value === 'string') {
523
- if (this.isISODateFormat(value)) {
524
- this.selectedDate = DateHelper.parseDate(value);
525
- }
526
- else {
527
- this.selectedDate = DateHelper.parseDate(value, 'dd/MM/yyyy');
528
- }
529
- }
530
- else if (value instanceof Date) {
531
- this.selectedDate = value;
532
- }
533
- else {
534
- this.selectedDate = null;
535
- }
536
- const dateString = this.selectedDate ? this.formatDate(this.selectedDate) : '';
537
- this.formControl.setValue(dateString);
538
- }
539
- registerOnChange(onChange) {
540
- this.onChange = onChange;
541
- }
542
- registerOnTouched(onTouched) {
543
- this.onTouched = onTouched;
544
- }
545
- setDisabledState(isDisabled) {
546
- this.isDisabled = isDisabled;
547
- if (this.formControl) {
548
- if (isDisabled && this.formControl.enabled) {
549
- this.formControl.disable();
550
- }
551
- else if (!isDisabled && this.formControl.disabled) {
552
- this.formControl.enable();
553
- }
554
- }
555
- this.ref.markForCheck();
556
- }
557
- selectDateFromCalendar(result) {
558
- if (result.complete) {
559
- this.formControl.setValue(this.formatDate(result.date));
560
- this.flyout.close();
561
- }
562
- }
563
- formatDate(date) {
564
- return DateHelper.formatDate(date, 'DD/MM/YYYY', {
565
- leadingZero: true,
566
- monthLabels: this.monthLabels,
567
- weekdayLabels: this.weekdayLabels,
568
- });
569
- }
570
- validate(ctrl) {
571
- // no error on empty value (add required validator in app)
572
- if (ctrl.value === '' || ctrl.value === null) {
573
- return null;
574
- }
575
- // throw format error if no valid date was provided
576
- const date = DateHelper.parseDate(ctrl.value);
577
- if (!date) {
578
- return {
579
- format: this.errorLabels.ERRORS_INVALID_DATE,
580
- };
581
- }
582
- // no error if valid date an no range provided
583
- if (!this.range || !this.range.length) {
584
- return null;
585
- }
586
- // throw error when out of range
587
- const range = this.calendarService.getRangeForDate(date, this.range);
588
- return range.indexOf(date.getDate()) >= 0
589
- ? {
590
- range: this.errorLabels.ERRORS_INVALID_RANGE,
591
- }
592
- : null;
593
- }
594
- handleBlur(e) {
595
- this.blur.emit(e);
596
- this.onTouched(e);
597
- }
598
- isISODateFormat(value) {
599
- if (typeof value !== 'string') {
600
- return false;
601
- }
602
- return value.match(/\d{4}-\d{2}-\d{2}T.*/);
603
- }
604
- }
605
- /** @nocollapse */ DatepickerComponent.ɵfac = function DatepickerComponent_Factory(t) { return new (t || DatepickerComponent)(i0.ɵɵdirectiveInject(CALENDAR_MONTH_LABELS), i0.ɵɵdirectiveInject(CALENDAR_WEEKDAY_LABELS), i0.ɵɵdirectiveInject(DATEPICKER_ERROR_LABELS), i0.ɵɵdirectiveInject(i1$2.CalendarService), i0.ɵɵdirectiveInject(i1$1.UntypedFormBuilder), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
606
- /** @nocollapse */ DatepickerComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DatepickerComponent, selectors: [["aui-datepicker"]], viewQuery: function DatepickerComponent_Query(rf, ctx) { if (rf & 1) {
607
- i0.ɵɵviewQuery(FlyoutDirective, 7);
608
- } if (rf & 2) {
609
- let _t;
610
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.flyout = _t.first);
611
- } }, inputs: { id: "id", name: "name", placeholder: "placeholder", label: "label", description: "description", range: "range", min: "min", max: "max", autocomplete: "autocomplete", weekdayLabels: "weekdayLabels", monthLabels: "monthLabels", ariaOpenDatepickerLabel: "ariaOpenDatepickerLabel" }, outputs: { blur: "blur" }, features: [i0.ɵɵProvidersFeature([
612
- {
613
- provide: NG_VALUE_ACCESSOR,
614
- useExisting: forwardRef((() => DatepickerComponent)),
615
- multi: true,
616
- },
617
- {
618
- provide: NG_VALIDATORS,
619
- useExisting: forwardRef((() => DatepickerComponent)),
620
- multi: true,
621
- },
622
- ]), i0.ɵɵNgOnChangesFeature], decls: 8, vars: 11, consts: [["aria-haspopup", "grid", "auiFlyout", "", 1, "aui-datepicker", "a-input", "has-icon-right"], ["class", "a-input__label", 3, "for", 4, "ngIf"], ["class", "a-input__description", 4, "ngIf"], [1, "a-input__wrapper"], ["label", "Pick date", "description", "Description", "type", "text", 3, "autocomplete", "formControl", "id", "name", "placeholder", "blur"], [4, "ngIf"], [1, "a-input__label", 3, "for"], [1, "a-input__description"], ["name", "ai-calendar"], ["auiFlyoutAction", "", "name", "ai-calendar", "className", "is-clickable", "role", "button", "tabindex", "0", 3, "openOnFocus"], ["auiFlyoutZone", "", "role", "dialog", 1, "m-datepicker", "m-datepicker--fixed"], [3, "range", "selectedDate", "interval", "weekdayLabels", "monthLabels", "selectDate"]], template: function DatepickerComponent_Template(rf, ctx) { if (rf & 1) {
623
- i0.ɵɵelementStart(0, "div", 0);
624
- i0.ɵɵtemplate(1, DatepickerComponent_label_1_Template, 2, 2, "label", 1);
625
- i0.ɵɵtemplate(2, DatepickerComponent_small_2_Template, 2, 1, "small", 2);
626
- i0.ɵɵelementStart(3, "div", 3)(4, "input", 4);
627
- i0.ɵɵlistener("blur", function DatepickerComponent_Template_input_blur_4_listener($event) { return ctx.handleBlur($event); });
628
- i0.ɵɵelementEnd();
629
- i0.ɵɵtemplate(5, DatepickerComponent_ng_container_5_Template, 2, 0, "ng-container", 5);
630
- i0.ɵɵtemplate(6, DatepickerComponent_ng_container_6_Template, 2, 2, "ng-container", 5);
631
- i0.ɵɵtemplate(7, DatepickerComponent_ng_container_7_Template, 3, 5, "ng-container", 5);
632
- i0.ɵɵelementEnd()();
633
- } if (rf & 2) {
634
- i0.ɵɵadvance(1);
635
- i0.ɵɵproperty("ngIf", ctx.label);
636
- i0.ɵɵadvance(1);
637
- i0.ɵɵproperty("ngIf", ctx.description);
638
- i0.ɵɵadvance(2);
639
- i0.ɵɵpropertyInterpolate("id", ctx.id);
640
- i0.ɵɵpropertyInterpolate("name", ctx.name);
641
- i0.ɵɵpropertyInterpolate("placeholder", ctx.placeholder);
642
- i0.ɵɵproperty("autocomplete", ctx.autocomplete)("formControl", ctx.formControl);
643
- i0.ɵɵattribute("disabled", ctx.isDisabled ? true : null);
644
- i0.ɵɵadvance(1);
645
- i0.ɵɵproperty("ngIf", ctx.isDisabled);
646
- i0.ɵɵadvance(1);
647
- i0.ɵɵproperty("ngIf", !ctx.isDisabled);
648
- i0.ɵɵadvance(1);
649
- i0.ɵɵproperty("ngIf", !ctx.isDisabled);
650
- } }, dependencies: [i1.NgIf, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.FormControlDirective, i1$2.CalendarComponent, i4$1.IconComponent, i4.FlyoutActionDirective, i4.FlyoutZoneDirective, i4.FlyoutDirective], styles: ["[_nghost-%COMP%], .aui-datepicker[_ngcontent-%COMP%]{display:block}.m-flyout.is-open[_ngcontent-%COMP%] .m-datepicker[_ngcontent-%COMP%]{opacity:1;transform:translateY(calc(var(--BORDER-WIDTH) * -1));transition-delay:0s;visibility:visible}"], changeDetection: 0 });
651
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatepickerComponent, [{
652
- type: Component,
653
- args: [{ selector: 'aui-datepicker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
654
- {
655
- provide: NG_VALUE_ACCESSOR,
656
- useExisting: forwardRef((() => DatepickerComponent)),
657
- multi: true,
658
- },
659
- {
660
- provide: NG_VALIDATORS,
661
- useExisting: forwardRef((() => DatepickerComponent)),
662
- multi: true,
663
- },
664
- ], template: "<div aria-haspopup=\"grid\" auiFlyout class=\"aui-datepicker a-input has-icon-right\">\n <label class=\"a-input__label\" for=\"{{ id }}\" *ngIf=\"label\">{{ label }}</label>\n <small class=\"a-input__description\" *ngIf=\"description\"> {{ description }}</small>\n <div class=\"a-input__wrapper\">\n <input\n (blur)=\"handleBlur($event)\"\n [attr.disabled]=\"isDisabled ? true : null\"\n [autocomplete]=\"autocomplete\"\n [formControl]=\"formControl\"\n id=\"{{ id }}\"\n label=\"Pick date\"\n description=\"Description\"\n name=\"{{ name }}\"\n placeholder=\"{{ placeholder }}\"\n type=\"text\"\n />\n <ng-container *ngIf=\"isDisabled\">\n <aui-icon\n name=\"ai-calendar\"\n />\n </ng-container>\n <ng-container *ngIf=\"!isDisabled\">\n <aui-icon\n auiFlyoutAction\n [openOnFocus]=\"false\"\n name=\"ai-calendar\"\n className=\"is-clickable\"\n role=\"button\"\n [attr.aria-label]=\"ariaOpenDatepickerLabel\"\n tabindex=\"0\"\n />\n </ng-container>\n\n <ng-container *ngIf=\"!isDisabled\">\n <div auiFlyoutZone class=\"m-datepicker m-datepicker--fixed\" role=\"dialog\">\n <aui-calendar\n (selectDate)=\"selectDateFromCalendar($event)\"\n [range]=\"range\"\n [selectedDate]=\"selectedDate\"\n [interval]=\"interval\"\n [weekdayLabels]=\"weekdayLabels\"\n [monthLabels]=\"monthLabels\"\n ></aui-calendar>\n </div>\n </ng-container>\n </div>\n</div>\n", styles: [":host,.aui-datepicker{display:block}.m-flyout.is-open .m-datepicker{opacity:1;transform:translateY(calc(var(--BORDER-WIDTH) * -1));transition-delay:0s;visibility:visible}\n"] }]
665
- }], function () { return [{ type: undefined, decorators: [{
666
- type: Inject,
667
- args: [CALENDAR_MONTH_LABELS]
668
- }] }, { type: undefined, decorators: [{
669
- type: Inject,
670
- args: [CALENDAR_WEEKDAY_LABELS]
671
- }] }, { type: undefined, decorators: [{
672
- type: Inject,
673
- args: [DATEPICKER_ERROR_LABELS]
674
- }] }, { type: i1$2.CalendarService }, { type: i1$1.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }]; }, { flyout: [{
675
- type: ViewChild,
676
- args: [FlyoutDirective, { static: true }]
677
- }], id: [{
678
- type: Input
679
- }], name: [{
680
- type: Input
681
- }], placeholder: [{
682
- type: Input
683
- }], label: [{
684
- type: Input
685
- }], description: [{
686
- type: Input
687
- }], range: [{
688
- type: Input
689
- }], min: [{
690
- type: Input
691
- }], max: [{
692
- type: Input
693
- }], autocomplete: [{
694
- type: Input
695
- }], weekdayLabels: [{
696
- type: Input
697
- }], monthLabels: [{
698
- type: Input
699
- }], ariaOpenDatepickerLabel: [{
700
- type: Input
701
- }], blur: [{
702
- type: Output
703
- }] }); })();
704
-
705
- class DatepickerModule {
706
- static forChild(weekdayLabels, monthLabels, errorLabels) {
707
- return {
708
- ngModule: DatepickerModule,
709
- providers: [
710
- { provide: CALENDAR_WEEKDAY_LABELS, useValue: weekdayLabels },
711
- { provide: CALENDAR_MONTH_LABELS, useValue: monthLabels },
712
- { provide: DATEPICKER_ERROR_LABELS, useValue: errorLabels },
713
- ],
714
- };
715
- }
716
- }
717
- /** @nocollapse */ DatepickerModule.ɵfac = function DatepickerModule_Factory(t) { return new (t || DatepickerModule)(); };
718
- /** @nocollapse */ DatepickerModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: DatepickerModule });
719
- /** @nocollapse */ DatepickerModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [
720
- {
721
- provide: CALENDAR_WEEKDAY_LABELS,
722
- useValue: CALENDAR_DEFAULT_WEEKDAY_LABELS,
723
- },
724
- { provide: CALENDAR_MONTH_LABELS, useValue: CALENDAR_DEFAULT_MONTH_LABELS },
725
- {
726
- provide: DATEPICKER_ERROR_LABELS,
727
- useValue: DATEPICKER_DEFAULT_ERROR_LABELS,
728
- },
729
- ], imports: [CommonModule, FormsModule, ReactiveFormsModule, CalendarModule, IconModule, FlyoutModule] });
730
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatepickerModule, [{
731
- type: NgModule,
732
- args: [{
733
- imports: [CommonModule, FormsModule, ReactiveFormsModule, CalendarModule, IconModule, FlyoutModule],
734
- declarations: [DatepickerComponent],
735
- exports: [DatepickerComponent],
736
- providers: [
737
- {
738
- provide: CALENDAR_WEEKDAY_LABELS,
739
- useValue: CALENDAR_DEFAULT_WEEKDAY_LABELS,
740
- },
741
- { provide: CALENDAR_MONTH_LABELS, useValue: CALENDAR_DEFAULT_MONTH_LABELS },
742
- {
743
- provide: DATEPICKER_ERROR_LABELS,
744
- useValue: DATEPICKER_DEFAULT_ERROR_LABELS,
745
- },
746
- ],
747
- }]
748
- }], null, null); })();
749
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(DatepickerModule, { declarations: [DatepickerComponent], imports: [CommonModule, FormsModule, ReactiveFormsModule, CalendarModule, IconModule, FlyoutModule], exports: [DatepickerComponent] }); })();
750
-
751
- function RangeSliderComponent_div_6_Template(rf, ctx) { if (rf & 1) {
752
- i0.ɵɵelement(0, "div", 11);
753
- } }
754
- function RangeSliderComponent_span_9_Template(rf, ctx) { if (rf & 1) {
755
- const _r5 = i0.ɵɵgetCurrentView();
756
- i0.ɵɵelementStart(0, "span", 12);
757
- i0.ɵɵlistener("blur", function RangeSliderComponent_span_9_Template_span_blur_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.toggleFocus(false, null, $event)); })("dragexit", function RangeSliderComponent_span_9_Template_span_dragexit_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.onMouseUp($event)); })("focus", function RangeSliderComponent_span_9_Template_span_focus_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.toggleFocus(true, "end", $event)); })("mousedown", function RangeSliderComponent_span_9_Template_span_mousedown_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r8 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r8.onMouseDown("end")); })("touchstart", function RangeSliderComponent_span_9_Template_span_touchstart_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r9.onMouseDown("end")); });
758
- i0.ɵɵelementEnd();
759
- } if (rf & 2) {
760
- const ctx_r1 = i0.ɵɵnextContext();
761
- i0.ɵɵstyleProp("left", ctx_r1.endPercentage + "%");
762
- i0.ɵɵattribute("aria-label", ctx_r1.ariaLabelMax);
763
- } }
764
- class RangeSliderComponent {
765
- constructor(elRef) {
766
- this.elRef = elRef;
767
- this.coreBranding = true;
768
- this.min = 0;
769
- this.max = 100;
770
- this.minimalDistance = 1;
771
- this.step = 0;
772
- this.label = '';
773
- this.labelBefore = '';
774
- this.labelAfter = '';
775
- this.ariaLabelMin = 'Minimum';
776
- this.ariaLabelMax = 'Maximum';
777
- this.start = 0;
778
- this.end = false;
779
- this.steps = [];
780
- this.active = null;
781
- this.isDisabled = false;
782
- this.hasFocus = false;
783
- this.click = false;
784
- this.propagateChange = (value) => { };
785
- }
786
- get disabledClass() {
787
- return this.isDisabled;
788
- }
789
- ngOnInit() {
790
- if (this.step > 0) {
791
- for (let i = 0; i <= this.max; i += Number(this.step)) {
792
- this.steps.push(i);
793
- }
794
- }
795
- this.startPercentage = this.startToPercentage();
796
- if (this.end) {
797
- this.endPercentage = this.endToPercentage();
798
- }
799
- }
800
- writeValue(value) {
801
- if (value && value.start) {
802
- this.start = value.start;
803
- }
804
- else if (!isNaN(value) && value !== '') {
805
- this.start = Number(value);
806
- }
807
- else {
808
- this.setStart(Number(this.min));
809
- }
810
- this.startPercentage = this.startToPercentage();
811
- if (value && value.end) {
812
- this.end = value.end;
813
- this.endPercentage = this.endToPercentage();
814
- }
815
- }
816
- registerOnTouched() { }
817
- registerOnChange(fn) {
818
- this.propagateChange = fn;
819
- }
820
- setDisabledState(isDisabled) {
821
- this.isDisabled = isDisabled;
822
- }
823
- onMouseDown(handle) {
824
- if (this.isDisabled) {
825
- return;
826
- }
827
- this.hasFocus = true;
828
- this.active = handle;
829
- }
830
- toggleFocus(hasFocus, element, $event) {
831
- if (this.isDisabled) {
832
- return;
833
- }
834
- $event.preventDefault();
835
- this.hasFocus = hasFocus;
836
- this.active = element;
837
- }
838
- onKeyDown($event) {
839
- if (!this.hasFocus) {
840
- return;
841
- }
842
- const key = $event.keyCode;
843
- const keyCodes = {
844
- end: 35,
845
- home: 36,
846
- left: 37,
847
- up: 38,
848
- right: 39,
849
- down: 40,
850
- };
851
- if (Object.keys(keyCodes)
852
- .map((e) => keyCodes[e])
853
- .indexOf(key) === -1) {
854
- return;
855
- }
856
- let increment = this.minimalDistance;
857
- if (this.step > 0) {
858
- increment = Number(this.step);
859
- }
860
- const processValue = (dir) => {
861
- let newValue = this.active === 'start' ? this.start : Number(this.end);
862
- if (dir === 'up') {
863
- newValue += increment;
864
- }
865
- else {
866
- newValue -= increment;
867
- }
868
- let newPercentage = ((newValue - this.min) / (this.max - this.min)) * 100;
869
- if (newPercentage > 100) {
870
- newPercentage = 100;
871
- }
872
- if (newPercentage < 0) {
873
- newPercentage = 0;
874
- }
875
- return newPercentage;
876
- };
877
- switch (key) {
878
- case keyCodes.right:
879
- case keyCodes.up:
880
- this.updateHandle(processValue('up'));
881
- $event.preventDefault();
882
- break;
883
- case keyCodes.left:
884
- case keyCodes.down:
885
- this.updateHandle(processValue('down'));
886
- $event.preventDefault();
887
- break;
888
- case keyCodes.end:
889
- this.updateHandle(100);
890
- $event.preventDefault();
891
- break;
892
- case keyCodes.home:
893
- this.updateHandle(0);
894
- $event.preventDefault();
895
- break;
896
- }
897
- }
898
- onMouseUp(event) {
899
- if (this.active === 'start') {
900
- this.setStart(this.round(this.start, this.step, 0));
901
- this.startPercentage = this.startToPercentage();
902
- }
903
- if (this.active === 'end') {
904
- this.setEnd(this.round(this.end, this.step, 0));
905
- this.endPercentage = this.endToPercentage();
906
- }
907
- this.click = false;
908
- }
909
- mouseDown(event) {
910
- this.click = true;
911
- }
912
- onMouseMove(event) {
913
- if (!this.active || !this.click) {
914
- return;
915
- }
916
- event.preventDefault(); // Do not select text while sliding
917
- const x = event.x !== undefined ? event.x : event.targetTouches[0].pageX;
918
- const rect = this.elRef.nativeElement.getBoundingClientRect();
919
- const newPercentage = this.calcPercentage(x, rect.width, rect.left);
920
- this.updateHandle(newPercentage);
921
- }
922
- updateHandle(newPercentage) {
923
- if (this.active === 'start') {
924
- this.startPercentage = newPercentage;
925
- this.setStart(this.percentageToStart());
926
- if (this.minimalDistanceNotRespected()) {
927
- this.setStart(Number(this.end) - Number(this.minimalDistance));
928
- this.startPercentage = this.startToPercentage();
929
- }
930
- }
931
- if (this.active === 'end' && this.endPercentage) {
932
- this.endPercentage = newPercentage;
933
- this.setEnd(this.percentageToEnd());
934
- if (this.minimalDistanceNotRespected()) {
935
- this.setEnd(Number(this.start) + Number(this.minimalDistance));
936
- this.endPercentage = this.endToPercentage();
937
- }
938
- }
939
- }
940
- // ---------- HELPERS ---------- //
941
- setStart(value) {
942
- this.start = value;
943
- if (this.end) {
944
- this.propagateChange({
945
- start: this.start,
946
- end: this.end,
947
- });
948
- }
949
- else {
950
- this.propagateChange(this.start);
951
- }
952
- }
953
- setEnd(value) {
954
- this.end = value;
955
- this.propagateChange({
956
- start: this.start,
957
- end: this.end,
958
- });
959
- }
960
- round(n, increment, offset) {
961
- if (increment > 0) {
962
- return Math.round((n - offset) / increment) * increment + offset;
963
- }
964
- return n;
965
- }
966
- startToPercentage() {
967
- return Math.round(((this.start - this.min) / (this.max - this.min)) * 100);
968
- }
969
- percentageToStart() {
970
- return Math.round((this.startPercentage / 100) * (this.max - this.min) + Number(this.min));
971
- }
972
- endToPercentage() {
973
- return Math.round(((Number(this.end) - this.min) / (this.max - this.min)) * 100);
974
- }
975
- percentageToEnd() {
976
- return Math.round((this.endPercentage / 100) * (this.max - this.min) + Number(this.min));
977
- }
978
- minimalDistanceNotRespected() {
979
- return this.minimalDistance >= 0 && this.end && this.start > Number(this.end) - this.minimalDistance;
980
- }
981
- calcPercentage(mouseX, width, offsetLeft) {
982
- const mousePos = mouseX - offsetLeft;
983
- let newPercentage = Math.round((mousePos / width) * 100);
984
- if (newPercentage > 100) {
985
- newPercentage = 100;
986
- }
987
- if (newPercentage < 0) {
988
- newPercentage = 0;
989
- }
990
- return newPercentage;
991
- }
992
- }
993
- /** @nocollapse */ RangeSliderComponent.ɵfac = function RangeSliderComponent_Factory(t) { return new (t || RangeSliderComponent)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
994
- /** @nocollapse */ RangeSliderComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: RangeSliderComponent, selectors: [["aui-range-slider"]], hostVars: 4, hostBindings: function RangeSliderComponent_HostBindings(rf, ctx) { if (rf & 1) {
995
- i0.ɵɵlistener("keydown", function RangeSliderComponent_keydown_HostBindingHandler($event) { return ctx.onKeyDown($event); }, false, i0.ɵɵresolveDocument)("touchend", function RangeSliderComponent_touchend_HostBindingHandler($event) { return ctx.onMouseUp($event); })("mouseup", function RangeSliderComponent_mouseup_HostBindingHandler($event) { return ctx.onMouseUp($event); })("touchstart", function RangeSliderComponent_touchstart_HostBindingHandler($event) { return ctx.mouseDown($event); })("mousedown", function RangeSliderComponent_mousedown_HostBindingHandler($event) { return ctx.mouseDown($event); })("touchmove", function RangeSliderComponent_touchmove_HostBindingHandler($event) { return ctx.onMouseMove($event); })("mousemove", function RangeSliderComponent_mousemove_HostBindingHandler($event) { return ctx.onMouseMove($event); });
996
- } if (rf & 2) {
997
- i0.ɵɵclassProp("m-range-slider", ctx.coreBranding)("is-disabled", ctx.disabledClass);
998
- } }, inputs: { min: "min", max: "max", minimalDistance: "minimalDistance", step: "step", label: "label", labelBefore: "labelBefore", labelAfter: "labelAfter", ariaLabelMin: "ariaLabelMin", ariaLabelMax: "ariaLabelMax" }, features: [i0.ɵɵProvidersFeature([
999
- {
1000
- provide: NG_VALUE_ACCESSOR,
1001
- useExisting: forwardRef((() => RangeSliderComponent)),
1002
- multi: true,
1003
- },
1004
- ])], decls: 15, vars: 16, consts: [[1, "a-range-slider"], [1, "a-range-slider__labels"], [1, "a-range-slider__label"], [1, "a-range-slider__inner"], [1, "a-range-slider__tickmarks"], ["class", "a-range-slider__tickmark", 4, "ngFor", "ngForOf"], [1, "a-range-slider__bar"], ["tabindex", "0", 1, "a-range-slider__handle", 3, "blur", "dragexit", "focus", "mousedown", "touchstart"], ["class", "a-range-slider__handle", "name", "a-range-slider__handle__end", "tabindex", "0", 3, "left", "blur", "dragexit", "focus", "mousedown", "touchstart", 4, "ngIf"], [1, "a-range-slider__descriptions"], [1, "a-range-slider__description", "small"], [1, "a-range-slider__tickmark"], ["name", "a-range-slider__handle__end", "tabindex", "0", 1, "a-range-slider__handle", 3, "blur", "dragexit", "focus", "mousedown", "touchstart"]], template: function RangeSliderComponent_Template(rf, ctx) { if (rf & 1) {
1005
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
1006
- i0.ɵɵtext(3);
1007
- i0.ɵɵelementEnd()();
1008
- i0.ɵɵelementStart(4, "div", 3)(5, "div", 4);
1009
- i0.ɵɵtemplate(6, RangeSliderComponent_div_6_Template, 1, 0, "div", 5);
1010
- i0.ɵɵelementEnd();
1011
- i0.ɵɵelement(7, "div", 6);
1012
- i0.ɵɵelementStart(8, "span", 7);
1013
- i0.ɵɵlistener("blur", function RangeSliderComponent_Template_span_blur_8_listener($event) { return ctx.toggleFocus(false, null, $event); })("dragexit", function RangeSliderComponent_Template_span_dragexit_8_listener($event) { return ctx.onMouseUp($event); })("focus", function RangeSliderComponent_Template_span_focus_8_listener($event) { return ctx.toggleFocus(true, "start", $event); })("mousedown", function RangeSliderComponent_Template_span_mousedown_8_listener() { return ctx.onMouseDown("start"); })("touchstart", function RangeSliderComponent_Template_span_touchstart_8_listener() { return ctx.onMouseDown("start"); });
1014
- i0.ɵɵelementEnd();
1015
- i0.ɵɵtemplate(9, RangeSliderComponent_span_9_Template, 1, 3, "span", 8);
1016
- i0.ɵɵelementEnd();
1017
- i0.ɵɵelementStart(10, "div", 9)(11, "div", 10);
1018
- i0.ɵɵtext(12);
1019
- i0.ɵɵelementEnd();
1020
- i0.ɵɵelementStart(13, "div", 10);
1021
- i0.ɵɵtext(14);
1022
- i0.ɵɵelementEnd()()();
1023
- } if (rf & 2) {
1024
- i0.ɵɵadvance(3);
1025
- i0.ɵɵtextInterpolate(ctx.label);
1026
- i0.ɵɵadvance(3);
1027
- i0.ɵɵproperty("ngForOf", ctx.steps);
1028
- i0.ɵɵadvance(1);
1029
- i0.ɵɵstyleProp("left", ctx.endPercentage ? ctx.startPercentage + "%" : false)("width", ctx.endPercentage ? ctx.endPercentage - ctx.startPercentage + "%" : ctx.startPercentage + "%");
1030
- i0.ɵɵadvance(1);
1031
- i0.ɵɵstyleProp("left", ctx.startPercentage + "%");
1032
- i0.ɵɵattribute("aria-label", ctx.ariaLabelMin);
1033
- i0.ɵɵadvance(1);
1034
- i0.ɵɵproperty("ngIf", ctx.end);
1035
- i0.ɵɵadvance(3);
1036
- i0.ɵɵtextInterpolate3("", ctx.labelBefore, "", ctx.min, "", ctx.labelAfter, "");
1037
- i0.ɵɵadvance(2);
1038
- i0.ɵɵtextInterpolate3("", ctx.labelBefore, "", ctx.max, "", ctx.labelAfter, "");
1039
- } }, dependencies: [i1.NgForOf, i1.NgIf], styles: ["[_nghost-%COMP%]{display:block;position:relative}.is-disabled[_nghost-%COMP%]{cursor:not-allowed}.is-disabled[_nghost-%COMP%] .m-range-slider__handle[_ngcontent-%COMP%]:hover{cursor:not-allowed}"] });
1040
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RangeSliderComponent, [{
1041
- type: Component,
1042
- args: [{ selector: 'aui-range-slider', providers: [
1043
- {
1044
- provide: NG_VALUE_ACCESSOR,
1045
- useExisting: forwardRef((() => RangeSliderComponent)),
1046
- multi: true,
1047
- },
1048
- ], template: "<div class=\"a-range-slider\">\n <div class=\"a-range-slider__labels\">\n <div class=\"a-range-slider__label\">{{ label }}</div>\n </div>\n <div class=\"a-range-slider__inner\">\n <div class=\"a-range-slider__tickmarks\">\n <div *ngFor=\"let step of steps; let i = index\" class=\"a-range-slider__tickmark\"></div>\n </div>\n <div\n [style.left]=\"endPercentage ? startPercentage + '%' : false\"\n [style.width]=\"endPercentage ? endPercentage - startPercentage + '%' : startPercentage + '%'\"\n class=\"a-range-slider__bar\"\n ></div>\n <span\n (blur)=\"toggleFocus(false, null, $event)\"\n (dragexit)=\"onMouseUp($event)\"\n (focus)=\"toggleFocus(true, 'start', $event)\"\n (mousedown)=\"onMouseDown('start')\"\n (touchstart)=\"onMouseDown('start')\"\n [style.left]=\"startPercentage + '%'\"\n class=\"a-range-slider__handle\"\n [attr.aria-label]=\"ariaLabelMin\"\n tabindex=\"0\"\n >\n </span>\n\n <span\n (blur)=\"toggleFocus(false, null, $event)\"\n (dragexit)=\"onMouseUp($event)\"\n (focus)=\"toggleFocus(true, 'end', $event)\"\n (mousedown)=\"onMouseDown('end')\"\n (touchstart)=\"onMouseDown('end')\"\n *ngIf=\"end\"\n [style.left]=\"endPercentage + '%'\"\n class=\"a-range-slider__handle\"\n name=\"a-range-slider__handle__end\"\n [attr.aria-label]=\"ariaLabelMax\"\n tabindex=\"0\"\n >\n </span>\n </div>\n <div class=\"a-range-slider__descriptions\">\n <div class=\"a-range-slider__description small\">{{ labelBefore }}{{ min }}{{ labelAfter }}</div>\n <div class=\"a-range-slider__description small\">{{ labelBefore }}{{ max }}{{ labelAfter }}</div>\n </div>\n</div>\n", styles: [":host{display:block;position:relative}:host.is-disabled{cursor:not-allowed}:host.is-disabled .m-range-slider__handle:hover{cursor:not-allowed}\n"] }]
1049
- }], function () { return [{ type: i0.ElementRef }]; }, { coreBranding: [{
1050
- type: HostBinding,
1051
- args: ['class.m-range-slider']
1052
- }], min: [{
1053
- type: Input
1054
- }], max: [{
1055
- type: Input
1056
- }], minimalDistance: [{
1057
- type: Input
1058
- }], step: [{
1059
- type: Input
1060
- }], label: [{
1061
- type: Input
1062
- }], labelBefore: [{
1063
- type: Input
1064
- }], labelAfter: [{
1065
- type: Input
1066
- }], ariaLabelMin: [{
1067
- type: Input
1068
- }], ariaLabelMax: [{
1069
- type: Input
1070
- }], disabledClass: [{
1071
- type: HostBinding,
1072
- args: ['class.is-disabled']
1073
- }], onKeyDown: [{
1074
- type: HostListener,
1075
- args: ['document:keydown', ['$event']]
1076
- }], onMouseUp: [{
1077
- type: HostListener,
1078
- args: ['touchend', ['$event']]
1079
- }, {
1080
- type: HostListener,
1081
- args: ['mouseup', ['$event']]
1082
- }], mouseDown: [{
1083
- type: HostListener,
1084
- args: ['touchstart', ['$event']]
1085
- }, {
1086
- type: HostListener,
1087
- args: ['mousedown', ['$event']]
1088
- }], onMouseMove: [{
1089
- type: HostListener,
1090
- args: ['touchmove', ['$event']]
1091
- }, {
1092
- type: HostListener,
1093
- args: ['mousemove', ['$event']]
1094
- }] }); })();
1095
-
1096
- class RangeSliderModule {
1097
- }
1098
- /** @nocollapse */ RangeSliderModule.ɵfac = function RangeSliderModule_Factory(t) { return new (t || RangeSliderModule)(); };
1099
- /** @nocollapse */ RangeSliderModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: RangeSliderModule });
1100
- /** @nocollapse */ RangeSliderModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ imports: [CommonModule, FormsModule] });
1101
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RangeSliderModule, [{
1102
- type: NgModule,
1103
- args: [{
1104
- imports: [CommonModule, FormsModule],
1105
- declarations: [RangeSliderComponent],
1106
- exports: [RangeSliderComponent],
1107
- }]
1108
- }], null, null); })();
1109
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(RangeSliderModule, { declarations: [RangeSliderComponent], imports: [CommonModule, FormsModule], exports: [RangeSliderComponent] }); })();
1110
-
1111
- const _c0$4 = function (a0, a1) { return { "a-button--l": a0, "a-button--s": a1 }; };
1112
- function SearchFilterComponent_button_8_Template(rf, ctx) { if (rf & 1) {
1113
- const _r6 = i0.ɵɵgetCurrentView();
1114
- i0.ɵɵelementStart(0, "button", 12);
1115
- i0.ɵɵlistener("click", function SearchFilterComponent_button_8_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.clear()); });
1116
- i0.ɵɵelement(1, "aui-icon", 13);
1117
- i0.ɵɵelementEnd();
1118
- } if (rf & 2) {
1119
- const ctx_r0 = i0.ɵɵnextContext();
1120
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(2, _c0$4, ctx_r0.size === "large", ctx_r0.size === "small"));
1121
- i0.ɵɵattribute("disabled", ctx_r0.isDisabled || ctx_r0.closeDisabled ? "" : null);
1122
- } }
1123
- function SearchFilterComponent_aui_icon_9_Template(rf, ctx) { if (rf & 1) {
1124
- i0.ɵɵelement(0, "aui-icon", 13);
1125
- } }
1126
- function SearchFilterComponent_p_11_Template(rf, ctx) { if (rf & 1) {
1127
- i0.ɵɵelementStart(0, "p", 14);
1128
- i0.ɵɵtext(1);
1129
- i0.ɵɵelementEnd();
1130
- } if (rf & 2) {
1131
- const ctx_r2 = i0.ɵɵnextContext();
1132
- i0.ɵɵadvance(1);
1133
- i0.ɵɵtextInterpolate(ctx_r2.labelResults);
1134
- } }
1135
- function SearchFilterComponent_div_12_Template(rf, ctx) { if (rf & 1) {
1136
- i0.ɵɵelement(0, "div", 15);
1137
- } }
1138
- function SearchFilterComponent_ul_13_li_1_Template(rf, ctx) { if (rf & 1) {
1139
- i0.ɵɵelementStart(0, "li", 19)(1, "p", 20);
1140
- i0.ɵɵtext(2);
1141
- i0.ɵɵelementEnd()();
1142
- } if (rf & 2) {
1143
- const ctx_r7 = i0.ɵɵnextContext(2);
1144
- i0.ɵɵadvance(2);
1145
- i0.ɵɵtextInterpolate(ctx_r7.labelNoResults);
1146
- } }
1147
- function SearchFilterComponent_ul_13_li_2_Template(rf, ctx) { if (rf & 1) {
1148
- const _r12 = i0.ɵɵgetCurrentView();
1149
- i0.ɵɵelementStart(0, "li", 19)(1, "div", 21)(2, "div", 22)(3, "input", 23);
1150
- i0.ɵɵlistener("change", function SearchFilterComponent_ul_13_li_2_Template_input_change_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r12); const choice_r9 = restoredCtx.$implicit; const ctx_r11 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r11.toggleSelected(choice_r9.label)); });
1151
- i0.ɵɵelementEnd();
1152
- i0.ɵɵelementStart(4, "label", 24);
1153
- i0.ɵɵtext(5);
1154
- i0.ɵɵelementEnd()()()();
1155
- } if (rf & 2) {
1156
- const choice_r9 = ctx.$implicit;
1157
- const i_r10 = ctx.index;
1158
- const ctx_r8 = i0.ɵɵnextContext(2);
1159
- i0.ɵɵadvance(3);
1160
- i0.ɵɵpropertyInterpolate("id", "checkbox--" + i_r10 + "--" + ctx_r8.id);
1161
- i0.ɵɵpropertyInterpolate("name", "checkbox--" + i_r10 + "--" + ctx_r8.id);
1162
- i0.ɵɵproperty("checked", ctx_r8.selectedItems.indexOf(choice_r9.label) >= 0);
1163
- i0.ɵɵattribute("disabled", ctx_r8.isDisabled ? true : null);
1164
- i0.ɵɵadvance(1);
1165
- i0.ɵɵpropertyInterpolate("for", "checkbox--" + i_r10 + "--" + ctx_r8.id);
1166
- i0.ɵɵadvance(1);
1167
- i0.ɵɵtextInterpolate(choice_r9.label);
1168
- } }
1169
- function SearchFilterComponent_ul_13_Template(rf, ctx) { if (rf & 1) {
1170
- i0.ɵɵelementStart(0, "ul", 16);
1171
- i0.ɵɵtemplate(1, SearchFilterComponent_ul_13_li_1_Template, 3, 1, "li", 17);
1172
- i0.ɵɵtemplate(2, SearchFilterComponent_ul_13_li_2_Template, 6, 6, "li", 18);
1173
- i0.ɵɵelementEnd();
1174
- } if (rf & 2) {
1175
- const ctx_r4 = i0.ɵɵnextContext();
1176
- i0.ɵɵadvance(1);
1177
- i0.ɵɵproperty("ngIf", !ctx_r4.filteredChoices.length);
1178
- i0.ɵɵadvance(1);
1179
- i0.ɵɵproperty("ngForOf", ctx_r4.filteredChoices);
1180
- } }
1181
- const _c1$4 = function (a0, a1, a2) { return { "a-input--l": a0, "a-input--s": a1, "has-icon-right": a2 }; };
1182
- class SearchFilterComponent {
1183
- constructor() {
1184
- this.flyoutSize = FlyoutSize.Small;
1185
- this.labelDeselect = 'Alles deselecteren';
1186
- this.labelResults = 'Resultaten';
1187
- this.labelNoResults = 'Geen resultaten gevonden.';
1188
- this.choices = [];
1189
- this.inputDelay = 150;
1190
- this.onSelect = () => { };
1191
- this.onClear = () => { };
1192
- this.size = 'default';
1193
- this.search = new EventEmitter();
1194
- this.query = '';
1195
- this.selectedItems = [];
1196
- this.filteredChoices = [];
1197
- this.loading = false;
1198
- this.isDisabled = false;
1199
- this.closeDisabled = false;
1200
- this.updateModel = () => { };
1201
- this.filterDataFromSearch = debounce(this.filterData.bind(this), this.inputDelay);
1202
- }
1203
- writeValue(value) {
1204
- this.selectedItems = Array.isArray(value) ? value : [];
1205
- }
1206
- registerOnChange(onChange) {
1207
- this.updateModel = onChange;
1208
- }
1209
- registerOnTouched() { }
1210
- setDisabledState(isDisabled) {
1211
- this.isDisabled = isDisabled;
1212
- }
1213
- ngOnChanges(changes) {
1214
- const choices = get(changes, 'choices.currentValue', null);
1215
- if (!choices) {
1216
- return;
1217
- }
1218
- if (this.remote) {
1219
- this.filteredChoices = [...choices];
1220
- this.loading = false;
1221
- }
1222
- else {
1223
- this.filterData();
1224
- }
1225
- }
1226
- filterData() {
1227
- if (this.remote) {
1228
- this.loading = true;
1229
- return this.search.emit(this.query);
1230
- }
1231
- this.filterChoices();
1232
- }
1233
- clear() {
1234
- this.selectedItems = [];
1235
- this.query = '';
1236
- this.filterData();
1237
- this.updateModel(this.selectedItems);
1238
- this.onClear();
1239
- }
1240
- toggleSelected(choice) {
1241
- const selected = this.selectedItems.indexOf(choice);
1242
- if (selected < 0) {
1243
- this.selectedItems = this.selectedItems.concat(choice);
1244
- }
1245
- else {
1246
- this.selectedItems = [...this.selectedItems.slice(0, selected), ...this.selectedItems.slice(selected + 1)];
1247
- }
1248
- this.updateModel(this.selectedItems);
1249
- this.onSelect();
1250
- }
1251
- filterChoices() {
1252
- this.filteredChoices = this.choices.filter((choice) => {
1253
- return (this.selectedItems.indexOf(choice.value) < 0 &&
1254
- choice.label.toLowerCase().indexOf(this.query.toLowerCase()) >= 0);
1255
- });
1256
- }
1257
- hasClose() {
1258
- return this.filteredChoices?.length && this.query?.length > 1;
1259
- }
1260
- getSelectedLabels() {
1261
- if (!this.selectedItems.length) {
1262
- this.closeDisabled = true;
1263
- return null;
1264
- }
1265
- else {
1266
- this.closeDisabled = false;
1267
- return this.selectedItems.map((el) => el).join(', ');
1268
- }
1269
- }
1270
- }
1271
- /** @nocollapse */ SearchFilterComponent.ɵfac = function SearchFilterComponent_Factory(t) { return new (t || SearchFilterComponent)(); };
1272
- /** @nocollapse */ SearchFilterComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: SearchFilterComponent, selectors: [["aui-search-filter"]], inputs: { id: "id", name: "name", flyoutSize: "flyoutSize", flyoutAlign: "flyoutAlign", label: "label", description: "description", labelDeselect: "labelDeselect", labelResults: "labelResults", labelNoResults: "labelNoResults", choices: "choices", remote: "remote", inputDelay: "inputDelay", onSelect: "onSelect", onClear: "onClear", size: "size" }, outputs: { search: "search" }, features: [i0.ɵɵProvidersFeature([
1273
- {
1274
- provide: NG_VALUE_ACCESSOR,
1275
- useExisting: forwardRef((() => SearchFilterComponent)),
1276
- multi: true,
1277
- },
1278
- ]), i0.ɵɵNgOnChangesFeature], decls: 14, vars: 22, consts: [["aria-haspopup", "listbox", "auiFlyout", "", 1, "m-search-filter", 3, "align", "size"], [1, "a-input", 3, "ngClass"], [1, "a-input__label", 3, "for"], [1, "a-input__description", 3, "id"], [1, "m-search-filter__input"], ["aria-autocomplete", "list", "type", "text", "auiFlyoutAction", "", 3, "ngModel", "id", "name", "value", "input", "ngModelChange"], ["class", "a-button a-button--outlined has-icon m-search-filter__button a-button--danger", "aria-label", "Zoekopdracht wissen", "type", "button", 3, "ngClass", "click", 4, "ngIf"], ["name", "ai-close", 4, "ngIf"], ["auiFlyoutZone", "", 1, "m-search-filter__search", "m-search-filter__search--scroll"], ["class", "h6 m-search-filter__results-title u-margin-bottom-xs", 4, "ngIf"], ["class", "u-text-center u-padding a-spinner", 4, "ngIf"], ["class", "a-checkbox-list a-checkbox-list--flushed", 4, "ngIf"], ["aria-label", "Zoekopdracht wissen", "type", "button", 1, "a-button", "a-button--outlined", "has-icon", "m-search-filter__button", "a-button--danger", 3, "ngClass", "click"], ["name", "ai-close"], [1, "h6", "m-search-filter__results-title", "u-margin-bottom-xs"], [1, "u-text-center", "u-padding", "a-spinner"], [1, "a-checkbox-list", "a-checkbox-list--flushed"], ["class", "a-checkbox-list__item", 4, "ngIf"], ["class", "a-checkbox-list__item", 4, "ngFor", "ngForOf"], [1, "a-checkbox-list__item"], [1, "u-margin-xs"], [1, "a-input", "a-checkbox-list__checkbox"], [1, "a-input__checkbox"], ["type", "checkbox", 3, "checked", "id", "name", "change"], [3, "for"]], template: function SearchFilterComponent_Template(rf, ctx) { if (rf & 1) {
1279
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "label", 2);
1280
- i0.ɵɵtext(3);
1281
- i0.ɵɵelementEnd();
1282
- i0.ɵɵelementStart(4, "small", 3);
1283
- i0.ɵɵtext(5);
1284
- i0.ɵɵelementEnd();
1285
- i0.ɵɵelementStart(6, "div", 4)(7, "input", 5);
1286
- i0.ɵɵlistener("input", function SearchFilterComponent_Template_input_input_7_listener() { return ctx.filterDataFromSearch(); })("ngModelChange", function SearchFilterComponent_Template_input_ngModelChange_7_listener($event) { return ctx.query = $event; });
1287
- i0.ɵɵelementEnd();
1288
- i0.ɵɵtemplate(8, SearchFilterComponent_button_8_Template, 2, 5, "button", 6);
1289
- i0.ɵɵtemplate(9, SearchFilterComponent_aui_icon_9_Template, 1, 0, "aui-icon", 7);
1290
- i0.ɵɵelementEnd()();
1291
- i0.ɵɵelementStart(10, "div", 8);
1292
- i0.ɵɵtemplate(11, SearchFilterComponent_p_11_Template, 2, 1, "p", 9);
1293
- i0.ɵɵtemplate(12, SearchFilterComponent_div_12_Template, 1, 0, "div", 10);
1294
- i0.ɵɵtemplate(13, SearchFilterComponent_ul_13_Template, 3, 2, "ul", 11);
1295
- i0.ɵɵelementEnd()();
1296
- } if (rf & 2) {
1297
- i0.ɵɵproperty("align", ctx.flyoutAlign)("size", ctx.flyoutSize);
1298
- i0.ɵɵadvance(1);
1299
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction3(18, _c1$4, ctx.size === "large", ctx.size === "small", ctx.hasClose));
1300
- i0.ɵɵadvance(1);
1301
- i0.ɵɵpropertyInterpolate("for", ctx.id + "-search");
1302
- i0.ɵɵadvance(1);
1303
- i0.ɵɵtextInterpolate(ctx.label);
1304
- i0.ɵɵadvance(1);
1305
- i0.ɵɵpropertyInterpolate("id", ctx.id + "-description");
1306
- i0.ɵɵadvance(1);
1307
- i0.ɵɵtextInterpolate(ctx.description);
1308
- i0.ɵɵadvance(2);
1309
- i0.ɵɵpropertyInterpolate("id", ctx.id + "-search");
1310
- i0.ɵɵpropertyInterpolate("name", ctx.name + "-search");
1311
- i0.ɵɵpropertyInterpolate("value", ctx.getSelectedLabels());
1312
- i0.ɵɵproperty("ngModel", ctx.query);
1313
- i0.ɵɵattribute("aria-labelledby", ctx.id + "-label")("disabled", ctx.isDisabled ? "" : null);
1314
- i0.ɵɵadvance(1);
1315
- i0.ɵɵproperty("ngIf", ctx.hasClose);
1316
- i0.ɵɵadvance(1);
1317
- i0.ɵɵproperty("ngIf", !ctx.hasClose);
1318
- i0.ɵɵadvance(2);
1319
- i0.ɵɵproperty("ngIf", ctx.labelResults);
1320
- i0.ɵɵadvance(1);
1321
- i0.ɵɵproperty("ngIf", ctx.loading);
1322
- i0.ɵɵadvance(1);
1323
- i0.ɵɵproperty("ngIf", !ctx.loading);
1324
- } }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf, i4.FlyoutActionDirective, i4.FlyoutZoneDirective, i4.FlyoutDirective, i1$1.DefaultValueAccessor, i1$1.NgControlStatus, i1$1.NgModel, i4$1.IconComponent], styles: [".m-search-filter[_ngcontent-%COMP%]{display:block}.m-search-filter__input[_ngcontent-%COMP%]{display:flex;padding:0}.m-search-filter__input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-right:none}.m-search-filter__button[_ngcontent-%COMP%]{display:inline-block;padding:0;position:relative;vertical-align:middle}.m-search-filter__button[_ngcontent-%COMP%] .ai[_ngcontent-%COMP%]{position:relative;transform:none!important;top:0}"] });
1325
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchFilterComponent, [{
1326
- type: Component,
1327
- args: [{ selector: 'aui-search-filter', providers: [
1328
- {
1329
- provide: NG_VALUE_ACCESSOR,
1330
- useExisting: forwardRef((() => SearchFilterComponent)),
1331
- multi: true,
1332
- },
1333
- ], template: "<div [align]=\"flyoutAlign\" [size]=\"flyoutSize\" aria-haspopup=\"listbox\" auiFlyout class=\"m-search-filter\">\n <div\n class=\"a-input\"\n [ngClass]=\"{\n 'a-input--l': size === 'large',\n 'a-input--s': size === 'small',\n 'has-icon-right': hasClose\n }\"\n >\n <label class=\"a-input__label\" for=\"{{ id + '-search' }}\">{{ label }}</label>\n <small class=\"a-input__description\" id=\"{{ id + '-description' }}\">{{ description }}</small>\n <div class=\"m-search-filter__input\">\n <input\n (input)=\"filterDataFromSearch()\"\n [(ngModel)]=\"query\"\n [attr.aria-labelledby]=\"id + '-label'\"\n [attr.disabled]=\"isDisabled ? '' : null\"\n aria-autocomplete=\"list\"\n id=\"{{ id + '-search' }}\"\n name=\"{{ name + '-search' }}\"\n value=\"{{ getSelectedLabels() }}\"\n type=\"text\"\n auiFlyoutAction\n />\n <button\n *ngIf=\"hasClose\"\n [ngClass]=\"{\n 'a-button--l': size === 'large',\n 'a-button--s': size === 'small'\n }\"\n class=\"a-button a-button--outlined has-icon m-search-filter__button a-button--danger\"\n aria-label=\"Zoekopdracht wissen\"\n type=\"button\"\n (click)=\"clear()\"\n [attr.disabled]=\"isDisabled || closeDisabled ? '' : null\"\n >\n <aui-icon name=\"ai-close\"></aui-icon>\n </button>\n <aui-icon *ngIf=\"!hasClose\" name=\"ai-close\"></aui-icon>\n </div>\n </div>\n <div auiFlyoutZone class=\"m-search-filter__search m-search-filter__search--scroll\">\n <p *ngIf=\"labelResults\" class=\"h6 m-search-filter__results-title u-margin-bottom-xs\">{{ labelResults }}</p>\n <div *ngIf=\"loading\" class=\"u-text-center u-padding a-spinner\"></div>\n <ul *ngIf=\"!loading\" class=\"a-checkbox-list a-checkbox-list--flushed\">\n <li *ngIf=\"!filteredChoices.length\" class=\"a-checkbox-list__item\">\n <p class=\"u-margin-xs\">{{ labelNoResults }}</p>\n </li>\n <li *ngFor=\"let choice of filteredChoices; index as i\" class=\"a-checkbox-list__item\">\n <div class=\"a-input a-checkbox-list__checkbox\">\n <div class=\"a-input__checkbox\">\n <input\n (change)=\"toggleSelected(choice.label)\"\n [attr.disabled]=\"isDisabled ? true : null\"\n [checked]=\"selectedItems.indexOf(choice.label) >= 0\"\n id=\"{{ 'checkbox--' + i + '--' + id }}\"\n name=\"{{ 'checkbox--' + i + '--' + id }}\"\n type=\"checkbox\"\n />\n <label for=\"{{ 'checkbox--' + i + '--' + id }}\">{{ choice.label }}</label>\n </div>\n </div>\n </li>\n </ul>\n </div>\n</div>\n", styles: [".m-search-filter{display:block}.m-search-filter__input{display:flex;padding:0}.m-search-filter__input input{border-right:none}.m-search-filter__button{display:inline-block;padding:0;position:relative;vertical-align:middle}.m-search-filter__button .ai{position:relative;transform:none!important;top:0}\n"] }]
1334
- }], function () { return []; }, { id: [{
1335
- type: Input
1336
- }], name: [{
1337
- type: Input
1338
- }], flyoutSize: [{
1339
- type: Input
1340
- }], flyoutAlign: [{
1341
- type: Input
1342
- }], label: [{
1343
- type: Input
1344
- }], description: [{
1345
- type: Input
1346
- }], labelDeselect: [{
1347
- type: Input
1348
- }], labelResults: [{
1349
- type: Input
1350
- }], labelNoResults: [{
1351
- type: Input
1352
- }], choices: [{
1353
- type: Input
1354
- }], remote: [{
1355
- type: Input
1356
- }], inputDelay: [{
1357
- type: Input
1358
- }], onSelect: [{
1359
- type: Input
1360
- }], onClear: [{
1361
- type: Input
1362
- }], size: [{
1363
- type: Input
1364
- }], search: [{
1365
- type: Output
1366
- }] }); })();
1367
-
1368
- class SearchFilterModule {
1369
- }
1370
- /** @nocollapse */ SearchFilterModule.ɵfac = function SearchFilterModule_Factory(t) { return new (t || SearchFilterModule)(); };
1371
- /** @nocollapse */ SearchFilterModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: SearchFilterModule });
1372
- /** @nocollapse */ SearchFilterModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ imports: [CommonModule, FlyoutModule, FormsModule, IconModule] });
1373
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchFilterModule, [{
1374
- type: NgModule,
1375
- args: [{
1376
- imports: [CommonModule, FlyoutModule, FormsModule, IconModule],
1377
- declarations: [SearchFilterComponent],
1378
- exports: [SearchFilterComponent],
1379
- }]
1380
- }], null, null); })();
1381
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SearchFilterModule, { declarations: [SearchFilterComponent], imports: [CommonModule, FlyoutModule, FormsModule, IconModule], exports: [SearchFilterComponent] }); })();
1382
-
1383
- class TimePickerValidators {
1384
- // time `hh:mm` 24h format
1385
- static minTime(time) {
1386
- const validator = (control) => {
1387
- const splittedControlValue = control.value.split(':');
1388
- const controlHours = parseInt(splittedControlValue[0], 10);
1389
- const controlMinutes = parseInt(splittedControlValue[1], 10);
1390
- const splittedMinTime = time.split(':');
1391
- const minHours = parseInt(splittedMinTime[0], 10);
1392
- const minMinutes = parseInt(splittedMinTime[1], 10);
1393
- // Don't throw error --> use Validator.required
1394
- if (isNaN(controlHours) || isNaN(controlMinutes) || isNaN(minHours) || isNaN(minMinutes)) {
1395
- return null;
1396
- }
1397
- if (minHours < controlHours) {
1398
- return null;
1399
- }
1400
- if (minHours === controlHours && minMinutes <= controlMinutes) {
1401
- return null;
1402
- }
1403
- return { minTime: { value: control.value } };
1404
- };
1405
- return validator;
1406
- }
1407
- // time `hh:mm` 24h format
1408
- static maxTime(time) {
1409
- const validator = (control) => {
1410
- const splittedControlValue = control.value.split(':');
1411
- const controlHours = parseInt(splittedControlValue[0], 10);
1412
- const controlMinutes = parseInt(splittedControlValue[1], 10);
1413
- const splittedMinTime = time.split(':');
1414
- const maxHours = parseInt(splittedMinTime[0], 10);
1415
- const maxMinutes = parseInt(splittedMinTime[1], 10);
1416
- // Don't throw error --> use Validator.required
1417
- if (isNaN(controlHours) || isNaN(controlMinutes) || isNaN(maxHours) || isNaN(maxMinutes)) {
1418
- return null;
1419
- }
1420
- if (maxHours > controlHours) {
1421
- return null;
1422
- }
1423
- if (maxHours === controlHours && maxMinutes >= controlMinutes) {
1424
- return null;
1425
- }
1426
- return { maxTime: { value: control.value } };
1427
- };
1428
- return validator;
1429
- }
1430
- }
1431
-
1432
- var TimepickerInputSize;
1433
- (function (TimepickerInputSize) {
1434
- TimepickerInputSize["Auto"] = "auto";
1435
- TimepickerInputSize["Small"] = "small";
1436
- TimepickerInputSize["Large"] = "large";
1437
- })(TimepickerInputSize || (TimepickerInputSize = {}));
1438
-
1439
- function TimepickerComponent_div_1_label_1_Template(rf, ctx) { if (rf & 1) {
1440
- i0.ɵɵelementStart(0, "label", 7);
1441
- i0.ɵɵtext(1);
1442
- i0.ɵɵelementEnd();
1443
- } if (rf & 2) {
1444
- const ctx_r2 = i0.ɵɵnextContext(2);
1445
- i0.ɵɵadvance(1);
1446
- i0.ɵɵtextInterpolate(ctx_r2.label);
1447
- } }
1448
- function TimepickerComponent_div_1_small_2_aui_icon_1_Template(rf, ctx) { if (rf & 1) {
1449
- i0.ɵɵelement(0, "aui-icon", 10);
1450
- } }
1451
- const _c0$3 = function (a0) { return { "is-error": a0 }; };
1452
- function TimepickerComponent_div_1_small_2_Template(rf, ctx) { if (rf & 1) {
1453
- i0.ɵɵelementStart(0, "small", 8);
1454
- i0.ɵɵtemplate(1, TimepickerComponent_div_1_small_2_aui_icon_1_Template, 1, 0, "aui-icon", 9);
1455
- i0.ɵɵtext(2);
1456
- i0.ɵɵelementEnd();
1457
- } if (rf & 2) {
1458
- const ctx_r3 = i0.ɵɵnextContext(2);
1459
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c0$3, ctx_r3.hasError));
1460
- i0.ɵɵadvance(1);
1461
- i0.ɵɵproperty("ngIf", ctx_r3.hasError);
1462
- i0.ɵɵadvance(1);
1463
- i0.ɵɵtextInterpolate1(" ", ctx_r3.description, "");
1464
- } }
1465
- const _c1$3 = function (a0) { return { "has-error": a0 }; };
1466
- function TimepickerComponent_div_1_Template(rf, ctx) { if (rf & 1) {
1467
- i0.ɵɵelementStart(0, "div", 3);
1468
- i0.ɵɵtemplate(1, TimepickerComponent_div_1_label_1_Template, 2, 1, "label", 4);
1469
- i0.ɵɵtemplate(2, TimepickerComponent_div_1_small_2_Template, 3, 5, "small", 5);
1470
- i0.ɵɵelement(3, "input", 6);
1471
- i0.ɵɵelementEnd();
1472
- } if (rf & 2) {
1473
- const ctx_r0 = i0.ɵɵnextContext();
1474
- i0.ɵɵclassMap("a-input--" + ctx_r0.size);
1475
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$3, ctx_r0.hasError));
1476
- i0.ɵɵadvance(1);
1477
- i0.ɵɵproperty("ngIf", ctx_r0.label);
1478
- i0.ɵɵadvance(1);
1479
- i0.ɵɵproperty("ngIf", ctx_r0.description);
1480
- i0.ɵɵadvance(1);
1481
- i0.ɵɵproperty("formControl", ctx_r0.timeControl)("id", ctx_r0.id);
1482
- i0.ɵɵattribute("aria-label", ctx_r0.ariaLabelHours + ":" + ctx_r0.ariaLabelMinutes);
1483
- } }
1484
- function TimepickerComponent_div_2_option_6_Template(rf, ctx) { if (rf & 1) {
1485
- i0.ɵɵelementStart(0, "option", 19);
1486
- i0.ɵɵtext(1);
1487
- i0.ɵɵelementEnd();
1488
- } if (rf & 2) {
1489
- const hour_r7 = ctx.$implicit;
1490
- i0.ɵɵproperty("value", hour_r7);
1491
- i0.ɵɵadvance(1);
1492
- i0.ɵɵtextInterpolate(hour_r7);
1493
- } }
1494
- function TimepickerComponent_div_2_option_13_Template(rf, ctx) { if (rf & 1) {
1495
- i0.ɵɵelementStart(0, "option", 19);
1496
- i0.ɵɵtext(1);
1497
- i0.ɵɵelementEnd();
1498
- } if (rf & 2) {
1499
- const minute_r8 = ctx.$implicit;
1500
- i0.ɵɵproperty("value", minute_r8);
1501
- i0.ɵɵadvance(1);
1502
- i0.ɵɵtextInterpolate(minute_r8);
1503
- } }
1504
- function TimepickerComponent_div_2_Template(rf, ctx) { if (rf & 1) {
1505
- i0.ɵɵelementStart(0, "div", 11)(1, "div", 12)(2, "div", 13)(3, "select", 14)(4, "option", 15);
1506
- i0.ɵɵtext(5);
1507
- i0.ɵɵelementEnd();
1508
- i0.ɵɵtemplate(6, TimepickerComponent_div_2_option_6_Template, 2, 2, "option", 16);
1509
- i0.ɵɵelementEnd();
1510
- i0.ɵɵelement(7, "aui-icon", 17);
1511
- i0.ɵɵelementEnd()();
1512
- i0.ɵɵelementStart(8, "div", 12)(9, "div", 13)(10, "select", 18)(11, "option", 15);
1513
- i0.ɵɵtext(12);
1514
- i0.ɵɵelementEnd();
1515
- i0.ɵɵtemplate(13, TimepickerComponent_div_2_option_13_Template, 2, 2, "option", 16);
1516
- i0.ɵɵelementEnd();
1517
- i0.ɵɵelement(14, "aui-icon", 17);
1518
- i0.ɵɵelementEnd()()();
1519
- } if (rf & 2) {
1520
- const ctx_r1 = i0.ɵɵnextContext();
1521
- i0.ɵɵproperty("formGroup", ctx_r1.fallbackForm);
1522
- i0.ɵɵadvance(1);
1523
- i0.ɵɵclassMap("a-input--" + ctx_r1.size);
1524
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c1$3, ctx_r1.hasError));
1525
- i0.ɵɵadvance(2);
1526
- i0.ɵɵproperty("id", ctx_r1.id);
1527
- i0.ɵɵattribute("aria-label", ctx_r1.ariaLabelHours);
1528
- i0.ɵɵadvance(2);
1529
- i0.ɵɵtextInterpolate(ctx_r1.hoursPlaceholder);
1530
- i0.ɵɵadvance(1);
1531
- i0.ɵɵproperty("ngForOf", ctx_r1.hours);
1532
- i0.ɵɵadvance(2);
1533
- i0.ɵɵclassMap("a-input--" + ctx_r1.size);
1534
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c1$3, ctx_r1.hasError));
1535
- i0.ɵɵadvance(2);
1536
- i0.ɵɵattribute("aria-label", ctx_r1.ariaLabelMinutes);
1537
- i0.ɵɵadvance(2);
1538
- i0.ɵɵtextInterpolate(ctx_r1.minutesPlaceholder);
1539
- i0.ɵɵadvance(1);
1540
- i0.ɵɵproperty("ngForOf", ctx_r1.minutes);
1541
- } }
1542
- class TimepickerComponent {
1543
- constructor(formBuilder, renderer) {
1544
- this.formBuilder = formBuilder;
1545
- this.renderer = renderer;
1546
- this.id = 'aui-timepicker-' + Math.random().toString(36).substring(2);
1547
- this.hoursPlaceholder = 'uu';
1548
- this.minutesPlaceholder = 'mm';
1549
- this.hasError = false;
1550
- this.size = TimepickerInputSize.Auto;
1551
- this.ariaLabelHours = 'Uur';
1552
- this.ariaLabelMinutes = 'Minuten';
1553
- this.shouldUseFallback = false;
1554
- this.minutes = [];
1555
- this.hours = [];
1556
- this.timeControl = new UntypedFormControl();
1557
- this.componentDestroyed$ = new Subject();
1558
- }
1559
- ngOnInit() {
1560
- this.shouldUseFallback = this.supportsNativeTimepicker();
1561
- this.minutes = this.getMinutes();
1562
- this.hours = this.getHours();
1563
- this.fallbackForm = this.formBuilder.group({
1564
- hours: null,
1565
- minutes: null,
1566
- });
1567
- this.fallbackForm.valueChanges.pipe(takeUntil(this.componentDestroyed$)).subscribe((formData) => {
1568
- if (formData.hours && formData.minutes) {
1569
- this.updateModel(`${formData.hours}:${formData.minutes}`);
1570
- }
1571
- else {
1572
- this.updateModel('');
1573
- }
1574
- });
1575
- this.timeControl.valueChanges.pipe(takeUntil(this.componentDestroyed$)).subscribe((time) => {
1576
- this.updateModel(time);
1577
- });
1578
- }
1579
- ngOnDestroy() {
1580
- this.componentDestroyed$.next(true);
1581
- this.componentDestroyed$.complete();
1582
- }
1583
- writeValue(value) {
1584
- this.timeControl.setValue(value, { emitEvent: false });
1585
- if (value) {
1586
- const splitted = value.split(':');
1587
- this.fallbackForm.get('hours').setValue(splitted[0], { emitEvent: false });
1588
- this.fallbackForm.get('minutes').setValue(splitted[1], { emitEvent: false });
1589
- }
1590
- }
1591
- registerOnChange(onChange) {
1592
- this.updateModel = onChange;
1593
- }
1594
- registerOnTouched() { }
1595
- setDisabledState(isDisabled) {
1596
- if (isDisabled) {
1597
- this.timeControl.disable({ emitEvent: false });
1598
- this.fallbackForm.disable({ emitEvent: false });
1599
- }
1600
- else {
1601
- this.timeControl.enable({ emitEvent: false });
1602
- this.fallbackForm.enable({ emitEvent: false });
1603
- }
1604
- }
1605
- supportsNativeTimepicker() {
1606
- const element = this.renderer.createElement('input');
1607
- element.type = 'time';
1608
- return element.type === 'text';
1609
- }
1610
- getMinutes() {
1611
- return Array(60)
1612
- .fill('')
1613
- .map((value, index) => {
1614
- return DateHelper.addLeadingZero(index);
1615
- });
1616
- }
1617
- getHours() {
1618
- return Array(24)
1619
- .fill('')
1620
- .map((value, index) => {
1621
- return DateHelper.addLeadingZero(index);
1622
- });
1623
- }
1624
- }
1625
- /** @nocollapse */ TimepickerComponent.ɵfac = function TimepickerComponent_Factory(t) { return new (t || TimepickerComponent)(i0.ɵɵdirectiveInject(i1$1.UntypedFormBuilder), i0.ɵɵdirectiveInject(i0.Renderer2)); };
1626
- /** @nocollapse */ TimepickerComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TimepickerComponent, selectors: [["aui-timepicker"]], inputs: { id: "id", hoursPlaceholder: "hoursPlaceholder", minutesPlaceholder: "minutesPlaceholder", hasError: "hasError", size: "size", ariaLabelHours: "ariaLabelHours", ariaLabelMinutes: "ariaLabelMinutes", label: "label", description: "description" }, features: [i0.ɵɵProvidersFeature([
1627
- {
1628
- provide: NG_VALUE_ACCESSOR,
1629
- useExisting: forwardRef((() => TimepickerComponent)),
1630
- multi: true,
1631
- },
1632
- ])], decls: 3, vars: 2, consts: [[1, "m-timepicker"], ["class", "a-input", 3, "class", "ngClass", 4, "ngIf"], [3, "formGroup", 4, "ngIf"], [1, "a-input", 3, "ngClass"], ["class", "a-input__label", "for", "id", 4, "ngIf"], ["class", "a-input__description", "id", "id", 3, "ngClass", 4, "ngIf"], ["type", "time", 3, "formControl", "id"], ["for", "id", 1, "a-input__label"], ["id", "id", 1, "a-input__description", 3, "ngClass"], ["name", "ai-alert-triangle", 4, "ngIf"], ["name", "ai-alert-triangle"], [3, "formGroup"], [1, "a-input", "has-icon-right", 3, "ngClass"], [1, "a-input__wrapper"], ["formControlName", "hours", 3, "id"], ["disabled", "", "value", "null"], [3, "value", 4, "ngFor", "ngForOf"], ["name", "ai-arrow-down-1"], ["formControlName", "minutes"], [3, "value"]], template: function TimepickerComponent_Template(rf, ctx) { if (rf & 1) {
1633
- i0.ɵɵelementStart(0, "div", 0);
1634
- i0.ɵɵtemplate(1, TimepickerComponent_div_1_Template, 4, 10, "div", 1);
1635
- i0.ɵɵtemplate(2, TimepickerComponent_div_2_Template, 15, 18, "div", 2);
1636
- i0.ɵɵelementEnd();
1637
- } if (rf & 2) {
1638
- i0.ɵɵadvance(1);
1639
- i0.ɵɵproperty("ngIf", !ctx.shouldUseFallback);
1640
- i0.ɵɵadvance(1);
1641
- i0.ɵɵproperty("ngIf", ctx.shouldUseFallback);
1642
- } }, dependencies: [i1$1.NgSelectOption, i1$1.ɵNgSelectMultipleOption, i1$1.DefaultValueAccessor, i1$1.SelectControlValueAccessor, i1$1.NgControlStatus, i1$1.NgControlStatusGroup, i1$1.FormControlDirective, i1$1.FormGroupDirective, i1$1.FormControlName, i1.NgClass, i1.NgForOf, i1.NgIf, i4$1.IconComponent], styles: ["[_nghost-%COMP%]{display:block}"], changeDetection: 0 });
1643
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimepickerComponent, [{
1644
- type: Component,
1645
- args: [{ selector: 'aui-timepicker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1646
- {
1647
- provide: NG_VALUE_ACCESSOR,
1648
- useExisting: forwardRef((() => TimepickerComponent)),
1649
- multi: true,
1650
- },
1651
- ], template: "<div class=\"m-timepicker\">\n <div *ngIf=\"!shouldUseFallback\" [class]=\"'a-input--' + size\" [ngClass]=\"{ 'has-error': hasError }\" class=\"a-input\">\n <label class=\"a-input__label\" for=\"id\" *ngIf=\"label\">{{ label }}</label>\n <small class=\"a-input__description\" id=\"id\" [ngClass]=\"{ 'is-error': hasError }\" *ngIf=\"description\">\n <aui-icon *ngIf=\"hasError\" name=\"ai-alert-triangle\"></aui-icon>\n {{ description }}</small\n >\n <input\n [attr.aria-label]=\"ariaLabelHours + ':' + ariaLabelMinutes\"\n [formControl]=\"timeControl\"\n [id]=\"id\"\n type=\"time\"\n />\n </div>\n\n <div *ngIf=\"shouldUseFallback\" [formGroup]=\"fallbackForm\">\n <div [class]=\"'a-input--' + size\" [ngClass]=\"{ 'has-error': hasError }\" class=\"a-input has-icon-right\">\n <div class=\"a-input__wrapper\">\n <select [attr.aria-label]=\"ariaLabelHours\" [id]=\"id\" formControlName=\"hours\">\n <option disabled value=\"null\">{{ hoursPlaceholder }}</option>\n <option *ngFor=\"let hour of hours\" [value]=\"hour\">{{ hour }}</option>\n </select>\n <aui-icon name=\"ai-arrow-down-1\"></aui-icon>\n </div>\n </div>\n\n <div [class]=\"'a-input--' + size\" [ngClass]=\"{ 'has-error': hasError }\" class=\"a-input has-icon-right\">\n <div class=\"a-input__wrapper\">\n <select [attr.aria-label]=\"ariaLabelMinutes\" formControlName=\"minutes\">\n <option disabled value=\"null\">{{ minutesPlaceholder }}</option>\n <option *ngFor=\"let minute of minutes\" [value]=\"minute\">{{ minute }}</option>\n </select>\n <aui-icon name=\"ai-arrow-down-1\"></aui-icon>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}\n"] }]
1652
- }], function () { return [{ type: i1$1.UntypedFormBuilder }, { type: i0.Renderer2 }]; }, { id: [{
1653
- type: Input
1654
- }], hoursPlaceholder: [{
1655
- type: Input
1656
- }], minutesPlaceholder: [{
1657
- type: Input
1658
- }], hasError: [{
1659
- type: Input
1660
- }], size: [{
1661
- type: Input
1662
- }], ariaLabelHours: [{
1663
- type: Input
1664
- }], ariaLabelMinutes: [{
1665
- type: Input
1666
- }], label: [{
1667
- type: Input
1668
- }], description: [{
1669
- type: Input
1670
- }] }); })();
1671
-
1672
- class TimepickerModule {
1673
- }
1674
- /** @nocollapse */ TimepickerModule.ɵfac = function TimepickerModule_Factory(t) { return new (t || TimepickerModule)(); };
1675
- /** @nocollapse */ TimepickerModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: TimepickerModule });
1676
- /** @nocollapse */ TimepickerModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ imports: [ReactiveFormsModule, CommonModule, IconModule] });
1677
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimepickerModule, [{
1678
- type: NgModule,
1679
- args: [{
1680
- imports: [ReactiveFormsModule, CommonModule, IconModule],
1681
- declarations: [TimepickerComponent],
1682
- exports: [TimepickerComponent],
1683
- providers: [],
1684
- }]
1685
- }], null, null); })();
1686
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TimepickerModule, { declarations: [TimepickerComponent], imports: [ReactiveFormsModule, CommonModule, IconModule], exports: [TimepickerComponent] }); })();
1687
-
1688
- const UPLOAD_OPTIONS_DEFAULT = {
1689
- allowedMimeTypes: [],
1690
- allowedFileTypes: [],
1691
- autoUpload: false,
1692
- maxFileSize: 0,
1693
- queueLimit: 0,
1694
- type: 'drop',
1695
- url: '',
1696
- };
1697
- const UPLOAD_VALIDATION_MESSAGES = new InjectionToken('uploadValidationMessages');
1698
-
1699
- class Uploader {
1700
- constructor(options) {
1701
- this.options = UPLOAD_OPTIONS_DEFAULT;
1702
- this.setOptions(options);
1703
- }
1704
- setOptions(options) {
1705
- this.options = Object.assign({}, this.options, options);
1706
- }
1707
- uploadFiles(files) {
1708
- const formData = this.filesToFormData(files);
1709
- return new Observable(observer => {
1710
- const xhr = new XMLHttpRequest();
1711
- // Progress callback
1712
- xhr.upload.addEventListener('progress', (e) => {
1713
- if (e.lengthComputable) {
1714
- const percentComplete = e.loaded / e.total;
1715
- observer.next({
1716
- progress: percentComplete,
1717
- data: null,
1718
- });
1719
- }
1720
- });
1721
- // Complete callback
1722
- xhr.onload = () => {
1723
- observer.next({
1724
- progress: 1,
1725
- data: xhr.response,
1726
- });
1727
- // observer.complete();
1728
- };
1729
- // Do request
1730
- xhr.responseType = 'json';
1731
- xhr.open('post', this.options.url);
1732
- xhr.send(formData);
1733
- });
1734
- }
1735
- validateFiles(files) {
1736
- const validFiles = [];
1737
- const invalidFiles = [];
1738
- if (files.length > 0) {
1739
- for (const file of files) {
1740
- const errors = [];
1741
- if (!this.validateFileType(file)) {
1742
- errors.push('INVALID_FILE_TYPE');
1743
- }
1744
- if (!this.validateFileSize(file)) {
1745
- errors.push('INVALID_FILE_SIZE');
1746
- }
1747
- if (!this.validateMimeType(file)) {
1748
- errors.push('INVALID_MIME_TYPE');
1749
- }
1750
- if (errors.length === 0) {
1751
- validFiles.push(file);
1752
- }
1753
- else {
1754
- invalidFiles.push({
1755
- reasons: errors,
1756
- file,
1757
- });
1758
- }
1759
- }
1760
- }
1761
- return {
1762
- validFiles,
1763
- invalidFiles,
1764
- };
1765
- }
1766
- filesToFormData(files) {
1767
- const formData = new FormData();
1768
- if (!this.options.url || this.options.url === '') {
1769
- throw new Error('Define the upload url.');
1770
- }
1771
- for (const file of files) {
1772
- formData.append('file', file);
1773
- }
1774
- return formData;
1775
- }
1776
- getFileExtension(file) {
1777
- return file.name.split('.')[file.name.split('.').length - 1];
1778
- }
1779
- validateFileType(file) {
1780
- const allowedFileTypes = this.options.allowedFileTypes;
1781
- const ext = this.getFileExtension(file);
1782
- // Filter defined?
1783
- if (!Array.isArray(allowedFileTypes) || allowedFileTypes.length === 0) {
1784
- return true;
1785
- }
1786
- // Make allowedFileTypes case insensitive
1787
- const toUpper = (x) => x.toUpperCase();
1788
- const allowedFileTypesToUpper = allowedFileTypes.map(toUpper);
1789
- return allowedFileTypesToUpper.lastIndexOf(ext.toUpperCase()) !== -1;
1790
- }
1791
- validateFileSize(file) {
1792
- const maxFileSize = this.options.maxFileSize;
1793
- // Filter defined?
1794
- if (!maxFileSize || maxFileSize === 0) {
1795
- return true;
1796
- }
1797
- return maxFileSize > file.size;
1798
- }
1799
- validateMimeType(file) {
1800
- const allowedMimeTypes = this.options.allowedMimeTypes;
1801
- // Filter defined?
1802
- if (!Array.isArray(allowedMimeTypes) || allowedMimeTypes.length === 0) {
1803
- return true;
1804
- }
1805
- return allowedMimeTypes.lastIndexOf(file.type) !== -1;
1806
- }
1807
- }
1808
-
1809
- function UploadQueueComponent_li_1_Template(rf, ctx) { if (rf & 1) {
1810
- const _r5 = i0.ɵɵgetCurrentView();
1811
- i0.ɵɵelementStart(0, "li");
1812
- i0.ɵɵelement(1, "aui-icon", 3);
1813
- i0.ɵɵelementStart(2, "span", 4);
1814
- i0.ɵɵtext(3);
1815
- i0.ɵɵelementEnd();
1816
- i0.ɵɵelementStart(4, "button", 5);
1817
- i0.ɵɵlistener("click", function UploadQueueComponent_li_1_Template_button_click_4_listener() { const restoredCtx = i0.ɵɵrestoreView(_r5); const i_r3 = restoredCtx.index; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.remove(i_r3)); });
1818
- i0.ɵɵelement(5, "aui-icon", 6);
1819
- i0.ɵɵelementEnd()();
1820
- } if (rf & 2) {
1821
- const file_r2 = ctx.$implicit;
1822
- const ctx_r0 = i0.ɵɵnextContext();
1823
- i0.ɵɵadvance(3);
1824
- i0.ɵɵtextInterpolate(file_r2.name);
1825
- i0.ɵɵadvance(2);
1826
- i0.ɵɵproperty("ariaLabel", ctx_r0.ariaLabelRemove);
1827
- } }
1828
- function UploadQueueComponent_button_2_Template(rf, ctx) { if (rf & 1) {
1829
- const _r7 = i0.ɵɵgetCurrentView();
1830
- i0.ɵɵelementStart(0, "button", 7);
1831
- i0.ɵɵlistener("click", function UploadQueueComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.uploadFiles()); });
1832
- i0.ɵɵtext(1, "Upload");
1833
- i0.ɵɵelementEnd();
1834
- } }
1835
- class UploadQueueComponent {
1836
- constructor() {
1837
- this.ariaLabelRemove = 'Verwijder';
1838
- this.uploadedFiles = new EventEmitter();
1839
- this.uploadProgress = 0;
1840
- }
1841
- remove(index) {
1842
- this.files.splice(index, 1);
1843
- }
1844
- uploadFiles() {
1845
- const progress = undefined;
1846
- const data = undefined;
1847
- this.uploader.uploadFiles(this.files).subscribe((response) => {
1848
- if (response.progress) {
1849
- this.uploadProgress = Math.floor(response.progress * 100);
1850
- }
1851
- if (response.data) {
1852
- this.uploadedFiles.emit(response.data);
1853
- this.files = [];
1854
- }
1855
- });
1856
- }
1857
- }
1858
- /** @nocollapse */ UploadQueueComponent.ɵfac = function UploadQueueComponent_Factory(t) { return new (t || UploadQueueComponent)(); };
1859
- /** @nocollapse */ UploadQueueComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: UploadQueueComponent, selectors: [["aui-upload-queue"]], inputs: { files: "files", uploader: "uploader", ariaLabelRemove: "ariaLabelRemove" }, outputs: { uploadedFiles: "uploadedFiles" }, decls: 3, vars: 2, consts: [[1, "m-upload__files", "u-margin-bottom-xs"], [4, "ngFor", "ngForOf"], ["class", "a-button", "type", "button", 3, "click", 4, "ngIf"], ["name", "ai-common-file-empty"], [1, "m-upload__filename"], ["type", "button", 1, "m-upload__delete", "a-button", "a-button--text", "a-button--neutral", "a-button--s", "has-icon", 3, "click"], ["name", "ai-close", 3, "ariaLabel"], ["type", "button", 1, "a-button", 3, "click"]], template: function UploadQueueComponent_Template(rf, ctx) { if (rf & 1) {
1860
- i0.ɵɵelementStart(0, "ul", 0);
1861
- i0.ɵɵtemplate(1, UploadQueueComponent_li_1_Template, 6, 2, "li", 1);
1862
- i0.ɵɵelementEnd();
1863
- i0.ɵɵtemplate(2, UploadQueueComponent_button_2_Template, 2, 0, "button", 2);
1864
- } if (rf & 2) {
1865
- i0.ɵɵadvance(1);
1866
- i0.ɵɵproperty("ngForOf", ctx.files);
1867
- i0.ɵɵadvance(1);
1868
- i0.ɵɵproperty("ngIf", ctx.files.length > 0);
1869
- } }, dependencies: [i1.NgForOf, i1.NgIf, i4$1.IconComponent], encapsulation: 2 });
1870
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UploadQueueComponent, [{
1871
- type: Component,
1872
- args: [{ selector: 'aui-upload-queue', template: "<ul class=\"m-upload__files u-margin-bottom-xs\">\n <li *ngFor=\"let file of files; let i = index\">\n <aui-icon name=\"ai-common-file-empty\"></aui-icon>\n <span class=\"m-upload__filename\">{{ file.name }}</span>\n\n <button\n (click)=\"remove(i)\"\n class=\"m-upload__delete a-button a-button--text a-button--neutral a-button--s has-icon\"\n type=\"button\"\n >\n <aui-icon name=\"ai-close\" [ariaLabel]=\"ariaLabelRemove\"></aui-icon>\n </button>\n </li>\n</ul>\n\n<button (click)=\"uploadFiles()\" *ngIf=\"files.length > 0\" class=\"a-button\" type=\"button\">Upload</button>\n" }]
1873
- }], null, { files: [{
1874
- type: Input
1875
- }], uploader: [{
1876
- type: Input
1877
- }], ariaLabelRemove: [{
1878
- type: Input
1879
- }], uploadedFiles: [{
1880
- type: Output
1881
- }] }); })();
1882
-
1883
- const _c0$2 = ["fileInput"];
1884
- function UploadZoneComponent_div_0_div_5_Template(rf, ctx) { if (rf & 1) {
1885
- i0.ɵɵelementStart(0, "div", 10)(1, "label", 11);
1886
- i0.ɵɵtext(2);
1887
- i0.ɵɵelementEnd();
1888
- i0.ɵɵelementStart(3, "p", 12);
1889
- i0.ɵɵtext(4);
1890
- i0.ɵɵelementEnd()();
1891
- } if (rf & 2) {
1892
- const ctx_r3 = i0.ɵɵnextContext(2);
1893
- i0.ɵɵadvance(1);
1894
- i0.ɵɵproperty("for", ctx_r3.ariaId);
1895
- i0.ɵɵadvance(1);
1896
- i0.ɵɵtextInterpolate1(" ", ctx_r3.label, " ");
1897
- i0.ɵɵadvance(2);
1898
- i0.ɵɵtextInterpolate(ctx_r3.uploadedFilesString);
1899
- } }
1900
- function UploadZoneComponent_div_0_ng_container_6_ng_container_2_ng_container_2_Template(rf, ctx) { if (rf & 1) {
1901
- i0.ɵɵelementContainerStart(0);
1902
- i0.ɵɵtext(1, ",");
1903
- i0.ɵɵelementContainerEnd();
1904
- } }
1905
- function UploadZoneComponent_div_0_ng_container_6_ng_container_2_Template(rf, ctx) { if (rf & 1) {
1906
- i0.ɵɵelementContainerStart(0);
1907
- i0.ɵɵtext(1);
1908
- i0.ɵɵtemplate(2, UploadZoneComponent_div_0_ng_container_6_ng_container_2_ng_container_2_Template, 2, 0, "ng-container", 8);
1909
- i0.ɵɵelementContainerEnd();
1910
- } if (rf & 2) {
1911
- const file_r6 = ctx.$implicit;
1912
- const last_r7 = ctx.last;
1913
- i0.ɵɵadvance(1);
1914
- i0.ɵɵtextInterpolate1(" ", file_r6.name, " ");
1915
- i0.ɵɵadvance(1);
1916
- i0.ɵɵproperty("ngIf", !last_r7);
1917
- } }
1918
- function UploadZoneComponent_div_0_ng_container_6_Template(rf, ctx) { if (rf & 1) {
1919
- i0.ɵɵelementContainerStart(0);
1920
- i0.ɵɵelementStart(1, "p", 13);
1921
- i0.ɵɵtemplate(2, UploadZoneComponent_div_0_ng_container_6_ng_container_2_Template, 3, 2, "ng-container", 14);
1922
- i0.ɵɵelementEnd();
1923
- i0.ɵɵelement(3, "aui-progress-bar", 15);
1924
- i0.ɵɵelementContainerEnd();
1925
- } if (rf & 2) {
1926
- const ctx_r4 = i0.ɵɵnextContext(2);
1927
- i0.ɵɵadvance(2);
1928
- i0.ɵɵproperty("ngForOf", ctx_r4.uploadingFiles);
1929
- i0.ɵɵadvance(1);
1930
- i0.ɵɵproperty("value", ctx_r4.uploadProgress);
1931
- } }
1932
- function UploadZoneComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1933
- const _r10 = i0.ɵɵgetCurrentView();
1934
- i0.ɵɵelementStart(0, "div", 2)(1, "div", 3)(2, "div", 4)(3, "input", 5, 6);
1935
- i0.ɵɵlistener("click", function UploadZoneComponent_div_0_Template_input_click_3_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r9.onFileClick($event)); })("change", function UploadZoneComponent_div_0_Template_input_change_3_listener() { i0.ɵɵrestoreView(_r10); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.updateFiles()); });
1936
- i0.ɵɵelementEnd();
1937
- i0.ɵɵtemplate(5, UploadZoneComponent_div_0_div_5_Template, 5, 3, "div", 7);
1938
- i0.ɵɵtemplate(6, UploadZoneComponent_div_0_ng_container_6_Template, 4, 2, "ng-container", 8);
1939
- i0.ɵɵelementEnd()();
1940
- i0.ɵɵelementStart(7, "small", 9);
1941
- i0.ɵɵtext(8);
1942
- i0.ɵɵelementEnd()();
1943
- } if (rf & 2) {
1944
- const ctx_r0 = i0.ɵɵnextContext();
1945
- i0.ɵɵclassProp("is-disabled", ctx_r0.disabled);
1946
- i0.ɵɵadvance(3);
1947
- i0.ɵɵproperty("id", ctx_r0.id);
1948
- i0.ɵɵattribute("aria-labelledby", ctx_r0.ariaId);
1949
- i0.ɵɵadvance(2);
1950
- i0.ɵɵproperty("ngIf", !ctx_r0.uploadProgress || ctx_r0.uploadProgress === 0);
1951
- i0.ɵɵadvance(1);
1952
- i0.ɵɵproperty("ngIf", ctx_r0.uploadProgress > 0);
1953
- i0.ɵɵadvance(2);
1954
- i0.ɵɵtextInterpolate1(" ", ctx_r0.description, " ");
1955
- } }
1956
- function UploadZoneComponent_button_1_Template(rf, ctx) { if (rf & 1) {
1957
- const _r14 = i0.ɵɵgetCurrentView();
1958
- i0.ɵɵelementStart(0, "button", 16);
1959
- i0.ɵɵlistener("click", function UploadZoneComponent_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.triggerFile()); });
1960
- i0.ɵɵelementStart(1, "span", 17);
1961
- i0.ɵɵprojection(2);
1962
- i0.ɵɵelementEnd();
1963
- i0.ɵɵelementStart(3, "input", 5, 6);
1964
- i0.ɵɵlistener("click", function UploadZoneComponent_button_1_Template_input_click_3_listener($event) { i0.ɵɵrestoreView(_r14); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onFileClick($event)); })("change", function UploadZoneComponent_button_1_Template_input_change_3_listener() { i0.ɵɵrestoreView(_r14); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.updateFiles()); });
1965
- i0.ɵɵelementEnd()();
1966
- } if (rf & 2) {
1967
- const ctx_r1 = i0.ɵɵnextContext();
1968
- i0.ɵɵproperty("disabled", ctx_r1.disabled);
1969
- i0.ɵɵadvance(1);
1970
- i0.ɵɵproperty("id", ctx_r1.ariaId);
1971
- i0.ɵɵadvance(2);
1972
- i0.ɵɵproperty("id", ctx_r1.id);
1973
- i0.ɵɵattribute("aria-labelledby", ctx_r1.ariaId);
1974
- } }
1975
- const _c1$2 = [[["", 8, "m-upload__button"]]];
1976
- const _c2 = [".m-upload__button"];
1977
- class UploadZoneComponent {
1978
- onDragOver(event) {
1979
- this.preventAndStop(event);
1980
- this.hasDragOver = true;
1981
- }
1982
- onDragLeave(event) {
1983
- this.preventAndStop(event);
1984
- this.hasDragOver = false;
1985
- }
1986
- onDrop(event) {
1987
- this.preventAndStop(event);
1988
- this.hasDragOver = false;
1989
- const files = this.fileListToArray(event.dataTransfer.files);
1990
- this.handleFiles(files);
1991
- }
1992
- constructor(renderer) {
1993
- this.renderer = renderer;
1994
- this.id = '';
1995
- this.accept = [];
1996
- this.capture = '';
1997
- this.ariaId = '';
1998
- this.disabled = false;
1999
- this.multiple = true;
2000
- this.label = '';
2001
- this.description = '';
2002
- this.uploadedFiles = new EventEmitter();
2003
- this.queuedFiles = new EventEmitter();
2004
- this.invalidFiles = new EventEmitter();
2005
- this.hasDragOver = false;
2006
- this.uploadProgress = 0;
2007
- }
2008
- triggerFile() {
2009
- this.fileInput.nativeElement.click();
2010
- }
2011
- updateFiles() {
2012
- const files = this.fileListToArray(this.fileInput.nativeElement.files);
2013
- this.uploadedFilesString = files.map((file) => file.name).join(', ');
2014
- this.handleFiles(files);
2015
- }
2016
- onFileClick(event) {
2017
- // When removing a file make sure you can add it again later
2018
- // See: https://stackoverflow.com/questions/59870335/ng2-file-upload-not-allowing-me-to-add-same-doc-after-ive-removed-it-from-que
2019
- event.target.value = '';
2020
- }
2021
- ngAfterViewInit() {
2022
- if (this.multiple !== false) {
2023
- this.renderer.setProperty(this.fileInput.nativeElement, 'multiple', 'multiple');
2024
- }
2025
- if (!!this.accept.length) {
2026
- this.renderer.setProperty(this.fileInput.nativeElement, 'accept', this.accept.join());
2027
- }
2028
- if (this.disabled) {
2029
- this.renderer.setProperty(this.fileInput.nativeElement, 'disabled', 'disabled');
2030
- }
2031
- if (this.capture !== '') {
2032
- this.renderer.setAttribute(this.fileInput.nativeElement, 'capture', this.capture);
2033
- }
2034
- }
2035
- handleFiles(files) {
2036
- const response = this.uploader.validateFiles(files);
2037
- this.invalidFiles.emit(response.invalidFiles);
2038
- if (this.uploader.options.autoUpload && response.validFiles.length > 0) {
2039
- this.uploadFiles(response.validFiles);
2040
- }
2041
- else {
2042
- this.queuedFiles.emit(response.validFiles);
2043
- }
2044
- }
2045
- uploadFiles(files) {
2046
- // Reset progress
2047
- this.uploadProgress = 0;
2048
- this.uploadingFiles = files;
2049
- // upload
2050
- this.uploader.uploadFiles(files).subscribe((response) => {
2051
- if (response.progress) {
2052
- this.uploadProgress = Math.floor(response.progress * 100);
2053
- }
2054
- if (response.data) {
2055
- this.uploadedFiles.emit(response.data);
2056
- }
2057
- }, (err) => {
2058
- console.log(err);
2059
- });
2060
- }
2061
- fileListToArray(list) {
2062
- return Array.from(list);
2063
- }
2064
- preventAndStop(event) {
2065
- event.preventDefault();
2066
- event.stopPropagation();
2067
- }
2068
- uploadedFilesToString() {
2069
- console.log('UPLOADS TO STRING');
2070
- return this.fileInput.nativeElement.files.map((file) => file.name).join('');
2071
- }
2072
- }
2073
- /** @nocollapse */ UploadZoneComponent.ɵfac = function UploadZoneComponent_Factory(t) { return new (t || UploadZoneComponent)(i0.ɵɵdirectiveInject(i0.Renderer2)); };
2074
- /** @nocollapse */ UploadZoneComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: UploadZoneComponent, selectors: [["aui-upload-zone"]], viewQuery: function UploadZoneComponent_Query(rf, ctx) { if (rf & 1) {
2075
- i0.ɵɵviewQuery(_c0$2, 5);
2076
- } if (rf & 2) {
2077
- let _t;
2078
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
2079
- } }, hostBindings: function UploadZoneComponent_HostBindings(rf, ctx) { if (rf & 1) {
2080
- i0.ɵɵlistener("dragover", function UploadZoneComponent_dragover_HostBindingHandler($event) { return ctx.onDragOver($event); })("dragleave", function UploadZoneComponent_dragleave_HostBindingHandler($event) { return ctx.onDragLeave($event); })("drop", function UploadZoneComponent_drop_HostBindingHandler($event) { return ctx.onDrop($event); });
2081
- } }, inputs: { uploader: "uploader", id: "id", accept: "accept", capture: "capture", ariaId: "ariaId", disabled: "disabled", multiple: "multiple", label: "label", description: "description" }, outputs: { uploadedFiles: "uploadedFiles", queuedFiles: "queuedFiles", invalidFiles: "invalidFiles" }, ngContentSelectors: _c2, decls: 2, vars: 2, consts: [["class", "m-upload", 3, "is-disabled", 4, "ngIf"], ["class", "a-button m-upload__button", "type", "button", 3, "disabled", "click", 4, "ngIf"], [1, "m-upload"], [1, "m-upload__inner"], [1, "m-upload__dropzone"], ["type", "file", 1, "m-upload__input", 3, "id", "click", "change"], ["fileInput", ""], ["class", "m-upload__content", 4, "ngIf"], [4, "ngIf"], [1, "m-upload__description"], [1, "m-upload__content"], [1, "m-upload__message", 3, "for"], [1, "m-upload__uploads", "u-text-bold"], [1, "m-upload__uploads", "u-text-bold", "u-margin-bottom-xs"], [4, "ngFor", "ngForOf"], ["max", "100", 3, "value"], ["type", "button", 1, "a-button", "m-upload__button", 3, "disabled", "click"], [3, "id"]], template: function UploadZoneComponent_Template(rf, ctx) { if (rf & 1) {
2082
- i0.ɵɵprojectionDef(_c1$2);
2083
- i0.ɵɵtemplate(0, UploadZoneComponent_div_0_Template, 9, 7, "div", 0);
2084
- i0.ɵɵtemplate(1, UploadZoneComponent_button_1_Template, 5, 4, "button", 1);
2085
- } if (rf & 2) {
2086
- i0.ɵɵproperty("ngIf", ctx.uploader.options.type === "drop");
2087
- i0.ɵɵadvance(1);
2088
- i0.ɵɵproperty("ngIf", ctx.uploader.options.type === "button");
2089
- } }, dependencies: [i1.NgForOf, i1.NgIf, i2.ProgressBarComponent], styles: [".m-upload__button[_ngcontent-%COMP%]{position:relative}"] });
2090
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UploadZoneComponent, [{
2091
- type: Component,
2092
- args: [{ selector: 'aui-upload-zone', template: "<div *ngIf=\"uploader.options.type === 'drop'\" [class.is-disabled]=\"disabled\" class=\"m-upload\">\n <div class=\"m-upload__inner\">\n <div class=\"m-upload__dropzone\">\n <input\n #fileInput\n type=\"file\"\n class=\"m-upload__input\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"ariaId\"\n (click)=\"onFileClick($event)\"\n (change)=\"updateFiles()\"\n />\n\n <div *ngIf=\"!uploadProgress || uploadProgress === 0\" class=\"m-upload__content\">\n <label [for]=\"ariaId\" class=\"m-upload__message\">\n {{ label }}\n </label>\n <p class=\"m-upload__uploads u-text-bold\">{{ uploadedFilesString }}</p>\n </div>\n\n <ng-container *ngIf=\"uploadProgress > 0\">\n <p class=\"m-upload__uploads u-text-bold u-margin-bottom-xs\">\n <ng-container *ngFor=\"let file of uploadingFiles; let last = last\">\n {{ file.name }}\n <ng-container *ngIf=\"!last\">,</ng-container>\n </ng-container>\n </p>\n <aui-progress-bar [value]=\"uploadProgress\" max=\"100\"></aui-progress-bar>\n </ng-container>\n </div>\n </div>\n\n <small class=\"m-upload__description\">\n {{ description }}\n </small>\n</div>\n\n<button\n (click)=\"triggerFile()\"\n *ngIf=\"uploader.options.type === 'button'\"\n [disabled]=\"disabled\"\n class=\"a-button m-upload__button\"\n type=\"button\"\n>\n <span [id]=\"ariaId\"><ng-content select=\".m-upload__button\"></ng-content></span>\n <input\n #fileInput\n type=\"file\"\n class=\"m-upload__input\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"ariaId\"\n (click)=\"onFileClick($event)\"\n (change)=\"updateFiles()\"\n />\n</button>\n", styles: [".m-upload__button{position:relative}\n"] }]
2093
- }], function () { return [{ type: i0.Renderer2 }]; }, { fileInput: [{
2094
- type: ViewChild,
2095
- args: ['fileInput', { static: false }]
2096
- }], uploader: [{
2097
- type: Input
2098
- }], id: [{
2099
- type: Input
2100
- }], accept: [{
2101
- type: Input
2102
- }], capture: [{
2103
- type: Input
2104
- }], ariaId: [{
2105
- type: Input
2106
- }], disabled: [{
2107
- type: Input
2108
- }], multiple: [{
2109
- type: Input
2110
- }], label: [{
2111
- type: Input
2112
- }], description: [{
2113
- type: Input
2114
- }], uploadedFiles: [{
2115
- type: Output
2116
- }], queuedFiles: [{
2117
- type: Output
2118
- }], invalidFiles: [{
2119
- type: Output
2120
- }], onDragOver: [{
2121
- type: HostListener,
2122
- args: ['dragover', ['$event']]
2123
- }], onDragLeave: [{
2124
- type: HostListener,
2125
- args: ['dragleave', ['$event']]
2126
- }], onDrop: [{
2127
- type: HostListener,
2128
- args: ['drop', ['$event']]
2129
- }] }); })();
2130
-
2131
- class ValidationMessagesService {
2132
- constructor(initValues) {
2133
- this.initValues = initValues;
2134
- this.INVALID_FILE_TYPE = 'INVALID_FILE_TYPE';
2135
- this.INVALID_FILE_SIZE = 'INVALID_FILE_SIZE';
2136
- this.INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';
2137
- if (initValues.INVALID_FILE_TYPE) {
2138
- this.INVALID_FILE_TYPE = initValues.INVALID_FILE_TYPE;
2139
- }
2140
- if (initValues.INVALID_FILE_SIZE) {
2141
- this.INVALID_FILE_SIZE = initValues.INVALID_FILE_SIZE;
2142
- }
2143
- if (initValues.INVALID_MIME_TYPE) {
2144
- this.INVALID_MIME_TYPE = initValues.INVALID_MIME_TYPE;
2145
- }
2146
- }
2147
- }
2148
- /** @nocollapse */ ValidationMessagesService.ɵfac = function ValidationMessagesService_Factory(t) { return new (t || ValidationMessagesService)(i0.ɵɵinject(UPLOAD_VALIDATION_MESSAGES)); };
2149
- /** @nocollapse */ ValidationMessagesService.ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ValidationMessagesService, factory: ValidationMessagesService.ɵfac });
2150
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ValidationMessagesService, [{
2151
- type: Injectable
2152
- }], function () { return [{ type: undefined, decorators: [{
2153
- type: Inject,
2154
- args: [UPLOAD_VALIDATION_MESSAGES]
2155
- }] }]; }, null); })();
2156
-
2157
- function ValidationListComponent_li_1_Template(rf, ctx) { if (rf & 1) {
2158
- const _r4 = i0.ɵɵgetCurrentView();
2159
- i0.ɵɵelementStart(0, "li", 2);
2160
- i0.ɵɵelement(1, "aui-icon", 3);
2161
- i0.ɵɵelementStart(2, "span", 4);
2162
- i0.ɵɵtext(3);
2163
- i0.ɵɵelementEnd();
2164
- i0.ɵɵelementStart(4, "span", 5);
2165
- i0.ɵɵtext(5);
2166
- i0.ɵɵelementEnd();
2167
- i0.ɵɵelementStart(6, "button", 6);
2168
- i0.ɵɵlistener("click", function ValidationListComponent_li_1_Template_button_click_6_listener() { const restoredCtx = i0.ɵɵrestoreView(_r4); const i_r2 = restoredCtx.index; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.remove(i_r2)); });
2169
- i0.ɵɵelement(7, "aui-icon", 7);
2170
- i0.ɵɵelementEnd()();
2171
- } if (rf & 2) {
2172
- const invalidFile_r1 = ctx.$implicit;
2173
- const ctx_r0 = i0.ɵɵnextContext();
2174
- i0.ɵɵadvance(3);
2175
- i0.ɵɵtextInterpolate(invalidFile_r1.file.name);
2176
- i0.ɵɵadvance(2);
2177
- i0.ɵɵtextInterpolate(ctx_r0.formatReasons(invalidFile_r1.reasons));
2178
- i0.ɵɵadvance(2);
2179
- i0.ɵɵproperty("ariaLabel", ctx_r0.ariaLabelRemove);
2180
- } }
2181
- class ValidationListComponent {
2182
- constructor(messagesService) {
2183
- this.messagesService = messagesService;
2184
- this.invalidFiles = [];
2185
- this.ariaLabelRemove = 'Verwijder';
2186
- }
2187
- remove(index) {
2188
- this.invalidFiles.splice(index, 1);
2189
- }
2190
- formatReasons(reasons) {
2191
- const result = [];
2192
- for (const reason of reasons) {
2193
- result.push(this.messagesService[reason]);
2194
- }
2195
- return result.join(', ');
2196
- }
2197
- }
2198
- /** @nocollapse */ ValidationListComponent.ɵfac = function ValidationListComponent_Factory(t) { return new (t || ValidationListComponent)(i0.ɵɵdirectiveInject(ValidationMessagesService)); };
2199
- /** @nocollapse */ ValidationListComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: ValidationListComponent, selectors: [["aui-validation-list"]], inputs: { invalidFiles: "invalidFiles", ariaLabelRemove: "ariaLabelRemove" }, decls: 2, vars: 1, consts: [[1, "m-upload__files"], ["class", "is-error", 4, "ngFor", "ngForOf"], [1, "is-error"], ["name", "ai-alert-triangle"], [1, "m-upload__filename"], [1, "m-upload__error"], ["type", "button", 1, "m-upload__delete", "a-button", "a-button--text", "a-button--danger", "a-button--s", "has-icon", 3, "click"], ["name", "ai-close", 3, "ariaLabel"]], template: function ValidationListComponent_Template(rf, ctx) { if (rf & 1) {
2200
- i0.ɵɵelementStart(0, "ul", 0);
2201
- i0.ɵɵtemplate(1, ValidationListComponent_li_1_Template, 8, 3, "li", 1);
2202
- i0.ɵɵelementEnd();
2203
- } if (rf & 2) {
2204
- i0.ɵɵadvance(1);
2205
- i0.ɵɵproperty("ngForOf", ctx.invalidFiles);
2206
- } }, dependencies: [i1.NgForOf, i4$1.IconComponent], encapsulation: 2 });
2207
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ValidationListComponent, [{
2208
- type: Component,
2209
- args: [{ selector: 'aui-validation-list', template: "<ul class=\"m-upload__files\">\n <li *ngFor=\"let invalidFile of invalidFiles; let i = index\" class=\"is-error\">\n <aui-icon name=\"ai-alert-triangle\"></aui-icon>\n <span class=\"m-upload__filename\">{{ invalidFile.file.name }}</span>\n <span class=\"m-upload__error\">{{ formatReasons(invalidFile.reasons) }}</span>\n\n <button\n (click)=\"remove(i)\"\n class=\"m-upload__delete a-button a-button--text a-button--danger a-button--s has-icon\"\n type=\"button\"\n >\n <aui-icon name=\"ai-close\" [ariaLabel]=\"ariaLabelRemove\"></aui-icon>\n </button>\n </li>\n</ul>\n" }]
2210
- }], function () { return [{ type: ValidationMessagesService }]; }, { invalidFiles: [{
2211
- type: Input
2212
- }], ariaLabelRemove: [{
2213
- type: Input
2214
- }] }); })();
2215
-
2216
- function UploadComponent_aui_upload_queue_5_Template(rf, ctx) { if (rf & 1) {
2217
- const _r2 = i0.ɵɵgetCurrentView();
2218
- i0.ɵɵelementStart(0, "aui-upload-queue", 5);
2219
- i0.ɵɵlistener("uploadedFiles", function UploadComponent_aui_upload_queue_5_Template_aui_upload_queue_uploadedFiles_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onUploadedFiles($event)); });
2220
- i0.ɵɵelementEnd();
2221
- } if (rf & 2) {
2222
- const ctx_r0 = i0.ɵɵnextContext();
2223
- i0.ɵɵproperty("ariaLabelRemove", ctx_r0.ariaLabelRemove)("files", ctx_r0.queuedFiles)("uploader", ctx_r0.uploader);
2224
- } }
2225
- const _c0$1 = [[["", 8, "m-upload__button"]]];
2226
- const _c1$1 = [".m-upload__button"];
2227
- class UploadComponent {
2228
- constructor() {
2229
- this.id = '';
2230
- this.accept = [];
2231
- this.capture = '';
2232
- this.ariaLabelRemove = 'Verwijder';
2233
- this.disabled = false;
2234
- this.multiple = true;
2235
- this.label = '';
2236
- this.description = '';
2237
- this.options = UPLOAD_OPTIONS_DEFAULT;
2238
- this.selectUploadedFiles = new EventEmitter();
2239
- this.uploadedFiles = [];
2240
- this.invalidFiles = [];
2241
- this.queuedFiles = [];
2242
- }
2243
- ngOnInit() {
2244
- if (!this.id) {
2245
- this.ariaId = 'aui-upload-' + Math.random().toString(36).substring(2);
2246
- this.id = this.ariaId;
2247
- }
2248
- this.uploader = new Uploader(this.options);
2249
- }
2250
- onUploadedFiles(files) {
2251
- this.uploadedFiles = this.uploadedFiles.concat(files);
2252
- this.selectUploadedFiles.emit(this.uploadedFiles);
2253
- }
2254
- onInvalidFiles(files) {
2255
- this.invalidFiles = files;
2256
- }
2257
- onQueuedFiles(files) {
2258
- this.queuedFiles = this.queuedFiles.concat(files);
2259
- }
2260
- }
2261
- /** @nocollapse */ UploadComponent.ɵfac = function UploadComponent_Factory(t) { return new (t || UploadComponent)(); };
2262
- /** @nocollapse */ UploadComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: UploadComponent, selectors: [["aui-upload"]], inputs: { id: "id", accept: "accept", capture: "capture", ariaLabelRemove: "ariaLabelRemove", disabled: "disabled", multiple: "multiple", label: "label", description: "description", options: "options" }, outputs: { selectUploadedFiles: "selectUploadedFiles" }, ngContentSelectors: _c1$1, decls: 6, vars: 12, consts: [[1, "m-upload", "aui-upload"], [3, "id", "accept", "capture", "ariaId", "disabled", "multiple", "uploader", "label", "description", "invalidFiles", "queuedFiles", "uploadedFiles"], [1, "m-upload__button"], [3, "ariaLabelRemove", "invalidFiles"], [3, "ariaLabelRemove", "files", "uploader", "uploadedFiles", 4, "ngIf"], [3, "ariaLabelRemove", "files", "uploader", "uploadedFiles"]], template: function UploadComponent_Template(rf, ctx) { if (rf & 1) {
2263
- i0.ɵɵprojectionDef(_c0$1);
2264
- i0.ɵɵelementStart(0, "div", 0)(1, "aui-upload-zone", 1);
2265
- i0.ɵɵlistener("invalidFiles", function UploadComponent_Template_aui_upload_zone_invalidFiles_1_listener($event) { return ctx.onInvalidFiles($event); })("queuedFiles", function UploadComponent_Template_aui_upload_zone_queuedFiles_1_listener($event) { return ctx.onQueuedFiles($event); })("uploadedFiles", function UploadComponent_Template_aui_upload_zone_uploadedFiles_1_listener($event) { return ctx.onUploadedFiles($event); });
2266
- i0.ɵɵelementStart(2, "div", 2);
2267
- i0.ɵɵprojection(3);
2268
- i0.ɵɵelementEnd()();
2269
- i0.ɵɵelement(4, "aui-validation-list", 3);
2270
- i0.ɵɵtemplate(5, UploadComponent_aui_upload_queue_5_Template, 1, 3, "aui-upload-queue", 4);
2271
- i0.ɵɵelementEnd();
2272
- } if (rf & 2) {
2273
- i0.ɵɵadvance(1);
2274
- i0.ɵɵproperty("id", ctx.id)("accept", ctx.accept)("capture", ctx.capture)("ariaId", ctx.ariaId)("disabled", ctx.disabled)("multiple", ctx.multiple)("uploader", ctx.uploader)("label", ctx.label)("description", ctx.description);
2275
- i0.ɵɵadvance(3);
2276
- i0.ɵɵproperty("ariaLabelRemove", ctx.ariaLabelRemove)("invalidFiles", ctx.invalidFiles);
2277
- i0.ɵɵadvance(1);
2278
- i0.ɵɵproperty("ngIf", !(ctx.options == null ? null : ctx.options.autoUpload));
2279
- } }, dependencies: [i1.NgIf, UploadQueueComponent, UploadZoneComponent, ValidationListComponent], styles: [".m-upload__button[_ngcontent-%COMP%]{position:relative}"] });
2280
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UploadComponent, [{
2281
- type: Component,
2282
- args: [{ selector: 'aui-upload', template: "<div class=\"m-upload aui-upload\">\n <aui-upload-zone\n [id]=\"id\"\n [accept]=\"accept\"\n [capture]=\"capture\"\n [ariaId]=\"ariaId\"\n [disabled]=\"disabled\"\n [multiple]=\"multiple\"\n [uploader]=\"uploader\"\n (invalidFiles)=\"onInvalidFiles($event)\"\n (queuedFiles)=\"onQueuedFiles($event)\"\n (uploadedFiles)=\"onUploadedFiles($event)\"\n [label]=\"label\"\n [description]=\"description\"\n >\n <div class=\"m-upload__button\">\n <ng-content select=\".m-upload__button\"></ng-content>\n </div>\n </aui-upload-zone>\n <aui-validation-list [ariaLabelRemove]=\"ariaLabelRemove\" [invalidFiles]=\"invalidFiles\"></aui-validation-list>\n <aui-upload-queue\n (uploadedFiles)=\"onUploadedFiles($event)\"\n *ngIf=\"!options?.autoUpload\"\n [ariaLabelRemove]=\"ariaLabelRemove\"\n [files]=\"queuedFiles\"\n [uploader]=\"uploader\"\n ></aui-upload-queue>\n</div>\n", styles: [".m-upload__button{position:relative}\n"] }]
2283
- }], null, { id: [{
2284
- type: Input
2285
- }], accept: [{
2286
- type: Input
2287
- }], capture: [{
2288
- type: Input
2289
- }], ariaLabelRemove: [{
2290
- type: Input
2291
- }], disabled: [{
2292
- type: Input
2293
- }], multiple: [{
2294
- type: Input
2295
- }], label: [{
2296
- type: Input
2297
- }], description: [{
2298
- type: Input
2299
- }], options: [{
2300
- type: Input
2301
- }], selectUploadedFiles: [{
2302
- type: Output
2303
- }] }); })();
2304
-
2305
- const _c0 = [[["", 8, "m-upload__message"]], [["", 8, "m-upload__description"]], [["", 8, "m-upload__button"]]];
2306
- const _c1 = [".m-upload__message", ".m-upload__description", ".m-upload__button"];
2307
- class UploadInputComponent {
2308
- constructor() {
2309
- this.propagateChange = (_) => undefined;
2310
- }
2311
- writeValue(value) {
2312
- }
2313
- registerOnChange(fn) {
2314
- this.propagateChange = fn;
2315
- }
2316
- registerOnTouched() {
2317
- }
2318
- onUpload(files) {
2319
- const data = (this.format ? this.format(files) : files);
2320
- this.propagateChange(data);
2321
- }
2322
- }
2323
- /** @nocollapse */ UploadInputComponent.ɵfac = function UploadInputComponent_Factory(t) { return new (t || UploadInputComponent)(); };
2324
- /** @nocollapse */ UploadInputComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: UploadInputComponent, selectors: [["aui-upload-input"]], inputs: { options: "options", format: "format" }, features: [i0.ɵɵProvidersFeature([{
2325
- provide: NG_VALUE_ACCESSOR,
2326
- useExisting: UploadInputComponent,
2327
- multi: true,
2328
- }])], ngContentSelectors: _c1, decls: 7, vars: 1, consts: [[3, "options", "selectUploadedFiles"], [1, "m-upload__message"], [1, "m-upload__description"], [1, "m-upload__button"]], template: function UploadInputComponent_Template(rf, ctx) { if (rf & 1) {
2329
- i0.ɵɵprojectionDef(_c0);
2330
- i0.ɵɵelementStart(0, "aui-upload", 0);
2331
- i0.ɵɵlistener("selectUploadedFiles", function UploadInputComponent_Template_aui_upload_selectUploadedFiles_0_listener($event) { return ctx.onUpload($event); });
2332
- i0.ɵɵelementStart(1, "div", 1);
2333
- i0.ɵɵprojection(2);
2334
- i0.ɵɵelementEnd();
2335
- i0.ɵɵelementStart(3, "div", 2);
2336
- i0.ɵɵprojection(4, 1);
2337
- i0.ɵɵelementEnd();
2338
- i0.ɵɵelementStart(5, "div", 3);
2339
- i0.ɵɵprojection(6, 2);
2340
- i0.ɵɵelementEnd()();
2341
- } if (rf & 2) {
2342
- i0.ɵɵproperty("options", ctx.options);
2343
- } }, dependencies: [UploadComponent], encapsulation: 2 });
2344
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UploadInputComponent, [{
2345
- type: Component,
2346
- args: [{ selector: 'aui-upload-input', providers: [{
2347
- provide: NG_VALUE_ACCESSOR,
2348
- useExisting: UploadInputComponent,
2349
- multi: true,
2350
- }], template: "<aui-upload (selectUploadedFiles)=\"onUpload($event)\" [options]=\"options\">\n <div class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </div>\n <div class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </div>\n <div class=\"m-upload__button\">\n <ng-content select=\".m-upload__button\"></ng-content>\n </div>\n</aui-upload>\n" }]
2351
- }], null, { options: [{
2352
- type: Input
2353
- }], format: [{
2354
- type: Input
2355
- }] }); })();
2356
-
2357
- class UploadModule {
2358
- static forChild(validationMessages = {}) {
2359
- return {
2360
- ngModule: UploadModule,
2361
- providers: [{ provide: UPLOAD_VALIDATION_MESSAGES, useValue: validationMessages }],
2362
- };
2363
- }
2364
- }
2365
- /** @nocollapse */ UploadModule.ɵfac = function UploadModule_Factory(t) { return new (t || UploadModule)(); };
2366
- /** @nocollapse */ UploadModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: UploadModule });
2367
- /** @nocollapse */ UploadModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ValidationMessagesService, { provide: UPLOAD_VALIDATION_MESSAGES, useValue: {} }], imports: [CommonModule, ProgressBarModule, FormsModule, IconModule] });
2368
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UploadModule, [{
2369
- type: NgModule,
2370
- args: [{
2371
- imports: [CommonModule, ProgressBarModule, FormsModule, IconModule],
2372
- declarations: [
2373
- UploadComponent,
2374
- UploadInputComponent,
2375
- UploadQueueComponent,
2376
- UploadZoneComponent,
2377
- ValidationListComponent,
2378
- ],
2379
- exports: [UploadComponent, UploadInputComponent, UploadQueueComponent, UploadZoneComponent, ValidationListComponent],
2380
- providers: [ValidationMessagesService, { provide: UPLOAD_VALIDATION_MESSAGES, useValue: {} }],
2381
- }]
2382
- }], null, null); })();
2383
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(UploadModule, { declarations: [UploadComponent,
2384
- UploadInputComponent,
2385
- UploadQueueComponent,
2386
- UploadZoneComponent,
2387
- ValidationListComponent], imports: [CommonModule, ProgressBarModule, FormsModule, IconModule], exports: [UploadComponent, UploadInputComponent, UploadQueueComponent, UploadZoneComponent, ValidationListComponent] }); })();
2388
-
2389
- /**
2390
- * Generated bundle index. Do not edit.
2391
- */
2392
-
2393
- export { AutoCompleteComponent, AutoCompleteModule, DATEPICKER_DEFAULT_ERROR_LABELS, DATEPICKER_ERROR_LABELS, DATEPICKER_SEPARATOR_CHAR, DatepickerComponent, DatepickerModule, RangeSliderComponent, RangeSliderModule, SearchFilterComponent, SearchFilterModule, TimePickerValidators, TimepickerComponent, TimepickerInputSize, TimepickerModule, UPLOAD_OPTIONS_DEFAULT, UPLOAD_VALIDATION_MESSAGES, UploadComponent, UploadInputComponent, UploadModule, UploadQueueComponent, UploadZoneComponent, Uploader, ValidationListComponent, ValidationMessagesService };
2394
- //# sourceMappingURL=acpaas-ui-ngx-forms.mjs.map