@bsol-oss/react-datatable5 2.0.3 → 2.0.4
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 +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -379,6 +379,9 @@ const DataTableServer = ({ columns, url, enableRowSelection = true, enableMultiR
|
|
|
379
379
|
react$1.useEffect(() => {
|
|
380
380
|
onRowSelect(table.getState().rowSelection, data.results);
|
|
381
381
|
}, [table.getState().rowSelection]);
|
|
382
|
+
react$1.useEffect(() => {
|
|
383
|
+
table.resetPagination();
|
|
384
|
+
}, [sorting, columnFilters, globalFilter, url]);
|
|
382
385
|
return (jsxRuntime.jsx(TableContext.Provider, { value: {
|
|
383
386
|
table: { ...table },
|
|
384
387
|
refreshData: refreshData,
|
|
@@ -921,9 +924,9 @@ const GlobalFilter = ({ icon = md.MdSearch }) => {
|
|
|
921
924
|
const { table } = useDataTableContext();
|
|
922
925
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(react.Box, { children: jsxRuntime.jsxs(react.InputGroup, { children: [jsxRuntime.jsx(react.InputLeftElement, { pointerEvents: "none", children: jsxRuntime.jsx(react.Icon, { as: icon, color: "gray.300" }) }), jsxRuntime.jsx(react.Input, { value: table.getState().globalFilter.globalFilter, onChange: (e) => {
|
|
923
926
|
if (!!e.target.value) {
|
|
924
|
-
table.setGlobalFilter(
|
|
927
|
+
table.setGlobalFilter(undefined);
|
|
925
928
|
}
|
|
926
|
-
table.setGlobalFilter(
|
|
929
|
+
table.setGlobalFilter(e.target.value);
|
|
927
930
|
} })] }) }) }));
|
|
928
931
|
};
|
|
929
932
|
|
package/dist/index.mjs
CHANGED
|
@@ -377,6 +377,9 @@ const DataTableServer = ({ columns, url, enableRowSelection = true, enableMultiR
|
|
|
377
377
|
useEffect(() => {
|
|
378
378
|
onRowSelect(table.getState().rowSelection, data.results);
|
|
379
379
|
}, [table.getState().rowSelection]);
|
|
380
|
+
useEffect(() => {
|
|
381
|
+
table.resetPagination();
|
|
382
|
+
}, [sorting, columnFilters, globalFilter, url]);
|
|
380
383
|
return (jsx(TableContext.Provider, { value: {
|
|
381
384
|
table: { ...table },
|
|
382
385
|
refreshData: refreshData,
|
|
@@ -919,9 +922,9 @@ const GlobalFilter = ({ icon = MdSearch }) => {
|
|
|
919
922
|
const { table } = useDataTableContext();
|
|
920
923
|
return (jsx(Fragment, { children: jsx(Box, { children: jsxs(InputGroup, { children: [jsx(InputLeftElement, { pointerEvents: "none", children: jsx(Icon, { as: icon, color: "gray.300" }) }), jsx(Input, { value: table.getState().globalFilter.globalFilter, onChange: (e) => {
|
|
921
924
|
if (!!e.target.value) {
|
|
922
|
-
table.setGlobalFilter(
|
|
925
|
+
table.setGlobalFilter(undefined);
|
|
923
926
|
}
|
|
924
|
-
table.setGlobalFilter(
|
|
927
|
+
table.setGlobalFilter(e.target.value);
|
|
925
928
|
} })] }) }) }));
|
|
926
929
|
};
|
|
927
930
|
|