@appbaseio/reactivesearch-vue 1.23.4-alpha → 1.24.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.
@@ -8398,6 +8398,11 @@
8398
8398
  var value = internalValue && internalValue.value || '';
8399
8399
 
8400
8400
  if (isAppbaseEnabled && (componentProps.enablePopularSuggestions || componentProps.enableQuerySuggestions)) {
8401
+ if (config.mongodb) {
8402
+ dispatch((0, misc.setDefaultPopularSuggestions)([], componentId.split('__internal')[0]));
8403
+ return;
8404
+ }
8405
+
8401
8406
  var suggQuery = (0, utils.getSuggestionQuery)(getState, componentId);
8402
8407
  appbaseRef.getQuerySuggestions(suggQuery).then(function (suggestions) {
8403
8408
  var querySuggestion = suggestions[(0, utils.getQuerySuggestionsId)(componentId)];
@@ -9128,7 +9133,8 @@
9128
9133
  protocol = _getState$appbaseRef.protocol,
9129
9134
  credentials = _getState$appbaseRef.credentials;
9130
9135
 
9131
- var app = config.app;
9136
+ var app = config.app,
9137
+ mongodb = config.mongodb;
9132
9138
  var esURL = protocol + '://' + url;
9133
9139
  var parsedURL = (esURL || '').replace(/\/+$/, '');
9134
9140
  var requestOptions = {
@@ -9175,7 +9181,14 @@
9175
9181
  }
9176
9182
  }
9177
9183
 
9178
- fetch(parsedURL + '/_analytics/' + app + '/recent-searches?' + queryString, requestOptions).then(function (res) {
9184
+ if (mongodb) {
9185
+ return dispatch({
9186
+ type: constants.RECENT_SEARCHES_SUCCESS,
9187
+ data: []
9188
+ });
9189
+ }
9190
+
9191
+ return fetch(parsedURL + '/_analytics/' + app + '/recent-searches?' + queryString, requestOptions).then(function (res) {
9179
9192
  if (res.status >= 500 || res.status >= 400) {
9180
9193
  return dispatch({
9181
9194
  type: constants.RECENT_SEARCHES_ERROR,
@@ -14421,6 +14434,11 @@
14421
14434
  renderNoResult: function renderNoResult() {
14422
14435
  var h = this.$createElement;
14423
14436
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
14437
+
14438
+ if (this.$scopedSlots.renderNoResults) {
14439
+ return isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults;
14440
+ }
14441
+
14424
14442
  return h("p", {
14425
14443
  "class": getClassName$1(this.$props.innerClass, 'noResults') || null
14426
14444
  }, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
@@ -15769,14 +15787,14 @@
15769
15787
 
15770
15788
  if (data) {
15771
15789
  Object.keys(data).forEach(function (key) {
15772
- if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error')) {
15790
+ if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error') && !!data[key].error) {
15773
15791
  errorResponses += 1;
15774
15792
  }
15775
15793
  });
15776
15794
  } // reject only when all responses has error
15777
15795
 
15778
15796
 
15779
- if (errorResponses > 0 && allResponses === errorResponses && !isMongoRequest) {
15797
+ if (errorResponses > 0 && allResponses === errorResponses) {
15780
15798
  return reject(data);
15781
15799
  }
15782
15800
  }
@@ -23663,7 +23681,7 @@
23663
23681
  this.internalComponent = null;
23664
23682
  this.$defaultQuery = null; // Set custom query in store
23665
23683
 
23666
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
23684
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
23667
23685
  var customQuery = props.customQuery,
23668
23686
  componentId = props.componentId,
23669
23687
  filterLabel = props.filterLabel,
@@ -23686,7 +23704,7 @@
23686
23704
  }
23687
23705
 
23688
23706
  if (customQuery) {
23689
- var calcCustomQuery = customQuery(props);
23707
+ var calcCustomQuery = customQuery(this.selectedValue, props);
23690
23708
 
23691
23709
  var _ref = calcCustomQuery || {},
23692
23710
  query = _ref.query;
@@ -23705,7 +23723,7 @@
23705
23723
 
23706
23724
  this.updateQuery({
23707
23725
  componentId: componentId,
23708
- queryToSet: queryToSet,
23726
+ query: queryToSet,
23709
23727
  value: this.selectedValue || null,
23710
23728
  label: filterLabel,
23711
23729
  showFilter: showFilter,
@@ -23756,8 +23774,8 @@
23756
23774
  },
23757
23775
  beforeMount: function beforeMount() {
23758
23776
  if (this.internalComponent && this.$props.defaultQuery) {
23759
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
23760
- this.$defaultQuery = this.$props.defaultQuery();
23777
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
23778
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
23761
23779
 
23762
23780
  var _ref3 = this.$defaultQuery || {},
23763
23781
  query = _ref3.query,
@@ -23821,8 +23839,8 @@
23821
23839
  }
23822
23840
  },
23823
23841
  defaultQuery: function defaultQuery(newVal, oldVal) {
23824
- if (newVal && !isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
23825
- this.$defaultQuery = newVal();
23842
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
23843
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
23826
23844
 
23827
23845
  var _ref4 = this.$defaultQuery || {},
23828
23846
  query = _ref4.query,
@@ -23833,7 +23851,7 @@
23833
23851
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
23834
23852
 
23835
23853
 
23836
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
23854
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
23837
23855
  var queryToSet = query || null;
23838
23856
 
23839
23857
  if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
@@ -23847,9 +23865,9 @@
23847
23865
  }
23848
23866
  },
23849
23867
  customQuery: function customQuery(newVal, oldVal) {
23850
- if (newVal && !isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
23868
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
23851
23869
  var componentId = this.$props.componentId;
23852
- this.$customQuery = newVal(this.$props);
23870
+ this.$customQuery = newVal(this.selectedValue, this.$props);
23853
23871
 
23854
23872
  var _ref5 = this.$customQuery || {},
23855
23873
  query = _ref5.query,
@@ -23860,7 +23878,7 @@
23860
23878
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
23861
23879
 
23862
23880
 
23863
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
23881
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
23864
23882
  var queryToSet = query || null;
23865
23883
 
23866
23884
  if (this.$customQuery && this.$customQuery.id) {
@@ -25948,16 +25966,7 @@
25948
25966
  compProps[key] = component[key];
25949
25967
  }
25950
25968
  });
25951
- var isInternalComponentPresent = false; // Set custom and default queries
25952
-
25953
- if (component.customQuery && typeof component.customQuery === 'function') {
25954
- customQueries[component.componentId] = component.customQuery(component.value, compProps);
25955
- }
25956
-
25957
- if (component.defaultQuery && typeof component.defaultQuery === 'function') {
25958
- defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
25959
- }
25960
-
25969
+ var isInternalComponentPresent = false;
25961
25970
  var isResultComponent = resultComponents.includes(componentType);
25962
25971
  var internalComponent = component.componentId + "__internal";
25963
25972
  var label = component.filterLabel || component.componentId;
@@ -25981,7 +25990,16 @@
25981
25990
  reference: reference,
25982
25991
  showFilter: showFilter,
25983
25992
  URLParams: component.URLParams || false
25984
- }); // [2] set query options - main component query (valid for result components)
25993
+ }); // Set custom and default queries
25994
+
25995
+ if (component.customQuery && typeof component.customQuery === 'function') {
25996
+ customQueries[component.componentId] = component.customQuery(value, compProps);
25997
+ }
25998
+
25999
+ if (component.defaultQuery && typeof component.defaultQuery === 'function') {
26000
+ defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
26001
+ } // [2] set query options - main component query (valid for result components)
26002
+
25985
26003
 
25986
26004
  if (componentsWithOptions.includes(componentType)) {
25987
26005
  var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
@@ -26068,7 +26086,7 @@
26068
26086
 
26069
26087
 
26070
26088
  if (isResultComponent) {
26071
- var _getQuery = getQuery(component, null, componentType),
26089
+ var _getQuery = getQuery(component, value, componentType),
26072
26090
  query = _getQuery.query;
26073
26091
 
26074
26092
  queryList = queryReducer(queryList, {
@@ -26295,7 +26313,7 @@
26295
26313
  });
26296
26314
  }
26297
26315
 
26298
- var version = "1.23.4-alpha";
26316
+ var version = "1.24.3";
26299
26317
 
26300
26318
  var _templateObject$n, _templateObject2$a;
26301
26319