@kiva/kv-components 9.0.3 → 9.1.1

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.
Files changed (35) hide show
  1. package/dist/utils/headerMenuTiming.d.ts +6 -0
  2. package/dist/utils/headerMenuTiming.js +9 -0
  3. package/dist/utils/useHeaderMenuGroup.d.ts +27 -0
  4. package/dist/utils/useHeaderMenuGroup.js +68 -0
  5. package/dist/utils/useHeaderMenuPlacement.d.ts +6 -0
  6. package/dist/utils/useHeaderMenuPlacement.js +30 -0
  7. package/dist/utils/useHeaderMenuState.d.ts +10 -0
  8. package/dist/utils/useHeaderMenuState.js +21 -0
  9. package/dist/utils/useHoverIntent.d.ts +5 -0
  10. package/dist/utils/useHoverIntent.js +17 -0
  11. package/dist/utils/useOutsidePointerDown.d.ts +2 -0
  12. package/dist/utils/useOutsidePointerDown.js +19 -0
  13. package/dist/utils/usePointerType.d.ts +5 -0
  14. package/dist/utils/usePointerType.js +19 -0
  15. package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu2.js +62 -61
  16. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.css +1 -0
  17. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.js +35 -0
  18. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.vue.d.ts +25 -0
  19. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup2.js +37 -0
  20. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +1 -1
  21. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +29 -75
  22. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +37 -92
  23. package/dist/vue/KvWwwHeaderBasic/LinkBar.css +1 -1
  24. package/dist/vue/KvWwwHeaderBasic/LinkBar.js +206 -132
  25. package/dist/vue/KvWwwHeaderBasic/LinkBar.vue.d.ts +226 -185
  26. package/dist/vue/KvWwwHeaderBasic/LinkBar2.js +69 -96
  27. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.vue.d.ts +9 -1
  28. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +12 -11
  29. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.vue.d.ts +9 -1
  30. package/dist/vue/KvWwwHeaderBasic/SearchBar.js +12 -12
  31. package/dist/vue/KvWwwHeaderBasic/SearchBar.vue.d.ts +9 -1
  32. package/dist/vue/KvWwwHeaderBasic/SearchBar2.js +49 -43
  33. package/package.json +3 -4
  34. package/dist/utils/useHeaderBasicMenuState.d.ts +0 -3197
  35. package/dist/utils/useHeaderBasicMenuState.js +0 -30
@@ -1,17 +1,18 @@
1
- import s from "./SearchPanel2.js";
2
- import { resolveComponent as t, openBlock as i, createBlock as m } from "vue";
3
- import p from "../../../_virtual/_plugin-vue_export-helper.js";
4
- function c(o, e, r, u, g, l) {
5
- const n = t("search-bar");
6
- return i(), m(n, {
7
- "search-suggestions": r.searchSuggestions,
8
- "app-origin": r.appOrigin,
1
+ import n from "./SearchPanel2.js";
2
+ import { resolveComponent as t, openBlock as i, createBlock as c } from "vue";
3
+ import m from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ function p(r, e, o, u, l, d) {
5
+ const s = t("search-bar");
6
+ return i(), c(s, {
7
+ "search-suggestions": o.searchSuggestions,
8
+ "app-origin": o.appOrigin,
9
+ "input-id": "kv-www-header-basic-search-mobile",
9
10
  "is-mobile": "",
10
- onLoadSearchData: e[0] || (e[0] = (a) => o.$emit("load-search-data")),
11
- onSearchSubmit: e[1] || (e[1] = (a) => o.$emit("search-submit", a))
11
+ onLoadSearchData: e[0] || (e[0] = (a) => r.$emit("load-search-data")),
12
+ onSearchSubmit: e[1] || (e[1] = (a) => r.$emit("search-submit", a))
12
13
  }, null, 8, ["search-suggestions", "app-origin"]);
13
14
  }
14
- const b = /* @__PURE__ */ p(s, [["render", c]]);
15
+ const b = /* @__PURE__ */ m(n, [["render", p]]);
15
16
  export {
16
17
  b as default
17
18
  };
@@ -38,9 +38,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
38
38
  type: BooleanConstructor;
39
39
  default: boolean;
40
40
  };
41
+ inputId: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
41
45
  }>, {
42
46
  mdiMagnify: string;
43
- inputId: string;
44
47
  term: any;
45
48
  displayTerm: import('vue').ComputedRef<any>;
46
49
  groupedResults: any;
@@ -67,6 +70,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
67
70
  type: BooleanConstructor;
68
71
  default: boolean;
69
72
  };
73
+ inputId: {
74
+ type: StringConstructor;
75
+ default: string;
76
+ };
70
77
  }>> & Readonly<{
71
78
  "onLoad-search-data"?: (...args: any[]) => any;
72
79
  "onSearch-submit"?: (...args: any[]) => any;
@@ -74,6 +81,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
74
81
  isMobile: boolean;
75
82
  searchSuggestions: SearchSuggestion[];
76
83
  appOrigin: string;
84
+ inputId: string;
77
85
  }, {}, {
78
86
  KvTextInput: any;
79
87
  }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,8 +1,8 @@
1
1
  import b from "./SearchBar2.js";
2
- import { resolveComponent as f, openBlock as r, createElementBlock as n, withModifiers as l, createElementVNode as o, createVNode as v, withKeys as d, withDirectives as y, normalizeClass as u, Fragment as w, renderList as c, toDisplayString as _, vShow as S } from "vue";
2
+ import { resolveComponent as f, openBlock as r, createElementBlock as n, withModifiers as l, createElementVNode as o, createVNode as v, withKeys as s, withDirectives as y, normalizeClass as w, Fragment as c, renderList as m, toDisplayString as _, vShow as S } from "vue";
3
3
  import x from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const g = ["for"], k = ["data-testid"], B = { class: "tw-text-base tw-py-0.5" }, M = ["data-testid", "onClick"], I = ["innerHTML"];
5
- function C(F, a, m, t, D, K) {
5
+ function C(F, a, d, t, D, K) {
6
6
  const p = f("kv-text-input");
7
7
  return r(), n("form", {
8
8
  class: "tw-relative",
@@ -10,11 +10,11 @@ function C(F, a, m, t, D, K) {
10
10
  onSubmit: a[1] || (a[1] = l((...e) => t.onSubmit && t.onSubmit(...e), ["prevent"]))
11
11
  }, [
12
12
  o("label", {
13
- for: t.inputId,
13
+ for: d.inputId,
14
14
  class: "tw-sr-only"
15
15
  }, "Search all loans", 8, g),
16
16
  v(p, {
17
- id: t.inputId,
17
+ id: d.inputId,
18
18
  type: "search",
19
19
  name: "queryString",
20
20
  "data-testid": "header-basic-search-input",
@@ -27,28 +27,28 @@ function C(F, a, m, t, D, K) {
27
27
  onFocus: t.onFocus,
28
28
  onBlur: t.onBlur,
29
29
  onKeydown: [
30
- d(l(t.listUp, ["prevent"]), ["up"]),
31
- d(l(t.listDown, ["prevent"]), ["down"]),
32
- d(l(t.onSubmit, ["prevent"]), ["enter"])
30
+ s(l(t.listUp, ["prevent"]), ["up"]),
31
+ s(l(t.listDown, ["prevent"]), ["down"]),
32
+ s(l(t.onSubmit, ["prevent"]), ["enter"])
33
33
  ]
34
34
  }, null, 8, ["id", "icon", "model-value", "onInput", "onFocus", "onBlur", "onKeydown"]),
35
35
  y(o("ol", {
36
- class: u(["tw-w-full tw-bg-primary tw-p-2.5 tw-border tw-border-tertiary tw-overflow-auto", m.isMobile ? "tw-mt-2" : "tw-absolute tw-z-popover tw-inset-x-0 md:tw-rounded-b"])
36
+ class: w(["tw-w-full tw-bg-primary tw-p-2.5 tw-border tw-border-tertiary tw-overflow-auto", d.isMobile ? "tw-mt-2" : "tw-absolute tw-z-popover tw-inset-x-0 md:tw-rounded-b"])
37
37
  }, [
38
- (r(!0), n(w, null, c(t.groupedResults, (e) => (r(), n("li", {
38
+ (r(!0), n(c, null, m(t.groupedResults, (e) => (r(), n("li", {
39
39
  key: e.group,
40
40
  "data-testid": `header-basic-search-results-${e.group}`
41
41
  }, [
42
42
  o("h2", B, _(e.group), 1),
43
43
  o("ol", null, [
44
- (r(!0), n(w, null, c(e.items, (i, h) => {
45
- var s;
44
+ (r(!0), n(c, null, m(e.items, (i, h) => {
45
+ var u;
46
46
  return r(), n("li", {
47
47
  key: i.label
48
48
  }, [
49
49
  o("button", {
50
50
  type: "button",
51
- class: u(["tw-w-full tw-text-left tw-pl-1.5 tw-py-0.5 tw-rounded-xs tw-font-medium tw-cursor-pointer hover:tw-bg-secondary hover:tw-underline", { "tw-bg-secondary tw-underline": i.label === ((s = t.highlighted) == null ? void 0 : s.label) }]),
51
+ class: w(["tw-w-full tw-text-left tw-pl-1.5 tw-py-0.5 tw-rounded-xs tw-font-medium tw-cursor-pointer hover:tw-bg-secondary hover:tw-underline", { "tw-bg-secondary tw-underline": i.label === ((u = t.highlighted) == null ? void 0 : u.label) }]),
52
52
  "data-testid": `header-basic-search-result-item-${e.group}-${h}`,
53
53
  onMousedown: a[0] || (a[0] = l(() => {
54
54
  }, ["prevent"])),
@@ -12,9 +12,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
12
12
  type: BooleanConstructor;
13
13
  default: boolean;
14
14
  };
15
+ inputId: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
15
19
  }>, {
16
20
  mdiMagnify: string;
17
- inputId: string;
18
21
  term: any;
19
22
  displayTerm: import('vue').ComputedRef<any>;
20
23
  groupedResults: any;
@@ -41,6 +44,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
41
44
  type: BooleanConstructor;
42
45
  default: boolean;
43
46
  };
47
+ inputId: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
44
51
  }>> & Readonly<{
45
52
  "onLoad-search-data"?: (...args: any[]) => any;
46
53
  "onSearch-submit"?: (...args: any[]) => any;
@@ -48,6 +55,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
48
55
  isMobile: boolean;
49
56
  searchSuggestions: SearchSuggestion[];
50
57
  appOrigin: string;
58
+ inputId: string;
51
59
  }, {}, {
52
60
  KvTextInput: any;
53
61
  }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,11 +1,11 @@
1
- import { inject as B, ref as m, toRef as p, computed as s } from "vue";
2
- import { mdiMagnify as E } from "@mdi/js";
3
- import F from "../KvTextInput.js";
4
- import O from "../../utils/markMatches.js";
5
- import { useTypeaheadSearch as _ } from "../../utils/useTypeaheadSearch.js";
6
- const K = {
1
+ import { inject as x, ref as m, toRef as p, computed as s } from "vue";
2
+ import { mdiMagnify as B } from "@mdi/js";
3
+ import E from "../KvTextInput.js";
4
+ import F from "../../utils/markMatches.js";
5
+ import { useTypeaheadSearch as O } from "../../utils/useTypeaheadSearch.js";
6
+ const D = {
7
7
  name: "SearchBar",
8
- components: { KvTextInput: F },
8
+ components: { KvTextInput: E },
9
9
  props: {
10
10
  searchSuggestions: {
11
11
  type: Array,
@@ -18,67 +18,73 @@ const K = {
18
18
  isMobile: {
19
19
  type: Boolean,
20
20
  default: !1
21
+ },
22
+ /**
23
+ * Id for the search input and its label's `for` attribute. Must be unique per instance.
24
+ */
25
+ inputId: {
26
+ type: String,
27
+ default: "kv-www-header-basic-search"
21
28
  }
22
29
  },
23
30
  emits: ["load-search-data", "search-submit"],
24
- setup(r, { emit: i }) {
25
- const f = B("$kvTrackEvent", () => {
26
- }), d = "kv-www-header-basic-search", n = m(!1), v = m(!1), {
31
+ setup(c, { emit: i }) {
32
+ const f = x("$kvTrackEvent", () => {
33
+ }), l = m(!1), v = m(!1), {
27
34
  term: t,
28
- groupedResults: o,
35
+ groupedResults: n,
29
36
  activeIndex: a,
30
- resolveSubmit: g
31
- } = _(p(r, "searchSuggestions"), p(r, "appOrigin")), l = s(() => o.value.flatMap((e) => e.items)), u = s(() => a.value > -1 ? l.value[a.value] : void 0), b = s(() => {
37
+ resolveSubmit: d
38
+ } = O(p(c, "searchSuggestions"), p(c, "appOrigin")), o = s(() => n.value.flatMap((e) => e.items)), u = s(() => a.value > -1 ? o.value[a.value] : void 0), g = s(() => {
32
39
  var e;
33
40
  return ((e = u.value) == null ? void 0 : e.label) ?? t.value;
34
- }), y = s(() => o.value.length > 0 && n.value);
35
- function S(e) {
41
+ }), y = s(() => n.value.length > 0 && l.value);
42
+ function b(e) {
36
43
  t.value = e;
37
44
  }
38
- function k() {
39
- n.value = !0, v.value || (i("load-search-data"), v.value = !0), f("search", "focus");
45
+ function S() {
46
+ l.value = !0, v.value || (i("load-search-data"), v.value = !0), f("search", "focus");
40
47
  }
41
- function w() {
42
- n.value = !1, a.value = -1;
48
+ function k() {
49
+ l.value = !1, a.value = -1;
43
50
  }
44
- function c(e) {
45
- const h = g(e);
51
+ function r(e) {
52
+ const h = d(e);
46
53
  f("search", "click", h.suggestion ? "type-ahead-search" : "custom-search-option"), i("search-submit", h);
47
54
  }
48
- function I(e) {
49
- c(e);
55
+ function w(e) {
56
+ r(e);
57
+ }
58
+ function I() {
59
+ u.value ? r(u.value) : r(t.value);
50
60
  }
51
61
  function R() {
52
- u.value ? c(u.value) : c(t.value);
62
+ a.value += 1, a.value >= o.value.length && (a.value = -1);
53
63
  }
54
64
  function T() {
55
- a.value += 1, a.value >= l.value.length && (a.value = -1);
56
- }
57
- function M() {
58
- a.value === -1 && (a.value = l.value.length), a.value -= 1;
65
+ a.value === -1 && (a.value = o.value.length), a.value -= 1;
59
66
  }
60
- function x(e) {
61
- return O(e.label, e.matches);
67
+ function M(e) {
68
+ return F(e.label, e.matches);
62
69
  }
63
70
  return {
64
- mdiMagnify: E,
65
- inputId: d,
71
+ mdiMagnify: B,
66
72
  term: t,
67
- displayTerm: b,
68
- groupedResults: o,
73
+ displayTerm: g,
74
+ groupedResults: n,
69
75
  highlighted: u,
70
76
  showResults: y,
71
- onInput: S,
72
- onFocus: k,
73
- onBlur: w,
74
- onSubmit: R,
75
- runSearch: I,
76
- listUp: M,
77
- listDown: T,
78
- formatResult: x
77
+ onInput: b,
78
+ onFocus: S,
79
+ onBlur: k,
80
+ onSubmit: I,
81
+ runSearch: w,
82
+ listUp: T,
83
+ listDown: R,
84
+ formatResult: M
79
85
  };
80
86
  }
81
87
  };
82
88
  export {
83
- K as default
89
+ D as default
84
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "9.0.3",
3
+ "version": "9.1.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -44,10 +44,9 @@
44
44
  "@storybook/vue3-vite": "^10.1.10",
45
45
  "@testing-library/dom": "^8.1.0",
46
46
  "@testing-library/jest-dom": "^5.16.2",
47
- "@testing-library/user-event": "^13.2.1",
47
+ "@testing-library/user-event": "^14.6.7",
48
48
  "@testing-library/vue": "^8.1.0",
49
49
  "@types/leaflet": "^1.9.21",
50
- "@vue/reactivity": "3.2.37",
51
50
  "@vue/vue3-jest": "^29.2.6",
52
51
  "@vueuse/integrations": "^14.1.0",
53
52
  "aria-hidden": "^1.2.4",
@@ -113,5 +112,5 @@
113
112
  "dependencies": {
114
113
  "fuse.js": "^7.1.0"
115
114
  },
116
- "gitHead": "34383a223296d1dd68ac2bdb3828ee89a2d7b23d"
115
+ "gitHead": "b8e2d2c7bb4a12f0151226fea982f696ab77856b"
117
116
  }