umwd-components 0.1.709 → 0.1.711

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.
Files changed (41) hide show
  1. package/dist/node_modules/base64-js/index.js +1 -1
  2. package/dist/node_modules/ieee754/index.js +1 -1
  3. package/dist/src/components/common/EnhancedTable/EnhancedTable.js +1 -1
  4. package/dist/src/components/common/EnhancedTable/EnhancedTableFilterRow.js +1 -1
  5. package/dist/src/data/loaders/e-commerce/getAllCustomers.js +1 -1
  6. package/dist/src/data/loaders/e-commerce/getAllInvoices.js +1 -1
  7. package/dist/src/data/loaders/e-commerce/getSingleOpo.js +1 -1
  8. package/dist/src/data/loaders/e-commerce/getTableProducts.js +1 -1
  9. package/dist/src/data/loaders/e-commerce/iros/getAllIros.js +1 -1
  10. package/dist/src/data/loaders/logistics/getTableIpos.js +1 -1
  11. package/dist/src/lib/processFilters.js +1 -1
  12. package/dist/tsconfig.build.tsbuildinfo +1 -1
  13. package/dist/types/data/loaders/e-commerce/getAllCustomers.d.ts +5 -1
  14. package/dist/types/data/loaders/e-commerce/getAllInvoices.d.ts +9 -1
  15. package/dist/types/data/loaders/e-commerce/getAllOpos.d.ts +5 -1
  16. package/dist/types/data/loaders/e-commerce/getSingleOpo.d.ts +1 -1
  17. package/dist/types/data/loaders/e-commerce/getTableProducts.d.ts +9 -1
  18. package/dist/types/data/loaders/e-commerce/iros/getAllIros.d.ts +8 -1
  19. package/dist/types/data/loaders/logistics/getTableIpos.d.ts +9 -1
  20. package/dist/types/lib/utils.d.ts +10 -0
  21. package/package.json +1 -1
  22. package/src/app/page.tsx +2 -0
  23. package/src/components/common/EnhancedTable/EnhancedTable.tsx +11 -6
  24. package/src/components/common/EnhancedTable/EnhancedTableFilterRow.tsx +65 -36
  25. package/src/data/loaders/e-commerce/getAllCustomers.ts +16 -2
  26. package/src/data/loaders/e-commerce/getAllInvoices.ts +20 -3
  27. package/src/data/loaders/e-commerce/getAllOpos.ts +6 -1
  28. package/src/data/loaders/e-commerce/getSingleOpo.ts +1 -1
  29. package/src/data/loaders/e-commerce/getTableProducts.ts +14 -7
  30. package/src/data/loaders/e-commerce/iros/getAllIros.ts +10 -1
  31. package/src/data/loaders/logistics/getTableIpos.ts +13 -6
  32. package/src/lib/processFilters.ts +5 -1
  33. package/src/lib/utils.ts +10 -0
  34. package/.ai/action-patterns.md +0 -170
  35. package/.ai/form-patterns.instruction.md +0 -0
  36. package/.ai/form-patterns.md +0 -198
  37. package/.ai/form-patterns.prompt.md +0 -0
  38. package/.ai/instructions/form-patterns.instructions.md +0 -150
  39. package/.ai/prompts/form-patterns.prompt.md +0 -171
  40. package/.ai/prompts/update-form-and-actions.prompt.md +0 -20
  41. package/.vscode/settings.json +0 -7
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__exports as r}from"../../_virtual/index8.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
6
+ import{__exports as r}from"../../_virtual/index7.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
@@ -3,5 +3,5 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__exports as a}from"../../_virtual/index7.js";
6
+ import{__exports as a}from"../../_virtual/index8.js";
7
7
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var t;function o(){return t||(t=1,a.read=function(a,t,o,r,h){var M,e,i=8*h-r-1,p=(1<<i)-1,f=p>>1,n=-7,w=o?h-1:0,s=o?-1:1,u=a[t+w];for(w+=s,M=u&(1<<-n)-1,u>>=-n,n+=i;n>0;M=256*M+a[t+w],w+=s,n-=8);for(e=M&(1<<-n)-1,M>>=-n,n+=r;n>0;e=256*e+a[t+w],w+=s,n-=8);if(0===M)M=1-f;else{if(M===p)return e?NaN:1/0*(u?-1:1);e+=Math.pow(2,r),M-=f}return(u?-1:1)*e*Math.pow(2,M-r)},a.write=function(a,t,o,r,h,M){var e,i,p,f=8*M-h-1,n=(1<<f)-1,w=n>>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:M-1,N=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,e=n):(e=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-e))<1&&(e--,p*=2),(t+=e+w>=1?s/p:s*Math.pow(2,1-w))*p>=2&&(e++,p/=2),e+w>=n?(i=0,e=n):e+w>=1?(i=(t*p-1)*Math.pow(2,h),e+=w):(i=t*Math.pow(2,w-1)*Math.pow(2,h),e=0));h>=8;a[o+u]=255&i,u+=N,i/=256,h-=8);for(e=e<<h|i,f+=h;f>0;a[o+u]=255&e,u+=N,e/=256,f-=8);a[o+u-N]|=128*_}),a}export{o as __require};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__read as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import n,{useState as o,useEffect as l}from"react";import i from"@mui/material/Box";import a from"@mui/material/Table";import r from"@mui/material/TableBody";import c from"@mui/material/TableCell";import m from"@mui/material/TableContainer";import s from"@mui/material/TablePagination";import u from"@mui/material/TableRow";import d from"@mui/material/Paper";import f from"@mui/material/FormControlLabel";import g from"@mui/material/Switch";import h from"./EnhancedTableHead.js";import p from"./EnhancedTableToolbar.js";import b from"./EnhancedTableRow.js";import v from"./EnhancedTableFilterRow.js";import{useRouter as w,usePathname as S,useSearchParams as E}from"next/navigation";function C(C){var P,T,R,F,x=C.data,y=C.meta,j=C.headCells,k=C.subHeadCells,B=C.withSelection,H=C.title,L=C.subTitle,O=C.functions,U=C.selectFunctions,q=w().replace,z=S(),A=E(),D=e(o("asc"),2),I=D[0],W=D[1],_=e(o("id"),2),G=_[0],J=_[1],K=e(o([]),2),M=K[0],N=K[1],Q=e(o(0),2),V=Q[0],X=Q[1],Y=e(o(!1),2),Z=Y[0],$=Y[1],ee=e(o(5),2),te=ee[0],ne=ee[1],oe=e(o(!1),2),le=oe[0],ie=oe[1],ae=e(o((function(){var e=new URLSearchParams(null==A?void 0:A.toString()),t={};return j.forEach((function(n){if(n.filterable){var o=e.get("filter[".concat(n.id,"]"));o&&(t[n.id]=o)}})),t})),2),re=ae[0],ce=ae[1],me=j.some((function(e){return e.filterable})),se=function(e,t){var n=M.indexOf(t),o=[];-1===n?o=o.concat(M,t):0===n?o=o.concat(M.slice(1)):n===M.length-1?o=o.concat(M.slice(0,-1)):n>0&&(o=o.concat(M.slice(0,n),M.slice(n+1))),N(o)},ue=V+1===(null===(P=null==y?void 0:y.pagination)||void 0===P?void 0:P.pageCount)?(null===(T=null==y?void 0:y.pagination)||void 0===T?void 0:T.total)-(null===(R=null==y?void 0:y.pagination)||void 0===R?void 0:R.pageCount)*te:0;return l((function(){if(A){console.log("Search Params:",A.toString());var t=new URLSearchParams(A);console.log(t),I?t.set("order",I):t.delete("order"),G?t.set("orderBy",G):t.delete("orderBy"),V?t.set("page",V.toString()):t.delete("page"),te?t.set("rowsPerPage",te.toString()):t.delete("rowsPerPage"),Object.entries(re).forEach((function(n){var o=e(n,2),l=o[0],i=o[1];i?t.set("filter[".concat(l,"]"),i):t.delete("filter[".concat(l,"]"))})),q("".concat(z,"?").concat(t.toString()))}}),[I,G,V,te,re]),n.createElement(i,{sx:{width:"100%"}},n.createElement(d,{sx:{width:"100%",mb:2}},n.createElement(p,{selected:M,setSelected:N,title:H,functions:O,selectFunctions:U,showFilters:le,onToggleFilters:function(){return ie(!le)},hasFilterableColumns:me}),n.createElement(m,null,n.createElement(a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:Z?"small":"medium"},n.createElement(h,{numSelected:M.length,order:I,orderBy:G,onSelectAllClick:function(e){if(e.target.checked){var t=x.map((function(e){return e.id}));N(t)}else N([])},onRequestSort:function(e,t){W(G===t&&"asc"===I?"desc":"asc"),J(t)},rowCount:x.length,headCells:j,withSelection:B,withSubRows:!!k}),n.createElement(r,null,le&&n.createElement(v,{headCells:j,filters:re,onFilterChange:function(e,n){ce((function(o){var l;return t(t({},o),((l={})[e]=n,l))})),X(0)},withSelection:B,withSubRows:!!k}),x.map((function(e,t){return n.createElement(b,{key:e.id,row:e,headCells:j,subHeadCells:k,withSelection:B,isSelected:M.includes(e.id),handleSelectClick:se,subTitle:L})})),ue>0&&n.createElement(u,{style:{height:(Z?33:53)*ue}},n.createElement(c,{colSpan:j.length+(B?1:0)+(k?1:0)}))))),n.createElement(s,{rowsPerPageOptions:[5,10,25],component:"div",count:null===(F=null==y?void 0:y.pagination)||void 0===F?void 0:F.total,rowsPerPage:te,page:V,onPageChange:function(e,t){X(t)},onRowsPerPageChange:function(e){ne(parseInt(e.target.value,10)),X(0)}})),n.createElement(f,{control:n.createElement(g,{checked:Z,onChange:function(e){$(e.target.checked)}}),label:"Dense padding"}))}export{C as default};
6
+ import{__read as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import n,{useState as o,useEffect as i}from"react";import l from"@mui/material/Box";import r from"@mui/material/Table";import a from"@mui/material/TableBody";import c from"@mui/material/TableCell";import m from"@mui/material/TableContainer";import s from"@mui/material/TablePagination";import u from"@mui/material/TableRow";import d from"@mui/material/Paper";import f from"@mui/material/FormControlLabel";import h from"@mui/material/Switch";import g from"./EnhancedTableHead.js";import p from"./EnhancedTableToolbar.js";import w from"./EnhancedTableRow.js";import b from"./EnhancedTableFilterRow.js";import{useRouter as v,usePathname as E,useSearchParams as S}from"next/navigation";function C(C){var T,P,x,y,F=C.data,R=C.meta,j=C.headCells,k=C.subHeadCells,B=C.withSelection,H=C.title,L=C.subTitle,O=C.functions,q=C.selectFunctions,A=v().replace,U=E(),z=S(),D=e(o("asc"),2),I=D[0],W=D[1],X=e(o("id"),2),Y=X[0],_=X[1],G=e(o([]),2),J=G[0],K=G[1],M=e(o(0),2),N=M[0],Q=M[1],V=e(o(!1),2),Z=V[0],$=V[1],ee=e(o(5),2),te=ee[0],ne=ee[1],oe=e(o(!1),2),ie=oe[0],le=oe[1],re=e(o((function(){var e=new URLSearchParams(null==z?void 0:z.toString()),t={};return j.forEach((function(n){if(n.filterable){var o=e.get("filter[".concat(n.id,"]"));o&&(t[n.id]=o)}})),t})),2),ae=re[0],ce=re[1],me=j.some((function(e){return e.filterable})),se=function(e,t){var n=J.indexOf(t),o=[];-1===n?o=o.concat(J,t):0===n?o=o.concat(J.slice(1)):n===J.length-1?o=o.concat(J.slice(0,-1)):n>0&&(o=o.concat(J.slice(0,n),J.slice(n+1))),K(o)},ue=N+1===(null===(T=null==R?void 0:R.pagination)||void 0===T?void 0:T.pageCount)?(null===(P=null==R?void 0:R.pagination)||void 0===P?void 0:P.total)-(null===(x=null==R?void 0:R.pagination)||void 0===x?void 0:x.pageCount)*te:0;return i((function(){if(z){var t={x:window.scrollX,y:window.scrollY},n=new URLSearchParams(z);I?n.set("order",I):n.delete("order"),Y?n.set("orderBy",Y):n.delete("orderBy"),N?n.set("page",N.toString()):n.delete("page"),te?n.set("rowsPerPage",te.toString()):n.delete("rowsPerPage"),Object.entries(ae).forEach((function(t){var o=e(t,2),i=o[0],l=o[1];l?n.set("filter[".concat(i,"]"),l):n.delete("filter[".concat(i,"]"))})),A("".concat(U,"?").concat(n.toString()),{scroll:!1}),requestAnimationFrame((function(){window.scrollTo(t.x,t.y)}))}}),[I,Y,N,te,ae]),n.createElement(l,{sx:{width:"100%"}},n.createElement(d,{sx:{width:"100%",mb:2}},n.createElement(p,{selected:J,setSelected:K,title:H,functions:O,selectFunctions:q,showFilters:ie,onToggleFilters:function(){return le(!ie)},hasFilterableColumns:me}),n.createElement(m,null,n.createElement(r,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:Z?"small":"medium"},n.createElement(g,{numSelected:J.length,order:I,orderBy:Y,onSelectAllClick:function(e){if(e.target.checked){var t=F.map((function(e){return e.id}));K(t)}else K([])},onRequestSort:function(e,t){W(Y===t&&"asc"===I?"desc":"asc"),_(t)},rowCount:F.length,headCells:j,withSelection:B,withSubRows:!!k}),n.createElement(a,null,ie&&n.createElement(b,{headCells:j,filters:ae,onFilterChange:function(e,n){ce((function(o){var i;return t(t({},o),((i={})[e]=n,i))})),Q(0)},withSelection:B,withSubRows:!!k}),F.map((function(e,t){return n.createElement(w,{key:e.id,row:e,headCells:j,subHeadCells:k,withSelection:B,isSelected:J.includes(e.id),handleSelectClick:se,subTitle:L})})),ue>0&&n.createElement(u,{style:{height:(Z?33:53)*ue}},n.createElement(c,{colSpan:j.length+(B?1:0)+(k?1:0)}))))),n.createElement(s,{rowsPerPageOptions:[5,10,25],component:"div",count:null===(y=null==R?void 0:R.pagination)||void 0===y?void 0:y.total,rowsPerPage:te,page:N,onPageChange:function(e,t){Q(t)},onRowsPerPageChange:function(e){ne(parseInt(e.target.value,10)),Q(0)}})),n.createElement(f,{control:n.createElement(h,{checked:Z,onChange:function(e){$(e.target.checked)}}),label:"Dense padding"}))}export{C as default};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__read as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import l from"react";import r from"@mui/material/TableRow";import a from"@mui/material/TableCell";import n from"@mui/material/TextField";import i from"@mui/material/Select";import o from"@mui/material/MenuItem";import u from"@mui/material/Box";function m(m){var c=m.headCells,d=m.filters,f=m.onFilterChange,s=m.withSelection,p=m.withSubRows,v=e(l.useState(d),2),h=v[0],g=v[1],E=function(e,t){f(e,t)};return l.createElement(r,null,s&&l.createElement(a,{padding:"checkbox"}),p&&l.createElement(a,null),c.map((function(r){return l.createElement(a,{key:r.id,align:r.numeric?"right":"left",padding:r.disablePadding?"none":"normal"},r.filterable&&function(){var a,m=h[r.id]||"";switch(r.filterType){case"select":return l.createElement(i,{size:"small",value:m,onChange:function(e){var l=e.target.value;g((function(e){var a;return t(t({},e),((a={})[r.id]=l,a))})),E(r.id,l)},fullWidth:!0},l.createElement(o,{value:""},"All"),null===(a=r.filterOptions)||void 0===a?void 0:a.map((function(e){return l.createElement(o,{key:e,value:e},e)})));case"date":var c=e(m?m.split(","):["",""],2),d=c[0],f=c[1];return l.createElement(u,{sx:{display:"flex",gap:1}},l.createElement(n,{type:"date",size:"small",placeholder:"Start date",value:d,onChange:function(e){var l=[e.target.value,f].filter(Boolean).join(",");g((function(e){var a;return t(t({},e),((a={})[r.id]=l,a))})),E(r.id,l)},sx:{flex:1}}),l.createElement(n,{type:"date",size:"small",placeholder:"End date",value:f,onChange:function(e){var l=e.target.value,a=[d,l].filter(Boolean).join(",");g((function(e){var l;return t(t({},e),((l={})[r.id]=a,l))})),E(r.id,a)},sx:{flex:1}}));default:return l.createElement(n,{size:"small",placeholder:"Filter ".concat(r.label),value:m,onChange:function(e){return g((function(l){var a;return t(t({},l),((a={})[r.id]=e.target.value,a))}))},onBlur:function(){return E(r.id,m)},onKeyPress:function(e){"Enter"===e.key&&E(r.id,m)},fullWidth:!0})}}())})))}export{m as default};
6
+ import{__read as e,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import n from"react";import i from"@mui/material/TableRow";import r from"@mui/material/TableCell";import l from"@mui/material/TextField";import a from"@mui/material/Select";import o from"@mui/material/MenuItem";import u from"@mui/material/Box";import m from"@mui/material/Button";function c(c){var s=c.headCells,f=c.filters,d=c.onFilterChange,h=c.withSelection,p=c.withSubRows,v=e(n.useState(f),2),g=v[0],x=v[1],E=function(e,t){d(e,t)};return n.createElement(i,null,h&&n.createElement(r,{padding:"checkbox"}),p&&n.createElement(r,null),s.map((function(i){return n.createElement(r,{key:i.id,align:i.numeric?"right":"left",padding:i.disablePadding?"none":"normal"},i.filterable&&function(){var r,c=g[i.id]||"";switch(i.filterType){case"select":return n.createElement(a,{size:"small",value:c,onChange:function(e){return n=i.id,r=e.target.value,x((function(e){var i;return t(t({},e),((i={})[n]=r,i))})),void E(n,r);var n,r},fullWidth:!0,sx:{height:32}},n.createElement(o,{value:""},"All"),null===(r=i.filterOptions)||void 0===r?void 0:r.map((function(e){return n.createElement(o,{key:e,value:e},e)})));case"date":var s=e(c?c.split(","):["",""],2),f=s[0],d=s[1];return n.createElement(u,{sx:{display:"flex",alignItems:"center",gap:.5}},n.createElement(l,{type:"date",size:"small",InputProps:{sx:{height:32,fontSize:"0.875rem"}},value:f,onChange:function(e){return x((function(n){var r;return t(t({},n),((r={})[i.id]=[e.target.value,d].filter(Boolean).join(","),r))}))},sx:{width:130}}),n.createElement(l,{type:"date",size:"small",InputProps:{sx:{height:32,fontSize:"0.875rem"}},value:d,onChange:function(e){return x((function(n){var r;return t(t({},n),((r={})[i.id]=[f,e.target.value].filter(Boolean).join(","),r))}))},sx:{width:130}}),n.createElement(m,{size:"small",sx:{minWidth:32,height:32,px:.5},onClick:function(){x((function(e){var n;return t(t({},e),((n={})[i.id]="",n))})),E(i.id,"")}},"✕"),n.createElement(m,{size:"small",variant:"contained",sx:{minWidth:32,height:32,px:.5},onClick:function(){return E(i.id,g[i.id]||"")}},"✓"));default:return n.createElement(l,{size:"small",placeholder:"Filter ".concat(i.label),value:c,InputProps:{sx:{height:32,fontSize:"0.875rem"}},onChange:function(e){return x((function(n){var r;return t(t({},n),((r={})[i.id]=e.target.value,r))}))},onBlur:function(){return E(i.id,c)},onKeyDown:function(e){return"Enter"===e.key&&E(i.id,c)},fullWidth:!0})}}())})))}export{c as default};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as r,__generator as e}from"../../../../node_modules/tslib/tslib.es6.js";import i from"../../../../node_modules/qs/lib/index.js";import{fetchData as o}from"../loaders.js";import{getStrapiURL as t}from"../../../lib/utils.js";import{unstable_noStore as s}from"next/cache";var n=t();function a(t,a,c,m){return r(this,void 0,void 0,(function(){var r;return e(this,(function(e){switch(e.label){case 0:return s(),(r=new URL("/api/customer-profiles",n)).search=i.stringify({sort:"".concat(m||"id",":").concat(c||"desc"),pagination:{pageSize:a||10,page:t?t+1:1}}),[4,o(r.href)];case 1:return[2,e.sent()]}}))}))}export{a as getAllCustomers};
7
+ import{__awaiter as r,__generator as i,__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import o from"../../../../node_modules/qs/lib/index.js";import{fetchData as t}from"../loaders.js";import{getStrapiURL as s}from"../../../lib/utils.js";import{unstable_noStore as n}from"next/cache";import{processFilters as c}from"../../../lib/processFilters.js";var a=s();function m(s,m,l,f){return r(this,arguments,void 0,(function(r,s,m,l,f,p){var u,d;return void 0===p&&(p={}),i(this,(function(i){switch(i.label){case 0:return n(),u=new URL("/api/customer-profiles",a),d=c(p),u.search=o.stringify({filters:e({},d),sort:"".concat(l||"id",":").concat(m||"desc"),pagination:{pageSize:s||10,page:r?r+1:1}}),[4,t(u.href)];case 1:return[2,i.sent()]}}))}))}export{m as getAllCustomers};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as e,__generator as s}from"../../../../node_modules/tslib/tslib.es6.js";import i from"../../../../node_modules/qs/lib/index.js";import{fetchData as r}from"../loaders.js";import{getStrapiURL as t,flattenAttributes as o}from"../../../lib/utils.js";import{unstable_noStore as n}from"next/cache";var a=t();function c(t,c,l,m){return e(this,void 0,void 0,(function(){var e,d;return s(this,(function(s){switch(s.label){case 0:return n(),(e=new URL("/api/invoices",a)).search=i.stringify({sort:"".concat(m||"id",":").concat(l||"desc"),populate:{items:!0,admin_items:{populate:{price:!0}},seller_business_credentials:!0,seller_company_address:!0,buyer_company_address:!0,buyer_business_credentials:!0,customer:{fields:"customer_number"}},pagination:{pageSize:c||10,page:t?t+1:1}}),d=o,[4,r(e.href)];case 1:return[2,d.apply(void 0,[s.sent()])]}}))}))}export{c as getAllInvoices};
7
+ import{__awaiter as e,__generator as s,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import i from"../../../../node_modules/qs/lib/index.js";import{fetchData as t}from"../loaders.js";import{getStrapiURL as o,flattenAttributes as n}from"../../../lib/utils.js";import{unstable_noStore as a}from"next/cache";import{processFilters as c}from"../../../lib/processFilters.js";var l=o();function m(o,m,p,d){return e(this,arguments,void 0,(function(e,o,m,p,d,u){var f,_,b;return void 0===u&&(u={}),s(this,(function(s){switch(s.label){case 0:return a(),f=new URL("/api/invoices",l),_=c(u),f.search=i.stringify({filters:r({},_),sort:"".concat(p||"id",":").concat(m||"desc"),populate:{items:!0,admin_items:{populate:{price:!0}},seller_business_credentials:!0,seller_company_address:!0,buyer_company_address:!0,buyer_business_credentials:!0,customer:{fields:"customer_number"}},pagination:{pageSize:o||10,page:e?e+1:1}}),b=n,[4,t(f.href)];case 1:return[2,b.apply(void 0,[s.sent()])]}}))}))}export{m as getAllInvoices};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as e,__generator as o,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"../../../../node_modules/qs/lib/index.js";import{fetchData as s}from"../loaders.js";import{getStrapiURL as p}from"../../../lib/utils.js";import{unstable_noStore as i}from"next/cache";var a=p();function u(p,u){return e(this,void 0,void 0,(function(){var e;return o(this,(function(o){switch(o.label){case 0:return i(),(e=new URL("/api/opos/".concat(p),a)).search=r.stringify({populate:{opo_items:{populate:{product:{populate:{price:!0,image:!0}},picked_reports:!0,packed_reports:!0,shipped_reports:!0,reports:{populate:{author:!0}}}},customer:{populate:["business_credentials"]},notes:{populate:{author:{populate:!0}}}},filters:t({},u)}),[4,s(e.href)];case 1:return[2,o.sent()]}}))}))}export{u as getSingleOpo};
7
+ import{__awaiter as e,__generator as o,__assign as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"../../../../node_modules/qs/lib/index.js";import{fetchData as s}from"../loaders.js";import{getStrapiURL as p}from"../../../lib/utils.js";import{unstable_noStore as i}from"next/cache";var a=p();function u(p){return e(this,arguments,void 0,(function(e,p){var u;return void 0===p&&(p={}),o(this,(function(o){switch(o.label){case 0:return i(),(u=new URL("/api/opos/".concat(e),a)).search=r.stringify({populate:{opo_items:{populate:{product:{populate:{price:!0,image:!0}},picked_reports:!0,packed_reports:!0,shipped_reports:!0,reports:{populate:{author:!0}}}},customer:{populate:["business_credentials"]},notes:{populate:{author:{populate:!0}}}},filters:t({},p)}),[4,s(u.href)];case 1:return[2,o.sent()]}}))}))}export{u as getSingleOpo};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as i,__generator as r}from"../../../../node_modules/tslib/tslib.es6.js";import e from"../../../../node_modules/qs/lib/index.js";import{fetchData as t}from"../loaders.js";import{getStrapiURL as o}from"../../../lib/utils.js";import{unstable_noStore as s}from"next/cache";var n=o();function a(o,a,c,p,l){return i(this,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return s(),(i=new URL("/api/products",n)).search=e.stringify({filters:{is_archive:{$in:l}},sort:"".concat(p||"id",":").concat(c||"desc"),populate:{price:!0},pagination:{pageSize:a||10,page:o?o+1:1}}),[4,t(i.href)];case 1:return[2,r.sent()]}}))}))}export{a as getTableProducts};
7
+ import{__awaiter as i,__generator as r,__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import o from"../../../../node_modules/qs/lib/index.js";import{fetchData as t}from"../loaders.js";import{getStrapiURL as s}from"../../../lib/utils.js";import{unstable_noStore as n}from"next/cache";import{processFilters as c}from"../../../lib/processFilters.js";var a=s();function p(s,p,l,m){return i(this,arguments,void 0,(function(i,s,p,l,m,d){var f,u;return void 0===m&&(m=[!1]),void 0===d&&(d={}),r(this,(function(r){switch(r.label){case 0:return n(),f=new URL("/api/products",a),u=c(d),f.search=o.stringify({filters:e({is_archive:{$in:m}},u),sort:"".concat(l||"id",":").concat(p||"desc"),populate:{price:!0},pagination:{pageSize:s||10,page:i?i+1:1}}),[4,t(f.href)];case 1:return[2,r.sent()]}}))}))}export{p as getTableProducts};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as e,__generator as s}from"../../../../../node_modules/tslib/tslib.es6.js";import r from"../../../../../node_modules/qs/lib/index.js";import{fetchData as i}from"../../loaders.js";import{getStrapiURL as o}from"../../../../lib/utils.js";import{unstable_noStore as t}from"next/cache";import{getUserRole as n}from"../../../services/get-user-me-loader.js";var a=o();function d(o,d,l,u,p){return e(this,void 0,void 0,(function(){var e,c,m,_,b,v;return s(this,(function(s){switch(s.label){case 0:return t(),[4,n()];case 1:return e=s.sent(),c=null===(v=null===(b=null==e?void 0:e.data)||void 0===b?void 0:b.role)||void 0===v?void 0:v.type,m="enduser"===c,(_=new URL("/api/iros",a)).search=r.stringify({filters:{is_archive:{$in:p}},sort:"".concat(u||"id",":").concat(l||"desc"),populate:{iro_items:{populate:{product:{populate:{price:!0}},reports:!0}},customer:!!m&&{populate:{company_address:!0,delivery_address:!0,billing_address:!0,business_credentials:!0}},invoice:{populate:{seller_business_credentials:!0,seller_company_address:!0,buyer_company_address:!0,buyer_delivery_address:!0,buyer_billing_address:!0,buyer_business_credentials:!0,items:!0,admin_items:!0}}},pagination:{pageSize:d||10,page:o?o+1:1}}),[4,i(_.href)];case 2:return[2,s.sent()]}}))}))}export{d as getAllIros};
7
+ import{__awaiter as e,__generator as s,__assign as r}from"../../../../../node_modules/tslib/tslib.es6.js";import i from"../../../../../node_modules/qs/lib/index.js";import{fetchData as o}from"../../loaders.js";import{getStrapiURL as t}from"../../../../lib/utils.js";import{unstable_noStore as n}from"next/cache";import{getUserRole as d}from"../../../services/get-user-me-loader.js";import{processFilters as a}from"../../../../lib/processFilters.js";var l=t();function p(t,p,u,c){return e(this,arguments,void 0,(function(e,t,p,u,c,m){var _,b,v,f,y,g,h;return void 0===c&&(c=[!1]),void 0===m&&(m={}),s(this,(function(s){switch(s.label){case 0:return n(),[4,d()];case 1:return _=s.sent(),b=null===(h=null===(g=null==_?void 0:_.data)||void 0===g?void 0:g.role)||void 0===h?void 0:h.type,v="enduser"===b,f=new URL("/api/iros",l),y=a(m),f.search=i.stringify({filters:r({is_archive:{$in:c}},y),sort:"".concat(u||"id",":").concat(p||"desc"),populate:{iro_items:{populate:{product:{populate:{price:!0}},reports:!0}},customer:!!v&&{populate:{company_address:!0,delivery_address:!0,billing_address:!0,business_credentials:!0}},invoice:{populate:{seller_business_credentials:!0,seller_company_address:!0,buyer_company_address:!0,buyer_delivery_address:!0,buyer_billing_address:!0,buyer_business_credentials:!0,items:!0,admin_items:!0}}},pagination:{pageSize:t||10,page:e?e+1:1}}),[4,o(f.href)];case 2:return[2,s.sent()]}}))}))}export{p as getAllIros};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__awaiter as e,__generator as r}from"../../../../node_modules/tslib/tslib.es6.js";import i from"../../../../node_modules/qs/lib/index.js";import{fetchData as t}from"../loaders.js";import{getStrapiURL as o}from"../../../lib/utils.js";import{unstable_noStore as s}from"next/cache";import{getUserRole as n}from"../../services/get-user-me-loader.js";var l=o();function a(o,a,u,d,p){return e(this,void 0,void 0,(function(){var e,c,m,f;return r(this,(function(r){switch(r.label){case 0:return s(),[4,n()];case 1:return e=r.sent(),null===(f=null===(m=null==e?void 0:e.data)||void 0===m?void 0:m.role)||void 0===f||f.type,(c=new URL("/api/ipos",l)).search=i.stringify({filters:{is_archive:{$in:p}},sort:"".concat(d||"id",":").concat(u||"desc"),populate:{vendor_profile:{fields:["vendor_number","website_url"],populate:{business_credentials:{fields:"company_name"}}},items:{populate:{product:{fields:["title","product_number","external_product_number"]},reports:!0}}},pagination:{pageSize:a||10,page:o?o+1:1}}),[4,t(c.href)];case 2:return[2,r.sent()]}}))}))}export{a as getTableIpos};
7
+ import{__awaiter as e,__generator as r,__assign as i}from"../../../../node_modules/tslib/tslib.es6.js";import o from"../../../../node_modules/qs/lib/index.js";import{fetchData as t}from"../loaders.js";import{getStrapiURL as s}from"../../../lib/utils.js";import{unstable_noStore as n}from"next/cache";import{getUserRole as l}from"../../services/get-user-me-loader.js";import{processFilters as a}from"../../../lib/processFilters.js";var p=s();function d(s,d,u,c){return e(this,arguments,void 0,(function(e,s,d,u,c,m){var f,v,b,_,h;return void 0===c&&(c=[!1]),void 0===m&&(m={}),r(this,(function(r){switch(r.label){case 0:return n(),[4,l()];case 1:return f=r.sent(),null===(h=null===(_=null==f?void 0:f.data)||void 0===_?void 0:_.role)||void 0===h||h.type,v=new URL("/api/ipos",p),b=a(m),v.search=o.stringify({filters:i({is_archive:{$in:c}},b),sort:"".concat(u||"id",":").concat(d||"desc"),populate:{vendor_profile:{fields:["vendor_number","website_url"],populate:{business_credentials:{fields:"company_name"}}},items:{populate:{product:{fields:["title","product_number","external_product_number"]},reports:!0}}},pagination:{pageSize:s||10,page:e?e+1:1}}),[4,t(v.href)];case 2:return[2,r.sent()]}}))}))}export{d as getTableIpos};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import{__read as e}from"../../node_modules/tslib/tslib.es6.js";function t(t){return Object.entries(t).reduce((function(t,r){var i=e(r,2),n=i[0],s=i[1];if(!s)return t;if(s.includes(",")){var l=e(s.split(","),2),o=l[0],u=l[1];o&&u?t[n]={$gte:o,$lte:u}:o?t[n]={$gte:o}:u&&(t[n]={$lte:u})}else t[n]={$containsi:s};return t}),{})}export{t as processFilters};
6
+ import{__read as e}from"../../node_modules/tslib/tslib.es6.js";function t(t){return Object.entries(t).reduce((function(t,r){var i=e(r,2),n=i[0],s=i[1];if(!s)return t;if(s.includes(",")){var l=e(s.split(","),2),u=l[0],c=l[1];u&&c?t[n]={$gte:u,$lte:c}:u?t[n]={$gte:u}:c&&(t[n]={$lte:c})}else{var o=s.includes(" ")?s.replace(/\s+/g,"_"):s;t[n]={$containsi:o}}return t}),{})}export{t as processFilters};