@corva/ui 0.81.0-11 → 0.81.0-13
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.
- package/cjs-bundle/components/AdvancedSlider/AdvancedSlider.js +1 -1
- package/cjs-bundle/components/AdvancedSlider/Handle.js +1 -1
- package/cjs-bundle/components/AdvancedSlider/icons/HandleIcon.js +1 -0
- package/cjs-bundle/components/AdvancedSlider/styles/handleStyles.js +1 -0
- package/cjs-bundle/components/AdvancedSlider/styles/sliderStyles.js +1 -0
- package/components/AdvancedSlider/AdvancedSlider.d.ts.map +1 -1
- package/components/AdvancedSlider/AdvancedSlider.js +1 -1
- package/components/AdvancedSlider/Handle.d.ts.map +1 -1
- package/components/AdvancedSlider/Handle.js +1 -1
- package/components/AdvancedSlider/icons/HandleIcon.d.ts +5 -0
- package/components/AdvancedSlider/icons/HandleIcon.d.ts.map +1 -0
- package/components/AdvancedSlider/icons/HandleIcon.js +1 -0
- package/components/AdvancedSlider/icons/index.d.ts +2 -0
- package/components/AdvancedSlider/icons/index.d.ts.map +1 -0
- package/components/AdvancedSlider/styles/handleStyles.d.ts +2 -0
- package/components/AdvancedSlider/styles/handleStyles.d.ts.map +1 -0
- package/components/AdvancedSlider/styles/handleStyles.js +1 -0
- package/components/AdvancedSlider/styles/index.d.ts +3 -0
- package/components/AdvancedSlider/styles/index.d.ts.map +1 -0
- package/components/AdvancedSlider/styles/sliderStyles.d.ts +2 -0
- package/components/AdvancedSlider/styles/sliderStyles.d.ts.map +1 -0
- package/components/AdvancedSlider/styles/sliderStyles.js +1 -0
- package/components/Chart/options.d.ts +1 -0
- package/components/Chart/options.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),a=require("re-resizable"),r=require("react-sizeme"),i=require("classnames"),o=require("lodash"),l=require("../shared/useThrottledCallback.js"),d=require("./Handle.js"),u=require("./icons/HandleIcon.js"),s=require("./styles/sliderStyles.js");require("./styles/handleStyles.js");var c=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(e),f=h(t),v=h(i);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){m.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y="twoValuesSliderDefault",g=function(e){var t,r,i=e.min,o=e.max,h=e.value,p=e.size,g=e.orientation,j=e.valueFormatter,w=e.displayFormatter,z=e.editableHandles,x=e.onChange,H=e.onStop,O=e.reversed,S=e.handlePosition,C=e.handleClasses,P=e.minimal,E=s.useSliderStyles(),q=n.useRef(null),R=n.useRef(null),T=n.useState([j(null==h?void 0:h.at(0)),j(null==h?void 0:h.at(1))]),k=f.default(T,2),M=k[0],L=k[1],_=n.useRef(null),B=n.useState(!1),D=f.default(B,2),F=D[0],N=D[1];n.useEffect((function(){if(!_.current){var e=[j(null==h?void 0:h.at(0)),j(null==h?void 0:h.at(1))],t=Math.min.apply(Math,e),n=Math.max.apply(Math,e);L([t,n])}}),[null==h?void 0:h.at(0),null==h?void 0:h.at(1)]);var W=f.default(M,2),I=W[0],X=W[1];n.useEffect((function(){if("horizontal"===g){var e=p.width/(o-i)*(I-i),t=p.width/(o-i)*(o-X);q.current.updateSize({width:O?t:e,height:p.height}),R.current.updateSize({width:O?e:t,height:p.height})}else if("vertical"===g){var n=p.height/(o-i)*(I-i),a=p.height/(o-i)*(o-X);q.current.updateSize({width:p.width,height:O?a:n}),R.current.updateSize({width:p.width,height:O?n:a})}}),[i,o,I,X,p.width,p.height,g]),n.useEffect((function(){var e=function(){document.removeEventListener("mousemove",J),document.removeEventListener("mouseup",K),document.removeEventListener("touchmove",Q),document.removeEventListener("touchend",U)};return F?(document.addEventListener("mousemove",J),document.addEventListener("mouseup",K),document.addEventListener("touchmove",Q),document.addEventListener("touchend",U)):(e(),H()),function(){e()}}),[F]);var Y=l.useThrottledCallback((function(e,t,n){_.current="onResize Event";var a=n.clientWidth,r=n.clientHeight,l=I,d=X;"right"===t?O?d=j(o-a/p.width*(o-i)):l=j(i+a/p.width*(o-i)):"left"===t?O?l=j(i+a/p.width*(o-i)):d=j(o-a/p.width*(o-i)):"bottom"===t?O?d=j(o-r/p.height*(o-i)):l=j(i+r/p.height*(o-i)):"top"===t&&(O?l=j(i+r/p.height*(o-i)):d=j(o-r/p.height*(o-i))),l=Math.min(l,X),d=Math.max(d,I),L([l,d]),x([l,d])})),A=l.useThrottledCallback((function(){_.current=null,H()})),V=function(e,t){_.current={xPos:e,yPos:t,head:I,tail:X}},G=function(e,t){if(_.current){var n;"horizontal"===g?n=(_.current.xPos-e)/p.width*(o-i):"vertical"===g&&(n=(_.current.yPos-t)/p.height*(o-i));var a,r,l=_.current.head-n*(O?-1:1),d=_.current.tail-n*(O?-1:1),u=_.current.tail-_.current.head;l<=i?(a=i,r=i+u):d>=o?(a=o-u,r=o):(a=l,r=d),a=j(a),r=j(r),L([a,r]),x([a,r])}},J=l.useThrottledCallback((function(e){G(e.clientX,e.clientY)})),K=l.useThrottledCallback((function(){_.current=null,N(!1)})),Q=l.useThrottledCallback((function(e){G(e.touches[0].pageX,e.touches[0].pageY)})),U=l.useThrottledCallback((function(){_.current=null,N(!1)})),Z=l.useThrottledCallback((function(e){L([e,X]),x([e,X])})),$=l.useThrottledCallback((function(e){L([I,e]),x([I,e])})),ee=n.useMemo((function(){return(X-I)/(o-i)*("vertical"===g?p.height:p.width)<30}),[i,o,I,X]),te=function(e){var t={min:i,max:X,value:I,onChange:Z},n={min:I,max:o,value:X,onChange:$};return"head"===e?c.jsx(d.Handle,b({"data-testid":"".concat(y,"_handle_top"),placement:"head",readOnly:!z,displayFormatter:w,orientation:g,classes:C,minimal:P},O?n:t)):"tail"===e?c.jsx(d.Handle,b({"data-testid":"".concat(y,"_handle_bottom"),placement:"tail",readOnly:!z,displayFormatter:w,orientation:g,classes:C,minimal:P},O?t:n)):null};return c.jsx("div",{className:E.rootWrapper,children:c.jsxs("div",{className:v.default(E.root,(t={},m.default(t,E.horizontalRoot,"horizontal"===g),m.default(t,E.verticalRoot,"vertical"===g),m.default(t,E.minimal,P),t)),children:[c.jsx(a.Resizable,{ref:q,minHeight:0,minWidth:0,enable:{right:"horizontal"===g,bottom:"vertical"===g},handleComponent:{right:te("head"),bottom:te("head")},onResize:Y,onResizeStop:A}),c.jsx("div",{className:E.body,"data-testid":"slider-body",onMouseDown:function(e){V(e.clientX,e.clientY),N(!0)},onTouchStart:function(e){V(e.touches[0].pageX,e.touches[0].pageY),N(!0)},children:ee?c.jsx("div",{className:v.default((r={},m.default(r,E.horizontalBodyHandle,"horizontal"===g),m.default(r,E.verticalBodyHandle,"vertical"===g),m.default(r,E.leftBodyHandle,"left"===S),m.default(r,E.rightBodyHandle,"right"===S),m.default(r,E.topBodyHandle,"top"===S),m.default(r,E.bottomBodyHandle,"bottom"===S),r)),children:c.jsx("div",{className:E.bodyHandle,"data-testid":"".concat(y,"_handle"),children:c.jsx(u.HandleIcon,{orientation:"vertical",minimal:P})})}):c.jsx("div",{className:E.bodyHandleIcon,"data-testid":"".concat(y,"_handle"),children:c.jsx(u.HandleIcon,{orientation:g,minimal:P})})}),c.jsx(a.Resizable,{ref:R,minHeight:0,minWidth:0,enable:{left:"horizontal"===g,top:"vertical"===g},handleComponent:{left:te("tail"),top:te("tail")},onResize:Y,onResizeStop:A})]})})};g.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(e){return e},onChange:o.noop,onStop:o.noop,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var j=r.withSize({monitorWidth:!0,monitorHeight:!0})(g);exports.AdvancedSlider=g,exports.default=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),a=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),l=require("@material-ui/core"),i=require("classnames"),r=require("lodash");require("./styles/sliderStyles.js");var n=require("./styles/handleStyles.js"),d=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(e),s=o(a),c=o(i),f=r.debounce((function(e){e()}),500);exports.Handle=function(e){var a,i,r=e.value,o=e.orientation,h=e.placement,m=e.readOnly,v=e.onChange,p=e.min,H=e.max,y=e.displayFormatter,b=e.classes,q=e.minimal,R=e["data-testid"],j=n.useHandleStyles(),z=t.useState(r),x=s.default(z,2),T=x[0],N=x[1],S=t.useRef(null);t.useEffect((function(){N(r)}),[r]);return d.jsx("div",{className:c.default(j.root,b.handleRoot,(a={},u.default(a,j.horizontalHeadRoot,"horizontal"===o&&"head"===h),u.default(a,j.horizontalTailRoot,"horizontal"===o&&"tail"===h),u.default(a,j.verticalHeadRoot,"vertical"===o&&"head"===h),u.default(a,j.verticalTailRoot,"vertical"===o&&"tail"===h),u.default(a,j.minimalHandleRoot,q),a)),children:d.jsx("div",{className:c.default(j.handle,b.handle,(i={},u.default(i,j.horizontalHeadHandle,"horizontal"===o&&"head"===h),u.default(i,j.horizontalTailHandle,"horizontal"===o&&"tail"===h),u.default(i,j.verticalHeadHandle,"vertical"===o&&"head"===h),u.default(i,j.verticalTailHandle,"vertical"===o&&"tail"===h),u.default(i,j.minimalHandle,q),u.default(i,j.minimalVerticalHandle,q&&"vertical"===o),i)),"data-testid":R,children:!q&&d.jsx(l.Input,{inputProps:{"data-testid":"handle-input"},readOnly:m,inputRef:S,classes:{root:j.inputRoot},value:m?y(T):T,onChange:function(e){var a=e.target.value;N(a),Number.isFinite(+a)&&+a>=p&&+a<=H&&f((function(){v(+a)}))},disableUnderline:!0,error:!(Number.isFinite(+T)&&+T>=p&&+T<=H)})})})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime");exports.HandleIcon=function(e){var i=e.orientation;return e.minimal?"horizontal"===i?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 -2 16 16",fill:"none",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 4L4 4L4 12L5.33333 12L5.33333 4ZM8.66659 4L8.66659 12L7.33325 12L7.33325 4L8.66659 4ZM12.0001 4L12.0001 12L10.6667 12L10.6667 4L12.0001 4Z",fill:"white"})}):t.jsxs("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{width:"12",height:"1"}),t.jsx("rect",{y:"3",width:"12",height:"1"}),t.jsx("rect",{y:"6",width:"12",height:"1"})]}):"horizontal"===i?t.jsxs("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 7.5 0.5)"}),t.jsx("rect",{x:"4.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 4.5 0.5)"}),t.jsx("rect",{x:"1.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 1.5 0.5)"})]}):t.jsxs("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{width:"12",height:"1"}),t.jsx("rect",{y:"3",width:"12",height:"1"}),t.jsx("rect",{y:"6",width:"12",height:"1"})]})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core"),r={minWidth:47,height:20,borderRadius:4},t=e.makeStyles((function(e){var t=e.isLightTheme,o=e.palette;return{root:{position:"absolute","&:hover":{borderColor:o.primary.main},"&:active":{borderColor:o.primary.main},"&:hover $handle":{borderColor:o.primary.main},"&:active $handle":{background:o.primary.dark,borderColor:o.primary.main},"&:hover $inputRoot":{background:o.primary.dark,border:"1px solid ".concat(o.primary.main)},"&:active $inputRoot":{background:o.primary.dark,border:"1px solid ".concat(o.primary.main)},display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},horizontalHeadRoot:{top:0,bottom:0,right:5},horizontalTailRoot:{top:0,bottom:0,left:5},verticalHeadRoot:{left:0,right:0,bottom:5},verticalTailRoot:{left:0,right:0,top:5},handle:{position:"relative",background:t?"#B1B1B1":"#414141","& > p":{fontSize:"12px",textAlign:"center",lineHeight:"20px"},display:"flex",alignItems:"center",justifyContent:"center","&:before":{position:"absolute",left:"50%",top:"50%",height:64,width:64,content:'""',transform:"translate(-50%, -50%)",zIndex:100}},horizontalHeadHandle:r,horizontalTailHandle:r,verticalHeadHandle:r,verticalTailHandle:r,inputRoot:{borderRadius:4,minWidth:47,zIndex:101,height:"20px",fontSize:"12px",border:"1px solid ".concat(o.primary.text9),"&:hover":{border:"1px solid ".concat(o.primary.main)},"&:active":{textDecoration:"underline"},"&::before":{borderWidth:0},"&::after":{borderWidth:"1px !important"},"& .MuiInputBase-input":{padding:0,height:"100%",textAlign:"center"},"&:hover::before":{borderWidth:"1px !important"},"&.Mui-focused":{textDecoration:"underline",background:o.primary.dark,border:"1px solid ".concat(o.primary.main)}},minimalHandle:{background:o.primary.text9,width:8,height:20,"& .MuiInput-underline.Mui-error:after":{border:0}},minimalVerticalHandle:{width:20,height:8},minimalHandleRoot:{borderColor:o.primary.text9,zIndex:100,"&:not(:hover)":{border:"none"}}}}));exports.useHandleStyles=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("@material-ui/core"),e=o.makeStyles((function(e){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover:not($minimal) $body":{background:"#008BA366"},"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{display:"flex",alignItems:"center"},verticalRoot:{display:"flex",alignItems:"center",flexDirection:"column"},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden"},bodyHandleIcon:{visibility:"hidden"},minimal:{border:"1px solid ".concat(e.palette.background.b9),borderRadius:4,"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:o.fade(e.palette.background.b7,.1),border:"1px solid ".concat(e.palette.primary.text9),borderRadius:4}}}}));exports.useSliderStyles=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"AA6BO,wDA4VN;;;;;QAKmB,kDAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useRef as
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useRef as n,useState as o,useEffect as i,useMemo as r}from"react";import{Resizable as a}from"re-resizable";import{withSize as l}from"react-sizeme";import d from"classnames";import{noop as c}from"lodash";import{useThrottledCallback as h}from"../shared/useThrottledCallback.js";import{Handle as u}from"./Handle.js";import{HandleIcon as s}from"./icons/HandleIcon.js";import{useSliderStyles as m}from"./styles/sliderStyles.js";import"./styles/handleStyles.js";import{jsx as p,jsxs as v}from"react/jsx-runtime";function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?f(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var y="twoValuesSliderDefault",b=function(l){var c,f,b=l.min,w=l.max,z=l.value,O=l.size,j=l.orientation,H=l.valueFormatter,P=l.displayFormatter,S=l.editableHandles,E=l.onChange,x=l.onStop,C=l.reversed,L=l.handlePosition,M=l.handleClasses,R=l.minimal,B=m(),D=n(null),F=n(null),N=o([H(null==z?void 0:z.at(0)),H(null==z?void 0:z.at(1))]),_=e(N,2),W=_[0],X=_[1],Y=n(null),T=o(!1),k=e(T,2),I=k[0],A=k[1];i((function(){if(!Y.current){var t=[H(null==z?void 0:z.at(0)),H(null==z?void 0:z.at(1))],e=Math.min.apply(Math,t),n=Math.max.apply(Math,t);X([e,n])}}),[null==z?void 0:z.at(0),null==z?void 0:z.at(1)]);var V=e(W,2),q=V[0],G=V[1];i((function(){if("horizontal"===j){var t=O.width/(w-b)*(q-b),e=O.width/(w-b)*(w-G);D.current.updateSize({width:C?e:t,height:O.height}),F.current.updateSize({width:C?t:e,height:O.height})}else if("vertical"===j){var n=O.height/(w-b)*(q-b),o=O.height/(w-b)*(w-G);D.current.updateSize({width:O.width,height:C?o:n}),F.current.updateSize({width:O.width,height:C?n:o})}}),[b,w,q,G,O.width,O.height,j]),i((function(){var t=function(){document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",$),document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",et)};return I?(document.addEventListener("mousemove",Z),document.addEventListener("mouseup",$),document.addEventListener("touchmove",tt),document.addEventListener("touchend",et)):(t(),x()),function(){t()}}),[I]);var J=h((function(t,e,n){Y.current="onResize Event";var o=n.clientWidth,i=n.clientHeight,r=q,a=G;"right"===e?C?a=H(w-o/O.width*(w-b)):r=H(b+o/O.width*(w-b)):"left"===e?C?r=H(b+o/O.width*(w-b)):a=H(w-o/O.width*(w-b)):"bottom"===e?C?a=H(w-i/O.height*(w-b)):r=H(b+i/O.height*(w-b)):"top"===e&&(C?r=H(b+i/O.height*(w-b)):a=H(w-i/O.height*(w-b))),r=Math.min(r,G),a=Math.max(a,q),X([r,a]),E([r,a])})),K=h((function(){Y.current=null,x()})),Q=function(t,e){Y.current={xPos:t,yPos:e,head:q,tail:G}},U=function(t,e){if(Y.current){var n;"horizontal"===j?n=(Y.current.xPos-t)/O.width*(w-b):"vertical"===j&&(n=(Y.current.yPos-e)/O.height*(w-b));var o,i,r=Y.current.head-n*(C?-1:1),a=Y.current.tail-n*(C?-1:1),l=Y.current.tail-Y.current.head;r<=b?(o=b,i=b+l):a>=w?(o=w-l,i=w):(o=r,i=a),o=H(o),i=H(i),X([o,i]),E([o,i])}},Z=h((function(t){U(t.clientX,t.clientY)})),$=h((function(){Y.current=null,A(!1)})),tt=h((function(t){U(t.touches[0].pageX,t.touches[0].pageY)})),et=h((function(){Y.current=null,A(!1)})),nt=h((function(t){X([t,G]),E([t,G])})),ot=h((function(t){X([q,t]),E([q,t])})),it=r((function(){return(G-q)/(w-b)*("vertical"===j?O.height:O.width)<30}),[b,w,q,G]),rt=function(t){var e={min:b,max:G,value:q,onChange:nt},n={min:q,max:w,value:G,onChange:ot};return"head"===t?p(u,g({"data-testid":"".concat(y,"_handle_top"),placement:"head",readOnly:!S,displayFormatter:P,orientation:j,classes:M,minimal:R},C?n:e)):"tail"===t?p(u,g({"data-testid":"".concat(y,"_handle_bottom"),placement:"tail",readOnly:!S,displayFormatter:P,orientation:j,classes:M,minimal:R},C?e:n)):null};return p("div",{className:B.rootWrapper,children:v("div",{className:d(B.root,(c={},t(c,B.horizontalRoot,"horizontal"===j),t(c,B.verticalRoot,"vertical"===j),t(c,B.minimal,R),c)),children:[p(a,{ref:D,minHeight:0,minWidth:0,enable:{right:"horizontal"===j,bottom:"vertical"===j},handleComponent:{right:rt("head"),bottom:rt("head")},onResize:J,onResizeStop:K}),p("div",{className:B.body,"data-testid":"slider-body",onMouseDown:function(t){Q(t.clientX,t.clientY),A(!0)},onTouchStart:function(t){Q(t.touches[0].pageX,t.touches[0].pageY),A(!0)},children:p("div",it?{className:d((f={},t(f,B.horizontalBodyHandle,"horizontal"===j),t(f,B.verticalBodyHandle,"vertical"===j),t(f,B.leftBodyHandle,"left"===L),t(f,B.rightBodyHandle,"right"===L),t(f,B.topBodyHandle,"top"===L),t(f,B.bottomBodyHandle,"bottom"===L),f)),children:p("div",{className:B.bodyHandle,"data-testid":"".concat(y,"_handle"),children:p(s,{orientation:"vertical",minimal:R})})}:{className:B.bodyHandleIcon,"data-testid":"".concat(y,"_handle"),children:p(s,{orientation:j,minimal:R})})}),p(a,{ref:F,minHeight:0,minWidth:0,enable:{left:"horizontal"===j,top:"vertical"===j},handleComponent:{left:rt("tail"),top:rt("tail")},onResize:J,onResizeStop:K})]})})};b.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(t){return t},onChange:c,onStop:c,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var w=l({monitorWidth:!0,monitorHeight:!0})(b);export{b as AdvancedSlider,w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/Handle.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/Handle.js"],"names":[],"mappings":"AAsBO;;;;;;;;;;;;gBAsEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useRef as i,useEffect as l}from"react";import{Input as r}from"@material-ui/core";import o from"classnames";import{debounce as n}from"lodash";import"./styles/sliderStyles.js";import{useHandleStyles as d}from"./styles/handleStyles.js";import{jsx as m}from"react/jsx-runtime";var s=n((function(a){a()}),500),c=function(n){var c,h,p=n.value,u=n.orientation,v=n.placement,f=n.readOnly,H=n.onChange,y=n.min,z=n.max,R=n.displayFormatter,b=n.classes,T=n.minimal,N=n["data-testid"],g=d(),j=t(p),x=e(j,2),F=x[0],C=x[1],O=i(null);l((function(){C(p)}),[p]);return m("div",{className:o(g.root,b.handleRoot,(c={},a(c,g.horizontalHeadRoot,"horizontal"===u&&"head"===v),a(c,g.horizontalTailRoot,"horizontal"===u&&"tail"===v),a(c,g.verticalHeadRoot,"vertical"===u&&"head"===v),a(c,g.verticalTailRoot,"vertical"===u&&"tail"===v),a(c,g.minimalHandleRoot,T),c)),children:m("div",{className:o(g.handle,b.handle,(h={},a(h,g.horizontalHeadHandle,"horizontal"===u&&"head"===v),a(h,g.horizontalTailHandle,"horizontal"===u&&"tail"===v),a(h,g.verticalHeadHandle,"vertical"===u&&"head"===v),a(h,g.verticalTailHandle,"vertical"===u&&"tail"===v),a(h,g.minimalHandle,T),a(h,g.minimalVerticalHandle,T&&"vertical"===u),h)),"data-testid":N,children:!T&&m(r,{inputProps:{"data-testid":"handle-input"},readOnly:f,inputRef:O,classes:{root:g.inputRoot},value:f?R(F):F,onChange:function(a){var e=a.target.value;C(e),Number.isFinite(+e)&&+e>=y&&+e<=z&&s((function(){H(+e)}))},disableUnderline:!0,error:!(Number.isFinite(+F)&&+F>=y&&+F<=z)})})})};export{c as Handle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HandleIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/icons/HandleIcon.js"],"names":[],"mappings":"AAAO;;;gBAsCN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as h}from"react/jsx-runtime";var i=function(i){var e=i.orientation;return i.minimal?"horizontal"===e?t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 -2 16 16",fill:"none",children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 4L4 4L4 12L5.33333 12L5.33333 4ZM8.66659 4L8.66659 12L7.33325 12L7.33325 4L8.66659 4ZM12.0001 4L12.0001 12L10.6667 12L10.6667 4L12.0001 4Z",fill:"white"})}):h("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{width:"12",height:"1"}),t("rect",{y:"3",width:"12",height:"1"}),t("rect",{y:"6",width:"12",height:"1"})]}):h("svg","horizontal"===e?{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{x:"7.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 7.5 0.5)"}),t("rect",{x:"4.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 4.5 0.5)"}),t("rect",{x:"1.5",y:"0.5",width:"12",height:"1",transform:"rotate(90 1.5 0.5)"})]}:{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{width:"12",height:"1"}),t("rect",{y:"3",width:"12",height:"1"}),t("rect",{y:"6",width:"12",height:"1"})]})};export{i as HandleIcon};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/icons/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const useHandleStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"handle" | "root" | "inputRoot" | "horizontalHeadRoot" | "horizontalTailRoot" | "verticalHeadRoot" | "verticalTailRoot" | "horizontalHeadHandle" | "horizontalTailHandle" | "verticalHeadHandle" | "verticalTailHandle" | "minimalHandle" | "minimalVerticalHandle" | "minimalHandleRoot">;
|
|
2
|
+
//# sourceMappingURL=handleStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/handleStyles.js"],"names":[],"mappings":"AAWA,qXA2HI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeStyles as r}from"@material-ui/core";var e={minWidth:47,height:20,borderRadius:4},t=r((function(r){var t=r.isLightTheme,o=r.palette;return{root:{position:"absolute","&:hover":{borderColor:o.primary.main},"&:active":{borderColor:o.primary.main},"&:hover $handle":{borderColor:o.primary.main},"&:active $handle":{background:o.primary.dark,borderColor:o.primary.main},"&:hover $inputRoot":{background:o.primary.dark,border:"1px solid ".concat(o.primary.main)},"&:active $inputRoot":{background:o.primary.dark,border:"1px solid ".concat(o.primary.main)},display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},horizontalHeadRoot:{top:0,bottom:0,right:5},horizontalTailRoot:{top:0,bottom:0,left:5},verticalHeadRoot:{left:0,right:0,bottom:5},verticalTailRoot:{left:0,right:0,top:5},handle:{position:"relative",background:t?"#B1B1B1":"#414141","& > p":{fontSize:"12px",textAlign:"center",lineHeight:"20px"},display:"flex",alignItems:"center",justifyContent:"center","&:before":{position:"absolute",left:"50%",top:"50%",height:64,width:64,content:'""',transform:"translate(-50%, -50%)",zIndex:100}},horizontalHeadHandle:e,horizontalTailHandle:e,verticalHeadHandle:e,verticalTailHandle:e,inputRoot:{borderRadius:4,minWidth:47,zIndex:101,height:"20px",fontSize:"12px",border:"1px solid ".concat(o.primary.text9),"&:hover":{border:"1px solid ".concat(o.primary.main)},"&:active":{textDecoration:"underline"},"&::before":{borderWidth:0},"&::after":{borderWidth:"1px !important"},"& .MuiInputBase-input":{padding:0,height:"100%",textAlign:"center"},"&:hover::before":{borderWidth:"1px !important"},"&.Mui-focused":{textDecoration:"underline",background:o.primary.dark,border:"1px solid ".concat(o.primary.main)}},minimalHandle:{background:o.primary.text9,width:8,height:20,"& .MuiInput-underline.Mui-error:after":{border:0}},minimalVerticalHandle:{width:20,height:8},minimalHandleRoot:{borderColor:o.primary.text9,zIndex:100,"&:not(:hover)":{border:"none"}}}}));export{t as useHandleStyles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const useSliderStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"body" | "root" | "rootWrapper" | "horizontalRoot" | "verticalRoot" | "horizontalBodyHandle" | "verticalBodyHandle" | "leftBodyHandle" | "rightBodyHandle" | "topBodyHandle" | "bottomBodyHandle" | "bodyHandle" | "bodyHandleIcon" | "minimal">;
|
|
2
|
+
//# sourceMappingURL=sliderStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliderStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/sliderStyles.js"],"names":[],"mappings":"AAIA,2UA+GI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeStyles as o,fade as t}from"@material-ui/core";var e=o((function(o){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover:not($minimal) $body":{background:"#008BA366"},"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{display:"flex",alignItems:"center"},verticalRoot:{display:"flex",alignItems:"center",flexDirection:"column"},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden"},bodyHandleIcon:{visibility:"hidden"},minimal:{border:"1px solid ".concat(o.palette.background.b9),borderRadius:4,"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:t(o.palette.background.b7,.1),border:"1px solid ".concat(o.palette.primary.text9),borderRadius:4}}}}));export{e as useSliderStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAiBA
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/options.js"],"names":[],"mappings":";AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgLC"}
|