@oliasoft-open-source/react-ui-library 4.2.0 → 4.2.1-beta-2

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 (141) hide show
  1. package/dist/assets/{index-9e4179c3.css → index-0d78a198.css} +3 -0
  2. package/dist/assets/{index-cfa07a3f.js → index-26f804a8.js} +180 -175
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.html +1 -1
  5. package/dist/index.js +27 -16
  6. package/dist/index.js.map +1 -1
  7. package/dist/storybook/assets/Color-6VNJS4EI-6b48c85b.js +1 -0
  8. package/dist/storybook/assets/DocsRenderer-NNNQARDV-25c0f625.js +1 -0
  9. package/dist/storybook/assets/WithTooltip-4HIR6TLV-9ebd09dc.js +1 -0
  10. package/dist/storybook/assets/{accordion-1b587708.js → accordion-168fa7c5.js} +1 -1
  11. package/dist/storybook/assets/{accordion.stories-d52a4724.js → accordion.stories-0f8af16e.js} +1 -1
  12. package/dist/storybook/assets/{actions-83a2a04e.js → actions-2d4e1c8e.js} +1 -1
  13. package/dist/storybook/assets/{actions.stories-a38cd26e.js → actions.stories-81a7cb7a.js} +1 -1
  14. package/dist/storybook/assets/{afe.stories-dbb9e71e.js → afe.stories-afb9be07.js} +2 -2
  15. package/dist/storybook/assets/{badge.stories-1cbf35f9.js → badge.stories-5ce7957f.js} +1 -1
  16. package/dist/storybook/assets/{blowout.stories-af7f9432.js → blowout.stories-ee7f932b.js} +1 -1
  17. package/dist/storybook/assets/{button-050c998a.js → button-74c97e4a.js} +1 -1
  18. package/dist/storybook/assets/{button-group-0176fca3.js → button-group-fa895d0c.js} +1 -1
  19. package/dist/storybook/assets/{button-group.stories-7659a587.js → button-group.stories-22f072b7.js} +1 -1
  20. package/dist/storybook/assets/{button.stories-5f73ddef.js → button.stories-9b954335.js} +1 -1
  21. package/dist/storybook/assets/buttons-and-links-16cf8577.js +14 -0
  22. package/dist/storybook/assets/{card.stories-0437a4e2.js → card.stories-537a1772.js} +1 -1
  23. package/dist/storybook/assets/{casing-loads.stories-97ec4b66.js → casing-loads.stories-cfbab702.js} +1 -1
  24. package/dist/storybook/assets/{cell.stories-4a847cd0.js → cell.stories-524a7418.js} +1 -1
  25. package/dist/storybook/assets/{check-box-b38490e5.js → check-box-e21258d5.js} +1 -1
  26. package/dist/storybook/assets/{check-box.stories-9bf1c260.js → check-box.stories-5f7d06e0.js} +1 -1
  27. package/dist/storybook/assets/{chunk-HLWAVYOI-15cd9aaa.js → chunk-HLWAVYOI-1c498991.js} +1 -1
  28. package/dist/storybook/assets/color-8b40ecf4.js +25 -0
  29. package/dist/storybook/assets/{column.stories-d5ca2c42.js → column.stories-ae7588c5.js} +1 -1
  30. package/dist/storybook/assets/{dialog-c036ff34.js → dialog-cd58dd09.js} +1 -1
  31. package/dist/storybook/assets/{drawer-308b0a03.js → drawer-7f450988.js} +1 -1
  32. package/dist/storybook/assets/{drawer.stories-d76c0577.js → drawer.stories-39625e91.js} +2 -2
  33. package/dist/storybook/assets/{empty.stories-30fdd793.js → empty.stories-e0e3ac78.js} +1 -1
  34. package/dist/storybook/assets/{field-248df38c.js → field-a094cd72.js} +1 -1
  35. package/dist/storybook/assets/{field.stories-60d1a82f.js → field.stories-f1318053.js} +1 -1
  36. package/dist/storybook/assets/{file-input.stories-a7e96582.js → file-input.stories-1c6ce0ea.js} +1 -1
  37. package/dist/storybook/assets/{flex.stories-6a278b40.js → flex.stories-09e9c602.js} +1 -1
  38. package/dist/storybook/assets/footer.stories-57f07ea2.js +3 -0
  39. package/dist/storybook/assets/form.stories-45c0cd59.js +49 -0
  40. package/dist/storybook/assets/formation.stories-5eeaa826.js +74 -0
  41. package/dist/storybook/assets/{formatter-SWP5E3XI-bc797410.js → formatter-SWP5E3XI-521171e8.js} +2 -2
  42. package/dist/storybook/assets/{heading-39e599c8.js → heading-d29eb744.js} +1 -1
  43. package/dist/storybook/assets/{heading.stories-6ff7f5ed.js → heading.stories-9689bddc.js} +1 -1
  44. package/dist/storybook/assets/{help-icon-c0abd380.js → help-icon-d4189b1b.js} +1 -1
  45. package/dist/storybook/assets/{help-icon.stories-a30b7058.js → help-icon.stories-15d1620d.js} +1 -1
  46. package/dist/storybook/assets/icon-e9cbb4d7.js +8 -0
  47. package/dist/storybook/assets/{icon.stories-466d158f.js → icon.stories-8dae69e1.js} +1 -1
  48. package/dist/storybook/assets/iframe-5eee0790.js +1 -0
  49. package/dist/storybook/assets/{number-input-7cb3ea4d.js → index-57d7693e.js} +9 -9
  50. package/dist/storybook/assets/{index-ded8dd51.js → index-665bded2.js} +4 -4
  51. package/dist/storybook/assets/{index.es-37e2ce0d.js → index.es-85cc7dfc.js} +4 -4
  52. package/dist/storybook/assets/inheritsLoose-d4851ab8.js +1 -0
  53. package/dist/storybook/assets/{input-05f21b51.js → input-d68625a5.js} +1 -1
  54. package/dist/storybook/assets/{input-group.stories-602e1e93.js → input-group.stories-a2a3400e.js} +2 -2
  55. package/dist/storybook/assets/{input-validation-98dcb1cc.js → input-validation-560fd9e3.js} +2 -2
  56. package/dist/storybook/assets/{input.stories-bf58ba7c.js → input.stories-164d93ab.js} +1 -1
  57. package/dist/storybook/assets/{inputs-95a86db4.js → inputs-ed0fc7ad.js} +1 -1
  58. package/dist/storybook/assets/{label-e6d15b59.js → label-13d490a3.js} +1 -1
  59. package/dist/storybook/assets/{label.stories-1c98204a.js → label.stories-427ba162.js} +1 -1
  60. package/dist/storybook/assets/layout-forms-e9b95540.js +16 -0
  61. package/dist/storybook/assets/{layout-general-d43e1deb.js → layout-general-7a81d7f9.js} +2 -2
  62. package/dist/storybook/assets/{list-bc0d9ad9.js → list-0dc3df85.js} +1 -1
  63. package/dist/storybook/assets/{list-heading-2215213f.js → list-heading-88cc8a9b.js} +1 -1
  64. package/dist/storybook/assets/{list.stories-c8b4f325.js → list.stories-5715452e.js} +2 -2
  65. package/dist/storybook/assets/{list.stories-data-ba40864f.js → list.stories-data-94f7c623.js} +1 -1
  66. package/dist/storybook/assets/{loader.stories-4e8e8df7.js → loader.stories-6107832a.js} +1 -1
  67. package/dist/storybook/assets/{menu.stories-8d724757.js → menu.stories-927adf3d.js} +1 -1
  68. package/dist/storybook/assets/{message-0b5ae3c5.js → message-7e627e60.js} +1 -1
  69. package/dist/storybook/assets/{message.stories-9b9c40c4.js → message.stories-f41a0c22.js} +1 -1
  70. package/dist/storybook/assets/{modal.stories-1b13be75.js → modal.stories-0e068cc1.js} +2 -2
  71. package/dist/storybook/assets/number-input-7d49b0b3.js +1 -0
  72. package/dist/storybook/assets/{number-input.stories-a78d1390.js → number-input.stories-02528124.js} +1 -1
  73. package/dist/storybook/assets/{option-dropdown.stories-4c391727.js → option-dropdown.stories-5030bdb8.js} +1 -1
  74. package/dist/storybook/assets/{padding-and-spacing-175c928c.js → padding-and-spacing-ea2bf22c.js} +2 -2
  75. package/dist/storybook/assets/{page.stories-b69a6953.js → page.stories-7cb68fed.js} +1 -1
  76. package/dist/storybook/assets/{pagination-443065a8.js → pagination-8aade846.js} +1 -1
  77. package/dist/storybook/assets/{pagination.stories-985230f7.js → pagination.stories-423b4938.js} +2 -2
  78. package/dist/storybook/assets/{pop-confirm.stories-3016f322.js → pop-confirm.stories-81b30901.js} +1 -1
  79. package/dist/storybook/assets/{popover-c1234faa.js → popover-06e375a5.js} +1 -1
  80. package/dist/storybook/assets/popover.stories-f651a81c.js +1 -0
  81. package/dist/storybook/assets/{preview-5b4b7caf.js → preview-51e87244.js} +3 -3
  82. package/dist/storybook/assets/preview-987fd1ab.js +1 -0
  83. package/dist/storybook/assets/projects.stories-3884a80c.js +47 -0
  84. package/dist/storybook/assets/{radio-button-d69b72e4.js → radio-button-135a9615.js} +1 -1
  85. package/dist/storybook/assets/{radio-button.stories-6ff0dc9b.js → radio-button.stories-0e8377ea.js} +1 -1
  86. package/dist/storybook/assets/{reservoirs.stories-0306bd1a.js → reservoirs.stories-6b14a37f.js} +2 -2
  87. package/dist/storybook/assets/{rich-text-input.stories-383819b4.js → rich-text-input.stories-661f34f1.js} +3 -3
  88. package/dist/storybook/assets/{row.stories-d565ec28.js → row.stories-d5b6b4a6.js} +1 -1
  89. package/dist/storybook/assets/select-205cd538.js +1 -0
  90. package/dist/storybook/assets/{select.stories-6651d3f2.js → select.stories-60f055e6.js} +2 -2
  91. package/dist/storybook/assets/{side-bar-10cceacd.js → side-bar-88e8cf41.js} +1 -1
  92. package/dist/storybook/assets/{side-bar.stories-02211e0d.js → side-bar.stories-2c06f8a6.js} +1 -1
  93. package/dist/storybook/assets/{site.stories-ae79a20c.js → site.stories-dee8ce1c.js} +2 -2
  94. package/dist/storybook/assets/slider-160e2152.js +7 -0
  95. package/dist/storybook/assets/{slider.stories-a55df653.js → slider.stories-79ab0e97.js} +2 -2
  96. package/dist/storybook/assets/{spacer.stories-a2798d47.js → spacer.stories-38071af8.js} +1 -1
  97. package/dist/storybook/assets/syntaxhighlighter-NMPM6SWI-96abff19.js +1 -0
  98. package/dist/storybook/assets/{table-a19b5c53.js → table-da6f6045.js} +1 -1
  99. package/dist/storybook/assets/{table.stories-4b24d81a.js → table.stories-67a3023a.js} +1 -1
  100. package/dist/storybook/assets/{table.stories-data-ddbcf8c3.js → table.stories-data-8a836b92.js} +1 -1
  101. package/dist/storybook/assets/{textarea-598f9fff.js → textarea-d48efea2.js} +1 -1
  102. package/dist/storybook/assets/{textarea.stories-3902f4aa.js → textarea.stories-89c8afd7.js} +1 -1
  103. package/dist/storybook/assets/{title.stories-00dc9f42.js → title.stories-5b4a226c.js} +1 -1
  104. package/dist/storybook/assets/{toaster-f096ba56.js → toaster-541ce85b.js} +1 -1
  105. package/dist/storybook/assets/{toaster.stories-66162195.js → toaster.stories-5e4d95b1.js} +1 -1
  106. package/dist/storybook/assets/{toggle-6f4d5797.js → toggle-bb34b2a2.js} +1 -1
  107. package/dist/storybook/assets/{toggle.stories-a289f544.js → toggle.stories-b771ed81.js} +1 -1
  108. package/dist/storybook/assets/{tooltip-856042a7.js → tooltip-23e84186.js} +1 -1
  109. package/dist/storybook/assets/{tooltip.stories-666868d0.js → tooltip.stories-e8ba5fff.js} +1 -1
  110. package/dist/storybook/assets/{tooltip.test-case.stories-4c1ea273.js → tooltip.test-case.stories-9817078b.js} +1 -1
  111. package/dist/storybook/assets/{top-bar-38689fe2.js → top-bar-a84b9365.js} +1 -1
  112. package/dist/storybook/assets/{top-bar.stories-3d9a6da1.js → top-bar.stories-e93330f0.js} +1 -1
  113. package/dist/storybook/assets/{top-bar.testcase.stories-dc051455.js → top-bar.testcase.stories-3a824a14.js} +1 -1
  114. package/dist/storybook/assets/{tree.stories-729aebd7.js → tree.stories-590bdd69.js} +1 -1
  115. package/dist/storybook/assets/unit-input.stories-0eea1703.js +265 -0
  116. package/dist/storybook/assets/unit-input.stories-c251e2c8.css +1 -0
  117. package/dist/storybook/iframe.html +1 -1
  118. package/dist/storybook/index.json +1 -1
  119. package/dist/storybook/project.json +1 -1
  120. package/dist/storybook/stories.json +1 -1
  121. package/package.json +1 -1
  122. package/dist/404.html +0 -1
  123. package/dist/storybook/assets/Color-6VNJS4EI-b934ab6b.js +0 -1
  124. package/dist/storybook/assets/DocsRenderer-NNNQARDV-ddf564a7.js +0 -1
  125. package/dist/storybook/assets/WithTooltip-4HIR6TLV-8e7953d1.js +0 -1
  126. package/dist/storybook/assets/buttons-and-links-bea8e431.js +0 -14
  127. package/dist/storybook/assets/color-d7525af7.js +0 -25
  128. package/dist/storybook/assets/extends-98964cd2.js +0 -1
  129. package/dist/storybook/assets/footer.stories-da256be2.js +0 -3
  130. package/dist/storybook/assets/form.stories-7c1518fa.js +0 -49
  131. package/dist/storybook/assets/formation.stories-a033bc86.js +0 -74
  132. package/dist/storybook/assets/icon-8acf9925.js +0 -8
  133. package/dist/storybook/assets/iframe-615023be.js +0 -1
  134. package/dist/storybook/assets/inheritsLoose-c82a83d4.js +0 -1
  135. package/dist/storybook/assets/layout-forms-2d1a89fa.js +0 -16
  136. package/dist/storybook/assets/popover.stories-7542a367.js +0 -1
  137. package/dist/storybook/assets/preview-e85ca407.js +0 -1
  138. package/dist/storybook/assets/projects.stories-104a0c19.js +0 -47
  139. package/dist/storybook/assets/select-d4593fc0.js +0 -1
  140. package/dist/storybook/assets/slider-5d5442fe.js +0 -7
  141. package/dist/storybook/assets/syntaxhighlighter-NMPM6SWI-696a62ca.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1496,7 +1496,7 @@ export declare interface IUnitInputProps {
1496
1496
  left?: boolean;
1497
1497
  small?: boolean;
1498
1498
  width?: string | number;
1499
- value?: string | number;
1499
+ value?: string;
1500
1500
  unitkey?: string;
1501
1501
  initUnit?: string;
1502
1502
  noConversion?: boolean;
package/dist/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><head><title>React UI Library</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1" user-scalable="no"><meta name="apple-mobile-web-app-capable" content="yes"><script type="module" crossorigin src="/react-ui-library/assets/index-cfa07a3f.js"></script><link rel="stylesheet" href="/react-ui-library/assets/index-9e4179c3.css"></head><body><div id="content"></div></body>
1
+ <!doctype html><head><title>React UI Library</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1" user-scalable="no"><meta name="apple-mobile-web-app-capable" content="yes"><script type="module" crossorigin src="/react-ui-library/assets/index-26f804a8.js"></script><link rel="stylesheet" href="/react-ui-library/assets/index-0d78a198.css"></head><body><div id="content"></div></body>
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import * as PropTypes from "prop-types";
11
11
  import PropTypes__default from "prop-types";
12
12
  import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
13
13
  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, isObjectLike, has as has$1 } from "lodash";
14
- import { validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, convertSamePrecision, withUnit, getValue as getValue$1, split as split$1, getUnit, checkAndCleanDecimalComma, label as label$b, altUnitsList } from "@oliasoft-open-source/units";
14
+ import { validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, split as split$1, checkAndCleanDecimalComma, label as label$b, altUnitsList } from "@oliasoft-open-source/units";
15
15
  import { isValueWithUnit as isValueWithUnit$1 } from "@oliasoft-open-source/units/dist/units";
16
16
  const global$2 = "";
17
17
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -70138,20 +70138,34 @@ const isWrongValue = (val) => {
70138
70138
  return val === "undefined" || val === void 0 || val === "" || val === "null" || val === null || val === "NaN" || isNaN(val);
70139
70139
  };
70140
70140
  const convertUnit = (stringValue = "", toUnit, defaultFromUnit = "", doNotConvertValue = false) => {
70141
- if (toUnit && !doNotConvertValue) {
70141
+ if (doNotConvertValue)
70142
+ return stringValue;
70143
+ if (toUnit && !isWrongValue(stringValue)) {
70142
70144
  try {
70143
- const result = isWrongValue(stringValue) ? stringValue : isValueWithUnit(stringValue) ? convertSamePrecision(stringValue, toUnit) : convertSamePrecision(withUnit(stringValue, defaultFromUnit), toUnit);
70145
+ const valueWithUnit = isValueWithUnit(stringValue) ? stringValue : withUnit(stringValue, defaultFromUnit);
70146
+ const result = convertSamePrecision(valueWithUnit, toUnit);
70144
70147
  return getValue$1(result);
70145
70148
  } catch (e2) {
70146
70149
  }
70147
70150
  }
70148
- return "";
70151
+ return stringValue;
70152
+ };
70153
+ const isValueWithUnknownUnit = (value) => {
70154
+ if (!value)
70155
+ return false;
70156
+ return Boolean(getUnit(value));
70149
70157
  };
70150
70158
  const safeConvertValue = (value = "", toUnit, defaultFromUnit, doNotConvertValue) => {
70151
- const isWithUnit = isValueWithUnit(value);
70152
- const isNullEmptyUndefined = isWithUnit && isWrongValue(getValue$1(value)) || !isWithUnit && isWrongValue(value);
70153
- const convertedValue = isWithUnit ? !isNullEmptyUndefined ? convertUnit(getValue$1(value), toUnit, defaultFromUnit, doNotConvertValue) : "" : !isNullEmptyUndefined ? value : "";
70154
- return convertedValue;
70159
+ if (doNotConvertValue)
70160
+ return value;
70161
+ const isWithUnit = isValueWithUnknownUnit(value) || isValueWithUnit(value);
70162
+ const rawValue = getValue$1(value);
70163
+ const isInvalidInput = isWrongValue(rawValue);
70164
+ if (isInvalidInput)
70165
+ return rawValue;
70166
+ if (!isWithUnit)
70167
+ return value;
70168
+ return convertUnit(rawValue, toUnit, defaultFromUnit, doNotConvertValue);
70155
70169
  };
70156
70170
  const getStringName = (name2) => {
70157
70171
  if (isObject$5(name2) && !isArray$1(name2) && !isFunction$3(name2)) {
@@ -70273,14 +70287,14 @@ const UnitInput = ({
70273
70287
  }
70274
70288
  const predefinedMenuItemUnit = isValueWithUnit(el2.value) ? getUnit(el2.value) : "";
70275
70289
  return withUnit(
70276
- convertUnit(String(value), predefinedMenuItemUnit),
70290
+ convertUnit(value, predefinedMenuItemUnit),
70277
70291
  predefinedMenuItemUnit
70278
70292
  ) === el2.value;
70279
70293
  });
70280
70294
  const getAlternativeUnits = () => {
70281
70295
  if (unitkey) {
70282
70296
  try {
70283
- const valueToList = String(isAutoValue ? autoValue : value ?? "");
70297
+ const valueToList = isAutoValue ? autoValue : value ?? "";
70284
70298
  let alternativeUnits2 = altUnitsList(valueToList, unitkey);
70285
70299
  if (getValue$1(valueToList) === "") {
70286
70300
  return alternativeUnits2.map((unitRow) => ["", unitRow[1]]);
@@ -70341,7 +70355,7 @@ const UnitInput = ({
70341
70355
  let newValue, newUnit = "";
70342
70356
  if (previousInitUnit !== initDisplayUnit) {
70343
70357
  newValue = safeConvertValue(
70344
- String(value),
70358
+ value,
70345
70359
  initDisplayUnit,
70346
70360
  propUnit,
70347
70361
  doNotConvertValue
@@ -70349,7 +70363,7 @@ const UnitInput = ({
70349
70363
  newUnit = initDisplayUnit;
70350
70364
  } else if (withUnit(displayLayer.value, displayLayer.unit) !== value) {
70351
70365
  newValue = safeConvertValue(
70352
- String(value),
70366
+ value,
70353
70367
  displayLayer.unit,
70354
70368
  propUnit,
70355
70369
  doNotConvertValue
@@ -70367,10 +70381,7 @@ const UnitInput = ({
70367
70381
  }
70368
70382
  }
70369
70383
  }
70370
- const cleanValue = withUnit(
70371
- checkAndCleanDecimalComma(propValue),
70372
- (displayLayer == null ? void 0 : displayLayer.unit) || ""
70373
- );
70384
+ const cleanValue = checkAndCleanDecimalComma(propValue);
70374
70385
  const errorMessage = validate(cleanValue, {
70375
70386
  allowEmpty,
70376
70387
  autoValue,