@corva/ui 0.61.0-11 → 0.61.0-12

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
- "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),i=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),r=require("@material-ui/core"),l=require("@material-ui/icons/Straighten"),n=require("../ChartWrapperContext.js"),u=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(e),c=a(t),f=a(i),p=a(l),h=["left","width","top","bottom","right","labelOffset","isXAxis","height","coll","onCustomizeScaleClick"],d=r.makeStyles((function(e){return{axis:function(e){return{position:"absolute",cursor:"pointer",width:e.width,left:e.left,bottom:e.bottom,height:e.height}},tooltip:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:125,backgroundColor:e.palette.background.b9,color:e.palette.text.primary,fontSize:"12px",lineHeight:"16px",letterSpacing:"0.4px",borderRadius:"4px",padding:"4px",zIndex:1e4},tooltipIcon:{fontSize:16,color:e.palette.primary.text6}}}));module.exports=function(e){var t,i=e.left,l=e.width,a=e.top,x=e.bottom,g=e.right,m=e.labelOffset,b=e.isXAxis,y=e.height,C=e.coll,v=e.onCustomizeScaleClick,j=f.default(e,h),S=o.useContext(n).chart,q=o.useState({}),E=c.default(q,2),w=E[0],k=E[1],z=o.useRef(),W=14+m,B=14+m,I=d({top:a,right:g,width:b?l+B:B,height:b?B:y+B,left:b?i-5:i-B,bottom:b?x-B:x-5}),M=null===(t=z.current)||void 0===t?void 0:t.getBoundingClientRect(),P=u.jsxs("div",{className:I.tooltip,children:[u.jsx(p.default,{className:I.tooltipIcon})," Customize Scale"]}),R=function(){S.update(s.default({},C,{lineColor:"#03BCD4",lineWidth:2,labels:{style:{color:"#ffffff"}},title:{style:{color:"#ffffff"}}}))},A=function(){S.update(s.default({},C,{lineColor:"rgb(87, 91, 91)",lineWidth:1,labels:{style:{color:"#9E9E9E"}},title:{style:{color:"#9E9E9E"}}}))};return o.useEffect((function(){var e=S.axisGroup;e&&(e.element.style.cursor="pointer")}),[S]),u.jsx(r.Tooltip,{title:P,placement:b?"top":"right",onMouseMove:function(e){var t=e.pageX,i=e.pageY;k({x:t,y:i})},PopperProps:{anchorEl:{clientHeight:0,clientWidth:0,getBoundingClientRect:function(){return{top:b?M.y:w.y,left:b?w.x:M.x-W,right:b?w.x:M.x+W,bottom:b?M.y:w.y,width:0,height:0}}}},children:u.jsx("div",{className:I.axis,ref:z,onClick:function(){return v(j)},onMouseOver:R,onMouseLeave:A,onFocus:R,onBlur:A})})};
1
+ "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),i=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),r=require("@material-ui/core"),l=require("@material-ui/icons/Straighten"),n=require("../ChartWrapperContext.js"),u=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(e),c=a(t),f=a(i),p=a(l),d=["left","width","top","bottom","right","labelOffset","height","coll","onCustomizeScaleClick"],h=r.makeStyles((function(e){return{axis:function(e){return{position:"absolute",cursor:"pointer",width:e.width,left:e.left,bottom:e.bottom,height:e.height}},tooltip:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:125,backgroundColor:e.palette.background.b9,color:e.palette.text.primary,fontSize:"12px",lineHeight:"16px",letterSpacing:"0.4px",borderRadius:"4px",padding:"4px",zIndex:1e4},tooltipIcon:{fontSize:16,color:e.palette.primary.text6}}}));module.exports=function(e){var t,i=e.left,l=e.width,a=e.top,x=e.bottom,m=e.right,g=e.labelOffset,b=e.height,y=e.coll,C=e.onCustomizeScaleClick,v=f.default(e,d),j=o.useContext(n).chart,S=o.useState({}),q=c.default(S,2),E=q[0],w=q[1],B=o.useRef(),k=(null==j?void 0:j.inverted)?"yAxis"===y:"xAxis"===y,z=14+g,W=14+g,I=h({top:a,right:m,width:k?l+W:W,height:k?W:b+W,left:k?i-5:i-W,bottom:k?x-W:x-5}),M=null===(t=B.current)||void 0===t?void 0:t.getBoundingClientRect(),P=u.jsxs("div",{className:I.tooltip,children:[u.jsx(p.default,{className:I.tooltipIcon})," Customize Scale"]}),R=function(){j.update(s.default({},y,{lineColor:"#03BCD4",lineWidth:2,labels:{style:{color:"#ffffff"}},title:{style:{color:"#ffffff"}}}))},A=function(){j.update(s.default({},y,{lineColor:"#3B3B3B",lineWidth:1,labels:{style:{color:"#9E9E9E"}},title:{style:{color:"#9E9E9E"}}}))};return o.useEffect((function(){var e=j.axisGroup;e&&(e.element.style.cursor="pointer")}),[j]),u.jsx(r.Tooltip,{title:P,placement:k?"top":"right",onMouseMove:function(e){var t=e.pageX,i=e.pageY;w({x:t,y:i})},PopperProps:{anchorEl:{clientHeight:0,clientWidth:0,getBoundingClientRect:function(){return{top:k?M.y:E.y,left:k?E.x:M.x-z,right:k?E.x:M.x+z,bottom:k?M.y:E.y,width:0,height:0}}}},children:u.jsx("div",{className:I.axis,ref:B,onClick:function(){return C(v)},onMouseOver:R,onMouseLeave:A,onFocus:R,onBlur:A})})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/objectWithoutProperties"),l=require("react"),i=require("@material-ui/core"),n=require("@material-ui/icons"),o=require("classnames"),a=require("../../IconButton/index.js"),s=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var c=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(e),p=u(t),b=u(r),m=u(o),y=["isExpanded","setIsExpanded","tooltipTitle","collapsibleHeader","collapsibleBody","maxCellWidth","maxCharsNumberFromStart","maxCharsNumberFromEnd","cellWidth","children"];function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){d.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=i.makeStyles((function(e){return{stickyCell:{position:"sticky",left:0,zIndex:2,background:e.palette.background.b6},stickyEmptyCell:{position:"sticky",right:0,zIndex:2},collapseHeader:{width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},tableCellWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},iconButton:{padding:0,fontSize:16,"&:hover":{backgroundColor:"transparent"}}}}));exports.TableCell=function(e){var t,r=e.isExpanded,o=e.setIsExpanded,u=e.tooltipTitle,d=e.collapsibleHeader,h=e.collapsibleBody,C=e.maxCellWidth,j=e.maxCharsNumberFromStart,g=e.maxCharsNumberFromEnd,O=e.cellWidth,v=e.children,E=b.default(e,y),k=E.stickyCell&&!E.emptyCell,W=x({isExpanded:r,cellWidth:O,maxCellWidth:C}),P=l.useState(!1),q=p.default(P,2),w=q[0],T=q[1];return c.jsxs(i.TableCell,f(f({},E),{},{className:m.default(d&&W.collapseHeader,k&&W.stickyCell,E.emptyCell&&W.stickyEmptyCell,k&&"stickyCell",E.emptyCell&&"stickyEmptyCell",E.className),children:[d&&c.jsxs("div",{className:W.tableCellWrapper,children:[v,c.jsx(a,{className:W.iconButton,onClick:function(){T(!1),o(!r)},tooltipProps:{title:r?"Collapse":"Expand",open:w,disableHoverListener:!0,onMouseEnter:function(){return T(!0)},onMouseLeave:function(){return T(!1)}},children:r?c.jsx(n.KeyboardArrowLeft,{}):c.jsx(n.KeyboardArrowRight,{})})]}),h&&c.jsx(s.Tooltip,{title:!r&&u,children:c.jsx("div",{children:r?v:(t=u,t.length>j+g?"".concat(t.substring(0,j)," ... ").concat(t.substring(t.length-g)):t)})}),!d&&!h&&v]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/objectWithoutProperties"),l=require("react"),i=require("@material-ui/core"),n=require("@material-ui/icons"),o=require("classnames"),a=require("../../IconButton/index.js"),s=require("../../Tooltip/Tooltip.js");require("../../Tooltip/ScrollableTooltip.js");var c=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(e),p=u(t),b=u(r),m=u(o),y=["isExpanded","setIsExpanded","tooltipTitle","collapsibleHeader","collapsibleBody","maxCellWidth","maxCharsNumberFromStart","maxCharsNumberFromEnd","cellWidth","children"];function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){d.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=i.makeStyles((function(e){return{stickyCell:{position:"sticky",left:0,zIndex:2,background:e.palette.background.b6},stickyEmptyCell:{position:"sticky",right:0,zIndex:2},collapseHeader:{width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},tableCellWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},iconButton:{padding:0,fontSize:16,"&:hover":{backgroundColor:"transparent"}}}}));exports.TableCell=function(e){var t,r=e.isExpanded,o=e.setIsExpanded,u=e.tooltipTitle,d=e.collapsibleHeader,h=e.collapsibleBody,C=e.maxCellWidth,j=e.maxCharsNumberFromStart,g=e.maxCharsNumberFromEnd,O=e.cellWidth,v=e.children,E=b.default(e,y),k=E.stickyCell&&!E.emptyCell,W=x({isExpanded:r,cellWidth:O,maxCellWidth:C}),P=l.useState(!1),q=p.default(P,2),w=q[0],T=q[1];return c.jsxs(i.TableCell,f(f({},E),{},{className:m.default(d&&W.collapseHeader,k&&W.stickyCell,E.emptyCell&&W.stickyEmptyCell,k&&"stickyCell",E.emptyCell&&"stickyEmptyCell",E.className),children:[d&&c.jsxs("div",{className:W.tableCellWrapper,children:[v,c.jsx(a,{className:W.iconButton,onClick:function(){T(!1),o(!r)},tooltipProps:{title:r?"Collapse":"Expand",open:w,disableHoverListener:!0,onMouseEnter:function(){return T(!0)},onMouseLeave:function(){return T(!1)}},children:r?c.jsx(n.KeyboardArrowLeft,{}):c.jsx(n.KeyboardArrowRight,{})})]}),h&&c.jsx(s.Tooltip,{title:r?"":u,children:c.jsx("div",{children:r?v:(t=u,t.length>j+g?"".concat(t.substring(0,j)," ... ").concat(t.substring(t.length-g)):t)})}),!d&&!h&&v]}))};
@@ -1,5 +1,5 @@
1
1
  export default AxisOverlay;
2
- declare function AxisOverlay({ left, width, top, bottom, right, labelOffset, isXAxis, height, coll, onCustomizeScaleClick, ...otherProps }: {
2
+ declare function AxisOverlay({ left, width, top, bottom, right, labelOffset, height, coll, onCustomizeScaleClick, ...otherProps }: {
3
3
  [x: string]: any;
4
4
  left: any;
5
5
  width: any;
@@ -7,7 +7,6 @@ declare function AxisOverlay({ left, width, top, bottom, right, labelOffset, isX
7
7
  bottom: any;
8
8
  right: any;
9
9
  labelOffset: any;
10
- isXAxis: any;
11
10
  height: any;
12
11
  coll: any;
13
12
  onCustomizeScaleClick: any;
@@ -1 +1 @@
1
- {"version":3,"file":"AxisOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/AxisOverlay.js"],"names":[],"mappings":";AAuCA;;;;;;;;;;;;gBAqHC"}
1
+ {"version":3,"file":"AxisOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/AxisOverlay.js"],"names":[],"mappings":";AAuCA;;;;;;;;;;;gBAsHC"}
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/objectWithoutProperties";import{useContext as i,useState as r,useRef as l,useEffect as n}from"react";import{makeStyles as a,Tooltip as c}from"@material-ui/core";import p from"@material-ui/icons/Straighten";import s from"../ChartWrapperContext.js";import{jsxs as f,jsx as u}from"react/jsx-runtime";var m=["left","width","top","bottom","right","labelOffset","isXAxis","height","coll","onCustomizeScaleClick"],h=a((function(t){return{axis:function(t){return{position:"absolute",cursor:"pointer",width:t.width,left:t.left,bottom:t.bottom,height:t.height}},tooltip:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:125,backgroundColor:t.palette.background.b9,color:t.palette.text.primary,fontSize:"12px",lineHeight:"16px",letterSpacing:"0.4px",borderRadius:"4px",padding:"4px",zIndex:1e4},tooltipIcon:{fontSize:16,color:t.palette.primary.text6}}})),d=function(a){var d,g=a.left,b=a.width,x=a.top,y=a.bottom,C=a.right,v=a.labelOffset,w=a.isXAxis,E=a.height,S=a.coll,z=a.onCustomizeScaleClick,W=o(a,m),k=i(s).chart,j=r({}),B=e(j,2),I=B[0],M=B[1],P=l(),A=14+v,N=14+v,O=h({top:x,right:C,width:w?b+N:N,height:w?N:E+N,left:w?g-5:g-N,bottom:w?y-N:y-5}),R=null===(d=P.current)||void 0===d?void 0:d.getBoundingClientRect(),X=f("div",{className:O.tooltip,children:[u(p,{className:O.tooltipIcon})," Customize Scale"]}),H=function(){k.update(t({},S,{lineColor:"#03BCD4",lineWidth:2,labels:{style:{color:"#ffffff"}},title:{style:{color:"#ffffff"}}}))},D=function(){k.update(t({},S,{lineColor:"rgb(87, 91, 91)",lineWidth:1,labels:{style:{color:"#9E9E9E"}},title:{style:{color:"#9E9E9E"}}}))};return n((function(){var t=k.axisGroup;t&&(t.element.style.cursor="pointer")}),[k]),u(c,{title:X,placement:w?"top":"right",onMouseMove:function(t){var e=t.pageX,o=t.pageY;M({x:e,y:o})},PopperProps:{anchorEl:{clientHeight:0,clientWidth:0,getBoundingClientRect:function(){return{top:w?R.y:I.y,left:w?I.x:R.x-A,right:w?I.x:R.x+A,bottom:w?R.y:I.y,width:0,height:0}}}},children:u("div",{className:O.axis,ref:P,onClick:function(){return z(W)},onMouseOver:H,onMouseLeave:D,onFocus:H,onBlur:D})})};export{d as default};
1
+ import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/objectWithoutProperties";import{useContext as i,useState as r,useRef as l,useEffect as n}from"react";import{makeStyles as a,Tooltip as c}from"@material-ui/core";import p from"@material-ui/icons/Straighten";import f from"../ChartWrapperContext.js";import{jsxs as s,jsx as u}from"react/jsx-runtime";var m=["left","width","top","bottom","right","labelOffset","height","coll","onCustomizeScaleClick"],h=a((function(t){return{axis:function(t){return{position:"absolute",cursor:"pointer",width:t.width,left:t.left,bottom:t.bottom,height:t.height}},tooltip:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:125,backgroundColor:t.palette.background.b9,color:t.palette.text.primary,fontSize:"12px",lineHeight:"16px",letterSpacing:"0.4px",borderRadius:"4px",padding:"4px",zIndex:1e4},tooltipIcon:{fontSize:16,color:t.palette.primary.text6}}})),d=function(a){var d,g=a.left,b=a.width,x=a.top,y=a.bottom,C=a.right,v=a.labelOffset,w=a.height,B=a.coll,E=a.onCustomizeScaleClick,S=o(a,m),z=i(f).chart,W=r({}),k=e(W,2),j=k[0],I=k[1],M=l(),P=(null==z?void 0:z.inverted)?"yAxis"===B:"xAxis"===B,A=14+v,N=14+v,O=h({top:x,right:C,width:P?b+N:N,height:P?N:w+N,left:P?g-5:g-N,bottom:P?y-N:y-5}),R=null===(d=M.current)||void 0===d?void 0:d.getBoundingClientRect(),H=s("div",{className:O.tooltip,children:[u(p,{className:O.tooltipIcon})," Customize Scale"]}),D=function(){z.update(t({},B,{lineColor:"#03BCD4",lineWidth:2,labels:{style:{color:"#ffffff"}},title:{style:{color:"#ffffff"}}}))},F=function(){z.update(t({},B,{lineColor:"#3B3B3B",lineWidth:1,labels:{style:{color:"#9E9E9E"}},title:{style:{color:"#9E9E9E"}}}))};return n((function(){var t=z.axisGroup;t&&(t.element.style.cursor="pointer")}),[z]),u(c,{title:H,placement:P?"top":"right",onMouseMove:function(t){var e=t.pageX,o=t.pageY;I({x:e,y:o})},PopperProps:{anchorEl:{clientHeight:0,clientWidth:0,getBoundingClientRect:function(){return{top:P?R.y:j.y,left:P?j.x:R.x-A,right:P?j.x:R.x+A,bottom:P?R.y:j.y,width:0,height:0}}}},children:u("div",{className:O.axis,ref:M,onClick:function(){return E(S)},onMouseOver:D,onMouseLeave:F,onFocus:D,onBlur:F})})};export{d as default};
@@ -46,6 +46,7 @@ declare function getChartOptions({ seriesCount, recordsCount, labelMinLength, la
46
46
  minPadding: number;
47
47
  maxPadding: number;
48
48
  tickWidth: number;
49
+ lineColor: string;
49
50
  lineWidth: number;
50
51
  title: {
51
52
  text: string;
@@ -71,6 +72,8 @@ declare function getChartOptions({ seriesCount, recordsCount, labelMinLength, la
71
72
  };
72
73
  };
73
74
  zIndex: number;
75
+ lineColor: string;
76
+ lineWidth: number;
74
77
  title: {
75
78
  text: string;
76
79
  style: {
@@ -89,6 +92,7 @@ declare function getChartOptions({ seriesCount, recordsCount, labelMinLength, la
89
92
  shared: boolean;
90
93
  split: boolean;
91
94
  padding: number;
95
+ hideDelay: number;
92
96
  formatter: typeof tooltipFormatter;
93
97
  valueDecimals: number;
94
98
  style: {
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FC"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FC"}
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/objectWithoutProperties";import{useState as l}from"react";import{makeStyles as o,TableCell as i}from"@material-ui/core";import{KeyboardArrowLeft as n,KeyboardArrowRight as a}from"@material-ui/icons";import c from"classnames";import s from"../../IconButton/index.js";import{Tooltip as p}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{jsxs as m,jsx as d}from"react/jsx-runtime";var u=["isExpanded","setIsExpanded","tooltipTitle","collapsibleHeader","collapsibleBody","maxCellWidth","maxCharsNumberFromStart","maxCharsNumberFromEnd","cellWidth","children"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function h(t){for(var r=1;r<arguments.length;r++){var l=null!=arguments[r]?arguments[r]:{};r%2?b(Object(l),!0).forEach((function(r){e(t,r,l[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):b(Object(l)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(l,e))}))}return t}var f=o((function(e){return{stickyCell:{position:"sticky",left:0,zIndex:2,background:e.palette.background.b6},stickyEmptyCell:{position:"sticky",right:0,zIndex:2},collapseHeader:{width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},tableCellWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},iconButton:{padding:0,fontSize:16,"&:hover":{backgroundColor:"transparent"}}}})),y=function(e){var o,b=e.isExpanded,y=e.setIsExpanded,C=e.tooltipTitle,x=e.collapsibleHeader,g=e.collapsibleBody,j=e.maxCellWidth,O=e.maxCharsNumberFromStart,E=e.maxCharsNumberFromEnd,k=e.cellWidth,v=e.children,W=r(e,u),P=W.stickyCell&&!W.emptyCell,w=f({isExpanded:b,cellWidth:k,maxCellWidth:j}),N=l(!1),T=t(N,2),I=T[0],S=T[1];return m(i,h(h({},W),{},{className:c(x&&w.collapseHeader,P&&w.stickyCell,W.emptyCell&&w.stickyEmptyCell,P&&"stickyCell",W.emptyCell&&"stickyEmptyCell",W.className),children:[x&&m("div",{className:w.tableCellWrapper,children:[v,d(s,{className:w.iconButton,onClick:function(){S(!1),y(!b)},tooltipProps:{title:b?"Collapse":"Expand",open:I,disableHoverListener:!0,onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)}},children:d(b?n:a,{})})]}),g&&d(p,{title:!b&&C,children:d("div",{children:b?v:(o=C,o.length>O+E?"".concat(o.substring(0,O)," ... ").concat(o.substring(o.length-E)):o)})}),!x&&!g&&v]}))};export{y as TableCell};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/objectWithoutProperties";import{useState as l}from"react";import{makeStyles as o,TableCell as i}from"@material-ui/core";import{KeyboardArrowLeft as n,KeyboardArrowRight as a}from"@material-ui/icons";import c from"classnames";import s from"../../IconButton/index.js";import{Tooltip as p}from"../../Tooltip/Tooltip.js";import"../../Tooltip/ScrollableTooltip.js";import{jsxs as m,jsx as d}from"react/jsx-runtime";var u=["isExpanded","setIsExpanded","tooltipTitle","collapsibleHeader","collapsibleBody","maxCellWidth","maxCharsNumberFromStart","maxCharsNumberFromEnd","cellWidth","children"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function h(t){for(var r=1;r<arguments.length;r++){var l=null!=arguments[r]?arguments[r]:{};r%2?b(Object(l),!0).forEach((function(r){e(t,r,l[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):b(Object(l)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(l,e))}))}return t}var f=o((function(e){return{stickyCell:{position:"sticky",left:0,zIndex:2,background:e.palette.background.b6},stickyEmptyCell:{position:"sticky",right:0,zIndex:2},collapseHeader:{width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},tableCellWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",width:function(e){var t=e.isExpanded,r=e.maxCellWidth,l=e.cellWidth;return t?r:l}},iconButton:{padding:0,fontSize:16,"&:hover":{backgroundColor:"transparent"}}}})),y=function(e){var o,b=e.isExpanded,y=e.setIsExpanded,C=e.tooltipTitle,x=e.collapsibleHeader,g=e.collapsibleBody,j=e.maxCellWidth,O=e.maxCharsNumberFromStart,E=e.maxCharsNumberFromEnd,k=e.cellWidth,v=e.children,W=r(e,u),P=W.stickyCell&&!W.emptyCell,w=f({isExpanded:b,cellWidth:k,maxCellWidth:j}),N=l(!1),T=t(N,2),I=T[0],S=T[1];return m(i,h(h({},W),{},{className:c(x&&w.collapseHeader,P&&w.stickyCell,W.emptyCell&&w.stickyEmptyCell,P&&"stickyCell",W.emptyCell&&"stickyEmptyCell",W.className),children:[x&&m("div",{className:w.tableCellWrapper,children:[v,d(s,{className:w.iconButton,onClick:function(){S(!1),y(!b)},tooltipProps:{title:b?"Collapse":"Expand",open:I,disableHoverListener:!0,onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)}},children:d(b?n:a,{})})]}),g&&d(p,{title:b?"":C,children:d("div",{children:b?v:(o=C,o.length>O+E?"".concat(o.substring(0,O)," ... ").concat(o.substring(o.length-E)):o)})}),!x&&!g&&v]}))};export{y as TableCell};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.61.0-11",
3
+ "version": "0.61.0-12",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"