@oliasoft-open-source/react-ui-library 4.2.1-beta-1 → 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.
- package/dist/index.js +9 -16
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/Color-6VNJS4EI-6b48c85b.js +1 -0
- package/dist/storybook/assets/DocsRenderer-NNNQARDV-25c0f625.js +1 -0
- package/dist/storybook/assets/WithTooltip-4HIR6TLV-9ebd09dc.js +1 -0
- package/dist/storybook/assets/{accordion-1b587708.js → accordion-168fa7c5.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-41aed20e.js → accordion.stories-0f8af16e.js} +2 -2
- package/dist/storybook/assets/{actions-83a2a04e.js → actions-2d4e1c8e.js} +1 -1
- package/dist/storybook/assets/{actions.stories-a38cd26e.js → actions.stories-81a7cb7a.js} +1 -1
- package/dist/storybook/assets/{afe.stories-a4fbd6ce.js → afe.stories-afb9be07.js} +2 -2
- package/dist/storybook/assets/{badge.stories-1cbf35f9.js → badge.stories-5ce7957f.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-3d16e5ec.js → blowout.stories-ee7f932b.js} +1 -1
- package/dist/storybook/assets/{button-050c998a.js → button-74c97e4a.js} +1 -1
- package/dist/storybook/assets/{button-group-0176fca3.js → button-group-fa895d0c.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-7659a587.js → button-group.stories-22f072b7.js} +1 -1
- package/dist/storybook/assets/{button.stories-5f73ddef.js → button.stories-9b954335.js} +1 -1
- package/dist/storybook/assets/buttons-and-links-16cf8577.js +14 -0
- package/dist/storybook/assets/{card.stories-0437a4e2.js → card.stories-537a1772.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-d5882170.js → casing-loads.stories-cfbab702.js} +2 -2
- package/dist/storybook/assets/{cell.stories-0ae4bf08.js → cell.stories-524a7418.js} +2 -2
- package/dist/storybook/assets/{check-box-b38490e5.js → check-box-e21258d5.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-9bf1c260.js → check-box.stories-5f7d06e0.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-48e544a6.js → chunk-HLWAVYOI-1c498991.js} +1 -1
- package/dist/storybook/assets/color-8b40ecf4.js +25 -0
- package/dist/storybook/assets/{column.stories-d5ca2c42.js → column.stories-ae7588c5.js} +1 -1
- package/dist/storybook/assets/{dialog-c036ff34.js → dialog-cd58dd09.js} +1 -1
- package/dist/storybook/assets/{drawer-308b0a03.js → drawer-7f450988.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-d76c0577.js → drawer.stories-39625e91.js} +2 -2
- package/dist/storybook/assets/{empty.stories-30fdd793.js → empty.stories-e0e3ac78.js} +1 -1
- package/dist/storybook/assets/{field-248df38c.js → field-a094cd72.js} +1 -1
- package/dist/storybook/assets/{field.stories-60d1a82f.js → field.stories-f1318053.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-6878a9b8.js → file-input.stories-1c6ce0ea.js} +1 -1
- package/dist/storybook/assets/{flex.stories-6a278b40.js → flex.stories-09e9c602.js} +1 -1
- package/dist/storybook/assets/footer.stories-57f07ea2.js +3 -0
- package/dist/storybook/assets/form.stories-45c0cd59.js +49 -0
- package/dist/storybook/assets/formation.stories-5eeaa826.js +74 -0
- package/dist/storybook/assets/{formatter-SWP5E3XI-3022f287.js → formatter-SWP5E3XI-521171e8.js} +2 -2
- package/dist/storybook/assets/{heading-39e599c8.js → heading-d29eb744.js} +1 -1
- package/dist/storybook/assets/{heading.stories-6ff7f5ed.js → heading.stories-9689bddc.js} +1 -1
- package/dist/storybook/assets/{help-icon-c0abd380.js → help-icon-d4189b1b.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-a30b7058.js → help-icon.stories-15d1620d.js} +1 -1
- package/dist/storybook/assets/icon-e9cbb4d7.js +8 -0
- package/dist/storybook/assets/{icon.stories-466d158f.js → icon.stories-8dae69e1.js} +1 -1
- package/dist/storybook/assets/iframe-5eee0790.js +1 -0
- package/dist/storybook/assets/{index-facfe879.js → index-665bded2.js} +4 -4
- package/dist/storybook/assets/{index.es-37e2ce0d.js → index.es-85cc7dfc.js} +4 -4
- package/dist/storybook/assets/inheritsLoose-d4851ab8.js +1 -0
- package/dist/storybook/assets/{input-05f21b51.js → input-d68625a5.js} +1 -1
- package/dist/storybook/assets/{input-group.stories-602e1e93.js → input-group.stories-a2a3400e.js} +2 -2
- package/dist/storybook/assets/{input-validation-36225c65.js → input-validation-560fd9e3.js} +2 -2
- package/dist/storybook/assets/{input.stories-bf58ba7c.js → input.stories-164d93ab.js} +1 -1
- package/dist/storybook/assets/{inputs-76e61ee6.js → inputs-ed0fc7ad.js} +2 -2
- package/dist/storybook/assets/{label-e6d15b59.js → label-13d490a3.js} +1 -1
- package/dist/storybook/assets/{label.stories-1c98204a.js → label.stories-427ba162.js} +1 -1
- package/dist/storybook/assets/layout-forms-e9b95540.js +16 -0
- package/dist/storybook/assets/{layout-general-86c12240.js → layout-general-7a81d7f9.js} +2 -2
- package/dist/storybook/assets/{list-bc0d9ad9.js → list-0dc3df85.js} +1 -1
- package/dist/storybook/assets/{list-heading-2215213f.js → list-heading-88cc8a9b.js} +1 -1
- package/dist/storybook/assets/{list.stories-c8b4f325.js → list.stories-5715452e.js} +2 -2
- package/dist/storybook/assets/{list.stories-data-ba40864f.js → list.stories-data-94f7c623.js} +1 -1
- package/dist/storybook/assets/{loader.stories-4e8e8df7.js → loader.stories-6107832a.js} +1 -1
- package/dist/storybook/assets/{menu.stories-8d724757.js → menu.stories-927adf3d.js} +1 -1
- package/dist/storybook/assets/{message-0b5ae3c5.js → message-7e627e60.js} +1 -1
- package/dist/storybook/assets/{message.stories-9b9c40c4.js → message.stories-f41a0c22.js} +1 -1
- package/dist/storybook/assets/{modal.stories-1b13be75.js → modal.stories-0e068cc1.js} +2 -2
- package/dist/storybook/assets/{number-input-cfbd9eb7.js → number-input-7d49b0b3.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-8137782e.js → number-input.stories-02528124.js} +2 -2
- package/dist/storybook/assets/{option-dropdown.stories-4c391727.js → option-dropdown.stories-5030bdb8.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-27184e3b.js → padding-and-spacing-ea2bf22c.js} +2 -2
- package/dist/storybook/assets/{page.stories-8d0476d7.js → page.stories-7cb68fed.js} +1 -1
- package/dist/storybook/assets/{pagination-443065a8.js → pagination-8aade846.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-985230f7.js → pagination.stories-423b4938.js} +2 -2
- package/dist/storybook/assets/{pop-confirm.stories-3016f322.js → pop-confirm.stories-81b30901.js} +1 -1
- package/dist/storybook/assets/{popover-c1234faa.js → popover-06e375a5.js} +1 -1
- package/dist/storybook/assets/popover.stories-f651a81c.js +1 -0
- package/dist/storybook/assets/{preview-b8e17d34.js → preview-51e87244.js} +3 -3
- package/dist/storybook/assets/preview-987fd1ab.js +1 -0
- package/dist/storybook/assets/projects.stories-3884a80c.js +47 -0
- package/dist/storybook/assets/{radio-button-d69b72e4.js → radio-button-135a9615.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-6ff0dc9b.js → radio-button.stories-0e8377ea.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-537002ca.js → reservoirs.stories-6b14a37f.js} +2 -2
- package/dist/storybook/assets/{rich-text-input.stories-383819b4.js → rich-text-input.stories-661f34f1.js} +3 -3
- package/dist/storybook/assets/{row.stories-c12a3e52.js → row.stories-d5b6b4a6.js} +2 -2
- package/dist/storybook/assets/select-205cd538.js +1 -0
- package/dist/storybook/assets/{select.stories-6651d3f2.js → select.stories-60f055e6.js} +2 -2
- package/dist/storybook/assets/{side-bar-10cceacd.js → side-bar-88e8cf41.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-02211e0d.js → side-bar.stories-2c06f8a6.js} +1 -1
- package/dist/storybook/assets/{site.stories-9486039d.js → site.stories-dee8ce1c.js} +2 -2
- package/dist/storybook/assets/slider-160e2152.js +7 -0
- package/dist/storybook/assets/{slider.stories-a55df653.js → slider.stories-79ab0e97.js} +2 -2
- package/dist/storybook/assets/{spacer.stories-a2798d47.js → spacer.stories-38071af8.js} +1 -1
- package/dist/storybook/assets/syntaxhighlighter-NMPM6SWI-96abff19.js +1 -0
- package/dist/storybook/assets/{table-134da40b.js → table-da6f6045.js} +1 -1
- package/dist/storybook/assets/{table.stories-8dd2a568.js → table.stories-67a3023a.js} +2 -2
- package/dist/storybook/assets/{table.stories-data-ddbcf8c3.js → table.stories-data-8a836b92.js} +1 -1
- package/dist/storybook/assets/{textarea-5ebdd171.js → textarea-d48efea2.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-02879684.js → textarea.stories-89c8afd7.js} +1 -1
- package/dist/storybook/assets/{title.stories-2ba6aa87.js → title.stories-5b4a226c.js} +2 -2
- package/dist/storybook/assets/{toaster-f096ba56.js → toaster-541ce85b.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-66162195.js → toaster.stories-5e4d95b1.js} +1 -1
- package/dist/storybook/assets/{toggle-6f4d5797.js → toggle-bb34b2a2.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-a289f544.js → toggle.stories-b771ed81.js} +1 -1
- package/dist/storybook/assets/{tooltip-856042a7.js → tooltip-23e84186.js} +1 -1
- package/dist/storybook/assets/{tooltip.stories-666868d0.js → tooltip.stories-e8ba5fff.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-4c1ea273.js → tooltip.test-case.stories-9817078b.js} +1 -1
- package/dist/storybook/assets/{top-bar-2c70083e.js → top-bar-a84b9365.js} +1 -1
- package/dist/storybook/assets/{top-bar.stories-bbfb7220.js → top-bar.stories-e93330f0.js} +1 -1
- package/dist/storybook/assets/{top-bar.testcase.stories-1d4c6e3a.js → top-bar.testcase.stories-3a824a14.js} +1 -1
- package/dist/storybook/assets/{tree.stories-729aebd7.js → tree.stories-590bdd69.js} +1 -1
- package/dist/storybook/assets/unit-input.stories-0eea1703.js +265 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/Color-6VNJS4EI-38f93e87.js +0 -1
- package/dist/storybook/assets/DocsRenderer-NNNQARDV-850c5573.js +0 -1
- package/dist/storybook/assets/WithTooltip-4HIR6TLV-c574e731.js +0 -1
- package/dist/storybook/assets/buttons-and-links-dab2a936.js +0 -14
- package/dist/storybook/assets/color-c848f869.js +0 -25
- package/dist/storybook/assets/extends-98964cd2.js +0 -1
- package/dist/storybook/assets/footer.stories-50a2e3db.js +0 -3
- package/dist/storybook/assets/form.stories-fb337772.js +0 -49
- package/dist/storybook/assets/formation.stories-3c9cd637.js +0 -74
- package/dist/storybook/assets/icon-8acf9925.js +0 -8
- package/dist/storybook/assets/iframe-c049b5de.js +0 -1
- package/dist/storybook/assets/inheritsLoose-c82a83d4.js +0 -1
- package/dist/storybook/assets/layout-forms-e5b070bb.js +0 -16
- package/dist/storybook/assets/popover.stories-7542a367.js +0 -1
- package/dist/storybook/assets/preview-2ce67243.js +0 -1
- package/dist/storybook/assets/projects.stories-47d63f05.js +0 -47
- package/dist/storybook/assets/select-d4593fc0.js +0 -1
- package/dist/storybook/assets/slider-5d5442fe.js +0 -7
- package/dist/storybook/assets/syntaxhighlighter-NMPM6SWI-abcfc30f.js +0 -1
- package/dist/storybook/assets/unit-input.stories-035fa696.js +0 -265
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, withUnit, convertSamePrecision, getValue as getValue$1, getUnit,
|
|
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 : {};
|
|
@@ -70150,10 +70150,15 @@ const convertUnit = (stringValue = "", toUnit, defaultFromUnit = "", doNotConver
|
|
|
70150
70150
|
}
|
|
70151
70151
|
return stringValue;
|
|
70152
70152
|
};
|
|
70153
|
+
const isValueWithUnknownUnit = (value) => {
|
|
70154
|
+
if (!value)
|
|
70155
|
+
return false;
|
|
70156
|
+
return Boolean(getUnit(value));
|
|
70157
|
+
};
|
|
70153
70158
|
const safeConvertValue = (value = "", toUnit, defaultFromUnit, doNotConvertValue) => {
|
|
70154
70159
|
if (doNotConvertValue)
|
|
70155
70160
|
return value;
|
|
70156
|
-
const isWithUnit = isValueWithUnit(value);
|
|
70161
|
+
const isWithUnit = isValueWithUnknownUnit(value) || isValueWithUnit(value);
|
|
70157
70162
|
const rawValue = getValue$1(value);
|
|
70158
70163
|
const isInvalidInput = isWrongValue(rawValue);
|
|
70159
70164
|
if (isInvalidInput)
|
|
@@ -70207,14 +70212,6 @@ const validate = (value, options) => {
|
|
|
70207
70212
|
}
|
|
70208
70213
|
return null;
|
|
70209
70214
|
};
|
|
70210
|
-
const isUnitKnown = (unit2 = "") => {
|
|
70211
|
-
var _a;
|
|
70212
|
-
return (_a = KNOWN_UNITS) == null ? void 0 : _a.includes(unit2);
|
|
70213
|
-
};
|
|
70214
|
-
const isKnownUnit = (valueWithUnit, defaultUnit) => {
|
|
70215
|
-
const unitFromValue = getUnit(valueWithUnit || "");
|
|
70216
|
-
return isUnitKnown(defaultUnit) && isUnitKnown(unitFromValue);
|
|
70217
|
-
};
|
|
70218
70215
|
const predefinedMenuActive = "_predefinedMenuActive_1yvt4_1";
|
|
70219
70216
|
const styles = {
|
|
70220
70217
|
predefinedMenuActive
|
|
@@ -70263,7 +70260,6 @@ const UnitInput = ({
|
|
|
70263
70260
|
() => getPreferredUnit(unitkey, unitTemplate),
|
|
70264
70261
|
[unitkey, unitTemplate]
|
|
70265
70262
|
);
|
|
70266
|
-
const knownUnit = isKnownUnit(value, defaultUnit);
|
|
70267
70263
|
const initDisplayUnit = initUnit || defaultUnit || propUnit;
|
|
70268
70264
|
const previousInitUnit = usePrevious(initDisplayUnit);
|
|
70269
70265
|
const convertedValue = safeConvertValue(
|
|
@@ -70357,7 +70353,7 @@ const UnitInput = ({
|
|
|
70357
70353
|
useEffect(() => {
|
|
70358
70354
|
if (initDisplayUnit) {
|
|
70359
70355
|
let newValue, newUnit = "";
|
|
70360
|
-
if (previousInitUnit !== initDisplayUnit
|
|
70356
|
+
if (previousInitUnit !== initDisplayUnit) {
|
|
70361
70357
|
newValue = safeConvertValue(
|
|
70362
70358
|
value,
|
|
70363
70359
|
initDisplayUnit,
|
|
@@ -70365,7 +70361,7 @@ const UnitInput = ({
|
|
|
70365
70361
|
doNotConvertValue
|
|
70366
70362
|
);
|
|
70367
70363
|
newUnit = initDisplayUnit;
|
|
70368
|
-
} else if (withUnit(displayLayer.value, displayLayer.unit) !== value
|
|
70364
|
+
} else if (withUnit(displayLayer.value, displayLayer.unit) !== value) {
|
|
70369
70365
|
newValue = safeConvertValue(
|
|
70370
70366
|
value,
|
|
70371
70367
|
displayLayer.unit,
|
|
@@ -70373,9 +70369,6 @@ const UnitInput = ({
|
|
|
70373
70369
|
doNotConvertValue
|
|
70374
70370
|
);
|
|
70375
70371
|
newUnit = displayLayer.unit;
|
|
70376
|
-
} else if (!knownUnit) {
|
|
70377
|
-
newValue = getValue$1(value ?? "");
|
|
70378
|
-
newUnit = initDisplayUnit;
|
|
70379
70372
|
}
|
|
70380
70373
|
if (newValue !== void 0) {
|
|
70381
70374
|
setDisplayLayer({ value: newValue, unit: newUnit });
|