@yuuvis/client-framework 2.11.0 → 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/fesm2022/yuuvis-client-framework-forms.mjs +14 -16
- package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
- package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -1
- package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +6 -5
- package/package.json +4 -4
|
@@ -511,12 +511,17 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
511
511
|
/**
|
|
512
512
|
* Enables setting time as well (default: false)
|
|
513
513
|
*/
|
|
514
|
-
this.
|
|
514
|
+
this.withTimeInput = input(false, { alias: 'withTime' });
|
|
515
|
+
this.withTime = linkedSignal(this.withTimeInput);
|
|
515
516
|
/**
|
|
516
517
|
* Will prevent the input from being changed (default: false)
|
|
517
518
|
*/
|
|
518
|
-
this.readonly = false;
|
|
519
|
-
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();
|
|
520
525
|
this._isValid = true;
|
|
521
526
|
this.ngControl = injectNgControl(this);
|
|
522
527
|
// options for search situation
|
|
@@ -572,6 +577,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
572
577
|
#onValueChange() {
|
|
573
578
|
const dateValue = this.rangeForm.value.dateValue;
|
|
574
579
|
const operator = this.rangeForm.value.operator;
|
|
580
|
+
operator === Operator.EQUAL ? this.withTime.set(false) : this.withTime.set(true);
|
|
575
581
|
if (operator === Operator.INTERVAL_INCLUDE_BOTH) {
|
|
576
582
|
const dateValueFrom = this.rangeForm.value.dateValueFrom;
|
|
577
583
|
if (dateValueFrom && dateValue) {
|
|
@@ -604,7 +610,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
604
610
|
const dateValueFrom = Utils.getDateFrom(control.get('dateValueFrom')?.value);
|
|
605
611
|
const singleValueOperators = new Set([Operator.EQUAL, Operator.GREATER_OR_EQUAL, Operator.LESS_OR_EQUAL]);
|
|
606
612
|
const rangeOperators = new Set([Operator.INTERVAL_INCLUDE_BOTH]);
|
|
607
|
-
if (this.situation === Situation.SEARCH && !rangeOperators.has(operator))
|
|
613
|
+
if (this.situation() === Situation.SEARCH && !rangeOperators.has(operator))
|
|
608
614
|
return null;
|
|
609
615
|
if (singleValueOperators.has(operator)) {
|
|
610
616
|
if (!Utils.isValidDate(dateValue)) {
|
|
@@ -642,7 +648,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
642
648
|
this.rangeForm.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe({
|
|
643
649
|
next: () => {
|
|
644
650
|
if (this.ngControl?.control) {
|
|
645
|
-
// this.errorState = this.situation === Situation.SEARCH || this._isValid;
|
|
651
|
+
// this.errorState = this.situation() === Situation.SEARCH || this._isValid;
|
|
646
652
|
this.errorState = !!this.rangeForm.errors;
|
|
647
653
|
this.ngControl.control.setErrors(this.rangeForm.errors);
|
|
648
654
|
}
|
|
@@ -655,20 +661,12 @@ class DatetimeRangeComponent extends AbstractMatFormField {
|
|
|
655
661
|
super.onNgOnDestroy();
|
|
656
662
|
}
|
|
657
663
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeRangeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
658
|
-
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"] }] }); }
|
|
659
665
|
}
|
|
660
666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DatetimeRangeComponent, decorators: [{
|
|
661
667
|
type: Component,
|
|
662
|
-
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"] }]
|
|
663
|
-
}]
|
|
664
|
-
type: Input
|
|
665
|
-
}], readonly: [{
|
|
666
|
-
type: Input
|
|
667
|
-
}], operator: [{
|
|
668
|
-
type: Input
|
|
669
|
-
}], situation: [{
|
|
670
|
-
type: Input
|
|
671
|
-
}] } });
|
|
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
|
+
}] });
|
|
672
670
|
|
|
673
671
|
var _a;
|
|
674
672
|
/**
|