@appbaseio/reactivesearch-vue 1.33.0 → 1.33.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.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +1916 -6072
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +3 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-0673191e.js → Button-841fd06d.js} +1 -7
- package/dist/cjs/{CancelSvg-9f258f4f.js → CancelSvg-220a7cc3.js} +24 -58
- package/dist/cjs/{Card-642547a8.js → Card-240f283d.js} +2 -2
- package/dist/cjs/{ComponentWrapper-981ab977.js → ComponentWrapper-9318cece.js} +21 -41
- package/dist/cjs/{Container-daf30918.js → Container-e699ea95.js} +1 -1
- package/dist/cjs/{DataSearch-708b183d.js → DataSearch-99a6a2e8.js} +121 -293
- package/dist/cjs/DataSearch.js +11 -11
- package/dist/cjs/{DropDown-c479bbb0.js → DropDown-8984b544.js} +27 -48
- package/dist/cjs/DynamicRangeSlider.js +44 -93
- package/dist/cjs/{Flex-aa517a13.js → Flex-ddd7cb6b.js} +1 -3
- package/dist/cjs/{FormControlList-c195a592.js → FormControlList-bbb5cd24.js} +1 -3
- package/dist/cjs/{Input-e6603a7e.js → Input-ead4cd84.js} +14 -16
- package/dist/cjs/{ListItem-8c9e0d68.js → ListItem-5088bd6a.js} +2 -3
- package/dist/cjs/MultiDropdownList.js +41 -102
- package/dist/cjs/MultiList.js +35 -98
- package/dist/cjs/MultiRange.js +20 -52
- package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
- package/dist/cjs/{PreferencesConsumer-7be03476.js → PreferencesConsumer-5d67b486.js} +13 -16
- package/dist/cjs/RangeInput.js +36 -52
- package/dist/cjs/RangeSlider.js +24 -48
- package/dist/cjs/ReactiveBase.js +34 -79
- package/dist/cjs/{ReactiveComponent-5ff98cce.js → ReactiveComponent-805201c6.js} +118 -301
- package/dist/cjs/ReactiveComponent.js +20 -20
- package/dist/cjs/ReactiveGoogleMap.js +167 -353
- package/dist/cjs/ReactiveList.js +88 -176
- package/dist/cjs/ResultCard.js +10 -18
- package/dist/cjs/ResultList.js +13 -24
- package/dist/cjs/SelectedFilters.js +16 -34
- package/dist/cjs/SingleDropdownList.js +35 -75
- package/dist/cjs/SingleList.js +29 -75
- package/dist/cjs/SingleRange.js +17 -40
- package/dist/cjs/StateProvider.js +6 -26
- package/dist/cjs/{Title-1de7d0f4.js → Title-16042ea0.js} +1 -1
- package/dist/cjs/ToggleButton.js +20 -58
- package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
- package/dist/cjs/{index-08f8dfa3.js → index-30126fd0.js} +39 -75
- package/dist/cjs/index.js +20 -21
- package/dist/cjs/initReactivesearch.js +49 -120
- package/dist/cjs/install.js +20 -20
- package/dist/cjs/{ssr-3027b848.js → ssr-f2fc1bf6.js} +1 -4
- package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-7cfc2f98.js} +6 -11
- package/dist/es/{Button-35aa984e.js → Button-153cd885.js} +1 -7
- package/dist/es/{CancelSvg-4cfae5fd.js → CancelSvg-e40552a5.js} +24 -58
- package/dist/es/{Card-450683f1.js → Card-19ad6d90.js} +2 -2
- package/dist/es/{ComponentWrapper-d5e814a4.js → ComponentWrapper-240450cc.js} +21 -41
- package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +1 -1
- package/dist/es/{DataSearch-5376d39a.js → DataSearch-20f0d8f1.js} +121 -293
- package/dist/es/DataSearch.js +11 -11
- package/dist/es/{DropDown-05a644a5.js → DropDown-28ddce07.js} +27 -48
- package/dist/es/DynamicRangeSlider.js +44 -93
- package/dist/es/{Flex-1f0795c3.js → Flex-7c177a10.js} +1 -3
- package/dist/es/{FormControlList-c22d64f6.js → FormControlList-99797d0a.js} +1 -3
- package/dist/es/{Input-7a2a9fac.js → Input-c09c0b56.js} +14 -16
- package/dist/es/{ListItem-cad14c5e.js → ListItem-07888a65.js} +2 -3
- package/dist/es/MultiDropdownList.js +41 -102
- package/dist/es/MultiList.js +35 -98
- package/dist/es/MultiRange.js +20 -52
- package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
- package/dist/es/{PreferencesConsumer-c30605fe.js → PreferencesConsumer-bc097ebb.js} +13 -16
- package/dist/es/RangeInput.js +36 -52
- package/dist/es/RangeSlider.js +24 -48
- package/dist/es/ReactiveBase.js +34 -79
- package/dist/es/{ReactiveComponent-ee01562d.js → ReactiveComponent-dd85aa9c.js} +118 -301
- package/dist/es/ReactiveComponent.js +20 -20
- package/dist/es/ReactiveGoogleMap.js +167 -353
- package/dist/es/ReactiveList.js +88 -176
- package/dist/es/ResultCard.js +10 -18
- package/dist/es/ResultList.js +13 -24
- package/dist/es/SelectedFilters.js +16 -34
- package/dist/es/SingleDropdownList.js +35 -75
- package/dist/es/SingleList.js +29 -75
- package/dist/es/SingleRange.js +17 -40
- package/dist/es/StateProvider.js +6 -26
- package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +1 -1
- package/dist/es/ToggleButton.js +20 -58
- package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
- package/dist/es/{index-99c5f9c9.js → index-0444a498.js} +39 -75
- package/dist/es/index.js +20 -21
- package/dist/es/initReactivesearch.js +49 -120
- package/dist/es/install.js +20 -20
- package/dist/es/{ssr-b2c0b401.js → ssr-03607d84.js} +1 -4
- package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-b8146772.js → vueTypes-8986b709.js} +6 -11
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { helper, Actions, causes } from '@appbaseio/reactivecore';
|
|
2
2
|
import { SEARCH_COMPONENTS_MODES, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
3
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
5
5
|
import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
6
6
|
import styled, { css, cx, injectGlobal } from '@appbaseio/vue-emotion';
|
|
7
|
-
import { t as types } from './vueTypes-
|
|
8
|
-
import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, j as getQuerySuggestionsComponent, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, m as hasQuerySuggestionsRenderer, c as connect } from './index-
|
|
9
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
10
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
11
|
-
import { T as Title } from './Title-
|
|
12
|
-
import { F as Flex } from './Flex-
|
|
7
|
+
import { t as types } from './vueTypes-8986b709.js';
|
|
8
|
+
import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, j as getQuerySuggestionsComponent, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, m as hasQuerySuggestionsRenderer, c as connect } from './index-0444a498.js';
|
|
9
|
+
import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
|
|
10
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
|
|
11
|
+
import { T as Title } from './Title-863dfa42.js';
|
|
12
|
+
import { F as Flex } from './Flex-7c177a10.js';
|
|
13
13
|
import hotkeys from 'hotkeys-js';
|
|
14
|
-
import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './CancelSvg-
|
|
15
|
-
import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-
|
|
16
|
-
import { C as Container } from './Container-
|
|
14
|
+
import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './CancelSvg-e40552a5.js';
|
|
15
|
+
import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-c09c0b56.js';
|
|
16
|
+
import { C as Container } from './Container-d00219f7.js';
|
|
17
17
|
import Highlight from 'vue-highlight-words';
|
|
18
18
|
|
|
19
19
|
var _templateObject;
|
|
@@ -39,9 +39,9 @@ var SuggestionWrapper = {
|
|
|
39
39
|
render: function render() {
|
|
40
40
|
var h = arguments[0];
|
|
41
41
|
var _this$$props = this.$props,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
themePreset = _this$$props.themePreset,
|
|
43
|
+
innerClass = _this$$props.innerClass,
|
|
44
|
+
innerClassName = _this$$props.innerClassName;
|
|
45
45
|
return h("div", {
|
|
46
46
|
"class": noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
|
|
47
47
|
}, [h("li", [this.$scopedSlots["default"]()])]);
|
|
@@ -65,20 +65,20 @@ var SuggestionItem = {
|
|
|
65
65
|
render: function render() {
|
|
66
66
|
var h = arguments[0];
|
|
67
67
|
var _this$suggestion = this.suggestion,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
label = _this$suggestion.label,
|
|
69
|
+
value = _this$suggestion.value,
|
|
70
|
+
title = _this$suggestion.title,
|
|
71
|
+
description = _this$suggestion.description,
|
|
72
|
+
image = _this$suggestion.image,
|
|
73
|
+
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
|
|
74
|
+
_suggestion_type = _this$suggestion._suggestion_type,
|
|
75
|
+
_category = _this$suggestion._category;
|
|
77
76
|
if (label) {
|
|
78
77
|
// label has highest precedence
|
|
79
78
|
return typeof label === 'string' ? h("div", {
|
|
80
79
|
"class": "trim"
|
|
81
|
-
}, [(_category ? false : isPredictiveSuggestion
|
|
80
|
+
}, [(_category ? false : isPredictiveSuggestion
|
|
81
|
+
// eslint-disable-next-line
|
|
82
82
|
|| !!_suggestion_type) ? h(PredictiveSuggestion, {
|
|
83
83
|
"domProps": {
|
|
84
84
|
"innerHTML": label
|
|
@@ -92,7 +92,6 @@ var SuggestionItem = {
|
|
|
92
92
|
}
|
|
93
93
|
})]) : label;
|
|
94
94
|
}
|
|
95
|
-
|
|
96
95
|
if (title || image || description) {
|
|
97
96
|
return h(Flex, {
|
|
98
97
|
"attrs": {
|
|
@@ -148,7 +147,6 @@ var SuggestionItem = {
|
|
|
148
147
|
}
|
|
149
148
|
})])])]);
|
|
150
149
|
}
|
|
151
|
-
|
|
152
150
|
return value;
|
|
153
151
|
}
|
|
154
152
|
};
|
|
@@ -180,6 +178,7 @@ var SearchSvg = {
|
|
|
180
178
|
|
|
181
179
|
var _templateObject$3;
|
|
182
180
|
|
|
181
|
+
// eslint-disable-next-line
|
|
183
182
|
injectGlobal(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n\t#el_TvxDfTAtKp {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_D93PK3GbmJ {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t\tfill: #d8d8d8;\n\t}\n"])));
|
|
184
183
|
var MicSvg = {
|
|
185
184
|
name: 'MicSvg',
|
|
@@ -227,6 +226,7 @@ var MicSvg = {
|
|
|
227
226
|
|
|
228
227
|
var _templateObject$4;
|
|
229
228
|
|
|
229
|
+
// eslint-disable-next-line
|
|
230
230
|
injectGlobal(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\t#el_X81iT9kZYo {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_gMpyalCphp {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t}\n\t#el_c7H-3u-D4l {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_qhFcdAAFwo {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_M8X8g37WOI {\n\t\tstroke: #e83137;\n\t\tstroke-width: 21;\n\t}\n"])));
|
|
231
231
|
var MuteSvg = {
|
|
232
232
|
name: 'MuteSvg',
|
|
@@ -285,6 +285,7 @@ var MuteSvg = {
|
|
|
285
285
|
|
|
286
286
|
var _templateObject$5;
|
|
287
287
|
|
|
288
|
+
// eslint-disable-next-line
|
|
288
289
|
injectGlobal(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\t@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t#el_hiibMG0x- * {\n\t\t-webkit-animation-duration: 1.2s;\n\t\tanimation-duration: 1.2s;\n\t\t-webkit-animation-iteration-count: infinite;\n\t\tanimation-iteration-count: infinite;\n\t\t-webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t}\n\t#el_QJeJ_2CDw5 {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_UYYCfubTRf {\n\t\t-webkit-transform: translate(163px, 123px);\n\t\ttransform: translate(163px, 123px);\n\t}\n\t#el_uzZNtK32Zi {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_EYKQ2N9Kgy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6SDP2LAgKC {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t}\n\t#el_-Vm65Ltfy7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_q04iZcSim4 {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6WKby7wXqV {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\tanimation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_9bggsfQOtU {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_NKxqi9eIym {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_Wi-my975tM {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\tanimation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_zclQ34fvf7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_1OsvRT8HkeZ {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DkfFFTaFxy8 {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\tanimation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_aa9sjx4H0vA {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_tea114vWg0J {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_34IgwiMB5rf {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\tanimation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_z5u6RAFhx7d {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_7nfuWmA5Uhy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DeebuCsPTGA {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\tanimation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el__ZcqlS20zcw {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_8DnEQnD7VWV {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_ZOjjrPTvyrv {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\tanimation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_FYYKCI_u24e {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_XZty4MnTp5Y {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_2FATegVmf0K {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\tanimation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_RMT1KUfbdF8 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_RgLcovvFiO1 {\n\t\tfill: #d8d8d8;\n\t}\n"])));
|
|
289
290
|
var ListenSvg = {
|
|
290
291
|
name: 'ListenSvg',
|
|
@@ -635,90 +636,71 @@ var Mic = {
|
|
|
635
636
|
},
|
|
636
637
|
handleClick: function handleClick() {
|
|
637
638
|
var _this = this;
|
|
638
|
-
|
|
639
639
|
this.results = [];
|
|
640
|
-
|
|
641
640
|
if (window && window.SpeechRecognition) {
|
|
642
641
|
var status = this.$data.status;
|
|
643
|
-
|
|
644
642
|
if (status === STATUS.active) {
|
|
645
643
|
this.status = STATUS.inactive;
|
|
646
644
|
}
|
|
647
|
-
|
|
648
645
|
var _this$$props = this.$props,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
646
|
+
handleResult = _this$$props.handleResult,
|
|
647
|
+
onNoMatch = _this$$props.onNoMatch,
|
|
648
|
+
onError = _this$$props.onError,
|
|
649
|
+
lang = _this$$props.lang,
|
|
650
|
+
getInstance = _this$$props.getInstance;
|
|
654
651
|
var _window = window,
|
|
655
|
-
|
|
656
|
-
|
|
652
|
+
SpeechRecognition = _window.SpeechRecognition;
|
|
657
653
|
if (this.instance && this.status !== STATUS.denied) {
|
|
658
654
|
this.status = STATUS.inactive;
|
|
659
655
|
this.instance.stop();
|
|
660
656
|
this.instance = null;
|
|
661
657
|
return;
|
|
662
658
|
}
|
|
663
|
-
|
|
664
659
|
this.instance = new SpeechRecognition();
|
|
665
660
|
this.instance.continuous = true;
|
|
666
661
|
this.instance.interimResults = true;
|
|
667
662
|
this.instance.lang = lang;
|
|
668
|
-
|
|
669
663
|
if (getInstance) {
|
|
670
664
|
getInstance(this.instance);
|
|
671
665
|
}
|
|
672
|
-
|
|
673
666
|
this.instance.start();
|
|
674
|
-
|
|
675
667
|
this.instance.onstart = function () {
|
|
676
668
|
_this.status = STATUS.active;
|
|
677
669
|
};
|
|
678
|
-
|
|
679
670
|
this.instance.onresult = function (_ref) {
|
|
680
671
|
var results = _ref.results,
|
|
681
|
-
|
|
682
|
-
|
|
672
|
+
timeStamp = _ref.timeStamp;
|
|
683
673
|
_this.stopMic();
|
|
684
|
-
|
|
685
674
|
if (handleResult) {
|
|
686
675
|
handleResult({
|
|
687
676
|
results: results,
|
|
688
677
|
timeStamp: timeStamp
|
|
689
678
|
});
|
|
690
679
|
}
|
|
691
|
-
|
|
692
680
|
_this.results.push({
|
|
693
681
|
results: results,
|
|
694
682
|
timeStamp: timeStamp
|
|
695
683
|
});
|
|
696
684
|
};
|
|
697
|
-
|
|
698
685
|
this.instance.onnomatch = function (e) {
|
|
699
686
|
return onNoMatch ? onNoMatch(e) : console.warn(e);
|
|
700
687
|
};
|
|
701
|
-
|
|
702
688
|
this.instance.onerror = function (e) {
|
|
703
689
|
if (e.error === 'no-speech' || e.error === 'audio-capture') {
|
|
704
690
|
_this.status = STATUS.inactive;
|
|
705
691
|
} else if (e.error === 'not-allowed') {
|
|
706
692
|
_this.status = STATUS.denied;
|
|
707
693
|
}
|
|
708
|
-
|
|
709
694
|
console.error(e);
|
|
710
|
-
|
|
711
695
|
if (onError) {
|
|
712
696
|
onError(e);
|
|
713
697
|
}
|
|
714
698
|
};
|
|
715
|
-
/* Below Two methods run when Continuous is False */
|
|
716
|
-
|
|
717
699
|
|
|
700
|
+
/* Below Two methods run when Continuous is False */
|
|
718
701
|
this.instance.onspeechend = function () {
|
|
719
702
|
_this.status = STATUS.inactive;
|
|
720
703
|
};
|
|
721
|
-
|
|
722
704
|
this.instance.onaudioend = function () {
|
|
723
705
|
_this.status = STATUS.inactive;
|
|
724
706
|
};
|
|
@@ -733,7 +715,6 @@ var Mic = {
|
|
|
733
715
|
var h = this.$createElement;
|
|
734
716
|
var status = this.$data.status;
|
|
735
717
|
var className = this.$props.className;
|
|
736
|
-
|
|
737
718
|
switch (status) {
|
|
738
719
|
case STATUS.active:
|
|
739
720
|
return h(ListenSvg, {
|
|
@@ -744,7 +725,6 @@ var Mic = {
|
|
|
744
725
|
"click": this.handleClick
|
|
745
726
|
}
|
|
746
727
|
});
|
|
747
|
-
|
|
748
728
|
case STATUS.stopped:
|
|
749
729
|
case STATUS.denied:
|
|
750
730
|
return h(MuteSvg, {
|
|
@@ -755,7 +735,6 @@ var Mic = {
|
|
|
755
735
|
"click": this.handleClick
|
|
756
736
|
}
|
|
757
737
|
});
|
|
758
|
-
|
|
759
738
|
default:
|
|
760
739
|
return h(MicSvg, {
|
|
761
740
|
"attrs": {
|
|
@@ -775,10 +754,8 @@ var Mic = {
|
|
|
775
754
|
},
|
|
776
755
|
created: function created() {
|
|
777
756
|
this.results = [];
|
|
778
|
-
|
|
779
757
|
if (typeof window !== 'undefined') {
|
|
780
758
|
window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
|
|
781
|
-
|
|
782
759
|
if (!window.SpeechRecognition) {
|
|
783
760
|
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.');
|
|
784
761
|
}
|
|
@@ -786,11 +763,9 @@ var Mic = {
|
|
|
786
763
|
},
|
|
787
764
|
render: function render() {
|
|
788
765
|
var h = arguments[0];
|
|
789
|
-
|
|
790
766
|
if (this.hasCustomRenderer) {
|
|
791
767
|
return this.getComponent();
|
|
792
768
|
}
|
|
793
|
-
|
|
794
769
|
return h(IconWrapper, [this.Icon]);
|
|
795
770
|
}
|
|
796
771
|
};
|
|
@@ -809,13 +784,11 @@ var CustomSvg = {
|
|
|
809
784
|
},
|
|
810
785
|
render: function render() {
|
|
811
786
|
var h = arguments[0];
|
|
812
|
-
|
|
813
787
|
if (this.customIcon) {
|
|
814
788
|
return h("div", {
|
|
815
789
|
"class": this.$props.className
|
|
816
790
|
}, [this.customIcon]);
|
|
817
791
|
}
|
|
818
|
-
|
|
819
792
|
if (this.$props.type === 'recent-search-icon') {
|
|
820
793
|
return h("svg", {
|
|
821
794
|
"attrs": {
|
|
@@ -840,7 +813,6 @@ var CustomSvg = {
|
|
|
840
813
|
}
|
|
841
814
|
})]);
|
|
842
815
|
}
|
|
843
|
-
|
|
844
816
|
if (this.$props.type === 'promoted-search-icon') {
|
|
845
817
|
return h("svg", {
|
|
846
818
|
"attrs": {
|
|
@@ -860,7 +832,6 @@ var CustomSvg = {
|
|
|
860
832
|
}
|
|
861
833
|
})]);
|
|
862
834
|
}
|
|
863
|
-
|
|
864
835
|
if (this.$props.type === 'popular-search-icon') {
|
|
865
836
|
return h("svg", {
|
|
866
837
|
"attrs": {
|
|
@@ -885,7 +856,6 @@ var CustomSvg = {
|
|
|
885
856
|
}
|
|
886
857
|
})]);
|
|
887
858
|
}
|
|
888
|
-
|
|
889
859
|
return h(SearchSvg, {
|
|
890
860
|
"attrs": {
|
|
891
861
|
"styles": {
|
|
@@ -904,26 +874,26 @@ var TagsContainer = styled('div')(_templateObject$6 || (_templateObject$6 = _tag
|
|
|
904
874
|
var TagItem = styled('span')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
|
|
905
875
|
|
|
906
876
|
var updateQuery = Actions.updateQuery,
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
877
|
+
setQueryOptions = Actions.setQueryOptions,
|
|
878
|
+
setCustomQuery = Actions.setCustomQuery,
|
|
879
|
+
setDefaultQuery = Actions.setDefaultQuery,
|
|
880
|
+
setCustomHighlightOptions = Actions.setCustomHighlightOptions,
|
|
881
|
+
recordSuggestionClick = Actions.recordSuggestionClick,
|
|
882
|
+
loadPopularSuggestions = Actions.loadPopularSuggestions,
|
|
883
|
+
getRecentSearches = Actions.getRecentSearches,
|
|
884
|
+
resetStoreForComponent = Actions.resetStoreForComponent;
|
|
915
885
|
var debounce = helper.debounce,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
886
|
+
checkValueChange = helper.checkValueChange,
|
|
887
|
+
getClassName$1 = helper.getClassName,
|
|
888
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
889
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery,
|
|
890
|
+
isEqual = helper.isEqual,
|
|
891
|
+
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
892
|
+
withClickIds = helper.withClickIds,
|
|
893
|
+
getResultStats = helper.getResultStats,
|
|
894
|
+
handleOnSuggestions = helper.handleOnSuggestions,
|
|
895
|
+
getTopSuggestions = helper.getTopSuggestions,
|
|
896
|
+
normalizeDataField = helper.normalizeDataField;
|
|
927
897
|
var DataSearch = {
|
|
928
898
|
name: 'DataSearch',
|
|
929
899
|
isTagsMode: false,
|
|
@@ -946,46 +916,36 @@ var DataSearch = {
|
|
|
946
916
|
},
|
|
947
917
|
created: function created() {
|
|
948
918
|
var _this$$props = this.$props,
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
919
|
+
enableRecentSearches = _this$$props.enableRecentSearches,
|
|
920
|
+
distinctField = _this$$props.distinctField,
|
|
921
|
+
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
922
|
+
index = _this$$props.index,
|
|
923
|
+
mode = _this$$props.mode;
|
|
955
924
|
if (mode === SEARCH_COMPONENTS_MODES.TAG) {
|
|
956
925
|
this.$options.isTagsMode = true;
|
|
957
926
|
}
|
|
958
|
-
|
|
959
927
|
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
960
928
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
961
929
|
}
|
|
962
|
-
|
|
963
930
|
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
964
931
|
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
965
932
|
}
|
|
966
|
-
|
|
967
933
|
if (!this.enableAppbase && index) {
|
|
968
934
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
969
935
|
}
|
|
970
|
-
|
|
971
936
|
this.currentValue = '';
|
|
972
|
-
|
|
973
937
|
if (this.$options.isTagsMode) {
|
|
974
938
|
this.currentValue = '';
|
|
975
939
|
}
|
|
976
|
-
|
|
977
940
|
var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
|
|
978
|
-
|
|
979
941
|
if (shouldFetchInitialSuggestions) {
|
|
980
942
|
this.loadPopularSuggestions(this.$props.componentId);
|
|
981
|
-
|
|
982
943
|
if (enableRecentSearches) {
|
|
983
944
|
this.getRecentSearches();
|
|
984
945
|
}
|
|
985
946
|
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
947
|
+
this.handleTextChange = debounce(this.handleText, this.$props.debounce);
|
|
948
|
+
// Set custom and default queries in store
|
|
989
949
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
990
950
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
991
951
|
this.updateDefaultQueryHandler(this.currentValue, this.$props, false);
|
|
@@ -993,36 +953,32 @@ var DataSearch = {
|
|
|
993
953
|
computed: {
|
|
994
954
|
suggestionsList: function suggestionsList() {
|
|
995
955
|
var suggestionsList = [];
|
|
996
|
-
|
|
997
956
|
if (!this.$data.currentValue && this.$props.defaultSuggestions && this.$props.defaultSuggestions.length) {
|
|
998
957
|
suggestionsList = this.$props.defaultSuggestions;
|
|
999
958
|
} else if (this.$data.currentValue) {
|
|
1000
959
|
suggestionsList = this.normalizedSuggestions;
|
|
1001
960
|
}
|
|
1002
|
-
|
|
1003
961
|
return withClickIds(suggestionsList);
|
|
1004
962
|
},
|
|
1005
963
|
topSuggestions: function topSuggestions() {
|
|
1006
964
|
if (!this.currentValue) {
|
|
1007
965
|
return [];
|
|
1008
966
|
}
|
|
1009
|
-
|
|
1010
967
|
return this.enablePopularSuggestions ? this.normalizedPopularSuggestions : [];
|
|
1011
968
|
},
|
|
1012
969
|
normalizedRecentSearches: function normalizedRecentSearches() {
|
|
1013
970
|
return this.recentSearches || [];
|
|
1014
971
|
},
|
|
1015
972
|
normalizedPopularSuggestions: function normalizedPopularSuggestions() {
|
|
1016
|
-
return getTopSuggestions(
|
|
973
|
+
return getTopSuggestions(
|
|
974
|
+
// use default popular suggestions if value is empty
|
|
1017
975
|
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue, this.showDistinctSuggestions);
|
|
1018
976
|
},
|
|
1019
977
|
defaultSearchSuggestions: function defaultSearchSuggestions() {
|
|
1020
978
|
var isPopularSuggestionsEnabled = this.enablePopularSuggestions;
|
|
1021
|
-
|
|
1022
979
|
if (this.currentValue || !this.enableDefaultSuggestions) {
|
|
1023
980
|
return [];
|
|
1024
981
|
}
|
|
1025
|
-
|
|
1026
982
|
var customDefaultPopularSuggestions = (this.defaultPopularSuggestions || []).map(function (suggestion) {
|
|
1027
983
|
return _extends({}, suggestion, {
|
|
1028
984
|
_popular_suggestion: true
|
|
@@ -1034,7 +990,8 @@ var DataSearch = {
|
|
|
1034
990
|
});
|
|
1035
991
|
});
|
|
1036
992
|
var defaultSuggestions = isPopularSuggestionsEnabled ? [].concat(customNormalizedRecentSearches, customDefaultPopularSuggestions || []) : customNormalizedRecentSearches;
|
|
1037
|
-
return getTopSuggestions(
|
|
993
|
+
return getTopSuggestions(
|
|
994
|
+
// use default popular suggestions if value is empty
|
|
1038
995
|
defaultSuggestions, this.currentValue, this.showDistinctSuggestions);
|
|
1039
996
|
},
|
|
1040
997
|
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
@@ -1125,7 +1082,6 @@ var DataSearch = {
|
|
|
1125
1082
|
if (this.customHighlight && typeof this.customHighlight === 'function') {
|
|
1126
1083
|
this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
|
|
1127
1084
|
}
|
|
1128
|
-
|
|
1129
1085
|
var queryOptions = DataSearch.highlightQuery(this.$props) || {};
|
|
1130
1086
|
this.queryOptions = _extends({}, queryOptions, this.getBasicQueryOptions());
|
|
1131
1087
|
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
@@ -1133,7 +1089,6 @@ var DataSearch = {
|
|
|
1133
1089
|
this.queryOptions = this.getBasicQueryOptions();
|
|
1134
1090
|
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
1135
1091
|
}
|
|
1136
|
-
|
|
1137
1092
|
if (this.selectedValue) {
|
|
1138
1093
|
this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
|
|
1139
1094
|
} else if (this.$props.value) {
|
|
@@ -1173,7 +1128,6 @@ var DataSearch = {
|
|
|
1173
1128
|
if (this.isPending && this.$options.isTagsMode && Array.isArray(newVal)) {
|
|
1174
1129
|
this.isPending = false;
|
|
1175
1130
|
}
|
|
1176
|
-
|
|
1177
1131
|
this.setValue(newVal, true, this.$props, undefined, false, typeof newVal !== 'string' && this.$options.isTagsMode);
|
|
1178
1132
|
}
|
|
1179
1133
|
},
|
|
@@ -1201,12 +1155,10 @@ var DataSearch = {
|
|
|
1201
1155
|
// selected value is cleared, call onValueSelected
|
|
1202
1156
|
this.onValueSelectedHandler('', causes.CLEAR_VALUE);
|
|
1203
1157
|
}
|
|
1204
|
-
|
|
1205
1158
|
if (this.$options.isTagsMode) {
|
|
1206
1159
|
// handling reset of tags through SelectedFilters or URL
|
|
1207
1160
|
this.selectedTags = [];
|
|
1208
1161
|
}
|
|
1209
|
-
|
|
1210
1162
|
this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
|
|
1211
1163
|
}
|
|
1212
1164
|
},
|
|
@@ -1228,18 +1180,15 @@ var DataSearch = {
|
|
|
1228
1180
|
var props = this.$props;
|
|
1229
1181
|
var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
|
|
1230
1182
|
var propValue = props[propName];
|
|
1231
|
-
|
|
1232
1183
|
if (!this.enableAppbase) {
|
|
1233
1184
|
if (!propValue) {
|
|
1234
1185
|
console.error(requiredError);
|
|
1235
1186
|
return;
|
|
1236
1187
|
}
|
|
1237
|
-
|
|
1238
1188
|
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
1239
1189
|
console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
|
|
1240
1190
|
return;
|
|
1241
1191
|
}
|
|
1242
|
-
|
|
1243
1192
|
if (Array.isArray(propValue) && propValue.length === 0) {
|
|
1244
1193
|
console.error(requiredError);
|
|
1245
1194
|
}
|
|
@@ -1249,7 +1198,6 @@ var DataSearch = {
|
|
|
1249
1198
|
if (this.customHighlight && typeof this.customHighlight === 'function') {
|
|
1250
1199
|
this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
|
|
1251
1200
|
}
|
|
1252
|
-
|
|
1253
1201
|
var queryOptions = DataSearch.highlightQuery(this.$props) || {};
|
|
1254
1202
|
this.queryOptions = _extends({}, queryOptions, this.getBasicQueryOptions());
|
|
1255
1203
|
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
@@ -1258,11 +1206,9 @@ var DataSearch = {
|
|
|
1258
1206
|
if (downshiftProps === void 0) {
|
|
1259
1207
|
downshiftProps = {};
|
|
1260
1208
|
}
|
|
1261
|
-
|
|
1262
1209
|
if (isQuerySuggestionsRender === void 0) {
|
|
1263
1210
|
isQuerySuggestionsRender = false;
|
|
1264
1211
|
}
|
|
1265
|
-
|
|
1266
1212
|
var currentValue = this.$data.currentValue;
|
|
1267
1213
|
var data = {
|
|
1268
1214
|
error: this.error,
|
|
@@ -1279,7 +1225,6 @@ var DataSearch = {
|
|
|
1279
1225
|
querySuggestions: this.normalizedPopularSuggestions,
|
|
1280
1226
|
popularSuggestions: this.normalizedPopularSuggestions
|
|
1281
1227
|
};
|
|
1282
|
-
|
|
1283
1228
|
if (isQuerySuggestionsRender) {
|
|
1284
1229
|
return getQuerySuggestionsComponent({
|
|
1285
1230
|
downshiftProps: downshiftProps,
|
|
@@ -1289,21 +1234,18 @@ var DataSearch = {
|
|
|
1289
1234
|
error: this.error
|
|
1290
1235
|
}, this);
|
|
1291
1236
|
}
|
|
1292
|
-
|
|
1293
1237
|
return getComponent(data, this);
|
|
1294
1238
|
},
|
|
1295
1239
|
// returns size and aggs property
|
|
1296
1240
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
1297
1241
|
var aggregationField = this.$props.aggregationField;
|
|
1298
1242
|
var queryOptions = getQueryOptions(this.$props);
|
|
1299
|
-
|
|
1300
1243
|
if (aggregationField) {
|
|
1301
1244
|
queryOptions.aggs = getCompositeAggsQuery({
|
|
1302
1245
|
props: this.$props,
|
|
1303
1246
|
showTopHits: true
|
|
1304
1247
|
}).aggs;
|
|
1305
1248
|
}
|
|
1306
|
-
|
|
1307
1249
|
return queryOptions;
|
|
1308
1250
|
},
|
|
1309
1251
|
onSuggestions: function onSuggestions(results) {
|
|
@@ -1311,7 +1253,6 @@ var DataSearch = {
|
|
|
1311
1253
|
},
|
|
1312
1254
|
handleSearchIconClick: function handleSearchIconClick() {
|
|
1313
1255
|
var currentValue = this.currentValue;
|
|
1314
|
-
|
|
1315
1256
|
if (currentValue.trim()) {
|
|
1316
1257
|
this.isPending = false;
|
|
1317
1258
|
this.setValue(currentValue, true);
|
|
@@ -1320,35 +1261,28 @@ var DataSearch = {
|
|
|
1320
1261
|
},
|
|
1321
1262
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, isTagsMode) {
|
|
1322
1263
|
var _this = this;
|
|
1323
|
-
|
|
1324
1264
|
if (isDefaultValue === void 0) {
|
|
1325
1265
|
isDefaultValue = false;
|
|
1326
1266
|
}
|
|
1327
|
-
|
|
1328
1267
|
if (props === void 0) {
|
|
1329
1268
|
props = this.$props;
|
|
1330
1269
|
}
|
|
1331
|
-
|
|
1332
1270
|
if (toggleIsOpen === void 0) {
|
|
1333
1271
|
toggleIsOpen = true;
|
|
1334
1272
|
}
|
|
1335
|
-
|
|
1336
1273
|
if (isTagsMode === void 0) {
|
|
1337
1274
|
isTagsMode = this.$options.isTagsMode;
|
|
1338
1275
|
}
|
|
1339
|
-
|
|
1340
1276
|
var performUpdate = function performUpdate() {
|
|
1341
1277
|
if (isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
1342
1278
|
return;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
|
|
1279
|
+
}
|
|
1280
|
+
// Refresh recent searches when value becomes empty
|
|
1346
1281
|
if (!value && props.enableDefaultSuggestions === false) {
|
|
1347
1282
|
_this.resetStoreForComponent(props.componentId);
|
|
1348
1283
|
} else if (!value && _this.currentValue && _this.enableRecentSearches) {
|
|
1349
1284
|
_this.getRecentSearches();
|
|
1350
1285
|
}
|
|
1351
|
-
|
|
1352
1286
|
if (isTagsMode) {
|
|
1353
1287
|
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
1354
1288
|
// check if value already present in selectedTags
|
|
@@ -1356,9 +1290,7 @@ var DataSearch = {
|
|
|
1356
1290
|
_this.isOpen = false;
|
|
1357
1291
|
return;
|
|
1358
1292
|
}
|
|
1359
|
-
|
|
1360
1293
|
_this.selectedTags = [].concat(_this.selectedTags);
|
|
1361
|
-
|
|
1362
1294
|
if (typeof value === 'string' && !!value) {
|
|
1363
1295
|
_this.selectedTags.push(value);
|
|
1364
1296
|
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
@@ -1367,29 +1299,23 @@ var DataSearch = {
|
|
|
1367
1299
|
} else if (value) {
|
|
1368
1300
|
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1369
1301
|
}
|
|
1370
|
-
|
|
1371
1302
|
_this.currentValue = '';
|
|
1372
1303
|
} else {
|
|
1373
1304
|
_this.currentValue = value;
|
|
1374
1305
|
}
|
|
1375
|
-
|
|
1376
1306
|
var queryHandlerValue = value;
|
|
1377
|
-
|
|
1378
1307
|
if (isTagsMode) {
|
|
1379
1308
|
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
1380
1309
|
}
|
|
1381
|
-
|
|
1382
1310
|
if (isDefaultValue) {
|
|
1383
1311
|
if (_this.$props.autosuggest) {
|
|
1384
1312
|
if (toggleIsOpen) {
|
|
1385
1313
|
_this.isOpen = false;
|
|
1386
1314
|
}
|
|
1387
|
-
|
|
1388
1315
|
if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
|
|
1389
1316
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1390
1317
|
// to set the query otherwise the value should reset
|
|
1391
1318
|
|
|
1392
|
-
|
|
1393
1319
|
if (props.strictSelection) {
|
|
1394
1320
|
if (cause === causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
|
|
1395
1321
|
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
@@ -1403,24 +1329,20 @@ var DataSearch = {
|
|
|
1403
1329
|
// debounce for handling text while typing
|
|
1404
1330
|
_this.handleTextChange(value);
|
|
1405
1331
|
}
|
|
1406
|
-
|
|
1407
1332
|
_this.$emit('valueChange', value);
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1333
|
+
_this.$emit('value-change', value);
|
|
1334
|
+
// Set the already fetched suggestions if query is same as used last to fetch the hits
|
|
1412
1335
|
if (value === _this.lastUsedQuery) {
|
|
1413
|
-
_this.suggestions = _this.onSuggestions(_this.suggestions);
|
|
1414
|
-
|
|
1336
|
+
_this.suggestions = _this.onSuggestions(_this.suggestions);
|
|
1337
|
+
// invoke on suggestions
|
|
1415
1338
|
_this.$emit('suggestions', _this.suggestions);
|
|
1416
1339
|
} else if (!value) {
|
|
1417
1340
|
// reset suggestions
|
|
1418
|
-
_this.suggestions = [];
|
|
1419
|
-
|
|
1341
|
+
_this.suggestions = [];
|
|
1342
|
+
// invoke on suggestions
|
|
1420
1343
|
_this.$emit('suggestions', _this.suggestions);
|
|
1421
1344
|
}
|
|
1422
1345
|
};
|
|
1423
|
-
|
|
1424
1346
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1425
1347
|
},
|
|
1426
1348
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
|
|
@@ -1429,23 +1351,18 @@ var DataSearch = {
|
|
|
1429
1351
|
this.resetStoreForComponent(props.componentId);
|
|
1430
1352
|
return;
|
|
1431
1353
|
}
|
|
1432
|
-
|
|
1433
1354
|
var defaultQueryOptions;
|
|
1434
1355
|
var query = DataSearch.defaultQuery(value, props);
|
|
1435
|
-
|
|
1436
1356
|
if (this.defaultQuery) {
|
|
1437
1357
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
1438
1358
|
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
1439
|
-
|
|
1440
1359
|
if (defaultQueryObj) {
|
|
1441
1360
|
query = defaultQueryObj;
|
|
1442
1361
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1362
|
+
defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
1363
|
+
// Update calculated default query in store
|
|
1446
1364
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
1447
1365
|
}
|
|
1448
|
-
|
|
1449
1366
|
this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), execute);
|
|
1450
1367
|
this.updateQuery({
|
|
1451
1368
|
componentId: this.internalComponent,
|
|
@@ -1456,26 +1373,22 @@ var DataSearch = {
|
|
|
1456
1373
|
},
|
|
1457
1374
|
updateQueryHandler: function updateQueryHandler(componentId, value, props) {
|
|
1458
1375
|
var customQuery = props.customQuery,
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1376
|
+
filterLabel = props.filterLabel,
|
|
1377
|
+
showFilter = props.showFilter,
|
|
1378
|
+
URLParams = props.URLParams;
|
|
1462
1379
|
var customQueryOptions;
|
|
1463
1380
|
var defaultQueryTobeSet = DataSearch.defaultQuery(value, props);
|
|
1464
1381
|
var query = defaultQueryTobeSet;
|
|
1465
|
-
|
|
1466
1382
|
if (customQuery) {
|
|
1467
1383
|
var customQueryTobeSet = customQuery(value, props);
|
|
1468
1384
|
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
1469
|
-
|
|
1470
1385
|
if (queryTobeSet) {
|
|
1471
1386
|
query = queryTobeSet;
|
|
1472
1387
|
}
|
|
1473
|
-
|
|
1474
1388
|
customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
1475
1389
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
1476
1390
|
this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions), false);
|
|
1477
1391
|
}
|
|
1478
|
-
|
|
1479
1392
|
if (!this.isPending) {
|
|
1480
1393
|
this.updateQuery({
|
|
1481
1394
|
componentId: componentId,
|
|
@@ -1495,7 +1408,6 @@ var DataSearch = {
|
|
|
1495
1408
|
},
|
|
1496
1409
|
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
1497
1410
|
var results = _ref.results;
|
|
1498
|
-
|
|
1499
1411
|
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
1500
1412
|
this.isPending = false;
|
|
1501
1413
|
this.setValue(results[0][0].transcript.trim(), true);
|
|
@@ -1503,11 +1415,9 @@ var DataSearch = {
|
|
|
1503
1415
|
},
|
|
1504
1416
|
triggerQuery: function triggerQuery(_temp) {
|
|
1505
1417
|
var _ref2 = _temp === void 0 ? false : _temp,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1418
|
+
_ref2$isOpen = _ref2.isOpen,
|
|
1419
|
+
isOpen = _ref2$isOpen === void 0 ? false : _ref2$isOpen;
|
|
1509
1420
|
var value = this.$props.value;
|
|
1510
|
-
|
|
1511
1421
|
if (value !== undefined) {
|
|
1512
1422
|
this.isPending = false;
|
|
1513
1423
|
this.setValue(this.$props.value, !isOpen);
|
|
@@ -1516,17 +1426,14 @@ var DataSearch = {
|
|
|
1516
1426
|
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
1517
1427
|
// click analytics would only work client side and after javascript loads
|
|
1518
1428
|
var docId = documentId;
|
|
1519
|
-
|
|
1520
1429
|
if (!docId) {
|
|
1521
1430
|
var hitData = this.suggestionsList.find(function (hit) {
|
|
1522
1431
|
return hit._click_id === searchPosition;
|
|
1523
1432
|
});
|
|
1524
|
-
|
|
1525
1433
|
if (hitData && hitData.source && hitData.source._id) {
|
|
1526
1434
|
docId = hitData.source._id;
|
|
1527
1435
|
}
|
|
1528
1436
|
}
|
|
1529
|
-
|
|
1530
1437
|
this.recordSuggestionClick(searchPosition, docId);
|
|
1531
1438
|
},
|
|
1532
1439
|
clearValue: function clearValue() {
|
|
@@ -1536,53 +1443,44 @@ var DataSearch = {
|
|
|
1536
1443
|
},
|
|
1537
1444
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1538
1445
|
var value = this.$props.value;
|
|
1539
|
-
|
|
1540
1446
|
if (value !== undefined) {
|
|
1541
1447
|
this.isPending = true;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1448
|
+
}
|
|
1544
1449
|
|
|
1450
|
+
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
1545
1451
|
if (event.key === 'Enter' && highlightedIndex === null) {
|
|
1546
1452
|
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined // to handle tags
|
|
1547
1453
|
);
|
|
1548
|
-
this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
|
|
1549
|
-
} // Need to review
|
|
1550
|
-
|
|
1551
1454
|
|
|
1455
|
+
this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
|
|
1456
|
+
}
|
|
1457
|
+
// Need to review
|
|
1552
1458
|
this.$emit('keyDown', event, this.triggerQuery);
|
|
1553
1459
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1554
1460
|
},
|
|
1555
1461
|
onInputChange: function onInputChange(e) {
|
|
1556
1462
|
var _this2 = this;
|
|
1557
|
-
|
|
1558
1463
|
var inputValue = e.target.value;
|
|
1559
|
-
|
|
1560
1464
|
if (!this.$data.isOpen) {
|
|
1561
1465
|
this.isOpen = true;
|
|
1562
1466
|
}
|
|
1563
|
-
|
|
1564
1467
|
var _this$$props2 = this.$props,
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1468
|
+
value = _this$$props2.value,
|
|
1469
|
+
autosuggest = _this$$props2.autosuggest;
|
|
1568
1470
|
if (value === undefined) {
|
|
1569
1471
|
this.setValue(inputValue, false, this.$props, undefined, true, false);
|
|
1570
1472
|
} else {
|
|
1571
1473
|
this.isPending = true;
|
|
1572
1474
|
this.$emit('change', inputValue, function (_temp2) {
|
|
1573
1475
|
var _ref3 = _temp2 === void 0 ? {} : _temp2,
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1476
|
+
_ref3$isOpen = _ref3.isOpen,
|
|
1477
|
+
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen;
|
|
1577
1478
|
if (_this2.$options.isTagsMode && autosuggest) {
|
|
1578
1479
|
_this2.currentValue = value;
|
|
1579
1480
|
_this2.isOpen = isOpen;
|
|
1580
|
-
|
|
1581
1481
|
_this2.updateDefaultQueryHandler(_this2.currentValue, _this2.$props);
|
|
1582
|
-
|
|
1583
1482
|
return;
|
|
1584
1483
|
}
|
|
1585
|
-
|
|
1586
1484
|
_this2.triggerQuery({
|
|
1587
1485
|
isOpen: isOpen
|
|
1588
1486
|
});
|
|
@@ -1590,28 +1488,24 @@ var DataSearch = {
|
|
|
1590
1488
|
}
|
|
1591
1489
|
},
|
|
1592
1490
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1593
|
-
var value = this.$props.value;
|
|
1594
|
-
|
|
1491
|
+
var value = this.$props.value;
|
|
1492
|
+
// Record analytics for selected suggestions
|
|
1595
1493
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
1596
|
-
|
|
1597
1494
|
if (value === undefined) {
|
|
1598
1495
|
this.setValue(suggestion.value, true, this.$props, causes.SUGGESTION_SELECT);
|
|
1599
1496
|
} else if (this.$options.isTagsMode) {
|
|
1600
1497
|
var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
1601
|
-
|
|
1602
1498
|
if (this.selectedTags.includes(suggestion.value)) {
|
|
1603
1499
|
// avoid duplicates in tags array
|
|
1604
1500
|
this.isOpen = false;
|
|
1605
1501
|
return;
|
|
1606
1502
|
}
|
|
1607
|
-
|
|
1608
1503
|
emitValue.push(suggestion.value);
|
|
1609
1504
|
this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, true);
|
|
1610
1505
|
this.$emit('change', emitValue, this.triggerQuery);
|
|
1611
1506
|
} else {
|
|
1612
1507
|
this.$emit('change', suggestion.value, this.triggerQuery);
|
|
1613
1508
|
}
|
|
1614
|
-
|
|
1615
1509
|
this.isPending = false;
|
|
1616
1510
|
this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT, suggestion.source);
|
|
1617
1511
|
},
|
|
@@ -1619,11 +1513,9 @@ var DataSearch = {
|
|
|
1619
1513
|
if (currentValue === void 0) {
|
|
1620
1514
|
currentValue = this.$data.currentValue;
|
|
1621
1515
|
}
|
|
1622
|
-
|
|
1623
1516
|
for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1624
1517
|
cause[_key - 1] = arguments[_key];
|
|
1625
1518
|
}
|
|
1626
|
-
|
|
1627
1519
|
this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
|
|
1628
1520
|
this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
|
|
1629
1521
|
},
|
|
@@ -1633,26 +1525,21 @@ var DataSearch = {
|
|
|
1633
1525
|
},
|
|
1634
1526
|
getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
|
|
1635
1527
|
var isDark = this.themePreset === 'dark';
|
|
1636
|
-
|
|
1637
1528
|
if (isDark) {
|
|
1638
1529
|
return highlightedIndex === index ? '#555' : '#424242';
|
|
1639
1530
|
}
|
|
1640
|
-
|
|
1641
1531
|
return highlightedIndex === index ? '#eee' : '#fff';
|
|
1642
1532
|
},
|
|
1643
1533
|
renderIcon: function renderIcon() {
|
|
1644
1534
|
var h = this.$createElement;
|
|
1645
|
-
|
|
1646
1535
|
if (this.$props.showIcon) {
|
|
1647
1536
|
return this.$props.icon || h(SearchSvg);
|
|
1648
1537
|
}
|
|
1649
|
-
|
|
1650
1538
|
return null;
|
|
1651
1539
|
},
|
|
1652
1540
|
renderErrorComponent: function renderErrorComponent() {
|
|
1653
1541
|
var h = this.$createElement;
|
|
1654
1542
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
1655
|
-
|
|
1656
1543
|
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
1657
1544
|
return h(SuggestionWrapper, {
|
|
1658
1545
|
"attrs": {
|
|
@@ -1663,33 +1550,28 @@ var DataSearch = {
|
|
|
1663
1550
|
}
|
|
1664
1551
|
}, [isFunction(renderError) ? renderError(this.error) : renderError]);
|
|
1665
1552
|
}
|
|
1666
|
-
|
|
1667
1553
|
return null;
|
|
1668
1554
|
},
|
|
1669
1555
|
renderCancelIcon: function renderCancelIcon() {
|
|
1670
1556
|
var h = this.$createElement;
|
|
1671
|
-
|
|
1672
1557
|
if (this.$props.showClear) {
|
|
1673
1558
|
return this.$props.clearIcon || h(CancelSvg);
|
|
1674
1559
|
}
|
|
1675
|
-
|
|
1676
1560
|
return null;
|
|
1677
1561
|
},
|
|
1678
1562
|
renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
|
|
1679
1563
|
if (finalSuggestionsList === void 0) {
|
|
1680
1564
|
finalSuggestionsList = [];
|
|
1681
1565
|
}
|
|
1682
|
-
|
|
1683
1566
|
var h = this.$createElement;
|
|
1684
1567
|
var _this$$props3 = this.$props,
|
|
1685
|
-
|
|
1686
|
-
|
|
1568
|
+
theme = _this$$props3.theme,
|
|
1569
|
+
innerClass = _this$$props3.innerClass;
|
|
1687
1570
|
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
1688
1571
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
1689
1572
|
var _this$$data = this.$data,
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1573
|
+
isOpen = _this$$data.isOpen,
|
|
1574
|
+
currentValue = _this$$data.currentValue;
|
|
1693
1575
|
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
1694
1576
|
return h(SuggestionWrapper, {
|
|
1695
1577
|
"attrs": {
|
|
@@ -1705,22 +1587,18 @@ var DataSearch = {
|
|
|
1705
1587
|
}
|
|
1706
1588
|
});
|
|
1707
1589
|
}
|
|
1708
|
-
|
|
1709
1590
|
return null;
|
|
1710
1591
|
},
|
|
1711
1592
|
renderInputAddonBefore: function renderInputAddonBefore() {
|
|
1712
1593
|
var h = this.$createElement;
|
|
1713
1594
|
var addonBefore = this.$scopedSlots.addonBefore;
|
|
1714
|
-
|
|
1715
1595
|
if (addonBefore) {
|
|
1716
1596
|
return h(InputAddon, [addonBefore()]);
|
|
1717
1597
|
}
|
|
1718
|
-
|
|
1719
1598
|
return null;
|
|
1720
1599
|
},
|
|
1721
1600
|
renderTag: function renderTag(item) {
|
|
1722
1601
|
var _this3 = this;
|
|
1723
|
-
|
|
1724
1602
|
var h = this.$createElement;
|
|
1725
1603
|
var innerClass = this.$props.innerClass;
|
|
1726
1604
|
return h(TagItem, {
|
|
@@ -1741,7 +1619,6 @@ var DataSearch = {
|
|
|
1741
1619
|
clearAllTags: function clearAllTags() {
|
|
1742
1620
|
this.selectedTags = [];
|
|
1743
1621
|
this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
|
|
1744
|
-
|
|
1745
1622
|
if (this.$props.value !== undefined) {
|
|
1746
1623
|
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1747
1624
|
}
|
|
@@ -1751,20 +1628,16 @@ var DataSearch = {
|
|
|
1751
1628
|
return tag !== tagValue;
|
|
1752
1629
|
}));
|
|
1753
1630
|
this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
|
|
1754
|
-
|
|
1755
1631
|
if (this.$props.value !== undefined) {
|
|
1756
1632
|
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1757
1633
|
}
|
|
1758
1634
|
},
|
|
1759
1635
|
renderTags: function renderTags() {
|
|
1760
1636
|
var _this4 = this;
|
|
1761
|
-
|
|
1762
1637
|
var h = this.$createElement;
|
|
1763
|
-
|
|
1764
1638
|
if (!Array.isArray(this.selectedTags)) {
|
|
1765
1639
|
return null;
|
|
1766
1640
|
}
|
|
1767
|
-
|
|
1768
1641
|
var tagsList = [].concat(this.selectedTags);
|
|
1769
1642
|
var shouldRenderClearAllTag = tagsList.length > 1;
|
|
1770
1643
|
var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
|
|
@@ -1790,22 +1663,20 @@ var DataSearch = {
|
|
|
1790
1663
|
renderInputAddonAfter: function renderInputAddonAfter() {
|
|
1791
1664
|
var h = this.$createElement;
|
|
1792
1665
|
var addonAfter = this.$scopedSlots.addonAfter;
|
|
1793
|
-
|
|
1794
1666
|
if (addonAfter) {
|
|
1795
1667
|
return h(InputAddon, [addonAfter()]);
|
|
1796
1668
|
}
|
|
1797
|
-
|
|
1798
1669
|
return null;
|
|
1799
1670
|
},
|
|
1800
1671
|
renderIcons: function renderIcons() {
|
|
1801
1672
|
var h = this.$createElement;
|
|
1802
1673
|
var _this$$props4 = this.$props,
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1674
|
+
iconPosition = _this$$props4.iconPosition,
|
|
1675
|
+
showClear = _this$$props4.showClear,
|
|
1676
|
+
innerClass = _this$$props4.innerClass,
|
|
1677
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
1678
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
1679
|
+
showIcon = _this$$props4.showIcon;
|
|
1809
1680
|
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
1810
1681
|
var currentValue = this.$data.currentValue;
|
|
1811
1682
|
return h("div", [h(IconGroup, {
|
|
@@ -1845,49 +1716,41 @@ var DataSearch = {
|
|
|
1845
1716
|
},
|
|
1846
1717
|
focusSearchBox: function focusSearchBox(event) {
|
|
1847
1718
|
var _this$$refs, _this$$refs$this$$pro;
|
|
1848
|
-
|
|
1849
1719
|
var elt = event.target || event.srcElement;
|
|
1850
1720
|
var tagName = elt.tagName;
|
|
1851
|
-
|
|
1852
1721
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1853
1722
|
// already in an input
|
|
1854
1723
|
return;
|
|
1855
1724
|
}
|
|
1856
|
-
|
|
1857
1725
|
(_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
|
|
1858
1726
|
},
|
|
1859
1727
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1860
1728
|
var _this5 = this;
|
|
1861
|
-
|
|
1862
1729
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1863
|
-
|
|
1864
|
-
|
|
1730
|
+
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1865
1731
|
if (isEmpty(focusShortcuts)) {
|
|
1866
1732
|
return;
|
|
1867
1733
|
}
|
|
1734
|
+
var shortcutsString = parseFocusShortcuts(focusShortcuts).join(',');
|
|
1868
1735
|
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1736
|
+
// handler for alphabets and other key combinations
|
|
1737
|
+
hotkeys(shortcutsString,
|
|
1738
|
+
// eslint-disable-next-line no-unused-vars
|
|
1873
1739
|
/* eslint-disable no-shadow */
|
|
1874
1740
|
function (event, handler) {
|
|
1875
1741
|
// Prevent the default refresh event under WINDOWS system
|
|
1876
1742
|
event.preventDefault();
|
|
1877
|
-
|
|
1878
1743
|
_this5.focusSearchBox(event);
|
|
1879
|
-
});
|
|
1744
|
+
});
|
|
1880
1745
|
|
|
1746
|
+
// if one of modifier keys are used, they are handled below
|
|
1881
1747
|
hotkeys('*', function (event) {
|
|
1882
1748
|
var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
|
|
1883
1749
|
if (modifierKeys.length === 0) return;
|
|
1884
|
-
|
|
1885
1750
|
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
1886
1751
|
var element = modifierKeys[index];
|
|
1887
|
-
|
|
1888
1752
|
if (hotkeys[element]) {
|
|
1889
1753
|
_this5.focusSearchBox(event);
|
|
1890
|
-
|
|
1891
1754
|
break;
|
|
1892
1755
|
}
|
|
1893
1756
|
}
|
|
@@ -1896,22 +1759,19 @@ var DataSearch = {
|
|
|
1896
1759
|
},
|
|
1897
1760
|
render: function render() {
|
|
1898
1761
|
var _this6 = this;
|
|
1899
|
-
|
|
1900
1762
|
var h = arguments[0];
|
|
1901
1763
|
var _this$$props5 = this.$props,
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1764
|
+
theme = _this$$props5.theme,
|
|
1765
|
+
size = _this$$props5.size,
|
|
1766
|
+
expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer,
|
|
1767
|
+
enableDefaultSuggestions = _this$$props5.enableDefaultSuggestions;
|
|
1906
1768
|
var _this$$scopedSlots = this.$scopedSlots,
|
|
1907
|
-
|
|
1908
|
-
|
|
1769
|
+
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
1770
|
+
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
1909
1771
|
var hasSuggestions = this.currentValue ? this.suggestionsList.length || this.topSuggestions.length : this.defaultSearchSuggestions.length;
|
|
1910
|
-
|
|
1911
1772
|
if (enableDefaultSuggestions === false && !this.currentValue) {
|
|
1912
1773
|
hasSuggestions = false;
|
|
1913
1774
|
}
|
|
1914
|
-
|
|
1915
1775
|
return h(Container, {
|
|
1916
1776
|
"class": this.$props.className
|
|
1917
1777
|
}, [this.$props.title && h(Title, {
|
|
@@ -1926,13 +1786,12 @@ var DataSearch = {
|
|
|
1926
1786
|
"scopedSlots": {
|
|
1927
1787
|
"default": function _default(_ref4) {
|
|
1928
1788
|
var getInputEvents = _ref4.getInputEvents,
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1789
|
+
getInputProps = _ref4.getInputProps,
|
|
1790
|
+
getItemProps = _ref4.getItemProps,
|
|
1791
|
+
getItemEvents = _ref4.getItemEvents,
|
|
1792
|
+
isOpen = _ref4.isOpen,
|
|
1793
|
+
highlightedIndex = _ref4.highlightedIndex,
|
|
1794
|
+
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
1936
1795
|
var renderSuggestionsContainer = function renderSuggestionsContainer() {
|
|
1937
1796
|
return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
|
|
1938
1797
|
isOpen: isOpen,
|
|
@@ -2030,7 +1889,6 @@ var DataSearch = {
|
|
|
2030
1889
|
})]);
|
|
2031
1890
|
})]) : _this6.renderNoSuggestions(_this6.suggestionsList)]);
|
|
2032
1891
|
};
|
|
2033
|
-
|
|
2034
1892
|
return h("div", {
|
|
2035
1893
|
"class": suggestionsContainer
|
|
2036
1894
|
}, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
@@ -2054,7 +1912,6 @@ var DataSearch = {
|
|
|
2054
1912
|
onFocus: _this6.handleFocus,
|
|
2055
1913
|
onKeyPress: function onKeyPress(e) {
|
|
2056
1914
|
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
2057
|
-
|
|
2058
1915
|
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
2059
1916
|
},
|
|
2060
1917
|
onKeyDown: function onKeyDown(e) {
|
|
@@ -2062,7 +1919,6 @@ var DataSearch = {
|
|
|
2062
1919
|
},
|
|
2063
1920
|
onKeyUp: function onKeyUp(e) {
|
|
2064
1921
|
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
2065
|
-
|
|
2066
1922
|
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
2067
1923
|
},
|
|
2068
1924
|
onClick: function onClick() {
|
|
@@ -2092,7 +1948,6 @@ var DataSearch = {
|
|
|
2092
1948
|
},
|
|
2093
1949
|
keypress: function keypress(e) {
|
|
2094
1950
|
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
2095
|
-
|
|
2096
1951
|
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
2097
1952
|
},
|
|
2098
1953
|
input: this.onInputChange,
|
|
@@ -2101,12 +1956,10 @@ var DataSearch = {
|
|
|
2101
1956
|
},
|
|
2102
1957
|
keydown: function keydown(e) {
|
|
2103
1958
|
_this6.$emit('keyDown', e, _this6.triggerQuery);
|
|
2104
|
-
|
|
2105
1959
|
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
2106
1960
|
},
|
|
2107
1961
|
keyup: function keyup(e) {
|
|
2108
1962
|
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
2109
|
-
|
|
2110
1963
|
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
2111
1964
|
}
|
|
2112
1965
|
}),
|
|
@@ -2121,10 +1974,8 @@ var DataSearch = {
|
|
|
2121
1974
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
2122
1975
|
}
|
|
2123
1976
|
};
|
|
2124
|
-
|
|
2125
1977
|
DataSearch.defaultQuery = function (value, props) {
|
|
2126
1978
|
var finalQuery = null;
|
|
2127
|
-
|
|
2128
1979
|
if (value) {
|
|
2129
1980
|
var fields = normalizeDataField(props.dataField, props.fieldWeights);
|
|
2130
1981
|
finalQuery = {
|
|
@@ -2134,11 +1985,9 @@ DataSearch.defaultQuery = function (value, props) {
|
|
|
2134
1985
|
}
|
|
2135
1986
|
};
|
|
2136
1987
|
}
|
|
2137
|
-
|
|
2138
1988
|
if (value === '') {
|
|
2139
1989
|
finalQuery = null;
|
|
2140
1990
|
}
|
|
2141
|
-
|
|
2142
1991
|
if (finalQuery && props.nestedField) {
|
|
2143
1992
|
return {
|
|
2144
1993
|
query: {
|
|
@@ -2149,23 +1998,18 @@ DataSearch.defaultQuery = function (value, props) {
|
|
|
2149
1998
|
}
|
|
2150
1999
|
};
|
|
2151
2000
|
}
|
|
2152
|
-
|
|
2153
2001
|
return finalQuery;
|
|
2154
2002
|
};
|
|
2155
|
-
|
|
2156
2003
|
DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
2157
2004
|
var finalQuery = [];
|
|
2158
2005
|
var phrasePrefixFields = [];
|
|
2159
2006
|
var fields = dataFields.map(function (dataField) {
|
|
2160
2007
|
var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
|
|
2161
|
-
|
|
2162
2008
|
if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
|
|
2163
2009
|
phrasePrefixFields.push(queryField);
|
|
2164
2010
|
}
|
|
2165
|
-
|
|
2166
2011
|
return queryField;
|
|
2167
2012
|
});
|
|
2168
|
-
|
|
2169
2013
|
if (props.searchOperators || props.queryString) {
|
|
2170
2014
|
return {
|
|
2171
2015
|
query: value,
|
|
@@ -2173,7 +2017,6 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2173
2017
|
default_operator: props.queryFormat
|
|
2174
2018
|
};
|
|
2175
2019
|
}
|
|
2176
|
-
|
|
2177
2020
|
if (props.queryFormat === 'and') {
|
|
2178
2021
|
finalQuery.push({
|
|
2179
2022
|
multi_match: {
|
|
@@ -2191,7 +2034,6 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2191
2034
|
operator: 'and'
|
|
2192
2035
|
}
|
|
2193
2036
|
});
|
|
2194
|
-
|
|
2195
2037
|
if (phrasePrefixFields.length > 0) {
|
|
2196
2038
|
finalQuery.push({
|
|
2197
2039
|
multi_match: {
|
|
@@ -2202,10 +2044,8 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2202
2044
|
}
|
|
2203
2045
|
});
|
|
2204
2046
|
}
|
|
2205
|
-
|
|
2206
2047
|
return finalQuery;
|
|
2207
2048
|
}
|
|
2208
|
-
|
|
2209
2049
|
finalQuery.push({
|
|
2210
2050
|
multi_match: {
|
|
2211
2051
|
query: value,
|
|
@@ -2223,7 +2063,6 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2223
2063
|
operator: 'or'
|
|
2224
2064
|
}
|
|
2225
2065
|
});
|
|
2226
|
-
|
|
2227
2066
|
if (phrasePrefixFields.length > 0) {
|
|
2228
2067
|
finalQuery.push({
|
|
2229
2068
|
multi_match: {
|
|
@@ -2234,22 +2073,17 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2234
2073
|
}
|
|
2235
2074
|
});
|
|
2236
2075
|
}
|
|
2237
|
-
|
|
2238
2076
|
return finalQuery;
|
|
2239
2077
|
};
|
|
2240
|
-
|
|
2241
2078
|
DataSearch.highlightQuery = function (props) {
|
|
2242
2079
|
if (props.customHighlight) {
|
|
2243
2080
|
return props.customHighlight(props);
|
|
2244
2081
|
}
|
|
2245
|
-
|
|
2246
2082
|
if (!props.highlight) {
|
|
2247
2083
|
return null;
|
|
2248
2084
|
}
|
|
2249
|
-
|
|
2250
2085
|
var fields = {};
|
|
2251
2086
|
var highlightField = props.highlightField ? props.highlightField : props.dataField;
|
|
2252
|
-
|
|
2253
2087
|
if (typeof highlightField === 'string') {
|
|
2254
2088
|
fields[highlightField] = {};
|
|
2255
2089
|
} else if (Array.isArray(highlightField)) {
|
|
@@ -2257,7 +2091,6 @@ DataSearch.highlightQuery = function (props) {
|
|
|
2257
2091
|
fields[item] = {};
|
|
2258
2092
|
});
|
|
2259
2093
|
}
|
|
2260
|
-
|
|
2261
2094
|
return {
|
|
2262
2095
|
highlight: _extends({
|
|
2263
2096
|
pre_tags: ['<mark>'],
|
|
@@ -2268,11 +2101,9 @@ DataSearch.highlightQuery = function (props) {
|
|
|
2268
2101
|
})
|
|
2269
2102
|
};
|
|
2270
2103
|
};
|
|
2271
|
-
|
|
2272
2104
|
DataSearch.hasInternalComponent = function () {
|
|
2273
2105
|
return true;
|
|
2274
2106
|
};
|
|
2275
|
-
|
|
2276
2107
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
2277
2108
|
return {
|
|
2278
2109
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
@@ -2297,7 +2128,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
2297
2128
|
recentSearches: state.recentSearches.data
|
|
2298
2129
|
};
|
|
2299
2130
|
};
|
|
2300
|
-
|
|
2301
2131
|
var mapDispatchToProps = {
|
|
2302
2132
|
setQueryOptions: setQueryOptions,
|
|
2303
2133
|
updateQuery: updateQuery,
|
|
@@ -2313,12 +2143,10 @@ var DSConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps,
|
|
|
2313
2143
|
componentType: componentTypes.dataSearch,
|
|
2314
2144
|
internalComponent: DataSearch.hasInternalComponent()
|
|
2315
2145
|
}));
|
|
2316
|
-
|
|
2317
2146
|
DataSearch.install = function (Vue) {
|
|
2318
2147
|
Vue.component(DataSearch.name, DSConnected);
|
|
2319
|
-
};
|
|
2320
|
-
|
|
2321
|
-
|
|
2148
|
+
};
|
|
2149
|
+
// Add componentType for SSR
|
|
2322
2150
|
DataSearch.componentType = componentTypes.dataSearch;
|
|
2323
2151
|
|
|
2324
2152
|
export { CustomSvg as C, DSConnected as D, InputAddon as I, Mic as M, SearchSvg as S, TagItem as T, DataSearch as a, SuggestionWrapper as b, TagsContainer as c, InputGroup as d, SuggestionItem as e };
|