@telsho/react-google-flight-datepicker 1.1.4 → 1.1.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/index.js +1385 -651
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1360 -652
- package/dist/index.mjs.map +1 -1
- package/dist/styles.scss +779 -0
- package/package.json +45 -39
package/dist/index.mjs
CHANGED
|
@@ -1,660 +1,1368 @@
|
|
|
1
|
-
var kt=Object.defineProperty,Jt=Object.defineProperties;var vt=Object.getOwnPropertyDescriptors;var me=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable;var Se=(e,t,o)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,O=(e,t)=>{for(var o in t||(t={}))Pe.call(t,o)&&Se(e,o,t[o]);if(me)for(var o of me(t))Ke.call(t,o)&&Se(e,o,t[o]);return e},U=(e,t)=>Jt(e,vt(t));var fe=(e,t)=>{var o={};for(var a in e)Pe.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&me)for(var a of me(e))t.indexOf(a)<0&&Ke.call(e,a)&&(o[a]=e[a]);return o};import{useState as _,useRef as ze,useEffect as ie,useLayoutEffect as yo,useCallback as Le}from"react";import W from"dayjs";import Go from"classnames";import Xo from"dayjs/plugin/localeData";import wt from"dayjs";function ye(e,t,o){let a=[],n=new Date(e,t,1),d=new Date(e,t+1,0).getDate(),A=1,g=n.getDay()===0?1:7-n.getDay()+1;for(o==="sunday"&&(g=7-n.getDay());A<=d;)a.push({start:A,days:g-A+1}),A=g+1,g+=7,g=A===1&&g===8?1:g,g>d&&(g=d);return{totalWeek:a,totalDay:d}}function Ge(e,t){let o=[...Array(7)].map((a,n)=>wt().day(n).format(t==="dd"?"dd":t==="ddd"?"ddd":"dddd"));if(e==="sunday"){let a=o.pop();a&&o.unshift(a)}return o}function $e(e,t){let o;return function(...n){let l=()=>{o=null,e.apply(this,n)};o&&clearTimeout(o),o=setTimeout(l,t)}}import{createContext as se,useContext as Xe,useState as Nt,useEffect as Wt}from"react";import Je from"dayjs";import{jsx as Ie}from"react/jsx-runtime";var _e=se(null),qe=se(null),et=se(null),tt=se(null),Vt=se(null),v=()=>{let e=Xe(_e);if(!e)throw new Error("useDateState must be used within DatePickerProvider");return e},k=()=>{let e=Xe(qe);if(!e)throw new Error("useDatePickerConfig must be used within DatePickerProvider");return e},ne=()=>{let e=Xe(et);if(!e)throw new Error("useUIState must be used within DatePickerProvider");return e},w=()=>{let e=Xe(tt);if(!e)throw new Error("useDisplayCustomization must be used within DatePickerProvider");return e};var Tt=async e=>{if(e==="en")return!0;try{return await import(`dayjs/locale/${e}.js`),!0}catch(t){return console.error(`Failed to load locale ${e}:`,t),!1}},ot=({children:e,dateState:t,config:o,uiState:a,display:n,locale:l="en"})=>{let[d,A]=Nt({currentLocale:"en",isLocaleReady:l==="en"});return Wt(()=>{l!=="en"?(A(g=>U(O({},g),{isLocaleReady:!1})),Tt(l).then(g=>{g?(Je.locale(l),A({currentLocale:l,isLocaleReady:!0})):(Je.locale("en"),A({currentLocale:"en",isLocaleReady:!0}))})):(Je.locale("en"),A({currentLocale:"en",isLocaleReady:!0}))},[l]),d.isLocaleReady?Ie(Vt.Provider,{value:d,children:Ie(_e.Provider,{value:t,children:Ie(qe.Provider,{value:o,children:Ie(et.Provider,{value:a,children:Ie(tt.Provider,{value:n,children:e})})})})}):null};import"react";import{jsx as ct}from"react/jsx-runtime";var Yt=e=>ct("svg",U(O({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:ct("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 002 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"})})),De=Yt;import{useEffect as zt,useState as ve}from"react";import Lt from"classnames";import we from"dayjs";import"react";import{jsx as at}from"react/jsx-runtime";var jt=e=>at("svg",U(O({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:at("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})})),he=jt;import"react";import{jsx as gt}from"react/jsx-runtime";var Mt=e=>gt("svg",U(O({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:gt("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})})),Be=Mt;import{jsx as ce,jsxs as it}from"react/jsx-runtime";var Ne=({type:e,showIcon:t=!1,tabIndex:o=0,nonFocusable:a=!1})=>{let[n,l]=ve(null),[d,A]=ve(!1),[g,s]=ve(!1),{fromDate:r,toDate:p,inputFocus:G,handleClickDateInput:B,handleChangeDate:x}=v(),{isSingle:D,minDate:y,maxDate:X,dateFormat:c}=k(),{startDatePlaceholder:m,endDatePlaceholder:C}=w(),f=e==="from"?r:p,V=e==="from"?m:C;zt(()=>{if(f){let Z=f.clone().locale(we.locale()).format("ddd, DD MMM");c&&(Z=f.format(c)),l(Z);let Q=y?we(y):null,H=X?we(X):null;Q!=null&&Q.add(1,"day").isAfter(f,"date")||e==="to"&&r&&f.isBefore(r.add(1,"day"),"date")?A(!0):A(!1),H!=null&&H.subtract(1,"day").isBefore(f,"date")?s(!0):s(!1)}else l(null)},[f,r,y,X,c,e]);let N=J=>{J.stopPropagation(),f&&x(f.subtract(1,"day"),e)},S=J=>{J.stopPropagation(),f&&x(f.add(1,"day"),e)},u=()=>{B(e)};return it("div",{className:Lt("date",{"is-focus":G===e&&!D,"is-single":D}),role:"button",tabIndex:a?-1:o,onClick:u,id:`${e}-date-input-button`,children:[t&&ce(De,{className:"icon-calendar",viewBox:"0 0 24 24"}),ce("div",{className:"selected-date",children:n!=null?n:ce("div",{className:"date-placeholder",children:V})}),n&&it("div",{className:"change-date-group",children:[ce("button",{type:"button",className:"btn-outline change-date-button",onClick:N,tabIndex:a?-1:0,disabled:d,children:ce(he,{viewBox:"0 0 24 24",className:"icon-arrow"})}),ce("button",{type:"button",className:"btn-outline change-date-button",onClick:S,tabIndex:a?-1:0,disabled:g,children:ce(Be,{viewBox:"0 0 24 24",className:"icon-arrow"})})]})]})};import{jsx as He,jsxs as lt}from"react/jsx-runtime";var Fe=({showIcon:e=!1,nonFocusable:t=!1})=>{let{isSingle:o}=k(),{dateInputSeperator:a}=w();return lt("div",{className:"date-picker-input",children:[e&&He(De,{className:"icon-calendar mobile",viewBox:"0 0 24 24"}),lt("div",{className:"date-picker-date-group",children:[He(Ne,{type:"from",tabIndex:t?-1:0,showIcon:!0,nonFocusable:t}),!o&&a&&He("div",{className:"date-input-separator",children:a}),!o&&He(Ne,{type:"to",tabIndex:t?-1:0,showIcon:!1,nonFocusable:t})]})]})};import{createPortal as Pt}from"react-dom";import{useEffect as Et,useState as St}from"react";var rt=()=>{let[e,t]=St(!1);return Et(()=>{t(!0)},[]),e};import{jsx as $t}from"react/jsx-runtime";var Kt=({children:e=null,isMobile:t=!1})=>rt()?t?Pt($t("div",{children:e}),document.body):e:null,nt=Kt;import{useEffect as po,useState as ft,useRef as xo}from"react";import mo from"classnames";import"react";import{jsx as dt}from"react/jsx-runtime";var _t=e=>dt("svg",U(O({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 492 492"},e),{children:dt("path",{d:"M464.3 207.4l.8.2H136l103.5-103.7c5-5.1 7.8-12 7.8-19.2 0-7.2-2.7-14-7.8-19l-16.1-16.2c-5-5-11.8-7.8-19-7.8-7.2 0-14 2.8-19 7.8L7.8 227C2.8 232 0 238.8 0 246c0 7.3 2.8 14 7.8 19.2l177.5 177.4c5 5 11.8 7.8 19 7.8 7.2 0 14-2.8 19-7.8l16-16.1a26.6 26.6 0 000-37.7L134.8 284.4h330a27.9 27.9 0 0027.3-27.6V234a27.3 27.3 0 00-27.7-26.6z"})})),It=_t;import no,{useEffect as bt,useState as Io,useRef as so}from"react";import z from"dayjs";import{VariableSizeList as Co}from"react-window";import Ao from"react-virtualized-auto-sizer";import{forwardRef as go}from"react";import io from"classnames";import lo from"dayjs";import{forwardRef as oo}from"react";import co from"classnames";import ao from"dayjs";import{forwardRef as qt,useCallback as st,useEffect as eo,useRef as to}from"react";import Ct from"classnames";import{jsx as We,jsxs as At}from"react/jsx-runtime";var Ve=qt(({dateIndex:e,dateValue:t,isEndDay:o,selected:a,hovered:n,disabled:l,totalDay:d,highlight:A,handleHoverDay:g,subText:s},r)=>{let p=to(null),{onSelectDate:G,onHoverDate:B}=v(),x=c=>{c.stopPropagation(),c.preventDefault(),!l&&G(t)},D=()=>{l||(B(t),g(t))},y=st(()=>{if(!r||typeof r=="function")return;let c=r.current;c&&p.current&&(c.style.left=`${p.current.offsetLeft-c.offsetWidth+135}px`,c.style.top=`${p.current.offsetTop-c.offsetHeight-15}px`,c.style.visibility="visible")},[r]),X=st(()=>{if(!r||typeof r=="function")return;let c=r.current;c&&(c.style.visibility="hidden")},[r]);return eo(()=>{let c=p.current;return c&&(c.addEventListener("mouseover",y),c.addEventListener("mouseleave",X)),()=>{c&&(c.removeEventListener("mouseover",y),c.removeEventListener("mouseleave",X))}},[y,X]),At("div",{className:Ct("day",{selected:a,hovered:n,disabled:l,highlight:A,end:o,"has-subtext":!!s}),onClick:x,onMouseEnter:D,role:"button",tabIndex:-1,"data-day-index":e,"data-date-value":t.valueOf(),ref:p,children:[n&&!(o&&e===d)&&!(e===1&&a&&!o)&&We("div",{className:Ct("background-day",{"first-day":e===1,"last-day":e===d})}),At("div",{className:"day-content",children:[We("div",{className:"text-day",children:e}),s&&We("div",{className:"sub-text",style:{position:"relative",zIndex:3,color:a&&!n?"#fff":"#666"},children:s})]})]})});Ve.displayName="Day";import{jsx as ut}from"react/jsx-runtime";var Te=oo(({isFirst:e,week:t,month:o,year:a,totalDay:n,weekIndex:l,handleHoverDay:d},A)=>{let{fromDate:g,toDate:s,hoverDate:r}=v(),{minDate:p,maxDate:G,isSingle:B,highlightToday:x}=k(),{subTextDict:D}=w(),y=()=>Array.from({length:t.days},(X,c)=>{var Z;let m=c+t.start,C=ao(`${a}-${o+1}-${m}`),f=p&&C.isBefore(p,"date")||G&&C.isAfter(G,"date"),V=g&&C.isSame(g,"date")||s&&C.isSame(s,"date"),N=!1,S=x&&C.isSame(new Date,"date");g&&!g.isSame(s,"date")&&!B&&(s&&!g.isAfter(C,"date")&&!s.isBefore(C,"date")&&(N=!0),!s&&!C.isBefore(g,"date")&&!(r&&r.isBefore(C,"date"))&&g.isBefore(r,"date")&&(N=!0));let u=s&&C.isSame(s,"date")||!s&&r&&C.isSame(r,"date"),J=D?(Z=D[C.format("YYYY-MM-DD")])!=null?Z:"\xA0":"";return ut(Ve,{dateIndex:m,dateValue:C,selected:V,hovered:N,highlight:S,disabled:f,isEndDay:u,totalDay:n,handleHoverDay:d,subText:J,ref:A},c)});return ut("div",{className:co("week",{first:e}),children:y()})});Te.displayName="Week";import{jsx as Ce,jsxs as ro}from"react/jsx-runtime";var Ae=go(({month:e,year:t,hidden:o=!1,isAnimating:a=!1,handleHoverDay:n,className:l},d)=>{let{startWeekDay:A,weekDayFormat:g,monthFormat:s,singleCalendar:r}=k(),p=()=>{let{totalWeek:x,totalDay:D}=ye(t,e,A);return x.map(y=>{let X=`${t}-${e}-${y.start}`;return Ce(Te,{week:y,month:e,year:t,isFirst:y===x[0],totalDay:D,weekIndex:x.indexOf(y),handleHoverDay:n,ref:d},X)})},G=()=>Ge(A,g).map(D=>Ce("div",{className:"weekday",children:D},`weekday-${D.toLowerCase()}`)),B=()=>{let x=lo(`${t}-${e+1}-1`);return s?x.format(s):x.format("MMMM - YYYY")};return ro("div",{className:io("month-calendar",{isAnimating:a,hidden:o,single:r},l),"data-month-index":e+1,children:[Ce("div",{className:"month-name",children:B()}),Ce("div",{className:"weekdays",children:G()}),Ce("div",{className:"week-container",children:p()})]})});Ae.displayName="MonthCalendar";import{jsx as ae,jsxs as uo}from"react/jsx-runtime";var pt=()=>{let[e,t]=Io(2400),o=so(null),{fromDate:a}=v(),{startWeekDay:n,minDate:l,maxDate:d,weekDayFormat:A}=k(),{complsOpen:g}=ne(),{tooltip:s,subTextDict:r}=w(),p=l?z(l).year():1900,G=l?z(l).month():0;bt(()=>{if(d){let c=l?z(l):z("1900-01-01");t(z(d).diff(c,"month")+1)}},[d,l]),bt(()=>{if(o.current&&g){let c=a?z(a):z(),m=c.diff(z("1900-01-01"),"month");l&&(m=c.diff(z(l),"month")),o.current.scrollToItem(m+1,"smart")}},[g,a,l]);let B=c=>{let m=c+G,C=p+Math.floor(m/12),f=m%12;return{year:C,month:f}},x=no.memo(({index:c,style:m})=>{let{year:C,month:f}=B(c);return ae("div",{style:m,children:ae(Ae,{month:f,year:C,hidden:!1,isAnimating:!1,handleHoverDay:()=>{}})})});x.displayName="CalendarRow";let D=c=>{let{year:m,month:C}=B(c),{totalWeek:f}=ye(m,C,n||"monday");return f.length*48+34},y=()=>ae(Ao,{children:({height:c,width:m})=>ae(Co,{ref:o,width:m,height:c-36,itemCount:e,itemSize:D,children:x})});return ae("div",{className:"calendar-wrapper",children:uo("div",{className:"calendar-content",children:[ae("div",{className:"weekdays mobile",children:Ge(n||"monday",A).map((m,C)=>ae("div",{className:"weekday",children:m},C))}),y()]})})};import{useEffect as be,useState as L,useRef as xt,useCallback as Qe,useMemo as Ye}from"react";import ue from"classnames";import Ze from"dayjs";import{jsx as ge,jsxs as je}from"react/jsx-runtime";var bo=()=>{let[e,t]=L(!1);return be(()=>{t(!0)},[]),e},mt=({dateChanged:e=null})=>{let t=bo(),o=xt(null),a=xt(null),[n,l]=L(0),[d,A]=L([]),[g,s]=L(null),[r,p]=L(!1),[G,B]=L(!1),[x,D]=L(0),[y,X]=L(null),[c,m]=L(!1),{fromDate:C}=v(),{minDate:f,maxDate:V,singleCalendar:N}=k(),{complsOpen:S}=ne(),{tooltip:u}=w(),J=Qe(I=>[I.subtract(1,"month"),I,I.add(1,"month"),I.add(2,"month")],[]);be(()=>{if(!t||!o.current)return;let I=()=>{let R=o.current.offsetWidth,F=window.getComputedStyle(o.current),Y=N?R+parseInt(F.marginLeft)-8:R/2;D(Y)};I();let b=new ResizeObserver(I);return b.observe(o.current),()=>b.disconnect()},[t,N]),be(()=>{s(C!=null?C:Ze())},[S,C]),be(()=>{if(!g)return;let I=f?Ze(f):null,b=V?Ze(V):null;p(!!(I&&g.isBefore(I.add(1,"month"),"month"))),B(!!(b&&g.isAfter(b.subtract(2,"month"),"month"))),A(J(g))},[g,f,V,J]),be(()=>{if(!e||!g)return;let I=e.diff(g,"month");I<-1&&H(),I>1&&Q()},[e,g]);let Z=Qe(I=>()=>{if(I==="next"&&G||I==="prev"&&r||c)return;m(!0),l(I==="next"?-x:x);let b=setTimeout(()=>{s(R=>{let F=I==="next"?R.add(1,"month"):R.subtract(1,"month");return A(J(F)),F}),l(0),m(!1)},200);return()=>clearTimeout(b)},[G,r,c,x,J]),[Q,H]=Ye(()=>[Z("next"),Z("prev")],[Z]),P=Qe(()=>{if(!t||!o.current)return;let b=o.current.querySelector(".day.selected, .month-calendar:not(.hidden) .day:not(.disabled)");b==null||b.focus()},[t]),q=Qe(I=>{var te,le;let b=I.target,R=b.getAttribute("data-day-index");if(!R)return;I.preventDefault();let F=b.closest(".calendar-wrapper"),Y=parseInt((te=b.dataset.dateValue)!=null?te:"0"),ee=Ze(Y),ke=ee.endOf("month").date(),j=parseInt(R);switch(I.key){case"ArrowLeft":j--;break;case"ArrowUp":j-=7;break;case"ArrowRight":j++;break;case"ArrowDown":j+=7;break;case" ":b.click();return;default:return}if(j>0&&j<=ke)(le=F==null?void 0:F.querySelector(`[data-day-index="${j}"]`))==null||le.focus();else{let M=ee.add(j-parseInt(R),"day"),K=M.diff(g,"month");K>1&&!G&&Q(),K<0&&!r&&H(),setTimeout(()=>{var oe;(oe=F==null?void 0:F.querySelector(`[data-month-index="${M.month()+1}"] [data-day-index="${M.date()}"]`))==null||oe.focus()},200)}},[g,G,r,Q,H]),Ue=Ye(()=>{var b;if(!u||!t)return null;let I=typeof u=="function"?u((b=y==null?void 0:y.toDate())!=null?b:new Date):u;return ge("div",{id:"day-tooltip",className:"tooltip-text",ref:a,children:I})},[u,y,t]),T=Ye(()=>d.map((I,b)=>{let R=b===1||b===2,F=c&&n<0&&b===3,Y=c&&n>0&&b===0;return ge(Ae,{hidden:!R&&!F&&!Y,isAnimating:F||Y,month:I.month(),year:I.year(),handleHoverDay:X,ref:a,className:ue({"slide-next":F,"slide-prev":Y})},`${I.year()}-${I.month()}`)}),[d,c,n]);return je("div",{className:"relative",children:[Ue,je("div",{className:ue("calendar-wrapper",{single:N}),ref:o,onKeyDown:q,role:"grid","aria-label":"Calendar",children:[ge("div",{className:ue("calendar-content",{isAnimating:c}),style:{transform:`translateX(${n}px)`},children:T}),je("div",{className:"calendar-flippers",children:[ge("button",{className:ue("flipper-button",{disabled:r}),onClick:H,onKeyDown:I=>I.key===" "&&H(),disabled:r,"aria-label":"Previous month",children:ge(he,{viewBox:"0 0 24 24"})}),ge("button",{className:ue("flipper-button",{disabled:G}),onClick:Q,onKeyDown:I=>I.key===" "&&Q(),disabled:G,"aria-label":"Next month",onBlur:P,children:ge(Be,{viewBox:"0 0 24 24"})})]})]})]})};import{jsx as E,jsxs as Me}from"react/jsx-runtime";var yt=({containerRef:e})=>{let[t,o]=ft(!1),[a,n]=ft(null),l=xo(null),d=e||l,{handleChangeDate:A,handleReset:g}=v(),{singleCalendar:s,expandDirection:r}=k(),{complsOpen:p,isMobile:G,toggleDialog:B}=ne(),{hideDialogHeader:x,hideDialogFooter:D}=w(),y=(X,c)=>{n(X),A(X,c)};return po(()=>{p&&!t&&o(!0),p&&setTimeout(()=>{var c;let X=(c=d.current)==null?void 0:c.querySelector("#start-date-input-button");X&&X.focus()},50)},[p,d,t]),Me("div",{className:mo("dialog-date-picker",{open:p,hide:!p&&t,single:s&&!G,"expand-left":r==="left","expand-right":r==="right"}),ref:d,children:[!x&&Me("div",{className:"dialog-header",children:[E("button",{type:"button",className:"btn-outline back-button",onClick:B,children:E(It,{viewBox:"0 0 492 492"})}),E(Fe,{showIcon:!0,nonFocusable:!p}),E("button",{type:"button",className:"btn-outline reset-button",onClick:g,children:"Reset"})]}),E("div",{className:"dialog-content",children:G?E(pt,{}):E(mt,{dateChanged:a})}),!D&&Me("div",{className:"dialog-footer",children:[E("button",{type:"button",className:"submit-button",onClick:B,tabIndex:0,children:"Done"}),E("button",{type:"button",className:"btn-outline reset-button mobile",onClick:g,children:"Reset"})]})]})};var fo=`.react-google-flight-datepicker {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
.react-google-flight-datepicker .date-picker.disabled {
|
|
26
|
-
opacity: 0.6;
|
|
27
|
-
cursor: default;
|
|
28
|
-
}
|
|
29
|
-
.react-google-flight-datepicker .date-picker-input {
|
|
30
|
-
width: 100%;
|
|
31
|
-
display: flex;
|
|
32
|
-
justify-content: space-between;
|
|
33
|
-
border: 1px solid #dadce0;
|
|
34
|
-
border-radius: 4px;
|
|
35
|
-
color: #3c4043;
|
|
36
|
-
height: 56px;
|
|
37
|
-
letter-spacing: 0.2px;
|
|
38
|
-
font-size: 1rem;
|
|
39
|
-
align-items: center;
|
|
40
|
-
overflow: visible;
|
|
41
|
-
}
|
|
42
|
-
.react-google-flight-datepicker .date-picker-input svg {
|
|
43
|
-
min-width: 24px;
|
|
44
|
-
min-height: 24px;
|
|
45
|
-
}
|
|
46
|
-
.react-google-flight-datepicker .date-picker-date-group {
|
|
47
|
-
position: relative;
|
|
48
|
-
display: flex;
|
|
49
|
-
justify-content: space-between;
|
|
50
|
-
height: 100%;
|
|
51
|
-
flex-grow: 1;
|
|
52
|
-
}
|
|
53
|
-
.react-google-flight-datepicker .date {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
height: 100%;
|
|
57
|
-
position: relative;
|
|
58
|
-
border-radius: 2px 0 0 2px;
|
|
59
|
-
padding: 0 13px;
|
|
60
|
-
flex-grow: 1;
|
|
61
|
-
width: 50%;
|
|
62
|
-
background: white;
|
|
63
|
-
border-radius: 4px;
|
|
64
|
-
}
|
|
65
|
-
.react-google-flight-datepicker .date.is-single::before {
|
|
66
|
-
display: none;
|
|
67
|
-
}
|
|
68
|
-
.react-google-flight-datepicker .date:first-child::before {
|
|
69
|
-
content: "";
|
|
70
|
-
position: absolute;
|
|
71
|
-
right: 0;
|
|
72
|
-
top: 50%;
|
|
73
|
-
transform: translate(0, -50%);
|
|
74
|
-
width: 1px;
|
|
75
|
-
height: 70%;
|
|
76
|
-
background: #dadce0;
|
|
77
|
-
}
|
|
78
|
-
.react-google-flight-datepicker .selected-date {
|
|
79
|
-
display: flex;
|
|
80
|
-
flex: 1 1 0px;
|
|
81
|
-
align-items: center;
|
|
82
|
-
height: 100%;
|
|
83
|
-
font-size: 0.9rem;
|
|
84
|
-
line-height: normal;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
text-overflow: ellipsis;
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
}
|
|
89
|
-
.react-google-flight-datepicker .date-placeholder {
|
|
90
|
-
color: rgba(0, 0, 0, 0.56);
|
|
91
|
-
}
|
|
92
|
-
.react-google-flight-datepicker .change-date-group {
|
|
93
|
-
width: 48px;
|
|
94
|
-
display: flex;
|
|
95
|
-
}
|
|
96
|
-
.react-google-flight-datepicker .change-date-group .change-date-button {
|
|
97
|
-
height: 40px;
|
|
98
|
-
color: #5f6368;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
padding: 8px 0;
|
|
101
|
-
flex-grow: 1;
|
|
102
|
-
}
|
|
103
|
-
.react-google-flight-datepicker .change-date-group .change-date-button:disabled {
|
|
104
|
-
cursor: default;
|
|
105
|
-
}
|
|
106
|
-
.react-google-flight-datepicker .change-date-group .change-date-button:disabled .icon-arrow {
|
|
107
|
-
fill: #93989e;
|
|
108
|
-
}
|
|
109
|
-
.react-google-flight-datepicker .icon-calendar {
|
|
110
|
-
width: 24px;
|
|
111
|
-
height: 24px;
|
|
112
|
-
fill: #1a73e8;
|
|
113
|
-
margin-right: 12px;
|
|
114
|
-
}
|
|
115
|
-
.react-google-flight-datepicker .icon-calendar.mobile {
|
|
116
|
-
display: none;
|
|
117
|
-
}
|
|
118
|
-
.react-google-flight-datepicker .icon-arrow {
|
|
119
|
-
width: 24px;
|
|
120
|
-
height: 24px;
|
|
121
|
-
fill: #5f6368;
|
|
122
|
-
}
|
|
123
|
-
@keyframes showPopup {
|
|
124
|
-
0% {
|
|
125
|
-
transform: scale(0.7);
|
|
126
|
-
opacity: 0;
|
|
1
|
+
// src/lib/components/DatePicker/BaseDatePicker.tsx
|
|
2
|
+
import {
|
|
3
|
+
useState as useState7,
|
|
4
|
+
useRef as useRef5,
|
|
5
|
+
useEffect as useEffect8,
|
|
6
|
+
useLayoutEffect,
|
|
7
|
+
useCallback as useCallback4
|
|
8
|
+
} from "react";
|
|
9
|
+
import dayjs8 from "dayjs";
|
|
10
|
+
import cx7 from "classnames";
|
|
11
|
+
import localeData from "dayjs/plugin/localeData";
|
|
12
|
+
|
|
13
|
+
// src/lib/helpers/index.ts
|
|
14
|
+
import dayjs from "dayjs";
|
|
15
|
+
function getMonthInfo(year, month, startDay) {
|
|
16
|
+
const weeks = [];
|
|
17
|
+
const firstDate = new Date(year, month, 1);
|
|
18
|
+
const lastDate = new Date(year, month + 1, 0);
|
|
19
|
+
const numDays = lastDate.getDate();
|
|
20
|
+
let start = 1;
|
|
21
|
+
let end = firstDate.getDay() === 0 ? 1 : 7 - firstDate.getDay() + 1;
|
|
22
|
+
if (startDay === "sunday") {
|
|
23
|
+
end = 7 - firstDate.getDay();
|
|
127
24
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
25
|
+
while (start <= numDays) {
|
|
26
|
+
weeks.push({ start, days: end - start + 1 });
|
|
27
|
+
start = end + 1;
|
|
28
|
+
end += 7;
|
|
29
|
+
end = start === 1 && end === 8 ? 1 : end;
|
|
30
|
+
if (end > numDays) {
|
|
31
|
+
end = numDays;
|
|
32
|
+
}
|
|
131
33
|
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
34
|
+
return { totalWeek: weeks, totalDay: numDays };
|
|
35
|
+
}
|
|
36
|
+
function getWeekDay(startWeekDay, weekDayFormat) {
|
|
37
|
+
const days = [...Array(7)].map(
|
|
38
|
+
(_, i) => dayjs().day(i).format(weekDayFormat === "dd" ? "dd" : weekDayFormat === "ddd" ? "ddd" : "dddd")
|
|
39
|
+
);
|
|
40
|
+
if (startWeekDay === "sunday") {
|
|
41
|
+
const last = days.pop();
|
|
42
|
+
if (last) {
|
|
43
|
+
days.unshift(last);
|
|
44
|
+
}
|
|
137
45
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
46
|
+
return days;
|
|
47
|
+
}
|
|
48
|
+
function debounce(func, wait) {
|
|
49
|
+
let timeout;
|
|
50
|
+
return function executedFunction(...args) {
|
|
51
|
+
const later = () => {
|
|
52
|
+
timeout = null;
|
|
53
|
+
func.apply(this, args);
|
|
54
|
+
};
|
|
55
|
+
if (timeout) {
|
|
56
|
+
clearTimeout(timeout);
|
|
57
|
+
}
|
|
58
|
+
timeout = setTimeout(later, wait);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/lib/components/DatePicker/DatePickerProvider.tsx
|
|
63
|
+
import { createContext, useContext, useState, useEffect } from "react";
|
|
64
|
+
import dayjs2 from "dayjs";
|
|
65
|
+
import { jsx } from "react/jsx-runtime";
|
|
66
|
+
var DateStateContext = createContext(null);
|
|
67
|
+
var DatePickerConfigContext = createContext(null);
|
|
68
|
+
var UIStateContext = createContext(null);
|
|
69
|
+
var DisplayContext = createContext(null);
|
|
70
|
+
var LocaleContext = createContext(null);
|
|
71
|
+
var useDateState = () => {
|
|
72
|
+
const context = useContext(DateStateContext);
|
|
73
|
+
if (!context) throw new Error("useDateState must be used within DatePickerProvider");
|
|
74
|
+
return context;
|
|
75
|
+
};
|
|
76
|
+
var useDatePickerConfig = () => {
|
|
77
|
+
const context = useContext(DatePickerConfigContext);
|
|
78
|
+
if (!context) throw new Error("useDatePickerConfig must be used within DatePickerProvider");
|
|
79
|
+
return context;
|
|
80
|
+
};
|
|
81
|
+
var useUIState = () => {
|
|
82
|
+
const context = useContext(UIStateContext);
|
|
83
|
+
if (!context) throw new Error("useUIState must be used within DatePickerProvider");
|
|
84
|
+
return context;
|
|
85
|
+
};
|
|
86
|
+
var useDisplayCustomization = () => {
|
|
87
|
+
const context = useContext(DisplayContext);
|
|
88
|
+
if (!context) throw new Error("useDisplayCustomization must be used within DatePickerProvider");
|
|
89
|
+
return context;
|
|
90
|
+
};
|
|
91
|
+
var loadLocale = async (locale) => {
|
|
92
|
+
if (locale === "en") return true;
|
|
93
|
+
try {
|
|
94
|
+
await import(`dayjs/locale/${locale}.js`);
|
|
95
|
+
return true;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.error(`Failed to load locale ${locale}:`, error);
|
|
98
|
+
return false;
|
|
142
99
|
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
.react-google-flight-datepicker .dialog-header .date-picker-input {
|
|
186
|
-
height: 48px;
|
|
187
|
-
width: 50%;
|
|
188
|
-
}
|
|
189
|
-
.react-google-flight-datepicker .date:focus,
|
|
190
|
-
.react-google-flight-datepicker .date.is-focus {
|
|
191
|
-
background-color: #f4f8ff;
|
|
192
|
-
}
|
|
193
|
-
.react-google-flight-datepicker .date:focus::after,
|
|
194
|
-
.react-google-flight-datepicker .date.is-focus::after {
|
|
195
|
-
content: "";
|
|
196
|
-
margin: -1px;
|
|
197
|
-
border: 2px solid #1a73e8;
|
|
198
|
-
border-radius: 4px;
|
|
199
|
-
position: absolute;
|
|
200
|
-
pointer-events: none;
|
|
201
|
-
top: 0;
|
|
202
|
-
bottom: 0;
|
|
203
|
-
left: 0;
|
|
204
|
-
right: 0;
|
|
205
|
-
z-index: 5;
|
|
206
|
-
}
|
|
207
|
-
.react-google-flight-datepicker .back-button {
|
|
208
|
-
display: none;
|
|
209
|
-
}
|
|
210
|
-
.react-google-flight-datepicker .dialog-content {
|
|
211
|
-
border-bottom: 1px solid #dadce0;
|
|
212
|
-
border-top: 1px solid #dadce0;
|
|
213
|
-
position: relative;
|
|
214
|
-
}
|
|
215
|
-
.react-google-flight-datepicker .reset-button {
|
|
216
|
-
font-size: 0.9rem;
|
|
217
|
-
padding: 0 8px;
|
|
218
|
-
height: 36px;
|
|
219
|
-
border-radius: 4px;
|
|
220
|
-
border: none;
|
|
221
|
-
color: #5f6368;
|
|
222
|
-
min-width: 64px;
|
|
223
|
-
}
|
|
224
|
-
.react-google-flight-datepicker .reset-button:hover {
|
|
225
|
-
background-color: #fafafa;
|
|
226
|
-
}
|
|
227
|
-
.react-google-flight-datepicker .reset-button.mobile {
|
|
228
|
-
display: none;
|
|
229
|
-
}
|
|
230
|
-
.react-google-flight-datepicker .calendar-wrapper {
|
|
231
|
-
margin: 12px 38px 8px;
|
|
232
|
-
overflow: hidden;
|
|
233
|
-
min-height: 353px;
|
|
234
|
-
}
|
|
235
|
-
.react-google-flight-datepicker .calendar-wrapper.single {
|
|
236
|
-
margin-left: 36px;
|
|
237
|
-
margin-right: 36px;
|
|
238
|
-
}
|
|
239
|
-
.react-google-flight-datepicker .tooltip-text {
|
|
240
|
-
position: absolute;
|
|
241
|
-
background-color: #4285f4;
|
|
242
|
-
color: #fff;
|
|
243
|
-
text-align: center;
|
|
244
|
-
border-radius: 6px;
|
|
245
|
-
padding: 5px 15px;
|
|
246
|
-
z-index: 999;
|
|
247
|
-
width: 120px;
|
|
248
|
-
max-width: 120px;
|
|
249
|
-
word-break: break-word;
|
|
250
|
-
visibility: hidden;
|
|
251
|
-
}
|
|
252
|
-
.react-google-flight-datepicker .tooltip-text::before {
|
|
253
|
-
z-index: 1001;
|
|
254
|
-
border: 6px solid transparent;
|
|
255
|
-
background: transparent;
|
|
256
|
-
content: "";
|
|
257
|
-
margin-left: -6px;
|
|
258
|
-
margin-bottom: -12px;
|
|
259
|
-
border-top-color: #4285f4;
|
|
260
|
-
position: absolute;
|
|
261
|
-
bottom: 0;
|
|
262
|
-
left: 50%;
|
|
263
|
-
}
|
|
264
|
-
.react-google-flight-datepicker .calendar-content {
|
|
265
|
-
display: flex;
|
|
266
|
-
padding: 0 2px;
|
|
267
|
-
position: relative;
|
|
268
|
-
overflow: hidden;
|
|
269
|
-
}
|
|
270
|
-
.react-google-flight-datepicker .calendar-content.isAnimating {
|
|
271
|
-
transition: transform 0.2s ease;
|
|
272
|
-
overflow: initial;
|
|
273
|
-
}
|
|
274
|
-
.react-google-flight-datepicker .month-calendar {
|
|
275
|
-
width: 308px;
|
|
276
|
-
color: #3c4043;
|
|
277
|
-
margin-right: 43px;
|
|
278
|
-
}
|
|
279
|
-
.react-google-flight-datepicker .month-calendar.hidden {
|
|
280
|
-
position: absolute;
|
|
281
|
-
visibility: hidden;
|
|
282
|
-
z-index: -1;
|
|
283
|
-
opacity: 0;
|
|
284
|
-
}
|
|
285
|
-
.react-google-flight-datepicker .month-calendar.isAnimating {
|
|
286
|
-
position: absolute;
|
|
287
|
-
left: -350px;
|
|
288
|
-
}
|
|
289
|
-
.react-google-flight-datepicker .month-calendar .month-calendar.slide-next {
|
|
290
|
-
position: absolute;
|
|
291
|
-
left: 350px;
|
|
292
|
-
}
|
|
293
|
-
.react-google-flight-datepicker .month-calendar .month-calendar.slide-prev {
|
|
294
|
-
position: absolute;
|
|
295
|
-
left: -350px;
|
|
296
|
-
}
|
|
297
|
-
.react-google-flight-datepicker .month-name {
|
|
298
|
-
text-align: center;
|
|
299
|
-
font-size: 1rem;
|
|
300
|
-
margin-bottom: 10px;
|
|
301
|
-
}
|
|
302
|
-
.react-google-flight-datepicker .weekdays {
|
|
303
|
-
width: 100%;
|
|
304
|
-
font-size: 0.9rem;
|
|
305
|
-
color: rgba(0, 0, 0, 0.54);
|
|
306
|
-
display: flex;
|
|
307
|
-
}
|
|
308
|
-
.react-google-flight-datepicker .weekdays .weekday {
|
|
309
|
-
display: flex;
|
|
310
|
-
align-items: center;
|
|
311
|
-
justify-content: center;
|
|
312
|
-
height: 36px;
|
|
313
|
-
margin: 0;
|
|
314
|
-
flex-grow: 1;
|
|
315
|
-
}
|
|
316
|
-
.react-google-flight-datepicker .week {
|
|
317
|
-
display: flex;
|
|
318
|
-
justify-content: flex-start;
|
|
319
|
-
}
|
|
320
|
-
.react-google-flight-datepicker .week.first {
|
|
321
|
-
justify-content: flex-end;
|
|
322
|
-
}
|
|
323
|
-
.react-google-flight-datepicker .day {
|
|
324
|
-
display: flex;
|
|
325
|
-
justify-content: center;
|
|
326
|
-
align-items: center;
|
|
327
|
-
cursor: pointer;
|
|
328
|
-
height: 44px;
|
|
329
|
-
margin: 2px 0;
|
|
330
|
-
text-align: center;
|
|
331
|
-
width: 44px;
|
|
332
|
-
vertical-align: top;
|
|
333
|
-
position: relative;
|
|
334
|
-
border-radius: 50%;
|
|
335
|
-
}
|
|
336
|
-
.react-google-flight-datepicker .day .background-day {
|
|
337
|
-
bottom: 0;
|
|
338
|
-
opacity: 0;
|
|
339
|
-
pointer-events: none;
|
|
340
|
-
position: absolute;
|
|
341
|
-
top: 0;
|
|
342
|
-
width: 10px;
|
|
343
|
-
z-index: 1;
|
|
344
|
-
}
|
|
345
|
-
.react-google-flight-datepicker .day .background-day.first-day {
|
|
346
|
-
background: linear-gradient(to right, #fff, #daedfd);
|
|
347
|
-
left: -10px;
|
|
348
|
-
}
|
|
349
|
-
.react-google-flight-datepicker .day .background-day.last-day {
|
|
350
|
-
background: linear-gradient(to left, #fff, #daedfd);
|
|
351
|
-
right: -10px;
|
|
352
|
-
}
|
|
353
|
-
.react-google-flight-datepicker .day::after {
|
|
354
|
-
border-radius: 100%;
|
|
355
|
-
bottom: 0;
|
|
356
|
-
content: "";
|
|
357
|
-
height: 44px;
|
|
358
|
-
left: 0;
|
|
359
|
-
margin: auto;
|
|
360
|
-
position: absolute;
|
|
361
|
-
right: 0;
|
|
362
|
-
top: 0;
|
|
363
|
-
width: 44px;
|
|
364
|
-
z-index: 2;
|
|
365
|
-
}
|
|
366
|
-
.react-google-flight-datepicker .day:hover::after {
|
|
367
|
-
background-color: #fff;
|
|
368
|
-
border: 2px solid #4285f4;
|
|
369
|
-
bottom: -2px;
|
|
370
|
-
left: -2px;
|
|
371
|
-
right: -2px;
|
|
372
|
-
top: -2px;
|
|
373
|
-
}
|
|
374
|
-
.react-google-flight-datepicker .day.selected {
|
|
375
|
-
color: white;
|
|
376
|
-
}
|
|
377
|
-
.react-google-flight-datepicker .day.selected:hover {
|
|
378
|
-
color: #000;
|
|
379
|
-
}
|
|
380
|
-
.react-google-flight-datepicker .day.selected::after {
|
|
381
|
-
background-color: #4285f4;
|
|
382
|
-
border-radius: 100%;
|
|
383
|
-
}
|
|
384
|
-
.react-google-flight-datepicker .day.selected:hover::after {
|
|
385
|
-
background-color: #fff;
|
|
386
|
-
}
|
|
387
|
-
.react-google-flight-datepicker .day.highlight::before {
|
|
388
|
-
content: "";
|
|
389
|
-
width: 44px;
|
|
390
|
-
height: 44px;
|
|
391
|
-
position: absolute;
|
|
392
|
-
left: 50%;
|
|
393
|
-
top: 50%;
|
|
394
|
-
transform: translate(-50%, -50%);
|
|
395
|
-
background-color: rgba(247, 237, 122, 0.8196078431);
|
|
396
|
-
border-radius: 50%;
|
|
397
|
-
}
|
|
398
|
-
.react-google-flight-datepicker .day.hovered {
|
|
399
|
-
background-color: #d9edfd;
|
|
400
|
-
position: relative;
|
|
401
|
-
border-radius: unset;
|
|
402
|
-
}
|
|
403
|
-
.react-google-flight-datepicker .day.hovered .background-day {
|
|
404
|
-
opacity: 1;
|
|
405
|
-
}
|
|
406
|
-
.react-google-flight-datepicker .day.hovered.end {
|
|
407
|
-
background: linear-gradient(90deg, #d9edfd 50%, #fff 50%);
|
|
408
|
-
}
|
|
409
|
-
.react-google-flight-datepicker .day.hovered:hover {
|
|
410
|
-
background-color: #d9edfd;
|
|
411
|
-
}
|
|
412
|
-
.react-google-flight-datepicker .day.hovered:hover::after {
|
|
413
|
-
border-radius: 100%;
|
|
414
|
-
background-color: #fff;
|
|
415
|
-
}
|
|
416
|
-
.react-google-flight-datepicker .day.selected.hovered {
|
|
417
|
-
background: linear-gradient(90deg, #fff 50%, #d9edfd 50%);
|
|
418
|
-
color: #fff;
|
|
419
|
-
}
|
|
420
|
-
.react-google-flight-datepicker .day.selected.hovered.end {
|
|
421
|
-
background: linear-gradient(90deg, #d9edfd 50%, #fff 50%);
|
|
422
|
-
}
|
|
423
|
-
.react-google-flight-datepicker .day.selected.hovered:hover {
|
|
424
|
-
color: #000;
|
|
425
|
-
}
|
|
426
|
-
.react-google-flight-datepicker .day.selected.hovered::after {
|
|
427
|
-
border-radius: 100%;
|
|
428
|
-
background-color: #4285f4;
|
|
429
|
-
}
|
|
430
|
-
.react-google-flight-datepicker .day.selected.hovered:hover::after {
|
|
431
|
-
background-color: #fff;
|
|
432
|
-
}
|
|
433
|
-
.react-google-flight-datepicker .day.disabled {
|
|
434
|
-
pointer-events: none;
|
|
435
|
-
color: rgba(0, 0, 0, 0.26);
|
|
436
|
-
}
|
|
437
|
-
.react-google-flight-datepicker .day.disabled.selected {
|
|
438
|
-
color: #fff;
|
|
439
|
-
}
|
|
440
|
-
.react-google-flight-datepicker .day .text-day {
|
|
441
|
-
position: relative;
|
|
442
|
-
z-index: 3;
|
|
443
|
-
}
|
|
444
|
-
.react-google-flight-datepicker .day-content {
|
|
445
|
-
display: flex;
|
|
446
|
-
flex-direction: column;
|
|
447
|
-
align-items: center;
|
|
448
|
-
gap: 2px;
|
|
449
|
-
}
|
|
450
|
-
.react-google-flight-datepicker .sub-text {
|
|
451
|
-
font-size: 0.75em;
|
|
452
|
-
color: #666;
|
|
453
|
-
text-align: center;
|
|
454
|
-
}
|
|
455
|
-
.react-google-flight-datepicker .day.has-subtext {
|
|
456
|
-
padding-bottom: 4px;
|
|
457
|
-
}
|
|
458
|
-
.react-google-flight-datepicker .calendar-flippers {
|
|
459
|
-
position: absolute;
|
|
460
|
-
top: 0;
|
|
461
|
-
left: 0;
|
|
462
|
-
bottom: 0;
|
|
463
|
-
right: 0;
|
|
464
|
-
display: flex;
|
|
465
|
-
justify-content: space-between;
|
|
466
|
-
align-items: center;
|
|
467
|
-
pointer-events: none;
|
|
468
|
-
}
|
|
469
|
-
.react-google-flight-datepicker .flipper-button {
|
|
470
|
-
background-color: #fff;
|
|
471
|
-
border-radius: 100%;
|
|
472
|
-
box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24);
|
|
473
|
-
cursor: pointer;
|
|
474
|
-
height: 40px;
|
|
475
|
-
width: 40px;
|
|
476
|
-
display: flex;
|
|
477
|
-
justify-content: center;
|
|
478
|
-
align-items: center;
|
|
479
|
-
margin: 0 -20px;
|
|
480
|
-
pointer-events: all;
|
|
481
|
-
border: none;
|
|
482
|
-
outline: none;
|
|
483
|
-
}
|
|
484
|
-
.react-google-flight-datepicker .flipper-button:focus:hover {
|
|
485
|
-
outline: none;
|
|
486
|
-
box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24), 0 0 0 2px rgba(0, 0, 0, 0.1);
|
|
487
|
-
}
|
|
488
|
-
.react-google-flight-datepicker .flipper-button svg {
|
|
489
|
-
width: 24px;
|
|
490
|
-
height: 24px;
|
|
491
|
-
}
|
|
492
|
-
.react-google-flight-datepicker .flipper-button.disabled {
|
|
493
|
-
cursor: default;
|
|
494
|
-
}
|
|
495
|
-
.react-google-flight-datepicker .flipper-button.disabled svg {
|
|
496
|
-
fill: #93989e;
|
|
497
|
-
}
|
|
498
|
-
.react-google-flight-datepicker .dialog-footer {
|
|
499
|
-
align-items: center;
|
|
500
|
-
display: flex;
|
|
501
|
-
flex-direction: row-reverse;
|
|
502
|
-
padding: 8px;
|
|
503
|
-
}
|
|
504
|
-
.react-google-flight-datepicker .dialog-footer .submit-button {
|
|
505
|
-
border-radius: 8px;
|
|
506
|
-
padding: 10px 8px;
|
|
507
|
-
border: none;
|
|
508
|
-
line-height: 16px;
|
|
509
|
-
text-transform: uppercase;
|
|
510
|
-
color: #fff;
|
|
511
|
-
background: #4285f4;
|
|
512
|
-
height: 36px;
|
|
513
|
-
min-width: 88px;
|
|
514
|
-
font-weight: 500;
|
|
515
|
-
font-size: 0.9rem;
|
|
516
|
-
cursor: pointer;
|
|
517
|
-
}
|
|
518
|
-
@media screen and (max-width: 768px) {
|
|
519
|
-
.react-google-flight-datepicker .date-picker-demo {
|
|
520
|
-
width: 100%;
|
|
521
|
-
}
|
|
522
|
-
.react-google-flight-datepicker .date-picker-input {
|
|
523
|
-
height: 40px;
|
|
524
|
-
border: none;
|
|
525
|
-
border-radius: 0;
|
|
526
|
-
position: relative;
|
|
527
|
-
}
|
|
528
|
-
.react-google-flight-datepicker .date {
|
|
529
|
-
border: 1px solid #dadce0;
|
|
530
|
-
border-radius: 5px;
|
|
531
|
-
padding: 0 10px;
|
|
532
|
-
flex-grow: 1;
|
|
533
|
-
}
|
|
534
|
-
.react-google-flight-datepicker .date:nth-child(2) {
|
|
535
|
-
margin-left: 10px;
|
|
536
|
-
}
|
|
537
|
-
.react-google-flight-datepicker .date.is-focus {
|
|
538
|
-
height: 40px;
|
|
539
|
-
}
|
|
540
|
-
.react-google-flight-datepicker .date:first-child::before {
|
|
541
|
-
display: none;
|
|
542
|
-
}
|
|
543
|
-
.react-google-flight-datepicker .icon-calendar {
|
|
544
|
-
display: none;
|
|
545
|
-
}
|
|
546
|
-
.react-google-flight-datepicker .icon-calendar.mobile {
|
|
547
|
-
display: block;
|
|
548
|
-
}
|
|
549
|
-
.react-google-flight-datepicker .reset-button {
|
|
550
|
-
display: none;
|
|
551
|
-
}
|
|
552
|
-
.react-google-flight-datepicker .reset-button.mobile {
|
|
553
|
-
display: block;
|
|
554
|
-
color: rgba(0, 0, 0, 0.87);
|
|
555
|
-
min-width: 88px;
|
|
556
|
-
font-weight: 500;
|
|
557
|
-
}
|
|
558
|
-
.react-google-flight-datepicker .change-date-group,
|
|
559
|
-
.react-google-flight-datepicker .divider,
|
|
560
|
-
.react-google-flight-datepicker .calendar-flippers,
|
|
561
|
-
.react-google-flight-datepicker .weekdays {
|
|
562
|
-
display: none;
|
|
563
|
-
}
|
|
564
|
-
.react-google-flight-datepicker .back-button {
|
|
565
|
-
display: block;
|
|
566
|
-
width: 56px;
|
|
567
|
-
height: 100%;
|
|
568
|
-
margin-right: 16px;
|
|
569
|
-
padding: 0;
|
|
570
|
-
}
|
|
571
|
-
.react-google-flight-datepicker .back-button svg {
|
|
572
|
-
width: 20px;
|
|
573
|
-
height: 20px;
|
|
574
|
-
fill: rgba(0, 0, 0, 0.7);
|
|
100
|
+
};
|
|
101
|
+
var DatePickerProvider = ({
|
|
102
|
+
children,
|
|
103
|
+
dateState,
|
|
104
|
+
config,
|
|
105
|
+
uiState,
|
|
106
|
+
display,
|
|
107
|
+
locale = "en"
|
|
108
|
+
}) => {
|
|
109
|
+
const [localeState, setLocaleState] = useState({
|
|
110
|
+
currentLocale: "en",
|
|
111
|
+
isLocaleReady: locale === "en"
|
|
112
|
+
});
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (locale !== "en") {
|
|
115
|
+
setLocaleState((prev) => ({ ...prev, isLocaleReady: false }));
|
|
116
|
+
loadLocale(locale).then((success) => {
|
|
117
|
+
if (success) {
|
|
118
|
+
dayjs2.locale(locale);
|
|
119
|
+
setLocaleState({
|
|
120
|
+
currentLocale: locale,
|
|
121
|
+
isLocaleReady: true
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
dayjs2.locale("en");
|
|
125
|
+
setLocaleState({
|
|
126
|
+
currentLocale: "en",
|
|
127
|
+
isLocaleReady: true
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
dayjs2.locale("en");
|
|
133
|
+
setLocaleState({
|
|
134
|
+
currentLocale: "en",
|
|
135
|
+
isLocaleReady: true
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}, [locale]);
|
|
139
|
+
if (!localeState.isLocaleReady) {
|
|
140
|
+
return null;
|
|
575
141
|
}
|
|
576
|
-
.
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
142
|
+
return /* @__PURE__ */ jsx(LocaleContext.Provider, { value: localeState, children: /* @__PURE__ */ jsx(DateStateContext.Provider, { value: dateState, children: /* @__PURE__ */ jsx(DatePickerConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsx(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx(DisplayContext.Provider, { value: display, children }) }) }) }) });
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/lib/assets/svg/calendar.svg
|
|
146
|
+
import * as React2 from "react";
|
|
147
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
148
|
+
var SvgCalendar = (props) => /* @__PURE__ */ jsx2("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ jsx2("path", { d: "M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 002 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z" }) });
|
|
149
|
+
var calendar_default = SvgCalendar;
|
|
150
|
+
|
|
151
|
+
// src/lib/components/DatePicker/DateInput.tsx
|
|
152
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
153
|
+
import cx from "classnames";
|
|
154
|
+
import dayjs3 from "dayjs";
|
|
155
|
+
|
|
156
|
+
// src/lib/assets/svg/prev.svg
|
|
157
|
+
import * as React3 from "react";
|
|
158
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
159
|
+
var SvgPrev = (props) => /* @__PURE__ */ jsx3("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ jsx3("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }) });
|
|
160
|
+
var prev_default = SvgPrev;
|
|
161
|
+
|
|
162
|
+
// src/lib/assets/svg/next.svg
|
|
163
|
+
import * as React4 from "react";
|
|
164
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
165
|
+
var SvgNext = (props) => /* @__PURE__ */ jsx4("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ jsx4("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) });
|
|
166
|
+
var next_default = SvgNext;
|
|
167
|
+
|
|
168
|
+
// src/lib/components/DatePicker/DateInput.tsx
|
|
169
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
170
|
+
var DateInput = ({
|
|
171
|
+
type,
|
|
172
|
+
showIcon = false,
|
|
173
|
+
tabIndex = 0,
|
|
174
|
+
nonFocusable = false
|
|
175
|
+
}) => {
|
|
176
|
+
const [formattedDate, setFormattedDate] = useState2(null);
|
|
177
|
+
const [disablePrev, setDisablePrev] = useState2(false);
|
|
178
|
+
const [disableNext, setDisableNext] = useState2(false);
|
|
179
|
+
const {
|
|
180
|
+
fromDate,
|
|
181
|
+
toDate,
|
|
182
|
+
inputFocus,
|
|
183
|
+
handleClickDateInput,
|
|
184
|
+
handleChangeDate
|
|
185
|
+
} = useDateState();
|
|
186
|
+
const {
|
|
187
|
+
isSingle,
|
|
188
|
+
minDate,
|
|
189
|
+
maxDate,
|
|
190
|
+
dateFormat
|
|
191
|
+
} = useDatePickerConfig();
|
|
192
|
+
const {
|
|
193
|
+
startDatePlaceholder,
|
|
194
|
+
endDatePlaceholder
|
|
195
|
+
} = useDisplayCustomization();
|
|
196
|
+
const value = type === "from" ? fromDate : toDate;
|
|
197
|
+
const placeholder = type === "from" ? startDatePlaceholder : endDatePlaceholder;
|
|
198
|
+
useEffect2(() => {
|
|
199
|
+
if (value) {
|
|
200
|
+
let formattedValue = value.clone().locale(dayjs3.locale());
|
|
201
|
+
let text = formattedValue.format("ddd, DD MMM");
|
|
202
|
+
if (dateFormat) {
|
|
203
|
+
text = value.format(dateFormat);
|
|
204
|
+
}
|
|
205
|
+
setFormattedDate(text);
|
|
206
|
+
const minDateDayjs = minDate ? dayjs3(minDate) : null;
|
|
207
|
+
const maxDateDayjs = maxDate ? dayjs3(maxDate) : null;
|
|
208
|
+
if (minDateDayjs?.add(1, "day").isAfter(value, "date") || type === "to" && fromDate && value.isBefore(fromDate.add(1, "day"), "date")) {
|
|
209
|
+
setDisablePrev(true);
|
|
210
|
+
} else {
|
|
211
|
+
setDisablePrev(false);
|
|
212
|
+
}
|
|
213
|
+
if (maxDateDayjs?.subtract(1, "day").isBefore(value, "date")) {
|
|
214
|
+
setDisableNext(true);
|
|
215
|
+
} else {
|
|
216
|
+
setDisableNext(false);
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
setFormattedDate(null);
|
|
220
|
+
}
|
|
221
|
+
}, [value, fromDate, minDate, maxDate, dateFormat, type]);
|
|
222
|
+
const prevDate = (e) => {
|
|
223
|
+
e.stopPropagation();
|
|
224
|
+
if (value) {
|
|
225
|
+
handleChangeDate(value.subtract(1, "day"), type);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const nextDate = (e) => {
|
|
229
|
+
e.stopPropagation();
|
|
230
|
+
if (value) {
|
|
231
|
+
handleChangeDate(value.add(1, "day"), type);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const handleClick = () => {
|
|
235
|
+
handleClickDateInput(type);
|
|
236
|
+
};
|
|
237
|
+
return /* @__PURE__ */ jsxs(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
className: cx("date", {
|
|
241
|
+
"is-focus": inputFocus === type && !isSingle,
|
|
242
|
+
"is-single": isSingle
|
|
243
|
+
}),
|
|
244
|
+
role: "button",
|
|
245
|
+
tabIndex: nonFocusable ? -1 : tabIndex,
|
|
246
|
+
onClick: handleClick,
|
|
247
|
+
id: `${type}-date-input-button`,
|
|
248
|
+
children: [
|
|
249
|
+
showIcon && /* @__PURE__ */ jsx5(calendar_default, { className: "icon-calendar", viewBox: "0 0 24 24" }),
|
|
250
|
+
/* @__PURE__ */ jsx5("div", { className: "selected-date", children: formattedDate ?? /* @__PURE__ */ jsx5("div", { className: "date-placeholder", children: placeholder }) }),
|
|
251
|
+
formattedDate && /* @__PURE__ */ jsxs("div", { className: "change-date-group", children: [
|
|
252
|
+
/* @__PURE__ */ jsx5(
|
|
253
|
+
"button",
|
|
254
|
+
{
|
|
255
|
+
type: "button",
|
|
256
|
+
className: "btn-outline change-date-button",
|
|
257
|
+
onClick: prevDate,
|
|
258
|
+
tabIndex: nonFocusable ? -1 : 0,
|
|
259
|
+
disabled: disablePrev,
|
|
260
|
+
children: /* @__PURE__ */ jsx5(prev_default, { viewBox: "0 0 24 24", className: "icon-arrow" })
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/* @__PURE__ */ jsx5(
|
|
264
|
+
"button",
|
|
265
|
+
{
|
|
266
|
+
type: "button",
|
|
267
|
+
className: "btn-outline change-date-button",
|
|
268
|
+
onClick: nextDate,
|
|
269
|
+
tabIndex: nonFocusable ? -1 : 0,
|
|
270
|
+
disabled: disableNext,
|
|
271
|
+
children: /* @__PURE__ */ jsx5(next_default, { viewBox: "0 0 24 24", className: "icon-arrow" })
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
] })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// src/lib/components/DatePicker/DateInputGroup.tsx
|
|
281
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
282
|
+
var DateInputGroup = ({
|
|
283
|
+
showIcon = false,
|
|
284
|
+
nonFocusable = false
|
|
285
|
+
}) => {
|
|
286
|
+
const { isSingle } = useDatePickerConfig();
|
|
287
|
+
const { dateInputSeperator } = useDisplayCustomization();
|
|
288
|
+
return /* @__PURE__ */ jsxs2("div", { className: "date-picker-input", children: [
|
|
289
|
+
showIcon && /* @__PURE__ */ jsx6(calendar_default, { className: "icon-calendar mobile", viewBox: "0 0 24 24" }),
|
|
290
|
+
/* @__PURE__ */ jsxs2("div", { className: "date-picker-date-group", children: [
|
|
291
|
+
/* @__PURE__ */ jsx6(
|
|
292
|
+
DateInput,
|
|
293
|
+
{
|
|
294
|
+
type: "from",
|
|
295
|
+
tabIndex: nonFocusable ? -1 : 0,
|
|
296
|
+
showIcon: true,
|
|
297
|
+
nonFocusable
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
!isSingle && dateInputSeperator && /* @__PURE__ */ jsx6("div", { className: "date-input-separator", children: dateInputSeperator }),
|
|
301
|
+
!isSingle && /* @__PURE__ */ jsx6(
|
|
302
|
+
DateInput,
|
|
303
|
+
{
|
|
304
|
+
type: "to",
|
|
305
|
+
tabIndex: nonFocusable ? -1 : 0,
|
|
306
|
+
showIcon: false,
|
|
307
|
+
nonFocusable
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] })
|
|
311
|
+
] });
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/lib/components/DatePicker/DialogWrapper.tsx
|
|
315
|
+
import { createPortal } from "react-dom";
|
|
316
|
+
|
|
317
|
+
// src/lib/hooks/useClientSide.ts
|
|
318
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
319
|
+
var useClientSide = () => {
|
|
320
|
+
const [isClient, setIsClient] = useState3(false);
|
|
321
|
+
useEffect3(() => {
|
|
322
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
323
|
+
setIsClient(true);
|
|
324
|
+
} else {
|
|
325
|
+
console.warn("Client-side context not available");
|
|
326
|
+
}
|
|
327
|
+
}, []);
|
|
328
|
+
return isClient;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
// src/lib/components/DatePicker/DialogWrapper.tsx
|
|
332
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
333
|
+
var DialogWrapper = ({
|
|
334
|
+
children = null,
|
|
335
|
+
isMobile = false
|
|
336
|
+
}) => {
|
|
337
|
+
const isClient = useClientSide();
|
|
338
|
+
if (!isClient) return null;
|
|
339
|
+
return isMobile ? createPortal(/* @__PURE__ */ jsx7("div", { children }), document.body) : children;
|
|
340
|
+
};
|
|
341
|
+
var DialogWrapper_default = DialogWrapper;
|
|
342
|
+
|
|
343
|
+
// src/lib/components/DatePicker/Dialog.tsx
|
|
344
|
+
import { useEffect as useEffect7, useState as useState6, useRef as useRef4 } from "react";
|
|
345
|
+
import cx6 from "classnames";
|
|
346
|
+
|
|
347
|
+
// src/lib/assets/svg/back.svg
|
|
348
|
+
import * as React6 from "react";
|
|
349
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
350
|
+
var SvgBack = (props) => /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 492 492", ...props, children: /* @__PURE__ */ jsx8("path", { d: "M464.3 207.4l.8.2H136l103.5-103.7c5-5.1 7.8-12 7.8-19.2 0-7.2-2.7-14-7.8-19l-16.1-16.2c-5-5-11.8-7.8-19-7.8-7.2 0-14 2.8-19 7.8L7.8 227C2.8 232 0 238.8 0 246c0 7.3 2.8 14 7.8 19.2l177.5 177.4c5 5 11.8 7.8 19 7.8 7.2 0 14-2.8 19-7.8l16-16.1a26.6 26.6 0 000-37.7L134.8 284.4h330a27.9 27.9 0 0027.3-27.6V234a27.3 27.3 0 00-27.7-26.6z" }) });
|
|
351
|
+
var back_default = SvgBack;
|
|
352
|
+
|
|
353
|
+
// src/lib/components/DatePicker/DialogContentMobile.tsx
|
|
354
|
+
import React10, { useEffect as useEffect5, useState as useState4, useRef as useRef2 } from "react";
|
|
355
|
+
import dayjs6 from "dayjs";
|
|
356
|
+
import { VariableSizeList as List } from "react-window";
|
|
357
|
+
import AutoSizer from "react-virtualized-auto-sizer";
|
|
358
|
+
|
|
359
|
+
// src/lib/components/DatePicker/MonthCalendar.tsx
|
|
360
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
361
|
+
import cx4 from "classnames";
|
|
362
|
+
import dayjs5 from "dayjs";
|
|
363
|
+
|
|
364
|
+
// src/lib/components/DatePicker/Week.tsx
|
|
365
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
366
|
+
import cx3 from "classnames";
|
|
367
|
+
import dayjs4 from "dayjs";
|
|
368
|
+
|
|
369
|
+
// src/lib/components/DatePicker/Day.tsx
|
|
370
|
+
import { forwardRef, useCallback as useCallback2, useEffect as useEffect4, useRef } from "react";
|
|
371
|
+
import cx2 from "classnames";
|
|
372
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
373
|
+
var Day = forwardRef(({
|
|
374
|
+
dateIndex,
|
|
375
|
+
dateValue,
|
|
376
|
+
isEndDay,
|
|
377
|
+
selected,
|
|
378
|
+
hovered,
|
|
379
|
+
disabled,
|
|
380
|
+
totalDay,
|
|
381
|
+
highlight,
|
|
382
|
+
handleHoverDay,
|
|
383
|
+
subText
|
|
384
|
+
}, ref) => {
|
|
385
|
+
const dayRef = useRef(null);
|
|
386
|
+
const { onSelectDate, onHoverDate } = useDateState();
|
|
387
|
+
const selectDate = (e) => {
|
|
388
|
+
e.stopPropagation();
|
|
389
|
+
e.preventDefault();
|
|
390
|
+
if (disabled) return;
|
|
391
|
+
onSelectDate(dateValue);
|
|
392
|
+
};
|
|
393
|
+
const handleHoverDate = () => {
|
|
394
|
+
if (disabled) return;
|
|
395
|
+
onHoverDate(dateValue);
|
|
396
|
+
handleHoverDay(dateValue);
|
|
397
|
+
};
|
|
398
|
+
const handleTooltipPosition = useCallback2(() => {
|
|
399
|
+
if (!ref || typeof ref === "function") return;
|
|
400
|
+
const element = ref.current;
|
|
401
|
+
if (element && dayRef.current) {
|
|
402
|
+
element.style.left = `${dayRef.current.offsetLeft - element.offsetWidth + 135}px`;
|
|
403
|
+
element.style.top = `${dayRef.current.offsetTop - element.offsetHeight - 15}px`;
|
|
404
|
+
element.style.visibility = "visible";
|
|
405
|
+
}
|
|
406
|
+
}, [ref]);
|
|
407
|
+
const handleTooltipHidden = useCallback2(() => {
|
|
408
|
+
if (!ref || typeof ref === "function") return;
|
|
409
|
+
const element = ref.current;
|
|
410
|
+
if (element) {
|
|
411
|
+
element.style.visibility = "hidden";
|
|
412
|
+
}
|
|
413
|
+
}, [ref]);
|
|
414
|
+
useEffect4(() => {
|
|
415
|
+
const currentRef = dayRef.current;
|
|
416
|
+
if (currentRef) {
|
|
417
|
+
currentRef.addEventListener("mouseover", handleTooltipPosition);
|
|
418
|
+
currentRef.addEventListener("mouseleave", handleTooltipHidden);
|
|
419
|
+
}
|
|
420
|
+
return () => {
|
|
421
|
+
if (currentRef) {
|
|
422
|
+
currentRef.removeEventListener("mouseover", handleTooltipPosition);
|
|
423
|
+
currentRef.removeEventListener("mouseleave", handleTooltipHidden);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}, [handleTooltipPosition, handleTooltipHidden]);
|
|
427
|
+
return /* @__PURE__ */ jsxs3(
|
|
428
|
+
"div",
|
|
429
|
+
{
|
|
430
|
+
className: cx2("day", {
|
|
431
|
+
selected,
|
|
432
|
+
hovered,
|
|
433
|
+
disabled,
|
|
434
|
+
highlight,
|
|
435
|
+
end: isEndDay,
|
|
436
|
+
"has-subtext": !!subText
|
|
437
|
+
}),
|
|
438
|
+
onClick: selectDate,
|
|
439
|
+
onMouseEnter: handleHoverDate,
|
|
440
|
+
role: "button",
|
|
441
|
+
tabIndex: -1,
|
|
442
|
+
"data-day-index": dateIndex,
|
|
443
|
+
"data-date-value": dateValue.valueOf(),
|
|
444
|
+
ref: dayRef,
|
|
445
|
+
children: [
|
|
446
|
+
hovered && !(isEndDay && dateIndex === totalDay) && !(dateIndex === 1 && selected && !isEndDay) && /* @__PURE__ */ jsx9(
|
|
447
|
+
"div",
|
|
448
|
+
{
|
|
449
|
+
className: cx2("background-day", {
|
|
450
|
+
"first-day": dateIndex === 1,
|
|
451
|
+
"last-day": dateIndex === totalDay
|
|
452
|
+
})
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
/* @__PURE__ */ jsxs3("div", { className: "day-content", children: [
|
|
456
|
+
/* @__PURE__ */ jsx9("div", { className: "text-day", children: dateIndex }),
|
|
457
|
+
subText && /* @__PURE__ */ jsx9(
|
|
458
|
+
"div",
|
|
459
|
+
{
|
|
460
|
+
className: "sub-text",
|
|
461
|
+
style: {
|
|
462
|
+
position: "relative",
|
|
463
|
+
zIndex: 3,
|
|
464
|
+
color: selected && !hovered ? "#fff" : "#666"
|
|
465
|
+
},
|
|
466
|
+
children: subText
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
] })
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
});
|
|
474
|
+
Day.displayName = "Day";
|
|
475
|
+
|
|
476
|
+
// src/lib/components/DatePicker/Week.tsx
|
|
477
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
478
|
+
var Week = forwardRef2(({
|
|
479
|
+
isFirst,
|
|
480
|
+
week,
|
|
481
|
+
month,
|
|
482
|
+
year,
|
|
483
|
+
totalDay,
|
|
484
|
+
weekIndex,
|
|
485
|
+
handleHoverDay
|
|
486
|
+
}, ref) => {
|
|
487
|
+
const {
|
|
488
|
+
fromDate,
|
|
489
|
+
toDate,
|
|
490
|
+
hoverDate
|
|
491
|
+
} = useDateState();
|
|
492
|
+
const {
|
|
493
|
+
minDate,
|
|
494
|
+
maxDate,
|
|
495
|
+
isSingle,
|
|
496
|
+
highlightToday
|
|
497
|
+
} = useDatePickerConfig();
|
|
498
|
+
const { subTextDict } = useDisplayCustomization();
|
|
499
|
+
const generateDay = () => {
|
|
500
|
+
return Array.from({ length: week.days }, (_, index) => {
|
|
501
|
+
const dateIndex = index + week.start;
|
|
502
|
+
const dateValue = dayjs4(`${year}-${month + 1}-${dateIndex}`);
|
|
503
|
+
const disabled = minDate && dateValue.isBefore(minDate, "date") || maxDate && dateValue.isAfter(maxDate, "date");
|
|
504
|
+
const selected = fromDate && dateValue.isSame(fromDate, "date") || toDate && dateValue.isSame(toDate, "date");
|
|
505
|
+
let hovered = false;
|
|
506
|
+
const highlight = highlightToday && dateValue.isSame(/* @__PURE__ */ new Date(), "date");
|
|
507
|
+
if (fromDate && !fromDate.isSame(toDate, "date") && !isSingle) {
|
|
508
|
+
if (toDate && !fromDate.isAfter(dateValue, "date") && !toDate.isBefore(dateValue, "date")) {
|
|
509
|
+
hovered = true;
|
|
510
|
+
}
|
|
511
|
+
if (!toDate && !dateValue.isBefore(fromDate, "date") && !(hoverDate && hoverDate.isBefore(dateValue, "date")) && fromDate.isBefore(hoverDate, "date")) {
|
|
512
|
+
hovered = true;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
const isEndDate = toDate && dateValue.isSame(toDate, "date") || !toDate && hoverDate && dateValue.isSame(hoverDate, "date");
|
|
516
|
+
const subText = !subTextDict ? "" : subTextDict[dateValue.format("YYYY-MM-DD")] ?? "\xA0";
|
|
517
|
+
return /* @__PURE__ */ jsx10(
|
|
518
|
+
Day,
|
|
519
|
+
{
|
|
520
|
+
dateIndex,
|
|
521
|
+
dateValue,
|
|
522
|
+
selected,
|
|
523
|
+
hovered,
|
|
524
|
+
highlight,
|
|
525
|
+
disabled,
|
|
526
|
+
isEndDay: isEndDate,
|
|
527
|
+
totalDay,
|
|
528
|
+
handleHoverDay,
|
|
529
|
+
subText,
|
|
530
|
+
ref
|
|
531
|
+
},
|
|
532
|
+
index
|
|
533
|
+
);
|
|
534
|
+
});
|
|
535
|
+
};
|
|
536
|
+
return /* @__PURE__ */ jsx10("div", { className: cx3("week", { first: isFirst }), children: generateDay() });
|
|
537
|
+
});
|
|
538
|
+
Week.displayName = "Week";
|
|
539
|
+
|
|
540
|
+
// src/lib/components/DatePicker/MonthCalendar.tsx
|
|
541
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
542
|
+
var MonthCalendar = forwardRef3(({
|
|
543
|
+
month,
|
|
544
|
+
year,
|
|
545
|
+
hidden = false,
|
|
546
|
+
isAnimating = false,
|
|
547
|
+
handleHoverDay,
|
|
548
|
+
className
|
|
549
|
+
}, ref) => {
|
|
550
|
+
const {
|
|
551
|
+
startWeekDay,
|
|
552
|
+
weekDayFormat,
|
|
553
|
+
monthFormat,
|
|
554
|
+
singleCalendar
|
|
555
|
+
} = useDatePickerConfig();
|
|
556
|
+
const generateWeek = () => {
|
|
557
|
+
const { totalWeek, totalDay } = getMonthInfo(year, month, startWeekDay);
|
|
558
|
+
return totalWeek.map((week) => {
|
|
559
|
+
const weekKey = `${year}-${month}-${week.start}`;
|
|
560
|
+
return /* @__PURE__ */ jsx11(
|
|
561
|
+
Week,
|
|
562
|
+
{
|
|
563
|
+
week,
|
|
564
|
+
month,
|
|
565
|
+
year,
|
|
566
|
+
isFirst: week === totalWeek[0],
|
|
567
|
+
totalDay,
|
|
568
|
+
weekIndex: totalWeek.indexOf(week),
|
|
569
|
+
handleHoverDay,
|
|
570
|
+
ref
|
|
571
|
+
},
|
|
572
|
+
weekKey
|
|
573
|
+
);
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
const generateWeekDay = () => {
|
|
577
|
+
const arrWeekDay = getWeekDay(startWeekDay, weekDayFormat);
|
|
578
|
+
return arrWeekDay.map((day) => {
|
|
579
|
+
return /* @__PURE__ */ jsx11("div", { className: "weekday", children: day }, `weekday-${day.toLowerCase()}`);
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
const getMonthDisplay = () => {
|
|
583
|
+
const date = dayjs5(`${year}-${month + 1}-1`);
|
|
584
|
+
return monthFormat ? date.format(monthFormat) : date.format("MMMM - YYYY");
|
|
585
|
+
};
|
|
586
|
+
return /* @__PURE__ */ jsxs4(
|
|
587
|
+
"div",
|
|
588
|
+
{
|
|
589
|
+
className: cx4("month-calendar", {
|
|
590
|
+
isAnimating,
|
|
591
|
+
hidden,
|
|
592
|
+
single: singleCalendar
|
|
593
|
+
}, className),
|
|
594
|
+
"data-month-index": month + 1,
|
|
595
|
+
children: [
|
|
596
|
+
/* @__PURE__ */ jsx11("div", { className: "month-name", children: getMonthDisplay() }),
|
|
597
|
+
/* @__PURE__ */ jsx11("div", { className: "weekdays", children: generateWeekDay() }),
|
|
598
|
+
/* @__PURE__ */ jsx11("div", { className: "week-container", children: generateWeek() })
|
|
599
|
+
]
|
|
600
|
+
}
|
|
601
|
+
);
|
|
602
|
+
});
|
|
603
|
+
MonthCalendar.displayName = "MonthCalendar";
|
|
604
|
+
|
|
605
|
+
// src/lib/components/DatePicker/DialogContentMobile.tsx
|
|
606
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
607
|
+
var DialogContentMobile = () => {
|
|
608
|
+
const [rowCount, setRowCount] = useState4(2400);
|
|
609
|
+
const listRef = useRef2(null);
|
|
610
|
+
const {
|
|
611
|
+
fromDate
|
|
612
|
+
} = useDateState();
|
|
613
|
+
const {
|
|
614
|
+
startWeekDay,
|
|
615
|
+
minDate,
|
|
616
|
+
maxDate,
|
|
617
|
+
weekDayFormat
|
|
618
|
+
} = useDatePickerConfig();
|
|
619
|
+
const {
|
|
620
|
+
complsOpen
|
|
621
|
+
} = useUIState();
|
|
622
|
+
const {
|
|
623
|
+
tooltip,
|
|
624
|
+
subTextDict
|
|
625
|
+
} = useDisplayCustomization();
|
|
626
|
+
const minYear = minDate ? dayjs6(minDate).year() : 1900;
|
|
627
|
+
const minMonth = minDate ? dayjs6(minDate).month() : 0;
|
|
628
|
+
useEffect5(() => {
|
|
629
|
+
if (maxDate) {
|
|
630
|
+
const _minDate = minDate ? dayjs6(minDate) : dayjs6("1900-01-01");
|
|
631
|
+
setRowCount(dayjs6(maxDate).diff(_minDate, "month") + 1);
|
|
632
|
+
}
|
|
633
|
+
}, [maxDate, minDate]);
|
|
634
|
+
useEffect5(() => {
|
|
635
|
+
if (listRef.current && complsOpen) {
|
|
636
|
+
const date = fromDate ? dayjs6(fromDate) : dayjs6();
|
|
637
|
+
let monthDiff = date.diff(dayjs6("1900-01-01"), "month");
|
|
638
|
+
if (minDate) {
|
|
639
|
+
monthDiff = date.diff(dayjs6(minDate), "month");
|
|
640
|
+
}
|
|
641
|
+
listRef.current.scrollToItem(monthDiff + 1, "smart");
|
|
642
|
+
}
|
|
643
|
+
}, [complsOpen, fromDate, minDate]);
|
|
644
|
+
const getMonthYearFromIndex = (index) => {
|
|
645
|
+
const _index = index + minMonth;
|
|
646
|
+
const year = minYear + Math.floor(_index / 12);
|
|
647
|
+
const month = _index % 12;
|
|
648
|
+
return { year, month };
|
|
649
|
+
};
|
|
650
|
+
const Row = React10.memo(({ index, style }) => {
|
|
651
|
+
const { year, month } = getMonthYearFromIndex(index);
|
|
652
|
+
return /* @__PURE__ */ jsx12("div", { style, children: /* @__PURE__ */ jsx12(
|
|
653
|
+
MonthCalendar,
|
|
654
|
+
{
|
|
655
|
+
month,
|
|
656
|
+
year,
|
|
657
|
+
hidden: false,
|
|
658
|
+
isAnimating: false,
|
|
659
|
+
handleHoverDay: () => {
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
) });
|
|
663
|
+
});
|
|
664
|
+
Row.displayName = "CalendarRow";
|
|
665
|
+
const getItemSize = (index) => {
|
|
666
|
+
const { year, month } = getMonthYearFromIndex(index);
|
|
667
|
+
const { totalWeek } = getMonthInfo(year, month, startWeekDay || "monday");
|
|
668
|
+
return totalWeek.length * 48 + 34;
|
|
669
|
+
};
|
|
670
|
+
const renderMonthCalendars = () => {
|
|
671
|
+
return /* @__PURE__ */ jsx12(AutoSizer, { children: ({ height, width }) => /* @__PURE__ */ jsx12(
|
|
672
|
+
List,
|
|
673
|
+
{
|
|
674
|
+
ref: listRef,
|
|
675
|
+
width,
|
|
676
|
+
height: height - 36,
|
|
677
|
+
itemCount: rowCount,
|
|
678
|
+
itemSize: getItemSize,
|
|
679
|
+
children: Row
|
|
680
|
+
}
|
|
681
|
+
) });
|
|
682
|
+
};
|
|
683
|
+
const generateWeekDay = () => {
|
|
684
|
+
const arrWeekDay = getWeekDay(startWeekDay || "monday", weekDayFormat);
|
|
685
|
+
return arrWeekDay.map((day, index) => /* @__PURE__ */ jsx12("div", { className: "weekday", children: day }, index));
|
|
686
|
+
};
|
|
687
|
+
return /* @__PURE__ */ jsx12("div", { className: "calendar-wrapper", children: /* @__PURE__ */ jsxs5("div", { className: "calendar-content", children: [
|
|
688
|
+
/* @__PURE__ */ jsx12("div", { className: "weekdays mobile", children: generateWeekDay() }),
|
|
689
|
+
renderMonthCalendars()
|
|
690
|
+
] }) });
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
// src/lib/components/DatePicker/DialogContentDesktop.tsx
|
|
694
|
+
import {
|
|
695
|
+
useEffect as useEffect6,
|
|
696
|
+
useState as useState5,
|
|
697
|
+
useRef as useRef3,
|
|
698
|
+
useCallback as useCallback3,
|
|
699
|
+
useMemo
|
|
700
|
+
} from "react";
|
|
701
|
+
import cx5 from "classnames";
|
|
702
|
+
import dayjs7 from "dayjs";
|
|
703
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
704
|
+
var useClientSide2 = () => {
|
|
705
|
+
const [isClient, setIsClient] = useState5(false);
|
|
706
|
+
useEffect6(() => {
|
|
707
|
+
setIsClient(true);
|
|
708
|
+
}, []);
|
|
709
|
+
return isClient;
|
|
710
|
+
};
|
|
711
|
+
var DialogContentDesktop = ({
|
|
712
|
+
dateChanged = null
|
|
713
|
+
}) => {
|
|
714
|
+
const isClient = useClientSide2();
|
|
715
|
+
const containerRef = useRef3(null);
|
|
716
|
+
const tooltipRef = useRef3(null);
|
|
717
|
+
const [translateAmount, setTranslateAmount] = useState5(0);
|
|
718
|
+
const [monthArray, setMonthArray] = useState5([]);
|
|
719
|
+
const [focusDate, setFocusDate] = useState5(null);
|
|
720
|
+
const [disablePrev, setDisablePrev] = useState5(false);
|
|
721
|
+
const [disableNext, setDisableNext] = useState5(false);
|
|
722
|
+
const [wrapperWidth, setWrapperWidth] = useState5(0);
|
|
723
|
+
const [dayValue, setDayValue] = useState5(null);
|
|
724
|
+
const [isAnimating, setIsAnimating] = useState5(false);
|
|
725
|
+
const { fromDate } = useDateState();
|
|
726
|
+
const { minDate, maxDate, singleCalendar } = useDatePickerConfig();
|
|
727
|
+
const { complsOpen } = useUIState();
|
|
728
|
+
const { tooltip } = useDisplayCustomization();
|
|
729
|
+
const getArrayMonth = useCallback3((date) => [
|
|
730
|
+
date.subtract(1, "month"),
|
|
731
|
+
date,
|
|
732
|
+
date.add(1, "month"),
|
|
733
|
+
date.add(2, "month")
|
|
734
|
+
], []);
|
|
735
|
+
useEffect6(() => {
|
|
736
|
+
if (!isClient || !containerRef.current) return;
|
|
737
|
+
const updateDimensions = () => {
|
|
738
|
+
const width = containerRef.current.offsetWidth;
|
|
739
|
+
const style = window.getComputedStyle(containerRef.current);
|
|
740
|
+
const translateValue = singleCalendar ? width + parseInt(style.marginLeft) - 8 : width / 2;
|
|
741
|
+
setWrapperWidth(translateValue);
|
|
742
|
+
};
|
|
743
|
+
updateDimensions();
|
|
744
|
+
const resizeObserver = new ResizeObserver(updateDimensions);
|
|
745
|
+
resizeObserver.observe(containerRef.current);
|
|
746
|
+
return () => resizeObserver.disconnect();
|
|
747
|
+
}, [isClient, singleCalendar]);
|
|
748
|
+
useEffect6(() => {
|
|
749
|
+
setFocusDate(fromDate ?? dayjs7());
|
|
750
|
+
}, [complsOpen, fromDate]);
|
|
751
|
+
useEffect6(() => {
|
|
752
|
+
if (!focusDate) return;
|
|
753
|
+
const minDayjs = minDate ? dayjs7(minDate) : null;
|
|
754
|
+
const maxDayjs = maxDate ? dayjs7(maxDate) : null;
|
|
755
|
+
setDisablePrev(
|
|
756
|
+
Boolean(
|
|
757
|
+
minDayjs && focusDate.isBefore(minDayjs.add(1, "month"), "month")
|
|
758
|
+
)
|
|
759
|
+
);
|
|
760
|
+
setDisableNext(
|
|
761
|
+
Boolean(
|
|
762
|
+
maxDayjs && focusDate.isAfter(maxDayjs.subtract(2, "month"), "month")
|
|
763
|
+
)
|
|
764
|
+
);
|
|
765
|
+
setMonthArray(getArrayMonth(focusDate));
|
|
766
|
+
}, [focusDate, minDate, maxDate, getArrayMonth]);
|
|
767
|
+
useEffect6(() => {
|
|
768
|
+
if (!dateChanged || !focusDate) return;
|
|
769
|
+
const monthDiff = dateChanged.diff(focusDate, "month");
|
|
770
|
+
if (monthDiff < -1) decreaseCurrentMonth();
|
|
771
|
+
if (monthDiff > 1) increaseCurrentMonth();
|
|
772
|
+
}, [dateChanged, focusDate]);
|
|
773
|
+
const handleMonthChange = useCallback3((direction) => () => {
|
|
774
|
+
if (direction === "next" && disableNext || direction === "prev" && disablePrev || isAnimating) return;
|
|
775
|
+
setIsAnimating(true);
|
|
776
|
+
setTranslateAmount(direction === "next" ? -wrapperWidth : wrapperWidth);
|
|
777
|
+
const timer = setTimeout(() => {
|
|
778
|
+
setFocusDate((prev) => {
|
|
779
|
+
const newDate = direction === "next" ? prev.add(1, "month") : prev.subtract(1, "month");
|
|
780
|
+
setMonthArray(getArrayMonth(newDate));
|
|
781
|
+
return newDate;
|
|
782
|
+
});
|
|
783
|
+
setTranslateAmount(0);
|
|
784
|
+
setIsAnimating(false);
|
|
785
|
+
}, 200);
|
|
786
|
+
return () => clearTimeout(timer);
|
|
787
|
+
}, [disableNext, disablePrev, isAnimating, wrapperWidth, getArrayMonth]);
|
|
788
|
+
const [increaseCurrentMonth, decreaseCurrentMonth] = useMemo(
|
|
789
|
+
() => [handleMonthChange("next"), handleMonthChange("prev")],
|
|
790
|
+
[handleMonthChange]
|
|
791
|
+
);
|
|
792
|
+
const focusOnCalendar = useCallback3(() => {
|
|
793
|
+
if (!isClient || !containerRef.current) return;
|
|
794
|
+
const selector = ".day.selected, .month-calendar:not(.hidden) .day:not(.disabled)";
|
|
795
|
+
const focusTarget = containerRef.current.querySelector(selector);
|
|
796
|
+
focusTarget?.focus();
|
|
797
|
+
}, [isClient]);
|
|
798
|
+
const handleKeyDown = useCallback3((e) => {
|
|
799
|
+
const target = e.target;
|
|
800
|
+
const dayIndex = target.getAttribute("data-day-index");
|
|
801
|
+
if (!dayIndex) return;
|
|
802
|
+
e.preventDefault();
|
|
803
|
+
const calendarContainer = target.closest(".calendar-wrapper");
|
|
804
|
+
const dateValue = parseInt(target.dataset.dateValue ?? "0");
|
|
805
|
+
const date = dayjs7(dateValue);
|
|
806
|
+
const lastDate = date.endOf("month").date();
|
|
807
|
+
let newIndex = parseInt(dayIndex);
|
|
808
|
+
switch (e.key) {
|
|
809
|
+
case "ArrowLeft":
|
|
810
|
+
newIndex--;
|
|
811
|
+
break;
|
|
812
|
+
case "ArrowUp":
|
|
813
|
+
newIndex -= 7;
|
|
814
|
+
break;
|
|
815
|
+
case "ArrowRight":
|
|
816
|
+
newIndex++;
|
|
817
|
+
break;
|
|
818
|
+
case "ArrowDown":
|
|
819
|
+
newIndex += 7;
|
|
820
|
+
break;
|
|
821
|
+
case " ":
|
|
822
|
+
target.click();
|
|
823
|
+
return;
|
|
824
|
+
default:
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
if (newIndex > 0 && newIndex <= lastDate) {
|
|
828
|
+
calendarContainer?.querySelector(`[data-day-index="${newIndex}"]`)?.focus();
|
|
829
|
+
} else {
|
|
830
|
+
const newDate = date.add(newIndex - parseInt(dayIndex), "day");
|
|
831
|
+
const monthDiff = newDate.diff(focusDate, "month");
|
|
832
|
+
if (monthDiff > 1 && !disableNext) increaseCurrentMonth();
|
|
833
|
+
if (monthDiff < 0 && !disablePrev) decreaseCurrentMonth();
|
|
834
|
+
setTimeout(() => {
|
|
835
|
+
calendarContainer?.querySelector(
|
|
836
|
+
`[data-month-index="${newDate.month() + 1}"] [data-day-index="${newDate.date()}"]`
|
|
837
|
+
)?.focus();
|
|
838
|
+
}, 200);
|
|
839
|
+
}
|
|
840
|
+
}, [focusDate, disableNext, disablePrev, increaseCurrentMonth, decreaseCurrentMonth]);
|
|
841
|
+
const renderTooltip = useMemo(() => {
|
|
842
|
+
if (!tooltip || !isClient) return null;
|
|
843
|
+
const content = typeof tooltip === "function" ? tooltip(dayValue?.toDate() ?? /* @__PURE__ */ new Date()) : tooltip;
|
|
844
|
+
return /* @__PURE__ */ jsx13("div", { id: "day-tooltip", className: "tooltip-text", ref: tooltipRef, children: content });
|
|
845
|
+
}, [tooltip, dayValue, isClient]);
|
|
846
|
+
const calendarMonths = useMemo(
|
|
847
|
+
() => monthArray.map((date, index) => {
|
|
848
|
+
const isVisible = index === 1 || index === 2;
|
|
849
|
+
const isSlidingNext = isAnimating && translateAmount < 0 && index === 3;
|
|
850
|
+
const isSlidingPrev = isAnimating && translateAmount > 0 && index === 0;
|
|
851
|
+
return /* @__PURE__ */ jsx13(
|
|
852
|
+
MonthCalendar,
|
|
853
|
+
{
|
|
854
|
+
hidden: !isVisible && !isSlidingNext && !isSlidingPrev,
|
|
855
|
+
isAnimating: isSlidingNext || isSlidingPrev,
|
|
856
|
+
month: date.month(),
|
|
857
|
+
year: date.year(),
|
|
858
|
+
handleHoverDay: setDayValue,
|
|
859
|
+
ref: tooltipRef,
|
|
860
|
+
className: cx5({ "slide-next": isSlidingNext, "slide-prev": isSlidingPrev })
|
|
861
|
+
},
|
|
862
|
+
`${date.year()}-${date.month()}`
|
|
863
|
+
);
|
|
864
|
+
}),
|
|
865
|
+
[monthArray, isAnimating, translateAmount]
|
|
866
|
+
);
|
|
867
|
+
return /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
868
|
+
renderTooltip,
|
|
869
|
+
/* @__PURE__ */ jsxs6(
|
|
870
|
+
"div",
|
|
871
|
+
{
|
|
872
|
+
className: cx5("calendar-wrapper", { single: singleCalendar }),
|
|
873
|
+
ref: containerRef,
|
|
874
|
+
onKeyDown: handleKeyDown,
|
|
875
|
+
role: "grid",
|
|
876
|
+
"aria-label": "Calendar",
|
|
877
|
+
children: [
|
|
878
|
+
/* @__PURE__ */ jsx13(
|
|
879
|
+
"div",
|
|
880
|
+
{
|
|
881
|
+
className: cx5("calendar-content", { isAnimating }),
|
|
882
|
+
style: { transform: `translateX(${translateAmount}px)` },
|
|
883
|
+
children: calendarMonths
|
|
884
|
+
}
|
|
885
|
+
),
|
|
886
|
+
/* @__PURE__ */ jsxs6("div", { className: "calendar-flippers", children: [
|
|
887
|
+
/* @__PURE__ */ jsx13(
|
|
888
|
+
"button",
|
|
889
|
+
{
|
|
890
|
+
className: cx5("flipper-button", { disabled: disablePrev }),
|
|
891
|
+
onClick: decreaseCurrentMonth,
|
|
892
|
+
onKeyDown: (e) => e.key === " " && decreaseCurrentMonth(),
|
|
893
|
+
disabled: disablePrev,
|
|
894
|
+
"aria-label": "Previous month",
|
|
895
|
+
children: /* @__PURE__ */ jsx13(prev_default, { viewBox: "0 0 24 24" })
|
|
896
|
+
}
|
|
897
|
+
),
|
|
898
|
+
/* @__PURE__ */ jsx13(
|
|
899
|
+
"button",
|
|
900
|
+
{
|
|
901
|
+
className: cx5("flipper-button", { disabled: disableNext }),
|
|
902
|
+
onClick: increaseCurrentMonth,
|
|
903
|
+
onKeyDown: (e) => e.key === " " && increaseCurrentMonth(),
|
|
904
|
+
disabled: disableNext,
|
|
905
|
+
"aria-label": "Next month",
|
|
906
|
+
onBlur: focusOnCalendar,
|
|
907
|
+
children: /* @__PURE__ */ jsx13(next_default, { viewBox: "0 0 24 24" })
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
] })
|
|
911
|
+
]
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
] });
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
// src/lib/components/DatePicker/Dialog.tsx
|
|
918
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
919
|
+
var Dialog = ({
|
|
920
|
+
containerRef: externalRef
|
|
921
|
+
}) => {
|
|
922
|
+
const [hideAnimation, setHideAnimation] = useState6(false);
|
|
923
|
+
const [dateChanged, setDateChanged] = useState6(null);
|
|
924
|
+
const defaultRef = useRef4(null);
|
|
925
|
+
const containerRef = externalRef || defaultRef;
|
|
926
|
+
const {
|
|
927
|
+
handleChangeDate,
|
|
928
|
+
handleReset
|
|
929
|
+
} = useDateState();
|
|
930
|
+
const {
|
|
931
|
+
singleCalendar,
|
|
932
|
+
expandDirection
|
|
933
|
+
} = useDatePickerConfig();
|
|
934
|
+
const {
|
|
935
|
+
complsOpen,
|
|
936
|
+
isMobile,
|
|
937
|
+
toggleDialog
|
|
938
|
+
} = useUIState();
|
|
939
|
+
const {
|
|
940
|
+
hideDialogHeader,
|
|
941
|
+
hideDialogFooter
|
|
942
|
+
} = useDisplayCustomization();
|
|
943
|
+
const onChangeDate = (date, type) => {
|
|
944
|
+
setDateChanged(date);
|
|
945
|
+
handleChangeDate(date, type);
|
|
946
|
+
};
|
|
947
|
+
useEffect7(() => {
|
|
948
|
+
if (complsOpen && !hideAnimation) {
|
|
949
|
+
setHideAnimation(true);
|
|
950
|
+
}
|
|
951
|
+
if (complsOpen) {
|
|
952
|
+
setTimeout(() => {
|
|
953
|
+
const startDateInput = containerRef.current?.querySelector(
|
|
954
|
+
"#start-date-input-button"
|
|
955
|
+
);
|
|
956
|
+
if (startDateInput) {
|
|
957
|
+
startDateInput.focus();
|
|
958
|
+
}
|
|
959
|
+
}, 50);
|
|
960
|
+
}
|
|
961
|
+
}, [complsOpen, containerRef, hideAnimation]);
|
|
962
|
+
return /* @__PURE__ */ jsxs7(
|
|
963
|
+
"div",
|
|
964
|
+
{
|
|
965
|
+
className: cx6("dialog-date-picker", {
|
|
966
|
+
"open": complsOpen,
|
|
967
|
+
"hide": !complsOpen && hideAnimation,
|
|
968
|
+
"single": singleCalendar && !isMobile,
|
|
969
|
+
"expand-left": expandDirection === "left",
|
|
970
|
+
"expand-right": expandDirection === "right"
|
|
971
|
+
}),
|
|
972
|
+
ref: containerRef,
|
|
973
|
+
children: [
|
|
974
|
+
!hideDialogHeader && /* @__PURE__ */ jsxs7("div", { className: "dialog-header", children: [
|
|
975
|
+
/* @__PURE__ */ jsx14(
|
|
976
|
+
"button",
|
|
977
|
+
{
|
|
978
|
+
type: "button",
|
|
979
|
+
className: "btn-outline back-button",
|
|
980
|
+
onClick: toggleDialog,
|
|
981
|
+
children: /* @__PURE__ */ jsx14(back_default, { viewBox: "0 0 492 492" })
|
|
982
|
+
}
|
|
983
|
+
),
|
|
984
|
+
/* @__PURE__ */ jsx14(
|
|
985
|
+
DateInputGroup,
|
|
986
|
+
{
|
|
987
|
+
showIcon: true,
|
|
988
|
+
nonFocusable: !complsOpen
|
|
989
|
+
}
|
|
990
|
+
),
|
|
991
|
+
/* @__PURE__ */ jsx14(
|
|
992
|
+
"button",
|
|
993
|
+
{
|
|
994
|
+
type: "button",
|
|
995
|
+
className: "btn-outline reset-button",
|
|
996
|
+
onClick: handleReset,
|
|
997
|
+
children: "Reset"
|
|
998
|
+
}
|
|
999
|
+
)
|
|
1000
|
+
] }),
|
|
1001
|
+
/* @__PURE__ */ jsx14("div", { className: "dialog-content", children: isMobile ? /* @__PURE__ */ jsx14(DialogContentMobile, {}) : /* @__PURE__ */ jsx14(
|
|
1002
|
+
DialogContentDesktop,
|
|
1003
|
+
{
|
|
1004
|
+
dateChanged
|
|
1005
|
+
}
|
|
1006
|
+
) }),
|
|
1007
|
+
!hideDialogFooter && /* @__PURE__ */ jsxs7("div", { className: "dialog-footer", children: [
|
|
1008
|
+
/* @__PURE__ */ jsx14(
|
|
1009
|
+
"button",
|
|
1010
|
+
{
|
|
1011
|
+
type: "button",
|
|
1012
|
+
className: "submit-button",
|
|
1013
|
+
onClick: toggleDialog,
|
|
1014
|
+
tabIndex: 0,
|
|
1015
|
+
children: "Done"
|
|
1016
|
+
}
|
|
1017
|
+
),
|
|
1018
|
+
/* @__PURE__ */ jsx14(
|
|
1019
|
+
"button",
|
|
1020
|
+
{
|
|
1021
|
+
type: "button",
|
|
1022
|
+
className: "btn-outline reset-button mobile",
|
|
1023
|
+
onClick: handleReset,
|
|
1024
|
+
children: "Reset"
|
|
1025
|
+
}
|
|
1026
|
+
)
|
|
1027
|
+
] })
|
|
1028
|
+
]
|
|
1029
|
+
}
|
|
1030
|
+
);
|
|
1031
|
+
};
|
|
1032
|
+
|
|
1033
|
+
// src/lib/components/DatePicker/BaseDatePicker.tsx
|
|
1034
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1035
|
+
dayjs8.extend(localeData);
|
|
1036
|
+
var BaseDatePicker = ({
|
|
1037
|
+
startDate = null,
|
|
1038
|
+
endDate = null,
|
|
1039
|
+
className = "",
|
|
1040
|
+
disabled = false,
|
|
1041
|
+
startDatePlaceholder,
|
|
1042
|
+
endDatePlaceholder,
|
|
1043
|
+
onChange,
|
|
1044
|
+
onFocus = () => {
|
|
1045
|
+
},
|
|
1046
|
+
startWeekDay = "monday",
|
|
1047
|
+
minDate = null,
|
|
1048
|
+
maxDate = null,
|
|
1049
|
+
weekDayFormat = "dd",
|
|
1050
|
+
dateFormat = "",
|
|
1051
|
+
monthFormat = "",
|
|
1052
|
+
highlightToday = false,
|
|
1053
|
+
dateInputSeperator = null,
|
|
1054
|
+
hideDialogHeader = false,
|
|
1055
|
+
hideDialogFooter = false,
|
|
1056
|
+
hideDialogAfterSelectEndDate = false,
|
|
1057
|
+
isOpen = false,
|
|
1058
|
+
onCloseCalendar,
|
|
1059
|
+
tooltip = "",
|
|
1060
|
+
subTextDict = null,
|
|
1061
|
+
expandDirection = "right",
|
|
1062
|
+
locale = "en",
|
|
1063
|
+
isSingle = false,
|
|
1064
|
+
singleCalendar = false
|
|
1065
|
+
}) => {
|
|
1066
|
+
const [complsOpen, setComplsOpen] = useState7(isOpen);
|
|
1067
|
+
const [inputFocus, setInputFocus] = useState7(
|
|
1068
|
+
isSingle ? "from" : null
|
|
1069
|
+
);
|
|
1070
|
+
const [fromDate, setFromDate] = useState7(
|
|
1071
|
+
startDate ? dayjs8(startDate) : void 0
|
|
1072
|
+
);
|
|
1073
|
+
const [toDate, setToDate] = useState7(
|
|
1074
|
+
endDate ? dayjs8(endDate) : void 0
|
|
1075
|
+
);
|
|
1076
|
+
const [hoverDate, setHoverDate] = useState7();
|
|
1077
|
+
const [isMobile, setIsMobile] = useState7(false);
|
|
1078
|
+
const [isFirstTime, setIsFirstTime] = useState7(false);
|
|
1079
|
+
const isClient = useClientSide();
|
|
1080
|
+
const containerRef = useRef5(null);
|
|
1081
|
+
const fromDateRef = useRef5(null);
|
|
1082
|
+
const toDateRef = useRef5(null);
|
|
1083
|
+
const handleResize = useCallback4(() => {
|
|
1084
|
+
if (!isClient) return;
|
|
1085
|
+
setIsMobile(window.innerWidth < 768);
|
|
1086
|
+
}, [isClient]);
|
|
1087
|
+
const notifyChange = () => {
|
|
1088
|
+
const _startDate = fromDateRef.current ? fromDateRef.current.toDate() : null;
|
|
1089
|
+
const _endDate = !isSingle && toDateRef.current ? toDateRef.current.toDate() : null;
|
|
1090
|
+
if (isSingle) {
|
|
1091
|
+
onChange(_startDate, null);
|
|
1092
|
+
} else {
|
|
1093
|
+
onChange(_startDate, _endDate);
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1096
|
+
const debounceNotifyChange = debounce(notifyChange, 20);
|
|
1097
|
+
const updateFromDate = (dateValue, shouldNotifyChange = false) => {
|
|
1098
|
+
setFromDate(dateValue || void 0);
|
|
1099
|
+
fromDateRef.current = dateValue || null;
|
|
1100
|
+
if (shouldNotifyChange) {
|
|
1101
|
+
debounceNotifyChange();
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
const updateToDate = (dateValue, shouldNotifyChange = false) => {
|
|
1105
|
+
if (!isSingle) {
|
|
1106
|
+
setToDate(dateValue || void 0);
|
|
1107
|
+
toDateRef.current = dateValue || null;
|
|
1108
|
+
if (shouldNotifyChange) {
|
|
1109
|
+
debounceNotifyChange();
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
useLayoutEffect(() => {
|
|
1114
|
+
if (!isClient) return;
|
|
1115
|
+
handleResize();
|
|
1116
|
+
window.addEventListener("resize", handleResize);
|
|
1117
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
1118
|
+
}, [isClient, handleResize]);
|
|
1119
|
+
useEffect8(() => {
|
|
1120
|
+
if (!isClient) return;
|
|
1121
|
+
setIsFirstTime(true);
|
|
1122
|
+
const handleDocumentClick = (e) => {
|
|
1123
|
+
if (containerRef.current && e.target instanceof Node && !containerRef.current.contains(e.target) && window.innerWidth >= 768) {
|
|
1124
|
+
setComplsOpen(false);
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
document.addEventListener("click", handleDocumentClick);
|
|
1128
|
+
return () => document.removeEventListener("click", handleDocumentClick);
|
|
1129
|
+
}, [isClient]);
|
|
1130
|
+
useEffect8(() => {
|
|
1131
|
+
const _startDateJs = startDate ? dayjs8(startDate) : null;
|
|
1132
|
+
fromDateRef.current = _startDateJs;
|
|
1133
|
+
updateFromDate(_startDateJs, false);
|
|
1134
|
+
}, [startDate]);
|
|
1135
|
+
useEffect8(() => {
|
|
1136
|
+
if (!isSingle) {
|
|
1137
|
+
const _endDateJs = endDate ? dayjs8(endDate) : null;
|
|
1138
|
+
toDateRef.current = _endDateJs;
|
|
1139
|
+
updateToDate(_endDateJs, false);
|
|
1140
|
+
}
|
|
1141
|
+
}, [endDate, isSingle]);
|
|
1142
|
+
useEffect8(() => {
|
|
1143
|
+
if (!complsOpen && isFirstTime) {
|
|
1144
|
+
const _startDate = fromDateRef.current?.toDate() || null;
|
|
1145
|
+
const _endDate = toDateRef.current?.toDate() || null;
|
|
1146
|
+
if (isSingle) {
|
|
1147
|
+
onCloseCalendar(_startDate, null);
|
|
1148
|
+
} else {
|
|
1149
|
+
onCloseCalendar(_startDate, _endDate);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}, [complsOpen, isFirstTime, isSingle, onCloseCalendar]);
|
|
1153
|
+
useEffect8(() => {
|
|
1154
|
+
setComplsOpen(isOpen);
|
|
1155
|
+
}, [isOpen]);
|
|
1156
|
+
useEffect8(() => {
|
|
1157
|
+
if (isFirstTime) {
|
|
1158
|
+
const input = inputFocus === "from" ? "Start Date" : inputFocus === "to" ? "End Date" : "";
|
|
1159
|
+
onFocus(input);
|
|
1160
|
+
}
|
|
1161
|
+
}, [inputFocus, isFirstTime, onFocus]);
|
|
1162
|
+
const toggleDialog = () => {
|
|
1163
|
+
setComplsOpen(!complsOpen);
|
|
1164
|
+
};
|
|
1165
|
+
const handleClickDateInput = (focusInput) => {
|
|
1166
|
+
if (disabled || !isSingle && focusInput === "to" && !fromDate) {
|
|
1167
|
+
return;
|
|
1168
|
+
}
|
|
1169
|
+
if (!complsOpen) {
|
|
1170
|
+
setComplsOpen(true);
|
|
1171
|
+
}
|
|
1172
|
+
setInputFocus(focusInput);
|
|
1173
|
+
};
|
|
1174
|
+
const onSelectDate = useCallback4(
|
|
1175
|
+
(date) => {
|
|
1176
|
+
const minDayjs = minDate ? dayjs8(minDate) : null;
|
|
1177
|
+
const maxDayjs = maxDate ? dayjs8(maxDate) : null;
|
|
1178
|
+
if (minDayjs && minDayjs.isAfter(date, "date") || maxDayjs && maxDayjs.isBefore(date, "date")) {
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
if (isSingle) {
|
|
1182
|
+
updateFromDate(date, true);
|
|
1183
|
+
if (hideDialogAfterSelectEndDate) {
|
|
1184
|
+
setTimeout(() => setComplsOpen(false), 50);
|
|
1185
|
+
}
|
|
1186
|
+
} else if (inputFocus === "from" || fromDate && date.isBefore(fromDate, "date")) {
|
|
1187
|
+
updateFromDate(date, true);
|
|
1188
|
+
if (toDate && date.isAfter(toDate, "date")) {
|
|
1189
|
+
updateToDate(null, true);
|
|
1190
|
+
}
|
|
1191
|
+
setInputFocus("to");
|
|
1192
|
+
} else {
|
|
1193
|
+
updateToDate(date, true);
|
|
1194
|
+
setInputFocus(null);
|
|
1195
|
+
if (hideDialogAfterSelectEndDate) {
|
|
1196
|
+
setTimeout(() => setComplsOpen(false), 50);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
[
|
|
1201
|
+
minDate,
|
|
1202
|
+
maxDate,
|
|
1203
|
+
isSingle,
|
|
1204
|
+
hideDialogAfterSelectEndDate,
|
|
1205
|
+
inputFocus,
|
|
1206
|
+
fromDate,
|
|
1207
|
+
toDate
|
|
1208
|
+
]
|
|
1209
|
+
);
|
|
1210
|
+
const onHoverDate = (date) => {
|
|
1211
|
+
setHoverDate(date);
|
|
1212
|
+
};
|
|
1213
|
+
const handleReset = () => {
|
|
1214
|
+
setHoverDate(void 0);
|
|
1215
|
+
updateFromDate(null, true);
|
|
1216
|
+
if (!isSingle) {
|
|
1217
|
+
updateToDate(null, true);
|
|
1218
|
+
}
|
|
1219
|
+
setInputFocus("from");
|
|
1220
|
+
};
|
|
1221
|
+
const handleChangeDate = useCallback4(
|
|
1222
|
+
(date, type) => {
|
|
1223
|
+
const minDayjs = minDate ? dayjs8(minDate) : null;
|
|
1224
|
+
const maxDayjs = maxDate ? dayjs8(maxDate) : null;
|
|
1225
|
+
if (minDayjs && minDayjs.isAfter(date, "date") || maxDayjs && maxDayjs.isBefore(date, "date")) {
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
if (type === "from" || isSingle) {
|
|
1229
|
+
setInputFocus("from");
|
|
1230
|
+
updateFromDate(date, true);
|
|
1231
|
+
if (!isSingle && toDate && date.isAfter(toDate, "date")) {
|
|
1232
|
+
updateToDate(null, true);
|
|
1233
|
+
}
|
|
1234
|
+
} else {
|
|
1235
|
+
setInputFocus("to");
|
|
1236
|
+
updateToDate(date, true);
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
[minDate, maxDate, isSingle, toDate, inputFocus]
|
|
1240
|
+
);
|
|
1241
|
+
const dateState = {
|
|
1242
|
+
fromDate,
|
|
1243
|
+
toDate,
|
|
1244
|
+
hoverDate,
|
|
1245
|
+
inputFocus,
|
|
1246
|
+
onSelectDate,
|
|
1247
|
+
onHoverDate,
|
|
1248
|
+
handleChangeDate,
|
|
1249
|
+
handleReset,
|
|
1250
|
+
handleClickDateInput
|
|
1251
|
+
};
|
|
1252
|
+
const config = {
|
|
1253
|
+
isSingle,
|
|
1254
|
+
startWeekDay,
|
|
1255
|
+
minDate: minDate ? dayjs8(minDate).toDate() : null,
|
|
1256
|
+
maxDate: maxDate ? dayjs8(maxDate).toDate() : null,
|
|
1257
|
+
weekDayFormat,
|
|
1258
|
+
dateFormat,
|
|
1259
|
+
monthFormat,
|
|
1260
|
+
highlightToday,
|
|
1261
|
+
singleCalendar,
|
|
1262
|
+
expandDirection,
|
|
1263
|
+
locale
|
|
1264
|
+
};
|
|
1265
|
+
const uiState = {
|
|
1266
|
+
complsOpen,
|
|
1267
|
+
isMobile,
|
|
1268
|
+
disabled,
|
|
1269
|
+
toggleDialog
|
|
1270
|
+
};
|
|
1271
|
+
const display = {
|
|
1272
|
+
startDatePlaceholder,
|
|
1273
|
+
endDatePlaceholder,
|
|
1274
|
+
dateInputSeperator,
|
|
1275
|
+
hideDialogHeader,
|
|
1276
|
+
hideDialogFooter,
|
|
1277
|
+
hideDialogAfterSelectEndDate,
|
|
1278
|
+
tooltip,
|
|
1279
|
+
subTextDict
|
|
1280
|
+
};
|
|
1281
|
+
return /* @__PURE__ */ jsx15("div", { className: "react-google-flight-datepicker", children: /* @__PURE__ */ jsx15(
|
|
1282
|
+
"div",
|
|
1283
|
+
{
|
|
1284
|
+
className: cx7("date-picker", className, {
|
|
1285
|
+
disabled
|
|
1286
|
+
}),
|
|
1287
|
+
ref: containerRef,
|
|
1288
|
+
children: /* @__PURE__ */ jsxs8(
|
|
1289
|
+
DatePickerProvider,
|
|
1290
|
+
{
|
|
1291
|
+
dateState,
|
|
1292
|
+
config,
|
|
1293
|
+
uiState,
|
|
1294
|
+
display,
|
|
1295
|
+
locale,
|
|
1296
|
+
children: [
|
|
1297
|
+
/* @__PURE__ */ jsx15(DateInputGroup, {}),
|
|
1298
|
+
/* @__PURE__ */ jsx15(DialogWrapper_default, { children: /* @__PURE__ */ jsx15(Dialog, {}) })
|
|
1299
|
+
]
|
|
1300
|
+
}
|
|
1301
|
+
)
|
|
1302
|
+
}
|
|
1303
|
+
) });
|
|
1304
|
+
};
|
|
1305
|
+
var BaseDatePicker_default = BaseDatePicker;
|
|
1306
|
+
|
|
1307
|
+
// src/lib/components/DatePicker/ClientOnly.tsx
|
|
1308
|
+
import { useState as useState8, useEffect as useEffect9 } from "react";
|
|
1309
|
+
import { Fragment, jsx as jsx16 } from "react/jsx-runtime";
|
|
1310
|
+
var ClientOnly = ({ children }) => {
|
|
1311
|
+
const [hasMounted, setHasMounted] = useState8(false);
|
|
1312
|
+
useEffect9(() => {
|
|
1313
|
+
setHasMounted(true);
|
|
1314
|
+
}, []);
|
|
1315
|
+
if (!hasMounted) return null;
|
|
1316
|
+
return /* @__PURE__ */ jsx16(Fragment, { children });
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
// src/lib/components/DatePicker/RangeDatePicker.tsx
|
|
1320
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1321
|
+
var RangeDatePicker = ({
|
|
1322
|
+
onChange = () => {
|
|
1323
|
+
},
|
|
1324
|
+
onCloseCalendar = () => {
|
|
1325
|
+
},
|
|
1326
|
+
startDatePlaceholder = "Start date",
|
|
1327
|
+
endDatePlaceholder = "End date",
|
|
1328
|
+
...props
|
|
1329
|
+
}) => /* @__PURE__ */ jsx17(ClientOnly, { children: /* @__PURE__ */ jsx17(
|
|
1330
|
+
BaseDatePicker_default,
|
|
1331
|
+
{
|
|
1332
|
+
...props,
|
|
1333
|
+
isSingle: false,
|
|
1334
|
+
startDate: props.startDate,
|
|
1335
|
+
endDate: props.endDate,
|
|
1336
|
+
startDatePlaceholder,
|
|
1337
|
+
endDatePlaceholder,
|
|
1338
|
+
onChange,
|
|
1339
|
+
onCloseCalendar
|
|
591
1340
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
1341
|
+
) });
|
|
1342
|
+
|
|
1343
|
+
// src/lib/components/DatePicker/SingleDatePicker.tsx
|
|
1344
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1345
|
+
var SingleDatePicker = ({
|
|
1346
|
+
onChange = () => {
|
|
1347
|
+
},
|
|
1348
|
+
onCloseCalendar = () => {
|
|
1349
|
+
},
|
|
1350
|
+
startDatePlaceholder = "Date",
|
|
1351
|
+
...props
|
|
1352
|
+
}) => /* @__PURE__ */ jsx18(ClientOnly, { children: /* @__PURE__ */ jsx18(
|
|
1353
|
+
BaseDatePicker_default,
|
|
1354
|
+
{
|
|
1355
|
+
...props,
|
|
1356
|
+
endDate: null,
|
|
1357
|
+
isSingle: true,
|
|
1358
|
+
startDate: props.startDate,
|
|
1359
|
+
startDatePlaceholder,
|
|
1360
|
+
onChange: (date) => onChange(date),
|
|
1361
|
+
onCloseCalendar: (date) => onCloseCalendar(date)
|
|
596
1362
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
.react-google-flight-datepicker .dialog-header {
|
|
603
|
-
padding: 8px;
|
|
604
|
-
box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.24);
|
|
605
|
-
z-index: 50;
|
|
606
|
-
}
|
|
607
|
-
.react-google-flight-datepicker .dialog-header .date-picker-input {
|
|
608
|
-
height: 40px;
|
|
609
|
-
width: 100%;
|
|
610
|
-
}
|
|
611
|
-
.react-google-flight-datepicker .dialog-content {
|
|
612
|
-
border: none;
|
|
613
|
-
overflow: hidden;
|
|
614
|
-
height: 100%;
|
|
615
|
-
}
|
|
616
|
-
.react-google-flight-datepicker .calendar-wrapper {
|
|
617
|
-
margin: 0;
|
|
618
|
-
height: 100%;
|
|
619
|
-
display: flex;
|
|
620
|
-
}
|
|
621
|
-
.react-google-flight-datepicker .calendar-content {
|
|
622
|
-
padding: 0;
|
|
623
|
-
width: 100%;
|
|
624
|
-
height: 100%;
|
|
625
|
-
flex-direction: column;
|
|
626
|
-
flex-grow: 1;
|
|
627
|
-
}
|
|
628
|
-
.react-google-flight-datepicker .weekdays.mobile {
|
|
629
|
-
display: flex;
|
|
630
|
-
background-color: #f3f3f3;
|
|
631
|
-
}
|
|
632
|
-
.react-google-flight-datepicker .month-calendar {
|
|
633
|
-
width: 100%;
|
|
634
|
-
display: flex;
|
|
635
|
-
flex-direction: column;
|
|
636
|
-
}
|
|
637
|
-
.react-google-flight-datepicker .day {
|
|
638
|
-
width: 14.2857142857%;
|
|
639
|
-
max-width: 14.2857142857%;
|
|
640
|
-
}
|
|
641
|
-
.react-google-flight-datepicker .day.selected:hover, .react-google-flight-datepicker .day.hovered:hover {
|
|
642
|
-
color: #fff !important;
|
|
643
|
-
}
|
|
644
|
-
.react-google-flight-datepicker .day.selected:hover::after, .react-google-flight-datepicker .day.hovered:hover::after {
|
|
645
|
-
background-color: #4285f4 !important;
|
|
646
|
-
}
|
|
647
|
-
.react-google-flight-datepicker .month-name {
|
|
648
|
-
text-align: left;
|
|
649
|
-
margin-left: 10px;
|
|
650
|
-
margin-bottom: 0px;
|
|
651
|
-
margin-top: 25px;
|
|
652
|
-
font-weight: bold;
|
|
653
|
-
}
|
|
654
|
-
.react-google-flight-datepicker .dialog-footer {
|
|
655
|
-
box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24);
|
|
656
|
-
padding: 15px 8px;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiQzpcXFVzZXJzXFxFbGlhc1xcRG9jdW1lbnRzXFxyZWFjdC1nb29nbGUtZmxpZ2h0LWRhdGVwaWNrZXJcXHNyY1xcbGliXFxjb21wb25lbnRzXFxEYXRlUGlja2VyIiwic291cmNlcyI6WyJzdHlsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFO0VBQ0E7QUE2bEJBOztBQTNsQkE7RUFDRTs7QUFHRjtFQUNFOztBQUdG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cbiAgICAgIGNvbnRlbnQ6ICcnO1xyXG4gICAgICBtYXJnaW46IC0xcHg7XHJcbiAgICAgIGJvcmRlcjogMnB4IHNvbGlkICMxYTczZTg7XHJcbiAgICAgIGJvcmRlci1yYWRpdXM6IDRweDtcclxuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xyXG4gICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcclxuICAgICAgdG9wOiAwO1xyXG4gICAgICBib3R0b206IDA7XHJcbiAgICAgIGxlZnQ6IDA7XHJcbiAgICAgIHJpZ2h0OiAwO1xyXG4gICAgICB6LWluZGV4OiA1O1xyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgLmJhY2stYnV0dG9uIHtcclxuICAgIGRpc3BsYXk6IG5vbmU7XHJcbiAgfVxyXG5cclxuICAuZGlhbG9nLWNvbnRlbnQge1xyXG4gICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICNkYWRjZTA7XHJcbiAgICBib3JkZXItdG9wOiAxcHggc29saWQgI2RhZGNlMDtcclxuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcclxuICB9XHJcblxyXG4gIC5yZXNldC1idXR0b24ge1xyXG4gICAgZm9udC1zaXplOiAwLjlyZW07XHJcbiAgICBwYWRkaW5nOiAwIDhweDtcclxuICAgIGhlaWdodDogMzZweDtcclxuICAgIGJvcmRlci1yYWRpdXM6IDRweDtcclxuICAgIGJvcmRlcjogbm9uZTtcclxuICAgIGNvbG9yOiAjNWY2MzY4O1xyXG4gICAgbWluLXdpZHRoOiA2NHB4O1xyXG5cclxuICAgICY6aG92ZXIge1xyXG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmFmYWZhO1xyXG4gICAgfVxyXG5cclxuICAgICYubW9iaWxlIHtcclxuICAgICAgZGlzcGxheTogbm9uZTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC5jYWxlbmRhci13cmFwcGVyIHtcclxuICAgIG1hcmdpbjogMTJweCAzOHB4IDhweD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cbiAgfVxyXG5cclxuICAud2Vla2RheXMge1xyXG4gICAgd2lkdGg6IDEwMCU7XHJcbiAgICBmb250LXNpemU6IDAuOXJlbTtcclxuICAgIGNvbG9yOiByZ2JhKDAsIDAsIDAsIDAuNTQpO1xyXG4gICAgZGlzcGxheTogZmxleDtcclxuXHJcbiAgICAud2Vla2RheSB7XHJcbiAgICAgIGRpc3BsYXk6IGZsZXg7XHJcbiAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XHJcbiAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xyXG4gICAgICBoZWlnaHQ6IDM2cHg7XHJcbiAgICAgIG1hcmdpbjogMDtcclxuICAgICAgZmxleC1ncm93OiAxO1xyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgLndlZWsge1xyXG4gICAgZGlzcGxheTogZmxleDtcclxuICAgIGp1c3RpZnktY29udGVudDogZmxleC1zdGFydDtcclxuXHJcbiAgICAmLmZpcnN0IHtcclxuICAgICAganVzdGlmeS1jb250ZW50OiBmbGV4LWVuZDtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC5kYXkge1xyXG4gICAgZGlzcGxheTogZmxleDtcclxuICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xyXG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcclxuICAgIGN1cnNvcjogcG9pbnRlcjtcclxuICAgIGhlaWdodDogNDRweDtcclxuICAgIG1hcmdpbjogMnB4IDA7XHJcbiAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XHJcbiAgICB3aWR0aDogNDRweDtcclxuICAgIHZlcnRpY2FsLWFsaWduOiB0b3A7XHJcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XHJcbiAgICBib3JkZXItcmFkaXVzOiA1MCU7XHJcblxyXG4gICAgLmJhY2tncm91bmQtZGF5IHtcclxuICAgICAgYm90dG9tOiAwO1xyXG4gICAgICBvcGFjaXR5OiAwO1xyXG4gICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcclxuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xyXG4gICAgICB0b3A6IDA7XHJcbiAgICAgIHdpZHRoOiAxMHB4O1xyXG4gICAgICB6LWluZGV4OiAxO1xyXG5cclxuICAgICAgJi5maXJzdC1kYXkge1xyXG4gICAgICAgIGJhY2tncm91bmQ6IGxpbmVhci1ncmFkaWVudCh0byByaWdodCwgI2ZmZiwgI2RhZWRmZCk7XHJcbiAgICAgICAgbGVmdDogLTEwcHg7XHJcbiAgICAgIH1cclxuXHJcbiAgICAgICYubGFzdC1kYXkge1xyXG4gICAgICAgIGJhY2tncm91bmQ6IGxpbmVhci1ncmFkaWVudCh0byBsZWZ0LCAjZmZmLCAjZGFlZGZkKTtcclxuICAgICAgICByaWdodDogLTEwcHg7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAmOjphZnRlciB7XHJcbiAgICAgIGJvcmRlci1yYWRpdXM6IDEwMCU7XHJcbiAgICAgIGJvdHRvbTogMDtcclxuICAgICAgY29udGVudDogJyc7XHJcbiAgICAgIGhlaWdodDogNDRweDtcclxuICAgICAgbGVmdDogMDtcclxuICAgICAgbWFyZ2luOiBhdXRvO1xyXG4gICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XHJcbiAgICAgIHJpZ2h0OiAwO1xyXG4gICAgICB0b3A6IDA7XHJcbiAgICAgIHdpZHRoOiA0NHB4O1xyXG4gICAgICB6LWluZGV4OiAyO1xyXG4gICAgfVxyXG5cclxuICAgICY6aG92ZXI6OmFmdGVyIHtcclxuICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcclxuICAgICAgYm9yZGVyOiAycHggc29saWQgIzQyODVmNDtcclxuICAgICAgYm90dG9tOiAtMnB4O1xyXG4gICAgICBsZWZ0OiAtMnB4O1xyXG4gICAgICByaWdodDogLTJweDtcclxuICAgICAgdG9wOiAtMnB4O1xyXG4gICAgfVxyXG5cclxuICAgICYuc2VsZWN0ZWQge1xyXG4gICAgICBj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Bib3JkZXItcmFkaXVzOiAwO1xyXG4gICAgICB3aWR0aDogMTAwJTtcclxuICAgICAgaGVpZ2h0OiAxMDAlO1xyXG4gICAgICBtYXgtaGVpZ2h0OiAxMDAlO1xyXG4gICAgICBwb3NpdGlvbjogZml4ZWQ7XHJcbiAgICAgIGxlZnQ6IDA7XHJcbiAgICAgIHJpZ2h0OiAwO1xyXG4gICAgICBib3R0b206IDEwcHg7XHJcbiAgICAgIHRvcDogMTAwJTtcclxuICAgICAgZGlzcGxheTogZmxleDtcclxuICAgICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcclxuICAgICAgb3BhY2l0eTogMTtcclxuICAgICAgdHJhbnNmb3JtOiBub25lO1xyXG4gICAgICB6LWluZGV4OiA5OTk5OTk5OTk7XHJcblxyXG4gICAgICAmLm9wZW4ge1xyXG4gICAgICAgIHRyYW5zaXRpb246IGFsbCAwLjJzIGVhc2Utb3V0O1xyXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlKDAsIC0xMDAlKTtcclxuICAgICAgICBhbmltYXRpb246IG5vbmU7XHJcbiAgICAgIH1cclxuXHJcbiAgICAgICYuaGlkZSB7XHJcbiAgICAgICAgdHJhbnNpdGlvbjogYWxsIDAuMnMgZWFzZS1pbjtcclxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgwLCAwKTtcclxuICAgICAgICBhbmltYXRpb246IG5vbmU7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAuZGlhbG9nLWhlYWRlciB7XHJcbiAgICAgIHBhZGRpbmc6IDhweDtcclxuICAgICAgYm94LXNoYWRvdzogMCAwIDJweCByZ2JhKDAsIDAsIDAsIDAuMTIpLCAwIDJweCAycHggcmdiYSgwLCAwLCAwLCAwLjI0KTtcclxuICAgICAgei1pbmRleDogNTA7XHJcblxyXG4gICAgICAuZGF0ZS1waWNrZXItaW5wdXQge1xyXG4gICAgICAgIGhlaWdodDogNDBweDtcclxuICAgICAgICB3a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HtcclxuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICM0Mjg1ZjQgIWltcG9ydGFudDtcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAubW9udGgtbmFtZSB7XHJcbiAgICAgIHRleHQtYWxpZ246IGxlZnQ7XHJcbiAgICAgIG1hcmdpbi1sZWZ0OiAxMHB4O1xyXG4gICAgICBtYXJnaW4tYm90dG9tOiAwcHg7XHJcbiAgICAgIG1hcmdpbi10b3A6IDI1cHg7XHJcbiAgICAgIGZvbnQtd2VpZ2h0OiBib2xkO1xyXG4gICAgfVxyXG5cclxuICAgIC5kaWFsb2ctZm9vdGVyIHtcclxuICAgICAgYm94LXNoYWRvdzogMCAwIDRweCByZ2JhKDAsIDAsIDAsIDAuMTIpLCAwIDRweCA0cHggcmdiYSgwLCAwLCAwLCAwLjI0KTtcclxuICAgICAgcGFkZGluZzogMTVweCA4cHg7XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ== */`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(fo));import{jsx as pe,jsxs as ho}from"react/jsx-runtime";W.extend(Xo);var Do=({startDate:e=null,endDate:t=null,className:o="",disabled:a=!1,startDatePlaceholder:n,endDatePlaceholder:l,onChange:d,onFocus:A=()=>{},startWeekDay:g="monday",minDate:s=null,maxDate:r=null,weekDayFormat:p="dd",dateFormat:G="",monthFormat:B="",highlightToday:x=!1,dateInputSeperator:D=null,hideDialogHeader:y=!1,hideDialogFooter:X=!1,hideDialogAfterSelectEndDate:c=!1,isOpen:m=!1,onCloseCalendar:C,tooltip:f="",subTextDict:V=null,expandDirection:N="right",locale:S="en",isSingle:u=!1,singleCalendar:J=!1})=>{let[Z,Q]=_(m),[H,P]=_(u?"from":null),[q,Ue]=_(e?W(e):void 0),[T,I]=_(t?W(t):void 0),[b,R]=_(),[F,Y]=_(!1),[ee,ke]=_(!1),te=(()=>{let[i,h]=_(!1);return ie(()=>{h(!0)},[]),i})(),le=ze(null),M=ze(null),K=ze(null),oe=Le(()=>{te&&Y(window.innerWidth<768)},[te]),Ee=$e(()=>{let i=M.current?M.current.toDate():null,h=!u&&K.current?K.current.toDate():null;u?d(i,null):d(i,h)},20),de=(i,h=!1)=>{Ue(i||void 0),M.current=i||null,h&&Ee()},re=(i,h=!1)=>{u||(I(i||void 0),K.current=i||null,h&&Ee())};yo(()=>{if(te)return oe(),window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[te,oe]),ie(()=>{ke(!0);let i=h=>{le.current&&h.target instanceof Node&&!le.current.contains(h.target)&&window.innerWidth>=768&&Q(!1)};return document.addEventListener("click",i),()=>document.removeEventListener("click",i)},[]),ie(()=>{let i=e?W(e):null;M.current=i,de(i,!1)},[e]),ie(()=>{if(!u){let i=t?W(t):null;K.current=i,re(i,!1)}},[t,u]),ie(()=>{var i,h;if(!Z&&ee){let $=((i=M.current)==null?void 0:i.toDate())||null,xe=((h=K.current)==null?void 0:h.toDate())||null;u?C($,null):C($,xe)}},[Z,ee,u,C]),ie(()=>{Q(m)},[m]),ie(()=>{ee&&A(H==="from"?"Start Date":H==="to"?"End Date":"")},[H,ee,A]);let Dt=()=>{Q(!Z)},ht=i=>{a||!u&&i==="to"&&!q||(Z||Q(!0),P(i))},Bt=Le(i=>{let h=s?W(s):null,$=r?W(r):null;h&&h.isAfter(i,"date")||$&&$.isBefore(i,"date")||(u?(de(i,!0),c&&setTimeout(()=>Q(!1),50)):H==="from"||q&&i.isBefore(q,"date")?(de(i,!0),T&&i.isAfter(T,"date")&&re(null,!0),P("to")):(re(i,!0),P(null),c&&setTimeout(()=>Q(!1),50)))},[s,r,u,c,H,q,T]),Ht=i=>{R(i)},Ft=()=>{R(void 0),de(null,!0),u||re(null,!0),P("from")},Qt=Le((i,h)=>{let $=s?W(s):null,xe=r?W(r):null;$&&$.isAfter(i,"date")||xe&&xe.isBefore(i,"date")||(h==="from"||u?(P("from"),de(i,!0),!u&&T&&i.isAfter(T,"date")&&re(null,!0)):(P("to"),re(i,!0)))},[s,r,u,T,H]),Zt={fromDate:q,toDate:T,hoverDate:b,inputFocus:H,onSelectDate:Bt,onHoverDate:Ht,handleChangeDate:Qt,handleReset:Ft,handleClickDateInput:ht},Rt={isSingle:u,startWeekDay:g,minDate:s?W(s).toDate():null,maxDate:r?W(r).toDate():null,weekDayFormat:p,dateFormat:G,monthFormat:B,highlightToday:x,singleCalendar:J,expandDirection:N,locale:S},Ot={complsOpen:Z,isMobile:F,disabled:a,toggleDialog:Dt},Ut={startDatePlaceholder:n,endDatePlaceholder:l,dateInputSeperator:D,hideDialogHeader:y,hideDialogFooter:X,hideDialogAfterSelectEndDate:c,tooltip:f,subTextDict:V};return pe("div",{className:"react-google-flight-datepicker",children:pe("div",{className:Go("date-picker",o,{disabled:a}),ref:le,children:ho(ot,{dateState:Zt,config:Rt,uiState:Ot,display:Ut,locale:S,children:[pe(Fe,{}),pe(nt,{children:pe(yt,{})})]})})})},Re=Do;import{useState as Bo,useEffect as Ho}from"react";import{Fragment as Fo,jsx as Qo}from"react/jsx-runtime";var Oe=({children:e})=>{let[t,o]=Bo(!1);return Ho(()=>{o(!0)},[]),t?Qo(Fo,{children:e}):null};import{jsx as Gt}from"react/jsx-runtime";var Zo=l=>{var d=l,{onChange:e=()=>{},onCloseCalendar:t=()=>{},startDatePlaceholder:o="Start date",endDatePlaceholder:a="End date"}=d,n=fe(d,["onChange","onCloseCalendar","startDatePlaceholder","endDatePlaceholder"]);return Gt(Oe,{children:Gt(Re,U(O({},n),{isSingle:!1,startDate:n.startDate,endDate:n.endDate,startDatePlaceholder:o,endDatePlaceholder:a,onChange:e,onCloseCalendar:t}))})};import{jsx as Xt}from"react/jsx-runtime";var Ro=n=>{var l=n,{onChange:e=()=>{},onCloseCalendar:t=()=>{},startDatePlaceholder:o="Date"}=l,a=fe(l,["onChange","onCloseCalendar","startDatePlaceholder"]);return Xt(Oe,{children:Xt(Re,U(O({},a),{endDate:null,isSingle:!0,startDate:a.startDate,startDatePlaceholder:o,onChange:d=>e(d),onCloseCalendar:d=>t(d)}))})};export{Zo as RangeDatePicker,Ro as SingleDatePicker};
|
|
1363
|
+
) });
|
|
1364
|
+
export {
|
|
1365
|
+
RangeDatePicker,
|
|
1366
|
+
SingleDatePicker
|
|
1367
|
+
};
|
|
660
1368
|
//# sourceMappingURL=index.mjs.map
|