@appbaseio/reactivesearch-vue 1.25.0 → 1.27.0-gamma.2

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