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

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 (61) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +3046 -1186
  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/{ComponentWrapper-2dc930e1.js → ComponentWrapper-9146d811.js} +1 -1
  6. package/dist/cjs/{DropDown-f48bea16.js → DropDown-b16418e9.js} +1 -1
  7. package/dist/cjs/DynamicRangeSlider.js +2 -2
  8. package/dist/cjs/{Flex-d5675ea6.js → Flex-ddde6d26.js} +3 -1
  9. package/dist/cjs/{ListItem-23af8974.js → ListItem-7a682970.js} +6 -1
  10. package/dist/cjs/MultiDropdownList.js +5 -5
  11. package/dist/cjs/MultiList.js +4 -4
  12. package/dist/cjs/MultiRange.js +3 -3
  13. package/dist/cjs/{PreferencesConsumer-2c69ac61.js → PreferencesConsumer-85dee673.js} +1 -1
  14. package/dist/cjs/RangeInput.js +4 -4
  15. package/dist/cjs/RangeSlider.js +3 -3
  16. package/dist/cjs/ReactiveBase.js +1 -1
  17. package/dist/cjs/ReactiveComponent.js +297 -43
  18. package/dist/cjs/ReactiveGoogleMap.js +3 -3
  19. package/dist/cjs/ReactiveList.js +5 -5
  20. package/dist/cjs/ResultList.js +1 -1
  21. package/dist/cjs/SelectedFilters.js +1 -1
  22. package/dist/cjs/SingleDropdownList.js +5 -5
  23. package/dist/cjs/SingleList.js +4 -4
  24. package/dist/cjs/SingleRange.js +3 -3
  25. package/dist/cjs/StateProvider.js +1 -1
  26. package/dist/cjs/ToggleButton.js +3 -3
  27. package/dist/cjs/{index-1481798c.js → index-779ed366.js} +2 -4
  28. package/dist/cjs/index.js +17 -14
  29. package/dist/cjs/{ReactiveComponent-8180c806.js → install-7cdf6798.js} +756 -244
  30. package/dist/cjs/install.js +28 -32
  31. package/dist/cjs/{utils-36b1b880.js → utils-c9bd5628.js} +9 -0
  32. package/dist/cjs/version.js +1 -1
  33. package/dist/es/{ComponentWrapper-3a215eed.js → ComponentWrapper-8a3c388d.js} +1 -1
  34. package/dist/es/{DropDown-7174661a.js → DropDown-fc1fef02.js} +1 -1
  35. package/dist/es/DynamicRangeSlider.js +2 -2
  36. package/dist/es/{Flex-a08e22d7.js → Flex-25792bc3.js} +3 -1
  37. package/dist/es/{ListItem-1cb1b4de.js → ListItem-e3c6acf4.js} +6 -1
  38. package/dist/es/MultiDropdownList.js +5 -5
  39. package/dist/es/MultiList.js +4 -4
  40. package/dist/es/MultiRange.js +3 -3
  41. package/dist/es/{PreferencesConsumer-24e88f3b.js → PreferencesConsumer-b058d14e.js} +1 -1
  42. package/dist/es/RangeInput.js +4 -4
  43. package/dist/es/RangeSlider.js +3 -3
  44. package/dist/es/ReactiveBase.js +1 -1
  45. package/dist/es/ReactiveComponent.js +298 -42
  46. package/dist/es/ReactiveGoogleMap.js +3 -3
  47. package/dist/es/ReactiveList.js +5 -5
  48. package/dist/es/ResultList.js +1 -1
  49. package/dist/es/SelectedFilters.js +1 -1
  50. package/dist/es/SingleDropdownList.js +5 -5
  51. package/dist/es/SingleList.js +4 -4
  52. package/dist/es/SingleRange.js +3 -3
  53. package/dist/es/StateProvider.js +1 -1
  54. package/dist/es/ToggleButton.js +3 -3
  55. package/dist/es/{index-4520a598.js → index-882489e1.js} +2 -4
  56. package/dist/es/index.js +11 -10
  57. package/dist/es/{ReactiveComponent-f78ff2cd.js → install-0c7962bc.js} +765 -255
  58. package/dist/es/install.js +26 -34
  59. package/dist/es/{utils-9e5a16a1.js → utils-d7dd4f4e.js} +9 -1
  60. package/dist/es/version.js +1 -1
  61. package/package.json +2 -2
@@ -15,54 +15,50 @@ 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
- require('./index-1481798c.js');
22
- require('./ComponentWrapper-2dc930e1.js');
23
- require('./PreferencesConsumer-2c69ac61.js');
21
+ require('./index-779ed366.js');
22
+ require('./ComponentWrapper-9146d811.js');
23
+ require('./PreferencesConsumer-85dee673.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');
36
- require('./DropDown-f48bea16.js');
35
+ var install = require('./install-7cdf6798.js');
36
+ require('./DropDown-b16418e9.js');
37
37
  require('./Input-497be42a.js');
38
38
  require('compute-scroll-into-view');
39
39
  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.1";
6
6
 
7
7
  exports.default = version;
@@ -4,7 +4,7 @@ import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
4
4
  import { h } from 'vue';
5
5
  import VueTypes from 'vue-types';
6
6
  import { getInternalComponentID } from '@appbaseio/reactivecore/lib/utils/transform';
7
- import { c as connect, b as getCamelCase, d as getValidPropsKeys } from './index-4520a598.js';
7
+ import { c as connect, b as getCamelCase, d as getValidPropsKeys } from './index-882489e1.js';
8
8
 
9
9
  var addComponent = Actions.addComponent,
10
10
  removeComponent = Actions.removeComponent,
@@ -5,7 +5,7 @@ import { createVNode, createTextVNode, mergeProps } from 'vue';
5
5
  import VueTypes from 'vue-types';
6
6
  import { styled } from '@appbaseio/vue-emotion';
7
7
  import { t as types } from './vueTypes-f1923c72.js';
8
- import { a as isFunction } from './index-4520a598.js';
8
+ import { a as isFunction } from './index-882489e1.js';
9
9
  import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-f7499ef8.js';
10
10
  import computeScrollIntoView from 'compute-scroll-into-view';
11
11
  import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
@@ -6,8 +6,8 @@ import VueTypes from 'vue-types';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import { t as types } from './vueTypes-f1923c72.js';
8
8
  import 'redux';
9
- import { j as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-4520a598.js';
10
- import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
9
+ import { j as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-882489e1.js';
10
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.js';
11
11
  import { T as Title } from './Title-863dfa42.js';
12
12
  import { C as Container } from './Container-d00219f7.js';
13
13
  import { g as getComponents, N as NoSSR, S as Slider } from './ssr-c630ccb9.js';
@@ -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 };
@@ -11,16 +11,16 @@ import { l as loadMoreContainer, B as Button } from './Button-fd869491.js';
11
11
  import { t as types } from './vueTypes-f1923c72.js';
12
12
  import '@appbaseio/reactivecore/lib/utils/transform';
13
13
  import 'redux';
14
- import { j as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, n as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-4520a598.js';
15
- import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
16
- import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
14
+ import { j as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, n as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-882489e1.js';
15
+ import { C as ComponentWrapper } from './ComponentWrapper-8a3c388d.js';
16
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.js';
17
17
  import { T as Title } from './Title-863dfa42.js';
18
- import { c as Dropdown } from './DropDown-7174661a.js';
18
+ import { c as Dropdown } from './DropDown-fc1fef02.js';
19
19
  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);
@@ -9,15 +9,15 @@ import 'polished';
9
9
  import { t as types } from './vueTypes-f1923c72.js';
10
10
  import '@appbaseio/reactivecore/lib/utils/transform';
11
11
  import 'redux';
12
- import { j as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, m as isEvent, n as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-4520a598.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
14
- import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
12
+ import { j as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, m as isEvent, n as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-882489e1.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-8a3c388d.js';
14
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.js';
15
15
  import { T as Title } from './Title-863dfa42.js';
16
16
  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,
@@ -9,9 +9,9 @@ import 'polished';
9
9
  import { t as types } from './vueTypes-f1923c72.js';
10
10
  import '@appbaseio/reactivecore/lib/utils/transform';
11
11
  import 'redux';
12
- import { n as parseValueArray, j as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4520a598.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
14
- import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
12
+ import { n as parseValueArray, j as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-882489e1.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-8a3c388d.js';
14
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.js';
15
15
  import { T as Title } from './Title-863dfa42.js';
16
16
  import { C as Container } from './Container-d00219f7.js';
17
17
  import { U as UL, C as Checkbox } from './FormControlList-fe6eaee4.js';
@@ -1,6 +1,6 @@
1
1
  import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
2
2
  import { h } from 'vue';
3
- import { b as getCamelCase } from './index-4520a598.js';
3
+ import { b as getCamelCase } from './index-882489e1.js';
4
4
 
5
5
  var deepValue = function deepValue(o, p) {
6
6
  return p.split('.').reduce(function (a, v) {
@@ -10,11 +10,11 @@ import 'polished';
10
10
  import { t as types } from './vueTypes-f1923c72.js';
11
11
  import '@appbaseio/reactivecore/lib/utils/transform';
12
12
  import 'redux';
13
- import { c as connect } from './index-4520a598.js';
14
- import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
15
- import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
13
+ import { c as connect } from './index-882489e1.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-8a3c388d.js';
15
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.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';
@@ -7,9 +7,9 @@ import '@appbaseio/vue-emotion';
7
7
  import { t as types } from './vueTypes-f1923c72.js';
8
8
  import '@appbaseio/reactivecore/lib/utils/transform';
9
9
  import 'redux';
10
- import { j as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4520a598.js';
11
- import { C as ComponentWrapper } from './ComponentWrapper-3a215eed.js';
12
- import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
10
+ import { j as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-882489e1.js';
11
+ import { C as ComponentWrapper } from './ComponentWrapper-8a3c388d.js';
12
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.js';
13
13
  import { T as Title } from './Title-863dfa42.js';
14
14
  import { C as Container } from './Container-d00219f7.js';
15
15
  import { g as getComponents, N as NoSSR, S as Slider } from './ssr-c630ccb9.js';
@@ -7,7 +7,7 @@ import { isEqual as isEqual$1, transformRequestUsingEndpoint } from '@appbaseio/
7
7
  import { styled, createCache } from '@appbaseio/vue-emotion';
8
8
  import { t as types } from './vueTypes-f1923c72.js';
9
9
  import 'redux';
10
- import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-4520a598.js';
10
+ import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-882489e1.js';
11
11
  import configureStore, { Actions as Actions$1 } from '@appbaseio/reactivecore/lib';
12
12
  import { updateAnalyticsConfig } from '@appbaseio/reactivecore/lib/actions/analytics';
13
13
  import Appbase from 'appbase-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-882489e1.js';
10
+ import { C as ComponentWrapper } from './ComponentWrapper-8a3c388d.js';
11
+ import { P as PreferencesConsumer } from './PreferencesConsumer-b058d14e.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;