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

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