trithuc-mvc-react 3.0.9 → 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>
|