@yuuvis/client-framework 2.10.3 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/lib/autocomplete.component.d.ts +4 -4
- package/autocomplete/lib/autocomplete.interface.d.ts +2 -2
- package/common/lib/services/index.d.ts +1 -0
- package/common/lib/services/layout-settings/layout-settings.service.d.ts +15 -0
- package/common/lib/services/theme/index.d.ts +3 -0
- package/common/lib/services/theme/theme.models.d.ts +16 -0
- package/common/lib/services/theme/theme.provider.d.ts +4 -0
- package/common/lib/services/theme/theme.service.d.ts +16 -0
- package/fesm2022/yuuvis-client-framework-common.mjs +213 -4
- package/fesm2022/yuuvis-client-framework-common.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-datepicker.mjs +1 -1
- package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-forms.mjs +60 -37
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs +2 -2
- package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-relationship.mjs +135 -52
- package/fesm2022/yuuvis-client-framework-object-relationship.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-object-versions.mjs +4 -3
- package/fesm2022/yuuvis-client-framework-object-versions.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-query-list.mjs +5 -4
- package/fesm2022/yuuvis-client-framework-query-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-tile-list.mjs +20 -4
- package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework.mjs +616 -98
- package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
- package/forms/lib/elements/datetime/datetime.component.d.ts +0 -1
- package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +6 -5
- package/forms/lib/elements/organization/organization.component.d.ts +1 -1
- package/forms/lib/elements/organization-set/organization-set.component.d.ts +1 -1
- package/index.d.ts +5 -2
- package/lib/config/index.d.ts +1 -0
- package/lib/config/session/index.d.ts +3 -0
- package/lib/config/session/session-activity-window-before-end.const.d.ts +43 -0
- package/lib/config/session/session-default-duration.const.d.ts +47 -0
- package/lib/config/session/session-popup-before-end.const.d.ts +47 -0
- package/lib/enums/channel-message.enum.d.ts +4 -0
- package/lib/enums/index.d.ts +1 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/session/channel-payload.model.d.ts +5 -0
- package/lib/models/session/index.d.ts +1 -0
- package/lib/models/snack-bar/index.d.ts +3 -0
- package/lib/models/snack-bar/snack-bar-data.model.d.ts +6 -0
- package/lib/models/snack-bar/snack-bar-level.model.d.ts +1 -0
- package/lib/{services/snack-bar/snack-bar.interface.d.ts → models/snack-bar/snack-bar-options.model.d.ts} +1 -6
- package/lib/providers/index.d.ts +1 -0
- package/lib/providers/session/index.d.ts +1 -0
- package/lib/providers/session/provide-session.provider.d.ts +43 -0
- package/lib/services/index.d.ts +2 -2
- package/lib/services/session/session.service.d.ts +113 -0
- package/lib/services/snack-bar/snack-bar.service.d.ts +5 -5
- package/object-relationship/index.d.ts +1 -0
- package/object-relationship/lib/actions/add-relationship/add-relationship.component.d.ts +10 -0
- package/object-relationship/lib/actions/relationship-target-search/relationship-target-search.component.d.ts +17 -4
- package/object-relationship/lib/object-relationship.const.d.ts +0 -1
- package/object-versions/lib/object-versions.component.d.ts +1 -0
- package/package.json +8 -8
- package/query-list/lib/query-list.component.d.ts +8 -7
- package/tile-list/lib/tile-list/tile-list.component.d.ts +4 -2
- package/lib/assets/i18n/de.json +0 -202
- package/lib/assets/i18n/en.json +0 -202
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1$2 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgClass } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, signal, input, forwardRef, ChangeDetectionStrategy, Component, ChangeDetectorRef, ElementRef, computed, linkedSignal, effect, untracked,
|
|
4
|
+
import { inject, signal, input, forwardRef, ChangeDetectionStrategy, Component, ChangeDetectorRef, ElementRef, computed, linkedSignal, effect, untracked, DestroyRef, viewChild, Input, output, NgModule } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormBuilder, Validators, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormControl, FormGroup, FormsModule } from '@angular/forms';
|
|
7
7
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -23,12 +23,12 @@ import { YmtButtonDirective, YmtIconButtonDirective } from '@yuuvis/material';
|
|
|
23
23
|
import { map, timer, take, of, forkJoin } from 'rxjs';
|
|
24
24
|
import { MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
|
|
25
25
|
import { FormTranslateService, DialogComponent, AbstractMatFormField, injectNgControl } from '@yuuvis/client-framework/common';
|
|
26
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
26
27
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
27
28
|
import { MatInputModule } from '@angular/material/input';
|
|
28
29
|
import { TranslateService as TranslateService$1, TranslateModule as TranslateModule$1 } from '@ngx-translate/core';
|
|
29
30
|
import * as i2$2 from '@yuuvis/client-framework/datepicker';
|
|
30
31
|
import { DatepickerComponent, YuvDatepickerModule } from '@yuuvis/client-framework/datepicker';
|
|
31
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
32
32
|
import * as i1$1 from '@angular/material/select';
|
|
33
33
|
import { MatSelectModule } from '@angular/material/select';
|
|
34
34
|
import * as i3$1 from '@yuuvis/client-framework/autocomplete';
|
|
@@ -383,11 +383,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
383
383
|
}, 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"] }]
|
|
384
384
|
}] });
|
|
385
385
|
|
|
386
|
+
class FormUtils {
|
|
387
|
+
static getErrorState(control) {
|
|
388
|
+
return control.invalid && (control.dirty || control.touched);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
386
392
|
class DatetimeComponent extends AbstractMatFormField {
|
|
387
|
-
#localeEffect;
|
|
388
393
|
constructor() {
|
|
389
|
-
super();
|
|
394
|
+
super(...arguments);
|
|
390
395
|
this.translate = inject(TranslateService$1);
|
|
396
|
+
this.#dRef = inject(DestroyRef);
|
|
391
397
|
this.pickerCmp = viewChild.required(DatepickerComponent);
|
|
392
398
|
this.ngControl = injectNgControl(this);
|
|
393
399
|
this.fc = new FormControl(null);
|
|
@@ -414,12 +420,21 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
414
420
|
this.withTime = input(false);
|
|
415
421
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
416
422
|
this.propagateChange = (_) => { };
|
|
417
|
-
this.fc.valueChanges.subscribe((v) => this.onValueChange(v));
|
|
418
|
-
this.fc.statusChanges.subscribe((v) => {
|
|
419
|
-
this.errorState = v === 'INVALID';
|
|
420
|
-
this.ngControl?.control?.setErrors(this.errorState ? { datecontrol: true } : null);
|
|
421
|
-
});
|
|
422
423
|
}
|
|
424
|
+
#dRef;
|
|
425
|
+
#localeEffect;
|
|
426
|
+
// constructor() {
|
|
427
|
+
// super();
|
|
428
|
+
// this.fc.valueChanges.pipe(takeUntilDestroyed()).subscribe((v) => this.onValueChange(v));
|
|
429
|
+
// this.fc.statusChanges.pipe(takeUntilDestroyed()).subscribe((v) => {
|
|
430
|
+
// this.errorState = FormUtils.getErrorState(this.fc);
|
|
431
|
+
// if (this.ngControl?.control) {
|
|
432
|
+
// this.ngControl.control.setErrors(this.fc.errors);
|
|
433
|
+
// }
|
|
434
|
+
// // this.errorState = v === 'INVALID';
|
|
435
|
+
// // this.ngControl?.control?.setErrors(this.errorState ? { datecontrol: true } : null);
|
|
436
|
+
// });
|
|
437
|
+
// }
|
|
423
438
|
#setLabels() {
|
|
424
439
|
this.labels = {
|
|
425
440
|
calendarApply: this.translate.instant('yuv.form.element.datetime.calendar.select'),
|
|
@@ -441,7 +456,8 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
441
456
|
this.#propagate(value);
|
|
442
457
|
}
|
|
443
458
|
this.value = value || null;
|
|
444
|
-
this.fc.setValue(this.value, { emitEvent: false });
|
|
459
|
+
// this.fc.setValue(this.value, { emitEvent: false });
|
|
460
|
+
this.fc.patchValue(this.value, { emitEvent: false, onlySelf: true });
|
|
445
461
|
}
|
|
446
462
|
#propagate(value) {
|
|
447
463
|
let propagateValue = value;
|
|
@@ -457,6 +473,12 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
457
473
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
458
474
|
registerOnTouched() { }
|
|
459
475
|
setDisabledState(isDisabled) {
|
|
476
|
+
if (isDisabled) {
|
|
477
|
+
this.fc.disable();
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
this.fc.enable();
|
|
481
|
+
}
|
|
460
482
|
this.disabled = isDisabled;
|
|
461
483
|
}
|
|
462
484
|
onValueChange(e) {
|
|
@@ -466,14 +488,21 @@ class DatetimeComponent extends AbstractMatFormField {
|
|
|
466
488
|
this.focusHandled.set(true);
|
|
467
489
|
this.#setLabels();
|
|
468
490
|
this.translate.onLangChange.subscribe((e) => this._locale.set(e.lang));
|
|
491
|
+
this.fc.valueChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => this.onValueChange(v));
|
|
492
|
+
this.fc.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
|
|
493
|
+
this.errorState = FormUtils.getErrorState(this.fc);
|
|
494
|
+
if (this.ngControl?.control) {
|
|
495
|
+
this.ngControl.control.setErrors(this.fc.errors);
|
|
496
|
+
}
|
|
497
|
+
});
|
|
469
498
|
}
|
|
470
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeComponent, deps:
|
|
499
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
471
500
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.15", 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$2.DatepickerComponent, selector: "yuv-datepicker", inputs: ["calendar", "readonly", "hour12", "locale", "labels", "withTime", "onlyFutureDates", "minDate", "maxDate", "disabled"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }] }); }
|
|
472
501
|
}
|
|
473
502
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeComponent, decorators: [{
|
|
474
503
|
type: Component,
|
|
475
504
|
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"] }]
|
|
476
|
-
}]
|
|
505
|
+
}] });
|
|
477
506
|
|
|
478
507
|
class DatetimeRangeComponent extends AbstractMatFormField {
|
|
479
508
|
constructor() {
|
|
@@ -482,12 +511,17 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
482
511
|
/**
|
|
483
512
|
* Enables setting time as well (default: false)
|
|
484
513
|
*/
|
|
485
|
-
this.
|
|
514
|
+
this.withTimeInput = input(false, { alias: 'withTime' });
|
|
515
|
+
this.withTime = linkedSignal(this.withTimeInput);
|
|
486
516
|
/**
|
|
487
517
|
* Will prevent the input from being changed (default: false)
|
|
488
518
|
*/
|
|
489
|
-
this.readonly = false;
|
|
490
|
-
this
|
|
519
|
+
this.readonly = input(false);
|
|
520
|
+
// TODO: this should be set by the form and not by the consumer of the component,
|
|
521
|
+
// otherwise there would be two sources of truth for the situation (one in the form and one in the component)
|
|
522
|
+
// also not used!!!!
|
|
523
|
+
this.operator = input(Operator.EQUAL);
|
|
524
|
+
this.situation = input();
|
|
491
525
|
this._isValid = true;
|
|
492
526
|
this.ngControl = injectNgControl(this);
|
|
493
527
|
// options for search situation
|
|
@@ -543,6 +577,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
543
577
|
#onValueChange() {
|
|
544
578
|
const dateValue = this.rangeForm.value.dateValue;
|
|
545
579
|
const operator = this.rangeForm.value.operator;
|
|
580
|
+
operator === Operator.EQUAL ? this.withTime.set(false) : this.withTime.set(true);
|
|
546
581
|
if (operator === Operator.INTERVAL_INCLUDE_BOTH) {
|
|
547
582
|
const dateValueFrom = this.rangeForm.value.dateValueFrom;
|
|
548
583
|
if (dateValueFrom && dateValue) {
|
|
@@ -575,7 +610,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
575
610
|
const dateValueFrom = Utils.getDateFrom(control.get('dateValueFrom')?.value);
|
|
576
611
|
const singleValueOperators = new Set([Operator.EQUAL, Operator.GREATER_OR_EQUAL, Operator.LESS_OR_EQUAL]);
|
|
577
612
|
const rangeOperators = new Set([Operator.INTERVAL_INCLUDE_BOTH]);
|
|
578
|
-
if (this.situation === Situation.SEARCH && !rangeOperators.has(operator))
|
|
613
|
+
if (this.situation() === Situation.SEARCH && !rangeOperators.has(operator))
|
|
579
614
|
return null;
|
|
580
615
|
if (singleValueOperators.has(operator)) {
|
|
581
616
|
if (!Utils.isValidDate(dateValue)) {
|
|
@@ -613,7 +648,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
613
648
|
this.rangeForm.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe({
|
|
614
649
|
next: () => {
|
|
615
650
|
if (this.ngControl?.control) {
|
|
616
|
-
// this.errorState = this.situation === Situation.SEARCH || this._isValid;
|
|
651
|
+
// this.errorState = this.situation() === Situation.SEARCH || this._isValid;
|
|
617
652
|
this.errorState = !!this.rangeForm.errors;
|
|
618
653
|
this.ngControl.control.setErrors(this.rangeForm.errors);
|
|
619
654
|
}
|
|
@@ -626,26 +661,12 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
626
661
|
super.onNgOnDestroy();
|
|
627
662
|
}
|
|
628
663
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
629
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: DatetimeRangeComponent, isStandalone: true, selector: "yuv-datetime-range", inputs: {
|
|
664
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", 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: CommonModule }, { 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],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1$1.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"] }] }); }
|
|
630
665
|
}
|
|
631
666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeRangeComponent, decorators: [{
|
|
632
667
|
type: Component,
|
|
633
|
-
args: [{ selector: 'yuv-datetime-range', standalone: true, imports: [CommonModule, 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"] }]
|
|
634
|
-
}]
|
|
635
|
-
type: Input
|
|
636
|
-
}], readonly: [{
|
|
637
|
-
type: Input
|
|
638
|
-
}], operator: [{
|
|
639
|
-
type: Input
|
|
640
|
-
}], situation: [{
|
|
641
|
-
type: Input
|
|
642
|
-
}] } });
|
|
643
|
-
|
|
644
|
-
class FormUtils {
|
|
645
|
-
static getErrorState(control) {
|
|
646
|
-
return control.invalid && (control.dirty || control.touched);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
668
|
+
args: [{ selector: 'yuv-datetime-range', standalone: true, imports: [CommonModule, 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"] }]
|
|
669
|
+
}] });
|
|
649
670
|
|
|
650
671
|
var _a;
|
|
651
672
|
/**
|
|
@@ -1163,7 +1184,7 @@ class OrganizationComponent extends AbstractMatFormField {
|
|
|
1163
1184
|
this.disabled = isDisabled;
|
|
1164
1185
|
}
|
|
1165
1186
|
#getPropagateValue() {
|
|
1166
|
-
const value = this.innerValue.map((v) => (this.withMetadata() ? JSON.stringify({ id: v.id, title: v.title }) : v.id));
|
|
1187
|
+
const value = this.innerValue.map((v) => (this.withMetadata() ? JSON.stringify({ id: v.id, title: v.title, type: v.type }) : v.id));
|
|
1167
1188
|
return this.multiselect() ? value : value[0];
|
|
1168
1189
|
}
|
|
1169
1190
|
resolveFn(value) {
|
|
@@ -1965,11 +1986,13 @@ class StringComponent extends AbstractMatFormField {
|
|
|
1965
1986
|
super.onNgOnDestroy();
|
|
1966
1987
|
}
|
|
1967
1988
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StringComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1968
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: StringComponent, isStandalone: true, selector: "yuv-string", inputs: { multiselect: "multiselect", rows: "rows", readonly: "readonly", autofocus: "autofocus", classifications: "classifications", situation: "situation", regex: "regex", minLength: "minLength", maxLength: "maxLength" }, 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 <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
|
|
1989
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: StringComponent, isStandalone: true, selector: "yuv-string", inputs: { multiselect: "multiselect", rows: "rows", readonly: "readonly", autofocus: "autofocus", classifications: "classifications", situation: "situation", regex: "regex", minLength: "minLength", maxLength: "maxLength" }, 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 <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} @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){overflow-x:auto;scrollbar-width:none}: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}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1$3.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i1$3.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i1$3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i1$3.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: i3.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 }] }); }
|
|
1969
1990
|
}
|
|
1970
1991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StringComponent, decorators: [{
|
|
1971
1992
|
type: Component,
|
|
1972
|
-
args: [{ selector: 'yuv-string', standalone: true, imports: [CommonModule, MatChipsModule, MatIconModule, ReactiveFormsModule, FormsModule], providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }],
|
|
1993
|
+
args: [{ selector: 'yuv-string', standalone: true, imports: [CommonModule, MatChipsModule, MatIconModule, ReactiveFormsModule, FormsModule], providers: [{ provide: MatFormFieldControl, useExisting: StringComponent }], host: {
|
|
1994
|
+
'[class.readonly]': 'readonly'
|
|
1995
|
+
}, 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 <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} @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){overflow-x:auto;scrollbar-width:none}: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}\n"] }]
|
|
1973
1996
|
}], propDecorators: { multiselect: [{
|
|
1974
1997
|
type: Input
|
|
1975
1998
|
}], rows: [{
|