kwant-ui 3.51.0-dev.7 → 3.51.0-dev.8

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.es.js CHANGED
@@ -4726,7 +4726,7 @@ object-assign
4726
4726
  font-size: 1rem;
4727
4727
  font-weight: 500;
4728
4728
  color: ${e=>e.theme.primary.primary90};
4729
- `,PT=[{label:"AM",value:"AM"},{label:"PM",value:"PM"}];function OT({label:r,disabled:a=!1,tooltipContent:c,tooltipPosition:l,format:i="12",onChange:o,onBlur:s,value:h="00:00",required:v,id:p,period:g="AM",onlyHours:m=!1}){const[d,_]=u(m?h.split(":")[0]||"00":h),[w,b]=u(!1),[x,y]=u(g??"AM"),M="24"===i,E=f((e,t)=>{const n=M?23:12,r=M?0:1;return{hours:Math.min(Math.max(e,r),n),minutes:Math.min(Math.max(t,0),59)}},[M]);return t(n,{children:[t(Ke,{color:a?V.grey.grey400:V.grey.grey900,children:[v&&e(We,{disabled:a,children:"*"}),r,c&&e(Ge,{children:e(we,{tooltipContent:()=>c,position:l,offset:"10px",top:"8px",children:e(nt,{icon:"info",width:16,height:16,fill:V.grey.grey400})})})]}),t(_T,{children:[t(bT,{onlyHours:m,children:[e(wT,{id:p,type:"text",value:d,onChange:e=>{let t=e.target.value,n=!1;if(m){const r=e.target.value.replace(/[^\d]/g,"").slice(0,2);if(r.length<=2){const e=parseInt(r);(""===r||e>=(M?0:1)&&e<=(M?23:12))&&(_(r),t=r,n=!0)}}else{let r=e.target.value.replace(/[^\d:]/g,"");if(/^\d{2}$/.test(r)&&(r+=":"),r.length<=5){const[e="",a=""]=r.split(":");if(e.length<=2){const c=parseInt(e)||0;(""===e||c>=(M?0:1)&&c<=(M?23:12))&&(""===a||a.length<=2&&parseInt(a)<=59)&&(_(r),t=r,n=!0)}}}if(n&&o){const e={time:t};M||(e.period=x),o(e)}},onBlur:e=>{if(m){const e=parseInt(d)||(M?0:1),t=M?23:12,n=M?0:1,r=Math.min(Math.max(e,n),t).toString().padStart(2,"0");_(r)}else{const[e="",t=""]=d.split(":"),n=parseInt(e)||(M?0:1),r=parseInt(t)||0,{hours:a,minutes:c}=E(n,r),l=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;_(l)}s&&s(e)},placeholder:m?"00":"00:00",disabled:a,format:i,onlyHours:m}),m&&t(n,{children:[e(xT,{children:":"}),e(yT,{children:"00"})]})]}),!M&&t(MT,{children:[t(ET,{onClick:()=>{b(!w)},children:[e(HT,{children:x}),e(_r,{isOpened:w,children:br})]}),e(cn,{opened:w,data:PT,width:"80px",offsetRight:"0px",offsetTop:"50px",isDynamicOptionPosition:!0,selectedValue:x,onClose:()=>b(!1),onSelect:e=>{if(("AM"===e?.value||"PM"===e?.value)&&(y(e.value),o)){const t={time:d};M||(t.period=e.value),o(t)}},showScrollbar:!1,searchable:!1})]})]})]})}const zT=r.div`
4729
+ `,PT=[{label:"AM",value:"AM"},{label:"PM",value:"PM"}];function OT({label:r,disabled:a=!1,tooltipContent:c,tooltipPosition:l,format:i="12",onChange:o,onBlur:s,value:h="00:00",required:v,id:p,period:g="AM",onlyHours:m=!1}){const[d,_]=u(m?h.split(":")[0]||"00":h),[w,b]=u(!1),[x,y]=u(g??"AM"),M="24"===i,E=f((e,t)=>{const n=M?23:12,r=M?0:1;return{hours:Math.min(Math.max(e,r),n),minutes:Math.min(Math.max(t,0),59)}},[M]);return t(n,{children:[t(Ke,{color:a?V.grey.grey400:V.grey.grey900,children:[v&&e(We,{disabled:a,children:"*"}),r,c&&e(Ge,{children:e(we,{tooltipContent:()=>c,position:l,offset:"10px",top:"8px",children:e(nt,{icon:"info",width:16,height:16,fill:V.grey.grey400})})})]}),t(_T,{children:[t(bT,{onlyHours:m,children:[e(wT,{id:p,type:"text",value:d,onChange:e=>{let t=e.target.value,n=!1;if(""===e.target.value)_(""),t="",n=!0;else if(m){const r=e.target.value.replace(/[^\d]/g,"").slice(0,2);if(r.length<=2){const e=parseInt(r),a=M?23:12;(""===r||1===r.length||!isNaN(e)&&e>=0&&e<=a)&&(_(r),t=r,n=!0)}}else{let r=e.target.value.replace(/[^\d:]/g,"");if(/^\d{2}$/.test(r)&&(r+=":"),r.length<=5){const[e="",a=""]=r.split(":");if(e.length<=2){const c=parseInt(e),l=M?23:12;if(""===e||1===e.length||!isNaN(c)&&c>=0&&c<=l){(""===a||a.length<=2&&(1===a.length||parseInt(a)<=59))&&(_(r),t=r,n=!0)}}}}if(n&&o){const e={time:t};M||(e.period=x),o(e)}},onBlur:e=>{if(""!==d){if(m){const e=parseInt(d)||(M?0:1),t=M?23:12,n=M?0:1,r=Math.min(Math.max(e,n),t).toString().padStart(2,"0");_(r)}else{const[e="",t=""]=d.split(":"),n=parseInt(e)||(M?0:1),r=parseInt(t)||0,{hours:a,minutes:c}=E(n,r),l=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;_(l)}s&&s(e)}else s&&s(e)},placeholder:m?"HH":"HH:MM",disabled:a,format:i,onlyHours:m}),m&&t(n,{children:[e(xT,{children:":"}),e(yT,{children:"00"})]})]}),!M&&t(MT,{children:[t(ET,{onClick:()=>{b(!w)},children:[e(HT,{children:x}),e(_r,{isOpened:w,children:br})]}),e(cn,{opened:w,data:PT,width:"80px",offsetRight:"0px",offsetTop:"50px",isDynamicOptionPosition:!0,selectedValue:x,onClose:()=>b(!1),onSelect:e=>{if(("AM"===e?.value||"PM"===e?.value)&&(y(e.value),o)){const t={time:d};M||(t.period=e.value),o(t)}},showScrollbar:!1,searchable:!1})]})]})]})}const zT=r.div`
4730
4730
  display: flex;
4731
4731
  align-items: center;
4732
4732
  justify-content: center;