@corva/ui 0.71.0-4 → 0.71.0-5

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('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),o=require("react"),n=require("lodash"),a=require("@material-ui/core"),r=require("classnames"),s=require("./components/Toolbox/Toolbox.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=d(r),u=a.makeStyles((function(){return{container:{position:"relative",width:"100%",height:"100%"}}})),l=function(n){var a=n.containerClassName,r=n.customToolboxContainerClass,d=n.onDataZoom,l=n.children,c=u(),x=o.useRef(null),m=x.current,v=o.useState(!0),y=v[0],h=v[1],f=o.useState(!1),M=f[0],p=f[1],b=o.useState(!0),g=b[0],F=b[1],Z=o.useState(!1),A=Z[0],O=Z[1],C=o.useRef(null),E=o.useState(null),I=E[0],S=E[1],T=function(e){var t=100*Math.abs(e.x.start-C.current.x.start),o=100*Math.abs(e.x.end-C.current.x.start),n=100*Math.abs(e.y.start-C.current.y.start),a=100*Math.abs(e.y.end-C.current.y.start),r=n/Math.abs(C.current.y.start-C.current.y.end),s=a/Math.abs(C.current.y.start-C.current.y.end),d=t/Math.abs(C.current.x.start-C.current.x.end),i=o/Math.abs(C.current.x.start-C.current.x.end);A?(m.dispatchAction({type:"dataZoom",dataZoomIndex:0,moveOnMouseMove:M||g,start:+d.toFixed(2),end:+i.toFixed(2)}),m.dispatchAction({type:"dataZoom",dataZoomIndex:1,moveOnMouseMove:M||g,start:+r.toFixed(2),end:+s.toFixed(2)})):(m.setOption({dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:M||g,start:+d.toFixed(2),end:+i.toFixed(2)},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:M||g,start:+r.toFixed(2),end:+s.toFixed(2)}]}),S(e))},q=function(){var e,t,o,n,a,r,s,d,i=null===(n=null===(o=null===(t=null===(e=null==m?void 0:m.getModel())||void 0===e?void 0:e.getComponent("xAxis",0))||void 0===t?void 0:t.axis)||void 0===o?void 0:o.scale)||void 0===n?void 0:n.getExtent(),u=null===(d=null===(s=null===(r=null===(a=null==m?void 0:m.getModel())||void 0===a?void 0:a.getComponent("yAxis",0))||void 0===r?void 0:r.axis)||void 0===s?void 0:s.scale)||void 0===d?void 0:d.getExtent();if(i&&u){var l=i[0],c=i[1],x=u[0],v=u[1];C.current={x:{start:+l.toFixed(2),end:+c.toFixed(2)},y:{start:+x.toFixed(2),end:+v.toFixed(2)}}}},z=function(e){var t=0===e.start&&100===e.end;"datazoom"!==e.type||t||O((function(e){return e||q(),!0})),function(){var e=m.getModel().getComponent("yAxis",0).axis.scale.getExtent(),t=e[0],o=e[1],n=m.getModel().getComponent("xAxis",0).axis.scale.getExtent(),a={x:{start:n[0],end:n[1]},y:{start:t,end:o}};S(a),d(a)}()};o.useEffect((function(){m&&(A||q(),y||(m.setOption({toolbox:{show:!0,width:0,height:0,feature:{dataZoom:{show:!0,icon:null},brush:{show:!1}}},dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1}]},{replaceMerge:"dataZoom"}),m.on("dataZoom",z),h(!0),F(!0)))}),[m,y]),o.useEffect((function(){var e=null==m?void 0:m.getZr();if(e){var t=Array.from(e.dom.getElementsByTagName("canvas")).at(-1);t?t.style.cursor=M?"grab":g?"crosshair":"default":console.error("Canvas not found")}}),[m,M,g]),o.useEffect((function(){m&&m.setOption({dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:M||g},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:M||g}]})}),[M,g,m]),o.useEffect((function(){m&&m.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:g})}),[g]);return t.jsxs("div",e.__assign({className:i.default(c.container,a)},{children:[o.Children.map(l,(function(e){var t,n=e.props.onChartReady;return o.cloneElement(e,{onChartReady:(t=n,function(e){t&&t(e),h(!1),x.current=e})})})),t.jsx(s.Toolbox,{handleTogglePane:function(e){return p(e)},handleToggleBrush:function(e){return F(e)},isPaneEnabled:M,isBrushEnabled:g,isZoomed:A,chart:m,customToolboxContainerClass:r,handleZoomReset:function(){O(!1),p(!1),F(!0),m.dispatchAction({type:"dataZoom",start:0,end:100,rangeMode:["percent","percent"]})},handleZoomOut:function(){var e=.05*Math.abs(C.current.x.start-C.current.x.end),t=.05*Math.abs(C.current.y.start-C.current.y.end),o=+(I.x.start-e).toFixed(2),n=+(I.x.end+e).toFixed(2),a=+(I.y.start-t).toFixed(2),r=+(I.y.end+t).toFixed(2),s=o<=C.current.x.start||n>=C.current.x.end,d=a<=C.current.y.start||r>=C.current.y.end;s&&d&&(O(!1),p(!1),F(!0)),T({x:s?C.current.x:{start:o,end:n},y:d?C.current.y:{start:a,end:r}})},handleZoomIn:function(){A||(q(),O(!0));var e=I||C.current,t=.05*Math.abs(e.x.start-e.x.end),o=.05*Math.abs(e.y.start-e.y.end),n=+(e.x.start+t).toFixed(2),a=+(e.x.end-t).toFixed(2),r=+(e.y.start+o).toFixed(2),s=+(e.y.end-o).toFixed(2),d=n>=a,i=r>=s;T({x:{start:d?e.x.start:n,end:d?e.x.end:a},y:{start:i?e.y.start:r,end:i?e.y.end:s}})}})]}))};l.defaultProps={onDataZoom:n.noop},module.exports=l;
1
+ "use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),n=require("react"),o=require("lodash"),r=require("@material-ui/core"),a=require("classnames"),s=require("./components/Toolbox/Toolbox.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=i(a),u=r.makeStyles((function(){return{container:{position:"relative",width:"100%",height:"100%"}}})),l=function(o){var a=o.containerClassName,i=o.customToolboxContainerClass,l=o.onDataZoom,c=o.children,x=u(),y=n.useRef(null),v=y.current,m=r.useTheme(),h=n.useState(!1),f=h[0],M=h[1],p=n.useState(!1),b=p[0],g=p[1],A=n.useState(!0),Z=A[0],F=A[1],C=n.useState(!1),O=C[0],E=C[1],S=n.useRef(null),T=n.useState(null),q=T[0],I=T[1],j=function(e){var t,n,o=v.getOption(),r=o.series,a=Array.isArray(r)?r[0].data:r.data;if((null===(t=null==o?void 0:o.xAxis)||void 0===t?void 0:t.length)>1||(null===(n=o.yAxis)||void 0===n?void 0:n.length)>1||a.some((function(t){return Array.isArray(t)?t[0]>e.x.start&&t[0]<e.x.end&&t[1]>e.y.start&&t[1]<e.y.end:t.x>e.x.start&&t.x<e.x.end&&t.y>e.y.start&&t.y<e.y.end}))){var s=100*Math.abs(e.x.start-S.current.x.start),i=100*Math.abs(e.x.end-S.current.x.start),d=100*Math.abs(e.y.start-S.current.y.start),u=100*Math.abs(e.y.end-S.current.y.start),l=d/Math.abs(S.current.y.start-S.current.y.end),c=u/Math.abs(S.current.y.start-S.current.y.end),x=s/Math.abs(S.current.x.start-S.current.x.end),y=i/Math.abs(S.current.x.start-S.current.x.end);v.dispatchAction({type:"dataZoom",moveOnMouseMove:b,filterMode:"none",rangeMode:["percent","percent"],batch:[{start:+x.toFixed(2),end:+y.toFixed(2),dataZoomIndex:0},{start:+l.toFixed(2),end:+c.toFixed(2),dataZoomIndex:1}]})}},k=function(){var e,t,n,o,r,a,s,i,d=null===(o=null===(n=null===(t=null===(e=null==v?void 0:v.getModel())||void 0===e?void 0:e.getComponent("xAxis",0))||void 0===t?void 0:t.axis)||void 0===n?void 0:n.scale)||void 0===o?void 0:o.getExtent(),u=null===(i=null===(s=null===(a=null===(r=null==v?void 0:v.getModel())||void 0===r?void 0:r.getComponent("yAxis",0))||void 0===a?void 0:a.axis)||void 0===s?void 0:s.scale)||void 0===i?void 0:i.getExtent();if(d&&u){var l=d[0],c=d[1],x=u[0],y=u[1];S.current={x:{start:+l.toFixed(2),end:+c.toFixed(2)},y:{start:+x.toFixed(2),end:+y.toFixed(2)}}}},R=function(){E(!1),g(!1),F(!0),v.dispatchAction({type:"dataZoom",start:0,end:100,rangeMode:["percent","percent"]})},W=function(e){var t,n,o=0===e.start&&100===e.end,r=null===(n=null===(t=e.batch)||void 0===t?void 0:t[0])||void 0===n?void 0:n.startValue;E((function(e){return!!r||(o&&k(),!o)})),function(){var e=v.getModel().getComponent("yAxis",0).axis.scale.getExtent(),t=e[0],n=e[1],o=v.getModel().getComponent("xAxis",0).axis.scale.getExtent(),r={x:{start:o[0],end:o[1]},y:{start:t,end:n}};I(r),l(r)}()};n.useEffect((function(){v&&(O||k(),f&&(v.setOption({toolbox:{show:!0,width:0,height:0,feature:{dataZoom:{show:!0,icon:null,brushStyle:{borderWidth:0,opacity:.1,color:m.palette.primary.light}}}},dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:!1},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:!1}]},{replaceMerge:"dataZoom"}),v.on("dataZoom",W),M(!1),v.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})))}),[v,f,O]),n.useEffect((function(){var e=null==v?void 0:v.getZr();if(e){var t=Array.from(e.dom.getElementsByTagName("canvas")).at(-1);t?t.style.cursor=b?"grab":Z?"crosshair":"default":console.error("Canvas not found")}}),[v,b,Z]),n.useEffect((function(){v&&v.setOption({dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:b},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:b}]})}),[b]),n.useEffect((function(){null==v||v.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:Z})}),[Z]);return t.jsxs("div",e.__assign({className:d.default(x.container,a)},{children:[n.Children.map(c,(function(e){var t,o=e.props.onChartReady;return n.cloneElement(e,{onChartReady:(t=o,function(e){t&&t(e),M(!0),y.current=e})})})),t.jsx(s.Toolbox,{handleTogglePane:function(e){return g(e)},handleToggleBrush:function(e){return F(e)},isPaneEnabled:b,isBrushEnabled:Z,isZoomed:O,chart:v,customToolboxContainerClass:i,handleZoomReset:R,handleZoomOut:function(){var e=.05*Math.abs(S.current.x.start-S.current.x.end),t=.05*Math.abs(S.current.y.start-S.current.y.end),n=+(q.x.start-e).toFixed(2),o=+(q.x.end+e).toFixed(2),r=+(q.y.start-t).toFixed(2),a=+(q.y.end+t).toFixed(2),s=n<=S.current.x.start||o>=S.current.x.end,i=r<=S.current.y.start||a>=S.current.y.end;if(s&&i)return R();j({x:s?S.current.x:{start:n,end:o},y:i?S.current.y:{start:r,end:a}})},handleZoomIn:function(){O||(k(),E(!0));var e=q||S.current,t=.05*Math.abs(e.x.start-e.x.end),n=.05*Math.abs(e.y.start-e.y.end),o=+(e.x.start+t).toFixed(2),r=+(e.x.end-t).toFixed(2),a=+(e.y.start+n).toFixed(2),s=+(e.y.end-n).toFixed(2),i=o>=r,d=a>=s;j({x:{start:i?e.x.start:o,end:i?e.x.end:r},y:{start:d?e.y.start:a,end:d?e.y.end:s}})}})]}))};l.defaultProps={onDataZoom:o.noop},module.exports=l;
@@ -1 +1 @@
1
- {"version":3,"file":"EChartsWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/EChartsWrapper/EChartsWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0B,EAAE,EAA+B,MAAM,OAAO,CAAC;AAShF,OAAO,EAAa,iBAAiB,EAAiB,MAAM,SAAS,CAAC;AAYtE,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAwVzC,CAAC;AAMF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"EChartsWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/EChartsWrapper/EChartsWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0B,EAAE,EAA+B,MAAM,OAAO,CAAC;AAShF,OAAO,EAAa,iBAAiB,EAAiC,MAAM,SAAS,CAAC;AAYtF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CA6VzC,CAAC;AAMF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useRef as n,useState as a,useEffect as r,Children as d,cloneElement as s}from"react";import{noop as i}from"lodash";import{makeStyles as l}from"@material-ui/core";import u from"classnames";import{Toolbox as x}from"./components/Toolbox/Toolbox.js";var c=l((function(){return{container:{position:"relative",width:"100%",height:"100%"}}})),m=function(i){var l=i.containerClassName,m=i.customToolboxContainerClass,v=i.onDataZoom,y=i.children,h=c(),M=n(null),f=M.current,p=a(!0),b=p[0],g=p[1],F=a(!1),Z=F[0],A=F[1],O=a(!0),C=O[0],I=O[1],z=a(!1),E=z[0],T=z[1],W=n(null),w=a(null),j=w[0],B=w[1],N=function(t){var e=100*Math.abs(t.x.start-W.current.x.start),o=100*Math.abs(t.x.end-W.current.x.start),n=100*Math.abs(t.y.start-W.current.y.start),a=100*Math.abs(t.y.end-W.current.y.start),r=n/Math.abs(W.current.y.start-W.current.y.end),d=a/Math.abs(W.current.y.start-W.current.y.end),s=e/Math.abs(W.current.x.start-W.current.x.end),i=o/Math.abs(W.current.x.start-W.current.x.end);E?(f.dispatchAction({type:"dataZoom",dataZoomIndex:0,moveOnMouseMove:Z||C,start:+s.toFixed(2),end:+i.toFixed(2)}),f.dispatchAction({type:"dataZoom",dataZoomIndex:1,moveOnMouseMove:Z||C,start:+r.toFixed(2),end:+d.toFixed(2)})):(f.setOption({dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:Z||C,start:+s.toFixed(2),end:+i.toFixed(2)},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:Z||C,start:+r.toFixed(2),end:+d.toFixed(2)}]}),B(t))},P=function(){var t,e,o,n,a,r,d,s,i=null===(n=null===(o=null===(e=null===(t=null==f?void 0:f.getModel())||void 0===t?void 0:t.getComponent("xAxis",0))||void 0===e?void 0:e.axis)||void 0===o?void 0:o.scale)||void 0===n?void 0:n.getExtent(),l=null===(s=null===(d=null===(r=null===(a=null==f?void 0:f.getModel())||void 0===a?void 0:a.getComponent("yAxis",0))||void 0===r?void 0:r.axis)||void 0===d?void 0:d.scale)||void 0===s?void 0:s.getExtent();if(i&&l){var u=i[0],x=i[1],c=l[0],m=l[1];W.current={x:{start:+u.toFixed(2),end:+x.toFixed(2)},y:{start:+c.toFixed(2),end:+m.toFixed(2)}}}},R=function(t){var e=0===t.start&&100===t.end;"datazoom"!==t.type||e||T((function(t){return t||P(),!0})),function(){var t=f.getModel().getComponent("yAxis",0).axis.scale.getExtent(),e=t[0],o=t[1],n=f.getModel().getComponent("xAxis",0).axis.scale.getExtent(),a={x:{start:n[0],end:n[1]},y:{start:e,end:o}};B(a),v(a)}()};r((function(){f&&(E||P(),b||(f.setOption({toolbox:{show:!0,width:0,height:0,feature:{dataZoom:{show:!0,icon:null},brush:{show:!1}}},dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1}]},{replaceMerge:"dataZoom"}),f.on("dataZoom",R),g(!0),I(!0)))}),[f,b]),r((function(){var t=null==f?void 0:f.getZr();if(t){var e=Array.from(t.dom.getElementsByTagName("canvas")).at(-1);e?e.style.cursor=Z?"grab":C?"crosshair":"default":console.error("Canvas not found")}}),[f,Z,C]),r((function(){f&&f.setOption({dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:Z||C},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:Z||C}]})}),[Z,C,f]),r((function(){f&&f.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:C})}),[C]);return e("div",t({className:u(h.container,l)},{children:[d.map(y,(function(t){var e,o=t.props.onChartReady;return s(t,{onChartReady:(e=o,function(t){e&&e(t),g(!1),M.current=t})})})),o(x,{handleTogglePane:function(t){return A(t)},handleToggleBrush:function(t){return I(t)},isPaneEnabled:Z,isBrushEnabled:C,isZoomed:E,chart:f,customToolboxContainerClass:m,handleZoomReset:function(){T(!1),A(!1),I(!0),f.dispatchAction({type:"dataZoom",start:0,end:100,rangeMode:["percent","percent"]})},handleZoomOut:function(){var t=.05*Math.abs(W.current.x.start-W.current.x.end),e=.05*Math.abs(W.current.y.start-W.current.y.end),o=+(j.x.start-t).toFixed(2),n=+(j.x.end+t).toFixed(2),a=+(j.y.start-e).toFixed(2),r=+(j.y.end+e).toFixed(2),d=o<=W.current.x.start||n>=W.current.x.end,s=a<=W.current.y.start||r>=W.current.y.end;d&&s&&(T(!1),A(!1),I(!0)),N({x:d?W.current.x:{start:o,end:n},y:s?W.current.y:{start:a,end:r}})},handleZoomIn:function(){E||(P(),T(!0));var t=j||W.current,e=.05*Math.abs(t.x.start-t.x.end),o=.05*Math.abs(t.y.start-t.y.end),n=+(t.x.start+e).toFixed(2),a=+(t.x.end-e).toFixed(2),r=+(t.y.start+o).toFixed(2),d=+(t.y.end-o).toFixed(2),s=n>=a,i=r>=d;N({x:{start:s?t.x.start:n,end:s?t.x.end:a},y:{start:i?t.y.start:r,end:i?t.y.end:d}})}})]}))};m.defaultProps={onDataZoom:i};export{m as default};
1
+ import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useRef as n,useState as r,useEffect as a,Children as i,cloneElement as d}from"react";import{noop as s}from"lodash";import{makeStyles as l,useTheme as u}from"@material-ui/core";import c from"classnames";import{Toolbox as x}from"./components/Toolbox/Toolbox.js";var m=l((function(){return{container:{position:"relative",width:"100%",height:"100%"}}})),y=function(s){var l=s.containerClassName,y=s.customToolboxContainerClass,v=s.onDataZoom,h=s.children,f=m(),p=n(null),M=p.current,g=u(),b=r(!1),A=b[0],Z=b[1],F=r(!1),C=F[0],O=F[1],E=r(!0),I=E[0],T=E[1],S=r(!1),W=S[0],k=S[1],w=n(null),z=r(null),j=z[0],B=z[1],N=function(t){var e,o,n=M.getOption(),r=n.series,a=Array.isArray(r)?r[0].data:r.data;if((null===(e=null==n?void 0:n.xAxis)||void 0===e?void 0:e.length)>1||(null===(o=n.yAxis)||void 0===o?void 0:o.length)>1||a.some((function(e){return Array.isArray(e)?e[0]>t.x.start&&e[0]<t.x.end&&e[1]>t.y.start&&e[1]<t.y.end:e.x>t.x.start&&e.x<t.x.end&&e.y>t.y.start&&e.y<t.y.end}))){var i=100*Math.abs(t.x.start-w.current.x.start),d=100*Math.abs(t.x.end-w.current.x.start),s=100*Math.abs(t.y.start-w.current.y.start),l=100*Math.abs(t.y.end-w.current.y.start),u=s/Math.abs(w.current.y.start-w.current.y.end),c=l/Math.abs(w.current.y.start-w.current.y.end),x=i/Math.abs(w.current.x.start-w.current.x.end),m=d/Math.abs(w.current.x.start-w.current.x.end);M.dispatchAction({type:"dataZoom",moveOnMouseMove:C,filterMode:"none",rangeMode:["percent","percent"],batch:[{start:+x.toFixed(2),end:+m.toFixed(2),dataZoomIndex:0},{start:+u.toFixed(2),end:+c.toFixed(2),dataZoomIndex:1}]})}},P=function(){var t,e,o,n,r,a,i,d,s=null===(n=null===(o=null===(e=null===(t=null==M?void 0:M.getModel())||void 0===t?void 0:t.getComponent("xAxis",0))||void 0===e?void 0:e.axis)||void 0===o?void 0:o.scale)||void 0===n?void 0:n.getExtent(),l=null===(d=null===(i=null===(a=null===(r=null==M?void 0:M.getModel())||void 0===r?void 0:r.getComponent("yAxis",0))||void 0===a?void 0:a.axis)||void 0===i?void 0:i.scale)||void 0===d?void 0:d.getExtent();if(s&&l){var u=s[0],c=s[1],x=l[0],m=l[1];w.current={x:{start:+u.toFixed(2),end:+c.toFixed(2)},y:{start:+x.toFixed(2),end:+m.toFixed(2)}}}},R=function(){k(!1),O(!1),T(!0),M.dispatchAction({type:"dataZoom",start:0,end:100,rangeMode:["percent","percent"]})},D=function(t){var e,o,n=0===t.start&&100===t.end,r=null===(o=null===(e=t.batch)||void 0===e?void 0:e[0])||void 0===o?void 0:o.startValue;k((function(t){return!!r||(n&&P(),!n)})),function(){var t=M.getModel().getComponent("yAxis",0).axis.scale.getExtent(),e=t[0],o=t[1],n=M.getModel().getComponent("xAxis",0).axis.scale.getExtent(),r={x:{start:n[0],end:n[1]},y:{start:e,end:o}};B(r),v(r)}()};a((function(){M&&(W||P(),A&&(M.setOption({toolbox:{show:!0,width:0,height:0,feature:{dataZoom:{show:!0,icon:null,brushStyle:{borderWidth:0,opacity:.1,color:g.palette.primary.light}}}},dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:!1},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:!1}]},{replaceMerge:"dataZoom"}),M.on("dataZoom",D),Z(!1),M.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})))}),[M,A,W]),a((function(){var t=null==M?void 0:M.getZr();if(t){var e=Array.from(t.dom.getElementsByTagName("canvas")).at(-1);e?e.style.cursor=C?"grab":I?"crosshair":"default":console.error("Canvas not found")}}),[M,C,I]),a((function(){M&&M.setOption({dataZoom:[{type:"inside",xAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:C},{type:"inside",yAxisIndex:"all",filterMode:"none",zoomOnMouseWheel:!1,moveOnMouseMove:C}]})}),[C]),a((function(){null==M||M.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:I})}),[I]);return e("div",t({className:c(f.container,l)},{children:[i.map(h,(function(t){var e,o=t.props.onChartReady;return d(t,{onChartReady:(e=o,function(t){e&&e(t),Z(!0),p.current=t})})})),o(x,{handleTogglePane:function(t){return O(t)},handleToggleBrush:function(t){return T(t)},isPaneEnabled:C,isBrushEnabled:I,isZoomed:W,chart:M,customToolboxContainerClass:y,handleZoomReset:R,handleZoomOut:function(){var t=.05*Math.abs(w.current.x.start-w.current.x.end),e=.05*Math.abs(w.current.y.start-w.current.y.end),o=+(j.x.start-t).toFixed(2),n=+(j.x.end+t).toFixed(2),r=+(j.y.start-e).toFixed(2),a=+(j.y.end+e).toFixed(2),i=o<=w.current.x.start||n>=w.current.x.end,d=r<=w.current.y.start||a>=w.current.y.end;if(i&&d)return R();N({x:i?w.current.x:{start:o,end:n},y:d?w.current.y:{start:r,end:a}})},handleZoomIn:function(){W||(P(),k(!0));var t=j||w.current,e=.05*Math.abs(t.x.start-t.x.end),o=.05*Math.abs(t.y.start-t.y.end),n=+(t.x.start+e).toFixed(2),r=+(t.x.end-e).toFixed(2),a=+(t.y.start+o).toFixed(2),i=+(t.y.end-o).toFixed(2),d=n>=r,s=a>=i;N({x:{start:d?t.x.start:n,end:d?t.x.end:r},y:{start:s?t.y.start:a,end:s?t.y.end:i}})}})]}))};y.defaultProps={onDataZoom:s};export{y as default};
@@ -15,8 +15,10 @@ export declare type DataZoomEvent = {
15
15
  end?: number;
16
16
  type: 'datazoom';
17
17
  batch?: {
18
- startValue: number;
19
- endValue: number;
18
+ start?: number;
19
+ end?: number;
20
+ startValue?: number;
21
+ endValue?: number;
20
22
  type: 'datazoom';
21
23
  }[];
22
24
  };
@@ -55,4 +57,8 @@ export declare type ToolboxButtonProps = {
55
57
  placement?: TooltipProps['placement'];
56
58
  className?: string;
57
59
  };
60
+ export declare type SeriesDataItem = {
61
+ x: number;
62
+ y: number;
63
+ } | [x: number, y: number];
58
64
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/EChartsWrapper/types.ts"],"names":[],"mappings":";AAAA,OAAO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AAc,GACtB;IACE,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,GACD,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.71.0-4",
3
+ "version": "0.71.0-5",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"