@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.js
CHANGED
@@ -55899,10 +55899,17 @@ function EditingControlCell(props) {
|
|
55899
55899
|
const handleFocus = useEditingCellAutofocus(props);
|
55900
55900
|
const value = cell.getValue();
|
55901
55901
|
const rowChanges = tableMeta.editing.getRowValue(cell.row.id);
|
55902
|
+
const shouldRunUpdate = React__default.useRef(false);
|
55902
55903
|
const hasNonTextControl = React__default.useMemo(() => {
|
55903
55904
|
var _a;
|
55904
55905
|
return typeof type === "function" && !!((_a = cellRef.current) == null ? void 0 : _a.querySelector('[data-taco="Select2"],[data-taco="switch"],[data-taco="checkbox"]'));
|
55905
55906
|
}, [cellRef.current]);
|
55907
|
+
useLazyEffect(() => {
|
55908
|
+
if (hasNonTextControl && shouldRunUpdate.current) {
|
55909
|
+
tableMeta.editing.onCellChanged(cell, rowIndex, value, true, false);
|
55910
|
+
shouldRunUpdate.current = false;
|
55911
|
+
}
|
55912
|
+
}, [value]);
|
55906
55913
|
const handleChange = React__default.useCallback(
|
55907
55914
|
(nextValue) => {
|
55908
55915
|
let hasChanged = false;
|
@@ -55919,9 +55926,7 @@ function EditingControlCell(props) {
|
|
55919
55926
|
}
|
55920
55927
|
if (hasChanged) {
|
55921
55928
|
tableMeta.editing.setCellValue(cell, rowIndex, nextValue);
|
55922
|
-
|
55923
|
-
requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue, true, false));
|
55924
|
-
}
|
55929
|
+
shouldRunUpdate.current = hasNonTextControl;
|
55925
55930
|
}
|
55926
55931
|
},
|
55927
55932
|
[hasNonTextControl, cell.row.id, cell.column.id, cell.row.original, rowIndex, value, columnMeta.dataType]
|
@@ -56199,6 +56204,7 @@ function DiscardChangesConfirmationDialog(props) {
|
|
56199
56204
|
return /* @__PURE__ */ React__default.createElement(Dialog, { ...dialogProps, showCloseButton: false }, /* @__PURE__ */ React__default.createElement(
|
56200
56205
|
Dialog.Content,
|
56201
56206
|
{
|
56207
|
+
"data-taco": "discard-changes-dialog",
|
56202
56208
|
"aria-label": texts.table3.editing.clearChangesConfirmationDialog.title,
|
56203
56209
|
onClick: handleClickInsideDialogContent,
|
56204
56210
|
onKeyDown: handleKeydown
|