kwant-ui 3.38.4-stable.13 → 3.38.4-stable.14

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
@@ -4712,7 +4712,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
4712
4712
  font-size: 1rem;
4713
4713
  font-weight: 500;
4714
4714
  color: ${e=>e.theme.primary.primary90};
4715
- `,HW=[{label:"AM",value:"AM"},{label:"PM",value:"PM"}];function PW({label:n,disabled:a=!1,tooltipContent:c,tooltipPosition:i,format:o="12",onChange:s,onBlur:l,value:h="00:00",required:v,id:u,period:g="AM",onlyHours:m=!1}){const[d,f]=p(m?h.split(":")[0]||"00":h),[_,b]=p(!1),[y,x]=p(g??"AM"),Z="24"===o,O=w(((e,t)=>{const r=Z?23:12,n=Z?0:1;return{hours:Math.min(Math.max(e,n),r),minutes:Math.min(Math.max(t,0),59)}}),[Z]);return t(r,{children:[t(Ge,{color:a?A.grey.grey400:A.grey.grey900,children:[v&&e(Ke,{disabled:a,children:"*"}),n,c&&e(Je,{children:e(be,{tooltipContent:()=>c,position:i,offset:"10px",top:"8px",children:e(nt,{icon:"info",width:16,height:16,fill:A.grey.grey400})})})]}),t(wW,{children:[t(yW,{onlyHours:m,children:[e(bW,{id:u,type:"text",value:d,onChange:e=>{if(!Z&&"0"===e.target.value)return;let t=e.target.value,r=!1;if(""===e.target.value)f(""),t="",r=!0;else if(m){const n=e.target.value.replace(/[^\d]/g,"").slice(0,2);if(n.length<=2){const e=parseInt(n),a=Z?23:12;(""===n||1===n.length||!isNaN(e)&&e>=0&&e<=a)&&(f(n),t=n,r=!0)}}else{let n=e.target.value.replace(/[^\d:]/g,"");if(/^\d{2}$/.test(n)&&(n+=":"),n.length<=5){const[e="",a=""]=n.split(":");if(e.length<=2){const c=parseInt(e),i=Z?23:12;if(""===e||1===e.length||!isNaN(c)&&c>=0&&c<=i){(""===a||a.length<=2&&(1===a.length||parseInt(a)<=59))&&(f(n),t=n,r=!0)}}}}if(r&&s){const e={time:t};Z||(e.period=y),s(e)}},onBlur:e=>{if(""!==d){if(m&&Z){const e=parseInt(d)||(Z?0:1),t=Z?23:12,r=Z?0:1,n=Math.min(Math.max(e,r),t).toString().padStart(2,"0");f(n)}if(Z){const[e="",t=""]=d.split(":"),r=parseInt(e)||(Z?0:1),n=parseInt(t)||0,{hours:a,minutes:c}=O(r,n),i=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;f(i)}l&&l(e)}else l&&l(e)},placeholder:m&&!Z?"H":"HH:MM",disabled:a,format:o,onlyHours:m}),m&&t(r,{children:[e(xW,{children:":"}),e(ZW,{children:"00"})]})]}),!Z&&t(OW,{children:[t(MW,{onClick:()=>{b(!_)},children:[e(EW,{children:y}),e(bn,{isOpened:_,children:xn})]}),e(or,{opened:_,data:HW,width:"80px",offsetRight:"0px",offsetTop:"50px",isDynamicOptionPosition:!0,selectedValue:y,onClose:()=>b(!1),onSelect:e=>{if(("AM"===e?.value||"PM"===e?.value)&&(x(e.value),s)){const t={time:d};Z||(t.period=e.value),s(t)}},showScrollbar:!1,searchable:!1})]})]})]})}const jW=n.div`
4715
+ `,HW=[{label:"AM",value:"AM"},{label:"PM",value:"PM"}];function PW({label:n,disabled:a=!1,tooltipContent:c,tooltipPosition:i,format:o="12",onChange:s,onBlur:l,value:h="00:00",required:v,id:u,period:g="AM",onlyHours:m=!1}){const[d,f]=p(m?h.split(":")[0]||"00":h),[_,b]=p(!1),[y,x]=p(g??"AM"),Z="24"===o,O=w(((e,t)=>{const r=Z?23:12,n=Z?0:1;return{hours:Math.min(Math.max(e,n),r),minutes:Math.min(Math.max(t,0),59)}}),[Z]);return t(r,{children:[t(Ge,{color:a?A.grey.grey400:A.grey.grey900,children:[v&&e(Ke,{disabled:a,children:"*"}),n,c&&e(Je,{children:e(be,{tooltipContent:()=>c,position:i,offset:"10px",top:"8px",children:e(nt,{icon:"info",width:16,height:16,fill:A.grey.grey400})})})]}),t(wW,{children:[t(yW,{onlyHours:m,children:[e(bW,{id:u,type:"text",value:d,onChange:e=>{if(!Z&&"0"===e.target.value)return;let t=e.target.value,r=!1;if(""===e.target.value)f(""),t="",r=!0;else if(m){const n=e.target.value.replace(/[^\d]/g,"").slice(0,2);if(n.length<=2){const e=parseInt(n),a=Z?23:12;(""===n||1===n.length||!isNaN(e)&&e>=0&&e<=a)&&(f(n),t=n,r=!0)}}else{let n=e.target.value.replace(/[^\d:]/g,"");if(/^\d{2}$/.test(n)&&(n+=":"),n.length<=5){const[e="",a=""]=n.split(":");if(e.length<=2){const c=parseInt(e),i=Z?23:12;if(""===e||1===e.length||!isNaN(c)&&c>=0&&c<=i){(""===a||a.length<=2&&(1===a.length||parseInt(a)<=59))&&(f(n),t=n,r=!0)}}}}if(r&&s){const e={time:t};Z||(e.period=y),s(e)}},onBlur:e=>{if(""!==d){if(m&&Z){const e=parseInt(d)||(Z?0:1),t=Z?23:12,r=Z?0:1,n=Math.min(Math.max(e,r),t).toString().padStart(2,"0");f(n)}if(Z){const[e="",t=""]=d.split(":"),r=parseInt(e)||(Z?0:1),n=parseInt(t)||0,{hours:a,minutes:c}=O(r,n),i=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;f(i)}l&&l(e)}else l&&l(e)},placeholder:m&&!Z?"00":"HH:MM",disabled:a,format:o,onlyHours:m}),m&&t(r,{children:[e(xW,{children:":"}),e(ZW,{children:"00"})]})]}),!Z&&t(OW,{children:[t(MW,{onClick:()=>{b(!_)},children:[e(EW,{children:y}),e(bn,{isOpened:_,children:xn})]}),e(or,{opened:_,data:HW,width:"80px",offsetRight:"0px",offsetTop:"50px",isDynamicOptionPosition:!0,selectedValue:y,onClose:()=>b(!1),onSelect:e=>{if(("AM"===e?.value||"PM"===e?.value)&&(x(e.value),s)){const t={time:d};Z||(t.period=e.value),s(t)}},showScrollbar:!1,searchable:!1})]})]})]})}const jW=n.div`
4716
4716
  display: flex;
4717
4717
  column-gap: 2px;
4718
4718
  ${({danger:e,color:t})=>e?a`