vue-instantsearch 4.10.12 → 4.12.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.
- package/README.md +0 -1
- package/package.json +4 -4
- package/src/__tests__/common-widgets.test.js +3 -0
- package/src/components/InstantSearch.js +10 -1
- package/src/components/Pagination.vue +13 -8
- package/src/components/__tests__/Hits.js +0 -26
- package/src/util/createInstantSearchComponent.js +8 -0
- 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/InstantSearch.js +1 -1
- package/vue2/es/src/components/InstantSearch.js.map +1 -1
- package/vue2/es/src/components/Pagination.vue.js +1 -1
- package/vue2/es/src/util/createInstantSearchComponent.js +1 -1
- package/vue2/es/src/util/createInstantSearchComponent.js.map +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/InstantSearch.js +1 -1
- package/vue3/es/src/components/InstantSearch.js.map +1 -1
- package/vue3/es/src/components/Pagination.vue.js +1 -1
- package/vue3/es/src/components/Pagination.vue_vue&type=script&lang.js.map +1 -1
- package/vue3/es/src/components/Pagination.vue_vue&type=template&id=5b708f87&lang.js +2 -0
- package/vue3/es/src/components/Pagination.vue_vue&type=template&id=5b708f87&lang.js.map +1 -0
- package/vue3/es/src/util/createInstantSearchComponent.js +1 -1
- package/vue3/es/src/util/createInstantSearchComponent.js.map +1 -1
- package/vue3/umd/index.js +1 -1
- package/vue3/umd/index.js.map +1 -1
- package/src/components/__tests__/__snapshots__/Hits.js.snap +0 -14
- package/vue3/es/src/components/Pagination.vue_vue&type=template&id=36adea52&lang.js +0 -2
- package/vue3/es/src/components/Pagination.vue_vue&type=template&id=36adea52&lang.js.map +0 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"autocomplete"
|
|
17
17
|
],
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"version": "4.
|
|
19
|
+
"version": "4.12.0",
|
|
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": "4.
|
|
38
|
+
"instantsearch.js": "4.59.0",
|
|
39
39
|
"mitt": "^2.1.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@vue/test-utils": "1.3.0",
|
|
61
61
|
"@vue/test-utils2": "npm:@vue/test-utils@2.0.0-rc.11",
|
|
62
62
|
"algoliasearch": "4.14.3",
|
|
63
|
-
"algoliasearch-helper": "3.
|
|
63
|
+
"algoliasearch-helper": "3.15.0",
|
|
64
64
|
"instantsearch.css": "8.1.0",
|
|
65
65
|
"rollup": "1.32.1",
|
|
66
66
|
"rollup-plugin-babel": "4.4.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"vuex": "3.5.1",
|
|
88
88
|
"vuex4": "npm:vuex@4.0.0"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "8fb537f2301a5e133e9e5df20c7c208cae16b3aa"
|
|
91
91
|
}
|
|
@@ -247,6 +247,9 @@ const testSetups = {
|
|
|
247
247
|
),
|
|
248
248
|
},
|
|
249
249
|
}),
|
|
250
|
+
h('div', { attrs: { id: 'hits-with-defaults' } }, [
|
|
251
|
+
h(AisHits, { props: widgetParams }),
|
|
252
|
+
]),
|
|
250
253
|
h(AisIndex, { props: { indexName: 'nested' } }, [
|
|
251
254
|
h(AisHits, {
|
|
252
255
|
attrs: { id: 'nested-hits' },
|
|
@@ -42,7 +42,11 @@ export default createInstantSearchComponent({
|
|
|
42
42
|
insights: {
|
|
43
43
|
default: undefined,
|
|
44
44
|
validator(value) {
|
|
45
|
-
return
|
|
45
|
+
return (
|
|
46
|
+
typeof value === 'undefined' ||
|
|
47
|
+
typeof value === 'boolean' ||
|
|
48
|
+
typeof value === 'object'
|
|
49
|
+
);
|
|
46
50
|
},
|
|
47
51
|
},
|
|
48
52
|
stalledSearchDelay: {
|
|
@@ -85,6 +89,10 @@ export default createInstantSearchComponent({
|
|
|
85
89
|
type: Array,
|
|
86
90
|
default: null,
|
|
87
91
|
},
|
|
92
|
+
future: {
|
|
93
|
+
type: Object,
|
|
94
|
+
default: undefined,
|
|
95
|
+
},
|
|
88
96
|
},
|
|
89
97
|
data() {
|
|
90
98
|
return {
|
|
@@ -98,6 +106,7 @@ export default createInstantSearchComponent({
|
|
|
98
106
|
searchFunction: this.searchFunction,
|
|
99
107
|
onStateChange: this.onStateChange,
|
|
100
108
|
initialUiState: this.initialUiState,
|
|
109
|
+
future: this.future,
|
|
101
110
|
}),
|
|
102
111
|
};
|
|
103
112
|
},
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
<template v-if="!state.isFirstPage">
|
|
32
32
|
<a
|
|
33
33
|
:class="suit('link')"
|
|
34
|
-
aria-label="First"
|
|
34
|
+
aria-label="First Page"
|
|
35
35
|
:href="state.createURL(0)"
|
|
36
36
|
@click.exact.left.prevent="refine(0)"
|
|
37
37
|
>‹‹</a
|
|
38
38
|
>
|
|
39
39
|
</template>
|
|
40
40
|
<template v-else>
|
|
41
|
-
<span :class="suit('link')" aria-label="First">‹‹</span>
|
|
41
|
+
<span :class="suit('link')" aria-label="First Page">‹‹</span>
|
|
42
42
|
</template>
|
|
43
43
|
</slot>
|
|
44
44
|
</li>
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
<template v-if="!state.isFirstPage">
|
|
60
60
|
<a
|
|
61
61
|
:class="suit('link')"
|
|
62
|
-
aria-label="Previous"
|
|
62
|
+
aria-label="Previous Page"
|
|
63
63
|
:href="state.createURL(state.currentRefinement - 1)"
|
|
64
64
|
@click.exact.left.prevent="refine(state.currentRefinement - 1)"
|
|
65
65
|
>‹</a
|
|
66
66
|
>
|
|
67
67
|
</template>
|
|
68
68
|
<template v-else>
|
|
69
|
-
<span :class="suit('link')" aria-label="Previous">‹</span>
|
|
69
|
+
<span :class="suit('link')" aria-label="Previous Page">‹</span>
|
|
70
70
|
</template>
|
|
71
71
|
</slot>
|
|
72
72
|
</li>
|
|
@@ -115,14 +115,14 @@
|
|
|
115
115
|
<template v-if="!state.isLastPage">
|
|
116
116
|
<a
|
|
117
117
|
:class="suit('link')"
|
|
118
|
-
aria-label="Next"
|
|
118
|
+
aria-label="Next Page"
|
|
119
119
|
:href="state.createURL(state.currentRefinement + 1)"
|
|
120
120
|
@click.exact.left.prevent="refine(state.currentRefinement + 1)"
|
|
121
121
|
>›</a
|
|
122
122
|
>
|
|
123
123
|
</template>
|
|
124
124
|
<template v-else>
|
|
125
|
-
<span :class="suit('link')" aria-label="Next">›</span>
|
|
125
|
+
<span :class="suit('link')" aria-label="Next Page">›</span>
|
|
126
126
|
</template>
|
|
127
127
|
</slot>
|
|
128
128
|
</li>
|
|
@@ -143,14 +143,19 @@
|
|
|
143
143
|
<template v-if="!state.isLastPage">
|
|
144
144
|
<a
|
|
145
145
|
:class="suit('link')"
|
|
146
|
-
aria-label="Last"
|
|
146
|
+
:aria-label="`Last Page, Page ${state.nbPages}`"
|
|
147
147
|
:href="state.createURL(state.nbPages - 1)"
|
|
148
148
|
@click.exact.left.prevent="refine(state.nbPages - 1)"
|
|
149
149
|
>››</a
|
|
150
150
|
>
|
|
151
151
|
</template>
|
|
152
152
|
<template v-else>
|
|
153
|
-
<span
|
|
153
|
+
<span
|
|
154
|
+
:class="suit('link')"
|
|
155
|
+
:aria-label="`Last Page, Page ${state.nbPages}`"
|
|
156
|
+
>
|
|
157
|
+
››
|
|
158
|
+
</span>
|
|
154
159
|
</template>
|
|
155
160
|
</slot>
|
|
156
161
|
</li>
|
|
@@ -28,32 +28,6 @@ it('accepts an escapeHTML prop', () => {
|
|
|
28
28
|
expect(wrapper.vm.widgetParams.escapeHTML).toBe(true);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
it('accepts a transformItems prop', () => {
|
|
32
|
-
__setState({
|
|
33
|
-
...defaultState,
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const transformItems = () => {};
|
|
37
|
-
|
|
38
|
-
const wrapper = mount(Hits, {
|
|
39
|
-
propsData: {
|
|
40
|
-
transformItems,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
expect(wrapper.vm.widgetParams.transformItems).toBe(transformItems);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders correctly', () => {
|
|
48
|
-
__setState({
|
|
49
|
-
...defaultState,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const wrapper = mount(Hits);
|
|
53
|
-
|
|
54
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
31
|
it('exposes insights prop to the default slot', async () => {
|
|
58
32
|
const insights = jest.fn();
|
|
59
33
|
__setState({
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { INSTANTSEARCH_FUTURE_DEFAULTS } from 'instantsearch.js/es/lib/InstantSearch';
|
|
2
|
+
|
|
1
3
|
import { version } from '../../package.json'; // rollup does pick only what needed from json
|
|
2
4
|
import { createSuitMixin } from '../mixins/suit';
|
|
3
5
|
|
|
@@ -64,6 +66,12 @@ export const createInstantSearchComponent = (component) =>
|
|
|
64
66
|
});
|
|
65
67
|
},
|
|
66
68
|
},
|
|
69
|
+
future(future) {
|
|
70
|
+
this.instantSearchInstance.future = Object.assign(
|
|
71
|
+
INSTANTSEARCH_FUTURE_DEFAULTS,
|
|
72
|
+
future
|
|
73
|
+
);
|
|
74
|
+
},
|
|
67
75
|
},
|
|
68
76
|
created() {
|
|
69
77
|
const searchClient = this.instantSearchInstance.client;
|