@heycater/qualification-funnel 1.19.2 → 1.19.4
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 +90 -90
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +14 -4
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7553,8 +7553,13 @@ function handleServiceTypeChange(state, answer) {
|
|
|
7553
7553
|
const newStepOrder = getStepOrderForServiceType(serviceType);
|
|
7554
7554
|
const existingSteps = state.qualification.steps;
|
|
7555
7555
|
const newSteps = newStepOrder.map((stepId) => {
|
|
7556
|
-
|
|
7557
|
-
|
|
7556
|
+
if (stepId === "city") {
|
|
7557
|
+
const existingCityStep = existingSteps.find((s3) => s3.id === "city");
|
|
7558
|
+
if (existingCityStep == null ? void 0 : existingCityStep.disabled) {
|
|
7559
|
+
return { id: stepId, disabled: true };
|
|
7560
|
+
}
|
|
7561
|
+
}
|
|
7562
|
+
return { id: stepId };
|
|
7558
7563
|
});
|
|
7559
7564
|
return {
|
|
7560
7565
|
...state,
|
|
@@ -8004,6 +8009,7 @@ function setQuestion(state, stepId) {
|
|
|
8004
8009
|
return state;
|
|
8005
8010
|
}
|
|
8006
8011
|
function toNextStep(state, onFunnelFinished) {
|
|
8012
|
+
var _a2;
|
|
8007
8013
|
if (state.status !== QUALIFICATION_STATUS.answering) {
|
|
8008
8014
|
return state;
|
|
8009
8015
|
}
|
|
@@ -8014,8 +8020,12 @@ function toNextStep(state, onFunnelFinished) {
|
|
|
8014
8020
|
const stepIndex = state.qualification.steps.findIndex(
|
|
8015
8021
|
(_step) => _step.id === step2.id
|
|
8016
8022
|
);
|
|
8017
|
-
|
|
8018
|
-
|
|
8023
|
+
let nextStepIndex = stepIndex + 1;
|
|
8024
|
+
while (nextStepIndex < state.qualification.steps.length && ((_a2 = state.qualification.steps[nextStepIndex]) == null ? void 0 : _a2.disabled)) {
|
|
8025
|
+
nextStepIndex++;
|
|
8026
|
+
}
|
|
8027
|
+
const nextStep = state.qualification.steps[nextStepIndex];
|
|
8028
|
+
if (!nextStep) {
|
|
8019
8029
|
const funnelAnsweredState = {
|
|
8020
8030
|
...state,
|
|
8021
8031
|
status: "answered",
|