@kiva/kv-components 9.0.3 → 9.1.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,17 +1,17 @@
1
- import { gql as l } from "@apollo/client/core";
2
- import { toRefs as I, ref as s, computed as v, onMounted as w } from "vue";
3
- import A from "./KvLendListMenu.js";
1
+ import { gql as i } from "@apollo/client/core";
2
+ import { toRefs as q, ref as s, computed as g, onMounted as w } from "vue";
3
+ import I from "./KvLendListMenu.js";
4
4
  import O from "./KvLendMegaMenu.js";
5
- import F from "../../KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js";
6
- import { indexIn as N } from "../../../utils/comparators.js";
7
- import { groupBy as x, sortBy as C } from "../../../utils/arrayUtils.js";
8
- import B from "../../KvPageContainer.js";
9
- const U = {
5
+ import A from "../../KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js";
6
+ import { indexIn as F } from "../../../utils/comparators.js";
7
+ import { groupBy as N, sortBy as v } from "../../../utils/arrayUtils.js";
8
+ import x from "../../KvPageContainer.js";
9
+ const Q = {
10
10
  components: {
11
- KvLendListMenu: A,
11
+ KvLendListMenu: I,
12
12
  KvLendMegaMenu: O,
13
- MobileLendMenu: F,
14
- KvPageContainer: B
13
+ MobileLendMenu: A,
14
+ KvPageContainer: x
15
15
  },
16
16
  props: {
17
17
  userId: {
@@ -52,10 +52,10 @@ const U = {
52
52
  }
53
53
  },
54
54
  emits: ["load-lend-menu-data", "load-search-data", "search-submit"],
55
- setup(h, { emit: M }) {
55
+ setup(C, { emit: h }) {
56
56
  const {
57
- userId: i
58
- } = I(h), c = s([]), d = s([]), m = s(0), p = s([]), b = [
57
+ userId: l
58
+ } = q(C), c = s([]), m = s([]), d = s(0), y = s([]), M = [
59
59
  "North America",
60
60
  "Central America",
61
61
  "South America",
@@ -64,10 +64,10 @@ const U = {
64
64
  "Middle East",
65
65
  "Asia",
66
66
  "Oceania"
67
- ], y = s(!0), f = s(!0), L = async (r) => {
68
- var o, t, n, u;
69
- if (r.watchQuery({
70
- query: l`query countryFacets {
67
+ ], p = s(!0), f = s(!0), b = async (n) => {
68
+ var o, r, t, a;
69
+ if (n.watchQuery({
70
+ query: i`query countryFacets {
71
71
  lend {
72
72
  countryFacets {
73
73
  count
@@ -82,31 +82,32 @@ const U = {
82
82
  }`
83
83
  }).subscribe({
84
84
  next: ({ data: e }) => {
85
- var a;
86
- d.value = ((a = e == null ? void 0 : e.lend) == null ? void 0 : a.countryFacets) ?? [], y.value = !1;
85
+ var u;
86
+ m.value = ((u = e == null ? void 0 : e.lend) == null ? void 0 : u.countryFacets) ?? [], p.value = !1;
87
87
  }
88
- }), r.watchQuery({
89
- query: l`
88
+ }), n.watchQuery({
89
+ query: i`
90
90
  query lendMenuData {
91
- lend {
92
- loanChannels(popular: true, applyMinLoanCount: true, limit: 50) {
93
- values {
94
- id
95
- name
96
- url
97
- }
91
+ browsingCategories(
92
+ filters: { popularOnly: true, applyMinimumLoanCount: true }
93
+ limit: 50
94
+ ) {
95
+ values {
96
+ id
97
+ name
98
+ url
98
99
  }
99
100
  }
100
101
  }
101
102
  `
102
103
  }).subscribe({
103
104
  next: ({ data: e }) => {
104
- var a, g;
105
- c.value = ((g = (a = e == null ? void 0 : e.lend) == null ? void 0 : a.loanChannels) == null ? void 0 : g.values) ?? [], f.value = !1;
105
+ var u;
106
+ c.value = ((u = e == null ? void 0 : e.browsingCategories) == null ? void 0 : u.values) ?? [], f.value = !1;
106
107
  }
107
- }), i.value) {
108
- const { data: e } = await r.query({
109
- query: l`
108
+ }), l.value) {
109
+ const { data: e } = await n.query({
110
+ query: i`
110
111
  query lendMenuPrivateData($userId: Int!) {
111
112
  lend {
112
113
  loans(limit: 1, filters: {
@@ -127,45 +128,45 @@ const U = {
127
128
  }
128
129
  `,
129
130
  variables: {
130
- userId: i.value
131
+ userId: l.value
131
132
  },
132
133
  fetchPolicy: "network-only"
133
134
  });
134
- m.value = ((t = (o = e == null ? void 0 : e.lend) == null ? void 0 : o.loans) == null ? void 0 : t.totalCount) ?? 0, p.value = ((u = (n = e == null ? void 0 : e.my) == null ? void 0 : n.savedSearches) == null ? void 0 : u.values) ?? [];
135
+ d.value = ((r = (o = e == null ? void 0 : e.lend) == null ? void 0 : o.loans) == null ? void 0 : r.totalCount) ?? 0, y.value = ((a = (t = e == null ? void 0 : e.my) == null ? void 0 : t.savedSearches) == null ? void 0 : a.values) ?? [];
135
136
  }
136
- }, S = v(() => {
137
- const r = d.value.map((n) => ({
138
- name: n.country.name,
139
- region: n.country.region,
140
- isoCode: n.country.isoCode.toLowerCase(),
141
- count: n.count || 0
142
- })), o = x(r, "region"), t = [];
143
- for (const [n, u] of Object.entries(o))
144
- t.push({
145
- name: n,
146
- countries: u.sort(C("name"))
137
+ }, L = g(() => {
138
+ const n = m.value.map((t) => ({
139
+ name: t.country.name,
140
+ region: t.country.region,
141
+ isoCode: t.country.isoCode.toLowerCase(),
142
+ count: t.count || 0
143
+ })), o = N(n, "region"), r = [];
144
+ for (const [t, a] of Object.entries(o))
145
+ r.push({
146
+ name: t,
147
+ countries: a.sort(v("name"))
147
148
  });
148
- return t.sort(N(b, "name"));
149
- }), q = v(() => {
149
+ return r.sort(F(M, "name"));
150
+ }), S = g(() => {
150
151
  var o;
151
- return ((o = c.value) == null ? void 0 : o.map((t) => {
152
- const n = JSON.parse(JSON.stringify(t));
153
- return n.url = n.url.replace("lend", "lend-by-category"), n;
154
- })).sort(C("name"));
152
+ return ((o = c.value) == null ? void 0 : o.map((r) => {
153
+ const t = JSON.parse(JSON.stringify(r));
154
+ return t.url = t.url.replace("lend", "lend-by-category"), t;
155
+ })).sort(v("name"));
155
156
  });
156
157
  return w(() => {
157
- M("load-lend-menu-data");
158
+ h("load-lend-menu-data");
158
159
  }), {
159
- onLoad: L,
160
- regions: S,
161
- computedCategories: q,
160
+ onLoad: b,
161
+ regions: L,
162
+ computedCategories: S,
162
163
  isChannelsLoading: f,
163
- isRegionsLoading: y,
164
- savedSearches: p,
165
- favoritesCount: m
164
+ isRegionsLoading: p,
165
+ savedSearches: y,
166
+ favoritesCount: d
166
167
  };
167
168
  }
168
169
  };
169
170
  export {
170
- U as default
171
+ Q as default
171
172
  };
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.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": "34383a223296d1dd68ac2bdb3828ee89a2d7b23d"
116
+ "gitHead": "ff6bd8a622403e32383ffb2d903bf850af5a70e7"
117
117
  }