@corva/ui 3.40.0-0 → 3.40.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("socket.io-client"),n=require("./constants.js"),i=require("./subscriptions-client.js"),s=require("./subscriptions-client.dummy.js"),r=function(){function r(){}return r.init=function(e){void 0===e&&(e=n.SUBSCRIPTIONS_URL);var t=new URL(e).origin;return this.instances.has(t)||this.instances.set(t,this.create(e)),this.instances.get(t)},r.create=function(r){if(n.IGNORED_ROUTES_REGEXP.test(window.location.pathname))return new s.DummySubscriptionsClient;var c=t.io(r,{transports:["websocket"],autoConnect:!0}),o=0;return c.on("connect",(function(){(o+=1,c.recovered)||1!==o&&Object.keys(c._callbacks).filter((function(e){return e.startsWith("$data#")})).map((function(e){return e.replace("$data#","")})).forEach((function(t){c.emit("subscribe",e.__assign({channel:t},n.getHrefDebugField()))}))})),new i.SubscriptionsClientV2(c)},r.instances=new Map,r}();exports.SubscriptionsClientFactory=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("socket.io-client"),n=require("./constants.js"),i=require("./subscriptions-client.js"),s=require("./subscriptions-client.dummy.js"),r=function(){function r(){}return r.init=function(e){void 0===e&&(e=n.SUBSCRIPTIONS_URL);var t=new URL(e).origin;return this.instances.has(t)||this.instances.set(t,this.create(e)),this.instances.get(t)},r.create=function(r){if(n.IGNORED_ROUTES_REGEXP.test(window.location.pathname))return new s.DummySubscriptionsClient;var c=t.io(r,{transports:["websocket"],autoConnect:!0,path:process.env.REACT_APP_SUBSCRIPTIONS_PATH||"/socket.io"}),o=0;return c.on("connect",(function(){(o+=1,c.recovered)||1!==o&&Object.keys(c._callbacks).filter((function(e){return e.startsWith("$data#")})).map((function(e){return e.replace("$data#","")})).forEach((function(t){c.emit("subscribe",e.__assign({channel:t},n.getHrefDebugField()))}))})),new i.SubscriptionsClientV2(c)},r.instances=new Map,r}();exports.SubscriptionsClientFactory=r;
2
2
  //# sourceMappingURL=subscriptions-client.factory.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),i=require("react"),n=require("re-resizable"),a=require("react-sizeme"),o=require("classnames"),r=require("../shared/useThrottledCallback.js"),l=require("./Handle.js"),d=require("./icons/HandleIcon.js"),s=require("./utils.js"),u=require("./styles/sliderStyles.js");require("./styles/handleStyles.js");var h=require("./constants.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(o),v="twoValuesSliderDefault",f=function(a){var o,c,f,g=a.min,p=a.max,_=a.value,b=a.onChange,x=void 0===b?function(){}:b,H=a.orientation,I=void 0===H?h.HORIZONTAL_ORIENTATION:H,R=a.valueFormatter,w=void 0===R?Math.floor:R,y=a.displayFormatter,N=void 0===y?function(e){return e}:y,T=a.editableHandles,A=void 0===T||T,j=a.onStop,M=void 0===j?function(){}:j,z=a.reversed,C=void 0!==z&&z,O=a.handlePosition,E=a.handleClasses,S=void 0===E?{}:E,P=a.minimal,L=void 0!==P&&P,q=a.dimension,W=void 0===q?"small":q,k=e.__rest(a,["min","max","value","onChange","orientation","valueFormatter","displayFormatter","editableHandles","onStop","reversed","handlePosition","handleClasses","minimal","dimension"]).size,G=void 0===k?{}:k,B=u.useSliderStyles(),F=i.useRef(null),V=i.useRef(null),X=I===h.HORIZONTAL_ORIENTATION,Y=I===h.VERTICAL_ORIENTATION,D=L?G:e.__assign(e.__assign({},G),{width:X?G.width-2*h.INPUT_WIDTH:G.width,height:Y?G.height-2*h.INPUT_HEIGHT:G.height}),Z=i.useState([w(null==_?void 0:_.at(0)),w(null==_?void 0:_.at(1))]),U=Z[0],J=Z[1],K=i.useRef(null),Q=i.useState(!1),$=Q[0],ee=Q[1],te=U[0],ie=U[1],ne=s.getSizedControls({isHorizontalOrientation:X,size:D,max:p,min:g,tail:ie,head:te}),ae=ne.headMaxWidth,oe=ne.tailMaxWidth,re=ne.headMaxHeight,le=ne.tailMaxHeight;i.useEffect((function(){if(!K.current){var e=[w(null==_?void 0:_.at(0)),w(null==_?void 0:_.at(1))],t=Math.min.apply(Math,e),i=Math.max.apply(Math,e);J([t,i])}}),[null==_?void 0:_.at(0),null==_?void 0:_.at(1)]),i.useEffect((function(){if(X){var e=D.width/(p-g)*(te-g),t=D.width/(p-g)*(p-ie);F.current.updateSize({width:C?t:e,height:D.height}),V.current.updateSize({width:C?e:t,height:D.height})}else if(Y){var i=D.height/(p-g)*(te-g),n=D.height/(p-g)*(p-ie);F.current.updateSize({width:D.width,height:C?n:i}),V.current.updateSize({width:D.width,height:C?i:n})}}),[g,p,te,ie,D.width,D.height,I]),i.useEffect((function(){var e=function(){document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me),document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",fe)};return $?(document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),document.addEventListener("touchmove",ve),document.addEventListener("touchend",fe)):(e(),M()),function(){e()}}),[$]);var de=r.useThrottledCallback((function(e,t,i){K.current="onResize Event";var n=i.clientWidth,a=i.clientHeight,o=te,r=ie;"right"===t?C?r=w(p-n/D.width*(p-g)):o=w(g+n/D.width*(p-g)):"left"===t?C?o=w(g+n/D.width*(p-g)):r=w(p-n/D.width*(p-g)):"bottom"===t?C?r=w(p-a/D.height*(p-g)):o=w(g+a/D.height*(p-g)):"top"===t&&(C?o=w(g+a/D.height*(p-g)):r=w(p-a/D.height*(p-g))),o=Math.min(o,ie),r=Math.max(r,te),J([o,r]),x([o,r])})),se=r.useThrottledCallback((function(){K.current=null,M()})),ue=function(e,t){K.current={xPos:e,yPos:t,head:te,tail:ie}},he=function(e,t){if(K.current){var i=void 0;X?i=(K.current.xPos-e)/D.width*(p-g):Y&&(i=(K.current.yPos-t)/D.height*(p-g));var n=K.current.head-i*(C?-1:1),a=K.current.tail-i*(C?-1:1),o=K.current.tail-K.current.head,r=void 0,l=void 0;n<=g?(r=g,l=g+o):a>=p?(r=p-o,l=p):(r=n,l=a),r=w(r),l=w(l),J([r,l]),x([r,l])}},ce=r.useThrottledCallback((function(e){he(e.clientX,e.clientY)})),me=r.useThrottledCallback((function(){K.current=null,ee(!1)})),ve=r.useThrottledCallback((function(e){he(e.touches[0].pageX,e.touches[0].pageY)})),fe=r.useThrottledCallback((function(){K.current=null,ee(!1)})),ge=r.useThrottledCallback((function(e){J([e,ie]),x([e,ie]),M()})),pe=r.useThrottledCallback((function(e){J([te,e]),x([te,e]),M()})),_e=i.useMemo((function(){return(ie-te)/(p-g)*(Y?D.height:D.width)<30}),[g,p,te,ie]),be=i.useMemo((function(){return(ie-te)/(p-g)*(Y?D.height:D.width)<h.INNER_GAP}),[g,p,te,ie]),xe=i.useMemo((function(){var e=Y?D.height:D.width,t=e/(p-g),i=function(e){return(e-g)*t},n=i(te),a=e-i(ie);return{isLeftArrowInvisible:C?a<h.MIN_ARROW_GAP:n<h.MIN_ARROW_GAP,isRightArrowInvisible:C?n<h.MIN_ARROW_GAP:a<h.MIN_ARROW_GAP,distance:(ie-te)/(p-g)*e-(Y?h.VERTICAL_MIN_GAP:h.HORIZONTAL_MIN_GAP)}}),[g,p,te,ie,C]),He=function(i){var n={min:g,max:ie,value:te,onChange:ge},a={min:te,max:p,value:ie,onChange:pe};return"head"===i?t.jsx(l.Handle,e.__assign({"data-testid":"".concat(v,"_handle_top"),placement:"head",dimension:W,readOnly:!A,isInsideArrowsVisible:be,arrowsOutsideConfig:xe,displayFormatter:N,orientation:I,classes:S,minimal:L},C?a:n)):"tail"===i?t.jsx(l.Handle,e.__assign({"data-testid":"".concat(v,"_handle_bottom"),placement:"tail",dimension:W,readOnly:!A,isInsideArrowsVisible:be,arrowsOutsideConfig:xe,displayFormatter:N,orientation:I,classes:S,minimal:L},C?n:a)):null};return t.jsx("div",{className:m.default(B.rootWrapper,B["".concat(I,"-").concat(W)],(o={},o[B.rootMinimal]=L,o)),children:t.jsxs("div",{className:m.default(B.root,(c={},c[B.horizontalRoot]=X,c[B.verticalRoot]=Y,c[B.minimal]=L,c)),children:[t.jsx(n.Resizable,{className:B.resizable,ref:F,minHeight:0,minWidth:0,maxWidth:C?oe:ae,maxHeight:C?le:re,enable:{right:X,bottom:Y},handleComponent:{right:He("head"),bottom:He("head")},onResize:de,onResizeStop:se}),t.jsx("div",{className:B.body,"data-testid":"slider-body",onMouseDown:function(e){ue(e.clientX,e.clientY),ee(!0)},onTouchStart:function(e){ue(e.touches[0].pageX,e.touches[0].pageY),ee(!0)},children:_e?t.jsx("div",{className:m.default((f={},f[B.horizontalBodyHandle]=X,f[B.verticalBodyHandle]=Y,f[B.leftBodyHandle]="left"===O,f[B.rightBodyHandle]="right"===O,f[B.topBodyHandle]="top"===O,f[B.bottomBodyHandle]="bottom"===O,f)),children:t.jsx("div",{className:B.bodyHandle,"data-testid":"".concat(v,"_handle"),children:t.jsx(d.HandleIcon,{orientation:"vertical",minimal:L})})}):t.jsx("div",{className:B.bodyHandleIcon,"data-testid":"".concat(v,"_handle"),children:t.jsx(d.HandleIcon,{orientation:I,minimal:L})})}),t.jsx(n.Resizable,{className:B.resizable,ref:V,minHeight:0,minWidth:0,enable:{left:X,top:Y},handleComponent:{left:He("tail"),top:He("tail")},onResize:de,onResizeStop:se})]})})},g=a.withSize({monitorWidth:!0,monitorHeight:!0})(f);exports.AdvancedSlider=f,exports.default=g;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),i=require("react"),n=require("re-resizable"),a=require("react-sizeme"),o=require("classnames"),r=require("../shared/useThrottledCallback.js"),l=require("./Handle.js"),d=require("./icons/HandleIcon.js"),s=require("./utils.js"),u=require("./styles/sliderStyles.js");require("./styles/handleStyles.js");var h=require("./constants.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(o),v="twoValuesSliderDefault",f=function(a){var o,c,f,g=a.min,p=a.max,b=a.value,_=a.onChange,x=void 0===_?function(){}:_,H=a.orientation,I=void 0===H?h.HORIZONTAL_ORIENTATION:H,R=a.valueFormatter,w=void 0===R?Math.floor:R,N=a.displayFormatter,y=void 0===N?function(e){return e}:N,T=a.editableHandles,A=void 0===T||T,j=a.onStop,M=void 0===j?function(){}:j,z=a.reversed,C=void 0!==z&&z,O=a.handlePosition,E=a.handleClasses,S=void 0===E?{}:E,P=a.minimal,L=void 0!==P&&P,q=a.dimension,W=void 0===q?"small":q,k=e.__rest(a,["min","max","value","onChange","orientation","valueFormatter","displayFormatter","editableHandles","onStop","reversed","handlePosition","handleClasses","minimal","dimension"]).size,G=void 0===k?{}:k,F=u.useSliderStyles(),B=i.useRef(null),V=i.useRef(null),X=I===h.HORIZONTAL_ORIENTATION,Y=I===h.VERTICAL_ORIENTATION,D=L?G:e.__assign(e.__assign({},G),{width:X?G.width-2*h.INPUT_WIDTH:G.width,height:Y?G.height-2*h.INPUT_HEIGHT:G.height}),Z=i.useState([w(null==b?void 0:b.at(0)),w(null==b?void 0:b.at(1))]),U=Z[0],J=Z[1],K=i.useRef(null),Q=i.useState(!1),$=Q[0],ee=Q[1],te=U[0],ie=U[1],ne=s.getSizedControls({isHorizontalOrientation:X,size:D,max:p,min:g,tail:ie,head:te}),ae=ne.headMaxWidth,oe=ne.tailMaxWidth,re=ne.headMaxHeight,le=ne.tailMaxHeight;i.useEffect((function(){if(!K.current){var e=[w(null==b?void 0:b.at(0)),w(null==b?void 0:b.at(1))],t=Math.min.apply(Math,e),i=Math.max.apply(Math,e);J([t,i])}}),[null==b?void 0:b.at(0),null==b?void 0:b.at(1)]),i.useEffect((function(){if(X){var e=D.width/(p-g)*(te-g),t=D.width/(p-g)*(p-ie);B.current.updateSize({width:C?t:e,height:D.height}),V.current.updateSize({width:C?e:t,height:D.height})}else if(Y){var i=D.height/(p-g)*(te-g),n=D.height/(p-g)*(p-ie);B.current.updateSize({width:D.width,height:C?n:i}),V.current.updateSize({width:D.width,height:C?i:n})}}),[g,p,te,ie,D.width,D.height,I]),i.useEffect((function(){var e=function(){document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me),document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",fe)};return $?(document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),document.addEventListener("touchmove",ve),document.addEventListener("touchend",fe)):(e(),M()),function(){e()}}),[$]);var de=r.useThrottledCallback((function(e,t,i){K.current="onResize Event";var n=i.clientWidth,a=i.clientHeight,o=te,r=ie;"right"===t?C?r=w(p-n/D.width*(p-g)):o=w(g+n/D.width*(p-g)):"left"===t?C?o=w(g+n/D.width*(p-g)):r=w(p-n/D.width*(p-g)):"bottom"===t?C?r=w(p-a/D.height*(p-g)):o=w(g+a/D.height*(p-g)):"top"===t&&(C?o=w(g+a/D.height*(p-g)):r=w(p-a/D.height*(p-g))),o=Math.min(o,ie),r=Math.max(r,te),J([o,r]),x([o,r])})),se=r.useThrottledCallback((function(){K.current=null,M()})),ue=function(e,t){K.current={xPos:e,yPos:t,head:te,tail:ie}},he=function(e,t){if(K.current){var i=void 0;X?i=(K.current.xPos-e)/D.width*(p-g):Y&&(i=(K.current.yPos-t)/D.height*(p-g));var n=K.current.head-i*(C?-1:1),a=K.current.tail-i*(C?-1:1),o=K.current.tail-K.current.head,r=void 0,l=void 0;n<=g?(r=g,l=g+o):a>=p?(r=p-o,l=p):(r=n,l=a),r=w(r),l=w(l),J([r,l]),x([r,l])}},ce=r.useThrottledCallback((function(e){he(e.clientX,e.clientY)})),me=r.useThrottledCallback((function(){K.current=null,ee(!1)})),ve=r.useThrottledCallback((function(e){he(e.touches[0].pageX,e.touches[0].pageY)})),fe=r.useThrottledCallback((function(){K.current=null,ee(!1)})),ge=r.useThrottledCallback((function(e){J([e,ie]),x([e,ie]),M()})),pe=r.useThrottledCallback((function(e){J([te,e]),x([te,e]),M()})),be=i.useMemo((function(){return(ie-te)/(p-g)*(Y?D.height:D.width)<30}),[g,p,te,ie]),_e=i.useMemo((function(){return(ie-te)/(p-g)*(Y?D.height:D.width)<h.INNER_GAP}),[g,p,te,ie]),xe=i.useMemo((function(){var e=Y?D.height:D.width,t=e/(p-g),i=function(e){return(e-g)*t},n=i(te),a=e-i(ie),o=(ie-te)/(p-g)*e-(Y?h.VERTICAL_MIN_GAP:h.HORIZONTAL_MIN_GAP);return{isLeftArrowInvisible:C?a<h.MIN_ARROW_GAP:n<h.MIN_ARROW_GAP,isRightArrowInvisible:C?n<h.MIN_ARROW_GAP:a<h.MIN_ARROW_GAP,distance:Number.isFinite(o)?o:0}}),[g,p,te,ie,C]),He=function(i){var n={min:g,max:ie,value:te,onChange:ge},a={min:te,max:p,value:ie,onChange:pe};return"head"===i?t.jsx(l.Handle,e.__assign({"data-testid":"".concat(v,"_handle_top"),placement:"head",dimension:W,readOnly:!A,isInsideArrowsVisible:_e,arrowsOutsideConfig:xe,displayFormatter:y,orientation:I,classes:S,minimal:L},C?a:n)):"tail"===i?t.jsx(l.Handle,e.__assign({"data-testid":"".concat(v,"_handle_bottom"),placement:"tail",dimension:W,readOnly:!A,isInsideArrowsVisible:_e,arrowsOutsideConfig:xe,displayFormatter:y,orientation:I,classes:S,minimal:L},C?n:a)):null};return t.jsx("div",{className:m.default(F.rootWrapper,F["".concat(I,"-").concat(W)],(o={},o[F.rootMinimal]=L,o)),children:t.jsxs("div",{className:m.default(F.root,(c={},c[F.horizontalRoot]=X,c[F.verticalRoot]=Y,c[F.minimal]=L,c)),children:[t.jsx(n.Resizable,{className:F.resizable,ref:B,minHeight:0,minWidth:0,maxWidth:C?oe:ae,maxHeight:C?le:re,enable:{right:X,bottom:Y},handleComponent:{right:He("head"),bottom:He("head")},onResize:de,onResizeStop:se}),t.jsx("div",{className:F.body,"data-testid":"slider-body",onMouseDown:function(e){ue(e.clientX,e.clientY),ee(!0)},onTouchStart:function(e){ue(e.touches[0].pageX,e.touches[0].pageY),ee(!0)},children:be?t.jsx("div",{className:m.default((f={},f[F.horizontalBodyHandle]=X,f[F.verticalBodyHandle]=Y,f[F.leftBodyHandle]="left"===O,f[F.rightBodyHandle]="right"===O,f[F.topBodyHandle]="top"===O,f[F.bottomBodyHandle]="bottom"===O,f)),children:t.jsx("div",{className:F.bodyHandle,"data-testid":"".concat(v,"_handle"),children:t.jsx(d.HandleIcon,{orientation:"vertical",minimal:L})})}):t.jsx("div",{className:F.bodyHandleIcon,"data-testid":"".concat(v,"_handle"),children:t.jsx(d.HandleIcon,{orientation:I,minimal:L})})}),t.jsx(n.Resizable,{className:F.resizable,ref:V,minHeight:0,minWidth:0,enable:{left:X,top:Y},handleComponent:{left:He("tail"),top:He("tail")},onResize:de,onResizeStop:se})]})})},g=a.withSize({monitorWidth:!0,monitorHeight:!0})(f);exports.AdvancedSlider=f,exports.default=g;
2
2
  //# sourceMappingURL=AdvancedSlider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions-client.factory.d.ts","sourceRoot":"","sources":["../../../src/clients/subscriptions/subscriptions-client.factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,0BAA0B;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAyC;WAE5D,IAAI,CAAC,GAAG,SAAoB;IAS1C,OAAO,CAAC,MAAM,CAAC,MAAM;CAoDtB"}
1
+ {"version":3,"file":"subscriptions-client.factory.d.ts","sourceRoot":"","sources":["../../../src/clients/subscriptions/subscriptions-client.factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,0BAA0B;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAyC;WAE5D,IAAI,CAAC,GAAG,SAAoB;IAS1C,OAAO,CAAC,MAAM,CAAC,MAAM;CAqDtB"}
@@ -1,2 +1,2 @@
1
- import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{io as n}from"socket.io-client";import{IGNORED_ROUTES_REGEXP as e,getHrefDebugField as i,SUBSCRIPTIONS_URL as s}from"./constants.js";import{SubscriptionsClientV2 as r}from"./subscriptions-client.js";import{DummySubscriptionsClient as o}from"./subscriptions-client.dummy.js";var c=function(){function c(){}return c.init=function(t){void 0===t&&(t=s);var n=new URL(t).origin;return this.instances.has(n)||this.instances.set(n,this.create(t)),this.instances.get(n)},c.create=function(s){if(e.test(window.location.pathname))return new o;var c=n(s,{transports:["websocket"],autoConnect:!0}),a=0;return c.on("connect",(function(){(a+=1,c.recovered)||1!==a&&Object.keys(c._callbacks).filter((function(t){return t.startsWith("$data#")})).map((function(t){return t.replace("$data#","")})).forEach((function(n){c.emit("subscribe",t({channel:n},i()))}))})),new r(c)},c.instances=new Map,c}();export{c as SubscriptionsClientFactory};
1
+ import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{io as n}from"socket.io-client";import{IGNORED_ROUTES_REGEXP as e,getHrefDebugField as i,SUBSCRIPTIONS_URL as s}from"./constants.js";import{SubscriptionsClientV2 as o}from"./subscriptions-client.js";import{DummySubscriptionsClient as r}from"./subscriptions-client.dummy.js";var c=function(){function c(){}return c.init=function(t){void 0===t&&(t=s);var n=new URL(t).origin;return this.instances.has(n)||this.instances.set(n,this.create(t)),this.instances.get(n)},c.create=function(s){if(e.test(window.location.pathname))return new r;var c=n(s,{transports:["websocket"],autoConnect:!0,path:process.env.REACT_APP_SUBSCRIPTIONS_PATH||"/socket.io"}),a=0;return c.on("connect",(function(){(a+=1,c.recovered)||1!==a&&Object.keys(c._callbacks).filter((function(t){return t.startsWith("$data#")})).map((function(t){return t.replace("$data#","")})).forEach((function(n){c.emit("subscribe",t({channel:n},i()))}))})),new o(c)},c.instances=new Map,c}();export{c as SubscriptionsClientFactory};
2
2
  //# sourceMappingURL=subscriptions-client.factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EACZ,SAAS,EAMV,MAAM,OAAO,CAAC;AAwBf,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6KAgB5B,mBAAmB,KAAG,YAmYxB,CAAC;;AAEF,wBAGmB"}
1
+ {"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EACZ,SAAS,EAMV,MAAM,OAAO,CAAC;AAwBf,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6KAgB5B,mBAAmB,KAAG,YAqYxB,CAAC;;AAEF,wBAGmB"}
@@ -1,2 +1,2 @@
1
- import{__rest as t,__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useRef as o,useState as a,useEffect as r,useMemo as d}from"react";import{Resizable as l}from"re-resizable";import{withSize as h}from"react-sizeme";import s from"classnames";import{useThrottledCallback as m}from"../shared/useThrottledCallback.js";import{Handle as c}from"./Handle.js";import{HandleIcon as u}from"./icons/HandleIcon.js";import{getSizedControls as v}from"./utils.js";import{useSliderStyles as f}from"./styles/sliderStyles.js";import"./styles/handleStyles.js";import{INPUT_WIDTH as p,INPUT_HEIGHT as g,INNER_GAP as w,MIN_ARROW_GAP as b,VERTICAL_MIN_GAP as y,HORIZONTAL_MIN_GAP as H,HORIZONTAL_ORIENTATION as z,VERTICAL_ORIENTATION as x}from"./constants.js";var M="twoValuesSliderDefault",S=function(h){var S,C,j,E=h.min,L=h.max,N=h.value,R=h.onChange,W=void 0===R?function(){}:R,_=h.orientation,B=void 0===_?z:_,F=h.valueFormatter,I=void 0===F?Math.floor:F,P=h.displayFormatter,O=void 0===P?function(t){return t}:P,A=h.editableHandles,X=void 0===A||A,Y=h.onStop,V=void 0===Y?function(){}:Y,D=h.reversed,T=void 0!==D&&D,k=h.handlePosition,q=h.handleClasses,G=void 0===q?{}:q,J=h.minimal,K=void 0!==J&&J,Q=h.dimension,U=void 0===Q?"small":Q,Z=t(h,["min","max","value","onChange","orientation","valueFormatter","displayFormatter","editableHandles","onStop","reversed","handlePosition","handleClasses","minimal","dimension"]).size,$=void 0===Z?{}:Z,tt=f(),et=o(null),it=o(null),nt=B===z,ot=B===x,at=K?$:e(e({},$),{width:nt?$.width-2*p:$.width,height:ot?$.height-2*g:$.height}),rt=a([I(null==N?void 0:N.at(0)),I(null==N?void 0:N.at(1))]),dt=rt[0],lt=rt[1],ht=o(null),st=a(!1),mt=st[0],ct=st[1],ut=dt[0],vt=dt[1],ft=v({isHorizontalOrientation:nt,size:at,max:L,min:E,tail:vt,head:ut}),pt=ft.headMaxWidth,gt=ft.tailMaxWidth,wt=ft.headMaxHeight,bt=ft.tailMaxHeight;r((function(){if(!ht.current){var t=[I(null==N?void 0:N.at(0)),I(null==N?void 0:N.at(1))],e=Math.min.apply(Math,t),i=Math.max.apply(Math,t);lt([e,i])}}),[null==N?void 0:N.at(0),null==N?void 0:N.at(1)]),r((function(){if(nt){var t=at.width/(L-E)*(ut-E),e=at.width/(L-E)*(L-vt);et.current.updateSize({width:T?e:t,height:at.height}),it.current.updateSize({width:T?t:e,height:at.height})}else if(ot){var i=at.height/(L-E)*(ut-E),n=at.height/(L-E)*(L-vt);et.current.updateSize({width:at.width,height:T?n:i}),it.current.updateSize({width:at.width,height:T?i:n})}}),[E,L,ut,vt,at.width,at.height,B]),r((function(){var t=function(){document.removeEventListener("mousemove",Mt),document.removeEventListener("mouseup",St),document.removeEventListener("touchmove",Ct),document.removeEventListener("touchend",jt)};return mt?(document.addEventListener("mousemove",Mt),document.addEventListener("mouseup",St),document.addEventListener("touchmove",Ct),document.addEventListener("touchend",jt)):(t(),V()),function(){t()}}),[mt]);var yt=m((function(t,e,i){ht.current="onResize Event";var n=i.clientWidth,o=i.clientHeight,a=ut,r=vt;"right"===e?T?r=I(L-n/at.width*(L-E)):a=I(E+n/at.width*(L-E)):"left"===e?T?a=I(E+n/at.width*(L-E)):r=I(L-n/at.width*(L-E)):"bottom"===e?T?r=I(L-o/at.height*(L-E)):a=I(E+o/at.height*(L-E)):"top"===e&&(T?a=I(E+o/at.height*(L-E)):r=I(L-o/at.height*(L-E))),a=Math.min(a,vt),r=Math.max(r,ut),lt([a,r]),W([a,r])})),Ht=m((function(){ht.current=null,V()})),zt=function(t,e){ht.current={xPos:t,yPos:e,head:ut,tail:vt}},xt=function(t,e){if(ht.current){var i=void 0;nt?i=(ht.current.xPos-t)/at.width*(L-E):ot&&(i=(ht.current.yPos-e)/at.height*(L-E));var n=ht.current.head-i*(T?-1:1),o=ht.current.tail-i*(T?-1:1),a=ht.current.tail-ht.current.head,r=void 0,d=void 0;n<=E?(r=E,d=E+a):o>=L?(r=L-a,d=L):(r=n,d=o),r=I(r),d=I(d),lt([r,d]),W([r,d])}},Mt=m((function(t){xt(t.clientX,t.clientY)})),St=m((function(){ht.current=null,ct(!1)})),Ct=m((function(t){xt(t.touches[0].pageX,t.touches[0].pageY)})),jt=m((function(){ht.current=null,ct(!1)})),Et=m((function(t){lt([t,vt]),W([t,vt]),V()})),Lt=m((function(t){lt([ut,t]),W([ut,t]),V()})),Nt=d((function(){return(vt-ut)/(L-E)*(ot?at.height:at.width)<30}),[E,L,ut,vt]),Rt=d((function(){return(vt-ut)/(L-E)*(ot?at.height:at.width)<w}),[E,L,ut,vt]),Wt=d((function(){var t=ot?at.height:at.width,e=t/(L-E),i=function(t){return(t-E)*e},n=i(ut),o=t-i(vt);return{isLeftArrowInvisible:T?o<b:n<b,isRightArrowInvisible:T?n<b:o<b,distance:(vt-ut)/(L-E)*t-(ot?y:H)}}),[E,L,ut,vt,T]),_t=function(t){var n={min:E,max:vt,value:ut,onChange:Et},o={min:ut,max:L,value:vt,onChange:Lt};return"head"===t?i(c,e({"data-testid":"".concat(M,"_handle_top"),placement:"head",dimension:U,readOnly:!X,isInsideArrowsVisible:Rt,arrowsOutsideConfig:Wt,displayFormatter:O,orientation:B,classes:G,minimal:K},T?o:n)):"tail"===t?i(c,e({"data-testid":"".concat(M,"_handle_bottom"),placement:"tail",dimension:U,readOnly:!X,isInsideArrowsVisible:Rt,arrowsOutsideConfig:Wt,displayFormatter:O,orientation:B,classes:G,minimal:K},T?n:o)):null};return i("div",{className:s(tt.rootWrapper,tt["".concat(B,"-").concat(U)],(S={},S[tt.rootMinimal]=K,S)),children:n("div",{className:s(tt.root,(C={},C[tt.horizontalRoot]=nt,C[tt.verticalRoot]=ot,C[tt.minimal]=K,C)),children:[i(l,{className:tt.resizable,ref:et,minHeight:0,minWidth:0,maxWidth:T?gt:pt,maxHeight:T?bt:wt,enable:{right:nt,bottom:ot},handleComponent:{right:_t("head"),bottom:_t("head")},onResize:yt,onResizeStop:Ht}),i("div",{className:tt.body,"data-testid":"slider-body",onMouseDown:function(t){zt(t.clientX,t.clientY),ct(!0)},onTouchStart:function(t){zt(t.touches[0].pageX,t.touches[0].pageY),ct(!0)},children:i("div",Nt?{className:s((j={},j[tt.horizontalBodyHandle]=nt,j[tt.verticalBodyHandle]=ot,j[tt.leftBodyHandle]="left"===k,j[tt.rightBodyHandle]="right"===k,j[tt.topBodyHandle]="top"===k,j[tt.bottomBodyHandle]="bottom"===k,j)),children:i("div",{className:tt.bodyHandle,"data-testid":"".concat(M,"_handle"),children:i(u,{orientation:"vertical",minimal:K})})}:{className:tt.bodyHandleIcon,"data-testid":"".concat(M,"_handle"),children:i(u,{orientation:B,minimal:K})})}),i(l,{className:tt.resizable,ref:it,minHeight:0,minWidth:0,enable:{left:nt,top:ot},handleComponent:{left:_t("tail"),top:_t("tail")},onResize:yt,onResizeStop:Ht})]})})},C=h({monitorWidth:!0,monitorHeight:!0})(S);export{S as AdvancedSlider,C as default};
1
+ import{__rest as t,__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useRef as o,useState as a,useEffect as r,useMemo as d}from"react";import{Resizable as l}from"re-resizable";import{withSize as s}from"react-sizeme";import h from"classnames";import{useThrottledCallback as m}from"../shared/useThrottledCallback.js";import{Handle as c}from"./Handle.js";import{HandleIcon as u}from"./icons/HandleIcon.js";import{getSizedControls as v}from"./utils.js";import{useSliderStyles as f}from"./styles/sliderStyles.js";import"./styles/handleStyles.js";import{INPUT_WIDTH as p,INPUT_HEIGHT as g,INNER_GAP as w,MIN_ARROW_GAP as b,HORIZONTAL_ORIENTATION as y,VERTICAL_ORIENTATION as H,VERTICAL_MIN_GAP as z,HORIZONTAL_MIN_GAP as x}from"./constants.js";var M="twoValuesSliderDefault",S=function(s){var S,C,j,E=s.min,L=s.max,N=s.value,R=s.onChange,W=void 0===R?function(){}:R,F=s.orientation,_=void 0===F?y:F,B=s.valueFormatter,I=void 0===B?Math.floor:B,P=s.displayFormatter,O=void 0===P?function(t){return t}:P,A=s.editableHandles,X=void 0===A||A,Y=s.onStop,V=void 0===Y?function(){}:Y,D=s.reversed,T=void 0!==D&&D,k=s.handlePosition,q=s.handleClasses,G=void 0===q?{}:q,J=s.minimal,K=void 0!==J&&J,Q=s.dimension,U=void 0===Q?"small":Q,Z=t(s,["min","max","value","onChange","orientation","valueFormatter","displayFormatter","editableHandles","onStop","reversed","handlePosition","handleClasses","minimal","dimension"]).size,$=void 0===Z?{}:Z,tt=f(),et=o(null),it=o(null),nt=_===y,ot=_===H,at=K?$:e(e({},$),{width:nt?$.width-2*p:$.width,height:ot?$.height-2*g:$.height}),rt=a([I(null==N?void 0:N.at(0)),I(null==N?void 0:N.at(1))]),dt=rt[0],lt=rt[1],st=o(null),ht=a(!1),mt=ht[0],ct=ht[1],ut=dt[0],vt=dt[1],ft=v({isHorizontalOrientation:nt,size:at,max:L,min:E,tail:vt,head:ut}),pt=ft.headMaxWidth,gt=ft.tailMaxWidth,wt=ft.headMaxHeight,bt=ft.tailMaxHeight;r((function(){if(!st.current){var t=[I(null==N?void 0:N.at(0)),I(null==N?void 0:N.at(1))],e=Math.min.apply(Math,t),i=Math.max.apply(Math,t);lt([e,i])}}),[null==N?void 0:N.at(0),null==N?void 0:N.at(1)]),r((function(){if(nt){var t=at.width/(L-E)*(ut-E),e=at.width/(L-E)*(L-vt);et.current.updateSize({width:T?e:t,height:at.height}),it.current.updateSize({width:T?t:e,height:at.height})}else if(ot){var i=at.height/(L-E)*(ut-E),n=at.height/(L-E)*(L-vt);et.current.updateSize({width:at.width,height:T?n:i}),it.current.updateSize({width:at.width,height:T?i:n})}}),[E,L,ut,vt,at.width,at.height,_]),r((function(){var t=function(){document.removeEventListener("mousemove",Mt),document.removeEventListener("mouseup",St),document.removeEventListener("touchmove",Ct),document.removeEventListener("touchend",jt)};return mt?(document.addEventListener("mousemove",Mt),document.addEventListener("mouseup",St),document.addEventListener("touchmove",Ct),document.addEventListener("touchend",jt)):(t(),V()),function(){t()}}),[mt]);var yt=m((function(t,e,i){st.current="onResize Event";var n=i.clientWidth,o=i.clientHeight,a=ut,r=vt;"right"===e?T?r=I(L-n/at.width*(L-E)):a=I(E+n/at.width*(L-E)):"left"===e?T?a=I(E+n/at.width*(L-E)):r=I(L-n/at.width*(L-E)):"bottom"===e?T?r=I(L-o/at.height*(L-E)):a=I(E+o/at.height*(L-E)):"top"===e&&(T?a=I(E+o/at.height*(L-E)):r=I(L-o/at.height*(L-E))),a=Math.min(a,vt),r=Math.max(r,ut),lt([a,r]),W([a,r])})),Ht=m((function(){st.current=null,V()})),zt=function(t,e){st.current={xPos:t,yPos:e,head:ut,tail:vt}},xt=function(t,e){if(st.current){var i=void 0;nt?i=(st.current.xPos-t)/at.width*(L-E):ot&&(i=(st.current.yPos-e)/at.height*(L-E));var n=st.current.head-i*(T?-1:1),o=st.current.tail-i*(T?-1:1),a=st.current.tail-st.current.head,r=void 0,d=void 0;n<=E?(r=E,d=E+a):o>=L?(r=L-a,d=L):(r=n,d=o),r=I(r),d=I(d),lt([r,d]),W([r,d])}},Mt=m((function(t){xt(t.clientX,t.clientY)})),St=m((function(){st.current=null,ct(!1)})),Ct=m((function(t){xt(t.touches[0].pageX,t.touches[0].pageY)})),jt=m((function(){st.current=null,ct(!1)})),Et=m((function(t){lt([t,vt]),W([t,vt]),V()})),Lt=m((function(t){lt([ut,t]),W([ut,t]),V()})),Nt=d((function(){return(vt-ut)/(L-E)*(ot?at.height:at.width)<30}),[E,L,ut,vt]),Rt=d((function(){return(vt-ut)/(L-E)*(ot?at.height:at.width)<w}),[E,L,ut,vt]),Wt=d((function(){var t=ot?at.height:at.width,e=t/(L-E),i=function(t){return(t-E)*e},n=i(ut),o=t-i(vt),a=(vt-ut)/(L-E)*t-(ot?z:x);return{isLeftArrowInvisible:T?o<b:n<b,isRightArrowInvisible:T?n<b:o<b,distance:Number.isFinite(a)?a:0}}),[E,L,ut,vt,T]),Ft=function(t){var n={min:E,max:vt,value:ut,onChange:Et},o={min:ut,max:L,value:vt,onChange:Lt};return"head"===t?i(c,e({"data-testid":"".concat(M,"_handle_top"),placement:"head",dimension:U,readOnly:!X,isInsideArrowsVisible:Rt,arrowsOutsideConfig:Wt,displayFormatter:O,orientation:_,classes:G,minimal:K},T?o:n)):"tail"===t?i(c,e({"data-testid":"".concat(M,"_handle_bottom"),placement:"tail",dimension:U,readOnly:!X,isInsideArrowsVisible:Rt,arrowsOutsideConfig:Wt,displayFormatter:O,orientation:_,classes:G,minimal:K},T?n:o)):null};return i("div",{className:h(tt.rootWrapper,tt["".concat(_,"-").concat(U)],(S={},S[tt.rootMinimal]=K,S)),children:n("div",{className:h(tt.root,(C={},C[tt.horizontalRoot]=nt,C[tt.verticalRoot]=ot,C[tt.minimal]=K,C)),children:[i(l,{className:tt.resizable,ref:et,minHeight:0,minWidth:0,maxWidth:T?gt:pt,maxHeight:T?bt:wt,enable:{right:nt,bottom:ot},handleComponent:{right:Ft("head"),bottom:Ft("head")},onResize:yt,onResizeStop:Ht}),i("div",{className:tt.body,"data-testid":"slider-body",onMouseDown:function(t){zt(t.clientX,t.clientY),ct(!0)},onTouchStart:function(t){zt(t.touches[0].pageX,t.touches[0].pageY),ct(!0)},children:i("div",Nt?{className:h((j={},j[tt.horizontalBodyHandle]=nt,j[tt.verticalBodyHandle]=ot,j[tt.leftBodyHandle]="left"===k,j[tt.rightBodyHandle]="right"===k,j[tt.topBodyHandle]="top"===k,j[tt.bottomBodyHandle]="bottom"===k,j)),children:i("div",{className:tt.bodyHandle,"data-testid":"".concat(M,"_handle"),children:i(u,{orientation:"vertical",minimal:K})})}:{className:tt.bodyHandleIcon,"data-testid":"".concat(M,"_handle"),children:i(u,{orientation:_,minimal:K})})}),i(l,{className:tt.resizable,ref:it,minHeight:0,minWidth:0,enable:{left:nt,top:ot},handleComponent:{left:Ft("tail"),top:Ft("tail")},onResize:yt,onResizeStop:Ht})]})})},C=s({monitorWidth:!0,monitorHeight:!0})(S);export{S as AdvancedSlider,C as default};
2
2
  //# sourceMappingURL=AdvancedSlider.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "3.40.0-0",
3
+ "version": "3.40.0-2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Shared components/utils for Corva ui projects",
6
6
  "keywords": [