@economic/taco 2.69.1 → 2.69.2-onEditingChange-stale.0
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 +9 -3
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.js +9 -3
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.cjs
CHANGED
@@ -55917,10 +55917,17 @@ function EditingControlCell(props) {
|
|
55917
55917
|
const handleFocus = useEditingCellAutofocus(props);
|
55918
55918
|
const value = cell.getValue();
|
55919
55919
|
const rowChanges = tableMeta.editing.getRowValue(cell.row.id);
|
55920
|
+
const shouldRunUpdate = React.useRef(false);
|
55920
55921
|
const hasNonTextControl = React.useMemo(() => {
|
55921
55922
|
var _a;
|
55922
55923
|
return typeof type === "function" && !!((_a = cellRef.current) == null ? void 0 : _a.querySelector('[data-taco="Select2"],[data-taco="switch"],[data-taco="checkbox"]'));
|
55923
55924
|
}, [cellRef.current]);
|
55925
|
+
useLazyEffect(() => {
|
55926
|
+
if (hasNonTextControl && shouldRunUpdate.current) {
|
55927
|
+
tableMeta.editing.onCellChanged(cell, rowIndex, value, true, false);
|
55928
|
+
shouldRunUpdate.current = false;
|
55929
|
+
}
|
55930
|
+
}, [value]);
|
55924
55931
|
const handleChange = React.useCallback(
|
55925
55932
|
(nextValue) => {
|
55926
55933
|
let hasChanged = false;
|
@@ -55937,9 +55944,7 @@ function EditingControlCell(props) {
|
|
55937
55944
|
}
|
55938
55945
|
if (hasChanged) {
|
55939
55946
|
tableMeta.editing.setCellValue(cell, rowIndex, nextValue);
|
55940
|
-
|
55941
|
-
requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue, true, false));
|
55942
|
-
}
|
55947
|
+
shouldRunUpdate.current = hasNonTextControl;
|
55943
55948
|
}
|
55944
55949
|
},
|
55945
55950
|
[hasNonTextControl, cell.row.id, cell.column.id, cell.row.original, rowIndex, value, columnMeta.dataType]
|
@@ -56217,6 +56222,7 @@ function DiscardChangesConfirmationDialog(props) {
|
|
56217
56222
|
return /* @__PURE__ */ React.createElement(Dialog, { ...dialogProps, showCloseButton: false }, /* @__PURE__ */ React.createElement(
|
56218
56223
|
Dialog.Content,
|
56219
56224
|
{
|
56225
|
+
"data-taco": "discard-changes-dialog",
|
56220
56226
|
"aria-label": texts.table3.editing.clearChangesConfirmationDialog.title,
|
56221
56227
|
onClick: handleClickInsideDialogContent,
|
56222
56228
|
onKeyDown: handleKeydown
|