@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/es/DataSearch.js
CHANGED
|
@@ -53,7 +53,8 @@ var DataSearch = {
|
|
|
53
53
|
selectedTags: [],
|
|
54
54
|
isOpen: false,
|
|
55
55
|
normalizedSuggestions: [],
|
|
56
|
-
isPending: false
|
|
56
|
+
isPending: false,
|
|
57
|
+
isSuggestionSelected: false
|
|
57
58
|
};
|
|
58
59
|
this.internalComponent = props.componentId + "__internal";
|
|
59
60
|
return this.__state;
|
|
@@ -123,7 +124,7 @@ var DataSearch = {
|
|
|
123
124
|
normalizedPopularSuggestions: function normalizedPopularSuggestions() {
|
|
124
125
|
return getTopSuggestions(
|
|
125
126
|
// use default popular suggestions if value is empty
|
|
126
|
-
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue, this.showDistinctSuggestions);
|
|
127
|
+
this.currentValue ? this.popularSuggestions : this.defaultPopularSuggestions || [], this.currentValue || '', this.showDistinctSuggestions);
|
|
127
128
|
},
|
|
128
129
|
defaultSearchSuggestions: function defaultSearchSuggestions() {
|
|
129
130
|
var isPopularSuggestionsEnabled = this.enablePopularSuggestions;
|
|
@@ -143,7 +144,7 @@ var DataSearch = {
|
|
|
143
144
|
var defaultSuggestions = isPopularSuggestionsEnabled ? [].concat(customNormalizedRecentSearches, customDefaultPopularSuggestions || []) : customNormalizedRecentSearches;
|
|
144
145
|
return getTopSuggestions(
|
|
145
146
|
// use default popular suggestions if value is empty
|
|
146
|
-
defaultSuggestions, this.currentValue, this.showDistinctSuggestions);
|
|
147
|
+
defaultSuggestions, this.currentValue || '', this.showDistinctSuggestions);
|
|
147
148
|
},
|
|
148
149
|
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
149
150
|
return hasCustomRenderer(this);
|
|
@@ -293,23 +294,12 @@ var DataSearch = {
|
|
|
293
294
|
this.updateQueryHandler(this.componentId, this.$data.currentValue, this.$props);
|
|
294
295
|
}
|
|
295
296
|
},
|
|
296
|
-
isLoading: function isLoading(newVal) {
|
|
297
|
-
if (newVal) {
|
|
298
|
-
this.suggestions = [];
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
297
|
suggestions: function suggestions(newVal) {
|
|
302
|
-
if (this.isLoading) {
|
|
303
|
-
this.normalizedSuggestions = [];
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
298
|
if (Array.isArray(newVal) && this.$data.currentValue.trim().length) {
|
|
307
299
|
// shallow check allows us to set suggestions even if the next set
|
|
308
300
|
// of suggestions are same as the current one
|
|
309
301
|
this.$emit('suggestions', newVal);
|
|
310
|
-
|
|
311
|
-
this.normalizedSuggestions = this.onSuggestions(newVal);
|
|
312
|
-
}
|
|
302
|
+
this.normalizedSuggestions = this.onSuggestions(newVal);
|
|
313
303
|
}
|
|
314
304
|
},
|
|
315
305
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
@@ -414,7 +404,7 @@ var DataSearch = {
|
|
|
414
404
|
return queryOptions;
|
|
415
405
|
},
|
|
416
406
|
onSuggestions: function onSuggestions(results) {
|
|
417
|
-
return handleOnSuggestions(results, this.$data.currentValue, this);
|
|
407
|
+
return handleOnSuggestions(results, this.$data.currentValue || '', this);
|
|
418
408
|
},
|
|
419
409
|
handleSearchIconClick: function handleSearchIconClick() {
|
|
420
410
|
var currentValue = this.currentValue;
|
|
@@ -442,11 +432,13 @@ var DataSearch = {
|
|
|
442
432
|
if (isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
443
433
|
return;
|
|
444
434
|
}
|
|
445
|
-
|
|
446
|
-
|
|
435
|
+
if (!value && props.enableDefaultSuggestions === false) {
|
|
436
|
+
_this.resetStoreForComponent(props.componentId);
|
|
437
|
+
} else if (!value && _this.currentValue && _this.enableRecentSearches) {
|
|
447
438
|
_this.getRecentSearches();
|
|
448
439
|
}
|
|
449
440
|
if (isTagsMode) {
|
|
441
|
+
var isTagAdded = false;
|
|
450
442
|
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
451
443
|
// check if value already present in selectedTags
|
|
452
444
|
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
@@ -455,14 +447,36 @@ var DataSearch = {
|
|
|
455
447
|
}
|
|
456
448
|
_this.selectedTags = [].concat(_this.selectedTags);
|
|
457
449
|
if (typeof value === 'string' && !!value) {
|
|
458
|
-
|
|
450
|
+
if (props.strictSelection && cause === causes.SUGGESTION_SELECT) {
|
|
451
|
+
_this.selectedTags.push(value);
|
|
452
|
+
isTagAdded = true;
|
|
453
|
+
} else if (!props.strictSelection) {
|
|
454
|
+
_this.selectedTags.push(value);
|
|
455
|
+
isTagAdded = true;
|
|
456
|
+
}
|
|
459
457
|
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
460
|
-
|
|
458
|
+
if (props.strictSelection && cause === causes.SUGGESTION_SELECT) {
|
|
459
|
+
_this.selectedTags = value;
|
|
460
|
+
isTagAdded = true;
|
|
461
|
+
} else if (!props.strictSelection) {
|
|
462
|
+
_this.selectedTags.push(value);
|
|
463
|
+
isTagAdded = true;
|
|
464
|
+
}
|
|
461
465
|
}
|
|
462
466
|
} else if (value) {
|
|
463
|
-
|
|
467
|
+
if (props.strictSelection && cause === causes.SUGGESTION_SELECT) {
|
|
468
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
469
|
+
isTagAdded = true;
|
|
470
|
+
} else if (!props.strictSelection) {
|
|
471
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
472
|
+
isTagAdded = true;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (props.strictSelection && !isTagAdded && typeof value === 'string') {
|
|
476
|
+
_this.currentValue = value;
|
|
477
|
+
} else {
|
|
478
|
+
_this.currentValue = '';
|
|
464
479
|
}
|
|
465
|
-
_this.currentValue = '';
|
|
466
480
|
} else {
|
|
467
481
|
_this.currentValue = value;
|
|
468
482
|
}
|
|
@@ -482,7 +496,7 @@ var DataSearch = {
|
|
|
482
496
|
if (props.strictSelection && props.autosuggest) {
|
|
483
497
|
if (cause === causes.SUGGESTION_SELECT || props.value !== undefined) {
|
|
484
498
|
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
485
|
-
} else if (_this.currentValue !== '') {
|
|
499
|
+
} else if (_this.currentValue !== '' && !props.strictSelection) {
|
|
486
500
|
_this.setValue('', true);
|
|
487
501
|
}
|
|
488
502
|
} else {
|
|
@@ -496,7 +510,7 @@ var DataSearch = {
|
|
|
496
510
|
_this.$emit('value-change', value);
|
|
497
511
|
// Set the already fetched suggestions if query is same as used last to fetch the hits
|
|
498
512
|
if (value === _this.lastUsedQuery) {
|
|
499
|
-
_this.
|
|
513
|
+
_this.normalizedSuggestions = _this.onSuggestions(_this.suggestions);
|
|
500
514
|
// invoke on suggestions
|
|
501
515
|
_this.$emit('suggestions', _this.suggestions);
|
|
502
516
|
} else if (!value) {
|
|
@@ -524,13 +538,18 @@ var DataSearch = {
|
|
|
524
538
|
// Update calculated default query in store
|
|
525
539
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
526
540
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
541
|
+
if (!value && props.enableDefaultSuggestions === false) {
|
|
542
|
+
// clear Component data from store
|
|
543
|
+
this.resetStoreForComponent(props.componentId);
|
|
544
|
+
} else {
|
|
545
|
+
this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), execute);
|
|
546
|
+
this.updateQuery({
|
|
547
|
+
componentId: this.internalComponent,
|
|
548
|
+
query: query,
|
|
549
|
+
value: value,
|
|
550
|
+
componentType: componentTypes.dataSearch
|
|
551
|
+
}, execute);
|
|
552
|
+
}
|
|
534
553
|
},
|
|
535
554
|
updateQueryHandler: function updateQueryHandler(componentId, value, props) {
|
|
536
555
|
var customQuery = props.customQuery,
|
|
@@ -599,24 +618,27 @@ var DataSearch = {
|
|
|
599
618
|
},
|
|
600
619
|
clearValue: function clearValue() {
|
|
601
620
|
this.isPending = false;
|
|
602
|
-
this.
|
|
621
|
+
if (!this.$props.enableDefaultSuggestions) {
|
|
622
|
+
this.isOpen = false;
|
|
623
|
+
}
|
|
624
|
+
this.setValue('', false);
|
|
603
625
|
this.onValueSelectedHandler('', causes.CLEAR_VALUE);
|
|
604
626
|
},
|
|
605
627
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
606
628
|
var targetValue = event.target.value;
|
|
607
629
|
var _this$$props2 = this.$props,
|
|
608
630
|
value = _this$$props2.value,
|
|
609
|
-
|
|
610
|
-
size = _this$$props2.size,
|
|
611
|
-
autosuggest = _this$$props2.autosuggest;
|
|
631
|
+
size = _this$$props2.size;
|
|
612
632
|
if (value !== undefined) {
|
|
613
633
|
this.isPending = true;
|
|
614
634
|
}
|
|
615
635
|
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
616
636
|
if (event.key === 'Enter' && (highlightedIndex === null || highlightedIndex < 0 || highlightedIndex === [].concat([].concat(this.suggestionsList).slice(0, size || 10), this.defaultSearchSuggestions, this.topSuggestions).length)) {
|
|
617
637
|
this.isPending = false;
|
|
618
|
-
|
|
619
|
-
|
|
638
|
+
if (!this.isSuggestionSelected) {
|
|
639
|
+
this.setValue(targetValue, true, this.$props, undefined, false);
|
|
640
|
+
this.onValueSelectedHandler(targetValue, causes.ENTER_PRESS);
|
|
641
|
+
}
|
|
620
642
|
}
|
|
621
643
|
// Need to review
|
|
622
644
|
this.$emit('keyDown', event, this.triggerQuery);
|
|
@@ -652,11 +674,16 @@ var DataSearch = {
|
|
|
652
674
|
}
|
|
653
675
|
},
|
|
654
676
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
677
|
+
var _this3 = this;
|
|
655
678
|
var value = this.$props.value;
|
|
656
679
|
// Record analytics for selected suggestions
|
|
657
680
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
658
681
|
if (value === undefined) {
|
|
659
682
|
this.setValue(suggestion.value, true, this.$props, causes.SUGGESTION_SELECT);
|
|
683
|
+
this.isSuggestionSelected = true;
|
|
684
|
+
setTimeout(function () {
|
|
685
|
+
_this3.isSuggestionSelected = false;
|
|
686
|
+
}, 50);
|
|
660
687
|
} else if (this.$options.isTagsMode) {
|
|
661
688
|
var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
662
689
|
if (this.selectedTags.includes(suggestion.value)) {
|
|
@@ -762,7 +789,7 @@ var DataSearch = {
|
|
|
762
789
|
return null;
|
|
763
790
|
},
|
|
764
791
|
renderTag: function renderTag(item) {
|
|
765
|
-
var
|
|
792
|
+
var _this4 = this;
|
|
766
793
|
var h = this.$createElement;
|
|
767
794
|
var innerClass = this.$props.innerClass;
|
|
768
795
|
return h(TagItem, {
|
|
@@ -775,7 +802,7 @@ var DataSearch = {
|
|
|
775
802
|
"class": "close-icon",
|
|
776
803
|
"on": {
|
|
777
804
|
"click": function click() {
|
|
778
|
-
return
|
|
805
|
+
return _this4.clearTag(item);
|
|
779
806
|
}
|
|
780
807
|
}
|
|
781
808
|
}, [h(CancelSvg)])]);
|
|
@@ -797,7 +824,7 @@ var DataSearch = {
|
|
|
797
824
|
}
|
|
798
825
|
},
|
|
799
826
|
renderTags: function renderTags() {
|
|
800
|
-
var
|
|
827
|
+
var _this5 = this;
|
|
801
828
|
var h = this.$createElement;
|
|
802
829
|
if (!Array.isArray(this.selectedTags)) {
|
|
803
830
|
return null;
|
|
@@ -810,7 +837,7 @@ var DataSearch = {
|
|
|
810
837
|
handleClear: this.clearTag,
|
|
811
838
|
handleClearAll: this.clearAllTags
|
|
812
839
|
}) : h(TagsContainer, [tagsList.map(function (item) {
|
|
813
|
-
return
|
|
840
|
+
return _this5.renderTag(item);
|
|
814
841
|
}), shouldRenderClearAllTag && h(TagItem, {
|
|
815
842
|
"class": getClassName(this.$props.innerClass, 'selected-tag') || ''
|
|
816
843
|
}, [h("span", ["Clear All"]), h("span", {
|
|
@@ -889,7 +916,7 @@ var DataSearch = {
|
|
|
889
916
|
(_this$$refs = this.$refs) == null || (_this$$refs = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs.focus(); // eslint-disable-line
|
|
890
917
|
},
|
|
891
918
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
892
|
-
var
|
|
919
|
+
var _this6 = this;
|
|
893
920
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
894
921
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
895
922
|
if (isEmpty(focusShortcuts)) {
|
|
@@ -904,7 +931,7 @@ var DataSearch = {
|
|
|
904
931
|
function (event, handler) {
|
|
905
932
|
// Prevent the default refresh event under WINDOWS system
|
|
906
933
|
event.preventDefault();
|
|
907
|
-
|
|
934
|
+
_this6.focusSearchBox(event);
|
|
908
935
|
});
|
|
909
936
|
|
|
910
937
|
// if one of modifier keys are used, they are handled below
|
|
@@ -914,7 +941,7 @@ var DataSearch = {
|
|
|
914
941
|
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
915
942
|
var element = modifierKeys[index];
|
|
916
943
|
if (hotkeys[element]) {
|
|
917
|
-
|
|
944
|
+
_this6.focusSearchBox(event);
|
|
918
945
|
break;
|
|
919
946
|
}
|
|
920
947
|
}
|
|
@@ -922,7 +949,7 @@ var DataSearch = {
|
|
|
922
949
|
}
|
|
923
950
|
},
|
|
924
951
|
render: function render() {
|
|
925
|
-
var
|
|
952
|
+
var _this7 = this;
|
|
926
953
|
var h = arguments[0];
|
|
927
954
|
var _this$$props6 = this.$props,
|
|
928
955
|
theme = _this$$props6.theme,
|
|
@@ -957,14 +984,14 @@ var DataSearch = {
|
|
|
957
984
|
highlightedIndex = _ref4.highlightedIndex,
|
|
958
985
|
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
959
986
|
var renderSuggestionsContainer = function renderSuggestionsContainer() {
|
|
960
|
-
return h("div", [
|
|
987
|
+
return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
|
|
961
988
|
isOpen: isOpen,
|
|
962
989
|
getItemProps: getItemProps,
|
|
963
990
|
getItemEvents: getItemEvents,
|
|
964
991
|
highlightedIndex: highlightedIndex
|
|
965
|
-
}),
|
|
966
|
-
"class": suggestions(
|
|
967
|
-
}, [
|
|
992
|
+
}), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
993
|
+
"class": suggestions(_this7.themePreset, theme) + " " + getClassName(_this7.$props.innerClass, 'list')
|
|
994
|
+
}, [_this7.suggestionsList.slice(0, size || 10).map(function (item, index) {
|
|
968
995
|
return h("li", {
|
|
969
996
|
"domProps": _extends({}, getItemProps({
|
|
970
997
|
item: item
|
|
@@ -974,15 +1001,15 @@ var DataSearch = {
|
|
|
974
1001
|
})),
|
|
975
1002
|
"key": index + 1 + "-" + item.value,
|
|
976
1003
|
"style": {
|
|
977
|
-
backgroundColor:
|
|
1004
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, index)
|
|
978
1005
|
}
|
|
979
1006
|
}, [h(SuggestionItem, {
|
|
980
1007
|
"attrs": {
|
|
981
|
-
"currentValue":
|
|
1008
|
+
"currentValue": _this7.currentValue,
|
|
982
1009
|
"suggestion": item
|
|
983
1010
|
}
|
|
984
1011
|
})]);
|
|
985
|
-
}),
|
|
1012
|
+
}), _this7.defaultSearchSuggestions.map(function (sugg, index) {
|
|
986
1013
|
return h("li", {
|
|
987
1014
|
"domProps": _extends({}, getItemProps({
|
|
988
1015
|
item: sugg
|
|
@@ -990,9 +1017,9 @@ var DataSearch = {
|
|
|
990
1017
|
"on": _extends({}, getItemEvents({
|
|
991
1018
|
item: sugg
|
|
992
1019
|
})),
|
|
993
|
-
"key":
|
|
1020
|
+
"key": _this7.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
994
1021
|
"style": {
|
|
995
|
-
backgroundColor:
|
|
1022
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, _this7.suggestionsList.length + index),
|
|
996
1023
|
justifyContent: 'flex-start'
|
|
997
1024
|
}
|
|
998
1025
|
}, [h("div", {
|
|
@@ -1001,28 +1028,28 @@ var DataSearch = {
|
|
|
1001
1028
|
}
|
|
1002
1029
|
}, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
|
|
1003
1030
|
"attrs": {
|
|
1004
|
-
"className": getClassName(
|
|
1031
|
+
"className": getClassName(_this7.$props.innerClass, 'recent-search-icon') || null,
|
|
1005
1032
|
"icon": recentSearchesIcon,
|
|
1006
1033
|
"type": "recent-search-icon"
|
|
1007
1034
|
}
|
|
1008
1035
|
}), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
|
|
1009
1036
|
"attrs": {
|
|
1010
|
-
"className": getClassName(
|
|
1037
|
+
"className": getClassName(_this7.$props.innerClass, 'popular-search-icon') || null,
|
|
1011
1038
|
"icon": popularSearchesIcon,
|
|
1012
1039
|
"type": "popular-search-icon"
|
|
1013
1040
|
}
|
|
1014
1041
|
})]), h(SuggestionItem, {
|
|
1015
1042
|
"attrs": {
|
|
1016
|
-
"currentValue":
|
|
1043
|
+
"currentValue": _this7.currentValue,
|
|
1017
1044
|
"suggestion": sugg
|
|
1018
1045
|
}
|
|
1019
1046
|
})]);
|
|
1020
|
-
}), hasQuerySuggestionsRenderer(
|
|
1047
|
+
}), hasQuerySuggestionsRenderer(_this7) ? _this7.getComponent({
|
|
1021
1048
|
isOpen: isOpen,
|
|
1022
1049
|
getItemProps: getItemProps,
|
|
1023
1050
|
getItemEvents: getItemEvents,
|
|
1024
1051
|
highlightedIndex: highlightedIndex
|
|
1025
|
-
}, true) :
|
|
1052
|
+
}, true) : _this7.topSuggestions.map(function (sugg, index) {
|
|
1026
1053
|
return h("li", {
|
|
1027
1054
|
"domProps": _extends({}, getItemProps({
|
|
1028
1055
|
item: sugg
|
|
@@ -1030,9 +1057,9 @@ var DataSearch = {
|
|
|
1030
1057
|
"on": _extends({}, getItemEvents({
|
|
1031
1058
|
item: sugg
|
|
1032
1059
|
})),
|
|
1033
|
-
"key":
|
|
1060
|
+
"key": _this7.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
1034
1061
|
"style": {
|
|
1035
|
-
backgroundColor:
|
|
1062
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, _this7.suggestionsList.length + index),
|
|
1036
1063
|
justifyContent: 'flex-start'
|
|
1037
1064
|
}
|
|
1038
1065
|
}, [h("div", {
|
|
@@ -1041,58 +1068,58 @@ var DataSearch = {
|
|
|
1041
1068
|
}
|
|
1042
1069
|
}, [h(CustomSvg, {
|
|
1043
1070
|
"attrs": {
|
|
1044
|
-
"className": getClassName(
|
|
1071
|
+
"className": getClassName(_this7.$props.innerClass, 'popular-search-icon') || null,
|
|
1045
1072
|
"icon": popularSearchesIcon,
|
|
1046
1073
|
"type": "popular-search-icon"
|
|
1047
1074
|
}
|
|
1048
1075
|
})]), h(SuggestionItem, {
|
|
1049
1076
|
"attrs": {
|
|
1050
|
-
"currentValue":
|
|
1077
|
+
"currentValue": _this7.currentValue,
|
|
1051
1078
|
"suggestion": sugg
|
|
1052
1079
|
}
|
|
1053
1080
|
})]);
|
|
1054
|
-
})]) :
|
|
1081
|
+
})]) : _this7.renderNoSuggestions(_this7.suggestionsList)]);
|
|
1055
1082
|
};
|
|
1056
1083
|
return h("div", {
|
|
1057
1084
|
"class": suggestionsContainer
|
|
1058
|
-
}, [h(InputGroup, [
|
|
1085
|
+
}, [h(InputGroup, [_this7.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
1059
1086
|
"attrs": {
|
|
1060
|
-
"id":
|
|
1061
|
-
"showIcon":
|
|
1062
|
-
"showClear":
|
|
1063
|
-
"iconPosition":
|
|
1064
|
-
"placeholder":
|
|
1065
|
-
"autoFocus":
|
|
1066
|
-
"themePreset":
|
|
1087
|
+
"id": _this7.$props.componentId + "-input",
|
|
1088
|
+
"showIcon": _this7.$props.showIcon,
|
|
1089
|
+
"showClear": _this7.$props.showClear,
|
|
1090
|
+
"iconPosition": _this7.$props.iconPosition,
|
|
1091
|
+
"placeholder": _this7.$props.placeholder,
|
|
1092
|
+
"autoFocus": _this7.$props.autoFocus,
|
|
1093
|
+
"themePreset": _this7.themePreset,
|
|
1067
1094
|
"autocomplete": "off"
|
|
1068
1095
|
},
|
|
1069
|
-
"ref":
|
|
1070
|
-
"class": getClassName(
|
|
1096
|
+
"ref": _this7.$props.innerRef,
|
|
1097
|
+
"class": getClassName(_this7.$props.innerClass, 'input'),
|
|
1071
1098
|
"on": _extends({}, getInputEvents({
|
|
1072
|
-
onInput:
|
|
1099
|
+
onInput: _this7.onInputChange,
|
|
1073
1100
|
onBlur: function onBlur(e) {
|
|
1074
|
-
|
|
1101
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
1075
1102
|
},
|
|
1076
|
-
onFocus:
|
|
1103
|
+
onFocus: _this7.handleFocus,
|
|
1077
1104
|
onKeyPress: function onKeyPress(e) {
|
|
1078
|
-
|
|
1079
|
-
|
|
1105
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
1106
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
1080
1107
|
},
|
|
1081
1108
|
onKeyDown: function onKeyDown(e) {
|
|
1082
|
-
return
|
|
1109
|
+
return _this7.handleKeyDown(e, highlightedIndex);
|
|
1083
1110
|
},
|
|
1084
1111
|
onKeyUp: function onKeyUp(e) {
|
|
1085
|
-
|
|
1086
|
-
|
|
1112
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
1113
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
1087
1114
|
},
|
|
1088
1115
|
onClick: function onClick() {
|
|
1089
1116
|
setHighlightedIndex(null);
|
|
1090
1117
|
}
|
|
1091
1118
|
})),
|
|
1092
1119
|
"domProps": _extends({}, getInputProps({
|
|
1093
|
-
value:
|
|
1120
|
+
value: _this7.$data.currentValue === null || typeof _this7.$data.currentValue !== 'string' ? '' : _this7.$data.currentValue
|
|
1094
1121
|
}))
|
|
1095
|
-
}),
|
|
1122
|
+
}), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this7.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this7.renderTags()]);
|
|
1096
1123
|
}
|
|
1097
1124
|
}
|
|
1098
1125
|
}) : h("div", {
|
|
@@ -1108,22 +1135,22 @@ var DataSearch = {
|
|
|
1108
1135
|
},
|
|
1109
1136
|
"on": _extends({}, {
|
|
1110
1137
|
blur: function blur(e) {
|
|
1111
|
-
|
|
1138
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
1112
1139
|
},
|
|
1113
1140
|
keypress: function keypress(e) {
|
|
1114
|
-
|
|
1115
|
-
|
|
1141
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
1142
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
1116
1143
|
},
|
|
1117
1144
|
input: this.onInputChange,
|
|
1118
1145
|
focus: function focus(e) {
|
|
1119
|
-
|
|
1146
|
+
_this7.$emit('focus', e, _this7.triggerQuery);
|
|
1120
1147
|
},
|
|
1121
1148
|
keydown: function keydown(e) {
|
|
1122
|
-
|
|
1149
|
+
_this7.handleKeyDown(e, null);
|
|
1123
1150
|
},
|
|
1124
1151
|
keyup: function keyup(e) {
|
|
1125
|
-
|
|
1126
|
-
|
|
1152
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
1153
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
1127
1154
|
}
|
|
1128
1155
|
}),
|
|
1129
1156
|
"domProps": _extends({}, {
|