@visns-studio/visns-components 5.10.5 → 5.10.6
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/package.json
CHANGED
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
88
88
|
},
|
|
89
89
|
"name": "@visns-studio/visns-components",
|
|
90
|
-
"version": "5.10.
|
|
90
|
+
"version": "5.10.6",
|
|
91
91
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
92
92
|
"main": "src/index.js",
|
|
93
93
|
"files": [
|
|
@@ -1740,10 +1740,43 @@ function GenericIndex({
|
|
|
1740
1740
|
|
|
1741
1741
|
const date = moment().format('YYYYMMDD');
|
|
1742
1742
|
|
|
1743
|
+
// Process the export payload
|
|
1744
|
+
let payload = {};
|
|
1745
|
+
if (config.export.payload) {
|
|
1746
|
+
payload = { ...config.export.payload };
|
|
1747
|
+
|
|
1748
|
+
// Process special values in the payload
|
|
1749
|
+
Object.keys(payload).forEach(key => {
|
|
1750
|
+
if (payload[key] === 'currentActive()') {
|
|
1751
|
+
// Get the current active filter value
|
|
1752
|
+
const activeFilter = subnav?.find(filter => {
|
|
1753
|
+
if (filter.isParent) {
|
|
1754
|
+
return filter.children && filter.children.some(child => child.show);
|
|
1755
|
+
}
|
|
1756
|
+
return filter.show === true;
|
|
1757
|
+
});
|
|
1758
|
+
|
|
1759
|
+
if (activeFilter) {
|
|
1760
|
+
if (activeFilter.isParent && activeFilter.children && activeFilter.children.length > 0) {
|
|
1761
|
+
// If it's a parent filter, get the active child's value
|
|
1762
|
+
const activeChild = activeFilter.children.find(child => child.show);
|
|
1763
|
+
payload[key] = activeChild ? activeChild.value || activeChild.id : '';
|
|
1764
|
+
} else {
|
|
1765
|
+
// For non-parent filters, use the filter's value or id
|
|
1766
|
+
payload[key] = activeFilter.value || activeFilter.id;
|
|
1767
|
+
}
|
|
1768
|
+
} else {
|
|
1769
|
+
// If no active filter is found, set to empty string
|
|
1770
|
+
payload[key] = '';
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1743
1776
|
const res = await Download(
|
|
1744
1777
|
config.export.url,
|
|
1745
1778
|
config.export.method,
|
|
1746
|
-
|
|
1779
|
+
payload
|
|
1747
1780
|
);
|
|
1748
1781
|
|
|
1749
1782
|
if (res.data.error) {
|