@appbaseio/reactivesearch-vue 1.16.0-alpha.24 → 1.16.0-alpha.25

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.
@@ -14024,12 +14024,9 @@
14024
14024
  return this.$listeners && this.$listeners.resultStats;
14025
14025
  },
14026
14026
  stats: function stats() {
14027
- var _this$getAllData = this.getAllData(),
14028
- filteredResults = _this$getAllData.filteredResults;
14029
-
14030
14027
  return _extends({}, getResultStats(this), {
14031
14028
  currentPage: this.currentPageState,
14032
- displayedResults: filteredResults.length
14029
+ displayedResults: this.data.length
14033
14030
  });
14034
14031
  },
14035
14032
  hasCustomRender: function hasCustomRender() {
@@ -14038,6 +14035,27 @@
14038
14035
  showInfiniteScroll: function showInfiniteScroll() {
14039
14036
  // Pagination has higher priority then infinite scroll
14040
14037
  return this.infiniteScroll && !this.shouldRenderPagination;
14038
+ },
14039
+ data: function data() {
14040
+ var results = parseHits(this.hits) || [];
14041
+ var parsedPromotedResults = parseHits(this.promotedResults) || [];
14042
+ var filteredResults = results;
14043
+
14044
+ if (parsedPromotedResults.length) {
14045
+ var ids = parsedPromotedResults.map(function (item) {
14046
+ return item._id;
14047
+ }).filter(Boolean);
14048
+
14049
+ if (ids) {
14050
+ filteredResults = filteredResults.filter(function (item) {
14051
+ return !ids.includes(item._id);
14052
+ });
14053
+ }
14054
+
14055
+ filteredResults = [].concat(parsedPromotedResults, filteredResults);
14056
+ }
14057
+
14058
+ return helper_2(filteredResults);
14041
14059
  }
14042
14060
  },
14043
14061
  watch: {
@@ -14119,7 +14137,7 @@
14119
14137
  }
14120
14138
  },
14121
14139
  hits: function hits(newVal, oldVal) {
14122
- this.$emit('data', this.getAllData());
14140
+ this.$emit('data', this.getData());
14123
14141
 
14124
14142
  if (this.shouldRenderPagination) {
14125
14143
  // called when page is changed
@@ -14304,13 +14322,10 @@
14304
14322
 
14305
14323
  var h = this.$createElement;
14306
14324
  var size = this.$props.size;
14307
- var hits = this.$data.hits;
14308
- var results = parseHits(hits) || [];
14309
- var filteredResults = results;
14310
14325
  var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
14311
14326
  var element = this.hasCustomRender ? this.getComponent() : h("div", {
14312
14327
  "class": this.$props.listClass + " " + getClassName$1(this.$props.innerClass, 'list')
14313
- }, [[].concat(filteredResults).map(function (item, index) {
14328
+ }, [this.data.map(function (item, index) {
14314
14329
  return renderItem({
14315
14330
  item: item,
14316
14331
  triggerClickAnalytics: function triggerClickAnalytics() {
@@ -14321,7 +14336,7 @@
14321
14336
 
14322
14337
  return this.analytics ? h(ImpressionTracker$1, {
14323
14338
  "attrs": {
14324
- "hits": filteredResults
14339
+ "hits": this.data
14325
14340
  }
14326
14341
  }, [element]) : element;
14327
14342
  },
@@ -14501,8 +14516,8 @@
14501
14516
  })]);
14502
14517
  },
14503
14518
  withClickIds: function withClickIds(results) {
14504
- var _this$getAllData2 = this.getAllData(),
14505
- base = _this$getAllData2.base;
14519
+ var _this$getAllData = this.getAllData(),
14520
+ base = _this$getAllData.base;
14506
14521
 
14507
14522
  return results.map(function (result, index) {
14508
14523
  return _extends({}, result, {
@@ -14520,26 +14535,9 @@
14520
14535
  hits = this.hits;
14521
14536
  var results = parseHits(hits) || [];
14522
14537
  var parsedPromotedResults = parseHits(promotedResults) || [];
14523
- var filteredResults = results;
14524
14538
  var base = currentPage * size;
14525
-
14526
- if (parsedPromotedResults.length) {
14527
- var ids = parsedPromotedResults.map(function (item) {
14528
- return item._id;
14529
- }).filter(Boolean);
14530
-
14531
- if (ids) {
14532
- filteredResults = filteredResults.filter(function (item) {
14533
- return !ids.includes(item._id);
14534
- });
14535
- }
14536
-
14537
- filteredResults = [].concat(parsedPromotedResults, filteredResults);
14538
- }
14539
-
14540
14539
  return {
14541
14540
  results: results,
14542
- filteredResults: filteredResults,
14543
14541
  customData: customData || {},
14544
14542
  promotedResults: parsedPromotedResults,
14545
14543
  aggregationData: aggregationData,
@@ -14549,14 +14547,13 @@
14549
14547
  };
14550
14548
  },
14551
14549
  getData: function getData() {
14552
- var _this$getAllData3 = this.getAllData(),
14553
- filteredResults = _this$getAllData3.filteredResults,
14554
- promotedResults = _this$getAllData3.promotedResults,
14555
- aggregationData = _this$getAllData3.aggregationData,
14556
- customData = _this$getAllData3.customData;
14550
+ var _this$getAllData2 = this.getAllData(),
14551
+ promotedResults = _this$getAllData2.promotedResults,
14552
+ aggregationData = _this$getAllData2.aggregationData,
14553
+ customData = _this$getAllData2.customData;
14557
14554
 
14558
14555
  return {
14559
- data: this.withClickIds(filteredResults),
14556
+ data: this.data,
14560
14557
  aggregationData: this.withClickIds(aggregationData || []),
14561
14558
  promotedData: this.withClickIds(promotedResults || []),
14562
14559
  rawData: this.rawData,
@@ -32916,7 +32913,7 @@
32916
32913
  });
32917
32914
  }
32918
32915
 
32919
- var version = "1.16.0-alpha.24";
32916
+ var version = "1.16.0-alpha.25";
32920
32917
 
32921
32918
  var _templateObject$o, _templateObject2$b;
32922
32919