@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.js
CHANGED
@@ -29775,13 +29775,12 @@ const Item$2 = React.forwardRef(function MenuItem(props, ref) {
|
|
29775
29775
|
className: props.className
|
29776
29776
|
});
|
29777
29777
|
const disabled = props.disabled ?? props["aria-disabled"];
|
29778
|
-
|
29779
|
-
|
29780
|
-
handleClick = (event) => {
|
29778
|
+
const handleClick = (event) => {
|
29779
|
+
if (disabled) {
|
29781
29780
|
event.preventDefault();
|
29782
|
-
|
29783
|
-
|
29784
|
-
}
|
29781
|
+
}
|
29782
|
+
event.stopPropagation();
|
29783
|
+
};
|
29785
29784
|
if (subMenu) {
|
29786
29785
|
return /* @__PURE__ */ React.createElement($d08ef79370b62062$export$d7a01e11500dfb6f, null, /* @__PURE__ */ React.createElement($d08ef79370b62062$export$2ea8a7a591ac5eac, { ...otherProps, className, onClick: handleClick, ref }, icon ? /* @__PURE__ */ React.createElement(Icon, { name: icon }) : null, props.children, /* @__PURE__ */ React.createElement(Icon$1, { className: "-mr-1.5 ml-auto !h-5 !w-5", name: "chevron-right" })), subMenu());
|
29787
29786
|
}
|
@@ -53904,7 +53903,7 @@ function useTableEditingListener(table, tableRef, scrollToIndex) {
|
|
53904
53903
|
tableMeta.editing.saveChanges(table, (_a = table.getRowModel().rows[tableMeta.rowActive.rowActiveIndex]) == null ? void 0 : _a.id);
|
53905
53904
|
}
|
53906
53905
|
};
|
53907
|
-
}, [tableMeta.rowActive.rowActiveIndex]);
|
53906
|
+
}, [tableMeta.rowActive.rowActiveIndex, tableMeta.editing.isEditing]);
|
53908
53907
|
const hasChanges = tableMeta.editing.hasChanges();
|
53909
53908
|
React__default.useEffect(() => {
|
53910
53909
|
function showUnsavedChangesWarning(event) {
|
@@ -55337,11 +55336,13 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55337
55336
|
}
|
55338
55337
|
async function saveChanges(table, rowId = void 0) {
|
55339
55338
|
var _a, _b, _c;
|
55339
|
+
const tableMeta = table.options.meta;
|
55340
|
+
const state2 = tableMeta.editing.getState();
|
55340
55341
|
if (!handleSave) {
|
55341
55342
|
console.warn("Tried to save, but Table has no onEditingSave handler");
|
55342
55343
|
return false;
|
55343
55344
|
}
|
55344
|
-
const changes = rowId ? { [rowId]:
|
55345
|
+
const changes = rowId ? { [rowId]: state2.changes.rows[rowId] } : state2.changes.rows;
|
55345
55346
|
let completed = true;
|
55346
55347
|
for (const rowId2 of Object.keys(changes)) {
|
55347
55348
|
const status = getRowStatus(rowId2);
|
@@ -55351,7 +55352,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55351
55352
|
continue;
|
55352
55353
|
}
|
55353
55354
|
setRowStatus(rowId2, "saving");
|
55354
|
-
const changeSet = { ...
|
55355
|
+
const changeSet = { ...state2.changes.originals[rowId2], ...rowChanges };
|
55355
55356
|
if (isTemporaryRow(changeSet[rowIdentityAccessor])) {
|
55356
55357
|
delete changeSet[rowIdentityAccessor];
|
55357
55358
|
}
|
@@ -55421,7 +55422,11 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55421
55422
|
payload: { rowIdentityAccessor, changes, handleDiscard: handleDiscard2 }
|
55422
55423
|
});
|
55423
55424
|
}
|
55425
|
+
function getState() {
|
55426
|
+
return state;
|
55427
|
+
}
|
55424
55428
|
return {
|
55429
|
+
getState,
|
55425
55430
|
// row
|
55426
55431
|
getRowValue,
|
55427
55432
|
getRowMoveReason,
|
@@ -55970,7 +55975,10 @@ function Cell$1(props) {
|
|
55970
55975
|
const hasErrorAndIsEditing = cellError ? tableMeta.editing.isEditing : true;
|
55971
55976
|
const changedValue = tableMeta.editing.getCellValue(cell);
|
55972
55977
|
if (changedValue !== void 0 && changedValue !== cell.getValue() && hasErrorAndIsEditing) {
|
55973
|
-
|
55978
|
+
const getValue2 = () => changedValue;
|
55979
|
+
const context = cell.getContext();
|
55980
|
+
cell.getValue = getValue2;
|
55981
|
+
cell.getContext = () => ({ ...context, getValue: getValue2 });
|
55974
55982
|
}
|
55975
55983
|
if (isActiveRow || !!cellError || isHovered && !isActiveRow && !tableMeta.rowActive.isHoverStatePaused) {
|
55976
55984
|
return /* @__PURE__ */ React__default.createElement(EditingControlCell, { ...props });
|