@natoora-libs/core 0.1.16-dev-doug-5 → 0.1.16-dev-doug-6
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.
|
@@ -7995,7 +7995,8 @@ var TableDesktopNumericField = ({
|
|
|
7995
7995
|
}) => {
|
|
7996
7996
|
const [input, setInput] = (0, import_react36.useState)(initialValue);
|
|
7997
7997
|
const commitValue = (value) => {
|
|
7998
|
-
|
|
7998
|
+
const isDirty = value !== initialValue;
|
|
7999
|
+
if (!onUpdateEditableCell || !isDirty) {
|
|
7999
8000
|
return;
|
|
8000
8001
|
}
|
|
8001
8002
|
onUpdateEditableCell(rowId ?? 0, field, value, value);
|
|
@@ -8123,7 +8124,8 @@ var TableDesktopTextField = ({
|
|
|
8123
8124
|
const [input, setInput] = (0, import_react38.useState)(initialValue);
|
|
8124
8125
|
const hasValidationError = (0, import_react38.useMemo)(() => !validateInput?.(input), [input, validateInput]);
|
|
8125
8126
|
const commitValue = (value) => {
|
|
8126
|
-
|
|
8127
|
+
const isDirty = value !== initialValue;
|
|
8128
|
+
if (hasValidationError || !onUpdateEditableCell || !isDirty) {
|
|
8127
8129
|
return;
|
|
8128
8130
|
}
|
|
8129
8131
|
onUpdateEditableCell(rowId ?? 0, field, value, value);
|
|
@@ -8220,7 +8222,7 @@ var TableDesktopEditableComponent = ({
|
|
|
8220
8222
|
variant,
|
|
8221
8223
|
size,
|
|
8222
8224
|
field,
|
|
8223
|
-
initialValue: editInitialValue,
|
|
8225
|
+
initialValue: editInitialValue ?? "",
|
|
8224
8226
|
inputLabel: inputLabel ?? "",
|
|
8225
8227
|
validateInput,
|
|
8226
8228
|
onUpdateEditableCell
|
|
@@ -8234,7 +8236,7 @@ var TableDesktopEditableComponent = ({
|
|
|
8234
8236
|
variant,
|
|
8235
8237
|
size,
|
|
8236
8238
|
field,
|
|
8237
|
-
initialValue: editInitialValue,
|
|
8239
|
+
initialValue: editInitialValue ?? "",
|
|
8238
8240
|
inputLabel: inputLabel ?? "",
|
|
8239
8241
|
onUpdateEditableCell
|
|
8240
8242
|
}
|