@corva/ui 0.39.0-2 → 0.39.0-3

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,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M16 6V8H17H18C19.1 8 20 8.9 20 10V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V10C4 8.9 4.9 8 6 8H14V6C14 3.24 16.24 1 19 1C21.76 1 24 3.24 24 6H22C22 4.34 20.66 3 19 3C17.34 3 16 4.34 16 6ZM6 20H18V10H6V20ZM12 17C13.1 17 14 16.1 14 15C14 13.9 13.1 13 12 13C10.9 13 10 13.9 10 15C10 16.1 10.9 17 12 17Z" fill="#03BCD4"/>
3
+ </svg>
@@ -1 +1 @@
1
- import{makeStyles as a,Tooltip as o,IconButton as e}from"@material-ui/core";import t from"classnames";import{jsx as d}from"react/jsx-runtime";var c=a((function(a){return{root:{width:36,height:36,"&:hover":{backgroundColor:a.palette.background.b7},borderRadius:"50%"},button:{width:"100%",height:"100%","&:hover":{backgroundColor:a.palette.background.b7}}}}));function r(a){var r=a.className,i=a.disabled,l=a.isDraggableAndResizable,n=a.lockedIcon,s=a.onClick,b=a.pageName,u=c();return d(o,{title:i?"Can't unlock dashboard layout":l?"Lock Dashboard Layout":"Unlock Dashboard Layout",children:d("div",{className:t(u.root,r),children:d(e,{className:u.button,color:"primary","data-testid":"".concat(b,"_").concat(l?"gridUnlocked":"gridLocked"),disabled:i,onClick:s,children:d("img",{src:l?"/static/media/a26b034a29631cd21c82e74f67904071.svg":n,alt:"Lock"})})})})}r.defaultProps={lockedIcon:"/static/media/2d1e493e7f3afb84f4a5c8aded37a718.svg"},r.LockedWhiteIcon="/static/media/fb9a5d3233e9e3e310d6d297e6ddcc55.svg";export{r as default};
1
+ import{makeStyles as a,Tooltip as e,IconButton as o}from"@material-ui/core";import t from"classnames";import{jsx as d}from"react/jsx-runtime";var c=a((function(a){return{root:{width:36,height:36,"&:hover":{backgroundColor:a.palette.background.b7},borderRadius:"50%"},button:{width:"100%",height:"100%","&:hover":{backgroundColor:a.palette.background.b7}}}}));function r(a){var r=a.className,i=a.disabled,l=a.isDraggableAndResizable,n=a.lockedIcon,s=a.onClick,b=a.pageName,u=c();return d(e,{title:i?"Can't unlock dashboard layout":l?"Lock Dashboard Layout":"Unlock Dashboard Layout",children:d("div",{className:t(u.root,r),children:d(o,{className:u.button,color:"primary","data-testid":"".concat(b,"_").concat(l?"gridUnlocked":"gridLocked"),disabled:i,onClick:s,children:d("img",{src:l?"/static/media/b1dce244ca65e361a28be5801cf93d73.svg":n,alt:"Lock"})})})})}r.defaultProps={lockedIcon:"/static/media/2d1e493e7f3afb84f4a5c8aded37a718.svg"},r.LockedWhiteIcon="/static/media/fb9a5d3233e9e3e310d6d297e6ddcc55.svg";export{r as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var n={rangeSliderInput:"Input_rangeSliderInput__uoNkK"};e(".Input_rangeSliderInput__uoNkK{background:#414141;border:none;border-radius:4px;color:#fff;display:block;font-size:10px;font-weight:500;margin:0 0 0 auto;outline:none;padding:2px 4px;text-align:center}");export{n as default};
1
+ import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={rangeSliderInput:"Input_rangeSliderInput__uoNkK",rotated:"Input_rotated__GBHlR"};t(".Input_rangeSliderInput__uoNkK{background:var(--palette-background-b-6);border:none;border:1px solid var(--palette-primary-text-6);border-radius:4px;color:var(--palette-primary-text-6);display:block;font-size:14px;font-weight:500;height:24px;line-height:24px;margin:0 0 0 auto;min-width:40px;outline:none;padding:2px 4px;text-align:center}.Input_rangeSliderInput__uoNkK:focus{border:1px solid var(--palette-primary-main);color:var(--palette-primary-contrast-text)}.Input_rotated__GBHlR{transform:rotate(180deg)}");export{e as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var r={rangeSliderHorizontal:"RangeSlider_rangeSliderHorizontal__SAdDE",rangeSliderVertical:"RangeSlider_rangeSliderVertical__k8ac-",rangeSliderRail:"RangeSlider_rangeSliderRail__ufDMI",rangeSliderRailHorizontal:"RangeSlider_rangeSliderRailHorizontal__rLPtT",rangeSliderRailVertical:"RangeSlider_rangeSliderRailVertical__4zKzk",rangeSliderBar:"RangeSlider_rangeSliderBar__Kj3LC",rangeSliderBarHorizontal:"RangeSlider_rangeSliderBarHorizontal__is0F7",rangeSliderBarVertical:"RangeSlider_rangeSliderBarVertical__2DexQ",rangeSliderBarView:"RangeSlider_rangeSliderBarView__6dNQB",rangeSliderBarViewHorizontal:"RangeSlider_rangeSliderBarViewHorizontal__6pRPw",rangeSliderBarViewVertical:"RangeSlider_rangeSliderBarViewVertical__W2QnY",rangeSliderThumb:"RangeSlider_rangeSliderThumb__KMaq0",rangeSliderLabel:"RangeSlider_rangeSliderLabel__3-qO8",rangeSliderInputDivider:"RangeSlider_rangeSliderInputDivider__PcwIK",rangeSliderCompactInputs:"RangeSlider_rangeSliderCompactInputs__ukFLL"};e(".RangeSlider_rangeSliderHorizontal__SAdDE{padding:30px 0 12px}.RangeSlider_rangeSliderVertical__k8ac-{height:100%;padding:0 30px}.RangeSlider_rangeSliderRail__ufDMI{background-color:hsla(0,0%,100%,.3);border-radius:1px;position:relative}.RangeSlider_rangeSliderRailHorizontal__rLPtT{height:2px}.RangeSlider_rangeSliderRailVertical__4zKzk{height:100%;width:2px}.RangeSlider_rangeSliderBar__Kj3LC{cursor:grab;position:absolute;z-index:1}.RangeSlider_rangeSliderBarHorizontal__is0F7{height:12px;margin:1px 0 0;transform:translateY(-50%)}.RangeSlider_rangeSliderBarVertical__2DexQ{height:100%;margin:1px 0 0;width:12px}.RangeSlider_rangeSliderBarView__6dNQB{background:#03bcd4;border-radius:1px}.RangeSlider_rangeSliderBarViewHorizontal__6pRPw{height:2px;margin:5px 0 0}.RangeSlider_rangeSliderBarViewVertical__W2QnY{height:100%;margin:5px 0 0;width:2px}.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarView__6dNQB{box-shadow:0 0 0 4px rgba(3,188,212,.2)}.RangeSlider_rangeSliderThumb__KMaq0{align-items:center;cursor:grab;display:flex;height:24px;justify-content:center;position:absolute;transform:translate(-50%,-50%);width:24px;z-index:1}.RangeSlider_rangeSliderLabel__3-qO8{background:#03bcd4;border-radius:12px;height:12px;position:relative;transition:box-shadow .3s;width:12px}.RangeSlider_rangeSliderThumb__KMaq0:hover>.RangeSlider_rangeSliderLabel__3-qO8{box-shadow:0 0 0 6px rgba(3,188,212,.2)}.RangeSlider_rangeSliderInputDivider__PcwIK{background:#414141;color:#fff;font-size:10px;font-weight:500}.RangeSlider_rangeSliderCompactInputs__ukFLL{align-items:center;background:#414141;border-radius:4px;display:flex;justify-content:center;position:absolute;transform:translate(-50%,-50%)}");export{r as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var r={rangeSliderHorizontal:"RangeSlider_rangeSliderHorizontal__SAdDE",rangeSliderVertical:"RangeSlider_rangeSliderVertical__k8ac-",rangeSliderRail:"RangeSlider_rangeSliderRail__ufDMI",rangeSliderRailHorizontal:"RangeSlider_rangeSliderRailHorizontal__rLPtT",rotatedVerticalRange:"RangeSlider_rotatedVerticalRange__-oEIw",rangeSliderRailVertical:"RangeSlider_rangeSliderRailVertical__4zKzk",rangeSliderBar:"RangeSlider_rangeSliderBar__Kj3LC",rangeSliderBarHorizontal:"RangeSlider_rangeSliderBarHorizontal__is0F7",rangeSliderBarVertical:"RangeSlider_rangeSliderBarVertical__2DexQ",rangeSliderBarView:"RangeSlider_rangeSliderBarView__6dNQB",rangeSliderBarViewHorizontal:"RangeSlider_rangeSliderBarViewHorizontal__6pRPw",rangeSliderBarViewVertical:"RangeSlider_rangeSliderBarViewVertical__W2QnY",rangeSliderThumb:"RangeSlider_rangeSliderThumb__KMaq0",rangeSliderLabel:"RangeSlider_rangeSliderLabel__3-qO8",rangeSliderInputDivider:"RangeSlider_rangeSliderInputDivider__PcwIK",rangeSliderCompactInputs:"RangeSlider_rangeSliderCompactInputs__ukFLL"};e(".RangeSlider_rangeSliderHorizontal__SAdDE{align-items:center;display:flex;padding:30px 0 12px}.RangeSlider_rangeSliderVertical__k8ac-{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;padding:0 30px}.RangeSlider_rangeSliderRail__ufDMI{background-color:hsla(0,0%,100%,.3);border-radius:1px;position:relative}.RangeSlider_rangeSliderRailHorizontal__rLPtT{height:2px;margin:0 6px;width:100%}.RangeSlider_rotatedVerticalRange__-oEIw{transform:rotate(180deg)}.RangeSlider_rangeSliderRailVertical__4zKzk{height:100%;margin:6px 0;width:2px}.RangeSlider_rangeSliderBar__Kj3LC{cursor:grab;position:absolute;z-index:1}.RangeSlider_rangeSliderBarHorizontal__is0F7{height:12px;margin:1px 0 0;transform:translateY(-50%)}.RangeSlider_rangeSliderBarVertical__2DexQ{height:100%;margin:1px 0 0;width:12px}.RangeSlider_rangeSliderBarView__6dNQB{background:var(--palette-primary-main);border-radius:1px}.RangeSlider_rangeSliderBarViewHorizontal__6pRPw{height:2px;margin:5px 0 0}.RangeSlider_rangeSliderBarViewVertical__W2QnY{height:100%;width:2px}.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarView__6dNQB{box-shadow:0 0 0 4px rgba(3,188,212,.2)}.RangeSlider_rangeSliderThumb__KMaq0{align-items:center;cursor:grab;display:flex;height:24px;justify-content:center;position:absolute;transform:translate(-50%,-50%);width:24px;z-index:1}.RangeSlider_rangeSliderLabel__3-qO8{background:var(--palette-primary-main);border-radius:9px;height:9px;position:relative;transition:box-shadow .3s;width:9px}.RangeSlider_rangeSliderThumb__KMaq0:hover>.RangeSlider_rangeSliderLabel__3-qO8{box-shadow:0 0 0 6px rgba(3,188,212,.2)}.RangeSlider_rangeSliderInputDivider__PcwIK{background:var(--palette-background-b-9);color:#fff;font-size:10px;font-weight:500}.RangeSlider_rangeSliderCompactInputs__ukFLL{align-items:center;background:var(--palette-background-b-9);border-radius:4px;display:flex;justify-content:center;position:absolute;transform:translate(-50%,-50%)}");export{r as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as t,useEffect as i}from"react";import a from"classnames";import{round as o,throttle as l}from"lodash";import u from"prop-types";import m from"./RangeSlider.css.js";import{horizontalStrategy as s}from"./strategies/horizontal.js";import{verticalStrategy as c}from"./strategies/vertical.js";import{calculatePercentForValue as p,updateFromValue as d,updateToValue as f,calculateValueFromPercent as g}from"./utils.js";import I from"./inputs/FromInput.js";import R from"./inputs/ToInput.js";import{RangeSliderControl as v,RangeSliderOrientation as T}from"./constants.js";import{jsx as O,jsxs as C}from"react/jsx-runtime";var S=function(u){var S=u.min,h=u.max,N=u.from,V=u.to,A=u.minRange,L=u.onChange,y=u.orientation,b=u.precision,B=r(null),M=n(B,2),x=M[0],E=M[1],F=r(null),P=n(F,2),H=P[0],w=P[1],j=r(null),z=n(j,2),U=z[0],Z=z[1],_=r(null),D=n(_,2),q=D[0],X=D[1],Y=r(v.FROM),k=n(Y,2),G=k[0],J=k[1],K=r({}),Q=n(K,2),W=Q[0],$=Q[1],ee=t(null),ne=t(null),re=t(null),te=t(null),ie=t(null);i((function(){y===T.HORIZONTAL&&Z(s),y===T.VERTICAL&&Z(c)}),[y]),i((function(){if(U){var n,r=o(N,b),t=o(V,b),i=o(S,b),a=o(h,b),l=p(r,i,a),u=p(t,i,a),m={};te.current&&ie.current&&(m=U.calculateInputSpacing(l,u,ee,te,ie)),y===T.HORIZONTAL&&X(m.isNotEnoughInputSpace),$((e(n={},v.FROM,U.getThumbStyles(l,G===v.FROM)),e(n,v.TO,U.getThumbStyles(u,G===v.TO)),e(n,v.BAR,U.getBarStyles(l,u)),e(n,v.FROM_INPUT,U.getInputStyles(l)),e(n,v.TO_INPUT,U.getInputStyles(u)),e(n,v.COMPACT_INPUTS,U.getInputStyles((l+u)/2)),n)),E(r.toString()),w(t.toString())}}),[U,S,h,N,V]);var ae=function(e){var n=U.getCoordinates(e,ee.current.getBoundingClientRect()),r=p(n.new,n.min,n.max),t=o(g(r,S,h),b);if(t!==N){var i=d(t,N,V,S,A);L(i)}},oe=function(e){var n=U.getCoordinates(e,ee.current.getBoundingClientRect()),r=p(n.new,n.min,n.max),t=o(g(r,S,h),b);if(t!==V){var i=f(t,N,V,h,A);L(i)}},le=function(e,n){var r=U.getBarCoordinates(e,n,ee.current.getBoundingClientRect()),t=p(r.new,r.min,r.max),i=o(g(t,S,h),b),a=o(V+(i-N),b);if(i<S){var l=S-i;i=S,a=o(a+l,b)}if(a>h){var u=a-h;a=h,i=o(i-u,b)}i!==N&&a!==V&&i>=S&&a<=h&&L({from:i,to:a})},ue=function(e,n){n.stopPropagation(),J(e);var r=n.clientX,t=n.clientY,i=n.target.getBoundingClientRect(),a=i.x,o=i.y;var u=l((function(n){!function(e){return e===v.FROM?ae:e===v.TO?oe:le}(e)(n,{clientX:r,clientY:t,x:a,y:o})}),4);document.addEventListener("mousemove",u),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e)}))},me=function(e,n){var r=n.target.value;Number.isNaN(r)||function(e){return e===v.FROM?E:w}(e)(r)},se=function(e,n){var r=n.target.value,t=o(r,b);if(e===v.FROM){var i=d(t,N,V,S,A);L(i)}if(e===v.TO){var a=f(t,N,V,h,A);L(a)}};return O("div",{className:a(y===T.HORIZONTAL&&m.rangeSliderHorizontal,y===T.VERTICAL&&m.rangeSliderVertical),children:C("div",{className:a(m.rangeSliderRail,y===T.HORIZONTAL&&m.rangeSliderRailHorizontal,y===T.VERTICAL&&m.rangeSliderRailVertical),ref:ee,children:[O("div",{ref:ne,className:m.rangeSliderThumb,style:W[v.FROM],onMouseDown:function(e){return ue(v.FROM,e)},children:O("div",{className:m.rangeSliderLabel})}),O("div",{className:a(m.rangeSliderBar,y===T.HORIZONTAL&&m.rangeSliderBarHorizontal,y===T.VERTICAL&&m.rangeSliderBarVertical),style:W[v.BAR],onMouseDown:function(e){return ue(v.BAR,e)},children:O("div",{className:a(m.rangeSliderBarView,y===T.HORIZONTAL&&m.rangeSliderBarViewHorizontal,y===T.VERTICAL&&m.rangeSliderBarViewVertical)})}),O("div",{ref:re,className:m.rangeSliderThumb,style:W[v.TO],onMouseDown:function(e){return ue(v.TO,e)},children:O("div",{className:m.rangeSliderLabel})}),!q&&O(I,{compStyles:W[v.FROM_INPUT],isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,fromInputRef:te,from:N,fromInputValue:x,onInputChange:me,validateInputChange:se}),!q&&O(R,{compStyles:W[v.TO_INPUT],isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,toInputRef:ie,to:V,toInputValue:H,onInputChange:me,validateInputChange:se}),q&&C("div",{className:m.rangeSliderCompactInputs,style:W[v.COMPACT_INPUTS],children:[O(I,{isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,fromInputRef:te,from:N,fromInputValue:x,onInputChange:me,validateInputChange:se}),O("span",{className:m.rangeSliderInputDivider,children:"-"}),O(R,{isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,toInputRef:ie,to:V,toInputValue:H,onInputChange:me,validateInputChange:se})]})]})})};S.propTypes={min:u.number,max:u.number,from:u.number.isRequired,to:u.number.isRequired,orientation:u.oneOf(["horizontal","vertical"]),precision:u.number,minRange:u.number,onChange:u.func},S.defaultProps={min:0,max:100,orientation:"horizontal",precision:0,minRange:0,onChange:function(){}};export{S as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as t,useEffect as i}from"react";import o from"classnames";import{round as a,throttle as l}from"lodash";import u from"prop-types";import m from"./RangeSlider.css.js";import{horizontalStrategy as s}from"./strategies/horizontal.js";import{verticalStrategy as c}from"./strategies/vertical.js";import{calculatePercentForValue as d,updateFromValue as g,updateToValue as f,calculateValueFromPercent as p}from"./utils.js";import v from"./inputs/FromInput.js";import R from"./inputs/ToInput.js";import{RangeSliderControl as h,RangeSliderOrientation as S}from"./constants.js";import{jsxs as O,jsx as b}from"react/jsx-runtime";var C=function(u){var C,B,I,T,V=u.min,N=u.max,x=u.from,y=u.to,M=u.minRange,L=u.onChange,w=u.orientation,A=u.precision,F=u.isSingleRange,j=u.isWithoutInput,z=r(null),E=n(z,2),H=E[0],D=E[1],P=r(null),W=n(P,2),q=W[0],X=W[1],Y=r(null),Z=n(Y,2),k=Z[0],G=Z[1],J=r(h.FROM),K=n(J,2),Q=K[0],U=K[1],$=r({}),_=n($,2),ee=_[0],ne=_[1],re=t(null),te=t(null),ie=t(null),oe=t(null),ae=t(null),le=w===S.HORIZONTAL,ue=w===S.VERTICAL,me=F&&j;i((function(){w===S.HORIZONTAL&&G(s),w===S.VERTICAL&&G(c)}),[w]),i((function(){F&&L({from:0,to:y})}),[F]),i((function(){if(k){var n,r=a(x,A),t=a(y,A),i=a(V,A),o=a(N,A),l=d(r,i,o),u=d(t,i,o);ne((e(n={},h.FROM,k.getThumbStyles(l,Q===h.FROM)),e(n,h.TO,k.getThumbStyles(u,Q===h.TO)),e(n,h.BAR,k.getBarStyles(l,u)),n)),D(r.toString()),X(t.toString())}}),[k,V,N,x,y]);var se=function(e){var n=k.getCoordinates(e,re.current.getBoundingClientRect()),r=d(n.new,n.min,n.max),t=a(p(r,V,N),A);if(t!==x){var i=g(t,x,y,V,M);L(i)}},ce=function(e){var n=ue&&F?k.getRotatedCoordinates(e,re.current.getBoundingClientRect()):k.getCoordinates(e,re.current.getBoundingClientRect()),r=d(n.new,n.min,n.max),t=a(p(r,V,N),A);if(t!==y){var i=f(t,x,y,N,M);L(i)}},de=function(e,n){var r=k.getBarCoordinates(e,n,re.current.getBoundingClientRect()),t=d(r.new,r.min,r.max),i=a(p(t,V,N),A),o=a(y+(i-x),A);if(i<V){var l=V-i;i=V,o=a(o+l,A)}if(o>N){var u=o-N;o=N,i=a(i-u,A)}i!==x&&o!==y&&i>=V&&o<=N&&L({from:i,to:o})},ge=function(e,n){if(!F||e!==h.BAR){n.stopPropagation(),U(e);var r=n.clientX,t=n.clientY,i=n.target.getBoundingClientRect(),o=i.x,a=i.y,u=l((function(n){!function(e){return e===h.FROM?se:e===h.TO?ce:de}(e)(n,{clientX:r,clientY:t,x:o,y:a})}),4);document.addEventListener("mousemove",u),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e)}))}},fe=function(e,n){var r=n.target.value;Number.isNaN(r)||function(e){return e===h.FROM?D:X}(e)(r)},pe=function(e,n){var r=n.target.value,t=a(r,A);if(e===h.FROM){var i=g(t,x,y,V,M);L(i)}if(e===h.TO){var o=f(t,x,y,N,M);L(o)}};return O("div",{className:o((C={},e(C,m.rangeSliderHorizontal,le),e(C,m.rangeSliderVertical,ue),e(C,m.rotatedVerticalRange,ue&&F),C)),children:[!F&&b(v,{isVerticalOrientation:ue,max:N,precision:A,fromInputRef:oe,from:x,fromInputValue:H,onInputChange:fe,validateInputChange:pe}),O("div",{className:o(m.rangeSliderRail,(B={},e(B,m.rangeSliderRailHorizontal,le),e(B,m.rangeSliderRailVertical,ue),B)),ref:re,children:[!F&&b("div",{ref:te,className:m.rangeSliderThumb,style:ee[h.FROM],onMouseDown:function(e){return ge(h.FROM,e)},children:b("div",{className:m.rangeSliderLabel})}),b("div",{className:o(m.rangeSliderBar,(I={},e(I,m.rangeSliderBarHorizontal,le),e(I,m.rangeSliderBarVertical,ue),I)),style:ee[h.BAR],onMouseDown:function(e){return ge(h.BAR,e)},children:b("div",{className:o(m.rangeSliderBarView,(T={},e(T,m.rangeSliderBarViewHorizontal,le),e(T,m.rangeSliderBarViewVertical,ue),T))})}),b("div",{ref:ie,className:m.rangeSliderThumb,style:ee[h.TO],onMouseDown:function(e){return ge(h.TO,e)},children:b("div",{className:m.rangeSliderLabel})})]}),!me&&b(R,{isVerticalOrientation:ue,rotated:ue&&F,max:N,precision:A,toInputRef:ae,to:y,toInputValue:q,onInputChange:fe,validateInputChange:pe})]})};C.propTypes={min:u.number,max:u.number,from:u.number.isRequired,to:u.number.isRequired,orientation:u.oneOf(["horizontal","vertical"]),precision:u.number,minRange:u.number,onChange:u.func,isSingleRange:u.bool,isWithoutInput:u.bool},C.defaultProps={min:0,max:100,orientation:"horizontal",precision:0,minRange:0,onChange:function(){},isSingleRange:!1,isWithoutInput:!1};export{C as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"prop-types";import{round as t}from"lodash";import{RangeSliderControl as n}from"../constants.js";import o from"../Input.css.js";import{jsx as i}from"react/jsx-runtime";function u(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function p(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var c=function(e){var r=e.compStyles,u=e.isVerticalOrientation,c=e.max,a=e.precision,s=e.fromInputRef,f=e.from,m=e.fromInputValue,l=e.onInputChange,O=e.validateInputChange,b=t(f,a);return i("div",{style:p(p({},r),{},{width:u?8*("".concat(c).length+a):"auto",marginLeft:u?8*-("".concat(c).length+a)/2-8:"auto"}),children:i("input",{ref:s,className:o.rangeSliderInput,type:"text",size:"".concat(b).length||1,value:m,onChange:function(e){l(n.FROM,e)},onBlur:function(e){return O(n.FROM,e)},onKeyDown:function(e){"Enter"===e.key&&O(n.FROM,e)}})})};c.propTypes={max:r.number.isRequired,from:r.number.isRequired,isVerticalOrientation:r.bool.isRequired,precision:r.number.isRequired,compStyles:r.shape({}),fromInputRef:r.node.isRequired,fromInputValue:r.number.isRequired,onInputChange:r.func.isRequired,validateInputChange:r.func.isRequired},c.defaultProps={compStyles:{}};export{c as default};
1
+ import{round as n}from"lodash";import{RangeSliderControl as t}from"../constants.js";import r from"../Input.css.js";import{jsx as e}from"react/jsx-runtime";var o=function(o){var a=o.precision,u=o.fromInputRef,i=o.from,f=o.fromInputValue,p=o.onInputChange,m=o.validateInputChange,s=n(i,a);return e("div",{children:e("input",{ref:u,className:r.rangeSliderInput,type:"text",size:"".concat(s).length||1,value:f,onChange:function(n){p(t.FROM,n)},onBlur:function(n){return m(t.FROM,n)},onKeyDown:function(n){"Enter"===n.key&&m(t.FROM,n)}})})};export{o as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import{round as r}from"lodash";import{RangeSliderControl as n}from"../constants.js";import o from"../Input.css.js";import{jsx as i}from"react/jsx-runtime";function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var c=function(e){var t=e.compStyles,u=e.isVerticalOrientation,c=e.max,a=e.precision,s=e.toInputRef,l=e.to,f=e.toInputValue,m=e.onInputChange,O=e.validateInputChange,b=r(l,a);return i("div",{style:p(p({},t),{},{width:u?8*("".concat(c).length+a):"auto",marginLeft:u?8*-("".concat(c).length+a)/2-8:"auto"}),children:i("input",{ref:s,className:o.rangeSliderInput,type:"text",size:"".concat(b).length||1,value:f,onChange:function(e){return m(n.TO,e)},onBlur:function(e){return O(n.TO,e)},onKeyDown:function(e){"Enter"===e.key&&O(n.TO,e)}})})};c.propTypes={max:t.number.isRequired,to:t.number.isRequired,isVerticalOrientation:t.bool.isRequired,precision:t.number.isRequired,compStyles:t.shape({}),toInputRef:t.node.isRequired,toInputValue:t.number.isRequired,onInputChange:t.func.isRequired,validateInputChange:t.func.isRequired},c.defaultProps={compStyles:{}};export{c as default};
1
+ import t from"@babel/runtime/helpers/defineProperty";import{round as n}from"lodash";import e from"classnames";import{RangeSliderControl as r}from"../constants.js";import o from"../Input.css.js";import{jsx as a}from"react/jsx-runtime";var i=function(i){var u=i.rotated,p=i.precision,s=i.toInputRef,m=i.to,f=i.toInputValue,c=i.onInputChange,l=i.validateInputChange,d=n(m,p);return a("div",{children:a("input",{ref:s,className:e(o.rangeSliderInput,t({},o.rotated,u)),type:"text",size:"".concat(d).length||1,value:f,onChange:function(t){return c(r.TO,t)},onBlur:function(t){return l(r.TO,t)},onKeyDown:function(t){"Enter"===t.key&&l(r.TO,t)}})})};export{i as default};
@@ -1 +1 @@
1
- import{calculateValueFromPercent as t}from"../utils.js";var n={getCoordinates:function(t,n){return{new:t.clientX,min:n.x,max:n.x+n.width}},getBarCoordinates:function(t,n,e){var i=n.clientX-n.x;return{new:t.clientX-i,min:e.x,max:e.x+e.width}},getThumbStyles:function(t,n){return{top:"1px",left:"".concat(t,"%"),zIndex:n?10:2}},getBarStyles:function(t,n){return{left:"".concat(t,"%"),width:"".concat(n-t,"%")}},getInputStyles:function(t){return{position:"absolute",top:"-15px",left:"".concat(t,"%"),transform:"translate(-50%, -50%)"}},calculateInputSpacing:function(n,e,i,r,o){var c=r.current.getBoundingClientRect().width,u=o.current.getBoundingClientRect().width,a=i.current.getBoundingClientRect(),l=a.x,g=a.width,d=t(n,l,l+g);return{isNotEnoughInputSpace:t(e,l,l+g)-d<(c+u)/2}}};export{n as horizontalStrategy};
1
+ var t={getCoordinates:function(t,n){return{new:t.clientX,min:n.x,max:n.x+n.width}},getBarCoordinates:function(t,n,e){var r=n.clientX-n.x;return{new:t.clientX-r,min:e.x,max:e.x+e.width}},getThumbStyles:function(t,n){return{top:"1px",left:"".concat(t,"%"),zIndex:n?10:2}},getBarStyles:function(t,n){return{left:"".concat(t,"%"),width:"".concat(n-t,"%")}}};export{t as horizontalStrategy};
@@ -1 +1 @@
1
- import{calculateValueFromPercent as t}from"../utils.js";var n={getCoordinates:function(t,n){return{new:t.clientY,min:n.y,max:n.y+n.height}},getBarCoordinates:function(t,n,e){var i=n.clientY-n.y;return{new:t.clientY-i,min:e.y,max:e.y+e.height}},getThumbStyles:function(t,n){return{left:"1px",top:"".concat(t,"%"),zIndex:n?10:2}},getBarStyles:function(t,n){return{top:"".concat(t,"%"),height:"".concat(n-t,"%")}},getInputStyles:function(t){return{position:"absolute",top:"".concat(t,"%"),transform:"translate(-50%, -50%)"}},calculateInputSpacing:function(n,e,i,r,o){var c=r.current.getBoundingClientRect().height,u=o.current.getBoundingClientRect().height,a=i.current.getBoundingClientRect(),g=a.y,l=a.height,h=t(n,g,g+l);return{isNotEnoughInputSpace:t(e,g,g+l)-h<(c+u)/2}}};export{n as verticalStrategy};
1
+ var t={getCoordinates:function(t,n){return{new:t.clientY,min:n.y,max:n.y+n.height}},getRotatedCoordinates:function(t,n){return{new:n.y+n.height-t.clientY+n.y,min:n.y,max:n.y+n.height}},getBarCoordinates:function(t,n,e){var i=n.clientY-n.y;return{new:t.clientY-i,min:e.y,max:e.y+e.height}},getThumbStyles:function(t,n){return{left:"1px",top:"".concat(t,"%"),zIndex:n?10:2}},getBarStyles:function(t,n){return{top:"".concat(t,"%"),height:"".concat(n-t,"%")}}};export{t as verticalStrategy};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.39.0-2",
3
+ "version": "0.39.0-3",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M18 8H17V6C17 3.24 14.76 1 12 1C9.24 1 7 3.24 7 6H9C9 4.34 10.34 3 12 3C13.66 3 15 4.34 15 6V8H6C4.9 8 4 8.9 4 10V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V10C20 8.9 19.1 8 18 8ZM6 20V10H18V20H6ZM14 15C14 16.1 13.1 17 12 17C10.9 17 10 16.1 10 15C10 13.9 10.9 13 12 13C13.1 13 14 13.9 14 15Z" fill="#03BCD4"/>
3
- </svg>