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

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
@@ -70232,6 +70232,7 @@ const safeConvertValue = ({
70232
70232
  }) => {
70233
70233
  const rawValue = getValue$1(value);
70234
70234
  const isInvalidInput = isWrongValue(rawValue);
70235
+ const availableUnits = ALT_UNITS[unitkey];
70235
70236
  if (isValueWithUnknownUnit(value)) {
70236
70237
  return { value: rawValue };
70237
70238
  }
@@ -70241,6 +70242,9 @@ const safeConvertValue = ({
70241
70242
  if (!isValueWithUnit(value)) {
70242
70243
  return { value };
70243
70244
  }
70245
+ if (!(availableUnits == null ? void 0 : availableUnits.includes(getUnit(value)))) {
70246
+ return { value: rawValue };
70247
+ }
70244
70248
  return convertUnit({
70245
70249
  value,
70246
70250
  unitkey,
@@ -70295,12 +70299,10 @@ const PredefinedOptionsMenu = ({
70295
70299
  const [foundPredefinedMenuOption, setFoundPredefinedMenuOption] = useState(void 0);
70296
70300
  const convertPredefinedOptions = ({
70297
70301
  value,
70298
- unitkey: optionUnitKey,
70299
- linked
70302
+ unitkey: optionUnitKey
70300
70303
  }) => {
70301
70304
  if (!value || !rootUnitKey) return value;
70302
70305
  if (!isValueWithUnit(value)) return value;
70303
- if (linked) return value;
70304
70306
  const selectedUnitKey = optionUnitKey || rootUnitKey;
70305
70307
  const preferredOptionUnit = getPreferredUnit(selectedUnitKey, unitTemplate);
70306
70308
  const { value: resultValue } = safeConvertValue({