@kiva/kv-shop 3.8.21 → 3.8.22
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
1
|
import { gql as s } from "@apollo/client/core";
|
|
2
|
-
import { toRefs as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { toRefs as q, ref as n, computed as f, onMounted as w } from "vue";
|
|
3
|
+
import I from "./KvLendListMenu.js";
|
|
4
|
+
import A from "./KvLendMegaMenu.js";
|
|
5
5
|
import O from "../../KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js";
|
|
6
|
-
import { indexIn as
|
|
7
|
-
import { groupBy as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
6
|
+
import { indexIn as N } from "../../../utils/comparators.js";
|
|
7
|
+
import { groupBy as x, sortBy as g } from "../../../utils/arrayUtils.js";
|
|
8
|
+
import B from "../../KvPageContainer.js";
|
|
9
|
+
const k = {
|
|
10
10
|
components: {
|
|
11
|
-
KvLendListMenu:
|
|
12
|
-
KvLendMegaMenu:
|
|
11
|
+
KvLendListMenu: I,
|
|
12
|
+
KvLendMegaMenu: A,
|
|
13
13
|
MobileLendMenu: O,
|
|
14
|
-
KvPageContainer:
|
|
14
|
+
KvPageContainer: B
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
17
|
userId: {
|
|
@@ -52,10 +52,10 @@ const J = {
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
emits: ["load-lend-menu-data", "load-search-data", "search-submit"],
|
|
55
|
-
setup(
|
|
55
|
+
setup(M, { emit: b }) {
|
|
56
56
|
const {
|
|
57
57
|
userId: i
|
|
58
|
-
} =
|
|
58
|
+
} = q(M), d = n([]), c = n([]), m = n(0), v = n([]), h = [
|
|
59
59
|
"North America",
|
|
60
60
|
"Central America",
|
|
61
61
|
"South America",
|
|
@@ -64,9 +64,9 @@ const J = {
|
|
|
64
64
|
"Middle East",
|
|
65
65
|
"Asia",
|
|
66
66
|
"Oceania"
|
|
67
|
-
], p =
|
|
68
|
-
var t, a,
|
|
69
|
-
if (
|
|
67
|
+
], p = n(!0), y = n(!0), C = async (r) => {
|
|
68
|
+
var t, a, o, l;
|
|
69
|
+
if (r.watchQuery({
|
|
70
70
|
query: s`query countryFacets {
|
|
71
71
|
lend {
|
|
72
72
|
countryFacets {
|
|
@@ -85,27 +85,28 @@ const J = {
|
|
|
85
85
|
var u;
|
|
86
86
|
c.value = ((u = e == null ? void 0 : e.lend) == null ? void 0 : u.countryFacets) ?? [], p.value = !1;
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
88
|
+
}), r.watchQuery({
|
|
89
89
|
query: s`
|
|
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 u
|
|
105
|
-
d.value = ((
|
|
105
|
+
var u;
|
|
106
|
+
d.value = ((u = e == null ? void 0 : e.browsingCategories) == null ? void 0 : u.values) ?? [], y.value = !1;
|
|
106
107
|
}
|
|
107
108
|
}), i.value) {
|
|
108
|
-
const { data: e } = await
|
|
109
|
+
const { data: e } = await r.query({
|
|
109
110
|
query: s`
|
|
110
111
|
query lendMenuPrivateData($userId: Int!) {
|
|
111
112
|
lend {
|
|
@@ -131,34 +132,34 @@ const J = {
|
|
|
131
132
|
},
|
|
132
133
|
fetchPolicy: "network-only"
|
|
133
134
|
});
|
|
134
|
-
m.value = ((a = (t = e == null ? void 0 : e.lend) == null ? void 0 : t.loans) == null ? void 0 : a.totalCount) ?? 0, v.value = ((l = (
|
|
135
|
+
m.value = ((a = (t = e == null ? void 0 : e.lend) == null ? void 0 : t.loans) == null ? void 0 : a.totalCount) ?? 0, v.value = ((l = (o = e == null ? void 0 : e.my) == null ? void 0 : o.savedSearches) == null ? void 0 : l.values) ?? [];
|
|
135
136
|
}
|
|
136
|
-
},
|
|
137
|
-
const
|
|
138
|
-
name:
|
|
139
|
-
region:
|
|
140
|
-
isoCode:
|
|
141
|
-
count:
|
|
142
|
-
})), t =
|
|
143
|
-
for (const [
|
|
137
|
+
}, L = f(() => {
|
|
138
|
+
const r = c.value.map((o) => ({
|
|
139
|
+
name: o.country.name,
|
|
140
|
+
region: o.country.region,
|
|
141
|
+
isoCode: o.country.isoCode.toLowerCase(),
|
|
142
|
+
count: o.count || 0
|
|
143
|
+
})), t = x(r, "region"), a = [];
|
|
144
|
+
for (const [o, l] of Object.entries(t))
|
|
144
145
|
a.push({
|
|
145
|
-
name:
|
|
146
|
-
countries: l.sort(
|
|
146
|
+
name: o,
|
|
147
|
+
countries: l.sort(g("name"))
|
|
147
148
|
});
|
|
148
|
-
return a.sort(
|
|
149
|
-
}),
|
|
150
|
-
var
|
|
151
|
-
return ((
|
|
149
|
+
return a.sort(N(h, "name"));
|
|
150
|
+
}), S = f(() => {
|
|
151
|
+
var r;
|
|
152
|
+
return ((r = d.value) == null ? void 0 : r.map((t) => {
|
|
152
153
|
const a = JSON.parse(JSON.stringify(t));
|
|
153
154
|
return a.url = a.url.replace("lend", "lend-by-category"), a;
|
|
154
|
-
})).sort(
|
|
155
|
+
})).sort(g("name"));
|
|
155
156
|
});
|
|
156
157
|
return w(() => {
|
|
157
|
-
|
|
158
|
+
b("load-lend-menu-data");
|
|
158
159
|
}), {
|
|
159
|
-
onLoad:
|
|
160
|
-
regions:
|
|
161
|
-
computedCategories:
|
|
160
|
+
onLoad: C,
|
|
161
|
+
regions: L,
|
|
162
|
+
computedCategories: S,
|
|
162
163
|
isChannelsLoading: y,
|
|
163
164
|
isRegionsLoading: p,
|
|
164
165
|
savedSearches: v,
|
|
@@ -167,5 +168,5 @@ const J = {
|
|
|
167
168
|
}
|
|
168
169
|
};
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
+
k as default
|
|
171
172
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-shop",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@apollo/client": "^3.13.1",
|
|
36
36
|
"@kiva/kv-analytics": "^1.4.0",
|
|
37
|
-
"@kiva/kv-components": "^9.0
|
|
37
|
+
"@kiva/kv-components": "^9.1.0",
|
|
38
38
|
"@kiva/vite-plugin-vue-lib-css": "^2.0.0",
|
|
39
39
|
"@types/braintree-web-drop-in": "^1.39.3",
|
|
40
40
|
"braintree-web-drop-in": "^1.44.1",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"numeral": "2.x",
|
|
50
50
|
"vue": "3.x"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "ff6bd8a622403e32383ffb2d903bf850af5a70e7"
|
|
53
53
|
}
|