trithuc-mvc-react 1.6.3 → 1.6.4

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.
@@ -2,7 +2,7 @@ import { Checkbox, TableRow, TableCell, TableHead as MuiTableHead, useTheme, use
2
2
  import { useDataTable, usePermission } from "./hooks";
3
3
  export function TableHead({ numSelected, rowCount, onSelectAllClick, headLabel }) {
4
4
  const { canEdit } = usePermission();
5
- const { disableStatus } = useDataTable();
5
+ const { disableStatus,disableCellThaoTac } = useDataTable();
6
6
  const theme = useTheme();
7
7
  const downXl = useMediaQuery(theme.breakpoints.down("xl"));
8
8
  return (
@@ -23,7 +23,7 @@ export function TableHead({ numSelected, rowCount, onSelectAllClick, headLabel }
23
23
  </TableCell>
24
24
  ))}
25
25
  {!disableStatus && canEdit && <TableCell sx={{ textAlign: "center" }}>Kích hoạt</TableCell>}
26
- <TableCell sx={{ minWidth: "136px", textAlign: "center" }}>Thao tác</TableCell>
26
+ {!disableCellThaoTac && <TableCell sx={{ minWidth: "136px", textAlign: "center" }}>Thao tác</TableCell>}
27
27
  </TableRow>
28
28
  </MuiTableHead>
29
29
  );
@@ -9,7 +9,7 @@ import MoreMenu from "../MoreMenu";
9
9
  import { useMemo } from "react";
10
10
 
11
11
  export const TableRowRender = ({ index, row, selected, onSelect, onChangeStatus, onDelete, onEdit }) => {
12
- const { selectedField, columns, statusKey, disableStatus, tableActions } = useDataTable();
12
+ const { selectedField, columns, statusKey, disableStatus, tableActions,disableCellThaoTac } = useDataTable();
13
13
  const { canEdit, canDelete, canView, canAction } = usePermission();
14
14
 
15
15
  const { tableActionsOnTable, tableActionsOnMoreMenu } = useMemo(() => {
@@ -68,7 +68,7 @@ export const TableRowRender = ({ index, row, selected, onSelect, onChangeStatus,
68
68
  </TableCell>
69
69
  )}
70
70
 
71
- <TableCell align="center">
71
+ {!disableCellThaoTac && <TableCell align="center">
72
72
  {canEdit && (
73
73
  <Tooltip title="Chỉnh sửa">
74
74
  <IconButton onClick={() => onEdit(row)}>
@@ -101,7 +101,7 @@ export const TableRowRender = ({ index, row, selected, onSelect, onChangeStatus,
101
101
  ))}
102
102
 
103
103
  {<MoreMenu actions={tableActionsOnMoreMenu} data={row} />}
104
- </TableCell>
104
+ </TableCell>}
105
105
  </TableRow>
106
106
  );
107
107
  };
@@ -33,6 +33,7 @@ DataManagement.propTypes = {
33
33
  validationSchema: PropTypes.object,
34
34
  disableStatus: PropTypes.bool,
35
35
  disableAdd: PropTypes.bool,
36
+ disableCellThaoTac: PropTypes.bool,
36
37
  statusKey: PropTypes.string,
37
38
  tableActions: PropTypes.array,
38
39
  disableEditor: PropTypes.bool,
@@ -52,6 +53,7 @@ function DataManagement({
52
53
  statusKey = "Status",
53
54
  disableStatus = false,
54
55
  disableAdd = false,
56
+ disableCellThaoTac = false,
55
57
  tableActions = [],
56
58
  disableEditor = false,
57
59
  onAddClick = () => {},
@@ -109,6 +111,7 @@ function DataManagement({
109
111
  validationSchema,
110
112
  statusKey,
111
113
  disableStatus,
114
+ disableCellThaoTac,
112
115
  disableAdd,
113
116
  tableActions
114
117
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"