@kiva/kv-components 6.52.8 → 6.52.10

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,16 +1,16 @@
1
1
  import { gql as f } from "@apollo/client/core";
2
- import { toRefs as q, ref as i, computed as w, onMounted as S, resolveComponent as h, openBlock as x, createBlock as A, withCtx as B, createVNode as k } from "vue";
3
- import F from "./KvLendListMenu.js";
4
- import N from "./KvLendMegaMenu.js";
5
- import { indexIn as O } from "../../../utils/comparators.js";
6
- import { groupBy as R, sortBy as L } from "../../../utils/arrayUtils.js";
7
- import K from "../../KvPageContainer.js";
8
- import D from "../../../_virtual/_plugin-vue_export-helper.js";
9
- const E = {
2
+ import { toRefs as S, ref as a, computed as L, onMounted as q, resolveComponent as h, openBlock as N, createBlock as x, withCtx as U, createVNode as w } from "vue";
3
+ import A from "./KvLendListMenu.js";
4
+ import B from "./KvLendMegaMenu.js";
5
+ import { indexIn as F } from "../../../utils/comparators.js";
6
+ import { groupBy as O, sortBy as k } from "../../../utils/arrayUtils.js";
7
+ import R from "../../KvPageContainer.js";
8
+ import K from "../../../_virtual/_plugin-vue_export-helper.js";
9
+ const D = {
10
10
  components: {
11
- KvLendListMenu: F,
12
- KvLendMegaMenu: N,
13
- KvPageContainer: K
11
+ KvLendListMenu: A,
12
+ KvLendMegaMenu: B,
13
+ KvPageContainer: R
14
14
  },
15
15
  props: {
16
16
  userId: {
@@ -20,13 +20,17 @@ const E = {
20
20
  showMGUpsellLink: {
21
21
  type: Boolean,
22
22
  default: !1
23
+ },
24
+ countriesNotLentToUrl: {
25
+ type: String,
26
+ default: "/lend/countries-not-lent"
23
27
  }
24
28
  },
25
29
  emits: ["load-lend-menu-data"],
26
- setup(p, { emit: y }) {
30
+ setup(y, { emit: p }) {
27
31
  const {
28
32
  userId: s
29
- } = q(p), e = i([]), g = i([]), m = i(0), c = i([]), v = [
33
+ } = S(y), e = a([]), g = a([]), m = a(0), u = a([]), v = [
30
34
  "North America",
31
35
  "Central America",
32
36
  "South America",
@@ -35,9 +39,9 @@ const E = {
35
39
  "Middle East",
36
40
  "Asia",
37
41
  "Oceania"
38
- ], u = i(!0), C = i(!0), M = async (a) => {
39
- var r, t, o, d;
40
- if (a.watchQuery({
42
+ ], c = a(!0), C = a(!0), M = async (i) => {
43
+ var t, r, o, d;
44
+ if (i.watchQuery({
41
45
  query: f`query countryFacets {
42
46
  lend {
43
47
  countryFacets {
@@ -54,9 +58,9 @@ const E = {
54
58
  }).subscribe({
55
59
  next: ({ data: n }) => {
56
60
  var l;
57
- g.value = ((l = n == null ? void 0 : n.lend) == null ? void 0 : l.countryFacets) ?? [], u.value = !1;
61
+ g.value = ((l = n == null ? void 0 : n.lend) == null ? void 0 : l.countryFacets) ?? [], c.value = !1;
58
62
  }
59
- }), a.watchQuery({
63
+ }), i.watchQuery({
60
64
  query: f`
61
65
  query lendMenuData {
62
66
  lend {
@@ -76,7 +80,7 @@ const E = {
76
80
  e.value = ((_ = (l = n == null ? void 0 : n.lend) == null ? void 0 : l.loanChannels) == null ? void 0 : _.values) ?? [], C.value = !1;
77
81
  }
78
82
  }), s.value) {
79
- const { data: n } = await a.query({
83
+ const { data: n } = await i.query({
80
84
  query: f`
81
85
  query lendMenuPrivateData($userId: Int!) {
82
86
  lend {
@@ -102,46 +106,46 @@ const E = {
102
106
  },
103
107
  fetchPolicy: "network-only"
104
108
  });
105
- m.value = ((t = (r = n == null ? void 0 : n.lend) == null ? void 0 : r.loans) == null ? void 0 : t.totalCount) ?? 0, c.value = ((d = (o = n == null ? void 0 : n.my) == null ? void 0 : o.savedSearches) == null ? void 0 : d.values) ?? [];
109
+ m.value = ((r = (t = n == null ? void 0 : n.lend) == null ? void 0 : t.loans) == null ? void 0 : r.totalCount) ?? 0, u.value = ((d = (o = n == null ? void 0 : n.my) == null ? void 0 : o.savedSearches) == null ? void 0 : d.values) ?? [];
106
110
  }
107
- }, b = w(() => {
108
- const a = g.value.map((o) => ({
111
+ }, b = L(() => {
112
+ const i = g.value.map((o) => ({
109
113
  name: o.country.name,
110
114
  region: o.country.region,
111
115
  isoCode: o.country.isoCode.toLowerCase(),
112
116
  count: o.count || 0
113
- })), r = R(a, "region"), t = [];
114
- for (const [o, d] of Object.entries(r))
115
- t.push({
117
+ })), t = O(i, "region"), r = [];
118
+ for (const [o, d] of Object.entries(t))
119
+ r.push({
116
120
  name: o,
117
- countries: d.sort(L("name"))
121
+ countries: d.sort(k("name"))
118
122
  });
119
- return t.sort(O(v, "name"));
120
- }), I = w(() => {
121
- var r;
122
- return ((r = e.value) == null ? void 0 : r.map((t) => {
123
- const o = JSON.parse(JSON.stringify(t));
123
+ return r.sort(F(v, "name"));
124
+ }), I = L(() => {
125
+ var t;
126
+ return ((t = e.value) == null ? void 0 : t.map((r) => {
127
+ const o = JSON.parse(JSON.stringify(r));
124
128
  return o.url = o.url.replace("lend", "lend-by-category"), o;
125
- })).sort(L("name"));
129
+ })).sort(k("name"));
126
130
  });
127
- return S(() => {
128
- y("load-lend-menu-data");
131
+ return q(() => {
132
+ p("load-lend-menu-data");
129
133
  }), {
130
134
  onLoad: M,
131
135
  regions: b,
132
136
  computedCategories: I,
133
137
  isChannelsLoading: C,
134
- isRegionsLoading: u,
135
- savedSearches: c,
138
+ isRegionsLoading: c,
139
+ savedSearches: u,
136
140
  favoritesCount: m
137
141
  };
138
142
  }
139
143
  };
140
- function G(p, y, s, e, g, m) {
141
- const c = h("kv-lend-list-menu"), v = h("kv-lend-mega-menu"), u = h("kv-page-container");
142
- return x(), A(u, { class: "tw-pt-2 lg:tw-pt-0" }, {
143
- default: B(() => [
144
- k(c, {
144
+ function E(y, p, s, e, g, m) {
145
+ const u = h("kv-lend-list-menu"), v = h("kv-lend-mega-menu"), c = h("kv-page-container");
146
+ return N(), x(c, { class: "tw-pt-2 lg:tw-pt-0" }, {
147
+ default: U(() => [
148
+ w(u, {
145
149
  class: "lg:tw-hidden",
146
150
  categories: e.computedCategories,
147
151
  regions: e.regions,
@@ -150,9 +154,10 @@ function G(p, y, s, e, g, m) {
150
154
  searches: e.savedSearches,
151
155
  "is-regions-loading": e.isRegionsLoading,
152
156
  "is-channels-loading": e.isChannelsLoading,
153
- "show-m-g-upsell-link": s.showMGUpsellLink
154
- }, null, 8, ["categories", "regions", "user-id", "favorites", "searches", "is-regions-loading", "is-channels-loading", "show-m-g-upsell-link"]),
155
- k(v, {
157
+ "show-m-g-upsell-link": s.showMGUpsellLink,
158
+ "countries-not-lent-to-url": s.countriesNotLentToUrl
159
+ }, null, 8, ["categories", "regions", "user-id", "favorites", "searches", "is-regions-loading", "is-channels-loading", "show-m-g-upsell-link", "countries-not-lent-to-url"]),
160
+ w(v, {
156
161
  class: "tw-hidden lg:tw-block",
157
162
  categories: e.computedCategories,
158
163
  regions: e.regions,
@@ -161,13 +166,14 @@ function G(p, y, s, e, g, m) {
161
166
  searches: e.savedSearches,
162
167
  "is-regions-loading": e.isRegionsLoading,
163
168
  "is-channels-loading": e.isChannelsLoading,
164
- "show-m-g-upsell-link": s.showMGUpsellLink
165
- }, null, 8, ["categories", "regions", "user-id", "favorites", "searches", "is-regions-loading", "is-channels-loading", "show-m-g-upsell-link"])
169
+ "show-m-g-upsell-link": s.showMGUpsellLink,
170
+ "countries-not-lent-to-url": s.countriesNotLentToUrl
171
+ }, null, 8, ["categories", "regions", "user-id", "favorites", "searches", "is-regions-loading", "is-channels-loading", "show-m-g-upsell-link", "countries-not-lent-to-url"])
166
172
  ]),
167
173
  _: 1
168
174
  });
169
175
  }
170
- const T = /* @__PURE__ */ D(E, [["render", G]]);
176
+ const H = /* @__PURE__ */ K(D, [["render", E]]);
171
177
  export {
172
- T as default
178
+ H as default
173
179
  };
@@ -1 +1 @@
1
- .header-fade-enter-active[data-v-87116c5e]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-87116c5e]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-87116c5e],.header-fade-leave-to[data-v-87116c5e]{opacity:0}.header-fade-leave[data-v-87116c5e],.header-fade-enter-to[data-v-87116c5e]{opacity:1}.bg-opacity-50[data-v-87116c5e]{background-color:rgba(var(--bg-action-highlight),.5)}
1
+ .header-fade-enter-active[data-v-c1223ffa]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-c1223ffa]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-c1223ffa],.header-fade-leave-to[data-v-c1223ffa]{opacity:0}.header-fade-leave[data-v-c1223ffa],.header-fade-enter-to[data-v-c1223ffa]{opacity:1}.bg-opacity-50[data-v-c1223ffa]{background-color:rgba(var(--bg-action-highlight),.5)}
@@ -1,5 +1,5 @@
1
- import { ref as l, shallowRef as D, computed as B, onMounted as U, onBeforeUnmount as x, resolveComponent as f, resolveDirective as N, openBlock as w, createBlock as M, withCtx as g, createElementVNode as k, normalizeStyle as _, createVNode as d, Transition as I, withDirectives as h, vShow as E, createElementBlock as A, normalizeClass as G, resolveDynamicComponent as K } from "vue";
2
- import S from "@kiva/kv-tokens";
1
+ import { ref as l, shallowRef as D, computed as U, onMounted as B, onBeforeUnmount as N, resolveComponent as f, resolveDirective as x, openBlock as w, createBlock as M, withCtx as g, createElementVNode as k, normalizeStyle as _, createVNode as d, Transition as I, withDirectives as h, vShow as E, createElementBlock as A, normalizeClass as S, resolveDynamicComponent as G } from "vue";
2
+ import K from "@kiva/kv-tokens";
3
3
  import z from "./KvWwwHeader/KvHeaderLinkBar.js";
4
4
  import R from "./KvWwwHeader/KvHeaderLogo.js";
5
5
  import P from "./KvThemeProvider.js";
@@ -58,48 +58,52 @@ const j = "3.75rem", q = {
58
58
  showMGUpsellLink: {
59
59
  type: Boolean,
60
60
  default: !1
61
+ },
62
+ countriesNotLentToUrl: {
63
+ type: String,
64
+ default: "/lend/countries-not-lent"
61
65
  }
62
66
  },
63
67
  emits: [
64
68
  "load-lend-menu-data"
65
69
  ],
66
- setup(C, { emit: t }) {
67
- const o = l(!0), e = l(null), a = l(!1), i = D(null), r = l(null), s = l({ left: 0, position: "relative" }), u = l(!1);
68
- let v;
69
- const b = B(() => {
70
+ setup(L, { emit: t }) {
71
+ const o = l(!0), e = l(null), r = l(!1), a = D(null), i = l(null), s = l({ left: 0, position: "relative" }), u = l(!1);
72
+ let c;
73
+ const b = U(() => {
70
74
  var m, n;
71
- return ((n = (m = r.value) == null ? void 0 : m.$options) == null ? void 0 : n.name) === "KvHeaderMobileMenu";
72
- }), c = (m, n, H) => {
73
- n ? (clearTimeout(v), i.value !== n && (s.value = { left: 0, position: "relative" }), i.value = n, a.value = !0, H && (s.value = {
74
- ...H,
75
+ return ((n = (m = i.value) == null ? void 0 : m.$options) == null ? void 0 : n.name) === "KvHeaderMobileMenu";
76
+ }), v = (m, n, p) => {
77
+ n ? (clearTimeout(c), a.value !== n && (s.value = { left: 0, position: "relative" }), a.value = n, r.value = !0, p && (s.value = {
78
+ ...p,
75
79
  position: "absolute"
76
- })) : a.value && (v = setTimeout(() => {
77
- a.value = !1, i.value = null;
80
+ })) : r.value && (c = setTimeout(() => {
81
+ r.value = !1, a.value = null;
78
82
  }, 100));
79
- }, L = (m) => {
83
+ }, T = (m) => {
80
84
  var n;
81
- (n = r.value) == null || n.onLoad(m);
82
- }, T = () => {
85
+ (n = i.value) == null || n.onLoad(m);
86
+ }, C = () => {
83
87
  t("load-lend-menu-data");
84
88
  }, y = () => {
85
- u.value = (window == null ? void 0 : window.innerWidth) < S.breakpoints.md;
86
- }, p = O(y, 100);
87
- return U(() => {
88
- y(), window.addEventListener("resize", p);
89
- }), x(() => {
90
- window.removeEventListener("resize", p);
89
+ u.value = (window == null ? void 0 : window.innerWidth) < K.breakpoints.md;
90
+ }, H = O(y, 100);
91
+ return B(() => {
92
+ y(), window.addEventListener("resize", H);
93
+ }), N(() => {
94
+ window.removeEventListener("resize", H);
91
95
  }), {
92
96
  HEADER_HEIGHT: j,
93
- emitLendMenuEvent: T,
97
+ emitLendMenuEvent: C,
94
98
  isMobile: u,
95
99
  linksVisible: o,
96
- menuOpen: a,
100
+ menuOpen: r,
97
101
  isMobileMenuActive: b,
98
- onHover: c,
99
- loadMenuData: L,
102
+ onHover: v,
103
+ loadMenuData: T,
100
104
  activeHeaderItem: e,
101
- menuComponent: i,
102
- menuComponentInstance: r,
105
+ menuComponent: a,
106
+ menuComponentInstance: i,
103
107
  menuPosition: s
104
108
  };
105
109
  }
@@ -107,9 +111,9 @@ const j = "3.75rem", q = {
107
111
  href: "/",
108
112
  class: "tw-px-1 tw-py-2 tw-cursor-pointer tw-absolute tw-top-1/2 tw-left-1/2 tw--translate-y-1/2 tw--translate-x-1/2 tw-transition-all tw-duration-300"
109
113
  };
110
- function J(C, t, o, e, a, i) {
111
- const r = f("kv-header-link-bar"), s = f("kv-header-logo"), u = f("kv-page-container"), v = f("kv-theme-provider"), b = N("kv-track-event");
112
- return w(), M(v, {
114
+ function J(L, t, o, e, r, a) {
115
+ const i = f("kv-header-link-bar"), s = f("kv-header-logo"), u = f("kv-page-container"), c = f("kv-theme-provider"), b = x("kv-track-event");
116
+ return w(), M(c, {
113
117
  tag: "div",
114
118
  class: "tw-bg-primary"
115
119
  }, {
@@ -122,7 +126,7 @@ function J(C, t, o, e, a, i) {
122
126
  default: g(() => [
123
127
  d(I, { name: "header-fade" }, {
124
128
  default: g(() => [
125
- h(d(r, {
129
+ h(d(i, {
126
130
  "logged-in": o.loggedIn,
127
131
  "basket-count": o.basketCount,
128
132
  "login-url": o.loginUrl,
@@ -155,15 +159,15 @@ function J(C, t, o, e, a, i) {
155
159
  style: _({ top: e.HEADER_HEIGHT })
156
160
  }, [
157
161
  k("div", {
158
- class: G(["tw-bg-primary tw-overflow-y-auto", { "tw-min-h-dvh": e.isMobileMenuActive }]),
162
+ class: S(["tw-bg-primary tw-overflow-y-auto", { "tw-min-h-dvh": e.isMobileMenuActive }]),
159
163
  style: _({
160
164
  ...e.menuPosition,
161
165
  maxHeight: e.isMobileMenuActive ? "auto" : `calc(100dvh - ${e.HEADER_HEIGHT})`
162
166
  }),
163
- onMouseover: t[1] || (t[1] = (c) => e.onHover(e.activeHeaderItem, e.menuComponent)),
164
- onMouseout: t[2] || (t[2] = (c) => e.onHover())
167
+ onMouseover: t[1] || (t[1] = (v) => e.onHover(e.activeHeaderItem, e.menuComponent)),
168
+ onMouseout: t[2] || (t[2] = (v) => e.onHover())
165
169
  }, [
166
- (w(), M(K(e.menuComponent), {
170
+ (w(), M(G(e.menuComponent), {
167
171
  ref: "menuComponentInstance",
168
172
  "logged-in": o.loggedIn,
169
173
  "login-url": o.loginUrl,
@@ -173,9 +177,10 @@ function J(C, t, o, e, a, i) {
173
177
  "my-dashboard-url": o.myDashboardUrl,
174
178
  "show-m-g-upsell-link": o.showMGUpsellLink,
175
179
  "is-mobile": e.isMobile,
180
+ "countries-not-lent-to-url": o.countriesNotLentToUrl,
176
181
  onLoadLendMenuData: e.emitLendMenuEvent,
177
- onClosingMenu: t[0] || (t[0] = (c) => e.onHover())
178
- }, null, 40, ["logged-in", "login-url", "user-id", "is-borrower", "is-trustee", "my-dashboard-url", "show-m-g-upsell-link", "is-mobile", "onLoadLendMenuData"]))
182
+ onClosingMenu: t[0] || (t[0] = (v) => e.onHover())
183
+ }, null, 40, ["logged-in", "login-url", "user-id", "is-borrower", "is-trustee", "my-dashboard-url", "show-m-g-upsell-link", "is-mobile", "countries-not-lent-to-url", "onLoadLendMenuData"]))
179
184
  ], 38)
180
185
  ], 4), [
181
186
  [E, e.menuOpen]
@@ -187,7 +192,7 @@ function J(C, t, o, e, a, i) {
187
192
  _: 1
188
193
  });
189
194
  }
190
- const le = /* @__PURE__ */ W(q, [["render", J], ["__scopeId", "data-v-87116c5e"]]);
195
+ const le = /* @__PURE__ */ W(q, [["render", J], ["__scopeId", "data-v-c1223ffa"]]);
191
196
  export {
192
197
  le as default
193
198
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.52.8",
3
+ "version": "6.52.10",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -114,5 +114,5 @@
114
114
  "embla-carousel-fade",
115
115
  "popper.js"
116
116
  ],
117
- "gitHead": "63e6ad5ab416be93564086e4501e6f1828389b0a"
117
+ "gitHead": "f7509c21acb1a45b5556219f4fdfde85e0fc7c9d"
118
118
  }