trotl-table 1.0.87 → 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 +18 -3
- package/dist/Table.cjs.js.map +1 -1
- package/dist/Table.esm.js +18 -3
- package/dist/Table.esm.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
package/dist/Table.esm.js
CHANGED
|
@@ -9635,6 +9635,8 @@ function TableInner({
|
|
|
9635
9635
|
duplicateCallback = () => {},
|
|
9636
9636
|
// new download callback
|
|
9637
9637
|
downloadCallback = () => {},
|
|
9638
|
+
// new undelete callback
|
|
9639
|
+
undeleteCallback = () => {},
|
|
9638
9640
|
// callback for cell edits: (row, accessor, newValue)
|
|
9639
9641
|
onCellChange = () => {},
|
|
9640
9642
|
// callback for any cell click
|
|
@@ -9679,6 +9681,7 @@ function TableInner({
|
|
|
9679
9681
|
view: "View",
|
|
9680
9682
|
edit: "Edit",
|
|
9681
9683
|
delete: "Delete",
|
|
9684
|
+
undelete: "Undelete",
|
|
9682
9685
|
share: "Share",
|
|
9683
9686
|
duplicate: "Duplicate",
|
|
9684
9687
|
download: "Download",
|
|
@@ -9701,6 +9704,7 @@ function TableInner({
|
|
|
9701
9704
|
const shareCallbackRef = useRef(shareCallback);
|
|
9702
9705
|
const duplicateCallbackRef = useRef(duplicateCallback);
|
|
9703
9706
|
const downloadCallbackRef = useRef(downloadCallback);
|
|
9707
|
+
const undeleteCallbackRef = useRef(undeleteCallback);
|
|
9704
9708
|
const onCellChangeRef = useRef(onCellChange);
|
|
9705
9709
|
const cellCallbackRef = useRef(cellCallback);
|
|
9706
9710
|
|
|
@@ -9711,6 +9715,7 @@ function TableInner({
|
|
|
9711
9715
|
viewCallbackRef.current = viewCallback;
|
|
9712
9716
|
editCallbackRef.current = editCallback;
|
|
9713
9717
|
deleteCallbackRef.current = deleteCallback;
|
|
9718
|
+
undeleteCallbackRef.current = undeleteCallback;
|
|
9714
9719
|
onCellChangeRef.current = onCellChange;
|
|
9715
9720
|
cellCallbackRef.current = cellCallback;
|
|
9716
9721
|
});
|
|
@@ -10824,10 +10829,11 @@ function TableInner({
|
|
|
10824
10829
|
// show delete only when view is also shown (per request)
|
|
10825
10830
|
const showDelete = showView && buttons.includes("delete");
|
|
10826
10831
|
const showShare = buttons.includes("share");
|
|
10832
|
+
const showUndelete = buttons.includes("undelete");
|
|
10827
10833
|
const showDuplicate = buttons.includes("duplicate") || buttons.includes("duplicates");
|
|
10828
10834
|
const showDownload = buttons.includes("download");
|
|
10829
|
-
const showActions = showView || showEdit || showDelete || showShare || showDuplicate || showDownload;
|
|
10830
|
-
const visibleActionCount = [showView, showEdit, showDuplicate, showDelete, showShare, showDownload].filter(Boolean).length;
|
|
10835
|
+
const showActions = showView || showEdit || showDelete || showShare || showUndelete || showDuplicate || showDownload;
|
|
10836
|
+
const visibleActionCount = [showView, showEdit, showDuplicate, showDelete, showShare, showUndelete, showDownload].filter(Boolean).length;
|
|
10831
10837
|
const actionColumnStyle = useMemo(() => {
|
|
10832
10838
|
if (!showActions) return undefined;
|
|
10833
10839
|
const gap = 4;
|
|
@@ -11212,7 +11218,16 @@ function TableInner({
|
|
|
11212
11218
|
role: "img",
|
|
11213
11219
|
"aria-hidden": "false",
|
|
11214
11220
|
title: translate("delete")
|
|
11215
|
-
}, "\uD83D\uDDD1\uFE0F") : translate("delete")),
|
|
11221
|
+
}, "\uD83D\uDDD1\uFE0F") : translate("delete")), showUndelete && /*#__PURE__*/React__default.createElement("button", {
|
|
11222
|
+
className: "action-btn-table",
|
|
11223
|
+
onClick: () => undeleteCallbackRef.current(row),
|
|
11224
|
+
onDoubleClick: e => e.stopPropagation(),
|
|
11225
|
+
"aria-label": translate("undelete")
|
|
11226
|
+
}, showIcons ? /*#__PURE__*/React__default.createElement("span", {
|
|
11227
|
+
role: "img",
|
|
11228
|
+
"aria-hidden": "false",
|
|
11229
|
+
title: translate("undelete")
|
|
11230
|
+
}, "\u267B\uFE0F") : translate("undelete")), showShare && /*#__PURE__*/React__default.createElement("button", {
|
|
11216
11231
|
className: "action-btn-table",
|
|
11217
11232
|
onClick: () => shareCallbackRef.current(row),
|
|
11218
11233
|
onDoubleClick: e => e.stopPropagation(),
|