fui-material 2.8.23 → 2.8.24

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.
@@ -10317,6 +10317,29 @@ function useFManualPagination(options) {
10317
10317
  const nextPage = ((pageMeta == null ? void 0 : pageMeta.number) ?? page) + 1;
10318
10318
  return changePage(nextPage);
10319
10319
  }, [query.isFetching, isFetchingMore, hasMore, pageMeta, page, changePage]);
10320
+ const refetch = useCallback(async (refetchOptions) => {
10321
+ const shouldReset = (refetchOptions == null ? void 0 : refetchOptions.resetPage) ?? isInfinite;
10322
+ const targetPage = shouldReset ? 1 : page;
10323
+ const targetSize = pageSize || defaultPageSize || 20;
10324
+ if (shouldReset) {
10325
+ setPage(1);
10326
+ if (isInfinite) {
10327
+ setAccumulatedData(void 0);
10328
+ }
10329
+ }
10330
+ const rawResponse = await query.run({
10331
+ newParams: { page: targetPage, size: targetSize },
10332
+ newUrlParams: { page: targetPage, size: targetSize },
10333
+ mergeParams: true,
10334
+ preserveParams: true,
10335
+ preserveUrlParams: true
10336
+ });
10337
+ const extracted = extractResult(rawResponse);
10338
+ if (isInfinite) {
10339
+ setAccumulatedData(extracted);
10340
+ }
10341
+ return extracted;
10342
+ }, [isInfinite, page, pageSize, defaultPageSize, query, extractResult]);
10320
10343
  const paginationProps = useMemo(() => ({
10321
10344
  currentPage: (pageMeta == null ? void 0 : pageMeta.number) ?? page,
10322
10345
  totalCount: (pageMeta == null ? void 0 : pageMeta.totalItems) ?? 0,
@@ -10351,6 +10374,7 @@ function useFManualPagination(options) {
10351
10374
  submitFilters,
10352
10375
  changePage,
10353
10376
  loadMore,
10377
+ refetch,
10354
10378
  paginationProps
10355
10379
  };
10356
10380
  }