umwd-components 0.1.301 → 0.1.302
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.
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as a,useEffect as o}from"react";import l from"@mui/material/Box";import i from"@mui/material/Table";import r from"@mui/material/TableBody";import n from"@mui/material/TableCell";import m from"@mui/material/TableContainer";import d from"@mui/material/TablePagination";import c from"@mui/material/TableRow";import u from"@mui/material/Paper";import s from"@mui/material/FormControlLabel";import p from"@mui/material/Switch";import g from"./EnhancedTableHead.js";import f from"./EnhancedTableToolbar.js";import h from"./EnhancedTableRow.js";import{useRouter as b,usePathname as v,useSearchParams as w}from"next/navigation";function E(E){var C,P,S,T,x
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as a,useEffect as o}from"react";import l from"@mui/material/Box";import i from"@mui/material/Table";import r from"@mui/material/TableBody";import n from"@mui/material/TableCell";import m from"@mui/material/TableContainer";import d from"@mui/material/TablePagination";import c from"@mui/material/TableRow";import u from"@mui/material/Paper";import s from"@mui/material/FormControlLabel";import p from"@mui/material/Switch";import g from"./EnhancedTableHead.js";import f from"./EnhancedTableToolbar.js";import h from"./EnhancedTableRow.js";import{useRouter as b,usePathname as v,useSearchParams as w}from"next/navigation";function E(E){var C,P,S,T,y,x=E.data,k=E.meta,R=E.headCells,B=E.subHeadCells,j=E.withSelection,H=E.title,L=E.subTitle,O=b().replace,q=v(),z=w(),A=e(a("asc"),2),D=A[0],F=A[1],I=e(a("id"),2),N=I[0],U=I[1],W=e(a([]),2),_=W[0],G=W[1],J=e(a(0),2),K=J[0],M=J[1],Q=e(a(!1),2),V=Q[0],X=Q[1],Y=e(a(5),2),Z=Y[0],$=Y[1],ee=K+1===(null===(C=null==k?void 0:k.pagination)||void 0===C?void 0:C.pageCount)?(null===(P=null==k?void 0:k.pagination)||void 0===P?void 0:P.total)-(null===(S=null==k?void 0:k.pagination)||void 0===S?void 0:S.pageCount)*Z:0;return o((function(){if(z){var e=new URLSearchParams(z);D?e.set("order",D):e.delete("order"),N?e.set("orderBy",N):e.delete("orderBy"),K?e.set("page",K.toString()):e.delete("page"),Z?e.set("rowsPerPage",Z.toString()):e.delete("rowsPerPage"),O("".concat(q,"?").concat(e.toString()))}}),[D,N,K,Z]),t.createElement(l,{sx:{width:"100%"}},t.createElement(u,{sx:{width:"100%",mb:2}},t.createElement(f,{numSelected:_.length,title:H}),t.createElement(m,null,t.createElement(i,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:V?"small":"medium"},t.createElement(g,{numSelected:_.length,order:D,orderBy:N,onSelectAllClick:function(e){if(e.target.checked){var t=x.map((function(e){return e.id}));G(t)}else G([])},onRequestSort:function(e,t){F(N===t&&"asc"===D?"desc":"asc"),U(t)},rowCount:null===(T=null==k?void 0:k.pagination)||void 0===T?void 0:T.total,headCells:R,withSelection:j,withSubRows:B&&B.length>0}),t.createElement(r,null,x&&x.map((function(e,a){var o,l=(o=Number(e.id),-1!==_.indexOf(o));return t.createElement(h,{key:e.key||"".concat((null==e?void 0:e.id)+a),row:e,headCells:R,subHeadCells:B,selected:l,subTitle:L})})),ee>0&&t.createElement(c,{style:{height:(V?33:53)*ee}},t.createElement(n,{colSpan:6}))))),t.createElement(d,{rowsPerPageOptions:[5,10,25],component:"div",count:null===(y=null==k?void 0:k.pagination)||void 0===y?void 0:y.total,rowsPerPage:Z,page:K,onPageChange:function(e,t){M(t)},onRowsPerPageChange:function(e){$(parseInt(e.target.value,10)),M(0)}})),t.createElement(s,{control:t.createElement(p,{checked:V,onChange:function(e){X(e.target.checked)}}),label:"Dense padding"}))}export{E as default};
|