@ahmadmubarak98/namozaj 1.11.5 → 1.11.7
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/main.d.ts +1 -1
- package/dist/namozaj.js +17 -4
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -352,7 +352,7 @@ export declare type NamozajPhoneFieldCountry = CountryIso2;
|
|
|
352
352
|
|
|
353
353
|
export declare interface NamozajProps {
|
|
354
354
|
fields: (NamozajBlock)[];
|
|
355
|
-
dirtyLock?:
|
|
355
|
+
dirtyLock?: 'defaultValue' | 'onChange';
|
|
356
356
|
unloadConfirm?: boolean;
|
|
357
357
|
localization?: NamozajLocalizationOptions;
|
|
358
358
|
stepper?: NamozajStepperConfig;
|
package/dist/namozaj.js
CHANGED
|
@@ -87776,7 +87776,7 @@ const Form = React__default.forwardRef(
|
|
|
87776
87776
|
async (ce) => {
|
|
87777
87777
|
var Re, ve;
|
|
87778
87778
|
let We = { ...ce };
|
|
87779
|
-
(Re = e.localization) != null && Re.includeInDataSubmission ? We[DEFAULT_LOCALE_PICKER_FIELD_NAME] = a : delete We[DEFAULT_LOCALE_PICKER_FIELD_NAME], await ((ve = e.onSubmit) == null ? void 0 : ve.call(e, We)), u((ze) => ze + 1), e.dirtyLock && g.reset(We);
|
|
87779
|
+
(Re = e.localization) != null && Re.includeInDataSubmission ? We[DEFAULT_LOCALE_PICKER_FIELD_NAME] = a : delete We[DEFAULT_LOCALE_PICKER_FIELD_NAME], await ((ve = e.onSubmit) == null ? void 0 : ve.call(e, We)), u((ze) => ze + 1), e.dirtyLock === "onChange" && g.reset(We);
|
|
87780
87780
|
},
|
|
87781
87781
|
[
|
|
87782
87782
|
e.onSubmit,
|
|
@@ -87876,7 +87876,7 @@ const Form = React__default.forwardRef(
|
|
|
87876
87876
|
});
|
|
87877
87877
|
}, [e.error]), useEffect(() => {
|
|
87878
87878
|
const ce = (We) => {
|
|
87879
|
-
if (g.formState.isDirty && e.unloadConfirm && (We.preventDefault(), !window.confirm()))
|
|
87879
|
+
if (g.formState.isDirty && e.unloadConfirm && e.dirtyLock === "onChange" && (We.preventDefault(), !window.confirm()))
|
|
87880
87880
|
return history.pushState(null, "", window.location.href), !1;
|
|
87881
87881
|
};
|
|
87882
87882
|
if (!e.isNested)
|
|
@@ -88070,7 +88070,10 @@ const Form = React__default.forwardRef(
|
|
|
88070
88070
|
return;
|
|
88071
88071
|
}
|
|
88072
88072
|
a == null || a.forEach((S) => {
|
|
88073
|
-
const x = c(
|
|
88073
|
+
const x = c(
|
|
88074
|
+
C,
|
|
88075
|
+
S
|
|
88076
|
+
);
|
|
88074
88077
|
b.push({
|
|
88075
88078
|
...x
|
|
88076
88079
|
});
|
|
@@ -88130,7 +88133,17 @@ const Form = React__default.forwardRef(
|
|
|
88130
88133
|
fields: p,
|
|
88131
88134
|
selectedLocales: a
|
|
88132
88135
|
},
|
|
88133
|
-
children: /* @__PURE__ */ jsx(
|
|
88136
|
+
children: /* @__PURE__ */ jsx(
|
|
88137
|
+
Form,
|
|
88138
|
+
{
|
|
88139
|
+
ref: t,
|
|
88140
|
+
...e,
|
|
88141
|
+
fields: p,
|
|
88142
|
+
...typeof e.dirtyLock == "boolean" && {
|
|
88143
|
+
dirtyLock: "onChange"
|
|
88144
|
+
}
|
|
88145
|
+
}
|
|
88146
|
+
)
|
|
88134
88147
|
}
|
|
88135
88148
|
);
|
|
88136
88149
|
}
|