umwd-components 0.1.424 → 0.1.425
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/src/components/e-commerce/checkout/CheckoutForm.js +1 -1
- package/dist/src/components/e-commerce/checkout/Step1.js +1 -1
- package/dist/src/components/e-commerce/checkout/Step2.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/e-commerce/checkout/Step1.d.ts +5 -1
- package/dist/types/types/e-commerce/checkout/types.d.ts +10 -8
- package/package.json +1 -1
- package/src/components/e-commerce/checkout/CheckoutForm.tsx +7 -6
- package/src/components/e-commerce/checkout/Step1.tsx +8 -3
- package/src/components/e-commerce/checkout/Step2.tsx +8 -9
- package/src/types/e-commerce/checkout/types.ts +10 -8
- package/dist/types/components/e-commerce/checkoutV2/CheckoutForm.d.ts +0 -6
- package/dist/types/components/e-commerce/checkoutV2/Step1.d.ts +0 -8
- package/dist/types/components/e-commerce/checkoutV2/Step2.d.ts +0 -3
- package/dist/types/components/e-commerce/checkoutV2/Step3.d.ts +0 -3
- package/dist/types/components/e-commerce/checkoutV2/Step4.d.ts +0 -3
- package/dist/types/components/e-commerce/checkoutV2/Step5.d.ts +0 -3
- package/src/components/e-commerce/checkoutV2/CheckoutForm.tsx +0 -345
- package/src/components/e-commerce/checkoutV2/Step1.tsx +0 -122
- package/src/components/e-commerce/checkoutV2/Step2.tsx +0 -83
- package/src/components/e-commerce/checkoutV2/Step3.tsx +0 -478
- package/src/components/e-commerce/checkoutV2/Step4.tsx +0 -184
- package/src/components/e-commerce/checkoutV2/Step5.tsx +0 -81
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Typography";import n from"@mui/material/Container";import a from"@mui/material/Stack";import l from"@mui/material/Grid";import o from"@mui/material/Paper";import i from"@mui/material/Box";import m from"@mui/material/Button";import c from"@mui/material/Stepper";import s from"@mui/material/Step";import u from"@mui/material/StepLabel";import p from"@mui/material/MobileStepper";import d from"@mui/material/useMediaQuery";import{useTheme as x}from"@mui/material/styles";import E,{useState as f,useEffect as b}from"react";import
|
|
7
|
+
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Typography";import n from"@mui/material/Container";import a from"@mui/material/Stack";import l from"@mui/material/Grid";import o from"@mui/material/Paper";import i from"@mui/material/Box";import m from"@mui/material/Button";import c from"@mui/material/Stepper";import s from"@mui/material/Step";import u from"@mui/material/StepLabel";import p from"@mui/material/MobileStepper";import d from"@mui/material/useMediaQuery";import{useTheme as x}from"@mui/material/styles";import E,{useState as f,useEffect as b}from"react";import g from"next/link";import{useSearchParams as v}from"next/navigation";import{useSession as h}from"../../../context/auth/SessionContext.js";import k from"@mui/icons-material/KeyboardArrowLeft";import B from"@mui/icons-material/KeyboardArrowRight";import y from"./Step1.js";import C from"./Step2.js";import S from"./Step3.js";import N from"./Step4.js";import j from"./Step5.js";import{useCheckout as w}from"../../../context/e-commerce/checkout/CheckoutContext.js";import{useCart as z}from"../../../context/e-commerce/cart/CartContext.js";function _(_){var D=_.shopUrl,I=void 0===D?"/shop":D,O=x(),P=d(O.breakpoints.down("sm")),T=w(),A=T.state,H=T.runAllChecks,L=z().dispatch,M=t(f(0),2),V=M[0],F=M[1],K=function(){F((function(e){return e+1}))},G=function(){F((function(e){return e-1}))},Q=h(),R=Q.loading;Q.error;var U=Q.user;Q.login;var q=Q.logout,J=v();b((function(){null!==J&&(J.get("order")&&(F(4),localStorage.removeItem("cart"),L({type:"SET_ITEMS",payload:[]})))}),[J,L]),b((function(){H()}),[U,H]);var W=!A.confirmations.itemsInCart,X=!A.confirmations.customerProfileComplete,Y=[{label:"Login or register",children:E.createElement(y,{user:U,logout:q}),backButton:E.createElement(m,{variant:P?"text":"outlined",disabled:0===V,onClick:G,sx:{mr:1}},"Back",P&&E.createElement(k,null)),nextButton:E.createElement(m,{variant:P?"text":"contained",onClick:K,sx:{ml:1},disabled:(!U||W)&&"production"===process.env.NODE_ENV,size:P?"small":"large"},"Next",P&&E.createElement(B,null))},{label:"Provide us with your address",children:E.createElement(C,null),backButton:E.createElement(m,{size:P?"small":"large",onClick:G,disabled:0===V,variant:P?"text":"outlined"},"Back",P&&E.createElement(k,null)),nextButton:E.createElement(m,{size:P?"small":"large",variant:P?"text":"contained",onClick:function(){K()},disabled:(!U||W||X)&&"production"===process.env.NODE_ENV},"Next",P&&E.createElement(B,null))},{label:"Set up mailing options",children:E.createElement(S,null),backButton:E.createElement(m,{size:P?"small":"large",variant:P?"text":"outlined",onClick:G,disabled:0===V},"Back",P&&E.createElement(k,null)),nextButton:E.createElement(m,{size:P?"small":"large",variant:P?"text":"contained",onClick:function(){K()},disabled:(!U||W||X)&&"production"===process.env.NODE_ENV},"Next",P&&E.createElement(B,null))},{label:"Confirm and make a payment",children:E.createElement(N,null),nextButton:E.createElement(E.Fragment,null,E.createElement(m,{size:P?"small":"large",variant:P?"text":"contained",onClick:function(){K()},disabled:!0},"Next",P&&E.createElement(B,null))),backButton:E.createElement(m,{size:P?"small":"large",variant:P?"text":"outlined",onClick:G,disabled:0===V},"Back",P&&E.createElement(k,null))},{label:"Done!",children:E.createElement(j,null)}];return E.createElement(n,{sx:{py:2,minHeight:"100vh"}},E.createElement(l,{container:!0,spacing:2,sx:{py:3,minHeight:"60vh"}},E.createElement(l,{item:!0,xs:12},E.createElement(r,{variant:"h4",align:"center"},"Check Out")),W&&4!=V&&E.createElement(l,{item:!0,xs:12},E.createElement(i,{sx:{color:"red",border:"2px solid red",p:2}},E.createElement(r,{variant:"h5"},"No products in cart"),E.createElement(r,{variant:"body1"},"There are no products selected to order, please visit the shop befor continuing"))),E.createElement(l,{item:!0,xs:12},E.createElement(i,{width:"100%"},E.createElement(o,{sx:{p:2,mb:2,display:{xs:"block",sm:"none"}}},E.createElement(a,{direction:"row",spacing:2,alignItems:"center"},E.createElement(r,{variant:"body2"},"".concat(V+1," / ").concat(Y.length)),E.createElement(r,null,"".concat(Y[V].label)))),E.createElement(o,{sx:{px:2,pt:2,mb:2,display:{xs:"none",sm:"block"}}},E.createElement(c,{activeStep:V},Y.map((function(t,r){var n={};return E.createElement(s,e({key:r},{},{sx:{pb:"20px"}}),E.createElement(u,n,t.label))})))),!R&&E.createElement(E.Fragment,null,Y[V].children,E.createElement(o,{sx:{p:2,mt:2,display:{xs:"none",sm:"block"}}},E.createElement(a,{direction:"row",spacing:2},Y[V].backButton,E.createElement(m,{variant:"outlined",sx:{ml:1}},E.createElement(g,{href:I},"continue shopping")),E.createElement(i,{sx:{flex:"1 1 auto"}}),Y[V].nextButton))))),E.createElement(l,{item:!0,xs:12},E.createElement(p,{sx:{display:{xs:"flex",sm:"none"}},variant:"text",steps:Y.length,position:"static",activeStep:V,nextButton:Y[V].nextButton,backButton:Y[V].backButton}))))}export{_ as default};
|
|
@@ -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 from"react";import r from"@mui/material/
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import n from"@mui/material/Typography";import a from"@mui/material/Button";import i from"@mui/material/Stack";import o from"../../auth/DenseSigninForm.js";import m from"../../auth/DenseRegisterForm.js";function l(l){var c=l.user,u=l.logout,s=(null==c?void 0:c.customer_profile)?c.customer_profile:null,E=e(t.useState(!1),2),d=E[0],g=E[1];return t.createElement(r,{sx:{p:2}},c?t.createElement(t.Fragment,null,s?t.createElement(t.Fragment,null,t.createElement(n,{variant:"h6"},"Dearest ",s.first_name," ",s.last_name,", are you ready to checkout?"),t.createElement(i,{spacing:2,direction:"row",alignItems:"center"},t.createElement(n,{variant:"body1"},"Not ",s.first_name," ",s.last_name,"?"),t.createElement(a,{variant:"outlined",onClick:function(){return u()}},"sign in as somebody else"))):t.createElement(t.Fragment,null,t.createElement(n,{variant:"h6"},"Dearest ",c.username,", ",c.email,", are you ready to checkout?"),t.createElement(i,{spacing:2,direction:"row",alignItems:"center"},t.createElement(n,{variant:"body1"},"Not"," ",c.username&&c.email?"".concat(c.username," ").concat(c.email):"".concat(c.username),"?"),t.createElement(a,{variant:"outlined",onClick:function(){return u()}},"sign in as somebody else")))):t.createElement(t.Fragment,null,d?t.createElement(i,{spacing:2},t.createElement(n,{variant:"h6"},"Register to continue"),t.createElement(n,{variant:"body1"},"Enter your details to register an account"),t.createElement(m,{data:{redirect_url:"/shop/check-out"}}),t.createElement(a,{variant:"outlined",onClick:function(){return g(!1)}},"Sign in")):t.createElement(i,{spacing:2},t.createElement(n,{variant:"h6"},"Sign in to continue"),t.createElement(n,{variant:"body1"},"Enter your details to sign in to your account"),t.createElement(o,{data:{redirect_url:"/shop/check-out"}}),t.createElement(a,{variant:"outlined",onClick:function(){return g(!0)}},"Register"))))}export{l as default};
|
|
@@ -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 r,{useState as t,useEffect as o}from"react";import i from"@mui/material/Button";import m from"@mui/material/Paper";import
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as t,useEffect as o}from"react";import i from"@mui/material/Button";import m from"@mui/material/Paper";import l from"@mui/material/Stack";import a from"@mui/material/Box";import n from"@mui/material/CircularProgress";import{useSession as s}from"../../../context/auth/SessionContext.js";import{isCustomerProfileComplete as c}from"../../../lib/isCustomerProfileComplete.js";import u from"../customer/DenseCustomerProfileDisplay.js";import p from"../customer/CustomerProfileEditForm.js";function f(){var f=s(),d=f.user,E=f.loading,x=f.error,C=e(t((null==d?void 0:d.customer_profile)?d.customer_profile:null),2),g=C[0],h=C[1],v=e(t(!(g&&c(g))),2),j=v[0],P=v[1];return E||!d?r.createElement(a,{sx:{display:{xs:"none",md:"flex"},flexGrow:0,position:"relative",width:"40px",height:"40px"}},r.createElement(n,null)):x?r.createElement("p",null,"Error: ",x):(o((function(){console.log("user changed",d),h((null==d?void 0:d.customer_profile)?d.customer_profile:null)}),[d]),r.createElement(m,{sx:{p:2}},j?r.createElement(l,{spacing:2},r.createElement(p,{data:g}),r.createElement(i,{variant:"contained",onClick:function(){P(!1)},disabled:!c(g)},"cancel")):r.createElement(l,{spacing:2},r.createElement(u,{data:g}),r.createElement(i,{variant:"contained",onClick:function(){P(!0)}},"Change address"))))}export{f as default};
|