@appbaseio/reactivesearch-vue 1.23.2 → 1.23.3

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.
@@ -446,18 +446,17 @@ var ReactiveList = {
446
446
  ResultCardsWrapper: ResultCardsWrapper
447
447
  },
448
448
  data: function data() {
449
- var props = this.$props;
450
449
  var currentPageState = 0;
450
+ var defaultPage = this.defaultPage || -1;
451
451
 
452
- if (props.defaultPage >= 0) {
453
- currentPageState = props.defaultPage;
454
- } else if (props.currentPage) {
455
- currentPageState = Math.max(props.currentPage - 1, 0);
452
+ if (defaultPage >= 0) {
453
+ currentPageState = defaultPage;
454
+ } else if (this.currentPage) {
455
+ currentPageState = Math.max(this.currentPage - 1, 0);
456
456
  }
457
457
 
458
458
  this.__state = {
459
- from: currentPageState * props.size,
460
- isLoading: true,
459
+ from: currentPageState * this.size,
461
460
  currentPageState: currentPageState
462
461
  };
463
462
  return this.__state;
@@ -486,8 +485,10 @@ var ReactiveList = {
486
485
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
487
486
  }
488
487
 
489
- if (this.defaultPage >= 0) {
490
- this.currentPageState = this.defaultPage;
488
+ var defaultPage = this.defaultPage || -1;
489
+
490
+ if (defaultPage >= 0) {
491
+ this.currentPageState = defaultPage;
491
492
  this.from = this.currentPageState * this.$props.size;
492
493
  }
493
494
 
@@ -955,7 +956,7 @@ var ReactiveList = {
955
956
  if (this.stats.numberOfResults) {
956
957
  return h("p", {
957
958
  "class": resultStats + " " + getClassName$1(this.$props.innerClass, 'resultStats')
958
- }, [this.stats.numberOfResults, " results found in ", this.stats.time, "ms"]);
959
+ }, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
959
960
  }
960
961
 
961
962
  return null;
@@ -1088,7 +1089,7 @@ var ReactiveList = {
1088
1089
  return {
1089
1090
  data: this.withClickIds(filteredResults),
1090
1091
  aggregationData: this.withClickIds(aggregationData || []),
1091
- promotedData: this.withClickIds(promotedResults),
1092
+ promotedData: this.withClickIds(promotedResults || []),
1092
1093
  rawData: this.rawData,
1093
1094
  resultStats: this.stats,
1094
1095
  customData: customData
@@ -1100,7 +1101,7 @@ var ReactiveList = {
1100
1101
 
1101
1102
  var data = _rollupPluginBabelHelpers._extends({
1102
1103
  error: error,
1103
- loading: isLoading,
1104
+ loading: isLoading || false,
1104
1105
  loadMore: this.loadMore,
1105
1106
  // TODO: Remove in v2
1106
1107
  triggerAnalytics: this.triggerClickAnalytics,
@@ -1115,13 +1116,13 @@ var ReactiveList = {
1115
1116
 
1116
1117
  var mapStateToProps = function mapStateToProps(state, props) {
1117
1118
  return {
1118
- defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
1119
+ defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
1119
1120
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
1120
1121
  rawData: state.rawData[props.componentId],
1121
- aggregationData: state.compositeAggregations[props.componentId] || [],
1122
- promotedResults: state.promotedResults[props.componentId] || [],
1122
+ aggregationData: state.compositeAggregations[props.componentId],
1123
+ promotedResults: state.promotedResults[props.componentId],
1123
1124
  customData: state.customData[props.componentId],
1124
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1125
+ time: state.hits[props.componentId] && state.hits[props.componentId].time,
1125
1126
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
1126
1127
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
1127
1128
  analytics: state.config && state.config.analytics,
@@ -1130,7 +1131,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
1130
1131
  error: state.error[props.componentId],
1131
1132
  afterKey: state.aggregations[props.componentId] && state.aggregations[props.componentId][props.aggregationField] && state.aggregations[props.componentId][props.aggregationField].after_key,
1132
1133
  componentProps: state.props[props.componentId],
1133
- isLoading: state.isLoading[props.componentId] || false
1134
+ isLoading: state.isLoading[props.componentId]
1134
1135
  };
1135
1136
  };
1136
1137
 
@@ -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
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "1.23.2";
5
+ var version = "1.23.3";
6
6
 
7
7
  exports.default = version;
@@ -438,18 +438,17 @@ var ReactiveList = {
438
438
  ResultCardsWrapper: ResultCardsWrapper
439
439
  },
440
440
  data: function data() {
441
- var props = this.$props;
442
441
  var currentPageState = 0;
442
+ var defaultPage = this.defaultPage || -1;
443
443
 
444
- if (props.defaultPage >= 0) {
445
- currentPageState = props.defaultPage;
446
- } else if (props.currentPage) {
447
- currentPageState = Math.max(props.currentPage - 1, 0);
444
+ if (defaultPage >= 0) {
445
+ currentPageState = defaultPage;
446
+ } else if (this.currentPage) {
447
+ currentPageState = Math.max(this.currentPage - 1, 0);
448
448
  }
449
449
 
450
450
  this.__state = {
451
- from: currentPageState * props.size,
452
- isLoading: true,
451
+ from: currentPageState * this.size,
453
452
  currentPageState: currentPageState
454
453
  };
455
454
  return this.__state;
@@ -478,8 +477,10 @@ var ReactiveList = {
478
477
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
479
478
  }
480
479
 
481
- if (this.defaultPage >= 0) {
482
- this.currentPageState = this.defaultPage;
480
+ var defaultPage = this.defaultPage || -1;
481
+
482
+ if (defaultPage >= 0) {
483
+ this.currentPageState = defaultPage;
483
484
  this.from = this.currentPageState * this.$props.size;
484
485
  }
485
486
 
@@ -947,7 +948,7 @@ var ReactiveList = {
947
948
  if (this.stats.numberOfResults) {
948
949
  return h("p", {
949
950
  "class": resultStats + " " + getClassName$1(this.$props.innerClass, 'resultStats')
950
- }, [this.stats.numberOfResults, " results found in ", this.stats.time, "ms"]);
951
+ }, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
951
952
  }
952
953
 
953
954
  return null;
@@ -1080,7 +1081,7 @@ var ReactiveList = {
1080
1081
  return {
1081
1082
  data: this.withClickIds(filteredResults),
1082
1083
  aggregationData: this.withClickIds(aggregationData || []),
1083
- promotedData: this.withClickIds(promotedResults),
1084
+ promotedData: this.withClickIds(promotedResults || []),
1084
1085
  rawData: this.rawData,
1085
1086
  resultStats: this.stats,
1086
1087
  customData: customData
@@ -1092,7 +1093,7 @@ var ReactiveList = {
1092
1093
 
1093
1094
  var data = _extends({
1094
1095
  error: error,
1095
- loading: isLoading,
1096
+ loading: isLoading || false,
1096
1097
  loadMore: this.loadMore,
1097
1098
  // TODO: Remove in v2
1098
1099
  triggerAnalytics: this.triggerClickAnalytics,
@@ -1107,13 +1108,13 @@ var ReactiveList = {
1107
1108
 
1108
1109
  var mapStateToProps = function mapStateToProps(state, props) {
1109
1110
  return {
1110
- defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
1111
+ defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
1111
1112
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
1112
1113
  rawData: state.rawData[props.componentId],
1113
- aggregationData: state.compositeAggregations[props.componentId] || [],
1114
- promotedResults: state.promotedResults[props.componentId] || [],
1114
+ aggregationData: state.compositeAggregations[props.componentId],
1115
+ promotedResults: state.promotedResults[props.componentId],
1115
1116
  customData: state.customData[props.componentId],
1116
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1117
+ time: state.hits[props.componentId] && state.hits[props.componentId].time,
1117
1118
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
1118
1119
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
1119
1120
  analytics: state.config && state.config.analytics,
@@ -1122,7 +1123,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
1122
1123
  error: state.error[props.componentId],
1123
1124
  afterKey: state.aggregations[props.componentId] && state.aggregations[props.componentId][props.aggregationField] && state.aggregations[props.componentId][props.aggregationField].after_key,
1124
1125
  componentProps: state.props[props.componentId],
1125
- isLoading: state.isLoading[props.componentId] || false
1126
+ isLoading: state.isLoading[props.componentId]
1126
1127
  };
1127
1128
  };
1128
1129
 
@@ -307,8 +307,9 @@ function initReactivesearch(componentCollection, searchState, settings) {
307
307
  appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), getDependentQueries(state, component.componentId, orderOfQueries));
308
308
  }
309
309
  } else {
310
+ var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
310
311
  finalQuery = [].concat(finalQuery, [{
311
- preference: component.componentId
312
+ preference: preference
312
313
  }, currentQuery]);
313
314
  }
314
315
  }
@@ -1,3 +1,3 @@
1
- var version = "1.23.2";
1
+ var version = "1.23.3";
2
2
 
3
3
  export default version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appbaseio/reactivesearch-vue",
3
- "version": "1.23.2",
3
+ "version": "1.23.3",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "jsnext:main": "dist/es/index.js",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "sideEffects": false,
36
36
  "dependencies": {
37
- "@appbaseio/reactivecore": "9.12.7",
37
+ "@appbaseio/reactivecore": "9.12.8",
38
38
  "@appbaseio/vue-emotion": "0.4.4",
39
39
  "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
40
40
  "appbase-js": "^4.4.1",