tycho-components 0.0.17-SNAPSHOT-4 → 0.0.17-SNAPSHOT-5
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Select, MenuItem } from '@mui/material';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
4
|
import { IconButton } from 'tycho-storybook';
|
|
5
5
|
import './styles.scss';
|
|
@@ -15,9 +15,16 @@ export default function AppPagination({ totalElements, pagination, setPagination
|
|
|
15
15
|
const setPageIndex = (p) => {
|
|
16
16
|
setPagination({ ...pagination, pageIndex: p });
|
|
17
17
|
};
|
|
18
|
-
return (_jsxs("div", { className: "app-table-pagination", children: [!hideItensPage && (_jsxs("div", { className: "itens-page", children: [_jsx("span", { children: t('table.label.rows-page') }), _jsx(Select, { value: pagination.pageSize, onChange: (e) => setPageSize(e.target.value), children: [10, 25, 50].map((size) => (_jsx(MenuItem, { value: size, children: size }, size))) })] })), _jsx("div", { className: "itens-total", children: _jsx("span", { children: _jsx(Trans, { t: t, i18nKey: "table.label.items", values: {
|
|
18
|
+
return (_jsxs("div", { className: "app-table-pagination", children: [!hideItensPage && (_jsxs("div", { className: "itens-page", children: [_jsx("span", { children: t('table.label.rows-page') }), _jsx(Select, { value: pagination.pageSize, onChange: (e) => setPageSize(e.target.value), MenuProps: menuProps, children: [10, 25, 50].map((size) => (_jsx(MenuItem, { value: size, children: size }, size))) })] })), _jsx("div", { className: "itens-total", children: _jsx("span", { children: _jsx(Trans, { t: t, i18nKey: "table.label.items", values: {
|
|
19
19
|
first: getFirstElementNumber(),
|
|
20
20
|
last: getLastElementNumber(),
|
|
21
21
|
total: totalElements,
|
|
22
|
-
} }) }) }), _jsxs("div", { className: "pages-total", children: [_jsx(Select, { value: currentPage, onChange: (e) => setPageIndex(e.target.value - 1), children: Array.from({ length: numPages }, (_, index) => (_jsx(MenuItem, { value: index + 1, children: index + 1 }, index + 1))) }), _jsx("span", { children: _jsx(Trans, { t: t, i18nKey: "table.label.pages", values: { value: numPages } }) })] }), _jsxs("div", { className: "pages-navigation", children: [_jsx(IconButton, { size: "medium", mode: "tonal", onClick: () => setPageIndex(pagination.pageIndex - 1), disabled: pagination.pageIndex === 0, name: "chevron_backward" }), _jsx(IconButton, { size: "medium", mode: "tonal", onClick: () => setPageIndex(pagination.pageIndex + 1), disabled: pagination.pageIndex >= numPages - 1, name: "chevron_forward" })] })] }));
|
|
22
|
+
} }) }) }), _jsxs("div", { className: "pages-total", children: [_jsx(Select, { value: currentPage, onChange: (e) => setPageIndex(e.target.value - 1), MenuProps: menuProps, children: Array.from({ length: numPages }, (_, index) => (_jsx(MenuItem, { value: index + 1, children: index + 1 }, index + 1))) }), _jsx("span", { children: _jsx(Trans, { t: t, i18nKey: "table.label.pages", values: { value: numPages } }) })] }), _jsxs("div", { className: "pages-navigation", children: [_jsx(IconButton, { size: "medium", mode: "tonal", onClick: () => setPageIndex(pagination.pageIndex - 1), disabled: pagination.pageIndex === 0, name: "chevron_backward" }), _jsx(IconButton, { size: "medium", mode: "tonal", onClick: () => setPageIndex(pagination.pageIndex + 1), disabled: pagination.pageIndex >= numPages - 1, name: "chevron_forward" })] })] }));
|
|
23
23
|
}
|
|
24
|
+
const menuProps = {
|
|
25
|
+
PaperProps: {
|
|
26
|
+
style: {
|
|
27
|
+
maxHeight: 400,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.17-SNAPSHOT-
|
|
4
|
+
"version": "0.0.17-SNAPSHOT-5",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-hook-form": "^7.45.2",
|
|
50
50
|
"react-i18next": "^13.0.2",
|
|
51
51
|
"react-router-dom": "^6.14.2",
|
|
52
|
-
"tycho-storybook": "0.1.7-
|
|
52
|
+
"tycho-storybook": "0.1.7-r3",
|
|
53
53
|
"yup": "^1.2.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|