@3kles/kles-material-dynamicforms 19.3.2 → 19.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/fesm2022/3kles-kles-material-dynamicforms.mjs +1572 -1123
  2. package/fesm2022/3kles-kles-material-dynamicforms.mjs.map +1 -1
  3. package/lib/controls/control.abstract.d.ts +5 -5
  4. package/lib/decorators/component.decorator.d.ts +4 -1
  5. package/lib/directive/dynamic-field.directive.d.ts +3 -1
  6. package/lib/dynamic-form.component.d.ts +4 -0
  7. package/lib/factories/field.factory.d.ts +3 -2
  8. package/lib/fields/array.component.d.ts +3 -0
  9. package/lib/fields/checkbox.component.d.ts +2 -0
  10. package/lib/fields/date.component.d.ts +1 -1
  11. package/lib/fields/field.abstract.d.ts +23 -9
  12. package/lib/fields/group.component.d.ts +2 -0
  13. package/lib/fields/icon.component.d.ts +1 -1
  14. package/lib/fields/input.clearable.component.d.ts +1 -5
  15. package/lib/fields/input.component.d.ts +3 -4
  16. package/lib/fields/label.component.d.ts +2 -1
  17. package/lib/fields/list-field.component.d.ts +3 -5
  18. package/lib/fields/select.component.d.ts +3 -5
  19. package/lib/fields/select.lazy-search.component.d.ts +1 -6
  20. package/lib/fields/select.search.component.d.ts +3 -5
  21. package/lib/fields/subfields/clear.component.d.ts +14 -9
  22. package/lib/fields/subfields/copy.component.d.ts +18 -0
  23. package/lib/fields/subfields/password-visibility.component.d.ts +6 -6
  24. package/lib/interfaces/field.config.interface.d.ts +38 -35
  25. package/lib/kles-material-dynamicforms.module.d.ts +3 -7
  26. package/lib/token.d.ts +9 -0
  27. package/lib/ui/array.ui.d.ts +5 -0
  28. package/lib/ui/default.ui.d.ts +5 -0
  29. package/lib/ui/group.ui.d.ts +5 -0
  30. package/lib/ui/ui-state/array-ui-state.d.ts +9 -0
  31. package/lib/ui/ui-state/control-ui-state.d.ts +7 -0
  32. package/lib/ui/ui-state/group-ui-state.d.ts +13 -0
  33. package/lib/ui/ui-state/ui-state.abstract.d.ts +11 -0
  34. package/lib/ui/ui.abstract.d.ts +8 -0
  35. package/lib/ui/ui.interface.d.ts +4 -0
  36. package/package.json +1 -1
  37. package/public-api.d.ts +11 -1
  38. package/lib/fields/copy.component.d.ts +0 -20
@@ -1,35 +1,36 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, Component, Injector, Directive, Injectable, EventEmitter, Output, NgModule, HostBinding, signal, Pipe, ViewChildren, ViewChild, forwardRef, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
2
+ import { signal, InjectionToken, inject, Component, Injector, Input, Directive, Injectable, EventEmitter, Output, NgModule, computed, ViewContainerRef, HostBinding, Pipe, ChangeDetectorRef, ViewChildren, ViewChild, forwardRef, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
6
- import { Validators, FormControl, ReactiveFormsModule, FormsModule, FormControlDirective, FormControlName, FormArray, FormGroup, NG_VALUE_ACCESSOR, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
7
- import { concat, of, Subject, Observable, combineLatest, BehaviorSubject, ReplaySubject } from 'rxjs';
8
- import { tap, take, catchError, map, takeUntil, distinctUntilChanged, filter, switchMap, startWith, debounceTime, shareReplay } from 'rxjs/operators';
9
- import * as i4 from '@angular/material/form-field';
6
+ import { Validators, FormControl, ReactiveFormsModule, FormsModule, FormControlDirective, FormControlName, FormArray, FormGroup, UntypedFormBuilder, NG_VALUE_ACCESSOR, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
7
+ import { concat, of, Subject, combineLatest, startWith, map as map$1, takeUntil, Observable, BehaviorSubject, ReplaySubject } from 'rxjs';
8
+ import { tap, take, catchError, map, takeUntil as takeUntil$1, distinctUntilChanged, filter, switchMap, startWith as startWith$1, debounceTime, shareReplay } from 'rxjs/operators';
9
+ import * as i2$1 from '@angular/material/form-field';
10
10
  import { MatError, MatFormFieldModule, MatFormField, MatHint, MatLabel } from '@angular/material/form-field';
11
11
  import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS, ErrorStateMatcher, MatNativeDateModule, MatOptionModule, MatOption } from '@angular/material/core';
12
- import * as i2$1 from '@angular/material/icon';
12
+ import * as i2$2 from '@angular/material/icon';
13
13
  import { MatIcon, MatIconModule } from '@angular/material/icon';
14
- import * as i4$2 from '@angular/material/button';
14
+ import * as i4$3 from '@angular/material/button';
15
15
  import { MatIconButton, MatButtonModule, MatButton } from '@angular/material/button';
16
+ import { toSignal } from '@angular/core/rxjs-interop';
16
17
  import { MatSliderModule } from '@angular/material/slider';
17
18
  import { MatToolbarModule } from '@angular/material/toolbar';
18
19
  import { MatSidenavModule } from '@angular/material/sidenav';
19
- import * as i3$4 from '@angular/material/badge';
20
+ import * as i3$5 from '@angular/material/badge';
20
21
  import { MatBadgeModule, MatBadge } from '@angular/material/badge';
21
- import * as i3$3 from '@angular/material/list';
22
+ import * as i3$4 from '@angular/material/list';
22
23
  import { MatListModule } from '@angular/material/list';
23
24
  import { MatGridListModule } from '@angular/material/grid-list';
24
- import * as i3$1 from '@angular/material/datepicker';
25
+ import * as i3$2 from '@angular/material/datepicker';
25
26
  import { MatDatepickerModule } from '@angular/material/datepicker';
26
- import * as i5 from '@angular/material/input';
27
+ import * as i3 from '@angular/material/input';
27
28
  import { MatInputModule, MatInput, MatLabel as MatLabel$1, MatFormField as MatFormField$1 } from '@angular/material/input';
28
- import * as i5$1 from '@angular/material/select';
29
+ import * as i4 from '@angular/material/select';
29
30
  import { MatSelectModule, MatSelectTrigger, MatSelect } from '@angular/material/select';
30
31
  import { MatRadioModule, MatRadioButton, MatRadioGroup } from '@angular/material/radio';
31
32
  import { MatChipsModule, MatChipOption, MatChipListbox } from '@angular/material/chips';
32
- import * as i3 from '@angular/material/tooltip';
33
+ import * as i4$1 from '@angular/material/tooltip';
33
34
  import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
34
35
  import { MatTableModule } from '@angular/material/table';
35
36
  import { MatPaginatorModule } from '@angular/material/paginator';
@@ -37,12 +38,12 @@ import { MatCardModule } from '@angular/material/card';
37
38
  import { MatMenuModule } from '@angular/material/menu';
38
39
  import { CdkTableModule } from '@angular/cdk/table';
39
40
  import { MatTabsModule } from '@angular/material/tabs';
40
- import * as i9 from '@angular/material/progress-spinner';
41
+ import * as i8 from '@angular/material/progress-spinner';
41
42
  import { MatProgressSpinnerModule, MatProgressSpinner } from '@angular/material/progress-spinner';
42
43
  import * as i1$1 from '@angular/material/checkbox';
43
44
  import { MatCheckboxModule, MatCheckbox } from '@angular/material/checkbox';
44
45
  import { MatDialogModule } from '@angular/material/dialog';
45
- import * as i6 from '@angular/material/autocomplete';
46
+ import * as i5 from '@angular/material/autocomplete';
46
47
  import { MatAutocompleteModule, MatOption as MatOption$1 } from '@angular/material/autocomplete';
47
48
  import { MatProgressBarModule } from '@angular/material/progress-bar';
48
49
  import { MatSortModule } from '@angular/material/sort';
@@ -50,18 +51,18 @@ import { MatExpansionModule } from '@angular/material/expansion';
50
51
  import { MatSnackBarModule } from '@angular/material/snack-bar';
51
52
  import { MatTreeModule } from '@angular/material/tree';
52
53
  import { MatSlideToggleModule, MatSlideToggle } from '@angular/material/slide-toggle';
53
- import * as i4$1 from '@angular/cdk/scrolling';
54
+ import * as i3$1 from '@angular/cdk/scrolling';
54
55
  import { ScrollingModule, CdkScrollable, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
55
- import * as i3$5 from '@angular/material/button-toggle';
56
+ import * as i3$6 from '@angular/material/button-toggle';
56
57
  import { MatButtonToggleModule } from '@angular/material/button-toggle';
57
58
  import { PortalModule } from '@angular/cdk/portal';
58
59
  import { __decorate } from 'tslib';
59
60
  import { v4 } from 'uuid';
60
61
  import { cloneDeep } from 'lodash';
61
62
  import { ColorPickerDirective, ColorPickerComponent } from 'ngx-color-picker';
62
- import * as i3$2 from '@angular/cdk/text-field';
63
+ import * as i3$3 from '@angular/cdk/text-field';
63
64
  import { TextFieldModule } from '@angular/cdk/text-field';
64
- import * as i5$2 from 'ngx-mat-select-search';
65
+ import * as i4$2 from 'ngx-mat-select-search';
65
66
  import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
66
67
  import { getMultipleValuesInSingleSelectionError } from '@angular/cdk/collections';
67
68
  import * as i1$2 from '@angular/cdk/clipboard';
@@ -81,7 +82,7 @@ class KlesAbstractFormControl {
81
82
  bindAsyncValidations(validations) {
82
83
  if (validations.length > 0) {
83
84
  return Validators.composeAsync(validations.map((validation) => {
84
- return ((c) => {
85
+ return (c) => {
85
86
  const validator$ = validation.validator(c);
86
87
  if (validator$ instanceof Promise) {
87
88
  return validator$.finally(() => this.ref?.markForCheck());
@@ -89,7 +90,7 @@ class KlesAbstractFormControl {
89
90
  else {
90
91
  return validator$.pipe(tap(() => this.ref?.markForCheck()));
91
92
  }
92
- });
93
+ };
93
94
  }));
94
95
  }
95
96
  return null;
@@ -126,10 +127,75 @@ class KlesFormControl extends KlesAbstractFormControl {
126
127
  }
127
128
  }
128
129
 
130
+ class AbstractUiState {
131
+ constructor() {
132
+ this._value = signal(undefined);
133
+ }
134
+ get(path) {
135
+ let currPath = path;
136
+ if (currPath == null)
137
+ return null;
138
+ if (!Array.isArray(currPath))
139
+ currPath = currPath.split('.');
140
+ if (currPath.length === 0)
141
+ return null;
142
+ return currPath.reduce((uiState, name) => uiState && uiState._find(name), this);
143
+ }
144
+ _find(name) {
145
+ return null;
146
+ }
147
+ get value() {
148
+ return this._value.asReadonly();
149
+ }
150
+ }
151
+
152
+ class ControlUiState extends AbstractUiState {
153
+ constructor(value) {
154
+ super();
155
+ this._value.set(value);
156
+ }
157
+ setValue(value) {
158
+ this._value.set(value);
159
+ }
160
+ patchValue(value) {
161
+ this.setValue(value);
162
+ }
163
+ }
164
+
165
+ class KlesAbstractFormUiControl {
166
+ constructor(field) {
167
+ this.field = field;
168
+ }
169
+ }
170
+
171
+ class KlesFormUiControl extends KlesAbstractFormUiControl {
172
+ create() {
173
+ return new ControlUiState({
174
+ inputType: this.field.inputType,
175
+ min: this.field.min,
176
+ max: this.field.max,
177
+ maxLength: this.field.maxLength,
178
+ step: this.field.step,
179
+ hostClass: this.field.hostClass,
180
+ ngClass: this.field.ngClass,
181
+ ngStyle: this.field.ngStyle,
182
+ indeterminate: this.field.indeterminate ?? false,
183
+ color: this.field.color,
184
+ icon: this.field.icon,
185
+ iconSvg: this.field.iconSvg,
186
+ appearance: this.field.appearance ?? 'fill',
187
+ });
188
+ }
189
+ }
190
+
129
191
  const klesFieldControlFactory = (field, ref) => {
130
192
  const factory = new KlesFormControl(field, ref);
131
193
  return factory.create();
132
194
  };
195
+ const klesFieldUiFactory = (field) => {
196
+ const factory = new KlesFormUiControl(field);
197
+ return factory.create();
198
+ };
133
199
 
134
200
  const componentMapper = [];
135
201
  function FieldMapper(config) {
@@ -137,7 +203,8 @@ function FieldMapper(config) {
137
203
  componentMapper.push({
138
204
  component: target,
139
205
  type: config.type,
140
- factory: config.factory || klesFieldControlFactory
206
+ factory: config.factory || klesFieldControlFactory,
207
+ ui: config.ui || klesFieldUiFactory,
141
208
  });
142
209
  };
143
210
  }
@@ -163,22 +230,54 @@ var EnumType;
163
230
  EnumType["range"] = "range";
164
231
  })(EnumType || (EnumType = {}));
165
232
 
233
+ const FIELD_NAME = new InjectionToken('FIELD_NAME');
234
+ const GROUP = new InjectionToken('GROUP');
235
+ const SIBLING_FIELDS = new InjectionToken('SIBLING_FIELDS');
236
+ const GROUP_UI = new InjectionToken('GROUP_UI');
237
+ const FIELD = new InjectionToken('FIELD');
238
+
166
239
  class KlesFormClearComponent {
240
+ constructor() {
241
+ this.field = inject(FIELD);
242
+ this.group = inject(GROUP);
243
+ this.siblingFields = inject(SIBLING_FIELDS);
244
+ this._onDestroy = new Subject();
245
+ this.disabled = toSignal(combineLatest([
246
+ this.group.get(this.field.name)?.valueChanges.pipe(startWith(this.group.get(this.field.name).value), map$1((value) => {
247
+ return !this.isPresent(value);
248
+ })),
249
+ this.group.get(this.field.name)?.statusChanges.pipe(startWith(this.group.get(this.field.name).status), map$1((status) => status === 'DISABLED')),
250
+ ]).pipe(takeUntil(this._onDestroy), map$1(([empty, disabled]) => {
251
+ return empty || disabled;
252
+ })));
253
+ }
254
+ ngOnDestroy() {
255
+ this._onDestroy.next();
256
+ this._onDestroy.complete();
257
+ }
167
258
  clear(event) {
168
259
  event.stopPropagation();
169
260
  this.group.controls[this.field.name].reset();
170
261
  }
171
- isDisable() {
172
- return this.group.get(this.field.name).disabled
173
- || !this.group.get(this.field.name).value
174
- || (Array.isArray(this.group.get(this.field.name).value) && !this.group.get(this.field.name).value.length);
262
+ isPresent(value) {
263
+ if (value == null)
264
+ return false;
265
+ if (typeof value === 'string') {
266
+ return value.length > 0;
267
+ }
268
+ if (Array.isArray(value)) {
269
+ return value.length > 0;
270
+ }
271
+ if (value instanceof Map || value instanceof Set) {
272
+ return value.size > 0;
273
+ }
274
+ return true;
175
275
  }
176
276
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormClearComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
177
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormClearComponent, isStandalone: true, selector: "kles-form-clear", inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, ngImport: i0, template: `
178
- <button [disabled]="isDisable()" mat-icon-button aria-label="Clear" type="button"
179
- (click)="clear($event)">
180
- <mat-icon>close</mat-icon>
181
- </button>
277
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormClearComponent, isStandalone: true, selector: "kles-form-clear", ngImport: i0, template: `
278
+ <button [disabled]="disabled()" mat-icon-button aria-label="Clear" type="button" (click)="clear($event)">
279
+ <mat-icon>close</mat-icon>
280
+ </button>
182
281
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
183
282
  }
184
283
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormClearComponent, decorators: [{
@@ -186,21 +285,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
186
285
  args: [{
187
286
  selector: 'kles-form-clear',
188
287
  template: `
189
- <button [disabled]="isDisable()" mat-icon-button aria-label="Clear" type="button"
190
- (click)="clear($event)">
191
- <mat-icon>close</mat-icon>
192
- </button>
288
+ <button [disabled]="disabled()" mat-icon-button aria-label="Clear" type="button" (click)="clear($event)">
289
+ <mat-icon>close</mat-icon>
290
+ </button>
193
291
  `,
194
292
  standalone: true,
195
- imports: [CommonModule, MatIcon, MatIconButton]
293
+ imports: [CommonModule, MatIcon, MatIconButton],
196
294
  }]
197
- }], propDecorators: { field: [{
198
- type: Input
199
- }], group: [{
200
- type: Input
201
- }], siblingFields: [{
202
- type: Input
203
- }] } });
295
+ }], ctorParameters: () => [] });
204
296
 
205
297
  function isDestroyable(value) {
206
298
  return value !== null && typeof value === 'object' &&
@@ -254,6 +346,26 @@ class KlesDynamicFieldDirective {
254
346
  { provide: MAT_DATE_FORMATS, useValue: this.field.dateOptions.dateFormat },
255
347
  ]
256
348
  : []),
349
+ {
350
+ provide: FIELD_NAME,
351
+ useValue: this.field.name,
352
+ },
353
+ {
354
+ provide: FIELD,
355
+ useValue: this.field,
356
+ },
357
+ {
358
+ provide: GROUP,
359
+ useValue: this.group,
360
+ },
361
+ {
362
+ provide: SIBLING_FIELDS,
363
+ useValue: this.siblingFields,
364
+ },
365
+ {
366
+ provide: GROUP_UI,
367
+ useValue: this.ui,
368
+ },
257
369
  ],
258
370
  parent: this.injector,
259
371
  };
@@ -266,12 +378,6 @@ class KlesDynamicFieldDirective {
266
378
  this.subComponents.push(...this.field.subComponents.map((subComponent) => this.createSubComponent(subComponent, options)));
267
379
  }
268
380
  this.componentRef = this.createComponentRef(injector);
269
- this.componentRef.setInput('field', this.field);
270
- this.componentRef.setInput('group', this.group);
271
- this.componentRef.setInput('siblingFields', this.siblingFields);
272
- // this.componentRef.instance.field = this.field;
273
- // this.componentRef.instance.group = this.group;
274
- // this.componentRef.instance.siblingFields = this.siblingFields;
275
381
  this.componentRef.onDestroy(() => {
276
382
  if (isDestroyable(injector)) {
277
383
  injector.destroy();
@@ -296,9 +402,6 @@ class KlesDynamicFieldDirective {
296
402
  createSubComponent(componentType, options) {
297
403
  const injector = Injector.create(options);
298
404
  const component = this.container.createComponent(componentType, { injector });
299
- component.setInput('field', this.field);
300
- component.setInput('group', this.group);
301
- component.setInput('siblingFields', this.siblingFields);
302
405
  component.onDestroy(() => {
303
406
  if (isDestroyable(injector)) {
304
407
  injector.destroy();
@@ -307,7 +410,7 @@ class KlesDynamicFieldDirective {
307
410
  return component;
308
411
  }
309
412
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesDynamicFieldDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
310
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: KlesDynamicFieldDirective, isStandalone: true, selector: "[klesDynamicField]", inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, usesOnChanges: true, ngImport: i0 }); }
413
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: KlesDynamicFieldDirective, isStandalone: true, selector: "[klesDynamicField]", inputs: { field: "field", group: "group", ui: "ui", siblingFields: "siblingFields" }, usesOnChanges: true, ngImport: i0 }); }
311
414
  }
312
415
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesDynamicFieldDirective, decorators: [{
313
416
  type: Directive,
@@ -319,6 +422,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
319
422
  type: Input
320
423
  }], group: [{
321
424
  type: Input
425
+ }], ui: [{
426
+ type: Input
322
427
  }], siblingFields: [{
323
428
  type: Input
324
429
  }] } });
@@ -398,6 +503,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
398
503
  type: Injectable
399
504
  }], ctorParameters: () => [] });
400
505
 
506
+ class GroupUiState extends AbstractUiState {
507
+ constructor() {
508
+ super(...arguments);
509
+ this.states = {};
510
+ }
511
+ setValue(value) {
512
+ Object.keys(value).forEach((name) => {
513
+ this.states[name]?.setValue(value[name]);
514
+ });
515
+ }
516
+ patchValue(value) {
517
+ if (value == null)
518
+ return;
519
+ Object.keys(value).forEach((name) => {
520
+ const state = this.states[name];
521
+ if (state) {
522
+ state.patchValue(value[name]);
523
+ }
524
+ });
525
+ }
526
+ _find(name) {
527
+ return this.states.hasOwnProperty(name) ? this.states[name] : null;
528
+ }
529
+ addUiState(name, uiState) {
530
+ this.states[name] = uiState;
531
+ }
532
+ }
533
+
401
534
  const originFormControlNgOnChanges = FormControlDirective.prototype.ngOnChanges;
402
535
  FormControlDirective.prototype.ngOnChanges = function () {
403
536
  this.form.nativeElement = this.valueAccessor._elementRef?.nativeElement;
@@ -427,6 +560,7 @@ class KlesDynamicFormComponent {
427
560
  }
428
561
  ngOnInit() {
429
562
  this.form = this.createForm();
563
+ this.ui = this.createUi();
430
564
  this.setOrientationClass();
431
565
  this._onLoaded.emit();
432
566
  }
@@ -537,6 +671,14 @@ class KlesDynamicFormComponent {
537
671
  return componentMapper.find((c) => c.component === field.component)?.factory ? componentMapper.find((c) => c.component === field.component)?.factory(field, this.ref) : klesFieldControlFactory(field, this.ref);
538
672
  }
539
673
  }
674
+ createUiState(field) {
675
+ if (field.type) {
676
+ return componentMapper.find((c) => c.type === field.type)?.ui ? componentMapper.find((c) => c.type === field.type)?.ui(field) : klesFieldUiFactory(field);
677
+ }
678
+ else {
679
+ return componentMapper.find((c) => c.component === field.component)?.ui ? componentMapper.find((c) => c.component === field.component)?.ui(field) : klesFieldUiFactory(field);
680
+ }
681
+ }
540
682
  createForm() {
541
683
  const group = this.fb.group({});
542
684
  this.fields.forEach((field) => {
@@ -555,19 +697,29 @@ class KlesDynamicFormComponent {
555
697
  control.markAsTouched({ onlySelf: true });
556
698
  });
557
699
  }
700
+ createUi() {
701
+ const uiGroup = new GroupUiState();
702
+ this.fields.forEach((field) => {
703
+ const uiState = this.createUiState(field);
704
+ if (uiState) {
705
+ uiGroup.addUiState(field.name, uiState);
706
+ }
707
+ });
708
+ return uiGroup;
709
+ }
558
710
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesDynamicFormComponent, deps: [{ token: i2.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
559
711
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesDynamicFormComponent, isStandalone: true, selector: "app-kles-dynamic-form", inputs: { fields: "fields", validators: "validators", asyncValidators: "asyncValidators", direction: "direction", formClass: "formClass" }, outputs: { submit: "submit", _onLoaded: "_onLoaded" }, providers: [{ provide: ErrorStateMatcher, useClass: KlesFormErrorStateMatcher }], exportAs: ["klesDynamicForm"], usesOnChanges: true, ngImport: i0, template: `
560
712
  <form class="{{ orientationClass }}" [ngClass]="formClass" [formGroup]="form" (submit)="onSubmit($event)">
561
713
  @for (field of fields; track field.name) {
562
714
  @if (field.visible !== false) {
563
- <ng-container klesDynamicField [field]="field" [group]="form" [siblingFields]="fields"> </ng-container>
715
+ <ng-container klesDynamicField [field]="field" [group]="form" [ui]="ui" [siblingFields]="fields"> </ng-container>
564
716
  }
565
717
  }
566
718
  @if (form && form.errors) {
567
719
  <mat-error matErrorForm [form]="form" [validations]="validators" [asyncValidations]="asyncValidators"></mat-error>
568
720
  }
569
721
  </form>
570
- `, isInline: true, styles: [".dynamic-form-column{display:flex;flex-direction:column}\n", ".dynamic-form-column>*{width:100%}\n", ".dynamic-form-row{display:inline-flex;flex-wrap:wrap;gap:10px;align-items:baseline}\n", ".dynamic-form-row>*{width:100%}\n", ".dynamic-form-grid{display:grid}\n", ".dynamic-form-inline-grid{display:inline-grid}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorFormDirective, selector: "[matErrorForm]", inputs: ["form", "validations", "asyncValidations"] }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "siblingFields"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }] }); }
722
+ `, isInline: true, styles: [".dynamic-form-column{display:flex;flex-direction:column}\n", ".dynamic-form-column>*{width:100%}\n", ".dynamic-form-row{display:inline-flex;flex-wrap:wrap;gap:10px;align-items:baseline}\n", ".dynamic-form-row>*{width:100%}\n", ".dynamic-form-grid{display:grid}\n", ".dynamic-form-inline-grid{display:inline-grid}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorFormDirective, selector: "[matErrorForm]", inputs: ["form", "validations", "asyncValidations"] }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "ui", "siblingFields"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }] }); }
571
723
  }
572
724
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesDynamicFormComponent, decorators: [{
573
725
  type: Component,
@@ -575,7 +727,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
575
727
  <form class="{{ orientationClass }}" [ngClass]="formClass" [formGroup]="form" (submit)="onSubmit($event)">
576
728
  @for (field of fields; track field.name) {
577
729
  @if (field.visible !== false) {
578
- <ng-container klesDynamicField [field]="field" [group]="form" [siblingFields]="fields"> </ng-container>
730
+ <ng-container klesDynamicField [field]="field" [group]="form" [ui]="ui" [siblingFields]="fields"> </ng-container>
579
731
  }
580
732
  }
581
733
  @if (form && form.errors) {
@@ -620,10 +772,18 @@ class KlesComponentDirective {
620
772
  if (this.componentRef) {
621
773
  this.componentRef.destroy();
622
774
  }
623
- this.componentRef = this.container.createComponent(this.component);
775
+ const options = {
776
+ providers: [
777
+ {
778
+ provide: FIELD,
779
+ useValue: this.field,
780
+ },
781
+ ],
782
+ };
783
+ const injector = Injector.create(options);
784
+ this.componentRef = this.container.createComponent(this.component, { injector });
624
785
  this.componentRef.instance.component = this.component;
625
786
  this.componentRef.instance.value = this.value;
626
- this.componentRef.instance.field = this.field;
627
787
  }
628
788
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
629
789
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: KlesComponentDirective, isStandalone: true, selector: "[klesComponent]", inputs: { component: "component", value: "value", field: "field" }, usesOnChanges: true, ngImport: i0 }); }
@@ -876,26 +1036,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
876
1036
  }] });
877
1037
 
878
1038
  class KlesFieldAbstract {
879
- constructor(viewRef) {
880
- this.viewRef = viewRef;
1039
+ constructor() {
1040
+ this.field = inject(FIELD);
1041
+ this.group = inject(GROUP);
1042
+ this.siblingFields = inject(SIBLING_FIELDS);
1043
+ this.ui = inject(GROUP_UI, { optional: true });
1044
+ this.appearance = computed(() => this.ui?.get(this.field.name)?.value()?.appearance);
1045
+ this.inputType = computed(() => this.ui?.get(this.field.name)?.value()?.inputType);
1046
+ this.min = computed(() => this.ui?.get(this.field.name)?.value()?.min);
1047
+ this.max = computed(() => this.ui?.get(this.field.name)?.value()?.max);
1048
+ this.maxLength = computed(() => this.ui?.get(this.field.name)?.value()?.maxLength);
1049
+ this.step = computed(() => this.ui?.get(this.field.name)?.value()?.step);
1050
+ this.ngClass = computed(() => this.ui?.get(this.field.name)?.value()?.ngClass);
1051
+ this.ngStyle = computed(() => this.ui?.get(this.field.name)?.value()?.ngStyle);
1052
+ this.indeterminate = computed(() => this.ui?.get(this.field.name)?.value()?.indeterminate ?? false);
1053
+ this.color = computed(() => this.ui?.get(this.field.name)?.value()?.color);
1054
+ this.icon = computed(() => this.ui?.get(this.field.name)?.value()?.icon);
1055
+ this.iconSvg = computed(() => this.ui?.get(this.field.name)?.value()?.iconSvg);
1056
+ this.viewRef = inject(ViewContainerRef);
881
1057
  this._onDestroy = new Subject();
1058
+ if (this.field.directive) {
1059
+ this.directive = new this.field.directive(this.viewRef, this);
1060
+ }
882
1061
  }
883
1062
  ngOnInit() {
884
- if (!this.field.appearance) {
885
- this.field.appearance = 'fill';
886
- }
887
1063
  if (this.field.valueChanges) {
888
1064
  this.field.valueChanges(this.field, this.group, this.siblingFields);
889
1065
  }
890
- this.group.controls[this.field.name]?.valueChanges
891
- .pipe(takeUntil(this._onDestroy))
892
- .subscribe(val => {
1066
+ this.group.controls[this.field.name]?.valueChanges.pipe(takeUntil$1(this._onDestroy)).subscribe((val) => {
893
1067
  if (this.field.valueChanges) {
894
1068
  this.field.valueChanges(this.field, this.group, this.siblingFields, val);
895
1069
  }
896
1070
  });
897
- if (this.field.directive) {
898
- this.directive = new this.field.directive(this.viewRef, this);
1071
+ if (this.directive) {
899
1072
  this.directive.ngOnInit();
900
1073
  }
901
1074
  }
@@ -920,10 +1093,10 @@ class KlesFieldAbstract {
920
1093
  if (control) {
921
1094
  const val = this.group.controls[this.field.name].value;
922
1095
  if (this.field.pipeTransform) {
923
- this.field.pipeTransform.forEach(p => {
1096
+ this.field.pipeTransform.forEach((p) => {
924
1097
  let pipeVal = control.value;
925
1098
  if (p.options) {
926
- p.options.forEach(opt => {
1099
+ p.options.forEach((opt) => {
927
1100
  pipeVal = p.pipe.transform(val, opt);
928
1101
  });
929
1102
  }
@@ -937,7 +1110,7 @@ class KlesFieldAbstract {
937
1110
  }
938
1111
  }
939
1112
  isPending() {
940
- return (this.group.controls[this.field.name].pending || this.field.pending);
1113
+ return this.group.controls[this.field.name].pending || this.field.pending;
941
1114
  }
942
1115
  onFocus() {
943
1116
  if (this.field?.onFocus) {
@@ -949,54 +1122,47 @@ class KlesFieldAbstract {
949
1122
  this.field.onBlur(this.field, this.group);
950
1123
  }
951
1124
  }
952
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFieldAbstract, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
953
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: KlesFieldAbstract, isStandalone: true, inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, host: { properties: { "attr.klesDirective": "this.directive" } }, ngImport: i0 }); }
1125
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFieldAbstract, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1126
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: KlesFieldAbstract, isStandalone: true, host: { properties: { "attr.klesDirective": "this.directive" } }, ngImport: i0 }); }
954
1127
  }
955
1128
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFieldAbstract, decorators: [{
956
1129
  type: Directive
957
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }], propDecorators: { field: [{
958
- type: Input
959
- }], group: [{
960
- type: Input
961
- }], siblingFields: [{
962
- type: Input
963
- }], directive: [{
1130
+ }], ctorParameters: () => [], propDecorators: { directive: [{
964
1131
  type: HostBinding,
965
1132
  args: ['attr.klesDirective']
966
1133
  }] } });
967
1134
 
968
1135
  class KlesFormLabelComponent extends KlesFieldAbstract {
969
- ngOnInit() {
1136
+ constructor() {
1137
+ super();
970
1138
  this.group.controls[this.field.name].disable({ emitEvent: false });
1139
+ }
1140
+ ngOnInit() {
971
1141
  super.ngOnInit();
972
1142
  }
973
1143
  ngOnDestroy() {
974
1144
  super.ngOnDestroy();
975
1145
  }
976
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormLabelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
977
1147
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormLabelComponent, isStandalone: true, selector: "kles-form-label", usesInheritance: true, ngImport: i0, template: `
978
- <div [formGroup]="group" >
979
- <input matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id"
980
- [ngClass]="field.ngClass"
981
- [ngStyle]="{'color':'inherit'}" [formControlName]="field.name" [placeholder]="field.placeholder" [type]="field.inputType">
982
- </div>
983
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
1148
+ <div [formGroup]="group">
1149
+ <input matInput matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [ngStyle]="{ color: 'inherit' }" [formControlName]="field.name" [placeholder]="field.placeholder" [type]="inputType()" />
1150
+ </div>
1151
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] }); }
984
1152
  }
985
1153
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormLabelComponent, decorators: [{
986
1154
  type: Component,
987
1155
  args: [{
988
- selector: "kles-form-label",
1156
+ selector: 'kles-form-label',
989
1157
  template: `
990
- <div [formGroup]="group" >
991
- <input matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id"
992
- [ngClass]="field.ngClass"
993
- [ngStyle]="{'color':'inherit'}" [formControlName]="field.name" [placeholder]="field.placeholder" [type]="field.inputType">
994
- </div>
995
- `,
1158
+ <div [formGroup]="group">
1159
+ <input matInput matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [ngStyle]="{ color: 'inherit' }" [formControlName]="field.name" [placeholder]="field.placeholder" [type]="inputType()" />
1160
+ </div>
1161
+ `,
996
1162
  standalone: true,
997
- imports: [CommonModule, ReactiveFormsModule, MatTooltip]
1163
+ imports: [CommonModule, ReactiveFormsModule, MatTooltip, MatInputModule],
998
1164
  }]
999
- }] });
1165
+ }], ctorParameters: () => [] });
1000
1166
 
1001
1167
  class MatErrorMessageDirective {
1002
1168
  set validations(v) {
@@ -1069,12 +1235,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1069
1235
  }] });
1070
1236
 
1071
1237
  let KlesFormInputComponent = class KlesFormInputComponent extends KlesFieldAbstract {
1072
- constructor(viewRef, intl) {
1073
- super(viewRef);
1074
- this.viewRef = viewRef;
1075
- this.intl = intl;
1238
+ constructor() {
1239
+ super();
1076
1240
  this.isFocused = new Subject();
1077
1241
  this.isLoading = signal(false);
1242
+ this.intl = inject(KlesDynamicFormIntl);
1243
+ if (this.maxLength() === undefined) {
1244
+ this.ui?.get(this.field.name)?.patchValue({ maxLength: 524288 }); // Max default input W3C
1245
+ }
1078
1246
  }
1079
1247
  ngOnInit() {
1080
1248
  if (this.field.lazy) {
@@ -1114,7 +1282,7 @@ let KlesFormInputComponent = class KlesFormInputComponent extends KlesFieldAbstr
1114
1282
  this.options$ = of({ loading: false, options: this.field.options });
1115
1283
  }
1116
1284
  }
1117
- this.filteredOption$ = concat(combineLatest([this.group.get(this.field.name).valueChanges.pipe(startWith('')), this.options$]).pipe(map(([data, response]) => {
1285
+ this.filteredOption$ = concat(combineLatest([this.group.get(this.field.name).valueChanges.pipe(startWith$1('')), this.options$]).pipe(map(([data, response]) => {
1118
1286
  if (response.loading) {
1119
1287
  return response;
1120
1288
  }
@@ -1122,9 +1290,6 @@ let KlesFormInputComponent = class KlesFormInputComponent extends KlesFieldAbstr
1122
1290
  return { loading: false, options: data && response.options ? this.filterData(data, response.options) : response.options };
1123
1291
  }
1124
1292
  })));
1125
- if (!this.field.maxLength) {
1126
- this.field.maxLength = 524288; // Max default input W3C
1127
- }
1128
1293
  super.ngOnInit();
1129
1294
  }
1130
1295
  onFocus() {
@@ -1160,83 +1325,94 @@ let KlesFormInputComponent = class KlesFormInputComponent extends KlesFieldAbstr
1160
1325
  ngOnDestroy() {
1161
1326
  super.ngOnDestroy();
1162
1327
  }
1163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormInputComponent, deps: [{ token: i0.ViewContainerRef }, { token: KlesDynamicFormIntl }], target: i0.ɵɵFactoryTarget.Component }); }
1328
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1164
1329
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormInputComponent, isStandalone: true, selector: "kles-form-input", usesInheritance: true, ngImport: i0, template: `
1165
- <mat-form-field [formGroup]="group" [color]="field.color" [subscriptSizing]="field.subscriptSizing" class="form-element" [appearance]="field.appearance" class="field-bottom">
1330
+ <mat-form-field [formGroup]="group" [color]="color()" [subscriptSizing]="field.subscriptSizing" class="form-element" [appearance]="appearance()" class="field-bottom">
1166
1331
  @if (field.label) {
1167
1332
  <mat-label>{{ field.label }}</mat-label>
1168
1333
  }
1169
- @if(field.icon){
1170
- <mat-icon matPrefix>{{ field.icon }}</mat-icon>
1334
+ @if (icon()) {
1335
+ <mat-icon matPrefix>{{ icon() }}</mat-icon>
1171
1336
  }
1172
-
1173
- @if (field.autocomplete) {
1174
- <input
1175
- matInput
1176
- matTooltip="{{ field.tooltip }}"
1177
- [attr.id]="field.id"
1178
- [ngClass]="field.ngClass"
1179
- [formControlName]="field.name"
1180
- [placeholder]="field.placeholder"
1181
- [type]="field.inputType"
1182
- [maxLength]="field.maxLength"
1183
- [min]="field.min"
1184
- [max]="field.max"
1185
- [step]="field.step"
1186
- [matAutocomplete]="auto"
1187
- (focus)="onFocus()"
1188
- (blur)="onBlur()"
1189
- />
1190
1337
 
1191
- <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
1192
- @if(filteredOption$ | async; as filteredOption){ @if(filteredOption.loading){
1193
- <mat-option disabled>
1194
- <div class="loadingSelect">
1195
- {{ intl.loading }}...
1196
- <mat-spinner class="spinner" diameter="20"></mat-spinner>
1197
- </div>
1198
- </mat-option>
1199
- }@else{ @if (!field.autocompleteComponent) { @for (option of filteredOption.options; track option) {
1200
- <mat-option [value]="option">
1201
- {{ field.property ? option[field.property] : option }}
1202
- </mat-option>
1203
- } } @else { @for (option of filteredOption.options; track option) {
1204
- <mat-option [value]="option">
1205
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
1206
- </mat-option>
1207
- } } } }
1208
- </mat-autocomplete>
1338
+ @if (field.autocomplete) {
1339
+ <input
1340
+ matInput
1341
+ matTooltip="{{ field.tooltip }}"
1342
+ [attr.id]="field.id"
1343
+ [ngClass]="ngClass()"
1344
+ [formControlName]="field.name"
1345
+ [placeholder]="field.placeholder"
1346
+ [type]="inputType()"
1347
+ [maxLength]="maxLength()"
1348
+ [min]="min()"
1349
+ [max]="max()"
1350
+ [step]="step()"
1351
+ [matAutocomplete]="auto"
1352
+ (focus)="onFocus()"
1353
+ (blur)="onBlur()"
1354
+ />
1355
+
1356
+ <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
1357
+ @if (filteredOption$ | async; as filteredOption) {
1358
+ @if (filteredOption.loading) {
1359
+ <mat-option disabled>
1360
+ <div class="loadingSelect">
1361
+ {{ intl.loading }}...
1362
+ <mat-spinner class="spinner" diameter="20"></mat-spinner>
1363
+ </div>
1364
+ </mat-option>
1365
+ } @else {
1366
+ @if (!field.autocompleteComponent) {
1367
+ @for (option of filteredOption.options; track option) {
1368
+ <mat-option [value]="option">
1369
+ {{ field.property ? option[field.property] : option }}
1370
+ </mat-option>
1371
+ }
1372
+ } @else {
1373
+ @for (option of filteredOption.options; track option) {
1374
+ <mat-option [value]="option">
1375
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
1376
+ </mat-option>
1377
+ }
1378
+ }
1379
+ }
1380
+ }
1381
+ </mat-autocomplete>
1209
1382
  } @else {
1210
- <input
1211
- matInput
1212
- matTooltip="{{ field.tooltip }}"
1213
- [attr.id]="field.id"
1214
- [ngClass]="field.ngClass"
1215
- [formControlName]="field.name"
1216
- [placeholder]="field.placeholder"
1217
- [type]="field.inputType"
1218
- [maxLength]="field.maxLength"
1219
- [min]="field.min"
1220
- [max]="field.max"
1221
- [step]="field.step"
1222
- (focus)="onFocus()"
1223
- (blur)="onBlur()"
1224
- />
1225
- } @if (field.hint) {
1226
- <mat-hint>{{ field.hint }}</mat-hint>
1227
- } @if (field.subComponents || field.clearable || isPending()) {
1228
- <div matSuffix class="suffix">
1229
- @if(isPending()){
1230
- <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
1231
- } @if(field.subComponents || field.clearable){
1232
- <ng-content></ng-content>
1233
- }
1234
- </div>
1383
+ <input
1384
+ matInput
1385
+ matTooltip="{{ field.tooltip }}"
1386
+ [attr.id]="field.id"
1387
+ [ngClass]="ngClass()"
1388
+ [formControlName]="field.name"
1389
+ [placeholder]="field.placeholder"
1390
+ [type]="inputType()"
1391
+ [maxLength]="maxLength()"
1392
+ [min]="min()"
1393
+ [max]="max()"
1394
+ [step]="step()"
1395
+ (focus)="onFocus()"
1396
+ (blur)="onBlur()"
1397
+ />
1398
+ }
1399
+ @if (field.hint) {
1400
+ <mat-hint>{{ field.hint }}</mat-hint>
1401
+ }
1402
+ @if (field.subComponents || field.clearable || isPending()) {
1403
+ <div matSuffix class="suffix">
1404
+ @if (isPending()) {
1405
+ <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
1406
+ }
1407
+ @if (field.subComponents || field.clearable) {
1408
+ <ng-content></ng-content>
1409
+ }
1410
+ </div>
1235
1411
  }
1236
1412
 
1237
1413
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1238
1414
  </mat-form-field>
1239
- `, isInline: true, styles: [".suffix{display:flex;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", ".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
1415
+ `, isInline: true, styles: [".suffix{display:flex;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", ".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
1240
1416
  };
1241
1417
  KlesFormInputComponent = __decorate([
1242
1418
  FieldMapper({ type: EnumType.input })
@@ -1244,82 +1420,93 @@ KlesFormInputComponent = __decorate([
1244
1420
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormInputComponent, decorators: [{
1245
1421
  type: Component,
1246
1422
  args: [{ selector: 'kles-form-input', template: `
1247
- <mat-form-field [formGroup]="group" [color]="field.color" [subscriptSizing]="field.subscriptSizing" class="form-element" [appearance]="field.appearance" class="field-bottom">
1423
+ <mat-form-field [formGroup]="group" [color]="color()" [subscriptSizing]="field.subscriptSizing" class="form-element" [appearance]="appearance()" class="field-bottom">
1248
1424
  @if (field.label) {
1249
1425
  <mat-label>{{ field.label }}</mat-label>
1250
1426
  }
1251
- @if(field.icon){
1252
- <mat-icon matPrefix>{{ field.icon }}</mat-icon>
1427
+ @if (icon()) {
1428
+ <mat-icon matPrefix>{{ icon() }}</mat-icon>
1253
1429
  }
1254
-
1255
- @if (field.autocomplete) {
1256
- <input
1257
- matInput
1258
- matTooltip="{{ field.tooltip }}"
1259
- [attr.id]="field.id"
1260
- [ngClass]="field.ngClass"
1261
- [formControlName]="field.name"
1262
- [placeholder]="field.placeholder"
1263
- [type]="field.inputType"
1264
- [maxLength]="field.maxLength"
1265
- [min]="field.min"
1266
- [max]="field.max"
1267
- [step]="field.step"
1268
- [matAutocomplete]="auto"
1269
- (focus)="onFocus()"
1270
- (blur)="onBlur()"
1271
- />
1272
1430
 
1273
- <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
1274
- @if(filteredOption$ | async; as filteredOption){ @if(filteredOption.loading){
1275
- <mat-option disabled>
1276
- <div class="loadingSelect">
1277
- {{ intl.loading }}...
1278
- <mat-spinner class="spinner" diameter="20"></mat-spinner>
1279
- </div>
1280
- </mat-option>
1281
- }@else{ @if (!field.autocompleteComponent) { @for (option of filteredOption.options; track option) {
1282
- <mat-option [value]="option">
1283
- {{ field.property ? option[field.property] : option }}
1284
- </mat-option>
1285
- } } @else { @for (option of filteredOption.options; track option) {
1286
- <mat-option [value]="option">
1287
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
1288
- </mat-option>
1289
- } } } }
1290
- </mat-autocomplete>
1431
+ @if (field.autocomplete) {
1432
+ <input
1433
+ matInput
1434
+ matTooltip="{{ field.tooltip }}"
1435
+ [attr.id]="field.id"
1436
+ [ngClass]="ngClass()"
1437
+ [formControlName]="field.name"
1438
+ [placeholder]="field.placeholder"
1439
+ [type]="inputType()"
1440
+ [maxLength]="maxLength()"
1441
+ [min]="min()"
1442
+ [max]="max()"
1443
+ [step]="step()"
1444
+ [matAutocomplete]="auto"
1445
+ (focus)="onFocus()"
1446
+ (blur)="onBlur()"
1447
+ />
1448
+
1449
+ <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
1450
+ @if (filteredOption$ | async; as filteredOption) {
1451
+ @if (filteredOption.loading) {
1452
+ <mat-option disabled>
1453
+ <div class="loadingSelect">
1454
+ {{ intl.loading }}...
1455
+ <mat-spinner class="spinner" diameter="20"></mat-spinner>
1456
+ </div>
1457
+ </mat-option>
1458
+ } @else {
1459
+ @if (!field.autocompleteComponent) {
1460
+ @for (option of filteredOption.options; track option) {
1461
+ <mat-option [value]="option">
1462
+ {{ field.property ? option[field.property] : option }}
1463
+ </mat-option>
1464
+ }
1465
+ } @else {
1466
+ @for (option of filteredOption.options; track option) {
1467
+ <mat-option [value]="option">
1468
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
1469
+ </mat-option>
1470
+ }
1471
+ }
1472
+ }
1473
+ }
1474
+ </mat-autocomplete>
1291
1475
  } @else {
1292
- <input
1293
- matInput
1294
- matTooltip="{{ field.tooltip }}"
1295
- [attr.id]="field.id"
1296
- [ngClass]="field.ngClass"
1297
- [formControlName]="field.name"
1298
- [placeholder]="field.placeholder"
1299
- [type]="field.inputType"
1300
- [maxLength]="field.maxLength"
1301
- [min]="field.min"
1302
- [max]="field.max"
1303
- [step]="field.step"
1304
- (focus)="onFocus()"
1305
- (blur)="onBlur()"
1306
- />
1307
- } @if (field.hint) {
1308
- <mat-hint>{{ field.hint }}</mat-hint>
1309
- } @if (field.subComponents || field.clearable || isPending()) {
1310
- <div matSuffix class="suffix">
1311
- @if(isPending()){
1312
- <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
1313
- } @if(field.subComponents || field.clearable){
1314
- <ng-content></ng-content>
1315
- }
1316
- </div>
1476
+ <input
1477
+ matInput
1478
+ matTooltip="{{ field.tooltip }}"
1479
+ [attr.id]="field.id"
1480
+ [ngClass]="ngClass()"
1481
+ [formControlName]="field.name"
1482
+ [placeholder]="field.placeholder"
1483
+ [type]="inputType()"
1484
+ [maxLength]="maxLength()"
1485
+ [min]="min()"
1486
+ [max]="max()"
1487
+ [step]="step()"
1488
+ (focus)="onFocus()"
1489
+ (blur)="onBlur()"
1490
+ />
1491
+ }
1492
+ @if (field.hint) {
1493
+ <mat-hint>{{ field.hint }}</mat-hint>
1494
+ }
1495
+ @if (field.subComponents || field.clearable || isPending()) {
1496
+ <div matSuffix class="suffix">
1497
+ @if (isPending()) {
1498
+ <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
1499
+ }
1500
+ @if (field.subComponents || field.clearable) {
1501
+ <ng-content></ng-content>
1502
+ }
1503
+ </div>
1317
1504
  }
1318
1505
 
1319
1506
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1320
1507
  </mat-form-field>
1321
1508
  `, standalone: true, imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatAutocompleteModule, MatTooltipModule, MatProgressSpinnerModule, MatOptionModule, MatError, MatErrorMessageDirective, KlesComponentDirective, MatIconModule], styles: [".suffix{display:flex;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", ".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", "mat-form-field{width:100%}\n"] }]
1322
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: KlesDynamicFormIntl }] });
1509
+ }], ctorParameters: () => [] });
1323
1510
 
1324
1511
  class KlesTransformPipe {
1325
1512
  transform(value, pipes) {
@@ -1351,13 +1538,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1351
1538
  }] });
1352
1539
 
1353
1540
  let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbstract {
1354
- constructor(viewRef, ref, intl) {
1355
- super(viewRef);
1356
- this.viewRef = viewRef;
1357
- this.ref = ref;
1358
- this.intl = intl;
1541
+ constructor() {
1542
+ super(...arguments);
1359
1543
  this.isLoading = false;
1360
1544
  this.openChange$ = new Subject();
1545
+ this.intl = inject(KlesDynamicFormIntl);
1546
+ this.ref = inject(ChangeDetectorRef);
1361
1547
  this.compareFn = (o1, o2) => {
1362
1548
  if (this.field.property && o1 && o2) {
1363
1549
  return o1[this.field.property] === o2[this.field.property];
@@ -1377,7 +1563,7 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1377
1563
  this.options$ = new BehaviorSubject([]);
1378
1564
  }
1379
1565
  this.openChange$
1380
- .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
1566
+ .pipe(takeUntil$1(this._onDestroy), switchMap((isOpen) => {
1381
1567
  if (isOpen) {
1382
1568
  if (this.field.options instanceof Observable) {
1383
1569
  this.isLoading = true;
@@ -1448,11 +1634,11 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1448
1634
  }
1449
1635
  }
1450
1636
  }
1451
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: KlesDynamicFormIntl }], target: i0.ɵɵFactoryTarget.Component }); }
1637
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1452
1638
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormSelectComponent, isStandalone: true, selector: "kles-form-select", viewQueries: [{ propertyName: "cdkVirtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "options", predicate: MatOption, descendants: true }], usesInheritance: true, ngImport: i0, template: `
1453
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
1639
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()" class="field-bottom">
1454
1640
  @if (field.label) {
1455
- <mat-label>{{ field.label }}</mat-label>
1641
+ <mat-label>{{ field.label }}</mat-label>
1456
1642
  }
1457
1643
  <mat-select
1458
1644
  matTooltip="{{ field.tooltip }}"
@@ -1460,7 +1646,7 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1460
1646
  (openedChange)="openChange($event)"
1461
1647
  [compareWith]="compareFn"
1462
1648
  [panelWidth]="field.panelWidth || 'auto'"
1463
- [ngClass]="field.ngClass"
1649
+ [ngClass]="ngClass()"
1464
1650
  [placeholder]="field.placeholder"
1465
1651
  [formControlName]="field.name"
1466
1652
  [multiple]="field.multiple"
@@ -1468,73 +1654,101 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1468
1654
  (blur)="onBlur()"
1469
1655
  >
1470
1656
  @if (field.triggerComponent) {
1471
- <mat-select-trigger>
1472
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
1473
- </mat-select-trigger>
1474
- } @if (!field.virtualScroll) { @if (!field.autocompleteComponent) { @if (!isLoading) { @for (item of options$ | async; track item) {
1475
- <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
1476
- } } @else {
1477
- <mat-option class="hide-checkbox" disabled
1478
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1479
- ></mat-option>
1480
- } } @else { @if (!isLoading) { @for (item of options$ | async; track item) {
1481
- <mat-option [value]="item" [disabled]="item?.disabled">
1482
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1483
- </mat-option>
1484
- } } @else {
1485
- <mat-option class="hide-checkbox" disabled
1486
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1487
- ></mat-option>
1488
- } } } @else {
1489
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="5 * 48">
1490
- @if (!field.autocompleteComponent) { @if (!isLoading) {
1491
- <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1492
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
1493
- </mat-option>
1494
- } @else {
1495
- <mat-option class="hide-checkbox" disabled
1496
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1497
- ></mat-option>
1498
- } @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
1499
- <mat-option [value]="item" style="display:none">
1500
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
1501
- </mat-option>
1502
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
1503
- <mat-option [value]="item" style="display:none">
1504
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
1505
- </mat-option>
1506
- } } } @else { @if (!isLoading) {
1507
- <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1508
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1509
- </mat-option>
1657
+ <mat-select-trigger>
1658
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
1659
+ </mat-select-trigger>
1660
+ }
1661
+ @if (!field.virtualScroll) {
1662
+ @if (!field.autocompleteComponent) {
1663
+ @if (!isLoading) {
1664
+ @for (item of options$ | async; track item) {
1665
+ <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
1666
+ }
1667
+ } @else {
1668
+ <mat-option class="hide-checkbox" disabled
1669
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1670
+ ></mat-option>
1671
+ }
1510
1672
  } @else {
1511
- <mat-option class="hide-checkbox" disabled
1512
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1513
- ></mat-option>
1514
- } @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
1515
- <mat-option [value]="item" style="display:none">
1516
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1517
- </mat-option>
1518
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
1519
- <mat-option [value]="item" style="display:none">
1520
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1521
- </mat-option>
1522
- } } }
1523
- </cdk-virtual-scroll-viewport>
1673
+ @if (!isLoading) {
1674
+ @for (item of options$ | async; track item) {
1675
+ <mat-option [value]="item" [disabled]="item?.disabled">
1676
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1677
+ </mat-option>
1678
+ }
1679
+ } @else {
1680
+ <mat-option class="hide-checkbox" disabled
1681
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1682
+ ></mat-option>
1683
+ }
1684
+ }
1685
+ } @else {
1686
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="5 * 48">
1687
+ @if (!field.autocompleteComponent) {
1688
+ @if (!isLoading) {
1689
+ <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1690
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
1691
+ </mat-option>
1692
+ } @else {
1693
+ <mat-option class="hide-checkbox" disabled
1694
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1695
+ ></mat-option>
1696
+ }
1697
+ @if (field.multiple) {
1698
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
1699
+ <mat-option [value]="item" style="display:none">
1700
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
1701
+ </mat-option>
1702
+ }
1703
+ }
1704
+ @if (!field.multiple && group.controls[field.name].value) {
1705
+ @for (item of [group?.controls[field.name]?.value]; track item) {
1706
+ <mat-option [value]="item" style="display:none">
1707
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
1708
+ </mat-option>
1709
+ }
1710
+ }
1711
+ } @else {
1712
+ @if (!isLoading) {
1713
+ <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1714
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1715
+ </mat-option>
1716
+ } @else {
1717
+ <mat-option class="hide-checkbox" disabled
1718
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1719
+ ></mat-option>
1720
+ }
1721
+ @if (field.multiple) {
1722
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
1723
+ <mat-option [value]="item" style="display:none">
1724
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1725
+ </mat-option>
1726
+ }
1727
+ }
1728
+ @if (!field.multiple && group.controls[field.name].value) {
1729
+ @for (item of [group?.controls[field.name]?.value]; track item) {
1730
+ <mat-option [value]="item" style="display:none">
1731
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1732
+ </mat-option>
1733
+ }
1734
+ }
1735
+ }
1736
+ </cdk-virtual-scroll-viewport>
1524
1737
  }
1525
1738
  </mat-select>
1526
1739
 
1527
1740
  @if (field.hint) {
1528
- <mat-hint>{{ field.hint }}</mat-hint>
1529
- } @if (field.subComponents || field.clearable) {
1530
- <div matSuffix>
1531
- <ng-content></ng-content>
1532
- </div>
1741
+ <mat-hint>{{ field.hint }}</mat-hint>
1742
+ }
1743
+ @if (field.subComponents || field.clearable) {
1744
+ <div matSuffix>
1745
+ <ng-content></ng-content>
1746
+ </div>
1533
1747
  }
1534
1748
 
1535
1749
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1536
1750
  </mat-form-field>
1537
- `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
1751
+ `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i4.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
1538
1752
  };
1539
1753
  KlesFormSelectComponent = __decorate([
1540
1754
  FieldMapper({ type: EnumType.select })
@@ -1542,9 +1756,9 @@ KlesFormSelectComponent = __decorate([
1542
1756
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectComponent, decorators: [{
1543
1757
  type: Component,
1544
1758
  args: [{ selector: 'kles-form-select', template: `
1545
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
1759
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()" class="field-bottom">
1546
1760
  @if (field.label) {
1547
- <mat-label>{{ field.label }}</mat-label>
1761
+ <mat-label>{{ field.label }}</mat-label>
1548
1762
  }
1549
1763
  <mat-select
1550
1764
  matTooltip="{{ field.tooltip }}"
@@ -1552,7 +1766,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1552
1766
  (openedChange)="openChange($event)"
1553
1767
  [compareWith]="compareFn"
1554
1768
  [panelWidth]="field.panelWidth || 'auto'"
1555
- [ngClass]="field.ngClass"
1769
+ [ngClass]="ngClass()"
1556
1770
  [placeholder]="field.placeholder"
1557
1771
  [formControlName]="field.name"
1558
1772
  [multiple]="field.multiple"
@@ -1560,74 +1774,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1560
1774
  (blur)="onBlur()"
1561
1775
  >
1562
1776
  @if (field.triggerComponent) {
1563
- <mat-select-trigger>
1564
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
1565
- </mat-select-trigger>
1566
- } @if (!field.virtualScroll) { @if (!field.autocompleteComponent) { @if (!isLoading) { @for (item of options$ | async; track item) {
1567
- <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
1568
- } } @else {
1569
- <mat-option class="hide-checkbox" disabled
1570
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1571
- ></mat-option>
1572
- } } @else { @if (!isLoading) { @for (item of options$ | async; track item) {
1573
- <mat-option [value]="item" [disabled]="item?.disabled">
1574
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1575
- </mat-option>
1576
- } } @else {
1577
- <mat-option class="hide-checkbox" disabled
1578
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1579
- ></mat-option>
1580
- } } } @else {
1581
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="5 * 48">
1582
- @if (!field.autocompleteComponent) { @if (!isLoading) {
1583
- <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1584
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
1585
- </mat-option>
1586
- } @else {
1587
- <mat-option class="hide-checkbox" disabled
1588
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1589
- ></mat-option>
1590
- } @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
1591
- <mat-option [value]="item" style="display:none">
1592
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
1593
- </mat-option>
1594
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
1595
- <mat-option [value]="item" style="display:none">
1596
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
1597
- </mat-option>
1598
- } } } @else { @if (!isLoading) {
1599
- <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1600
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1601
- </mat-option>
1777
+ <mat-select-trigger>
1778
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
1779
+ </mat-select-trigger>
1780
+ }
1781
+ @if (!field.virtualScroll) {
1782
+ @if (!field.autocompleteComponent) {
1783
+ @if (!isLoading) {
1784
+ @for (item of options$ | async; track item) {
1785
+ <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
1786
+ }
1787
+ } @else {
1788
+ <mat-option class="hide-checkbox" disabled
1789
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1790
+ ></mat-option>
1791
+ }
1602
1792
  } @else {
1603
- <mat-option class="hide-checkbox" disabled
1604
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1605
- ></mat-option>
1606
- } @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
1607
- <mat-option [value]="item" style="display:none">
1608
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1609
- </mat-option>
1610
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
1611
- <mat-option [value]="item" style="display:none">
1612
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1613
- </mat-option>
1614
- } } }
1615
- </cdk-virtual-scroll-viewport>
1793
+ @if (!isLoading) {
1794
+ @for (item of options$ | async; track item) {
1795
+ <mat-option [value]="item" [disabled]="item?.disabled">
1796
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1797
+ </mat-option>
1798
+ }
1799
+ } @else {
1800
+ <mat-option class="hide-checkbox" disabled
1801
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1802
+ ></mat-option>
1803
+ }
1804
+ }
1805
+ } @else {
1806
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="5 * 48">
1807
+ @if (!field.autocompleteComponent) {
1808
+ @if (!isLoading) {
1809
+ <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1810
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
1811
+ </mat-option>
1812
+ } @else {
1813
+ <mat-option class="hide-checkbox" disabled
1814
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1815
+ ></mat-option>
1816
+ }
1817
+ @if (field.multiple) {
1818
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
1819
+ <mat-option [value]="item" style="display:none">
1820
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
1821
+ </mat-option>
1822
+ }
1823
+ }
1824
+ @if (!field.multiple && group.controls[field.name].value) {
1825
+ @for (item of [group?.controls[field.name]?.value]; track item) {
1826
+ <mat-option [value]="item" style="display:none">
1827
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
1828
+ </mat-option>
1829
+ }
1830
+ }
1831
+ } @else {
1832
+ @if (!isLoading) {
1833
+ <mat-option *cdkVirtualFor="let item of options$ | async" [value]="item" [disabled]="item?.disabled">
1834
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1835
+ </mat-option>
1836
+ } @else {
1837
+ <mat-option class="hide-checkbox" disabled
1838
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
1839
+ ></mat-option>
1840
+ }
1841
+ @if (field.multiple) {
1842
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
1843
+ <mat-option [value]="item" style="display:none">
1844
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1845
+ </mat-option>
1846
+ }
1847
+ }
1848
+ @if (!field.multiple && group.controls[field.name].value) {
1849
+ @for (item of [group?.controls[field.name]?.value]; track item) {
1850
+ <mat-option [value]="item" style="display:none">
1851
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
1852
+ </mat-option>
1853
+ }
1854
+ }
1855
+ }
1856
+ </cdk-virtual-scroll-viewport>
1616
1857
  }
1617
1858
  </mat-select>
1618
1859
 
1619
1860
  @if (field.hint) {
1620
- <mat-hint>{{ field.hint }}</mat-hint>
1621
- } @if (field.subComponents || field.clearable) {
1622
- <div matSuffix>
1623
- <ng-content></ng-content>
1624
- </div>
1861
+ <mat-hint>{{ field.hint }}</mat-hint>
1862
+ }
1863
+ @if (field.subComponents || field.clearable) {
1864
+ <div matSuffix>
1865
+ <ng-content></ng-content>
1866
+ </div>
1625
1867
  }
1626
1868
 
1627
1869
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1628
1870
  </mat-form-field>
1629
- `, standalone: true, imports: [CommonModule, KlesTransformPipe, MatErrorMessageDirective, MatHint, KlesComponentDirective, MatOption, MatProgressSpinner, ScrollingModule, MatSelectModule, ReactiveFormsModule, MatTooltip], styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"] }]
1630
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: KlesDynamicFormIntl }], propDecorators: { cdkVirtualScrollViewport: [{
1871
+ `, standalone: true, imports: [CommonModule, KlesTransformPipe, MatErrorMessageDirective, MatFormFieldModule, MatHint, KlesComponentDirective, MatOption, MatProgressSpinner, ScrollingModule, MatSelectModule, ReactiveFormsModule, MatTooltip], styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"] }]
1872
+ }], propDecorators: { cdkVirtualScrollViewport: [{
1631
1873
  type: ViewChild,
1632
1874
  args: [CdkVirtualScrollViewport]
1633
1875
  }], options: [{
@@ -1636,52 +1878,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1636
1878
  }] } });
1637
1879
 
1638
1880
  class KlesFormDateComponent extends KlesFieldAbstract {
1639
- ngOnInit() { super.ngOnInit(); }
1881
+ ngOnInit() {
1882
+ super.ngOnInit();
1883
+ }
1640
1884
  ngOnDestroy() {
1641
1885
  super.ngOnDestroy();
1642
1886
  }
1643
1887
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1644
1888
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormDateComponent, isStandalone: true, selector: "kles-form-datepicker", usesInheritance: true, ngImport: i0, template: `
1645
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance">
1646
- @if (field.label) {
1647
- <mat-label>{{field.label}}</mat-label>
1648
- }
1649
- <input matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [matDatepicker]="picker" [formControlName]="field.name" [placeholder]="field.placeholder"
1650
- [min]="field.min" [max]="field.max">
1651
- <div matSuffix class="suffix">
1652
- <mat-datepicker-toggle [for]="picker"></mat-datepicker-toggle>
1653
- <ng-content></ng-content>
1654
- </div>
1655
- <mat-datepicker #picker></mat-datepicker>
1656
- @if (field.hint) {
1657
- <mat-hint>{{field.hint}}</mat-hint>
1658
- }
1889
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()">
1890
+ @if (field.label) {
1891
+ <mat-label>{{ field.label }}</mat-label>
1892
+ }
1893
+ <input matInput matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [matDatepicker]="picker" [formControlName]="field.name" [placeholder]="field.placeholder" [min]="field.min" [max]="field.max" />
1894
+ <div matSuffix class="suffix">
1895
+ <mat-datepicker-toggle [for]="picker"></mat-datepicker-toggle>
1896
+ <ng-content></ng-content>
1897
+ </div>
1898
+ <mat-datepicker #picker></mat-datepicker>
1899
+ @if (field.hint) {
1900
+ <mat-hint>{{ field.hint }}</mat-hint>
1901
+ }
1659
1902
 
1660
- <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1903
+ <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1661
1904
  </mat-form-field>
1662
- `, isInline: true, styles: ["mat-form-field{width:100%}\n", ".suffix{display:flex;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] }); }
1905
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n", ".suffix{display:flex;flex-direction:row}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
1663
1906
  }
1664
1907
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormDateComponent, decorators: [{
1665
1908
  type: Component,
1666
1909
  args: [{ selector: 'kles-form-datepicker', template: `
1667
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance">
1668
- @if (field.label) {
1669
- <mat-label>{{field.label}}</mat-label>
1670
- }
1671
- <input matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [matDatepicker]="picker" [formControlName]="field.name" [placeholder]="field.placeholder"
1672
- [min]="field.min" [max]="field.max">
1673
- <div matSuffix class="suffix">
1674
- <mat-datepicker-toggle [for]="picker"></mat-datepicker-toggle>
1675
- <ng-content></ng-content>
1676
- </div>
1677
- <mat-datepicker #picker></mat-datepicker>
1678
- @if (field.hint) {
1679
- <mat-hint>{{field.hint}}</mat-hint>
1680
- }
1910
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()">
1911
+ @if (field.label) {
1912
+ <mat-label>{{ field.label }}</mat-label>
1913
+ }
1914
+ <input matInput matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [matDatepicker]="picker" [formControlName]="field.name" [placeholder]="field.placeholder" [min]="field.min" [max]="field.max" />
1915
+ <div matSuffix class="suffix">
1916
+ <mat-datepicker-toggle [for]="picker"></mat-datepicker-toggle>
1917
+ <ng-content></ng-content>
1918
+ </div>
1919
+ <mat-datepicker #picker></mat-datepicker>
1920
+ @if (field.hint) {
1921
+ <mat-hint>{{ field.hint }}</mat-hint>
1922
+ }
1681
1923
 
1682
- <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1924
+ <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
1683
1925
  </mat-form-field>
1684
- `, standalone: true, imports: [CommonModule, MatErrorMessageDirective, MatError, MatHint, MatDatepickerModule, ReactiveFormsModule, MatTooltip, MatLabel, MatFormField, MatInput], styles: ["mat-form-field{width:100%}\n", ".suffix{display:flex;flex-direction:row}\n"] }]
1926
+ `, standalone: true, imports: [CommonModule, MatErrorMessageDirective, MatFormFieldModule, MatInputModule, MatTooltipModule, MatError, MatHint, MatDatepickerModule, ReactiveFormsModule, MatTooltip, MatLabel, MatFormField, MatInput], styles: ["mat-form-field{width:100%}\n", ".suffix{display:flex;flex-direction:row}\n"] }]
1685
1927
  }] });
1686
1928
 
1687
1929
  class KlesFormRadioComponent extends KlesFieldAbstract {
@@ -1704,7 +1946,7 @@ class KlesFormRadioComponent extends KlesFieldAbstract {
1704
1946
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormRadioComponent, isStandalone: true, selector: "kles-form-radiobutton", usesInheritance: true, ngImport: i0, template: `
1705
1947
  <div [formGroup]="group">
1706
1948
  <label class="radio-label-padding">{{field.label}}</label>
1707
- <mat-radio-group matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [formControlName]="field.name">
1949
+ <mat-radio-group matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="ngClass()" [formControlName]="field.name">
1708
1950
  @for (item of options$ | async; track item) {
1709
1951
  <mat-radio-button [value]="item">{{item}}</mat-radio-button>
1710
1952
  }
@@ -1717,7 +1959,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1717
1959
  args: [{ selector: 'kles-form-radiobutton', template: `
1718
1960
  <div [formGroup]="group">
1719
1961
  <label class="radio-label-padding">{{field.label}}</label>
1720
- <mat-radio-group matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [formControlName]="field.name">
1962
+ <mat-radio-group matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="ngClass()" [formControlName]="field.name">
1721
1963
  @for (item of options$ | async; track item) {
1722
1964
  <mat-radio-button [value]="item">{{item}}</mat-radio-button>
1723
1965
  }
@@ -1733,10 +1975,14 @@ let KlesFormCheckboxComponent = class KlesFormCheckboxComponent extends KlesFiel
1733
1975
  ngOnDestroy() {
1734
1976
  super.ngOnDestroy();
1735
1977
  }
1978
+ onChange(e) {
1979
+ this.ui?.get(this.field.name)?.patchValue({ indeterminate: false });
1980
+ }
1736
1981
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1737
1982
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormCheckboxComponent, isStandalone: true, selector: "kles-form-checkbox", usesInheritance: true, ngImport: i0, template: `
1983
+ {{ indeterminate() }}
1738
1984
  <div [formGroup]="group">
1739
- <mat-checkbox matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [(indeterminate)]="field.indeterminate" [color]="field.color" [formControlName]="field.name">{{ field.label }}</mat-checkbox>
1985
+ <mat-checkbox matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [indeterminate]="indeterminate()" (change)="onChange($event)" [color]="color()" [formControlName]="field.name">{{ field.label }}</mat-checkbox>
1740
1986
  </div>
1741
1987
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
1742
1988
  };
@@ -1746,8 +1992,9 @@ KlesFormCheckboxComponent = __decorate([
1746
1992
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCheckboxComponent, decorators: [{
1747
1993
  type: Component,
1748
1994
  args: [{ selector: 'kles-form-checkbox', template: `
1995
+ {{ indeterminate() }}
1749
1996
  <div [formGroup]="group">
1750
- <mat-checkbox matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [(indeterminate)]="field.indeterminate" [color]="field.color" [formControlName]="field.name">{{ field.label }}</mat-checkbox>
1997
+ <mat-checkbox matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [indeterminate]="indeterminate()" (change)="onChange($event)" [color]="color()" [formControlName]="field.name">{{ field.label }}</mat-checkbox>
1751
1998
  </div>
1752
1999
  `, standalone: true, imports: [CommonModule, ReactiveFormsModule, MatCheckbox, MatTooltip] }]
1753
2000
  }] });
@@ -1805,11 +2052,10 @@ class KlesFormArray extends KlesFormControl {
1805
2052
  }
1806
2053
 
1807
2054
  let KlesFormListFieldComponent = class KlesFormListFieldComponent extends KlesFieldAbstract {
1808
- constructor(fb, viewRef) {
1809
- super(viewRef);
1810
- this.fb = fb;
1811
- this.viewRef = viewRef;
2055
+ constructor() {
2056
+ super(...arguments);
1812
2057
  this.collections = [];
2058
+ this.fb = inject(UntypedFormBuilder);
1813
2059
  }
1814
2060
  ngOnInit() {
1815
2061
  this.formArray = this.group.controls[this.field.name];
@@ -1857,7 +2103,7 @@ let KlesFormListFieldComponent = class KlesFormListFieldComponent extends KlesFi
1857
2103
  ngOnDestroy() {
1858
2104
  super.ngOnDestroy();
1859
2105
  }
1860
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormListFieldComponent, deps: [{ token: i2.UntypedFormBuilder }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
2106
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormListFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1861
2107
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormListFieldComponent, isStandalone: true, selector: "kles-form-listfield", usesInheritance: true, ngImport: i0, template: `
1862
2108
  <div [formGroup]="group" class="form-element">
1863
2109
  <div class="label">
@@ -1868,32 +2114,35 @@ let KlesFormListFieldComponent = class KlesFormListFieldComponent extends KlesFi
1868
2114
  </div>
1869
2115
 
1870
2116
  <div class="dynamic-form" [formGroupName]="field.name">
1871
- @for (subGroup of formArray.controls; track subGroup.value._id; let idx = $index;) {
1872
- <div class="subfields">
1873
- @for (subfield of collections[idx]; track subfield.name) {
1874
- <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="collections[idx]"> </ng-container>
1875
- } @if(collections[idx]){
1876
- <button mat-icon-button (click)="deleteField(idx)" color="primary">
1877
- <mat-icon>delete_outlined</mat-icon>
1878
- </button>
1879
- }
1880
- </div>
1881
- } @for (validation of field.validations; track validation.name) {
1882
- <ng-container ngProjectAs="mat-error">
1883
- @if (group.get(field.name).hasError(validation.name)) {
1884
- <mat-error>{{ validation.message }}</mat-error>
1885
- }
1886
- </ng-container>
1887
- } @for (validation of field.asyncValidations; track validation.name) {
1888
- <ng-container ngProjectAs="mat-error">
1889
- @if (group.get(field.name).hasError(validation.name)) {
1890
- <mat-error>{{ validation.message }}</mat-error>
1891
- }
1892
- </ng-container>
2117
+ @for (subGroup of formArray.controls; track subGroup.value._id; let idx = $index) {
2118
+ <div class="subfields">
2119
+ @for (subfield of collections[idx]; track subfield.name) {
2120
+ <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="collections[idx]"> </ng-container>
2121
+ }
2122
+ @if (collections[idx]) {
2123
+ <button mat-icon-button (click)="deleteField(idx)" color="primary">
2124
+ <mat-icon>delete_outlined</mat-icon>
2125
+ </button>
2126
+ }
2127
+ </div>
2128
+ }
2129
+ @for (validation of field.validations; track validation.name) {
2130
+ <ng-container ngProjectAs="mat-error">
2131
+ @if (group.get(field.name).hasError(validation.name)) {
2132
+ <mat-error>{{ validation.message }}</mat-error>
2133
+ }
2134
+ </ng-container>
2135
+ }
2136
+ @for (validation of field.asyncValidations; track validation.name) {
2137
+ <ng-container ngProjectAs="mat-error">
2138
+ @if (group.get(field.name).hasError(validation.name)) {
2139
+ <mat-error>{{ validation.message }}</mat-error>
2140
+ }
2141
+ </ng-container>
1893
2142
  }
1894
2143
  </div>
1895
2144
  </div>
1896
- `, isInline: true, styles: [".subfields{display:flex;flex-direction:row;gap:5px}\n", ".label{display:flex;align-items:center;flex-direction:row;gap:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "siblingFields"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }] }); }
2145
+ `, isInline: true, styles: [".subfields{display:flex;flex-direction:row;gap:5px}\n", ".label{display:flex;align-items:center;flex-direction:row;gap:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "ui", "siblingFields"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }] }); }
1897
2146
  };
1898
2147
  KlesFormListFieldComponent = __decorate([
1899
2148
  FieldMapper({ type: 'listfield', factory: (field) => new KlesFormArray(field).create() })
@@ -1910,33 +2159,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1910
2159
  </div>
1911
2160
 
1912
2161
  <div class="dynamic-form" [formGroupName]="field.name">
1913
- @for (subGroup of formArray.controls; track subGroup.value._id; let idx = $index;) {
1914
- <div class="subfields">
1915
- @for (subfield of collections[idx]; track subfield.name) {
1916
- <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="collections[idx]"> </ng-container>
1917
- } @if(collections[idx]){
1918
- <button mat-icon-button (click)="deleteField(idx)" color="primary">
1919
- <mat-icon>delete_outlined</mat-icon>
1920
- </button>
1921
- }
1922
- </div>
1923
- } @for (validation of field.validations; track validation.name) {
1924
- <ng-container ngProjectAs="mat-error">
1925
- @if (group.get(field.name).hasError(validation.name)) {
1926
- <mat-error>{{ validation.message }}</mat-error>
1927
- }
1928
- </ng-container>
1929
- } @for (validation of field.asyncValidations; track validation.name) {
1930
- <ng-container ngProjectAs="mat-error">
1931
- @if (group.get(field.name).hasError(validation.name)) {
1932
- <mat-error>{{ validation.message }}</mat-error>
1933
- }
1934
- </ng-container>
2162
+ @for (subGroup of formArray.controls; track subGroup.value._id; let idx = $index) {
2163
+ <div class="subfields">
2164
+ @for (subfield of collections[idx]; track subfield.name) {
2165
+ <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="collections[idx]"> </ng-container>
2166
+ }
2167
+ @if (collections[idx]) {
2168
+ <button mat-icon-button (click)="deleteField(idx)" color="primary">
2169
+ <mat-icon>delete_outlined</mat-icon>
2170
+ </button>
2171
+ }
2172
+ </div>
2173
+ }
2174
+ @for (validation of field.validations; track validation.name) {
2175
+ <ng-container ngProjectAs="mat-error">
2176
+ @if (group.get(field.name).hasError(validation.name)) {
2177
+ <mat-error>{{ validation.message }}</mat-error>
2178
+ }
2179
+ </ng-container>
2180
+ }
2181
+ @for (validation of field.asyncValidations; track validation.name) {
2182
+ <ng-container ngProjectAs="mat-error">
2183
+ @if (group.get(field.name).hasError(validation.name)) {
2184
+ <mat-error>{{ validation.message }}</mat-error>
2185
+ }
2186
+ </ng-container>
1935
2187
  }
1936
2188
  </div>
1937
2189
  </div>
1938
2190
  `, standalone: true, imports: [CommonModule, MatError, MatIcon, KlesDynamicFieldDirective, ReactiveFormsModule], styles: [".subfields{display:flex;flex-direction:row;gap:5px}\n", ".label{display:flex;align-items:center;flex-direction:row;gap:5px}\n"] }]
1939
- }], ctorParameters: () => [{ type: i2.UntypedFormBuilder }, { type: i0.ViewContainerRef }] });
2191
+ }] });
1940
2192
 
1941
2193
  class KlesFormColorComponent extends KlesFieldAbstract {
1942
2194
  ngOnInit() {
@@ -2013,13 +2265,13 @@ class KlesFormColorComponent extends KlesFieldAbstract {
2013
2265
  [cpColorMode]="field.colorOption.mode"
2014
2266
  [cpOutputFormat]="field.colorOption.format"
2015
2267
  [cpPositionOffset]="field.colorOption.positionOffset"
2016
- [appearance]="field.appearance"
2268
+ [appearance]="appearance()"
2017
2269
  >
2018
2270
  <input
2019
2271
  matInput
2020
2272
  matTooltip="{{ field.tooltip }}"
2021
2273
  [attr.id]="field.id"
2022
- [ngClass]="field.ngClass"
2274
+ [ngClass]="ngClass()"
2023
2275
  [placeholder]="field.placeholder"
2024
2276
  [value]="group.get(field.name).value"
2025
2277
  class="colorPicker"
@@ -2051,13 +2303,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
2051
2303
  [cpColorMode]="field.colorOption.mode"
2052
2304
  [cpOutputFormat]="field.colorOption.format"
2053
2305
  [cpPositionOffset]="field.colorOption.positionOffset"
2054
- [appearance]="field.appearance"
2306
+ [appearance]="appearance()"
2055
2307
  >
2056
2308
  <input
2057
2309
  matInput
2058
2310
  matTooltip="{{ field.tooltip }}"
2059
2311
  [attr.id]="field.id"
2060
- [ngClass]="field.ngClass"
2312
+ [ngClass]="ngClass()"
2061
2313
  [placeholder]="field.placeholder"
2062
2314
  [value]="group.get(field.name).value"
2063
2315
  class="colorPicker"
@@ -2268,13 +2520,13 @@ class KlesFormButtonComponent extends KlesFieldAbstract {
2268
2520
  <div [formGroup]="group">
2269
2521
  <kles-button
2270
2522
  [attr.id]="field.id"
2271
- [classButton]="field.ngClass"
2523
+ [classButton]="ngClass()"
2272
2524
  [name]="field.name"
2273
2525
  [label]="field.label"
2274
- [color]="field.color"
2526
+ [color]="color()"
2275
2527
  [attribute]="field.attribute"
2276
- [icon]="field.icon"
2277
- [iconSvg]="field.iconSvg"
2528
+ [icon]="icon()"
2529
+ [iconSvg]="iconSvg()"
2278
2530
  [value]="field.value"
2279
2531
  [formControlName]="field.name"
2280
2532
  [tooltip]="field.tooltip"
@@ -2290,13 +2542,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
2290
2542
  <div [formGroup]="group">
2291
2543
  <kles-button
2292
2544
  [attr.id]="field.id"
2293
- [classButton]="field.ngClass"
2545
+ [classButton]="ngClass()"
2294
2546
  [name]="field.name"
2295
2547
  [label]="field.label"
2296
- [color]="field.color"
2548
+ [color]="color()"
2297
2549
  [attribute]="field.attribute"
2298
- [icon]="field.icon"
2299
- [iconSvg]="field.iconSvg"
2550
+ [icon]="icon()"
2551
+ [iconSvg]="iconSvg()"
2300
2552
  [value]="field.value"
2301
2553
  [formControlName]="field.name"
2302
2554
  [tooltip]="field.tooltip"
@@ -2392,10 +2644,10 @@ class KlesFormButtonCheckerComponent extends KlesFieldAbstract {
2392
2644
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormButtonCheckerComponent, isStandalone: true, selector: "kles-form-button-checker", usesInheritance: true, ngImport: i0, template: `
2393
2645
  <div [formGroup]="group">
2394
2646
  <kles-button-checker
2395
- [attr.id]="field.id" [classButton]="field.ngClass"
2396
- [name]="field.name" [label]="field.label" [color]="field.color"
2397
- [icon]="field.icon"
2398
- [iconSvg]="field.iconSvg"
2647
+ [attr.id]="field.id" [classButton]="ngClass()"
2648
+ [name]="field.name" [label]="field.label" [color]="color()"
2649
+ [icon]="icon()"
2650
+ [iconSvg]="iconSvg()"
2399
2651
  [value]="field.value"
2400
2652
  [formControlName]="field.name"
2401
2653
  [tooltip]="field.tooltip"
@@ -2410,10 +2662,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
2410
2662
  args: [{ selector: 'kles-form-button-checker', template: `
2411
2663
  <div [formGroup]="group">
2412
2664
  <kles-button-checker
2413
- [attr.id]="field.id" [classButton]="field.ngClass"
2414
- [name]="field.name" [label]="field.label" [color]="field.color"
2415
- [icon]="field.icon"
2416
- [iconSvg]="field.iconSvg"
2665
+ [attr.id]="field.id" [classButton]="ngClass()"
2666
+ [name]="field.name" [label]="field.label" [color]="color()"
2667
+ [icon]="icon()"
2668
+ [iconSvg]="iconSvg()"
2417
2669
  [value]="field.value"
2418
2670
  [formControlName]="field.name"
2419
2671
  [tooltip]="field.tooltip"
@@ -2557,12 +2809,12 @@ class KlesFormButtonFileComponent extends KlesFieldAbstract {
2557
2809
  <div [formGroup]="group">
2558
2810
  <kles-button-file
2559
2811
  [attr.id]="field.id"
2560
- [classButton]="field.ngClass"
2812
+ [classButton]="ngClass()"
2561
2813
  [name]="field.name"
2562
2814
  [label]="field.label"
2563
- [color]="field.color"
2564
- [icon]="field.icon"
2565
- [iconSvg]="field.iconSvg"
2815
+ [color]="color()"
2816
+ [icon]="icon()"
2817
+ [iconSvg]="iconSvg()"
2566
2818
  [value]="field.value"
2567
2819
  [formControlName]="field.name"
2568
2820
  [type]="field.buttonType"
@@ -2579,12 +2831,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
2579
2831
  <div [formGroup]="group">
2580
2832
  <kles-button-file
2581
2833
  [attr.id]="field.id"
2582
- [classButton]="field.ngClass"
2834
+ [classButton]="ngClass()"
2583
2835
  [name]="field.name"
2584
2836
  [label]="field.label"
2585
- [color]="field.color"
2586
- [icon]="field.icon"
2587
- [iconSvg]="field.iconSvg"
2837
+ [color]="color()"
2838
+ [icon]="icon()"
2839
+ [iconSvg]="iconSvg()"
2588
2840
  [value]="field.value"
2589
2841
  [formControlName]="field.name"
2590
2842
  [type]="field.buttonType"
@@ -2605,14 +2857,14 @@ class KlesFormTextareaComponent extends KlesFieldAbstract {
2605
2857
  }
2606
2858
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2607
2859
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormTextareaComponent, isStandalone: true, selector: "kles-form-textarea", usesInheritance: true, ngImport: i0, template: `
2608
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="field.color" class="form-element" [appearance]="field.appearance">
2860
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="color()" class="form-element" [appearance]="appearance()">
2609
2861
  @if (field.label) {
2610
2862
  <mat-label>{{field.label}}</mat-label>
2611
2863
  }
2612
2864
 
2613
- <textarea matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
2865
+ <textarea matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="ngClass()"
2614
2866
  [formControlName]="field.name" cdkTextareaAutosize [placeholder]="field.placeholder"
2615
- [cdkAutosizeMinRows]="field.textareaAutoSize?.minRows" [cdkAutosizeMaxRows]="field.textareaAutoSize?.maxRows" [maxlength]="field.maxLength">
2867
+ [cdkAutosizeMinRows]="field.textareaAutoSize?.minRows" [cdkAutosizeMaxRows]="field.textareaAutoSize?.maxRows" [maxlength]="maxLength()">
2616
2868
  </textarea>
2617
2869
 
2618
2870
  @if (field.subComponents || field.clearable) {
@@ -2623,19 +2875,19 @@ class KlesFormTextareaComponent extends KlesFieldAbstract {
2623
2875
 
2624
2876
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
2625
2877
  </mat-form-field>
2626
- `, isInline: true, styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "directive", type: i3$2.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] }); }
2878
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "directive", type: i3$3.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] }); }
2627
2879
  }
2628
2880
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormTextareaComponent, decorators: [{
2629
2881
  type: Component,
2630
2882
  args: [{ selector: 'kles-form-textarea', template: `
2631
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="field.color" class="form-element" [appearance]="field.appearance">
2883
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="color()" class="form-element" [appearance]="appearance()">
2632
2884
  @if (field.label) {
2633
2885
  <mat-label>{{field.label}}</mat-label>
2634
2886
  }
2635
2887
 
2636
- <textarea matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
2888
+ <textarea matInput matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="ngClass()"
2637
2889
  [formControlName]="field.name" cdkTextareaAutosize [placeholder]="field.placeholder"
2638
- [cdkAutosizeMinRows]="field.textareaAutoSize?.minRows" [cdkAutosizeMaxRows]="field.textareaAutoSize?.maxRows" [maxlength]="field.maxLength">
2890
+ [cdkAutosizeMinRows]="field.textareaAutoSize?.minRows" [cdkAutosizeMaxRows]="field.textareaAutoSize?.maxRows" [maxlength]="maxLength()">
2639
2891
  </textarea>
2640
2892
 
2641
2893
  @if (field.subComponents || field.clearable) {
@@ -2658,13 +2910,13 @@ let KlesFormTextComponent = class KlesFormTextComponent extends KlesFieldAbstrac
2658
2910
  }
2659
2911
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2660
2912
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormTextComponent, isStandalone: true, selector: "kles-form-text", usesInheritance: true, ngImport: i0, template: `
2661
- <span matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [ngStyle]="field.ngStyle">
2662
- {{((field.property && group.controls[field.name].value) ? group.controls[field.name].value[field.property] : group.controls[field.name].value) | klesTransform:field.pipeTransform}}
2913
+ <span matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [ngStyle]="ngStyle()">
2914
+ {{ (field.property && group.controls[field.name].value ? group.controls[field.name].value[field.property] : group.controls[field.name].value) | klesTransform: field.pipeTransform }}
2663
2915
  </span>
2664
2916
  @if (field.subComponents || isPending()) {
2665
- <ng-content></ng-content>
2917
+ <ng-content></ng-content>
2666
2918
  }
2667
- `, isInline: true, styles: [":host{display:flex;align-items:center;flex-direction:row;justify-content:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
2919
+ `, isInline: true, styles: [":host{display:flex;align-items:center;flex-direction:row;justify-content:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
2668
2920
  };
2669
2921
  KlesFormTextComponent = __decorate([
2670
2922
  FieldMapper({ type: EnumType.text })
@@ -2672,13 +2924,13 @@ KlesFormTextComponent = __decorate([
2672
2924
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormTextComponent, decorators: [{
2673
2925
  type: Component,
2674
2926
  args: [{ selector: 'kles-form-text', template: `
2675
- <span matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [ngStyle]="field.ngStyle">
2676
- {{((field.property && group.controls[field.name].value) ? group.controls[field.name].value[field.property] : group.controls[field.name].value) | klesTransform:field.pipeTransform}}
2927
+ <span matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [ngStyle]="ngStyle()">
2928
+ {{ (field.property && group.controls[field.name].value ? group.controls[field.name].value[field.property] : group.controls[field.name].value) | klesTransform: field.pipeTransform }}
2677
2929
  </span>
2678
2930
  @if (field.subComponents || isPending()) {
2679
- <ng-content></ng-content>
2931
+ <ng-content></ng-content>
2680
2932
  }
2681
- `, standalone: true, imports: [CommonModule, KlesTransformPipe, MatTooltip], styles: [":host{display:flex;align-items:center;flex-direction:row;justify-content:inherit}\n"] }]
2933
+ `, standalone: true, imports: [CommonModule, KlesTransformPipe, MatTooltip, ReactiveFormsModule], styles: [":host{display:flex;align-items:center;flex-direction:row;justify-content:inherit}\n"] }]
2682
2934
  }] });
2683
2935
 
2684
2936
  class KlesFormChipComponent extends KlesFieldAbstract {
@@ -2690,9 +2942,9 @@ class KlesFormChipComponent extends KlesFieldAbstract {
2690
2942
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormChipComponent, isStandalone: true, selector: "kles-form-chip", usesInheritance: true, ngImport: i0, template: `
2691
2943
  <div [formGroup]="group">
2692
2944
  <mat-chip-listbox>
2693
- <mat-chip-option [color]="field.color" matTooltip="{{field.tooltip}}" [attr.id]="field.id" selected [ngClass]="field.ngClass" [ngStyle]="field.ngStyle">
2694
- @if (field.icon) {
2695
- <mat-icon>{{field.icon}}</mat-icon>
2945
+ <mat-chip-option [color]="color()" matTooltip="{{field.tooltip}}" [attr.id]="field.id" selected [ngClass]="ngClass()" [ngStyle]="ngStyle()">
2946
+ @if (icon()) {
2947
+ <mat-icon>{{icon()}}</mat-icon>
2696
2948
  }
2697
2949
  {{group.controls[field.name].value | klesTransform:field.pipeTransform}}
2698
2950
  </mat-chip-option>
@@ -2705,9 +2957,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
2705
2957
  args: [{ selector: "kles-form-chip", template: `
2706
2958
  <div [formGroup]="group">
2707
2959
  <mat-chip-listbox>
2708
- <mat-chip-option [color]="field.color" matTooltip="{{field.tooltip}}" [attr.id]="field.id" selected [ngClass]="field.ngClass" [ngStyle]="field.ngStyle">
2709
- @if (field.icon) {
2710
- <mat-icon>{{field.icon}}</mat-icon>
2960
+ <mat-chip-option [color]="color()" matTooltip="{{field.tooltip}}" [attr.id]="field.id" selected [ngClass]="ngClass()" [ngStyle]="ngStyle()">
2961
+ @if (icon()) {
2962
+ <mat-icon>{{icon()}}</mat-icon>
2711
2963
  }
2712
2964
  {{group.controls[field.name].value | klesTransform:field.pipeTransform}}
2713
2965
  </mat-chip-option>
@@ -2759,6 +3011,29 @@ class KlesFormGroup extends KlesFormControl {
2759
3011
  }
2760
3012
  }
2761
3013
 
3014
+ class KlesFormUiGroup extends KlesFormUiControl {
3015
+ create() {
3016
+ const subGroup = new GroupUiState();
3017
+ if (this.field.collections && Array.isArray(this.field.collections)) {
3018
+ this.field.collections.forEach((subfield) => {
3019
+ let ui;
3020
+ if (subfield.type) {
3021
+ ui =
3022
+ componentMapper.find((c) => c.type === subfield.type)?.ui({ ...subfield, value: subfield.value || this.field.value?.[subfield.name] }) ||
3023
+ klesFieldUiFactory({ ...subfield, value: subfield.value || this.field.value?.[subfield.name] });
3024
+ }
3025
+ else {
3026
+ ui =
3027
+ componentMapper.find((c) => c.component === subfield.component)?.ui({ ...subfield, value: subfield.value || this.field.value?.[subfield.name] }) ||
3028
+ klesFieldUiFactory({ ...subfield, value: subfield.value || this.field.value?.[subfield.name] });
3029
+ }
3030
+ subGroup.addUiState(subfield.name, ui);
3031
+ });
3032
+ }
3033
+ return subGroup;
3034
+ }
3035
+ }
3036
+
2762
3037
  let KlesFormGroupComponent = class KlesFormGroupComponent extends KlesFieldAbstract {
2763
3038
  constructor() {
2764
3039
  super(...arguments);
@@ -2769,6 +3044,7 @@ let KlesFormGroupComponent = class KlesFormGroupComponent extends KlesFieldAbstr
2769
3044
  }
2770
3045
  ngOnInit() {
2771
3046
  this.subGroup = this.group.controls[this.field.name];
3047
+ this.subUi = this.ui?.get(this.field.name);
2772
3048
  super.ngOnInit();
2773
3049
  this.setOrientationClass();
2774
3050
  }
@@ -2795,214 +3071,234 @@ let KlesFormGroupComponent = class KlesFormGroupComponent extends KlesFieldAbstr
2795
3071
  }
2796
3072
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2797
3073
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormGroupComponent, isStandalone: true, selector: "kles-group", host: { properties: { "formGroup": "group", "formGroupName": "field.name", "class": "this.className" } }, usesInheritance: true, ngImport: i0, template: `
2798
- @if(field.label){
2799
- <h4><span [matTooltip]="field.tooltip || ''" >{{field.label}}</span></h4>
3074
+ @if (field.label) {
3075
+ <h4>
3076
+ <span [matTooltip]="field.tooltip || ''">{{ field.label }}</span>
3077
+ </h4>
2800
3078
  }
2801
-
3079
+
2802
3080
  @for (subfield of field.collections; track subfield.name) {
2803
3081
  @if (subfield.visible !== false) {
2804
- <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="field.collections">
2805
- </ng-container>
3082
+ <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="field.collections" [ui]="subUi"> </ng-container>
2806
3083
  }
2807
3084
  }
2808
- `, isInline: true, styles: ["mat-form-field{width:100%}\n", ":host.group-container{display:flex;flex-direction:inherit;width:inherit;justify-content:inherit}\n", ":host.group-container-column{display:flex;flex-direction:column;justify-content:inherit}\n", ":host.group-container-column>*{width:100%}\n", ":host.group-container-row{display:inline-flex;flex-wrap:wrap;gap:10px;align-items:baseline;justify-content:inherit}\n", ":host.group-container-row>*{width:100%}\n", ":host.group-container-grid{display:grid}\n", ":host.group-container-inline-grid{display:inline-grid}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "siblingFields"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
3085
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n", ":host.group-container{display:flex;flex-direction:inherit;width:inherit;justify-content:inherit}\n", ":host.group-container-column{display:flex;flex-direction:column;justify-content:inherit}\n", ":host.group-container-column>*{width:100%}\n", ":host.group-container-row{display:inline-flex;flex-wrap:wrap;gap:10px;align-items:baseline;justify-content:inherit}\n", ":host.group-container-row>*{width:100%}\n", ":host.group-container-grid{display:grid}\n", ":host.group-container-inline-grid{display:inline-grid}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "ui", "siblingFields"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
2809
3086
  };
2810
3087
  KlesFormGroupComponent = __decorate([
2811
- FieldMapper({ type: EnumType.group, factory: (field) => (new KlesFormGroup(field).create()) })
3088
+ FieldMapper({ type: EnumType.group, factory: (field) => new KlesFormGroup(field).create(), ui: (field) => new KlesFormUiGroup(field).create() })
2812
3089
  ], KlesFormGroupComponent);
2813
3090
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormGroupComponent, decorators: [{
2814
3091
  type: Component,
2815
3092
  args: [{ host: { '[formGroup]': 'group', '[formGroupName]': 'field.name' }, selector: 'kles-group', template: `
2816
- @if(field.label){
2817
- <h4><span [matTooltip]="field.tooltip || ''" >{{field.label}}</span></h4>
3093
+ @if (field.label) {
3094
+ <h4>
3095
+ <span [matTooltip]="field.tooltip || ''">{{ field.label }}</span>
3096
+ </h4>
2818
3097
  }
2819
-
3098
+
2820
3099
  @for (subfield of field.collections; track subfield.name) {
2821
3100
  @if (subfield.visible !== false) {
2822
- <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="field.collections">
2823
- </ng-container>
3101
+ <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="field.collections" [ui]="subUi"> </ng-container>
2824
3102
  }
2825
3103
  }
2826
- `, standalone: true, imports: [CommonModule, KlesDynamicFieldDirective, MatTooltip], styles: ["mat-form-field{width:100%}\n", ":host.group-container{display:flex;flex-direction:inherit;width:inherit;justify-content:inherit}\n", ":host.group-container-column{display:flex;flex-direction:column;justify-content:inherit}\n", ":host.group-container-column>*{width:100%}\n", ":host.group-container-row{display:inline-flex;flex-wrap:wrap;gap:10px;align-items:baseline;justify-content:inherit}\n", ":host.group-container-row>*{width:100%}\n", ":host.group-container-grid{display:grid}\n", ":host.group-container-inline-grid{display:inline-grid}\n"] }]
3104
+ `, standalone: true, imports: [CommonModule, KlesDynamicFieldDirective, MatTooltip, ReactiveFormsModule], styles: ["mat-form-field{width:100%}\n", ":host.group-container{display:flex;flex-direction:inherit;width:inherit;justify-content:inherit}\n", ":host.group-container-column{display:flex;flex-direction:column;justify-content:inherit}\n", ":host.group-container-column>*{width:100%}\n", ":host.group-container-row{display:inline-flex;flex-wrap:wrap;gap:10px;align-items:baseline;justify-content:inherit}\n", ":host.group-container-row>*{width:100%}\n", ":host.group-container-grid{display:grid}\n", ":host.group-container-inline-grid{display:inline-grid}\n"] }]
2827
3105
  }], propDecorators: { className: [{
2828
3106
  type: HostBinding,
2829
3107
  args: ['class']
2830
3108
  }] } });
2831
3109
 
2832
3110
  class KlesFormInputClearableComponent extends KlesFormInputComponent {
2833
- constructor(viewRef, intl) {
2834
- super(viewRef, intl);
2835
- this.viewRef = viewRef;
2836
- this.intl = intl;
2837
- }
2838
3111
  ngOnDestroy() {
2839
3112
  super.ngOnDestroy();
2840
3113
  }
2841
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormInputClearableComponent, deps: [{ token: i0.ViewContainerRef }, { token: KlesDynamicFormIntl }], target: i0.ɵɵFactoryTarget.Component }); }
3114
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormInputClearableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2842
3115
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormInputClearableComponent, isStandalone: true, selector: "kles-form-input-clearable", usesInheritance: true, ngImport: i0, template: `
2843
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="field.color" class="form-element" [appearance]="field.appearance">
3116
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="color()" class="form-element" [appearance]="appearance()">
2844
3117
  @if (field.label) {
2845
- <mat-label>{{ field.label }}</mat-label>
2846
- } @if (field.autocomplete) {
2847
- <input
2848
- matInput
2849
- matTooltip="{{ field.tooltip }}"
2850
- [attr.id]="field.id"
2851
- [ngClass]="field.ngClass"
2852
- [formControlName]="field.name"
2853
- [placeholder]="field.placeholder"
2854
- [type]="field.inputType"
2855
- [maxLength]="field.maxLength"
2856
- [min]="field.min"
2857
- [max]="field.max"
2858
- [step]="field.step"
2859
- [matAutocomplete]="auto"
2860
- />
2861
-
2862
- <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
2863
- @if(filteredOption$ | async; as filteredOption){ @if(filteredOption.loading){
2864
- <mat-option class="hide-checkbox" disabled>
2865
- <div class="loadingSelect">
2866
- {{ intl.loading }}...
2867
- <mat-spinner class="spinner" diameter="20"></mat-spinner>
2868
- </div>
2869
- </mat-option>
2870
- }@else{ @if (!field.autocompleteComponent) { @for (option of filteredOption.options; track option) {
2871
- <mat-option [value]="option">
2872
- {{ field.property ? option[field.property] : option }}
2873
- </mat-option>
2874
- } } @else { @for (option of filteredOption.options; track option) {
2875
- <mat-option [value]="option">
2876
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
2877
- </mat-option>
2878
- } } } }
2879
- </mat-autocomplete>
3118
+ <mat-label>{{ field.label }}</mat-label>
3119
+ }
3120
+ @if (field.autocomplete) {
3121
+ <input
3122
+ matInput
3123
+ matTooltip="{{ field.tooltip }}"
3124
+ [attr.id]="field.id"
3125
+ [ngClass]="ngClass()"
3126
+ [formControlName]="field.name"
3127
+ [placeholder]="field.placeholder"
3128
+ [type]="inputType()"
3129
+ [maxLength]="maxLength()"
3130
+ [min]="min()"
3131
+ [max]="max()"
3132
+ [step]="step()"
3133
+ [matAutocomplete]="auto"
3134
+ />
3135
+
3136
+ <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
3137
+ @if (filteredOption$ | async; as filteredOption) {
3138
+ @if (filteredOption.loading) {
3139
+ <mat-option class="hide-checkbox" disabled>
3140
+ <div class="loadingSelect">
3141
+ {{ intl.loading }}...
3142
+ <mat-spinner class="spinner" diameter="20"></mat-spinner>
3143
+ </div>
3144
+ </mat-option>
3145
+ } @else {
3146
+ @if (!field.autocompleteComponent) {
3147
+ @for (option of filteredOption.options; track option) {
3148
+ <mat-option [value]="option">
3149
+ {{ field.property ? option[field.property] : option }}
3150
+ </mat-option>
3151
+ }
3152
+ } @else {
3153
+ @for (option of filteredOption.options; track option) {
3154
+ <mat-option [value]="option">
3155
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
3156
+ </mat-option>
3157
+ }
3158
+ }
3159
+ }
3160
+ }
3161
+ </mat-autocomplete>
2880
3162
  } @else {
2881
- <input
2882
- matInput
2883
- matTooltip="{{ field.tooltip }}"
2884
- [attr.id]="field.id"
2885
- [ngClass]="field.ngClass"
2886
- [formControlName]="field.name"
2887
- [placeholder]="field.placeholder"
2888
- [type]="field.inputType"
2889
- [maxLength]="field.maxLength"
2890
- [min]="field.min"
2891
- [max]="field.max"
2892
- [step]="field.step"
2893
- />
2894
- } @if (!group.get(field.name).disabled) {
2895
- <button matSuffix mat-icon-button aria-label="Clear" type="button" (click)="group.controls[field.name].reset()">
2896
- <mat-icon>close</mat-icon>
2897
- </button>
2898
- } @if (isPending()) {
2899
- <mat-spinner matSuffix mode="indeterminate" diameter="17"></mat-spinner>
3163
+ <input
3164
+ matInput
3165
+ matTooltip="{{ field.tooltip }}"
3166
+ [attr.id]="field.id"
3167
+ [ngClass]="ngClass()"
3168
+ [formControlName]="field.name"
3169
+ [placeholder]="field.placeholder"
3170
+ [type]="inputType()"
3171
+ [maxLength]="maxLength()"
3172
+ [min]="min()"
3173
+ [max]="max()"
3174
+ [step]="step()"
3175
+ />
3176
+ }
3177
+ @if (!group.get(field.name).disabled) {
3178
+ <button matSuffix mat-icon-button aria-label="Clear" type="button" (click)="group.controls[field.name].reset()">
3179
+ <mat-icon>close</mat-icon>
3180
+ </button>
3181
+ }
3182
+ @if (isPending()) {
3183
+ <mat-spinner matSuffix mode="indeterminate" diameter="17"></mat-spinner>
2900
3184
  }
2901
3185
 
2902
3186
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
2903
3187
  </mat-form-field>
2904
- `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel$1, selector: "mat-label" }, { kind: "component", type: MatFormField$1, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }] }); }
3188
+ `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel$1, selector: "mat-label" }, { kind: "component", type: MatFormField$1, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }] }); }
2905
3189
  }
2906
3190
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormInputClearableComponent, decorators: [{
2907
3191
  type: Component,
2908
3192
  args: [{ selector: 'kles-form-input-clearable', template: `
2909
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="field.color" class="form-element" [appearance]="field.appearance">
3193
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [formGroup]="group" [color]="color()" class="form-element" [appearance]="appearance()">
2910
3194
  @if (field.label) {
2911
- <mat-label>{{ field.label }}</mat-label>
2912
- } @if (field.autocomplete) {
2913
- <input
2914
- matInput
2915
- matTooltip="{{ field.tooltip }}"
2916
- [attr.id]="field.id"
2917
- [ngClass]="field.ngClass"
2918
- [formControlName]="field.name"
2919
- [placeholder]="field.placeholder"
2920
- [type]="field.inputType"
2921
- [maxLength]="field.maxLength"
2922
- [min]="field.min"
2923
- [max]="field.max"
2924
- [step]="field.step"
2925
- [matAutocomplete]="auto"
2926
- />
2927
-
2928
- <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
2929
- @if(filteredOption$ | async; as filteredOption){ @if(filteredOption.loading){
2930
- <mat-option class="hide-checkbox" disabled>
2931
- <div class="loadingSelect">
2932
- {{ intl.loading }}...
2933
- <mat-spinner class="spinner" diameter="20"></mat-spinner>
2934
- </div>
2935
- </mat-option>
2936
- }@else{ @if (!field.autocompleteComponent) { @for (option of filteredOption.options; track option) {
2937
- <mat-option [value]="option">
2938
- {{ field.property ? option[field.property] : option }}
2939
- </mat-option>
2940
- } } @else { @for (option of filteredOption.options; track option) {
2941
- <mat-option [value]="option">
2942
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
2943
- </mat-option>
2944
- } } } }
2945
- </mat-autocomplete>
3195
+ <mat-label>{{ field.label }}</mat-label>
3196
+ }
3197
+ @if (field.autocomplete) {
3198
+ <input
3199
+ matInput
3200
+ matTooltip="{{ field.tooltip }}"
3201
+ [attr.id]="field.id"
3202
+ [ngClass]="ngClass()"
3203
+ [formControlName]="field.name"
3204
+ [placeholder]="field.placeholder"
3205
+ [type]="inputType()"
3206
+ [maxLength]="maxLength()"
3207
+ [min]="min()"
3208
+ [max]="max()"
3209
+ [step]="step()"
3210
+ [matAutocomplete]="auto"
3211
+ />
3212
+
3213
+ <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn.bind(this)" [panelWidth]="this.field.panelWidth">
3214
+ @if (filteredOption$ | async; as filteredOption) {
3215
+ @if (filteredOption.loading) {
3216
+ <mat-option class="hide-checkbox" disabled>
3217
+ <div class="loadingSelect">
3218
+ {{ intl.loading }}...
3219
+ <mat-spinner class="spinner" diameter="20"></mat-spinner>
3220
+ </div>
3221
+ </mat-option>
3222
+ } @else {
3223
+ @if (!field.autocompleteComponent) {
3224
+ @for (option of filteredOption.options; track option) {
3225
+ <mat-option [value]="option">
3226
+ {{ field.property ? option[field.property] : option }}
3227
+ </mat-option>
3228
+ }
3229
+ } @else {
3230
+ @for (option of filteredOption.options; track option) {
3231
+ <mat-option [value]="option">
3232
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="option" [field]="field"> </ng-container>
3233
+ </mat-option>
3234
+ }
3235
+ }
3236
+ }
3237
+ }
3238
+ </mat-autocomplete>
2946
3239
  } @else {
2947
- <input
2948
- matInput
2949
- matTooltip="{{ field.tooltip }}"
2950
- [attr.id]="field.id"
2951
- [ngClass]="field.ngClass"
2952
- [formControlName]="field.name"
2953
- [placeholder]="field.placeholder"
2954
- [type]="field.inputType"
2955
- [maxLength]="field.maxLength"
2956
- [min]="field.min"
2957
- [max]="field.max"
2958
- [step]="field.step"
2959
- />
2960
- } @if (!group.get(field.name).disabled) {
2961
- <button matSuffix mat-icon-button aria-label="Clear" type="button" (click)="group.controls[field.name].reset()">
2962
- <mat-icon>close</mat-icon>
2963
- </button>
2964
- } @if (isPending()) {
2965
- <mat-spinner matSuffix mode="indeterminate" diameter="17"></mat-spinner>
3240
+ <input
3241
+ matInput
3242
+ matTooltip="{{ field.tooltip }}"
3243
+ [attr.id]="field.id"
3244
+ [ngClass]="ngClass()"
3245
+ [formControlName]="field.name"
3246
+ [placeholder]="field.placeholder"
3247
+ [type]="inputType()"
3248
+ [maxLength]="maxLength()"
3249
+ [min]="min()"
3250
+ [max]="max()"
3251
+ [step]="step()"
3252
+ />
3253
+ }
3254
+ @if (!group.get(field.name).disabled) {
3255
+ <button matSuffix mat-icon-button aria-label="Clear" type="button" (click)="group.controls[field.name].reset()">
3256
+ <mat-icon>close</mat-icon>
3257
+ </button>
3258
+ }
3259
+ @if (isPending()) {
3260
+ <mat-spinner matSuffix mode="indeterminate" diameter="17"></mat-spinner>
2966
3261
  }
2967
3262
 
2968
3263
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
2969
3264
  </mat-form-field>
2970
3265
  `, standalone: true, imports: [CommonModule, ReactiveFormsModule, MatAutocompleteModule, MatErrorMessageDirective, MatProgressSpinner, MatIcon, MatTooltip, KlesComponentDirective, MatOption$1, MatInput, MatLabel$1, MatFormField$1], styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", "mat-form-field{width:100%}\n"] }]
2971
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: KlesDynamicFormIntl }] });
3266
+ }] });
2972
3267
 
2973
3268
  class KlesFormIconComponent extends KlesFieldAbstract {
2974
- ngOnInit() { super.ngOnInit(); }
3269
+ ngOnInit() {
3270
+ super.ngOnInit();
3271
+ }
2975
3272
  ngOnDestroy() {
2976
3273
  super.ngOnDestroy();
2977
3274
  }
2978
3275
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormIconComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2979
3276
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormIconComponent, isStandalone: true, selector: "kles-form-icon", usesInheritance: true, ngImport: i0, template: `
2980
- <mat-icon [color]="field.color" matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [ngStyle]="field.ngStyle">
2981
- {{group.controls[field.name].value}}
3277
+ <mat-icon [color]="color()" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [ngStyle]="ngStyle()">
3278
+ {{ group.controls[field.name].value }}
2982
3279
  </mat-icon>
2983
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
3280
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
2984
3281
  }
2985
3282
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormIconComponent, decorators: [{
2986
3283
  type: Component,
2987
- args: [{ selector: "kles-form-icon", template: `
2988
- <mat-icon [color]="field.color" matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass" [ngStyle]="field.ngStyle">
2989
- {{group.controls[field.name].value}}
3284
+ args: [{ selector: 'kles-form-icon', template: `
3285
+ <mat-icon [color]="color()" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [ngStyle]="ngStyle()">
3286
+ {{ group.controls[field.name].value }}
2990
3287
  </mat-icon>
2991
- `, standalone: true, imports: [CommonModule, MatIcon, MatTooltip] }]
3288
+ `, standalone: true, imports: [CommonModule, MatIcon, MatTooltip, ReactiveFormsModule] }]
2992
3289
  }] });
2993
3290
 
2994
3291
  class KlesFormSelectSearchComponent extends KlesFieldAbstract {
2995
- constructor(viewRef, ref, intl) {
2996
- super(viewRef);
2997
- this.viewRef = viewRef;
2998
- this.ref = ref;
2999
- this.intl = intl;
3292
+ constructor() {
3293
+ super(...arguments);
3000
3294
  this.searchControl = new UntypedFormControl();
3001
3295
  this.selectAllControl = new UntypedFormControl(false);
3002
3296
  this.isLoading = signal(false);
3003
3297
  this.optionsFiltered$ = new ReplaySubject(1);
3004
3298
  this.openChange$ = new BehaviorSubject(false);
3005
3299
  this.openClosed$ = new Subject();
3300
+ this.intl = inject(KlesDynamicFormIntl);
3301
+ this.ref = inject(ChangeDetectorRef);
3006
3302
  this.compareFn = (o1, o2) => {
3007
3303
  if (this.field.property && o1 && o2) {
3008
3304
  return o1[this.field.property] === o2[this.field.property];
@@ -3034,11 +3330,11 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3034
3330
  this.options$ = of(this.field.options);
3035
3331
  }
3036
3332
  }
3037
- this.options$.pipe(takeUntil(this._onDestroy)).subscribe((options) => {
3333
+ this.options$.pipe(takeUntil$1(this._onDestroy)).subscribe((options) => {
3038
3334
  this.optionsFiltered$.next(options);
3039
3335
  });
3040
3336
  this.searchControl.valueChanges
3041
- .pipe(takeUntil(this._onDestroy), debounceTime(this.field.debounceTime || 0), startWith(this.searchControl.value), switchMap((value) => {
3337
+ .pipe(takeUntil$1(this._onDestroy), debounceTime(this.field.debounceTime || 0), startWith$1(this.searchControl.value), switchMap((value) => {
3042
3338
  return concat(of({ loading: true, options: [] }), this.onSearchChange(value).pipe(take(1), map((options) => ({ loading: false, options }))));
3043
3339
  }))
3044
3340
  .subscribe(({ loading, options }) => {
@@ -3079,7 +3375,7 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3079
3375
  }
3080
3376
  openChangeEvent() {
3081
3377
  this.openChange$
3082
- .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
3378
+ .pipe(takeUntil$1(this._onDestroy), switchMap((isOpen) => {
3083
3379
  return this.onOpenChange(isOpen);
3084
3380
  }))
3085
3381
  .subscribe((options) => {
@@ -3094,11 +3390,11 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3094
3390
  if (isOpen) {
3095
3391
  if (this.field.options instanceof Observable) {
3096
3392
  this.isLoading.set(true);
3097
- return this.field.options.pipe(takeUntil(this.openClosed$));
3393
+ return this.field.options.pipe(takeUntil$1(this.openClosed$));
3098
3394
  }
3099
3395
  else if (this.field.options instanceof Function) {
3100
3396
  this.isLoading.set(true);
3101
- return this.field.options().pipe(takeUntil(this.openClosed$));
3397
+ return this.field.options().pipe(takeUntil$1(this.openClosed$));
3102
3398
  }
3103
3399
  else {
3104
3400
  return of(this.field.options);
@@ -3177,17 +3473,17 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3177
3473
  }
3178
3474
  }
3179
3475
  }
3180
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectSearchComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: KlesDynamicFormIntl }], target: i0.ɵɵFactoryTarget.Component }); }
3476
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3181
3477
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormSelectSearchComponent, isStandalone: true, selector: "kles-form-select-search", viewQueries: [{ propertyName: "cdkVirtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "options", predicate: MatOption, descendants: true }], usesInheritance: true, ngImport: i0, template: `
3182
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
3478
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()" class="field-bottom">
3183
3479
  @if (field.label) {
3184
- <mat-label>{{ field.label }}</mat-label>
3480
+ <mat-label>{{ field.label }}</mat-label>
3185
3481
  }
3186
3482
 
3187
3483
  <mat-select
3188
3484
  matTooltip="{{ field.tooltip }}"
3189
3485
  [attr.id]="field.id"
3190
- [ngClass]="field.ngClass"
3486
+ [ngClass]="ngClass()"
3191
3487
  (openedChange)="openChange($event)"
3192
3488
  [compareWith]="compareFn"
3193
3489
  [panelWidth]="field.panelWidth || 'auto'"
@@ -3199,106 +3495,131 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
3199
3495
  (blur)="onBlur()"
3200
3496
  >
3201
3497
  @if (field.triggerComponent) {
3202
- <mat-select-trigger>
3203
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
3204
- </mat-select-trigger>
3205
- } @if (field.virtualScroll) {
3206
- <mat-option>
3207
- <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3208
- </mat-option>
3209
-
3210
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
3211
- @if (!isLoading()) { @if (field.multiple) {
3212
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3213
- {{ intl.selectAll }}
3214
- </mat-checkbox>
3215
- } @if (!field.autocompleteComponent) {
3216
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
3217
-
3218
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
3219
- <mat-option [value]="item" style="display:none">
3220
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
3221
- </mat-option>
3222
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
3223
- <mat-option [value]="item" style="display:none">
3224
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
3225
- </mat-option>
3226
- } } } @else {
3227
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3228
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3498
+ <mat-select-trigger>
3499
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
3500
+ </mat-select-trigger>
3501
+ }
3502
+ @if (field.virtualScroll) {
3503
+ <mat-option>
3504
+ <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3229
3505
  </mat-option>
3230
3506
 
3231
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
3232
- <mat-option [value]="item" style="display:none">
3233
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3234
- </mat-option>
3235
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
3236
- <mat-option [value]="item" style="display:none">
3237
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3238
- </mat-option>
3239
- } } } } @else {
3240
- <mat-option class="hide-checkbox" disabled
3241
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3242
- ></mat-option>
3243
- }
3244
- </cdk-virtual-scroll-viewport>
3507
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
3508
+ @if (!isLoading()) {
3509
+ @if (field.multiple) {
3510
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3511
+ {{ intl.selectAll }}
3512
+ </mat-checkbox>
3513
+ }
3514
+ @if (!field.autocompleteComponent) {
3515
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
3516
+
3517
+ @if (field.multiple) {
3518
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
3519
+ <mat-option [value]="item" style="display:none">
3520
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
3521
+ </mat-option>
3522
+ }
3523
+ }
3524
+ @if (!field.multiple && group.controls[field.name].value) {
3525
+ @for (item of [group?.controls[field.name]?.value]; track item) {
3526
+ <mat-option [value]="item" style="display:none">
3527
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
3528
+ </mat-option>
3529
+ }
3530
+ }
3531
+ } @else {
3532
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3533
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3534
+ </mat-option>
3535
+
3536
+ @if (field.multiple) {
3537
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
3538
+ <mat-option [value]="item" style="display:none">
3539
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3540
+ </mat-option>
3541
+ }
3542
+ }
3543
+ @if (!field.multiple && group.controls[field.name].value) {
3544
+ @for (item of [group?.controls[field.name]?.value]; track item) {
3545
+ <mat-option [value]="item" style="display:none">
3546
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3547
+ </mat-option>
3548
+ }
3549
+ }
3550
+ }
3551
+ } @else {
3552
+ <mat-option class="hide-checkbox" disabled
3553
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3554
+ ></mat-option>
3555
+ }
3556
+ </cdk-virtual-scroll-viewport>
3245
3557
  } @else {
3246
- <mat-option>
3247
- <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3248
- </mat-option>
3249
-
3250
- @if (!isLoading()) { @if (field.multiple) {
3251
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3252
- {{ intl.selectAll }}
3253
- </mat-checkbox>
3254
- } @if (!field.autocompleteComponent) { @for (item of optionsFiltered$ | async; track item) {
3255
- <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
3256
- } } @else { @for (item of optionsFiltered$ | async; track item) {
3257
- <mat-option [value]="item" [disabled]="item?.disabled">
3258
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3259
- </mat-option>
3260
- } } } @else {
3261
- <mat-option class="hide-checkbox" disabled
3262
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3263
- ></mat-option>
3264
- }
3558
+ <mat-option>
3559
+ <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3560
+ </mat-option>
3265
3561
 
3266
- <ng-template #emptyOption>
3267
- <mat-option class="hide-checkbox" disabled
3268
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3269
- ></mat-option>
3270
- </ng-template>
3271
- }
3272
- </mat-select>
3562
+ @if (!isLoading()) {
3563
+ @if (field.multiple) {
3564
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3565
+ {{ intl.selectAll }}
3566
+ </mat-checkbox>
3567
+ }
3568
+ @if (!field.autocompleteComponent) {
3569
+ @for (item of optionsFiltered$ | async; track item) {
3570
+ <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
3571
+ }
3572
+ } @else {
3573
+ @for (item of optionsFiltered$ | async; track item) {
3574
+ <mat-option [value]="item" [disabled]="item?.disabled">
3575
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3576
+ </mat-option>
3577
+ }
3578
+ }
3579
+ } @else {
3580
+ <mat-option class="hide-checkbox" disabled
3581
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3582
+ ></mat-option>
3583
+ }
3273
3584
 
3274
- @if (field.hint) {
3275
- <mat-hint>{{ field.hint }}</mat-hint>
3276
- } @if (field.subComponents || field.clearable || isPending()) {
3277
- <div matSuffix class="suffix">
3278
- @if(isPending()){
3279
- <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
3280
- } @if(field.subComponents || field.clearable){
3281
- <ng-content></ng-content>
3585
+ <ng-template #emptyOption>
3586
+ <mat-option class="hide-checkbox" disabled
3587
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3588
+ ></mat-option>
3589
+ </ng-template>
3282
3590
  }
3283
- </div>
3591
+ </mat-select>
3592
+
3593
+ @if (field.hint) {
3594
+ <mat-hint>{{ field.hint }}</mat-hint>
3595
+ }
3596
+ @if (field.subComponents || field.clearable || isPending()) {
3597
+ <div matSuffix class="suffix">
3598
+ @if (isPending()) {
3599
+ <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
3600
+ }
3601
+ @if (field.subComponents || field.clearable) {
3602
+ <ng-content></ng-content>
3603
+ }
3604
+ </div>
3284
3605
  }
3285
3606
 
3286
3607
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
3287
3608
  </mat-form-field>
3288
- `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".suffix{display:flex;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .selectAll{padding:0 16px 0 5px!important;display:flex!important}\n", "::ng-deep .selectAll .mdc-form-field{width:100%}\n", "::ng-deep .selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", "::ng-deep .selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i5$2.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] }); }
3609
+ `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".suffix{display:flex;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .selectAll{padding:0 16px 0 5px!important;display:flex!important}\n", "::ng-deep .selectAll .mdc-form-field{width:100%}\n", "::ng-deep .selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", "::ng-deep .selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i4$2.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }] }); }
3289
3610
  }
3290
3611
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectSearchComponent, decorators: [{
3291
3612
  type: Component,
3292
3613
  args: [{ selector: 'kles-form-select-search', template: `
3293
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
3614
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()" class="field-bottom">
3294
3615
  @if (field.label) {
3295
- <mat-label>{{ field.label }}</mat-label>
3616
+ <mat-label>{{ field.label }}</mat-label>
3296
3617
  }
3297
3618
 
3298
3619
  <mat-select
3299
3620
  matTooltip="{{ field.tooltip }}"
3300
3621
  [attr.id]="field.id"
3301
- [ngClass]="field.ngClass"
3622
+ [ngClass]="ngClass()"
3302
3623
  (openedChange)="openChange($event)"
3303
3624
  [compareWith]="compareFn"
3304
3625
  [panelWidth]="field.panelWidth || 'auto'"
@@ -3310,88 +3631,113 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3310
3631
  (blur)="onBlur()"
3311
3632
  >
3312
3633
  @if (field.triggerComponent) {
3313
- <mat-select-trigger>
3314
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
3315
- </mat-select-trigger>
3316
- } @if (field.virtualScroll) {
3317
- <mat-option>
3318
- <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3319
- </mat-option>
3320
-
3321
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
3322
- @if (!isLoading()) { @if (field.multiple) {
3323
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3324
- {{ intl.selectAll }}
3325
- </mat-checkbox>
3326
- } @if (!field.autocompleteComponent) {
3327
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
3328
-
3329
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
3330
- <mat-option [value]="item" style="display:none">
3331
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
3332
- </mat-option>
3333
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
3334
- <mat-option [value]="item" style="display:none">
3335
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
3336
- </mat-option>
3337
- } } } @else {
3338
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3339
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3634
+ <mat-select-trigger>
3635
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
3636
+ </mat-select-trigger>
3637
+ }
3638
+ @if (field.virtualScroll) {
3639
+ <mat-option>
3640
+ <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3340
3641
  </mat-option>
3341
3642
 
3342
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
3343
- <mat-option [value]="item" style="display:none">
3344
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3345
- </mat-option>
3346
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
3347
- <mat-option [value]="item" style="display:none">
3348
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3643
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
3644
+ @if (!isLoading()) {
3645
+ @if (field.multiple) {
3646
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3647
+ {{ intl.selectAll }}
3648
+ </mat-checkbox>
3649
+ }
3650
+ @if (!field.autocompleteComponent) {
3651
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
3652
+
3653
+ @if (field.multiple) {
3654
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
3655
+ <mat-option [value]="item" style="display:none">
3656
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
3657
+ </mat-option>
3658
+ }
3659
+ }
3660
+ @if (!field.multiple && group.controls[field.name].value) {
3661
+ @for (item of [group?.controls[field.name]?.value]; track item) {
3662
+ <mat-option [value]="item" style="display:none">
3663
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
3664
+ </mat-option>
3665
+ }
3666
+ }
3667
+ } @else {
3668
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3669
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3670
+ </mat-option>
3671
+
3672
+ @if (field.multiple) {
3673
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
3674
+ <mat-option [value]="item" style="display:none">
3675
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3676
+ </mat-option>
3677
+ }
3678
+ }
3679
+ @if (!field.multiple && group.controls[field.name].value) {
3680
+ @for (item of [group?.controls[field.name]?.value]; track item) {
3681
+ <mat-option [value]="item" style="display:none">
3682
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3683
+ </mat-option>
3684
+ }
3685
+ }
3686
+ }
3687
+ } @else {
3688
+ <mat-option class="hide-checkbox" disabled
3689
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3690
+ ></mat-option>
3691
+ }
3692
+ </cdk-virtual-scroll-viewport>
3693
+ } @else {
3694
+ <mat-option>
3695
+ <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3349
3696
  </mat-option>
3350
- } } } } @else {
3351
- <mat-option class="hide-checkbox" disabled
3352
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3353
- ></mat-option>
3697
+
3698
+ @if (!isLoading()) {
3699
+ @if (field.multiple) {
3700
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3701
+ {{ intl.selectAll }}
3702
+ </mat-checkbox>
3703
+ }
3704
+ @if (!field.autocompleteComponent) {
3705
+ @for (item of optionsFiltered$ | async; track item) {
3706
+ <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
3707
+ }
3708
+ } @else {
3709
+ @for (item of optionsFiltered$ | async; track item) {
3710
+ <mat-option [value]="item" [disabled]="item?.disabled">
3711
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3712
+ </mat-option>
3713
+ }
3714
+ }
3715
+ } @else {
3716
+ <mat-option class="hide-checkbox" disabled
3717
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3718
+ ></mat-option>
3354
3719
  }
3355
- </cdk-virtual-scroll-viewport>
3356
- } @else {
3357
- <mat-option>
3358
- <ngx-mat-select-search [formControl]="searchControl" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
3359
- </mat-option>
3360
-
3361
- @if (!isLoading()) { @if (field.multiple) {
3362
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
3363
- {{ intl.selectAll }}
3364
- </mat-checkbox>
3365
- } @if (!field.autocompleteComponent) { @for (item of optionsFiltered$ | async; track item) {
3366
- <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
3367
- } } @else { @for (item of optionsFiltered$ | async; track item) {
3368
- <mat-option [value]="item" [disabled]="item?.disabled">
3369
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3370
- </mat-option>
3371
- } } } @else {
3372
- <mat-option class="hide-checkbox" disabled
3373
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3374
- ></mat-option>
3375
- }
3376
3720
 
3377
- <ng-template #emptyOption>
3378
- <mat-option class="hide-checkbox" disabled
3379
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3380
- ></mat-option>
3381
- </ng-template>
3721
+ <ng-template #emptyOption>
3722
+ <mat-option class="hide-checkbox" disabled
3723
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
3724
+ ></mat-option>
3725
+ </ng-template>
3382
3726
  }
3383
3727
  </mat-select>
3384
3728
 
3385
3729
  @if (field.hint) {
3386
- <mat-hint>{{ field.hint }}</mat-hint>
3387
- } @if (field.subComponents || field.clearable || isPending()) {
3388
- <div matSuffix class="suffix">
3389
- @if(isPending()){
3390
- <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
3391
- } @if(field.subComponents || field.clearable){
3392
- <ng-content></ng-content>
3393
- }
3394
- </div>
3730
+ <mat-hint>{{ field.hint }}</mat-hint>
3731
+ }
3732
+ @if (field.subComponents || field.clearable || isPending()) {
3733
+ <div matSuffix class="suffix">
3734
+ @if (isPending()) {
3735
+ <mat-spinner mode="indeterminate" diameter="21"></mat-spinner>
3736
+ }
3737
+ @if (field.subComponents || field.clearable) {
3738
+ <ng-content></ng-content>
3739
+ }
3740
+ </div>
3395
3741
  }
3396
3742
 
3397
3743
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
@@ -3413,8 +3759,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3413
3759
  MatFormField,
3414
3760
  NgxMatSelectSearchModule,
3415
3761
  MatCheckbox,
3762
+ MatFormFieldModule,
3416
3763
  ], styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".suffix{display:flex;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", "::ng-deep .selectAll{padding:0 16px 0 5px!important;display:flex!important}\n", "::ng-deep .selectAll .mdc-form-field{width:100%}\n", "::ng-deep .selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", "::ng-deep .selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"] }]
3417
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: KlesDynamicFormIntl }], propDecorators: { cdkVirtualScrollViewport: [{
3764
+ }], propDecorators: { cdkVirtualScrollViewport: [{
3418
3765
  type: ViewChild,
3419
3766
  args: [CdkVirtualScrollViewport]
3420
3767
  }], options: [{
@@ -3473,7 +3820,7 @@ class KlesFormLinkComponent extends KlesFieldAbstract {
3473
3820
  }
3474
3821
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormLinkComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3475
3822
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormLinkComponent, isStandalone: true, selector: "kles-form-link", usesInheritance: true, ngImport: i0, template: `
3476
- <a [href]="group.controls[field.name].value" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass">
3823
+ <a [href]="group.controls[field.name].value" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()">
3477
3824
  {{ field.label }}
3478
3825
  </a>
3479
3826
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
@@ -3483,7 +3830,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3483
3830
  args: [{
3484
3831
  selector: 'kles-form-link',
3485
3832
  template: `
3486
- <a [href]="group.controls[field.name].value" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass">
3833
+ <a [href]="group.controls[field.name].value" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()">
3487
3834
  {{ field.label }}
3488
3835
  </a>
3489
3836
  `,
@@ -3502,7 +3849,7 @@ class KlesFormSlideToggleComponent extends KlesFieldAbstract {
3502
3849
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSlideToggleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3503
3850
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormSlideToggleComponent, isStandalone: true, selector: "kles-form-slide-toggle", usesInheritance: true, ngImport: i0, template: `
3504
3851
  <div [formGroup]="group">
3505
- <mat-slide-toggle matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [color]="field.color" [formControlName]="field.name">{{ field.label }}</mat-slide-toggle>
3852
+ <mat-slide-toggle matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [color]="color()" [formControlName]="field.name">{{ field.label }}</mat-slide-toggle>
3506
3853
  </div>
3507
3854
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
3508
3855
  }
@@ -3510,7 +3857,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3510
3857
  type: Component,
3511
3858
  args: [{ selector: 'kles-form-slide-toggle', template: `
3512
3859
  <div [formGroup]="group">
3513
- <mat-slide-toggle matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [color]="field.color" [formControlName]="field.name">{{ field.label }}</mat-slide-toggle>
3860
+ <mat-slide-toggle matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [color]="color()" [formControlName]="field.name">{{ field.label }}</mat-slide-toggle>
3514
3861
  </div>
3515
3862
  `, standalone: true, imports: [CommonModule, MatSlideToggle, MatTooltip, ReactiveFormsModule] }]
3516
3863
  }] });
@@ -3767,10 +4114,10 @@ class KlesFormSelectionListComponent extends KlesFieldAbstract {
3767
4114
  else {
3768
4115
  this.options$ = of(this.field.options);
3769
4116
  }
3770
- this.group.controls[this.field.name].valueChanges.pipe(takeUntil(this._onDestroy)).subscribe((value) => {
4117
+ this.group.controls[this.field.name].valueChanges.pipe(takeUntil$1(this._onDestroy)).subscribe((value) => {
3771
4118
  this.selection.setSelection(Array.isArray(value) ? value : [value], { emitEvent: false });
3772
4119
  });
3773
- this.selection.changed.pipe(takeUntil(this._onDestroy)).subscribe((change) => {
4120
+ this.selection.changed.pipe(takeUntil$1(this._onDestroy)).subscribe((change) => {
3774
4121
  this.group.controls[this.field.name].patchValue(change.source.selected);
3775
4122
  this.group.controls[this.field.name].markAllAsTouched();
3776
4123
  this.group.controls[this.field.name].markAsDirty();
@@ -3787,7 +4134,7 @@ class KlesFormSelectionListComponent extends KlesFieldAbstract {
3787
4134
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectionListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3788
4135
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormSelectionListComponent, isStandalone: true, selector: "kles-form-selection-list", usesInheritance: true, ngImport: i0, template: `
3789
4136
  <div class="margin-top" [formGroup]="group">
3790
- <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="field.ngClass" (selectionChange)="onSelectionChange($event)">
4137
+ <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="ngClass()" (selectionChange)="onSelectionChange($event)">
3791
4138
  @if(options$ | async; as options){ @if(field.virtualScroll){
3792
4139
  <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 20" style="height:100%">
3793
4140
  @if (!field.autocompleteComponent) {
@@ -3813,13 +4160,13 @@ class KlesFormSelectionListComponent extends KlesFieldAbstract {
3813
4160
  }
3814
4161
  </mat-selection-list>
3815
4162
  </div>
3816
- `, isInline: true, styles: ["mat-selection-list{width:100%;height:250px;overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3$3.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i3$3.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
4163
+ `, isInline: true, styles: ["mat-selection-list{width:100%;height:250px;overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3$4.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i3$4.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
3817
4164
  }
3818
4165
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectionListComponent, decorators: [{
3819
4166
  type: Component,
3820
4167
  args: [{ selector: 'kles-form-selection-list', template: `
3821
4168
  <div class="margin-top" [formGroup]="group">
3822
- <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="field.ngClass" (selectionChange)="onSelectionChange($event)">
4169
+ <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="ngClass()" (selectionChange)="onSelectionChange($event)">
3823
4170
  @if(options$ | async; as options){ @if(field.virtualScroll){
3824
4171
  <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 20" style="height:100%">
3825
4172
  @if (!field.autocompleteComponent) {
@@ -3857,10 +4204,10 @@ let KlesFormBadgeComponent = class KlesFormBadgeComponent extends KlesFieldAbstr
3857
4204
  }
3858
4205
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormBadgeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3859
4206
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormBadgeComponent, isStandalone: true, selector: "kles-form-badge", usesInheritance: true, ngImport: i0, template: `
3860
- <span matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
3861
- matBadge="{{group.controls[field.name].value}}" matBadgeOverlap="false" matBadgeColor="{{field.color}}">
4207
+ <span matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="ngClass()"
4208
+ matBadge="{{group.controls[field.name].value}}" matBadgeOverlap="false" [matBadgeColor]="color()">
3862
4209
  </span>
3863
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i3$4.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }] }); }
4210
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i3$5.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }] }); }
3864
4211
  };
3865
4212
  KlesFormBadgeComponent = __decorate([
3866
4213
  FieldMapper({ type: EnumType.badge })
@@ -3870,8 +4217,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3870
4217
  args: [{
3871
4218
  selector: 'kles-form-badge',
3872
4219
  template: `
3873
- <span matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
3874
- matBadge="{{group.controls[field.name].value}}" matBadgeOverlap="false" matBadgeColor="{{field.color}}">
4220
+ <span matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="ngClass()"
4221
+ matBadge="{{group.controls[field.name].value}}" matBadgeOverlap="false" [matBadgeColor]="color()">
3875
4222
  </span>
3876
4223
  `,
3877
4224
  standalone: true,
@@ -3898,7 +4245,7 @@ class KlesFormButtonToogleGroupComponent extends KlesFieldAbstract {
3898
4245
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormButtonToogleGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3899
4246
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormButtonToogleGroupComponent, isStandalone: true, selector: "kles-form-button-toogle-group", usesInheritance: true, ngImport: i0, template: `
3900
4247
  <div [formGroup]="group" class="form-element">
3901
- <mat-button-toggle-group [formControlName]="field.name" [multiple]="field.multiple" [attr.id]="field.id" [ngClass]="field.ngClass">
4248
+ <mat-button-toggle-group [formControlName]="field.name" [multiple]="field.multiple" [attr.id]="field.id" [ngClass]="ngClass()">
3902
4249
  @for (item of options$ | async; track item) {
3903
4250
  <mat-button-toggle [value]="item">
3904
4251
  {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
@@ -3906,7 +4253,7 @@ class KlesFormButtonToogleGroupComponent extends KlesFieldAbstract {
3906
4253
  }
3907
4254
  </mat-button-toggle-group>
3908
4255
  </div>
3909
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i3$5.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3$5.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }] }); }
4256
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i3$6.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3$6.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }] }); }
3910
4257
  }
3911
4258
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormButtonToogleGroupComponent, decorators: [{
3912
4259
  type: Component,
@@ -3914,7 +4261,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3914
4261
  selector: 'kles-form-button-toogle-group',
3915
4262
  template: `
3916
4263
  <div [formGroup]="group" class="form-element">
3917
- <mat-button-toggle-group [formControlName]="field.name" [multiple]="field.multiple" [attr.id]="field.id" [ngClass]="field.ngClass">
4264
+ <mat-button-toggle-group [formControlName]="field.name" [multiple]="field.multiple" [attr.id]="field.id" [ngClass]="ngClass()">
3918
4265
  @for (item of options$ | async; track item) {
3919
4266
  <mat-button-toggle [value]="item">
3920
4267
  {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
@@ -3928,55 +4275,132 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
3928
4275
  }]
3929
4276
  }] });
3930
4277
 
4278
+ class ArrayUiState extends AbstractUiState {
4279
+ constructor() {
4280
+ super(...arguments);
4281
+ this.states = [];
4282
+ }
4283
+ setValue(value) {
4284
+ value.forEach((newValue, index) => {
4285
+ this.at(index).setValue(newValue);
4286
+ });
4287
+ }
4288
+ patchValue(value) {
4289
+ if (value == null)
4290
+ return;
4291
+ value.forEach((newValue, index) => {
4292
+ if (this.at(index)) {
4293
+ this.at(index).patchValue(newValue);
4294
+ }
4295
+ });
4296
+ }
4297
+ at(index) {
4298
+ return this.states?.[index];
4299
+ }
4300
+ _find(name) {
4301
+ return this.at(name) ?? null;
4302
+ }
4303
+ push(control) {
4304
+ if (Array.isArray(control)) {
4305
+ control.forEach((ctrl) => {
4306
+ this.states.push(ctrl);
4307
+ });
4308
+ }
4309
+ else {
4310
+ this.states.push(control);
4311
+ }
4312
+ }
4313
+ }
4314
+
4315
+ class KlesFormUiArray extends KlesFormUiControl {
4316
+ create() {
4317
+ const array = new ArrayUiState();
4318
+ if (this.field.value && Array.isArray(this.field.value)) {
4319
+ if (this.field.collections && Array.isArray(this.field.collections)) {
4320
+ this.field.value.forEach(() => {
4321
+ const group = new GroupUiState();
4322
+ this.field.collections?.forEach((subfield) => {
4323
+ let control;
4324
+ if (subfield.type) {
4325
+ control = componentMapper.find((c) => c.type === subfield.type)?.ui(subfield) || klesFieldUiFactory(subfield);
4326
+ }
4327
+ else {
4328
+ control = componentMapper.find((c) => c.component === subfield.component)?.ui(subfield) || klesFieldUiFactory(subfield);
4329
+ }
4330
+ group.addUiState(subfield.name, control);
4331
+ });
4332
+ array.push(group);
4333
+ });
4334
+ }
4335
+ }
4336
+ else {
4337
+ const group = new GroupUiState();
4338
+ this.field.collections?.forEach((subfield) => {
4339
+ let control;
4340
+ if (subfield.type) {
4341
+ control = componentMapper.find((c) => c.type === subfield.type)?.ui(subfield) || klesFieldUiFactory(subfield);
4342
+ }
4343
+ else {
4344
+ control = componentMapper.find((c) => c.component === subfield.component)?.ui(subfield) || klesFieldUiFactory(subfield);
4345
+ }
4346
+ group.addUiState(subfield.name, control);
4347
+ });
4348
+ array.push(group);
4349
+ }
4350
+ return array;
4351
+ }
4352
+ }
4353
+
3931
4354
  let KlesFormArrayComponent = class KlesFormArrayComponent extends KlesFieldAbstract {
4355
+ constructor() {
4356
+ super();
4357
+ this.formArray = this.group.controls[this.field.name];
4358
+ this.subUi = this.ui?.get(this.field.name);
4359
+ }
3932
4360
  ngOnInit() {
3933
- // this.subGroup = this.group.controls[this.field.name] as FormGroup;
3934
4361
  super.ngOnInit();
3935
- this.formArray = this.group.controls[this.field.name];
3936
4362
  }
3937
4363
  ngOnDestroy() {
3938
4364
  super.ngOnDestroy();
3939
4365
  }
3940
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormArrayComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4366
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormArrayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3941
4367
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormArrayComponent, isStandalone: true, selector: "kles-array", usesInheritance: true, ngImport: i0, template: `
3942
- <div [formGroup]="group" class="container" [ngClass]="{'container-column': field.direction ==='column'}">
3943
- <ng-container [formArrayName]="field.name">
3944
- @for (subGroup of formArray.controls; track subGroup.value._id) {
3945
- <div class="group-container" [ngClass]="field.direction === 'column' ? 'column': 'row'">
3946
- @for (subfield of field.collections; track subfield.name) {
3947
- @if (subfield.visible !== false) {
3948
- <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="field.collections">
3949
- </ng-container>
4368
+ <div [formGroup]="group" class="container" [ngClass]="{ 'container-column': field.direction === 'column' }">
4369
+ <ng-container [formArrayName]="field.name">
4370
+ @for (subGroup of formArray.controls; track subGroup.value._id; let index = $index;) {
4371
+ <div class="group-container" [ngClass]="field.direction === 'column' ? 'column' : 'row'">
4372
+ @for (subfield of field.collections; track subfield.name) {
4373
+ @if (subfield.visible !== false) {
4374
+ <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [ui]="subUi?.at(index)" [siblingFields]="field.collections"> </ng-container>
4375
+ }
3950
4376
  }
3951
- }
3952
- </div>
3953
- }
3954
- </ng-container>
3955
- </div>
3956
- `, isInline: true, styles: ["mat-form-field{width:100%}\n", ":host{display:flex;flex-direction:inherit}\n", ".container{display:flex;flex-direction:inherit}\n", ".container-column{gap:10px}\n", ".group-container{display:flex;flex-direction:inherit}\n", ".row{gap:10px;flex-direction:row;align-items:baseline}\n", ".column{flex-direction:column;gap:0px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "siblingFields"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }] }); }
4377
+ </div>
4378
+ }
4379
+ </ng-container>
4380
+ </div>
4381
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n", ":host{display:flex;flex-direction:inherit}\n", ".container{display:flex;flex-direction:inherit}\n", ".container-column{gap:10px}\n", ".group-container{display:flex;flex-direction:inherit}\n", ".row{gap:10px;flex-direction:row;align-items:baseline}\n", ".column{flex-direction:column;gap:0px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: ["field", "group", "ui", "siblingFields"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }] }); }
3957
4382
  };
3958
4383
  KlesFormArrayComponent = __decorate([
3959
- FieldMapper({ type: EnumType.array, factory: (field) => (new KlesFormArray(field).create()) })
4384
+ FieldMapper({ type: EnumType.array, factory: (field) => new KlesFormArray(field).create(), ui: (field) => new KlesFormUiArray(field).create() })
3960
4385
  ], KlesFormArrayComponent);
3961
4386
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormArrayComponent, decorators: [{
3962
4387
  type: Component,
3963
4388
  args: [{ selector: 'kles-array', template: `
3964
- <div [formGroup]="group" class="container" [ngClass]="{'container-column': field.direction ==='column'}">
3965
- <ng-container [formArrayName]="field.name">
3966
- @for (subGroup of formArray.controls; track subGroup.value._id) {
3967
- <div class="group-container" [ngClass]="field.direction === 'column' ? 'column': 'row'">
3968
- @for (subfield of field.collections; track subfield.name) {
3969
- @if (subfield.visible !== false) {
3970
- <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [siblingFields]="field.collections">
3971
- </ng-container>
4389
+ <div [formGroup]="group" class="container" [ngClass]="{ 'container-column': field.direction === 'column' }">
4390
+ <ng-container [formArrayName]="field.name">
4391
+ @for (subGroup of formArray.controls; track subGroup.value._id; let index = $index;) {
4392
+ <div class="group-container" [ngClass]="field.direction === 'column' ? 'column' : 'row'">
4393
+ @for (subfield of field.collections; track subfield.name) {
4394
+ @if (subfield.visible !== false) {
4395
+ <ng-container klesDynamicField [field]="subfield" [group]="subGroup" [ui]="subUi?.at(index)" [siblingFields]="field.collections"> </ng-container>
4396
+ }
3972
4397
  }
3973
- }
3974
- </div>
3975
- }
3976
- </ng-container>
3977
- </div>
3978
- `, standalone: true, imports: [CommonModule, KlesDynamicFieldDirective, ReactiveFormsModule], styles: ["mat-form-field{width:100%}\n", ":host{display:flex;flex-direction:inherit}\n", ".container{display:flex;flex-direction:inherit}\n", ".container-column{gap:10px}\n", ".group-container{display:flex;flex-direction:inherit}\n", ".row{gap:10px;flex-direction:row;align-items:baseline}\n", ".column{flex-direction:column;gap:0px}\n"] }]
3979
- }] });
4398
+ </div>
4399
+ }
4400
+ </ng-container>
4401
+ </div>
4402
+ `, standalone: true, imports: [CommonModule, KlesDynamicFieldDirective, ReactiveFormsModule], styles: ["mat-form-field{width:100%}\n", ":host{display:flex;flex-direction:inherit}\n", ".container{display:flex;flex-direction:inherit}\n", ".container-column{gap:10px}\n", ".group-container{display:flex;flex-direction:inherit}\n", ".row{gap:10px;flex-direction:row;align-items:baseline}\n", ".column{flex-direction:column;gap:0px}\n"] }]
4403
+ }], ctorParameters: () => [] });
3980
4404
 
3981
4405
  class KlesFormRange extends KlesFormControl {
3982
4406
  create() {
@@ -3995,10 +4419,6 @@ class KlesFormRange extends KlesFormControl {
3995
4419
  }
3996
4420
 
3997
4421
  let KlesFormRangeComponent = class KlesFormRangeComponent extends KlesFieldAbstract {
3998
- // range = new FormGroup({
3999
- // start: new FormControl<Date | null>(null),
4000
- // end: new FormControl<Date | null>(null),
4001
- // });
4002
4422
  ngOnInit() {
4003
4423
  super.ngOnInit();
4004
4424
  }
@@ -4007,12 +4427,12 @@ let KlesFormRangeComponent = class KlesFormRangeComponent extends KlesFieldAbstr
4007
4427
  }
4008
4428
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4009
4429
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormRangeComponent, isStandalone: true, selector: "kles-form-rangepicker", usesInheritance: true, ngImport: i0, template: `
4010
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [color]="field.color" [formGroup]="group" [appearance]="field.appearance">
4430
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [color]="color()" [formGroup]="group" [appearance]="appearance()">
4011
4431
  <mat-label>{{ field.label }}</mat-label>
4012
4432
 
4013
- <mat-date-range-input [formGroupName]="field.name" [rangePicker]="picker" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [min]="field.min" [max]="field.max">
4014
- <input matStartDate formControlName="start" [placeholder]="(field.placeholder?.start ? field.placeholder?.start : '')" />
4015
- <input matEndDate formControlName="end" [placeholder]="(field.placeholder?.end ? field.placeholder?.end : '')" />
4433
+ <mat-date-range-input [formGroupName]="field.name" [rangePicker]="picker" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [min]="min()" [max]="max()">
4434
+ <input matStartDate formControlName="start" [placeholder]="field.placeholder?.start ? field.placeholder?.start : ''" />
4435
+ <input matEndDate formControlName="end" [placeholder]="field.placeholder?.end ? field.placeholder?.end : ''" />
4016
4436
  </mat-date-range-input>
4017
4437
 
4018
4438
  <div matSuffix class="suffix">
@@ -4022,12 +4442,12 @@ let KlesFormRangeComponent = class KlesFormRangeComponent extends KlesFieldAbstr
4022
4442
 
4023
4443
  <mat-date-range-picker #picker></mat-date-range-picker>
4024
4444
  @if (field.hint) {
4025
- <mat-hint>{{ field.hint }}</mat-hint>
4445
+ <mat-hint>{{ field.hint }}</mat-hint>
4026
4446
  }
4027
4447
 
4028
4448
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
4029
4449
  </mat-form-field>
4030
- `, isInline: true, styles: [".suffix{display:flex;align-items:center}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i3$1.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i3$1.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i3$1.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i3$1.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }] }); }
4450
+ `, isInline: true, styles: [".suffix{display:flex;align-items:center}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i3$2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i3$2.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i3$2.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i3$2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }] }); }
4031
4451
  };
4032
4452
  KlesFormRangeComponent = __decorate([
4033
4453
  FieldMapper({ type: EnumType.range, factory: (field) => new KlesFormRange(field).create() })
@@ -4035,12 +4455,12 @@ KlesFormRangeComponent = __decorate([
4035
4455
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormRangeComponent, decorators: [{
4036
4456
  type: Component,
4037
4457
  args: [{ selector: 'kles-form-rangepicker', template: `
4038
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [color]="field.color" [formGroup]="group" [appearance]="field.appearance">
4458
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [color]="color()" [formGroup]="group" [appearance]="appearance()">
4039
4459
  <mat-label>{{ field.label }}</mat-label>
4040
4460
 
4041
- <mat-date-range-input [formGroupName]="field.name" [rangePicker]="picker" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [min]="field.min" [max]="field.max">
4042
- <input matStartDate formControlName="start" [placeholder]="(field.placeholder?.start ? field.placeholder?.start : '')" />
4043
- <input matEndDate formControlName="end" [placeholder]="(field.placeholder?.end ? field.placeholder?.end : '')" />
4461
+ <mat-date-range-input [formGroupName]="field.name" [rangePicker]="picker" matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [min]="min()" [max]="max()">
4462
+ <input matStartDate formControlName="start" [placeholder]="field.placeholder?.start ? field.placeholder?.start : ''" />
4463
+ <input matEndDate formControlName="end" [placeholder]="field.placeholder?.end ? field.placeholder?.end : ''" />
4044
4464
  </mat-date-range-input>
4045
4465
 
4046
4466
  <div matSuffix class="suffix">
@@ -4050,7 +4470,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4050
4470
 
4051
4471
  <mat-date-range-picker #picker></mat-date-range-picker>
4052
4472
  @if (field.hint) {
4053
- <mat-hint>{{ field.hint }}</mat-hint>
4473
+ <mat-hint>{{ field.hint }}</mat-hint>
4054
4474
  }
4055
4475
 
4056
4476
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
@@ -4059,12 +4479,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4059
4479
  }] });
4060
4480
 
4061
4481
  class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
4062
- constructor(viewRef, ref, intl) {
4063
- super(viewRef, ref, intl);
4064
- this.viewRef = viewRef;
4065
- this.ref = ref;
4066
- this.intl = intl;
4067
- }
4068
4482
  ngOnInit() {
4069
4483
  this.field.lazy = true;
4070
4484
  this.field.debounceTime = this.field.debounceTime ? this.field.debounceTime : 500;
@@ -4091,7 +4505,7 @@ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
4091
4505
  }
4092
4506
  openChangeEvent() {
4093
4507
  this.openChange$
4094
- .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
4508
+ .pipe(takeUntil$1(this._onDestroy), switchMap((isOpen) => {
4095
4509
  return this.onOpenChange(isOpen).pipe(map((options) => ({ options, isOpen })));
4096
4510
  }))
4097
4511
  .subscribe(({ options, isOpen }) => {
@@ -4103,17 +4517,17 @@ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
4103
4517
  this.ref.markForCheck();
4104
4518
  });
4105
4519
  }
4106
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectLazySearchComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: KlesDynamicFormIntl }], target: i0.ɵɵFactoryTarget.Component }); }
4520
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectLazySearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4107
4521
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormSelectLazySearchComponent, isStandalone: true, selector: "kles-form-select-lazy-search", usesInheritance: true, ngImport: i0, template: `
4108
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
4522
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()" class="field-bottom">
4109
4523
  @if (field.label) {
4110
- <mat-label>{{ field.label }}</mat-label>
4524
+ <mat-label>{{ field.label }}</mat-label>
4111
4525
  }
4112
4526
 
4113
4527
  <mat-select
4114
4528
  matTooltip="{{ field.tooltip }}"
4115
4529
  [attr.id]="field.id"
4116
- [ngClass]="field.ngClass"
4530
+ [ngClass]="ngClass()"
4117
4531
  (openedChange)="openChange($event)"
4118
4532
  [compareWith]="compareFn"
4119
4533
  [panelWidth]="field.panelWidth || 'auto'"
@@ -4122,93 +4536,117 @@ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
4122
4536
  [multiple]="field.multiple"
4123
4537
  >
4124
4538
  @if (field.triggerComponent) {
4125
- <mat-select-trigger>
4126
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
4127
- </mat-select-trigger>
4128
- } @if (field.virtualScroll) {
4129
- <mat-option>
4130
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4131
- </mat-option>
4132
-
4133
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
4134
- @if (!isLoading()) { @if (field.multiple) {
4135
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4136
- {{ intl.selectAll }}
4137
- </mat-checkbox>
4138
- } @if (!field.autocompleteComponent) {
4139
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
4140
-
4141
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
4142
- <mat-option [value]="item" style="display:none">
4143
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
4144
- </mat-option>
4145
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
4146
- <mat-option [value]="item" style="display:none">
4147
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
4148
- </mat-option>
4149
- } } } @else {
4150
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
4151
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4539
+ <mat-select-trigger>
4540
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
4541
+ </mat-select-trigger>
4542
+ }
4543
+ @if (field.virtualScroll) {
4544
+ <mat-option>
4545
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4152
4546
  </mat-option>
4153
4547
 
4154
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
4155
- <mat-option [value]="item" style="display:none">
4156
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4157
- </mat-option>
4158
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
4159
- <mat-option [value]="item" style="display:none">
4160
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4548
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
4549
+ @if (!isLoading()) {
4550
+ @if (field.multiple) {
4551
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4552
+ {{ intl.selectAll }}
4553
+ </mat-checkbox>
4554
+ }
4555
+ @if (!field.autocompleteComponent) {
4556
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
4557
+
4558
+ @if (field.multiple) {
4559
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
4560
+ <mat-option [value]="item" style="display:none">
4561
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
4562
+ </mat-option>
4563
+ }
4564
+ }
4565
+ @if (!field.multiple && group.controls[field.name].value) {
4566
+ @for (item of [group?.controls[field.name]?.value]; track item) {
4567
+ <mat-option [value]="item" style="display:none">
4568
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
4569
+ </mat-option>
4570
+ }
4571
+ }
4572
+ } @else {
4573
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
4574
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4575
+ </mat-option>
4576
+
4577
+ @if (field.multiple) {
4578
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
4579
+ <mat-option [value]="item" style="display:none">
4580
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4581
+ </mat-option>
4582
+ }
4583
+ }
4584
+ @if (!field.multiple && group.controls[field.name].value) {
4585
+ @for (item of [group?.controls[field.name]?.value]; track item) {
4586
+ <mat-option [value]="item" style="display:none">
4587
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4588
+ </mat-option>
4589
+ }
4590
+ }
4591
+ }
4592
+ } @else {
4593
+ <mat-option class="hide-checkbox" disabled
4594
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4595
+ ></mat-option>
4596
+ }
4597
+ </cdk-virtual-scroll-viewport>
4598
+ } @else {
4599
+ <mat-option>
4600
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4161
4601
  </mat-option>
4162
- } } } } @else {
4163
- <mat-option class="hide-checkbox" disabled
4164
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4165
- ></mat-option>
4602
+
4603
+ @if (!isLoading()) {
4604
+ @if (field.multiple) {
4605
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4606
+ {{ intl.selectAll }}
4607
+ </mat-checkbox>
4608
+ }
4609
+ @if (!field.autocompleteComponent) {
4610
+ @for (item of optionsFiltered$ | async; track item) {
4611
+ <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
4612
+ }
4613
+ } @else {
4614
+ @for (item of optionsFiltered$ | async; track item) {
4615
+ <mat-option [value]="item" [disabled]="item?.disabled">
4616
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4617
+ </mat-option>
4618
+ }
4619
+ }
4620
+ } @else {
4621
+ <mat-option class="hide-checkbox" disabled
4622
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4623
+ ></mat-option>
4166
4624
  }
4167
- </cdk-virtual-scroll-viewport>
4168
- } @else {
4169
- <mat-option>
4170
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4171
- </mat-option>
4172
-
4173
- @if (!isLoading()) { @if (field.multiple) {
4174
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4175
- {{ intl.selectAll }}
4176
- </mat-checkbox>
4177
- } @if (!field.autocompleteComponent) { @for (item of optionsFiltered$ | async; track item) {
4178
- <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
4179
- } } @else { @for (item of optionsFiltered$ | async; track item) {
4180
- <mat-option [value]="item" [disabled]="item?.disabled">
4181
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4182
- </mat-option>
4183
- } } } @else {
4184
- <mat-option class="hide-checkbox" disabled
4185
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4186
- ></mat-option>
4187
- } }
4625
+ }
4188
4626
  </mat-select>
4189
4627
 
4190
4628
  @if (field.subComponents || field.clearable) {
4191
- <div matSuffix>
4192
- <ng-content></ng-content>
4193
- </div>
4629
+ <div matSuffix>
4630
+ <ng-content></ng-content>
4631
+ </div>
4194
4632
  }
4195
4633
 
4196
4634
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
4197
4635
  </mat-form-field>
4198
- `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", ".selectAll{padding:0 16px 0 5px;display:flex!important}\n", ".selectAll .mdc-form-field{width:100%}\n", ".selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", ".selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i5$2.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
4636
+ `, isInline: true, styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", ".selectAll{padding:0 16px 0 5px;display:flex!important}\n", ".selectAll .mdc-form-field{width:100%}\n", ".selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", ".selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "component", type: MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i4.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i4$2.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
4199
4637
  }
4200
4638
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectLazySearchComponent, decorators: [{
4201
4639
  type: Component,
4202
4640
  args: [{ selector: 'kles-form-select-lazy-search', template: `
4203
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
4641
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="color()" [formGroup]="group" [appearance]="appearance()" class="field-bottom">
4204
4642
  @if (field.label) {
4205
- <mat-label>{{ field.label }}</mat-label>
4643
+ <mat-label>{{ field.label }}</mat-label>
4206
4644
  }
4207
4645
 
4208
4646
  <mat-select
4209
4647
  matTooltip="{{ field.tooltip }}"
4210
4648
  [attr.id]="field.id"
4211
- [ngClass]="field.ngClass"
4649
+ [ngClass]="ngClass()"
4212
4650
  (openedChange)="openChange($event)"
4213
4651
  [compareWith]="compareFn"
4214
4652
  [panelWidth]="field.panelWidth || 'auto'"
@@ -4217,81 +4655,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4217
4655
  [multiple]="field.multiple"
4218
4656
  >
4219
4657
  @if (field.triggerComponent) {
4220
- <mat-select-trigger>
4221
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
4222
- </mat-select-trigger>
4223
- } @if (field.virtualScroll) {
4224
- <mat-option>
4225
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4226
- </mat-option>
4227
-
4228
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
4229
- @if (!isLoading()) { @if (field.multiple) {
4230
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4231
- {{ intl.selectAll }}
4232
- </mat-checkbox>
4233
- } @if (!field.autocompleteComponent) {
4234
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
4235
-
4236
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
4237
- <mat-option [value]="item" style="display:none">
4238
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
4239
- </mat-option>
4240
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
4241
- <mat-option [value]="item" style="display:none">
4242
- {{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}
4243
- </mat-option>
4244
- } } } @else {
4245
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
4246
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4658
+ <mat-select-trigger>
4659
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
4660
+ </mat-select-trigger>
4661
+ }
4662
+ @if (field.virtualScroll) {
4663
+ <mat-option>
4664
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4247
4665
  </mat-option>
4248
4666
 
4249
- @if (field.multiple) { @for (item of group.controls[field.name].value | slice:0:30; track item) {
4250
- <mat-option [value]="item" style="display:none">
4251
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4252
- </mat-option>
4253
- } } @if (!field.multiple && group.controls[field.name].value) { @for (item of [group?.controls[field.name]?.value]; track item) {
4254
- <mat-option [value]="item" style="display:none">
4255
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4667
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]="4 * 48">
4668
+ @if (!isLoading()) {
4669
+ @if (field.multiple) {
4670
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4671
+ {{ intl.selectAll }}
4672
+ </mat-checkbox>
4673
+ }
4674
+ @if (!field.autocompleteComponent) {
4675
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
4676
+
4677
+ @if (field.multiple) {
4678
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
4679
+ <mat-option [value]="item" style="display:none">
4680
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
4681
+ </mat-option>
4682
+ }
4683
+ }
4684
+ @if (!field.multiple && group.controls[field.name].value) {
4685
+ @for (item of [group?.controls[field.name]?.value]; track item) {
4686
+ <mat-option [value]="item" style="display:none">
4687
+ {{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}
4688
+ </mat-option>
4689
+ }
4690
+ }
4691
+ } @else {
4692
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
4693
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4694
+ </mat-option>
4695
+
4696
+ @if (field.multiple) {
4697
+ @for (item of group.controls[field.name].value | slice: 0 : 30; track item) {
4698
+ <mat-option [value]="item" style="display:none">
4699
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4700
+ </mat-option>
4701
+ }
4702
+ }
4703
+ @if (!field.multiple && group.controls[field.name].value) {
4704
+ @for (item of [group?.controls[field.name]?.value]; track item) {
4705
+ <mat-option [value]="item" style="display:none">
4706
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4707
+ </mat-option>
4708
+ }
4709
+ }
4710
+ }
4711
+ } @else {
4712
+ <mat-option class="hide-checkbox" disabled
4713
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4714
+ ></mat-option>
4715
+ }
4716
+ </cdk-virtual-scroll-viewport>
4717
+ } @else {
4718
+ <mat-option>
4719
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4256
4720
  </mat-option>
4257
- } } } } @else {
4258
- <mat-option class="hide-checkbox" disabled
4259
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4260
- ></mat-option>
4721
+
4722
+ @if (!isLoading()) {
4723
+ @if (field.multiple) {
4724
+ <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4725
+ {{ intl.selectAll }}
4726
+ </mat-checkbox>
4727
+ }
4728
+ @if (!field.autocompleteComponent) {
4729
+ @for (item of optionsFiltered$ | async; track item) {
4730
+ <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform: field.pipeTransform }}</mat-option>
4731
+ }
4732
+ } @else {
4733
+ @for (item of optionsFiltered$ | async; track item) {
4734
+ <mat-option [value]="item" [disabled]="item?.disabled">
4735
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4736
+ </mat-option>
4737
+ }
4738
+ }
4739
+ } @else {
4740
+ <mat-option class="hide-checkbox" disabled
4741
+ ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4742
+ ></mat-option>
4261
4743
  }
4262
- </cdk-virtual-scroll-viewport>
4263
- } @else {
4264
- <mat-option>
4265
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false" placeholderLabel="" noEntriesFoundLabel=""></ngx-mat-select-search>
4266
- </mat-option>
4267
-
4268
- @if (!isLoading()) { @if (field.multiple) {
4269
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
4270
- {{ intl.selectAll }}
4271
- </mat-checkbox>
4272
- } @if (!field.autocompleteComponent) { @for (item of optionsFiltered$ | async; track item) {
4273
- <mat-option [value]="item" [disabled]="item?.disabled">{{ (field.property ? item[field.property] : item) | klesTransform : field.pipeTransform }}</mat-option>
4274
- } } @else { @for (item of optionsFiltered$ | async; track item) {
4275
- <mat-option [value]="item" [disabled]="item?.disabled">
4276
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
4277
- </mat-option>
4278
- } } } @else {
4279
- <mat-option class="hide-checkbox" disabled
4280
- ><div class="loadingSelect">{{ intl.loading }}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div
4281
- ></mat-option>
4282
- } }
4744
+ }
4283
4745
  </mat-select>
4284
4746
 
4285
4747
  @if (field.subComponents || field.clearable) {
4286
- <div matSuffix>
4287
- <ng-content></ng-content>
4288
- </div>
4748
+ <div matSuffix>
4749
+ <ng-content></ng-content>
4750
+ </div>
4289
4751
  }
4290
4752
 
4291
4753
  <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
4292
4754
  </mat-form-field>
4293
- `, standalone: true, imports: [CommonModule, KlesTransformPipe, MatErrorMessageDirective, MatProgressSpinnerModule, MatSelectModule, KlesComponentDirective, ReactiveFormsModule, NgxMatSelectSearchModule, ScrollingModule, MatTooltipModule], styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", ".selectAll{padding:0 16px 0 5px;display:flex!important}\n", ".selectAll .mdc-form-field{width:100%}\n", ".selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", ".selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"] }]
4294
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: KlesDynamicFormIntl }] });
4755
+ `, standalone: true, imports: [CommonModule, KlesTransformPipe, MatErrorMessageDirective, MatFormFieldModule, MatProgressSpinnerModule, MatSelectModule, KlesComponentDirective, ReactiveFormsModule, NgxMatSelectSearchModule, ScrollingModule, MatTooltipModule], styles: [".loadingSelect{display:flex;flex-direction:row;justify-content:space-between;align-items:center}\n", ".field-bottom .mat-mdc-form-field-bottom-align:before{content:none!important}\n", "mat-form-field{width:100%}\n", ".selectAll{padding:0 16px 0 5px;display:flex!important}\n", ".selectAll .mdc-form-field{width:100%}\n", ".selectAll .mdc-form-field .mdc-label{width:100%;min-height:48px;align-items:center;display:flex}\n", ".selectAll .mdc-form-field .mdc-checkbox__ripple{display:none!important}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"] }]
4756
+ }] });
4295
4757
 
4296
4758
  class KlesFabComponent extends KlesButtonBase {
4297
4759
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFabComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
@@ -4314,7 +4776,7 @@ class KlesFabComponent extends KlesButtonBase {
4314
4776
  <mat-icon svgIcon="{{iconSvg}}"></mat-icon>
4315
4777
  }
4316
4778
  </button>
4317
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$2.MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }] }); }
4779
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$3.MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }] }); }
4318
4780
  }
4319
4781
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFabComponent, decorators: [{
4320
4782
  type: Component,
@@ -4357,10 +4819,10 @@ class KlesFormFabComponent extends KlesFieldAbstract {
4357
4819
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormFabComponent, isStandalone: true, selector: "kles-form-fab", usesInheritance: true, ngImport: i0, template: `
4358
4820
  <div [formGroup]="group">
4359
4821
  <kles-fab
4360
- [attr.id]="field.id" [classButton]="field.ngClass"
4361
- [name]="field.name" [label]="field.label" [color]="field.color"
4362
- [icon]="field.icon"
4363
- [iconSvg]="field.iconSvg"
4822
+ [attr.id]="field.id" [classButton]="ngClass()"
4823
+ [name]="field.name" [label]="field.label" [color]="color()"
4824
+ [icon]="icon()"
4825
+ [iconSvg]="iconSvg()"
4364
4826
  [value]="field.value"
4365
4827
  [formControlName]="field.name"
4366
4828
  [tooltip]="field.tooltip"
@@ -4375,10 +4837,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4375
4837
  args: [{ selector: 'kles-form-fab', template: `
4376
4838
  <div [formGroup]="group">
4377
4839
  <kles-fab
4378
- [attr.id]="field.id" [classButton]="field.ngClass"
4379
- [name]="field.name" [label]="field.label" [color]="field.color"
4380
- [icon]="field.icon"
4381
- [iconSvg]="field.iconSvg"
4840
+ [attr.id]="field.id" [classButton]="ngClass()"
4841
+ [name]="field.name" [label]="field.label" [color]="color()"
4842
+ [icon]="icon()"
4843
+ [iconSvg]="iconSvg()"
4382
4844
  [value]="field.value"
4383
4845
  [formControlName]="field.name"
4384
4846
  [tooltip]="field.tooltip"
@@ -4410,7 +4872,7 @@ class KlesMiniFabComponent extends KlesButtonBase {
4410
4872
  <mat-icon svgIcon="{{iconSvg}}"></mat-icon>
4411
4873
  }
4412
4874
  </button>
4413
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$2.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }] }); }
4875
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$3.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }] }); }
4414
4876
  }
4415
4877
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesMiniFabComponent, decorators: [{
4416
4878
  type: Component,
@@ -4453,10 +4915,10 @@ class KlesFormMiniFabComponent extends KlesFieldAbstract {
4453
4915
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormMiniFabComponent, isStandalone: true, selector: "kles-form-mini-fab", usesInheritance: true, ngImport: i0, template: `
4454
4916
  <div [formGroup]="group">
4455
4917
  <kles-mini-fab
4456
- [attr.id]="field.id" [classButton]="field.ngClass"
4457
- [name]="field.name" [label]="field.label" [color]="field.color"
4458
- [icon]="field.icon"
4459
- [iconSvg]="field.iconSvg"
4918
+ [attr.id]="field.id" [classButton]="ngClass()"
4919
+ [name]="field.name" [label]="field.label" [color]="color()"
4920
+ [icon]="icon()"
4921
+ [iconSvg]="iconSvg()"
4460
4922
  [value]="field.value"
4461
4923
  [formControlName]="field.name"
4462
4924
  [tooltip]="field.tooltip"
@@ -4471,10 +4933,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4471
4933
  args: [{ selector: 'kles-form-mini-fab', template: `
4472
4934
  <div [formGroup]="group">
4473
4935
  <kles-mini-fab
4474
- [attr.id]="field.id" [classButton]="field.ngClass"
4475
- [name]="field.name" [label]="field.label" [color]="field.color"
4476
- [icon]="field.icon"
4477
- [iconSvg]="field.iconSvg"
4936
+ [attr.id]="field.id" [classButton]="ngClass()"
4937
+ [name]="field.name" [label]="field.label" [color]="color()"
4938
+ [icon]="icon()"
4939
+ [iconSvg]="iconSvg()"
4478
4940
  [value]="field.value"
4479
4941
  [formControlName]="field.name"
4480
4942
  [tooltip]="field.tooltip"
@@ -4501,7 +4963,7 @@ class KlesIconButtonComponent extends KlesButtonBase {
4501
4963
  <mat-icon svgIcon="{{ iconSvg }}"></mat-icon>
4502
4964
  }
4503
4965
  </button>
4504
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
4966
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
4505
4967
  }
4506
4968
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesIconButtonComponent, decorators: [{
4507
4969
  type: Component,
@@ -4539,10 +5001,10 @@ class KlesFormIconButtonComponent extends KlesFieldAbstract {
4539
5001
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormIconButtonComponent, isStandalone: true, selector: "kles-form-icon-button", usesInheritance: true, ngImport: i0, template: `
4540
5002
  <div [formGroup]="group">
4541
5003
  <kles-icon-button
4542
- [attr.id]="field.id" [classButton]="field.ngClass"
4543
- [name]="field.name" [color]="field.color"
4544
- [icon]="field.icon"
4545
- [iconSvg]="field.iconSvg"
5004
+ [attr.id]="field.id" [classButton]="ngClass()"
5005
+ [name]="field.name" [color]="color()"
5006
+ [icon]="icon()"
5007
+ [iconSvg]="iconSvg()"
4546
5008
  [value]="field.value"
4547
5009
  [formControlName]="field.name"
4548
5010
  [tooltip]="field.tooltip"
@@ -4557,10 +5019,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4557
5019
  args: [{ selector: 'kles-form-icon-button', template: `
4558
5020
  <div [formGroup]="group">
4559
5021
  <kles-icon-button
4560
- [attr.id]="field.id" [classButton]="field.ngClass"
4561
- [name]="field.name" [color]="field.color"
4562
- [icon]="field.icon"
4563
- [iconSvg]="field.iconSvg"
5022
+ [attr.id]="field.id" [classButton]="ngClass()"
5023
+ [name]="field.name" [color]="color()"
5024
+ [icon]="icon()"
5025
+ [iconSvg]="iconSvg()"
4564
5026
  [value]="field.value"
4565
5027
  [formControlName]="field.name"
4566
5028
  [tooltip]="field.tooltip"
@@ -4595,15 +5057,15 @@ class KlesFormSelectionListSearchComponent extends KlesFieldAbstract {
4595
5057
  if (this.field.options instanceof Observable) {
4596
5058
  this.options$ = this.field.options.pipe(shareReplay(1));
4597
5059
  }
4598
- this.group.controls[this.field.name].valueChanges.pipe(takeUntil(this._onDestroy)).subscribe((value) => {
5060
+ this.group.controls[this.field.name].valueChanges.pipe(takeUntil$1(this._onDestroy)).subscribe((value) => {
4599
5061
  this.selection.setSelection(Array.isArray(value) ? value : [value], { emitEvent: false });
4600
5062
  });
4601
- this.selection.changed.pipe(takeUntil(this._onDestroy)).subscribe((change) => {
5063
+ this.selection.changed.pipe(takeUntil$1(this._onDestroy)).subscribe((change) => {
4602
5064
  this.group.controls[this.field.name].patchValue(change.source.selected);
4603
5065
  this.group.controls[this.field.name].markAllAsTouched();
4604
5066
  this.group.controls[this.field.name].markAsDirty();
4605
5067
  });
4606
- this.optionFiltered$ = this.searchControl.valueChanges.pipe(takeUntil(this._onDestroy), startWith(null), debounceTime(this.field.debounceTime || 0), distinctUntilChanged(), map((value) => value?.toLowerCase()), switchMap((value) => {
5068
+ this.optionFiltered$ = this.searchControl.valueChanges.pipe(takeUntil$1(this._onDestroy), startWith$1(null), debounceTime(this.field.debounceTime || 0), distinctUntilChanged(), map((value) => value?.toLowerCase()), switchMap((value) => {
4607
5069
  if (this.field.options instanceof Function) {
4608
5070
  return this.field.options(value);
4609
5071
  }
@@ -4632,7 +5094,7 @@ class KlesFormSelectionListSearchComponent extends KlesFieldAbstract {
4632
5094
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectionListSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4633
5095
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: KlesFormSelectionListSearchComponent, isStandalone: true, selector: "kles-form-selection-list-search", usesInheritance: true, ngImport: i0, template: `
4634
5096
  <div class="selection-list" [formGroup]="group">
4635
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [appearance]="field.appearance">
5097
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [appearance]="appearance()">
4636
5098
  @if (field.label) {
4637
5099
  <mat-label>{{ field.label }}</mat-label>
4638
5100
  }
@@ -4642,7 +5104,7 @@ class KlesFormSelectionListSearchComponent extends KlesFieldAbstract {
4642
5104
  </button>
4643
5105
  </mat-form-field>
4644
5106
 
4645
- <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="field.ngClass" (selectionChange)="onSelectionChange($event)">
5107
+ <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="ngClass()" (selectionChange)="onSelectionChange($event)">
4646
5108
  @if(optionFiltered$ | async; as options){ @if(field.virtualScroll){
4647
5109
  <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 20" style="height:100%">
4648
5110
  @if (!field.autocompleteComponent) {
@@ -4668,13 +5130,13 @@ class KlesFormSelectionListSearchComponent extends KlesFieldAbstract {
4668
5130
  }
4669
5131
  </mat-selection-list>
4670
5132
  </div>
4671
- `, isInline: true, styles: [".selection-list{display:flex;flex-direction:column;gap:5px}\n", "mat-selection-list{width:100%;height:250px;overflow:auto;flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i4$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i4$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i4$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3$3.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i3$3.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }] }); }
5133
+ `, isInline: true, styles: [".selection-list{display:flex;flex-direction:column;gap:5px}\n", "mat-selection-list{width:100%;height:250px;overflow:auto;flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3$4.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i3$4.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }] }); }
4672
5134
  }
4673
5135
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormSelectionListSearchComponent, decorators: [{
4674
5136
  type: Component,
4675
5137
  args: [{ selector: 'kles-form-selection-list-search', template: `
4676
5138
  <div class="selection-list" [formGroup]="group">
4677
- <mat-form-field [subscriptSizing]="field.subscriptSizing" [appearance]="field.appearance">
5139
+ <mat-form-field [subscriptSizing]="field.subscriptSizing" [appearance]="appearance()">
4678
5140
  @if (field.label) {
4679
5141
  <mat-label>{{ field.label }}</mat-label>
4680
5142
  }
@@ -4684,7 +5146,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4684
5146
  </button>
4685
5147
  </mat-form-field>
4686
5148
 
4687
- <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="field.ngClass" (selectionChange)="onSelectionChange($event)">
5149
+ <mat-selection-list [attr.id]="field.id" [multiple]="field.multiple" [ngClass]="ngClass()" (selectionChange)="onSelectionChange($event)">
4688
5150
  @if(optionFiltered$ | async; as options){ @if(field.virtualScroll){
4689
5151
  <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 20" style="height:100%">
4690
5152
  @if (!field.autocompleteComponent) {
@@ -4816,11 +5278,11 @@ let KlesFormCheckboxIndeterminateComponent = class KlesFormCheckboxIndeterminate
4816
5278
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCheckboxIndeterminateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4817
5279
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormCheckboxIndeterminateComponent, isStandalone: true, selector: "kles-form-checkbox-indeterminate", usesInheritance: true, ngImport: i0, template: `
4818
5280
  <div [formGroup]="group">
4819
- <kles-checkbox-indeterminate matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [color]="field.color" [formControlName]="field.name">{{
5281
+ <kles-checkbox-indeterminate matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [color]="color()" [formControlName]="field.name">{{
4820
5282
  field.label
4821
5283
  }}</kles-checkbox-indeterminate>
4822
5284
  </div>
4823
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: KlesIndeterminateCheckboxComponent, selector: "kles-checkbox-indeterminate", inputs: ["label", "color"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
5285
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: KlesIndeterminateCheckboxComponent, selector: "kles-checkbox-indeterminate", inputs: ["label", "color"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
4824
5286
  };
4825
5287
  KlesFormCheckboxIndeterminateComponent = __decorate([
4826
5288
  FieldMapper({ type: EnumType.checkbox })
@@ -4829,60 +5291,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4829
5291
  type: Component,
4830
5292
  args: [{ selector: 'kles-form-checkbox-indeterminate', template: `
4831
5293
  <div [formGroup]="group">
4832
- <kles-checkbox-indeterminate matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="field.ngClass" [color]="field.color" [formControlName]="field.name">{{
5294
+ <kles-checkbox-indeterminate matTooltip="{{ field.tooltip }}" [attr.id]="field.id" [ngClass]="ngClass()" [color]="color()" [formControlName]="field.name">{{
4833
5295
  field.label
4834
5296
  }}</kles-checkbox-indeterminate>
4835
5297
  </div>
4836
5298
  `, standalone: true, imports: [CommonModule, FormsModule, ReactiveFormsModule, KlesIndeterminateCheckboxComponent, MatTooltipModule] }]
4837
5299
  }] });
4838
5300
 
4839
- class KlesFormCopyComponent {
4840
- constructor(clipBoard) {
4841
- this.clipBoard = clipBoard;
4842
- }
4843
- ngOnInit() {
4844
- this.tooltipText = this.field.copyTooltip || '';
4845
- }
4846
- copy(event) {
4847
- event.stopPropagation();
4848
- const copyText = (this.field.property ? this.group.controls[this.field.name].value?.[this.field.property] : this.group.controls[this.field.name].value) || '';
4849
- this.clipBoard.copy(copyText);
4850
- this.tooltip.disabled = false;
4851
- this.tooltip.show();
4852
- setTimeout(() => {
4853
- this.tooltip.disabled = true;
4854
- }, 200);
4855
- }
4856
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCopyComponent, deps: [{ token: i1$2.Clipboard }], target: i0.ɵɵFactoryTarget.Component }); }
4857
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormCopyComponent, isStandalone: true, selector: "kles-form-copy", inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, viewQueries: [{ propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], ngImport: i0, template: `
4858
- <button #tooltip="matTooltip" mat-icon-button color="primary" type="button" (click)="copy($event)" [matTooltipDisabled]="true" [matTooltip]="tooltipText" matTooltipPosition="above">
4859
- <mat-icon>content_copy</mat-icon>
4860
- </button>
4861
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ClipboardModule }] }); }
4862
- }
4863
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCopyComponent, decorators: [{
4864
- type: Component,
4865
- args: [{
4866
- selector: 'kles-form-copy',
4867
- template: `
4868
- <button #tooltip="matTooltip" mat-icon-button color="primary" type="button" (click)="copy($event)" [matTooltipDisabled]="true" [matTooltip]="tooltipText" matTooltipPosition="above">
4869
- <mat-icon>content_copy</mat-icon>
4870
- </button>
4871
- `,
4872
- standalone: true,
4873
- imports: [CommonModule, MatIconModule, MatButtonModule, MatTooltipModule, ClipboardModule],
4874
- }]
4875
- }], ctorParameters: () => [{ type: i1$2.Clipboard }], propDecorators: { tooltip: [{
4876
- type: ViewChild,
4877
- args: ['tooltip']
4878
- }], field: [{
4879
- type: Input
4880
- }], group: [{
4881
- type: Input
4882
- }], siblingFields: [{
4883
- type: Input
4884
- }] } });
4885
-
4886
5301
  class KlesFileControlComponent {
4887
5302
  constructor() {
4888
5303
  this.disabled = false;
@@ -4969,6 +5384,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
4969
5384
  `, standalone: true, imports: [KlesFileControlComponent, FormsModule, ReactiveFormsModule], styles: ["mat-form-field{width:100%}\n"] }]
4970
5385
  }] });
4971
5386
 
5387
+ class KlesFormCopyComponent {
5388
+ constructor(clipBoard) {
5389
+ this.clipBoard = clipBoard;
5390
+ this.field = inject(FIELD);
5391
+ this.group = inject(GROUP);
5392
+ this.siblingFields = inject(SIBLING_FIELDS);
5393
+ this.tooltipText = this.field.copyTooltip || '';
5394
+ }
5395
+ copy(event) {
5396
+ event.stopPropagation();
5397
+ const copyText = (this.field.property ? this.group.controls[this.field.name].value?.[this.field.property] : this.group.controls[this.field.name].value) || '';
5398
+ this.clipBoard.copy(copyText);
5399
+ this.tooltip.disabled = false;
5400
+ this.tooltip.show();
5401
+ setTimeout(() => {
5402
+ this.tooltip.disabled = true;
5403
+ }, 1000);
5404
+ }
5405
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCopyComponent, deps: [{ token: i1$2.Clipboard }], target: i0.ɵɵFactoryTarget.Component }); }
5406
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormCopyComponent, isStandalone: true, selector: "kles-form-copy", viewQueries: [{ propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], ngImport: i0, template: `
5407
+ <button #tooltip="matTooltip" mat-icon-button color="primary" type="button" (click)="copy($event)" [matTooltipDisabled]="true" [matTooltip]="tooltipText" matTooltipPosition="above">
5408
+ <mat-icon>content_copy</mat-icon>
5409
+ </button>
5410
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ClipboardModule }] }); }
5411
+ }
5412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormCopyComponent, decorators: [{
5413
+ type: Component,
5414
+ args: [{
5415
+ selector: 'kles-form-copy',
5416
+ template: `
5417
+ <button #tooltip="matTooltip" mat-icon-button color="primary" type="button" (click)="copy($event)" [matTooltipDisabled]="true" [matTooltip]="tooltipText" matTooltipPosition="above">
5418
+ <mat-icon>content_copy</mat-icon>
5419
+ </button>
5420
+ `,
5421
+ standalone: true,
5422
+ imports: [CommonModule, MatIconModule, MatButtonModule, MatTooltipModule, ClipboardModule],
5423
+ }]
5424
+ }], ctorParameters: () => [{ type: i1$2.Clipboard }], propDecorators: { tooltip: [{
5425
+ type: ViewChild,
5426
+ args: ['tooltip']
5427
+ }] } });
5428
+
4972
5429
  const components = [
4973
5430
  KlesDynamicFormComponent,
4974
5431
  KlesFormLabelComponent,
@@ -5108,10 +5565,7 @@ class KlesMaterialDynamicformsModule {
5108
5565
  KlesFormIconButtonComponent,
5109
5566
  KlesFormSelectionListSearchComponent,
5110
5567
  KlesFormCopyComponent, KlesTransformPipe, ArrayFormatPipe, KlesDynamicFieldDirective, KlesComponentDirective, MatErrorMessageDirective, MatErrorFormDirective] }); }
5111
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesMaterialDynamicformsModule, providers: [
5112
- { provide: ErrorStateMatcher, useClass: KlesFormErrorStateMatcher },
5113
- pipes,
5114
- ], imports: [CommonModule, ReactiveFormsModule, FormsModule, MaterialModule, NgxMatSelectSearchModule, KlesDynamicFormComponent,
5568
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesMaterialDynamicformsModule, providers: [{ provide: ErrorStateMatcher, useClass: KlesFormErrorStateMatcher }, pipes], imports: [CommonModule, ReactiveFormsModule, FormsModule, MaterialModule, NgxMatSelectSearchModule, KlesDynamicFormComponent,
5115
5569
  KlesFormLabelComponent,
5116
5570
  KlesFormInputComponent,
5117
5571
  KlesFormInputClearableComponent,
@@ -5159,10 +5613,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
5159
5613
  type: NgModule,
5160
5614
  args: [{
5161
5615
  imports: [CommonModule, ReactiveFormsModule, FormsModule, MaterialModule, NgxMatSelectSearchModule, components, directives, pipes, colorPicker],
5162
- providers: [
5163
- { provide: ErrorStateMatcher, useClass: KlesFormErrorStateMatcher },
5164
- pipes,
5165
- ],
5616
+ providers: [{ provide: ErrorStateMatcher, useClass: KlesFormErrorStateMatcher }, pipes],
5166
5617
  exports: [components, pipes, directives],
5167
5618
  schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
5168
5619
  }]
@@ -5170,17 +5621,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
5170
5621
 
5171
5622
  class KlesFormPasswordVisibilityComponent {
5172
5623
  constructor() {
5173
- this.hide = true;
5624
+ this.field = inject(FIELD);
5625
+ this.group = inject(GROUP);
5626
+ this.siblingFields = inject(SIBLING_FIELDS);
5627
+ this.hide = signal(true);
5174
5628
  }
5175
5629
  toggleVisibility(event) {
5176
5630
  event.stopPropagation();
5177
- this.hide = !this.hide;
5178
- this.field.inputType = this.hide ? 'password' : 'text';
5631
+ this.hide.set(!this.hide());
5632
+ // this.field.inputType = this.hide ? 'password' : 'text';
5633
+ //TODO
5179
5634
  }
5180
5635
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: KlesFormPasswordVisibilityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5181
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormPasswordVisibilityComponent, isStandalone: true, selector: "kles-form-password-visibility", inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, ngImport: i0, template: `
5636
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: KlesFormPasswordVisibilityComponent, isStandalone: true, selector: "kles-form-password-visibility", ngImport: i0, template: `
5182
5637
  <button [disabled]="group?.get(field?.name).disabled" mat-icon-button aria-label="visibility" type="button" (click)="toggleVisibility($event)">
5183
- <mat-icon>{{ hide ? 'visibility_off' : 'visibility' }}</mat-icon>
5638
+ <mat-icon>{{ hide() ? 'visibility_off' : 'visibility' }}</mat-icon>
5184
5639
  </button>
5185
5640
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
5186
5641
  }
@@ -5190,19 +5645,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
5190
5645
  selector: 'kles-form-password-visibility',
5191
5646
  template: `
5192
5647
  <button [disabled]="group?.get(field?.name).disabled" mat-icon-button aria-label="visibility" type="button" (click)="toggleVisibility($event)">
5193
- <mat-icon>{{ hide ? 'visibility_off' : 'visibility' }}</mat-icon>
5648
+ <mat-icon>{{ hide() ? 'visibility_off' : 'visibility' }}</mat-icon>
5194
5649
  </button>
5195
5650
  `,
5196
5651
  standalone: true,
5197
5652
  imports: [CommonModule, MatIcon, MatIconButton],
5198
5653
  }]
5199
- }], propDecorators: { field: [{
5200
- type: Input
5201
- }], group: [{
5202
- type: Input
5203
- }], siblingFields: [{
5204
- type: Input
5205
- }] } });
5654
+ }] });
5206
5655
 
5207
5656
  function autocompleteObjectValidator(optional) {
5208
5657
  return (control) => {
@@ -5235,5 +5684,5 @@ function autocompleteStringValidator(validOptions, optional) {
5235
5684
  * Generated bundle index. Do not edit.
5236
5685
  */
5237
5686
 
5238
- export { ArrayFormatPipe, EnumButtonAttribute, EnumType, FieldMapper, KlesAbstractFormControl, KlesButtonBase, KlesButtonCheckerComponent, KlesButtonComponent, KlesButtonFileComponent, KlesComponentDirective, KlesDynamicFieldDirective, KlesDynamicFormComponent, KlesDynamicFormIntl, KlesFabComponent, KlesFieldAbstract, KlesFileControlComponent, KlesFormArray, KlesFormArrayComponent, KlesFormBadgeComponent, KlesFormButtonCheckerComponent, KlesFormButtonComponent, KlesFormButtonFileComponent, KlesFormButtonToogleGroupComponent, KlesFormCheckboxComponent, KlesFormCheckboxIndeterminateComponent, KlesFormChipComponent, KlesFormClearComponent, KlesFormColorComponent, KlesFormControl, KlesFormCopyComponent, KlesFormDateComponent, KlesFormErrorStateMatcher, KlesFormFabComponent, KlesFormFileComponent, KlesFormGroup, KlesFormGroupComponent, KlesFormIconButtonComponent, KlesFormIconComponent, KlesFormInputClearableComponent, KlesFormInputComponent, KlesFormLabelComponent, KlesFormLineBreakComponent, KlesFormLinkComponent, KlesFormListFieldComponent, KlesFormMiniFabComponent, KlesFormPasswordVisibilityComponent, KlesFormRadioComponent, KlesFormRange, KlesFormRangeComponent, KlesFormSelectComponent, KlesFormSelectLazySearchComponent, KlesFormSelectSearchComponent, KlesFormSelectionListComponent, KlesFormSelectionListSearchComponent, KlesFormSlideToggleComponent, KlesFormTextComponent, KlesFormTextareaComponent, KlesIconButtonComponent, KlesIndeterminateCheckboxComponent, KlesMaterialDynamicformsModule, KlesMiniFabComponent, KlesSelectionModel, KlesTransformPipe, MatErrorFormDirective, MatErrorMessageDirective, autocompleteObjectValidator, autocompleteStringValidator, componentMapper, isDestroyable, klesFieldControlFactory };
5687
+ export { AbstractUiState, ArrayFormatPipe, ArrayUiState, ControlUiState, EnumButtonAttribute, EnumType, FieldMapper, GroupUiState, KlesAbstractFormControl, KlesAbstractFormUiControl, KlesButtonBase, KlesButtonCheckerComponent, KlesButtonComponent, KlesButtonFileComponent, KlesComponentDirective, KlesDynamicFieldDirective, KlesDynamicFormComponent, KlesDynamicFormIntl, KlesFabComponent, KlesFieldAbstract, KlesFileControlComponent, KlesFormArray, KlesFormArrayComponent, KlesFormBadgeComponent, KlesFormButtonCheckerComponent, KlesFormButtonComponent, KlesFormButtonFileComponent, KlesFormButtonToogleGroupComponent, KlesFormCheckboxComponent, KlesFormCheckboxIndeterminateComponent, KlesFormChipComponent, KlesFormClearComponent, KlesFormColorComponent, KlesFormControl, KlesFormCopyComponent, KlesFormDateComponent, KlesFormErrorStateMatcher, KlesFormFabComponent, KlesFormFileComponent, KlesFormGroup, KlesFormGroupComponent, KlesFormIconButtonComponent, KlesFormIconComponent, KlesFormInputClearableComponent, KlesFormInputComponent, KlesFormLabelComponent, KlesFormLineBreakComponent, KlesFormLinkComponent, KlesFormListFieldComponent, KlesFormMiniFabComponent, KlesFormPasswordVisibilityComponent, KlesFormRadioComponent, KlesFormRange, KlesFormRangeComponent, KlesFormSelectComponent, KlesFormSelectLazySearchComponent, KlesFormSelectSearchComponent, KlesFormSelectionListComponent, KlesFormSelectionListSearchComponent, KlesFormSlideToggleComponent, KlesFormTextComponent, KlesFormTextareaComponent, KlesFormUiArray, KlesFormUiControl, KlesFormUiGroup, KlesIconButtonComponent, KlesIndeterminateCheckboxComponent, KlesMaterialDynamicformsModule, KlesMiniFabComponent, KlesSelectionModel, KlesTransformPipe, MatErrorFormDirective, MatErrorMessageDirective, autocompleteObjectValidator, autocompleteStringValidator, componentMapper, isDestroyable, klesFieldControlFactory, klesFieldUiFactory };
5239
5688
  //# sourceMappingURL=3kles-kles-material-dynamicforms.mjs.map