@oliasoft-open-source/react-ui-library 4.10.5-beta-2 → 4.10.5-beta-4

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 (39) hide show
  1. package/dist/index.js +12 -32
  2. package/dist/index.js.map +1 -1
  3. package/dist/storybook/assets/{Color-KGDBMAHA-Clo6H3WP.js → Color-KGDBMAHA-ByQTGg0_.js} +1 -1
  4. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-gpTLkmsi.js → DocsRenderer-PKQXORMH-BkvhSINR.js} +1 -1
  5. package/dist/storybook/assets/{accordion.stories-Cf8mC4Vz.js → accordion.stories-BLEGXECa.js} +1 -1
  6. package/dist/storybook/assets/{buttons-and-links-DzAIMXeO.js → buttons-and-links-z94KsMj7.js} +1 -1
  7. package/dist/storybook/assets/{casing-loads.stories-C-zpBzFl.js → casing-loads.stories-BCXgA6_-.js} +1 -1
  8. package/dist/storybook/assets/{cell.stories-C_TxsFop.js → cell.stories-CrIM0y6t.js} +1 -1
  9. package/dist/storybook/assets/{chunk-HLWAVYOI-Dj2MWya0.js → chunk-HLWAVYOI-CTClYHYU.js} +1 -1
  10. package/dist/storybook/assets/{color-CZN-p4aM.js → color-C3FN4nLF.js} +1 -1
  11. package/dist/storybook/assets/file-input-B0-ERX66.js +13 -0
  12. package/dist/storybook/assets/{file-input.stories-CWD5XYE9.js → file-input.stories-Cpd1NHbq.js} +1 -1
  13. package/dist/storybook/assets/{footer.stories-DhXi3lug.js → footer.stories-BU-TGwM2.js} +1 -1
  14. package/dist/storybook/assets/{formation.stories-EQAgZUkh.js → formation.stories-DxVe8Zyc.js} +1 -1
  15. package/dist/storybook/assets/{iframe-9ccGSytp.js → iframe-DFGJOq1K.js} +2 -2
  16. package/dist/storybook/assets/{index-B3iLD3UY.js → index-Cl_bcKMw.js} +1 -1
  17. package/dist/storybook/assets/{index-DGBZhlHG.js → index-CvGNbVtg.js} +4 -4
  18. package/dist/storybook/assets/{input-validation-BA1-pp__.js → input-validation-Cq89bq3t.js} +1 -1
  19. package/dist/storybook/assets/{inputs-B4D_ZFgy.js → inputs-BK2UyAEZ.js} +1 -1
  20. package/dist/storybook/assets/{layout-forms-BkDnEJwQ.js → layout-forms-DIJt4VWU.js} +1 -1
  21. package/dist/storybook/assets/{layout-general-DHM5VM3D.js → layout-general-du5alL11.js} +1 -1
  22. package/dist/storybook/assets/{number-input-DOZPfwJP.js → number-input-B5ReSBSL.js} +2 -2
  23. package/dist/storybook/assets/{number-input.stories-u2pq69wU.js → number-input.stories-DMAU21wG.js} +1 -1
  24. package/dist/storybook/assets/{padding-and-spacing-CUJJ9GU5.js → padding-and-spacing-BtgnCZbR.js} +1 -1
  25. package/dist/storybook/assets/{preview-FMbzOyLt.js → preview-A61CgYHz.js} +2 -2
  26. package/dist/storybook/assets/{preview-CEXyF-6g.js → preview-S5KlypPk.js} +1 -1
  27. package/dist/storybook/assets/{row.stories-DjHAdpK1.js → row.stories-C8rG1yoB.js} +1 -1
  28. package/dist/storybook/assets/{smart-upload-modal.stories-Dn7dIsu1.js → smart-upload-modal.stories-xqiXR6jV.js} +1 -1
  29. package/dist/storybook/assets/{table-B9IPSqY5.js → table-DdpQxqOc.js} +1 -1
  30. package/dist/storybook/assets/{table.stories-W86Jdvf5.js → table.stories-D4zMbjkS.js} +1 -1
  31. package/dist/storybook/assets/{title.stories-BGrrprew.js → title.stories-hThIUrWl.js} +1 -1
  32. package/dist/storybook/assets/unit-input.stories-CkeTteis.js +421 -0
  33. package/dist/storybook/assets/{unit-table.stories-CL-Uxx5D.js → unit-table.stories-CEqyw4pW.js} +1 -1
  34. package/dist/storybook/iframe.html +1 -1
  35. package/dist/storybook/index.json +1 -1
  36. package/dist/storybook/project.json +1 -1
  37. package/package.json +1 -1
  38. package/dist/storybook/assets/file-input-X3BnZaHk.js +0 -13
  39. package/dist/storybook/assets/unit-input.stories-DMU1BH5_.js +0 -426
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, roundToFixed, validateNumber, isValueWithUnit, getValue as getValue$1, cleanNumStr, stripLeadingZeros, unitFromQuantity, withUnit, convertSamePrecision, getUnit, KNOWN_UNITS, split as split$1, label as label$b, isValidNum, altUnitsList, convertAndGetValue, getUnitsForQuantity, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
19
+ import { toString as toString$1, isScientificStringNum, roundToPrecision, toNum, roundToFixed, validateNumber, cleanNumStr, stripLeadingZeros, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, label as label$b, isValidNum, altUnitsList, convertAndGetValue, 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;
@@ -9206,13 +9206,13 @@ const FileInput = ({
9206
9206
  if (!(disabled2 || disabledContext)) (_a2 = inputRef.current) == null ? void 0 : _a2.click();
9207
9207
  };
9208
9208
  const handleChange = (evt) => {
9209
- var _a2, _b, _c;
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];
9209
+ const { files } = evt.target;
9210
+ const value = multi ? files ? [...files] : null : files == null ? void 0 : files[0];
9211
9211
  const customEvent = {
9212
9212
  ...evt,
9213
9213
  target: {
9214
9214
  ...evt.target,
9215
- value: files,
9215
+ value,
9216
9216
  name: evt.target.name
9217
9217
  }
9218
9218
  };
@@ -55688,12 +55688,6 @@ const NumberInput = ({
55688
55688
  }) => {
55689
55689
  const validateInputValue = (value2) => {
55690
55690
  const validation = validateNumber(value2);
55691
- const isPlaceholder = placeholder3 && isEmptyNullOrUndefined(
55692
- isValueWithUnit(value2) ? getValue$1(String(value2)) : value2
55693
- );
55694
- if (isPlaceholder) {
55695
- return { valid: true, errors: [] };
55696
- }
55697
55691
  if (allowEmpty && value2 === "" || validation.valid) {
55698
55692
  return { ...validation, valid: true, errors: void 0 };
55699
55693
  } else {
@@ -55739,7 +55733,7 @@ const NumberInput = ({
55739
55733
  value2.replaceAll(" ", "").replaceAll("|", "")
55740
55734
  );
55741
55735
  setDisplayValue(inputValue);
55742
- if (((_b = validateInputValue(inputValue)) == null ? void 0 : _b.valid) || placeholder3 && isEmptyNullOrUndefined(value2)) {
55736
+ if ((_b = validateInputValue(inputValue)) == null ? void 0 : _b.valid) {
55743
55737
  const event = {
55744
55738
  ...evt,
55745
55739
  target: {
@@ -70302,7 +70296,7 @@ const UnitInput = ({
70302
70296
  initialPredefinedOption ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM
70303
70297
  );
70304
70298
  const isAutoValue = propValue === "" && autoValue;
70305
- const disableInternalErrorValidationMessages = !!(disabledValidation || autoValue);
70299
+ const disableInternalErrorValidationMessages = !!(disabledValidation || autoValue || placeholder3 && isEmptyNullOrUndefined(value));
70306
70300
  const foundPredefinedMenuOption = predefinedOptions && predefinedOptions.find((el2) => {
70307
70301
  if (!(el2 == null ? void 0 : el2.value)) return;
70308
70302
  if (selectedPredefinedOptionKey) {
@@ -70443,25 +70437,6 @@ const UnitInput = ({
70443
70437
  const dynamicOptions = predefinedOptions.map(createPredefinedOption);
70444
70438
  sectionsPredefinedMenu = [...sectionsPredefinedMenu, ...dynamicOptions];
70445
70439
  }
70446
- const getPlaceholder = (placeholder22) => {
70447
- if (isAutoValue) {
70448
- return safeConvertValue(
70449
- autoValue,
70450
- displayLayer.unit,
70451
- propAutoUnit,
70452
- doNotConvertValue
70453
- );
70454
- } else if (isValueWithUnit(placeholder22)) {
70455
- const placeholderUnit = getUnit(placeholder22);
70456
- return safeConvertValue(
70457
- placeholder22,
70458
- displayLayer.unit,
70459
- placeholderUnit,
70460
- doNotConvertValue
70461
- );
70462
- }
70463
- return placeholder22;
70464
- };
70465
70440
  return /* @__PURE__ */ jsx(
70466
70441
  "div",
70467
70442
  {
@@ -70502,7 +70477,12 @@ const UnitInput = ({
70502
70477
  name: stringName,
70503
70478
  testId,
70504
70479
  disabled: disabled2,
70505
- placeholder: getPlaceholder(placeholder3),
70480
+ placeholder: isAutoValue ? safeConvertValue(
70481
+ autoValue,
70482
+ displayLayer.unit,
70483
+ propAutoUnit,
70484
+ doNotConvertValue
70485
+ ) : placeholder3,
70506
70486
  value: displayLayer.value,
70507
70487
  onChange: onSetValue,
70508
70488
  onFocus,