trotl-table 1.0.72 → 1.0.74
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 +26 -7
- package/dist/Table.cjs.js.map +1 -1
- package/dist/Table.esm.js +26 -7
- package/dist/Table.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/Table.cjs.js
CHANGED
|
@@ -9667,6 +9667,7 @@ function TableInner({
|
|
|
9667
9667
|
enableDragRow = false,
|
|
9668
9668
|
enableSearchUrlParam = false,
|
|
9669
9669
|
enableMultiSelect = false,
|
|
9670
|
+
enableGroupSelection = false,
|
|
9670
9671
|
initialSelectedRows = [],
|
|
9671
9672
|
initaialSelectedRows,
|
|
9672
9673
|
enableExternalRowDrop = false,
|
|
@@ -10413,11 +10414,12 @@ function TableInner({
|
|
|
10413
10414
|
}
|
|
10414
10415
|
}, [getAccessorKey, getAccessorValue]);
|
|
10415
10416
|
const renderCell = React.useCallback((v, accessor, row, col) => {
|
|
10416
|
-
const
|
|
10417
|
+
const isUndefinedLike = v === undefined || typeof v === "string" && v.trim().toLowerCase() === "undefined";
|
|
10418
|
+
const isNoData = isUndefinedLike;
|
|
10417
10419
|
|
|
10418
10420
|
// Checkbox column type (editable in-table)
|
|
10419
10421
|
if (col && col.type === 'checkbox') {
|
|
10420
|
-
const checked = !!v;
|
|
10422
|
+
const checked = isUndefinedLike ? false : !!v;
|
|
10421
10423
|
return /*#__PURE__*/React.createElement("input", {
|
|
10422
10424
|
type: "checkbox",
|
|
10423
10425
|
checked: checked,
|
|
@@ -10455,7 +10457,7 @@ function TableInner({
|
|
|
10455
10457
|
|
|
10456
10458
|
// Switch column type (uses internal Switch component)
|
|
10457
10459
|
if (col && col.type === 'switch') {
|
|
10458
|
-
const checked = !!v;
|
|
10460
|
+
const checked = isUndefinedLike ? false : !!v;
|
|
10459
10461
|
return /*#__PURE__*/React.createElement("div", {
|
|
10460
10462
|
title: isNoData ? translate("noData") : undefined,
|
|
10461
10463
|
onClick: e => {
|
|
@@ -10493,8 +10495,8 @@ function TableInner({
|
|
|
10493
10495
|
|
|
10494
10496
|
// Color column type (display color swatch background)
|
|
10495
10497
|
if (col && col.type === 'color') {
|
|
10496
|
-
const colorVal = v || "transparent";
|
|
10497
|
-
const text = String(colorVal) ;
|
|
10498
|
+
const colorVal = isUndefinedLike ? "transparent" : v || "transparent";
|
|
10499
|
+
const text = isUndefinedLike ? "..." : String(colorVal) ;
|
|
10498
10500
|
return /*#__PURE__*/React.createElement("div", {
|
|
10499
10501
|
style: {
|
|
10500
10502
|
width: '100%',
|
|
@@ -10636,6 +10638,23 @@ function TableInner({
|
|
|
10636
10638
|
minute: "2-digit"
|
|
10637
10639
|
}) : "-";
|
|
10638
10640
|
}
|
|
10641
|
+
if (isUndefinedLike) {
|
|
10642
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10643
|
+
title: translate("noData")
|
|
10644
|
+
}, "...");
|
|
10645
|
+
}
|
|
10646
|
+
if (typeof v === "boolean") {
|
|
10647
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10648
|
+
title: String(v),
|
|
10649
|
+
style: {
|
|
10650
|
+
color: v ? "#1a7f37" : "#b42318",
|
|
10651
|
+
fontWeight: 700,
|
|
10652
|
+
display: "inline-block",
|
|
10653
|
+
minWidth: "1ch",
|
|
10654
|
+
textAlign: "center"
|
|
10655
|
+
}
|
|
10656
|
+
}, v ? "✓" : "✗");
|
|
10657
|
+
}
|
|
10639
10658
|
// existing highlight logic for other fields
|
|
10640
10659
|
return highlight(String(v));
|
|
10641
10660
|
}, [highlight, isGrouped, triggerCellCallback, translate, formatArrayValue]);
|
|
@@ -10846,7 +10865,7 @@ function TableInner({
|
|
|
10846
10865
|
},
|
|
10847
10866
|
className: "table-row group-row empty-group-drop",
|
|
10848
10867
|
onClick: () => toggleGroup(gid)
|
|
10849
|
-
}, enableMultiSelect && /*#__PURE__*/React.createElement("div", {
|
|
10868
|
+
}, enableMultiSelect && enableGroupSelection && /*#__PURE__*/React.createElement("div", {
|
|
10850
10869
|
className: "table-cell checkbox-cell"
|
|
10851
10870
|
}, /*#__PURE__*/React.createElement("input", {
|
|
10852
10871
|
type: "checkbox",
|
|
@@ -10890,7 +10909,7 @@ function TableInner({
|
|
|
10890
10909
|
style: style,
|
|
10891
10910
|
className: "table-row group-row",
|
|
10892
10911
|
onClick: () => toggleGroup(gid)
|
|
10893
|
-
}, enableMultiSelect && /*#__PURE__*/React.createElement("div", {
|
|
10912
|
+
}, enableMultiSelect && enableGroupSelection && /*#__PURE__*/React.createElement("div", {
|
|
10894
10913
|
className: "table-cell checkbox-cell"
|
|
10895
10914
|
}, /*#__PURE__*/React.createElement("input", {
|
|
10896
10915
|
type: "checkbox",
|