umwd-components 0.1.347 → 0.1.348
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/ExplanatoryFoldOut.js +1 -1
- package/dist/src/components/common/media/UploadBase64MediaForm.js +1 -1
- package/dist/src/components/common/media/UploadMediaForm.js +1 -1
- package/dist/src/components/logistics/ipo/ManageIPOForm.js +1 -1
- package/dist/src/components/logistics/vendor/AddVendorForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/ExplanatoryFoldOut.d.ts +3 -2
- package/dist/types/components/common/media/UploadBase64MediaForm.d.ts +1 -1
- package/dist/types/components/logistics/ipo/ManageIPOForm.d.ts +1 -1
- package/dist/types/components/logistics/vendor/AddVendorForm.d.ts +2 -1
- package/dist/types/types/logistics/Ipo.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/ExplanatoryFoldOut.tsx +12 -4
- package/src/components/common/media/UploadBase64MediaForm.tsx +141 -121
- package/src/components/common/media/UploadMediaForm.tsx +0 -6
- package/src/components/logistics/ipo/ManageIPOForm.tsx +15 -2
- package/src/components/logistics/vendor/AddVendorForm.tsx +37 -26
- package/src/types/logistics/Ipo.ts +9 -0
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as r,__spreadArray as e}from"../../node_modules/tslib/tslib.es6.js";import t,{useState as i}from"react";import m from"@mui/material/Typography";import o from"@mui/material/Divider";import a from"@mui/material/Box";import l from"@mui/material/Collapse";import n from"@mui/material/Chip";import
|
|
6
|
+
import{__read as r,__spreadArray as e}from"../../node_modules/tslib/tslib.es6.js";import t,{useState as i}from"react";import m from"@mui/material/Typography";import o from"@mui/material/Divider";import a from"@mui/material/Box";import l from"@mui/material/Collapse";import n from"@mui/material/Chip";import c from"@mui/icons-material/KeyboardArrowDown";import p from"@mui/icons-material/KeyboardArrowUp";function s(s){var u=s.title,f=s.description,d=s.sx,y=void 0===d?[]:d,E=s.children,x=r(i(!1),2),b=x[0],A=x[1];return t.createElement(a,{sx:e([],r(Array.isArray(y)?y:[y]),!1)},t.createElement(o,{textAlign:"left"},t.createElement(n,{label:u,size:"small",color:"primary",onClick:function(){return A(!b)},icon:b?t.createElement(p,null):t.createElement(c,null)})),t.createElement(l,{in:b},f&&t.createElement(m,{variant:"body2",color:"primary",sx:{mt:1}},f),E&&t.createElement(a,{sx:{mt:1}},E)))}export{s as ExplanatoryFoldOut};
|
|
@@ -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
|
|
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 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;E.fileData;var 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],D=e(r(null),2),H=D[0],L=D[1],N=c.bind(null,I,x,_),T=e(m(N,f),2),U=T[0],F=T[1],M=n(null);return l((function(){U.data&&R&&R()}),[U.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"}},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:U.strapiErrors}),t.createElement(d,{error:null===(v=U.zodErrors)||void 0===v?void 0:v.image}),(null==U?void 0:U.message)&&t.createElement(u,{severity:"error"},null==U?void 0:U.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}}));L(t),A(r)}},style:{display:"none"}})),null!==H&&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{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as r,useRef as n
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as r,useRef as n}from"react";import l from"@mui/material/Stack";import a from"@mui/material/Typography";import i from"@mui/material/Box";import{useFormState as o}from"react-dom";import{uploadMediaAction as m}from"../../../data/actions/media/uploadMediaAction.js";import{StrapiErrors as c}from"../../StrapiErrors.js";import{ZodErrors as u}from"../../ZodErrors.js";import s from"@mui/material/Alert";import{SubmitButton as p}from"../../SubmitButton.js";var d={zodErrors:null,strapiErrors:null,data:null,message:null};function f(f){var E,y=f.reference,v=f.refID,g=f.field,x=f.multiple,h=void 0===x||x,b=f.accept,j=void 0===b?"image/*":b;f.fileData,f.revalidateCallback;var k=e(r(null),2),w=k[0],C=k[1],I=e(r(null),2),O=I[0],S=I[1],z=e(o(m,d),2),A=z[0],B=z[1],D=n(null);return t.createElement("form",{action:B},t.createElement(l,{spacing:1,sx:{flex:1}},y&&t.createElement("input",{type:"text",name:"ref",value:y,style:{display:"none"},readOnly:!0}),v&&t.createElement("input",{type:"text",name:"refId",value:v,style:{display:"none"},readOnly:!0}),g&&t.createElement("input",{type:"text",name:"field",value:g,style:{display:"none"},readOnly:!0}),null!==w?t.createElement(i,{onClick:function(){var e;return null===(e=D.current)||void 0===e?void 0:e.click()},sx:{p:2,width:"100%",border:"1px dashed white",minHeight:"100px"}},void 0===j||"image/*"===j?t.createElement(l,{direction:"row",spacing:1,justifyContent:"flex-end"},w.map((function(e,r){return t.createElement("img",{key:r,src:e.url,alt:e.name,style:{width:"100px"}})}))):t.createElement(l,{spacing:1,justifyContent:"flex-end"},w.map((function(e,r){return t.createElement(a,{key:r},e.name)})))):t.createElement(i,{onClick:function(){var e;return null===(e=D.current)||void 0===e?void 0:e.click()},sx:{p:2,width:"100%",border:"1px dashed white",minHeight:"100px"}},t.createElement(a,null,"No file","".concat(h?"s":"")," selected")),t.createElement(l,{direction:"column",spacing:2,alignItems:"center",justifyContent:"space-between"},t.createElement(c,{error:A.strapiErrors}),t.createElement(u,{error:null===(E=A.zodErrors)||void 0===E?void 0:E.image}),(null==A?void 0:A.message)&&t.createElement(s,{severity:"error"},null==A?void 0:A.message),t.createElement(i,null,t.createElement("label",{htmlFor:"pictureInput"},t.createElement("input",{id:"pictureInput",accept:j,multiple:h,type:"file",name:"files",ref:D,onChange:function(e){console.log(e.target.files);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}}));S(t),C(r)}},style:{display:"none"}})),null!==O&&t.createElement(p,{text:"upload",loadingText:"loading"})))))}export{f as UploadMediaForm};
|
|
@@ -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 r,{useState as n}from"react";import a from"@mui/material/Paper";import o from"@mui/material/Stack";import i from"@mui/material/Typography";import l from"@mui/material/Button";import m from"@mui/material/Divider";import c from"@mui/material/Grid";import d from"@mui/material/Card";import s from"@mui/material/CardContent";import p from"@mui/material/Box";import{useFormState as u}from"react-dom";import{updateIpoAction as v}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as n}from"react";import a from"@mui/material/Paper";import o from"@mui/material/Stack";import i from"@mui/material/Typography";import l from"@mui/material/Button";import m from"@mui/material/Divider";import c from"@mui/material/Grid";import d from"@mui/material/Card";import s from"@mui/material/CardContent";import p from"@mui/material/Box";import{useFormState as u}from"react-dom";import{updateIpoAction as v}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as E}from"../../common/media/UploadBase64MediaForm.js";import f from"../../../data/loaders/common/media/downloadBase64File.js";import g from"./ItemUpdater.js";import y from"../note/NotesDisplay.js";import h from"../note/NoteTakingComponent.js";import{SubmitButton as _}from"../../SubmitButton.js";import{StrapiErrors as b}from"../../StrapiErrors.js";import x from"@mui/material/Alert";var w={zodErrors:null,strapiErrors:null,data:null,message:null};function C(C){var j,D,I,N,k,A,R,F=C.data,O=C.sx,q=C.revalidateCallback,S=e(u(v,w),2),U=S[0],B=S[1];console.log("data",F);var M=e(n(F.items.data),2),P=M[0],T=M[1],H=function(r,n,a){void 0===a&&(a="registered_bad_reports"),console.log(P),console.log(r,n,a),console.log("handleAddReport");var o=t([],e(P),!1),i=o.findIndex((function(e){return e.id===r}));console.log(o[i]),o[i][a]?o[i][a].push(n):o[i][a]=[n]},Q=function(r,n,a){console.log(P),console.log(r,n,a),console.log("handleUpdateQuantity");var o=t([],e(P),!1),i=o.findIndex((function(e){return e.id===n}));o[i][a]=r,T(o)},z=function(e,t){console.log(P),console.log(e,t),console.log("handleRemoveReportAtIndex")};return r.createElement(p,{sx:t([],e(Array.isArray(O)?O:[O]),!1)},r.createElement(c,{container:!0,spacing:2},r.createElement(c,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(o,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(o,{spacing:2},r.createElement(i,{variant:"h3",component:"h1"},"Inbound Management Purchase Order"),r.createElement(i,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),r.createElement(h,{content:"",related:[{id:F.id,__type:"api::logistics.ipo"}]})),r.createElement(m,null))),r.createElement(c,{item:!0,xs:12},r.createElement(i,{variant:"h4"},"Purchase Order Number ",F.ipo_number)),r.createElement(c,{item:!0,xs:6},r.createElement(o,{spacing:1},r.createElement(i,{variant:"h5"},"Details"),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Custom reference"),r.createElement(i,{variant:"body2"},F.custom_reference)),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Order Date"),r.createElement(i,{variant:"body2"},F.order_date)),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Supplier"),r.createElement(i,{variant:"body2"},null===(D=null===(j=F.vendor_profile)||void 0===j?void 0:j.business_credentials)||void 0===D?void 0:D.company_name)),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Order Status"),r.createElement(i,{variant:"body2"},F.status)))),r.createElement(c,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(i,{variant:"h5"},"Documents"),r.createElement(d,{variant:"outlined"},r.createElement(s,null,r.createElement(o,{spacing:1},F.order_confirmation?r.createElement(r.Fragment,null,r.createElement(i,{variant:"h6"},"Order Confirmation"),r.createElement(i,null,null===(I=F.order_confirmation)||void 0===I?void 0:I.name),r.createElement(l,{variant:"contained",onClick:function(){f("api/ipos/".concat(F.id),"order_confirmation")}},"Download")):r.createElement(r.Fragment,null,r.createElement(i,{variant:"h5"},"Order Confirmation"),r.createElement(i,{variant:"body1"},"Here you can upload the the order confirmation for this order"),r.createElement(i,{variant:"body1"},"FileUpload"),r.createElement(m,null),r.createElement(E,{reference:"api::logistics.ipo",refID:F.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:q})),F.delivery_note?r.createElement(r.Fragment,null,r.createElement(i,{variant:"h6"},"Delivery Note"),r.createElement(i,null,null===(N=F.delivery_note)||void 0===N?void 0:N.name),r.createElement(l,{variant:"contained",onClick:function(){f("api/ipos/".concat(F.id),"delivery_note")}},"Download")):r.createElement(r.Fragment,null,r.createElement(i,{variant:"h5"},"Delivery Note"),r.createElement(i,{variant:"body1"},"Here you can upload the the delivery note for this order"),r.createElement(m,null),r.createElement(E,{reference:"api::logistics.ipo",refID:F.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:q}))))))),(null===(A=null===(k=null==F?void 0:F.notes)||void 0===k?void 0:k.data)||void 0===A?void 0:A.length)>0&&r.createElement(c,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(i,{variant:"h5"},"Notes"),r.createElement(y,{notes:F.notes.data}),r.createElement(m,null))),r.createElement(c,{item:!0,xs:12},r.createElement("form",{action:B},r.createElement("input",{name:"id",type:"hidden",value:F.id}),(null===(R=null==F?void 0:F.items)||void 0===R?void 0:R.data)&&F.items.data.map((function(e,t){var n;return console.log("item",e),r.createElement(a,{sx:{p:2,mb:2},key:t},r.createElement(g,{item:e,index:t,handleAddReport:H,handleUpdateQuantity:Q,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image,handleRemoveReportAtIndex:z}))})),r.createElement(a,{sx:{p:2}},r.createElement(o,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(_,{text:"Update items",loadingText:"Loading..."}),r.createElement(b,{error:null==U?void 0:U.strapiErrors}),(null==U?void 0:U.message)&&r.createElement(x,{severity:"error"},null==U?void 0:U.message))),r.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,recieved_quantity:e.recieved_quantity,registered_bad_reports:e.registered_bad_reports}}))}(P))})))))}export{C 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 m}from"react";import o from"@mui/material/Paper";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 o from"@mui/material/Paper";import a from"@mui/material/Box";import c from"@mui/material/Stack";import i from"@mui/material/Alert";import l from"@mui/material/TextField";import s from"@mui/material/Typography";import{SubmitButton as p}from"../../SubmitButton.js";import{useFormState as d}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 b}from"../../common/Address.js";import g from"../../e-commerce/products/ProductSelector.js";import{ContactsFields as v}from"../../common/Contacts.js";import h from"@mui/material/IconButton";import _ from"@mui/icons-material/Add";import{ContactType as y}from"../../../types/common/Contact.js";var j={zodErrors:null,strapiErrors:null,data:null,message:null};function N(N){var A=N.productNamesArr,C=N.revalidateCallback,k=e(d(E,j),2),R=k[0],w=k[1],B=e(m([{componentName:"contacts[0]",componentReference:"logistics-elements.contact",data:{first_name:"",last_name:"",email:"",phone_number:"",type:y.Other}}]),2),P=B[0],S=B[1];return n((function(){(null==R?void 0:R.data)&&C&&C()}),[R.data]),r.createElement(a,{component:o,sx:{p:2}},r.createElement("form",{action:w},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(c,{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(b,{componentName:"address",componentReference:"common.address"})),r.createElement(f,{item:!0,xs:12,sx:{mt:1}},r.createElement(s,{variant:"h6"},"Products"),r.createElement(g,{productNames:A,currentValue:[]})),r.createElement(f,{item:!0,xs:12,sx:{mt:1}},r.createElement(s,{variant:"h6"},"Contacts"),P.map((function(e,t){return r.createElement(v,{key:t,data:e.data,componentName:e.componentName,componentReference:"logistics-elements.contact"})})),r.createElement(h,{onClick:function(){S(t(t([],e(P),!1),[{componentName:"contacts[".concat(P.length,"]"),componentReference:"logistics-elements.contact",data:{first_name:"",last_name:"",email:"",phone_number:"",type:y.Other}}],!1))}},r.createElement(_,null))),r.createElement(f,{item:!0,xs:12},r.createElement(c,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{backgroundColor:"secondary.dark",px:2,py:1}},r.createElement(p,{text:"create new vendor",loadingText:"loading",sx:{color:"secondary.contrastText"}}),r.createElement(u,{error:null==R?void 0:R.strapiErrors}),(null==R?void 0:R.message)&&r.createElement(i,{severity:"error"},null==R?void 0:R.message))))))}export{N as AddVendorForm};
|