@appbaseio/reactivesearch-vue 1.33.1 → 1.33.3
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 +2888 -6530
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +7 -9
- 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-c42d8681.js → DataSearch-e4822dbf.js} +131 -299
- 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 +27 -53
- package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
- package/dist/cjs/{PreferencesConsumer-4707bd94.js → PreferencesConsumer-5d67b486.js} +8 -18
- package/dist/cjs/RangeInput.js +36 -52
- package/dist/cjs/RangeSlider.js +24 -48
- package/dist/cjs/ReactiveBase.js +66 -81
- package/dist/cjs/{ReactiveComponent-63ef70c2.js → ReactiveComponent-b8efb0cf.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 +28 -32
- 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 +21 -22
- package/dist/cjs/initReactivesearch.js +49 -120
- package/dist/cjs/install.js +21 -21
- 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-d56bf07a.js → DataSearch-5ddfba23.js} +131 -299
- 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 +27 -53
- package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
- package/dist/es/{PreferencesConsumer-4169deb1.js → PreferencesConsumer-bc097ebb.js} +8 -18
- package/dist/es/RangeInput.js +36 -52
- package/dist/es/RangeSlider.js +24 -48
- package/dist/es/ReactiveBase.js +66 -81
- package/dist/es/{ReactiveComponent-9e4721e1.js → ReactiveComponent-59107264.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 +29 -33
- 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 +21 -22
- package/dist/es/initReactivesearch.js +49 -120
- package/dist/es/install.js +21 -21
- 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 +3 -2
|
@@ -5,21 +5,21 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
5
5
|
var configureStore = require('@appbaseio/reactivecore');
|
|
6
6
|
var configureStore__default = _interopDefault(configureStore);
|
|
7
7
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
8
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
8
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
|
|
9
9
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
10
10
|
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
11
11
|
var styled = require('@appbaseio/vue-emotion');
|
|
12
12
|
var styled__default = _interopDefault(styled);
|
|
13
|
-
var vueTypes = require('./vueTypes-
|
|
14
|
-
var index = require('./index-
|
|
15
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
16
|
-
var PreferencesConsumer = require('./PreferencesConsumer-
|
|
17
|
-
var Title = require('./Title-
|
|
18
|
-
var Flex = require('./Flex-
|
|
13
|
+
var vueTypes = require('./vueTypes-7cfc2f98.js');
|
|
14
|
+
var index = require('./index-30126fd0.js');
|
|
15
|
+
var ComponentWrapper = require('./ComponentWrapper-9318cece.js');
|
|
16
|
+
var PreferencesConsumer = require('./PreferencesConsumer-5d67b486.js');
|
|
17
|
+
var Title = require('./Title-16042ea0.js');
|
|
18
|
+
var Flex = require('./Flex-ddd7cb6b.js');
|
|
19
19
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
20
|
-
var CancelSvg = require('./CancelSvg-
|
|
21
|
-
var Input = require('./Input-
|
|
22
|
-
var Container = require('./Container-
|
|
20
|
+
var CancelSvg = require('./CancelSvg-220a7cc3.js');
|
|
21
|
+
var Input = require('./Input-ead4cd84.js');
|
|
22
|
+
var Container = require('./Container-e699ea95.js');
|
|
23
23
|
var Highlight = _interopDefault(require('vue-highlight-words'));
|
|
24
24
|
|
|
25
25
|
var _templateObject;
|
|
@@ -45,9 +45,9 @@ var SuggestionWrapper = {
|
|
|
45
45
|
render: function render() {
|
|
46
46
|
var h = arguments[0];
|
|
47
47
|
var _this$$props = this.$props,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
themePreset = _this$$props.themePreset,
|
|
49
|
+
innerClass = _this$$props.innerClass,
|
|
50
|
+
innerClassName = _this$$props.innerClassName;
|
|
51
51
|
return h("div", {
|
|
52
52
|
"class": Input.noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
|
|
53
53
|
}, [h("li", [this.$scopedSlots["default"]()])]);
|
|
@@ -71,20 +71,20 @@ var SuggestionItem = {
|
|
|
71
71
|
render: function render() {
|
|
72
72
|
var h = arguments[0];
|
|
73
73
|
var _this$suggestion = this.suggestion,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
label = _this$suggestion.label,
|
|
75
|
+
value = _this$suggestion.value,
|
|
76
|
+
title = _this$suggestion.title,
|
|
77
|
+
description = _this$suggestion.description,
|
|
78
|
+
image = _this$suggestion.image,
|
|
79
|
+
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
|
|
80
|
+
_suggestion_type = _this$suggestion._suggestion_type,
|
|
81
|
+
_category = _this$suggestion._category;
|
|
83
82
|
if (label) {
|
|
84
83
|
// label has highest precedence
|
|
85
84
|
return typeof label === 'string' ? h("div", {
|
|
86
85
|
"class": "trim"
|
|
87
|
-
}, [(_category ? false : isPredictiveSuggestion
|
|
86
|
+
}, [(_category ? false : isPredictiveSuggestion
|
|
87
|
+
// eslint-disable-next-line
|
|
88
88
|
|| !!_suggestion_type) ? h(PredictiveSuggestion, {
|
|
89
89
|
"domProps": {
|
|
90
90
|
"innerHTML": label
|
|
@@ -98,7 +98,6 @@ var SuggestionItem = {
|
|
|
98
98
|
}
|
|
99
99
|
})]) : label;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
101
|
if (title || image || description) {
|
|
103
102
|
return h(Flex.Flex, {
|
|
104
103
|
"attrs": {
|
|
@@ -154,7 +153,6 @@ var SuggestionItem = {
|
|
|
154
153
|
}
|
|
155
154
|
})])])]);
|
|
156
155
|
}
|
|
157
|
-
|
|
158
156
|
return value;
|
|
159
157
|
}
|
|
160
158
|
};
|
|
@@ -186,6 +184,7 @@ var SearchSvg = {
|
|
|
186
184
|
|
|
187
185
|
var _templateObject$3;
|
|
188
186
|
|
|
187
|
+
// eslint-disable-next-line
|
|
189
188
|
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"])));
|
|
190
189
|
var MicSvg = {
|
|
191
190
|
name: 'MicSvg',
|
|
@@ -233,6 +232,7 @@ var MicSvg = {
|
|
|
233
232
|
|
|
234
233
|
var _templateObject$4;
|
|
235
234
|
|
|
235
|
+
// eslint-disable-next-line
|
|
236
236
|
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"])));
|
|
237
237
|
var MuteSvg = {
|
|
238
238
|
name: 'MuteSvg',
|
|
@@ -291,6 +291,7 @@ var MuteSvg = {
|
|
|
291
291
|
|
|
292
292
|
var _templateObject$5;
|
|
293
293
|
|
|
294
|
+
// eslint-disable-next-line
|
|
294
295
|
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"])));
|
|
295
296
|
var ListenSvg = {
|
|
296
297
|
name: 'ListenSvg',
|
|
@@ -641,90 +642,71 @@ var Mic = {
|
|
|
641
642
|
},
|
|
642
643
|
handleClick: function handleClick() {
|
|
643
644
|
var _this = this;
|
|
644
|
-
|
|
645
645
|
this.results = [];
|
|
646
|
-
|
|
647
646
|
if (window && window.SpeechRecognition) {
|
|
648
647
|
var status = this.$data.status;
|
|
649
|
-
|
|
650
648
|
if (status === STATUS.active) {
|
|
651
649
|
this.status = STATUS.inactive;
|
|
652
650
|
}
|
|
653
|
-
|
|
654
651
|
var _this$$props = this.$props,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
652
|
+
handleResult = _this$$props.handleResult,
|
|
653
|
+
onNoMatch = _this$$props.onNoMatch,
|
|
654
|
+
onError = _this$$props.onError,
|
|
655
|
+
lang = _this$$props.lang,
|
|
656
|
+
getInstance = _this$$props.getInstance;
|
|
660
657
|
var _window = window,
|
|
661
|
-
|
|
662
|
-
|
|
658
|
+
SpeechRecognition = _window.SpeechRecognition;
|
|
663
659
|
if (this.instance && this.status !== STATUS.denied) {
|
|
664
660
|
this.status = STATUS.inactive;
|
|
665
661
|
this.instance.stop();
|
|
666
662
|
this.instance = null;
|
|
667
663
|
return;
|
|
668
664
|
}
|
|
669
|
-
|
|
670
665
|
this.instance = new SpeechRecognition();
|
|
671
666
|
this.instance.continuous = true;
|
|
672
667
|
this.instance.interimResults = true;
|
|
673
668
|
this.instance.lang = lang;
|
|
674
|
-
|
|
675
669
|
if (getInstance) {
|
|
676
670
|
getInstance(this.instance);
|
|
677
671
|
}
|
|
678
|
-
|
|
679
672
|
this.instance.start();
|
|
680
|
-
|
|
681
673
|
this.instance.onstart = function () {
|
|
682
674
|
_this.status = STATUS.active;
|
|
683
675
|
};
|
|
684
|
-
|
|
685
676
|
this.instance.onresult = function (_ref) {
|
|
686
677
|
var results = _ref.results,
|
|
687
|
-
|
|
688
|
-
|
|
678
|
+
timeStamp = _ref.timeStamp;
|
|
689
679
|
_this.stopMic();
|
|
690
|
-
|
|
691
680
|
if (handleResult) {
|
|
692
681
|
handleResult({
|
|
693
682
|
results: results,
|
|
694
683
|
timeStamp: timeStamp
|
|
695
684
|
});
|
|
696
685
|
}
|
|
697
|
-
|
|
698
686
|
_this.results.push({
|
|
699
687
|
results: results,
|
|
700
688
|
timeStamp: timeStamp
|
|
701
689
|
});
|
|
702
690
|
};
|
|
703
|
-
|
|
704
691
|
this.instance.onnomatch = function (e) {
|
|
705
692
|
return onNoMatch ? onNoMatch(e) : console.warn(e);
|
|
706
693
|
};
|
|
707
|
-
|
|
708
694
|
this.instance.onerror = function (e) {
|
|
709
695
|
if (e.error === 'no-speech' || e.error === 'audio-capture') {
|
|
710
696
|
_this.status = STATUS.inactive;
|
|
711
697
|
} else if (e.error === 'not-allowed') {
|
|
712
698
|
_this.status = STATUS.denied;
|
|
713
699
|
}
|
|
714
|
-
|
|
715
700
|
console.error(e);
|
|
716
|
-
|
|
717
701
|
if (onError) {
|
|
718
702
|
onError(e);
|
|
719
703
|
}
|
|
720
704
|
};
|
|
721
|
-
/* Below Two methods run when Continuous is False */
|
|
722
|
-
|
|
723
705
|
|
|
706
|
+
/* Below Two methods run when Continuous is False */
|
|
724
707
|
this.instance.onspeechend = function () {
|
|
725
708
|
_this.status = STATUS.inactive;
|
|
726
709
|
};
|
|
727
|
-
|
|
728
710
|
this.instance.onaudioend = function () {
|
|
729
711
|
_this.status = STATUS.inactive;
|
|
730
712
|
};
|
|
@@ -739,7 +721,6 @@ var Mic = {
|
|
|
739
721
|
var h = this.$createElement;
|
|
740
722
|
var status = this.$data.status;
|
|
741
723
|
var className = this.$props.className;
|
|
742
|
-
|
|
743
724
|
switch (status) {
|
|
744
725
|
case STATUS.active:
|
|
745
726
|
return h(ListenSvg, {
|
|
@@ -750,7 +731,6 @@ var Mic = {
|
|
|
750
731
|
"click": this.handleClick
|
|
751
732
|
}
|
|
752
733
|
});
|
|
753
|
-
|
|
754
734
|
case STATUS.stopped:
|
|
755
735
|
case STATUS.denied:
|
|
756
736
|
return h(MuteSvg, {
|
|
@@ -761,7 +741,6 @@ var Mic = {
|
|
|
761
741
|
"click": this.handleClick
|
|
762
742
|
}
|
|
763
743
|
});
|
|
764
|
-
|
|
765
744
|
default:
|
|
766
745
|
return h(MicSvg, {
|
|
767
746
|
"attrs": {
|
|
@@ -781,10 +760,8 @@ var Mic = {
|
|
|
781
760
|
},
|
|
782
761
|
created: function created() {
|
|
783
762
|
this.results = [];
|
|
784
|
-
|
|
785
763
|
if (typeof window !== 'undefined') {
|
|
786
764
|
window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
|
|
787
|
-
|
|
788
765
|
if (!window.SpeechRecognition) {
|
|
789
766
|
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.');
|
|
790
767
|
}
|
|
@@ -792,11 +769,9 @@ var Mic = {
|
|
|
792
769
|
},
|
|
793
770
|
render: function render() {
|
|
794
771
|
var h = arguments[0];
|
|
795
|
-
|
|
796
772
|
if (this.hasCustomRenderer) {
|
|
797
773
|
return this.getComponent();
|
|
798
774
|
}
|
|
799
|
-
|
|
800
775
|
return h(CancelSvg.IconWrapper, [this.Icon]);
|
|
801
776
|
}
|
|
802
777
|
};
|
|
@@ -815,13 +790,11 @@ var CustomSvg = {
|
|
|
815
790
|
},
|
|
816
791
|
render: function render() {
|
|
817
792
|
var h = arguments[0];
|
|
818
|
-
|
|
819
793
|
if (this.customIcon) {
|
|
820
794
|
return h("div", {
|
|
821
795
|
"class": this.$props.className
|
|
822
796
|
}, [this.customIcon]);
|
|
823
797
|
}
|
|
824
|
-
|
|
825
798
|
if (this.$props.type === 'recent-search-icon') {
|
|
826
799
|
return h("svg", {
|
|
827
800
|
"attrs": {
|
|
@@ -846,7 +819,6 @@ var CustomSvg = {
|
|
|
846
819
|
}
|
|
847
820
|
})]);
|
|
848
821
|
}
|
|
849
|
-
|
|
850
822
|
if (this.$props.type === 'promoted-search-icon') {
|
|
851
823
|
return h("svg", {
|
|
852
824
|
"attrs": {
|
|
@@ -866,7 +838,6 @@ var CustomSvg = {
|
|
|
866
838
|
}
|
|
867
839
|
})]);
|
|
868
840
|
}
|
|
869
|
-
|
|
870
841
|
if (this.$props.type === 'popular-search-icon') {
|
|
871
842
|
return h("svg", {
|
|
872
843
|
"attrs": {
|
|
@@ -891,7 +862,6 @@ var CustomSvg = {
|
|
|
891
862
|
}
|
|
892
863
|
})]);
|
|
893
864
|
}
|
|
894
|
-
|
|
895
865
|
return h(SearchSvg, {
|
|
896
866
|
"attrs": {
|
|
897
867
|
"styles": {
|
|
@@ -910,26 +880,26 @@ var TagsContainer = styled__default('div')(_templateObject$6 || (_templateObject
|
|
|
910
880
|
var TagItem = styled__default('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._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"])));
|
|
911
881
|
|
|
912
882
|
var updateQuery = configureStore.Actions.updateQuery,
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
883
|
+
setQueryOptions = configureStore.Actions.setQueryOptions,
|
|
884
|
+
setCustomQuery = configureStore.Actions.setCustomQuery,
|
|
885
|
+
setDefaultQuery = configureStore.Actions.setDefaultQuery,
|
|
886
|
+
setCustomHighlightOptions = configureStore.Actions.setCustomHighlightOptions,
|
|
887
|
+
recordSuggestionClick = configureStore.Actions.recordSuggestionClick,
|
|
888
|
+
loadPopularSuggestions = configureStore.Actions.loadPopularSuggestions,
|
|
889
|
+
getRecentSearches = configureStore.Actions.getRecentSearches,
|
|
890
|
+
resetStoreForComponent = configureStore.Actions.resetStoreForComponent;
|
|
921
891
|
var debounce = configureStore.helper.debounce,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
892
|
+
checkValueChange = configureStore.helper.checkValueChange,
|
|
893
|
+
getClassName$1 = configureStore.helper.getClassName,
|
|
894
|
+
extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
|
|
895
|
+
getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery,
|
|
896
|
+
isEqual = configureStore.helper.isEqual,
|
|
897
|
+
getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
|
|
898
|
+
withClickIds = configureStore.helper.withClickIds,
|
|
899
|
+
getResultStats = configureStore.helper.getResultStats,
|
|
900
|
+
handleOnSuggestions = configureStore.helper.handleOnSuggestions,
|
|
901
|
+
getTopSuggestions = configureStore.helper.getTopSuggestions,
|
|
902
|
+
normalizeDataField = configureStore.helper.normalizeDataField;
|
|
933
903
|
var DataSearch = {
|
|
934
904
|
name: 'DataSearch',
|
|
935
905
|
isTagsMode: false,
|
|
@@ -952,83 +922,70 @@ var DataSearch = {
|
|
|
952
922
|
},
|
|
953
923
|
created: function created() {
|
|
954
924
|
var _this$$props = this.$props,
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
925
|
+
enableRecentSearches = _this$$props.enableRecentSearches,
|
|
926
|
+
distinctField = _this$$props.distinctField,
|
|
927
|
+
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
928
|
+
index$1 = _this$$props.index,
|
|
929
|
+
mode = _this$$props.mode;
|
|
961
930
|
if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
|
|
962
931
|
this.$options.isTagsMode = true;
|
|
963
932
|
}
|
|
964
|
-
|
|
965
933
|
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
966
934
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
967
935
|
}
|
|
968
|
-
|
|
969
936
|
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
970
937
|
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
971
938
|
}
|
|
972
|
-
|
|
973
939
|
if (!this.enableAppbase && index$1) {
|
|
974
940
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
975
941
|
}
|
|
976
|
-
|
|
977
942
|
this.currentValue = '';
|
|
978
|
-
|
|
979
943
|
if (this.$options.isTagsMode) {
|
|
980
944
|
this.currentValue = '';
|
|
981
945
|
}
|
|
982
|
-
|
|
983
946
|
var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
|
|
984
|
-
|
|
985
947
|
if (shouldFetchInitialSuggestions) {
|
|
986
948
|
this.loadPopularSuggestions(this.$props.componentId);
|
|
987
|
-
|
|
988
949
|
if (enableRecentSearches) {
|
|
989
950
|
this.getRecentSearches();
|
|
990
951
|
}
|
|
991
952
|
}
|
|
992
|
-
|
|
993
|
-
this.
|
|
994
|
-
|
|
953
|
+
this.handleTextChange = debounce(this.handleText, this.$props.debounce);
|
|
954
|
+
this.updateDefaultQueryHandlerDebounced = debounce(this.updateDefaultQueryHandler, this.$props.debounce);
|
|
955
|
+
// Set custom and default queries in store
|
|
995
956
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
996
957
|
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
997
|
-
this.
|
|
958
|
+
this.updateDefaultQueryHandlerDebounced(this.currentValue, this.$props, false);
|
|
998
959
|
},
|
|
999
960
|
computed: {
|
|
1000
961
|
suggestionsList: function suggestionsList() {
|
|
1001
962
|
var suggestionsList = [];
|
|
1002
|
-
|
|
1003
963
|
if (!this.$data.currentValue && this.$props.defaultSuggestions && this.$props.defaultSuggestions.length) {
|
|
1004
964
|
suggestionsList = this.$props.defaultSuggestions;
|
|
1005
965
|
} else if (this.$data.currentValue) {
|
|
1006
966
|
suggestionsList = this.normalizedSuggestions;
|
|
1007
967
|
}
|
|
1008
|
-
|
|
1009
968
|
return withClickIds(suggestionsList);
|
|
1010
969
|
},
|
|
1011
970
|
topSuggestions: function topSuggestions() {
|
|
1012
971
|
if (!this.currentValue) {
|
|
1013
972
|
return [];
|
|
1014
973
|
}
|
|
1015
|
-
|
|
1016
974
|
return this.enablePopularSuggestions ? this.normalizedPopularSuggestions : [];
|
|
1017
975
|
},
|
|
1018
976
|
normalizedRecentSearches: function normalizedRecentSearches() {
|
|
1019
977
|
return this.recentSearches || [];
|
|
1020
978
|
},
|
|
1021
979
|
normalizedPopularSuggestions: function normalizedPopularSuggestions() {
|
|
1022
|
-
return getTopSuggestions(
|
|
980
|
+
return getTopSuggestions(
|
|
981
|
+
// use default popular suggestions if value is empty
|
|
1023
982
|
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue, this.showDistinctSuggestions);
|
|
1024
983
|
},
|
|
1025
984
|
defaultSearchSuggestions: function defaultSearchSuggestions() {
|
|
1026
985
|
var isPopularSuggestionsEnabled = this.enablePopularSuggestions;
|
|
1027
|
-
|
|
1028
986
|
if (this.currentValue || !this.enableDefaultSuggestions) {
|
|
1029
987
|
return [];
|
|
1030
988
|
}
|
|
1031
|
-
|
|
1032
989
|
var customDefaultPopularSuggestions = (this.defaultPopularSuggestions || []).map(function (suggestion) {
|
|
1033
990
|
return _rollupPluginBabelHelpers._extends({}, suggestion, {
|
|
1034
991
|
_popular_suggestion: true
|
|
@@ -1040,7 +997,8 @@ var DataSearch = {
|
|
|
1040
997
|
});
|
|
1041
998
|
});
|
|
1042
999
|
var defaultSuggestions = isPopularSuggestionsEnabled ? [].concat(customNormalizedRecentSearches, customDefaultPopularSuggestions || []) : customNormalizedRecentSearches;
|
|
1043
|
-
return getTopSuggestions(
|
|
1000
|
+
return getTopSuggestions(
|
|
1001
|
+
// use default popular suggestions if value is empty
|
|
1044
1002
|
defaultSuggestions, this.currentValue, this.showDistinctSuggestions);
|
|
1045
1003
|
},
|
|
1046
1004
|
hasCustomRenderer: function hasCustomRenderer() {
|
|
@@ -1131,7 +1089,6 @@ var DataSearch = {
|
|
|
1131
1089
|
if (this.customHighlight && typeof this.customHighlight === 'function') {
|
|
1132
1090
|
this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
|
|
1133
1091
|
}
|
|
1134
|
-
|
|
1135
1092
|
var queryOptions = DataSearch.highlightQuery(this.$props) || {};
|
|
1136
1093
|
this.queryOptions = _rollupPluginBabelHelpers._extends({}, queryOptions, this.getBasicQueryOptions());
|
|
1137
1094
|
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
@@ -1139,7 +1096,6 @@ var DataSearch = {
|
|
|
1139
1096
|
this.queryOptions = this.getBasicQueryOptions();
|
|
1140
1097
|
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
1141
1098
|
}
|
|
1142
|
-
|
|
1143
1099
|
if (this.selectedValue) {
|
|
1144
1100
|
this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
1145
1101
|
} else if (this.$props.value) {
|
|
@@ -1179,13 +1135,12 @@ var DataSearch = {
|
|
|
1179
1135
|
if (this.isPending && this.$options.isTagsMode && Array.isArray(newVal)) {
|
|
1180
1136
|
this.isPending = false;
|
|
1181
1137
|
}
|
|
1182
|
-
|
|
1183
1138
|
this.setValue(newVal, true, this.$props, undefined, false, typeof newVal !== 'string' && this.$options.isTagsMode);
|
|
1184
1139
|
}
|
|
1185
1140
|
},
|
|
1186
1141
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
1187
1142
|
if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
1188
|
-
this.
|
|
1143
|
+
this.updateDefaultQueryHandlerDebounced(this.$data.currentValue, this.$props);
|
|
1189
1144
|
}
|
|
1190
1145
|
},
|
|
1191
1146
|
customQuery: function customQuery(newVal, oldVal) {
|
|
@@ -1207,12 +1162,10 @@ var DataSearch = {
|
|
|
1207
1162
|
// selected value is cleared, call onValueSelected
|
|
1208
1163
|
this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
|
|
1209
1164
|
}
|
|
1210
|
-
|
|
1211
1165
|
if (this.$options.isTagsMode) {
|
|
1212
1166
|
// handling reset of tags through SelectedFilters or URL
|
|
1213
1167
|
this.selectedTags = [];
|
|
1214
1168
|
}
|
|
1215
|
-
|
|
1216
1169
|
this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
1217
1170
|
}
|
|
1218
1171
|
},
|
|
@@ -1223,9 +1176,9 @@ var DataSearch = {
|
|
|
1223
1176
|
methods: {
|
|
1224
1177
|
handleText: function handleText(value) {
|
|
1225
1178
|
if (this.$props.autosuggest) {
|
|
1226
|
-
this.
|
|
1179
|
+
this.updateDefaultQueryHandlerDebounced(value, this.$props);
|
|
1227
1180
|
} else {
|
|
1228
|
-
this.
|
|
1181
|
+
this.updateDefaultQueryHandlerDebounced(this.$props.componentId, value, this.$props);
|
|
1229
1182
|
}
|
|
1230
1183
|
},
|
|
1231
1184
|
validateDataField: function validateDataField() {
|
|
@@ -1234,18 +1187,15 @@ var DataSearch = {
|
|
|
1234
1187
|
var props = this.$props;
|
|
1235
1188
|
var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
|
|
1236
1189
|
var propValue = props[propName];
|
|
1237
|
-
|
|
1238
1190
|
if (!this.enableAppbase) {
|
|
1239
1191
|
if (!propValue) {
|
|
1240
1192
|
console.error(requiredError);
|
|
1241
1193
|
return;
|
|
1242
1194
|
}
|
|
1243
|
-
|
|
1244
1195
|
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
1245
1196
|
console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
|
|
1246
1197
|
return;
|
|
1247
1198
|
}
|
|
1248
|
-
|
|
1249
1199
|
if (Array.isArray(propValue) && propValue.length === 0) {
|
|
1250
1200
|
console.error(requiredError);
|
|
1251
1201
|
}
|
|
@@ -1255,7 +1205,6 @@ var DataSearch = {
|
|
|
1255
1205
|
if (this.customHighlight && typeof this.customHighlight === 'function') {
|
|
1256
1206
|
this.setCustomHighlightOptions(this.componentId, this.customHighlight(this.$props));
|
|
1257
1207
|
}
|
|
1258
|
-
|
|
1259
1208
|
var queryOptions = DataSearch.highlightQuery(this.$props) || {};
|
|
1260
1209
|
this.queryOptions = _rollupPluginBabelHelpers._extends({}, queryOptions, this.getBasicQueryOptions());
|
|
1261
1210
|
this.setQueryOptions(this.$props.componentId, this.queryOptions);
|
|
@@ -1264,11 +1213,9 @@ var DataSearch = {
|
|
|
1264
1213
|
if (downshiftProps === void 0) {
|
|
1265
1214
|
downshiftProps = {};
|
|
1266
1215
|
}
|
|
1267
|
-
|
|
1268
1216
|
if (isQuerySuggestionsRender === void 0) {
|
|
1269
1217
|
isQuerySuggestionsRender = false;
|
|
1270
1218
|
}
|
|
1271
|
-
|
|
1272
1219
|
var currentValue = this.$data.currentValue;
|
|
1273
1220
|
var data = {
|
|
1274
1221
|
error: this.error,
|
|
@@ -1285,7 +1232,6 @@ var DataSearch = {
|
|
|
1285
1232
|
querySuggestions: this.normalizedPopularSuggestions,
|
|
1286
1233
|
popularSuggestions: this.normalizedPopularSuggestions
|
|
1287
1234
|
};
|
|
1288
|
-
|
|
1289
1235
|
if (isQuerySuggestionsRender) {
|
|
1290
1236
|
return index.getQuerySuggestionsComponent({
|
|
1291
1237
|
downshiftProps: downshiftProps,
|
|
@@ -1295,21 +1241,18 @@ var DataSearch = {
|
|
|
1295
1241
|
error: this.error
|
|
1296
1242
|
}, this);
|
|
1297
1243
|
}
|
|
1298
|
-
|
|
1299
1244
|
return index.getComponent(data, this);
|
|
1300
1245
|
},
|
|
1301
1246
|
// returns size and aggs property
|
|
1302
1247
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
1303
1248
|
var aggregationField = this.$props.aggregationField;
|
|
1304
1249
|
var queryOptions = helper.getQueryOptions(this.$props);
|
|
1305
|
-
|
|
1306
1250
|
if (aggregationField) {
|
|
1307
1251
|
queryOptions.aggs = getCompositeAggsQuery({
|
|
1308
1252
|
props: this.$props,
|
|
1309
1253
|
showTopHits: true
|
|
1310
1254
|
}).aggs;
|
|
1311
1255
|
}
|
|
1312
|
-
|
|
1313
1256
|
return queryOptions;
|
|
1314
1257
|
},
|
|
1315
1258
|
onSuggestions: function onSuggestions(results) {
|
|
@@ -1317,7 +1260,6 @@ var DataSearch = {
|
|
|
1317
1260
|
},
|
|
1318
1261
|
handleSearchIconClick: function handleSearchIconClick() {
|
|
1319
1262
|
var currentValue = this.currentValue;
|
|
1320
|
-
|
|
1321
1263
|
if (currentValue.trim()) {
|
|
1322
1264
|
this.isPending = false;
|
|
1323
1265
|
this.setValue(currentValue, true);
|
|
@@ -1326,35 +1268,28 @@ var DataSearch = {
|
|
|
1326
1268
|
},
|
|
1327
1269
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, isTagsMode) {
|
|
1328
1270
|
var _this = this;
|
|
1329
|
-
|
|
1330
1271
|
if (isDefaultValue === void 0) {
|
|
1331
1272
|
isDefaultValue = false;
|
|
1332
1273
|
}
|
|
1333
|
-
|
|
1334
1274
|
if (props === void 0) {
|
|
1335
1275
|
props = this.$props;
|
|
1336
1276
|
}
|
|
1337
|
-
|
|
1338
1277
|
if (toggleIsOpen === void 0) {
|
|
1339
1278
|
toggleIsOpen = true;
|
|
1340
1279
|
}
|
|
1341
|
-
|
|
1342
1280
|
if (isTagsMode === void 0) {
|
|
1343
1281
|
isTagsMode = this.$options.isTagsMode;
|
|
1344
1282
|
}
|
|
1345
|
-
|
|
1346
1283
|
var performUpdate = function performUpdate() {
|
|
1347
1284
|
if (isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
1348
1285
|
return;
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1286
|
+
}
|
|
1287
|
+
// Refresh recent searches when value becomes empty
|
|
1352
1288
|
if (!value && props.enableDefaultSuggestions === false) {
|
|
1353
1289
|
_this.resetStoreForComponent(props.componentId);
|
|
1354
1290
|
} else if (!value && _this.currentValue && _this.enableRecentSearches) {
|
|
1355
1291
|
_this.getRecentSearches();
|
|
1356
1292
|
}
|
|
1357
|
-
|
|
1358
1293
|
if (isTagsMode) {
|
|
1359
1294
|
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
1360
1295
|
// check if value already present in selectedTags
|
|
@@ -1362,9 +1297,7 @@ var DataSearch = {
|
|
|
1362
1297
|
_this.isOpen = false;
|
|
1363
1298
|
return;
|
|
1364
1299
|
}
|
|
1365
|
-
|
|
1366
1300
|
_this.selectedTags = [].concat(_this.selectedTags);
|
|
1367
|
-
|
|
1368
1301
|
if (typeof value === 'string' && !!value) {
|
|
1369
1302
|
_this.selectedTags.push(value);
|
|
1370
1303
|
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
@@ -1373,29 +1306,23 @@ var DataSearch = {
|
|
|
1373
1306
|
} else if (value) {
|
|
1374
1307
|
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1375
1308
|
}
|
|
1376
|
-
|
|
1377
1309
|
_this.currentValue = '';
|
|
1378
1310
|
} else {
|
|
1379
1311
|
_this.currentValue = value;
|
|
1380
1312
|
}
|
|
1381
|
-
|
|
1382
1313
|
var queryHandlerValue = value;
|
|
1383
|
-
|
|
1384
1314
|
if (isTagsMode) {
|
|
1385
1315
|
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
1386
1316
|
}
|
|
1387
|
-
|
|
1388
1317
|
if (isDefaultValue) {
|
|
1389
1318
|
if (_this.$props.autosuggest) {
|
|
1390
1319
|
if (toggleIsOpen) {
|
|
1391
1320
|
_this.isOpen = false;
|
|
1392
1321
|
}
|
|
1393
|
-
|
|
1394
|
-
if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
|
|
1322
|
+
if (typeof value === 'string') _this.updateDefaultQueryHandlerDebounced(value, _this.$props);
|
|
1395
1323
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1396
1324
|
// to set the query otherwise the value should reset
|
|
1397
1325
|
|
|
1398
|
-
|
|
1399
1326
|
if (props.strictSelection) {
|
|
1400
1327
|
if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
|
|
1401
1328
|
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
@@ -1409,49 +1336,43 @@ var DataSearch = {
|
|
|
1409
1336
|
// debounce for handling text while typing
|
|
1410
1337
|
_this.handleTextChange(value);
|
|
1411
1338
|
}
|
|
1412
|
-
|
|
1413
1339
|
_this.$emit('valueChange', value);
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1340
|
+
_this.$emit('value-change', value);
|
|
1341
|
+
// Set the already fetched suggestions if query is same as used last to fetch the hits
|
|
1418
1342
|
if (value === _this.lastUsedQuery) {
|
|
1419
|
-
_this.suggestions = _this.onSuggestions(_this.suggestions);
|
|
1420
|
-
|
|
1343
|
+
_this.suggestions = _this.onSuggestions(_this.suggestions);
|
|
1344
|
+
// invoke on suggestions
|
|
1421
1345
|
_this.$emit('suggestions', _this.suggestions);
|
|
1422
1346
|
} else if (!value) {
|
|
1423
1347
|
// reset suggestions
|
|
1424
|
-
_this.suggestions = [];
|
|
1425
|
-
|
|
1348
|
+
_this.suggestions = [];
|
|
1349
|
+
// invoke on suggestions
|
|
1426
1350
|
_this.$emit('suggestions', _this.suggestions);
|
|
1427
1351
|
}
|
|
1428
1352
|
};
|
|
1429
|
-
|
|
1430
1353
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1431
1354
|
},
|
|
1432
1355
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
|
|
1356
|
+
if (props === void 0) {
|
|
1357
|
+
props = this.$props;
|
|
1358
|
+
}
|
|
1433
1359
|
if (!value && props.enableDefaultSuggestions === false) {
|
|
1434
1360
|
// clear Component data from store
|
|
1435
1361
|
this.resetStoreForComponent(props.componentId);
|
|
1436
1362
|
return;
|
|
1437
1363
|
}
|
|
1438
|
-
|
|
1439
1364
|
var defaultQueryOptions;
|
|
1440
1365
|
var query = DataSearch.defaultQuery(value, props);
|
|
1441
|
-
|
|
1442
1366
|
if (this.defaultQuery) {
|
|
1443
1367
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
1444
1368
|
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
1445
|
-
|
|
1446
1369
|
if (defaultQueryObj) {
|
|
1447
1370
|
query = defaultQueryObj;
|
|
1448
1371
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1372
|
+
defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
1373
|
+
// Update calculated default query in store
|
|
1452
1374
|
index.updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
1453
1375
|
}
|
|
1454
|
-
|
|
1455
1376
|
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, this.queryOptions, defaultQueryOptions), execute);
|
|
1456
1377
|
this.updateQuery({
|
|
1457
1378
|
componentId: this.internalComponent,
|
|
@@ -1462,26 +1383,22 @@ var DataSearch = {
|
|
|
1462
1383
|
},
|
|
1463
1384
|
updateQueryHandler: function updateQueryHandler(componentId, value, props) {
|
|
1464
1385
|
var customQuery = props.customQuery,
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1386
|
+
filterLabel = props.filterLabel,
|
|
1387
|
+
showFilter = props.showFilter,
|
|
1388
|
+
URLParams = props.URLParams;
|
|
1468
1389
|
var customQueryOptions;
|
|
1469
1390
|
var defaultQueryTobeSet = DataSearch.defaultQuery(value, props);
|
|
1470
1391
|
var query = defaultQueryTobeSet;
|
|
1471
|
-
|
|
1472
1392
|
if (customQuery) {
|
|
1473
1393
|
var customQueryTobeSet = customQuery(value, props);
|
|
1474
1394
|
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
1475
|
-
|
|
1476
1395
|
if (queryTobeSet) {
|
|
1477
1396
|
query = queryTobeSet;
|
|
1478
1397
|
}
|
|
1479
|
-
|
|
1480
1398
|
customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
1481
1399
|
index.updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
1482
1400
|
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, this.queryOptions, customQueryOptions), false);
|
|
1483
1401
|
}
|
|
1484
|
-
|
|
1485
1402
|
if (!this.isPending) {
|
|
1486
1403
|
this.updateQuery({
|
|
1487
1404
|
componentId: componentId,
|
|
@@ -1501,7 +1418,6 @@ var DataSearch = {
|
|
|
1501
1418
|
},
|
|
1502
1419
|
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
1503
1420
|
var results = _ref.results;
|
|
1504
|
-
|
|
1505
1421
|
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
1506
1422
|
this.isPending = false;
|
|
1507
1423
|
this.setValue(results[0][0].transcript.trim(), true);
|
|
@@ -1509,11 +1425,9 @@ var DataSearch = {
|
|
|
1509
1425
|
},
|
|
1510
1426
|
triggerQuery: function triggerQuery(_temp) {
|
|
1511
1427
|
var _ref2 = _temp === void 0 ? false : _temp,
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1428
|
+
_ref2$isOpen = _ref2.isOpen,
|
|
1429
|
+
isOpen = _ref2$isOpen === void 0 ? false : _ref2$isOpen;
|
|
1515
1430
|
var value = this.$props.value;
|
|
1516
|
-
|
|
1517
1431
|
if (value !== undefined) {
|
|
1518
1432
|
this.isPending = false;
|
|
1519
1433
|
this.setValue(this.$props.value, !isOpen);
|
|
@@ -1522,17 +1436,14 @@ var DataSearch = {
|
|
|
1522
1436
|
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
1523
1437
|
// click analytics would only work client side and after javascript loads
|
|
1524
1438
|
var docId = documentId;
|
|
1525
|
-
|
|
1526
1439
|
if (!docId) {
|
|
1527
1440
|
var hitData = this.suggestionsList.find(function (hit) {
|
|
1528
1441
|
return hit._click_id === searchPosition;
|
|
1529
1442
|
});
|
|
1530
|
-
|
|
1531
1443
|
if (hitData && hitData.source && hitData.source._id) {
|
|
1532
1444
|
docId = hitData.source._id;
|
|
1533
1445
|
}
|
|
1534
1446
|
}
|
|
1535
|
-
|
|
1536
1447
|
this.recordSuggestionClick(searchPosition, docId);
|
|
1537
1448
|
},
|
|
1538
1449
|
clearValue: function clearValue() {
|
|
@@ -1542,53 +1453,44 @@ var DataSearch = {
|
|
|
1542
1453
|
},
|
|
1543
1454
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1544
1455
|
var value = this.$props.value;
|
|
1545
|
-
|
|
1546
1456
|
if (value !== undefined) {
|
|
1547
1457
|
this.isPending = true;
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1458
|
+
}
|
|
1550
1459
|
|
|
1460
|
+
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
1551
1461
|
if (event.key === 'Enter' && highlightedIndex === null) {
|
|
1552
1462
|
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
|
|
1553
1463
|
);
|
|
1554
|
-
this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
|
|
1555
|
-
} // Need to review
|
|
1556
|
-
|
|
1557
1464
|
|
|
1465
|
+
this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
|
|
1466
|
+
}
|
|
1467
|
+
// Need to review
|
|
1558
1468
|
this.$emit('keyDown', event, this.triggerQuery);
|
|
1559
1469
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1560
1470
|
},
|
|
1561
1471
|
onInputChange: function onInputChange(e) {
|
|
1562
1472
|
var _this2 = this;
|
|
1563
|
-
|
|
1564
1473
|
var inputValue = e.target.value;
|
|
1565
|
-
|
|
1566
1474
|
if (!this.$data.isOpen) {
|
|
1567
1475
|
this.isOpen = true;
|
|
1568
1476
|
}
|
|
1569
|
-
|
|
1570
1477
|
var _this$$props2 = this.$props,
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1478
|
+
value = _this$$props2.value,
|
|
1479
|
+
autosuggest = _this$$props2.autosuggest;
|
|
1574
1480
|
if (value === undefined) {
|
|
1575
1481
|
this.setValue(inputValue, false, this.$props, undefined, true, false);
|
|
1576
1482
|
} else {
|
|
1577
1483
|
this.isPending = true;
|
|
1578
1484
|
this.$emit('change', inputValue, function (_temp2) {
|
|
1579
1485
|
var _ref3 = _temp2 === void 0 ? {} : _temp2,
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1486
|
+
_ref3$isOpen = _ref3.isOpen,
|
|
1487
|
+
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen;
|
|
1583
1488
|
if (_this2.$options.isTagsMode && autosuggest) {
|
|
1584
1489
|
_this2.currentValue = value;
|
|
1585
1490
|
_this2.isOpen = isOpen;
|
|
1586
|
-
|
|
1587
|
-
_this2.updateDefaultQueryHandler(_this2.currentValue, _this2.$props);
|
|
1588
|
-
|
|
1491
|
+
_this2.updateDefaultQueryHandlerDebounced(_this2.currentValue, _this2.$props);
|
|
1589
1492
|
return;
|
|
1590
1493
|
}
|
|
1591
|
-
|
|
1592
1494
|
_this2.triggerQuery({
|
|
1593
1495
|
isOpen: isOpen
|
|
1594
1496
|
});
|
|
@@ -1596,28 +1498,24 @@ var DataSearch = {
|
|
|
1596
1498
|
}
|
|
1597
1499
|
},
|
|
1598
1500
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1599
|
-
var value = this.$props.value;
|
|
1600
|
-
|
|
1501
|
+
var value = this.$props.value;
|
|
1502
|
+
// Record analytics for selected suggestions
|
|
1601
1503
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
1602
|
-
|
|
1603
1504
|
if (value === undefined) {
|
|
1604
1505
|
this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1605
1506
|
} else if (this.$options.isTagsMode) {
|
|
1606
1507
|
var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
1607
|
-
|
|
1608
1508
|
if (this.selectedTags.includes(suggestion.value)) {
|
|
1609
1509
|
// avoid duplicates in tags array
|
|
1610
1510
|
this.isOpen = false;
|
|
1611
1511
|
return;
|
|
1612
1512
|
}
|
|
1613
|
-
|
|
1614
1513
|
emitValue.push(suggestion.value);
|
|
1615
1514
|
this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, true);
|
|
1616
1515
|
this.$emit('change', emitValue, this.triggerQuery);
|
|
1617
1516
|
} else {
|
|
1618
1517
|
this.$emit('change', suggestion.value, this.triggerQuery);
|
|
1619
1518
|
}
|
|
1620
|
-
|
|
1621
1519
|
this.isPending = false;
|
|
1622
1520
|
this.onValueSelectedHandler(suggestion.value, configureStore.causes.SUGGESTION_SELECT, suggestion.source);
|
|
1623
1521
|
},
|
|
@@ -1625,11 +1523,9 @@ var DataSearch = {
|
|
|
1625
1523
|
if (currentValue === void 0) {
|
|
1626
1524
|
currentValue = this.$data.currentValue;
|
|
1627
1525
|
}
|
|
1628
|
-
|
|
1629
1526
|
for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1630
1527
|
cause[_key - 1] = arguments[_key];
|
|
1631
1528
|
}
|
|
1632
|
-
|
|
1633
1529
|
this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
|
|
1634
1530
|
this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
|
|
1635
1531
|
},
|
|
@@ -1639,26 +1535,21 @@ var DataSearch = {
|
|
|
1639
1535
|
},
|
|
1640
1536
|
getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
|
|
1641
1537
|
var isDark = this.themePreset === 'dark';
|
|
1642
|
-
|
|
1643
1538
|
if (isDark) {
|
|
1644
1539
|
return highlightedIndex === index ? '#555' : '#424242';
|
|
1645
1540
|
}
|
|
1646
|
-
|
|
1647
1541
|
return highlightedIndex === index ? '#eee' : '#fff';
|
|
1648
1542
|
},
|
|
1649
1543
|
renderIcon: function renderIcon() {
|
|
1650
1544
|
var h = this.$createElement;
|
|
1651
|
-
|
|
1652
1545
|
if (this.$props.showIcon) {
|
|
1653
1546
|
return this.$props.icon || h(SearchSvg);
|
|
1654
1547
|
}
|
|
1655
|
-
|
|
1656
1548
|
return null;
|
|
1657
1549
|
},
|
|
1658
1550
|
renderErrorComponent: function renderErrorComponent() {
|
|
1659
1551
|
var h = this.$createElement;
|
|
1660
1552
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
1661
|
-
|
|
1662
1553
|
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
1663
1554
|
return h(SuggestionWrapper, {
|
|
1664
1555
|
"attrs": {
|
|
@@ -1669,33 +1560,28 @@ var DataSearch = {
|
|
|
1669
1560
|
}
|
|
1670
1561
|
}, [index.isFunction(renderError) ? renderError(this.error) : renderError]);
|
|
1671
1562
|
}
|
|
1672
|
-
|
|
1673
1563
|
return null;
|
|
1674
1564
|
},
|
|
1675
1565
|
renderCancelIcon: function renderCancelIcon() {
|
|
1676
1566
|
var h = this.$createElement;
|
|
1677
|
-
|
|
1678
1567
|
if (this.$props.showClear) {
|
|
1679
1568
|
return this.$props.clearIcon || h(CancelSvg.CancelSvg);
|
|
1680
1569
|
}
|
|
1681
|
-
|
|
1682
1570
|
return null;
|
|
1683
1571
|
},
|
|
1684
1572
|
renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
|
|
1685
1573
|
if (finalSuggestionsList === void 0) {
|
|
1686
1574
|
finalSuggestionsList = [];
|
|
1687
1575
|
}
|
|
1688
|
-
|
|
1689
1576
|
var h = this.$createElement;
|
|
1690
1577
|
var _this$$props3 = this.$props,
|
|
1691
|
-
|
|
1692
|
-
|
|
1578
|
+
theme = _this$$props3.theme,
|
|
1579
|
+
innerClass = _this$$props3.innerClass;
|
|
1693
1580
|
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
1694
1581
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
1695
1582
|
var _this$$data = this.$data,
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1583
|
+
isOpen = _this$$data.isOpen,
|
|
1584
|
+
currentValue = _this$$data.currentValue;
|
|
1699
1585
|
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
1700
1586
|
return h(SuggestionWrapper, {
|
|
1701
1587
|
"attrs": {
|
|
@@ -1711,22 +1597,18 @@ var DataSearch = {
|
|
|
1711
1597
|
}
|
|
1712
1598
|
});
|
|
1713
1599
|
}
|
|
1714
|
-
|
|
1715
1600
|
return null;
|
|
1716
1601
|
},
|
|
1717
1602
|
renderInputAddonBefore: function renderInputAddonBefore() {
|
|
1718
1603
|
var h = this.$createElement;
|
|
1719
1604
|
var addonBefore = this.$scopedSlots.addonBefore;
|
|
1720
|
-
|
|
1721
1605
|
if (addonBefore) {
|
|
1722
1606
|
return h(InputAddon, [addonBefore()]);
|
|
1723
1607
|
}
|
|
1724
|
-
|
|
1725
1608
|
return null;
|
|
1726
1609
|
},
|
|
1727
1610
|
renderTag: function renderTag(item) {
|
|
1728
1611
|
var _this3 = this;
|
|
1729
|
-
|
|
1730
1612
|
var h = this.$createElement;
|
|
1731
1613
|
var innerClass = this.$props.innerClass;
|
|
1732
1614
|
return h(TagItem, {
|
|
@@ -1747,7 +1629,6 @@ var DataSearch = {
|
|
|
1747
1629
|
clearAllTags: function clearAllTags() {
|
|
1748
1630
|
this.selectedTags = [];
|
|
1749
1631
|
this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1750
|
-
|
|
1751
1632
|
if (this.$props.value !== undefined) {
|
|
1752
1633
|
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1753
1634
|
}
|
|
@@ -1757,20 +1638,16 @@ var DataSearch = {
|
|
|
1757
1638
|
return tag !== tagValue;
|
|
1758
1639
|
}));
|
|
1759
1640
|
this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1760
|
-
|
|
1761
1641
|
if (this.$props.value !== undefined) {
|
|
1762
1642
|
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1763
1643
|
}
|
|
1764
1644
|
},
|
|
1765
1645
|
renderTags: function renderTags() {
|
|
1766
1646
|
var _this4 = this;
|
|
1767
|
-
|
|
1768
1647
|
var h = this.$createElement;
|
|
1769
|
-
|
|
1770
1648
|
if (!Array.isArray(this.selectedTags)) {
|
|
1771
1649
|
return null;
|
|
1772
1650
|
}
|
|
1773
|
-
|
|
1774
1651
|
var tagsList = [].concat(this.selectedTags);
|
|
1775
1652
|
var shouldRenderClearAllTag = tagsList.length > 1;
|
|
1776
1653
|
var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
|
|
@@ -1796,22 +1673,20 @@ var DataSearch = {
|
|
|
1796
1673
|
renderInputAddonAfter: function renderInputAddonAfter() {
|
|
1797
1674
|
var h = this.$createElement;
|
|
1798
1675
|
var addonAfter = this.$scopedSlots.addonAfter;
|
|
1799
|
-
|
|
1800
1676
|
if (addonAfter) {
|
|
1801
1677
|
return h(InputAddon, [addonAfter()]);
|
|
1802
1678
|
}
|
|
1803
|
-
|
|
1804
1679
|
return null;
|
|
1805
1680
|
},
|
|
1806
1681
|
renderIcons: function renderIcons() {
|
|
1807
1682
|
var h = this.$createElement;
|
|
1808
1683
|
var _this$$props4 = this.$props,
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1684
|
+
iconPosition = _this$$props4.iconPosition,
|
|
1685
|
+
showClear = _this$$props4.showClear,
|
|
1686
|
+
innerClass = _this$$props4.innerClass,
|
|
1687
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
1688
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
1689
|
+
showIcon = _this$$props4.showIcon;
|
|
1815
1690
|
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
1816
1691
|
var currentValue = this.$data.currentValue;
|
|
1817
1692
|
return h("div", [h(CancelSvg.IconGroup, {
|
|
@@ -1851,49 +1726,41 @@ var DataSearch = {
|
|
|
1851
1726
|
},
|
|
1852
1727
|
focusSearchBox: function focusSearchBox(event) {
|
|
1853
1728
|
var _this$$refs, _this$$refs$this$$pro;
|
|
1854
|
-
|
|
1855
1729
|
var elt = event.target || event.srcElement;
|
|
1856
1730
|
var tagName = elt.tagName;
|
|
1857
|
-
|
|
1858
1731
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1859
1732
|
// already in an input
|
|
1860
1733
|
return;
|
|
1861
1734
|
}
|
|
1862
|
-
|
|
1863
1735
|
(_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
|
|
1864
1736
|
},
|
|
1865
1737
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1866
1738
|
var _this5 = this;
|
|
1867
|
-
|
|
1868
1739
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1869
|
-
|
|
1870
|
-
|
|
1740
|
+
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1871
1741
|
if (index.isEmpty(focusShortcuts)) {
|
|
1872
1742
|
return;
|
|
1873
1743
|
}
|
|
1744
|
+
var shortcutsString = index.parseFocusShortcuts(focusShortcuts).join(',');
|
|
1874
1745
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1746
|
+
// handler for alphabets and other key combinations
|
|
1747
|
+
hotkeys(shortcutsString,
|
|
1748
|
+
// eslint-disable-next-line no-unused-vars
|
|
1879
1749
|
/* eslint-disable no-shadow */
|
|
1880
1750
|
function (event, handler) {
|
|
1881
1751
|
// Prevent the default refresh event under WINDOWS system
|
|
1882
1752
|
event.preventDefault();
|
|
1883
|
-
|
|
1884
1753
|
_this5.focusSearchBox(event);
|
|
1885
|
-
});
|
|
1754
|
+
});
|
|
1886
1755
|
|
|
1756
|
+
// if one of modifier keys are used, they are handled below
|
|
1887
1757
|
hotkeys('*', function (event) {
|
|
1888
1758
|
var modifierKeys = index.extractModifierKeysFromFocusShortcuts(focusShortcuts);
|
|
1889
1759
|
if (modifierKeys.length === 0) return;
|
|
1890
|
-
|
|
1891
1760
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
1892
1761
|
var element = modifierKeys[index$1];
|
|
1893
|
-
|
|
1894
1762
|
if (hotkeys[element]) {
|
|
1895
1763
|
_this5.focusSearchBox(event);
|
|
1896
|
-
|
|
1897
1764
|
break;
|
|
1898
1765
|
}
|
|
1899
1766
|
}
|
|
@@ -1902,22 +1769,19 @@ var DataSearch = {
|
|
|
1902
1769
|
},
|
|
1903
1770
|
render: function render() {
|
|
1904
1771
|
var _this6 = this;
|
|
1905
|
-
|
|
1906
1772
|
var h = arguments[0];
|
|
1907
1773
|
var _this$$props5 = this.$props,
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1774
|
+
theme = _this$$props5.theme,
|
|
1775
|
+
size = _this$$props5.size,
|
|
1776
|
+
expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer,
|
|
1777
|
+
enableDefaultSuggestions = _this$$props5.enableDefaultSuggestions;
|
|
1912
1778
|
var _this$$scopedSlots = this.$scopedSlots,
|
|
1913
|
-
|
|
1914
|
-
|
|
1779
|
+
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
1780
|
+
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
1915
1781
|
var hasSuggestions = this.currentValue ? this.suggestionsList.length || this.topSuggestions.length : this.defaultSearchSuggestions.length;
|
|
1916
|
-
|
|
1917
1782
|
if (enableDefaultSuggestions === false && !this.currentValue) {
|
|
1918
1783
|
hasSuggestions = false;
|
|
1919
1784
|
}
|
|
1920
|
-
|
|
1921
1785
|
return h(Container.Container, {
|
|
1922
1786
|
"class": this.$props.className
|
|
1923
1787
|
}, [this.$props.title && h(Title.Title, {
|
|
@@ -1932,13 +1796,12 @@ var DataSearch = {
|
|
|
1932
1796
|
"scopedSlots": {
|
|
1933
1797
|
"default": function _default(_ref4) {
|
|
1934
1798
|
var getInputEvents = _ref4.getInputEvents,
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1799
|
+
getInputProps = _ref4.getInputProps,
|
|
1800
|
+
getItemProps = _ref4.getItemProps,
|
|
1801
|
+
getItemEvents = _ref4.getItemEvents,
|
|
1802
|
+
isOpen = _ref4.isOpen,
|
|
1803
|
+
highlightedIndex = _ref4.highlightedIndex,
|
|
1804
|
+
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
1942
1805
|
var renderSuggestionsContainer = function renderSuggestionsContainer() {
|
|
1943
1806
|
return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
|
|
1944
1807
|
isOpen: isOpen,
|
|
@@ -2036,7 +1899,6 @@ var DataSearch = {
|
|
|
2036
1899
|
})]);
|
|
2037
1900
|
})]) : _this6.renderNoSuggestions(_this6.suggestionsList)]);
|
|
2038
1901
|
};
|
|
2039
|
-
|
|
2040
1902
|
return h("div", {
|
|
2041
1903
|
"class": Input.suggestionsContainer
|
|
2042
1904
|
}, [h(InputGroup, [_this6.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
@@ -2060,7 +1922,6 @@ var DataSearch = {
|
|
|
2060
1922
|
onFocus: _this6.handleFocus,
|
|
2061
1923
|
onKeyPress: function onKeyPress(e) {
|
|
2062
1924
|
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
2063
|
-
|
|
2064
1925
|
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
2065
1926
|
},
|
|
2066
1927
|
onKeyDown: function onKeyDown(e) {
|
|
@@ -2068,7 +1929,6 @@ var DataSearch = {
|
|
|
2068
1929
|
},
|
|
2069
1930
|
onKeyUp: function onKeyUp(e) {
|
|
2070
1931
|
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
2071
|
-
|
|
2072
1932
|
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
2073
1933
|
},
|
|
2074
1934
|
onClick: function onClick() {
|
|
@@ -2098,7 +1958,6 @@ var DataSearch = {
|
|
|
2098
1958
|
},
|
|
2099
1959
|
keypress: function keypress(e) {
|
|
2100
1960
|
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
2101
|
-
|
|
2102
1961
|
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
2103
1962
|
},
|
|
2104
1963
|
input: this.onInputChange,
|
|
@@ -2107,12 +1966,10 @@ var DataSearch = {
|
|
|
2107
1966
|
},
|
|
2108
1967
|
keydown: function keydown(e) {
|
|
2109
1968
|
_this6.$emit('keyDown', e, _this6.triggerQuery);
|
|
2110
|
-
|
|
2111
1969
|
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
2112
1970
|
},
|
|
2113
1971
|
keyup: function keyup(e) {
|
|
2114
1972
|
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
2115
|
-
|
|
2116
1973
|
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
2117
1974
|
}
|
|
2118
1975
|
}),
|
|
@@ -2127,10 +1984,8 @@ var DataSearch = {
|
|
|
2127
1984
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
2128
1985
|
}
|
|
2129
1986
|
};
|
|
2130
|
-
|
|
2131
1987
|
DataSearch.defaultQuery = function (value, props) {
|
|
2132
1988
|
var finalQuery = null;
|
|
2133
|
-
|
|
2134
1989
|
if (value) {
|
|
2135
1990
|
var fields = normalizeDataField(props.dataField, props.fieldWeights);
|
|
2136
1991
|
finalQuery = {
|
|
@@ -2140,11 +1995,9 @@ DataSearch.defaultQuery = function (value, props) {
|
|
|
2140
1995
|
}
|
|
2141
1996
|
};
|
|
2142
1997
|
}
|
|
2143
|
-
|
|
2144
1998
|
if (value === '') {
|
|
2145
1999
|
finalQuery = null;
|
|
2146
2000
|
}
|
|
2147
|
-
|
|
2148
2001
|
if (finalQuery && props.nestedField) {
|
|
2149
2002
|
return {
|
|
2150
2003
|
query: {
|
|
@@ -2155,23 +2008,18 @@ DataSearch.defaultQuery = function (value, props) {
|
|
|
2155
2008
|
}
|
|
2156
2009
|
};
|
|
2157
2010
|
}
|
|
2158
|
-
|
|
2159
2011
|
return finalQuery;
|
|
2160
2012
|
};
|
|
2161
|
-
|
|
2162
2013
|
DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
2163
2014
|
var finalQuery = [];
|
|
2164
2015
|
var phrasePrefixFields = [];
|
|
2165
2016
|
var fields = dataFields.map(function (dataField) {
|
|
2166
2017
|
var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
|
|
2167
|
-
|
|
2168
2018
|
if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
|
|
2169
2019
|
phrasePrefixFields.push(queryField);
|
|
2170
2020
|
}
|
|
2171
|
-
|
|
2172
2021
|
return queryField;
|
|
2173
2022
|
});
|
|
2174
|
-
|
|
2175
2023
|
if (props.searchOperators || props.queryString) {
|
|
2176
2024
|
return {
|
|
2177
2025
|
query: value,
|
|
@@ -2179,7 +2027,6 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2179
2027
|
default_operator: props.queryFormat
|
|
2180
2028
|
};
|
|
2181
2029
|
}
|
|
2182
|
-
|
|
2183
2030
|
if (props.queryFormat === 'and') {
|
|
2184
2031
|
finalQuery.push({
|
|
2185
2032
|
multi_match: {
|
|
@@ -2197,7 +2044,6 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2197
2044
|
operator: 'and'
|
|
2198
2045
|
}
|
|
2199
2046
|
});
|
|
2200
|
-
|
|
2201
2047
|
if (phrasePrefixFields.length > 0) {
|
|
2202
2048
|
finalQuery.push({
|
|
2203
2049
|
multi_match: {
|
|
@@ -2208,10 +2054,8 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2208
2054
|
}
|
|
2209
2055
|
});
|
|
2210
2056
|
}
|
|
2211
|
-
|
|
2212
2057
|
return finalQuery;
|
|
2213
2058
|
}
|
|
2214
|
-
|
|
2215
2059
|
finalQuery.push({
|
|
2216
2060
|
multi_match: {
|
|
2217
2061
|
query: value,
|
|
@@ -2229,7 +2073,6 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2229
2073
|
operator: 'or'
|
|
2230
2074
|
}
|
|
2231
2075
|
});
|
|
2232
|
-
|
|
2233
2076
|
if (phrasePrefixFields.length > 0) {
|
|
2234
2077
|
finalQuery.push({
|
|
2235
2078
|
multi_match: {
|
|
@@ -2240,22 +2083,17 @@ DataSearch.shouldQuery = function (value, dataFields, props) {
|
|
|
2240
2083
|
}
|
|
2241
2084
|
});
|
|
2242
2085
|
}
|
|
2243
|
-
|
|
2244
2086
|
return finalQuery;
|
|
2245
2087
|
};
|
|
2246
|
-
|
|
2247
2088
|
DataSearch.highlightQuery = function (props) {
|
|
2248
2089
|
if (props.customHighlight) {
|
|
2249
2090
|
return props.customHighlight(props);
|
|
2250
2091
|
}
|
|
2251
|
-
|
|
2252
2092
|
if (!props.highlight) {
|
|
2253
2093
|
return null;
|
|
2254
2094
|
}
|
|
2255
|
-
|
|
2256
2095
|
var fields = {};
|
|
2257
2096
|
var highlightField = props.highlightField ? props.highlightField : props.dataField;
|
|
2258
|
-
|
|
2259
2097
|
if (typeof highlightField === 'string') {
|
|
2260
2098
|
fields[highlightField] = {};
|
|
2261
2099
|
} else if (Array.isArray(highlightField)) {
|
|
@@ -2263,7 +2101,6 @@ DataSearch.highlightQuery = function (props) {
|
|
|
2263
2101
|
fields[item] = {};
|
|
2264
2102
|
});
|
|
2265
2103
|
}
|
|
2266
|
-
|
|
2267
2104
|
return {
|
|
2268
2105
|
highlight: _rollupPluginBabelHelpers._extends({
|
|
2269
2106
|
pre_tags: ['<mark>'],
|
|
@@ -2274,11 +2111,9 @@ DataSearch.highlightQuery = function (props) {
|
|
|
2274
2111
|
})
|
|
2275
2112
|
};
|
|
2276
2113
|
};
|
|
2277
|
-
|
|
2278
2114
|
DataSearch.hasInternalComponent = function () {
|
|
2279
2115
|
return true;
|
|
2280
2116
|
};
|
|
2281
|
-
|
|
2282
2117
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
2283
2118
|
return {
|
|
2284
2119
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
@@ -2303,7 +2138,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
2303
2138
|
recentSearches: state.recentSearches.data
|
|
2304
2139
|
};
|
|
2305
2140
|
};
|
|
2306
|
-
|
|
2307
2141
|
var mapDispatchToProps = {
|
|
2308
2142
|
setQueryOptions: setQueryOptions,
|
|
2309
2143
|
updateQuery: updateQuery,
|
|
@@ -2319,12 +2153,10 @@ var DSConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.Compo
|
|
|
2319
2153
|
componentType: constants.componentTypes.dataSearch,
|
|
2320
2154
|
internalComponent: DataSearch.hasInternalComponent()
|
|
2321
2155
|
}));
|
|
2322
|
-
|
|
2323
2156
|
DataSearch.install = function (Vue) {
|
|
2324
2157
|
Vue.component(DataSearch.name, DSConnected);
|
|
2325
|
-
};
|
|
2326
|
-
|
|
2327
|
-
|
|
2158
|
+
};
|
|
2159
|
+
// Add componentType for SSR
|
|
2328
2160
|
DataSearch.componentType = constants.componentTypes.dataSearch;
|
|
2329
2161
|
|
|
2330
2162
|
exports.CustomSvg = CustomSvg;
|