@3kles/kles-material-dynamicforms 18.1.1 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +0 -1
  2. package/fesm2022/3kles-kles-material-dynamicforms.mjs +1735 -1880
  3. package/fesm2022/3kles-kles-material-dynamicforms.mjs.map +1 -1
  4. package/lib/directive/dynamic-component.directive.d.ts +1 -1
  5. package/lib/directive/dynamic-field.directive.d.ts +2 -2
  6. package/lib/directive/mat-error-form.directive.d.ts +1 -1
  7. package/lib/directive/mat-error-message.directive.d.ts +1 -1
  8. package/lib/dynamic-form-intl.d.ts +7 -0
  9. package/lib/dynamic-form.component.d.ts +1 -1
  10. package/lib/fields/array.component.d.ts +1 -1
  11. package/lib/fields/badge.component.d.ts +1 -1
  12. package/lib/fields/button-fab.component.d.ts +1 -1
  13. package/lib/fields/button-form.component.d.ts +1 -1
  14. package/lib/fields/button-icon.component.d.ts +1 -1
  15. package/lib/fields/button-mini-fab.component.d.ts +1 -1
  16. package/lib/fields/button-toogle-group.component.d.ts +1 -1
  17. package/lib/fields/buttonchecker-form.component.d.ts +1 -1
  18. package/lib/fields/buttonfile-form.component.d.ts +1 -1
  19. package/lib/fields/checkbox-indeterminate.component.d.ts +1 -1
  20. package/lib/fields/checkbox.component.d.ts +1 -1
  21. package/lib/fields/chip.component.d.ts +1 -1
  22. package/lib/fields/clear.component.d.ts +1 -1
  23. package/lib/fields/color.component.d.ts +1 -1
  24. package/lib/fields/copy.component.d.ts +6 -6
  25. package/lib/fields/date.component.d.ts +1 -1
  26. package/lib/fields/field.abstract.d.ts +1 -1
  27. package/lib/fields/file.component.d.ts +1 -1
  28. package/lib/fields/group.component.d.ts +1 -1
  29. package/lib/fields/icon.component.d.ts +1 -1
  30. package/lib/fields/input.clearable.component.d.ts +6 -2
  31. package/lib/fields/input.component.d.ts +6 -2
  32. package/lib/fields/label.component.d.ts +1 -1
  33. package/lib/fields/line-break.component.d.ts +1 -1
  34. package/lib/fields/link.component.d.ts +3 -3
  35. package/lib/fields/list-field.component.d.ts +1 -1
  36. package/lib/fields/radio.component.d.ts +1 -1
  37. package/lib/fields/range.component.d.ts +2 -2
  38. package/lib/fields/select.component.d.ts +4 -2
  39. package/lib/fields/select.lazy-search.component.d.ts +4 -2
  40. package/lib/fields/select.search.component.d.ts +4 -2
  41. package/lib/fields/selection-list.component.d.ts +1 -1
  42. package/lib/fields/selection-list.search.component.d.ts +1 -1
  43. package/lib/fields/slide-toggle.component.d.ts +2 -2
  44. package/lib/fields/text.component.d.ts +1 -1
  45. package/lib/fields/textarea.component.d.ts +1 -1
  46. package/lib/forms/button-control-base.d.ts +1 -1
  47. package/lib/forms/button-control.component.d.ts +1 -1
  48. package/lib/forms/buttonchecker-control.component.d.ts +1 -1
  49. package/lib/forms/buttonfile-control.component.d.ts +1 -1
  50. package/lib/forms/fab-control.component.d.ts +1 -1
  51. package/lib/forms/file-control.component.d.ts +1 -1
  52. package/lib/forms/icon-button-control.component.d.ts +1 -1
  53. package/lib/forms/indeterminate-checkbox.d.ts +2 -1
  54. package/lib/forms/mini-fab-control.component.d.ts +1 -1
  55. package/lib/kles-material-dynamicforms.module.d.ts +58 -60
  56. package/lib/modules/material.module.d.ts +4 -5
  57. package/lib/pipe/array.pipe.d.ts +1 -1
  58. package/lib/pipe/transform.pipe.d.ts +1 -1
  59. package/package.json +26 -22
  60. package/public-api.d.ts +2 -1
  61. package/esm2022/3kles-kles-material-dynamicforms.mjs +0 -5
  62. package/esm2022/lib/controls/array.control.mjs +0 -57
  63. package/esm2022/lib/controls/control.abstract.mjs +0 -31
  64. package/esm2022/lib/controls/control.interface.mjs +0 -2
  65. package/esm2022/lib/controls/default.control.mjs +0 -34
  66. package/esm2022/lib/controls/group.control.mjs +0 -49
  67. package/esm2022/lib/controls/range.control.mjs +0 -18
  68. package/esm2022/lib/decorators/component.decorator.mjs +0 -12
  69. package/esm2022/lib/directive/dynamic-component.directive.mjs +0 -44
  70. package/esm2022/lib/directive/dynamic-field.directive.mjs +0 -109
  71. package/esm2022/lib/directive/mat-error-form.directive.mjs +0 -54
  72. package/esm2022/lib/directive/mat-error-message.directive.mjs +0 -53
  73. package/esm2022/lib/dynamic-form.component.mjs +0 -214
  74. package/esm2022/lib/enums/button-attribute.enum.mjs +0 -8
  75. package/esm2022/lib/enums/type.enum.mjs +0 -21
  76. package/esm2022/lib/factories/field.factory.mjs +0 -6
  77. package/esm2022/lib/fields/array.component.mjs +0 -61
  78. package/esm2022/lib/fields/badge.component.mjs +0 -39
  79. package/esm2022/lib/fields/button-fab.component.mjs +0 -48
  80. package/esm2022/lib/fields/button-form.component.mjs +0 -50
  81. package/esm2022/lib/fields/button-icon.component.mjs +0 -48
  82. package/esm2022/lib/fields/button-mini-fab.component.mjs +0 -48
  83. package/esm2022/lib/fields/button-toogle-group.component.mjs +0 -55
  84. package/esm2022/lib/fields/buttonchecker-form.component.mjs +0 -48
  85. package/esm2022/lib/fields/buttonfile-form.component.mjs +0 -51
  86. package/esm2022/lib/fields/checkbox-indeterminate.component.mjs +0 -42
  87. package/esm2022/lib/fields/checkbox.component.mjs +0 -42
  88. package/esm2022/lib/fields/chip.component.mjs +0 -44
  89. package/esm2022/lib/fields/clear.component.mjs +0 -35
  90. package/esm2022/lib/fields/color.component.mjs +0 -134
  91. package/esm2022/lib/fields/copy.component.mjs +0 -45
  92. package/esm2022/lib/fields/date-time.component.mjs +0 -61
  93. package/esm2022/lib/fields/date.component.mjs +0 -60
  94. package/esm2022/lib/fields/field.abstract.mjs +0 -88
  95. package/esm2022/lib/fields/file.component.mjs +0 -41
  96. package/esm2022/lib/fields/group.component.mjs +0 -80
  97. package/esm2022/lib/fields/icon.component.mjs +0 -27
  98. package/esm2022/lib/fields/input.clearable.component.mjs +0 -144
  99. package/esm2022/lib/fields/input.component.mjs +0 -252
  100. package/esm2022/lib/fields/label.component.mjs +0 -39
  101. package/esm2022/lib/fields/line-break.component.mjs +0 -26
  102. package/esm2022/lib/fields/link.component.mjs +0 -31
  103. package/esm2022/lib/fields/list-field.component.mjs +0 -157
  104. package/esm2022/lib/fields/radio.component.mjs +0 -50
  105. package/esm2022/lib/fields/range.component.mjs +0 -81
  106. package/esm2022/lib/fields/select.component.mjs +0 -358
  107. package/esm2022/lib/fields/select.lazy-search.component.mjs +0 -303
  108. package/esm2022/lib/fields/select.search.component.mjs +0 -475
  109. package/esm2022/lib/fields/selection-list.component.mjs +0 -149
  110. package/esm2022/lib/fields/selection-list.search.component.mjs +0 -193
  111. package/esm2022/lib/fields/slide-toggle.component.mjs +0 -29
  112. package/esm2022/lib/fields/text.component.mjs +0 -42
  113. package/esm2022/lib/fields/textarea.component.mjs +0 -64
  114. package/esm2022/lib/forms/button-control-base.mjs +0 -89
  115. package/esm2022/lib/forms/button-control.component.mjs +0 -91
  116. package/esm2022/lib/forms/buttonchecker-control.component.mjs +0 -98
  117. package/esm2022/lib/forms/buttonfile-control.component.mjs +0 -124
  118. package/esm2022/lib/forms/fab-control.component.mjs +0 -60
  119. package/esm2022/lib/forms/file-control.component.mjs +0 -72
  120. package/esm2022/lib/forms/icon-button-control.component.mjs +0 -55
  121. package/esm2022/lib/forms/indeterminate-checkbox.mjs +0 -91
  122. package/esm2022/lib/forms/mini-fab-control.component.mjs +0 -60
  123. package/esm2022/lib/interfaces/clear-control.interface.mjs +0 -2
  124. package/esm2022/lib/interfaces/component.interface.mjs +0 -2
  125. package/esm2022/lib/interfaces/directive.interface.mjs +0 -2
  126. package/esm2022/lib/interfaces/field.config.interface.mjs +0 -2
  127. package/esm2022/lib/interfaces/field.interface.mjs +0 -2
  128. package/esm2022/lib/interfaces/validator.interface.mjs +0 -2
  129. package/esm2022/lib/kles-material-dynamicforms.module.mjs +0 -261
  130. package/esm2022/lib/matcher/form-error.matcher.mjs +0 -16
  131. package/esm2022/lib/modules/material.module.mjs +0 -279
  132. package/esm2022/lib/pipe/array.pipe.mjs +0 -22
  133. package/esm2022/lib/pipe/transform.pipe.mjs +0 -28
  134. package/esm2022/lib/selection/selection-model.mjs +0 -231
  135. package/esm2022/lib/utils/destroyable.guard.mjs +0 -5
  136. package/esm2022/lib/validators/autocomplete.validator.mjs +0 -23
  137. package/esm2022/public-api.mjs +0 -92
  138. package/lib/fields/date-time.component.d.ts +0 -9
@@ -1,303 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { of } from 'rxjs';
3
- import { map, switchMap, take, takeUntil } from 'rxjs/operators';
4
- import { KlesFormSelectSearchComponent } from './select.search.component';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/common";
7
- import * as i2 from "@angular/forms";
8
- import * as i3 from "@angular/material/form-field";
9
- import * as i4 from "@angular/material/select";
10
- import * as i5 from "@angular/material/core";
11
- import * as i6 from "@angular/material/tooltip";
12
- import * as i7 from "@angular/material/progress-spinner";
13
- import * as i8 from "@angular/material/checkbox";
14
- import * as i9 from "@angular/cdk/scrolling";
15
- import * as i10 from "ngx-mat-select-search";
16
- import * as i11 from "../directive/dynamic-component.directive";
17
- import * as i12 from "../directive/mat-error-message.directive";
18
- import * as i13 from "@ngx-translate/core";
19
- import * as i14 from "../pipe/transform.pipe";
20
- export class KlesFormSelectLazySearchComponent extends KlesFormSelectSearchComponent {
21
- constructor(viewRef, ref) {
22
- super(viewRef, ref);
23
- this.viewRef = viewRef;
24
- this.ref = ref;
25
- }
26
- ngOnInit() {
27
- this.field.lazy = true;
28
- this.field.debounceTime = this.field.debounceTime ? this.field.debounceTime : 500;
29
- super.ngOnInit();
30
- }
31
- ngOnDestroy() {
32
- super.ngOnDestroy();
33
- }
34
- onSearchChange(value) {
35
- if (this.field.options instanceof Function) {
36
- if (this.openChange$.getValue() && this.field.options instanceof Function) {
37
- if (value) {
38
- return this.field.options(value).pipe(take(1));
39
- }
40
- else {
41
- return this.field.options().pipe(take(1));
42
- }
43
- }
44
- return of(this.group.controls[this.field.name].value ? [this.group.controls[this.field.name].value] : []);
45
- }
46
- else {
47
- return super.onSearchChange(value);
48
- }
49
- }
50
- openChangeEvent() {
51
- this.openChange$
52
- .pipe(takeUntil(this._onDestroy), switchMap((isOpen) => {
53
- return this.onOpenChange(isOpen).pipe(map((options) => ({ options, isOpen })));
54
- }))
55
- .subscribe(({ options, isOpen }) => {
56
- if (!isOpen) {
57
- this.searchControl.reset(null, { emitEvent: false });
58
- }
59
- this.optionsFiltered$.next(options);
60
- this.isLoading.set(false);
61
- this.ref.markForCheck();
62
- });
63
- }
64
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KlesFormSelectLazySearchComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
65
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: KlesFormSelectLazySearchComponent, selector: "kles-form-select-lazy-search", usesInheritance: true, ngImport: i0, template: `
66
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
67
- @if (field.label) {
68
- <mat-label>{{field.label}}</mat-label>
69
- }
70
-
71
- <mat-select matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
72
- (openedChange)="openChange($event)" [compareWith]="compareFn" [panelWidth]="field.panelWidth || 'auto'"
73
- [placeholder]="field.placeholder | translate" [formControlName]="field.name" [multiple]="field.multiple">
74
- @if (field.triggerComponent) {
75
- <mat-select-trigger>
76
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
77
- </mat-select-trigger>
78
- }
79
-
80
- @if (field.virtualScroll) {
81
- <mat-option>
82
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
83
- placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
84
- </mat-option>
85
-
86
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]=4*48>
87
- @if (!isLoading()) {
88
- @if (field.multiple) {
89
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
90
- {{'selectAll' | translate}}
91
- </mat-checkbox>
92
- }
93
-
94
- @if (!field.autocompleteComponent) {
95
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
96
-
97
- @if (field.multiple) {
98
- @for (item of group.controls[field.name].value | slice:0:30; track item) {
99
- <mat-option [value]="item" style="display:none">
100
- {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
101
- </mat-option>
102
- }
103
- }
104
-
105
- @if (!field.multiple && group.controls[field.name].value) {
106
- @for (item of [group?.controls[field.name]?.value]; track item) {
107
- <mat-option [value]="item" style="display:none">
108
- {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
109
- </mat-option>
110
- }
111
- }
112
- }
113
- @else {
114
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
115
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
116
- </mat-option>
117
-
118
- @if (field.multiple) {
119
- @for (item of group.controls[field.name].value | slice:0:30; track item) {
120
- <mat-option [value]="item" style="display:none">
121
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
122
- </mat-option>
123
- }
124
- }
125
-
126
- @if (!field.multiple && group.controls[field.name].value) {
127
- @for (item of [group?.controls[field.name]?.value]; track item) {
128
- <mat-option [value]="item" style="display:none">
129
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
130
- </mat-option>
131
- }
132
- }
133
- }
134
- }
135
- @else {
136
- <mat-option class="hide-checkbox" disabled><div class="loadingSelect">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
137
- }
138
- </cdk-virtual-scroll-viewport>
139
- }
140
- @else {
141
- <mat-option>
142
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
143
- placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
144
- </mat-option>
145
-
146
- @if (!isLoading()) {
147
- @if (field.multiple) {
148
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
149
- {{'selectAll' | translate}}
150
- </mat-checkbox>
151
- }
152
-
153
- @if (!field.autocompleteComponent) {
154
- @for (item of optionsFiltered$ | async; track item) {
155
- <mat-option [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
156
- }
157
- }
158
- @else {
159
- @for (item of optionsFiltered$ | async; track item) {
160
- <mat-option [value]="item" [disabled]="item?.disabled">
161
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
162
- </mat-option>
163
- }
164
- }
165
- }
166
- @else {
167
- <mat-option class="hide-checkbox" disabled><div class="loadingSelect">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
168
- }
169
- }
170
-
171
- </mat-select>
172
-
173
- @if (field.subComponents || field.clearable) {
174
- <div matSuffix>
175
- <ng-content></ng-content>
176
- </div>
177
- }
178
-
179
- <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
180
- </mat-form-field>
181
- `, 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: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { 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"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i4.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i8.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i9.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i9.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i9.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: i10.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: "directive", type: i11.KlesComponentDirective, selector: "[klesComponent]", inputs: ["component", "value", "field"] }, { kind: "component", type: i12.MatErrorMessageDirective, selector: "[matErrorMessage]", inputs: ["validations", "asyncValidations"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i13.TranslatePipe, name: "translate" }, { kind: "pipe", type: i14.KlesTransformPipe, name: "klesTransform" }] }); }
182
- }
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KlesFormSelectLazySearchComponent, decorators: [{
184
- type: Component,
185
- args: [{ selector: 'kles-form-select-lazy-search', template: `
186
- <mat-form-field [subscriptSizing]="field.subscriptSizing" class="margin-top" [color]="field.color" [formGroup]="group" [appearance]="field.appearance" class="field-bottom">
187
- @if (field.label) {
188
- <mat-label>{{field.label}}</mat-label>
189
- }
190
-
191
- <mat-select matTooltip="{{field.tooltip}}" [attr.id]="field.id" [ngClass]="field.ngClass"
192
- (openedChange)="openChange($event)" [compareWith]="compareFn" [panelWidth]="field.panelWidth || 'auto'"
193
- [placeholder]="field.placeholder | translate" [formControlName]="field.name" [multiple]="field.multiple">
194
- @if (field.triggerComponent) {
195
- <mat-select-trigger>
196
- <ng-container klesComponent [component]="field.triggerComponent" [value]="group.controls[field.name].value" [field]="field"></ng-container>
197
- </mat-select-trigger>
198
- }
199
-
200
- @if (field.virtualScroll) {
201
- <mat-option>
202
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
203
- placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
204
- </mat-option>
205
-
206
- <cdk-virtual-scroll-viewport [itemSize]="field.itemSize || 50" [style.height.px]=4*48>
207
- @if (!isLoading()) {
208
- @if (field.multiple) {
209
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
210
- {{'selectAll' | translate}}
211
- </mat-checkbox>
212
- }
213
-
214
- @if (!field.autocompleteComponent) {
215
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
216
-
217
- @if (field.multiple) {
218
- @for (item of group.controls[field.name].value | slice:0:30; track item) {
219
- <mat-option [value]="item" style="display:none">
220
- {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
221
- </mat-option>
222
- }
223
- }
224
-
225
- @if (!field.multiple && group.controls[field.name].value) {
226
- @for (item of [group?.controls[field.name]?.value]; track item) {
227
- <mat-option [value]="item" style="display:none">
228
- {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}
229
- </mat-option>
230
- }
231
- }
232
- }
233
- @else {
234
- <mat-option *cdkVirtualFor="let item of optionsFiltered$ | async" [value]="item" [disabled]="item?.disabled">
235
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
236
- </mat-option>
237
-
238
- @if (field.multiple) {
239
- @for (item of group.controls[field.name].value | slice:0:30; track item) {
240
- <mat-option [value]="item" style="display:none">
241
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
242
- </mat-option>
243
- }
244
- }
245
-
246
- @if (!field.multiple && group.controls[field.name].value) {
247
- @for (item of [group?.controls[field.name]?.value]; track item) {
248
- <mat-option [value]="item" style="display:none">
249
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
250
- </mat-option>
251
- }
252
- }
253
- }
254
- }
255
- @else {
256
- <mat-option class="hide-checkbox" disabled><div class="loadingSelect">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
257
- }
258
- </cdk-virtual-scroll-viewport>
259
- }
260
- @else {
261
- <mat-option>
262
- <ngx-mat-select-search [formControl]="searchControl" [clearSearchInput]="false"
263
- placeholderLabel="" noEntriesFoundLabel =""></ngx-mat-select-search>
264
- </mat-option>
265
-
266
- @if (!isLoading()) {
267
- @if (field.multiple) {
268
- <mat-checkbox class="selectAll mat-mdc-option mdc-list-item" [formControl]="selectAllControl" (change)="toggleAllSelection($event)">
269
- {{'selectAll' | translate}}
270
- </mat-checkbox>
271
- }
272
-
273
- @if (!field.autocompleteComponent) {
274
- @for (item of optionsFiltered$ | async; track item) {
275
- <mat-option [value]="item" [disabled]="item?.disabled">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>
276
- }
277
- }
278
- @else {
279
- @for (item of optionsFiltered$ | async; track item) {
280
- <mat-option [value]="item" [disabled]="item?.disabled">
281
- <ng-container klesComponent [component]="field.autocompleteComponent" [value]="item" [field]="field"></ng-container>
282
- </mat-option>
283
- }
284
- }
285
- }
286
- @else {
287
- <mat-option class="hide-checkbox" disabled><div class="loadingSelect">{{'loading' | translate}}... <mat-spinner class="spinner" diameter="20"></mat-spinner></div></mat-option>
288
- }
289
- }
290
-
291
- </mat-select>
292
-
293
- @if (field.subComponents || field.clearable) {
294
- <div matSuffix>
295
- <ng-content></ng-content>
296
- </div>
297
- }
298
-
299
- <mat-error matErrorMessage [validations]="field.validations" [asyncValidations]="field.asyncValidations"></mat-error>
300
- </mat-form-field>
301
- `, 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"] }]
302
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }] });
303
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0Lmxhenktc2VhcmNoLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4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B8IGtsZXNUcmFuc2Zvcm06ZmllbGQucGlwZVRyYW5zZm9ybX19PC9tYXQtb3B0aW9uPlxuXG4gICAgICAgICAgICAgICAgICAgICAgICBAaWYgKGZpZWxkLm11bHRpcGxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZvciAoaXRlbSBvZiBncm91cC5jb250cm9sc1tmaWVsZC5uYW1lXS52YWx1ZSB8IHNsaWNlOjA6MzA7IHRyYWNrIGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1vcHRpb24gW3ZhbHVlXT1cIml0ZW1cIiBzdHlsZT1cImRpc3BsYXk6bm9uZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3soZmllbGQucHJvcGVydHkgPyBpdGVtW2ZpZWxkLnByb3BlcnR5XSA6IGl0ZW0pIHwga2xlc1RyYW5zZm9ybTpmaWVsZC5waXBlVHJhbnNmb3JtfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtb3B0aW9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgQGlmICghZmllbGQubXVsdGlwbGUgJiYgZ3JvdXAuY29udHJvbHNbZmllbGQubmFtZV0udmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAZm9yIChpdGVtIG9mIFtncm91cD8uY29udHJvbHNbZmllbGQubmFtZV0/LnZhbHVlXTsgdHJhY2sgaXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bWF0LW9wdGlvbiBbdmFsdWVdPVwiaXRlbVwiIHN0eWxlPVwiZGlzcGxheTpub25lXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7eyhmaWVsZC5wcm9wZXJ0eSA/IGl0ZW1bZmllbGQucHJvcGVydHldIDogaXRlbSkgfCBrbGVzVHJhbnNmb3JtOmZpZWxkLnBpcGVUcmFuc2Zvcm19fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1vcHRpb24+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIEBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtb3B0aW9uICpjZGtWaXJ0dWFsRm9yPVwibGV0IGl0ZW0gb2Ygb3B0aW9uc0ZpbHRlcmVkJCB8IGFzeW5jXCIgW3ZhbHVlXT1cIml0ZW1cIiBbZGlzYWJsZWRdPVwiaXRlbT8uZGlzYWJsZWRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bmctY29udGFpbmVyIGtsZXNDb21wb25lbnQgW2NvbXBvbmVudF09XCJmaWVsZC5hdXRvY29tcGxldGVDb21wb25lbnRcIiBbdmFsdWVdPVwiaXRlbVwiIFtmaWVsZF09XCJmaWVsZFwiPjwvbmctY29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtb3B0aW9uPlxuXG4gICAgICAgICAgICAgICAgICAgICAgICBAaWYgKGZpZWxkLm11bHRpcGxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZvciAoaXRlbSBvZiBncm91cC5jb250cm9sc1tmaWVsZC5uYW1lXS52YWx1ZSB8IHNsaWNlOjA6MzA7IHRyYWNrIGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1vcHRpb24gW3ZhbHVlXT1cIml0ZW1cIiBzdHlsZT1cImRpc3BsYXk6bm9uZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG5nLWNvbnRhaW5lciBrbGVzQ29tcG9uZW50IFtjb21wb25lbnRdPVwiZmllbGQuYXV0b2NvbXBsZXRlQ29tcG9uZW50XCIgW3ZhbHVlXT1cIml0ZW1cIiBbZmllbGRdPVwiZmllbGRcIj48L25nLWNvbnRhaW5lcj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtb3B0aW9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgQGlmICghZmllbGQubXVsdGlwbGUgJiYgZ3JvdXAuY29udHJvbHNbZmllbGQubmFtZV0udmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAZm9yIChpdGVtIG9mIFtncm91cD8uY29udHJvbHNbZmllbGQubmFtZV0/LnZhbHVlXTsgdHJhY2sgaXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bWF0LW9wdGlvbiBbdmFsdWVdPVwiaXRlbVwiIHN0eWxlPVwiZGlzcGxheTpub25lXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bmctY29udGFpbmVyIGtsZXNDb21wb25lbnQgW2NvbXBvbmVudF09XCJmaWVsZC5hdXRvY29tcGxldGVDb21wb25lbnRcIiBbdmFsdWVdPVwiaXRlbVwiIFtmaWVsZF09XCJmaWVsZFwiPjwvbmctY29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1vcHRpb24+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIEBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgPG1hdC1vcHRpb24gY2xhc3M9XCJoaWRlLWNoZWNrYm94XCIgZGlzYWJsZWQ+PGRpdiBjbGFzcz1cImxvYWRpbmdTZWxlY3RcIj57eydsb2FkaW5nJyB8IHRyYW5zbGF0ZX19Li4uIDxtYXQtc3Bpbm5lciBjbGFzcz1cInNwaW5uZXJcIiBkaWFtZXRlcj1cIjIwXCI+PC9tYXQtc3Bpbm5lcj48L2Rpdj48L21hdC1vcHRpb24+XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgPC9jZGstdmlydHVhbC1zY3JvbGwtdmlld3BvcnQ+XG4gICAgICAgIH1cbiAgICAgICAgQGVsc2Uge1xuICAgICAgICAgICAgPG1hdC1vcHRpb24+XG4gICAgICAgICAgICAgICAgPG5neC1tYXQtc2VsZWN0LXNlYXJjaCBbZm9ybUNvbnRyb2xdPVwic2VhcmNoQ29udHJvbFwiIFtjbGVhclNlYXJjaElucHV0XT1cImZhbHNlXCJcbiAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckxhYmVsPVwiXCIgbm9FbnRyaWVzRm91bmRMYWJlbCA9XCJcIj48L25neC1tYXQtc2VsZWN0LXNlYXJjaD5cbiAgICAgICAgICAgIDwvbWF0LW9wdGlvbj5cblxuICAgICAgICAgICAgQGlmICghaXNMb2FkaW5nKCkpIHtcbiAgICAgICAgICAgICAgICBAaWYgKGZpZWxkLm11bHRpcGxlKSB7XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtY2hlY2tib3ggY2xhc3M9XCJzZWxlY3RBbGwgbWF0LW1kYy1vcHRpb24gbWRjLWxpc3QtaXRlbVwiIFtmb3JtQ29udHJvbF09XCJzZWxlY3RBbGxDb250cm9sXCIgKGNoYW5nZSk9XCJ0b2dnbGVBbGxTZWxlY3Rpb24oJGV2ZW50KVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAge3snc2VsZWN0QWxsJyB8IHRyYW5zbGF0ZX19XG4gICAgICAgICAgICAgICAgICAgIDwvbWF0LWNoZWNrYm94PlxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIEBpZiAoIWZpZWxkLmF1dG9jb21wbGV0ZUNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgICAgICBAZm9yIChpdGVtI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b24pIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm9wZW5DaGFuZ2UkLmdldFZhbHVlKCkgJiYgdGhpcy5maWVsZC5vcHRpb25zIGluc3RhbmNlb2YgRnVuY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZmllbGQub3B0aW9ucyh2YWx1ZSkucGlwZSh0YWtlKDEpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maWVsZC5vcHRpb25zKCkucGlwZSh0YWtlKDEpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gb2YodGhpcy5ncm91cC5jb250cm9sc1t0aGlzLmZpZWxkLm5hbWVdLnZhbHVlID8gW3RoaXMuZ3JvdXAuY29udHJvbHNbdGhpcy5maWVsZC5uYW1lXS52YWx1ZV0gOiBbXSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gc3VwZXIub25TZWFyY2hDaGFuZ2UodmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHJvdGVjdGVkIG9wZW5DaGFuZ2VFdmVudCgpOiB2b2lkIHtcbiAgICAgICAgdGhpcy5vcGVuQ2hhbmdlJFxuICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgdGFrZVVudGlsKHRoaXMuX29uRGVzdHJveSksXG4gICAgICAgICAgICAgICAgc3dpdGNoTWFwKChpc09wZW4pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMub25PcGVuQ2hhbmdlKGlzT3BlbikucGlwZShtYXAoKG9wdGlvbnMpID0+ICh7IG9wdGlvbnMsIGlzT3BlbiB9KSkpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApXG4gICAgICAgICAgICAuc3Vic2NyaWJlKCh7IG9wdGlvbnMsIGlzT3BlbiB9KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCFpc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZWFyY2hDb250cm9sLnJlc2V0KG51bGwsIHsgZW1pdEV2ZW50OiBmYWxzZSB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zRmlsdGVyZWQkLm5leHQob3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pc0xvYWRpbmcuc2V0KGZhbHNlKTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlZi5tYXJrRm9yQ2hlY2soKTtcbiAgICAgICAgICAgIH0pO1xuICAgIH1cbn1cbiJdfQ==