@corva/ui 0.49.0-5 → 0.49.0-6

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.
@@ -0,0 +1,14 @@
1
+ export default AxisOverlay;
2
+ declare function AxisOverlay({ left, width, top, bottom, right, isXAxis, height, coll, onCustomizeScaleClick, ...otherProps }: {
3
+ [x: string]: any;
4
+ left: any;
5
+ width: any;
6
+ top: any;
7
+ bottom: any;
8
+ right: any;
9
+ isXAxis: any;
10
+ height: any;
11
+ coll: any;
12
+ onCustomizeScaleClick: any;
13
+ }): JSX.Element;
14
+ //# sourceMappingURL=AxisOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxisOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/AxisOverlay.js"],"names":[],"mappings":";AAsCA;;;;;;;;;;;gBAiHC"}
@@ -0,0 +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 u,jsx as f}from"react/jsx-runtime";var m=["left","width","top","bottom","right","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.isXAxis,w=a.height,E=a.coll,S=a.onCustomizeScaleClick,z=o(a,m),W=i(s).chart,k=r({}),j=e(k,2),B=j[0],I=j[1],M=l(),P=h({top:x,right:C,width:v?b:4,height:v?4:w,left:g-4,bottom:y-4}),A=null===(d=M.current)||void 0===d?void 0:d.getBoundingClientRect(),N=u("div",{className:P.tooltip,children:[f(p,{className:P.tooltipIcon})," Customize Scale"]}),R=function(){W.update(t({},E,{lineColor:"#03BCD4",lineWidth:2,labels:{style:{color:"#ffffff"}},title:{style:{color:"#ffffff"}}}))},X=function(){W.update(t({},E,{lineColor:"rgb(87, 91, 91)",lineWidth:1,labels:{style:{color:"#9E9E9E"}},title:{style:{color:"#9E9E9E"}}}))};return n((function(){var t=W.axisGroup;t&&(t.element.style.cursor="pointer")}),[W]),f(c,{title:N,placement:v?"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:v?A.y:B.y,left:v?B.x:A.x-8,right:v?B.x:A.x+8,bottom:v?A.y:B.y,width:0,height:0}}}},children:f("div",{className:P.axis,ref:M,onClick:function(){return S(z)},onMouseOver:R,onMouseLeave:X,onFocus:R,onBlur:X})})};export{d as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import t from"classnames";import{makeStyles as o,Tooltip as i}from"@material-ui/core";import{jsx as n}from"react/jsx-runtime";var c=["onClick","className","children","tooltipProps","isActive","isHidden","disabled"];function a(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,o)}return t}function l(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var s=o((function(r){var e=r.palette;return{button:{display:"flex",justifyContent:"center",alignItems:"center",width:30,height:30,borderRadius:"4px",color:e.primary.text6,background:e.background.b6,marginBottom:"4px","&:hover":{color:e.primary.contrastText,background:e.background.b7,cursor:"pointer"},"&:active":{background:e.background.b8,"& .MuiSvgIcon-root":{color:e.primary.main}},"& .MuiSvgIcon-root":{width:16,height:16},"& .MuiSvgIcon-root:active":{color:e.primary.main}},isActive:{color:e.primary.main,"&:hover":{color:e.primary.main}},isHidden:{visibility:"hidden"},disabled:{cursor:"not-allowed !important","&:hover":{background:e.background.b6},"& .MuiSvgIcon-root":{color:"".concat(e.primary.text6," !important")}}}})),p=function(o){var a,p=o.onClick,d=o.className,b=o.children,u=o.tooltipProps,m=o.isActive,f=o.isHidden,g=o.disabled,v=e(o,c),y=s(),h=n("div",l(l({className:t(y.button,d,(a={},r(a,y.isHidden,f),r(a,y.disabled,g),r(a,y.isActive,m),a)),onClick:g||p},v),{},{children:b}));return g?h:n(i,l(l({placement:"left"},u),{},{children:h}))};export{p as default};
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import t from"classnames";import{makeStyles as o,Tooltip as i}from"@material-ui/core";import{jsx as n}from"react/jsx-runtime";var c=["onClick","className","children","tooltipProps","isActive","isHidden","disabled"];function a(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,o)}return t}function l(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var s=o((function(r){var e=r.palette;return{button:{display:"flex",justifyContent:"center",alignItems:"center",width:30,height:30,borderRadius:"4px",color:e.primary.text6,background:e.background.b6,marginBottom:"4px","&:hover":{color:e.primary.contrastText,background:e.background.b7,cursor:"pointer"},"&:active":{background:e.background.b8,"& .MuiSvgIcon-root":{color:e.primary.main}},"& .MuiSvgIcon-root":{width:16,height:16},"& .MuiSvgIcon-root:active":{color:e.primary.main}},isActive:{color:e.primary.main,"&:hover":{color:e.primary.main}},isHidden:{visibility:"hidden"},disabled:{cursor:"not-allowed !important","&:hover":{background:e.background.b6},"& .MuiSvgIcon-root":{color:"".concat(e.primary.text6," !important")}}}})),p=function(o){var a,p=o.onClick,d=o.className,u=o.children,b=o.tooltipProps,m=o.isActive,f=o.isHidden,g=o.disabled,v=e(o,c),y=s(),h=n("div",l(l({className:t(y.button,d,(a={},r(a,y.isHidden,f),r(a,y.disabled,g),r(a,y.isActive,m),a)),onClick:g?null:p},v),{},{children:u}));return g?h:n(i,l(l({placement:"left"},b),{},{children:h}))};export{p as default};
@@ -1,7 +1,8 @@
1
1
  export default ChartWrapper;
2
- declare function ChartWrapper({ children, chartRef, isAxesCoordinatesShown }: {
2
+ declare function ChartWrapper({ children, chartRef, isAxesCoordinatesShown, onCustomizeScaleClick }: {
3
3
  children: any;
4
4
  chartRef: any;
5
5
  isAxesCoordinatesShown: any;
6
+ onCustomizeScaleClick: any;
6
7
  }): JSX.Element;
7
8
  //# sourceMappingURL=ChartWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/ChartWrapper.js"],"names":[],"mappings":";AAeA;;;;gBAwDC"}
1
+ {"version":3,"file":"ChartWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/components/ChartWrapper.js"],"names":[],"mappings":";AAgBA;;;;;gBA8DC"}
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{makeStyles as t}from"@material-ui/core";import{isEmpty as o}from"lodash";import{useState as n,useEffect as i}from"react";import a from"../ChartWrapperContext.js";import{MIN_CHART_HEIGHT as l}from"../constants.js";import{useZoom as c}from"../effects/useZoom.js";import{useChartModifier as h}from"../effects/useChartModifier.js";import{jsx as s}from"react/jsx-runtime";function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function m(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?d(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var u=t({container:{width:"100%",height:"100%",position:"relative"}}),f=function(e){var t,d,f,p,v,b,g=e.children,C=e.chartRef,O=e.isAxesCoordinatesShown,j=u(),y=n({}),S=r(y,2),P=S[0],Z=S[1],w=c({chart:null===(t=C.current)||void 0===t?void 0:t.chart}),E=w.zoomStatus,x=w.zoomConfig,z=w.handleZoomEvent,D=w.handleResetZoom,A=w.isZoomEnabled,B=w.handleIsZoomEnabledChange,M=w.debouncedChartSelection;i((function(){var e,r,t;o(null===(e=C.current)||void 0===e?void 0:e.chart)||Z({marginBottom:null===(r=C.current)||void 0===r||null===(t=r.chart)||void 0===t?void 0:t.marginBottom})}),[]);var R=(null===(d=C.current)||void 0===d||null===(f=d.chart)||void 0===f||null===(p=f.plotBox)||void 0===p?void 0:p.height)<=l;h({chart:null===(v=C.current)||void 0===v?void 0:v.chart,isZoomEnabled:A,isMinHeightChart:R,handleChartSelection:M,isAxesCoordinatesShown:O});var H={chart:null===(b=C.current)||void 0===b?void 0:b.chart,zoomConfig:x,chartStyles:P,zoomStatus:E,isZoomEnabled:A,setChartStyles:Z,handleResetZoom:D,handleZoomEvent:z,isMinHeightChart:R,handleChartSelection:M,handleChangeChartStyles:function(e){Z((function(r){return m(m({},r),e)}))},handleIsZoomEnabledChange:B};return s("div",{className:j.container,children:s(a.Provider,{value:H,children:g})})};export{f as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{makeStyles as t}from"@material-ui/core";import{isEmpty as o}from"lodash";import{useState as n,useEffect as i}from"react";import a from"../ChartWrapperContext.js";import{MIN_CHART_HEIGHT as l}from"../constants.js";import{useZoom as c}from"../effects/useZoom.js";import{useChartModifier as s}from"../effects/useChartModifier.js";import h from"./AxisOverlay.js";import{jsx as m,jsxs as u}from"react/jsx-runtime";function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function f(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?d(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var p=t({container:{width:"100%",height:"100%",position:"relative"}}),v=function(e){var t,d,v,b,C,g,O,j=e.children,y=e.chartRef,S=e.isAxesCoordinatesShown,P=e.onCustomizeScaleClick,Z=p(),w=n({}),E=r(w,2),x=E[0],z=E[1],A=c({chart:null===(t=y.current)||void 0===t?void 0:t.chart}),D=A.zoomStatus,k=A.zoomConfig,B=A.handleZoomEvent,M=A.handleResetZoom,R=A.isZoomEnabled,H=A.handleIsZoomEnabledChange,I=A.debouncedChartSelection;i((function(){var e,r,t;o(null===(e=y.current)||void 0===e?void 0:e.chart)||z({marginBottom:null===(r=y.current)||void 0===r||null===(t=r.chart)||void 0===t?void 0:t.marginBottom})}),[]);var N=(null===(d=y.current)||void 0===d||null===(v=d.chart)||void 0===v||null===(b=v.plotBox)||void 0===b?void 0:b.height)<=l;s({chart:null===(C=y.current)||void 0===C?void 0:C.chart,isZoomEnabled:R,isMinHeightChart:N,handleChartSelection:I,isAxesCoordinatesShown:S});var T={chart:null===(g=y.current)||void 0===g?void 0:g.chart,zoomConfig:k,chartStyles:x,zoomStatus:D,isZoomEnabled:R,setChartStyles:z,handleResetZoom:M,handleZoomEvent:B,isMinHeightChart:N,handleChartSelection:I,handleChangeChartStyles:function(e){z((function(r){return f(f({},r),e)}))},handleIsZoomEnabledChange:H};return m("div",{className:Z.container,children:u(a.Provider,{value:T,children:[j,P&&(null===(O=y.current)||void 0===O?void 0:O.chart.axes.map((function(e){return m(h,f({onCustomizeScaleClick:P},e),e.coll)})))]})})};export{v as default};
@@ -41,6 +41,7 @@ declare function getChartOptions({ seriesCount, recordsCount, labelMinLength, la
41
41
  };
42
42
  xAxis: {
43
43
  gridLineWidth: number;
44
+ zIndex: number;
44
45
  gridLineColor: string;
45
46
  minPadding: number;
46
47
  maxPadding: number;
@@ -69,6 +70,7 @@ declare function getChartOptions({ seriesCount, recordsCount, labelMinLength, la
69
70
  color: string;
70
71
  };
71
72
  };
73
+ zIndex: number;
72
74
  title: {
73
75
  text: string;
74
76
  style: {
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFC"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.49.0-5",
3
+ "version": "0.49.0-6",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"