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.js CHANGED
@@ -1565,6 +1565,7 @@ function useInputValueProcessing({
1565
1565
  const { trimStart, trimEnd, characters } = blurTrim || {};
1566
1566
  const isUseBitDepthPoints = Boolean(onlyNumbers) && isPriceInput;
1567
1567
  const isPseudoPasswordMode = type === "pseudoPassword";
1568
+ const bitDepthSettings = typeof onlyNumbers === "object" && onlyNumbers !== null ? onlyNumbers : void 0;
1568
1569
  const correctMinMax = (value2, correctionType) => {
1569
1570
  if (!onlyNumbers) return value2;
1570
1571
  const { min, max, isOnlyPositive, isNoEmptyValues } = getIsOnlyAnObject(
@@ -1576,14 +1577,14 @@ function useInputValueProcessing({
1576
1577
  let inputValue = getSafelyValue(value2);
1577
1578
  const checkMin = () => {
1578
1579
  if (!inputValue && isNoEmptyValues) {
1579
- inputValue = minimum !== void 0 ? minimum : "0";
1580
- } else if (inputValue && !Number.isNaN(Number(minimum)) && Number(minimum) > Number((minusSymbol ?? "") + inputValue)) {
1581
- inputValue = minimum;
1580
+ inputValue = minimum !== void 0 ? String(minimum) : "0";
1581
+ } else if (inputValue && minimum !== void 0 && !Number.isNaN(Number(minimum)) && Number(minimum) > Number((minusSymbol ?? "") + inputValue)) {
1582
+ inputValue = String(minimum);
1582
1583
  }
1583
1584
  };
1584
1585
  const checkMax = () => {
1585
- if (!Number.isNaN(Number(maximum)) && Number(maximum) < Number((minusSymbol ?? "") + inputValue)) {
1586
- inputValue = maximum;
1586
+ if (maximum !== void 0 && !Number.isNaN(Number(maximum)) && Number(maximum) < Number((minusSymbol ?? "") + inputValue)) {
1587
+ inputValue = String(maximum);
1587
1588
  minusSymbol = null;
1588
1589
  }
1589
1590
  };
@@ -1592,7 +1593,7 @@ function useInputValueProcessing({
1592
1593
  minusSymbol = "-";
1593
1594
  inputValue = inputValue.slice(1);
1594
1595
  }
1595
- inputValue = filterNumeric(inputValue, onlyNumbers);
1596
+ inputValue = filterNumeric(inputValue, bitDepthSettings);
1596
1597
  switch (correctionType) {
1597
1598
  case "min":
1598
1599
  checkMin();
@@ -1690,7 +1691,7 @@ function useInputValueProcessing({
1690
1691
  if (typeof onlyNumbers === "object" && onlyNumbers?.isNoEmptyValues)
1691
1692
  safelyValue = correctMinMax(safelyValue, "min");
1692
1693
  if (isUseBitDepthPoints)
1693
- safelyValue = formatToAddBitDepthPoints(safelyValue, onlyNumbers);
1694
+ safelyValue = formatToAddBitDepthPoints(safelyValue, bitDepthSettings);
1694
1695
  return safelyValue;
1695
1696
  })();
1696
1697
  return {