@appbaseio/reactivesearch-vue 1.23.0 → 1.23.4

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.
@@ -9,6 +9,7 @@ var configureStore__default = _interopDefault(configureStore);
9
9
  var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
10
10
  var VueTypes = _interopDefault(require('vue-types'));
11
11
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
12
+ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
12
13
  require('emotion');
13
14
  var styled = require('@appbaseio/vue-emotion');
14
15
  var styled__default = _interopDefault(styled);
@@ -20,7 +21,6 @@ var index = require('./index-89c39a9e.js');
20
21
  var ComponentWrapper = require('./ComponentWrapper-32481890.js');
21
22
  var Title = require('./Title-584a8cc8.js');
22
23
  var Flex = require('./Flex-f146cdad.js');
23
- var helper = require('@appbaseio/reactivecore/lib/utils/helper');
24
24
  var hotkeys = _interopDefault(require('hotkeys-js'));
25
25
  var Input = require('./Input-3cc3fa59.js');
26
26
  require('compute-scroll-into-view');
@@ -9,13 +9,13 @@ var configureStore__default = _interopDefault(configureStore);
9
9
  var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
10
10
  var VueTypes = _interopDefault(require('vue-types'));
11
11
  require('@appbaseio/reactivecore/lib/utils/constants');
12
+ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
12
13
  var styled = require('@appbaseio/vue-emotion');
13
14
  var styled__default = _interopDefault(styled);
14
15
  var vueTypes = require('./vueTypes-22b4fd3a.js');
15
16
  require('redux');
16
17
  var index = require('./index-89c39a9e.js');
17
18
  var _mergeJSXProps = _interopDefault(require('@vue/babel-helper-vue-jsx-merge-props'));
18
- var helper = require('@appbaseio/reactivecore/lib/utils/helper');
19
19
  var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
20
20
  var Appbase = _interopDefault(require('appbase-js'));
21
21
  require('url-search-params-polyfill');
@@ -86,9 +86,15 @@ var ReactiveComponent = {
86
86
  this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
87
87
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
88
88
 
89
+ var queryToSet = query || null;
90
+
91
+ if (calcCustomQuery && calcCustomQuery.id) {
92
+ queryToSet = calcCustomQuery;
93
+ }
94
+
89
95
  this.updateQuery({
90
96
  componentId: componentId,
91
- query: query,
97
+ queryToSet: queryToSet,
92
98
  value: this.selectedValue || null,
93
99
  label: filterLabel,
94
100
  showFilter: showFilter,
@@ -102,6 +108,12 @@ var ReactiveComponent = {
102
108
 
103
109
  if (options) {
104
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;
105
117
  } // Update customQuery field for RS API
106
118
 
107
119
 
@@ -109,7 +121,11 @@ var ReactiveComponent = {
109
121
  var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options);
110
122
 
111
123
  if (obj && obj.query) {
112
- customQueryCalc.query = obj.query;
124
+ if (obj.query.id) {
125
+ customQueryCalc = queryToBeSet;
126
+ } else {
127
+ customQueryCalc.query = obj.query;
128
+ }
113
129
  }
114
130
 
115
131
  _this.setCustomQuery(props.componentId, customQueryCalc);
@@ -140,9 +156,15 @@ var ReactiveComponent = {
140
156
  this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
141
157
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
142
158
 
159
+ var queryToSet = query || null;
160
+
161
+ if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
162
+ queryToSet = this.$defaultQuery;
163
+ }
164
+
143
165
  this.updateQuery({
144
166
  componentId: this.internalComponent,
145
- query: query || null
167
+ query: queryToSet
146
168
  });
147
169
  }
148
170
  },
@@ -201,9 +223,15 @@ var ReactiveComponent = {
201
223
 
202
224
 
203
225
  index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
226
+ var queryToSet = query || null;
227
+
228
+ if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
229
+ queryToSet = this.$defaultQuery;
230
+ }
231
+
204
232
  this.updateQuery({
205
233
  componentId: this.internalComponent,
206
- query: query || null
234
+ query: queryToSet
207
235
  });
208
236
  }
209
237
  },
@@ -222,9 +250,15 @@ var ReactiveComponent = {
222
250
 
223
251
 
224
252
  index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
253
+ var queryToSet = query || null;
254
+
255
+ if (this.$customQuery && this.$customQuery.id) {
256
+ queryToSet = this.$customQuery;
257
+ }
258
+
225
259
  this.updateQuery({
226
260
  componentId: componentId,
227
- query: query || null
261
+ query: queryToSet
228
262
  });
229
263
  }
230
264
  }
@@ -9,6 +9,7 @@ var configureStore__default = _interopDefault(configureStore);
9
9
  var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
10
10
  var VueTypes = _interopDefault(require('vue-types'));
11
11
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
12
+ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
12
13
  var emotion = require('emotion');
13
14
  var styled = require('@appbaseio/vue-emotion');
14
15
  var styled__default = _interopDefault(styled);
@@ -446,18 +447,17 @@ var ReactiveList = {
446
447
  ResultCardsWrapper: ResultCardsWrapper
447
448
  },
448
449
  data: function data() {
449
- var props = this.$props;
450
450
  var currentPageState = 0;
451
+ var defaultPage = this.defaultPage || -1;
451
452
 
452
- if (props.defaultPage >= 0) {
453
- currentPageState = props.defaultPage;
454
- } else if (props.currentPage) {
455
- currentPageState = Math.max(props.currentPage - 1, 0);
453
+ if (defaultPage >= 0) {
454
+ currentPageState = defaultPage;
455
+ } else if (this.currentPage) {
456
+ currentPageState = Math.max(this.currentPage - 1, 0);
456
457
  }
457
458
 
458
459
  this.__state = {
459
- from: currentPageState * props.size,
460
- isLoading: true,
460
+ from: currentPageState * this.size,
461
461
  currentPageState: currentPageState
462
462
  };
463
463
  return this.__state;
@@ -486,8 +486,10 @@ var ReactiveList = {
486
486
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
487
487
  }
488
488
 
489
- if (this.defaultPage >= 0) {
490
- this.currentPageState = this.defaultPage;
489
+ var defaultPage = this.defaultPage || -1;
490
+
491
+ if (defaultPage >= 0) {
492
+ this.currentPageState = defaultPage;
491
493
  this.from = this.currentPageState * this.$props.size;
492
494
  }
493
495
 
@@ -554,12 +556,9 @@ var ReactiveList = {
554
556
  return this.$listeners && this.$listeners.resultStats;
555
557
  },
556
558
  stats: function stats() {
557
- var _this$getAllData = this.getAllData(),
558
- filteredResults = _this$getAllData.filteredResults;
559
-
560
559
  return _rollupPluginBabelHelpers._extends({}, getResultStats(this), {
561
560
  currentPage: this.currentPageState,
562
- displayedResults: filteredResults.length
561
+ displayedResults: this.data.length
563
562
  });
564
563
  },
565
564
  hasCustomRender: function hasCustomRender() {
@@ -568,6 +567,27 @@ var ReactiveList = {
568
567
  showInfiniteScroll: function showInfiniteScroll() {
569
568
  // Pagination has higher priority then infinite scroll
570
569
  return this.infiniteScroll && !this.shouldRenderPagination;
570
+ },
571
+ data: function data() {
572
+ var results = parseHits(this.hits) || [];
573
+ var parsedPromotedResults = parseHits(this.promotedResults) || [];
574
+ var filteredResults = results;
575
+
576
+ if (parsedPromotedResults.length) {
577
+ var ids = parsedPromotedResults.map(function (item) {
578
+ return item._id;
579
+ }).filter(Boolean);
580
+
581
+ if (ids) {
582
+ filteredResults = filteredResults.filter(function (item) {
583
+ return !ids.includes(item._id);
584
+ });
585
+ }
586
+
587
+ filteredResults = [].concat(parsedPromotedResults, filteredResults);
588
+ }
589
+
590
+ return helper.withClickIds(filteredResults);
571
591
  }
572
592
  },
573
593
  watch: {
@@ -649,7 +669,7 @@ var ReactiveList = {
649
669
  }
650
670
  },
651
671
  hits: function hits(newVal, oldVal) {
652
- this.$emit('data', this.getAllData());
672
+ this.$emit('data', this.getData());
653
673
 
654
674
  if (this.shouldRenderPagination) {
655
675
  // called when page is changed
@@ -834,13 +854,10 @@ var ReactiveList = {
834
854
 
835
855
  var h = this.$createElement;
836
856
  var size = this.$props.size;
837
- var hits = this.$data.hits;
838
- var results = parseHits(hits) || [];
839
- var filteredResults = results;
840
857
  var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
841
858
  var element = this.hasCustomRender ? this.getComponent() : h("div", {
842
859
  "class": this.$props.listClass + " " + getClassName$1(this.$props.innerClass, 'list')
843
- }, [[].concat(filteredResults).map(function (item, index) {
860
+ }, [this.data.map(function (item, index) {
844
861
  return renderItem({
845
862
  item: item,
846
863
  triggerClickAnalytics: function triggerClickAnalytics() {
@@ -851,7 +868,7 @@ var ReactiveList = {
851
868
 
852
869
  return this.analytics ? h(ImpressionTracker$1, {
853
870
  "attrs": {
854
- "hits": filteredResults
871
+ "hits": this.data
855
872
  }
856
873
  }, [element]) : element;
857
874
  },
@@ -955,7 +972,7 @@ var ReactiveList = {
955
972
  if (this.stats.numberOfResults) {
956
973
  return h("p", {
957
974
  "class": resultStats + " " + getClassName$1(this.$props.innerClass, 'resultStats')
958
- }, [this.stats.numberOfResults, " results found in ", this.stats.time, "ms"]);
975
+ }, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
959
976
  }
960
977
 
961
978
  return null;
@@ -1031,8 +1048,8 @@ var ReactiveList = {
1031
1048
  })]);
1032
1049
  },
1033
1050
  withClickIds: function withClickIds(results) {
1034
- var _this$getAllData2 = this.getAllData(),
1035
- base = _this$getAllData2.base;
1051
+ var _this$getAllData = this.getAllData(),
1052
+ base = _this$getAllData.base;
1036
1053
 
1037
1054
  return results.map(function (result, index) {
1038
1055
  return _rollupPluginBabelHelpers._extends({}, result, {
@@ -1050,26 +1067,9 @@ var ReactiveList = {
1050
1067
  hits = this.hits;
1051
1068
  var results = parseHits(hits) || [];
1052
1069
  var parsedPromotedResults = parseHits(promotedResults) || [];
1053
- var filteredResults = results;
1054
1070
  var base = currentPage * size;
1055
-
1056
- if (parsedPromotedResults.length) {
1057
- var ids = parsedPromotedResults.map(function (item) {
1058
- return item._id;
1059
- }).filter(Boolean);
1060
-
1061
- if (ids) {
1062
- filteredResults = filteredResults.filter(function (item) {
1063
- return !ids.includes(item._id);
1064
- });
1065
- }
1066
-
1067
- filteredResults = [].concat(parsedPromotedResults, filteredResults);
1068
- }
1069
-
1070
1071
  return {
1071
1072
  results: results,
1072
- filteredResults: filteredResults,
1073
1073
  customData: customData || {},
1074
1074
  promotedResults: parsedPromotedResults,
1075
1075
  aggregationData: aggregationData,
@@ -1079,16 +1079,15 @@ var ReactiveList = {
1079
1079
  };
1080
1080
  },
1081
1081
  getData: function getData() {
1082
- var _this$getAllData3 = this.getAllData(),
1083
- filteredResults = _this$getAllData3.filteredResults,
1084
- promotedResults = _this$getAllData3.promotedResults,
1085
- aggregationData = _this$getAllData3.aggregationData,
1086
- customData = _this$getAllData3.customData;
1082
+ var _this$getAllData2 = this.getAllData(),
1083
+ promotedResults = _this$getAllData2.promotedResults,
1084
+ aggregationData = _this$getAllData2.aggregationData,
1085
+ customData = _this$getAllData2.customData;
1087
1086
 
1088
1087
  return {
1089
- data: this.withClickIds(filteredResults),
1088
+ data: this.data,
1090
1089
  aggregationData: this.withClickIds(aggregationData || []),
1091
- promotedData: this.withClickIds(promotedResults),
1090
+ promotedData: this.withClickIds(promotedResults || []),
1092
1091
  rawData: this.rawData,
1093
1092
  resultStats: this.stats,
1094
1093
  customData: customData
@@ -1100,7 +1099,7 @@ var ReactiveList = {
1100
1099
 
1101
1100
  var data = _rollupPluginBabelHelpers._extends({
1102
1101
  error: error,
1103
- loading: isLoading,
1102
+ loading: isLoading || false,
1104
1103
  loadMore: this.loadMore,
1105
1104
  // TODO: Remove in v2
1106
1105
  triggerAnalytics: this.triggerClickAnalytics,
@@ -1115,13 +1114,13 @@ var ReactiveList = {
1115
1114
 
1116
1115
  var mapStateToProps = function mapStateToProps(state, props) {
1117
1116
  return {
1118
- defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
1117
+ defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
1119
1118
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
1120
1119
  rawData: state.rawData[props.componentId],
1121
- aggregationData: state.compositeAggregations[props.componentId] || [],
1122
- promotedResults: state.promotedResults[props.componentId] || [],
1120
+ aggregationData: state.compositeAggregations[props.componentId],
1121
+ promotedResults: state.promotedResults[props.componentId],
1123
1122
  customData: state.customData[props.componentId],
1124
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1123
+ time: state.hits[props.componentId] && state.hits[props.componentId].time,
1125
1124
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
1126
1125
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
1127
1126
  analytics: state.config && state.config.analytics,
@@ -1130,7 +1129,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
1130
1129
  error: state.error[props.componentId],
1131
1130
  afterKey: state.aggregations[props.componentId] && state.aggregations[props.componentId][props.aggregationField] && state.aggregations[props.componentId][props.aggregationField].after_key,
1132
1131
  componentProps: state.props[props.componentId],
1133
- isLoading: state.isLoading[props.componentId] || false
1132
+ isLoading: state.isLoading[props.componentId]
1134
1133
  };
1135
1134
  };
1136
1135
 
@@ -96,7 +96,7 @@ var StateProvider = {
96
96
  watch: {
97
97
  searchState: function searchState(newVal, oldVal) {
98
98
  if (this.isStateChanged(newVal, oldVal)) {
99
- this.$emit('change', newVal, oldVal);
99
+ this.$emit('change', oldVal, newVal);
100
100
  }
101
101
  },
102
102
  selectedValues: function selectedValues(newVal, oldVal) {
package/dist/cjs/index.js CHANGED
@@ -6,6 +6,7 @@ require('@appbaseio/reactivecore');
6
6
  require('./_rollupPluginBabelHelpers-f127c8b7.js');
7
7
  require('vue-types');
8
8
  require('@appbaseio/reactivecore/lib/utils/constants');
9
+ require('@appbaseio/reactivecore/lib/utils/helper');
9
10
  require('emotion');
10
11
  require('@appbaseio/vue-emotion');
11
12
  require('polished');
@@ -21,7 +22,6 @@ require('./Title-584a8cc8.js');
21
22
  require('./ListItem-b40adb04.js');
22
23
  require('./Card-fd94ef07.js');
23
24
  require('./Flex-f146cdad.js');
24
- require('@appbaseio/reactivecore/lib/utils/helper');
25
25
  require('@appbaseio/reactivecore/lib/actions/analytics');
26
26
  require('appbase-js');
27
27
  require('url-search-params-polyfill');
@@ -6,8 +6,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
6
6
 
7
7
  var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
8
8
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
9
- var transform = require('@appbaseio/reactivecore/lib/utils/transform');
10
9
  var helper = require('@appbaseio/reactivecore/lib/utils/helper');
10
+ var transform = require('@appbaseio/reactivecore/lib/utils/transform');
11
11
  var Appbase = _interopDefault(require('appbase-js'));
12
12
  var valueReducer = _interopDefault(require('@appbaseio/reactivecore/lib/reducers/valueReducer'));
13
13
  var queryReducer = _interopDefault(require('@appbaseio/reactivecore/lib/reducers/queryReducer'));
@@ -313,8 +313,9 @@ function initReactivesearch(componentCollection, searchState, settings) {
313
313
  appbaseQuery = _rollupPluginBabelHelpers._extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), transform.getDependentQueries(state, component.componentId, orderOfQueries));
314
314
  }
315
315
  } else {
316
+ var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
316
317
  finalQuery = [].concat(finalQuery, [{
317
- preference: component.componentId
318
+ preference: preference
318
319
  }, currentQuery]);
319
320
  }
320
321
  }
@@ -6,6 +6,7 @@ require('@appbaseio/reactivecore');
6
6
  require('./_rollupPluginBabelHelpers-f127c8b7.js');
7
7
  require('vue-types');
8
8
  require('@appbaseio/reactivecore/lib/utils/constants');
9
+ require('@appbaseio/reactivecore/lib/utils/helper');
9
10
  require('emotion');
10
11
  require('@appbaseio/vue-emotion');
11
12
  require('polished');
@@ -21,7 +22,6 @@ require('./Title-584a8cc8.js');
21
22
  require('./ListItem-b40adb04.js');
22
23
  require('./Card-fd94ef07.js');
23
24
  require('./Flex-f146cdad.js');
24
- require('@appbaseio/reactivecore/lib/utils/helper');
25
25
  require('@appbaseio/reactivecore/lib/actions/analytics');
26
26
  require('appbase-js');
27
27
  require('url-search-params-polyfill');
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "1.23.0";
5
+ var version = "1.23.4";
6
6
 
7
7
  exports.default = version;
@@ -2,6 +2,7 @@ import { helper, Actions, causes } from '@appbaseio/reactivecore';
2
2
  import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-0f24d612.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
+ import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
5
6
  import 'emotion';
6
7
  import styled, { css, cx, injectGlobal } from '@appbaseio/vue-emotion';
7
8
  import 'polished';
@@ -12,7 +13,6 @@ import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as
12
13
  import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
13
14
  import { T as Title } from './Title-3522ff56.js';
14
15
  import { F as Flex } from './Flex-8770345d.js';
15
- import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
16
16
  import hotkeys from 'hotkeys-js';
17
17
  import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-08bb1bcf.js';
18
18
  import 'compute-scroll-into-view';
@@ -2,12 +2,12 @@ import configureStore, { Actions, helper } from '@appbaseio/reactivecore';
2
2
  import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-0f24d612.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
+ import { isEqual as isEqual$1 } from '@appbaseio/reactivecore/lib/utils/helper';
5
6
  import styled from '@appbaseio/vue-emotion';
6
7
  import { t as types } from './vueTypes-e89c8a3c.js';
7
8
  import 'redux';
8
9
  import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-cb1950b6.js';
9
10
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
10
- import { isEqual as isEqual$1 } from '@appbaseio/reactivecore/lib/utils/helper';
11
11
  import { updateAnalyticsConfig } from '@appbaseio/reactivecore/lib/actions/analytics';
12
12
  import Appbase from 'appbase-js';
13
13
  import 'url-search-params-polyfill';
@@ -79,9 +79,15 @@ var ReactiveComponent = {
79
79
  this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
80
80
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
81
81
 
82
+ var queryToSet = query || null;
83
+
84
+ if (calcCustomQuery && calcCustomQuery.id) {
85
+ queryToSet = calcCustomQuery;
86
+ }
87
+
82
88
  this.updateQuery({
83
89
  componentId: componentId,
84
- query: query,
90
+ queryToSet: queryToSet,
85
91
  value: this.selectedValue || null,
86
92
  label: filterLabel,
87
93
  showFilter: showFilter,
@@ -95,6 +101,12 @@ var ReactiveComponent = {
95
101
 
96
102
  if (options) {
97
103
  _this.setQueryOptions(props.componentId, _extends({}, options, _this.getAggsQuery()), false);
104
+ }
105
+
106
+ var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
107
+
108
+ if (obj && obj.query && obj.query.query) {
109
+ queryToBeSet = obj.query.query;
98
110
  } // Update customQuery field for RS API
99
111
 
100
112
 
@@ -102,7 +114,11 @@ var ReactiveComponent = {
102
114
  var customQueryCalc = _extends({}, options);
103
115
 
104
116
  if (obj && obj.query) {
105
- customQueryCalc.query = obj.query;
117
+ if (obj.query.id) {
118
+ customQueryCalc = queryToBeSet;
119
+ } else {
120
+ customQueryCalc.query = obj.query;
121
+ }
106
122
  }
107
123
 
108
124
  _this.setCustomQuery(props.componentId, customQueryCalc);
@@ -133,9 +149,15 @@ var ReactiveComponent = {
133
149
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
134
150
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
135
151
 
152
+ var queryToSet = query || null;
153
+
154
+ if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
155
+ queryToSet = this.$defaultQuery;
156
+ }
157
+
136
158
  this.updateQuery({
137
159
  componentId: this.internalComponent,
138
- query: query || null
160
+ query: queryToSet
139
161
  });
140
162
  }
141
163
  },
@@ -194,9 +216,15 @@ var ReactiveComponent = {
194
216
 
195
217
 
196
218
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
219
+ var queryToSet = query || null;
220
+
221
+ if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
222
+ queryToSet = this.$defaultQuery;
223
+ }
224
+
197
225
  this.updateQuery({
198
226
  componentId: this.internalComponent,
199
- query: query || null
227
+ query: queryToSet
200
228
  });
201
229
  }
202
230
  },
@@ -215,9 +243,15 @@ var ReactiveComponent = {
215
243
 
216
244
 
217
245
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
246
+ var queryToSet = query || null;
247
+
248
+ if (this.$customQuery && this.$customQuery.id) {
249
+ queryToSet = this.$customQuery;
250
+ }
251
+
218
252
  this.updateQuery({
219
253
  componentId: componentId,
220
- query: query || null
254
+ query: queryToSet
221
255
  });
222
256
  }
223
257
  }