@evergis/react 3.1.24 → 3.1.25
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/react.esm.js
CHANGED
|
@@ -8724,7 +8724,17 @@ const useWidgetPage = (type = WidgetType.Dashboard) => {
|
|
|
8724
8724
|
changePage(pageIndex > 1 ? pageIndex - 1 : 1);
|
|
8725
8725
|
}
|
|
8726
8726
|
}, [changePage, pageIndex, projectInfo, updateProject]);
|
|
8727
|
-
|
|
8727
|
+
const updateConfigLayer = useCallback((name, newProps) => {
|
|
8728
|
+
const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
|
|
8729
|
+
const pages = getPagesFromProjectInfo(newProjectInfo);
|
|
8730
|
+
const page = pages?.[pageIndex - 1];
|
|
8731
|
+
const index = page?.layers?.findIndex(layer => layer.name === name) ?? -1;
|
|
8732
|
+
if (index === -1)
|
|
8733
|
+
return;
|
|
8734
|
+
page.layers[index] = { ...page.layers[index], ...newProps };
|
|
8735
|
+
updateProject(newProjectInfo);
|
|
8736
|
+
}, [projectInfo, pageIndex, updateProject]);
|
|
8737
|
+
return { pageIndex, currentPage, changePage, updateConfigPage, addConfigPage, deleteConfigPage, updateConfigLayer };
|
|
8728
8738
|
};
|
|
8729
8739
|
|
|
8730
8740
|
const useChartData = ({ element, type }) => {
|