@appbaseio/reactivesearch-vue 1.33.1 → 1.33.2
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 +1911 -6073
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +2 -4
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-0673191e.js → Button-841fd06d.js} +1 -7
- package/dist/cjs/{CancelSvg-9f258f4f.js → CancelSvg-220a7cc3.js} +24 -58
- package/dist/cjs/{Card-642547a8.js → Card-240f283d.js} +2 -2
- package/dist/cjs/{ComponentWrapper-981ab977.js → ComponentWrapper-9318cece.js} +21 -41
- package/dist/cjs/{Container-daf30918.js → Container-e699ea95.js} +1 -1
- package/dist/cjs/{DataSearch-c42d8681.js → DataSearch-99a6a2e8.js} +121 -293
- package/dist/cjs/DataSearch.js +11 -11
- package/dist/cjs/{DropDown-c479bbb0.js → DropDown-8984b544.js} +27 -48
- package/dist/cjs/DynamicRangeSlider.js +44 -93
- package/dist/cjs/{Flex-aa517a13.js → Flex-ddd7cb6b.js} +1 -3
- package/dist/cjs/{FormControlList-c195a592.js → FormControlList-bbb5cd24.js} +1 -3
- package/dist/cjs/{Input-e6603a7e.js → Input-ead4cd84.js} +14 -16
- package/dist/cjs/{ListItem-8c9e0d68.js → ListItem-5088bd6a.js} +2 -3
- package/dist/cjs/MultiDropdownList.js +41 -102
- package/dist/cjs/MultiList.js +35 -98
- package/dist/cjs/MultiRange.js +20 -52
- package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
- package/dist/cjs/{PreferencesConsumer-4707bd94.js → PreferencesConsumer-5d67b486.js} +8 -18
- package/dist/cjs/RangeInput.js +36 -52
- package/dist/cjs/RangeSlider.js +24 -48
- package/dist/cjs/ReactiveBase.js +34 -79
- package/dist/cjs/{ReactiveComponent-63ef70c2.js → ReactiveComponent-805201c6.js} +118 -301
- package/dist/cjs/ReactiveComponent.js +20 -20
- package/dist/cjs/ReactiveGoogleMap.js +167 -353
- package/dist/cjs/ReactiveList.js +88 -176
- package/dist/cjs/ResultCard.js +10 -18
- package/dist/cjs/ResultList.js +13 -24
- package/dist/cjs/SelectedFilters.js +16 -34
- package/dist/cjs/SingleDropdownList.js +35 -75
- package/dist/cjs/SingleList.js +29 -75
- package/dist/cjs/SingleRange.js +17 -40
- package/dist/cjs/StateProvider.js +6 -26
- package/dist/cjs/{Title-1de7d0f4.js → Title-16042ea0.js} +1 -1
- package/dist/cjs/ToggleButton.js +20 -58
- package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
- package/dist/cjs/{index-08f8dfa3.js → index-30126fd0.js} +39 -75
- package/dist/cjs/index.js +20 -21
- package/dist/cjs/initReactivesearch.js +49 -120
- package/dist/cjs/install.js +20 -20
- package/dist/cjs/{ssr-3027b848.js → ssr-f2fc1bf6.js} +1 -4
- package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-7cfc2f98.js} +6 -11
- package/dist/es/{Button-35aa984e.js → Button-153cd885.js} +1 -7
- package/dist/es/{CancelSvg-4cfae5fd.js → CancelSvg-e40552a5.js} +24 -58
- package/dist/es/{Card-450683f1.js → Card-19ad6d90.js} +2 -2
- package/dist/es/{ComponentWrapper-d5e814a4.js → ComponentWrapper-240450cc.js} +21 -41
- package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +1 -1
- package/dist/es/{DataSearch-d56bf07a.js → DataSearch-20f0d8f1.js} +121 -293
- package/dist/es/DataSearch.js +11 -11
- package/dist/es/{DropDown-05a644a5.js → DropDown-28ddce07.js} +27 -48
- package/dist/es/DynamicRangeSlider.js +44 -93
- package/dist/es/{Flex-1f0795c3.js → Flex-7c177a10.js} +1 -3
- package/dist/es/{FormControlList-c22d64f6.js → FormControlList-99797d0a.js} +1 -3
- package/dist/es/{Input-7a2a9fac.js → Input-c09c0b56.js} +14 -16
- package/dist/es/{ListItem-cad14c5e.js → ListItem-07888a65.js} +2 -3
- package/dist/es/MultiDropdownList.js +41 -102
- package/dist/es/MultiList.js +35 -98
- package/dist/es/MultiRange.js +20 -52
- package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
- package/dist/es/{PreferencesConsumer-4169deb1.js → PreferencesConsumer-bc097ebb.js} +8 -18
- package/dist/es/RangeInput.js +36 -52
- package/dist/es/RangeSlider.js +24 -48
- package/dist/es/ReactiveBase.js +34 -79
- package/dist/es/{ReactiveComponent-9e4721e1.js → ReactiveComponent-dd85aa9c.js} +118 -301
- package/dist/es/ReactiveComponent.js +20 -20
- package/dist/es/ReactiveGoogleMap.js +167 -353
- package/dist/es/ReactiveList.js +88 -176
- package/dist/es/ResultCard.js +10 -18
- package/dist/es/ResultList.js +13 -24
- package/dist/es/SelectedFilters.js +16 -34
- package/dist/es/SingleDropdownList.js +35 -75
- package/dist/es/SingleList.js +29 -75
- package/dist/es/SingleRange.js +17 -40
- package/dist/es/StateProvider.js +6 -26
- package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +1 -1
- package/dist/es/ToggleButton.js +20 -58
- package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
- package/dist/es/{index-99c5f9c9.js → index-0444a498.js} +39 -75
- package/dist/es/index.js +20 -21
- package/dist/es/initReactivesearch.js +49 -120
- package/dist/es/install.js +20 -20
- package/dist/es/{ssr-b2c0b401.js → ssr-03607d84.js} +1 -4
- package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-b8146772.js → vueTypes-8986b709.js} +6 -11
- package/package.json +1 -1
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
|
6
|
-
|
|
7
6
|
var alertBorder = function alertBorder(_ref) {
|
|
8
7
|
var theme = _ref.theme;
|
|
9
8
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tborder: 1px solid ", ";\n"])), theme.colors.alertColor);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
10
|
var input = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tline-height: 1.5;\n\tmin-height: 42px;\n\tpadding: 8px 12px;\n\tborder: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 0.9rem;\n\toutline: none;\n\theight: 100%;\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n"])));
|
|
13
|
-
|
|
14
11
|
var dark = function dark(theme) {
|
|
15
12
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\tborder-color: ", ";\n"])), theme.colors.borderColor);
|
|
16
13
|
};
|
|
17
|
-
|
|
18
14
|
var darkInput = function darkInput(_ref2) {
|
|
19
15
|
var theme = _ref2.theme;
|
|
20
16
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.textColor, dark(theme), theme.colors.backgroundColor);
|
|
21
17
|
};
|
|
22
|
-
|
|
23
18
|
var Input = styled('input')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n"])), input, function (_ref3) {
|
|
24
19
|
var themePreset = _ref3.themePreset,
|
|
25
|
-
|
|
20
|
+
theme = _ref3.theme;
|
|
26
21
|
return themePreset === 'dark' && darkInput({
|
|
27
22
|
theme: theme
|
|
28
23
|
});
|
|
@@ -31,39 +26,42 @@ var Input = styled('input')(_templateObject5 || (_templateObject5 = _taggedTempl
|
|
|
31
26
|
}, function (props) {
|
|
32
27
|
return props.showIcon && props.iconPosition === 'right' && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])));
|
|
33
28
|
}, function (props) {
|
|
34
|
-
return (
|
|
29
|
+
return (
|
|
30
|
+
// for clear icon
|
|
35
31
|
props.showClear && css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])))
|
|
36
32
|
);
|
|
37
33
|
}, function (props) {
|
|
38
|
-
return (
|
|
34
|
+
return (
|
|
35
|
+
// for voice search icon
|
|
39
36
|
props.showVoiceSearch && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])))
|
|
40
37
|
);
|
|
41
38
|
}, function (props) {
|
|
42
|
-
return (
|
|
39
|
+
return (
|
|
40
|
+
// for clear icon with search icon
|
|
43
41
|
props.showClear && props.showIcon && props.iconPosition === 'right' && css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
|
|
44
42
|
);
|
|
45
43
|
}, function (props) {
|
|
46
|
-
return (
|
|
44
|
+
return (
|
|
45
|
+
// for voice search icon with search icon
|
|
47
46
|
props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
|
|
48
47
|
);
|
|
49
48
|
}, function (props) {
|
|
50
|
-
return (
|
|
49
|
+
return (
|
|
50
|
+
// for voice search icon with clear icon
|
|
51
51
|
props.showVoiceSearch && props.showIcon && css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
|
|
52
52
|
);
|
|
53
53
|
}, function (props) {
|
|
54
|
-
return (
|
|
54
|
+
return (
|
|
55
|
+
// for clear icon with search icon and voice search
|
|
55
56
|
props.showClear && props.showIcon && props.showVoiceSearch && props.iconPosition === 'right' && css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 90px;\n\t\t"])))
|
|
56
57
|
);
|
|
57
58
|
}, function (props) {
|
|
58
59
|
return props.alert && alertBorder;
|
|
59
60
|
});
|
|
60
|
-
|
|
61
61
|
var suggestions = function suggestions(themePreset, theme) {
|
|
62
62
|
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 402px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark(theme));
|
|
63
63
|
};
|
|
64
|
-
|
|
65
64
|
var suggestionsContainer = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
66
|
-
|
|
67
65
|
var noSuggestions = function noSuggestions(themePreset, theme) {
|
|
68
66
|
return css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t", "\n"])), themePreset === 'dark' && theme && dark(theme));
|
|
69
67
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { lighten } from 'polished';
|
|
5
|
-
import './Title-
|
|
5
|
+
import './Title-863dfa42.js';
|
|
6
6
|
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
8
8
|
var container = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tborder-radius: 0.25rem;\n\toverflow: hidden;\n"])));
|
|
@@ -30,7 +30,6 @@ var ListItem = styled('a')(_templateObject4 || (_templateObject4 = _taggedTempla
|
|
|
30
30
|
if (props.image) {
|
|
31
31
|
return props.small ? 'calc(100% - 100px)' : 'calc(100% - 160px)';
|
|
32
32
|
}
|
|
33
|
-
|
|
34
33
|
return '100%';
|
|
35
34
|
}, function (props) {
|
|
36
35
|
return props.image ? '10px' : 0;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
3
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { l as loadMoreContainer, B as Button } from './Button-
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { l as loadMoreContainer, B as Button } from './Button-153cd885.js';
|
|
9
|
+
import { t as types } from './vueTypes-8986b709.js';
|
|
10
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
11
11
|
import 'redux';
|
|
12
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-0444a498.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
|
|
14
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
|
|
15
15
|
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
16
|
-
import { T as Title } from './Title-
|
|
17
|
-
import './CancelSvg-
|
|
18
|
-
import './Input-
|
|
16
|
+
import { T as Title } from './Title-863dfa42.js';
|
|
17
|
+
import './CancelSvg-e40552a5.js';
|
|
18
|
+
import './Input-c09c0b56.js';
|
|
19
19
|
import 'compute-scroll-into-view';
|
|
20
|
-
import { C as Container } from './Container-
|
|
20
|
+
import { C as Container } from './Container-d00219f7.js';
|
|
21
21
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
22
|
-
import { g as getAggsQuery } from './utils-
|
|
23
|
-
import { D as Dropdown } from './DropDown-
|
|
22
|
+
import { g as getAggsQuery } from './utils-9e5a16a1.js';
|
|
23
|
+
import { D as Dropdown } from './DropDown-28ddce07.js';
|
|
24
24
|
|
|
25
25
|
var updateQuery = Actions.updateQuery,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
setQueryOptions = Actions.setQueryOptions,
|
|
27
|
+
setCustomQuery = Actions.setCustomQuery,
|
|
28
|
+
setDefaultQuery = Actions.setDefaultQuery;
|
|
29
29
|
var isEqual = helper.isEqual,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
getQueryOptions = helper.getQueryOptions,
|
|
31
|
+
checkValueChange = helper.checkValueChange,
|
|
32
|
+
checkPropChange = helper.checkPropChange,
|
|
33
|
+
getClassName = helper.getClassName,
|
|
34
|
+
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
35
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
36
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
37
37
|
var MultiDropdownList = {
|
|
38
38
|
name: 'MultiDropdownList',
|
|
39
39
|
data: function data() {
|
|
@@ -90,16 +90,14 @@ var MultiDropdownList = {
|
|
|
90
90
|
if (!this.enableAppbase && this.$props.index) {
|
|
91
91
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
92
92
|
}
|
|
93
|
-
|
|
94
93
|
var props = this.$props;
|
|
95
|
-
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : [];
|
|
96
|
-
|
|
94
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : [];
|
|
95
|
+
// Set custom and default queries in store
|
|
97
96
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
98
97
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
99
98
|
},
|
|
100
99
|
beforeMount: function beforeMount() {
|
|
101
100
|
this.updateQueryOptions(this.$props);
|
|
102
|
-
|
|
103
101
|
if (this.selectedValue) {
|
|
104
102
|
this.setValue(this.selectedValue, true);
|
|
105
103
|
} else if (this.$props.value) {
|
|
@@ -111,33 +109,27 @@ var MultiDropdownList = {
|
|
|
111
109
|
watch: {
|
|
112
110
|
selectedValue: function selectedValue(newVal) {
|
|
113
111
|
var _this = this;
|
|
114
|
-
|
|
115
112
|
var selectedValue = Object.keys(this.$data.currentValue);
|
|
116
|
-
|
|
117
113
|
if (this.$props.selectAllLabel) {
|
|
118
114
|
selectedValue = selectedValue.filter(function (val) {
|
|
119
115
|
return val !== _this.$props.selectAllLabel;
|
|
120
116
|
});
|
|
121
|
-
|
|
122
117
|
if (this.$data.currentValue[this.$props.selectAllLabel]) {
|
|
123
118
|
selectedValue = [this.$props.selectAllLabel];
|
|
124
119
|
}
|
|
125
120
|
}
|
|
126
|
-
|
|
127
121
|
if (!isEqual(selectedValue, newVal)) {
|
|
128
122
|
this.setValue(newVal || [], true);
|
|
129
123
|
}
|
|
130
124
|
},
|
|
131
125
|
options: function options(newVal, oldVal) {
|
|
132
126
|
var _this2 = this;
|
|
133
|
-
|
|
134
127
|
if (newVal) {
|
|
135
128
|
checkPropChange(oldVal, newVal, function () {
|
|
136
129
|
var _this2$$props = _this2.$props,
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
showLoadMore = _this2$$props.showLoadMore,
|
|
131
|
+
dataField = _this2$$props.dataField;
|
|
139
132
|
var modifiedOptions = _this2.$data.modifiedOptions;
|
|
140
|
-
|
|
141
133
|
if (showLoadMore) {
|
|
142
134
|
// append options with showLoadMore
|
|
143
135
|
var buckets = newVal[dataField].buckets;
|
|
@@ -148,7 +140,6 @@ var MultiDropdownList = {
|
|
|
148
140
|
};
|
|
149
141
|
}));
|
|
150
142
|
var after = newVal[dataField].after_key; // detect the last bucket by checking if the next set of buckets were empty
|
|
151
|
-
|
|
152
143
|
var isLastBucket = !buckets.length;
|
|
153
144
|
_this2.after = {
|
|
154
145
|
after: after
|
|
@@ -193,41 +184,35 @@ var MultiDropdownList = {
|
|
|
193
184
|
render: function render() {
|
|
194
185
|
var h = arguments[0];
|
|
195
186
|
var _this$$props = this.$props,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
187
|
+
showLoadMore = _this$$props.showLoadMore,
|
|
188
|
+
loadMoreLabel = _this$$props.loadMoreLabel,
|
|
189
|
+
renderItem = _this$$props.renderItem,
|
|
190
|
+
renderError = _this$$props.renderError,
|
|
191
|
+
renderLabel = _this$$props.renderLabel;
|
|
201
192
|
var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
|
|
202
193
|
var renderErrorCalc = this.$scopedSlots.renderError || renderError;
|
|
203
194
|
var renderLabelCalc = this.$scopedSlots.renderLabel || renderLabel;
|
|
204
195
|
var isLastBucket = this.$data.isLastBucket;
|
|
205
196
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
206
197
|
var selectAll = [];
|
|
207
|
-
|
|
208
198
|
if (renderErrorCalc && this.error) {
|
|
209
199
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
210
200
|
}
|
|
211
|
-
|
|
212
201
|
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
213
202
|
if (renderNoResults && isFunction(renderNoResults)) {
|
|
214
203
|
return h("div", [renderNoResults()]);
|
|
215
204
|
}
|
|
216
|
-
|
|
217
205
|
if (renderNoResults && !isFunction(renderNoResults)) {
|
|
218
206
|
return renderNoResults;
|
|
219
207
|
}
|
|
220
|
-
|
|
221
208
|
return null;
|
|
222
209
|
}
|
|
223
|
-
|
|
224
210
|
if (this.$props.selectAllLabel) {
|
|
225
211
|
selectAll = [{
|
|
226
212
|
key: this.$props.selectAllLabel,
|
|
227
213
|
doc_count: this.totalDocumentCount
|
|
228
214
|
}];
|
|
229
215
|
}
|
|
230
|
-
|
|
231
216
|
return h(Container, {
|
|
232
217
|
"class": this.$props.className
|
|
233
218
|
}, [this.$props.title && h(Title, {
|
|
@@ -273,7 +258,6 @@ var MultiDropdownList = {
|
|
|
273
258
|
methods: {
|
|
274
259
|
handleChange: function handleChange(item) {
|
|
275
260
|
var value = this.$props.value;
|
|
276
|
-
|
|
277
261
|
if (value === undefined) {
|
|
278
262
|
this.setValue(item);
|
|
279
263
|
} else {
|
|
@@ -283,19 +267,15 @@ var MultiDropdownList = {
|
|
|
283
267
|
},
|
|
284
268
|
setValue: function setValue(value, isDefaultValue, props) {
|
|
285
269
|
var _this3 = this;
|
|
286
|
-
|
|
287
270
|
if (isDefaultValue === void 0) {
|
|
288
271
|
isDefaultValue = false;
|
|
289
272
|
}
|
|
290
|
-
|
|
291
273
|
if (props === void 0) {
|
|
292
274
|
props = this.$props;
|
|
293
275
|
}
|
|
294
|
-
|
|
295
276
|
var selectAllLabel = this.$props.selectAllLabel;
|
|
296
277
|
var currentValue = this.$data.currentValue;
|
|
297
278
|
var finalValues = null;
|
|
298
|
-
|
|
299
279
|
if (selectAllLabel && value.includes(selectAllLabel)) {
|
|
300
280
|
if (currentValue[selectAllLabel]) {
|
|
301
281
|
currentValue = {};
|
|
@@ -310,71 +290,55 @@ var MultiDropdownList = {
|
|
|
310
290
|
} else if (isDefaultValue) {
|
|
311
291
|
finalValues = value;
|
|
312
292
|
currentValue = {};
|
|
313
|
-
|
|
314
293
|
if (Array.isArray(value)) {
|
|
315
294
|
value.forEach(function (item) {
|
|
316
295
|
currentValue[item] = true;
|
|
317
296
|
});
|
|
318
297
|
}
|
|
319
|
-
|
|
320
298
|
if (selectAllLabel && selectAllLabel in currentValue) {
|
|
321
299
|
var _currentValue = currentValue,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
300
|
+
del = _currentValue[selectAllLabel],
|
|
301
|
+
obj = _objectWithoutPropertiesLoose(_currentValue, [selectAllLabel].map(_toPropertyKey));
|
|
325
302
|
currentValue = _extends({}, obj);
|
|
326
303
|
}
|
|
327
304
|
} else {
|
|
328
305
|
if (currentValue[value]) {
|
|
329
306
|
var _currentValue2 = currentValue,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
307
|
+
_del = _currentValue2[value],
|
|
308
|
+
rest = _objectWithoutPropertiesLoose(_currentValue2, [value].map(_toPropertyKey));
|
|
333
309
|
currentValue = _extends({}, rest);
|
|
334
310
|
} else {
|
|
335
311
|
currentValue[value] = true;
|
|
336
312
|
}
|
|
337
|
-
|
|
338
313
|
if (selectAllLabel && selectAllLabel in currentValue) {
|
|
339
314
|
var _currentValue3 = currentValue,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
315
|
+
_del2 = _currentValue3[selectAllLabel],
|
|
316
|
+
_obj = _objectWithoutPropertiesLoose(_currentValue3, [selectAllLabel].map(_toPropertyKey));
|
|
343
317
|
currentValue = _extends({}, _obj);
|
|
344
318
|
}
|
|
345
|
-
|
|
346
319
|
finalValues = Object.keys(currentValue);
|
|
347
320
|
}
|
|
348
|
-
|
|
349
321
|
var performUpdate = function performUpdate() {
|
|
350
322
|
_this3.currentValue = _extends({}, currentValue);
|
|
351
|
-
|
|
352
323
|
_this3.updateQueryHandler(finalValues, props);
|
|
353
|
-
|
|
354
324
|
_this3.$emit('valueChange', finalValues);
|
|
355
|
-
|
|
356
325
|
_this3.$emit('value-change', finalValues);
|
|
357
326
|
};
|
|
358
|
-
|
|
359
327
|
checkValueChange(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
360
328
|
},
|
|
361
329
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
362
330
|
var query = MultiDropdownList.defaultQuery(value, props);
|
|
363
|
-
|
|
364
331
|
if (this.defaultQuery) {
|
|
365
332
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
366
333
|
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
367
|
-
|
|
368
334
|
if (defaultQueryObj) {
|
|
369
335
|
query = defaultQueryObj;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
336
|
+
}
|
|
337
|
+
// Update calculated default query in store
|
|
373
338
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
374
339
|
var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
375
340
|
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
376
341
|
}
|
|
377
|
-
|
|
378
342
|
this.updateQuery({
|
|
379
343
|
componentId: this.internalComponent,
|
|
380
344
|
query: query,
|
|
@@ -385,7 +349,6 @@ var MultiDropdownList = {
|
|
|
385
349
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
386
350
|
var customQuery = props.customQuery;
|
|
387
351
|
var query = MultiDropdownList.defaultQuery(value, props);
|
|
388
|
-
|
|
389
352
|
if (customQuery) {
|
|
390
353
|
var customQueryCalc = customQuery(value, props);
|
|
391
354
|
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
@@ -393,7 +356,6 @@ var MultiDropdownList = {
|
|
|
393
356
|
var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
394
357
|
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
395
358
|
}
|
|
396
|
-
|
|
397
359
|
this.updateQuery({
|
|
398
360
|
componentId: props.componentId,
|
|
399
361
|
query: query,
|
|
@@ -416,15 +378,12 @@ var MultiDropdownList = {
|
|
|
416
378
|
if (addAfterKey === void 0) {
|
|
417
379
|
addAfterKey = false;
|
|
418
380
|
}
|
|
419
|
-
|
|
420
381
|
// when using composite aggs flush the current options for a fresh query
|
|
421
382
|
if (props.showLoadMore && !addAfterKey) {
|
|
422
383
|
this.modifiedOptions = [];
|
|
423
384
|
} // for a new query due to other changes don't append after to get fresh results
|
|
424
385
|
|
|
425
|
-
|
|
426
386
|
var queryOptions = MultiDropdownList.generateQueryOptions(props, addAfterKey ? this.$data.after : {});
|
|
427
|
-
|
|
428
387
|
if (props.defaultQuery) {
|
|
429
388
|
var value = Object.keys(this.$data.currentValue);
|
|
430
389
|
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
@@ -440,7 +399,6 @@ var MultiDropdownList = {
|
|
|
440
399
|
if (downshiftProps === void 0) {
|
|
441
400
|
downshiftProps = {};
|
|
442
401
|
}
|
|
443
|
-
|
|
444
402
|
var currentValue = this.$data.currentValue;
|
|
445
403
|
var data = {
|
|
446
404
|
error: this.error,
|
|
@@ -460,21 +418,16 @@ var MultiDropdownList = {
|
|
|
460
418
|
}
|
|
461
419
|
}
|
|
462
420
|
};
|
|
463
|
-
|
|
464
421
|
MultiDropdownList.defaultQuery = function (value, props) {
|
|
465
422
|
var query = null;
|
|
466
423
|
var queryFormat = props.queryFormat;
|
|
467
|
-
|
|
468
424
|
if (queryFormat === undefined) {
|
|
469
425
|
queryFormat = 'or';
|
|
470
426
|
}
|
|
471
|
-
|
|
472
427
|
var type = queryFormat === 'or' ? 'terms' : 'term';
|
|
473
|
-
|
|
474
428
|
if (!Array.isArray(value) || value.length === 0) {
|
|
475
429
|
return null;
|
|
476
430
|
}
|
|
477
|
-
|
|
478
431
|
if (props.selectAllLabel && value.includes(props.selectAllLabel)) {
|
|
479
432
|
if (props.showMissing) {
|
|
480
433
|
query = {
|
|
@@ -489,16 +442,13 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
489
442
|
}
|
|
490
443
|
} else if (value) {
|
|
491
444
|
var listQuery;
|
|
492
|
-
|
|
493
445
|
if (queryFormat === 'or') {
|
|
494
446
|
if (props.showMissing) {
|
|
495
447
|
var _type, _ref;
|
|
496
|
-
|
|
497
448
|
var hasMissingTerm = value.includes(props.missingLabel);
|
|
498
449
|
var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
|
|
499
450
|
return item !== props.missingLabel;
|
|
500
451
|
}), _type), _ref)];
|
|
501
|
-
|
|
502
452
|
if (hasMissingTerm) {
|
|
503
453
|
should = should.concat({
|
|
504
454
|
bool: {
|
|
@@ -510,7 +460,6 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
510
460
|
}
|
|
511
461
|
});
|
|
512
462
|
}
|
|
513
|
-
|
|
514
463
|
listQuery = {
|
|
515
464
|
bool: {
|
|
516
465
|
should: should
|
|
@@ -518,14 +467,12 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
518
467
|
};
|
|
519
468
|
} else {
|
|
520
469
|
var _type2, _listQuery;
|
|
521
|
-
|
|
522
470
|
listQuery = (_listQuery = {}, _listQuery[type] = (_type2 = {}, _type2[props.dataField] = value, _type2), _listQuery);
|
|
523
471
|
}
|
|
524
472
|
} else {
|
|
525
473
|
// adds a sub-query with must as an array of objects for each term/value
|
|
526
474
|
var queryArray = value.map(function (item) {
|
|
527
475
|
var _type3, _ref2;
|
|
528
|
-
|
|
529
476
|
return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
|
|
530
477
|
});
|
|
531
478
|
listQuery = {
|
|
@@ -534,10 +481,8 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
534
481
|
}
|
|
535
482
|
};
|
|
536
483
|
}
|
|
537
|
-
|
|
538
484
|
query = value.length ? listQuery : null;
|
|
539
485
|
}
|
|
540
|
-
|
|
541
486
|
if (query && props.nestedField) {
|
|
542
487
|
return {
|
|
543
488
|
query: {
|
|
@@ -548,10 +493,8 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
548
493
|
}
|
|
549
494
|
};
|
|
550
495
|
}
|
|
551
|
-
|
|
552
496
|
return query;
|
|
553
497
|
};
|
|
554
|
-
|
|
555
498
|
MultiDropdownList.generateQueryOptions = function (props, after) {
|
|
556
499
|
var queryOptions = getQueryOptions(props);
|
|
557
500
|
return props.showLoadMore ? getCompositeAggsQuery({
|
|
@@ -560,11 +503,9 @@ MultiDropdownList.generateQueryOptions = function (props, after) {
|
|
|
560
503
|
after: after
|
|
561
504
|
}) : getAggsQuery(queryOptions, props);
|
|
562
505
|
};
|
|
563
|
-
|
|
564
506
|
MultiDropdownList.hasInternalComponent = function () {
|
|
565
507
|
return true;
|
|
566
508
|
};
|
|
567
|
-
|
|
568
509
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
569
510
|
return {
|
|
570
511
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -578,7 +519,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
578
519
|
enableAppbase: state.config.enableAppbase
|
|
579
520
|
};
|
|
580
521
|
};
|
|
581
|
-
|
|
582
522
|
var mapDispatchtoProps = {
|
|
583
523
|
setQueryOptions: setQueryOptions,
|
|
584
524
|
updateQuery: updateQuery,
|
|
@@ -589,12 +529,11 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
|
|
|
589
529
|
componentType: componentTypes.multiDropdownList,
|
|
590
530
|
internalComponent: MultiDropdownList.hasInternalComponent()
|
|
591
531
|
}));
|
|
592
|
-
|
|
593
532
|
MultiDropdownList.install = function (Vue) {
|
|
594
533
|
Vue.component(MultiDropdownList.name, ListConnected);
|
|
595
|
-
};
|
|
596
|
-
|
|
534
|
+
};
|
|
597
535
|
|
|
536
|
+
// Add componentType for SSR
|
|
598
537
|
MultiDropdownList.componentType = componentTypes.multiDropdownList;
|
|
599
538
|
|
|
600
539
|
export default MultiDropdownList;
|