procode-lowcode-core 1.0.7 → 1.0.8

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.esm.js CHANGED
@@ -18559,7 +18559,7 @@ const getParams = (config, actionInvokerProps, selectedValue) => {
18559
18559
  ValueReplacePolicy$1.STATE_SELECTED_DATA) {
18560
18560
  const fields = p.rightOperand.value.split("::");
18561
18561
  let model = getValueFromNestedObject(fields[0], actionInvokerProps.viewModel);
18562
- model = model === null || model === void 0 ? void 0 : model.find((m) => m.id === selectedValue);
18562
+ model = model === null || model === void 0 ? void 0 : model.find((m) => { var _a; return m[(_a = selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.dataItemKey) !== null && _a !== void 0 ? _a : "id"] === (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value); });
18563
18563
  value = getValueFromNestedObject(fields[1], model);
18564
18564
  }
18565
18565
  else {
package/dist/index.js CHANGED
@@ -18563,7 +18563,7 @@ const getParams = (config, actionInvokerProps, selectedValue) => {
18563
18563
  ValueReplacePolicy$1.STATE_SELECTED_DATA) {
18564
18564
  const fields = p.rightOperand.value.split("::");
18565
18565
  let model = getValueFromNestedObject(fields[0], actionInvokerProps.viewModel);
18566
- model = model === null || model === void 0 ? void 0 : model.find((m) => m.id === selectedValue);
18566
+ model = model === null || model === void 0 ? void 0 : model.find((m) => { var _a; return m[(_a = selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.dataItemKey) !== null && _a !== void 0 ? _a : "id"] === (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value); });
18567
18567
  value = getValueFromNestedObject(fields[1], model);
18568
18568
  }
18569
18569
  else {
@@ -1,3 +1,6 @@
1
1
  import { ActionInvokerProperties } from "../Types";
2
- declare const handleNavigation: (actionInvokerProps: ActionInvokerProperties, selectedValue?: string | number) => void;
2
+ declare const handleNavigation: (actionInvokerProps: ActionInvokerProperties, selectedValue?: {
3
+ dataItemKey: string;
4
+ value: any;
5
+ }) => void;
3
6
  export default handleNavigation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "procode-lowcode-core",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "ProCode Core Library - React framework for low-code applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4,7 +4,7 @@ import { ActionInvokerProperties, ValueReplacePolicy } from "../Types";
4
4
  const getParams = (
5
5
  config: any,
6
6
  actionInvokerProps: ActionInvokerProperties,
7
- selectedValue?: string | number
7
+ selectedValue?: { dataItemKey: string; value: any },
8
8
  ) => {
9
9
  const paramsList: string[] = [];
10
10
 
@@ -13,7 +13,7 @@ const getParams = (
13
13
  if (p?.rightOperand?.valueReplacePolicy === ValueReplacePolicy.STATE) {
14
14
  value = getValueFromNestedObject(
15
15
  p.rightOperand.value,
16
- actionInvokerProps.viewModel
16
+ actionInvokerProps.viewModel,
17
17
  );
18
18
  } else if (
19
19
  p?.rightOperand?.valueReplacePolicy ===
@@ -22,9 +22,12 @@ const getParams = (
22
22
  const fields = p.rightOperand.value.split("::");
23
23
  let model = getValueFromNestedObject(
24
24
  fields[0],
25
- actionInvokerProps.viewModel
25
+ actionInvokerProps.viewModel,
26
+ );
27
+ model = model?.find(
28
+ (m: any) =>
29
+ m[selectedValue?.dataItemKey ?? "id"] === selectedValue?.value,
26
30
  );
27
- model = model?.find((m: any) => m.id === selectedValue);
28
31
  value = getValueFromNestedObject(fields[1], model);
29
32
  } else {
30
33
  value = p.rightOperand.value;
@@ -38,7 +41,7 @@ const getParams = (
38
41
 
39
42
  const handleNavigation = (
40
43
  actionInvokerProps: ActionInvokerProperties,
41
- selectedValue?: string | number
44
+ selectedValue?: { dataItemKey: string; value: any },
42
45
  ) => {
43
46
  const config = actionInvokerProps.actionProps.config;
44
47
  let path = config.path;
@@ -46,7 +49,7 @@ const handleNavigation = (
46
49
  const paramsList: string[] = getParams(
47
50
  config,
48
51
  actionInvokerProps,
49
- selectedValue
52
+ selectedValue,
50
53
  );
51
54
 
52
55
  if (paramsList.length > 0) {