@producteca/producteca-ui-kit 1.102.2 → 1.104.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';
@@ -8,10 +8,11 @@ export declare const SingleValue: (props: SingleValueProps<SelectOption> & {
8
8
  getOptionLabel?: (option: SelectOption) => string;
9
9
  }) => import("react/jsx-runtime").JSX.Element;
10
10
  export declare const SearchComponent: () => import("react/jsx-runtime").JSX.Element;
11
- export declare const ClearComponent: ({ optionSelected, isClearable, handleChange, }: {
11
+ export declare const ClearComponent: ({ optionSelected, isClearable, handleChange, disabled, }: {
12
12
  optionSelected?: SelectOptionType | undefined;
13
13
  isClearable: boolean;
14
14
  handleChange: (selected: SelectOptionType) => void;
15
+ disabled?: boolean;
15
16
  }) => import("react/jsx-runtime").JSX.Element | null;
16
17
  export declare const SelectField: React.FC<SelectFieldProps>;
17
18
  export default SelectField;
@@ -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
  };
@@ -84,6 +84,7 @@ declare const _default: {
84
84
  example: string;
85
85
  defaultValue: string;
86
86
  disabled: string;
87
+ disabledMultiple: string;
87
88
  disabledOptions: string;
88
89
  noOptions: string;
89
90
  withIcon: string;
@@ -679,5 +680,27 @@ declare const _default: {
679
680
  steps: string;
680
681
  activeStep: string;
681
682
  };
683
+ pagination: {
684
+ ariaLabel: string;
685
+ previousPage: string;
686
+ nextPage: string;
687
+ goToPage: string;
688
+ ellipsis: string;
689
+ range: string;
690
+ ofTotal: string;
691
+ items: string;
692
+ pageSize: string;
693
+ products: string;
694
+ component: string;
695
+ props: {
696
+ page: string;
697
+ pageSize: string;
698
+ totalItems: string;
699
+ onPageChange: string;
700
+ onPageSizeChange: string;
701
+ pageSizeOptions: string;
702
+ itemsLabel: string;
703
+ };
704
+ };
682
705
  };
683
706
  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 {};