@topconsultnpm/sdkui-react-beta 6.15.83 → 6.15.85

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.
@@ -99,15 +99,24 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
99
99
  return;
100
100
  if (!metadataValues || metadataValues.length === 0)
101
101
  return;
102
- // Process each inputMid and apply the values using onChangeHandler
102
+ // Clone the current metadata values
103
+ let newValues = structuredClone(metadataValues);
104
+ let hasChanges = false;
105
+ // Apply all the inputMid values to the cloned array
103
106
  inputMids.forEach(inputMid => {
104
- // Check if this mid exists in the current metadata values
105
- const existingMetadata = metadataValues.find(mv => mv.mid === inputMid.mid);
106
- if (existingMetadata) {
107
- // Apply the value using onChangeHandler
108
- onChangeHandler(inputMid.value, inputMid.mid);
107
+ const item = newValues.find(value => value.mid === inputMid.mid);
108
+ if (item) {
109
+ item.value = inputMid.value;
110
+ if (showCheckBoxes !== ShowCheckBoxesMode.Never) {
111
+ item.isSelected = !stringIsNullOrEmpty(inputMid.value);
112
+ }
113
+ hasChanges = true;
109
114
  }
110
115
  });
116
+ // Call onValueChanged once with all changes
117
+ if (hasChanges) {
118
+ onValueChanged?.(newValues);
119
+ }
111
120
  }, [inputMids, metadataValues]); // Run when inputMids or metadataValues change
112
121
  const loadDynDataListToBeRefreshedCascadeAsync = async (tid, mvdList) => {
113
122
  if (!tid)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.15.83",
3
+ "version": "6.15.85",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",