@oliasoft-open-source/react-ui-library 4.13.0-beta-7 → 4.13.0-beta-9

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 CHANGED
@@ -70295,9 +70295,12 @@ const PredefinedOptionsMenu = ({
70295
70295
  const [foundPredefinedMenuOption, setFoundPredefinedMenuOption] = useState(void 0);
70296
70296
  const convertPredefinedOptions = ({
70297
70297
  value,
70298
- unitkey: optionUnitKey
70298
+ unitkey: optionUnitKey,
70299
+ linked
70299
70300
  }) => {
70300
70301
  if (!value || !rootUnitKey) return value;
70302
+ if (!isValueWithUnit(value)) return value;
70303
+ if (linked) return value;
70301
70304
  const selectedUnitKey = optionUnitKey || rootUnitKey;
70302
70305
  const preferredOptionUnit = getPreferredUnit(selectedUnitKey, unitTemplate);
70303
70306
  const { value: resultValue } = safeConvertValue({
@@ -70571,27 +70574,18 @@ const UnitInput = ({
70571
70574
  predefinedOptions,
70572
70575
  displayLayer,
70573
70576
  onPredefinedOptionSelect: (newValue, option2) => {
70574
- if (option2 == null ? void 0 : option2.linked) {
70575
- onChange({
70576
- target: {
70577
- value,
70578
- name: stringName,
70579
- predefinedSelected: true,
70580
- predefinedOption: option2
70581
- }
70582
- });
70583
- } else {
70584
- onChange({
70585
- target: {
70586
- value: newValue,
70587
- name: stringName
70588
- }
70589
- });
70590
- setDisplayLayer({
70577
+ onChange({
70578
+ target: {
70591
70579
  value: newValue,
70592
- unit: getUnit(newValue) || displayLayer.unit
70593
- });
70594
- }
70580
+ name: stringName,
70581
+ predefinedSelected: true,
70582
+ predefinedOption: option2
70583
+ }
70584
+ });
70585
+ setDisplayLayer({
70586
+ value: newValue,
70587
+ unit: getUnit(newValue) || displayLayer.unit
70588
+ });
70595
70589
  },
70596
70590
  disabled: disabled2,
70597
70591
  initialPredefinedOption,