trithuc-mvc-react 2.8.8 → 2.9.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.
@@ -1,4 +1,4 @@
1
- import { Table, TableBody, TableCell, TableContainer, TableRow, Typography, useMediaQuery, useTheme } from "@mui/material";
1
+ import { Grid, Table, TableBody, TableCell, TableContainer, TableRow, Typography, useMediaQuery, useTheme } from "@mui/material";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import TablePaginationCustom from "../table/TablePagination";
4
4
 
@@ -1,4 +1,4 @@
1
- import { Table, TableBody, TableCell, TableContainer, TableRow, Typography, useMediaQuery, useTheme } from "@mui/material";
1
+ import { Grid, Table, TableBody, TableCell, TableContainer, TableRow, Typography, useMediaQuery, useTheme } from "@mui/material";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import TablePaginationCustom from "../table/TablePagination";
4
4
 
@@ -1,4 +1,4 @@
1
- import { Box, useMediaQuery, useTheme } from "@mui/material";
1
+ import { Box, Grid, useMediaQuery, useTheme } from "@mui/material";
2
2
  import { FormProvider, useForm } from "react-hook-form";
3
3
 
4
4
  import PropTypes from "prop-types";
@@ -1,8 +1,8 @@
1
+ import { URL_APPLICATION, URL_APPLICATION_API } from "@/constants";
2
+ import { Download } from "@mui/icons-material";
3
+ import { Button, IconButton, Tooltip, useMediaQuery, useTheme } from "@mui/material";
1
4
  import { toast } from "react-toastify";
2
5
  import { exportExcel } from "../../api";
3
- import { Button, IconButton, Tooltip, useMediaQuery, useTheme } from "@mui/material";
4
- import { Download } from "@mui/icons-material";
5
- import { URL_APPLICATION, URL_APPLICATION_API } from "@/constants";
6
6
 
7
7
  const ExportExcelButton = ({ tableName, data, size = "small" }) => {
8
8
  const theme = useTheme();
@@ -1,19 +1,10 @@
1
- import {
2
- Autocomplete,
3
- FormControl,
4
- IconButton,
5
- InputAdornment,
6
- InputLabel,
7
- MenuItem,
8
- Select,
9
- TextField
10
- } from "@mui/material";
11
- import { useCallback } from "react";
12
1
  import { SearchOutlined } from "@mui/icons-material";
13
- import { useController, useFormContext } from "react-hook-form";
2
+ import ClearIcon from "@mui/icons-material/Clear";
3
+ import { Autocomplete, FormControl, IconButton, InputAdornment, InputLabel, MenuItem, Select, TextField } from "@mui/material";
14
4
  import { debounce } from "lodash";
5
+ import { useCallback } from "react";
6
+ import { useController, useFormContext } from "react-hook-form";
15
7
  import { useDataTable } from "./hooks";
16
- import ClearIcon from "@mui/icons-material/Clear";
17
8
  export function FilterElement({
18
9
  name,
19
10
  type,
@@ -1,4 +1,4 @@
1
- import { Accordion, AccordionSummary, Box, Slider, Typography } from "@mui/material";
1
+ import { Accordion, AccordionSummary, Box, Grid, Slider, Typography } from "@mui/material";
2
2
  import { useFormContext } from "react-hook-form";
3
3
 
4
4
  import { FilterElement } from "./FilterElement";
@@ -3,7 +3,6 @@ import {
3
3
  Checkbox,
4
4
  FormControl,
5
5
  FormControlLabel,
6
- FormLabel,
7
6
  InputLabel,
8
7
  MenuItem,
9
8
  Radio,
@@ -14,13 +13,13 @@ import {
14
13
  } from "@mui/material";
15
14
  import { Controller, useFormContext } from "react-hook-form";
16
15
  // Grid version 2
17
- import PropTypes from "prop-types";
18
16
  import { DatePicker } from "@mui/x-date-pickers";
19
- import { useCallback, useEffect } from "react";
20
17
  import moment from "moment/moment";
18
+ import PropTypes from "prop-types";
19
+ import { useCallback, useEffect } from "react";
21
20
  import { DEFAULT_DATE_FORMAT } from "../../constants";
22
- import UploadMultipleFile from "./upload/UploadMultipleFile";
23
21
  import RhfUploadAvatar from "./upload/RhfUploadAvatar";
22
+ import UploadMultipleFile from "./upload/UploadMultipleFile";
24
23
 
25
24
  FormField.propTypes = {
26
25
  datas: PropTypes.array,
@@ -1,6 +1,6 @@
1
- import { useEffect, useState } from "react";
2
- import { Tooltip, IconButton } from "@mui/material";
3
1
  import { LightbulbOutlined } from "@mui/icons-material";
2
+ import { IconButton, Tooltip } from "@mui/material";
3
+ import { useEffect, useState } from "react";
4
4
  import { huongDan } from "../../api";
5
5
 
6
6
  const HuongDanButton = ({ tableName, size = "small" }) => {
@@ -1,6 +1,6 @@
1
- import { Checkbox, TableRow, TableCell, TableHead as MuiTableHead, useTheme, useMediaQuery } from "@mui/material";
2
- import { useDataTable } from "./hooks";
1
+ import { Checkbox, TableHead as MuiTableHead, TableCell, TableRow, useMediaQuery, useTheme } from "@mui/material";
3
2
  import { usePermission } from "../../hooks";
3
+ import { useDataTable } from "./hooks";
4
4
  export function TableHead({ numSelected, rowCount, onSelectAllClick, headLabel }) {
5
5
  const { disableStatus, disableCellThaoTac, tableName } = useDataTable();
6
6
  const { canEdit } = usePermission(tableName);
@@ -1,15 +1,14 @@
1
- import { Checkbox, IconButton, Switch, TableCell, TableRow, Tooltip, Toolbar, useMediaQuery } from "@mui/material";
2
- import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline";
3
1
  import { EditOutlined } from "@mui/icons-material";
4
- import { useDataTable } from "./hooks";
2
+ import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline";
5
3
  import RemoveRedEyeOutlinedIcon from "@mui/icons-material/RemoveRedEyeOutlined";
4
+ import { Checkbox, IconButton, Switch, TableCell, TableRow, Toolbar, Tooltip, useMediaQuery } from "@mui/material";
6
5
  import { usePermission } from "../../hooks";
6
+ import { useDataTable } from "./hooks";
7
7
  // material
8
8
 
9
9
  import { styled, useTheme } from "@mui/material/styles";
10
- import MoreMenu from "../MoreMenu";
11
10
  import { useMemo } from "react";
12
-
11
+ import MoreMenu from "../MoreMenu";
13
12
 
14
13
  export const TableRowRender = ({
15
14
  index,
@@ -28,7 +27,7 @@ export const TableRowRender = ({
28
27
  const { selectedField, columns, statusKey, disableStatus, tableActions, disableCellThaoTac, tableName, sttLuyKe } =
29
28
  useDataTable();
30
29
  const { canEdit, canDelete, canView, canAction } = usePermission(tableName);
31
-
30
+
32
31
  const { tableActionsOnTable, tableActionsOnMoreMenu } = useMemo(() => {
33
32
  const tableActionsAfterFilter = [...tableActions]
34
33
  .filter((x) => x)
@@ -1,7 +1,7 @@
1
1
  import { EditOutlined } from "@mui/icons-material";
2
2
  import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline";
3
3
  import RemoveRedEyeOutlinedIcon from "@mui/icons-material/RemoveRedEyeOutlined";
4
- import { Box, IconButton, Switch, TableCell, TableRow, Toolbar, Tooltip, useMediaQuery } from "@mui/material";
4
+ import { Box, Grid, IconButton, Switch, TableCell, TableRow, Toolbar, Tooltip, useMediaQuery } from "@mui/material";
5
5
  import { styled, useTheme } from "@mui/material/styles";
6
6
  import { useMemo } from "react";
7
7
  import { usePermission } from "../../hooks";
@@ -1,12 +1,12 @@
1
- import { Checkbox, IconButton, Tooltip, Typography, Box, useMediaQuery, Stack } from "@mui/material";
2
1
  import { Delete } from "@mui/icons-material";
2
+ import { Box, Checkbox, IconButton, Stack, Tooltip, Typography, useMediaQuery } from "@mui/material";
3
3
 
4
- import PropTypes from "prop-types";
5
4
  import { useTheme } from "@mui/material/styles";
6
- import { RootStyle } from "./TableRowRender";
5
+ import PropTypes from "prop-types";
6
+ import { useMemo } from "react";
7
7
  import { usePermission } from "../../hooks";
8
8
  import { useDataTable } from "./hooks";
9
- import { useMemo } from "react";
9
+ import { RootStyle } from "./TableRowRender";
10
10
  // ----------------------------------------------------------------------
11
11
  const TableToolbar = ({ selected, multipleActions = [], numSelected, onSelectAllClick, rowCount, onDeleteMultiple }) => {
12
12
  const theme = useTheme();
@@ -1,21 +1,21 @@
1
- import { Button, Card, IconButton, Stack, Tooltip, Typography, useTheme, useMediaQuery } from "@mui/material";
1
+ import { Button, Card, IconButton, Stack, Tooltip, Typography, useMediaQuery, useTheme } from "@mui/material";
2
2
 
3
3
  import { useEffect, useMemo, useState } from "react";
4
4
 
5
- import { DataTableContext } from "./context";
5
+ import { Add, Refresh } from "@mui/icons-material";
6
6
  import PropTypes from "prop-types";
7
+ import { DataTableContext } from "./context";
7
8
  import DataTable from "./DataTable";
8
- import { Add, Lightbulb, LightbulbCircle, LightbulbCircleOutlined, LightbulbOutlined, Refresh } from "@mui/icons-material";
9
9
 
10
10
  import { FormProvider, useForm } from "react-hook-form";
11
11
  import EditorDialog from "./EditorDialog";
12
12
  import ViewDetailDialog from "./ViewDetailDialog";
13
13
 
14
+ import { usePermission } from "../../hooks";
15
+ import DataTableSM from "./DataTableSM";
14
16
  import ExportExcelButton from "./ExportExcelButton";
15
17
  import { FilterGod } from "./FilterGod";
16
- import { usePermission } from "../../hooks";
17
18
  import HuongDanButton from "./HuongDanButton";
18
- import DataTableSM from "./DataTableSM";
19
19
 
20
20
  DataManagement.propTypes = {
21
21
  columns: PropTypes.array,
@@ -1,10 +1,10 @@
1
1
  import { FormHelperText, LinearProgress } from "@mui/material";
2
2
 
3
+ import { saveFilesToServer } from "@/utils";
4
+ import { Typography } from "@mui/material";
5
+ import { useCallback, useState } from "react";
3
6
  import { Controller, useFormContext } from "react-hook-form";
4
7
  import UploadMultiFile from "trithuc-mvc-react/components/DataManagement/upload/UploadMultiFile";
5
- import { useCallback, useState } from "react";
6
- import { saveFilesToServer } from "@/utils";
7
- import { Typography } from '@mui/material';
8
8
  const UploadMultipleFile = ({ name, label, disabled }) => {
9
9
  const { control, getValues, setValue } = useFormContext();
10
10
  const [isLoadingUpfile, setIsLoadingUpfile] = useState(false);
@@ -40,9 +40,9 @@ const UploadMultipleFile = ({ name, label, disabled }) => {
40
40
  maxSize={31457280}
41
41
  accept="*"
42
42
  files={field.value}
43
- onDrop={!disabled ? handleDrop : () => { }} // disabled lúc ở model view thì ko được chọn ảnh
44
- onRemove={!disabled ? handleRemove : () => { }}
45
- onRemoveAll={!disabled ? handleRemoveAll : () => { }}
43
+ onDrop={!disabled ? handleDrop : () => {}} // disabled lúc ở model view thì ko được chọn ảnh
44
+ onRemove={!disabled ? handleRemove : () => {}}
45
+ onRemoveAll={!disabled ? handleRemoveAll : () => {}}
46
46
  error={Boolean(error)}
47
47
  />
48
48
  {isLoadingUpfile && <LinearProgress />}
@@ -2,8 +2,8 @@ import { isString } from "lodash";
2
2
  import PropTypes from "prop-types";
3
3
  import { useDropzone } from "react-dropzone";
4
4
  // material
5
+ import { Box, Paper, Typography } from "@mui/material";
5
6
  import { alpha, styled } from "@mui/material/styles";
6
- import { Paper, Box, Typography } from "@mui/material";
7
7
  // utils
8
8
  // import { fData } from '../../utils/formatNumber';
9
9
  //
@@ -1,4 +1,4 @@
1
- import { Box } from "@mui/material";
1
+ import { Box, Grid } from "@mui/material";
2
2
 
3
3
  import PropTypes from "prop-types";
4
4
  import { FormProvider, useForm } from "react-hook-form";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "2.8.8",
3
+ "version": "2.9.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -38,8 +38,8 @@
38
38
  "@mui/icons-material": "^5.15.12",
39
39
  "@mui/lab": "^5.0.0-alpha.142",
40
40
  "@mui/material": "^5.15.12",
41
- "@mui/x-date-pickers": "^6.20.2",
42
- "@mui/x-tree-view": "^6.0.0-alpha.4",
41
+ "@mui/x-date-pickers": "^7.22.1",
42
+ "@mui/x-tree-view": "^7.22.1",
43
43
  "react": ">=16",
44
44
  "react-dom": ">=16",
45
45
  "react-query": "^3.39.3",