@ahmadmubarak98/namozaj 1.6.11 → 1.6.12

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.
Files changed (2) hide show
  1. package/dist/namozaj.js +19 -23
  2. package/package.json +1 -1
package/dist/namozaj.js CHANGED
@@ -46334,26 +46334,21 @@ const FileField = ({
46334
46334
  onChange: l,
46335
46335
  error: c
46336
46336
  }) => {
46337
- const { name: p, meta: d, type: u } = t, b = useFormContext(), h = (m) => {
46338
- const y = m.target.value;
46339
- l(y);
46340
- }, g = useCallback(
46341
- (m) => {
46342
- if (!(typeof m > "u" || m === null))
46343
- return typeof m == "function" ? m(b.watch(), b) : m;
46337
+ const { name: p, meta: d, type: u } = t, b = useFormContext(), h = useCallback(
46338
+ (C) => {
46339
+ if (!(typeof C > "u" || C === null))
46340
+ return typeof C == "function" ? C(b.watch(), b) : C;
46344
46341
  },
46345
46342
  [b, b == null ? void 0 : b.watch()]
46346
- );
46347
- return useEffect(() => {
46348
- const m = g(d.min), y = g(d.max);
46349
- a && (m && typeof m == "object" && a < m.value && b.setError(p, {
46350
- type: "manual",
46351
- message: m.errorMessage || `Value should be greater than ${m.value}`
46352
- }), y && typeof y == "object" && a > y.value && b.setError(p, {
46353
- type: "manual",
46354
- message: y.errorMessage || `Value should be less than ${y.value}`
46355
- }));
46356
- }, [a]), /* @__PURE__ */ jsx(
46343
+ ), g = h(d.min), m = h(d.max), y = (C) => {
46344
+ const v = C.target.value;
46345
+ if (v.trim() === "") {
46346
+ l(null);
46347
+ return;
46348
+ }
46349
+ /^-?\d*\.?\d+$/.test(v.trim()) ? (l(parseFloat(v)), typeof g == "object" && parseFloat(v) < g.value && (b.setValue(p, g.value), b.clearErrors(p)), typeof m == "object" && parseFloat(v) > m.value && (b.setValue(p, m.value), b.clearErrors(p))) : l(null);
46350
+ };
46351
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
46357
46352
  TextField$2,
46358
46353
  {
46359
46354
  id: e,
@@ -46368,16 +46363,16 @@ const FileField = ({
46368
46363
  endAdornment: d.endAdornment
46369
46364
  },
46370
46365
  htmlInput: {
46371
- min: g(d.min),
46372
- max: g(d.max),
46366
+ // min: typeof min === "object" ? min.value : min,
46367
+ // max: typeof max === "object" ? max.value : max,
46373
46368
  step: d.step
46374
46369
  }
46375
46370
  },
46376
46371
  value: a ?? "",
46377
- onChange: h,
46372
+ onChange: y,
46378
46373
  fullWidth: !0
46379
46374
  }
46380
- );
46375
+ ) });
46381
46376
  }, SliderField = ({ id: e, config: t, value: a, onChange: l }) => {
46382
46377
  const {
46383
46378
  meta: {
@@ -85026,7 +85021,8 @@ const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports), MultiSelectFie
85026
85021
  error: h.fieldState.error
85027
85022
  }) }),
85028
85023
  ((w = d.helperText) == null ? void 0 : w.content) && shouldRenderHelperText(e.type) && /* @__PURE__ */ jsx(Box, { mt: 0.25, children: /* @__PURE__ */ jsx(HelperText, { ...d.helperText }) }),
85029
- h.fieldState.error && h.fieldState.error.message && /* @__PURE__ */ jsx(FormHelperText$1, { error: !0, children: h.fieldState.error.message })
85024
+ h.fieldState.error && h.fieldState.error.message && /* @__PURE__ */ jsx(FormHelperText$1, { error: !0, children: h.fieldState.error.message }),
85025
+ JSON.stringify(h.fieldState.error)
85030
85026
  ]
85031
85027
  }
85032
85028
  ) : null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ahmadmubarak98/namozaj",
3
3
  "private": false,
4
- "version": "1.6.11",
4
+ "version": "1.6.12",
5
5
  "type": "module",
6
6
  "main": "dist/namozaj.js",
7
7
  "types": "dist/main.d.ts",