@ahmadmubarak98/namozaj 1.9.0 → 1.10.1

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
@@ -47,15 +47,36 @@ export declare type BaseFormFieldProps = {
47
47
  value: any;
48
48
  onChange: ((value: any) => void);
49
49
  error?: boolean;
50
- config: NamozajField;
50
+ config: NamozajBlock;
51
51
  locale?: string | undefined;
52
52
  };
53
53
 
54
+ export declare type BaseFormRepresentationalBlockProps = {
55
+ id?: string;
56
+ name: string;
57
+ config: NamozajRepresentationalBlock;
58
+ };
59
+
54
60
  export declare type BasePlacement = "top" | "bottom" | "right" | "left";
55
61
 
56
- export declare type ButtonConfig = BaseFieldConfig & {
57
- type: "text";
58
- meta: Omit<BaseFieldConfig["meta"], 'defaultValue, placeholder, translated, validations, renderLabelRightSide, dependencies, onValueChange, compute'> & {
62
+ export declare type BaseRepresentationalBlockConfig = {
63
+ name: string;
64
+ type: "button";
65
+ meta: {
66
+ style?: React.CSSProperties;
67
+ className?: string;
68
+ hidden?: boolean;
69
+ fullRow?: boolean;
70
+ grid?: GridColumnConfig;
71
+ visibilityRules?: VisibilityRule[];
72
+ step?: number | string;
73
+ };
74
+ };
75
+
76
+ export declare type ButtonConfig = BaseRepresentationalBlockConfig & {
77
+ type: "button";
78
+ meta: BaseRepresentationalBlockConfig['meta'] & {
79
+ label: string;
59
80
  variant?: ButtonOwnProps['variant'];
60
81
  startIcon?: React.ReactNode | string;
61
82
  size?: ButtonOwnProps['size'];
@@ -292,7 +313,9 @@ export declare type MultiSelectFieldConfig = BaseFieldConfig & {
292
313
 
293
314
  export declare const Namozaj: default_2.ForwardRefExoticComponent<NamozajProps & default_2.RefAttributes<any>>;
294
315
 
295
- export declare type NamozajField = ButtonConfig | TextFieldConfig | NumberFieldConfig | SliderFieldConfig | PhoneFieldConfig | GroupFieldConfig | SelectFieldConfig | MultiSelectFieldConfig | CheckBoxGroupFieldConfig | RadioGroupFieldConfig | SwitchFieldConfig | CheckboxFieldConfig | DateFieldConfig | FileFieldConfig | ComputedFieldConfig | SectionFieldConfig | ButtonFieldConfig | RepeaterFieldConfig | FieldArrayFieldConfig;
316
+ export declare type NamozajBlock = NamozajField | NamozajRepresentationalBlock;
317
+
318
+ export declare type NamozajField = TextFieldConfig | NumberFieldConfig | SliderFieldConfig | PhoneFieldConfig | GroupFieldConfig | SelectFieldConfig | MultiSelectFieldConfig | CheckBoxGroupFieldConfig | RadioGroupFieldConfig | SwitchFieldConfig | CheckboxFieldConfig | DateFieldConfig | FileFieldConfig | ComputedFieldConfig | SectionFieldConfig | ButtonFieldConfig | RepeaterFieldConfig | FieldArrayFieldConfig;
296
319
 
297
320
  export declare type NamozajFormMethods = RHFFormMethods & {
298
321
  validateForm: () => Promise<boolean>;
@@ -317,7 +340,7 @@ export declare interface NamozajLocalizationOptions {
317
340
  export declare type NamozajPhoneFieldCountry = CountryIso2;
318
341
 
319
342
  export declare interface NamozajProps {
320
- fields: NamozajField[];
343
+ fields: (NamozajBlock)[];
321
344
  dirtyLock?: boolean;
322
345
  unloadConfirm?: boolean;
323
346
  localization?: NamozajLocalizationOptions;
@@ -346,6 +369,8 @@ export declare interface NamozajProps {
346
369
  onChange?: (data: any) => void;
347
370
  }
348
371
 
372
+ export declare type NamozajRepresentationalBlock = ButtonConfig;
373
+
349
374
  export declare type NamozajStepItem = {
350
375
  label: string;
351
376
  description?: React.ReactNode;
package/dist/namozaj.js CHANGED
@@ -4,7 +4,7 @@ var K1 = (e, t, a) => ob(e, typeof t != "symbol" ? t + "" : t, a);
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import * as React from "react";
6
6
  import React__default, { useState, useEffect, useMemo, createContext, useContext, createElement, useCallback, isValidElement, cloneElement, Children, useRef, forwardRef, useImperativeHandle, useReducer, Fragment as Fragment$1, Component as Component$1, memo, useLayoutEffect } from "react";
7
- import { Stack, Box as Box$1, TextField as TextField$2, IconButton as IconButton$1, InputLabel as InputLabel$1, Autocomplete, Select as Select$1, Checkbox, MenuItem as MenuItem$1, InputAdornment as InputAdornment$1, Tooltip as Tooltip$1, FormControlLabel, FormGroup, FormControl as FormControl$1, RadioGroup, Radio, Switch, Typography as Typography$1, Avatar, CircularProgress as CircularProgress$1, Button as Button$1, Slider, Portal as Portal$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, FormHelperText as FormHelperText$1, Grid } from "@mui/material";
7
+ import { Stack, Box as Box$1, TextField as TextField$2, IconButton as IconButton$1, InputLabel as InputLabel$1, Autocomplete, Select as Select$1, Checkbox, MenuItem as MenuItem$1, InputAdornment as InputAdornment$1, Tooltip as Tooltip$1, FormControlLabel, FormGroup, FormControl as FormControl$1, RadioGroup, Radio, Switch, Typography as Typography$1, Avatar, CircularProgress as CircularProgress$1, Button as Button$2, Slider, Portal as Portal$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, FormHelperText as FormHelperText$1, Grid } from "@mui/material";
8
8
  import emStyled from "@emotion/styled";
9
9
  import { Global, ThemeContext, keyframes, css } from "@emotion/react";
10
10
  const defaultContextValue = {
@@ -1247,20 +1247,25 @@ function useForm(e = {}) {
1247
1247
  }, [e.shouldUnregister, p]), t.current.formState = getProxyFormState(l, p), t.current;
1248
1248
  }
1249
1249
  const DEFAULT_LOCALE_PICKER_FIELD_NAME = "localePicker_Field", DEFAULT_GRID_SIZE = 12, DEFAULT_FIELD_VARIANT = "outlined", DEFAULT_FIELD_SIZE = "medium", DEFAULT_TEXT_AREA_ROWS = 4, FIELDS_EXCLUDE_VALIDATION = [
1250
- "group"
1251
- ], FIELDS_TO_FLATTEN = ["group"], FIELDS_EXCLUDE_LABEL = [
1250
+ "group",
1251
+ "button"
1252
+ ], FIELDS_TO_FLATTEN = ["group"], FIELDS_EXCLUDE_AS_VALUE = [
1253
+ "button"
1254
+ ], REPRSENTATIONAL_BLOCKS = ["button"], FIELDS_EXCLUDE_LABEL = [
1252
1255
  "checkbox",
1253
1256
  "switch",
1254
1257
  "repeater",
1255
1258
  "field-array",
1256
- "group"
1259
+ "group",
1260
+ "button"
1257
1261
  ], FIELDS_EXCLUDE_HELPER_TEXT = [
1258
1262
  "repeater",
1259
1263
  "field-array",
1260
1264
  "group"
1261
1265
  ], FIELDS_EXCLUDE_REPEATER_GRID_HEADER = [
1262
1266
  "repeater",
1263
- "group"
1267
+ "group",
1268
+ "button"
1264
1269
  ], EXTENSION_MIME_TYPE_MAP = {
1265
1270
  123: "application/vnd.lotus-1-2-3",
1266
1271
  "1km": "application/vnd.1000minds.decision-model+xml",
@@ -6048,7 +6053,7 @@ addMethod(create$6, YUP_PHONE_METHOD, function(t, a) {
6048
6053
  });
6049
6054
  });
6050
6055
  const createYupSchema = (e) => {
6051
- const l = flattenFields(e).filter(
6056
+ const l = flattenFields(e).filter((c) => !FIELDS_EXCLUDE_AS_VALUE.includes(c.type) && c.name).filter(
6052
6057
  (c) => !FIELDS_EXCLUDE_VALIDATION.includes(c.type)
6053
6058
  ).reduce((c, p) => (c[p.name] = createFieldValidator(p), c), {});
6054
6059
  return create$3().shape(l);
@@ -24682,7 +24687,7 @@ const useUtilityClasses$14 = (e) => {
24682
24687
  display: "inline-block",
24683
24688
  width: "1em",
24684
24689
  height: "1em"
24685
- }), Button = /* @__PURE__ */ React.forwardRef(function e(t, a) {
24690
+ }), Button$1 = /* @__PURE__ */ React.forwardRef(function e(t, a) {
24686
24691
  const l = React.useContext(ButtonGroupContext), c = React.useContext(ButtonGroupButtonContext), p = resolveProps(l, t), d = useDefaultProps({
24687
24692
  props: p,
24688
24693
  name: "MuiButton"
@@ -24767,7 +24772,7 @@ const useUtilityClasses$14 = (e) => {
24767
24772
  children: [re, N !== "end" && We, u, N === "end" && We, Z]
24768
24773
  });
24769
24774
  });
24770
- process.env.NODE_ENV !== "production" && (Button.propTypes = {
24775
+ process.env.NODE_ENV !== "production" && (Button$1.propTypes = {
24771
24776
  // ┌────────────────────────────── Warning ──────────────────────────────┐
24772
24777
  // │ These PropTypes are generated from the TypeScript type definitions. │
24773
24778
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -24980,22 +24985,22 @@ function PickersActionBar(e) {
24980
24985
  const b = p == null ? void 0 : p.map((h) => {
24981
24986
  switch (h) {
24982
24987
  case "clear":
24983
- return /* @__PURE__ */ jsx(Button, {
24988
+ return /* @__PURE__ */ jsx(Button$1, {
24984
24989
  onClick: a,
24985
24990
  children: u.clearButtonLabel
24986
24991
  }, h);
24987
24992
  case "cancel":
24988
- return /* @__PURE__ */ jsx(Button, {
24993
+ return /* @__PURE__ */ jsx(Button$1, {
24989
24994
  onClick: l,
24990
24995
  children: u.cancelButtonLabel
24991
24996
  }, h);
24992
24997
  case "accept":
24993
- return /* @__PURE__ */ jsx(Button, {
24998
+ return /* @__PURE__ */ jsx(Button$1, {
24994
24999
  onClick: t,
24995
25000
  children: u.okButtonLabel
24996
25001
  }, h);
24997
25002
  case "today":
24998
- return /* @__PURE__ */ jsx(Button, {
25003
+ return /* @__PURE__ */ jsx(Button$1, {
24999
25004
  onClick: c,
25000
25005
  children: u.todayButtonLabel
25001
25006
  }, h);
@@ -40309,7 +40314,7 @@ const pickersToolbarTextClasses = generateUtilityClasses("MuiPickersToolbarText"
40309
40314
  return composeClasses({
40310
40315
  root: ["root"]
40311
40316
  }, getPickersToolbarUtilityClass, t);
40312
- }, PickersToolbarButtonRoot = styled(Button, {
40317
+ }, PickersToolbarButtonRoot = styled(Button$1, {
40313
40318
  name: "MuiPickersToolbarButton",
40314
40319
  slot: "Root",
40315
40320
  overridesResolver: (e, t) => t.root
@@ -50944,7 +50949,7 @@ const FileField = ({
50944
50949
  Ne ? Ne.focus() : alert("Please allow popups for this website");
50945
50950
  }, a0 = () => /* @__PURE__ */ jsxs(Box$1, { display: "flex", flexDirection: "column", gap: 2, children: [
50946
50951
  /* @__PURE__ */ jsxs(
50947
- Button$1,
50952
+ Button$2,
50948
50953
  {
50949
50954
  loading: oe,
50950
50955
  loadingIndicator: C,
@@ -51082,7 +51087,7 @@ const FileField = ({
51082
51087
  }
51083
51088
  )
51084
51089
  ] }),
51085
- /* @__PURE__ */ jsxs(Button$1, { variant: "outlined", component: "label", fullWidth: !0, children: [
51090
+ /* @__PURE__ */ jsxs(Button$2, { variant: "outlined", component: "label", fullWidth: !0, children: [
51086
51091
  x,
51087
51092
  /* @__PURE__ */ jsx(
51088
51093
  "input",
@@ -51145,6 +51150,7 @@ const FileField = ({
51145
51150
  size: d.size || DEFAULT_FIELD_SIZE,
51146
51151
  type: "number",
51147
51152
  error: c,
51153
+ disabled: d.disabled,
51148
51154
  slotProps: {
51149
51155
  input: {
51150
51156
  startAdornment: d.startAdornment,
@@ -51259,8 +51265,8 @@ const FileField = ({
51259
51265
  ...a == null ? void 0 : a.dialogActions
51260
51266
  },
51261
51267
  children: [
51262
- /* @__PURE__ */ jsx(Button$1, { disabled: b, type: "button", onClick: C, children: c || "Cancel" }),
51263
- /* @__PURE__ */ jsx(Button$1, { loading: b, type: "button", onClick: v, children: p || d || e })
51268
+ /* @__PURE__ */ jsx(Button$2, { disabled: b, type: "button", onClick: C, children: c || "Cancel" }),
51269
+ /* @__PURE__ */ jsx(Button$2, { loading: b, type: "button", onClick: v, children: p || d || e })
51264
51270
  ]
51265
51271
  }
51266
51272
  )
@@ -85343,7 +85349,7 @@ const RowActions = ({
85343
85349
  onRemoveClick: d
85344
85350
  }) => /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: 1, children: [
85345
85351
  l && /* @__PURE__ */ jsx(
85346
- Button$1,
85352
+ Button$2,
85347
85353
  {
85348
85354
  onClick: () => p && p(e),
85349
85355
  variant: "outlined",
@@ -85353,7 +85359,7 @@ const RowActions = ({
85353
85359
  }
85354
85360
  ),
85355
85361
  c && /* @__PURE__ */ jsx(
85356
- Button$1,
85362
+ Button$2,
85357
85363
  {
85358
85364
  onClick: () => d && d(e),
85359
85365
  variant: "outlined",
@@ -85441,7 +85447,7 @@ const RowActions = ({
85441
85447
  addBtn: a,
85442
85448
  onAddClick: l
85443
85449
  }) => /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 2, justifyContent: "end", children: e.length > 0 && t && /* @__PURE__ */ jsx(
85444
- Button$1,
85450
+ Button$2,
85445
85451
  {
85446
85452
  type: "button",
85447
85453
  variant: "contained",
@@ -85597,10 +85603,10 @@ const ConfirmationDialog = ({
85597
85603
  /* @__PURE__ */ jsx(DialogTitle, { children: t }),
85598
85604
  /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContentText, { children: a }) }),
85599
85605
  /* @__PURE__ */ jsxs(DialogActions, { children: [
85600
- /* @__PURE__ */ jsx(Button, { disabled: p, onClick: () => {
85606
+ /* @__PURE__ */ jsx(Button$1, { disabled: p, onClick: () => {
85601
85607
  u && typeof u == "function" && u();
85602
85608
  }, children: l || "Cancel" }),
85603
- /* @__PURE__ */ jsx(Button, { loading: p, onClick: () => {
85609
+ /* @__PURE__ */ jsx(Button$1, { loading: p, onClick: () => {
85604
85610
  d && typeof d == "function" && d();
85605
85611
  }, autoFocus: !0, children: c || "Confirm" })
85606
85612
  ] })
@@ -85742,7 +85748,7 @@ const ConfirmationDialog = ({
85742
85748
  children: [
85743
85749
  /* @__PURE__ */ jsx(Typography$1, { variant: "body1", children: t.meta.emptyMessage }),
85744
85750
  /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, mt: 1, children: Y && /* @__PURE__ */ jsx(
85745
- Button$1,
85751
+ Button$2,
85746
85752
  {
85747
85753
  variant: "outlined",
85748
85754
  size: "small",
@@ -85886,7 +85892,7 @@ const ConfirmationDialog = ({
85886
85892
  },
85887
85893
  children: [
85888
85894
  /* @__PURE__ */ jsx(Typography$1, { variant: "body1", children: t.meta.emptyMessage }),
85889
- /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, mt: 1, children: K && /* @__PURE__ */ jsx(Button$1, { variant: "outlined", size: "small", onClick: j, children: N }) })
85895
+ /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, mt: 1, children: K && /* @__PURE__ */ jsx(Button$2, { variant: "outlined", size: "small", onClick: j, children: N }) })
85890
85896
  ]
85891
85897
  }
85892
85898
  ),
@@ -85911,7 +85917,7 @@ const ConfirmationDialog = ({
85911
85917
  }
85912
85918
  ),
85913
85919
  k && !((we = d.unRemovableIndexes) != null && we.includes(ye)) && /* @__PURE__ */ jsx(
85914
- Button$1,
85920
+ Button$2,
85915
85921
  {
85916
85922
  variant: "outlined",
85917
85923
  color: "error",
@@ -85980,7 +85986,7 @@ const ConfirmationDialog = ({
85980
85986
  ] }, ve._id);
85981
85987
  }),
85982
85988
  /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 2, justifyContent: "end", children: h.fields.length > 0 && K && /* @__PURE__ */ jsx(
85983
- Button$1,
85989
+ Button$2,
85984
85990
  {
85985
85991
  type: "button",
85986
85992
  variant: "contained",
@@ -86008,6 +86014,28 @@ const ConfirmationDialog = ({
86008
86014
  )) }),
86009
86015
  ((p = a.helperText) == null ? void 0 : p.content) && /* @__PURE__ */ jsx(Box$1, { mt: 0.25, children: /* @__PURE__ */ jsx(HelperText, { ...a.helperText }) })
86010
86016
  ] }) });
86017
+ }, Button = (e) => {
86018
+ const { config: t } = e, { meta: a } = t, l = useFormContext(), c = useCallback(() => {
86019
+ var p;
86020
+ (p = a.onClick) == null || p.call(a, l);
86021
+ }, [a, l]);
86022
+ return /* @__PURE__ */ jsx(
86023
+ Button$2,
86024
+ {
86025
+ variant: a.variant || "contained",
86026
+ size: a.size || "medium",
86027
+ color: a.color || "primary",
86028
+ onClick: c,
86029
+ disabled: a.disabled,
86030
+ hidden: a.hidden,
86031
+ startIcon: a.startIcon,
86032
+ endIcon: a.endIcon,
86033
+ fullWidth: a.fullWidth,
86034
+ style: a.style,
86035
+ className: a.className,
86036
+ children: a.label
86037
+ }
86038
+ );
86011
86039
  }, FieldRenderer = (e) => {
86012
86040
  var C, v, T, S;
86013
86041
  const { fieldsOptions: t, setFieldOptions: a } = useLocalNamozajProvider(), l = useRef(`${e.name}`), [c, p] = useState(!0), d = e.meta || {}, u = e.locale, b = d.grid || {}, h = useController({
@@ -86052,7 +86080,7 @@ const ConfirmationDialog = ({
86052
86080
  case "group":
86053
86081
  return /* @__PURE__ */ jsx(GroupField, { ...D });
86054
86082
  case "button":
86055
- return /* @__PURE__ */ jsx(GroupField, { ...D });
86083
+ return /* @__PURE__ */ jsx(Button, { ...D });
86056
86084
  default:
86057
86085
  return null;
86058
86086
  }
@@ -86079,7 +86107,7 @@ const ConfirmationDialog = ({
86079
86107
  p(V && !H);
86080
86108
  }
86081
86109
  }, [(v = e.meta) == null ? void 0 : v.visibilityRules, (T = e.meta) == null ? void 0 : T.hidden, g == null ? void 0 : g.watch()]), useEffect(() => {
86082
- c || h.field.onChange(getDefaultValue(e));
86110
+ !c && !REPRSENTATIONAL_BLOCKS.includes(e.type) && h.field.onChange(getDefaultValue(e));
86083
86111
  }, [c]), useEffect(() => {
86084
86112
  l.current = `${e.name}-${generateFieldId()}`;
86085
86113
  }, []), c ? /* @__PURE__ */ jsxs(
@@ -86111,13 +86139,13 @@ const ConfirmationDialog = ({
86111
86139
  },
86112
86140
  onChange: (x) => {
86113
86141
  var L;
86114
- h.field.onChange(x), (L = d.onValueChange) == null || L.call(d, x, g);
86142
+ REPRSENTATIONAL_BLOCKS.includes(e.type) || (h.field.onChange(x), "onValueChange" in d && typeof d.onValueChange == "function" && ((L = d.onValueChange) == null || L.call(d, x, g)));
86115
86143
  },
86116
86144
  locale: u,
86117
86145
  value: h.field.value,
86118
86146
  error: h.fieldState.error
86119
86147
  }) }),
86120
- ((S = d.helperText) == null ? void 0 : S.content) && shouldRenderHelperText(e.type) && /* @__PURE__ */ jsx(Box$1, { mt: 0.25, children: /* @__PURE__ */ jsx(HelperText, { ...d.helperText }) }),
86148
+ "helperText" in d && ((S = d.helperText) == null ? void 0 : S.content) && shouldRenderHelperText(e.type) && /* @__PURE__ */ jsx(Box$1, { mt: 0.25, children: /* @__PURE__ */ jsx(HelperText, { ...d.helperText }) }),
86121
86149
  h.fieldState.error && h.fieldState.error.message && /* @__PURE__ */ jsx(FormHelperText$1, { error: !0, children: h.fieldState.error.message })
86122
86150
  ]
86123
86151
  }
@@ -87552,7 +87580,7 @@ function NamozajStepper({
87552
87580
  },
87553
87581
  children: [
87554
87582
  /* @__PURE__ */ jsx(
87555
- Button,
87583
+ Button$1,
87556
87584
  {
87557
87585
  onClick: S,
87558
87586
  disabled: N === 0 || D.disableBack,
@@ -87561,7 +87589,7 @@ function NamozajStepper({
87561
87589
  }
87562
87590
  ),
87563
87591
  N < a.length - 1 && /* @__PURE__ */ jsx(
87564
- Button,
87592
+ Button$1,
87565
87593
  {
87566
87594
  variant: "contained",
87567
87595
  onClick: T,
@@ -87584,7 +87612,7 @@ function NamozajStepper({
87584
87612
  sx: { mt: 2, display: "flex", justifyContent: "center", gap: 2 },
87585
87613
  children: [
87586
87614
  /* @__PURE__ */ jsx(
87587
- Button,
87615
+ Button$1,
87588
87616
  {
87589
87617
  onClick: S,
87590
87618
  disabled: e === 0 || L.disableBack,
@@ -87593,7 +87621,7 @@ function NamozajStepper({
87593
87621
  }
87594
87622
  ),
87595
87623
  e < a.length - 1 && /* @__PURE__ */ jsx(
87596
- Button,
87624
+ Button$1,
87597
87625
  {
87598
87626
  variant: "contained",
87599
87627
  onClick: T,
@@ -87614,9 +87642,18 @@ const Form = React__default.forwardRef(
87614
87642
  (e, t) => {
87615
87643
  var V, H, G, K, k, j, oe, Y, re;
87616
87644
  const { selectedLocales: a } = useLocalNamozajProvider(), [l, c] = useState(!0), [p, d] = useState(0), u = useMemo(
87617
- () => createYupSchema(e.fields),
87645
+ () => createYupSchema(
87646
+ e.fields.filter(
87647
+ (Z) => !REPRSENTATIONAL_BLOCKS.includes(Z.type)
87648
+ )
87649
+ ),
87618
87650
  [e, e.fields, (V = e.localization) == null ? void 0 : V.locales, createYupSchema]
87619
- ), b = useMemo(() => e.defaultValues ? e.defaultValues : getDefaultValues(e.fields), [e.fields, e.defaultValues]), h = useForm({
87651
+ ), b = useMemo(() => {
87652
+ let Z = e.fields.filter(
87653
+ (ce) => !FIELDS_EXCLUDE_AS_VALUE.includes(ce.type)
87654
+ );
87655
+ return e.defaultValues ? e.defaultValues : getDefaultValues(Z);
87656
+ }, [e.fields, e.defaultValues]), h = useForm({
87620
87657
  resolver: o(u),
87621
87658
  defaultValues: b,
87622
87659
  mode: e.validationMode || "onChange"
@@ -87633,7 +87670,11 @@ const Form = React__default.forwardRef(
87633
87670
  We.forEach((ye) => {
87634
87671
  h.unregister(ye);
87635
87672
  });
87636
- const ve = e.defaultValues ?? getDefaultValues(e.fields);
87673
+ const ve = e.defaultValues ?? getDefaultValues(
87674
+ e.fields.filter(
87675
+ (ye) => !REPRSENTATIONAL_BLOCKS.includes(ye.type)
87676
+ )
87677
+ );
87637
87678
  Re.forEach((ye) => {
87638
87679
  const we = ve[ye];
87639
87680
  h.resetField(ye, {
@@ -87689,7 +87730,7 @@ const Form = React__default.forwardRef(
87689
87730
  ), S = () => {
87690
87731
  var Z, ce, We, Re, ve, ye, we, Ke, je, Xe, Ge;
87691
87732
  return /* @__PURE__ */ jsx(Fragment, { children: !((Z = e.submitButtonProps) != null && Z.hidden) && /* @__PURE__ */ jsx(
87692
- Button$1,
87733
+ Button$2,
87693
87734
  {
87694
87735
  loading: e.loading,
87695
87736
  loadingPosition: "start",
@@ -87786,7 +87827,7 @@ const Form = React__default.forwardRef(
87786
87827
  return useEffect(() => {
87787
87828
  var Z;
87788
87829
  if ((Z = e.stepper) != null && Z.advanceOnValidation) {
87789
- const We = e.fields.filter((Re) => !Re.meta.hidden).filter((Re) => {
87830
+ const We = e.fields.filter((Re) => !REPRSENTATIONAL_BLOCKS.includes(Re.type)).filter((Re) => !Re.meta.hidden).filter((Re) => {
87790
87831
  var ve;
87791
87832
  return Re.meta.visibilityRules && ((ve = Re.meta.visibilityRules) == null ? void 0 : ve.length) > 0 ? evaluateVisibilityRules(
87792
87833
  Re.meta.visibilityRules,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ahmadmubarak98/namozaj",
3
3
  "private": false,
4
- "version": "1.9.0",
4
+ "version": "1.10.1",
5
5
  "type": "module",
6
6
  "main": "dist/namozaj.js",
7
7
  "types": "dist/main.d.ts",