@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.
@@ -5517,7 +5517,7 @@
5517
5517
  }, size > 0 ? {
5518
5518
  numberOfPages: Math.ceil(total / size)
5519
5519
  } : null, {
5520
- time: time,
5520
+ time: time || 0,
5521
5521
  hidden: hidden,
5522
5522
  promoted: promotedResults && promotedResults.length
5523
5523
  });
@@ -8721,8 +8721,9 @@
8721
8721
  }
8722
8722
  }
8723
8723
  } else {
8724
+ var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + '_' + component : component;
8724
8725
  finalQuery = [].concat(_toConsumableArray(finalQuery), [{
8725
- preference: component
8726
+ preference: preference
8726
8727
  }, currentQuery]);
8727
8728
  }
8728
8729
  }
@@ -8927,8 +8928,9 @@
8927
8928
  appendToAggs: appendToAggs
8928
8929
  }));
8929
8930
  } else {
8931
+ var preference = store.config && store.config.analyticsConfig && store.config.analyticsConfig.userId ? store.config.analyticsConfig.userId + '_' + component : component;
8930
8932
  var _finalQuery = [{
8931
- preference: component
8933
+ preference: preference
8932
8934
  }, currentQuery];
8933
8935
  dispatch(msearch(_finalQuery, [component], appendToHits, false, appendToAggs));
8934
8936
  }
@@ -13882,18 +13884,17 @@
13882
13884
  ResultCardsWrapper: ResultCardsWrapper
13883
13885
  },
13884
13886
  data: function data() {
13885
- var props = this.$props;
13886
13887
  var currentPageState = 0;
13888
+ var defaultPage = this.defaultPage || -1;
13887
13889
 
13888
- if (props.defaultPage >= 0) {
13889
- currentPageState = props.defaultPage;
13890
- } else if (props.currentPage) {
13891
- currentPageState = Math.max(props.currentPage - 1, 0);
13890
+ if (defaultPage >= 0) {
13891
+ currentPageState = defaultPage;
13892
+ } else if (this.currentPage) {
13893
+ currentPageState = Math.max(this.currentPage - 1, 0);
13892
13894
  }
13893
13895
 
13894
13896
  this.__state = {
13895
- from: currentPageState * props.size,
13896
- isLoading: true,
13897
+ from: currentPageState * this.size,
13897
13898
  currentPageState: currentPageState
13898
13899
  };
13899
13900
  return this.__state;
@@ -13922,8 +13923,10 @@
13922
13923
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
13923
13924
  }
13924
13925
 
13925
- if (this.defaultPage >= 0) {
13926
- this.currentPageState = this.defaultPage;
13926
+ var defaultPage = this.defaultPage || -1;
13927
+
13928
+ if (defaultPage >= 0) {
13929
+ this.currentPageState = defaultPage;
13927
13930
  this.from = this.currentPageState * this.$props.size;
13928
13931
  }
13929
13932
 
@@ -14391,7 +14394,7 @@
14391
14394
  if (this.stats.numberOfResults) {
14392
14395
  return h("p", {
14393
14396
  "class": resultStats + " " + getClassName$1(this.$props.innerClass, 'resultStats')
14394
- }, [this.stats.numberOfResults, " results found in ", this.stats.time, "ms"]);
14397
+ }, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
14395
14398
  }
14396
14399
 
14397
14400
  return null;
@@ -14524,7 +14527,7 @@
14524
14527
  return {
14525
14528
  data: this.withClickIds(filteredResults),
14526
14529
  aggregationData: this.withClickIds(aggregationData || []),
14527
- promotedData: this.withClickIds(promotedResults),
14530
+ promotedData: this.withClickIds(promotedResults || []),
14528
14531
  rawData: this.rawData,
14529
14532
  resultStats: this.stats,
14530
14533
  customData: customData
@@ -14536,7 +14539,7 @@
14536
14539
 
14537
14540
  var data = _extends({
14538
14541
  error: error,
14539
- loading: isLoading,
14542
+ loading: isLoading || false,
14540
14543
  loadMore: this.loadMore,
14541
14544
  // TODO: Remove in v2
14542
14545
  triggerAnalytics: this.triggerClickAnalytics,
@@ -14551,13 +14554,13 @@
14551
14554
 
14552
14555
  var mapStateToProps$1 = function mapStateToProps(state, props) {
14553
14556
  return {
14554
- defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
14557
+ defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
14555
14558
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
14556
14559
  rawData: state.rawData[props.componentId],
14557
- aggregationData: state.compositeAggregations[props.componentId] || [],
14558
- promotedResults: state.promotedResults[props.componentId] || [],
14560
+ aggregationData: state.compositeAggregations[props.componentId],
14561
+ promotedResults: state.promotedResults[props.componentId],
14559
14562
  customData: state.customData[props.componentId],
14560
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
14563
+ time: state.hits[props.componentId] && state.hits[props.componentId].time,
14561
14564
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
14562
14565
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
14563
14566
  analytics: state.config && state.config.analytics,
@@ -14566,7 +14569,7 @@
14566
14569
  error: state.error[props.componentId],
14567
14570
  afterKey: state.aggregations[props.componentId] && state.aggregations[props.componentId][props.aggregationField] && state.aggregations[props.componentId][props.aggregationField].after_key,
14568
14571
  componentProps: state.props[props.componentId],
14569
- isLoading: state.isLoading[props.componentId] || false
14572
+ isLoading: state.isLoading[props.componentId]
14570
14573
  };
14571
14574
  };
14572
14575
 
@@ -25939,8 +25942,9 @@
25939
25942
  appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), transform_1(state, component.componentId, orderOfQueries));
25940
25943
  }
25941
25944
  } else {
25945
+ var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
25942
25946
  finalQuery = [].concat(finalQuery, [{
25943
- preference: component.componentId
25947
+ preference: preference
25944
25948
  }, currentQuery]);
25945
25949
  }
25946
25950
  }
@@ -26094,7 +26098,7 @@
26094
26098
  });
26095
26099
  }
26096
26100
 
26097
- var version = "1.23.2";
26101
+ var version = "1.23.3";
26098
26102
 
26099
26103
  var _templateObject$n, _templateObject2$a;
26100
26104