@appbaseio/reactivesearch-vue 2.0.0-alpha.3 → 2.0.0-alpha.4
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 +168 -110
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +3 -3
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{DataSearch-6cf29cf0.js → DataSearch-aa04dc6e.js} +115 -86
- package/dist/cjs/DataSearch.js +1 -1
- package/dist/cjs/StateProvider.js +46 -16
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/initReactivesearch.js +7 -3
- package/dist/cjs/{install-42ba1d44.js → install-b97dbac4.js} +1 -1
- package/dist/cjs/install.js +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/es/{DataSearch-4888aa43.js → DataSearch-b86a6675.js} +115 -86
- package/dist/es/DataSearch.js +1 -1
- package/dist/es/StateProvider.js +46 -16
- package/dist/es/index.js +3 -3
- package/dist/es/initReactivesearch.js +7 -3
- package/dist/es/{install-80bc2764.js → install-ac8a1edb.js} +1 -1
- package/dist/es/install.js +2 -2
- package/dist/es/version.js +1 -1
- package/package.json +2 -2
|
@@ -7807,10 +7807,6 @@
|
|
|
7807
7807
|
|
|
7808
7808
|
var endpoint = void 0;
|
|
7809
7809
|
|
|
7810
|
-
if (store.config && store.config.endpoint instanceof Object) {
|
|
7811
|
-
endpoint = store.config.endpoint;
|
|
7812
|
-
}
|
|
7813
|
-
|
|
7814
7810
|
if (componentProps.endpoint instanceof Object) {
|
|
7815
7811
|
endpoint = _extends({}, endpoint || {}, componentProps.endpoint);
|
|
7816
7812
|
}
|
|
@@ -20979,7 +20975,11 @@
|
|
|
20979
20975
|
},
|
|
20980
20976
|
value: function value(newVal, oldVal) {
|
|
20981
20977
|
if (!isEqual$4(newVal, oldVal)) {
|
|
20982
|
-
this.
|
|
20978
|
+
if (this.isPending && this.$options.isTagsMode && Array.isArray(newVal)) {
|
|
20979
|
+
this.isPending = false;
|
|
20980
|
+
}
|
|
20981
|
+
|
|
20982
|
+
this.setValue(newVal, true, this.$props, undefined, false, typeof newVal !== 'string' && this.$options.isTagsMode);
|
|
20983
20983
|
}
|
|
20984
20984
|
},
|
|
20985
20985
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -21123,7 +21123,7 @@
|
|
|
21123
21123
|
this.onValueSelectedHandler(currentValue, lib_7.SEARCH_ICON_CLICK);
|
|
21124
21124
|
}
|
|
21125
21125
|
},
|
|
21126
|
-
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen) {
|
|
21126
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, isTagsMode) {
|
|
21127
21127
|
var _this = this;
|
|
21128
21128
|
|
|
21129
21129
|
if (isDefaultValue === void 0) {
|
|
@@ -21138,8 +21138,12 @@
|
|
|
21138
21138
|
toggleIsOpen = true;
|
|
21139
21139
|
}
|
|
21140
21140
|
|
|
21141
|
+
if (isTagsMode === void 0) {
|
|
21142
|
+
isTagsMode = this.$options.isTagsMode;
|
|
21143
|
+
}
|
|
21144
|
+
|
|
21141
21145
|
var performUpdate = function performUpdate() {
|
|
21142
|
-
if (
|
|
21146
|
+
if (isTagsMode && isEqual$4(value, _this.selectedTags)) {
|
|
21143
21147
|
return;
|
|
21144
21148
|
} // Refresh recent searches when value becomes empty
|
|
21145
21149
|
|
|
@@ -21150,7 +21154,7 @@
|
|
|
21150
21154
|
_this.getRecentSearches();
|
|
21151
21155
|
}
|
|
21152
21156
|
|
|
21153
|
-
if (
|
|
21157
|
+
if (isTagsMode) {
|
|
21154
21158
|
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
21155
21159
|
// check if value already present in selectedTags
|
|
21156
21160
|
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
@@ -21177,7 +21181,7 @@
|
|
|
21177
21181
|
|
|
21178
21182
|
var queryHandlerValue = value;
|
|
21179
21183
|
|
|
21180
|
-
if (
|
|
21184
|
+
if (isTagsMode) {
|
|
21181
21185
|
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
21182
21186
|
}
|
|
21183
21187
|
|
|
@@ -21355,19 +21359,40 @@
|
|
|
21355
21359
|
this.$emit('key-down', event, this.triggerQuery);
|
|
21356
21360
|
},
|
|
21357
21361
|
onInputChange: function onInputChange(e) {
|
|
21362
|
+
var _this2 = this;
|
|
21363
|
+
|
|
21358
21364
|
var inputValue = e.target.value;
|
|
21359
21365
|
|
|
21360
21366
|
if (!this.$data.isOpen) {
|
|
21361
21367
|
this.isOpen = true;
|
|
21362
21368
|
}
|
|
21363
21369
|
|
|
21364
|
-
var
|
|
21370
|
+
var _this$$props2 = this.$props,
|
|
21371
|
+
value = _this$$props2.value,
|
|
21372
|
+
autosuggest = _this$$props2.autosuggest;
|
|
21365
21373
|
|
|
21366
21374
|
if (value === undefined) {
|
|
21367
|
-
this.setValue(inputValue);
|
|
21375
|
+
this.setValue(inputValue, false, this.$props, undefined, true, false);
|
|
21368
21376
|
} else {
|
|
21369
21377
|
this.isPending = true;
|
|
21370
|
-
this.$emit('change', inputValue,
|
|
21378
|
+
this.$emit('change', inputValue, function (_temp2) {
|
|
21379
|
+
var _ref3 = _temp2 === void 0 ? {} : _temp2,
|
|
21380
|
+
_ref3$isOpen = _ref3.isOpen,
|
|
21381
|
+
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen;
|
|
21382
|
+
|
|
21383
|
+
if (_this2.$options.isTagsMode && autosuggest) {
|
|
21384
|
+
_this2.currentValue = value;
|
|
21385
|
+
_this2.isOpen = isOpen;
|
|
21386
|
+
|
|
21387
|
+
_this2.updateDefaultQueryHandler(_this2.currentValue, _this2.$props);
|
|
21388
|
+
|
|
21389
|
+
return;
|
|
21390
|
+
}
|
|
21391
|
+
|
|
21392
|
+
_this2.triggerQuery({
|
|
21393
|
+
isOpen: isOpen
|
|
21394
|
+
});
|
|
21395
|
+
}, e);
|
|
21371
21396
|
}
|
|
21372
21397
|
},
|
|
21373
21398
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
@@ -21462,9 +21487,9 @@
|
|
|
21462
21487
|
}
|
|
21463
21488
|
|
|
21464
21489
|
var h = this.$createElement;
|
|
21465
|
-
var _this$$
|
|
21466
|
-
theme = _this$$
|
|
21467
|
-
innerClass = _this$$
|
|
21490
|
+
var _this$$props3 = this.$props,
|
|
21491
|
+
theme = _this$$props3.theme,
|
|
21492
|
+
innerClass = _this$$props3.innerClass;
|
|
21468
21493
|
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
21469
21494
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
21470
21495
|
var _this$$data = this.$data,
|
|
@@ -21500,7 +21525,7 @@
|
|
|
21500
21525
|
return null;
|
|
21501
21526
|
},
|
|
21502
21527
|
renderTag: function renderTag(item) {
|
|
21503
|
-
var
|
|
21528
|
+
var _this3 = this;
|
|
21504
21529
|
|
|
21505
21530
|
var h = this.$createElement;
|
|
21506
21531
|
var innerClass = this.$props.innerClass;
|
|
@@ -21514,7 +21539,7 @@
|
|
|
21514
21539
|
"class": "close-icon",
|
|
21515
21540
|
"on": {
|
|
21516
21541
|
"click": function click() {
|
|
21517
|
-
return
|
|
21542
|
+
return _this3.clearTag(item);
|
|
21518
21543
|
}
|
|
21519
21544
|
}
|
|
21520
21545
|
}, [h(CancelSvg)])]);
|
|
@@ -21538,7 +21563,7 @@
|
|
|
21538
21563
|
}
|
|
21539
21564
|
},
|
|
21540
21565
|
renderTags: function renderTags() {
|
|
21541
|
-
var
|
|
21566
|
+
var _this4 = this;
|
|
21542
21567
|
|
|
21543
21568
|
var h = this.$createElement;
|
|
21544
21569
|
|
|
@@ -21554,7 +21579,7 @@
|
|
|
21554
21579
|
handleClear: this.clearTag,
|
|
21555
21580
|
handleClearAll: this.clearAllTags
|
|
21556
21581
|
}) : h(TagsContainer, [tagsList.map(function (item) {
|
|
21557
|
-
return
|
|
21582
|
+
return _this4.renderTag(item);
|
|
21558
21583
|
}), shouldRenderClearAllTag && h(TagItem, {
|
|
21559
21584
|
"class": getClassName$3(this.$props.innerClass, 'selected-tag') || ''
|
|
21560
21585
|
}, [h("span", ["Clear All"]), h("span", {
|
|
@@ -21580,13 +21605,13 @@
|
|
|
21580
21605
|
},
|
|
21581
21606
|
renderIcons: function renderIcons() {
|
|
21582
21607
|
var h = this.$createElement;
|
|
21583
|
-
var _this$$
|
|
21584
|
-
iconPosition = _this$$
|
|
21585
|
-
showClear = _this$$
|
|
21586
|
-
innerClass = _this$$
|
|
21587
|
-
getMicInstance = _this$$
|
|
21588
|
-
showVoiceSearch = _this$$
|
|
21589
|
-
showIcon = _this$$
|
|
21608
|
+
var _this$$props4 = this.$props,
|
|
21609
|
+
iconPosition = _this$$props4.iconPosition,
|
|
21610
|
+
showClear = _this$$props4.showClear,
|
|
21611
|
+
innerClass = _this$$props4.innerClass,
|
|
21612
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
21613
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
21614
|
+
showIcon = _this$$props4.showIcon;
|
|
21590
21615
|
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
21591
21616
|
var currentValue = this.$data.currentValue;
|
|
21592
21617
|
return h("div", [h(IconGroup, {
|
|
@@ -21638,7 +21663,7 @@
|
|
|
21638
21663
|
(_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
|
|
21639
21664
|
},
|
|
21640
21665
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
21641
|
-
var
|
|
21666
|
+
var _this5 = this;
|
|
21642
21667
|
|
|
21643
21668
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
21644
21669
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
@@ -21656,7 +21681,7 @@
|
|
|
21656
21681
|
// Prevent the default refresh event under WINDOWS system
|
|
21657
21682
|
event.preventDefault();
|
|
21658
21683
|
|
|
21659
|
-
|
|
21684
|
+
_this5.focusSearchBox(event);
|
|
21660
21685
|
}); // if one of modifier keys are used, they are handled below
|
|
21661
21686
|
|
|
21662
21687
|
hotkeys('*', function (event) {
|
|
@@ -21667,7 +21692,7 @@
|
|
|
21667
21692
|
var element = modifierKeys[index];
|
|
21668
21693
|
|
|
21669
21694
|
if (hotkeys[element]) {
|
|
21670
|
-
|
|
21695
|
+
_this5.focusSearchBox(event);
|
|
21671
21696
|
|
|
21672
21697
|
break;
|
|
21673
21698
|
}
|
|
@@ -21676,14 +21701,14 @@
|
|
|
21676
21701
|
}
|
|
21677
21702
|
},
|
|
21678
21703
|
render: function render() {
|
|
21679
|
-
var
|
|
21704
|
+
var _this6 = this;
|
|
21680
21705
|
|
|
21681
21706
|
var h = arguments[0];
|
|
21682
|
-
var _this$$
|
|
21683
|
-
theme = _this$$
|
|
21684
|
-
size = _this$$
|
|
21685
|
-
expandSuggestionsContainer = _this$$
|
|
21686
|
-
enableDefaultSuggestions = _this$$
|
|
21707
|
+
var _this$$props5 = this.$props,
|
|
21708
|
+
theme = _this$$props5.theme,
|
|
21709
|
+
size = _this$$props5.size,
|
|
21710
|
+
expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer,
|
|
21711
|
+
enableDefaultSuggestions = _this$$props5.enableDefaultSuggestions;
|
|
21687
21712
|
var _this$$scopedSlots = this.$scopedSlots,
|
|
21688
21713
|
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
21689
21714
|
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
@@ -21705,24 +21730,24 @@
|
|
|
21705
21730
|
"isOpen": this.$data.isOpen
|
|
21706
21731
|
},
|
|
21707
21732
|
"scopedSlots": {
|
|
21708
|
-
"default": function _default(
|
|
21709
|
-
var getInputEvents =
|
|
21710
|
-
getInputProps =
|
|
21711
|
-
getItemProps =
|
|
21712
|
-
getItemEvents =
|
|
21713
|
-
isOpen =
|
|
21714
|
-
highlightedIndex =
|
|
21715
|
-
setHighlightedIndex =
|
|
21733
|
+
"default": function _default(_ref4) {
|
|
21734
|
+
var getInputEvents = _ref4.getInputEvents,
|
|
21735
|
+
getInputProps = _ref4.getInputProps,
|
|
21736
|
+
getItemProps = _ref4.getItemProps,
|
|
21737
|
+
getItemEvents = _ref4.getItemEvents,
|
|
21738
|
+
isOpen = _ref4.isOpen,
|
|
21739
|
+
highlightedIndex = _ref4.highlightedIndex,
|
|
21740
|
+
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
21716
21741
|
|
|
21717
21742
|
var renderSuggestionsContainer = function renderSuggestionsContainer() {
|
|
21718
|
-
return h("div", [
|
|
21743
|
+
return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
|
|
21719
21744
|
isOpen: isOpen,
|
|
21720
21745
|
getItemProps: getItemProps,
|
|
21721
21746
|
getItemEvents: getItemEvents,
|
|
21722
21747
|
highlightedIndex: highlightedIndex
|
|
21723
|
-
}),
|
|
21724
|
-
"class": suggestions$1(
|
|
21725
|
-
}, [
|
|
21748
|
+
}), _this6.renderErrorComponent(), !_this6.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
21749
|
+
"class": suggestions$1(_this6.themePreset, theme) + " " + getClassName$3(_this6.$props.innerClass, 'list')
|
|
21750
|
+
}, [_this6.suggestionsList.slice(0, size || 10).map(function (item, index) {
|
|
21726
21751
|
return h("li", {
|
|
21727
21752
|
"domProps": _extends({}, getItemProps({
|
|
21728
21753
|
item: item
|
|
@@ -21732,15 +21757,15 @@
|
|
|
21732
21757
|
})),
|
|
21733
21758
|
"key": index + 1 + "-" + item.value,
|
|
21734
21759
|
"style": {
|
|
21735
|
-
backgroundColor:
|
|
21760
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, index)
|
|
21736
21761
|
}
|
|
21737
21762
|
}, [h(SuggestionItem, {
|
|
21738
21763
|
"attrs": {
|
|
21739
|
-
"currentValue":
|
|
21764
|
+
"currentValue": _this6.currentValue,
|
|
21740
21765
|
"suggestion": item
|
|
21741
21766
|
}
|
|
21742
21767
|
})]);
|
|
21743
|
-
}),
|
|
21768
|
+
}), _this6.defaultSearchSuggestions.map(function (sugg, index) {
|
|
21744
21769
|
return h("li", {
|
|
21745
21770
|
"domProps": _extends({}, getItemProps({
|
|
21746
21771
|
item: sugg
|
|
@@ -21748,9 +21773,9 @@
|
|
|
21748
21773
|
"on": _extends({}, getItemEvents({
|
|
21749
21774
|
item: sugg
|
|
21750
21775
|
})),
|
|
21751
|
-
"key":
|
|
21776
|
+
"key": _this6.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
21752
21777
|
"style": {
|
|
21753
|
-
backgroundColor:
|
|
21778
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, _this6.suggestionsList.length + index),
|
|
21754
21779
|
justifyContent: 'flex-start'
|
|
21755
21780
|
}
|
|
21756
21781
|
}, [h("div", {
|
|
@@ -21759,28 +21784,28 @@
|
|
|
21759
21784
|
}
|
|
21760
21785
|
}, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
|
|
21761
21786
|
"attrs": {
|
|
21762
|
-
"className": getClassName$3(
|
|
21787
|
+
"className": getClassName$3(_this6.$props.innerClass, 'recent-search-icon') || null,
|
|
21763
21788
|
"icon": recentSearchesIcon,
|
|
21764
21789
|
"type": "recent-search-icon"
|
|
21765
21790
|
}
|
|
21766
21791
|
}), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
|
|
21767
21792
|
"attrs": {
|
|
21768
|
-
"className": getClassName$3(
|
|
21793
|
+
"className": getClassName$3(_this6.$props.innerClass, 'popular-search-icon') || null,
|
|
21769
21794
|
"icon": popularSearchesIcon,
|
|
21770
21795
|
"type": "popular-search-icon"
|
|
21771
21796
|
}
|
|
21772
21797
|
})]), h(SuggestionItem, {
|
|
21773
21798
|
"attrs": {
|
|
21774
|
-
"currentValue":
|
|
21799
|
+
"currentValue": _this6.currentValue,
|
|
21775
21800
|
"suggestion": sugg
|
|
21776
21801
|
}
|
|
21777
21802
|
})]);
|
|
21778
|
-
}), hasQuerySuggestionsRenderer(
|
|
21803
|
+
}), hasQuerySuggestionsRenderer(_this6) ? _this6.getComponent({
|
|
21779
21804
|
isOpen: isOpen,
|
|
21780
21805
|
getItemProps: getItemProps,
|
|
21781
21806
|
getItemEvents: getItemEvents,
|
|
21782
21807
|
highlightedIndex: highlightedIndex
|
|
21783
|
-
}, true) :
|
|
21808
|
+
}, true) : _this6.topSuggestions.map(function (sugg, index) {
|
|
21784
21809
|
return h("li", {
|
|
21785
21810
|
"domProps": _extends({}, getItemProps({
|
|
21786
21811
|
item: sugg
|
|
@@ -21788,9 +21813,9 @@
|
|
|
21788
21813
|
"on": _extends({}, getItemEvents({
|
|
21789
21814
|
item: sugg
|
|
21790
21815
|
})),
|
|
21791
|
-
"key":
|
|
21816
|
+
"key": _this6.suggestionsList.length + index + 1 + "-" + sugg.value,
|
|
21792
21817
|
"style": {
|
|
21793
|
-
backgroundColor:
|
|
21818
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, _this6.suggestionsList.length + index),
|
|
21794
21819
|
justifyContent: 'flex-start'
|
|
21795
21820
|
}
|
|
21796
21821
|
}, [h("div", {
|
|
@@ -21799,61 +21824,61 @@
|
|
|
21799
21824
|
}
|
|
21800
21825
|
}, [h(CustomSvg, {
|
|
21801
21826
|
"attrs": {
|
|
21802
|
-
"className": getClassName$3(
|
|
21827
|
+
"className": getClassName$3(_this6.$props.innerClass, 'popular-search-icon') || null,
|
|
21803
21828
|
"icon": popularSearchesIcon,
|
|
21804
21829
|
"type": "popular-search-icon"
|
|
21805
21830
|
}
|
|
21806
21831
|
})]), h(SuggestionItem, {
|
|
21807
21832
|
"attrs": {
|
|
21808
|
-
"currentValue":
|
|
21833
|
+
"currentValue": _this6.currentValue,
|
|
21809
21834
|
"suggestion": sugg
|
|
21810
21835
|
}
|
|
21811
21836
|
})]);
|
|
21812
|
-
})]) :
|
|
21837
|
+
})]) : _this6.renderNoSuggestions(_this6.suggestionsList)]);
|
|
21813
21838
|
};
|
|
21814
21839
|
|
|
21815
21840
|
return h("div", {
|
|
21816
21841
|
"class": suggestionsContainer
|
|
21817
|
-
}, [h(InputGroup, [
|
|
21842
|
+
}, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
21818
21843
|
"attrs": {
|
|
21819
|
-
"id":
|
|
21820
|
-
"showIcon":
|
|
21821
|
-
"showClear":
|
|
21822
|
-
"iconPosition":
|
|
21823
|
-
"placeholder":
|
|
21824
|
-
"autoFocus":
|
|
21825
|
-
"themePreset":
|
|
21844
|
+
"id": _this6.$props.componentId + "-input",
|
|
21845
|
+
"showIcon": _this6.$props.showIcon,
|
|
21846
|
+
"showClear": _this6.$props.showClear,
|
|
21847
|
+
"iconPosition": _this6.$props.iconPosition,
|
|
21848
|
+
"placeholder": _this6.$props.placeholder,
|
|
21849
|
+
"autoFocus": _this6.$props.autoFocus,
|
|
21850
|
+
"themePreset": _this6.themePreset,
|
|
21826
21851
|
"autocomplete": "off"
|
|
21827
21852
|
},
|
|
21828
|
-
"ref":
|
|
21829
|
-
"class": getClassName$3(
|
|
21853
|
+
"ref": _this6.$props.innerRef,
|
|
21854
|
+
"class": getClassName$3(_this6.$props.innerClass, 'input'),
|
|
21830
21855
|
"on": _extends({}, getInputEvents({
|
|
21831
|
-
onInput:
|
|
21856
|
+
onInput: _this6.onInputChange,
|
|
21832
21857
|
onBlur: function onBlur(e) {
|
|
21833
|
-
|
|
21858
|
+
_this6.$emit('blur', e, _this6.triggerQuery);
|
|
21834
21859
|
},
|
|
21835
|
-
onFocus:
|
|
21860
|
+
onFocus: _this6.handleFocus,
|
|
21836
21861
|
onKeyPress: function onKeyPress(e) {
|
|
21837
|
-
|
|
21862
|
+
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
21838
21863
|
|
|
21839
|
-
|
|
21864
|
+
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
21840
21865
|
},
|
|
21841
21866
|
onKeyDown: function onKeyDown(e) {
|
|
21842
|
-
return
|
|
21867
|
+
return _this6.handleKeyDown(e, highlightedIndex);
|
|
21843
21868
|
},
|
|
21844
21869
|
onKeyUp: function onKeyUp(e) {
|
|
21845
|
-
|
|
21870
|
+
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
21846
21871
|
|
|
21847
|
-
|
|
21872
|
+
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
21848
21873
|
},
|
|
21849
21874
|
onClick: function onClick() {
|
|
21850
21875
|
setHighlightedIndex(null);
|
|
21851
21876
|
}
|
|
21852
21877
|
})),
|
|
21853
21878
|
"domProps": _extends({}, getInputProps({
|
|
21854
|
-
value:
|
|
21879
|
+
value: _this6.$data.currentValue === null ? '' : _this6.$data.currentValue
|
|
21855
21880
|
}))
|
|
21856
|
-
}),
|
|
21881
|
+
}), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this6.renderTags()]);
|
|
21857
21882
|
}
|
|
21858
21883
|
}
|
|
21859
21884
|
}) : h("div", {
|
|
@@ -21869,26 +21894,26 @@
|
|
|
21869
21894
|
},
|
|
21870
21895
|
"on": _extends({}, {
|
|
21871
21896
|
blur: function blur(e) {
|
|
21872
|
-
|
|
21897
|
+
_this6.$emit('blur', e, _this6.triggerQuery);
|
|
21873
21898
|
},
|
|
21874
21899
|
keypress: function keypress(e) {
|
|
21875
|
-
|
|
21900
|
+
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
21876
21901
|
|
|
21877
|
-
|
|
21902
|
+
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
21878
21903
|
},
|
|
21879
21904
|
input: this.onInputChange,
|
|
21880
21905
|
focus: function focus(e) {
|
|
21881
|
-
|
|
21906
|
+
_this6.$emit('focus', e, _this6.triggerQuery);
|
|
21882
21907
|
},
|
|
21883
21908
|
keydown: function keydown(e) {
|
|
21884
|
-
|
|
21909
|
+
_this6.$emit('keyDown', e, _this6.triggerQuery);
|
|
21885
21910
|
|
|
21886
|
-
|
|
21911
|
+
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
21887
21912
|
},
|
|
21888
21913
|
keyup: function keyup(e) {
|
|
21889
|
-
|
|
21914
|
+
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
21890
21915
|
|
|
21891
|
-
|
|
21916
|
+
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
21892
21917
|
}
|
|
21893
21918
|
}),
|
|
21894
21919
|
"domProps": _extends({}, {
|
|
@@ -28393,35 +28418,61 @@
|
|
|
28393
28418
|
}
|
|
28394
28419
|
|
|
28395
28420
|
var _props = props,
|
|
28396
|
-
componentIds = _props.componentIds
|
|
28421
|
+
componentIds = _props.componentIds,
|
|
28422
|
+
excludeComponentIds = _props.excludeComponentIds;
|
|
28397
28423
|
|
|
28398
|
-
if (
|
|
28399
|
-
|
|
28424
|
+
if (componentIds) {
|
|
28425
|
+
if (typeof componentIds === 'string') {
|
|
28426
|
+
var _ref;
|
|
28400
28427
|
|
|
28401
|
-
|
|
28402
|
-
|
|
28428
|
+
return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
|
|
28429
|
+
}
|
|
28403
28430
|
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28409
|
-
|
|
28431
|
+
if (Array.isArray(componentIds) && componentIds.length) {
|
|
28432
|
+
var _filteredState = {};
|
|
28433
|
+
componentIds.forEach(function (componentId) {
|
|
28434
|
+
_filteredState[componentId] = state[componentId];
|
|
28435
|
+
});
|
|
28436
|
+
return _filteredState;
|
|
28437
|
+
}
|
|
28410
28438
|
}
|
|
28411
28439
|
|
|
28440
|
+
var filteredState = {};
|
|
28441
|
+
|
|
28412
28442
|
if (!props.includeInternalComponents) {
|
|
28413
|
-
var _filteredState = {};
|
|
28414
28443
|
Object.keys(state).forEach(function (componentId) {
|
|
28415
28444
|
if (componentId.endsWith('internal') || componentId.endsWith('active') || componentId.endsWith('timestamp')) {
|
|
28416
28445
|
return;
|
|
28417
28446
|
}
|
|
28418
28447
|
|
|
28419
|
-
|
|
28448
|
+
filteredState[componentId] = state[componentId];
|
|
28420
28449
|
});
|
|
28421
|
-
|
|
28450
|
+
} else {
|
|
28451
|
+
filteredState = state;
|
|
28452
|
+
} // Apply exclude component ids
|
|
28453
|
+
|
|
28454
|
+
|
|
28455
|
+
if (excludeComponentIds) {
|
|
28456
|
+
if (typeof excludeComponentIds === 'string') {
|
|
28457
|
+
Object.keys(state).forEach(function (componentId) {
|
|
28458
|
+
if (componentId === excludeComponentIds) {
|
|
28459
|
+
// Delete state
|
|
28460
|
+
delete filteredState[componentId];
|
|
28461
|
+
}
|
|
28462
|
+
});
|
|
28463
|
+
}
|
|
28464
|
+
|
|
28465
|
+
if (Array.isArray(excludeComponentIds) && excludeComponentIds.length) {
|
|
28466
|
+
Object.keys(state).forEach(function (componentId) {
|
|
28467
|
+
if (excludeComponentIds.includes(componentId)) {
|
|
28468
|
+
// Delete state
|
|
28469
|
+
delete filteredState[componentId];
|
|
28470
|
+
}
|
|
28471
|
+
});
|
|
28472
|
+
}
|
|
28422
28473
|
}
|
|
28423
28474
|
|
|
28424
|
-
return
|
|
28475
|
+
return filteredState;
|
|
28425
28476
|
};
|
|
28426
28477
|
|
|
28427
28478
|
var filterByKeys = function filterByKeys(state, allowedKeys) {
|
|
@@ -28445,7 +28496,8 @@
|
|
|
28445
28496
|
componentIds: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)]),
|
|
28446
28497
|
includeKeys: VueTypes.arrayOf(VueTypes.string).def(defaultKeys),
|
|
28447
28498
|
strict: VueTypes.bool.def(true),
|
|
28448
|
-
includeInternalComponents: VueTypes.bool.def(false)
|
|
28499
|
+
includeInternalComponents: VueTypes.bool.def(false),
|
|
28500
|
+
excludeComponentIds: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)])
|
|
28449
28501
|
},
|
|
28450
28502
|
data: function data() {
|
|
28451
28503
|
this.__state = {
|
|
@@ -28505,6 +28557,9 @@
|
|
|
28505
28557
|
componentIds: function componentIds(newVal, oldVal) {
|
|
28506
28558
|
this.calculateSearchState(newVal, oldVal);
|
|
28507
28559
|
},
|
|
28560
|
+
excludeComponentIds: function excludeComponentIds(newVal, oldVal) {
|
|
28561
|
+
this.calculateSearchState(newVal, oldVal);
|
|
28562
|
+
},
|
|
28508
28563
|
includeKeys: function includeKeys(newVal, oldVal) {
|
|
28509
28564
|
this.calculateSearchState(newVal, oldVal);
|
|
28510
28565
|
},
|
|
@@ -37500,11 +37555,14 @@
|
|
|
37500
37555
|
var _excluded$k = ["aggs", "size"],
|
|
37501
37556
|
_excluded2 = ["query"],
|
|
37502
37557
|
_excluded3 = ["query"];
|
|
37558
|
+
|
|
37559
|
+
var _componentTypeToDefau;
|
|
37503
37560
|
var X_SEARCH_CLIENT$1 = 'ReactiveSearch Vue';
|
|
37504
37561
|
var componentsWithoutFilters = [constants_1$1.numberBox, constants_1$1.ratingsFilter];
|
|
37505
37562
|
var resultComponents = [constants_1$1.reactiveList, constants_1$1.reactiveMap];
|
|
37563
|
+
var componentTypeToDefaultValue = (_componentTypeToDefau = {}, _componentTypeToDefau[constants_1$1.singleList] = '', _componentTypeToDefau[constants_1$1.multiList] = [], _componentTypeToDefau[constants_1$1.singleDataList] = '', _componentTypeToDefau[constants_1$1.singleDropdownList] = '', _componentTypeToDefau[constants_1$1.multiDataList] = [], _componentTypeToDefau[constants_1$1.multiDropdownList] = [], _componentTypeToDefau[constants_1$1.tagCloud] = '', _componentTypeToDefau[constants_1$1.toggleButton] = '', _componentTypeToDefau[constants_1$1.singleDropdownRange] = '', _componentTypeToDefau[constants_1$1.multiDropdownRange] = [], _componentTypeToDefau[constants_1$1.singleRange] = '', _componentTypeToDefau[constants_1$1.multiRange] = [], _componentTypeToDefau);
|
|
37506
37564
|
|
|
37507
|
-
function getValue(state, id, defaultValue) {
|
|
37565
|
+
function getValue(state, id, defaultValue, componentType) {
|
|
37508
37566
|
if (state && state[id]) {
|
|
37509
37567
|
try {
|
|
37510
37568
|
// parsing for next.js - since it uses extra set of quotes to wrap params
|
|
@@ -37523,7 +37581,7 @@
|
|
|
37523
37581
|
}
|
|
37524
37582
|
|
|
37525
37583
|
return {
|
|
37526
|
-
value: defaultValue,
|
|
37584
|
+
value: defaultValue || componentTypeToDefaultValue[componentType] || null,
|
|
37527
37585
|
reference: 'DEFAULT'
|
|
37528
37586
|
};
|
|
37529
37587
|
}
|
|
@@ -37662,7 +37720,7 @@
|
|
|
37662
37720
|
var internalComponent = component.componentId + "__internal";
|
|
37663
37721
|
var label = component.filterLabel || component.componentId;
|
|
37664
37722
|
|
|
37665
|
-
var _getValue = getValue(searchState, component.componentId, component.value || component.defaultValue),
|
|
37723
|
+
var _getValue = getValue(searchState, component.componentId, component.value || component.defaultValue, componentType),
|
|
37666
37724
|
value = _getValue.value,
|
|
37667
37725
|
reference = _getValue.reference; // [1] set selected values
|
|
37668
37726
|
|
|
@@ -38031,7 +38089,7 @@
|
|
|
38031
38089
|
});
|
|
38032
38090
|
}
|
|
38033
38091
|
|
|
38034
|
-
var version = "2.0.0-alpha.
|
|
38092
|
+
var version = "2.0.0-alpha.4";
|
|
38035
38093
|
|
|
38036
38094
|
var _templateObject$q, _templateObject2$c;
|
|
38037
38095
|
|