@acpaas-ui/ngx-forms 5.4.0 → 6.0.0-beta.1

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