trithuc-mvc-react 1.8.6 → 1.8.7
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.
|
@@ -16,9 +16,11 @@ const TableToolbar = ({ selected, multipleActions = [], numSelected, onSelectAll
|
|
|
16
16
|
const downXl = useMediaQuery(theme.breakpoints.down("xl"));
|
|
17
17
|
|
|
18
18
|
const actions = useMemo(() => {
|
|
19
|
-
const actions = [...multipleActions]
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const actions = [...multipleActions]
|
|
20
|
+
.filter((element) => !!element)
|
|
21
|
+
.filter(({ permissionType }) => {
|
|
22
|
+
return !(permissionType == "action" && !canAction);
|
|
23
|
+
});
|
|
22
24
|
|
|
23
25
|
return actions;
|
|
24
26
|
}, [canAction, multipleActions]);
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { TablePagination, useMediaQuery, useTheme } from "@mui/material";
|
|
1
|
+
import { Grid, TablePagination, Typography, useMediaQuery, useTheme } from "@mui/material";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
|
|
4
4
|
TablePaginationCustom.propsType = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
count: PropTypes.number,
|
|
6
|
+
rowsPerPage: PropTypes.number,
|
|
7
|
+
page: PropTypes.number,
|
|
8
|
+
onPageChange: PropTypes.func,
|
|
9
|
+
onRowsPerPageChange: PropTypes.func
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
function TablePaginationCustom({ count, rowsPerPage, page, onPageChange, onRowsPerPageChange, ...rest }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const matchsDownMD = useMediaQuery(theme.breakpoints.down("md"));
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<Grid container>
|
|
18
|
+
<Grid item alignSelf={"center"} sx={{ pl: 2}}>
|
|
19
|
+
<Typography variant="body1">
|
|
20
|
+
Tổng số lượng: <span>{count}</span>
|
|
21
|
+
</Typography>
|
|
22
|
+
</Grid>
|
|
23
|
+
<Grid item xs>
|
|
24
|
+
<TablePagination
|
|
25
|
+
{...rest}
|
|
26
|
+
rowsPerPageOptions={[5, 10, 25, 100]}
|
|
27
|
+
component="div"
|
|
28
|
+
count={count}
|
|
29
|
+
rowsPerPage={rowsPerPage}
|
|
30
|
+
page={page}
|
|
31
|
+
onPageChange={onPageChange}
|
|
32
|
+
onRowsPerPageChange={onRowsPerPageChange}
|
|
33
|
+
showFirstButton={true}
|
|
34
|
+
showLastButton={true}
|
|
35
|
+
labelRowsPerPage={matchsDownMD ? "Số hàng" : "Số bản ghi trên trang:"}
|
|
36
|
+
labelDisplayedRows={function defaultLabelDisplayedRows({ from, to, count }) {
|
|
37
|
+
return `${from}–${to} của ${count !== -1 ? count : `more than ${to}`}`;
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
</Grid>
|
|
41
|
+
</Grid>
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
33
44
|
}
|
|
34
45
|
export default TablePaginationCustom;
|