rbro-tat-uds 1.5.9 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1386,7 +1386,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[i2]+=1);const ft=e=>l.createE
1386
1386
  `,u7=S.div`
1387
1387
  flex: 1;
1388
1388
  height: 100%;
1389
- cursor: pointer;
1389
+ cursor: ${({$disabled:e})=>e?"default":"pointer"};
1390
1390
  display: flex;
1391
1391
  align-items: center;
1392
1392
  justify-content: center;
@@ -1397,7 +1397,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[i2]+=1);const ft=e=>l.createE
1397
1397
  flex: 1;
1398
1398
  border-radius: 2px;
1399
1399
  background: ${t.gray_60};
1400
- cursor: pointer;
1400
+ cursor: ${({$disabled:e})=>e?"default":"pointer"};
1401
1401
  position: relative;
1402
1402
  outline: none;
1403
1403
 
@@ -1405,7 +1405,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[i2]+=1);const ft=e=>l.createE
1405
1405
  position: absolute;
1406
1406
  left: 0;
1407
1407
  height: 100%;
1408
- background-color: ${t.info_700};
1408
+ background-color: ${({$disabled:e})=>e?t.gray_300:t.info_700};
1409
1409
  border-radius: inherit;
1410
1410
 
1411
1411
  & > span {
@@ -1422,7 +1422,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[i2]+=1);const ft=e=>l.createE
1422
1422
  }
1423
1423
  }
1424
1424
  }
1425
- `,g7=({id:e,name:n,value:o=0,setValue:i,min:a=0,max:s=100,showSteppers:h=!1,stepSize:d=1,disabled:C=!1,height:u=32,wrapperWidth:x,...b})=>{const f=y.useRef(null),[_,m]=y.useState(!1),M=y.useCallback(v=>{var T,w;const W=(T=f.current)==null?void 0:T.getBoundingClientRect();if(W){let A;if("touches"in v?A=(w=v.touches[0])==null?void 0:w.clientX:"clientX"in v&&(A=v.clientX),A!==void 0){const F=A-W.left,g=W.width,j=F/g*(s-a)+a;let P=Math.round(j/d)*d;P=Math.max(a,P),P=Math.min(s,P),i&&i(P)}}},[s,a,i,d]),$=v=>{if(v==="minus"){if(o===a)return;if(o-d<a){i&&i(a);return}i&&i(o-d)}else{if(o===s)return;if(o+d>s){i&&i(s);return}i&&i(o+d)}},R=y.useCallback(()=>{i&&i(o),m(!1)},[o,i]),Z=y.useCallback(v=>{_&&M(v)},[_,M]),V=v=>{M(v),m(!0)},D=v=>{m(!0),M(v)},k=y.useCallback(v=>{M(v)},[M]),E=y.useCallback(()=>{i&&i(o),m(!1)},[o,i]);return y.useEffect(()=>(_&&(window.addEventListener("mousemove",Z),window.addEventListener("mouseup",R),window.addEventListener("touchmove",k,{passive:!0}),window.addEventListener("touchend",E)),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",R),window.removeEventListener("touchmove",k),window.removeEventListener("touchend",E)}),[_,Z,R,E,k]),r.jsxs(C7,{$height:u,$showSteppers:h,$disabled:C,$wrapperWidth:x,children:[h&&r.jsx(b1,{disabled:C,icon:"minus",intent:"info",variant:"secondaryOutlined",size:"small",shape:"circle",onClick:()=>$("minus")}),r.jsx(u7,{$disabled:C,ref:f,role:"slider",id:e,"aria-label":n,tabIndex:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":o,onMouseDown:V,onTouchStart:D,...b,children:r.jsx("div",{children:r.jsx("div",{style:{width:`${(o-a)/(s-a)*100}%`},children:r.jsx("span",{style:{cursor:_?"grabbing":"grab",right:`${(o-a)/(s-a)*100*.32-32}px`}})})})}),h&&r.jsx(b1,{disabled:C,icon:"add",intent:"info",variant:"secondaryOutlined",size:"small",shape:"circle",onClick:()=>$("add")})]})},x7=S.div`
1425
+ `,g7=({id:e,name:n,value:o=0,setValue:i,min:a=0,max:s=100,showSteppers:h=!1,stepSize:d=1,disabled:C=!1,height:u=32,wrapperWidth:x,...b})=>{const f=y.useRef(null),[_,m]=y.useState(!1),M=y.useCallback(v=>{var T,w;const W=(T=f.current)==null?void 0:T.getBoundingClientRect();if(W){let A;if("touches"in v?A=(w=v.touches[0])==null?void 0:w.clientX:"clientX"in v&&(A=v.clientX),A!==void 0){const F=A-W.left,g=W.width,j=F/g*(s-a)+a;let P=Math.round(j/d)*d;P=Math.max(a,P),P=Math.min(s,P),i&&i(P)}}},[s,a,i,d]),$=v=>{if(v==="minus"){if(o===a)return;if(o-d<a){i&&i(a);return}i&&i(o-d)}else{if(o===s)return;if(o+d>s){i&&i(s);return}i&&i(o+d)}},R=y.useCallback(()=>{i&&i(o),m(!1)},[o,i]),Z=y.useCallback(v=>{_&&M(v)},[_,M]),V=v=>{C||(M(v),m(!0))},D=v=>{m(!0),M(v)},k=y.useCallback(v=>{M(v)},[M]),E=y.useCallback(()=>{i&&i(o),m(!1)},[o,i]);return y.useEffect(()=>{if(!C)return _&&(window.addEventListener("mousemove",Z),window.addEventListener("mouseup",R),window.addEventListener("touchmove",k,{passive:!0}),window.addEventListener("touchend",E)),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",R),window.removeEventListener("touchmove",k),window.removeEventListener("touchend",E)}},[_,Z,R,E,k]),r.jsxs(C7,{$height:u,$showSteppers:h,$disabled:C,$wrapperWidth:x,children:[h&&r.jsx(b1,{disabled:C,icon:"minus",intent:"info",variant:"secondaryOutlined",size:"small",shape:"circle",onClick:()=>$("minus")}),r.jsx(u7,{$disabled:C,ref:f,role:"slider",id:e,"aria-label":n,tabIndex:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":o,onMouseDown:V,onTouchStart:D,...b,children:r.jsx("div",{children:r.jsx("div",{style:{width:`${(o-a)/(s-a)*100}%`},children:r.jsx("span",{style:{cursor:C?"default":_?"grabbing":"grab",right:`${(o-a)/(s-a)*100*.32-32}px`}})})})}),h&&r.jsx(b1,{disabled:C,icon:"add",intent:"info",variant:"secondaryOutlined",size:"small",shape:"circle",onClick:()=>$("add")})]})},x7=S.div`
1426
1426
  display: flex;
1427
1427
  flex-direction: column;
1428
1428
  width: 100%;