umwd-components 0.1.365 → 0.1.366
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/Contacts.js +1 -1
- package/dist/src/components/common/media/EditMediaDialog.js +1 -1
- package/dist/src/components/common/media/MediaLibraryDialog.js +1 -1
- package/dist/src/components/e-commerce/categories/CategorySelectorV2.js +1 -1
- package/dist/src/components/e-commerce/customer/BusinessCredentials.js +1 -0
- package/dist/src/components/e-commerce/customer/CustomerProfileEditForm.js +1 -1
- package/dist/src/components/e-commerce/products/AddProductForm.js +1 -1
- package/dist/src/components/e-commerce/products/EditProductForm.js +1 -1
- package/dist/src/components/e-commerce/products/PriceFields.js +1 -1
- package/dist/src/components/logistics/vendor/AddVendorForm.js +1 -1
- package/dist/src/components/logistics/vendor/EditVendorForm.js +1 -1
- package/dist/src/components/logistics/vendor/VendorSelector.js +1 -1
- package/dist/src/data/actions/profile-actions.js +1 -1
- package/dist/src/data/loaders/e-commerce/getSingleProduct.js +1 -1
- package/dist/src/lib/isCustomerProfileComplete.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/logistics/vendor/EditVendorForm.d.ts +2 -1
- package/dist/types/lib/isCustomerProfileComplete.d.ts +5 -0
- package/dist/types/types/e-commerce/product/types.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/common/Contacts.tsx +41 -51
- package/src/components/common/media/EditMediaDialog.tsx +6 -5
- package/src/components/common/media/MediaLibraryDialog.tsx +34 -28
- package/src/components/e-commerce/categories/CategorySelectorV2.tsx +2 -2
- package/src/components/e-commerce/customer/BusinessCredentials.tsx +2 -0
- package/src/components/e-commerce/customer/CustomerProfileEditForm.tsx +62 -24
- package/src/components/e-commerce/products/AddProductForm.tsx +1 -1
- package/src/components/e-commerce/products/EditProductForm.tsx +5 -1
- package/src/components/e-commerce/products/PriceFields.tsx +7 -5
- package/src/components/logistics/vendor/AddVendorForm.tsx +66 -46
- package/src/components/logistics/vendor/EditVendorForm.tsx +11 -8
- package/src/components/logistics/vendor/VendorSelector.tsx +4 -3
- package/src/data/actions/profile-actions.ts +11 -0
- package/src/data/loaders/e-commerce/getSingleProduct.ts +1 -0
- package/src/lib/isCustomerProfileComplete.ts +12 -6
- package/src/types/e-commerce/product/types.ts +1 -0
|
@@ -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/index6.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{extends as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"react";import a from"@mui/material/Stack";import n from"@mui/material/TextField";import l from"@mui/material/Typography";import m from"@mui/material/Button";import r from"@mui/icons-material/AccountCircle";import{ContactType as i}from"../../types/common/Contact.js";import o from"@mui/material/Autocomplete";import c from"@mui/material/IconButton";import{Delete as u}from"@mui/icons-material";function p(e){var n=e.data,i=n.id,o=n.first_name,c=n.last_name,u=n.email,p=n.phone_number,d=n.type,f=n.onClick;return t.createElement(a,null,t.createElement(a,{spacing:2,direction:"row"},t.createElement(r,null),t.createElement(a,null,t.createElement(l,null,o," ",c),t.createElement(l,null,u),t.createElement(l,null,p),t.createElement(l,null,d),f&&t.createElement(m,{onClick:function(e){i&&f(e,i)}},"Edit"))))}function d(l){var m=l.data,
|
|
6
|
+
import{extends as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"react";import a from"@mui/material/Stack";import n from"@mui/material/TextField";import l from"@mui/material/Typography";import m from"@mui/material/Button";import r from"@mui/icons-material/AccountCircle";import{ContactType as i}from"../../types/common/Contact.js";import o from"@mui/material/Autocomplete";import c from"@mui/material/IconButton";import{Delete as u}from"@mui/icons-material";function p(e){var n=e.data,i=n.id,o=n.first_name,c=n.last_name,u=n.email,p=n.phone_number,d=n.type,f=n.onClick;return t.createElement(a,null,t.createElement(a,{spacing:2,direction:"row"},t.createElement(r,null),t.createElement(a,null,t.createElement(l,null,o," ",c),t.createElement(l,null,u),t.createElement(l,null,p),t.createElement(l,null,d),f&&t.createElement(m,{onClick:function(e){i&&f(e,i)}},"Edit"))))}function d(l){var m=l.data,r=l.componentName,p=l.componentReference,d=l.deleteCallback,f=m||{},s=f.id,E=f.first_name,_=f.last_name,b=f.email,y=f.phone_number,h=f.type;return t.createElement(a,{spacing:1},t.createElement("input",{id:"",type:"hidden",name:"".concat(r,".__component"),value:p}),s&&t.createElement("input",{id:"",type:"hidden",name:"".concat(r,".id"),value:s}),t.createElement(a,{spacing:1,direction:"row"},t.createElement(n,{id:"first_name",name:"".concat(r,".first_name"),label:"First Name",defaultValue:E||""}),d&&t.createElement(c,{onClick:d},t.createElement(u,null))),t.createElement(n,{id:"last_name",name:"".concat(r,".last_name"),label:"Last Name",defaultValue:_||""}),t.createElement(n,{id:"email",name:"".concat(r,".email"),label:"E-mail",defaultValue:b||""}),t.createElement(n,{id:"phone_number",name:"".concat(r,".phone_number"),label:"Phone Number",defaultValue:y||""}),t.createElement(o,{id:"type",options:Object.values(i),defaultValue:h||Object.values(i)[0],renderInput:function(a){return t.createElement(n,e({},a,{name:"".concat(r,".type"),label:"Type"}))}}))}export{d as ContactsFields,p as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import e from"react";import t from"@mui/material/Dialog";import
|
|
6
|
+
import e from"react";import t from"@mui/material/Dialog";import m from"@mui/material/DialogTitle";import a from"@mui/material/DialogContent";import{DenseEditMediaForm as r}from"./DenseEditMediaForm.js";import l from"@mui/material/Button";import{DialogActions as i}from"@mui/material";function o(o){var n=o.open,u=o.handleClose,c=o.data;return e.createElement(t,{open:n,fullWidth:!0,maxWidth:"lg"},e.createElement(m,null,c.name),e.createElement(a,null,e.createElement(r,{data:c})),e.createElement(i,null,e.createElement(l,{onClick:u},"close")))}export{o as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__awaiter as t,__generator as
|
|
7
|
+
import{__read as e,__awaiter as t,__generator as r}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as n,useEffect as i}from"react";import{MediaGrid as l}from"./MediaGrid.js";import{UploadMediaForm as o}from"./UploadMediaForm.js";import m from"@mui/material/Dialog";import c from"@mui/material/Button";import d from"@mui/material/Divider";import u from"@mui/material/Stack";import{DialogTitle as s,DialogContent as f,Typography as p,DialogActions as h}from"@mui/material";import{getAllMedia as v}from"../../../data/loaders/common/media/getAllMedia.js";function E(E){var b=this,g=E.open,y=E.handleClose,C=E.handleCancel,j=E.selected,k=E.handleSelect,M=e(n(),2),S=M[0],U=M[1];i((function(){!function(){t(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return[4,v()];case 1:return e=t.sent(),U(e),[2]}}))}))}()}),[]);return a.createElement(m,{open:g,fullWidth:!0,maxWidth:"lg"},a.createElement(s,null,"Media Library"),a.createElement(f,null,a.createElement(u,{spacing:2},a.createElement(p,{variant:"body2"},"Upload media to use in your content"),a.createElement(o,{revalidateCallback:function(){t(b,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return[4,v()];case 1:return e=t.sent(),U(e),[2]}}))}))}}),a.createElement(d,null),a.createElement(p,{variant:"body2"},"Select media to use in your content"),S&&a.createElement(l,{mediaArray:S,selected:j,handleSelect:k}))),a.createElement(h,null,a.createElement(c,{variant:"outlined",onClick:C},"Close"),j.length>0&&a.createElement(c,{variant:"contained",onClick:y},"Use selected file".concat(j.length>1?"s":""))))}export{E as MediaLibraryDialog};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as n}from"react";import i from"@mui/material/Autocomplete";import l from"@mui/material/TextField";var o=function(o){var u=o.categories,a=o.currentValue,m=t(n(a||[]),2),c=m[0],p=m[1];return r.createElement(r.Fragment,null,r.createElement(i,{multiple:!0,options:u,getOptionLabel:function(e){return e.title},filterSelectedOptions:!0,onChange:function(e,t){t.map((function(e){return e.id})),p(t.map((function(e){return e.id})))},renderInput:function(t){return r.createElement(l,e({},t,{label:"Category"}))},
|
|
6
|
+
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as n}from"react";import i from"@mui/material/Autocomplete";import l from"@mui/material/TextField";var o=function(o){var u=o.categories,a=o.currentValue,m=t(n(a||[]),2),c=m[0],p=m[1];return r.createElement(r.Fragment,null,r.createElement(i,{multiple:!0,options:u,getOptionLabel:function(e){return e.title},filterSelectedOptions:!0,onChange:function(e,t){t.map((function(e){return e.id})),p(t.map((function(e){return e.id})))},renderInput:function(t){return r.createElement(l,e({},t,{label:"Category"}))},value:u.filter((function(e){return c.includes(e.id)}))}),r.createElement("input",{type:"hidden",name:"categories",value:JSON.stringify(c)||""}))};export{o 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
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"@mui/material/Divider";import a from"@mui/material/Paper";import r from"@mui/material/Box";import n from"@mui/material/Stack";import l from"@mui/material/Alert";import m from"@mui/material/TextField";import i from"@mui/material/Typography";import o from"@mui/material/Checkbox";import{AddressFields as s}from"../../common/Address.js";import{SubmitButton as c}from"../../SubmitButton.js";import{useFormState as d}from"react-dom";import{updateCustomerProfileAction as u}from"../../../data/actions/profile-actions.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{BusinessCredentialsFields as f}from"./BusinessCredentials.js";import E,{useState as v}from"react";var g={zodErrors:null,strapiErrors:null,data:null,message:null};function h(h){var _=h.data,b=_.id;_.uuid,_.customer_number;var y=_.first_name,x=_.last_name,j=_.email,C=_.phone,N=_.company_address,A=_.delivery_address,B=_.billing_address,k=_.business_credentials,R=e(d(u,g),2),V=R[0],w=R[1];console.log(A),console.log(B);var D=e(v(null!=A),2),I=D[0],P=D[1],S=e(v(null!=B),2),T=S[0],F=S[1];return E.createElement(r,{component:a,sx:{p:2}},E.createElement("form",{action:w},E.createElement(n,{spacing:2},E.createElement("input",{type:"hidden",name:"id",value:b}),E.createElement(i,{variant:"h6"},"Personal Details"),E.createElement(t,null),E.createElement(m,{id:"first_name",name:"first_name",label:"First Name",defaultValue:y}),E.createElement(m,{id:"last_name",name:"last_name",label:"Last Name",defaultValue:x}),E.createElement(m,{id:"email",name:"email",label:"Email",defaultValue:j}),E.createElement(m,{id:"phone",name:"phone",label:"Phone",defaultValue:C}),E.createElement(i,{variant:"h6"},"Business Credentials"),E.createElement(t,null),E.createElement(f,{componentName:"business_credentials",componentReference:"business.credentials",data:k}),E.createElement(i,{variant:"h6"},"Company Address"),E.createElement(t,null),E.createElement(s,{componentName:"company_address",componentReference:"common.address",data:N}),E.createElement(i,{variant:"h6"},"Delivery Address"),E.createElement(t,null),E.createElement(n,{direction:"row",spacing:2,alignItems:"center"},E.createElement(o,{value:I,checked:I,onChange:function(){return P(!I)}}),E.createElement(i,null,"Use a different address for delivery")),I&&E.createElement(s,{componentName:"delivery_address",componentReference:"common.address",data:A}),E.createElement(i,{variant:"h6"},"Billing Address"),E.createElement(t,null),E.createElement(n,{direction:"row",spacing:2,alignItems:"center"},E.createElement(o,{value:T,checked:T,onChange:function(){return F(!T)}}),E.createElement(i,null,"Use a different address for billing")),T&&E.createElement(s,{componentName:"billing_address",componentReference:"common.address",data:B}),E.createElement(n,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1}},E.createElement(c,{text:"save changes",loadingText:"loading"}),E.createElement(p,{error:null==V?void 0:V.strapiErrors}),(null==V?void 0:V.message)&&E.createElement(l,{severity:"error"},null==V?void 0:V.message)))))}export{h as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as n}from"react";import i from"@mui/material/Paper";import m from"@mui/material/Box";import a from"@mui/material/Stack";import l from"@mui/material/Alert";import o from"@mui/material/TextField";import c from"@mui/material/Typography";import{SubmitButton as s}from"../../SubmitButton.js";import{useFormState as d}from"react-dom";import{StrapiErrors as u}from"../../StrapiErrors.js";import{createProductAction as p}from"../../../data/actions/e-commerce/product/createProductAction.js";import{MediaLibraryDialog as E}from"../../common/media/MediaLibraryDialog.js";import g from"@mui/material/Button";import f from"@mui/material/Grid";import{StrapiImage as h}from"../../StrapiImage.js";import{PriceFields as v}from"./PriceFields.js";import x from"../categories/CategorySelectorV2.js";import{DimensionsFields as y}from"../../common/Dimensions.js";import j from"../../logistics/vendor/VendorSelector.js";var w={zodErrors:null,strapiErrors:null,data:null,message:null};function S(S){var b=S.vendorArr,C=S.categories,T=e(d(p,w),2),P=T[0],V=T[1],k=e(n(null),2),D=k[0],I=k[1],N=e(n(null),2),R=N[0],A=N[1],B=e(n([]),2),O=B[0],F=B[1];return r.createElement(m,{component:i,sx:{p:2}},r.createElement("form",{action:V},r.createElement(f,{container:!0,spacing:2},r.createElement(f,{item:!0,xs:12},r.createElement(a,{spacing:2},r.createElement(o,{id:"title",name:"title",label:"Title"}),r.createElement(o,{id:"description",name:"description",label:"Description",multiline:!0,minRows:4,maxRows:8}))),r.createElement(f,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Product Image"),r.createElement("input",{id:"image",type:"hidden",name:"image",value:null==R?void 0:R.id}),r.createElement(h,{id:(null==R?void 0:R.id)||"",url:(null==R?void 0:R.url)||"",alternativeText:"product image",width:(null==R?void 0:R.width)&&(null==R?void 0:R.height)?R.width/R.height*200:200,height:200}),r.createElement(g,{onClick:function(){return I("image")}},"open media library"),r.createElement(E,{open:"image"===D,handleClose:function(){return I(null)},handleCancel:function(){A(null),I(null)},handleSelect:function(e){A(e)},selected:R?[R]:[]})),r.createElement(f,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Image Gallery"),r.createElement("input",{id:"gallery",type:"hidden",name:"gallery",value:JSON.stringify(O.map((function(e){return e.id})))}),r.createElement(a,{direction:"row",spacing:2},O.map((function(e){return r.createElement(h,{key:e.id,id:e.id,url:e.url,alternativeText:"gallery image",width:e.width/e.height*100,height:100})}))),r.createElement(g,{onClick:function(){return I("gallery")}},"open media library"),r.createElement(E,{open:"gallery"===D,handleClose:function(){return I(null)},handleCancel:function(){F([]),I(null)},handleSelect:function(r){if(O.indexOf(r)>-1){var n=t([],e(O),!1);n.splice(O.indexOf(r),1),F(n)}else O.length>=5?F(t([],e(O),!1)):F(t(t([],e(O),!1),[r],!1))},selected:O})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Price"),r.createElement(v,{componentName:"price",componentReference:"e-commerce-elements.price"})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Categories"),r.createElement(x,{categories:C,currentValue:[]})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Dimensions"),r.createElement(y,{componentName:"dimensions",componentReference:"e-commerce-elements.dimensions"})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Vendors"),r.createElement(j,{vendorNames:b,currentValue:null}))),r.createElement(f,{item:!0,xs:12},r.createElement(a,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:2}},r.createElement(s,{text:"create new product",loadingText:"loading"}),r.createElement(u,{error:null==P?void 0:P.strapiErrors}),(null==P?void 0:P.message)&&r.createElement(l,{severity:"error"},null==P?void 0:P.message)))))}export{S as AddProductForm};
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as n}from"react";import i from"@mui/material/Paper";import m from"@mui/material/Box";import a from"@mui/material/Stack";import l from"@mui/material/Alert";import o from"@mui/material/TextField";import c from"@mui/material/Typography";import{SubmitButton as s}from"../../SubmitButton.js";import{useFormState as d}from"react-dom";import{StrapiErrors as u}from"../../StrapiErrors.js";import{createProductAction as p}from"../../../data/actions/e-commerce/product/createProductAction.js";import{MediaLibraryDialog as E}from"../../common/media/MediaLibraryDialog.js";import g from"@mui/material/Button";import f from"@mui/material/Grid";import{StrapiImage as h}from"../../StrapiImage.js";import{PriceFields as v}from"./PriceFields.js";import x from"../categories/CategorySelectorV2.js";import{DimensionsFields as y}from"../../common/Dimensions.js";import j from"../../logistics/vendor/VendorSelector.js";var w={zodErrors:null,strapiErrors:null,data:null,message:null};function S(S){var b=S.vendorArr,C=S.categories,T=e(d(p,w),2),P=T[0],V=T[1],k=e(n(null),2),D=k[0],I=k[1],N=e(n(null),2),R=N[0],A=N[1],B=e(n([]),2),O=B[0],F=B[1];return r.createElement(m,{component:i,sx:{p:2}},r.createElement("form",{action:V},r.createElement(f,{container:!0,spacing:2},r.createElement(f,{item:!0,xs:12},r.createElement(a,{spacing:2},r.createElement(o,{id:"title",name:"title",label:"Title"}),r.createElement(o,{id:"description",name:"description",label:"Description",multiline:!0,minRows:4,maxRows:8}))),r.createElement(f,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Product Image"),r.createElement("input",{id:"image",type:"hidden",name:"image",value:(null==R?void 0:R.id)||""}),r.createElement(h,{id:(null==R?void 0:R.id)||"",url:(null==R?void 0:R.url)||"",alternativeText:"product image",width:(null==R?void 0:R.width)&&(null==R?void 0:R.height)?R.width/R.height*200:200,height:200}),r.createElement(g,{onClick:function(){return I("image")}},"open media library"),r.createElement(E,{open:"image"===D,handleClose:function(){return I(null)},handleCancel:function(){A(null),I(null)},handleSelect:function(e){A(e)},selected:R?[R]:[]})),r.createElement(f,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Image Gallery"),r.createElement("input",{id:"gallery",type:"hidden",name:"gallery",value:JSON.stringify(O.map((function(e){return e.id})))}),r.createElement(a,{direction:"row",spacing:2},O.map((function(e){return r.createElement(h,{key:e.id,id:e.id,url:e.url,alternativeText:"gallery image",width:e.width/e.height*100,height:100})}))),r.createElement(g,{onClick:function(){return I("gallery")}},"open media library"),r.createElement(E,{open:"gallery"===D,handleClose:function(){return I(null)},handleCancel:function(){F([]),I(null)},handleSelect:function(r){if(O.indexOf(r)>-1){var n=t([],e(O),!1);n.splice(O.indexOf(r),1),F(n)}else O.length>=5?F(t([],e(O),!1)):F(t(t([],e(O),!1),[r],!1))},selected:O})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Price"),r.createElement(v,{componentName:"price",componentReference:"e-commerce-elements.price"})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Categories"),r.createElement(x,{categories:C,currentValue:[]})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Dimensions"),r.createElement(y,{componentName:"dimensions",componentReference:"e-commerce-elements.dimensions"})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Vendors"),r.createElement(j,{vendorNames:b,currentValue:null}))),r.createElement(f,{item:!0,xs:12},r.createElement(a,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:2}},r.createElement(s,{text:"create new product",loadingText:"loading"}),r.createElement(u,{error:null==P?void 0:P.strapiErrors}),(null==P?void 0:P.message)&&r.createElement(l,{severity:"error"},null==P?void 0:P.message)))))}export{S as AddProductForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as i}from"react";import n from"@mui/material/Paper";import a from"@mui/material/Box";import l from"@mui/material/Stack";import m from"@mui/material/Alert";import o from"@mui/material/TextField";import c from"@mui/material/Typography";import{SubmitButton as d}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{StrapiErrors as s}from"../../StrapiErrors.js";import{updateProductAction as p}from"../../../data/actions/e-commerce/product/updateProductAction.js";import{MediaLibraryDialog as g}from"../../common/media/MediaLibraryDialog.js";import E from"@mui/material/Button";import f from"@mui/material/Grid";import{StrapiImage as
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as i}from"react";import n from"@mui/material/Paper";import a from"@mui/material/Box";import l from"@mui/material/Stack";import m from"@mui/material/Alert";import o from"@mui/material/TextField";import c from"@mui/material/Typography";import{SubmitButton as d}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{StrapiErrors as s}from"../../StrapiErrors.js";import{updateProductAction as p}from"../../../data/actions/e-commerce/product/updateProductAction.js";import{MediaLibraryDialog as g}from"../../common/media/MediaLibraryDialog.js";import E from"@mui/material/Button";import f from"@mui/material/Grid";import{StrapiImage as v}from"../../StrapiImage.js";import{PriceFields as h}from"./PriceFields.js";import y from"../categories/CategorySelectorV2.js";import{DimensionsFields as x}from"../../common/Dimensions.js";import j from"../../logistics/vendor/VendorSelector.js";var w={zodErrors:null,strapiErrors:null,data:null,message:null};function S(S){var b,C,V=S.data,T=S.vendorArr,I=S.categoriesArray,P=V.id,k=V.title,A=V.description,D=V.image,N=V.gallery,R=V.price,B=V.dimensions,F=V.categories,G=V.vendors;console.log("data",V);var z=(null==N?void 0:N.data)||[],J=(null==F?void 0:F.data)||[],L=e(u(p,w),2),M=L[0],O=L[1],_=e(i(null),2),q=_[0],H=_[1],K=e(i(D||null),2),Q=K[0],U=K[1],W=e(i(t([],e(z),!1)),2),X=W[0],Y=W[1];return r.createElement(a,{component:n,sx:{p:2}},r.createElement("form",{action:O},P&&r.createElement("input",{id:"id",type:"hidden",name:"id",value:P}),r.createElement(f,{container:!0,spacing:2},r.createElement(f,{item:!0,xs:12},r.createElement(l,{spacing:2},r.createElement(o,{id:"title",name:"title",label:"Title",defaultValue:k}),r.createElement(o,{id:"description",name:"description",label:"Description",multiline:!0,minRows:4,maxRows:8,defaultValue:A}))),r.createElement(f,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Product Image"),r.createElement("input",{id:"image",type:"hidden",name:"image",value:null==Q?void 0:Q.id}),r.createElement(v,{id:(null==Q?void 0:Q.id)||"",url:(null==Q?void 0:Q.url)||"",alternativeText:"product image",width:(null==Q?void 0:Q.width)&&(null==Q?void 0:Q.height)?Q.width/Q.height*200:200,height:200}),r.createElement(E,{onClick:function(){return H("image")}},"open media library"),r.createElement(g,{open:"image"===q,handleClose:function(){return H(null)},handleCancel:function(){U(null),H(null)},handleSelect:function(e){U(e)},selected:Q?[Q]:[]})),r.createElement(f,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Image Gallery"),r.createElement("input",{id:"gallery",type:"hidden",name:"gallery",value:JSON.stringify(X.map((function(e){return e.id})))}),r.createElement(l,{direction:"row",spacing:2},X.map((function(e){return r.createElement(v,{key:e.id,id:e.id,url:e.url,alternativeText:"gallery image",width:(null==e?void 0:e.width)&&(null==e?void 0:e.height)?e.width/e.height*100:100,height:100})}))),r.createElement(E,{onClick:function(){return H("gallery")}},"open media library"),r.createElement(g,{open:"gallery"===q,handleClose:function(){return H(null)},handleCancel:function(){Y([]),H(null)},handleSelect:function(r){var i=X.findIndex((function(e){return e.id===r.id}));if(i>-1){var n=t([],e(X),!1);n.splice(i,1),Y(n)}else X.length>=5?Y(t([],e(X),!1)):Y(t(t([],e(X),!1),[r],!1))},selected:X})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Price"),r.createElement(h,{componentName:"price",componentReference:"e-commerce-elements.price",data:R})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Categories"),r.createElement(y,{categories:I,currentValue:t([],e(J.map((function(e){return e.id}))),!1)})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Dimensions"),r.createElement(x,{componentName:"dimensions",componentReference:"e-commerce-elements.dimensions",data:B})),r.createElement(f,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Vendors"),r.createElement(j,{vendorNames:T,currentValue:null===(C=null===(b=G.data)||void 0===b?void 0:b[0])||void 0===C?void 0:C.id}))),r.createElement(f,{item:!0,xs:12},r.createElement(l,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1}},r.createElement(d,{text:"update product",loadingText:"loading"}),(null==M?void 0:M.strapiErrors)&&r.createElement(s,{error:null==M?void 0:M.strapiErrors}),(null==M?void 0:M.message)&&r.createElement(m,{severity:"error"},null==M?void 0:M.message)))))}export{S as EditProductForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a}from"react";import r from"@mui/material/TextField";import i from"@mui/icons-material/Euro";import l from"@mui/material/InputAdornment";import o from"@mui/material/Stack";function c(c){var m=c.data,d=c.componentName,
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a}from"react";import r from"@mui/material/TextField";import i from"@mui/icons-material/Euro";import l from"@mui/material/InputAdornment";import o from"@mui/material/Stack";function c(c){var m=c.data,d=c.componentName,p=c.componentReference,u=m||{},v=u.id,s=u.vat_rate,E=u.vat,f=u.price_incl_vat,_=u.price,b=e(n((null==_?void 0:_.toString())||""),2),g=b[0],F=b[1],h=e(n((function(){return(null==s?void 0:s.toString())||"21"})),2),x=h[0],y=h[1],A=e(n(E||0),2),I=A[0],P=A[1],S=e(n(f||0),2),V=S[0],C=S[1];return a((function(){if(g&&x){var e=parseFloat(g),t=e*(parseFloat(x)/100),n=e+t;P(t),C(n)}}),[g,x]),t.createElement(o,{spacing:2,direction:"row"},t.createElement("input",{id:"",type:"hidden",name:"".concat(d,".__component"),value:p}),v&&t.createElement("input",{id:"",type:"hidden",name:"".concat(d,".id"),value:v}),t.createElement(r,{id:"price",InputProps:{startAdornment:t.createElement(l,{position:"start"},t.createElement(i,null))},name:"".concat(d,".price"),label:"price",type:"float",value:g,onChange:function(e){F(e.target.value)}}),t.createElement(r,{id:"vat_rate",name:"".concat(d,".vat_rate"),type:"number",InputProps:{endAdornment:t.createElement(l,{position:"end"},"%")},label:"Vat Rate",value:x,onChange:function(e){y(e.target.value)}}),t.createElement(r,{id:"vat",InputProps:{startAdornment:t.createElement(l,{position:"start"},t.createElement(i,null))},name:"".concat(d,".vat"),label:"Vat",value:null==I?void 0:I.toFixed(2),disabled:!0}),t.createElement("input",{hidden:!0,name:"".concat(d,".vat"),value:null==I?void 0:I.toFixed(2),readOnly:!0}),t.createElement(r,{id:"price_incl_vat",InputProps:{startAdornment:t.createElement(l,{position:"start"},t.createElement(i,null))},name:"".concat(d,".price_incl_vat"),label:"Price Incl VAT",value:null==V?void 0:V.toFixed(2),disabled:!0}),t.createElement("input",{hidden:!0,name:"".concat(d,".price_incl_vat"),value:null==V?void 0:V.toFixed(2),readOnly:!0}))}export{c as PriceFields};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as m,useEffect as n}from"react";import
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as m,useEffect as n}from"react";import a from"@mui/material/Paper";import o from"@mui/material/Box";import i from"@mui/material/Stack";import c from"@mui/material/Alert";import l from"@mui/material/TextField";import s from"@mui/material/Typography";import{SubmitButton as d}from"../../SubmitButton.js";import{useFormState as p}from"react-dom";import{StrapiErrors as u}from"../../StrapiErrors.js";import{createVendorAction as E}from"../../../data/actions/logistics/vendor/createVendorAction.js";import f from"@mui/material/Grid";import{BusinessCredentialsFields as x}from"../../e-commerce/customer/BusinessCredentials.js";import{AddressFields as g}from"../../common/Address.js";import v from"../../e-commerce/products/ProductSelector.js";import{ContactsFields as b}from"../../common/Contacts.js";import h from"@mui/material/Button";import j from"@mui/icons-material/Add";import{ContactType as y}from"../../../types/common/Contact.js";var _={zodErrors:null,strapiErrors:null,data:null,message:null};function A(A){var C=A.productNamesArr,N=A.revalidateCallback,k=e(p(E,_),2),w=k[0],B=k[1],P=e(m([]),2),R=P[0],S=P[1];return n((function(){(null==w?void 0:w.data)&&N&&N()}),[w.data]),r.createElement(o,{component:a,sx:{p:2}},r.createElement("form",{action:B},r.createElement(f,{container:!0,spacing:2},r.createElement(f,{item:!0,xs:12},r.createElement(s,{variant:"h5"},"Add Vendor")),r.createElement(f,{item:!0,xs:12,md:6},r.createElement(x,{componentName:"business_credentials",componentReference:"common.business-credentials"})),r.createElement(f,{item:!0,xs:12,md:6},r.createElement(i,{spacing:1,sx:{pt:1}},r.createElement(l,{id:"website_url",name:"website_url",label:"Website Url"}),r.createElement(l,{id:"phone_number",name:"phone_number",label:"Phone Number"}),r.createElement(l,{id:"email",name:"email",label:"Email"}))),r.createElement(f,{item:!0,xs:12,md:6},r.createElement(s,{variant:"h6"},"Address"),r.createElement(g,{componentName:"address",componentReference:"common.address"})),r.createElement(f,{item:!0,xs:12,sx:{mt:1}},r.createElement(s,{variant:"h6"},"Products"),r.createElement(v,{productNames:C,currentValue:[]})),r.createElement(f,{item:!0,xs:12,sx:{mt:1}},r.createElement(s,{variant:"h6"},"Contacts"),r.createElement(f,{container:!0,spacing:2},R.map((function(e,t){return r.createElement(f,{item:!0,xs:12,sm:6,md:4,lg:3,key:t},r.createElement("p",null,t),r.createElement(b,{key:t,data:e.data,componentName:e.componentName,componentReference:"logistics-elements.contact",deleteCallback:function(){!function(e){console.log("delete",e);var t=R.filter((function(t,r){return r!==e}));S(t)}(t)}}))})),r.createElement(f,{item:!0,xs:12,sm:6,md:4,lg:3,sx:{justifyContent:"center",display:"flex",alignItems:"center"}},r.createElement(h,{variant:"contained",startIcon:r.createElement(j,null),onClick:function(){S(t(t([],e(R),!1),[{componentName:"contacts[".concat(R.length,"]"),componentReference:"logistics-elements.contact",data:{first_name:"",last_name:"",email:"",phone_number:"",type:y.Other}}],!1))},size:"large"},"Add contact")))),r.createElement(f,{item:!0,xs:12},r.createElement(i,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1}},r.createElement(d,{text:"create new vendor",loadingText:"loading"}),(null==w?void 0:w.strapiErrors)&&r.createElement(u,{error:null==w?void 0:w.strapiErrors}),(null==w?void 0:w.message)&&r.createElement(c,{severity:"error"},null==w?void 0:w.message))))))}export{A as AddVendorForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__assign as t,__spreadArray as n}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as r,Fragment as
|
|
7
|
+
import{__read as e,__assign as t,__spreadArray as n}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as r,Fragment as o}from"react";import m from"@mui/material/Paper";import i from"@mui/material/Box";import c from"@mui/material/Stack";import l from"@mui/material/Alert";import s from"@mui/material/TextField";import d from"@mui/material/Typography";import{SubmitButton as u}from"../../SubmitButton.js";import{useFormState as p}from"react-dom";import{StrapiErrors as f}from"../../StrapiErrors.js";import{updateVendorAction as E}from"../../../data/actions/logistics/vendor/updateVendorAction.js";import v from"@mui/material/Grid";import{BusinessCredentialsFields as b}from"../../e-commerce/customer/BusinessCredentials.js";import{AddressFields as g}from"../../common/Address.js";import h from"../../e-commerce/products/ProductSelector.js";import x,{ContactsFields as _}from"../../common/Contacts.js";import y from"@mui/material/IconButton";import N from"@mui/icons-material/Add";import{ContactType as j}from"../../../types/common/Contact.js";var k={zodErrors:null,strapiErrors:null,data:null,message:null};function C(C){var A=C.data,R=C.productNamesArr;C.revalidateCallback;var V=A.id,w=A.website_url,B=A.phone_number,P=A.email,S=A.business_credentials,T=A.address,I=A.products,z=A.contacts;console.log("data",A);var F=e(p(E,k),2),G=F[0],O=F[1],U=e(r([]),2),W=U[0],q=U[1],D=(null==I?void 0:I.data)||[],H=e(r([]),2),J=H[0],K=H[1],L=e(r(z.reduce((function(e,t,n){return e.push({componentName:"contacts[".concat(n,"]"),componentReference:"logistics-elements.contact",data:t}),e}),[])),2),M=L[0],Q=L[1],X=function(t,a){J.includes(a)?K(J.filter((function(e){return e!==a}))):K(n(n([],e(J),!1),[a],!1))};return a.createElement(i,{component:m,sx:{p:2}},a.createElement("form",{action:O},V&&a.createElement("input",{id:"id",type:"hidden",name:"id",value:V}),a.createElement(v,{container:!0,spacing:2},a.createElement(v,{item:!0,xs:12},a.createElement(d,{variant:"h5"},"Edit Vendor")),a.createElement(v,{item:!0,xs:12,md:6},a.createElement(b,{data:S,componentName:"business_credentials",componentReference:"common.business-credentials"})),a.createElement(v,{item:!0,xs:12,md:6},a.createElement(c,{spacing:2},a.createElement(s,{id:"website_url",name:"website_url",label:"Website Url",defaultValue:w}),a.createElement(s,{id:"phone_number",name:"phone_number",label:"Phone Number",defaultValue:B}),a.createElement(s,{id:"email",name:"email",label:"Email",defaultValue:P}))),a.createElement(v,{item:!0,xs:12,md:6},a.createElement(d,{variant:"h6"},"Address"),a.createElement(g,{data:T,componentName:"address",componentReference:"common.address"})),a.createElement(v,{item:!0,xs:12,sx:{mt:1}},a.createElement(d,{variant:"h6"},"Products"),a.createElement(h,{productNames:R,currentValue:D.map((function(e){return e.id}))})),a.createElement(v,{item:!0,xs:12,sx:{mt:1}},a.createElement(d,{variant:"h6"},"Contacts"),null==M?void 0:M.map((function(e,n){var r,m;return(null===(r=e.data)||void 0===r?void 0:r.id)?J.includes(null===(m=e.data)||void 0===m?void 0:m.id)?a.createElement(_,{key:e.data.id,data:e.data,componentName:"contacts[".concat(n,"]"),componentReference:"logistics-elements.contact",deleteCallback:function(){Q(M.filter((function(e,t){return t!==n})))}}):a.createElement(o,{key:e.data.id},a.createElement("input",{type:"hidden",name:"contacts[".concat(n,"].id"),value:e.data.id}),a.createElement("input",{type:"hidden",name:"contacts[".concat(n,"].__component"),value:"logistics-elements.contact"}),a.createElement(x,{data:t(t({},e.data),{onClick:X})})):null})),W.map((function(e,t){return a.createElement(_,{key:t,data:e.data,componentName:e.componentName,componentReference:"logistics-elements.contact",deleteCallback:function(){q(W.filter((function(e,n){return n!==t})))}})})),a.createElement(y,{onClick:function(){q(n(n([],e(W),!1),[{componentName:"contacts[".concat(z.length+W.length,"]"),componentReference:"logistics-elements.contact",data:{first_name:"",last_name:"",email:"",phone_number:"",type:j.Other}}],!1))}},a.createElement(N,null))),a.createElement(v,{item:!0,xs:12},a.createElement(c,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1}},a.createElement(u,{text:"update vendor",loadingText:"loading"}),(null==G?void 0:G.strapiErrors)&&a.createElement(f,{error:null==G?void 0:G.strapiErrors}),(null==G?void 0:G.message)&&a.createElement(l,{severity:"error"},null==G?void 0:G.message))))))}export{C as EditVendorForm};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as n}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as l}from"react";import r from"@mui/material/Autocomplete";import
|
|
6
|
+
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as n}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as l}from"react";import r from"@mui/material/Autocomplete";import o from"@mui/material/TextField";var i=function(i){var u=i.vendorNames,a=i.currentValue,m=i.onSelectVendor;console.log(a);var d=n(l(a||null),2),s=d[0],c=d[1];return t.createElement(t.Fragment,null,t.createElement(r,{options:u,getOptionLabel:function(e){var n;return null===(n=null==e?void 0:e.business_credentials)||void 0===n?void 0:n.company_name},filterSelectedOptions:!0,onChange:function(e,n){var t=(null==n?void 0:n.id)||null;c(t),m&&m(t)},renderInput:function(n){return t.createElement(o,e({},n,{label:"Vendors"}))},value:(null==u?void 0:u.find((function(e){return e.id===s})))||null}),t.createElement("input",{type:"hidden",name:"vendors",value:s?JSON.stringify(s):""}))};export{i 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,__assign as
|
|
7
|
+
import{__awaiter as r,__generator as e,__assign as s}from"../../../node_modules/tslib/tslib.es6.js";import{mutateData as i}from"../services/mutate-data.js";import{flattenAttributes as a}from"../../lib/utils.js";import{parseFormData as o}from"../../lib/parseFormData.js";function t(t,d){return r(this,void 0,void 0,(function(){var r,l,n,m,u;return e(this,(function(e){switch(e.label){case 0:return r=Object.fromEntries(d),l=o(d),console.log("parsedFormData",l),void 0===l.data.delivery_address&&(console.log("delivery_address is undefined"),l.data.delivery_address=null),void 0===l.data.billing_address&&(console.log("billing_address is undefined"),l.data.billing_address=null),n=r.id,[4,i("PUT","/api/customer-profiles/".concat(n),l)];case 1:return(m=e.sent())?m.error?[2,s(s({},t),{strapiErrors:m.error,message:"Failed to Register."})]:(u=a(m),[2,s(s({},t),{message:"Profile Updated",data:u,strapiErrors:null})]):[2,s(s({},t),{strapiErrors:null,message:"Ops! Something went wrong. Please try again."})]}}))}))}export{t as updateCustomerProfileAction};
|
|
@@ -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 s}from"../../../lib/utils.js";import{unstable_noStore as t}from"next/cache";var n=s();function a(s){return r(this,void 0,void 0,(function(){var r;return e(this,(function(e){switch(e.label){case 0:return t(),(r=new URL("/api/slugify/slugs/product/".concat(s),n)).search=i.stringify({populate:{price:!0,image:!0,gallery:!0,dimensions:!0,categories:!0,brand:!0}}),[4,o(r.href)];case 1:return[2,e.sent()]}}))}))}export{a as getSingleProduct};
|
|
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 s}from"../../../lib/utils.js";import{unstable_noStore as t}from"next/cache";var n=s();function a(s){return r(this,void 0,void 0,(function(){var r;return e(this,(function(e){switch(e.label){case 0:return t(),(r=new URL("/api/slugify/slugs/product/".concat(s),n)).search=i.stringify({populate:{price:!0,image:!0,gallery:!0,dimensions:!0,categories:!0,brand:!0,vendors:!0}}),[4,o(r.href)];case 1:return[2,e.sent()]}}))}))}export{a as getSingleProduct};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{isAddressComplete as e}from"./isAddressComplete.js";import{areBusinessCredentailsComplete as s}from"./areBusinessCredentialsComplete.js";var r=function(r){return!!r&&(!!e(r.
|
|
6
|
+
import{isAddressComplete as e}from"./isAddressComplete.js";import{areBusinessCredentailsComplete as s}from"./areBusinessCredentialsComplete.js";var r=function(r){return!!r&&(!!e(r.company_address)&&!!s(r.business_credentials))};export{r as isCustomerProfileComplete};
|