@oliasoft-open-source/react-ui-library 4.15.5 → 4.15.6-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;
@@ -70306,6 +70306,10 @@ const initializeContext = (context2) => {
70306
70306
  UnitContext = context2;
70307
70307
  }
70308
70308
  };
70309
+ const safeRoundNumbers = (value) => {
70310
+ const isScientific = isScientificStringNum(value);
70311
+ return !isScientific ? safeToString(round$1(toNum(value))) : value;
70312
+ };
70309
70313
  const predefinedMenuActive = "_predefinedMenuActive_ye9w9_1";
70310
70314
  const inputWrapper = "_inputWrapper_ye9w9_4";
70311
70315
  const styles = {
@@ -70612,7 +70616,7 @@ const UnitInput = ({
70612
70616
  sections: alternativeUnits.map(([value2, altUnit, label2]) => {
70613
70617
  const displayUnit = label2 || altUnit || "";
70614
70618
  const safeValue = isValidNum(value2) ? value2 : "";
70615
- const displayValue = enableCosmeticRounding ? roundNumberCosmetic(safeValue) : safeValue;
70619
+ const displayValue = enableCosmeticRounding ? safeRoundNumbers(safeValue) : safeValue;
70616
70620
  return {
70617
70621
  type: "Option",
70618
70622
  label: displayValue,