@mcurros2/microm 1.1.96-0 → 1.1.98-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/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -154,8 +154,8 @@ $parcel$export(module.exports, "useEntityForm", function () { return $8b0c683387
|
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
parcelRequire("2eyXi");
|
|
157
|
-
var $lTNXP = parcelRequire("lTNXP");
|
|
158
157
|
var $iKzSR = parcelRequire("iKzSR");
|
|
158
|
+
var $lTNXP = parcelRequire("lTNXP");
|
|
159
159
|
parcelRequire("6Rdyz");
|
|
160
160
|
var $98ddT = parcelRequire("98ddT");
|
|
161
161
|
|
|
@@ -244,6 +244,7 @@ function $8b0c683387a5432f$export$f1f43a62560a15ec(props) {
|
|
|
244
244
|
}, [
|
|
245
245
|
form
|
|
246
246
|
]);
|
|
247
|
+
const lastGetValues = (0, $b4te3$react.useRef)();
|
|
247
248
|
// Form Handlers
|
|
248
249
|
const performGetData = (0, $b4te3$react.useCallback)(()=>$8b0c683387a5432f$var$__awaiter(this, void 0, void 0, function*() {
|
|
249
250
|
setStatus({
|
|
@@ -256,11 +257,14 @@ function $8b0c683387a5432f$export$f1f43a62560a15ec(props) {
|
|
|
256
257
|
if (ret) {
|
|
257
258
|
const new_values = (0, $vXZlt.getMantineValuesObject)(form.values, entity.def.columns, true);
|
|
258
259
|
form.setValues(new_values);
|
|
260
|
+
lastGetValues.current = new_values;
|
|
259
261
|
const new_status = {
|
|
260
262
|
loading: false,
|
|
261
263
|
operationType: "get"
|
|
262
264
|
};
|
|
263
265
|
setStatus(new_status);
|
|
266
|
+
form.resetDirty();
|
|
267
|
+
form.resetTouched();
|
|
264
268
|
}
|
|
265
269
|
return ret;
|
|
266
270
|
} catch (e) {
|
|
@@ -425,6 +429,7 @@ function $8b0c683387a5432f$export$f1f43a62560a15ec(props) {
|
|
|
425
429
|
const removeValidation = (0, $b4te3$react.useCallback)((column)=>{
|
|
426
430
|
delete validationObject.current[column.name];
|
|
427
431
|
}, []);
|
|
432
|
+
// getDataOnInit
|
|
428
433
|
(0, $b4te3$react.useEffect)(()=>{
|
|
429
434
|
const cancellation = getAbortController.current;
|
|
430
435
|
if (getDataOnInit) {
|
|
@@ -461,9 +466,9 @@ function $8b0c683387a5432f$export$f1f43a62560a15ec(props) {
|
|
|
461
466
|
(0, $b4te3$react.useEffect)(()=>{
|
|
462
467
|
const handleBeforeUnload = ()=>$8b0c683387a5432f$var$__awaiter(this, void 0, void 0, function*() {
|
|
463
468
|
try {
|
|
464
|
-
if (saveBeforeRemoteNavigation
|
|
469
|
+
if (saveBeforeRemoteNavigation) {
|
|
465
470
|
form.validate();
|
|
466
|
-
yield saveAndGet();
|
|
471
|
+
if (!(0, $iKzSR.areValuesObjectsEqual)(form.values, lastGetValues.current)) yield saveAndGet();
|
|
467
472
|
}
|
|
468
473
|
} catch (ex) {
|
|
469
474
|
console.error("SaveBeforeRemoteNavigation", ex);
|
|
@@ -484,7 +489,7 @@ function $8b0c683387a5432f$export$f1f43a62560a15ec(props) {
|
|
|
484
489
|
try {
|
|
485
490
|
if (saveBeforeLocalNavigation && form.isDirty() && prevLocationRef.current !== window.location.hash) {
|
|
486
491
|
form.validate();
|
|
487
|
-
yield saveAndGet();
|
|
492
|
+
if (!(0, $iKzSR.areValuesObjectsEqual)(form.values, lastGetValues.current)) yield saveAndGet();
|
|
488
493
|
}
|
|
489
494
|
} catch (ex) {
|
|
490
495
|
console.error("SaveBeforeLocalNavigation", ex);
|