@appbaseio/reactivesearch-vue 1.16.0-alpha.6 → 1.16.0-alpha.62

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