admin_lsac 2.0.31 → 2.0.32
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.
|
@@ -60,6 +60,13 @@ export function AdminPage({ pages, selectedPage, basePath, apiURL = '', }) {
|
|
|
60
60
|
const [rowObject, setRowObject] = useState([]);
|
|
61
61
|
const [refetch, setRefetch] = useState(false);
|
|
62
62
|
const [socket, setSocket] = useState(io);
|
|
63
|
+
const [pagination, setPagination] = useState(() => {
|
|
64
|
+
const saved = localStorage.getItem('tablePageSize');
|
|
65
|
+
return {
|
|
66
|
+
pageIndex: 0,
|
|
67
|
+
pageSize: saved ? parseInt(saved) : 10,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
63
70
|
if (apiURL !== '') {
|
|
64
71
|
newSocket(setSocket, apiURL);
|
|
65
72
|
}
|
|
@@ -99,7 +106,13 @@ export function AdminPage({ pages, selectedPage, basePath, apiURL = '', }) {
|
|
|
99
106
|
overflowY: 'visible',
|
|
100
107
|
overflowX: 'auto',
|
|
101
108
|
},
|
|
102
|
-
}, enableColumnResizing: true, enableColumnPinning: true, enableGlobalFilterModes: true, enablePagination:
|
|
109
|
+
}, enableColumnResizing: true, enableColumnPinning: true, enableGlobalFilterModes: true, enablePagination: true, paginationDisplayMode: "pages", onPaginationChange: (updater) => {
|
|
110
|
+
setPagination((prev) => {
|
|
111
|
+
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
112
|
+
localStorage.setItem('tablePageSize', String(next.pageSize));
|
|
113
|
+
return next;
|
|
114
|
+
});
|
|
115
|
+
}, state: { pagination }, enableRowVirtualization: false, renderTopToolbarCustomActions: () => (_jsx(ChakraProvider, { children: _jsx(Stack, { margin: 0, padding: 2, direction: "row", wrap: "wrap", children: selectedPage.actions.map((action, index) => (_jsx(Button, { colorScheme: "blue", onClick: () => {
|
|
103
116
|
setSelectedAction(action);
|
|
104
117
|
onOpen();
|
|
105
118
|
}, children: action.name }, index))) }) })), enableRowActions: true, renderRowActionMenuItems: (obj) => {
|