@acpaas-ui/ngx-forms 5.3.0 → 6.0.0-beta.0

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