@appbaseio/reactivesearch-vue 1.16.0-alpha.50 → 1.16.0-alpha.51

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.
@@ -6065,6 +6065,76 @@
6065
6065
  var value_4 = value.patchValue;
6066
6066
  var value_5 = value.clearValues;
6067
6067
 
6068
+ var hits = createCommonjsModule(function (module, exports) {
6069
+ Object.defineProperty(exports, "__esModule", {
6070
+ value: true
6071
+ });
6072
+ exports.updateAggs = updateAggs;
6073
+ exports.updateCompositeAggs = updateCompositeAggs;
6074
+ exports.updateHits = updateHits;
6075
+ exports.saveQueryToHits = saveQueryToHits;
6076
+ exports.mockDataForTesting = mockDataForTesting;
6077
+
6078
+ function updateAggs(component, aggregations) {
6079
+ var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6080
+ return {
6081
+ type: constants.UPDATE_AGGS,
6082
+ component: component,
6083
+ aggregations: aggregations,
6084
+ append: append
6085
+ };
6086
+ }
6087
+
6088
+ function updateCompositeAggs(component, aggregations) {
6089
+ var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6090
+ return {
6091
+ type: constants.UPDATE_COMPOSITE_AGGS,
6092
+ component: component,
6093
+ aggregations: aggregations,
6094
+ append: append
6095
+ };
6096
+ }
6097
+
6098
+ function updateHits(component, hits, time, hidden) {
6099
+ var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
6100
+ return {
6101
+ type: constants.UPDATE_HITS,
6102
+ component: component,
6103
+ hits: hits.hits,
6104
+ total: typeof hits.total === 'object' ? hits.total.value : hits.total,
6105
+ hidden: hidden,
6106
+ time: time,
6107
+ append: append
6108
+ };
6109
+ }
6110
+
6111
+ function saveQueryToHits(component, query) {
6112
+ return {
6113
+ type: constants.SET_QUERY_TO_HITS,
6114
+ component: component,
6115
+ query: query
6116
+ };
6117
+ }
6118
+
6119
+ function mockDataForTesting(component, data) {
6120
+ return function (dispatch) {
6121
+ if (data.hasOwnProperty('aggregations')) {
6122
+ dispatch(updateAggs(component, data.aggregations));
6123
+ }
6124
+
6125
+ if (data.hasOwnProperty('hits')) {
6126
+ dispatch(updateHits(component, data, data.time || undefined));
6127
+ }
6128
+ };
6129
+ }
6130
+ });
6131
+ unwrapExports(hits);
6132
+ var hits_1 = hits.updateAggs;
6133
+ var hits_2 = hits.updateCompositeAggs;
6134
+ var hits_3 = hits.updateHits;
6135
+ var hits_4 = hits.saveQueryToHits;
6136
+ var hits_5 = hits.mockDataForTesting;
6137
+
6068
6138
  var misc = createCommonjsModule(function (module, exports) {
6069
6139
  Object.defineProperty(exports, "__esModule", {
6070
6140
  value: true
@@ -6092,6 +6162,7 @@
6092
6162
  exports.setGoogleMapScriptLoading = setGoogleMapScriptLoading;
6093
6163
  exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded;
6094
6164
  exports.setGoogleMapScriptError = setGoogleMapScriptError;
6165
+ exports.resetStoreForComponent = resetStoreForComponent;
6095
6166
 
6096
6167
  function setRawData(component, response) {
6097
6168
  return {
@@ -6283,6 +6354,22 @@
6283
6354
  error: error
6284
6355
  };
6285
6356
  }
6357
+
6358
+ function resetStoreForComponent(componentId) {
6359
+ return function (dispatch) {
6360
+ dispatch(setRawData(componentId, null));
6361
+ dispatch(setCustomData(null, componentId));
6362
+ dispatch(setPromotedResults([], componentId));
6363
+ dispatch(setPopularSuggestions([], componentId));
6364
+ dispatch(setDefaultPopularSuggestions([], componentId));
6365
+ dispatch((0, hits.updateAggs)(componentId, null));
6366
+ dispatch((0, hits.updateCompositeAggs)(componentId, {}));
6367
+ dispatch((0, hits.updateHits)(componentId, {
6368
+ hits: [],
6369
+ total: 0
6370
+ }, 0));
6371
+ };
6372
+ }
6286
6373
  });
6287
6374
  unwrapExports(misc);
6288
6375
  var misc_1 = misc.setRawData;
@@ -6308,76 +6395,7 @@
6308
6395
  var misc_21 = misc.setGoogleMapScriptLoading;
6309
6396
  var misc_22 = misc.setGoogleMapScriptLoaded;
6310
6397
  var misc_23 = misc.setGoogleMapScriptError;
6311
-
6312
- var hits = createCommonjsModule(function (module, exports) {
6313
- Object.defineProperty(exports, "__esModule", {
6314
- value: true
6315
- });
6316
- exports.updateAggs = updateAggs;
6317
- exports.updateCompositeAggs = updateCompositeAggs;
6318
- exports.updateHits = updateHits;
6319
- exports.saveQueryToHits = saveQueryToHits;
6320
- exports.mockDataForTesting = mockDataForTesting;
6321
-
6322
- function updateAggs(component, aggregations) {
6323
- var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6324
- return {
6325
- type: constants.UPDATE_AGGS,
6326
- component: component,
6327
- aggregations: aggregations,
6328
- append: append
6329
- };
6330
- }
6331
-
6332
- function updateCompositeAggs(component, aggregations) {
6333
- var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6334
- return {
6335
- type: constants.UPDATE_COMPOSITE_AGGS,
6336
- component: component,
6337
- aggregations: aggregations,
6338
- append: append
6339
- };
6340
- }
6341
-
6342
- function updateHits(component, hits, time, hidden) {
6343
- var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
6344
- return {
6345
- type: constants.UPDATE_HITS,
6346
- component: component,
6347
- hits: hits.hits,
6348
- total: typeof hits.total === 'object' ? hits.total.value : hits.total,
6349
- hidden: hidden,
6350
- time: time,
6351
- append: append
6352
- };
6353
- }
6354
-
6355
- function saveQueryToHits(component, query) {
6356
- return {
6357
- type: constants.SET_QUERY_TO_HITS,
6358
- component: component,
6359
- query: query
6360
- };
6361
- }
6362
-
6363
- function mockDataForTesting(component, data) {
6364
- return function (dispatch) {
6365
- if (data.hasOwnProperty('aggregations')) {
6366
- dispatch(updateAggs(component, data.aggregations));
6367
- }
6368
-
6369
- if (data.hasOwnProperty('hits')) {
6370
- dispatch(updateHits(component, data, data.time || undefined));
6371
- }
6372
- };
6373
- }
6374
- });
6375
- unwrapExports(hits);
6376
- var hits_1 = hits.updateAggs;
6377
- var hits_2 = hits.updateCompositeAggs;
6378
- var hits_3 = hits.updateHits;
6379
- var hits_4 = hits.saveQueryToHits;
6380
- var hits_5 = hits.mockDataForTesting;
6398
+ var misc_24 = misc.resetStoreForComponent;
6381
6399
 
6382
6400
  var xdate = createCommonjsModule(function (module) {
6383
6401
  /**
@@ -19591,7 +19609,8 @@
19591
19609
  setCustomHighlightOptions = lib_5.setCustomHighlightOptions,
19592
19610
  recordSuggestionClick = lib_5.recordSuggestionClick,
19593
19611
  loadPopularSuggestions = lib_5.loadPopularSuggestions,
19594
- getRecentSearches = lib_5.getRecentSearches;
19612
+ getRecentSearches = lib_5.getRecentSearches,
19613
+ resetStoreForComponent = lib_5.resetStoreForComponent;
19595
19614
  var debounce$1 = lib_8.debounce,
19596
19615
  checkValueChange = lib_8.checkValueChange,
19597
19616
  getClassName$3 = lib_8.getClassName,
@@ -20003,7 +20022,9 @@
20003
20022
 
20004
20023
  var performUpdate = function performUpdate() {
20005
20024
  // Refresh recent searches when value becomes empty
20006
- if (!value && _this.currentValue && _this.enableRecentSearches) {
20025
+ if (!value && props.enableDefaultSuggestions === false) {
20026
+ _this.resetStoreForComponent(props.componentId);
20027
+ } else if (!value && _this.currentValue && _this.enableRecentSearches) {
20007
20028
  _this.getRecentSearches();
20008
20029
  }
20009
20030
 
@@ -20054,6 +20075,12 @@
20054
20075
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
20055
20076
  },
20056
20077
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
20078
+ if (!value && props.enableDefaultSuggestions === false) {
20079
+ // clear Component data from store
20080
+ this.resetStoreForComponent(props.componentId);
20081
+ return;
20082
+ }
20083
+
20057
20084
  var defaultQueryOptions;
20058
20085
  var query = DataSearch.defaultQuery(value, props);
20059
20086
 
@@ -20827,7 +20854,8 @@
20827
20854
  setCustomHighlightOptions: setCustomHighlightOptions,
20828
20855
  recordSuggestionClick: recordSuggestionClick,
20829
20856
  loadPopularSuggestions: loadPopularSuggestions,
20830
- getRecentSearches: getRecentSearches
20857
+ getRecentSearches: getRecentSearches,
20858
+ resetStoreForComponent: resetStoreForComponent
20831
20859
  };
20832
20860
  var DSConnected = ComponentWrapper$1(connect(mapStateToProps$3, mapDispatchToProps$2)(DataSearch), {
20833
20861
  componentType: constants_1$1.dataSearch,
@@ -34391,7 +34419,7 @@
34391
34419
  });
34392
34420
  }
34393
34421
 
34394
- var version = "1.16.0-alpha.50";
34422
+ var version = "1.16.0-alpha.51";
34395
34423
 
34396
34424
  var _templateObject$p, _templateObject2$b;
34397
34425