@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 R, ref as o, computed as x, watchEffect as $, onMounted as C, onUnmounted as E, openBlock as s, createElementBlock as d, createVNode as N, createCommentVNode as A } from "vue";
2
- import H from "./KvLoadingSpinner.js";
3
- const P = ["data-testid", "aria-busy"], Q = {
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
- }, V = ["src", "height", "title"], k = "https://kiva.tfaforms.net", K = /* @__PURE__ */ R({
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(m, { emit: F }) {
37
- const I = (t) => Array.isArray(t) && typeof t[0] == "string" && typeof t[1] == "string", e = m, f = F, n = o(!0), c = o(null), u = o(null), S = x(() => e.formAssemblyId ? `kv-form-assembly-form-${e.formAssemblyId}` : "kv-form-assembly-form"), l = o(""), y = o(500), L = () => {
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
- }, g = () => {
41
- typeof window > "u" || !(e != null && e.formAssemblyId) || (l.value = `${k}/${e.formAssemblyId}${L()}`);
40
+ }, $ = () => {
41
+ typeof window > "u" || !(e != null && e.formAssemblyId) || (l.value = `${S}/${e.formAssemblyId}${x()}`);
42
42
  };
43
- $(() => {
44
- c.value && g();
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 w, p, b, h;
50
- if (t.origin !== k) return;
51
- const r = (w = u.value) == null ? void 0 : w.contentWindow;
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 a = (p = t == null ? void 0 : t.data) == null ? void 0 : p.type;
54
- if (a === "fa_frame_loaded" && _(), a === "fa_frame_data" || a === "fa_form_page_change" || a === "fa_form_submitted") {
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 (a === "fa_form_closed" && f("fa-form-closed"), a === "fa_form_submitted") {
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
- valid: I(i)
62
+ selectedValues: C,
63
+ valid: E
63
64
  });
64
65
  }
65
66
  };
66
- return C(() => {
67
+ return Q(() => {
67
68
  window.addEventListener("message", v);
68
- }), E(() => {
69
+ }), B(() => {
69
70
  window.removeEventListener("message", v);
70
- }), (t, r) => (s(), d("div", {
71
+ }), (t, r) => (d(), s("div", {
71
72
  ref_key: "formContainerRef",
72
- ref: c,
73
+ ref: m,
73
74
  class: "kv-form-assembly-form tw-w-full",
74
- "data-testid": S.value,
75
+ "data-testid": R.value,
75
76
  "aria-busy": n.value
76
77
  }, [
77
- n.value ? (s(), d("div", Q, [
78
- N(H, { class: "tw-self-center" })
79
- ])) : A("", !0),
80
- l.value ? (s(), d("iframe", {
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: m.title,
88
+ title: c.title,
88
89
  frameborder: "0",
89
90
  onLoad: _
90
- }, null, 40, V)) : A("", !0)
91
- ], 8, P));
91
+ }, null, 40, U)) : I("", !0)
92
+ ], 8, M));
92
93
  }
93
94
  });
94
95
  export {
95
- K as default
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.23.3",
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": "9878ecbc5e791dfc2f33c71e027f4ae159073790"
116
+ "gitHead": "628747b81d4255846b3205d534b1aec57c1a8064"
117
117
  }