@appbaseio/reactivesearch-vue 1.36.6 → 1.36.7
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 +35043 -26307
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +42 -42
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/DataSearch.js +118 -91
- package/dist/cjs/{ReactiveComponentPrivate-04f3bf64.js → ReactiveComponentPrivate-3a197e2c.js} +103 -66
- package/dist/cjs/ReactiveComponentPrivate.js +1 -1
- package/dist/cjs/ReactiveGoogleMap.js +8 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/install.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/DataSearch.js +118 -91
- package/dist/es/{ReactiveComponentPrivate-a774148b.js → ReactiveComponentPrivate-ebe9a60a.js} +103 -66
- package/dist/es/ReactiveComponentPrivate.js +1 -1
- package/dist/es/ReactiveGoogleMap.js +8 -0
- package/dist/es/index.js +1 -1
- package/dist/es/install.js +1 -1
- package/dist/es/version.js +1 -1
- package/package.json +2 -2
package/dist/cjs/DataSearch.js
CHANGED
|
@@ -60,7 +60,8 @@ var DataSearch = {
|
|
|
60
60
|
selectedTags: [],
|
|
61
61
|
isOpen: false,
|
|
62
62
|
normalizedSuggestions: [],
|
|
63
|
-
isPending: false
|
|
63
|
+
isPending: false,
|
|
64
|
+
isSuggestionSelected: false
|
|
64
65
|
};
|
|
65
66
|
this.internalComponent = props.componentId + "__internal";
|
|
66
67
|
return this.__state;
|
|
@@ -130,7 +131,7 @@ var DataSearch = {
|
|
|
130
131
|
normalizedPopularSuggestions: function normalizedPopularSuggestions() {
|
|
131
132
|
return getTopSuggestions(
|
|
132
133
|
// use default popular suggestions if value is empty
|
|
133
|
-
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue, this.showDistinctSuggestions);
|
|
134
|
+
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue || '', this.showDistinctSuggestions);
|
|
134
135
|
},
|
|
135
136
|
defaultSearchSuggestions: function defaultSearchSuggestions() {
|
|
136
137
|
var isPopularSuggestionsEnabled = this.enablePopularSuggestions;
|
|
@@ -150,7 +151,7 @@ var DataSearch = {
|
|
|
150
151
|
var defaultSuggestions = isPopularSuggestionsEnabled ? [].concat(customNormalizedRecentSearches, customDefaultPopularSuggestions || []) : customNormalizedRecentSearches;
|
|
151
152
|
return getTopSuggestions(
|
|
152
153
|
// use default popular suggestions if value is empty
|
|
153
|
-
defaultSuggestions, this.currentValue, this.showDistinctSuggestions);
|
|
154
|
+
defaultSuggestions, this.currentValue || '', this.showDistinctSuggestions);
|
|
154
155
|
},
|
|
155
156
|
hasCustomRenderer: function hasCustomRenderer() {
|
|
156
157
|
return index.hasCustomRenderer(this);
|
|
@@ -300,23 +301,12 @@ var DataSearch = {
|
|
|
300
301
|
this.updateQueryHandler(this.componentId, this.$data.currentValue, this.$props);
|
|
301
302
|
}
|
|
302
303
|
},
|
|
303
|
-
isLoading: function isLoading(newVal) {
|
|
304
|
-
if (newVal) {
|
|
305
|
-
this.suggestions = [];
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
304
|
suggestions: function suggestions(newVal) {
|
|
309
|
-
if (this.isLoading) {
|
|
310
|
-
this.normalizedSuggestions = [];
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
305
|
if (Array.isArray(newVal) && this.$data.currentValue.trim().length) {
|
|
314
306
|
// shallow check allows us to set suggestions even if the next set
|
|
315
307
|
// of suggestions are same as the current one
|
|
316
308
|
this.$emit('suggestions', newVal);
|
|
317
|
-
|
|
318
|
-
this.normalizedSuggestions = this.onSuggestions(newVal);
|
|
319
|
-
}
|
|
309
|
+
this.normalizedSuggestions = this.onSuggestions(newVal);
|
|
320
310
|
}
|
|
321
311
|
},
|
|
322
312
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
@@ -421,7 +411,7 @@ var DataSearch = {
|
|
|
421
411
|
return queryOptions;
|
|
422
412
|
},
|
|
423
413
|
onSuggestions: function onSuggestions(results) {
|
|
424
|
-
return handleOnSuggestions(results, this.$data.currentValue, this);
|
|
414
|
+
return handleOnSuggestions(results, this.$data.currentValue || '', this);
|
|
425
415
|
},
|
|
426
416
|
handleSearchIconClick: function handleSearchIconClick() {
|
|
427
417
|
var currentValue = this.currentValue;
|
|
@@ -449,11 +439,13 @@ var DataSearch = {
|
|
|
449
439
|
if (isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
450
440
|
return;
|
|
451
441
|
}
|
|
452
|
-
|
|
453
|
-
|
|
442
|
+
if (!value && props.enableDefaultSuggestions === false) {
|
|
443
|
+
_this.resetStoreForComponent(props.componentId);
|
|
444
|
+
} else if (!value && _this.currentValue && _this.enableRecentSearches) {
|
|
454
445
|
_this.getRecentSearches();
|
|
455
446
|
}
|
|
456
447
|
if (isTagsMode) {
|
|
448
|
+
var isTagAdded = false;
|
|
457
449
|
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
458
450
|
// check if value already present in selectedTags
|
|
459
451
|
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
@@ -462,14 +454,36 @@ var DataSearch = {
|
|
|
462
454
|
}
|
|
463
455
|
_this.selectedTags = [].concat(_this.selectedTags);
|
|
464
456
|
if (typeof value === 'string' && !!value) {
|
|
465
|
-
|
|
457
|
+
if (props.strictSelection && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
458
|
+
_this.selectedTags.push(value);
|
|
459
|
+
isTagAdded = true;
|
|
460
|
+
} else if (!props.strictSelection) {
|
|
461
|
+
_this.selectedTags.push(value);
|
|
462
|
+
isTagAdded = true;
|
|
463
|
+
}
|
|
466
464
|
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
467
|
-
|
|
465
|
+
if (props.strictSelection && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
466
|
+
_this.selectedTags = value;
|
|
467
|
+
isTagAdded = true;
|
|
468
|
+
} else if (!props.strictSelection) {
|
|
469
|
+
_this.selectedTags.push(value);
|
|
470
|
+
isTagAdded = true;
|
|
471
|
+
}
|
|
468
472
|
}
|
|
469
473
|
} else if (value) {
|
|
470
|
-
|
|
474
|
+
if (props.strictSelection && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
475
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
476
|
+
isTagAdded = true;
|
|
477
|
+
} else if (!props.strictSelection) {
|
|
478
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
479
|
+
isTagAdded = true;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (props.strictSelection && !isTagAdded && typeof value === 'string') {
|
|
483
|
+
_this.currentValue = value;
|
|
484
|
+
} else {
|
|
485
|
+
_this.currentValue = '';
|
|
471
486
|
}
|
|
472
|
-
_this.currentValue = '';
|
|
473
487
|
} else {
|
|
474
488
|
_this.currentValue = value;
|
|
475
489
|
}
|
|
@@ -489,7 +503,7 @@ var DataSearch = {
|
|
|
489
503
|
if (props.strictSelection && props.autosuggest) {
|
|
490
504
|
if (cause === configureStore.causes.SUGGESTION_SELECT || props.value !== undefined) {
|
|
491
505
|
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
492
|
-
} else if (_this.currentValue !== '') {
|
|
506
|
+
} else if (_this.currentValue !== '' && !props.strictSelection) {
|
|
493
507
|
_this.setValue('', true);
|
|
494
508
|
}
|
|
495
509
|
} else {
|
|
@@ -503,7 +517,7 @@ var DataSearch = {
|
|
|
503
517
|
_this.$emit('value-change', value);
|
|
504
518
|
// Set the already fetched suggestions if query is same as used last to fetch the hits
|
|
505
519
|
if (value === _this.lastUsedQuery) {
|
|
506
|
-
_this.
|
|
520
|
+
_this.normalizedSuggestions = _this.onSuggestions(_this.suggestions);
|
|
507
521
|
// invoke on suggestions
|
|
508
522
|
_this.$emit('suggestions', _this.suggestions);
|
|
509
523
|
} else if (!value) {
|
|
@@ -531,13 +545,18 @@ var DataSearch = {
|
|
|
531
545
|
// Update calculated default query in store
|
|
532
546
|
index.updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
533
547
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
548
|
+
if (!value && props.enableDefaultSuggestions === false) {
|
|
549
|
+
// clear Component data from store
|
|
550
|
+
this.resetStoreForComponent(props.componentId);
|
|
551
|
+
} else {
|
|
552
|
+
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, this.queryOptions, defaultQueryOptions), execute);
|
|
553
|
+
this.updateQuery({
|
|
554
|
+
componentId: this.internalComponent,
|
|
555
|
+
query: query,
|
|
556
|
+
value: value,
|
|
557
|
+
componentType: constants.componentTypes.dataSearch
|
|
558
|
+
}, execute);
|
|
559
|
+
}
|
|
541
560
|
},
|
|
542
561
|
updateQueryHandler: function updateQueryHandler(componentId, value, props) {
|
|
543
562
|
var customQuery = props.customQuery,
|
|
@@ -606,24 +625,27 @@ var DataSearch = {
|
|
|
606
625
|
},
|
|
607
626
|
clearValue: function clearValue() {
|
|
608
627
|
this.isPending = false;
|
|
609
|
-
this.
|
|
628
|
+
if (!this.$props.enableDefaultSuggestions) {
|
|
629
|
+
this.isOpen = false;
|
|
630
|
+
}
|
|
631
|
+
this.setValue('', false);
|
|
610
632
|
this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
|
|
611
633
|
},
|
|
612
634
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
613
635
|
var targetValue = event.target.value;
|
|
614
636
|
var _this$$props2 = this.$props,
|
|
615
637
|
value = _this$$props2.value,
|
|
616
|
-
|
|
617
|
-
size = _this$$props2.size,
|
|
618
|
-
autosuggest = _this$$props2.autosuggest;
|
|
638
|
+
size = _this$$props2.size;
|
|
619
639
|
if (value !== undefined) {
|
|
620
640
|
this.isPending = true;
|
|
621
641
|
}
|
|
622
642
|
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
623
643
|
if (event.key === 'Enter' && (highlightedIndex === null || highlightedIndex < 0 || highlightedIndex === [].concat([].concat(this.suggestionsList).slice(0, size || 10), this.defaultSearchSuggestions, this.topSuggestions).length)) {
|
|
624
644
|
this.isPending = false;
|
|
625
|
-
|
|
626
|
-
|
|
645
|
+
if (!this.isSuggestionSelected) {
|
|
646
|
+
this.setValue(targetValue, true, this.$props, undefined, false);
|
|
647
|
+
this.onValueSelectedHandler(targetValue, configureStore.causes.ENTER_PRESS);
|
|
648
|
+
}
|
|
627
649
|
}
|
|
628
650
|
// Need to review
|
|
629
651
|
this.$emit('keyDown', event, this.triggerQuery);
|
|
@@ -659,11 +681,16 @@ var DataSearch = {
|
|
|
659
681
|
}
|
|
660
682
|
},
|
|
661
683
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
684
|
+
var _this3 = this;
|
|
662
685
|
var value = this.$props.value;
|
|
663
686
|
// Record analytics for selected suggestions
|
|
664
687
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
665
688
|
if (value === undefined) {
|
|
666
689
|
this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
690
|
+
this.isSuggestionSelected = true;
|
|
691
|
+
setTimeout(function () {
|
|
692
|
+
_this3.isSuggestionSelected = false;
|
|
693
|
+
}, 50);
|
|
667
694
|
} else if (this.$options.isTagsMode) {
|
|
668
695
|
var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
669
696
|
if (this.selectedTags.includes(suggestion.value)) {
|
|
@@ -769,7 +796,7 @@ var DataSearch = {
|
|
|
769
796
|
return null;
|
|
770
797
|
},
|
|
771
798
|
renderTag: function renderTag(item) {
|
|
772
|
-
var
|
|
799
|
+
var _this4 = this;
|
|
773
800
|
var h = this.$createElement;
|
|
774
801
|
var innerClass = this.$props.innerClass;
|
|
775
802
|
return h(Tags.TagItem, {
|
|
@@ -782,7 +809,7 @@ var DataSearch = {
|
|
|
782
809
|
"class": "close-icon",
|
|
783
810
|
"on": {
|
|
784
811
|
"click": function click() {
|
|
785
|
-
return
|
|
812
|
+
return _this4.clearTag(item);
|
|
786
813
|
}
|
|
787
814
|
}
|
|
788
815
|
}, [h(CancelSvg.CancelSvg)])]);
|
|
@@ -804,7 +831,7 @@ var DataSearch = {
|
|
|
804
831
|
}
|
|
805
832
|
},
|
|
806
833
|
renderTags: function renderTags() {
|
|
807
|
-
var
|
|
834
|
+
var _this5 = this;
|
|
808
835
|
var h = this.$createElement;
|
|
809
836
|
if (!Array.isArray(this.selectedTags)) {
|
|
810
837
|
return null;
|
|
@@ -817,7 +844,7 @@ var DataSearch = {
|
|
|
817
844
|
handleClear: this.clearTag,
|
|
818
845
|
handleClearAll: this.clearAllTags
|
|
819
846
|
}) : h(Tags.TagsContainer, [tagsList.map(function (item) {
|
|
820
|
-
return
|
|
847
|
+
return _this5.renderTag(item);
|
|
821
848
|
}), shouldRenderClearAllTag && h(Tags.TagItem, {
|
|
822
849
|
"class": getClassName(this.$props.innerClass, 'selected-tag') || ''
|
|
823
850
|
}, [h("span", ["Clear All"]), h("span", {
|
|
@@ -896,7 +923,7 @@ var DataSearch = {
|
|
|
896
923
|
(_this$$refs = this.$refs) == null || (_this$$refs = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs.focus(); // eslint-disable-line
|
|
897
924
|
},
|
|
898
925
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
899
|
-
var
|
|
926
|
+
var _this6 = this;
|
|
900
927
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
901
928
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
902
929
|
if (index.isEmpty(focusShortcuts)) {
|
|
@@ -911,7 +938,7 @@ var DataSearch = {
|
|
|
911
938
|
function (event, handler) {
|
|
912
939
|
// Prevent the default refresh event under WINDOWS system
|
|
913
940
|
event.preventDefault();
|
|
914
|
-
|
|
941
|
+
_this6.focusSearchBox(event);
|
|
915
942
|
});
|
|
916
943
|
|
|
917
944
|
// if one of modifier keys are used, they are handled below
|
|
@@ -921,7 +948,7 @@ var DataSearch = {
|
|
|
921
948
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
922
949
|
var element = modifierKeys[index$1];
|
|
923
950
|
if (hotkeys[element]) {
|
|
924
|
-
|
|
951
|
+
_this6.focusSearchBox(event);
|
|
925
952
|
break;
|
|
926
953
|
}
|
|
927
954
|
}
|
|
@@ -929,7 +956,7 @@ var DataSearch = {
|
|
|
929
956
|
}
|
|
930
957
|
},
|
|
931
958
|
render: function render() {
|
|
932
|
-
var
|
|
959
|
+
var _this7 = this;
|
|
933
960
|
var h = arguments[0];
|
|
934
961
|
var _this$$props6 = this.$props,
|
|
935
962
|
theme = _this$$props6.theme,
|
|
@@ -964,14 +991,14 @@ var DataSearch = {
|
|
|
964
991
|
highlightedIndex = _ref4.highlightedIndex,
|
|
965
992
|
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
966
993
|
var renderSuggestionsContainer = function renderSuggestionsContainer() {
|
|
967
|
-
return h("div", [
|
|
994
|
+
return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
|
|
968
995
|
isOpen: isOpen,
|
|
969
996
|
getItemProps: getItemProps,
|
|
970
997
|
getItemEvents: getItemEvents,
|
|
971
998
|
highlightedIndex: highlightedIndex
|
|
972
|
-
}),
|
|
973
|
-
"class": Input.suggestions(
|
|
974
|
-
}, [
|
|
999
|
+
}), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
1000
|
+
"class": Input.suggestions(_this7.themePreset, theme) + " " + getClassName(_this7.$props.innerClass, 'list')
|
|
1001
|
+
}, [_this7.suggestionsList.slice(0, size || 10).map(function (item, index) {
|
|
975
1002
|
return h("li", {
|
|
976
1003
|
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
977
1004
|
item: item
|
|
@@ -981,15 +1008,15 @@ var DataSearch = {
|
|
|
981
1008
|
})),
|
|
982
1009
|
"key": index + 1 + "-" + item.value,
|
|
983
1010
|
"style": {
|
|
984
|
-
backgroundColor:
|
|
1011
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, index)
|
|
985
1012
|
}
|
|
986
1013
|
}, [h(Tags.SuggestionItem, {
|
|
987
1014
|
"attrs": {
|
|
988
|
-
"currentValue":
|
|
1015
|
+
"currentValue": _this7.currentValue,
|
|
989
1016
|
"suggestion": item
|
|
990
1017
|
}
|
|
991
1018
|
})]);
|
|
992
|
-
}),
|
|
1019
|
+
}), _this7.defaultSearchSuggestions.map(function (sugg, index) {
|
|
993
1020
|
return h("li", {
|
|
994
1021
|
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
995
1022
|
item: sugg
|
|
@@ -997,9 +1024,9 @@ var DataSearch = {
|
|
|
997
1024
|
"on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
|
|
998
1025
|
item: sugg
|
|
999
1026
|
})),
|
|
1000
|
-
"key":
|
|
1027
|
+
"key": _this7.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
1001
1028
|
"style": {
|
|
1002
|
-
backgroundColor:
|
|
1029
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, _this7.suggestionsList.length + index),
|
|
1003
1030
|
justifyContent: 'flex-start'
|
|
1004
1031
|
}
|
|
1005
1032
|
}, [h("div", {
|
|
@@ -1008,28 +1035,28 @@ var DataSearch = {
|
|
|
1008
1035
|
}
|
|
1009
1036
|
}, [sugg.source && sugg.source._recent_search && h(Tags.CustomSvg, {
|
|
1010
1037
|
"attrs": {
|
|
1011
|
-
"className": getClassName(
|
|
1038
|
+
"className": getClassName(_this7.$props.innerClass, 'recent-search-icon') || null,
|
|
1012
1039
|
"icon": recentSearchesIcon,
|
|
1013
1040
|
"type": "recent-search-icon"
|
|
1014
1041
|
}
|
|
1015
1042
|
}), sugg.source && sugg.source._popular_suggestion && h(Tags.CustomSvg, {
|
|
1016
1043
|
"attrs": {
|
|
1017
|
-
"className": getClassName(
|
|
1044
|
+
"className": getClassName(_this7.$props.innerClass, 'popular-search-icon') || null,
|
|
1018
1045
|
"icon": popularSearchesIcon,
|
|
1019
1046
|
"type": "popular-search-icon"
|
|
1020
1047
|
}
|
|
1021
1048
|
})]), h(Tags.SuggestionItem, {
|
|
1022
1049
|
"attrs": {
|
|
1023
|
-
"currentValue":
|
|
1050
|
+
"currentValue": _this7.currentValue,
|
|
1024
1051
|
"suggestion": sugg
|
|
1025
1052
|
}
|
|
1026
1053
|
})]);
|
|
1027
|
-
}), index.hasQuerySuggestionsRenderer(
|
|
1054
|
+
}), index.hasQuerySuggestionsRenderer(_this7) ? _this7.getComponent({
|
|
1028
1055
|
isOpen: isOpen,
|
|
1029
1056
|
getItemProps: getItemProps,
|
|
1030
1057
|
getItemEvents: getItemEvents,
|
|
1031
1058
|
highlightedIndex: highlightedIndex
|
|
1032
|
-
}, true) :
|
|
1059
|
+
}, true) : _this7.topSuggestions.map(function (sugg, index) {
|
|
1033
1060
|
return h("li", {
|
|
1034
1061
|
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
1035
1062
|
item: sugg
|
|
@@ -1037,9 +1064,9 @@ var DataSearch = {
|
|
|
1037
1064
|
"on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
|
|
1038
1065
|
item: sugg
|
|
1039
1066
|
})),
|
|
1040
|
-
"key":
|
|
1067
|
+
"key": _this7.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
1041
1068
|
"style": {
|
|
1042
|
-
backgroundColor:
|
|
1069
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, _this7.suggestionsList.length + index),
|
|
1043
1070
|
justifyContent: 'flex-start'
|
|
1044
1071
|
}
|
|
1045
1072
|
}, [h("div", {
|
|
@@ -1048,58 +1075,58 @@ var DataSearch = {
|
|
|
1048
1075
|
}
|
|
1049
1076
|
}, [h(Tags.CustomSvg, {
|
|
1050
1077
|
"attrs": {
|
|
1051
|
-
"className": getClassName(
|
|
1078
|
+
"className": getClassName(_this7.$props.innerClass, 'popular-search-icon') || null,
|
|
1052
1079
|
"icon": popularSearchesIcon,
|
|
1053
1080
|
"type": "popular-search-icon"
|
|
1054
1081
|
}
|
|
1055
1082
|
})]), h(Tags.SuggestionItem, {
|
|
1056
1083
|
"attrs": {
|
|
1057
|
-
"currentValue":
|
|
1084
|
+
"currentValue": _this7.currentValue,
|
|
1058
1085
|
"suggestion": sugg
|
|
1059
1086
|
}
|
|
1060
1087
|
})]);
|
|
1061
|
-
})]) :
|
|
1088
|
+
})]) : _this7.renderNoSuggestions(_this7.suggestionsList)]);
|
|
1062
1089
|
};
|
|
1063
1090
|
return h("div", {
|
|
1064
1091
|
"class": Input.suggestionsContainer
|
|
1065
|
-
}, [h(Tags.InputGroup, [
|
|
1092
|
+
}, [h(Tags.InputGroup, [_this7.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1066
1093
|
"attrs": {
|
|
1067
|
-
"id":
|
|
1068
|
-
"showIcon":
|
|
1069
|
-
"showClear":
|
|
1070
|
-
"iconPosition":
|
|
1071
|
-
"placeholder":
|
|
1072
|
-
"autoFocus":
|
|
1073
|
-
"themePreset":
|
|
1094
|
+
"id": _this7.$props.componentId + "-input",
|
|
1095
|
+
"showIcon": _this7.$props.showIcon,
|
|
1096
|
+
"showClear": _this7.$props.showClear,
|
|
1097
|
+
"iconPosition": _this7.$props.iconPosition,
|
|
1098
|
+
"placeholder": _this7.$props.placeholder,
|
|
1099
|
+
"autoFocus": _this7.$props.autoFocus,
|
|
1100
|
+
"themePreset": _this7.themePreset,
|
|
1074
1101
|
"autocomplete": "off"
|
|
1075
1102
|
},
|
|
1076
|
-
"ref":
|
|
1077
|
-
"class": getClassName(
|
|
1103
|
+
"ref": _this7.$props.innerRef,
|
|
1104
|
+
"class": getClassName(_this7.$props.innerClass, 'input'),
|
|
1078
1105
|
"on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
|
|
1079
|
-
onInput:
|
|
1106
|
+
onInput: _this7.onInputChange,
|
|
1080
1107
|
onBlur: function onBlur(e) {
|
|
1081
|
-
|
|
1108
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
1082
1109
|
},
|
|
1083
|
-
onFocus:
|
|
1110
|
+
onFocus: _this7.handleFocus,
|
|
1084
1111
|
onKeyPress: function onKeyPress(e) {
|
|
1085
|
-
|
|
1086
|
-
|
|
1112
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
1113
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
1087
1114
|
},
|
|
1088
1115
|
onKeyDown: function onKeyDown(e) {
|
|
1089
|
-
return
|
|
1116
|
+
return _this7.handleKeyDown(e, highlightedIndex);
|
|
1090
1117
|
},
|
|
1091
1118
|
onKeyUp: function onKeyUp(e) {
|
|
1092
|
-
|
|
1093
|
-
|
|
1119
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
1120
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
1094
1121
|
},
|
|
1095
1122
|
onClick: function onClick() {
|
|
1096
1123
|
setHighlightedIndex(null);
|
|
1097
1124
|
}
|
|
1098
1125
|
})),
|
|
1099
1126
|
"domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
|
|
1100
|
-
value:
|
|
1127
|
+
value: _this7.$data.currentValue === null || typeof _this7.$data.currentValue !== 'string' ? '' : _this7.$data.currentValue
|
|
1101
1128
|
}))
|
|
1102
|
-
}),
|
|
1129
|
+
}), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this7.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this7.renderTags()]);
|
|
1103
1130
|
}
|
|
1104
1131
|
}
|
|
1105
1132
|
}) : h("div", {
|
|
@@ -1115,22 +1142,22 @@ var DataSearch = {
|
|
|
1115
1142
|
},
|
|
1116
1143
|
"on": _rollupPluginBabelHelpers._extends({}, {
|
|
1117
1144
|
blur: function blur(e) {
|
|
1118
|
-
|
|
1145
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
1119
1146
|
},
|
|
1120
1147
|
keypress: function keypress(e) {
|
|
1121
|
-
|
|
1122
|
-
|
|
1148
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
1149
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
1123
1150
|
},
|
|
1124
1151
|
input: this.onInputChange,
|
|
1125
1152
|
focus: function focus(e) {
|
|
1126
|
-
|
|
1153
|
+
_this7.$emit('focus', e, _this7.triggerQuery);
|
|
1127
1154
|
},
|
|
1128
1155
|
keydown: function keydown(e) {
|
|
1129
|
-
|
|
1156
|
+
_this7.handleKeyDown(e, null);
|
|
1130
1157
|
},
|
|
1131
1158
|
keyup: function keyup(e) {
|
|
1132
|
-
|
|
1133
|
-
|
|
1159
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
1160
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
1134
1161
|
}
|
|
1135
1162
|
}),
|
|
1136
1163
|
"domProps": _rollupPluginBabelHelpers._extends({}, {
|