armtek-uikit-react 1.0.131 → 1.0.132
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 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.132","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
|
@@ -2,14 +2,14 @@ import { StackProps } from '../../ui/Stack';
|
|
|
2
2
|
type OwnProps = {
|
|
3
3
|
page: number;
|
|
4
4
|
total: number;
|
|
5
|
-
|
|
5
|
+
pageSize: number;
|
|
6
6
|
onChange: (page: number) => void;
|
|
7
7
|
};
|
|
8
8
|
export type PaginationProps = OwnProps & Omit<Partial<PaginationPerPageProps>, keyof OwnProps> & Omit<StackProps, keyof OwnProps>;
|
|
9
9
|
export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
10
|
type PaginationPerPageProps = {
|
|
11
|
-
|
|
11
|
+
pageSizes: number[];
|
|
12
12
|
perPageListLabel?: string;
|
|
13
|
-
|
|
13
|
+
onPageSizeSelect: (value: number) => void;
|
|
14
14
|
};
|
|
15
15
|
export default Pagination;
|
|
@@ -13,12 +13,12 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
13
13
|
const MAX_DISPLAY = 5;
|
|
14
14
|
export const Pagination = props => {
|
|
15
15
|
const {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
pageSize,
|
|
17
|
+
pageSizes,
|
|
18
18
|
perPageListLabel,
|
|
19
19
|
total,
|
|
20
20
|
page,
|
|
21
|
-
|
|
21
|
+
onPageSizeSelect,
|
|
22
22
|
onChange,
|
|
23
23
|
...stackProps
|
|
24
24
|
} = props;
|
|
@@ -39,10 +39,10 @@ export const Pagination = props => {
|
|
|
39
39
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
40
40
|
children: /*#__PURE__*/_jsxs(Stack, {
|
|
41
41
|
spacing: 'small',
|
|
42
|
-
children: [
|
|
42
|
+
children: [pageSizes && onPageSizeSelect && /*#__PURE__*/_jsx(PaginationPerPage, {
|
|
43
43
|
...props,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
pageSizes: pageSizes,
|
|
45
|
+
onPageSizeSelect: onPageSizeSelect
|
|
46
46
|
}), /*#__PURE__*/_jsxs(Stack, {
|
|
47
47
|
center: true,
|
|
48
48
|
...stackProps,
|
|
@@ -107,16 +107,16 @@ export const Pagination = props => {
|
|
|
107
107
|
};
|
|
108
108
|
const PaginationPerPage = props => {
|
|
109
109
|
const {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
pageSize,
|
|
111
|
+
pageSizes,
|
|
112
112
|
perPageListLabel,
|
|
113
|
-
|
|
113
|
+
onPageSizeSelect
|
|
114
114
|
} = props;
|
|
115
115
|
const [visible, setVisible] = useState(false);
|
|
116
116
|
const btnRef = useRef(null);
|
|
117
117
|
const handleClose = () => setVisible(false);
|
|
118
118
|
const handleClick = item => {
|
|
119
|
-
|
|
119
|
+
onPageSizeSelect(item);
|
|
120
120
|
handleClose();
|
|
121
121
|
};
|
|
122
122
|
return /*#__PURE__*/_jsxs(Stack, {
|
|
@@ -135,7 +135,7 @@ const PaginationPerPage = props => {
|
|
|
135
135
|
}),
|
|
136
136
|
size: 'small',
|
|
137
137
|
color: 'neutral',
|
|
138
|
-
children:
|
|
138
|
+
children: pageSize
|
|
139
139
|
}), /*#__PURE__*/_jsx(Popover, {
|
|
140
140
|
placement: 'bottom',
|
|
141
141
|
open: visible,
|
|
@@ -144,9 +144,9 @@ const PaginationPerPage = props => {
|
|
|
144
144
|
classes: {
|
|
145
145
|
paper: 'p-0'
|
|
146
146
|
},
|
|
147
|
-
children:
|
|
147
|
+
children: pageSizes.map(item => /*#__PURE__*/_jsx(ListItem, {
|
|
148
148
|
onClick: () => handleClick(item),
|
|
149
|
-
active: item ===
|
|
149
|
+
active: item === pageSize,
|
|
150
150
|
children: item
|
|
151
151
|
}, item))
|
|
152
152
|
})]
|