@mamrp/components 1.0.23 → 1.0.24

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/index.mjs CHANGED
@@ -1956,6 +1956,12 @@ function SearchLicensePlate({
1956
1956
  }
1957
1957
  }, [data]);
1958
1958
  const handleInputChange = (enteredInput, inputName, maxlength, minLength) => {
1959
+ if (inputName !== "input2") {
1960
+ const englishInput = convertToEnglishDigits2(enteredInput);
1961
+ if (!/^\d*$/.test(englishInput)) {
1962
+ return;
1963
+ }
1964
+ }
1959
1965
  const newInputValues = {
1960
1966
  ...inputValues,
1961
1967
  [inputName]: enteredInput
@@ -2066,7 +2072,13 @@ function SearchLicensePlate({
2066
2072
  cursor: readOnly || !!data && readOnly ? "" : "text"
2067
2073
  },
2068
2074
  value: convertToPersianDigits2(inputValues.input1),
2069
- onChange: (e) => handleInputChange(e.target.value, "input1", 2)
2075
+ onChange: (e) => {
2076
+ const value = e.target.value;
2077
+ const englishValue = convertToEnglishDigits2(value);
2078
+ if (/^\d*$/.test(englishValue)) {
2079
+ handleInputChange(value, "input1", 2);
2080
+ }
2081
+ }
2070
2082
  }
2071
2083
  ),
2072
2084
  /* @__PURE__ */ React12.createElement(
@@ -2211,7 +2223,13 @@ function SearchLicensePlate({
2211
2223
  cursor: readOnly || !!data && readOnly ? "" : "text"
2212
2224
  },
2213
2225
  value: convertToPersianDigits2(inputValues.input3),
2214
- onChange: (e) => handleInputChange(e.target.value, "input3", 3)
2226
+ onChange: (e) => {
2227
+ const value = e.target.value;
2228
+ const englishValue = convertToEnglishDigits2(value);
2229
+ if (/^\d*$/.test(englishValue)) {
2230
+ handleInputChange(value, "input3", 3);
2231
+ }
2232
+ }
2215
2233
  }
2216
2234
  ),
2217
2235
  /* @__PURE__ */ React12.createElement(
@@ -2250,7 +2268,13 @@ function SearchLicensePlate({
2250
2268
  cursor: readOnly || !!data && readOnly ? "" : "text"
2251
2269
  },
2252
2270
  value: convertToPersianDigits2(inputValues.input4),
2253
- onChange: (e) => handleInputChange(e.target.value, "input4", 2)
2271
+ onChange: (e) => {
2272
+ const value = e.target.value;
2273
+ const englishValue = convertToEnglishDigits2(value);
2274
+ if (/^\d*$/.test(englishValue)) {
2275
+ handleInputChange(value, "input4", 2);
2276
+ }
2277
+ }
2254
2278
  }
2255
2279
  ),
2256
2280
  /* @__PURE__ */ React12.createElement(