trithuc-mvc-react 3.0.8 → 3.1.0

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.
@@ -14,7 +14,6 @@ import { TableRowRenderSM } from "./TableRowRenderSM";
14
14
  import TableToolbar from "./TableToolbar";
15
15
  import { useDataTable } from "./hooks";
16
16
  const defaultQueryOptions = {
17
- keepPreviousData: true, // Giữ dữ liệu cũ trong khi tải dữ liệu mới
18
17
  staleTime: 1000 * 60 * 1, // Thời gian dữ liệu có thể sử dụng lại trước khi gọi lại API
19
18
  cacheTime: 1000 * 60 * 30, // Thời gian dữ liệu được lưu trong cache trước khi bị xóa
20
19
  refetchOnWindowFocus: true, // Tự động lấy lại dữ liệu khi người dùng quay lại tab
@@ -135,8 +135,8 @@ export const TableRowRender = ({
135
135
  </IconButton>
136
136
  </Tooltip>
137
137
  )}
138
- {tableActionsOnTable.map(({ title, onClick, element }) => (
139
- <Tooltip key={title} title={title}>
138
+ {tableActionsOnTable.map(({ title, onClick, element, visible }) => (
139
+ <Tooltip key={title} title={title} hidden={typeof visible === "function" && !visible(row)}>
140
140
  <IconButton
141
141
  size={downXl ? "small" : "medium"}
142
142
  onClick={() => {
@@ -142,7 +142,7 @@ export const TableRowRenderSM = ({
142
142
  Xóa
143
143
  </Button>
144
144
  )}
145
- {tableActionsOnTable.map(({ title, onClick, element }) => (
145
+ {tableActionsOnTable.map(({ title, onClick, element, visible = true }) => (
146
146
  <Button
147
147
  size="small"
148
148
  variant="outlined"
@@ -162,6 +162,7 @@ export const TableRowRenderSM = ({
162
162
  overflow: "hidden",
163
163
  textOverflow: "ellipsis"
164
164
  }}
165
+ hidden={typeof visible === "function" && !visible(row)}
165
166
  >
166
167
  {title.toLowerCase() === "xem chi tiết" ? "Xem" : title}
167
168
  </Button>
@@ -260,7 +260,7 @@ function DataManagement({
260
260
  </Grid>
261
261
  </Stack>
262
262
 
263
- <Card>
263
+ <Card className="custom-card-DataManagement">
264
264
  {tabPanel}
265
265
  <FilterGod tableName={tableName} filters={filters} elementSize={elementSize} setPage={setPage} />
266
266
  {backParentNavigator}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "3.0.8",
3
+ "version": "3.1.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"