@appbaseio/reactivesearch-vue 1.33.0 → 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.
Files changed (91) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1916 -6072
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +3 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-0673191e.js → Button-841fd06d.js} +1 -7
  6. package/dist/cjs/{CancelSvg-9f258f4f.js → CancelSvg-220a7cc3.js} +24 -58
  7. package/dist/cjs/{Card-642547a8.js → Card-240f283d.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-981ab977.js → ComponentWrapper-9318cece.js} +21 -41
  9. package/dist/cjs/{Container-daf30918.js → Container-e699ea95.js} +1 -1
  10. package/dist/cjs/{DataSearch-708b183d.js → DataSearch-99a6a2e8.js} +121 -293
  11. package/dist/cjs/DataSearch.js +11 -11
  12. package/dist/cjs/{DropDown-c479bbb0.js → DropDown-8984b544.js} +27 -48
  13. package/dist/cjs/DynamicRangeSlider.js +44 -93
  14. package/dist/cjs/{Flex-aa517a13.js → Flex-ddd7cb6b.js} +1 -3
  15. package/dist/cjs/{FormControlList-c195a592.js → FormControlList-bbb5cd24.js} +1 -3
  16. package/dist/cjs/{Input-e6603a7e.js → Input-ead4cd84.js} +14 -16
  17. package/dist/cjs/{ListItem-8c9e0d68.js → ListItem-5088bd6a.js} +2 -3
  18. package/dist/cjs/MultiDropdownList.js +41 -102
  19. package/dist/cjs/MultiList.js +35 -98
  20. package/dist/cjs/MultiRange.js +20 -52
  21. package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
  22. package/dist/cjs/{PreferencesConsumer-7be03476.js → PreferencesConsumer-5d67b486.js} +13 -16
  23. package/dist/cjs/RangeInput.js +36 -52
  24. package/dist/cjs/RangeSlider.js +24 -48
  25. package/dist/cjs/ReactiveBase.js +34 -79
  26. package/dist/cjs/{ReactiveComponent-5ff98cce.js → ReactiveComponent-805201c6.js} +118 -301
  27. package/dist/cjs/ReactiveComponent.js +20 -20
  28. package/dist/cjs/ReactiveGoogleMap.js +167 -353
  29. package/dist/cjs/ReactiveList.js +88 -176
  30. package/dist/cjs/ResultCard.js +10 -18
  31. package/dist/cjs/ResultList.js +13 -24
  32. package/dist/cjs/SelectedFilters.js +16 -34
  33. package/dist/cjs/SingleDropdownList.js +35 -75
  34. package/dist/cjs/SingleList.js +29 -75
  35. package/dist/cjs/SingleRange.js +17 -40
  36. package/dist/cjs/StateProvider.js +6 -26
  37. package/dist/cjs/{Title-1de7d0f4.js → Title-16042ea0.js} +1 -1
  38. package/dist/cjs/ToggleButton.js +20 -58
  39. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  40. package/dist/cjs/{index-08f8dfa3.js → index-30126fd0.js} +39 -75
  41. package/dist/cjs/index.js +20 -21
  42. package/dist/cjs/initReactivesearch.js +49 -120
  43. package/dist/cjs/install.js +20 -20
  44. package/dist/cjs/{ssr-3027b848.js → ssr-f2fc1bf6.js} +1 -4
  45. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  46. package/dist/cjs/version.js +1 -1
  47. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-7cfc2f98.js} +6 -11
  48. package/dist/es/{Button-35aa984e.js → Button-153cd885.js} +1 -7
  49. package/dist/es/{CancelSvg-4cfae5fd.js → CancelSvg-e40552a5.js} +24 -58
  50. package/dist/es/{Card-450683f1.js → Card-19ad6d90.js} +2 -2
  51. package/dist/es/{ComponentWrapper-d5e814a4.js → ComponentWrapper-240450cc.js} +21 -41
  52. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +1 -1
  53. package/dist/es/{DataSearch-5376d39a.js → DataSearch-20f0d8f1.js} +121 -293
  54. package/dist/es/DataSearch.js +11 -11
  55. package/dist/es/{DropDown-05a644a5.js → DropDown-28ddce07.js} +27 -48
  56. package/dist/es/DynamicRangeSlider.js +44 -93
  57. package/dist/es/{Flex-1f0795c3.js → Flex-7c177a10.js} +1 -3
  58. package/dist/es/{FormControlList-c22d64f6.js → FormControlList-99797d0a.js} +1 -3
  59. package/dist/es/{Input-7a2a9fac.js → Input-c09c0b56.js} +14 -16
  60. package/dist/es/{ListItem-cad14c5e.js → ListItem-07888a65.js} +2 -3
  61. package/dist/es/MultiDropdownList.js +41 -102
  62. package/dist/es/MultiList.js +35 -98
  63. package/dist/es/MultiRange.js +20 -52
  64. package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
  65. package/dist/es/{PreferencesConsumer-c30605fe.js → PreferencesConsumer-bc097ebb.js} +13 -16
  66. package/dist/es/RangeInput.js +36 -52
  67. package/dist/es/RangeSlider.js +24 -48
  68. package/dist/es/ReactiveBase.js +34 -79
  69. package/dist/es/{ReactiveComponent-ee01562d.js → ReactiveComponent-dd85aa9c.js} +118 -301
  70. package/dist/es/ReactiveComponent.js +20 -20
  71. package/dist/es/ReactiveGoogleMap.js +167 -353
  72. package/dist/es/ReactiveList.js +88 -176
  73. package/dist/es/ResultCard.js +10 -18
  74. package/dist/es/ResultList.js +13 -24
  75. package/dist/es/SelectedFilters.js +16 -34
  76. package/dist/es/SingleDropdownList.js +35 -75
  77. package/dist/es/SingleList.js +29 -75
  78. package/dist/es/SingleRange.js +17 -40
  79. package/dist/es/StateProvider.js +6 -26
  80. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +1 -1
  81. package/dist/es/ToggleButton.js +20 -58
  82. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  83. package/dist/es/{index-99c5f9c9.js → index-0444a498.js} +39 -75
  84. package/dist/es/index.js +20 -21
  85. package/dist/es/initReactivesearch.js +49 -120
  86. package/dist/es/install.js +20 -20
  87. package/dist/es/{ssr-b2c0b401.js → ssr-03607d84.js} +1 -4
  88. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  89. package/dist/es/version.js +1 -1
  90. package/dist/es/{vueTypes-b8146772.js → vueTypes-8986b709.js} +6 -11
  91. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
1
+ import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
2
2
  import VueTypes from 'vue-types';
3
3
  import 'emotion';
4
4
  import '@appbaseio/vue-emotion';
5
5
  import 'polished';
6
- import { t as types } from './vueTypes-b8146772.js';
6
+ import { t as types } from './vueTypes-8986b709.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
- import { T as Title } from './Title-3342664a.js';
9
- import { I as Image, C as Card } from './Card-450683f1.js';
8
+ import { T as Title } from './Title-863dfa42.js';
9
+ import { I as Image, C as Card } from './Card-19ad6d90.js';
10
10
 
11
11
  var ResultCardTitle = {
12
12
  name: 'ResultCardTitle',
@@ -16,7 +16,6 @@ var ResultCardTitle = {
16
16
  return h(Title, _mergeJSXProps([{}, this.$props]), [children]);
17
17
  }
18
18
  };
19
-
20
19
  ResultCardTitle.install = function (Vue) {
21
20
  Vue.component(ResultCardTitle.name, ResultCardTitle);
22
21
  };
@@ -29,11 +28,9 @@ var ResultCardImage = {
29
28
  },
30
29
  render: function render() {
31
30
  var h = arguments[0];
32
-
33
31
  var _this$$props = this.$props,
34
- src = _this$$props.src,
35
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
36
-
32
+ src = _this$$props.src,
33
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
37
34
  return h(Image, _mergeJSXProps([{
38
35
  "style": {
39
36
  backgroundImage: "url(" + src + ")"
@@ -41,7 +38,6 @@ var ResultCardImage = {
41
38
  }, props]));
42
39
  }
43
40
  };
44
-
45
41
  ResultCardImage.install = function (Vue) {
46
42
  Vue.component(ResultCardImage.name, ResultCardImage);
47
43
  };
@@ -51,12 +47,11 @@ var ResultCardDescription = {
51
47
  functional: true,
52
48
  render: function render(_, _ref) {
53
49
  var props = _ref.props,
54
- children = _ref.children;
50
+ children = _ref.children;
55
51
  var h = arguments[0];
56
52
  return h("article", _mergeJSXProps([{}, props]), [children]);
57
53
  }
58
54
  };
59
-
60
55
  ResultCardDescription.install = function (Vue) {
61
56
  Vue.component(ResultCardDescription.name, ResultCardDescription);
62
57
  };
@@ -76,12 +71,10 @@ var ResultCard = {
76
71
  render: function render() {
77
72
  var h = arguments[0];
78
73
  var children = this.$slots["default"];
79
-
80
74
  var _this$$props = this.$props,
81
- href = _this$$props.href,
82
- target = _this$$props.target,
83
- rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
84
-
75
+ href = _this$$props.href,
76
+ target = _this$$props.target,
77
+ rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
85
78
  return h(Card, _mergeJSXProps([{
86
79
  "attrs": {
87
80
  "href": href,
@@ -91,7 +84,6 @@ var ResultCard = {
91
84
  }, rest]), [children]);
92
85
  }
93
86
  };
94
-
95
87
  ResultCard.install = function (Vue) {
96
88
  Vue.component(ResultCard.name, ResultCard);
97
89
  Vue.component(ResultCardTitle.name, ResultCardTitle);
@@ -1,24 +1,23 @@
1
- import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
1
+ import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
2
2
  import VueTypes from 'vue-types';
3
3
  import 'emotion';
4
4
  import '@appbaseio/vue-emotion';
5
5
  import 'polished';
6
- import { t as types } from './vueTypes-b8146772.js';
6
+ import { t as types } from './vueTypes-8986b709.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
- import { T as Title } from './Title-3342664a.js';
9
- import { I as Image, L as ListItem } from './ListItem-cad14c5e.js';
8
+ import { T as Title } from './Title-863dfa42.js';
9
+ import { I as Image, L as ListItem } from './ListItem-07888a65.js';
10
10
 
11
11
  var ResultListContent = {
12
12
  name: 'ResultListContent',
13
13
  functional: true,
14
14
  render: function render(_, _ref) {
15
15
  var props = _ref.props,
16
- children = _ref.children;
16
+ children = _ref.children;
17
17
  var h = arguments[0];
18
18
  return h("article", _mergeJSXProps([{}, props]), [children]);
19
19
  }
20
20
  };
21
-
22
21
  ResultListContent.install = function (Vue) {
23
22
  Vue.component(ResultListContent.name, ResultListContent);
24
23
  };
@@ -28,12 +27,11 @@ var ResultListDescription = {
28
27
  functional: true,
29
28
  render: function render(_, _ref) {
30
29
  var props = _ref.props,
31
- children = _ref.children;
30
+ children = _ref.children;
32
31
  var h = arguments[0];
33
32
  return h("div", _mergeJSXProps([{}, props]), [children]);
34
33
  }
35
34
  };
36
-
37
35
  ResultListDescription.install = function (Vue) {
38
36
  Vue.component(ResultListDescription.name, ResultListDescription);
39
37
  };
@@ -47,12 +45,10 @@ var ResultListImage = {
47
45
  },
48
46
  render: function render() {
49
47
  var h = arguments[0];
50
-
51
48
  var _this$$props = this.$props,
52
- src = _this$$props.src,
53
- small = _this$$props.small,
54
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
55
-
49
+ src = _this$$props.src,
50
+ small = _this$$props.small,
51
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
56
52
  return h(Image, _mergeJSXProps([{
57
53
  "attrs": {
58
54
  "src": src,
@@ -61,7 +57,6 @@ var ResultListImage = {
61
57
  }, props]));
62
58
  }
63
59
  };
64
-
65
60
  ResultListImage.install = function (Vue) {
66
61
  Vue.component(ResultListImage.name, ResultListImage);
67
62
  };
@@ -74,7 +69,6 @@ var ResultListTitle = {
74
69
  return h(Title, _mergeJSXProps([{}, this.$props]), [children]);
75
70
  }
76
71
  };
77
-
78
72
  ResultListTitle.install = function (Vue) {
79
73
  Vue.component(ResultListTitle.name, ResultListTitle);
80
74
  };
@@ -104,10 +98,8 @@ var ResultList = {
104
98
  var ImageChild = children.find(function (o) {
105
99
  return o.componentOptions && o.componentOptions.tag === ResultListImage.name;
106
100
  });
107
-
108
101
  if (ImageChild && ImageChild.componentOptions && ImageChild.componentOptions.propsData) {
109
102
  this.hasImage = true;
110
-
111
103
  if (ImageChild.componentOptions.propsData.small) {
112
104
  this.isSmall = true;
113
105
  }
@@ -115,14 +107,12 @@ var ResultList = {
115
107
  },
116
108
  render: function render() {
117
109
  var h = arguments[0];
118
-
119
110
  var _this$$props = this.$props,
120
- href = _this$$props.href,
121
- target = _this$$props.target,
122
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
123
-
111
+ href = _this$$props.href,
112
+ target = _this$$props.target,
113
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
124
114
  var hasImage = this.hasImage,
125
- isSmall = this.isSmall;
115
+ isSmall = this.isSmall;
126
116
  var children = this.$slots["default"];
127
117
  return h(ListItem, _mergeJSXProps([{
128
118
  "attrs": {
@@ -135,7 +125,6 @@ var ResultList = {
135
125
  }, props]), [children]);
136
126
  }
137
127
  };
138
-
139
128
  ResultList.install = function (Vue) {
140
129
  Vue.component(ResultList.name, ResultList);
141
130
  Vue.component(ResultListContent.name, ResultListContent);
@@ -1,22 +1,22 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
2
  import '@appbaseio/reactivecore/lib/utils/constants';
3
- import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
+ import { a as _extends } 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 { f as filters, B as Button } from './Button-35aa984e.js';
9
- import { t as types } from './vueTypes-b8146772.js';
8
+ import { f as filters, B as Button } from './Button-153cd885.js';
9
+ import { t as types } from './vueTypes-8986b709.js';
10
10
  import 'redux';
11
- import { n as decodeHtml, c as connect } from './index-99c5f9c9.js';
12
- import { T as Title } from './Title-3342664a.js';
13
- import { C as Container } from './Container-ba826e96.js';
11
+ import { n as decodeHtml, c as connect } from './index-0444a498.js';
12
+ import { T as Title } from './Title-863dfa42.js';
13
+ import { C as Container } from './Container-d00219f7.js';
14
14
 
15
15
  var setValue = Actions.setValue,
16
- clearValues = Actions.clearValues,
17
- resetValuesToDefault = Actions.resetValuesToDefault;
16
+ clearValues = Actions.clearValues,
17
+ resetValuesToDefault = Actions.resetValuesToDefault;
18
18
  var getClassName = helper.getClassName,
19
- handleA11yAction = helper.handleA11yAction;
19
+ handleA11yAction = helper.handleA11yAction;
20
20
  var SelectedFilters = {
21
21
  name: 'SelectedFilters',
22
22
  props: {
@@ -36,9 +36,7 @@ var SelectedFilters = {
36
36
  },
37
37
  render: function render() {
38
38
  var _this = this;
39
-
40
39
  var h = arguments[0];
41
-
42
40
  if (this.$scopedSlots["default"]) {
43
41
  return this.$scopedSlots["default"]({
44
42
  components: this.components,
@@ -49,7 +47,6 @@ var SelectedFilters = {
49
47
  resetValuesToDefault: this.resetValuesToDefault
50
48
  });
51
49
  }
52
-
53
50
  var filtersToRender = this.renderFilters();
54
51
  var hasValues = !!filtersToRender.length;
55
52
  return h(Container, {
@@ -76,27 +73,23 @@ var SelectedFilters = {
76
73
  if (value === void 0) {
77
74
  value = null;
78
75
  }
79
-
80
76
  this.setValue(component, null);
81
77
  this.$emit('clear', component, value);
82
78
  },
83
79
  clearValues: function clearValues() {
84
80
  var resetToDefault = this.resetToDefault,
85
- resetToValues = this.resetToValues,
86
- clearAllBlacklistComponents = this.clearAllBlacklistComponents;
87
-
81
+ resetToValues = this.resetToValues,
82
+ clearAllBlacklistComponents = this.clearAllBlacklistComponents;
88
83
  if (resetToDefault) {
89
84
  this.resetValuesToDefault(clearAllBlacklistComponents);
90
85
  } else {
91
86
  this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
92
87
  }
93
-
94
88
  this.$emit('clear', resetToValues);
95
89
  },
96
90
  clearValue: function clearValue(componentId) {
97
91
  var resetToDefault = this.resetToDefault,
98
- resetToValues = this.resetToValues;
99
-
92
+ resetToValues = this.resetToValues;
100
93
  if (resetToDefault) {
101
94
  this.resetValuesToDefault(this.components.filter(function (component) {
102
95
  return component !== componentId;
@@ -104,30 +97,24 @@ var SelectedFilters = {
104
97
  } else {
105
98
  this.setValue(componentId, (resetToValues == null ? void 0 : resetToValues[componentId]) || null);
106
99
  }
107
-
108
100
  this.$emit('clear', resetToValues == null ? void 0 : resetToValues[componentId]);
109
101
  },
110
102
  renderValue: function renderValue(value, isArray) {
111
103
  var _this2 = this;
112
-
113
104
  if (isArray && value.length) {
114
105
  var arrayToRender = value.map(function (item) {
115
106
  return _this2.renderValue(item);
116
107
  });
117
108
  return arrayToRender.join(', ');
118
109
  }
119
-
120
110
  if (value && typeof value === 'object') {
121
111
  // TODO: support for NestedList
122
112
  var label = (typeof value.label === 'string' ? value.label : value.value) || value.key || value.distance || null;
123
-
124
113
  if (value.location) {
125
114
  label = value.location + " - " + label;
126
115
  }
127
-
128
116
  return label;
129
117
  }
130
-
131
118
  return value;
132
119
  },
133
120
  renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
@@ -148,25 +135,23 @@ var SelectedFilters = {
148
135
  },
149
136
  renderFilters: function renderFilters() {
150
137
  var _this3 = this;
151
-
152
138
  var selectedValues = this.selectedValues;
153
139
  var filterComponents = Object.keys(selectedValues).filter(function (id) {
154
140
  return _this3.components.includes(id) && selectedValues[id].showFilter;
155
141
  });
156
142
  return filterComponents.map(function (component, index) {
157
143
  var _selectedValues$compo = selectedValues[component],
158
- label = _selectedValues$compo.label,
159
- value = _selectedValues$compo.value;
160
- var isArray = Array.isArray(value); // default behaviour
144
+ label = _selectedValues$compo.label,
145
+ value = _selectedValues$compo.value;
146
+ var isArray = Array.isArray(value);
161
147
 
148
+ // default behaviour
162
149
  if (label && (isArray && value.length || !isArray && value)) {
163
150
  var valueToRender = _this3.renderValue(value, isArray);
164
-
165
151
  return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
166
152
  return _this3.remove(component, value);
167
153
  }, selectedValues[component].label + ": " + decodeHtml(valueToRender));
168
154
  }
169
-
170
155
  return null;
171
156
  }).filter(Boolean);
172
157
  }
@@ -177,21 +162,18 @@ var SelectedFilters = {
177
162
  }
178
163
  }
179
164
  };
180
-
181
165
  var mapStateToProps = function mapStateToProps(state) {
182
166
  return {
183
167
  components: state.components,
184
168
  selectedValues: state.selectedValues
185
169
  };
186
170
  };
187
-
188
171
  var mapDispatchtoProps = {
189
172
  clearValuesAction: clearValues,
190
173
  setValue: setValue,
191
174
  resetValuesToDefault: resetValuesToDefault
192
175
  };
193
176
  var RcConnected = connect(mapStateToProps, mapDispatchtoProps)(SelectedFilters);
194
-
195
177
  SelectedFilters.install = function (Vue) {
196
178
  Vue.component(SelectedFilters.name, RcConnected);
197
179
  };
@@ -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 } from './_rollupPluginBabelHelpers-76660dab.js';
3
+ import { a as _extends } 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-35aa984e.js';
9
- import { t as types } from './vueTypes-b8146772.js';
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, g as getComponent, h as hasCustomRenderer, c as connect } from './index-99c5f9c9.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-d5e814a4.js';
14
- import { P as PreferencesConsumer } from './PreferencesConsumer-c30605fe.js';
12
+ import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, 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-3342664a.js';
17
- import './CancelSvg-4cfae5fd.js';
18
- import './Input-7a2a9fac.js';
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-ba826e96.js';
20
+ import { C as Container } from './Container-d00219f7.js';
21
21
  import '@appbaseio/reactivecore/lib/utils/suggestions';
22
- import { g as getAggsQuery } from './utils-9e68acee.js';
23
- import { D as Dropdown } from './DropDown-05a644a5.js';
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
- setQueryOptions = Actions.setQueryOptions,
27
- setCustomQuery = Actions.setCustomQuery,
28
- setDefaultQuery = Actions.setDefaultQuery;
26
+ setQueryOptions = Actions.setQueryOptions,
27
+ setCustomQuery = Actions.setCustomQuery,
28
+ setDefaultQuery = Actions.setDefaultQuery;
29
29
  var getQueryOptions = helper.getQueryOptions,
30
- checkValueChange = helper.checkValueChange,
31
- checkPropChange = helper.checkPropChange,
32
- getClassName = helper.getClassName,
33
- isEqual = helper.isEqual,
34
- getCompositeAggsQuery = helper.getCompositeAggsQuery,
35
- extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
36
- getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
30
+ checkValueChange = helper.checkValueChange,
31
+ checkPropChange = helper.checkPropChange,
32
+ getClassName = helper.getClassName,
33
+ isEqual = helper.isEqual,
34
+ getCompositeAggsQuery = helper.getCompositeAggsQuery,
35
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
36
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
37
37
  var SingleDropdownList = {
38
38
  name: 'SingleDropdownList',
39
39
  data: function data() {
@@ -89,16 +89,14 @@ var SingleDropdownList = {
89
89
  if (!this.enableAppbase && this.$props.index) {
90
90
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
91
91
  }
92
-
93
92
  var props = this.$props;
94
- this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
95
-
93
+ this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : [];
94
+ // Set custom and default queries in store
96
95
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
97
96
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
98
97
  },
99
98
  beforeMount: function beforeMount() {
100
99
  this.updateQueryOptions(this.$props);
101
-
102
100
  if (this.selectedValue) {
103
101
  this.setValue(this.selectedValue);
104
102
  } else if (this.$props.value) {
@@ -110,14 +108,12 @@ var SingleDropdownList = {
110
108
  watch: {
111
109
  options: function options(newVal, oldVal) {
112
110
  var _this = this;
113
-
114
111
  if (newVal) {
115
112
  checkPropChange(oldVal, newVal, function () {
116
113
  var _this$$props = _this.$props,
117
- showLoadMore = _this$$props.showLoadMore,
118
- dataField = _this$$props.dataField;
114
+ showLoadMore = _this$$props.showLoadMore,
115
+ dataField = _this$$props.dataField;
119
116
  var modifiedOptions = _this.$data.modifiedOptions;
120
-
121
117
  if (showLoadMore) {
122
118
  // append options with showLoadMore
123
119
  var buckets = newVal[dataField].buckets;
@@ -128,7 +124,6 @@ var SingleDropdownList = {
128
124
  };
129
125
  }));
130
126
  var after = newVal[dataField].after_key; // detect the last bucket by checking if the next set of buckets were empty
131
-
132
127
  var isLastBucket = !buckets.length;
133
128
  _this.after = {
134
129
  after: after
@@ -178,41 +173,35 @@ var SingleDropdownList = {
178
173
  render: function render() {
179
174
  var h = arguments[0];
180
175
  var _this$$props2 = this.$props,
181
- showLoadMore = _this$$props2.showLoadMore,
182
- loadMoreLabel = _this$$props2.loadMoreLabel,
183
- renderItem = _this$$props2.renderItem,
184
- renderError = _this$$props2.renderError,
185
- renderLabel = _this$$props2.renderLabel;
176
+ showLoadMore = _this$$props2.showLoadMore,
177
+ loadMoreLabel = _this$$props2.loadMoreLabel,
178
+ renderItem = _this$$props2.renderItem,
179
+ renderError = _this$$props2.renderError,
180
+ renderLabel = _this$$props2.renderLabel;
186
181
  var isLastBucket = this.$data.isLastBucket;
187
182
  var selectAll = [];
188
183
  var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
189
184
  var renderErrorCalc = this.$scopedSlots.renderError || renderError;
190
185
  var renderLabelCalc = this.$scopedSlots.renderLabel || renderLabel;
191
186
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
192
-
193
187
  if (renderErrorCalc && this.error) {
194
188
  return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
195
189
  }
196
-
197
190
  if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
198
191
  if (renderNoResults && isFunction(renderNoResults)) {
199
192
  return h("div", [renderNoResults()]);
200
193
  }
201
-
202
194
  if (renderNoResults && !isFunction(renderNoResults)) {
203
195
  return renderNoResults;
204
196
  }
205
-
206
197
  return null;
207
198
  }
208
-
209
199
  if (this.$props.selectAllLabel) {
210
200
  selectAll = [{
211
201
  key: this.$props.selectAllLabel,
212
202
  doc_count: this.totalDocumentCount
213
203
  }];
214
204
  }
215
-
216
205
  return h(Container, {
217
206
  "class": this.$props.className
218
207
  }, [this.$props.title && h(Title, {
@@ -257,26 +246,19 @@ var SingleDropdownList = {
257
246
  methods: {
258
247
  setValue: function setValue(value, props) {
259
248
  var _this2 = this;
260
-
261
249
  if (props === void 0) {
262
250
  props = this.$props;
263
251
  }
264
-
265
252
  var performUpdate = function performUpdate() {
266
253
  _this2.currentValue = value;
267
-
268
254
  _this2.updateQueryHandler(value, props);
269
-
270
255
  _this2.$emit('valueChange', value);
271
-
272
256
  _this2.$emit('value-change', value);
273
257
  };
274
-
275
258
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
276
259
  },
277
260
  handleChange: function handleChange(item) {
278
261
  var value = this.$props.value;
279
-
280
262
  if (value === undefined) {
281
263
  this.setValue(item);
282
264
  } else {
@@ -285,21 +267,17 @@ var SingleDropdownList = {
285
267
  },
286
268
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
287
269
  var query = SingleDropdownList.defaultQuery(value, props);
288
-
289
270
  if (this.defaultQuery) {
290
271
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
291
272
  var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
292
-
293
273
  if (defaultQueryObj) {
294
274
  query = defaultQueryObj;
295
- } // Update calculated default query in store
296
-
297
-
275
+ }
276
+ // Update calculated default query in store
298
277
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
299
278
  var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
300
279
  this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
301
280
  }
302
-
303
281
  this.updateQuery({
304
282
  componentId: this.internalComponent,
305
283
  query: query,
@@ -310,7 +288,6 @@ var SingleDropdownList = {
310
288
  updateQueryHandler: function updateQueryHandler(value, props) {
311
289
  var customQuery = props.customQuery;
312
290
  var query = SingleDropdownList.defaultQuery(value, props);
313
-
314
291
  if (customQuery) {
315
292
  var customQueryCalc = customQuery(value, props);
316
293
  query = extractQueryFromCustomQuery(customQueryCalc);
@@ -318,7 +295,6 @@ var SingleDropdownList = {
318
295
  var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
319
296
  this.setQueryOptions(props.componentId, customQueryOptions, false);
320
297
  }
321
-
322
298
  this.updateQuery({
323
299
  componentId: props.componentId,
324
300
  query: query,
@@ -341,15 +317,12 @@ var SingleDropdownList = {
341
317
  if (addAfterKey === void 0) {
342
318
  addAfterKey = false;
343
319
  }
344
-
345
320
  // when using composite aggs flush the current options for a fresh query
346
321
  if (props.showLoadMore && !addAfterKey) {
347
322
  this.modifiedOptions = [];
348
323
  } // for a new query due to other changes don't append after to get fresh results
349
324
 
350
-
351
325
  var queryOptions = SingleDropdownList.generateQueryOptions(props, addAfterKey ? this.$data.after : {});
352
-
353
326
  if (props.defaultQuery) {
354
327
  var value = this.$data.currentValue;
355
328
  var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
@@ -365,7 +338,6 @@ var SingleDropdownList = {
365
338
  if (downshiftProps === void 0) {
366
339
  downshiftProps = {};
367
340
  }
368
-
369
341
  var currentValue = this.$data.currentValue;
370
342
  var data = {
371
343
  error: this.error,
@@ -385,17 +357,14 @@ var SingleDropdownList = {
385
357
  }
386
358
  }
387
359
  };
388
-
389
360
  SingleDropdownList.defaultQuery = function (value, props) {
390
361
  var query = null;
391
-
392
362
  if (props.selectAllLabel && props.selectAllLabel === value) {
393
363
  if (props.showMissing) {
394
364
  query = {
395
365
  match_all: {}
396
366
  };
397
367
  }
398
-
399
368
  query = {
400
369
  exists: {
401
370
  field: props.dataField
@@ -403,7 +372,6 @@ SingleDropdownList.defaultQuery = function (value, props) {
403
372
  };
404
373
  } else if (value) {
405
374
  var _term;
406
-
407
375
  if (props.showMissing && props.missingLabel === value) {
408
376
  query = {
409
377
  bool: {
@@ -415,12 +383,10 @@ SingleDropdownList.defaultQuery = function (value, props) {
415
383
  }
416
384
  };
417
385
  }
418
-
419
386
  query = {
420
387
  term: (_term = {}, _term[props.dataField] = value, _term)
421
388
  };
422
389
  }
423
-
424
390
  if (query && props.nestedField) {
425
391
  return {
426
392
  query: {
@@ -431,10 +397,8 @@ SingleDropdownList.defaultQuery = function (value, props) {
431
397
  }
432
398
  };
433
399
  }
434
-
435
400
  return query;
436
401
  };
437
-
438
402
  SingleDropdownList.generateQueryOptions = function (props, after) {
439
403
  var queryOptions = getQueryOptions(props);
440
404
  return props.showLoadMore ? getCompositeAggsQuery({
@@ -443,11 +407,9 @@ SingleDropdownList.generateQueryOptions = function (props, after) {
443
407
  after: after
444
408
  }) : getAggsQuery(queryOptions, props);
445
409
  };
446
-
447
410
  SingleDropdownList.hasInternalComponent = function () {
448
411
  return true;
449
412
  };
450
-
451
413
  var mapStateToProps = function mapStateToProps(state, props) {
452
414
  return {
453
415
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
@@ -461,7 +423,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
461
423
  enableAppbase: state.config.enableAppbase
462
424
  };
463
425
  };
464
-
465
426
  var mapDispatchtoProps = {
466
427
  setQueryOptions: setQueryOptions,
467
428
  updateQuery: updateQuery,
@@ -472,12 +433,11 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
472
433
  componentType: componentTypes.singleDropdownList,
473
434
  internalComponent: SingleDropdownList.hasInternalComponent()
474
435
  }));
475
-
476
436
  SingleDropdownList.install = function (Vue) {
477
437
  Vue.component(SingleDropdownList.name, ListConnected);
478
- }; // Add componentType for SSR
479
-
438
+ };
480
439
 
440
+ // Add componentType for SSR
481
441
  SingleDropdownList.componentType = componentTypes.singleDropdownList;
482
442
 
483
443
  export default SingleDropdownList;