@yuuvis/client-framework 2.1.12 → 2.1.13
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.
- package/fesm2022/yuuvis-client-framework-forms.mjs +56 -12
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-master-details.mjs +0 -4
- package/fesm2022/yuuvis-client-framework-master-details.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +2 -2
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs +19 -10
- package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-form.mjs +12 -4
- package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-sort.mjs +120 -0
- package/fesm2022/yuuvis-client-framework-sort.mjs.map +1 -0
- package/forms/lib/elements/datetime/datetime.component.d.ts +1 -1
- package/lib/assets/i18n/de.json +3 -0
- package/lib/assets/i18n/en.json +3 -0
- package/metadata-form/lib/metadata-form-field/metadata-form-field.component.d.ts +3 -1
- package/metadata-form/lib/metadata-form-field/metadata-form-field.interface.d.ts +2 -0
- package/metadata-form/lib/object-metadata-element-label.directive.d.ts +2 -2
- package/object-form/lib/object-form-element/object-form-element.component.d.ts +1 -0
- package/object-form/lib/object-form.service.d.ts +2 -0
- package/package.json +8 -4
- package/sort/README.md +3 -0
- package/sort/index.d.ts +2 -0
- package/sort/lib/sort/models/index.d.ts +1 -0
- package/sort/lib/sort/models/sort.interface.d.ts +7 -0
- package/sort/lib/sort/sort.component.d.ts +19 -0
|
@@ -118,7 +118,7 @@ class EditTableDataComponent {
|
|
|
118
118
|
useExisting: forwardRef(() => EditTableDataComponent),
|
|
119
119
|
multi: true
|
|
120
120
|
}
|
|
121
|
-
], ngImport: i0, template: "<yuv-dialog [headertitel]=\"'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\n @let errorsGroup = errorMessage();\n @if (errorsGroup && tableForm.errors) {\n <div class=\"err-msg\">\n @for (errors of errorsGroup; track $index) {\n @for (error of errors; track $index) {\n {{ error[element.name] }}\n }\n }\n </div>\n }\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.form.element.data.grid.edit' | translate }}\n }\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host .fields{padding:var(--ymt-spacing-m)}: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: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],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: ["headertitel"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: MetadataFormFieldComponent, selector: "yuv-metadata-form-field", inputs: ["field", "situation"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
121
|
+
], ngImport: i0, template: "<yuv-dialog [headertitel]=\"'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 \n [field]=\"element\" [formControlName]=\"element.name\" [situation]=\"situation\"></yuv-metadata-form-field>\n\n @let errorsGroup = errorMessage();\n @if (errorsGroup && tableForm.errors) {\n <div class=\"err-msg\">\n @for (errors of errorsGroup; track $index) {\n @for (error of errors; track $index) {\n {{ error[element.name] }}\n }\n }\n </div>\n }\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.form.element.data.grid.edit' | translate }}\n }\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host .fields{padding:var(--ymt-spacing-m)}: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: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],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: ["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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
122
122
|
}
|
|
123
123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: EditTableDataComponent, decorators: [{
|
|
124
124
|
type: Component,
|
|
@@ -138,7 +138,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImpo
|
|
|
138
138
|
useExisting: forwardRef(() => EditTableDataComponent),
|
|
139
139
|
multi: true
|
|
140
140
|
}
|
|
141
|
-
], template: "<yuv-dialog [headertitel]=\"'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\n @let errorsGroup = errorMessage();\n @if (errorsGroup && tableForm.errors) {\n <div class=\"err-msg\">\n @for (errors of errorsGroup; track $index) {\n @for (error of errors; track $index) {\n {{ error[element.name] }}\n }\n }\n </div>\n }\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.form.element.data.grid.edit' | translate }}\n }\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host .fields{padding:var(--ymt-spacing-m)}:host .err-msg{font:var(--ymt-font-body-subtle);color:var(--ymt-danger);padding:var(--ymt-spacing-2xs) 0;border:0}\n"] }]
|
|
141
|
+
], template: "<yuv-dialog [headertitel]=\"'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 \n [field]=\"element\" [formControlName]=\"element.name\" [situation]=\"situation\"></yuv-metadata-form-field>\n\n @let errorsGroup = errorMessage();\n @if (errorsGroup && tableForm.errors) {\n <div class=\"err-msg\">\n @for (errors of errorsGroup; track $index) {\n @for (error of errors; track $index) {\n {{ error[element.name] }}\n }\n }\n </div>\n }\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.form.element.data.grid.edit' | translate }}\n }\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host .fields{padding:var(--ymt-spacing-m)}:host .err-msg{font:var(--ymt-font-body-subtle);color:var(--ymt-danger);padding:var(--ymt-spacing-2xs) 0;border:0}\n"] }]
|
|
142
142
|
}] });
|
|
143
143
|
|
|
144
144
|
var DataGridSizeType;
|
|
@@ -338,8 +338,8 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
338
338
|
* Enables setting time as well (default: false)
|
|
339
339
|
*/
|
|
340
340
|
this.withTime = input(false);
|
|
341
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
342
|
-
this.propagateChange = (
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
342
|
+
this.propagateChange = (_) => { };
|
|
343
343
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
344
344
|
this.validationChange = () => { };
|
|
345
345
|
}
|
|
@@ -357,10 +357,18 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
357
357
|
writeValue(value) {
|
|
358
358
|
if (typeof value === 'string') {
|
|
359
359
|
value = new Date(value);
|
|
360
|
-
this
|
|
360
|
+
this.#propagate(value);
|
|
361
361
|
}
|
|
362
362
|
this.value = value || null;
|
|
363
363
|
}
|
|
364
|
+
#propagate(value) {
|
|
365
|
+
let propagateValue = value;
|
|
366
|
+
if (propagateValue && !this.withTime()) {
|
|
367
|
+
// returns a string in the format 'yyyy-MM-dd' like expected for resolution date
|
|
368
|
+
propagateValue = `${propagateValue.getFullYear()}-${(propagateValue.getMonth() + 1).toString().padStart(2, '0')}-${propagateValue.getDate().toString().padStart(2, '0')}`;
|
|
369
|
+
}
|
|
370
|
+
this.propagateChange(propagateValue);
|
|
371
|
+
}
|
|
364
372
|
registerOnChange(fn) {
|
|
365
373
|
this.propagateChange = fn;
|
|
366
374
|
}
|
|
@@ -370,7 +378,7 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
370
378
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
371
379
|
registerOnTouched() { }
|
|
372
380
|
onValueChange(e) {
|
|
373
|
-
this
|
|
381
|
+
this.#propagate(e);
|
|
374
382
|
}
|
|
375
383
|
ngOnInit() {
|
|
376
384
|
this.focusHandled.set(true);
|
|
@@ -693,7 +701,10 @@ class NumberComponent extends AbstractMatFormField {
|
|
|
693
701
|
}
|
|
694
702
|
ngOnInit() {
|
|
695
703
|
// set up validators once all inputs are set
|
|
696
|
-
this
|
|
704
|
+
const validators = [this.#getValidator()];
|
|
705
|
+
if (this.required)
|
|
706
|
+
validators.push(Validators.required);
|
|
707
|
+
this.innerCtrl.setValidators(validators);
|
|
697
708
|
this.innerCtrl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
|
|
698
709
|
this.errorState = this.innerCtrl.invalid;
|
|
699
710
|
if (this.ngControl?.control) {
|
|
@@ -932,6 +943,7 @@ class OrganizationComponent extends AbstractMatFormField {
|
|
|
932
943
|
super(...arguments);
|
|
933
944
|
this.#system = inject(SystemService);
|
|
934
945
|
this.#userService = inject(UserService);
|
|
946
|
+
this.#dRef = inject(DestroyRef);
|
|
935
947
|
this.translate = inject(TranslateService);
|
|
936
948
|
this.minLength = 2;
|
|
937
949
|
this.busy = signal(false);
|
|
@@ -966,6 +978,7 @@ class OrganizationComponent extends AbstractMatFormField {
|
|
|
966
978
|
}
|
|
967
979
|
#system;
|
|
968
980
|
#userService;
|
|
981
|
+
#dRef;
|
|
969
982
|
set innerValue(iv) {
|
|
970
983
|
this._innerValue = iv || [];
|
|
971
984
|
}
|
|
@@ -1048,6 +1061,7 @@ class OrganizationComponent extends AbstractMatFormField {
|
|
|
1048
1061
|
value: u
|
|
1049
1062
|
}));
|
|
1050
1063
|
this.acFormControl.setValue(this.multiselect() ? mapped : [mapped[0]], { emitEvent: false });
|
|
1064
|
+
this.acFormControl.updateValueAndValidity();
|
|
1051
1065
|
});
|
|
1052
1066
|
}
|
|
1053
1067
|
autocompleteFn(query) {
|
|
@@ -1080,6 +1094,15 @@ class OrganizationComponent extends AbstractMatFormField {
|
|
|
1080
1094
|
}
|
|
1081
1095
|
}
|
|
1082
1096
|
ngOnInit() {
|
|
1097
|
+
if (this.required)
|
|
1098
|
+
this.acFormControl.setValidators(Validators.required);
|
|
1099
|
+
this.acFormControl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
|
|
1100
|
+
this.errorState = this.acFormControl.invalid;
|
|
1101
|
+
if (this.ngControl?.control) {
|
|
1102
|
+
this.ngControl.control.setErrors(this.acFormControl.errors);
|
|
1103
|
+
}
|
|
1104
|
+
});
|
|
1105
|
+
this.acFormControl.updateValueAndValidity();
|
|
1083
1106
|
this.acFormControl.valueChanges.subscribe((v) => {
|
|
1084
1107
|
if (!Array.isArray(v))
|
|
1085
1108
|
v = v ? [v] : [];
|
|
@@ -1091,13 +1114,11 @@ class OrganizationComponent extends AbstractMatFormField {
|
|
|
1091
1114
|
super.onNgOnDestroy();
|
|
1092
1115
|
}
|
|
1093
1116
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: OrganizationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1094
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.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: false, 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 [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.user.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.state.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.user.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">{{ multiselect() ? 'group' : 'person' }}</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$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
1117
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.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: false, 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 (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.user.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.state.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.user.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">{{ multiselect() ? 'group' : 'person' }}</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$2.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"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
1095
1118
|
}
|
|
1096
1119
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.12", ngImport: i0, type: OrganizationComponent, decorators: [{
|
|
1097
1120
|
type: Component,
|
|
1098
|
-
args: [{ selector: 'yuv-organization', standalone: true, imports: [CommonModule, FormsModule, YuvAutocompleteModule,
|
|
1099
|
-
MatTooltipModule,
|
|
1100
|
-
MatIconModule, ReactiveFormsModule, TranslateModule], providers: [{ provide: MatFormFieldControl, useExisting: OrganizationComponent }], 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.user.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.state.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.user.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">{{ multiselect() ? 'group' : 'person' }}</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"] }]
|
|
1121
|
+
args: [{ selector: 'yuv-organization', standalone: true, imports: [CommonModule, FormsModule, YuvAutocompleteModule, MatTooltipModule, MatIconModule, ReactiveFormsModule, TranslateModule], 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 (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.user.title }}</span>\n </ng-template>\n\n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\" [ngClass]=\"{ notFound: item.value.state.notFound }\" [matTooltip]=\"item.value.titleString\">\n {{ item.value.user.title || '...' }}\n </span>\n </ng-template>\n</yuv-autocomplete>\n\n<mat-icon [matTooltip]=\"'yuv.form.element.organization.classify.icon.title' | translate\">{{ multiselect() ? 'group' : 'person' }}</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"] }]
|
|
1101
1122
|
}], propDecorators: { classifications: [{
|
|
1102
1123
|
type: Input
|
|
1103
1124
|
}] } });
|
|
@@ -1120,6 +1141,7 @@ class OrganizationSetComponent extends AbstractMatFormField {
|
|
|
1120
1141
|
super(...arguments);
|
|
1121
1142
|
this.#system = inject(SystemService);
|
|
1122
1143
|
this.#idmService = inject(IdmService);
|
|
1144
|
+
this.#dRef = inject(DestroyRef);
|
|
1123
1145
|
this.types = input(undefined);
|
|
1124
1146
|
this.#typesEffect = effect(() => {
|
|
1125
1147
|
const types = this.types();
|
|
@@ -1160,6 +1182,7 @@ class OrganizationSetComponent extends AbstractMatFormField {
|
|
|
1160
1182
|
}
|
|
1161
1183
|
#system;
|
|
1162
1184
|
#idmService;
|
|
1185
|
+
#dRef;
|
|
1163
1186
|
#typesEffect;
|
|
1164
1187
|
#targetTypes;
|
|
1165
1188
|
set classifications(c) {
|
|
@@ -1220,6 +1243,15 @@ class OrganizationSetComponent extends AbstractMatFormField {
|
|
|
1220
1243
|
}
|
|
1221
1244
|
}
|
|
1222
1245
|
ngOnInit() {
|
|
1246
|
+
if (this.required)
|
|
1247
|
+
this.acFormControl.setValidators(Validators.required);
|
|
1248
|
+
this.acFormControl.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
|
|
1249
|
+
this.errorState = this.acFormControl.invalid;
|
|
1250
|
+
if (this.ngControl?.control) {
|
|
1251
|
+
this.ngControl.control.setErrors(this.acFormControl.errors);
|
|
1252
|
+
}
|
|
1253
|
+
});
|
|
1254
|
+
this.acFormControl.updateValueAndValidity();
|
|
1223
1255
|
this.acFormControl.valueChanges.subscribe((v) => {
|
|
1224
1256
|
if (!Array.isArray(v))
|
|
1225
1257
|
v = v ? [v] : [];
|
|
@@ -1752,7 +1784,10 @@ class StringComponent extends AbstractMatFormField {
|
|
|
1752
1784
|
};
|
|
1753
1785
|
}
|
|
1754
1786
|
ngOnInit() {
|
|
1755
|
-
this
|
|
1787
|
+
const validators = [this.#getValidator()];
|
|
1788
|
+
if (this.required)
|
|
1789
|
+
validators.push(Validators.required);
|
|
1790
|
+
this.fc.setValidators(validators);
|
|
1756
1791
|
this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
|
|
1757
1792
|
this.errorState = this.fc.invalid;
|
|
1758
1793
|
if (this.ngControl?.control) {
|
|
@@ -1849,6 +1884,15 @@ class CatalogComponent extends AbstractMatFormField {
|
|
|
1849
1884
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1850
1885
|
registerOnTouched(fn) { }
|
|
1851
1886
|
ngOnInit() {
|
|
1887
|
+
if (this.required)
|
|
1888
|
+
this.fc.setValidators(Validators.required);
|
|
1889
|
+
this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
|
|
1890
|
+
this.errorState = this.fc.invalid;
|
|
1891
|
+
if (this.ngControl?.control) {
|
|
1892
|
+
this.ngControl.control.setErrors(this.fc.errors);
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
this.fc.updateValueAndValidity();
|
|
1852
1896
|
this.fc.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => this.#onValueChange(v));
|
|
1853
1897
|
}
|
|
1854
1898
|
ngOnDestroy() {
|