diff --git a/.size-snapshot.json b/.size-snapshot.json index 403285a..7a70703 100644 --- a/.size-snapshot.json +++ b/.size-snapshot.json @@ -19,21 +19,21 @@ } }, "dist\\index.js": { - "bundled": 104977, - "minified": 48560, - "gzipped": 13057 + "bundled": 113237, + "minified": 52528, + "gzipped": 13837 }, "dist\\index.es.js": { - "bundled": 104090, - "minified": 47770, - "gzipped": 12900, + "bundled": 112300, + "minified": 51692, + "gzipped": 13671, "treeshaked": { "rollup": { "code": 80, "import_statements": 21 }, "webpack": { - "code": 8227 + "code": 8461 } } } diff --git a/docs/api/usePagination.md b/docs/api/usePagination.md index 58c4230..6e5ad6b 100644 --- a/docs/api/usePagination.md +++ b/docs/api/usePagination.md @@ -30,6 +30,7 @@ The following options are supported via the main options object passed to `useTa - When `true`, the `pageIndex` state will automatically reset if `manualPagination` is `false` and any of the following conditions are met: - `data` is changed - `manualSortBy` is `false` and `state.sortBy` is changed + - `manualGlobalFilter` is `false` and `state.globalFilter` is changed - `manualFilters` is `false` and `state.filters` is changed - `manualGroupBy` is `false` and `state.groupBy` is changed - To disable, set to `false` diff --git a/src/plugin-hooks/usePagination.js b/src/plugin-hooks/usePagination.js index d40a58a..b08aca6 100755 --- a/src/plugin-hooks/usePagination.js +++ b/src/plugin-hooks/usePagination.js @@ -76,10 +76,11 @@ function useInstance(instance) { pageCount: userPageCount, paginateExpandedRows = true, expandSubRows = true, - state: { pageSize, pageIndex, expanded, filters, groupBy, sortBy }, + state: { pageSize, pageIndex, expanded, globalFilter, filters, groupBy, sortBy }, dispatch, data, manualPagination, + manualGlobalFilter, manualFilters, manualGroupBy, manualSortBy, @@ -87,7 +88,7 @@ function useInstance(instance) { ensurePluginOrder( plugins, - ['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'], + ['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'], 'usePagination', [] ) @@ -101,6 +102,7 @@ function useInstance(instance) { }, [ dispatch, manualPagination ? null : data, + manualPagination || manualGlobalFilter ? null : globalFilter, manualPagination || manualFilters ? null : filters, manualPagination || manualGroupBy ? null : groupBy, manualPagination || manualSortBy ? null : sortBy,