@oliasoft-open-source/react-ui-library 4.8.0-beta-5 → 4.8.0-beta-6

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.
Files changed (128) hide show
  1. package/dist/assets/{index-Oe0PlEED.css → index-BpSdrNXy.css} +316 -316
  2. package/dist/assets/{index-GTFdS-JF.js → index-CnfDrmnZ.js} +236 -195
  3. package/dist/index.d.ts +39 -39
  4. package/dist/index.html +1 -1
  5. package/dist/index.js +209 -193
  6. package/dist/index.js.map +1 -1
  7. package/dist/storybook/assets/{Color-KGDBMAHA-Bz9U70BD.js → Color-KGDBMAHA-7n9iRx7S.js} +1 -1
  8. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-pSX8_0Nr.js → DocsRenderer-PKQXORMH-C57lSAQP.js} +1 -1
  9. package/dist/storybook/assets/{accordion.stories-vgiXrB4-.js → accordion.stories-DxcPNOgs.js} +2 -2
  10. package/dist/storybook/assets/actions-D-uVCDzk.js +39 -0
  11. package/dist/storybook/assets/{actions.stories-CUAkvJjE.js → actions.stories-gKfuiKQy.js} +1 -1
  12. package/dist/storybook/assets/{afe.stories-CBoaZ-5U.js → afe.stories-Be4Zi8Qk.js} +2 -2
  13. package/dist/storybook/assets/{blowout.stories-CF976Bad.js → blowout.stories-DHdofVc-.js} +1 -1
  14. package/dist/storybook/assets/{button-group-DCx4Z6vk.js → button-group-1DEZPmxq.js} +1 -1
  15. package/dist/storybook/assets/{button-group.stories-DvSsGv_D.js → button-group.stories-C4V1k0z_.js} +1 -1
  16. package/dist/storybook/assets/{buttons-and-links-B0beM0KB.js → buttons-and-links-CAoQC4F0.js} +2 -2
  17. package/dist/storybook/assets/{casing-loads.stories-W4rWa3bH.js → casing-loads.stories-C4UBI5Xe.js} +2 -2
  18. package/dist/storybook/assets/{cell.stories-pVmyCUQN.js → cell.stories-BSxt9Uy7.js} +2 -2
  19. package/dist/storybook/assets/check-box-DPLaOkRR.js +13 -0
  20. package/dist/storybook/assets/{check-box.stories-C_7Z7Ss6.js → check-box.stories-DfbWw6mD.js} +1 -1
  21. package/dist/storybook/assets/{chunk-HLWAVYOI-CuHfCuSg.js → chunk-HLWAVYOI-DrFFqdeg.js} +1 -1
  22. package/dist/storybook/assets/{color-ReYZ4m5V.js → color-Cj3Jrfqu.js} +2 -2
  23. package/dist/storybook/assets/{dialog-BtnEK12u.js → dialog-BelCA1mt.js} +1 -1
  24. package/dist/storybook/assets/{drawer-BqojbwAS.js → drawer-DOWJp9T4.js} +1 -1
  25. package/dist/storybook/assets/{drawer.stories-fxIBm3g1.js → drawer.stories-DcjyDHEs.js} +1 -1
  26. package/dist/storybook/assets/{field.stories-BBqJzdkf.js → field.stories-DUGMwi1O.js} +1 -1
  27. package/dist/storybook/assets/file-button.stories-CU2pZcEO.js +22 -0
  28. package/dist/storybook/assets/file-input-X3BnZaHk.js +13 -0
  29. package/dist/storybook/assets/{file-input.stories-BW--e4ZG.js → file-input.stories-CWD5XYE9.js} +1 -1
  30. package/dist/storybook/assets/footer.stories-CMQkKB8p.js +3 -0
  31. package/dist/storybook/assets/form.stories-CX1WxUVL.js +49 -0
  32. package/dist/storybook/assets/formation.stories-DdQ8gl9A.js +74 -0
  33. package/dist/storybook/assets/helpers-JJxzGegQ.js +1 -0
  34. package/dist/storybook/assets/iframe-BGmrP0sW.js +2 -0
  35. package/dist/storybook/assets/index-C2sXcduN.js +1 -0
  36. package/dist/storybook/assets/{index-RIOk8k9q.js → index-DugqEjCI.js} +47 -47
  37. package/dist/storybook/assets/input-DTXbDJaL.js +1 -0
  38. package/dist/storybook/assets/{input-group.stories-CY5ksLqR.js → input-group.stories-Bqx8op1f.js} +2 -2
  39. package/dist/storybook/assets/{input-validation-DyFpZQsn.js → input-validation-f5uEIzl2.js} +2 -2
  40. package/dist/storybook/assets/{input.stories-EZ7qJt4K.js → input.stories-FKl0qVhm.js} +1 -1
  41. package/dist/storybook/assets/{inputs-0dwI7OeZ.js → inputs-CeRKE4Lz.js} +2 -2
  42. package/dist/storybook/assets/{layout-forms-BApBtPld.js → layout-forms-BxYHgSuN.js} +4 -4
  43. package/dist/storybook/assets/{layout-general-9f8QN3PD.js → layout-general-GRQFrkfR.js} +1 -1
  44. package/dist/storybook/assets/{list-DhcQLzoC.js → list-bKpz6I9Q.js} +1 -1
  45. package/dist/storybook/assets/{list.stories-IFLT_P7d.js → list.stories-Cgmt29Wv.js} +1 -1
  46. package/dist/storybook/assets/{list.stories-data-tIuoGcNV.js → list.stories-data-D_Aj3AN4.js} +1 -1
  47. package/dist/storybook/assets/{lodash-BHd_uQHh.js → lodash-c4VUpsOs.js} +2 -2
  48. package/dist/storybook/assets/menu.stories-data-CQ59XhzU.js +1 -0
  49. package/dist/storybook/assets/{menu.stories-CXq2Fiuq.js → menu.stories-xWX80Eh2.js} +1 -1
  50. package/dist/storybook/assets/{meta-content-CvnoQB7n.js → meta-content-DWZbURV2.js} +1 -1
  51. package/dist/storybook/assets/{modal.stories-5y8dh1sC.js → modal.stories-BcqAhYEy.js} +2 -2
  52. package/dist/storybook/assets/number-input-CEoWDcRg.js +16 -0
  53. package/dist/storybook/assets/number-input.stories-UJVpFqsh.js +110 -0
  54. package/dist/storybook/assets/option-dropdown.stories-CIvqMhQ3.js +52 -0
  55. package/dist/storybook/assets/{padding-and-spacing-CCiHHnai.js → padding-and-spacing-D6XbiS3K.js} +1 -1
  56. package/dist/storybook/assets/{page.stories-B_x_6shq.js → page.stories-DnCh8h8y.js} +1 -1
  57. package/dist/storybook/assets/{pagination-DayOrCL5.js → pagination-D6pYWeQM.js} +1 -1
  58. package/dist/storybook/assets/{pagination.stories-DqzdrU74.js → pagination.stories-ItfGvzb-.js} +2 -2
  59. package/dist/storybook/assets/popover.stories-B4sQDryP.js +10 -0
  60. package/dist/storybook/assets/{preview-C2ZSBCEy.js → preview-C0zm9b3L.js} +2 -2
  61. package/dist/storybook/assets/{preview-C3DVwYVR.js → preview-DGngQ_J0.js} +2 -2
  62. package/dist/storybook/assets/projects.stories-Co_WnKSx.js +47 -0
  63. package/dist/storybook/assets/radio-button-C4ljBRED.js +13 -0
  64. package/dist/storybook/assets/{radio-button.stories-CGJnfCk-.js → radio-button.stories-BzyW2CtK.js} +2 -2
  65. package/dist/storybook/assets/{reservoirs.stories-SrSPvn3J.js → reservoirs.stories-FQuUA3DK.js} +2 -2
  66. package/dist/storybook/assets/{rich-text-input.stories-C7X6120m.js → rich-text-input.stories-B5srzxDu.js} +44 -44
  67. package/dist/storybook/assets/{row.stories-BuWQsbpc.js → row.stories-C1XgB_82.js} +2 -2
  68. package/dist/storybook/assets/select-V2ZNp3Pv.js +61 -0
  69. package/dist/storybook/assets/select.input-CJed_LLR.js +1 -0
  70. package/dist/storybook/assets/{select.stories-Bvug9LhH.js → select.stories-CV9h5z0E.js} +2 -2
  71. package/dist/storybook/assets/{side-bar-BhPNjZba.js → side-bar-CSx5wI-k.js} +1 -1
  72. package/dist/storybook/assets/{side-bar.stories-BsFhqiB3.js → side-bar.stories-M6FsuCrQ.js} +1 -1
  73. package/dist/storybook/assets/{site.stories-zUoOcZmf.js → site.stories-ZGohyW6Z.js} +2 -2
  74. package/dist/storybook/assets/slider-C7vnj_3M.js +27 -0
  75. package/dist/storybook/assets/{slider.stories-BJOTup9W.js → slider.stories-BzBb3PkP.js} +1 -1
  76. package/dist/storybook/assets/{smart-upload-modal.stories-BWQlNSV5.js → smart-upload-modal.stories-Dn7dIsu1.js} +1 -1
  77. package/dist/storybook/assets/{table-DNN_2kqQ.js → table-iMn5OU9-.js} +1 -1
  78. package/dist/storybook/assets/{table.stories-BL9nAubQ.js → table.stories-CIsR2u2M.js} +2 -2
  79. package/dist/storybook/assets/{table.stories-data-CG4FwGG3.js → table.stories-data-D52aKMY1.js} +1 -1
  80. package/dist/storybook/assets/tabs-BoToLVEP.js +13 -0
  81. package/dist/storybook/assets/tabs.stories-B52iEaHf.js +30 -0
  82. package/dist/storybook/assets/textarea-D6ltcKhz.js +13 -0
  83. package/dist/storybook/assets/{textarea.stories-CrZgmMxl.js → textarea.stories-CJ-Oqytp.js} +1 -1
  84. package/dist/storybook/assets/{title.stories-BrxyGKY2.js → title.stories-BhbnN3vD.js} +2 -2
  85. package/dist/storybook/assets/toggle-BbFVf61v.js +13 -0
  86. package/dist/storybook/assets/{toggle.stories-mjk0JIle.js → toggle.stories-qTHFTXxI.js} +1 -1
  87. package/dist/storybook/assets/{tooltip.test-case.stories-joo9YReN.js → tooltip.test-case.stories-CHibN8rC.js} +1 -1
  88. package/dist/storybook/assets/{top-bar-BlwEXx7O.js → top-bar-DkXSzzqt.js} +1 -1
  89. package/dist/storybook/assets/{top-bar.stories-Bxk6q5go.js → top-bar.stories-HDmWT243.js} +1 -1
  90. package/dist/storybook/assets/{top-bar.testcase.stories-BUBXpPJs.js → top-bar.testcase.stories-DfmrkEpT.js} +1 -1
  91. package/dist/storybook/assets/{tree.stories-CTPqyCKs.js → tree.stories-feLUcTtm.js} +1 -1
  92. package/dist/storybook/assets/{types-UmZ4Y_CR.js → types-Dx2TtIG9.js} +1 -1
  93. package/dist/storybook/assets/unit-input.stories-DCAfSaYS.js +316 -0
  94. package/dist/storybook/assets/unit-table.stories-M7pzrM4S.js +152 -0
  95. package/dist/storybook/iframe.html +1 -1
  96. package/dist/storybook/index.json +1 -1
  97. package/dist/storybook/project.json +1 -1
  98. package/dist/storybook/sb-addons/interactions-2/manager-bundle.js +52 -52
  99. package/dist/storybook/sb-manager/globals-runtime.js +7164 -7166
  100. package/dist/storybook/sb-manager/runtime.js +1110 -1111
  101. package/dist/storybook/sb-preview/runtime.js +1485 -1483
  102. package/package.json +3 -3
  103. package/dist/storybook/assets/actions-BhPnDYmS.js +0 -27
  104. package/dist/storybook/assets/check-box-BtCGePRy.js +0 -1
  105. package/dist/storybook/assets/file-button.stories-DQxp1MPV.js +0 -10
  106. package/dist/storybook/assets/file-input-DlOuEoMf.js +0 -1
  107. package/dist/storybook/assets/footer.stories-Biows6FL.js +0 -3
  108. package/dist/storybook/assets/form.stories-CaUuJTP-.js +0 -49
  109. package/dist/storybook/assets/formation.stories-CXNu3N_u.js +0 -74
  110. package/dist/storybook/assets/iframe-Ds9MEeRD.js +0 -2
  111. package/dist/storybook/assets/index-BCGvwS4L.js +0 -1
  112. package/dist/storybook/assets/input-DFNY9YDm.js +0 -1
  113. package/dist/storybook/assets/menu.stories-data-DeDnsKpk.js +0 -1
  114. package/dist/storybook/assets/number-input-hqsQsKER.js +0 -4
  115. package/dist/storybook/assets/number-input.stories-DZ3eM89y.js +0 -163
  116. package/dist/storybook/assets/option-dropdown.stories-DVA8-yqU.js +0 -34
  117. package/dist/storybook/assets/popover.stories-BcPmknc4.js +0 -10
  118. package/dist/storybook/assets/projects.stories-Clez6c2x.js +0 -47
  119. package/dist/storybook/assets/radio-button-YBwYcMaM.js +0 -1
  120. package/dist/storybook/assets/select-DAXADfWF.js +0 -40
  121. package/dist/storybook/assets/select.input-DIKP56UZ.js +0 -1
  122. package/dist/storybook/assets/slider-DckvIvC7.js +0 -31
  123. package/dist/storybook/assets/tabs-CAZ_dHGK.js +0 -1
  124. package/dist/storybook/assets/tabs.stories-DXcDAqB2.js +0 -30
  125. package/dist/storybook/assets/textarea-D-R3vavM.js +0 -1
  126. package/dist/storybook/assets/toggle-CBpNgTrm.js +0 -1
  127. package/dist/storybook/assets/unit-input.stories-3plFgvQq.js +0 -353
  128. package/dist/storybook/assets/unit-table.stories-DR17ZD2i.js +0 -152
package/dist/index.js CHANGED
@@ -15,8 +15,8 @@ import React__default, { useContext, isValidElement, useState, useRef, useEffect
15
15
  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
- import _$1, { 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 { isScientificStringNum, roundToPrecision, roundToFixed, toString as toString$1, validateNumber, stripLeadingZeros, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, label as label$b, altUnitsList, convertAndGetValue, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
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 { roundToFixed, validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, label as label$b, altUnitsList, getUnitsForQuantity, convertAndGetValue, isScientificStringNum, roundToPrecision, 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;
@@ -4269,7 +4269,7 @@ const Option$2 = ({
4269
4269
  inline: inline2,
4270
4270
  title: title2,
4271
4271
  upload,
4272
- onChange,
4272
+ onChange = noop$3,
4273
4273
  testId,
4274
4274
  component: Component2 = "a"
4275
4275
  }) => {
@@ -4285,6 +4285,22 @@ const Option$2 = ({
4285
4285
  }
4286
4286
  onClick == null ? void 0 : onClick(evt);
4287
4287
  };
4288
+ const handleFileChange = (evt) => {
4289
+ const { files } = (evt == null ? void 0 : evt.target) ?? {};
4290
+ if (files) {
4291
+ const customEvent = {
4292
+ ...evt,
4293
+ target: {
4294
+ ...evt.target,
4295
+ value: files,
4296
+ name: evt.target.name,
4297
+ files
4298
+ }
4299
+ };
4300
+ onChange == null ? void 0 : onChange(customEvent);
4301
+ close2 == null ? void 0 : close2();
4302
+ }
4303
+ };
4288
4304
  return /* @__PURE__ */ jsxs(
4289
4305
  Component2,
4290
4306
  {
@@ -4306,10 +4322,7 @@ const Option$2 = ({
4306
4322
  {
4307
4323
  type: "file",
4308
4324
  className: styles$L.fileInput,
4309
- onChange: (evt) => {
4310
- onChange == null ? void 0 : onChange(evt.target.files);
4311
- close2 == null ? void 0 : close2();
4312
- }
4325
+ onChange: handleFileChange
4313
4326
  }
4314
4327
  ),
4315
4328
  /* @__PURE__ */ jsx("span", { className: styles$L.label, title: `${title2 || label2}`, children: label2 }),
@@ -8936,8 +8949,7 @@ const FileButton = ({
8936
8949
  multi,
8937
8950
  name: name2,
8938
8951
  disabled: disabled2,
8939
- onChange = () => {
8940
- },
8952
+ onChange = noop$3,
8941
8953
  ...buttonProps
8942
8954
  }) => {
8943
8955
  const disabledContext = useContext(DisabledContext);
@@ -8949,7 +8961,15 @@ const FileButton = ({
8949
8961
  const handleChange = (evt) => {
8950
8962
  var _a2;
8951
8963
  const files = multi ? evt.target.files : (_a2 = evt.target.files) == null ? void 0 : _a2[0];
8952
- onChange({ ...evt, target: { ...evt.target, value: files } });
8964
+ const customEvent = {
8965
+ ...evt,
8966
+ target: {
8967
+ ...evt.target,
8968
+ value: files,
8969
+ name: evt.target.name
8970
+ }
8971
+ };
8972
+ onChange(customEvent);
8953
8973
  if (inputRef.current) {
8954
8974
  inputRef.current.value = "";
8955
8975
  }
@@ -9043,8 +9063,7 @@ const Input$1 = forwardRef(
9043
9063
  isInTable: isInTable2,
9044
9064
  width: propWidth = void 0,
9045
9065
  small: small2 = false,
9046
- onChange = () => {
9047
- },
9066
+ onChange = noop$3,
9048
9067
  placeholder: placeholder3 = "",
9049
9068
  value = "",
9050
9069
  onKeyPress = () => {
@@ -9176,8 +9195,7 @@ const FileInput = ({
9176
9195
  multi,
9177
9196
  name: name2,
9178
9197
  width: width2,
9179
- onChange = () => {
9180
- },
9198
+ onChange = noop$3,
9181
9199
  testId
9182
9200
  }) => {
9183
9201
  const disabledContext = useContext(DisabledContext);
@@ -9190,7 +9208,15 @@ const FileInput = ({
9190
9208
  const handleChange = (evt) => {
9191
9209
  var _a2, _b, _c;
9192
9210
  const files = multi ? (_a2 = evt == null ? void 0 : evt.target) == null ? void 0 : _a2.files : (_c = (_b = evt == null ? void 0 : evt.target) == null ? void 0 : _b.files) == null ? void 0 : _c[0];
9193
- onChange({ ...evt, target: { ...evt.target, value: files } });
9211
+ const customEvent = {
9212
+ ...evt,
9213
+ target: {
9214
+ ...evt.target,
9215
+ value: files,
9216
+ name: evt.target.name
9217
+ }
9218
+ };
9219
+ onChange(customEvent);
9194
9220
  if (inputRef.current) {
9195
9221
  inputRef.current.value = "";
9196
9222
  }
@@ -19621,12 +19647,9 @@ const NativeSelect = ({
19621
19647
  warning: warning2 = null,
19622
19648
  tooltip: tooltip2 = null,
19623
19649
  options,
19624
- onChange = () => {
19625
- },
19626
- onFocus = () => {
19627
- },
19628
- onBlur = () => {
19629
- },
19650
+ onChange = noop$3,
19651
+ onFocus = noop$3,
19652
+ onBlur = noop$3,
19630
19653
  right: right2 = false,
19631
19654
  small: small2 = false,
19632
19655
  tabIndex = 0,
@@ -20789,8 +20812,7 @@ const Input = ({
20789
20812
  selectedOptions,
20790
20813
  searchable = false,
20791
20814
  searchValue,
20792
- onChange = () => {
20793
- },
20815
+ onChange = noop$3,
20794
20816
  inputRef,
20795
20817
  error: error2,
20796
20818
  placeholder: placeholder3 = "Select...",
@@ -21515,8 +21537,8 @@ const CustomSelect = (props) => {
21515
21537
  }
21516
21538
  ) });
21517
21539
  };
21518
- const isMulti = (selectedOptions) => selectedOptions instanceof Array;
21519
21540
  const isEmptyNullOrUndefined = (value) => value === null || value === void 0 || value === "";
21541
+ const isMulti = (selectedOptions) => selectedOptions instanceof Array;
21520
21542
  const standardizeOptions = (options, simple) => {
21521
21543
  return simple && Array.isArray(options) ? options.map(
21522
21544
  (o) => typeof o === "string" || typeof o === "number" ? { label: o, value: o } : o
@@ -21604,8 +21626,7 @@ const Select = (props) => {
21604
21626
  options: rawOptions = [],
21605
21627
  value: rawSelectedOptions,
21606
21628
  native = false,
21607
- onChange = () => {
21608
- },
21629
+ onChange = noop$3,
21609
21630
  deprecatedEventHandler = false,
21610
21631
  autoScroll: autoScroll2 = true,
21611
21632
  warning: warning2,
@@ -21648,7 +21669,9 @@ const Select = (props) => {
21648
21669
  const newSelectedOptions = multi ? selectedOptions2.map(
21649
21670
  (o) => simpleInputs ? o.value : o
21650
21671
  ) : simpleInputs ? selectedOptions2.value : selectedOptions2;
21651
- onChange(newSelectedOptions);
21672
+ if (newSelectedOptions) {
21673
+ onChange(newSelectedOptions);
21674
+ }
21652
21675
  } else {
21653
21676
  const isSyntheticEvent = !(evt instanceof Event);
21654
21677
  const value = multi ? selectedOptions2 : selectedOptions2.value;
@@ -21660,17 +21683,16 @@ const Select = (props) => {
21660
21683
  }
21661
21684
  onChange(evt);
21662
21685
  } else {
21663
- onChange({
21686
+ const customEvent = {
21664
21687
  ...evt,
21665
21688
  target: {
21666
21689
  ...evt.target,
21667
21690
  name: name2,
21668
21691
  value,
21669
- ...!multi && {
21670
- label: selectedOptions2.label
21671
- }
21692
+ label: !multi ? selectedOptions2.label : void 0
21672
21693
  }
21673
- });
21694
+ };
21695
+ onChange(customEvent);
21674
21696
  }
21675
21697
  }
21676
21698
  };
@@ -37512,7 +37534,7 @@ let createNanoEvents = () => ({
37512
37534
  return () => this.events[event] = (this.events[event] || []).filter((i) => i !== cb2);
37513
37535
  }
37514
37536
  });
37515
- var __defProp$h = Object.defineProperty;
37537
+ var __defProp$i = Object.defineProperty;
37516
37538
  var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
37517
37539
  var __decorateClass$f = (decorators, target, key2, kind) => {
37518
37540
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key2) : target;
@@ -37520,7 +37542,7 @@ var __decorateClass$f = (decorators, target, key2, kind) => {
37520
37542
  if (decorator = decorators[i])
37521
37543
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
37522
37544
  if (kind && result)
37523
- __defProp$h(target, key2, result);
37545
+ __defProp$i(target, key2, result);
37524
37546
  return result;
37525
37547
  };
37526
37548
  var __accessCheck$3 = (obj, member, msg2) => {
@@ -42538,7 +42560,7 @@ const hoverColorTheme = {
42538
42560
  3: `0 1px 1px ${shadow3}`
42539
42561
  }
42540
42562
  });
42541
- var __defProp$g = Object.defineProperty;
42563
+ var __defProp$h = Object.defineProperty;
42542
42564
  var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
42543
42565
  var __decorateClass$e = (decorators, target, key2, kind) => {
42544
42566
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key2) : target;
@@ -42546,7 +42568,7 @@ var __decorateClass$e = (decorators, target, key2, kind) => {
42546
42568
  if (decorator = decorators[i])
42547
42569
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
42548
42570
  if (kind && result)
42549
- __defProp$g(target, key2, result);
42571
+ __defProp$h(target, key2, result);
42550
42572
  return result;
42551
42573
  };
42552
42574
  var __accessCheck$2 = (obj, member, msg2) => {
@@ -43005,7 +43027,7 @@ PositionerExtension = __decorateClass$e([
43005
43027
  staticKeys: ["scrollDebounce"]
43006
43028
  })
43007
43029
  ], PositionerExtension);
43008
- var __defProp$f = Object.defineProperty;
43030
+ var __defProp$g = Object.defineProperty;
43009
43031
  var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
43010
43032
  var __decorateClass$d = (decorators, target, key2, kind) => {
43011
43033
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key2) : target;
@@ -43013,7 +43035,7 @@ var __decorateClass$d = (decorators, target, key2, kind) => {
43013
43035
  if (decorator = decorators[i])
43014
43036
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
43015
43037
  if (kind && result)
43016
- __defProp$f(target, key2, result);
43038
+ __defProp$g(target, key2, result);
43017
43039
  return result;
43018
43040
  };
43019
43041
  var toggleBoldOptions = {
@@ -43110,7 +43132,7 @@ BoldExtension = __decorateClass$d([
43110
43132
  staticKeys: ["weight"]
43111
43133
  })
43112
43134
  ], BoldExtension);
43113
- var __defProp$e = Object.defineProperty;
43135
+ var __defProp$f = Object.defineProperty;
43114
43136
  var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
43115
43137
  var __decorateClass$c = (decorators, target, key2, kind) => {
43116
43138
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key2) : target;
@@ -43118,7 +43140,7 @@ var __decorateClass$c = (decorators, target, key2, kind) => {
43118
43140
  if (decorator = decorators[i])
43119
43141
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
43120
43142
  if (kind && result)
43121
- __defProp$e(target, key2, result);
43143
+ __defProp$f(target, key2, result);
43122
43144
  return result;
43123
43145
  };
43124
43146
  var { DESCRIPTION, LABEL } = extensionCodeMessages;
@@ -43712,7 +43734,7 @@ function redoDepth(state) {
43712
43734
  let hist = historyKey.getState(state);
43713
43735
  return hist ? hist.undone.eventCount : 0;
43714
43736
  }
43715
- var __defProp$d = Object.defineProperty;
43737
+ var __defProp$e = Object.defineProperty;
43716
43738
  var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
43717
43739
  var __decorateClass$b = (decorators, target, key2, kind) => {
43718
43740
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key2) : target;
@@ -43720,7 +43742,7 @@ var __decorateClass$b = (decorators, target, key2, kind) => {
43720
43742
  if (decorator = decorators[i])
43721
43743
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
43722
43744
  if (kind && result)
43723
- __defProp$d(target, key2, result);
43745
+ __defProp$e(target, key2, result);
43724
43746
  return result;
43725
43747
  };
43726
43748
  var DocExtension = class extends NodeExtension {
@@ -43986,7 +44008,7 @@ function requireObjectWithoutProperties() {
43986
44008
  })(objectWithoutProperties);
43987
44009
  return objectWithoutProperties.exports;
43988
44010
  }
43989
- var __defProp$c = Object.defineProperty;
44011
+ var __defProp$d = Object.defineProperty;
43990
44012
  var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
43991
44013
  var __decorateClass$a = (decorators, target, key2, kind) => {
43992
44014
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key2) : target;
@@ -43994,7 +44016,7 @@ var __decorateClass$a = (decorators, target, key2, kind) => {
43994
44016
  if (decorator = decorators[i])
43995
44017
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
43996
44018
  if (kind && result)
43997
- __defProp$c(target, key2, result);
44019
+ __defProp$d(target, key2, result);
43998
44020
  return result;
43999
44021
  };
44000
44022
  function posAtDOM(view, node2, offset3, bias) {
@@ -44530,7 +44552,7 @@ function drawGapCursor(state) {
44530
44552
  node2.className = "ProseMirror-gapcursor";
44531
44553
  return DecorationSet.create(state.doc, [Decoration.widget(state.selection.head, node2, { key: "gapcursor" })]);
44532
44554
  }
44533
- var __defProp$b = Object.defineProperty;
44555
+ var __defProp$c = Object.defineProperty;
44534
44556
  var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
44535
44557
  var __decorateClass$9 = (decorators, target, key2, kind) => {
44536
44558
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key2) : target;
@@ -44538,7 +44560,7 @@ var __decorateClass$9 = (decorators, target, key2, kind) => {
44538
44560
  if (decorator = decorators[i])
44539
44561
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
44540
44562
  if (kind && result)
44541
- __defProp$b(target, key2, result);
44563
+ __defProp$c(target, key2, result);
44542
44564
  return result;
44543
44565
  };
44544
44566
  var GapCursorExtension = class extends PlainExtension {
@@ -44552,7 +44574,7 @@ var GapCursorExtension = class extends PlainExtension {
44552
44574
  GapCursorExtension = __decorateClass$9([
44553
44575
  extension({})
44554
44576
  ], GapCursorExtension);
44555
- var __defProp$a = Object.defineProperty;
44577
+ var __defProp$b = Object.defineProperty;
44556
44578
  var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
44557
44579
  var __decorateClass$8 = (decorators, target, key2, kind) => {
44558
44580
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key2) : target;
@@ -44560,7 +44582,7 @@ var __decorateClass$8 = (decorators, target, key2, kind) => {
44560
44582
  if (decorator = decorators[i])
44561
44583
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
44562
44584
  if (kind && result)
44563
- __defProp$a(target, key2, result);
44585
+ __defProp$b(target, key2, result);
44564
44586
  return result;
44565
44587
  };
44566
44588
  var HistoryExtension = class extends PlainExtension {
@@ -44656,7 +44678,7 @@ HistoryExtension = __decorateClass$8([
44656
44678
  handlerKeys: ["onUndo", "onRedo"]
44657
44679
  })
44658
44680
  ], HistoryExtension);
44659
- var __defProp$9 = Object.defineProperty;
44681
+ var __defProp$a = Object.defineProperty;
44660
44682
  var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
44661
44683
  var __decorateClass$7 = (decorators, target, key2, kind) => {
44662
44684
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key2) : target;
@@ -44664,7 +44686,7 @@ var __decorateClass$7 = (decorators, target, key2, kind) => {
44664
44686
  if (decorator = decorators[i])
44665
44687
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
44666
44688
  if (kind && result)
44667
- __defProp$9(target, key2, result);
44689
+ __defProp$a(target, key2, result);
44668
44690
  return result;
44669
44691
  };
44670
44692
  var toggleItalicOptions = {
@@ -44828,7 +44850,7 @@ function liftOutOfList$1(state, dispatch, range2) {
44828
44850
  dispatch(tr2.scrollIntoView());
44829
44851
  return true;
44830
44852
  }
44831
- var __defProp$8 = Object.defineProperty;
44853
+ var __defProp$9 = Object.defineProperty;
44832
44854
  var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
44833
44855
  var __decorateClass$6 = (decorators, target, key2, kind) => {
44834
44856
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key2) : target;
@@ -44836,7 +44858,7 @@ var __decorateClass$6 = (decorators, target, key2, kind) => {
44836
44858
  if (decorator = decorators[i])
44837
44859
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
44838
44860
  if (kind && result)
44839
- __defProp$8(target, key2, result);
44861
+ __defProp$9(target, key2, result);
44840
44862
  return result;
44841
44863
  };
44842
44864
  function isList(type) {
@@ -48846,7 +48868,7 @@ marked.walkTokens;
48846
48868
  marked.parseInline;
48847
48869
  Parser$1.parse;
48848
48870
  Lexer.lex;
48849
- var __defProp$7 = Object.defineProperty;
48871
+ var __defProp$8 = Object.defineProperty;
48850
48872
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
48851
48873
  var __decorateClass$5 = (decorators, target, key2, kind) => {
48852
48874
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key2) : target;
@@ -48854,7 +48876,7 @@ var __decorateClass$5 = (decorators, target, key2, kind) => {
48854
48876
  if (decorator = decorators[i])
48855
48877
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
48856
48878
  if (kind && result)
48857
- __defProp$7(target, key2, result);
48879
+ __defProp$8(target, key2, result);
48858
48880
  return result;
48859
48881
  };
48860
48882
  var TurndownService = defaultImport(TurndownService$1);
@@ -49123,7 +49145,7 @@ MarkdownExtension = __decorateClass$5([
49123
49145
  staticKeys: ["htmlToMarkdown", "markdownToHtml", "htmlSanitizer"]
49124
49146
  })
49125
49147
  ], MarkdownExtension);
49126
- var __defProp$6 = Object.defineProperty;
49148
+ var __defProp$7 = Object.defineProperty;
49127
49149
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
49128
49150
  var __decorateClass$4 = (decorators, target, key2, kind) => {
49129
49151
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key2) : target;
@@ -49131,7 +49153,7 @@ var __decorateClass$4 = (decorators, target, key2, kind) => {
49131
49153
  if (decorator = decorators[i])
49132
49154
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
49133
49155
  if (kind && result)
49134
- __defProp$6(target, key2, result);
49156
+ __defProp$7(target, key2, result);
49135
49157
  return result;
49136
49158
  };
49137
49159
  var insertParagraphOptions = {
@@ -49209,7 +49231,7 @@ ParagraphExtension = __decorateClass$4([
49209
49231
  defaultPriority: ExtensionPriority.Medium
49210
49232
  })
49211
49233
  ], ParagraphExtension);
49212
- var __defProp$5 = Object.defineProperty;
49234
+ var __defProp$6 = Object.defineProperty;
49213
49235
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
49214
49236
  var __decorateClass$3 = (decorators, target, key2, kind) => {
49215
49237
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key2) : target;
@@ -49217,7 +49239,7 @@ var __decorateClass$3 = (decorators, target, key2, kind) => {
49217
49239
  if (decorator = decorators[i])
49218
49240
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
49219
49241
  if (kind && result)
49220
- __defProp$5(target, key2, result);
49242
+ __defProp$6(target, key2, result);
49221
49243
  return result;
49222
49244
  };
49223
49245
  var PlaceholderExtension = class extends PlainExtension {
@@ -49284,7 +49306,7 @@ function createDecorationSet(props) {
49284
49306
  });
49285
49307
  return DecorationSet.create(state.doc, decorations);
49286
49308
  }
49287
- var __defProp$4 = Object.defineProperty;
49309
+ var __defProp$5 = Object.defineProperty;
49288
49310
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
49289
49311
  var __decorateClass$2 = (decorators, target, key2, kind) => {
49290
49312
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key2) : target;
@@ -49292,7 +49314,7 @@ var __decorateClass$2 = (decorators, target, key2, kind) => {
49292
49314
  if (decorator = decorators[i])
49293
49315
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
49294
49316
  if (kind && result)
49295
- __defProp$4(target, key2, result);
49317
+ __defProp$5(target, key2, result);
49296
49318
  return result;
49297
49319
  };
49298
49320
  var TextExtension = class extends NodeExtension {
@@ -49350,7 +49372,7 @@ function corePreset(options = {}) {
49350
49372
  }
49351
49373
  return coreExtensions;
49352
49374
  }
49353
- var __defProp$3 = Object.defineProperty;
49375
+ var __defProp$4 = Object.defineProperty;
49354
49376
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
49355
49377
  var __decorateClass$1 = (decorators, target, key2, kind) => {
49356
49378
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key2) : target;
@@ -49358,7 +49380,7 @@ var __decorateClass$1 = (decorators, target, key2, kind) => {
49358
49380
  if (decorator = decorators[i])
49359
49381
  result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
49360
49382
  if (kind && result)
49361
- __defProp$3(target, key2, result);
49383
+ __defProp$4(target, key2, result);
49362
49384
  return result;
49363
49385
  };
49364
49386
  var __accessCheck$1 = (obj, member, msg2) => {
@@ -49797,6 +49819,22 @@ ReactComponentExtension = __decorateClass$1([
49797
49819
  staticKeys: ["defaultBlockNode", "defaultInlineNode", "defaultContentNode", "defaultEnvironment"]
49798
49820
  })
49799
49821
  ], ReactComponentExtension);
49822
+ var __defProp$3 = Object.defineProperty;
49823
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
49824
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
49825
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
49826
+ var __defNormalProp$2 = (obj, key2, value) => key2 in obj ? __defProp$3(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
49827
+ var __spreadValues = (a2, b2) => {
49828
+ for (var prop in b2 || (b2 = {}))
49829
+ if (__hasOwnProp$1.call(b2, prop))
49830
+ __defNormalProp$2(a2, prop, b2[prop]);
49831
+ if (__getOwnPropSymbols)
49832
+ for (var prop of __getOwnPropSymbols(b2)) {
49833
+ if (__propIsEnum.call(b2, prop))
49834
+ __defNormalProp$2(a2, prop, b2[prop]);
49835
+ }
49836
+ return a2;
49837
+ };
49800
49838
  function createContextHook(useHook) {
49801
49839
  const DefaultContext2 = createContext(null);
49802
49840
  const useHookContext = contextHookFactory(DefaultContext2);
@@ -49844,29 +49882,29 @@ function createContextState(creator, hook) {
49844
49882
  const contextRef = useRef(null);
49845
49883
  const setContextRef = useRef();
49846
49884
  const state = void 0;
49847
- const [context2, setContext] = useState(() => {
49848
- return creator({
49885
+ const [context2, setContext] = useState(
49886
+ () => creator({
49849
49887
  get: createGet(contextRef),
49850
49888
  set: createSet(setContextRef),
49851
49889
  previousContext: void 0,
49852
49890
  props,
49853
49891
  state
49854
- });
49855
- });
49892
+ })
49893
+ );
49856
49894
  const dependencies = [...Object.values(props), state];
49857
49895
  useEffect(() => {
49858
49896
  if (dependencies.length === 0) {
49859
49897
  return;
49860
49898
  }
49861
- setContext((previousContext) => {
49862
- return creator({
49899
+ setContext(
49900
+ (previousContext) => creator({
49863
49901
  get: createGet(contextRef),
49864
49902
  set: createSet(setContextRef),
49865
49903
  previousContext,
49866
49904
  props,
49867
49905
  state
49868
- });
49869
- });
49906
+ })
49907
+ );
49870
49908
  }, dependencies);
49871
49909
  contextRef.current = context2;
49872
49910
  setContextRef.current = setContext;
@@ -49898,10 +49936,7 @@ function createSet(ref2) {
49898
49936
  "`set` called outside of function scope. `set` can only be called within a function."
49899
49937
  );
49900
49938
  }
49901
- ref2.current((context2) => ({
49902
- ...context2,
49903
- ...typeof partial === "function" ? partial(context2) : partial
49904
- }));
49939
+ ref2.current((context2) => __spreadValues(__spreadValues({}, context2), typeof partial === "function" ? partial(context2) : partial));
49905
49940
  };
49906
49941
  }
49907
49942
  var dist = {};
@@ -55252,16 +55287,18 @@ const Slider = ({
55252
55287
  width: "100px",
55253
55288
  height: "400px"
55254
55289
  },
55255
- onChange
55290
+ onChange = noop$3
55256
55291
  }) => {
55257
55292
  const disabledContext = useContext(DisabledContext);
55258
55293
  const formattedMarks = memoizedFormatMarkers(marks);
55259
55294
  const onChangeValue = (value2) => {
55295
+ const eventLabel = typeof label2 === "string" ? label2 : String(label2);
55296
+ const eventName = name2 ?? "";
55260
55297
  onChange({
55261
55298
  target: {
55262
- name: name2,
55299
+ name: eventName,
55263
55300
  value: value2,
55264
- label: label2
55301
+ label: eventLabel
55265
55302
  }
55266
55303
  });
55267
55304
  };
@@ -55302,7 +55339,7 @@ const Slider = ({
55302
55339
  styles$c.container,
55303
55340
  small2 ? styles$c.small : "",
55304
55341
  vertical2.enabled ? styles$c.vertical : "",
55305
- !_$1.isEmpty(marks) ? styles$c.hasMarks : ""
55342
+ !isEmpty(marks) ? styles$c.hasMarks : ""
55306
55343
  ),
55307
55344
  style: vertical2.enabled ? { width: vertical2.width, height: vertical2.height } : { width: width2 },
55308
55345
  children: [
@@ -55659,12 +55696,6 @@ const InputCell = ({
55659
55696
  }
55660
55697
  );
55661
55698
  };
55662
- const COSMETIC_ROUNDING_DEFAULT_PRECISION = 14;
55663
- const roundNumberCosmetic = (value) => {
55664
- const isScientific = isScientificStringNum(value);
55665
- return !isScientific ? roundToPrecision(value, COSMETIC_ROUNDING_DEFAULT_PRECISION) : value;
55666
- };
55667
- const safeToString = (value) => String(toString$1(value));
55668
55699
  const getStringName$1 = (name2) => {
55669
55700
  if (!name2) return "";
55670
55701
  if (typeof name2 === "string") {
@@ -55698,65 +55729,68 @@ const NumberInput = ({
55698
55729
  allowEmpty = false,
55699
55730
  isInTable: isInTable2,
55700
55731
  groupOrder,
55701
- enableCosmeticRounding = true,
55702
55732
  enableDisplayRounding = false,
55703
55733
  roundDisplayValue,
55704
55734
  disableInternalErrorValidationMessages = false
55705
55735
  }) => {
55706
55736
  const inputRef = useRef(null);
55707
- const [displayValue, setDisplayValue] = useState(safeToString(value));
55737
+ const [displayValue, setDisplayValue] = useState(value);
55738
+ const [validationError, setValidationError] = useState(null);
55708
55739
  const [focus2, setFocus] = useState(false);
55709
- const [pristine, setPristine] = useState(true);
55710
55740
  const stringName = getStringName$1(name2);
55711
55741
  const validateInputValue = (value2) => {
55712
- const validation = validateNumber(value2);
55742
+ let validation = validateNumber(value2);
55713
55743
  if (allowEmpty && value2 === "" || validation.valid) {
55714
55744
  return { ...validation, valid: true, errors: void 0 };
55715
55745
  } else {
55716
55746
  return validation;
55717
55747
  }
55718
55748
  };
55719
- const { valid, errors: errors2 } = validateInputValue(displayValue);
55720
- const firstError = errors2 && errors2.length && !disableInternalErrorValidationMessages ? errors2[0] : null;
55721
55749
  useEffect(() => {
55722
- setDisplayValue(safeToString(value));
55723
- setPristine(true);
55724
- }, [value, enableCosmeticRounding, enableDisplayRounding]);
55725
- useEffect(() => {
55726
- if (!focus2 && !valid) {
55727
- validationCallback(stringName, firstError);
55728
- } else {
55750
+ const { valid, errors: errors2 } = validateInputValue(value);
55751
+ setDisplayValue(value);
55752
+ if (valid) {
55753
+ setValidationError(null);
55729
55754
  validationCallback(stringName, null);
55755
+ } else {
55756
+ const firstError = errors2 && errors2.length ? errors2[0] : null;
55757
+ setValidationError(firstError);
55758
+ validationCallback(stringName, firstError);
55730
55759
  }
55731
- }, [focus2, valid, error2]);
55732
- const onChangeValue = (evt) => {
55733
- if (valid && !pristine) {
55734
- const event = {
55760
+ }, [value, error2]);
55761
+ const onSetValue = (evt) => {
55762
+ const input2 = evt.target;
55763
+ const { value: value2 } = input2;
55764
+ const inputValue = cleanNumStr(
55765
+ value2.replaceAll(" ", "").replaceAll("|", "")
55766
+ );
55767
+ const { valid, errors: errors2 } = validateInputValue(inputValue);
55768
+ if (valid) {
55769
+ const newEvent = {
55735
55770
  ...evt,
55736
55771
  target: {
55737
55772
  ...evt.target,
55738
- value: stripLeadingZeros(safeToString(displayValue)),
55773
+ value: inputValue,
55739
55774
  name: stringName
55740
55775
  }
55741
55776
  };
55742
- onChange(event);
55777
+ onChange(newEvent);
55778
+ setDisplayValue(inputValue);
55779
+ setValidationError(null);
55780
+ validationCallback(stringName, null);
55781
+ } else {
55782
+ setDisplayValue(inputValue);
55783
+ const firstError = errors2 && errors2.length ? errors2[0] : null;
55784
+ setValidationError(firstError);
55785
+ validationCallback(stringName, firstError);
55743
55786
  }
55744
55787
  };
55745
- const onSetValue = (evt) => {
55746
- const input2 = evt.target;
55747
- const { value: value2 } = input2;
55748
- const inputValue = cleanNumStr(
55749
- value2.replaceAll(" ", "").replaceAll("|", "")
55750
- );
55751
- setDisplayValue(inputValue);
55752
- setPristine(false);
55753
- };
55754
55788
  useEffect(() => {
55755
55789
  if (inputRef && (inputRef == null ? void 0 : inputRef.current) && enableDisplayRounding && focus2) {
55756
55790
  const textInput = inputRef.current;
55757
55791
  if (textInput) {
55758
55792
  setTimeout(() => {
55759
- const { length: length2 } = safeToString(displayValue);
55793
+ const { length: length2 } = String(displayValue);
55760
55794
  textInput.setSelectionRange(length2, length2);
55761
55795
  }, 0);
55762
55796
  }
@@ -55768,48 +55802,33 @@ const NumberInput = ({
55768
55802
  };
55769
55803
  const onInputBlur = (evt) => {
55770
55804
  setFocus(false);
55771
- onChangeValue(evt);
55772
55805
  onBlur(evt);
55773
55806
  };
55774
- const shouldDisplayRound = enableDisplayRounding && !focus2 && valid;
55775
- const valueWithDisplayRounding = shouldDisplayRound ? roundDisplayValue ? safeToString(roundDisplayValue(displayValue)) : roundToFixed(displayValue, 2) : displayValue;
55776
- const displayValueEndsWithZero = !!(valueWithDisplayRounding == null ? void 0 : valueWithDisplayRounding.endsWith("0"));
55777
- const shouldCosmeticallyRound = enableCosmeticRounding && // only when prop is enabled
55778
- valueWithDisplayRounding && // not when empty typed value
55779
- !displayValueEndsWithZero && // not when intentionally trying to type trailing zeros as interim values (OW-17109)
55780
- valid;
55781
- const valueWithCosmeticRounding = shouldCosmeticallyRound ? roundNumberCosmetic(valueWithDisplayRounding) : valueWithDisplayRounding;
55807
+ const roundedDisplayValue = !focus2 && enableDisplayRounding ? roundDisplayValue ? roundDisplayValue(displayValue) : roundToFixed(displayValue, 2) : displayValue;
55782
55808
  return /* @__PURE__ */ jsx(
55783
- KeyboardEventHandler,
55809
+ Input$1,
55784
55810
  {
55785
- handleKeys: [EventKey.ENTER],
55786
- onKeyEvent: (_key, evt) => onChangeValue(evt),
55787
- children: /* @__PURE__ */ jsx(
55788
- Input$1,
55789
- {
55790
- type: "text",
55791
- name: stringName,
55792
- testId,
55793
- disabled: disabled2,
55794
- placeholder: placeholder3,
55795
- value: valueWithCosmeticRounding,
55796
- onChange: onSetValue,
55797
- onFocus: onInputFocus,
55798
- onBlur: onInputBlur,
55799
- error: !focus2 && (firstError || error2),
55800
- warning: warning2,
55801
- right: !left2,
55802
- small: small2,
55803
- width: width2,
55804
- isInTable: isInTable2,
55805
- groupOrder,
55806
- tabIndex,
55807
- tooltip: tooltip2,
55808
- ref: inputRef
55809
- },
55810
- stringName
55811
- )
55812
- }
55811
+ type: "text",
55812
+ name: stringName,
55813
+ testId,
55814
+ disabled: disabled2,
55815
+ placeholder: placeholder3,
55816
+ value: roundedDisplayValue,
55817
+ onChange: onSetValue,
55818
+ onFocus: onInputFocus,
55819
+ onBlur: onInputBlur,
55820
+ error: error2 || validationError,
55821
+ warning: warning2,
55822
+ right: !left2,
55823
+ small: small2,
55824
+ width: width2,
55825
+ isInTable: isInTable2,
55826
+ groupOrder,
55827
+ tabIndex,
55828
+ tooltip: tooltip2,
55829
+ ref: inputRef
55830
+ },
55831
+ stringName
55813
55832
  );
55814
55833
  };
55815
55834
  const NumberInputCell = ({ cell: cell2, testId }) => {
@@ -55835,7 +55854,6 @@ const NumberInputCell = ({ cell: cell2, testId }) => {
55835
55854
  tooltip: cell2.tooltip,
55836
55855
  validationCallback: cell2.validationCallback,
55837
55856
  allowEmpty: cell2.allowEmpty,
55838
- enableCosmeticRounding: cell2.enableCosmeticRounding,
55839
55857
  enableDisplayRounding: cell2.enableDisplayRounding,
55840
55858
  roundDisplayValue: cell2.roundDisplayValue
55841
55859
  }
@@ -56604,8 +56622,7 @@ const Tabs = ({
56604
56622
  options: rawOptions = null,
56605
56623
  children = null,
56606
56624
  value: rawValue = void 0,
56607
- onChange = () => {
56608
- },
56625
+ onChange = noop$3,
56609
56626
  padding: padding2 = false,
56610
56627
  margin: margin2 = true,
56611
56628
  contentPadding: contentPadding2 = true,
@@ -56641,6 +56658,18 @@ const Tabs = ({
56641
56658
  const selectedValue = isDeprecated || value === void 0 || value === null ? void 0 : simpleInputs ? value : value.value;
56642
56659
  const activeTabIndexBase = rawActiveTabIndex !== void 0 ? rawActiveTabIndex : tabs2 == null ? void 0 : tabs2.findIndex((t) => t.value === selectedValue);
56643
56660
  const activeTabIndex = activeTabIndexBase === -1 ? 0 : activeTabIndexBase;
56661
+ const handleTabClick = (index2, tab2, event) => {
56662
+ if (isDeprecated) {
56663
+ const value2 = tab2.key || tab2.label || null;
56664
+ onChangeTab(index2, value2);
56665
+ } else {
56666
+ const target = event.target;
56667
+ target.name = name2;
56668
+ target.value = tab2.value;
56669
+ target.label = tab2.label;
56670
+ onChange(event);
56671
+ }
56672
+ };
56644
56673
  const renderTab = (tab2, index2) => {
56645
56674
  const {
56646
56675
  label: label2,
@@ -56664,16 +56693,7 @@ const Tabs = ({
56664
56693
  badge: badge2,
56665
56694
  right: right2,
56666
56695
  active: isDeprecated ? index2 === activeTabIndex : value2 === selectedValue,
56667
- onClick: isDeprecated ? () => {
56668
- const value3 = tab2.key || label2 || null;
56669
- onChangeTab(index2, value3);
56670
- } : (evt) => {
56671
- const target = evt.target;
56672
- target.name = name2;
56673
- target.value = tab2.value;
56674
- target.label = label2;
56675
- onChange(evt);
56676
- },
56696
+ onClick: (event) => handleTabClick(index2, tab2, event),
56677
56697
  testId: testId2
56678
56698
  },
56679
56699
  index2
@@ -56758,14 +56778,10 @@ const TextArea = ({
56758
56778
  cols,
56759
56779
  rows,
56760
56780
  disabled: disabled2 = false,
56761
- onChange = () => {
56762
- },
56763
- onKeyPress = () => {
56764
- },
56765
- onFocus = () => {
56766
- },
56767
- onBlur = () => {
56768
- },
56781
+ onChange = noop$3,
56782
+ onKeyPress = noop$3,
56783
+ onFocus = noop$3,
56784
+ onBlur = noop$3,
56769
56785
  tabIndex = 0,
56770
56786
  error: error2 = null,
56771
56787
  warning: warning2 = null,
@@ -70252,14 +70268,10 @@ const UnitInput = ({
70252
70268
  unitkey = "",
70253
70269
  initUnit,
70254
70270
  noConversion = false,
70255
- onChange = () => {
70256
- },
70257
- onClick = () => {
70258
- },
70259
- onFocus = () => {
70260
- },
70261
- onSwitchUnit = () => {
70262
- },
70271
+ onChange = noop$3,
70272
+ onClick = noop$3,
70273
+ onFocus = noop$3,
70274
+ onSwitchUnit = noop$3,
70263
70275
  unitTemplate,
70264
70276
  doNotConvertValue = false,
70265
70277
  testId,
@@ -70271,10 +70283,7 @@ const UnitInput = ({
70271
70283
  validationCallback = () => ({ name: "", error: null }),
70272
70284
  disabledValidation = false,
70273
70285
  allowEmpty = false,
70274
- autoValue,
70275
- convertBackToStorageUnit = false,
70276
- enableCosmeticRounding = true,
70277
- enableDisplayRounding = false
70286
+ autoValue
70278
70287
  }) => {
70279
70288
  const context2 = useUnitContext();
70280
70289
  const runAfterUpdate = useRunAfterUpdate();
@@ -70308,7 +70317,7 @@ const UnitInput = ({
70308
70317
  initialPredefinedOption ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM
70309
70318
  );
70310
70319
  const isAutoValue = propValue === "" && autoValue;
70311
- const disableInternalErrorValidationMessages = !!(disabledValidation || autoValue || placeholder3);
70320
+ const disableInternalErrorValidationMessages = !!(disabledValidation || autoValue || placeholder3 && isEmptyNullOrUndefined(value));
70312
70321
  const foundPredefinedMenuOption = predefinedOptions && predefinedOptions.find((el2) => {
70313
70322
  if (!(el2 == null ? void 0 : el2.value)) return;
70314
70323
  if (selectedPredefinedOptionKey) {
@@ -70339,10 +70348,9 @@ const UnitInput = ({
70339
70348
  const input2 = evt.target;
70340
70349
  const { value: inputValue, selectionStart: currentCursorPosition } = input2;
70341
70350
  const newValue = withUnit(inputValue, (displayLayer == null ? void 0 : displayLayer.unit) || "");
70342
- const returnValue = convertBackToStorageUnit ? withUnit(convertAndGetValue(newValue, propUnit), propUnit) : newValue;
70343
70351
  onChange({
70344
70352
  target: {
70345
- value: returnValue,
70353
+ value: newValue,
70346
70354
  name: stringName2
70347
70355
  }
70348
70356
  });
@@ -70503,8 +70511,6 @@ const UnitInput = ({
70503
70511
  left: left2,
70504
70512
  allowEmpty,
70505
70513
  validationCallback: (_name, error22) => validationCallback(stringName, error22),
70506
- enableCosmeticRounding,
70507
- enableDisplayRounding,
70508
70514
  groupOrder: predefinedOptions ? "middle" : "first",
70509
70515
  disableInternalErrorValidationMessages
70510
70516
  },
@@ -70524,7 +70530,7 @@ const UnitInput = ({
70524
70530
  sections: alternativeUnits.map(([value2, altUnit, label2]) => {
70525
70531
  const displayUnit = label2 || altUnit || "";
70526
70532
  const safeValue = !isNaN(Number(value2)) ? value2 : "";
70527
- const displayValue = enableCosmeticRounding ? roundNumberCosmetic(safeValue) : safeValue;
70533
+ const displayValue = safeValue;
70528
70534
  return {
70529
70535
  type: "Option",
70530
70536
  label: displayValue,
@@ -70595,12 +70601,22 @@ const convertVisibleRows = ({
70595
70601
  const storageUnit = storageUnits[unitKey];
70596
70602
  const unitChanged = selectedUnit !== storageUnit;
70597
70603
  const convertedValue = unitChanged ? convertAndGetValue(value, selectedUnit, storageUnit) : cell2.value;
70598
- const formattedDisplayValue = formatDisplayValue ? formatDisplayValue(convertedValue) : convertedValue;
70604
+ const isScientific = isScientificStringNum(value);
70605
+ const displayValue = enableCosmeticRounding && (unitChanged || !isScientific) ? (
70606
+ /*
70607
+ Optionally do Excel-style "cosmetic rounding" of display values (only if enableCosmeticRounding prop on)
70608
+ This means rounding to slightly less precision than the underlying floating-point number type, to
70609
+ resolve floating-point "rounding noise" associated with storing values in one unit but converting
70610
+ and displaying them in another unit. This solution was evaluated by Tools Team in relation to
70611
+ tickets OW-10614 and OW-15745.
70612
+ */
70613
+ roundToPrecision(convertedValue, 14)
70614
+ ) : convertedValue;
70615
+ const formattedDisplayValue = formatDisplayValue ? formatDisplayValue(displayValue) : displayValue;
70599
70616
  return {
70600
70617
  ...cell2,
70601
70618
  value: formattedDisplayValue,
70602
- enableCosmeticRounding: enableCosmeticRounding && unitChanged,
70603
- //todo: why did we need to check unitChanged here? (original rationale)
70619
+ enableCosmeticRounding,
70604
70620
  enableDisplayRounding,
70605
70621
  roundDisplayValue,
70606
70622
  onChange: (evt) => {