@corva/ui 0.47.0-3 → 0.47.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
- 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"},"&:hover ":{color:e.primary.text1},"& .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,d=o.className,m=o.children,u=o.tooltipProps,b=o.isActive,v=o.isHidden,f=o.disabled,h=e(o,c),y=s(),g=n("div",l(l({className:t(y.button,d,(a={},r(a,y.isHidden,v),r(a,y.disabled,f),r(a,y.isActive,b),a)),onClick:f||p},h),{},{children:m}));return f?g:n(i,l(l({placement:"left"},u),{},{children:g}))};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",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 t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import r 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","bottom"];function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?a(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var p=o({container:{position:"absolute",right:"8px",display:"flex",flexDirection:"column"}}),m=function(t){var o=t.className,a=t.buttons,m=t.bottom,l=e(t,c),u=p();return i("div",s(s({className:r(u.container,o),style:{bottom:m}},l),{},{children:null==a?void 0:a.map((function(t){return i(n,s({},t),t.id)}))}))};export{m 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}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 i,PanToolOutlined as e,BorderStyle as n,Add as r,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 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,C=o.chartRef,Z=o.chart,b=h(),k=a({chart:C}),g=k.zoomConfig,y=k.handleZoomEvent,P=k.handleResetZoom,j=k.isZoomEnabled,x=k.handleIsZoomEnabledChange,R=(null==C||null===(v=C.plotBox)||void 0===v?void 0:v.height)<=d,z=function(){y(p.zoomIn)},B=function(){y(p.zoomOut)};m([{keyCode:38,callback:z},{keyCode:40,callback:B}]);var E=[{id:0,tooltipProps:{title:"Reset Zoom"},isHidden:g.isZoomReset||R,onClick:P,children:u(i,{})},{id:1,tooltipProps:{title:"Pan"},isHidden:R,isActive:!j,onClick:function(){return x(!1)},children:u(e,{})},{id:2,tooltipProps:{title:"Drag To Zoom"},isHidden:R,isActive:j,onClick:function(){return x(!0)},children:u(n,{})},{id:3,tooltipProps:{title:"Zoom In"},onClick:z,children:u(r,{})},{id:4,tooltipProps:{title:"Zoom Out"},disabled:g.isZoomReset,onClick:B,children:u(l,{})}];return t((function(){s(C)||null==C||C.update({chart:{zoomType:R||!j?"none":"xy",panning:{enabled:!0,type:"xy"}},plotOptions:{series:{cursor:R||!j?"grab":"crosshair"}}})}),[C,j]),f("div",{className:b.container,children:[Z,u(c,{bottom:(null==C?void 0:C.marginBottom)+3,buttons:E})]})};export{v as default};
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 i from"@babel/runtime/helpers/objectWithoutProperties";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as t}from"react";import{isEmpty as o}from"lodash";import{getXExtremes as a,getYExtremes as m,getChartScale as s,getNextZoomCoordinates as c,getCurrentMinValue as x,getCurrentMaxValue as p}from"../utils.js";import{MAX_ZOOM as l}from"../constants.js";var f=["originXMin","originXMax","originYMin","originYMax"];function u(i,e){var n=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.push.apply(n,r)}return n}function g(i){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?u(Object(r),!0).forEach((function(n){e(i,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(r,e))}))}return i}var M=function(e){var u=e.chart,M=r({}),b=n(M,2),y=b[0],X=b[1],Y=r(!0),O=n(Y,2),h=O[0],j=O[1];t((function(){var i=u||{},e=i.xAxis,n=i.yAxis,r=e?e[0]:{},t=r.min,o=r.max,a=n?n[0]:{},m=a.min,s=a.max;X({xStep:(o-t)/l,yStep:(s-m)/l,originXMin:t,originXMax:o,originYMin:m,originYMax:s,isZoomReset:!0})}),[u]);t((function(){o(y)||(u.xAxis[0].setExtremes(y.minX,y.maxX),u.yAxis[0].setExtremes(y.minY,y.maxY))}),[y.minX,y.minY,y.maxX,y.maxY]);return{handleChartSelection:function(){X((function(i){return g(g({},i),{},{isZoomReset:!1})}))},isZoomEnabled:h,handleIsZoomEnabledChange:function(i){j(i)},handleResetZoom:function(){X((function(e){var n=e.originXMin,r=e.originXMax,t=e.originYMin,o=e.originYMax;return g(g({},i(e,f)),{},{minX:n,maxX:r,minY:t,maxY:o,xScale:0,yScale:0})}))},handleZoomEvent:function(i){var e=a(u),r=m(u),t=s({extremes:e,step:y.xStep}),o=s({extremes:r,step:y.yStep}),l=c({min:e.min,max:e.max,initialMin:y.originXMin,initialMax:y.originXMax,zoomStep:y.xStep,zoomType:i,scale:t}),f=c({min:r.min,max:r.max,initialMin:y.originYMin,initialMax:y.originYMax,zoomStep:y.yStep,zoomType:i,scale:o}),M=n(l,2),b=M[0],Y=M[1],O=n(f,2),h=O[0],j=O[1],S=y.originXMin,d=y.originXMax,v=y.originYMax,P=y.originYMin,E=x(b,S),Z=x(h,P),w=p(Y,d),z=p(j,v),A=S===E&&d===w&&v===z&&P===Z;X((function(i){return g(g({},i),{},{isZoomReset:A,minX:E>Y?Y:E,maxX:w<b?b:w,minY:Z>j?j:Z,maxY:z<h?h:z})}))},zoomConfig:y}};export{M as useZoom};
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",
3
+ "version": "0.47.0-5",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -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.84.0",
166
- "slate-react": "0.83.2",
165
+ "slate": "0.66.5",
166
+ "slate-react": "0.66.7",
167
167
  "socket.io-client": "2.2.0",
168
168
  "sql-parser": "0.5.0",
169
169
  "style-loader": "1.0.0",