@klippa/ngx-enhancy-forms 10.2.1 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/esm2020/klippa-ngx-enhancy-forms.mjs +5 -0
  2. package/esm2020/lib/elements/button/button.component.mjs +57 -0
  3. package/esm2020/lib/elements/checkbox/checkbox.component.mjs +23 -0
  4. package/esm2020/lib/elements/date-picker/date-picker.component.mjs +108 -0
  5. package/esm2020/lib/elements/date-time-picker/date-time-picker.component.mjs +360 -0
  6. package/esm2020/lib/elements/email/email-input.component.mjs +20 -0
  7. package/esm2020/lib/elements/file-input/file-input.component.mjs +71 -0
  8. package/esm2020/lib/elements/hour-minute-input/hour-minute-input.component.mjs +90 -0
  9. package/esm2020/lib/elements/loading-indicator/loading-indicator.component.mjs +20 -0
  10. package/esm2020/lib/elements/number-input/number-input.component.mjs +31 -0
  11. package/esm2020/lib/elements/password-field/password-field.component.mjs +21 -0
  12. package/esm2020/lib/elements/select/select-footer/select-footer.component.mjs +15 -0
  13. package/esm2020/lib/elements/select/select.component.mjs +129 -0
  14. package/esm2020/lib/elements/sortable-grouped-items/sortable-grouped-items.component.mjs +51 -0
  15. package/esm2020/lib/elements/sortable-items/sortable-items.component.mjs +70 -0
  16. package/esm2020/lib/elements/text-input/text-input.component.mjs +28 -0
  17. package/esm2020/lib/elements/toggle/toggle.component.mjs +15 -0
  18. package/esm2020/lib/elements/value-accessor-base/multiple-value-accessor-base.component.mjs +61 -0
  19. package/esm2020/lib/elements/value-accessor-base/value-accessor-base.component.mjs +144 -0
  20. package/esm2020/lib/form/form-caption/form-caption.component.mjs +36 -0
  21. package/esm2020/lib/form/form-element/form-element.component.mjs +124 -0
  22. package/esm2020/lib/form/form-error/form-error.component.mjs +39 -0
  23. package/esm2020/lib/form/form-submit-button/form-submit-button.component.mjs +61 -0
  24. package/esm2020/lib/form/form.component.mjs +180 -0
  25. package/esm2020/lib/material.module.mjs +22 -0
  26. package/esm2020/lib/ngx-enhancy-forms.module.mjs +158 -0
  27. package/esm2020/lib/types.mjs +2 -0
  28. package/esm2020/lib/util/arrays.mjs +45 -0
  29. package/esm2020/lib/util/values.mjs +23 -0
  30. package/esm2020/lib/validators/dateValidator.mjs +6 -0
  31. package/esm2020/lib/validators/timeValidator.mjs +6 -0
  32. package/esm2020/public-api.mjs +30 -0
  33. package/fesm2015/klippa-ngx-enhancy-forms.mjs +1894 -0
  34. package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -0
  35. package/fesm2020/klippa-ngx-enhancy-forms.mjs +1858 -0
  36. package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -0
  37. package/{klippa-ngx-enhancy-forms.d.ts → index.d.ts} +1 -1
  38. package/lib/elements/button/button.component.d.ts +3 -0
  39. package/lib/elements/checkbox/checkbox.component.d.ts +3 -0
  40. package/lib/elements/date-picker/date-picker.component.d.ts +3 -0
  41. package/lib/elements/date-time-picker/date-time-picker.component.d.ts +3 -0
  42. package/lib/elements/email/email-input.component.d.ts +3 -0
  43. package/lib/elements/file-input/file-input.component.d.ts +3 -0
  44. package/lib/elements/hour-minute-input/hour-minute-input.component.d.ts +3 -0
  45. package/lib/elements/loading-indicator/loading-indicator.component.d.ts +3 -0
  46. package/lib/elements/number-input/number-input.component.d.ts +3 -0
  47. package/lib/elements/password-field/password-field.component.d.ts +3 -0
  48. package/lib/elements/select/select-footer/select-footer.component.d.ts +3 -0
  49. package/lib/elements/select/select.component.d.ts +5 -0
  50. package/lib/elements/sortable-grouped-items/sortable-grouped-items.component.d.ts +3 -0
  51. package/lib/elements/sortable-items/sortable-items.component.d.ts +3 -0
  52. package/lib/elements/text-input/text-input.component.d.ts +3 -0
  53. package/lib/elements/toggle/toggle.component.d.ts +3 -0
  54. package/lib/elements/value-accessor-base/multiple-value-accessor-base.component.d.ts +3 -0
  55. package/lib/elements/value-accessor-base/value-accessor-base.component.d.ts +5 -2
  56. package/lib/form/form-caption/form-caption.component.d.ts +3 -0
  57. package/lib/form/form-element/form-element.component.d.ts +8 -5
  58. package/lib/form/form-error/form-error.component.d.ts +3 -0
  59. package/lib/form/form-submit-button/form-submit-button.component.d.ts +3 -0
  60. package/lib/form/form.component.d.ts +10 -5
  61. package/lib/material.module.d.ts +9 -0
  62. package/lib/ngx-enhancy-forms.module.d.ts +32 -0
  63. package/package.json +29 -16
  64. package/src/lib/form/README.md +1 -0
  65. package/bundles/klippa-ngx-enhancy-forms.umd.js +0 -2185
  66. package/bundles/klippa-ngx-enhancy-forms.umd.js.map +0 -1
  67. package/bundles/klippa-ngx-enhancy-forms.umd.min.js +0 -17
  68. package/bundles/klippa-ngx-enhancy-forms.umd.min.js.map +0 -1
  69. package/esm2015/klippa-ngx-enhancy-forms.js +0 -6
  70. package/esm2015/lib/elements/button/button.component.js +0 -50
  71. package/esm2015/lib/elements/checkbox/checkbox.component.js +0 -22
  72. package/esm2015/lib/elements/date-picker/date-picker.component.js +0 -95
  73. package/esm2015/lib/elements/date-time-picker/date-time-picker.component.js +0 -330
  74. package/esm2015/lib/elements/email/email-input.component.js +0 -21
  75. package/esm2015/lib/elements/file-input/file-input.component.js +0 -66
  76. package/esm2015/lib/elements/hour-minute-input/hour-minute-input.component.js +0 -90
  77. package/esm2015/lib/elements/loading-indicator/loading-indicator.component.js +0 -19
  78. package/esm2015/lib/elements/number-input/number-input.component.js +0 -30
  79. package/esm2015/lib/elements/password-field/password-field.component.js +0 -21
  80. package/esm2015/lib/elements/select/select-footer/select-footer.component.js +0 -15
  81. package/esm2015/lib/elements/select/select.component.js +0 -104
  82. package/esm2015/lib/elements/sortable-grouped-items/sortable-grouped-items.component.js +0 -49
  83. package/esm2015/lib/elements/sortable-items/sortable-items.component.js +0 -67
  84. package/esm2015/lib/elements/text-input/text-input.component.js +0 -25
  85. package/esm2015/lib/elements/toggle/toggle.component.js +0 -14
  86. package/esm2015/lib/elements/value-accessor-base/multiple-value-accessor-base.component.js +0 -54
  87. package/esm2015/lib/elements/value-accessor-base/value-accessor-base.component.js +0 -135
  88. package/esm2015/lib/form/form-caption/form-caption.component.js +0 -35
  89. package/esm2015/lib/form/form-element/form-element.component.js +0 -118
  90. package/esm2015/lib/form/form-error/form-error.component.js +0 -37
  91. package/esm2015/lib/form/form-submit-button/form-submit-button.component.js +0 -53
  92. package/esm2015/lib/form/form.component.js +0 -173
  93. package/esm2015/lib/material.module.js +0 -17
  94. package/esm2015/lib/ngx-enhancy-forms.module.js +0 -97
  95. package/esm2015/lib/types.js +0 -2
  96. package/esm2015/lib/util/arrays.js +0 -45
  97. package/esm2015/lib/util/values.js +0 -23
  98. package/esm2015/lib/validators/dateValidator.js +0 -6
  99. package/esm2015/lib/validators/timeValidator.js +0 -6
  100. package/esm2015/public-api.js +0 -30
  101. package/fesm2015/klippa-ngx-enhancy-forms.js +0 -1716
  102. package/fesm2015/klippa-ngx-enhancy-forms.js.map +0 -1
  103. package/klippa-ngx-enhancy-forms.metadata.json +0 -1
@@ -1,1716 +0,0 @@
1
- import { Directive, Input, Component, SkipSelf, Optional, InjectionToken, Host, Inject, ViewChild, EventEmitter, Output, HostBinding, ElementRef, ContentChild, TemplateRef, ChangeDetectorRef, NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { FormArray, FormGroup, FormControl, ControlContainer, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
4
- import { isString, isArray } from 'lodash';
5
- import { __awaiter } from 'tslib';
6
- import { SortablejsModule } from 'ngx-sortablejs';
7
- import { NgSelectModule } from '@ng-select/ng-select';
8
- import { parse, format, isSameDay, startOfMonth, endOfMonth } from 'date-fns';
9
- import { MAT_NATIVE_DATE_FORMATS, MAT_DATE_FORMATS, DateAdapter, MatNativeDateModule } from '@angular/material/core';
10
- import { MatDatepickerModule } from '@angular/material/datepicker';
11
- import { MatFormFieldModule } from '@angular/material/form-field';
12
- import { MatInputModule } from '@angular/material/input';
13
- import { MatButtonModule } from '@angular/material/button';
14
-
15
- function stringIsSetAndFilled(s) {
16
- return isString(s) && s.length > 0;
17
- }
18
- function isNullOrUndefined(value) {
19
- return value === null || value === undefined;
20
- }
21
- function numberIsSet(value) {
22
- return isValueSet(value) && typeof value === 'number';
23
- }
24
- function isValueSet(value) {
25
- return value !== null && value !== undefined;
26
- }
27
- function stringOrArrayIsSetAndEmpty(value) {
28
- return value !== null && value !== undefined && value.length === 0;
29
- }
30
- function truncateString(s, length) {
31
- if (s.length < length) {
32
- return s;
33
- }
34
- return s.substring(0, length) + '...';
35
- }
36
-
37
- const invalidFieldsSymbol = Symbol('Not all fields are valid');
38
- class SubFormDirective {
39
- }
40
- SubFormDirective.decorators = [
41
- { type: Directive, args: [{
42
- // tslint:disable-next-line:directive-selector
43
- selector: 'klp-sub-form',
44
- },] }
45
- ];
46
- SubFormDirective.propDecorators = {
47
- injectInto: [{ type: Input }],
48
- at: [{ type: Input }]
49
- };
50
- class FormComponent {
51
- constructor(parent, subFormPlaceholder) {
52
- this.parent = parent;
53
- this.subFormPlaceholder = subFormPlaceholder;
54
- this.showErrorMessages = true;
55
- this.errorMessageLocation = 'belowCaption';
56
- // we keep track of what form controls are actually rendered. Only those count when looking at form validation
57
- this.activeControls = [];
58
- }
59
- ngOnInit() {
60
- if (isValueSet(this.parent) && isValueSet(this.subFormPlaceholder)) {
61
- const injectInto = this.subFormPlaceholder.injectInto;
62
- const injectAt = this.subFormPlaceholder.at;
63
- if (injectInto instanceof FormArray) {
64
- if (typeof injectAt !== 'number') {
65
- throw new Error(`cannot index FormArray with ${typeof injectAt}`);
66
- }
67
- injectInto.setControl(injectAt, this.formGroup);
68
- }
69
- else if (injectInto instanceof FormGroup) {
70
- if (typeof injectAt !== 'string') {
71
- throw new Error(`cannot index FormGroup with ${typeof injectAt}`);
72
- }
73
- injectInto.setControl(injectAt, this.formGroup);
74
- }
75
- }
76
- if (isValueSet(this.patchValueInterceptor)) {
77
- this.addSupportForPatchValueInterceptor();
78
- }
79
- }
80
- ngOnDestroy() {
81
- if (isValueSet(this.parent) && isValueSet(this.subFormPlaceholder)) {
82
- const injectInto = this.subFormPlaceholder.injectInto;
83
- const injectAt = this.subFormPlaceholder.at;
84
- if (injectInto instanceof FormArray) {
85
- const idx = injectInto.controls.findIndex(e => e === this.formGroup);
86
- injectInto.removeAt(idx);
87
- }
88
- else if (injectInto instanceof FormGroup) {
89
- if (typeof injectAt !== 'string') {
90
- throw new Error(`cannot index FormGroup with ${typeof injectAt}`);
91
- }
92
- injectInto.removeControl(injectAt);
93
- }
94
- }
95
- }
96
- addSupportForPatchValueInterceptor() {
97
- const fn = this.formGroup.patchValue;
98
- const newFn = (value, options) => {
99
- this.patchValueInterceptor(value).then((val) => {
100
- setTimeout(() => {
101
- fn.call(this.formGroup, val, options);
102
- });
103
- });
104
- };
105
- this.formGroup.patchValue = newFn;
106
- }
107
- registerControl(formControl, formElement) {
108
- this.activeControls.push({ formControl, formElement });
109
- if (this.parent) {
110
- this.parent.registerControl(formControl, formElement);
111
- }
112
- }
113
- unregisterControl(formControl) {
114
- this.activeControls = this.activeControls.filter((e) => e.formControl !== formControl);
115
- if (this.parent) {
116
- this.parent.unregisterControl(formControl);
117
- }
118
- }
119
- addFormGroupControls(formGroup, result) {
120
- Object.values(formGroup.controls).forEach((value) => {
121
- if (value instanceof FormGroup) {
122
- this.addFormGroupControls(value, result);
123
- }
124
- else if (value instanceof FormArray) {
125
- this.addFormArrayControls(value, result);
126
- }
127
- else if (value instanceof FormControl) {
128
- this.addFormControl(value, result);
129
- }
130
- });
131
- }
132
- addFormArrayControls(formArray, result) {
133
- formArray.controls.forEach((value) => {
134
- if (value instanceof FormGroup) {
135
- this.addFormGroupControls(value, result);
136
- }
137
- else if (value instanceof FormArray) {
138
- this.addFormArrayControls(value, result);
139
- }
140
- else if (value instanceof FormControl) {
141
- this.addFormControl(value, result);
142
- }
143
- });
144
- }
145
- getAllFormControls() {
146
- const result = [];
147
- this.addFormGroupControls(this.formGroup, result);
148
- return result;
149
- }
150
- addFormControl(control, result) {
151
- result.push(control);
152
- }
153
- disableInactiveFormControl(control) {
154
- if (!this.activeControls.some((e) => e.formControl === control)) {
155
- control.disable();
156
- }
157
- }
158
- trySubmit() {
159
- var _a, _b;
160
- this.formGroup.markAllAsTouched();
161
- const allControls = this.getAllFormControls();
162
- const originalDisabledStates = allControls.map(e => {
163
- return { control: e, disabled: e.disabled };
164
- });
165
- allControls.forEach(e => this.disableInactiveFormControl(e));
166
- allControls.forEach(e => e.updateValueAndValidity());
167
- const values = this.formGroup.value;
168
- if (this.formGroup.valid) {
169
- this.setDisabledStatesForAllControls(originalDisabledStates);
170
- return Promise.resolve(values);
171
- }
172
- else {
173
- (_b = (_a = this.activeControls.find((e) => !e.formControl.valid)) === null || _a === void 0 ? void 0 : _a.formElement) === null || _b === void 0 ? void 0 : _b.scrollTo();
174
- this.setDisabledStatesForAllControls(originalDisabledStates);
175
- return Promise.reject(invalidFieldsSymbol);
176
- }
177
- }
178
- setDisabledStatesForAllControls(originalDisabledStates) {
179
- originalDisabledStates.forEach((e) => {
180
- if (e.disabled) {
181
- e.control.disable();
182
- }
183
- else {
184
- e.control.enable();
185
- }
186
- });
187
- }
188
- }
189
- FormComponent.decorators = [
190
- { type: Component, args: [{
191
- selector: 'klp-form',
192
- template: "<form>\n\t<ng-content></ng-content>\n</form>\n\n\n",
193
- styles: [":host{display:block}:host.row{display:flex}"]
194
- },] }
195
- ];
196
- FormComponent.ctorParameters = () => [
197
- { type: FormComponent, decorators: [{ type: SkipSelf }, { type: Optional }] },
198
- { type: SubFormDirective, decorators: [{ type: Optional }] }
199
- ];
200
- FormComponent.propDecorators = {
201
- showErrorMessages: [{ type: Input }],
202
- errorMessageLocation: [{ type: Input }],
203
- formGroup: [{ type: Input }],
204
- patchValueInterceptor: [{ type: Input }]
205
- };
206
-
207
- const FORM_ERROR_MESSAGES = new InjectionToken('form.error.messages');
208
- const DEFAULT_ERROR_MESSAGES = {
209
- min: 'Use a number larger than %min%',
210
- max: 'Use a number smaller than %max%',
211
- required: 'This field is required',
212
- email: 'Use a valid email address',
213
- minLength: 'Has to be longer than %minLength% character(s)',
214
- maxLength: 'Has to be shorter than %maxLength% character(s)',
215
- pattern: 'This input is not valid',
216
- matchPassword: 'Passwords must match',
217
- date: 'Enter a valid date',
218
- };
219
- class FormElementComponent {
220
- constructor(parent, customMessages) {
221
- this.parent = parent;
222
- this.customMessages = customMessages;
223
- this.direction = 'horizontal';
224
- this.captionSpacing = 'percentages';
225
- this.spaceDistribution = '40-60';
226
- this.swapInputAndCaption = false;
227
- this.errorMessages = DEFAULT_ERROR_MESSAGES;
228
- this.customErrorHandlers = [];
229
- }
230
- shouldShowErrorMessages() {
231
- var _a;
232
- return ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.showErrorMessages) !== false;
233
- }
234
- substituteParameters(message, parameters) {
235
- return Object.keys(parameters).reduce((msg, key) => {
236
- return msg.replace(`%${key}%`, parameters[key]);
237
- }, message);
238
- }
239
- registerControl(formControl, input = null) {
240
- this.attachedControl = formControl;
241
- this.parent.registerControl(formControl, this);
242
- this.input = input;
243
- }
244
- unregisterControl(formControl) {
245
- this.attachedControl = null;
246
- this.parent.unregisterControl(formControl);
247
- }
248
- getAttachedControl() {
249
- return this.attachedControl;
250
- }
251
- registerErrorHandler(error, templateRef) {
252
- this.customErrorHandlers.push({ error, templateRef });
253
- }
254
- registerCaption(templateRef) {
255
- this.captionRef = templateRef;
256
- }
257
- getErrorToShow() {
258
- var _a, _b, _c;
259
- if (((_a = this.attachedControl) === null || _a === void 0 ? void 0 : _a.touched) === true && ((_b = this.attachedControl) === null || _b === void 0 ? void 0 : _b.errors)) {
260
- return Object.keys((_c = this.attachedControl) === null || _c === void 0 ? void 0 : _c.errors)[0];
261
- }
262
- return null;
263
- }
264
- getCustomErrorHandler(error) {
265
- return this.customErrorHandlers.find((e) => e.error === error);
266
- }
267
- showDefaultError(error) {
268
- return this.getErrorToShow() === error && !this.customErrorHandlers.some((e) => e.error === error);
269
- }
270
- getScrollableParent(node) {
271
- if (node == null) {
272
- return null;
273
- }
274
- if (node.scrollHeight > node.clientHeight) {
275
- return node;
276
- }
277
- else {
278
- return this.getScrollableParent(node.parentNode);
279
- }
280
- }
281
- scrollTo() {
282
- var _a;
283
- this.internalComponentRef.nativeElement.scrollIntoView(true);
284
- // to give some breathing room, we scroll 100px more to the top
285
- (_a = this.getScrollableParent(this.internalComponentRef.nativeElement)) === null || _a === void 0 ? void 0 : _a.scrollBy(0, -100);
286
- }
287
- isRequired() {
288
- if (isValueSet(this.input)) {
289
- return this.input.hasValidator('required');
290
- }
291
- return false;
292
- }
293
- getErrorMessage(key) {
294
- var _a, _b, _c;
295
- return (_c = (_b = (_a = this.customMessages) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : this.errorMessages[key];
296
- }
297
- getErrorLocation() {
298
- var _a, _b;
299
- return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.errorMessageLocation) !== null && _b !== void 0 ? _b : 'belowCaption';
300
- }
301
- }
302
- FormElementComponent.decorators = [
303
- { type: Component, args: [{
304
- selector: 'klp-form-element',
305
- template: "<ng-template #errorRef>\n\t<div *ngIf=\"shouldShowErrorMessages() && getErrorToShow()\" class=\"errorContainer\" [ngClass]=\"{hasCaption: caption || captionRef, 'd30-70': spaceDistribution === '30-70'}\">\n\t\t<div *ngIf=\"showDefaultError('min')\">{{substituteParameters(getErrorMessage(\"min\"), {min: attachedControl.errors.min.min})}}</div>\n\t\t<div *ngIf=\"showDefaultError('max')\">{{substituteParameters(getErrorMessage(\"max\"), {max: attachedControl.errors.max.max})}}</div>\n\t\t<div *ngIf=\"showDefaultError('required')\">{{getErrorMessage(\"required\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('email')\">{{getErrorMessage(\"email\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('minlength')\">{{substituteParameters(getErrorMessage(\"minLength\"), {minLength: attachedControl.errors.minlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('maxlength')\">{{substituteParameters(getErrorMessage(\"maxLength\"), {maxLength: attachedControl.errors.maxlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('pattern')\">{{getErrorMessage(\"pattern\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('MatchPassword')\">{{getErrorMessage(\"matchPassword\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('date')\">{{getErrorMessage(\"date\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('message')\">{{attachedControl.errors.message.value}}</div>\n\t\t<div [ngTemplateOutlet]=\"getCustomErrorHandler(getErrorToShow())?.templateRef\"></div>\n\t</div>\n</ng-template>\n\n<ng-container *ngIf=\"direction === 'horizontal'\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\n<div class=\"componentContainer\" [ngClass]=\"{hasCaption: caption || captionRef, vertical: direction === 'vertical', reverseOrder: swapInputAndCaption}\" #internalComponentRef>\n\t<div class=\"caption\" *ngIf=\"caption || captionRef\"\n\t\t[ngClass]=\"{\n\t\t\thasErrors: getErrorToShow() && attachedControl.touched,\n\t\t\tpercentageSpacing: captionSpacing === 'percentages', 'd30-70': spaceDistribution === '30-70',\n\t\t\twithErrorRightOfCaption: getErrorLocation() === 'rightOfCaption'\n\t\t}\"\n\t>\n\t\t<div *ngIf=\"captionRef\" class=\"captionRefContainer\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionRef\"></ng-container>\n\t\t\t<div *ngIf=\"isRequired()\">&nbsp;*</div>\n\t\t</div>\n\t\t<div *ngIf=\"!captionRef\">{{caption}}<span *ngIf=\"isRequired()\">&nbsp;*</span></div>\n\t\t<div class=\"rightOfCaptionError\">\n\t\t\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'rightOfCaption'\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t</div>\n\t</div>\n\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'belowCaption'\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t<div class=\"inputContainer\" [ngClass]=\"{ percentageSpacing: captionSpacing === 'percentages', 'd30-70': spaceDistribution === '30-70' }\">\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n",
306
- styles: [":host{display:block}.componentContainer{align-items:center;display:flex;min-height:42px}.componentContainer:not(.hasCaption){display:block}.componentContainer:not(.hasCaption) .inputContainer{margin-top:0}.componentContainer.reverseOrder{flex-direction:row-reverse;justify-content:flex-end}.componentContainer.vertical{display:block}.componentContainer.vertical .inputContainer{margin-top:.3125rem}.componentContainer.vertical .errorContainer{margin-left:0}.componentContainer.vertical .caption{padding-right:0}.captionRefContainer{display:flex}.caption{color:#515365;flex:0 0 auto;font-weight:700;padding-right:1.25rem}.caption.percentageSpacing{flex:0 0 40%}.caption.percentageSpacing.d30-70{flex-basis:30%}.caption.hasErrors{color:#ff8000}.caption.withErrorRightOfCaption{display:flex;gap:2.5rem;justify-content:space-between}.caption.withErrorRightOfCaption .rightOfCaptionError{font-weight:400;overflow:hidden}.caption.withErrorRightOfCaption .rightOfCaptionError *{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inputContainer{flex:1}.inputContainer.percentageSpacing{flex:0 0 60%}.inputContainer.percentageSpacing.d30-70{flex-basis:70%}.errorContainer{color:#ff8000}.errorContainer.hasCaption{margin-left:40%}.errorContainer.hasCaption.d30-70{margin-left:30%}"]
307
- },] }
308
- ];
309
- FormElementComponent.ctorParameters = () => [
310
- { type: FormComponent, decorators: [{ type: Host }, { type: Optional }] },
311
- { type: undefined, decorators: [{ type: Inject, args: [FORM_ERROR_MESSAGES,] }, { type: Optional }] }
312
- ];
313
- FormElementComponent.propDecorators = {
314
- caption: [{ type: Input }],
315
- direction: [{ type: Input }],
316
- captionSpacing: [{ type: Input }],
317
- spaceDistribution: [{ type: Input }],
318
- swapInputAndCaption: [{ type: Input }],
319
- internalComponentRef: [{ type: ViewChild, args: ['internalComponentRef',] }]
320
- };
321
-
322
- function removeDuplicatesFromArraysWithComparator(comparator, ...arrays) {
323
- let combined = [];
324
- for (const array of arrays) {
325
- combined = combined.concat(array);
326
- }
327
- return combined.filter((c, i) => {
328
- const firstOccurrenceIndex = combined.findIndex((c2) => comparator(c, c2));
329
- return i === firstOccurrenceIndex;
330
- });
331
- }
332
- function removeDuplicatesFromArray(array) {
333
- return array.filter((c, i) => {
334
- const firstOccurrenceIndex = array.findIndex((c2) => c2 === c);
335
- return i === firstOccurrenceIndex;
336
- });
337
- }
338
- function insertAtIndex(arr, index, item) {
339
- arr.splice(index, 0, item);
340
- }
341
- function arrayIsSetAndFilled(arr) {
342
- return isArray(arr) && arr !== null && arr !== undefined && arr.length > 0;
343
- }
344
- function asArray(value) {
345
- if (isValueSet(value)) {
346
- if (Array.isArray(value)) {
347
- return value;
348
- }
349
- return [value];
350
- }
351
- return [];
352
- }
353
- function splitArrayByCondition(value, condition) {
354
- return value.reduce((acc, cur) => {
355
- if (condition(cur)) {
356
- acc.push([]);
357
- }
358
- else {
359
- acc[acc.length - 1].push(cur);
360
- }
361
- return acc;
362
- }, [[]]);
363
- }
364
-
365
- /**
366
- * This component is a base in order to create a component that supports ngModel.
367
- * Some important things to know about it:
368
- *
369
- * innerValue = your own inner state, which you should use to store the current state of what ngModel should be.
370
- * writeValue() = called by angular, when ngModel is changed from OUTSIDE of the component. Feel free to patch this method if you need inner logic to happen when ngModel is altered from the outside. Always remember to also call the super.writeValue if you do!
371
- * setInnerValueAndNotify() = call this when you want your ngModel to be updated from INSIDE of your component, and provide it to the OUTSIDE.
372
- * ngOnInit() = Used to support the angular reactive forms framework. If you use ngOnInit in your own component (which happens fairly often) you must not forget to call the super.ngOnInit() method.
373
- */
374
- class ValueAccessorBase {
375
- constructor(parent, controlContainer) {
376
- this.parent = parent;
377
- this.controlContainer = controlContainer;
378
- this.changed = new Array();
379
- this.touched = new Array();
380
- this.prevValue = null;
381
- this.disabled = false;
382
- // we support both providing just the formControlName and the full formControl
383
- this.formControlName = null;
384
- this.formControl = null;
385
- this.onTouch = new EventEmitter();
386
- this.validators = [];
387
- }
388
- ngOnInit() {
389
- var _a, _b, _c, _d;
390
- if (this.formControl) {
391
- this.attachedFormControl = this.formControl;
392
- }
393
- else if (stringIsSetAndFilled(this.formControlName)) {
394
- this.attachedFormControl = (_a = this.controlContainer) === null || _a === void 0 ? void 0 : _a.control.get(this.formControlName);
395
- if (isNullOrUndefined(this.attachedFormControl)) {
396
- throw new Error(`Form element '${this.formControlName}' with caption '${(_b = this.parent) === null || _b === void 0 ? void 0 : _b.caption}' is not declared in your FormGroup.`);
397
- }
398
- }
399
- if (this.attachedFormControl) {
400
- this.disabled = this.attachedFormControl.disabled;
401
- this.attachedFormControl.statusChanges.subscribe(() => {
402
- this.disabled = this.attachedFormControl.disabled;
403
- });
404
- (_c = this.parent) === null || _c === void 0 ? void 0 : _c.registerControl(this.attachedFormControl, this);
405
- if ((_d = this.attachedFormControl) === null || _d === void 0 ? void 0 : _d.validator) {
406
- const vals = this.attachedFormControl.validator({});
407
- if (isValueSet(vals)) {
408
- this.validators = Object.keys(vals);
409
- }
410
- else {
411
- this.validators = [];
412
- }
413
- }
414
- }
415
- }
416
- isInErrorState() {
417
- return this.attachedFormControl && this.attachedFormControl.status === 'INVALID' && this.attachedFormControl.touched;
418
- }
419
- ngOnDestroy() {
420
- var _a;
421
- if (this.attachedFormControl) {
422
- (_a = this.parent) === null || _a === void 0 ? void 0 : _a.unregisterControl(this.attachedFormControl);
423
- }
424
- }
425
- touch() {
426
- this.touched.forEach((f) => f());
427
- }
428
- writeValue(value) {
429
- this.innerValue = value;
430
- this.prevValue = value;
431
- }
432
- registerOnChange(fn) {
433
- this.changed.push(fn);
434
- }
435
- registerOnTouched(fn) {
436
- this.touched.push(fn);
437
- }
438
- setInnerValueAndNotify(value) {
439
- const actuallySetValue = (valueToSet) => {
440
- this.innerValue = valueToSet;
441
- this.prevValue = valueToSet;
442
- this.changed.forEach((fn) => fn(valueToSet));
443
- };
444
- if (isValueSet(this.innerValueChangeInterceptor)) {
445
- this.latestInnerValueChangedInterceptorPromise = this.innerValueChangeInterceptor(this.prevValue, value);
446
- const myPromise = this.latestInnerValueChangedInterceptorPromise;
447
- this.latestInnerValueChangedInterceptorPromise.then(() => {
448
- if (this.latestInnerValueChangedInterceptorPromise === myPromise) {
449
- actuallySetValue(value);
450
- }
451
- else {
452
- // ignore outdated promises
453
- }
454
- }).catch(() => {
455
- if (this.latestInnerValueChangedInterceptorPromise === myPromise) {
456
- actuallySetValue(this.prevValue);
457
- }
458
- else {
459
- // ignore outdated promises
460
- }
461
- });
462
- }
463
- else {
464
- actuallySetValue(value);
465
- }
466
- }
467
- resetToNull() {
468
- this.setInnerValueAndNotify(null);
469
- }
470
- hasValidator(validatorName) {
471
- if (arrayIsSetAndFilled(this.validators)) {
472
- return this.validators.includes(validatorName);
473
- }
474
- return false;
475
- }
476
- }
477
- ValueAccessorBase.decorators = [
478
- { type: Component, args: [{
479
- selector: '',
480
- template: ''
481
- },] }
482
- ];
483
- ValueAccessorBase.ctorParameters = () => [
484
- { type: FormElementComponent, decorators: [{ type: Host }, { type: Optional }] },
485
- { type: ControlContainer, decorators: [{ type: Host }, { type: Optional }] }
486
- ];
487
- ValueAccessorBase.propDecorators = {
488
- disabled: [{ type: Input }],
489
- innerValueChangeInterceptor: [{ type: Input }],
490
- formControlName: [{ type: Input }],
491
- formControl: [{ type: Input }],
492
- onTouch: [{ type: Output }]
493
- };
494
-
495
- class ButtonComponent {
496
- constructor() {
497
- this.variant = 'white';
498
- this.size = 'medium';
499
- this.fullWidth = false;
500
- this.hasBorder = true;
501
- this.disabled = false;
502
- this.isLoading = false;
503
- this.type = 'button';
504
- }
505
- get _() {
506
- return this.fullWidth;
507
- }
508
- onClick(event) {
509
- return __awaiter(this, void 0, void 0, function* () {
510
- if (this.disabled) {
511
- event.stopPropagation();
512
- return;
513
- }
514
- if (isValueSet(this.clickCallback)) {
515
- this.isLoading = true;
516
- yield this.clickCallback(event).finally(() => {
517
- this.isLoading = false;
518
- });
519
- }
520
- });
521
- }
522
- }
523
- ButtonComponent.decorators = [
524
- { type: Component, args: [{
525
- selector: 'klp-form-button',
526
- template: "<button class=\"buttonFundamentals\"\n\t[ngClass]=\"[\n\t\tvariant,\n\t\tsize,\n\t\tfullWidth ? 'fullWidth' : '',\n\t\thasBorder ? '' : 'no-border',\n\t\tdisabled ? 'disabled' : ''\n\t]\"\n\t[type]=\"type\"\n\t(click)=\"onClick($event)\"\n>\n\t<div class=\"caption\" [ngClass]=\"{invisible: isLoading}\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"loadingSpinnerContainer\" *ngIf=\"isLoading\">\n\t\t<klp-form-loading-indicator variant=\"spinner\" size=\"small\"></klp-form-loading-indicator>\n\t</div>\n</button>\n",
527
- styles: [":host{display:inline-block}:host._fullWidth{display:block}.buttonFundamentals{border:1px solid #e6ecf5;border-radius:5px;color:#888da8;cursor:pointer;font-size:13px;font-weight:700;height:2.625rem;letter-spacing:1px;padding:0 20px}.buttonFundamentals.disabled{cursor:not-allowed}.buttonFundamentals.tiny{font-size:.75rem;font-weight:400;height:2rem}.buttonFundamentals.large{height:3rem}.fullWidth{width:100%}.no-border{border:none}.caption.invisible{visibility:hidden}button{position:relative}.loadingSpinnerContainer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.white{background-color:#fff;border-color:#d4deee;color:#515365;font-weight:500}.white:active,.white:hover{background-color:#edf2f8;border-color:#edf2f8;color:#515365}.white:focus{text-decoration:underline}.greenFilled{background-color:#27bb5f;border-color:#27bb5f;color:#fff}.greenFilled:hover{background-color:#2bd06a;border-color:#2bd06a;color:#fff}.greenFilled:focus{text-decoration:underline}.greenFilled:active{background-color:#23a654;border-color:#23a654}.greenOutlined{background-color:#fff;border-color:#27bb5f;color:#27bb5f}.greenOutlined:hover{background-color:#2bd06a;border-color:#2bd06a;color:#fff}.greenOutlined:focus{text-decoration:underline}.greenOutlined:active{background-color:#23a654;border-color:#23a654}.greenLink{background:none;border:none;color:#27bb5f;padding:0}.greenLink:focus,.greenLink:hover{text-decoration:underline}.contextMenuItem{background-color:#fff;border-color:#fff;color:#888da8}.contextMenuItem:hover{background-color:#f6f7fb;border-color:#f6f7fb}.contextMenuItem:active,.contextMenuItem:focus{text-decoration:underline}.redFilled{background-color:#dc3545;border-color:#dc3545;color:#fff}.redFilled:hover{background-color:#e04b59;border-color:#e04b59;color:#fff}.redFilled:focus{text-decoration:underline}.redFilled:active{background-color:#d32535;border-color:#d32535}.redOutlined{background-color:#fff;border-color:#dc3545;color:#dc3545}.redOutlined:hover{background-color:#e04b59;border-color:#e04b59;color:#fff}.redOutlined:focus{text-decoration:underline}.redOutlined:active{background-color:#d32535;border-color:#d32535}.orangeFilled{background-color:#ff8000;border-color:#ff8000;color:#fff}.orangeFilled:hover{background-color:#ff8d1a;border-color:#ff8d1a;color:#fff}.orangeFilled:focus{text-decoration:underline}.orangeFilled:active{background-color:#e67300;border-color:#e67300}"]
528
- },] }
529
- ];
530
- ButtonComponent.propDecorators = {
531
- variant: [{ type: Input }],
532
- size: [{ type: Input }],
533
- fullWidth: [{ type: Input }],
534
- hasBorder: [{ type: Input }],
535
- disabled: [{ type: Input }],
536
- isLoading: [{ type: Input }],
537
- type: [{ type: Input }],
538
- clickCallback: [{ type: Input }],
539
- _: [{ type: HostBinding, args: ['class._fullWidth',] }]
540
- };
541
-
542
- class CheckboxComponent extends ValueAccessorBase {
543
- constructor() {
544
- super(...arguments);
545
- this.renderUndefinedAsIndeterminate = false;
546
- }
547
- }
548
- CheckboxComponent.decorators = [
549
- { type: Component, args: [{
550
- selector: 'klp-form-checkbox',
551
- template: "<label class=\"componentContainer\">\n\t<div class=\"checkboxContainer\">\n\t\t<input type=\"checkbox\" class=\"checkboxNative\"\n\t\t\t[(ngModel)]=\"innerValue\"\n\t\t\t(change)=\"setInnerValueAndNotify(innerValue); touch()\"\n\t\t\t[disabled]=\"disabled\"\n\t\t/>\n <div class=\"checkboxVisual\">\n <svg *ngIf=\"innerValue === true\" version=\"1.1\" viewBox=\"0 0 4.2333 4.2333\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m0.17014 2.7065 1.3073 1.1798 2.5656-3.7404\" stroke=\"currentColor\" fill=\"none\" stroke-width=\".4646px\" />\n </svg>\n\t\t\t<svg *ngIf=\"renderUndefinedAsIndeterminate && innerValue === undefined\" version=\"1.1\" viewBox=\"0 0 4.2333 4.2333\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t<path d=\"m0.5 2.11665 3.2333 0\" stroke=\"currentColor\" fill=\"none\" stroke-width=\".4646px\" />\n\t\t\t</svg>\n </div>\n\t</div>\n\t<div *ngIf=\"caption\" class=\"caption\">{{ caption }}</div>\n</label>\n",
552
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }],
553
- styles: [":host{display:block}.componentContainer{display:flex;margin-bottom:0}.checkboxContainer{position:relative}.caption{color:#888da8;cursor:pointer;font-weight:700}.checkboxNative{left:0;opacity:0;position:absolute;top:0}.checkboxNative,.checkboxVisual{cursor:pointer;height:22px;width:22px}.checkboxVisual{background-color:#fff;border:2px solid #e6ecf5;border-radius:3px;color:#27bb5f;display:inline-block;font-size:15px;font-weight:400;line-height:19px;margin-right:10px;padding:.125rem;pointer-events:none;text-align:center;vertical-align:bottom}.checkboxNative[disabled]{cursor:not-allowed}.checkboxNative[disabled]+.checkboxVisual:before{color:#666}"]
554
- },] }
555
- ];
556
- CheckboxComponent.propDecorators = {
557
- caption: [{ type: Input }],
558
- renderUndefinedAsIndeterminate: [{ type: Input }]
559
- };
560
-
561
- class EmailInputComponent extends ValueAccessorBase {
562
- constructor() {
563
- super(...arguments);
564
- this.placeholder = '';
565
- }
566
- }
567
- EmailInputComponent.decorators = [
568
- { type: Component, args: [{
569
- selector: 'klp-form-email-input',
570
- template: "<input\n\ttype=\"email\"\n\tclass=\"form-control\"\n\t[(ngModel)]=\"innerValue\"\n\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t[placeholder]=\"placeholder\"\n\t(blur)=\"touch()\"\n\t[disabled]=\"disabled\"\n/>\n",
571
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: EmailInputComponent, multi: true }],
572
- styles: [":host,input{display:block}input{-moz-transition:all .2s ease-in;-ms-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;color:#888da8;font-size:14px;height:42px;outline:none;padding:.375rem .625rem;transition:all .2s ease-in;width:100%}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder,input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{border-color:#3ed778;box-shadow:none;outline:0 none}input.input-sm{height:30px}input.input-lg{height:50px}input.error{background-color:#f6cdd1;border-color:#dc3545}input.valid{background-color:#ebfaeb;border-color:#37c936;color:#278d26}.showErrors{border-color:#ff8000}"]
573
- },] }
574
- ];
575
- EmailInputComponent.propDecorators = {
576
- placeholder: [{ type: Input }]
577
- };
578
-
579
- class LoadingIndicatorComponent {
580
- constructor() {
581
- this.variant = '3dots';
582
- this.size = 'medium';
583
- }
584
- }
585
- LoadingIndicatorComponent.decorators = [
586
- { type: Component, args: [{
587
- selector: 'klp-form-loading-indicator',
588
- template: "<div class=\"threeDots\" [ngClass]=\"[size]\" *ngIf=\"variant === '3dots'\">\n\t<div></div>\n\t<div></div>\n\t<div></div>\n\t<div></div>\n</div>\n\n<div class=\"spinner\" [ngClass]=\"[size]\" *ngIf=\"variant === 'spinner'\">\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\">\n\t\t<circle cx=\"24\" cy=\"4\" r=\"4\" fill=\"currentColor\" />\n\t\t<circle cx=\"12.19\" cy=\"7.86\" r=\"3.7\" fill=\"currentColor\" />\n\t\t<circle cx=\"5.02\" cy=\"17.68\" r=\"3.4\" fill=\"currentColor\" />\n\t\t<circle cx=\"5.02\" cy=\"30.32\" r=\"3.1\" fill=\"currentColor\" />\n\t\t<circle cx=\"12.19\" cy=\"40.14\" r=\"2.8\" fill=\"currentColor\" />\n\t\t<circle cx=\"24\" cy=\"44\" r=\"2.5\" fill=\"currentColor\" />\n\t\t<circle cx=\"35.81\" cy=\"40.14\" r=\"2.2\" fill=\"currentColor\" />\n\t\t<circle cx=\"42.98\" cy=\"30.32\" r=\"1.9\" fill=\"currentColor\" />\n\t\t<circle cx=\"42.98\" cy=\"17.68\" r=\"1.6\" fill=\"currentColor\" />\n\t\t<circle cx=\"35.81\" cy=\"7.86\" r=\"1.3\" fill=\"currentColor\" />\n\t</svg>\n</div>\n\n<div class=\"textInput\" *ngIf=\"variant === 'textInput'\">\n\t<input\n\t\tdisabled\n\t\ttype=\"text\"\n\t\tclass=\"form-control\"\n\t\tplaceholder=\"Loading...\"\n\t>\n</div>\n\n<div class=\"picker\" *ngIf=\"variant === 'picker'\">\n\t<input\n\t\tdisabled\n\t\ttype=\"text\"\n\t\tclass=\"form-control\"\n\t\tplaceholder=\"Loading...\"\n\t>\n\t<div class=\"chevronDown\"></div>\n</div>\n",
589
- styles: [".threeDots,:host{display:block}.threeDots{height:var(--base);position:relative;width:calc(var(--base)*4)}.threeDots.tiny{--base:4px}.threeDots.small{--base:8px}.threeDots.medium{--base:12px}.threeDots.large{--base:18px}.threeDots.huge{--base:26px}.threeDots div{-webkit-animation-timing-function:cubic-bezier(0,1,1,0);animation-timing-function:cubic-bezier(0,1,1,0);background:#27bb5f;border-radius:50%;height:var(--base);position:absolute;top:0;width:var(--base)}.threeDots div:first-child{-webkit-animation:lds-ellipsis1 .6s infinite;animation:lds-ellipsis1 .6s infinite}.threeDots div:nth-child(2),.threeDots div:nth-child(3){-webkit-animation:lds-ellipsis2 .6s infinite;animation:lds-ellipsis2 .6s infinite}.threeDots div:nth-child(3){left:calc(var(--base)*1.5)}.threeDots div:nth-child(4){-webkit-animation:lds-ellipsis3 .6s infinite;animation:lds-ellipsis3 .6s infinite;left:calc(var(--base)*3)}@-webkit-keyframes lds-ellipsis1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes lds-ellipsis1{0%{transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes lds-ellipsis3{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}to{transform:scale(0)}}@-webkit-keyframes lds-ellipsis2{0%{transform:translate(0)}to{transform:translate(150%)}}@keyframes lds-ellipsis2{0%{transform:translate(0)}to{transform:translate(150%)}}.spinner.tiny svg{height:1rem;width:1rem}.spinner.small svg{height:1.6rem;width:1.6rem}.spinner.medium svg{height:2.5rem;width:2.5rem}.spinner.large svg{height:3rem;width:3rem}.spinner.huge svg{height:4rem;width:4rem}.spinner svg{-moz-animation-duration:1.2s;-moz-animation-iteration-count:infinite;-moz-animation-name:rotate;-moz-animation-timing-function:linear;-moz-transition-property:-moz-transform;-webkit-animation-duration:1.2s;-webkit-animation-iteration-count:infinite;-webkit-animation-name:rotate;-webkit-animation-timing-function:linear;-webkit-transition-duration:1.2s;-webkit-transition-property:-webkit-transform;animation-duration:1.2s;animation-iteration-count:infinite;animation-name:rotate;animation-timing-function:linear;transition-property:transform}@-webkit-keyframes rotate{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.picker{position:relative}.picker .chevronDown{border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #888da8;height:0;position:absolute;right:23px;top:18px;width:0}"]
590
- },] }
591
- ];
592
- LoadingIndicatorComponent.propDecorators = {
593
- variant: [{ type: Input }],
594
- size: [{ type: Input }]
595
- };
596
-
597
- class NumberInputComponent extends ValueAccessorBase {
598
- constructor() {
599
- super(...arguments);
600
- this.parseNumber = false;
601
- }
602
- setInnerValueAndNotify(value) {
603
- if (this.parseNumber && typeof value === "string") {
604
- super.setInnerValueAndNotify(Number(value));
605
- }
606
- else {
607
- super.setInnerValueAndNotify(value);
608
- }
609
- }
610
- }
611
- NumberInputComponent.decorators = [
612
- { type: Component, args: [{
613
- selector: 'klp-form-number-input',
614
- template: "<input\n\ttype=\"number\"\n\tclass=\"form-control\"\n\t[(ngModel)]=\"innerValue\"\n\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t[placeholder]=\"placeholder ? placeholder : ''\"\n\t[ngClass]=\"{showErrors: isInErrorState()}\"\n\t[disabled]=\"disabled\"\n/>\n",
615
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: NumberInputComponent, multi: true }],
616
- styles: [":host,input{display:block}input{-moz-transition:all .2s ease-in;-ms-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;color:#888da8;font-size:14px;height:42px;outline:none;padding:.375rem .625rem;transition:all .2s ease-in;width:100%}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder,input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{border-color:#3ed778;box-shadow:none;outline:0 none}input.input-sm{height:30px}input.input-lg{height:50px}input.error{background-color:#f6cdd1;border-color:#dc3545}input.valid{background-color:#ebfaeb;border-color:#37c936;color:#278d26}.showErrors{border-color:#ff8000}"]
617
- },] }
618
- ];
619
- NumberInputComponent.propDecorators = {
620
- placeholder: [{ type: Input }],
621
- parseNumber: [{ type: Input }]
622
- };
623
-
624
- class PasswordFieldComponent extends ValueAccessorBase {
625
- constructor() {
626
- super(...arguments);
627
- this.placeholder = 'Password';
628
- }
629
- }
630
- PasswordFieldComponent.decorators = [
631
- { type: Component, args: [{
632
- selector: 'klp-form-password-field',
633
- template: "<input\n\ttype=\"password\"\n\tclass=\"form-control\"\n [ngClass]=\"{showErrors: isInErrorState()}\"\n\t[(ngModel)]=\"innerValue\"\n\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t[placeholder]=\"placeholder\"\n\t(blur)=\"touch()\"\n\t[disabled]=\"disabled\"\n/>\n",
634
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: PasswordFieldComponent, multi: true }],
635
- styles: [":host,input{display:block}input{-moz-transition:all .2s ease-in;-ms-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;color:#888da8;font-size:14px;height:42px;outline:none;padding:.375rem .625rem;transition:all .2s ease-in;width:100%}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder,input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{border-color:#3ed778;box-shadow:none;outline:0 none}input.input-sm{height:30px}input.input-lg{height:50px}input.error{background-color:#f6cdd1;border-color:#dc3545}input.valid{background-color:#ebfaeb;border-color:#37c936;color:#278d26}.showErrors{border-color:#ff8000}"]
636
- },] }
637
- ];
638
- PasswordFieldComponent.propDecorators = {
639
- placeholder: [{ type: Input }]
640
- };
641
-
642
- const SELECT_TRANSLATIONS = new InjectionToken('klp.form.select.translations');
643
- class KlpSelectOptionTemplateDirective {
644
- }
645
- KlpSelectOptionTemplateDirective.decorators = [
646
- { type: Directive, args: [{ selector: '[klpSelectOptionTpl]' },] }
647
- ];
648
- class SelectComponent extends ValueAccessorBase {
649
- constructor(parent, controlContainer, translations, elRef) {
650
- super(parent, controlContainer);
651
- this.parent = parent;
652
- this.controlContainer = controlContainer;
653
- this.translations = translations;
654
- this.elRef = elRef;
655
- this.orientation = 'horizontal';
656
- this.multiple = false;
657
- this.multipleDisplayedAsAmount = false;
658
- this.clearable = true;
659
- this.truncateOptions = true;
660
- this.onSearch = new EventEmitter();
661
- this.onEndReached = new EventEmitter();
662
- this.onOpened = new EventEmitter();
663
- this.lastItemIndexReached = -1;
664
- }
665
- ngOnChanges(changes) {
666
- if (isValueSet(changes.options)) {
667
- this.lastItemIndexReached = -1;
668
- }
669
- }
670
- getDefaultTranslation(key) {
671
- switch (key) {
672
- case 'placeholder':
673
- return () => 'Pick an option';
674
- case 'amountSelected':
675
- return (amount) => `${amount} selected`;
676
- }
677
- }
678
- getTranslation(key, params = null) {
679
- var _a, _b, _c;
680
- if (key === 'placeholder' && stringIsSetAndFilled(this.placeholder)) {
681
- return this.placeholder;
682
- }
683
- return (_c = (_b = (_a = this.translations) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.call(_a, params)) !== null && _c !== void 0 ? _c : this.getDefaultTranslation(key)(params);
684
- }
685
- onScroll(lastItemIndex) {
686
- var _a, _b, _c, _d;
687
- const visibleItems = (_d = (_c = (_b = (_a = this.ngSelect) === null || _a === void 0 ? void 0 : _a.itemsList) === null || _b === void 0 ? void 0 : _b.filteredItems) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;
688
- if (this.lastItemIndexReached < lastItemIndex && lastItemIndex === visibleItems) {
689
- this.onEndReached.emit();
690
- }
691
- this.lastItemIndexReached = Math.max(lastItemIndex, this.lastItemIndexReached);
692
- }
693
- searchQueryChanged(searchQuery) {
694
- this.onSearch.emit(searchQuery);
695
- }
696
- onOpen() {
697
- // waiting for the thing to render until we fire the event
698
- setTimeout(() => {
699
- this.onOpened.emit();
700
- if (this.truncateOptions === false) {
701
- const widths = Array.from(this.elRef.nativeElement.querySelectorAll('.ng-option div')).map((e) => e.scrollWidth);
702
- const maxWidth = Math.max(...widths);
703
- const dropdownPanel = this.elRef.nativeElement.querySelector('ng-dropdown-panel');
704
- dropdownPanel.style.width = `${maxWidth + 40}px`;
705
- }
706
- });
707
- }
708
- }
709
- SelectComponent.decorators = [
710
- { type: Component, args: [{
711
- selector: 'klp-form-select',
712
- template: "<ng-select\n\t#ngSelect\n\t[placeholder]=\"getTranslation('placeholder')\"\n\tbindLabel=\"name\"\n\tbindValue=\"id\"\n\t[items]=\"options\"\n\t[clearable]=\"clearable\"\n\t[(ngModel)]=\"innerValue\"\n\t[ngClass]=\"{showErrors: isInErrorState(), verticalOrientation: orientation === 'vertical'}\"\n\t(change)=\"setInnerValueAndNotify(innerValue)\"\n\t[multiple]=\"multiple\"\n\t[disabled]=\"disabled\"\n\t(blur)=\"touch()\"\n\t(search)=\"searchQueryChanged($event.term)\"\n\t[dropdownPosition]=\"dropdownPosition\"\n\t[searchFn]=\"customSearchFn\"\n\t[selectOnTab]=\"true\"\n\t[virtualScroll]=\"true\"\n\t(scroll)=\"onScroll($event.end)\"\n\t(open)=\"onOpen()\"\n>\n\t<ng-template let-item=\"item\" ng-option-tmp>\n\t\t<ng-container *ngIf=\"customOptionTpl\" [ngTemplateOutlet]=\"customOptionTpl\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n\t\t<div [attr.data-cy]=\"item.id\" *ngIf=\"!customOptionTpl\">\n\t\t\t{{ item.name }}\n\t\t\t<div *ngIf=\"item.description\" class=\"dropdown-item-description\">\n\t\t\t\t{{ item.description }}\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\t<ng-container *ngIf=\"multiple && multipleDisplayedAsAmount && innerValue?.length > 1\">\n\t\t<ng-template ng-multi-label-tmp>\n\t\t\t<div class=\"ng-value\">\n\t\t\t\t<span class=\"ng-value-label\">{{getTranslation('amountSelected', innerValue?.length)}}</span>\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-container>\n\t<ng-template ng-footer-tmp *ngIf=\"footerElement\">\n\t\t<ng-container [ngTemplateOutlet]=\"footerElement\"></ng-container>\n\t</ng-template>\n</ng-select>\n",
713
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }],
714
- styles: [":host{display:block}ng-select.showErrors::ng-deep .ng-select-container{border-color:#ff8000}:host ::ng-deep ng-select.ng-select .ng-select-container{color:#888da8}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container{background:#fff;border-color:#3ed778}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container:hover{box-shadow:none}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container .ng-arrow{border-color:transparent transparent #999;border-width:0 5px 5px;top:-2px}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container .ng-arrow:hover{border-color:transparent transparent #666}:host ::ng-deep .ng-select.ng-select-opened.ng-select-bottom>.ng-select-container{border-bottom-left-radius:0;border-bottom-right-radius:0}:host ::ng-deep .ng-select.ng-select-opened.ng-select-top>.ng-select-container{border-top-left-radius:0;border-top-right-radius:0}:host ::ng-deep .ng-select.ng-select-disabled>.ng-select-container{background-color:#f9f9f9}:host ::ng-deep .ng-select .ng-has-value .ng-placeholder{display:none}:host ::ng-deep .ng-select .ng-select-container{align-items:center;background-clip:padding-box;background-color:#fff;border:1px solid #e6ecf5;border-radius:4px;border-radius:2px;box-shadow:none;box-sizing:border-box;color:#888da8;display:flex;flex-direction:row;font-size:1rem;font-size:14px;line-height:1.5;margin:0;min-height:42px;outline:none;overflow:visible;padding:.375rem .75rem;transition-delay:0s;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in;width:100%}:host ::ng-deep .ng-select .ng-select-container:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}:host ::ng-deep .ng-select .ng-select-container .ng-value-container{align-items:center;overflow:hidden;padding-left:10px}:host ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#aaa}:host ::ng-deep .ng-select.ng-select-single .ng-select-container{height:42px}:host ::ng-deep .ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{left:0;padding-left:10px;padding-right:50px;top:5px}:host ::ng-deep .ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:#f9f9f9;border:1px solid #e3e3e3}:host ::ng-deep .ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-label{padding:0 5px}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:#e7faee;border:1px solid #93e8b3;border-radius:2px;display:flex;font-size:.9em;margin-bottom:3px;margin-right:5px;margin-top:3px;overflow:hidden}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled{background-color:#f9f9f9;border:1px solid #e3e3e3}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-label{padding-left:5px}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label{display:inline-block;overflow:hidden;padding:0 5px;text-overflow:ellipsis}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:inline-block;padding:0 5px}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#93e8b3}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right:1px solid #93e8b3}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.right{border-left:1px solid #c2e0ff}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{padding-bottom:3px;padding-left:3px}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{padding-bottom:3px;padding-left:3px;position:static;top:5px}:host ::ng-deep .ng-select .ng-clear-wrapper{color:#999}:host ::ng-deep .ng-select .ng-clear-wrapper .ng-clear:hover{color:#dc3545}:host ::ng-deep .ng-select .ng-spinner-zone{padding-right:5px;padding-top:5px}:host ::ng-deep .ng-select .ng-arrow-wrapper{padding-right:5px;width:25px}:host ::ng-deep .ng-select .ng-arrow-wrapper:hover .ng-arrow{border-top-color:#666}:host ::ng-deep .ng-select .ng-arrow-wrapper .ng-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}:host ::ng-deep .ng-dropdown-panel{background-color:#fff;border:1px solid #3ed778;box-shadow:0 1px 0 rgba(0,0,0,.06)}:host ::ng-deep .ng-dropdown-panel.ng-select-bottom{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-top-color:#e6e6e6;margin-top:-1px;top:100%}:host ::ng-deep .ng-dropdown-panel.ng-select-bottom .ng-dropdown-panel-items .ng-option:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}:host ::ng-deep .ng-dropdown-panel.ng-select-top{border-bottom-color:#e6e6e6;border-top-left-radius:4px;border-top-right-radius:4px;bottom:100%;margin-bottom:-1px}:host ::ng-deep .ng-dropdown-panel.ng-select-top .ng-dropdown-panel-items .ng-option:first-child{border-top-left-radius:4px;border-top-right-radius:4px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-header{border-bottom:1px solid #ccc;padding:5px 7px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-footer{border-top:1px solid #ccc;padding:5px 7px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items{margin-bottom:1px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;color:rgba(0,0,0,.54);cursor:default;cursor:pointer;font-weight:500;padding:8px 10px;user-select:none}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-disabled{cursor:default}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-marked{background-color:#ebf5ff}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected{background-color:#f5faff;font-weight:600}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#fff;color:rgba(0,0,0,.87);padding:8px 10px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected{background-color:#e7faee;color:#333}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected .ng-option-label{font-weight:600}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background-color:#e7faee;color:#333}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#ccc}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-child{padding-left:22px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{font-size:80%;font-weight:400;padding-right:5px}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container{padding-left:0}:host ::ng-deep ng-select.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{color:#888da8;top:9px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option,:host ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-input>input{color:#888da8}:host ::ng-deep .ng-select.ng-select-auto-grow{max-width:inherit}:host ::ng-deep .ng-select.ng-select-auto-grow .ng-dropdown-panel{width:auto}.verticalOrientation{transform:translateY(100%) rotate(-90deg);transform-origin:top left}.verticalOrientation ::ng-deep ng-dropdown-panel.ng-select-bottom{border-bottom-left-radius:0;border-bottom-right-radius:2px;border-top-color:#3ed778;border-top-right-radius:2px;transform:rotate(90deg) translateX(100%);transform-origin:top right}"]
715
- },] }
716
- ];
717
- SelectComponent.ctorParameters = () => [
718
- { type: FormElementComponent, decorators: [{ type: Optional }, { type: Host }] },
719
- { type: ControlContainer, decorators: [{ type: Optional }, { type: Host }] },
720
- { type: undefined, decorators: [{ type: Inject, args: [SELECT_TRANSLATIONS,] }, { type: Optional }] },
721
- { type: ElementRef }
722
- ];
723
- SelectComponent.propDecorators = {
724
- placeholder: [{ type: Input }],
725
- orientation: [{ type: Input }],
726
- options: [{ type: Input }],
727
- multiple: [{ type: Input }],
728
- multipleDisplayedAsAmount: [{ type: Input }],
729
- clearable: [{ type: Input }],
730
- truncateOptions: [{ type: Input }],
731
- dropdownPosition: [{ type: Input }],
732
- customSearchFn: [{ type: Input }],
733
- footerElement: [{ type: Input }],
734
- onSearch: [{ type: Output }],
735
- onEndReached: [{ type: Output }],
736
- onOpened: [{ type: Output }],
737
- ngSelect: [{ type: ViewChild, args: ['ngSelect',] }],
738
- customOptionTpl: [{ type: ContentChild, args: [KlpSelectOptionTemplateDirective, { read: TemplateRef },] }]
739
- };
740
-
741
- class SelectFooterComponent {
742
- }
743
- SelectFooterComponent.decorators = [
744
- { type: Component, args: [{
745
- selector: 'klp-select-footer',
746
- template: "<div class=\"componentContainer\">\n\t<span class=\"prefix\">{{prefix}}</span>\n\t<span class=\"text\">{{text}}</span>\n</div>\n",
747
- styles: [":host{display:block}.componentContainer{cursor:pointer;padding:6px 10px}.componentContainer:hover{background:#e7faee}.prefix{font-size:80%;padding-right:.625rem}"]
748
- },] }
749
- ];
750
- SelectFooterComponent.propDecorators = {
751
- prefix: [{ type: Input }],
752
- text: [{ type: Input }]
753
- };
754
-
755
- class SortableItemsComponent extends ValueAccessorBase {
756
- constructor() {
757
- super(...arguments);
758
- this.sortableItemSize = 'lg';
759
- this.useCustomScroll = false;
760
- this.scrollInterval = null;
761
- this.itemsOrderChanged = () => {
762
- this.setInnerValueAndNotify(this.innerValue);
763
- };
764
- this.onItemDrag = (data) => {
765
- // if the item you're dragging is reaching the top, start scrolling.
766
- if (data.relatedRect.top < 100) {
767
- this.scrollPage(100);
768
- }
769
- else {
770
- this.stopScrolling();
771
- }
772
- };
773
- this.onEnd = () => {
774
- this.stopScrolling();
775
- };
776
- }
777
- ngOnInit() {
778
- super.ngOnInit();
779
- if (this.useCustomScroll) {
780
- this.sortablejsOptions = { onUpdate: this.itemsOrderChanged, onMove: this.onItemDrag, onEnd: this.onEnd };
781
- }
782
- else {
783
- this.sortablejsOptions = { onUpdate: this.itemsOrderChanged };
784
- }
785
- }
786
- scrollPage(scrollAmount) {
787
- if (!isValueSet(this.scrollInterval)) {
788
- this.scrollInterval = setInterval(() => {
789
- window.scroll({
790
- top: document.scrollingElement.scrollTop - scrollAmount,
791
- behavior: 'smooth',
792
- });
793
- if (document.scrollingElement.scrollTop <= 100) {
794
- this.stopScrolling();
795
- }
796
- }, 100);
797
- }
798
- }
799
- stopScrolling() {
800
- clearInterval(this.scrollInterval);
801
- this.scrollInterval = null;
802
- }
803
- }
804
- SortableItemsComponent.decorators = [
805
- { type: Component, args: [{
806
- selector: 'klp-form-sortable-items',
807
- template: "<ng-template #listItem>\n\t<li *ngFor=\"let item of innerValue; index as index\"\n\t\t\tclass=\"sortableItem\"\n\t\t\t[ngClass]=\"{\n\t\t\tlargeSortableItem: sortableItemSize === 'lg',\n\t\t \tsmallSortableItem: sortableItemSize === 'sm'\n\t\t }\"\n\t>\n\t\t<ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item, index:index }\"></ng-container>\n\t</li>\n</ng-template>\n\n<ol *ngIf='!disabled'\n\t\t[sortablejs]=\"innerValue\"\n\t\t[sortablejsOptions]=\"sortablejsOptions\"\n\t\tclass=\"itemsContainer\"\n>\n\t<ng-container *ngTemplateOutlet=\"listItem\"></ng-container>\n</ol>\n\n<ol *ngIf='disabled' class=\"itemsContainer disabled-mouse-cursor\">\n\t<ng-container *ngTemplateOutlet=\"listItem\"></ng-container>\n</ol>\n",
808
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SortableItemsComponent, multi: true }],
809
- styles: [":host{display:block}.itemsContainer{border:1px solid #e6ecf5;border-radius:5px;margin-bottom:0;padding:0}.sortableItem{border-top:1px solid #e6ecf5;cursor:-webkit-grab;cursor:grab;list-style:none}.sortableItem:hover{background:#f8f9fa}.sortableItem:first-child{border-top:none}.largeSortableItem{padding:15px}.smallSortableItem{padding:0 10px}.disabled-mouse-cursor li{cursor:no-drop}"]
810
- },] }
811
- ];
812
- SortableItemsComponent.propDecorators = {
813
- template: [{ type: ContentChild, args: [TemplateRef,] }],
814
- sortableItemSize: [{ type: Input }],
815
- useCustomScroll: [{ type: Input }]
816
- };
817
-
818
- class TextInputComponent extends ValueAccessorBase {
819
- constructor() {
820
- super(...arguments);
821
- this.type = 'text';
822
- this.clearable = false;
823
- }
824
- }
825
- TextInputComponent.decorators = [
826
- { type: Component, args: [{
827
- selector: 'klp-form-text-input',
828
- template: "<div class=\"componentContainer\">\n\t<ng-container *ngIf=\"icon?.length > 0\">\n\t\t<i class=\"ti-search\" *ngIf=\"icon === 'search'\"></i>\n\t</ng-container>\n\t<input\n\t\t[type]=\"type\"\n\t\t[ngClass]=\"{showErrors: isInErrorState(), hasIcon: icon?.length > 0, hasClearButton: clearable}\"\n\t\t[(ngModel)]=\"innerValue\"\n\t\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t\t[placeholder]=\"placeholder ? placeholder : ''\"\n\t\t(blur)=\"touch()\"\n\t\t[disabled]='disabled'\n\t/>\n\t<div class=\"clearIcon\" *ngIf=\"clearable && innerValue?.length > 0\" (click)=\"resetToNull()\">\u00D7</div>\n</div>\n",
829
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: TextInputComponent, multi: true }],
830
- styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{position:relative}i{left:.625rem;position:absolute;top:14px}input{-moz-transition:all .2s ease-in;-ms-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;color:#888da8;display:block;font-size:14px;height:42px;outline:none;padding:.375rem .625rem;transition:all .2s ease-in;width:100%}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder,input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{border-color:#3ed778;box-shadow:none;outline:0 none}input.input-sm{height:30px}input.input-lg{height:50px}input.error{background-color:#f6cdd1;border-color:#dc3545}input.valid{background-color:#ebfaeb;border-color:#37c936;color:#278d26}input.hasIcon{padding-left:1.875rem}input.hasClearButton{padding-right:1.875rem}.clearIcon{cursor:pointer;font-size:18px;position:absolute;right:.625rem;top:7px}.showErrors{border-color:#ff8000}"]
831
- },] }
832
- ];
833
- TextInputComponent.propDecorators = {
834
- placeholder: [{ type: Input }],
835
- type: [{ type: Input }],
836
- clearable: [{ type: Input }],
837
- icon: [{ type: Input }]
838
- };
839
-
840
- class ToggleComponent extends ValueAccessorBase {
841
- }
842
- ToggleComponent.decorators = [
843
- { type: Component, args: [{
844
- selector: 'klp-form-toggle',
845
- template: "<div class=\"componentContainer\" [ngClass]=\"{disabled: disabled}\">\n\t<input type=\"checkbox\" class=\"nativeCheckbox\"\n\t\t[(ngModel)]=\"innerValue\"\n\t\t(input)=\"setInnerValueAndNotify($event.target.checked); touch()\"\n\t\t[disabled]=\"disabled\"\n\t\t[ngClass]=\"{showErrors: isInErrorState()}\"\n\t/>\n\t<div class=\"toggleVisual\"></div>\n</div>\n",
846
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: ToggleComponent, multi: true }],
847
- styles: [":host{display:block}.componentContainer{position:relative}.nativeCheckbox{cursor:pointer;height:20px;left:0;opacity:0;position:absolute;top:0;width:35px}.toggleVisual{-moz-transition:.4s ease;-ms-transition:.4s ease;-o-transition:.4s ease;-webkit-transition:.4s ease;border:1px solid #e6ecf5;border-radius:35px;display:block;height:20px;pointer-events:none;position:relative;transition:.4s ease;width:35px}.toggleVisual:before{-moz-transition:.2s cubic-bezier(.24,0,.5,1);-ms-transition:.2s cubic-bezier(.24,0,.5,1);-o-transition:.2s cubic-bezier(.24,0,.5,1);-webkit-transition:.2s cubic-bezier(.24,0,.5,1);border-radius:30px;height:18px;left:-1px;margin:1px;transition:.2s cubic-bezier(.24,0,.5,1);width:33px}.toggleVisual:after,.toggleVisual:before{content:\"\";display:block;position:absolute;top:-1px}.toggleVisual:after{-moz-transition:.35s cubic-bezier(.54,1.6,.5,1);-ms-transition:.35s cubic-bezier(.54,1.6,.5,1);-o-transition:.35s cubic-bezier(.54,1.6,.5,1);-webkit-transition:.35s cubic-bezier(.54,1.6,.5,1);background:#f7f7f7;border-radius:60px;box-shadow:0 0 0 1px rgba(0,0,0,.1),0 4px 0 0 rgba(0,0,0,.04),0 4px 9px rgba(0,0,0,.13),0 3px 3px rgba(0,0,0,.05);height:20px;left:0;transition:.35s cubic-bezier(.54,1.6,.5,1);width:20px}.nativeCheckbox:checked+.toggleVisual:before{-moz-transition:width .2s cubic-bezier(0,0,0,.1);-ms-transition:width .2s cubic-bezier(0,0,0,.1);-o-transition:width .2s cubic-bezier(0,0,0,.1);-webkit-transition:width .2s cubic-bezier(0,0,0,.1);background:#37c936;transition:width .2s cubic-bezier(0,0,0,.1)}.nativeCheckbox:checked+.toggleVisual:after{left:18px}.disabled{opacity:.6}.showErrors+.toggleVisual:before{border:1px solid #ff8000}"]
848
- },] }
849
- ];
850
-
851
- class FormCaptionComponent {
852
- constructor(parent) {
853
- this.parent = parent;
854
- }
855
- ngOnInit() {
856
- // this is being run next cycle, because we dont want to fail if the order of components is as follows:
857
- // <app-form-error />
858
- // <some-input />
859
- // That would fail, because the logic of the form error is run first, and at that moment, the `some-input` isnt registered yet
860
- setTimeout(() => {
861
- const attachedControl = this.parent.getAttachedControl();
862
- this.parent.registerCaption(this.contentRef);
863
- if (isNullOrUndefined(attachedControl)) {
864
- throw new Error('You added a Form Caption component without an attached Form Control');
865
- }
866
- });
867
- }
868
- }
869
- FormCaptionComponent.decorators = [
870
- { type: Component, args: [{
871
- selector: 'klp-form-caption',
872
- template: "<ng-template #contentRef>\n\t<ng-content></ng-content>\n</ng-template>\n",
873
- styles: [":host{display:block}"]
874
- },] }
875
- ];
876
- FormCaptionComponent.ctorParameters = () => [
877
- { type: FormElementComponent, decorators: [{ type: Host }, { type: Optional }] }
878
- ];
879
- FormCaptionComponent.propDecorators = {
880
- contentRef: [{ type: ViewChild, args: ['contentRef',] }]
881
- };
882
-
883
- class FormErrorComponent {
884
- constructor(parent) {
885
- this.parent = parent;
886
- this.showError = false;
887
- }
888
- ngOnInit() {
889
- // this is being run next cycle, because we dont want to fail if the order of components is as follows:
890
- // <app-form-error />
891
- // <some-input />
892
- // That would fail, because the logic of the form error is run first, and at that moment, the `some-input` isnt registered yet
893
- setTimeout(() => {
894
- const attachedControl = this.parent.getAttachedControl();
895
- this.parent.registerErrorHandler(this.error, this.contentRef);
896
- if (isNullOrUndefined(attachedControl)) {
897
- throw new Error('You added a Form Error component without an attached Form Control');
898
- }
899
- });
900
- }
901
- }
902
- FormErrorComponent.decorators = [
903
- { type: Component, args: [{
904
- selector: 'klp-form-error',
905
- template: "<ng-template #contentRef>\n\t<ng-content></ng-content>\n</ng-template>\n",
906
- styles: [":host{display:block}"]
907
- },] }
908
- ];
909
- FormErrorComponent.ctorParameters = () => [
910
- { type: FormElementComponent, decorators: [{ type: Host }, { type: Optional }] }
911
- ];
912
- FormErrorComponent.propDecorators = {
913
- error: [{ type: Input }],
914
- contentRef: [{ type: ViewChild, args: ['contentRef',] }]
915
- };
916
-
917
- class FormSubmitButtonComponent {
918
- constructor(parentForm) {
919
- this.parentForm = parentForm;
920
- this.isLoading = false;
921
- this.fullWidth = false;
922
- this.variant = 'greenFilled';
923
- }
924
- get _() {
925
- return this.fullWidth;
926
- }
927
- submitForm() {
928
- this.parentForm
929
- .trySubmit()
930
- .then((value) => {
931
- this.isLoading = true;
932
- const submitCallbackResult = this.submitCallback(value);
933
- if (isNullOrUndefined(submitCallbackResult)) {
934
- throw new Error('No promise is returned in your submit function.');
935
- }
936
- return submitCallbackResult.then(() => (this.isLoading = false)).catch((e) => {
937
- this.isLoading = false;
938
- throw e;
939
- });
940
- })
941
- .catch((e) => {
942
- if (e === invalidFieldsSymbol) {
943
- return; // swallow the error, the framework will scroll to the field that needs attention
944
- }
945
- throw e;
946
- });
947
- }
948
- }
949
- FormSubmitButtonComponent.decorators = [
950
- { type: Component, args: [{
951
- selector: 'klp-form-submit-button',
952
- template: "<klp-form-button\n\t\t[variant]=\"variant\"\n\t\t(click)=\"submitForm()\"\n\t\t[disabled]=\"isLoading\"\n\t\t[isLoading]=\"isLoading\"\n\t\t[fullWidth]=\"fullWidth\"\n\t\ttype=\"submit\"\n\t\t[ngClass]=\"fullWidth ? 'fullWidth' : ''\"\n\t>\n\t<ng-content></ng-content>\n</klp-form-button>\n",
953
- styles: [":host{display:inline-block}:host._fullWidth{display:block}.fullWidth{width:100%}"]
954
- },] }
955
- ];
956
- FormSubmitButtonComponent.ctorParameters = () => [
957
- { type: FormComponent, decorators: [{ type: Host }, { type: Optional }] }
958
- ];
959
- FormSubmitButtonComponent.propDecorators = {
960
- isLoading: [{ type: Input }],
961
- fullWidth: [{ type: Input }],
962
- variant: [{ type: Input }],
963
- submitCallback: [{ type: Input }],
964
- _: [{ type: HostBinding, args: ['class._fullWidth',] }]
965
- };
966
-
967
- class MultipleValueAccessorBase extends ValueAccessorBase {
968
- constructor(parent, controlContainer) {
969
- super(parent, controlContainer);
970
- this.parent = parent;
971
- this.controlContainer = controlContainer;
972
- this.multiple = false;
973
- }
974
- writeValue(value) {
975
- // if the outside world passes a value in the wrong format, it should be corrected
976
- if (this.multiple && !Array.isArray(value)) {
977
- const correctedVal = [value].filter(isValueSet);
978
- super.writeValue(correctedVal);
979
- super.setInnerValueAndNotify(correctedVal);
980
- }
981
- else if (!this.multiple && Array.isArray(value)) {
982
- const correctedVal = value[0];
983
- super.writeValue(correctedVal);
984
- super.setInnerValueAndNotify(correctedVal);
985
- }
986
- else {
987
- super.writeValue(value);
988
- }
989
- }
990
- setInnerValueAndNotify(value) {
991
- if (this.multiple && !Array.isArray(value)) {
992
- super.setInnerValueAndNotify([value].filter(isValueSet));
993
- }
994
- else if (!this.multiple && Array.isArray(value)) {
995
- super.setInnerValueAndNotify(value[0]);
996
- }
997
- else {
998
- super.setInnerValueAndNotify(value);
999
- }
1000
- }
1001
- }
1002
- MultipleValueAccessorBase.decorators = [
1003
- { type: Component, args: [{
1004
- selector: '',
1005
- template: ''
1006
- },] }
1007
- ];
1008
- MultipleValueAccessorBase.ctorParameters = () => [
1009
- { type: FormElementComponent, decorators: [{ type: Host }, { type: Optional }] },
1010
- { type: ControlContainer, decorators: [{ type: Host }, { type: Optional }] }
1011
- ];
1012
- MultipleValueAccessorBase.propDecorators = {
1013
- multiple: [{ type: Input }]
1014
- };
1015
-
1016
- const invalidDateKey = '--invalid_date--';
1017
- function dateValidator(control) {
1018
- const invalid = control.value === invalidDateKey;
1019
- return invalid ? { date: control.value } : null;
1020
- }
1021
-
1022
- const DATE_PICKER_TRANSLATIONS = new InjectionToken('klp.form.date.translations');
1023
- class DatePickerComponent extends MultipleValueAccessorBase {
1024
- constructor(parent, controlContainer, translations) {
1025
- super(parent, controlContainer);
1026
- this.parent = parent;
1027
- this.controlContainer = controlContainer;
1028
- this.translations = translations;
1029
- this.minDate = undefined;
1030
- this.maxDate = undefined;
1031
- this.sameMonthOnly = false;
1032
- this.format = 'dd-MM-yyyy';
1033
- this.clearable = false;
1034
- }
1035
- writeValue(value) {
1036
- if (value === invalidDateKey) {
1037
- super.writeValue(invalidDateKey);
1038
- }
1039
- else if (isNullOrUndefined(value)) {
1040
- this.dateValue = this.multiple ? [] : null;
1041
- super.writeValue(this.multiple ? [] : null);
1042
- }
1043
- else {
1044
- if (Array.isArray(value)) {
1045
- this.dateValue = value.map((e) => parse(e, 'yyyy-MM-dd', new Date()));
1046
- }
1047
- else {
1048
- this.dateValue = parse(value, 'yyyy-MM-dd', new Date());
1049
- }
1050
- super.writeValue(value);
1051
- }
1052
- }
1053
- dateChanged(value) {
1054
- if (value === invalidDateKey) {
1055
- this.setInnerValueAndNotify(invalidDateKey);
1056
- }
1057
- else if (isNullOrUndefined(value)) {
1058
- this.dateValue = this.multiple ? [] : null;
1059
- this.setInnerValueAndNotify(this.multiple ? [] : null);
1060
- }
1061
- else {
1062
- this.dateValue = value;
1063
- if (Array.isArray(value)) {
1064
- this.setInnerValueAndNotify(value.map((e) => format(e, 'yyyy-MM-dd')));
1065
- }
1066
- else {
1067
- this.setInnerValueAndNotify(format(value, 'yyyy-MM-dd'));
1068
- }
1069
- }
1070
- }
1071
- getDefaultTranslation(key) {
1072
- switch (key) {
1073
- case 'placeholder':
1074
- return () => 'Select date';
1075
- }
1076
- }
1077
- getTranslation(key, params = null) {
1078
- var _a, _b, _c;
1079
- if (key === 'placeholder' && this.multiple) {
1080
- return '';
1081
- }
1082
- if (key === 'placeholder' && stringIsSetAndFilled(this.placeholder)) {
1083
- return this.placeholder;
1084
- }
1085
- return (_c = (_b = (_a = this.translations) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.call(_a, params)) !== null && _c !== void 0 ? _c : this.getDefaultTranslation(key)(params);
1086
- }
1087
- }
1088
- DatePickerComponent.decorators = [
1089
- { type: Component, args: [{
1090
- selector: 'klp-form-date-picker',
1091
- template: "<div class=\"componentContainer\" [ngClass]=\"{showErrors: isInErrorState()}\">\n\t<klp-form-date-time-picker\n\t\t[multiple]=\"multiple\"\n\t\t[disabled]=\"disabled\"\n\t\t[(ngModel)]=\"dateValue\"\n\t\t(ngModelChange)=\"dateChanged($event)\"\n\t\t[minDate]=\"minDate\"\n\t\t[maxDate]=\"maxDate\"\n\t\t[sameMonthOnly]=\"sameMonthOnly\"\n\t\t[format]=\"format\"\n\t\t[placeholder]=\"getTranslation('placeholder')\"\n\t\t[clearable]=\"clearable\"\n\t\t[showTimeInput]=\"false\"\n\t\t(onTouch)=\"touch()\"\n\t></klp-form-date-time-picker>\n</div>\n",
1092
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: DatePickerComponent, multi: true }],
1093
- styles: [":host{display:block}.componentContainer.showErrors ::ng-deep klp-form-date-time-picker .clearButton,.componentContainer.showErrors ::ng-deep klp-form-date-time-picker .dateContainer{border-color:#ff8000}"]
1094
- },] }
1095
- ];
1096
- DatePickerComponent.ctorParameters = () => [
1097
- { type: FormElementComponent, decorators: [{ type: Host }, { type: Optional }] },
1098
- { type: ControlContainer, decorators: [{ type: Host }, { type: Optional }] },
1099
- { type: undefined, decorators: [{ type: Inject, args: [DATE_PICKER_TRANSLATIONS,] }, { type: Optional }] }
1100
- ];
1101
- DatePickerComponent.propDecorators = {
1102
- minDate: [{ type: Input }],
1103
- maxDate: [{ type: Input }],
1104
- sameMonthOnly: [{ type: Input }],
1105
- format: [{ type: Input }],
1106
- placeholder: [{ type: Input }],
1107
- clearable: [{ type: Input }]
1108
- };
1109
-
1110
- const KLP_DATE_FORMATS = new InjectionToken('klp.form.date.formats');
1111
- const DATE_TIME_PICKER_TRANSLATIONS = new InjectionToken('klp.form.dateTime.translations');
1112
- const DATE_PICKER_LOCALE = new InjectionToken('klp.form.dateTime.locale');
1113
- function matDateFormatsFactory(component, dateFormats) {
1114
- var _a;
1115
- return (_a = dateFormats === null || dateFormats === void 0 ? void 0 : dateFormats(component.format)) !== null && _a !== void 0 ? _a : MAT_NATIVE_DATE_FORMATS;
1116
- }
1117
- class DateTimePickerComponent extends MultipleValueAccessorBase {
1118
- constructor(parent, controlContainer, translations, datePickerLocale, dateAdapter, cdr) {
1119
- super(parent, controlContainer);
1120
- this.parent = parent;
1121
- this.controlContainer = controlContainer;
1122
- this.translations = translations;
1123
- this.datePickerLocale = datePickerLocale;
1124
- this.dateAdapter = dateAdapter;
1125
- this.cdr = cdr;
1126
- this.minDate = undefined;
1127
- this.maxDate = undefined;
1128
- this.sameMonthOnly = false;
1129
- this.format = 'dd-MM-yyyy';
1130
- this.clearable = false;
1131
- this.showTimeInput = true;
1132
- this.invalidTimeAsMidnight = false; // if the time is not valid, use 00:00 as the time
1133
- this.openPickerOnDate = null;
1134
- this.minDateStartOfDay = undefined;
1135
- this.maxDateEndOfDay = undefined;
1136
- this.selectedDates = [];
1137
- this.dateTouched = false;
1138
- this.hoursTouched = false;
1139
- this.minutesTouched = false;
1140
- this.isSelected = (d) => {
1141
- if (this.multiple) {
1142
- return this.selectedDates.some((e) => isSameDay(e, d)) ? 'selected' : '';
1143
- }
1144
- return '';
1145
- };
1146
- this.filterDates = (e) => {
1147
- if (this.disabled) {
1148
- return false;
1149
- }
1150
- return true;
1151
- };
1152
- if (isValueSet(datePickerLocale)) {
1153
- dateAdapter.setLocale(datePickerLocale());
1154
- }
1155
- }
1156
- ngOnInit() {
1157
- super.ngOnInit();
1158
- if (this.multiple) {
1159
- this.placeholder = '';
1160
- this.showTimeInput = false;
1161
- }
1162
- }
1163
- ngAfterViewInit() {
1164
- if (this.multiple) {
1165
- // we are going to overwrite the datepicker closing fn later, so we are saving it here to restore it when needed
1166
- this.datePickingClosingFn = this.datePickerRef.close;
1167
- }
1168
- }
1169
- ngOnChanges(changes) {
1170
- if (changes.minDate) {
1171
- this.determineMinAndMaxDates();
1172
- }
1173
- if (changes.maxDate) {
1174
- this.determineMinAndMaxDates();
1175
- }
1176
- }
1177
- setMinDate(minDate) {
1178
- if (minDate) {
1179
- this.minDateStartOfDay = new Date(minDate);
1180
- this.minDateStartOfDay.setHours(0, 0, 0, 0);
1181
- }
1182
- else {
1183
- this.minDateStartOfDay = undefined;
1184
- }
1185
- }
1186
- setMaxDate(maxDate) {
1187
- if (maxDate) {
1188
- this.maxDateEndOfDay = new Date(maxDate);
1189
- this.maxDateEndOfDay.setHours(23, 59, 59, 999);
1190
- }
1191
- else {
1192
- this.maxDateEndOfDay = undefined;
1193
- }
1194
- }
1195
- getSelectedMonths() {
1196
- return removeDuplicatesFromArray(this.selectedDates.map((e) => format(e, 'MMMM'))).length;
1197
- }
1198
- // dateChanged is called when the output of the datepicker is changed and
1199
- // parsed correctly. If the date is invalid, it will be called the first time
1200
- // with null but never again until a valid input is provided.
1201
- dateChanged(event) {
1202
- const date = event.value;
1203
- if (this.multiple) {
1204
- this.datePickerRef.close = () => {
1205
- };
1206
- if (this.selectedDates.some((e) => isSameDay(e, date))) {
1207
- this.selectedDates = this.selectedDates.filter((e) => !isSameDay(e, date));
1208
- }
1209
- else {
1210
- this.selectedDates = [...this.selectedDates, date];
1211
- }
1212
- // START HACK
1213
- // the date picker does not provide any rerender calls. Therefore, we are going to change the minDate in order to force the render
1214
- // This is needed to show all selected days in our date picker
1215
- // We also set the innerValue to null (with this.valueForMaterialDatePicker = null;), otherwise you can not
1216
- // deselect your last picked date
1217
- this.cdr.detectChanges();
1218
- this.valueForMaterialDatePicker = null;
1219
- const oldMinDate = this.minDateStartOfDay;
1220
- this.minDateStartOfDay = new Date(0);
1221
- this.cdr.detectChanges();
1222
- this.minDateStartOfDay = oldMinDate;
1223
- // END HACK
1224
- if (this.sameMonthOnly) {
1225
- if (this.selectedDates.length >= 2) {
1226
- if (date < startOfMonth(this.selectedDates[0]) || date > endOfMonth(this.selectedDates[0])) {
1227
- this.selectedDates = [date];
1228
- }
1229
- }
1230
- this.determineMinAndMaxDates();
1231
- }
1232
- this.setInnerValueAndNotify(this.selectedDates);
1233
- setTimeout(() => {
1234
- this.datePickerRef.close = this.datePickingClosingFn;
1235
- });
1236
- }
1237
- else {
1238
- this.notifyNewDate();
1239
- }
1240
- }
1241
- determineMinAndMaxDates() {
1242
- if (this.sameMonthOnly) {
1243
- if (this.selectedDates.length >= 2) {
1244
- this.setMinDate(startOfMonth(this.selectedDates[0]));
1245
- this.setMaxDate(endOfMonth(this.selectedDates[0]));
1246
- }
1247
- else {
1248
- this.setMinDate(this.minDate);
1249
- this.setMaxDate(this.maxDate);
1250
- }
1251
- }
1252
- else {
1253
- this.setMinDate(this.minDate);
1254
- this.setMaxDate(this.maxDate);
1255
- }
1256
- }
1257
- notifyNewDate() {
1258
- const nativeInputValue = this.nativeInputRef.nativeElement.value;
1259
- const parsedHours = Number(this.hours);
1260
- const parsedMinutes = Number(this.minutes);
1261
- // if we dont have the time element
1262
- if (!this.showTimeInput) {
1263
- if (!stringIsSetAndFilled(nativeInputValue)) {
1264
- this.setInnerValueAndNotify(null);
1265
- return;
1266
- }
1267
- if (this.valueForMaterialDatePicker instanceof Date) {
1268
- this.setInnerValueAndNotify(this.valueForMaterialDatePicker);
1269
- return;
1270
- }
1271
- }
1272
- // when all inputs are empty
1273
- if (!stringIsSetAndFilled(nativeInputValue) && !stringIsSetAndFilled(this.hours) && !stringIsSetAndFilled(this.minutes)) {
1274
- this.setInnerValueAndNotify(null);
1275
- return;
1276
- }
1277
- // if we have date and time
1278
- if (stringIsSetAndFilled(this.hours) &&
1279
- Number.isFinite(parsedHours) &&
1280
- parsedHours >= 0 &&
1281
- parsedHours <= 23 &&
1282
- stringIsSetAndFilled(this.minutes) &&
1283
- Number.isFinite(parsedMinutes) &&
1284
- parsedMinutes >= 0 &&
1285
- parsedMinutes <= 59 &&
1286
- this.valueForMaterialDatePicker instanceof Date) {
1287
- const newDateWithHours = new Date(this.valueForMaterialDatePicker.setHours(parsedHours));
1288
- const newDateWithMinutes = new Date(newDateWithHours.setMinutes(parsedMinutes));
1289
- this.setInnerValueAndNotify(newDateWithMinutes);
1290
- return;
1291
- }
1292
- if (this.invalidTimeAsMidnight) {
1293
- if (this.valueForMaterialDatePicker instanceof Date) {
1294
- this.setInnerValueAndNotify(this.valueForMaterialDatePicker);
1295
- return;
1296
- }
1297
- }
1298
- // all other cases, we are not in a valid state
1299
- this.setInnerValueAndNotify(invalidDateKey);
1300
- }
1301
- writeValue(value) {
1302
- super.writeValue(value);
1303
- if (Array.isArray(value)) {
1304
- this.selectedDates = value;
1305
- this.determineMinAndMaxDates();
1306
- this.valueForMaterialDatePicker = null;
1307
- if (arrayIsSetAndFilled(value)) {
1308
- this.openPickerOnDate = this.selectedDates[0];
1309
- }
1310
- }
1311
- else {
1312
- this.valueForMaterialDatePicker = value === invalidDateKey ? null : value;
1313
- if (value instanceof Date) {
1314
- this.hours = String(value.getHours());
1315
- this.minutes = String(value.getMinutes());
1316
- this.formatTime();
1317
- this.openPickerOnDate = value;
1318
- }
1319
- else {
1320
- this.hours = '';
1321
- this.minutes = '';
1322
- this.openPickerOnDate = null;
1323
- this.selectedDates = [];
1324
- }
1325
- }
1326
- }
1327
- // nativeValueChanged is called when the internal text value changes, but not
1328
- // when the date is changed via the date picker. We need this so that we can
1329
- // determine if the datepicker is empty or invalid.
1330
- nativeValueChanged() {
1331
- if (this.datePickerRef.opened) {
1332
- // if the user is typing instead of using the picker, close it.
1333
- this.datePickerRef.close();
1334
- }
1335
- this.notifyNewDate();
1336
- }
1337
- resetToNull() {
1338
- this.setInnerValueAndNotify(null);
1339
- this.valueForMaterialDatePicker = null;
1340
- this.nativeInputRef.nativeElement.value = null;
1341
- this.hours = '';
1342
- this.minutes = '';
1343
- this.selectedDates = [];
1344
- }
1345
- formatTime() {
1346
- if (Number.isFinite(Number(this.hours)) && this.hours.length === 1) {
1347
- this.hours = '0' + this.hours;
1348
- }
1349
- if (Number.isFinite(Number(this.minutes)) && this.minutes.length === 1) {
1350
- this.minutes = '0' + this.minutes;
1351
- }
1352
- }
1353
- touchDate() {
1354
- this.dateTouched = true;
1355
- this.determineAllTouched();
1356
- }
1357
- touchHours() {
1358
- this.hoursTouched = true;
1359
- this.determineAllTouched();
1360
- }
1361
- touchMinutes() {
1362
- this.minutesTouched = true;
1363
- this.determineAllTouched();
1364
- }
1365
- determineAllTouched() {
1366
- if ((this.dateTouched && this.hoursTouched && this.minutesTouched) || (this.dateTouched && !this.showTimeInput)) {
1367
- this.touch();
1368
- }
1369
- }
1370
- getDefaultTranslation(key) {
1371
- switch (key) {
1372
- case 'placeholder':
1373
- return () => 'Select date';
1374
- case 'selectDays':
1375
- return () => 'Select day(s)';
1376
- case 'selectedDate':
1377
- return (d) => d.toLocaleDateString();
1378
- case 'daysSelected':
1379
- return (amount) => `${amount} days selected`;
1380
- case 'selectedInMonth':
1381
- return (d) => ` in ${format(d, 'MMMM')}`;
1382
- }
1383
- }
1384
- getTranslation(key, params = null) {
1385
- var _a, _b, _c;
1386
- if (key === 'placeholder' && this.multiple) {
1387
- return '';
1388
- }
1389
- if (key === 'placeholder' && stringIsSetAndFilled(this.placeholder)) {
1390
- return this.placeholder;
1391
- }
1392
- return (_c = (_b = (_a = this.translations) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.call(_a, params)) !== null && _c !== void 0 ? _c : this.getDefaultTranslation(key)(params);
1393
- }
1394
- }
1395
- DateTimePickerComponent.decorators = [
1396
- { type: Component, args: [{
1397
- selector: 'klp-form-date-time-picker',
1398
- template: "<div class=\"componentContainer\" [ngClass]=\"{showErrors: isInErrorState()}\">\n\t<div class=\"dateContainer\" [ngClass]=\"{noRightBorder: !showTimeInput && clearable && !disabled, disabled: disabled}\">\n\t\t<mat-form-field floatLabel=\"never\">\n\t\t\t<div *ngIf=\"multiple\" class=\"daysSelectedCaption\" (click)=\"picker.open()\" [ngClass]=\"{disabled: disabled}\">\n\t\t\t\t<ng-container *ngIf=\"selectedDates.length >= 2\">\n\t\t\t\t\t<span>{{getTranslation('daysSelected', selectedDates.length)}}</span>\n\t\t\t\t\t<span *ngIf=\"getSelectedMonths() === 1\">{{getTranslation('selectedInMonth', selectedDates[0])}}</span>\n\t\t\t\t</ng-container>\n\t\t\t\t<span *ngIf=\"selectedDates.length === 1\">{{getTranslation('selectedDate', selectedDates[0])}}</span>\n\t\t\t\t<span *ngIf=\"selectedDates.length === 0\" class=\"placeholderForMultipleSelection\">{{getTranslation('selectDays')}}</span>\n\t\t\t</div>\n\t\t\t<input\n\t\t\t\t#nativeInput\n\t\t\t\tmatInput\n\t\t\t\t[matDatepicker]=\"picker\"\n\t\t\t\t[matDatepickerFilter]=\"filterDates\"\n\t\t\t\t[(ngModel)]=\"valueForMaterialDatePicker\"\n\t\t\t\t(dateInput)=\"dateChanged($event)\"\n\t\t\t\t(input)=\"nativeValueChanged()\"\n\t\t\t\t[min]=\"minDateStartOfDay\"\n\t\t\t\t[max]=\"maxDateEndOfDay\"\n\t\t\t\t[placeholder]=\"getTranslation('placeholder')\"\n\t\t\t\t(click)=\"picker.open()\"\n\t\t\t\t(blur)=\"touchDate()\"\n\t\t\t\t[ngClass]=\"{inputForMultipleDays: multiple}\"\n\t\t\t>\n\t\t\t<mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n\t\t\t<mat-datepicker\n\t\t\t\t#picker\n\t\t\t\t[dateClass]=\"isSelected\"\n\t\t\t\t[startAt]=\"openPickerOnDate\"\n\t\t\t></mat-datepicker>\n\t\t</mat-form-field>\n\t</div>\n\t<div class=\"timeContainer\" *ngIf=\"showTimeInput\" [ngClass]=\"{disabled: disabled}\">\n\t\t<input maxlength=\"2\" placeholder=\"__\" [disabled]=\"disabled\" [(ngModel)]=\"hours\" (ngModelChange)=\"notifyNewDate()\" (blur)=\"formatTime(); touchHours()\">\n\t\t<div class=\"divider\">:</div>\n\t\t<input maxlength=\"2\" placeholder=\"__\" [disabled]=\"disabled\" [(ngModel)]=\"minutes\" (ngModelChange)=\"notifyNewDate()\" (blur)=\"formatTime(); touchMinutes()\">\n\t</div>\n\t<button *ngIf=\"clearable && !disabled\" class=\"clearButton\" (click)=\"resetToNull()\" [ngClass]=\"{withoutSpacing: !showTimeInput}\">\u00D7</button>\n</div>\n",
1399
- providers: [
1400
- { provide: NG_VALUE_ACCESSOR, useExisting: DateTimePickerComponent, multi: true },
1401
- {
1402
- provide: MAT_DATE_FORMATS,
1403
- deps: [DateTimePickerComponent, [new Optional(), KLP_DATE_FORMATS]],
1404
- useFactory: matDateFormatsFactory,
1405
- },
1406
- ],
1407
- styles: [":host{display:block}:host ::ng-deep mat-form-field{display:block;height:100%}:host ::ng-deep mat-form-field.mat-focused .mat-form-field-label,:host ::ng-deep mat-form-field .mat-form-field-label{color:#adadad}:host ::ng-deep .mat-datepicker-toggle-active{color:#666}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field-flex{flex-direction:row-reverse}:host ::ng-deep .mat-form-field-infix{border-top:none;width:auto}:host ::ng-deep .mat-form-field-suffix{margin-right:.625rem}:host ::ng-deep .mat-form-field-suffix:hover .mat-button-focus-overlay{opacity:.1}:host ::ng-deep .mat-form-field-underline{display:none}:host ::ng-deep .daysSelectedCaption{cursor:pointer}:host ::ng-deep .daysSelectedCaption.disabled{cursor:zoom-in}:host ::ng-deep .inputForMultipleDays{display:none}.componentContainer{border-radius:2px;color:#888da8;display:flex;position:relative}.componentContainer .placeholderForMultipleSelection{color:#adadad}.componentContainer.showErrors .clearButton.withoutSpacing,.componentContainer.showErrors .dateContainer,.componentContainer.showErrors .timeContainer{border-color:#ff8000}.componentContainer .clearButton{align-items:center;background:#fff;border:1px solid #e6ecf5;color:#7b7b7b;display:flex;flex:0 0 auto;font-size:18px;margin-left:1.25rem;padding:6px 14px}.componentContainer .clearButton.withoutSpacing{border-left:none;margin-left:0}.componentContainer .clearButton:disabled{background:#f9f9f9;border:1px solid #e6ecf5}.componentContainer .dateContainer{background:#fff;border:1px solid #e6ecf5;flex:1 1 auto;padding:6px}.componentContainer .dateContainer.noRightBorder{border-right:none}.componentContainer .dateContainer.disabled{background:#f9f9f9}.componentContainer .timeContainer{align-items:center;background:#fff;border:1px solid #e6ecf5;display:flex;flex:0 0 auto;margin-left:1.25rem;padding:6px .625rem}.componentContainer .timeContainer.disabled{background:#f9f9f9}.componentContainer .timeContainer input{border:none;color:#888da8;padding:0;text-align:center;width:20px}.componentContainer .timeContainer input::-moz-placeholder{color:#adadad}.componentContainer .timeContainer input:-ms-input-placeholder{color:#adadad}.componentContainer .timeContainer input::placeholder{color:#adadad}.componentContainer .timeContainer .divider{margin:0 .3125rem}"]
1408
- },] }
1409
- ];
1410
- DateTimePickerComponent.ctorParameters = () => [
1411
- { type: FormElementComponent, decorators: [{ type: Host }, { type: Optional }] },
1412
- { type: ControlContainer, decorators: [{ type: Host }, { type: Optional }] },
1413
- { type: undefined, decorators: [{ type: Inject, args: [DATE_TIME_PICKER_TRANSLATIONS,] }, { type: Optional }] },
1414
- { type: undefined, decorators: [{ type: Inject, args: [DATE_PICKER_LOCALE,] }, { type: Optional }] },
1415
- { type: DateAdapter },
1416
- { type: ChangeDetectorRef }
1417
- ];
1418
- DateTimePickerComponent.propDecorators = {
1419
- minDate: [{ type: Input }],
1420
- maxDate: [{ type: Input }],
1421
- sameMonthOnly: [{ type: Input }],
1422
- format: [{ type: Input }],
1423
- placeholder: [{ type: Input }],
1424
- clearable: [{ type: Input }],
1425
- showTimeInput: [{ type: Input }],
1426
- invalidTimeAsMidnight: [{ type: Input }],
1427
- nativeInputRef: [{ type: ViewChild, args: ['nativeInput',] }],
1428
- datePickerRef: [{ type: ViewChild, args: ['picker',] }]
1429
- };
1430
-
1431
- // material.module.ts
1432
- class MaterialModule {
1433
- }
1434
- MaterialModule.decorators = [
1435
- { type: NgModule, args: [{
1436
- imports: [MatDatepickerModule, MatFormFieldModule, MatNativeDateModule, MatInputModule, MatButtonModule],
1437
- exports: [MatDatepickerModule, MatFormFieldModule, MatNativeDateModule, MatInputModule, MatButtonModule],
1438
- providers: [MatDatepickerModule],
1439
- },] }
1440
- ];
1441
-
1442
- class FileInputComponent extends MultipleValueAccessorBase {
1443
- constructor() {
1444
- super(...arguments);
1445
- this.isLoading = false;
1446
- this.clearable = false;
1447
- this.onlyShowUploadButton = false;
1448
- this.useFullParentSize = false;
1449
- }
1450
- onChange(files) {
1451
- const result = [];
1452
- for (let i = 0; i < files.length; i++) {
1453
- result.push(files.item(i));
1454
- }
1455
- this.setInnerValueAndNotify(result);
1456
- // to make sure we can select the same file again
1457
- this.fileInputEl.nativeElement.value = null;
1458
- }
1459
- getFileNames() {
1460
- if (Array.isArray(this.innerValue)) {
1461
- return this.innerValue.map(e => e.name).join(', ');
1462
- }
1463
- else if (this.innerValue instanceof File) {
1464
- return this.innerValue.name;
1465
- }
1466
- return null;
1467
- }
1468
- shouldShowClearButton() {
1469
- if (this.onlyShowUploadButton) {
1470
- return false;
1471
- }
1472
- if (this.multiple) {
1473
- if (arrayIsSetAndFilled(this.innerValue)) {
1474
- return true;
1475
- }
1476
- return false;
1477
- }
1478
- if (isValueSet(this.innerValue)) {
1479
- return true;
1480
- }
1481
- return false;
1482
- }
1483
- uploadFileClicked() {
1484
- this.fileInputEl.nativeElement.click();
1485
- }
1486
- }
1487
- FileInputComponent.decorators = [
1488
- { type: Component, args: [{
1489
- selector: 'klp-form-file-input',
1490
- template: "<div class=\"componentContainer\" [ngClass]=\"{fullParentSize: useFullParentSize}\">\n\t<div class=\"buttonContainer\">\n\t\t<klp-form-button class=\"uploadButton\" [isLoading]=\"isLoading\" (click)=\"uploadFileClicked()\">\n\t\t\tUpload a file\n\t\t</klp-form-button>\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\t#fileInput\n\t\t\t(change)=\"onChange($event.target.files)\"\n\t\t\t[multiple]=\"multiple\"\n\t\t\t[disabled]=\"disabled\"\n\t\t>\n\t</div>\n\t<div class=\"fileName\" *ngIf=\"!onlyShowUploadButton\">\n\t\t{{getFileNames()}}\n\t</div>\n\t<klp-form-button class=\"clearButton\" variant=\"white\" *ngIf=\"shouldShowClearButton()\" (click)=\"resetToNull()\">X</klp-form-button>\n</div>\n",
1491
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: FileInputComponent, multi: true }],
1492
- styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{align-items:center;display:flex}.componentContainer.fullParentSize{height:100%;justify-content:center;position:relative}.componentContainer:not(.fullParentSize) .buttonContainer{position:relative}.componentContainer .buttonContainer{flex:0 0 auto}input{bottom:0;cursor:pointer;left:0;opacity:0;position:absolute;right:0;top:0}.fileName{color:#515365;flex:1 1 0px;margin-left:.625rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.clearButton{flex:0 0 auto}"]
1493
- },] }
1494
- ];
1495
- FileInputComponent.propDecorators = {
1496
- isLoading: [{ type: Input }],
1497
- clearable: [{ type: Input }],
1498
- onlyShowUploadButton: [{ type: Input }],
1499
- useFullParentSize: [{ type: Input }],
1500
- fileInputEl: [{ type: ViewChild, args: ['fileInput',] }]
1501
- };
1502
-
1503
- class SortableGroupedItemsComponent extends ValueAccessorBase {
1504
- constructor() {
1505
- super(...arguments);
1506
- this.reloader = true; // sortable items doesnt correctly update, so we have this boolean that flips to rerender the sortable items comp
1507
- }
1508
- writeValue(value) {
1509
- super.writeValue(value);
1510
- this.reloader = false;
1511
- setTimeout(() => {
1512
- if (arrayIsSetAndFilled(value)) {
1513
- this.items = value.flatMap(e => [...e, '']);
1514
- }
1515
- else {
1516
- this.items = [];
1517
- }
1518
- this.reloader = true;
1519
- });
1520
- }
1521
- onItemsRearranged(value) {
1522
- const result = splitArrayByCondition(value, e => e === '').filter(arrayIsSetAndFilled);
1523
- this.setInnerValueAndNotify(result);
1524
- this.reloader = false;
1525
- setTimeout(() => {
1526
- this.items = [...this.items, ''].filter((e, i) => {
1527
- if (i === 0 && e === '') {
1528
- return false;
1529
- }
1530
- if (e === '' && this.items[i - 1] === '') {
1531
- return false;
1532
- }
1533
- return true;
1534
- });
1535
- this.reloader = true;
1536
- });
1537
- }
1538
- }
1539
- SortableGroupedItemsComponent.decorators = [
1540
- { type: Component, args: [{
1541
- selector: 'klp-form-sortable-grouped-items',
1542
- template: "<ng-container *ngIf=\"reloader\">\n\t<klp-form-sortable-items\n\t\t[(ngModel)]=\"items\"\n\t\t(ngModelChange)=\"onItemsRearranged($event)\"\n\t>\n\t\t<ng-template let-item=\"item\">\n\t\t\t<div>{{item}}</div>\n\t\t</ng-template>\n\t</klp-form-sortable-items>\n</ng-container>\n",
1543
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SortableGroupedItemsComponent, multi: true }],
1544
- styles: [":host{display:block}"]
1545
- },] }
1546
- ];
1547
-
1548
- const invalidTimeKey = '--invalid_time--';
1549
- function timeValidator(control) {
1550
- const invalid = control.value === invalidTimeKey;
1551
- return invalid ? { date: control.value } : null;
1552
- }
1553
-
1554
- class HourMinuteInputComponent extends ValueAccessorBase {
1555
- constructor() {
1556
- super(...arguments);
1557
- this.placeholders = ['hour', 'min'];
1558
- this.hoursTouched = false;
1559
- this.minutesTouched = false;
1560
- }
1561
- formatHours() {
1562
- if (!stringIsSetAndFilled(this.hours)) {
1563
- this.hours = '0';
1564
- }
1565
- }
1566
- formatMinutes() {
1567
- if (!stringIsSetAndFilled(this.minutes)) {
1568
- this.minutes = '0';
1569
- }
1570
- }
1571
- formatTime() {
1572
- if (Number.isFinite(Number(this.hours)) && this.hours.length === 1) {
1573
- this.hours = '0' + this.hours;
1574
- }
1575
- if (Number.isFinite(Number(this.minutes)) && this.minutes.length === 1) {
1576
- this.minutes = '0' + this.minutes;
1577
- }
1578
- }
1579
- writeValue(value) {
1580
- if (Number.isFinite(value)) {
1581
- this.hours = Math.floor(value / 60) + '';
1582
- this.minutes = value % 60 + '';
1583
- this.formatTime();
1584
- super.writeValue(value);
1585
- }
1586
- else {
1587
- this.hours = '';
1588
- this.minutes = '';
1589
- super.writeValue(invalidTimeKey);
1590
- }
1591
- }
1592
- notifyNewTime() {
1593
- const parsedHours = Number(this.hours);
1594
- const parsedMinutes = Number(this.minutes);
1595
- // when all inputs are empty
1596
- if (!stringIsSetAndFilled(this.hours) && !stringIsSetAndFilled(this.minutes)) {
1597
- this.setInnerValueAndNotify(null);
1598
- return;
1599
- }
1600
- // if we have valid time
1601
- if (Number.isFinite(parsedHours) &&
1602
- parsedHours >= 0 &&
1603
- parsedHours <= 9999 &&
1604
- Number.isFinite(parsedMinutes) &&
1605
- parsedMinutes >= 0 &&
1606
- parsedMinutes <= 59) {
1607
- this.setInnerValueAndNotify(parsedHours * 60 + parsedMinutes);
1608
- return;
1609
- }
1610
- // all other cases, we are not in a valid state
1611
- this.setInnerValueAndNotify(invalidTimeKey);
1612
- }
1613
- touchHours() {
1614
- this.hoursTouched = true;
1615
- this.determineAllTouched();
1616
- }
1617
- touchMinutes() {
1618
- this.minutesTouched = true;
1619
- this.determineAllTouched();
1620
- }
1621
- determineAllTouched() {
1622
- if (this.hoursTouched && this.minutesTouched) {
1623
- this.touch();
1624
- }
1625
- }
1626
- }
1627
- HourMinuteInputComponent.decorators = [
1628
- { type: Component, args: [{
1629
- selector: 'klp-form-hour-minute-input',
1630
- template: "<div class=\"componentContainer\" [ngClass]=\"{disabled: disabled}\">\n\t<input class=\"hourInput\" maxlength=\"4\" [placeholder]=\"placeholders[0]\" [disabled]=\"disabled\" [(ngModel)]=\"hours\" (blur)=\"formatHours(); formatTime(); touchHours(); notifyNewTime()\" (ngModelChange)=\"notifyNewTime()\">\n\t<div class=\"divider\">:</div>\n\t<input maxlength=\"2\" [placeholder]=\"placeholders[1]\" [disabled]=\"disabled\" [(ngModel)]=\"minutes\" (blur)=\"formatMinutes(); formatTime(); touchMinutes(); notifyNewTime()\" (ngModelChange)=\"notifyNewTime()\">\n</div>\n",
1631
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: HourMinuteInputComponent, multi: true }],
1632
- styles: [":host{display:flex}.componentContainer{align-items:center;background:#fff;border:1px solid #e6ecf5;display:flex;flex:0 0 auto;height:42px;padding:6px .625rem}.componentContainer.disabled{background:#f9f9f9;cursor:not-allowed}.componentContainer input{border:none;color:#888da8;padding:0;text-align:center;width:30px}.componentContainer input.hourInput{width:50px}.componentContainer input::-moz-placeholder{color:#adadad}.componentContainer input:-ms-input-placeholder{color:#adadad}.componentContainer input::placeholder{color:#adadad}.componentContainer .divider{margin:0 .3125rem}"]
1633
- },] }
1634
- ];
1635
- HourMinuteInputComponent.propDecorators = {
1636
- placeholders: [{ type: Input }]
1637
- };
1638
-
1639
- class NgxEnhancyFormsModule {
1640
- }
1641
- NgxEnhancyFormsModule.decorators = [
1642
- { type: NgModule, args: [{
1643
- imports: [
1644
- CommonModule,
1645
- FormsModule,
1646
- NgSelectModule,
1647
- SortablejsModule,
1648
- MaterialModule,
1649
- ],
1650
- declarations: [
1651
- ValueAccessorBase,
1652
- MultipleValueAccessorBase,
1653
- ButtonComponent,
1654
- CheckboxComponent,
1655
- DatePickerComponent,
1656
- DateTimePickerComponent,
1657
- EmailInputComponent,
1658
- LoadingIndicatorComponent,
1659
- NumberInputComponent,
1660
- PasswordFieldComponent,
1661
- SelectComponent,
1662
- KlpSelectOptionTemplateDirective,
1663
- SelectFooterComponent,
1664
- SortableItemsComponent,
1665
- SortableGroupedItemsComponent,
1666
- TextInputComponent,
1667
- ToggleComponent,
1668
- FileInputComponent,
1669
- FormCaptionComponent,
1670
- FormElementComponent,
1671
- FormErrorComponent,
1672
- FormSubmitButtonComponent,
1673
- FormComponent,
1674
- SubFormDirective,
1675
- HourMinuteInputComponent
1676
- ],
1677
- exports: [
1678
- ValueAccessorBase,
1679
- MultipleValueAccessorBase,
1680
- ButtonComponent,
1681
- DatePickerComponent,
1682
- DateTimePickerComponent,
1683
- CheckboxComponent,
1684
- EmailInputComponent,
1685
- LoadingIndicatorComponent,
1686
- NumberInputComponent,
1687
- PasswordFieldComponent,
1688
- SelectComponent,
1689
- KlpSelectOptionTemplateDirective,
1690
- SelectFooterComponent,
1691
- SortableItemsComponent,
1692
- SortableGroupedItemsComponent,
1693
- TextInputComponent,
1694
- ToggleComponent,
1695
- FileInputComponent,
1696
- FormCaptionComponent,
1697
- FormElementComponent,
1698
- FormErrorComponent,
1699
- FormSubmitButtonComponent,
1700
- FormComponent,
1701
- SubFormDirective,
1702
- HourMinuteInputComponent
1703
- ]
1704
- },] }
1705
- ];
1706
-
1707
- /*
1708
- * Public API Surface of ngx-enhancy-forms
1709
- */
1710
-
1711
- /**
1712
- * Generated bundle index. Do not edit.
1713
- */
1714
-
1715
- export { ButtonComponent, CheckboxComponent, DATE_PICKER_LOCALE, DATE_PICKER_TRANSLATIONS, DATE_TIME_PICKER_TRANSLATIONS, DEFAULT_ERROR_MESSAGES, DatePickerComponent, DateTimePickerComponent, EmailInputComponent, FORM_ERROR_MESSAGES, FileInputComponent, FormCaptionComponent, FormComponent, FormElementComponent, FormErrorComponent, FormSubmitButtonComponent, HourMinuteInputComponent, KLP_DATE_FORMATS, KlpSelectOptionTemplateDirective, LoadingIndicatorComponent, MultipleValueAccessorBase, NgxEnhancyFormsModule, NumberInputComponent, PasswordFieldComponent, SELECT_TRANSLATIONS, SelectComponent, SelectFooterComponent, SortableGroupedItemsComponent, SortableItemsComponent, SubFormDirective, TextInputComponent, ToggleComponent, ValueAccessorBase, dateValidator, invalidDateKey, invalidFieldsSymbol, matDateFormatsFactory, MaterialModule as ɵa };
1716
- //# sourceMappingURL=klippa-ngx-enhancy-forms.js.map