@oliasoft-open-source/react-ui-library 4.15.6-beta-4 → 4.15.7-beta-1

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.js CHANGED
@@ -16,7 +16,7 @@ import * as PropTypes from "prop-types";
16
16
  import PropTypes__default from "prop-types";
17
17
  import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
18
18
  import { noop as noop$3, set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$2, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$2, isObject as isObject$5, isEqual as isEqual$4 } from "lodash";
19
- import { toString as toString$1, isScientificStringNum, roundToPrecision, toNum, validateNumber, cleanNumStr, stripLeadingZeros, roundToFixed, roundByMagnitude, unitFromQuantity, getUnit, KNOWN_UNITS, ALT_UNITS, isValueWithUnit, getValue as getValue$1, withUnit, convertSamePrecision, convertAndGetValue, split as split$1, label as label$b, isValidNum, getAltUnitsListByQuantity, altUnitsList, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
19
+ import { toString as toString$1, isScientificStringNum, roundToPrecision, toNum, validateNumber, cleanNumStr, stripLeadingZeros, roundToFixed, roundByMagnitude, unitFromQuantity, getUnit, KNOWN_UNITS, ALT_UNITS, isValueWithUnit, getValue as getValue$1, withUnit, convertSamePrecision, convertAndGetValue, round as round$1, split as split$1, label as label$b, isValidNum, getAltUnitsListByQuantity, altUnitsList, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
20
20
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
21
21
  function getDefaultExportFromCjs(x2) {
22
22
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -70308,6 +70308,10 @@ const initializeContext = (context2) => {
70308
70308
  UnitContext = context2;
70309
70309
  }
70310
70310
  };
70311
+ const safeRoundNumbers = (value) => {
70312
+ const isScientific = isScientificStringNum(value);
70313
+ return !isScientific ? safeToString(round$1(toNum(value))) : value;
70314
+ };
70311
70315
  const predefinedMenuActive = "_predefinedMenuActive_ye9w9_1";
70312
70316
  const inputWrapper = "_inputWrapper_ye9w9_4";
70313
70317
  const styles = {
@@ -70614,7 +70618,7 @@ const UnitInput = ({
70614
70618
  sections: alternativeUnits.map(([value2, altUnit, label2]) => {
70615
70619
  const displayUnit = label2 || altUnit || "";
70616
70620
  const safeValue = isValidNum(value2) ? value2 : "";
70617
- const displayValue = enableCosmeticRounding ? roundNumberCosmetic(safeValue) : safeValue;
70621
+ const displayValue = enableCosmeticRounding ? safeRoundNumbers(safeValue) : safeValue;
70618
70622
  return {
70619
70623
  type: "Option",
70620
70624
  label: displayValue,