@wipco/sdui 0.49.0 → 0.50.0
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.js +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1801,6 +1801,14 @@ function substituteFields(template, row) {
|
|
|
1801
1801
|
}
|
|
1802
1802
|
if (Array.isArray(template)) return template.map((item) => substituteFields(item, row));
|
|
1803
1803
|
if (isPlainObject(template)) {
|
|
1804
|
+
const nested = isPlainObject(template.$calc) ? template.$calc : null;
|
|
1805
|
+
if (nested && nested.op === "map") {
|
|
1806
|
+
const inner = {};
|
|
1807
|
+
for (const [key, value] of Object.entries(nested)) {
|
|
1808
|
+
inner[key] = key === "select" ? value : substituteFields(value, row);
|
|
1809
|
+
}
|
|
1810
|
+
return { ...template, $calc: inner };
|
|
1811
|
+
}
|
|
1804
1812
|
const out = {};
|
|
1805
1813
|
for (const [key, value] of Object.entries(template)) out[key] = substituteFields(value, row);
|
|
1806
1814
|
return out;
|