@kiva/kv-shop 3.8.32 → 3.8.34

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 (150) hide show
  1. package/dist/components/KvPaymentSelect2.js +32 -101
  2. package/package.json +9 -5
  3. package/dist/kv-components/dist/_virtual/_plugin-vue_export-helper.js +0 -9
  4. package/dist/kv-components/dist/data/allCountriesISOMap.js +0 -249
  5. package/dist/kv-components/dist/data/simpleMapCentroids.js +0 -1315
  6. package/dist/kv-components/dist/data/simpleMapCountryPaths.js +0 -215
  7. package/dist/kv-components/dist/data/simpleMapPaths.js +0 -216
  8. package/dist/kv-components/dist/utils/arrayUtils.js +0 -8
  9. package/dist/kv-components/dist/utils/attrs.js +0 -19
  10. package/dist/kv-components/dist/utils/chartColors.js +0 -16
  11. package/dist/kv-components/dist/utils/comparators.js +0 -23
  12. package/dist/kv-components/dist/utils/expander.js +0 -36
  13. package/dist/kv-components/dist/utils/headerNavLinks.js +0 -10
  14. package/dist/kv-components/dist/utils/loanCard.js +0 -49
  15. package/dist/kv-components/dist/utils/mapUtils.js +0 -7
  16. package/dist/kv-components/dist/utils/markMatches.js +0 -12
  17. package/dist/kv-components/dist/utils/paramCase.js +0 -6
  18. package/dist/kv-components/dist/utils/pieChartColors.js +0 -5
  19. package/dist/kv-components/dist/utils/typeaheadSearchConfig.js +0 -31
  20. package/dist/kv-components/dist/utils/typeaheadSearchEngine.js +0 -28
  21. package/dist/kv-components/dist/utils/useMapTourCycle.js +0 -73
  22. package/dist/kv-components/dist/utils/useTypeaheadSearch.js +0 -65
  23. package/dist/kv-components/dist/vue/KvAccordionItem.js +0 -41
  24. package/dist/kv-components/dist/vue/KvAccordionItem2.js +0 -60
  25. package/dist/kv-components/dist/vue/KvAtbModal.css +0 -1
  26. package/dist/kv-components/dist/vue/KvCarousel.css +0 -1
  27. package/dist/kv-components/dist/vue/KvCartModal.css +0 -1
  28. package/dist/kv-components/dist/vue/KvCheckbox.css +0 -1
  29. package/dist/kv-components/dist/vue/KvCheckoutReceipt.css +0 -1
  30. package/dist/kv-components/dist/vue/KvClassicLoanCard.css +0 -1
  31. package/dist/kv-components/dist/vue/KvClassicLoanCard2.js +0 -57
  32. package/dist/kv-components/dist/vue/KvCommentsAdd.css +0 -1
  33. package/dist/kv-components/dist/vue/KvCommentsHeartButton.css +0 -1
  34. package/dist/kv-components/dist/vue/KvCommentsReplyButton.css +0 -1
  35. package/dist/kv-components/dist/vue/KvCompactLoanCard.css +0 -1
  36. package/dist/kv-components/dist/vue/KvCompactLoanCard2.js +0 -49
  37. package/dist/kv-components/dist/vue/KvDatePicker.css +0 -1
  38. package/dist/kv-components/dist/vue/KvExpandable.js +0 -18
  39. package/dist/kv-components/dist/vue/KvExpandable2.js +0 -52
  40. package/dist/kv-components/dist/vue/KvFlag.css +0 -1
  41. package/dist/kv-components/dist/vue/KvGrid.js +0 -15
  42. package/dist/kv-components/dist/vue/KvGrid2.js +0 -15
  43. package/dist/kv-components/dist/vue/KvImageUpload.css +0 -1
  44. package/dist/kv-components/dist/vue/KvImpactDashboardHeader.css +0 -1
  45. package/dist/kv-components/dist/vue/KvInlineActivityFeed.css +0 -1
  46. package/dist/kv-components/dist/vue/KvIntroductionLoanCard.css +0 -1
  47. package/dist/kv-components/dist/vue/KvIntroductionLoanCard2.js +0 -50
  48. package/dist/kv-components/dist/vue/KvLendCta.css +0 -1
  49. package/dist/kv-components/dist/vue/KvLendCta2.js +0 -24
  50. package/dist/kv-components/dist/vue/KvLoadingPlaceholder.css +0 -1
  51. package/dist/kv-components/dist/vue/KvLoadingPlaceholder.js +0 -11
  52. package/dist/kv-components/dist/vue/KvLoadingSpinner.js +0 -24
  53. package/dist/kv-components/dist/vue/KvLoadingSpinner2.js +0 -29
  54. package/dist/kv-components/dist/vue/KvLoadingText.css +0 -1
  55. package/dist/kv-components/dist/vue/KvLoanActivities.css +0 -1
  56. package/dist/kv-components/dist/vue/KvLoanActivities2.js +0 -26
  57. package/dist/kv-components/dist/vue/KvLoanBookmark2.js +0 -14
  58. package/dist/kv-components/dist/vue/KvLoanCallouts.css +0 -1
  59. package/dist/kv-components/dist/vue/KvLoanInfoCard.css +0 -1
  60. package/dist/kv-components/dist/vue/KvLoanInfoCard.js +0 -23
  61. package/dist/kv-components/dist/vue/KvLoanProgressGroup.css +0 -1
  62. package/dist/kv-components/dist/vue/KvLoanTag2.js +0 -31
  63. package/dist/kv-components/dist/vue/KvLoanUse2.js +0 -18
  64. package/dist/kv-components/dist/vue/KvMap.css +0 -1
  65. package/dist/kv-components/dist/vue/KvMaterialIcon.js +0 -24
  66. package/dist/kv-components/dist/vue/KvMaterialIcon2.js +0 -15
  67. package/dist/kv-components/dist/vue/KvPageContainer.js +0 -16
  68. package/dist/kv-components/dist/vue/KvPageContainer2.js +0 -4
  69. package/dist/kv-components/dist/vue/KvPieChart.css +0 -1
  70. package/dist/kv-components/dist/vue/KvPieChartV2.css +0 -1
  71. package/dist/kv-components/dist/vue/KvProgressCircle.css +0 -1
  72. package/dist/kv-components/dist/vue/KvPulsingDot.css +0 -1
  73. package/dist/kv-components/dist/vue/KvSecondaryNav.css +0 -1
  74. package/dist/kv-components/dist/vue/KvSelect.css +0 -1
  75. package/dist/kv-components/dist/vue/KvSimpleMap.css +0 -1
  76. package/dist/kv-components/dist/vue/KvSimpleMap2.js +0 -20
  77. package/dist/kv-components/dist/vue/KvStackedBarGraph.css +0 -1
  78. package/dist/kv-components/dist/vue/KvTab.js +0 -25
  79. package/dist/kv-components/dist/vue/KvTab2.js +0 -48
  80. package/dist/kv-components/dist/vue/KvTabPanel.js +0 -34
  81. package/dist/kv-components/dist/vue/KvTabPanel2.js +0 -28
  82. package/dist/kv-components/dist/vue/KvTabs.js +0 -32
  83. package/dist/kv-components/dist/vue/KvTabs2.js +0 -73
  84. package/dist/kv-components/dist/vue/KvTextInput.css +0 -1
  85. package/dist/kv-components/dist/vue/KvTextInput.js +0 -66
  86. package/dist/kv-components/dist/vue/KvTextInput2.js +0 -126
  87. package/dist/kv-components/dist/vue/KvThemeProvider.css +0 -1
  88. package/dist/kv-components/dist/vue/KvTooltip.css +0 -1
  89. package/dist/kv-components/dist/vue/KvTreeMapChart.css +0 -1
  90. package/dist/kv-components/dist/vue/KvTreeMapChart2.js +0 -6
  91. package/dist/kv-components/dist/vue/KvUserAvatar.css +0 -1
  92. package/dist/kv-components/dist/vue/KvVotingCard.css +0 -1
  93. package/dist/kv-components/dist/vue/KvVotingCardV2.css +0 -1
  94. package/dist/kv-components/dist/vue/KvWideLoanCard.css +0 -1
  95. package/dist/kv-components/dist/vue/KvWideLoanCard2.js +0 -45
  96. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderAboutMenu.js +0 -85
  97. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderAboutMenu2.js +0 -9
  98. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderLinkBar.css +0 -1
  99. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderLinkBar2.js +0 -11
  100. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderMenuLink.js +0 -12
  101. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderMobileMenu.css +0 -1
  102. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderMobileMenu.js +0 -145
  103. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderMobileMenu2.js +0 -59
  104. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderMyKivaMenu.js +0 -89
  105. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderMyKivaMenu2.js +0 -27
  106. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderTakeActionMenu.js +0 -57
  107. package/dist/kv-components/dist/vue/KvWwwHeader/KvHeaderTakeActionMenu2.js +0 -9
  108. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.css +0 -1
  109. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.js +0 -207
  110. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu2.js +0 -82
  111. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.css +0 -1
  112. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.js +0 -205
  113. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu2.js +0 -86
  114. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenu.js +0 -55
  115. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenu2.js +0 -172
  116. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenuCountryList.css +0 -1
  117. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenuCountryList.js +0 -31
  118. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenuCountryList2.js +0 -12
  119. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenuSearchList.js +0 -26
  120. package/dist/kv-components/dist/vue/KvWwwHeader/LendMenu/KvLendMenuSearchList2.js +0 -11
  121. package/dist/kv-components/dist/vue/KvWwwHeader.css +0 -1
  122. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/AboutMenu.css +0 -1
  123. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/AboutMenu.js +0 -25
  124. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/AboutMenu2.js +0 -33
  125. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.css +0 -1
  126. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +0 -1
  127. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +0 -17
  128. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/LinkBar.css +0 -1
  129. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/LinkBar2.js +0 -12
  130. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel.css +0 -1
  131. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel.js +0 -61
  132. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel2.js +0 -18
  133. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.css +0 -1
  134. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js +0 -102
  135. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu2.js +0 -74
  136. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel.css +0 -1
  137. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel.js +0 -51
  138. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel2.js +0 -31
  139. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/RegionsPanel.js +0 -38
  140. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/RegionsPanel2.js +0 -24
  141. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +0 -18
  142. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel2.js +0 -19
  143. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileMenu.css +0 -1
  144. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileMenu.js +0 -59
  145. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MobileMenu2.js +0 -49
  146. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MyKivaMenu.css +0 -1
  147. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MyKivaMenu.js +0 -132
  148. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/MyKivaMenu2.js +0 -55
  149. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/SearchBar.js +0 -73
  150. package/dist/kv-components/dist/vue/KvWwwHeaderBasic/SearchBar2.js +0 -90
@@ -1,132 +0,0 @@
1
- import d from "./MyKivaMenu2.js";
2
- import { resolveComponent as u, openBlock as a, createElementBlock as s, createVNode as o, withCtx as t, createTextVNode as i, Fragment as f, createCommentVNode as k } from "vue";
3
- import "./MyKivaMenu.css";
4
- import m from "../../_virtual/_plugin-vue_export-helper.js";
5
- const C = { class: "tw-flex tw-flex-col tw-items-start tw-font-medium tw-mt-0.5 tw-pb-1 tw-px-2" };
6
- function h(y, e, c, l, w, p) {
7
- const r = u("kv-header-menu-link");
8
- return a(), s("nav", C, [
9
- o(r, {
10
- href: c.myDashboardUrl,
11
- class: "md:tw-hidden",
12
- onClick: e[0] || (e[0] = (n) => l.onLinkClick("click-Dashboard"))
13
- }, {
14
- default: t(() => e[12] || (e[12] = [
15
- i(" My Dashboard ")
16
- ])),
17
- _: 1
18
- }, 8, ["href"]),
19
- c.isBorrower ? (a(), s(f, { key: 0 }, [
20
- o(r, {
21
- href: "/my/borrower",
22
- onClick: e[1] || (e[1] = (n) => l.onLinkClick("click-Portfolio-My borrower dashboard"))
23
- }, {
24
- default: t(() => e[13] || (e[13] = [
25
- i(" My borrower dashboard ")
26
- ])),
27
- _: 1
28
- }),
29
- c.mostRecentBorrowedLoanId !== null ? (a(), s(f, { key: 0 }, [
30
- o(r, {
31
- href: `/lend/${c.mostRecentBorrowedLoanId}`,
32
- onClick: e[2] || (e[2] = (n) => l.onLinkClick("click-Portfolio-My loan page"))
33
- }, {
34
- default: t(() => e[14] || (e[14] = [
35
- i(" My loan page ")
36
- ])),
37
- _: 1
38
- }, 8, ["href"]),
39
- o(r, {
40
- href: `/lend-classic/${c.mostRecentBorrowedLoanId}#loanComments`,
41
- onClick: e[3] || (e[3] = (n) => l.onLinkClick("click-Portfolio-My Conversations"))
42
- }, {
43
- default: t(() => e[15] || (e[15] = [
44
- i(" My conversations ")
45
- ])),
46
- _: 1
47
- }, 8, ["href"])
48
- ], 64)) : k("", !0)
49
- ], 64)) : k("", !0),
50
- c.isTrustee ? (a(), s(f, { key: 1 }, [
51
- c.isBorrower ? k("", !0) : (a(), s(f, { key: 0 }, [
52
- o(r, {
53
- href: l.trusteeLoansUrl,
54
- onClick: e[4] || (e[4] = (n) => l.onLinkClick("click-Portfolio-My Trustee loans"))
55
- }, {
56
- default: t(() => e[16] || (e[16] = [
57
- i(" My Trustee loans ")
58
- ])),
59
- _: 1
60
- }, 8, ["href"]),
61
- o(r, {
62
- href: `/trustees/${c.trusteeId}`,
63
- onClick: e[5] || (e[5] = (n) => l.onLinkClick("click-Portfolio-My public Trustee page"))
64
- }, {
65
- default: t(() => e[17] || (e[17] = [
66
- i(" My public Trustee page ")
67
- ])),
68
- _: 1
69
- }, 8, ["href"])
70
- ], 64)),
71
- o(r, {
72
- href: "/my/trustee",
73
- onClick: e[6] || (e[6] = (n) => l.onLinkClick("click-Portfolio-My Trustee dashboard"))
74
- }, {
75
- default: t(() => e[18] || (e[18] = [
76
- i(" My Trustee dashboard ")
77
- ])),
78
- _: 1
79
- })
80
- ], 64)) : k("", !0),
81
- o(r, {
82
- href: "/portfolio",
83
- onClick: e[7] || (e[7] = (n) => l.onLinkClick("click-Portfolio-Portfolio"))
84
- }, {
85
- default: t(() => e[19] || (e[19] = [
86
- i(" Portfolio ")
87
- ])),
88
- _: 1
89
- }),
90
- o(r, {
91
- href: "/teams/my-teams",
92
- onClick: e[8] || (e[8] = (n) => l.onLinkClick("click-Portfolio-My teams"))
93
- }, {
94
- default: t(() => e[20] || (e[20] = [
95
- i(" My Teams ")
96
- ])),
97
- _: 1
98
- }),
99
- o(r, {
100
- href: "/portfolio/donations",
101
- onClick: e[9] || (e[9] = (n) => l.onLinkClick("click-Portfolio-Donations"))
102
- }, {
103
- default: t(() => e[21] || (e[21] = [
104
- i(" Donations ")
105
- ])),
106
- _: 1
107
- }),
108
- o(r, {
109
- href: "/settings",
110
- onClick: e[10] || (e[10] = (n) => l.onLinkClick("click-Portfolio-Settings"))
111
- }, {
112
- default: t(() => e[22] || (e[22] = [
113
- i(" Settings ")
114
- ])),
115
- _: 1
116
- }),
117
- o(r, {
118
- href: "/ui-logout",
119
- class: "tw-border-t tw-border-secondary tw-w-full",
120
- onClick: e[11] || (e[11] = (n) => l.onLinkClick("click-Portfolio-Sign out"))
121
- }, {
122
- default: t(() => e[23] || (e[23] = [
123
- i(" Sign out ")
124
- ])),
125
- _: 1
126
- })
127
- ]);
128
- }
129
- const P = /* @__PURE__ */ m(d, [["render", h], ["__scopeId", "data-v-7b004666"]]);
130
- export {
131
- P as default
132
- };
@@ -1,55 +0,0 @@
1
- import { inject as u, computed as r } from "vue";
2
- import s from "../KvWwwHeader/KvHeaderMenuLink.js";
3
- const f = {
4
- name: "MyKivaMenu",
5
- components: { KvHeaderMenuLink: s },
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
- trusteeId: {
25
- type: Number,
26
- default: null
27
- },
28
- mostRecentBorrowedLoanId: {
29
- type: Number,
30
- default: null
31
- },
32
- myDashboardUrl: {
33
- type: String,
34
- default: "/mykiva"
35
- },
36
- isMobile: {
37
- type: Boolean,
38
- default: !1
39
- }
40
- },
41
- emits: ["closing-menu"],
42
- setup(e, { emit: t }) {
43
- const n = u("$kvTrackEvent", () => {
44
- }), o = r(
45
- () => `/lend?trustee=${e.trusteeId}&status=fundraising&sortBy=newest`
46
- );
47
- function a(l) {
48
- n("TopNav", l), t("closing-menu");
49
- }
50
- return { trusteeLoansUrl: o, onLinkClick: a };
51
- }
52
- };
53
- export {
54
- f as default
55
- };
@@ -1,73 +0,0 @@
1
- import h 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 i, withDirectives as y, normalizeClass as p, Fragment as w, renderList as c, toDisplayString as g, vShow as S } from "vue";
3
- import k from "../../_virtual/_plugin-vue_export-helper.js";
4
- const M = ["for"], x = ["data-testid"], B = { class: "tw-text-base tw-py-0.5" }, I = ["data-testid", "onClick"], C = ["innerHTML"];
5
- function D(F, s, u, e, K, L) {
6
- const m = f("kv-text-input");
7
- return r(), n("form", {
8
- class: "tw-relative",
9
- autocomplete: "off",
10
- onSubmit: s[1] || (s[1] = l((...t) => e.onSubmit && e.onSubmit(...t), ["prevent"]))
11
- }, [
12
- o("label", {
13
- for: u.inputId,
14
- class: "tw-sr-only"
15
- }, "Search all loans", 8, M),
16
- v(m, {
17
- id: u.inputId,
18
- type: "search",
19
- name: "queryString",
20
- "data-testid": "header-basic-search-input",
21
- icon: e.mdiMagnify,
22
- "model-value": e.displayTerm,
23
- "can-clear": !0,
24
- class: "tw-w-full",
25
- placeholder: "Search all loans",
26
- onInput: e.onInput,
27
- onFocus: e.onFocus,
28
- onBlur: e.onBlur,
29
- onKeydown: [
30
- i(l(e.listUp, ["prevent"]), ["up"]),
31
- i(l(e.listDown, ["prevent"]), ["down"]),
32
- i(l(e.onSubmit, ["prevent"]), ["enter"])
33
- ]
34
- }, null, 8, ["id", "icon", "model-value", "onInput", "onFocus", "onBlur", "onKeydown"]),
35
- y(o("ol", {
36
- class: p(["tw-w-full tw-bg-primary tw-p-2.5 tw-border tw-border-tertiary tw-overflow-auto", u.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(e.groupedResults, (t) => (r(), n("li", {
39
- key: t.group,
40
- "data-testid": `header-basic-search-results-${t.group}`
41
- }, [
42
- o("h2", B, g(t.group), 1),
43
- o("ol", null, [
44
- (r(!0), n(w, null, c(t.items, (a, b) => {
45
- var d;
46
- return r(), n("li", {
47
- key: a.label
48
- }, [
49
- o("button", {
50
- type: "button",
51
- class: p(["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": a.label === ((d = e.highlighted) == null ? void 0 : d.label) }]),
52
- "data-testid": `header-basic-search-result-item-${t.group}-${b}`,
53
- onMousedown: s[0] || (s[0] = l(() => {
54
- }, ["prevent"])),
55
- onClick: (E) => e.runSearch(a)
56
- }, [
57
- o("span", {
58
- innerHTML: e.formatResult(a)
59
- }, null, 8, C)
60
- ], 42, I)
61
- ]);
62
- }), 128))
63
- ])
64
- ], 8, x))), 128))
65
- ], 2), [
66
- [S, e.showResults]
67
- ])
68
- ], 32);
69
- }
70
- const z = /* @__PURE__ */ k(h, [["render", D]]);
71
- export {
72
- z as default
73
- };
@@ -1,90 +0,0 @@
1
- import { inject as x, ref as m, toRef as h, computed as l } from "vue";
2
- import { mdiMagnify as B } from "@mdi/js";
3
- import A from "../KvTextInput.js";
4
- import D from "../../utils/markMatches.js";
5
- import { useTypeaheadSearch as O } from "../../utils/useTypeaheadSearch.js";
6
- const $ = {
7
- name: "SearchBar",
8
- components: { KvTextInput: A },
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
- * 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"
28
- }
29
- },
30
- emits: ["load-search-data", "search-submit"],
31
- setup(i, { emit: c }) {
32
- const v = x("$kvTrackEvent", () => {
33
- }), n = m(!1), f = m(!1), {
34
- term: t,
35
- groupedResults: r,
36
- activeIndex: a,
37
- resolveSubmit: d
38
- } = O(h(i, "searchSuggestions"), h(i, "appOrigin")), o = l(() => r.value.flatMap((e) => e.items)), u = l(() => a.value > -1 ? o.value[a.value] : void 0), g = l(() => {
39
- var e;
40
- return ((e = u.value) == null ? void 0 : e.label) ?? t.value;
41
- }), y = l(() => r.value.length > 0 && n.value);
42
- function S(e) {
43
- t.value = e;
44
- }
45
- function b() {
46
- n.value = !0, f.value || (c("load-search-data"), f.value = !0), v("search", "focus");
47
- }
48
- function w() {
49
- n.value = !1, a.value = -1;
50
- }
51
- function s(e) {
52
- const p = d(e);
53
- v("search", "click", p.suggestion ? "type-ahead-search" : "custom-search-option"), c("search-submit", p);
54
- }
55
- function I(e) {
56
- s(e);
57
- }
58
- function R() {
59
- u.value ? s(u.value) : s(t.value);
60
- }
61
- function k() {
62
- a.value += 1, a.value >= o.value.length && (a.value = -1);
63
- }
64
- function M() {
65
- a.value === -1 && (a.value = o.value.length), a.value -= 1;
66
- }
67
- function T(e) {
68
- return D(e.label, e.matches);
69
- }
70
- return {
71
- mdiMagnify: B,
72
- term: t,
73
- displayTerm: g,
74
- groupedResults: r,
75
- highlighted: u,
76
- showResults: y,
77
- onInput: S,
78
- onFocus: b,
79
- onBlur: w,
80
- onSubmit: R,
81
- runSearch: I,
82
- listUp: M,
83
- listDown: k,
84
- formatResult: T
85
- };
86
- }
87
- };
88
- export {
89
- $ as default
90
- };