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

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
  },
@@ -70371,32 +70374,27 @@ const PredefinedOptionsMenu = ({
70371
70374
  ...predefinedOptions.map(createPredefinedOption)
70372
70375
  ];
70373
70376
  return /* @__PURE__ */ jsx(
70374
- Tooltip,
70377
+ Menu,
70375
70378
  {
70376
- text: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? foundPredefinedMenuOption == null ? void 0 : foundPredefinedMenuOption.label : "",
70377
- children: /* @__PURE__ */ jsx(
70378
- Menu,
70379
- {
70380
- testId: testId && `${testId}-predefined-menu`,
70381
- maxHeight: 380,
70382
- groupOrder: "first",
70383
- disabled: disabled2,
70384
- menu: {
70385
- colored: true,
70386
- trigger: "Component",
70387
- component: /* @__PURE__ */ jsx(
70388
- Button$1,
70389
- {
70390
- groupOrder: "first",
70391
- active: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED,
70392
- icon: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink"
70393
- }
70394
- ),
70395
- small: true,
70396
- sections: sectionsPredefinedMenu
70379
+ testId: testId && `${testId}-predefined-menu`,
70380
+ maxHeight: 380,
70381
+ groupOrder: "first",
70382
+ disabled: disabled2,
70383
+ menu: {
70384
+ colored: true,
70385
+ trigger: "Component",
70386
+ component: /* @__PURE__ */ jsx(
70387
+ Button$1,
70388
+ {
70389
+ groupOrder: "first",
70390
+ active: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED,
70391
+ icon: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink"
70397
70392
  }
70398
- }
70399
- )
70393
+ ),
70394
+ small: true,
70395
+ sections: sectionsPredefinedMenu
70396
+ },
70397
+ tooltip: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? foundPredefinedMenuOption == null ? void 0 : foundPredefinedMenuOption.label : ""
70400
70398
  }
70401
70399
  );
70402
70400
  };
@@ -70460,7 +70458,7 @@ const UnitInput = ({
70460
70458
  const initDisplayLayer = convertedValue !== "" ? { value: convertedValue, unit: initDisplayUnit } : { value: propValue, unit: propUnit };
70461
70459
  const [displayLayer, setDisplayLayer] = useState(initDisplayLayer);
70462
70460
  const derivedAllowEmpty = allowEmpty || (displayLayer == null ? void 0 : displayLayer.value) === void 0;
70463
- const disableInternalErrorValidationMessages = !!disabledValidation;
70461
+ const disableInternalErrorValidationMessages = !!disabledValidation || disabled2;
70464
70462
  const getAlternativeUnits = () => {
70465
70463
  const valueToList = value ?? "";
70466
70464
  const initToUnit = displayLayer == null ? void 0 : displayLayer.unit;