@coolon/angular-ui-powerups 13.7.20 → 13.7.21

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.
@@ -3080,15 +3080,20 @@ class ListPropertyColumnModel extends ColumnModel {
3080
3080
  constructor(id, property, defaults) {
3081
3081
  super(id, defaults);
3082
3082
  this.property = property;
3083
- this._format = (value) => value?.map(v => v?.toString()).join(", ");
3083
+ this._defaultSearchTextFormat = value => {
3084
+ const intermediate = (this._userFormat ?? Functions.identity)(value);
3085
+ return Array.isArray(intermediate) ?
3086
+ intermediate.map(v => v?.toString()).join(", ") :
3087
+ intermediate?.toString();
3088
+ };
3084
3089
  this.cellRenderer(DefaultCellRendererComponent);
3085
3090
  }
3086
3091
  cellRenderer(componentType) {
3087
- this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => ColumnTextSearchFormatter.forFormatter(value => this._format(value))), row => row[this.property]);
3092
+ this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => ColumnTextSearchFormatter.forFormatter(this._defaultSearchTextFormat)), row => row[this.property]);
3088
3093
  this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
3089
- let rowElement = rowData.row[this.property];
3094
+ const rowValue = rowData.row[this.property];
3090
3095
  // @ts-ignore Started complaining in ts 4.5.. but I think my logic is correct...
3091
- component.value = this._format(rowElement);
3096
+ component.value = (this._userFormat) ? this._userFormat(rowValue) : rowValue;
3092
3097
  }));
3093
3098
  return this;
3094
3099
  }
@@ -3109,7 +3114,7 @@ class ListPropertyColumnModel extends ColumnModel {
3109
3114
  }
3110
3115
  format(formatter) {
3111
3116
  assert$1.isFunction(formatter);
3112
- this._format = formatter;
3117
+ this._userFormat = formatter;
3113
3118
  return this;
3114
3119
  }
3115
3120
  selectRowOnClick(selectRowOnClick) {
@@ -3121,11 +3126,13 @@ class PropertyColumnModel extends ColumnModel {
3121
3126
  constructor(id, property, defaults) {
3122
3127
  super(id, defaults);
3123
3128
  this.property = property;
3124
- this._format = (value) => value?.toString();
3129
+ this._defaultSearchTextFormatter = (value) => {
3130
+ return (this._userFormat ?? Functions.identity)(value)?.toString();
3131
+ };
3125
3132
  this.cellRenderer(DefaultCellRendererComponent);
3126
3133
  }
3127
3134
  cellRenderer(componentType, onComponentInitOrOptions) {
3128
- this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => ColumnTextSearchFormatter.forFormatter(value => this._format(value))), row => row[this.property]);
3135
+ this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => ColumnTextSearchFormatter.forFormatter(this._defaultSearchTextFormatter)), row => row[this.property]);
3129
3136
  this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
3130
3137
  if (firstTime) {
3131
3138
  if (isFunction$1(onComponentInitOrOptions)) {
@@ -3137,7 +3144,8 @@ class PropertyColumnModel extends ColumnModel {
3137
3144
  }
3138
3145
  }
3139
3146
  }
3140
- component.value = this._format(rowData.row[this.property]);
3147
+ const rowValue = rowData.row[this.property];
3148
+ component.value = this._userFormat ? this._userFormat(rowValue) : rowValue;
3141
3149
  }));
3142
3150
  return this;
3143
3151
  }
@@ -3194,7 +3202,7 @@ class PropertyColumnModel extends ColumnModel {
3194
3202
  }
3195
3203
  format(formatter) {
3196
3204
  assert$1.isFunction(formatter);
3197
- this._format = formatter;
3205
+ this._userFormat = formatter;
3198
3206
  return this;
3199
3207
  }
3200
3208
  selectRowOnClick(selectOnRowClick) {