trotl-table 1.0.39 → 1.0.40

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
@@ -9646,6 +9646,7 @@ function TableInner({
9646
9646
  showKey = false,
9647
9647
  keyWidth = null,
9648
9648
  selectedRowsCallback = () => {},
9649
+ doubleClickEnable = false,
9649
9650
  refreshTrigger = () => {},
9650
9651
  editCallback = () => {},
9651
9652
  viewCallback = () => {},
@@ -10468,10 +10469,19 @@ function TableInner({
10468
10469
  }
10469
10470
  });
10470
10471
  }
10472
+ const handleRowDoubleClick = e => {
10473
+ if (!doubleClickEnable) return;
10474
+ // ignore double-clicks on action buttons or inputs
10475
+ if (e.target.closest('.action-btn-table') || e.target.closest('input') || e.target.closest('button')) {
10476
+ return;
10477
+ }
10478
+ editCallbackRef.current(row);
10479
+ };
10471
10480
  const content = /*#__PURE__*/React.createElement("div", {
10472
10481
  key: key,
10473
10482
  style: style,
10474
- className: "table-row"
10483
+ className: "table-row",
10484
+ onDoubleClick: handleRowDoubleClick
10475
10485
  }, enableMultiSelect && showDelete && /*#__PURE__*/React.createElement("div", {
10476
10486
  className: "table-cell checkbox-cell"
10477
10487
  }, /*#__PURE__*/React.createElement("input", {
@@ -10574,7 +10584,7 @@ function TableInner({
10574
10584
  }, content);
10575
10585
  }
10576
10586
  return content;
10577
- }, [tableDataFlat, columns, selectedRows, toggleRowSelection, groupRowsById, renderCell, showActions, showDelete, showEdit, showKey, showView, translate, enableDragRow, moveRow, enableMultiSelect, rowHeight, tableId, customColumns]);
10587
+ }, [tableDataFlat, columns, selectedRows, toggleRowSelection, groupRowsById, renderCell, showActions, showDelete, showEdit, showKey, showView, translate, enableDragRow, moveRow, enableMultiSelect, rowHeight, tableId, customColumns, doubleClickEnable]);
10578
10588
  const rowHeightGetter = ({
10579
10589
  index
10580
10590
  }) => tableDataFlat[index]?.type === "group" ? groupHeaderHeight : rowHeight;