@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
|
|
2
|
-
import { toRefs as
|
|
3
|
-
import
|
|
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
|
|
6
|
-
import { indexIn as
|
|
7
|
-
import { groupBy as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
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:
|
|
11
|
+
KvLendListMenu: I,
|
|
12
12
|
KvLendMegaMenu: O,
|
|
13
|
-
MobileLendMenu:
|
|
14
|
-
KvPageContainer:
|
|
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(
|
|
55
|
+
setup(C, { emit: h }) {
|
|
56
56
|
const {
|
|
57
|
-
userId:
|
|
58
|
-
} =
|
|
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
|
-
],
|
|
68
|
-
var o,
|
|
69
|
-
if (
|
|
70
|
-
query:
|
|
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
|
|
86
|
-
|
|
85
|
+
var u;
|
|
86
|
+
m.value = ((u = e == null ? void 0 : e.lend) == null ? void 0 : u.countryFacets) ?? [], p.value = !1;
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
89
|
-
query:
|
|
88
|
+
}), n.watchQuery({
|
|
89
|
+
query: i`
|
|
90
90
|
query lendMenuData {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
105
|
-
c.value = ((
|
|
105
|
+
var u;
|
|
106
|
+
c.value = ((u = e == null ? void 0 : e.browsingCategories) == null ? void 0 : u.values) ?? [], f.value = !1;
|
|
106
107
|
}
|
|
107
|
-
}),
|
|
108
|
-
const { data: e } = await
|
|
109
|
-
query:
|
|
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:
|
|
131
|
+
userId: l.value
|
|
131
132
|
},
|
|
132
133
|
fetchPolicy: "network-only"
|
|
133
134
|
});
|
|
134
|
-
|
|
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
|
-
},
|
|
137
|
-
const
|
|
138
|
-
name:
|
|
139
|
-
region:
|
|
140
|
-
isoCode:
|
|
141
|
-
count:
|
|
142
|
-
})), o =
|
|
143
|
-
for (const [
|
|
144
|
-
|
|
145
|
-
name:
|
|
146
|
-
countries:
|
|
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
|
|
149
|
-
}),
|
|
149
|
+
return r.sort(F(M, "name"));
|
|
150
|
+
}), S = g(() => {
|
|
150
151
|
var o;
|
|
151
|
-
return ((o = c.value) == null ? void 0 : o.map((
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
})).sort(
|
|
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
|
-
|
|
158
|
+
h("load-lend-menu-data");
|
|
158
159
|
}), {
|
|
159
|
-
onLoad:
|
|
160
|
-
regions:
|
|
161
|
-
computedCategories:
|
|
160
|
+
onLoad: b,
|
|
161
|
+
regions: L,
|
|
162
|
+
computedCategories: S,
|
|
162
163
|
isChannelsLoading: f,
|
|
163
|
-
isRegionsLoading:
|
|
164
|
-
savedSearches:
|
|
165
|
-
favoritesCount:
|
|
164
|
+
isRegionsLoading: p,
|
|
165
|
+
savedSearches: y,
|
|
166
|
+
favoritesCount: d
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
169
|
};
|
|
169
170
|
export {
|
|
170
|
-
|
|
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
|
+
"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": "
|
|
116
|
+
"gitHead": "ff6bd8a622403e32383ffb2d903bf850af5a70e7"
|
|
117
117
|
}
|