@appbaseio/reactivesearch-vue 1.33.10 → 1.33.12
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 +1129 -1109
- 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-f89a5972.js → ComponentWrapper-94c50228.js} +1 -1
- package/dist/cjs/DataSearch.js +1310 -17
- package/dist/cjs/{DropDown-8984b544.js → DropDown-1c69b067.js} +1 -1
- package/dist/cjs/DynamicRangeSlider.js +2 -2
- package/dist/cjs/MultiDropdownList.js +4 -4
- package/dist/cjs/MultiList.js +3 -3
- package/dist/cjs/MultiRange.js +3 -3
- package/dist/cjs/{PreferencesConsumer-5d67b486.js → PreferencesConsumer-5e6e84a2.js} +1 -1
- package/dist/cjs/RangeInput.js +3 -3
- package/dist/cjs/RangeSlider.js +3 -3
- package/dist/cjs/ReactiveBase.js +1 -1
- package/dist/cjs/ReactiveComponent.js +316 -45
- package/dist/cjs/{ReactiveComponent-f51e4519.js → ReactiveComponentPrivate-fe54dfe2.js} +22 -311
- package/dist/cjs/ReactiveComponentPrivate.js +55 -0
- package/dist/cjs/ReactiveGoogleMap.js +3 -3
- package/dist/cjs/ReactiveList.js +3 -3
- package/dist/cjs/SelectedFilters.js +1 -1
- package/dist/cjs/SingleDropdownList.js +4 -4
- package/dist/cjs/SingleList.js +3 -3
- package/dist/cjs/SingleRange.js +3 -3
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/Tags-8fbad58b.js +883 -0
- package/dist/cjs/ToggleButton.js +3 -3
- package/dist/cjs/{index-30126fd0.js → index-de136c17.js} +2 -0
- package/dist/cjs/index.js +12 -9
- package/dist/cjs/install.js +9 -7
- package/dist/cjs/version.js +1 -1
- package/dist/es/{ComponentWrapper-39966c87.js → ComponentWrapper-edaeaceb.js} +1 -1
- package/dist/es/DataSearch.js +1310 -15
- package/dist/es/{DropDown-28ddce07.js → DropDown-40687515.js} +1 -1
- package/dist/es/DynamicRangeSlider.js +2 -2
- package/dist/es/MultiDropdownList.js +4 -4
- package/dist/es/MultiList.js +3 -3
- package/dist/es/MultiRange.js +3 -3
- package/dist/es/{PreferencesConsumer-bc097ebb.js → PreferencesConsumer-86a676c8.js} +1 -1
- package/dist/es/RangeInput.js +3 -3
- package/dist/es/RangeSlider.js +3 -3
- package/dist/es/ReactiveBase.js +1 -1
- package/dist/es/ReactiveComponent.js +316 -44
- package/dist/es/{ReactiveComponent-9ae8b96c.js → ReactiveComponentPrivate-799f2576.js} +8 -297
- package/dist/es/ReactiveComponentPrivate.js +47 -0
- package/dist/es/ReactiveGoogleMap.js +3 -3
- package/dist/es/ReactiveList.js +3 -3
- package/dist/es/SelectedFilters.js +1 -1
- package/dist/es/SingleDropdownList.js +4 -4
- package/dist/es/SingleList.js +3 -3
- package/dist/es/SingleRange.js +3 -3
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/Tags-7f4665a9.js +869 -0
- package/dist/es/ToggleButton.js +3 -3
- package/dist/es/{index-0444a498.js → index-5509c0bc.js} +2 -0
- package/dist/es/index.js +8 -6
- package/dist/es/install.js +9 -7
- package/dist/es/version.js +1 -1
- package/package.json +88 -88
- package/dist/cjs/DataSearch-57d44eca.js +0 -2184
- package/dist/es/DataSearch-8a195d63.js +0 -2168
|
@@ -5310,7 +5310,8 @@
|
|
|
5310
5310
|
};
|
|
5311
5311
|
var featuredSuggestionsActionTypes = exports.featuredSuggestionsActionTypes = {
|
|
5312
5312
|
NAVIGATE: 'navigate',
|
|
5313
|
-
FUNCTION: 'function'
|
|
5313
|
+
FUNCTION: 'function',
|
|
5314
|
+
SELECT: 'select'
|
|
5314
5315
|
};
|
|
5315
5316
|
var queryFormatMillisecondsMap = exports.queryFormatMillisecondsMap = {
|
|
5316
5317
|
minute: 60000,
|
|
@@ -6129,7 +6130,7 @@
|
|
|
6129
6130
|
end: store.aggregations[component + '__range__internal'][componentProps.nestedField].max.value
|
|
6130
6131
|
} : null;
|
|
6131
6132
|
} else {
|
|
6132
|
-
rangeValue = rangeValue && store.aggregations[component + '__range__internal'].min ? {
|
|
6133
|
+
rangeValue = rangeValue && store.aggregations[component + '__range__internal'].min && store.aggregations[component + '__range__internal'].min.value ? {
|
|
6133
6134
|
start: store.aggregations[component + '__range__internal'].min.value,
|
|
6134
6135
|
end: store.aggregations[component + '__range__internal'].max.value
|
|
6135
6136
|
} : null;
|
|
@@ -12778,12 +12779,14 @@
|
|
|
12778
12779
|
if (str === void 0) {
|
|
12779
12780
|
str = '';
|
|
12780
12781
|
}
|
|
12782
|
+
var propsWhichRequirePascalCase = ['u-r-l-params'];
|
|
12781
12783
|
var arr = str.split('-');
|
|
12782
12784
|
var capital = arr.map(function (item, index) {
|
|
12783
12785
|
return index ? item.charAt(0).toUpperCase() + item.slice(1).toLowerCase() : item;
|
|
12784
12786
|
});
|
|
12785
12787
|
// ^-- change here.
|
|
12786
12788
|
var capitalString = capital.join('');
|
|
12789
|
+
if (propsWhichRequirePascalCase.includes(str)) capitalString = capitalString[0].toUpperCase() + capitalString.substring(1);
|
|
12787
12790
|
return capitalString || '';
|
|
12788
12791
|
};
|
|
12789
12792
|
var isEmpty = function isEmpty(val) {
|
|
@@ -23718,664 +23721,728 @@
|
|
|
23718
23721
|
// Add componentType for SSR
|
|
23719
23722
|
TBConnected.componentType = constants_1$1.toggleButton;
|
|
23720
23723
|
|
|
23721
|
-
|
|
23722
|
-
|
|
23723
|
-
* (c) 2018-present egoist <0x142857@gmail.com>
|
|
23724
|
-
* Released under the MIT License.
|
|
23725
|
-
*/
|
|
23726
|
-
|
|
23727
|
-
var index$3 = {
|
|
23728
|
-
name: 'NoSsr',
|
|
23729
|
-
functional: true,
|
|
23730
|
-
props: {
|
|
23731
|
-
placeholder: String,
|
|
23732
|
-
placeholderTag: {
|
|
23733
|
-
type: String,
|
|
23734
|
-
"default": 'div'
|
|
23735
|
-
}
|
|
23736
|
-
},
|
|
23737
|
-
render: function render(h, ref) {
|
|
23738
|
-
var parent = ref.parent;
|
|
23739
|
-
var slots = ref.slots;
|
|
23740
|
-
var props = ref.props;
|
|
23741
|
-
var ref$1 = slots();
|
|
23742
|
-
var defaultSlot = ref$1["default"];
|
|
23743
|
-
if (defaultSlot === void 0) defaultSlot = [];
|
|
23744
|
-
var placeholderSlot = ref$1.placeholder;
|
|
23745
|
-
if (parent._isMounted) {
|
|
23746
|
-
return defaultSlot;
|
|
23747
|
-
}
|
|
23748
|
-
parent.$once('hook:mounted', function () {
|
|
23749
|
-
parent.$forceUpdate();
|
|
23750
|
-
});
|
|
23751
|
-
if (props.placeholderTag && (props.placeholder || placeholderSlot)) {
|
|
23752
|
-
return h(props.placeholderTag, {
|
|
23753
|
-
"class": ['no-ssr-placeholder']
|
|
23754
|
-
}, props.placeholder || placeholderSlot);
|
|
23755
|
-
}
|
|
23756
|
-
|
|
23757
|
-
// Return a placeholder element for each child in the default slot
|
|
23758
|
-
// Or if no children return a single placeholder
|
|
23759
|
-
return defaultSlot.length > 0 ? defaultSlot.map(function () {
|
|
23760
|
-
return h(false);
|
|
23761
|
-
}) : h(false);
|
|
23762
|
-
}
|
|
23763
|
-
};
|
|
23764
|
-
var vueNoSsr_common = index$3;
|
|
23765
|
-
|
|
23766
|
-
var _templateObject$o;
|
|
23767
|
-
var Slider = index$1('div')(_templateObject$o || (_templateObject$o = _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"])));
|
|
23768
|
-
|
|
23769
|
-
/**
|
|
23770
|
-
* Caution: Please do not change this file without having a discussion with the Team.
|
|
23771
|
-
* Any change may break the umd build, we're directly replacing the line no: 14
|
|
23772
|
-
* `
|
|
23773
|
-
var s = document.createElement("script");
|
|
23774
|
-
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
|
|
23775
|
-
s.onload = function(){
|
|
23776
|
-
var VueSlider = global['vue-slider-component'];
|
|
23777
|
-
components['vue-slider-component'] = VueSlider;
|
|
23778
|
-
}
|
|
23779
|
-
document.head.appendChild(s);
|
|
23780
|
-
` in rollup umd build process with some script.
|
|
23781
|
-
*/
|
|
23782
|
-
// eslint-disable-next-line
|
|
23783
|
-
var getComponents = function getComponents() {
|
|
23784
|
-
var components = {
|
|
23785
|
-
NoSSR: vueNoSsr_common
|
|
23786
|
-
};
|
|
23787
|
-
{
|
|
23788
|
-
try {
|
|
23789
|
-
// in older versions of nuxt, it's process.BROWSER_BUILD
|
|
23790
|
-
// eslint-disable-next-line
|
|
23791
|
-
|
|
23792
|
-
var s = document.createElement("script");
|
|
23793
|
-
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
|
|
23794
|
-
s.onload = function(){
|
|
23795
|
-
var VueSlider = global$1['vue-slider-component'];
|
|
23796
|
-
components['vue-slider-component'] = VueSlider;
|
|
23797
|
-
};
|
|
23798
|
-
document.head.appendChild(s);
|
|
23799
|
-
|
|
23800
|
-
} catch (e) {
|
|
23801
|
-
console.error('Unable to load vue-slider', e);
|
|
23802
|
-
}
|
|
23803
|
-
}
|
|
23804
|
-
return components;
|
|
23805
|
-
};
|
|
23806
|
-
|
|
23807
|
-
var addComponent$1 = lib_5.addComponent,
|
|
23808
|
-
removeComponent$1 = lib_5.removeComponent,
|
|
23809
|
-
watchComponent$1 = lib_5.watchComponent,
|
|
23810
|
-
updateQuery$8 = lib_5.updateQuery,
|
|
23811
|
-
setQueryListener$1 = lib_5.setQueryListener,
|
|
23724
|
+
var _excluded = ["options"];
|
|
23725
|
+
var updateQuery$8 = lib_5.updateQuery,
|
|
23812
23726
|
setQueryOptions$7 = lib_5.setQueryOptions,
|
|
23813
|
-
setComponentProps$1 = lib_5.setComponentProps,
|
|
23814
23727
|
setCustomQuery$7 = lib_5.setCustomQuery,
|
|
23815
|
-
|
|
23816
|
-
var
|
|
23817
|
-
getClassName$b = lib_8.getClassName,
|
|
23728
|
+
setDefaultQuery$7 = lib_5.setDefaultQuery;
|
|
23729
|
+
var parseHits$1 = lib_8.parseHits,
|
|
23818
23730
|
isEqual$b = lib_8.isEqual,
|
|
23819
|
-
|
|
23731
|
+
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
23732
|
+
getResultStats$3 = lib_8.getResultStats,
|
|
23820
23733
|
extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
|
|
23821
23734
|
getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
|
|
23822
|
-
var
|
|
23823
|
-
name: '
|
|
23824
|
-
components: getComponents(),
|
|
23735
|
+
var ReactiveComponent = {
|
|
23736
|
+
name: 'ReactiveComponent',
|
|
23825
23737
|
props: {
|
|
23826
|
-
beforeValueChange: types.func,
|
|
23827
|
-
className: VueTypes.string.def(''),
|
|
23828
|
-
rangeLabels: types.func,
|
|
23829
23738
|
componentId: types.stringRequired,
|
|
23739
|
+
aggregationField: types.string,
|
|
23740
|
+
aggregationSize: VueTypes.number,
|
|
23741
|
+
size: VueTypes.number,
|
|
23742
|
+
defaultQuery: types.func,
|
|
23830
23743
|
customQuery: types.func,
|
|
23831
|
-
data: types.data,
|
|
23832
|
-
dataField: types.stringRequired,
|
|
23833
|
-
defaultValue: types.func,
|
|
23834
23744
|
filterLabel: types.string,
|
|
23835
|
-
innerClass: types.style,
|
|
23836
23745
|
react: types.react,
|
|
23837
23746
|
showFilter: VueTypes.bool.def(true),
|
|
23838
|
-
destroyOnUnmount: VueTypes.bool,
|
|
23839
|
-
showCheckbox: VueTypes.bool.def(true),
|
|
23840
|
-
title: types.title,
|
|
23841
23747
|
URLParams: VueTypes.bool.def(false),
|
|
23842
|
-
|
|
23843
|
-
|
|
23748
|
+
distinctField: types.string,
|
|
23749
|
+
distinctFieldConfig: types.props,
|
|
23844
23750
|
index: VueTypes.string,
|
|
23845
|
-
value: types.range,
|
|
23846
23751
|
endpoint: types.endpointConfig
|
|
23847
23752
|
},
|
|
23848
|
-
data: function data() {
|
|
23849
|
-
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
23850
|
-
return {
|
|
23851
|
-
currentValue: null,
|
|
23852
|
-
stats: []
|
|
23853
|
-
};
|
|
23854
|
-
},
|
|
23855
23753
|
created: function created() {
|
|
23856
23754
|
var _this = this;
|
|
23857
|
-
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
args[_key] = arguments[_key];
|
|
23861
|
-
}
|
|
23862
|
-
_this.$emit.apply(_this, ['queryChange'].concat(args));
|
|
23863
|
-
_this.$emit.apply(_this, ['query-change'].concat(args));
|
|
23864
|
-
};
|
|
23865
|
-
this.setQueryListener(this.$props.componentId, onQueryChange, null);
|
|
23866
|
-
// Update props in store
|
|
23867
|
-
this.setComponentProps(this.componentId, this.$props, constants_1$1.dynamicRangeSlider);
|
|
23868
|
-
this.setComponentProps(this.internalRangeComponent, this.$props, constants_1$1.dynamicRangeSlider);
|
|
23869
|
-
if (!this.enableAppbase && this.$props.index) {
|
|
23870
|
-
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
23871
|
-
}
|
|
23755
|
+
var props = this.$props;
|
|
23756
|
+
this.internalComponent = null;
|
|
23757
|
+
this.$defaultQuery = null;
|
|
23872
23758
|
// Set custom query in store
|
|
23873
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.
|
|
23874
|
-
|
|
23875
|
-
|
|
23876
|
-
|
|
23877
|
-
|
|
23878
|
-
|
|
23879
|
-
|
|
23880
|
-
|
|
23881
|
-
|
|
23882
|
-
|
|
23759
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23760
|
+
var customQuery = props.customQuery,
|
|
23761
|
+
componentId = props.componentId,
|
|
23762
|
+
filterLabel = props.filterLabel,
|
|
23763
|
+
showFilter = props.showFilter,
|
|
23764
|
+
URLParams = props.URLParams,
|
|
23765
|
+
distinctField = props.distinctField,
|
|
23766
|
+
distinctFieldConfig = props.distinctFieldConfig,
|
|
23767
|
+
index = props.index;
|
|
23768
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
23769
|
+
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
23883
23770
|
}
|
|
23884
|
-
|
|
23885
|
-
|
|
23886
|
-
this.addComponent(this.componentId, this.$timestamp);
|
|
23887
|
-
this.addComponent(this.internalRangeComponent, this.$timestamp);
|
|
23888
|
-
if (Array.isArray(this.selectedValue)) {
|
|
23889
|
-
this.handleChange(this.selectedValue);
|
|
23890
|
-
} else if (this.selectedValue) {
|
|
23891
|
-
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
23892
|
-
} else if (value) {
|
|
23893
|
-
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
23894
|
-
}
|
|
23895
|
-
|
|
23896
|
-
// get range before executing other queries
|
|
23897
|
-
this.updateRangeQueryOptions();
|
|
23771
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
23772
|
+
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
23898
23773
|
}
|
|
23899
|
-
|
|
23900
|
-
|
|
23901
|
-
if (!this.currentValue) {
|
|
23902
|
-
this.setDefaultValue(this.range);
|
|
23774
|
+
if (!this.enableAppbase && index) {
|
|
23775
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
23903
23776
|
}
|
|
23904
|
-
|
|
23905
|
-
|
|
23906
|
-
|
|
23907
|
-
|
|
23908
|
-
|
|
23777
|
+
if (customQuery) {
|
|
23778
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
23779
|
+
var query = extractQueryFromCustomQuery$6(calcCustomQuery);
|
|
23780
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
|
|
23781
|
+
if (customQueryOptions) {
|
|
23782
|
+
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
23783
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
23784
|
+
this.updateQuery({
|
|
23785
|
+
componentId: componentId,
|
|
23786
|
+
query: query,
|
|
23787
|
+
value: this.selectedValue || null,
|
|
23788
|
+
label: filterLabel,
|
|
23789
|
+
showFilter: showFilter,
|
|
23790
|
+
URLParams: URLParams
|
|
23791
|
+
});
|
|
23909
23792
|
}
|
|
23910
|
-
|
|
23911
|
-
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
23793
|
+
this.setQuery = function (_ref) {
|
|
23794
|
+
var options = _ref.options,
|
|
23795
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23796
|
+
var queryToBeSet = obj.query;
|
|
23797
|
+
|
|
23798
|
+
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
23799
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
23800
|
+
queryToBeSet = queryToBeSet.query;
|
|
23915
23801
|
}
|
|
23916
|
-
|
|
23917
|
-
|
|
23918
|
-
|
|
23919
|
-
var
|
|
23920
|
-
|
|
23921
|
-
if (
|
|
23922
|
-
|
|
23923
|
-
defaultStart = _this$$props$defaultV.start,
|
|
23924
|
-
defaultEnd = _this$$props$defaultV.end;
|
|
23925
|
-
this.handleChange([defaultStart, defaultEnd]);
|
|
23926
|
-
} else if (this.isControlled()) {
|
|
23927
|
-
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
23928
|
-
} else {
|
|
23929
|
-
this.currentValue = [start, end];
|
|
23802
|
+
var customQueryCalc = _extends({}, options, {
|
|
23803
|
+
query: queryToBeSet
|
|
23804
|
+
});
|
|
23805
|
+
var rsAPIQuery = customQueryCalc;
|
|
23806
|
+
// handle stored queries
|
|
23807
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
23808
|
+
rsAPIQuery = queryToBeSet;
|
|
23930
23809
|
}
|
|
23931
|
-
|
|
23932
|
-
|
|
23933
|
-
if (
|
|
23934
|
-
|
|
23935
|
-
this.watchComponent(this.$props.componentId, this.$props.react);
|
|
23936
|
-
} else {
|
|
23937
|
-
this.watchComponent(this.internalRangeComponent, {});
|
|
23938
|
-
this.watchComponent(this.$props.componentId, {});
|
|
23810
|
+
// Update customQuery field for RS API
|
|
23811
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
23812
|
+
if (options) {
|
|
23813
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
23939
23814
|
}
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
23943
|
-
|
|
23944
|
-
|
|
23945
|
-
|
|
23946
|
-
|
|
23947
|
-
|
|
23948
|
-
|
|
23949
|
-
|
|
23950
|
-
|
|
23951
|
-
|
|
23952
|
-
|
|
23953
|
-
|
|
23954
|
-
|
|
23955
|
-
|
|
23956
|
-
|
|
23957
|
-
|
|
23958
|
-
|
|
23959
|
-
aggs = (_aggs = {}, _aggs[this.$props.nestedField] = {
|
|
23960
|
-
nested: {
|
|
23961
|
-
path: this.$props.nestedField
|
|
23962
|
-
},
|
|
23963
|
-
aggs: this.rangeQuery()
|
|
23964
|
-
}, _aggs);
|
|
23965
|
-
} else {
|
|
23966
|
-
aggs = this.rangeQuery();
|
|
23967
|
-
}
|
|
23968
|
-
this.setQueryOptions(this.internalRangeComponent, {
|
|
23969
|
-
aggs: aggs
|
|
23970
|
-
});
|
|
23971
|
-
},
|
|
23972
|
-
handleSlider: function handleSlider() {
|
|
23973
|
-
var sliderValues = this.$refs.slider.getValue();
|
|
23974
|
-
var value = this.$props.value;
|
|
23975
|
-
if (value === undefined) {
|
|
23976
|
-
this.handleChange(sliderValues);
|
|
23977
|
-
} else {
|
|
23978
|
-
this.$emit('change', {
|
|
23979
|
-
start: sliderValues[0],
|
|
23980
|
-
end: sliderValues[1]
|
|
23981
|
-
});
|
|
23982
|
-
}
|
|
23983
|
-
},
|
|
23984
|
-
handleChange: function handleChange(currentValue) {
|
|
23985
|
-
var _this2 = this;
|
|
23986
|
-
// Always keep the values within range
|
|
23987
|
-
var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
|
|
23988
|
-
var performUpdate = function performUpdate() {
|
|
23989
|
-
_this2.currentValue = normalizedValue;
|
|
23990
|
-
_this2.updateQueryHandler(normalizedValue, _this2.$props);
|
|
23991
|
-
_this2.$emit('valueChange', {
|
|
23992
|
-
start: normalizedValue[0],
|
|
23993
|
-
end: normalizedValue[1]
|
|
23994
|
-
});
|
|
23995
|
-
_this2.$emit('value-change', {
|
|
23996
|
-
start: normalizedValue[0],
|
|
23997
|
-
end: normalizedValue[1]
|
|
23998
|
-
});
|
|
23999
|
-
};
|
|
24000
|
-
checkValueChange$7(this.$props.componentId, {
|
|
24001
|
-
start: normalizedValue[0],
|
|
24002
|
-
end: normalizedValue[1]
|
|
24003
|
-
}, this.$props.beforeValueChange, performUpdate);
|
|
24004
|
-
},
|
|
24005
|
-
updateQueryHandler: function updateQueryHandler(value) {
|
|
24006
|
-
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
24007
|
-
if (this.$props.customQuery) {
|
|
24008
|
-
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
24009
|
-
var queryTobeSet = extractQueryFromCustomQuery$6(customQueryTobeSet);
|
|
24010
|
-
if (queryTobeSet) {
|
|
24011
|
-
query = queryTobeSet;
|
|
24012
|
-
}
|
|
24013
|
-
var customQueryOptions = getOptionsForCustomQuery$6(customQueryTobeSet);
|
|
24014
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
24015
|
-
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
24016
|
-
}
|
|
24017
|
-
var _ref2 = this.range || {
|
|
24018
|
-
start: value[0],
|
|
24019
|
-
end: value[1]
|
|
24020
|
-
},
|
|
24021
|
-
start = _ref2.start,
|
|
24022
|
-
end = _ref2.end;
|
|
24023
|
-
var currentStart = value[0],
|
|
24024
|
-
currentEnd = value[1];
|
|
24025
|
-
// check if the slider is at its initial position
|
|
24026
|
-
var isInitialValue = currentStart === start && currentEnd === end;
|
|
23815
|
+
_this.updateQuery(_extends({}, obj, {
|
|
23816
|
+
query: customQueryCalc.query,
|
|
23817
|
+
componentId: props.componentId,
|
|
23818
|
+
label: props.filterLabel,
|
|
23819
|
+
showFilter: props.showFilter,
|
|
23820
|
+
URLParams: props.URLParams
|
|
23821
|
+
}));
|
|
23822
|
+
};
|
|
23823
|
+
if (props.defaultQuery) {
|
|
23824
|
+
this.internalComponent = props.componentId + "__internal";
|
|
23825
|
+
}
|
|
23826
|
+
if (this.internalComponent && this.$props.defaultQuery) {
|
|
23827
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23828
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
23829
|
+
var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
23830
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
23831
|
+
if (queryOptions) {
|
|
23832
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
23833
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
24027
23834
|
this.updateQuery({
|
|
24028
|
-
componentId: this
|
|
24029
|
-
query:
|
|
24030
|
-
value: value,
|
|
24031
|
-
label: this.$props.filterLabel,
|
|
24032
|
-
showFilter: this.$props.showFilter && !isInitialValue,
|
|
24033
|
-
URLParams: this.$props.URLParams,
|
|
24034
|
-
componentType: constants_1$1.dynamicRangeSlider
|
|
23835
|
+
componentId: this.internalComponent,
|
|
23836
|
+
query: _query
|
|
24035
23837
|
});
|
|
24036
23838
|
}
|
|
24037
23839
|
},
|
|
24038
|
-
computed: {
|
|
24039
|
-
labels: function labels() {
|
|
24040
|
-
if (!this.rangeLabels) return null;
|
|
24041
|
-
return this.rangeLabels(this.range.start, this.range.end);
|
|
24042
|
-
}
|
|
24043
|
-
},
|
|
24044
23840
|
watch: {
|
|
24045
|
-
|
|
24046
|
-
|
|
24047
|
-
|
|
24048
|
-
var _this3 = this;
|
|
24049
|
-
var propsKeys = getValidPropsKeys(newVal);
|
|
24050
|
-
checkSomePropChange$1(newVal, this.componentProps, propsKeys, function () {
|
|
24051
|
-
_this3.updateComponentProps(_this3.componentId, newVal, constants_1$1.dynamicRangeSlider);
|
|
24052
|
-
_this3.updateComponentProps(_this3.internalRangeComponent, newVal, constants_1$1.dynamicRangeSlider);
|
|
24053
|
-
});
|
|
23841
|
+
hits: function hits(newVal, oldVal) {
|
|
23842
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23843
|
+
this.$emit('data', this.getData());
|
|
24054
23844
|
}
|
|
24055
23845
|
},
|
|
24056
|
-
|
|
24057
|
-
|
|
23846
|
+
rawData: function rawData(newVal, oldVal) {
|
|
23847
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23848
|
+
this.$emit('data', this.getData());
|
|
23849
|
+
}
|
|
24058
23850
|
},
|
|
24059
|
-
|
|
24060
|
-
if (isEqual$b(
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
end: this.range.end
|
|
24064
|
-
};
|
|
24065
|
-
this.$emit('change', value);
|
|
24066
|
-
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
23851
|
+
aggregations: function aggregations(newVal, oldVal) {
|
|
23852
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23853
|
+
this.$emit('data', this.getData());
|
|
23854
|
+
}
|
|
24067
23855
|
},
|
|
24068
|
-
|
|
24069
|
-
if (isEqual$b(
|
|
24070
|
-
|
|
24071
|
-
|
|
24072
|
-
currentEnd = _ref3[1];
|
|
24073
|
-
var _ref4 = oldValue || {},
|
|
24074
|
-
oldStart = _ref4.start,
|
|
24075
|
-
oldEnd = _ref4.end;
|
|
24076
|
-
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
24077
|
-
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
24078
|
-
this.handleChange([newStart, newEnd]);
|
|
23856
|
+
aggregationData: function aggregationData(newVal, oldVal) {
|
|
23857
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23858
|
+
this.$emit('data', this.getData());
|
|
23859
|
+
}
|
|
24079
23860
|
},
|
|
24080
|
-
|
|
24081
|
-
if (!
|
|
24082
|
-
this
|
|
23861
|
+
promotedResults: function promotedResults(newVal, oldVal) {
|
|
23862
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23863
|
+
this.$emit('data', this.getData());
|
|
24083
23864
|
}
|
|
24084
23865
|
},
|
|
24085
|
-
|
|
23866
|
+
hidden: function hidden(newVal, oldVal) {
|
|
24086
23867
|
if (!isEqual$b(newVal, oldVal)) {
|
|
24087
|
-
this
|
|
23868
|
+
this.$emit('data', this.getData());
|
|
23869
|
+
}
|
|
23870
|
+
},
|
|
23871
|
+
total: function total(newVal, oldVal) {
|
|
23872
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23873
|
+
this.$emit('data', this.getData());
|
|
23874
|
+
}
|
|
23875
|
+
},
|
|
23876
|
+
time: function time(newVal, oldVal) {
|
|
23877
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23878
|
+
this.$emit('data', this.getData());
|
|
23879
|
+
}
|
|
23880
|
+
},
|
|
23881
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
23882
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23883
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
23884
|
+
var query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
23885
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
23886
|
+
if (queryOptions) {
|
|
23887
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
23888
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
23889
|
+
// Update default query for RS API
|
|
23890
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23891
|
+
this.updateQuery({
|
|
23892
|
+
componentId: this.internalComponent,
|
|
23893
|
+
query: query
|
|
23894
|
+
});
|
|
23895
|
+
}
|
|
23896
|
+
},
|
|
23897
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
23898
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23899
|
+
var componentId = this.$props.componentId;
|
|
23900
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
23901
|
+
var query = extractQueryFromCustomQuery$6(this.$customQuery);
|
|
23902
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$customQuery);
|
|
23903
|
+
if (queryOptions) {
|
|
23904
|
+
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
23905
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
23906
|
+
|
|
23907
|
+
// Update custom query for RS API
|
|
23908
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23909
|
+
this.updateQuery({
|
|
23910
|
+
componentId: componentId,
|
|
23911
|
+
query: query
|
|
23912
|
+
});
|
|
24088
23913
|
}
|
|
24089
23914
|
}
|
|
24090
23915
|
},
|
|
24091
23916
|
render: function render() {
|
|
24092
23917
|
var h = arguments[0];
|
|
24093
|
-
|
|
23918
|
+
try {
|
|
23919
|
+
var dom = this.$scopedSlots["default"];
|
|
23920
|
+
var error = this.error,
|
|
23921
|
+
isLoading = this.isLoading,
|
|
23922
|
+
selectedValue = this.selectedValue;
|
|
23923
|
+
var propsToBePassed = _extends({
|
|
23924
|
+
error: error,
|
|
23925
|
+
loading: isLoading
|
|
23926
|
+
}, this.getData(), {
|
|
23927
|
+
value: selectedValue,
|
|
23928
|
+
setQuery: this.setQuery
|
|
23929
|
+
});
|
|
23930
|
+
return h("div", [dom(propsToBePassed)]);
|
|
23931
|
+
} catch (e) {
|
|
24094
23932
|
return null;
|
|
24095
23933
|
}
|
|
24096
|
-
|
|
24097
|
-
|
|
24098
|
-
|
|
24099
|
-
|
|
24100
|
-
|
|
24101
|
-
|
|
24102
|
-
|
|
24103
|
-
|
|
24104
|
-
|
|
24105
|
-
|
|
24106
|
-
|
|
24107
|
-
|
|
24108
|
-
|
|
24109
|
-
|
|
24110
|
-
|
|
24111
|
-
|
|
24112
|
-
|
|
24113
|
-
|
|
24114
|
-
|
|
24115
|
-
|
|
24116
|
-
|
|
24117
|
-
|
|
24118
|
-
|
|
24119
|
-
|
|
24120
|
-
|
|
24121
|
-
|
|
24122
|
-
|
|
24123
|
-
|
|
24124
|
-
|
|
24125
|
-
"class": getClassName$b(this.$props.innerClass, 'label') || 'range-label-right'
|
|
24126
|
-
}, [this.labels.end])]) : null])])]);
|
|
24127
|
-
}
|
|
24128
|
-
};
|
|
24129
|
-
DynamicRangeSlider.defaultQuery = function (values, props) {
|
|
24130
|
-
var query = null;
|
|
24131
|
-
if (Array.isArray(values) && values.length) {
|
|
24132
|
-
var _range;
|
|
24133
|
-
query = {
|
|
24134
|
-
range: (_range = {}, _range[props.dataField] = {
|
|
24135
|
-
gte: values[0],
|
|
24136
|
-
lte: values[1],
|
|
24137
|
-
boost: 2.0
|
|
24138
|
-
}, _range)
|
|
24139
|
-
};
|
|
24140
|
-
}
|
|
24141
|
-
if (query && props.nestedField) {
|
|
24142
|
-
return {
|
|
24143
|
-
query: {
|
|
24144
|
-
nested: {
|
|
24145
|
-
path: props.nestedField,
|
|
24146
|
-
query: query
|
|
23934
|
+
},
|
|
23935
|
+
methods: {
|
|
23936
|
+
getAggsQuery: function getAggsQuery() {
|
|
23937
|
+
if (this.aggregationField) {
|
|
23938
|
+
return {
|
|
23939
|
+
aggs: getCompositeAggsQuery$5({
|
|
23940
|
+
props: this.$props,
|
|
23941
|
+
showTopHits: true,
|
|
23942
|
+
value: this.selectedValue
|
|
23943
|
+
}).aggs
|
|
23944
|
+
};
|
|
23945
|
+
}
|
|
23946
|
+
return {};
|
|
23947
|
+
},
|
|
23948
|
+
getData: function getData() {
|
|
23949
|
+
var hits = this.hits,
|
|
23950
|
+
aggregations = this.aggregations,
|
|
23951
|
+
aggregationData = this.aggregationData,
|
|
23952
|
+
promotedResults = this.promotedResults,
|
|
23953
|
+
rawData = this.rawData;
|
|
23954
|
+
var filteredResults = parseHits$1(hits);
|
|
23955
|
+
if (promotedResults.length) {
|
|
23956
|
+
var ids = promotedResults.map(function (item) {
|
|
23957
|
+
return item._id;
|
|
23958
|
+
}).filter(Boolean);
|
|
23959
|
+
if (ids) {
|
|
23960
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
23961
|
+
return !ids.includes(item._id);
|
|
23962
|
+
});
|
|
24147
23963
|
}
|
|
23964
|
+
filteredResults = [].concat(promotedResults, filteredResults);
|
|
24148
23965
|
}
|
|
24149
|
-
|
|
24150
|
-
|
|
24151
|
-
|
|
24152
|
-
|
|
24153
|
-
|
|
24154
|
-
|
|
24155
|
-
|
|
23966
|
+
return {
|
|
23967
|
+
data: filteredResults,
|
|
23968
|
+
aggregationData: aggregationData,
|
|
23969
|
+
rawData: rawData,
|
|
23970
|
+
aggregations: aggregations,
|
|
23971
|
+
promotedData: promotedResults,
|
|
23972
|
+
resultStats: this.stats
|
|
23973
|
+
};
|
|
23974
|
+
}
|
|
23975
|
+
},
|
|
23976
|
+
computed: {
|
|
23977
|
+
stats: function stats() {
|
|
23978
|
+
return getResultStats$3(this);
|
|
23979
|
+
}
|
|
24156
23980
|
}
|
|
24157
|
-
return [];
|
|
24158
23981
|
};
|
|
24159
|
-
|
|
24160
|
-
return
|
|
23982
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
23983
|
+
return !!props.defaultQuery;
|
|
24161
23984
|
};
|
|
24162
23985
|
var mapStateToProps$a = function mapStateToProps(state, props) {
|
|
24163
|
-
var componentId = state.aggregations[props.componentId];
|
|
24164
|
-
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
24165
|
-
var options = componentId && componentId[props.dataField];
|
|
24166
|
-
var range = state.aggregations[props.componentId + "__range__internal"];
|
|
24167
|
-
if (props.nestedField) {
|
|
24168
|
-
options = options && componentId[props.dataField][props.nestedField] && componentId[props.dataField][props.nestedField].buckets ? componentId[props.dataField][props.nestedField].buckets : [];
|
|
24169
|
-
range = range && internalRange[props.nestedField].min ? {
|
|
24170
|
-
start: internalRange[props.nestedField].min.value,
|
|
24171
|
-
end: internalRange[props.nestedField].max.value
|
|
24172
|
-
} : null;
|
|
24173
|
-
} else {
|
|
24174
|
-
options = options && componentId[props.dataField].buckets ? componentId[props.dataField].buckets : [];
|
|
24175
|
-
range = range && internalRange.min ? {
|
|
24176
|
-
start: internalRange.min.value,
|
|
24177
|
-
end: internalRange.max.value
|
|
24178
|
-
} : null;
|
|
24179
|
-
}
|
|
24180
23986
|
return {
|
|
24181
|
-
|
|
24182
|
-
|
|
24183
|
-
|
|
23987
|
+
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
23988
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
23989
|
+
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
23990
|
+
rawData: state.rawData[props.componentId],
|
|
23991
|
+
error: state.error[props.componentId],
|
|
23992
|
+
isLoading: state.isLoading[props.componentId],
|
|
23993
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
23994
|
+
promotedResults: state.promotedResults[props.componentId] || [],
|
|
23995
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
23996
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
23997
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
24184
23998
|
componentProps: state.props[props.componentId],
|
|
24185
23999
|
enableAppbase: state.config.enableAppbase
|
|
24186
24000
|
};
|
|
24187
24001
|
};
|
|
24188
24002
|
var mapDispatchtoProps$7 = {
|
|
24189
|
-
addComponent: addComponent$1,
|
|
24190
|
-
removeComponent: removeComponent$1,
|
|
24191
|
-
updateQuery: updateQuery$8,
|
|
24192
|
-
watchComponent: watchComponent$1,
|
|
24193
|
-
setQueryListener: setQueryListener$1,
|
|
24194
24003
|
setQueryOptions: setQueryOptions$7,
|
|
24195
|
-
|
|
24004
|
+
updateQuery: updateQuery$8,
|
|
24196
24005
|
setCustomQuery: setCustomQuery$7,
|
|
24197
|
-
|
|
24006
|
+
setDefaultQuery: setDefaultQuery$7
|
|
24198
24007
|
};
|
|
24199
|
-
var
|
|
24200
|
-
|
|
24201
|
-
|
|
24202
|
-
|
|
24203
|
-
|
|
24204
|
-
|
|
24008
|
+
var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$7)(ReactiveComponent), {
|
|
24009
|
+
componentType: constants_1$1.reactiveComponent
|
|
24010
|
+
});
|
|
24011
|
+
var RcConnected = PreferencesConsumer({
|
|
24012
|
+
name: 'RcConnected',
|
|
24013
|
+
render: function render(h) {
|
|
24014
|
+
return h(ConnectedComponent, {
|
|
24015
|
+
attrs: this.$attrs,
|
|
24016
|
+
on: this.$listeners,
|
|
24017
|
+
scopedSlots: this.$scopedSlots,
|
|
24018
|
+
slots: this.$slots
|
|
24019
|
+
});
|
|
24020
|
+
}
|
|
24021
|
+
});
|
|
24022
|
+
RcConnected.name = ReactiveComponent.name;
|
|
24023
|
+
RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
|
|
24205
24024
|
// Add componentType for SSR
|
|
24206
|
-
|
|
24207
|
-
|
|
24208
|
-
Vue.component(
|
|
24025
|
+
RcConnected.componentType = constants_1$1.reactiveComponent;
|
|
24026
|
+
RcConnected.install = function (Vue) {
|
|
24027
|
+
Vue.component(RcConnected.name, RcConnected);
|
|
24209
24028
|
};
|
|
24210
24029
|
|
|
24211
|
-
|
|
24212
|
-
|
|
24213
|
-
|
|
24214
|
-
|
|
24215
|
-
|
|
24216
|
-
|
|
24217
|
-
|
|
24218
|
-
|
|
24219
|
-
|
|
24220
|
-
|
|
24221
|
-
|
|
24222
|
-
|
|
24223
|
-
|
|
24224
|
-
|
|
24225
|
-
|
|
24030
|
+
/*!
|
|
24031
|
+
* vue-no-ssr v1.1.1
|
|
24032
|
+
* (c) 2018-present egoist <0x142857@gmail.com>
|
|
24033
|
+
* Released under the MIT License.
|
|
24034
|
+
*/
|
|
24035
|
+
|
|
24036
|
+
var index$3 = {
|
|
24037
|
+
name: 'NoSsr',
|
|
24038
|
+
functional: true,
|
|
24039
|
+
props: {
|
|
24040
|
+
placeholder: String,
|
|
24041
|
+
placeholderTag: {
|
|
24042
|
+
type: String,
|
|
24043
|
+
"default": 'div'
|
|
24044
|
+
}
|
|
24226
24045
|
},
|
|
24046
|
+
render: function render(h, ref) {
|
|
24047
|
+
var parent = ref.parent;
|
|
24048
|
+
var slots = ref.slots;
|
|
24049
|
+
var props = ref.props;
|
|
24050
|
+
var ref$1 = slots();
|
|
24051
|
+
var defaultSlot = ref$1["default"];
|
|
24052
|
+
if (defaultSlot === void 0) defaultSlot = [];
|
|
24053
|
+
var placeholderSlot = ref$1.placeholder;
|
|
24054
|
+
if (parent._isMounted) {
|
|
24055
|
+
return defaultSlot;
|
|
24056
|
+
}
|
|
24057
|
+
parent.$once('hook:mounted', function () {
|
|
24058
|
+
parent.$forceUpdate();
|
|
24059
|
+
});
|
|
24060
|
+
if (props.placeholderTag && (props.placeholder || placeholderSlot)) {
|
|
24061
|
+
return h(props.placeholderTag, {
|
|
24062
|
+
"class": ['no-ssr-placeholder']
|
|
24063
|
+
}, props.placeholder || placeholderSlot);
|
|
24064
|
+
}
|
|
24065
|
+
|
|
24066
|
+
// Return a placeholder element for each child in the default slot
|
|
24067
|
+
// Or if no children return a single placeholder
|
|
24068
|
+
return defaultSlot.length > 0 ? defaultSlot.map(function () {
|
|
24069
|
+
return h(false);
|
|
24070
|
+
}) : h(false);
|
|
24071
|
+
}
|
|
24072
|
+
};
|
|
24073
|
+
var vueNoSsr_common = index$3;
|
|
24074
|
+
|
|
24075
|
+
var _templateObject$o;
|
|
24076
|
+
var Slider = index$1('div')(_templateObject$o || (_templateObject$o = _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"])));
|
|
24077
|
+
|
|
24078
|
+
/**
|
|
24079
|
+
* Caution: Please do not change this file without having a discussion with the Team.
|
|
24080
|
+
* Any change may break the umd build, we're directly replacing the line no: 14
|
|
24081
|
+
* `
|
|
24082
|
+
var s = document.createElement("script");
|
|
24083
|
+
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
|
|
24084
|
+
s.onload = function(){
|
|
24085
|
+
var VueSlider = global['vue-slider-component'];
|
|
24086
|
+
components['vue-slider-component'] = VueSlider;
|
|
24087
|
+
}
|
|
24088
|
+
document.head.appendChild(s);
|
|
24089
|
+
` in rollup umd build process with some script.
|
|
24090
|
+
*/
|
|
24091
|
+
// eslint-disable-next-line
|
|
24092
|
+
var getComponents = function getComponents() {
|
|
24093
|
+
var components = {
|
|
24094
|
+
NoSSR: vueNoSsr_common
|
|
24095
|
+
};
|
|
24096
|
+
{
|
|
24097
|
+
try {
|
|
24098
|
+
// in older versions of nuxt, it's process.BROWSER_BUILD
|
|
24099
|
+
// eslint-disable-next-line
|
|
24100
|
+
|
|
24101
|
+
var s = document.createElement("script");
|
|
24102
|
+
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
|
|
24103
|
+
s.onload = function(){
|
|
24104
|
+
var VueSlider = global$1['vue-slider-component'];
|
|
24105
|
+
components['vue-slider-component'] = VueSlider;
|
|
24106
|
+
};
|
|
24107
|
+
document.head.appendChild(s);
|
|
24108
|
+
|
|
24109
|
+
} catch (e) {
|
|
24110
|
+
console.error('Unable to load vue-slider', e);
|
|
24111
|
+
}
|
|
24112
|
+
}
|
|
24113
|
+
return components;
|
|
24114
|
+
};
|
|
24115
|
+
|
|
24116
|
+
var addComponent$1 = lib_5.addComponent,
|
|
24117
|
+
removeComponent$1 = lib_5.removeComponent,
|
|
24118
|
+
watchComponent$1 = lib_5.watchComponent,
|
|
24119
|
+
updateQuery$9 = lib_5.updateQuery,
|
|
24120
|
+
setQueryListener$1 = lib_5.setQueryListener,
|
|
24121
|
+
setQueryOptions$8 = lib_5.setQueryOptions,
|
|
24122
|
+
setComponentProps$1 = lib_5.setComponentProps,
|
|
24123
|
+
setCustomQuery$8 = lib_5.setCustomQuery,
|
|
24124
|
+
updateComponentProps$2 = lib_5.updateComponentProps;
|
|
24125
|
+
var checkValueChange$7 = lib_8.checkValueChange,
|
|
24126
|
+
getClassName$b = lib_8.getClassName,
|
|
24127
|
+
isEqual$c = lib_8.isEqual,
|
|
24128
|
+
checkSomePropChange$1 = lib_8.checkSomePropChange,
|
|
24129
|
+
extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
|
|
24130
|
+
getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
|
|
24131
|
+
var DynamicRangeSlider = {
|
|
24132
|
+
name: 'DynamicRangeSlider',
|
|
24133
|
+
components: getComponents(),
|
|
24227
24134
|
props: {
|
|
24228
24135
|
beforeValueChange: types.func,
|
|
24229
24136
|
className: VueTypes.string.def(''),
|
|
24137
|
+
rangeLabels: types.func,
|
|
24230
24138
|
componentId: types.stringRequired,
|
|
24231
24139
|
customQuery: types.func,
|
|
24232
24140
|
data: types.data,
|
|
24233
24141
|
dataField: types.stringRequired,
|
|
24234
|
-
defaultValue: types.
|
|
24235
|
-
value: types.value,
|
|
24142
|
+
defaultValue: types.func,
|
|
24236
24143
|
filterLabel: types.string,
|
|
24237
24144
|
innerClass: types.style,
|
|
24238
24145
|
react: types.react,
|
|
24239
24146
|
showFilter: VueTypes.bool.def(true),
|
|
24240
|
-
|
|
24147
|
+
destroyOnUnmount: VueTypes.bool,
|
|
24148
|
+
showCheckbox: VueTypes.bool.def(true),
|
|
24241
24149
|
title: types.title,
|
|
24242
24150
|
URLParams: VueTypes.bool.def(false),
|
|
24151
|
+
sliderOptions: VueTypes.object.def({}),
|
|
24243
24152
|
nestedField: types.string,
|
|
24244
24153
|
index: VueTypes.string,
|
|
24154
|
+
value: types.range,
|
|
24245
24155
|
endpoint: types.endpointConfig
|
|
24246
24156
|
},
|
|
24157
|
+
data: function data() {
|
|
24158
|
+
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
24159
|
+
return {
|
|
24160
|
+
currentValue: null,
|
|
24161
|
+
stats: []
|
|
24162
|
+
};
|
|
24163
|
+
},
|
|
24247
24164
|
created: function created() {
|
|
24165
|
+
var _this = this;
|
|
24166
|
+
this.$timestamp = new Date().getTime();
|
|
24167
|
+
var onQueryChange = function onQueryChange() {
|
|
24168
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24169
|
+
args[_key] = arguments[_key];
|
|
24170
|
+
}
|
|
24171
|
+
_this.$emit.apply(_this, ['queryChange'].concat(args));
|
|
24172
|
+
_this.$emit.apply(_this, ['query-change'].concat(args));
|
|
24173
|
+
};
|
|
24174
|
+
this.setQueryListener(this.$props.componentId, onQueryChange, null);
|
|
24175
|
+
// Update props in store
|
|
24176
|
+
this.setComponentProps(this.componentId, this.$props, constants_1$1.dynamicRangeSlider);
|
|
24177
|
+
this.setComponentProps(this.internalRangeComponent, this.$props, constants_1$1.dynamicRangeSlider);
|
|
24248
24178
|
if (!this.enableAppbase && this.$props.index) {
|
|
24249
24179
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
24250
24180
|
}
|
|
24251
24181
|
// Set custom query in store
|
|
24252
24182
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
24253
24183
|
},
|
|
24184
|
+
mounted: function mounted() {
|
|
24185
|
+
this.setReact();
|
|
24186
|
+
},
|
|
24254
24187
|
beforeMount: function beforeMount() {
|
|
24255
|
-
|
|
24256
|
-
|
|
24257
|
-
|
|
24258
|
-
|
|
24259
|
-
}
|
|
24260
|
-
|
|
24188
|
+
var components = [];
|
|
24189
|
+
if (this.$$store) {
|
|
24190
|
+
var _this$$$store$getStat = this.$$store.getState();
|
|
24191
|
+
components = _this$$$store$getStat.components;
|
|
24192
|
+
}
|
|
24193
|
+
var value = this.$props.value;
|
|
24194
|
+
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
24195
|
+
this.addComponent(this.componentId, this.$timestamp);
|
|
24196
|
+
this.addComponent(this.internalRangeComponent, this.$timestamp);
|
|
24197
|
+
if (Array.isArray(this.selectedValue)) {
|
|
24198
|
+
this.handleChange(this.selectedValue);
|
|
24199
|
+
} else if (this.selectedValue) {
|
|
24200
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
24201
|
+
} else if (value) {
|
|
24202
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
24203
|
+
}
|
|
24204
|
+
|
|
24205
|
+
// get range before executing other queries
|
|
24206
|
+
this.updateRangeQueryOptions();
|
|
24261
24207
|
}
|
|
24262
24208
|
},
|
|
24263
|
-
|
|
24264
|
-
|
|
24265
|
-
this.
|
|
24266
|
-
}
|
|
24267
|
-
|
|
24268
|
-
|
|
24269
|
-
|
|
24270
|
-
|
|
24271
|
-
|
|
24272
|
-
|
|
24209
|
+
beforeUpdate: function beforeUpdate() {
|
|
24210
|
+
if (!this.currentValue) {
|
|
24211
|
+
this.setDefaultValue(this.range);
|
|
24212
|
+
}
|
|
24213
|
+
},
|
|
24214
|
+
beforeDestroy: function beforeDestroy() {
|
|
24215
|
+
if (this.destroyOnUnmount) {
|
|
24216
|
+
this.removeComponent(this.$props.componentId);
|
|
24217
|
+
this.removeComponent(this.internalRangeComponent);
|
|
24218
|
+
}
|
|
24219
|
+
},
|
|
24220
|
+
methods: {
|
|
24221
|
+
isControlled: function isControlled() {
|
|
24222
|
+
if (this.$props.value && this.$listeners) {
|
|
24223
|
+
return true;
|
|
24273
24224
|
}
|
|
24225
|
+
return false;
|
|
24274
24226
|
},
|
|
24275
|
-
|
|
24276
|
-
|
|
24277
|
-
|
|
24227
|
+
setDefaultValue: function setDefaultValue(_ref) {
|
|
24228
|
+
var start = _ref.start,
|
|
24229
|
+
end = _ref.end;
|
|
24230
|
+
if (this.$props.defaultValue) {
|
|
24231
|
+
var _this$$props$defaultV = this.$props.defaultValue(start, end),
|
|
24232
|
+
defaultStart = _this$$props$defaultV.start,
|
|
24233
|
+
defaultEnd = _this$$props$defaultV.end;
|
|
24234
|
+
this.handleChange([defaultStart, defaultEnd]);
|
|
24235
|
+
} else if (this.isControlled()) {
|
|
24236
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
24237
|
+
} else {
|
|
24238
|
+
this.currentValue = [start, end];
|
|
24278
24239
|
}
|
|
24279
24240
|
},
|
|
24280
|
-
|
|
24281
|
-
if (
|
|
24282
|
-
this.
|
|
24241
|
+
setReact: function setReact() {
|
|
24242
|
+
if (this.$props.react) {
|
|
24243
|
+
this.watchComponent(this.internalRangeComponent, this.$props.react);
|
|
24244
|
+
this.watchComponent(this.$props.componentId, this.$props.react);
|
|
24245
|
+
} else {
|
|
24246
|
+
this.watchComponent(this.internalRangeComponent, {});
|
|
24247
|
+
this.watchComponent(this.$props.componentId, {});
|
|
24283
24248
|
}
|
|
24284
|
-
}
|
|
24285
|
-
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
}, [this.$props.title && h(Title, {
|
|
24292
|
-
"class": getClassName$c(this.$props.innerClass, 'title')
|
|
24293
|
-
}, [this.$props.title]), h(UL, {
|
|
24294
|
-
"class": getClassName$c(this.$props.innerClass, 'list')
|
|
24295
|
-
}, [this.$props.data.map(function (item) {
|
|
24296
|
-
var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
|
|
24297
|
-
return h("li", {
|
|
24298
|
-
"key": item.label,
|
|
24299
|
-
"class": "" + (selected ? 'active' : '')
|
|
24300
|
-
}, [h(Radio, {
|
|
24301
|
-
"class": getClassName$c(_this.$props.innerClass, 'radio'),
|
|
24302
|
-
"attrs": {
|
|
24303
|
-
"id": _this.$props.componentId + "-" + item.label,
|
|
24304
|
-
"name": _this.$props.componentId,
|
|
24305
|
-
"value": item.label,
|
|
24306
|
-
"type": "radio",
|
|
24307
|
-
"checked": selected,
|
|
24308
|
-
"show": _this.$props.showRadio
|
|
24249
|
+
},
|
|
24250
|
+
rangeQuery: function rangeQuery() {
|
|
24251
|
+
return {
|
|
24252
|
+
min: {
|
|
24253
|
+
min: {
|
|
24254
|
+
field: this.$props.dataField
|
|
24255
|
+
}
|
|
24309
24256
|
},
|
|
24310
|
-
|
|
24311
|
-
|
|
24312
|
-
|
|
24313
|
-
|
|
24314
|
-
"class": getClassName$c(_this.$props.innerClass, 'label'),
|
|
24315
|
-
"attrs": {
|
|
24316
|
-
"for": _this.$props.componentId + "-" + item.label
|
|
24257
|
+
max: {
|
|
24258
|
+
max: {
|
|
24259
|
+
field: this.$props.dataField
|
|
24260
|
+
}
|
|
24317
24261
|
}
|
|
24318
|
-
}, [item.label])]);
|
|
24319
|
-
})])]);
|
|
24320
|
-
},
|
|
24321
|
-
methods: {
|
|
24322
|
-
setValue: function setValue(value, props) {
|
|
24323
|
-
var _this2 = this;
|
|
24324
|
-
if (props === void 0) {
|
|
24325
|
-
props = this.$props;
|
|
24326
|
-
}
|
|
24327
|
-
var currentValue = typeof value === 'string' ? SingleRange.parseValue(value, props) : value;
|
|
24328
|
-
var performUpdate = function performUpdate() {
|
|
24329
|
-
_this2.currentValue = currentValue;
|
|
24330
|
-
_this2.updateQueryHandler(currentValue, props);
|
|
24331
|
-
_this2.$emit('valueChange', currentValue);
|
|
24332
|
-
_this2.$emit('value-change', currentValue);
|
|
24333
24262
|
};
|
|
24334
|
-
checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
24335
24263
|
},
|
|
24336
|
-
|
|
24337
|
-
var
|
|
24338
|
-
|
|
24339
|
-
|
|
24340
|
-
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24264
|
+
updateRangeQueryOptions: function updateRangeQueryOptions() {
|
|
24265
|
+
var aggs = {};
|
|
24266
|
+
if (this.$props.nestedField) {
|
|
24267
|
+
var _aggs;
|
|
24268
|
+
aggs = (_aggs = {}, _aggs[this.$props.nestedField] = {
|
|
24269
|
+
nested: {
|
|
24270
|
+
path: this.$props.nestedField
|
|
24271
|
+
},
|
|
24272
|
+
aggs: this.rangeQuery()
|
|
24273
|
+
}, _aggs);
|
|
24274
|
+
} else {
|
|
24275
|
+
aggs = this.rangeQuery();
|
|
24345
24276
|
}
|
|
24346
|
-
this.
|
|
24347
|
-
|
|
24348
|
-
query: query,
|
|
24349
|
-
value: value,
|
|
24350
|
-
label: props.filterLabel,
|
|
24351
|
-
showFilter: props.showFilter,
|
|
24352
|
-
URLParams: props.URLParams,
|
|
24353
|
-
componentType: constants_1$1.singleRange
|
|
24277
|
+
this.setQueryOptions(this.internalRangeComponent, {
|
|
24278
|
+
aggs: aggs
|
|
24354
24279
|
});
|
|
24355
24280
|
},
|
|
24356
|
-
|
|
24281
|
+
handleSlider: function handleSlider() {
|
|
24282
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
24357
24283
|
var value = this.$props.value;
|
|
24358
24284
|
if (value === undefined) {
|
|
24359
|
-
this.
|
|
24285
|
+
this.handleChange(sliderValues);
|
|
24360
24286
|
} else {
|
|
24361
|
-
this.$emit('change',
|
|
24287
|
+
this.$emit('change', {
|
|
24288
|
+
start: sliderValues[0],
|
|
24289
|
+
end: sliderValues[1]
|
|
24290
|
+
});
|
|
24291
|
+
}
|
|
24292
|
+
},
|
|
24293
|
+
handleChange: function handleChange(currentValue) {
|
|
24294
|
+
var _this2 = this;
|
|
24295
|
+
// Always keep the values within range
|
|
24296
|
+
var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
|
|
24297
|
+
var performUpdate = function performUpdate() {
|
|
24298
|
+
_this2.currentValue = normalizedValue;
|
|
24299
|
+
_this2.updateQueryHandler(normalizedValue, _this2.$props);
|
|
24300
|
+
_this2.$emit('valueChange', {
|
|
24301
|
+
start: normalizedValue[0],
|
|
24302
|
+
end: normalizedValue[1]
|
|
24303
|
+
});
|
|
24304
|
+
_this2.$emit('value-change', {
|
|
24305
|
+
start: normalizedValue[0],
|
|
24306
|
+
end: normalizedValue[1]
|
|
24307
|
+
});
|
|
24308
|
+
};
|
|
24309
|
+
checkValueChange$7(this.$props.componentId, {
|
|
24310
|
+
start: normalizedValue[0],
|
|
24311
|
+
end: normalizedValue[1]
|
|
24312
|
+
}, this.$props.beforeValueChange, performUpdate);
|
|
24313
|
+
},
|
|
24314
|
+
updateQueryHandler: function updateQueryHandler(value) {
|
|
24315
|
+
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
24316
|
+
if (this.$props.customQuery) {
|
|
24317
|
+
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
24318
|
+
var queryTobeSet = extractQueryFromCustomQuery$7(customQueryTobeSet);
|
|
24319
|
+
if (queryTobeSet) {
|
|
24320
|
+
query = queryTobeSet;
|
|
24321
|
+
}
|
|
24322
|
+
var customQueryOptions = getOptionsForCustomQuery$7(customQueryTobeSet);
|
|
24323
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
24324
|
+
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
24362
24325
|
}
|
|
24326
|
+
var _ref2 = this.range || {
|
|
24327
|
+
start: value[0],
|
|
24328
|
+
end: value[1]
|
|
24329
|
+
},
|
|
24330
|
+
start = _ref2.start,
|
|
24331
|
+
end = _ref2.end;
|
|
24332
|
+
var currentStart = value[0],
|
|
24333
|
+
currentEnd = value[1];
|
|
24334
|
+
// check if the slider is at its initial position
|
|
24335
|
+
var isInitialValue = currentStart === start && currentEnd === end;
|
|
24336
|
+
this.updateQuery({
|
|
24337
|
+
componentId: this.$props.componentId,
|
|
24338
|
+
query: query,
|
|
24339
|
+
value: value,
|
|
24340
|
+
label: this.$props.filterLabel,
|
|
24341
|
+
showFilter: this.$props.showFilter && !isInitialValue,
|
|
24342
|
+
URLParams: this.$props.URLParams,
|
|
24343
|
+
componentType: constants_1$1.dynamicRangeSlider
|
|
24344
|
+
});
|
|
24363
24345
|
}
|
|
24364
|
-
}
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
|
|
24369
|
-
|
|
24346
|
+
},
|
|
24347
|
+
computed: {
|
|
24348
|
+
labels: function labels() {
|
|
24349
|
+
if (!this.rangeLabels) return null;
|
|
24350
|
+
return this.rangeLabels(this.range.start, this.range.end);
|
|
24351
|
+
}
|
|
24352
|
+
},
|
|
24353
|
+
watch: {
|
|
24354
|
+
$props: {
|
|
24355
|
+
deep: true,
|
|
24356
|
+
handler: function handler(newVal) {
|
|
24357
|
+
var _this3 = this;
|
|
24358
|
+
var propsKeys = getValidPropsKeys(newVal);
|
|
24359
|
+
checkSomePropChange$1(newVal, this.componentProps, propsKeys, function () {
|
|
24360
|
+
_this3.updateComponentProps(_this3.componentId, newVal, constants_1$1.dynamicRangeSlider);
|
|
24361
|
+
_this3.updateComponentProps(_this3.internalRangeComponent, newVal, constants_1$1.dynamicRangeSlider);
|
|
24362
|
+
});
|
|
24363
|
+
}
|
|
24364
|
+
},
|
|
24365
|
+
react: function react() {
|
|
24366
|
+
this.setReact();
|
|
24367
|
+
},
|
|
24368
|
+
selectedValue: function selectedValue(newValue) {
|
|
24369
|
+
if (isEqual$c(newValue, this.currentValue)) return;
|
|
24370
|
+
var value = newValue || {
|
|
24371
|
+
start: this.range.start,
|
|
24372
|
+
end: this.range.end
|
|
24373
|
+
};
|
|
24374
|
+
this.$emit('change', value);
|
|
24375
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
24376
|
+
},
|
|
24377
|
+
range: function range(newValue, oldValue) {
|
|
24378
|
+
if (isEqual$c(newValue, oldValue) || !this.currentValue) return;
|
|
24379
|
+
var _ref3 = this.currentValue || [],
|
|
24380
|
+
currentStart = _ref3[0],
|
|
24381
|
+
currentEnd = _ref3[1];
|
|
24382
|
+
var _ref4 = oldValue || {},
|
|
24383
|
+
oldStart = _ref4.start,
|
|
24384
|
+
oldEnd = _ref4.end;
|
|
24385
|
+
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
24386
|
+
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
24387
|
+
this.handleChange([newStart, newEnd]);
|
|
24388
|
+
},
|
|
24389
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
24390
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
24391
|
+
this.updateQueryHandler(this.$data.currentValue);
|
|
24392
|
+
}
|
|
24393
|
+
},
|
|
24394
|
+
value: function value(newVal, oldVal) {
|
|
24395
|
+
if (!isEqual$c(newVal, oldVal)) {
|
|
24396
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
24397
|
+
}
|
|
24398
|
+
}
|
|
24399
|
+
},
|
|
24400
|
+
render: function render() {
|
|
24401
|
+
var h = arguments[0];
|
|
24402
|
+
if (!this.range || !this.currentValue) {
|
|
24403
|
+
return null;
|
|
24404
|
+
}
|
|
24405
|
+
var _this$range = this.range,
|
|
24406
|
+
start = _this$range.start,
|
|
24407
|
+
end = _this$range.end;
|
|
24408
|
+
return h(Container, {
|
|
24409
|
+
"class": this.$props.className
|
|
24410
|
+
}, [this.$props.title && h(Title, {
|
|
24411
|
+
"class": getClassName$b(this.$props.innerClass, 'title')
|
|
24412
|
+
}, [this.$props.title]), h(vueNoSsr_common, [h(Slider, {
|
|
24413
|
+
"class": getClassName$b(this.$props.innerClass, 'slider')
|
|
24414
|
+
}, [h("vue-slider-component", {
|
|
24415
|
+
"ref": "slider",
|
|
24416
|
+
"attrs": {
|
|
24417
|
+
"value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
|
|
24418
|
+
"min": Math.floor(Math.min(start, this.currentValue[0])),
|
|
24419
|
+
"max": Math.ceil(Math.max(end, this.currentValue[1])),
|
|
24420
|
+
"dotSize": 20,
|
|
24421
|
+
"height": 4,
|
|
24422
|
+
"enable-cross": false,
|
|
24423
|
+
"tooltip": "always"
|
|
24424
|
+
},
|
|
24425
|
+
"on": {
|
|
24426
|
+
"drag-end": this.handleSlider
|
|
24427
|
+
},
|
|
24428
|
+
"props": _extends({}, this.$props.sliderOptions)
|
|
24429
|
+
}), this.labels ? h("div", {
|
|
24430
|
+
"class": "label-container"
|
|
24431
|
+
}, [h("label", {
|
|
24432
|
+
"class": getClassName$b(this.$props.innerClass, 'label') || 'range-label-left'
|
|
24433
|
+
}, [this.labels.start]), h("label", {
|
|
24434
|
+
"class": getClassName$b(this.$props.innerClass, 'label') || 'range-label-right'
|
|
24435
|
+
}, [this.labels.end])]) : null])])]);
|
|
24436
|
+
}
|
|
24370
24437
|
};
|
|
24371
|
-
|
|
24438
|
+
DynamicRangeSlider.defaultQuery = function (values, props) {
|
|
24372
24439
|
var query = null;
|
|
24373
|
-
if (
|
|
24440
|
+
if (Array.isArray(values) && values.length) {
|
|
24374
24441
|
var _range;
|
|
24375
24442
|
query = {
|
|
24376
24443
|
range: (_range = {}, _range[props.dataField] = {
|
|
24377
|
-
gte:
|
|
24378
|
-
lte:
|
|
24444
|
+
gte: values[0],
|
|
24445
|
+
lte: values[1],
|
|
24379
24446
|
boost: 2.0
|
|
24380
24447
|
}, _range)
|
|
24381
24448
|
};
|
|
@@ -24392,48 +24459,79 @@
|
|
|
24392
24459
|
}
|
|
24393
24460
|
return query;
|
|
24394
24461
|
};
|
|
24462
|
+
DynamicRangeSlider.parseValue = function (value) {
|
|
24463
|
+
if (value) {
|
|
24464
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
24465
|
+
}
|
|
24466
|
+
return [];
|
|
24467
|
+
};
|
|
24468
|
+
DynamicRangeSlider.hasInternalComponent = function () {
|
|
24469
|
+
return true;
|
|
24470
|
+
};
|
|
24395
24471
|
var mapStateToProps$b = function mapStateToProps(state, props) {
|
|
24472
|
+
var componentId = state.aggregations[props.componentId];
|
|
24473
|
+
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
24474
|
+
var options = componentId && componentId[props.dataField];
|
|
24475
|
+
var range = state.aggregations[props.componentId + "__range__internal"];
|
|
24476
|
+
if (props.nestedField) {
|
|
24477
|
+
options = options && componentId[props.dataField][props.nestedField] && componentId[props.dataField][props.nestedField].buckets ? componentId[props.dataField][props.nestedField].buckets : [];
|
|
24478
|
+
range = range && internalRange[props.nestedField].min ? {
|
|
24479
|
+
start: internalRange[props.nestedField].min.value,
|
|
24480
|
+
end: internalRange[props.nestedField].max.value
|
|
24481
|
+
} : null;
|
|
24482
|
+
} else {
|
|
24483
|
+
options = options && componentId[props.dataField].buckets ? componentId[props.dataField].buckets : [];
|
|
24484
|
+
range = range && internalRange.min ? {
|
|
24485
|
+
start: internalRange.min.value,
|
|
24486
|
+
end: internalRange.max.value
|
|
24487
|
+
} : null;
|
|
24488
|
+
}
|
|
24396
24489
|
return {
|
|
24397
|
-
|
|
24490
|
+
options: options,
|
|
24491
|
+
range: range,
|
|
24492
|
+
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
24398
24493
|
componentProps: state.props[props.componentId],
|
|
24399
24494
|
enableAppbase: state.config.enableAppbase
|
|
24400
24495
|
};
|
|
24401
24496
|
};
|
|
24402
24497
|
var mapDispatchtoProps$8 = {
|
|
24498
|
+
addComponent: addComponent$1,
|
|
24499
|
+
removeComponent: removeComponent$1,
|
|
24403
24500
|
updateQuery: updateQuery$9,
|
|
24501
|
+
watchComponent: watchComponent$1,
|
|
24502
|
+
setQueryListener: setQueryListener$1,
|
|
24404
24503
|
setQueryOptions: setQueryOptions$8,
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
componentType: constants_1$1.singleRange
|
|
24409
|
-
}));
|
|
24410
|
-
RangeConnected$1.name = SingleRange.name;
|
|
24411
|
-
RangeConnected$1.defaultQuery = SingleRange.defaultQuery;
|
|
24412
|
-
RangeConnected$1.parseValue = SingleRange.parseValue;
|
|
24413
|
-
RangeConnected$1.hasInternalComponent = SingleRange.hasInternalComponent;
|
|
24414
|
-
RangeConnected$1.install = function (Vue) {
|
|
24415
|
-
Vue.component(RangeConnected$1.name, RangeConnected$1);
|
|
24504
|
+
setComponentProps: setComponentProps$1,
|
|
24505
|
+
setCustomQuery: setCustomQuery$8,
|
|
24506
|
+
updateComponentProps: updateComponentProps$2
|
|
24416
24507
|
};
|
|
24508
|
+
var RangeConnected = PreferencesConsumer(connect(mapStateToProps$b, mapDispatchtoProps$8)(DynamicRangeSlider));
|
|
24509
|
+
RangeConnected.defaultQuery = DynamicRangeSlider.defaultQuery;
|
|
24510
|
+
RangeConnected.parseValue = DynamicRangeSlider.parseValue;
|
|
24511
|
+
RangeConnected.hasInternalComponent = DynamicRangeSlider.hasInternalComponent;
|
|
24512
|
+
RangeConnected.name = DynamicRangeSlider.name;
|
|
24513
|
+
|
|
24417
24514
|
// Add componentType for SSR
|
|
24418
|
-
RangeConnected
|
|
24515
|
+
RangeConnected.componentType = constants_1$1.dynamicRangeSlider;
|
|
24516
|
+
RangeConnected.install = function (Vue) {
|
|
24517
|
+
Vue.component(RangeConnected.name, RangeConnected);
|
|
24518
|
+
};
|
|
24419
24519
|
|
|
24420
24520
|
var updateQuery$a = lib_5.updateQuery,
|
|
24421
24521
|
setQueryOptions$9 = lib_5.setQueryOptions,
|
|
24422
24522
|
setCustomQuery$9 = lib_5.setCustomQuery;
|
|
24423
24523
|
var isEqual$d = lib_8.isEqual,
|
|
24424
|
-
checkValueChange$
|
|
24425
|
-
getClassName$
|
|
24426
|
-
getOptionsFromQuery$
|
|
24427
|
-
var
|
|
24428
|
-
name: '
|
|
24524
|
+
checkValueChange$8 = lib_8.checkValueChange,
|
|
24525
|
+
getClassName$c = lib_8.getClassName,
|
|
24526
|
+
getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
|
|
24527
|
+
var SingleRange = {
|
|
24528
|
+
name: 'SingleRange',
|
|
24429
24529
|
data: function data() {
|
|
24430
|
-
this.
|
|
24431
|
-
currentValue:
|
|
24432
|
-
showModal: false,
|
|
24433
|
-
selectedValues: {}
|
|
24530
|
+
this.__state = {
|
|
24531
|
+
currentValue: null
|
|
24434
24532
|
};
|
|
24435
24533
|
this.type = 'range';
|
|
24436
|
-
return this.
|
|
24534
|
+
return this.__state;
|
|
24437
24535
|
},
|
|
24438
24536
|
props: {
|
|
24439
24537
|
beforeValueChange: types.func,
|
|
@@ -24442,65 +24540,276 @@
|
|
|
24442
24540
|
customQuery: types.func,
|
|
24443
24541
|
data: types.data,
|
|
24444
24542
|
dataField: types.stringRequired,
|
|
24445
|
-
defaultValue: types.
|
|
24446
|
-
value: types.
|
|
24543
|
+
defaultValue: types.string,
|
|
24544
|
+
value: types.value,
|
|
24447
24545
|
filterLabel: types.string,
|
|
24448
24546
|
innerClass: types.style,
|
|
24449
24547
|
react: types.react,
|
|
24450
24548
|
showFilter: VueTypes.bool.def(true),
|
|
24451
|
-
|
|
24549
|
+
showRadio: VueTypes.bool.def(true),
|
|
24452
24550
|
title: types.title,
|
|
24453
24551
|
URLParams: VueTypes.bool.def(false),
|
|
24454
24552
|
nestedField: types.string,
|
|
24455
24553
|
index: VueTypes.string,
|
|
24456
24554
|
endpoint: types.endpointConfig
|
|
24457
24555
|
},
|
|
24458
|
-
|
|
24459
|
-
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24464
|
-
|
|
24465
|
-
|
|
24466
|
-
|
|
24556
|
+
created: function created() {
|
|
24557
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
24558
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
24559
|
+
}
|
|
24560
|
+
// Set custom query in store
|
|
24561
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
24562
|
+
},
|
|
24563
|
+
beforeMount: function beforeMount() {
|
|
24564
|
+
if (this.selectedValue) {
|
|
24565
|
+
this.setValue(this.selectedValue);
|
|
24566
|
+
} else if (this.$props.value) {
|
|
24567
|
+
this.setValue(this.$props.value);
|
|
24568
|
+
} else if (this.$props.defaultValue) {
|
|
24569
|
+
this.setValue(this.$props.defaultValue);
|
|
24570
|
+
}
|
|
24571
|
+
},
|
|
24572
|
+
watch: {
|
|
24573
|
+
dataField: function dataField() {
|
|
24574
|
+
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
24467
24575
|
},
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
|
|
24576
|
+
defaultValue: function defaultValue(newVal) {
|
|
24577
|
+
this.setValue(newVal);
|
|
24578
|
+
},
|
|
24579
|
+
value: function value(newVal, oldVal) {
|
|
24580
|
+
if (!isEqual$d(newVal, oldVal)) {
|
|
24581
|
+
this.setValue(newVal);
|
|
24472
24582
|
}
|
|
24473
|
-
|
|
24474
|
-
|
|
24583
|
+
},
|
|
24584
|
+
selectedValue: function selectedValue(newVal) {
|
|
24585
|
+
if (!isEqual$d(this.$data.currentValue, newVal)) {
|
|
24586
|
+
this.setValue(newVal);
|
|
24475
24587
|
}
|
|
24476
|
-
|
|
24477
|
-
|
|
24588
|
+
},
|
|
24589
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
24590
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
24591
|
+
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
24478
24592
|
}
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
}
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
|
|
24499
|
-
|
|
24500
|
-
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
|
|
24593
|
+
}
|
|
24594
|
+
},
|
|
24595
|
+
render: function render() {
|
|
24596
|
+
var _this = this;
|
|
24597
|
+
var h = arguments[0];
|
|
24598
|
+
return h(Container, {
|
|
24599
|
+
"class": this.$props.className
|
|
24600
|
+
}, [this.$props.title && h(Title, {
|
|
24601
|
+
"class": getClassName$c(this.$props.innerClass, 'title')
|
|
24602
|
+
}, [this.$props.title]), h(UL, {
|
|
24603
|
+
"class": getClassName$c(this.$props.innerClass, 'list')
|
|
24604
|
+
}, [this.$props.data.map(function (item) {
|
|
24605
|
+
var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
|
|
24606
|
+
return h("li", {
|
|
24607
|
+
"key": item.label,
|
|
24608
|
+
"class": "" + (selected ? 'active' : '')
|
|
24609
|
+
}, [h(Radio, {
|
|
24610
|
+
"class": getClassName$c(_this.$props.innerClass, 'radio'),
|
|
24611
|
+
"attrs": {
|
|
24612
|
+
"id": _this.$props.componentId + "-" + item.label,
|
|
24613
|
+
"name": _this.$props.componentId,
|
|
24614
|
+
"value": item.label,
|
|
24615
|
+
"type": "radio",
|
|
24616
|
+
"checked": selected,
|
|
24617
|
+
"show": _this.$props.showRadio
|
|
24618
|
+
},
|
|
24619
|
+
"on": {
|
|
24620
|
+
"change": _this.handleChange
|
|
24621
|
+
}
|
|
24622
|
+
}), h("label", {
|
|
24623
|
+
"class": getClassName$c(_this.$props.innerClass, 'label'),
|
|
24624
|
+
"attrs": {
|
|
24625
|
+
"for": _this.$props.componentId + "-" + item.label
|
|
24626
|
+
}
|
|
24627
|
+
}, [item.label])]);
|
|
24628
|
+
})])]);
|
|
24629
|
+
},
|
|
24630
|
+
methods: {
|
|
24631
|
+
setValue: function setValue(value, props) {
|
|
24632
|
+
var _this2 = this;
|
|
24633
|
+
if (props === void 0) {
|
|
24634
|
+
props = this.$props;
|
|
24635
|
+
}
|
|
24636
|
+
var currentValue = typeof value === 'string' ? SingleRange.parseValue(value, props) : value;
|
|
24637
|
+
var performUpdate = function performUpdate() {
|
|
24638
|
+
_this2.currentValue = currentValue;
|
|
24639
|
+
_this2.updateQueryHandler(currentValue, props);
|
|
24640
|
+
_this2.$emit('valueChange', currentValue);
|
|
24641
|
+
_this2.$emit('value-change', currentValue);
|
|
24642
|
+
};
|
|
24643
|
+
checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
24644
|
+
},
|
|
24645
|
+
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
24646
|
+
var customQuery = props.customQuery;
|
|
24647
|
+
var query = SingleRange.defaultQuery(value, props);
|
|
24648
|
+
if (customQuery) {
|
|
24649
|
+
var _ref = customQuery(value, props) || {};
|
|
24650
|
+
query = _ref.query;
|
|
24651
|
+
var customQueryOptions = getOptionsFromQuery$1(customQuery(value, props));
|
|
24652
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
24653
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
24654
|
+
}
|
|
24655
|
+
this.updateQuery({
|
|
24656
|
+
componentId: props.componentId,
|
|
24657
|
+
query: query,
|
|
24658
|
+
value: value,
|
|
24659
|
+
label: props.filterLabel,
|
|
24660
|
+
showFilter: props.showFilter,
|
|
24661
|
+
URLParams: props.URLParams,
|
|
24662
|
+
componentType: constants_1$1.singleRange
|
|
24663
|
+
});
|
|
24664
|
+
},
|
|
24665
|
+
handleChange: function handleChange(e) {
|
|
24666
|
+
var value = this.$props.value;
|
|
24667
|
+
if (value === undefined) {
|
|
24668
|
+
this.setValue(e.target.value);
|
|
24669
|
+
} else {
|
|
24670
|
+
this.$emit('change', e.target.value);
|
|
24671
|
+
}
|
|
24672
|
+
}
|
|
24673
|
+
}
|
|
24674
|
+
};
|
|
24675
|
+
SingleRange.parseValue = function (value, props) {
|
|
24676
|
+
return props.data.find(function (item) {
|
|
24677
|
+
return item.label === value;
|
|
24678
|
+
}) || null;
|
|
24679
|
+
};
|
|
24680
|
+
SingleRange.defaultQuery = function (value, props) {
|
|
24681
|
+
var query = null;
|
|
24682
|
+
if (value) {
|
|
24683
|
+
var _range;
|
|
24684
|
+
query = {
|
|
24685
|
+
range: (_range = {}, _range[props.dataField] = {
|
|
24686
|
+
gte: value.start,
|
|
24687
|
+
lte: value.end,
|
|
24688
|
+
boost: 2.0
|
|
24689
|
+
}, _range)
|
|
24690
|
+
};
|
|
24691
|
+
}
|
|
24692
|
+
if (query && props.nestedField) {
|
|
24693
|
+
return {
|
|
24694
|
+
query: {
|
|
24695
|
+
nested: {
|
|
24696
|
+
path: props.nestedField,
|
|
24697
|
+
query: query
|
|
24698
|
+
}
|
|
24699
|
+
}
|
|
24700
|
+
};
|
|
24701
|
+
}
|
|
24702
|
+
return query;
|
|
24703
|
+
};
|
|
24704
|
+
var mapStateToProps$c = function mapStateToProps(state, props) {
|
|
24705
|
+
return {
|
|
24706
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24707
|
+
componentProps: state.props[props.componentId],
|
|
24708
|
+
enableAppbase: state.config.enableAppbase
|
|
24709
|
+
};
|
|
24710
|
+
};
|
|
24711
|
+
var mapDispatchtoProps$9 = {
|
|
24712
|
+
updateQuery: updateQuery$a,
|
|
24713
|
+
setQueryOptions: setQueryOptions$9,
|
|
24714
|
+
setCustomQuery: setCustomQuery$9
|
|
24715
|
+
};
|
|
24716
|
+
var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(SingleRange), {
|
|
24717
|
+
componentType: constants_1$1.singleRange
|
|
24718
|
+
}));
|
|
24719
|
+
RangeConnected$1.name = SingleRange.name;
|
|
24720
|
+
RangeConnected$1.defaultQuery = SingleRange.defaultQuery;
|
|
24721
|
+
RangeConnected$1.parseValue = SingleRange.parseValue;
|
|
24722
|
+
RangeConnected$1.hasInternalComponent = SingleRange.hasInternalComponent;
|
|
24723
|
+
RangeConnected$1.install = function (Vue) {
|
|
24724
|
+
Vue.component(RangeConnected$1.name, RangeConnected$1);
|
|
24725
|
+
};
|
|
24726
|
+
// Add componentType for SSR
|
|
24727
|
+
RangeConnected$1.componentType = constants_1$1.singleRange;
|
|
24728
|
+
|
|
24729
|
+
var updateQuery$b = lib_5.updateQuery,
|
|
24730
|
+
setQueryOptions$a = lib_5.setQueryOptions,
|
|
24731
|
+
setCustomQuery$a = lib_5.setCustomQuery;
|
|
24732
|
+
var isEqual$e = lib_8.isEqual,
|
|
24733
|
+
checkValueChange$9 = lib_8.checkValueChange,
|
|
24734
|
+
getClassName$d = lib_8.getClassName,
|
|
24735
|
+
getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
|
|
24736
|
+
var MultiRange = {
|
|
24737
|
+
name: 'MultiRange',
|
|
24738
|
+
data: function data() {
|
|
24739
|
+
this.state = {
|
|
24740
|
+
currentValue: [],
|
|
24741
|
+
showModal: false,
|
|
24742
|
+
selectedValues: {}
|
|
24743
|
+
};
|
|
24744
|
+
this.type = 'range';
|
|
24745
|
+
return this.state;
|
|
24746
|
+
},
|
|
24747
|
+
props: {
|
|
24748
|
+
beforeValueChange: types.func,
|
|
24749
|
+
className: VueTypes.string.def(''),
|
|
24750
|
+
componentId: types.stringRequired,
|
|
24751
|
+
customQuery: types.func,
|
|
24752
|
+
data: types.data,
|
|
24753
|
+
dataField: types.stringRequired,
|
|
24754
|
+
defaultValue: types.stringArray,
|
|
24755
|
+
value: types.stringArray,
|
|
24756
|
+
filterLabel: types.string,
|
|
24757
|
+
innerClass: types.style,
|
|
24758
|
+
react: types.react,
|
|
24759
|
+
showFilter: VueTypes.bool.def(true),
|
|
24760
|
+
showCheckbox: VueTypes.bool.def(true),
|
|
24761
|
+
title: types.title,
|
|
24762
|
+
URLParams: VueTypes.bool.def(false),
|
|
24763
|
+
nestedField: types.string,
|
|
24764
|
+
index: VueTypes.string,
|
|
24765
|
+
endpoint: types.endpointConfig
|
|
24766
|
+
},
|
|
24767
|
+
methods: {
|
|
24768
|
+
handleClick: function handleClick(e) {
|
|
24769
|
+
var value = this.$props.value;
|
|
24770
|
+
if (value === undefined) {
|
|
24771
|
+
this.selectItem(e.target.value);
|
|
24772
|
+
} else {
|
|
24773
|
+
var values = parseValueArray(this.selectedValues, e.target.value);
|
|
24774
|
+
this.$emit('change', values);
|
|
24775
|
+
}
|
|
24776
|
+
},
|
|
24777
|
+
selectItem: function selectItem(item, isDefaultValue, props, reset) {
|
|
24778
|
+
var _this = this;
|
|
24779
|
+
if (isDefaultValue === void 0) {
|
|
24780
|
+
isDefaultValue = false;
|
|
24781
|
+
}
|
|
24782
|
+
if (props === void 0) {
|
|
24783
|
+
props = this.$props;
|
|
24784
|
+
}
|
|
24785
|
+
if (reset === void 0) {
|
|
24786
|
+
reset = false;
|
|
24787
|
+
}
|
|
24788
|
+
var currentValue = this.currentValue,
|
|
24789
|
+
selectedValues = this.selectedValues;
|
|
24790
|
+
if (!item) {
|
|
24791
|
+
currentValue = [];
|
|
24792
|
+
selectedValues = {};
|
|
24793
|
+
} else if (isDefaultValue) {
|
|
24794
|
+
currentValue = MultiRange.parseValue(item, props);
|
|
24795
|
+
var values = {};
|
|
24796
|
+
currentValue.forEach(function (value) {
|
|
24797
|
+
values[[value.label]] = true;
|
|
24798
|
+
});
|
|
24799
|
+
if (reset) {
|
|
24800
|
+
selectedValues = values;
|
|
24801
|
+
} else {
|
|
24802
|
+
selectedValues = _extends({}, selectedValues, values);
|
|
24803
|
+
}
|
|
24804
|
+
} else if (selectedValues[item]) {
|
|
24805
|
+
currentValue = currentValue.filter(function (value) {
|
|
24806
|
+
return value.label !== item;
|
|
24807
|
+
});
|
|
24808
|
+
var _selectedValues = selectedValues,
|
|
24809
|
+
del = _selectedValues[item],
|
|
24810
|
+
selected = _objectWithoutPropertiesLoose(_selectedValues, [item].map(_toPropertyKey));
|
|
24811
|
+
selectedValues = selected;
|
|
24812
|
+
} else {
|
|
24504
24813
|
var _extends2;
|
|
24505
24814
|
var currentItems = props.data.filter(function (value) {
|
|
24506
24815
|
return item.indexOf(value.label) !== -1;
|
|
@@ -24546,12 +24855,12 @@
|
|
|
24546
24855
|
this.selectItem(newVal, true, undefined, true);
|
|
24547
24856
|
},
|
|
24548
24857
|
value: function value(newVal, oldVal) {
|
|
24549
|
-
if (!isEqual$
|
|
24858
|
+
if (!isEqual$e(newVal, oldVal)) {
|
|
24550
24859
|
this.selectItem(newVal, true, undefined, true);
|
|
24551
24860
|
}
|
|
24552
24861
|
},
|
|
24553
24862
|
selectedValue: function selectedValue(newVal) {
|
|
24554
|
-
if (!isEqual$
|
|
24863
|
+
if (!isEqual$e(this.$data.currentValue, newVal)) {
|
|
24555
24864
|
var processSelectedValues = newVal ? newVal.map(function (item) {
|
|
24556
24865
|
if (typeof item === 'object' && 'label' in item) {
|
|
24557
24866
|
return item.label;
|
|
@@ -24664,19 +24973,19 @@
|
|
|
24664
24973
|
}
|
|
24665
24974
|
return query;
|
|
24666
24975
|
};
|
|
24667
|
-
var mapStateToProps$
|
|
24976
|
+
var mapStateToProps$d = function mapStateToProps(state, props) {
|
|
24668
24977
|
return {
|
|
24669
24978
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24670
24979
|
componentProps: state.props[props.componentId],
|
|
24671
24980
|
enableAppbase: state.config.enableAppbase
|
|
24672
24981
|
};
|
|
24673
24982
|
};
|
|
24674
|
-
var mapDispatchtoProps$
|
|
24675
|
-
updateQuery: updateQuery$
|
|
24676
|
-
setQueryOptions: setQueryOptions$
|
|
24677
|
-
setCustomQuery: setCustomQuery$
|
|
24983
|
+
var mapDispatchtoProps$a = {
|
|
24984
|
+
updateQuery: updateQuery$b,
|
|
24985
|
+
setQueryOptions: setQueryOptions$a,
|
|
24986
|
+
setCustomQuery: setCustomQuery$a
|
|
24678
24987
|
};
|
|
24679
|
-
var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
24988
|
+
var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(MultiRange), {
|
|
24680
24989
|
componentType: constants_1$1.multiRange
|
|
24681
24990
|
}));
|
|
24682
24991
|
RangeConnected$2.name = MultiRange.name;
|
|
@@ -24689,13 +24998,13 @@
|
|
|
24689
24998
|
// Add componentType for SSR
|
|
24690
24999
|
RangeConnected$2.componentType = constants_1$1.multiRange;
|
|
24691
25000
|
|
|
24692
|
-
var updateQuery$
|
|
24693
|
-
setQueryOptions$
|
|
24694
|
-
setCustomQuery$
|
|
25001
|
+
var updateQuery$c = lib_5.updateQuery,
|
|
25002
|
+
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25003
|
+
setCustomQuery$b = lib_5.setCustomQuery;
|
|
24695
25004
|
var checkValueChange$a = lib_8.checkValueChange,
|
|
24696
25005
|
getClassName$e = lib_8.getClassName,
|
|
24697
25006
|
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
|
|
24698
|
-
isEqual$
|
|
25007
|
+
isEqual$f = lib_8.isEqual;
|
|
24699
25008
|
var RangeSlider = {
|
|
24700
25009
|
name: 'RangeSlider',
|
|
24701
25010
|
components: getComponents(),
|
|
@@ -24809,12 +25118,12 @@
|
|
|
24809
25118
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
24810
25119
|
},
|
|
24811
25120
|
value: function value(newVal, oldVal) {
|
|
24812
|
-
if (!isEqual$
|
|
25121
|
+
if (!isEqual$f(newVal, oldVal)) {
|
|
24813
25122
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
24814
25123
|
}
|
|
24815
25124
|
},
|
|
24816
25125
|
selectedValue: function selectedValue(newVal) {
|
|
24817
|
-
if (!isEqual$
|
|
25126
|
+
if (!isEqual$f(this.$data.currentValue, newVal)) {
|
|
24818
25127
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
24819
25128
|
this.$emit('change', newVal);
|
|
24820
25129
|
}
|
|
@@ -24917,7 +25226,7 @@
|
|
|
24917
25226
|
}
|
|
24918
25227
|
return [];
|
|
24919
25228
|
};
|
|
24920
|
-
var mapStateToProps$
|
|
25229
|
+
var mapStateToProps$e = function mapStateToProps(state, props) {
|
|
24921
25230
|
return {
|
|
24922
25231
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
24923
25232
|
: [],
|
|
@@ -24926,12 +25235,12 @@
|
|
|
24926
25235
|
enableAppbase: state.config.enableAppbase
|
|
24927
25236
|
};
|
|
24928
25237
|
};
|
|
24929
|
-
var mapDispatchtoProps$
|
|
24930
|
-
updateQuery: updateQuery$
|
|
24931
|
-
setQueryOptions: setQueryOptions$
|
|
24932
|
-
setCustomQuery: setCustomQuery$
|
|
25238
|
+
var mapDispatchtoProps$b = {
|
|
25239
|
+
updateQuery: updateQuery$c,
|
|
25240
|
+
setQueryOptions: setQueryOptions$b,
|
|
25241
|
+
setCustomQuery: setCustomQuery$b
|
|
24933
25242
|
};
|
|
24934
|
-
var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
25243
|
+
var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(RangeSlider), {
|
|
24935
25244
|
componentType: constants_1$1.rangeSlider
|
|
24936
25245
|
}));
|
|
24937
25246
|
RangeConnected$3.name = RangeSlider.name;
|
|
@@ -24955,7 +25264,7 @@
|
|
|
24955
25264
|
});
|
|
24956
25265
|
|
|
24957
25266
|
var getClassName$f = lib_8.getClassName,
|
|
24958
|
-
isEqual$
|
|
25267
|
+
isEqual$g = lib_8.isEqual;
|
|
24959
25268
|
var RangeInput = {
|
|
24960
25269
|
name: 'RangeInput',
|
|
24961
25270
|
components: {
|
|
@@ -25033,7 +25342,7 @@
|
|
|
25033
25342
|
},
|
|
25034
25343
|
handleChange: function handleChange(value, event) {
|
|
25035
25344
|
var currentValue = value;
|
|
25036
|
-
if (this.shouldUpdate(value) && !isEqual$
|
|
25345
|
+
if (this.shouldUpdate(value) && !isEqual$g(value, this.currentValue)) {
|
|
25037
25346
|
switch (event) {
|
|
25038
25347
|
case 'change':
|
|
25039
25348
|
if (!value) {
|
|
@@ -25064,488 +25373,198 @@
|
|
|
25064
25373
|
handleInputChange: function handleInputChange(e) {
|
|
25065
25374
|
var _e$target = e.target,
|
|
25066
25375
|
name = _e$target.name,
|
|
25067
|
-
value = _e$target.value;
|
|
25068
|
-
if (Number.isNaN(value)) {
|
|
25069
|
-
if (name === 'start') {
|
|
25070
|
-
this.$data.isStartValid = false;
|
|
25071
|
-
} else {
|
|
25072
|
-
this.$data.isEndValid = false;
|
|
25073
|
-
}
|
|
25074
|
-
} else if (name === 'start' && !this.$data.isStartValid) {
|
|
25075
|
-
this.$data.isStartValid = true;
|
|
25076
|
-
} else if (name === 'end' && !this.$data.isEndValid) {
|
|
25077
|
-
this.$data.isEndValid = true;
|
|
25078
|
-
}
|
|
25079
|
-
if (this.$data.isStartValid && this.$data.isEndValid) {
|
|
25080
|
-
if (name === 'start') {
|
|
25081
|
-
this.handleChange({
|
|
25082
|
-
start: Number(value),
|
|
25083
|
-
end: this.$data.currentValue.end
|
|
25084
|
-
}, 'change');
|
|
25085
|
-
} else {
|
|
25086
|
-
this.handleChange({
|
|
25087
|
-
start: this.$data.currentValue.start,
|
|
25088
|
-
end: Number(value)
|
|
25089
|
-
}, 'change');
|
|
25090
|
-
}
|
|
25091
|
-
}
|
|
25092
|
-
}
|
|
25093
|
-
},
|
|
25094
|
-
watch: {
|
|
25095
|
-
defaultValue: function defaultValue(newVal, oldVal) {
|
|
25096
|
-
if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
|
|
25097
|
-
this.handleChange(newVal);
|
|
25098
|
-
}
|
|
25099
|
-
},
|
|
25100
|
-
value: function value(newVal, oldVal) {
|
|
25101
|
-
if (!isEqual$f(newVal, oldVal)) {
|
|
25102
|
-
if (this.isControlled()) {
|
|
25103
|
-
this.handleChange(newVal, 'change');
|
|
25104
|
-
}
|
|
25105
|
-
}
|
|
25106
|
-
}
|
|
25107
|
-
},
|
|
25108
|
-
created: function created() {
|
|
25109
|
-
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
25110
|
-
this.handleChange(this.$props.defaultValue);
|
|
25111
|
-
}
|
|
25112
|
-
if (this.isControlled()) {
|
|
25113
|
-
this.handleChange(this.$props.value, 'change');
|
|
25114
|
-
}
|
|
25115
|
-
},
|
|
25116
|
-
render: function render() {
|
|
25117
|
-
var h = arguments[0];
|
|
25118
|
-
var _this$$props = this.$props,
|
|
25119
|
-
className = _this$$props.className,
|
|
25120
|
-
dataField = _this$$props.dataField,
|
|
25121
|
-
range = _this$$props.range,
|
|
25122
|
-
rangeLabels = _this$$props.rangeLabels,
|
|
25123
|
-
componentId = _this$$props.componentId,
|
|
25124
|
-
innerClass = _this$$props.innerClass,
|
|
25125
|
-
stepValue = _this$$props.stepValue,
|
|
25126
|
-
componentStyle = _this$$props.componentStyle,
|
|
25127
|
-
themePreset = _this$$props.themePreset,
|
|
25128
|
-
includeNullValues = _this$$props.includeNullValues,
|
|
25129
|
-
beforeValueChange = _this$$props.beforeValueChange,
|
|
25130
|
-
customQuery = _this$$props.customQuery,
|
|
25131
|
-
data = _this$$props.data,
|
|
25132
|
-
filterLabel = _this$$props.filterLabel,
|
|
25133
|
-
react = _this$$props.react,
|
|
25134
|
-
showFilter = _this$$props.showFilter,
|
|
25135
|
-
showCheckbox = _this$$props.showCheckbox,
|
|
25136
|
-
title = _this$$props.title,
|
|
25137
|
-
URLParams = _this$$props.URLParams,
|
|
25138
|
-
sliderOptions = _this$$props.sliderOptions,
|
|
25139
|
-
nestedField = _this$$props.nestedField;
|
|
25140
|
-
return h(Container, {
|
|
25141
|
-
"style": componentStyle,
|
|
25142
|
-
"class": className
|
|
25143
|
-
}, [h(RangeConnected$3, {
|
|
25144
|
-
"attrs": {
|
|
25145
|
-
"componentId": componentId,
|
|
25146
|
-
"value": {
|
|
25147
|
-
start: this.currentValue.start,
|
|
25148
|
-
end: this.currentValue.end
|
|
25149
|
-
},
|
|
25150
|
-
"range": range,
|
|
25151
|
-
"dataField": dataField,
|
|
25152
|
-
"rangeLabels": rangeLabels,
|
|
25153
|
-
"includeNullValues": includeNullValues,
|
|
25154
|
-
"beforeValueChange": beforeValueChange,
|
|
25155
|
-
"customQuery": customQuery,
|
|
25156
|
-
"data": data,
|
|
25157
|
-
"filterLabel": filterLabel,
|
|
25158
|
-
"react": react,
|
|
25159
|
-
"showFilter": showFilter,
|
|
25160
|
-
"showCheckbox": showCheckbox,
|
|
25161
|
-
"title": title,
|
|
25162
|
-
"uRLParams": URLParams,
|
|
25163
|
-
"sliderOptions": sliderOptions,
|
|
25164
|
-
"nestedField": nestedField
|
|
25165
|
-
},
|
|
25166
|
-
"on": {
|
|
25167
|
-
"change": this.handleOnChange,
|
|
25168
|
-
"value-change": this.handleValueChange
|
|
25169
|
-
}
|
|
25170
|
-
}), h(Flex, {
|
|
25171
|
-
"class": getClassName$f(innerClass, 'input-container') || ''
|
|
25172
|
-
}, [h(Flex, {
|
|
25173
|
-
"attrs": {
|
|
25174
|
-
"direction": "column",
|
|
25175
|
-
"flex": 2
|
|
25176
|
-
}
|
|
25177
|
-
}, [h(Input, {
|
|
25178
|
-
"key": componentId + "-start-value",
|
|
25179
|
-
"attrs": {
|
|
25180
|
-
"name": "start",
|
|
25181
|
-
"type": "number",
|
|
25182
|
-
"step": stepValue,
|
|
25183
|
-
"themePreset": themePreset,
|
|
25184
|
-
"aria-label": componentId + "-start-input",
|
|
25185
|
-
"min": this.$props.range ? this.$props.range.start : 0,
|
|
25186
|
-
"alert": !this.isStartValid
|
|
25187
|
-
},
|
|
25188
|
-
"on": {
|
|
25189
|
-
"change": this.handleInputChange
|
|
25190
|
-
},
|
|
25191
|
-
"class": getClassName$f(innerClass, 'input') || '',
|
|
25192
|
-
"domProps": _extends({}, {
|
|
25193
|
-
value: this.currentValue.start
|
|
25194
|
-
})
|
|
25195
|
-
}), !this.isStartValid && h(Content, {
|
|
25196
|
-
"attrs": {
|
|
25197
|
-
"alert": true
|
|
25198
|
-
}
|
|
25199
|
-
}, ["Input range is invalid"])]), h(Flex, {
|
|
25200
|
-
"attrs": {
|
|
25201
|
-
"justifyContent": "center",
|
|
25202
|
-
"alignItems": "center",
|
|
25203
|
-
"flex": 1
|
|
25204
|
-
}
|
|
25205
|
-
}, ["-"]), h(Flex, {
|
|
25206
|
-
"attrs": {
|
|
25207
|
-
"direction": "column",
|
|
25208
|
-
"flex": 2
|
|
25209
|
-
}
|
|
25210
|
-
}, [h(Input, {
|
|
25211
|
-
"key": componentId + "-end-value",
|
|
25212
|
-
"attrs": {
|
|
25213
|
-
"name": "end",
|
|
25214
|
-
"type": "number",
|
|
25215
|
-
"step": stepValue,
|
|
25216
|
-
"themePreset": themePreset,
|
|
25217
|
-
"aria-label": componentId + "-end-input",
|
|
25218
|
-
"max": this.$props.range ? this.$props.range.end : 10,
|
|
25219
|
-
"alert": !this.isEndValid
|
|
25220
|
-
},
|
|
25221
|
-
"on": {
|
|
25222
|
-
"change": this.handleInputChange
|
|
25223
|
-
},
|
|
25224
|
-
"class": getClassName$f(innerClass, 'input') || '',
|
|
25225
|
-
"domProps": _extends({}, {
|
|
25226
|
-
value: this.currentValue.end
|
|
25227
|
-
})
|
|
25228
|
-
}), !this.isEndValid && h(Content, {
|
|
25229
|
-
"attrs": {
|
|
25230
|
-
"alert": true
|
|
25231
|
-
}
|
|
25232
|
-
}, ["Input range is invalid"])])])]);
|
|
25233
|
-
}
|
|
25234
|
-
};
|
|
25235
|
-
var mapStateToProps$e = function mapStateToProps(state) {
|
|
25236
|
-
return {
|
|
25237
|
-
themePreset: state.config.themePreset
|
|
25238
|
-
};
|
|
25239
|
-
};
|
|
25240
|
-
var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$e, {})(RangeInput), {
|
|
25241
|
-
componentType: constants_1$1.rangeInput
|
|
25242
|
-
}));
|
|
25243
|
-
RangeConnected$4.name = RangeInput.name;
|
|
25244
|
-
RangeConnected$4.install = function (Vue) {
|
|
25245
|
-
Vue.component(RangeConnected$4.name, RangeConnected$4);
|
|
25246
|
-
};
|
|
25247
|
-
|
|
25248
|
-
// Add componentType for SSR
|
|
25249
|
-
RangeConnected$4.componentType = constants_1$1.rangeInput;
|
|
25250
|
-
|
|
25251
|
-
var _excluded = ["options"];
|
|
25252
|
-
var updateQuery$c = lib_5.updateQuery,
|
|
25253
|
-
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25254
|
-
setCustomQuery$b = lib_5.setCustomQuery,
|
|
25255
|
-
setDefaultQuery$7 = lib_5.setDefaultQuery;
|
|
25256
|
-
var parseHits$1 = lib_8.parseHits,
|
|
25257
|
-
isEqual$g = lib_8.isEqual,
|
|
25258
|
-
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
25259
|
-
getResultStats$3 = lib_8.getResultStats,
|
|
25260
|
-
extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
|
|
25261
|
-
getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
|
|
25262
|
-
var ReactiveComponent = {
|
|
25263
|
-
name: 'ReactiveComponent',
|
|
25264
|
-
props: {
|
|
25265
|
-
componentId: types.stringRequired,
|
|
25266
|
-
aggregationField: types.string,
|
|
25267
|
-
aggregationSize: VueTypes.number,
|
|
25268
|
-
size: VueTypes.number,
|
|
25269
|
-
defaultQuery: types.func,
|
|
25270
|
-
customQuery: types.func,
|
|
25271
|
-
filterLabel: types.string,
|
|
25272
|
-
react: types.react,
|
|
25273
|
-
showFilter: VueTypes.bool.def(true),
|
|
25274
|
-
URLParams: VueTypes.bool.def(false),
|
|
25275
|
-
distinctField: types.string,
|
|
25276
|
-
distinctFieldConfig: types.props,
|
|
25277
|
-
index: VueTypes.string,
|
|
25278
|
-
endpoint: types.endpointConfig
|
|
25279
|
-
},
|
|
25280
|
-
created: function created() {
|
|
25281
|
-
var _this = this;
|
|
25282
|
-
var props = this.$props;
|
|
25283
|
-
this.internalComponent = null;
|
|
25284
|
-
this.$defaultQuery = null;
|
|
25285
|
-
// Set custom query in store
|
|
25286
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
25287
|
-
var customQuery = props.customQuery,
|
|
25288
|
-
componentId = props.componentId,
|
|
25289
|
-
filterLabel = props.filterLabel,
|
|
25290
|
-
showFilter = props.showFilter,
|
|
25291
|
-
URLParams = props.URLParams,
|
|
25292
|
-
distinctField = props.distinctField,
|
|
25293
|
-
distinctFieldConfig = props.distinctFieldConfig,
|
|
25294
|
-
index = props.index;
|
|
25295
|
-
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
25296
|
-
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
25297
|
-
}
|
|
25298
|
-
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
25299
|
-
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
25300
|
-
}
|
|
25301
|
-
if (!this.enableAppbase && index) {
|
|
25302
|
-
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
25303
|
-
}
|
|
25304
|
-
if (customQuery) {
|
|
25305
|
-
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
25306
|
-
var query = extractQueryFromCustomQuery$7(calcCustomQuery);
|
|
25307
|
-
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$7(calcCustomQuery) : null;
|
|
25308
|
-
if (customQueryOptions) {
|
|
25309
|
-
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
25310
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
25311
|
-
this.updateQuery({
|
|
25312
|
-
componentId: componentId,
|
|
25313
|
-
query: query,
|
|
25314
|
-
value: this.selectedValue || null,
|
|
25315
|
-
label: filterLabel,
|
|
25316
|
-
showFilter: showFilter,
|
|
25317
|
-
URLParams: URLParams
|
|
25318
|
-
});
|
|
25319
|
-
}
|
|
25320
|
-
this.setQuery = function (_ref) {
|
|
25321
|
-
var options = _ref.options,
|
|
25322
|
-
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25323
|
-
var queryToBeSet = obj.query;
|
|
25324
|
-
|
|
25325
|
-
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
25326
|
-
if (queryToBeSet && queryToBeSet.query) {
|
|
25327
|
-
queryToBeSet = queryToBeSet.query;
|
|
25328
|
-
}
|
|
25329
|
-
var customQueryCalc = _extends({}, options, {
|
|
25330
|
-
query: queryToBeSet
|
|
25331
|
-
});
|
|
25332
|
-
var rsAPIQuery = customQueryCalc;
|
|
25333
|
-
// handle stored queries
|
|
25334
|
-
if (queryToBeSet && queryToBeSet.id) {
|
|
25335
|
-
rsAPIQuery = queryToBeSet;
|
|
25336
|
-
}
|
|
25337
|
-
// Update customQuery field for RS API
|
|
25338
|
-
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
25339
|
-
if (options) {
|
|
25340
|
-
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
25341
|
-
}
|
|
25342
|
-
_this.updateQuery(_extends({}, obj, {
|
|
25343
|
-
query: customQueryCalc.query,
|
|
25344
|
-
componentId: props.componentId,
|
|
25345
|
-
label: props.filterLabel,
|
|
25346
|
-
showFilter: props.showFilter,
|
|
25347
|
-
URLParams: props.URLParams
|
|
25348
|
-
}));
|
|
25349
|
-
};
|
|
25350
|
-
if (props.defaultQuery) {
|
|
25351
|
-
this.internalComponent = props.componentId + "__internal";
|
|
25352
|
-
}
|
|
25353
|
-
if (this.internalComponent && this.$props.defaultQuery) {
|
|
25354
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
25355
|
-
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
25356
|
-
var _query = extractQueryFromCustomQuery$7(this.$defaultQuery);
|
|
25357
|
-
var queryOptions = getOptionsForCustomQuery$7(this.$defaultQuery);
|
|
25358
|
-
if (queryOptions) {
|
|
25359
|
-
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25360
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
25361
|
-
this.updateQuery({
|
|
25362
|
-
componentId: this.internalComponent,
|
|
25363
|
-
query: _query
|
|
25364
|
-
});
|
|
25365
|
-
}
|
|
25366
|
-
},
|
|
25367
|
-
watch: {
|
|
25368
|
-
hits: function hits(newVal, oldVal) {
|
|
25369
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25370
|
-
this.$emit('data', this.getData());
|
|
25371
|
-
}
|
|
25372
|
-
},
|
|
25373
|
-
rawData: function rawData(newVal, oldVal) {
|
|
25374
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25375
|
-
this.$emit('data', this.getData());
|
|
25376
|
-
}
|
|
25377
|
-
},
|
|
25378
|
-
aggregations: function aggregations(newVal, oldVal) {
|
|
25379
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25380
|
-
this.$emit('data', this.getData());
|
|
25381
|
-
}
|
|
25382
|
-
},
|
|
25383
|
-
aggregationData: function aggregationData(newVal, oldVal) {
|
|
25384
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25385
|
-
this.$emit('data', this.getData());
|
|
25386
|
-
}
|
|
25387
|
-
},
|
|
25388
|
-
promotedResults: function promotedResults(newVal, oldVal) {
|
|
25389
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25390
|
-
this.$emit('data', this.getData());
|
|
25391
|
-
}
|
|
25392
|
-
},
|
|
25393
|
-
hidden: function hidden(newVal, oldVal) {
|
|
25394
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25395
|
-
this.$emit('data', this.getData());
|
|
25396
|
-
}
|
|
25397
|
-
},
|
|
25398
|
-
total: function total(newVal, oldVal) {
|
|
25399
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25400
|
-
this.$emit('data', this.getData());
|
|
25401
|
-
}
|
|
25402
|
-
},
|
|
25403
|
-
time: function time(newVal, oldVal) {
|
|
25404
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25405
|
-
this.$emit('data', this.getData());
|
|
25406
|
-
}
|
|
25407
|
-
},
|
|
25408
|
-
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
25409
|
-
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
25410
|
-
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
25411
|
-
var query = extractQueryFromCustomQuery$7(this.$defaultQuery);
|
|
25412
|
-
var queryOptions = getOptionsForCustomQuery$7(this.$defaultQuery);
|
|
25413
|
-
if (queryOptions) {
|
|
25414
|
-
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25415
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
25416
|
-
// Update default query for RS API
|
|
25417
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
25418
|
-
this.updateQuery({
|
|
25419
|
-
componentId: this.internalComponent,
|
|
25420
|
-
query: query
|
|
25421
|
-
});
|
|
25422
|
-
}
|
|
25423
|
-
},
|
|
25424
|
-
customQuery: function customQuery(newVal, oldVal) {
|
|
25425
|
-
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
25426
|
-
var componentId = this.$props.componentId;
|
|
25427
|
-
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
25428
|
-
var query = extractQueryFromCustomQuery$7(this.$customQuery);
|
|
25429
|
-
var queryOptions = getOptionsForCustomQuery$7(this.$customQuery);
|
|
25430
|
-
if (queryOptions) {
|
|
25431
|
-
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25432
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
25433
|
-
|
|
25434
|
-
// Update custom query for RS API
|
|
25435
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
25436
|
-
this.updateQuery({
|
|
25437
|
-
componentId: componentId,
|
|
25438
|
-
query: query
|
|
25439
|
-
});
|
|
25376
|
+
value = _e$target.value;
|
|
25377
|
+
if (Number.isNaN(value)) {
|
|
25378
|
+
if (name === 'start') {
|
|
25379
|
+
this.$data.isStartValid = false;
|
|
25380
|
+
} else {
|
|
25381
|
+
this.$data.isEndValid = false;
|
|
25382
|
+
}
|
|
25383
|
+
} else if (name === 'start' && !this.$data.isStartValid) {
|
|
25384
|
+
this.$data.isStartValid = true;
|
|
25385
|
+
} else if (name === 'end' && !this.$data.isEndValid) {
|
|
25386
|
+
this.$data.isEndValid = true;
|
|
25387
|
+
}
|
|
25388
|
+
if (this.$data.isStartValid && this.$data.isEndValid) {
|
|
25389
|
+
if (name === 'start') {
|
|
25390
|
+
this.handleChange({
|
|
25391
|
+
start: Number(value),
|
|
25392
|
+
end: this.$data.currentValue.end
|
|
25393
|
+
}, 'change');
|
|
25394
|
+
} else {
|
|
25395
|
+
this.handleChange({
|
|
25396
|
+
start: this.$data.currentValue.start,
|
|
25397
|
+
end: Number(value)
|
|
25398
|
+
}, 'change');
|
|
25399
|
+
}
|
|
25440
25400
|
}
|
|
25441
25401
|
}
|
|
25442
25402
|
},
|
|
25443
|
-
|
|
25444
|
-
|
|
25445
|
-
|
|
25446
|
-
|
|
25447
|
-
var error = this.error,
|
|
25448
|
-
isLoading = this.isLoading,
|
|
25449
|
-
selectedValue = this.selectedValue;
|
|
25450
|
-
var propsToBePassed = _extends({
|
|
25451
|
-
error: error,
|
|
25452
|
-
loading: isLoading
|
|
25453
|
-
}, this.getData(), {
|
|
25454
|
-
value: selectedValue,
|
|
25455
|
-
setQuery: this.setQuery
|
|
25456
|
-
});
|
|
25457
|
-
return h("div", [dom(propsToBePassed)]);
|
|
25458
|
-
} catch (e) {
|
|
25459
|
-
return null;
|
|
25460
|
-
}
|
|
25461
|
-
},
|
|
25462
|
-
methods: {
|
|
25463
|
-
getAggsQuery: function getAggsQuery() {
|
|
25464
|
-
if (this.aggregationField) {
|
|
25465
|
-
return {
|
|
25466
|
-
aggs: getCompositeAggsQuery$5({
|
|
25467
|
-
props: this.$props,
|
|
25468
|
-
showTopHits: true,
|
|
25469
|
-
value: this.selectedValue
|
|
25470
|
-
}).aggs
|
|
25471
|
-
};
|
|
25403
|
+
watch: {
|
|
25404
|
+
defaultValue: function defaultValue(newVal, oldVal) {
|
|
25405
|
+
if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
|
|
25406
|
+
this.handleChange(newVal);
|
|
25472
25407
|
}
|
|
25473
|
-
return {};
|
|
25474
25408
|
},
|
|
25475
|
-
|
|
25476
|
-
|
|
25477
|
-
|
|
25478
|
-
|
|
25479
|
-
promotedResults = this.promotedResults,
|
|
25480
|
-
rawData = this.rawData;
|
|
25481
|
-
var filteredResults = parseHits$1(hits);
|
|
25482
|
-
if (promotedResults.length) {
|
|
25483
|
-
var ids = promotedResults.map(function (item) {
|
|
25484
|
-
return item._id;
|
|
25485
|
-
}).filter(Boolean);
|
|
25486
|
-
if (ids) {
|
|
25487
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
25488
|
-
return !ids.includes(item._id);
|
|
25489
|
-
});
|
|
25409
|
+
value: function value(newVal, oldVal) {
|
|
25410
|
+
if (!isEqual$g(newVal, oldVal)) {
|
|
25411
|
+
if (this.isControlled()) {
|
|
25412
|
+
this.handleChange(newVal, 'change');
|
|
25490
25413
|
}
|
|
25491
|
-
filteredResults = [].concat(promotedResults, filteredResults);
|
|
25492
25414
|
}
|
|
25493
|
-
return {
|
|
25494
|
-
data: filteredResults,
|
|
25495
|
-
aggregationData: aggregationData,
|
|
25496
|
-
rawData: rawData,
|
|
25497
|
-
aggregations: aggregations,
|
|
25498
|
-
promotedData: promotedResults,
|
|
25499
|
-
resultStats: this.stats
|
|
25500
|
-
};
|
|
25501
25415
|
}
|
|
25502
25416
|
},
|
|
25503
|
-
|
|
25504
|
-
|
|
25505
|
-
|
|
25417
|
+
created: function created() {
|
|
25418
|
+
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
25419
|
+
this.handleChange(this.$props.defaultValue);
|
|
25506
25420
|
}
|
|
25421
|
+
if (this.isControlled()) {
|
|
25422
|
+
this.handleChange(this.$props.value, 'change');
|
|
25423
|
+
}
|
|
25424
|
+
},
|
|
25425
|
+
render: function render() {
|
|
25426
|
+
var h = arguments[0];
|
|
25427
|
+
var _this$$props = this.$props,
|
|
25428
|
+
className = _this$$props.className,
|
|
25429
|
+
dataField = _this$$props.dataField,
|
|
25430
|
+
range = _this$$props.range,
|
|
25431
|
+
rangeLabels = _this$$props.rangeLabels,
|
|
25432
|
+
componentId = _this$$props.componentId,
|
|
25433
|
+
innerClass = _this$$props.innerClass,
|
|
25434
|
+
stepValue = _this$$props.stepValue,
|
|
25435
|
+
componentStyle = _this$$props.componentStyle,
|
|
25436
|
+
themePreset = _this$$props.themePreset,
|
|
25437
|
+
includeNullValues = _this$$props.includeNullValues,
|
|
25438
|
+
beforeValueChange = _this$$props.beforeValueChange,
|
|
25439
|
+
customQuery = _this$$props.customQuery,
|
|
25440
|
+
data = _this$$props.data,
|
|
25441
|
+
filterLabel = _this$$props.filterLabel,
|
|
25442
|
+
react = _this$$props.react,
|
|
25443
|
+
showFilter = _this$$props.showFilter,
|
|
25444
|
+
showCheckbox = _this$$props.showCheckbox,
|
|
25445
|
+
title = _this$$props.title,
|
|
25446
|
+
URLParams = _this$$props.URLParams,
|
|
25447
|
+
sliderOptions = _this$$props.sliderOptions,
|
|
25448
|
+
nestedField = _this$$props.nestedField;
|
|
25449
|
+
return h(Container, {
|
|
25450
|
+
"style": componentStyle,
|
|
25451
|
+
"class": className
|
|
25452
|
+
}, [h(RangeConnected$3, {
|
|
25453
|
+
"attrs": {
|
|
25454
|
+
"componentId": componentId,
|
|
25455
|
+
"value": {
|
|
25456
|
+
start: this.currentValue.start,
|
|
25457
|
+
end: this.currentValue.end
|
|
25458
|
+
},
|
|
25459
|
+
"range": range,
|
|
25460
|
+
"dataField": dataField,
|
|
25461
|
+
"rangeLabels": rangeLabels,
|
|
25462
|
+
"includeNullValues": includeNullValues,
|
|
25463
|
+
"beforeValueChange": beforeValueChange,
|
|
25464
|
+
"customQuery": customQuery,
|
|
25465
|
+
"data": data,
|
|
25466
|
+
"filterLabel": filterLabel,
|
|
25467
|
+
"react": react,
|
|
25468
|
+
"showFilter": showFilter,
|
|
25469
|
+
"showCheckbox": showCheckbox,
|
|
25470
|
+
"title": title,
|
|
25471
|
+
"uRLParams": URLParams,
|
|
25472
|
+
"sliderOptions": sliderOptions,
|
|
25473
|
+
"nestedField": nestedField
|
|
25474
|
+
},
|
|
25475
|
+
"on": {
|
|
25476
|
+
"change": this.handleOnChange,
|
|
25477
|
+
"value-change": this.handleValueChange
|
|
25478
|
+
}
|
|
25479
|
+
}), h(Flex, {
|
|
25480
|
+
"class": getClassName$f(innerClass, 'input-container') || ''
|
|
25481
|
+
}, [h(Flex, {
|
|
25482
|
+
"attrs": {
|
|
25483
|
+
"direction": "column",
|
|
25484
|
+
"flex": 2
|
|
25485
|
+
}
|
|
25486
|
+
}, [h(Input, {
|
|
25487
|
+
"key": componentId + "-start-value",
|
|
25488
|
+
"attrs": {
|
|
25489
|
+
"name": "start",
|
|
25490
|
+
"type": "number",
|
|
25491
|
+
"step": stepValue,
|
|
25492
|
+
"themePreset": themePreset,
|
|
25493
|
+
"aria-label": componentId + "-start-input",
|
|
25494
|
+
"min": this.$props.range ? this.$props.range.start : 0,
|
|
25495
|
+
"alert": !this.isStartValid
|
|
25496
|
+
},
|
|
25497
|
+
"on": {
|
|
25498
|
+
"change": this.handleInputChange
|
|
25499
|
+
},
|
|
25500
|
+
"class": getClassName$f(innerClass, 'input') || '',
|
|
25501
|
+
"domProps": _extends({}, {
|
|
25502
|
+
value: this.currentValue.start
|
|
25503
|
+
})
|
|
25504
|
+
}), !this.isStartValid && h(Content, {
|
|
25505
|
+
"attrs": {
|
|
25506
|
+
"alert": true
|
|
25507
|
+
}
|
|
25508
|
+
}, ["Input range is invalid"])]), h(Flex, {
|
|
25509
|
+
"attrs": {
|
|
25510
|
+
"justifyContent": "center",
|
|
25511
|
+
"alignItems": "center",
|
|
25512
|
+
"flex": 1
|
|
25513
|
+
}
|
|
25514
|
+
}, ["-"]), h(Flex, {
|
|
25515
|
+
"attrs": {
|
|
25516
|
+
"direction": "column",
|
|
25517
|
+
"flex": 2
|
|
25518
|
+
}
|
|
25519
|
+
}, [h(Input, {
|
|
25520
|
+
"key": componentId + "-end-value",
|
|
25521
|
+
"attrs": {
|
|
25522
|
+
"name": "end",
|
|
25523
|
+
"type": "number",
|
|
25524
|
+
"step": stepValue,
|
|
25525
|
+
"themePreset": themePreset,
|
|
25526
|
+
"aria-label": componentId + "-end-input",
|
|
25527
|
+
"max": this.$props.range ? this.$props.range.end : 10,
|
|
25528
|
+
"alert": !this.isEndValid
|
|
25529
|
+
},
|
|
25530
|
+
"on": {
|
|
25531
|
+
"change": this.handleInputChange
|
|
25532
|
+
},
|
|
25533
|
+
"class": getClassName$f(innerClass, 'input') || '',
|
|
25534
|
+
"domProps": _extends({}, {
|
|
25535
|
+
value: this.currentValue.end
|
|
25536
|
+
})
|
|
25537
|
+
}), !this.isEndValid && h(Content, {
|
|
25538
|
+
"attrs": {
|
|
25539
|
+
"alert": true
|
|
25540
|
+
}
|
|
25541
|
+
}, ["Input range is invalid"])])])]);
|
|
25507
25542
|
}
|
|
25508
25543
|
};
|
|
25509
|
-
|
|
25510
|
-
return !!props.defaultQuery;
|
|
25511
|
-
};
|
|
25512
|
-
var mapStateToProps$f = function mapStateToProps(state, props) {
|
|
25544
|
+
var mapStateToProps$f = function mapStateToProps(state) {
|
|
25513
25545
|
return {
|
|
25514
|
-
|
|
25515
|
-
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
25516
|
-
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
25517
|
-
rawData: state.rawData[props.componentId],
|
|
25518
|
-
error: state.error[props.componentId],
|
|
25519
|
-
isLoading: state.isLoading[props.componentId],
|
|
25520
|
-
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
25521
|
-
promotedResults: state.promotedResults[props.componentId] || [],
|
|
25522
|
-
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
25523
|
-
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
25524
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
25525
|
-
componentProps: state.props[props.componentId],
|
|
25526
|
-
enableAppbase: state.config.enableAppbase
|
|
25546
|
+
themePreset: state.config.themePreset
|
|
25527
25547
|
};
|
|
25528
25548
|
};
|
|
25529
|
-
var
|
|
25530
|
-
|
|
25531
|
-
|
|
25532
|
-
|
|
25533
|
-
|
|
25549
|
+
var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$f, {})(RangeInput), {
|
|
25550
|
+
componentType: constants_1$1.rangeInput
|
|
25551
|
+
}));
|
|
25552
|
+
RangeConnected$4.name = RangeInput.name;
|
|
25553
|
+
RangeConnected$4.install = function (Vue) {
|
|
25554
|
+
Vue.component(RangeConnected$4.name, RangeConnected$4);
|
|
25534
25555
|
};
|
|
25535
|
-
|
|
25536
|
-
|
|
25537
|
-
|
|
25538
|
-
|
|
25556
|
+
|
|
25557
|
+
// Add componentType for SSR
|
|
25558
|
+
RangeConnected$4.componentType = constants_1$1.rangeInput;
|
|
25559
|
+
|
|
25560
|
+
var RcConnected$1 = PreferencesConsumer({
|
|
25539
25561
|
name: 'RcConnected',
|
|
25540
25562
|
render: function render(h) {
|
|
25541
|
-
var component =
|
|
25563
|
+
var component = RcConnected;
|
|
25542
25564
|
switch (this.$attrs.componentType) {
|
|
25543
25565
|
case constants_1$1.reactiveList:
|
|
25544
25566
|
component = RLConnected;
|
|
25545
25567
|
break;
|
|
25546
|
-
case constants_1$1.dataSearch:
|
|
25547
|
-
component = DSConnected;
|
|
25548
|
-
break;
|
|
25549
25568
|
case constants_1$1.searchBox:
|
|
25550
25569
|
component = SBConnected;
|
|
25551
25570
|
break;
|
|
@@ -25591,12 +25610,12 @@
|
|
|
25591
25610
|
});
|
|
25592
25611
|
}
|
|
25593
25612
|
});
|
|
25594
|
-
RcConnected.name =
|
|
25595
|
-
RcConnected.hasInternalComponent =
|
|
25613
|
+
RcConnected$1.name = 'ReactiveComponentPrivate';
|
|
25614
|
+
RcConnected$1.hasInternalComponent = RcConnected.hasInternalComponent;
|
|
25596
25615
|
// Add componentType for SSR
|
|
25597
|
-
RcConnected.componentType = constants_1$1.reactiveComponent;
|
|
25598
|
-
RcConnected.install = function (Vue) {
|
|
25599
|
-
Vue.component(RcConnected.name, RcConnected);
|
|
25616
|
+
RcConnected$1.componentType = constants_1$1.reactiveComponent;
|
|
25617
|
+
RcConnected$1.install = function (Vue) {
|
|
25618
|
+
Vue.component(RcConnected$1.name, RcConnected$1);
|
|
25600
25619
|
};
|
|
25601
25620
|
|
|
25602
25621
|
var setValue$2 = lib_5.setValue,
|
|
@@ -25760,10 +25779,10 @@
|
|
|
25760
25779
|
setValue: setValue$2,
|
|
25761
25780
|
resetValuesToDefault: resetValuesToDefault
|
|
25762
25781
|
};
|
|
25763
|
-
var RcConnected$
|
|
25764
|
-
RcConnected$
|
|
25765
|
-
RcConnected$
|
|
25766
|
-
Vue.component(RcConnected$
|
|
25782
|
+
var RcConnected$2 = connect(mapStateToProps$g, mapDispatchtoProps$c)(SelectedFilters);
|
|
25783
|
+
RcConnected$2.name = SelectedFilters.name;
|
|
25784
|
+
RcConnected$2.install = function (Vue) {
|
|
25785
|
+
Vue.component(RcConnected$2.name, RcConnected$2);
|
|
25767
25786
|
};
|
|
25768
25787
|
|
|
25769
25788
|
var ResultCardTitle = {
|
|
@@ -34821,9 +34840,9 @@
|
|
|
34821
34840
|
});
|
|
34822
34841
|
}
|
|
34823
34842
|
|
|
34824
|
-
var version = "1.33.
|
|
34843
|
+
var version = "1.33.12";
|
|
34825
34844
|
|
|
34826
|
-
var components$1 = [RLConnected, ResultCard, ResultList, ReactiveBase, DSConnected, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
|
|
34845
|
+
var components$1 = [RLConnected, ResultCard, ResultList, ReactiveBase, DSConnected, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
|
|
34827
34846
|
function install (Vue) {
|
|
34828
34847
|
components$1.map(function (component) {
|
|
34829
34848
|
Vue.use(component);
|
|
@@ -34849,12 +34868,13 @@
|
|
|
34849
34868
|
exports.RangeSlider = RangeConnected$3;
|
|
34850
34869
|
exports.ReactiveBase = ReactiveBase;
|
|
34851
34870
|
exports.ReactiveComponent = RcConnected;
|
|
34871
|
+
exports.ReactiveComponentPrivate = RcConnected$1;
|
|
34852
34872
|
exports.ReactiveGoogleMap = ReactiveGoogleMap;
|
|
34853
34873
|
exports.ReactiveList = RLConnected;
|
|
34854
34874
|
exports.ResultCard = ResultCard;
|
|
34855
34875
|
exports.ResultList = ResultList;
|
|
34856
34876
|
exports.SearchBox = SBConnected;
|
|
34857
|
-
exports.SelectedFilters = RcConnected$
|
|
34877
|
+
exports.SelectedFilters = RcConnected$2;
|
|
34858
34878
|
exports.SingleDropdownList = ListConnected$2;
|
|
34859
34879
|
exports.SingleList = ListConnected;
|
|
34860
34880
|
exports.SingleRange = RangeConnected$1;
|