vue-instantsearch 4.17.0 → 4.17.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.
Files changed (40) hide show
  1. package/package.json +5 -5
  2. package/src/__tests__/common-widgets.test.js +3 -0
  3. package/src/components/Hits.js +2 -5
  4. package/src/components/InfiniteHits.vue +2 -7
  5. package/src/components/RatingMenu.vue +36 -34
  6. package/src/components/__tests__/Hits.js +1 -1
  7. package/src/components/__tests__/InfiniteHits.js +1 -168
  8. package/src/components/__tests__/RatingMenu.js +0 -117
  9. package/src/components/__tests__/__snapshots__/InfiniteHits.js.snap +0 -110
  10. package/vue2/cjs/index.js +1 -1
  11. package/vue2/cjs/index.js.map +1 -1
  12. package/vue2/es/package.json.js +1 -1
  13. package/vue2/es/src/components/Hits.js +1 -1
  14. package/vue2/es/src/components/Hits.js.map +1 -1
  15. package/vue2/es/src/components/InfiniteHits.vue.js +1 -1
  16. package/vue2/es/src/components/InfiniteHits.vue_rollup-plugin-vue=script.js +1 -1
  17. package/vue2/es/src/components/RatingMenu.vue.js +1 -1
  18. package/vue2/umd/index.js +1 -1
  19. package/vue2/umd/index.js.map +1 -1
  20. package/vue3/cjs/index.js +1 -1
  21. package/vue3/cjs/index.js.map +1 -1
  22. package/vue3/es/package.json.js +1 -1
  23. package/vue3/es/src/components/Hits.js +1 -1
  24. package/vue3/es/src/components/Hits.js.map +1 -1
  25. package/vue3/es/src/components/InfiniteHits.vue.js +1 -1
  26. package/vue3/es/src/components/InfiniteHits.vue_vue&type=script&lang.js +1 -1
  27. package/vue3/es/src/components/InfiniteHits.vue_vue&type=script&lang.js.map +1 -1
  28. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=1b2a109e&lang.js +2 -0
  29. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=1b2a109e&lang.js.map +1 -0
  30. package/vue3/es/src/components/RatingMenu.vue.js +1 -1
  31. package/vue3/es/src/components/RatingMenu.vue_vue&type=script&lang.js.map +1 -1
  32. package/vue3/es/src/components/RatingMenu.vue_vue&type=template&id=c025dd38&lang.js +2 -0
  33. package/vue3/es/src/components/RatingMenu.vue_vue&type=template&id=c025dd38&lang.js.map +1 -0
  34. package/vue3/umd/index.js +1 -1
  35. package/vue3/umd/index.js.map +1 -1
  36. package/src/components/__tests__/__snapshots__/RatingMenu.js.snap +0 -487
  37. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=39939af3&lang.js +0 -2
  38. package/vue3/es/src/components/InfiniteHits.vue_vue&type=template&id=39939af3&lang.js.map +0 -1
  39. package/vue3/es/src/components/RatingMenu.vue_vue&type=template&id=6effe1ff&lang.js +0 -2
  40. package/vue3/es/src/components/RatingMenu.vue_vue&type=template&id=6effe1ff&lang.js.map +0 -1
@@ -1,487 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`renders correctly 1`] = `
4
- <div class="ais-RatingMenu">
5
- <svg style="display: none;"
6
- xmlns="http://www.w3.org/2000/svg"
7
- >
8
- <symbol id="ais-RatingMenu-starSymbol"
9
- viewbox="0 0 24 24"
10
- >
11
- <path d="M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z">
12
- </path>
13
- </symbol>
14
- <symbol id="ais-RatingMenu-starEmptySymbol"
15
- viewbox="0 0 24 24"
16
- >
17
- <path d="M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z">
18
- </path>
19
- </symbol>
20
- </svg>
21
- <ul class="ais-RatingMenu-list">
22
- <li class="ais-RatingMenu-item">
23
- <a aria-label="1 &amp; Up"
24
- class="ais-RatingMenu-link"
25
- href="#"
26
- >
27
- <svg aria-hidden="true"
28
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
29
- height="24"
30
- width="24"
31
- >
32
- <use xlink:href="#ais-RatingMenu-starSymbol">
33
- </use>
34
- </svg>
35
- <svg aria-hidden="true"
36
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
37
- height="24"
38
- width="24"
39
- >
40
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
41
- </use>
42
- </svg>
43
- <svg aria-hidden="true"
44
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
45
- height="24"
46
- width="24"
47
- >
48
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
49
- </use>
50
- </svg>
51
- <svg aria-hidden="true"
52
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
53
- height="24"
54
- width="24"
55
- >
56
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
57
- </use>
58
- </svg>
59
- <svg aria-hidden="true"
60
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
61
- height="24"
62
- width="24"
63
- >
64
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
65
- </use>
66
- </svg>
67
- <span aria-hidden="true"
68
- class="ais-RatingMenu-label"
69
- >
70
- &amp; Up
71
- </span>
72
- <span class="ais-RatingMenu-count">
73
- 20
74
- </span>
75
- </a>
76
- </li>
77
- <li class="ais-RatingMenu-item">
78
- <a aria-label="2 &amp; Up"
79
- class="ais-RatingMenu-link"
80
- href="#"
81
- >
82
- <svg aria-hidden="true"
83
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
84
- height="24"
85
- width="24"
86
- >
87
- <use xlink:href="#ais-RatingMenu-starSymbol">
88
- </use>
89
- </svg>
90
- <svg aria-hidden="true"
91
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
92
- height="24"
93
- width="24"
94
- >
95
- <use xlink:href="#ais-RatingMenu-starSymbol">
96
- </use>
97
- </svg>
98
- <svg aria-hidden="true"
99
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
100
- height="24"
101
- width="24"
102
- >
103
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
104
- </use>
105
- </svg>
106
- <svg aria-hidden="true"
107
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
108
- height="24"
109
- width="24"
110
- >
111
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
112
- </use>
113
- </svg>
114
- <svg aria-hidden="true"
115
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
116
- height="24"
117
- width="24"
118
- >
119
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
120
- </use>
121
- </svg>
122
- <span aria-hidden="true"
123
- class="ais-RatingMenu-label"
124
- >
125
- &amp; Up
126
- </span>
127
- <span class="ais-RatingMenu-count">
128
- 3
129
- </span>
130
- </a>
131
- </li>
132
- <li class="ais-RatingMenu-item">
133
- <a aria-label="3 &amp; Up"
134
- class="ais-RatingMenu-link"
135
- href="#"
136
- >
137
- <svg aria-hidden="true"
138
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
139
- height="24"
140
- width="24"
141
- >
142
- <use xlink:href="#ais-RatingMenu-starSymbol">
143
- </use>
144
- </svg>
145
- <svg aria-hidden="true"
146
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
147
- height="24"
148
- width="24"
149
- >
150
- <use xlink:href="#ais-RatingMenu-starSymbol">
151
- </use>
152
- </svg>
153
- <svg aria-hidden="true"
154
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
155
- height="24"
156
- width="24"
157
- >
158
- <use xlink:href="#ais-RatingMenu-starSymbol">
159
- </use>
160
- </svg>
161
- <svg aria-hidden="true"
162
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
163
- height="24"
164
- width="24"
165
- >
166
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
167
- </use>
168
- </svg>
169
- <svg aria-hidden="true"
170
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
171
- height="24"
172
- width="24"
173
- >
174
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
175
- </use>
176
- </svg>
177
- <span aria-hidden="true"
178
- class="ais-RatingMenu-label"
179
- >
180
- &amp; Up
181
- </span>
182
- <span class="ais-RatingMenu-count">
183
- 2000
184
- </span>
185
- </a>
186
- </li>
187
- <li class="ais-RatingMenu-item">
188
- <a aria-label="4 &amp; Up"
189
- class="ais-RatingMenu-link"
190
- href="#"
191
- >
192
- <svg aria-hidden="true"
193
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
194
- height="24"
195
- width="24"
196
- >
197
- <use xlink:href="#ais-RatingMenu-starSymbol">
198
- </use>
199
- </svg>
200
- <svg aria-hidden="true"
201
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
202
- height="24"
203
- width="24"
204
- >
205
- <use xlink:href="#ais-RatingMenu-starSymbol">
206
- </use>
207
- </svg>
208
- <svg aria-hidden="true"
209
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
210
- height="24"
211
- width="24"
212
- >
213
- <use xlink:href="#ais-RatingMenu-starSymbol">
214
- </use>
215
- </svg>
216
- <svg aria-hidden="true"
217
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
218
- height="24"
219
- width="24"
220
- >
221
- <use xlink:href="#ais-RatingMenu-starSymbol">
222
- </use>
223
- </svg>
224
- <svg aria-hidden="true"
225
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
226
- height="24"
227
- width="24"
228
- >
229
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
230
- </use>
231
- </svg>
232
- <span aria-hidden="true"
233
- class="ais-RatingMenu-label"
234
- >
235
- &amp; Up
236
- </span>
237
- <span class="ais-RatingMenu-count">
238
- 8
239
- </span>
240
- </a>
241
- </li>
242
- </ul>
243
- </div>
244
- `;
245
-
246
- exports[`renders correctly when refined 1`] = `
247
- <div class="ais-RatingMenu">
248
- <svg style="display: none;"
249
- xmlns="http://www.w3.org/2000/svg"
250
- >
251
- <symbol id="ais-RatingMenu-starSymbol"
252
- viewbox="0 0 24 24"
253
- >
254
- <path d="M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z">
255
- </path>
256
- </symbol>
257
- <symbol id="ais-RatingMenu-starEmptySymbol"
258
- viewbox="0 0 24 24"
259
- >
260
- <path d="M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z">
261
- </path>
262
- </symbol>
263
- </svg>
264
- <ul class="ais-RatingMenu-list">
265
- <li class="ais-RatingMenu-item">
266
- <a aria-label="1 &amp; Up"
267
- class="ais-RatingMenu-link"
268
- href="#"
269
- >
270
- <svg aria-hidden="true"
271
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
272
- height="24"
273
- width="24"
274
- >
275
- <use xlink:href="#ais-RatingMenu-starSymbol">
276
- </use>
277
- </svg>
278
- <svg aria-hidden="true"
279
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
280
- height="24"
281
- width="24"
282
- >
283
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
284
- </use>
285
- </svg>
286
- <svg aria-hidden="true"
287
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
288
- height="24"
289
- width="24"
290
- >
291
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
292
- </use>
293
- </svg>
294
- <svg aria-hidden="true"
295
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
296
- height="24"
297
- width="24"
298
- >
299
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
300
- </use>
301
- </svg>
302
- <svg aria-hidden="true"
303
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
304
- height="24"
305
- width="24"
306
- >
307
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
308
- </use>
309
- </svg>
310
- <span aria-hidden="true"
311
- class="ais-RatingMenu-label"
312
- >
313
- &amp; Up
314
- </span>
315
- <span class="ais-RatingMenu-count">
316
- 20
317
- </span>
318
- </a>
319
- </li>
320
- <li class="ais-RatingMenu-item">
321
- <a aria-label="2 &amp; Up"
322
- class="ais-RatingMenu-link"
323
- href="#"
324
- >
325
- <svg aria-hidden="true"
326
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
327
- height="24"
328
- width="24"
329
- >
330
- <use xlink:href="#ais-RatingMenu-starSymbol">
331
- </use>
332
- </svg>
333
- <svg aria-hidden="true"
334
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
335
- height="24"
336
- width="24"
337
- >
338
- <use xlink:href="#ais-RatingMenu-starSymbol">
339
- </use>
340
- </svg>
341
- <svg aria-hidden="true"
342
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
343
- height="24"
344
- width="24"
345
- >
346
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
347
- </use>
348
- </svg>
349
- <svg aria-hidden="true"
350
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
351
- height="24"
352
- width="24"
353
- >
354
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
355
- </use>
356
- </svg>
357
- <svg aria-hidden="true"
358
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
359
- height="24"
360
- width="24"
361
- >
362
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
363
- </use>
364
- </svg>
365
- <span aria-hidden="true"
366
- class="ais-RatingMenu-label"
367
- >
368
- &amp; Up
369
- </span>
370
- <span class="ais-RatingMenu-count">
371
- 3
372
- </span>
373
- </a>
374
- </li>
375
- <li class="ais-RatingMenu-item">
376
- <a aria-label="3 &amp; Up"
377
- class="ais-RatingMenu-link"
378
- href="#"
379
- >
380
- <svg aria-hidden="true"
381
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
382
- height="24"
383
- width="24"
384
- >
385
- <use xlink:href="#ais-RatingMenu-starSymbol">
386
- </use>
387
- </svg>
388
- <svg aria-hidden="true"
389
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
390
- height="24"
391
- width="24"
392
- >
393
- <use xlink:href="#ais-RatingMenu-starSymbol">
394
- </use>
395
- </svg>
396
- <svg aria-hidden="true"
397
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
398
- height="24"
399
- width="24"
400
- >
401
- <use xlink:href="#ais-RatingMenu-starSymbol">
402
- </use>
403
- </svg>
404
- <svg aria-hidden="true"
405
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
406
- height="24"
407
- width="24"
408
- >
409
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
410
- </use>
411
- </svg>
412
- <svg aria-hidden="true"
413
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
414
- height="24"
415
- width="24"
416
- >
417
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
418
- </use>
419
- </svg>
420
- <span aria-hidden="true"
421
- class="ais-RatingMenu-label"
422
- >
423
- &amp; Up
424
- </span>
425
- <span class="ais-RatingMenu-count">
426
- 2000
427
- </span>
428
- </a>
429
- </li>
430
- <li class="ais-RatingMenu-item ais-RatingMenu-item--selected">
431
- <a aria-label="4 &amp; Up"
432
- class="ais-RatingMenu-link"
433
- href="#"
434
- >
435
- <svg aria-hidden="true"
436
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
437
- height="24"
438
- width="24"
439
- >
440
- <use xlink:href="#ais-RatingMenu-starSymbol">
441
- </use>
442
- </svg>
443
- <svg aria-hidden="true"
444
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
445
- height="24"
446
- width="24"
447
- >
448
- <use xlink:href="#ais-RatingMenu-starSymbol">
449
- </use>
450
- </svg>
451
- <svg aria-hidden="true"
452
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
453
- height="24"
454
- width="24"
455
- >
456
- <use xlink:href="#ais-RatingMenu-starSymbol">
457
- </use>
458
- </svg>
459
- <svg aria-hidden="true"
460
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--full"
461
- height="24"
462
- width="24"
463
- >
464
- <use xlink:href="#ais-RatingMenu-starSymbol">
465
- </use>
466
- </svg>
467
- <svg aria-hidden="true"
468
- class="ais-RatingMenu-starIcon ais-RatingMenu-starIcon--empty"
469
- height="24"
470
- width="24"
471
- >
472
- <use xlink:href="#ais-RatingMenu-starEmptySymbol">
473
- </use>
474
- </svg>
475
- <span aria-hidden="true"
476
- class="ais-RatingMenu-label"
477
- >
478
- &amp; Up
479
- </span>
480
- <span class="ais-RatingMenu-count">
481
- 8
482
- </span>
483
- </a>
484
- </li>
485
- </ul>
486
- </div>
487
- `;
@@ -1,2 +0,0 @@
1
- import{openBlock as e,createElementBlock as t,normalizeClass as s,renderSlot as i,createElementVNode as n,createCommentVNode as r,Fragment as a,renderList as o,createTextVNode as u,toDisplayString as l}from"vue";var c=["disabled"],d=["onClick","onAuxclick"],f=["disabled"];function v(v,P,g,k,x,b){return v.state?(e(),t("div",{key:0,class:s(v.suit())},[g.showPrevious?i(v.$slots,"loadPrevious",{key:0,refinePrevious:b.refinePrevious,page:v.state.results.page,isFirstPage:v.state.isFirstPage},function(){return[n("button",{class:s([v.suit("loadPrevious"),v.state.isFirstPage&&v.suit("loadPrevious","disabled")]),disabled:v.state.isFirstPage,onClick:P[0]||(P[0]=function(e){return b.refinePrevious()})}," Show previous results ",10,c)]}):r("",!0),i(v.$slots,"default",{items:b.items,results:v.state.results,isLastPage:v.state.isLastPage,refinePrevious:b.refinePrevious,refineNext:b.refineNext,refine:b.refineNext,insights:v.state.insights,sendEvent:v.state.sendEvent},function(){return[n("ol",{class:s(v.suit("list"))},[(e(!0),t(a,null,o(b.items,function(n,r){return e(),t("li",{class:s(v.suit("item")),key:n.objectID,onClick:function(e){return v.state.sendEvent("click:internal",n,"Hit Clicked")},onAuxclick:function(e){return v.state.sendEvent("click:internal",n,"Hit Clicked")}},[i(v.$slots,"item",{item:n,index:r,insights:v.state.insights,sendEvent:v.state.sendEvent},function(){return[u(" objectID: "+l(n.objectID)+", index: "+l(r),1)]})],42,d)}),128))],2),i(v.$slots,"loadMore",{refineNext:b.refineNext,refine:b.refineNext,page:v.state.results.page,isLastPage:v.state.isLastPage},function(){return[n("button",{class:s([v.suit("loadMore"),v.state.isLastPage&&v.suit("loadMore","disabled")]),disabled:v.state.isLastPage,onClick:P[1]||(P[1]=function(e){return b.refineNext()})}," Show more results ",10,f)]})]})],2)):r("",!0)}export{v as render};
2
- //# sourceMappingURL=InfiniteHits.vue_vue&type=template&id=39939af3&lang.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InfiniteHits.vue_vue&type=template&id=39939af3&lang.js","sources":["../../../../src/components/InfiniteHits.vue?vue&type=template&id=39939af3&lang.js"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n v-if=\"showPrevious\"\n name=\"loadPrevious\"\n :refine-previous=\"refinePrevious\"\n :page=\"state.results.page\"\n :is-first-page=\"state.isFirstPage\"\n >\n <button\n :class=\"[\n suit('loadPrevious'),\n state.isFirstPage && suit('loadPrevious', 'disabled'),\n ]\"\n :disabled=\"state.isFirstPage\"\n @click=\"refinePrevious()\"\n >\n Show previous results\n </button>\n </slot>\n\n <slot\n :items=\"items\"\n :results=\"state.results\"\n :is-last-page=\"state.isLastPage\"\n :refine-previous=\"refinePrevious\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n <ol :class=\"suit('list')\">\n <li\n v-for=\"(item, index) in items\"\n :class=\"suit('item')\"\n :key=\"item.objectID\"\n @click=\"state.sendEvent('click:internal', item, 'Hit Clicked')\"\n @auxclick=\"state.sendEvent('click:internal', item, 'Hit Clicked')\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n :index=\"index\"\n :insights=\"state.insights\"\n :send-event=\"state.sendEvent\"\n >\n objectID: {{ item.objectID }}, index: {{ index }}\n </slot>\n </li>\n </ol>\n\n <slot\n name=\"loadMore\"\n :refine-next=\"refineNext\"\n :refine=\"refineNext\"\n :page=\"state.results.page\"\n :is-last-page=\"state.isLastPage\"\n >\n <button\n :class=\"[\n suit('loadMore'),\n state.isLastPage && suit('loadMore', 'disabled'),\n ]\"\n :disabled=\"state.isLastPage\"\n @click=\"refineNext()\"\n >\n Show more results\n </button>\n </slot>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectInfiniteHitsWithInsights } from 'instantsearch.js/es/connectors';\n\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\n\nexport default {\n name: 'AisInfiniteHits',\n mixins: [\n createWidgetMixin(\n {\n connector: connectInfiniteHitsWithInsights,\n },\n {\n $$widgetType: 'ais.infiniteHits',\n }\n ),\n createSuitMixin({ name: 'InfiniteHits' }),\n ],\n props: {\n showPrevious: {\n type: Boolean,\n default: false,\n },\n escapeHTML: {\n type: Boolean,\n default: true,\n },\n transformItems: {\n type: Function,\n default: undefined,\n },\n cache: {\n type: Object,\n default: undefined,\n },\n },\n computed: {\n widgetParams() {\n return {\n showPrevious: this.showPrevious,\n escapeHTML: this.escapeHTML,\n transformItems: this.transformItems,\n cache: this.cache,\n };\n },\n items() {\n // Fixes InstantSearch.js connectors API: every list\n // of things must be called `items`\n return this.state.hits;\n },\n },\n methods: {\n refinePrevious() {\n this.state.showPrevious();\n },\n refineNext() {\n this.state.showMore();\n },\n },\n};\n</script>\n"],"names":["_ctx","_createElementBlock","class","$props","_renderSlot","refinePrevious","$options","page","results","isFirstPage","_createElementVNode","disabled","onClick","items","isLastPage","refineNext","refine","insights","sendEvent","item","index","key","objectID","onAuxclick"],"mappings":"gTACaA,aAAXC,eAAmBC,QAAOF,YAEhBG,eADRC,iCAGGC,eAAiBC,iBACjBC,KAAMP,QAAMQ,QAAQD,KACpBE,YAAeT,QAAMS,+BAEtBC,YACGR,yFAIAS,SAAUX,QAAMS,YAChBG,uCAAON,kEAMZF,sBACGS,MAAOP,QACPE,QAASR,QAAMQ,QACfM,WAAcd,QAAMc,WACpBT,eAAiBC,iBACjBS,WAAaT,aACbU,OAAQV,aACRW,SAAUjB,QAAMiB,SAChBC,UAAYlB,QAAMkB,6BAEnBR,QAAKR,QAAOF,yBACVC,WAC0BK,iBAAhBa,EAAMC,cADhBnB,QAEGC,QAAOF,gBACPqB,IAAKF,EAAKG,SACVV,2BAAOZ,QAAMkB,2BAA4BC,kBACzCI,8BAAUvB,QAAMkB,2BAA4BC,oBAE7Cf,mBAEGe,KAAMA,EACNC,MAAOA,EACPH,SAAUjB,QAAMiB,SAChBC,UAAYlB,QAAMkB,+CAENC,EAAKG,UAAW,cAAYF,4BAK/ChB,uBAEGW,WAAaT,aACbU,OAAQV,aACRC,KAAMP,QAAMQ,QAAQD,KACpBO,WAAcd,QAAMc,8BAErBJ,YACGR,gFAIAS,SAAUX,QAAMc,WAChBF,uCAAON"}
@@ -1,2 +0,0 @@
1
- import{openBlock as t,createElementBlock as e,normalizeClass as s,renderSlot as a,createElementVNode as n,Fragment as i,renderList as l,withModifiers as u,createTextVNode as r,toDisplayString as o,createCommentVNode as c}from"vue";var h={xmlns:"http://www.w3.org/2000/svg",style:{display:"none"}},d=[n("symbol",{id:"ais-RatingMenu-starSymbol",viewBox:"0 0 24 24"},[n("path",{d:"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z"})],-1),n("symbol",{id:"ais-RatingMenu-starEmptySymbol",viewBox:"0 0 24 24"},[n("path",{d:"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z"})],-1)],f=["href","aria-label","onClick"],m=[n("use",{"xlink:href":"#ais-RatingMenu-starSymbol"},null,-1)],p=[n("use",{"xlink:href":"#ais-RatingMenu-starEmptySymbol"},null,-1)];function y(y,v,g,R,b,k){return y.state?(t(),e("div",{key:0,class:s(y.suit())},[a(y.$slots,"default",{items:y.state.items,refine:y.state.refine,createURL:y.state.createURL,sendEvent:y.state.sendEvent,canRefine:y.state.canRefine},function(){return[(t(),e("svg",h,d)),n("ul",{class:s(y.suit("list"))},[(t(!0),e(i,null,l(y.state.items,function(c,h){return t(),e("li",{key:h,class:s([y.suit("item"),c.isRefined&&y.suit("item","selected")])},[n("a",{href:y.state.createURL(c.value),"aria-label":c.value+" & Up",class:s(y.suit("link")),onClick:u(function(t){return y.state.refine(c.value)},["prevent"])},[(t(!0),e(i,null,l(c.stars,function(a,n){return t(),e(i,null,[a?(t(),e("svg",{"aria-hidden":"true",width:"24",height:"24",class:s([y.suit("starIcon"),y.suit("starIcon--full")]),key:n+"-full"},m,2)):(t(),e("svg",{class:s([y.suit("starIcon"),y.suit("starIcon--empty")]),"aria-hidden":"true",width:"24",height:"24",key:n+"-empty"},p,2))],64)}),256)),n("span",{class:s(y.suit("label")),"aria-hidden":"true"},[a(y.$slots,"andUp",{},function(){return[r("& Up")]})],2),n("span",{class:s(y.suit("count"))},o(c.count),3)],10,f)],2)}),128))],2)]})],2)):c("",!0)}export{y as render};
2
- //# sourceMappingURL=RatingMenu.vue_vue&type=template&id=6effe1ff&lang.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RatingMenu.vue_vue&type=template&id=6effe1ff&lang.js","sources":["../../../../src/components/RatingMenu.vue?vue&type=template&id=6effe1ff&lang.js"],"sourcesContent":["<template>\n <div v-if=\"state\" :class=\"suit()\">\n <slot\n :items=\"state.items\"\n :refine=\"state.refine\"\n :createURL=\"state.createURL\"\n :send-event=\"state.sendEvent\"\n :can-refine=\"state.canRefine\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display: none\">\n <symbol id=\"ais-RatingMenu-starSymbol\" viewBox=\"0 0 24 24\">\n <path\n d=\"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z\"\n />\n </symbol>\n <symbol id=\"ais-RatingMenu-starEmptySymbol\" viewBox=\"0 0 24 24\">\n <path\n d=\"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z\"\n />\n </symbol>\n </svg>\n\n <ul :class=\"suit('list')\">\n <li\n v-for=\"(item, key) in state.items\"\n :key=\"key\"\n :class=\"[suit('item'), item.isRefined && suit('item', 'selected')]\"\n >\n <a\n :href=\"state.createURL(item.value)\"\n :aria-label=\"`${item.value} & Up`\"\n :class=\"suit('link')\"\n @click.prevent=\"state.refine(item.value)\"\n >\n <template v-for=\"(full, n) in item.stars\">\n <svg\n v-if=\"full\"\n aria-hidden=\"true\"\n width=\"24\"\n height=\"24\"\n :class=\"[suit('starIcon'), suit('starIcon--full')]\"\n :key=\"n + '-full'\"\n >\n <use xlink:href=\"#ais-RatingMenu-starSymbol\" />\n </svg>\n\n <svg\n v-else\n :class=\"[suit('starIcon'), suit('starIcon--empty')]\"\n aria-hidden=\"true\"\n width=\"24\"\n height=\"24\"\n :key=\"n + '-empty'\"\n >\n <use xlink:href=\"#ais-RatingMenu-starEmptySymbol\" />\n </svg>\n </template>\n\n <span :class=\"suit('label')\" aria-hidden=\"true\">\n <slot name=\"andUp\">&amp; Up</slot>\n </span>\n <span :class=\"suit('count')\">{{ item.count }}</span>\n </a>\n </li>\n </ul>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectRatingMenu } from 'instantsearch.js/es/connectors';\n\nimport { createPanelConsumerMixin } from '../mixins/panel';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\n\nexport default {\n name: 'AisRatingMenu',\n mixins: [\n createSuitMixin({ name: 'RatingMenu' }),\n createWidgetMixin(\n {\n connector: connectRatingMenu,\n },\n {\n $$widgetType: 'ais.ratingMenu',\n }\n ),\n createPanelConsumerMixin(),\n ],\n props: {\n attribute: {\n type: String,\n required: true,\n },\n max: {\n type: Number,\n default: undefined,\n },\n },\n computed: {\n widgetParams() {\n return {\n attribute: this.attribute,\n max: this.max,\n };\n },\n },\n};\n</script>\n"],"names":["xmlns","style","_createElementVNode","id","viewBox","d","xlink:href","_ctx","_createElementBlock","class","_renderSlot","items","refine","createURL","sendEvent","canRefine","_hoisted_1","item","key","isRefined","href","value","aria-label","onClick","stars","full","n","aria-hidden","width","height","count"],"mappings":"8OASWA,MAAM,6BAA6BC,MAAA,qBACtCC,YAAQC,GAAG,4BAA4BC,QAAQ,cAC7CF,UACEG,EAAE,oHAGNH,YAAQC,GAAG,iCAAiCC,QAAQ,cAClDF,UACEG,EAAE,8RA0BEH,SAAKI,aAAW,2CAWhBJ,SAAKI,aAAW,4EArDnBC,aAAXC,eAAmBC,QAAOF,YACxBG,sBACGC,MAAOJ,QAAMI,MACbC,OAAQL,QAAMK,OACdC,UAAWN,QAAMM,UACjBC,UAAYP,QAAMO,UAClBC,UAAYR,QAAMQ,kCAEnBP,QAAAQ,MAaAd,QAAKO,QAAOF,yBACVC,WACwBD,QAAMI,eAApBM,EAAMC,cADhBV,QAEGU,IAAKA,EACLT,SAAQF,eAAcU,EAAKE,WAAaZ,8BAEzCL,OACGkB,KAAMb,QAAMM,UAAUI,EAAKI,OAC3BC,aAAeL,EAAKI,cACpBZ,QAAOF,gBACPgB,6BAAehB,QAAMK,OAAOK,EAAKI,8BAElCb,WAA8BS,EAAKO,eAAjBC,EAAMC,wBAEdD,OADRjB,SAEEmB,cAAY,OACZC,MAAM,KACNC,OAAO,KACNpB,SAAQF,mBAAkBA,2BAC1BW,IAAKQ,sBAKRlB,SAEGC,SAAQF,mBAAkBA,4BAC3BoB,cAAY,OACZC,MAAM,KACNC,OAAO,KACNX,IAAKQ,+BAMVxB,UAAOO,QAAOF,iBAAeoB,cAAY,SACvCjB,0CAAmB,eAErBR,UAAOO,QAAOF,oBAAkBU,EAAKa"}