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.
- package/dist/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/ieee754/index.js +1 -1
- package/dist/src/components/common/EnhancedTable/EnhancedTable.js +1 -1
- package/dist/src/components/common/EnhancedTable/EnhancedTableFilterRow.js +1 -1
- package/dist/src/data/loaders/e-commerce/getAllCustomers.js +1 -1
- package/dist/src/data/loaders/e-commerce/getAllInvoices.js +1 -1
- package/dist/src/data/loaders/e-commerce/getSingleOpo.js +1 -1
- package/dist/src/data/loaders/e-commerce/getTableProducts.js +1 -1
- package/dist/src/data/loaders/e-commerce/iros/getAllIros.js +1 -1
- package/dist/src/data/loaders/logistics/getTableIpos.js +1 -1
- package/dist/src/lib/processFilters.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/data/loaders/e-commerce/getAllCustomers.d.ts +5 -1
- package/dist/types/data/loaders/e-commerce/getAllInvoices.d.ts +9 -1
- package/dist/types/data/loaders/e-commerce/getAllOpos.d.ts +5 -1
- package/dist/types/data/loaders/e-commerce/getSingleOpo.d.ts +1 -1
- package/dist/types/data/loaders/e-commerce/getTableProducts.d.ts +9 -1
- package/dist/types/data/loaders/e-commerce/iros/getAllIros.d.ts +8 -1
- package/dist/types/data/loaders/logistics/getTableIpos.d.ts +9 -1
- package/dist/types/lib/utils.d.ts +10 -0
- package/package.json +1 -1
- package/src/app/page.tsx +2 -0
- package/src/components/common/EnhancedTable/EnhancedTable.tsx +11 -6
- package/src/components/common/EnhancedTable/EnhancedTableFilterRow.tsx +65 -36
- package/src/data/loaders/e-commerce/getAllCustomers.ts +16 -2
- package/src/data/loaders/e-commerce/getAllInvoices.ts +20 -3
- package/src/data/loaders/e-commerce/getAllOpos.ts +6 -1
- package/src/data/loaders/e-commerce/getSingleOpo.ts +1 -1
- package/src/data/loaders/e-commerce/getTableProducts.ts +14 -7
- package/src/data/loaders/e-commerce/iros/getAllIros.ts +10 -1
- package/src/data/loaders/logistics/getTableIpos.ts +13 -6
- package/src/lib/processFilters.ts +5 -1
- package/src/lib/utils.ts +10 -0
- package/.ai/action-patterns.md +0 -170
- package/.ai/form-patterns.instruction.md +0 -0
- package/.ai/form-patterns.md +0 -198
- package/.ai/form-patterns.prompt.md +0 -0
- package/.ai/instructions/form-patterns.instructions.md +0 -150
- package/.ai/prompts/form-patterns.prompt.md +0 -171
- package/.ai/prompts/update-form-and-actions.prompt.md +0 -20
- 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/
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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),
|
|
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};
|