trithuc-mvc-react 2.8.5 → 2.8.7
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.
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import TablePaginationCustom from "../table/TablePagination";
|
|
1
|
+
import { Table, TableBody, TableCell, TableContainer, TableRow, Typography, useMediaQuery, useTheme } from "@mui/material";
|
|
3
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import TablePaginationCustom from "../table/TablePagination";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useConfirm } from "material-ui-confirm";
|
|
6
6
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
|
7
|
+
import { toast } from "react-toastify";
|
|
7
8
|
import { changeStatusDataToTable, deleteDataFromTable, deleteMultipleDataFromTable, getDatasFromTable } from "../../api";
|
|
8
9
|
import TableRowsLoader from "../table/TableRowsLoader";
|
|
9
|
-
import {
|
|
10
|
-
import { useConfirm } from "material-ui-confirm";
|
|
10
|
+
import { TableHead } from "./TableHead";
|
|
11
11
|
|
|
12
|
+
import { URL_APPLICATION_API } from "@/constants";
|
|
13
|
+
import { usePermission } from "../../hooks";
|
|
12
14
|
import { TableRowRender } from "./TableRowRender";
|
|
13
15
|
import TableToolbar from "./TableToolbar";
|
|
14
16
|
import { useDataTable } from "./hooks";
|
|
15
|
-
import { usePermission } from "../../hooks";
|
|
16
|
-
import { URL_APPLICATION, URL_APPLICATION_API } from "@/constants";
|
|
17
17
|
const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit, disableDelete }) => {
|
|
18
18
|
const {
|
|
19
19
|
tableName,
|
|
@@ -288,16 +288,16 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
|
|
|
288
288
|
</Table>
|
|
289
289
|
</TableContainer>
|
|
290
290
|
|
|
291
|
-
<
|
|
291
|
+
<Grid container>
|
|
292
292
|
{!hasTabpanel && (
|
|
293
|
-
<
|
|
293
|
+
<Grid item alignSelf={"center"} sx={{ pl: 2 }}>
|
|
294
294
|
<Typography variant="body1">
|
|
295
295
|
Tổng số lượng: <span>{total}</span>
|
|
296
296
|
</Typography>
|
|
297
297
|
</Grid>
|
|
298
298
|
)}
|
|
299
299
|
|
|
300
|
-
<
|
|
300
|
+
<Grid item xs>
|
|
301
301
|
<TablePaginationCustom
|
|
302
302
|
count={total}
|
|
303
303
|
rowsPerPage={rowsPerPage}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import TablePaginationCustom from "../table/TablePagination";
|
|
1
|
+
import { Table, TableBody, TableCell, TableContainer, TableRow, Typography, useMediaQuery, useTheme } from "@mui/material";
|
|
3
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import TablePaginationCustom from "../table/TablePagination";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useConfirm } from "material-ui-confirm";
|
|
6
6
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
|
7
|
+
import { toast } from "react-toastify";
|
|
7
8
|
import { changeStatusDataToTable, deleteDataFromTable, deleteMultipleDataFromTable, getDatasFromTable } from "../../api";
|
|
8
9
|
import TableRowsLoader from "../table/TableRowsLoader";
|
|
9
|
-
import { toast } from "react-toastify";
|
|
10
|
-
import { useConfirm } from "material-ui-confirm";
|
|
11
10
|
|
|
12
|
-
import {
|
|
13
|
-
import TableToolbar from "./TableToolbar";
|
|
14
|
-
import { useDataTable } from "./hooks";
|
|
11
|
+
import { URL_APPLICATION_API } from "@/constants";
|
|
15
12
|
import { usePermission } from "../../hooks";
|
|
16
|
-
import { URL_APPLICATION, URL_APPLICATION_API } from "@/constants";
|
|
17
13
|
import { TableRowRenderSM } from "./TableRowRenderSM";
|
|
14
|
+
import TableToolbar from "./TableToolbar";
|
|
15
|
+
import { useDataTable } from "./hooks";
|
|
18
16
|
const DataTableSM = ({ multipleActions = [], page, setPage = () => {}, disableEdit, disableDelete }) => {
|
|
19
17
|
const {
|
|
20
18
|
tableName,
|
|
@@ -289,16 +287,16 @@ const DataTableSM = ({ multipleActions = [], page, setPage = () => {}, disableEd
|
|
|
289
287
|
</Table>
|
|
290
288
|
</TableContainer>
|
|
291
289
|
|
|
292
|
-
<
|
|
290
|
+
<Grid container>
|
|
293
291
|
{!hasTabpanel && (
|
|
294
|
-
<
|
|
292
|
+
<Grid item alignSelf={"center"} sx={{ pl: 2 }}>
|
|
295
293
|
<Typography variant="body1">
|
|
296
294
|
Tổng số lượng: <span>{total}</span>
|
|
297
295
|
</Typography>
|
|
298
296
|
</Grid>
|
|
299
297
|
)}
|
|
300
298
|
|
|
301
|
-
<
|
|
299
|
+
<Grid item xs>
|
|
302
300
|
<TablePaginationCustom
|
|
303
301
|
count={total}
|
|
304
302
|
rowsPerPage={rowsPerPage}
|
|
@@ -166,7 +166,7 @@ function EditorForm({ fields, submitRef }) {
|
|
|
166
166
|
return (
|
|
167
167
|
<FormProvider {...methods}>
|
|
168
168
|
<Box component={"form"} onSubmit={methods.handleSubmit(onSubmit, onValid)}>
|
|
169
|
-
<
|
|
169
|
+
<Grid container spacing={2}>
|
|
170
170
|
{fields.map(
|
|
171
171
|
({
|
|
172
172
|
field,
|
|
@@ -185,7 +185,7 @@ function EditorForm({ fields, submitRef }) {
|
|
|
185
185
|
...rest
|
|
186
186
|
}) => {
|
|
187
187
|
return (
|
|
188
|
-
<
|
|
188
|
+
<Grid item md={size?.md} xs={size?.xs} sm={size?.sm} key={field}>
|
|
189
189
|
<FormField
|
|
190
190
|
type={type}
|
|
191
191
|
label={label}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion, AccordionSummary, Box,
|
|
1
|
+
import { Accordion, AccordionSummary, Box, Slider, Typography } from "@mui/material";
|
|
2
2
|
import { useFormContext } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
import { FilterElement } from "./FilterElement";
|
|
@@ -30,7 +30,7 @@ export const FilterGod = ({ filters, elementSize = "small", setPage = () => {} }
|
|
|
30
30
|
<Typography variant="h6">Tìm kiếm</Typography>
|
|
31
31
|
</AccordionSummary>
|
|
32
32
|
<AccordionDetails>
|
|
33
|
-
<
|
|
33
|
+
<Grid container spacing={1}>
|
|
34
34
|
{filters.map(({ field, size, ...rest }) => {
|
|
35
35
|
if (rest.type === "date-range") {
|
|
36
36
|
let label = ["Từ ngày", "Đến ngày"];
|
|
@@ -39,7 +39,7 @@ export const FilterGod = ({ filters, elementSize = "small", setPage = () => {} }
|
|
|
39
39
|
label = field.label;
|
|
40
40
|
}
|
|
41
41
|
return (
|
|
42
|
-
<
|
|
42
|
+
<Grid key={field.toString()} md={size?.md} xs={size?.xs} sm={size?.sm}>
|
|
43
43
|
<DateRangePicker
|
|
44
44
|
label={label}
|
|
45
45
|
onChange={(value) => {
|
|
@@ -59,7 +59,7 @@ export const FilterGod = ({ filters, elementSize = "small", setPage = () => {} }
|
|
|
59
59
|
|
|
60
60
|
if (rest.type === "slider-range") {
|
|
61
61
|
return (
|
|
62
|
-
<
|
|
62
|
+
<Grid key={field.toString()} md={size?.md} xs={size?.xs} sm={size?.sm}>
|
|
63
63
|
<Slider
|
|
64
64
|
onChange={(e, value) => {
|
|
65
65
|
setDataSearch({
|
|
@@ -80,7 +80,7 @@ export const FilterGod = ({ filters, elementSize = "small", setPage = () => {} }
|
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
return (
|
|
83
|
-
<
|
|
83
|
+
<Grid key={field} md={size?.md} xs={size?.xs} sm={size?.sm}>
|
|
84
84
|
<FilterElement name={field} {...rest} setPage={setPage} />
|
|
85
85
|
</Grid>
|
|
86
86
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box
|
|
1
|
+
import { Box } from "@mui/material";
|
|
2
2
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { FormProvider, useForm } from "react-hook-form";
|
|
@@ -79,11 +79,11 @@ function DynamicForm({ fields, elementSize = "medium", submitRef, validationSche
|
|
|
79
79
|
size={elementSize}
|
|
80
80
|
required={required}
|
|
81
81
|
/>
|
|
82
|
-
</
|
|
82
|
+
</Grid>
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
)}
|
|
86
|
-
</
|
|
86
|
+
</Grid>
|
|
87
87
|
<button ref={submitRef} type="submit" style={{ display: "none" }} />
|
|
88
88
|
</Box>
|
|
89
89
|
</FormProvider>
|