@heycater/qualification-funnel 1.3.12 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/heycater-funnel.iife.js +132 -134
- package/dist/index.cjs.js +128 -130
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +132 -70
- package/dist/index.esm.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var _a;
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import React__default, { createContext, useContext, useMemo, useReducer, useCallback, useEffect, useRef, useState, isValidElement, cloneElement, Children, forwardRef } from "react";
|
|
5
|
-
import { darken as darken$1, lighten as lighten$1, ButtonBase as ButtonBase$2, Typography as Typography$1, useMediaQuery, Input as Input$1, IconButton as IconButton$2,
|
|
5
|
+
import { darken as darken$1, lighten as lighten$1, ButtonBase as ButtonBase$2, Typography as Typography$1, useMediaQuery, Input as Input$1, IconButton as IconButton$2, useTheme as useTheme$1, FormControlLabel, Tooltip, Menu, Hidden, SnackbarContent, Snackbar, TextField, CircularProgress, Modal, ThemeProvider as ThemeProvider$1, StylesProvider as StylesProvider$1, CssBaseline } from "@material-ui/core";
|
|
6
6
|
import { useTranslation, initReactI18next, I18nextProvider } from "react-i18next";
|
|
7
7
|
import styled, { css as css$1, createGlobalStyle, ThemeProvider } from "styled-components";
|
|
8
8
|
import { gql, useQuery, useClient, mapExchange, Client, cacheExchange, fetchExchange, Provider } from "urql";
|
|
@@ -7077,7 +7077,29 @@ const teamSizeQuestion = Object.freeze(
|
|
|
7077
7077
|
titleDe: "Wie viele Mitarbeitende sind ca. regelmäßig vor Ort?",
|
|
7078
7078
|
placeholderEn: "Number of employees",
|
|
7079
7079
|
placeholderDe: "Anzahl der Mitarbeiter"
|
|
7080
|
-
}
|
|
7080
|
+
},
|
|
7081
|
+
suggestions: [
|
|
7082
|
+
{
|
|
7083
|
+
labelEn: "10 People",
|
|
7084
|
+
labelDe: "10 Personen",
|
|
7085
|
+
value: 10
|
|
7086
|
+
},
|
|
7087
|
+
{
|
|
7088
|
+
labelEn: "25 People",
|
|
7089
|
+
labelDe: "25 Personen",
|
|
7090
|
+
value: 25
|
|
7091
|
+
},
|
|
7092
|
+
{
|
|
7093
|
+
labelEn: "50 People",
|
|
7094
|
+
labelDe: "50 Personen",
|
|
7095
|
+
value: 50
|
|
7096
|
+
},
|
|
7097
|
+
{
|
|
7098
|
+
labelEn: "100 People",
|
|
7099
|
+
labelDe: "100 Personen",
|
|
7100
|
+
value: 100
|
|
7101
|
+
}
|
|
7102
|
+
]
|
|
7081
7103
|
})
|
|
7082
7104
|
);
|
|
7083
7105
|
const questions$2 = {
|
|
@@ -9661,6 +9683,7 @@ const QuantityStepperField = ({
|
|
|
9661
9683
|
autoFocus = true
|
|
9662
9684
|
}) => {
|
|
9663
9685
|
const { inputRef } = useInputFocusOnMount({ shouldFocus: autoFocus });
|
|
9686
|
+
const muiTheme = useTheme$1();
|
|
9664
9687
|
const handleChange = (nextValue) => {
|
|
9665
9688
|
onChange(Number(nextValue));
|
|
9666
9689
|
};
|
|
@@ -9670,6 +9693,15 @@ const QuantityStepperField = ({
|
|
|
9670
9693
|
const onIncrement = () => {
|
|
9671
9694
|
handleChange((value ?? 0) + 1);
|
|
9672
9695
|
};
|
|
9696
|
+
const inputInlineStyle = {
|
|
9697
|
+
textAlign: "center",
|
|
9698
|
+
backgroundColor: muiTheme.palette.text.disabled,
|
|
9699
|
+
border: "1px solid transparent",
|
|
9700
|
+
borderRadius: muiTheme.spacing(1),
|
|
9701
|
+
height: 49,
|
|
9702
|
+
width: 110,
|
|
9703
|
+
boxSizing: "border-box"
|
|
9704
|
+
};
|
|
9673
9705
|
return /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [
|
|
9674
9706
|
/* @__PURE__ */ jsx(
|
|
9675
9707
|
IconButtonLeft$1,
|
|
@@ -9694,7 +9726,8 @@ const QuantityStepperField = ({
|
|
|
9694
9726
|
defaultValue,
|
|
9695
9727
|
onChange: (event) => handleChange(event.target.value),
|
|
9696
9728
|
value,
|
|
9697
|
-
autoComplete: "off"
|
|
9729
|
+
autoComplete: "off",
|
|
9730
|
+
inputProps: { style: inputInlineStyle }
|
|
9698
9731
|
}
|
|
9699
9732
|
),
|
|
9700
9733
|
/* @__PURE__ */ jsx(
|
|
@@ -9774,24 +9807,6 @@ const IconButtonRight$1 = styled(StepperIconButton$1)`
|
|
|
9774
9807
|
const IconButtonLeft$1 = styled(StepperIconButton$1)`
|
|
9775
9808
|
margin-right: ${(props) => props.theme.spacing(2)}px;
|
|
9776
9809
|
`;
|
|
9777
|
-
function PeopleCountStepper() {
|
|
9778
|
-
const { actions, state, answerOf, errorsOf } = useQualification();
|
|
9779
|
-
if (state.status !== QUALIFICATION_STATUS.answering) {
|
|
9780
|
-
return null;
|
|
9781
|
-
}
|
|
9782
|
-
const answer = answerOf(questions$2.peopleCount.id);
|
|
9783
|
-
const errors = errorsOf(questions$2.peopleCount.id);
|
|
9784
|
-
return /* @__PURE__ */ jsx(
|
|
9785
|
-
QuantityStepperField,
|
|
9786
|
-
{
|
|
9787
|
-
name: questions$2.peopleCount.id,
|
|
9788
|
-
id: questions$2.peopleCount.id,
|
|
9789
|
-
value: answer || 0,
|
|
9790
|
-
error: !!(errors == null ? void 0 : errors.length),
|
|
9791
|
-
onChange: (value) => actions.answerQuestion(questions$2.peopleCount.id, value)
|
|
9792
|
-
}
|
|
9793
|
-
);
|
|
9794
|
-
}
|
|
9795
9810
|
const localeConfig = {
|
|
9796
9811
|
locales: ["en", "de"],
|
|
9797
9812
|
defaultLocale: "de"
|
|
@@ -9823,18 +9838,14 @@ function useLocalizedFieldName() {
|
|
|
9823
9838
|
localizedAttributeName
|
|
9824
9839
|
};
|
|
9825
9840
|
}
|
|
9826
|
-
function PopularValues() {
|
|
9827
|
-
const { actions } = useQualification();
|
|
9841
|
+
function PopularValues({ questionId, suggestions, onSelect }) {
|
|
9828
9842
|
const { localizedAttributeName } = useLocalizedFieldName();
|
|
9829
9843
|
const localizedOptions = useMemo(
|
|
9830
|
-
() => {
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
}));
|
|
9836
|
-
},
|
|
9837
|
-
[localizedAttributeName]
|
|
9844
|
+
() => suggestions.map((option) => ({
|
|
9845
|
+
value: option.value,
|
|
9846
|
+
label: option[localizedAttributeName("label")]
|
|
9847
|
+
})),
|
|
9848
|
+
[localizedAttributeName, suggestions]
|
|
9838
9849
|
) || [];
|
|
9839
9850
|
return /* @__PURE__ */ jsx(
|
|
9840
9851
|
FlexBox,
|
|
@@ -9843,11 +9854,11 @@ function PopularValues() {
|
|
|
9843
9854
|
flexDirection: "row",
|
|
9844
9855
|
alignItems: "center",
|
|
9845
9856
|
justifyContent: "center",
|
|
9846
|
-
id:
|
|
9857
|
+
id: questionId,
|
|
9847
9858
|
children: localizedOptions.map((option, index) => /* @__PURE__ */ jsx(
|
|
9848
9859
|
Box,
|
|
9849
9860
|
{
|
|
9850
|
-
onClick: () =>
|
|
9861
|
+
onClick: () => onSelect(option.value),
|
|
9851
9862
|
children: /* @__PURE__ */ jsx(StyledTypography$1, { variant: "caption", children: option.label })
|
|
9852
9863
|
},
|
|
9853
9864
|
`${option.value}::${index}`
|
|
@@ -9875,6 +9886,7 @@ function PriceStepperField({
|
|
|
9875
9886
|
autoFocus
|
|
9876
9887
|
}) {
|
|
9877
9888
|
const { inputRef } = useInputFocusOnMount({ shouldFocus: !!autoFocus });
|
|
9889
|
+
const muiTheme = useTheme$1();
|
|
9878
9890
|
const minValue = min2 || 0;
|
|
9879
9891
|
const currencySymbol = useCurrencySymbol();
|
|
9880
9892
|
const isInputValid = (value2) => {
|
|
@@ -9924,7 +9936,18 @@ function PriceStepperField({
|
|
|
9924
9936
|
type: "tel",
|
|
9925
9937
|
onChange: handleChange,
|
|
9926
9938
|
value: Number(value),
|
|
9927
|
-
autoComplete: "off"
|
|
9939
|
+
autoComplete: "off",
|
|
9940
|
+
inputProps: {
|
|
9941
|
+
style: {
|
|
9942
|
+
textAlign: "center",
|
|
9943
|
+
backgroundColor: muiTheme.palette.text.disabled,
|
|
9944
|
+
border: "1px solid transparent",
|
|
9945
|
+
borderRadius: muiTheme.spacing(1),
|
|
9946
|
+
height: 49,
|
|
9947
|
+
width: 110,
|
|
9948
|
+
boxSizing: "border-box"
|
|
9949
|
+
}
|
|
9950
|
+
}
|
|
9928
9951
|
}
|
|
9929
9952
|
),
|
|
9930
9953
|
/* @__PURE__ */ jsx(Adornment, { children: /* @__PURE__ */ jsx(Typography, { children: currencySymbol }) })
|
|
@@ -10021,14 +10044,33 @@ function BudgetQuestionWithPeopleCount() {
|
|
|
10021
10044
|
const { t: t2 } = useTranslation();
|
|
10022
10045
|
const { currentUserAccount } = useCurrentUser();
|
|
10023
10046
|
const isManagedAccount = (_b = (_a2 = currentUserAccount == null ? void 0 : currentUserAccount.owner) == null ? void 0 : _a2.salesforceCustomer) == null ? void 0 : _b.isManagedAccount;
|
|
10047
|
+
const peopleCountAnswer = answerOf(questions$2.peopleCount.id);
|
|
10048
|
+
const peopleCountErrors = errorsOf(questions$2.peopleCount.id);
|
|
10024
10049
|
const pricePerPersonAnswer = answerOf(pricePerPersonQuestion.id);
|
|
10025
10050
|
const pricePerPersonErrors = errorsOf(pricePerPersonQuestion.id);
|
|
10026
10051
|
const budgetAnswer = answerOf(totalBudgetQuestion.id);
|
|
10027
10052
|
const budgetErrors = errorsOf(totalBudgetQuestion.id);
|
|
10028
10053
|
return /* @__PURE__ */ jsxs(Wrapper$4, { children: [
|
|
10029
10054
|
/* @__PURE__ */ jsx(Box, { mb: 3, children: /* @__PURE__ */ jsx(Typography, { as: "label", htmlFor: questions$2.peopleCount.id, children: t2("common:questions.min_order_number") }) }),
|
|
10030
|
-
/* @__PURE__ */ jsx(Box, { mb: 3, children: /* @__PURE__ */ jsx(
|
|
10031
|
-
|
|
10055
|
+
/* @__PURE__ */ jsx(Box, { mb: 3, children: /* @__PURE__ */ jsx(
|
|
10056
|
+
QuantityStepperField,
|
|
10057
|
+
{
|
|
10058
|
+
name: questions$2.peopleCount.id,
|
|
10059
|
+
id: questions$2.peopleCount.id,
|
|
10060
|
+
value: peopleCountAnswer || 0,
|
|
10061
|
+
error: !!(peopleCountErrors == null ? void 0 : peopleCountErrors.length),
|
|
10062
|
+
onChange: (value) => actions.answerQuestion(questions$2.peopleCount.id, value),
|
|
10063
|
+
autoFocus: false
|
|
10064
|
+
}
|
|
10065
|
+
) }),
|
|
10066
|
+
/* @__PURE__ */ jsx(FullRowBox, { children: /* @__PURE__ */ jsx(
|
|
10067
|
+
PopularValues,
|
|
10068
|
+
{
|
|
10069
|
+
questionId: questions$2.peopleCount.id,
|
|
10070
|
+
suggestions: peopleCountQuestion.suggestions || [],
|
|
10071
|
+
onSelect: (value) => actions.answerQuestion(questions$2.peopleCount.id, value)
|
|
10072
|
+
}
|
|
10073
|
+
) }),
|
|
10032
10074
|
/* @__PURE__ */ jsx(Divider$1, { my: 4 }),
|
|
10033
10075
|
/* @__PURE__ */ jsx(Box, { mb: 2, children: /* @__PURE__ */ jsx(Typography, { as: "label", htmlFor: pricePerPersonQuestion.id, children: t2("common:questions.budgetProPerson") }) }),
|
|
10034
10076
|
/* @__PURE__ */ jsx(Box, { mb: 2, children: /* @__PURE__ */ jsx(
|
|
@@ -11419,25 +11461,45 @@ const IconWrapper$1 = styled(Box)`
|
|
|
11419
11461
|
function createIconEntry(id, Icon, translationKey) {
|
|
11420
11462
|
return { id, Icon, translationKey: translationKey || `common:cities.${id}` };
|
|
11421
11463
|
}
|
|
11422
|
-
const TeamSizeInput = ({
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11464
|
+
const TeamSizeInput = ({
|
|
11465
|
+
label,
|
|
11466
|
+
questionId,
|
|
11467
|
+
value,
|
|
11468
|
+
onChange,
|
|
11469
|
+
placeholder,
|
|
11470
|
+
error,
|
|
11471
|
+
suggestions,
|
|
11472
|
+
autoFocus
|
|
11473
|
+
}) => {
|
|
11474
|
+
return /* @__PURE__ */ jsxs(Wrapper$1, { children: [
|
|
11475
|
+
/* @__PURE__ */ jsx(Box, { mb: 3, children: /* @__PURE__ */ jsx(Typography, { as: "label", htmlFor: questionId, children: label }) }),
|
|
11476
|
+
/* @__PURE__ */ jsx(Box, { mb: (suggestions == null ? void 0 : suggestions.length) ? 3 : 0, children: /* @__PURE__ */ jsx(
|
|
11477
|
+
QuantityStepperField,
|
|
11478
|
+
{
|
|
11479
|
+
id: questionId,
|
|
11480
|
+
name: questionId,
|
|
11481
|
+
value,
|
|
11482
|
+
error,
|
|
11483
|
+
onChange: (val) => onChange(Number(val)),
|
|
11484
|
+
placeholder,
|
|
11485
|
+
autoFocus
|
|
11486
|
+
}
|
|
11487
|
+
) }),
|
|
11488
|
+
(suggestions == null ? void 0 : suggestions.length) ? /* @__PURE__ */ jsx(
|
|
11489
|
+
PopularValues,
|
|
11490
|
+
{
|
|
11491
|
+
questionId,
|
|
11492
|
+
suggestions,
|
|
11493
|
+
onSelect: onChange
|
|
11494
|
+
}
|
|
11495
|
+
) : null
|
|
11496
|
+
] });
|
|
11433
11497
|
};
|
|
11434
|
-
const Wrapper$1 = styled
|
|
11498
|
+
const Wrapper$1 = styled.div`
|
|
11435
11499
|
display: flex;
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
border-radius: 8px;
|
|
11440
|
-
max-width: 300px;
|
|
11500
|
+
flex-direction: column;
|
|
11501
|
+
align-items: center;
|
|
11502
|
+
max-width: 441px;
|
|
11441
11503
|
margin: 0 auto;
|
|
11442
11504
|
`;
|
|
11443
11505
|
const MAX_WIDTH_OF_WHITE_WRAPPER = 826;
|
|
@@ -11464,7 +11526,7 @@ const EmbeddedQuestion = ({
|
|
|
11464
11526
|
LayoutComponent = EmbeddedQuestionLayout,
|
|
11465
11527
|
mode = "embedded"
|
|
11466
11528
|
}) => {
|
|
11467
|
-
var _a2, _b, _c, _d;
|
|
11529
|
+
var _a2, _b, _c, _d, _e;
|
|
11468
11530
|
const { t: t2 } = useTranslation();
|
|
11469
11531
|
const { state, actions, answerOf } = useQualification();
|
|
11470
11532
|
const selectedMenu = "qualification" in state ? state.qualification.selectedMenu : null;
|
|
@@ -11594,9 +11656,12 @@ const EmbeddedQuestion = ({
|
|
|
11594
11656
|
content: /* @__PURE__ */ jsx(Container, { size: MAX_WIDTH_OF_WHITE_WRAPPER, children: /* @__PURE__ */ jsx(WhiteWrapper, { children: /* @__PURE__ */ jsx(Box, { py: 4, children: /* @__PURE__ */ jsx(
|
|
11595
11657
|
TeamSizeInput,
|
|
11596
11658
|
{
|
|
11659
|
+
label: t2("qualification:embeddedFunnel.teamSize.label", (_e = teamSizeQuestion.content) == null ? void 0 : _e.titleDe),
|
|
11660
|
+
questionId: teamSizeQuestion.id,
|
|
11597
11661
|
value: answerOf("team_size"),
|
|
11598
11662
|
onChange: (value) => actions.answerQuestion("team_size", value),
|
|
11599
|
-
placeholder: t2("qualification:embeddedFunnel.teamSize.placeholder")
|
|
11663
|
+
placeholder: t2("qualification:embeddedFunnel.teamSize.placeholder"),
|
|
11664
|
+
suggestions: teamSizeQuestion.suggestions
|
|
11600
11665
|
}
|
|
11601
11666
|
) }) }) }),
|
|
11602
11667
|
side: selectedMenu && /* @__PURE__ */ jsx(SelectedMenuCard, { ...selectedMenu })
|
|
@@ -11636,9 +11701,12 @@ const EmbeddedQuestion = ({
|
|
|
11636
11701
|
content: /* @__PURE__ */ jsx(Container, { size: MAX_WIDTH_OF_WHITE_WRAPPER, children: /* @__PURE__ */ jsx(WhiteWrapper, { children: /* @__PURE__ */ jsx(Box, { py: 4, children: /* @__PURE__ */ jsx(
|
|
11637
11702
|
TeamSizeInput,
|
|
11638
11703
|
{
|
|
11704
|
+
label: t2("common:questions.min_order_number"),
|
|
11705
|
+
questionId: peopleCountFullServiceQuestion.id,
|
|
11639
11706
|
value: answerOf("min_order_number"),
|
|
11640
11707
|
onChange: (value) => actions.answerQuestion("min_order_number", value),
|
|
11641
|
-
placeholder: t2("qualification:embeddedFunnel.peopleCount.placeholder")
|
|
11708
|
+
placeholder: t2("qualification:embeddedFunnel.peopleCount.placeholder"),
|
|
11709
|
+
suggestions: peopleCountFullServiceQuestion.suggestions
|
|
11642
11710
|
}
|
|
11643
11711
|
) }) }) }),
|
|
11644
11712
|
side: selectedMenu && /* @__PURE__ */ jsx(SelectedMenuCard, { ...selectedMenu })
|
|
@@ -14703,17 +14771,12 @@ function requireReactIs_development() {
|
|
|
14703
14771
|
}
|
|
14704
14772
|
return reactIs_development;
|
|
14705
14773
|
}
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
if (process.env.NODE_ENV === "production") {
|
|
14711
|
-
reactIs$1.exports = requireReactIs_production_min();
|
|
14712
|
-
} else {
|
|
14713
|
-
reactIs$1.exports = requireReactIs_development();
|
|
14714
|
-
}
|
|
14715
|
-
return reactIs$1.exports;
|
|
14774
|
+
if (process.env.NODE_ENV === "production") {
|
|
14775
|
+
reactIs$1.exports = requireReactIs_production_min();
|
|
14776
|
+
} else {
|
|
14777
|
+
reactIs$1.exports = requireReactIs_development();
|
|
14716
14778
|
}
|
|
14779
|
+
var reactIsExports = reactIs$1.exports;
|
|
14717
14780
|
/*
|
|
14718
14781
|
object-assign
|
|
14719
14782
|
(c) Sindre Sorhus
|
|
@@ -14874,7 +14937,7 @@ var hasRequiredFactoryWithTypeCheckers;
|
|
|
14874
14937
|
function requireFactoryWithTypeCheckers() {
|
|
14875
14938
|
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
14876
14939
|
hasRequiredFactoryWithTypeCheckers = 1;
|
|
14877
|
-
var ReactIs =
|
|
14940
|
+
var ReactIs = reactIsExports;
|
|
14878
14941
|
var assign2 = requireObjectAssign();
|
|
14879
14942
|
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
14880
14943
|
var has2 = requireHas();
|
|
@@ -15367,7 +15430,7 @@ function requireFactoryWithThrowingShims() {
|
|
|
15367
15430
|
return factoryWithThrowingShims;
|
|
15368
15431
|
}
|
|
15369
15432
|
if (process.env.NODE_ENV !== "production") {
|
|
15370
|
-
var ReactIs =
|
|
15433
|
+
var ReactIs = reactIsExports;
|
|
15371
15434
|
var throwOnDirectAccess = true;
|
|
15372
15435
|
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
15373
15436
|
} else {
|
|
@@ -15462,7 +15525,6 @@ function formatMuiErrorMessage(code) {
|
|
|
15462
15525
|
}
|
|
15463
15526
|
return "Minified Material-UI error #" + code + "; visit " + url + " for the full message.";
|
|
15464
15527
|
}
|
|
15465
|
-
var reactIsExports = requireReactIs();
|
|
15466
15528
|
var fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
15467
15529
|
function getFunctionName(fn) {
|
|
15468
15530
|
var match2 = "".concat(fn).match(fnNameMatchRegex);
|
|
@@ -18957,7 +19019,7 @@ function makeStyles(stylesOrCreator) {
|
|
|
18957
19019
|
};
|
|
18958
19020
|
return useStyles;
|
|
18959
19021
|
}
|
|
18960
|
-
var reactIs =
|
|
19022
|
+
var reactIs = reactIsExports;
|
|
18961
19023
|
var REACT_STATICS = {
|
|
18962
19024
|
childContextTypes: true,
|
|
18963
19025
|
contextType: true,
|