@heycater/qualification-funnel 1.19.5 → 1.19.7
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/heycater-funnel.iife.js +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +13 -5
- package/package.json +1 -1
|
@@ -595,7 +595,7 @@
|
|
|
595
595
|
margin-left: ${e=>e.theme.spacing(2)}px;
|
|
596
596
|
`,VM=_p(BM)`
|
|
597
597
|
margin-right: ${e=>e.theme.spacing(2)}px;
|
|
598
|
-
`,UM={locales:["en","de"],defaultLocale:"de"},WM=e=>t=>{const n=t
|
|
598
|
+
`,UM={locales:["en","de"],defaultLocale:"de"},WM=e=>t=>{const n=t=>{let n;return n="string"==typeof e&&e.startsWith("en")?"en":UM.locales.includes(e)?e:UM.defaultLocale,`${t}_${n}`};if(t.includes(".")){const[e,r]=t.split(".");return`${e}.${n(r)}`}return n(t)};function HM(){const e=_E();var t;return{localizedFieldAlgolia:WM(e.locale),localizedAttributeName:(t=e.locale,e=>(null==t?void 0:t.startsWith("en"))?`${e}En`:UM.locales.includes(t)?`${e}${CS(t)}`:`${e}${CS(UM.defaultLocale)}`)}}function ZM({questionId:e,suggestions:t,onSelect:n}){const{localizedAttributeName:r}=HM(),o=g.useMemo(()=>t.map(e=>({value:e.value,label:e[r("label")]})),[r,t])||[];return C.jsx(KM,{flexWrap:"wrap",flexDirection:"row",alignItems:"center",justifyContent:"center",id:e,children:o.map((e,t)=>C.jsx(Fm,{onClick:()=>n(e.value),children:C.jsx(YM,{variant:"caption",children:e.label})},`${e.value}::${t}`))})}const KM=_p(Fm)`
|
|
599
599
|
display: flex;
|
|
600
600
|
gap: ${({theme:e})=>e.spacing(1.5)}px;
|
|
601
601
|
justify-content: space-around;
|
|
@@ -877,7 +877,7 @@
|
|
|
877
877
|
${({theme:e})=>e.breakpoints.up("md")} {
|
|
878
878
|
max-width: 320px;
|
|
879
879
|
}
|
|
880
|
-
`;function sP(){var e,t;const
|
|
880
|
+
`;function sP(){var e,t,n;const r=_E(),{answerOf:o,actions:i,state:a}=KO(),{trackAnswer:s}=dj(),l=o("event_date"),u=l?new Date(l):void 0,c=function(e,t){if(h_(2,arguments),!t||"object"!==he(t))return new Date(NaN);var n=t.years?p_(t.years):0,r=t.months?p_(t.months):0,o=t.weeks?p_(t.weeks):0,i=t.days?p_(t.days):0,a=t.hours?p_(t.hours):0,s=t.minutes?p_(t.minutes):0,l=t.seconds?p_(t.seconds):0,u=m_(e),c=r||n?v_(u,r+12*n):u,d=i||o?g_(c,i+7*o):c,f=1e3*(l+60*(s+60*a));return new Date(d.getTime()+f)}(new Date,{days:2}),d="qualification"in a?UL.getAttributes({answers:a.qualification.answers,selectedCaterer:a.qualification.selectedCaterer}):null,f=(null==(e=r.locale)?void 0:e.startsWith("en"))?null==(t=null==d?void 0:d.minDate)?void 0:t.messageEn:null==(n=null==d?void 0:d.minDate)?void 0:n.messageDe,[p]=g.useState(!!o(VL.id));g.useEffect(()=>{l&&i.answerQuestion("has_recurring_need",p)},[p]);const[h,m]=g.useState(u||c);return C.jsx(nP,{dateSelector:C.jsxs(pP,{children:[C.jsx(hP,{children:C.jsx(tP,{components:{Caption:uP,Row:cP,Day:lP},formatters:{formatWeekdayName:(e,t)=>TL(e,"EEEEE",{locale:null==t?void 0:t.locale})},month:h,onDayClick:e=>{i.answerQuestion("event_date",e),s("event_date",TL(e,"yyyy-MM-dd"))},selected:u,fromDate:c,onMonthChange:m,captionLayout:"buttons",locale:r.locale?hM[r.locale]:void 0,showOutsideDays:!0,mode:"single"})}),f&&C.jsx(Fm,{textAlign:"center",mt:2,children:C.jsxs(fP,{children:["*",f]})})]}),sideContent:C.jsx(oP,{})})}function lP(e){const{outside:t}=DT(e.date,e.displayMonth),n=$j();return t&&function(e){return h_(1,arguments),1===m_(e).getDate()}(e.date)?C.jsxs(Fm,{position:"relative",children:[C.jsx(Fm,{position:"absolute",top:"-3px",left:"-3px",children:C.jsx(Qm,{fontSize:9,children:TL(e.date,"MMM",{locale:n.locale})})}),C.jsx(qT,{...e})]}):C.jsx(qT,{...e})}function uP(e){const{goToMonth:t,nextMonth:n,previousMonth:r}=Yj(),o=$j();return C.jsxs(Fm,{display:"flex",justifyContent:"space-between",alignItems:"center",py:1.5,children:[C.jsx(dP,{id:"datepicker__prev-month",type:"button",disabled:!r,onClick:()=>r&&t(r),children:C.jsx(Qj,{})}),C.jsx(Qm,{fontSize:15,fontWeight:600,children:TL(e.displayMonth,"MMMM yyyy",{locale:o.locale})}),C.jsx(dP,{id:"datepicker__next-month",type:"button",disabled:!n,onClick:()=>n&&t(n),children:C.jsx(Jj,{})})]})}function cP(e){const t=new Date;if(FL(t,e.displayMonth)){const n=RL(e.displayMonth),r=RL(t)-n,o=e.dates.map(e=>__(e,r));return o.some(t=>FL(t,e.displayMonth))?C.jsx(UT,{...e,weekNumber:e.weekNumber+r,dates:o}):C.jsx(C.Fragment,{})}return C.jsx(UT,{...e})}const dP=_p.button`
|
|
881
881
|
background-color: transparent;
|
|
882
882
|
border: none;
|
|
883
883
|
cursor: pointer;
|
package/dist/index.cjs.js
CHANGED
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
margin-left: ${e=>e.theme.spacing(2)}px;
|
|
445
445
|
`,gp=o(hp)`
|
|
446
446
|
margin-right: ${e=>e.theme.spacing(2)}px;
|
|
447
|
-
`,yp={locales:["en","de"],defaultLocale:"de"},vp=e=>t=>{const n=t
|
|
447
|
+
`,yp={locales:["en","de"],defaultLocale:"de"},vp=e=>t=>{const n=t=>{let n;return n="string"==typeof e&&e.startsWith("en")?"en":yp.locales.includes(e)?e:yp.defaultLocale,`${t}_${n}`};if(t.includes(".")){const[e,r]=t.split(".");return`${e}.${n(r)}`}return n(t)};function bp(){const e=du();var t;return{localizedFieldAlgolia:vp(e.locale),localizedAttributeName:(t=e.locale,e=>(null==t?void 0:t.startsWith("en"))?`${e}En`:yp.locales.includes(t)?`${e}${Rl(t)}`:`${e}${Rl(yp.defaultLocale)}`)}}function Cp({questionId:e,suggestions:r,onSelect:i}){const{localizedAttributeName:o}=bp(),a=n.useMemo(()=>r.map(e=>({value:e.value,label:e[o("label")]})),[o,r])||[];return t.jsx(xp,{flexWrap:"wrap",flexDirection:"row",alignItems:"center",justifyContent:"center",id:e,children:a.map((e,n)=>t.jsx(v,{onClick:()=>i(e.value),children:t.jsx(wp,{variant:"caption",children:e.label})},`${e.value}::${n}`))})}const xp=o(v)`
|
|
448
448
|
display: flex;
|
|
449
449
|
gap: ${({theme:e})=>e.spacing(1.5)}px;
|
|
450
450
|
justify-content: space-around;
|
|
@@ -726,7 +726,7 @@
|
|
|
726
726
|
${({theme:e})=>e.breakpoints.up("md")} {
|
|
727
727
|
max-width: 320px;
|
|
728
728
|
}
|
|
729
|
-
`;function lh(){var e,r;const
|
|
729
|
+
`;function lh(){var e,r,i;const o=du(),{answerOf:a,actions:s,state:l}=xf(),{trackAnswer:c}=$p(),d=a("event_date"),f=d?new Date(d):void 0,p=rc(new Date,{days:2}),h="qualification"in l?gd.getAttributes({answers:l.qualification.answers,selectedCaterer:l.qualification.selectedCaterer}):null,m=(null==(e=o.locale)?void 0:e.startsWith("en"))?null==(r=null==h?void 0:h.minDate)?void 0:r.messageEn:null==(i=null==h?void 0:h.minDate)?void 0:i.messageDe,[g]=n.useState(!!a(md.id));n.useEffect(()=>{d&&s.answerQuestion("has_recurring_need",g)},[g]);const[y,b]=n.useState(f||p);return t.jsx(rh,{dateSelector:t.jsxs(hh,{children:[t.jsx(mh,{children:t.jsx(u.DayPicker,{components:{Caption:ch,Row:dh,Day:uh},formatters:{formatWeekdayName:(e,t)=>rd(e,"EEEEE",{locale:null==t?void 0:t.locale})},month:y,onDayClick:e=>{s.answerQuestion("event_date",e),c("event_date",rd(e,"yyyy-MM-dd"))},selected:f,fromDate:p,onMonthChange:b,captionLayout:"buttons",locale:o.locale?qf[o.locale]:void 0,showOutsideDays:!0,mode:"single"})}),m&&t.jsx(v,{textAlign:"center",mt:2,children:t.jsxs(ph,{children:["*",m]})})]}),sideContent:t.jsx(oh,{})})}function uh(e){const{outside:n}=u.useActiveModifiers(e.date,e.displayMonth),r=u.useDayPicker();return n&&function(e){return ec(1,arguments),1===tc(e).getDate()}(e.date)?t.jsxs(v,{position:"relative",children:[t.jsx(v,{position:"absolute",top:"-3px",left:"-3px",children:t.jsx(D,{fontSize:9,children:rd(e.date,"MMM",{locale:r.locale})})}),t.jsx(u.Day,{...e})]}):t.jsx(u.Day,{...e})}function ch(e){const{goToMonth:n,nextMonth:r,previousMonth:i}=u.useNavigation(),o=u.useDayPicker();return t.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",py:1.5,children:[t.jsx(fh,{id:"datepicker__prev-month",type:"button",disabled:!i,onClick:()=>i&&n(i),children:t.jsx(u.IconLeft,{})}),t.jsx(D,{fontSize:15,fontWeight:600,children:rd(e.displayMonth,"MMMM yyyy",{locale:o.locale})}),t.jsx(fh,{id:"datepicker__next-month",type:"button",disabled:!r,onClick:()=>r&&n(r),children:t.jsx(u.IconRight,{})})]})}function dh(e){const n=new Date;if(pd(n,e.displayMonth)){const r=od(e.displayMonth),i=od(n)-r,o=e.dates.map(e=>function(e,t){return ec(2,arguments),nc(e,7*Xu(t))}(e,i));return o.some(t=>pd(t,e.displayMonth))?t.jsx(u.Row,{...e,weekNumber:e.weekNumber+i,dates:o}):t.jsx(t.Fragment,{})}return t.jsx(u.Row,{...e})}const fh=o.button`
|
|
730
730
|
background-color: transparent;
|
|
731
731
|
border: none;
|
|
732
732
|
cursor: pointer;
|
package/dist/index.esm.js
CHANGED
|
@@ -9886,9 +9886,14 @@ const localeConfig = {
|
|
|
9886
9886
|
};
|
|
9887
9887
|
const algoliaAttributeNameForLocale = (locale2) => (name) => {
|
|
9888
9888
|
const toLocalizedAlgoliaKey = (name2) => {
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9889
|
+
let parsedLocale;
|
|
9890
|
+
if (typeof locale2 === "string" && locale2.startsWith("en")) {
|
|
9891
|
+
parsedLocale = "en";
|
|
9892
|
+
} else if (localeConfig.locales.includes(locale2)) {
|
|
9893
|
+
parsedLocale = locale2;
|
|
9894
|
+
} else {
|
|
9895
|
+
parsedLocale = localeConfig.defaultLocale;
|
|
9896
|
+
}
|
|
9892
9897
|
return `${name2}_${parsedLocale}`;
|
|
9893
9898
|
};
|
|
9894
9899
|
if (name.includes(".")) {
|
|
@@ -9898,6 +9903,9 @@ const algoliaAttributeNameForLocale = (locale2) => (name) => {
|
|
|
9898
9903
|
return toLocalizedAlgoliaKey(name);
|
|
9899
9904
|
};
|
|
9900
9905
|
const attributeNameForLocale = (locale2) => (name) => {
|
|
9906
|
+
if (locale2 == null ? void 0 : locale2.startsWith("en")) {
|
|
9907
|
+
return `${name}En`;
|
|
9908
|
+
}
|
|
9901
9909
|
if (!localeConfig.locales.includes(locale2))
|
|
9902
9910
|
return `${name}${capitalize$3(localeConfig.defaultLocale)}`;
|
|
9903
9911
|
return `${name}${capitalize$3(locale2)}`;
|
|
@@ -10849,7 +10857,7 @@ const SwitchesWrapper = styled.div`
|
|
|
10849
10857
|
`;
|
|
10850
10858
|
const defaultLeadTimeInDays = DEFAULT_LEAD_DAYS;
|
|
10851
10859
|
function DatePickerEmbedded() {
|
|
10852
|
-
var _a2, _b;
|
|
10860
|
+
var _a2, _b, _c;
|
|
10853
10861
|
const router = useRouter();
|
|
10854
10862
|
const { answerOf, actions, state } = useQualification();
|
|
10855
10863
|
const { trackAnswer } = useTracking();
|
|
@@ -10863,7 +10871,7 @@ function DatePickerEmbedded() {
|
|
|
10863
10871
|
answers: state.qualification.answers,
|
|
10864
10872
|
selectedCaterer: state.qualification.selectedCaterer
|
|
10865
10873
|
}) : null;
|
|
10866
|
-
const minDateMessage = router.locale
|
|
10874
|
+
const minDateMessage = ((_a2 = router.locale) == null ? void 0 : _a2.startsWith("en")) ? (_b = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _b.messageEn : (_c = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _c.messageDe;
|
|
10867
10875
|
const [isRecurringNeedSelected] = useState(
|
|
10868
10876
|
!!answerOf(isRecurringQuestion.id)
|
|
10869
10877
|
);
|