@appbaseio/reactivesearch-vue 2.0.0-alpha.3 → 3.0.0-alpha.0

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