@3kles/kles-material-dynamicforms 14.8.1 → 14.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ import { CdkTableModule } from '@angular/cdk/table';
42
42
  import { MatTabsModule } from '@angular/material/tabs';
43
43
  import * as i9 from '@angular/material/progress-spinner';
44
44
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
45
- import * as i6$1 from '@angular/material/checkbox';
45
+ import * as i10 from '@angular/material/checkbox';
46
46
  import { MatCheckboxModule } from '@angular/material/checkbox';
47
47
  import { MatDialogModule } from '@angular/material/dialog';
48
48
  import * as i9$1 from '@angular/material/autocomplete';
@@ -52,11 +52,11 @@ import { MatSortModule } from '@angular/material/sort';
52
52
  import { MatExpansionModule } from '@angular/material/expansion';
53
53
  import { MatSnackBarModule } from '@angular/material/snack-bar';
54
54
  import { MatTreeModule } from '@angular/material/tree';
55
- import * as i6$2 from '@angular/material/slide-toggle';
55
+ import * as i6$1 from '@angular/material/slide-toggle';
56
56
  import { MatSlideToggleModule } from '@angular/material/slide-toggle';
57
57
  import * as i7$2 from 'ngx-color-picker';
58
58
  import { ColorPickerModule } from 'ngx-color-picker';
59
- import * as i10 from '@angular/cdk/scrolling';
59
+ import * as i11 from '@angular/cdk/scrolling';
60
60
  import { ScrollingModule, CdkScrollable, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
61
61
  import * as i4$5 from '@angular/material/button-toggle';
62
62
  import { MatButtonToggleModule } from '@angular/material/button-toggle';
@@ -69,6 +69,7 @@ import * as i3$1 from '@angular/flex-layout/flex';
69
69
  import * as i4$3 from '@angular/cdk/text-field';
70
70
  import * as i12 from 'ngx-mat-select-search';
71
71
  import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
72
+ import { v4 } from 'uuid';
72
73
 
73
74
  class KlesFormControl {
74
75
  constructor(field) {
@@ -80,6 +81,9 @@ class KlesFormControl {
80
81
  asyncValidators: this.bindAsyncValidations(this.field.asyncValidations || []),
81
82
  updateOn: this.field.updateOn || 'change'
82
83
  });
84
+ if (this.field.disabled) {
85
+ control.disable();
86
+ }
83
87
  if (this.field.asyncValue) {
84
88
  concat(of({ value: null, pending: true }), this.field.asyncValue.pipe(take(1), catchError((err) => {
85
89
  console.error(err);
@@ -90,7 +94,9 @@ class KlesFormControl {
90
94
  control.disable({ emitEvent: false });
91
95
  }
92
96
  else {
93
- control.enable({ emitEvent: false });
97
+ if (!this.field.disabled) {
98
+ control.enable({ emitEvent: false });
99
+ }
94
100
  control.setValue(response.value);
95
101
  this.field.value = response.value;
96
102
  }
@@ -834,6 +840,9 @@ let KlesFormInputComponent = class KlesFormInputComponent extends KlesFieldAbstr
834
840
  if (this.field.options instanceof Observable) {
835
841
  this.options$ = this.field.options;
836
842
  }
843
+ else if (this.field.options instanceof Function) {
844
+ this.options$ = this.field.options();
845
+ }
837
846
  else {
838
847
  this.options$ = of(this.field.options);
839
848
  }
@@ -1055,13 +1064,17 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1055
1064
  this.openChange$
1056
1065
  .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
1057
1066
  if (isOpen) {
1058
- if (!(this.field.options instanceof Observable)) {
1059
- return of(this.field.options);
1060
- }
1061
- else {
1067
+ if (this.field.options instanceof Observable) {
1062
1068
  this.isLoading = true;
1063
1069
  return this.field.options.pipe(take(1));
1064
1070
  }
1071
+ else if (this.field.options instanceof Function) {
1072
+ this.isLoading = true;
1073
+ return this.field.options();
1074
+ }
1075
+ else {
1076
+ return of(this.field.options);
1077
+ }
1065
1078
  }
1066
1079
  else {
1067
1080
  return of(this.group.controls[this.field.name].value !== undefined && this.group.controls[this.field.name].value !== null
@@ -1076,11 +1089,14 @@ let KlesFormSelectComponent = class KlesFormSelectComponent extends KlesFieldAbs
1076
1089
  });
1077
1090
  }
1078
1091
  else {
1079
- if (!(this.field.options instanceof Observable)) {
1080
- this.options$ = of(this.field.options);
1092
+ if (this.field.options instanceof Observable) {
1093
+ this.options$ = this.field.options;
1094
+ }
1095
+ else if (this.field.options instanceof Function) {
1096
+ this.options$ = this.field.options();
1081
1097
  }
1082
1098
  else {
1083
- this.options$ = this.field.options;
1099
+ this.options$ = of(this.field.options);
1084
1100
  }
1085
1101
  }
1086
1102
  }
@@ -1206,7 +1222,7 @@ KlesFormSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
1206
1222
  <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
1207
1223
  </ng-container>
1208
1224
  </mat-form-field>
1209
- `, isInline: true, styles: ["mat-form-field{width:100%}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i7$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i10.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i10.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i10.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }] });
1225
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i7$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i11.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i11.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i11.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }] });
1210
1226
  KlesFormSelectComponent = __decorate([
1211
1227
  FieldMapper({ type: EnumType.select })
1212
1228
  ], KlesFormSelectComponent);
@@ -1415,7 +1431,7 @@ KlesFormCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
1415
1431
  <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message}}</mat-error>
1416
1432
  </ng-container>
1417
1433
  </div>
1418
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i6$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
1434
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i10.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
1419
1435
  KlesFormCheckboxComponent = __decorate([
1420
1436
  FieldMapper({ type: EnumType.checkbox })
1421
1437
  ], KlesFormCheckboxComponent);
@@ -2167,6 +2183,9 @@ class KlesFormGroup extends KlesFormControl {
2167
2183
  subGroup.addControl(subfield.name, control);
2168
2184
  });
2169
2185
  }
2186
+ if (this.field.disabled) {
2187
+ subGroup.disable();
2188
+ }
2170
2189
  return subGroup;
2171
2190
  }
2172
2191
  }
@@ -2355,20 +2374,7 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
2355
2374
  }
2356
2375
  this.openChange$
2357
2376
  .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
2358
- if (isOpen) {
2359
- if (!(this.field.options instanceof Observable)) {
2360
- return of(this.field.options);
2361
- }
2362
- else {
2363
- this.isLoading = true;
2364
- return this.field.options.pipe(take(1));
2365
- }
2366
- }
2367
- else {
2368
- return of(this.group.controls[this.field.name].value !== undefined && this.group.controls[this.field.name].value !== null
2369
- ? (Array.isArray(this.group.controls[this.field.name].value) ?
2370
- this.group.controls[this.field.name].value : [this.group.controls[this.field.name].value]) : []);
2371
- }
2377
+ return this.onOpenChange(isOpen);
2372
2378
  }))
2373
2379
  .subscribe((options) => {
2374
2380
  this.options$.next(options);
@@ -2377,41 +2383,22 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
2377
2383
  });
2378
2384
  }
2379
2385
  else {
2380
- if (!(this.field.options instanceof Observable)) {
2381
- this.options$ = of(this.field.options);
2382
- }
2383
- else {
2386
+ if (this.field.options instanceof Observable) {
2384
2387
  this.options$ = this.field.options;
2385
2388
  }
2386
- }
2387
- this.searchControl.valueChanges.pipe(startWith(this.searchControl.value), takeUntil(this._onDestroy), switchMap(value => {
2388
- if (value) {
2389
- const search = value.toLowerCase();
2390
- return this.options$.pipe(map(options => {
2391
- return options
2392
- .filter(option => {
2393
- if (this.field.searchKeys && this.field.searchKeys.length) {
2394
- return this.field.searchKeys.some(searchKey => {
2395
- if (option[searchKey]) {
2396
- return option[searchKey].toString().toLowerCase().indexOf(search) > -1;
2397
- }
2398
- return false;
2399
- }) || (this.field.property ?
2400
- option[this.field.property].toString().toLowerCase().indexOf(search) > -1 : false);
2401
- }
2402
- else {
2403
- if (this.field.property) {
2404
- return option[this.field.property].toString().toLowerCase().indexOf(search) > -1;
2405
- }
2406
- }
2407
- return option.toString().toLowerCase().indexOf(search) > -1;
2408
- });
2409
- }));
2389
+ else if (this.field.options instanceof Function) {
2390
+ this.options$ = this.field.options();
2410
2391
  }
2411
2392
  else {
2412
- return this.options$;
2393
+ this.options$ = of(this.field.options);
2413
2394
  }
2414
- })).subscribe(this.optionsFiltered$);
2395
+ }
2396
+ this.searchControl.valueChanges.pipe(takeUntil(this._onDestroy), startWith(this.searchControl.value), switchMap(value => {
2397
+ return concat(of({ loading: true, options: [] }), this.onSearchChange(value).pipe(map((options) => ({ loading: false, options }))));
2398
+ })).subscribe(({ loading, options }) => {
2399
+ this.isLoading = loading;
2400
+ this.optionsFiltered$.next(options);
2401
+ });
2415
2402
  if (this.field.multiple) {
2416
2403
  this.group.controls[this.field.name]
2417
2404
  .valueChanges.pipe(takeUntil(this._onDestroy), startWith(this.group.controls[this.field.name].value), map((selected) => (this.field.property ? selected?.map(s => s[this.field.property]) : selected)), switchMap(selected => {
@@ -2447,6 +2434,54 @@ class KlesFormSelectSearchComponent extends KlesFieldAbstract {
2447
2434
  this.group.controls[this.field.name].patchValue([]);
2448
2435
  }
2449
2436
  }
2437
+ onOpenChange(isOpen) {
2438
+ if (isOpen) {
2439
+ if (this.field.options instanceof Observable) {
2440
+ this.isLoading = true;
2441
+ return this.field.options.pipe(take(1));
2442
+ }
2443
+ else if (this.field.options instanceof Function) {
2444
+ this.isLoading = true;
2445
+ return this.field.options();
2446
+ }
2447
+ else {
2448
+ return of(this.field.options);
2449
+ }
2450
+ }
2451
+ else {
2452
+ return of(this.group.controls[this.field.name].value !== undefined && this.group.controls[this.field.name].value !== null
2453
+ ? (Array.isArray(this.group.controls[this.field.name].value) ?
2454
+ this.group.controls[this.field.name].value : [this.group.controls[this.field.name].value]) : []);
2455
+ }
2456
+ }
2457
+ onSearchChange(value) {
2458
+ if (value) {
2459
+ const search = value.toLowerCase();
2460
+ return this.options$.pipe(map(options => {
2461
+ return options
2462
+ .filter(option => {
2463
+ if (this.field.searchKeys && this.field.searchKeys.length) {
2464
+ return this.field.searchKeys.some(searchKey => {
2465
+ if (option[searchKey]) {
2466
+ return option[searchKey].toString().toLowerCase().indexOf(search) > -1;
2467
+ }
2468
+ return false;
2469
+ }) || (this.field.property ?
2470
+ option[this.field.property].toString().toLowerCase().indexOf(search) > -1 : false);
2471
+ }
2472
+ else {
2473
+ if (this.field.property) {
2474
+ return option[this.field.property].toString().toLowerCase().indexOf(search) > -1;
2475
+ }
2476
+ }
2477
+ return option.toString().toLowerCase().indexOf(search) > -1;
2478
+ });
2479
+ }));
2480
+ }
2481
+ else {
2482
+ return this.options$;
2483
+ }
2484
+ }
2450
2485
  openChange($event) {
2451
2486
  if (this.field.lazy) {
2452
2487
  this.openChange$.next($event);
@@ -2563,7 +2598,7 @@ KlesFormSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
2563
2598
  <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
2564
2599
  </ng-container>
2565
2600
  </mat-form-field>
2566
- `, isInline: true, styles: ["mat-form-field{width:100%}\n", ".selectAll{padding:10px 16px}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i7$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i6$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i10.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i10.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i10.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: i12.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }] });
2601
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n", ".selectAll{padding:10px 16px}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i7$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i10.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i11.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i11.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i11.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: i12.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }] });
2567
2602
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KlesFormSelectSearchComponent, decorators: [{
2568
2603
  type: Component,
2569
2604
  args: [{ selector: 'kles-form-select-search', template: `
@@ -2757,7 +2792,7 @@ KlesFormSlideToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
2757
2792
  <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message}}</mat-error>
2758
2793
  </ng-container>
2759
2794
  </div>
2760
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i6$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
2795
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i6$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
2761
2796
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KlesFormSlideToggleComponent, decorators: [{
2762
2797
  type: Component,
2763
2798
  args: [{ selector: 'kles-form-slide-toggle', template: `
@@ -2776,11 +2811,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
2776
2811
  class KlesFormSelectionListComponent extends KlesFieldAbstract {
2777
2812
  ngOnInit() {
2778
2813
  super.ngOnInit();
2779
- if (!(this.field.options instanceof Observable)) {
2780
- this.options$ = of(this.field.options);
2814
+ if (this.field.options instanceof Observable) {
2815
+ this.options$ = this.field.options;
2816
+ }
2817
+ else if (this.field.options instanceof Function) {
2818
+ this.options$ = this.field.options();
2781
2819
  }
2782
2820
  else {
2783
- this.options$ = this.field.options;
2821
+ this.options$ = of(this.field.options);
2784
2822
  }
2785
2823
  }
2786
2824
  ngOnDestroy() {
@@ -2858,11 +2896,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
2858
2896
  class KlesFormButtonToogleGroupComponent extends KlesFieldAbstract {
2859
2897
  ngOnInit() {
2860
2898
  super.ngOnInit();
2861
- if (!(this.field.options instanceof Observable)) {
2862
- this.options$ = of(this.field.options);
2899
+ if (this.field.options instanceof Observable) {
2900
+ this.options$ = this.field.options;
2901
+ }
2902
+ else if (this.field.options instanceof Function) {
2903
+ this.options$ = this.field.options();
2863
2904
  }
2864
2905
  else {
2865
- this.options$ = this.field.options;
2906
+ this.options$ = of(this.field.options);
2866
2907
  }
2867
2908
  }
2868
2909
  ngOnDestroy() {
@@ -2899,11 +2940,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
2899
2940
 
2900
2941
  class KlesFormArray extends KlesFormControl {
2901
2942
  create() {
2902
- const array = new FormArray([]);
2943
+ const array = new FormArray([], {
2944
+ validators: this.bindValidations(this.field.validations || []),
2945
+ asyncValidators: this.bindAsyncValidations(this.field.asyncValidations || []),
2946
+ updateOn: this.field.updateOn || 'change'
2947
+ });
2903
2948
  if (this.field.value && Array.isArray(this.field.value)) {
2904
2949
  if (this.field.collections && Array.isArray(this.field.collections)) {
2905
2950
  this.field.value.forEach(val => {
2906
2951
  const group = new FormGroup({});
2952
+ group.addControl('_id', new FormControl(v4()));
2907
2953
  this.field.collections.forEach(subfield => {
2908
2954
  const data = val[subfield.name] || null;
2909
2955
  const control = new KlesFormControl({ ...subfield, ...(data && { value: data }) }).create();
@@ -2921,6 +2967,9 @@ class KlesFormArray extends KlesFormControl {
2921
2967
  });
2922
2968
  array.push(group);
2923
2969
  }
2970
+ if (this.field.disabled) {
2971
+ array.disable();
2972
+ }
2924
2973
  return array;
2925
2974
  }
2926
2975
  }
@@ -3059,6 +3108,256 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
3059
3108
  `, styles: ["mat-form-field{width:100%}\n"] }]
3060
3109
  }] });
3061
3110
 
3111
+ class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
3112
+ constructor(viewRef, ref) {
3113
+ super(viewRef, ref);
3114
+ this.viewRef = viewRef;
3115
+ this.ref = ref;
3116
+ }
3117
+ ngOnInit() {
3118
+ this.field.lazy = true;
3119
+ super.ngOnInit();
3120
+ this.openChange$.pipe(takeUntil(this._onDestroy))
3121
+ .subscribe((open) => {
3122
+ if (open) {
3123
+ this.searchControl.reset(null);
3124
+ }
3125
+ else {
3126
+ this.searchControl.reset(null, { emitEvent: false });
3127
+ }
3128
+ });
3129
+ }
3130
+ ngOnDestroy() {
3131
+ super.ngOnDestroy();
3132
+ }
3133
+ onSearchChange(value) {
3134
+ if (this.field.options instanceof Function) {
3135
+ if (value) {
3136
+ const search = value.toLowerCase();
3137
+ return this.field.options(search).pipe(take(1));
3138
+ }
3139
+ else {
3140
+ return this.field.options().pipe(take(1));
3141
+ }
3142
+ }
3143
+ else {
3144
+ return super.onSearchChange(value);
3145
+ }
3146
+ }
3147
+ }
3148
+ KlesFormSelectLazySearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KlesFormSelectLazySearchComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3149
+ KlesFormSelectLazySearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: KlesFormSelectLazySearchComponent, selector: "kles-form-select-lazy-search", usesInheritance: true, ngImport: i0, template: `
3150
+ <mat-form-field class="margin-top" [color]="field.color" [formGroup]="group">
3151
+ <mat-select matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
3152
+ (openedChange)="openChange($event)" [compareWith]="compareFn"
3153
+ [placeholder]="field.placeholder | translate" [formControlName]="field.name" [multiple]="field.multiple">
3154
+ <mat-select-trigger *ngIf="field.triggerComponent">
3155
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
3156
+ </mat-select-trigger>
3157
+
3158
+ <ng-container *ngIf="field.virtualScroll">
3159
+ <mat-option>
3160
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
3161
+ placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
3162
+ </mat-option>
3163
+
3164
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]=4*48>
3165
+ <ng-container *ngIf="!isLoading; else emptyOption">
3166
+ <mat-checkbox *ngIf="field.multiple" class="selectAll" [formControl]="selectAllControl"
3167
+ (change)="toggleAllSelection($event)">
3168
+ {{'selectAll' | translate}}
3169
+ </mat-checkbox>
3170
+ <ng-container *ngIf="!field.autocompleteComponent">
3171
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
3172
+
3173
+ <ng-container *ngIf="field.multiple">
3174
+ <mat-option *ngFor="let item of group.controls[field.name].value | slice:0:30" [value]="item"
3175
+ style="display:none">
3176
+ {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
3177
+ </mat-option>
3178
+ </ng-container>
3179
+
3180
+ <ng-container *ngIf="!field.multiple && group.controls[field.name].value">
3181
+ <mat-option *ngFor="let item of [group?.controls[field.name]?.value]" [value]="item" style="display:none">
3182
+ {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
3183
+ </mat-option>
3184
+ </ng-container>
3185
+ </ng-container>
3186
+
3187
+ <ng-container *ngIf="field.autocompleteComponent">
3188
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3189
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3190
+ </mat-option>
3191
+
3192
+ <ng-container *ngIf="field.multiple">
3193
+ <mat-option *ngFor="let item of group.controls[field.name].value | slice:0:30" [value]="item"
3194
+ style="display:none">
3195
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3196
+ </mat-option>
3197
+ </ng-container>
3198
+
3199
+ <ng-container *ngIf="!field.multiple && group.controls[field.name].value">
3200
+ <mat-option *ngFor="let item of [group?.controls[field.name]?.value]" [value]="item" style="display:none">
3201
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3202
+ </mat-option>
3203
+ </ng-container>
3204
+ </ng-container>
3205
+ </ng-container>
3206
+ <ng-template #emptyOption>
3207
+ <mat-option class="hide-checkbox" disabled><div fxLayout="row" fxLayoutAlign="space-between center">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
3208
+ </ng-template>
3209
+ </cdk-virtual-scroll-viewport>
3210
+
3211
+ </ng-container>
3212
+
3213
+ <ng-container *ngIf="!field.virtualScroll">
3214
+ <mat-option>
3215
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
3216
+ placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
3217
+ </mat-option>
3218
+
3219
+ <ng-container *ngIf="!isLoading; else emptyOption">
3220
+ <mat-checkbox *ngIf="field.multiple" class="selectAll" [formControl]="selectAllControl"
3221
+ (change)="toggleAllSelection($event)">
3222
+ {{'selectAll' | translate}}
3223
+ </mat-checkbox>
3224
+ <ng-container *ngIf="!field.autocompleteComponent">
3225
+ <mat-option *ngFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
3226
+ </ng-container>
3227
+
3228
+ <ng-container *ngIf="field.autocompleteComponent">
3229
+ <mat-option *ngFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3230
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3231
+ </mat-option>
3232
+ </ng-container>
3233
+ </ng-container>
3234
+
3235
+ <ng-template #emptyOption>
3236
+ <mat-option class="hide-checkbox" disabled><div fxLayout="row" fxLayoutAlign="space-between center">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
3237
+ </ng-template>
3238
+ </ng-container>
3239
+ </mat-select>
3240
+
3241
+ <div matSuffix>
3242
+ <ng-content></ng-content>
3243
+ </div>
3244
+
3245
+ <ng-container *ngFor="let validation of field.validations;" ngProjectAs="mat-error">
3246
+ <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
3247
+ </ng-container>
3248
+ <ng-container *ngFor="let validation of field.asyncValidations;" ngProjectAs="mat-error">
3249
+ <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
3250
+ </ng-container>
3251
+ </mat-form-field>
3252
+ `, isInline: true, styles: ["mat-form-field{width:100%}\n", ".selectAll{padding:10px 16px}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i7$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i10.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i11.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i11.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i11.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: i12.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: KlesTransformPipe, name: "klesTransform" }] });
3253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KlesFormSelectLazySearchComponent, decorators: [{
3254
+ type: Component,
3255
+ args: [{ selector: 'kles-form-select-lazy-search', template: `
3256
+ <mat-form-field class="margin-top" [color]="field.color" [formGroup]="group">
3257
+ <mat-select matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
3258
+ (openedChange)="openChange($event)" [compareWith]="compareFn"
3259
+ [placeholder]="field.placeholder | translate" [formControlName]="field.name" [multiple]="field.multiple">
3260
+ <mat-select-trigger *ngIf="field.triggerComponent">
3261
+ <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
3262
+ </mat-select-trigger>
3263
+
3264
+ <ng-container *ngIf="field.virtualScroll">
3265
+ <mat-option>
3266
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
3267
+ placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
3268
+ </mat-option>
3269
+
3270
+ <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]=4*48>
3271
+ <ng-container *ngIf="!isLoading; else emptyOption">
3272
+ <mat-checkbox *ngIf="field.multiple" class="selectAll" [formControl]="selectAllControl"
3273
+ (change)="toggleAllSelection($event)">
3274
+ {{'selectAll' | translate}}
3275
+ </mat-checkbox>
3276
+ <ng-container *ngIf="!field.autocompleteComponent">
3277
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
3278
+
3279
+ <ng-container *ngIf="field.multiple">
3280
+ <mat-option *ngFor="let item of group.controls[field.name].value | slice:0:30" [value]="item"
3281
+ style="display:none">
3282
+ {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
3283
+ </mat-option>
3284
+ </ng-container>
3285
+
3286
+ <ng-container *ngIf="!field.multiple && group.controls[field.name].value">
3287
+ <mat-option *ngFor="let item of [group?.controls[field.name]?.value]" [value]="item" style="display:none">
3288
+ {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
3289
+ </mat-option>
3290
+ </ng-container>
3291
+ </ng-container>
3292
+
3293
+ <ng-container *ngIf="field.autocompleteComponent">
3294
+ <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3295
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3296
+ </mat-option>
3297
+
3298
+ <ng-container *ngIf="field.multiple">
3299
+ <mat-option *ngFor="let item of group.controls[field.name].value | slice:0:30" [value]="item"
3300
+ style="display:none">
3301
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3302
+ </mat-option>
3303
+ </ng-container>
3304
+
3305
+ <ng-container *ngIf="!field.multiple && group.controls[field.name].value">
3306
+ <mat-option *ngFor="let item of [group?.controls[field.name]?.value]" [value]="item" style="display:none">
3307
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3308
+ </mat-option>
3309
+ </ng-container>
3310
+ </ng-container>
3311
+ </ng-container>
3312
+ <ng-template #emptyOption>
3313
+ <mat-option class="hide-checkbox" disabled><div fxLayout="row" fxLayoutAlign="space-between center">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
3314
+ </ng-template>
3315
+ </cdk-virtual-scroll-viewport>
3316
+
3317
+ </ng-container>
3318
+
3319
+ <ng-container *ngIf="!field.virtualScroll">
3320
+ <mat-option>
3321
+ <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
3322
+ placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
3323
+ </mat-option>
3324
+
3325
+ <ng-container *ngIf="!isLoading; else emptyOption">
3326
+ <mat-checkbox *ngIf="field.multiple" class="selectAll" [formControl]="selectAllControl"
3327
+ (change)="toggleAllSelection($event)">
3328
+ {{'selectAll' | translate}}
3329
+ </mat-checkbox>
3330
+ <ng-container *ngIf="!field.autocompleteComponent">
3331
+ <mat-option *ngFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
3332
+ </ng-container>
3333
+
3334
+ <ng-container *ngIf="field.autocompleteComponent">
3335
+ <mat-option *ngFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
3336
+ <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
3337
+ </mat-option>
3338
+ </ng-container>
3339
+ </ng-container>
3340
+
3341
+ <ng-template #emptyOption>
3342
+ <mat-option class="hide-checkbox" disabled><div fxLayout="row" fxLayoutAlign="space-between center">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
3343
+ </ng-template>
3344
+ </ng-container>
3345
+ </mat-select>
3346
+
3347
+ <div matSuffix>
3348
+ <ng-content></ng-content>
3349
+ </div>
3350
+
3351
+ <ng-container *ngFor="let validation of field.validations;" ngProjectAs="mat-error">
3352
+ <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
3353
+ </ng-container>
3354
+ <ng-container *ngFor="let validation of field.asyncValidations;" ngProjectAs="mat-error">
3355
+ <mat-error *ngIf="group.get(field.name).hasError(validation.name)">{{validation.message | translate}}</mat-error>
3356
+ </ng-container>
3357
+ </mat-form-field>
3358
+ `, styles: ["mat-form-field{width:100%}\n", ".selectAll{padding:10px 16px}\n", "::ng-deep .hide-checkbox .mat-pseudo-checkbox{display:none!important}\n"] }]
3359
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; } });
3360
+
3062
3361
  const components = [
3063
3362
  KlesDynamicFormComponent,
3064
3363
  KlesFormLabelComponent,
@@ -3091,7 +3390,8 @@ const components = [
3091
3390
  KlesFormButtonToogleGroupComponent,
3092
3391
  KlesFormArrayComponent,
3093
3392
  KlesFormRangeComponent,
3094
- KlesFormClearComponent
3393
+ KlesFormClearComponent,
3394
+ KlesFormSelectLazySearchComponent
3095
3395
  ];
3096
3396
  const directives = [KlesDynamicFieldDirective, KlesComponentDirective];
3097
3397
  const pipes = [KlesTransformPipe, ArrayFormatPipe];
@@ -3134,7 +3434,8 @@ KlesMaterialDynamicformsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "1
3134
3434
  KlesFormButtonToogleGroupComponent,
3135
3435
  KlesFormArrayComponent,
3136
3436
  KlesFormRangeComponent,
3137
- KlesFormClearComponent, KlesDynamicFieldDirective, KlesComponentDirective, KlesTransformPipe, ArrayFormatPipe], imports: [CommonModule,
3437
+ KlesFormClearComponent,
3438
+ KlesFormSelectLazySearchComponent, KlesDynamicFieldDirective, KlesComponentDirective, KlesTransformPipe, ArrayFormatPipe], imports: [CommonModule,
3138
3439
  ReactiveFormsModule,
3139
3440
  TranslateModule,
3140
3441
  FlexLayoutModule,
@@ -3172,7 +3473,8 @@ KlesMaterialDynamicformsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "1
3172
3473
  KlesFormButtonToogleGroupComponent,
3173
3474
  KlesFormArrayComponent,
3174
3475
  KlesFormRangeComponent,
3175
- KlesFormClearComponent, KlesTransformPipe, ArrayFormatPipe, KlesDynamicFieldDirective, KlesComponentDirective, ColorPickerModule] });
3476
+ KlesFormClearComponent,
3477
+ KlesFormSelectLazySearchComponent, KlesTransformPipe, ArrayFormatPipe, KlesDynamicFieldDirective, KlesComponentDirective, ColorPickerModule] });
3176
3478
  KlesMaterialDynamicformsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KlesMaterialDynamicformsModule, providers: [
3177
3479
  { provide: ErrorStateMatcher, useClass: KlesFormErrorStateMatcher },
3178
3480
  pipes
@@ -3247,5 +3549,5 @@ function autocompleteStringValidator(validOptions, optional) {
3247
3549
  * Generated bundle index. Do not edit.
3248
3550
  */
3249
3551
 
3250
- export { ArrayFormatPipe, EnumType, FieldMapper, KlesButtonCheckerComponent, KlesButtonComponent, KlesButtonFileComponent, KlesComponentDirective, KlesDynamicFieldDirective, KlesDynamicFormComponent, KlesFieldAbstract, KlesFormArray, KlesFormArrayComponent, KlesFormBadgeComponent, KlesFormButtonCheckerComponent, KlesFormButtonComponent, KlesFormButtonFileComponent, KlesFormButtonToogleGroupComponent, KlesFormCheckboxComponent, KlesFormChipComponent, KlesFormClearComponent, KlesFormColorComponent, KlesFormControl, KlesFormDateComponent, KlesFormErrorStateMatcher, KlesFormGroup, KlesFormGroupComponent, KlesFormIconComponent, KlesFormInputClearableComponent, KlesFormInputComponent, KlesFormLabelComponent, KlesFormLineBreakComponent, KlesFormLinkComponent, KlesFormListFieldComponent, KlesFormRadioComponent, KlesFormRange, KlesFormRangeComponent, KlesFormSelectComponent, KlesFormSelectSearchComponent, KlesFormSelectionListComponent, KlesFormSlideToggleComponent, KlesFormSubmitButtonComponent, KlesFormTextComponent, KlesFormTextareaComponent, KlesMaterialDynamicformsModule, KlesTransformPipe, autocompleteObjectValidator, autocompleteStringValidator, componentMapper, klesFieldControlFactory };
3552
+ export { ArrayFormatPipe, EnumType, FieldMapper, KlesButtonCheckerComponent, KlesButtonComponent, KlesButtonFileComponent, KlesComponentDirective, KlesDynamicFieldDirective, KlesDynamicFormComponent, KlesFieldAbstract, KlesFormArray, KlesFormArrayComponent, KlesFormBadgeComponent, KlesFormButtonCheckerComponent, KlesFormButtonComponent, KlesFormButtonFileComponent, KlesFormButtonToogleGroupComponent, KlesFormCheckboxComponent, KlesFormChipComponent, KlesFormClearComponent, KlesFormColorComponent, KlesFormControl, KlesFormDateComponent, KlesFormErrorStateMatcher, KlesFormGroup, KlesFormGroupComponent, KlesFormIconComponent, KlesFormInputClearableComponent, KlesFormInputComponent, KlesFormLabelComponent, KlesFormLineBreakComponent, KlesFormLinkComponent, KlesFormListFieldComponent, KlesFormRadioComponent, KlesFormRange, KlesFormRangeComponent, KlesFormSelectComponent, KlesFormSelectLazySearchComponent, KlesFormSelectSearchComponent, KlesFormSelectionListComponent, KlesFormSlideToggleComponent, KlesFormSubmitButtonComponent, KlesFormTextComponent, KlesFormTextareaComponent, KlesMaterialDynamicformsModule, KlesTransformPipe, autocompleteObjectValidator, autocompleteStringValidator, componentMapper, klesFieldControlFactory };
3251
3553
  //# sourceMappingURL=3kles-kles-material-dynamicforms.mjs.map