@corva/ui 0.43.0-0 → 0.43.0-1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{makeStyles as t,Tooltip as r,IconButton as o}from"@material-ui/core";import a from"classnames";import{jsx as c}from"react/jsx-runtime";function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function n(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?i(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var d=t((function(e){return{root:{width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7},borderRadius:"50%"},button:{width:"100%",height:"100%","&:hover":{backgroundColor:e.palette.background.b7}}}}));function s(e){var t=e.className,i=e.disabled,s=e.isDraggableAndResizable,l=e.lockedIcon,b=e.onClick,p=e.pageName,u=e.tooltipProps,f=d();return c(r,n(n({title:i?"Can't unlock dashboard layout":s?"Lock Dashboard Layout":"Unlock Dashboard Layout"},u),{},{children:c("div",{className:a(f.root,t),children:c(o,{className:f.button,color:"primary","data-testid":"".concat(p,"_").concat(s?"gridUnlocked":"gridLocked"),disabled:i,onClick:b,children:c("img",{src:s?"/static/media/b1dce244ca65e361a28be5801cf93d73.svg":l,alt:"Lock"})})})}))}s.defaultProps={lockedIcon:"/static/media/2d1e493e7f3afb84f4a5c8aded37a718.svg",tooltipProps:{}},s.LockedWhiteIcon="/static/media/fb9a5d3233e9e3e310d6d297e6ddcc55.svg";export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as
|
|
1
|
+
import o from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useEffect as r}from"react";import n from"prop-types";import{IconButton as i,withStyles as a,Tooltip as s,Menu as c}from"@material-ui/core";import{MoreVert as l}from"@material-ui/icons";import{jsx as p,jsxs as u,Fragment as m}from"react/jsx-runtime";function d(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}))}return e}function f(o){var n=o.classes,i=o["data-testid"],a=o.iconButtonStyle,l=o.color,d=o.disableRipple,f=o.className,b=o.IconElement,g=o.IconButtonComponent,O=o.disabled,y=o.iconButtonProps,v=o.children,P=o.anchorOrigin,j=o.transformOrigin,B=o.marginThreshold,T=o.menuProps,w=o.tooltipProps,I=t(null),C=e(I,2),E=C[0],S=C[1],z=!!E,D=t(!1),N=e(D,2),R=N[0],k=N[1];r((function(){var o;return z&&setTimeout((function(){o=k(z)}),500),function(){o&&clearTimeout(o)}}),[z]);var x=function(o){o.stopPropagation(),S(null),k(!1)},A=p(g,h(h({"aria-label":"IconMenu","aria-owns":z?"icon-menu":void 0,"aria-haspopup":"true","data-testid":i,onClick:function(o){o.stopPropagation(),S(o.currentTarget)},classes:{root:n.iconButton},className:f,style:a,color:l,disableRipple:d,disabled:O},y),{},{children:b}));return u(m,{children:[w?p(s,h(h({},w),{},{children:A})):A,p(c,h(h({id:"icon-menu",anchorEl:E,open:z,disableAutoFocus:!R,autoFocus:R,onClose:x,onClick:x,anchorOrigin:P,transformOrigin:j,classes:{paper:n.paper},elevation:0,marginThreshold:B},T),{},{children:v}))]})}f.propTypes={children:n.oneOfType([n.string,n.node,n.array]),classes:n.shape({iconButton:n.string,paper:n.string}),className:n.string,color:n.string,IconElement:n.element,IconButtonComponent:n.any,iconButtonStyle:n.shape({}),anchorOrigin:n.shape({horizontal:n.oneOf(["left","center","right"]),vertical:n.oneOf(["top","center","bottom"])}),transformOrigin:n.shape({horizontal:n.oneOf(["left","center","right"]),vertical:n.oneOf(["top","center","bottom"])}),disableRipple:n.bool,"data-testid":n.string,marginThreshold:n.number,disabled:n.bool,tooltipProps:n.shape({}),menuProps:n.shape({}),iconButtonProps:n.shape({})},f.defaultProps={children:void 0,classes:{},className:void 0,color:void 0,"data-testid":void 0,IconElement:p(l,{}),iconButtonStyle:void 0,IconButtonComponent:i,disableRipple:!1,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"bottom"},marginThreshold:void 0,disabled:!1,tooltipProps:void 0,menuProps:{},iconButtonProps:{}};var b=a({iconButton:{padding:"10px",color:"white"},paper:{}})(f);export{b as default};
|