@ahmadmubarak98/namozaj 1.8.4 → 1.8.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.
package/dist/main.d.ts CHANGED
@@ -299,6 +299,7 @@ export declare type NamozajPhoneFieldCountry = CountryIso2;
299
299
  export declare interface NamozajProps {
300
300
  fields: NamozajField[];
301
301
  dirtyLock?: boolean;
302
+ unloadConfirm?: boolean;
302
303
  localization?: NamozajLocalizationOptions;
303
304
  stepper?: NamozajStepperConfig;
304
305
  emptyFormMessage?: string;
@@ -523,7 +524,7 @@ export declare type TooltipPlacement = AutoPlacement | BasePlacement | Variation
523
524
  export declare type ValidationMode = "onChange" | "onBlur" | "onTouched" | "onSubmit" | "all";
524
525
 
525
526
  export declare type ValidationRule = {
526
- type: "required" | "pattern" | "minLength" | "maxLength" | "min" | "max" | "email" | "phone" | "url" | "between";
527
+ type: "required" | "pattern" | "min" | "max" | "email" | "phone" | "url" | "between";
527
528
  value?: FieldValueType | RegExp;
528
529
  when?: {
529
530
  field: string;
package/dist/namozaj.js CHANGED
@@ -6133,7 +6133,7 @@ const createYupSchema = (e) => {
6133
6133
  t.errorMessage ? t.errorMessage : `Minimum value is ${t.value}`
6134
6134
  );
6135
6135
  if (e.type === "string")
6136
- return e.min(
6136
+ return e.length(
6137
6137
  t.value,
6138
6138
  t.errorMessage ? t.errorMessage : `Minimum length is ${t.value}`
6139
6139
  );
@@ -6145,7 +6145,7 @@ const createYupSchema = (e) => {
6145
6145
  t.errorMessage ? t.errorMessage : `Maximum value is ${t.value}`
6146
6146
  );
6147
6147
  if (e.type === "string")
6148
- return e.max(
6148
+ return e.length(
6149
6149
  t.value,
6150
6150
  t.errorMessage ? t.errorMessage : `Maximum length is ${t.value}`
6151
6151
  );
@@ -87641,14 +87641,14 @@ const Form = React__default.forwardRef(
87641
87641
  });
87642
87642
  }, [e.error]), useEffect(() => {
87643
87643
  const K = (ce) => {
87644
- if (h.formState.isDirty && (ce.preventDefault(), !window.confirm()))
87644
+ if (h.formState.isDirty && e.unloadConfirm && (ce.preventDefault(), !window.confirm()))
87645
87645
  return history.pushState(null, "", window.location.href), !1;
87646
87646
  };
87647
87647
  if (!e.isNested)
87648
87648
  return window.addEventListener("beforeunload", K), () => {
87649
87649
  window.removeEventListener("beforeunload", K);
87650
87650
  };
87651
- }, [h.formState.isDirty]);
87651
+ }, [h.formState.isDirty, e.unloadConfirm]);
87652
87652
  const N = (K) => /* @__PURE__ */ jsx(Grid, { container: !0, spacing: 2, children: (K || []).map((ce, we) => /* @__PURE__ */ jsx(Fragment$1, { children: ce.meta.fullRow ? /* @__PURE__ */ jsx(
87653
87653
  Grid,
87654
87654
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ahmadmubarak98/namozaj",
3
3
  "private": false,
4
- "version": "1.8.4",
4
+ "version": "1.8.6",
5
5
  "type": "module",
6
6
  "main": "dist/namozaj.js",
7
7
  "types": "dist/main.d.ts",