@rolster/react-components 19.7.11 → 19.7.12

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/es/index.mjs CHANGED
@@ -1863,12 +1863,17 @@ function PageButton({ page, onSelect }) {
1863
1863
  }, [page, onSelect]);
1864
1864
  return (jsxRuntimeExports.jsx("button", { type: "button", className: className, onClick: onClick, children: page.label }));
1865
1865
  }
1866
- function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
1866
+ function RlsPaginationComponent({ suggestions, count, filter, onPagination, position }) {
1867
1867
  const [template, setTemplate] = useState();
1868
1868
  const controller = useRef(undefined);
1869
1869
  const refreshTemplate = useCallback((template, suggestions) => {
1870
- const { firstPage, lastPage } = template;
1871
- onPagination?.({ firstPage, lastPage, suggestions });
1870
+ const { currentPage, firstPage, lastPage } = template;
1871
+ onPagination?.({
1872
+ currentPage: currentPage.value,
1873
+ firstPage,
1874
+ lastPage,
1875
+ suggestions
1876
+ });
1872
1877
  setTemplate(template);
1873
1878
  }, [onPagination]);
1874
1879
  const refreshPagination = useCallback((pagination) => {
@@ -1880,7 +1885,7 @@ function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
1880
1885
  const pagination = new PaginationController({
1881
1886
  suggestions,
1882
1887
  count,
1883
- position: template?.currentPage.value
1888
+ position: template?.currentPage.value ?? position
1884
1889
  });
1885
1890
  controller.current = pagination;
1886
1891
  refreshTemplate(pagination.template, pagination.page.collection);