intelicoreact 2.0.5 → 2.0.7

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/form.cjs CHANGED
@@ -1696,6 +1696,7 @@ function useInputValueProcessing({
1696
1696
  const { trimStart, trimEnd, characters } = blurTrim || {};
1697
1697
  const isUseBitDepthPoints = Boolean(onlyNumbers) && isPriceInput;
1698
1698
  const isPseudoPasswordMode = type === "pseudoPassword";
1699
+ const bitDepthSettings = typeof onlyNumbers === "object" && onlyNumbers !== null ? onlyNumbers : void 0;
1699
1700
  const correctMinMax = (value2, correctionType) => {
1700
1701
  if (!onlyNumbers) return value2;
1701
1702
  const { min, max, isOnlyPositive, isNoEmptyValues } = getIsOnlyAnObject(
@@ -1707,14 +1708,14 @@ function useInputValueProcessing({
1707
1708
  let inputValue = getSafelyValue(value2);
1708
1709
  const checkMin = () => {
1709
1710
  if (!inputValue && isNoEmptyValues) {
1710
- inputValue = minimum !== void 0 ? minimum : "0";
1711
- } else if (inputValue && !Number.isNaN(Number(minimum)) && Number(minimum) > Number((minusSymbol ?? "") + inputValue)) {
1712
- inputValue = minimum;
1711
+ inputValue = minimum !== void 0 ? String(minimum) : "0";
1712
+ } else if (inputValue && minimum !== void 0 && !Number.isNaN(Number(minimum)) && Number(minimum) > Number((minusSymbol ?? "") + inputValue)) {
1713
+ inputValue = String(minimum);
1713
1714
  }
1714
1715
  };
1715
1716
  const checkMax = () => {
1716
- if (!Number.isNaN(Number(maximum)) && Number(maximum) < Number((minusSymbol ?? "") + inputValue)) {
1717
- inputValue = maximum;
1717
+ if (maximum !== void 0 && !Number.isNaN(Number(maximum)) && Number(maximum) < Number((minusSymbol ?? "") + inputValue)) {
1718
+ inputValue = String(maximum);
1718
1719
  minusSymbol = null;
1719
1720
  }
1720
1721
  };
@@ -1723,7 +1724,7 @@ function useInputValueProcessing({
1723
1724
  minusSymbol = "-";
1724
1725
  inputValue = inputValue.slice(1);
1725
1726
  }
1726
- inputValue = filterNumeric(inputValue, onlyNumbers);
1727
+ inputValue = filterNumeric(inputValue, bitDepthSettings);
1727
1728
  switch (correctionType) {
1728
1729
  case "min":
1729
1730
  checkMin();
@@ -1821,7 +1822,7 @@ function useInputValueProcessing({
1821
1822
  if (typeof onlyNumbers === "object" && onlyNumbers?.isNoEmptyValues)
1822
1823
  safelyValue = correctMinMax(safelyValue, "min");
1823
1824
  if (isUseBitDepthPoints)
1824
- safelyValue = formatToAddBitDepthPoints(safelyValue, onlyNumbers);
1825
+ safelyValue = formatToAddBitDepthPoints(safelyValue, bitDepthSettings);
1825
1826
  return safelyValue;
1826
1827
  })();
1827
1828
  return {