@appbaseio/reactivesearch-vue 1.26.0 → 1.27.0-gamma.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 +1691 -436
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{ComponentWrapper-32481890.js → ComponentWrapper-10bad289.js} +1 -1
- package/dist/cjs/DataSearch-0ef14926.js +2154 -0
- package/dist/cjs/DataSearch.js +18 -2101
- package/dist/cjs/{DropDown-cf9bfffc.js → DropDown-e4381fcc.js} +16 -11
- package/dist/cjs/DynamicRangeSlider.js +40 -7
- package/dist/cjs/{Input-3cc3fa59.js → Input-0d7b25ad.js} +1 -1
- package/dist/cjs/MultiDropdownList.js +6 -5
- package/dist/cjs/MultiList.js +16 -11
- package/dist/cjs/MultiRange.js +2 -2
- package/dist/cjs/RangeInput.js +7 -3
- package/dist/cjs/RangeSlider.js +2 -2
- package/dist/cjs/ReactiveBase.js +1 -1
- package/dist/cjs/ReactiveComponent.js +2 -2
- package/dist/cjs/ReactiveList.js +13 -3
- package/dist/cjs/SelectedFilters.js +1 -1
- package/dist/cjs/SingleDropdownList.js +5 -4
- package/dist/cjs/SingleList.js +3 -3
- package/dist/cjs/SingleRange.js +2 -2
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/ToggleButton.js +2 -2
- package/dist/cjs/{index-89c39a9e.js → index-4509aa45.js} +10 -4
- package/dist/cjs/index.js +11 -10
- package/dist/cjs/install-311df9cc.js +1200 -0
- package/dist/cjs/install.js +25 -30
- package/dist/cjs/version.js +1 -1
- package/dist/es/{ComponentWrapper-4f85a67e.js → ComponentWrapper-0f3431d1.js} +1 -1
- package/dist/es/DataSearch-be45e960.js +2141 -0
- package/dist/es/DataSearch.js +17 -2100
- package/dist/es/{DropDown-c8da0a2c.js → DropDown-ff6ad982.js} +16 -11
- package/dist/es/DynamicRangeSlider.js +40 -7
- package/dist/es/{Input-08bb1bcf.js → Input-e339e63a.js} +1 -1
- package/dist/es/MultiDropdownList.js +6 -5
- package/dist/es/MultiList.js +16 -11
- package/dist/es/MultiRange.js +2 -2
- package/dist/es/RangeInput.js +7 -3
- package/dist/es/RangeSlider.js +2 -2
- package/dist/es/ReactiveBase.js +1 -1
- package/dist/es/ReactiveComponent.js +2 -2
- package/dist/es/ReactiveList.js +13 -3
- package/dist/es/SelectedFilters.js +1 -1
- package/dist/es/SingleDropdownList.js +5 -4
- package/dist/es/SingleList.js +3 -3
- package/dist/es/SingleRange.js +2 -2
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/ToggleButton.js +2 -2
- package/dist/es/{index-cb1950b6.js → index-78920565.js} +10 -4
- package/dist/es/index.js +7 -7
- package/dist/es/install-af797de0.js +1193 -0
- package/dist/es/install.js +23 -32
- package/dist/es/version.js +1 -1
- package/package.json +4 -4
|
@@ -13264,10 +13264,16 @@
|
|
|
13264
13264
|
}; // parses current array (i.e. this.$props.value) for `onChange` callback for multi-* components
|
|
13265
13265
|
|
|
13266
13266
|
function parseValueArray(objectValues, currentValue) {
|
|
13267
|
-
var
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13267
|
+
var selectedValues;
|
|
13268
|
+
|
|
13269
|
+
if (Array.isArray(objectValues)) {
|
|
13270
|
+
selectedValues = [].concat(objectValues);
|
|
13271
|
+
} else {
|
|
13272
|
+
var keys = Object.keys(objectValues);
|
|
13273
|
+
selectedValues = keys.map(function (key) {
|
|
13274
|
+
return objectValues[key] ? key : null;
|
|
13275
|
+
});
|
|
13276
|
+
}
|
|
13271
13277
|
|
|
13272
13278
|
if (selectedValues.includes(currentValue)) {
|
|
13273
13279
|
return selectedValues.filter(function (item) {
|
|
@@ -14082,6 +14088,12 @@
|
|
|
14082
14088
|
});
|
|
14083
14089
|
}
|
|
14084
14090
|
|
|
14091
|
+
if (this.urlSortOption) {
|
|
14092
|
+
this.sortOptionIndex = this.$props.sortOptions.findIndex(function (s) {
|
|
14093
|
+
return s.label === _this.urlSortOption;
|
|
14094
|
+
}) || 0;
|
|
14095
|
+
}
|
|
14096
|
+
|
|
14085
14097
|
this.updateComponentProps(this.componentId, {
|
|
14086
14098
|
from: this.from
|
|
14087
14099
|
}, constants_1$1.reactiveList);
|
|
@@ -14390,7 +14402,7 @@
|
|
|
14390
14402
|
"labelPosition": this.sortOptions ? 'right' : 'left'
|
|
14391
14403
|
},
|
|
14392
14404
|
"class": getClassName$1(this.$props.innerClass, 'resultsInfo')
|
|
14393
|
-
}, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading &&
|
|
14405
|
+
}, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && hits && hits.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
|
|
14394
14406
|
"attrs": {
|
|
14395
14407
|
"pages": this.$props.pages,
|
|
14396
14408
|
"totalPages": this.totalPages,
|
|
@@ -14598,8 +14610,11 @@
|
|
|
14598
14610
|
sortBy: sortBy
|
|
14599
14611
|
}, constants_1$1.reactiveList);
|
|
14600
14612
|
this.setQueryOptions(this.$props.componentId, options, true);
|
|
14613
|
+
this.setPage(0);
|
|
14601
14614
|
this.currentPageState = 0;
|
|
14602
14615
|
this.from = 0;
|
|
14616
|
+
var sortOption = this.$props.sortOptions[this.sortOptionIndex] ? this.$props.sortOptions[this.sortOptionIndex].label : null;
|
|
14617
|
+
this.setPageURL(this.$props.componentId + "sortOption", sortOption, this.$props.componentId + "sortOption", false, this.$props.URLParams);
|
|
14603
14618
|
}
|
|
14604
14619
|
},
|
|
14605
14620
|
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
@@ -14711,6 +14726,7 @@
|
|
|
14711
14726
|
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
14712
14727
|
return {
|
|
14713
14728
|
defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
|
|
14729
|
+
urlSortOption: state.selectedValues[props.componentId + "sortOption"] && state.selectedValues[props.componentId + "sortOption"].value,
|
|
14714
14730
|
hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
14715
14731
|
rawData: state.rawData[props.componentId],
|
|
14716
14732
|
aggregationData: state.compositeAggregations[props.componentId],
|
|
@@ -17929,7 +17945,7 @@
|
|
|
17929
17945
|
});
|
|
17930
17946
|
|
|
17931
17947
|
var suggestions$1 = function suggestions(themePreset, theme) {
|
|
17932
|
-
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height:
|
|
17948
|
+
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 402px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark$1(theme));
|
|
17933
17949
|
};
|
|
17934
17950
|
|
|
17935
17951
|
var suggestionsContainer = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
@@ -18969,19 +18985,22 @@
|
|
|
18969
18985
|
title = _this$suggestion.title,
|
|
18970
18986
|
description = _this$suggestion.description,
|
|
18971
18987
|
image = _this$suggestion.image,
|
|
18972
|
-
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion
|
|
18988
|
+
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
|
|
18989
|
+
_suggestion_type = _this$suggestion._suggestion_type,
|
|
18990
|
+
_category = _this$suggestion._category;
|
|
18973
18991
|
|
|
18974
18992
|
if (label) {
|
|
18975
18993
|
// label has highest precedence
|
|
18976
18994
|
return typeof label === 'string' ? h("div", {
|
|
18977
18995
|
"class": "trim"
|
|
18978
|
-
}, [
|
|
18996
|
+
}, [(_category ? false : isPredictiveSuggestion // eslint-disable-next-line
|
|
18997
|
+
|| !!_suggestion_type) ? h(PredictiveSuggestion, {
|
|
18979
18998
|
"domProps": {
|
|
18980
18999
|
"innerHTML": label
|
|
18981
19000
|
}
|
|
18982
19001
|
}) : h(VueHighlightWords, {
|
|
18983
19002
|
"attrs": {
|
|
18984
|
-
"searchWords": this.currentValue.split(' '),
|
|
19003
|
+
"searchWords": _category ? [_category] : this.currentValue.split(' '),
|
|
18985
19004
|
"textToHighlight": label,
|
|
18986
19005
|
"autoEscape": true,
|
|
18987
19006
|
"highlightStyle": highlightStyle
|
|
@@ -19050,17 +19069,22 @@
|
|
|
19050
19069
|
};
|
|
19051
19070
|
|
|
19052
19071
|
var SearchSvg = {
|
|
19053
|
-
|
|
19054
|
-
|
|
19072
|
+
name: 'SearchSvg',
|
|
19073
|
+
props: ['styles'],
|
|
19074
|
+
render: function render() {
|
|
19075
|
+
var h = arguments[0];
|
|
19055
19076
|
return h("svg", {
|
|
19056
19077
|
"attrs": {
|
|
19057
19078
|
"alt": "Search",
|
|
19058
|
-
"height": "
|
|
19059
|
-
"width": "10",
|
|
19079
|
+
"height": "12",
|
|
19060
19080
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
19061
19081
|
"viewBox": "0 0 15 15"
|
|
19062
19082
|
},
|
|
19063
|
-
"class": "search-icon"
|
|
19083
|
+
"class": "search-icon",
|
|
19084
|
+
"style": _extends({
|
|
19085
|
+
transform: 'scale(1.35)',
|
|
19086
|
+
position: 'relative'
|
|
19087
|
+
}, this.$props.styles ? this.$props.styles : {})
|
|
19064
19088
|
}, [h("title", ["Search"]), h("path", {
|
|
19065
19089
|
"attrs": {
|
|
19066
19090
|
"d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
|
|
@@ -19732,11 +19756,11 @@
|
|
|
19732
19756
|
}, [this.customIcon]);
|
|
19733
19757
|
}
|
|
19734
19758
|
|
|
19735
|
-
if (this.$props.type === '
|
|
19759
|
+
if (this.$props.type === 'recent-search-icon') {
|
|
19736
19760
|
return h("svg", {
|
|
19737
19761
|
"attrs": {
|
|
19738
19762
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
19739
|
-
"alt": "
|
|
19763
|
+
"alt": "Recent Search",
|
|
19740
19764
|
"height": "20",
|
|
19741
19765
|
"width": "20",
|
|
19742
19766
|
"viewBox": "0 0 24 24"
|
|
@@ -19752,14 +19776,36 @@
|
|
|
19752
19776
|
}
|
|
19753
19777
|
}), h("path", {
|
|
19754
19778
|
"attrs": {
|
|
19755
|
-
"d": "
|
|
19779
|
+
"d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
|
|
19756
19780
|
}
|
|
19757
19781
|
})]);
|
|
19758
|
-
}
|
|
19782
|
+
}
|
|
19783
|
+
|
|
19784
|
+
if (this.$props.type === 'promoted-search-icon') {
|
|
19785
|
+
return h("svg", {
|
|
19786
|
+
"attrs": {
|
|
19787
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
19788
|
+
"width": "20",
|
|
19789
|
+
"alt": "promoted search",
|
|
19790
|
+
"height": "20",
|
|
19791
|
+
"viewBox": "0 0 24 24"
|
|
19792
|
+
},
|
|
19793
|
+
"class": this.$props.className,
|
|
19794
|
+
"style": {
|
|
19795
|
+
fill: '#707070'
|
|
19796
|
+
}
|
|
19797
|
+
}, [h("path", {
|
|
19798
|
+
"attrs": {
|
|
19799
|
+
"d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
|
|
19800
|
+
}
|
|
19801
|
+
})]);
|
|
19802
|
+
}
|
|
19803
|
+
|
|
19804
|
+
if (this.$props.type === 'popular-search-icon') {
|
|
19759
19805
|
return h("svg", {
|
|
19760
19806
|
"attrs": {
|
|
19761
19807
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
19762
|
-
"alt": "
|
|
19808
|
+
"alt": "Popular Search",
|
|
19763
19809
|
"height": "20",
|
|
19764
19810
|
"width": "20",
|
|
19765
19811
|
"viewBox": "0 0 24 24"
|
|
@@ -19775,10 +19821,21 @@
|
|
|
19775
19821
|
}
|
|
19776
19822
|
}), h("path", {
|
|
19777
19823
|
"attrs": {
|
|
19778
|
-
"d": "
|
|
19824
|
+
"d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
|
|
19779
19825
|
}
|
|
19780
19826
|
})]);
|
|
19781
19827
|
}
|
|
19828
|
+
|
|
19829
|
+
return h(SearchSvg, {
|
|
19830
|
+
"attrs": {
|
|
19831
|
+
"styles": {
|
|
19832
|
+
position: 'relative',
|
|
19833
|
+
fill: '#707070',
|
|
19834
|
+
left: '3px',
|
|
19835
|
+
marginRight: '8px'
|
|
19836
|
+
}
|
|
19837
|
+
}
|
|
19838
|
+
});
|
|
19782
19839
|
}
|
|
19783
19840
|
};
|
|
19784
19841
|
|
|
@@ -21022,217 +21079,1368 @@
|
|
|
21022
21079
|
|
|
21023
21080
|
DataSearch.componentType = constants_1$1.dataSearch;
|
|
21024
21081
|
|
|
21025
|
-
var _templateObject$j
|
|
21026
|
-
var
|
|
21027
|
-
|
|
21028
|
-
|
|
21029
|
-
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
var formItem = function formItem(_ref) {
|
|
21035
|
-
var theme = _ref.theme;
|
|
21036
|
-
return css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, curriedLighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
|
|
21037
|
-
};
|
|
21038
|
-
|
|
21039
|
-
var Radio = index$1('input')(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
21040
|
-
return props.show ? null : hideInputControl;
|
|
21041
|
-
}, function (_ref2) {
|
|
21042
|
-
var theme = _ref2.theme;
|
|
21043
|
-
return theme.colors.primaryColor;
|
|
21044
|
-
}, function (_ref3) {
|
|
21045
|
-
var theme = _ref3.theme;
|
|
21046
|
-
return theme.colors.primaryColor;
|
|
21047
|
-
});
|
|
21048
|
-
var Checkbox = index$1('input')(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
21049
|
-
return props.show ? null : hideInputControl;
|
|
21050
|
-
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
21051
|
-
var theme = _ref4.theme;
|
|
21052
|
-
return theme.colors.primaryColor;
|
|
21053
|
-
}, function (_ref5) {
|
|
21054
|
-
var theme = _ref5.theme;
|
|
21055
|
-
return theme.colors.primaryColor;
|
|
21056
|
-
});
|
|
21057
|
-
var UL = index$1('ul')(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
|
|
21058
|
-
|
|
21059
|
-
var getAggsOrder = lib_8.getAggsOrder;
|
|
21060
|
-
|
|
21061
|
-
var extractQuery = function extractQuery(props) {
|
|
21062
|
-
var queryToBeReturned = {};
|
|
21063
|
-
|
|
21064
|
-
if (props.defaultQuery) {
|
|
21065
|
-
var evaluateQuery = props.defaultQuery([], props);
|
|
21066
|
-
|
|
21067
|
-
if (evaluateQuery) {
|
|
21068
|
-
if (evaluateQuery.query) {
|
|
21069
|
-
queryToBeReturned.query = evaluateQuery.query;
|
|
21082
|
+
var _templateObject$j;
|
|
21083
|
+
var AutofillSvgIcon = index$1('button')(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
|
|
21084
|
+
var AutoFillSvg = {
|
|
21085
|
+
name: 'AutoFillSvg',
|
|
21086
|
+
render: function render() {
|
|
21087
|
+
var h = arguments[0];
|
|
21088
|
+
return h(AutofillSvgIcon, {
|
|
21089
|
+
"on": {
|
|
21090
|
+
"click": this.$listeners.click
|
|
21070
21091
|
}
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
|
|
21092
|
+
}, [h("svg", {
|
|
21093
|
+
"attrs": {
|
|
21094
|
+
"viewBox": "0 0 24 24"
|
|
21074
21095
|
}
|
|
21075
|
-
}
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
return queryToBeReturned;
|
|
21079
|
-
}; // eslint-disable-next-line import/prefer-default-export
|
|
21080
|
-
|
|
21081
|
-
|
|
21082
|
-
var getAggsQuery = function getAggsQuery(query, props) {
|
|
21083
|
-
var _clonedQuery$aggs;
|
|
21084
|
-
|
|
21085
|
-
var clonedQuery = query;
|
|
21086
|
-
var dataField = props.dataField,
|
|
21087
|
-
size = props.size,
|
|
21088
|
-
sortBy = props.sortBy,
|
|
21089
|
-
showMissing = props.showMissing,
|
|
21090
|
-
missingLabel = props.missingLabel;
|
|
21091
|
-
clonedQuery.size = 0;
|
|
21092
|
-
clonedQuery.aggs = (_clonedQuery$aggs = {}, _clonedQuery$aggs[dataField] = {
|
|
21093
|
-
terms: _extends({
|
|
21094
|
-
field: dataField,
|
|
21095
|
-
size: size,
|
|
21096
|
-
order: getAggsOrder(sortBy || 'count')
|
|
21097
|
-
}, showMissing ? {
|
|
21098
|
-
missing: missingLabel
|
|
21099
|
-
} : {})
|
|
21100
|
-
}, _clonedQuery$aggs);
|
|
21101
|
-
|
|
21102
|
-
if (props.nestedField) {
|
|
21103
|
-
clonedQuery.aggs = {
|
|
21104
|
-
reactivesearch_nested: {
|
|
21105
|
-
nested: {
|
|
21106
|
-
path: props.nestedField
|
|
21107
|
-
},
|
|
21108
|
-
aggs: clonedQuery.aggs
|
|
21096
|
+
}, [h("path", {
|
|
21097
|
+
"attrs": {
|
|
21098
|
+
"d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
|
|
21109
21099
|
}
|
|
21110
|
-
};
|
|
21100
|
+
})])]);
|
|
21101
|
+
},
|
|
21102
|
+
methods: {
|
|
21103
|
+
clicked: function clicked(e) {
|
|
21104
|
+
e.stopPropagation();
|
|
21105
|
+
window.console.log('hey', e);
|
|
21106
|
+
}
|
|
21111
21107
|
}
|
|
21112
|
-
|
|
21113
|
-
return _extends({}, clonedQuery, extractQuery(props));
|
|
21114
21108
|
};
|
|
21115
21109
|
|
|
21116
21110
|
var updateQuery$2 = lib_5.updateQuery,
|
|
21117
|
-
setQueryOptions$2 = lib_5.setQueryOptions,
|
|
21118
21111
|
setCustomQuery$1 = lib_5.setCustomQuery,
|
|
21119
|
-
setDefaultQuery$2 = lib_5.setDefaultQuery
|
|
21120
|
-
|
|
21112
|
+
setDefaultQuery$2 = lib_5.setDefaultQuery,
|
|
21113
|
+
recordSuggestionClick$1 = lib_5.recordSuggestionClick;
|
|
21114
|
+
var _debounce = lib_8.debounce,
|
|
21121
21115
|
checkValueChange$1 = lib_8.checkValueChange,
|
|
21122
21116
|
getClassName$4 = lib_8.getClassName,
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
componentId: types.stringRequired,
|
|
21131
|
-
customQuery: types.func,
|
|
21132
|
-
dataField: types.stringRequired,
|
|
21133
|
-
defaultValue: types.string,
|
|
21134
|
-
value: types.value,
|
|
21135
|
-
defaultQuery: types.func,
|
|
21136
|
-
filterLabel: types.string,
|
|
21137
|
-
innerClass: types.style,
|
|
21138
|
-
placeholder: VueTypes.string.def('Search'),
|
|
21139
|
-
react: types.react,
|
|
21140
|
-
render: types.func,
|
|
21141
|
-
renderItem: types.func,
|
|
21142
|
-
renderNoResults: VueTypes.any,
|
|
21143
|
-
transformData: types.func,
|
|
21144
|
-
selectAllLabel: types.string,
|
|
21145
|
-
showCount: VueTypes.bool.def(true),
|
|
21146
|
-
showFilter: VueTypes.bool.def(true),
|
|
21147
|
-
showRadio: VueTypes.bool.def(true),
|
|
21148
|
-
showSearch: VueTypes.bool.def(true),
|
|
21149
|
-
size: VueTypes.number,
|
|
21150
|
-
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
21151
|
-
title: types.title,
|
|
21152
|
-
URLParams: VueTypes.bool.def(false),
|
|
21153
|
-
showMissing: VueTypes.bool.def(false),
|
|
21154
|
-
missingLabel: VueTypes.string.def('N/A'),
|
|
21155
|
-
nestedField: types.string,
|
|
21156
|
-
index: VueTypes.string,
|
|
21157
|
-
enableStrictSelection: VueTypes.bool.def(false)
|
|
21158
|
-
},
|
|
21117
|
+
isEqual$5 = lib_8.isEqual,
|
|
21118
|
+
getCompositeAggsQuery$2 = lib_8.getCompositeAggsQuery,
|
|
21119
|
+
withClickIds$1 = lib_8.withClickIds,
|
|
21120
|
+
getResultStats$2 = lib_8.getResultStats,
|
|
21121
|
+
normalizeDataField$1 = lib_8.normalizeDataField;
|
|
21122
|
+
var SearchBox = {
|
|
21123
|
+
name: 'SearchBox',
|
|
21159
21124
|
data: function data() {
|
|
21160
21125
|
var props = this.$props;
|
|
21161
21126
|
this.__state = {
|
|
21162
21127
|
currentValue: '',
|
|
21163
|
-
|
|
21164
|
-
|
|
21128
|
+
isOpen: false,
|
|
21129
|
+
normalizedSuggestions: []
|
|
21165
21130
|
};
|
|
21166
21131
|
this.internalComponent = props.componentId + "__internal";
|
|
21167
21132
|
return this.__state;
|
|
21168
21133
|
},
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21134
|
+
inject: {
|
|
21135
|
+
theme: {
|
|
21136
|
+
from: 'theme_reactivesearch'
|
|
21172
21137
|
}
|
|
21138
|
+
},
|
|
21139
|
+
created: function created() {
|
|
21140
|
+
var _this$$props = this.$props,
|
|
21141
|
+
distinctField = _this$$props.distinctField,
|
|
21142
|
+
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
21143
|
+
index = _this$$props.index;
|
|
21173
21144
|
|
|
21174
|
-
|
|
21175
|
-
|
|
21145
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
21146
|
+
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
21147
|
+
}
|
|
21176
21148
|
|
|
21177
|
-
|
|
21178
|
-
|
|
21179
|
-
|
|
21180
|
-
beforeMount: function beforeMount() {
|
|
21181
|
-
this.updateQueryHandlerOptions(this.$props);
|
|
21149
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
21150
|
+
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
21151
|
+
}
|
|
21182
21152
|
|
|
21183
|
-
if (this.
|
|
21184
|
-
|
|
21185
|
-
} else if (this.$props.value) {
|
|
21186
|
-
this.setValue(this.$props.value);
|
|
21187
|
-
} else if (this.$props.defaultValue) {
|
|
21188
|
-
this.setValue(this.$props.defaultValue);
|
|
21153
|
+
if (!this.enableAppbase && index) {
|
|
21154
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
21189
21155
|
}
|
|
21156
|
+
|
|
21157
|
+
this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
|
|
21158
|
+
this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
|
|
21159
|
+
this.setValue(this.currentValue, true, this.$props, undefined, false, this.selectedCategory); // Set custom and default queries in store
|
|
21160
|
+
|
|
21161
|
+
this.triggerCustomQuery(this.currentValue, this.selectedCategory);
|
|
21162
|
+
this.triggerDefaultQuery(this.currentValue);
|
|
21190
21163
|
},
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
|
|
21194
|
-
this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
|
|
21195
|
-
}
|
|
21196
|
-
},
|
|
21197
|
-
size: function size() {
|
|
21198
|
-
this.updateQueryHandlerOptions(this.$props);
|
|
21199
|
-
},
|
|
21200
|
-
sortBy: function sortBy() {
|
|
21201
|
-
this.updateQueryHandlerOptions(this.$props);
|
|
21202
|
-
},
|
|
21203
|
-
dataField: function dataField() {
|
|
21204
|
-
this.updateQueryHandlerOptions(this.$props);
|
|
21205
|
-
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
21206
|
-
},
|
|
21207
|
-
defaultValue: function defaultValue(newVal) {
|
|
21208
|
-
this.setValue(newVal);
|
|
21209
|
-
},
|
|
21210
|
-
value: function value(newVal, oldVal) {
|
|
21211
|
-
if (!isEqual$5(newVal, oldVal)) {
|
|
21212
|
-
this.setValue(newVal);
|
|
21213
|
-
}
|
|
21214
|
-
},
|
|
21215
|
-
selectedValue: function selectedValue(newVal) {
|
|
21216
|
-
if (this.$data.currentValue !== newVal) {
|
|
21217
|
-
this.setValue(newVal || '');
|
|
21218
|
-
}
|
|
21219
|
-
},
|
|
21220
|
-
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
21221
|
-
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
21222
|
-
this.updateDefaultQueryHandler(this.$data.currentValue, this.$props);
|
|
21223
|
-
}
|
|
21164
|
+
computed: {
|
|
21165
|
+
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
21166
|
+
return hasCustomRenderer(this);
|
|
21224
21167
|
},
|
|
21225
|
-
|
|
21226
|
-
|
|
21227
|
-
this.updateQueryHandler(this.componentId, this.$data.currentValue, this.$props);
|
|
21228
|
-
}
|
|
21168
|
+
stats: function stats() {
|
|
21169
|
+
return getResultStats$2(this);
|
|
21229
21170
|
}
|
|
21230
21171
|
},
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21172
|
+
props: {
|
|
21173
|
+
autoFocus: VueTypes.bool,
|
|
21174
|
+
autosuggest: VueTypes.bool.def(true),
|
|
21175
|
+
beforeValueChange: types.func,
|
|
21176
|
+
className: VueTypes.string.def(''),
|
|
21177
|
+
clearIcon: types.children,
|
|
21178
|
+
componentId: types.stringRequired,
|
|
21179
|
+
customHighlight: types.func,
|
|
21180
|
+
customQuery: types.func,
|
|
21181
|
+
defaultQuery: types.func,
|
|
21182
|
+
dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
|
|
21183
|
+
field: VueTypes.string,
|
|
21184
|
+
weight: VueTypes.number
|
|
21185
|
+
}), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
|
|
21186
|
+
field: VueTypes.string,
|
|
21187
|
+
weight: VueTypes.number
|
|
21188
|
+
})]),
|
|
21189
|
+
aggregationField: types.string,
|
|
21190
|
+
aggregationSize: VueTypes.number,
|
|
21191
|
+
size: VueTypes.number,
|
|
21192
|
+
debounce: VueTypes.number.def(0),
|
|
21193
|
+
defaultValue: types.string,
|
|
21194
|
+
excludeFields: types.excludeFields,
|
|
21195
|
+
value: types.value,
|
|
21196
|
+
defaultSuggestions: types.suggestions,
|
|
21197
|
+
enableSynonyms: VueTypes.bool.def(true),
|
|
21198
|
+
enableQuerySuggestions: VueTypes.bool.def(false),
|
|
21199
|
+
enablePopularSuggestions: VueTypes.bool.def(false),
|
|
21200
|
+
enableRecentSuggestions: VueTypes.bool.def(false),
|
|
21201
|
+
fieldWeights: types.fieldWeights,
|
|
21202
|
+
filterLabel: types.string,
|
|
21203
|
+
fuzziness: types.fuzziness,
|
|
21204
|
+
highlight: VueTypes.bool,
|
|
21205
|
+
highlightField: types.stringOrArray,
|
|
21206
|
+
icon: types.children,
|
|
21207
|
+
iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
|
|
21208
|
+
includeFields: types.includeFields,
|
|
21209
|
+
innerClass: types.style,
|
|
21210
|
+
innerRef: VueTypes.string.def('searchInputField'),
|
|
21211
|
+
render: types.func,
|
|
21212
|
+
renderNoSuggestion: types.title,
|
|
21213
|
+
renderError: types.title,
|
|
21214
|
+
placeholder: VueTypes.string.def('Search'),
|
|
21215
|
+
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
21216
|
+
react: types.react,
|
|
21217
|
+
showClear: VueTypes.bool.def(true),
|
|
21218
|
+
showDistinctSuggestions: VueTypes.bool.def(true),
|
|
21219
|
+
showFilter: VueTypes.bool.def(true),
|
|
21220
|
+
showIcon: VueTypes.bool.def(true),
|
|
21221
|
+
title: types.title,
|
|
21222
|
+
theme: types.style,
|
|
21223
|
+
URLParams: VueTypes.bool.def(false),
|
|
21224
|
+
strictSelection: VueTypes.bool.def(false),
|
|
21225
|
+
nestedField: types.string,
|
|
21226
|
+
enablePredictiveSuggestions: VueTypes.bool.def(false),
|
|
21227
|
+
recentSearchesIcon: VueTypes.any,
|
|
21228
|
+
popularSearchesIcon: VueTypes.any,
|
|
21229
|
+
// mic props
|
|
21230
|
+
showVoiceSearch: VueTypes.bool.def(false),
|
|
21231
|
+
getMicInstance: types.func,
|
|
21232
|
+
renderMic: types.func,
|
|
21233
|
+
distinctField: types.string,
|
|
21234
|
+
distinctFieldConfig: types.props,
|
|
21235
|
+
//
|
|
21236
|
+
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
21237
|
+
addonBefore: VueTypes.any,
|
|
21238
|
+
addonAfter: VueTypes.any,
|
|
21239
|
+
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
21240
|
+
index: VueTypes.string,
|
|
21241
|
+
popularSuggestionsConfig: VueTypes.object,
|
|
21242
|
+
recentSuggestionsConfig: VueTypes.object,
|
|
21243
|
+
applyStopwords: VueTypes.bool,
|
|
21244
|
+
customStopwords: types.stringArray,
|
|
21245
|
+
onData: types.func,
|
|
21246
|
+
renderItem: types.func
|
|
21247
|
+
},
|
|
21248
|
+
mounted: function mounted() {
|
|
21249
|
+
this.listenForFocusShortcuts();
|
|
21250
|
+
},
|
|
21251
|
+
watch: {
|
|
21252
|
+
dataField: function dataField(newVal, oldVal) {
|
|
21253
|
+
if (!isEqual$5(newVal, oldVal)) {
|
|
21254
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21255
|
+
}
|
|
21256
|
+
},
|
|
21257
|
+
fieldWeights: function fieldWeights() {
|
|
21258
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21259
|
+
},
|
|
21260
|
+
fuzziness: function fuzziness() {
|
|
21261
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21262
|
+
},
|
|
21263
|
+
queryFormat: function queryFormat() {
|
|
21264
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21265
|
+
},
|
|
21266
|
+
defaultValue: function defaultValue(newVal) {
|
|
21267
|
+
this.setValue(newVal, true, this.$props);
|
|
21268
|
+
},
|
|
21269
|
+
value: function value(newVal, oldVal) {
|
|
21270
|
+
if (!isEqual$5(newVal, oldVal)) {
|
|
21271
|
+
this.setValue(newVal, true, this.$props, newVal === '' ? lib_7.CLEAR_VALUE : undefined, false);
|
|
21272
|
+
}
|
|
21273
|
+
},
|
|
21274
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
21275
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
21276
|
+
this.triggerDefaultQuery(this.$data.currentValue);
|
|
21277
|
+
}
|
|
21278
|
+
},
|
|
21279
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
21280
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
21281
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21282
|
+
}
|
|
21283
|
+
},
|
|
21284
|
+
suggestions: function suggestions(newVal) {
|
|
21285
|
+
var suggestionsList = [];
|
|
21286
|
+
|
|
21287
|
+
if (Array.isArray(newVal) && newVal.length) {
|
|
21288
|
+
suggestionsList = [].concat(withClickIds$1(newVal));
|
|
21289
|
+
} else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
|
|
21290
|
+
suggestionsList = [].concat(withClickIds$1(this.$props.defaultSuggestions));
|
|
21291
|
+
}
|
|
21292
|
+
|
|
21293
|
+
this.normalizedSuggestions = suggestionsList;
|
|
21294
|
+
},
|
|
21295
|
+
selectedValue: function selectedValue(newVal, oldVal) {
|
|
21296
|
+
if (oldVal !== newVal && this.$data.currentValue !== newVal) {
|
|
21297
|
+
if (!newVal && this.$data.currentValue) {
|
|
21298
|
+
// selected value is cleared, call onValueSelected
|
|
21299
|
+
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
21300
|
+
}
|
|
21301
|
+
|
|
21302
|
+
if (this.$props.value === undefined) {
|
|
21303
|
+
this.setValue(newVal || '', true, this.$props);
|
|
21304
|
+
}
|
|
21305
|
+
}
|
|
21306
|
+
},
|
|
21307
|
+
focusShortcuts: function focusShortcuts() {
|
|
21308
|
+
this.listenForFocusShortcuts();
|
|
21309
|
+
},
|
|
21310
|
+
rawData: function rawData(newVal) {
|
|
21311
|
+
this.$emit('on-data', {
|
|
21312
|
+
data: this.normalizedSuggestions,
|
|
21313
|
+
rawData: newVal,
|
|
21314
|
+
aggregationData: this.aggregationData,
|
|
21315
|
+
loading: this.isLoading,
|
|
21316
|
+
error: this.isError
|
|
21317
|
+
});
|
|
21318
|
+
},
|
|
21319
|
+
aggregationData: function aggregationData(newVal) {
|
|
21320
|
+
this.$emit('on-data', {
|
|
21321
|
+
data: this.normalizedSuggestions,
|
|
21322
|
+
rawData: this.rawData,
|
|
21323
|
+
aggregationData: newVal,
|
|
21324
|
+
loading: this.isLoading,
|
|
21325
|
+
error: this.isError
|
|
21326
|
+
});
|
|
21327
|
+
},
|
|
21328
|
+
loading: function loading(newVal) {
|
|
21329
|
+
this.$emit('on-data', {
|
|
21330
|
+
data: this.normalizedSuggestions,
|
|
21331
|
+
rawData: this.rawData,
|
|
21332
|
+
aggregationData: this.aggregationData,
|
|
21333
|
+
loading: newVal,
|
|
21334
|
+
error: this.isError
|
|
21335
|
+
});
|
|
21336
|
+
},
|
|
21337
|
+
error: function error(newVal) {
|
|
21338
|
+
this.$emit('on-data', {
|
|
21339
|
+
data: this.normalizedSuggestions,
|
|
21340
|
+
rawData: this.rawData,
|
|
21341
|
+
aggregationData: this.aggregationData,
|
|
21342
|
+
loading: this.isLoading,
|
|
21343
|
+
error: newVal
|
|
21344
|
+
});
|
|
21345
|
+
},
|
|
21346
|
+
debounce: function debounce(newVal, oldVal) {
|
|
21347
|
+
if (!isEqual$5(newVal, oldVal)) {
|
|
21348
|
+
this.handleTextChange = _debounce(this.handleText, newVal);
|
|
21349
|
+
}
|
|
21350
|
+
}
|
|
21351
|
+
},
|
|
21352
|
+
methods: {
|
|
21353
|
+
handleText: function handleText(value, cause) {
|
|
21354
|
+
if (cause === lib_7.CLEAR_VALUE) {
|
|
21355
|
+
this.triggerCustomQuery(value);
|
|
21356
|
+
this.triggerDefaultQuery(value);
|
|
21357
|
+
} else if (this.$props.autosuggest) {
|
|
21358
|
+
this.triggerDefaultQuery(value);
|
|
21359
|
+
} else {
|
|
21360
|
+
this.triggerCustomQuery(value);
|
|
21361
|
+
}
|
|
21362
|
+
},
|
|
21363
|
+
validateDataField: function validateDataField() {
|
|
21364
|
+
var propName = 'dataField';
|
|
21365
|
+
var componentName = SearchBox.name;
|
|
21366
|
+
var props = this.$props;
|
|
21367
|
+
var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
|
|
21368
|
+
var propValue = props[propName];
|
|
21369
|
+
|
|
21370
|
+
if (!this.enableAppbase) {
|
|
21371
|
+
if (!propValue) {
|
|
21372
|
+
console.error(requiredError);
|
|
21373
|
+
return;
|
|
21374
|
+
}
|
|
21375
|
+
|
|
21376
|
+
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
21377
|
+
console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
|
|
21378
|
+
return;
|
|
21379
|
+
}
|
|
21380
|
+
|
|
21381
|
+
if (Array.isArray(propValue) && propValue.length === 0) {
|
|
21382
|
+
console.error(requiredError);
|
|
21383
|
+
}
|
|
21384
|
+
}
|
|
21385
|
+
},
|
|
21386
|
+
getComponent: function getComponent$1(downshiftProps) {
|
|
21387
|
+
if (downshiftProps === void 0) {
|
|
21388
|
+
downshiftProps = {};
|
|
21389
|
+
}
|
|
21390
|
+
|
|
21391
|
+
var currentValue = this.$data.currentValue;
|
|
21392
|
+
var data = {
|
|
21393
|
+
error: this.error,
|
|
21394
|
+
loading: this.isLoading,
|
|
21395
|
+
downshiftProps: downshiftProps,
|
|
21396
|
+
data: this.normalizedSuggestions,
|
|
21397
|
+
rawData: this.rawData,
|
|
21398
|
+
value: currentValue,
|
|
21399
|
+
resultStats: this.stats
|
|
21400
|
+
};
|
|
21401
|
+
return getComponent(data, this);
|
|
21402
|
+
},
|
|
21403
|
+
// returns size and aggs property
|
|
21404
|
+
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
21405
|
+
var aggregationField = this.$props.aggregationField;
|
|
21406
|
+
var queryOptions = helper_20(this.$props);
|
|
21407
|
+
|
|
21408
|
+
if (aggregationField) {
|
|
21409
|
+
queryOptions.aggs = getCompositeAggsQuery$2({
|
|
21410
|
+
props: this.$props,
|
|
21411
|
+
showTopHits: true
|
|
21412
|
+
}).aggs;
|
|
21413
|
+
}
|
|
21414
|
+
|
|
21415
|
+
return queryOptions;
|
|
21416
|
+
},
|
|
21417
|
+
handleSearchIconClick: function handleSearchIconClick() {
|
|
21418
|
+
var currentValue = this.currentValue;
|
|
21419
|
+
|
|
21420
|
+
if (currentValue.trim()) {
|
|
21421
|
+
this.setValue(currentValue, true);
|
|
21422
|
+
this.onValueSelectedHandler(currentValue, lib_7.SEARCH_ICON_CLICK);
|
|
21423
|
+
}
|
|
21424
|
+
},
|
|
21425
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
21426
|
+
var _this = this;
|
|
21427
|
+
|
|
21428
|
+
if (isDefaultValue === void 0) {
|
|
21429
|
+
isDefaultValue = false;
|
|
21430
|
+
}
|
|
21431
|
+
|
|
21432
|
+
if (props === void 0) {
|
|
21433
|
+
props = this.$props;
|
|
21434
|
+
}
|
|
21435
|
+
|
|
21436
|
+
if (toggleIsOpen === void 0) {
|
|
21437
|
+
toggleIsOpen = true;
|
|
21438
|
+
}
|
|
21439
|
+
|
|
21440
|
+
if (categoryValue === void 0) {
|
|
21441
|
+
categoryValue = undefined;
|
|
21442
|
+
}
|
|
21443
|
+
|
|
21444
|
+
var performUpdate = function performUpdate() {
|
|
21445
|
+
_this.currentValue = value;
|
|
21446
|
+
|
|
21447
|
+
if (isDefaultValue) {
|
|
21448
|
+
if (_this.$props.autosuggest) {
|
|
21449
|
+
if (toggleIsOpen) {
|
|
21450
|
+
_this.isOpen = false;
|
|
21451
|
+
}
|
|
21452
|
+
|
|
21453
|
+
_this.triggerDefaultQuery(value);
|
|
21454
|
+
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
21455
|
+
// to set the query otherwise the value should reset
|
|
21456
|
+
|
|
21457
|
+
|
|
21458
|
+
if (props.strictSelection) {
|
|
21459
|
+
if (cause === lib_7.SUGGESTION_SELECT || value === '') {
|
|
21460
|
+
_this.triggerCustomQuery(value, categoryValue);
|
|
21461
|
+
} else {
|
|
21462
|
+
_this.setValue('', true);
|
|
21463
|
+
}
|
|
21464
|
+
} else if (props.value === undefined) {
|
|
21465
|
+
_this.triggerCustomQuery(value, categoryValue);
|
|
21466
|
+
}
|
|
21467
|
+
} else {
|
|
21468
|
+
// debounce for handling text while typing
|
|
21469
|
+
_this.handleTextChange(value, cause);
|
|
21470
|
+
}
|
|
21471
|
+
|
|
21472
|
+
_this.$emit('valueChange', value);
|
|
21473
|
+
|
|
21474
|
+
_this.$emit('value-change', value);
|
|
21475
|
+
};
|
|
21476
|
+
|
|
21477
|
+
checkValueChange$1(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
21478
|
+
},
|
|
21479
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
|
|
21480
|
+
if (!this.$props.autosuggest) {
|
|
21481
|
+
return;
|
|
21482
|
+
}
|
|
21483
|
+
|
|
21484
|
+
var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
|
|
21485
|
+
var query = SearchBox.defaultQuery(value, this.$props);
|
|
21486
|
+
|
|
21487
|
+
if (this.defaultQuery) {
|
|
21488
|
+
var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
|
|
21489
|
+
|
|
21490
|
+
if (defaultQueryToBeSet.query) {
|
|
21491
|
+
query = defaultQueryToBeSet.query;
|
|
21492
|
+
} // Update calculated default query in store
|
|
21493
|
+
|
|
21494
|
+
|
|
21495
|
+
updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
|
|
21496
|
+
}
|
|
21497
|
+
|
|
21498
|
+
this.updateQuery({
|
|
21499
|
+
componentId: this.internalComponent,
|
|
21500
|
+
query: query,
|
|
21501
|
+
value: value,
|
|
21502
|
+
componentType: constants_1$1.searchBox
|
|
21503
|
+
});
|
|
21504
|
+
},
|
|
21505
|
+
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
21506
|
+
if (categoryValue === void 0) {
|
|
21507
|
+
categoryValue = undefined;
|
|
21508
|
+
}
|
|
21509
|
+
|
|
21510
|
+
var _this$$props2 = this.$props,
|
|
21511
|
+
customQuery = _this$$props2.customQuery,
|
|
21512
|
+
filterLabel = _this$$props2.filterLabel,
|
|
21513
|
+
showFilter = _this$$props2.showFilter,
|
|
21514
|
+
URLParams = _this$$props2.URLParams;
|
|
21515
|
+
var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
|
|
21516
|
+
var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
|
|
21517
|
+
var query = defaultQueryTobeSet;
|
|
21518
|
+
|
|
21519
|
+
if (customQuery) {
|
|
21520
|
+
var customQueryTobeSet = customQuery(value, this.$props);
|
|
21521
|
+
var queryTobeSet = customQueryTobeSet.query;
|
|
21522
|
+
|
|
21523
|
+
if (queryTobeSet) {
|
|
21524
|
+
query = queryTobeSet;
|
|
21525
|
+
}
|
|
21526
|
+
|
|
21527
|
+
updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
|
|
21528
|
+
}
|
|
21529
|
+
|
|
21530
|
+
this.updateQuery({
|
|
21531
|
+
componentId: this.$props.componentId,
|
|
21532
|
+
query: query,
|
|
21533
|
+
value: value,
|
|
21534
|
+
label: filterLabel,
|
|
21535
|
+
showFilter: showFilter,
|
|
21536
|
+
URLParams: URLParams,
|
|
21537
|
+
componentType: constants_1$1.searchBox,
|
|
21538
|
+
category: categoryValue
|
|
21539
|
+
});
|
|
21540
|
+
},
|
|
21541
|
+
handleFocus: function handleFocus(event) {
|
|
21542
|
+
if (this.$props.autosuggest) {
|
|
21543
|
+
this.isOpen = true;
|
|
21544
|
+
}
|
|
21545
|
+
|
|
21546
|
+
this.$emit('focus', event);
|
|
21547
|
+
},
|
|
21548
|
+
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
21549
|
+
var results = _ref.results;
|
|
21550
|
+
|
|
21551
|
+
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
21552
|
+
this.setValue(results[0][0].transcript.trim(), true);
|
|
21553
|
+
}
|
|
21554
|
+
},
|
|
21555
|
+
triggerQuery: function triggerQuery(_ref2) {
|
|
21556
|
+
var _ref2$isOpen = _ref2.isOpen,
|
|
21557
|
+
isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
|
|
21558
|
+
_ref2$customQuery = _ref2.customQuery,
|
|
21559
|
+
customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
|
|
21560
|
+
_ref2$defaultQuery = _ref2.defaultQuery,
|
|
21561
|
+
defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
|
|
21562
|
+
_ref2$value = _ref2.value,
|
|
21563
|
+
value = _ref2$value === void 0 ? undefined : _ref2$value,
|
|
21564
|
+
_ref2$categoryValue = _ref2.categoryValue,
|
|
21565
|
+
categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
|
|
21566
|
+
|
|
21567
|
+
if (typeof isOpen === 'boolean') {
|
|
21568
|
+
this.isOpen = isOpen;
|
|
21569
|
+
}
|
|
21570
|
+
|
|
21571
|
+
if (customQuery) {
|
|
21572
|
+
this.triggerCustomQuery(value, categoryValue);
|
|
21573
|
+
}
|
|
21574
|
+
|
|
21575
|
+
if (defaultQuery) {
|
|
21576
|
+
this.triggerDefaultQuery(value);
|
|
21577
|
+
}
|
|
21578
|
+
},
|
|
21579
|
+
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
21580
|
+
// click analytics would only work client side and after javascript loads
|
|
21581
|
+
var docId = documentId;
|
|
21582
|
+
|
|
21583
|
+
if (!docId) {
|
|
21584
|
+
var hitData = this.normalizedSuggestions.find(function (hit) {
|
|
21585
|
+
return hit._click_id === searchPosition;
|
|
21586
|
+
});
|
|
21587
|
+
|
|
21588
|
+
if (hitData && hitData.source && hitData.source._id) {
|
|
21589
|
+
docId = hitData.source._id;
|
|
21590
|
+
}
|
|
21591
|
+
}
|
|
21592
|
+
|
|
21593
|
+
this.recordSuggestionClick(searchPosition, docId);
|
|
21594
|
+
},
|
|
21595
|
+
clearValue: function clearValue() {
|
|
21596
|
+
this.setValue('', false, this.$props, lib_7.CLEAR_VALUE, false);
|
|
21597
|
+
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
21598
|
+
},
|
|
21599
|
+
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
21600
|
+
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
21601
|
+
if (event.key === 'Enter' && highlightedIndex === null) {
|
|
21602
|
+
this.setValue(event.target.value, true);
|
|
21603
|
+
this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
|
|
21604
|
+
} // Need to review
|
|
21605
|
+
|
|
21606
|
+
|
|
21607
|
+
this.$emit('keyDown', event, this.triggerQuery);
|
|
21608
|
+
this.$emit('key-down', event, this.triggerQuery);
|
|
21609
|
+
},
|
|
21610
|
+
onInputChange: function onInputChange(e) {
|
|
21611
|
+
var _this2 = this;
|
|
21612
|
+
|
|
21613
|
+
var inputValue = e.target.value;
|
|
21614
|
+
|
|
21615
|
+
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
21616
|
+
this.isOpen = true;
|
|
21617
|
+
}
|
|
21618
|
+
|
|
21619
|
+
var value = this.$props.value;
|
|
21620
|
+
|
|
21621
|
+
if (value === undefined) {
|
|
21622
|
+
this.setValue(inputValue, false, this.$props, inputValue === '' ? lib_7.CLEAR_VALUE : undefined);
|
|
21623
|
+
} else {
|
|
21624
|
+
this.$emit('change', inputValue, function (_ref3) {
|
|
21625
|
+
var isOpen = _ref3.isOpen;
|
|
21626
|
+
return _this2.triggerQuery({
|
|
21627
|
+
defaultQuery: true,
|
|
21628
|
+
customQuery: true,
|
|
21629
|
+
value: inputValue,
|
|
21630
|
+
isOpen: isOpen
|
|
21631
|
+
});
|
|
21632
|
+
}, e);
|
|
21633
|
+
}
|
|
21634
|
+
},
|
|
21635
|
+
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
21636
|
+
var _this3 = this;
|
|
21637
|
+
|
|
21638
|
+
this.isOpen = false;
|
|
21639
|
+
var value = this.$props.value; // Record analytics for selected suggestions
|
|
21640
|
+
|
|
21641
|
+
this.triggerClickAnalytics(suggestion._click_id);
|
|
21642
|
+
|
|
21643
|
+
if (value === undefined) {
|
|
21644
|
+
this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT, false, suggestion._category);
|
|
21645
|
+
} else {
|
|
21646
|
+
this.$emit('change', suggestion.value, function (_ref4) {
|
|
21647
|
+
var isOpen = _ref4.isOpen;
|
|
21648
|
+
return _this3.triggerQuery({
|
|
21649
|
+
isOpen: isOpen,
|
|
21650
|
+
value: suggestion.value,
|
|
21651
|
+
categoryValue: suggestion._category
|
|
21652
|
+
});
|
|
21653
|
+
});
|
|
21654
|
+
}
|
|
21655
|
+
|
|
21656
|
+
this.onValueSelectedHandler(suggestion.value, lib_7.SUGGESTION_SELECT, suggestion.source);
|
|
21657
|
+
},
|
|
21658
|
+
onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
|
|
21659
|
+
if (currentValue === void 0) {
|
|
21660
|
+
currentValue = this.$data.currentValue;
|
|
21661
|
+
}
|
|
21662
|
+
|
|
21663
|
+
for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
21664
|
+
cause[_key - 1] = arguments[_key];
|
|
21665
|
+
}
|
|
21666
|
+
|
|
21667
|
+
this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
|
|
21668
|
+
this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
|
|
21669
|
+
},
|
|
21670
|
+
handleStateChange: function handleStateChange(changes) {
|
|
21671
|
+
var isOpen = changes.isOpen;
|
|
21672
|
+
this.isOpen = isOpen;
|
|
21673
|
+
},
|
|
21674
|
+
getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
|
|
21675
|
+
var isDark = this.themePreset === 'dark';
|
|
21676
|
+
|
|
21677
|
+
if (isDark) {
|
|
21678
|
+
return highlightedIndex === index ? '#555' : '#424242';
|
|
21679
|
+
}
|
|
21680
|
+
|
|
21681
|
+
return highlightedIndex === index ? '#eee' : '#fff';
|
|
21682
|
+
},
|
|
21683
|
+
renderIcon: function renderIcon() {
|
|
21684
|
+
var h = this.$createElement;
|
|
21685
|
+
|
|
21686
|
+
if (this.$props.showIcon) {
|
|
21687
|
+
return this.$props.icon || h(SearchSvg);
|
|
21688
|
+
}
|
|
21689
|
+
|
|
21690
|
+
return null;
|
|
21691
|
+
},
|
|
21692
|
+
renderErrorComponent: function renderErrorComponent() {
|
|
21693
|
+
var h = this.$createElement;
|
|
21694
|
+
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
21695
|
+
|
|
21696
|
+
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
21697
|
+
return h(SuggestionWrapper, {
|
|
21698
|
+
"attrs": {
|
|
21699
|
+
"innerClass": this.$props.innerClass,
|
|
21700
|
+
"innerClassName": "error",
|
|
21701
|
+
"theme": this.theme,
|
|
21702
|
+
"themePreset": this.themePreset
|
|
21703
|
+
}
|
|
21704
|
+
}, [isFunction$1(renderError) ? renderError(this.error) : renderError]);
|
|
21705
|
+
}
|
|
21706
|
+
|
|
21707
|
+
return null;
|
|
21708
|
+
},
|
|
21709
|
+
renderCancelIcon: function renderCancelIcon() {
|
|
21710
|
+
var h = this.$createElement;
|
|
21711
|
+
|
|
21712
|
+
if (this.$props.showClear) {
|
|
21713
|
+
return this.$props.clearIcon || h(CancelSvg);
|
|
21714
|
+
}
|
|
21715
|
+
|
|
21716
|
+
return null;
|
|
21717
|
+
},
|
|
21718
|
+
renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
|
|
21719
|
+
if (finalSuggestionsList === void 0) {
|
|
21720
|
+
finalSuggestionsList = [];
|
|
21721
|
+
}
|
|
21722
|
+
|
|
21723
|
+
var h = this.$createElement;
|
|
21724
|
+
var _this$$props3 = this.$props,
|
|
21725
|
+
theme = _this$$props3.theme,
|
|
21726
|
+
innerClass = _this$$props3.innerClass;
|
|
21727
|
+
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
21728
|
+
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
21729
|
+
var _this$$data = this.$data,
|
|
21730
|
+
isOpen = _this$$data.isOpen,
|
|
21731
|
+
currentValue = _this$$data.currentValue;
|
|
21732
|
+
|
|
21733
|
+
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
21734
|
+
return h(SuggestionWrapper, {
|
|
21735
|
+
"attrs": {
|
|
21736
|
+
"innerClass": innerClass,
|
|
21737
|
+
"themePreset": this.themePreset,
|
|
21738
|
+
"theme": theme,
|
|
21739
|
+
"innerClassName": "noSuggestion"
|
|
21740
|
+
},
|
|
21741
|
+
"scopedSlots": {
|
|
21742
|
+
"default": function _default() {
|
|
21743
|
+
return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
|
|
21744
|
+
}
|
|
21745
|
+
}
|
|
21746
|
+
});
|
|
21747
|
+
}
|
|
21748
|
+
|
|
21749
|
+
return null;
|
|
21750
|
+
},
|
|
21751
|
+
renderInputAddonBefore: function renderInputAddonBefore() {
|
|
21752
|
+
var h = this.$createElement;
|
|
21753
|
+
var addonBefore = this.$scopedSlots.addonBefore;
|
|
21754
|
+
|
|
21755
|
+
if (addonBefore) {
|
|
21756
|
+
return h(InputAddon, {
|
|
21757
|
+
"class": "addon-before"
|
|
21758
|
+
}, [addonBefore()]);
|
|
21759
|
+
}
|
|
21760
|
+
|
|
21761
|
+
return null;
|
|
21762
|
+
},
|
|
21763
|
+
renderInputAddonAfter: function renderInputAddonAfter() {
|
|
21764
|
+
var h = this.$createElement;
|
|
21765
|
+
var addonAfter = this.$scopedSlots.addonAfter;
|
|
21766
|
+
|
|
21767
|
+
if (addonAfter) {
|
|
21768
|
+
return h(InputAddon, {
|
|
21769
|
+
"class": "addon-after"
|
|
21770
|
+
}, [addonAfter()]);
|
|
21771
|
+
}
|
|
21772
|
+
|
|
21773
|
+
return null;
|
|
21774
|
+
},
|
|
21775
|
+
renderIcons: function renderIcons() {
|
|
21776
|
+
var h = this.$createElement;
|
|
21777
|
+
var _this$$props4 = this.$props,
|
|
21778
|
+
iconPosition = _this$$props4.iconPosition,
|
|
21779
|
+
showClear = _this$$props4.showClear,
|
|
21780
|
+
innerClass = _this$$props4.innerClass,
|
|
21781
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
21782
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
21783
|
+
showIcon = _this$$props4.showIcon;
|
|
21784
|
+
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
21785
|
+
var currentValue = this.$data.currentValue;
|
|
21786
|
+
return h("div", [h(IconGroup, {
|
|
21787
|
+
"attrs": {
|
|
21788
|
+
"groupPosition": "right",
|
|
21789
|
+
"positionType": "absolute"
|
|
21790
|
+
}
|
|
21791
|
+
}, [currentValue && showClear && h(IconWrapper, {
|
|
21792
|
+
"on": {
|
|
21793
|
+
"click": this.clearValue
|
|
21794
|
+
},
|
|
21795
|
+
"attrs": {
|
|
21796
|
+
"showIcon": showIcon,
|
|
21797
|
+
"isClearIcon": true
|
|
21798
|
+
}
|
|
21799
|
+
}, [this.renderCancelIcon()]), showVoiceSearch && h(Mic, {
|
|
21800
|
+
"attrs": {
|
|
21801
|
+
"getInstance": getMicInstance,
|
|
21802
|
+
"render": renderMic,
|
|
21803
|
+
"handleResult": this.handleVoiceResults,
|
|
21804
|
+
"className": getClassName$4(innerClass, 'mic') || null
|
|
21805
|
+
}
|
|
21806
|
+
}), iconPosition === 'right' && showIcon && h(IconWrapper, {
|
|
21807
|
+
"on": {
|
|
21808
|
+
"click": this.handleSearchIconClick
|
|
21809
|
+
}
|
|
21810
|
+
}, [this.renderIcon()])]), h(IconGroup, {
|
|
21811
|
+
"attrs": {
|
|
21812
|
+
"groupPosition": "left",
|
|
21813
|
+
"positionType": "absolute"
|
|
21814
|
+
}
|
|
21815
|
+
}, [iconPosition === 'left' && showIcon && h(IconWrapper, {
|
|
21816
|
+
"on": {
|
|
21817
|
+
"click": this.handleSearchIconClick
|
|
21818
|
+
}
|
|
21819
|
+
}, [this.renderIcon()])])]);
|
|
21820
|
+
},
|
|
21821
|
+
focusSearchBox: function focusSearchBox(event) {
|
|
21822
|
+
var _this$$refs, _this$$refs$this$$pro;
|
|
21823
|
+
|
|
21824
|
+
var elt = event.target || event.srcElement;
|
|
21825
|
+
var tagName = elt.tagName;
|
|
21826
|
+
|
|
21827
|
+
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
21828
|
+
// already in an input
|
|
21829
|
+
return;
|
|
21830
|
+
}
|
|
21831
|
+
|
|
21832
|
+
(_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
|
|
21833
|
+
},
|
|
21834
|
+
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
21835
|
+
var _this4 = this;
|
|
21836
|
+
|
|
21837
|
+
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
21838
|
+
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
21839
|
+
|
|
21840
|
+
if (isEmpty(focusShortcuts)) {
|
|
21841
|
+
return;
|
|
21842
|
+
}
|
|
21843
|
+
|
|
21844
|
+
var shortcutsString = parseFocusShortcuts(focusShortcuts).join(','); // handler for alphabets and other key combinations
|
|
21845
|
+
|
|
21846
|
+
hotkeys(shortcutsString, // eslint-disable-next-line no-unused-vars
|
|
21847
|
+
|
|
21848
|
+
/* eslint-disable no-shadow */
|
|
21849
|
+
function (event, handler) {
|
|
21850
|
+
// Prevent the default refresh event under WINDOWS system
|
|
21851
|
+
event.preventDefault();
|
|
21852
|
+
|
|
21853
|
+
_this4.focusSearchBox(event);
|
|
21854
|
+
}); // if one of modifier keys are used, they are handled below
|
|
21855
|
+
|
|
21856
|
+
hotkeys('*', function (event) {
|
|
21857
|
+
var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
|
|
21858
|
+
if (modifierKeys.length === 0) return;
|
|
21859
|
+
|
|
21860
|
+
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
21861
|
+
var element = modifierKeys[index];
|
|
21862
|
+
|
|
21863
|
+
if (hotkeys[element]) {
|
|
21864
|
+
_this4.focusSearchBox(event);
|
|
21865
|
+
|
|
21866
|
+
break;
|
|
21867
|
+
}
|
|
21868
|
+
}
|
|
21869
|
+
});
|
|
21870
|
+
},
|
|
21871
|
+
onAutofillClick: function onAutofillClick(suggestion) {
|
|
21872
|
+
var value = suggestion.value;
|
|
21873
|
+
this.isOpen = true;
|
|
21874
|
+
this.currentValue = value;
|
|
21875
|
+
this.triggerDefaultQuery(value);
|
|
21876
|
+
},
|
|
21877
|
+
renderAutoFill: function renderAutoFill(suggestion) {
|
|
21878
|
+
var _this5 = this;
|
|
21879
|
+
|
|
21880
|
+
var h = this.$createElement;
|
|
21881
|
+
|
|
21882
|
+
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
21883
|
+
e.stopPropagation();
|
|
21884
|
+
|
|
21885
|
+
_this5.onAutofillClick(suggestion);
|
|
21886
|
+
};
|
|
21887
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
21888
|
+
|
|
21889
|
+
|
|
21890
|
+
return suggestion._category ? null : h(AutoFillSvg, {
|
|
21891
|
+
"on": {
|
|
21892
|
+
"click": handleAutoFillClick
|
|
21893
|
+
}
|
|
21894
|
+
});
|
|
21895
|
+
}
|
|
21896
|
+
},
|
|
21897
|
+
render: function render() {
|
|
21898
|
+
var _this6 = this;
|
|
21899
|
+
|
|
21900
|
+
var h = arguments[0];
|
|
21901
|
+
var _this$$props5 = this.$props,
|
|
21902
|
+
theme = _this$$props5.theme,
|
|
21903
|
+
expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer;
|
|
21904
|
+
var _this$$scopedSlots = this.$scopedSlots,
|
|
21905
|
+
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
21906
|
+
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
21907
|
+
var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
|
|
21908
|
+
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
21909
|
+
return h(Container, {
|
|
21910
|
+
"class": this.$props.className
|
|
21911
|
+
}, [this.$props.title && h(Title, {
|
|
21912
|
+
"class": getClassName$4(this.$props.innerClass, 'title') || ''
|
|
21913
|
+
}, [this.$props.title]), this.$props.autosuggest ? h(Downshift, {
|
|
21914
|
+
"attrs": {
|
|
21915
|
+
"id": this.$props.componentId + "-downshift",
|
|
21916
|
+
"handleChange": this.onSuggestionSelected,
|
|
21917
|
+
"handleMouseup": this.handleStateChange,
|
|
21918
|
+
"isOpen": this.$data.isOpen
|
|
21919
|
+
},
|
|
21920
|
+
"scopedSlots": {
|
|
21921
|
+
"default": function _default(_ref5) {
|
|
21922
|
+
var getInputEvents = _ref5.getInputEvents,
|
|
21923
|
+
getInputProps = _ref5.getInputProps,
|
|
21924
|
+
getItemProps = _ref5.getItemProps,
|
|
21925
|
+
getItemEvents = _ref5.getItemEvents,
|
|
21926
|
+
isOpen = _ref5.isOpen,
|
|
21927
|
+
highlightedIndex = _ref5.highlightedIndex,
|
|
21928
|
+
setHighlightedIndex = _ref5.setHighlightedIndex;
|
|
21929
|
+
|
|
21930
|
+
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
21931
|
+
var getIcon = function getIcon(iconType) {
|
|
21932
|
+
switch (iconType) {
|
|
21933
|
+
case helper_1.Recent:
|
|
21934
|
+
return recentSearchesIcon;
|
|
21935
|
+
|
|
21936
|
+
case helper_1.Popular:
|
|
21937
|
+
return popularSearchesIcon;
|
|
21938
|
+
|
|
21939
|
+
default:
|
|
21940
|
+
return null;
|
|
21941
|
+
}
|
|
21942
|
+
};
|
|
21943
|
+
|
|
21944
|
+
return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
|
|
21945
|
+
isOpen: isOpen,
|
|
21946
|
+
getItemProps: getItemProps,
|
|
21947
|
+
getItemEvents: getItemEvents,
|
|
21948
|
+
highlightedIndex: highlightedIndex
|
|
21949
|
+
}), _this6.renderErrorComponent(), !_this6.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
21950
|
+
"class": suggestions$1(_this6.themePreset, theme) + " " + getClassName$4(_this6.$props.innerClass, 'list')
|
|
21951
|
+
}, [_this6.normalizedSuggestions.map(function (item, index) {
|
|
21952
|
+
return renderItem ? h("li", {
|
|
21953
|
+
"domProps": _extends({}, getItemProps({
|
|
21954
|
+
item: item
|
|
21955
|
+
})),
|
|
21956
|
+
"on": _extends({}, getItemEvents({
|
|
21957
|
+
item: item
|
|
21958
|
+
})),
|
|
21959
|
+
"key": index + 1 + "-" + item.value,
|
|
21960
|
+
"style": {
|
|
21961
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
|
|
21962
|
+
justifyContent: 'flex-start',
|
|
21963
|
+
alignItems: 'center'
|
|
21964
|
+
}
|
|
21965
|
+
}, [renderItem(item)]) : h("li", {
|
|
21966
|
+
"domProps": _extends({}, getItemProps({
|
|
21967
|
+
item: item
|
|
21968
|
+
})),
|
|
21969
|
+
"on": _extends({}, getItemEvents({
|
|
21970
|
+
item: item
|
|
21971
|
+
})),
|
|
21972
|
+
"key": index + 1 + "-" + item.value,
|
|
21973
|
+
"style": {
|
|
21974
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
|
|
21975
|
+
justifyContent: 'flex-start',
|
|
21976
|
+
alignItems: 'center'
|
|
21977
|
+
}
|
|
21978
|
+
}, [h("div", {
|
|
21979
|
+
"style": {
|
|
21980
|
+
padding: '0 10px 0 0',
|
|
21981
|
+
display: 'flex'
|
|
21982
|
+
}
|
|
21983
|
+
}, [h(CustomSvg, {
|
|
21984
|
+
"attrs": {
|
|
21985
|
+
"className": getClassName$4(_this6.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
21986
|
+
"icon": getIcon(item._suggestion_type),
|
|
21987
|
+
"type": item._suggestion_type + "-search-icon"
|
|
21988
|
+
}
|
|
21989
|
+
})]), h(SuggestionItem, {
|
|
21990
|
+
"attrs": {
|
|
21991
|
+
"currentValue": _this6.currentValue,
|
|
21992
|
+
"suggestion": item
|
|
21993
|
+
}
|
|
21994
|
+
}), _this6.renderAutoFill(item)]);
|
|
21995
|
+
})]) : _this6.renderNoSuggestions(_this6.normalizedSuggestions)]);
|
|
21996
|
+
};
|
|
21997
|
+
|
|
21998
|
+
return h("div", {
|
|
21999
|
+
"class": suggestionsContainer
|
|
22000
|
+
}, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
22001
|
+
"attrs": {
|
|
22002
|
+
"id": _this6.$props.componentId + "-input",
|
|
22003
|
+
"showIcon": _this6.$props.showIcon,
|
|
22004
|
+
"showClear": _this6.$props.showClear,
|
|
22005
|
+
"iconPosition": _this6.$props.iconPosition,
|
|
22006
|
+
"placeholder": _this6.$props.placeholder,
|
|
22007
|
+
"autoFocus": _this6.$props.autoFocus,
|
|
22008
|
+
"themePreset": _this6.themePreset,
|
|
22009
|
+
"autocomplete": "off"
|
|
22010
|
+
},
|
|
22011
|
+
"ref": _this6.$props.innerRef,
|
|
22012
|
+
"class": getClassName$4(_this6.$props.innerClass, 'input'),
|
|
22013
|
+
"on": _extends({}, getInputEvents({
|
|
22014
|
+
onInput: _this6.onInputChange,
|
|
22015
|
+
onBlur: function onBlur(e) {
|
|
22016
|
+
_this6.$emit('blur', e, _this6.triggerQuery);
|
|
22017
|
+
},
|
|
22018
|
+
onFocus: _this6.handleFocus,
|
|
22019
|
+
onKeyPress: function onKeyPress(e) {
|
|
22020
|
+
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
22021
|
+
|
|
22022
|
+
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
22023
|
+
},
|
|
22024
|
+
onKeyDown: function onKeyDown(e) {
|
|
22025
|
+
return _this6.handleKeyDown(e, highlightedIndex);
|
|
22026
|
+
},
|
|
22027
|
+
onKeyUp: function onKeyUp(e) {
|
|
22028
|
+
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
22029
|
+
|
|
22030
|
+
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
22031
|
+
},
|
|
22032
|
+
onClick: function onClick() {
|
|
22033
|
+
setHighlightedIndex(null);
|
|
22034
|
+
}
|
|
22035
|
+
})),
|
|
22036
|
+
"domProps": _extends({}, getInputProps({
|
|
22037
|
+
value: _this6.$data.currentValue === null ? '' : _this6.$data.currentValue
|
|
22038
|
+
}))
|
|
22039
|
+
}), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
|
|
22040
|
+
}
|
|
22041
|
+
}
|
|
22042
|
+
}) : h("div", {
|
|
22043
|
+
"class": suggestionsContainer
|
|
22044
|
+
}, [h(InputGroup, [this.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
22045
|
+
"class": getClassName$4(this.$props.innerClass, 'input') || '',
|
|
22046
|
+
"attrs": {
|
|
22047
|
+
"placeholder": this.$props.placeholder,
|
|
22048
|
+
"iconPosition": this.$props.iconPosition,
|
|
22049
|
+
"showIcon": this.$props.showIcon,
|
|
22050
|
+
"showClear": this.$props.showClear,
|
|
22051
|
+
"themePreset": this.themePreset
|
|
22052
|
+
},
|
|
22053
|
+
"on": _extends({}, {
|
|
22054
|
+
blur: function blur(e) {
|
|
22055
|
+
_this6.$emit('blur', e, _this6.triggerQuery);
|
|
22056
|
+
},
|
|
22057
|
+
keypress: function keypress(e) {
|
|
22058
|
+
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
22059
|
+
|
|
22060
|
+
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
22061
|
+
},
|
|
22062
|
+
input: this.onInputChange,
|
|
22063
|
+
focus: function focus(e) {
|
|
22064
|
+
_this6.$emit('focus', e, _this6.triggerQuery);
|
|
22065
|
+
},
|
|
22066
|
+
keydown: function keydown(e) {
|
|
22067
|
+
_this6.$emit('keyDown', e, _this6.triggerQuery);
|
|
22068
|
+
|
|
22069
|
+
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
22070
|
+
},
|
|
22071
|
+
keyup: function keyup(e) {
|
|
22072
|
+
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
22073
|
+
|
|
22074
|
+
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
22075
|
+
}
|
|
22076
|
+
}),
|
|
22077
|
+
"domProps": _extends({}, {
|
|
22078
|
+
autofocus: this.$props.autoFocus,
|
|
22079
|
+
value: this.$data.currentValue ? this.$data.currentValue : ''
|
|
22080
|
+
}),
|
|
22081
|
+
"ref": this.$props.innerRef
|
|
22082
|
+
}), this.renderIcons()]), this.renderInputAddonAfter()])])]);
|
|
22083
|
+
},
|
|
22084
|
+
destroyed: function destroyed() {
|
|
22085
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
22086
|
+
}
|
|
22087
|
+
};
|
|
22088
|
+
|
|
22089
|
+
SearchBox.defaultQuery = function (value, props) {
|
|
22090
|
+
var finalQuery = null;
|
|
22091
|
+
var fields = normalizeDataField$1(props.dataField, props.fieldWeights);
|
|
22092
|
+
finalQuery = {
|
|
22093
|
+
bool: {
|
|
22094
|
+
should: SearchBox.shouldQuery(value, fields, props),
|
|
22095
|
+
minimum_should_match: '1'
|
|
22096
|
+
}
|
|
22097
|
+
};
|
|
22098
|
+
|
|
22099
|
+
if (finalQuery && props.nestedField) {
|
|
22100
|
+
return {
|
|
22101
|
+
query: {
|
|
22102
|
+
nested: {
|
|
22103
|
+
path: props.nestedField,
|
|
22104
|
+
query: finalQuery
|
|
22105
|
+
}
|
|
22106
|
+
}
|
|
22107
|
+
};
|
|
22108
|
+
}
|
|
22109
|
+
|
|
22110
|
+
return finalQuery;
|
|
22111
|
+
};
|
|
22112
|
+
|
|
22113
|
+
SearchBox.shouldQuery = function (value, dataFields, props) {
|
|
22114
|
+
var finalQuery = [];
|
|
22115
|
+
var phrasePrefixFields = [];
|
|
22116
|
+
var fields = dataFields.map(function (dataField) {
|
|
22117
|
+
var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
|
|
22118
|
+
|
|
22119
|
+
if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
|
|
22120
|
+
phrasePrefixFields.push(queryField);
|
|
22121
|
+
}
|
|
22122
|
+
|
|
22123
|
+
return queryField;
|
|
22124
|
+
});
|
|
22125
|
+
|
|
22126
|
+
if (props.searchOperators || props.queryString) {
|
|
22127
|
+
return {
|
|
22128
|
+
query: value,
|
|
22129
|
+
fields: fields,
|
|
22130
|
+
default_operator: props.queryFormat
|
|
22131
|
+
};
|
|
22132
|
+
}
|
|
22133
|
+
|
|
22134
|
+
if (props.queryFormat === 'and') {
|
|
22135
|
+
finalQuery.push({
|
|
22136
|
+
multi_match: {
|
|
22137
|
+
query: value,
|
|
22138
|
+
fields: fields,
|
|
22139
|
+
type: 'cross_fields',
|
|
22140
|
+
operator: 'and'
|
|
22141
|
+
}
|
|
22142
|
+
});
|
|
22143
|
+
finalQuery.push({
|
|
22144
|
+
multi_match: {
|
|
22145
|
+
query: value,
|
|
22146
|
+
fields: fields,
|
|
22147
|
+
type: 'phrase',
|
|
22148
|
+
operator: 'and'
|
|
22149
|
+
}
|
|
22150
|
+
});
|
|
22151
|
+
|
|
22152
|
+
if (phrasePrefixFields.length > 0) {
|
|
22153
|
+
finalQuery.push({
|
|
22154
|
+
multi_match: {
|
|
22155
|
+
query: value,
|
|
22156
|
+
fields: phrasePrefixFields,
|
|
22157
|
+
type: 'phrase_prefix',
|
|
22158
|
+
operator: 'and'
|
|
22159
|
+
}
|
|
22160
|
+
});
|
|
22161
|
+
}
|
|
22162
|
+
|
|
22163
|
+
return finalQuery;
|
|
22164
|
+
}
|
|
22165
|
+
|
|
22166
|
+
finalQuery.push({
|
|
22167
|
+
multi_match: {
|
|
22168
|
+
query: value,
|
|
22169
|
+
fields: fields,
|
|
22170
|
+
type: 'best_fields',
|
|
22171
|
+
operator: 'or',
|
|
22172
|
+
fuzziness: props.fuzziness ? props.fuzziness : 0
|
|
22173
|
+
}
|
|
22174
|
+
});
|
|
22175
|
+
finalQuery.push({
|
|
22176
|
+
multi_match: {
|
|
22177
|
+
query: value,
|
|
22178
|
+
fields: fields,
|
|
22179
|
+
type: 'phrase',
|
|
22180
|
+
operator: 'or'
|
|
22181
|
+
}
|
|
22182
|
+
});
|
|
22183
|
+
|
|
22184
|
+
if (phrasePrefixFields.length > 0) {
|
|
22185
|
+
finalQuery.push({
|
|
22186
|
+
multi_match: {
|
|
22187
|
+
query: value,
|
|
22188
|
+
fields: phrasePrefixFields,
|
|
22189
|
+
type: 'phrase_prefix',
|
|
22190
|
+
operator: 'or'
|
|
22191
|
+
}
|
|
22192
|
+
});
|
|
22193
|
+
}
|
|
22194
|
+
|
|
22195
|
+
return finalQuery;
|
|
22196
|
+
};
|
|
22197
|
+
|
|
22198
|
+
var mapStateToProps$4 = function mapStateToProps(state, props) {
|
|
22199
|
+
return {
|
|
22200
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
22201
|
+
selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
|
|
22202
|
+
suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
22203
|
+
rawData: state.rawData[props.componentId],
|
|
22204
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
22205
|
+
themePreset: state.config.themePreset,
|
|
22206
|
+
isLoading: !!state.isLoading[props.componentId + "_active"],
|
|
22207
|
+
error: state.error[props.componentId],
|
|
22208
|
+
enableAppbase: state.config.enableAppbase,
|
|
22209
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
22210
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
22211
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
22212
|
+
};
|
|
22213
|
+
};
|
|
22214
|
+
|
|
22215
|
+
var mapDispatchToProps$3 = {
|
|
22216
|
+
updateQuery: updateQuery$2,
|
|
22217
|
+
setCustomQuery: setCustomQuery$1,
|
|
22218
|
+
setDefaultQuery: setDefaultQuery$2,
|
|
22219
|
+
recordSuggestionClick: recordSuggestionClick$1
|
|
22220
|
+
};
|
|
22221
|
+
var DSConnected$1 = ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(SearchBox), {
|
|
22222
|
+
componentType: constants_1$1.searchBox,
|
|
22223
|
+
internalComponent: true
|
|
22224
|
+
});
|
|
22225
|
+
|
|
22226
|
+
SearchBox.install = function (Vue) {
|
|
22227
|
+
Vue.component(SearchBox.name, DSConnected$1);
|
|
22228
|
+
}; // Add componentType for SSR
|
|
22229
|
+
|
|
22230
|
+
|
|
22231
|
+
SearchBox.componentType = constants_1$1.searchBox;
|
|
22232
|
+
|
|
22233
|
+
var _templateObject$k, _templateObject2$7, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$3;
|
|
22234
|
+
var item = {
|
|
22235
|
+
width: '15px',
|
|
22236
|
+
height: '15px',
|
|
22237
|
+
scale: '4px'
|
|
22238
|
+
};
|
|
22239
|
+
var vh = css(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n"])));
|
|
22240
|
+
var hideInputControl = css(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n"])));
|
|
22241
|
+
|
|
22242
|
+
var formItem = function formItem(_ref) {
|
|
22243
|
+
var theme = _ref.theme;
|
|
22244
|
+
return css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, curriedLighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
|
|
22245
|
+
};
|
|
22246
|
+
|
|
22247
|
+
var Radio = index$1('input')(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
22248
|
+
return props.show ? null : hideInputControl;
|
|
22249
|
+
}, function (_ref2) {
|
|
22250
|
+
var theme = _ref2.theme;
|
|
22251
|
+
return theme.colors.primaryColor;
|
|
22252
|
+
}, function (_ref3) {
|
|
22253
|
+
var theme = _ref3.theme;
|
|
22254
|
+
return theme.colors.primaryColor;
|
|
22255
|
+
});
|
|
22256
|
+
var Checkbox = index$1('input')(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
22257
|
+
return props.show ? null : hideInputControl;
|
|
22258
|
+
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
22259
|
+
var theme = _ref4.theme;
|
|
22260
|
+
return theme.colors.primaryColor;
|
|
22261
|
+
}, function (_ref5) {
|
|
22262
|
+
var theme = _ref5.theme;
|
|
22263
|
+
return theme.colors.primaryColor;
|
|
22264
|
+
});
|
|
22265
|
+
var UL = index$1('ul')(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
|
|
22266
|
+
|
|
22267
|
+
var getAggsOrder = lib_8.getAggsOrder;
|
|
22268
|
+
|
|
22269
|
+
var extractQuery = function extractQuery(props) {
|
|
22270
|
+
var queryToBeReturned = {};
|
|
22271
|
+
|
|
22272
|
+
if (props.defaultQuery) {
|
|
22273
|
+
var evaluateQuery = props.defaultQuery([], props);
|
|
22274
|
+
|
|
22275
|
+
if (evaluateQuery) {
|
|
22276
|
+
if (evaluateQuery.query) {
|
|
22277
|
+
queryToBeReturned.query = evaluateQuery.query;
|
|
22278
|
+
}
|
|
22279
|
+
|
|
22280
|
+
if (evaluateQuery.aggs) {
|
|
22281
|
+
queryToBeReturned.aggs = evaluateQuery.aggs;
|
|
22282
|
+
}
|
|
22283
|
+
}
|
|
22284
|
+
}
|
|
22285
|
+
|
|
22286
|
+
return queryToBeReturned;
|
|
22287
|
+
}; // eslint-disable-next-line import/prefer-default-export
|
|
22288
|
+
|
|
22289
|
+
|
|
22290
|
+
var getAggsQuery = function getAggsQuery(query, props) {
|
|
22291
|
+
var _clonedQuery$aggs;
|
|
22292
|
+
|
|
22293
|
+
var clonedQuery = query;
|
|
22294
|
+
var dataField = props.dataField,
|
|
22295
|
+
size = props.size,
|
|
22296
|
+
sortBy = props.sortBy,
|
|
22297
|
+
showMissing = props.showMissing,
|
|
22298
|
+
missingLabel = props.missingLabel;
|
|
22299
|
+
clonedQuery.size = 0;
|
|
22300
|
+
clonedQuery.aggs = (_clonedQuery$aggs = {}, _clonedQuery$aggs[dataField] = {
|
|
22301
|
+
terms: _extends({
|
|
22302
|
+
field: dataField,
|
|
22303
|
+
size: size,
|
|
22304
|
+
order: getAggsOrder(sortBy || 'count')
|
|
22305
|
+
}, showMissing ? {
|
|
22306
|
+
missing: missingLabel
|
|
22307
|
+
} : {})
|
|
22308
|
+
}, _clonedQuery$aggs);
|
|
22309
|
+
|
|
22310
|
+
if (props.nestedField) {
|
|
22311
|
+
clonedQuery.aggs = {
|
|
22312
|
+
reactivesearch_nested: {
|
|
22313
|
+
nested: {
|
|
22314
|
+
path: props.nestedField
|
|
22315
|
+
},
|
|
22316
|
+
aggs: clonedQuery.aggs
|
|
22317
|
+
}
|
|
22318
|
+
};
|
|
22319
|
+
}
|
|
22320
|
+
|
|
22321
|
+
return _extends({}, clonedQuery, extractQuery(props));
|
|
22322
|
+
};
|
|
22323
|
+
|
|
22324
|
+
var updateQuery$3 = lib_5.updateQuery,
|
|
22325
|
+
setQueryOptions$2 = lib_5.setQueryOptions,
|
|
22326
|
+
setCustomQuery$2 = lib_5.setCustomQuery,
|
|
22327
|
+
setDefaultQuery$3 = lib_5.setDefaultQuery;
|
|
22328
|
+
var getQueryOptions$1 = lib_8.getQueryOptions,
|
|
22329
|
+
checkValueChange$2 = lib_8.checkValueChange,
|
|
22330
|
+
getClassName$5 = lib_8.getClassName,
|
|
22331
|
+
getOptionsFromQuery$2 = lib_8.getOptionsFromQuery,
|
|
22332
|
+
isEqual$6 = lib_8.isEqual;
|
|
22333
|
+
var SingleList = {
|
|
22334
|
+
name: 'SingleList',
|
|
22335
|
+
props: {
|
|
22336
|
+
beforeValueChange: types.func,
|
|
22337
|
+
className: VueTypes.string.def(''),
|
|
22338
|
+
componentId: types.stringRequired,
|
|
22339
|
+
customQuery: types.func,
|
|
22340
|
+
dataField: types.stringRequired,
|
|
22341
|
+
defaultValue: types.string,
|
|
22342
|
+
value: types.value,
|
|
22343
|
+
defaultQuery: types.func,
|
|
22344
|
+
filterLabel: types.string,
|
|
22345
|
+
innerClass: types.style,
|
|
22346
|
+
placeholder: VueTypes.string.def('Search'),
|
|
22347
|
+
react: types.react,
|
|
22348
|
+
render: types.func,
|
|
22349
|
+
renderItem: types.func,
|
|
22350
|
+
renderNoResults: VueTypes.any,
|
|
22351
|
+
transformData: types.func,
|
|
22352
|
+
selectAllLabel: types.string,
|
|
22353
|
+
showCount: VueTypes.bool.def(true),
|
|
22354
|
+
showFilter: VueTypes.bool.def(true),
|
|
22355
|
+
showRadio: VueTypes.bool.def(true),
|
|
22356
|
+
showSearch: VueTypes.bool.def(true),
|
|
22357
|
+
size: VueTypes.number,
|
|
22358
|
+
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
22359
|
+
title: types.title,
|
|
22360
|
+
URLParams: VueTypes.bool.def(false),
|
|
22361
|
+
showMissing: VueTypes.bool.def(false),
|
|
22362
|
+
missingLabel: VueTypes.string.def('N/A'),
|
|
22363
|
+
nestedField: types.string,
|
|
22364
|
+
index: VueTypes.string,
|
|
22365
|
+
enableStrictSelection: VueTypes.bool.def(false)
|
|
22366
|
+
},
|
|
22367
|
+
data: function data() {
|
|
22368
|
+
var props = this.$props;
|
|
22369
|
+
this.__state = {
|
|
22370
|
+
currentValue: '',
|
|
22371
|
+
modifiedOptions: [],
|
|
22372
|
+
searchTerm: ''
|
|
22373
|
+
};
|
|
22374
|
+
this.internalComponent = props.componentId + "__internal";
|
|
22375
|
+
return this.__state;
|
|
22376
|
+
},
|
|
22377
|
+
created: function created() {
|
|
22378
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
22379
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
22380
|
+
}
|
|
22381
|
+
|
|
22382
|
+
var props = this.$props;
|
|
22383
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
22384
|
+
|
|
22385
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
22386
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
22387
|
+
},
|
|
22388
|
+
beforeMount: function beforeMount() {
|
|
22389
|
+
this.updateQueryHandlerOptions(this.$props);
|
|
22390
|
+
|
|
22391
|
+
if (this.selectedValue) {
|
|
22392
|
+
this.setValue(this.selectedValue);
|
|
22393
|
+
} else if (this.$props.value) {
|
|
22394
|
+
this.setValue(this.$props.value);
|
|
22395
|
+
} else if (this.$props.defaultValue) {
|
|
22396
|
+
this.setValue(this.$props.defaultValue);
|
|
22397
|
+
}
|
|
22398
|
+
},
|
|
22399
|
+
watch: {
|
|
22400
|
+
options: function options(newVal) {
|
|
22401
|
+
if (newVal) {
|
|
22402
|
+
this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
|
|
22403
|
+
}
|
|
22404
|
+
},
|
|
22405
|
+
size: function size() {
|
|
22406
|
+
this.updateQueryHandlerOptions(this.$props);
|
|
22407
|
+
},
|
|
22408
|
+
sortBy: function sortBy() {
|
|
22409
|
+
this.updateQueryHandlerOptions(this.$props);
|
|
22410
|
+
},
|
|
22411
|
+
dataField: function dataField() {
|
|
22412
|
+
this.updateQueryHandlerOptions(this.$props);
|
|
22413
|
+
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
22414
|
+
},
|
|
22415
|
+
defaultValue: function defaultValue(newVal) {
|
|
22416
|
+
this.setValue(newVal);
|
|
22417
|
+
},
|
|
22418
|
+
value: function value(newVal, oldVal) {
|
|
22419
|
+
if (!isEqual$6(newVal, oldVal)) {
|
|
22420
|
+
this.setValue(newVal);
|
|
22421
|
+
}
|
|
22422
|
+
},
|
|
22423
|
+
selectedValue: function selectedValue(newVal) {
|
|
22424
|
+
if (this.$data.currentValue !== newVal) {
|
|
22425
|
+
this.setValue(newVal || '');
|
|
22426
|
+
}
|
|
22427
|
+
},
|
|
22428
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
22429
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
22430
|
+
this.updateDefaultQueryHandler(this.$data.currentValue, this.$props);
|
|
22431
|
+
}
|
|
22432
|
+
},
|
|
22433
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
22434
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
22435
|
+
this.updateQueryHandler(this.componentId, this.$data.currentValue, this.$props);
|
|
22436
|
+
}
|
|
22437
|
+
}
|
|
22438
|
+
},
|
|
22439
|
+
render: function render() {
|
|
22440
|
+
var _this = this;
|
|
22441
|
+
|
|
22442
|
+
var h = arguments[0];
|
|
22443
|
+
var _this$$props = this.$props,
|
|
21236
22444
|
selectAllLabel = _this$$props.selectAllLabel,
|
|
21237
22445
|
renderItem = _this$$props.renderItem,
|
|
21238
22446
|
renderError = _this$$props.renderError;
|
|
@@ -21271,14 +22479,14 @@
|
|
|
21271
22479
|
return h(Container, {
|
|
21272
22480
|
"class": this.$props.className
|
|
21273
22481
|
}, [this.$props.title && h(Title, {
|
|
21274
|
-
"class": getClassName$
|
|
22482
|
+
"class": getClassName$5(this.$props.innerClass, 'title') || ''
|
|
21275
22483
|
}, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
|
|
21276
|
-
"class": getClassName$
|
|
22484
|
+
"class": getClassName$5(this.$props.innerClass, 'list') || ''
|
|
21277
22485
|
}, [selectAllLabel ? h("li", {
|
|
21278
22486
|
"key": selectAllLabel,
|
|
21279
22487
|
"class": "" + (this.$data.currentValue === selectAllLabel ? 'active' : '')
|
|
21280
22488
|
}, [h(Radio, {
|
|
21281
|
-
"class": getClassName$
|
|
22489
|
+
"class": getClassName$5(this.$props.innerClass, 'radio'),
|
|
21282
22490
|
"attrs": {
|
|
21283
22491
|
"id": this.$props.componentId + "-" + selectAllLabel,
|
|
21284
22492
|
"name": this.$props.componentId,
|
|
@@ -21293,7 +22501,7 @@
|
|
|
21293
22501
|
checked: this.$data.currentValue === selectAllLabel
|
|
21294
22502
|
})
|
|
21295
22503
|
}), h("label", {
|
|
21296
|
-
"class": getClassName$
|
|
22504
|
+
"class": getClassName$5(this.$props.innerClass, 'label') || null,
|
|
21297
22505
|
"attrs": {
|
|
21298
22506
|
"for": this.$props.componentId + "-" + selectAllLabel
|
|
21299
22507
|
}
|
|
@@ -21302,7 +22510,7 @@
|
|
|
21302
22510
|
"key": item.key,
|
|
21303
22511
|
"class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
|
|
21304
22512
|
}, [h(Radio, {
|
|
21305
|
-
"class": getClassName$
|
|
22513
|
+
"class": getClassName$5(_this.$props.innerClass, 'radio'),
|
|
21306
22514
|
"attrs": {
|
|
21307
22515
|
"id": _this.$props.componentId + "-" + item.key,
|
|
21308
22516
|
"name": _this.$props.componentId,
|
|
@@ -21318,7 +22526,7 @@
|
|
|
21318
22526
|
checked: _this.currentValue === String(item.key)
|
|
21319
22527
|
})
|
|
21320
22528
|
}), h("label", {
|
|
21321
|
-
"class": getClassName$
|
|
22529
|
+
"class": getClassName$5(_this.$props.innerClass, 'label') || null,
|
|
21322
22530
|
"attrs": {
|
|
21323
22531
|
"for": _this.$props.componentId + "-" + item.key
|
|
21324
22532
|
}
|
|
@@ -21327,7 +22535,7 @@
|
|
|
21327
22535
|
count: item.doc_count,
|
|
21328
22536
|
isChecked: _this.currentValue === String(item.key)
|
|
21329
22537
|
}) : h("span", [item.key, _this.$props.showCount && h("span", {
|
|
21330
|
-
"class": getClassName$
|
|
22538
|
+
"class": getClassName$5(_this.$props.innerClass, 'count') || null
|
|
21331
22539
|
}, ["\xA0(", item.doc_count, ")"])])])]);
|
|
21332
22540
|
})])]);
|
|
21333
22541
|
},
|
|
@@ -21355,7 +22563,7 @@
|
|
|
21355
22563
|
_this2.$emit('value-change', value);
|
|
21356
22564
|
};
|
|
21357
22565
|
|
|
21358
|
-
checkValueChange$
|
|
22566
|
+
checkValueChange$2(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
21359
22567
|
},
|
|
21360
22568
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
21361
22569
|
var defaultQueryOptions;
|
|
@@ -21429,7 +22637,7 @@
|
|
|
21429
22637
|
|
|
21430
22638
|
if (this.$props.showSearch) {
|
|
21431
22639
|
return h(Input, {
|
|
21432
|
-
"class": getClassName$
|
|
22640
|
+
"class": getClassName$5(this.$props.innerClass, 'input') || '',
|
|
21433
22641
|
"on": {
|
|
21434
22642
|
"input": this.handleInputChange
|
|
21435
22643
|
},
|
|
@@ -21492,7 +22700,7 @@
|
|
|
21492
22700
|
var h = this.$createElement;
|
|
21493
22701
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
21494
22702
|
return h("p", {
|
|
21495
|
-
"class": getClassName$
|
|
22703
|
+
"class": getClassName$5(this.$props.innerClass, 'noResults') || null
|
|
21496
22704
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
21497
22705
|
}
|
|
21498
22706
|
},
|
|
@@ -21559,7 +22767,7 @@
|
|
|
21559
22767
|
return query;
|
|
21560
22768
|
};
|
|
21561
22769
|
|
|
21562
|
-
var mapStateToProps$
|
|
22770
|
+
var mapStateToProps$5 = function mapStateToProps(state, props) {
|
|
21563
22771
|
return {
|
|
21564
22772
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
21565
22773
|
rawData: state.rawData[props.componentId],
|
|
@@ -21574,11 +22782,11 @@
|
|
|
21574
22782
|
|
|
21575
22783
|
var mapDispatchtoProps$2 = {
|
|
21576
22784
|
setQueryOptions: setQueryOptions$2,
|
|
21577
|
-
updateQuery: updateQuery$
|
|
21578
|
-
setCustomQuery: setCustomQuery$
|
|
21579
|
-
setDefaultQuery: setDefaultQuery$
|
|
22785
|
+
updateQuery: updateQuery$3,
|
|
22786
|
+
setCustomQuery: setCustomQuery$2,
|
|
22787
|
+
setDefaultQuery: setDefaultQuery$3
|
|
21580
22788
|
};
|
|
21581
|
-
var ListConnected = ComponentWrapper$1(connect(mapStateToProps$
|
|
22789
|
+
var ListConnected = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
|
|
21582
22790
|
componentType: constants_1$1.singleList,
|
|
21583
22791
|
internalComponent: true
|
|
21584
22792
|
});
|
|
@@ -21590,14 +22798,14 @@
|
|
|
21590
22798
|
|
|
21591
22799
|
SingleList.componentType = constants_1$1.singleList;
|
|
21592
22800
|
|
|
21593
|
-
var updateQuery$
|
|
22801
|
+
var updateQuery$4 = lib_5.updateQuery,
|
|
21594
22802
|
setQueryOptions$3 = lib_5.setQueryOptions,
|
|
21595
|
-
setCustomQuery$
|
|
21596
|
-
setDefaultQuery$
|
|
21597
|
-
var isEqual$
|
|
22803
|
+
setCustomQuery$3 = lib_5.setCustomQuery,
|
|
22804
|
+
setDefaultQuery$4 = lib_5.setDefaultQuery;
|
|
22805
|
+
var isEqual$7 = lib_8.isEqual,
|
|
21598
22806
|
getQueryOptions$2 = lib_8.getQueryOptions,
|
|
21599
|
-
checkValueChange$
|
|
21600
|
-
getClassName$
|
|
22807
|
+
checkValueChange$3 = lib_8.checkValueChange,
|
|
22808
|
+
getClassName$6 = lib_8.getClassName,
|
|
21601
22809
|
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery;
|
|
21602
22810
|
var MultiList = {
|
|
21603
22811
|
name: 'MultiList',
|
|
@@ -21657,13 +22865,14 @@
|
|
|
21657
22865
|
},
|
|
21658
22866
|
beforeMount: function beforeMount() {
|
|
21659
22867
|
this.updateQueryHandlerOptions(this.$props);
|
|
22868
|
+
var value = this.selectedValue || this.$props.value || this.$props.defaultValue;
|
|
22869
|
+
this.setValue(value, !this.selectedValue);
|
|
22870
|
+
},
|
|
22871
|
+
mounted: function mounted() {
|
|
22872
|
+
var currentValue = Object.keys(this.$data.currentValue);
|
|
21660
22873
|
|
|
21661
|
-
if (this.
|
|
21662
|
-
this
|
|
21663
|
-
} else if (this.$props.value) {
|
|
21664
|
-
this.setValue(this.$props.value, true);
|
|
21665
|
-
} else if (this.$props.defaultValue) {
|
|
21666
|
-
this.setValue(this.$props.defaultValue, true);
|
|
22874
|
+
if (this.$props.value !== undefined && !isEqual$7(this.$props.value, currentValue)) {
|
|
22875
|
+
this.$emit('change', currentValue);
|
|
21667
22876
|
}
|
|
21668
22877
|
},
|
|
21669
22878
|
watch: {
|
|
@@ -21683,12 +22892,12 @@
|
|
|
21683
22892
|
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
21684
22893
|
},
|
|
21685
22894
|
value: function value(newVal, oldVal) {
|
|
21686
|
-
if (!isEqual$
|
|
22895
|
+
if (!isEqual$7(oldVal, newVal)) {
|
|
21687
22896
|
this.setValue(newVal, true);
|
|
21688
22897
|
}
|
|
21689
22898
|
},
|
|
21690
22899
|
defaultValue: function defaultValue(newVal, oldVal) {
|
|
21691
|
-
if (!isEqual$
|
|
22900
|
+
if (!isEqual$7(oldVal, newVal)) {
|
|
21692
22901
|
this.setValue(newVal, true);
|
|
21693
22902
|
}
|
|
21694
22903
|
},
|
|
@@ -21707,8 +22916,12 @@
|
|
|
21707
22916
|
}
|
|
21708
22917
|
}
|
|
21709
22918
|
|
|
21710
|
-
if (!isEqual$
|
|
21711
|
-
this.
|
|
22919
|
+
if (!isEqual$7(selectedValue, newVal)) {
|
|
22920
|
+
if (this.value === undefined) {
|
|
22921
|
+
this.setValue(newVal, true);
|
|
22922
|
+
} else {
|
|
22923
|
+
this.$emit('change', newVal);
|
|
22924
|
+
}
|
|
21712
22925
|
}
|
|
21713
22926
|
},
|
|
21714
22927
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -21765,9 +22978,9 @@
|
|
|
21765
22978
|
return h(Container, {
|
|
21766
22979
|
"class": this.$props.className
|
|
21767
22980
|
}, [this.$props.title && h(Title, {
|
|
21768
|
-
"class": getClassName$
|
|
22981
|
+
"class": getClassName$6(this.$props.innerClass, 'title')
|
|
21769
22982
|
}, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
|
|
21770
|
-
"class": getClassName$
|
|
22983
|
+
"class": getClassName$6(this.$props.innerClass, 'list')
|
|
21771
22984
|
}, [selectAllLabel ? h("li", {
|
|
21772
22985
|
"key": selectAllLabel,
|
|
21773
22986
|
"class": "" + (this.currentValue[selectAllLabel] ? 'active' : '')
|
|
@@ -21779,7 +22992,7 @@
|
|
|
21779
22992
|
"value": selectAllLabel,
|
|
21780
22993
|
"show": this.$props.showCheckbox
|
|
21781
22994
|
},
|
|
21782
|
-
"class": getClassName$
|
|
22995
|
+
"class": getClassName$6(this.$props.innerClass, 'checkbox'),
|
|
21783
22996
|
"on": {
|
|
21784
22997
|
"click": this.handleClick
|
|
21785
22998
|
},
|
|
@@ -21787,7 +23000,7 @@
|
|
|
21787
23000
|
checked: !!this.currentValue[selectAllLabel]
|
|
21788
23001
|
})
|
|
21789
23002
|
}), h("label", {
|
|
21790
|
-
"class": getClassName$
|
|
23003
|
+
"class": getClassName$6(this.$props.innerClass, 'label'),
|
|
21791
23004
|
"attrs": {
|
|
21792
23005
|
"for": this.$props.componentId + "-" + selectAllLabel
|
|
21793
23006
|
}
|
|
@@ -21803,7 +23016,7 @@
|
|
|
21803
23016
|
"value": item.key,
|
|
21804
23017
|
"show": _this2.$props.showCheckbox
|
|
21805
23018
|
},
|
|
21806
|
-
"class": getClassName$
|
|
23019
|
+
"class": getClassName$6(_this2.$props.innerClass, 'checkbox'),
|
|
21807
23020
|
"on": {
|
|
21808
23021
|
"click": _this2.handleClick
|
|
21809
23022
|
},
|
|
@@ -21811,7 +23024,7 @@
|
|
|
21811
23024
|
checked: !!_this2.$data.currentValue[item.key]
|
|
21812
23025
|
})
|
|
21813
23026
|
}), h("label", {
|
|
21814
|
-
"class": getClassName$
|
|
23027
|
+
"class": getClassName$6(_this2.$props.innerClass, 'label'),
|
|
21815
23028
|
"attrs": {
|
|
21816
23029
|
"for": _this2.$props.componentId + "-" + item.key
|
|
21817
23030
|
}
|
|
@@ -21820,7 +23033,7 @@
|
|
|
21820
23033
|
count: item.doc_count,
|
|
21821
23034
|
isChecked: !!_this2.$data.currentValue[item.key]
|
|
21822
23035
|
}) : h("span", [item.key, _this2.$props.showCount && h("span", {
|
|
21823
|
-
"class": getClassName$
|
|
23036
|
+
"class": getClassName$6(_this2.$props.innerClass, 'count')
|
|
21824
23037
|
}, ["\xA0(", item.doc_count, ")"])])])]);
|
|
21825
23038
|
})])]);
|
|
21826
23039
|
},
|
|
@@ -21904,7 +23117,7 @@
|
|
|
21904
23117
|
_this3.$emit('value-change', finalValues);
|
|
21905
23118
|
};
|
|
21906
23119
|
|
|
21907
|
-
checkValueChange$
|
|
23120
|
+
checkValueChange$3(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
21908
23121
|
},
|
|
21909
23122
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
21910
23123
|
var defaultQueryOptions;
|
|
@@ -21978,7 +23191,7 @@
|
|
|
21978
23191
|
|
|
21979
23192
|
if (this.$props.showSearch) {
|
|
21980
23193
|
return h(Input, {
|
|
21981
|
-
"class": getClassName$
|
|
23194
|
+
"class": getClassName$6(this.$props.innerClass, 'input') || '',
|
|
21982
23195
|
"on": {
|
|
21983
23196
|
"input": this.handleInputChange
|
|
21984
23197
|
},
|
|
@@ -22007,7 +23220,7 @@
|
|
|
22007
23220
|
if (value === undefined) {
|
|
22008
23221
|
this.setValue(currentValue);
|
|
22009
23222
|
} else {
|
|
22010
|
-
var values = parseValueArray(value, currentValue);
|
|
23223
|
+
var values = parseValueArray(value || [], currentValue);
|
|
22011
23224
|
this.$emit('change', values);
|
|
22012
23225
|
}
|
|
22013
23226
|
},
|
|
@@ -22036,7 +23249,7 @@
|
|
|
22036
23249
|
var h = this.$createElement;
|
|
22037
23250
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
22038
23251
|
return h("p", {
|
|
22039
|
-
"class": getClassName$
|
|
23252
|
+
"class": getClassName$6(this.$props.innerClass, 'noResults') || null
|
|
22040
23253
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
22041
23254
|
}
|
|
22042
23255
|
},
|
|
@@ -22137,7 +23350,7 @@
|
|
|
22137
23350
|
return getAggsQuery(queryOptions, props);
|
|
22138
23351
|
};
|
|
22139
23352
|
|
|
22140
|
-
var mapStateToProps$
|
|
23353
|
+
var mapStateToProps$6 = function mapStateToProps(state, props) {
|
|
22141
23354
|
return {
|
|
22142
23355
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
22143
23356
|
rawData: state.rawData[props.componentId],
|
|
@@ -22152,11 +23365,11 @@
|
|
|
22152
23365
|
|
|
22153
23366
|
var mapDispatchtoProps$3 = {
|
|
22154
23367
|
setQueryOptions: setQueryOptions$3,
|
|
22155
|
-
updateQuery: updateQuery$
|
|
22156
|
-
setCustomQuery: setCustomQuery$
|
|
22157
|
-
setDefaultQuery: setDefaultQuery$
|
|
23368
|
+
updateQuery: updateQuery$4,
|
|
23369
|
+
setCustomQuery: setCustomQuery$3,
|
|
23370
|
+
setDefaultQuery: setDefaultQuery$4
|
|
22158
23371
|
};
|
|
22159
|
-
var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$
|
|
23372
|
+
var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
|
|
22160
23373
|
componentType: constants_1$1.multiList,
|
|
22161
23374
|
internalComponent: true
|
|
22162
23375
|
});
|
|
@@ -22168,8 +23381,8 @@
|
|
|
22168
23381
|
|
|
22169
23382
|
MultiList.componentType = constants_1$1.multiList;
|
|
22170
23383
|
|
|
22171
|
-
var _templateObject$
|
|
22172
|
-
var small = css(_templateObject$
|
|
23384
|
+
var _templateObject$l, _templateObject2$8, _templateObject3$7, _templateObject4$6;
|
|
23385
|
+
var small = css(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"])));
|
|
22173
23386
|
|
|
22174
23387
|
var dark$2 = function dark(_ref) {
|
|
22175
23388
|
var theme = _ref.theme;
|
|
@@ -22187,13 +23400,13 @@
|
|
|
22187
23400
|
return theme.colors.primaryColor;
|
|
22188
23401
|
});
|
|
22189
23402
|
|
|
22190
|
-
var _templateObject$
|
|
22191
|
-
var open = css(_templateObject$
|
|
23403
|
+
var _templateObject$m, _templateObject2$9;
|
|
23404
|
+
var open = css(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
|
|
22192
23405
|
var Chevron = index$1('span')(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
|
|
22193
23406
|
return props.open ? open : null;
|
|
22194
23407
|
});
|
|
22195
23408
|
|
|
22196
|
-
var getClassName$
|
|
23409
|
+
var getClassName$7 = lib_8.getClassName;
|
|
22197
23410
|
var Dropdown = {
|
|
22198
23411
|
data: function data() {
|
|
22199
23412
|
this.__state = {
|
|
@@ -22279,14 +23492,15 @@
|
|
|
22279
23492
|
isOpen = _ref.isOpen,
|
|
22280
23493
|
highlightedIndex = _ref.highlightedIndex,
|
|
22281
23494
|
getButtonProps = _ref.getButtonProps,
|
|
22282
|
-
getItemEvents = _ref.getItemEvents
|
|
23495
|
+
getItemEvents = _ref.getItemEvents,
|
|
23496
|
+
getInputEvents = _ref.getInputEvents;
|
|
22283
23497
|
return h("div", {
|
|
22284
23498
|
"class": suggestionsContainer
|
|
22285
23499
|
}, [h(Select, {
|
|
22286
23500
|
"on": _extends({}, _extends({}, getButtonProps({
|
|
22287
23501
|
onClick: _this.toggle
|
|
22288
23502
|
}))),
|
|
22289
|
-
"class": getClassName$
|
|
23503
|
+
"class": getClassName$7(_this.$props.innerClass, 'select') || '',
|
|
22290
23504
|
"attrs": {
|
|
22291
23505
|
"title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
|
|
22292
23506
|
"small": _this.$props.small,
|
|
@@ -22303,8 +23517,14 @@
|
|
|
22303
23517
|
getButtonProps: getButtonProps,
|
|
22304
23518
|
getItemEvents: getItemEvents
|
|
22305
23519
|
}) : isOpen && itemsToRender.length ? h("ul", {
|
|
22306
|
-
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$
|
|
22307
|
-
}, [_this.$props.showSearch ? _this.renderSearchbox(
|
|
23520
|
+
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$7(_this.$props.innerClass, 'list')
|
|
23521
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
23522
|
+
on: {
|
|
23523
|
+
input: getInputEvents({
|
|
23524
|
+
onInput: _this.handleInputChange
|
|
23525
|
+
}).input
|
|
23526
|
+
}
|
|
23527
|
+
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
22308
23528
|
var selected = _this.$props.multi // MultiDropdownList
|
|
22309
23529
|
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
22310
23530
|
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
@@ -22332,9 +23552,9 @@
|
|
|
22332
23552
|
"innerHTML": item[labelField]
|
|
22333
23553
|
}
|
|
22334
23554
|
}) : item[labelField], _this.$props.showCount && item.doc_count && h("span", {
|
|
22335
|
-
"class": getClassName$
|
|
23555
|
+
"class": getClassName$7(_this.$props.innerClass, 'count') || ''
|
|
22336
23556
|
}, ["\xA0(", item.doc_count, ")"])]), selected && _this.$props.multi ? h(Tick, {
|
|
22337
|
-
"class": getClassName$
|
|
23557
|
+
"class": getClassName$7(_this.$props.innerClass, 'icon') || ''
|
|
22338
23558
|
}) : null]);
|
|
22339
23559
|
}), footer]) : null]);
|
|
22340
23560
|
}
|
|
@@ -22422,10 +23642,10 @@
|
|
|
22422
23642
|
var h = this.$createElement;
|
|
22423
23643
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
22424
23644
|
return h("p", {
|
|
22425
|
-
"class": getClassName$
|
|
23645
|
+
"class": getClassName$7(this.$props.innerClass, 'noResults') || null
|
|
22426
23646
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
22427
23647
|
},
|
|
22428
|
-
renderSearchbox: function renderSearchbox() {
|
|
23648
|
+
renderSearchbox: function renderSearchbox(eventObject) {
|
|
22429
23649
|
var h = this.$createElement;
|
|
22430
23650
|
var _this$$props2 = this.$props,
|
|
22431
23651
|
componentId = _this$$props2.componentId,
|
|
@@ -22433,7 +23653,7 @@
|
|
|
22433
23653
|
showClear = _this$$props2.showClear,
|
|
22434
23654
|
themePreset = _this$$props2.themePreset,
|
|
22435
23655
|
innerClass = _this$$props2.innerClass;
|
|
22436
|
-
var InputComponent = h(Input, {
|
|
23656
|
+
var InputComponent = h(Input, helper$1([{
|
|
22437
23657
|
"attrs": {
|
|
22438
23658
|
"id": componentId + "-input",
|
|
22439
23659
|
"showIcon": false,
|
|
@@ -22446,11 +23666,8 @@
|
|
|
22446
23666
|
border: 0,
|
|
22447
23667
|
borderBottom: '1px solid #ddd'
|
|
22448
23668
|
},
|
|
22449
|
-
"class": getClassName$
|
|
22450
|
-
|
|
22451
|
-
"change": this.handleInputChange
|
|
22452
|
-
}
|
|
22453
|
-
});
|
|
23669
|
+
"class": getClassName$7(innerClass, 'input')
|
|
23670
|
+
}, eventObject]));
|
|
22454
23671
|
|
|
22455
23672
|
if (showClear) {
|
|
22456
23673
|
return h(InputWrapper, [InputComponent, this.searchTerm && h(IconGroup, {
|
|
@@ -22473,17 +23690,17 @@
|
|
|
22473
23690
|
}
|
|
22474
23691
|
};
|
|
22475
23692
|
|
|
22476
|
-
var updateQuery$
|
|
23693
|
+
var updateQuery$5 = lib_5.updateQuery,
|
|
22477
23694
|
setQueryOptions$4 = lib_5.setQueryOptions,
|
|
22478
|
-
setCustomQuery$
|
|
22479
|
-
setDefaultQuery$
|
|
23695
|
+
setCustomQuery$4 = lib_5.setCustomQuery,
|
|
23696
|
+
setDefaultQuery$5 = lib_5.setDefaultQuery;
|
|
22480
23697
|
var getQueryOptions$3 = lib_8.getQueryOptions,
|
|
22481
|
-
checkValueChange$
|
|
23698
|
+
checkValueChange$4 = lib_8.checkValueChange,
|
|
22482
23699
|
checkPropChange$1 = lib_8.checkPropChange,
|
|
22483
|
-
getClassName$
|
|
23700
|
+
getClassName$8 = lib_8.getClassName,
|
|
22484
23701
|
getOptionsFromQuery$4 = lib_8.getOptionsFromQuery,
|
|
22485
|
-
isEqual$
|
|
22486
|
-
getCompositeAggsQuery$
|
|
23702
|
+
isEqual$8 = lib_8.isEqual,
|
|
23703
|
+
getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery;
|
|
22487
23704
|
var SingleDropdownList = {
|
|
22488
23705
|
name: 'SingleDropdownList',
|
|
22489
23706
|
data: function data() {
|
|
@@ -22604,7 +23821,7 @@
|
|
|
22604
23821
|
this.setValue(newVal);
|
|
22605
23822
|
},
|
|
22606
23823
|
value: function value(newVal, oldVal) {
|
|
22607
|
-
if (!isEqual$
|
|
23824
|
+
if (!isEqual$8(newVal, oldVal)) {
|
|
22608
23825
|
this.setValue(newVal);
|
|
22609
23826
|
}
|
|
22610
23827
|
},
|
|
@@ -22664,7 +23881,7 @@
|
|
|
22664
23881
|
return h(Container, {
|
|
22665
23882
|
"class": this.$props.className
|
|
22666
23883
|
}, [this.$props.title && h(Title, {
|
|
22667
|
-
"class": getClassName$
|
|
23884
|
+
"class": getClassName$8(this.$props.innerClass, 'title') || ''
|
|
22668
23885
|
}, [this.$props.title]), h(Dropdown, {
|
|
22669
23886
|
"attrs": {
|
|
22670
23887
|
"innerClass": this.$props.innerClass,
|
|
@@ -22720,7 +23937,7 @@
|
|
|
22720
23937
|
_this2.$emit('value-change', value);
|
|
22721
23938
|
};
|
|
22722
23939
|
|
|
22723
|
-
checkValueChange$
|
|
23940
|
+
checkValueChange$4(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
22724
23941
|
},
|
|
22725
23942
|
handleChange: function handleChange(item) {
|
|
22726
23943
|
var value = this.$props.value;
|
|
@@ -22781,7 +23998,7 @@
|
|
|
22781
23998
|
},
|
|
22782
23999
|
generateQueryOptions: function generateQueryOptions(props, after) {
|
|
22783
24000
|
var queryOptions = getQueryOptions$3(props);
|
|
22784
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24001
|
+
return props.showLoadMore ? getCompositeAggsQuery$3({
|
|
22785
24002
|
query: queryOptions,
|
|
22786
24003
|
props: props,
|
|
22787
24004
|
after: after
|
|
@@ -22887,14 +24104,14 @@
|
|
|
22887
24104
|
|
|
22888
24105
|
SingleDropdownList.generateQueryOptions = function (props, after) {
|
|
22889
24106
|
var queryOptions = getQueryOptions$3(props);
|
|
22890
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24107
|
+
return props.showLoadMore ? getCompositeAggsQuery$3({
|
|
22891
24108
|
query: queryOptions,
|
|
22892
24109
|
props: props,
|
|
22893
24110
|
after: after
|
|
22894
24111
|
}) : getAggsQuery(queryOptions, props);
|
|
22895
24112
|
};
|
|
22896
24113
|
|
|
22897
|
-
var mapStateToProps$
|
|
24114
|
+
var mapStateToProps$7 = function mapStateToProps(state, props) {
|
|
22898
24115
|
return {
|
|
22899
24116
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
22900
24117
|
rawData: state.rawData[props.componentId],
|
|
@@ -22909,11 +24126,11 @@
|
|
|
22909
24126
|
|
|
22910
24127
|
var mapDispatchtoProps$4 = {
|
|
22911
24128
|
setQueryOptions: setQueryOptions$4,
|
|
22912
|
-
updateQuery: updateQuery$
|
|
22913
|
-
setCustomQuery: setCustomQuery$
|
|
22914
|
-
setDefaultQuery: setDefaultQuery$
|
|
24129
|
+
updateQuery: updateQuery$5,
|
|
24130
|
+
setCustomQuery: setCustomQuery$4,
|
|
24131
|
+
setDefaultQuery: setDefaultQuery$5
|
|
22915
24132
|
};
|
|
22916
|
-
var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$
|
|
24133
|
+
var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
|
|
22917
24134
|
componentType: constants_1$1.singleDropdownList,
|
|
22918
24135
|
internalComponent: true
|
|
22919
24136
|
});
|
|
@@ -22925,17 +24142,17 @@
|
|
|
22925
24142
|
|
|
22926
24143
|
SingleDropdownList.componentType = constants_1$1.singleDropdownList;
|
|
22927
24144
|
|
|
22928
|
-
var updateQuery$
|
|
24145
|
+
var updateQuery$6 = lib_5.updateQuery,
|
|
22929
24146
|
setQueryOptions$5 = lib_5.setQueryOptions,
|
|
22930
|
-
setCustomQuery$
|
|
22931
|
-
setDefaultQuery$
|
|
22932
|
-
var isEqual$
|
|
24147
|
+
setCustomQuery$5 = lib_5.setCustomQuery,
|
|
24148
|
+
setDefaultQuery$6 = lib_5.setDefaultQuery;
|
|
24149
|
+
var isEqual$9 = lib_8.isEqual,
|
|
22933
24150
|
getQueryOptions$4 = lib_8.getQueryOptions,
|
|
22934
|
-
checkValueChange$
|
|
24151
|
+
checkValueChange$5 = lib_8.checkValueChange,
|
|
22935
24152
|
checkPropChange$2 = lib_8.checkPropChange,
|
|
22936
|
-
getClassName$
|
|
24153
|
+
getClassName$9 = lib_8.getClassName,
|
|
22937
24154
|
getOptionsFromQuery$5 = lib_8.getOptionsFromQuery,
|
|
22938
|
-
getCompositeAggsQuery$
|
|
24155
|
+
getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery;
|
|
22939
24156
|
var MultiDropdownList = {
|
|
22940
24157
|
name: 'MultiDropdownList',
|
|
22941
24158
|
data: function data() {
|
|
@@ -23025,7 +24242,7 @@
|
|
|
23025
24242
|
}
|
|
23026
24243
|
}
|
|
23027
24244
|
|
|
23028
|
-
if (!isEqual$
|
|
24245
|
+
if (!isEqual$9(selectedValue, newVal)) {
|
|
23029
24246
|
this.setValue(newVal || [], true);
|
|
23030
24247
|
}
|
|
23031
24248
|
},
|
|
@@ -23076,7 +24293,7 @@
|
|
|
23076
24293
|
this.setValue(newVal, true);
|
|
23077
24294
|
},
|
|
23078
24295
|
value: function value(newVal, oldVal) {
|
|
23079
|
-
if (!isEqual$
|
|
24296
|
+
if (!isEqual$9(newVal, oldVal)) {
|
|
23080
24297
|
this.setValue(newVal, true);
|
|
23081
24298
|
}
|
|
23082
24299
|
},
|
|
@@ -23131,7 +24348,7 @@
|
|
|
23131
24348
|
return h(Container, {
|
|
23132
24349
|
"class": this.$props.className
|
|
23133
24350
|
}, [this.$props.title && h(Title, {
|
|
23134
|
-
"class": getClassName$
|
|
24351
|
+
"class": getClassName$9(this.$props.innerClass, 'title') || ''
|
|
23135
24352
|
}, [this.$props.title]), h(Dropdown, {
|
|
23136
24353
|
"attrs": {
|
|
23137
24354
|
"innerClass": this.$props.innerClass,
|
|
@@ -23247,7 +24464,7 @@
|
|
|
23247
24464
|
}
|
|
23248
24465
|
|
|
23249
24466
|
var performUpdate = function performUpdate() {
|
|
23250
|
-
_this3.currentValue = currentValue;
|
|
24467
|
+
_this3.currentValue = _extends({}, currentValue);
|
|
23251
24468
|
|
|
23252
24469
|
_this3.updateQueryHandler(finalValues, props);
|
|
23253
24470
|
|
|
@@ -23256,7 +24473,7 @@
|
|
|
23256
24473
|
_this3.$emit('value-change', finalValues);
|
|
23257
24474
|
};
|
|
23258
24475
|
|
|
23259
|
-
checkValueChange$
|
|
24476
|
+
checkValueChange$5(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
23260
24477
|
},
|
|
23261
24478
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
23262
24479
|
var defaultQueryOptions;
|
|
@@ -23308,7 +24525,7 @@
|
|
|
23308
24525
|
},
|
|
23309
24526
|
generateQueryOptions: function generateQueryOptions(props, after) {
|
|
23310
24527
|
var queryOptions = getQueryOptions$4(props);
|
|
23311
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24528
|
+
return props.showLoadMore ? getCompositeAggsQuery$4({
|
|
23312
24529
|
query: queryOptions,
|
|
23313
24530
|
props: props,
|
|
23314
24531
|
after: after
|
|
@@ -23450,14 +24667,14 @@
|
|
|
23450
24667
|
|
|
23451
24668
|
MultiDropdownList.generateQueryOptions = function (props, after) {
|
|
23452
24669
|
var queryOptions = getQueryOptions$4(props);
|
|
23453
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24670
|
+
return props.showLoadMore ? getCompositeAggsQuery$4({
|
|
23454
24671
|
query: queryOptions,
|
|
23455
24672
|
props: props,
|
|
23456
24673
|
after: after
|
|
23457
24674
|
}) : getAggsQuery(queryOptions, props);
|
|
23458
24675
|
};
|
|
23459
24676
|
|
|
23460
|
-
var mapStateToProps$
|
|
24677
|
+
var mapStateToProps$8 = function mapStateToProps(state, props) {
|
|
23461
24678
|
return {
|
|
23462
24679
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
23463
24680
|
rawData: state.rawData[props.componentId],
|
|
@@ -23472,11 +24689,11 @@
|
|
|
23472
24689
|
|
|
23473
24690
|
var mapDispatchtoProps$5 = {
|
|
23474
24691
|
setQueryOptions: setQueryOptions$5,
|
|
23475
|
-
updateQuery: updateQuery$
|
|
23476
|
-
setCustomQuery: setCustomQuery$
|
|
23477
|
-
setDefaultQuery: setDefaultQuery$
|
|
24692
|
+
updateQuery: updateQuery$6,
|
|
24693
|
+
setCustomQuery: setCustomQuery$5,
|
|
24694
|
+
setDefaultQuery: setDefaultQuery$6
|
|
23478
24695
|
};
|
|
23479
|
-
var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$
|
|
24696
|
+
var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
|
|
23480
24697
|
componentType: constants_1$1.multiDropdownList,
|
|
23481
24698
|
internalComponent: true
|
|
23482
24699
|
});
|
|
@@ -23488,12 +24705,12 @@
|
|
|
23488
24705
|
|
|
23489
24706
|
MultiDropdownList.componentType = constants_1$1.multiDropdownList;
|
|
23490
24707
|
|
|
23491
|
-
var updateQuery$
|
|
24708
|
+
var updateQuery$7 = lib_5.updateQuery,
|
|
23492
24709
|
setQueryOptions$6 = lib_5.setQueryOptions,
|
|
23493
|
-
setCustomQuery$
|
|
23494
|
-
var isEqual$
|
|
23495
|
-
checkValueChange$
|
|
23496
|
-
getClassName$
|
|
24710
|
+
setCustomQuery$6 = lib_5.setCustomQuery;
|
|
24711
|
+
var isEqual$a = lib_8.isEqual,
|
|
24712
|
+
checkValueChange$6 = lib_8.checkValueChange,
|
|
24713
|
+
getClassName$a = lib_8.getClassName,
|
|
23497
24714
|
getOptionsFromQuery$6 = lib_8.getOptionsFromQuery,
|
|
23498
24715
|
handleA11yAction$1 = lib_8.handleA11yAction;
|
|
23499
24716
|
var ToggleButton = {
|
|
@@ -23552,21 +24769,21 @@
|
|
|
23552
24769
|
this.updateQuery(this.$data.currentValue, this.$props);
|
|
23553
24770
|
},
|
|
23554
24771
|
value: function value(newVal, oldVal) {
|
|
23555
|
-
if (!isEqual$
|
|
24772
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
23556
24773
|
this.handleToggle(newVal, true, this.$props);
|
|
23557
24774
|
}
|
|
23558
24775
|
},
|
|
23559
24776
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
23560
24777
|
if (this.$props.multiSelect) {
|
|
23561
24778
|
// for multiselect selectedValue will be an array
|
|
23562
|
-
if (!isEqual$
|
|
24779
|
+
if (!isEqual$a(this.$data.currentValue, newVal) && !isEqual$a(oldVal, newVal)) {
|
|
23563
24780
|
this.handleToggle(newVal || [], true, this.$props);
|
|
23564
24781
|
}
|
|
23565
24782
|
} else {
|
|
23566
24783
|
// else selectedValue will be a string
|
|
23567
24784
|
var currentValue = this.$data.currentValue[0] ? this.$data.currentValue[0].value : null;
|
|
23568
24785
|
|
|
23569
|
-
if (!isEqual$
|
|
24786
|
+
if (!isEqual$a(currentValue, this.selectedValue) && !isEqual$a(oldVal, this.selectedValue)) {
|
|
23570
24787
|
this.handleToggle(this.selectedValue || [], true, this.$props);
|
|
23571
24788
|
}
|
|
23572
24789
|
}
|
|
@@ -23644,7 +24861,7 @@
|
|
|
23644
24861
|
}
|
|
23645
24862
|
};
|
|
23646
24863
|
|
|
23647
|
-
checkValueChange$
|
|
24864
|
+
checkValueChange$6(props.componentId, props.multiSelect ? value : value[0], props.beforeValueChange, performUpdate);
|
|
23648
24865
|
},
|
|
23649
24866
|
updateQuery: function updateQuery(value, props) {
|
|
23650
24867
|
var filterValue = value;
|
|
@@ -23681,7 +24898,7 @@
|
|
|
23681
24898
|
multiSelect = _this$$props.multiSelect;
|
|
23682
24899
|
|
|
23683
24900
|
if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
|
|
23684
|
-
return isEqual$
|
|
24901
|
+
return isEqual$a(item, stateItem);
|
|
23685
24902
|
})) {
|
|
23686
24903
|
return false;
|
|
23687
24904
|
}
|
|
@@ -23711,7 +24928,7 @@
|
|
|
23711
24928
|
return _this2.handleClick(item);
|
|
23712
24929
|
}
|
|
23713
24930
|
}) : h(Button, {
|
|
23714
|
-
"class": getClassName$
|
|
24931
|
+
"class": getClassName$a(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
|
|
23715
24932
|
"on": {
|
|
23716
24933
|
"click": function click() {
|
|
23717
24934
|
return _this2.handleClick(item);
|
|
@@ -23738,7 +24955,7 @@
|
|
|
23738
24955
|
return h(Container, {
|
|
23739
24956
|
"class": toggleButtons
|
|
23740
24957
|
}, [this.$props.title && h(Title, {
|
|
23741
|
-
"class": getClassName$
|
|
24958
|
+
"class": getClassName$a(this.$props.innerClass, 'title')
|
|
23742
24959
|
}, [this.$props.title]), this.$props.data.map(function (item) {
|
|
23743
24960
|
return _this3.renderButton(item);
|
|
23744
24961
|
})]);
|
|
@@ -23794,7 +25011,7 @@
|
|
|
23794
25011
|
return query;
|
|
23795
25012
|
};
|
|
23796
25013
|
|
|
23797
|
-
var mapStateToProps$
|
|
25014
|
+
var mapStateToProps$9 = function mapStateToProps(state, props) {
|
|
23798
25015
|
return {
|
|
23799
25016
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
23800
25017
|
componentProps: state.props[props.componentId],
|
|
@@ -23803,11 +25020,11 @@
|
|
|
23803
25020
|
};
|
|
23804
25021
|
|
|
23805
25022
|
var mapDispatchtoProps$6 = {
|
|
23806
|
-
updateQueryHandler: updateQuery$
|
|
25023
|
+
updateQueryHandler: updateQuery$7,
|
|
23807
25024
|
setQueryOptions: setQueryOptions$6,
|
|
23808
|
-
setCustomQuery: setCustomQuery$
|
|
25025
|
+
setCustomQuery: setCustomQuery$6
|
|
23809
25026
|
};
|
|
23810
|
-
var RcConnected = ComponentWrapper$1(connect(mapStateToProps$
|
|
25027
|
+
var RcConnected = ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$6)(ToggleButton), {
|
|
23811
25028
|
componentType: constants_1$1.toggleButton
|
|
23812
25029
|
});
|
|
23813
25030
|
|
|
@@ -23822,15 +25039,15 @@
|
|
|
23822
25039
|
_excluded2 = ["query"],
|
|
23823
25040
|
_excluded3 = ["query"],
|
|
23824
25041
|
_excluded4 = ["query"];
|
|
23825
|
-
var updateQuery$
|
|
25042
|
+
var updateQuery$8 = lib_5.updateQuery,
|
|
23826
25043
|
setQueryOptions$7 = lib_5.setQueryOptions,
|
|
23827
|
-
setCustomQuery$
|
|
23828
|
-
setDefaultQuery$
|
|
25044
|
+
setCustomQuery$7 = lib_5.setCustomQuery,
|
|
25045
|
+
setDefaultQuery$7 = lib_5.setDefaultQuery;
|
|
23829
25046
|
var parseHits$1 = lib_8.parseHits,
|
|
23830
|
-
isEqual$
|
|
23831
|
-
getCompositeAggsQuery$
|
|
25047
|
+
isEqual$b = lib_8.isEqual,
|
|
25048
|
+
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
23832
25049
|
getOptionsFromQuery$7 = lib_8.getOptionsFromQuery,
|
|
23833
|
-
getResultStats$
|
|
25050
|
+
getResultStats$3 = lib_8.getResultStats;
|
|
23834
25051
|
var ReactiveComponent = {
|
|
23835
25052
|
name: 'ReactiveComponent',
|
|
23836
25053
|
props: {
|
|
@@ -23973,42 +25190,42 @@
|
|
|
23973
25190
|
},
|
|
23974
25191
|
watch: {
|
|
23975
25192
|
hits: function hits(newVal, oldVal) {
|
|
23976
|
-
if (!isEqual$
|
|
25193
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23977
25194
|
this.$emit('data', this.getData());
|
|
23978
25195
|
}
|
|
23979
25196
|
},
|
|
23980
25197
|
rawData: function rawData(newVal, oldVal) {
|
|
23981
|
-
if (!isEqual$
|
|
25198
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23982
25199
|
this.$emit('data', this.getData());
|
|
23983
25200
|
}
|
|
23984
25201
|
},
|
|
23985
25202
|
aggregations: function aggregations(newVal, oldVal) {
|
|
23986
|
-
if (!isEqual$
|
|
25203
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23987
25204
|
this.$emit('data', this.getData());
|
|
23988
25205
|
}
|
|
23989
25206
|
},
|
|
23990
25207
|
aggregationData: function aggregationData(newVal, oldVal) {
|
|
23991
|
-
if (!isEqual$
|
|
25208
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23992
25209
|
this.$emit('data', this.getData());
|
|
23993
25210
|
}
|
|
23994
25211
|
},
|
|
23995
25212
|
promotedResults: function promotedResults(newVal, oldVal) {
|
|
23996
|
-
if (!isEqual$
|
|
25213
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23997
25214
|
this.$emit('data', this.getData());
|
|
23998
25215
|
}
|
|
23999
25216
|
},
|
|
24000
25217
|
hidden: function hidden(newVal, oldVal) {
|
|
24001
|
-
if (!isEqual$
|
|
25218
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
24002
25219
|
this.$emit('data', this.getData());
|
|
24003
25220
|
}
|
|
24004
25221
|
},
|
|
24005
25222
|
total: function total(newVal, oldVal) {
|
|
24006
|
-
if (!isEqual$
|
|
25223
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
24007
25224
|
this.$emit('data', this.getData());
|
|
24008
25225
|
}
|
|
24009
25226
|
},
|
|
24010
25227
|
time: function time(newVal, oldVal) {
|
|
24011
|
-
if (!isEqual$
|
|
25228
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
24012
25229
|
this.$emit('data', this.getData());
|
|
24013
25230
|
}
|
|
24014
25231
|
},
|
|
@@ -24092,7 +25309,7 @@
|
|
|
24092
25309
|
getAggsQuery: function getAggsQuery() {
|
|
24093
25310
|
if (this.aggregationField) {
|
|
24094
25311
|
return {
|
|
24095
|
-
aggs: getCompositeAggsQuery$
|
|
25312
|
+
aggs: getCompositeAggsQuery$5({
|
|
24096
25313
|
props: this.$props,
|
|
24097
25314
|
showTopHits: true,
|
|
24098
25315
|
value: this.selectedValue
|
|
@@ -24136,12 +25353,12 @@
|
|
|
24136
25353
|
},
|
|
24137
25354
|
computed: {
|
|
24138
25355
|
stats: function stats() {
|
|
24139
|
-
return getResultStats$
|
|
25356
|
+
return getResultStats$3(this);
|
|
24140
25357
|
}
|
|
24141
25358
|
}
|
|
24142
25359
|
};
|
|
24143
25360
|
|
|
24144
|
-
var mapStateToProps$
|
|
25361
|
+
var mapStateToProps$a = function mapStateToProps(state, props) {
|
|
24145
25362
|
return {
|
|
24146
25363
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
24147
25364
|
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
@@ -24161,11 +25378,11 @@
|
|
|
24161
25378
|
|
|
24162
25379
|
var mapDispatchtoProps$7 = {
|
|
24163
25380
|
setQueryOptions: setQueryOptions$7,
|
|
24164
|
-
updateQuery: updateQuery$
|
|
24165
|
-
setCustomQuery: setCustomQuery$
|
|
24166
|
-
setDefaultQuery: setDefaultQuery$
|
|
25381
|
+
updateQuery: updateQuery$8,
|
|
25382
|
+
setCustomQuery: setCustomQuery$7,
|
|
25383
|
+
setDefaultQuery: setDefaultQuery$7
|
|
24167
25384
|
};
|
|
24168
|
-
var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$
|
|
25385
|
+
var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$7)(ReactiveComponent), {
|
|
24169
25386
|
componentType: constants_1$1.reactiveComponent
|
|
24170
25387
|
});
|
|
24171
25388
|
|
|
@@ -24179,7 +25396,7 @@
|
|
|
24179
25396
|
var setValue$2 = lib_5.setValue,
|
|
24180
25397
|
clearValues = lib_5.clearValues,
|
|
24181
25398
|
resetValuesToDefault = lib_5.resetValuesToDefault;
|
|
24182
|
-
var getClassName$
|
|
25399
|
+
var getClassName$b = lib_8.getClassName,
|
|
24183
25400
|
handleA11yAction$2 = lib_8.handleA11yAction;
|
|
24184
25401
|
var SelectedFilters = {
|
|
24185
25402
|
name: 'SelectedFilters',
|
|
@@ -24217,9 +25434,9 @@
|
|
|
24217
25434
|
return h(Container, {
|
|
24218
25435
|
"class": filters(this.theme) + " " + (this.$props.className || '')
|
|
24219
25436
|
}, [this.$props.title && hasValues && h(Title, {
|
|
24220
|
-
"class": getClassName$
|
|
25437
|
+
"class": getClassName$b(this.$props.innerClass, 'title') || ''
|
|
24221
25438
|
}, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues ? h(Button, {
|
|
24222
|
-
"class": getClassName$
|
|
25439
|
+
"class": getClassName$b(this.$props.innerClass, 'button') || '',
|
|
24223
25440
|
"on": _extends({}, {
|
|
24224
25441
|
click: this.clearValues,
|
|
24225
25442
|
keypress: function keypress(event) {
|
|
@@ -24294,7 +25511,7 @@
|
|
|
24294
25511
|
var valueToRender = _this3.renderValue(value, isArray);
|
|
24295
25512
|
|
|
24296
25513
|
return h(Button, {
|
|
24297
|
-
"class": getClassName$
|
|
25514
|
+
"class": getClassName$b(_this3.$props.innerClass, 'button') || '',
|
|
24298
25515
|
"key": component + "-" + (index + 1),
|
|
24299
25516
|
"on": _extends({}, {
|
|
24300
25517
|
click: function click() {
|
|
@@ -24323,7 +25540,7 @@
|
|
|
24323
25540
|
}
|
|
24324
25541
|
};
|
|
24325
25542
|
|
|
24326
|
-
var mapStateToProps$
|
|
25543
|
+
var mapStateToProps$b = function mapStateToProps(state) {
|
|
24327
25544
|
return {
|
|
24328
25545
|
components: state.components,
|
|
24329
25546
|
selectedValues: state.selectedValues
|
|
@@ -24335,18 +25552,18 @@
|
|
|
24335
25552
|
setValue: setValue$2,
|
|
24336
25553
|
resetValuesToDefault: resetValuesToDefault
|
|
24337
25554
|
};
|
|
24338
|
-
var RcConnected$2 = connect(mapStateToProps$
|
|
25555
|
+
var RcConnected$2 = connect(mapStateToProps$b, mapDispatchtoProps$8)(SelectedFilters);
|
|
24339
25556
|
|
|
24340
25557
|
SelectedFilters.install = function (Vue) {
|
|
24341
25558
|
Vue.component(SelectedFilters.name, RcConnected$2);
|
|
24342
25559
|
};
|
|
24343
25560
|
|
|
24344
|
-
var updateQuery$
|
|
25561
|
+
var updateQuery$9 = lib_5.updateQuery,
|
|
24345
25562
|
setQueryOptions$8 = lib_5.setQueryOptions,
|
|
24346
|
-
setCustomQuery$
|
|
24347
|
-
var isEqual$
|
|
24348
|
-
checkValueChange$
|
|
24349
|
-
getClassName$
|
|
25563
|
+
setCustomQuery$8 = lib_5.setCustomQuery;
|
|
25564
|
+
var isEqual$c = lib_8.isEqual,
|
|
25565
|
+
checkValueChange$7 = lib_8.checkValueChange,
|
|
25566
|
+
getClassName$c = lib_8.getClassName,
|
|
24350
25567
|
getOptionsFromQuery$8 = lib_8.getOptionsFromQuery;
|
|
24351
25568
|
var SingleRange = {
|
|
24352
25569
|
name: 'SingleRange',
|
|
@@ -24401,12 +25618,12 @@
|
|
|
24401
25618
|
this.setValue(newVal);
|
|
24402
25619
|
},
|
|
24403
25620
|
value: function value(newVal, oldVal) {
|
|
24404
|
-
if (!isEqual$
|
|
25621
|
+
if (!isEqual$c(newVal, oldVal)) {
|
|
24405
25622
|
this.setValue(newVal);
|
|
24406
25623
|
}
|
|
24407
25624
|
},
|
|
24408
25625
|
selectedValue: function selectedValue(newVal) {
|
|
24409
|
-
if (!isEqual$
|
|
25626
|
+
if (!isEqual$c(this.$data.currentValue, newVal)) {
|
|
24410
25627
|
this.setValue(newVal);
|
|
24411
25628
|
}
|
|
24412
25629
|
},
|
|
@@ -24423,16 +25640,16 @@
|
|
|
24423
25640
|
return h(Container, {
|
|
24424
25641
|
"class": this.$props.className
|
|
24425
25642
|
}, [this.$props.title && h(Title, {
|
|
24426
|
-
"class": getClassName$
|
|
25643
|
+
"class": getClassName$c(this.$props.innerClass, 'title')
|
|
24427
25644
|
}, [this.$props.title]), h(UL, {
|
|
24428
|
-
"class": getClassName$
|
|
25645
|
+
"class": getClassName$c(this.$props.innerClass, 'list')
|
|
24429
25646
|
}, [this.$props.data.map(function (item) {
|
|
24430
25647
|
var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
|
|
24431
25648
|
return h("li", {
|
|
24432
25649
|
"key": item.label,
|
|
24433
25650
|
"class": "" + (selected ? 'active' : '')
|
|
24434
25651
|
}, [h(Radio, {
|
|
24435
|
-
"class": getClassName$
|
|
25652
|
+
"class": getClassName$c(_this.$props.innerClass, 'radio'),
|
|
24436
25653
|
"attrs": {
|
|
24437
25654
|
"id": _this.$props.componentId + "-" + item.label,
|
|
24438
25655
|
"name": _this.$props.componentId,
|
|
@@ -24445,7 +25662,7 @@
|
|
|
24445
25662
|
"change": _this.handleChange
|
|
24446
25663
|
}
|
|
24447
25664
|
}), h("label", {
|
|
24448
|
-
"class": getClassName$
|
|
25665
|
+
"class": getClassName$c(_this.$props.innerClass, 'label'),
|
|
24449
25666
|
"attrs": {
|
|
24450
25667
|
"for": _this.$props.componentId + "-" + item.label
|
|
24451
25668
|
}
|
|
@@ -24472,7 +25689,7 @@
|
|
|
24472
25689
|
_this2.$emit('value-change', currentValue);
|
|
24473
25690
|
};
|
|
24474
25691
|
|
|
24475
|
-
checkValueChange$
|
|
25692
|
+
checkValueChange$7(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
24476
25693
|
},
|
|
24477
25694
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
24478
25695
|
var customQuery = props.customQuery;
|
|
@@ -24545,7 +25762,7 @@
|
|
|
24545
25762
|
return query;
|
|
24546
25763
|
};
|
|
24547
25764
|
|
|
24548
|
-
var mapStateToProps$
|
|
25765
|
+
var mapStateToProps$c = function mapStateToProps(state, props) {
|
|
24549
25766
|
return {
|
|
24550
25767
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24551
25768
|
componentProps: state.props[props.componentId],
|
|
@@ -24554,11 +25771,11 @@
|
|
|
24554
25771
|
};
|
|
24555
25772
|
|
|
24556
25773
|
var mapDispatchtoProps$9 = {
|
|
24557
|
-
updateQuery: updateQuery$
|
|
25774
|
+
updateQuery: updateQuery$9,
|
|
24558
25775
|
setQueryOptions: setQueryOptions$8,
|
|
24559
|
-
setCustomQuery: setCustomQuery$
|
|
25776
|
+
setCustomQuery: setCustomQuery$8
|
|
24560
25777
|
};
|
|
24561
|
-
var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$
|
|
25778
|
+
var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(SingleRange), {
|
|
24562
25779
|
componentType: constants_1$1.singleRange
|
|
24563
25780
|
});
|
|
24564
25781
|
|
|
@@ -24569,12 +25786,12 @@
|
|
|
24569
25786
|
|
|
24570
25787
|
SingleRange.componentType = constants_1$1.singleRange;
|
|
24571
25788
|
|
|
24572
|
-
var updateQuery$
|
|
25789
|
+
var updateQuery$a = lib_5.updateQuery,
|
|
24573
25790
|
setQueryOptions$9 = lib_5.setQueryOptions,
|
|
24574
|
-
setCustomQuery$
|
|
24575
|
-
var isEqual$
|
|
24576
|
-
checkValueChange$
|
|
24577
|
-
getClassName$
|
|
25791
|
+
setCustomQuery$9 = lib_5.setCustomQuery;
|
|
25792
|
+
var isEqual$d = lib_8.isEqual,
|
|
25793
|
+
checkValueChange$8 = lib_8.checkValueChange,
|
|
25794
|
+
getClassName$d = lib_8.getClassName,
|
|
24578
25795
|
getOptionsFromQuery$9 = lib_8.getOptionsFromQuery;
|
|
24579
25796
|
var MultiRange = {
|
|
24580
25797
|
name: 'MultiRange',
|
|
@@ -24681,7 +25898,7 @@
|
|
|
24681
25898
|
_this.$emit('value-change', Object.keys(selectedValues));
|
|
24682
25899
|
};
|
|
24683
25900
|
|
|
24684
|
-
checkValueChange$
|
|
25901
|
+
checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
24685
25902
|
},
|
|
24686
25903
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
24687
25904
|
var customQuery = props.customQuery;
|
|
@@ -24716,12 +25933,12 @@
|
|
|
24716
25933
|
this.selectItem(newVal, true, undefined, true);
|
|
24717
25934
|
},
|
|
24718
25935
|
value: function value(newVal, oldVal) {
|
|
24719
|
-
if (!isEqual$
|
|
25936
|
+
if (!isEqual$d(newVal, oldVal)) {
|
|
24720
25937
|
this.selectItem(newVal, true, undefined, true);
|
|
24721
25938
|
}
|
|
24722
25939
|
},
|
|
24723
25940
|
selectedValue: function selectedValue(newVal) {
|
|
24724
|
-
if (!isEqual$
|
|
25941
|
+
if (!isEqual$d(this.$data.currentValue, newVal)) {
|
|
24725
25942
|
this.selectItem(newVal, true, undefined, true);
|
|
24726
25943
|
}
|
|
24727
25944
|
},
|
|
@@ -24755,16 +25972,16 @@
|
|
|
24755
25972
|
return h(Container, {
|
|
24756
25973
|
"class": this.$props.className
|
|
24757
25974
|
}, [this.$props.title && h(Title, {
|
|
24758
|
-
"class": getClassName$
|
|
25975
|
+
"class": getClassName$d(this.$props.innerClass, 'title')
|
|
24759
25976
|
}, [this.$props.title]), h(UL, {
|
|
24760
|
-
"class": getClassName$
|
|
25977
|
+
"class": getClassName$d(this.$props.innerClass, 'list')
|
|
24761
25978
|
}, [this.$props.data.map(function (item) {
|
|
24762
25979
|
var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
|
|
24763
25980
|
return h("li", {
|
|
24764
25981
|
"key": item.label,
|
|
24765
25982
|
"class": "" + (selected ? 'active' : '')
|
|
24766
25983
|
}, [h(Checkbox, {
|
|
24767
|
-
"class": getClassName$
|
|
25984
|
+
"class": getClassName$d(_this2.$props.innerClass, 'checkbox'),
|
|
24768
25985
|
"attrs": {
|
|
24769
25986
|
"id": _this2.$props.componentId + "-" + item.label,
|
|
24770
25987
|
"name": _this2.$props.componentId,
|
|
@@ -24779,7 +25996,7 @@
|
|
|
24779
25996
|
click: _this2.handleClick
|
|
24780
25997
|
})
|
|
24781
25998
|
}), h("label", {
|
|
24782
|
-
"class": getClassName$
|
|
25999
|
+
"class": getClassName$d(_this2.$props.innerClass, 'label'),
|
|
24783
26000
|
"attrs": {
|
|
24784
26001
|
"for": _this2.$props.componentId + "-" + item.label
|
|
24785
26002
|
}
|
|
@@ -24839,7 +26056,7 @@
|
|
|
24839
26056
|
return query;
|
|
24840
26057
|
};
|
|
24841
26058
|
|
|
24842
|
-
var mapStateToProps$
|
|
26059
|
+
var mapStateToProps$d = function mapStateToProps(state, props) {
|
|
24843
26060
|
return {
|
|
24844
26061
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24845
26062
|
componentProps: state.props[props.componentId],
|
|
@@ -24848,11 +26065,11 @@
|
|
|
24848
26065
|
};
|
|
24849
26066
|
|
|
24850
26067
|
var mapDispatchtoProps$a = {
|
|
24851
|
-
updateQuery: updateQuery$
|
|
26068
|
+
updateQuery: updateQuery$a,
|
|
24852
26069
|
setQueryOptions: setQueryOptions$9,
|
|
24853
|
-
setCustomQuery: setCustomQuery$
|
|
26070
|
+
setCustomQuery: setCustomQuery$9
|
|
24854
26071
|
};
|
|
24855
|
-
var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$
|
|
26072
|
+
var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(MultiRange), {
|
|
24856
26073
|
componentType: constants_1$1.multiRange
|
|
24857
26074
|
});
|
|
24858
26075
|
|
|
@@ -25138,8 +26355,8 @@
|
|
|
25138
26355
|
};
|
|
25139
26356
|
var vueNoSsr_common = index$2;
|
|
25140
26357
|
|
|
25141
|
-
var _templateObject$
|
|
25142
|
-
var Slider = index$1('div')(_templateObject$
|
|
26358
|
+
var _templateObject$n;
|
|
26359
|
+
var Slider = index$1('div')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
|
|
25143
26360
|
|
|
25144
26361
|
/**
|
|
25145
26362
|
* Caution: Please do not change this file without having a discussion with the Team.
|
|
@@ -25182,13 +26399,13 @@
|
|
|
25182
26399
|
return components;
|
|
25183
26400
|
};
|
|
25184
26401
|
|
|
25185
|
-
var updateQuery$
|
|
26402
|
+
var updateQuery$b = lib_5.updateQuery,
|
|
25186
26403
|
setQueryOptions$a = lib_5.setQueryOptions,
|
|
25187
|
-
setCustomQuery$
|
|
25188
|
-
var checkValueChange$
|
|
25189
|
-
getClassName$
|
|
26404
|
+
setCustomQuery$a = lib_5.setCustomQuery;
|
|
26405
|
+
var checkValueChange$9 = lib_8.checkValueChange,
|
|
26406
|
+
getClassName$e = lib_8.getClassName,
|
|
25190
26407
|
getOptionsFromQuery$a = lib_8.getOptionsFromQuery,
|
|
25191
|
-
isEqual$
|
|
26408
|
+
isEqual$e = lib_8.isEqual;
|
|
25192
26409
|
var RangeSlider = {
|
|
25193
26410
|
name: 'RangeSlider',
|
|
25194
26411
|
components: getComponents(),
|
|
@@ -25269,7 +26486,7 @@
|
|
|
25269
26486
|
});
|
|
25270
26487
|
};
|
|
25271
26488
|
|
|
25272
|
-
checkValueChange$
|
|
26489
|
+
checkValueChange$9(props.componentId, {
|
|
25273
26490
|
start: currentValue[0],
|
|
25274
26491
|
end: currentValue[1]
|
|
25275
26492
|
}, props.beforeValueChange, performUpdate);
|
|
@@ -25312,12 +26529,12 @@
|
|
|
25312
26529
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25313
26530
|
},
|
|
25314
26531
|
value: function value(newVal, oldVal) {
|
|
25315
|
-
if (!isEqual$
|
|
26532
|
+
if (!isEqual$e(newVal, oldVal)) {
|
|
25316
26533
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25317
26534
|
}
|
|
25318
26535
|
},
|
|
25319
26536
|
selectedValue: function selectedValue(newVal) {
|
|
25320
|
-
if (!isEqual$
|
|
26537
|
+
if (!isEqual$e(this.$data.currentValue, newVal)) {
|
|
25321
26538
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25322
26539
|
this.$emit('change', newVal);
|
|
25323
26540
|
}
|
|
@@ -25363,9 +26580,9 @@
|
|
|
25363
26580
|
return h(Container, {
|
|
25364
26581
|
"class": this.$props.className
|
|
25365
26582
|
}, [this.$props.title && h(Title, {
|
|
25366
|
-
"class": getClassName$
|
|
26583
|
+
"class": getClassName$e(this.$props.innerClass, 'title')
|
|
25367
26584
|
}, [this.$props.title]), this.$props.range ? h(vueNoSsr_common, [h(Slider, {
|
|
25368
|
-
"class": getClassName$
|
|
26585
|
+
"class": getClassName$e(this.$props.innerClass, 'slider')
|
|
25369
26586
|
}, [h("vue-slider-component", {
|
|
25370
26587
|
"ref": "slider",
|
|
25371
26588
|
"attrs": {
|
|
@@ -25384,9 +26601,9 @@
|
|
|
25384
26601
|
}), this.$props.rangeLabels && h("div", {
|
|
25385
26602
|
"class": "label-container"
|
|
25386
26603
|
}, [h("label", {
|
|
25387
|
-
"class": getClassName$
|
|
26604
|
+
"class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-left'
|
|
25388
26605
|
}, [this.$props.rangeLabels.start]), h("label", {
|
|
25389
|
-
"class": getClassName$
|
|
26606
|
+
"class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-right'
|
|
25390
26607
|
}, [this.$props.rangeLabels.end])])])]) : null]);
|
|
25391
26608
|
}
|
|
25392
26609
|
};
|
|
@@ -25432,7 +26649,7 @@
|
|
|
25432
26649
|
return [];
|
|
25433
26650
|
};
|
|
25434
26651
|
|
|
25435
|
-
var mapStateToProps$
|
|
26652
|
+
var mapStateToProps$e = function mapStateToProps(state, props) {
|
|
25436
26653
|
return {
|
|
25437
26654
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
25438
26655
|
: [],
|
|
@@ -25443,11 +26660,11 @@
|
|
|
25443
26660
|
};
|
|
25444
26661
|
|
|
25445
26662
|
var mapDispatchtoProps$b = {
|
|
25446
|
-
updateQuery: updateQuery$
|
|
26663
|
+
updateQuery: updateQuery$b,
|
|
25447
26664
|
setQueryOptions: setQueryOptions$a,
|
|
25448
|
-
setCustomQuery: setCustomQuery$
|
|
26665
|
+
setCustomQuery: setCustomQuery$a
|
|
25449
26666
|
};
|
|
25450
|
-
var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$
|
|
26667
|
+
var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(RangeSlider), {
|
|
25451
26668
|
componentType: constants_1$1.rangeSlider
|
|
25452
26669
|
});
|
|
25453
26670
|
|
|
@@ -25461,16 +26678,16 @@
|
|
|
25461
26678
|
var addComponent$1 = lib_5.addComponent,
|
|
25462
26679
|
removeComponent$1 = lib_5.removeComponent,
|
|
25463
26680
|
watchComponent$1 = lib_5.watchComponent,
|
|
25464
|
-
updateQuery$
|
|
26681
|
+
updateQuery$c = lib_5.updateQuery,
|
|
25465
26682
|
setQueryListener$1 = lib_5.setQueryListener,
|
|
25466
26683
|
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25467
26684
|
setComponentProps$1 = lib_5.setComponentProps,
|
|
25468
|
-
setCustomQuery$
|
|
26685
|
+
setCustomQuery$b = lib_5.setCustomQuery,
|
|
25469
26686
|
updateComponentProps$2 = lib_5.updateComponentProps;
|
|
25470
|
-
var checkValueChange$
|
|
25471
|
-
getClassName$
|
|
26687
|
+
var checkValueChange$a = lib_8.checkValueChange,
|
|
26688
|
+
getClassName$f = lib_8.getClassName,
|
|
25472
26689
|
getOptionsFromQuery$b = lib_8.getOptionsFromQuery,
|
|
25473
|
-
isEqual$
|
|
26690
|
+
isEqual$f = lib_8.isEqual,
|
|
25474
26691
|
checkSomePropChange$1 = lib_8.checkSomePropChange;
|
|
25475
26692
|
var DynamicRangeSlider = {
|
|
25476
26693
|
name: 'DynamicRangeSlider',
|
|
@@ -25494,7 +26711,8 @@
|
|
|
25494
26711
|
URLParams: VueTypes.bool.def(false),
|
|
25495
26712
|
sliderOptions: VueTypes.object.def({}),
|
|
25496
26713
|
nestedField: types.string,
|
|
25497
|
-
index: VueTypes.string
|
|
26714
|
+
index: VueTypes.string,
|
|
26715
|
+
value: types.range
|
|
25498
26716
|
},
|
|
25499
26717
|
data: function data() {
|
|
25500
26718
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -25540,6 +26758,8 @@
|
|
|
25540
26758
|
components = _this$$$store$getStat.components;
|
|
25541
26759
|
}
|
|
25542
26760
|
|
|
26761
|
+
var value = this.$props.value;
|
|
26762
|
+
|
|
25543
26763
|
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
25544
26764
|
this.addComponent(this.componentId);
|
|
25545
26765
|
this.addComponent(this.internalRangeComponent);
|
|
@@ -25548,6 +26768,8 @@
|
|
|
25548
26768
|
this.handleChange(this.selectedValue);
|
|
25549
26769
|
} else if (this.selectedValue) {
|
|
25550
26770
|
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
26771
|
+
} else if (value) {
|
|
26772
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
25551
26773
|
} // get range before executing other queries
|
|
25552
26774
|
|
|
25553
26775
|
|
|
@@ -25566,6 +26788,13 @@
|
|
|
25566
26788
|
}
|
|
25567
26789
|
},
|
|
25568
26790
|
methods: {
|
|
26791
|
+
isControlled: function isControlled() {
|
|
26792
|
+
if (this.$props.value && this.$listeners) {
|
|
26793
|
+
return true;
|
|
26794
|
+
}
|
|
26795
|
+
|
|
26796
|
+
return false;
|
|
26797
|
+
},
|
|
25569
26798
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
25570
26799
|
var start = _ref.start,
|
|
25571
26800
|
end = _ref.end;
|
|
@@ -25576,6 +26805,8 @@
|
|
|
25576
26805
|
defaultEnd = _this$$props$defaultV.end;
|
|
25577
26806
|
|
|
25578
26807
|
this.handleChange([defaultStart, defaultEnd]);
|
|
26808
|
+
} else if (this.isControlled()) {
|
|
26809
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
25579
26810
|
} else {
|
|
25580
26811
|
this.currentValue = [start, end];
|
|
25581
26812
|
}
|
|
@@ -25625,7 +26856,16 @@
|
|
|
25625
26856
|
},
|
|
25626
26857
|
handleSlider: function handleSlider() {
|
|
25627
26858
|
var sliderValues = this.$refs.slider.getValue();
|
|
25628
|
-
this.
|
|
26859
|
+
var value = this.$props.value;
|
|
26860
|
+
|
|
26861
|
+
if (value === undefined) {
|
|
26862
|
+
this.handleChange(sliderValues);
|
|
26863
|
+
} else {
|
|
26864
|
+
this.$emit('change', {
|
|
26865
|
+
start: sliderValues[0],
|
|
26866
|
+
end: sliderValues[1]
|
|
26867
|
+
});
|
|
26868
|
+
}
|
|
25629
26869
|
},
|
|
25630
26870
|
handleChange: function handleChange(currentValue) {
|
|
25631
26871
|
var _this2 = this;
|
|
@@ -25649,7 +26889,7 @@
|
|
|
25649
26889
|
});
|
|
25650
26890
|
};
|
|
25651
26891
|
|
|
25652
|
-
checkValueChange$
|
|
26892
|
+
checkValueChange$a(this.$props.componentId, {
|
|
25653
26893
|
start: normalizedValue[0],
|
|
25654
26894
|
end: normalizedValue[1]
|
|
25655
26895
|
}, this.$props.beforeValueChange, performUpdate);
|
|
@@ -25713,15 +26953,16 @@
|
|
|
25713
26953
|
this.setReact();
|
|
25714
26954
|
},
|
|
25715
26955
|
selectedValue: function selectedValue(newValue) {
|
|
25716
|
-
if (isEqual$
|
|
26956
|
+
if (isEqual$f(newValue, this.currentValue)) return;
|
|
25717
26957
|
var value = newValue || {
|
|
25718
26958
|
start: this.range.start,
|
|
25719
26959
|
end: this.range.end
|
|
25720
26960
|
};
|
|
26961
|
+
this.$emit('change', value);
|
|
25721
26962
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
25722
26963
|
},
|
|
25723
26964
|
range: function range(newValue, oldValue) {
|
|
25724
|
-
if (isEqual$
|
|
26965
|
+
if (isEqual$f(newValue, oldValue) || !this.currentValue) return;
|
|
25725
26966
|
|
|
25726
26967
|
var _ref4 = this.currentValue || [],
|
|
25727
26968
|
currentStart = _ref4[0],
|
|
@@ -25739,6 +26980,11 @@
|
|
|
25739
26980
|
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
25740
26981
|
this.updateQueryHandler(this.$data.currentValue);
|
|
25741
26982
|
}
|
|
26983
|
+
},
|
|
26984
|
+
value: function value(newVal, oldVal) {
|
|
26985
|
+
if (!isEqual$f(newVal, oldVal)) {
|
|
26986
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
26987
|
+
}
|
|
25742
26988
|
}
|
|
25743
26989
|
},
|
|
25744
26990
|
render: function render() {
|
|
@@ -25754,15 +27000,15 @@
|
|
|
25754
27000
|
return h(Container, {
|
|
25755
27001
|
"class": this.$props.className
|
|
25756
27002
|
}, [this.$props.title && h(Title, {
|
|
25757
|
-
"class": getClassName$
|
|
27003
|
+
"class": getClassName$f(this.$props.innerClass, 'title')
|
|
25758
27004
|
}, [this.$props.title]), h(vueNoSsr_common, [h(Slider, {
|
|
25759
|
-
"class": getClassName$
|
|
27005
|
+
"class": getClassName$f(this.$props.innerClass, 'slider')
|
|
25760
27006
|
}, [h("vue-slider-component", {
|
|
25761
27007
|
"ref": "slider",
|
|
25762
27008
|
"attrs": {
|
|
25763
|
-
"value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
|
|
25764
|
-
"min": Math.min(start, this.currentValue[0]),
|
|
25765
|
-
"max": Math.max(end, this.currentValue[1]),
|
|
27009
|
+
"value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
|
|
27010
|
+
"min": Math.floor(Math.min(start, this.currentValue[0])),
|
|
27011
|
+
"max": Math.ceil(Math.max(end, this.currentValue[1])),
|
|
25766
27012
|
"dotSize": 20,
|
|
25767
27013
|
"height": 4,
|
|
25768
27014
|
"enable-cross": false,
|
|
@@ -25775,9 +27021,9 @@
|
|
|
25775
27021
|
}), this.labels ? h("div", {
|
|
25776
27022
|
"class": "label-container"
|
|
25777
27023
|
}, [h("label", {
|
|
25778
|
-
"class": getClassName$
|
|
27024
|
+
"class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-left'
|
|
25779
27025
|
}, [this.labels.start]), h("label", {
|
|
25780
|
-
"class": getClassName$
|
|
27026
|
+
"class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-right'
|
|
25781
27027
|
}, [this.labels.end])]) : null])])]);
|
|
25782
27028
|
}
|
|
25783
27029
|
};
|
|
@@ -25812,10 +27058,14 @@
|
|
|
25812
27058
|
};
|
|
25813
27059
|
|
|
25814
27060
|
DynamicRangeSlider.parseValue = function (value) {
|
|
25815
|
-
|
|
27061
|
+
if (value) {
|
|
27062
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
27063
|
+
}
|
|
27064
|
+
|
|
27065
|
+
return [];
|
|
25816
27066
|
};
|
|
25817
27067
|
|
|
25818
|
-
var mapStateToProps$
|
|
27068
|
+
var mapStateToProps$f = function mapStateToProps(state, props) {
|
|
25819
27069
|
var componentId = state.aggregations[props.componentId];
|
|
25820
27070
|
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
25821
27071
|
var options = componentId && componentId[props.dataField];
|
|
@@ -25847,15 +27097,15 @@
|
|
|
25847
27097
|
var mapDispatchtoProps$c = {
|
|
25848
27098
|
addComponent: addComponent$1,
|
|
25849
27099
|
removeComponent: removeComponent$1,
|
|
25850
|
-
updateQuery: updateQuery$
|
|
27100
|
+
updateQuery: updateQuery$c,
|
|
25851
27101
|
watchComponent: watchComponent$1,
|
|
25852
27102
|
setQueryListener: setQueryListener$1,
|
|
25853
27103
|
setQueryOptions: setQueryOptions$b,
|
|
25854
27104
|
setComponentProps: setComponentProps$1,
|
|
25855
|
-
setCustomQuery: setCustomQuery$
|
|
27105
|
+
setCustomQuery: setCustomQuery$b,
|
|
25856
27106
|
updateComponentProps: updateComponentProps$2
|
|
25857
27107
|
};
|
|
25858
|
-
var RangeConnected$3 = connect(mapStateToProps$
|
|
27108
|
+
var RangeConnected$3 = connect(mapStateToProps$f, mapDispatchtoProps$c)(DynamicRangeSlider);
|
|
25859
27109
|
|
|
25860
27110
|
DynamicRangeSlider.install = function (Vue) {
|
|
25861
27111
|
Vue.component(DynamicRangeSlider.name, RangeConnected$3);
|
|
@@ -26017,7 +27267,7 @@
|
|
|
26017
27267
|
}
|
|
26018
27268
|
};
|
|
26019
27269
|
|
|
26020
|
-
var mapStateToProps$
|
|
27270
|
+
var mapStateToProps$g = function mapStateToProps(state, props) {
|
|
26021
27271
|
return {
|
|
26022
27272
|
selectedValues: filterByComponentIds(state.selectedValues, props),
|
|
26023
27273
|
queryLog: filterByComponentIds(state.queryLog, props),
|
|
@@ -26034,7 +27284,7 @@
|
|
|
26034
27284
|
};
|
|
26035
27285
|
};
|
|
26036
27286
|
|
|
26037
|
-
var StateProviderConnected = connect(mapStateToProps$
|
|
27287
|
+
var StateProviderConnected = connect(mapStateToProps$g, {})(StateProvider);
|
|
26038
27288
|
|
|
26039
27289
|
StateProvider.install = function (Vue) {
|
|
26040
27290
|
Vue.component(StateProvider.name, StateProviderConnected);
|
|
@@ -26510,21 +27760,21 @@
|
|
|
26510
27760
|
});
|
|
26511
27761
|
}
|
|
26512
27762
|
|
|
26513
|
-
var version = "1.
|
|
27763
|
+
var version = "1.27.0-gamma.3";
|
|
26514
27764
|
|
|
26515
|
-
var _templateObject$
|
|
27765
|
+
var _templateObject$o, _templateObject2$a;
|
|
26516
27766
|
|
|
26517
27767
|
var alert = function alert(_ref) {
|
|
26518
27768
|
var theme = _ref.theme;
|
|
26519
|
-
return css(_templateObject$
|
|
27769
|
+
return css(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
|
|
26520
27770
|
};
|
|
26521
27771
|
|
|
26522
27772
|
var Content = index$1('div')(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
26523
27773
|
return props.alert && alert;
|
|
26524
27774
|
});
|
|
26525
27775
|
|
|
26526
|
-
var getClassName$
|
|
26527
|
-
isEqual$
|
|
27776
|
+
var getClassName$g = lib_8.getClassName,
|
|
27777
|
+
isEqual$g = lib_8.isEqual;
|
|
26528
27778
|
var RangeInput = {
|
|
26529
27779
|
name: 'RangeInput',
|
|
26530
27780
|
components: {
|
|
@@ -26606,7 +27856,7 @@
|
|
|
26606
27856
|
handleChange: function handleChange(value, event) {
|
|
26607
27857
|
var currentValue = value;
|
|
26608
27858
|
|
|
26609
|
-
if (this.shouldUpdate(value) && !isEqual$
|
|
27859
|
+
if (this.shouldUpdate(value) && !isEqual$g(value, this.currentValue)) {
|
|
26610
27860
|
switch (event) {
|
|
26611
27861
|
case 'change':
|
|
26612
27862
|
if (!value) {
|
|
@@ -26676,7 +27926,7 @@
|
|
|
26676
27926
|
}
|
|
26677
27927
|
},
|
|
26678
27928
|
value: function value(newVal, oldVal) {
|
|
26679
|
-
if (!isEqual$
|
|
27929
|
+
if (!isEqual$g(newVal, oldVal)) {
|
|
26680
27930
|
if (this.isControlled()) {
|
|
26681
27931
|
this.handleChange(newVal, 'change');
|
|
26682
27932
|
}
|
|
@@ -26687,6 +27937,10 @@
|
|
|
26687
27937
|
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
26688
27938
|
this.handleChange(this.$props.defaultValue);
|
|
26689
27939
|
}
|
|
27940
|
+
|
|
27941
|
+
if (this.isControlled()) {
|
|
27942
|
+
this.handleChange(this.$props.value, 'change');
|
|
27943
|
+
}
|
|
26690
27944
|
},
|
|
26691
27945
|
render: function render() {
|
|
26692
27946
|
var h = arguments[0];
|
|
@@ -26743,7 +27997,7 @@
|
|
|
26743
27997
|
"value-change": this.handleValueChange
|
|
26744
27998
|
}
|
|
26745
27999
|
}), h(Flex, {
|
|
26746
|
-
"class": getClassName$
|
|
28000
|
+
"class": getClassName$g(innerClass, 'input-container') || ''
|
|
26747
28001
|
}, [h(Flex, {
|
|
26748
28002
|
"attrs": {
|
|
26749
28003
|
"direction": "column",
|
|
@@ -26763,7 +28017,7 @@
|
|
|
26763
28017
|
"on": {
|
|
26764
28018
|
"change": this.handleInputChange
|
|
26765
28019
|
},
|
|
26766
|
-
"class": getClassName$
|
|
28020
|
+
"class": getClassName$g(innerClass, 'input') || '',
|
|
26767
28021
|
"domProps": _extends({}, {
|
|
26768
28022
|
value: this.currentValue.start
|
|
26769
28023
|
})
|
|
@@ -26796,7 +28050,7 @@
|
|
|
26796
28050
|
"on": {
|
|
26797
28051
|
"change": this.handleInputChange
|
|
26798
28052
|
},
|
|
26799
|
-
"class": getClassName$
|
|
28053
|
+
"class": getClassName$g(innerClass, 'input') || '',
|
|
26800
28054
|
"domProps": _extends({}, {
|
|
26801
28055
|
value: this.currentValue.end
|
|
26802
28056
|
})
|
|
@@ -26808,13 +28062,13 @@
|
|
|
26808
28062
|
}
|
|
26809
28063
|
};
|
|
26810
28064
|
|
|
26811
|
-
var mapStateToProps$
|
|
28065
|
+
var mapStateToProps$h = function mapStateToProps(state) {
|
|
26812
28066
|
return {
|
|
26813
28067
|
themePreset: state.config.themePreset
|
|
26814
28068
|
};
|
|
26815
28069
|
};
|
|
26816
28070
|
|
|
26817
|
-
var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$
|
|
28071
|
+
var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$h, {})(RangeInput), {
|
|
26818
28072
|
componentType: constants_1$1.rangeInput
|
|
26819
28073
|
});
|
|
26820
28074
|
|
|
@@ -26825,7 +28079,7 @@
|
|
|
26825
28079
|
|
|
26826
28080
|
RangeInput.componentType = constants_1$1.rangeInput;
|
|
26827
28081
|
|
|
26828
|
-
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
|
|
28082
|
+
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SearchBox, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
|
|
26829
28083
|
function install (Vue) {
|
|
26830
28084
|
components.map(function (component) {
|
|
26831
28085
|
Vue.use(component);
|
|
@@ -26855,6 +28109,7 @@
|
|
|
26855
28109
|
exports.ReactiveList = ReactiveList;
|
|
26856
28110
|
exports.ResultCard = ResultCard;
|
|
26857
28111
|
exports.ResultList = ResultList;
|
|
28112
|
+
exports.SearchBox = SearchBox;
|
|
26858
28113
|
exports.SelectedFilters = SelectedFilters;
|
|
26859
28114
|
exports.SingleDropdownList = SingleDropdownList;
|
|
26860
28115
|
exports.SingleList = SingleList;
|