@appbaseio/reactivesearch-vue 1.24.3 → 1.27.0-gamma.1

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