umwd-components 0.1.558 → 0.1.560
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/auth/SigninForm.js +1 -1
- package/dist/src/components/common/cookie-consent/CookieConsentBanner.js +1 -1
- package/dist/src/components/e-commerce/cart/AddToCartButton.client.js +1 -1
- package/dist/src/components/e-commerce/products/ProductCard.js +1 -1
- package/dist/src/components/e-commerce/products/SingleProduct.js +1 -1
- package/dist/src/components/logistics/ipo/IPOItemFields.js +1 -1
- package/dist/src/components/logistics/ipo/ManageIPOForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/auth/SigninForm.d.ts +1 -0
- package/dist/types/components/e-commerce/products/ProductCard.d.ts +2 -2
- package/dist/types/components/e-commerce/products/ProductCategoryCard.d.ts +2 -2
- package/dist/types/components/page-elements/CategoryBlock.d.ts +2 -2
- package/dist/types/types/e-commerce/cart/types.d.ts +1 -0
- package/dist/types/types/logistics/Ipo.d.ts +0 -1
- package/package.json +1 -1
- package/src/components/auth/SigninForm.tsx +31 -10
- package/src/components/common/cookie-consent/CookieConsentBanner.tsx +7 -12
- package/src/components/e-commerce/cart/AddToCartButton.client.tsx +8 -0
- package/src/components/e-commerce/products/ProductCard.tsx +17 -4
- package/src/components/e-commerce/products/ProductCategoryCard.tsx +2 -2
- package/src/components/e-commerce/products/SingleProduct.tsx +1 -0
- package/src/components/logistics/ipo/IPOItemFields.tsx +21 -10
- package/src/components/logistics/ipo/ManageIPOForm.tsx +1 -1
- package/src/components/page-elements/CategoryBlock.tsx +3 -3
- package/src/types/e-commerce/cart/types.ts +1 -0
- package/src/types/logistics/Ipo.ts +1 -1
|
@@ -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};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
7
|
+
import{__read as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import o from"react";import t from"next/link";import{StyledLink as i}from"../StyledLink.js";import{useFormState as a}from"react-dom";import{loginUserAction as n}from"../../data/actions/auth-actions.js";import{setOpacity as l}from"../../lib/utils.js";import m from"@mui/material/CardHeader";import s from"@mui/material/CardContent";import d from"@mui/material/CardActions";import c from"@mui/material/Card";import u from"@mui/material/TextField";import p from"@mui/material/Stack";import f from"@mui/material/Container";import v from"@mui/material/Typography";import{SubmitButton as g}from"../SubmitButton.js";import{StrapiErrors as E}from"../StrapiErrors.js";import{useTheme as b}from"@mui/material/styles";import{useCookieConsent as x}from"../common/cookie-consent/CookieConsentContext.js";import y from"../common/cookie-consent/CookieConsentButton.js";import h from"@mui/material/Paper";import k from"@mui/icons-material/Cookie";var C={zodErrors:null,strapiErrors:null,data:null,message:null};function w(w){var j,S,z,T,_=w.data,F=_.title,P=void 0===F?"Sign In":F,W=_.subtitle,B=void 0===W?"Enter your details to sign in to your account":W,G=_.maxWidth,I=void 0===G?"lg":G,L=_.sx,Y=void 0===L?{}:L,A=_.glass,D=void 0!==A&&A,H=_.registration_url,R=void 0===H?"/signup":H,U=_.redirect_url,q=void 0===U?"/":U,J=_.forgot_password_url,K=void 0===J?"/forgot-password":J,M=_.dashboard,N=void 0!==M&&M,O=e(a(n,C),2),Q=O[0],V=O[1],X=b();return!1===(N?{consentGiven:!0}:x()).consentGiven?o.createElement(f,{maxWidth:I||"lg",sx:r({my:1},Y)},o.createElement(h,{sx:{backdropFilter:"blur(3px)",backgroundColor:l(X.palette.background.paper,D?.1:1),border:D?"1px solid rgba(255, 255, 255, 0.15)":"none",p:2}},o.createElement(p,{direction:"column",spacing:2},o.createElement(v,{variant:"body1"},"You need to accept cookies to sign in. To learn more about our use of cookies, view our"," ",o.createElement(i,{href:"/privacy-policy",target:"_self",sx:{fontWeight:"bold",color:"primary.main"}}," ","Privacy Policy."," ")," ","You can also manage your cookie settings at any time using the cookie ",o.createElement(k,{fontSize:"inherit"})," icon in the footer."),o.createElement(y,null)))):o.createElement(f,{maxWidth:I||"lg",sx:r({my:1},Y)},o.createElement("form",{action:V},o.createElement("input",{type:"hidden",name:"redirect",value:q}),o.createElement(c,{sx:{backdropFilter:"blur(3px)",backgroundColor:l(X.palette.background.paper,D?.1:1),border:D?"1px solid rgba(255, 255, 255, 0.15)":"none"}},o.createElement(m,{title:P,subheader:B}),o.createElement(s,null,o.createElement(p,{spacing:2},o.createElement(u,{id:"identifier",name:"identifier",label:"identifier",variant:"outlined",error:null!=(null===(j=null==Q?void 0:Q.zodErrors)||void 0===j?void 0:j.identifier),helperText:null===(S=null==Q?void 0:Q.zodErrors)||void 0===S?void 0:S.identifier}),o.createElement(u,{id:"password",name:"password",label:"password",type:"password",variant:"outlined",error:null!=(null===(z=null==Q?void 0:Q.zodErrors)||void 0===z?void 0:z.password),helperText:null===(T=null==Q?void 0:Q.zodErrors)||void 0===T?void 0:T.password}))),o.createElement(d,null,o.createElement(g,{text:"Sign In",loadingText:"Loading"}),o.createElement(E,{error:null==Q?void 0:Q.strapiErrors}),Q.message&&o.createElement(v,{sx:{pt:2},variant:"body2",color:"error"},Q.message))),!1===N&&o.createElement(o.Fragment,null,o.createElement(v,{sx:{pt:2},variant:"body2"},"Don't have an account?"),o.createElement(t,{href:R},"Sign Up"),o.createElement(v,{sx:{pt:2},variant:"body2"},"Forgot your password?"),o.createElement(t,{href:K},"Reset Password"))))}export{w as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import e from"react";import{useCookieConsent as t}from"./CookieConsentContext.js";import
|
|
7
|
+
import e from"react";import{useCookieConsent as t}from"./CookieConsentContext.js";import o from"@mui/material/Snackbar";import i from"@mui/material/Paper";import r from"@mui/material/Stack";import n from"@mui/material/Button";import a from"@mui/material/Typography";import m from"@mui/material/Link";import c from"@mui/icons-material/Cookie";var l=function(){var l=t(),u=l.consentGiven,s=l.giveConsent,p=l.declineConsent;return null!==u?null:e.createElement(o,{open:!0,anchorOrigin:{vertical:"bottom",horizontal:"center"},onClose:function(){},sx:{width:"90%"}},e.createElement(i,{sx:{p:2,width:"100%"}},e.createElement(r,{direction:"column",spacing:2},e.createElement(a,{variant:"body1"},"This website uses cookies to ensure you get the best experience on our website.To learn more about our use of cookies, view our"," ",e.createElement(m,{href:"/privacy-policy",color:"inherit",underline:"hover",sx:{fontWeight:"bold",color:"primary.main"}}," ","Privacy Policy."," ")," ","You can also manage your cookie settings at any time using the cookie ",e.createElement(c,{fontSize:"inherit"})," icon in the footer."),e.createElement(r,{direction:"row",spacing:2,justifyContent:"flex-end"},e.createElement(n,{variant:"outlined",onClick:p},"I Decline"),e.createElement(n,{variant:"contained",onClick:s},"I Accept")))))};export{l as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import t from"react";import
|
|
7
|
+
import t from"react";import a from"@mui/material/Button";import{useCart as e}from"../../../context/e-commerce/cart/CartContext.js";var o=function(o){var r=o.product,n=e().dispatch;return 0===r.stock?t.createElement(a,{size:"small",variant:"contained",disabled:!0},"Out of Stock"):t.createElement(a,{size:"small",variant:"contained",onClick:function(){n({type:"ADD_ITEM",payload:r})}},"Add to Card")};export{o as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__spreadArray as t,__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r from"react";import i from"@mui/material/Box";import a from"@mui/material/Card";import o from"@mui/material/CardActions";import m from"@mui/material/CardContent";import l from"@mui/material/CardMedia";import n from"@mui/material/Button";import c from"@mui/material/Typography";import u from"@mui/material/Stack";import p from"./Price.js";import{getStrapiMedia as s}from"../../../lib/utils.js";import{StyledLink as d}from"../../StyledLink.js";import f from"../cart/AddToCartButton.client.js";import v from"../../common/markdown/MarkdownDisplay.js";function _(_){var x,h,E=_.product,y=_.sx,b=void 0===y?[]:y,g=E.id,j=E.uuid,C=E.product_number,
|
|
6
|
+
import{__spreadArray as t,__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r from"react";import i from"@mui/material/Box";import a from"@mui/material/Card";import o from"@mui/material/CardActions";import m from"@mui/material/CardContent";import l from"@mui/material/CardMedia";import n from"@mui/material/Button";import c from"@mui/material/Typography";import u from"@mui/material/Stack";import p from"./Price.js";import{getStrapiMedia as s}from"../../../lib/utils.js";import{StyledLink as d}from"../../StyledLink.js";import f from"../cart/AddToCartButton.client.js";import v from"../../common/markdown/MarkdownDisplay.js";function _(_){var x,h,E=_.product,y=_.sx,b=void 0===y?[]:y,g=E.id,j=E.uuid,C=E.product_number,k=E.title,w=E.description,A=E.slug,B=E.price,M=E.image,T=E.stock,D=s(null==M?void 0:M.url),L=s(null===(h=null===(x=null==M?void 0:M.formats)||void 0===x?void 0:x.thumbnail)||void 0===h?void 0:h.url);return r.createElement(a,{sx:t([{width:"100%",height:"100%"},{display:"flex",flexDirection:"column"}],e(Array.isArray(b)?b:[b]),!1)},r.createElement(l,{component:"img",height:"140",src:"".concat(D),alt:M.alternativeText}),r.createElement(m,null,r.createElement(u,{direction:"row",justifyContent:"space-between",sx:{pb:2}},r.createElement(d,{href:"/shop/".concat(A),target:"_self"},r.createElement(c,{variant:"h5"},k)),r.createElement(p,{id:g,price:B.price,vat:B.vat,vat_rate:B.vat_rate,price_incl_vat:B.price_incl_vat})),w&&r.createElement(v,null,w.substring(0,150)+"...")),r.createElement(i,{sx:{flexGrow:1}}),r.createElement(o,{sx:{display:"flex",justifyContent:"flex-end"}},r.createElement(n,{size:"small",href:"/shop/".concat(A)},"Learn More"),r.createElement(f,{product:{id:g,uuid:j,slug:A,thumb:L,title:k,vat_rate:B.vat_rate,price_excl_vat:B.price,price_incl_vat:B.price_incl_vat,quantity:1,product_number:C,stock:T}})))}export{_ as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import e,{Suspense as t}from"react";import l from"@mui/material/Box";import r from"@mui/material/Button";import i from"@mui/material/Typography";import a from"@mui/material/Stack";import n from"@mui/material/Grid";import m from"@mui/material/Paper";import{getStrapiMedia as o}from"../../../lib/utils.js";import c from"next/link";import{StrapiImage as u}from"../../StrapiImage.js";import d from"../cart/AddToCartButton.client.js";import s from"../../common/markdown/MarkdownDisplay.js";function p(p){var v,g,E,x,f=p.product;p.sx;var h=f.id,y=f.uuid,_=f.product_number,b=f.title,k=f.description,T=f.slug,j=f.price,w=f.image;f.gallery;var B=f.categories,F=f.stock,C=(null==w?void 0:w.url)?o(w.url):null,A=(null===(g=null===(v=null==w?void 0:w.formats)||void 0===v?void 0:v.thumbnail)||void 0===g?void 0:g.url)?o(w.formats.thumbnail.url):null;return e.createElement(e.Fragment,null,e.createElement(n,{container:!0,spacing:2,sx:{py:3,minHeight:"60vh"}},e.createElement(n,{item:!0,xs:12,sm:12,md:12,lg:12,xl:12},e.createElement(i,{variant:"h4",align:"left",component:"h1"},b)),e.createElement(n,{item:!0,xs:12,sm:8,md:9,lg:4,xl:4},e.createElement(s,null,k)),e.createElement(n,{item:!0,xs:12,sm:4,md:3,lg:3,xl:3},(null==j?void 0:j.price)&&e.createElement(m,{sx:{p:1}},e.createElement(a,{spacing:1},e.createElement(i,{variant:"body2"},"Price excl. VAT € ",j.price.toFixed(2)),j.price_incl_vat&&e.createElement(i,{variant:"body2",sx:{fontWeight:600}},"Price incl. VAT € ",j.price_incl_vat.toFixed(2)),e.createElement(i,{variant:"body2",sx:{fontWeight:600,color:0===F?"red":"white"},align:"right"},F," items in stock"),e.createElement(d,{product:{id:h,uuid:y,slug:T,thumb:A,title:b,vat_rate:j.vat_rate,quantity:1,price_excl_vat:j.price,price_incl_vat:j.price_incl_vat,product_number:_}})))),e.createElement(n,{item:!0,xs:12,sm:12,md:6,lg:5,xl:5},null!==C&&e.createElement(l,{sx:{height:"400px",width:"100%",position:"relative"}},e.createElement(t,{fallback:e.createElement("div",null,"Loading...")},e.createElement(u,{id:w.id,url:C,alternativeText:w.alternativeText,fill:!0,style:{objectFit:"contain"}})))),e.createElement(n,{item:!0,xs:12,sm:12,md:6,lg:7,xl:7},e.createElement(n,{container:!0,spacing:2},e.createElement(n,{item:!0,xs:12},e.createElement(i,{variant:"h6"},"Image gallery")),e.createElement(n,{item:!0,xs:12},e.createElement(t,{fallback:e.createElement("div",null,"Loading...")},e.createElement(a,{spacing:1,direction:"row"},(null===(E=null==f?void 0:f.gallery)||void 0===E?void 0:E.data)&&f.gallery.data.map((function(t){var r=(null==t?void 0:t.url)?o(t.url):null;return e.createElement(l,{key:t.id,sx:{width:" 150px",height:"150px",position:"relative"}},null!==r&&e.createElement(u,{id:t.id,url:r,alternativeText:t.alternativeText,fill:!0,style:{objectFit:"contain"}}))}))))),e.createElement(n,{item:!0,xs:12,md:6},(null==B?void 0:B.data)&&e.createElement(a,{justifyContent:"center",alignItems:"center",direction:1===B.data.length?"row":"column"},1===B.data.length?e.createElement(i,null,"Category:"):e.createElement(i,null,"Categories:"),null===(x=B.data)||void 0===x?void 0:x.map((function(t){return e.createElement(c,{href:"/shop/categories/".concat(t.slug),key:t.id,legacyBehavior:!0},e.createElement(r,{variant:"text"},t.slug))})))),e.createElement(n,{item:!0,xs:12,md:6},e.createElement(a,null,e.createElement(c,{href:"/shop",legacyBehavior:!0},e.createElement(r,{variant:"outlined"},"continue shopping"))))))))}export{p as default};
|
|
6
|
+
import e,{Suspense as t}from"react";import l from"@mui/material/Box";import r from"@mui/material/Button";import i from"@mui/material/Typography";import a from"@mui/material/Stack";import n from"@mui/material/Grid";import m from"@mui/material/Paper";import{getStrapiMedia as o}from"../../../lib/utils.js";import c from"next/link";import{StrapiImage as u}from"../../StrapiImage.js";import d from"../cart/AddToCartButton.client.js";import s from"../../common/markdown/MarkdownDisplay.js";function p(p){var v,g,E,x,f=p.product;p.sx;var h=f.id,y=f.uuid,_=f.product_number,b=f.title,k=f.description,T=f.slug,j=f.price,w=f.image;f.gallery;var B=f.categories,F=f.stock,C=(null==w?void 0:w.url)?o(w.url):null,A=(null===(g=null===(v=null==w?void 0:w.formats)||void 0===v?void 0:v.thumbnail)||void 0===g?void 0:g.url)?o(w.formats.thumbnail.url):null;return e.createElement(e.Fragment,null,e.createElement(n,{container:!0,spacing:2,sx:{py:3,minHeight:"60vh"}},e.createElement(n,{item:!0,xs:12,sm:12,md:12,lg:12,xl:12},e.createElement(i,{variant:"h4",align:"left",component:"h1"},b)),e.createElement(n,{item:!0,xs:12,sm:8,md:9,lg:4,xl:4},e.createElement(s,null,k)),e.createElement(n,{item:!0,xs:12,sm:4,md:3,lg:3,xl:3},(null==j?void 0:j.price)&&e.createElement(m,{sx:{p:1}},e.createElement(a,{spacing:1},e.createElement(i,{variant:"body2"},"Price excl. VAT € ",j.price.toFixed(2)),j.price_incl_vat&&e.createElement(i,{variant:"body2",sx:{fontWeight:600}},"Price incl. VAT € ",j.price_incl_vat.toFixed(2)),e.createElement(i,{variant:"body2",sx:{fontWeight:600,color:0===F?"red":"white"},align:"right"},F," items in stock"),e.createElement(d,{product:{id:h,uuid:y,slug:T,thumb:A,title:b,vat_rate:j.vat_rate,quantity:1,price_excl_vat:j.price,price_incl_vat:j.price_incl_vat,product_number:_,stock:F}})))),e.createElement(n,{item:!0,xs:12,sm:12,md:6,lg:5,xl:5},null!==C&&e.createElement(l,{sx:{height:"400px",width:"100%",position:"relative"}},e.createElement(t,{fallback:e.createElement("div",null,"Loading...")},e.createElement(u,{id:w.id,url:C,alternativeText:w.alternativeText,fill:!0,style:{objectFit:"contain"}})))),e.createElement(n,{item:!0,xs:12,sm:12,md:6,lg:7,xl:7},e.createElement(n,{container:!0,spacing:2},e.createElement(n,{item:!0,xs:12},e.createElement(i,{variant:"h6"},"Image gallery")),e.createElement(n,{item:!0,xs:12},e.createElement(t,{fallback:e.createElement("div",null,"Loading...")},e.createElement(a,{spacing:1,direction:"row"},(null===(E=null==f?void 0:f.gallery)||void 0===E?void 0:E.data)&&f.gallery.data.map((function(t){var r=(null==t?void 0:t.url)?o(t.url):null;return e.createElement(l,{key:t.id,sx:{width:" 150px",height:"150px",position:"relative"}},null!==r&&e.createElement(u,{id:t.id,url:r,alternativeText:t.alternativeText,fill:!0,style:{objectFit:"contain"}}))}))))),e.createElement(n,{item:!0,xs:12,md:6},(null==B?void 0:B.data)&&e.createElement(a,{justifyContent:"center",alignItems:"center",direction:1===B.data.length?"row":"column"},1===B.data.length?e.createElement(i,null,"Category:"):e.createElement(i,null,"Categories:"),null===(x=B.data)||void 0===x?void 0:x.map((function(t){return e.createElement(c,{href:"/shop/categories/".concat(t.slug),key:t.id,legacyBehavior:!0},e.createElement(r,{variant:"text"},t.slug))})))),e.createElement(n,{item:!0,xs:12,md:6},e.createElement(a,null,e.createElement(c,{href:"/shop",legacyBehavior:!0},e.createElement(r,{variant:"outlined"},"continue shopping"))))))))}export{p as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import l,{useState as r,useEffect as n}from"react";import a from"@mui/material/Table";import o from"@mui/material/TableHead";import i from"@mui/material/TableBody";import m from"@mui/material/TableCell";import u from"@mui/material/TableRow";import
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import l,{useState as r,useEffect as n}from"react";import a from"@mui/material/Table";import o from"@mui/material/TableHead";import i from"@mui/material/TableBody";import m from"@mui/material/TableCell";import u from"@mui/material/TableRow";import c from"@mui/material/IconButton";import d from"@mui/icons-material/Add";import s from"@mui/material/Typography";import p from"@mui/material/Stack";import f from"@mui/material/TextField";import b from"../../e-commerce/products/ProductSelector.js";import h from"../../common/WeekPicker.js";import E from"../../../../node_modules/dayjs/dayjs.min.js";import x from"@mui/icons-material/Delete";import{useTheme as w}from"@mui/material/styles";function g(g){var v=g.productsArr,y=g.vendorID,k=void 0===y?null:y,_=e(r([]),2),C=_[0],I=_[1],P=e(r(null),2),A=P[0],T=P[1],j=e(r(0),2),N=j[0],D=j[1],S=e(r(new Date),2),W=S[0],B=S[1],O=w();n((function(){I([])}),[k]);var q=e(r([]),2),F=q[0],H=q[1];return n((function(){H(function(e){return e.map((function(e,t){return{line_item_number:"".concat(t+1,".0.0"),product:e.product.id,ordered_quantity:e.amount,expected_delivery_date:e.pdw}}))}(C))}),[C]),l.createElement(p,{spacing:2},l.createElement(s,{variant:"h5"},"Adding the products"),l.createElement(s,{variant:"body1"},"Please select the products that are in the purchase order"),l.createElement(s,{variant:"body2"},"Only products by the selected supplier can be added"),l.createElement(a,null,l.createElement(o,null,l.createElement(u,null,l.createElement(m,{id:"line_item_number",sx:[{width:"15%"},null===k&&{color:O.palette.text.disabled}]},"Line Item Number"),l.createElement(m,{sx:[{width:"55%"},null===k&&{color:O.palette.text.disabled}]},"Product Number"),l.createElement(m,{sx:[{width:"15%"},null===k&&{color:O.palette.text.disabled}]},"Amount"),l.createElement(m,{sx:[{width:"15%"},null===k&&{color:O.palette.text.disabled}]},"Preferred delivery week"),l.createElement(m,{sx:[null===k&&{color:O.palette.text.disabled}]}))),l.createElement(i,null,C.map((function(e,t){return l.createElement(u,{key:t},l.createElement(m,{sx:[{width:"15%"},null===k&&{color:O.palette.text.disabled}]},t+1,".0.0"),l.createElement(m,{sx:[{width:"55%"},null===k&&{color:O.palette.text.disabled}]},e.product.product_number),l.createElement(m,{sx:{width:"15%"}},e.amount),l.createElement(m,{sx:{width:"10%"}},(r=e.pdw,E(r).isoWeek())),l.createElement(m,{align:"right",sx:{width:"5%"}},l.createElement(c,{onClick:function(){return function(e){var t=C.filter((function(t,l){return l!==e}));I(t)}(t)}},l.createElement(x,null))));var r})))),l.createElement("input",{type:"hidden",name:"ipo_items",value:JSON.stringify(F)}),l.createElement(p,{direction:"row",spacing:1,alignItems:"center",sx:{p:2,width:"100%"}},l.createElement(s,{variant:"body1",sx:{width:"15%"}},C.length+1,".0.0"),v&&l.createElement(b,{productNames:v,currentValue:[],sx:{width:"55%"},multiple:!1,onChangeCallback:function(e){var t=v.find((function(t){return t.id===e[0]}));console.log("product",t),T(t||null)}}),l.createElement(f,{id:"amount",name:"amount",type:"number",label:"Amount",value:N,onChange:function(e){""!==e.target.value?parseInt(e.target.value)<0?D(0):D(parseInt(e.target.value)):D(0)},disabled:null===k,sx:{width:"15%"}}),l.createElement(h,{value:W,onChangeCallback:function(e){console.log("WeekPicker onchange",e),B(e)},label:"Preferred delivery week",disabled:!1}),l.createElement(c,{disabled:null===k,onClick:function(){if(console.log("handleAddItem"),null!==A&&null!==N){var l={product:A,amount:N,pdw:W};console.log("newItem",l),I(t(t([],e(C),!1),[l],!1)),T(null),D(0),B(new Date)}else console.log("nextProductName or nextAmount is null")}},l.createElement(d,null))))}export{g as IPOItemFields};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as r}from"react";import{useFormState as n}from"react-dom";import{updateIpoAction as i}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as o}from"../../common/media/UploadBase64MediaForm.js";import l from"../../../data/loaders/common/media/downloadBase64File.js";import m from"./ItemUpdater.js";import c from"./ItemDisplay.js";import d from"../note/NotesDisplay.js";import s from"../note/NoteTakingComponent.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{SubmitButton as u}from"../../SubmitButton.js";import v from"@mui/material/Alert";import E from"@mui/material/Dialog";import f from"@mui/material/DialogActions";import g from"@mui/material/DialogContent";import y from"@mui/material/DialogTitle";import h from"@mui/material/Typography";import b from"@mui/material/Button";import C from"@mui/material/Grid";import
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as r}from"react";import{useFormState as n}from"react-dom";import{updateIpoAction as i}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as o}from"../../common/media/UploadBase64MediaForm.js";import l from"../../../data/loaders/common/media/downloadBase64File.js";import m from"./ItemUpdater.js";import c from"./ItemDisplay.js";import d from"../note/NotesDisplay.js";import s from"../note/NoteTakingComponent.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{SubmitButton as u}from"../../SubmitButton.js";import v from"@mui/material/Alert";import E from"@mui/material/Dialog";import f from"@mui/material/DialogActions";import g from"@mui/material/DialogContent";import y from"@mui/material/DialogTitle";import h from"@mui/material/Typography";import b from"@mui/material/Button";import C from"@mui/material/Grid";import _ from"@mui/material/Box";import x from"@mui/material/Paper";import w from"@mui/material/Stack";import D from"@mui/material/Divider";import k from"@mui/material/Card";import j from"@mui/material/CardContent";import{confirmationService as I}from"../../../data/services/logistics/ipo/confirmation-service.js";var F={zodErrors:null,strapiErrors:null,data:null,message:null};function N(e){var t=e.open,r=e.handleClose,n=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return a.createElement(E,{open:t},a.createElement(y,null,"Confirm Order"),a.createElement(g,null,a.createElement(w,{spacing:2},a.createElement(h,null,"Are you sure you want to confirm this order?"),a.createElement(h,null,"Current status: ",i))),a.createElement(f,null,a.createElement(b,{variant:"contained",onClick:function(e){I("ipos",[n]),o&&o()}},"Confirm"),a.createElement(b,{variant:"contained",onClick:r},"Cancel")))}function O(E){var f,g,y,I,O,S,q,A=E.data,B=E.sx,U=E.revalidateCallback;E.handleClose;var P=E.role,T=e(n(i,F),2),M=T[0],H=T[1],R=e(r(A.items.data?A.items.data:[]),2),z=R[0],G=R[1],J=e(r(!1),2),L=J[0],Q=J[1],K=function(a,r,n){var i=t([],e(z),!1),o=i.findIndex((function(e){return e.id===r}));i[o][n]=a,G(i)};return a.createElement(_,{sx:t([],e(Array.isArray(B)?B:[B]),!1)},a.createElement(C,{container:!0,spacing:2},a.createElement(C,{item:!0,xs:12},a.createElement(w,{spacing:2},a.createElement(w,{direction:"row",spacing:2,justifyContent:"space-between"},a.createElement(w,{spacing:2},a.createElement(h,{variant:"h3",component:"h1"},"Management Inbound Purchase Order"),a.createElement(h,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),a.createElement(s,{content:"",related:[{id:A.id,__type:"api::logistics.ipo"}],revalidateCallback:U})),a.createElement(D,null))),a.createElement(C,{item:!0,xs:12},a.createElement(h,{variant:"h4"},"Purchase Order Number ",A.ipo_number)),a.createElement(C,{item:!0,xs:6},a.createElement(w,{spacing:1},a.createElement(h,{variant:"h5"},"Details"),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"150px"},"Custom reference"),a.createElement(h,{variant:"body2"},A.custom_reference)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"150px"},"Order Date"),a.createElement(h,{variant:"body2"},A.order_date)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"150px"},"Supplier"),a.createElement(h,{variant:"body2"},null===(g=null===(f=A.vendor_profile)||void 0===f?void 0:f.business_credentials)||void 0===g?void 0:g.company_name)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"150px"},"Order Status"),a.createElement(h,{variant:"body2",width:"150px"},A.status)),("placed"===A.status||"received_on_stock"===A.status)&&"enduser"===P&&a.createElement(a.Fragment,null,a.createElement(b,{variant:"contained",color:"primary",onClick:function(){return Q(!0)}},"Confirm order"),a.createElement(v,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher"),a.createElement(N,{open:L,handleClose:function(){return Q(!1)},orderID:A.id,currentStatus:A.status,revalidateCallback:U})))),a.createElement(C,{item:!0,xs:12},a.createElement(w,{spacing:2},a.createElement(h,{variant:"h5"},"Documents"),a.createElement(k,{variant:"outlined"},a.createElement(j,null,a.createElement(w,{spacing:1},"enduser"===P&&a.createElement(a.Fragment,null,A.order_confirmation?a.createElement(a.Fragment,null,a.createElement(h,{variant:"h6"},"Order Confirmation"),a.createElement(h,null,null===(y=A.order_confirmation)||void 0===y?void 0:y.name),a.createElement(b,{variant:"contained",onClick:function(){l("api/ipos/".concat(A.id),"order_confirmation")}},"Download")):a.createElement(a.Fragment,null,a.createElement(h,{variant:"h5"},"Order Confirmation"),a.createElement(h,{variant:"body1"},"Here you can upload the the order confirmation for this order"),a.createElement(h,{variant:"body1"},"FileUpload"),a.createElement(D,null),a.createElement(o,{reference:"api::logistics.ipo",refID:A.id,field:"order_confirmation",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/ipos",componentName:"order_confirmation",componentReference:"common.base64-encoded-media",revalidateCallback:U}))),A.delivery_note?a.createElement(a.Fragment,null,a.createElement(h,{variant:"h6"},"Delivery Note"),a.createElement(h,null,null===(I=A.delivery_note)||void 0===I?void 0:I.name),a.createElement(b,{variant:"contained",onClick:function(){l("api/ipos/".concat(A.id),"delivery_note")}},"Download")):a.createElement(a.Fragment,null,a.createElement(h,{variant:"h5"},"Delivery Note"),a.createElement(h,{variant:"body1"},"Here you can upload the the delivery note for this order"),a.createElement(D,null),a.createElement(o,{reference:"api::logistics.ipo",refID:A.id,field:"delivery_note",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/ipos",componentName:"delivery_note",componentReference:"common.base64-encoded-media",revalidateCallback:U}))))))),(null===(S=null===(O=null==A?void 0:A.notes)||void 0===O?void 0:O.data)||void 0===S?void 0:S.length)>0&&a.createElement(C,{item:!0,xs:12},a.createElement(w,{spacing:2},a.createElement(h,{variant:"h5"},"Notes"),a.createElement(d,{notes:A.notes.data}),a.createElement(D,null))),a.createElement(C,{item:!0,xs:12},a.createElement(w,{spacing:1},a.createElement(h,{variant:"h5"},"Items"),"placed"===A.status&&a.createElement(v,{severity:"warning"},"Before confirmation you cannot update the items"),a.createElement(D,null),a.createElement("form",{action:H},a.createElement("input",{name:"id",type:"hidden",value:A.id}),(null===(q=null==A?void 0:A.items)||void 0===q?void 0:q.data)&&A.items.data.map((function(e,t){var r,n;return console.log("item",e),a.createElement(x,{sx:{p:2,mb:2},key:t},"placed"===A.status?a.createElement(c,{item:e,index:t,image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image}):a.createElement(m,{item:e,index:t,handleUpdateQuantity:K,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image,revalidateCallback:U}))})),a.createElement(x,{sx:{p:2}},a.createElement(w,{direction:"row",spacing:2,justifyContent:"end"},a.createElement(u,{text:"Update items",loadingText:"Loading..."}),a.createElement(p,{error:null==M?void 0:M.strapiErrors}),(null==M?void 0:M.message)&&a.createElement(v,{severity:"error"},null==M?void 0:M.message))),a.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){return{id:e.id,arrived_quantity:e.arrived_quantity,registered_quantity:e.registered_quantity,received_quantity:e.received_quantity}}))}(z))}))))))}export{O as default};
|