@griddo/ax 11.11.3-rc.0 → 11.11.3
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/package.json +2 -2
- package/src/hooks/forms.tsx +13 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "11.11.3
|
|
4
|
+
"version": "11.11.3",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -217,5 +217,5 @@
|
|
|
217
217
|
"publishConfig": {
|
|
218
218
|
"access": "public"
|
|
219
219
|
},
|
|
220
|
-
"gitHead": "
|
|
220
|
+
"gitHead": "6d836cec67937b9e209e1d69f035d34f7d8aa03f"
|
|
221
221
|
}
|
package/src/hooks/forms.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { FormContent, IUser } from "@ax/types";
|
|
|
6
6
|
|
|
7
7
|
import isEqual from "lodash.isequal";
|
|
8
8
|
|
|
9
|
-
const DEBUG_DIRTY =
|
|
9
|
+
const DEBUG_DIRTY = false;
|
|
10
10
|
|
|
11
11
|
const useDebounce = (value: any) => {
|
|
12
12
|
// State and setters for debounced value
|
|
@@ -136,15 +136,18 @@ const useIsDirty = (
|
|
|
136
136
|
return false;
|
|
137
137
|
}, [prevContent, updatedValues, debug]);
|
|
138
138
|
|
|
139
|
-
const resetDirty = useCallback(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
const resetDirty = useCallback(
|
|
140
|
+
(reseting = true, forceUpdate = false) => {
|
|
141
|
+
if (debug) {
|
|
142
|
+
console.log(`[useIsDirty] resetDirty(resetting=${reseting}, force=${forceUpdate})`);
|
|
143
|
+
}
|
|
144
|
+
setIsDirty(false);
|
|
145
|
+
setIsSaved(true);
|
|
146
|
+
reseting && setIsResetting(true);
|
|
147
|
+
setForce(forceUpdate);
|
|
148
|
+
},
|
|
149
|
+
[debug],
|
|
150
|
+
);
|
|
148
151
|
|
|
149
152
|
// biome-ignore lint/correctness/useExhaustiveDependencies: TODO: fix this
|
|
150
153
|
useEffect(() => {
|