@oliasoft-open-source/react-ui-library 4.13.0-beta-3 → 4.13.0-beta-4

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.d.ts CHANGED
@@ -1548,7 +1548,7 @@ declare interface IUnitConfigItem {
1548
1548
  }
1549
1549
 
1550
1550
  export declare interface IUnitInputProps {
1551
- name: string | {
1551
+ name?: string | {
1552
1552
  fieldName?: string;
1553
1553
  };
1554
1554
  placeholder?: string;
package/dist/index.js CHANGED
@@ -70192,9 +70192,13 @@ const convertUnit = ({
70192
70192
  }) => {
70193
70193
  var _a2;
70194
70194
  const value = isValueWithUnit(inputValue) ? getValue$1(inputValue) : inputValue;
70195
+ const isInfinity = [Infinity, -Infinity].includes(Number(value));
70195
70196
  if (doNotConvertValue) {
70196
70197
  return { value, error: null };
70197
70198
  }
70199
+ if (isInfinity) {
70200
+ return { value, error: null };
70201
+ }
70198
70202
  const defaultFromUnit = fromUnit || (isValueWithUnit(inputValue) ? getUnit(inputValue) : unitFromQuantity(unitkey));
70199
70203
  if (!((_a2 = validateNumber(value)) == null ? void 0 : _a2.valid)) {
70200
70204
  return { value: void 0, error: "Invalid number format" };
@@ -70308,7 +70312,6 @@ const PredefinedOptionsMenu = ({
70308
70312
  const createPredefinedOption = (el2) => {
70309
70313
  const convertedValue = convertPredefinedOptions(el2);
70310
70314
  const [inputValue = "", unit2 = ""] = split$1(convertedValue);
70311
- console.log(foundPredefinedMenuOption);
70312
70315
  return {
70313
70316
  type: MenuType.OPTION,
70314
70317
  inline: true,
@@ -70316,7 +70319,7 @@ const PredefinedOptionsMenu = ({
70316
70319
  const validation = validateNumber(inputValue);
70317
70320
  if (validation.valid && !disabled2) {
70318
70321
  setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
70319
- onPredefinedOptionSelect(inputValue, el2);
70322
+ onPredefinedOptionSelect(convertedValue, el2);
70320
70323
  setFoundPredefinedMenuOption(el2);
70321
70324
  }
70322
70325
  },
@@ -70460,7 +70463,7 @@ const UnitInput = ({
70460
70463
  const initDisplayLayer = convertedValue !== "" ? { value: convertedValue, unit: initDisplayUnit } : { value: propValue, unit: propUnit };
70461
70464
  const [displayLayer, setDisplayLayer] = useState(initDisplayLayer);
70462
70465
  const derivedAllowEmpty = allowEmpty || (displayLayer == null ? void 0 : displayLayer.value) === void 0;
70463
- const disableInternalErrorValidationMessages = !!disabledValidation;
70466
+ const disableInternalErrorValidationMessages = !!disabledValidation || disabled2;
70464
70467
  const getAlternativeUnits = () => {
70465
70468
  const valueToList = value ?? "";
70466
70469
  const initToUnit = displayLayer == null ? void 0 : displayLayer.unit;