wca-designsystem 1.0.89 → 1.0.90

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.89",
2
+ "version": "1.0.90",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -301,6 +301,6 @@ TabelaProps.args = {
301
301
  setGlobalFilter: () => console.log('aqui'),
302
302
  setPagination: () => console.log('aqui'),
303
303
  quantidadeDeRegistros: 10,
304
- tamanhoPaginacao: 97,
304
+ tamanhoPaginacao: 12,
305
305
  setSimples: () => console.log('aqui'),
306
306
  }
@@ -28,10 +28,10 @@ const Paginacao = ({
28
28
  quantidadeRegistros,
29
29
  qtdRegistrosPagina,
30
30
  }: PaginacaoProps) => {
31
+
31
32
  function nextPage() {
32
- if (tabelaPaginacao.pageIndex + 1 > tabelaPaginacao.pageSize) {
33
- return;
34
- }
33
+ if (tabelaPaginacao.pageIndex >= tamanhoPaginacao!) return;
34
+
35
35
  setPagination({
36
36
  pageIndex: tabelaPaginacao.pageIndex + 1,
37
37
  pageSize: tabelaPaginacao.pageSize ?? 10,
@@ -39,18 +39,17 @@ const Paginacao = ({
39
39
  }
40
40
 
41
41
  function previousPage() {
42
- if (tabelaPaginacao.pageIndex <= 0) {
43
- return;
44
- }
42
+ if (tabelaPaginacao.pageIndex <= 1) return;
43
+
45
44
  setPagination({
46
45
  pageIndex: tabelaPaginacao.pageIndex - 1,
47
46
  pageSize: tabelaPaginacao.pageSize ?? 10,
48
47
  });
49
48
  }
50
49
 
51
- function changePage(e: number) {
50
+ function changePage(pagina: number) {
52
51
  setPagination({
53
- pageIndex: e,
52
+ pageIndex: pagina,
54
53
  pageSize: tabelaPaginacao.pageSize ?? 10,
55
54
  });
56
55
  }