@oliasoft-open-source/react-ui-library 4.10.6 → 4.10.7
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 +28 -9
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-KGDBMAHA-DrMyC9A0.js → Color-KGDBMAHA-D26yaCjU.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-PKQXORMH-CC68DXWF.js → DocsRenderer-PKQXORMH-vElC6boV.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-QeOe4vsi.js → buttons-and-links-Bzw6sQEl.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-Cxh0E8tX.js → chunk-HLWAVYOI-Dub2zPy2.js} +1 -1
- package/dist/storybook/assets/{color-4IjYk88L.js → color-sXpR2rDi.js} +1 -1
- package/dist/storybook/assets/{iframe-Cs4an5gG.js → iframe-DfbvzuKW.js} +2 -2
- package/dist/storybook/assets/{index-BOsX0bVI.js → index-CI3hSkVq.js} +4 -4
- package/dist/storybook/assets/{index-S8YjWNHt.js → index-Cj40cYYp.js} +1 -1
- package/dist/storybook/assets/{input-validation-CsrR1bd6.js → input-validation-5WW8MSTd.js} +1 -1
- package/dist/storybook/assets/{inputs-KGQtyGlg.js → inputs-C6ZKc-en.js} +1 -1
- package/dist/storybook/assets/{layout-forms-D79Bssr0.js → layout-forms-Davxfa-B.js} +1 -1
- package/dist/storybook/assets/{layout-general-CO0u964D.js → layout-general-C4k_FsG1.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-4q9IoJDn.js → padding-and-spacing-ChZ-7T_N.js} +1 -1
- package/dist/storybook/assets/{preview-Cph2vWSX.js → preview-Blwe7Q4Y.js} +2 -2
- package/dist/storybook/assets/{preview-D-mQWfBm.js → preview-Dn1IHTmv.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-CkeTteis.js → unit-input.stories-9b23SnFs.js} +14 -14
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55688,6 +55688,10 @@ const NumberInput = ({
|
|
|
55688
55688
|
}) => {
|
|
55689
55689
|
const validateInputValue = (value2) => {
|
|
55690
55690
|
const validation = validateNumber(value2);
|
|
55691
|
+
const isPlaceholder = placeholder3 && isEmptyNullOrUndefined(value2);
|
|
55692
|
+
if (isPlaceholder) {
|
|
55693
|
+
return { valid: true, errors: [] };
|
|
55694
|
+
}
|
|
55691
55695
|
if (allowEmpty && value2 === "" || validation.valid) {
|
|
55692
55696
|
return { ...validation, valid: true, errors: void 0 };
|
|
55693
55697
|
} else {
|
|
@@ -55733,7 +55737,7 @@ const NumberInput = ({
|
|
|
55733
55737
|
value2.replaceAll(" ", "").replaceAll("|", "")
|
|
55734
55738
|
);
|
|
55735
55739
|
setDisplayValue(inputValue);
|
|
55736
|
-
if ((_b = validateInputValue(inputValue)) == null ? void 0 : _b.valid) {
|
|
55740
|
+
if (((_b = validateInputValue(inputValue)) == null ? void 0 : _b.valid) || placeholder3 && isEmptyNullOrUndefined(value2)) {
|
|
55737
55741
|
const event = {
|
|
55738
55742
|
...evt,
|
|
55739
55743
|
target: {
|
|
@@ -70338,7 +70342,7 @@ const UnitInput = ({
|
|
|
70338
70342
|
initialPredefinedOption ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM
|
|
70339
70343
|
);
|
|
70340
70344
|
const isAutoValue = propValue === "" && autoValue;
|
|
70341
|
-
const disableInternalErrorValidationMessages = !!(disabledValidation || autoValue
|
|
70345
|
+
const disableInternalErrorValidationMessages = !!(disabledValidation || autoValue);
|
|
70342
70346
|
const foundPredefinedMenuOption = predefinedOptions && predefinedOptions.find((el2) => {
|
|
70343
70347
|
if (!(el2 == null ? void 0 : el2.value)) return;
|
|
70344
70348
|
if (selectedPredefinedOptionKey) {
|
|
@@ -70490,6 +70494,27 @@ const UnitInput = ({
|
|
|
70490
70494
|
const dynamicOptions = predefinedOptions.map(createPredefinedOption);
|
|
70491
70495
|
sectionsPredefinedMenu = [...sectionsPredefinedMenu, ...dynamicOptions];
|
|
70492
70496
|
}
|
|
70497
|
+
const getPlaceholder = (placeholder22) => {
|
|
70498
|
+
if (isAutoValue) {
|
|
70499
|
+
return safeConvertValue({
|
|
70500
|
+
value: autoValue,
|
|
70501
|
+
toUnit: displayLayer.unit,
|
|
70502
|
+
unitkey,
|
|
70503
|
+
defaultFromUnit: propAutoUnit,
|
|
70504
|
+
doNotConvertValue
|
|
70505
|
+
});
|
|
70506
|
+
} else if (isValueWithUnit(placeholder22)) {
|
|
70507
|
+
const placeholderUnit = getUnit(placeholder22);
|
|
70508
|
+
return safeConvertValue({
|
|
70509
|
+
value: placeholder22,
|
|
70510
|
+
toUnit: displayLayer.unit,
|
|
70511
|
+
unitkey,
|
|
70512
|
+
defaultFromUnit: placeholderUnit,
|
|
70513
|
+
doNotConvertValue
|
|
70514
|
+
});
|
|
70515
|
+
}
|
|
70516
|
+
return placeholder22;
|
|
70517
|
+
};
|
|
70493
70518
|
return /* @__PURE__ */ jsx(
|
|
70494
70519
|
"div",
|
|
70495
70520
|
{
|
|
@@ -70530,13 +70555,7 @@ const UnitInput = ({
|
|
|
70530
70555
|
name: stringName,
|
|
70531
70556
|
testId,
|
|
70532
70557
|
disabled: disabled2,
|
|
70533
|
-
placeholder:
|
|
70534
|
-
value: autoValue,
|
|
70535
|
-
toUnit: displayLayer.unit,
|
|
70536
|
-
unitkey,
|
|
70537
|
-
defaultFromUnit: propAutoUnit,
|
|
70538
|
-
doNotConvertValue
|
|
70539
|
-
}) : placeholder3,
|
|
70558
|
+
placeholder: getPlaceholder(placeholder3),
|
|
70540
70559
|
value: displayLayer.value,
|
|
70541
70560
|
onChange: onSetValue,
|
|
70542
70561
|
onFocus,
|