@ostack.tech/ui 0.14.1 → 0.14.2

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/ostack-ui.js CHANGED
@@ -13421,7 +13421,6 @@ const NumericInput = forwardRef(function NumericInput2({
13421
13421
  () => valueToRNFString(value, valueIsInteger, formatProps),
13422
13422
  [formatProps, value, valueIsInteger]
13423
13423
  );
13424
- const prevStringValueRef = useRef(stringValue);
13425
13424
  const isAllowed = useCallback(
13426
13425
  (values) => {
13427
13426
  const valueRepresentations = transformNumberFormatValues(
@@ -13429,48 +13428,46 @@ const NumericInput = forwardRef(function NumericInput2({
13429
13428
  valueIsInteger,
13430
13429
  scale
13431
13430
  );
13432
- const { stringValue: stringValue2 } = valueRepresentations;
13433
- const prevStringValue = prevStringValueRef.current;
13434
- if (stringValue2) {
13431
+ const { stringValue: newStringValue } = valueRepresentations;
13432
+ if (newStringValue) {
13435
13433
  if (precision != null) {
13436
- const isNegative = isNumericStringNegative(stringValue2);
13437
- const prevIsNegative = isNumericStringNegative(prevStringValue);
13434
+ const newIsNegative = isNumericStringNegative(newStringValue);
13435
+ const oldIsNegative = isNumericStringNegative(stringValue);
13438
13436
  if (valueIsInteger) {
13439
- const curPrecision = stringValue2.length - (isNegative ? 1 : 0);
13440
- if (curPrecision > precision) {
13441
- const prevPrecision = prevStringValue.length - (prevIsNegative ? 1 : 0);
13442
- if (curPrecision > prevPrecision) {
13437
+ const newPrecision = newStringValue.length - (newIsNegative ? 1 : 0);
13438
+ if (newPrecision > precision) {
13439
+ const oldPrecision = stringValue.length - (oldIsNegative ? 1 : 0);
13440
+ if (newPrecision > oldPrecision) {
13443
13441
  return false;
13444
13442
  }
13445
13443
  }
13446
13444
  } else {
13447
- const decimalSeparatorIndex = stringValue2.indexOf(".");
13448
- const decimal = decimalSeparatorIndex === -1 ? stringValue2 : stringValue2.slice(0, decimalSeparatorIndex);
13449
- const curDecimalPrecision = decimal.length - (isNegative ? 1 : 0);
13450
- if (curDecimalPrecision > precision - scale) {
13451
- const prevDecimalSeparatorIndex = prevStringValue.indexOf(".");
13452
- const prevDecimal = prevDecimalSeparatorIndex === -1 ? prevStringValue : prevStringValue.slice(0, prevDecimalSeparatorIndex);
13453
- const prevDecimalPrecision = prevDecimal.length - (prevIsNegative ? 1 : 0);
13454
- if (curDecimalPrecision > prevDecimalPrecision) {
13445
+ const newDecimalSeparatorIndex = newStringValue.indexOf(".");
13446
+ const newDecimal = newDecimalSeparatorIndex === -1 ? newStringValue : newStringValue.slice(0, newDecimalSeparatorIndex);
13447
+ const newDecimalPrecision = newDecimal.length - (newIsNegative ? 1 : 0);
13448
+ if (newDecimalPrecision > precision - scale) {
13449
+ const oldDecimalSeparatorIndex = stringValue.indexOf(".");
13450
+ const oldDecimal = oldDecimalSeparatorIndex === -1 ? stringValue : stringValue.slice(0, oldDecimalSeparatorIndex);
13451
+ const oldDecimalPrecision = oldDecimal.length - (oldIsNegative ? 1 : 0);
13452
+ if (newDecimalPrecision > oldDecimalPrecision) {
13455
13453
  return false;
13456
13454
  }
13457
13455
  }
13458
13456
  }
13459
13457
  }
13460
- if (minString && (compareNumericStrings(minString, "0") < 0 && compareNumericStrings(stringValue2, minString) < 0 || compareNumericStrings(minString, "0") >= 0 && compareNumericStrings(stringValue2, "0") < 0) && compareNumericStrings(stringValue2, prevStringValue) < 0) {
13458
+ if (minString && (compareNumericStrings(minString, "0") < 0 && compareNumericStrings(newStringValue, minString) < 0 || compareNumericStrings(minString, "0") >= 0 && compareNumericStrings(newStringValue, "0") < 0) && compareNumericStrings(newStringValue, stringValue) < 0) {
13461
13459
  return false;
13462
13460
  }
13463
- if (maxString && (compareNumericStrings(maxString, "0") > 0 && compareNumericStrings(stringValue2, maxString) > 0 || compareNumericStrings(maxString, "0") <= 0 && compareNumericStrings(stringValue2, "0") > 0) && compareNumericStrings(stringValue2, prevStringValue) > 0) {
13461
+ if (maxString && (compareNumericStrings(maxString, "0") > 0 && compareNumericStrings(newStringValue, maxString) > 0 || compareNumericStrings(maxString, "0") <= 0 && compareNumericStrings(newStringValue, "0") > 0) && compareNumericStrings(newStringValue, stringValue) > 0) {
13464
13462
  return false;
13465
13463
  }
13466
- if (exclusiveMinString && (compareNumericStrings(exclusiveMinString, "0") < 0 && compareNumericStrings(stringValue2, exclusiveMinString) <= 0 || compareNumericStrings(exclusiveMinString, "0") >= 0 && compareNumericStrings(stringValue2, "0") < 0) && compareNumericStrings(stringValue2, prevStringValue) < 0) {
13464
+ if (exclusiveMinString && (compareNumericStrings(exclusiveMinString, "0") < 0 && compareNumericStrings(newStringValue, exclusiveMinString) <= 0 || compareNumericStrings(exclusiveMinString, "0") >= 0 && compareNumericStrings(newStringValue, "0") < 0) && compareNumericStrings(newStringValue, stringValue) < 0) {
13467
13465
  return false;
13468
13466
  }
13469
- if (exclusiveMaxString && (compareNumericStrings(exclusiveMaxString, "0") > 0 && compareNumericStrings(stringValue2, exclusiveMaxString) >= 0 || compareNumericStrings(exclusiveMaxString, "0") <= 0 && compareNumericStrings(stringValue2, "0") > 0) && compareNumericStrings(stringValue2, prevStringValue) > 0) {
13467
+ if (exclusiveMaxString && (compareNumericStrings(exclusiveMaxString, "0") > 0 && compareNumericStrings(newStringValue, exclusiveMaxString) >= 0 || compareNumericStrings(exclusiveMaxString, "0") <= 0 && compareNumericStrings(newStringValue, "0") > 0) && compareNumericStrings(newStringValue, stringValue) > 0) {
13470
13468
  return false;
13471
13469
  }
13472
13470
  }
13473
- prevStringValueRef.current = stringValue2;
13474
13471
  return true;
13475
13472
  },
13476
13473
  [
@@ -13480,7 +13477,8 @@ const NumericInput = forwardRef(function NumericInput2({
13480
13477
  minString,
13481
13478
  maxString,
13482
13479
  exclusiveMinString,
13483
- exclusiveMaxString
13480
+ exclusiveMaxString,
13481
+ stringValue
13484
13482
  ]
13485
13483
  );
13486
13484
  const {