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.
|
@@ -79,12 +79,13 @@ export const TableRowRenderSM = ({
|
|
|
79
79
|
)}
|
|
80
80
|
|
|
81
81
|
{/* Các nút thao tác */}
|
|
82
|
-
<Grid container spacing={
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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:
|
|
154
|
-
borderRadius:
|
|
161
|
+
// marginLeft: 0.3,
|
|
162
|
+
// marginRight: 0.3,
|
|
163
|
+
marginBottom: "10px",
|
|
164
|
+
borderRadius: "10px",
|
|
155
165
|
minWidth: 50,
|
|
156
|
-
padding: "
|
|
157
|
-
height: "
|
|
166
|
+
padding: "4px 8px",
|
|
167
|
+
height: "23px",
|
|
158
168
|
fontSize: "0.6rem",
|
|
159
169
|
whiteSpace: "nowrap",
|
|
160
170
|
overflow: "hidden",
|