dirk-cfx-react 1.1.50 → 1.1.51
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/hooks/index.cjs +17 -33
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +17 -33
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +17 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2078,7 +2078,7 @@ function createFormStore(initialValues, validationRules, onSubmit) {
|
|
|
2078
2078
|
const newValues = setNested(currentValues, path, value);
|
|
2079
2079
|
const oldValue = getNested(state.initialValues, path);
|
|
2080
2080
|
const hasChanged = value !== oldValue;
|
|
2081
|
-
history.push(currentValues);
|
|
2081
|
+
history.push({ values: currentValues, changed: new Set(changed) });
|
|
2082
2082
|
future.length = 0;
|
|
2083
2083
|
let newPartial = state.partialChanged;
|
|
2084
2084
|
if (hasChanged) {
|
|
@@ -2168,25 +2168,17 @@ function createFormStore(initialValues, validationRules, onSubmit) {
|
|
|
2168
2168
|
},
|
|
2169
2169
|
back: () => {
|
|
2170
2170
|
if (!history.length) return;
|
|
2171
|
-
const
|
|
2172
|
-
future.push(get().values);
|
|
2173
|
-
const initial = get().initialValues;
|
|
2174
|
-
let partial = {};
|
|
2171
|
+
const entry = history.pop();
|
|
2172
|
+
future.push({ values: get().values, changed: new Set(changed) });
|
|
2175
2173
|
changed.clear();
|
|
2176
|
-
const
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
for (const path of allKeys) {
|
|
2182
|
-
const val = getNested(prev, path);
|
|
2183
|
-
if (val !== getNested(initial, path)) {
|
|
2184
|
-
changed.add(path);
|
|
2185
|
-
partial = setNested(partial, path, val);
|
|
2186
|
-
}
|
|
2174
|
+
for (const f of entry.changed) changed.add(f);
|
|
2175
|
+
let partial = {};
|
|
2176
|
+
for (const path of changed) {
|
|
2177
|
+
const val = getNested(entry.values, path);
|
|
2178
|
+
partial = setNested(partial, path, val);
|
|
2187
2179
|
}
|
|
2188
2180
|
set({
|
|
2189
|
-
values:
|
|
2181
|
+
values: entry.values,
|
|
2190
2182
|
partialChanged: partial,
|
|
2191
2183
|
canBack: history.length > 0,
|
|
2192
2184
|
canForward: true,
|
|
@@ -2196,25 +2188,17 @@ function createFormStore(initialValues, validationRules, onSubmit) {
|
|
|
2196
2188
|
},
|
|
2197
2189
|
forward: () => {
|
|
2198
2190
|
if (!future.length) return;
|
|
2199
|
-
const
|
|
2200
|
-
history.push(get().values);
|
|
2201
|
-
const initial = get().initialValues;
|
|
2202
|
-
let partial = {};
|
|
2191
|
+
const entry = future.pop();
|
|
2192
|
+
history.push({ values: get().values, changed: new Set(changed) });
|
|
2203
2193
|
changed.clear();
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
for (const path of allKeys) {
|
|
2210
|
-
const val = getNested(next, path);
|
|
2211
|
-
if (val !== getNested(initial, path)) {
|
|
2212
|
-
changed.add(path);
|
|
2213
|
-
partial = setNested(partial, path, val);
|
|
2214
|
-
}
|
|
2194
|
+
for (const f of entry.changed) changed.add(f);
|
|
2195
|
+
let partial = {};
|
|
2196
|
+
for (const path of changed) {
|
|
2197
|
+
const val = getNested(entry.values, path);
|
|
2198
|
+
partial = setNested(partial, path, val);
|
|
2215
2199
|
}
|
|
2216
2200
|
set({
|
|
2217
|
-
values:
|
|
2201
|
+
values: entry.values,
|
|
2218
2202
|
partialChanged: partial,
|
|
2219
2203
|
canBack: true,
|
|
2220
2204
|
canForward: future.length > 0,
|