@oliasoft-open-source/react-ui-library 4.13.0-beta-14 → 4.13.0-beta-16
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.d.ts +1 -0
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -70322,6 +70322,7 @@ const PredefinedOptionsMenu = ({
|
|
|
70322
70322
|
type: MenuType.OPTION,
|
|
70323
70323
|
inline: true,
|
|
70324
70324
|
onClick: () => {
|
|
70325
|
+
if (isEqual$4(foundPredefinedMenuOption, el2)) return;
|
|
70325
70326
|
const validation = validateNumber(inputValue);
|
|
70326
70327
|
const optionState = {
|
|
70327
70328
|
predefinedSelected: true,
|
|
@@ -70343,27 +70344,36 @@ const PredefinedOptionsMenu = ({
|
|
|
70343
70344
|
};
|
|
70344
70345
|
const initialPredefinedOptionObject = useMemo$1(() => {
|
|
70345
70346
|
return predefinedOptions.find(
|
|
70346
|
-
(option2) => option2.value
|
|
70347
|
+
(option2) => [option2.value, option2.label, option2.valueKey].includes(
|
|
70348
|
+
initialPredefinedOption
|
|
70349
|
+
)
|
|
70347
70350
|
);
|
|
70348
|
-
}, [initialPredefinedOption
|
|
70351
|
+
}, [initialPredefinedOption]);
|
|
70349
70352
|
useEffect(() => {
|
|
70350
70353
|
if (initialPredefinedOptionObject) {
|
|
70351
70354
|
setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
|
|
70352
70355
|
setFoundPredefinedMenuOption(initialPredefinedOptionObject);
|
|
70353
|
-
|
|
70354
|
-
|
|
70355
|
-
|
|
70356
|
-
|
|
70356
|
+
if (!(initialPredefinedOptionObject == null ? void 0 : initialPredefinedOptionObject.linked)) {
|
|
70357
|
+
onPredefinedOptionSelect(initialPredefinedOptionObject.value, {
|
|
70358
|
+
predefinedSelected: true,
|
|
70359
|
+
predefinedOption: initialPredefinedOptionObject
|
|
70360
|
+
});
|
|
70361
|
+
}
|
|
70357
70362
|
}
|
|
70358
|
-
}, [
|
|
70363
|
+
}, [
|
|
70364
|
+
initialPredefinedOptionObject == null ? void 0 : initialPredefinedOptionObject.value,
|
|
70365
|
+
initialPredefinedOptionObject == null ? void 0 : initialPredefinedOptionObject.label
|
|
70366
|
+
]);
|
|
70359
70367
|
useEffect(() => {
|
|
70360
70368
|
const foundOption = predefinedOptions.find((option2) => {
|
|
70361
70369
|
const convertedValue = convertPredefinedOptions(option2);
|
|
70362
70370
|
return convertedValue === withUnit(displayLayer == null ? void 0 : displayLayer.value, (displayLayer == null ? void 0 : displayLayer.unit) ?? "");
|
|
70363
70371
|
});
|
|
70364
|
-
if (foundOption) {
|
|
70372
|
+
if (foundOption || initialPredefinedOptionObject) {
|
|
70365
70373
|
setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
|
|
70366
|
-
setFoundPredefinedMenuOption(
|
|
70374
|
+
setFoundPredefinedMenuOption(
|
|
70375
|
+
foundOption || initialPredefinedOptionObject
|
|
70376
|
+
);
|
|
70367
70377
|
} else {
|
|
70368
70378
|
setPredefinedOptionsMenuState(PredefinedOptionsMenuState.CUSTOM);
|
|
70369
70379
|
setFoundPredefinedMenuOption(void 0);
|