@shival99/z-ui 1.4.28 → 1.5.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.
|
@@ -265,7 +265,17 @@ class ZTableEditCellComponent {
|
|
|
265
265
|
}
|
|
266
266
|
return config;
|
|
267
267
|
}, ...(ngDevMode ? [{ debugName: "editConfig" }] : []));
|
|
268
|
-
editType = computed(() =>
|
|
268
|
+
editType = computed(() => {
|
|
269
|
+
const config = this.editConfig();
|
|
270
|
+
const typeConfig = config?.type;
|
|
271
|
+
if (!typeConfig) {
|
|
272
|
+
return 'text';
|
|
273
|
+
}
|
|
274
|
+
if (typeof typeConfig === 'function') {
|
|
275
|
+
return typeConfig(this.zRow());
|
|
276
|
+
}
|
|
277
|
+
return typeConfig;
|
|
278
|
+
}, ...(ngDevMode ? [{ debugName: "editType" }] : []));
|
|
269
279
|
size = computed(() => {
|
|
270
280
|
const config = this.editConfig();
|
|
271
281
|
return config?.size ?? 'default';
|
|
@@ -276,7 +286,14 @@ class ZTableEditCellComponent {
|
|
|
276
286
|
}, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
277
287
|
selectOptions = computed(() => {
|
|
278
288
|
const config = this.editConfig();
|
|
279
|
-
|
|
289
|
+
const optionsConfig = config?.options;
|
|
290
|
+
if (!optionsConfig) {
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
293
|
+
if (typeof optionsConfig === 'function') {
|
|
294
|
+
return optionsConfig(this.zRow());
|
|
295
|
+
}
|
|
296
|
+
return optionsConfig;
|
|
280
297
|
}, ...(ngDevMode ? [{ debugName: "selectOptions" }] : []));
|
|
281
298
|
isDisabled = computed(() => {
|
|
282
299
|
const config = this.editConfig();
|
|
@@ -1904,9 +1921,10 @@ class ZTableCellEditPipe {
|
|
|
1904
1921
|
config: { enabled: edit, type: 'text' },
|
|
1905
1922
|
};
|
|
1906
1923
|
}
|
|
1924
|
+
const baseType = typeof edit.type === 'function' ? 'text' : (edit.type ?? 'text');
|
|
1907
1925
|
return {
|
|
1908
1926
|
enabled: edit.enabled !== false,
|
|
1909
|
-
type:
|
|
1927
|
+
type: baseType,
|
|
1910
1928
|
config: edit,
|
|
1911
1929
|
};
|
|
1912
1930
|
}
|