trotl-table 1.0.64 → 1.0.65

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 CHANGED
@@ -9701,6 +9701,7 @@ function TableInner({
9701
9701
  yesDelete: "Yes, Delete",
9702
9702
  areYouSureYouWantToDelete: "Are you sure you want to delete",
9703
9703
  action: "Action",
9704
+ noData: "No Data",
9704
9705
  DropHereToMoveIntoThisGroup: "Drop here to move into this group"
9705
9706
  };
9706
9707
  return translations[key] || key;
@@ -10236,12 +10237,15 @@ function TableInner({
10236
10237
  }
10237
10238
  }, [getAccessorKey, getAccessorValue]);
10238
10239
  const renderCell = React.useCallback((v, accessor, row, col) => {
10240
+ const isNoData = v === undefined;
10241
+
10239
10242
  // Checkbox column type (editable in-table)
10240
10243
  if (col && col.type === 'checkbox') {
10241
10244
  const checked = !!v;
10242
10245
  return /*#__PURE__*/React.createElement("input", {
10243
10246
  type: "checkbox",
10244
10247
  checked: checked,
10248
+ title: isNoData ? translate("noData") : undefined,
10245
10249
  onClick: e => {
10246
10250
  e.stopPropagation();
10247
10251
  triggerCellCallback(row, col, checked);
@@ -10277,6 +10281,7 @@ function TableInner({
10277
10281
  if (col && col.type === 'switch') {
10278
10282
  const checked = !!v;
10279
10283
  return /*#__PURE__*/React.createElement("div", {
10284
+ title: isNoData ? translate("noData") : undefined,
10280
10285
  onClick: e => {
10281
10286
  e.stopPropagation();
10282
10287
  triggerCellCallback(row, col, checked);
@@ -10312,11 +10317,13 @@ function TableInner({
10312
10317
 
10313
10318
  // Input column type (editable text)
10314
10319
  if (col && col.type === 'input') {
10315
- const text = v == null ? "" : String(v);
10320
+ const text = isNoData ? "" : v == null ? "" : String(v);
10316
10321
  return /*#__PURE__*/React.createElement("input", {
10317
10322
  type: "text",
10318
10323
  className: "table-cell-input",
10319
10324
  value: text,
10325
+ placeholder: isNoData ? "..." : undefined,
10326
+ title: isNoData ? translate("noData") : text,
10320
10327
  onClick: e => {
10321
10328
  e.stopPropagation();
10322
10329
  triggerCellCallback(row, col, text);
@@ -10351,6 +10358,11 @@ function TableInner({
10351
10358
  }
10352
10359
  });
10353
10360
  }
10361
+ if (isNoData) {
10362
+ return /*#__PURE__*/React.createElement("span", {
10363
+ title: translate("noData")
10364
+ }, "...");
10365
+ }
10354
10366
 
10355
10367
  // If column has dateFormat, format value as date/time
10356
10368
  if (col && col.dateFormat && v) {
@@ -10396,7 +10408,7 @@ function TableInner({
10396
10408
  }
10397
10409
  // existing highlight logic for other fields
10398
10410
  return highlight(String(v));
10399
- }, [highlight, isGrouped, triggerCellCallback]);
10411
+ }, [highlight, isGrouped, triggerCellCallback, translate]);
10400
10412
  const showView = buttons.includes("view");
10401
10413
  const showEdit = buttons.includes("edit");
10402
10414
  // show delete only when view is also shown (per request)