@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.
- package/esm2020/lib/components/tables/column/list-propery-column-model.mjs +12 -6
- package/esm2020/lib/components/tables/column/property-column-model.mjs +9 -5
- package/fesm2015/coolon-angular-ui-powerups.mjs +19 -9
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +17 -9
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/column/list-propery-column-model.d.ts +4 -3
- package/lib/components/tables/column/property-column-model.d.ts +5 -4
- package/package.json +1 -1
|
@@ -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.
|
|
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(
|
|
3092
|
+
this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => ColumnTextSearchFormatter.forFormatter(this._defaultSearchTextFormat)), row => row[this.property]);
|
|
3088
3093
|
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
|
|
3089
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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(
|
|
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
|
-
|
|
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.
|
|
3205
|
+
this._userFormat = formatter;
|
|
3198
3206
|
return this;
|
|
3199
3207
|
}
|
|
3200
3208
|
selectRowOnClick(selectOnRowClick) {
|