cja-phoenix 1.2.54 → 1.2.56
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.json +1 -1
- package/dist/runtime/components/Modal.vue +6 -1
- package/dist/runtime/components/StickyContainer.vue +2 -1
- package/dist/runtime/composables/useValidateForm.d.ts +1 -1
- package/dist/runtime/composables/useValidateForm.js +6 -8
- package/package.json +1 -1
- package/dist/runtime/utils/getAbTestVersion.d.ts +0 -10
- package/dist/runtime/utils/getAbTestVersion.js +0 -46
package/dist/module.json
CHANGED
|
@@ -73,7 +73,12 @@ const toggleModal = () => {
|
|
|
73
73
|
};
|
|
74
74
|
watch(active, () => {
|
|
75
75
|
nextTick(() => {
|
|
76
|
-
|
|
76
|
+
if (!active.value) {
|
|
77
|
+
mobileFull.value = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const containerHeight = modalContainer.value?.clientHeight ?? 0;
|
|
81
|
+
mobileFull.value = props.forceMobileFull || containerHeight >= window.innerHeight * 0.75;
|
|
77
82
|
});
|
|
78
83
|
});
|
|
79
84
|
defineExpose({ active, openModal, closeModal, toggleModal });
|
|
@@ -32,6 +32,7 @@ onMounted(() => {
|
|
|
32
32
|
() => [top, headerHeight.value],
|
|
33
33
|
() => {
|
|
34
34
|
if (observer) observer.disconnect();
|
|
35
|
+
const stickyOffset = top ?? headerHeight.value;
|
|
35
36
|
observer = new IntersectionObserver(
|
|
36
37
|
(entries) => {
|
|
37
38
|
const entry = entries[0];
|
|
@@ -40,7 +41,7 @@ onMounted(() => {
|
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
{
|
|
43
|
-
rootMargin: `0px 0px -${window.innerHeight -
|
|
44
|
+
rootMargin: `0px 0px -${window.innerHeight - stickyOffset}px 0px`
|
|
44
45
|
}
|
|
45
46
|
);
|
|
46
47
|
observer.observe(stickyContainer.value);
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { nextTick, ref } from "vue";
|
|
2
2
|
export const useValidateForm = (options) => {
|
|
3
3
|
const validForm = ref(false);
|
|
4
4
|
const submitLock = ref(false);
|
|
5
5
|
const validate = async () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
await field.value.validate();
|
|
11
|
-
}
|
|
6
|
+
await nextTick();
|
|
7
|
+
const fields = options.fields?.filter((f) => f.value) ?? [];
|
|
8
|
+
for (const field of fields) {
|
|
9
|
+
await field.value.validate();
|
|
12
10
|
}
|
|
13
|
-
validForm.value = fields
|
|
11
|
+
validForm.value = fields.every((f) => f.value.meta.valid);
|
|
14
12
|
};
|
|
15
13
|
const submit = async () => {
|
|
16
14
|
await validate();
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StepType } from "../types/index.js";
|
|
2
|
-
export declare const getAbTestVersion: (journeyId: string | undefined, config: {
|
|
3
|
-
stepType: StepType;
|
|
4
|
-
enabled: boolean;
|
|
5
|
-
experiment: string;
|
|
6
|
-
condition?: {
|
|
7
|
-
type: "utmSource";
|
|
8
|
-
utmSource: string;
|
|
9
|
-
};
|
|
10
|
-
}) => Promise<any>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useRuntimeConfig,
|
|
3
|
-
useCookie,
|
|
4
|
-
updateForm,
|
|
5
|
-
useRequestFetch
|
|
6
|
-
} from "#imports";
|
|
7
|
-
export const getAbTestVersion = async (journeyId, config) => {
|
|
8
|
-
const { apiURL } = useRuntimeConfig().public;
|
|
9
|
-
const requestFetch = useRequestFetch();
|
|
10
|
-
const abTestCookie = useCookie(`abTestVersion_${config.experiment}`);
|
|
11
|
-
const fetchAbTestVersion = async () => requestFetch("/core/apis/data/abTestServiceLookup", {
|
|
12
|
-
baseURL: apiURL,
|
|
13
|
-
method: "post",
|
|
14
|
-
body: {
|
|
15
|
-
experimentName: config.experiment,
|
|
16
|
-
journeyId
|
|
17
|
-
}
|
|
18
|
-
}).then(async (d) => {
|
|
19
|
-
const abTestVersion = d.version || "control";
|
|
20
|
-
abTestCookie.value = abTestVersion;
|
|
21
|
-
await updateForm({
|
|
22
|
-
journeyId,
|
|
23
|
-
stepName: "AB Test Version",
|
|
24
|
-
stepType: config.stepType,
|
|
25
|
-
payload: {
|
|
26
|
-
abTestName: config.experiment,
|
|
27
|
-
abTestVersion
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return abTestVersion;
|
|
31
|
-
});
|
|
32
|
-
if (!abTestCookie.value && journeyId && config.enabled) {
|
|
33
|
-
if (config.condition) {
|
|
34
|
-
switch (config.condition.type) {
|
|
35
|
-
case "utmSource":
|
|
36
|
-
const url = new URL(location.href);
|
|
37
|
-
if (url.searchParams.get("utm_source") == config.condition.utmSource) {
|
|
38
|
-
return fetchAbTestVersion();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
return fetchAbTestVersion();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return abTestCookie.value || "control";
|
|
46
|
-
};
|