umwd-components 0.1.281 → 0.1.282
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.
- package/dist/cjs/src/components/e-commerce/EnhancedTable/EnhancedTable.js +1 -1
- package/dist/cjs/src/components/e-commerce/EnhancedTable/EnhancedTableHead.js +1 -1
- package/dist/cjs/src/components/e-commerce/EnhancedTable/EnhancedTableRow.js +1 -1
- package/dist/cjs/src/components/e-commerce/EnhancedTable/EnhancedTableToolbar.js +1 -1
- package/dist/esm/src/components/e-commerce/EnhancedTable/EnhancedTable.js +1 -1
- package/dist/esm/src/components/e-commerce/EnhancedTable/EnhancedTableHead.js +1 -1
- package/dist/esm/src/components/e-commerce/EnhancedTable/EnhancedTableRow.js +1 -1
- package/dist/esm/src/components/e-commerce/EnhancedTable/EnhancedTableToolbar.js +1 -1
- package/package.json +1 -1
- package/src/components/e-commerce/EnhancedTable/EnhancedTable.tsx +11 -9
- package/src/components/e-commerce/EnhancedTable/EnhancedTableHead.tsx +5 -2
- package/src/components/e-commerce/EnhancedTable/EnhancedTableRow.tsx +16 -19
- package/src/components/e-commerce/EnhancedTable/EnhancedTableToolbar.tsx +4 -2
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Box"),a=require("@mui/material/Table"),
|
|
7
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Box"),a=require("@mui/material/Table"),l=require("@mui/material/TableBody"),r=require("@mui/material/TableCell"),i=require("@mui/material/TableContainer"),n=require("@mui/material/TablePagination"),o=require("@mui/material/TableRow"),u=require("@mui/material/Paper"),s=require("@mui/material/FormControlLabel"),d=require("@mui/material/Switch"),c=require("./EnhancedTableHead.js"),m=require("./EnhancedTableToolbar.js"),g=require("./EnhancedTableRow.js"),h=require("next/navigation");exports.default=function(b){var p,S,v,w,E;const{data:P,meta:q,headCells:C,subHeadCells:T,withSelection:f,title:x,subTitle:y}=b,{replace:R}=h.useRouter(),k=h.usePathname(),B=h.useSearchParams(),[j,H]=e.useState("asc"),[O,L]=e.useState("id"),[_,z]=e.useState([]),[A,D]=e.useState(0),[F,I]=e.useState(!1),[M,N]=e.useState(5),U=A+1===(null==q||null===(p=q.pagination)||void 0===p?void 0:p.pageCount)?(null==q||null===(S=q.pagination)||void 0===S?void 0:S.total)-(null==q||null===(v=q.pagination)||void 0===v?void 0:v.pageCount)*M:0;return e.useEffect((()=>{if(B){const e=new URLSearchParams(B);j?e.set("order",j):e.delete("order"),O?e.set("orderBy",O):e.delete("orderBy"),A?e.set("page",A.toString()):e.delete("page"),M?e.set("rowsPerPage",M.toString()):e.delete("rowsPerPage"),R("".concat(k,"?").concat(e.toString()))}}),[j,O,A,M]),e.createElement(t,{sx:{width:"100%"}},e.createElement(u,{sx:{width:"100%",mb:2}},e.createElement(m.default,{numSelected:_.length,title:x}),e.createElement(i,null,e.createElement(a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:F?"small":"medium"},e.createElement(c.default,{numSelected:_.length,order:j,orderBy:O,onSelectAllClick:e=>{if(e.target.checked){const e=P.map((e=>e.id));z(e)}else z([])},onRequestSort:(e,t)=>{H(O===t&&"asc"===j?"desc":"asc"),L(t)},rowCount:null==q||null===(w=q.pagination)||void 0===w?void 0:w.total,headCells:C,withSelection:f,withSubRows:T&&T.length>0}),e.createElement(l,null,P&&P.map(((t,a)=>{const l=(r=Number(t.id),-1!==_.indexOf(r));var r;return e.createElement(g.default,{key:"".concat((null==t?void 0:t.id)+a),row:t,headCells:C,subHeadCells:T,selected:l,subTitle:y})})),U>0&&e.createElement(o,{style:{height:(F?33:53)*U}},e.createElement(r,{colSpan:6}))))),e.createElement(n,{rowsPerPageOptions:[5,10,25],component:"div",count:null==q||null===(E=q.pagination)||void 0===E?void 0:E.total,rowsPerPage:M,page:A,onPageChange:(e,t)=>{D(t)},onRowsPerPageChange:e=>{N(parseInt(e.target.value,10)),D(0)}})),e.createElement(s,{control:e.createElement(d,{checked:F,onChange:e=>{I(e.target.checked)}}),label:"Dense padding"}))};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@mui/material/Box"),
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@mui/material/Box"),l=require("@mui/material/Checkbox"),t=require("@mui/material/TableCell"),i=require("@mui/material/TableHead"),a=require("@mui/material/TableRow"),n=require("@mui/material/TableSortLabel"),d=require("../../../../node_modules/@mui/utils/esm/visuallyHidden/visuallyHidden.js");exports.default=function(u){const{onSelectAllClick:o,order:c,orderBy:m,numSelected:s,rowCount:b,onRequestSort:p,headCells:g,withSelection:q,withSubRows:E}=u;return e.createElement(i,null,e.createElement(a,null,E&&e.createElement(t,null),q&&e.createElement(t,{padding:"checkbox"},e.createElement(l,{color:"primary",indeterminate:s>0&&s<b,checked:b>0&&s===b,onChange:o,inputProps:{"aria-label":"select all desserts"}})),g.map((l=>{return e.createElement(t,{key:l.id,align:l.numeric?"right":"left",padding:l.disablePadding?"none":"normal",sortDirection:m===l.id&&c},!1!==l.sortable?e.createElement(n,{active:m===l.id,direction:m===l.id?c:"asc",onClick:(i=l.id,e=>{p(e,i)})},l.label,m===l.id?e.createElement(r,{component:"span",sx:d.default},"desc"===c?"sorted descending":"sorted ascending"):null):e.createElement(e.Fragment,null,l.label));var i}))))};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("@mui/material/Box"),l=require("@mui/material/TableRow"),r=require("@mui/material/TableCell"),t=require("@mui/material/IconButton"),i=require("@mui/material/Collapse"),n=require("@mui/material/Typography"),m=require("@mui/material/Table"),u=require("@mui/material/TableHead"),o=require("@mui/material/TableBody"),c=require("@mui/material/Checkbox"),d=require("@mui/icons-material/KeyboardArrowUp"),s=require("@mui/icons-material/KeyboardArrowDown");exports.default=function(p,b){const{row:E,headCells:g,subHeadCells:h,withSelection:y,selected:q,handleClick:k,subTitle:x}=p,{subRows:w}=E,[T,C]=e.useState(!1),f="enhanced-table-checkbox-".concat(b);return e.createElement(e.Fragment,null,e.createElement(l,{sx:{"& > *":{borderBottom:"unset"}}},y&&e.createElement(r,{padding:"checkbox"},e.createElement(c,{color:"primary",checked:q,inputProps:{"aria-labelledby":f}})),w&&h&&e.createElement(r,null,e.createElement(t,{"aria-label":"expand row",size:"small",onClick:()=>C(!T)},T?e.createElement(d,null):e.createElement(s,null))),g.map((a=>e.createElement(r,{key:a.id,align:a.numeric?"right":"left",padding:a.disablePadding?"none":"normal"},E[a.id])))),w&&h&&e.createElement(l,null,e.createElement(r,{style:{paddingBottom:0,paddingTop:0},colSpan:6},e.createElement(i,{in:T,timeout:"auto",unmountOnExit:!0},e.createElement(a,{sx:{margin:1}},e.createElement(n,{variant:"h6",gutterBottom:!0,component:"div"},x),e.createElement(m,{size:"small","aria-label":"purchases"},e.createElement(u,null,e.createElement(l,null,h.map((a=>e.createElement(r,{key:a.id,align:a.numeric?"right":"left",padding:a.disablePadding?"none":"normal"},a.label))))),e.createElement(o,null,w.map((a=>e.createElement(l,{key:a.key},h.map((l=>e.createElement(r,{key:l.id,align:l.numeric?"right":"left",padding:l.disablePadding?"none":"normal"},a[l.id])))))))))))))};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Toolbar"),r=require("@mui/material/Typography"),l=require("@mui/material/IconButton"),i=require("@mui/material/Tooltip"),a=require("@mui/icons-material/Delete"),n=require("@mui/icons-material/FilterList"),
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Toolbar"),r=require("@mui/material/Typography"),l=require("@mui/material/IconButton"),i=require("@mui/material/Tooltip"),a=require("@mui/icons-material/Delete"),n=require("@mui/icons-material/FilterList"),m=require("@mui/material/styles");exports.default=function(u){const{title:c,numSelected:o}=u;return e.createElement(t,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...o>0&&{bgcolor:e=>m.alpha(e.palette.primary.main,e.palette.action.activatedOpacity)}}},o>0?e.createElement(r,{sx:{flex:"1 1 100%"},color:"inherit",variant:"subtitle1",component:"div"},o," selected"):e.createElement(r,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div"},c),o>0?e.createElement(i,{title:"Delete"},e.createElement(l,null,e.createElement(a,null))):e.createElement(i,{title:"Filter list"},e.createElement(l,null,e.createElement(n,null))))};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import e,{useState as t,useEffect as a}from"react";import l from"@mui/material/Box";import o from"@mui/material/Table";import r from"@mui/material/TableBody";import i from"@mui/material/TableCell";import n from"@mui/material/TableContainer";import m from"@mui/material/TablePagination";import d from"@mui/material/TableRow";import c from"@mui/material/Paper";import s from"@mui/material/FormControlLabel";import u from"@mui/material/Switch";import p from"./EnhancedTableHead.js";import g from"./EnhancedTableToolbar.js";import h from"./EnhancedTableRow.js";import{useRouter as b,usePathname as f,useSearchParams as w}from"next/navigation";function v(v){var E,C,P,S,T;const{data:x,meta:y,headCells:R,subHeadCells:k,withSelection:B,title:j,subTitle:H}=v,{replace:L}=b(),O=f(),q=w(),[z,A]=t("asc"),[D,F]=t("id"),[I,N]=t([]),[U,W]=t(0),[G,J]=t(!1),[K,M]=t(5),Q=U+1===(null==y||null===(E=y.pagination)||void 0===E?void 0:E.pageCount)?(null==y||null===(C=y.pagination)||void 0===C?void 0:C.total)-(null==y||null===(P=y.pagination)||void 0===P?void 0:P.pageCount)*K:0;return a((()=>{if(q){const e=new URLSearchParams(q);z?e.set("order",z):e.delete("order"),D?e.set("orderBy",D):e.delete("orderBy"),U?e.set("page",U.toString()):e.delete("page"),K?e.set("rowsPerPage",K.toString()):e.delete("rowsPerPage"),L("".concat(O,"?").concat(e.toString()))}}),[z,D,U,K]),e.createElement(l,{sx:{width:"100%"}},e.createElement(c,{sx:{width:"100%",mb:2}},e.createElement(g,{numSelected:I.length,title:j}),e.createElement(n,null,e.createElement(o,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:G?"small":"medium"},e.createElement(p,{numSelected:I.length,order:z,orderBy:D,onSelectAllClick:e=>{if(e.target.checked){const e=x.map((e=>e.id));N(e)}else N([])},onRequestSort:(e,t)=>{A(D===t&&"asc"===z?"desc":"asc"),F(t)},rowCount:null==y||null===(S=y.pagination)||void 0===S?void 0:S.total,headCells:R,withSelection:B,withSubRows:k&&k.length>0}),e.createElement(r,null,x&&x.map(((t,a)=>{const l=(o=Number(t.id),-1!==I.indexOf(o));var o;return e.createElement(h,{key:"".concat((null==t?void 0:t.id)+a),row:t,headCells:R,subHeadCells:k,selected:l,subTitle:H})})),Q>0&&e.createElement(d,{style:{height:(G?33:53)*Q}},e.createElement(i,{colSpan:6}))))),e.createElement(m,{rowsPerPageOptions:[5,10,25],component:"div",count:null==y||null===(T=y.pagination)||void 0===T?void 0:T.total,rowsPerPage:K,page:U,onPageChange:(e,t)=>{W(t)},onRowsPerPageChange:e=>{M(parseInt(e.target.value,10)),W(0)}})),e.createElement(s,{control:e.createElement(u,{checked:G,onChange:e=>{J(e.target.checked)}}),label:"Dense padding"}))}export{v as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import e from"react";import t from"@mui/material/Box";import l from"@mui/material/Checkbox";import r from"@mui/material/TableCell";import i from"@mui/material/TableHead";import a from"@mui/material/TableRow";import n from"@mui/material/TableSortLabel";import o from"../../../../node_modules/@mui/utils/esm/visuallyHidden/visuallyHidden.js";function m(m){const{onSelectAllClick:d,order:c,orderBy:s,numSelected:u,rowCount:p,onRequestSort:b,headCells:f,withSelection:g,withSubRows:E}=m;return e.createElement(i,null,e.createElement(a,null,E&&e.createElement(r,null),g&&e.createElement(r,{padding:"checkbox"},e.createElement(l,{color:"primary",indeterminate:u>0&&u<p,checked:p>0&&u===p,onChange:d,inputProps:{"aria-label":"select all desserts"}})),f.map((l=>{return e.createElement(r,{key:l.id,align:l.numeric?"right":"left",padding:l.disablePadding?"none":"normal",sortDirection:s===l.id&&c},!1!==l.sortable?e.createElement(n,{active:s===l.id,direction:s===l.id?c:"asc",onClick:(i=l.id,e=>{b(e,i)})},l.label,s===l.id?e.createElement(t,{component:"span",sx:o},"desc"===c?"sorted descending":"sorted ascending"):null):e.createElement(e.Fragment,null,l.label));var i}))))}export{m as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import e,{Fragment as a}from"react";import t from"@mui/material/Box";import l from"@mui/material/TableRow";import r from"@mui/material/TableCell";import m from"@mui/material/IconButton";import i from"@mui/material/Collapse";import n from"@mui/material/Typography";import o from"@mui/material/Table";import c from"@mui/material/TableHead";import d from"@mui/material/TableBody";import u from"@mui/material/Checkbox";import p from"@mui/icons-material/KeyboardArrowUp";import s from"@mui/icons-material/KeyboardArrowDown";function b(b,E){const{row:f,headCells:g,subHeadCells:h,withSelection:y,selected:k,handleClick:x,subTitle:w}=b,{subRows:T}=f,[C,B]=e.useState(!1),P="enhanced-table-checkbox-".concat(E);return e.createElement(a,null,e.createElement(l,{sx:{"& > *":{borderBottom:"unset"}}},y&&e.createElement(r,{padding:"checkbox"},e.createElement(u,{color:"primary",checked:k,inputProps:{"aria-labelledby":P}})),T&&h&&e.createElement(r,null,e.createElement(m,{"aria-label":"expand row",size:"small",onClick:()=>B(!C)},C?e.createElement(p,null):e.createElement(s,null))),g.map((a=>e.createElement(r,{key:a.id,align:a.numeric?"right":"left",padding:a.disablePadding?"none":"normal"},f[a.id])))),T&&h&&e.createElement(l,null,e.createElement(r,{style:{paddingBottom:0,paddingTop:0},colSpan:6},e.createElement(i,{in:C,timeout:"auto",unmountOnExit:!0},e.createElement(t,{sx:{margin:1}},e.createElement(n,{variant:"h6",gutterBottom:!0,component:"div"},w),e.createElement(o,{size:"small","aria-label":"purchases"},e.createElement(c,null,e.createElement(l,null,h.map((a=>e.createElement(r,{key:a.id,align:a.numeric?"right":"left",padding:a.disablePadding?"none":"normal"},a.label))))),e.createElement(d,null,T.map((a=>e.createElement(l,{key:a.key},h.map((t=>e.createElement(r,{key:t.id,align:t.numeric?"right":"left",padding:t.disablePadding?"none":"normal"},a[t.id])))))))))))))}export{b as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import e from"react";import t from"@mui/material/Toolbar";import l from"@mui/material/Typography";import r from"@mui/material/IconButton";import i from"@mui/material/Tooltip";import m from"@mui/icons-material/Delete";import a from"@mui/icons-material/FilterList";import{alpha as o}from"@mui/material/styles";function n(n){const{title:c,numSelected:p}=n;return e.createElement(t,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...p>0&&{bgcolor:e=>o(e.palette.primary.main,e.palette.action.activatedOpacity)}}},p>0?e.createElement(l,{sx:{flex:"1 1 100%"},color:"inherit",variant:"subtitle1",component:"div"},p," selected"):e.createElement(l,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div"},c),p>0?e.createElement(i,{title:"Delete"},e.createElement(r,null,e.createElement(m,null))):e.createElement(i,{title:"Filter list"},e.createElement(r,null,e.createElement(a,null))))}export{n as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import React, { useState, useEffect } from "react";
|
|
4
4
|
import Box from "@mui/material/Box";
|
|
5
5
|
import Table from "@mui/material/Table";
|
|
6
6
|
import TableBody from "@mui/material/TableBody";
|
|
@@ -18,7 +18,7 @@ import EnhancedTableRow from "./EnhancedTableRow.tsx";
|
|
|
18
18
|
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
19
19
|
import { EnhancedTableProps } from "./types";
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function EnhancedTable(props: EnhancedTableProps) {
|
|
22
22
|
const {
|
|
23
23
|
data,
|
|
24
24
|
meta,
|
|
@@ -33,12 +33,12 @@ export default function EnhancedTable(props: EnhancedTableProps) {
|
|
|
33
33
|
const pathname = usePathname();
|
|
34
34
|
const searchParams = useSearchParams();
|
|
35
35
|
|
|
36
|
-
const [order, setOrder] =
|
|
37
|
-
const [orderBy, setOrderBy] =
|
|
38
|
-
const [selected, setSelected] =
|
|
39
|
-
const [page, setPage] =
|
|
40
|
-
const [dense, setDense] =
|
|
41
|
-
const [rowsPerPage, setRowsPerPage] =
|
|
36
|
+
const [order, setOrder] = useState<Order>("asc");
|
|
37
|
+
const [orderBy, setOrderBy] = useState<string>("id");
|
|
38
|
+
const [selected, setSelected] = useState<readonly number[]>([]);
|
|
39
|
+
const [page, setPage] = useState(0);
|
|
40
|
+
const [dense, setDense] = useState(false);
|
|
41
|
+
const [rowsPerPage, setRowsPerPage] = useState(5);
|
|
42
42
|
|
|
43
43
|
const handleRequestSort = (
|
|
44
44
|
event: React.MouseEvent<unknown>,
|
|
@@ -100,7 +100,7 @@ export default function EnhancedTable(props: EnhancedTableProps) {
|
|
|
100
100
|
? meta?.pagination?.total - meta?.pagination?.pageCount * rowsPerPage
|
|
101
101
|
: 0;
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
useEffect(() => {
|
|
104
104
|
if (searchParams) {
|
|
105
105
|
const params = new URLSearchParams(searchParams);
|
|
106
106
|
if (order) {
|
|
@@ -194,3 +194,5 @@ export default function EnhancedTable(props: EnhancedTableProps) {
|
|
|
194
194
|
</Box>
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
|
+
|
|
198
|
+
export default EnhancedTable;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Box from "@mui/material/Box";
|
|
3
3
|
import Checkbox from "@mui/material/Checkbox";
|
|
4
4
|
import TableCell from "@mui/material/TableCell";
|
|
5
5
|
import TableHead from "@mui/material/TableHead";
|
|
6
6
|
import TableRow from "@mui/material/TableRow";
|
|
7
7
|
import TableSortLabel from "@mui/material/TableSortLabel";
|
|
8
|
+
// import { visuallyHidden } from "@mui/utils";
|
|
8
9
|
import { visuallyHidden } from "@mui/utils";
|
|
9
10
|
import { EnhancedTableHeadProps } from "./types";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
function EnhancedTableHead(props: EnhancedTableHeadProps) {
|
|
12
13
|
const {
|
|
13
14
|
onSelectAllClick,
|
|
14
15
|
order,
|
|
@@ -74,3 +75,5 @@ export default function EnhancedTableHead(props: EnhancedTableHeadProps) {
|
|
|
74
75
|
</TableHead>
|
|
75
76
|
);
|
|
76
77
|
}
|
|
78
|
+
|
|
79
|
+
export default EnhancedTableHead;
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Checkbox,
|
|
13
|
-
} from "@mui/material";
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
import Box from "@mui/material/Box";
|
|
3
|
+
import TableRow from "@mui/material/TableRow";
|
|
4
|
+
import TableCell from "@mui/material/TableCell";
|
|
5
|
+
import IconButton from "@mui/material/IconButton";
|
|
6
|
+
import Collapse from "@mui/material/Collapse";
|
|
7
|
+
import Typography from "@mui/material/Typography";
|
|
8
|
+
import Table from "@mui/material/Table";
|
|
9
|
+
import TableHead from "@mui/material/TableHead";
|
|
10
|
+
import TableBody from "@mui/material/TableBody";
|
|
11
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
14
12
|
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
15
13
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
16
14
|
import { EnhancedTableRowProps } from "./types";
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
props: EnhancedTableRowProps,
|
|
20
|
-
index: number
|
|
21
|
-
) {
|
|
16
|
+
function EnhancedTableRow(props: EnhancedTableRowProps, index: number) {
|
|
22
17
|
const {
|
|
23
18
|
row,
|
|
24
19
|
headCells,
|
|
@@ -36,7 +31,7 @@ export default function EnhancedTableRow(
|
|
|
36
31
|
const labelId = `enhanced-table-checkbox-${index}`;
|
|
37
32
|
|
|
38
33
|
return (
|
|
39
|
-
<
|
|
34
|
+
<Fragment>
|
|
40
35
|
<TableRow sx={{ "& > *": { borderBottom: "unset" } }}>
|
|
41
36
|
{withSelection && (
|
|
42
37
|
<TableCell padding="checkbox">
|
|
@@ -113,6 +108,8 @@ export default function EnhancedTableRow(
|
|
|
113
108
|
</TableCell>
|
|
114
109
|
</TableRow>
|
|
115
110
|
)}
|
|
116
|
-
</
|
|
111
|
+
</Fragment>
|
|
117
112
|
);
|
|
118
113
|
}
|
|
114
|
+
|
|
115
|
+
export default EnhancedTableRow;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Toolbar from "@mui/material/Toolbar";
|
|
3
3
|
import Typography from "@mui/material/Typography";
|
|
4
4
|
import IconButton from "@mui/material/IconButton";
|
|
@@ -8,7 +8,7 @@ import FilterListIcon from "@mui/icons-material/FilterList";
|
|
|
8
8
|
import { alpha } from "@mui/material/styles";
|
|
9
9
|
import { EnhancedTableToolbarProps } from "./types";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function EnhancedTableToolbar(props: EnhancedTableToolbarProps) {
|
|
12
12
|
const { title, numSelected } = props;
|
|
13
13
|
|
|
14
14
|
return (
|
|
@@ -60,3 +60,5 @@ export default function EnhancedTableToolbar(props: EnhancedTableToolbarProps) {
|
|
|
60
60
|
</Toolbar>
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
export default EnhancedTableToolbar;
|