@porscheinformatik/clr-addons 19.0.8 → 19.1.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.
@@ -2450,6 +2450,9 @@ class ClrNumericField {
2450
2450
  this.handleInputChanged();
2451
2451
  }
2452
2452
  }
2453
+ /**
2454
+ * @deprecated Use {@link clrInputSuffix} or {@link clrInputPrefix} from Clarity instead.
2455
+ */
2453
2456
  set unit(value) {
2454
2457
  if (value != this._unit) {
2455
2458
  this._unit = value;
@@ -2481,6 +2484,9 @@ class ClrNumericField {
2481
2484
  this.autofillDecimals = false;
2482
2485
  this.decimalSeparator = ',';
2483
2486
  this.groupingSeparator = '.';
2487
+ /**
2488
+ * @deprecated Use {@link clrInputSuffix} or {@link clrInputPrefix} from Clarity instead.
2489
+ */
2484
2490
  this.unitPosition = 'right';
2485
2491
  this.numericValueChanged = new EventEmitter();
2486
2492
  this.displayValue = '';
@@ -11503,8 +11509,10 @@ class ClrDateFilterComponent {
11503
11509
  }
11504
11510
  this._from = from;
11505
11511
  this.validateDates();
11506
- this._changes.next([this._from, this._to]);
11507
- this.filterValueChange.emit([this._from, this._to]);
11512
+ if (!this.valError) {
11513
+ this._changes.next([this._from, this._to]);
11514
+ this.filterValueChange.emit([this._from, this._to]);
11515
+ }
11508
11516
  }
11509
11517
  }
11510
11518
  set fromTime(fromtime) {
@@ -11534,8 +11542,10 @@ class ClrDateFilterComponent {
11534
11542
  }
11535
11543
  this._to = to;
11536
11544
  this.validateDates();
11537
- this._changes.next([this._from, this._to]);
11538
- this.filterValueChange.emit([this._from, this._to]);
11545
+ if (!this.valError) {
11546
+ this._changes.next([this._from, this._to]);
11547
+ this.filterValueChange.emit([this._from, this._to]);
11548
+ }
11539
11549
  }
11540
11550
  }
11541
11551
  set toTime(totime) {
@@ -11598,11 +11608,11 @@ class ClrDateFilterComponent {
11598
11608
  }
11599
11609
  }
11600
11610
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ClrDateFilterComponent, deps: [{ token: i2.ClrCommonStringsService }, { token: i2.ClrPopoverEventsService }, { token: i2.ClrDatagridFilter }], target: i0.ɵɵFactoryTarget.Component }); }
11601
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: ClrDateFilterComponent, isStandalone: false, selector: "clr-date-filter", inputs: { timeActive: "timeActive", dateValidationError: "dateValidationError", property: ["clrProperty", "property"], maxPlaceholder: ["clrFilterMaxPlaceholder", "maxPlaceholder"], minPlaceholder: ["clrFilterMinPlaceholder", "minPlaceholder"], value: ["clrFilterValue", "value"] }, outputs: { filterValueChange: "clrFilterValueChange" }, ngImport: i0, template: "<button class=\"btn btn-sm btn-icon btn-link btn-trash\" (click)=\"clearFilter()\">\n <cds-icon shape=\"trash\"></cds-icon>\n</button>\n<ng-container *ngIf=\"!timeActive\">\n <clr-date-container class=\"filter-selection\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <clr-date-container class=\"filter-selection\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n</ng-container>\n<ng-container *ngIf=\"timeActive\">\n <clr-date-time-container class=\"filter-selection\">\n <clr-date-container class=\"time-filter-active\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"fromTime\" />\n </clr-date-time-container>\n <clr-date-time-container>\n <clr-date-container class=\"time-filter-active\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"toTime\" />\n </clr-date-time-container>\n <clr-control-error *ngIf=\"valError\"\n >{{ dateValidationError || 'Date \"from\" must be before date \"to\"!' }}\n </clr-control-error>\n</ng-container>\n", styles: [".btn-trash{position:absolute;top:10px;right:40px;padding:0}.time-filter-active{width:12rem;margin-top:.5rem}.time-filter-active-input,.time-filter-input{width:4.5rem!important}.filter-selection{margin-top:.5rem}\n"], dependencies: [{ kind: "directive", type: i2.CdsIconCustomTag, selector: "cds-icon" }, { kind: "component", type: i2.ClrControlError, selector: "clr-control-error" }, { kind: "component", type: i2.ClrDateContainer, selector: "clr-date-container, clr-date-range-container", inputs: ["showActionButtons", "clrPosition", "rangeOptions", "min", "max"] }, { kind: "directive", type: i2.ClrDateInput, selector: "[clrDate]", inputs: ["clrDate", "min", "max"], outputs: ["clrDateChange"] }, { kind: "directive", type: i2.ClrDateInputValidator, selector: "[clrDate], [clrStartDate], [clrEndDate]" }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ClrDateTimeContainer, selector: "clr-date-time-container" }, { kind: "directive", type: ClrTimeInput, selector: "[clrTime]" }] }); }
11611
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: ClrDateFilterComponent, isStandalone: false, selector: "clr-date-filter", inputs: { timeActive: "timeActive", dateValidationError: "dateValidationError", property: ["clrProperty", "property"], maxPlaceholder: ["clrFilterMaxPlaceholder", "maxPlaceholder"], minPlaceholder: ["clrFilterMinPlaceholder", "minPlaceholder"], value: ["clrFilterValue", "value"] }, outputs: { filterValueChange: "clrFilterValueChange" }, ngImport: i0, template: "<button class=\"btn btn-sm btn-icon btn-link btn-trash\" (click)=\"clearFilter()\">\n <cds-icon shape=\"trash\"></cds-icon>\n</button>\n<ng-container *ngIf=\"!timeActive\">\n <clr-date-container class=\"filter-selection\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <clr-date-container class=\"filter-selection\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n <clr-control-error *ngIf=\"valError\"\n >{{ dateValidationError || 'Date \"from\" must be before date \"to\"!' }}\n </clr-control-error>\n</ng-container>\n<ng-container *ngIf=\"timeActive\">\n <clr-date-time-container class=\"filter-selection\">\n <clr-date-container class=\"time-filter-active\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"fromTime\" />\n </clr-date-time-container>\n <clr-date-time-container>\n <clr-date-container class=\"time-filter-active\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"toTime\" />\n </clr-date-time-container>\n <clr-control-error *ngIf=\"valError\"\n >{{ dateValidationError || 'Date \"from\" must be before date \"to\"!' }}\n </clr-control-error>\n</ng-container>\n", styles: [".btn-trash{position:absolute;top:10px;right:40px;padding:0}.time-filter-active{width:12rem;margin-top:.5rem}.time-filter-active-input,.time-filter-input{width:4.5rem!important}.filter-selection{margin-top:.5rem}\n"], dependencies: [{ kind: "directive", type: i2.CdsIconCustomTag, selector: "cds-icon" }, { kind: "component", type: i2.ClrControlError, selector: "clr-control-error" }, { kind: "component", type: i2.ClrDateContainer, selector: "clr-date-container, clr-date-range-container", inputs: ["showActionButtons", "clrPosition", "rangeOptions", "min", "max"] }, { kind: "directive", type: i2.ClrDateInput, selector: "[clrDate]", inputs: ["clrDate", "min", "max"], outputs: ["clrDateChange"] }, { kind: "directive", type: i2.ClrDateInputValidator, selector: "[clrDate], [clrStartDate], [clrEndDate]" }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ClrDateTimeContainer, selector: "clr-date-time-container" }, { kind: "directive", type: ClrTimeInput, selector: "[clrTime]" }] }); }
11602
11612
  }
11603
11613
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ClrDateFilterComponent, decorators: [{
11604
11614
  type: Component,
11605
- args: [{ selector: 'clr-date-filter', standalone: false, template: "<button class=\"btn btn-sm btn-icon btn-link btn-trash\" (click)=\"clearFilter()\">\n <cds-icon shape=\"trash\"></cds-icon>\n</button>\n<ng-container *ngIf=\"!timeActive\">\n <clr-date-container class=\"filter-selection\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <clr-date-container class=\"filter-selection\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n</ng-container>\n<ng-container *ngIf=\"timeActive\">\n <clr-date-time-container class=\"filter-selection\">\n <clr-date-container class=\"time-filter-active\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"fromTime\" />\n </clr-date-time-container>\n <clr-date-time-container>\n <clr-date-container class=\"time-filter-active\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"toTime\" />\n </clr-date-time-container>\n <clr-control-error *ngIf=\"valError\"\n >{{ dateValidationError || 'Date \"from\" must be before date \"to\"!' }}\n </clr-control-error>\n</ng-container>\n", styles: [".btn-trash{position:absolute;top:10px;right:40px;padding:0}.time-filter-active{width:12rem;margin-top:.5rem}.time-filter-active-input,.time-filter-input{width:4.5rem!important}.filter-selection{margin-top:.5rem}\n"] }]
11615
+ args: [{ selector: 'clr-date-filter', standalone: false, template: "<button class=\"btn btn-sm btn-icon btn-link btn-trash\" (click)=\"clearFilter()\">\n <cds-icon shape=\"trash\"></cds-icon>\n</button>\n<ng-container *ngIf=\"!timeActive\">\n <clr-date-container class=\"filter-selection\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <clr-date-container class=\"filter-selection\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n <clr-control-error *ngIf=\"valError\"\n >{{ dateValidationError || 'Date \"from\" must be before date \"to\"!' }}\n </clr-control-error>\n</ng-container>\n<ng-container *ngIf=\"timeActive\">\n <clr-date-time-container class=\"filter-selection\">\n <clr-date-container class=\"time-filter-active\">\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"fromTime\" />\n </clr-date-time-container>\n <clr-date-time-container>\n <clr-date-container class=\"time-filter-active\">\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input time-filter-active-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n </clr-date-container>\n <input clrTime type=\"time\" class=\"time-filter-input\" step=\"60\" [(ngModel)]=\"toTime\" />\n </clr-date-time-container>\n <clr-control-error *ngIf=\"valError\"\n >{{ dateValidationError || 'Date \"from\" must be before date \"to\"!' }}\n </clr-control-error>\n</ng-container>\n", styles: [".btn-trash{position:absolute;top:10px;right:40px;padding:0}.time-filter-active{width:12rem;margin-top:.5rem}.time-filter-active-input,.time-filter-input{width:4.5rem!important}.filter-selection{margin-top:.5rem}\n"] }]
11606
11616
  }], ctorParameters: () => [{ type: i2.ClrCommonStringsService }, { type: i2.ClrPopoverEventsService }, { type: i2.ClrDatagridFilter }], propDecorators: { timeActive: [{
11607
11617
  type: Input
11608
11618
  }], dateValidationError: [{
@@ -13867,9 +13877,15 @@ class ClrReadonlyDirective {
13867
13877
  this.elementRef = elementRef;
13868
13878
  this.renderer = renderer;
13869
13879
  this.injector = injector;
13880
+ /**
13881
+ * @deprecated Use {@link clrInputSuffix} or {@link clrInputPrefix} from Clarity instead.
13882
+ */
13870
13883
  this.unitPosition = 'right';
13871
13884
  this.property = null;
13872
13885
  this.clrReadOnly = true;
13886
+ /**
13887
+ * @deprecated Use {@link clrInputSuffix} or {@link clrInputPrefix} from Clarity instead.
13888
+ */
13873
13889
  this.unit = '';
13874
13890
  this.decimalPlaces = 2;
13875
13891
  this.roundValue = false;
@@ -13938,19 +13954,24 @@ class ClrReadonlyDirective {
13938
13954
  if (controlValue == null || controlValue === '') {
13939
13955
  return '';
13940
13956
  }
13957
+ let formattedValue = controlValue ?? '';
13941
13958
  if (controlType === 'numeric') {
13942
- return this.formatNumericValue(controlValue);
13959
+ formattedValue = this.formatNumericValue(controlValue);
13943
13960
  }
13944
13961
  else if (this.property) {
13945
- return this.formatValueForObjectValue(controlValue);
13962
+ formattedValue = this.formatValueForObjectValue(controlValue);
13946
13963
  }
13947
13964
  else if (controlType === 'select') {
13948
- return this.formatListValue(controlValue);
13965
+ formattedValue = this.formatListValue(controlValue);
13949
13966
  }
13950
- return controlValue ?? '';
13967
+ formattedValue = this.addTextPrefixSuffixToValue(formattedValue);
13968
+ return formattedValue;
13951
13969
  }
13952
13970
  formatNumericValue(controlValue) {
13953
13971
  const result = formatNumber(controlValue + '', true, this.decimalSeparator, this.groupingSeparator, this.decimalPlaces, this.autofillDecimals);
13972
+ if (this.unit == null || this.unit === '') {
13973
+ return result;
13974
+ }
13954
13975
  return this.unitPosition === 'left' ? `${this.unit} ${result}` : `${result} ${this.unit}`;
13955
13976
  }
13956
13977
  formatValueForObjectValue(controlValue) {
@@ -13971,6 +13992,18 @@ class ClrReadonlyDirective {
13971
13992
  return '';
13972
13993
  }
13973
13994
  }
13995
+ addTextPrefixSuffixToValue(formattedValue) {
13996
+ const parentElement = this.elementRef.nativeElement.parentElement;
13997
+ const prefixElement = parentElement.querySelector('[clrInputPrefix]');
13998
+ const suffixElement = parentElement.querySelector('[clrInputSuffix]');
13999
+ if (prefixElement?.textContent) {
14000
+ formattedValue = `${prefixElement.textContent} ${formattedValue}`;
14001
+ }
14002
+ if (suffixElement?.textContent) {
14003
+ formattedValue = `${formattedValue} ${suffixElement.textContent}`;
14004
+ }
14005
+ return formattedValue;
14006
+ }
13974
14007
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ClrReadonlyDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
13975
14008
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: ClrReadonlyDirective, isStandalone: false, selector: "[clrReadonly]", inputs: { unitPosition: ["clrUnitPosition", "unitPosition"], property: ["clrReadOnlyProperty", "property"], clrReadOnly: ["clrReadonly", "clrReadOnly"], unit: ["clrUnit", "unit"], decimalPlaces: ["clrDecimalPlaces", "decimalPlaces"], roundValue: ["clrRoundDisplayValue", "roundValue"], autofillDecimals: ["clrAutofillDecimals", "autofillDecimals"], decimalSeparator: ["clrDecimalSep", "decimalSeparator"], groupingSeparator: ["clrGroupingSep", "groupingSeparator"] }, usesOnChanges: true, ngImport: i0 }); }
13976
14009
  }