trithuc-mvc-react 3.1.8 → 3.1.9

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.
@@ -350,7 +350,7 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
350
350
  </Grid>
351
351
  )}
352
352
 
353
- <Grid>
353
+ <Grid size={12}>
354
354
  <TablePaginationCustom
355
355
  count={total}
356
356
  rowsPerPage={rowsPerPage}
@@ -79,12 +79,13 @@ export const TableRowRenderSM = ({
79
79
  )}
80
80
 
81
81
  {/* Các nút thao tác */}
82
- <Grid container spacing={2} sx={{ width: "100%", pt: 2, pb: 2 }}>
83
- <Grid size={{ xs: 12 }} sx={{ display: "flex", justifyContent: "flex-end", flexWrap: "wrap" }}>
84
- {!disableCellThaoTac && (
85
- <>
86
- {!disableEdit && canEdit && (
82
+ <Grid container spacing={0.5} sx={{ width: "100%", pt: 2, pb: 2 }}>
83
+ {!disableCellThaoTac && (
84
+ <>
85
+ {!disableEdit && canEdit && (
86
+ <Grid size={4}>
87
87
  <Button
88
+ fullWidth
88
89
  size="small"
89
90
  variant="outlined"
90
91
  color="primary"
@@ -94,9 +95,12 @@ export const TableRowRenderSM = ({
94
95
  >
95
96
  Sửa
96
97
  </Button>
97
- )}
98
- {canView && !tableActions?.some(({ permissionType }) => permissionType === "view") && (
98
+ </Grid>
99
+ )}
100
+ {canView && !tableActions?.some(({ permissionType }) => permissionType === "view") && (
101
+ <Grid size={4}>
99
102
  <Button
103
+ fullWidth
100
104
  size="small"
101
105
  variant="outlined"
102
106
  color="info"
@@ -106,9 +110,12 @@ export const TableRowRenderSM = ({
106
110
  >
107
111
  Xem
108
112
  </Button>
109
- )}
110
- {!disableDelete && canDelete && (
113
+ </Grid>
114
+ )}
115
+ {!disableDelete && canDelete && (
116
+ <Grid size={4}>
111
117
  <Button
118
+ fullWidth
112
119
  size="small"
113
120
  variant="outlined"
114
121
  color="error"
@@ -118,11 +125,14 @@ export const TableRowRenderSM = ({
118
125
  >
119
126
  Xóa
120
127
  </Button>
121
- )}
122
- {tableActionsOnTable.map(
123
- ({ title, onClick, element, visible = true }, idx) =>
124
- (typeof visible === "function" ? visible(row) : visible) && (
128
+ </Grid>
129
+ )}
130
+ {tableActionsOnTable.map(
131
+ ({ title, size, onClick, element, visible = true }, idx) =>
132
+ (typeof visible === "function" ? visible(row) : visible) && (
133
+ <Grid size={4}>
125
134
  <Button
135
+ fullWidth
126
136
  key={idx}
127
137
  size="small"
128
138
  variant="outlined"
@@ -134,12 +144,12 @@ export const TableRowRenderSM = ({
134
144
  >
135
145
  {title === "xem chi tiết" ? "Xem" : title}
136
146
  </Button>
137
- )
138
- )}
139
- <MoreMenu actions={tableActionsOnMoreMenu} data={row} />
140
- </>
141
- )}
142
- </Grid>
147
+ </Grid>
148
+ )
149
+ )}
150
+ <MoreMenu actions={tableActionsOnMoreMenu} data={row} />
151
+ </>
152
+ )}
143
153
  </Grid>
144
154
  </TableCell>
145
155
  </TableRow>
@@ -148,13 +158,13 @@ export const TableRowRenderSM = ({
148
158
 
149
159
  // Button style dùng chung
150
160
  const buttonStyle = {
151
- marginLeft: 0.3,
152
- marginRight: 0.3,
153
- marginBottom: 0.5,
154
- borderRadius: 14,
161
+ // marginLeft: 0.3,
162
+ // marginRight: 0.3,
163
+ marginBottom: "10px",
164
+ borderRadius: "10px",
155
165
  minWidth: 50,
156
- padding: "2px 8px",
157
- height: "20px",
166
+ padding: "4px 8px",
167
+ height: "23px",
158
168
  fontSize: "0.6rem",
159
169
  whiteSpace: "nowrap",
160
170
  overflow: "hidden",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "3.1.8",
3
+ "version": "3.1.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"