umwd-components 0.1.631 → 0.1.632

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.
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
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};
6
+ import{__exports as r}from"../../_virtual/index8.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/index8.js";
6
+ import{__exports as a}from"../../_virtual/index7.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};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+ import{extends as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as a,__spreadArray as t}from"../../../node_modules/tslib/tslib.es6.js";import l,{useEffect as r}from"react";import i from"@mui/material/TextField";var o=function(o){var n=o.label,m=o.minNewValue,u=o.maxNewValue,s=a(l.useState(0),2),d=s[0],v=s[1];return r((function(){o.setValueCallback&&o.setValueCallback(d)}),[d]),l.createElement(i,e({},o,{type:"number",label:n,size:"small",value:d,onChange:function(e){var a=Number(e.target.value);v(void 0!==m&&void 0!==u?Math.max(m,Math.min(a,u)):void 0!==m?Math.max(a,m):void 0!==u?Math.min(a,u):a)},inputProps:{step:1,min:null!=m?m:void 0,max:null!=u?u:void 0},onWheel:function(e){e.target.blur()},helperText:"min: ".concat(m,", max: ").concat(u),error:void 0!==m&&d<m||void 0!==u&&d>u||o.error,sx:t([{width:"9rem"}],a(Array.isArray(null==o?void 0:o.sx)?o.sx:[o.sx]),!1)}))};export{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,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as n,useEffect as o,Suspense as i}from"react";import{useFormState as m}from"react-dom";import{requestRmaAction as l}from"../../../data/actions/e-commerce/iro/requestRmaAction.js";import{SubmitButton as u}from"../../SubmitButton.js";import c from"@mui/material/Typography";import d from"@mui/material/Grid";import s from"@mui/material/Box";import p from"@mui/material/TextField";import f from"@mui/material/Checkbox";import v from"@mui/material/Button";import E from"@mui/material/Stack";import{Divider as h}from"@mui/material";import{TextualAmountUpdater as g}from"../../common/TextualAmountUpdater.js";import y from"@mui/material/Dialog";import _ from"@mui/material/DialogActions";import b from"@mui/material/DialogContent";import C from"@mui/material/DialogContentText";import x from"@mui/material/DialogTitle";var q={zodErrors:null,strapiErrors:null,data:null,message:null},k=function(t){var m=t.items,l=e(n([]),2),u=l[0],d=l[1],s=e(n([]),2);s[0],s[1];var f=e(n(!1),2),v=f[0],y=f[1],_=e(n(!1),2);_[0],_[1];var b=function(e,t,a){d(u.map((function(n,o){var i;return o===e?r(r({},n),((i={})[t]=a,i)):n})))};o((function(){m&&d(m.map((function(e){return{line_item_number:e.line_item_number,product:e.product,ordered_quantity:e.ordered_quantity,returned_quantity:0,reason:"damaged",other_reason:""}})))}),[m]);var C=e(n([]),2),x=C[0],q=C[1];return o((function(){u&&q(u.map((function(e,t){return{line_item_number:"".concat(t+1,".0.0"),product:"object"==typeof e.product&&"id"in e.product?e.product.id:0,returned_quantity:e.returned_quantity,reason:e.reason,other_reason:e.other_reason||""}})))}),[u]),a.createElement(i,{fallback:a.createElement("div",null,"Loading...")},a.createElement(E,{spacing:2},a.createElement(c,{variant:"h6"},"Items"),a.createElement(c,{variant:"body1"},"from the items in the original order please select the items you'd like to return"),a.createElement("input",{type:"hidden",name:"iro_items",value:JSON.stringify(x)}),a.createElement(E,{spacing:1},m.map((function(e,t){var r,n;return a.createElement(E,{spacing:1},a.createElement(c,{variant:"body1"},"Line Item Number: ",e.line_item_number),a.createElement(c,{variant:"body1"},"Part Number: ",null===(r=e.product)||void 0===r?void 0:r.product_number),a.createElement(c,{variant:"body1"},"Quantity Ordered: ",e.ordered_quantity),a.createElement(g,{label:"Quantity to return",currentValue:e.ordered_quantity,totalValue:e.ordered_quantity,minNewValue:0,maxNewValue:e.ordered_quantity,handleChange:function(e){console.log(e),b(t,"returned_quantity",e)},color:"info"}),a.createElement(c,{variant:"body1"},"Reason for return:"),a.createElement(p,{value:null===(n=u[t])||void 0===n?void 0:n.reason,select:!0,SelectProps:{native:!0},variant:"outlined",fullWidth:!0,onChange:function(e){var r=e.target.value;y("other"===r),b(t,"reason",r)}},a.createElement("option",{value:"damaged"},"Damaged on arrival"),a.createElement("option",{value:"not_as_described"},"Not as described"),a.createElement("option",{value:"wrong_item"},"Wrong item"),a.createElement("option",{value:"other"},"Other")),v&&a.createElement(p,{value:u[t].other_reason,label:"Custom reason",variant:"outlined",fullWidth:!0,onChange:function(e){var r=e.target.value;b(t,"other_reason",r)}}),a.createElement(h,null))})))))},A=function(t){var r=t.open,o=t.onClose;t.data;var i=e(n(!0),2),m=i[0],l=i[1];return a.createElement(y,{open:r,onClose:o},a.createElement(x,null,"Confirm RMA"),a.createElement(b,null,a.createElement(C,null,"Are you sure you want to request a return merchandise authorization for the selected items?"),a.createElement(f,{onChange:function(e){return l(!e.target.checked)}}),a.createElement(c,{variant:"body1"},"I understand that all returned items must be unused and unopened")),a.createElement(_,null,a.createElement(u,{text:"Yes",loadingText:"Loading...",disabled:m}),a.createElement(v,{onClick:o},"No")))};function N(r){var i,u,p,f=r.opo,h=r.sx,g=r.revalidateCallback;r.handleClose;var y=e(m(l,q),2),_=y[0],b=y[1],C=e(n(!1),2),x=C[0],N=C[1];return o((function(){(null==_?void 0:_.data)&&g&&g()}),[_.data]),a.createElement(s,{sx:t([],e(Array.isArray(h)?h:[h]),!1)},a.createElement("form",{action:b},a.createElement(d,{container:!0,spacing:2},a.createElement(d,{item:!0,xs:12},a.createElement(c,{variant:"h6"},"RMA Form")),a.createElement("input",{type:"hidden",name:"opos",value:JSON.stringify([f.id])}),a.createElement(d,{item:!0,xs:12},a.createElement(E,{spacing:2},a.createElement(c,{variant:"body1"},"Please fill out the form below to request a return merchandise authorization. Due to the sensitive nature of the products, only unopened packages can be returned."))),a.createElement(d,{item:!0,xs:12},(null===(i=f.opo_items)||void 0===i?void 0:i.data)?a.createElement(E,{spacing:1},(null===(u=f.opo_items)||void 0===u?void 0:u.data)&&a.createElement(k,{items:null===(p=f.opo_items)||void 0===p?void 0:p.data})):a.createElement(c,{variant:"body1"},"No items")),a.createElement(A,{data:_,open:x,onClose:function(){return N(!x)}}),a.createElement(d,{item:!0,xs:12},a.createElement(v,{onClick:function(){return N(!x)}},"Request RMA")))))}export{N as default};
7
+ import{__read as e,__spreadArray as t,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import n,{useState as a,useEffect as o,Suspense as i}from"react";import{useFormState as m}from"react-dom";import{requestRmaAction as l}from"../../../data/actions/e-commerce/iro/requestRmaAction.js";import{SubmitButton as u}from"../../SubmitButton.js";import c from"@mui/material/Typography";import d from"@mui/material/Grid";import s from"@mui/material/Box";import p from"@mui/material/TextField";import f from"@mui/material/Checkbox";import E from"@mui/material/Button";import v from"@mui/material/Stack";import{Divider as g}from"@mui/material";import h from"@mui/material/Dialog";import b from"@mui/material/DialogActions";import y from"@mui/material/DialogContent";import _ from"@mui/material/DialogContentText";import x from"@mui/material/DialogTitle";import C from"../../common/NumberInput.js";var k={zodErrors:null,strapiErrors:null,data:null,message:null},q=function(m){var l=m.items,u=e(a([]),2),d=u[0],s=u[1],E=e(a([]),2),h=E[0],b=E[1],y=e(a(!1),2),_=y[0],x=y[1],k=function(e,t,n){s(d.map((function(a,o){var i;return o===e?r(r({},a),((i={})[t]=n,i)):a})))};o((function(){l&&s(l.map((function(e){return{line_item_number:e.line_item_number,product:e.product,ordered_quantity:e.ordered_quantity,returned_quantity:0,reason:"damaged",other_reason:""}})))}),[l]);var q=e(a([]),2),N=q[0],w=q[1];return o((function(){d&&w(d.map((function(e,t){return{line_item_number:"".concat(t+1,".0.0"),product:"object"==typeof e.product&&"id"in e.product?e.product.id:0,returned_quantity:e.returned_quantity,reason:e.reason,other_reason:e.other_reason||""}})))}),[d]),n.createElement(i,{fallback:n.createElement("div",null,"Loading...")},n.createElement(v,{spacing:2},n.createElement(c,{variant:"h6"},"Items"),n.createElement(c,{variant:"body1"},"from the items in the original order please select the items you'd like to return"),n.createElement("input",{type:"hidden",name:"iro_items",value:JSON.stringify(N)}),n.createElement(v,{spacing:1},l.map((function(r,a){var o,i;return n.createElement(n.Fragment,null,n.createElement(v,{spacing:1,direction:"row",alignItems:"center"},n.createElement(f,{checked:h.includes(a),onChange:function(r){r.target.checked?b(t(t([],e(h),!1),[a],!1)):b(h.filter((function(e){return e!==a})))}}),n.createElement(c,{variant:"body1"},"Line Item Number: ",r.line_item_number),n.createElement(c,{variant:"body1"},"Part Number: ",null===(o=r.product)||void 0===o?void 0:o.product_number),n.createElement(c,{variant:"body1"},"Quantity Ordered: ",r.ordered_quantity)),h.includes(a)&&n.createElement(n.Fragment,null,n.createElement(v,{direction:"row",spacing:1,alignItems:"center"},n.createElement(C,{label:"Quantity to return",minNewValue:0,maxNewValue:r.ordered_quantity,setValueCallback:function(e){k(a,"returned_quantity",e)},sx:{width:"12rem"}}),n.createElement(g,{orientation:"vertical",flexItem:!0}),n.createElement(c,{variant:"body1",sx:{width:"12rem"}},"Reason for return:"),n.createElement(p,{value:null===(i=d[a])||void 0===i?void 0:i.reason,select:!0,SelectProps:{native:!0},variant:"outlined",fullWidth:!0,onChange:function(e){var t=e.target.value;x("other"===t),k(a,"reason",t)}},n.createElement("option",{value:"damaged"},"Damaged on arrival"),n.createElement("option",{value:"not_as_described"},"Not as described"),n.createElement("option",{value:"wrong_item"},"Wrong item"),n.createElement("option",{value:"other"},"Other"))),_&&n.createElement(p,{value:d[a].other_reason,label:"Custom reason",variant:"outlined",fullWidth:!0,onChange:function(e){var t=e.target.value;k(a,"other_reason",t)}})),n.createElement(g,null))})))))},N=function(t){var r=t.open,o=t.onClose;t.data;var i=e(a(!0),2),m=i[0],l=i[1];return n.createElement(h,{open:r,onClose:o},n.createElement(x,null,"Confirm RMA"),n.createElement(y,null,n.createElement(_,null,"Are you sure you want to request a return merchandise authorization for the selected items?"),n.createElement(f,{onChange:function(e){return l(!e.target.checked)}}),n.createElement(c,{variant:"body1"},"I understand that all returned items must be unused and unopened")),n.createElement(b,null,n.createElement(u,{text:"Yes",loadingText:"Loading...",disabled:m}),n.createElement(E,{onClick:o},"No")))};function w(r){var i,u,p,f=r.opo,g=r.sx,h=r.revalidateCallback;r.handleClose;var b=e(m(l,k),2),y=b[0],_=b[1],x=e(a(!1),2),C=x[0],w=x[1];return o((function(){(null==y?void 0:y.data)&&h&&h()}),[y.data]),n.createElement(s,{sx:t([],e(Array.isArray(g)?g:[g]),!1)},n.createElement("form",{action:_},n.createElement(d,{container:!0,spacing:2},n.createElement(d,{item:!0,xs:12},n.createElement(c,{variant:"h6"},"RMA Form")),n.createElement("input",{type:"hidden",name:"opos",value:JSON.stringify([f.id])}),n.createElement(d,{item:!0,xs:12},n.createElement(v,{spacing:2},n.createElement(c,{variant:"body1"},"Please fill out the form below to request a return merchandise authorization. Due to the sensitive nature of the products, only unopened packages can be returned."))),n.createElement(d,{item:!0,xs:12},(null===(i=f.opo_items)||void 0===i?void 0:i.data)?n.createElement(v,{spacing:1},(null===(u=f.opo_items)||void 0===u?void 0:u.data)&&n.createElement(q,{items:null===(p=f.opo_items)||void 0===p?void 0:p.data})):n.createElement(c,{variant:"body1"},"No items")),n.createElement(N,{data:y,open:C,onClose:function(){return w(!C)}}),n.createElement(d,{item:!0,xs:12},n.createElement(E,{onClick:function(){return w(!C)}},"Request RMA")))))}export{w as default};