@3kles/kles-material-dynamicforms 21.4.1 → 21.4.2

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.
@@ -5880,6 +5880,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
5880
5880
  }] });
5881
5881
 
5882
5882
  class KlesFormTileComponent extends KlesFieldAbstract {
5883
+ constructor() {
5884
+ super(...arguments);
5885
+ this.control = this.group.controls[this.field.name];
5886
+ this.controlValue = toSignal(this.control.valueChanges, {
5887
+ initialValue: this.control.value,
5888
+ });
5889
+ this.formattedValue = computed(() => {
5890
+ const value = this.controlValue();
5891
+ if (value == null) {
5892
+ return '';
5893
+ }
5894
+ if (this.field.displayWith) {
5895
+ return this.field.displayWith(value) ?? '';
5896
+ }
5897
+ if (this.field.property && typeof value === 'object') {
5898
+ return String(value[this.field.property] ?? '');
5899
+ }
5900
+ return String(value);
5901
+ }, ...(ngDevMode ? [{ debugName: "formattedValue" }] : /* istanbul ignore next */ []));
5902
+ this.displayValue = computed(() => this.formattedValue() || this.label() || '', ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
5903
+ }
5883
5904
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: KlesFormTileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5884
5905
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: KlesFormTileComponent, isStandalone: true, selector: "app-kles-form-tile", usesInheritance: true, ngImport: i0, template: `
5885
5906
  <div class="kles-tile" [ngClass]="ngClass()" [ngStyle]="ngStyle()" [matTooltip]="tooltip()">
@@ -5888,9 +5909,9 @@ class KlesFormTileComponent extends KlesFieldAbstract {
5888
5909
  }
5889
5910
 
5890
5911
  <div class="kles-tile__content">
5891
- @if (label()) {
5912
+ @if (displayValue(); as value) {
5892
5913
  <div class="kles-tile__label">
5893
- {{ label() }}
5914
+ {{ value }}
5894
5915
  </div>
5895
5916
  }
5896
5917
 
@@ -5912,9 +5933,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
5912
5933
  }
5913
5934
 
5914
5935
  <div class="kles-tile__content">
5915
- @if (label()) {
5936
+ @if (displayValue(); as value) {
5916
5937
  <div class="kles-tile__label">
5917
- {{ label() }}
5938
+ {{ value }}
5918
5939
  </div>
5919
5940
  }
5920
5941