@appbaseio/reactivesearch-vue 3.0.0-alpha.7 → 3.0.0-rc

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.
Files changed (35) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +3042 -1181
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Flex-d5675ea6.js → Flex-ddde6d26.js} +3 -1
  6. package/dist/cjs/{ListItem-23af8974.js → ListItem-7a682970.js} +6 -1
  7. package/dist/cjs/MultiDropdownList.js +1 -1
  8. package/dist/cjs/MultiList.js +1 -1
  9. package/dist/cjs/RangeInput.js +1 -1
  10. package/dist/cjs/ReactiveComponent.js +297 -43
  11. package/dist/cjs/ReactiveList.js +2 -2
  12. package/dist/cjs/ResultList.js +1 -1
  13. package/dist/cjs/SingleDropdownList.js +1 -1
  14. package/dist/cjs/SingleList.js +1 -1
  15. package/dist/cjs/index.js +13 -10
  16. package/dist/cjs/{ReactiveComponent-8180c806.js → install-2c548585.js} +752 -240
  17. package/dist/cjs/install.js +24 -28
  18. package/dist/cjs/{utils-36b1b880.js → utils-c9bd5628.js} +9 -0
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/es/{Flex-a08e22d7.js → Flex-25792bc3.js} +3 -1
  21. package/dist/es/{ListItem-1cb1b4de.js → ListItem-e3c6acf4.js} +6 -1
  22. package/dist/es/MultiDropdownList.js +1 -1
  23. package/dist/es/MultiList.js +1 -1
  24. package/dist/es/RangeInput.js +1 -1
  25. package/dist/es/ReactiveComponent.js +298 -42
  26. package/dist/es/ReactiveList.js +2 -2
  27. package/dist/es/ResultList.js +1 -1
  28. package/dist/es/SingleDropdownList.js +1 -1
  29. package/dist/es/SingleList.js +1 -1
  30. package/dist/es/index.js +7 -6
  31. package/dist/es/{ReactiveComponent-f78ff2cd.js → install-44a07e7a.js} +761 -251
  32. package/dist/es/install.js +22 -30
  33. package/dist/es/{utils-9e5a16a1.js → utils-d7dd4f4e.js} +9 -1
  34. package/dist/es/version.js +1 -1
  35. package/package.json +1 -1
@@ -15,24 +15,24 @@ require('polished');
15
15
  require('./Button-d4da7470.js');
16
16
  require('./vueTypes-1bf00978.js');
17
17
  require('./Pagination-b953a80a.js');
18
- var ReactiveList = require('./ReactiveList.js');
18
+ require('./ReactiveList.js');
19
19
  require('@appbaseio/reactivecore/lib/utils/transform');
20
20
  require('redux');
21
21
  require('./index-1481798c.js');
22
22
  require('./ComponentWrapper-2dc930e1.js');
23
23
  require('./PreferencesConsumer-2c69ac61.js');
24
24
  require('./Title-8802a218.js');
25
- require('./ListItem-23af8974.js');
25
+ require('./ListItem-7a682970.js');
26
26
  require('./Card-63968d94.js');
27
- require('./Flex-d5675ea6.js');
27
+ require('./Flex-ddde6d26.js');
28
28
  require('@appbaseio/reactivecore/lib');
29
29
  require('@appbaseio/reactivecore/lib/actions/analytics');
30
30
  require('appbase-js');
31
31
  require('@appbaseio/analytics');
32
32
  require('url-search-params-polyfill');
33
- var ReactiveBase = require('./ReactiveBase.js');
33
+ require('./ReactiveBase.js');
34
34
  require('hotkeys-js');
35
- var ReactiveComponent = require('./ReactiveComponent-8180c806.js');
35
+ var install = require('./install-2c548585.js');
36
36
  require('./DropDown-f48bea16.js');
37
37
  require('./Input-497be42a.js');
38
38
  require('compute-scroll-into-view');
@@ -40,29 +40,25 @@ require('./Container-29f049b2.js');
40
40
  require('vue-highlight-words');
41
41
  require('@appbaseio/reactivecore/lib/utils/suggestions');
42
42
  require('./FormControlList-fadd792f.js');
43
- require('./utils-36b1b880.js');
44
- var SingleList = require('./SingleList.js');
45
- var MultiList = require('./MultiList.js');
46
- var SingleDropdownList = require('./SingleDropdownList.js');
47
- var MultiDropdownList = require('./MultiDropdownList.js');
48
- var ToggleButton = require('./ToggleButton.js');
43
+ require('./utils-c9bd5628.js');
44
+ require('./SingleList.js');
45
+ require('./MultiList.js');
46
+ require('@appbaseio/reactivecore/lib/utils/types');
47
+ require('./SingleDropdownList.js');
48
+ require('./MultiDropdownList.js');
49
+ require('./ToggleButton.js');
50
+ require('./ReactiveComponent.js');
49
51
  require('./ssr-8dd13d43.js');
50
- var DynamicRangeSlider = require('./DynamicRangeSlider.js');
51
- var SingleRange = require('./SingleRange.js');
52
- var MultiRange = require('./MultiRange.js');
53
- var RangeSlider = require('./RangeSlider.js');
54
- var RangeInput = require('./RangeInput.js');
55
- var SelectedFilters = require('./SelectedFilters.js');
56
- var ResultCard = require('./ResultCard.js');
57
- var ResultList = require('./ResultList.js');
58
- var StateProvider = require('./StateProvider.js');
52
+ require('./DynamicRangeSlider.js');
53
+ require('./SingleRange.js');
54
+ require('./MultiRange.js');
55
+ require('./RangeSlider.js');
56
+ require('./RangeInput.js');
57
+ require('./SelectedFilters.js');
58
+ require('./ResultCard.js');
59
+ require('./ResultList.js');
60
+ require('./StateProvider.js');
59
61
 
60
- var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, ReactiveComponent.SearchBox, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.ReactiveComponent, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default];
61
- function install (Vue) {
62
- components.map(function (component) {
63
- Vue.use(component);
64
- return null;
65
- });
66
- }
67
62
 
68
- exports.default = install;
63
+
64
+ exports.default = install.install;
@@ -50,5 +50,14 @@ var getAggsQuery = function getAggsQuery(query, props) {
50
50
  }
51
51
  return _rollupPluginBabelHelpers._extends({}, clonedQuery, extractQuery(props));
52
52
  };
53
+ var sanitizeObject = function sanitizeObject(obj) {
54
+ return JSON.parse(JSON.stringify(obj, function (key, value) {
55
+ return (
56
+ // eslint-disable-next-line eqeqeq
57
+ value === null || value == {} || value === false ? undefined : value
58
+ );
59
+ }));
60
+ };
53
61
 
54
62
  exports.getAggsQuery = getAggsQuery;
63
+ exports.sanitizeObject = sanitizeObject;
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "3.0.0-alpha.7";
5
+ var version = "3.0.0-rc";
6
6
 
7
7
  exports.default = version;
@@ -12,7 +12,7 @@ var border = function border(_ref) {
12
12
  colors = _ref$theme$colors === void 0 ? {} : _ref$theme$colors;
13
13
  return "\n\tborder: 1px solid " + (colors.borderColor || '#ccc') + ";\n";
14
14
  };
15
- var Flex = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
15
+ var Flex = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
16
16
  return props.inline ? 'inline-flex' : 'flex';
17
17
  }, function (props) {
18
18
  return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
@@ -28,6 +28,8 @@ var Flex = styled('div')(_templateObject || (_templateObject = _taggedTemplateLi
28
28
  return props.justifyContent && "\n\t\t\tjustify-content: " + props.justifyContent + ";\n\t\t";
29
29
  }, function (props) {
30
30
  return props.alignItems && "\n\t\t\talign-items: " + props.alignItems + ";\n\t\t";
31
+ }, function (props) {
32
+ return props.gap && "\n\t\t\tgap: " + props.gap + ";\n\t\t";
31
33
  }, function (props) {
32
34
  return props.flex && "\n\t\t\tflex: " + props.flex + ";\n\t\t";
33
35
  }, function (props) {
@@ -12,7 +12,7 @@ var Image = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplat
12
12
  }, function (props) {
13
13
  return "url(" + props.src + ")";
14
14
  });
15
- var ListItem = styled('a')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n"])), function (_ref) {
15
+ var ListItem = styled('a')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n\n\t", "\n"])), function (_ref) {
16
16
  var theme = _ref.theme;
17
17
  return theme.colors.backgroundColor ? lighten(0.1, theme.colors.backgroundColor) : '#fff';
18
18
  }, function (_ref2) {
@@ -33,6 +33,11 @@ var ListItem = styled('a')(_templateObject3 || (_templateObject3 = _taggedTempla
33
33
  return '100%';
34
34
  }, function (props) {
35
35
  return props.image ? '10px' : 0;
36
+ }, function (props) {
37
+ if (props.isTreeListItem) {
38
+ return 'border-bottom: none; width:max-content; cursor:pointer; padding: 5px 12px;';
39
+ }
40
+ return '';
36
41
  });
37
42
 
38
43
  export { Image as I, ListItem as L, container as c };
@@ -20,7 +20,7 @@ import './Input-f7499ef8.js';
20
20
  import 'compute-scroll-into-view';
21
21
  import { C as Container } from './Container-d00219f7.js';
22
22
  import '@appbaseio/reactivecore/lib/utils/suggestions';
23
- import { g as getAggsQuery } from './utils-9e5a16a1.js';
23
+ import { g as getAggsQuery } from './utils-d7dd4f4e.js';
24
24
 
25
25
  function _isSlot(s) {
26
26
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
@@ -17,7 +17,7 @@ import { I as Input } from './Input-f7499ef8.js';
17
17
  import { C as Container } from './Container-d00219f7.js';
18
18
  import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
19
19
  import { U as UL, C as Checkbox } from './FormControlList-fe6eaee4.js';
20
- import { g as getAggsQuery } from './utils-9e5a16a1.js';
20
+ import { g as getAggsQuery } from './utils-d7dd4f4e.js';
21
21
 
22
22
  var updateQuery = Actions.updateQuery,
23
23
  setQueryOptions = Actions.setQueryOptions,
@@ -14,7 +14,7 @@ import { c as connect } from './index-4520a598.js';
14
14
  import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
15
15
  import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
16
16
  import './Title-863dfa42.js';
17
- import { F as Flex } from './Flex-a08e22d7.js';
17
+ import { F as Flex } from './Flex-25792bc3.js';
18
18
  import { I as Input } from './Input-f7499ef8.js';
19
19
  import { C as Container } from './Container-d00219f7.js';
20
20
  import './ssr-c630ccb9.js';
@@ -1,44 +1,300 @@
1
- import '@appbaseio/reactivecore';
2
- import '@appbaseio/reactivecore/lib/utils/constants';
3
- import '@vue/babel-helper-vue-transform-on';
4
- import './_rollupPluginBabelHelpers-ded08042.js';
5
- import 'vue';
6
- import 'vue-types';
7
- import '@appbaseio/reactivecore/lib/utils/helper';
8
- import '@appbaseio/vue-emotion';
9
- import '@emotion/css';
10
- import 'polished';
11
- import './Button-fd869491.js';
12
- import './vueTypes-f1923c72.js';
13
- import './Pagination-c2745bec.js';
14
- import './ReactiveList.js';
1
+ import { Actions, helper } from '@appbaseio/reactivecore';
2
+ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
+ import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
4
+ import { createVNode, h } from 'vue';
5
+ import VueTypes from 'vue-types';
6
+ import { t as types } from './vueTypes-f1923c72.js';
15
7
  import '@appbaseio/reactivecore/lib/utils/transform';
16
8
  import 'redux';
17
- import './index-4520a598.js';
18
- import './ComponentWrapper-3a215eed.js';
19
- import './PreferencesConsumer-24e88f3b.js';
20
- import './Title-863dfa42.js';
21
- import './ListItem-1cb1b4de.js';
22
- import './Card-54b9e7a0.js';
23
- import './Flex-a08e22d7.js';
24
- import 'hotkeys-js';
25
- export { R as default } from './ReactiveComponent-f78ff2cd.js';
26
- import './DropDown-7174661a.js';
27
- import './Input-f7499ef8.js';
28
- import 'compute-scroll-into-view';
29
- import './Container-d00219f7.js';
30
- import 'vue-highlight-words';
31
- import '@appbaseio/reactivecore/lib/utils/suggestions';
32
- import './FormControlList-fe6eaee4.js';
33
- import './utils-9e5a16a1.js';
34
- import './SingleList.js';
35
- import './MultiList.js';
36
- import './SingleDropdownList.js';
37
- import './MultiDropdownList.js';
38
- import './ToggleButton.js';
39
- import './ssr-c630ccb9.js';
40
- import './DynamicRangeSlider.js';
41
- import './SingleRange.js';
42
- import './MultiRange.js';
43
- import './RangeSlider.js';
44
- import './RangeInput.js';
9
+ import { j as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-4520a598.js';
10
+ import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
11
+ import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
12
+
13
+ var _excluded = ["options"];
14
+ var updateQuery = Actions.updateQuery,
15
+ setQueryOptions = Actions.setQueryOptions,
16
+ setCustomQuery = Actions.setCustomQuery,
17
+ setDefaultQuery = Actions.setDefaultQuery;
18
+ var parseHits = helper.parseHits,
19
+ isEqual = helper.isEqual,
20
+ getCompositeAggsQuery = helper.getCompositeAggsQuery,
21
+ getResultStats = helper.getResultStats,
22
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
23
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
24
+ var ReactiveComponent = {
25
+ name: 'ReactiveComponent',
26
+ props: {
27
+ componentId: types.stringRequired,
28
+ aggregationField: types.string,
29
+ aggregationSize: VueTypes.number,
30
+ size: VueTypes.number,
31
+ defaultQuery: types.func,
32
+ customQuery: types.func,
33
+ filterLabel: types.string,
34
+ react: types.react,
35
+ showFilter: VueTypes.bool.def(true),
36
+ URLParams: VueTypes.bool.def(false),
37
+ distinctField: types.string,
38
+ distinctFieldConfig: types.props,
39
+ index: VueTypes.string,
40
+ endpoint: types.endpointConfig
41
+ },
42
+ created: function created() {
43
+ var _this = this;
44
+ var props = this.$props;
45
+ this.internalComponent = null;
46
+ this.$defaultQuery = null;
47
+ // Set custom query in store
48
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
49
+ var customQuery = props.customQuery,
50
+ componentId = props.componentId,
51
+ filterLabel = props.filterLabel,
52
+ showFilter = props.showFilter,
53
+ URLParams = props.URLParams;
54
+ if (customQuery) {
55
+ var calcCustomQuery = customQuery(this.selectedValue, props);
56
+ var query = extractQueryFromCustomQuery(calcCustomQuery);
57
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
58
+ if (customQueryOptions) {
59
+ this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
60
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
61
+ this.updateQuery({
62
+ componentId: componentId,
63
+ query: query,
64
+ value: this.selectedValue || null,
65
+ label: filterLabel,
66
+ showFilter: showFilter,
67
+ URLParams: URLParams
68
+ });
69
+ }
70
+ this.setQuery = function (_ref) {
71
+ var options = _ref.options,
72
+ obj = _objectWithoutPropertiesLoose(_ref, _excluded);
73
+ var queryToBeSet = obj.query;
74
+
75
+ // when enableAppbase is true, Backend throws error because of repeated query in request body
76
+ if (queryToBeSet && queryToBeSet.query) {
77
+ queryToBeSet = queryToBeSet.query;
78
+ }
79
+ var customQueryCalc = _extends({}, options, {
80
+ query: queryToBeSet
81
+ });
82
+ var rsAPIQuery = customQueryCalc;
83
+ // handle stored queries
84
+ if (queryToBeSet && queryToBeSet.id) {
85
+ rsAPIQuery = queryToBeSet;
86
+ }
87
+ // Update customQuery field for RS API
88
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
89
+ if (options) {
90
+ _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
91
+ }
92
+ _this.updateQuery(_extends({}, obj, {
93
+ query: customQueryCalc.query,
94
+ componentId: props.componentId,
95
+ label: props.filterLabel,
96
+ showFilter: props.showFilter,
97
+ URLParams: props.URLParams
98
+ }));
99
+ };
100
+ if (props.defaultQuery) {
101
+ this.internalComponent = props.componentId + "__internal";
102
+ }
103
+ if (this.internalComponent && this.$props.defaultQuery) {
104
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
105
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
106
+ var _query = extractQueryFromCustomQuery(this.$defaultQuery);
107
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
108
+ if (queryOptions) {
109
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
110
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
111
+ this.updateQuery({
112
+ componentId: this.internalComponent,
113
+ query: _query
114
+ });
115
+ }
116
+ },
117
+ watch: {
118
+ hits: function hits(newVal, oldVal) {
119
+ if (!isEqual(newVal, oldVal)) {
120
+ this.$emit('data', this.getData());
121
+ }
122
+ },
123
+ rawData: function rawData(newVal, oldVal) {
124
+ if (!isEqual(newVal, oldVal)) {
125
+ this.$emit('data', this.getData());
126
+ }
127
+ },
128
+ aggregations: function aggregations(newVal, oldVal) {
129
+ if (!isEqual(newVal, oldVal)) {
130
+ this.$emit('data', this.getData());
131
+ }
132
+ },
133
+ aggregationData: function aggregationData(newVal, oldVal) {
134
+ if (!isEqual(newVal, oldVal)) {
135
+ this.$emit('data', this.getData());
136
+ }
137
+ },
138
+ promotedResults: function promotedResults(newVal, oldVal) {
139
+ if (!isEqual(newVal, oldVal)) {
140
+ this.$emit('data', this.getData());
141
+ }
142
+ },
143
+ hidden: function hidden(newVal, oldVal) {
144
+ if (!isEqual(newVal, oldVal)) {
145
+ this.$emit('data', this.getData());
146
+ }
147
+ },
148
+ total: function total(newVal, oldVal) {
149
+ if (!isEqual(newVal, oldVal)) {
150
+ this.$emit('data', this.getData());
151
+ }
152
+ },
153
+ time: function time(newVal, oldVal) {
154
+ if (!isEqual(newVal, oldVal)) {
155
+ this.$emit('data', this.getData());
156
+ }
157
+ },
158
+ defaultQuery: function defaultQuery(newVal, oldVal) {
159
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
160
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
161
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
162
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
163
+ if (queryOptions) {
164
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
165
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
166
+ // Update default query for RS API
167
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
168
+ this.updateQuery({
169
+ componentId: this.internalComponent,
170
+ query: query
171
+ });
172
+ }
173
+ },
174
+ customQuery: function customQuery(newVal, oldVal) {
175
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
176
+ var componentId = this.$props.componentId;
177
+ this.$customQuery = newVal(this.selectedValue, this.$props);
178
+ var query = extractQueryFromCustomQuery(this.$customQuery);
179
+ var queryOptions = getOptionsForCustomQuery(this.$customQuery);
180
+ if (queryOptions) {
181
+ this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
182
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
183
+
184
+ // Update custom query for RS API
185
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
186
+ this.updateQuery({
187
+ componentId: componentId,
188
+ query: query
189
+ });
190
+ }
191
+ }
192
+ },
193
+ render: function render() {
194
+ try {
195
+ var dom = this.$slots["default"];
196
+ var error = this.error,
197
+ isLoading = this.isLoading,
198
+ selectedValue = this.selectedValue;
199
+ var propsToBePassed = _extends({
200
+ error: error,
201
+ loading: isLoading
202
+ }, this.getData(), {
203
+ value: selectedValue,
204
+ setQuery: this.setQuery
205
+ });
206
+ return createVNode("div", null, [dom(propsToBePassed)]);
207
+ } catch (e) {
208
+ return null;
209
+ }
210
+ },
211
+ methods: {
212
+ getAggsQuery: function getAggsQuery() {
213
+ if (this.aggregationField) {
214
+ return {
215
+ aggs: getCompositeAggsQuery({
216
+ props: this.$props,
217
+ showTopHits: true,
218
+ value: this.selectedValue
219
+ }).aggs
220
+ };
221
+ }
222
+ return {};
223
+ },
224
+ getData: function getData() {
225
+ var hits = this.hits,
226
+ aggregations = this.aggregations,
227
+ aggregationData = this.aggregationData,
228
+ promotedResults = this.promotedResults,
229
+ rawData = this.rawData;
230
+ var filteredResults = parseHits(hits);
231
+ if (promotedResults.length) {
232
+ var ids = promotedResults.map(function (item) {
233
+ return item._id;
234
+ }).filter(Boolean);
235
+ if (ids) {
236
+ filteredResults = filteredResults.filter(function (item) {
237
+ return !ids.includes(item._id);
238
+ });
239
+ }
240
+ filteredResults = [].concat(promotedResults, filteredResults);
241
+ }
242
+ return {
243
+ data: filteredResults,
244
+ aggregationData: aggregationData,
245
+ rawData: rawData,
246
+ aggregations: aggregations,
247
+ promotedData: promotedResults,
248
+ resultStats: this.stats
249
+ };
250
+ }
251
+ },
252
+ computed: {
253
+ stats: function stats() {
254
+ return getResultStats(this);
255
+ }
256
+ }
257
+ };
258
+ ReactiveComponent.hasInternalComponent = function (props) {
259
+ return !!props.defaultQuery;
260
+ };
261
+ var mapStateToProps = function mapStateToProps(state, props) {
262
+ return {
263
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
264
+ aggregationData: state.compositeAggregations[props.componentId] || [],
265
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
266
+ rawData: state.rawData[props.componentId],
267
+ error: state.error[props.componentId],
268
+ isLoading: state.isLoading[props.componentId],
269
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
270
+ promotedResults: state.promotedResults[props.componentId] || [],
271
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
272
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
273
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
274
+ componentProps: state.props[props.componentId]
275
+ };
276
+ };
277
+ var mapDispatchtoProps = {
278
+ setQueryOptions: setQueryOptions,
279
+ updateQuery: updateQuery,
280
+ setCustomQuery: setCustomQuery,
281
+ setDefaultQuery: setDefaultQuery
282
+ };
283
+ var ConnectedComponent = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(ReactiveComponent), {
284
+ componentType: componentTypes.reactiveComponent
285
+ });
286
+ var RcConnected = PreferencesConsumer({
287
+ name: 'RcConnected',
288
+ render: function render() {
289
+ return h(ConnectedComponent, null, this.$slots);
290
+ }
291
+ });
292
+ RcConnected.name = ReactiveComponent.name;
293
+ RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
294
+ // Add componentType for SSR
295
+ RcConnected.componentType = componentTypes.reactiveComponent;
296
+ RcConnected.install = function (Vue) {
297
+ Vue.component(RcConnected.name, RcConnected);
298
+ };
299
+
300
+ export default RcConnected;
@@ -17,9 +17,9 @@ import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updat
17
17
  import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
18
18
  import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
19
19
  import './Title-863dfa42.js';
20
- import { c as container } from './ListItem-1cb1b4de.js';
20
+ import { c as container } from './ListItem-e3c6acf4.js';
21
21
  import { c as container$1 } from './Card-54b9e7a0.js';
22
- import { F as Flex } from './Flex-a08e22d7.js';
22
+ import { F as Flex } from './Flex-25792bc3.js';
23
23
 
24
24
  var _templateObject;
25
25
  var PoweredByImage = styled('img')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\twidth: 110px;\n"])));
@@ -6,7 +6,7 @@ import '@emotion/css';
6
6
  import 'polished';
7
7
  import { t as types } from './vueTypes-f1923c72.js';
8
8
  import { T as Title } from './Title-863dfa42.js';
9
- import { I as Image, L as ListItem } from './ListItem-1cb1b4de.js';
9
+ import { I as Image, L as ListItem } from './ListItem-e3c6acf4.js';
10
10
 
11
11
  var ResultListContent = {
12
12
  name: 'ResultListContent',
@@ -20,7 +20,7 @@ import './Input-f7499ef8.js';
20
20
  import 'compute-scroll-into-view';
21
21
  import { C as Container } from './Container-d00219f7.js';
22
22
  import '@appbaseio/reactivecore/lib/utils/suggestions';
23
- import { g as getAggsQuery } from './utils-9e5a16a1.js';
23
+ import { g as getAggsQuery } from './utils-d7dd4f4e.js';
24
24
 
25
25
  function _isSlot(s) {
26
26
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
@@ -17,7 +17,7 @@ import { I as Input } from './Input-f7499ef8.js';
17
17
  import { C as Container } from './Container-d00219f7.js';
18
18
  import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
19
19
  import { U as UL, R as Radio } from './FormControlList-fe6eaee4.js';
20
- import { g as getAggsQuery } from './utils-9e5a16a1.js';
20
+ import { g as getAggsQuery } from './utils-d7dd4f4e.js';
21
21
 
22
22
  var updateQuery = Actions.updateQuery,
23
23
  setQueryOptions = Actions.setQueryOptions,
package/dist/es/index.js CHANGED
@@ -18,9 +18,9 @@ import './index-4520a598.js';
18
18
  import './ComponentWrapper-3a215eed.js';
19
19
  import './PreferencesConsumer-24e88f3b.js';
20
20
  import './Title-863dfa42.js';
21
- import './ListItem-1cb1b4de.js';
21
+ import './ListItem-e3c6acf4.js';
22
22
  import './Card-54b9e7a0.js';
23
- import './Flex-a08e22d7.js';
23
+ import './Flex-25792bc3.js';
24
24
  import '@appbaseio/reactivecore/lib';
25
25
  import '@appbaseio/reactivecore/lib/actions/analytics';
26
26
  import 'appbase-js';
@@ -28,7 +28,8 @@ import '@appbaseio/analytics';
28
28
  import 'url-search-params-polyfill';
29
29
  export { default as ReactiveBase } from './ReactiveBase.js';
30
30
  import 'hotkeys-js';
31
- export { R as ReactiveComponent, S as SearchBox } from './ReactiveComponent-f78ff2cd.js';
31
+ import { i as install } from './install-44a07e7a.js';
32
+ export { R as ReactiveComponentPrivate, S as SearchBox, T as TreeList, i as install } from './install-44a07e7a.js';
32
33
  import './DropDown-7174661a.js';
33
34
  import './Input-f7499ef8.js';
34
35
  import 'compute-scroll-into-view';
@@ -36,12 +37,14 @@ import './Container-d00219f7.js';
36
37
  import 'vue-highlight-words';
37
38
  import '@appbaseio/reactivecore/lib/utils/suggestions';
38
39
  import './FormControlList-fe6eaee4.js';
39
- import './utils-9e5a16a1.js';
40
+ import './utils-d7dd4f4e.js';
40
41
  export { default as SingleList } from './SingleList.js';
41
42
  export { default as MultiList } from './MultiList.js';
43
+ import '@appbaseio/reactivecore/lib/utils/types';
42
44
  export { default as SingleDropdownList } from './SingleDropdownList.js';
43
45
  export { default as MultiDropdownList } from './MultiDropdownList.js';
44
46
  export { default as ToggleButton } from './ToggleButton.js';
47
+ export { default as ReactiveComponent } from './ReactiveComponent.js';
45
48
  import './ssr-c630ccb9.js';
46
49
  export { default as DynamicRangeSlider } from './DynamicRangeSlider.js';
47
50
  export { default as SingleRange } from './SingleRange.js';
@@ -60,8 +63,6 @@ import '@appbaseio/reactivecore/lib/utils/server';
60
63
  export { default as getServerState } from './initReactivesearch.js';
61
64
  import version from './version.js';
62
65
  export { default as version } from './version.js';
63
- import install from './install.js';
64
- export { default as install } from './install.js';
65
66
 
66
67
  // Add polyfills to support in IE
67
68
  if (typeof window !== 'undefined' && window.Vue) {