@corva/ui 0.47.0-4 → 0.47.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.
|
@@ -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",background:e.background.b6,marginBottom:"4px","&:hover":{background:e.background.b7,cursor:"pointer"},"&:
|
|
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",background:e.background.b6,marginBottom:"4px","&:hover":{background:e.background.b7,cursor:"pointer"},"&:active":{"& .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",color:e.primary.text6,"&:hover":{color:e.primary.text6},"& .MuiSvgIcon-root:hover":{color:e.primary.text6},"& .MuiSvgIcon-root:active":{color:e.primary.text6}}}})),p=function(o){var a,p=o.onClick,m=o.className,d=o.children,u=o.tooltipProps,b=o.isActive,v=o.isHidden,f=o.disabled,y=e(o,c),h=s(),g=n("div",l(l({className:t(h.button,m,(a={},r(a,h.isHidden,v),r(a,h.disabled,f),r(a,h.isActive,b),a)),onClick:f||p},y),{},{children:d}));return f?g:n(i,l(l({placement:"left"},u),{},{children:g}))};export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import t from"classnames";import{makeStyles as o}from"@material-ui/core";import n from"./ChartButton.js";import{jsx as i}from"react/jsx-runtime";var c=["className","buttons"];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 s(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 p=o({container:{position:"absolute",right:"8px",display:"flex",flexDirection:"column"}}),u=function(r){var o=r.className,a=r.buttons,u=e(r,c),l=p();return i("div",s(s({className:t(l.container,o)},u),{},{children:null==a?void 0:a.map((function(r){return i(n,s({},r),r.id)}))}))};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as o}from"@material-ui/core";import{useEffect as t}from"react";import{ReplayOutlined as e,PanToolOutlined as i,BorderStyle as
|
|
1
|
+
import{makeStyles as o}from"@material-ui/core";import{useEffect as t}from"react";import{ReplayOutlined as e,PanToolOutlined as i,BorderStyle as r,Add as n,Remove as l}from"@material-ui/icons";import{isEmpty as s}from"lodash";import{useZoom as a}from"../effects/useZoom.js";import{useKeyboardControl as m}from"../effects/useKeyboardControl.js";import"@babel/runtime/helpers/slicedToArray";import c from"./ChartButtons.js";import{MIN_CHART_HEIGHT as d,ZOOM_TYPE as p}from"../constants.js";import{jsx as u,jsxs as f}from"react/jsx-runtime";var h=o({container:{width:"100%",height:"100%",position:"relative"}}),v=function(o){var v,b=o.chartRef,g=o.chart,C=o.children,Z=o.hideDefaultButtons,x=h(),y=a({chartRef:b}),k=y.zoomConfig,z=y.handleZoomEvent,P=y.handleResetZoom,R=y.isZoomEnabled,j=y.handleIsZoomEnabledChange,A=y.handleChartSelection,E=(null==b||null===(v=b.plotBox)||void 0===v?void 0:v.height)<=d,B=function(){z(p.zoomIn)},H=function(){z(p.zoomOut)};m([{keyCode:38,callback:B},{keyCode:40,callback:H}]);var I=[{id:0,tooltipProps:{title:"Reset Zoom"},isHidden:k.isZoomReset||E,onClick:P,children:u(e,{})},{id:1,tooltipProps:{title:"Pan"},isHidden:E,isActive:!R,onClick:function(){return j(!1)},children:u(i,{})},{id:2,tooltipProps:{title:"Drag To Zoom"},isHidden:E,isActive:R,onClick:function(){return j(!0)},children:u(r,{})},{id:3,tooltipProps:{title:"Zoom In"},onClick:B,children:u(n,{})},{id:4,tooltipProps:{title:"Zoom Out"},disabled:k.isZoomReset,onClick:H,children:u(l,{})}];return t((function(){s(b)||null==b||b.update({chart:{zoomType:E||!R?"none":"xy",panning:{enabled:!0,type:"xy"}},xAxis:{events:{afterSetExtremes:function(o){"zoom"===o.trigger&&A()}}},yAxis:{events:{afterSetExtremes:function(o){"zoom"===o.trigger&&A()}}},plotOptions:{series:{cursor:E||!R?"grab":"crosshair"}}})}),[b,R]),f("div",{className:x.container,children:[g,!Z&&u(c,{style:{bottom:(null==b?void 0:b.marginBottom)+3},buttons:I}),C]})};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/slicedToArray";import{useState as n,useEffect as t}from"react";import{isEmpty as r}from"lodash";import{getXExtremes as o,getYExtremes as m,getChartScale as a,getNextZoomCoordinates as s,getCurrentMinValue as x,getCurrentMaxValue as c}from"../utils.js";import{MAX_ZOOM as p}from"../constants.js";function f(e,i){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);i&&(t=t.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,t)}return n}function l(i){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){e(i,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}))}return i}var u=function(e){var f=e.chartRef,u=n({}),g=i(u,2),y=g[0],b=g[1],M=n(!0),O=i(M,2),h=O[0],X=O[1];t((function(){var e=f||{},i=e.xAxis,n=e.yAxis,t=i?i[0]:{},r=t.min,o=t.max,m=n?n[0]:{},a=m.min,s=m.max;b({xStep:(o-r)/p,yStep:(s-a)/p,originXMin:r,originXMax:o,originYMin:a,originYMax:s,isZoomReset:!0})}),[f]);t((function(){r(y)||(f.xAxis[0].setExtremes(y.minX,y.maxX),f.yAxis[0].setExtremes(y.minY,y.maxY))}),[y.minX,y.minY,y.maxX,y.maxY]);return{handleChartSelection:function(){b((function(e){return l(l({},e),{},{isZoomReset:!1})}))},isZoomEnabled:h,handleIsZoomEnabledChange:function(e){X(e)},handleResetZoom:function(){var e=y.originXMin,i=y.originXMax,n=y.originYMin,t=y.originYMax;f.xAxis[0].setExtremes(e,i),f.yAxis[0].setExtremes(n,t),b((function(e){return l(l({},e),{},{isZoomReset:!0})}))},handleZoomEvent:function(e){var n=o(f),t=m(f),r=a({extremes:n,step:y.xStep}),p=a({extremes:t,step:y.yStep}),u=s({min:n.min,max:n.max,initialMin:y.originXMin,initialMax:y.originXMax,zoomStep:y.xStep,zoomType:e,scale:r}),g=s({min:t.min,max:t.max,initialMin:y.originYMin,initialMax:y.originYMax,zoomStep:y.yStep,zoomType:e,scale:p}),M=i(u,2),O=M[0],h=M[1],X=i(g,2),Y=X[0],j=X[1],d=y.originXMin,S=y.originXMax,v=y.originYMax,E=y.originYMin,P=x(O,d),Z=x(Y,E),A=c(h,S),w=c(j,v),R=d===P&&S===A&&v===w&&E===Z;b((function(e){return l(l({},e),{},{isZoomReset:R,minX:P>h?h:P,maxX:A<O?O:A,minY:Z>j?j:Z,maxY:w<Y?Y:w})}))},zoomConfig:y}};export{u as useZoom};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corva/ui",
|
|
3
|
-
"version": "0.47.0-
|
|
3
|
+
"version": "0.47.0-6",
|
|
4
4
|
"description": "Shared components/utils for Corva ui projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"corva-ui"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@babel/plugin-transform-runtime": "^7.12.10",
|
|
85
85
|
"@babel/preset-env": "^7.12.11",
|
|
86
86
|
"@babel/preset-react": "^7.12.10",
|
|
87
|
-
"@corva/dc-platform-shared": "0.1.
|
|
87
|
+
"@corva/dc-platform-shared": "^0.1.5",
|
|
88
88
|
"@corva/eslint-config-browser": "^0.0.4",
|
|
89
89
|
"@date-io/moment": "1.3.13",
|
|
90
90
|
"@material-ui/core": "4.11.2",
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
"rollup-plugin-copy": "^3.4.0",
|
|
163
163
|
"sass": "^1.51.0",
|
|
164
164
|
"semver": "7.2.1",
|
|
165
|
-
"slate": "0.
|
|
166
|
-
"slate-react": "0.
|
|
165
|
+
"slate": "^0.62.0",
|
|
166
|
+
"slate-react": "^0.62.0",
|
|
167
167
|
"socket.io-client": "2.2.0",
|
|
168
168
|
"sql-parser": "0.5.0",
|
|
169
169
|
"style-loader": "1.0.0",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"uuid": "3.4.0",
|
|
174
174
|
"video-extensions": "1.1.0",
|
|
175
175
|
"webpack": "4.44.2",
|
|
176
|
-
"webpack-bundle-analyzer": "
|
|
176
|
+
"webpack-bundle-analyzer": "3.9.0",
|
|
177
177
|
"webpack-cli": "3.3.6",
|
|
178
178
|
"webpack-dev-server": "3.11.1",
|
|
179
179
|
"webpack-manifest-plugin": "2.2.0",
|
|
@@ -187,16 +187,16 @@
|
|
|
187
187
|
"@rollup/plugin-image": "^2.0.6",
|
|
188
188
|
"@rollup/plugin-json": "^4.1.0",
|
|
189
189
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
|
190
|
-
"@storybook/addon-docs": "6.
|
|
191
|
-
"@storybook/addon-essentials": "6.
|
|
192
|
-
"@storybook/addon-links": "6.
|
|
190
|
+
"@storybook/addon-docs": "6.4.9",
|
|
191
|
+
"@storybook/addon-essentials": "6.4.9",
|
|
192
|
+
"@storybook/addon-links": "6.4.9",
|
|
193
193
|
"@storybook/addon-postcss": "^2.0.0",
|
|
194
|
-
"@storybook/addon-storysource": "6.
|
|
195
|
-
"@storybook/addons": "6.
|
|
196
|
-
"@storybook/cli": "6.
|
|
194
|
+
"@storybook/addon-storysource": "6.4.9",
|
|
195
|
+
"@storybook/addons": "6.4.9",
|
|
196
|
+
"@storybook/cli": "6.4.9",
|
|
197
197
|
"@storybook/preset-scss": "^1.0.3",
|
|
198
|
-
"@storybook/react": "6.
|
|
199
|
-
"@storybook/theming": "6.
|
|
198
|
+
"@storybook/react": "6.4.9",
|
|
199
|
+
"@storybook/theming": "6.4.9",
|
|
200
200
|
"@testing-library/jest-dom": "^5.16.5",
|
|
201
201
|
"@testing-library/react": "^11.1.0",
|
|
202
202
|
"@testing-library/react-hooks": "^8.0.1",
|