@appbaseio/reactivesearch-vue 2.0.0-alpha.1 → 2.0.0-alpha.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.
@@ -1486,7 +1486,8 @@
1486
1486
 
1487
1487
  function configReducer() {
1488
1488
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1489
- analyticsConfig: analytics.defaultAnalyticsConfig
1489
+ analyticsConfig: analytics.defaultAnalyticsConfig,
1490
+ lock: false
1490
1491
  };
1491
1492
  var action = arguments[1];
1492
1493
 
@@ -5207,6 +5208,11 @@
5207
5208
 
5208
5209
  function debounce(callback, wait) {
5209
5210
  var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
5211
+
5212
+ if (!wait) {
5213
+ return callback;
5214
+ }
5215
+
5210
5216
  var timeout = null;
5211
5217
  var callbackArgs = null;
5212
5218
 
@@ -5574,7 +5580,10 @@
5574
5580
  return null;
5575
5581
  };
5576
5582
 
5577
- function computeResultStats(hits, searchState, promotedResults) {
5583
+ function computeResultStats() {
5584
+ var hits = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5585
+ var searchState = arguments[1];
5586
+ var promotedResults = arguments[2];
5578
5587
  Object.keys(hits).forEach(function (componentId) {
5579
5588
  var _ref = hits[componentId] || {},
5580
5589
  hidden = _ref.hidden,
@@ -5618,7 +5627,7 @@
5618
5627
  };
5619
5628
 
5620
5629
  populateState(props);
5621
- Object.keys(selectedValues).forEach(function (componentId) {
5630
+ Object.keys(selectedValues || {}).forEach(function (componentId) {
5622
5631
  var componentState = searchState[componentId];
5623
5632
  var selectedValue = selectedValues[componentId];
5624
5633
 
@@ -9419,6 +9428,10 @@
9419
9428
  settings.userId = (0, utils.isPropertyDefined)(config.analyticsConfig.userId) ? config.analyticsConfig.userId : undefined;
9420
9429
  settings.enableQueryRules = (0, utils.isPropertyDefined)(config.analyticsConfig.enableQueryRules) ? config.analyticsConfig.enableQueryRules : undefined;
9421
9430
  settings.customEvents = (0, utils.isPropertyDefined)(config.analyticsConfig.customEvents) ? config.analyticsConfig.customEvents : undefined;
9431
+ settings.emptyQuery = (0, utils.isPropertyDefined)(config.analyticsConfig.emptyQuery) ? config.analyticsConfig.emptyQuery : undefined;
9432
+ settings.enableSearchRelevancy = (0, utils.isPropertyDefined)(config.analyticsConfig.enableSearchRelevancy) ? config.analyticsConfig.enableSearchRelevancy : undefined;
9433
+ settings.suggestionAnalytics = (0, utils.isPropertyDefined)(config.analyticsConfig.suggestionAnalytics) ? config.analyticsConfig.suggestionAnalytics : undefined;
9434
+ settings.useCache = (0, utils.isPropertyDefined)(config.analyticsConfig.useCache) ? config.analyticsConfig.useCache : undefined;
9422
9435
  }
9423
9436
 
9424
9437
  orderOfQueries.forEach(function (component) {
@@ -9451,7 +9464,6 @@
9451
9464
  }
9452
9465
 
9453
9466
  var requestStack = [];
9454
- var lock = false;
9455
9467
 
9456
9468
  function executeQuery(componentId) {
9457
9469
  var executeWatchList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -9470,7 +9482,8 @@
9470
9482
  queryOptions = _getState4.queryOptions,
9471
9483
  queryListener = _getState4.queryListener,
9472
9484
  props = _getState4.props,
9473
- internalValues = _getState4.internalValues;
9485
+ internalValues = _getState4.internalValues,
9486
+ lock = _getState4.lock;
9474
9487
 
9475
9488
  var lockTime = config.initialQueriesSyncTime;
9476
9489
  var initialTimestamp = config.initialTimestamp;
@@ -9636,6 +9649,14 @@
9636
9649
  newQuery.execute = true;
9637
9650
  }
9638
9651
 
9652
+ if (processedQueriesMap[query.id] && processedQueriesMap[query.id].type === constants$1.queryTypes.suggestion && newQuery.type !== constants$1.queryTypes.suggestion) {
9653
+ processedQueriesMap[query.id + '__suggestion_type'] = _extends({}, processedQueriesMap[query.id]);
9654
+ processedQueriesMap[query.id] = _extends({}, newQuery, {
9655
+ execute: false
9656
+ });
9657
+ return;
9658
+ }
9659
+
9639
9660
  processedQueriesMap[query.id] = newQuery;
9640
9661
  });
9641
9662
  }
@@ -9668,7 +9689,9 @@
9668
9689
  }, lockTime);
9669
9690
  }
9670
9691
 
9671
- lock = true;
9692
+ dispatch((0, utils.updateStoreConfig)({
9693
+ lock: true
9694
+ }));
9672
9695
  requestStack.push({
9673
9696
  query: finalQuery,
9674
9697
  orderOfQueries: orderOfQueries,
@@ -9821,7 +9844,7 @@
9821
9844
  if (queryFromStore) {
9822
9845
  var query = queryFromStore.map(function (queryItem) {
9823
9846
  if (queryItem.id === componentId) {
9824
- return _extends({}, queryItem, {
9847
+ var finalQueryItem = _extends({}, queryItem, {
9825
9848
  deepPaginationConfig: {
9826
9849
  cursor: deepPaginationCursor
9827
9850
  },
@@ -9830,6 +9853,9 @@
9830
9853
  sortField: '_id',
9831
9854
  sortBy: 'asc'
9832
9855
  });
9856
+
9857
+ delete finalQueryItem.from;
9858
+ return finalQueryItem;
9833
9859
  }
9834
9860
 
9835
9861
  return queryItem;
@@ -10539,6 +10565,7 @@
10539
10565
  function configureStore(initialState) {
10540
10566
  var finalInitialState = _extends({}, initialState, {
10541
10567
  config: _extends({}, initialState.config, {
10568
+ lock: false,
10542
10569
  analyticsConfig: initialState.config && initialState.config.analyticsConfig ? _extends({}, analytics.defaultAnalyticsConfig, initialState.config.analyticsConfig) : analytics.defaultAnalyticsConfig
10543
10570
  })
10544
10571
  });
@@ -28382,6 +28409,18 @@
28382
28409
  return filteredState;
28383
28410
  }
28384
28411
 
28412
+ if (!props.includeInternalComponents) {
28413
+ var _filteredState = {};
28414
+ Object.keys(state).forEach(function (componentId) {
28415
+ if (componentId.endsWith('internal') || componentId.endsWith('active') || componentId.endsWith('timestamp')) {
28416
+ return;
28417
+ }
28418
+
28419
+ _filteredState[componentId] = state[componentId];
28420
+ });
28421
+ return _filteredState;
28422
+ }
28423
+
28385
28424
  return state;
28386
28425
  };
28387
28426
 
@@ -28405,7 +28444,8 @@
28405
28444
  onChange: VueTypes.func,
28406
28445
  componentIds: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)]),
28407
28446
  includeKeys: VueTypes.arrayOf(VueTypes.string).def(defaultKeys),
28408
- strict: VueTypes.bool.def(true)
28447
+ strict: VueTypes.bool.def(true),
28448
+ includeInternalComponents: VueTypes.bool.def(false)
28409
28449
  },
28410
28450
  data: function data() {
28411
28451
  this.__state = {
@@ -28420,21 +28460,21 @@
28420
28460
  searchStateProps: function searchStateProps() {
28421
28461
  return {
28422
28462
  selectedValues: this.selectedValues || {},
28423
- queryLog: this.queryLog,
28424
- dependencyTree: this.dependencyTree,
28425
- componentProps: this.componentProps,
28426
- hits: this.hits,
28427
- aggregations: this.aggregations,
28428
- isLoading: this.isLoading,
28429
- error: this.error,
28430
- promotedResults: this.promotedResults,
28431
- rawData: this.rawData
28463
+ queryLog: this.queryLog || {},
28464
+ dependencyTree: this.dependencyTree || {},
28465
+ componentProps: this.componentProps || {},
28466
+ hits: this.hits || {},
28467
+ aggregations: this.aggregations || {},
28468
+ isLoading: this.isLoading || {},
28469
+ error: this.error || {},
28470
+ promotedResults: this.promotedResults || {},
28471
+ rawData: this.rawData || {}
28432
28472
  };
28433
28473
  }
28434
28474
  },
28435
28475
  watch: {
28436
28476
  searchState: function searchState(newVal, oldVal) {
28437
- if (this.isStateChanged(newVal, oldVal)) {
28477
+ if (oldVal != null && this.isStateChanged(newVal, oldVal)) {
28438
28478
  this.$emit('change', oldVal, newVal);
28439
28479
  }
28440
28480
  },
@@ -36426,6 +36466,13 @@
36426
36466
  this.triggerAnalytics(id, index);
36427
36467
  this.$emit('open-marker-popover', marker.metaData);
36428
36468
  },
36469
+ removeMarkers: function removeMarkers() {
36470
+ if (this.$clusterObject) {
36471
+ // Remove old markers
36472
+ this.$clusterObject.clearMarkers(true);
36473
+ this.$markers = [];
36474
+ }
36475
+ },
36429
36476
  buildMarkers: function buildMarkers(markersToRender) {
36430
36477
  var _this = this;
36431
36478
 
@@ -37361,6 +37408,26 @@
37361
37408
  },
37362
37409
  getMapRef: function getMapRef() {
37363
37410
  return this.mapRef;
37411
+ },
37412
+ removeMarkers: function removeMarkers() {
37413
+ var clusterManagerInstance;
37414
+ var currentInstance = this;
37415
+
37416
+ while (currentInstance) {
37417
+ if (currentInstance && currentInstance._name === '<ConnectClusterMarkers>') {
37418
+ clusterManagerInstance = currentInstance;
37419
+ currentInstance = null;
37420
+ } else if (currentInstance.$children) {
37421
+ var _currentInstance$$chi = currentInstance.$children;
37422
+ currentInstance = _currentInstance$$chi[0];
37423
+ } else {
37424
+ currentInstance = null;
37425
+ }
37426
+ }
37427
+
37428
+ if (clusterManagerInstance && clusterManagerInstance.removeMarkers) {
37429
+ clusterManagerInstance.removeMarkers();
37430
+ }
37364
37431
  }
37365
37432
  },
37366
37433
  mounted: function mounted() {
@@ -37964,7 +38031,7 @@
37964
38031
  });
37965
38032
  }
37966
38033
 
37967
- var version = "2.0.0-alpha.1";
38034
+ var version = "2.0.0-alpha.3";
37968
38035
 
37969
38036
  var _templateObject$q, _templateObject2$c;
37970
38037