trotl-table 1.0.72 → 1.0.73
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/dist/Table.cjs.js +23 -5
- package/dist/Table.cjs.js.map +1 -1
- package/dist/Table.esm.js +23 -5
- package/dist/Table.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/Table.cjs.js
CHANGED
|
@@ -10413,11 +10413,12 @@ function TableInner({
|
|
|
10413
10413
|
}
|
|
10414
10414
|
}, [getAccessorKey, getAccessorValue]);
|
|
10415
10415
|
const renderCell = React.useCallback((v, accessor, row, col) => {
|
|
10416
|
-
const
|
|
10416
|
+
const isUndefinedLike = v === undefined || typeof v === "string" && v.trim().toLowerCase() === "undefined";
|
|
10417
|
+
const isNoData = isUndefinedLike;
|
|
10417
10418
|
|
|
10418
10419
|
// Checkbox column type (editable in-table)
|
|
10419
10420
|
if (col && col.type === 'checkbox') {
|
|
10420
|
-
const checked = !!v;
|
|
10421
|
+
const checked = isUndefinedLike ? false : !!v;
|
|
10421
10422
|
return /*#__PURE__*/React.createElement("input", {
|
|
10422
10423
|
type: "checkbox",
|
|
10423
10424
|
checked: checked,
|
|
@@ -10455,7 +10456,7 @@ function TableInner({
|
|
|
10455
10456
|
|
|
10456
10457
|
// Switch column type (uses internal Switch component)
|
|
10457
10458
|
if (col && col.type === 'switch') {
|
|
10458
|
-
const checked = !!v;
|
|
10459
|
+
const checked = isUndefinedLike ? false : !!v;
|
|
10459
10460
|
return /*#__PURE__*/React.createElement("div", {
|
|
10460
10461
|
title: isNoData ? translate("noData") : undefined,
|
|
10461
10462
|
onClick: e => {
|
|
@@ -10493,8 +10494,8 @@ function TableInner({
|
|
|
10493
10494
|
|
|
10494
10495
|
// Color column type (display color swatch background)
|
|
10495
10496
|
if (col && col.type === 'color') {
|
|
10496
|
-
const colorVal = v || "transparent";
|
|
10497
|
-
const text = String(colorVal) ;
|
|
10497
|
+
const colorVal = isUndefinedLike ? "transparent" : v || "transparent";
|
|
10498
|
+
const text = isUndefinedLike ? "..." : String(colorVal) ;
|
|
10498
10499
|
return /*#__PURE__*/React.createElement("div", {
|
|
10499
10500
|
style: {
|
|
10500
10501
|
width: '100%',
|
|
@@ -10636,6 +10637,23 @@ function TableInner({
|
|
|
10636
10637
|
minute: "2-digit"
|
|
10637
10638
|
}) : "-";
|
|
10638
10639
|
}
|
|
10640
|
+
if (isUndefinedLike) {
|
|
10641
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10642
|
+
title: translate("noData")
|
|
10643
|
+
}, "...");
|
|
10644
|
+
}
|
|
10645
|
+
if (typeof v === "boolean") {
|
|
10646
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10647
|
+
title: String(v),
|
|
10648
|
+
style: {
|
|
10649
|
+
color: v ? "#1a7f37" : "#b42318",
|
|
10650
|
+
fontWeight: 700,
|
|
10651
|
+
display: "inline-block",
|
|
10652
|
+
minWidth: "1ch",
|
|
10653
|
+
textAlign: "center"
|
|
10654
|
+
}
|
|
10655
|
+
}, v ? "✓" : "✗");
|
|
10656
|
+
}
|
|
10639
10657
|
// existing highlight logic for other fields
|
|
10640
10658
|
return highlight(String(v));
|
|
10641
10659
|
}, [highlight, isGrouped, triggerCellCallback, translate, formatArrayValue]);
|