trithuc-mvc-react 3.2.0 → 3.2.2
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.
|
@@ -54,10 +54,9 @@ export const FilterGod = ({ tableName, filters, filterButtons, elementSize = "sm
|
|
|
54
54
|
|
|
55
55
|
<AccordionDetails>
|
|
56
56
|
<Grid container spacing={1}>
|
|
57
|
-
{filters.map(({ field, size, ...rest }) => {
|
|
57
|
+
{filters.map(({ field, label, size, ...rest }) => {
|
|
58
58
|
if (rest.type === "date-range") {
|
|
59
|
-
const [label1, label2] = Array.isArray(
|
|
60
|
-
|
|
59
|
+
const [label1, label2] = Array.isArray(label) ? label : ["Từ ngày", "Đến ngày"];
|
|
61
60
|
const handleClear = (key) => {
|
|
62
61
|
setDataSearch((prev) => ({
|
|
63
62
|
...prev,
|
|
@@ -8,37 +8,77 @@ function defaultLabelDisplayedRows({ from, to, count }) {
|
|
|
8
8
|
function TablePaginationCustom({ count, rowsPerPage, page, onPageChange, onRowsPerPageChange, ...rest }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const matchsDownMD = useMediaQuery(theme.breakpoints.down("md"));
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
11
|
+
const isSmallScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
12
|
+
return !isSmallScreen ? (
|
|
13
|
+
<TablePagination
|
|
14
|
+
{...rest}
|
|
15
|
+
rowsPerPageOptions={[5, 10, 20, 25, 50, 100]}
|
|
16
|
+
component="div"
|
|
17
|
+
count={count}
|
|
18
|
+
rowsPerPage={rowsPerPage}
|
|
19
|
+
page={page}
|
|
20
|
+
onPageChange={onPageChange}
|
|
21
|
+
onRowsPerPageChange={onRowsPerPageChange}
|
|
22
|
+
showFirstButton
|
|
23
|
+
showLastButton
|
|
24
|
+
labelRowsPerPage={matchsDownMD ? "Số hàng" : "Số bản ghi trên trang:"}
|
|
25
|
+
labelDisplayedRows={defaultLabelDisplayedRows}
|
|
26
|
+
sx={{
|
|
27
|
+
width: "100%",
|
|
28
|
+
"& .MuiTablePagination-toolbar": {
|
|
29
|
+
justifyContent: "flex-end",
|
|
30
|
+
flexWrap: "wrap", // Cho nó xuống dòng nếu thiếu chỗ
|
|
31
|
+
paddingLeft: "8px",
|
|
32
|
+
paddingRight: "8px"
|
|
33
|
+
},
|
|
34
|
+
"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows": {
|
|
35
|
+
fontSize: "0.7rem"
|
|
36
|
+
},
|
|
37
|
+
"& .MuiTablePagination-select": {
|
|
38
|
+
minWidth: "60px"
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
) : (
|
|
43
|
+
<TablePagination
|
|
44
|
+
{...rest}
|
|
45
|
+
rowsPerPageOptions={[5, 10, 20, 25, 50, 100]}
|
|
46
|
+
component="div"
|
|
47
|
+
count={count}
|
|
48
|
+
rowsPerPage={rowsPerPage}
|
|
49
|
+
page={page}
|
|
50
|
+
onPageChange={onPageChange}
|
|
51
|
+
onRowsPerPageChange={onRowsPerPageChange}
|
|
52
|
+
showFirstButton
|
|
53
|
+
showLastButton
|
|
54
|
+
labelRowsPerPage={matchsDownMD ? "Số hàng" : "Số bản ghi trên trang:"}
|
|
55
|
+
labelDisplayedRows={defaultLabelDisplayedRows}
|
|
56
|
+
sx={{
|
|
57
|
+
width: "100%",
|
|
58
|
+
overflowX: "auto",
|
|
59
|
+
"& .MuiTablePagination-toolbar": {
|
|
60
|
+
display: "flex",
|
|
61
|
+
flexWrap: "wrap", // Cho xuống dòng nếu không đủ chỗ
|
|
62
|
+
justifyContent: "space-between",
|
|
63
|
+
paddingLeft: "4px",
|
|
64
|
+
paddingRight: "4px",
|
|
65
|
+
gap: "2px", // Giảm khoảng cách
|
|
66
|
+
minHeight: "auto"
|
|
67
|
+
},
|
|
68
|
+
"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows": {
|
|
69
|
+
fontSize: "0.53rem"
|
|
70
|
+
},
|
|
71
|
+
"& .MuiTablePagination-select": {
|
|
72
|
+
fontSize: "0.53rem",
|
|
73
|
+
minWidth: "45px"
|
|
74
|
+
},
|
|
75
|
+
"& .MuiTablePagination-actions > button": {
|
|
76
|
+
fontSize: "0.53rem",
|
|
77
|
+
minWidth: "20px",
|
|
78
|
+
padding: "2px"
|
|
79
|
+
}
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
42
82
|
);
|
|
43
83
|
}
|
|
44
84
|
|