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].filter(({ permissionType }) => {
20
- return !(permissionType == "action" && !canAction);
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
- count: PropTypes.number,
6
- rowsPerPage: PropTypes.number,
7
- page: PropTypes.number,
8
- onPageChange: PropTypes.func,
9
- onRowsPerPageChange: PropTypes.func
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
- const theme = useTheme();
14
- const matchsDownMD = useMediaQuery(theme.breakpoints.down("md"));
15
- return (
16
- <TablePagination
17
- {...rest}
18
- rowsPerPageOptions={[5, 10, 25, 100]}
19
- component="div"
20
- count={count}
21
- rowsPerPage={rowsPerPage}
22
- page={page}
23
- onPageChange={onPageChange}
24
- onRowsPerPageChange={onRowsPerPageChange}
25
- showFirstButton={true}
26
- showLastButton={true}
27
- labelRowsPerPage={matchsDownMD ? "Số hàng" : "Số bản ghi trên trang:"}
28
- labelDisplayedRows={function defaultLabelDisplayedRows({ from, to, count }) {
29
- return `${from}–${to} của ${count !== -1 ? count : `more than ${to}`}`;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"