@shival99/z-ui 1.6.1 → 1.6.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.
- package/fesm2022/shival99-z-ui-components-z-table.mjs +34 -3
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
- package/types/shival99-z-ui-components-z-table.d.ts +18 -2
|
@@ -283,18 +283,47 @@ class ZTableEditCellComponent {
|
|
|
283
283
|
}, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
284
284
|
placeholder = computed(() => {
|
|
285
285
|
const config = this.editConfig();
|
|
286
|
-
|
|
286
|
+
const placeholderConfig = config?.placeholder;
|
|
287
|
+
if (!placeholderConfig) {
|
|
288
|
+
return '';
|
|
289
|
+
}
|
|
290
|
+
if (typeof placeholderConfig === 'function') {
|
|
291
|
+
return placeholderConfig(this.zRow());
|
|
292
|
+
}
|
|
293
|
+
return placeholderConfig;
|
|
287
294
|
}, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
295
|
+
allowClear = computed(() => {
|
|
296
|
+
const config = this.editConfig();
|
|
297
|
+
return config?.allowClear ?? false;
|
|
298
|
+
}, ...(ngDevMode ? [{ debugName: "allowClear" }] : []));
|
|
288
299
|
selectOptions = computed(() => {
|
|
289
300
|
const config = this.editConfig();
|
|
290
301
|
const optionsConfig = config?.options;
|
|
291
302
|
if (!optionsConfig) {
|
|
292
303
|
return [];
|
|
293
304
|
}
|
|
305
|
+
let rawOptions;
|
|
294
306
|
if (typeof optionsConfig === 'function') {
|
|
295
|
-
|
|
307
|
+
rawOptions = optionsConfig(this.zRow());
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
rawOptions = optionsConfig;
|
|
311
|
+
}
|
|
312
|
+
const labelKey = config?.optionLabelKey;
|
|
313
|
+
const valueKey = config?.optionValueKey;
|
|
314
|
+
if (labelKey || valueKey) {
|
|
315
|
+
return rawOptions.map((opt) => {
|
|
316
|
+
if (typeof opt !== 'object' || opt === null) {
|
|
317
|
+
return { label: String(opt), value: opt };
|
|
318
|
+
}
|
|
319
|
+
const obj = opt;
|
|
320
|
+
return {
|
|
321
|
+
label: String(obj[labelKey ?? 'label'] ?? ''),
|
|
322
|
+
value: obj[valueKey ?? 'value'],
|
|
323
|
+
};
|
|
324
|
+
});
|
|
296
325
|
}
|
|
297
|
-
return
|
|
326
|
+
return rawOptions;
|
|
298
327
|
}, ...(ngDevMode ? [{ debugName: "selectOptions" }] : []));
|
|
299
328
|
isDisabled = computed(() => {
|
|
300
329
|
const config = this.editConfig();
|
|
@@ -482,6 +511,7 @@ class ZTableEditCellComponent {
|
|
|
482
511
|
[zWrap]="false"
|
|
483
512
|
[zScrollClose]="true"
|
|
484
513
|
[zOptions]="selectOptions()"
|
|
514
|
+
[zAllowClear]="allowClear()"
|
|
485
515
|
[zDisabled]="isDisabled() || isReadonly()"
|
|
486
516
|
[ngModel]="value()"
|
|
487
517
|
[zPlaceholder]="placeholder()"
|
|
@@ -580,6 +610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
580
610
|
[zWrap]="false"
|
|
581
611
|
[zScrollClose]="true"
|
|
582
612
|
[zOptions]="selectOptions()"
|
|
613
|
+
[zAllowClear]="allowClear()"
|
|
583
614
|
[zDisabled]="isDisabled() || isReadonly()"
|
|
584
615
|
[ngModel]="value()"
|
|
585
616
|
[zPlaceholder]="placeholder()"
|