lizaui 8.0.3 → 8.0.5
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/calendar/index.cjs.js +10 -10
- package/dist/calendar/index.cjs.js.map +1 -1
- package/dist/calendar/index.es.js +1710 -524
- package/dist/calendar/index.es.js.map +1 -1
- package/dist/chunks/{styled-components.browser.esm-C7xt3djl.js → styled-components.browser.esm-CxZkQVdi.js} +732 -702
- package/dist/chunks/styled-components.browser.esm-CxZkQVdi.js.map +1 -0
- package/dist/chunks/styled-components.browser.esm-M-8MrVJR.js +49 -0
- package/dist/chunks/styled-components.browser.esm-M-8MrVJR.js.map +1 -0
- package/dist/time-input/index.cjs.js +1 -1
- package/dist/time-input/index.es.js +18 -18
- package/package.json +1 -1
- package/dist/chunks/styled-components.browser.esm-C7xt3djl.js.map +0 -1
- package/dist/chunks/styled-components.browser.esm-CDXyhBVL.js +0 -49
- package/dist/chunks/styled-components.browser.esm-CDXyhBVL.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../chunks/jsx-runtime-DZW6kfQG.js"),p=require("react"),Ke=require("react-dom"),pe=require("clsx"),l=require("../chunks/styled-components.browser.esm-CDXyhBVL.js"),Ge=require("../chunks/utils-IjLH3w2e.js");require("../chunks/textarea-99dejq_o.js");const Ue=require("../chunks/label-error-wbavGDVw.js");require("../chunks/button-CGIs6rx_.js");function Le(e){var t=e.angle,n=t===void 0?0:t,i=e.name,s=e.length,u=s===void 0?100:s,a=e.oppositeLength,c=a===void 0?10:a,d=e.width,h=d===void 0?1:d;return o.jsxRuntimeExports.jsx("div",{className:"react-clock__hand react-clock__".concat(i,"-hand"),style:{transform:"rotate(".concat(n,"deg)")},children:o.jsxRuntimeExports.jsx("div",{className:"react-clock__hand__body react-clock__".concat(i,"-hand__body"),style:{width:"".concat(h,"px"),top:"".concat(50-u/2,"%"),bottom:"".concat(50-c/2,"%")}})})}var Ce=p.memo(function(t){var n=t.angle,i=n===void 0?0:n,s=t.length,u=s===void 0?10:s,a=t.name,c=t.width,d=c===void 0?1:c;return o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark react-clock__".concat(a,"-mark"),style:{transform:"rotate(".concat(i,"deg)")},children:o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark__body react-clock__".concat(a,"-mark__body"),style:{width:"".concat(d,"px"),top:0,bottom:"".concat(100-u/2,"%")}})})}),Be=p.memo(function(t){var n=t.angle,i=n===void 0?0:n,s=t.length,u=s===void 0?10:s,a=t.name,c=t.number;return o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark react-clock__".concat(a,"-mark"),style:{transform:"rotate(".concat(i,"deg)")},children:o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark__number",style:{transform:"rotate(-".concat(i,"deg)"),top:"".concat(u/2,"%")},children:c})})});function Te(e,t){return t.toLocaleString(e||l.getUserLocale()||void 0)}function Je(e){return e!==null&&e!==!1&&!Number.isNaN(Number(e))}function Qe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Math.max.apply(Math,e.filter(Je))}function Xe(e){var t=e.className,n=e.formatHour,i=n===void 0?Te:n,s=e.hourHandLength,u=s===void 0?50:s,a=e.hourHandOppositeLength,c=e.hourHandWidth,d=c===void 0?4:c,h=e.hourMarksLength,v=h===void 0?10:h,x=e.hourMarksWidth,j=x===void 0?3:x,y=e.locale,w=e.minuteHandLength,M=w===void 0?70:w,b=e.minuteHandOppositeLength,H=e.minuteHandWidth,$=H===void 0?2:H,C=e.minuteMarksLength,A=C===void 0?6:C,T=e.minuteMarksWidth,J=T===void 0?1:T,K=e.renderHourMarks,O=K===void 0?!0:K,F=e.renderMinuteHand,G=F===void 0?!0:F,q=e.renderMinuteMarks,Q=q===void 0?!0:q,X=e.renderNumbers,re=e.renderSecondHand,Y=re===void 0?!0:re,z=e.secondHandLength,oe=z===void 0?90:z,se=e.secondHandOppositeLength,V=e.secondHandWidth,ee=V===void 0?1:V,U=e.size,L=U===void 0?150:U,W=e.useMillisecondPrecision,k=e.value;function ie(){if(!Q)return null;for(var E=[],_=1;_<=60;_+=1){var ne=O&&!(_%5);ne||E.push(o.jsxRuntimeExports.jsx(Ce,{angle:_*6,length:A,name:"minute",width:J},"minute_".concat(_)))}return E}function ue(){if(!O)return null;for(var E=[],_=1;_<=12;_+=1)E.push(o.jsxRuntimeExports.jsx(Ce,{angle:_*30,length:v,name:"hour",width:j},"hour_".concat(_)));return E}function P(){if(!X)return null;for(var E=[],_=1;_<=12;_+=1)E.push(o.jsxRuntimeExports.jsx(Be,{angle:_*30,length:Qe(O&&v,Q&&A,0),name:"number",number:i(y,_)},"number_".concat(_)));return E}function le(){return o.jsxRuntimeExports.jsxs("div",{className:"react-clock__face",children:[ie(),ue(),P()]})}function ae(){var E=k?l.getHours(k)*30+l.getMinutes(k)/2+l.getSeconds(k)/120+(W?l.getMilliseconds(k)/12e4:0):0;return o.jsxRuntimeExports.jsx(Le,{angle:E,length:u,name:"hour",oppositeLength:a,width:d})}function de(){if(!G)return null;var E=k?l.getHours(k)*360+l.getMinutes(k)*6+l.getSeconds(k)/10+(W?l.getMilliseconds(k)/1e4:0):0;return o.jsxRuntimeExports.jsx(Le,{angle:E,length:M,name:"minute",oppositeLength:b,width:$})}function te(){if(!Y)return null;var E=k?l.getMinutes(k)*360+l.getSeconds(k)*6+(W?l.getMilliseconds(k)*.006:0):0;return o.jsxRuntimeExports.jsx(Le,{angle:E,length:oe,name:"second",oppositeLength:se,width:ee})}return o.jsxRuntimeExports.jsxs("time",{className:pe("react-clock",t),dateTime:k instanceof Date?k.toLocaleTimeString("en",{hourCycle:"h23",hour:"2-digit",minute:G?"2-digit":void 0,second:Y?"2-digit":void 0}):k||void 0,style:{width:L,height:L},children:[le(),ae(),de(),te()]})}function Ye({children:e}){return o.jsxRuntimeExports.jsx("span",{className:"react-time-picker__inputGroup__divider",children:e})}function Ie(e,t){let n=Number(e);return t==="am"&&n===12?n=0:t==="pm"&&n<12&&(n+=12),n}function ce(e){return[Number(e)%12||12,Number(e)<12?"am":"pm"]}const Re=new Map;function Ae(e){return function(n,i){const s=n||l.getUserLocale();Re.has(s)||Re.set(s,new Map);const u=Re.get(s);return u.has(e)||u.set(e,new Intl.DateTimeFormat(s||void 0,e).format),u.get(e)(i)}}const He=new Map;function et(e){return(t,n)=>{const i=t||l.getUserLocale();He.has(i)||He.set(i,new Map);const s=He.get(i);return s.has(e)||s.set(e,new Intl.NumberFormat(i||void 0,e).format),s.get(e)(n)}}const tt=["9","٩"],Me=new RegExp(`[${tt.join("")}]`),Fe=Ae({hour:"numeric"});function Oe(e){const t=Fe(e,new Date(2017,0,1,9)),n=Fe(e,new Date(2017,0,1,21)),[i,s]=t.split(Me),[u,a]=n.split(Me);if(a!==void 0){if(i!==u)return[i,u].map(c=>c.trim());if(s!==a)return[s,a].map(c=>c.trim())}return["AM","PM"]}function We(e){return e!==null&&e!==!1&&!Number.isNaN(Number(e))}function be(...e){return Math.min(...e.filter(We))}function ke(...e){return Math.max(...e.filter(We))}function nt({ariaLabel:e,autoFocus:t,className:n,disabled:i,inputRef:s,locale:u,maxTime:a,minTime:c,onChange:d,onKeyDown:h,required:v,value:x}){const j=c?ce(l.getHours(c))[1]==="pm":!1,y=a?ce(l.getHours(a))[1]==="am":!1,w="amPm",[M,b]=Oe(u);return o.jsxRuntimeExports.jsxs("select",{"aria-label":e,autoFocus:t,className:pe(`${n}__input`,`${n}__${w}`),"data-input":"true","data-select":"true",disabled:i,name:w,onChange:d,onKeyDown:h,ref:s,required:v,value:x!==null?x:"",children:[!x&&o.jsxRuntimeExports.jsx("option",{value:"",children:"--"}),o.jsxRuntimeExports.jsx("option",{disabled:j,value:"am",children:M}),o.jsxRuntimeExports.jsx("option",{disabled:y,value:"pm",children:b})]})}const Se=typeof window<"u",rt=Se?p.useLayoutEffect:p.useEffect,ot=Se&&/(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent),st=Se&&/Firefox/.test(navigator.userAgent);function it(e){const{target:t}=e;ot?requestAnimationFrame(()=>t.select()):t.select()}function ut(e){if(document.readyState==="complete")return;function t(){l.updateInputWidth(e)}window.addEventListener("load",t)}function at(e){if(!document.fonts)return;const t=l.getFontShorthand(e);if(!t||document.fonts.check(t))return;function i(){l.updateInputWidth(e)}document.fonts.addEventListener("loadingdone",i)}function ct(e){if(e&&"selectionStart"in e&&e.selectionStart!==null&&"selectionEnd"in e&&e.selectionEnd!==null)return e.value.slice(e.selectionStart,e.selectionEnd);if("getSelection"in window){const t=window.getSelection();return t?.toString()}return null}function lt(e){if(e!==null)return function(n){if(st)return;const{key:i,target:s}=n,{value:u}=s,a=i.length===1&&/\d/.test(i),c=ct(s);(!a||!(c||u.length<e))&&n.preventDefault()}}function ve({ariaLabel:e,autoFocus:t,className:n,disabled:i,inputRef:s,max:u,min:a,name:c,nameForClass:d,onChange:h,onKeyDown:v,onKeyUp:x,placeholder:j="--",required:y,showLeadingZeros:w,step:M,value:b}){rt(()=>{!s||!s.current||(l.updateInputWidth(s.current),ut(s.current),at(s.current))},[s,b]);const H=w&&b&&Number(b)<10&&(b==="0"||!b.toString().startsWith("0")),$=u?u.toString().length:null;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[H?o.jsxRuntimeExports.jsx("span",{className:`${n}__leadingZero`,children:"0"}):null,o.jsxRuntimeExports.jsx("input",{"aria-label":e,autoComplete:"off",autoFocus:t,className:pe(`${n}__input`,`${n}__${d||c}`,H&&`${n}__input--hasLeadingZero`),"data-input":"true",disabled:i,inputMode:"numeric",max:u,min:a,name:c,onChange:h,onFocus:it,onKeyDown:v,onKeyPress:lt($),onKeyUp:C=>{l.updateInputWidth(C.target),x&&x(C)},placeholder:j,ref:s,required:y,step:M,type:"number",value:b!==null?b:""})]})}function dt({amPm:e,maxTime:t,minTime:n,value:i,...s}){const u=be(12,t&&(()=>{const[d,h]=ce(l.getHours(t));return h!==e?null:d})()),a=ke(1,n&&(()=>{const[d,h]=ce(l.getHours(n));return h!==e||d===12?null:d})()),c=i?ce(i)[0].toString():"";return o.jsxRuntimeExports.jsx(ve,{max:u,min:a,name:"hour12",nameForClass:"hour",value:c,...s})}function mt({maxTime:e,minTime:t,...n}){const i=be(23,e&&l.getHours(e)),s=ke(0,t&&l.getHours(t));return o.jsxRuntimeExports.jsx(ve,{max:i,min:s,name:"hour24",nameForClass:"hour",...n})}function pt({hour:e,maxTime:t,minTime:n,showLeadingZeros:i=!0,...s}){function u(d){return e===l.getHours(d).toString()}const a=be(59,t&&u(t)&&l.getMinutes(t)),c=ke(0,n&&u(n)&&l.getMinutes(n));return o.jsxRuntimeExports.jsx(ve,{max:a,min:c,name:"minute",showLeadingZeros:i,...s})}function ft({ariaLabel:e,disabled:t,maxTime:n,minTime:i,name:s,onChange:u,required:a,value:c,valueType:d}){const h=(()=>{switch(d){case"hour":return j=>`${l.getHours(j)}:00`;case"minute":return l.getHoursMinutes;case"second":return l.getHoursMinutesSeconds;default:throw new Error("Invalid valueType")}})(),v=(()=>{switch(d){case"hour":return 3600;case"minute":return 60;case"second":return 1;default:throw new Error("Invalid valueType")}})();function x(j){j.stopPropagation()}return o.jsxRuntimeExports.jsx("input",{"aria-label":e,disabled:t,hidden:!0,max:n?h(n):void 0,min:i?h(i):void 0,name:s,onChange:u,onFocus:x,required:a,step:v,style:{visibility:"hidden",position:"absolute",zIndex:"-999"},type:"time",value:c?h(c):""})}function ht({hour:e,maxTime:t,minTime:n,minute:i,showLeadingZeros:s=!0,...u}){function a(h){return e===l.getHours(h).toString()&&i===l.getMinutes(h).toString()}const c=be(59,t&&a(t)&&l.getSeconds(t)),d=ke(0,n&&a(n)&&l.getSeconds(n));return o.jsxRuntimeExports.jsx(ve,{max:c,min:d,name:"second",showLeadingZeros:s,...u})}const Pe={},gt=["hour","minute","second"];function xt(e){return e.dataset.input==="true"}function $e(e,t){let n=e;do n=n[t];while(n&&!xt(n));return n}function Ne(e){e&&e.focus()}function bt(e,t,n){const i=[],s=new RegExp(Object.keys(t).map(a=>`${a}+`).join("|"),"g"),u=e.match(s);return e.split(s).reduce((a,c,d)=>{const h=c&&o.jsxRuntimeExports.jsx(Ye,{children:c},`separator_${d}`);a.push(h);const v=u?.[d];if(v){const x=t[v]||t[Object.keys(t).find(j=>v.match(j))];if(!x)return a;!n&&i.includes(x)?a.push(v):(a.push(x(v,d)),i.push(x))}return a},[])}const xe=et({useGrouping:!1});function kt({amPmAriaLabel:e,autoFocus:t,className:n,disabled:i,format:s,hourAriaLabel:u,hourPlaceholder:a,isClockOpen:c=null,locale:d,maxDetail:h="minute",maxTime:v,minTime:x,minuteAriaLabel:j,minutePlaceholder:y,name:w="time",nativeInputAriaLabel:M,onChange:b,onInvalidChange:H,required:$,secondAriaLabel:C,secondPlaceholder:A,value:T}){const[J,K]=p.useState(null),[O,F]=p.useState(null),[G,q]=p.useState(null),[Q,X]=p.useState(null),[re,Y]=p.useState(null),z=p.useRef(null),oe=p.useRef(null),se=p.useRef(null),V=p.useRef(null),ee=p.useRef(null),[U,L]=p.useState(c),W=p.useRef(void 0);p.useEffect(()=>{L(c)},[c]),p.useEffect(()=>{const r=T;r?(K(ce(l.getHours(r))[1]),F(l.getHours(r).toString()),q(l.getMinutes(r).toString()),X(l.getSeconds(r).toString()),Y(r)):(K(null),F(null),q(null),X(null),Y(null))},[T,x,v,h,U]);const k=h,ie=(()=>{const r=gt.indexOf(h),m=Pe[r]||(()=>{const f={hour:"numeric"};return r>=1&&(f.minute="numeric"),r>=2&&(f.second="numeric"),Pe[r]=f,f})();return Ae(m)})();function ue(r){return(()=>{switch(k){case"hour":case"minute":return l.getHoursMinutes;case"second":return l.getHoursMinutesSeconds;default:throw new Error("Invalid valueType")}})()(r)}const P=s||(()=>{const Ee=new Date(2017,0,1,21,13,14);return ie(d,Ee).replace(xe(d,9),"h").replace(xe(d,21),"H").replace(xe(d,13),"mm").replace(xe(d,14),"ss").replace(new RegExp(Oe(d).join("|")),"a")})(),le=(()=>{const r=P.match(/[^0-9a-z]/i);return r?r[0]:null})();function ae(r){if(r.target===r.currentTarget){const m=r.target.children[1];Ne(m)}}function de(r){switch(W.current=r.key,r.key){case"ArrowLeft":case"ArrowRight":case le:{r.preventDefault();const{target:m}=r,f=r.key==="ArrowLeft"?"previousElementSibling":"nextElementSibling",I=$e(m,f);Ne(I);break}}}function te(r){const{key:m,target:f}=r;if(!(W.current===m)||!!Number.isNaN(Number(m)))return;const me=f.getAttribute("max");if(!me)return;const{value:ge}=f;if(Number(ge)*10>Number(me)||ge.length>=me.length){const we=$e(f,"nextElementSibling");Ne(we)}}function E(){if(!b)return;function r(R){return!!R}const m=[z.current,oe.current,se.current,V.current,ee.current].filter(r),f=m.slice(1),I={};for(const R of m)I[R.name]=R.type==="number"?R.valueAsNumber:R.value;if(f.every(R=>!R.value)){b(null,!1);return}const me=m.every(R=>R.value),ge=m.every(R=>R.validity.valid);if(me&&ge){const R=Number(I.hour24||I.hour12&&I.amPm&&Ie(I.hour12,I.amPm)||0),we=Number(I.minute||0),qe=Number(I.second||0),ye=Ze=>`0${Ze}`.slice(-2),ze=`${ye(R)}:${ye(we)}:${ye(qe)}`,Ve=ue(ze);b(Ve,!1);return}H&&H()}function _(r){const{name:m,value:f}=r.target;switch(m){case"amPm":K(f);break;case"hour12":F(f?Ie(f,J||"am").toString():"");break;case"hour24":F(f);break;case"minute":q(f);break;case"second":X(f);break}E()}function ne(r){const{value:m}=r.target;if(!b)return;b(m||null,!1)}const Z={className:n,disabled:i,maxTime:v,minTime:x,onChange:_,onKeyDown:de,onKeyUp:te,required:!!($||U)};function _e(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!1;return o.jsxRuntimeExports.jsx(dt,{...Z,amPm:J,ariaLabel:u,autoFocus:m===0&&t,inputRef:oe,placeholder:a,showLeadingZeros:f,value:O},"hour12")}function je(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!1;return o.jsxRuntimeExports.jsx(mt,{...Z,ariaLabel:u,autoFocus:m===0&&t,inputRef:se,placeholder:a,showLeadingZeros:f,value:O},"hour24")}function fe(r,m){return/h/.test(r)?_e(r,m):je(r,m)}function g(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!1;return o.jsxRuntimeExports.jsx(pt,{...Z,ariaLabel:j,autoFocus:m===0&&t,hour:O,inputRef:V,placeholder:y,showLeadingZeros:f,value:G},"minute")}function N(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!0;return o.jsxRuntimeExports.jsx(ht,{...Z,ariaLabel:C,autoFocus:m===0&&t,hour:O,inputRef:ee,minute:G,placeholder:A,showLeadingZeros:f,value:Q},"second")}function D(r,m){return o.jsxRuntimeExports.jsx(nt,{...Z,ariaLabel:e,autoFocus:m===0&&t,inputRef:z,locale:d,onChange:_,value:J},"ampm")}function B(){return bt(P,{h:fe,H:fe,m:g,s:N,a:D},typeof s<"u")}function he(){return o.jsxRuntimeExports.jsx(ft,{ariaLabel:M,disabled:i,maxTime:v,minTime:x,name:w,onChange:ne,required:$,value:re,valueType:k},"time")}return o.jsxRuntimeExports.jsxs("div",{className:n,onClick:ae,children:[he(),B()]})}const S="react-time-picker",vt=["mousedown","focusin","touchstart"],De={xmlns:"http://www.w3.org/2000/svg",width:19,height:19,viewBox:"0 0 19 19",stroke:"black",strokeWidth:2},_t=o.jsxRuntimeExports.jsxs("svg",{...De,"aria-hidden":"true",className:`${S}__clock-button__icon ${S}__button__icon`,fill:"none",children:[o.jsxRuntimeExports.jsx("circle",{cx:"9.5",cy:"9.5",r:"7.5"}),o.jsxRuntimeExports.jsx("path",{d:"M9.5 4.5 v5 h4"})]}),jt=o.jsxRuntimeExports.jsxs("svg",{...De,"aria-hidden":"true",className:`${S}__clear-button__icon ${S}__button__icon`,children:[o.jsxRuntimeExports.jsx("line",{x1:"4",x2:"15",y1:"4",y2:"15"}),o.jsxRuntimeExports.jsx("line",{x1:"15",x2:"4",y1:"4",y2:"15"})]});function Et(e){const{amPmAriaLabel:t,autoFocus:n,className:i,clearAriaLabel:s,clearIcon:u=jt,clockAriaLabel:a,clockIcon:c=_t,closeClock:d=!0,"data-testid":h,hourAriaLabel:v,hourPlaceholder:x,disableClock:j,disabled:y,format:w,id:M,isOpen:b=null,locale:H,maxTime:$,maxDetail:C="minute",minTime:A,minuteAriaLabel:T,minutePlaceholder:J,name:K="time",nativeInputAriaLabel:O,onClockClose:F,onClockOpen:G,onChange:q,onFocus:Q,onInvalidChange:X,openClockOnFocus:re=!0,required:Y,value:z,secondAriaLabel:oe,secondPlaceholder:se,shouldCloseClock:V,shouldOpenClock:ee,...U}=e,[L,W]=p.useState(b),k=p.useRef(null),ie=p.useRef(null);p.useEffect(()=>{W(b)},[b]);function ue({reason:g}){ee&&!ee({reason:g})||(W(!0),G&&G())}const P=p.useCallback(({reason:g})=>{V&&!V({reason:g})||(W(!1),F&&F())},[F,V]);function le(){L?P({reason:"buttonClick"}):ue({reason:"buttonClick"})}function ae(g,N=d){N&&P({reason:"select"}),q&&q(g)}function de(g){Q&&Q(g),!(y||L||!re||g.target.dataset.select==="true")&&ue({reason:"focus"})}const te=p.useCallback(g=>{g.key==="Escape"&&P({reason:"escape"})},[P]);function E(){ae(null)}function _(g){g.stopPropagation()}const ne=p.useCallback(g=>{const{current:N}=k,{current:D}=ie,B="composedPath"in g?g.composedPath()[0]:g.target;B&&N&&!N.contains(B)&&(!D||!D.contains(B))&&P({reason:"outsideAction"})},[P]),Z=p.useCallback((g=L)=>{for(const N of vt)g?document.addEventListener(N,ne):document.removeEventListener(N,ne);g?document.addEventListener("keydown",te):document.removeEventListener("keydown",te)},[L,ne,te]);p.useEffect(()=>(Z(),()=>{Z(!1)}),[Z]);function _e(){const[g]=Array.isArray(z)?z:[z],N={amPmAriaLabel:t,hourAriaLabel:v,minuteAriaLabel:T,nativeInputAriaLabel:O,secondAriaLabel:oe},D={hourPlaceholder:x,minutePlaceholder:J,secondPlaceholder:se};return o.jsxRuntimeExports.jsxs("div",{className:`${S}__wrapper`,children:[o.jsxRuntimeExports.jsx(kt,{...N,...D,autoFocus:n,className:`${S}__inputGroup`,disabled:y,format:w,isClockOpen:L,locale:H,maxDetail:C,maxTime:$,minTime:A,name:K,onChange:ae,onInvalidChange:X,required:Y,value:g}),u!==null&&o.jsxRuntimeExports.jsx("button",{"aria-label":s,className:`${S}__clear-button ${S}__button`,disabled:y,onClick:E,onFocus:_,type:"button",children:typeof u=="function"?p.createElement(u):u}),c!==null&&!j&&o.jsxRuntimeExports.jsx("button",{"aria-expanded":L||!1,"aria-label":a,className:`${S}__clock-button ${S}__button`,disabled:y,onClick:le,onFocus:_,type:"button",children:typeof c=="function"?p.createElement(c):c})]})}function je(){if(L===null||j)return null;const{clockProps:g,portalContainer:N,value:D}=e,B=`${S}__clock`,he=pe(B,`${B}--${L?"open":"closed"}`),[r]=Array.isArray(D)?D:[D],m=o.jsxRuntimeExports.jsx(Xe,{locale:H,value:r,...g});return N?Ke.createPortal(o.jsxRuntimeExports.jsx("div",{ref:ie,className:he,children:m}),N):o.jsxRuntimeExports.jsx(l.Fit,{children:o.jsxRuntimeExports.jsx("div",{ref:f=>{f&&!L&&f.removeAttribute("style")},className:he,children:m})})}const fe=p.useMemo(()=>l.makeEventProps(U),[U]);return o.jsxRuntimeExports.jsxs("div",{className:pe(S,`${S}--${L?"open":"closed"}`,`${S}--${y?"disabled":"enabled"}`,i),"data-testid":h,id:M,...fe,onFocus:de,ref:k,children:[_e(),je()]})}const wt=l.dt.div`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../chunks/jsx-runtime-DZW6kfQG.js"),p=require("react"),Ke=require("react-dom"),pe=require("clsx"),l=require("../chunks/styled-components.browser.esm-M-8MrVJR.js"),Ge=require("../chunks/utils-IjLH3w2e.js");require("../chunks/textarea-99dejq_o.js");const Ue=require("../chunks/label-error-wbavGDVw.js");require("../chunks/button-CGIs6rx_.js");function Le(e){var t=e.angle,n=t===void 0?0:t,i=e.name,s=e.length,u=s===void 0?100:s,a=e.oppositeLength,c=a===void 0?10:a,d=e.width,h=d===void 0?1:d;return o.jsxRuntimeExports.jsx("div",{className:"react-clock__hand react-clock__".concat(i,"-hand"),style:{transform:"rotate(".concat(n,"deg)")},children:o.jsxRuntimeExports.jsx("div",{className:"react-clock__hand__body react-clock__".concat(i,"-hand__body"),style:{width:"".concat(h,"px"),top:"".concat(50-u/2,"%"),bottom:"".concat(50-c/2,"%")}})})}var Ce=p.memo(function(t){var n=t.angle,i=n===void 0?0:n,s=t.length,u=s===void 0?10:s,a=t.name,c=t.width,d=c===void 0?1:c;return o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark react-clock__".concat(a,"-mark"),style:{transform:"rotate(".concat(i,"deg)")},children:o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark__body react-clock__".concat(a,"-mark__body"),style:{width:"".concat(d,"px"),top:0,bottom:"".concat(100-u/2,"%")}})})}),Be=p.memo(function(t){var n=t.angle,i=n===void 0?0:n,s=t.length,u=s===void 0?10:s,a=t.name,c=t.number;return o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark react-clock__".concat(a,"-mark"),style:{transform:"rotate(".concat(i,"deg)")},children:o.jsxRuntimeExports.jsx("div",{className:"react-clock__mark__number",style:{transform:"rotate(-".concat(i,"deg)"),top:"".concat(u/2,"%")},children:c})})});function Te(e,t){return t.toLocaleString(e||l.getUserLocale()||void 0)}function Je(e){return e!==null&&e!==!1&&!Number.isNaN(Number(e))}function Qe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Math.max.apply(Math,e.filter(Je))}function Xe(e){var t=e.className,n=e.formatHour,i=n===void 0?Te:n,s=e.hourHandLength,u=s===void 0?50:s,a=e.hourHandOppositeLength,c=e.hourHandWidth,d=c===void 0?4:c,h=e.hourMarksLength,v=h===void 0?10:h,x=e.hourMarksWidth,j=x===void 0?3:x,y=e.locale,w=e.minuteHandLength,M=w===void 0?70:w,b=e.minuteHandOppositeLength,H=e.minuteHandWidth,$=H===void 0?2:H,C=e.minuteMarksLength,A=C===void 0?6:C,T=e.minuteMarksWidth,J=T===void 0?1:T,K=e.renderHourMarks,O=K===void 0?!0:K,F=e.renderMinuteHand,G=F===void 0?!0:F,q=e.renderMinuteMarks,Q=q===void 0?!0:q,X=e.renderNumbers,re=e.renderSecondHand,Y=re===void 0?!0:re,z=e.secondHandLength,oe=z===void 0?90:z,se=e.secondHandOppositeLength,V=e.secondHandWidth,ee=V===void 0?1:V,U=e.size,L=U===void 0?150:U,W=e.useMillisecondPrecision,k=e.value;function ie(){if(!Q)return null;for(var E=[],_=1;_<=60;_+=1){var ne=O&&!(_%5);ne||E.push(o.jsxRuntimeExports.jsx(Ce,{angle:_*6,length:A,name:"minute",width:J},"minute_".concat(_)))}return E}function ue(){if(!O)return null;for(var E=[],_=1;_<=12;_+=1)E.push(o.jsxRuntimeExports.jsx(Ce,{angle:_*30,length:v,name:"hour",width:j},"hour_".concat(_)));return E}function P(){if(!X)return null;for(var E=[],_=1;_<=12;_+=1)E.push(o.jsxRuntimeExports.jsx(Be,{angle:_*30,length:Qe(O&&v,Q&&A,0),name:"number",number:i(y,_)},"number_".concat(_)));return E}function le(){return o.jsxRuntimeExports.jsxs("div",{className:"react-clock__face",children:[ie(),ue(),P()]})}function ae(){var E=k?l.getHours(k)*30+l.getMinutes(k)/2+l.getSeconds(k)/120+(W?l.getMilliseconds(k)/12e4:0):0;return o.jsxRuntimeExports.jsx(Le,{angle:E,length:u,name:"hour",oppositeLength:a,width:d})}function de(){if(!G)return null;var E=k?l.getHours(k)*360+l.getMinutes(k)*6+l.getSeconds(k)/10+(W?l.getMilliseconds(k)/1e4:0):0;return o.jsxRuntimeExports.jsx(Le,{angle:E,length:M,name:"minute",oppositeLength:b,width:$})}function te(){if(!Y)return null;var E=k?l.getMinutes(k)*360+l.getSeconds(k)*6+(W?l.getMilliseconds(k)*.006:0):0;return o.jsxRuntimeExports.jsx(Le,{angle:E,length:oe,name:"second",oppositeLength:se,width:ee})}return o.jsxRuntimeExports.jsxs("time",{className:pe("react-clock",t),dateTime:k instanceof Date?k.toLocaleTimeString("en",{hourCycle:"h23",hour:"2-digit",minute:G?"2-digit":void 0,second:Y?"2-digit":void 0}):k||void 0,style:{width:L,height:L},children:[le(),ae(),de(),te()]})}function Ye({children:e}){return o.jsxRuntimeExports.jsx("span",{className:"react-time-picker__inputGroup__divider",children:e})}function Ie(e,t){let n=Number(e);return t==="am"&&n===12?n=0:t==="pm"&&n<12&&(n+=12),n}function ce(e){return[Number(e)%12||12,Number(e)<12?"am":"pm"]}const Re=new Map;function Ae(e){return function(n,i){const s=n||l.getUserLocale();Re.has(s)||Re.set(s,new Map);const u=Re.get(s);return u.has(e)||u.set(e,new Intl.DateTimeFormat(s||void 0,e).format),u.get(e)(i)}}const He=new Map;function et(e){return(t,n)=>{const i=t||l.getUserLocale();He.has(i)||He.set(i,new Map);const s=He.get(i);return s.has(e)||s.set(e,new Intl.NumberFormat(i||void 0,e).format),s.get(e)(n)}}const tt=["9","٩"],Me=new RegExp(`[${tt.join("")}]`),Fe=Ae({hour:"numeric"});function Oe(e){const t=Fe(e,new Date(2017,0,1,9)),n=Fe(e,new Date(2017,0,1,21)),[i,s]=t.split(Me),[u,a]=n.split(Me);if(a!==void 0){if(i!==u)return[i,u].map(c=>c.trim());if(s!==a)return[s,a].map(c=>c.trim())}return["AM","PM"]}function We(e){return e!==null&&e!==!1&&!Number.isNaN(Number(e))}function be(...e){return Math.min(...e.filter(We))}function ke(...e){return Math.max(...e.filter(We))}function nt({ariaLabel:e,autoFocus:t,className:n,disabled:i,inputRef:s,locale:u,maxTime:a,minTime:c,onChange:d,onKeyDown:h,required:v,value:x}){const j=c?ce(l.getHours(c))[1]==="pm":!1,y=a?ce(l.getHours(a))[1]==="am":!1,w="amPm",[M,b]=Oe(u);return o.jsxRuntimeExports.jsxs("select",{"aria-label":e,autoFocus:t,className:pe(`${n}__input`,`${n}__${w}`),"data-input":"true","data-select":"true",disabled:i,name:w,onChange:d,onKeyDown:h,ref:s,required:v,value:x!==null?x:"",children:[!x&&o.jsxRuntimeExports.jsx("option",{value:"",children:"--"}),o.jsxRuntimeExports.jsx("option",{disabled:j,value:"am",children:M}),o.jsxRuntimeExports.jsx("option",{disabled:y,value:"pm",children:b})]})}const Se=typeof window<"u",rt=Se?p.useLayoutEffect:p.useEffect,ot=Se&&/(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent),st=Se&&/Firefox/.test(navigator.userAgent);function it(e){const{target:t}=e;ot?requestAnimationFrame(()=>t.select()):t.select()}function ut(e){if(document.readyState==="complete")return;function t(){l.updateInputWidth(e)}window.addEventListener("load",t)}function at(e){if(!document.fonts)return;const t=l.getFontShorthand(e);if(!t||document.fonts.check(t))return;function i(){l.updateInputWidth(e)}document.fonts.addEventListener("loadingdone",i)}function ct(e){if(e&&"selectionStart"in e&&e.selectionStart!==null&&"selectionEnd"in e&&e.selectionEnd!==null)return e.value.slice(e.selectionStart,e.selectionEnd);if("getSelection"in window){const t=window.getSelection();return t?.toString()}return null}function lt(e){if(e!==null)return function(n){if(st)return;const{key:i,target:s}=n,{value:u}=s,a=i.length===1&&/\d/.test(i),c=ct(s);(!a||!(c||u.length<e))&&n.preventDefault()}}function ve({ariaLabel:e,autoFocus:t,className:n,disabled:i,inputRef:s,max:u,min:a,name:c,nameForClass:d,onChange:h,onKeyDown:v,onKeyUp:x,placeholder:j="--",required:y,showLeadingZeros:w,step:M,value:b}){rt(()=>{!s||!s.current||(l.updateInputWidth(s.current),ut(s.current),at(s.current))},[s,b]);const H=w&&b&&Number(b)<10&&(b==="0"||!b.toString().startsWith("0")),$=u?u.toString().length:null;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[H?o.jsxRuntimeExports.jsx("span",{className:`${n}__leadingZero`,children:"0"}):null,o.jsxRuntimeExports.jsx("input",{"aria-label":e,autoComplete:"off",autoFocus:t,className:pe(`${n}__input`,`${n}__${d||c}`,H&&`${n}__input--hasLeadingZero`),"data-input":"true",disabled:i,inputMode:"numeric",max:u,min:a,name:c,onChange:h,onFocus:it,onKeyDown:v,onKeyPress:lt($),onKeyUp:C=>{l.updateInputWidth(C.target),x&&x(C)},placeholder:j,ref:s,required:y,step:M,type:"number",value:b!==null?b:""})]})}function dt({amPm:e,maxTime:t,minTime:n,value:i,...s}){const u=be(12,t&&(()=>{const[d,h]=ce(l.getHours(t));return h!==e?null:d})()),a=ke(1,n&&(()=>{const[d,h]=ce(l.getHours(n));return h!==e||d===12?null:d})()),c=i?ce(i)[0].toString():"";return o.jsxRuntimeExports.jsx(ve,{max:u,min:a,name:"hour12",nameForClass:"hour",value:c,...s})}function mt({maxTime:e,minTime:t,...n}){const i=be(23,e&&l.getHours(e)),s=ke(0,t&&l.getHours(t));return o.jsxRuntimeExports.jsx(ve,{max:i,min:s,name:"hour24",nameForClass:"hour",...n})}function pt({hour:e,maxTime:t,minTime:n,showLeadingZeros:i=!0,...s}){function u(d){return e===l.getHours(d).toString()}const a=be(59,t&&u(t)&&l.getMinutes(t)),c=ke(0,n&&u(n)&&l.getMinutes(n));return o.jsxRuntimeExports.jsx(ve,{max:a,min:c,name:"minute",showLeadingZeros:i,...s})}function ft({ariaLabel:e,disabled:t,maxTime:n,minTime:i,name:s,onChange:u,required:a,value:c,valueType:d}){const h=(()=>{switch(d){case"hour":return j=>`${l.getHours(j)}:00`;case"minute":return l.getHoursMinutes;case"second":return l.getHoursMinutesSeconds;default:throw new Error("Invalid valueType")}})(),v=(()=>{switch(d){case"hour":return 3600;case"minute":return 60;case"second":return 1;default:throw new Error("Invalid valueType")}})();function x(j){j.stopPropagation()}return o.jsxRuntimeExports.jsx("input",{"aria-label":e,disabled:t,hidden:!0,max:n?h(n):void 0,min:i?h(i):void 0,name:s,onChange:u,onFocus:x,required:a,step:v,style:{visibility:"hidden",position:"absolute",zIndex:"-999"},type:"time",value:c?h(c):""})}function ht({hour:e,maxTime:t,minTime:n,minute:i,showLeadingZeros:s=!0,...u}){function a(h){return e===l.getHours(h).toString()&&i===l.getMinutes(h).toString()}const c=be(59,t&&a(t)&&l.getSeconds(t)),d=ke(0,n&&a(n)&&l.getSeconds(n));return o.jsxRuntimeExports.jsx(ve,{max:c,min:d,name:"second",showLeadingZeros:s,...u})}const Pe={},gt=["hour","minute","second"];function xt(e){return e.dataset.input==="true"}function $e(e,t){let n=e;do n=n[t];while(n&&!xt(n));return n}function Ne(e){e&&e.focus()}function bt(e,t,n){const i=[],s=new RegExp(Object.keys(t).map(a=>`${a}+`).join("|"),"g"),u=e.match(s);return e.split(s).reduce((a,c,d)=>{const h=c&&o.jsxRuntimeExports.jsx(Ye,{children:c},`separator_${d}`);a.push(h);const v=u?.[d];if(v){const x=t[v]||t[Object.keys(t).find(j=>v.match(j))];if(!x)return a;!n&&i.includes(x)?a.push(v):(a.push(x(v,d)),i.push(x))}return a},[])}const xe=et({useGrouping:!1});function kt({amPmAriaLabel:e,autoFocus:t,className:n,disabled:i,format:s,hourAriaLabel:u,hourPlaceholder:a,isClockOpen:c=null,locale:d,maxDetail:h="minute",maxTime:v,minTime:x,minuteAriaLabel:j,minutePlaceholder:y,name:w="time",nativeInputAriaLabel:M,onChange:b,onInvalidChange:H,required:$,secondAriaLabel:C,secondPlaceholder:A,value:T}){const[J,K]=p.useState(null),[O,F]=p.useState(null),[G,q]=p.useState(null),[Q,X]=p.useState(null),[re,Y]=p.useState(null),z=p.useRef(null),oe=p.useRef(null),se=p.useRef(null),V=p.useRef(null),ee=p.useRef(null),[U,L]=p.useState(c),W=p.useRef(void 0);p.useEffect(()=>{L(c)},[c]),p.useEffect(()=>{const r=T;r?(K(ce(l.getHours(r))[1]),F(l.getHours(r).toString()),q(l.getMinutes(r).toString()),X(l.getSeconds(r).toString()),Y(r)):(K(null),F(null),q(null),X(null),Y(null))},[T,x,v,h,U]);const k=h,ie=(()=>{const r=gt.indexOf(h),m=Pe[r]||(()=>{const f={hour:"numeric"};return r>=1&&(f.minute="numeric"),r>=2&&(f.second="numeric"),Pe[r]=f,f})();return Ae(m)})();function ue(r){return(()=>{switch(k){case"hour":case"minute":return l.getHoursMinutes;case"second":return l.getHoursMinutesSeconds;default:throw new Error("Invalid valueType")}})()(r)}const P=s||(()=>{const Ee=new Date(2017,0,1,21,13,14);return ie(d,Ee).replace(xe(d,9),"h").replace(xe(d,21),"H").replace(xe(d,13),"mm").replace(xe(d,14),"ss").replace(new RegExp(Oe(d).join("|")),"a")})(),le=(()=>{const r=P.match(/[^0-9a-z]/i);return r?r[0]:null})();function ae(r){if(r.target===r.currentTarget){const m=r.target.children[1];Ne(m)}}function de(r){switch(W.current=r.key,r.key){case"ArrowLeft":case"ArrowRight":case le:{r.preventDefault();const{target:m}=r,f=r.key==="ArrowLeft"?"previousElementSibling":"nextElementSibling",I=$e(m,f);Ne(I);break}}}function te(r){const{key:m,target:f}=r;if(!(W.current===m)||!!Number.isNaN(Number(m)))return;const me=f.getAttribute("max");if(!me)return;const{value:ge}=f;if(Number(ge)*10>Number(me)||ge.length>=me.length){const we=$e(f,"nextElementSibling");Ne(we)}}function E(){if(!b)return;function r(R){return!!R}const m=[z.current,oe.current,se.current,V.current,ee.current].filter(r),f=m.slice(1),I={};for(const R of m)I[R.name]=R.type==="number"?R.valueAsNumber:R.value;if(f.every(R=>!R.value)){b(null,!1);return}const me=m.every(R=>R.value),ge=m.every(R=>R.validity.valid);if(me&&ge){const R=Number(I.hour24||I.hour12&&I.amPm&&Ie(I.hour12,I.amPm)||0),we=Number(I.minute||0),qe=Number(I.second||0),ye=Ze=>`0${Ze}`.slice(-2),ze=`${ye(R)}:${ye(we)}:${ye(qe)}`,Ve=ue(ze);b(Ve,!1);return}H&&H()}function _(r){const{name:m,value:f}=r.target;switch(m){case"amPm":K(f);break;case"hour12":F(f?Ie(f,J||"am").toString():"");break;case"hour24":F(f);break;case"minute":q(f);break;case"second":X(f);break}E()}function ne(r){const{value:m}=r.target;if(!b)return;b(m||null,!1)}const Z={className:n,disabled:i,maxTime:v,minTime:x,onChange:_,onKeyDown:de,onKeyUp:te,required:!!($||U)};function _e(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!1;return o.jsxRuntimeExports.jsx(dt,{...Z,amPm:J,ariaLabel:u,autoFocus:m===0&&t,inputRef:oe,placeholder:a,showLeadingZeros:f,value:O},"hour12")}function je(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!1;return o.jsxRuntimeExports.jsx(mt,{...Z,ariaLabel:u,autoFocus:m===0&&t,inputRef:se,placeholder:a,showLeadingZeros:f,value:O},"hour24")}function fe(r,m){return/h/.test(r)?_e(r,m):je(r,m)}function g(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!1;return o.jsxRuntimeExports.jsx(pt,{...Z,ariaLabel:j,autoFocus:m===0&&t,hour:O,inputRef:V,placeholder:y,showLeadingZeros:f,value:G},"minute")}function N(r,m){if(r&&r.length>2)throw new Error(`Unsupported token: ${r}`);const f=r?r.length===2:!0;return o.jsxRuntimeExports.jsx(ht,{...Z,ariaLabel:C,autoFocus:m===0&&t,hour:O,inputRef:ee,minute:G,placeholder:A,showLeadingZeros:f,value:Q},"second")}function D(r,m){return o.jsxRuntimeExports.jsx(nt,{...Z,ariaLabel:e,autoFocus:m===0&&t,inputRef:z,locale:d,onChange:_,value:J},"ampm")}function B(){return bt(P,{h:fe,H:fe,m:g,s:N,a:D},typeof s<"u")}function he(){return o.jsxRuntimeExports.jsx(ft,{ariaLabel:M,disabled:i,maxTime:v,minTime:x,name:w,onChange:ne,required:$,value:re,valueType:k},"time")}return o.jsxRuntimeExports.jsxs("div",{className:n,onClick:ae,children:[he(),B()]})}const S="react-time-picker",vt=["mousedown","focusin","touchstart"],De={xmlns:"http://www.w3.org/2000/svg",width:19,height:19,viewBox:"0 0 19 19",stroke:"black",strokeWidth:2},_t=o.jsxRuntimeExports.jsxs("svg",{...De,"aria-hidden":"true",className:`${S}__clock-button__icon ${S}__button__icon`,fill:"none",children:[o.jsxRuntimeExports.jsx("circle",{cx:"9.5",cy:"9.5",r:"7.5"}),o.jsxRuntimeExports.jsx("path",{d:"M9.5 4.5 v5 h4"})]}),jt=o.jsxRuntimeExports.jsxs("svg",{...De,"aria-hidden":"true",className:`${S}__clear-button__icon ${S}__button__icon`,children:[o.jsxRuntimeExports.jsx("line",{x1:"4",x2:"15",y1:"4",y2:"15"}),o.jsxRuntimeExports.jsx("line",{x1:"15",x2:"4",y1:"4",y2:"15"})]});function Et(e){const{amPmAriaLabel:t,autoFocus:n,className:i,clearAriaLabel:s,clearIcon:u=jt,clockAriaLabel:a,clockIcon:c=_t,closeClock:d=!0,"data-testid":h,hourAriaLabel:v,hourPlaceholder:x,disableClock:j,disabled:y,format:w,id:M,isOpen:b=null,locale:H,maxTime:$,maxDetail:C="minute",minTime:A,minuteAriaLabel:T,minutePlaceholder:J,name:K="time",nativeInputAriaLabel:O,onClockClose:F,onClockOpen:G,onChange:q,onFocus:Q,onInvalidChange:X,openClockOnFocus:re=!0,required:Y,value:z,secondAriaLabel:oe,secondPlaceholder:se,shouldCloseClock:V,shouldOpenClock:ee,...U}=e,[L,W]=p.useState(b),k=p.useRef(null),ie=p.useRef(null);p.useEffect(()=>{W(b)},[b]);function ue({reason:g}){ee&&!ee({reason:g})||(W(!0),G&&G())}const P=p.useCallback(({reason:g})=>{V&&!V({reason:g})||(W(!1),F&&F())},[F,V]);function le(){L?P({reason:"buttonClick"}):ue({reason:"buttonClick"})}function ae(g,N=d){N&&P({reason:"select"}),q&&q(g)}function de(g){Q&&Q(g),!(y||L||!re||g.target.dataset.select==="true")&&ue({reason:"focus"})}const te=p.useCallback(g=>{g.key==="Escape"&&P({reason:"escape"})},[P]);function E(){ae(null)}function _(g){g.stopPropagation()}const ne=p.useCallback(g=>{const{current:N}=k,{current:D}=ie,B="composedPath"in g?g.composedPath()[0]:g.target;B&&N&&!N.contains(B)&&(!D||!D.contains(B))&&P({reason:"outsideAction"})},[P]),Z=p.useCallback((g=L)=>{for(const N of vt)g?document.addEventListener(N,ne):document.removeEventListener(N,ne);g?document.addEventListener("keydown",te):document.removeEventListener("keydown",te)},[L,ne,te]);p.useEffect(()=>(Z(),()=>{Z(!1)}),[Z]);function _e(){const[g]=Array.isArray(z)?z:[z],N={amPmAriaLabel:t,hourAriaLabel:v,minuteAriaLabel:T,nativeInputAriaLabel:O,secondAriaLabel:oe},D={hourPlaceholder:x,minutePlaceholder:J,secondPlaceholder:se};return o.jsxRuntimeExports.jsxs("div",{className:`${S}__wrapper`,children:[o.jsxRuntimeExports.jsx(kt,{...N,...D,autoFocus:n,className:`${S}__inputGroup`,disabled:y,format:w,isClockOpen:L,locale:H,maxDetail:C,maxTime:$,minTime:A,name:K,onChange:ae,onInvalidChange:X,required:Y,value:g}),u!==null&&o.jsxRuntimeExports.jsx("button",{"aria-label":s,className:`${S}__clear-button ${S}__button`,disabled:y,onClick:E,onFocus:_,type:"button",children:typeof u=="function"?p.createElement(u):u}),c!==null&&!j&&o.jsxRuntimeExports.jsx("button",{"aria-expanded":L||!1,"aria-label":a,className:`${S}__clock-button ${S}__button`,disabled:y,onClick:le,onFocus:_,type:"button",children:typeof c=="function"?p.createElement(c):c})]})}function je(){if(L===null||j)return null;const{clockProps:g,portalContainer:N,value:D}=e,B=`${S}__clock`,he=pe(B,`${B}--${L?"open":"closed"}`),[r]=Array.isArray(D)?D:[D],m=o.jsxRuntimeExports.jsx(Xe,{locale:H,value:r,...g});return N?Ke.createPortal(o.jsxRuntimeExports.jsx("div",{ref:ie,className:he,children:m}),N):o.jsxRuntimeExports.jsx(l.Fit,{children:o.jsxRuntimeExports.jsx("div",{ref:f=>{f&&!L&&f.removeAttribute("style")},className:he,children:m})})}const fe=p.useMemo(()=>l.makeEventProps(U),[U]);return o.jsxRuntimeExports.jsxs("div",{className:pe(S,`${S}--${L?"open":"closed"}`,`${S}--${y?"disabled":"enabled"}`,i),"data-testid":h,id:M,...fe,onFocus:de,ref:k,children:[_e(),je()]})}const wt=l.dt.div`
|
|
2
2
|
width: auto;
|
|
3
3
|
|
|
4
4
|
.react-time-picker {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as o } from "../chunks/jsx-runtime-Dk9ExdSX.js";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as qe, useLayoutEffect as rn, useEffect as pe, useState as re, useRef as G, useCallback as xe, useMemo as on, createElement as De, useId as an } from "react";
|
|
3
3
|
import { createPortal as sn } from "react-dom";
|
|
4
4
|
import be from "clsx";
|
|
5
|
-
import {
|
|
5
|
+
import { g as Oe, a as I, b as oe, c as de, d as Pe, u as ye, e as cn, f as Be, h as Ue, m as un, F as ln, i as dn } from "../chunks/styled-components.browser.esm-CxZkQVdi.js";
|
|
6
6
|
import { c as mn } from "../chunks/utils-B6yFEsav.js";
|
|
7
7
|
import "../chunks/textarea-COi5ngTN.js";
|
|
8
8
|
import { L as pn } from "../chunks/label-error-Dg6_L7YY.js";
|
|
@@ -17,7 +17,7 @@ function Se(e) {
|
|
|
17
17
|
bottom: "".concat(50 - u / 2, "%")
|
|
18
18
|
} }) });
|
|
19
19
|
}
|
|
20
|
-
var ze =
|
|
20
|
+
var ze = qe(function(n) {
|
|
21
21
|
var t = n.angle, a = t === void 0 ? 0 : t, i = n.length, s = i === void 0 ? 10 : i, c = n.name, u = n.width, l = u === void 0 ? 1 : u;
|
|
22
22
|
return o.jsx("div", { className: "react-clock__mark react-clock__".concat(c, "-mark"), style: {
|
|
23
23
|
transform: "rotate(".concat(a, "deg)")
|
|
@@ -26,7 +26,7 @@ var ze = Re(function(n) {
|
|
|
26
26
|
top: 0,
|
|
27
27
|
bottom: "".concat(100 - s / 2, "%")
|
|
28
28
|
} }) });
|
|
29
|
-
}), fn =
|
|
29
|
+
}), fn = qe(function(n) {
|
|
30
30
|
var t = n.angle, a = t === void 0 ? 0 : t, i = n.length, s = i === void 0 ? 10 : i, c = n.name, u = n.number;
|
|
31
31
|
return o.jsx("div", { className: "react-clock__mark react-clock__".concat(c, "-mark"), style: {
|
|
32
32
|
transform: "rotate(".concat(a, "deg)")
|
|
@@ -47,7 +47,7 @@ function bn() {
|
|
|
47
47
|
return Math.max.apply(Math, e.filter(gn));
|
|
48
48
|
}
|
|
49
49
|
function kn(e) {
|
|
50
|
-
var n = e.className, t = e.formatHour, a = t === void 0 ? hn : t, i = e.hourHandLength, s = i === void 0 ? 50 : i, c = e.hourHandOppositeLength, u = e.hourHandWidth, l = u === void 0 ? 4 : u, p = e.hourMarksLength, k = p === void 0 ? 10 : p, h = e.hourMarksWidth, _ = h === void 0 ? 3 : h, y = e.locale, w = e.minuteHandLength, P = w === void 0 ? 70 : w, g = e.minuteHandOppositeLength, N = e.minuteHandWidth, M = N === void 0 ? 2 : N, E = e.minuteMarksLength, A = E === void 0 ? 6 : E, J = e.minuteMarksWidth, Q = J === void 0 ? 1 : J,
|
|
50
|
+
var n = e.className, t = e.formatHour, a = t === void 0 ? hn : t, i = e.hourHandLength, s = i === void 0 ? 50 : i, c = e.hourHandOppositeLength, u = e.hourHandWidth, l = u === void 0 ? 4 : u, p = e.hourMarksLength, k = p === void 0 ? 10 : p, h = e.hourMarksWidth, _ = h === void 0 ? 3 : h, y = e.locale, w = e.minuteHandLength, P = w === void 0 ? 70 : w, g = e.minuteHandOppositeLength, N = e.minuteHandWidth, M = N === void 0 ? 2 : N, E = e.minuteMarksLength, A = E === void 0 ? 6 : E, J = e.minuteMarksWidth, Q = J === void 0 ? 1 : J, R = e.renderHourMarks, O = R === void 0 ? !0 : R, S = e.renderMinuteHand, q = S === void 0 ? !0 : S, z = e.renderMinuteMarks, T = z === void 0 ? !0 : z, X = e.renderNumbers, ie = e.renderSecondHand, Y = ie === void 0 ? !0 : ie, V = e.secondHandLength, ae = V === void 0 ? 90 : V, se = e.secondHandOppositeLength, Z = e.secondHandWidth, ee = Z === void 0 ? 1 : Z, B = e.size, L = B === void 0 ? 150 : B, W = e.useMillisecondPrecision, b = e.value;
|
|
51
51
|
function ce() {
|
|
52
52
|
if (!T)
|
|
53
53
|
return null;
|
|
@@ -79,7 +79,7 @@ function kn(e) {
|
|
|
79
79
|
return o.jsx(Se, { angle: x, length: s, name: "hour", oppositeLength: c, width: l });
|
|
80
80
|
}
|
|
81
81
|
function he() {
|
|
82
|
-
if (!
|
|
82
|
+
if (!q)
|
|
83
83
|
return null;
|
|
84
84
|
var x = b ? I(b) * 360 + oe(b) * 6 + de(b) / 10 + (W ? Pe(b) / 1e4 : 0) : 0;
|
|
85
85
|
return o.jsx(Se, { angle: x, length: P, name: "minute", oppositeLength: g, width: M });
|
|
@@ -95,7 +95,7 @@ function kn(e) {
|
|
|
95
95
|
b.toLocaleTimeString("en", {
|
|
96
96
|
hourCycle: "h23",
|
|
97
97
|
hour: "2-digit",
|
|
98
|
-
minute:
|
|
98
|
+
minute: q ? "2-digit" : void 0,
|
|
99
99
|
second: Y ? "2-digit" : void 0
|
|
100
100
|
})
|
|
101
101
|
) : b || void 0, style: {
|
|
@@ -315,7 +315,7 @@ const Ge = {}, An = ["hour", "minute", "second"];
|
|
|
315
315
|
function On(e) {
|
|
316
316
|
return e.dataset.input === "true";
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Re(e, n) {
|
|
319
319
|
let t = e;
|
|
320
320
|
do
|
|
321
321
|
t = t[n];
|
|
@@ -343,12 +343,12 @@ function Wn(e, n, t) {
|
|
|
343
343
|
}
|
|
344
344
|
const we = _n({ useGrouping: !1 });
|
|
345
345
|
function Dn({ amPmAriaLabel: e, autoFocus: n, className: t, disabled: a, format: i, hourAriaLabel: s, hourPlaceholder: c, isClockOpen: u = null, locale: l, maxDetail: p = "minute", maxTime: k, minTime: h, minuteAriaLabel: _, minutePlaceholder: y, name: w = "time", nativeInputAriaLabel: P, onChange: g, onInvalidChange: N, required: M, secondAriaLabel: E, secondPlaceholder: A, value: J }) {
|
|
346
|
-
const [Q,
|
|
346
|
+
const [Q, R] = re(null), [O, S] = re(null), [q, z] = re(null), [T, X] = re(null), [ie, Y] = re(null), V = G(null), ae = G(null), se = G(null), Z = G(null), ee = G(null), [B, L] = re(u), W = G(void 0);
|
|
347
347
|
pe(() => {
|
|
348
348
|
L(u);
|
|
349
349
|
}, [u]), pe(() => {
|
|
350
350
|
const r = J;
|
|
351
|
-
r ? (
|
|
351
|
+
r ? (R(me(I(r))[1]), S(I(r).toString()), z(oe(r).toString()), X(de(r).toString()), Y(r)) : (R(null), S(null), z(null), X(null), Y(null));
|
|
352
352
|
}, [
|
|
353
353
|
J,
|
|
354
354
|
h,
|
|
@@ -396,7 +396,7 @@ function Dn({ amPmAriaLabel: e, autoFocus: n, className: t, disabled: a, format:
|
|
|
396
396
|
case "ArrowRight":
|
|
397
397
|
case fe: {
|
|
398
398
|
r.preventDefault();
|
|
399
|
-
const { target: d } = r, m = r.key === "ArrowLeft" ? "previousElementSibling" : "nextElementSibling", F =
|
|
399
|
+
const { target: d } = r, m = r.key === "ArrowLeft" ? "previousElementSibling" : "nextElementSibling", F = Re(d, m);
|
|
400
400
|
Ae(F);
|
|
401
401
|
break;
|
|
402
402
|
}
|
|
@@ -411,7 +411,7 @@ function Dn({ amPmAriaLabel: e, autoFocus: n, className: t, disabled: a, format:
|
|
|
411
411
|
return;
|
|
412
412
|
const { value: _e } = m;
|
|
413
413
|
if (Number(_e) * 10 > Number(ge) || _e.length >= ge.length) {
|
|
414
|
-
const Ee =
|
|
414
|
+
const Ee = Re(m, "nextElementSibling");
|
|
415
415
|
Ae(Ee);
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -446,7 +446,7 @@ function Dn({ amPmAriaLabel: e, autoFocus: n, className: t, disabled: a, format:
|
|
|
446
446
|
const { name: d, value: m } = r.target;
|
|
447
447
|
switch (d) {
|
|
448
448
|
case "amPm":
|
|
449
|
-
|
|
449
|
+
R(m);
|
|
450
450
|
break;
|
|
451
451
|
case "hour12":
|
|
452
452
|
S(m ? Ve(m, Q || "am").toString() : "");
|
|
@@ -499,13 +499,13 @@ function Dn({ amPmAriaLabel: e, autoFocus: n, className: t, disabled: a, format:
|
|
|
499
499
|
if (r && r.length > 2)
|
|
500
500
|
throw new Error(`Unsupported token: ${r}`);
|
|
501
501
|
const m = r ? r.length === 2 : !1;
|
|
502
|
-
return o.jsx(Sn, { ...K, ariaLabel: _, autoFocus: d === 0 && n, hour: O, inputRef: Z, placeholder: y, showLeadingZeros: m, value:
|
|
502
|
+
return o.jsx(Sn, { ...K, ariaLabel: _, autoFocus: d === 0 && n, hour: O, inputRef: Z, placeholder: y, showLeadingZeros: m, value: q }, "minute");
|
|
503
503
|
}
|
|
504
504
|
function C(r, d) {
|
|
505
505
|
if (r && r.length > 2)
|
|
506
506
|
throw new Error(`Unsupported token: ${r}`);
|
|
507
507
|
const m = r ? r.length === 2 : !0;
|
|
508
|
-
return o.jsx(Mn, { ...K, ariaLabel: E, autoFocus: d === 0 && n, hour: O, inputRef: ee, minute:
|
|
508
|
+
return o.jsx(Mn, { ...K, ariaLabel: E, autoFocus: d === 0 && n, hour: O, inputRef: ee, minute: q, placeholder: A, showLeadingZeros: m, value: T }, "second");
|
|
509
509
|
}
|
|
510
510
|
function D(r, d) {
|
|
511
511
|
return o.jsx(wn, { ...K, ariaLabel: e, autoFocus: d === 0 && n, inputRef: V, locale: l, onChange: v, value: Q }, "ampm");
|
|
@@ -537,12 +537,12 @@ const H = "react-time-picker", zn = ["mousedown", "focusin", "touchstart"], Xe =
|
|
|
537
537
|
strokeWidth: 2
|
|
538
538
|
}, Vn = o.jsxs("svg", { ...Xe, "aria-hidden": "true", className: `${H}__clock-button__icon ${H}__button__icon`, fill: "none", children: [o.jsx("circle", { cx: "9.5", cy: "9.5", r: "7.5" }), o.jsx("path", { d: "M9.5 4.5 v5 h4" })] }), Zn = o.jsxs("svg", { ...Xe, "aria-hidden": "true", className: `${H}__clear-button__icon ${H}__button__icon`, children: [o.jsx("line", { x1: "4", x2: "15", y1: "4", y2: "15" }), o.jsx("line", { x1: "15", x2: "4", y1: "4", y2: "15" })] });
|
|
539
539
|
function Kn(e) {
|
|
540
|
-
const { amPmAriaLabel: n, autoFocus: t, className: a, clearAriaLabel: i, clearIcon: s = Zn, clockAriaLabel: c, clockIcon: u = Vn, closeClock: l = !0, "data-testid": p, hourAriaLabel: k, hourPlaceholder: h, disableClock: _, disabled: y, format: w, id: P, isOpen: g = null, locale: N, maxTime: M, maxDetail: E = "minute", minTime: A, minuteAriaLabel: J, minutePlaceholder: Q, name:
|
|
540
|
+
const { amPmAriaLabel: n, autoFocus: t, className: a, clearAriaLabel: i, clearIcon: s = Zn, clockAriaLabel: c, clockIcon: u = Vn, closeClock: l = !0, "data-testid": p, hourAriaLabel: k, hourPlaceholder: h, disableClock: _, disabled: y, format: w, id: P, isOpen: g = null, locale: N, maxTime: M, maxDetail: E = "minute", minTime: A, minuteAriaLabel: J, minutePlaceholder: Q, name: R = "time", nativeInputAriaLabel: O, onClockClose: S, onClockOpen: q, onChange: z, onFocus: T, onInvalidChange: X, openClockOnFocus: ie = !0, required: Y, value: V, secondAriaLabel: ae, secondPlaceholder: se, shouldCloseClock: Z, shouldOpenClock: ee, ...B } = e, [L, W] = re(g), b = G(null), ce = G(null);
|
|
541
541
|
pe(() => {
|
|
542
542
|
W(g);
|
|
543
543
|
}, [g]);
|
|
544
544
|
function ue({ reason: f }) {
|
|
545
|
-
ee && !ee({ reason: f }) || (W(!0),
|
|
545
|
+
ee && !ee({ reason: f }) || (W(!0), q && q());
|
|
546
546
|
}
|
|
547
547
|
const $ = xe(({ reason: f }) => {
|
|
548
548
|
Z && !Z({ reason: f }) || (W(!1), S && S());
|
|
@@ -589,7 +589,7 @@ function Kn(e) {
|
|
|
589
589
|
minutePlaceholder: Q,
|
|
590
590
|
secondPlaceholder: se
|
|
591
591
|
};
|
|
592
|
-
return o.jsxs("div", { className: `${H}__wrapper`, children: [o.jsx(Dn, { ...C, ...D, autoFocus: t, className: `${H}__inputGroup`, disabled: y, format: w, isClockOpen: L, locale: N, maxDetail: E, maxTime: M, minTime: A, name:
|
|
592
|
+
return o.jsxs("div", { className: `${H}__wrapper`, children: [o.jsx(Dn, { ...C, ...D, autoFocus: t, className: `${H}__inputGroup`, disabled: y, format: w, isClockOpen: L, locale: N, maxDetail: E, maxTime: M, minTime: A, name: R, onChange: le, onInvalidChange: X, required: Y, value: f }), s !== null && o.jsx("button", { "aria-label": i, className: `${H}__clear-button ${H}__button`, disabled: y, onClick: x, onFocus: v, type: "button", children: typeof s == "function" ? De(s) : s }), u !== null && !_ && o.jsx("button", { "aria-expanded": L || !1, "aria-label": c, className: `${H}__clock-button ${H}__button`, disabled: y, onClick: fe, onFocus: v, type: "button", children: typeof u == "function" ? De(u) : u })] });
|
|
593
593
|
}
|
|
594
594
|
function He() {
|
|
595
595
|
if (L === null || _)
|