@appbaseio/reactivesearch-vue 1.34.0-alpha.2 → 1.35.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/dist/@appbaseio/reactivesearch-vue.umd.js +10892 -8633
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +12 -11
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/Button-841fd06d.js +62 -0
- package/dist/cjs/{CancelSvg-062a42f0.js → CancelSvg-220a7cc3.js} +40 -32
- package/dist/cjs/Card-240f283d.js +30 -0
- package/dist/cjs/{ComponentWrapper-db45cc6d.js → ComponentWrapper-94c50228.js} +7 -7
- package/dist/cjs/Container-e699ea95.js +15 -0
- package/dist/cjs/DataSearch.js +1313 -20
- package/dist/cjs/{DropDown-3b899b20.js → DropDown-c6b79b05.js} +79 -78
- package/dist/cjs/DynamicRangeSlider.js +47 -56
- package/dist/cjs/Flex-ddd7cb6b.js +50 -0
- package/dist/cjs/FormControlList-bbb5cd24.js +45 -0
- package/dist/cjs/Input-ead4cd84.js +77 -0
- package/dist/cjs/ListItem-5088bd6a.js +45 -0
- package/dist/cjs/MultiDropdownList.js +69 -74
- package/dist/cjs/MultiList.js +95 -89
- package/dist/cjs/MultiRange.js +45 -54
- package/dist/cjs/{Pagination-a468f960.js → Pagination-6d184d4a.js} +53 -56
- package/dist/cjs/{PreferencesConsumer-034c55e3.js → PreferencesConsumer-5e6e84a2.js} +5 -6
- package/dist/cjs/RangeInput.js +108 -115
- package/dist/cjs/RangeSlider.js +40 -50
- package/dist/cjs/ReactiveBase.js +55 -69
- package/dist/cjs/ReactiveComponent.js +317 -46
- package/dist/cjs/{ReactiveComponent-f0f486ca.js → ReactiveComponentPrivate-6f03f300.js} +322 -618
- package/dist/cjs/ReactiveComponentPrivate.js +55 -0
- package/dist/cjs/ReactiveGoogleMap.js +442 -384
- package/dist/cjs/ReactiveList.js +129 -100
- package/dist/cjs/ResultCard.js +19 -26
- package/dist/cjs/ResultList.js +27 -31
- package/dist/cjs/SelectedFilters.js +34 -49
- package/dist/cjs/SingleDropdownList.js +67 -73
- package/dist/cjs/SingleList.js +97 -90
- package/dist/cjs/SingleRange.js +43 -48
- package/dist/cjs/StateProvider.js +2 -2
- package/dist/cjs/Tags-d464c22e.js +883 -0
- package/dist/cjs/Title-16042ea0.js +15 -0
- package/dist/cjs/ToggleButton.js +35 -39
- package/dist/cjs/{index-dc25b706.js → index-de136c17.js} +8 -6
- package/dist/cjs/index.js +27 -25
- package/dist/cjs/initReactivesearch.js +0 -3
- package/dist/cjs/install.js +23 -22
- package/dist/cjs/ssr-f2fc1bf6.js +36 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-621a8143.js → vueTypes-568ce5e6.js} +4 -2
- package/dist/es/Button-153cd885.js +53 -0
- package/dist/es/{CancelSvg-14ebc9a1.js → CancelSvg-e40552a5.js} +37 -30
- package/dist/es/{Card-1951569e.js → Card-19ad6d90.js} +6 -5
- package/dist/es/{ComponentWrapper-bf443c0b.js → ComponentWrapper-edaeaceb.js} +6 -6
- package/dist/es/Container-d00219f7.js +1 -1
- package/dist/es/DataSearch.js +1313 -18
- package/dist/es/{DropDown-35e232b7.js → DropDown-c685912c.js} +78 -78
- package/dist/es/DynamicRangeSlider.js +44 -53
- package/dist/es/Flex-7c177a10.js +45 -0
- package/dist/es/FormControlList-99797d0a.js +38 -0
- package/dist/es/Input-c09c0b56.js +69 -0
- package/dist/es/{ListItem-47a6345a.js → ListItem-07888a65.js} +7 -6
- package/dist/es/MultiDropdownList.js +67 -72
- package/dist/es/MultiList.js +94 -88
- package/dist/es/MultiRange.js +43 -52
- package/dist/es/{Pagination-145b4ff2.js → Pagination-f477f92f.js} +53 -56
- package/dist/es/{PreferencesConsumer-7ea7313a.js → PreferencesConsumer-86a676c8.js} +4 -5
- package/dist/es/RangeInput.js +104 -112
- package/dist/es/RangeSlider.js +37 -47
- package/dist/es/ReactiveBase.js +53 -68
- package/dist/es/ReactiveComponent.js +317 -45
- package/dist/es/{ReactiveComponent-e2fb9eb4.js → ReactiveComponentPrivate-4467524a.js} +317 -614
- package/dist/es/ReactiveComponentPrivate.js +47 -0
- package/dist/es/ReactiveGoogleMap.js +437 -380
- package/dist/es/ReactiveList.js +126 -98
- package/dist/es/ResultCard.js +18 -25
- package/dist/es/ResultList.js +26 -30
- package/dist/es/SelectedFilters.js +32 -47
- package/dist/es/SingleDropdownList.js +65 -71
- package/dist/es/SingleList.js +95 -88
- package/dist/es/SingleRange.js +41 -46
- package/dist/es/StateProvider.js +2 -2
- package/dist/es/Tags-ebf363ec.js +869 -0
- package/dist/es/Title-863dfa42.js +1 -1
- package/dist/es/ToggleButton.js +33 -37
- package/dist/es/{index-285a43a6.js → index-5509c0bc.js} +8 -6
- package/dist/es/index.js +20 -19
- package/dist/es/initReactivesearch.js +0 -3
- package/dist/es/install.js +20 -19
- package/dist/es/ssr-03607d84.js +1 -1
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-e4af6fe2.js → vueTypes-7f572665.js} +4 -2
- package/package.json +87 -87
- package/dist/cjs/Button-626c5e8e.js +0 -58
- package/dist/cjs/Card-c381ded3.js +0 -26
- package/dist/cjs/Container-29f049b2.js +0 -12
- package/dist/cjs/DataSearch-7c71ec9f.js +0 -2043
- package/dist/cjs/Flex-d5675ea6.js +0 -48
- package/dist/cjs/FormControlList-cf1ff2ca.js +0 -42
- package/dist/cjs/Input-4d278ca0.js +0 -74
- package/dist/cjs/ListItem-c067bc07.js +0 -41
- package/dist/cjs/Title-8802a218.js +0 -12
- package/dist/cjs/ssr-eb901d09.js +0 -35
- package/dist/es/Button-ebafa3d6.js +0 -52
- package/dist/es/DataSearch-4f9a4e46.js +0 -2028
- package/dist/es/Flex-a08e22d7.js +0 -46
- package/dist/es/FormControlList-fa5cf78b.js +0 -38
- package/dist/es/Input-3b8408a6.js +0 -69
|
@@ -1,2028 +0,0 @@
|
|
|
1
|
-
import { helper, Actions, causes } from '@appbaseio/reactivecore';
|
|
2
|
-
import { SEARCH_COMPONENTS_MODES, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
-
import { createVNode, createTextVNode, isVNode, mergeProps } from 'vue';
|
|
5
|
-
import VueTypes from 'vue-types';
|
|
6
|
-
import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
7
|
-
import { styled, createGlobalStyle } from '@appbaseio/vue-emotion';
|
|
8
|
-
import { css, cx } from 'emotion';
|
|
9
|
-
import { t as types } from './vueTypes-e4af6fe2.js';
|
|
10
|
-
import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, j as getQuerySuggestionsComponent, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, m as hasQuerySuggestionsRenderer, c as connect } from './index-285a43a6.js';
|
|
11
|
-
import { C as ComponentWrapper } from './ComponentWrapper-bf443c0b.js';
|
|
12
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-7ea7313a.js';
|
|
13
|
-
import { T as Title } from './Title-863dfa42.js';
|
|
14
|
-
import { F as Flex } from './Flex-a08e22d7.js';
|
|
15
|
-
import hotkeys from 'hotkeys-js';
|
|
16
|
-
import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './CancelSvg-14ebc9a1.js';
|
|
17
|
-
import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-3b8408a6.js';
|
|
18
|
-
import { C as Container } from './Container-d00219f7.js';
|
|
19
|
-
import Highlight from 'vue-highlight-words';
|
|
20
|
-
|
|
21
|
-
var _templateObject;
|
|
22
|
-
var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
|
|
23
|
-
InputGroup.defaultProps = {
|
|
24
|
-
className: 'input-group'
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var _templateObject$1;
|
|
28
|
-
var InputAddon = styled('span')(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid #ccc;\n border-radius: 2px;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-weight: 400;\n padding: 0 11px;\n position: relative;\n transition: all 0.3s;\n box-sizing: border-box;\n overflow: hidden;\n\n &:first-of-type {\n border-right: none;\n }\n &:last-of-type {\n border-left: none;\n }\n"])));
|
|
29
|
-
InputAddon.defaultProps = {
|
|
30
|
-
className: 'input-addon'
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var getClassName = helper.getClassName;
|
|
34
|
-
var SuggestionWrapper = {
|
|
35
|
-
name: 'SuggestionWrapper',
|
|
36
|
-
props: {
|
|
37
|
-
innerClassName: types.string,
|
|
38
|
-
themePreset: types.themePreset,
|
|
39
|
-
innerClass: types.style
|
|
40
|
-
},
|
|
41
|
-
render: function render() {
|
|
42
|
-
var _this$$props = this.$props,
|
|
43
|
-
themePreset = _this$$props.themePreset,
|
|
44
|
-
innerClass = _this$$props.innerClass,
|
|
45
|
-
innerClassName = _this$$props.innerClassName;
|
|
46
|
-
return createVNode("div", {
|
|
47
|
-
"class": noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
|
|
48
|
-
}, [createVNode("li", null, [this.$slots["default"]()])]);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var _templateObject$2;
|
|
53
|
-
var highlightStyle = {
|
|
54
|
-
fontWeight: 600,
|
|
55
|
-
padding: 0,
|
|
56
|
-
backgroundColor: 'transparent',
|
|
57
|
-
color: 'inherit'
|
|
58
|
-
};
|
|
59
|
-
var PredictiveSuggestion = styled('span')(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteralLoose(["\n\t.highlight {\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tpadding: 0;\n\t}\n"])));
|
|
60
|
-
var SuggestionItem = {
|
|
61
|
-
name: 'SuggestionItem',
|
|
62
|
-
props: {
|
|
63
|
-
currentValue: types.string,
|
|
64
|
-
suggestion: types.any
|
|
65
|
-
},
|
|
66
|
-
render: function render() {
|
|
67
|
-
var _this = this;
|
|
68
|
-
var _this$suggestion = this.suggestion,
|
|
69
|
-
label = _this$suggestion.label,
|
|
70
|
-
value = _this$suggestion.value,
|
|
71
|
-
title = _this$suggestion.title,
|
|
72
|
-
description = _this$suggestion.description,
|
|
73
|
-
image = _this$suggestion.image,
|
|
74
|
-
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
|
|
75
|
-
_suggestion_type = _this$suggestion._suggestion_type,
|
|
76
|
-
_category = _this$suggestion._category;
|
|
77
|
-
if (label) {
|
|
78
|
-
// label has highest precedence
|
|
79
|
-
return typeof label === 'string' ? createVNode("div", {
|
|
80
|
-
"class": "trim"
|
|
81
|
-
}, [(_category ? false : isPredictiveSuggestion
|
|
82
|
-
// eslint-disable-next-line
|
|
83
|
-
|| !!_suggestion_type) ? createVNode(PredictiveSuggestion, {
|
|
84
|
-
"innerHTML": label
|
|
85
|
-
}, null) : createVNode(Highlight, {
|
|
86
|
-
"searchWords": _category ? [_category] : this.currentValue.split(' '),
|
|
87
|
-
"textToHighlight": label,
|
|
88
|
-
"autoEscape": true,
|
|
89
|
-
"highlightStyle": highlightStyle
|
|
90
|
-
}, null)]) : label;
|
|
91
|
-
}
|
|
92
|
-
if (title || image || description) {
|
|
93
|
-
return createVNode(Flex, {
|
|
94
|
-
"alignItems": "center",
|
|
95
|
-
"css": {
|
|
96
|
-
width: '100%'
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
"default": function _default() {
|
|
100
|
-
return [image && createVNode("div", {
|
|
101
|
-
"css": {
|
|
102
|
-
margin: 'auto',
|
|
103
|
-
marginRight: 10
|
|
104
|
-
}
|
|
105
|
-
}, [createVNode("img", {
|
|
106
|
-
"src": image,
|
|
107
|
-
"alt": " ",
|
|
108
|
-
"height": "50px",
|
|
109
|
-
"width": "50px",
|
|
110
|
-
"css": {
|
|
111
|
-
objectFit: 'contain'
|
|
112
|
-
}
|
|
113
|
-
}, null)]), createVNode(Flex, {
|
|
114
|
-
"direction": "column",
|
|
115
|
-
"css": {
|
|
116
|
-
width: image ? 'calc(100% - 60px)' : '100%'
|
|
117
|
-
}
|
|
118
|
-
}, {
|
|
119
|
-
"default": function _default() {
|
|
120
|
-
return [title && createVNode("div", {
|
|
121
|
-
"class": "trim"
|
|
122
|
-
}, [createVNode(Highlight, {
|
|
123
|
-
"searchWords": _this.currentValue.split(' '),
|
|
124
|
-
"textToHighlight": title,
|
|
125
|
-
"highlightStyle": highlightStyle,
|
|
126
|
-
"class": css({
|
|
127
|
-
fontSize: '1rem'
|
|
128
|
-
})
|
|
129
|
-
}, null)]), description && createVNode("div", {
|
|
130
|
-
"class": cx('trim', css({
|
|
131
|
-
marginTop: 3
|
|
132
|
-
}))
|
|
133
|
-
}, [createVNode(Highlight, {
|
|
134
|
-
"searchWords": _this.currentValue.split(' '),
|
|
135
|
-
"textToHighlight": description,
|
|
136
|
-
"highlightStyle": highlightStyle
|
|
137
|
-
}, null)])];
|
|
138
|
-
}
|
|
139
|
-
})];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
return value;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
var SearchSvg = {
|
|
148
|
-
name: 'SearchSvg',
|
|
149
|
-
props: ['styles'],
|
|
150
|
-
render: function render() {
|
|
151
|
-
return createVNode("svg", {
|
|
152
|
-
"alt": "Search",
|
|
153
|
-
"class": "search-icon",
|
|
154
|
-
"height": "12",
|
|
155
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
156
|
-
"viewBox": "0 0 15 15",
|
|
157
|
-
"style": _extends({
|
|
158
|
-
transform: 'scale(1.35)',
|
|
159
|
-
position: 'relative'
|
|
160
|
-
}, this.$props.styles ? this.$props.styles : {})
|
|
161
|
-
}, [createVNode("title", null, [createTextVNode("Search")]), createVNode("path", {
|
|
162
|
-
"d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
|
|
163
|
-
}, null)]);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
var _templateObject$3;
|
|
168
|
-
|
|
169
|
-
// eslint-disable-next-line
|
|
170
|
-
createGlobalStyle(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n\t#el_TvxDfTAtKp {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_D93PK3GbmJ {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t\tfill: #d8d8d8;\n\t}\n"])));
|
|
171
|
-
var MicSvg = {
|
|
172
|
-
name: 'MicSvg',
|
|
173
|
-
props: ['className'],
|
|
174
|
-
render: function render() {
|
|
175
|
-
return createVNode("svg", {
|
|
176
|
-
"viewBox": "0 0 480 480",
|
|
177
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
178
|
-
"id": "el_xS0FRzQjJ",
|
|
179
|
-
"width": 28,
|
|
180
|
-
"height": 28,
|
|
181
|
-
"className": this.$props.className,
|
|
182
|
-
"style": {
|
|
183
|
-
transform: 'scale(1.5)'
|
|
184
|
-
}
|
|
185
|
-
}, [createVNode("g", {
|
|
186
|
-
"id": "el_TvxDfTAtKp",
|
|
187
|
-
"fillRule": "evenodd"
|
|
188
|
-
}, [createVNode("g", {
|
|
189
|
-
"id": "el_D93PK3GbmJ",
|
|
190
|
-
"fillRule": "nonzero",
|
|
191
|
-
"style": {
|
|
192
|
-
fill: '#595959'
|
|
193
|
-
}
|
|
194
|
-
}, [createVNode("path", {
|
|
195
|
-
"d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
|
|
196
|
-
"id": "el_uly3EwA2O3"
|
|
197
|
-
}, null), createVNode("path", {
|
|
198
|
-
"d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
|
|
199
|
-
"id": "el_tnDbR4ytu4"
|
|
200
|
-
}, null)])])]);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
var _templateObject$4;
|
|
205
|
-
|
|
206
|
-
// eslint-disable-next-line
|
|
207
|
-
createGlobalStyle(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\t#el_X81iT9kZYo {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_gMpyalCphp {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t}\n\t#el_c7H-3u-D4l {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_qhFcdAAFwo {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_M8X8g37WOI {\n\t\tstroke: #e83137;\n\t\tstroke-width: 21;\n\t}\n"])));
|
|
208
|
-
var MuteSvg = {
|
|
209
|
-
name: 'MuteSvg',
|
|
210
|
-
props: ['className'],
|
|
211
|
-
render: function render() {
|
|
212
|
-
return createVNode("svg", {
|
|
213
|
-
"style": {
|
|
214
|
-
transform: 'scale(1.5)'
|
|
215
|
-
},
|
|
216
|
-
"viewBox": "0 0 480 480",
|
|
217
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
218
|
-
"id": "el_D1rEpH2zj",
|
|
219
|
-
"width": 28,
|
|
220
|
-
"height": 28,
|
|
221
|
-
"className": this.$props.className
|
|
222
|
-
}, [createVNode("g", {
|
|
223
|
-
"id": "el_X81iT9kZYo",
|
|
224
|
-
"fillRule": "evenodd"
|
|
225
|
-
}, [createVNode("g", {
|
|
226
|
-
"id": "el_gMpyalCphp"
|
|
227
|
-
}, [createVNode("path", {
|
|
228
|
-
"d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
|
|
229
|
-
"id": "el_c7H-3u-D4l",
|
|
230
|
-
"fillRule": "nonzero",
|
|
231
|
-
"style": {
|
|
232
|
-
fill: '#595959'
|
|
233
|
-
}
|
|
234
|
-
}, null), createVNode("path", {
|
|
235
|
-
"d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
|
|
236
|
-
"id": "el_qhFcdAAFwo",
|
|
237
|
-
"fillRule": "nonzero",
|
|
238
|
-
"style": {
|
|
239
|
-
fill: '#595959'
|
|
240
|
-
}
|
|
241
|
-
}, null), createVNode("path", {
|
|
242
|
-
"d": "M11.5,206.5 L142.5,12.5",
|
|
243
|
-
"id": "el_M8X8g37WOI",
|
|
244
|
-
"strokeLinecap": "round",
|
|
245
|
-
"strokeLinejoin": "round"
|
|
246
|
-
}, null)])])]);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
var _templateObject$5;
|
|
251
|
-
|
|
252
|
-
// eslint-disable-next-line
|
|
253
|
-
createGlobalStyle(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\t@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t#el_hiibMG0x- * {\n\t\t-webkit-animation-duration: 1.2s;\n\t\tanimation-duration: 1.2s;\n\t\t-webkit-animation-iteration-count: infinite;\n\t\tanimation-iteration-count: infinite;\n\t\t-webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t}\n\t#el_QJeJ_2CDw5 {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_UYYCfubTRf {\n\t\t-webkit-transform: translate(163px, 123px);\n\t\ttransform: translate(163px, 123px);\n\t}\n\t#el_uzZNtK32Zi {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_EYKQ2N9Kgy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6SDP2LAgKC {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t}\n\t#el_-Vm65Ltfy7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_q04iZcSim4 {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6WKby7wXqV {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\tanimation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_9bggsfQOtU {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_NKxqi9eIym {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_Wi-my975tM {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\tanimation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_zclQ34fvf7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_1OsvRT8HkeZ {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DkfFFTaFxy8 {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\tanimation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_aa9sjx4H0vA {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_tea114vWg0J {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_34IgwiMB5rf {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\tanimation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_z5u6RAFhx7d {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_7nfuWmA5Uhy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DeebuCsPTGA {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\tanimation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el__ZcqlS20zcw {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_8DnEQnD7VWV {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_ZOjjrPTvyrv {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\tanimation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_FYYKCI_u24e {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_XZty4MnTp5Y {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_2FATegVmf0K {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\tanimation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_RMT1KUfbdF8 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_RgLcovvFiO1 {\n\t\tfill: #d8d8d8;\n\t}\n"])));
|
|
254
|
-
var ListenSvg = {
|
|
255
|
-
name: 'ListenSvg',
|
|
256
|
-
props: ['className'],
|
|
257
|
-
render: function render() {
|
|
258
|
-
return createVNode("svg", {
|
|
259
|
-
"viewBox": "0 0 480 480",
|
|
260
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
261
|
-
"xmlnsXlink": "http://www.w3.org/1999/xlink",
|
|
262
|
-
"id": "el_hiibMG0x-",
|
|
263
|
-
"width": 28,
|
|
264
|
-
"height": 29,
|
|
265
|
-
"className": this.$props.className,
|
|
266
|
-
"style": {
|
|
267
|
-
transform: 'scale(1.5)'
|
|
268
|
-
}
|
|
269
|
-
}, [createVNode("defs", null, [createVNode("path", {
|
|
270
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
271
|
-
"id": "path-1"
|
|
272
|
-
}, null), createVNode("path", {
|
|
273
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
274
|
-
"id": "path-3"
|
|
275
|
-
}, null), createVNode("path", {
|
|
276
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
277
|
-
"id": "path-5"
|
|
278
|
-
}, null), createVNode("path", {
|
|
279
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
280
|
-
"id": "path-7"
|
|
281
|
-
}, null), createVNode("path", {
|
|
282
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
283
|
-
"id": "path-9"
|
|
284
|
-
}, null), createVNode("path", {
|
|
285
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
286
|
-
"id": "path-11"
|
|
287
|
-
}, null), createVNode("path", {
|
|
288
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
289
|
-
"id": "path-13"
|
|
290
|
-
}, null), createVNode("path", {
|
|
291
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
292
|
-
"id": "path-15"
|
|
293
|
-
}, null)]), createVNode("g", {
|
|
294
|
-
"id": "el_QJeJ_2CDw5",
|
|
295
|
-
"fillRule": "evenodd"
|
|
296
|
-
}, [createVNode("g", {
|
|
297
|
-
"id": "el_UYYCfubTRf"
|
|
298
|
-
}, [createVNode("path", {
|
|
299
|
-
"d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
|
|
300
|
-
"id": "el_uzZNtK32Zi",
|
|
301
|
-
"fillRule": "nonzero",
|
|
302
|
-
"style": {
|
|
303
|
-
fill: '#0B6AFF'
|
|
304
|
-
}
|
|
305
|
-
}, null), createVNode("path", {
|
|
306
|
-
"d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,0 76.9864699,0 C55.8825877,0 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
|
|
307
|
-
"id": "el_EYKQ2N9Kgy",
|
|
308
|
-
"fillRule": "nonzero"
|
|
309
|
-
}, null), createVNode("g", {
|
|
310
|
-
"id": "el_6SDP2LAgKC"
|
|
311
|
-
}, [createVNode("mask", {
|
|
312
|
-
"id": "mask-2",
|
|
313
|
-
"fill": "#fff"
|
|
314
|
-
}, [createVNode("use", {
|
|
315
|
-
"xlink:href": "#path-1"
|
|
316
|
-
}, null)]), createVNode("path", {
|
|
317
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
318
|
-
"id": "el_-Vm65Ltfy7",
|
|
319
|
-
"fillRule": "nonzero",
|
|
320
|
-
"mask": "url(#mask-2)"
|
|
321
|
-
}, null), createVNode("rect", {
|
|
322
|
-
"id": "el_q04iZcSim4",
|
|
323
|
-
"mask": "url(#mask-2)",
|
|
324
|
-
"x": "0.279",
|
|
325
|
-
"width": "77",
|
|
326
|
-
"height": "130"
|
|
327
|
-
}, null)]), createVNode("g", {
|
|
328
|
-
"id": "el_6WKby7wXqV"
|
|
329
|
-
}, [createVNode("mask", {
|
|
330
|
-
"id": "mask-4",
|
|
331
|
-
"fill": "#fff"
|
|
332
|
-
}, [createVNode("use", {
|
|
333
|
-
"xlink:href": "#path-3"
|
|
334
|
-
}, null)]), createVNode("path", {
|
|
335
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
336
|
-
"id": "el_9bggsfQOtU",
|
|
337
|
-
"fillRule": "nonzero",
|
|
338
|
-
"mask": "url(#mask-4)"
|
|
339
|
-
}, null), createVNode("rect", {
|
|
340
|
-
"id": "el_NKxqi9eIym",
|
|
341
|
-
"mask": "url(#mask-4)",
|
|
342
|
-
"x": "0.279",
|
|
343
|
-
"width": "77",
|
|
344
|
-
"height": "115"
|
|
345
|
-
}, null)]), createVNode("g", {
|
|
346
|
-
"id": "el_Wi-my975tM"
|
|
347
|
-
}, [createVNode("mask", {
|
|
348
|
-
"id": "mask-6",
|
|
349
|
-
"fill": "#fff"
|
|
350
|
-
}, [createVNode("use", {
|
|
351
|
-
"xlink:href": "#path-5"
|
|
352
|
-
}, null)]), createVNode("path", {
|
|
353
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
354
|
-
"id": "el_zclQ34fvf7",
|
|
355
|
-
"fillRule": "nonzero",
|
|
356
|
-
"mask": "url(#mask-6)"
|
|
357
|
-
}, null), createVNode("rect", {
|
|
358
|
-
"id": "el_1OsvRT8HkeZ",
|
|
359
|
-
"mask": "url(#mask-6)",
|
|
360
|
-
"x": "0.279",
|
|
361
|
-
"width": "77",
|
|
362
|
-
"height": "100"
|
|
363
|
-
}, null)]), createVNode("g", {
|
|
364
|
-
"id": "el_DkfFFTaFxy8"
|
|
365
|
-
}, [createVNode("mask", {
|
|
366
|
-
"id": "mask-8",
|
|
367
|
-
"fill": "#fff"
|
|
368
|
-
}, [createVNode("use", {
|
|
369
|
-
"xlink:href": "#path-7"
|
|
370
|
-
}, null)]), createVNode("path", {
|
|
371
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
372
|
-
"id": "el_aa9sjx4H0vA",
|
|
373
|
-
"fillRule": "nonzero",
|
|
374
|
-
"mask": "url(#mask-8)"
|
|
375
|
-
}, null), createVNode("rect", {
|
|
376
|
-
"id": "el_tea114vWg0J",
|
|
377
|
-
"mask": "url(#mask-8)",
|
|
378
|
-
"x": "0.279",
|
|
379
|
-
"width": "77",
|
|
380
|
-
"height": "85"
|
|
381
|
-
}, null)]), createVNode("g", {
|
|
382
|
-
"id": "el_34IgwiMB5rf"
|
|
383
|
-
}, [createVNode("mask", {
|
|
384
|
-
"id": "mask-10",
|
|
385
|
-
"fill": "#fff"
|
|
386
|
-
}, [createVNode("use", {
|
|
387
|
-
"xlink:href": "#path-9"
|
|
388
|
-
}, null)]), createVNode("path", {
|
|
389
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
390
|
-
"id": "el_z5u6RAFhx7d",
|
|
391
|
-
"fillRule": "nonzero",
|
|
392
|
-
"mask": "url(#mask-10)"
|
|
393
|
-
}, null), createVNode("rect", {
|
|
394
|
-
"id": "el_7nfuWmA5Uhy",
|
|
395
|
-
"mask": "url(#mask-10)",
|
|
396
|
-
"x": "0.279",
|
|
397
|
-
"width": "77",
|
|
398
|
-
"height": "70"
|
|
399
|
-
}, null)]), createVNode("g", {
|
|
400
|
-
"id": "el_DeebuCsPTGA"
|
|
401
|
-
}, [createVNode("mask", {
|
|
402
|
-
"id": "mask-12",
|
|
403
|
-
"fill": "#fff"
|
|
404
|
-
}, [createVNode("use", {
|
|
405
|
-
"xlink:href": "#path-11"
|
|
406
|
-
}, null)]), createVNode("path", {
|
|
407
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
408
|
-
"id": "el__ZcqlS20zcw",
|
|
409
|
-
"fillRule": "nonzero",
|
|
410
|
-
"mask": "url(#mask-12)"
|
|
411
|
-
}, null), createVNode("rect", {
|
|
412
|
-
"id": "el_8DnEQnD7VWV",
|
|
413
|
-
"mask": "url(#mask-12)",
|
|
414
|
-
"x": "0.279",
|
|
415
|
-
"width": "77",
|
|
416
|
-
"height": "55"
|
|
417
|
-
}, null)]), createVNode("g", {
|
|
418
|
-
"id": "el_ZOjjrPTvyrv"
|
|
419
|
-
}, [createVNode("mask", {
|
|
420
|
-
"id": "mask-14",
|
|
421
|
-
"fill": "#fff"
|
|
422
|
-
}, [createVNode("use", {
|
|
423
|
-
"xlink:href": "#path-13"
|
|
424
|
-
}, null)]), createVNode("path", {
|
|
425
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
426
|
-
"id": "el_FYYKCI_u24e",
|
|
427
|
-
"fillRule": "nonzero",
|
|
428
|
-
"mask": "url(#mask-14)"
|
|
429
|
-
}, null), createVNode("rect", {
|
|
430
|
-
"id": "el_XZty4MnTp5Y",
|
|
431
|
-
"mask": "url(#mask-14)",
|
|
432
|
-
"x": "0.279",
|
|
433
|
-
"width": "77",
|
|
434
|
-
"height": "40"
|
|
435
|
-
}, null)]), createVNode("g", {
|
|
436
|
-
"id": "el_2FATegVmf0K"
|
|
437
|
-
}, [createVNode("mask", {
|
|
438
|
-
"id": "mask-16",
|
|
439
|
-
"fill": "#fff"
|
|
440
|
-
}, [createVNode("use", {
|
|
441
|
-
"xlink:href": "#path-15"
|
|
442
|
-
}, null)]), createVNode("path", {
|
|
443
|
-
"d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
|
|
444
|
-
"id": "el_RMT1KUfbdF8",
|
|
445
|
-
"fillRule": "nonzero",
|
|
446
|
-
"mask": "url(#mask-16)"
|
|
447
|
-
}, null), createVNode("rect", {
|
|
448
|
-
"id": "el_RgLcovvFiO1",
|
|
449
|
-
"mask": "url(#mask-16)",
|
|
450
|
-
"x": "0.279",
|
|
451
|
-
"width": "77",
|
|
452
|
-
"height": "25"
|
|
453
|
-
}, null)])])])]);
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
var STATUS = {
|
|
458
|
-
inactive: 'INACTIVE',
|
|
459
|
-
stopped: 'STOPPED',
|
|
460
|
-
active: 'ACTIVE',
|
|
461
|
-
denied: 'DENIED'
|
|
462
|
-
};
|
|
463
|
-
var Mic = {
|
|
464
|
-
name: 'Mic',
|
|
465
|
-
props: {
|
|
466
|
-
children: types.title,
|
|
467
|
-
lang: VueTypes.string.def('en-US'),
|
|
468
|
-
iconPosition: VueTypes.string.def('left'),
|
|
469
|
-
handleResult: types.func,
|
|
470
|
-
onNoMatch: types.func,
|
|
471
|
-
onError: types.func,
|
|
472
|
-
getInstance: types.func,
|
|
473
|
-
render: types.func,
|
|
474
|
-
className: types.string,
|
|
475
|
-
applyClearStyle: VueTypes.bool,
|
|
476
|
-
showIcon: VueTypes.bool
|
|
477
|
-
},
|
|
478
|
-
methods: {
|
|
479
|
-
getComponent: function getComponent$1() {
|
|
480
|
-
var status = this.$data.status;
|
|
481
|
-
var data = {
|
|
482
|
-
handleClick: this.handleClick,
|
|
483
|
-
status: status
|
|
484
|
-
};
|
|
485
|
-
return getComponent(data, this);
|
|
486
|
-
},
|
|
487
|
-
stopMic: function stopMic() {
|
|
488
|
-
if (this.instance) {
|
|
489
|
-
this.status = STATUS.inactive;
|
|
490
|
-
this.instance.stop();
|
|
491
|
-
this.instance = null;
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
|
-
handleClick: function handleClick() {
|
|
495
|
-
var _this = this;
|
|
496
|
-
this.results = [];
|
|
497
|
-
if (window && window.SpeechRecognition) {
|
|
498
|
-
var status = this.$data.status;
|
|
499
|
-
if (status === STATUS.active) {
|
|
500
|
-
this.status = STATUS.inactive;
|
|
501
|
-
}
|
|
502
|
-
var _this$$props = this.$props,
|
|
503
|
-
handleResult = _this$$props.handleResult,
|
|
504
|
-
onNoMatch = _this$$props.onNoMatch,
|
|
505
|
-
onError = _this$$props.onError,
|
|
506
|
-
lang = _this$$props.lang,
|
|
507
|
-
getInstance = _this$$props.getInstance;
|
|
508
|
-
var _window = window,
|
|
509
|
-
SpeechRecognition = _window.SpeechRecognition;
|
|
510
|
-
if (this.instance && this.status !== STATUS.denied) {
|
|
511
|
-
this.status = STATUS.inactive;
|
|
512
|
-
this.instance.stop();
|
|
513
|
-
this.instance = null;
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
this.instance = new SpeechRecognition();
|
|
517
|
-
this.instance.continuous = true;
|
|
518
|
-
this.instance.interimResults = true;
|
|
519
|
-
this.instance.lang = lang;
|
|
520
|
-
if (getInstance) {
|
|
521
|
-
getInstance(this.instance);
|
|
522
|
-
}
|
|
523
|
-
this.instance.start();
|
|
524
|
-
this.instance.onstart = function () {
|
|
525
|
-
_this.status = STATUS.active;
|
|
526
|
-
};
|
|
527
|
-
this.instance.onresult = function (_ref) {
|
|
528
|
-
var results = _ref.results,
|
|
529
|
-
timeStamp = _ref.timeStamp;
|
|
530
|
-
_this.stopMic();
|
|
531
|
-
if (handleResult) {
|
|
532
|
-
handleResult({
|
|
533
|
-
results: results,
|
|
534
|
-
timeStamp: timeStamp
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
_this.results.push({
|
|
538
|
-
results: results,
|
|
539
|
-
timeStamp: timeStamp
|
|
540
|
-
});
|
|
541
|
-
};
|
|
542
|
-
this.instance.onnomatch = function (e) {
|
|
543
|
-
return onNoMatch ? onNoMatch(e) : console.warn(e);
|
|
544
|
-
};
|
|
545
|
-
this.instance.onerror = function (e) {
|
|
546
|
-
if (e.error === 'no-speech' || e.error === 'audio-capture') {
|
|
547
|
-
_this.status = STATUS.inactive;
|
|
548
|
-
} else if (e.error === 'not-allowed') {
|
|
549
|
-
_this.status = STATUS.denied;
|
|
550
|
-
}
|
|
551
|
-
console.error(e);
|
|
552
|
-
if (onError) {
|
|
553
|
-
onError(e);
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
/* Below Two methods run when Continuous is False */
|
|
558
|
-
this.instance.onspeechend = function () {
|
|
559
|
-
_this.status = STATUS.inactive;
|
|
560
|
-
};
|
|
561
|
-
this.instance.onaudioend = function () {
|
|
562
|
-
_this.status = STATUS.inactive;
|
|
563
|
-
};
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
computed: {
|
|
568
|
-
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
569
|
-
return hasCustomRenderer(this);
|
|
570
|
-
},
|
|
571
|
-
Icon: function Icon() {
|
|
572
|
-
var status = this.$data.status;
|
|
573
|
-
var className = this.$props.className;
|
|
574
|
-
switch (status) {
|
|
575
|
-
case STATUS.active:
|
|
576
|
-
return createVNode(ListenSvg, {
|
|
577
|
-
"className": className,
|
|
578
|
-
"nativeOnClick": this.handleClick
|
|
579
|
-
}, null);
|
|
580
|
-
case STATUS.stopped:
|
|
581
|
-
case STATUS.denied:
|
|
582
|
-
return createVNode(MuteSvg, {
|
|
583
|
-
"className": className,
|
|
584
|
-
"nativeOnClick": this.handleClick
|
|
585
|
-
}, null);
|
|
586
|
-
default:
|
|
587
|
-
return createVNode(MicSvg, {
|
|
588
|
-
"className": className,
|
|
589
|
-
"nativeOnClick": this.handleClick
|
|
590
|
-
}, null);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
},
|
|
594
|
-
data: function data() {
|
|
595
|
-
return {
|
|
596
|
-
status: STATUS.inactive
|
|
597
|
-
};
|
|
598
|
-
},
|
|
599
|
-
created: function created() {
|
|
600
|
-
this.results = [];
|
|
601
|
-
if (typeof window !== 'undefined') {
|
|
602
|
-
window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
|
|
603
|
-
if (!window.SpeechRecognition) {
|
|
604
|
-
console.error('SpeechRecognition is not supported in this browser. Please check the browser compatibility at https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Browser_compatibility.');
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
render: function render() {
|
|
609
|
-
var _this2 = this;
|
|
610
|
-
if (this.hasCustomRenderer) {
|
|
611
|
-
return this.getComponent();
|
|
612
|
-
}
|
|
613
|
-
return createVNode(IconWrapper, null, {
|
|
614
|
-
"default": function _default() {
|
|
615
|
-
return [_this2.Icon];
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
var CustomSvg = {
|
|
622
|
-
name: 'CustomSvg',
|
|
623
|
-
props: {
|
|
624
|
-
className: String,
|
|
625
|
-
icon: Function,
|
|
626
|
-
type: String
|
|
627
|
-
},
|
|
628
|
-
data: function data() {
|
|
629
|
-
return {
|
|
630
|
-
customIcon: this.$props.icon && typeof this.$props.icon === 'function' ? this.$props.icon() : null
|
|
631
|
-
};
|
|
632
|
-
},
|
|
633
|
-
render: function render() {
|
|
634
|
-
if (this.customIcon) {
|
|
635
|
-
return createVNode("div", {
|
|
636
|
-
"class": this.$props.className
|
|
637
|
-
}, [this.customIcon]);
|
|
638
|
-
}
|
|
639
|
-
if (this.$props.type === 'recent-search-icon') {
|
|
640
|
-
return createVNode("svg", {
|
|
641
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
642
|
-
"alt": "Recent Search",
|
|
643
|
-
"height": "20",
|
|
644
|
-
"width": "20",
|
|
645
|
-
"viewBox": "0 0 24 24",
|
|
646
|
-
"style": {
|
|
647
|
-
fill: '#707070'
|
|
648
|
-
},
|
|
649
|
-
"class": this.$props.className
|
|
650
|
-
}, [createVNode("path", {
|
|
651
|
-
"d": "M0 0h24v24H0z",
|
|
652
|
-
"fill": "none"
|
|
653
|
-
}, null), createVNode("path", {
|
|
654
|
-
"d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
|
|
655
|
-
}, null)]);
|
|
656
|
-
}
|
|
657
|
-
if (this.$props.type === 'promoted-search-icon') {
|
|
658
|
-
return createVNode("svg", {
|
|
659
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
660
|
-
"width": "20",
|
|
661
|
-
"alt": "promoted search",
|
|
662
|
-
"height": "20",
|
|
663
|
-
"viewBox": "0 0 24 24",
|
|
664
|
-
"class": this.$props.className,
|
|
665
|
-
"style": {
|
|
666
|
-
fill: '#707070'
|
|
667
|
-
}
|
|
668
|
-
}, [createVNode("path", {
|
|
669
|
-
"d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
|
|
670
|
-
}, null)]);
|
|
671
|
-
}
|
|
672
|
-
if (this.$props.type === 'popular-search-icon') {
|
|
673
|
-
return createVNode("svg", {
|
|
674
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
675
|
-
"alt": "Popular Search",
|
|
676
|
-
"height": "20",
|
|
677
|
-
"width": "20",
|
|
678
|
-
"viewBox": "0 0 24 24",
|
|
679
|
-
"style": {
|
|
680
|
-
fill: '#707070'
|
|
681
|
-
},
|
|
682
|
-
"class": this.$props.className
|
|
683
|
-
}, [createVNode("path", {
|
|
684
|
-
"d": "M0 0h24v24H0z",
|
|
685
|
-
"fill": "none"
|
|
686
|
-
}, null), createVNode("path", {
|
|
687
|
-
"d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
|
|
688
|
-
}, null)]);
|
|
689
|
-
}
|
|
690
|
-
return createVNode(SearchSvg, {
|
|
691
|
-
"styles": {
|
|
692
|
-
position: 'relative',
|
|
693
|
-
fill: '#707070',
|
|
694
|
-
left: '3px',
|
|
695
|
-
marginRight: '8px'
|
|
696
|
-
}
|
|
697
|
-
}, null);
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
var _templateObject$6, _templateObject2;
|
|
702
|
-
var TagsContainer = styled('div')(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
703
|
-
var TagItem = styled('span')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
|
|
704
|
-
|
|
705
|
-
function _isSlot(s) {
|
|
706
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
707
|
-
}
|
|
708
|
-
var updateQuery = Actions.updateQuery,
|
|
709
|
-
setQueryOptions = Actions.setQueryOptions,
|
|
710
|
-
setCustomQuery = Actions.setCustomQuery,
|
|
711
|
-
setDefaultQuery = Actions.setDefaultQuery,
|
|
712
|
-
setCustomHighlightOptions = Actions.setCustomHighlightOptions,
|
|
713
|
-
recordSuggestionClick = Actions.recordSuggestionClick,
|
|
714
|
-
loadPopularSuggestions = Actions.loadPopularSuggestions,
|
|
715
|
-
getRecentSearches = Actions.getRecentSearches,
|
|
716
|
-
resetStoreForComponent = Actions.resetStoreForComponent;
|
|
717
|
-
var debounce = helper.debounce,
|
|
718
|
-
checkValueChange = helper.checkValueChange,
|
|
719
|
-
getClassName$1 = helper.getClassName,
|
|
720
|
-
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
721
|
-
getOptionsForCustomQuery = helper.getOptionsForCustomQuery,
|
|
722
|
-
isEqual = helper.isEqual,
|
|
723
|
-
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
724
|
-
withClickIds = helper.withClickIds,
|
|
725
|
-
getResultStats = helper.getResultStats,
|
|
726
|
-
handleOnSuggestions = helper.handleOnSuggestions,
|
|
727
|
-
getTopSuggestions = helper.getTopSuggestions,
|
|
728
|
-
normalizeDataField = helper.normalizeDataField;
|
|
729
|
-
var DataSearch = {
|
|
730
|
-
name: 'DataSearch',
|
|
731
|
-
isTagsMode: false,
|
|
732
|
-
data: function data() {
|
|
733
|
-
var props = this.$props;
|
|
734
|
-
this.__state = {
|
|
735
|
-
currentValue: '',
|
|
736
|
-
selectedTags: [],
|
|
737
|
-
isOpen: false,
|
|
738
|
-
normalizedSuggestions: [],
|
|
739
|
-
isPending: false
|
|
740
|
-
};
|
|
741
|
-
this.internalComponent = props.componentId + "__internal";
|
|
742
|
-
return this.__state;
|
|
743
|
-
},
|
|
744
|
-
inject: {
|
|
745
|
-
theme: {
|
|
746
|
-
from: 'theme_reactivesearch'
|
|
747
|
-
}
|
|
748
|
-
},
|
|
749
|
-
created: function created() {
|
|
750
|
-
var _this$$props = this.$props,
|
|
751
|
-
enableRecentSearches = _this$$props.enableRecentSearches,
|
|
752
|
-
distinctField = _this$$props.distinctField,
|
|
753
|
-
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
754
|
-
index = _this$$props.index,
|
|
755
|
-
mode = _this$$props.mode;
|
|
756
|
-
if (mode === SEARCH_COMPONENTS_MODES.TAG) {
|
|
757
|
-
this.$options.isTagsMode = true;
|
|
758
|
-
}
|
|
759
|
-
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
760
|
-
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
761
|
-
}
|
|
762
|
-
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
763
|
-
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
764
|
-
}
|
|
765
|
-
if (!this.enableAppbase && index) {
|
|
766
|
-
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
767
|
-
}
|
|
768
|
-
this.currentValue = '';
|
|
769
|
-
if (this.$options.isTagsMode) {
|
|
770
|
-
this.currentValue = '';
|
|
771
|
-
}
|
|
772
|
-
var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
|
|
773
|
-
if (shouldFetchInitialSuggestions) {
|
|
774
|
-
this.loadPopularSuggestions(this.$props.componentId);
|
|
775
|
-
if (enableRecentSearches) {
|
|
776
|
-
this.getRecentSearches();
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
this.handleTextChange = debounce(this.handleText, this.$props.debounce);
|
|
780
|
-
this.updateDefaultQueryHandlerDebounced = debounce(this.updateDefaultQueryHandler, this.$props.debounce);
|
|
781
|
-
this.updateQueryHandlerDebounced = debounce(this.updateQueryHandler, this.$props.debounce);
|
|
782
|
-
// Set custom and default queries in store
|
|
783
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
784
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
785
|
-
this.updateDefaultQueryHandlerDebounced(this.currentValue, this.$props, false);
|
|
786
|
-
},
|
|
787
|
-
computed: {
|
|
788
|
-
suggestionsList: function suggestionsList() {
|
|
789
|
-
var suggestionsList = [];
|
|
790
|
-
if (!this.$data.currentValue && this.$props.defaultSuggestions && this.$props.defaultSuggestions.length) {
|
|
791
|
-
suggestionsList = this.$props.defaultSuggestions;
|
|
792
|
-
} else if (this.$data.currentValue) {
|
|
793
|
-
suggestionsList = this.normalizedSuggestions;
|
|
794
|
-
}
|
|
795
|
-
return withClickIds(suggestionsList);
|
|
796
|
-
},
|
|
797
|
-
topSuggestions: function topSuggestions() {
|
|
798
|
-
if (!this.currentValue) {
|
|
799
|
-
return [];
|
|
800
|
-
}
|
|
801
|
-
return this.enablePopularSuggestions ? this.normalizedPopularSuggestions : [];
|
|
802
|
-
},
|
|
803
|
-
normalizedRecentSearches: function normalizedRecentSearches() {
|
|
804
|
-
return this.recentSearches || [];
|
|
805
|
-
},
|
|
806
|
-
normalizedPopularSuggestions: function normalizedPopularSuggestions() {
|
|
807
|
-
return getTopSuggestions(
|
|
808
|
-
// use default popular suggestions if value is empty
|
|
809
|
-
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue, this.showDistinctSuggestions);
|
|
810
|
-
},
|
|
811
|
-
defaultSearchSuggestions: function defaultSearchSuggestions() {
|
|
812
|
-
var isPopularSuggestionsEnabled = this.enablePopularSuggestions;
|
|
813
|
-
if (this.currentValue || !this.enableDefaultSuggestions) {
|
|
814
|
-
return [];
|
|
815
|
-
}
|
|
816
|
-
var customDefaultPopularSuggestions = (this.defaultPopularSuggestions || []).map(function (suggestion) {
|
|
817
|
-
return _extends({}, suggestion, {
|
|
818
|
-
_popular_suggestion: true
|
|
819
|
-
});
|
|
820
|
-
});
|
|
821
|
-
var customNormalizedRecentSearches = (this.normalizedRecentSearches || []).map(function (search) {
|
|
822
|
-
return _extends({}, search, {
|
|
823
|
-
_recent_search: true
|
|
824
|
-
});
|
|
825
|
-
});
|
|
826
|
-
var defaultSuggestions = isPopularSuggestionsEnabled ? [].concat(customNormalizedRecentSearches, customDefaultPopularSuggestions || []) : customNormalizedRecentSearches;
|
|
827
|
-
return getTopSuggestions(
|
|
828
|
-
// use default popular suggestions if value is empty
|
|
829
|
-
defaultSuggestions, this.currentValue, this.showDistinctSuggestions);
|
|
830
|
-
},
|
|
831
|
-
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
832
|
-
return hasCustomRenderer(this);
|
|
833
|
-
},
|
|
834
|
-
stats: function stats() {
|
|
835
|
-
return getResultStats(this);
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
props: {
|
|
839
|
-
options: types.options,
|
|
840
|
-
autoFocus: VueTypes.bool,
|
|
841
|
-
autosuggest: VueTypes.bool.def(true),
|
|
842
|
-
beforeValueChange: types.func,
|
|
843
|
-
className: VueTypes.string.def(''),
|
|
844
|
-
clearIcon: types.children,
|
|
845
|
-
componentId: types.stringRequired,
|
|
846
|
-
customHighlight: types.func,
|
|
847
|
-
customQuery: types.func,
|
|
848
|
-
defaultQuery: types.func,
|
|
849
|
-
dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
|
|
850
|
-
field: VueTypes.string,
|
|
851
|
-
weight: VueTypes.number
|
|
852
|
-
}), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
|
|
853
|
-
field: VueTypes.string,
|
|
854
|
-
weight: VueTypes.number
|
|
855
|
-
})]),
|
|
856
|
-
aggregationField: types.string,
|
|
857
|
-
aggregationSize: VueTypes.number,
|
|
858
|
-
size: VueTypes.number,
|
|
859
|
-
debounce: VueTypes.number.def(0),
|
|
860
|
-
defaultValue: types.string,
|
|
861
|
-
excludeFields: types.excludeFields,
|
|
862
|
-
value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), types.value]),
|
|
863
|
-
defaultSuggestions: types.suggestions,
|
|
864
|
-
enableSynonyms: VueTypes.bool.def(true),
|
|
865
|
-
enablePopularSuggestions: VueTypes.bool.def(false),
|
|
866
|
-
enableRecentSearches: VueTypes.bool.def(false),
|
|
867
|
-
fieldWeights: types.fieldWeights,
|
|
868
|
-
filterLabel: types.string,
|
|
869
|
-
fuzziness: types.fuzziness,
|
|
870
|
-
highlight: VueTypes.bool,
|
|
871
|
-
highlightField: types.stringOrArray,
|
|
872
|
-
icon: types.children,
|
|
873
|
-
iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
|
|
874
|
-
includeFields: types.includeFields,
|
|
875
|
-
innerClass: types.style,
|
|
876
|
-
innerRef: VueTypes.string.def('searchInputField'),
|
|
877
|
-
render: types.func,
|
|
878
|
-
renderPopularSuggestions: types.func,
|
|
879
|
-
parseSuggestion: types.func,
|
|
880
|
-
renderNoSuggestion: types.title,
|
|
881
|
-
renderError: types.title,
|
|
882
|
-
placeholder: VueTypes.string.def('Search'),
|
|
883
|
-
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
884
|
-
react: types.react,
|
|
885
|
-
showClear: VueTypes.bool.def(true),
|
|
886
|
-
showDistinctSuggestions: VueTypes.bool.def(true),
|
|
887
|
-
showFilter: VueTypes.bool.def(true),
|
|
888
|
-
showIcon: VueTypes.bool.def(true),
|
|
889
|
-
title: types.title,
|
|
890
|
-
theme: types.style,
|
|
891
|
-
URLParams: VueTypes.bool.def(false),
|
|
892
|
-
strictSelection: VueTypes.bool.def(false),
|
|
893
|
-
nestedField: types.string,
|
|
894
|
-
enablePredictiveSuggestions: VueTypes.bool.def(false),
|
|
895
|
-
recentSearchesIcon: VueTypes.any,
|
|
896
|
-
popularSearchesIcon: VueTypes.any,
|
|
897
|
-
// mic props
|
|
898
|
-
showVoiceSearch: VueTypes.bool.def(false),
|
|
899
|
-
getMicInstance: types.func,
|
|
900
|
-
renderMic: types.func,
|
|
901
|
-
distinctField: types.string,
|
|
902
|
-
distinctFieldConfig: types.props,
|
|
903
|
-
//
|
|
904
|
-
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
905
|
-
addonBefore: VueTypes.any,
|
|
906
|
-
addonAfter: VueTypes.any,
|
|
907
|
-
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
908
|
-
index: VueTypes.string,
|
|
909
|
-
enableDefaultSuggestions: VueTypes.bool.def(true),
|
|
910
|
-
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
911
|
-
renderSelectedTags: VueTypes.any,
|
|
912
|
-
endpoint: types.endpointConfig
|
|
913
|
-
},
|
|
914
|
-
beforeMount: function beforeMount() {
|
|
915
|
-
if (this.$props.highlight) {
|
|
916
|
-
if (this.customHighlight && typeof this.customHighlight === 'function') {
|
|
917
|
-
this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
|
|
918
|
-
}
|
|
919
|
-
var queryOptions = DataSearch.highlightQuery(this.$props) || {};
|
|
920
|
-
this.queryOptions = _extends({}, queryOptions, this.getBasicQueryOptions());
|
|
921
|
-
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
922
|
-
} else {
|
|
923
|
-
this.queryOptions = this.getBasicQueryOptions();
|
|
924
|
-
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
925
|
-
}
|
|
926
|
-
if (this.selectedValue) {
|
|
927
|
-
this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
|
|
928
|
-
} else if (this.$props.value) {
|
|
929
|
-
this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
|
|
930
|
-
} else if (this.$props.defaultValue) {
|
|
931
|
-
this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
|
|
932
|
-
}
|
|
933
|
-
},
|
|
934
|
-
mounted: function mounted() {
|
|
935
|
-
this.listenForFocusShortcuts();
|
|
936
|
-
},
|
|
937
|
-
watch: {
|
|
938
|
-
highlight: function highlight() {
|
|
939
|
-
this.updateQueryOptions();
|
|
940
|
-
},
|
|
941
|
-
dataField: function dataField() {
|
|
942
|
-
this.updateQueryOptions();
|
|
943
|
-
this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
|
|
944
|
-
},
|
|
945
|
-
highlightField: function highlightField() {
|
|
946
|
-
this.updateQueryOptions();
|
|
947
|
-
},
|
|
948
|
-
fieldWeights: function fieldWeights() {
|
|
949
|
-
this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
|
|
950
|
-
},
|
|
951
|
-
fuzziness: function fuzziness() {
|
|
952
|
-
this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
|
|
953
|
-
},
|
|
954
|
-
queryFormat: function queryFormat() {
|
|
955
|
-
this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
|
|
956
|
-
},
|
|
957
|
-
defaultValue: function defaultValue(newVal) {
|
|
958
|
-
this.setValue(newVal, true, this.$props);
|
|
959
|
-
},
|
|
960
|
-
value: function value(newVal, oldVal) {
|
|
961
|
-
if (!isEqual(newVal, oldVal) || this.$options.isTagsMode && !isEqual(newVal, this.selectedTags)) {
|
|
962
|
-
if (this.isPending && this.$options.isTagsMode && Array.isArray(newVal)) {
|
|
963
|
-
this.isPending = false;
|
|
964
|
-
}
|
|
965
|
-
this.setValue(newVal, true, this.$props, newVal === '' ? causes.CLEAR_VALUE : undefined, false, typeof newVal !== 'string' && this.$options.isTagsMode);
|
|
966
|
-
}
|
|
967
|
-
},
|
|
968
|
-
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
969
|
-
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
970
|
-
this.updateDefaultQueryHandlerDebounced(this.$data.currentValue, this.$props);
|
|
971
|
-
}
|
|
972
|
-
},
|
|
973
|
-
customQuery: function customQuery(newVal, oldVal) {
|
|
974
|
-
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
975
|
-
this.updateQueryHandler(this.componentId, this.$data.currentValue, this.$props);
|
|
976
|
-
}
|
|
977
|
-
},
|
|
978
|
-
suggestions: function suggestions(newVal) {
|
|
979
|
-
if (Array.isArray(newVal) && this.$data.currentValue.trim().length) {
|
|
980
|
-
// shallow check allows us to set suggestions even if the next set
|
|
981
|
-
// of suggestions are same as the current one
|
|
982
|
-
this.$emit('suggestions', newVal);
|
|
983
|
-
this.normalizedSuggestions = this.onSuggestions(newVal);
|
|
984
|
-
}
|
|
985
|
-
},
|
|
986
|
-
selectedValue: function selectedValue(newVal, oldVal) {
|
|
987
|
-
if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
|
|
988
|
-
if (!newVal && this.$data.currentValue) {
|
|
989
|
-
// selected value is cleared, call onValueSelected
|
|
990
|
-
this.onValueSelectedHandler('', causes.CLEAR_VALUE);
|
|
991
|
-
}
|
|
992
|
-
if (this.$options.isTagsMode) {
|
|
993
|
-
// handling reset of tags through SelectedFilters or URL
|
|
994
|
-
this.selectedTags = [];
|
|
995
|
-
}
|
|
996
|
-
this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
|
|
997
|
-
}
|
|
998
|
-
},
|
|
999
|
-
focusShortcuts: function focusShortcuts() {
|
|
1000
|
-
this.listenForFocusShortcuts();
|
|
1001
|
-
}
|
|
1002
|
-
},
|
|
1003
|
-
methods: {
|
|
1004
|
-
handleText: function handleText(value) {
|
|
1005
|
-
if (this.$props.autosuggest) {
|
|
1006
|
-
this.updateDefaultQueryHandlerDebounced(value, this.$props);
|
|
1007
|
-
} else if (!this.$options.isTagsMode) {
|
|
1008
|
-
this.updateQueryHandlerDebounced(this.$props.componentId, value, this.$props);
|
|
1009
|
-
} else if (this.$options.isTagsMode) {
|
|
1010
|
-
this.$data.currentValue = value;
|
|
1011
|
-
}
|
|
1012
|
-
},
|
|
1013
|
-
validateDataField: function validateDataField() {
|
|
1014
|
-
var propName = 'dataField';
|
|
1015
|
-
var componentName = DataSearch.name;
|
|
1016
|
-
var props = this.$props;
|
|
1017
|
-
var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
|
|
1018
|
-
var propValue = props[propName];
|
|
1019
|
-
if (!this.enableAppbase) {
|
|
1020
|
-
if (!propValue) {
|
|
1021
|
-
console.error(requiredError);
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
1025
|
-
console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
|
|
1026
|
-
return;
|
|
1027
|
-
}
|
|
1028
|
-
if (Array.isArray(propValue) && propValue.length === 0) {
|
|
1029
|
-
console.error(requiredError);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
},
|
|
1033
|
-
updateQueryOptions: function updateQueryOptions() {
|
|
1034
|
-
if (this.customHighlight && typeof this.customHighlight === 'function') {
|
|
1035
|
-
this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
|
|
1036
|
-
}
|
|
1037
|
-
var queryOptions = DataSearch.highlightQuery(this.$props) || {};
|
|
1038
|
-
this.queryOptions = _extends({}, queryOptions, this.getBasicQueryOptions());
|
|
1039
|
-
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
1040
|
-
},
|
|
1041
|
-
getComponent: function getComponent$1(downshiftProps, isQuerySuggestionsRender) {
|
|
1042
|
-
if (downshiftProps === void 0) {
|
|
1043
|
-
downshiftProps = {};
|
|
1044
|
-
}
|
|
1045
|
-
if (isQuerySuggestionsRender === void 0) {
|
|
1046
|
-
isQuerySuggestionsRender = false;
|
|
1047
|
-
}
|
|
1048
|
-
var currentValue = this.$data.currentValue;
|
|
1049
|
-
var data = {
|
|
1050
|
-
error: this.error,
|
|
1051
|
-
loading: this.isLoading,
|
|
1052
|
-
downshiftProps: downshiftProps,
|
|
1053
|
-
data: this.suggestionsList,
|
|
1054
|
-
promotedData: this.promotedResults,
|
|
1055
|
-
aggregationData: this.aggregationData,
|
|
1056
|
-
rawData: this.rawData,
|
|
1057
|
-
customData: this.customData,
|
|
1058
|
-
value: currentValue,
|
|
1059
|
-
triggerClickAnalytics: this.triggerClickAnalytics,
|
|
1060
|
-
resultStats: this.stats,
|
|
1061
|
-
querySuggestions: this.normalizedPopularSuggestions,
|
|
1062
|
-
popularSuggestions: this.normalizedPopularSuggestions
|
|
1063
|
-
};
|
|
1064
|
-
if (isQuerySuggestionsRender) {
|
|
1065
|
-
return getQuerySuggestionsComponent({
|
|
1066
|
-
downshiftProps: downshiftProps,
|
|
1067
|
-
data: this.normalizedPopularSuggestions,
|
|
1068
|
-
value: currentValue,
|
|
1069
|
-
loading: this.isLoading,
|
|
1070
|
-
error: this.error
|
|
1071
|
-
}, this);
|
|
1072
|
-
}
|
|
1073
|
-
return getComponent(data, this);
|
|
1074
|
-
},
|
|
1075
|
-
// returns size and aggs property
|
|
1076
|
-
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
1077
|
-
var aggregationField = this.$props.aggregationField;
|
|
1078
|
-
var queryOptions = getQueryOptions(this.$props);
|
|
1079
|
-
if (aggregationField) {
|
|
1080
|
-
queryOptions.aggs = getCompositeAggsQuery({
|
|
1081
|
-
props: this.$props,
|
|
1082
|
-
showTopHits: true
|
|
1083
|
-
}).aggs;
|
|
1084
|
-
}
|
|
1085
|
-
return queryOptions;
|
|
1086
|
-
},
|
|
1087
|
-
onSuggestions: function onSuggestions(results) {
|
|
1088
|
-
return handleOnSuggestions(results, this.$data.currentValue, this);
|
|
1089
|
-
},
|
|
1090
|
-
handleSearchIconClick: function handleSearchIconClick() {
|
|
1091
|
-
var currentValue = this.currentValue;
|
|
1092
|
-
if (currentValue.trim()) {
|
|
1093
|
-
this.isPending = false;
|
|
1094
|
-
this.setValue(currentValue, true);
|
|
1095
|
-
this.onValueSelectedHandler(currentValue, causes.SEARCH_ICON_CLICK);
|
|
1096
|
-
}
|
|
1097
|
-
},
|
|
1098
|
-
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, isTagsMode) {
|
|
1099
|
-
var _this = this;
|
|
1100
|
-
if (isDefaultValue === void 0) {
|
|
1101
|
-
isDefaultValue = false;
|
|
1102
|
-
}
|
|
1103
|
-
if (props === void 0) {
|
|
1104
|
-
props = this.$props;
|
|
1105
|
-
}
|
|
1106
|
-
if (toggleIsOpen === void 0) {
|
|
1107
|
-
toggleIsOpen = true;
|
|
1108
|
-
}
|
|
1109
|
-
if (isTagsMode === void 0) {
|
|
1110
|
-
isTagsMode = this.$options.isTagsMode;
|
|
1111
|
-
}
|
|
1112
|
-
var performUpdate = function performUpdate() {
|
|
1113
|
-
if (isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
1114
|
-
return;
|
|
1115
|
-
}
|
|
1116
|
-
// Refresh recent searches when value becomes empty
|
|
1117
|
-
if (!value && props.enableDefaultSuggestions === false) {
|
|
1118
|
-
_this.resetStoreForComponent(props.componentId);
|
|
1119
|
-
} else if (!value && _this.currentValue && _this.enableRecentSearches) {
|
|
1120
|
-
_this.getRecentSearches();
|
|
1121
|
-
}
|
|
1122
|
-
if (isTagsMode) {
|
|
1123
|
-
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
1124
|
-
// check if value already present in selectedTags
|
|
1125
|
-
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
1126
|
-
_this.isOpen = false;
|
|
1127
|
-
return;
|
|
1128
|
-
}
|
|
1129
|
-
_this.selectedTags = [].concat(_this.selectedTags);
|
|
1130
|
-
if (typeof value === 'string' && !!value) {
|
|
1131
|
-
_this.selectedTags.push(value);
|
|
1132
|
-
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
1133
|
-
_this.selectedTags = value;
|
|
1134
|
-
}
|
|
1135
|
-
} else if (value) {
|
|
1136
|
-
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1137
|
-
}
|
|
1138
|
-
_this.currentValue = '';
|
|
1139
|
-
} else {
|
|
1140
|
-
_this.currentValue = value;
|
|
1141
|
-
}
|
|
1142
|
-
var queryHandlerValue = value;
|
|
1143
|
-
if (isTagsMode) {
|
|
1144
|
-
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
1145
|
-
}
|
|
1146
|
-
if (isDefaultValue) {
|
|
1147
|
-
if (_this.$props.autosuggest) {
|
|
1148
|
-
if (toggleIsOpen) {
|
|
1149
|
-
_this.isOpen = false;
|
|
1150
|
-
}
|
|
1151
|
-
if (typeof value === 'string') _this.updateDefaultQueryHandlerDebounced(value, _this.$props);
|
|
1152
|
-
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1153
|
-
// to set the query otherwise the value should reset
|
|
1154
|
-
|
|
1155
|
-
if (props.strictSelection && props.autosuggest) {
|
|
1156
|
-
if (cause === causes.SUGGESTION_SELECT || props.value !== undefined) {
|
|
1157
|
-
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
1158
|
-
} else if (_this.currentValue !== '') {
|
|
1159
|
-
_this.setValue('', true);
|
|
1160
|
-
}
|
|
1161
|
-
} else {
|
|
1162
|
-
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
1163
|
-
}
|
|
1164
|
-
} else {
|
|
1165
|
-
// debounce for handling text while typing
|
|
1166
|
-
_this.handleTextChange(value);
|
|
1167
|
-
}
|
|
1168
|
-
_this.$emit('valueChange', value);
|
|
1169
|
-
_this.$emit('value-change', value);
|
|
1170
|
-
// Set the already fetched suggestions if query is same as used last to fetch the hits
|
|
1171
|
-
if (value === _this.lastUsedQuery) {
|
|
1172
|
-
_this.suggestions = _this.onSuggestions(_this.suggestions);
|
|
1173
|
-
// invoke on suggestions
|
|
1174
|
-
_this.$emit('suggestions', _this.suggestions);
|
|
1175
|
-
} else if (!value) {
|
|
1176
|
-
// reset suggestions
|
|
1177
|
-
_this.suggestions = [];
|
|
1178
|
-
// invoke on suggestions
|
|
1179
|
-
_this.$emit('suggestions', _this.suggestions);
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1183
|
-
},
|
|
1184
|
-
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
|
|
1185
|
-
if (props === void 0) {
|
|
1186
|
-
props = this.$props;
|
|
1187
|
-
}
|
|
1188
|
-
if (!value && props.enableDefaultSuggestions === false) {
|
|
1189
|
-
// clear Component data from store
|
|
1190
|
-
this.resetStoreForComponent(props.componentId);
|
|
1191
|
-
return;
|
|
1192
|
-
}
|
|
1193
|
-
var defaultQueryOptions;
|
|
1194
|
-
var query = DataSearch.defaultQuery(value, props);
|
|
1195
|
-
if (this.defaultQuery) {
|
|
1196
|
-
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
1197
|
-
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
1198
|
-
if (defaultQueryObj) {
|
|
1199
|
-
query = defaultQueryObj;
|
|
1200
|
-
}
|
|
1201
|
-
defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
1202
|
-
// Update calculated default query in store
|
|
1203
|
-
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
1204
|
-
}
|
|
1205
|
-
this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), execute);
|
|
1206
|
-
this.updateQuery({
|
|
1207
|
-
componentId: this.internalComponent,
|
|
1208
|
-
query: query,
|
|
1209
|
-
value: value,
|
|
1210
|
-
componentType: componentTypes.dataSearch
|
|
1211
|
-
}, execute);
|
|
1212
|
-
},
|
|
1213
|
-
updateQueryHandler: function updateQueryHandler(componentId, value, props) {
|
|
1214
|
-
var customQuery = props.customQuery,
|
|
1215
|
-
filterLabel = props.filterLabel,
|
|
1216
|
-
showFilter = props.showFilter,
|
|
1217
|
-
URLParams = props.URLParams;
|
|
1218
|
-
var customQueryOptions;
|
|
1219
|
-
var defaultQueryTobeSet = DataSearch.defaultQuery(value, props);
|
|
1220
|
-
var query = defaultQueryTobeSet;
|
|
1221
|
-
if (customQuery) {
|
|
1222
|
-
var customQueryTobeSet = customQuery(value, props);
|
|
1223
|
-
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
1224
|
-
if (queryTobeSet) {
|
|
1225
|
-
query = queryTobeSet;
|
|
1226
|
-
}
|
|
1227
|
-
customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
1228
|
-
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
1229
|
-
this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions), false);
|
|
1230
|
-
}
|
|
1231
|
-
if (!this.isPending) {
|
|
1232
|
-
this.updateQuery({
|
|
1233
|
-
componentId: componentId,
|
|
1234
|
-
query: query,
|
|
1235
|
-
value: value,
|
|
1236
|
-
label: filterLabel,
|
|
1237
|
-
showFilter: showFilter,
|
|
1238
|
-
URLParams: URLParams,
|
|
1239
|
-
componentType: 'DATASEARCH'
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1242
|
-
},
|
|
1243
|
-
// need to review
|
|
1244
|
-
handleFocus: function handleFocus(event) {
|
|
1245
|
-
this.isOpen = true;
|
|
1246
|
-
this.$emit('focus', event);
|
|
1247
|
-
},
|
|
1248
|
-
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
1249
|
-
var results = _ref.results;
|
|
1250
|
-
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
1251
|
-
this.isPending = false;
|
|
1252
|
-
this.setValue(results[0][0].transcript.trim(), true);
|
|
1253
|
-
}
|
|
1254
|
-
},
|
|
1255
|
-
triggerQuery: function triggerQuery(_temp) {
|
|
1256
|
-
var _ref2 = _temp === void 0 ? false : _temp,
|
|
1257
|
-
_ref2$isOpen = _ref2.isOpen,
|
|
1258
|
-
isOpen = _ref2$isOpen === void 0 ? false : _ref2$isOpen;
|
|
1259
|
-
var value = this.$props.value;
|
|
1260
|
-
if (value !== undefined) {
|
|
1261
|
-
this.isPending = false;
|
|
1262
|
-
this.setValue(this.$props.value, !isOpen);
|
|
1263
|
-
}
|
|
1264
|
-
},
|
|
1265
|
-
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
1266
|
-
// click analytics would only work client side and after javascript loads
|
|
1267
|
-
var docId = documentId;
|
|
1268
|
-
if (!docId) {
|
|
1269
|
-
var hitData = this.suggestionsList.find(function (hit) {
|
|
1270
|
-
return hit._click_id === searchPosition;
|
|
1271
|
-
});
|
|
1272
|
-
if (hitData && hitData.source && hitData.source._id) {
|
|
1273
|
-
docId = hitData.source._id;
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
this.recordSuggestionClick(searchPosition, docId);
|
|
1277
|
-
},
|
|
1278
|
-
clearValue: function clearValue() {
|
|
1279
|
-
this.isPending = false;
|
|
1280
|
-
this.setValue('', true);
|
|
1281
|
-
this.onValueSelectedHandler('', causes.CLEAR_VALUE);
|
|
1282
|
-
},
|
|
1283
|
-
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1284
|
-
var targetValue = event.target.value;
|
|
1285
|
-
var _this$$props2 = this.$props,
|
|
1286
|
-
value = _this$$props2.value,
|
|
1287
|
-
strictSelection = _this$$props2.strictSelection,
|
|
1288
|
-
size = _this$$props2.size;
|
|
1289
|
-
if (value !== undefined) {
|
|
1290
|
-
this.isPending = true;
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
1294
|
-
if (event.key === 'Enter' && (highlightedIndex === null || highlightedIndex < 0 || highlightedIndex === [].concat([].concat(this.suggestionsList).slice(0, size || 10), this.defaultSearchSuggestions, this.topSuggestions).length)) {
|
|
1295
|
-
this.isPending = false;
|
|
1296
|
-
this.setValue(this.$options.isTagsMode && strictSelection ? '' : targetValue, true, this.$props, undefined, false);
|
|
1297
|
-
this.onValueSelectedHandler(targetValue, causes.ENTER_PRESS);
|
|
1298
|
-
}
|
|
1299
|
-
// Need to review
|
|
1300
|
-
this.$emit('keyDown', event, this.triggerQuery);
|
|
1301
|
-
this.$emit('key-down', event, this.triggerQuery);
|
|
1302
|
-
},
|
|
1303
|
-
onInputChange: function onInputChange(e) {
|
|
1304
|
-
var _this2 = this;
|
|
1305
|
-
var inputValue = e.target.value;
|
|
1306
|
-
if (!this.$data.isOpen) {
|
|
1307
|
-
this.isOpen = true;
|
|
1308
|
-
}
|
|
1309
|
-
var _this$$props3 = this.$props,
|
|
1310
|
-
value = _this$$props3.value,
|
|
1311
|
-
autosuggest = _this$$props3.autosuggest;
|
|
1312
|
-
if (value === undefined) {
|
|
1313
|
-
this.setValue(inputValue, false, this.$props, undefined, true, false);
|
|
1314
|
-
} else {
|
|
1315
|
-
this.isPending = true;
|
|
1316
|
-
this.currentValue = inputValue;
|
|
1317
|
-
this.$emit('change', inputValue, function (_temp2) {
|
|
1318
|
-
var _ref3 = _temp2 === void 0 ? {} : _temp2,
|
|
1319
|
-
_ref3$isOpen = _ref3.isOpen,
|
|
1320
|
-
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen;
|
|
1321
|
-
if (_this2.$options.isTagsMode && autosuggest) {
|
|
1322
|
-
_this2.isOpen = isOpen;
|
|
1323
|
-
_this2.updateDefaultQueryHandlerDebounced(_this2.currentValue, _this2.$props);
|
|
1324
|
-
return;
|
|
1325
|
-
}
|
|
1326
|
-
_this2.triggerQuery({
|
|
1327
|
-
isOpen: isOpen
|
|
1328
|
-
});
|
|
1329
|
-
}, e);
|
|
1330
|
-
}
|
|
1331
|
-
},
|
|
1332
|
-
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1333
|
-
var value = this.$props.value;
|
|
1334
|
-
// Record analytics for selected suggestions
|
|
1335
|
-
this.triggerClickAnalytics(suggestion._click_id);
|
|
1336
|
-
if (value === undefined) {
|
|
1337
|
-
this.setValue(suggestion.value, true, this.$props, causes.SUGGESTION_SELECT);
|
|
1338
|
-
} else if (this.$options.isTagsMode) {
|
|
1339
|
-
var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
1340
|
-
if (this.selectedTags.includes(suggestion.value)) {
|
|
1341
|
-
// avoid duplicates in tags array
|
|
1342
|
-
this.isOpen = false;
|
|
1343
|
-
return;
|
|
1344
|
-
}
|
|
1345
|
-
emitValue.push(suggestion.value);
|
|
1346
|
-
this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, true);
|
|
1347
|
-
this.$emit('change', emitValue, this.triggerQuery);
|
|
1348
|
-
} else {
|
|
1349
|
-
this.$emit('change', suggestion.value, this.triggerQuery);
|
|
1350
|
-
}
|
|
1351
|
-
this.isPending = false;
|
|
1352
|
-
this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT, suggestion.source);
|
|
1353
|
-
},
|
|
1354
|
-
onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
|
|
1355
|
-
if (currentValue === void 0) {
|
|
1356
|
-
currentValue = this.$data.currentValue;
|
|
1357
|
-
}
|
|
1358
|
-
for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1359
|
-
cause[_key - 1] = arguments[_key];
|
|
1360
|
-
}
|
|
1361
|
-
this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
|
|
1362
|
-
this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
|
|
1363
|
-
},
|
|
1364
|
-
handleStateChange: function handleStateChange(changes) {
|
|
1365
|
-
var isOpen = changes.isOpen;
|
|
1366
|
-
this.isOpen = isOpen;
|
|
1367
|
-
},
|
|
1368
|
-
getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
|
|
1369
|
-
var isDark = this.themePreset === 'dark';
|
|
1370
|
-
if (isDark) {
|
|
1371
|
-
return highlightedIndex === index ? '#555' : '#424242';
|
|
1372
|
-
}
|
|
1373
|
-
return highlightedIndex === index ? '#eee' : '#fff';
|
|
1374
|
-
},
|
|
1375
|
-
renderIcon: function renderIcon() {
|
|
1376
|
-
if (this.$props.showIcon) {
|
|
1377
|
-
return this.$props.icon || createVNode(SearchSvg, null, null);
|
|
1378
|
-
}
|
|
1379
|
-
return null;
|
|
1380
|
-
},
|
|
1381
|
-
renderErrorComponent: function renderErrorComponent() {
|
|
1382
|
-
var _this3 = this;
|
|
1383
|
-
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
1384
|
-
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
1385
|
-
return createVNode(SuggestionWrapper, {
|
|
1386
|
-
"innerClass": this.$props.innerClass,
|
|
1387
|
-
"innerClassName": "error",
|
|
1388
|
-
"theme": this.theme,
|
|
1389
|
-
"themePreset": this.themePreset
|
|
1390
|
-
}, {
|
|
1391
|
-
"default": function _default() {
|
|
1392
|
-
return [isFunction(renderError) ? renderError(_this3.error) : renderError];
|
|
1393
|
-
}
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
return null;
|
|
1397
|
-
},
|
|
1398
|
-
renderCancelIcon: function renderCancelIcon() {
|
|
1399
|
-
if (this.$props.showClear) {
|
|
1400
|
-
return this.$props.clearIcon || createVNode(CancelSvg, null, null);
|
|
1401
|
-
}
|
|
1402
|
-
return null;
|
|
1403
|
-
},
|
|
1404
|
-
renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
|
|
1405
|
-
if (finalSuggestionsList === void 0) {
|
|
1406
|
-
finalSuggestionsList = [];
|
|
1407
|
-
}
|
|
1408
|
-
var _this$$props4 = this.$props,
|
|
1409
|
-
theme = _this$$props4.theme,
|
|
1410
|
-
innerClass = _this$$props4.innerClass;
|
|
1411
|
-
var renderNoSuggestion = this.$slots.renderNoSuggestion() || this.$props.renderNoSuggestion;
|
|
1412
|
-
var renderError = this.$slots.renderError() || this.$props.renderError;
|
|
1413
|
-
var _this$$data = this.$data,
|
|
1414
|
-
isOpen = _this$$data.isOpen,
|
|
1415
|
-
currentValue = _this$$data.currentValue;
|
|
1416
|
-
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
1417
|
-
return createVNode(SuggestionWrapper, {
|
|
1418
|
-
"innerClass": innerClass,
|
|
1419
|
-
"themePreset": this.themePreset,
|
|
1420
|
-
"theme": theme,
|
|
1421
|
-
"innerClassName": "noSuggestion",
|
|
1422
|
-
"scopedSlots": {
|
|
1423
|
-
"default": function _default() {
|
|
1424
|
-
return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
}, null);
|
|
1428
|
-
}
|
|
1429
|
-
return null;
|
|
1430
|
-
},
|
|
1431
|
-
renderInputAddonBefore: function renderInputAddonBefore() {
|
|
1432
|
-
var addonBefore = this.$slots.addonBefore;
|
|
1433
|
-
if (addonBefore) {
|
|
1434
|
-
var _slot;
|
|
1435
|
-
return createVNode(InputAddon, null, _isSlot(_slot = addonBefore()) ? _slot : {
|
|
1436
|
-
"default": function _default() {
|
|
1437
|
-
return [_slot];
|
|
1438
|
-
}
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
return null;
|
|
1442
|
-
},
|
|
1443
|
-
renderTag: function renderTag(item) {
|
|
1444
|
-
var _this4 = this;
|
|
1445
|
-
var innerClass = this.$props.innerClass;
|
|
1446
|
-
return createVNode(TagItem, {
|
|
1447
|
-
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
1448
|
-
}, {
|
|
1449
|
-
"default": function _default() {
|
|
1450
|
-
return [createVNode("span", null, [item]), createVNode("span", {
|
|
1451
|
-
"role": "img",
|
|
1452
|
-
"aria-label": "delete-tag",
|
|
1453
|
-
"class": "close-icon",
|
|
1454
|
-
"onClick": function onClick() {
|
|
1455
|
-
return _this4.clearTag(item);
|
|
1456
|
-
}
|
|
1457
|
-
}, [createVNode(CancelSvg, null, null)])];
|
|
1458
|
-
}
|
|
1459
|
-
});
|
|
1460
|
-
},
|
|
1461
|
-
clearAllTags: function clearAllTags() {
|
|
1462
|
-
this.selectedTags = [];
|
|
1463
|
-
this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
|
|
1464
|
-
if (this.$props.value !== undefined) {
|
|
1465
|
-
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1466
|
-
}
|
|
1467
|
-
},
|
|
1468
|
-
clearTag: function clearTag(tagValue) {
|
|
1469
|
-
this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
|
|
1470
|
-
return tag !== tagValue;
|
|
1471
|
-
}));
|
|
1472
|
-
this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
|
|
1473
|
-
if (this.$props.value !== undefined) {
|
|
1474
|
-
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1475
|
-
}
|
|
1476
|
-
},
|
|
1477
|
-
renderTags: function renderTags() {
|
|
1478
|
-
var _this5 = this;
|
|
1479
|
-
if (!Array.isArray(this.selectedTags)) {
|
|
1480
|
-
return null;
|
|
1481
|
-
}
|
|
1482
|
-
var tagsList = [].concat(this.selectedTags);
|
|
1483
|
-
var shouldRenderClearAllTag = tagsList.length > 1;
|
|
1484
|
-
var renderSelectedTags = this.$slots.renderSelectedTags || this.$props.renderSelectedTags;
|
|
1485
|
-
return renderSelectedTags ? renderSelectedTags({
|
|
1486
|
-
values: this.selectedTags,
|
|
1487
|
-
handleClear: this.clearTag,
|
|
1488
|
-
handleClearAll: this.clearAllTags
|
|
1489
|
-
}) : createVNode(TagsContainer, null, {
|
|
1490
|
-
"default": function _default() {
|
|
1491
|
-
return [tagsList.map(function (item) {
|
|
1492
|
-
return _this5.renderTag(item);
|
|
1493
|
-
}), shouldRenderClearAllTag && createVNode(TagItem, {
|
|
1494
|
-
"class": getClassName$1(_this5.$props.innerClass, 'selected-tag') || ''
|
|
1495
|
-
}, {
|
|
1496
|
-
"default": function _default() {
|
|
1497
|
-
return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
|
|
1498
|
-
"role": "img",
|
|
1499
|
-
"aria-label": "delete-tag",
|
|
1500
|
-
"class": "close-icon",
|
|
1501
|
-
"onClick": _this5.clearAllTags
|
|
1502
|
-
}, [createVNode(CancelSvg, null, null)])];
|
|
1503
|
-
}
|
|
1504
|
-
})];
|
|
1505
|
-
}
|
|
1506
|
-
});
|
|
1507
|
-
},
|
|
1508
|
-
renderInputAddonAfter: function renderInputAddonAfter() {
|
|
1509
|
-
var addonAfter = this.$slots.addonAfter;
|
|
1510
|
-
if (addonAfter) {
|
|
1511
|
-
var _slot2;
|
|
1512
|
-
return createVNode(InputAddon, null, _isSlot(_slot2 = addonAfter()) ? _slot2 : {
|
|
1513
|
-
"default": function _default() {
|
|
1514
|
-
return [_slot2];
|
|
1515
|
-
}
|
|
1516
|
-
});
|
|
1517
|
-
}
|
|
1518
|
-
return null;
|
|
1519
|
-
},
|
|
1520
|
-
renderIcons: function renderIcons() {
|
|
1521
|
-
var _this6 = this;
|
|
1522
|
-
var _slot3, _slot4, _slot5;
|
|
1523
|
-
var _this$$props5 = this.$props,
|
|
1524
|
-
iconPosition = _this$$props5.iconPosition,
|
|
1525
|
-
showClear = _this$$props5.showClear,
|
|
1526
|
-
innerClass = _this$$props5.innerClass,
|
|
1527
|
-
getMicInstance = _this$$props5.getMicInstance,
|
|
1528
|
-
showVoiceSearch = _this$$props5.showVoiceSearch,
|
|
1529
|
-
showIcon = _this$$props5.showIcon;
|
|
1530
|
-
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
1531
|
-
var currentValue = this.$data.currentValue;
|
|
1532
|
-
return createVNode("div", null, [createVNode(IconGroup, {
|
|
1533
|
-
"groupPosition": "right",
|
|
1534
|
-
"positionType": "absolute"
|
|
1535
|
-
}, {
|
|
1536
|
-
"default": function _default() {
|
|
1537
|
-
return [currentValue && showClear && createVNode(IconWrapper, {
|
|
1538
|
-
"onClick": _this6.clearValue,
|
|
1539
|
-
"showIcon": showIcon,
|
|
1540
|
-
"isClearIcon": true
|
|
1541
|
-
}, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
|
|
1542
|
-
"default": function _default() {
|
|
1543
|
-
return [_slot3];
|
|
1544
|
-
}
|
|
1545
|
-
}), showVoiceSearch && createVNode(Mic, {
|
|
1546
|
-
"getInstance": getMicInstance,
|
|
1547
|
-
"render": renderMic,
|
|
1548
|
-
"handleResult": _this6.handleVoiceResults,
|
|
1549
|
-
"className": getClassName$1(innerClass, 'mic') || null
|
|
1550
|
-
}, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
|
|
1551
|
-
"onClick": _this6.handleSearchIconClick
|
|
1552
|
-
}, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
|
|
1553
|
-
"default": function _default() {
|
|
1554
|
-
return [_slot4];
|
|
1555
|
-
}
|
|
1556
|
-
})];
|
|
1557
|
-
}
|
|
1558
|
-
}), createVNode(IconGroup, {
|
|
1559
|
-
"groupPosition": "left",
|
|
1560
|
-
"positionType": "absolute"
|
|
1561
|
-
}, {
|
|
1562
|
-
"default": function _default() {
|
|
1563
|
-
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
1564
|
-
"onClick": _this6.handleSearchIconClick
|
|
1565
|
-
}, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
|
|
1566
|
-
"default": function _default() {
|
|
1567
|
-
return [_slot5];
|
|
1568
|
-
}
|
|
1569
|
-
})];
|
|
1570
|
-
}
|
|
1571
|
-
})]);
|
|
1572
|
-
},
|
|
1573
|
-
focusSearchBox: function focusSearchBox(event) {
|
|
1574
|
-
var _this$$refs, _this$$refs$this$$pro;
|
|
1575
|
-
var elt = event.target || event.srcElement;
|
|
1576
|
-
var tagName = elt.tagName;
|
|
1577
|
-
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1578
|
-
// already in an input
|
|
1579
|
-
return;
|
|
1580
|
-
}
|
|
1581
|
-
(_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
|
|
1582
|
-
},
|
|
1583
|
-
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1584
|
-
var _this7 = this;
|
|
1585
|
-
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1586
|
-
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1587
|
-
if (isEmpty(focusShortcuts)) {
|
|
1588
|
-
return;
|
|
1589
|
-
}
|
|
1590
|
-
var shortcutsString = parseFocusShortcuts(focusShortcuts).join(',');
|
|
1591
|
-
|
|
1592
|
-
// handler for alphabets and other key combinations
|
|
1593
|
-
hotkeys(shortcutsString,
|
|
1594
|
-
// eslint-disable-next-line no-unused-vars
|
|
1595
|
-
/* eslint-disable no-shadow */
|
|
1596
|
-
function (event, handler) {
|
|
1597
|
-
// Prevent the default refresh event under WINDOWS system
|
|
1598
|
-
event.preventDefault();
|
|
1599
|
-
_this7.focusSearchBox(event);
|
|
1600
|
-
});
|
|
1601
|
-
|
|
1602
|
-
// if one of modifier keys are used, they are handled below
|
|
1603
|
-
hotkeys('*', function (event) {
|
|
1604
|
-
var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
|
|
1605
|
-
if (modifierKeys.length === 0) return;
|
|
1606
|
-
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
1607
|
-
var element = modifierKeys[index];
|
|
1608
|
-
if (hotkeys[element]) {
|
|
1609
|
-
_this7.focusSearchBox(event);
|
|
1610
|
-
break;
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
});
|
|
1614
|
-
}
|
|
1615
|
-
},
|
|
1616
|
-
render: function render() {
|
|
1617
|
-
var _this8 = this;
|
|
1618
|
-
var _this$$props6 = this.$props,
|
|
1619
|
-
theme = _this$$props6.theme,
|
|
1620
|
-
size = _this$$props6.size,
|
|
1621
|
-
expandSuggestionsContainer = _this$$props6.expandSuggestionsContainer,
|
|
1622
|
-
enableDefaultSuggestions = _this$$props6.enableDefaultSuggestions;
|
|
1623
|
-
var _this$$slots = this.$slots,
|
|
1624
|
-
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
1625
|
-
popularSearchesIcon = _this$$slots.popularSearchesIcon;
|
|
1626
|
-
var hasSuggestions = this.currentValue ? this.suggestionsList.length || this.topSuggestions.length : this.defaultSearchSuggestions.length;
|
|
1627
|
-
if (enableDefaultSuggestions === false && !this.currentValue) {
|
|
1628
|
-
hasSuggestions = false;
|
|
1629
|
-
}
|
|
1630
|
-
return createVNode(Container, {
|
|
1631
|
-
"class": this.$props.className
|
|
1632
|
-
}, {
|
|
1633
|
-
"default": function _default() {
|
|
1634
|
-
return [_this8.$props.title && createVNode(Title, {
|
|
1635
|
-
"class": getClassName$1(_this8.$props.innerClass, 'title') || ''
|
|
1636
|
-
}, {
|
|
1637
|
-
"default": function _default() {
|
|
1638
|
-
return [_this8.$props.title];
|
|
1639
|
-
}
|
|
1640
|
-
}), _this8.$props.defaultSuggestions || _this8.$props.autosuggest ? createVNode(Downshift, {
|
|
1641
|
-
"id": _this8.$props.componentId + "-downshift",
|
|
1642
|
-
"handleChange": _this8.onSuggestionSelected,
|
|
1643
|
-
"handleMouseup": _this8.handleStateChange,
|
|
1644
|
-
"isOpen": _this8.$data.isOpen,
|
|
1645
|
-
"scopedSlots": {
|
|
1646
|
-
"default": function _default(_ref4) {
|
|
1647
|
-
var getInputEvents = _ref4.getInputEvents,
|
|
1648
|
-
getInputProps = _ref4.getInputProps,
|
|
1649
|
-
getItemProps = _ref4.getItemProps,
|
|
1650
|
-
getItemEvents = _ref4.getItemEvents,
|
|
1651
|
-
isOpen = _ref4.isOpen,
|
|
1652
|
-
highlightedIndex = _ref4.highlightedIndex,
|
|
1653
|
-
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
1654
|
-
var renderSuggestionsContainer = function renderSuggestionsContainer() {
|
|
1655
|
-
return createVNode("div", null, [_this8.hasCustomRenderer && _this8.getComponent({
|
|
1656
|
-
isOpen: isOpen,
|
|
1657
|
-
getItemProps: getItemProps,
|
|
1658
|
-
getItemEvents: getItemEvents,
|
|
1659
|
-
highlightedIndex: highlightedIndex
|
|
1660
|
-
}), _this8.renderErrorComponent(), !_this8.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
|
|
1661
|
-
"class": suggestions(_this8.themePreset, theme) + " " + getClassName$1(_this8.$props.innerClass, 'list')
|
|
1662
|
-
}, [_this8.suggestionsList.slice(0, size || 10).map(function (item, index) {
|
|
1663
|
-
return createVNode("li", mergeProps({
|
|
1664
|
-
domProps: getItemProps({
|
|
1665
|
-
item: item
|
|
1666
|
-
})
|
|
1667
|
-
}, {
|
|
1668
|
-
on: getItemEvents({
|
|
1669
|
-
item: item
|
|
1670
|
-
})
|
|
1671
|
-
}, {
|
|
1672
|
-
"key": index + 1 + "-" + item.value,
|
|
1673
|
-
"style": {
|
|
1674
|
-
backgroundColor: _this8.getBackgroundColor(highlightedIndex, index)
|
|
1675
|
-
}
|
|
1676
|
-
}), [createVNode(SuggestionItem, {
|
|
1677
|
-
"currentValue": _this8.currentValue,
|
|
1678
|
-
"suggestion": item
|
|
1679
|
-
}, null)]);
|
|
1680
|
-
}), _this8.defaultSearchSuggestions.map(function (sugg, index) {
|
|
1681
|
-
return createVNode("li", mergeProps({
|
|
1682
|
-
domProps: getItemProps({
|
|
1683
|
-
item: sugg
|
|
1684
|
-
})
|
|
1685
|
-
}, {
|
|
1686
|
-
on: getItemEvents({
|
|
1687
|
-
item: sugg
|
|
1688
|
-
})
|
|
1689
|
-
}, {
|
|
1690
|
-
"key": _this8.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
1691
|
-
"style": {
|
|
1692
|
-
backgroundColor: _this8.getBackgroundColor(highlightedIndex, _this8.suggestionsList.length + index),
|
|
1693
|
-
justifyContent: 'flex-start'
|
|
1694
|
-
}
|
|
1695
|
-
}), [createVNode("div", {
|
|
1696
|
-
"style": {
|
|
1697
|
-
padding: '0 10px 0 0'
|
|
1698
|
-
}
|
|
1699
|
-
}, [sugg.source && sugg.source._recent_search && createVNode(CustomSvg, {
|
|
1700
|
-
"className": getClassName$1(_this8.$props.innerClass, 'recent-search-icon') || null,
|
|
1701
|
-
"icon": recentSearchesIcon,
|
|
1702
|
-
"type": "recent-search-icon"
|
|
1703
|
-
}, null), sugg.source && sugg.source._popular_suggestion && createVNode(CustomSvg, {
|
|
1704
|
-
"className": getClassName$1(_this8.$props.innerClass, 'popular-search-icon') || null,
|
|
1705
|
-
"icon": popularSearchesIcon,
|
|
1706
|
-
"type": "popular-search-icon"
|
|
1707
|
-
}, null)]), createVNode(SuggestionItem, {
|
|
1708
|
-
"currentValue": _this8.currentValue,
|
|
1709
|
-
"suggestion": sugg
|
|
1710
|
-
}, null)]);
|
|
1711
|
-
}), hasQuerySuggestionsRenderer(_this8) ? _this8.getComponent({
|
|
1712
|
-
isOpen: isOpen,
|
|
1713
|
-
getItemProps: getItemProps,
|
|
1714
|
-
getItemEvents: getItemEvents,
|
|
1715
|
-
highlightedIndex: highlightedIndex
|
|
1716
|
-
}, true) : _this8.topSuggestions.map(function (sugg, index) {
|
|
1717
|
-
return createVNode("li", mergeProps({
|
|
1718
|
-
domProps: getItemProps({
|
|
1719
|
-
item: sugg
|
|
1720
|
-
})
|
|
1721
|
-
}, {
|
|
1722
|
-
on: getItemEvents({
|
|
1723
|
-
item: sugg
|
|
1724
|
-
})
|
|
1725
|
-
}, {
|
|
1726
|
-
"key": _this8.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
1727
|
-
"style": {
|
|
1728
|
-
backgroundColor: _this8.getBackgroundColor(highlightedIndex, _this8.suggestionsList.length + index),
|
|
1729
|
-
justifyContent: 'flex-start'
|
|
1730
|
-
}
|
|
1731
|
-
}), [createVNode("div", {
|
|
1732
|
-
"style": {
|
|
1733
|
-
padding: '0 10px 0 0'
|
|
1734
|
-
}
|
|
1735
|
-
}, [createVNode(CustomSvg, {
|
|
1736
|
-
"className": getClassName$1(_this8.$props.innerClass, 'popular-search-icon') || null,
|
|
1737
|
-
"icon": popularSearchesIcon,
|
|
1738
|
-
"type": "popular-search-icon"
|
|
1739
|
-
}, null)]), createVNode(SuggestionItem, {
|
|
1740
|
-
"currentValue": _this8.currentValue,
|
|
1741
|
-
"suggestion": sugg
|
|
1742
|
-
}, null)]);
|
|
1743
|
-
})]) : _this8.renderNoSuggestions(_this8.suggestionsList)]);
|
|
1744
|
-
};
|
|
1745
|
-
return createVNode("div", {
|
|
1746
|
-
"class": suggestionsContainer
|
|
1747
|
-
}, [createVNode(InputGroup, null, {
|
|
1748
|
-
"default": function _default() {
|
|
1749
|
-
return [_this8.renderInputAddonBefore(), createVNode(InputWrapper, null, {
|
|
1750
|
-
"default": function _default() {
|
|
1751
|
-
return [createVNode(Input, mergeProps({
|
|
1752
|
-
"id": _this8.$props.componentId + "-input",
|
|
1753
|
-
"showIcon": _this8.$props.showIcon,
|
|
1754
|
-
"showClear": _this8.$props.showClear,
|
|
1755
|
-
"iconPosition": _this8.$props.iconPosition,
|
|
1756
|
-
"ref": _this8.$props.innerRef,
|
|
1757
|
-
"class": getClassName$1(_this8.$props.innerClass, 'input'),
|
|
1758
|
-
"placeholder": _this8.$props.placeholder,
|
|
1759
|
-
"autoFocus": _this8.$props.autoFocus
|
|
1760
|
-
}, {
|
|
1761
|
-
on: getInputEvents({
|
|
1762
|
-
onInput: _this8.onInputChange,
|
|
1763
|
-
onBlur: function onBlur(e) {
|
|
1764
|
-
_this8.$emit('blur', e, _this8.triggerQuery);
|
|
1765
|
-
},
|
|
1766
|
-
onFocus: _this8.handleFocus,
|
|
1767
|
-
onKeyPress: function onKeyPress(e) {
|
|
1768
|
-
_this8.$emit('keyPress', e, _this8.triggerQuery);
|
|
1769
|
-
_this8.$emit('key-press', e, _this8.triggerQuery);
|
|
1770
|
-
},
|
|
1771
|
-
onKeyDown: function onKeyDown(e) {
|
|
1772
|
-
return _this8.handleKeyDown(e, highlightedIndex);
|
|
1773
|
-
},
|
|
1774
|
-
onKeyUp: function onKeyUp(e) {
|
|
1775
|
-
_this8.$emit('keyUp', e, _this8.triggerQuery);
|
|
1776
|
-
_this8.$emit('key-up', e, _this8.triggerQuery);
|
|
1777
|
-
},
|
|
1778
|
-
onClick: function onClick() {
|
|
1779
|
-
setHighlightedIndex(null);
|
|
1780
|
-
}
|
|
1781
|
-
})
|
|
1782
|
-
}, {
|
|
1783
|
-
domProps: getInputProps({
|
|
1784
|
-
value: _this8.$data.currentValue === null || typeof _this8.$data.currentValue !== 'string' ? '' : _this8.$data.currentValue
|
|
1785
|
-
})
|
|
1786
|
-
}, {
|
|
1787
|
-
"themePreset": _this8.themePreset,
|
|
1788
|
-
"autocomplete": "off"
|
|
1789
|
-
}), null), _this8.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()];
|
|
1790
|
-
}
|
|
1791
|
-
}), ' ', _this8.renderInputAddonAfter()];
|
|
1792
|
-
}
|
|
1793
|
-
}), expandSuggestionsContainer && renderSuggestionsContainer(), _this8.renderTags()]);
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
}, null) : createVNode("div", {
|
|
1797
|
-
"class": suggestionsContainer
|
|
1798
|
-
}, [createVNode(InputGroup, null, {
|
|
1799
|
-
"default": function _default() {
|
|
1800
|
-
return [_this8.renderInputAddonBefore(), createVNode(InputWrapper, null, {
|
|
1801
|
-
"default": function _default() {
|
|
1802
|
-
return [createVNode(Input, mergeProps({
|
|
1803
|
-
"class": getClassName$1(_this8.$props.innerClass, 'input') || '',
|
|
1804
|
-
"placeholder": _this8.$props.placeholder
|
|
1805
|
-
}, {
|
|
1806
|
-
on: {
|
|
1807
|
-
blur: function blur(e) {
|
|
1808
|
-
_this8.$emit('blur', e, _this8.triggerQuery);
|
|
1809
|
-
},
|
|
1810
|
-
keypress: function keypress(e) {
|
|
1811
|
-
_this8.$emit('keyPress', e, _this8.triggerQuery);
|
|
1812
|
-
_this8.$emit('key-press', e, _this8.triggerQuery);
|
|
1813
|
-
},
|
|
1814
|
-
input: _this8.onInputChange,
|
|
1815
|
-
focus: function focus(e) {
|
|
1816
|
-
_this8.$emit('focus', e, _this8.triggerQuery);
|
|
1817
|
-
},
|
|
1818
|
-
keydown: function keydown(e) {
|
|
1819
|
-
_this8.$emit('keyDown', e, _this8.triggerQuery);
|
|
1820
|
-
_this8.$emit('key-down', e, _this8.triggerQuery);
|
|
1821
|
-
},
|
|
1822
|
-
keyup: function keyup(e) {
|
|
1823
|
-
_this8.$emit('keyUp', e, _this8.triggerQuery);
|
|
1824
|
-
_this8.$emit('key-up', e, _this8.triggerQuery);
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
}, {
|
|
1828
|
-
domProps: {
|
|
1829
|
-
autofocus: _this8.$props.autoFocus,
|
|
1830
|
-
value: _this8.$data.currentValue ? _this8.$data.currentValue : ''
|
|
1831
|
-
}
|
|
1832
|
-
}, {
|
|
1833
|
-
"iconPosition": _this8.$props.iconPosition,
|
|
1834
|
-
"showIcon": _this8.$props.showIcon,
|
|
1835
|
-
"showClear": _this8.$props.showClear,
|
|
1836
|
-
"ref": _this8.$props.innerRef,
|
|
1837
|
-
"themePreset": _this8.themePreset
|
|
1838
|
-
}), null), _this8.renderIcons()];
|
|
1839
|
-
}
|
|
1840
|
-
}), _this8.renderInputAddonAfter()];
|
|
1841
|
-
}
|
|
1842
|
-
}), _this8.renderTags()])];
|
|
1843
|
-
}
|
|
1844
|
-
});
|
|
1845
|
-
},
|
|
1846
|
-
destroyed: function destroyed() {
|
|
1847
|
-
document.removeEventListener('keydown', this.onKeyDown);
|
|
1848
|
-
}
|
|
1849
|
-
};
|
|
1850
|
-
DataSearch.defaultQuery = function (value, props) {
|
|
1851
|
-
var finalQuery = null;
|
|
1852
|
-
if (value) {
|
|
1853
|
-
var fields = normalizeDataField(props.dataField, props.fieldWeights);
|
|
1854
|
-
finalQuery = {
|
|
1855
|
-
bool: {
|
|
1856
|
-
should: DataSearch.shouldQuery(value, fields, props),
|
|
1857
|
-
minimum_should_match: '1'
|
|
1858
|
-
}
|
|
1859
|
-
};
|
|
1860
|
-
}
|
|
1861
|
-
if (value === '') {
|
|
1862
|
-
finalQuery = null;
|
|
1863
|
-
}
|
|
1864
|
-
if (finalQuery && props.nestedField) {
|
|
1865
|
-
return {
|
|
1866
|
-
query: {
|
|
1867
|
-
nested: {
|
|
1868
|
-
path: props.nestedField,
|
|
1869
|
-
query: finalQuery
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
};
|
|
1873
|
-
}
|
|
1874
|
-
return finalQuery;
|
|
1875
|
-
};
|
|
1876
|
-
DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
1877
|
-
var finalQuery = [];
|
|
1878
|
-
var phrasePrefixFields = [];
|
|
1879
|
-
var fields = dataFields.map(function (dataField) {
|
|
1880
|
-
var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
|
|
1881
|
-
if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
|
|
1882
|
-
phrasePrefixFields.push(queryField);
|
|
1883
|
-
}
|
|
1884
|
-
return queryField;
|
|
1885
|
-
});
|
|
1886
|
-
if (props.searchOperators || props.queryString) {
|
|
1887
|
-
return {
|
|
1888
|
-
query: value,
|
|
1889
|
-
fields: fields,
|
|
1890
|
-
default_operator: props.queryFormat
|
|
1891
|
-
};
|
|
1892
|
-
}
|
|
1893
|
-
if (props.queryFormat === 'and') {
|
|
1894
|
-
finalQuery.push({
|
|
1895
|
-
multi_match: {
|
|
1896
|
-
query: value,
|
|
1897
|
-
fields: fields,
|
|
1898
|
-
type: 'cross_fields',
|
|
1899
|
-
operator: 'and'
|
|
1900
|
-
}
|
|
1901
|
-
});
|
|
1902
|
-
finalQuery.push({
|
|
1903
|
-
multi_match: {
|
|
1904
|
-
query: value,
|
|
1905
|
-
fields: fields,
|
|
1906
|
-
type: 'phrase',
|
|
1907
|
-
operator: 'and'
|
|
1908
|
-
}
|
|
1909
|
-
});
|
|
1910
|
-
if (phrasePrefixFields.length > 0) {
|
|
1911
|
-
finalQuery.push({
|
|
1912
|
-
multi_match: {
|
|
1913
|
-
query: value,
|
|
1914
|
-
fields: phrasePrefixFields,
|
|
1915
|
-
type: 'phrase_prefix',
|
|
1916
|
-
operator: 'and'
|
|
1917
|
-
}
|
|
1918
|
-
});
|
|
1919
|
-
}
|
|
1920
|
-
return finalQuery;
|
|
1921
|
-
}
|
|
1922
|
-
finalQuery.push({
|
|
1923
|
-
multi_match: {
|
|
1924
|
-
query: value,
|
|
1925
|
-
fields: fields,
|
|
1926
|
-
type: 'best_fields',
|
|
1927
|
-
operator: 'or',
|
|
1928
|
-
fuzziness: props.fuzziness ? props.fuzziness : 0
|
|
1929
|
-
}
|
|
1930
|
-
});
|
|
1931
|
-
finalQuery.push({
|
|
1932
|
-
multi_match: {
|
|
1933
|
-
query: value,
|
|
1934
|
-
fields: fields,
|
|
1935
|
-
type: 'phrase',
|
|
1936
|
-
operator: 'or'
|
|
1937
|
-
}
|
|
1938
|
-
});
|
|
1939
|
-
if (phrasePrefixFields.length > 0) {
|
|
1940
|
-
finalQuery.push({
|
|
1941
|
-
multi_match: {
|
|
1942
|
-
query: value,
|
|
1943
|
-
fields: phrasePrefixFields,
|
|
1944
|
-
type: 'phrase_prefix',
|
|
1945
|
-
operator: 'or'
|
|
1946
|
-
}
|
|
1947
|
-
});
|
|
1948
|
-
}
|
|
1949
|
-
return finalQuery;
|
|
1950
|
-
};
|
|
1951
|
-
DataSearch.highlightQuery = function (props) {
|
|
1952
|
-
if (props.customHighlight) {
|
|
1953
|
-
return props.customHighlight(props);
|
|
1954
|
-
}
|
|
1955
|
-
if (!props.highlight) {
|
|
1956
|
-
return null;
|
|
1957
|
-
}
|
|
1958
|
-
var fields = {};
|
|
1959
|
-
var highlightField = props.highlightField ? props.highlightField : props.dataField;
|
|
1960
|
-
if (typeof highlightField === 'string') {
|
|
1961
|
-
fields[highlightField] = {};
|
|
1962
|
-
} else if (Array.isArray(highlightField)) {
|
|
1963
|
-
highlightField.forEach(function (item) {
|
|
1964
|
-
fields[item] = {};
|
|
1965
|
-
});
|
|
1966
|
-
}
|
|
1967
|
-
return {
|
|
1968
|
-
highlight: _extends({
|
|
1969
|
-
pre_tags: ['<mark>'],
|
|
1970
|
-
post_tags: ['</mark>'],
|
|
1971
|
-
fields: fields
|
|
1972
|
-
}, props.highlightField && {
|
|
1973
|
-
require_field_match: false
|
|
1974
|
-
})
|
|
1975
|
-
};
|
|
1976
|
-
};
|
|
1977
|
-
DataSearch.hasInternalComponent = function () {
|
|
1978
|
-
return true;
|
|
1979
|
-
};
|
|
1980
|
-
var mapStateToProps = function mapStateToProps(state, props) {
|
|
1981
|
-
return {
|
|
1982
|
-
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
1983
|
-
suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
1984
|
-
rawData: state.rawData[props.componentId],
|
|
1985
|
-
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
1986
|
-
isLoading: !!state.isLoading[props.componentId + "_active"],
|
|
1987
|
-
themePreset: state.config.themePreset,
|
|
1988
|
-
error: state.error[props.componentId],
|
|
1989
|
-
analytics: state.analytics,
|
|
1990
|
-
enableAppbase: state.config.enableAppbase,
|
|
1991
|
-
headers: state.appbaseRef.headers,
|
|
1992
|
-
promotedResults: state.promotedResults[props.componentId] || [],
|
|
1993
|
-
customData: state.customData[props.componentId],
|
|
1994
|
-
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
1995
|
-
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
1996
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
1997
|
-
popularSuggestions: state.querySuggestions[props.componentId],
|
|
1998
|
-
defaultPopularSuggestions: state.defaultPopularSuggestions[props.componentId],
|
|
1999
|
-
componentProps: state.props[props.componentId],
|
|
2000
|
-
lastUsedQuery: state.queryToHits[props.componentId],
|
|
2001
|
-
recentSearches: state.recentSearches.data
|
|
2002
|
-
};
|
|
2003
|
-
};
|
|
2004
|
-
var mapDispatchToProps = {
|
|
2005
|
-
setQueryOptions: setQueryOptions,
|
|
2006
|
-
updateQuery: updateQuery,
|
|
2007
|
-
setCustomQuery: setCustomQuery,
|
|
2008
|
-
setDefaultQuery: setDefaultQuery,
|
|
2009
|
-
setCustomHighlightOptions: setCustomHighlightOptions,
|
|
2010
|
-
recordSuggestionClick: recordSuggestionClick,
|
|
2011
|
-
loadPopularSuggestions: loadPopularSuggestions,
|
|
2012
|
-
getRecentSearches: getRecentSearches,
|
|
2013
|
-
resetStoreForComponent: resetStoreForComponent
|
|
2014
|
-
};
|
|
2015
|
-
var DSConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchToProps)(DataSearch), {
|
|
2016
|
-
componentType: componentTypes.dataSearch,
|
|
2017
|
-
internalComponent: DataSearch.hasInternalComponent()
|
|
2018
|
-
}));
|
|
2019
|
-
DSConnected.name = DataSearch.name;
|
|
2020
|
-
|
|
2021
|
-
// plugins usage
|
|
2022
|
-
DSConnected.install = function (Vue) {
|
|
2023
|
-
Vue.component(DSConnected.name, DSConnected);
|
|
2024
|
-
};
|
|
2025
|
-
// Add componentType for SSR
|
|
2026
|
-
DSConnected.componentType = componentTypes.dataSearch;
|
|
2027
|
-
|
|
2028
|
-
export { CustomSvg as C, DSConnected as D, InputAddon as I, Mic as M, SearchSvg as S, TagItem as T, DSConnected as a, SuggestionWrapper as b, TagsContainer as c, InputGroup as d, SuggestionItem as e };
|