umwd-components 0.1.483 → 0.1.484

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.
@@ -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,useRef as r,useEffect as l}from"react";import a from"@mui/material/Stack";import i from"@mui/material/Typography";import o from"@mui/material/Box";import{useFormState as m}from"react-dom";import{uploadBase64MediaAction as c}from"../../../data/actions/media/uploadBase64MediaAction.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{ZodErrors as d}from"../../ZodErrors.js";import u from"@mui/material/Alert";import{SubmitButton as s}from"../../SubmitButton.js";var f={zodErrors:null,strapiErrors:null,data:null,message:null};function E(E){var v,y=E.reference,g=E.refID,x=void 0===g?0:g,h=E.field,b=E.multiple,j=void 0===b||b,k=E.accept,w=void 0===k?"image/*":k,C=E.path,I=void 0===C?"api/ipos":C,O=E.componentName,_=void 0===O?"":O,B=E.componentReference,R=E.revalidateCallback,S=e(n(null),2),z=S[0],A=S[1],H=e(n(null),2),L=H[0],N=H[1],T=c.bind(null,I,x,_),U=e(m(T,f),2),D=U[0],F=U[1],M=r(null);return l((function(){D.data&&R&&R()}),[D.data]),t.createElement("form",{action:F,id:h},t.createElement(o,{sx:[z&&z.length>0&&{border:"2px solid red",p:1}]},t.createElement(a,{spacing:1,sx:{flex:1}},y&&t.createElement("input",{type:"text",name:"ref",value:y,style:{display:"none"},readOnly:!0}),x&&t.createElement("input",{type:"text",name:"refId",value:x,style:{display:"none"},readOnly:!0})," ",h&&t.createElement("input",{type:"text",name:"field",value:h,style:{display:"none"},readOnly:!0}),t.createElement("input",{id:"component_name",type:"hidden",name:"".concat(_,".__component"),value:B}),null!==z?t.createElement(o,{onClick:function(){var e;return null===(e=M.current)||void 0===e?void 0:e.click()},sx:{p:2,width:"100%",border:"1px dashed white",minHeight:"100px"}},void 0===w||"image/*"===w?t.createElement(a,{direction:"row",spacing:1,justifyContent:"flex-end"},z.map((function(e,n){return t.createElement("img",{key:n,src:e.url,alt:e.name,style:{width:"100px"}})}))):t.createElement(a,{spacing:1,justifyContent:"flex-end"},z.map((function(e,n){return t.createElement(i,{key:n},e.name)})))):t.createElement(o,{onClick:function(){var e;return null===(e=M.current)||void 0===e?void 0:e.click()},sx:{p:2,width:"100%",border:"1px dashed white",minHeight:"100px"}},t.createElement(i,null,"No file","".concat(j?"s":"")," selected for upload")),t.createElement(a,{direction:"column",spacing:2,alignItems:"center",justifyContent:"space-between"},t.createElement(p,{error:D.strapiErrors}),t.createElement(d,{error:null===(v=D.zodErrors)||void 0===v?void 0:v.image}),(null==D?void 0:D.message)&&t.createElement(u,{severity:"error"},null==D?void 0:D.message),t.createElement(o,null,t.createElement("label",{htmlFor:"pictureInput"},t.createElement("input",{id:"pictureInput",accept:w,multiple:j,type:"file",name:"files",ref:M,onChange:function(e){var t=e.target.files;if(null!==t){var n=Object.keys(t).map((function(e,n){return{url:URL.createObjectURL(t[n]),name:t[n].name}}));N(t),A(n)}},style:{display:"none"}})),null!==L&&t.createElement(s,{text:"upload",loadingText:"loading"}))))))}export{E as UploadBase64MediaForm};
7
+ import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as r,useRef as n,useEffect as l}from"react";import a from"@mui/material/Stack";import i from"@mui/material/Typography";import o from"@mui/material/Box";import{useFormState as m}from"react-dom";import{uploadBase64MediaAction as c}from"../../../data/actions/media/uploadBase64MediaAction.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{ZodErrors as u}from"../../ZodErrors.js";import d from"@mui/material/Alert";import{SubmitButton as s}from"../../SubmitButton.js";var f={zodErrors:null,strapiErrors:null,data:null,message:null};function E(E){var v,y=E.reference,g=E.refID,x=void 0===g?0:g,h=E.field,b=E.multiple,j=void 0===b||b,k=E.accept,w=void 0===k?"image/*":k,C=E.path,I=void 0===C?"api/ipos":C,O=E.componentName,_=void 0===O?"":O,B=E.componentReference,R=E.revalidateCallback,S=e(r(null),2),z=S[0],A=S[1],H=e(r(null),2),L=H[0],N=H[1],T=c.bind(null,I,x,_),U=e(m(T,f),2),D=U[0],F=U[1],M=n(null);return l((function(){D.data&&R&&R()}),[D.data]),t.createElement("form",{action:F,id:h},t.createElement(o,{sx:[z&&z.length>0&&{border:"2px solid red",p:1}]},t.createElement(a,{spacing:1,sx:{flex:1}},y&&t.createElement("input",{type:"text",name:"ref",value:y,style:{display:"none"},readOnly:!0}),x&&t.createElement("input",{type:"text",name:"refId",value:x,style:{display:"none"},readOnly:!0})," ",h&&t.createElement("input",{type:"text",name:"field",value:h,style:{display:"none"},readOnly:!0}),t.createElement("input",{id:"component_name",type:"hidden",name:"".concat(_,".__component"),value:B}),null!==z?t.createElement(o,{onClick:function(){var e;return null===(e=M.current)||void 0===e?void 0:e.click()},sx:{p:2,width:"100%",border:"1px dashed white",minHeight:"100px"}},void 0===w||"image/*"===w?t.createElement(a,{direction:"row",spacing:1,justifyContent:"flex-end"},z.map((function(e,r){return t.createElement("img",{key:r,src:e.url,alt:e.name,style:{width:"100px"}})}))):t.createElement(a,{spacing:1,justifyContent:"flex-end"},z.map((function(e,r){return t.createElement(i,{key:r},e.name)})))):t.createElement(o,{onClick:function(){var e;return null===(e=M.current)||void 0===e?void 0:e.click()},sx:{p:2,width:"100%",border:"1px dashed white",minHeight:"100px",cursor:"pointer"}},t.createElement(i,null,"No file","".concat(j?"s":"")," selected for upload")),t.createElement(a,{direction:"column",spacing:2,alignItems:"center",justifyContent:"space-between"},t.createElement(p,{error:D.strapiErrors}),t.createElement(u,{error:null===(v=D.zodErrors)||void 0===v?void 0:v.image}),(null==D?void 0:D.message)&&t.createElement(d,{severity:"error"},null==D?void 0:D.message),t.createElement(o,null,t.createElement("label",{htmlFor:"pictureInput"},t.createElement("input",{id:"pictureInput",accept:w,multiple:j,type:"file",name:"files",ref:M,onChange:function(e){var t=e.target.files;if(null!==t){var r=Object.keys(t).map((function(e,r){return{url:URL.createObjectURL(t[r]),name:t[r].name}}));N(t),A(r)}},style:{display:"none"}})),null!==L&&t.createElement(s,{text:"upload",loadingText:"loading"}))))))}export{E as UploadBase64MediaForm};
@@ -4,4 +4,4 @@
4
4
  * @copyright Jelle Paulus
5
5
  * @license MIT
6
6
  */
7
- import{__spreadArray as e,__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"react";import m from"@mui/material/Paper";import a from"@mui/material/Box";import n from"@mui/material/Grid";import o from"@mui/material/Typography";import i from"@mui/material/Stack";import c from"../../e-commerce/customer/BusinessCredentials.js";import s from"../../common/Address.js";import l from"../../e-commerce/products/Price.js";import d from"../../common/markdown/MarkdownDisplay.js";import{ExplanatoryFoldOut as p}from"../../ExplanatoryFoldOut.js";import E from"../../common/Contacts.js";function u(u){var x=u.data,f=u.sx;x.id;var b=x.website_url,y=x.phone_number,v=x.email,h=x.business_credentials,j=x.address,g=x.products,P=x.contacts;return console.log(P),r.createElement(a,{sx:e([{p:2}],t(Array.isArray(f)?f:[f]),!1),component:m},r.createElement(n,{container:!0,spacing:2},r.createElement(n,{item:!0,xs:12},r.createElement(o,{variant:"h5"},"Vendor")),r.createElement(n,{item:!0,xs:12,md:6},r.createElement(c,{data:h})),r.createElement(n,{item:!0,xs:12,md:6},r.createElement(o,{variant:"body1"},"Website Url: ",b),r.createElement(o,{variant:"body1"},"Phone Number: ",y),r.createElement(o,{variant:"body1"},"Email: ",v)),r.createElement(n,{item:!0,xs:12,md:6},r.createElement(o,{variant:"h6"},"Address"),r.createElement(s,{data:j}))),r.createElement(n,{item:!0,xs:12,sx:{mt:3}},r.createElement(o,{variant:"h6"},"Products"),r.createElement(p,{title:"Products",sx:{mt:1}},r.createElement(i,{spacing:1},g.data.map((function(e,t){return r.createElement(m,{key:t,sx:{p:1}},r.createElement(o,{variant:"h6"},"Product: ",e.title," ",e.product_number),r.createElement(d,null,e.description.substring(0,160)),r.createElement(l,e.price))}))))),r.createElement(n,{item:!0,xs:12,sx:{mt:3}},r.createElement(o,{variant:"h6"},"Contacts"),r.createElement(p,{title:"Contacts",sx:{mt:1}},r.createElement(i,{spacing:1},P.map((function(e,t){return r.createElement(m,{key:t,sx:{p:1}},r.createElement(E,{data:e}))}))))))}export{u as VendorDisplay};
7
+ import{__spreadArray as e,__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"react";import m from"@mui/material/Paper";import a from"@mui/material/Box";import n from"@mui/material/Grid";import o from"@mui/material/Typography";import i from"@mui/material/Stack";import c from"../../e-commerce/customer/BusinessCredentials.js";import s from"../../common/Address.js";import l from"../../e-commerce/products/Price.js";import{ExplanatoryFoldOut as d}from"../../ExplanatoryFoldOut.js";import p from"../../common/Contacts.js";function E(E){var u=E.data,x=E.sx;u.id;var f=u.website_url,b=u.phone_number,y=u.email,v=u.business_credentials,h=u.address,j=u.products,P=u.contacts;return console.log(P),r.createElement(a,{sx:e([{p:2}],t(Array.isArray(x)?x:[x]),!1),component:m},r.createElement(n,{container:!0,spacing:2},r.createElement(n,{item:!0,xs:12},r.createElement(o,{variant:"h5"},"Vendor")),r.createElement(n,{item:!0,xs:12,md:6},r.createElement(c,{data:v})),r.createElement(n,{item:!0,xs:12,md:6},r.createElement(o,{variant:"body1"},"Website Url: ",f),r.createElement(o,{variant:"body1"},"Phone Number: ",b),r.createElement(o,{variant:"body1"},"Email: ",y)),r.createElement(n,{item:!0,xs:12,md:6},r.createElement(o,{variant:"h6"},"Address"),r.createElement(s,{data:h}))),r.createElement(n,{item:!0,xs:12,sx:{mt:3}},r.createElement(o,{variant:"h6"},"Products"),r.createElement(d,{title:"Products",sx:{mt:1}},r.createElement(i,{spacing:1},j.data.map((function(e,t){return r.createElement(m,{key:t,sx:{p:1}},r.createElement(i,{direction:"row",justifyContent:"space-between"},r.createElement(o,{variant:"h6"},"Product: ",e.title," ",e.product_number),r.createElement(l,e.price)))}))))),r.createElement(n,{item:!0,xs:12,sx:{mt:3}},r.createElement(o,{variant:"h6"},"Contacts"),r.createElement(d,{title:"Contacts",sx:{mt:1}},r.createElement(i,{spacing:1},P.map((function(e,t){return r.createElement(m,{key:t,sx:{p:1}},r.createElement(p,{data:e}))}))))))}export{E as VendorDisplay};