@appbaseio/reactivesearch-vue 1.28.0 → 1.29.0-preview.1
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/dist/@appbaseio/reactivesearch-vue.umd.js +1759 -371
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-11307285.js → Button-e0b7c1f6.js} +1 -1
- package/dist/cjs/DataSearch-eec21890.js +2171 -0
- package/dist/cjs/DataSearch.js +18 -2107
- package/dist/cjs/{DropDown-7aa3d0d2.js → DropDown-e4381fcc.js} +1 -1
- package/dist/cjs/{Input-3cc3fa59.js → Input-0d7b25ad.js} +1 -1
- package/dist/cjs/MultiDropdownList.js +3 -3
- package/dist/cjs/MultiList.js +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/ReactiveList.js +1 -1
- package/dist/cjs/SelectedFilters.js +1 -1
- package/dist/cjs/SingleDropdownList.js +3 -3
- package/dist/cjs/SingleList.js +1 -1
- package/dist/cjs/ToggleButton.js +1 -1
- package/dist/cjs/index.js +10 -9
- package/dist/cjs/install-b05fef06.js +1247 -0
- package/dist/cjs/install.js +24 -29
- package/dist/cjs/version.js +1 -1
- package/dist/es/{Button-91561391.js → Button-33de88e6.js} +1 -1
- package/dist/es/DataSearch-42f547cd.js +2158 -0
- package/dist/es/DataSearch.js +17 -2106
- package/dist/es/{DropDown-60a426a2.js → DropDown-ff6ad982.js} +1 -1
- package/dist/es/{Input-08bb1bcf.js → Input-e339e63a.js} +1 -1
- package/dist/es/MultiDropdownList.js +3 -3
- package/dist/es/MultiList.js +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/ReactiveList.js +1 -1
- package/dist/es/SelectedFilters.js +1 -1
- package/dist/es/SingleDropdownList.js +3 -3
- package/dist/es/SingleList.js +1 -1
- package/dist/es/ToggleButton.js +1 -1
- package/dist/es/index.js +6 -6
- package/dist/es/install-bd448c02.js +1240 -0
- package/dist/es/install.js +22 -31
- package/dist/es/version.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,1247 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
var configureStore = require('@appbaseio/reactivecore');
|
|
6
|
+
var configureStore__default = _interopDefault(configureStore);
|
|
7
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
|
|
8
|
+
var VueTypes = _interopDefault(require('vue-types'));
|
|
9
|
+
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
10
|
+
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
11
|
+
var styled = require('@appbaseio/vue-emotion');
|
|
12
|
+
var styled__default = _interopDefault(styled);
|
|
13
|
+
var Button = require('./Button-e0b7c1f6.js');
|
|
14
|
+
var vueTypes = require('./vueTypes-57d01f18.js');
|
|
15
|
+
var ReactiveList = require('./ReactiveList.js');
|
|
16
|
+
var index = require('./index-4509aa45.js');
|
|
17
|
+
var ComponentWrapper = require('./ComponentWrapper-10bad289.js');
|
|
18
|
+
var Title = require('./Title-584a8cc8.js');
|
|
19
|
+
var ReactiveBase = require('./ReactiveBase.js');
|
|
20
|
+
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
21
|
+
var DataSearch = require('./DataSearch-eec21890.js');
|
|
22
|
+
var CancelSvg = require('./CancelSvg-4aa35935.js');
|
|
23
|
+
var Input = require('./Input-0d7b25ad.js');
|
|
24
|
+
var Container = require('./Container-526efa6a.js');
|
|
25
|
+
var SingleList = require('./SingleList.js');
|
|
26
|
+
var MultiList = require('./MultiList.js');
|
|
27
|
+
var SingleDropdownList = require('./SingleDropdownList.js');
|
|
28
|
+
var MultiDropdownList = require('./MultiDropdownList.js');
|
|
29
|
+
var ToggleButton = require('./ToggleButton.js');
|
|
30
|
+
var ReactiveComponent = require('./ReactiveComponent.js');
|
|
31
|
+
var SelectedFilters = require('./SelectedFilters.js');
|
|
32
|
+
var SingleRange = require('./SingleRange.js');
|
|
33
|
+
var MultiRange = require('./MultiRange.js');
|
|
34
|
+
var ResultCard = require('./ResultCard.js');
|
|
35
|
+
var ResultList = require('./ResultList.js');
|
|
36
|
+
var RangeSlider = require('./RangeSlider.js');
|
|
37
|
+
var DynamicRangeSlider = require('./DynamicRangeSlider.js');
|
|
38
|
+
var StateProvider = require('./StateProvider.js');
|
|
39
|
+
var RangeInput = require('./RangeInput.js');
|
|
40
|
+
|
|
41
|
+
var _templateObject;
|
|
42
|
+
var AutofillSvgIcon = styled__default('button')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
|
|
43
|
+
var AutoFillSvg = {
|
|
44
|
+
name: 'AutoFillSvg',
|
|
45
|
+
render: function render() {
|
|
46
|
+
var h = arguments[0];
|
|
47
|
+
return h(AutofillSvgIcon, {
|
|
48
|
+
"on": {
|
|
49
|
+
"click": this.$listeners.click
|
|
50
|
+
}
|
|
51
|
+
}, [h("svg", {
|
|
52
|
+
"attrs": {
|
|
53
|
+
"viewBox": "0 0 24 24"
|
|
54
|
+
}
|
|
55
|
+
}, [h("path", {
|
|
56
|
+
"attrs": {
|
|
57
|
+
"d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
|
|
58
|
+
}
|
|
59
|
+
})])]);
|
|
60
|
+
},
|
|
61
|
+
methods: {
|
|
62
|
+
clicked: function clicked(e) {
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
window.console.log('hey', e);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var updateQuery = configureStore.Actions.updateQuery,
|
|
70
|
+
setCustomQuery = configureStore.Actions.setCustomQuery,
|
|
71
|
+
setDefaultQuery = configureStore.Actions.setDefaultQuery,
|
|
72
|
+
recordSuggestionClick = configureStore.Actions.recordSuggestionClick;
|
|
73
|
+
var _debounce = configureStore.helper.debounce,
|
|
74
|
+
checkValueChange = configureStore.helper.checkValueChange,
|
|
75
|
+
getClassName = configureStore.helper.getClassName,
|
|
76
|
+
isEqual = configureStore.helper.isEqual,
|
|
77
|
+
getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
|
|
78
|
+
withClickIds = configureStore.helper.withClickIds,
|
|
79
|
+
getResultStats = configureStore.helper.getResultStats,
|
|
80
|
+
normalizeDataField = configureStore.helper.normalizeDataField;
|
|
81
|
+
var SearchBox = {
|
|
82
|
+
name: 'SearchBox',
|
|
83
|
+
data: function data() {
|
|
84
|
+
var props = this.$props;
|
|
85
|
+
this.__state = {
|
|
86
|
+
currentValue: '',
|
|
87
|
+
isOpen: false,
|
|
88
|
+
normalizedSuggestions: []
|
|
89
|
+
};
|
|
90
|
+
this.internalComponent = props.componentId + "__internal";
|
|
91
|
+
return this.__state;
|
|
92
|
+
},
|
|
93
|
+
inject: {
|
|
94
|
+
theme: {
|
|
95
|
+
from: 'theme_reactivesearch'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
created: function created() {
|
|
99
|
+
var _this$$props = this.$props,
|
|
100
|
+
distinctField = _this$$props.distinctField,
|
|
101
|
+
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
102
|
+
index = _this$$props.index;
|
|
103
|
+
|
|
104
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
105
|
+
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
109
|
+
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!this.enableAppbase && index) {
|
|
113
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
|
|
117
|
+
this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
|
|
118
|
+
this.setValue(this.currentValue, true, this.$props, undefined, false, this.selectedCategory); // Set custom and default queries in store
|
|
119
|
+
|
|
120
|
+
this.triggerCustomQuery(this.currentValue, this.selectedCategory);
|
|
121
|
+
this.triggerDefaultQuery(this.currentValue);
|
|
122
|
+
},
|
|
123
|
+
computed: {
|
|
124
|
+
hasCustomRenderer: function hasCustomRenderer() {
|
|
125
|
+
return index.hasCustomRenderer(this);
|
|
126
|
+
},
|
|
127
|
+
stats: function stats() {
|
|
128
|
+
return getResultStats(this);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
props: {
|
|
132
|
+
autoFocus: VueTypes.bool,
|
|
133
|
+
autosuggest: VueTypes.bool.def(true),
|
|
134
|
+
beforeValueChange: vueTypes.types.func,
|
|
135
|
+
className: VueTypes.string.def(''),
|
|
136
|
+
clearIcon: vueTypes.types.children,
|
|
137
|
+
componentId: vueTypes.types.stringRequired,
|
|
138
|
+
customHighlight: vueTypes.types.func,
|
|
139
|
+
customQuery: vueTypes.types.func,
|
|
140
|
+
defaultQuery: vueTypes.types.func,
|
|
141
|
+
dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
|
|
142
|
+
field: VueTypes.string,
|
|
143
|
+
weight: VueTypes.number
|
|
144
|
+
}), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
|
|
145
|
+
field: VueTypes.string,
|
|
146
|
+
weight: VueTypes.number
|
|
147
|
+
})]),
|
|
148
|
+
aggregationField: vueTypes.types.string,
|
|
149
|
+
aggregationSize: VueTypes.number,
|
|
150
|
+
size: VueTypes.number,
|
|
151
|
+
debounce: VueTypes.number.def(0),
|
|
152
|
+
defaultValue: vueTypes.types.string,
|
|
153
|
+
excludeFields: vueTypes.types.excludeFields,
|
|
154
|
+
value: vueTypes.types.value,
|
|
155
|
+
defaultSuggestions: vueTypes.types.suggestions,
|
|
156
|
+
enableSynonyms: VueTypes.bool.def(true),
|
|
157
|
+
enableQuerySuggestions: VueTypes.bool.def(false),
|
|
158
|
+
enablePopularSuggestions: VueTypes.bool.def(false),
|
|
159
|
+
enableRecentSuggestions: VueTypes.bool.def(false),
|
|
160
|
+
fieldWeights: vueTypes.types.fieldWeights,
|
|
161
|
+
filterLabel: vueTypes.types.string,
|
|
162
|
+
fuzziness: vueTypes.types.fuzziness,
|
|
163
|
+
highlight: VueTypes.bool,
|
|
164
|
+
highlightField: vueTypes.types.stringOrArray,
|
|
165
|
+
icon: vueTypes.types.children,
|
|
166
|
+
iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
|
|
167
|
+
includeFields: vueTypes.types.includeFields,
|
|
168
|
+
innerClass: vueTypes.types.style,
|
|
169
|
+
innerRef: VueTypes.string.def('searchInputField'),
|
|
170
|
+
render: vueTypes.types.func,
|
|
171
|
+
renderNoSuggestion: vueTypes.types.title,
|
|
172
|
+
renderError: vueTypes.types.title,
|
|
173
|
+
placeholder: VueTypes.string.def('Search'),
|
|
174
|
+
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
175
|
+
react: vueTypes.types.react,
|
|
176
|
+
showClear: VueTypes.bool.def(true),
|
|
177
|
+
showDistinctSuggestions: VueTypes.bool.def(true),
|
|
178
|
+
showFilter: VueTypes.bool.def(true),
|
|
179
|
+
showIcon: VueTypes.bool.def(true),
|
|
180
|
+
title: vueTypes.types.title,
|
|
181
|
+
theme: vueTypes.types.style,
|
|
182
|
+
URLParams: VueTypes.bool.def(false),
|
|
183
|
+
strictSelection: VueTypes.bool.def(false),
|
|
184
|
+
nestedField: vueTypes.types.string,
|
|
185
|
+
enablePredictiveSuggestions: VueTypes.bool.def(false),
|
|
186
|
+
recentSearchesIcon: VueTypes.any,
|
|
187
|
+
popularSearchesIcon: VueTypes.any,
|
|
188
|
+
// mic props
|
|
189
|
+
showVoiceSearch: VueTypes.bool.def(false),
|
|
190
|
+
getMicInstance: vueTypes.types.func,
|
|
191
|
+
renderMic: vueTypes.types.func,
|
|
192
|
+
distinctField: vueTypes.types.string,
|
|
193
|
+
distinctFieldConfig: vueTypes.types.props,
|
|
194
|
+
//
|
|
195
|
+
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
196
|
+
addonBefore: VueTypes.any,
|
|
197
|
+
addonAfter: VueTypes.any,
|
|
198
|
+
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
199
|
+
index: VueTypes.string,
|
|
200
|
+
popularSuggestionsConfig: VueTypes.object,
|
|
201
|
+
recentSuggestionsConfig: VueTypes.object,
|
|
202
|
+
applyStopwords: VueTypes.bool,
|
|
203
|
+
customStopwords: vueTypes.types.stringArray,
|
|
204
|
+
onData: vueTypes.types.func,
|
|
205
|
+
renderItem: vueTypes.types.func,
|
|
206
|
+
enterButton: VueTypes.bool.def(false),
|
|
207
|
+
renderEnterButton: VueTypes.any
|
|
208
|
+
},
|
|
209
|
+
mounted: function mounted() {
|
|
210
|
+
this.listenForFocusShortcuts();
|
|
211
|
+
},
|
|
212
|
+
watch: {
|
|
213
|
+
dataField: function dataField(newVal, oldVal) {
|
|
214
|
+
if (!isEqual(newVal, oldVal)) {
|
|
215
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
fieldWeights: function fieldWeights() {
|
|
219
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
220
|
+
},
|
|
221
|
+
fuzziness: function fuzziness() {
|
|
222
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
223
|
+
},
|
|
224
|
+
queryFormat: function queryFormat() {
|
|
225
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
226
|
+
},
|
|
227
|
+
defaultValue: function defaultValue(newVal) {
|
|
228
|
+
this.setValue(newVal, true, this.$props);
|
|
229
|
+
},
|
|
230
|
+
value: function value(newVal, oldVal) {
|
|
231
|
+
if (!isEqual(newVal, oldVal)) {
|
|
232
|
+
this.setValue(newVal, true, this.$props, newVal === '' ? configureStore.causes.CLEAR_VALUE : undefined, false);
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
236
|
+
if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
237
|
+
this.triggerDefaultQuery(this.$data.currentValue);
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
241
|
+
if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
242
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
suggestions: function suggestions(newVal) {
|
|
246
|
+
var suggestionsList = [];
|
|
247
|
+
|
|
248
|
+
if (Array.isArray(newVal) && newVal.length) {
|
|
249
|
+
suggestionsList = [].concat(withClickIds(newVal));
|
|
250
|
+
} else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
|
|
251
|
+
suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
this.normalizedSuggestions = suggestionsList;
|
|
255
|
+
},
|
|
256
|
+
selectedValue: function selectedValue(newVal, oldVal) {
|
|
257
|
+
if (oldVal !== newVal && this.$data.currentValue !== newVal) {
|
|
258
|
+
if (!newVal && this.$data.currentValue) {
|
|
259
|
+
// selected value is cleared, call onValueSelected
|
|
260
|
+
this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (this.$props.value === undefined) {
|
|
264
|
+
this.setValue(newVal || '', true, this.$props);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
focusShortcuts: function focusShortcuts() {
|
|
269
|
+
this.listenForFocusShortcuts();
|
|
270
|
+
},
|
|
271
|
+
rawData: function rawData(newVal) {
|
|
272
|
+
this.$emit('on-data', {
|
|
273
|
+
data: this.normalizedSuggestions,
|
|
274
|
+
rawData: newVal,
|
|
275
|
+
aggregationData: this.aggregationData,
|
|
276
|
+
loading: this.isLoading,
|
|
277
|
+
error: this.isError
|
|
278
|
+
});
|
|
279
|
+
},
|
|
280
|
+
aggregationData: function aggregationData(newVal) {
|
|
281
|
+
this.$emit('on-data', {
|
|
282
|
+
data: this.normalizedSuggestions,
|
|
283
|
+
rawData: this.rawData,
|
|
284
|
+
aggregationData: newVal,
|
|
285
|
+
loading: this.isLoading,
|
|
286
|
+
error: this.isError
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
loading: function loading(newVal) {
|
|
290
|
+
this.$emit('on-data', {
|
|
291
|
+
data: this.normalizedSuggestions,
|
|
292
|
+
rawData: this.rawData,
|
|
293
|
+
aggregationData: this.aggregationData,
|
|
294
|
+
loading: newVal,
|
|
295
|
+
error: this.isError
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
error: function error(newVal) {
|
|
299
|
+
this.$emit('on-data', {
|
|
300
|
+
data: this.normalizedSuggestions,
|
|
301
|
+
rawData: this.rawData,
|
|
302
|
+
aggregationData: this.aggregationData,
|
|
303
|
+
loading: this.isLoading,
|
|
304
|
+
error: newVal
|
|
305
|
+
});
|
|
306
|
+
},
|
|
307
|
+
debounce: function debounce(newVal, oldVal) {
|
|
308
|
+
if (!isEqual(newVal, oldVal)) {
|
|
309
|
+
this.handleTextChange = _debounce(this.handleText, newVal);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
methods: {
|
|
314
|
+
handleText: function handleText(value, cause) {
|
|
315
|
+
if (cause === configureStore.causes.CLEAR_VALUE) {
|
|
316
|
+
this.triggerCustomQuery(value);
|
|
317
|
+
this.triggerDefaultQuery(value);
|
|
318
|
+
} else if (this.$props.autosuggest) {
|
|
319
|
+
this.triggerDefaultQuery(value);
|
|
320
|
+
} else if (!this.$props.enterButton) {
|
|
321
|
+
this.triggerCustomQuery(value);
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
validateDataField: function validateDataField() {
|
|
325
|
+
var propName = 'dataField';
|
|
326
|
+
var componentName = SearchBox.name;
|
|
327
|
+
var props = this.$props;
|
|
328
|
+
var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
|
|
329
|
+
var propValue = props[propName];
|
|
330
|
+
|
|
331
|
+
if (!this.enableAppbase) {
|
|
332
|
+
if (!propValue) {
|
|
333
|
+
console.error(requiredError);
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
338
|
+
console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (Array.isArray(propValue) && propValue.length === 0) {
|
|
343
|
+
console.error(requiredError);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
getComponent: function getComponent(downshiftProps) {
|
|
348
|
+
if (downshiftProps === void 0) {
|
|
349
|
+
downshiftProps = {};
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
var currentValue = this.$data.currentValue;
|
|
353
|
+
var data = {
|
|
354
|
+
error: this.error,
|
|
355
|
+
loading: this.isLoading,
|
|
356
|
+
downshiftProps: downshiftProps,
|
|
357
|
+
data: this.normalizedSuggestions,
|
|
358
|
+
rawData: this.rawData,
|
|
359
|
+
value: currentValue,
|
|
360
|
+
resultStats: this.stats
|
|
361
|
+
};
|
|
362
|
+
return index.getComponent(data, this);
|
|
363
|
+
},
|
|
364
|
+
// returns size and aggs property
|
|
365
|
+
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
366
|
+
var aggregationField = this.$props.aggregationField;
|
|
367
|
+
var queryOptions = helper.getQueryOptions(this.$props);
|
|
368
|
+
|
|
369
|
+
if (aggregationField) {
|
|
370
|
+
queryOptions.aggs = getCompositeAggsQuery({
|
|
371
|
+
props: this.$props,
|
|
372
|
+
showTopHits: true
|
|
373
|
+
}).aggs;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return queryOptions;
|
|
377
|
+
},
|
|
378
|
+
handleSearchIconClick: function handleSearchIconClick() {
|
|
379
|
+
var currentValue = this.currentValue;
|
|
380
|
+
|
|
381
|
+
if (currentValue.trim()) {
|
|
382
|
+
this.setValue(currentValue, true);
|
|
383
|
+
this.onValueSelectedHandler(currentValue, configureStore.causes.SEARCH_ICON_CLICK);
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
387
|
+
var _this = this;
|
|
388
|
+
|
|
389
|
+
if (isDefaultValue === void 0) {
|
|
390
|
+
isDefaultValue = false;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (props === void 0) {
|
|
394
|
+
props = this.$props;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (toggleIsOpen === void 0) {
|
|
398
|
+
toggleIsOpen = true;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (categoryValue === void 0) {
|
|
402
|
+
categoryValue = undefined;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
var performUpdate = function performUpdate() {
|
|
406
|
+
_this.currentValue = value;
|
|
407
|
+
|
|
408
|
+
if (isDefaultValue) {
|
|
409
|
+
if (_this.$props.autosuggest) {
|
|
410
|
+
if (toggleIsOpen) {
|
|
411
|
+
_this.isOpen = false;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
_this.triggerDefaultQuery(value);
|
|
415
|
+
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
416
|
+
// to set the query otherwise the value should reset
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
if (props.strictSelection) {
|
|
420
|
+
if (cause === configureStore.causes.SUGGESTION_SELECT || value === '') {
|
|
421
|
+
_this.triggerCustomQuery(value, categoryValue);
|
|
422
|
+
} else {
|
|
423
|
+
_this.setValue('', true);
|
|
424
|
+
}
|
|
425
|
+
} else if (props.value === undefined) {
|
|
426
|
+
_this.triggerCustomQuery(value, categoryValue);
|
|
427
|
+
}
|
|
428
|
+
} else {
|
|
429
|
+
// debounce for handling text while typing
|
|
430
|
+
_this.handleTextChange(value, cause);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
_this.$emit('valueChange', value);
|
|
434
|
+
|
|
435
|
+
_this.$emit('value-change', value);
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
439
|
+
},
|
|
440
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
|
|
441
|
+
if (!this.$props.autosuggest) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
|
|
446
|
+
var query = SearchBox.defaultQuery(value, this.$props);
|
|
447
|
+
|
|
448
|
+
if (this.defaultQuery) {
|
|
449
|
+
var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
|
|
450
|
+
|
|
451
|
+
if (defaultQueryToBeSet.query) {
|
|
452
|
+
query = defaultQueryToBeSet.query;
|
|
453
|
+
} // Update calculated default query in store
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
index.updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
this.updateQuery({
|
|
460
|
+
componentId: this.internalComponent,
|
|
461
|
+
query: query,
|
|
462
|
+
value: value,
|
|
463
|
+
componentType: constants.componentTypes.searchBox
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
467
|
+
if (categoryValue === void 0) {
|
|
468
|
+
categoryValue = undefined;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
var _this$$props2 = this.$props,
|
|
472
|
+
customQuery = _this$$props2.customQuery,
|
|
473
|
+
filterLabel = _this$$props2.filterLabel,
|
|
474
|
+
showFilter = _this$$props2.showFilter,
|
|
475
|
+
URLParams = _this$$props2.URLParams;
|
|
476
|
+
var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
|
|
477
|
+
var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
|
|
478
|
+
var query = defaultQueryTobeSet;
|
|
479
|
+
|
|
480
|
+
if (customQuery) {
|
|
481
|
+
var customQueryTobeSet = customQuery(value, this.$props);
|
|
482
|
+
var queryTobeSet = customQueryTobeSet.query;
|
|
483
|
+
|
|
484
|
+
if (queryTobeSet) {
|
|
485
|
+
query = queryTobeSet;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
index.updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
this.updateQuery({
|
|
492
|
+
componentId: this.$props.componentId,
|
|
493
|
+
query: query,
|
|
494
|
+
value: value,
|
|
495
|
+
label: filterLabel,
|
|
496
|
+
showFilter: showFilter,
|
|
497
|
+
URLParams: URLParams,
|
|
498
|
+
componentType: constants.componentTypes.searchBox,
|
|
499
|
+
category: categoryValue
|
|
500
|
+
});
|
|
501
|
+
},
|
|
502
|
+
handleFocus: function handleFocus(event) {
|
|
503
|
+
if (this.$props.autosuggest) {
|
|
504
|
+
this.isOpen = true;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
this.$emit('focus', event);
|
|
508
|
+
},
|
|
509
|
+
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
510
|
+
var results = _ref.results;
|
|
511
|
+
|
|
512
|
+
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
513
|
+
this.setValue(results[0][0].transcript.trim(), true);
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
triggerQuery: function triggerQuery(_ref2) {
|
|
517
|
+
var _ref2$isOpen = _ref2.isOpen,
|
|
518
|
+
isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
|
|
519
|
+
_ref2$customQuery = _ref2.customQuery,
|
|
520
|
+
customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
|
|
521
|
+
_ref2$defaultQuery = _ref2.defaultQuery,
|
|
522
|
+
defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
|
|
523
|
+
_ref2$value = _ref2.value,
|
|
524
|
+
value = _ref2$value === void 0 ? undefined : _ref2$value,
|
|
525
|
+
_ref2$categoryValue = _ref2.categoryValue,
|
|
526
|
+
categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
|
|
527
|
+
|
|
528
|
+
if (typeof isOpen === 'boolean') {
|
|
529
|
+
this.isOpen = isOpen;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if (customQuery) {
|
|
533
|
+
this.triggerCustomQuery(value, categoryValue);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
if (defaultQuery) {
|
|
537
|
+
this.triggerDefaultQuery(value);
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
541
|
+
// click analytics would only work client side and after javascript loads
|
|
542
|
+
var docId = documentId;
|
|
543
|
+
|
|
544
|
+
if (!docId) {
|
|
545
|
+
var hitData = this.normalizedSuggestions.find(function (hit) {
|
|
546
|
+
return hit._click_id === searchPosition;
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
if (hitData && hitData.source && hitData.source._id) {
|
|
550
|
+
docId = hitData.source._id;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
this.recordSuggestionClick(searchPosition, docId);
|
|
555
|
+
},
|
|
556
|
+
clearValue: function clearValue() {
|
|
557
|
+
this.setValue('', false, this.$props, configureStore.causes.CLEAR_VALUE, false);
|
|
558
|
+
this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
|
|
559
|
+
},
|
|
560
|
+
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
561
|
+
if (highlightedIndex === void 0) {
|
|
562
|
+
highlightedIndex = null;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
566
|
+
if (event.key === 'Enter') {
|
|
567
|
+
if (this.$props.autosuggest === false) {
|
|
568
|
+
this.enterButtonOnClick();
|
|
569
|
+
} else if (highlightedIndex === null) {
|
|
570
|
+
this.setValue(event.target.value, true);
|
|
571
|
+
this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
|
|
572
|
+
}
|
|
573
|
+
} // Need to review
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
this.$emit('keyDown', event, this.triggerQuery);
|
|
577
|
+
this.$emit('key-down', event, this.triggerQuery);
|
|
578
|
+
},
|
|
579
|
+
onInputChange: function onInputChange(e) {
|
|
580
|
+
var _this2 = this;
|
|
581
|
+
|
|
582
|
+
var inputValue = e.target.value;
|
|
583
|
+
|
|
584
|
+
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
585
|
+
this.isOpen = true;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
var value = this.$props.value;
|
|
589
|
+
|
|
590
|
+
if (value === undefined) {
|
|
591
|
+
this.setValue(inputValue, false, this.$props, inputValue === '' ? configureStore.causes.CLEAR_VALUE : undefined);
|
|
592
|
+
} else {
|
|
593
|
+
this.$emit('change', inputValue, function (_ref3) {
|
|
594
|
+
var isOpen = _ref3.isOpen;
|
|
595
|
+
return _this2.triggerQuery({
|
|
596
|
+
defaultQuery: true,
|
|
597
|
+
customQuery: true,
|
|
598
|
+
value: inputValue,
|
|
599
|
+
isOpen: isOpen
|
|
600
|
+
});
|
|
601
|
+
}, e);
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
605
|
+
var _this3 = this;
|
|
606
|
+
|
|
607
|
+
this.isOpen = false;
|
|
608
|
+
var value = this.$props.value; // Record analytics for selected suggestions
|
|
609
|
+
|
|
610
|
+
this.triggerClickAnalytics(suggestion._click_id);
|
|
611
|
+
|
|
612
|
+
if (value === undefined) {
|
|
613
|
+
this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
614
|
+
} else {
|
|
615
|
+
this.$emit('change', suggestion.value, function (_ref4) {
|
|
616
|
+
var isOpen = _ref4.isOpen;
|
|
617
|
+
return _this3.triggerQuery({
|
|
618
|
+
isOpen: isOpen,
|
|
619
|
+
value: suggestion.value,
|
|
620
|
+
categoryValue: suggestion._category
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
this.onValueSelectedHandler(suggestion.value, configureStore.causes.SUGGESTION_SELECT, suggestion.source);
|
|
626
|
+
},
|
|
627
|
+
onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
|
|
628
|
+
if (currentValue === void 0) {
|
|
629
|
+
currentValue = this.$data.currentValue;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
633
|
+
cause[_key - 1] = arguments[_key];
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
|
|
637
|
+
this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
|
|
638
|
+
},
|
|
639
|
+
handleStateChange: function handleStateChange(changes) {
|
|
640
|
+
var isOpen = changes.isOpen;
|
|
641
|
+
this.isOpen = isOpen;
|
|
642
|
+
},
|
|
643
|
+
getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
|
|
644
|
+
var isDark = this.themePreset === 'dark';
|
|
645
|
+
|
|
646
|
+
if (isDark) {
|
|
647
|
+
return highlightedIndex === index ? '#555' : '#424242';
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
return highlightedIndex === index ? '#eee' : '#fff';
|
|
651
|
+
},
|
|
652
|
+
renderIcon: function renderIcon() {
|
|
653
|
+
var h = this.$createElement;
|
|
654
|
+
|
|
655
|
+
if (this.$props.showIcon) {
|
|
656
|
+
return this.$props.icon || h(DataSearch.SearchSvg);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return null;
|
|
660
|
+
},
|
|
661
|
+
renderErrorComponent: function renderErrorComponent() {
|
|
662
|
+
var h = this.$createElement;
|
|
663
|
+
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
664
|
+
|
|
665
|
+
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
666
|
+
return h(DataSearch.SuggestionWrapper, {
|
|
667
|
+
"attrs": {
|
|
668
|
+
"innerClass": this.$props.innerClass,
|
|
669
|
+
"innerClassName": "error",
|
|
670
|
+
"theme": this.theme,
|
|
671
|
+
"themePreset": this.themePreset
|
|
672
|
+
}
|
|
673
|
+
}, [index.isFunction(renderError) ? renderError(this.error) : renderError]);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
return null;
|
|
677
|
+
},
|
|
678
|
+
renderCancelIcon: function renderCancelIcon() {
|
|
679
|
+
var h = this.$createElement;
|
|
680
|
+
|
|
681
|
+
if (this.$props.showClear) {
|
|
682
|
+
return this.$props.clearIcon || h(CancelSvg.CancelSvg);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
return null;
|
|
686
|
+
},
|
|
687
|
+
renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
|
|
688
|
+
if (finalSuggestionsList === void 0) {
|
|
689
|
+
finalSuggestionsList = [];
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
var h = this.$createElement;
|
|
693
|
+
var _this$$props3 = this.$props,
|
|
694
|
+
theme = _this$$props3.theme,
|
|
695
|
+
innerClass = _this$$props3.innerClass;
|
|
696
|
+
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
697
|
+
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
698
|
+
var _this$$data = this.$data,
|
|
699
|
+
isOpen = _this$$data.isOpen,
|
|
700
|
+
currentValue = _this$$data.currentValue;
|
|
701
|
+
|
|
702
|
+
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
703
|
+
return h(DataSearch.SuggestionWrapper, {
|
|
704
|
+
"attrs": {
|
|
705
|
+
"innerClass": innerClass,
|
|
706
|
+
"themePreset": this.themePreset,
|
|
707
|
+
"theme": theme,
|
|
708
|
+
"innerClassName": "noSuggestion"
|
|
709
|
+
},
|
|
710
|
+
"scopedSlots": {
|
|
711
|
+
"default": function _default() {
|
|
712
|
+
return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return null;
|
|
719
|
+
},
|
|
720
|
+
renderInputAddonBefore: function renderInputAddonBefore() {
|
|
721
|
+
var h = this.$createElement;
|
|
722
|
+
var addonBefore = this.$scopedSlots.addonBefore;
|
|
723
|
+
|
|
724
|
+
if (addonBefore) {
|
|
725
|
+
return h(DataSearch.InputAddon, {
|
|
726
|
+
"class": "addon-before"
|
|
727
|
+
}, [addonBefore()]);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
return null;
|
|
731
|
+
},
|
|
732
|
+
renderInputAddonAfter: function renderInputAddonAfter() {
|
|
733
|
+
var h = this.$createElement;
|
|
734
|
+
var addonAfter = this.$scopedSlots.addonAfter;
|
|
735
|
+
|
|
736
|
+
if (addonAfter) {
|
|
737
|
+
return h(DataSearch.InputAddon, {
|
|
738
|
+
"class": "addon-after"
|
|
739
|
+
}, [addonAfter()]);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return null;
|
|
743
|
+
},
|
|
744
|
+
enterButtonOnClick: function enterButtonOnClick() {
|
|
745
|
+
this.triggerQuery({
|
|
746
|
+
isOpen: false,
|
|
747
|
+
value: this.currentValue,
|
|
748
|
+
customQuery: true
|
|
749
|
+
});
|
|
750
|
+
},
|
|
751
|
+
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
752
|
+
var _this4 = this;
|
|
753
|
+
|
|
754
|
+
var h = this.$createElement;
|
|
755
|
+
var _this$$props4 = this.$props,
|
|
756
|
+
enterButton = _this$$props4.enterButton,
|
|
757
|
+
innerClass = _this$$props4.innerClass;
|
|
758
|
+
var renderEnterButton = this.$scopedSlots.renderEnterButton;
|
|
759
|
+
|
|
760
|
+
if (enterButton) {
|
|
761
|
+
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
762
|
+
if (renderEnterButton) {
|
|
763
|
+
return renderEnterButton(_this4.enterButtonOnClick);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
return h(Button.Button, {
|
|
767
|
+
"class": "enter-btn " + getClassName(innerClass, 'enterButton'),
|
|
768
|
+
"attrs": {
|
|
769
|
+
"primary": true
|
|
770
|
+
},
|
|
771
|
+
"on": {
|
|
772
|
+
"click": _this4.enterButtonOnClick
|
|
773
|
+
}
|
|
774
|
+
}, ["Search"]);
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
return h("div", {
|
|
778
|
+
"class": "enter-button-wrapper"
|
|
779
|
+
}, [getEnterButtonMarkup()]);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
return null;
|
|
783
|
+
},
|
|
784
|
+
renderIcons: function renderIcons() {
|
|
785
|
+
var h = this.$createElement;
|
|
786
|
+
var _this$$props5 = this.$props,
|
|
787
|
+
iconPosition = _this$$props5.iconPosition,
|
|
788
|
+
showClear = _this$$props5.showClear,
|
|
789
|
+
innerClass = _this$$props5.innerClass,
|
|
790
|
+
getMicInstance = _this$$props5.getMicInstance,
|
|
791
|
+
showVoiceSearch = _this$$props5.showVoiceSearch,
|
|
792
|
+
showIcon = _this$$props5.showIcon;
|
|
793
|
+
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
794
|
+
var currentValue = this.$data.currentValue;
|
|
795
|
+
return h("div", [h(CancelSvg.IconGroup, {
|
|
796
|
+
"attrs": {
|
|
797
|
+
"groupPosition": "right",
|
|
798
|
+
"positionType": "absolute"
|
|
799
|
+
}
|
|
800
|
+
}, [currentValue && showClear && h(CancelSvg.IconWrapper, {
|
|
801
|
+
"on": {
|
|
802
|
+
"click": this.clearValue
|
|
803
|
+
},
|
|
804
|
+
"attrs": {
|
|
805
|
+
"showIcon": showIcon,
|
|
806
|
+
"isClearIcon": true
|
|
807
|
+
}
|
|
808
|
+
}, [this.renderCancelIcon()]), showVoiceSearch && h(DataSearch.Mic, {
|
|
809
|
+
"attrs": {
|
|
810
|
+
"getInstance": getMicInstance,
|
|
811
|
+
"render": renderMic,
|
|
812
|
+
"handleResult": this.handleVoiceResults,
|
|
813
|
+
"className": getClassName(innerClass, 'mic') || null
|
|
814
|
+
}
|
|
815
|
+
}), iconPosition === 'right' && showIcon && h(CancelSvg.IconWrapper, {
|
|
816
|
+
"on": {
|
|
817
|
+
"click": this.handleSearchIconClick
|
|
818
|
+
}
|
|
819
|
+
}, [this.renderIcon()])]), h(CancelSvg.IconGroup, {
|
|
820
|
+
"attrs": {
|
|
821
|
+
"groupPosition": "left",
|
|
822
|
+
"positionType": "absolute"
|
|
823
|
+
}
|
|
824
|
+
}, [iconPosition === 'left' && showIcon && h(CancelSvg.IconWrapper, {
|
|
825
|
+
"on": {
|
|
826
|
+
"click": this.handleSearchIconClick
|
|
827
|
+
}
|
|
828
|
+
}, [this.renderIcon()])])]);
|
|
829
|
+
},
|
|
830
|
+
focusSearchBox: function focusSearchBox(event) {
|
|
831
|
+
var _this$$refs, _this$$refs$this$$pro;
|
|
832
|
+
|
|
833
|
+
var elt = event.target || event.srcElement;
|
|
834
|
+
var tagName = elt.tagName;
|
|
835
|
+
|
|
836
|
+
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
837
|
+
// already in an input
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
(_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
|
|
842
|
+
},
|
|
843
|
+
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
844
|
+
var _this5 = this;
|
|
845
|
+
|
|
846
|
+
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
847
|
+
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
848
|
+
|
|
849
|
+
if (index.isEmpty(focusShortcuts)) {
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
var shortcutsString = index.parseFocusShortcuts(focusShortcuts).join(','); // handler for alphabets and other key combinations
|
|
854
|
+
|
|
855
|
+
hotkeys(shortcutsString, // eslint-disable-next-line no-unused-vars
|
|
856
|
+
|
|
857
|
+
/* eslint-disable no-shadow */
|
|
858
|
+
function (event, handler) {
|
|
859
|
+
// Prevent the default refresh event under WINDOWS system
|
|
860
|
+
event.preventDefault();
|
|
861
|
+
|
|
862
|
+
_this5.focusSearchBox(event);
|
|
863
|
+
}); // if one of modifier keys are used, they are handled below
|
|
864
|
+
|
|
865
|
+
hotkeys('*', function (event) {
|
|
866
|
+
var modifierKeys = index.extractModifierKeysFromFocusShortcuts(focusShortcuts);
|
|
867
|
+
if (modifierKeys.length === 0) return;
|
|
868
|
+
|
|
869
|
+
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
870
|
+
var element = modifierKeys[index$1];
|
|
871
|
+
|
|
872
|
+
if (hotkeys[element]) {
|
|
873
|
+
_this5.focusSearchBox(event);
|
|
874
|
+
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
},
|
|
880
|
+
onAutofillClick: function onAutofillClick(suggestion) {
|
|
881
|
+
var value = suggestion.value;
|
|
882
|
+
this.isOpen = true;
|
|
883
|
+
this.currentValue = value;
|
|
884
|
+
this.triggerDefaultQuery(value);
|
|
885
|
+
},
|
|
886
|
+
renderAutoFill: function renderAutoFill(suggestion) {
|
|
887
|
+
var _this6 = this;
|
|
888
|
+
|
|
889
|
+
var h = this.$createElement;
|
|
890
|
+
|
|
891
|
+
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
892
|
+
e.stopPropagation();
|
|
893
|
+
|
|
894
|
+
_this6.onAutofillClick(suggestion);
|
|
895
|
+
};
|
|
896
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
return suggestion._category ? null : h(AutoFillSvg, {
|
|
900
|
+
"on": {
|
|
901
|
+
"click": handleAutoFillClick
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
render: function render() {
|
|
907
|
+
var _this7 = this;
|
|
908
|
+
|
|
909
|
+
var h = arguments[0];
|
|
910
|
+
var _this$$props6 = this.$props,
|
|
911
|
+
theme = _this$$props6.theme,
|
|
912
|
+
expandSuggestionsContainer = _this$$props6.expandSuggestionsContainer;
|
|
913
|
+
var _this$$scopedSlots = this.$scopedSlots,
|
|
914
|
+
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
915
|
+
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
916
|
+
var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
|
|
917
|
+
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
918
|
+
return h(Container.Container, {
|
|
919
|
+
"class": this.$props.className
|
|
920
|
+
}, [this.$props.title && h(Title.Title, {
|
|
921
|
+
"class": getClassName(this.$props.innerClass, 'title') || ''
|
|
922
|
+
}, [this.$props.title]), this.$props.autosuggest ? h(CancelSvg.Downshift, {
|
|
923
|
+
"attrs": {
|
|
924
|
+
"id": this.$props.componentId + "-downshift",
|
|
925
|
+
"handleChange": this.onSuggestionSelected,
|
|
926
|
+
"handleMouseup": this.handleStateChange,
|
|
927
|
+
"isOpen": this.$data.isOpen
|
|
928
|
+
},
|
|
929
|
+
"scopedSlots": {
|
|
930
|
+
"default": function _default(_ref5) {
|
|
931
|
+
var getInputEvents = _ref5.getInputEvents,
|
|
932
|
+
getInputProps = _ref5.getInputProps,
|
|
933
|
+
getItemProps = _ref5.getItemProps,
|
|
934
|
+
getItemEvents = _ref5.getItemEvents,
|
|
935
|
+
isOpen = _ref5.isOpen,
|
|
936
|
+
highlightedIndex = _ref5.highlightedIndex,
|
|
937
|
+
setHighlightedIndex = _ref5.setHighlightedIndex;
|
|
938
|
+
|
|
939
|
+
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
940
|
+
var getIcon = function getIcon(iconType) {
|
|
941
|
+
switch (iconType) {
|
|
942
|
+
case helper.suggestionTypes.Recent:
|
|
943
|
+
return recentSearchesIcon;
|
|
944
|
+
|
|
945
|
+
case helper.suggestionTypes.Popular:
|
|
946
|
+
return popularSearchesIcon;
|
|
947
|
+
|
|
948
|
+
default:
|
|
949
|
+
return null;
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
|
|
954
|
+
isOpen: isOpen,
|
|
955
|
+
getItemProps: getItemProps,
|
|
956
|
+
getItemEvents: getItemEvents,
|
|
957
|
+
highlightedIndex: highlightedIndex
|
|
958
|
+
}), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
959
|
+
"class": Input.suggestions(_this7.themePreset, theme) + " " + getClassName(_this7.$props.innerClass, 'list')
|
|
960
|
+
}, [_this7.normalizedSuggestions.map(function (item, index) {
|
|
961
|
+
return renderItem ? h("li", {
|
|
962
|
+
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
963
|
+
item: item
|
|
964
|
+
})),
|
|
965
|
+
"on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
|
|
966
|
+
item: item
|
|
967
|
+
})),
|
|
968
|
+
"key": index + 1 + "-" + item.value,
|
|
969
|
+
"style": {
|
|
970
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
|
|
971
|
+
justifyContent: 'flex-start',
|
|
972
|
+
alignItems: 'center'
|
|
973
|
+
}
|
|
974
|
+
}, [renderItem(item)]) : h("li", {
|
|
975
|
+
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
976
|
+
item: item
|
|
977
|
+
})),
|
|
978
|
+
"on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
|
|
979
|
+
item: item
|
|
980
|
+
})),
|
|
981
|
+
"key": index + 1 + "-" + item.value,
|
|
982
|
+
"style": {
|
|
983
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
|
|
984
|
+
justifyContent: 'flex-start',
|
|
985
|
+
alignItems: 'center'
|
|
986
|
+
}
|
|
987
|
+
}, [h("div", {
|
|
988
|
+
"style": {
|
|
989
|
+
padding: '0 10px 0 0',
|
|
990
|
+
display: 'flex'
|
|
991
|
+
}
|
|
992
|
+
}, [h(DataSearch.CustomSvg, {
|
|
993
|
+
"attrs": {
|
|
994
|
+
"className": getClassName(_this7.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
995
|
+
"icon": getIcon(item._suggestion_type),
|
|
996
|
+
"type": item._suggestion_type + "-search-icon"
|
|
997
|
+
}
|
|
998
|
+
})]), h(DataSearch.SuggestionItem, {
|
|
999
|
+
"attrs": {
|
|
1000
|
+
"currentValue": _this7.currentValue,
|
|
1001
|
+
"suggestion": item
|
|
1002
|
+
}
|
|
1003
|
+
}), _this7.renderAutoFill(item)]);
|
|
1004
|
+
})]) : _this7.renderNoSuggestions(_this7.normalizedSuggestions)]);
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
return h("div", {
|
|
1008
|
+
"class": Input.suggestionsContainer
|
|
1009
|
+
}, [h(DataSearch.InputGroup, [_this7.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1010
|
+
"attrs": {
|
|
1011
|
+
"id": _this7.$props.componentId + "-input",
|
|
1012
|
+
"showIcon": _this7.$props.showIcon,
|
|
1013
|
+
"showClear": _this7.$props.showClear,
|
|
1014
|
+
"iconPosition": _this7.$props.iconPosition,
|
|
1015
|
+
"placeholder": _this7.$props.placeholder,
|
|
1016
|
+
"autoFocus": _this7.$props.autoFocus,
|
|
1017
|
+
"themePreset": _this7.themePreset,
|
|
1018
|
+
"autocomplete": "off"
|
|
1019
|
+
},
|
|
1020
|
+
"ref": _this7.$props.innerRef,
|
|
1021
|
+
"class": getClassName(_this7.$props.innerClass, 'input'),
|
|
1022
|
+
"on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
|
|
1023
|
+
onInput: _this7.onInputChange,
|
|
1024
|
+
onBlur: function onBlur(e) {
|
|
1025
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
1026
|
+
},
|
|
1027
|
+
onFocus: _this7.handleFocus,
|
|
1028
|
+
onKeyPress: function onKeyPress(e) {
|
|
1029
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
1030
|
+
|
|
1031
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
1032
|
+
},
|
|
1033
|
+
onKeyDown: function onKeyDown(e) {
|
|
1034
|
+
return _this7.handleKeyDown(e, highlightedIndex);
|
|
1035
|
+
},
|
|
1036
|
+
onKeyUp: function onKeyUp(e) {
|
|
1037
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
1038
|
+
|
|
1039
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
1040
|
+
},
|
|
1041
|
+
onClick: function onClick() {
|
|
1042
|
+
setHighlightedIndex(null);
|
|
1043
|
+
}
|
|
1044
|
+
})),
|
|
1045
|
+
"domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
|
|
1046
|
+
value: _this7.$data.currentValue === null ? '' : _this7.$data.currentValue
|
|
1047
|
+
}))
|
|
1048
|
+
}), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this7.renderInputAddonAfter(), _this7.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}) : h("div", {
|
|
1052
|
+
"class": Input.suggestionsContainer
|
|
1053
|
+
}, [h(DataSearch.InputGroup, [this.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1054
|
+
"class": getClassName(this.$props.innerClass, 'input') || '',
|
|
1055
|
+
"attrs": {
|
|
1056
|
+
"placeholder": this.$props.placeholder,
|
|
1057
|
+
"iconPosition": this.$props.iconPosition,
|
|
1058
|
+
"showIcon": this.$props.showIcon,
|
|
1059
|
+
"showClear": this.$props.showClear,
|
|
1060
|
+
"themePreset": this.themePreset
|
|
1061
|
+
},
|
|
1062
|
+
"on": _rollupPluginBabelHelpers._extends({}, {
|
|
1063
|
+
blur: function blur(e) {
|
|
1064
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
1065
|
+
},
|
|
1066
|
+
keypress: function keypress(e) {
|
|
1067
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
1068
|
+
|
|
1069
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
1070
|
+
},
|
|
1071
|
+
input: this.onInputChange,
|
|
1072
|
+
focus: function focus(e) {
|
|
1073
|
+
_this7.$emit('focus', e, _this7.triggerQuery);
|
|
1074
|
+
},
|
|
1075
|
+
keydown: this.handleKeyDown,
|
|
1076
|
+
keyup: function keyup(e) {
|
|
1077
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
1078
|
+
|
|
1079
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
1080
|
+
}
|
|
1081
|
+
}),
|
|
1082
|
+
"domProps": _rollupPluginBabelHelpers._extends({}, {
|
|
1083
|
+
autofocus: this.$props.autoFocus,
|
|
1084
|
+
value: this.$data.currentValue ? this.$data.currentValue : ''
|
|
1085
|
+
}),
|
|
1086
|
+
"ref": this.$props.innerRef
|
|
1087
|
+
}), this.renderIcons()]), this.renderInputAddonAfter(), this.renderEnterButtonElement()])])]);
|
|
1088
|
+
},
|
|
1089
|
+
destroyed: function destroyed() {
|
|
1090
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
SearchBox.defaultQuery = function (value, props) {
|
|
1095
|
+
var finalQuery = null;
|
|
1096
|
+
var fields = normalizeDataField(props.dataField, props.fieldWeights);
|
|
1097
|
+
finalQuery = {
|
|
1098
|
+
bool: {
|
|
1099
|
+
should: SearchBox.shouldQuery(value, fields, props),
|
|
1100
|
+
minimum_should_match: '1'
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
if (finalQuery && props.nestedField) {
|
|
1105
|
+
return {
|
|
1106
|
+
query: {
|
|
1107
|
+
nested: {
|
|
1108
|
+
path: props.nestedField,
|
|
1109
|
+
query: finalQuery
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
return finalQuery;
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
SearchBox.shouldQuery = function (value, dataFields, props) {
|
|
1119
|
+
var finalQuery = [];
|
|
1120
|
+
var phrasePrefixFields = [];
|
|
1121
|
+
var fields = dataFields.map(function (dataField) {
|
|
1122
|
+
var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
|
|
1123
|
+
|
|
1124
|
+
if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
|
|
1125
|
+
phrasePrefixFields.push(queryField);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
return queryField;
|
|
1129
|
+
});
|
|
1130
|
+
|
|
1131
|
+
if (props.searchOperators || props.queryString) {
|
|
1132
|
+
return {
|
|
1133
|
+
query: value,
|
|
1134
|
+
fields: fields,
|
|
1135
|
+
default_operator: props.queryFormat
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
if (props.queryFormat === 'and') {
|
|
1140
|
+
finalQuery.push({
|
|
1141
|
+
multi_match: {
|
|
1142
|
+
query: value,
|
|
1143
|
+
fields: fields,
|
|
1144
|
+
type: 'cross_fields',
|
|
1145
|
+
operator: 'and'
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
finalQuery.push({
|
|
1149
|
+
multi_match: {
|
|
1150
|
+
query: value,
|
|
1151
|
+
fields: fields,
|
|
1152
|
+
type: 'phrase',
|
|
1153
|
+
operator: 'and'
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
|
|
1157
|
+
if (phrasePrefixFields.length > 0) {
|
|
1158
|
+
finalQuery.push({
|
|
1159
|
+
multi_match: {
|
|
1160
|
+
query: value,
|
|
1161
|
+
fields: phrasePrefixFields,
|
|
1162
|
+
type: 'phrase_prefix',
|
|
1163
|
+
operator: 'and'
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
return finalQuery;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
finalQuery.push({
|
|
1172
|
+
multi_match: {
|
|
1173
|
+
query: value,
|
|
1174
|
+
fields: fields,
|
|
1175
|
+
type: 'best_fields',
|
|
1176
|
+
operator: 'or',
|
|
1177
|
+
fuzziness: props.fuzziness ? props.fuzziness : 0
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
finalQuery.push({
|
|
1181
|
+
multi_match: {
|
|
1182
|
+
query: value,
|
|
1183
|
+
fields: fields,
|
|
1184
|
+
type: 'phrase',
|
|
1185
|
+
operator: 'or'
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
|
|
1189
|
+
if (phrasePrefixFields.length > 0) {
|
|
1190
|
+
finalQuery.push({
|
|
1191
|
+
multi_match: {
|
|
1192
|
+
query: value,
|
|
1193
|
+
fields: phrasePrefixFields,
|
|
1194
|
+
type: 'phrase_prefix',
|
|
1195
|
+
operator: 'or'
|
|
1196
|
+
}
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
return finalQuery;
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1203
|
+
var mapStateToProps = function mapStateToProps(state, props) {
|
|
1204
|
+
return {
|
|
1205
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
1206
|
+
selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
|
|
1207
|
+
suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
1208
|
+
rawData: state.rawData[props.componentId],
|
|
1209
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
1210
|
+
themePreset: state.config.themePreset,
|
|
1211
|
+
isLoading: !!state.isLoading[props.componentId + "_active"],
|
|
1212
|
+
error: state.error[props.componentId],
|
|
1213
|
+
enableAppbase: state.config.enableAppbase,
|
|
1214
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
1215
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
1216
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
1217
|
+
};
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
var mapDispatchToProps = {
|
|
1221
|
+
updateQuery: updateQuery,
|
|
1222
|
+
setCustomQuery: setCustomQuery,
|
|
1223
|
+
setDefaultQuery: setDefaultQuery,
|
|
1224
|
+
recordSuggestionClick: recordSuggestionClick
|
|
1225
|
+
};
|
|
1226
|
+
var DSConnected = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
|
|
1227
|
+
componentType: constants.componentTypes.searchBox,
|
|
1228
|
+
internalComponent: true
|
|
1229
|
+
});
|
|
1230
|
+
|
|
1231
|
+
SearchBox.install = function (Vue) {
|
|
1232
|
+
Vue.component(SearchBox.name, DSConnected);
|
|
1233
|
+
}; // Add componentType for SSR
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
SearchBox.componentType = constants.componentTypes.searchBox;
|
|
1237
|
+
|
|
1238
|
+
var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, DataSearch.DataSearch, SearchBox, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.default, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default];
|
|
1239
|
+
function install (Vue) {
|
|
1240
|
+
components.map(function (component) {
|
|
1241
|
+
Vue.use(component);
|
|
1242
|
+
return null;
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
exports.SearchBox = SearchBox;
|
|
1247
|
+
exports.install = install;
|