@kiva/kv-components 8.23.3 → 8.25.0
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as N, ref as a, computed as H, watchEffect as P, onMounted as Q, onUnmounted as B, openBlock as d, createElementBlock as s, createVNode as D, createCommentVNode as I } from "vue";
|
|
2
|
+
import K from "./KvLoadingSpinner.js";
|
|
3
|
+
const M = ["data-testid", "aria-busy"], T = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "tw-w-full tw-flex tw-content-center tw-justify-center",
|
|
6
6
|
style: { "min-height": "200px" }
|
|
7
|
-
},
|
|
7
|
+
}, U = ["src", "height", "title"], S = "https://kiva.tfaforms.net", z = /* @__PURE__ */ N({
|
|
8
8
|
__name: "KvFormAssemblyForm",
|
|
9
9
|
props: {
|
|
10
10
|
/**
|
|
@@ -33,64 +33,65 @@ const P = ["data-testid", "aria-busy"], Q = {
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
emits: ["fa-form-loaded", "fa-form-submitted", "fa-form-closed"],
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
36
|
+
setup(c, { emit: L }) {
|
|
37
|
+
const V = (t) => Array.isArray(t) && typeof t[0] == "string" && typeof t[1] == "string", e = c, f = L, n = a(!0), m = a(null), u = a(null), R = H(() => e.formAssemblyId ? `kv-form-assembly-form-${e.formAssemblyId}` : "kv-form-assembly-form"), l = a(""), y = a(500), x = () => {
|
|
38
38
|
const r = new URLSearchParams((e.additionalQueryParams || "").replace(/^\?/, "")).toString();
|
|
39
39
|
return r ? `?${r}` : "";
|
|
40
|
-
},
|
|
41
|
-
typeof window > "u" || !(e != null && e.formAssemblyId) || (l.value = `${
|
|
40
|
+
}, $ = () => {
|
|
41
|
+
typeof window > "u" || !(e != null && e.formAssemblyId) || (l.value = `${S}/${e.formAssemblyId}${x()}`);
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
P(() => {
|
|
44
|
+
m.value && $();
|
|
45
45
|
});
|
|
46
46
|
const _ = () => {
|
|
47
47
|
n.value && (n.value = !1, f("fa-form-loaded"));
|
|
48
48
|
}, v = (t) => {
|
|
49
|
-
var
|
|
50
|
-
if (t.origin !==
|
|
51
|
-
const r = (
|
|
49
|
+
var p, w, b, h, A, k;
|
|
50
|
+
if (t.origin !== S) return;
|
|
51
|
+
const r = (p = u.value) == null ? void 0 : p.contentWindow;
|
|
52
52
|
if (r && t.source !== r) return;
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
53
|
+
const o = (w = t == null ? void 0 : t.data) == null ? void 0 : w.type;
|
|
54
|
+
if (o === "fa_frame_loaded" && _(), o === "fa_frame_data" || o === "fa_form_page_change" || o === "fa_form_submitted") {
|
|
55
55
|
const i = ((b = t == null ? void 0 : t.data) == null ? void 0 : b.frameHeight) ?? 300;
|
|
56
56
|
y.value = i + 30;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
const i = ((h = t == null ? void 0 : t.data) == null ? void 0 : h.analytics) ?? null;
|
|
58
|
+
if (o === "fa_form_closed" && f("fa-form-closed"), o === "fa_form_submitted") {
|
|
59
|
+
const i = ((h = t == null ? void 0 : t.data) == null ? void 0 : h.analytics) ?? null, F = (A = t == null ? void 0 : t.data) == null ? void 0 : A.isValid, C = ((k = t == null ? void 0 : t.data) == null ? void 0 : k.selectedValues) ?? null, E = typeof F == "boolean" ? F : V(i);
|
|
60
60
|
f("fa-form-submitted", {
|
|
61
61
|
analytics: i,
|
|
62
|
-
|
|
62
|
+
selectedValues: C,
|
|
63
|
+
valid: E
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
|
-
return
|
|
67
|
+
return Q(() => {
|
|
67
68
|
window.addEventListener("message", v);
|
|
68
|
-
}),
|
|
69
|
+
}), B(() => {
|
|
69
70
|
window.removeEventListener("message", v);
|
|
70
|
-
}), (t, r) => (
|
|
71
|
+
}), (t, r) => (d(), s("div", {
|
|
71
72
|
ref_key: "formContainerRef",
|
|
72
|
-
ref:
|
|
73
|
+
ref: m,
|
|
73
74
|
class: "kv-form-assembly-form tw-w-full",
|
|
74
|
-
"data-testid":
|
|
75
|
+
"data-testid": R.value,
|
|
75
76
|
"aria-busy": n.value
|
|
76
77
|
}, [
|
|
77
|
-
n.value ? (
|
|
78
|
-
|
|
79
|
-
])) :
|
|
80
|
-
l.value ? (
|
|
78
|
+
n.value ? (d(), s("div", T, [
|
|
79
|
+
D(K, { class: "tw-self-center" })
|
|
80
|
+
])) : I("", !0),
|
|
81
|
+
l.value ? (d(), s("iframe", {
|
|
81
82
|
key: 1,
|
|
82
83
|
ref_key: "iFrameRef",
|
|
83
84
|
ref: u,
|
|
84
85
|
class: "tw-mx-auto tw-w-full",
|
|
85
86
|
src: l.value,
|
|
86
87
|
height: y.value,
|
|
87
|
-
title:
|
|
88
|
+
title: c.title,
|
|
88
89
|
frameborder: "0",
|
|
89
90
|
onLoad: _
|
|
90
|
-
}, null, 40,
|
|
91
|
-
], 8,
|
|
91
|
+
}, null, 40, U)) : I("", !0)
|
|
92
|
+
], 8, M));
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
+
z as default
|
|
96
97
|
};
|
|
@@ -15,6 +15,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
15
15
|
"fa-form-loaded": () => any;
|
|
16
16
|
"fa-form-submitted": (payload: {
|
|
17
17
|
analytics: unknown[] | null;
|
|
18
|
+
selectedValues: unknown[] | null;
|
|
18
19
|
valid: boolean;
|
|
19
20
|
}) => any;
|
|
20
21
|
"fa-form-closed": () => any;
|
|
@@ -35,6 +36,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
35
36
|
"onFa-form-loaded"?: () => any;
|
|
36
37
|
"onFa-form-submitted"?: (payload: {
|
|
37
38
|
analytics: unknown[] | null;
|
|
39
|
+
selectedValues: unknown[] | null;
|
|
38
40
|
valid: boolean;
|
|
39
41
|
}) => any;
|
|
40
42
|
"onFa-form-closed"?: () => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.25.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"fuse.js": "^7.1.0"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "628747b81d4255846b3205d534b1aec57c1a8064"
|
|
117
117
|
}
|