@economic/taco 2.61.3 → 2.61.4
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/taco.cjs +18 -10
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.js +18 -10
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.cjs
CHANGED
@@ -29793,13 +29793,12 @@ const Item$2 = React__namespace.forwardRef(function MenuItem(props, ref) {
|
|
29793
29793
|
className: props.className
|
29794
29794
|
});
|
29795
29795
|
const disabled = props.disabled ?? props["aria-disabled"];
|
29796
|
-
|
29797
|
-
|
29798
|
-
handleClick = (event) => {
|
29796
|
+
const handleClick = (event) => {
|
29797
|
+
if (disabled) {
|
29799
29798
|
event.preventDefault();
|
29800
|
-
|
29801
|
-
|
29802
|
-
}
|
29799
|
+
}
|
29800
|
+
event.stopPropagation();
|
29801
|
+
};
|
29803
29802
|
if (subMenu) {
|
29804
29803
|
return /* @__PURE__ */ React__namespace.createElement($d08ef79370b62062$export$d7a01e11500dfb6f, null, /* @__PURE__ */ React__namespace.createElement($d08ef79370b62062$export$2ea8a7a591ac5eac, { ...otherProps, className, onClick: handleClick, ref }, icon ? /* @__PURE__ */ React__namespace.createElement(Icon, { name: icon }) : null, props.children, /* @__PURE__ */ React__namespace.createElement(Icon$1, { className: "-mr-1.5 ml-auto !h-5 !w-5", name: "chevron-right" })), subMenu());
|
29805
29804
|
}
|
@@ -53922,7 +53921,7 @@ function useTableEditingListener(table, tableRef, scrollToIndex) {
|
|
53922
53921
|
tableMeta.editing.saveChanges(table, (_a = table.getRowModel().rows[tableMeta.rowActive.rowActiveIndex]) == null ? void 0 : _a.id);
|
53923
53922
|
}
|
53924
53923
|
};
|
53925
|
-
}, [tableMeta.rowActive.rowActiveIndex]);
|
53924
|
+
}, [tableMeta.rowActive.rowActiveIndex, tableMeta.editing.isEditing]);
|
53926
53925
|
const hasChanges = tableMeta.editing.hasChanges();
|
53927
53926
|
React.useEffect(() => {
|
53928
53927
|
function showUnsavedChangesWarning(event) {
|
@@ -55355,11 +55354,13 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55355
55354
|
}
|
55356
55355
|
async function saveChanges(table, rowId = void 0) {
|
55357
55356
|
var _a, _b, _c;
|
55357
|
+
const tableMeta = table.options.meta;
|
55358
|
+
const state2 = tableMeta.editing.getState();
|
55358
55359
|
if (!handleSave) {
|
55359
55360
|
console.warn("Tried to save, but Table has no onEditingSave handler");
|
55360
55361
|
return false;
|
55361
55362
|
}
|
55362
|
-
const changes = rowId ? { [rowId]:
|
55363
|
+
const changes = rowId ? { [rowId]: state2.changes.rows[rowId] } : state2.changes.rows;
|
55363
55364
|
let completed = true;
|
55364
55365
|
for (const rowId2 of Object.keys(changes)) {
|
55365
55366
|
const status = getRowStatus(rowId2);
|
@@ -55369,7 +55370,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55369
55370
|
continue;
|
55370
55371
|
}
|
55371
55372
|
setRowStatus(rowId2, "saving");
|
55372
|
-
const changeSet = { ...
|
55373
|
+
const changeSet = { ...state2.changes.originals[rowId2], ...rowChanges };
|
55373
55374
|
if (isTemporaryRow(changeSet[rowIdentityAccessor])) {
|
55374
55375
|
delete changeSet[rowIdentityAccessor];
|
55375
55376
|
}
|
@@ -55439,7 +55440,11 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55439
55440
|
payload: { rowIdentityAccessor, changes, handleDiscard: handleDiscard2 }
|
55440
55441
|
});
|
55441
55442
|
}
|
55443
|
+
function getState() {
|
55444
|
+
return state;
|
55445
|
+
}
|
55442
55446
|
return {
|
55447
|
+
getState,
|
55443
55448
|
// row
|
55444
55449
|
getRowValue,
|
55445
55450
|
getRowMoveReason,
|
@@ -55988,7 +55993,10 @@ function Cell$1(props) {
|
|
55988
55993
|
const hasErrorAndIsEditing = cellError ? tableMeta.editing.isEditing : true;
|
55989
55994
|
const changedValue = tableMeta.editing.getCellValue(cell);
|
55990
55995
|
if (changedValue !== void 0 && changedValue !== cell.getValue() && hasErrorAndIsEditing) {
|
55991
|
-
|
55996
|
+
const getValue2 = () => changedValue;
|
55997
|
+
const context = cell.getContext();
|
55998
|
+
cell.getValue = getValue2;
|
55999
|
+
cell.getContext = () => ({ ...context, getValue: getValue2 });
|
55992
56000
|
}
|
55993
56001
|
if (isActiveRow || !!cellError || isHovered && !isActiveRow && !tableMeta.rowActive.isHoverStatePaused) {
|
55994
56002
|
return /* @__PURE__ */ React.createElement(EditingControlCell, { ...props });
|