@oliasoft-open-source/react-ui-library 4.13.0-beta-12 → 4.13.0-beta-14

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
@@ -1041,8 +1041,7 @@ declare interface IPredefinedOption {
1041
1041
  value: string;
1042
1042
  label: string;
1043
1043
  valueKey?: string;
1044
- unitkey?: string;
1045
- linked?: boolean;
1044
+ unit?: string;
1046
1045
  }
1047
1046
 
1048
1047
  export declare interface IPrintHeaderProps {
package/dist/index.js CHANGED
@@ -70296,11 +70296,11 @@ const PredefinedOptionsMenu = ({
70296
70296
  setPredefinedOptionsMenuState,
70297
70297
  testId
70298
70298
  }) => {
70299
- extractValue(displayLayer == null ? void 0 : displayLayer.value);
70299
+ const extractedValue = extractValue(displayLayer == null ? void 0 : displayLayer.value);
70300
70300
  const [foundPredefinedMenuOption, setFoundPredefinedMenuOption] = useState(void 0);
70301
70301
  const convertPredefinedOptions = ({
70302
70302
  value,
70303
- unitkey: optionUnitKey
70303
+ unit: optionUnitKey
70304
70304
  }) => {
70305
70305
  if (!value || !rootUnitKey) return value;
70306
70306
  if (!isValueWithUnit(value)) return value;
@@ -70323,9 +70323,13 @@ const PredefinedOptionsMenu = ({
70323
70323
  inline: true,
70324
70324
  onClick: () => {
70325
70325
  const validation = validateNumber(inputValue);
70326
+ const optionState = {
70327
+ predefinedSelected: true,
70328
+ predefinedOption: el2
70329
+ };
70326
70330
  if (validation.valid && !disabled2) {
70327
70331
  setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
70328
- onPredefinedOptionSelect(convertedValue, el2);
70332
+ onPredefinedOptionSelect(convertedValue, optionState);
70329
70333
  setFoundPredefinedMenuOption(el2);
70330
70334
  }
70331
70335
  },
@@ -70346,10 +70350,10 @@ const PredefinedOptionsMenu = ({
70346
70350
  if (initialPredefinedOptionObject) {
70347
70351
  setPredefinedOptionsMenuState(PredefinedOptionsMenuState.PREDEFINED);
70348
70352
  setFoundPredefinedMenuOption(initialPredefinedOptionObject);
70349
- onPredefinedOptionSelect(
70350
- initialPredefinedOptionObject.value,
70351
- initialPredefinedOptionObject
70352
- );
70353
+ onPredefinedOptionSelect(initialPredefinedOptionObject.value, {
70354
+ predefinedSelected: true,
70355
+ predefinedOption: initialPredefinedOptionObject
70356
+ });
70353
70357
  }
70354
70358
  }, [initialPredefinedOptionObject]);
70355
70359
  useEffect(() => {
@@ -70364,11 +70368,7 @@ const PredefinedOptionsMenu = ({
70364
70368
  setPredefinedOptionsMenuState(PredefinedOptionsMenuState.CUSTOM);
70365
70369
  setFoundPredefinedMenuOption(void 0);
70366
70370
  }
70367
- }, [predefinedOptions]);
70368
- console.log(
70369
- "createPredefinedOption",
70370
- predefinedOptions.map(createPredefinedOption)
70371
- );
70371
+ }, [extractedValue]);
70372
70372
  const sectionsPredefinedMenu = [
70373
70373
  {
70374
70374
  type: MenuType.OPTION,
@@ -70447,8 +70447,6 @@ const UnitInput = ({
70447
70447
  const context2 = useUnitContext();
70448
70448
  const runAfterUpdate = useRunAfterUpdate();
70449
70449
  const [predefinedOptionsMenuState, setPredefinedOptionsMenuState] = useState(PredefinedOptionsMenuState.CUSTOM);
70450
- console.log("PRED_OPT>>>", predefinedOptions);
70451
- console.log("INIT_PRED_OPT>>>", initialPredefinedOption);
70452
70450
  if (typeof value === "number") {
70453
70451
  value = `${value}`;
70454
70452
  }
@@ -70582,13 +70580,13 @@ const UnitInput = ({
70582
70580
  unitkey,
70583
70581
  predefinedOptions,
70584
70582
  displayLayer,
70585
- onPredefinedOptionSelect: (newValue, option2) => {
70583
+ onPredefinedOptionSelect: (newValue, optionState) => {
70586
70584
  onChange({
70587
70585
  target: {
70588
70586
  value: newValue,
70589
70587
  name: stringName,
70590
- predefinedSelected: true,
70591
- predefinedOption: option2
70588
+ predefinedSelected: optionState == null ? void 0 : optionState.predefinedSelected,
70589
+ predefinedOption: optionState == null ? void 0 : optionState.predefinedOption
70592
70590
  }
70593
70591
  });
70594
70592
  setDisplayLayer({