@corva/ui 0.84.0-13 → 0.84.0-15

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.
Files changed (27) hide show
  1. package/cjs-bundle/components/AdvancedSlider/AdvancedSlider.js +1 -1
  2. package/cjs-bundle/components/AdvancedSlider/Handle.js +1 -1
  3. package/cjs-bundle/components/AdvancedSlider/constants.js +1 -0
  4. package/cjs-bundle/components/AdvancedSlider/styles/handleStyles.js +1 -1
  5. package/cjs-bundle/components/AdvancedSlider/styles/sliderStyles.js +1 -1
  6. package/cjs-bundle/components/AdvancedSlider/utils.js +1 -0
  7. package/cjs-bundle/components/Button/components/LiveButton/index.js +1 -1
  8. package/components/AdvancedSlider/AdvancedSlider.d.ts +1 -1
  9. package/components/AdvancedSlider/AdvancedSlider.d.ts.map +1 -1
  10. package/components/AdvancedSlider/AdvancedSlider.js +1 -1
  11. package/components/AdvancedSlider/Handle.d.ts +3 -1
  12. package/components/AdvancedSlider/Handle.d.ts.map +1 -1
  13. package/components/AdvancedSlider/Handle.js +1 -1
  14. package/components/AdvancedSlider/constants.d.ts +13 -0
  15. package/components/AdvancedSlider/constants.d.ts.map +1 -0
  16. package/components/AdvancedSlider/constants.js +1 -0
  17. package/components/AdvancedSlider/styles/handleStyles.d.ts +1 -1
  18. package/components/AdvancedSlider/styles/handleStyles.d.ts.map +1 -1
  19. package/components/AdvancedSlider/styles/handleStyles.js +1 -1
  20. package/components/AdvancedSlider/styles/sliderStyles.d.ts.map +1 -1
  21. package/components/AdvancedSlider/styles/sliderStyles.js +1 -1
  22. package/components/AdvancedSlider/utils.d.ts +7 -0
  23. package/components/AdvancedSlider/utils.d.ts.map +1 -0
  24. package/components/AdvancedSlider/utils.js +1 -0
  25. package/components/Button/components/LiveButton/index.d.ts.map +1 -1
  26. package/components/Button/components/LiveButton/index.js +1 -1
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),n=require("react"),i=require("re-resizable"),a=require("react-sizeme"),r=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 h=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(e),f=c(t),v=c(r);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}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){f.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 g="twoValuesSliderDefault",y=function(e){var t,a,r=e.min,o=e.max,c=e.value,p=e.size,y=e.orientation,j=e.valueFormatter,w=e.displayFormatter,x=e.editableHandles,H=e.onChange,O=e.onStop,S=e.reversed,z=e.handlePosition,C=e.handleClasses,P=e.minimal,E=s.useSliderStyles(),q=n.useRef(null),R=n.useRef(null),T="horizontal"===y,k="vertical"===y,M=b(b({},p),{},{width:T?p.width-94:p.width,height:k?p.height-40:p.height}),L=n.useState([j(null==c?void 0:c.at(0)),j(null==c?void 0:c.at(1))]),_=m.default(L,2),B=_[0],D=_[1],F=n.useRef(null),N=n.useState(!1),W=m.default(N,2),I=W[0],X=W[1],Y=m.default(B,2),A=Y[0],V=Y[1],G=M.width/(o-r)*(V-r),J=M.width/(o-r)*(o-A),K=M.height/(o-r)*(V-r),Q=M.height/(o-r)*(o-A);n.useEffect((function(){if(!F.current){var e=[j(null==c?void 0:c.at(0)),j(null==c?void 0:c.at(1))],t=Math.min.apply(Math,e),n=Math.max.apply(Math,e);D([t,n])}}),[null==c?void 0:c.at(0),null==c?void 0:c.at(1)]),n.useEffect((function(){if(T){var e=M.width/(o-r)*(A-r),t=M.width/(o-r)*(o-V);q.current.updateSize({width:S?t:e,height:M.height}),R.current.updateSize({width:S?e:t,height:M.height})}else if(k){var n=M.height/(o-r)*(A-r),i=M.height/(o-r)*(o-V);q.current.updateSize({width:M.width,height:S?i:n}),R.current.updateSize({width:M.width,height:S?n:i})}}),[r,o,A,V,M.width,M.height,y]),n.useEffect((function(){var e=function(){document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",ne),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",ae)};return I?(document.addEventListener("mousemove",te),document.addEventListener("mouseup",ne),document.addEventListener("touchmove",ie),document.addEventListener("touchend",ae)):(e(),O()),function(){e()}}),[I]);var U=l.useThrottledCallback((function(e,t,n){F.current="onResize Event";var i=n.clientWidth,a=n.clientHeight,l=A,d=V;"right"===t?S?d=j(o-i/M.width*(o-r)):l=j(r+i/M.width*(o-r)):"left"===t?S?l=j(r+i/M.width*(o-r)):d=j(o-i/M.width*(o-r)):"bottom"===t?S?d=j(o-a/M.height*(o-r)):l=j(r+a/M.height*(o-r)):"top"===t&&(S?l=j(r+a/M.height*(o-r)):d=j(o-a/M.height*(o-r))),l=Math.min(l,V),d=Math.max(d,A),D([l,d]),H([l,d])})),Z=l.useThrottledCallback((function(){F.current=null,O()})),$=function(e,t){F.current={xPos:e,yPos:t,head:A,tail:V}},ee=function(e,t){if(F.current){var n;T?n=(F.current.xPos-e)/M.width*(o-r):k&&(n=(F.current.yPos-t)/M.height*(o-r));var i,a,l=F.current.head-n*(S?-1:1),d=F.current.tail-n*(S?-1:1),u=F.current.tail-F.current.head;l<=r?(i=r,a=r+u):d>=o?(i=o-u,a=o):(i=l,a=d),i=j(i),a=j(a),D([i,a]),H([i,a])}},te=l.useThrottledCallback((function(e){ee(e.clientX,e.clientY)})),ne=l.useThrottledCallback((function(){F.current=null,X(!1)})),ie=l.useThrottledCallback((function(e){ee(e.touches[0].pageX,e.touches[0].pageY)})),ae=l.useThrottledCallback((function(){F.current=null,X(!1)})),re=l.useThrottledCallback((function(e){D([e,V]),H([e,V])})),oe=l.useThrottledCallback((function(e){D([A,e]),H([A,e])})),le=n.useMemo((function(){return(V-A)/(o-r)*(k?M.height:M.width)<30}),[r,o,A,V]),de=function(e){var t={min:r,max:V,value:A,onChange:re},n={min:A,max:o,value:V,onChange:oe};return"head"===e?h.jsx(d.Handle,b({"data-testid":"".concat(g,"_handle_top"),placement:"head",readOnly:!x,displayFormatter:w,orientation:y,classes:C,minimal:P},S?n:t)):"tail"===e?h.jsx(d.Handle,b({"data-testid":"".concat(g,"_handle_bottom"),placement:"tail",readOnly:!x,displayFormatter:w,orientation:y,classes:C,minimal:P},S?t:n)):null};return h.jsx("div",{className:E.rootWrapper,children:h.jsxs("div",{className:v.default(E.root,(t={},f.default(t,E.horizontalRoot,T),f.default(t,E.verticalRoot,k),f.default(t,E.minimal,P),t)),children:[h.jsx(i.Resizable,{ref:q,minHeight:0,minWidth:0,maxWidth:S?J:G,maxHeight:S?Q:K,enable:{right:T,bottom:k},handleComponent:{right:de("head"),bottom:de("head")},onResize:U,onResizeStop:Z}),h.jsx("div",{className:E.body,"data-testid":"slider-body",onMouseDown:function(e){$(e.clientX,e.clientY),X(!0)},onTouchStart:function(e){$(e.touches[0].pageX,e.touches[0].pageY),X(!0)},children:le?h.jsx("div",{className:v.default((a={},f.default(a,E.horizontalBodyHandle,T),f.default(a,E.verticalBodyHandle,k),f.default(a,E.leftBodyHandle,"left"===z),f.default(a,E.rightBodyHandle,"right"===z),f.default(a,E.topBodyHandle,"top"===z),f.default(a,E.bottomBodyHandle,"bottom"===z),a)),children:h.jsx("div",{className:E.bodyHandle,"data-testid":"".concat(g,"_handle"),children:h.jsx(u.HandleIcon,{orientation:"vertical",minimal:P})})}):h.jsx("div",{className:E.bodyHandleIcon,"data-testid":"".concat(g,"_handle"),children:h.jsx(u.HandleIcon,{orientation:y,minimal:P})})}),h.jsx(i.Resizable,{ref:R,minHeight:0,minWidth:0,enable:{left:T,top:k},handleComponent:{left:de("tail"),top:de("tail")},onResize:U,onResizeStop:Z})]})})};y.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=a.withSize({monitorWidth:!0,monitorHeight:!0})(y);exports.AdvancedSlider=y,exports.default=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),i=require("react"),n=require("re-resizable"),r=require("react-sizeme"),a=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 h=require("./constants.js"),c=require("react/jsx-runtime");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=f(e),v=f(t),p=f(a);function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function b(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){v.default(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var w="twoValuesSliderDefault",y=function(e){var t,r,a=e.min,o=e.max,f=e.value,g=e.size,y=e.orientation,O=e.valueFormatter,j=e.displayFormatter,I=e.editableHandles,R=e.onChange,A=e.onStop,H=e.reversed,T=e.handlePosition,_=e.handleClasses,x=e.minimal,N=s.useSliderStyles(),P=i.useRef(null),C=i.useRef(null),E=y===h.HORIZONTAL_ORIENTATION,S=y===h.VERTICAL_ORIENTATION,M=x?g:b(b({},g),{},{width:E?g.width-2*h.INPUT_WIDTH:g.width,height:S?g.height-2*h.INPUT_HEIGHT:g.height}),z=i.useState([O(null==f?void 0:f.at(0)),O(null==f?void 0:f.at(1))]),L=m.default(z,2),q=L[0],W=L[1],k=i.useRef(null),G=i.useState(!1),D=m.default(G,2),B=D[0],F=D[1],V=m.default(q,2),X=V[0],Y=V[1],Z=M.width/(o-a)*(Y-a),U=M.width/(o-a)*(o-X),J=M.height/(o-a)*(Y-a),K=M.height/(o-a)*(o-X);i.useEffect((function(){if(!k.current){var e=[O(null==f?void 0:f.at(0)),O(null==f?void 0:f.at(1))],t=Math.min.apply(Math,e),i=Math.max.apply(Math,e);W([t,i])}}),[null==f?void 0:f.at(0),null==f?void 0:f.at(1)]),i.useEffect((function(){if(E){var e=M.width/(o-a)*(X-a),t=M.width/(o-a)*(o-Y);P.current.updateSize({width:H?t:e,height:M.height}),C.current.updateSize({width:H?e:t,height:M.height})}else if(S){var i=M.height/(o-a)*(X-a),n=M.height/(o-a)*(o-Y);P.current.updateSize({width:M.width,height:H?n:i}),C.current.updateSize({width:M.width,height:H?i:n})}}),[a,o,X,Y,M.width,M.height,y]),i.useEffect((function(){var e=function(){document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",ne),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",ae)};return B?(document.addEventListener("mousemove",ie),document.addEventListener("mouseup",ne),document.addEventListener("touchmove",re),document.addEventListener("touchend",ae)):(e(),A()),function(){e()}}),[B]);var Q=l.useThrottledCallback((function(e,t,i){k.current="onResize Event";var n=i.clientWidth,r=i.clientHeight,l=X,d=Y;"right"===t?H?d=O(o-n/M.width*(o-a)):l=O(a+n/M.width*(o-a)):"left"===t?H?l=O(a+n/M.width*(o-a)):d=O(o-n/M.width*(o-a)):"bottom"===t?H?d=O(o-r/M.height*(o-a)):l=O(a+r/M.height*(o-a)):"top"===t&&(H?l=O(a+r/M.height*(o-a)):d=O(o-r/M.height*(o-a))),l=Math.min(l,Y),d=Math.max(d,X),W([l,d]),R([l,d])})),$=l.useThrottledCallback((function(){k.current=null,A()})),ee=function(e,t){k.current={xPos:e,yPos:t,head:X,tail:Y}},te=function(e,t){if(k.current){var i;E?i=(k.current.xPos-e)/M.width*(o-a):S&&(i=(k.current.yPos-t)/M.height*(o-a));var n,r,l=k.current.head-i*(H?-1:1),d=k.current.tail-i*(H?-1:1),u=k.current.tail-k.current.head;l<=a?(n=a,r=a+u):d>=o?(n=o-u,r=o):(n=l,r=d),n=O(n),r=O(r),W([n,r]),R([n,r])}},ie=l.useThrottledCallback((function(e){te(e.clientX,e.clientY)})),ne=l.useThrottledCallback((function(){k.current=null,F(!1)})),re=l.useThrottledCallback((function(e){te(e.touches[0].pageX,e.touches[0].pageY)})),ae=l.useThrottledCallback((function(){k.current=null,F(!1)})),oe=l.useThrottledCallback((function(e){W([e,Y]),R([e,Y])})),le=l.useThrottledCallback((function(e){W([X,e]),R([X,e])})),de=i.useMemo((function(){return(Y-X)/(o-a)*(S?M.height:M.width)<30}),[a,o,X,Y]),ue=i.useMemo((function(){return(Y-X)/(o-a)*(S?M.height:M.width)<h.INNER_GAP}),[a,o,X,Y]),se=function(e,t){return e/t*(S?M.height:M.width)},he=i.useMemo((function(){if(x)return{};var e=E?h.HORIZONTAL_MIN_GAP:h.VERTICAL_MIN_GAP;return H?{isRightArrowInvisible:se(X,o)<h.MIN_ARROW_GAP,isLeftArrowInvisible:se(o-Y,o)<h.MIN_ARROW_GAP,distance:(Y-X)/(o-a)*(S?M.height:M.width)-e}:{isRightArrowInvisible:se(o-Y,o)<h.MIN_ARROW_GAP,isLeftArrowInvisible:se(X,o)<h.MIN_ARROW_GAP,distance:(Y-X)/(o-a)*(S?M.height:M.width)-e}}),[a,o,X,Y,H]),ce=function(e){var t={min:a,max:Y,value:X,onChange:oe},i={min:X,max:o,value:Y,onChange:le};return"head"===e?c.jsx(d.Handle,b({"data-testid":"".concat(w,"_handle_top"),placement:"head",readOnly:!I,isInsideArrowsVisible:ue,arrowsOutsideConfig:he,displayFormatter:j,orientation:y,classes:_,minimal:x},H?i:t)):"tail"===e?c.jsx(d.Handle,b({"data-testid":"".concat(w,"_handle_bottom"),placement:"tail",readOnly:!I,isInsideArrowsVisible:ue,arrowsOutsideConfig:he,displayFormatter:j,orientation:y,classes:_,minimal:x},H?t:i)):null};return c.jsx("div",{className:N.rootWrapper,children:c.jsxs("div",{className:p.default(N.root,(t={},v.default(t,N.horizontalRoot,E),v.default(t,N.verticalRoot,S),v.default(t,N.minimal,x),t)),children:[c.jsx(n.Resizable,{ref:P,minHeight:0,minWidth:0,maxWidth:H?U:Z,maxHeight:H?K:J,enable:{right:E,bottom:S},handleComponent:{right:ce("head"),bottom:ce("head")},onResize:Q,onResizeStop:$}),c.jsx("div",{className:N.body,"data-testid":"slider-body",onMouseDown:function(e){ee(e.clientX,e.clientY),F(!0)},onTouchStart:function(e){ee(e.touches[0].pageX,e.touches[0].pageY),F(!0)},children:de?c.jsx("div",{className:p.default((r={},v.default(r,N.horizontalBodyHandle,E),v.default(r,N.verticalBodyHandle,S),v.default(r,N.leftBodyHandle,"left"===T),v.default(r,N.rightBodyHandle,"right"===T),v.default(r,N.topBodyHandle,"top"===T),v.default(r,N.bottomBodyHandle,"bottom"===T),r)),children:c.jsx("div",{className:N.bodyHandle,"data-testid":"".concat(w,"_handle"),children:c.jsx(u.HandleIcon,{orientation:"vertical",minimal:x})})}):c.jsx("div",{className:N.bodyHandleIcon,"data-testid":"".concat(w,"_handle"),children:c.jsx(u.HandleIcon,{orientation:y,minimal:x})})}),c.jsx(n.Resizable,{ref:C,minHeight:0,minWidth:0,enable:{left:E,top:S},handleComponent:{left:ce("tail"),top:ce("tail")},onResize:Q,onResizeStop:$})]})})};y.defaultProps={orientation:h.HORIZONTAL_ORIENTATION,valueFormatter:Math.floor,displayFormatter:function(e){return e},onChange:o.noop,onStop:o.noop,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var O=r.withSize({monitorWidth:!0,monitorHeight:!0})(y);exports.AdvancedSlider=y,exports.default=O;
@@ -1 +1 @@
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)})})})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/slicedToArray"),i=require("react"),t=require("@material-ui/core"),r=require("classnames"),a=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("./styles/sliderStyles.js");var n=require("./styles/handleStyles.js"),l=require("./utils.js"),o=require("./constants.js"),u=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e),f=c(s),m=c(r);exports.Handle=function(e){var s,r,c,v,I=e.value,h=e.orientation,j=e.placement,q=e.readOnly,p=e.onChange,R=e.min,A=e.max,b=e.displayFormatter,H=e.isInsideArrowsVisible,y=e.arrowsOutsideConfig,g=e.classes,O=e.minimal,N=e["data-testid"],T=i.useState(!1),w=f.default(T,2),E=w[0],x=w[1],C=i.useState(I),L=f.default(C,2),V=L[0],z=L[1],S=i.useRef(null),P=h===o.HORIZONTAL_ORIENTATION,_=h===o.VERTICAL_ORIENTATION,F=j===o.HEAD_PLACEMENT,M=n.useHandleStyles({distance:null==y?void 0:y.distance}),k=function(e){var s=Number(e);l.getIsInputValueValid(s)?p(l.getValidatedValue(s,R,A)):x(!0)};return i.useEffect((function(){z(I),E&&x(!1)}),[I]),u.jsxs("div",{className:m.default(M.root,g.handleRoot,(s={},d.default(s,M.horizontalHeadRoot,P&&F),d.default(s,M.horizontalTailRoot,P&&!F),d.default(s,M.verticalHeadRoot,_&&F),d.default(s,M.verticalTailRoot,_&&!F),d.default(s,M.minimalHandleRoot,O),s)),children:[!O&&u.jsx(a.LeftIcon,{size:16,className:m.default(M.leftArrow,(r={},d.default(r,M.reversedLeftArrow,_),d.default(r,M.isInvisible,H&&!F||F&&(null==y?void 0:y.isLeftArrowInvisible)),r)),fill:"white"}),u.jsx("div",{className:m.default(M.handle,g.handle,(c={},d.default(c,M.horizontalHeadHandle,P&&F),d.default(c,M.horizontalTailHandle,P&&!F),d.default(c,M.verticalHeadHandle,_&&F),d.default(c,M.verticalTailHandle,_&&!F),d.default(c,M.minimalHandle,O),d.default(c,M.minimalVerticalHandle,O&&_),c)),"data-testid":N,children:!O&&u.jsx(t.Input,{inputProps:{"data-testid":"handle-input"},readOnly:q,inputRef:S,onKeyDown:function(e){var s=e.keyCode,i=e.target;13===s&&k(i.value)},onBlur:function(e){var s=e.target;k(s.value)},classes:{root:m.default(M.inputRoot,E&&M.hasError)},value:q?b(V):V,onChange:function(e){var s=e.target.value;z(s),E&&x(!1)},disableUnderline:!0,error:!(Number.isFinite(+V)&&+V>=R&&+V<=A)})}),!O&&u.jsx(a.RightIcon,{size:16,className:m.default(M.rightArrow,(v={},d.default(v,M.reversedRightArrow,_),d.default(v,M.isInvisible,H&&F||!F&&(null==y?void 0:y.isRightArrowInvisible)),v)),fill:"white"})]})};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.HEAD_PLACEMENT="head",exports.HORIZONTAL_MIN_GAP=48,exports.HORIZONTAL_ORIENTATION="horizontal",exports.HOVER_AREA_HEIGHT=64,exports.HOVER_ARREA_WIDTH=72,exports.INNER_GAP=24,exports.INPUT_HEIGHT=20,exports.INPUT_VALUE_REGEX=/^[0-9.-]*$/,exports.INPUT_WIDTH=47,exports.MIN_ARROW_GAP=12,exports.VERTICAL_MIN_GAP=90,exports.VERTICAL_ORIENTATION="vertical";
@@ -1 +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:20},minimalHandleRoot:{borderColor:o.primary.text9,zIndex:100,"&:not(:hover)":{border:"none"}}}}));exports.useHandleStyles=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@material-ui/core"),t=require("../constants.js"),e=require("../utils.js"),i={minWidth:47,height:20,borderRadius:4},o=r.makeStyles((function(r){var o=r.isLightTheme,a=r.palette;return{root:{fontSize:"12px",position:"absolute","&:hover":{borderColor:a.primary.main},"&:active":{borderColor:a.primary.main},"&:hover $handle":{borderColor:a.primary.main},"&:active $handle":{background:a.primary.dark,borderColor:a.primary.main},"&:hover $inputRoot:not($hasError)":{background:a.primary.dark,border:"1px solid ".concat(a.primary.main)},"&:hover $inputRoot $hasError":{background:"".concat(a.background.b6," !important"),border:"1px solid ".concat(a.primary.main)},"&:active $inputRoot":{background:a.primary.dark,border:"1px solid ".concat(a.primary.main)},display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center","&:hover $leftArrow, &:active $leftArrow":{visibility:"visible"},"&:hover $rightArrow, &:active $rightArrow":{visibility:"visible"}},hasError:{border:"1px solid ".concat(a.error.main," !important"),"&.Mui-focused":{background:"".concat(a.background.b6," !important")},"&:hover":{background:a.background.b6},"&:hover $inputRoot":{background:a.background.b6}},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:o?"#B1B1B1":"#414141","& > p":{fontSize:"12px",textAlign:"center",lineHeight:"20px"},display:"flex",alignItems:"center",justifyContent:"center","&:before":{position:"absolute",left:"50%",top:"50%",height:function(r){var i=r.distance;return e.getHoverAreaSize({inititalSize:t.HOVER_AREA_HEIGHT,distance:i})},width:function(r){var i=r.distance;return e.getHoverAreaSize({distance:i,inititalSize:t.HOVER_ARREA_WIDTH})},content:'""',transform:"translate(-50%, -50%)",zIndex:100}},horizontalHeadHandle:i,horizontalTailHandle:i,verticalHeadHandle:i,verticalTailHandle:i,inputRoot:{borderRadius:4,minWidth:47,zIndex:101,height:"20px",fontSize:"12px",border:"1px solid ".concat(a.primary.text9),"&:hover":{border:"1px solid ".concat(a.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:a.primary.dark,border:"1px solid ".concat(a.primary.main)}},minimalHandle:{background:a.primary.text9,width:"8px !important",minWidth:8,minHeight:20,height:"20px !important","& .MuiInput-underline.Mui-error:after":{border:0},"&:before":{width:"0px !important",height:"0px !important"}},minimalVerticalHandle:{width:20,minWidth:20,minHeight:8,height:"8px !important"},minimalHandleRoot:{borderColor:a.primary.text9,zIndex:100,"&:not(:hover)":{border:"none"}},leftArrow:{visibility:"hidden",zIndex:101,position:"absolute",left:-16},rightArrow:{visibility:"hidden",zIndex:101,position:"absolute",right:-15},reversedLeftArrow:{left:"50%",transform:"translateX(-50%) rotate(90deg)",top:-16},reversedRightArrow:{left:"50%",transform:"translateX(-50%) rotate(90deg)",bottom:-15},isInvisible:{display:"none"}}}));exports.useHandleStyles=o;
@@ -1 +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:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:e.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:e.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},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,zIndex:111},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
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core"),t=e.makeStyles((function(t){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:t.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:t.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},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",background:"#008BA366"},"&:active $bodyHandleIcon":{visibility:"visible"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24,zIndex:111},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:{zIndex:101,width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden","&:before":{position:"absolute",left:"50%",top:"50%",height:32,width:24,content:'""',transform:"translate(-50%, -50%)",zIndex:1e3}},bodyHandleIcon:{visibility:"hidden"},minimal:{borderRadius:4,width:"100%",height:"100%",top:0,left:0,"&::before, &::after":{display:"none"},"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:e.fade(t.palette.background.b7,.1),border:"1px solid ".concat(t.palette.primary.text9),borderRadius:4}}}}));exports.useSliderStyles=t;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./constants.js");exports.getHoverAreaSize=function(e){var t=e.inititalSize,r=e.distance;return r<0?t-Math.abs(r/2):t},exports.getIsInputValueValid=function(t){return e.INPUT_VALUE_REGEX.test(t)&&!Number.isNaN(Number(t))},exports.getValidatedValue=function(e,t,r){return Math.min(Math.max(e,t),r)};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),s=require("moment-timezone"),i=require("@material-ui/core"),o=require("classnames"),n=require("../../../../icons/iconParkIcons.js");require("../../../../icons/customIcons/icons/AddMessage.js"),require("../../../../icons/customIcons/icons/Attention.js"),require("../../../../icons/customIcons/icons/Collapse.js"),require("../../../../icons/customIcons/icons/Expand.js"),require("../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../icons/customIcons/icons/Search.js"),require("../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../icons/customIcons/icons/MultiRuler.js");var r=require("../Button/index.js"),c=require("./constants.js"),u=require("./components/LiveButtonStateIndicator/index.js"),a=require("./styles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=l(s),d=l(o),v=function(e,s){return e===c.LiveButtonState.Default?"Go to Live data":e===c.LiveButtonState.Live?"Data receiving in real-time":t.jsxs("div",{children:["Asset isn't Live",t.jsx("br",{}),s&&"Last active: ".concat(m.default(s).format("MMM D YYYY, hh:mm A"))]})};exports.LiveButtonState=c.LiveButtonState,exports.LiveButton=function(s){var o,l=s.size,m=void 0===l?"medium":l,j=s.state,q=void 0===j?c.LiveButtonState.Default:j,p=s.startIcon,I=s.children,L=void 0===I?"Live":I,f=s.className,x=s.tooltipProps,S=s.lastActiveAt,B=e.__rest(s,["size","state","startIcon","children","className","tooltipProps","lastActiveAt"]),h=a.useStyles({size:m}),_=h[m],b={placement:"bottom",title:v(q,S)},A="small"===m,g=p||t.jsx(n.RightSmallIcon,{size:A?20:24});return t.jsx(i.Tooltip,e.__assign({},b,x,{children:t.jsxs(r,e.__assign({},B,{className:d.default(h.root,_,(o={},o[h.liveState]=q===c.LiveButtonState.Live,o[h.offlineState]=q===c.LiveButtonState.Offline,o),f),size:m,startIcon:q===c.LiveButtonState.Default&&g,disableRipple:!0},{children:[L,t.jsx(u.LiveButtonStateIndicator,{state:q})]}))}))},exports.getTooltipText=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),s=require("moment-timezone"),i=require("@material-ui/core"),o=require("classnames"),n=require("../../../../icons/iconParkIcons.js");require("../../../../icons/customIcons/icons/AddMessage.js"),require("../../../../icons/customIcons/icons/Attention.js"),require("../../../../icons/customIcons/icons/Collapse.js"),require("../../../../icons/customIcons/icons/Expand.js"),require("../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../icons/customIcons/icons/Search.js"),require("../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../icons/customIcons/icons/MultiRuler.js");var r=require("../Button/index.js"),c=require("./constants.js"),u=require("./components/LiveButtonStateIndicator/index.js"),a=require("./styles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=l(s),d=l(o),v=function(e,s){return e===c.LiveButtonState.Default?"Go to Live data":e===c.LiveButtonState.Live?"Data receiving in real-time":t.jsxs("div",{children:["Asset isn't Live",t.jsx("br",{}),s&&"Last active: ".concat(m.default(s).format("MMM D YYYY, hh:mm A"))]})};exports.LiveButtonState=c.LiveButtonState,exports.LiveButton=function(s){var o,l=s.size,m=void 0===l?"medium":l,j=s.state,q=void 0===j?c.LiveButtonState.Default:j,I=s.startIcon,L=s.children,f=void 0===L?"Live":L,p=s.className,x=s.tooltipProps,S=s.lastActiveAt,B=e.__rest(s,["size","state","startIcon","children","className","tooltipProps","lastActiveAt"]),h=a.useStyles({size:m}),_=h[m],A={placement:"bottom",title:v(q,S)},b="small"===m,g=I||t.jsx(n.RightSmallIcon,{size:b?20:24});return t.jsx(i.Tooltip,e.__assign({},A,x,{children:t.jsxs(r,e.__assign({},B,{className:d.default(h.root,_,(o={},o[h.liveState]=q===c.LiveButtonState.Live,o[h.offlineState]=q===c.LiveButtonState.Offline,o),p),size:m,startIcon:q===c.LiveButtonState.Default&&g},{children:[f,t.jsx(u.LiveButtonStateIndicator,{state:q})]}))}))},exports.getTooltipText=v;
@@ -14,6 +14,6 @@ export namespace AdvancedSlider {
14
14
  }
15
15
  declare const _default: import("react").ElementType<Omit<any, "size">>;
16
16
  export default _default;
17
- declare const HORIZONTAL_ORIENTATION: "horizontal";
17
+ import { HORIZONTAL_ORIENTATION } from "./constants";
18
18
  import { noop } from "lodash/common/util";
19
19
  //# sourceMappingURL=AdvancedSlider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"AAkCO,wDA0WN;;;;;QAKmB,kDAAc;;;;;;;;;;;AAjXlC,mDAA4C"}
1
+ {"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"AAwCO,wDA8YN;;;;;QAKmB,kDAAc"}
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import{useRef as n,useState as i,useEffect as o,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 h}from"lodash";import{useThrottledCallback as c}from"../shared/useThrottledCallback.js";import{Handle as u}from"./Handle.js";import{HandleIcon as m}from"./icons/HandleIcon.js";import{useSliderStyles as s}from"./styles/sliderStyles.js";import"./styles/handleStyles.js";import{jsx as p,jsxs as f}from"react/jsx-runtime";function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function g(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var y="twoValuesSliderDefault",b=function(l){var h,v,b=l.min,w=l.max,O=l.value,j=l.size,H=l.orientation,z=l.valueFormatter,P=l.displayFormatter,S=l.editableHandles,x=l.onChange,E=l.onStop,C=l.reversed,L=l.handlePosition,M=l.handleClasses,R=l.minimal,B=s(),D=n(null),F=n(null),N="horizontal"===H,W="vertical"===H,_=g(g({},j),{},{width:N?j.width-94:j.width,height:W?j.height-40:j.height}),X=i([z(null==O?void 0:O.at(0)),z(null==O?void 0:O.at(1))]),Y=t(X,2),T=Y[0],k=Y[1],I=n(null),A=i(!1),V=t(A,2),q=V[0],G=V[1],J=t(T,2),K=J[0],Q=J[1],U=_.width/(w-b)*(Q-b),Z=_.width/(w-b)*(w-K),$=_.height/(w-b)*(Q-b),tt=_.height/(w-b)*(w-K);o((function(){if(!I.current){var t=[z(null==O?void 0:O.at(0)),z(null==O?void 0:O.at(1))],e=Math.min.apply(Math,t),n=Math.max.apply(Math,t);k([e,n])}}),[null==O?void 0:O.at(0),null==O?void 0:O.at(1)]),o((function(){if(N){var t=_.width/(w-b)*(K-b),e=_.width/(w-b)*(w-Q);D.current.updateSize({width:C?e:t,height:_.height}),F.current.updateSize({width:C?t:e,height:_.height})}else if(W){var n=_.height/(w-b)*(K-b),i=_.height/(w-b)*(w-Q);D.current.updateSize({width:_.width,height:C?i:n}),F.current.updateSize({width:_.width,height:C?n:i})}}),[b,w,K,Q,_.width,_.height,H]),o((function(){var t=function(){document.removeEventListener("mousemove",rt),document.removeEventListener("mouseup",at),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",dt)};return q?(document.addEventListener("mousemove",rt),document.addEventListener("mouseup",at),document.addEventListener("touchmove",lt),document.addEventListener("touchend",dt)):(t(),E()),function(){t()}}),[q]);var et=c((function(t,e,n){I.current="onResize Event";var i=n.clientWidth,o=n.clientHeight,r=K,a=Q;"right"===e?C?a=z(w-i/_.width*(w-b)):r=z(b+i/_.width*(w-b)):"left"===e?C?r=z(b+i/_.width*(w-b)):a=z(w-i/_.width*(w-b)):"bottom"===e?C?a=z(w-o/_.height*(w-b)):r=z(b+o/_.height*(w-b)):"top"===e&&(C?r=z(b+o/_.height*(w-b)):a=z(w-o/_.height*(w-b))),r=Math.min(r,Q),a=Math.max(a,K),k([r,a]),x([r,a])})),nt=c((function(){I.current=null,E()})),it=function(t,e){I.current={xPos:t,yPos:e,head:K,tail:Q}},ot=function(t,e){if(I.current){var n;N?n=(I.current.xPos-t)/_.width*(w-b):W&&(n=(I.current.yPos-e)/_.height*(w-b));var i,o,r=I.current.head-n*(C?-1:1),a=I.current.tail-n*(C?-1:1),l=I.current.tail-I.current.head;r<=b?(i=b,o=b+l):a>=w?(i=w-l,o=w):(i=r,o=a),i=z(i),o=z(o),k([i,o]),x([i,o])}},rt=c((function(t){ot(t.clientX,t.clientY)})),at=c((function(){I.current=null,G(!1)})),lt=c((function(t){ot(t.touches[0].pageX,t.touches[0].pageY)})),dt=c((function(){I.current=null,G(!1)})),ht=c((function(t){k([t,Q]),x([t,Q])})),ct=c((function(t){k([K,t]),x([K,t])})),ut=r((function(){return(Q-K)/(w-b)*(W?_.height:_.width)<30}),[b,w,K,Q]),mt=function(t){var e={min:b,max:Q,value:K,onChange:ht},n={min:K,max:w,value:Q,onChange:ct};return"head"===t?p(u,g({"data-testid":"".concat(y,"_handle_top"),placement:"head",readOnly:!S,displayFormatter:P,orientation:H,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:H,classes:M,minimal:R},C?e:n)):null};return p("div",{className:B.rootWrapper,children:f("div",{className:d(B.root,(h={},e(h,B.horizontalRoot,N),e(h,B.verticalRoot,W),e(h,B.minimal,R),h)),children:[p(a,{ref:D,minHeight:0,minWidth:0,maxWidth:C?Z:U,maxHeight:C?tt:$,enable:{right:N,bottom:W},handleComponent:{right:mt("head"),bottom:mt("head")},onResize:et,onResizeStop:nt}),p("div",{className:B.body,"data-testid":"slider-body",onMouseDown:function(t){it(t.clientX,t.clientY),G(!0)},onTouchStart:function(t){it(t.touches[0].pageX,t.touches[0].pageY),G(!0)},children:p("div",ut?{className:d((v={},e(v,B.horizontalBodyHandle,N),e(v,B.verticalBodyHandle,W),e(v,B.leftBodyHandle,"left"===L),e(v,B.rightBodyHandle,"right"===L),e(v,B.topBodyHandle,"top"===L),e(v,B.bottomBodyHandle,"bottom"===L),v)),children:p("div",{className:B.bodyHandle,"data-testid":"".concat(y,"_handle"),children:p(m,{orientation:"vertical",minimal:R})})}:{className:B.bodyHandleIcon,"data-testid":"".concat(y,"_handle"),children:p(m,{orientation:H,minimal:R})})}),p(a,{ref:F,minHeight:0,minWidth:0,enable:{left:N,top:W},handleComponent:{left:mt("tail"),top:mt("tail")},onResize:et,onResizeStop:nt})]})})};b.defaultProps={orientation:"horizontal",valueFormatter:Math.floor,displayFormatter:function(t){return t},onChange:h,onStop:h,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var w=l({monitorWidth:!0,monitorHeight:!0})(b);export{b as AdvancedSlider,w as default};
1
+ import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import{useRef as i,useState as n,useEffect as r,useMemo as o}from"react";import{Resizable as a}from"re-resizable";import{withSize as l}from"react-sizeme";import d from"classnames";import{noop as h}from"lodash";import{useThrottledCallback as s}from"../shared/useThrottledCallback.js";import{Handle as c}from"./Handle.js";import{HandleIcon as u}from"./icons/HandleIcon.js";import{useSliderStyles as m}from"./styles/sliderStyles.js";import"./styles/handleStyles.js";import{HORIZONTAL_ORIENTATION as f,INPUT_WIDTH as p,INPUT_HEIGHT as v,INNER_GAP as g,MIN_ARROW_GAP as b,VERTICAL_ORIENTATION as w,HORIZONTAL_MIN_GAP as y,VERTICAL_MIN_GAP as O}from"./constants.js";import{jsx as j,jsxs as H}from"react/jsx-runtime";function P(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function z(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?P(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S="twoValuesSliderDefault",x=function(l){var h,P,x=l.min,C=l.max,E=l.value,L=l.size,R=l.orientation,I=l.valueFormatter,M=l.displayFormatter,A=l.editableHandles,B=l.onChange,D=l.onStop,F=l.reversed,N=l.handlePosition,W=l.handleClasses,_=l.minimal,X=m(),Y=i(null),T=i(null),V=R===f,k=R===w,q=_?L:z(z({},L),{},{width:V?L.width-2*p:L.width,height:k?L.height-2*v:L.height}),G=n([I(null==E?void 0:E.at(0)),I(null==E?void 0:E.at(1))]),J=t(G,2),K=J[0],Q=J[1],U=i(null),Z=n(!1),$=t(Z,2),tt=$[0],et=$[1],it=t(K,2),nt=it[0],rt=it[1],ot=q.width/(C-x)*(rt-x),at=q.width/(C-x)*(C-nt),lt=q.height/(C-x)*(rt-x),dt=q.height/(C-x)*(C-nt);r((function(){if(!U.current){var t=[I(null==E?void 0:E.at(0)),I(null==E?void 0:E.at(1))],e=Math.min.apply(Math,t),i=Math.max.apply(Math,t);Q([e,i])}}),[null==E?void 0:E.at(0),null==E?void 0:E.at(1)]),r((function(){if(V){var t=q.width/(C-x)*(nt-x),e=q.width/(C-x)*(C-rt);Y.current.updateSize({width:F?e:t,height:q.height}),T.current.updateSize({width:F?t:e,height:q.height})}else if(k){var i=q.height/(C-x)*(nt-x),n=q.height/(C-x)*(C-rt);Y.current.updateSize({width:q.width,height:F?n:i}),T.current.updateSize({width:q.width,height:F?i:n})}}),[x,C,nt,rt,q.width,q.height,R]),r((function(){var t=function(){document.removeEventListener("mousemove",mt),document.removeEventListener("mouseup",ft),document.removeEventListener("touchmove",pt),document.removeEventListener("touchend",vt)};return tt?(document.addEventListener("mousemove",mt),document.addEventListener("mouseup",ft),document.addEventListener("touchmove",pt),document.addEventListener("touchend",vt)):(t(),D()),function(){t()}}),[tt]);var ht=s((function(t,e,i){U.current="onResize Event";var n=i.clientWidth,r=i.clientHeight,o=nt,a=rt;"right"===e?F?a=I(C-n/q.width*(C-x)):o=I(x+n/q.width*(C-x)):"left"===e?F?o=I(x+n/q.width*(C-x)):a=I(C-n/q.width*(C-x)):"bottom"===e?F?a=I(C-r/q.height*(C-x)):o=I(x+r/q.height*(C-x)):"top"===e&&(F?o=I(x+r/q.height*(C-x)):a=I(C-r/q.height*(C-x))),o=Math.min(o,rt),a=Math.max(a,nt),Q([o,a]),B([o,a])})),st=s((function(){U.current=null,D()})),ct=function(t,e){U.current={xPos:t,yPos:e,head:nt,tail:rt}},ut=function(t,e){if(U.current){var i;V?i=(U.current.xPos-t)/q.width*(C-x):k&&(i=(U.current.yPos-e)/q.height*(C-x));var n,r,o=U.current.head-i*(F?-1:1),a=U.current.tail-i*(F?-1:1),l=U.current.tail-U.current.head;o<=x?(n=x,r=x+l):a>=C?(n=C-l,r=C):(n=o,r=a),n=I(n),r=I(r),Q([n,r]),B([n,r])}},mt=s((function(t){ut(t.clientX,t.clientY)})),ft=s((function(){U.current=null,et(!1)})),pt=s((function(t){ut(t.touches[0].pageX,t.touches[0].pageY)})),vt=s((function(){U.current=null,et(!1)})),gt=s((function(t){Q([t,rt]),B([t,rt])})),bt=s((function(t){Q([nt,t]),B([nt,t])})),wt=o((function(){return(rt-nt)/(C-x)*(k?q.height:q.width)<30}),[x,C,nt,rt]),yt=o((function(){return(rt-nt)/(C-x)*(k?q.height:q.width)<g}),[x,C,nt,rt]),Ot=function(t,e){return t/e*(k?q.height:q.width)},jt=o((function(){if(_)return{};var t=V?y:O;return F?{isRightArrowInvisible:Ot(nt,C)<b,isLeftArrowInvisible:Ot(C-rt,C)<b,distance:(rt-nt)/(C-x)*(k?q.height:q.width)-t}:{isRightArrowInvisible:Ot(C-rt,C)<b,isLeftArrowInvisible:Ot(nt,C)<b,distance:(rt-nt)/(C-x)*(k?q.height:q.width)-t}}),[x,C,nt,rt,F]),Ht=function(t){var e={min:x,max:rt,value:nt,onChange:gt},i={min:nt,max:C,value:rt,onChange:bt};return"head"===t?j(c,z({"data-testid":"".concat(S,"_handle_top"),placement:"head",readOnly:!A,isInsideArrowsVisible:yt,arrowsOutsideConfig:jt,displayFormatter:M,orientation:R,classes:W,minimal:_},F?i:e)):"tail"===t?j(c,z({"data-testid":"".concat(S,"_handle_bottom"),placement:"tail",readOnly:!A,isInsideArrowsVisible:yt,arrowsOutsideConfig:jt,displayFormatter:M,orientation:R,classes:W,minimal:_},F?e:i)):null};return j("div",{className:X.rootWrapper,children:H("div",{className:d(X.root,(h={},e(h,X.horizontalRoot,V),e(h,X.verticalRoot,k),e(h,X.minimal,_),h)),children:[j(a,{ref:Y,minHeight:0,minWidth:0,maxWidth:F?at:ot,maxHeight:F?dt:lt,enable:{right:V,bottom:k},handleComponent:{right:Ht("head"),bottom:Ht("head")},onResize:ht,onResizeStop:st}),j("div",{className:X.body,"data-testid":"slider-body",onMouseDown:function(t){ct(t.clientX,t.clientY),et(!0)},onTouchStart:function(t){ct(t.touches[0].pageX,t.touches[0].pageY),et(!0)},children:j("div",wt?{className:d((P={},e(P,X.horizontalBodyHandle,V),e(P,X.verticalBodyHandle,k),e(P,X.leftBodyHandle,"left"===N),e(P,X.rightBodyHandle,"right"===N),e(P,X.topBodyHandle,"top"===N),e(P,X.bottomBodyHandle,"bottom"===N),P)),children:j("div",{className:X.bodyHandle,"data-testid":"".concat(S,"_handle"),children:j(u,{orientation:"vertical",minimal:_})})}:{className:X.bodyHandleIcon,"data-testid":"".concat(S,"_handle"),children:j(u,{orientation:R,minimal:_})})}),j(a,{ref:T,minHeight:0,minWidth:0,enable:{left:V,top:k},handleComponent:{left:Ht("tail"),top:Ht("tail")},onResize:ht,onResizeStop:st})]})})};x.defaultProps={orientation:f,valueFormatter:Math.floor,displayFormatter:function(t){return t},onChange:h,onStop:h,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var C=l({monitorWidth:!0,monitorHeight:!0})(x);export{x as AdvancedSlider,C as default};
@@ -1,4 +1,4 @@
1
- export function Handle({ value, orientation, placement, readOnly, onChange, min, max, displayFormatter, classes, minimal, "data-testid": dataTestId, }: {
1
+ export function Handle({ value, orientation, placement, readOnly, onChange, min, max, displayFormatter, isInsideArrowsVisible, arrowsOutsideConfig, classes, minimal, "data-testid": dataTestId, }: {
2
2
  value: any;
3
3
  orientation: any;
4
4
  placement: any;
@@ -7,6 +7,8 @@ export function Handle({ value, orientation, placement, readOnly, onChange, min,
7
7
  min: any;
8
8
  max: any;
9
9
  displayFormatter: any;
10
+ isInsideArrowsVisible: any;
11
+ arrowsOutsideConfig: any;
10
12
  classes: any;
11
13
  minimal: any;
12
14
  "data-testid": any;
@@ -1 +1 @@
1
- {"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/Handle.js"],"names":[],"mappings":"AAsBO;;;;;;;;;;;;gBAsEN"}
1
+ {"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/Handle.js"],"names":[],"mappings":"AAoBO;;;;;;;;;;;;;;gBA2HN"}
@@ -1 +1 @@
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};
1
+ import o from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/slicedToArray";import{useState as s,useRef as e,useEffect as r}from"react";import{Input as n}from"@material-ui/core";import t from"classnames";import{LeftIcon as a,RightIcon as l}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"./styles/sliderStyles.js";import{useHandleStyles as c}from"./styles/handleStyles.js";import{getIsInputValueValid as m,getValidatedValue as d}from"./utils.js";import{HORIZONTAL_ORIENTATION as u,VERTICAL_ORIENTATION as p,HEAD_PLACEMENT as v}from"./constants.js";import{jsxs as f,jsx as h}from"react/jsx-runtime";var j=function(j){var I,b,w,y,H=j.value,R=j.orientation,g=j.placement,A=j.readOnly,z=j.onChange,C=j.min,N=j.max,O=j.displayFormatter,T=j.isInsideArrowsVisible,x=j.arrowsOutsideConfig,E=j.classes,F=j.minimal,L=j["data-testid"],P=s(!1),S=i(P,2),k=S[0],q=S[1],M=s(H),V=i(M,2),B=V[0],D=V[1],G=e(null),K=R===u,U=R===p,W=g===v,J=c({distance:null==x?void 0:x.distance}),Q=function(o){var i=Number(o);m(i)?z(d(i,C,N)):q(!0)};return r((function(){D(H),k&&q(!1)}),[H]),f("div",{className:t(J.root,E.handleRoot,(I={},o(I,J.horizontalHeadRoot,K&&W),o(I,J.horizontalTailRoot,K&&!W),o(I,J.verticalHeadRoot,U&&W),o(I,J.verticalTailRoot,U&&!W),o(I,J.minimalHandleRoot,F),I)),children:[!F&&h(a,{size:16,className:t(J.leftArrow,(b={},o(b,J.reversedLeftArrow,U),o(b,J.isInvisible,T&&!W||W&&(null==x?void 0:x.isLeftArrowInvisible)),b)),fill:"white"}),h("div",{className:t(J.handle,E.handle,(w={},o(w,J.horizontalHeadHandle,K&&W),o(w,J.horizontalTailHandle,K&&!W),o(w,J.verticalHeadHandle,U&&W),o(w,J.verticalTailHandle,U&&!W),o(w,J.minimalHandle,F),o(w,J.minimalVerticalHandle,F&&U),w)),"data-testid":L,children:!F&&h(n,{inputProps:{"data-testid":"handle-input"},readOnly:A,inputRef:G,onKeyDown:function(o){var i=o.keyCode,s=o.target;13===i&&Q(s.value)},onBlur:function(o){var i=o.target;Q(i.value)},classes:{root:t(J.inputRoot,k&&J.hasError)},value:A?O(B):B,onChange:function(o){var i=o.target.value;D(i),k&&q(!1)},disableUnderline:!0,error:!(Number.isFinite(+B)&&+B>=C&&+B<=N)})}),!F&&h(l,{size:16,className:t(J.rightArrow,(y={},o(y,J.reversedRightArrow,U),o(y,J.isInvisible,T&&W||!W&&(null==x?void 0:x.isRightArrowInvisible)),y)),fill:"white"})]})};export{j as Handle};
@@ -0,0 +1,13 @@
1
+ export const INPUT_VALUE_REGEX: RegExp;
2
+ export const VERTICAL_ORIENTATION: "vertical";
3
+ export const HORIZONTAL_ORIENTATION: "horizontal";
4
+ export const HEAD_PLACEMENT: "head";
5
+ export const INPUT_WIDTH: 47;
6
+ export const INPUT_HEIGHT: 20;
7
+ export const MIN_ARROW_GAP: 12;
8
+ export const INNER_GAP: 24;
9
+ export const VERTICAL_MIN_GAP: 90;
10
+ export const HORIZONTAL_MIN_GAP: 48;
11
+ export const HOVER_ARREA_WIDTH: 72;
12
+ export const HOVER_AREA_HEIGHT: 64;
13
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/constants.js"],"names":[],"mappings":"AAAA,uCAA8C;AAE9C,8CAA+C;AAC/C,kDAAmD;AACnD,oCAAqC;AAErC,6BAA8B;AAC9B,8BAA+B;AAC/B,+BAAgC;AAChC,2BAA4B;AAE5B,kCAAmC;AACnC,oCAAqC;AAErC,mCAAoC;AACpC,mCAAoC"}
@@ -0,0 +1 @@
1
+ var a=/^[0-9.-]*$/,r="vertical",e="horizontal",o="head",t=47,h=20,i=12,l=24,v=90,c=48,d=72,n=64;export{o as HEAD_PLACEMENT,c as HORIZONTAL_MIN_GAP,e as HORIZONTAL_ORIENTATION,n as HOVER_AREA_HEIGHT,d as HOVER_ARREA_WIDTH,l as INNER_GAP,h as INPUT_HEIGHT,a as INPUT_VALUE_REGEX,t as INPUT_WIDTH,i as MIN_ARROW_GAP,v as VERTICAL_MIN_GAP,r as VERTICAL_ORIENTATION};
@@ -1,2 +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">;
1
+ export const useHandleStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"handle" | "root" | "inputRoot" | "hasError" | "horizontalHeadRoot" | "horizontalTailRoot" | "verticalHeadRoot" | "verticalTailRoot" | "horizontalHeadHandle" | "horizontalTailHandle" | "verticalHeadHandle" | "verticalTailHandle" | "minimalHandle" | "minimalVerticalHandle" | "minimalHandleRoot" | "leftArrow" | "rightArrow" | "reversedLeftArrow" | "reversedRightArrow" | "isInvisible">;
2
2
  //# sourceMappingURL=handleStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/handleStyles.js"],"names":[],"mappings":"AAWA,qXA2HI"}
1
+ {"version":3,"file":"handleStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/handleStyles.js"],"names":[],"mappings":"AAaA,4dAkLI"}
@@ -1 +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:20},minimalHandleRoot:{borderColor:o.primary.text9,zIndex:100,"&:not(:hover)":{border:"none"}}}}));export{t as useHandleStyles};
1
+ import{makeStyles as r}from"@material-ui/core";import{HOVER_AREA_HEIGHT as t,HOVER_ARREA_WIDTH as i}from"../constants.js";import{getHoverAreaSize as o}from"../utils.js";var e={minWidth:47,height:20,borderRadius:4},n=r((function(r){var n=r.isLightTheme,a=r.palette;return{root:{fontSize:"12px",position:"absolute","&:hover":{borderColor:a.primary.main},"&:active":{borderColor:a.primary.main},"&:hover $handle":{borderColor:a.primary.main},"&:active $handle":{background:a.primary.dark,borderColor:a.primary.main},"&:hover $inputRoot:not($hasError)":{background:a.primary.dark,border:"1px solid ".concat(a.primary.main)},"&:hover $inputRoot $hasError":{background:"".concat(a.background.b6," !important"),border:"1px solid ".concat(a.primary.main)},"&:active $inputRoot":{background:a.primary.dark,border:"1px solid ".concat(a.primary.main)},display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center","&:hover $leftArrow, &:active $leftArrow":{visibility:"visible"},"&:hover $rightArrow, &:active $rightArrow":{visibility:"visible"}},hasError:{border:"1px solid ".concat(a.error.main," !important"),"&.Mui-focused":{background:"".concat(a.background.b6," !important")},"&:hover":{background:a.background.b6},"&:hover $inputRoot":{background:a.background.b6}},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:n?"#B1B1B1":"#414141","& > p":{fontSize:"12px",textAlign:"center",lineHeight:"20px"},display:"flex",alignItems:"center",justifyContent:"center","&:before":{position:"absolute",left:"50%",top:"50%",height:function(r){var i=r.distance;return o({inititalSize:t,distance:i})},width:function(r){var t=r.distance;return o({distance:t,inititalSize:i})},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(a.primary.text9),"&:hover":{border:"1px solid ".concat(a.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:a.primary.dark,border:"1px solid ".concat(a.primary.main)}},minimalHandle:{background:a.primary.text9,width:"8px !important",minWidth:8,minHeight:20,height:"20px !important","& .MuiInput-underline.Mui-error:after":{border:0},"&:before":{width:"0px !important",height:"0px !important"}},minimalVerticalHandle:{width:20,minWidth:20,minHeight:8,height:"8px !important"},minimalHandleRoot:{borderColor:a.primary.text9,zIndex:100,"&:not(:hover)":{border:"none"}},leftArrow:{visibility:"hidden",zIndex:101,position:"absolute",left:-16},rightArrow:{visibility:"hidden",zIndex:101,position:"absolute",right:-15},reversedLeftArrow:{left:"50%",transform:"translateX(-50%) rotate(90deg)",top:-16},reversedRightArrow:{left:"50%",transform:"translateX(-50%) rotate(90deg)",bottom:-15},isInvisible:{display:"none"}}}));export{n as useHandleStyles};
@@ -1 +1 @@
1
- {"version":3,"file":"sliderStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/sliderStyles.js"],"names":[],"mappings":"AAIA,2UAkJI"}
1
+ {"version":3,"file":"sliderStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/sliderStyles.js"],"names":[],"mappings":"AAIA,2UAsKI"}
@@ -1 +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:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:o.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:o.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},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,zIndex:111},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
+ import{makeStyles as t,fade as o}from"@material-ui/core";var e=t((function(t){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:t.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:t.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},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",background:"#008BA366"},"&:active $bodyHandleIcon":{visibility:"visible"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24,zIndex:111},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:{zIndex:101,width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden","&:before":{position:"absolute",left:"50%",top:"50%",height:32,width:24,content:'""',transform:"translate(-50%, -50%)",zIndex:1e3}},bodyHandleIcon:{visibility:"hidden"},minimal:{borderRadius:4,width:"100%",height:"100%",top:0,left:0,"&::before, &::after":{display:"none"},"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:o(t.palette.background.b7,.1),border:"1px solid ".concat(t.palette.primary.text9),borderRadius:4}}}}));export{e as useSliderStyles};
@@ -0,0 +1,7 @@
1
+ export function getValidatedValue(value: any, min: any, max: any): number;
2
+ export function getIsInputValueValid(inputValue: any): boolean;
3
+ export function getHoverAreaSize({ inititalSize, distance }: {
4
+ inititalSize: any;
5
+ distance: any;
6
+ }): any;
7
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/utils.js"],"names":[],"mappings":"AAEO,0EAAkF;AAElF,+DACkE;AAElE;;;QAC8D"}
@@ -0,0 +1 @@
1
+ import{INPUT_VALUE_REGEX as t}from"./constants.js";var n=function(t,n,r){return Math.min(Math.max(t,n),r)},r=function(n){return t.test(n)&&!Number.isNaN(Number(n))},a=function(t){var n=t.inititalSize,r=t.distance;return r<0?n-Math.abs(r/2):n};export{a as getHoverAreaSize,r as getIsInputValueValid,n as getValidatedValue};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/components/LiveButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAInE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,uFAWxD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0ChD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/components/LiveButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAInE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc,UAAW,mBAAmB,uFAWxD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyChD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +1 @@
1
- import{__rest as o,__assign as s}from'./../../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as i}from"react/jsx-runtime";import e from"moment-timezone";import{Tooltip as n}from"@material-ui/core";import c from"classnames";import{RightSmallIcon as r}from"../../../../icons/iconParkIcons.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import m from"../Button/index.js";import{LiveButtonState as a}from"./constants.js";export{LiveButtonState}from"./constants.js";import{LiveButtonStateIndicator as l}from"./components/LiveButtonStateIndicator/index.js";import{useStyles as p}from"./styles.js";var u=function(o,s){return o===a.Default?"Go to Live data":o===a.Live?"Data receiving in real-time":i("div",{children:["Asset isn't Live",t("br",{}),s&&"Last active: ".concat(e(s).format("MMM D YYYY, hh:mm A"))]})},d=function(e){var d,f=e.size,j=void 0===f?"medium":f,v=e.state,I=void 0===v?a.Default:v,h=e.startIcon,L=e.children,A=void 0===L?"Live":L,b=e.className,x=e.tooltipProps,z=e.lastActiveAt,D=o(e,["size","state","startIcon","children","className","tooltipProps","lastActiveAt"]),M=p({size:j}),S=M[j],O={placement:"bottom",title:u(I,z)},Y=h||t(r,{size:"small"===j?20:24});return t(n,s({},O,x,{children:i(m,s({},D,{className:c(M.root,S,(d={},d[M.liveState]=I===a.Live,d[M.offlineState]=I===a.Offline,d),b),size:j,startIcon:I===a.Default&&Y,disableRipple:!0},{children:[A,t(l,{state:I})]}))}))};export{d as LiveButton,u as getTooltipText};
1
+ import{__rest as o,__assign as t}from'./../../../../ext-esm/tslib/tslib.es6.js';import{jsx as s,jsxs as i}from"react/jsx-runtime";import e from"moment-timezone";import{Tooltip as n}from"@material-ui/core";import c from"classnames";import{RightSmallIcon as r}from"../../../../icons/iconParkIcons.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import m from"../Button/index.js";import{LiveButtonState as a}from"./constants.js";export{LiveButtonState}from"./constants.js";import{LiveButtonStateIndicator as l}from"./components/LiveButtonStateIndicator/index.js";import{useStyles as p}from"./styles.js";var u=function(o,t){return o===a.Default?"Go to Live data":o===a.Live?"Data receiving in real-time":i("div",{children:["Asset isn't Live",s("br",{}),t&&"Last active: ".concat(e(t).format("MMM D YYYY, hh:mm A"))]})},d=function(e){var d,f=e.size,j=void 0===f?"medium":f,v=e.state,I=void 0===v?a.Default:v,h=e.startIcon,L=e.children,A=void 0===L?"Live":L,x=e.className,z=e.tooltipProps,b=e.lastActiveAt,D=o(e,["size","state","startIcon","children","className","tooltipProps","lastActiveAt"]),M=p({size:j}),S=M[j],O={placement:"bottom",title:u(I,b)},Y=h||s(r,{size:"small"===j?20:24});return s(n,t({},O,z,{children:i(m,t({},D,{className:c(M.root,S,(d={},d[M.liveState]=I===a.Live,d[M.offlineState]=I===a.Offline,d),x),size:j,startIcon:I===a.Default&&Y},{children:[A,s(l,{state:I})]}))}))};export{d as LiveButton,u as getTooltipText};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.84.0-13",
3
+ "version": "0.84.0-15",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"