@appbaseio/reactivesearch-vue 1.16.0-alpha.6 → 1.16.0-alpha.62

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 (105) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +16030 -13113
  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/Button-446f819e.js +68 -0
  6. package/dist/cjs/{DownShift-966a58cb.js → CancelSvg-9f258f4f.js} +60 -16
  7. package/dist/cjs/Card-642547a8.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-603848ed.js → ComponentWrapper-ad3dad02.js} +40 -21
  9. package/dist/cjs/{Container-6cdd3864.js → Container-daf30918.js} +3 -11
  10. package/dist/cjs/DataSearch-86914b10.js +2322 -0
  11. package/dist/cjs/DataSearch.js +18 -2151
  12. package/dist/cjs/{DropDown-f6224ac8.js → DropDown-5513ea77.js} +80 -95
  13. package/dist/cjs/DynamicRangeSlider.js +107 -43
  14. package/dist/cjs/Flex-aa517a13.js +52 -0
  15. package/dist/cjs/FormControlList-c195a592.js +47 -0
  16. package/dist/cjs/Input-e6603a7e.js +79 -0
  17. package/dist/cjs/ListItem-8c9e0d68.js +46 -0
  18. package/dist/cjs/MultiDropdownList.js +102 -68
  19. package/dist/cjs/MultiList.js +80 -50
  20. package/dist/cjs/MultiRange.js +21 -16
  21. package/dist/cjs/{Pagination-af399262.js → Pagination-fe5452fc.js} +14 -8
  22. package/dist/cjs/RangeInput.js +29 -45
  23. package/dist/cjs/RangeSlider.js +32 -30
  24. package/dist/cjs/ReactiveBase.js +87 -56
  25. package/dist/cjs/ReactiveComponent.js +75 -62
  26. package/dist/cjs/ReactiveGoogleMap.js +262 -191
  27. package/dist/cjs/ReactiveList.js +189 -241
  28. package/dist/cjs/ResultCard.js +8 -6
  29. package/dist/cjs/ResultList.js +8 -6
  30. package/dist/cjs/SelectedFilters.js +66 -34
  31. package/dist/cjs/SingleDropdownList.js +88 -60
  32. package/dist/cjs/SingleList.js +53 -35
  33. package/dist/cjs/SingleRange.js +19 -14
  34. package/dist/cjs/StateProvider.js +39 -10
  35. package/dist/cjs/{Title-65d39104.js → Title-1de7d0f4.js} +3 -11
  36. package/dist/cjs/ToggleButton.js +36 -16
  37. package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
  38. package/dist/cjs/{index-baca18c4.js → index-6a167fe0.js} +99 -13
  39. package/dist/cjs/index.js +31 -25
  40. package/dist/cjs/initReactivesearch.js +178 -104
  41. package/dist/cjs/install-004c6aa4.js +1408 -0
  42. package/dist/cjs/install.js +42 -44
  43. package/dist/cjs/ssr-3027b848.js +39 -0
  44. package/dist/cjs/{utils-ea846a20.js → utils-d6a52588.js} +2 -2
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
  47. package/dist/es/Button-d8bc15ea.js +59 -0
  48. package/dist/es/{DownShift-92347b5e.js → CancelSvg-4cfae5fd.js} +56 -17
  49. package/dist/es/Card-450683f1.js +23 -0
  50. package/dist/es/{ComponentWrapper-c4c91949.js → ComponentWrapper-424e86fd.js} +40 -21
  51. package/dist/es/Container-ba826e96.js +10 -0
  52. package/dist/es/DataSearch-e71a1014.js +2307 -0
  53. package/dist/es/DataSearch.js +17 -2150
  54. package/dist/es/{DropDown-3d4291f1.js → DropDown-7d9a15c1.js} +79 -94
  55. package/dist/es/DynamicRangeSlider.js +107 -43
  56. package/dist/es/Flex-1f0795c3.js +47 -0
  57. package/dist/es/FormControlList-c22d64f6.js +40 -0
  58. package/dist/es/Input-7a2a9fac.js +71 -0
  59. package/dist/es/ListItem-cad14c5e.js +39 -0
  60. package/dist/es/MultiDropdownList.js +102 -68
  61. package/dist/es/MultiList.js +80 -50
  62. package/dist/es/MultiRange.js +21 -16
  63. package/dist/es/{Pagination-c2a00175.js → Pagination-3f350098.js} +14 -8
  64. package/dist/es/RangeInput.js +29 -45
  65. package/dist/es/RangeSlider.js +32 -30
  66. package/dist/es/ReactiveBase.js +87 -56
  67. package/dist/es/ReactiveComponent.js +75 -62
  68. package/dist/es/ReactiveGoogleMap.js +262 -191
  69. package/dist/es/ReactiveList.js +189 -241
  70. package/dist/es/ResultCard.js +8 -6
  71. package/dist/es/ResultList.js +8 -6
  72. package/dist/es/SelectedFilters.js +66 -34
  73. package/dist/es/SingleDropdownList.js +88 -60
  74. package/dist/es/SingleList.js +53 -35
  75. package/dist/es/SingleRange.js +19 -14
  76. package/dist/es/StateProvider.js +39 -10
  77. package/dist/es/Title-3342664a.js +10 -0
  78. package/dist/es/ToggleButton.js +36 -16
  79. package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
  80. package/dist/es/{index-185b6266.js → index-7788a843.js} +95 -14
  81. package/dist/es/index.js +27 -22
  82. package/dist/es/initReactivesearch.js +179 -105
  83. package/dist/es/install-b7b604cc.js +1401 -0
  84. package/dist/es/install.js +40 -46
  85. package/dist/es/ssr-b2c0b401.js +33 -0
  86. package/dist/es/{utils-57cc8789.js → utils-9e68acee.js} +2 -2
  87. package/dist/es/version.js +1 -1
  88. package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
  89. package/package.json +6 -4
  90. package/dist/cjs/Button-d48d4365.js +0 -146
  91. package/dist/cjs/Card-9748fbb2.js +0 -58
  92. package/dist/cjs/Flex-befd65fc.js +0 -160
  93. package/dist/cjs/FormControlList-f3857d4b.js +0 -105
  94. package/dist/cjs/Input-95cb19f8.js +0 -178
  95. package/dist/cjs/ListItem-84d185cf.js +0 -84
  96. package/dist/cjs/ssr-3ca8a14f.js +0 -47
  97. package/dist/es/Button-27cc8574.js +0 -137
  98. package/dist/es/Card-1f93780d.js +0 -51
  99. package/dist/es/Container-88c805ef.js +0 -18
  100. package/dist/es/Flex-16d1103a.js +0 -155
  101. package/dist/es/FormControlList-96d44e7b.js +0 -98
  102. package/dist/es/Input-1159c4b5.js +0 -170
  103. package/dist/es/ListItem-d22510c9.js +0 -77
  104. package/dist/es/Title-f0217338.js +0 -18
  105. package/dist/es/ssr-a710392b.js +0 -41
@@ -6,15 +6,16 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
6
6
 
7
7
  var configureStore = require('@appbaseio/reactivecore');
8
8
  var configureStore__default = _interopDefault(configureStore);
9
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.js');
9
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
10
10
  var VueTypes = _interopDefault(require('vue-types'));
11
11
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
12
- var vueTypes = require('./vueTypes-c21f265b.js');
12
+ var vueTypes = require('./vueTypes-6de9d2a9.js');
13
13
  require('@appbaseio/reactivecore/lib/utils/transform');
14
14
  require('redux');
15
- var index = require('./index-baca18c4.js');
16
- var ComponentWrapper = require('./ComponentWrapper-603848ed.js');
15
+ var index = require('./index-6a167fe0.js');
16
+ var ComponentWrapper = require('./ComponentWrapper-ad3dad02.js');
17
17
 
18
+ var _excluded = ["options"];
18
19
  var updateQuery = configureStore.Actions.updateQuery,
19
20
  setQueryOptions = configureStore.Actions.setQueryOptions,
20
21
  setCustomQuery = configureStore.Actions.setCustomQuery,
@@ -22,15 +23,16 @@ var updateQuery = configureStore.Actions.updateQuery,
22
23
  var parseHits = configureStore.helper.parseHits,
23
24
  isEqual = configureStore.helper.isEqual,
24
25
  getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
25
- getOptionsFromQuery = configureStore.helper.getOptionsFromQuery,
26
- getResultStats = configureStore.helper.getResultStats;
26
+ getResultStats = configureStore.helper.getResultStats,
27
+ extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
28
+ getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
27
29
  var ReactiveComponent = {
28
30
  name: 'ReactiveComponent',
29
31
  props: {
30
32
  componentId: vueTypes.types.stringRequired,
31
33
  aggregationField: vueTypes.types.string,
32
34
  aggregationSize: VueTypes.number,
33
- size: VueTypes.number.def(20),
35
+ size: VueTypes.number,
34
36
  defaultQuery: vueTypes.types.func,
35
37
  customQuery: vueTypes.types.func,
36
38
  filterLabel: vueTypes.types.string,
@@ -38,7 +40,8 @@ var ReactiveComponent = {
38
40
  showFilter: VueTypes.bool.def(true),
39
41
  URLParams: VueTypes.bool.def(false),
40
42
  distinctField: vueTypes.types.string,
41
- distinctFieldConfig: vueTypes.types.props
43
+ distinctFieldConfig: vueTypes.types.props,
44
+ index: VueTypes.string
42
45
  },
43
46
  created: function created() {
44
47
  var _this = this;
@@ -47,33 +50,35 @@ var ReactiveComponent = {
47
50
  this.internalComponent = null;
48
51
  this.$defaultQuery = null; // Set custom query in store
49
52
 
50
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
53
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
51
54
  var customQuery = props.customQuery,
52
55
  componentId = props.componentId,
53
56
  filterLabel = props.filterLabel,
54
57
  showFilter = props.showFilter,
55
58
  URLParams = props.URLParams,
56
59
  distinctField = props.distinctField,
57
- distinctFieldConfig = props.distinctFieldConfig;
60
+ distinctFieldConfig = props.distinctFieldConfig,
61
+ index$1 = props.index;
58
62
 
59
- if (this.config.enableAppbase && this.aggregationField && this.aggregationField !== '') {
63
+ if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
60
64
  console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
61
65
  }
62
66
 
63
- if (!this.config.enableAppbase && (distinctField || distinctFieldConfig)) {
67
+ if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
64
68
  console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
65
69
  }
66
70
 
67
- if (customQuery) {
68
- var calcCustomQuery = customQuery(props);
69
-
70
- var _ref = calcCustomQuery || {},
71
- query = _ref.query;
71
+ if (!this.enableAppbase && index$1) {
72
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
73
+ }
72
74
 
73
- var customQueryOptions = calcCustomQuery ? getOptionsFromQuery(calcCustomQuery) : null;
75
+ if (customQuery) {
76
+ var calcCustomQuery = customQuery(this.selectedValue, props);
77
+ var query = extractQueryFromCustomQuery(calcCustomQuery);
78
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
74
79
 
75
80
  if (customQueryOptions) {
76
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, customQueryOptions), this.getAggsQuery()), false);
81
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
77
82
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
78
83
 
79
84
  this.updateQuery({
@@ -86,26 +91,35 @@ var ReactiveComponent = {
86
91
  });
87
92
  }
88
93
 
89
- this.setQuery = function (_ref2) {
90
- var options = _ref2.options,
91
- obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref2, ["options"]);
94
+ this.setQuery = function (_ref) {
95
+ var options = _ref.options,
96
+ obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
92
97
 
93
- if (options) {
94
- _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, options), _this.getAggsQuery()), false);
95
- } // Update customQuery field for RS API
98
+ var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
96
99
 
100
+ if (queryToBeSet && queryToBeSet.query) {
101
+ queryToBeSet = queryToBeSet.query;
102
+ }
97
103
 
98
- if (obj && obj.query || options) {
99
- var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options);
104
+ var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
105
+ query: queryToBeSet
106
+ });
100
107
 
101
- if (obj && obj.query) {
102
- customQueryCalc.query = obj.query;
103
- }
108
+ var rsAPIQuery = customQueryCalc; // handle stored queries
109
+
110
+ if (queryToBeSet && queryToBeSet.id) {
111
+ rsAPIQuery = queryToBeSet;
112
+ } // Update customQuery field for RS API
104
113
 
105
- _this.setCustomQuery(props.componentId, customQueryCalc);
114
+
115
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
116
+
117
+ if (options) {
118
+ _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
106
119
  }
107
120
 
108
- _this.updateQuery(_rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, obj), {}, {
121
+ _this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
122
+ query: customQueryCalc.query,
109
123
  componentId: props.componentId,
110
124
  label: props.filterLabel,
111
125
  showFilter: props.showFilter,
@@ -116,23 +130,22 @@ var ReactiveComponent = {
116
130
  if (props.defaultQuery) {
117
131
  this.internalComponent = props.componentId + "__internal";
118
132
  }
119
- },
120
- beforeMount: function beforeMount() {
133
+
121
134
  if (this.internalComponent && this.$props.defaultQuery) {
122
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
123
- this.$defaultQuery = this.$props.defaultQuery();
135
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
136
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
124
137
 
125
- var _ref3 = this.$defaultQuery || {},
126
- query = _ref3.query,
127
- queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref3, ["query"]);
138
+ var _query = extractQueryFromCustomQuery(this.$defaultQuery);
139
+
140
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
128
141
 
129
142
  if (queryOptions) {
130
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, queryOptions), this.getAggsQuery()), false);
143
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
131
144
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
132
145
 
133
146
  this.updateQuery({
134
147
  componentId: this.internalComponent,
135
- query: query || null
148
+ query: _query
136
149
  });
137
150
  }
138
151
  },
@@ -178,43 +191,39 @@ var ReactiveComponent = {
178
191
  }
179
192
  },
180
193
  defaultQuery: function defaultQuery(newVal, oldVal) {
181
- if (newVal && !index.isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
182
- this.$defaultQuery = newVal();
183
-
184
- var _ref4 = this.$defaultQuery || {},
185
- query = _ref4.query,
186
- queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref4, ["query"]);
194
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
195
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
196
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
197
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
187
198
 
188
199
  if (queryOptions) {
189
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, queryOptions), this.getAggsQuery()), false);
200
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
190
201
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
191
202
 
192
203
 
193
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
204
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
194
205
  this.updateQuery({
195
206
  componentId: this.internalComponent,
196
- query: query || null
207
+ query: query
197
208
  });
198
209
  }
199
210
  },
200
211
  customQuery: function customQuery(newVal, oldVal) {
201
- if (newVal && !index.isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
212
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
202
213
  var componentId = this.$props.componentId;
203
- this.$customQuery = newVal(this.$props);
204
-
205
- var _ref5 = this.$customQuery || {},
206
- query = _ref5.query,
207
- queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref5, ["query"]);
214
+ this.$customQuery = newVal(this.selectedValue, this.$props);
215
+ var query = extractQueryFromCustomQuery(this.$customQuery);
216
+ var queryOptions = getOptionsForCustomQuery(this.$customQuery);
208
217
 
209
218
  if (queryOptions) {
210
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, queryOptions), this.getAggsQuery()), false);
219
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
211
220
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
212
221
 
213
222
 
214
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
223
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
215
224
  this.updateQuery({
216
225
  componentId: componentId,
217
- query: query || null
226
+ query: query
218
227
  });
219
228
  }
220
229
  }
@@ -228,10 +237,10 @@ var ReactiveComponent = {
228
237
  isLoading = this.isLoading,
229
238
  selectedValue = this.selectedValue;
230
239
 
231
- var propsToBePassed = _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({
240
+ var propsToBePassed = _rollupPluginBabelHelpers._extends({
232
241
  error: error,
233
242
  loading: isLoading
234
- }, this.getData()), {}, {
243
+ }, this.getData(), {
235
244
  value: selectedValue,
236
245
  setQuery: this.setQuery
237
246
  });
@@ -294,6 +303,10 @@ var ReactiveComponent = {
294
303
  }
295
304
  };
296
305
 
306
+ ReactiveComponent.hasInternalComponent = function (props) {
307
+ return !!props.defaultQuery;
308
+ };
309
+
297
310
  var mapStateToProps = function mapStateToProps(state, props) {
298
311
  return {
299
312
  aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
@@ -308,7 +321,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
308
321
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
309
322
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
310
323
  componentProps: state.props[props.componentId],
311
- config: state.config
324
+ enableAppbase: state.config.enableAppbase
312
325
  };
313
326
  };
314
327