@vuu-ui/vuu-table 0.8.18-debug → 0.8.19-debug
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/cjs/index.js +7 -10
- package/cjs/index.js.map +2 -2
- package/esm/index.js +9 -11
- package/esm/index.js.map +3 -3
- package/package.json +8 -8
- package/types/useTable.d.ts +1 -0
package/cjs/index.js
CHANGED
|
@@ -1652,14 +1652,13 @@ var useTableContextMenu = ({
|
|
|
1652
1652
|
const [showContextMenu] = (0, import_vuu_popups2.useContextMenu)();
|
|
1653
1653
|
const onContextMenu = (0, import_react18.useCallback)(
|
|
1654
1654
|
(evt) => {
|
|
1655
|
-
var _a;
|
|
1656
1655
|
const target = evt.target;
|
|
1657
1656
|
const cellEl = target == null ? void 0 : target.closest("div[role='cell']");
|
|
1658
1657
|
const rowEl = target == null ? void 0 : target.closest("div[role='row']");
|
|
1659
1658
|
if (cellEl && rowEl) {
|
|
1660
1659
|
const { selectedRowsCount } = dataSource;
|
|
1661
1660
|
const columnMap = (0, import_vuu_utils13.buildColumnMap)(columns);
|
|
1662
|
-
const rowIndex =
|
|
1661
|
+
const rowIndex = (0, import_vuu_utils13.getIndexFromRowElement)(rowEl);
|
|
1663
1662
|
const cellIndex = Array.from(rowEl.childNodes).indexOf(cellEl);
|
|
1664
1663
|
const row = data.find(([idx]) => idx === rowIndex);
|
|
1665
1664
|
const columnName = columns[cellIndex];
|
|
@@ -2903,14 +2902,11 @@ var useTable = ({
|
|
|
2903
2902
|
const handleDragStartRow = (0, import_react24.useCallback)(
|
|
2904
2903
|
(dragDropState) => {
|
|
2905
2904
|
const { initialDragElement } = dragDropState;
|
|
2906
|
-
const rowIndex = initialDragElement
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
dragDropState.setPayload(row);
|
|
2912
|
-
} else {
|
|
2913
|
-
}
|
|
2905
|
+
const rowIndex = (0, import_vuu_utils17.getIndexFromRowElement)(initialDragElement);
|
|
2906
|
+
const row = dataRef.current.find((row2) => row2[0] === rowIndex);
|
|
2907
|
+
if (row) {
|
|
2908
|
+
dragDropState.setPayload(row);
|
|
2909
|
+
} else {
|
|
2914
2910
|
}
|
|
2915
2911
|
onDragStart == null ? void 0 : onDragStart(dragDropState);
|
|
2916
2912
|
},
|
|
@@ -2928,6 +2924,7 @@ var useTable = ({
|
|
|
2928
2924
|
});
|
|
2929
2925
|
return {
|
|
2930
2926
|
...containerProps,
|
|
2927
|
+
"aria-rowcount": dataSource.size,
|
|
2931
2928
|
draggableRow,
|
|
2932
2929
|
onBlur: editingBlur,
|
|
2933
2930
|
onDoubleClick: editingDoubleClick,
|