@yuuvis/client-framework 3.0.1 → 3.2.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 (67) hide show
  1. package/fesm2022/yuuvis-client-framework-actions.mjs +214 -126
  2. package/fesm2022/yuuvis-client-framework-actions.mjs.map +1 -1
  3. package/fesm2022/yuuvis-client-framework-app-bar.mjs +3 -3
  4. package/fesm2022/yuuvis-client-framework-app-bar.mjs.map +1 -1
  5. package/fesm2022/yuuvis-client-framework-badges.mjs +379 -0
  6. package/fesm2022/yuuvis-client-framework-badges.mjs.map +1 -0
  7. package/fesm2022/yuuvis-client-framework-breadcrumb.mjs +3 -3
  8. package/fesm2022/yuuvis-client-framework-breadcrumb.mjs.map +1 -1
  9. package/fesm2022/yuuvis-client-framework-clipboard.mjs +8 -8
  10. package/fesm2022/yuuvis-client-framework-clipboard.mjs.map +1 -1
  11. package/fesm2022/yuuvis-client-framework-datepicker.mjs +31 -31
  12. package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -1
  13. package/fesm2022/yuuvis-client-framework-forms.mjs +745 -657
  14. package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
  15. package/fesm2022/yuuvis-client-framework-icons.mjs +9 -9
  16. package/fesm2022/yuuvis-client-framework-icons.mjs.map +1 -1
  17. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +10 -9
  18. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
  19. package/fesm2022/yuuvis-client-framework-metadata-form.mjs +19 -17
  20. package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
  21. package/fesm2022/yuuvis-client-framework-object-details.mjs +215 -208
  22. package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
  23. package/fesm2022/yuuvis-client-framework-object-flavor.mjs +18 -18
  24. package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
  25. package/fesm2022/yuuvis-client-framework-object-form.mjs +41 -37
  26. package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
  27. package/fesm2022/yuuvis-client-framework-object-preview.mjs +9 -9
  28. package/fesm2022/yuuvis-client-framework-object-preview.mjs.map +1 -1
  29. package/fesm2022/yuuvis-client-framework-object-relationship.mjs +29 -29
  30. package/fesm2022/yuuvis-client-framework-object-relationship.mjs.map +1 -1
  31. package/fesm2022/yuuvis-client-framework-object-summary.mjs +16 -16
  32. package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
  33. package/fesm2022/yuuvis-client-framework-object-versions.mjs +18 -12
  34. package/fesm2022/yuuvis-client-framework-object-versions.mjs.map +1 -1
  35. package/fesm2022/yuuvis-client-framework-pagination.mjs +3 -3
  36. package/fesm2022/yuuvis-client-framework-pagination.mjs.map +1 -1
  37. package/fesm2022/yuuvis-client-framework-query-list.mjs +7 -7
  38. package/fesm2022/yuuvis-client-framework-query-list.mjs.map +1 -1
  39. package/fesm2022/yuuvis-client-framework-renderer.mjs +40 -40
  40. package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
  41. package/fesm2022/yuuvis-client-framework-sequence-list.mjs +50 -38
  42. package/fesm2022/yuuvis-client-framework-sequence-list.mjs.map +1 -1
  43. package/fesm2022/yuuvis-client-framework-simple-search.mjs +3 -3
  44. package/fesm2022/yuuvis-client-framework-simple-search.mjs.map +1 -1
  45. package/fesm2022/yuuvis-client-framework-sort.mjs +3 -3
  46. package/fesm2022/yuuvis-client-framework-sort.mjs.map +1 -1
  47. package/fesm2022/yuuvis-client-framework-tile-list.mjs +191 -127
  48. package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
  49. package/fesm2022/yuuvis-client-framework-token-search.mjs +7 -7
  50. package/fesm2022/yuuvis-client-framework-token-search.mjs.map +1 -1
  51. package/fesm2022/yuuvis-client-framework-tree.mjs +9 -9
  52. package/fesm2022/yuuvis-client-framework-tree.mjs.map +1 -1
  53. package/fesm2022/yuuvis-client-framework-upload-progress.mjs +10 -10
  54. package/fesm2022/yuuvis-client-framework-upload-progress.mjs.map +1 -1
  55. package/fesm2022/yuuvis-client-framework.mjs +96 -51
  56. package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
  57. package/lib/assets/i18n/de.json +12 -1
  58. package/lib/assets/i18n/en.json +12 -1
  59. package/package.json +9 -5
  60. package/types/yuuvis-client-framework-actions.d.ts +91 -52
  61. package/types/yuuvis-client-framework-badges.d.ts +194 -0
  62. package/types/yuuvis-client-framework-forms.d.ts +215 -186
  63. package/types/yuuvis-client-framework-object-details.d.ts +104 -104
  64. package/types/yuuvis-client-framework-object-versions.d.ts +1 -0
  65. package/types/yuuvis-client-framework-sequence-list.d.ts +2 -2
  66. package/types/yuuvis-client-framework-tile-list.d.ts +11 -6
  67. package/types/yuuvis-client-framework.d.ts +13 -0
@@ -1,43 +1,148 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, DestroyRef, input, signal, effect, untracked, Component, forwardRef, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, computed, linkedSignal, viewChild, output, Input, NgModule } from '@angular/core';
3
+ import { takeUntilDestroyed, rxResource } from '@angular/core/rxjs-interop';
4
+ import * as i1$1 from '@angular/forms';
5
+ import { FormControl, Validators, ReactiveFormsModule, FormBuilder, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormGroup, FormsModule } from '@angular/forms';
6
+ import { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
7
+ import * as i1 from '@angular/material/select';
8
+ import { MatSelectModule } from '@angular/material/select';
9
+ import { SystemService, TranslateService, Classification, Situation, TranslatePipe, Operator, OperatorLabel, Utils, CatalogService, LocaleNumberPipe, FileSizePipe, IdmService, UserService, SearchUtils, LocaleDatePipe, ClassificationPrefix } from '@yuuvis/client-core';
10
+ import { AbstractMatFormField, injectNgControl, FormTranslateService, DialogComponent, ScrollButtonsComponent } from '@yuuvis/client-framework/common';
1
11
  import * as i1$3 from '@angular/common';
2
12
  import { NgClass, CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { inject, signal, input, forwardRef, ChangeDetectionStrategy, Component, ChangeDetectorRef, ElementRef, computed, linkedSignal, effect, untracked, DestroyRef, viewChild, output, Input, NgModule } from '@angular/core';
5
- import * as i1 from '@angular/forms';
6
- import { FormBuilder, Validators, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormControl, FormGroup, FormsModule } from '@angular/forms';
7
13
  import { MatButtonModule } from '@angular/material/button';
8
14
  import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
9
15
  import * as i2 from '@angular/material/icon';
10
16
  import { MatIconModule } from '@angular/material/icon';
11
- import * as i1$1 from '@angular/material/menu';
17
+ import * as i1$2 from '@angular/material/menu';
12
18
  import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
13
19
  import * as i3 from '@angular/material/table';
14
20
  import { MatTableModule } from '@angular/material/table';
15
21
  import * as i4 from '@angular/material/tooltip';
16
22
  import { MatTooltipModule } from '@angular/material/tooltip';
17
- import { SystemService, Situation, TranslatePipe, TranslateService, Operator, OperatorLabel, Utils, LocaleNumberPipe, FileSizePipe, Classification, IdmService, UserService, SearchUtils, LocaleDatePipe, ClassificationPrefix } from '@yuuvis/client-core';
18
23
  import { YUV_ICONS } from '@yuuvis/client-framework/icons';
19
24
  import { MetadataFormFieldComponent, ObjectMetadataElementLabelDirective } from '@yuuvis/client-framework/metadata-form';
20
25
  import { RendererDirective } from '@yuuvis/client-framework/renderer';
21
26
  import { YmtButtonDirective, YmtIconButtonDirective } from '@yuuvis/material';
22
27
  import { map, timer, take, of, forkJoin } from 'rxjs';
23
- import { MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
24
- import { FormTranslateService, DialogComponent, AbstractMatFormField, injectNgControl, ScrollButtonsComponent } from '@yuuvis/client-framework/common';
25
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
26
28
  import { MatDatepickerModule } from '@angular/material/datepicker';
27
29
  import { MatInputModule } from '@angular/material/input';
28
- import { TranslateService as TranslateService$1, TranslatePipe as TranslatePipe$1 } from '@ngx-translate/core';
30
+ import { TranslateService as TranslateService$1, TranslatePipe as TranslatePipe$1, _ } from '@ngx-translate/core';
29
31
  import * as i2$1 from '@yuuvis/client-framework/datepicker';
30
32
  import { DatepickerComponent, YuvDatepickerModule } from '@yuuvis/client-framework/datepicker';
31
- import * as i1$2 from '@angular/material/select';
32
- import { MatSelectModule } from '@angular/material/select';
33
- import * as i3$1 from '@yuuvis/client-framework/autocomplete';
33
+ import * as i2$2 from '@yuuvis/client-framework/autocomplete';
34
34
  import { YuvAutocompleteModule } from '@yuuvis/client-framework/autocomplete';
35
35
  import { map as map$1, catchError } from 'rxjs/operators';
36
- import { marker } from '@colsen1991/ngx-translate-extract-marker';
37
36
  import { ENTER, COMMA } from '@angular/cdk/keycodes';
38
37
  import * as i1$4 from '@angular/material/chips';
39
38
  import { MatChipsModule } from '@angular/material/chips';
40
39
 
40
+ class FormUtils {
41
+ static getErrorState(control) {
42
+ return control.invalid && (control.dirty || control.touched);
43
+ }
44
+ }
45
+
46
+ class CatalogComponent extends AbstractMatFormField {
47
+ constructor() {
48
+ super(...arguments);
49
+ this.#system = inject(SystemService);
50
+ this.#dRef = inject(DestroyRef);
51
+ this.translate = inject(TranslateService);
52
+ this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
53
+ this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
54
+ this._options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : /* istanbul ignore next */ []));
55
+ this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
56
+ this.#optionsEffect = effect(() => {
57
+ untracked(() => {
58
+ this.#setOptions(this.options() || [], false);
59
+ });
60
+ }, ...(ngDevMode ? [{ debugName: "#optionsEffect" }] : /* istanbul ignore next */ []));
61
+ /**
62
+ * Additional semantics for the form element.
63
+ */
64
+ this.classifications = input([], ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
65
+ this.#classificationEffect = effect(() => {
66
+ const cls = this.classifications();
67
+ untracked(() => {
68
+ const ce = this.#system.getClassifications(cls).get(Classification.STRING_CATALOG);
69
+ if (ce && ce.options) {
70
+ this.#setOptions(ce.options, false);
71
+ }
72
+ });
73
+ }, ...(ngDevMode ? [{ debugName: "#classificationEffect" }] : /* istanbul ignore next */ []));
74
+ /**
75
+ * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.
76
+ */
77
+ this.situation = input(...(ngDevMode ? [undefined, { debugName: "situation" }] : /* istanbul ignore next */ []));
78
+ this.ngControl = injectNgControl(this);
79
+ this.fc = new FormControl(undefined);
80
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
81
+ this.propagateChange = (_) => { };
82
+ }
83
+ #system;
84
+ #dRef;
85
+ #optionsEffect;
86
+ #classificationEffect;
87
+ #onValueChange(val) {
88
+ this.value = val;
89
+ this.propagateChange(this.value);
90
+ }
91
+ #setOptions(options, translate) {
92
+ if (translate) {
93
+ this._options.set(options.map((o) => ({
94
+ label: this.translate.instant(o),
95
+ value: o
96
+ })));
97
+ }
98
+ else {
99
+ this._options.set(options.map((o) => ({
100
+ label: o,
101
+ value: o
102
+ })));
103
+ }
104
+ }
105
+ writeValue(value) {
106
+ this.value = value;
107
+ this.fc.setValue(value, { emitEvent: false });
108
+ }
109
+ registerOnChange(fn) {
110
+ this.propagateChange = fn;
111
+ }
112
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
113
+ registerOnTouched(fn) { }
114
+ setDisabledState(isDisabled) {
115
+ if (isDisabled) {
116
+ this.fc.disable();
117
+ }
118
+ else {
119
+ this.fc.enable();
120
+ }
121
+ this.disabled = isDisabled;
122
+ }
123
+ ngOnInit() {
124
+ if (this.required)
125
+ this.fc.setValidators(Validators.required);
126
+ this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
127
+ this.errorState = FormUtils.getErrorState(this.fc);
128
+ if (this.ngControl?.control) {
129
+ this.ngControl.control.setErrors(this.fc.errors);
130
+ }
131
+ });
132
+ this.fc.updateValueAndValidity();
133
+ this.fc.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => this.#onValueChange(v));
134
+ }
135
+ ngOnDestroy() {
136
+ super.onNgOnDestroy();
137
+ }
138
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: CatalogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
139
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: CatalogComponent, isStandalone: true, selector: "yuv-catalog", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: CatalogComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
140
+ }
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: CatalogComponent, decorators: [{
142
+ type: Component,
143
+ args: [{ selector: 'yuv-catalog', imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: CatalogComponent }], template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n" }]
144
+ }], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
145
+
41
146
  class EditTableDataComponent {
42
147
  constructor() {
43
148
  this.#fb = inject(FormBuilder);
@@ -52,7 +157,7 @@ class EditTableDataComponent {
52
157
  this.columns = (this.formElement['elements'] || []).map((c) => ({
53
158
  ...c,
54
159
  propertyType: c.type,
55
- _internalType: this.#system.getInternalFormElementType(c.type, c.classifications)
160
+ _internalType: this.#system.getInternalFormElementType(c.type, c.classifications, c.catalog)
56
161
  }));
57
162
  this.#elementData = this.#dialogData.elementData || {};
58
163
  this.situation = this.#dialogData.situation || Situation.EDIT;
@@ -113,16 +218,16 @@ class EditTableDataComponent {
113
218
  return Object.keys(errors).length ? errors : null;
114
219
  };
115
220
  }
116
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EditTableDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
117
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: EditTableDataComponent, isStandalone: true, selector: "yuv-edit-table-data", inputs: { isInnerTableForm: { classPropertyName: "isInnerTableForm", publicName: "isInnerTableForm", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
221
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: EditTableDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
222
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: EditTableDataComponent, isStandalone: true, selector: "yuv-edit-table-data", inputs: { isInnerTableForm: { classPropertyName: "isInnerTableForm", publicName: "isInnerTableForm", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
118
223
  {
119
224
  provide: NG_VALUE_ACCESSOR,
120
225
  useExisting: forwardRef(() => EditTableDataComponent),
121
226
  multi: true
122
227
  }
123
- ], ngImport: i0, template: "<yuv-dialog [headertitle]=\"(adding ? 'yuv.form.element.data.grid.add.headline' : 'yuv.form.element.data.grid.edit.headline') | translate: { headline: header }\">\n <main>\n <div [formGroup]=\"tableForm\">\n <div class=\"fields\">\n @for (element of columns; track $index) {\n <div [attr.data-name]=\"element.name\" class=\"form-field\">\n <yuv-metadata-form-field [field]=\"element\" [formControlName]=\"element.name\" [situation]=\"situation\"></yuv-metadata-form-field>\n </div>\n }\n </div>\n </div>\n </main>\n\n <footer>\n <button ymtButton=\"secondary\" (click)=\"cancel()\">{{ 'yuv.form.element.data.grid.edit.cancel' | translate }}</button>\n <button ymtButton=\"primary\" (click)=\"submit()\" [disabled]=\"!tableForm.dirty || !tableForm.valid\">\n @if (adding) {\n {{ 'yuv.form.element.data.grid.edit.add' | translate }}\n } @else {\n {{ 'yuv.object-metadata.button.save' | translate }}\n }\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host .fields{padding:var(--ymt-spacing-m)}:host .fields .form-field:not(:last-child){margin-block-end:var(--ymt-spacing-s)}:host .err-msg{font:var(--ymt-font-body-subtle);color:var(--ymt-danger);padding:var(--ymt-spacing-2xs) 0;border:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: MetadataFormFieldComponent, selector: "yuv-metadata-form-field", inputs: ["formChangedSubject", "field", "situation"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
228
+ ], ngImport: i0, template: "<yuv-dialog [headertitle]=\"(adding ? 'yuv.form.element.data.grid.add.headline' : 'yuv.form.element.data.grid.edit.headline') | translate: { headline: header }\">\n <main>\n <div [formGroup]=\"tableForm\">\n <div class=\"fields\">\n @for (element of columns; track $index) {\n <div [attr.data-name]=\"element.name\" class=\"form-field\">\n <yuv-metadata-form-field [field]=\"element\" [formControlName]=\"element.name\" [situation]=\"situation\"></yuv-metadata-form-field>\n </div>\n }\n </div>\n </div>\n </main>\n\n <footer>\n <button ymtButton=\"secondary\" (click)=\"cancel()\">{{ 'yuv.form.element.data.grid.edit.cancel' | translate }}</button>\n <button ymtButton=\"primary\" (click)=\"submit()\" [disabled]=\"!tableForm.dirty || !tableForm.valid\">\n @if (adding) {\n {{ 'yuv.form.element.data.grid.edit.add' | translate }}\n } @else {\n {{ 'yuv.object-metadata.button.save' | translate }}\n }\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host .fields{padding:var(--ymt-spacing-m)}:host .fields .form-field:not(:last-child){margin-block-end:var(--ymt-spacing-s)}:host .err-msg{font:var(--ymt-font-body-subtle);color:var(--ymt-danger);padding:var(--ymt-spacing-2xs) 0;border:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: MetadataFormFieldComponent, selector: "yuv-metadata-form-field", inputs: ["formChangedSubject", "field", "situation"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
124
229
  }
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EditTableDataComponent, decorators: [{
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: EditTableDataComponent, decorators: [{
126
231
  type: Component,
127
232
  args: [{ selector: 'yuv-edit-table-data', standalone: true, imports: [
128
233
  ReactiveFormsModule,
@@ -294,7 +399,7 @@ class DataGridComponent {
294
399
  type: el.type,
295
400
  cell: (element) => ({
296
401
  propertyName: el.name,
297
- rendererType: this.#systemService.getInternalFormElementType(el.type, el.classifications),
402
+ rendererType: this.#systemService.getInternalFormElementType(el.type, el.classifications, el.catalog),
298
403
  value: element[el.name],
299
404
  meta: element[el.name]
300
405
  })
@@ -348,8 +453,8 @@ class DataGridComponent {
348
453
  return;
349
454
  this.onTouched();
350
455
  }
351
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
352
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DataGridComponent, isStandalone: true, selector: "yuv-data-grid", inputs: { situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, formElement: { classPropertyName: "formElement", publicName: "formElement", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, formFieldContext: { classPropertyName: "formFieldContext", publicName: "formFieldContext", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "onHostFocusOut($event)" }, classAttribute: "yuv-data-grid" }, providers: [
456
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
457
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DataGridComponent, isStandalone: true, selector: "yuv-data-grid", inputs: { situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, formElement: { classPropertyName: "formElement", publicName: "formElement", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, formFieldContext: { classPropertyName: "formFieldContext", publicName: "formFieldContext", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "onHostFocusOut($event)" }, classAttribute: "yuv-data-grid" }, providers: [
353
458
  {
354
459
  provide: NG_VALUE_ACCESSOR,
355
460
  useExisting: forwardRef(() => DataGridComponent),
@@ -360,9 +465,9 @@ class DataGridComponent {
360
465
  useExisting: forwardRef(() => DataGridComponent),
361
466
  multi: true
362
467
  }
363
- ], ngImport: i0, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\" [matTooltip]=\"'yuv.form.element.data.grid.add-row.button.tooltip' | translate\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n @let data = dataSource();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8\">\n <caption class=\"ymt-hide-sr\">\n {{\n tableLabel()\n }}\n </caption>\n\n @for (column of displayedCol; track column) {\n @if (column.columnDef === 'actions') {\n <!-- <h1>Actions</h1> -->\n <ng-container [matColumnDef]=\"column.columnDef\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef aria-label=\"row actions\"></th>\n <td class=\"yuv-data-grid__cell--editable\" mat-cell *matCellDef=\"let element\">\n <div class=\"yuv-data-grid__table-actions\">\n <!-- Only show the button in the last (empty) row -->\n <button ymtIconButton icon-button-size=\"small\" class=\"table-options-menu-bar-item\" [matMenuTriggerFor]=\"menu\" (click)=\"onMenuTrigger(element)\" [matTooltip]=\"'yuv.form.element.data.grid.row.button.actions.tooltip' | translate\" >\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n } @else {\n <ng-container [matColumnDef]=\"column.columnDef\">\n <th mat-header-cell *matHeaderCellDef [attr.aria-label]=\"column.header\" [title]=\"column.header\">{{ column.header }}</th>\n <td\n [ngClass]=\"{ 'number-cell': column.type === 'integer' || column.type === 'decimal', 'yuv-data-grid__cell--editable': !readonly() }\"\n mat-cell\n *matCellDef=\"let element\"\n >\n <ng-template *yuvRenderer=\"column.cell(element)\"></ng-template>\n </td>\n </ng-container>\n }\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell no-data-cell\" [attr.colspan]=\"column.length\"></td>\n </tr>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColActions; sticky: ['header-1']\"></tr>\n\n <tr (dblclick)=\"editRow(row)\" [class.selected-row]=\"row === selectedRow()\" mat-row *matRowDef=\"let row; columns: displayedColActions\"></tr>\n </table>\n @if (data.length === 0) {\n <span class=\"no-data\">{{ 'yuv.form.element.data.grid.noData' | translate }}</span>\n }\n </div>\n</fieldset>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"editRow(selectedRow())\">{{ 'yuv.form.element.data.grid.edit' | translate }}</button>\n <button mat-menu-item (click)=\"removeRow(selectedRow())\">{{ 'yuv.form.element.data.grid.remove' | translate }}</button>\n</mat-menu>\n", styles: [":host{--table-size-small: 200px;--table-size-medium: 400px;--table-size-large: 600px;--table-size-extra-large: 800px;max-width:100%;width:100%;border:1px solid var(--ymt-outline-variant);border-radius:var(--ymt-corner-s);overflow:hidden;position:relative}:host .yuv-data-grid__header{display:flex;justify-content:space-between;align-items:center;padding:var(--ymt-spacing-xs)}:host .yuv-data-grid__header-title{transform:scale(var(--mat-mdc-form-field-floating-label-scale, .75))}:host .yuv-data-grid__header-title--invalid{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);align-self:baseline}:host .yuv-data-grid__cell--editable{-webkit-user-select:none;user-select:none}:host .yuv-data-grid__table{overflow:auto;white-space:nowrap}:host .yuv-data-grid__table.small{height:var(--table-size-small)}:host .yuv-data-grid__table.medium{height:var(--table-size-medium)}:host .yuv-data-grid__table.large{height:var(--table-size-large)}:host .yuv-data-grid__table.extra-large{height:var(--table-size-extra-large)}:host .yuv-data-grid__table .no-data{display:block;width:100%;background-color:var(--ymt-surface);text-align:center;padding:var(--ymt-spacing-s);font:var(--ymt-font-body);color:var(--ymt-text-color-subtle);font-style:italic}:host .yuv-data-grid__table-actions{display:flex;align-items:center;justify-content:flex-end}:host.yuv-data-grid{display:block}:host.yuv-data-grid ::ng-deep tr.cdk-row td.number-cell{text-align:right}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: RendererDirective, selector: "[yuvRenderer]", inputs: ["yuvRenderer"] }, { kind: "directive", type: ObjectMetadataElementLabelDirective, selector: "[yuvObjectMetadataElementLabel]", inputs: ["yuvObjectMetadataElementLabel"] }, { kind: "directive", type: YmtIconButtonDirective, selector: "button[ymtIconButton],button[ymt-icon-button],a[ymtIconButton],a[ymt-icon-button]", inputs: ["disabled", "disableRipple", "aria-disabled", "disabledInteractive", "icon-button-size"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
468
+ ], ngImport: i0, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\" [matTooltip]=\"'yuv.form.element.data.grid.add-row.button.tooltip' | translate\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n @let data = dataSource();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8\">\n <caption class=\"ymt-hide-sr\">\n {{\n tableLabel()\n }}\n </caption>\n\n @for (column of displayedCol; track column) {\n @if (column.columnDef === 'actions') {\n <!-- <h1>Actions</h1> -->\n <ng-container [matColumnDef]=\"column.columnDef\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef aria-label=\"row actions\"></th>\n <td class=\"yuv-data-grid__cell--editable\" mat-cell *matCellDef=\"let element\">\n <div class=\"yuv-data-grid__table-actions\">\n <!-- Only show the button in the last (empty) row -->\n <button ymtIconButton icon-button-size=\"small\" class=\"table-options-menu-bar-item\" [matMenuTriggerFor]=\"menu\" (click)=\"onMenuTrigger(element)\" [matTooltip]=\"'yuv.form.element.data.grid.row.button.actions.tooltip' | translate\" >\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n } @else {\n <ng-container [matColumnDef]=\"column.columnDef\">\n <th mat-header-cell *matHeaderCellDef [attr.aria-label]=\"column.header\" [title]=\"column.header\">{{ column.header }}</th>\n <td\n [ngClass]=\"{ 'number-cell': column.type === 'integer' || column.type === 'decimal', 'yuv-data-grid__cell--editable': !readonly() }\"\n mat-cell\n *matCellDef=\"let element\"\n >\n <ng-template *yuvRenderer=\"column.cell(element)\"></ng-template>\n </td>\n </ng-container>\n }\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell no-data-cell\" [attr.colspan]=\"column.length\"></td>\n </tr>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColActions; sticky: ['header-1']\"></tr>\n\n <tr (dblclick)=\"editRow(row)\" [class.selected-row]=\"row === selectedRow()\" mat-row *matRowDef=\"let row; columns: displayedColActions\"></tr>\n </table>\n @if (data.length === 0) {\n <span class=\"no-data\">{{ 'yuv.form.element.data.grid.noData' | translate }}</span>\n }\n </div>\n</fieldset>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"editRow(selectedRow())\">{{ 'yuv.form.element.data.grid.edit' | translate }}</button>\n <button mat-menu-item (click)=\"removeRow(selectedRow())\">{{ 'yuv.form.element.data.grid.remove' | translate }}</button>\n</mat-menu>\n", styles: [":host{--table-size-small: 200px;--table-size-medium: 400px;--table-size-large: 600px;--table-size-extra-large: 800px;max-width:100%;width:100%;border:1px solid var(--ymt-outline-variant);border-radius:var(--ymt-corner-s);overflow:hidden;position:relative}:host .yuv-data-grid__header{display:flex;justify-content:space-between;align-items:center;padding:var(--ymt-spacing-xs)}:host .yuv-data-grid__header-title{transform:scale(var(--mat-mdc-form-field-floating-label-scale, .75))}:host .yuv-data-grid__header-title--invalid{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);align-self:baseline}:host .yuv-data-grid__cell--editable{-webkit-user-select:none;user-select:none}:host .yuv-data-grid__table{overflow:auto;white-space:nowrap}:host .yuv-data-grid__table.small{height:var(--table-size-small)}:host .yuv-data-grid__table.medium{height:var(--table-size-medium)}:host .yuv-data-grid__table.large{height:var(--table-size-large)}:host .yuv-data-grid__table.extra-large{height:var(--table-size-extra-large)}:host .yuv-data-grid__table .no-data{display:block;width:100%;background-color:var(--ymt-surface);text-align:center;padding:var(--ymt-spacing-s);font:var(--ymt-font-body);color:var(--ymt-text-color-subtle);font-style:italic}:host .yuv-data-grid__table-actions{display:flex;align-items:center;justify-content:flex-end}:host.yuv-data-grid{display:block}:host.yuv-data-grid ::ng-deep tr.cdk-row td.number-cell{text-align:right}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: RendererDirective, selector: "[yuvRenderer]", inputs: ["yuvRenderer"] }, { kind: "directive", type: ObjectMetadataElementLabelDirective, selector: "[yuvObjectMetadataElementLabel]", inputs: ["yuvObjectMetadataElementLabel"] }, { kind: "directive", type: YmtIconButtonDirective, selector: "button[ymtIconButton],button[ymt-icon-button],a[ymtIconButton],a[ymt-icon-button]", inputs: ["disabled", "disableRipple", "aria-disabled", "disabledInteractive", "icon-button-size"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
364
469
  }
365
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DataGridComponent, decorators: [{
470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DataGridComponent, decorators: [{
366
471
  type: Component,
367
472
  args: [{ selector: 'yuv-data-grid', standalone: true, imports: [
368
473
  NgClass,
@@ -388,12 +493,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
388
493
  }, template: "<fieldset [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"isInvalid\">\n <legend class=\"ymt-hide-sr\">\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </legend>\n <header class=\"yuv-data-grid__header\">\n <span\n [yuvObjectMetadataElementLabel]=\"formFieldContext()\"\n class=\"yuv-data-grid__header-title label\"\n [ngClass]=\"{ 'yuv-data-grid__header-title--invalid': isInvalid }\"\n aria-hidden=\"true\"\n >\n {{ tableLabel() }}\n @if (isRequired) {\n *\n }\n </span>\n\n @if (!readonly()) {\n <button ymtIconButton (click)=\"addRow()\" class=\"yuv-data-grid__header-action\" [matTooltip]=\"'yuv.form.element.data.grid.add-row.button.tooltip' | translate\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </header>\n\n @let displayedCol = displayedColumns();\n @let displayedColActions = displayedColumnsWithActions();\n @let data = dataSource();\n\n <div class=\"yuv-data-grid__table\" [ngClass]=\"size()\">\n <table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8\">\n <caption class=\"ymt-hide-sr\">\n {{\n tableLabel()\n }}\n </caption>\n\n @for (column of displayedCol; track column) {\n @if (column.columnDef === 'actions') {\n <!-- <h1>Actions</h1> -->\n <ng-container [matColumnDef]=\"column.columnDef\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef aria-label=\"row actions\"></th>\n <td class=\"yuv-data-grid__cell--editable\" mat-cell *matCellDef=\"let element\">\n <div class=\"yuv-data-grid__table-actions\">\n <!-- Only show the button in the last (empty) row -->\n <button ymtIconButton icon-button-size=\"small\" class=\"table-options-menu-bar-item\" [matMenuTriggerFor]=\"menu\" (click)=\"onMenuTrigger(element)\" [matTooltip]=\"'yuv.form.element.data.grid.row.button.actions.tooltip' | translate\" >\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n } @else {\n <ng-container [matColumnDef]=\"column.columnDef\">\n <th mat-header-cell *matHeaderCellDef [attr.aria-label]=\"column.header\" [title]=\"column.header\">{{ column.header }}</th>\n <td\n [ngClass]=\"{ 'number-cell': column.type === 'integer' || column.type === 'decimal', 'yuv-data-grid__cell--editable': !readonly() }\"\n mat-cell\n *matCellDef=\"let element\"\n >\n <ng-template *yuvRenderer=\"column.cell(element)\"></ng-template>\n </td>\n </ng-container>\n }\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell no-data-cell\" [attr.colspan]=\"column.length\"></td>\n </tr>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColActions; sticky: ['header-1']\"></tr>\n\n <tr (dblclick)=\"editRow(row)\" [class.selected-row]=\"row === selectedRow()\" mat-row *matRowDef=\"let row; columns: displayedColActions\"></tr>\n </table>\n @if (data.length === 0) {\n <span class=\"no-data\">{{ 'yuv.form.element.data.grid.noData' | translate }}</span>\n }\n </div>\n</fieldset>\n<mat-menu #menu=\"matMenu\">\n <button mat-menu-item (click)=\"editRow(selectedRow())\">{{ 'yuv.form.element.data.grid.edit' | translate }}</button>\n <button mat-menu-item (click)=\"removeRow(selectedRow())\">{{ 'yuv.form.element.data.grid.remove' | translate }}</button>\n</mat-menu>\n", styles: [":host{--table-size-small: 200px;--table-size-medium: 400px;--table-size-large: 600px;--table-size-extra-large: 800px;max-width:100%;width:100%;border:1px solid var(--ymt-outline-variant);border-radius:var(--ymt-corner-s);overflow:hidden;position:relative}:host .yuv-data-grid__header{display:flex;justify-content:space-between;align-items:center;padding:var(--ymt-spacing-xs)}:host .yuv-data-grid__header-title{transform:scale(var(--mat-mdc-form-field-floating-label-scale, .75))}:host .yuv-data-grid__header-title--invalid{background-color:var(--ymt-danger-container);color:var(--ymt-on-danger-container);align-self:baseline}:host .yuv-data-grid__cell--editable{-webkit-user-select:none;user-select:none}:host .yuv-data-grid__table{overflow:auto;white-space:nowrap}:host .yuv-data-grid__table.small{height:var(--table-size-small)}:host .yuv-data-grid__table.medium{height:var(--table-size-medium)}:host .yuv-data-grid__table.large{height:var(--table-size-large)}:host .yuv-data-grid__table.extra-large{height:var(--table-size-extra-large)}:host .yuv-data-grid__table .no-data{display:block;width:100%;background-color:var(--ymt-surface);text-align:center;padding:var(--ymt-spacing-s);font:var(--ymt-font-body);color:var(--ymt-text-color-subtle);font-style:italic}:host .yuv-data-grid__table-actions{display:flex;align-items:center;justify-content:flex-end}:host.yuv-data-grid{display:block}:host.yuv-data-grid ::ng-deep tr.cdk-row td.number-cell{text-align:right}\n"] }]
389
494
  }], propDecorators: { situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }], formElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "formElement", required: false }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], formFieldContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "formFieldContext", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
390
495
 
391
- class FormUtils {
392
- static getErrorState(control) {
393
- return control.invalid && (control.dirty || control.touched);
394
- }
395
- }
396
-
397
496
  class DatetimeComponent extends AbstractMatFormField {
398
497
  constructor() {
399
498
  super(...arguments);
@@ -501,10 +600,10 @@ class DatetimeComponent extends AbstractMatFormField {
501
600
  }
502
601
  });
503
602
  }
504
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
505
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: DatetimeComponent, isStandalone: true, selector: "yuv-datetime", inputs: { locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, onlyFutureDates: { classPropertyName: "onlyFutureDates", publicName: "onlyFutureDates", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, calendar: { classPropertyName: "calendar", publicName: "calendar", isSignal: true, isRequired: false, transformFunction: null }, withTime: { classPropertyName: "withTime", publicName: "withTime", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: DatetimeComponent }], viewQueries: [{ propertyName: "pickerCmp", first: true, predicate: DatepickerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<yuv-datepicker\n [calendar]=\"calendar()\"\n [disabled]=\"readonly()\"\n [withTime]=\"withTime()\"\n [locale]=\"_locale()\"\n [labels]=\"labels!\"\n [onlyFutureDates]=\"onlyFutureDates()\"\n [formControl]=\"fc\"\n></yuv-datepicker>\n", styles: [":host{display:flex;overflow-x:auto;--ymt-scrollbar-outer-size: 0px;--ymt-scrollbar-inner-size: 0px}:host yuv-datepicker{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: YuvDatepickerModule }, { kind: "component", type: i2$1.DatepickerComponent, selector: "yuv-datepicker", inputs: ["calendar", "readonly", "hour12", "locale", "labels", "withTime", "onlyFutureDates", "minDate", "maxDate", "disabled"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }] }); }
603
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
604
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.12", type: DatetimeComponent, isStandalone: true, selector: "yuv-datetime", inputs: { locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, onlyFutureDates: { classPropertyName: "onlyFutureDates", publicName: "onlyFutureDates", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, calendar: { classPropertyName: "calendar", publicName: "calendar", isSignal: true, isRequired: false, transformFunction: null }, withTime: { classPropertyName: "withTime", publicName: "withTime", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: DatetimeComponent }], viewQueries: [{ propertyName: "pickerCmp", first: true, predicate: DatepickerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<yuv-datepicker\n [calendar]=\"calendar()\"\n [disabled]=\"readonly()\"\n [withTime]=\"withTime()\"\n [locale]=\"_locale()\"\n [labels]=\"labels!\"\n [onlyFutureDates]=\"onlyFutureDates()\"\n [formControl]=\"fc\"\n></yuv-datepicker>\n", styles: [":host{display:flex;overflow-x:auto;--ymt-scrollbar-outer-size: 0px;--ymt-scrollbar-inner-size: 0px}:host yuv-datepicker{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: YuvDatepickerModule }, { kind: "component", type: i2$1.DatepickerComponent, selector: "yuv-datepicker", inputs: ["calendar", "readonly", "hour12", "locale", "labels", "withTime", "onlyFutureDates", "minDate", "maxDate", "disabled"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }] }); }
506
605
  }
507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimeComponent, decorators: [{
606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DatetimeComponent, decorators: [{
508
607
  type: Component,
509
608
  args: [{ selector: 'yuv-datetime', standalone: true, imports: [ReactiveFormsModule, YuvDatepickerModule, MatInputModule, MatDatepickerModule], providers: [{ provide: MatFormFieldControl, useExisting: DatetimeComponent }], template: "<yuv-datepicker\n [calendar]=\"calendar()\"\n [disabled]=\"readonly()\"\n [withTime]=\"withTime()\"\n [locale]=\"_locale()\"\n [labels]=\"labels!\"\n [onlyFutureDates]=\"onlyFutureDates()\"\n [formControl]=\"fc\"\n></yuv-datepicker>\n", styles: [":host{display:flex;overflow-x:auto;--ymt-scrollbar-outer-size: 0px;--ymt-scrollbar-inner-size: 0px}:host yuv-datepicker{flex:1}\n"] }]
510
609
  }], propDecorators: { pickerCmp: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DatepickerComponent), { isSignal: true }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], onlyFutureDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlyFutureDates", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], calendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendar", required: false }] }], withTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "withTime", required: false }] }] } });
@@ -665,170 +764,365 @@ class DatetimeRangeComponent extends AbstractMatFormField {
665
764
  ngOnDestroy() {
666
765
  super.onNgOnDestroy();
667
766
  }
668
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimeRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
669
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DatetimeRangeComponent, isStandalone: true, selector: "yuv-datetime-range", inputs: { withTimeInput: { classPropertyName: "withTimeInput", publicName: "withTime", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, operator: { classPropertyName: "operator", publicName: "operator", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: DatetimeRangeComponent }], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime()\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-datetime [withTime]=\"withTime()\" formControlName=\"dateValue\"></yuv-datetime>\n</form>\n", styles: [":host form{display:flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host form yuv-datetime{flex:1 1 auto}:host form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimeComponent, selector: "yuv-datetime", inputs: ["locale", "onlyFutureDates", "readonly", "calendar", "withTime"] }] }); }
767
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DatetimeRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
768
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DatetimeRangeComponent, isStandalone: true, selector: "yuv-datetime-range", inputs: { withTimeInput: { classPropertyName: "withTimeInput", publicName: "withTime", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, operator: { classPropertyName: "operator", publicName: "operator", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: DatetimeRangeComponent }], usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime()\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-datetime [withTime]=\"withTime()\" formControlName=\"dateValue\"></yuv-datetime>\n</form>\n", styles: [":host form{display:flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host form yuv-datetime{flex:1 1 auto}:host form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimeComponent, selector: "yuv-datetime", inputs: ["locale", "onlyFutureDates", "readonly", "calendar", "withTime"] }] }); }
670
769
  }
671
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DatetimeRangeComponent, decorators: [{
770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DatetimeRangeComponent, decorators: [{
672
771
  type: Component,
673
772
  args: [{ selector: 'yuv-datetime-range', standalone: true, imports: [FormsModule, MatDatepickerModule, MatSelectModule, ReactiveFormsModule, DatetimeComponent], providers: [{ provide: MatFormFieldControl, useExisting: DatetimeRangeComponent }], template: "<form [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime()\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-datetime [withTime]=\"withTime()\" formControlName=\"dateValue\"></yuv-datetime>\n</form>\n", styles: [":host form{display:flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host form yuv-datetime{flex:1 1 auto}:host form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"] }]
674
773
  }], propDecorators: { withTimeInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "withTime", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], operator: [{ type: i0.Input, args: [{ isSignal: true, alias: "operator", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
675
774
 
676
- var _a;
677
- /**
678
- * Creates form input for number values.
679
- *
680
- * Implements `ControlValueAccessor` so it can be used within Angular forms.
681
- *
682
- * @example
683
- * <yuv-number [scale]="2"></yuv-number>
684
- *
685
- */
686
- class NumberComponent extends AbstractMatFormField {
775
+ class DynamicCatalogComponent extends AbstractMatFormField {
776
+ #catalogService;
777
+ #dRef;
778
+ #translate;
779
+ #currentLang;
780
+ #optionsResource;
687
781
  constructor() {
688
- super(...arguments);
782
+ super();
783
+ this.#catalogService = inject(CatalogService);
689
784
  this.#dRef = inject(DestroyRef);
690
- this.translate = inject(TranslateService);
691
- // innerValue: string | null = null;
692
- this.validationErrors = [];
693
- this.transformPipe = new LocaleNumberPipe(this.translate);
694
- this.innerCtrl = new FormControl(null);
695
- this.ngControl = injectNgControl(this);
696
- /**
697
- * Number of decimal places
698
- */
699
- this.scale = input(undefined, ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
700
- this.#scale = computed(() => Math.min(this.scale() || 0, 30), ...(ngDevMode ? [{ debugName: "#scale" }] : /* istanbul ignore next */ []));
701
- /**
702
- * Overall amount of digits allowed (including decimal places)
703
- */
704
- this.precision = input(undefined, ...(ngDevMode ? [{ debugName: "precision" }] : /* istanbul ignore next */ []));
705
- this.#precision = computed(() => Math.min(this.precision() || 100, 100), ...(ngDevMode ? [{ debugName: "#precision" }] : /* istanbul ignore next */ []));
706
- /**
707
- * Set to true to group number by pattern
708
- */
709
- this.grouping = input(false, ...(ngDevMode ? [{ debugName: "grouping" }] : /* istanbul ignore next */ []));
710
- this.#grouping = computed(() => this.grouping() ?? true, ...(ngDevMode ? [{ debugName: "#grouping" }] : /* istanbul ignore next */ []));
711
- /**
712
- * The pattern to group number value by
713
- */
714
- this.groupPattern = input(undefined, ...(ngDevMode ? [{ debugName: "groupPattern" }] : /* istanbul ignore next */ []));
715
- /**
716
- * Will prevent the input from being changed (default: false)
717
- */
785
+ this.#translate = inject(TranslateService);
786
+ this.catalog = input.required(...(ngDevMode ? [{ debugName: "catalog" }] : /* istanbul ignore next */ []));
718
787
  this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
788
+ this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
789
+ this.#currentLang = signal(this.#translate.getCurrentLang(), ...(ngDevMode ? [{ debugName: "#currentLang" }] : /* istanbul ignore next */ []));
790
+ this.#optionsResource = rxResource({
791
+ params: computed(() => ({ catalog: this.catalog(), locale: this.#currentLang() })),
792
+ stream: ({ params }) => this.#catalogService.getEntries(params.catalog, { locale: params.locale }).pipe(map((res) => res.entries.map((entry) => ({
793
+ value: entry.name,
794
+ label: this.#resolveLabel(entry, params.locale)
795
+ }))))
796
+ });
797
+ this.options = this.#optionsResource.value;
719
798
  /**
720
- * set minimum input value
721
- */
722
- this.minValue = input(undefined, ...(ngDevMode ? [{ debugName: "minValue" }] : /* istanbul ignore next */ []));
723
- /**
724
- * set maximum input value
725
- *
726
- */
727
- this.maxValue = input(undefined, ...(ngDevMode ? [{ debugName: "maxValue" }] : /* istanbul ignore next */ []));
728
- /**
729
- * classification property adds some semantics to the value of this component.
730
- * If you provide a value of `filesize` numbers typed into the control will be
731
- * handled like file sizes (calculates differnt units)
799
+ * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation
800
+ * validation of the form element will be turned off, so you are able to enter
801
+ * search terms that do not meet the elements validators.
732
802
  */
733
- this.classifications = input([], ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
734
- this.#classificationsEffect = effect(() => {
735
- const classifications = this.classifications();
736
- this.transformPipe =
737
- classifications && classifications.includes(Classification.NUMBER_FILESIZE) ? new FileSizePipe(this.translate) : new LocaleNumberPipe(this.translate);
738
- }, ...(ngDevMode ? [{ debugName: "#classificationsEffect" }] : /* istanbul ignore next */ []));
739
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
740
- this.propagateChange = (_) => { };
741
- }
742
- #dRef;
743
- #scale;
744
- #precision;
745
- #grouping;
746
- #classificationsEffect;
747
- static betweenTwoNumbers(val, minVal, maxVal) {
748
- const min = !Utils.isEmpty(minVal) ? minVal : -Infinity;
749
- const max = !Utils.isEmpty(maxVal) ? maxVal : Infinity;
750
- return val >= min && val <= max;
803
+ this.situation = input(...(ngDevMode ? [undefined, { debugName: "situation" }] : /* istanbul ignore next */ []));
804
+ this.ngControl = injectNgControl(this);
805
+ this.ctrl = new FormControl(undefined);
806
+ // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/explicit-module-boundary-types
807
+ this.propagateChange = (fnc) => { };
808
+ this.#translate.onLangChange.pipe(takeUntilDestroyed()).subscribe((evt) => this.#currentLang.set(evt.lang));
751
809
  }
752
810
  writeValue(value) {
753
- this.value = value != null ? value : null;
754
- const innerValue = value != null ? this.transformPipe.numberToString(value, this.#grouping(), this.groupPattern(), this.#scale()) : null;
755
- this.innerCtrl.setValue(innerValue, { emitEvent: false });
811
+ this.value = value;
812
+ this.ctrl.setValue(value, { emitEvent: false });
756
813
  }
757
- registerOnChange(fn) {
758
- this.propagateChange = fn;
814
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
815
+ registerOnChange(fnc) {
816
+ this.propagateChange = fnc;
759
817
  }
760
818
  // eslint-disable-next-line @typescript-eslint/no-empty-function
761
819
  registerOnTouched() { }
762
820
  setDisabledState(isDisabled) {
763
821
  if (isDisabled) {
764
- this.innerCtrl.disable();
822
+ this.ctrl.disable();
765
823
  }
766
824
  else {
767
- this.innerCtrl.enable();
825
+ this.ctrl.enable();
768
826
  }
769
827
  this.disabled = isDisabled;
770
828
  }
771
- // called when the input looses focus
772
- format() {
773
- if (!this.readonly() && typeof this.value === 'number' && this.validationErrors.length === 0) {
774
- this.innerCtrl.patchValue(this.transformPipe.numberToString(this.value, this.#grouping(), this.groupPattern(), this.#scale()), { emitEvent: false });
775
- }
776
- }
777
- // called when the input get focus
778
- unformat() {
779
- if (!this.readonly() && typeof this.value === 'number' && this.validationErrors.length === 0) {
780
- this.innerCtrl.patchValue(this.transformPipe.transform(this.value, false), {
781
- emitEvent: false
782
- });
783
- }
784
- }
785
- #getValidator() {
786
- return (control) => {
787
- this.validationErrors = [];
788
- if (Utils.isEmpty(control.value))
789
- return null;
790
- const val = this.transformPipe.stringToNumber(control.value);
791
- // general number validation
792
- if (isNaN(val) || typeof val !== 'number') {
793
- this.validationErrors.push({ key: 'number' });
794
- }
795
- else {
796
- const split = control.value.replaceAll(this.transformPipe.separator, '').split(this.transformPipe.decimalSeparator);
797
- // check precision
798
- if (this.#precision() !== undefined) {
799
- const prePointDigits = this.#precision() - this.#scale();
800
- if (split[0]?.length > prePointDigits) {
801
- this.validationErrors.push({ key: 'precision', params: { prePointDigits } });
802
- }
803
- }
804
- // check scale
805
- if (this.#scale() && split[1]?.length > this.#scale()) {
806
- this.validationErrors.push({ key: 'scale', params: { scale: this.#scale() } });
807
- }
808
- // min max
809
- if (!_a.betweenTwoNumbers(val, this.minValue(), this.maxValue())) {
810
- if (Utils.isEmpty(this.minValue())) {
811
- this.validationErrors.push({ key: 'maxvalue', params: { maxValue: this.maxValue() } });
812
- }
813
- else if (Utils.isEmpty(this.maxValue())) {
814
- this.validationErrors.push({ key: 'minvalue', params: { minValue: this.minValue() } });
815
- }
816
- else {
817
- this.validationErrors.push({ key: 'minmax', params: { minValue: this.minValue(), maxValue: this.maxValue() } });
818
- }
819
- }
820
- }
821
- const e = Utils.arrayToObject(this.validationErrors, 'key', (err) => ({ valid: false, ...err }));
822
- return this.validationErrors.length ? e : null;
823
- };
824
- }
825
829
  ngOnInit() {
826
- // set up validators once all inputs are set
827
- const validators = [this.#getValidator()];
828
830
  if (this.required)
829
- validators.push(Validators.required);
830
- this.innerCtrl.setValidators(validators);
831
- this.innerCtrl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
831
+ this.ctrl.setValidators(Validators.required);
832
+ this.ctrl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe(() => {
833
+ this.errorState = FormUtils.getErrorState(this.ctrl);
834
+ if (this.ngControl?.control) {
835
+ this.ngControl.control.setErrors(this.ctrl.errors);
836
+ }
837
+ });
838
+ this.ctrl.updateValueAndValidity();
839
+ this.ctrl.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((value) => this.#onValueChange(value));
840
+ }
841
+ ngOnDestroy() {
842
+ super.onNgOnDestroy();
843
+ }
844
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
845
+ #onValueChange(val) {
846
+ this.value = val;
847
+ this.propagateChange(this.value);
848
+ }
849
+ #resolveLabel(entry, locale) {
850
+ const locs = entry.localizations;
851
+ return locs.find((loc) => loc.locale === locale)?.label || locs[0]?.label || entry.name;
852
+ }
853
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DynamicCatalogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
854
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DynamicCatalogComponent, isStandalone: true, selector: "yuv-dynamic-catalog", inputs: { catalog: { classPropertyName: "catalog", publicName: "catalog", isSignal: true, isRequired: true, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: DynamicCatalogComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"ctrl\">\n @for (o of options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
855
+ }
856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DynamicCatalogComponent, decorators: [{
857
+ type: Component,
858
+ args: [{ selector: 'yuv-dynamic-catalog', imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: DynamicCatalogComponent }], template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"ctrl\">\n @for (o of options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n" }]
859
+ }], ctorParameters: () => [], propDecorators: { catalog: [{ type: i0.Input, args: [{ isSignal: true, alias: "catalog", required: true }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
860
+
861
+ /**
862
+ * Form element for selecting one or multiple i18n catalog values.
863
+ * Having a classification of `i18n:catalog[one, two, three]` configured on the metadata field
864
+ * will automatically populate the options from the catalog. The options will be translated
865
+ * using the catalogs static values adding a prefix, the property name an the value itself.
866
+ * E.g. for property name `status` and option value `open` the label key will be `catalog:status:open_label`.
867
+ */
868
+ class I18nCatalogComponent extends AbstractMatFormField {
869
+ #system;
870
+ #dRef;
871
+ #optionsEffect;
872
+ #classificationEffect;
873
+ constructor() {
874
+ super();
875
+ this.#system = inject(SystemService);
876
+ this.#dRef = inject(DestroyRef);
877
+ this.translate = inject(TranslateService);
878
+ this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
879
+ this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
880
+ this.propertyName = input(undefined, ...(ngDevMode ? [{ debugName: "propertyName" }] : /* istanbul ignore next */ []));
881
+ this._options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : /* istanbul ignore next */ []));
882
+ this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
883
+ this.#optionsEffect = effect(() => {
884
+ untracked(() => {
885
+ this.#setOptions(this.options());
886
+ });
887
+ }, ...(ngDevMode ? [{ debugName: "#optionsEffect" }] : /* istanbul ignore next */ []));
888
+ /**
889
+ * Additional semantics for the form element.
890
+ */
891
+ this.classifications = input([], ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
892
+ this.#classificationEffect = effect(() => {
893
+ const cls = this.classifications();
894
+ untracked(() => {
895
+ const ce = this.#system.getClassifications(cls).get(Classification.STRING_CATALOG_I18N);
896
+ if (ce && ce.options) {
897
+ this.#setOptions(ce.options);
898
+ }
899
+ });
900
+ }, ...(ngDevMode ? [{ debugName: "#classificationEffect" }] : /* istanbul ignore next */ []));
901
+ /**
902
+ * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.
903
+ */
904
+ this.situation = input(...(ngDevMode ? [undefined, { debugName: "situation" }] : /* istanbul ignore next */ []));
905
+ this.ngControl = injectNgControl(this);
906
+ this.fc = new FormControl(undefined);
907
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
908
+ this.propagateChange = (_) => { };
909
+ this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe(() => {
910
+ // re-apply options to trigger translation
911
+ this.#setOptions(this.options());
912
+ });
913
+ }
914
+ #onValueChange(val) {
915
+ this.value = val;
916
+ this.propagateChange(this.value);
917
+ }
918
+ #setOptions(options) {
919
+ this._options.set(options.map((o) => ({
920
+ label: this.#translateOption(o),
921
+ value: o
922
+ })));
923
+ }
924
+ #translateOption(option) {
925
+ // labelkey: 'catalog:status:open_label' for option 'open'
926
+ // This will be derived fom a prefix the property name if available and this option itself
927
+ return this.#system.getLocalizedLabel(`catalog:${this.propertyName() || ''}:${option}`) || option;
928
+ }
929
+ writeValue(value) {
930
+ this.value = value;
931
+ this.fc.setValue(value, { emitEvent: false });
932
+ }
933
+ registerOnChange(fn) {
934
+ this.propagateChange = fn;
935
+ }
936
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
937
+ registerOnTouched(fn) { }
938
+ setDisabledState(isDisabled) {
939
+ if (isDisabled) {
940
+ this.fc.disable();
941
+ }
942
+ else {
943
+ this.fc.enable();
944
+ }
945
+ this.disabled = isDisabled;
946
+ }
947
+ ngOnInit() {
948
+ if (this.required)
949
+ this.fc.setValidators(Validators.required);
950
+ this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
951
+ this.errorState = FormUtils.getErrorState(this.fc);
952
+ if (this.ngControl?.control) {
953
+ this.ngControl.control.setErrors(this.fc.errors);
954
+ }
955
+ });
956
+ this.fc.updateValueAndValidity();
957
+ this.fc.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => this.#onValueChange(v));
958
+ }
959
+ ngOnDestroy() {
960
+ super.onNgOnDestroy();
961
+ }
962
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: I18nCatalogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
963
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: I18nCatalogComponent, isStandalone: true, selector: "yuv-i18n-catalog", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, propertyName: { classPropertyName: "propertyName", publicName: "propertyName", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: I18nCatalogComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
964
+ }
965
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: I18nCatalogComponent, decorators: [{
966
+ type: Component,
967
+ args: [{ selector: 'yuv-i18n-catalog', imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: I18nCatalogComponent }], template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>" }]
968
+ }], ctorParameters: () => [], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], propertyName: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyName", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
969
+
970
+ var _a;
971
+ /**
972
+ * Creates form input for number values.
973
+ *
974
+ * Implements `ControlValueAccessor` so it can be used within Angular forms.
975
+ *
976
+ * @example
977
+ * <yuv-number [scale]="2"></yuv-number>
978
+ *
979
+ */
980
+ class NumberComponent extends AbstractMatFormField {
981
+ constructor() {
982
+ super(...arguments);
983
+ this.#dRef = inject(DestroyRef);
984
+ this.translate = inject(TranslateService);
985
+ // innerValue: string | null = null;
986
+ this.validationErrors = [];
987
+ this.transformPipe = new LocaleNumberPipe(this.translate);
988
+ this.innerCtrl = new FormControl(null);
989
+ this.ngControl = injectNgControl(this);
990
+ /**
991
+ * Number of decimal places
992
+ */
993
+ this.scale = input(undefined, ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
994
+ this.#scale = computed(() => Math.min(this.scale() || 0, 30), ...(ngDevMode ? [{ debugName: "#scale" }] : /* istanbul ignore next */ []));
995
+ /**
996
+ * Overall amount of digits allowed (including decimal places)
997
+ */
998
+ this.precision = input(undefined, ...(ngDevMode ? [{ debugName: "precision" }] : /* istanbul ignore next */ []));
999
+ this.#precision = computed(() => Math.min(this.precision() || 100, 100), ...(ngDevMode ? [{ debugName: "#precision" }] : /* istanbul ignore next */ []));
1000
+ /**
1001
+ * Set to true to group number by pattern
1002
+ */
1003
+ this.grouping = input(false, ...(ngDevMode ? [{ debugName: "grouping" }] : /* istanbul ignore next */ []));
1004
+ this.#grouping = computed(() => this.grouping() ?? true, ...(ngDevMode ? [{ debugName: "#grouping" }] : /* istanbul ignore next */ []));
1005
+ /**
1006
+ * The pattern to group number value by
1007
+ */
1008
+ this.groupPattern = input(undefined, ...(ngDevMode ? [{ debugName: "groupPattern" }] : /* istanbul ignore next */ []));
1009
+ /**
1010
+ * Will prevent the input from being changed (default: false)
1011
+ */
1012
+ this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
1013
+ /**
1014
+ * set minimum input value
1015
+ */
1016
+ this.minValue = input(undefined, ...(ngDevMode ? [{ debugName: "minValue" }] : /* istanbul ignore next */ []));
1017
+ /**
1018
+ * set maximum input value
1019
+ *
1020
+ */
1021
+ this.maxValue = input(undefined, ...(ngDevMode ? [{ debugName: "maxValue" }] : /* istanbul ignore next */ []));
1022
+ /**
1023
+ * classification property adds some semantics to the value of this component.
1024
+ * If you provide a value of `filesize` numbers typed into the control will be
1025
+ * handled like file sizes (calculates differnt units)
1026
+ */
1027
+ this.classifications = input([], ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
1028
+ this.#classificationsEffect = effect(() => {
1029
+ const classifications = this.classifications();
1030
+ this.transformPipe =
1031
+ classifications && classifications.includes(Classification.NUMBER_FILESIZE) ? new FileSizePipe(this.translate) : new LocaleNumberPipe(this.translate);
1032
+ }, ...(ngDevMode ? [{ debugName: "#classificationsEffect" }] : /* istanbul ignore next */ []));
1033
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
1034
+ this.propagateChange = (_) => { };
1035
+ }
1036
+ #dRef;
1037
+ #scale;
1038
+ #precision;
1039
+ #grouping;
1040
+ #classificationsEffect;
1041
+ static betweenTwoNumbers(val, minVal, maxVal) {
1042
+ const min = !Utils.isEmpty(minVal) ? minVal : -Infinity;
1043
+ const max = !Utils.isEmpty(maxVal) ? maxVal : Infinity;
1044
+ return val >= min && val <= max;
1045
+ }
1046
+ writeValue(value) {
1047
+ this.value = value != null ? value : null;
1048
+ const innerValue = value != null ? this.transformPipe.numberToString(value, this.#grouping(), this.groupPattern(), this.#scale()) : null;
1049
+ this.innerCtrl.setValue(innerValue, { emitEvent: false });
1050
+ }
1051
+ registerOnChange(fn) {
1052
+ this.propagateChange = fn;
1053
+ }
1054
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1055
+ registerOnTouched() { }
1056
+ setDisabledState(isDisabled) {
1057
+ if (isDisabled) {
1058
+ this.innerCtrl.disable();
1059
+ }
1060
+ else {
1061
+ this.innerCtrl.enable();
1062
+ }
1063
+ this.disabled = isDisabled;
1064
+ }
1065
+ // called when the input looses focus
1066
+ format() {
1067
+ if (!this.readonly() && typeof this.value === 'number' && this.validationErrors.length === 0) {
1068
+ this.innerCtrl.patchValue(this.transformPipe.numberToString(this.value, this.#grouping(), this.groupPattern(), this.#scale()), { emitEvent: false });
1069
+ }
1070
+ }
1071
+ // called when the input get focus
1072
+ unformat() {
1073
+ if (!this.readonly() && typeof this.value === 'number' && this.validationErrors.length === 0) {
1074
+ this.innerCtrl.patchValue(this.transformPipe.transform(this.value, false), {
1075
+ emitEvent: false
1076
+ });
1077
+ }
1078
+ }
1079
+ #getValidator() {
1080
+ return (control) => {
1081
+ this.validationErrors = [];
1082
+ if (Utils.isEmpty(control.value))
1083
+ return null;
1084
+ const val = this.transformPipe.stringToNumber(control.value);
1085
+ // general number validation
1086
+ if (isNaN(val) || typeof val !== 'number') {
1087
+ this.validationErrors.push({ key: 'number' });
1088
+ }
1089
+ else {
1090
+ const split = control.value.replaceAll(this.transformPipe.separator, '').split(this.transformPipe.decimalSeparator);
1091
+ // check precision
1092
+ if (this.#precision() !== undefined) {
1093
+ const prePointDigits = this.#precision() - this.#scale();
1094
+ if (split[0]?.length > prePointDigits) {
1095
+ this.validationErrors.push({ key: 'precision', params: { prePointDigits } });
1096
+ }
1097
+ }
1098
+ // check scale
1099
+ if (this.#scale() && split[1]?.length > this.#scale()) {
1100
+ this.validationErrors.push({ key: 'scale', params: { scale: this.#scale() } });
1101
+ }
1102
+ // min max
1103
+ if (!_a.betweenTwoNumbers(val, this.minValue(), this.maxValue())) {
1104
+ if (Utils.isEmpty(this.minValue())) {
1105
+ this.validationErrors.push({ key: 'maxvalue', params: { maxValue: this.maxValue() } });
1106
+ }
1107
+ else if (Utils.isEmpty(this.maxValue())) {
1108
+ this.validationErrors.push({ key: 'minvalue', params: { minValue: this.minValue() } });
1109
+ }
1110
+ else {
1111
+ this.validationErrors.push({ key: 'minmax', params: { minValue: this.minValue(), maxValue: this.maxValue() } });
1112
+ }
1113
+ }
1114
+ }
1115
+ const e = Utils.arrayToObject(this.validationErrors, 'key', (err) => ({ valid: false, ...err }));
1116
+ return this.validationErrors.length ? e : null;
1117
+ };
1118
+ }
1119
+ ngOnInit() {
1120
+ // set up validators once all inputs are set
1121
+ const validators = [this.#getValidator()];
1122
+ if (this.required)
1123
+ validators.push(Validators.required);
1124
+ this.innerCtrl.setValidators(validators);
1125
+ this.innerCtrl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
832
1126
  this.errorState = FormUtils.getErrorState(this.innerCtrl);
833
1127
  if (this.ngControl?.control) {
834
1128
  this.ngControl.control.setErrors(this.innerCtrl.errors);
@@ -853,11 +1147,11 @@ class NumberComponent extends AbstractMatFormField {
853
1147
  ngOnDestroy() {
854
1148
  super.onNgOnDestroy();
855
1149
  }
856
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
857
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: NumberComponent, isStandalone: true, selector: "yuv-number", inputs: { scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, grouping: { classPropertyName: "grouping", publicName: "grouping", isSignal: true, isRequired: false, transformFunction: null }, groupPattern: { classPropertyName: "groupPattern", publicName: "groupPattern", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: NumberComponent }], usesInheritance: true, ngImport: i0, template: '<input type="string" [formControl]="innerCtrl" (focus)="unformat()" (blur)="format()" [readonly]="readonly()" />', isInline: true, styles: [":host{display:flex}:host input{width:100%;border:0;outline:0;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
1150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: NumberComponent, isStandalone: true, selector: "yuv-number", inputs: { scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, grouping: { classPropertyName: "grouping", publicName: "grouping", isSignal: true, isRequired: false, transformFunction: null }, groupPattern: { classPropertyName: "groupPattern", publicName: "groupPattern", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: NumberComponent }], usesInheritance: true, ngImport: i0, template: '<input type="string" [formControl]="innerCtrl" (focus)="unformat()" (blur)="format()" [readonly]="readonly()" />', isInline: true, styles: [":host{display:flex}:host input{width:100%;border:0;outline:0;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
858
1152
  }
859
1153
  _a = NumberComponent;
860
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberComponent, decorators: [{
1154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NumberComponent, decorators: [{
861
1155
  type: Component,
862
1156
  args: [{ selector: 'yuv-number', standalone: true, imports: [ReactiveFormsModule], template: '<input type="string" [formControl]="innerCtrl" (focus)="unformat()" (blur)="format()" [readonly]="readonly()" />', providers: [{ provide: MatFormFieldControl, useExisting: NumberComponent }], styles: [":host{display:flex}:host input{width:100%;border:0;outline:0;background:transparent}\n"] }]
863
1157
  }], propDecorators: { scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], precision: [{ type: i0.Input, args: [{ isSignal: true, alias: "precision", required: false }] }], grouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "grouping", required: false }] }], groupPattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupPattern", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }] } });
@@ -997,74 +1291,230 @@ class NumberRangeComponent extends AbstractMatFormField {
997
1291
  secondValue: undefined
998
1292
  };
999
1293
  }
1000
- this.propagateChange(this.value);
1294
+ this.propagateChange(this.value);
1295
+ }
1296
+ #getValidator() {
1297
+ return (control) => {
1298
+ let err;
1299
+ const operator = control.get('operator')?.value;
1300
+ const firstValue = Number(control.get('numberValueFrom')?.value);
1301
+ const secondValue = Number(control.get('numberValue')?.value);
1302
+ const singleValueOperators = new Set([Operator.EQUAL]);
1303
+ const rangeOperators = new Set([Operator.INTERVAL_INCLUDE_BOTH]);
1304
+ if (this.situation() === Situation.SEARCH)
1305
+ return null;
1306
+ if (singleValueOperators.has(operator)) {
1307
+ return { number: { valid: false } };
1308
+ }
1309
+ else if (rangeOperators.has(operator)) {
1310
+ if (firstValue && secondValue) {
1311
+ // make sure that on ranges, the first value is earlier than the last
1312
+ this.isValid = firstValue < secondValue;
1313
+ if (this.isValid)
1314
+ return null;
1315
+ return { numberrangeorder: { valid: false } };
1316
+ }
1317
+ else {
1318
+ return { numberrange: { valid: false } };
1319
+ }
1320
+ }
1321
+ return null;
1322
+ };
1323
+ }
1324
+ // returns null when valid else the validation object
1325
+ validate() {
1326
+ let err;
1327
+ const operator = this.rangeForm.value.operator;
1328
+ if (operator === Operator.EQUAL) {
1329
+ err = { number: { valid: false } };
1330
+ }
1331
+ else if (operator === Operator.INTERVAL_INCLUDE_BOTH && this.value?.firstValue && this.value?.secondValue) {
1332
+ // make sure that on ranges, the first value is earlier than the last
1333
+ this.isValid = this.value.firstValue < this.value.secondValue;
1334
+ err = { numberrangeorder: { valid: false } };
1335
+ }
1336
+ else {
1337
+ err = { numberrange: { valid: false } };
1338
+ }
1339
+ return this.isValid ? null : err;
1340
+ }
1341
+ ngOnInit() {
1342
+ this.rangeForm.setValidators(this.#getValidator());
1343
+ this.rangeForm.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
1344
+ this.errorState = FormUtils.getErrorState(this.rangeForm);
1345
+ if (this.ngControl?.control) {
1346
+ this.ngControl.control.setErrors(this.rangeForm.errors);
1347
+ }
1348
+ });
1349
+ this.rangeForm.updateValueAndValidity();
1350
+ this.rangeForm.valueChanges.subscribe(() => this.#onValueChange());
1351
+ }
1352
+ ngOnDestroy() {
1353
+ super.onNgOnDestroy();
1354
+ }
1355
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NumberRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1356
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: NumberRangeComponent, isStandalone: true, selector: "yuv-number-range", inputs: { scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, grouping: { classPropertyName: "grouping", publicName: "grouping", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: NumberRangeComponent }], usesInheritance: true, ngImport: i0, template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-number\n class=\"first\"\n [readonly]=\"readonly()\"\n [scale]=\"scale()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValueFrom\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n ></yuv-number>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-number\n [scale]=\"scale()\"\n [readonly]=\"readonly()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValue\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n >\n </yuv-number>\n</form>\n", styles: [":host>form{display:inline-flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host>form yuv-number{flex:1 1 auto}:host>form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"], dependencies: [{ kind: "component", type: NumberComponent, selector: "yuv-number", inputs: ["scale", "precision", "grouping", "groupPattern", "readonly", "minValue", "maxValue", "classifications"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
1357
+ }
1358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NumberRangeComponent, decorators: [{
1359
+ type: Component,
1360
+ args: [{ selector: 'yuv-number-range', standalone: true, imports: [NumberComponent, MatSelectModule, FormsModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: NumberRangeComponent }], template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-number\n class=\"first\"\n [readonly]=\"readonly()\"\n [scale]=\"scale()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValueFrom\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n ></yuv-number>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-number\n [scale]=\"scale()\"\n [readonly]=\"readonly()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValue\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n >\n </yuv-number>\n</form>\n", styles: [":host>form{display:inline-flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host>form yuv-number{flex:1 1 auto}:host>form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"] }]
1361
+ }], propDecorators: { scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], precision: [{ type: i0.Input, args: [{ isSignal: true, alias: "precision", required: false }] }], grouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "grouping", required: false }] }], pattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "pattern", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
1362
+
1363
+ /**
1364
+ * Creates form input for organization set values. An organization set is
1365
+ * either a user or a role. This control will emit a stringified JSON object of
1366
+ * a OrganizationSetEntry object.
1367
+ *
1368
+ * ```json
1369
+ * {
1370
+ * "id:organization:set": [
1371
+ * "{\"id\":\"YUUVIS_AI_PREDICT\",\"title\":\"YUUVIS_AI_PREDICT\",\"type\":\"role\"}"
1372
+ * ]
1373
+ * }
1374
+ * ```
1375
+ */
1376
+ class OrganizationSetComponent extends AbstractMatFormField {
1377
+ constructor() {
1378
+ super(...arguments);
1379
+ this.#system = inject(SystemService);
1380
+ this.#idmService = inject(IdmService);
1381
+ this.#dRef = inject(DestroyRef);
1382
+ /**
1383
+ * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.
1384
+ */
1385
+ this.situation = input(undefined, ...(ngDevMode ? [{ debugName: "situation" }] : /* istanbul ignore next */ []));
1386
+ /**
1387
+ * Indicator that multiple strings could be inserted, they will be rendered as chips (default: false).
1388
+ */
1389
+ this.multiselect = input(false, ...(ngDevMode ? [{ debugName: "multiselect" }] : /* istanbul ignore next */ []));
1390
+ /**
1391
+ * Will prevent the input from being changed (default: false)
1392
+ */
1393
+ this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
1394
+ /**
1395
+ * Whether or not the emitted value should be an object containing id and title
1396
+ * or, if set to false only the ID
1397
+ */
1398
+ this.withMetadata = input(false, ...(ngDevMode ? [{ debugName: "withMetadata" }] : /* istanbul ignore next */ []));
1399
+ /**
1400
+ * Minimum length of the autocomplete input before a query is sent to the server.
1401
+ */
1402
+ this.autocompleteMinLength = input(2, ...(ngDevMode ? [{ debugName: "autocompleteMinLength" }] : /* istanbul ignore next */ []));
1403
+ this.classifications = input(undefined, ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
1404
+ this.types = input(undefined, ...(ngDevMode ? [{ debugName: "types" }] : /* istanbul ignore next */ []));
1405
+ this.#targetTypes = linkedSignal(() => {
1406
+ const c = this.classifications();
1407
+ const types = this.types();
1408
+ if (c?.length) {
1409
+ const classifications = this.#system.getClassifications(c);
1410
+ return classifications.has(Classification.STRING_ORGANIZATION_SET)
1411
+ ? classifications.get(Classification.STRING_ORGANIZATION_SET).options
1412
+ : [];
1413
+ }
1414
+ else if (types) {
1415
+ return types;
1416
+ }
1417
+ return [];
1418
+ }, ...(ngDevMode ? [{ debugName: "#targetTypes" }] : /* istanbul ignore next */ []));
1419
+ this.busy = signal(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
1420
+ this.acFormControl = new FormControl(undefined);
1421
+ this.ngControl = injectNgControl(this);
1422
+ this.innerValue = [];
1423
+ this.autocompleteRes = [];
1424
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1425
+ this.propagateChange = (_) => { };
1426
+ }
1427
+ #system;
1428
+ #idmService;
1429
+ #dRef;
1430
+ #targetTypes;
1431
+ writeValue(value) {
1432
+ const val = Array.isArray(value)
1433
+ ? value.map((v) => (typeof v === 'string' ? JSON.parse(v) : v))
1434
+ : value
1435
+ ? [JSON.parse(value)]
1436
+ : [];
1437
+ this.innerValue = val;
1438
+ this.value = val.map((v) => JSON.stringify(v));
1439
+ if (!this.multiselect) {
1440
+ this.value = this.value[0] || null;
1441
+ }
1442
+ }
1443
+ registerOnChange(fn) {
1444
+ this.propagateChange = fn;
1445
+ }
1446
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1447
+ registerOnTouched(fn) { }
1448
+ setDisabledState(isDisabled) {
1449
+ if (isDisabled) {
1450
+ this.acFormControl.disable();
1451
+ }
1452
+ else {
1453
+ this.acFormControl.enable();
1454
+ }
1455
+ this.disabled = isDisabled;
1001
1456
  }
1002
- #getValidator() {
1003
- return (control) => {
1004
- let err;
1005
- const operator = control.get('operator')?.value;
1006
- const firstValue = Number(control.get('numberValueFrom')?.value);
1007
- const secondValue = Number(control.get('numberValue')?.value);
1008
- const singleValueOperators = new Set([Operator.EQUAL]);
1009
- const rangeOperators = new Set([Operator.INTERVAL_INCLUDE_BOTH]);
1010
- if (this.situation() === Situation.SEARCH)
1011
- return null;
1012
- if (singleValueOperators.has(operator)) {
1013
- return { number: { valid: false } };
1014
- }
1015
- else if (rangeOperators.has(operator)) {
1016
- if (firstValue && secondValue) {
1017
- // make sure that on ranges, the first value is earlier than the last
1018
- this.isValid = firstValue < secondValue;
1019
- if (this.isValid)
1020
- return null;
1021
- return { numberrangeorder: { valid: false } };
1022
- }
1023
- else {
1024
- return { numberrange: { valid: false } };
1025
- }
1026
- }
1027
- return null;
1028
- };
1457
+ propagate() {
1458
+ this.value = this.#getPropagateValue();
1459
+ this.propagateChange(this.value);
1029
1460
  }
1030
- // returns null when valid else the validation object
1031
- validate() {
1032
- let err;
1033
- const operator = this.rangeForm.value.operator;
1034
- if (operator === Operator.EQUAL) {
1035
- err = { number: { valid: false } };
1461
+ #getPropagateValue() {
1462
+ if (this.multiselect()) {
1463
+ return this.innerValue.map((v) => JSON.stringify(v));
1036
1464
  }
1037
- else if (operator === Operator.INTERVAL_INCLUDE_BOTH && this.value?.firstValue && this.value?.secondValue) {
1038
- // make sure that on ranges, the first value is earlier than the last
1039
- this.isValid = this.value.firstValue < this.value.secondValue;
1040
- err = { numberrangeorder: { valid: false } };
1465
+ else if (this.innerValue.length) {
1466
+ return JSON.stringify(this.innerValue[0]);
1467
+ }
1468
+ else
1469
+ return undefined;
1470
+ }
1471
+ autocompleteFn(query) {
1472
+ if (query.length >= this.autocompleteMinLength()) {
1473
+ this.#idmService.queryOrganizationEntity(query, this.#targetTypes()).subscribe({
1474
+ next: (entries) => {
1475
+ this.autocompleteRes = entries
1476
+ .filter((e) => !this.innerValue?.some((value) => value.id === e.id))
1477
+ .map((o) => ({
1478
+ label: o.title,
1479
+ value: o
1480
+ }));
1481
+ },
1482
+ error: (e) => {
1483
+ this.autocompleteRes = [];
1484
+ }
1485
+ });
1041
1486
  }
1042
1487
  else {
1043
- err = { numberrange: { valid: false } };
1488
+ this.autocompleteRes = [];
1044
1489
  }
1045
- return this.isValid ? null : err;
1046
1490
  }
1047
1491
  ngOnInit() {
1048
- this.rangeForm.setValidators(this.#getValidator());
1049
- this.rangeForm.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
1050
- this.errorState = FormUtils.getErrorState(this.rangeForm);
1492
+ if (this.required)
1493
+ this.acFormControl.setValidators(Validators.required);
1494
+ this.acFormControl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
1495
+ this.errorState = FormUtils.getErrorState(this.acFormControl);
1051
1496
  if (this.ngControl?.control) {
1052
- this.ngControl.control.setErrors(this.rangeForm.errors);
1497
+ this.ngControl.control.setErrors(this.acFormControl.errors);
1053
1498
  }
1054
1499
  });
1055
- this.rangeForm.updateValueAndValidity();
1056
- this.rangeForm.valueChanges.subscribe(() => this.#onValueChange());
1500
+ this.acFormControl.updateValueAndValidity();
1501
+ this.acFormControl.valueChanges.subscribe((v) => {
1502
+ if (!Array.isArray(v))
1503
+ v = v ? [v] : [];
1504
+ this.innerValue = v.map((i) => i.value);
1505
+ this.propagate();
1506
+ });
1057
1507
  }
1058
1508
  ngOnDestroy() {
1059
1509
  super.onNgOnDestroy();
1060
1510
  }
1061
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1062
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: NumberRangeComponent, isStandalone: true, selector: "yuv-number-range", inputs: { scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, grouping: { classPropertyName: "grouping", publicName: "grouping", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: NumberRangeComponent }], usesInheritance: true, ngImport: i0, template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-number\n class=\"first\"\n [readonly]=\"readonly()\"\n [scale]=\"scale()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValueFrom\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n ></yuv-number>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-number\n [scale]=\"scale()\"\n [readonly]=\"readonly()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValue\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n >\n </yuv-number>\n</form>\n", styles: [":host>form{display:inline-flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host>form yuv-number{flex:1 1 auto}:host>form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"], dependencies: [{ kind: "component", type: NumberComponent, selector: "yuv-number", inputs: ["scale", "precision", "grouping", "groupPattern", "readonly", "minValue", "maxValue", "classifications"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
1511
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: OrganizationSetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1512
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: OrganizationSetComponent, isStandalone: true, selector: "yuv-organization-set", inputs: { situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, withMetadata: { classPropertyName: "withMetadata", publicName: "withMetadata", isSignal: true, isRequired: false, transformFunction: null }, autocompleteMinLength: { classPropertyName: "autocompleteMinLength", publicName: "autocompleteMinLength", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, types: { classPropertyName: "types", publicName: "types", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: OrganizationSetComponent }], usesInheritance: true, ngImport: i0, template: "<yuv-autocomplete\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n <span class=\"chip\">{{ item.value.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\">\n {{ item.value.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization-set.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: YuvAutocompleteModule }, { kind: "component", type: i2$2.AutocompleteComponent, selector: "yuv-autocomplete", inputs: ["ariaLabel", "busy", "multiple", "distinctValues", "addOnBlur", "minLength", "maxItems", "forceSelection", "autocompleteValues"], outputs: ["autocompleteFnc", "acBlur"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: TranslatePipe$1, name: "translate" }] }); }
1063
1513
  }
1064
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NumberRangeComponent, decorators: [{
1514
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: OrganizationSetComponent, decorators: [{
1065
1515
  type: Component,
1066
- args: [{ selector: 'yuv-number-range', standalone: true, imports: [NumberComponent, MatSelectModule, FormsModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: NumberRangeComponent }], template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if (rangeForm.value.operator === 'gtelte') {\n <yuv-number\n class=\"first\"\n [readonly]=\"readonly()\"\n [scale]=\"scale()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValueFrom\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n ></yuv-number>\n }\n\n <mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" formControlName=\"operator\" [disabled]=\"readonly()\">\n @for (o of availableSearchOptions; track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n </mat-select>\n\n <yuv-number\n [scale]=\"scale()\"\n [readonly]=\"readonly()\"\n [precision]=\"precision()\"\n [grouping]=\"grouping()\"\n [groupPattern]=\"pattern()\"\n formControlName=\"numberValue\"\n [classifications]=\"classifications()\"\n [minValue]=\"minValue()\"\n [maxValue]=\"maxValue()\"\n >\n </yuv-number>\n</form>\n", styles: [":host>form{display:inline-flex;flex-flow:row nowrap;align-items:center;gap:var(--ymt-spacing-s)}:host>form yuv-number{flex:1 1 auto}:host>form mat-select{padding:0;width:calc(2ch + 1em);border-radius:2px}\n"] }]
1067
- }], propDecorators: { scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], precision: [{ type: i0.Input, args: [{ isSignal: true, alias: "precision", required: false }] }], grouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "grouping", required: false }] }], pattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "pattern", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
1516
+ args: [{ selector: 'yuv-organization-set', imports: [FormsModule, YuvAutocompleteModule, MatTooltipModule, MatIconModule, ReactiveFormsModule, TranslatePipe$1], providers: [{ provide: MatFormFieldControl, useExisting: OrganizationSetComponent }], template: "<yuv-autocomplete\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n <span class=\"chip\">{{ item.value.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\">\n {{ item.value.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization-set.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"] }]
1517
+ }], propDecorators: { situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }], multiselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiselect", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], withMetadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "withMetadata", required: false }] }], autocompleteMinLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteMinLength", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], types: [{ type: i0.Input, args: [{ isSignal: true, alias: "types", required: false }] }] } });
1068
1518
 
1069
1519
  const mapOrganizationNode = (innerValue) => map$1((node) => node
1070
1520
  .filter((e) => !innerValue?.some((value) => value?.id === e.id))
@@ -1243,196 +1693,32 @@ class OrganizationComponent extends AbstractMatFormField {
1243
1693
  return this.#userService.queryUser(query, excludeMe, filterRoles).pipe(mapOrganizationNode(this.innerValue), catchError(() => of([])));
1244
1694
  }
1245
1695
  #resolveOrganizationSet(query, filterRoles) {
1246
- return this.#idmService.queryOrganizationEntity(query, filterRoles).pipe(mapOrganizationNode(this.innerValue), catchError(() => of([])));
1247
- }
1248
- #getMetadataString(value) {
1249
- try {
1250
- if (Array.isArray(value)) {
1251
- return value.map((v) => JSON.parse(v));
1252
- }
1253
- else {
1254
- return JSON.parse(value);
1255
- }
1256
- }
1257
- catch (e) {
1258
- return undefined;
1259
- }
1260
- }
1261
- autocompleteFn(query) {
1262
- if (query.length >= this.minLength) {
1263
- this.busy.set(true);
1264
- (this.#organizationType() === Classification.STRING_ORGANIZATION
1265
- ? this.#resolveOrganization(query, this.excludeMe(), this.#filterRoles())
1266
- : this.#resolveOrganizationSet(query, this.#filterRoles())).subscribe({
1267
- next: (res) => {
1268
- this.busy.set(false);
1269
- this.autocompleteRes = res;
1270
- },
1271
- error: () => this.busy.set(false)
1272
- });
1273
- }
1274
- else {
1275
- this.autocompleteRes = [];
1276
- }
1277
- }
1278
- ngOnInit() {
1279
- if (this.required)
1280
- this.acFormControl.setValidators(Validators.required);
1281
- this.acFormControl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
1282
- this.errorState = FormUtils.getErrorState(this.acFormControl);
1283
- if (this.ngControl?.control) {
1284
- this.ngControl.control.setErrors(this.acFormControl.errors);
1285
- }
1286
- });
1287
- this.acFormControl.updateValueAndValidity({ emitEvent: false });
1288
- this.acFormControl.valueChanges.subscribe((v) => {
1289
- if (!Array.isArray(v))
1290
- v = v ? [v] : [];
1291
- this.innerValue = v.map((i) => i.value);
1292
- this.propagate();
1293
- });
1294
- }
1295
- ngOnDestroy() {
1296
- super.onNgOnDestroy();
1297
- }
1298
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OrganizationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1299
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: OrganizationComponent, isStandalone: true, selector: "yuv-organization", inputs: { situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, excludeMe: { classPropertyName: "excludeMe", publicName: "excludeMe", isSignal: true, isRequired: false, transformFunction: null }, withMetadata: { classPropertyName: "withMetadata", publicName: "withMetadata", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: OrganizationComponent }], usesInheritance: true, ngImport: i0, template: "<yuv-autocomplete\n [required]=\"required\"\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n [distinctValues]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n @if (item.value) {\n <span class=\"chip\">{{ item.value.title }}</span>\n }\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n @if (item.value) {\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.title || '...' }}\n </span>\n }\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host .chip.notFound{color:var(--ymt-on-danger-container);text-decoration:line-through}:host .chip.notFound:before{content:\"!\";display:inline-block;background-color:var(--ymt-danger-container);color:#fff;border-radius:2px;padding-inline:.3em;text-decoration:none;margin-inline-end:.75em}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: YuvAutocompleteModule }, { kind: "component", type: i3$1.AutocompleteComponent, selector: "yuv-autocomplete", inputs: ["ariaLabel", "busy", "multiple", "distinctValues", "addOnBlur", "minLength", "maxItems", "forceSelection", "autocompleteValues"], outputs: ["autocompleteFnc", "acBlur"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1300
- }
1301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OrganizationComponent, decorators: [{
1302
- type: Component,
1303
- args: [{ selector: 'yuv-organization', standalone: true, imports: [
1304
- CommonModule,
1305
- FormsModule,
1306
- YuvAutocompleteModule,
1307
- MatTooltipModule,
1308
- MatIconModule,
1309
- ReactiveFormsModule,
1310
- TranslatePipe
1311
- ], providers: [{ provide: MatFormFieldControl, useExisting: OrganizationComponent }], template: "<yuv-autocomplete\n [required]=\"required\"\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n [distinctValues]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n @if (item.value) {\n <span class=\"chip\">{{ item.value.title }}</span>\n }\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n @if (item.value) {\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.title || '...' }}\n </span>\n }\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host .chip.notFound{color:var(--ymt-on-danger-container);text-decoration:line-through}:host .chip.notFound:before{content:\"!\";display:inline-block;background-color:var(--ymt-danger-container);color:#fff;border-radius:2px;padding-inline:.3em;text-decoration:none;margin-inline-end:.75em}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"] }]
1312
- }], propDecorators: { situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }], multiselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiselect", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], excludeMe: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludeMe", required: false }] }], withMetadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "withMetadata", required: false }] }] } });
1313
-
1314
- /**
1315
- * Creates form input for organization set values. An organization set is
1316
- * either a user or a role. This control will emit a stringified JSON object of
1317
- * a OrganizationSetEntry object.
1318
- *
1319
- * ```json
1320
- * {
1321
- * "id:organization:set": [
1322
- * "{\"id\":\"YUUVIS_AI_PREDICT\",\"title\":\"YUUVIS_AI_PREDICT\",\"type\":\"role\"}"
1323
- * ]
1324
- * }
1325
- * ```
1326
- */
1327
- class OrganizationSetComponent extends AbstractMatFormField {
1328
- constructor() {
1329
- super(...arguments);
1330
- this.#system = inject(SystemService);
1331
- this.#idmService = inject(IdmService);
1332
- this.#dRef = inject(DestroyRef);
1333
- /**
1334
- * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.
1335
- */
1336
- this.situation = input(undefined, ...(ngDevMode ? [{ debugName: "situation" }] : /* istanbul ignore next */ []));
1337
- /**
1338
- * Indicator that multiple strings could be inserted, they will be rendered as chips (default: false).
1339
- */
1340
- this.multiselect = input(false, ...(ngDevMode ? [{ debugName: "multiselect" }] : /* istanbul ignore next */ []));
1341
- /**
1342
- * Will prevent the input from being changed (default: false)
1343
- */
1344
- this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
1345
- /**
1346
- * Whether or not the emitted value should be an object containing id and title
1347
- * or, if set to false only the ID
1348
- */
1349
- this.withMetadata = input(false, ...(ngDevMode ? [{ debugName: "withMetadata" }] : /* istanbul ignore next */ []));
1350
- /**
1351
- * Minimum length of the autocomplete input before a query is sent to the server.
1352
- */
1353
- this.autocompleteMinLength = input(2, ...(ngDevMode ? [{ debugName: "autocompleteMinLength" }] : /* istanbul ignore next */ []));
1354
- this.classifications = input(undefined, ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
1355
- this.types = input(undefined, ...(ngDevMode ? [{ debugName: "types" }] : /* istanbul ignore next */ []));
1356
- this.#targetTypes = linkedSignal(() => {
1357
- const c = this.classifications();
1358
- const types = this.types();
1359
- if (c?.length) {
1360
- const classifications = this.#system.getClassifications(c);
1361
- return classifications.has(Classification.STRING_ORGANIZATION_SET)
1362
- ? classifications.get(Classification.STRING_ORGANIZATION_SET).options
1363
- : [];
1364
- }
1365
- else if (types) {
1366
- return types;
1367
- }
1368
- return [];
1369
- }, ...(ngDevMode ? [{ debugName: "#targetTypes" }] : /* istanbul ignore next */ []));
1370
- this.busy = signal(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
1371
- this.acFormControl = new FormControl(undefined);
1372
- this.ngControl = injectNgControl(this);
1373
- this.innerValue = [];
1374
- this.autocompleteRes = [];
1375
- // eslint-disable-next-line @typescript-eslint/no-empty-function
1376
- this.propagateChange = (_) => { };
1377
- }
1378
- #system;
1379
- #idmService;
1380
- #dRef;
1381
- #targetTypes;
1382
- writeValue(value) {
1383
- const val = Array.isArray(value)
1384
- ? value.map((v) => (typeof v === 'string' ? JSON.parse(v) : v))
1385
- : value
1386
- ? [JSON.parse(value)]
1387
- : [];
1388
- this.innerValue = val;
1389
- this.value = val.map((v) => JSON.stringify(v));
1390
- if (!this.multiselect) {
1391
- this.value = this.value[0] || null;
1392
- }
1393
- }
1394
- registerOnChange(fn) {
1395
- this.propagateChange = fn;
1396
- }
1397
- // eslint-disable-next-line @typescript-eslint/no-empty-function
1398
- registerOnTouched(fn) { }
1399
- setDisabledState(isDisabled) {
1400
- if (isDisabled) {
1401
- this.acFormControl.disable();
1402
- }
1403
- else {
1404
- this.acFormControl.enable();
1405
- }
1406
- this.disabled = isDisabled;
1407
- }
1408
- propagate() {
1409
- this.value = this.#getPropagateValue();
1410
- this.propagateChange(this.value);
1696
+ return this.#idmService.queryOrganizationEntity(query, filterRoles).pipe(mapOrganizationNode(this.innerValue), catchError(() => of([])));
1411
1697
  }
1412
- #getPropagateValue() {
1413
- if (this.multiselect()) {
1414
- return this.innerValue.map((v) => JSON.stringify(v));
1415
- }
1416
- else if (this.innerValue.length) {
1417
- return JSON.stringify(this.innerValue[0]);
1698
+ #getMetadataString(value) {
1699
+ try {
1700
+ if (Array.isArray(value)) {
1701
+ return value.map((v) => JSON.parse(v));
1702
+ }
1703
+ else {
1704
+ return JSON.parse(value);
1705
+ }
1418
1706
  }
1419
- else
1707
+ catch (e) {
1420
1708
  return undefined;
1709
+ }
1421
1710
  }
1422
1711
  autocompleteFn(query) {
1423
- if (query.length >= this.autocompleteMinLength()) {
1424
- this.#idmService.queryOrganizationEntity(query, this.#targetTypes()).subscribe({
1425
- next: (entries) => {
1426
- this.autocompleteRes = entries
1427
- .filter((e) => !this.innerValue?.some((value) => value.id === e.id))
1428
- .map((o) => ({
1429
- label: o.title,
1430
- value: o
1431
- }));
1712
+ if (query.length >= this.minLength) {
1713
+ this.busy.set(true);
1714
+ (this.#organizationType() === Classification.STRING_ORGANIZATION
1715
+ ? this.#resolveOrganization(query, this.excludeMe(), this.#filterRoles())
1716
+ : this.#resolveOrganizationSet(query, this.#filterRoles())).subscribe({
1717
+ next: (res) => {
1718
+ this.busy.set(false);
1719
+ this.autocompleteRes = res;
1432
1720
  },
1433
- error: (e) => {
1434
- this.autocompleteRes = [];
1435
- }
1721
+ error: () => this.busy.set(false)
1436
1722
  });
1437
1723
  }
1438
1724
  else {
@@ -1448,7 +1734,7 @@ class OrganizationSetComponent extends AbstractMatFormField {
1448
1734
  this.ngControl.control.setErrors(this.acFormControl.errors);
1449
1735
  }
1450
1736
  });
1451
- this.acFormControl.updateValueAndValidity();
1737
+ this.acFormControl.updateValueAndValidity({ emitEvent: false });
1452
1738
  this.acFormControl.valueChanges.subscribe((v) => {
1453
1739
  if (!Array.isArray(v))
1454
1740
  v = v ? [v] : [];
@@ -1459,13 +1745,21 @@ class OrganizationSetComponent extends AbstractMatFormField {
1459
1745
  ngOnDestroy() {
1460
1746
  super.onNgOnDestroy();
1461
1747
  }
1462
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OrganizationSetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1463
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: OrganizationSetComponent, isStandalone: true, selector: "yuv-organization-set", inputs: { situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, withMetadata: { classPropertyName: "withMetadata", publicName: "withMetadata", isSignal: true, isRequired: false, transformFunction: null }, autocompleteMinLength: { classPropertyName: "autocompleteMinLength", publicName: "autocompleteMinLength", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, types: { classPropertyName: "types", publicName: "types", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: OrganizationSetComponent }], usesInheritance: true, ngImport: i0, template: "<yuv-autocomplete\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n <span class=\"chip\">{{ item.value.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\">\n {{ item.value.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization-set.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: YuvAutocompleteModule }, { kind: "component", type: i3$1.AutocompleteComponent, selector: "yuv-autocomplete", inputs: ["ariaLabel", "busy", "multiple", "distinctValues", "addOnBlur", "minLength", "maxItems", "forceSelection", "autocompleteValues"], outputs: ["autocompleteFnc", "acBlur"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: TranslatePipe$1, name: "translate" }] }); }
1748
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: OrganizationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1749
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: OrganizationComponent, isStandalone: true, selector: "yuv-organization", inputs: { situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, excludeMe: { classPropertyName: "excludeMe", publicName: "excludeMe", isSignal: true, isRequired: false, transformFunction: null }, withMetadata: { classPropertyName: "withMetadata", publicName: "withMetadata", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: OrganizationComponent }], usesInheritance: true, ngImport: i0, template: "<yuv-autocomplete\n [required]=\"required\"\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n [distinctValues]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n @if (item.value) {\n <span class=\"chip\">{{ item.value.title }}</span>\n }\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n @if (item.value) {\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.title || '...' }}\n </span>\n }\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host .chip.notFound{color:var(--ymt-on-danger-container);text-decoration:line-through}:host .chip.notFound:before{content:\"!\";display:inline-block;background-color:var(--ymt-danger-container);color:#fff;border-radius:2px;padding-inline:.3em;text-decoration:none;margin-inline-end:.75em}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: YuvAutocompleteModule }, { kind: "component", type: i2$2.AutocompleteComponent, selector: "yuv-autocomplete", inputs: ["ariaLabel", "busy", "multiple", "distinctValues", "addOnBlur", "minLength", "maxItems", "forceSelection", "autocompleteValues"], outputs: ["autocompleteFnc", "acBlur"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1464
1750
  }
1465
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OrganizationSetComponent, decorators: [{
1751
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: OrganizationComponent, decorators: [{
1466
1752
  type: Component,
1467
- args: [{ selector: 'yuv-organization-set', imports: [FormsModule, YuvAutocompleteModule, MatTooltipModule, MatIconModule, ReactiveFormsModule, TranslatePipe$1], providers: [{ provide: MatFormFieldControl, useExisting: OrganizationSetComponent }], template: "<yuv-autocomplete\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n <span class=\"chip\">{{ item.value.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\">\n {{ item.value.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization-set.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"] }]
1468
- }], propDecorators: { situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }], multiselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiselect", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], withMetadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "withMetadata", required: false }] }], autocompleteMinLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteMinLength", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], types: [{ type: i0.Input, args: [{ isSignal: true, alias: "types", required: false }] }] } });
1753
+ args: [{ selector: 'yuv-organization', standalone: true, imports: [
1754
+ CommonModule,
1755
+ FormsModule,
1756
+ YuvAutocompleteModule,
1757
+ MatTooltipModule,
1758
+ MatIconModule,
1759
+ ReactiveFormsModule,
1760
+ TranslatePipe
1761
+ ], providers: [{ provide: MatFormFieldControl, useExisting: OrganizationComponent }], template: "<yuv-autocomplete\n [required]=\"required\"\n [busy]=\"busy()\"\n [formControl]=\"acFormControl\"\n #autocomplete\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly()\"\n [autocompleteValues]=\"autocompleteRes\"\n [forceSelection]=\"true\"\n [distinctValues]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n [maxItems]=\"multiselect() ? -1 : 1\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #optionTemplate let-item>\n @if (item.value) {\n <span class=\"chip\">{{ item.value.title }}</span>\n }\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n @if (item.value) {\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.title || '...' }}\n </span>\n }\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon class=\"ymt-icon--size-s\" [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">\n {{ multiselect() ? 'group' : 'person' }}\n</mat-icon>\n", styles: [":host{display:flex;align-items:center}:host .chip.notFound{color:var(--ymt-on-danger-container);text-decoration:line-through}:host .chip.notFound:before{content:\"!\";display:inline-block;background-color:var(--ymt-danger-container);color:#fff;border-radius:2px;padding-inline:.3em;text-decoration:none;margin-inline-end:.75em}:host yuv-autocomplete{flex:1}:host mat-icon{color:var(--ymt-text-color-subtle)}\n"] }]
1762
+ }], propDecorators: { situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }], multiselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiselect", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], excludeMe: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludeMe", required: false }] }], withMetadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "withMetadata", required: false }] }] } });
1469
1763
 
1470
1764
  class DateRangePickerComponent {
1471
1765
  constructor() {
@@ -1494,25 +1788,25 @@ class DateRangePickerComponent {
1494
1788
  this.rangeChange.emit(this.form.value.range || undefined);
1495
1789
  this.#dialogRef.close(this.form.value.range);
1496
1790
  }
1497
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1498
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: DateRangePickerComponent, isStandalone: true, selector: "yuv-date-range-picker", inputs: { range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rangeChange: "rangeChange" }, ngImport: i0, template: "<yuv-dialog [headertitel]=\"'yuv.form.element.range-select-date.custom.overlay.title' | translate\">\n <main>\n <form id=\"date-range-picker-form\" [formGroup]=\"form\" (ngSubmit)=\"apply()\">\n <yuv-datetime-range [withTime]=\"false\" formControlName=\"range\"></yuv-datetime-range>\n </form>\n </main>\n <footer>\n <button form=\"date-range-picker-form\" ymtButton=\"primary\" [disabled]=\"form.invalid\">\n {{ 'yuv.form.element.range-select-date.custom.overlay.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host form{display:grid;grid-template-columns:1fr auto;grid-template-rows:repeat(3,auto);grid-template-areas:\"title title\" \"input input\" \". button\";gap:var(--ymt-spacing-m);padding:var(--ymt-spacing-m)}:host form h2{grid-area:title;margin:0}:host form yuv-datetime-range{grid-area:input;border:1px solid var(--ymt-text-color-subtle);padding:1px 2px;border-radius:2px}:host form button{grid-area:button}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimeRangeComponent, selector: "yuv-datetime-range", inputs: ["withTime", "readonly", "operator", "situation"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1791
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1792
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: DateRangePickerComponent, isStandalone: true, selector: "yuv-date-range-picker", inputs: { range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rangeChange: "rangeChange" }, ngImport: i0, template: "<yuv-dialog [headertitel]=\"'yuv.form.element.range-select-date.custom.overlay.title' | translate\">\n <main>\n <form id=\"date-range-picker-form\" [formGroup]=\"form\" (ngSubmit)=\"apply()\">\n <yuv-datetime-range [withTime]=\"false\" formControlName=\"range\"></yuv-datetime-range>\n </form>\n </main>\n <footer>\n <button form=\"date-range-picker-form\" ymtButton=\"primary\" [disabled]=\"form.invalid\">\n {{ 'yuv.form.element.range-select-date.custom.overlay.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host form{display:grid;grid-template-columns:1fr auto;grid-template-rows:repeat(3,auto);grid-template-areas:\"title title\" \"input input\" \". button\";gap:var(--ymt-spacing-m);padding:var(--ymt-spacing-m)}:host form h2{grid-area:title;margin:0}:host form yuv-datetime-range{grid-area:input;border:1px solid var(--ymt-text-color-subtle);padding:1px 2px;border-radius:2px}:host form button{grid-area:button}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimeRangeComponent, selector: "yuv-datetime-range", inputs: ["withTime", "readonly", "operator", "situation"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1499
1793
  }
1500
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateRangePickerComponent, decorators: [{
1794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DateRangePickerComponent, decorators: [{
1501
1795
  type: Component,
1502
1796
  args: [{ selector: 'yuv-date-range-picker', standalone: true, imports: [ReactiveFormsModule, TranslatePipe, DatetimeRangeComponent, YmtButtonDirective, DialogComponent], template: "<yuv-dialog [headertitel]=\"'yuv.form.element.range-select-date.custom.overlay.title' | translate\">\n <main>\n <form id=\"date-range-picker-form\" [formGroup]=\"form\" (ngSubmit)=\"apply()\">\n <yuv-datetime-range [withTime]=\"false\" formControlName=\"range\"></yuv-datetime-range>\n </form>\n </main>\n <footer>\n <button form=\"date-range-picker-form\" ymtButton=\"primary\" [disabled]=\"form.invalid\">\n {{ 'yuv.form.element.range-select-date.custom.overlay.button.apply' | translate }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host form{display:grid;grid-template-columns:1fr auto;grid-template-rows:repeat(3,auto);grid-template-areas:\"title title\" \"input input\" \". button\";gap:var(--ymt-spacing-m);padding:var(--ymt-spacing-m)}:host form h2{grid-area:title;margin:0}:host form yuv-datetime-range{grid-area:input;border:1px solid var(--ymt-text-color-subtle);padding:1px 2px;border-radius:2px}:host form button{grid-area:button}\n"] }]
1503
1797
  }], propDecorators: { range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], rangeChange: [{ type: i0.Output, args: ["rangeChange"] }] } });
1504
1798
 
1505
1799
  // marker for extracting translations for the available date range options
1506
- marker('yuv.form.element.range-select-date.option.any');
1507
- marker('yuv.form.element.range-select-date.option.today');
1508
- marker('yuv.form.element.range-select-date.option.yesterday');
1509
- marker('yuv.form.element.range-select-date.option.thisWeek');
1510
- marker('yuv.form.element.range-select-date.option.lastWeek');
1511
- marker('yuv.form.element.range-select-date.option.thisMonth');
1512
- marker('yuv.form.element.range-select-date.option.lastMonth');
1513
- marker('yuv.form.element.range-select-date.option.thisYear');
1514
- marker('yuv.form.element.range-select-date.option.lastYear');
1515
- marker('yuv.form.element.range-select-date.option.custom');
1800
+ _('yuv.form.element.range-select-date.option.any');
1801
+ _('yuv.form.element.range-select-date.option.today');
1802
+ _('yuv.form.element.range-select-date.option.yesterday');
1803
+ _('yuv.form.element.range-select-date.option.thisWeek');
1804
+ _('yuv.form.element.range-select-date.option.lastWeek');
1805
+ _('yuv.form.element.range-select-date.option.thisMonth');
1806
+ _('yuv.form.element.range-select-date.option.lastMonth');
1807
+ _('yuv.form.element.range-select-date.option.thisYear');
1808
+ _('yuv.form.element.range-select-date.option.lastYear');
1809
+ _('yuv.form.element.range-select-date.option.custom');
1516
1810
  /**
1517
1811
  * Component for selecting a date range based on pre-defined ranges like
1518
1812
  * 'today', 'this week', 'this month', etc.
@@ -1665,20 +1959,20 @@ class RangeSelectDateComponent extends AbstractMatFormField {
1665
1959
  ngOnDestroy() {
1666
1960
  super.onNgOnDestroy();
1667
1961
  }
1668
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RangeSelectDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1669
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: RangeSelectDateComponent, isStandalone: true, selector: "yuv-range-select-date", inputs: { ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null }, customRange: { classPropertyName: "customRange", publicName: "customRange", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: RangeSelectDateComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [formControl]=\"fc\" [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\">\n @for (o of options(); track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [":host{display:flex}:host mat-select{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
1962
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RangeSelectDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1963
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: RangeSelectDateComponent, isStandalone: true, selector: "yuv-range-select-date", inputs: { ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null }, customRange: { classPropertyName: "customRange", publicName: "customRange", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: RangeSelectDateComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [formControl]=\"fc\" [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\">\n @for (o of options(); track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [":host{display:flex}:host mat-select{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
1670
1964
  }
1671
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RangeSelectDateComponent, decorators: [{
1965
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RangeSelectDateComponent, decorators: [{
1672
1966
  type: Component,
1673
1967
  args: [{ selector: 'yuv-range-select-date', standalone: true, imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: RangeSelectDateComponent }], template: "<mat-select [formControl]=\"fc\" [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\">\n @for (o of options(); track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [":host{display:flex}:host mat-select{flex:1}\n"] }]
1674
1968
  }], ctorParameters: () => [], propDecorators: { ranges: [{ type: i0.Input, args: [{ isSignal: true, alias: "ranges", required: false }] }], customRange: [{ type: i0.Input, args: [{ isSignal: true, alias: "customRange", required: false }] }] } });
1675
1969
 
1676
1970
  // marker for extracting translations for the available filesize range options
1677
- marker('yuv.form.element.range-select-filesize.option.any');
1678
- marker('yuv.form.element.range-select-filesize.option.small');
1679
- marker('yuv.form.element.range-select-filesize.option.medium');
1680
- marker('yuv.form.element.range-select-filesize.option.large');
1681
- marker('yuv.form.element.range-select-filesize.option.verylarge');
1971
+ _('yuv.form.element.range-select-filesize.option.any');
1972
+ _('yuv.form.element.range-select-filesize.option.small');
1973
+ _('yuv.form.element.range-select-filesize.option.medium');
1974
+ _('yuv.form.element.range-select-filesize.option.large');
1975
+ _('yuv.form.element.range-select-filesize.option.verylarge');
1682
1976
  /**
1683
1977
  * Component for selecting a range of filesizes based on pre-defined ranges like
1684
1978
  * 'today', 'this week', 'this month', etc.
@@ -1748,10 +2042,10 @@ class RangeSelectFilesizeComponent extends AbstractMatFormField {
1748
2042
  ngOnDestroy() {
1749
2043
  super.onNgOnDestroy();
1750
2044
  }
1751
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RangeSelectFilesizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1752
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: RangeSelectFilesizeComponent, isStandalone: true, selector: "yuv-range-select-filesize", inputs: { ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: RangeSelectFilesizeComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" [formControl]=\"fc\">\n @for (o of options(); track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [":host{display:flex}:host mat-select{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
2045
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RangeSelectFilesizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2046
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: RangeSelectFilesizeComponent, isStandalone: true, selector: "yuv-range-select-filesize", inputs: { ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: RangeSelectFilesizeComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" [formControl]=\"fc\">\n @for (o of options(); track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [":host{display:flex}:host mat-select{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
1753
2047
  }
1754
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RangeSelectFilesizeComponent, decorators: [{
2048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RangeSelectFilesizeComponent, decorators: [{
1755
2049
  type: Component,
1756
2050
  args: [{ selector: 'yuv-range-select-filesize', standalone: true, imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: RangeSelectFilesizeComponent }], template: "<mat-select [panelWidth]=\"null\" [hideSingleSelectionIndicator]=\"true\" [formControl]=\"fc\">\n @for (o of options(); track $index) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [":host{display:flex}:host mat-select{flex:1}\n"] }]
1757
2051
  }], ctorParameters: () => [], propDecorators: { ranges: [{ type: i0.Input, args: [{ isSignal: true, alias: "ranges", required: false }] }] } });
@@ -2031,10 +2325,10 @@ class StringComponent extends AbstractMatFormField {
2031
2325
  ngOnDestroy() {
2032
2326
  super.onNgOnDestroy();
2033
2327
  }
2034
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StringComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2035
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: StringComponent, isStandalone: true, selector: "yuv-string", inputs: { multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: false, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, regex: { classPropertyName: "regex", publicName: "regex", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.readonly": "readonly()" } }, providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], usesInheritance: true, ngImport: i0, template: "@if ((!rows || rows <= 1) && !multiselect()) {\n <input matInput type=\"text\" (blur)=\"onBlur()\" [readonly]=\"readonly()\" [formControl]=\"fc\" />\n} @else if ((!rows || rows <= 1) && multiselect()) {\n <!-- single line input with multiselect-->\n <yuv-scroll-buttons>\n <mat-chip-grid #chipGrid [formControl]=\"fc\">\n @for (v of value; track v) {\n <mat-chip-row (removed)=\"chipsRemove(v)\" [editable]=\"true\" (edited)=\"chipsEdit(v, $event)\">\n {{ v }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n [matChipInputFor]=\"chipGrid\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"chipsAdd($event)\"\n />\n </mat-chip-grid>\n </yuv-scroll-buttons>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea matInput class=\"input-textarea\" (blur)=\"onBlur()\" [rows]=\"rows\" [readonly]=\"readonly()\" [formControl]=\"fc\"></textarea>\n}\n\n@if (classify) {\n <div class=\"classify\">\n @if (value && !validationErrors.length && (classify.hrefPrefix !== '' || !multiselect() || value.length <= 1)) {\n <a href=\"{{ classify.hrefPrefix + formatedValue }}\">\n <mat-icon>{{ classify.icon }}</mat-icon>\n </a>\n } @else {\n <mat-icon>{{ classify.icon }}</mat-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;flex:1;align-items:center}:host:has(mat-chip-grid){min-width:0}:host mat-chip-grid{flex:1}:host textarea.input-textarea{width:100%;resize:none;background-color:transparent;border:0;outline:0}:host input{display:flex;flex-wrap:wrap;align-items:center;width:100%;border:0;outline:0;background:transparent}:host.readonly .classify{pointer-events:all}:host .classify a{color:var(--ymt-text-color-subtle);text-decoration:none}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1$4.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1$4.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1$4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1$4.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: ScrollButtonsComponent, selector: "yuv-scroll-buttons", inputs: ["scrollAmount"] }] }); }
2328
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: StringComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2329
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: StringComponent, isStandalone: true, selector: "yuv-string", inputs: { multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: false, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null }, regex: { classPropertyName: "regex", publicName: "regex", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.readonly": "readonly()" } }, providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], usesInheritance: true, ngImport: i0, template: "@if ((!rows || rows <= 1) && !multiselect()) {\n <input matInput type=\"text\" (blur)=\"onBlur()\" [readonly]=\"readonly()\" [formControl]=\"fc\" />\n} @else if ((!rows || rows <= 1) && multiselect()) {\n <!-- single line input with multiselect-->\n <yuv-scroll-buttons>\n <mat-chip-grid #chipGrid [formControl]=\"fc\">\n @for (v of value; track v) {\n <mat-chip-row (removed)=\"chipsRemove(v)\" [editable]=\"true\" (edited)=\"chipsEdit(v, $event)\">\n {{ v }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n [matChipInputFor]=\"chipGrid\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"chipsAdd($event)\"\n />\n </mat-chip-grid>\n </yuv-scroll-buttons>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea matInput class=\"input-textarea\" (blur)=\"onBlur()\" [rows]=\"rows\" [readonly]=\"readonly()\" [formControl]=\"fc\"></textarea>\n}\n\n@if (classify) {\n <div class=\"classify\">\n @if (value && !validationErrors.length && (classify.hrefPrefix !== '' || !multiselect() || value.length <= 1)) {\n <a href=\"{{ classify.hrefPrefix + formatedValue }}\">\n <mat-icon>{{ classify.icon }}</mat-icon>\n </a>\n } @else {\n <mat-icon>{{ classify.icon }}</mat-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;flex:1;align-items:center}:host:has(mat-chip-grid){min-width:0}:host mat-chip-grid{flex:1}:host textarea.input-textarea{width:100%;resize:none;background-color:transparent;border:0;outline:0}:host input{display:flex;flex-wrap:wrap;align-items:center;width:100%;border:0;outline:0;background:transparent}:host.readonly .classify{pointer-events:all}:host .classify a{color:var(--ymt-text-color-subtle);text-decoration:none}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1$4.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1$4.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1$4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1$4.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: ScrollButtonsComponent, selector: "yuv-scroll-buttons", inputs: ["scrollAmount"] }] }); }
2036
2330
  }
2037
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StringComponent, decorators: [{
2331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: StringComponent, decorators: [{
2038
2332
  type: Component,
2039
2333
  args: [{ selector: 'yuv-string', standalone: true, imports: [MatChipsModule, MatIconModule, ReactiveFormsModule, FormsModule, ScrollButtonsComponent], providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], host: {
2040
2334
  '[class.readonly]': 'readonly()'
@@ -2045,215 +2339,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
2045
2339
  type: Input
2046
2340
  }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }], regex: [{ type: i0.Input, args: [{ isSignal: true, alias: "regex", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }] } });
2047
2341
 
2048
- class CatalogComponent extends AbstractMatFormField {
2049
- constructor() {
2050
- super(...arguments);
2051
- this.#system = inject(SystemService);
2052
- this.#dRef = inject(DestroyRef);
2053
- this.translate = inject(TranslateService);
2054
- this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
2055
- this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
2056
- this._options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : /* istanbul ignore next */ []));
2057
- this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
2058
- this.#optionsEffect = effect(() => {
2059
- untracked(() => {
2060
- this.#setOptions(this.options() || [], false);
2061
- });
2062
- }, ...(ngDevMode ? [{ debugName: "#optionsEffect" }] : /* istanbul ignore next */ []));
2063
- /**
2064
- * Additional semantics for the form element.
2065
- */
2066
- this.classifications = input([], ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
2067
- this.#classificationEffect = effect(() => {
2068
- const cls = this.classifications();
2069
- untracked(() => {
2070
- const ce = this.#system.getClassifications(cls).get(Classification.STRING_CATALOG);
2071
- if (ce && ce.options) {
2072
- this.#setOptions(ce.options, false);
2073
- }
2074
- });
2075
- }, ...(ngDevMode ? [{ debugName: "#classificationEffect" }] : /* istanbul ignore next */ []));
2076
- /**
2077
- * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.
2078
- */
2079
- this.situation = input(...(ngDevMode ? [undefined, { debugName: "situation" }] : /* istanbul ignore next */ []));
2080
- this.ngControl = injectNgControl(this);
2081
- this.fc = new FormControl(undefined);
2082
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2083
- this.propagateChange = (_) => { };
2084
- }
2085
- #system;
2086
- #dRef;
2087
- #optionsEffect;
2088
- #classificationEffect;
2089
- #onValueChange(val) {
2090
- this.value = val;
2091
- this.propagateChange(this.value);
2092
- }
2093
- #setOptions(options, translate) {
2094
- if (translate) {
2095
- this._options.set(options.map((o) => ({
2096
- label: this.translate.instant(o),
2097
- value: o
2098
- })));
2099
- }
2100
- else {
2101
- this._options.set(options.map((o) => ({
2102
- label: o,
2103
- value: o
2104
- })));
2105
- }
2106
- }
2107
- writeValue(value) {
2108
- this.value = value;
2109
- this.fc.setValue(value, { emitEvent: false });
2110
- }
2111
- registerOnChange(fn) {
2112
- this.propagateChange = fn;
2113
- }
2114
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2115
- registerOnTouched(fn) { }
2116
- setDisabledState(isDisabled) {
2117
- if (isDisabled) {
2118
- this.fc.disable();
2119
- }
2120
- else {
2121
- this.fc.enable();
2122
- }
2123
- this.disabled = isDisabled;
2124
- }
2125
- ngOnInit() {
2126
- if (this.required)
2127
- this.fc.setValidators(Validators.required);
2128
- this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
2129
- this.errorState = FormUtils.getErrorState(this.fc);
2130
- if (this.ngControl?.control) {
2131
- this.ngControl.control.setErrors(this.fc.errors);
2132
- }
2133
- });
2134
- this.fc.updateValueAndValidity();
2135
- this.fc.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => this.#onValueChange(v));
2136
- }
2137
- ngOnDestroy() {
2138
- super.onNgOnDestroy();
2139
- }
2140
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CatalogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2141
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: CatalogComponent, isStandalone: true, selector: "yuv-catalog", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: CatalogComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
2142
- }
2143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
2144
- type: Component,
2145
- args: [{ selector: 'yuv-catalog', imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: CatalogComponent }], template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>\n" }]
2146
- }], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
2147
-
2148
- /**
2149
- * Form element for selecting one or multiple i18n catalog values.
2150
- * Having a classification of `i18n:catalog[one, two, three]` configured on the metadata field
2151
- * will automatically populate the options from the catalog. The options will be translated
2152
- * using the catalogs static values adding a prefix, the property name an the value itself.
2153
- * E.g. for property name `status` and option value `open` the label key will be `catalog:status:open_label`.
2154
- */
2155
- class I18nCatalogComponent extends AbstractMatFormField {
2156
- #system;
2157
- #dRef;
2158
- #optionsEffect;
2159
- #classificationEffect;
2160
- constructor() {
2161
- super();
2162
- this.#system = inject(SystemService);
2163
- this.#dRef = inject(DestroyRef);
2164
- this.translate = inject(TranslateService);
2165
- this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
2166
- this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
2167
- this.propertyName = input(undefined, ...(ngDevMode ? [{ debugName: "propertyName" }] : /* istanbul ignore next */ []));
2168
- this._options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : /* istanbul ignore next */ []));
2169
- this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
2170
- this.#optionsEffect = effect(() => {
2171
- untracked(() => {
2172
- this.#setOptions(this.options());
2173
- });
2174
- }, ...(ngDevMode ? [{ debugName: "#optionsEffect" }] : /* istanbul ignore next */ []));
2175
- /**
2176
- * Additional semantics for the form element.
2177
- */
2178
- this.classifications = input([], ...(ngDevMode ? [{ debugName: "classifications" }] : /* istanbul ignore next */ []));
2179
- this.#classificationEffect = effect(() => {
2180
- const cls = this.classifications();
2181
- untracked(() => {
2182
- const ce = this.#system.getClassifications(cls).get(Classification.STRING_CATALOG_I18N);
2183
- if (ce && ce.options) {
2184
- this.#setOptions(ce.options);
2185
- }
2186
- });
2187
- }, ...(ngDevMode ? [{ debugName: "#classificationEffect" }] : /* istanbul ignore next */ []));
2188
- /**
2189
- * Possibles values are `EDIT` (default),`SEARCH`,`CREATE`. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.
2190
- */
2191
- this.situation = input(...(ngDevMode ? [undefined, { debugName: "situation" }] : /* istanbul ignore next */ []));
2192
- this.ngControl = injectNgControl(this);
2193
- this.fc = new FormControl(undefined);
2194
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2195
- this.propagateChange = (_) => { };
2196
- this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe(() => {
2197
- // re-apply options to trigger translation
2198
- this.#setOptions(this.options());
2199
- });
2200
- }
2201
- #onValueChange(val) {
2202
- this.value = val;
2203
- this.propagateChange(this.value);
2204
- }
2205
- #setOptions(options) {
2206
- this._options.set(options.map((o) => ({
2207
- label: this.#translateOption(o),
2208
- value: o
2209
- })));
2210
- }
2211
- #translateOption(option) {
2212
- // labelkey: 'catalog:status:open_label' for option 'open'
2213
- // This will be derived fom a prefix the property name if available and this option itself
2214
- return this.#system.getLocalizedLabel(`catalog:${this.propertyName() || ''}:${option}`) || option;
2215
- }
2216
- writeValue(value) {
2217
- this.value = value;
2218
- this.fc.setValue(value, { emitEvent: false });
2219
- }
2220
- registerOnChange(fn) {
2221
- this.propagateChange = fn;
2222
- }
2223
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2224
- registerOnTouched(fn) { }
2225
- setDisabledState(isDisabled) {
2226
- if (isDisabled) {
2227
- this.fc.disable();
2228
- }
2229
- else {
2230
- this.fc.enable();
2231
- }
2232
- this.disabled = isDisabled;
2233
- }
2234
- ngOnInit() {
2235
- if (this.required)
2236
- this.fc.setValidators(Validators.required);
2237
- this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
2238
- this.errorState = FormUtils.getErrorState(this.fc);
2239
- if (this.ngControl?.control) {
2240
- this.ngControl.control.setErrors(this.fc.errors);
2241
- }
2242
- });
2243
- this.fc.updateValueAndValidity();
2244
- this.fc.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => this.#onValueChange(v));
2245
- }
2246
- ngOnDestroy() {
2247
- super.onNgOnDestroy();
2248
- }
2249
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: I18nCatalogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2250
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: I18nCatalogComponent, isStandalone: true, selector: "yuv-i18n-catalog", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, propertyName: { classPropertyName: "propertyName", publicName: "propertyName", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, classifications: { classPropertyName: "classifications", publicName: "classifications", isSignal: true, isRequired: false, transformFunction: null }, situation: { classPropertyName: "situation", publicName: "situation", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: I18nCatalogComponent }], usesInheritance: true, ngImport: i0, template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
2251
- }
2252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: I18nCatalogComponent, decorators: [{
2253
- type: Component,
2254
- args: [{ selector: 'yuv-i18n-catalog', imports: [MatSelectModule, ReactiveFormsModule], providers: [{ provide: MatFormFieldControl, useExisting: I18nCatalogComponent }], template: "<mat-select [multiple]=\"multiple()\" [disabled]=\"readonly()\" [formControl]=\"fc\">\n @for (o of _options(); track o) {\n <mat-option [value]=\"o.value\">{{ o.label }}</mat-option>\n }\n</mat-select>" }]
2255
- }], ctorParameters: () => [], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], propertyName: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyName", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], classifications: [{ type: i0.Input, args: [{ isSignal: true, alias: "classifications", required: false }] }], situation: [{ type: i0.Input, args: [{ isSignal: true, alias: "situation", required: false }] }] } });
2256
-
2257
2342
  const formElementCmps = [
2258
2343
  StringComponent,
2259
2344
  NumberComponent,
@@ -2263,14 +2348,15 @@ const formElementCmps = [
2263
2348
  OrganizationComponent,
2264
2349
  StringComponent,
2265
2350
  CatalogComponent,
2351
+ DynamicCatalogComponent,
2266
2352
  I18nCatalogComponent
2267
2353
  ];
2268
2354
  /**
2269
2355
  * Module for the forms library.
2270
2356
  */
2271
2357
  class YuvFormsModule {
2272
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: YuvFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2273
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: YuvFormsModule, imports: [StringComponent,
2358
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: YuvFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2359
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: YuvFormsModule, imports: [StringComponent,
2274
2360
  NumberComponent,
2275
2361
  NumberRangeComponent,
2276
2362
  DatetimeComponent,
@@ -2278,6 +2364,7 @@ class YuvFormsModule {
2278
2364
  OrganizationComponent,
2279
2365
  StringComponent,
2280
2366
  CatalogComponent,
2367
+ DynamicCatalogComponent,
2281
2368
  I18nCatalogComponent], exports: [StringComponent,
2282
2369
  NumberComponent,
2283
2370
  NumberRangeComponent,
@@ -2286,10 +2373,11 @@ class YuvFormsModule {
2286
2373
  OrganizationComponent,
2287
2374
  StringComponent,
2288
2375
  CatalogComponent,
2376
+ DynamicCatalogComponent,
2289
2377
  I18nCatalogComponent] }); }
2290
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: YuvFormsModule, imports: [formElementCmps] }); }
2378
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: YuvFormsModule, imports: [formElementCmps] }); }
2291
2379
  }
2292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: YuvFormsModule, decorators: [{
2380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: YuvFormsModule, decorators: [{
2293
2381
  type: NgModule,
2294
2382
  args: [{
2295
2383
  imports: [...formElementCmps],
@@ -2301,5 +2389,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
2301
2389
  * Generated bundle index. Do not edit.
2302
2390
  */
2303
2391
 
2304
- export { CatalogComponent, DataGridComponent, DatetimeComponent, DatetimeRangeComponent, FormUtils, I18nCatalogComponent, NumberComponent, NumberRangeComponent, OrganizationComponent, OrganizationSetComponent, RangeSelectDateComponent, RangeSelectFilesizeComponent, StringComponent, YuvFormsModule };
2392
+ export { CatalogComponent, DataGridComponent, DatetimeComponent, DatetimeRangeComponent, DynamicCatalogComponent, FormUtils, I18nCatalogComponent, NumberComponent, NumberRangeComponent, OrganizationComponent, OrganizationSetComponent, RangeSelectDateComponent, RangeSelectFilesizeComponent, StringComponent, YuvFormsModule };
2305
2393
  //# sourceMappingURL=yuuvis-client-framework-forms.mjs.map