@artibet/react-mui-components 2.8.0 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/core/index.js +1 -1
  2. package/package.json +1 -1
package/core/index.js CHANGED
@@ -1 +1 @@
1
- import e from"react";import{Typography as t,Alert as n,Box as r,Button as o,Stack as i,Popover as l,Divider as a,MenuItem as c,ListItemIcon as u,Tooltip as s,IconButton as m,Menu as d,Paper as p}from"@mui/material";import{Done as f,Close as v}from"@mui/icons-material";import"date-fns";import"date-fns/locale";import{ImArrowLeft as g}from"react-icons/im";import h from"@mui/icons-material/Menu";var x=function(n){var r=n.label,o=void 0===r?"":r,i=n.color,l=void 0===i?"white":i,a=n.backgroundColor,c=void 0===a?"#888888":a,u=n.paddingX,s=void 0===u?"10px":u,m=n.paddingY,d=void 0===m?"5px":m,p=n.borderRadius,f=void 0===p?"10px":p,v=n.fontSize,g=void 0===v?"14px":v,h=n.width,x={text:{display:"inline-block",textAlign:"center",backgroundColor:c,paddingX:s,paddingY:d,borderRadius:f,width:void 0===h?"auto":h,color:l,fontSize:g}};return e.createElement(t,{sx:x.text},o)},E=function(t){var r=t.errors,o=t.marginBottom,i=void 0===o?3:o;return 0===Object.keys(r).length?null:e.createElement(e.Fragment,null,Object.keys(r).map((function(t,o){return e.createElement(n,{sx:{marginBottom:i},key:o,severity:"error"},r[t])})))},b=function(t){var n=t.on,r=t.showOn,o=void 0===r||r,i=t.showOff,l=void 0===i||i,a=t.size,c=void 0===a?24:a;return Boolean(n)?o?e.createElement(f,{color:"success",sx:{fontSize:c}}):null:l?e.createElement(v,{color:"error",sx:{fontSize:c}}):null},y=function(t){var n=t.status,r=t.showYes,o=void 0===r||r,i=t.showNo,l=void 0===i||i,a=t.width,c=void 0===a?80:a;return Boolean(n)?o&&e.createElement(x,{label:"ΝΑΙ",backgroundColor:"green",fontSize:"12px",paddingX:"5px",width:c}):l&&e.createElement(x,{label:"ΟΧΙ",backgroundColor:"red",fontSize:"12px",paddingX:"5px",width:c})},w=function(t){var n,o,i=t.amount,l=t.align,a=void 0===l?"left":l;return e.createElement(r,{sx:{textAlign:a}},null==(o=n=i)||""===o?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(n))},C=function(n){var l=n.position,a=void 0===l?"top":l,c=n.label,u=void 0===c?"ΕΠΙΣΤΡΟΦΗ":c;return e.createElement(r,{sx:{marginBottom:1}},"bottom"===a&&e.createElement("hr",null),e.createElement(r,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement(o,{color:"warning",onClick:function(){return history.back()}},e.createElement(i,{direction:"row",spacing:1,sx:{alignItems:"center"}},e.createElement(g,null),e.createElement(t,null,u)))),"top"===a&&e.createElement("hr",null))};function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var j=function(n){var l=n.title,a=n.titlePosition,c=void 0===a?"right":a,u=n.showReturnButton,s=void 0===u||u,m=n.returnButtonLabel,d=void 0===m?"ΕΠΙΣΤΡΟΦΗ":m,p=n.onReturn,f=void 0===p?null:p,v=n.titleProps,h=void 0===v?{}:v,x=n.returnButtonProps,E=void 0===x?{}:x,b=e.createElement(o,k({color:"warning",onClick:f?f():function(){return history.back()}},E),e.createElement(i,{direction:"row",spacing:1,sx:{alignItems:"center"}},e.createElement(g,null),e.createElement(t,null,d))),y=e.createElement(t,k({variant:"h6"},h),l),w="space-between";return s||(w="left"===c?"flex-start":"flex-end"),e.createElement(e.Fragment,null,e.createElement(r,{sx:{display:"flex",justifyContent:{justifyContent:w},alignItems:"center"}},"left"===c&&y,s&&b,"right"===c&&y),e.createElement("hr",null))},z=function(t){var n=t.popup,r=t.children,o=t.verticalAnchor,i=void 0===o?"bottom":o,a=t.horizontalAnchor,c=void 0===a?"left":a,u=t.verticalTransform,s=void 0===u?"top":u,m=t.horizontalTransform,d=void 0===m?"left":m,p=B(e.useState(null),2),f=p[0],v=p[1],g=Boolean(f),h=function(){v(null)},x=r?e.cloneElement(r,{onMouseEnter:function(e){v(e.currentTarget)},onMouseLeave:h}):null;return e.createElement(e.Fragment,null,x,e.createElement(l,{id:"mouse-over-popup",sx:{pointerEvents:"none"},open:g,anchorEl:f,anchorOrigin:{vertical:i,horizontal:c},transformOrigin:{vertical:s,horizontal:d},onClose:h,disableRestoreFocus:!0},n))},S=function(t){var n=t.option,r=t.onClose;return n.hidden?null:n.divider?e.createElement(a,null):e.createElement(c,{onClick:function(e){e.stopPropagation(),n.onClick&&(r(e),n.onClick())}},n.icon&&e.createElement(u,null,n.icon),n.label)},A=function(t){var n=t.tooltip,o=void 0===n?"Επιλογές":n,i=t.menuIcon,l=void 0===i?e.createElement(h,null):i,a=t.options,c=void 0===a?[]:a,u=B(e.useState(null),2),p=u[0],f=u[1],v=Boolean(p),g=function(e){e.stopPropagation(),f(null)};return c&&0!==c.length&&c.some((function(e){return!e.hidden}))?e.createElement(e.Fragment,null,e.createElement(r,{sx:{display:"flex",alignItems:"center",textAlign:"center"}},e.createElement(s,{title:o},e.createElement(m,{onClick:function(e){e.stopPropagation(),f(e.currentTarget)},size:"small"},l))),e.createElement(d,{anchorEl:p,open:v,onClose:g,onClick:g,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"}},c.map((function(t,n){return e.createElement(S,{key:n,option:t,onClose:g})})))):null},I=function(t){var n=t.icon,o=t.title,i=void 0===o?"":o,l=t.subtitle,a=void 0===l?"":l,c=t.backgroundColor,u=void 0===c?"white":c,s=t.elevation,m=void 0===s?2:s,d=t.iconBackgroundColor,f=void 0===d?"white":d,v=t.iconPadding,g={paper:{backgroundColor:u},wrapperBox:{display:"flex",flexDirection:"row",justifyContent:"start",gap:1},iconBox:{backgroundColor:f,padding:void 0===v?"15px":v,display:"inline-block"},contentBox:{display:"flex",flexDirection:"column",gap:1}};return e.createElement(p,{elevation:m,sx:g.paper,square:!0},e.createElement(r,{sx:g.wrapperBox},e.createElement(r,{sx:g.iconBox},n),e.createElement(r,{sx:g.contentBox},e.createElement(r,{sx:{marginTop:"3px"}},i),e.createElement(r,null,a))))};export{w as Currency,C as GoBack,I as IconCard,z as MouseOverPopup,x as MyChip,j as PageTitle,A as PopupMenu,E as ShowErrors,b as StatusIcon,y as YesNoChip};
1
+ import e from"react";import{Typography as t,Alert as n,Box as r,Button as o,Stack as i,Popover as l,Divider as a,MenuItem as c,ListItemIcon as u,Tooltip as s,IconButton as m,Menu as d,Paper as f}from"@mui/material";import{Done as p,Close as v}from"@mui/icons-material";import"date-fns";import"date-fns/locale";import{ImArrowLeft as g}from"react-icons/im";import h from"@mui/icons-material/Menu";var x=function(n){var r=n.label,o=void 0===r?"":r,i=n.color,l=void 0===i?"white":i,a=n.backgroundColor,c=void 0===a?"#888888":a,u=n.paddingX,s=void 0===u?"10px":u,m=n.paddingY,d=void 0===m?"5px":m,f=n.borderRadius,p=void 0===f?"10px":f,v=n.fontSize,g=void 0===v?"14px":v,h=n.width,x={text:{display:"inline-block",textAlign:"center",backgroundColor:c,paddingX:s,paddingY:d,borderRadius:p,width:void 0===h?"auto":h,color:l,fontSize:g}};return e.createElement(t,{sx:x.text},o)},E=function(t){var r=t.errors,o=t.marginBottom,i=void 0===o?3:o;return 0===Object.keys(r).length?null:e.createElement(e.Fragment,null,Object.keys(r).map((function(t,o){return e.createElement(n,{sx:{marginBottom:i},key:o,severity:"error"},r[t])})))},b=function(t){var n=t.on,r=t.showOn,o=void 0===r||r,i=t.showOff,l=void 0===i||i,a=t.size,c=void 0===a?24:a;return Boolean(n)?o?e.createElement(p,{color:"success",sx:{fontSize:c}}):null:l?e.createElement(v,{color:"error",sx:{fontSize:c}}):null},y=function(t){var n=t.status,r=t.showYes,o=void 0===r||r,i=t.showNo,l=void 0===i||i,a=t.width,c=void 0===a?80:a;return Boolean(n)?o&&e.createElement(x,{label:"ΝΑΙ",backgroundColor:"green",fontSize:"12px",paddingX:"5px",width:c}):l&&e.createElement(x,{label:"ΟΧΙ",backgroundColor:"red",fontSize:"12px",paddingX:"5px",width:c})},w=function(t){var n,o,i=t.amount,l=t.align,a=void 0===l?"left":l;return e.createElement(r,{sx:{textAlign:a}},null==(o=n=i)||""===o?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(n))},C=function(n){var l=n.position,a=void 0===l?"top":l,c=n.label,u=void 0===c?"ΕΠΙΣΤΡΟΦΗ":c;return e.createElement(r,{sx:{marginBottom:1}},"bottom"===a&&e.createElement("hr",null),e.createElement(r,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement(o,{color:"warning",onClick:function(){return history.back()}},e.createElement(i,{direction:"row",spacing:1,sx:{alignItems:"center"}},e.createElement(g,null),e.createElement(t,null,u)))),"top"===a&&e.createElement("hr",null))};function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,a=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var j=function(n){var l=n.title,a=n.titlePosition,c=void 0===a?"right":a,u=n.showReturnButton,s=void 0===u||u,m=n.returnButtonLabel,d=void 0===m?"ΕΠΙΣΤΡΟΦΗ":m,f=n.onReturn,p=void 0===f?null:f,v=n.titleProps,h=void 0===v?{}:v,x=n.returnButtonProps,E=void 0===x?{}:x,b=e.createElement(o,k({color:"warning",onClick:p?p():function(){return history.back()}},E),e.createElement(i,{direction:"row",spacing:1,sx:{alignItems:"center"}},e.createElement(g,null),e.createElement(t,null,d))),y=e.createElement(t,k({variant:"h6"},h),l),w="space-between";return s||(w="left"===c?"flex-start":"flex-end"),e.createElement(e.Fragment,null,e.createElement(r,{sx:{display:"flex",justifyContent:{justifyContent:w},alignItems:"center"}},"left"===c&&y,s&&b,"right"===c&&y),e.createElement("hr",null))},z=function(t){var n=t.popup,r=t.children,o=t.verticalAnchor,i=void 0===o?"bottom":o,a=t.horizontalAnchor,c=void 0===a?"left":a,u=t.verticalTransform,s=void 0===u?"top":u,m=t.horizontalTransform,d=void 0===m?"left":m,f=B(e.useState(null),2),p=f[0],v=f[1],g=Boolean(p),h=function(){v(null)},x=r?e.cloneElement(r,{onMouseEnter:function(e){v(e.currentTarget)},onMouseLeave:h}):null;return e.createElement(e.Fragment,null,x,e.createElement(l,{id:"mouse-over-popup",sx:{pointerEvents:"none"},open:g,anchorEl:p,anchorOrigin:{vertical:i,horizontal:c},transformOrigin:{vertical:s,horizontal:d},onClose:h,disableRestoreFocus:!0},n))},S=function(t){var n=t.option,r=t.onClose;return n.hidden?null:n.divider?e.createElement(a,null):e.createElement(c,{onClick:function(e){e.stopPropagation(),n.onClick&&(r(e),n.onClick())}},n.icon&&e.createElement(u,null,n.icon),n.label)},I=function(t){var n=t.tooltip,o=void 0===n?"Επιλογές":n,i=t.menuIcon,l=void 0===i?e.createElement(h,null):i,a=t.options,c=void 0===a?[]:a,u=B(e.useState(null),2),f=u[0],p=u[1],v=Boolean(f),g=function(e){e.stopPropagation(),p(null)};return c&&0!==c.length&&c.some((function(e){return!e.hidden}))?e.createElement(e.Fragment,null,e.createElement(r,{sx:{display:"flex",alignItems:"center",textAlign:"center"}},e.createElement(s,{title:o},e.createElement(m,{onClick:function(e){e.stopPropagation(),p(e.currentTarget)},size:"small"},l))),e.createElement(d,{anchorEl:f,open:v,onClose:g,onClick:g,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"}},c.map((function(t,n){return e.createElement(S,{key:n,option:t,onClose:g})})))):null},A=function(t){var n=t.icon,o=t.title,i=void 0===o?"":o,l=t.subtitle,a=void 0===l?"":l,c=t.backgroundColor,u=void 0===c?"white":c,s=t.elevation,m=void 0===s?2:s,d=t.iconBackgroundColor,p=void 0===d?"gray":d,v=t.iconColor,g=void 0===v?"white":v,h=t.width,x={paper:{backgroundColor:u,width:void 0===h?"100%":h},wrapperBox:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"start",gap:2},iconBox:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",color:g,backgroundColor:p,padding:0,margin:0,width:"72px",height:"72px",fontSize:"48px"},contentBox:{display:"flex",paddingRight:"15px",flexDirection:"column"}};return e.createElement(f,{elevation:m,sx:x.paper,square:!0},e.createElement(r,{sx:x.wrapperBox},e.createElement(r,{sx:x.iconBox},n),e.createElement(r,{sx:x.contentBox},e.createElement(r,null,i),e.createElement(r,null,a))))};export{w as Currency,C as GoBack,A as IconCard,z as MouseOverPopup,x as MyChip,j as PageTitle,I as PopupMenu,E as ShowErrors,b as StatusIcon,y as YesNoChip};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {