trotl-table 1.0.88 → 1.0.89

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
@@ -9657,6 +9657,8 @@ function TableInner({
9657
9657
  duplicateCallback = () => {},
9658
9658
  // new download callback
9659
9659
  downloadCallback = () => {},
9660
+ // new undelete callback
9661
+ undeleteCallback = () => {},
9660
9662
  // callback for cell edits: (row, accessor, newValue)
9661
9663
  onCellChange = () => {},
9662
9664
  // callback for any cell click
@@ -9701,6 +9703,7 @@ function TableInner({
9701
9703
  view: "View",
9702
9704
  edit: "Edit",
9703
9705
  delete: "Delete",
9706
+ undelete: "Undelete",
9704
9707
  share: "Share",
9705
9708
  duplicate: "Duplicate",
9706
9709
  download: "Download",
@@ -9723,6 +9726,7 @@ function TableInner({
9723
9726
  const shareCallbackRef = React.useRef(shareCallback);
9724
9727
  const duplicateCallbackRef = React.useRef(duplicateCallback);
9725
9728
  const downloadCallbackRef = React.useRef(downloadCallback);
9729
+ const undeleteCallbackRef = React.useRef(undeleteCallback);
9726
9730
  const onCellChangeRef = React.useRef(onCellChange);
9727
9731
  const cellCallbackRef = React.useRef(cellCallback);
9728
9732
 
@@ -9733,6 +9737,7 @@ function TableInner({
9733
9737
  viewCallbackRef.current = viewCallback;
9734
9738
  editCallbackRef.current = editCallback;
9735
9739
  deleteCallbackRef.current = deleteCallback;
9740
+ undeleteCallbackRef.current = undeleteCallback;
9736
9741
  onCellChangeRef.current = onCellChange;
9737
9742
  cellCallbackRef.current = cellCallback;
9738
9743
  });
@@ -10846,10 +10851,11 @@ function TableInner({
10846
10851
  // show delete only when view is also shown (per request)
10847
10852
  const showDelete = showView && buttons.includes("delete");
10848
10853
  const showShare = buttons.includes("share");
10854
+ const showUndelete = buttons.includes("undelete");
10849
10855
  const showDuplicate = buttons.includes("duplicate") || buttons.includes("duplicates");
10850
10856
  const showDownload = buttons.includes("download");
10851
- const showActions = showView || showEdit || showDelete || showShare || showDuplicate || showDownload;
10852
- const visibleActionCount = [showView, showEdit, showDuplicate, showDelete, showShare, showDownload].filter(Boolean).length;
10857
+ const showActions = showView || showEdit || showDelete || showShare || showUndelete || showDuplicate || showDownload;
10858
+ const visibleActionCount = [showView, showEdit, showDuplicate, showDelete, showShare, showUndelete, showDownload].filter(Boolean).length;
10853
10859
  const actionColumnStyle = React.useMemo(() => {
10854
10860
  if (!showActions) return undefined;
10855
10861
  const gap = 4;
@@ -11234,7 +11240,16 @@ function TableInner({
11234
11240
  role: "img",
11235
11241
  "aria-hidden": "false",
11236
11242
  title: translate("delete")
11237
- }, "\uD83D\uDDD1\uFE0F") : translate("delete")), showShare && /*#__PURE__*/React.createElement("button", {
11243
+ }, "\uD83D\uDDD1\uFE0F") : translate("delete")), showUndelete && /*#__PURE__*/React.createElement("button", {
11244
+ className: "action-btn-table",
11245
+ onClick: () => undeleteCallbackRef.current(row),
11246
+ onDoubleClick: e => e.stopPropagation(),
11247
+ "aria-label": translate("undelete")
11248
+ }, showIcons ? /*#__PURE__*/React.createElement("span", {
11249
+ role: "img",
11250
+ "aria-hidden": "false",
11251
+ title: translate("undelete")
11252
+ }, "\u267B\uFE0F") : translate("undelete")), showShare && /*#__PURE__*/React.createElement("button", {
11238
11253
  className: "action-btn-table",
11239
11254
  onClick: () => shareCallbackRef.current(row),
11240
11255
  onDoubleClick: e => e.stopPropagation(),