@ahmadmubarak98/namozaj 1.8.14 → 1.8.16

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
@@ -512,6 +512,7 @@ export declare type TextFieldConfig = BaseFieldConfig & {
512
512
  startAdornment?: React.ReactNode | string;
513
513
  endAdornment?: React.ReactNode | string;
514
514
  inputRestriction?: InputRestriction;
515
+ preventDoubleSpaces?: boolean;
515
516
  };
516
517
  };
517
518
 
package/dist/namozaj.js CHANGED
@@ -6138,9 +6138,16 @@ const createYupSchema = (e) => {
6138
6138
  t.errorMessage ? t.errorMessage : `Minimum value is ${t.value}`
6139
6139
  );
6140
6140
  if (e.type === "string")
6141
- return e.min(
6142
- t.value,
6143
- t.errorMessage ? t.errorMessage : `Minimum length is ${t.value}`
6141
+ return e.test(
6142
+ "min",
6143
+ t.errorMessage ? t.errorMessage : `Minimum length is ${t.value}`,
6144
+ function(a) {
6145
+ const { createError: l, path: c } = this;
6146
+ return a && a.length < t.value ? l({
6147
+ path: c,
6148
+ message: t.errorMessage ? t.errorMessage : `Minimum length is ${t.value}`
6149
+ }) : !0;
6150
+ }
6144
6151
  );
6145
6152
  break;
6146
6153
  case "max":
@@ -10655,8 +10662,8 @@ const VisibilityIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
10655
10662
  }), "VisibilityOff"), TextField$1 = (e) => {
10656
10663
  var u;
10657
10664
  const { config: t, onChange: a } = e, { meta: l } = t, [c, p] = useState(!1), d = (b) => {
10658
- const h = b.target.value;
10659
- l.inputRestriction ? (getRegex(l.inputRestriction).test(h) || h === "") && a(h) : a(h);
10665
+ let h = b.target.value;
10666
+ l.preventDoubleSpaces && (h = h.replace(/\s{2,}/g, " ")), !(l.maxLength && h.replace(/\s/g, "").length > l.maxLength) && (l.inputRestriction ? (getRegex(l.inputRestriction).test(h) || h === "") && a(h) : a(h));
10660
10667
  };
10661
10668
  return /* @__PURE__ */ jsxs(Box$1, { children: [
10662
10669
  /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ahmadmubarak98/namozaj",
3
3
  "private": false,
4
- "version": "1.8.14",
4
+ "version": "1.8.16",
5
5
  "type": "module",
6
6
  "main": "dist/namozaj.js",
7
7
  "types": "dist/main.d.ts",