umwd-components 0.1.683 → 0.1.685
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/common/AmountIndicator.js +1 -1
- package/dist/src/components/e-commerce/products/EditStockForm.js +1 -1
- package/dist/src/components/layout/SideNav.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/common/AmountIndicator.tsx +4 -1
- package/src/components/e-commerce/products/EditStockForm.tsx +3 -2
- package/src/components/layout/SideNav.tsx +2 -1
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import t from"react";import a from"@mui/material/Box";import e from"@mui/material/Typography";import{useTheme as r}from"@mui/material/styles";function o(o){var n=o.value,c=o.maxValue,i=o.color,m=void 0===i?"primary":i,l=100/c*n,p=r();return t.createElement(a,{sx:{display:"flex",alignItems:"center",background:"linear-gradient(90deg, ".concat(p.palette[m].main,"FF ").concat(l,"%, ").concat(p.palette[m].main,"66 ").concat(l,"%)"),width:"100%",borderRadius:"16px",padding:"2px",justifyContent:"center"}},n!==c?t.createElement(e,{variant:"body2",color:p.palette[m].contrastText},"".concat(n," / ").concat(c)):t.createElement(e,{variant:"body2"},"".concat(n)))}export{o as AmountIndicator,o 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,{useEffect as n}from"react";import l from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Typography";import{SubmitButton as o}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{updateProductAction as c}from"../../../data/actions/e-commerce/product/updateProductAction.js";import d from"@mui/material/Grid";import s from"../../logistics/report/ReportsDisplay.js";import E from"../../logistics/report/ReportMakingComponent.js";import{useSnackbar as p}from"../../../context/common/SnackbarContext.js";import y from"@mui/material/Table";import f from"@mui/material/TableBody";import g from"@mui/material/TableCell";import _ from"@mui/material/TableContainer";import v from"@mui/material/TableFooter";import k from"@mui/material/TableHead";import q from"@mui/material/TableRow";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import{AmountIndicator as h}from"../../common/AmountIndicator.js";var T={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function C(C){var S=C.data,j=C.revalidateCallback,Q=C.handleClose,V=C.sx,O=S.id,R=S.title;S.product_number,S.stock;var A=S.ipos,I=S.opos,N=S.reports,w=p().handleAddMessage,z=e(u(c,T),2),B=z[0],D=z[1];return n((function(){(null==B?void 0:B.message)&&(w({message:B.message,severity:B.severity||"error"}),"success"===B.severity&&(j&&j(),Q&&Q()))}),[null==B?void 0:B.message,w,j,Q]),n((function(){(null==B?void 0:B.strapiErrors)&&w({message:B.strapiErrors.message||"Error updating stock",severity:"error"})}),[null==B?void 0:B.strapiErrors,w]),r.createElement(a,{sx:t([],e(Array.isArray(V)?V:[V]),!1)},r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12},r.createElement(i,{variant:"h6"},R)),r.createElement(d,{item:!0,xs:12},r.createElement(_,{component:l},r.createElement(
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n}from"react";import l from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Typography";import{SubmitButton as o}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{updateProductAction as c}from"../../../data/actions/e-commerce/product/updateProductAction.js";import d from"@mui/material/Grid";import s from"../../logistics/report/ReportsDisplay.js";import E from"../../logistics/report/ReportMakingComponent.js";import{useSnackbar as p}from"../../../context/common/SnackbarContext.js";import y from"@mui/material/Table";import f from"@mui/material/TableBody";import g from"@mui/material/TableCell";import _ from"@mui/material/TableContainer";import v from"@mui/material/TableFooter";import k from"@mui/material/TableHead";import q from"@mui/material/TableRow";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import{AmountIndicator as h}from"../../common/AmountIndicator.js";var T={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function C(C){var S=C.data,j=C.revalidateCallback,Q=C.handleClose,V=C.sx,O=S.id,R=S.title;S.product_number,S.stock;var A=S.ipos,I=S.opos,N=S.reports,w=p().handleAddMessage,z=e(u(c,T),2),B=z[0],D=z[1];return n((function(){(null==B?void 0:B.message)&&(w({message:B.message,severity:B.severity||"error"}),"success"===B.severity&&(j&&j(),Q&&Q()))}),[null==B?void 0:B.message,w,j,Q]),n((function(){(null==B?void 0:B.strapiErrors)&&w({message:B.strapiErrors.message||"Error updating stock",severity:"error"})}),[null==B?void 0:B.strapiErrors,w]),r.createElement(a,{sx:t([],e(Array.isArray(V)?V:[V]),!1)},r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12},r.createElement(i,{variant:"h6"},R)),r.createElement(d,{item:!0,xs:12},r.createElement(_,{component:l},r.createElement(y,{size:"small"},r.createElement(i,{variant:"h6"},"Incoming orders"),r.createElement(k,null,r.createElement(q,null,r.createElement(g,null,"Number"),r.createElement(g,null,"Order Date"),r.createElement(g,null,"Line Item Number"),r.createElement(g,null,"Ordered Quantity"),r.createElement(g,null,"Received Quantity"),r.createElement(g,null,"Registered Quantity"),r.createElement(g,null,"Released Quantity"))),r.createElement(f,null,A.map((function(e){return r.createElement(r.Fragment,null,e.items.map((function(t){return r.createElement(q,{key:e.id},r.createElement(g,null,e.ipo_number),r.createElement(g,null,e.order_date),r.createElement(g,null,t.line_item_number),r.createElement(g,null,r.createElement(h,{value:t.ordered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.received_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.registered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.released_quantity,maxValue:t.ordered_quantity,color:"primary"})))})))}))),r.createElement(v,null,r.createElement(q,null,r.createElement(g,{colSpan:6,align:"right"},"Total added to stock:"),r.createElement(g,null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0))))),r.createElement(y,{size:"small"},r.createElement(i,{variant:"h6"},"Outgoing orders"),r.createElement(k,null,r.createElement(q,null,r.createElement(g,null,"Number"),r.createElement(g,null,"Order Date"),r.createElement(g,null,"Line Item Number"),r.createElement(g,null,"Ordered Quantity"),r.createElement(g,null,"Picked Quantity"),r.createElement(g,null,"Packed Quantity"),r.createElement(g,null,"Shipped Quantity"))),r.createElement(f,null,I.map((function(e){return r.createElement(r.Fragment,null,e.opo_items.map((function(t){return r.createElement(q,{key:e.id},r.createElement(g,null,e.opo_number),r.createElement(g,null,e.order_date),r.createElement(g,null,t.line_item_number),r.createElement(g,null,r.createElement(h,{value:t.ordered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.picked_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.packed_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.shipped_quantity,maxValue:t.ordered_quantity,color:"primary"})))})))}))),r.createElement(v,null,r.createElement(q,null,r.createElement(g,{colSpan:3,align:"right"},"Total reduced from stock:"),r.createElement(g,null,I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0))))),r.createElement(y,{size:"small"},r.createElement(q,null,r.createElement(g,{align:"right"},"Total added to stock:"),r.createElement(g,null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0))),r.createElement(q,null,r.createElement(g,{align:"right"},"Total reduced from stock:"),r.createElement(g,null,I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0))),r.createElement(q,null,r.createElement(g,{align:"right"},"Corrections:"),r.createElement(g,null,r.createElement(b,{title:"Total stock corrections"},r.createElement(i,null,N?N.reduce((function(e,t){return e+t.quantity}),0):0))),r.createElement(g,null,r.createElement(b,{title:"Total stock corrections after updating"},r.createElement("b",null,N?N.reduce((function(e,t){return e+t.quantity}),0):0)))),r.createElement(q,null,r.createElement(g,{align:"right"},"Stock:"),r.createElement(g,null,r.createElement(b,{title:"Total stock"},r.createElement(i,null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0)-I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0)+(N?N.reduce((function(e,t){return e+t.quantity}),0):0)))),r.createElement(g,null,r.createElement(b,{title:"Total stock after updating"},r.createElement("b",null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0)-I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0)+(N?N.reduce((function(e,t){return e+t.quantity}),0):0))))))))),r.createElement("form",{action:D},O&&r.createElement("input",{id:"id",type:"hidden",name:"id",value:O}),r.createElement("input",{id:"stock_reports",type:"hidden",name:"stock_reports",value:JSON.stringify(N)}),r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12,sx:{mt:2}},r.createElement(m,{spacing:2},r.createElement(i,{variant:"h5"},"Stock corrections"),r.createElement(i,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"),r.createElement(s,{reports:N}),r.createElement(E,{content:"content",quantity:0,type:"stock",related:[{id:O,__type:"api::e-commerce.product"}],revalidateCallback:j}))),r.createElement(d,{item:!0,xs:12},r.createElement(m,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{py:1}},Q&&r.createElement(x,{onClick:Q,variant:"outlined"},"Close"),r.createElement(o,{text:"Update Stock",loadingText:"Updating...",variant:"contained"}))))))}export{C as EditStockForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import i from"react";import n from"@mui/material/Box";import r from"@mui/material/Divider";import a from"@mui/material/Typography";import o from"@mui/material/Toolbar";import l from"@mui/material/IconButton";import s from"@mui/material/SpeedDial";import m from"@mui/material/SpeedDialAction";import c from"@mui/material/Drawer";import p from"@mui/material/AppBar";import d from"@mui/icons-material/Menu";import u from"@mui/icons-material/ChevronLeft";import f from"@mui/icons-material/ChevronRight";import x from"@mui/icons-material/AccountCircle";import{useTheme as h}from"@mui/material/styles";import{StyledLink as g}from"../StyledLink.js";function
|
|
7
|
+
import{__read as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import i from"react";import n from"@mui/material/Box";import r from"@mui/material/Divider";import a from"@mui/material/Typography";import o from"@mui/material/Toolbar";import l from"@mui/material/IconButton";import s from"@mui/material/SpeedDial";import m from"@mui/material/SpeedDialAction";import c from"@mui/material/Drawer";import p from"@mui/material/AppBar";import d from"@mui/icons-material/Menu";import u from"@mui/icons-material/ChevronLeft";import f from"@mui/icons-material/ChevronRight";import x from"@mui/icons-material/AccountCircle";import{useTheme as h}from"@mui/material/styles";import{StyledLink as g}from"../StyledLink.js";import{Paper as w}from"@mui/material";function E(E){var b,v,y=E.children,S=E.data,k=S.sections,C=void 0===k?[]:k,I=S.actions,D=void 0===I?[]:I,j=S.sx,z=void 0===j?{}:j,L=S.title,M=S.drawerWidth,X=void 0===M?260:M,_=h(),A={zIndex:_.zIndex.drawer+1,marginLeft:X,width:"calc(100% - ".concat(X,"px)")},B={zIndex:_.zIndex.drawer+1,transition:_.transitions.create(["width","margin"],{easing:_.transitions.easing.sharp,duration:_.transitions.duration.leavingScreen})},T={width:X,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",transition:_.transitions.create("width",{easing:_.transitions.easing.sharp,duration:_.transitions.duration.enteringScreen}),overflowX:"hidden","& .MuiDrawer-paper":{width:X,transition:_.transitions.create("width",{easing:_.transitions.easing.sharp,duration:_.transitions.duration.enteringScreen}),overflowX:"hidden"}},G=((b={flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",transition:_.transitions.create("width",{easing:_.transitions.easing.sharp,duration:_.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(_.spacing(7)," + 1px)")})[_.breakpoints.up("sm")]={width:"calc(".concat(_.spacing(8)," + 1px)")},b["& .MuiDrawer-paper"]=((v={transition:_.transitions.create("width",{easing:_.transitions.easing.sharp,duration:_.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(_.spacing(7)," + 1px)")})[_.breakpoints.up("sm")]={width:"calc(".concat(_.spacing(8)," + 1px)")},v),b),R=e(i.useState(!0),2),F=R[0],H=R[1];return i.createElement(n,{sx:t({display:"flex"},z)},i.createElement(p,{position:"fixed",sx:[F&&A,!F&&B]},i.createElement(o,{component:w,elevation:4},i.createElement(l,{color:"inherit","aria-label":"open drawer",onClick:function(){H(!0)},edge:"start",sx:t({marginRight:5},F&&{display:"none"})},i.createElement(d,null)),i.createElement(g,{href:"/dashboard",target:"_self"},null!=L?L:"Dashboard"),i.createElement(n,{sx:{position:"relative",height:"40px",flexGrow:1}},i.createElement(s,{ariaLabel:"...",icon:i.createElement(x,null),direction:"down",sx:{position:"absolute",top:0,right:0,width:40,"& .MuiFab-root":{width:40,height:40}}},D.map((function(e,t){return i.createElement(m,{key:t,icon:e.icon,"aria-label":e.name,tooltipTitle:e.name,onClick:function(){e.action()}})})))))),i.createElement(c,{variant:"permanent",open:F,sx:[F&&T,!F&&G]},i.createElement(n,{sx:t({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:_.spacing(0,1)},_.mixins.toolbar)},i.createElement(l,{onClick:function(){H(!1)}},"rtl"===_.direction?i.createElement(f,null):i.createElement(u,null))),i.createElement(r,null),C.map((function(e,t){return i.createElement(n,{key:t,sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},i.createElement(g,{href:e.link,target:"_self"},i.createElement(n,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:1,cursor:"pointer"}},e.icon,!F&&e.subSections&&i.createElement(a,null,"..."),F&&i.createElement(a,{sx:{pl:2}},e.title))),e.subSections&&F&&e.subSections.map((function(e,t){return i.createElement(g,{key:t,href:e.link,target:"_self"},i.createElement(n,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:1,cursor:"pointer"}},i.createElement(a,{variant:"body2",sx:{pl:4}},e.title)))})))}))),i.createElement(n,{component:"main",sx:{flexGrow:1,minHeight:"100vh"}},i.createElement(n,{sx:t({display:"flex",alignItems:"center",justifyContent:"flex-end"},_.mixins.toolbar)}),y))}export{E as default};
|