vue-instantsearch 4.8.0 → 4.8.2
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.
- package/package.json +3 -3
- package/src/__tests__/common.test.js +20 -0
- package/src/components/HierarchicalMenuList.vue +2 -1
- package/src/components/__tests__/HierarchicalMenu.js +9 -0
- package/src/components/__tests__/__snapshots__/HierarchicalMenu.js.snap +94 -2
- package/vue2/cjs/index.js +1 -1
- package/vue2/cjs/index.js.map +1 -1
- package/vue2/es/package.json.js +1 -1
- package/vue2/es/src/components/HierarchicalMenuList.vue.js +1 -1
- package/vue2/umd/index.js +1 -1
- package/vue2/umd/index.js.map +1 -1
- package/vue3/cjs/index.js +1 -1
- package/vue3/cjs/index.js.map +1 -1
- package/vue3/es/package.json.js +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue.js +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=script&lang.js.map +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=eb2af574&lang.js +2 -0
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=eb2af574&lang.js.map +1 -0
- package/vue3/umd/index.js +1 -1
- package/vue3/umd/index.js.map +1 -1
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=45723c6c&lang.js +0 -2
- package/vue3/es/src/components/HierarchicalMenuList.vue_vue&type=template&id=45723c6c&lang.js.map +0 -1
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"autocomplete"
|
|
17
17
|
],
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"version": "4.8.
|
|
19
|
+
"version": "4.8.2",
|
|
20
20
|
"files": [
|
|
21
21
|
"vue2",
|
|
22
22
|
"vue3",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test:exports:vue3": "node ./test/module/vue3/is-es-module.mjs && node ./test/module/vue3/is-cjs-module.cjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"instantsearch.js": "
|
|
38
|
+
"instantsearch.js": "4.50.2",
|
|
39
39
|
"mitt": "^2.1.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"vuex": "3.5.1",
|
|
86
86
|
"vuex4": "npm:vuex@4.0.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "929c1d782d17a0d743f8a16d8d7e2231534658e7"
|
|
89
89
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
createHierarchicalMenuTests,
|
|
7
7
|
createMenuTests,
|
|
8
8
|
createPaginationTests,
|
|
9
|
+
createInfiniteHitsTests,
|
|
9
10
|
} from '@instantsearch/tests';
|
|
10
11
|
|
|
11
12
|
import { nextTick, mountApp } from '../../test/utils';
|
|
@@ -16,6 +17,8 @@ import {
|
|
|
16
17
|
AisHierarchicalMenu,
|
|
17
18
|
AisMenu,
|
|
18
19
|
AisPagination,
|
|
20
|
+
AisInfiniteHits,
|
|
21
|
+
AisSearchBox,
|
|
19
22
|
createWidgetMixin,
|
|
20
23
|
} from '../instantsearch';
|
|
21
24
|
jest.unmock('instantsearch.js/es');
|
|
@@ -97,3 +100,20 @@ createPaginationTests(async ({ instantSearchOptions, widgetParams }) => {
|
|
|
97
100
|
|
|
98
101
|
await nextTick();
|
|
99
102
|
});
|
|
103
|
+
|
|
104
|
+
createInfiniteHitsTests(async ({ instantSearchOptions, widgetParams }) => {
|
|
105
|
+
mountApp(
|
|
106
|
+
{
|
|
107
|
+
render: renderCompat((h) =>
|
|
108
|
+
h(AisInstantSearch, { props: instantSearchOptions }, [
|
|
109
|
+
h(AisSearchBox),
|
|
110
|
+
h(AisInfiniteHits, { props: widgetParams }),
|
|
111
|
+
h(GlobalErrorSwallower),
|
|
112
|
+
])
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
document.body.appendChild(document.createElement('div'))
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
await nextTick();
|
|
119
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ul
|
|
3
|
+
v-if="items.length > 0"
|
|
3
4
|
:class="[
|
|
4
5
|
suit('list'),
|
|
5
6
|
level > 0 && suit('list', 'child'),
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
:key="item.value"
|
|
12
13
|
:class="[
|
|
13
14
|
suit('item'),
|
|
14
|
-
item.data && suit('item', 'parent'),
|
|
15
|
+
item.data && item.data.length > 0 && suit('item', 'parent'),
|
|
15
16
|
item.isRefined && suit('item', 'selected'),
|
|
16
17
|
]"
|
|
17
18
|
>
|
|
@@ -98,6 +98,14 @@ const microsoft = {
|
|
|
98
98
|
data: null,
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
const google = {
|
|
102
|
+
label: 'Google',
|
|
103
|
+
value: 'Google',
|
|
104
|
+
isRefined: true,
|
|
105
|
+
count: 2,
|
|
106
|
+
data: [],
|
|
107
|
+
};
|
|
108
|
+
|
|
101
109
|
const defaultState = {
|
|
102
110
|
items: [
|
|
103
111
|
{
|
|
@@ -116,6 +124,7 @@ const defaultState = {
|
|
|
116
124
|
data: [galaxy, note],
|
|
117
125
|
},
|
|
118
126
|
microsoft,
|
|
127
|
+
google,
|
|
119
128
|
],
|
|
120
129
|
refine: () => {},
|
|
121
130
|
createURL: () => {},
|
|
@@ -48,6 +48,13 @@ exports[`custom default render renders correctly 1`] = `
|
|
|
48
48
|
Microsoft - 20
|
|
49
49
|
</a>
|
|
50
50
|
</li>
|
|
51
|
+
<li>
|
|
52
|
+
<a>
|
|
53
|
+
Google - 2
|
|
54
|
+
</a>
|
|
55
|
+
<ol>
|
|
56
|
+
</ol>
|
|
57
|
+
</li>
|
|
51
58
|
</ol>
|
|
52
59
|
<button>
|
|
53
60
|
View more
|
|
@@ -104,6 +111,13 @@ exports[`custom default render renders correctly with a disabled show more butto
|
|
|
104
111
|
Microsoft - 20
|
|
105
112
|
</a>
|
|
106
113
|
</li>
|
|
114
|
+
<li>
|
|
115
|
+
<a>
|
|
116
|
+
Google - 2
|
|
117
|
+
</a>
|
|
118
|
+
<ol>
|
|
119
|
+
</ol>
|
|
120
|
+
</li>
|
|
107
121
|
</ol>
|
|
108
122
|
<button disabled="disabled">
|
|
109
123
|
View more
|
|
@@ -160,6 +174,13 @@ exports[`custom default render renders correctly with a limit 1`] = `
|
|
|
160
174
|
Microsoft - 20
|
|
161
175
|
</a>
|
|
162
176
|
</li>
|
|
177
|
+
<li>
|
|
178
|
+
<a>
|
|
179
|
+
Google - 2
|
|
180
|
+
</a>
|
|
181
|
+
<ol>
|
|
182
|
+
</ol>
|
|
183
|
+
</li>
|
|
163
184
|
</ol>
|
|
164
185
|
<button>
|
|
165
186
|
View more
|
|
@@ -216,6 +237,13 @@ exports[`custom default render renders correctly with a show more button toggled
|
|
|
216
237
|
Microsoft - 20
|
|
217
238
|
</a>
|
|
218
239
|
</li>
|
|
240
|
+
<li>
|
|
241
|
+
<a>
|
|
242
|
+
Google - 2
|
|
243
|
+
</a>
|
|
244
|
+
<ol>
|
|
245
|
+
</ol>
|
|
246
|
+
</li>
|
|
219
247
|
</ol>
|
|
220
248
|
<button>
|
|
221
249
|
View more
|
|
@@ -272,6 +300,13 @@ exports[`custom default render renders correctly with a show more button toggled
|
|
|
272
300
|
Microsoft - 20
|
|
273
301
|
</a>
|
|
274
302
|
</li>
|
|
303
|
+
<li>
|
|
304
|
+
<a>
|
|
305
|
+
Google - 2
|
|
306
|
+
</a>
|
|
307
|
+
<ol>
|
|
308
|
+
</ol>
|
|
309
|
+
</li>
|
|
275
310
|
</ol>
|
|
276
311
|
<button>
|
|
277
312
|
View less
|
|
@@ -328,6 +363,13 @@ exports[`custom default render renders correctly with an URL for the href 1`] =
|
|
|
328
363
|
Microsoft - 20
|
|
329
364
|
</a>
|
|
330
365
|
</li>
|
|
366
|
+
<li>
|
|
367
|
+
<a href="/categories/Google">
|
|
368
|
+
Google - 2
|
|
369
|
+
</a>
|
|
370
|
+
<ol>
|
|
371
|
+
</ol>
|
|
372
|
+
</li>
|
|
331
373
|
</ol>
|
|
332
374
|
<button>
|
|
333
375
|
View more
|
|
@@ -467,6 +509,16 @@ exports[`custom showMoreLabel render renders correctly with a custom show more l
|
|
|
467
509
|
</span>
|
|
468
510
|
</a>
|
|
469
511
|
</li>
|
|
512
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
513
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
514
|
+
<span class="ais-HierarchicalMenu-label">
|
|
515
|
+
Google
|
|
516
|
+
</span>
|
|
517
|
+
<span class="ais-HierarchicalMenu-count">
|
|
518
|
+
2
|
|
519
|
+
</span>
|
|
520
|
+
</a>
|
|
521
|
+
</li>
|
|
470
522
|
</ul>
|
|
471
523
|
<button class="ais-HierarchicalMenu-showMore">
|
|
472
524
|
<span>
|
|
@@ -595,6 +647,16 @@ exports[`custom showMoreLabel render renders correctly with a custom show more l
|
|
|
595
647
|
</span>
|
|
596
648
|
</a>
|
|
597
649
|
</li>
|
|
650
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
651
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
652
|
+
<span class="ais-HierarchicalMenu-label">
|
|
653
|
+
Google
|
|
654
|
+
</span>
|
|
655
|
+
<span class="ais-HierarchicalMenu-count">
|
|
656
|
+
2
|
|
657
|
+
</span>
|
|
658
|
+
</a>
|
|
659
|
+
</li>
|
|
598
660
|
</ul>
|
|
599
661
|
<button class="ais-HierarchicalMenu-showMore">
|
|
600
662
|
<span>
|
|
@@ -723,6 +785,16 @@ exports[`default render renders correctly 1`] = `
|
|
|
723
785
|
</span>
|
|
724
786
|
</a>
|
|
725
787
|
</li>
|
|
788
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
789
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
790
|
+
<span class="ais-HierarchicalMenu-label">
|
|
791
|
+
Google
|
|
792
|
+
</span>
|
|
793
|
+
<span class="ais-HierarchicalMenu-count">
|
|
794
|
+
2
|
|
795
|
+
</span>
|
|
796
|
+
</a>
|
|
797
|
+
</li>
|
|
726
798
|
</ul>
|
|
727
799
|
</div>
|
|
728
800
|
`;
|
|
@@ -991,6 +1063,18 @@ exports[`default render renders correctly with a URL for the href 1`] = `
|
|
|
991
1063
|
</span>
|
|
992
1064
|
</a>
|
|
993
1065
|
</li>
|
|
1066
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
1067
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected"
|
|
1068
|
+
href="/categories/Google"
|
|
1069
|
+
>
|
|
1070
|
+
<span class="ais-HierarchicalMenu-label">
|
|
1071
|
+
Google
|
|
1072
|
+
</span>
|
|
1073
|
+
<span class="ais-HierarchicalMenu-count">
|
|
1074
|
+
2
|
|
1075
|
+
</span>
|
|
1076
|
+
</a>
|
|
1077
|
+
</li>
|
|
994
1078
|
</ul>
|
|
995
1079
|
</div>
|
|
996
1080
|
`;
|
|
@@ -1114,6 +1198,16 @@ exports[`default render renders correctly with show more disabled 1`] = `
|
|
|
1114
1198
|
</span>
|
|
1115
1199
|
</a>
|
|
1116
1200
|
</li>
|
|
1201
|
+
<li class="ais-HierarchicalMenu-item ais-HierarchicalMenu-item--selected">
|
|
1202
|
+
<a class="ais-HierarchicalMenu-link ais-HierarchicalMenu-link--selected">
|
|
1203
|
+
<span class="ais-HierarchicalMenu-label">
|
|
1204
|
+
Google
|
|
1205
|
+
</span>
|
|
1206
|
+
<span class="ais-HierarchicalMenu-count">
|
|
1207
|
+
2
|
|
1208
|
+
</span>
|
|
1209
|
+
</a>
|
|
1210
|
+
</li>
|
|
1117
1211
|
</ul>
|
|
1118
1212
|
<button class="ais-HierarchicalMenu-showMore ais-HierarchicalMenu-showMore--disabled"
|
|
1119
1213
|
disabled="disabled"
|
|
@@ -1137,7 +1231,5 @@ exports[`default render renders correctly with show more label toggled 1`] = `
|
|
|
1137
1231
|
|
|
1138
1232
|
exports[`default render renders correctly without refinement 1`] = `
|
|
1139
1233
|
<div class="ais-HierarchicalMenu ais-HierarchicalMenu--noRefinement">
|
|
1140
|
-
<ul class="ais-HierarchicalMenu-list ais-HierarchicalMenu-list--lvl0">
|
|
1141
|
-
</ul>
|
|
1142
1234
|
</div>
|
|
1143
1235
|
`;
|