@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
|
-
//
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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)
|