@kiva/kv-components 8.14.2 → 8.15.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.
Files changed (61) hide show
  1. package/dist/index.js +104 -102
  2. package/dist/utils/headerNavLinks.d.ts +8 -0
  3. package/dist/utils/headerNavLinks.js +19 -0
  4. package/dist/utils/markMatches.js +12 -0
  5. package/dist/utils/typeaheadSearchConfig.d.ts +4 -0
  6. package/dist/utils/typeaheadSearchConfig.js +31 -0
  7. package/dist/utils/typeaheadSearchEngine.d.ts +14 -0
  8. package/dist/utils/typeaheadSearchEngine.js +28 -0
  9. package/dist/utils/useBreakpoints.d.ts +4 -0
  10. package/dist/utils/useBreakpoints.js +18 -0
  11. package/dist/utils/useHeaderBasicMenuState.d.ts +3197 -0
  12. package/dist/utils/useHeaderBasicMenuState.js +30 -0
  13. package/dist/utils/useTypeaheadSearch.d.ts +19 -0
  14. package/dist/utils/useTypeaheadSearch.js +64 -0
  15. package/dist/vue/KvTab.vue.d.ts +9 -0
  16. package/dist/vue/KvTextInput.css +1 -0
  17. package/dist/vue/KvTextInput.js +18 -17
  18. package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu.js +29 -13
  19. package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu2.js +58 -32
  20. package/dist/vue/KvWwwHeaderBasic/AboutMenu.css +1 -0
  21. package/dist/vue/KvWwwHeaderBasic/AboutMenu.js +25 -0
  22. package/dist/vue/KvWwwHeaderBasic/AboutMenu.vue.d.ts +29 -0
  23. package/dist/vue/KvWwwHeaderBasic/AboutMenu2.js +33 -0
  24. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +1 -0
  25. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +105 -0
  26. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +106 -0
  27. package/dist/vue/KvWwwHeaderBasic/LinkBar.css +1 -0
  28. package/dist/vue/KvWwwHeaderBasic/LinkBar.js +161 -0
  29. package/dist/vue/KvWwwHeaderBasic/LinkBar.vue.d.ts +398 -0
  30. package/dist/vue/KvWwwHeaderBasic/LinkBar2.js +114 -0
  31. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel.css +1 -0
  32. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel.js +61 -0
  33. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel.vue.d.ts +30 -0
  34. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel2.js +18 -0
  35. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.css +1 -0
  36. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js +102 -0
  37. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.vue.d.ts +285 -0
  38. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu2.js +74 -0
  39. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel.css +1 -0
  40. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel.js +51 -0
  41. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel.vue.d.ts +48 -0
  42. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel2.js +31 -0
  43. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/RegionsPanel.js +38 -0
  44. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/RegionsPanel.vue.d.ts +38 -0
  45. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/RegionsPanel2.js +24 -0
  46. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +17 -0
  47. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.vue.d.ts +81 -0
  48. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel2.js +19 -0
  49. package/dist/vue/KvWwwHeaderBasic/MobileMenu.css +1 -0
  50. package/dist/vue/KvWwwHeaderBasic/MobileMenu.js +52 -0
  51. package/dist/vue/KvWwwHeaderBasic/MobileMenu.vue.d.ts +59 -0
  52. package/dist/vue/KvWwwHeaderBasic/MobileMenu2.js +36 -0
  53. package/dist/vue/KvWwwHeaderBasic/MyKivaMenu.css +1 -0
  54. package/dist/vue/KvWwwHeaderBasic/MyKivaMenu.js +90 -0
  55. package/dist/vue/KvWwwHeaderBasic/MyKivaMenu.vue.d.ts +65 -0
  56. package/dist/vue/KvWwwHeaderBasic/MyKivaMenu2.js +45 -0
  57. package/dist/vue/KvWwwHeaderBasic/SearchBar.js +73 -0
  58. package/dist/vue/KvWwwHeaderBasic/SearchBar.vue.d.ts +54 -0
  59. package/dist/vue/KvWwwHeaderBasic/SearchBar2.js +84 -0
  60. package/dist/vue/index.d.ts +1 -0
  61. package/package.json +5 -2
@@ -0,0 +1,45 @@
1
+ import { inject as a } from "vue";
2
+ import l from "../KvWwwHeader/KvHeaderMenuLink.js";
3
+ const u = {
4
+ name: "MyKivaMenu",
5
+ components: { KvHeaderMenuLink: l },
6
+ props: {
7
+ // Accepts the orchestrator's user props; loggedIn/userId are part of the shared menu contract.
8
+ loggedIn: {
9
+ type: Boolean,
10
+ default: !1
11
+ },
12
+ userId: {
13
+ type: Number,
14
+ default: null
15
+ },
16
+ isBorrower: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ isTrustee: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ myDashboardUrl: {
25
+ type: String,
26
+ default: "/mykiva"
27
+ },
28
+ isMobile: {
29
+ type: Boolean,
30
+ default: !1
31
+ }
32
+ },
33
+ emits: ["closing-menu"],
34
+ setup(r, { emit: e }) {
35
+ const o = a("$kvTrackEvent", () => {
36
+ });
37
+ function n(t) {
38
+ o("TopNav", t), e("closing-menu");
39
+ }
40
+ return { onLinkClick: n };
41
+ }
42
+ };
43
+ export {
44
+ u as default
45
+ };
@@ -0,0 +1,73 @@
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";
3
+ import x from "../../_virtual/_plugin-vue_export-helper.js";
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) {
6
+ const p = f("kv-text-input");
7
+ return r(), n("form", {
8
+ class: "tw-relative",
9
+ autocomplete: "off",
10
+ onSubmit: a[1] || (a[1] = l((...e) => t.onSubmit && t.onSubmit(...e), ["prevent"]))
11
+ }, [
12
+ o("label", {
13
+ for: t.inputId,
14
+ class: "tw-sr-only"
15
+ }, "Search all loans", 8, g),
16
+ v(p, {
17
+ id: t.inputId,
18
+ type: "search",
19
+ name: "queryString",
20
+ "data-testid": "header-basic-search-input",
21
+ icon: t.mdiMagnify,
22
+ "model-value": t.displayTerm,
23
+ "can-clear": !0,
24
+ class: "tw-w-full",
25
+ placeholder: "Search all loans",
26
+ onInput: t.onInput,
27
+ onFocus: t.onFocus,
28
+ onBlur: t.onBlur,
29
+ onKeydown: [
30
+ d(l(t.listUp, ["prevent"]), ["up"]),
31
+ d(l(t.listDown, ["prevent"]), ["down"]),
32
+ d(l(t.onSubmit, ["prevent"]), ["enter"])
33
+ ]
34
+ }, null, 8, ["id", "icon", "model-value", "onInput", "onFocus", "onBlur", "onKeydown"]),
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"])
37
+ }, [
38
+ (r(!0), n(w, null, c(t.groupedResults, (e) => (r(), n("li", {
39
+ key: e.group,
40
+ "data-testid": `header-basic-search-results-${e.group}`
41
+ }, [
42
+ o("h2", B, _(e.group), 1),
43
+ o("ol", null, [
44
+ (r(!0), n(w, null, c(e.items, (i, h) => {
45
+ var s;
46
+ return r(), n("li", {
47
+ key: i.label
48
+ }, [
49
+ o("button", {
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) }]),
52
+ "data-testid": `header-basic-search-result-item-${e.group}-${h}`,
53
+ onMousedown: a[0] || (a[0] = l(() => {
54
+ }, ["prevent"])),
55
+ onClick: (L) => t.runSearch(i)
56
+ }, [
57
+ o("span", {
58
+ innerHTML: t.formatResult(i)
59
+ }, null, 8, I)
60
+ ], 42, M)
61
+ ]);
62
+ }), 128))
63
+ ])
64
+ ], 8, k))), 128))
65
+ ], 2), [
66
+ [S, t.showResults]
67
+ ])
68
+ ], 32);
69
+ }
70
+ const E = /* @__PURE__ */ x(b, [["render", C]]);
71
+ export {
72
+ E as default
73
+ };
@@ -0,0 +1,54 @@
1
+ import { SearchSuggestion } from '../../../../../../../../../../src/utils/typeaheadSearchEngine';
2
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
+ searchSuggestions: {
4
+ type: () => SearchSuggestion[];
5
+ default: () => any[];
6
+ };
7
+ appOrigin: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ isMobile: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ }>, {
16
+ mdiMagnify: string;
17
+ inputId: string;
18
+ term: any;
19
+ displayTerm: import('vue').ComputedRef<any>;
20
+ groupedResults: any;
21
+ highlighted: import('vue').ComputedRef<any>;
22
+ showResults: import('vue').ComputedRef<boolean>;
23
+ onInput: (value: string) => void;
24
+ onFocus: () => void;
25
+ onBlur: () => void;
26
+ onSubmit: () => void;
27
+ runSearch: (suggestion: SearchSuggestion) => void;
28
+ listUp: () => void;
29
+ listDown: () => void;
30
+ formatResult: (suggestion: SearchSuggestion) => string;
31
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("load-search-data" | "search-submit")[], "load-search-data" | "search-submit", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
32
+ searchSuggestions: {
33
+ type: () => SearchSuggestion[];
34
+ default: () => any[];
35
+ };
36
+ appOrigin: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ isMobile: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ }>> & Readonly<{
45
+ "onLoad-search-data"?: (...args: any[]) => any;
46
+ "onSearch-submit"?: (...args: any[]) => any;
47
+ }>, {
48
+ isMobile: boolean;
49
+ searchSuggestions: SearchSuggestion[];
50
+ appOrigin: string;
51
+ }, {}, {
52
+ KvTextInput: any;
53
+ }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
54
+ export default _default;
@@ -0,0 +1,84 @@
1
+ import { inject as x, ref as m, toRef as B, 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 = {
7
+ name: "SearchBar",
8
+ components: { KvTextInput: F },
9
+ props: {
10
+ searchSuggestions: {
11
+ type: Array,
12
+ default: () => []
13
+ },
14
+ appOrigin: {
15
+ type: String,
16
+ default: ""
17
+ },
18
+ isMobile: {
19
+ type: Boolean,
20
+ default: !1
21
+ }
22
+ },
23
+ emits: ["load-search-data", "search-submit"],
24
+ setup(r, { emit: i }) {
25
+ const f = x("$kvTrackEvent", () => {
26
+ }), p = "kv-www-header-basic-search", n = m(!1), v = m(!1), {
27
+ term: t,
28
+ groupedResults: l,
29
+ activeIndex: a,
30
+ resolveSubmit: d
31
+ } = _(B(r, "searchSuggestions"), r.appOrigin), o = s(() => l.value.flatMap((e) => e.items)), u = s(() => a.value > -1 ? o.value[a.value] : void 0), g = s(() => {
32
+ var e;
33
+ return ((e = u.value) == null ? void 0 : e.label) ?? t.value;
34
+ }), b = s(() => l.value.length > 0 && n.value);
35
+ function y(e) {
36
+ t.value = e;
37
+ }
38
+ function S() {
39
+ n.value = !0, v.value || (i("load-search-data"), v.value = !0), f("search", "focus");
40
+ }
41
+ function k() {
42
+ n.value = !1, a.value = -1;
43
+ }
44
+ function c(e) {
45
+ const h = d(e);
46
+ f("search", "click", h.suggestion ? "type-ahead-search" : "custom-search-option"), i("search-submit", h);
47
+ }
48
+ function w(e) {
49
+ c(e);
50
+ }
51
+ function I() {
52
+ u.value ? c(u.value) : c(t.value);
53
+ }
54
+ function R() {
55
+ a.value += 1, a.value >= o.value.length && (a.value = -1);
56
+ }
57
+ function T() {
58
+ a.value === -1 && (a.value = o.value.length), a.value -= 1;
59
+ }
60
+ function M(e) {
61
+ return O(e.label, e.matches);
62
+ }
63
+ return {
64
+ mdiMagnify: E,
65
+ inputId: p,
66
+ term: t,
67
+ displayTerm: g,
68
+ groupedResults: l,
69
+ highlighted: u,
70
+ showResults: b,
71
+ onInput: y,
72
+ onFocus: S,
73
+ onBlur: k,
74
+ onSubmit: I,
75
+ runSearch: w,
76
+ listUp: T,
77
+ listDown: R,
78
+ formatResult: M
79
+ };
80
+ }
81
+ };
82
+ export {
83
+ K as default
84
+ };
@@ -89,3 +89,4 @@ export * from './KvWideLoanCard.vue';
89
89
  export { default as KvAtbModal } from './KvAtbModal.vue';
90
90
  export { default as KvSecondaryNav } from './KvSecondaryNav.vue';
91
91
  export { default as KvWwwHeader } from './KvWwwHeader.vue';
92
+ export { default as KvWwwHeaderBasic } from './KvWwwHeaderBasic/KvWwwHeaderBasic.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "8.14.2",
3
+ "version": "8.15.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -125,5 +125,8 @@
125
125
  "embla-carousel-fade",
126
126
  "popper.js"
127
127
  ],
128
- "gitHead": "3286625d2cdc74397aeb3902a6dcce330f070071"
128
+ "dependencies": {
129
+ "fuse.js": "^7.1.0"
130
+ },
131
+ "gitHead": "d615c83ca4ae49487e28a78a5c8f2b060633299a"
129
132
  }