cja-phoenix 1.2.39 → 1.2.41
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/module.d.mts +6 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +29 -16
- package/dist/runtime/assets/iconia/fonts/CGG-icomoon.svg +94 -0
- package/dist/runtime/assets/iconia/fonts/CGG-icomoon.ttf +0 -0
- package/dist/runtime/assets/iconia/fonts/CGG-icomoon.woff +0 -0
- package/dist/runtime/assets/iconia/selection.json +1 -0
- package/dist/runtime/assets/iconia/style.css +281 -0
- package/dist/runtime/assets/scss/main.scss +6 -0
- package/dist/runtime/assets/scss/mixins/_funnel.scss +15 -0
- package/dist/runtime/assets/scss/mixins/_index.scss +46 -0
- package/dist/runtime/assets/scss/mixins/_media-queries.scss +109 -0
- package/dist/runtime/assets/scss/mixins/_results.scss +235 -0
- package/dist/runtime/assets/scss/tippy.scss +31 -0
- package/dist/runtime/assets/scss/variables/_breakpoints.scss +18 -0
- package/dist/runtime/assets/scss/variables/_colors.scss +100 -0
- package/dist/runtime/assets/scss/variables/_forms.scss +121 -0
- package/dist/runtime/assets/scss/variables/_grid.scss +12 -0
- package/dist/runtime/assets/scss/variables/_index.scss +6 -0
- package/dist/runtime/assets/scss/variables/_shadows.scss +7 -0
- package/dist/runtime/assets/scss/variables/_z-index.scss +6 -0
- package/dist/runtime/components/CjaButton.d.vue.ts +33 -0
- package/dist/runtime/components/CjaButton.vue +437 -0
- package/dist/runtime/components/CjaButton.vue.d.ts +33 -0
- package/dist/runtime/components/CollapseContainer.d.vue.ts +35 -0
- package/dist/runtime/components/CollapseContainer.vue +112 -0
- package/dist/runtime/components/CollapseContainer.vue.d.ts +35 -0
- package/dist/runtime/components/ContentTabs.d.vue.ts +23 -0
- package/dist/runtime/components/ContentTabs.vue +103 -0
- package/dist/runtime/components/ContentTabs.vue.d.ts +23 -0
- package/dist/runtime/components/Drawer.d.vue.ts +52 -0
- package/dist/runtime/components/Drawer.vue +169 -0
- package/dist/runtime/components/Drawer.vue.d.ts +52 -0
- package/dist/runtime/components/FixedContainer.d.vue.ts +37 -0
- package/dist/runtime/components/FixedContainer.vue +95 -0
- package/dist/runtime/components/FixedContainer.vue.d.ts +37 -0
- package/dist/runtime/components/GridContainer.d.vue.ts +13 -0
- package/dist/runtime/components/GridContainer.vue +37 -0
- package/dist/runtime/components/GridContainer.vue.d.ts +13 -0
- package/dist/runtime/components/GridItem.d.vue.ts +29 -0
- package/dist/runtime/components/GridItem.vue +93 -0
- package/dist/runtime/components/GridItem.vue.d.ts +29 -0
- package/dist/runtime/components/InfoMessage.d.vue.ts +28 -0
- package/dist/runtime/components/InfoMessage.vue +141 -0
- package/dist/runtime/components/InfoMessage.vue.d.ts +28 -0
- package/dist/runtime/components/LoadingSpinner.d.vue.ts +10 -0
- package/dist/runtime/components/LoadingSpinner.vue +39 -0
- package/dist/runtime/components/LoadingSpinner.vue.d.ts +10 -0
- package/dist/runtime/components/Modal.d.vue.ts +39 -0
- package/dist/runtime/components/Modal.vue +195 -0
- package/dist/runtime/components/Modal.vue.d.ts +39 -0
- package/dist/runtime/components/Scaffold.d.vue.ts +13 -0
- package/dist/runtime/components/Scaffold.vue +3 -0
- package/dist/runtime/components/Scaffold.vue.d.ts +13 -0
- package/dist/runtime/components/StickyContainer.d.vue.ts +21 -0
- package/dist/runtime/components/StickyContainer.vue +57 -0
- package/dist/runtime/components/StickyContainer.vue.d.ts +21 -0
- package/dist/runtime/components/form/CheckboxInput.d.vue.ts +42 -0
- package/dist/runtime/components/form/CheckboxInput.vue +163 -0
- package/dist/runtime/components/form/CheckboxInput.vue.d.ts +42 -0
- package/dist/runtime/components/form/CheckboxInputList.d.vue.ts +37 -0
- package/dist/runtime/components/form/CheckboxInputList.vue +84 -0
- package/dist/runtime/components/form/CheckboxInputList.vue.d.ts +37 -0
- package/dist/runtime/components/form/CurrencyInput.d.vue.ts +37 -0
- package/dist/runtime/components/form/CurrencyInput.vue +134 -0
- package/dist/runtime/components/form/CurrencyInput.vue.d.ts +37 -0
- package/dist/runtime/components/form/DateInput.d.vue.ts +40 -0
- package/dist/runtime/components/form/DateInput.vue +325 -0
- package/dist/runtime/components/form/DateInput.vue.d.ts +40 -0
- package/dist/runtime/components/form/FileInput.d.vue.ts +46 -0
- package/dist/runtime/components/form/FileInput.vue +202 -0
- package/dist/runtime/components/form/FileInput.vue.d.ts +46 -0
- package/dist/runtime/components/form/NumberInput.d.vue.ts +41 -0
- package/dist/runtime/components/form/NumberInput.vue +162 -0
- package/dist/runtime/components/form/NumberInput.vue.d.ts +41 -0
- package/dist/runtime/components/form/PhoneInput.d.vue.ts +44 -0
- package/dist/runtime/components/form/PhoneInput.vue +143 -0
- package/dist/runtime/components/form/PhoneInput.vue.d.ts +44 -0
- package/dist/runtime/components/form/RadioInput.d.vue.ts +42 -0
- package/dist/runtime/components/form/RadioInput.vue +181 -0
- package/dist/runtime/components/form/RadioInput.vue.d.ts +42 -0
- package/dist/runtime/components/form/RadioInputList.d.vue.ts +57 -0
- package/dist/runtime/components/form/RadioInputList.vue +130 -0
- package/dist/runtime/components/form/RadioInputList.vue.d.ts +57 -0
- package/dist/runtime/components/form/SelectInput.d.vue.ts +46 -0
- package/dist/runtime/components/form/SelectInput.vue +362 -0
- package/dist/runtime/components/form/SelectInput.vue.d.ts +46 -0
- package/dist/runtime/components/form/SelectionTiles.d.vue.ts +44 -0
- package/dist/runtime/components/form/SelectionTiles.vue +329 -0
- package/dist/runtime/components/form/SelectionTiles.vue.d.ts +44 -0
- package/dist/runtime/components/form/SliderInput.d.vue.ts +51 -0
- package/dist/runtime/components/form/SliderInput.vue +175 -0
- package/dist/runtime/components/form/SliderInput.vue.d.ts +51 -0
- package/dist/runtime/components/form/TextInput.d.vue.ts +56 -0
- package/dist/runtime/components/form/TextInput.vue +227 -0
- package/dist/runtime/components/form/TextInput.vue.d.ts +56 -0
- package/dist/runtime/components/form/TextareaInput.d.vue.ts +37 -0
- package/dist/runtime/components/form/TextareaInput.vue +76 -0
- package/dist/runtime/components/form/TextareaInput.vue.d.ts +37 -0
- package/dist/runtime/components/form/TileCheckboxInput.d.vue.ts +40 -0
- package/dist/runtime/components/form/TileCheckboxInput.vue +108 -0
- package/dist/runtime/components/form/TileCheckboxInput.vue.d.ts +40 -0
- package/dist/runtime/components/form/ToggleInput.d.vue.ts +43 -0
- package/dist/runtime/components/form/ToggleInput.vue +119 -0
- package/dist/runtime/components/form/ToggleInput.vue.d.ts +43 -0
- package/dist/runtime/components/form/structure/Container.d.vue.ts +16 -0
- package/dist/runtime/components/form/structure/Container.vue +31 -0
- package/dist/runtime/components/form/structure/Container.vue.d.ts +16 -0
- package/dist/runtime/components/form/structure/Description.d.vue.ts +9 -0
- package/dist/runtime/components/form/structure/Description.vue +26 -0
- package/dist/runtime/components/form/structure/Description.vue.d.ts +9 -0
- package/dist/runtime/components/form/structure/Error.d.vue.ts +9 -0
- package/dist/runtime/components/form/structure/Error.vue +23 -0
- package/dist/runtime/components/form/structure/Error.vue.d.ts +9 -0
- package/dist/runtime/components/form/structure/Title.d.vue.ts +12 -0
- package/dist/runtime/components/form/structure/Title.vue +43 -0
- package/dist/runtime/components/form/structure/Title.vue.d.ts +12 -0
- package/dist/runtime/components/funnel/Header.d.vue.ts +18 -0
- package/dist/runtime/components/funnel/Header.vue +62 -0
- package/dist/runtime/components/funnel/Header.vue.d.ts +18 -0
- package/dist/runtime/composables/useCjaGtm.d.ts +19 -0
- package/dist/runtime/composables/useCjaGtm.js +164 -0
- package/dist/runtime/composables/useFunnelConfig.d.ts +11 -0
- package/dist/runtime/composables/useFunnelConfig.js +51 -0
- package/dist/runtime/composables/useFunnelSummary.d.ts +14 -0
- package/dist/runtime/composables/useFunnelSummary.js +16 -0
- package/dist/runtime/composables/useHeaderHeight.d.ts +3 -0
- package/dist/runtime/composables/useHeaderHeight.js +24 -0
- package/dist/runtime/composables/useJourneyConfig.d.ts +11 -0
- package/dist/runtime/composables/useJourneyConfig.js +13 -0
- package/dist/runtime/composables/useValidateForm.d.ts +11 -0
- package/dist/runtime/composables/useValidateForm.js +33 -0
- package/dist/runtime/data/dialCodes.d.ts +7 -0
- package/dist/runtime/data/dialCodes.js +1466 -0
- package/dist/runtime/data/phoneDigits.d.ts +2 -0
- package/dist/runtime/data/phoneDigits.js +231 -0
- package/dist/runtime/plugins/tippy.d.ts +4 -0
- package/dist/runtime/plugins/tippy.js +12 -0
- package/dist/runtime/plugins/v-calendar.d.ts +3 -0
- package/dist/runtime/plugins/v-calendar.js +6 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/types/Form.d.ts +34 -0
- package/dist/runtime/types/Form.js +20 -0
- package/dist/runtime/types/Grid.d.ts +4 -0
- package/dist/runtime/types/Grid.js +0 -0
- package/dist/runtime/types/Icon.d.ts +2 -0
- package/dist/runtime/types/Icon.js +85 -0
- package/dist/runtime/types/JourneyConfig.d.ts +9 -0
- package/dist/runtime/types/JourneyConfig.js +0 -0
- package/dist/runtime/types/index.d.ts +4 -0
- package/dist/runtime/types/index.js +4 -0
- package/dist/runtime/utils/applyProductData.d.ts +10 -0
- package/dist/runtime/utils/applyProductData.js +22 -0
- package/dist/runtime/utils/convertDate.d.ts +5 -0
- package/dist/runtime/utils/convertDate.js +17 -0
- package/dist/runtime/utils/findScrollAncestor.d.ts +1 -0
- package/dist/runtime/utils/findScrollAncestor.js +14 -0
- package/dist/runtime/utils/formValidations.d.ts +78 -0
- package/dist/runtime/utils/formValidations.js +180 -0
- package/dist/runtime/utils/formatValue.d.ts +4 -0
- package/dist/runtime/utils/formatValue.js +20 -0
- package/dist/runtime/utils/getAbTestVersion.d.ts +9 -0
- package/dist/runtime/utils/getAbTestVersion.js +48 -0
- package/dist/runtime/utils/getCalendarUrl.d.ts +8 -0
- package/dist/runtime/utils/getCalendarUrl.js +24 -0
- package/dist/runtime/utils/getFromUrl.d.ts +2 -0
- package/dist/runtime/utils/getFromUrl.js +25 -0
- package/dist/runtime/utils/getStoryblokUrl.d.ts +71 -0
- package/dist/runtime/utils/getStoryblokUrl.js +35 -0
- package/dist/runtime/utils/jsonReviver.d.ts +1 -0
- package/dist/runtime/utils/jsonReviver.js +18 -0
- package/dist/runtime/utils/mediaBreakpoints.d.ts +28 -0
- package/dist/runtime/utils/mediaBreakpoints.js +28 -0
- package/dist/runtime/utils/toggleScroll.d.ts +1 -0
- package/dist/runtime/utils/toggleScroll.js +6 -0
- package/dist/runtime/utils/updateForm.d.ts +11 -0
- package/dist/runtime/utils/updateForm.js +74 -0
- package/dist/runtime/utils/updateMarketingConsent.d.ts +4 -0
- package/dist/runtime/utils/updateMarketingConsent.js +13 -0
- package/dist/runtime/utils/uploadFile.d.ts +8 -0
- package/dist/runtime/utils/uploadFile.js +13 -0
- package/dist/types.d.mts +6 -10
- package/package.json +9 -8
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
import type { StepData } from '../types/JourneyConfig.js';
|
|
3
|
+
export declare const useFunnelConfig: (structure: ComputedRef<Map<string, string[]>>) => {
|
|
4
|
+
steps: ComputedRef<string[]>;
|
|
5
|
+
structure: ComputedRef<Map<string, string[]>>;
|
|
6
|
+
currentStep: ComputedRef<StepData>;
|
|
7
|
+
totalSteps: ComputedRef<number>;
|
|
8
|
+
getStep: (step: string | number | undefined) => StepData | undefined;
|
|
9
|
+
goNextStep: () => Promise<void>;
|
|
10
|
+
goPrevStep: () => Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { navigateTo, useRoute, useRouter } from "#app";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
export const useFunnelConfig = (structure) => {
|
|
4
|
+
const route = useRouter().currentRoute;
|
|
5
|
+
const steps = computed(() => Array.from(structure.value.keys()));
|
|
6
|
+
const currentStep = computed(() => getStep(route.value.path.split("/").reverse()[0]) || currentStep.value);
|
|
7
|
+
const totalSteps = computed(() => structure.value.size);
|
|
8
|
+
const getStep = (step) => {
|
|
9
|
+
if (step === void 0) return;
|
|
10
|
+
const stepName = typeof step == "string" ? step : steps.value[step];
|
|
11
|
+
const stepFields = stepName && structure.value.get(stepName);
|
|
12
|
+
return stepName && stepFields ? {
|
|
13
|
+
index: steps.value.indexOf(stepName),
|
|
14
|
+
number: steps.value.indexOf(stepName) + 1,
|
|
15
|
+
name: stepName,
|
|
16
|
+
path: route.value.path.replace(/[^/]+(?=\/$|$)/g, stepName),
|
|
17
|
+
fields: stepFields
|
|
18
|
+
} : void 0;
|
|
19
|
+
};
|
|
20
|
+
const goNextStep = async () => {
|
|
21
|
+
if (currentStep.value) {
|
|
22
|
+
const nextStep = getStep(currentStep.value.index + 1);
|
|
23
|
+
if (nextStep) {
|
|
24
|
+
await navigateTo({
|
|
25
|
+
path: nextStep.path,
|
|
26
|
+
query: useRoute().query
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const goPrevStep = async () => {
|
|
32
|
+
if (currentStep.value) {
|
|
33
|
+
const nextStep = getStep(currentStep.value.index - 1);
|
|
34
|
+
if (nextStep) {
|
|
35
|
+
await navigateTo({
|
|
36
|
+
path: nextStep.path,
|
|
37
|
+
query: useRoute().query
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
steps,
|
|
44
|
+
structure,
|
|
45
|
+
currentStep,
|
|
46
|
+
totalSteps,
|
|
47
|
+
getStep,
|
|
48
|
+
goNextStep,
|
|
49
|
+
goPrevStep
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SelectOption } from "../types/Form.js";
|
|
2
|
+
import type { StepData } from "../types/JourneyConfig.js";
|
|
3
|
+
import type { ComputedRef } from "vue";
|
|
4
|
+
export declare const useFunnelSummary: (options: {
|
|
5
|
+
currentStep: ComputedRef<StepData>;
|
|
6
|
+
structure: ComputedRef<Map<string, string[]>>;
|
|
7
|
+
store: any;
|
|
8
|
+
}) => {
|
|
9
|
+
stepIncludes: (field: string) => boolean;
|
|
10
|
+
displayValue: (value: any, options?: SelectOption[]) => any;
|
|
11
|
+
displayLabel: (value: any, label: string) => string;
|
|
12
|
+
displayCurrency: (value: number | undefined) => string;
|
|
13
|
+
displayPercent: (value: number | undefined, maxDigits?: number) => string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { formatCurrency, formatPercent } from "../utils/formatValue.js";
|
|
2
|
+
export const useFunnelSummary = (options) => {
|
|
3
|
+
const { currentStep, structure, store } = options;
|
|
4
|
+
const stepIncludes = (field) => (currentStep.value.fields.includes(field) || store[field] !== void 0) && Array.from(structure.value.values()).flat().includes(field);
|
|
5
|
+
const displayValue = (value, options2) => options2 ? options2.find((o) => o.value == value)?.label ?? "-" : value ?? "-";
|
|
6
|
+
const displayLabel = (value, label) => value !== void 0 ? label : "-";
|
|
7
|
+
const displayCurrency = (value) => value ? formatCurrency(value) : "-";
|
|
8
|
+
const displayPercent = (value, maxDigits = 2) => value ? formatPercent(value, maxDigits) : "-";
|
|
9
|
+
return {
|
|
10
|
+
stepIncludes,
|
|
11
|
+
displayValue,
|
|
12
|
+
displayLabel,
|
|
13
|
+
displayCurrency,
|
|
14
|
+
displayPercent
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { onMounted, onUnmounted, ref } from "vue";
|
|
2
|
+
export const useHeaderHeight = () => {
|
|
3
|
+
const headerHeight = ref(0);
|
|
4
|
+
let resizeObserver = null;
|
|
5
|
+
onMounted(() => {
|
|
6
|
+
const header = document.querySelector("#page-header");
|
|
7
|
+
if (header) {
|
|
8
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
9
|
+
entries.forEach((e) => {
|
|
10
|
+
headerHeight.value = e.contentRect.height;
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
resizeObserver.observe(header);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
onUnmounted(() => {
|
|
17
|
+
if (resizeObserver != null) {
|
|
18
|
+
resizeObserver.disconnect();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
headerHeight
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JourneyLocation } from '../types/JourneyConfig.js';
|
|
2
|
+
export declare const useJourneyConfig: (location: JourneyLocation, options: {
|
|
3
|
+
locations: JourneyLocation[];
|
|
4
|
+
initialStep: string;
|
|
5
|
+
lastUrls: Map<JourneyLocation, string>;
|
|
6
|
+
}) => {
|
|
7
|
+
locations: JourneyLocation[];
|
|
8
|
+
initialStep: string;
|
|
9
|
+
lastUrls: Map<JourneyLocation, string>;
|
|
10
|
+
previousUrl: string | undefined;
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const useJourneyConfig = (location, options) => {
|
|
2
|
+
const {
|
|
3
|
+
locations,
|
|
4
|
+
initialStep,
|
|
5
|
+
lastUrls
|
|
6
|
+
} = options;
|
|
7
|
+
return {
|
|
8
|
+
locations,
|
|
9
|
+
initialStep,
|
|
10
|
+
lastUrls,
|
|
11
|
+
previousUrl: lastUrls.get(locations[locations.indexOf(location) - 1])
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export declare const useValidateForm: (options: {
|
|
3
|
+
fields?: Ref[];
|
|
4
|
+
onSubmit?: () => void | Promise<void>;
|
|
5
|
+
onError?: () => void;
|
|
6
|
+
}) => {
|
|
7
|
+
validForm: Ref<boolean, boolean>;
|
|
8
|
+
validate: () => Promise<void>;
|
|
9
|
+
submit: () => Promise<void>;
|
|
10
|
+
submitLock: Ref<boolean, boolean>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export const useValidateForm = (options) => {
|
|
3
|
+
const validForm = ref(false);
|
|
4
|
+
const submitLock = ref(false);
|
|
5
|
+
const validate = async () => {
|
|
6
|
+
const fields = options.fields?.filter((f) => f.value);
|
|
7
|
+
if (fields) {
|
|
8
|
+
for (let i = 0; i < fields.length; i++) {
|
|
9
|
+
const field = fields[i];
|
|
10
|
+
await field.value.validate();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
validForm.value = fields?.every((f) => f.value.meta.valid) ?? true;
|
|
14
|
+
};
|
|
15
|
+
const submit = async () => {
|
|
16
|
+
await validate();
|
|
17
|
+
if (validForm.value) {
|
|
18
|
+
if (!submitLock.value) {
|
|
19
|
+
submitLock.value = true;
|
|
20
|
+
await options.onSubmit?.();
|
|
21
|
+
submitLock.value = false;
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
options.onError?.();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
validForm,
|
|
29
|
+
validate,
|
|
30
|
+
submit,
|
|
31
|
+
submitLock
|
|
32
|
+
};
|
|
33
|
+
};
|