@artibet/react-mui-components 2.7.1 → 2.7.2
Sign up to get free protection for your applications and to get access to all the features.
- package/core/index.js +1 -1
- 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 l,Popover as i,Divider as a,MenuItem as c,ListItemIcon as u,Tooltip as
|
1
|
+
import e from"react";import{Typography as t,Alert as n,Box as r,Button as o,Stack as l,Popover as i,Divider as a,MenuItem as c,ListItemIcon as u,Tooltip as s,IconButton as m,Menu as d}from"@mui/material";import{Done as f,Close as p}from"@mui/icons-material";import"date-fns";import"date-fns/locale";import{ImArrowLeft as v}from"react-icons/im";import g from"@mui/icons-material/Menu";var h=function(n){var r=n.label,o=void 0===r?"":r,l=n.color,i=void 0===l?"white":l,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,E={text:{display:"inline-block",textAlign:"center",backgroundColor:c,paddingX:s,paddingY:d,borderRadius:p,width:void 0===h?"auto":h,color:i,fontSize:g}};return e.createElement(t,{sx:E.text},o)},E=function(t){var r=t.errors,o=t.marginBottom,l=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:l},key:o,severity:"error"},r[t])})))},b=function(t){var n=t.on,r=t.showOn,o=void 0===r||r,l=t.showOff,i=void 0===l||l,a=t.size,c=void 0===a?24:a;return Boolean(n)?o?e.createElement(f,{color:"success",sx:{fontSize:c}}):null:i?e.createElement(p,{color:"error",sx:{fontSize:c}}):null},y=function(t){var n=t.status,r=t.showYes,o=void 0===r||r,l=t.showNo,i=void 0===l||l,a=t.width,c=void 0===a?80:a;return Boolean(n)?o&&e.createElement(h,{label:"ΝΑΙ",backgroundColor:"green",fontSize:"12px",paddingX:"5px",width:c}):i&&e.createElement(h,{label:"ΟΧΙ",backgroundColor:"red",fontSize:"12px",paddingX:"5px",width:c})},x=function(t){var n,o,l=t.amount,i=t.align,a=void 0===i?"left":i;return e.createElement(r,{sx:{textAlign:a}},null==(o=n=l)||""===o?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(n))},w=function(n){var i=n.position,a=void 0===i?"top":i,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(l,{direction:"row",spacing:1,sx:{alignItems:"center"}},e.createElement(v,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 C(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,l,i,a=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.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&&(i=n.return(),Object(i)!==i))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 z=function(n){var i=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,g=n.titleProps,h=void 0===g?{}:g,E=n.returnButtonProps,b=void 0===E?{}:E,y=e.createElement(o,k({color:"warning",onClick:p?p():function(){return history.back()}},b),e.createElement(l,{direction:"row",spacing:1,sx:{alignItems:"center"}},e.createElement(v,null),e.createElement(t,null,d))),x=e.createElement(t,k({variant:"h6"},h),i),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&&x,s&&y,"right"===c&&x),e.createElement("hr",null))},j=function(t){var n=t.popup,r=t.children,o=t.verticalAnchor,l=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=C(e.useState(null),2),p=f[0],v=f[1],g=Boolean(p),h=function(){v(null)},E=r?e.cloneElement(r,{onMouseEnter:function(e){v(e.currentTarget)},onMouseLeave:h}):null;return e.createElement(e.Fragment,null,E,e.createElement(i,{id:"mouse-over-popup",sx:{pointerEvents:"none"},open:g,anchorEl:p,anchorOrigin:{vertical:l,horizontal:c},transformOrigin:{vertical:s,horizontal:d},onClose:h,disableRestoreFocus:!0},n))},S=function(t){var n=t.option;return n.divider?e.createElement(a,null):e.createElement(c,{onClick:function(e){n.onClick&&(e.stopPropagation(),n.onClick())}},n.icon&&e.createElement(u,null,n.icon),n.label)},A=function(t){var n=t.tooltip,o=void 0===n?"Επιλογές":n,l=t.menuIcon,i=void 0===l?e.createElement(g,null):l,a=t.options,c=void 0===a?[]:a,u=C(e.useState(null),2),f=u[0],p=u[1],v=Boolean(f),h=function(){p(null)};return 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"},i))),e.createElement(d,{anchorEl:f,open:v,onClose:h,onClick:h,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"}},c.map((function(t,n){return e.createElement(S,{key:n,option:t})}))))};export{x as Currency,w as GoBack,j as MouseOverPopup,h as MyChip,z as PageTitle,A as PopupMenu,E as ShowErrors,b as StatusIcon,y as YesNoChip};
|