@appbaseio/reactivesearch-vue 1.16.0-alpha.3 → 1.16.0-alpha.32

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 (101) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +6388 -5403
  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-d2f1aeda.js +68 -0
  6. package/dist/cjs/{DownShift-b09da079.js → CancelSvg-82021d23.js} +60 -16
  7. package/dist/cjs/Card-4b915733.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-5a0a8849.js → ComponentWrapper-7302fe1a.js} +40 -21
  9. package/dist/cjs/{Container-f84e72fc.js → Container-8a08d663.js} +3 -11
  10. package/dist/cjs/DataSearch.js +341 -391
  11. package/dist/cjs/{DropDown-c66be1a8.js → DropDown-c46d8b0c.js} +80 -95
  12. package/dist/cjs/DynamicRangeSlider.js +81 -25
  13. package/dist/cjs/Flex-699639d2.js +52 -0
  14. package/dist/cjs/FormControlList-73497794.js +47 -0
  15. package/dist/cjs/Input-c6f181d5.js +79 -0
  16. package/dist/cjs/ListItem-933c27e4.js +46 -0
  17. package/dist/cjs/MultiDropdownList.js +71 -46
  18. package/dist/cjs/MultiList.js +49 -29
  19. package/dist/cjs/MultiRange.js +20 -14
  20. package/dist/cjs/{Pagination-91df3b77.js → Pagination-1b2320a7.js} +4 -3
  21. package/dist/cjs/RangeInput.js +29 -45
  22. package/dist/cjs/RangeSlider.js +31 -28
  23. package/dist/cjs/ReactiveBase.js +55 -34
  24. package/dist/cjs/ReactiveComponent.js +80 -36
  25. package/dist/cjs/ReactiveGoogleMap.js +326 -235
  26. package/dist/cjs/ReactiveList.js +149 -202
  27. package/dist/cjs/ResultCard.js +8 -6
  28. package/dist/cjs/ResultList.js +8 -6
  29. package/dist/cjs/SelectedFilters.js +25 -12
  30. package/dist/cjs/SingleDropdownList.js +70 -45
  31. package/dist/cjs/SingleList.js +44 -26
  32. package/dist/cjs/SingleRange.js +17 -11
  33. package/dist/cjs/StateProvider.js +11 -7
  34. package/dist/cjs/{Title-e9beb554.js → Title-39765ee6.js} +3 -11
  35. package/dist/cjs/ToggleButton.js +35 -16
  36. package/dist/cjs/{_rollupPluginBabelHelpers-280a574c.js → _rollupPluginBabelHelpers-4abdbfff.js} +11 -1
  37. package/dist/cjs/{index-e0583d76.js → index-d44a0a21.js} +87 -13
  38. package/dist/cjs/index.js +23 -19
  39. package/dist/cjs/initReactivesearch.js +80 -38
  40. package/dist/cjs/install.js +20 -18
  41. package/dist/cjs/ssr-c333c82c.js +39 -0
  42. package/dist/cjs/{utils-d1ea9f95.js → utils-23afb20b.js} +2 -2
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
  45. package/dist/es/Button-799185e2.js +59 -0
  46. package/dist/es/{DownShift-d8f2500f.js → CancelSvg-4d9e0857.js} +56 -17
  47. package/dist/es/Card-04b3c33e.js +23 -0
  48. package/dist/es/{ComponentWrapper-d0b21b95.js → ComponentWrapper-bbb717bc.js} +40 -21
  49. package/dist/es/Container-4383c6f0.js +10 -0
  50. package/dist/es/DataSearch.js +339 -389
  51. package/dist/es/{DropDown-5dbd69c2.js → DropDown-4edaa621.js} +79 -94
  52. package/dist/es/DynamicRangeSlider.js +81 -25
  53. package/dist/es/Flex-aac91505.js +47 -0
  54. package/dist/es/FormControlList-fe389a2e.js +40 -0
  55. package/dist/es/Input-d8519224.js +71 -0
  56. package/dist/es/ListItem-bdb6d53d.js +39 -0
  57. package/dist/es/MultiDropdownList.js +71 -46
  58. package/dist/es/MultiList.js +49 -29
  59. package/dist/es/MultiRange.js +20 -14
  60. package/dist/es/{Pagination-800af44f.js → Pagination-b3e4054a.js} +4 -3
  61. package/dist/es/RangeInput.js +29 -45
  62. package/dist/es/RangeSlider.js +31 -28
  63. package/dist/es/ReactiveBase.js +55 -34
  64. package/dist/es/ReactiveComponent.js +80 -36
  65. package/dist/es/ReactiveGoogleMap.js +326 -235
  66. package/dist/es/ReactiveList.js +149 -202
  67. package/dist/es/ResultCard.js +8 -6
  68. package/dist/es/ResultList.js +8 -6
  69. package/dist/es/SelectedFilters.js +25 -12
  70. package/dist/es/SingleDropdownList.js +70 -45
  71. package/dist/es/SingleList.js +44 -26
  72. package/dist/es/SingleRange.js +17 -11
  73. package/dist/es/StateProvider.js +11 -7
  74. package/dist/es/Title-579f8d6c.js +10 -0
  75. package/dist/es/ToggleButton.js +35 -16
  76. package/dist/es/{_rollupPluginBabelHelpers-c9fbe19f.js → _rollupPluginBabelHelpers-ecf6c03c.js} +11 -1
  77. package/dist/es/{index-1fe91a0a.js → index-5daa8276.js} +84 -14
  78. package/dist/es/index.js +23 -19
  79. package/dist/es/initReactivesearch.js +80 -38
  80. package/dist/es/install.js +20 -18
  81. package/dist/es/ssr-e3196de1.js +33 -0
  82. package/dist/es/{utils-ce3d86fd.js → utils-3a32e13f.js} +2 -2
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
  85. package/package.json +86 -78
  86. package/dist/cjs/Button-78d8bc26.js +0 -146
  87. package/dist/cjs/Card-b4af314f.js +0 -58
  88. package/dist/cjs/Flex-737c55be.js +0 -160
  89. package/dist/cjs/FormControlList-08dfb28e.js +0 -105
  90. package/dist/cjs/Input-643d02a7.js +0 -178
  91. package/dist/cjs/ListItem-0c58c5d2.js +0 -84
  92. package/dist/cjs/ssr-b7a729f9.js +0 -47
  93. package/dist/es/Button-6c71c66e.js +0 -137
  94. package/dist/es/Card-ecf70ba1.js +0 -51
  95. package/dist/es/Container-f5efec9e.js +0 -18
  96. package/dist/es/Flex-40a74d8a.js +0 -155
  97. package/dist/es/FormControlList-b96aebef.js +0 -98
  98. package/dist/es/Input-dfd9dd40.js +0 -170
  99. package/dist/es/ListItem-da73bc7d.js +0 -77
  100. package/dist/es/Title-22c2f3bf.js +0 -18
  101. package/dist/es/ssr-2f57791d.js +0 -41
@@ -6,15 +6,19 @@ 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-280a574c.js');
9
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.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-e0583d76.js');
16
- var ComponentWrapper = require('./ComponentWrapper-5a0a8849.js');
15
+ var index = require('./index-d44a0a21.js');
16
+ var ComponentWrapper = require('./ComponentWrapper-7302fe1a.js');
17
17
 
18
+ var _excluded = ["options"],
19
+ _excluded2 = ["query"],
20
+ _excluded3 = ["query"],
21
+ _excluded4 = ["query"];
18
22
  var updateQuery = configureStore.Actions.updateQuery,
19
23
  setQueryOptions = configureStore.Actions.setQueryOptions,
20
24
  setCustomQuery = configureStore.Actions.setCustomQuery,
@@ -38,7 +42,8 @@ var ReactiveComponent = {
38
42
  showFilter: VueTypes.bool.def(true),
39
43
  URLParams: VueTypes.bool.def(false),
40
44
  distinctField: vueTypes.types.string,
41
- distinctFieldConfig: vueTypes.types.props
45
+ distinctFieldConfig: vueTypes.types.props,
46
+ index: VueTypes.string
42
47
  },
43
48
  created: function created() {
44
49
  var _this = this;
@@ -47,25 +52,30 @@ var ReactiveComponent = {
47
52
  this.internalComponent = null;
48
53
  this.$defaultQuery = null; // Set custom query in store
49
54
 
50
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
55
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
51
56
  var customQuery = props.customQuery,
52
57
  componentId = props.componentId,
53
58
  filterLabel = props.filterLabel,
54
59
  showFilter = props.showFilter,
55
60
  URLParams = props.URLParams,
56
61
  distinctField = props.distinctField,
57
- distinctFieldConfig = props.distinctFieldConfig;
62
+ distinctFieldConfig = props.distinctFieldConfig,
63
+ index$1 = props.index;
58
64
 
59
- if (this.config.enableAppbase && this.aggregationField && this.aggregationField !== '') {
65
+ if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
60
66
  console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
61
67
  }
62
68
 
63
- if (!this.config.enableAppbase && (distinctField || distinctFieldConfig)) {
69
+ if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
64
70
  console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
65
71
  }
66
72
 
73
+ if (!this.enableAppbase && index$1) {
74
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
75
+ }
76
+
67
77
  if (customQuery) {
68
- var calcCustomQuery = customQuery(props);
78
+ var calcCustomQuery = customQuery(this.selectedValue, props);
69
79
 
70
80
  var _ref = calcCustomQuery || {},
71
81
  query = _ref.query;
@@ -73,12 +83,18 @@ var ReactiveComponent = {
73
83
  var customQueryOptions = calcCustomQuery ? getOptionsFromQuery(calcCustomQuery) : null;
74
84
 
75
85
  if (customQueryOptions) {
76
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, customQueryOptions), this.getAggsQuery()), false);
86
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
77
87
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
78
88
 
89
+ var queryToSet = query || null;
90
+
91
+ if (calcCustomQuery && calcCustomQuery.id) {
92
+ queryToSet = calcCustomQuery;
93
+ }
94
+
79
95
  this.updateQuery({
80
96
  componentId: componentId,
81
- query: query,
97
+ query: queryToSet,
82
98
  value: this.selectedValue || null,
83
99
  label: filterLabel,
84
100
  showFilter: showFilter,
@@ -88,10 +104,16 @@ var ReactiveComponent = {
88
104
 
89
105
  this.setQuery = function (_ref2) {
90
106
  var options = _ref2.options,
91
- obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref2, ["options"]);
107
+ obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref2, _excluded);
92
108
 
93
109
  if (options) {
94
- _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, options), _this.getAggsQuery()), false);
110
+ _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, options, _this.getAggsQuery()), false);
111
+ }
112
+
113
+ var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
114
+
115
+ if (obj && obj.query && obj.query.query) {
116
+ queryToBeSet = obj.query.query;
95
117
  } // Update customQuery field for RS API
96
118
 
97
119
 
@@ -99,13 +121,17 @@ var ReactiveComponent = {
99
121
  var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options);
100
122
 
101
123
  if (obj && obj.query) {
102
- customQueryCalc.query = obj.query;
124
+ if (obj.query.id) {
125
+ customQueryCalc = queryToBeSet;
126
+ } else {
127
+ customQueryCalc.query = obj.query;
128
+ }
103
129
  }
104
130
 
105
131
  _this.setCustomQuery(props.componentId, customQueryCalc);
106
132
  }
107
133
 
108
- _this.updateQuery(_rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, obj), {}, {
134
+ _this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
109
135
  componentId: props.componentId,
110
136
  label: props.filterLabel,
111
137
  showFilter: props.showFilter,
@@ -119,20 +145,26 @@ var ReactiveComponent = {
119
145
  },
120
146
  beforeMount: function beforeMount() {
121
147
  if (this.internalComponent && this.$props.defaultQuery) {
122
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
123
- this.$defaultQuery = this.$props.defaultQuery();
148
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
149
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
124
150
 
125
151
  var _ref3 = this.$defaultQuery || {},
126
152
  query = _ref3.query,
127
- queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref3, ["query"]);
153
+ queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref3, _excluded2);
128
154
 
129
155
  if (queryOptions) {
130
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, queryOptions), this.getAggsQuery()), false);
156
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
131
157
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
132
158
 
159
+ var queryToSet = query || null;
160
+
161
+ if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
162
+ queryToSet = this.$defaultQuery;
163
+ }
164
+
133
165
  this.updateQuery({
134
166
  componentId: this.internalComponent,
135
- query: query || null
167
+ query: queryToSet
136
168
  });
137
169
  }
138
170
  },
@@ -178,43 +210,55 @@ var ReactiveComponent = {
178
210
  }
179
211
  },
180
212
  defaultQuery: function defaultQuery(newVal, oldVal) {
181
- if (newVal && !index.isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
182
- this.$defaultQuery = newVal();
213
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
214
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
183
215
 
184
216
  var _ref4 = this.$defaultQuery || {},
185
217
  query = _ref4.query,
186
- queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref4, ["query"]);
218
+ queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref4, _excluded3);
187
219
 
188
220
  if (queryOptions) {
189
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, queryOptions), this.getAggsQuery()), false);
221
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
190
222
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
191
223
 
192
224
 
193
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
225
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
226
+ var queryToSet = query || null;
227
+
228
+ if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
229
+ queryToSet = this.$defaultQuery;
230
+ }
231
+
194
232
  this.updateQuery({
195
233
  componentId: this.internalComponent,
196
- query: query || null
234
+ query: queryToSet
197
235
  });
198
236
  }
199
237
  },
200
238
  customQuery: function customQuery(newVal, oldVal) {
201
- if (newVal && !index.isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
239
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
202
240
  var componentId = this.$props.componentId;
203
- this.$customQuery = newVal(this.$props);
241
+ this.$customQuery = newVal(this.selectedValue, this.$props);
204
242
 
205
243
  var _ref5 = this.$customQuery || {},
206
244
  query = _ref5.query,
207
- queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref5, ["query"]);
245
+ queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref5, _excluded4);
208
246
 
209
247
  if (queryOptions) {
210
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, queryOptions), this.getAggsQuery()), false);
248
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
211
249
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
212
250
 
213
251
 
214
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
252
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
253
+ var queryToSet = query || null;
254
+
255
+ if (this.$customQuery && this.$customQuery.id) {
256
+ queryToSet = this.$customQuery;
257
+ }
258
+
215
259
  this.updateQuery({
216
260
  componentId: componentId,
217
- query: query || null
261
+ query: queryToSet
218
262
  });
219
263
  }
220
264
  }
@@ -228,10 +272,10 @@ var ReactiveComponent = {
228
272
  isLoading = this.isLoading,
229
273
  selectedValue = this.selectedValue;
230
274
 
231
- var propsToBePassed = _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({
275
+ var propsToBePassed = _rollupPluginBabelHelpers._extends({
232
276
  error: error,
233
277
  loading: isLoading
234
- }, this.getData()), {}, {
278
+ }, this.getData(), {
235
279
  value: selectedValue,
236
280
  setQuery: this.setQuery
237
281
  });
@@ -308,7 +352,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
308
352
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
309
353
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
310
354
  componentProps: state.props[props.componentId],
311
- config: state.config
355
+ enableAppbase: state.config.enableAppbase
312
356
  };
313
357
  };
314
358