@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 CHANGED
@@ -1042,6 +1042,7 @@ declare interface IPredefinedOption {
1042
1042
  label: string;
1043
1043
  valueKey?: string;
1044
1044
  unit?: string;
1045
+ linked?: boolean;
1045
1046
  }
1046
1047
 
1047
1048
  export declare interface IPrintHeaderProps {
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 === initialPredefinedOption || option2.label === initialPredefinedOption || option2.valueKey === initialPredefinedOption
70347
+ (option2) => [option2.value, option2.label, option2.valueKey].includes(
70348
+ initialPredefinedOption
70349
+ )
70347
70350
  );
70348
- }, [initialPredefinedOption, predefinedOptions]);
70351
+ }, [initialPredefinedOption]);
70349
70352
  useEffect(() => {
70350
70353
  if (initialPredefinedOptionObject) {
70351
70354
  setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
70352
70355
  setFoundPredefinedMenuOption(initialPredefinedOptionObject);
70353
- onPredefinedOptionSelect(initialPredefinedOptionObject.value, {
70354
- predefinedSelected: true,
70355
- predefinedOption: initialPredefinedOptionObject
70356
- });
70356
+ if (!(initialPredefinedOptionObject == null ? void 0 : initialPredefinedOptionObject.linked)) {
70357
+ onPredefinedOptionSelect(initialPredefinedOptionObject.value, {
70358
+ predefinedSelected: true,
70359
+ predefinedOption: initialPredefinedOptionObject
70360
+ });
70361
+ }
70357
70362
  }
70358
- }, [initialPredefinedOptionObject]);
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(foundOption);
70374
+ setFoundPredefinedMenuOption(
70375
+ foundOption || initialPredefinedOptionObject
70376
+ );
70367
70377
  } else {
70368
70378
  setPredefinedOptionsMenuState(PredefinedOptionsMenuState.CUSTOM);
70369
70379
  setFoundPredefinedMenuOption(void 0);