@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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Rolster Technology
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Rolster Technology
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1865,12 +1865,17 @@ function PageButton({ page, onSelect }) {
1865
1865
  }, [page, onSelect]);
1866
1866
  return (jsxRuntimeExports.jsx("button", { type: "button", className: className, onClick: onClick, children: page.label }));
1867
1867
  }
1868
- function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
1868
+ function RlsPaginationComponent({ suggestions, count, filter, onPagination, position }) {
1869
1869
  const [template, setTemplate] = require$$0.useState();
1870
1870
  const controller = require$$0.useRef(undefined);
1871
1871
  const refreshTemplate = require$$0.useCallback((template, suggestions) => {
1872
- const { firstPage, lastPage } = template;
1873
- onPagination?.({ firstPage, lastPage, suggestions });
1872
+ const { currentPage, firstPage, lastPage } = template;
1873
+ onPagination?.({
1874
+ currentPage: currentPage.value,
1875
+ firstPage,
1876
+ lastPage,
1877
+ suggestions
1878
+ });
1874
1879
  setTemplate(template);
1875
1880
  }, [onPagination]);
1876
1881
  const refreshPagination = require$$0.useCallback((pagination) => {
@@ -1882,7 +1887,7 @@ function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
1882
1887
  const pagination = new components.PaginationController({
1883
1888
  suggestions,
1884
1889
  count,
1885
- position: template?.currentPage.value
1890
+ position: template?.currentPage.value ?? position
1886
1891
  });
1887
1892
  controller.current = pagination;
1888
1893
  refreshTemplate(pagination.template, pagination.page.collection);