diff --git a/iframe.html b/iframe.html index ccf25674..4873f67c 100644 --- a/iframe.html +++ b/iframe.html @@ -361,4 +361,4 @@ - window['STORIES'] = [{"titlePrefix":"","directory":"./packages","files":"**/*.stories.@(ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:packages(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(ts|tsx))$"}]; \ No newline at end of file + window['STORIES'] = [{"titlePrefix":"","directory":"./packages","files":"**/*.stories.@(ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:packages(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(ts|tsx))$"}]; \ No newline at end of file diff --git a/main.82374d08.iframe.bundle.js b/main.c75c6c5f.iframe.bundle.js similarity index 99% rename from main.82374d08.iframe.bundle.js rename to main.c75c6c5f.iframe.bundle.js index e486512e..01a3ed23 100644 --- a/main.82374d08.iframe.bundle.js +++ b/main.c75c6c5f.iframe.bundle.js @@ -2556,7 +2556,7 @@ ToastTest.parameters = { storySource: { source: "(props) => {\\n return (\\n ); -}`}},Xn.parameters)},"./packages/travelmakers-design-core/src/components/CalendarSecond/stories/Calendar.stories.tsx":function(ve,v,e){"use strict";e.r(v),e.d(v,"Default",function(){return Y}),e.d(v,"ToastTest",function(){return be});var Z=e("./node_modules/core-js/modules/es.date.to-string.js"),ie=e("./node_modules/core-js/modules/es.object.assign.js"),K=e("./node_modules/core-js/modules/es.array.is-array.js"),W=e("./node_modules/core-js/modules/es.symbol.js"),U=e("./node_modules/core-js/modules/es.symbol.description.js"),V=e("./node_modules/core-js/modules/es.object.to-string.js"),M=e("./node_modules/core-js/modules/es.symbol.iterator.js"),s=e("./node_modules/core-js/modules/es.string.iterator.js"),J=e("./node_modules/core-js/modules/es.array.iterator.js"),G=e("./node_modules/core-js/modules/web.dom-collections.iterator.js"),L=e("./node_modules/core-js/modules/es.array.slice.js"),H=e("./node_modules/core-js/modules/es.function.name.js"),w=e("./node_modules/core-js/modules/es.array.from.js"),t=e("./packages/travelmakers-design-core/src/components/Toast/Toaster/Toaster.tsx"),n=e("./packages/travelmakers-design-core/src/components/Toast/Toast/Toast.tsx"),i=e("./node_modules/core-js/modules/es.object.keys.js"),d=e("./node_modules/core-js/modules/es.array.index-of.js"),c=e("./node_modules/core-js/modules/es.array.map.js"),l=e("./packages/travelmakers-design-hooks/src/useCalendar/useCalendar.tsx"),r=e("./packages/travelmakers-design-hooks/src/useUpdateEffect/useUpdateEffect.ts"),a=e("./node_modules/react/index.js"),p=e.n(a),T=e("./packages/travelmakers-design-core/src/components/View/View.tsx"),S=e("./packages/travelmakers-design-styles/src/tss/createStyles.ts"),O=Object(S.a)(function(m){var q,z;return{root:{width:"100%",height:"100%"},container:{backgroundColor:m.colors.white,maxWidth:m.deviceSizes.mobile,height:"100%",margin:"auto",position:"relative"},calendar:(z={maxWidth:m.deviceSizes.mobile,height:"100%",margin:"auto",padding:m.spacing.spacing10+" "+m.spacing.spacing30,backgroundColor:m.colors.white},z["& > table"]=(q={width:"100%",borderCollapse:"collapse",color:m.colors.primary1},q.tr={height:48},q),z),tableHead:{padding:m.spacing.spacing10+" "+m.spacing.spacing30,display:"flex",justifyContent:"space-between",alignItems:"center"},tableCell:{textAlign:"center",padding:m.spacing.spacing20},tableMonthly:{textAlign:"right"},mt10:{marginTop:m.spacing.spacing10},sunday:{color:m.colors.error},saturday:{color:m.colors.tertiary}}}),R=Object(S.a)(function(m,q){var z,re,he,ge,Ie=q.topIndicatorPosition;return{indicatorBox:{maxWidth:m.deviceSizes.mobile,margin:"auto",height:"64px",position:"sticky",top:Ie,zIndex:10,display:"flex",justifyContent:"space-between",backgroundColor:m.colors.surface,padding:m.spacing.spacing10+" "+m.spacing.spacing50},indicatorInnerBox:(re={display:"flex",flexDirection:"row",gap:m.spacing.spacing30,color:"black",width:"233px",height:"100%"},re["& > div"]=(z={display:"flex",flexDirection:"column"},z["& > span"]={height:m.lineHeights.caption},z),re),indicatorSelectedDay:(he={display:"flex",flexDirection:"column",gap:"3px"},he["& > span"]={height:m.lineHeights.caption},he),indicatorDateCountBox:(ge={margin:"auto 0"},ge["& > div"]={minWidth:"56px",height:"28px",padding:"0 "+m.spacing.spacing10,border:"1px solid "+m.colors.primary1,borderRadius:m.radius.radius100,textAlign:"center"},ge),indicatorNight:{display:"flex",justifyContent:"center",lineHeight:"28px"}}}),E=e("./packages/travelmakers-design-utils/src/getDate/getDate.tsx"),b=e("./packages/travelmakers-design-core/src/components/Typography/Typography.tsx"),h=e("./packages/travelmakers-design-core/src/components/Divider/Divider.tsx"),A=e("./node_modules/date-fns/esm/differenceInDays/index.js"),P=e("./node_modules/react/jsx-runtime.js"),N=function(q){var z=q.selected,re=q.type,he=q.topIndicatorPosition,ge=q.text,Ie=q.locale,xe=Ie===void 0?"ko":Ie,Re=R({topIndicatorPosition:he}),Be=Re.classes,an=re==="tour",gn=function(){if(an){var xn,_n;return!((xn=z.time)!==null&&xn!==void 0&&xn.hour)||!((_n=z.time)!==null&&_n!==void 0&&_n.minutes)?Object(P.jsx)(b.a,{level:"caption",color:"primary3",dangerouslySetInnerHTML:{__html:ge==null?void 0:ge.descriptionTo}}):Object(P.jsx)("div",{className:Be.indicatorSelectedDay,children:Object(P.jsx)(b.a,{level:"subhead1",color:"primary1",strong:!0,children:z.time.hour+":"+z.time.minutes})})}else return z.to?Object(P.jsxs)("div",{className:Be.indicatorSelectedDay,children:[Object(P.jsx)(b.a,{level:"subhead1",color:"primary1",strong:!0,children:Object(E.a)(z.to.date).format}),Object(P.jsx)(b.a,{level:"caption",color:"primary1",children:Object(E.b)(z.to.date,xe)})]}):Object(P.jsx)(b.a,{level:"caption",color:"primary3",dangerouslySetInnerHTML:{__html:ge==null?void 0:ge.descriptionTo}})};return Object(P.jsxs)("div",{className:Be.indicatorBox,children:[Object(P.jsxs)("div",{className:Be.indicatorInnerBox,children:[Object(P.jsxs)("div",{children:[Object(P.jsx)(b.a,{level:"body3",color:"secondary1",strong:!0,children:ge==null?void 0:ge.from}),z.from?Object(P.jsxs)("div",{className:Be.indicatorSelectedDay,children:[Object(P.jsx)(b.a,{level:"subhead1",color:"primary1",strong:!0,children:Object(E.a)(z.from.date).format}),Object(P.jsx)(b.a,{level:"caption",color:"primary1",children:Object(E.b)(z.from.date,xe)})]}):Object(P.jsx)(b.a,{level:"caption",color:"primary3",dangerouslySetInnerHTML:{__html:ge==null?void 0:ge.descriptionFrom}})]}),Object(P.jsx)(h.a,{type:"vertical",color:"outline"}),Object(P.jsxs)("div",{children:[Object(P.jsx)(b.a,{level:"body3",color:"secondary1",strong:!0,children:ge==null?void 0:ge.to}),gn()]})]}),z.from&&z.to&&!an&&Object(P.jsx)("div",{className:Be.indicatorDateCountBox,children:Object(P.jsx)("div",{children:Object(P.jsxs)(b.a,{className:Be.indicatorNight,level:"subhead2",color:"primary1",children:[Object(A.a)(z.to.date,z.from.date),xe==="ko"?"\uBC15":" nights"]})})})]})};N.displayName="Indicator";var f=N,I=Object(S.a)(function(m,q){var z,re=q.open;return{optionBox:{maxWidth:m.deviceSizes.mobile,margin:"auto",position:"sticky",bottom:0,display:"flex",flexDirection:"column",padding:m.spacing.spacing50+" "+m.spacing.spacing50+" "+m.spacing.spacing30,gap:m.spacing.spacing30,backgroundColor:m.colors.surface},titleBox:(z={display:"flex",justifyContent:"space-between"},z["& > svg"]={cursor:"pointer",transform:re&&"scaleY(-1)"},z),contentBox:{display:re?"block":"none"},submitButton:{display:"flex",justifyContent:"center"}}}),B=e("./packages/travelmakers-design-core/src/components/Icon/Icon.tsx"),k=e("./packages/travelmakers-design-core/src/components/Button/Button/Button.tsx");function C(m,q){return u(m)||y(m,q)||o(m,q)||_()}function _(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +}`}},Xn.parameters)},"./packages/travelmakers-design-core/src/components/CalendarSecond/stories/Calendar.stories.tsx":function(ve,v,e){"use strict";e.r(v),e.d(v,"Default",function(){return Y}),e.d(v,"ToastTest",function(){return be});var Z=e("./node_modules/core-js/modules/es.date.to-string.js"),ie=e("./node_modules/core-js/modules/es.object.assign.js"),K=e("./node_modules/core-js/modules/es.array.is-array.js"),W=e("./node_modules/core-js/modules/es.symbol.js"),U=e("./node_modules/core-js/modules/es.symbol.description.js"),V=e("./node_modules/core-js/modules/es.object.to-string.js"),M=e("./node_modules/core-js/modules/es.symbol.iterator.js"),s=e("./node_modules/core-js/modules/es.string.iterator.js"),J=e("./node_modules/core-js/modules/es.array.iterator.js"),G=e("./node_modules/core-js/modules/web.dom-collections.iterator.js"),L=e("./node_modules/core-js/modules/es.array.slice.js"),H=e("./node_modules/core-js/modules/es.function.name.js"),w=e("./node_modules/core-js/modules/es.array.from.js"),t=e("./packages/travelmakers-design-core/src/components/Toast/Toaster/Toaster.tsx"),n=e("./packages/travelmakers-design-core/src/components/Toast/Toast/Toast.tsx"),i=e("./node_modules/core-js/modules/es.object.keys.js"),d=e("./node_modules/core-js/modules/es.array.index-of.js"),c=e("./node_modules/core-js/modules/es.array.map.js"),l=e("./packages/travelmakers-design-hooks/src/useCalendar/useCalendar.tsx"),r=e("./packages/travelmakers-design-hooks/src/useUpdateEffect/useUpdateEffect.ts"),a=e("./node_modules/react/index.js"),p=e.n(a),T=e("./packages/travelmakers-design-core/src/components/View/View.tsx"),S=e("./packages/travelmakers-design-styles/src/tss/createStyles.ts"),O=Object(S.a)(function(m){var q,z;return{root:{width:"100%",height:"100%"},container:{backgroundColor:m.colors.white,maxWidth:m.deviceSizes.mobile,height:"100%",margin:"auto",position:"relative"},calendar:(z={maxWidth:m.deviceSizes.mobile,height:"100%",margin:"auto",padding:m.spacing.spacing10+" "+m.spacing.spacing30,backgroundColor:m.colors.white},z["& > table"]=(q={width:"100%",borderCollapse:"collapse",color:m.colors.primary1},q.tr={height:48},q),z),tableHead:{padding:m.spacing.spacing10+" "+m.spacing.spacing30,display:"flex",justifyContent:"space-between",alignItems:"center"},tableCell:{textAlign:"center",padding:m.spacing.spacing20},tableMonthly:{textAlign:"right"},mt10:{marginTop:m.spacing.spacing10},sunday:{color:m.colors.error},saturday:{color:m.colors.tertiary}}}),R=Object(S.a)(function(m,q){var z,re,he,ge,Ie=q.topIndicatorPosition;return{indicatorBox:{maxWidth:m.deviceSizes.mobile,margin:"auto",height:"64px",position:"sticky",top:Ie,zIndex:10,display:"flex",justifyContent:"space-between",backgroundColor:m.colors.surface,padding:m.spacing.spacing10+" "+m.spacing.spacing50},indicatorInnerBox:(re={display:"flex",flexDirection:"row",gap:m.spacing.spacing30,color:"black",width:"233px",height:"100%"},re["& > div"]=(z={display:"flex",flexDirection:"column"},z["& > span"]={height:m.lineHeights.caption},z),re),indicatorSelectedDayContainer:{minWidth:100},indicatorSelectedDay:(he={display:"flex",flexDirection:"column",gap:"3px"},he["& > span"]={height:m.lineHeights.caption},he),indicatorDateCountBox:(ge={margin:"auto 0"},ge["& > div"]={minWidth:"56px",height:"28px",padding:"0 "+m.spacing.spacing10,border:"1px solid "+m.colors.primary1,borderRadius:m.radius.radius100,textAlign:"center"},ge),indicatorNight:{display:"flex",justifyContent:"center",lineHeight:"28px"}}}),E=e("./packages/travelmakers-design-utils/src/getDate/getDate.tsx"),b=e("./packages/travelmakers-design-core/src/components/Typography/Typography.tsx"),h=e("./packages/travelmakers-design-core/src/components/Divider/Divider.tsx"),A=e("./node_modules/date-fns/esm/differenceInDays/index.js"),P=e("./node_modules/react/jsx-runtime.js"),N=function(q){var z=q.selected,re=q.type,he=q.topIndicatorPosition,ge=q.text,Ie=q.locale,xe=Ie===void 0?"ko":Ie,Re=R({topIndicatorPosition:he}),Be=Re.classes,an=re==="tour",gn=function(){if(an){var xn,_n;return!((xn=z.time)!==null&&xn!==void 0&&xn.hour)||!((_n=z.time)!==null&&_n!==void 0&&_n.minutes)?Object(P.jsx)(b.a,{level:"caption",color:"primary3",dangerouslySetInnerHTML:{__html:ge==null?void 0:ge.descriptionTo}}):Object(P.jsx)("div",{className:Be.indicatorSelectedDay,children:Object(P.jsx)(b.a,{level:"subhead1",color:"primary1",strong:!0,children:z.time.hour+":"+z.time.minutes})})}else return z.to?Object(P.jsxs)("div",{className:Be.indicatorSelectedDay,children:[Object(P.jsx)(b.a,{level:"subhead1",color:"primary1",strong:!0,children:Object(E.a)(z.to.date).format}),Object(P.jsx)(b.a,{level:"caption",color:"primary1",children:Object(E.b)(z.to.date,xe)})]}):Object(P.jsx)(b.a,{level:"caption",color:"primary3",dangerouslySetInnerHTML:{__html:ge==null?void 0:ge.descriptionTo}})};return Object(P.jsxs)("div",{className:Be.indicatorBox,children:[Object(P.jsxs)("div",{className:Be.indicatorInnerBox,children:[Object(P.jsxs)("div",{className:Be.indicatorSelectedDayContainer,children:[Object(P.jsx)(b.a,{level:"body3",color:"secondary1",strong:!0,children:ge==null?void 0:ge.from}),z.from?Object(P.jsxs)("div",{className:Be.indicatorSelectedDay,children:[Object(P.jsx)(b.a,{level:"subhead1",color:"primary1",strong:!0,children:Object(E.a)(z.from.date).format}),Object(P.jsx)(b.a,{level:"caption",color:"primary1",children:Object(E.b)(z.from.date,xe)})]}):Object(P.jsx)(b.a,{level:"caption",color:"primary3",dangerouslySetInnerHTML:{__html:ge==null?void 0:ge.descriptionFrom}})]}),Object(P.jsx)(h.a,{type:"vertical",color:"outline"}),Object(P.jsxs)("div",{className:Be.indicatorSelectedDayContainer,children:[Object(P.jsx)(b.a,{level:"body3",color:"secondary1",strong:!0,children:ge==null?void 0:ge.to}),gn()]})]}),z.from&&z.to&&!an&&Object(P.jsx)("div",{className:Be.indicatorDateCountBox,children:Object(P.jsx)("div",{children:Object(P.jsxs)(b.a,{className:Be.indicatorNight,level:"subhead2",color:"primary1",children:[Object(A.a)(z.to.date,z.from.date),xe==="ko"?"\uBC15":" nights"]})})})]})};N.displayName="Indicator";var f=N,I=Object(S.a)(function(m,q){var z,re=q.open;return{optionBox:{maxWidth:m.deviceSizes.mobile,margin:"auto",position:"sticky",bottom:0,display:"flex",flexDirection:"column",padding:m.spacing.spacing50+" "+m.spacing.spacing50+" "+m.spacing.spacing30,gap:m.spacing.spacing30,backgroundColor:m.colors.surface},titleBox:(z={display:"flex",justifyContent:"space-between"},z["& > svg"]={cursor:"pointer",transform:re&&"scaleY(-1)"},z),contentBox:{display:re?"block":"none"},submitButton:{display:"flex",justifyContent:"center"}}}),B=e("./packages/travelmakers-design-core/src/components/Icon/Icon.tsx"),k=e("./packages/travelmakers-design-core/src/components/Button/Button/Button.tsx");function C(m,q){return u(m)||y(m,q)||o(m,q)||_()}function _(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(m,q){if(m){if(typeof m=="string")return j(m,q);var z=Object.prototype.toString.call(m).slice(8,-1);if(z==="Object"&&m.constructor&&(z=m.constructor.name),z==="Map"||z==="Set")return Array.from(m);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return j(m,q)}}function j(m,q){(q==null||q>m.length)&&(q=m.length);for(var z=0,re=new Array(q);z div > span"]={transform:"matrix(-1, 0, 0, 1, 0, 0)"},Be},xe=function(){return{backgroundColor:m.colors.surface}};return{container:Object.assign({},m.typography.body2,{textAlign:"center",cursor:ge?"pointer":"default",position:"relative",margin:"auto",width:48,height:48}),calendar:{},box:(z={display:"inline-flex",alignItems:"center"},z["& > span"]={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},z),boxText:{width:24,height:24,borderRadius:m.radius.radius100},strikeBox:{display:"none",position:"absolute",alignItems:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},strike:{display:"block",width:"25px",height:"1px",backgroundColor:m.colors.primary3},sunday:{color:m.colors.error},saturday:{color:m.colors.tertiary},"disabled-between":{color:m.colors.primary4},"disabled-to-between":{color:m.colors.primary4},disabled:{color:m.colors.primary4},focusDay:{color:m.colors.white,backgroundColor:m.colors.secondary},betweenDaysBackground:Object.assign({},xe()),background:{position:"absolute",display:"flex",alignItems:"center",top:"24%",width:"100%",height:"26px"},"background-from":Object.assign({},xe(),{borderRadius:"100px 0px 0px 100px",width:"37px",right:-1}),"background-to":Object.assign({},xe(),Ie()),betweenDays:Object.assign({},xe()),"background-default-between":Object.assign({},xe()),"background-disabled-between":Object.assign({},xe()),"background-disabled-to-between":Object.assign({},xe(),Ie()),"background-to-between":Object.assign({},xe(),Ie())}}),Ge=["locale","day","visible","checked","dateBreak","betweenDays","selectableDates","disabledDays","onClick","enabledDays","minNight","type","className"];function tn(m){return nn(m)||Xe(m)||Ue(m)||ln()}function ln(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ue(m,q){if(m){if(typeof m=="string")return cn(m,q);var z=Object.prototype.toString.call(m).slice(8,-1);if(z==="Object"&&m.constructor&&(z=m.constructor.name),z==="Map"||z==="Set")return Array.from(m);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return cn(m,q)}}function Xe(m){if(typeof Symbol!="undefined"&&m[Symbol.iterator]!=null||m["@@iterator"]!=null)return Array.from(m)}function nn(m){if(Array.isArray(m))return cn(m)}function cn(m,q){(q==null||q>m.length)&&(q=m.length);for(var z=0,re=new Array(q);z=0)&&Object.prototype.propertyIsEnumerable.call(m,re)&&(z[re]=m[re])}return z}function $e(m,q){if(m==null)return{};var z={},re=Object.keys(m),he,ge;for(ge=0;ge=0)&&(z[he]=m[he]);return z}var we=p.a.memo(Object(a.forwardRef)(function(m,q){var z,re,he,ge,Ie=m.locale,xe=m.day,Re=m.visible,Be=m.checked,an=m.dateBreak,gn=m.betweenDays,vn=m.selectableDates,xn=m.disabledDays,_n=m.onClick,Tn=m.enabledDays,En=m.minNight,Cn=m.type,In=m.className,sn=Ze(m,Ge),yn=Le({day:xe,checked:Be,visible:Re}),qe=yn.classes,bn=yn.cx,kn=Object(a.useDeferredValue)(xe),On={0:[qe.sunday],1:[],2:[],3:[],4:[],5:[],6:[qe.saturday]},Bn=function(He){return Be.from&&Be.to&&Object(A.a)(He.date,Be.from.date)>0&&Object(A.a)(Be.to.date,He.date)>0},Se=function(He){return Be.from&&!Be.to&&Object(A.a)(He.date,Be.from.date)>0&&Object(A.a)(Tn,He.date)>=0},ne=function(He){if(Be.from){var Ve=Object(A.a)(He.date,Be.from.date);return Ve>En}return!1},ae=function(He){return He.disabled?Pe(He):Je(He)},Pe=function(He){var Ve;if(Be.from&&Object(F.a)((Ve=Be.to)===null||Ve===void 0?void 0:Ve.date,He.date))return"disabled-to-between";if(rn(He)&&(!Be.to||Mn(He))){var Ke=ne(He);return Ke&&gn.some(function(We){return Object(F.a)(We,He.date)})?"default-between":Ye(He)?"disabled-between":"disabled-to-between"}return"disabled"},Je=function(He){var Ve,Ke,We=gn.some(function(Pn){return Object(F.a)(Pn,He.date)});if(Se(He)){var en=ne(He);return Ye(He)?en&&We?"default-between":"disabled-between":en&&We?"to-between":"disabled-to-between"}return Object(F.a)(He.date,(Ve=Be.from)===null||Ve===void 0?void 0:Ve.date)?Cn==="move-in"?"from":"focus":Object(F.a)(He.date,(Ke=Be.to)===null||Ke===void 0?void 0:Ke.date)?"to":Bn(He)?"default-between":"default"},rn=function(He){return Be.from&&Object(A.a)(He.date,Be.from.date)>0&&Object(A.a)(Tn,He.date)>=0},Mn=function(He){var Ve;return!Be.to||Object(A.a)((Ve=Be.to)===null||Ve===void 0?void 0:Ve.date,He.date)>=0},Ye=function(He){return Object(A.a)(Tn,He.date)>0};return Object(P.jsx)(T.a,Object.assign({component:"td",ref:q,className:bn(In,qe.container),onClick:function(){return Re&&(_n==null?void 0:_n(kn))}},sn,{children:Re&&Object(P.jsxs)("div",{className:bn(qe.calendar),children:[Object(P.jsx)("div",{className:bn(qe.background,qe["background-"+ae(xe)],qe[Bn(xe)&&"betweenDays"],qe[Cn==="move-in"&&((z=Be.from)===null||z===void 0?void 0:z.date)===xe.date&&"background-from"],qe[Cn==="move-in"&&((re=Be.to)===null||re===void 0?void 0:re.date)===xe.date&&"background-to"])}),Object(P.jsx)("div",{className:qe.box,children:Object(P.jsx)("span",{className:bn.apply(void 0,[qe.boxText].concat(tn(On[kn.dayIndex]),[qe[ae(xe)],qe[!Be.from&&kn.disabled&&"disabled"],qe[((he=Be.from)===null||he===void 0?void 0:he.date)===xe.date&&"focusDay"],qe[((ge=Be.to)===null||ge===void 0?void 0:ge.date)===xe.date&&"focusDay"]])),children:kn.dayOfMonth})}),Object(P.jsx)("div",{className:qe.strikeBox,children:Object(P.jsx)("span",{className:qe.strike})})]})}))}));we.displayName="DateCell";var dn=e("./node_modules/lodash/lodash.js"),on=e.n(dn),hn=e("./node_modules/date-fns/esm/getMonth/index.js"),jn=["locale","title","hotelName","checked","betweenDays","disabledDays","selectableDates","year","month","weeks","onClick","onClear","enabledDays","minNight","type","className","children"];function Dn(m,q){if(m==null)return{};var z=pn(m,q),re,he;if(Object.getOwnPropertySymbols){var ge=Object.getOwnPropertySymbols(m);for(he=0;he=0)&&Object.prototype.propertyIsEnumerable.call(m,re)&&(z[re]=m[re])}return z}function pn(m,q){if(m==null)return{};var z={},re=Object.keys(m),he,ge;for(ge=0;ge=0)&&(z[he]=m[he]);return z}var Fe=p.a.memo(Object(a.forwardRef)(function(m,q){var z=m.locale,re=m.title,he=m.hotelName,ge=m.checked,Ie=m.betweenDays,xe=m.disabledDays,Re=m.selectableDates,Be=m.year,an=m.month,gn=m.weeks,vn=m.onClick,xn=m.onClear,_n=m.enabledDays,Tn=m.minNight,En=m.type,Cn=m.className,In=m.children,sn=Dn(m,jn),yn=le(),qe=yn.classes;return Object(P.jsxs)(P.Fragment,{children:[Object(P.jsx)("div",{className:qe.tableHead,children:Object(P.jsx)(ye,{title:re,onClear:xn,locale:z})}),Object(P.jsxs)("table",{children:[Object(P.jsxs)("caption",{className:"sr-only",children:[he&&he+" :"," ",re," \uB2EC\uB825"]}),Object(P.jsx)("thead",{className:qe.mt10,children:Object(P.jsx)(De,{locale:z})}),Object(P.jsx)("tbody",{children:gn.filter(function(bn){return on.a.first(bn).month===an&&on.a.first(bn).year===Be}).map(function(bn,kn){if(!Be)return null;var On=Be+"year-"+an+"month-"+kn+"week",Bn=!1;return Object(P.jsx)(p.a.Fragment,{children:Object(P.jsx)("tr",{children:bn.map(function(Se){if(!Se.year)return null;var ne=on.a.first(bn).month===Object(hn.a)(Se.date)+1+"\uC6D4",ae=on.a.first(bn).month===Object(E.a)(Se.date,"MMMM").format;return Object(P.jsx)(we,{locale:z,day:Se,betweenDays:Ie,dateBreak:Bn,type:En,enabledDays:_n,minNight:Tn,checked:ge,disabledDays:xe,selectableDates:Re,onClick:vn,visible:z==="ko"?ne:ae},On+"-"+Se.dayOfMonth+"day")})})},On)})})]})]})})),un=["checked","setChecked","type","selectableDates","disabledDays","minNight","maxNight","hotelName","notAllowedMessage","months","years","weeks","locale","className"];function ce(m,q){return _e(m)||fe(m,q)||Q(m,q)||ee()}function ee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q(m,q){if(m){if(typeof m=="string")return se(m,q);var z=Object.prototype.toString.call(m).slice(8,-1);if(z==="Object"&&m.constructor&&(z=m.constructor.name),z==="Map"||z==="Set")return Array.from(m);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return se(m,q)}}function se(m,q){(q==null||q>m.length)&&(q=m.length);for(var z=0,re=new Array(q);z=0)&&Object.prototype.propertyIsEnumerable.call(m,re)&&(z[re]=m[re])}return z}function pe(m,q){if(m==null)return{};var z={},re=Object.keys(m),he,ge;for(ge=0;ge=0)&&(z[he]=m[he]);return z}var Te=p.a.memo(Object(a.forwardRef)(function(m,q){var z=m.checked,re=m.setChecked,he=m.type,ge=m.selectableDates,Ie=m.disabledDays,xe=m.minNight,Re=m.maxNight,Be=m.hotelName,an=m.notAllowedMessage,gn=m.months,vn=m.years,xn=m.weeks,_n=m.locale,Tn=m.className,En=de(m,un),Cn=Object(a.useState)(),In=ce(Cn,2),sn=In[0],yn=In[1],qe=Object(a.useState)([]),bn=ce(qe,2),kn=bn[0],On=bn[1],Bn=function(){for(var We=[],en=Object(E.c)(z.from.date).dayjs.add(Re,"days").toDate(),Pn=Object(A.a)(en,z.from.date),wn=Array.from({length:Pn}),zn=function(){var $n=Object(E.c)(z.from.date,"YYYY-MM-DD").dayjs.add(Hn+1,"days").toDate(),at=!ge.some(function(st){return Object(F.a)(Object(E.c)(st).date,$n)});if(We.push($n),at)return"break"},Hn=0;Hn0&&Object(A.a)(sn,We.date)>=0},ne=function(We){if(z.from){var en=Object(A.a)(We.date,z.from.date);return en>xe}return!1},ae=function(We){var en=Ie.some(function(wn){return Object(F.a)(Object(E.c)(wn).date,We.date)}),Pn=!ge.some(function(wn){return Object(F.a)(Object(E.c)(wn).date,We.date)});return en||Pn},Pe=function(){re({to:null,from:null,time:{hour:null,minutes:null}})},Je=function(We){var en=he==="tour",Pn=!z.from;if(!(!en&&rn(We))){if(Mn(We)){an?an():Ve();return}en?Ye(We):Pn?mn(We):Se(We)?He(We):Ve()}},rn=function(We){var en=z.from&&!Se(We)&&!ae(We);return en&&Ve(),en},Mn=function(We){var en=z.from?kn.some(function(Pn){return Object(F.a)(Pn,We.date)}):!0;return!z.from&&ae(We)||z.from&&!en||Se(We)&&!ne(We)},Ye=function(We){re(function(en){return Object.assign({},en,{from:We,to:We})})},mn=function(We){re(function(en){return Object.assign({},en,{from:We})}),yn(Object($.a)(We.date,Re))},He=function(We){re(function(en){return Object.assign({},en,{to:We})}),yn(Object($.a)(We.date,Re))},Ve=function(){re({to:null,from:null,time:{hour:null,minutes:null}})};return Object(P.jsx)(P.Fragment,{children:gn.map(function(Ke,We){var en=vn[We];if(!en)return null;var Pn=en+"\uB144 "+Ke,wn=Ke+" "+en;return Object(P.jsx)(Fe,{locale:_n,checked:z,betweenDays:kn,type:he,disabledDays:Ie,selectableDates:ge,title:_n==="ko"?Pn:wn,hotelName:Be,year:en,month:Ke,weeks:xn,onClick:Je,onClear:Pe,enabledDays:sn,minNight:xe},Pn)})})})),X=e("./node_modules/date-fns/esm/locale/ko/index.js"),ue=e("./node_modules/date-fns/esm/locale/en-US/index.js"),Oe=["keyword","hotelName","type","selected","disabledDays","selectableDates","notAllowedMessage","minNight","maxNight","topIndicatorPosition","displayMonth","onChange","onClick","loadingImageSrc","indicatorText","locale","children","className"];function Me(m){return ze(m)||Ee(m)||Sn(m)||Ne()}function Ne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. diff --git a/project.json b/project.json index 1bc9dc49..861f75f7 100644 --- a/project.json +++ b/project.json @@ -1 +1 @@ -{"generatedAt":1726822731941,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"Next","packageName":"next","version":"13.4.7"},"monorepo":"Lerna","packageManager":{"type":"yarn","version":"1.22.22"},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addons":{"version":"6.5.16"},"@storybook/react":{"version":"6.5.16"},"@storybook/storybook-deployer":{"version":"2.8.16"}},"framework":{"name":"react"},"addons":{"storybook-addon-turbo-build":{"version":"1.1.0"},"storybook-dark-mode":{"version":"1.1.2"},"storybook-addon-outline":{"version":"1.4.2"},"@storybook/addon-viewport":{"version":"6.5.16"},"@storybook/addon-controls":{"version":"6.5.16"},"@storybook/addon-storysource":{"version":"6.5.16"},"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"},"@storybook/addon-docs":{"version":"6.5.16"},"@storybook/theming":{"version":"6.5.16"}}} +{"generatedAt":1727161274039,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"Next","packageName":"next","version":"13.4.7"},"monorepo":"Lerna","packageManager":{"type":"yarn","version":"1.22.22"},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addons":{"version":"6.5.16"},"@storybook/react":{"version":"6.5.16"},"@storybook/storybook-deployer":{"version":"2.8.16"}},"framework":{"name":"react"},"addons":{"storybook-addon-turbo-build":{"version":"1.1.0"},"storybook-dark-mode":{"version":"1.1.2"},"storybook-addon-outline":{"version":"1.4.2"},"@storybook/addon-viewport":{"version":"6.5.16"},"@storybook/addon-controls":{"version":"6.5.16"},"@storybook/addon-storysource":{"version":"6.5.16"},"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"},"@storybook/addon-docs":{"version":"6.5.16"},"@storybook/theming":{"version":"6.5.16"}}}