@yuuvis/client-framework 0.7.3 → 0.8.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 (42) hide show
  1. package/esm2022/actions/lib/components/contextmenu/contextmenu.component.mjs +2 -2
  2. package/esm2022/forms/index.mjs +5 -1
  3. package/esm2022/forms/lib/elements/datetime-range/datetime-range.component.mjs +32 -32
  4. package/esm2022/forms/lib/elements/number/number.component.mjs +3 -3
  5. package/esm2022/forms/lib/elements/number-range/number-range.component.mjs +3 -3
  6. package/esm2022/forms/lib/elements/range-select-date/date-range-picker/date-range-picker.component.mjs +38 -0
  7. package/esm2022/forms/lib/elements/range-select-date/range-select-date.component.mjs +181 -0
  8. package/esm2022/forms/lib/elements/range-select-date/range-select-date.interface.mjs +2 -0
  9. package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.component.mjs +98 -0
  10. package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.interface.mjs +2 -0
  11. package/esm2022/forms/lib/elements/string/string.component.mjs +10 -3
  12. package/esm2022/list/lib/list.component.mjs +6 -4
  13. package/esm2022/metadata-form/lib/metadata-default-templates/metadata-default-templates.component.mjs +3 -3
  14. package/esm2022/metadata-form/lib/metadata-form-field/metadata-form-field.component.mjs +5 -3
  15. package/esm2022/object-details/lib/object-audit/object-audit.component.mjs +3 -3
  16. package/esm2022/object-flavor/lib/object-flavor/object-flavor.component.mjs +2 -2
  17. package/esm2022/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.mjs +2 -2
  18. package/esm2022/tile-list/lib/tile-config/tile-config.component.mjs +2 -2
  19. package/fesm2022/yuuvis-client-framework-actions.mjs +1 -1
  20. package/fesm2022/yuuvis-client-framework-actions.mjs.map +1 -1
  21. package/fesm2022/yuuvis-client-framework-forms.mjs +339 -44
  22. package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
  23. package/fesm2022/yuuvis-client-framework-list.mjs +5 -3
  24. package/fesm2022/yuuvis-client-framework-list.mjs.map +1 -1
  25. package/fesm2022/yuuvis-client-framework-metadata-form.mjs +6 -4
  26. package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
  27. package/fesm2022/yuuvis-client-framework-object-details.mjs +2 -2
  28. package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
  29. package/fesm2022/yuuvis-client-framework-object-flavor.mjs +2 -2
  30. package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
  31. package/fesm2022/yuuvis-client-framework-tile-list.mjs +1 -1
  32. package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
  33. package/forms/index.d.ts +4 -0
  34. package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +2 -1
  35. package/forms/lib/elements/range-select-date/date-range-picker/date-range-picker.component.d.ts +13 -0
  36. package/forms/lib/elements/range-select-date/range-select-date.component.d.ts +33 -0
  37. package/forms/lib/elements/range-select-date/range-select-date.interface.d.ts +5 -0
  38. package/forms/lib/elements/range-select-filesize/range-select-filesize.component.d.ts +28 -0
  39. package/forms/lib/elements/range-select-filesize/range-select-filesize.interface.d.ts +5 -0
  40. package/list/lib/list.component.d.ts +2 -1
  41. package/metadata-form/lib/metadata-form-field/metadata-form-field.component.d.ts +1 -0
  42. package/package.json +28 -28
@@ -1,20 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
- import { forwardRef, Component, Input, inject, input, EventEmitter, ViewChild, HostListener, HostBinding, Output, ElementRef, Renderer2, ViewEncapsulation, NgModule } from '@angular/core';
2
+ import { forwardRef, Component, Input, inject, input, EventEmitter, ViewChild, HostListener, HostBinding, Output, ElementRef, Renderer2, ViewEncapsulation, NgModule, output, effect, signal } from '@angular/core';
3
3
  import * as i2 from '@angular/forms';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule, FormBuilder, Validators, NG_VALIDATORS, ReactiveFormsModule, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
5
5
  import * as i1 from '@yuuvis/client-core';
6
- import { Classification, OperatorLabel, Operator, FileSizePipe, LocaleNumberPipe, Utils, SystemService, UserService, YuvUser, TranslateModule, ClassificationPrefix, Situation } from '@yuuvis/client-core';
7
- import * as i3 from '@yuuvis/components/dropdown';
6
+ import { Classification, OperatorLabel, Operator, Situation, FileSizePipe, LocaleNumberPipe, Utils, SystemService, UserService, YuvUser, TranslateModule, ClassificationPrefix, TranslateService as TranslateService$1, SearchUtils, LocaleDatePipe } from '@yuuvis/client-core';
7
+ import * as i1$1 from '@yuuvis/components/dropdown';
8
8
  import { YvcDropdownModule } from '@yuuvis/components/dropdown';
9
9
  import { TranslateService, TranslateModule as TranslateModule$1 } from '@ngx-translate/core';
10
10
  import * as i2$1 from '@yuuvis/components/datepicker';
11
11
  import { YvcDatepickerModule } from '@yuuvis/components/datepicker';
12
- import * as i1$1 from '@angular/common';
12
+ import * as i1$2 from '@angular/common';
13
13
  import { CommonModule } from '@angular/common';
14
14
  import { YUV_ICONS, IconService } from '@yuuvis/client-framework/icons';
15
15
  import * as i2$2 from '@yuuvis/components/autocomplete';
16
16
  import { YvcAutocompleteModule } from '@yuuvis/components/autocomplete';
17
- import * as i3$1 from '@yuuvis/components/icon';
17
+ import * as i3 from '@yuuvis/components/icon';
18
18
  import { YvcIconModule } from '@yuuvis/components/icon';
19
19
  import { of, forkJoin } from 'rxjs';
20
20
  import { catchError } from 'rxjs/operators';
@@ -23,6 +23,9 @@ import { YvcChipsModule } from '@yuuvis/components/chips';
23
23
  import { FocusWithinDirective } from '@yuuvis/client-framework/common';
24
24
  import { YvcCheckboxModule } from '@yuuvis/components/checkbox';
25
25
  import { YvcFocusWithin } from '@yuuvis/components/common';
26
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
27
+ import { marker } from '@colsen1991/ngx-translate-extract-marker';
28
+ import { YvcOverlayRef, YvcOverlayService } from '@yuuvis/components/overlay';
26
29
 
27
30
  /**
28
31
  * Component rendering a simple catalog as form element.
@@ -105,7 +108,7 @@ class CatalogComponent {
105
108
  useExisting: forwardRef(() => CatalogComponent),
106
109
  multi: true
107
110
  }
108
- ], ngImport: i0, template: "<yvc-dropdown [multiple]=\"multiselect\" [options]=\"_options\" [(ngModel)]=\"value\" (ngModelChange)=\"onChange($event)\" [filter]=\"filter\"\n [disabled]=\"readonly\"></yvc-dropdown>\n", styles: [":host{display:block}:host ::ng-deep .p-checkbox{flex-shrink:0}:host ::ng-deep .p-multiselect-item{white-space:normal;min-width:33ch}:host ::ng-deep .p-overlay{max-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i3.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }] }); }
111
+ ], ngImport: i0, template: "<yvc-dropdown [multiple]=\"multiselect\" [options]=\"_options\" [(ngModel)]=\"value\" (ngModelChange)=\"onChange($event)\" [filter]=\"filter\"\n [disabled]=\"readonly\"></yvc-dropdown>\n", styles: [":host{display:block}:host ::ng-deep .p-checkbox{flex-shrink:0}:host ::ng-deep .p-multiselect-item{white-space:normal;min-width:33ch}:host ::ng-deep .p-overlay{max-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i1$1.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }] }); }
109
112
  }
110
113
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CatalogComponent, decorators: [{
111
114
  type: Component,
@@ -265,36 +268,34 @@ class DatetimeRangeComponent {
265
268
  const dateValueFrom = this.rangeForm.value.dateValueFrom || undefined;
266
269
  if (dateValueFrom || dateValue) {
267
270
  this._isValid = this.rangeForm.valid && !!dateValueFrom && !!dateValue;
268
- this.value = !this._isValid ?
269
- // {
270
- // operator: this.searchOption,
271
- // firstValue: undefined,
272
- // secondValue: undefined
273
- // }
274
- undefined
275
- :
276
- {
277
- operator: this.searchOption,
278
- firstValue: dateValueFrom,
279
- secondValue: dateValue
280
- };
271
+ this.value = !this._isValid
272
+ ? // {
273
+ // operator: this.searchOption,
274
+ // firstValue: undefined,
275
+ // secondValue: undefined
276
+ // }
277
+ undefined
278
+ : {
279
+ operator: this.searchOption,
280
+ firstValue: dateValueFrom,
281
+ secondValue: dateValue
282
+ };
281
283
  }
282
284
  }
283
285
  else {
284
286
  this._isValid = this.rangeForm.valid;
285
- this.value = !this._isValid ?
286
- // {
287
- // operator: this.searchOption,
288
- // firstValue: undefined,
289
- // secondValue: undefined
290
- // }
291
- undefined
292
- :
293
- {
294
- operator: this.searchOption,
295
- firstValue: dateValue,
296
- secondValue: undefined
297
- };
287
+ this.value = !this._isValid
288
+ ? // {
289
+ // operator: this.searchOption,
290
+ // firstValue: undefined,
291
+ // secondValue: undefined
292
+ // }
293
+ undefined
294
+ : {
295
+ operator: this.searchOption,
296
+ firstValue: dateValue,
297
+ secondValue: undefined
298
+ };
298
299
  }
299
300
  this.propagateChange(this.value);
300
301
  }
@@ -325,13 +326,13 @@ class DatetimeRangeComponent {
325
326
  };
326
327
  }
327
328
  }
328
- return this._isValid ? null : err;
329
+ return this.situation === Situation.SEARCH || this._isValid ? null : err;
329
330
  }
330
331
  ngOnInit() {
331
332
  this.rangeForm.valueChanges.subscribe(() => this.onValueChange());
332
333
  }
333
334
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatetimeRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
334
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DatetimeRangeComponent, isStandalone: true, selector: "yuv-datetime-range", inputs: { withTime: "withTime", readonly: "readonly", operator: "operator" }, providers: [
335
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DatetimeRangeComponent, isStandalone: true, selector: "yuv-datetime-range", inputs: { withTime: "withTime", readonly: "readonly", operator: "operator", situation: "situation" }, providers: [
335
336
  {
336
337
  provide: NG_VALUE_ACCESSOR,
337
338
  useExisting: forwardRef(() => DatetimeRangeComponent),
@@ -342,7 +343,7 @@ class DatetimeRangeComponent {
342
343
  useExisting: forwardRef(() => DatetimeRangeComponent),
343
344
  multi: true
344
345
  }
345
- ], ngImport: i0, template: "<form class=\"eo-datetime-range\" [formGroup]=\"rangeForm\">\n @if (searchOption === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n <yvc-dropdown\n [disableClearButton]=\"true\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\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}:host form yuv-datetime{flex:1 1 auto}:host form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i3.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimeComponent, selector: "yuv-datetime", inputs: ["onlyFutureDates", "readonly", "withTime"] }] }); }
346
+ ], ngImport: i0, template: "<form class=\"eo-datetime-range\" [formGroup]=\"rangeForm\">\n @if (searchOption === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n <yvc-dropdown\n [disableClearButton]=\"true\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\n\n <yuv-datetime [withTime]=\"withTime\" formControlName=\"dateValue\"></yuv-datetime>\n</form>\n", styles: [":host form{display:flex;flex-flow:row nowrap;gap:3px}:host form yuv-datetime{flex:1 1 auto}:host form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i1$1.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: DatetimeComponent, selector: "yuv-datetime", inputs: ["onlyFutureDates", "readonly", "withTime"] }] }); }
346
347
  }
347
348
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatetimeRangeComponent, decorators: [{
348
349
  type: Component,
@@ -357,13 +358,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
357
358
  useExisting: forwardRef(() => DatetimeRangeComponent),
358
359
  multi: true
359
360
  }
360
- ], template: "<form class=\"eo-datetime-range\" [formGroup]=\"rangeForm\">\n @if (searchOption === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n <yvc-dropdown\n [disableClearButton]=\"true\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\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}:host form yuv-datetime{flex:1 1 auto}:host form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"] }]
361
+ ], template: "<form class=\"eo-datetime-range\" [formGroup]=\"rangeForm\">\n @if (searchOption === 'gtelte') {\n <yuv-datetime [withTime]=\"withTime\" formControlName=\"dateValueFrom\"></yuv-datetime>\n }\n <yvc-dropdown\n [disableClearButton]=\"true\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\n\n <yuv-datetime [withTime]=\"withTime\" formControlName=\"dateValue\"></yuv-datetime>\n</form>\n", styles: [":host form{display:flex;flex-flow:row nowrap;gap:3px}:host form yuv-datetime{flex:1 1 auto}:host form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"] }]
361
362
  }], propDecorators: { withTime: [{
362
363
  type: Input
363
364
  }], readonly: [{
364
365
  type: Input
365
366
  }], operator: [{
366
367
  type: Input
368
+ }], situation: [{
369
+ type: Input
367
370
  }] } });
368
371
 
369
372
  /**
@@ -520,7 +523,7 @@ class NumberComponent {
520
523
  useExisting: forwardRef(() => NumberComponent),
521
524
  multi: true
522
525
  }
523
- ], ngImport: i0, template: "<input type=\"string\" [(ngModel)]=\"innerValue\" (focus)=\"unformat()\" (blur)=\"format()\" class=\"input-number\"\n [readonly]=\"readonly\" (ngModelChange)=\"onValueChange($event)\" />\n", styles: [":host{display:block}:host input{width:100%;border:0;background-color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
526
+ ], ngImport: i0, template: "<input type=\"string\" [(ngModel)]=\"innerValue\" (focus)=\"unformat()\" (blur)=\"format()\" class=\"input-number\"\n [readonly]=\"readonly\" (ngModelChange)=\"onValueChange($event)\" />\n", styles: [":host{display:flex}:host input{width:100%;border:0;background-color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
524
527
  }
525
528
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NumberComponent, decorators: [{
526
529
  type: Component,
@@ -535,7 +538,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
535
538
  useExisting: forwardRef(() => NumberComponent),
536
539
  multi: true
537
540
  }
538
- ], template: "<input type=\"string\" [(ngModel)]=\"innerValue\" (focus)=\"unformat()\" (blur)=\"format()\" class=\"input-number\"\n [readonly]=\"readonly\" (ngModelChange)=\"onValueChange($event)\" />\n", styles: [":host{display:block}:host input{width:100%;border:0;background-color:transparent}\n"] }]
541
+ ], template: "<input type=\"string\" [(ngModel)]=\"innerValue\" (focus)=\"unformat()\" (blur)=\"format()\" class=\"input-number\"\n [readonly]=\"readonly\" (ngModelChange)=\"onValueChange($event)\" />\n", styles: [":host{display:flex}:host input{width:100%;border:0;background-color:transparent}\n"] }]
539
542
  }], ctorParameters: () => [{ type: i1.TranslateService }], propDecorators: { scale: [{
540
543
  type: Input
541
544
  }], precision: [{
@@ -687,7 +690,7 @@ class NumberRangeComponent {
687
690
  useExisting: forwardRef(() => NumberRangeComponent),
688
691
  multi: true
689
692
  }
690
- ], ngImport: i0, template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if(searchOption === '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 <yvc-dropdown\n class=\"no-trigger\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [disabled]=\"readonly\"\n [disableClearButton]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\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{display:block}:host>form{display:flex;align-items:center}:host>form yuv-number{flex:1 1 auto}:host>form yuv-number.first ::ng-deep .input-number{text-align:right}:host>form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host>form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: NumberComponent, selector: "yuv-number", inputs: ["scale", "precision", "grouping", "groupPattern", "readonly", "minValue", "maxValue", "classifications"] }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i3.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
693
+ ], ngImport: i0, template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if(searchOption === '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 <yvc-dropdown\n class=\"no-trigger\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [disabled]=\"readonly\"\n [disableClearButton]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\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:flex;flex-flow:row nowrap;gap:3px}:host>form yuv-number{flex:1 1 auto}:host>form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host>form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: NumberComponent, selector: "yuv-number", inputs: ["scale", "precision", "grouping", "groupPattern", "readonly", "minValue", "maxValue", "classifications"] }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i1$1.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
691
694
  }
692
695
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NumberRangeComponent, decorators: [{
693
696
  type: Component,
@@ -702,7 +705,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
702
705
  useExisting: forwardRef(() => NumberRangeComponent),
703
706
  multi: true
704
707
  }
705
- ], template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if(searchOption === '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 <yvc-dropdown\n class=\"no-trigger\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [disabled]=\"readonly\"\n [disableClearButton]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\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{display:block}:host>form{display:flex;align-items:center}:host>form yuv-number{flex:1 1 auto}:host>form yuv-number.first ::ng-deep .input-number{text-align:right}:host>form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host>form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"] }]
708
+ ], template: "<form class=\"yuv-number-range\" [formGroup]=\"rangeForm\">\n @if(searchOption === '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 <yvc-dropdown\n class=\"no-trigger\"\n [(ngModel)]=\"searchOption\"\n (ngModelChange)=\"onValueChange()\"\n [disabled]=\"readonly\"\n [disableClearButton]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n [options]=\"availableSearchOptions\"\n ></yvc-dropdown>\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:flex;flex-flow:row nowrap;gap:3px}:host>form yuv-number{flex:1 1 auto}:host>form yvc-dropdown{--yvc-form-element-border-color: var(--text-color-hint);--yvc-form-element-focus-border-color: var(--color-accent);padding:0;min-width:auto;border-radius:2px;background-color:var(--list-item-hover-background)}:host>form yvc-dropdown:hover{background-color:var(--list-item-selected-background)}\n"] }]
706
709
  }], ctorParameters: () => [], propDecorators: { scale: [{
707
710
  type: Input
708
711
  }], precision: [{
@@ -930,7 +933,7 @@ class OrganizationComponent {
930
933
  useExisting: forwardRef(() => OrganizationComponent),
931
934
  multi: true
932
935
  }
933
- ], viewQueries: [{ propertyName: "autoCompleteInput", first: true, predicate: ["autocomplete"], descendants: true }], ngImport: i0, template: "<yvc-autocomplete\n [(ngModel)]=\"innerValue\"\n #autocomplete\n (suggestionSelect)=\"onSelect()\"\n [placeholder]=\"placeholder\"\n (suggestionUnselect)=\"onUnselect($event)\"\n (blur)=\"onAutoCompleteBlur()\"\n [disabled]=\"readonly\"\n [autocompleteValues]=\"autocompleteRes\"\n field=\"id\"\n [forceSelection]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #autocompleteOptionTemplate let-item>\n <span class=\"chip\">{{ item.title }}</span>\n </ng-template>\n \n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\">{{ item.title }}</span>\n </ng-template>\n</yvc-autocomplete>\n\n<yvc-icon\n class=\"classify\"\n [title]=\"'yuv.form.element.organization.classify.icon.title' | translate\"\n [svg]=\"multiselect ? icons.organizationMulti : icons.organization\"\n (click)=\"focusInput()\"\n></yvc-icon>\n", styles: [":host{display:flex;align-items:center}:host ::ng-deep .chip{--yvc-form-element-border-color: var(--text-color-hint)}:host yvc-autocomplete{flex:1;--yvc-form-element-focus-border-color: transparent;--yvc-form-element-focus-outline-color: transparent}:host yvc-icon.classify{width:18px;height:18px;padding:calc(var(--app-pane-padding) / 8);color:var(--text-color-hint)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: YvcAutocompleteModule }, { kind: "component", type: i2$2.AutoComplete, selector: "yvc-autocomplete", inputs: ["field", "placeholder", "minLength", "multiple", "typeahead", "distinctValues", "forceSelection", "autocompleteValues", "disabled"], outputs: ["autocompleteFnc", "blur", "focus", "suggestionUnselect", "suggestionSelect"] }, { kind: "ngmodule", type: YvcIconModule }, { kind: "component", type: i3$1.Icon, selector: "yvc-icon", inputs: ["label", "svg", "svgSrc"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
936
+ ], viewQueries: [{ propertyName: "autoCompleteInput", first: true, predicate: ["autocomplete"], descendants: true }], ngImport: i0, template: "<yvc-autocomplete\n [(ngModel)]=\"innerValue\"\n #autocomplete\n (suggestionSelect)=\"onSelect()\"\n [placeholder]=\"placeholder\"\n (suggestionUnselect)=\"onUnselect($event)\"\n (blur)=\"onAutoCompleteBlur()\"\n [disabled]=\"readonly\"\n [autocompleteValues]=\"autocompleteRes\"\n field=\"id\"\n [forceSelection]=\"true\"\n (autocompleteFnc)=\"autocompleteFn($event)\"\n [multiple]=\"true\"\n>\n <!-- template for item inside the dropdown -->\n <ng-template #autocompleteOptionTemplate let-item>\n <span class=\"chip\">{{ item.title }}</span>\n </ng-template>\n \n <!-- template for chip -->\n <ng-template #chipTemplate let-item>\n <span class=\"chip\">{{ item.title }}</span>\n </ng-template>\n</yvc-autocomplete>\n\n<yvc-icon\n class=\"classify\"\n [title]=\"'yuv.form.element.organization.classify.icon.title' | translate\"\n [svg]=\"multiselect ? icons.organizationMulti : icons.organization\"\n (click)=\"focusInput()\"\n></yvc-icon>\n", styles: [":host{display:flex;align-items:center}:host ::ng-deep .chip{--yvc-form-element-border-color: var(--text-color-hint)}:host yvc-autocomplete{flex:1;--yvc-form-element-focus-border-color: transparent;--yvc-form-element-focus-outline-color: transparent}:host yvc-icon.classify{width:18px;height:18px;padding:calc(var(--app-pane-padding) / 8);color:var(--text-color-hint)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: YvcAutocompleteModule }, { kind: "component", type: i2$2.AutoComplete, selector: "yvc-autocomplete", inputs: ["field", "placeholder", "minLength", "multiple", "typeahead", "distinctValues", "forceSelection", "autocompleteValues", "disabled"], outputs: ["autocompleteFnc", "blur", "focus", "suggestionUnselect", "suggestionSelect"] }, { kind: "ngmodule", type: YvcIconModule }, { kind: "component", type: i3.Icon, selector: "yvc-icon", inputs: ["label", "svg", "svgSrc"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
934
937
  }
935
938
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OrganizationComponent, decorators: [{
936
939
  type: Component,
@@ -1055,6 +1058,9 @@ class StringComponent {
1055
1058
  this.propagateChange(this.value);
1056
1059
  }
1057
1060
  writeValue(value) {
1061
+ if (Array.isArray(value)) {
1062
+ value = value.filter((v) => typeof v === 'string' && v.trim().length > 0);
1063
+ }
1058
1064
  this.formatedValue = Utils.formatMailTo(value, this.classify?.hrefPrefix === ClassificationPrefix.EMAIL);
1059
1065
  this.value = value || null;
1060
1066
  }
@@ -1103,6 +1109,10 @@ class StringComponent {
1103
1109
  this.propagate();
1104
1110
  }
1105
1111
  onBlur() {
1112
+ if (this.multiselect) {
1113
+ // add on blur
1114
+ this.value.push('');
1115
+ }
1106
1116
  if (this.trimValue()) {
1107
1117
  this.propagate();
1108
1118
  }
@@ -1178,7 +1188,7 @@ class StringComponent {
1178
1188
  useExisting: forwardRef(() => StringComponent),
1179
1189
  multi: true
1180
1190
  }
1181
- ], ngImport: i0, template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input type=\"text\" (blur)=\"onBlur()\" [readonly]=\"readonly\" [(ngModel)]=\"value\" (ngModelChange)=\"onValueChange($event)\" />\n}\n@else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <yvc-chips\n [(ngModel)]=\"value\"\n [disabled]=\"readonly\"\n [max]=\"maxEntryCountIfInvalid\"\n (onBlur)=\"onBlur()\"\n (ngModelChange)=\"onValueChange($event)\"\n [ngClass]=\"{ invalid: validationErrors.length }\"\n >\n <ng-template let-item #chipTemplate>\n <span class=\"p-autocomplete-token-label\">\n @if (classify && !validationErrors.length) {\n <div class=\"classify inchip\">\n <a href=\"{{ classify.hrefPrefix + item }}\">\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n </div>\n }\n <div class=\"label\">\n {{ item }}\n </div>\n </span>\n </ng-template>\n </yvc-chips>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n class=\"input-textarea\"\n pInputTextarea\n (blur)=\"onBlur()\"\n [(ngModel)]=\"value\"\n [rows]=\"rows\"\n [readonly]=\"readonly\"\n (ngModelChange)=\"onValueChange($event)\"\n ></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 <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n } @else {\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n }\n </div>\n}\n", styles: [":host{font-family:Roboto;display:flex;flex-flow:row nowrap;align-items:center}:host .p-autocomplete-token-label{display:flex;align-items:center;-webkit-user-select:text;user-select:text}:host .p-autocomplete-token-label .label{padding:0 calc(var(--app-pane-padding) / 4);word-break:break-word}:host .classify{color:var(--text-color-hint)}:host .classify a{color:var(--text-color-hint);display:block;border-radius:2px}:host .classify a:hover,:host .classify a:focus{background-color:var(--color-accent);color:#fff}:host .classify yvc-icon{width:18px;height:18px;padding:calc(var(--app-pane-padding) / 8)}:host textarea.input-textarea{width:100%;resize:vertical;background-color:transparent;color:var(--text-color-body);border:1px solid var(--yvc-form-element-border-color)}:host yvc-chips{width:100%}:host input{color:var(--text-color-body);padding:0;border:1px solid var(--yvc-form-element-border-color);display:flex;flex-wrap:wrap;align-items:center;width:100%;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: YvcChipsModule }, { kind: "component", type: i2$3.Chips, selector: "yvc-chips", inputs: ["field", "placeholder", "max", "disabled"] }, { kind: "ngmodule", type: YvcIconModule }, { kind: "component", type: i3$1.Icon, selector: "yvc-icon", inputs: ["label", "svg", "svgSrc"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1191
+ ], ngImport: i0, template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input type=\"text\" (blur)=\"onBlur()\" [readonly]=\"readonly\" [(ngModel)]=\"value\" (ngModelChange)=\"onValueChange($event)\" />\n}\n@else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <yvc-chips\n [(ngModel)]=\"value\"\n [disabled]=\"readonly\"\n [max]=\"maxEntryCountIfInvalid\"\n [addOnBlur]=\"true\"\n (onBlur)=\"onBlur()\"\n (ngModelChange)=\"onValueChange($event)\"\n [ngClass]=\"{ invalid: validationErrors.length }\"\n >\n <ng-template let-item #chipTemplate>\n <span class=\"p-autocomplete-token-label\">\n @if (classify && !validationErrors.length) {\n <div class=\"classify inchip\">\n <a href=\"{{ classify.hrefPrefix + item }}\">\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n </div>\n }\n <div class=\"label\">\n {{ item }}\n </div>\n </span>\n </ng-template>\n </yvc-chips>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n class=\"input-textarea\"\n pInputTextarea\n (blur)=\"onBlur()\"\n [(ngModel)]=\"value\"\n [rows]=\"rows\"\n [readonly]=\"readonly\"\n (ngModelChange)=\"onValueChange($event)\"\n ></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 <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n } @else {\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;align-items:center}:host .yvc-chips-list li.chip{--yvc-form-element-border-color: var(--text-color-hint)}:host .classify{color:var(--text-color-hint)}:host .classify a{color:var(--text-color-hint);display:block;border-radius:2px}:host .classify a:hover,:host .classify a:focus{background-color:var(--color-accent);color:#fff}:host .classify yvc-icon{width:18px;height:18px;padding:calc(var(--app-pane-padding) / 8)}:host textarea.input-textarea{width:100%;resize:vertical;background-color:transparent;color:var(--text-color-body);border:1px solid var(--yvc-form-element-border-color)}:host yvc-chips{width:100%}:host input{color:var(--text-color-body);padding:0;border:1px solid var(--yvc-form-element-border-color);display:flex;flex-wrap:wrap;align-items:center;width:100%;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: YvcChipsModule }, { kind: "component", type: i2$3.Chips, selector: "yvc-chips", inputs: ["field", "placeholder", "max", "disabled", "addOnBlur"] }, { kind: "ngmodule", type: YvcIconModule }, { kind: "component", type: i3.Icon, selector: "yvc-icon", inputs: ["label", "svg", "svgSrc"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1182
1192
  }
1183
1193
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StringComponent, decorators: [{
1184
1194
  type: Component,
@@ -1193,7 +1203,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1193
1203
  useExisting: forwardRef(() => StringComponent),
1194
1204
  multi: true
1195
1205
  }
1196
- ], template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input type=\"text\" (blur)=\"onBlur()\" [readonly]=\"readonly\" [(ngModel)]=\"value\" (ngModelChange)=\"onValueChange($event)\" />\n}\n@else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <yvc-chips\n [(ngModel)]=\"value\"\n [disabled]=\"readonly\"\n [max]=\"maxEntryCountIfInvalid\"\n (onBlur)=\"onBlur()\"\n (ngModelChange)=\"onValueChange($event)\"\n [ngClass]=\"{ invalid: validationErrors.length }\"\n >\n <ng-template let-item #chipTemplate>\n <span class=\"p-autocomplete-token-label\">\n @if (classify && !validationErrors.length) {\n <div class=\"classify inchip\">\n <a href=\"{{ classify.hrefPrefix + item }}\">\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n </div>\n }\n <div class=\"label\">\n {{ item }}\n </div>\n </span>\n </ng-template>\n </yvc-chips>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n class=\"input-textarea\"\n pInputTextarea\n (blur)=\"onBlur()\"\n [(ngModel)]=\"value\"\n [rows]=\"rows\"\n [readonly]=\"readonly\"\n (ngModelChange)=\"onValueChange($event)\"\n ></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 <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n } @else {\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n }\n </div>\n}\n", styles: [":host{font-family:Roboto;display:flex;flex-flow:row nowrap;align-items:center}:host .p-autocomplete-token-label{display:flex;align-items:center;-webkit-user-select:text;user-select:text}:host .p-autocomplete-token-label .label{padding:0 calc(var(--app-pane-padding) / 4);word-break:break-word}:host .classify{color:var(--text-color-hint)}:host .classify a{color:var(--text-color-hint);display:block;border-radius:2px}:host .classify a:hover,:host .classify a:focus{background-color:var(--color-accent);color:#fff}:host .classify yvc-icon{width:18px;height:18px;padding:calc(var(--app-pane-padding) / 8)}:host textarea.input-textarea{width:100%;resize:vertical;background-color:transparent;color:var(--text-color-body);border:1px solid var(--yvc-form-element-border-color)}:host yvc-chips{width:100%}:host input{color:var(--text-color-body);padding:0;border:1px solid var(--yvc-form-element-border-color);display:flex;flex-wrap:wrap;align-items:center;width:100%;background:transparent}\n"] }]
1206
+ ], template: "@if ((!rows || rows <= 1) && !multiselect) {\n <input type=\"text\" (blur)=\"onBlur()\" [readonly]=\"readonly\" [(ngModel)]=\"value\" (ngModelChange)=\"onValueChange($event)\" />\n}\n@else if ((!rows || rows <= 1) && multiselect) {\n <!-- single line input with multiselect-->\n <yvc-chips\n [(ngModel)]=\"value\"\n [disabled]=\"readonly\"\n [max]=\"maxEntryCountIfInvalid\"\n [addOnBlur]=\"true\"\n (onBlur)=\"onBlur()\"\n (ngModelChange)=\"onValueChange($event)\"\n [ngClass]=\"{ invalid: validationErrors.length }\"\n >\n <ng-template let-item #chipTemplate>\n <span class=\"p-autocomplete-token-label\">\n @if (classify && !validationErrors.length) {\n <div class=\"classify inchip\">\n <a href=\"{{ classify.hrefPrefix + item }}\">\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n </div>\n }\n <div class=\"label\">\n {{ item }}\n </div>\n </span>\n </ng-template>\n </yvc-chips>\n} @else if (rows && rows > 1) {\n <!-- multi line text inputs -->\n <textarea\n class=\"input-textarea\"\n pInputTextarea\n (blur)=\"onBlur()\"\n [(ngModel)]=\"value\"\n [rows]=\"rows\"\n [readonly]=\"readonly\"\n (ngModelChange)=\"onValueChange($event)\"\n ></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 <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n </a>\n } @else {\n <yvc-icon [svg]=\"classify.icon!\"></yvc-icon>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-flow:row nowrap;align-items:center}:host .yvc-chips-list li.chip{--yvc-form-element-border-color: var(--text-color-hint)}:host .classify{color:var(--text-color-hint)}:host .classify a{color:var(--text-color-hint);display:block;border-radius:2px}:host .classify a:hover,:host .classify a:focus{background-color:var(--color-accent);color:#fff}:host .classify yvc-icon{width:18px;height:18px;padding:calc(var(--app-pane-padding) / 8)}:host textarea.input-textarea{width:100%;resize:vertical;background-color:transparent;color:var(--text-color-body);border:1px solid var(--yvc-form-element-border-color)}:host yvc-chips{width:100%}:host input{color:var(--text-color-body);padding:0;border:1px solid var(--yvc-form-element-border-color);display:flex;flex-wrap:wrap;align-items:center;width:100%;background:transparent}\n"] }]
1197
1207
  }], propDecorators: { fe: [{
1198
1208
  type: HostBinding,
1199
1209
  args: ['class.yvc-form-element']
@@ -1347,9 +1357,294 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1347
1357
  }]
1348
1358
  }] });
1349
1359
 
1360
+ class DateRangePickerComponent {
1361
+ constructor() {
1362
+ this.#oRef = inject(YvcOverlayRef);
1363
+ this.#fb = inject(FormBuilder);
1364
+ this.form = this.#fb.group({
1365
+ range: this.#fb.control(this.#oRef.data.range, Validators.required)
1366
+ });
1367
+ this.range = input(this.#oRef.data.range);
1368
+ this.rangeChange = output();
1369
+ this.#rangeEffect = effect(() => {
1370
+ const range = this.range();
1371
+ this.form.patchValue({ range });
1372
+ });
1373
+ }
1374
+ #oRef;
1375
+ #fb;
1376
+ #rangeEffect;
1377
+ apply() {
1378
+ this.rangeChange.emit(this.form.value.range || undefined);
1379
+ this.#oRef?.close(this.form.value.range);
1380
+ }
1381
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1382
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", 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: "<form [formGroup]=\"form\" (ngSubmit)=\"apply()\">\n <h2>{{ 'yuv.form.element.range-select-date.custom.overlay.title' | translate }}</h2>\n <yuv-datetime-range [withTime]=\"false\" formControlName=\"range\"></yuv-datetime-range>\n <button class=\"primary\" [disabled]=\"form.invalid\">{{ 'yuv.form.element.range-select-date.custom.overlay.button.apply' | translate }}</button>\n</form>\n", styles: [":host{--form-element-border-color: transparent;--yvc-form-element-border-color: transparent}: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(--app-pane-padding);padding:var(--app-pane-padding)}:host form h2{grid-area:title;margin:0}:host form yuv-datetime-range{grid-area:input;border:1px solid var(--text-color-hint);padding:1px 2px;border-radius:2px}:host form button{grid-area:button}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: DatetimeRangeComponent, selector: "yuv-datetime-range", inputs: ["withTime", "readonly", "operator", "situation"] }] }); }
1383
+ }
1384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateRangePickerComponent, decorators: [{
1385
+ type: Component,
1386
+ args: [{ selector: 'yuv-date-range-picker', standalone: true, imports: [CommonModule, ReactiveFormsModule, TranslateModule, DatetimeRangeComponent], template: "<form [formGroup]=\"form\" (ngSubmit)=\"apply()\">\n <h2>{{ 'yuv.form.element.range-select-date.custom.overlay.title' | translate }}</h2>\n <yuv-datetime-range [withTime]=\"false\" formControlName=\"range\"></yuv-datetime-range>\n <button class=\"primary\" [disabled]=\"form.invalid\">{{ 'yuv.form.element.range-select-date.custom.overlay.button.apply' | translate }}</button>\n</form>\n", styles: [":host{--form-element-border-color: transparent;--yvc-form-element-border-color: transparent}: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(--app-pane-padding);padding:var(--app-pane-padding)}:host form h2{grid-area:title;margin:0}:host form yuv-datetime-range{grid-area:input;border:1px solid var(--text-color-hint);padding:1px 2px;border-radius:2px}:host form button{grid-area:button}\n"] }]
1387
+ }] });
1388
+
1389
+ // marker for extracting translations for the available date range options
1390
+ marker('yuv.form.element.range-select-date.option.any');
1391
+ marker('yuv.form.element.range-select-date.option.today');
1392
+ marker('yuv.form.element.range-select-date.option.yesterday');
1393
+ marker('yuv.form.element.range-select-date.option.thisWeek');
1394
+ marker('yuv.form.element.range-select-date.option.lastWeek');
1395
+ marker('yuv.form.element.range-select-date.option.thisMonth');
1396
+ marker('yuv.form.element.range-select-date.option.lastMonth');
1397
+ marker('yuv.form.element.range-select-date.option.thisYear');
1398
+ marker('yuv.form.element.range-select-date.option.lastYear');
1399
+ marker('yuv.form.element.range-select-date.option.custom');
1400
+ /**
1401
+ * Component for selecting a date range based on pre-defined ranges like
1402
+ * 'today', 'this week', 'this month', etc.
1403
+ * It also allows to pick a custom date range.
1404
+ */
1405
+ class RangeSelectDateComponent {
1406
+ #overlay;
1407
+ #fb;
1408
+ #ANY_OPTION;
1409
+ #CUSTOM_OPTION;
1410
+ #customDateRange;
1411
+ constructor() {
1412
+ this.translate = inject(TranslateService$1);
1413
+ this.#overlay = inject(YvcOverlayService);
1414
+ this.#fb = inject(FormBuilder);
1415
+ this.#ANY_OPTION = 'any';
1416
+ this.#CUSTOM_OPTION = 'custom';
1417
+ this.dateOptions = signal([]);
1418
+ this.innerForm = this.#fb.nonNullable.group({
1419
+ range: [this.#ANY_OPTION]
1420
+ });
1421
+ /**
1422
+ * Range values to be used in the dropdown.
1423
+ */
1424
+ this.ranges = input(['today', 'yesterday', 'thisWeek', 'thisMonth', 'thisYear']);
1425
+ /**
1426
+ * Whether to show the custom date range option.
1427
+ */
1428
+ this.customRange = input(true);
1429
+ // ControlValueAccessor implementation
1430
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1431
+ this.propagateChange = (_) => { };
1432
+ this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe((_) => this.#setupOptions());
1433
+ this.#setupOptions();
1434
+ this.innerForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((v) => this.#onFormValueChange(v));
1435
+ }
1436
+ #onFormValueChange(v) {
1437
+ if (v.range === this.#CUSTOM_OPTION) {
1438
+ if (!this.#customDateRange || this.dateOptions().find((o) => o.value === this.#CUSTOM_OPTION)?.label === this.#customDateRangeToString())
1439
+ this.#openCustomRangeDialog();
1440
+ else
1441
+ this.propagateChange({
1442
+ rangeValue: this.#customDateRange,
1443
+ label: this.#customDateRangeToString()
1444
+ });
1445
+ }
1446
+ else {
1447
+ const { start, end } = SearchUtils.dateRangeStartEnd(v.range);
1448
+ this.propagateChange(v.range !== this.#ANY_OPTION
1449
+ ? {
1450
+ rangeValue: { operator: Operator.INTERVAL_INCLUDE_BOTH, firstValue: start, secondValue: end },
1451
+ label: this.translate.instant(`yuv.form.element.range-select-date.option.${v.range}`)
1452
+ }
1453
+ : undefined);
1454
+ this.#customDateRange = undefined;
1455
+ this.#setupOptions();
1456
+ }
1457
+ }
1458
+ #openCustomRangeDialog() {
1459
+ // open date range picker
1460
+ const o = this.#overlay.open(DateRangePickerComponent, {
1461
+ range: this.#customDateRange
1462
+ });
1463
+ o.afterClosed$.subscribe((res) => {
1464
+ this.#customDateRange = res.data;
1465
+ if (!res.data) {
1466
+ this.innerForm.patchValue({ range: this.#ANY_OPTION });
1467
+ this.#setupOptions();
1468
+ }
1469
+ else {
1470
+ this.#onFormValueChange(this.innerForm.value);
1471
+ this.#setupOptions(this.#customDateRangeToString());
1472
+ setTimeout(() => {
1473
+ this.innerForm.patchValue({ range: this.#CUSTOM_OPTION }, {
1474
+ emitEvent: false
1475
+ });
1476
+ });
1477
+ }
1478
+ });
1479
+ }
1480
+ #setupOptions(custom) {
1481
+ const options = this.ranges().map((value) => ({
1482
+ label: this.translate.instant(`yuv.form.element.range-select-date.option.${value}`),
1483
+ value
1484
+ }));
1485
+ if (this.customRange())
1486
+ options.push({
1487
+ label: custom || this.translate.instant('yuv.form.element.range-select-date.option.custom'),
1488
+ value: this.#CUSTOM_OPTION
1489
+ });
1490
+ this.dateOptions.set([
1491
+ {
1492
+ label: this.translate.instant('yuv.form.element.range-select-date.option.any'),
1493
+ value: this.#ANY_OPTION
1494
+ },
1495
+ ...options
1496
+ ]);
1497
+ }
1498
+ #customDateRangeToString() {
1499
+ if (!this.#customDateRange)
1500
+ return undefined;
1501
+ const dp = new LocaleDatePipe(this.translate);
1502
+ switch (this.#customDateRange.operator) {
1503
+ case Operator.EQUAL: {
1504
+ return dp.transform(this.#customDateRange.firstValue, 'shortDate');
1505
+ }
1506
+ case Operator.GREATER_OR_EQUAL: {
1507
+ return `${OperatorLabel.GREATER_OR_EQUAL} ${dp.transform(this.#customDateRange.firstValue, 'shortDate')}`;
1508
+ }
1509
+ case Operator.LESS_OR_EQUAL: {
1510
+ return `${OperatorLabel.LESS_OR_EQUAL} ${dp.transform(this.#customDateRange.firstValue, 'shortDate')}`;
1511
+ }
1512
+ case Operator.INTERVAL_INCLUDE_BOTH: {
1513
+ return `${dp.transform(this.#customDateRange.firstValue, 'shortDate')} ${OperatorLabel.INTERVAL_INCLUDE_BOTH} ${dp.transform(this.#customDateRange.secondValue, 'shortDate')}`;
1514
+ }
1515
+ }
1516
+ return undefined;
1517
+ }
1518
+ writeValue(value) {
1519
+ if (value?.rangeValue?.operator && value?.rangeValue?.firstValue) {
1520
+ const dr = SearchUtils.getMatchingDateRange(value.rangeValue);
1521
+ if (dr) {
1522
+ this.innerForm.patchValue({ range: dr });
1523
+ }
1524
+ else {
1525
+ this.#customDateRange = value.rangeValue;
1526
+ this.innerForm.patchValue({ range: this.#CUSTOM_OPTION });
1527
+ }
1528
+ }
1529
+ else {
1530
+ this.innerForm.patchValue({ range: this.#ANY_OPTION });
1531
+ }
1532
+ }
1533
+ registerOnChange(fn) {
1534
+ this.propagateChange = fn;
1535
+ }
1536
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1537
+ registerOnTouched(fn) { }
1538
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RangeSelectDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1539
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", 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: [
1540
+ {
1541
+ provide: NG_VALUE_ACCESSOR,
1542
+ useExisting: forwardRef(() => RangeSelectDateComponent),
1543
+ multi: true
1544
+ }
1545
+ ], ngImport: i0, template: "<form [formGroup]=\"innerForm\">\n <yvc-dropdown formControlName=\"range\" [options]=\"dateOptions()\" [disableClearButton]=\"true\"></yvc-dropdown>\n</form>", styles: [":host form{display:flex}:host form yvc-dropdown{flex:1;outline-offset:0px;color:currentColor}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i1$1.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
1546
+ }
1547
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RangeSelectDateComponent, decorators: [{
1548
+ type: Component,
1549
+ args: [{ selector: 'yuv-range-select-date', standalone: true, imports: [CommonModule, YvcDropdownModule, ReactiveFormsModule], providers: [
1550
+ {
1551
+ provide: NG_VALUE_ACCESSOR,
1552
+ useExisting: forwardRef(() => RangeSelectDateComponent),
1553
+ multi: true
1554
+ }
1555
+ ], template: "<form [formGroup]=\"innerForm\">\n <yvc-dropdown formControlName=\"range\" [options]=\"dateOptions()\" [disableClearButton]=\"true\"></yvc-dropdown>\n</form>", styles: [":host form{display:flex}:host form yvc-dropdown{flex:1;outline-offset:0px;color:currentColor}\n"] }]
1556
+ }], ctorParameters: () => [] });
1557
+
1558
+ // marker for extracting translations for the available filesize range options
1559
+ marker('yuv.form.element.range-select-filesize.option.any');
1560
+ marker('yuv.form.element.range-select-filesize.option.small');
1561
+ marker('yuv.form.element.range-select-filesize.option.medium');
1562
+ marker('yuv.form.element.range-select-filesize.option.large');
1563
+ marker('yuv.form.element.range-select-filesize.option.verylarge');
1564
+ /**
1565
+ * Component for selecting a range of filesizes based on pre-defined ranges like
1566
+ * 'today', 'this week', 'this month', etc.
1567
+ */
1568
+ class RangeSelectFilesizeComponent {
1569
+ #fb;
1570
+ #ANY_OPTION;
1571
+ constructor() {
1572
+ this.translate = inject(TranslateService);
1573
+ this.#fb = inject(FormBuilder);
1574
+ this.#ANY_OPTION = 'any';
1575
+ this.options = signal([]);
1576
+ this.innerForm = this.#fb.nonNullable.group({
1577
+ range: [this.#ANY_OPTION]
1578
+ });
1579
+ /**
1580
+ * Range values to be used in the dropdown.
1581
+ */
1582
+ this.ranges = input(['small', 'medium', 'large', 'verylarge']);
1583
+ // ControlValueAccessor implementation
1584
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1585
+ this.propagateChange = (_) => { };
1586
+ this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe((_) => this.#setupOptions());
1587
+ this.#setupOptions();
1588
+ this.innerForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((v) => this.#onFormValueChange(v));
1589
+ }
1590
+ #onFormValueChange(v) {
1591
+ const rangeValue = v.range !== this.#ANY_OPTION ? SearchUtils.filesizeRangeToRangeValue(v.range) : undefined;
1592
+ const res = rangeValue && {
1593
+ rangeValue,
1594
+ label: this.translate.instant(`yuv.form.element.range-select-filesize.option.${v.range}`)
1595
+ };
1596
+ this.propagateChange(res);
1597
+ }
1598
+ #setupOptions() {
1599
+ const options = this.ranges().map((value) => ({
1600
+ label: this.translate.instant(`yuv.form.element.range-select-filesize.option.${value}`),
1601
+ value
1602
+ }));
1603
+ this.options.set([
1604
+ {
1605
+ label: this.translate.instant('yuv.form.element.range-select-filesize.option.any'),
1606
+ value: this.#ANY_OPTION
1607
+ },
1608
+ ...options
1609
+ ]);
1610
+ }
1611
+ writeValue(value) {
1612
+ const patch = { range: this.#ANY_OPTION };
1613
+ if (value?.rangeValue?.operator && value?.rangeValue?.firstValue) {
1614
+ const range = SearchUtils.getMatchingFilesizeRange(value.rangeValue);
1615
+ if (range)
1616
+ patch.range = range;
1617
+ }
1618
+ this.innerForm.patchValue(patch);
1619
+ }
1620
+ registerOnChange(fn) {
1621
+ this.propagateChange = fn;
1622
+ }
1623
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1624
+ registerOnTouched(fn) { }
1625
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RangeSelectFilesizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1626
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: RangeSelectFilesizeComponent, isStandalone: true, selector: "yuv-range-select-filesize", inputs: { ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
1627
+ {
1628
+ provide: NG_VALUE_ACCESSOR,
1629
+ useExisting: forwardRef(() => RangeSelectFilesizeComponent),
1630
+ multi: true
1631
+ }
1632
+ ], ngImport: i0, template: "<form [formGroup]=\"innerForm\">\n <yvc-dropdown formControlName=\"range\" [options]=\"options()\" [disableClearButton]=\"true\"></yvc-dropdown>\n</form>\n", styles: [":host form{display:flex}:host form yvc-dropdown{flex:1;outline-offset:0px;color:currentColor}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: YvcDropdownModule }, { kind: "component", type: i1$1.Dropdown, selector: "yvc-dropdown", inputs: ["options", "filter", "disabled", "multiple", "disableClearButton"], outputs: ["onDropdownOptionsClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
1633
+ }
1634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RangeSelectFilesizeComponent, decorators: [{
1635
+ type: Component,
1636
+ args: [{ selector: 'yuv-range-select-filesize', standalone: true, imports: [CommonModule, YvcDropdownModule, ReactiveFormsModule], providers: [
1637
+ {
1638
+ provide: NG_VALUE_ACCESSOR,
1639
+ useExisting: forwardRef(() => RangeSelectFilesizeComponent),
1640
+ multi: true
1641
+ }
1642
+ ], template: "<form [formGroup]=\"innerForm\">\n <yvc-dropdown formControlName=\"range\" [options]=\"options()\" [disableClearButton]=\"true\"></yvc-dropdown>\n</form>\n", styles: [":host form{display:flex}:host form yvc-dropdown{flex:1;outline-offset:0px;color:currentColor}\n"] }]
1643
+ }], ctorParameters: () => [] });
1644
+
1350
1645
  /**
1351
1646
  * Generated bundle index. Do not edit.
1352
1647
  */
1353
1648
 
1354
- export { CatalogComponent, DatetimeComponent, DatetimeRangeComponent, FormInputComponent, NumberComponent, NumberRangeComponent, OrganizationComponent, StringComponent, YuvFormsModule };
1649
+ export { CatalogComponent, DatetimeComponent, DatetimeRangeComponent, FormInputComponent, NumberComponent, NumberRangeComponent, OrganizationComponent, RangeSelectDateComponent, RangeSelectFilesizeComponent, StringComponent, YuvFormsModule };
1355
1650
  //# sourceMappingURL=yuuvis-client-framework-forms.mjs.map