@producteca/producteca-ui-kit 1.102.2 → 1.103.0

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.
@@ -19,5 +19,6 @@ export * from './link';
19
19
  export * from './draggableList';
20
20
  export * from './dropzone';
21
21
  export * from './stepper';
22
+ export * from './pagination';
22
23
  export * from './table';
23
24
  export * from './permissionOption';
@@ -19,5 +19,6 @@ export * from './link';
19
19
  export * from './draggableList';
20
20
  export * from './dropzone';
21
21
  export * from './stepper';
22
+ export * from './pagination';
22
23
  export * from './table';
23
24
  export * from './permissionOption';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export type ChevronDirection = 'previous' | 'next';
2
+ export interface ChevronButtonProps {
3
+ isHidden: boolean;
4
+ onClick: () => void;
5
+ direction: ChevronDirection;
6
+ }
7
+ export declare const ChevronButton: ({ onClick, isHidden, direction }: ChevronButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Pagination } from './pagination';
2
+ export { Pagination as default } from './pagination';
@@ -0,0 +1,3 @@
1
+ export { Pagination } from './pagination';
2
+ export type { PaginationProps } from './pagination.types';
3
+ export { Pagination as default } from './pagination';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { PaginationProps } from './pagination.types';
2
+
3
+ export declare const Pagination: ({ page, pageSize, className, totalItems, onPageChange, onPageSizeChange, itemsLabel, pageSizeOptions, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default Pagination;
@@ -0,0 +1,5 @@
1
+ import { PaginationProps } from './pagination.types';
2
+
3
+ export declare const productsTotal = 690;
4
+ export declare const pageSizeOptions: number[];
5
+ export declare const InteractivePagination: ({ page: initialPage, pageSize: initialPageSize, onPageChange, onPageSizeChange, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
4
+ page: number;
5
+ pageSize: number;
6
+ totalItems: number;
7
+ onPageChange: (page: number) => void;
8
+ onPageSizeChange?: (pageSize: number) => void;
9
+ pageSizeOptions?: number[];
10
+ itemsLabel?: string;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export type PageItem = number | 'start-ellipsis' | 'end-ellipsis';
2
+ export type PageRange = {
3
+ from: number;
4
+ to: number;
5
+ };
6
+ export declare const FIRST_PAGE = 1;
7
+ export declare const getTotalPages: (totalItems: number, pageSize: number) => number;
8
+ export declare const getPageRange: (page: number, pageSize: number, totalItems: number) => PageRange;
9
+ export declare const getPageItems: (page: number, totalPages: number) => PageItem[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { default as React } from 'react';
2
+ import { SelectOption } from '../inputs/selectField/selectField.types';
3
+ import { PageItem, PageRange } from './pagination.utils';
4
+
5
+ interface UsePaginationParams {
6
+ page: number;
7
+ pageSize: number;
8
+ totalItems: number;
9
+ pageSizeOptions: number[];
10
+ onPageChange: (page: number) => void;
11
+ onPageSizeChange?: (pageSize: number) => void;
12
+ }
13
+ type UsePaginationResult = {
14
+ currentPage: number;
15
+ pageItems: PageItem[];
16
+ range: PageRange;
17
+ hasPrevious: boolean;
18
+ hasNext: boolean;
19
+ sizeOptions: SelectOption[];
20
+ selectedSize: number[];
21
+ goToPage: (page: number) => void;
22
+ goToPrevious: () => void;
23
+ goToNext: () => void;
24
+ handlePageSizeChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
25
+ };
26
+ export declare const usePagination: ({ page, pageSize, totalItems, pageSizeOptions, onPageChange, onPageSizeChange, }: UsePaginationParams) => UsePaginationResult;
27
+ export {};
@@ -57,6 +57,17 @@ declare const _default: {
57
57
  };
58
58
  noFoundOptions: string;
59
59
  noResultsFound: string;
60
+ pagination: {
61
+ ariaLabel: string;
62
+ ellipsis: string;
63
+ goToPage: string;
64
+ items: string;
65
+ nextPage: string;
66
+ ofTotal: string;
67
+ pageSize: string;
68
+ previousPage: string;
69
+ range: string;
70
+ };
60
71
  permissionSelector: {
61
72
  ariaLabel: string;
62
73
  };
@@ -679,5 +679,27 @@ declare const _default: {
679
679
  steps: string;
680
680
  activeStep: string;
681
681
  };
682
+ pagination: {
683
+ ariaLabel: string;
684
+ previousPage: string;
685
+ nextPage: string;
686
+ goToPage: string;
687
+ ellipsis: string;
688
+ range: string;
689
+ ofTotal: string;
690
+ items: string;
691
+ pageSize: string;
692
+ products: string;
693
+ component: string;
694
+ props: {
695
+ page: string;
696
+ pageSize: string;
697
+ totalItems: string;
698
+ onPageChange: string;
699
+ onPageSizeChange: string;
700
+ pageSizeOptions: string;
701
+ itemsLabel: string;
702
+ };
703
+ };
682
704
  };
683
705
  export default _default;
@@ -57,6 +57,17 @@ declare const _default: {
57
57
  };
58
58
  noFoundOptions: string;
59
59
  noResultsFound: string;
60
+ pagination: {
61
+ ariaLabel: string;
62
+ ellipsis: string;
63
+ goToPage: string;
64
+ items: string;
65
+ nextPage: string;
66
+ ofTotal: string;
67
+ pageSize: string;
68
+ previousPage: string;
69
+ range: string;
70
+ };
60
71
  permissionSelector: {
61
72
  ariaLabel: string;
62
73
  };
@@ -35,5 +35,6 @@ export declare const DemoMenuAction: DemoComponent;
35
35
  export declare const DemoTable: DemoComponent;
36
36
  export declare const DemoPermissionSelector: DemoComponent;
37
37
  export declare const DemoDropzone: DemoComponent;
38
+ export declare const DemoPagination: DemoComponent;
38
39
  export declare const ComponentDemos: Record<string, DemoComponent>;
39
40
  export {};