@appbaseio/reactivesearch-vue 1.27.0-gamma.3 → 1.29.0

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.
Files changed (45) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +839 -1033
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-11307285.js → Button-e0b7c1f6.js} +1 -1
  6. package/dist/cjs/{DataSearch-0ef14926.js → DataSearch-eec21890.js} +30 -13
  7. package/dist/cjs/DataSearch.js +1 -1
  8. package/dist/cjs/DynamicRangeSlider.js +24 -16
  9. package/dist/cjs/MultiDropdownList.js +34 -25
  10. package/dist/cjs/MultiList.js +33 -23
  11. package/dist/cjs/MultiRange.js +2 -3
  12. package/dist/cjs/RangeSlider.js +2 -3
  13. package/dist/cjs/ReactiveComponent.js +41 -72
  14. package/dist/cjs/ReactiveList.js +38 -48
  15. package/dist/cjs/SelectedFilters.js +6 -4
  16. package/dist/cjs/SingleDropdownList.js +21 -18
  17. package/dist/cjs/SingleList.js +19 -16
  18. package/dist/cjs/SingleRange.js +2 -3
  19. package/dist/cjs/ToggleButton.js +1 -1
  20. package/dist/cjs/index.js +3 -3
  21. package/dist/cjs/initReactivesearch.js +109 -77
  22. package/dist/cjs/{install-311df9cc.js → install-4886582d.js} +102 -58
  23. package/dist/cjs/install.js +3 -3
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/es/{Button-91561391.js → Button-33de88e6.js} +1 -1
  26. package/dist/es/{DataSearch-be45e960.js → DataSearch-42f547cd.js} +30 -13
  27. package/dist/es/DataSearch.js +1 -1
  28. package/dist/es/DynamicRangeSlider.js +24 -16
  29. package/dist/es/MultiDropdownList.js +34 -25
  30. package/dist/es/MultiList.js +33 -23
  31. package/dist/es/MultiRange.js +2 -3
  32. package/dist/es/RangeSlider.js +2 -3
  33. package/dist/es/ReactiveComponent.js +41 -72
  34. package/dist/es/ReactiveList.js +38 -48
  35. package/dist/es/SelectedFilters.js +6 -4
  36. package/dist/es/SingleDropdownList.js +21 -18
  37. package/dist/es/SingleList.js +19 -16
  38. package/dist/es/SingleRange.js +2 -3
  39. package/dist/es/ToggleButton.js +1 -1
  40. package/dist/es/index.js +4 -4
  41. package/dist/es/initReactivesearch.js +111 -79
  42. package/dist/es/{install-af797de0.js → install-54ebd72e.js} +102 -58
  43. package/dist/es/install.js +3 -3
  44. package/dist/es/version.js +1 -1
  45. package/package.json +3 -3
@@ -820,6 +820,9 @@
820
820
  var RECENT_SEARCHES_ERROR = exports.RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR';
821
821
  var SET_VALUE = exports.SET_VALUE = 'SET_VALUE';
822
822
  var RESET_TO_DEFAULT = exports.RESET_TO_DEFAULT = 'RESET_TO_DEFAULT';
823
+ var SET_GOOGLE_MAP_SCRIPT_LOADING = exports.SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING';
824
+ var SET_GOOGLE_MAP_SCRIPT_LOADED = exports.SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED';
825
+ var SET_GOOGLE_MAP_SCRIPT_ERROR = exports.SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR';
823
826
  });
824
827
  unwrapExports(constants);
825
828
  var constants_1 = constants.ADD_COMPONENT;
@@ -867,6 +870,9 @@
867
870
  var constants_43 = constants.RECENT_SEARCHES_ERROR;
868
871
  var constants_44 = constants.SET_VALUE;
869
872
  var constants_45 = constants.RESET_TO_DEFAULT;
873
+ var constants_46 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
874
+ var constants_47 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
875
+ var constants_48 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
870
876
 
871
877
  var componentsReducer_1 = createCommonjsModule(function (module, exports) {
872
878
  Object.defineProperty(exports, "__esModule", {
@@ -1729,17 +1735,25 @@
1729
1735
 
1730
1736
  case constants.CLEAR_VALUES:
1731
1737
  {
1738
+ var nextState = {};
1739
+
1732
1740
  if (action.resetValues) {
1733
- var nextState = {};
1734
1741
  Object.keys(action.resetValues).forEach(function (componentId) {
1735
1742
  nextState[componentId] = _extends({}, state[componentId], {
1736
1743
  value: action.resetValues[componentId]
1737
1744
  });
1738
1745
  });
1739
- return nextState;
1740
1746
  }
1741
1747
 
1742
- return {};
1748
+ if (Array.isArray(action.clearAllBlacklistComponents)) {
1749
+ Object.keys(state).forEach(function (componentId) {
1750
+ if (action.clearAllBlacklistComponents.includes(componentId)) {
1751
+ nextState[componentId] = state[componentId];
1752
+ }
1753
+ });
1754
+ }
1755
+
1756
+ return nextState;
1743
1757
  }
1744
1758
 
1745
1759
  case constants.REMOVE_COMPONENT:
@@ -1822,7 +1836,30 @@
1822
1836
  }));
1823
1837
 
1824
1838
  case constants.CLEAR_VALUES:
1825
- return {};
1839
+ {
1840
+ var nextState = {};
1841
+
1842
+ if (action.resetValues) {
1843
+ Object.keys(action.resetValues).forEach(function (componentId) {
1844
+ nextState[componentId] = _extends({}, state[componentId], {
1845
+ value: action.resetValues[componentId]
1846
+ });
1847
+ });
1848
+ }
1849
+
1850
+ if (Array.isArray(action.clearAllBlacklistComponents)) {
1851
+ Object.keys(state).forEach(function (componentId) {
1852
+ if (action.clearAllBlacklistComponents.includes(componentId)) {
1853
+ nextState[componentId] = state[componentId];
1854
+ }
1855
+ });
1856
+ }
1857
+
1858
+ return nextState;
1859
+ }
1860
+
1861
+ case constants.RESET_TO_DEFAULT:
1862
+ return _extends({}, state, action.defaultValues);
1826
1863
 
1827
1864
  case constants.REMOVE_COMPONENT:
1828
1865
  {
@@ -3167,6 +3204,59 @@
3167
3204
  });
3168
3205
  unwrapExports(recentSearches);
3169
3206
 
3207
+ var googleMapScriptReducer_1 = createCommonjsModule(function (module, exports) {
3208
+ Object.defineProperty(exports, "__esModule", {
3209
+ value: true
3210
+ });
3211
+
3212
+ var _extends = Object.assign || function (target) {
3213
+ for (var i = 1; i < arguments.length; i++) {
3214
+ var source = arguments[i];
3215
+
3216
+ for (var key in source) {
3217
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
3218
+ target[key] = source[key];
3219
+ }
3220
+ }
3221
+ }
3222
+
3223
+ return target;
3224
+ };
3225
+
3226
+ exports["default"] = googleMapScriptReducer;
3227
+ var INITIAL_STATE = {
3228
+ loading: false,
3229
+ loaded: false,
3230
+ error: null
3231
+ };
3232
+
3233
+ function googleMapScriptReducer() {
3234
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
3235
+ var action = arguments[1];
3236
+ var type = action.type,
3237
+ loading = action.loading,
3238
+ loaded = action.loaded,
3239
+ error = action.error;
3240
+
3241
+ if (type === constants.SET_GOOGLE_MAP_SCRIPT_LOADING) {
3242
+ return _extends({}, INITIAL_STATE, {
3243
+ loading: loading
3244
+ });
3245
+ } else if (type === constants.SET_GOOGLE_MAP_SCRIPT_LOADED) {
3246
+ return _extends({}, INITIAL_STATE, {
3247
+ loaded: loaded
3248
+ });
3249
+ } else if (type === constants.SET_GOOGLE_MAP_SCRIPT_ERROR) {
3250
+ return _extends({}, INITIAL_STATE, {
3251
+ error: error
3252
+ });
3253
+ }
3254
+
3255
+ return state;
3256
+ }
3257
+ });
3258
+ unwrapExports(googleMapScriptReducer_1);
3259
+
3170
3260
  var reducers = createCommonjsModule(function (module, exports) {
3171
3261
  Object.defineProperty(exports, "__esModule", {
3172
3262
  value: true
@@ -3238,6 +3328,8 @@
3238
3328
 
3239
3329
  var _recentSearches2 = _interopRequireDefault(recentSearches);
3240
3330
 
3331
+ var _googleMapScriptReducer2 = _interopRequireDefault(googleMapScriptReducer_1);
3332
+
3241
3333
  function _interopRequireDefault(obj) {
3242
3334
  return obj && obj.__esModule ? obj : {
3243
3335
  "default": obj
@@ -3281,7 +3373,8 @@
3281
3373
  urlValues: function urlValues() {
3282
3374
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3283
3375
  return state;
3284
- }
3376
+ },
3377
+ googleMapScriptStatus: _googleMapScriptReducer2["default"]
3285
3378
  });
3286
3379
  });
3287
3380
  unwrapExports(reducers);
@@ -4861,7 +4954,7 @@
4861
4954
  Object.defineProperty(exports, "__esModule", {
4862
4955
  value: true
4863
4956
  });
4864
- exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
4957
+ exports.hasCustomRenderer = exports.getComponent = exports.isFunction = exports.getCalendarIntervalErrorMessage = exports.queryFormatMillisecondsMap = exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.extractQueryFromCustomQuery = exports.getOptionsForCustomQuery = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
4865
4958
 
4866
4959
  var _extends = Object.assign || function (target) {
4867
4960
  for (var i = 1; i < arguments.length; i++) {
@@ -4878,6 +4971,7 @@
4878
4971
  };
4879
4972
 
4880
4973
  exports.isEqual = isEqual;
4974
+ exports.compareQueries = compareQueries;
4881
4975
  exports.debounce = debounce;
4882
4976
  exports.getQueryOptions = getQueryOptions;
4883
4977
  exports.buildQuery = buildQuery;
@@ -4972,6 +5066,14 @@
4972
5066
  return true;
4973
5067
  }
4974
5068
 
5069
+ function compareQueries(x, y) {
5070
+ try {
5071
+ return isEqual(JSON.parse(JSON.stringify(x)), JSON.parse(JSON.stringify(y)));
5072
+ } catch (e) {
5073
+ return false;
5074
+ }
5075
+ }
5076
+
4975
5077
  function debounce(callback, wait) {
4976
5078
  var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
4977
5079
  var timeout = null;
@@ -5053,7 +5155,9 @@
5053
5155
  if (typeof comp !== 'string') {
5054
5156
  return getQuery(comp, queryList);
5055
5157
  } else if (comp in queryList) {
5056
- return queryList[comp];
5158
+ if (queryList[comp] && Object.keys(queryList[comp]).length) {
5159
+ return queryList[comp];
5160
+ }
5057
5161
  }
5058
5162
 
5059
5163
  return null;
@@ -5062,7 +5166,7 @@
5062
5166
  });
5063
5167
  var boolQuery = createBoolQuery(operation, queryArr);
5064
5168
 
5065
- if (boolQuery) {
5169
+ if (boolQuery && Object.keys(boolQuery).length) {
5066
5170
  query = [].concat(_toConsumableArray(query), [boolQuery]);
5067
5171
  }
5068
5172
  } else if (typeof react[conjunction] === 'string') {
@@ -5070,13 +5174,13 @@
5070
5174
 
5071
5175
  var _boolQuery = createBoolQuery(_operation, queryList[react[conjunction]]);
5072
5176
 
5073
- if (_boolQuery) {
5177
+ if (_boolQuery && Object.keys(_boolQuery).length) {
5074
5178
  query = [].concat(_toConsumableArray(query), [_boolQuery]);
5075
5179
  }
5076
5180
  } else if (typeof react[conjunction] === 'object' && react[conjunction] !== null) {
5077
5181
  var _boolQuery2 = getQuery(react[conjunction], queryList);
5078
5182
 
5079
- if (_boolQuery2) {
5183
+ if (_boolQuery2 && Object.keys(_boolQuery2).length) {
5080
5184
  query = [].concat(_toConsumableArray(query), [_boolQuery2]);
5081
5185
  }
5082
5186
  }
@@ -5194,7 +5298,7 @@
5194
5298
  }
5195
5299
 
5196
5300
  return {
5197
- _term: sortBy
5301
+ _key: sortBy
5198
5302
  };
5199
5303
  }
5200
5304
 
@@ -5307,6 +5411,38 @@
5307
5411
 
5308
5412
  exports.getOptionsFromQuery = getOptionsFromQuery;
5309
5413
 
5414
+ var getOptionsForCustomQuery = function getOptionsForCustomQuery() {
5415
+ var customQuery = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5416
+
5417
+ if (customQuery) {
5418
+ var query = customQuery.query,
5419
+ id = customQuery.id,
5420
+ params = customQuery.params,
5421
+ rest = _objectWithoutProperties(customQuery, ['query', 'id', 'params']);
5422
+
5423
+ return Object.keys(rest).length ? rest : null;
5424
+ }
5425
+
5426
+ return null;
5427
+ };
5428
+
5429
+ exports.getOptionsForCustomQuery = getOptionsForCustomQuery;
5430
+
5431
+ var extractQueryFromCustomQuery = exports.extractQueryFromCustomQuery = function extractQueryFromCustomQuery(customQuery) {
5432
+ if (customQuery) {
5433
+ if (customQuery.id) {
5434
+ return {
5435
+ id: customQuery.id,
5436
+ params: customQuery.params
5437
+ };
5438
+ }
5439
+
5440
+ return customQuery.query;
5441
+ }
5442
+
5443
+ return null;
5444
+ };
5445
+
5310
5446
  function computeResultStats(hits, searchState, promotedResults) {
5311
5447
  Object.keys(hits).forEach(function (componentId) {
5312
5448
  var _ref = hits[componentId] || {},
@@ -5682,38 +5818,112 @@
5682
5818
  Recent: 'recent',
5683
5819
  Promoted: 'promoted'
5684
5820
  };
5821
+ var queryFormatMillisecondsMap = exports.queryFormatMillisecondsMap = {
5822
+ minute: 60000,
5823
+ hour: 3600000,
5824
+ day: 86400000,
5825
+ week: 604800000,
5826
+ month: 2629746000,
5827
+ quarter: 7889238000,
5828
+ year: 31556952000
5829
+ };
5830
+
5831
+ var getCalendarIntervalErrorMessage = exports.getCalendarIntervalErrorMessage = function getCalendarIntervalErrorMessage(totalRange) {
5832
+ var calendarInterval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'minute';
5833
+ var queryFormatMillisecondsMapKeys = Object.keys(queryFormatMillisecondsMap);
5834
+ var indexOfCurrentCalendarInterval = queryFormatMillisecondsMapKeys.indexOf(calendarInterval);
5835
+
5836
+ if (indexOfCurrentCalendarInterval === -1) {
5837
+ console.error('Invalid calendarInterval Passed');
5838
+ }
5839
+
5840
+ if (calendarInterval === 'year') {
5841
+ return 'Try using a shorter range of values.';
5842
+ }
5843
+
5844
+ for (var index = indexOfCurrentCalendarInterval + 1; index < queryFormatMillisecondsMapKeys.length; index += 1) {
5845
+ if (totalRange / Object.values(queryFormatMillisecondsMap)[index] <= 100) {
5846
+ var calendarIntervalKey = queryFormatMillisecondsMapKeys[index];
5847
+ return {
5848
+ errorMessage: 'Please pass calendarInterval prop with value greater than or equal to a `' + calendarIntervalKey + '` for a meaningful resolution of histogram.',
5849
+ calculatedCalendarInterval: calendarIntervalKey
5850
+ };
5851
+ }
5852
+ }
5853
+
5854
+ return {
5855
+ errorMessage: 'Try using a shorter range of values.',
5856
+ calculatedCalendarInterval: 'year'
5857
+ };
5858
+ };
5859
+
5860
+ var isFunction = exports.isFunction = function isFunction(element) {
5861
+ return typeof element === 'function';
5862
+ };
5863
+
5864
+ var getComponent = exports.getComponent = function getComponent() {
5865
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5866
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5867
+ var children = props.children,
5868
+ render = props.render;
5869
+
5870
+ if (isFunction(children)) {
5871
+ return children(data);
5872
+ }
5873
+
5874
+ if (isFunction(render)) {
5875
+ return render(data);
5876
+ }
5877
+
5878
+ return null;
5879
+ };
5880
+
5881
+ var hasCustomRenderer = exports.hasCustomRenderer = function hasCustomRenderer() {
5882
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5883
+ var render = props.render,
5884
+ children = props.children;
5885
+ return isFunction(children) || isFunction(render);
5886
+ };
5685
5887
  });
5686
5888
  unwrapExports(helper);
5687
- var helper_1 = helper.suggestionTypes;
5688
- var helper_2 = helper.getTopSuggestions;
5689
- var helper_3 = helper.withClickIds;
5690
- var helper_4 = helper.getCompositeAggsQuery;
5691
- var helper_5 = helper.getAggsQuery;
5692
- var helper_6 = helper.extractQueryFromDefaultQuery;
5693
- var helper_7 = helper.updateInternalQuery;
5694
- var helper_8 = helper.getSearchState;
5695
- var helper_9 = helper.getOptionsFromQuery;
5696
- var helper_10 = helper.parseHits;
5697
- var helper_11 = helper.handleA11yAction;
5698
- var helper_12 = helper.getInnerKey;
5699
- var helper_13 = helper.getClassName;
5700
- var helper_14 = helper.checkSomePropChange;
5701
- var helper_15 = helper.checkPropChange;
5702
- var helper_16 = helper.updateDefaultQuery;
5703
- var helper_17 = helper.updateCustomQuery;
5704
- var helper_18 = helper.isEqual;
5705
- var helper_19 = helper.debounce;
5706
- var helper_20 = helper.getQueryOptions;
5707
- var helper_21 = helper.buildQuery;
5708
- var helper_22 = helper.pushToAndClause;
5709
- var helper_23 = helper.checkValueChange;
5710
- var helper_24 = helper.getAggsOrder;
5711
- var helper_25 = helper.formatDate;
5712
- var helper_26 = helper.getResultStats;
5713
- var helper_27 = helper.extractFieldsFromSource;
5714
- var helper_28 = helper.normalizeDataField;
5715
- var helper_29 = helper.handleOnSuggestions;
5716
- var helper_30 = helper.isValidDateRangeQueryFormat;
5889
+ var helper_1 = helper.hasCustomRenderer;
5890
+ var helper_2 = helper.getComponent;
5891
+ var helper_3 = helper.isFunction;
5892
+ var helper_4 = helper.getCalendarIntervalErrorMessage;
5893
+ var helper_5 = helper.queryFormatMillisecondsMap;
5894
+ var helper_6 = helper.suggestionTypes;
5895
+ var helper_7 = helper.getTopSuggestions;
5896
+ var helper_8 = helper.withClickIds;
5897
+ var helper_9 = helper.getCompositeAggsQuery;
5898
+ var helper_10 = helper.getAggsQuery;
5899
+ var helper_11 = helper.extractQueryFromDefaultQuery;
5900
+ var helper_12 = helper.updateInternalQuery;
5901
+ var helper_13 = helper.getSearchState;
5902
+ var helper_14 = helper.extractQueryFromCustomQuery;
5903
+ var helper_15 = helper.getOptionsForCustomQuery;
5904
+ var helper_16 = helper.getOptionsFromQuery;
5905
+ var helper_17 = helper.parseHits;
5906
+ var helper_18 = helper.handleA11yAction;
5907
+ var helper_19 = helper.getInnerKey;
5908
+ var helper_20 = helper.getClassName;
5909
+ var helper_21 = helper.checkSomePropChange;
5910
+ var helper_22 = helper.checkPropChange;
5911
+ var helper_23 = helper.updateDefaultQuery;
5912
+ var helper_24 = helper.updateCustomQuery;
5913
+ var helper_25 = helper.isEqual;
5914
+ var helper_26 = helper.compareQueries;
5915
+ var helper_27 = helper.debounce;
5916
+ var helper_28 = helper.getQueryOptions;
5917
+ var helper_29 = helper.buildQuery;
5918
+ var helper_30 = helper.pushToAndClause;
5919
+ var helper_31 = helper.checkValueChange;
5920
+ var helper_32 = helper.getAggsOrder;
5921
+ var helper_33 = helper.formatDate;
5922
+ var helper_34 = helper.getResultStats;
5923
+ var helper_35 = helper.extractFieldsFromSource;
5924
+ var helper_36 = helper.normalizeDataField;
5925
+ var helper_37 = helper.handleOnSuggestions;
5926
+ var helper_38 = helper.isValidDateRangeQueryFormat;
5717
5927
 
5718
5928
  var value = createCommonjsModule(function (module, exports) {
5719
5929
  Object.defineProperty(exports, "__esModule", {
@@ -5781,7 +5991,7 @@
5781
5991
  };
5782
5992
  }
5783
5993
 
5784
- function resetValuesToDefault() {
5994
+ function resetValuesToDefault(clearAllBlacklistComponents) {
5785
5995
  return function (dispatch, getState) {
5786
5996
  var _getState2 = getState(),
5787
5997
  selectedValues = _getState2.selectedValues,
@@ -5790,23 +6000,23 @@
5790
6000
  var defaultValues = {};
5791
6001
  var valueToSet = void 0;
5792
6002
  Object.keys(selectedValues).forEach(function (component) {
5793
- if (!componentProps[component] || !componentProps[component].componentType || !componentProps[component].defaultValue) {
5794
- valueToSet = null;
5795
- } else if ([constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.dateRange].includes(componentProps[component].componentType)) {
5796
- valueToSet = typeof componentProps[component].defaultValue === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null;
5797
- } else if ([constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange, constants$1.componentTypes.dataSearch, constants$1.componentTypes.datePicker].includes(componentProps[component].componentType)) {
5798
- valueToSet = componentProps[component].defaultValue;
5799
- } else if ([constants$1.componentTypes.categorySearch].includes(componentProps[component].componentType)) {
5800
- valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : '';
5801
- }
6003
+ if (!(Array.isArray(clearAllBlacklistComponents) && clearAllBlacklistComponents.includes(component))) {
6004
+ if (!componentProps[component] || !componentProps[component].componentType || !componentProps[component].defaultValue) {
6005
+ valueToSet = null;
6006
+ } else if ([constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.dateRange].includes(componentProps[component].componentType)) {
6007
+ valueToSet = typeof componentProps[component].defaultValue === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null;
6008
+ } else if ([constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange, constants$1.componentTypes.dataSearch, constants$1.componentTypes.datePicker].includes(componentProps[component].componentType)) {
6009
+ valueToSet = componentProps[component].defaultValue;
6010
+ } else if ([constants$1.componentTypes.categorySearch].includes(componentProps[component].componentType)) {
6011
+ valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : '';
6012
+ }
5802
6013
 
5803
- if (!(0, helper.isEqual)(selectedValues[component].value, valueToSet)) {
5804
- defaultValues = _extends({}, defaultValues, _defineProperty({}, component, _extends({}, selectedValues[component], {
5805
- value: valueToSet
5806
- })));
6014
+ if (!(0, helper.isEqual)(selectedValues[component].value, valueToSet)) {
6015
+ defaultValues = _extends({}, defaultValues, _defineProperty({}, component, _extends({}, selectedValues[component], {
6016
+ value: valueToSet
6017
+ })));
6018
+ }
5807
6019
  }
5808
-
5809
- return true;
5810
6020
  });
5811
6021
  dispatch({
5812
6022
  type: constants.RESET_TO_DEFAULT,
@@ -5836,9 +6046,11 @@
5836
6046
 
5837
6047
  function clearValues() {
5838
6048
  var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6049
+ var clearAllBlacklistComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
5839
6050
  return {
5840
6051
  type: constants.CLEAR_VALUES,
5841
- resetValues: resetValues
6052
+ resetValues: resetValues,
6053
+ clearAllBlacklistComponents: clearAllBlacklistComponents
5842
6054
  };
5843
6055
  }
5844
6056
  });
@@ -5873,6 +6085,9 @@
5873
6085
  exports.setCustomData = setCustomData;
5874
6086
  exports.setAppliedSettings = setAppliedSettings;
5875
6087
  exports.setQueryListener = setQueryListener;
6088
+ exports.setGoogleMapScriptLoading = setGoogleMapScriptLoading;
6089
+ exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded;
6090
+ exports.setGoogleMapScriptError = setGoogleMapScriptError;
5876
6091
 
5877
6092
  function setRawData(component, response) {
5878
6093
  return {
@@ -6043,6 +6258,27 @@
6043
6258
  onError: onError
6044
6259
  };
6045
6260
  }
6261
+
6262
+ function setGoogleMapScriptLoading(bool) {
6263
+ return {
6264
+ type: constants.SET_GOOGLE_MAP_SCRIPT_LOADING,
6265
+ loading: bool
6266
+ };
6267
+ }
6268
+
6269
+ function setGoogleMapScriptLoaded(bool) {
6270
+ return {
6271
+ type: constants.SET_GOOGLE_MAP_SCRIPT_LOADED,
6272
+ loaded: bool
6273
+ };
6274
+ }
6275
+
6276
+ function setGoogleMapScriptError(error) {
6277
+ return {
6278
+ type: constants.SET_GOOGLE_MAP_SCRIPT_ERROR,
6279
+ error: error
6280
+ };
6281
+ }
6046
6282
  });
6047
6283
  unwrapExports(misc);
6048
6284
  var misc_1 = misc.setRawData;
@@ -6065,6 +6301,9 @@
6065
6301
  var misc_18 = misc.setCustomData;
6066
6302
  var misc_19 = misc.setAppliedSettings;
6067
6303
  var misc_20 = misc.setQueryListener;
6304
+ var misc_21 = misc.setGoogleMapScriptLoading;
6305
+ var misc_22 = misc.setGoogleMapScriptLoaded;
6306
+ var misc_23 = misc.setGoogleMapScriptError;
6068
6307
 
6069
6308
  var hits = createCommonjsModule(function (module, exports) {
6070
6309
  Object.defineProperty(exports, "__esModule", {
@@ -7205,7 +7444,7 @@
7205
7444
  }
7206
7445
 
7207
7446
  if (componentProps.componentType === constants$1.componentTypes.dynamicRangeSlider || componentProps.componentType === constants$1.componentTypes.rangeSlider) {
7208
- calendarInterval = Object.keys(_dateFormats2["default"]).includes(queryFormat) ? componentProps.calendarInterval || 'month' : undefined;
7447
+ calendarInterval = Object.keys(_dateFormats2["default"]).includes(queryFormat) ? componentProps.calendarInterval : undefined;
7209
7448
 
7210
7449
  if (value) {
7211
7450
  if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
@@ -8370,7 +8609,7 @@
8370
8609
  exports.Response = ctx.Response;
8371
8610
  module.exports = exports;
8372
8611
  });
8373
- unwrapExports(browserPonyfill);
8612
+ var fetch$1 = unwrapExports(browserPonyfill);
8374
8613
  var browserPonyfill_1 = browserPonyfill.fetch;
8375
8614
  var browserPonyfill_2 = browserPonyfill.Headers;
8376
8615
  var browserPonyfill_3 = browserPonyfill.Request;
@@ -8794,7 +9033,7 @@
8794
9033
 
8795
9034
  var oldQuery = queryLog[component];
8796
9035
 
8797
- if (mustExecuteMapQuery || !(0, helper.isEqual)(currentQuery, oldQuery)) {
9036
+ if (mustExecuteMapQuery || !(0, helper.compareQueries)(currentQuery, oldQuery, false)) {
8798
9037
  orderOfQueries = [].concat(_toConsumableArray(orderOfQueries), [component]);
8799
9038
  dispatch((0, misc.logQuery)(component, queryToLog));
8800
9039
  var isMapComponent = Object.keys(mapData).includes(component);
@@ -8814,7 +9053,7 @@
8814
9053
  var _getState5 = getState(),
8815
9054
  combinedLog = _getState5.combinedLog;
8816
9055
 
8817
- if ((0, helper.isEqual)(combinedLog[component], currentQuery)) return;
9056
+ if ((0, helper.compareQueries)(combinedLog[component], currentQuery)) return;
8818
9057
  dispatch((0, misc.logCombinedQuery)(component, currentQuery));
8819
9058
  }
8820
9059
 
@@ -9031,7 +9270,7 @@
9031
9270
  query: _extends({}, queryObj)
9032
9271
  }, options);
9033
9272
 
9034
- if ((0, helper.isEqual)(queryLog[component], currentQuery)) return;
9273
+ if ((0, helper.compareQueries)(queryLog[component], currentQuery)) return;
9035
9274
  dispatch((0, misc.logQuery)(component, currentQuery));
9036
9275
 
9037
9276
  if (store.config && store.config.enableAppbase) {
@@ -12781,7 +13020,7 @@
12781
13020
  return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: #ccc;\n\tcursor: not-allowed;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor ? curriedLighten(0.1, theme.colors.backgroundColor) : '#fafafa', theme.colors.backgroundColor ? curriedLighten(0.2, theme.colors.backgroundColor) : '#fafafa');
12782
13021
  };
12783
13022
 
12784
- var Button = index$1('a')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\talign-items: center;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tmin-height: 30px;\n\tword-wrap: break-word;\n\tpadding: 5px 12px;\n\tline-height: 1.2rem;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:focus {\n\t\toutline: 0;\n\t\tborder-color: ", ";\n\t\tbox-shadow: ", ";\n\t}\n\n\t", ";\n\t", ";\n\t", ";\n"])), function (_ref4) {
13023
+ var Button = index$1('a')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\talign-items: center;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tmin-height: 30px;\n\tword-wrap: break-word;\n\tpadding: 5px 12px;\n\tline-height: 1.2rem;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:focus {\n\t\toutline: 0;\n\t\tborder-color: ", ";\n\t\tbox-shadow: ", ";\n\t}\n\n\t", ";\n\t", ";\n\t", ";\n\n\t&.enter-btn {\n\t\tborder-top-left-radius: 0px;\n\t\tborder-bottom-left-radius: 0px;\n\t\theight: 100%;\n\t}\n"])), function (_ref4) {
12785
13024
  var theme = _ref4.theme;
12786
13025
  return theme.colors.backgroundColor || '#eee';
12787
13026
  }, function (_ref5) {
@@ -14023,9 +14262,10 @@
14023
14262
  getQueryOptions = lib_8.getQueryOptions,
14024
14263
  getClassName$1 = lib_8.getClassName,
14025
14264
  parseHits = lib_8.parseHits,
14026
- getOptionsFromQuery = lib_8.getOptionsFromQuery,
14027
14265
  getCompositeAggsQuery = lib_8.getCompositeAggsQuery,
14028
- getResultStats = lib_8.getResultStats;
14266
+ getResultStats = lib_8.getResultStats,
14267
+ extractQueryFromCustomQuery = lib_8.extractQueryFromCustomQuery,
14268
+ getOptionsForCustomQuery = lib_8.getOptionsForCustomQuery;
14029
14269
  var ReactiveList = {
14030
14270
  name: 'ReactiveList',
14031
14271
  components: {
@@ -14184,7 +14424,7 @@
14184
14424
  filteredResults = [].concat(parsedPromotedResults, filteredResults);
14185
14425
  }
14186
14426
 
14187
- return helper_3(filteredResults);
14427
+ return helper_8(filteredResults);
14188
14428
  }
14189
14429
  },
14190
14430
  watch: {
@@ -14223,19 +14463,11 @@
14223
14463
  var options = getQueryOptions(this.$props);
14224
14464
  options.from = 0;
14225
14465
  this.$defaultQuery = newVal(null, this.$props);
14226
-
14227
- var _ref = this.$defaultQuery || {},
14228
- sort = _ref.sort,
14229
- query = _ref.query;
14230
-
14231
- if (sort) {
14232
- options.sort = this.$defaultQuery.sort;
14233
- }
14234
-
14235
- var queryOptions = getOptionsFromQuery(this.$defaultQuery);
14466
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
14467
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
14236
14468
 
14237
14469
  if (queryOptions) {
14238
- options = _extends({}, options, getOptionsFromQuery(this.$defaultQuery));
14470
+ options = _extends({}, options, queryOptions);
14239
14471
  } // Update calculated default query in store
14240
14472
 
14241
14473
 
@@ -14326,24 +14558,24 @@
14326
14558
  options.from = this.$data.from;
14327
14559
 
14328
14560
  if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
14329
- var _ref2;
14561
+ var _ref;
14330
14562
 
14331
14563
  var sortField = this.sortOptions[this.sortOptionIndex].dataField;
14332
14564
  var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
14333
- options.sort = [(_ref2 = {}, _ref2[sortField] = {
14565
+ options.sort = [(_ref = {}, _ref[sortField] = {
14334
14566
  order: sortBy
14335
- }, _ref2)]; // To handle sort options for RS API
14567
+ }, _ref)]; // To handle sort options for RS API
14336
14568
 
14337
14569
  this.updateComponentProps(this.componentId, {
14338
14570
  dataField: sortField,
14339
14571
  sortBy: sortBy
14340
14572
  }, constants_1$1.reactiveList);
14341
14573
  } else if (this.$props.sortBy) {
14342
- var _ref3;
14574
+ var _ref2;
14343
14575
 
14344
- options.sort = [(_ref3 = {}, _ref3[this.$props.dataField] = {
14576
+ options.sort = [(_ref2 = {}, _ref2[this.$props.dataField] = {
14345
14577
  order: this.$props.sortBy
14346
- }, _ref3)];
14578
+ }, _ref2)];
14347
14579
  } // Override sort query with defaultQuery's sort if defined
14348
14580
 
14349
14581
 
@@ -14351,20 +14583,13 @@
14351
14583
 
14352
14584
  if (this.$props.defaultQuery) {
14353
14585
  this.$defaultQuery = this.$props.defaultQuery();
14354
- options = _extends({}, options, getOptionsFromQuery(this.$defaultQuery));
14355
-
14356
- if (this.$defaultQuery.sort) {
14357
- options.sort = this.$defaultQuery.sort;
14358
- } // Update calculated default query in store
14359
-
14586
+ options = _extends({}, options, getOptionsForCustomQuery(this.$defaultQuery)); // Update calculated default query in store
14360
14587
 
14361
14588
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props);
14362
14589
  } // execute is set to false at the time of mount
14363
14590
 
14364
14591
 
14365
- var _ref4 = this.$defaultQuery || {},
14366
- query = _ref4.query;
14367
-
14592
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
14368
14593
  var execute = false;
14369
14594
  this.setQueryOptions(this.$props.componentId, _extends({}, options, this.getAggsQuery()), execute);
14370
14595
 
@@ -14479,18 +14704,18 @@
14479
14704
  }) : 0;
14480
14705
 
14481
14706
  if (props.sortOptions[sortOptionIndex]) {
14482
- var _ref5;
14707
+ var _ref3;
14483
14708
 
14484
- options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
14709
+ options.sort = [(_ref3 = {}, _ref3[props.sortOptions[sortOptionIndex].dataField] = {
14485
14710
  order: props.sortOptions[sortOptionIndex].sortBy
14486
- }, _ref5)];
14711
+ }, _ref3)];
14487
14712
  }
14488
14713
  } else if (props.sortBy) {
14489
- var _ref6;
14714
+ var _ref4;
14490
14715
 
14491
- options.sort = [(_ref6 = {}, _ref6[props.dataField] = {
14716
+ options.sort = [(_ref4 = {}, _ref4[props.dataField] = {
14492
14717
  order: props.sortBy
14493
- }, _ref6)];
14718
+ }, _ref4)];
14494
14719
  }
14495
14720
 
14496
14721
  this.setQueryOptions(this.$props.componentId, _extends({}, options, this.getAggsQuery()), true);
@@ -14593,16 +14818,16 @@
14593
14818
  var index = e.target.value;
14594
14819
 
14595
14820
  if (this.sortOptions && this.sortOptions[index]) {
14596
- var _ref7;
14821
+ var _ref5;
14597
14822
 
14598
14823
  // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
14599
14824
  var options = getQueryOptions(this.$props);
14600
14825
  options.from = 0;
14601
14826
  var sortField = this.sortOptions[index].dataField;
14602
14827
  var sortBy = this.sortOptions[index].sortBy;
14603
- options.sort = [(_ref7 = {}, _ref7[sortField] = {
14828
+ options.sort = [(_ref5 = {}, _ref5[sortField] = {
14604
14829
  order: sortBy
14605
- }, _ref7)];
14830
+ }, _ref5)];
14606
14831
  this.sortOptionIndex = index; // To handle sort options for RS API
14607
14832
 
14608
14833
  this.updateComponentProps(this.componentId, {
@@ -14767,7 +14992,7 @@
14767
14992
  options.size = size || 10;
14768
14993
 
14769
14994
  var getSortOption = function getSortOption() {
14770
- var _ref9;
14995
+ var _ref7;
14771
14996
 
14772
14997
  if (defaultSortOption) {
14773
14998
  var sortOption = sortOptionsNew.find(function (option) {
@@ -14775,35 +15000,39 @@
14775
15000
  });
14776
15001
 
14777
15002
  if (sortOption) {
14778
- var _ref8;
15003
+ var _ref6;
14779
15004
 
14780
- return _ref8 = {}, _ref8[sortOption.dataField] = {
15005
+ return _ref6 = {}, _ref6[sortOption.dataField] = {
14781
15006
  order: sortOption.sortBy
14782
- }, _ref8;
15007
+ }, _ref6;
14783
15008
  }
14784
15009
  }
14785
15010
 
14786
- return _ref9 = {}, _ref9[sortOptionsNew[0].dataField] = {
15011
+ return _ref7 = {}, _ref7[sortOptionsNew[0].dataField] = {
14787
15012
  order: sortOptionsNew[0].sortBy
14788
- }, _ref9;
15013
+ }, _ref7;
14789
15014
  };
14790
15015
 
14791
15016
  if (sortOptionsNew) {
14792
15017
  options.sort = [getSortOption()];
14793
15018
  } else if (sortBy) {
14794
- var _ref10;
15019
+ var _ref8;
14795
15020
 
14796
- options.sort = [(_ref10 = {}, _ref10[dataField] = {
15021
+ options.sort = [(_ref8 = {}, _ref8[dataField] = {
14797
15022
  order: sortBy
14798
- }, _ref10)];
15023
+ }, _ref8)];
14799
15024
  }
14800
15025
 
14801
15026
  return options;
14802
15027
  };
14803
15028
 
15029
+ ReactiveList.hasInternalComponent = function () {
15030
+ return true;
15031
+ };
15032
+
14804
15033
  var RLConnected = ComponentWrapper$1(connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveList), {
14805
15034
  componentType: constants_1$1.reactiveList,
14806
- internalComponent: true
15035
+ internalComponent: ReactiveList.hasInternalComponent()
14807
15036
  });
14808
15037
 
14809
15038
  ReactiveList.install = function (Vue) {
@@ -14946,591 +15175,76 @@
14946
15175
  var querystring_3 = querystring.encode;
14947
15176
  var querystring_4 = querystring.stringify;
14948
15177
 
14949
- var browserPonyfill$1 = createCommonjsModule(function (module) {
14950
- var __root__ = function (root) {
14951
- function F() {
14952
- this.fetch = false;
14953
- }
14954
-
14955
- F.prototype = root;
14956
- return new F();
14957
- }(typeof self !== 'undefined' ? self : commonjsGlobal);
15178
+ var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
15179
+ return typeof obj;
15180
+ } : function (obj) {
15181
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
15182
+ };
14958
15183
 
14959
- (function (self) {
14960
- (function (self) {
14961
- if (self.fetch) {
14962
- return;
14963
- }
15184
+ function contains(string, substring) {
15185
+ return string.indexOf(substring) !== -1;
15186
+ }
14964
15187
 
14965
- var support = {
14966
- searchParams: 'URLSearchParams' in self,
14967
- iterable: 'Symbol' in self && 'iterator' in Symbol,
14968
- blob: 'FileReader' in self && 'Blob' in self && function () {
14969
- try {
14970
- new Blob();
14971
- return true;
14972
- } catch (e) {
14973
- return false;
14974
- }
14975
- }(),
14976
- formData: 'FormData' in self,
14977
- arrayBuffer: 'ArrayBuffer' in self
14978
- };
15188
+ function isAppbase(url) {
15189
+ return contains(url, 'scalr.api.appbase.io');
15190
+ }
14979
15191
 
14980
- if (support.arrayBuffer) {
14981
- var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];
15192
+ function btoa$1() {
15193
+ var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
15194
+ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
15195
+ var str = input;
15196
+ var output = ''; // eslint-disable-next-line
14982
15197
 
14983
- var isDataView = function isDataView(obj) {
14984
- return obj && DataView.prototype.isPrototypeOf(obj);
14985
- };
15198
+ for (var block = 0, charCode, i = 0, map = chars; str.charAt(i | 0) || (map = '=', i % 1); // eslint-disable-line no-bitwise
15199
+ output += map.charAt(63 & block >> 8 - i % 1 * 8) // eslint-disable-line no-bitwise
15200
+ ) {
15201
+ charCode = str.charCodeAt(i += 3 / 4);
14986
15202
 
14987
- var isArrayBufferView = ArrayBuffer.isView || function (obj) {
14988
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
14989
- };
14990
- }
15203
+ if (charCode > 0xff) {
15204
+ throw new Error('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');
15205
+ }
14991
15206
 
14992
- function normalizeName(name) {
14993
- if (typeof name !== 'string') {
14994
- name = String(name);
14995
- }
15207
+ block = block << 8 | charCode; // eslint-disable-line no-bitwise
15208
+ }
14996
15209
 
14997
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
14998
- throw new TypeError('Invalid character in header field name');
14999
- }
15210
+ return output;
15211
+ }
15000
15212
 
15001
- return name.toLowerCase();
15002
- }
15213
+ function validateRSQuery(query) {
15214
+ if (query && Object.prototype.toString.call(query) === '[object Array]') {
15215
+ for (var i = 0; i < query.length; i += 1) {
15216
+ var q = query[i];
15003
15217
 
15004
- function normalizeValue(value) {
15005
- if (typeof value !== 'string') {
15006
- value = String(value);
15218
+ if (q) {
15219
+ if (!q.id) {
15220
+ return new Error("'id' field must be present in query object");
15007
15221
  }
15222
+ } else {
15223
+ return new Error('query object can not have an empty value');
15224
+ }
15225
+ }
15008
15226
 
15009
- return value;
15010
- } // Build a destructive iterator for the value list
15227
+ return true;
15228
+ }
15011
15229
 
15230
+ return new Error("invalid query value, 'query' value must be an array");
15231
+ }
15012
15232
 
15013
- function iteratorFor(items) {
15014
- var iterator = {
15015
- next: function next() {
15016
- var value = items.shift();
15017
- return {
15018
- done: value === undefined,
15019
- value: value
15020
- };
15021
- }
15022
- };
15023
-
15024
- if (support.iterable) {
15025
- iterator[Symbol.iterator] = function () {
15026
- return iterator;
15027
- };
15028
- }
15029
-
15030
- return iterator;
15031
- }
15032
-
15033
- function Headers(headers) {
15034
- this.map = {};
15035
-
15036
- if (headers instanceof Headers) {
15037
- headers.forEach(function (value, name) {
15038
- this.append(name, value);
15039
- }, this);
15040
- } else if (Array.isArray(headers)) {
15041
- headers.forEach(function (header) {
15042
- this.append(header[0], header[1]);
15043
- }, this);
15044
- } else if (headers) {
15045
- Object.getOwnPropertyNames(headers).forEach(function (name) {
15046
- this.append(name, headers[name]);
15047
- }, this);
15048
- }
15049
- }
15050
-
15051
- Headers.prototype.append = function (name, value) {
15052
- name = normalizeName(name);
15053
- value = normalizeValue(value);
15054
- var oldValue = this.map[name];
15055
- this.map[name] = oldValue ? oldValue + ',' + value : value;
15056
- };
15057
-
15058
- Headers.prototype['delete'] = function (name) {
15059
- delete this.map[normalizeName(name)];
15060
- };
15061
-
15062
- Headers.prototype.get = function (name) {
15063
- name = normalizeName(name);
15064
- return this.has(name) ? this.map[name] : null;
15065
- };
15066
-
15067
- Headers.prototype.has = function (name) {
15068
- return this.map.hasOwnProperty(normalizeName(name));
15069
- };
15070
-
15071
- Headers.prototype.set = function (name, value) {
15072
- this.map[normalizeName(name)] = normalizeValue(value);
15073
- };
15074
-
15075
- Headers.prototype.forEach = function (callback, thisArg) {
15076
- for (var name in this.map) {
15077
- if (this.map.hasOwnProperty(name)) {
15078
- callback.call(thisArg, this.map[name], name, this);
15079
- }
15080
- }
15081
- };
15082
-
15083
- Headers.prototype.keys = function () {
15084
- var items = [];
15085
- this.forEach(function (value, name) {
15086
- items.push(name);
15087
- });
15088
- return iteratorFor(items);
15089
- };
15090
-
15091
- Headers.prototype.values = function () {
15092
- var items = [];
15093
- this.forEach(function (value) {
15094
- items.push(value);
15095
- });
15096
- return iteratorFor(items);
15097
- };
15098
-
15099
- Headers.prototype.entries = function () {
15100
- var items = [];
15101
- this.forEach(function (value, name) {
15102
- items.push([name, value]);
15103
- });
15104
- return iteratorFor(items);
15105
- };
15106
-
15107
- if (support.iterable) {
15108
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
15109
- }
15110
-
15111
- function consumed(body) {
15112
- if (body.bodyUsed) {
15113
- return Promise.reject(new TypeError('Already read'));
15114
- }
15115
-
15116
- body.bodyUsed = true;
15117
- }
15118
-
15119
- function fileReaderReady(reader) {
15120
- return new Promise(function (resolve, reject) {
15121
- reader.onload = function () {
15122
- resolve(reader.result);
15123
- };
15124
-
15125
- reader.onerror = function () {
15126
- reject(reader.error);
15127
- };
15128
- });
15129
- }
15130
-
15131
- function readBlobAsArrayBuffer(blob) {
15132
- var reader = new FileReader();
15133
- var promise = fileReaderReady(reader);
15134
- reader.readAsArrayBuffer(blob);
15135
- return promise;
15136
- }
15137
-
15138
- function readBlobAsText(blob) {
15139
- var reader = new FileReader();
15140
- var promise = fileReaderReady(reader);
15141
- reader.readAsText(blob);
15142
- return promise;
15143
- }
15144
-
15145
- function readArrayBufferAsText(buf) {
15146
- var view = new Uint8Array(buf);
15147
- var chars = new Array(view.length);
15148
-
15149
- for (var i = 0; i < view.length; i++) {
15150
- chars[i] = String.fromCharCode(view[i]);
15151
- }
15152
-
15153
- return chars.join('');
15154
- }
15155
-
15156
- function bufferClone(buf) {
15157
- if (buf.slice) {
15158
- return buf.slice(0);
15159
- } else {
15160
- var view = new Uint8Array(buf.byteLength);
15161
- view.set(new Uint8Array(buf));
15162
- return view.buffer;
15163
- }
15164
- }
15165
-
15166
- function Body() {
15167
- this.bodyUsed = false;
15168
-
15169
- this._initBody = function (body) {
15170
- this._bodyInit = body;
15171
-
15172
- if (!body) {
15173
- this._bodyText = '';
15174
- } else if (typeof body === 'string') {
15175
- this._bodyText = body;
15176
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
15177
- this._bodyBlob = body;
15178
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
15179
- this._bodyFormData = body;
15180
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
15181
- this._bodyText = body.toString();
15182
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
15183
- this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body.
15184
-
15185
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
15186
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
15187
- this._bodyArrayBuffer = bufferClone(body);
15188
- } else {
15189
- throw new Error('unsupported BodyInit type');
15190
- }
15191
-
15192
- if (!this.headers.get('content-type')) {
15193
- if (typeof body === 'string') {
15194
- this.headers.set('content-type', 'text/plain;charset=UTF-8');
15195
- } else if (this._bodyBlob && this._bodyBlob.type) {
15196
- this.headers.set('content-type', this._bodyBlob.type);
15197
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
15198
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
15199
- }
15200
- }
15201
- };
15202
-
15203
- if (support.blob) {
15204
- this.blob = function () {
15205
- var rejected = consumed(this);
15206
-
15207
- if (rejected) {
15208
- return rejected;
15209
- }
15210
-
15211
- if (this._bodyBlob) {
15212
- return Promise.resolve(this._bodyBlob);
15213
- } else if (this._bodyArrayBuffer) {
15214
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
15215
- } else if (this._bodyFormData) {
15216
- throw new Error('could not read FormData body as blob');
15217
- } else {
15218
- return Promise.resolve(new Blob([this._bodyText]));
15219
- }
15220
- };
15221
-
15222
- this.arrayBuffer = function () {
15223
- if (this._bodyArrayBuffer) {
15224
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer);
15225
- } else {
15226
- return this.blob().then(readBlobAsArrayBuffer);
15227
- }
15228
- };
15229
- }
15230
-
15231
- this.text = function () {
15232
- var rejected = consumed(this);
15233
-
15234
- if (rejected) {
15235
- return rejected;
15236
- }
15237
-
15238
- if (this._bodyBlob) {
15239
- return readBlobAsText(this._bodyBlob);
15240
- } else if (this._bodyArrayBuffer) {
15241
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
15242
- } else if (this._bodyFormData) {
15243
- throw new Error('could not read FormData body as text');
15244
- } else {
15245
- return Promise.resolve(this._bodyText);
15246
- }
15247
- };
15248
-
15249
- if (support.formData) {
15250
- this.formData = function () {
15251
- return this.text().then(decode);
15252
- };
15253
- }
15254
-
15255
- this.json = function () {
15256
- return this.text().then(JSON.parse);
15257
- };
15258
-
15259
- return this;
15260
- } // HTTP methods whose capitalization should be normalized
15261
-
15262
-
15263
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
15264
-
15265
- function normalizeMethod(method) {
15266
- var upcased = method.toUpperCase();
15267
- return methods.indexOf(upcased) > -1 ? upcased : method;
15268
- }
15269
-
15270
- function Request(input, options) {
15271
- options = options || {};
15272
- var body = options.body;
15273
-
15274
- if (input instanceof Request) {
15275
- if (input.bodyUsed) {
15276
- throw new TypeError('Already read');
15277
- }
15278
-
15279
- this.url = input.url;
15280
- this.credentials = input.credentials;
15281
-
15282
- if (!options.headers) {
15283
- this.headers = new Headers(input.headers);
15284
- }
15285
-
15286
- this.method = input.method;
15287
- this.mode = input.mode;
15288
-
15289
- if (!body && input._bodyInit != null) {
15290
- body = input._bodyInit;
15291
- input.bodyUsed = true;
15292
- }
15293
- } else {
15294
- this.url = String(input);
15295
- }
15296
-
15297
- this.credentials = options.credentials || this.credentials || 'omit';
15298
-
15299
- if (options.headers || !this.headers) {
15300
- this.headers = new Headers(options.headers);
15301
- }
15302
-
15303
- this.method = normalizeMethod(options.method || this.method || 'GET');
15304
- this.mode = options.mode || this.mode || null;
15305
- this.referrer = null;
15306
-
15307
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
15308
- throw new TypeError('Body not allowed for GET or HEAD requests');
15309
- }
15310
-
15311
- this._initBody(body);
15312
- }
15313
-
15314
- Request.prototype.clone = function () {
15315
- return new Request(this, {
15316
- body: this._bodyInit
15317
- });
15318
- };
15319
-
15320
- function decode(body) {
15321
- var form = new FormData();
15322
- body.trim().split('&').forEach(function (bytes) {
15323
- if (bytes) {
15324
- var split = bytes.split('=');
15325
- var name = split.shift().replace(/\+/g, ' ');
15326
- var value = split.join('=').replace(/\+/g, ' ');
15327
- form.append(decodeURIComponent(name), decodeURIComponent(value));
15328
- }
15329
- });
15330
- return form;
15331
- }
15332
-
15333
- function parseHeaders(rawHeaders) {
15334
- var headers = new Headers(); // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
15335
- // https://tools.ietf.org/html/rfc7230#section-3.2
15336
-
15337
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
15338
- preProcessedHeaders.split(/\r?\n/).forEach(function (line) {
15339
- var parts = line.split(':');
15340
- var key = parts.shift().trim();
15341
-
15342
- if (key) {
15343
- var value = parts.join(':').trim();
15344
- headers.append(key, value);
15345
- }
15346
- });
15347
- return headers;
15348
- }
15349
-
15350
- Body.call(Request.prototype);
15351
-
15352
- function Response(bodyInit, options) {
15353
- if (!options) {
15354
- options = {};
15355
- }
15356
-
15357
- this.type = 'default';
15358
- this.status = options.status === undefined ? 200 : options.status;
15359
- this.ok = this.status >= 200 && this.status < 300;
15360
- this.statusText = 'statusText' in options ? options.statusText : 'OK';
15361
- this.headers = new Headers(options.headers);
15362
- this.url = options.url || '';
15363
-
15364
- this._initBody(bodyInit);
15365
- }
15366
-
15367
- Body.call(Response.prototype);
15368
-
15369
- Response.prototype.clone = function () {
15370
- return new Response(this._bodyInit, {
15371
- status: this.status,
15372
- statusText: this.statusText,
15373
- headers: new Headers(this.headers),
15374
- url: this.url
15375
- });
15376
- };
15377
-
15378
- Response.error = function () {
15379
- var response = new Response(null, {
15380
- status: 0,
15381
- statusText: ''
15382
- });
15383
- response.type = 'error';
15384
- return response;
15385
- };
15386
-
15387
- var redirectStatuses = [301, 302, 303, 307, 308];
15388
-
15389
- Response.redirect = function (url, status) {
15390
- if (redirectStatuses.indexOf(status) === -1) {
15391
- throw new RangeError('Invalid status code');
15392
- }
15393
-
15394
- return new Response(null, {
15395
- status: status,
15396
- headers: {
15397
- location: url
15398
- }
15399
- });
15400
- };
15401
-
15402
- self.Headers = Headers;
15403
- self.Request = Request;
15404
- self.Response = Response;
15405
-
15406
- self.fetch = function (input, init) {
15407
- return new Promise(function (resolve, reject) {
15408
- var request = new Request(input, init);
15409
- var xhr = new XMLHttpRequest();
15410
-
15411
- xhr.onload = function () {
15412
- var options = {
15413
- status: xhr.status,
15414
- statusText: xhr.statusText,
15415
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
15416
- };
15417
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
15418
- var body = 'response' in xhr ? xhr.response : xhr.responseText;
15419
- resolve(new Response(body, options));
15420
- };
15421
-
15422
- xhr.onerror = function () {
15423
- reject(new TypeError('Network request failed'));
15424
- };
15425
-
15426
- xhr.ontimeout = function () {
15427
- reject(new TypeError('Network request failed'));
15428
- };
15429
-
15430
- xhr.open(request.method, request.url, true);
15431
-
15432
- if (request.credentials === 'include') {
15433
- xhr.withCredentials = true;
15434
- } else if (request.credentials === 'omit') {
15435
- xhr.withCredentials = false;
15436
- }
15437
-
15438
- if ('responseType' in xhr && support.blob) {
15439
- xhr.responseType = 'blob';
15440
- }
15441
-
15442
- request.headers.forEach(function (value, name) {
15443
- xhr.setRequestHeader(name, value);
15444
- });
15445
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
15446
- });
15447
- };
15448
-
15449
- self.fetch.polyfill = true;
15450
- })(typeof self !== 'undefined' ? self : this);
15451
- }).call(__root__, void 0);
15452
- var fetch = __root__.fetch;
15453
- var Response = fetch.Response = __root__.Response;
15454
- var Request = fetch.Request = __root__.Request;
15455
- var Headers = fetch.Headers = __root__.Headers;
15456
-
15457
- if ( module.exports) {
15458
- module.exports = fetch; // Needed for TypeScript consumers without esModuleInterop.
15459
-
15460
- module.exports["default"] = fetch;
15461
- }
15462
- });
15463
-
15464
- var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
15465
- return typeof obj;
15466
- } : function (obj) {
15467
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
15468
- };
15469
-
15470
- function contains(string, substring) {
15471
- return string.indexOf(substring) !== -1;
15472
- }
15473
-
15474
- function isAppbase(url) {
15475
- return contains(url, 'scalr.api.appbase.io');
15476
- }
15477
-
15478
- function btoa$1() {
15479
- var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
15480
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
15481
- var str = input;
15482
- var output = ''; // eslint-disable-next-line
15483
-
15484
- for (var block = 0, charCode, i = 0, map = chars; str.charAt(i | 0) || (map = '=', i % 1); // eslint-disable-line no-bitwise
15485
- output += map.charAt(63 & block >> 8 - i % 1 * 8) // eslint-disable-line no-bitwise
15486
- ) {
15487
- charCode = str.charCodeAt(i += 3 / 4);
15488
-
15489
- if (charCode > 0xff) {
15490
- throw new Error('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');
15491
- }
15492
-
15493
- block = block << 8 | charCode; // eslint-disable-line no-bitwise
15494
- }
15495
-
15496
- return output;
15497
- }
15498
-
15499
- function validateRSQuery(query) {
15500
- if (query && Object.prototype.toString.call(query) === '[object Array]') {
15501
- for (var i = 0; i < query.length; i += 1) {
15502
- var q = query[i];
15503
-
15504
- if (q) {
15505
- if (!q.id) {
15506
- return new Error("'id' field must be present in query object");
15507
- }
15508
- } else {
15509
- return new Error('query object can not have an empty value');
15510
- }
15511
- }
15512
-
15513
- return true;
15514
- }
15515
-
15516
- return new Error("invalid query value, 'query' value must be an array");
15517
- }
15518
-
15519
- function validate(object, fields) {
15520
- var invalid = [];
15521
- var emptyFor = {
15522
- object: null,
15523
- string: '',
15524
- number: 0
15525
- };
15526
- var keys = Object.keys(fields);
15527
- keys.forEach(function (key) {
15528
- var types = fields[key].split('|');
15529
- var matchedType = types.find(function (type) {
15530
- return (// eslint-disable-next-line
15531
- _typeof$1(object[key]) === type
15532
- );
15533
- });
15233
+ function validate(object, fields) {
15234
+ var invalid = [];
15235
+ var emptyFor = {
15236
+ object: null,
15237
+ string: '',
15238
+ number: 0
15239
+ };
15240
+ var keys = Object.keys(fields);
15241
+ keys.forEach(function (key) {
15242
+ var types = fields[key].split('|');
15243
+ var matchedType = types.find(function (type) {
15244
+ return (// eslint-disable-next-line
15245
+ _typeof$1(object[key]) === type
15246
+ );
15247
+ });
15534
15248
 
15535
15249
  if (!matchedType || object[key] === emptyFor[matchedType]) {
15536
15250
  invalid.push(key);
@@ -15791,17 +15505,10 @@
15791
15505
  }
15792
15506
 
15793
15507
  var credentials = auth || null;
15794
-
15795
- if (!config.mongodb) {
15796
- if (isAppbase(url) && credentials === null) {
15797
- throw new Error('Authentication information is not present. Did you add credentials?');
15798
- }
15799
- }
15800
15508
  /**
15801
15509
  * Credentials can be provided as a part of the URL,
15802
15510
  * as username, password args or as a credentials argument directly */
15803
15511
 
15804
-
15805
15512
  if (typeof config.credentials === 'string' && config.credentials !== '') {
15806
15513
  // eslint-disable-next-line
15807
15514
  credentials = config.credentials;
@@ -15809,6 +15516,12 @@
15809
15516
  credentials = config.username + ':' + config.password;
15810
15517
  }
15811
15518
 
15519
+ if (!config.mongodb) {
15520
+ if (isAppbase(url) && credentials === null) {
15521
+ throw new Error('Authentication information is not present. Did you add credentials?');
15522
+ }
15523
+ }
15524
+
15812
15525
  this.url = url;
15813
15526
  this.protocol = protocol;
15814
15527
  this.app = config.app;
@@ -15906,7 +15619,7 @@
15906
15619
  var transformedRequest = Object.assign({}, ts);
15907
15620
  var url = transformedRequest.url;
15908
15621
  delete transformedRequest.url;
15909
- return browserPonyfill$1(url || finalURL, Object.assign({}, transformedRequest, {
15622
+ return fetch$1(url || finalURL, Object.assign({}, transformedRequest, {
15910
15623
  // apply timestamp header for RS API
15911
15624
  headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
15912
15625
  'x-timestamp': new Date().getTime()
@@ -17161,14 +16874,14 @@
17161
16874
  this.updateState(this.$props);
17162
16875
  },
17163
16876
  analyticsConfig: function analyticsConfig(newVal, oldVal) {
17164
- if (!helper_18(newVal, oldVal)) {
16877
+ if (!helper_25(newVal, oldVal)) {
17165
16878
  if (this.store) {
17166
16879
  this.store.dispatch(analytics_3$1(newVal));
17167
16880
  }
17168
16881
  }
17169
16882
  },
17170
16883
  appbaseConfig: function appbaseConfig(newVal, oldVal) {
17171
- if (!helper_18(newVal, oldVal)) {
16884
+ if (!helper_25(newVal, oldVal)) {
17172
16885
  if (this.store) {
17173
16886
  this.store.dispatch(analytics_3$1(newVal));
17174
16887
  }
@@ -19850,7 +19563,8 @@
19850
19563
  var debounce$1 = lib_8.debounce,
19851
19564
  checkValueChange = lib_8.checkValueChange,
19852
19565
  getClassName$3 = lib_8.getClassName,
19853
- getOptionsFromQuery$1 = lib_8.getOptionsFromQuery,
19566
+ extractQueryFromCustomQuery$1 = lib_8.extractQueryFromCustomQuery,
19567
+ getOptionsForCustomQuery$1 = lib_8.getOptionsForCustomQuery,
19854
19568
  isEqual$4 = lib_8.isEqual,
19855
19569
  getCompositeAggsQuery$1 = lib_8.getCompositeAggsQuery,
19856
19570
  withClickIds = lib_8.withClickIds,
@@ -19906,11 +19620,15 @@
19906
19620
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
19907
19621
  }
19908
19622
 
19909
- this.loadPopularSuggestions(this.$props.componentId);
19910
19623
  this.currentValue = this.selectedValue || '';
19624
+ var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
19625
+
19626
+ if (shouldFetchInitialSuggestions) {
19627
+ this.loadPopularSuggestions(this.$props.componentId);
19911
19628
 
19912
- if (enableRecentSearches) {
19913
- this.getRecentSearches();
19629
+ if (enableRecentSearches) {
19630
+ this.getRecentSearches();
19631
+ }
19914
19632
  }
19915
19633
 
19916
19634
  this.handleTextChange = debounce$1(this.handleText, this.$props.debounce); // Set custom and default queries in store
@@ -19947,7 +19665,7 @@
19947
19665
  defaultSearchSuggestions: function defaultSearchSuggestions() {
19948
19666
  var isPopularSuggestionsEnabled = this.enableQuerySuggestions || this.enablePopularSuggestions;
19949
19667
 
19950
- if (this.currentValue) {
19668
+ if (this.currentValue || !this.enableDefaultSuggestions) {
19951
19669
  return [];
19952
19670
  }
19953
19671
 
@@ -20044,7 +19762,8 @@
20044
19762
  addonBefore: VueTypes.any,
20045
19763
  addonAfter: VueTypes.any,
20046
19764
  expandSuggestionsContainer: VueTypes.bool.def(true),
20047
- index: VueTypes.string
19765
+ index: VueTypes.string,
19766
+ enableDefaultSuggestions: VueTypes.bool.def(true)
20048
19767
  },
20049
19768
  beforeMount: function beforeMount() {
20050
19769
  if (this.$props.highlight) {
@@ -20212,7 +19931,7 @@
20212
19931
  // returns size and aggs property
20213
19932
  getBasicQueryOptions: function getBasicQueryOptions() {
20214
19933
  var aggregationField = this.$props.aggregationField;
20215
- var queryOptions = helper_20(this.$props);
19934
+ var queryOptions = helper_28(this.$props);
20216
19935
 
20217
19936
  if (aggregationField) {
20218
19937
  queryOptions.aggs = getCompositeAggsQuery$1({
@@ -20308,12 +20027,13 @@
20308
20027
 
20309
20028
  if (this.defaultQuery) {
20310
20029
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
20030
+ var defaultQueryObj = extractQueryFromCustomQuery$1(defaultQueryToBeSet);
20311
20031
 
20312
- if (defaultQueryToBeSet.query) {
20313
- query = defaultQueryToBeSet.query;
20032
+ if (defaultQueryObj) {
20033
+ query = defaultQueryObj;
20314
20034
  }
20315
20035
 
20316
- defaultQueryOptions = getOptionsFromQuery$1(defaultQueryToBeSet); // Update calculated default query in store
20036
+ defaultQueryOptions = getOptionsForCustomQuery$1(defaultQueryToBeSet); // Update calculated default query in store
20317
20037
 
20318
20038
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
20319
20039
  }
@@ -20337,13 +20057,13 @@
20337
20057
 
20338
20058
  if (customQuery) {
20339
20059
  var customQueryTobeSet = customQuery(value, props);
20340
- var queryTobeSet = customQueryTobeSet.query;
20060
+ var queryTobeSet = extractQueryFromCustomQuery$1(customQueryTobeSet);
20341
20061
 
20342
20062
  if (queryTobeSet) {
20343
20063
  query = queryTobeSet;
20344
20064
  }
20345
20065
 
20346
- customQueryOptions = getOptionsFromQuery$1(customQueryTobeSet);
20066
+ customQueryOptions = getOptionsForCustomQuery$1(customQueryTobeSet);
20347
20067
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
20348
20068
  this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions), false);
20349
20069
  }
@@ -20670,11 +20390,17 @@
20670
20390
  var _this$$props4 = this.$props,
20671
20391
  theme = _this$$props4.theme,
20672
20392
  size = _this$$props4.size,
20673
- expandSuggestionsContainer = _this$$props4.expandSuggestionsContainer;
20393
+ expandSuggestionsContainer = _this$$props4.expandSuggestionsContainer,
20394
+ enableDefaultSuggestions = _this$$props4.enableDefaultSuggestions;
20674
20395
  var _this$$scopedSlots = this.$scopedSlots,
20675
20396
  recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
20676
20397
  popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
20677
20398
  var hasSuggestions = this.currentValue ? this.suggestionsList.length || this.topSuggestions.length : this.defaultSearchSuggestions.length;
20399
+
20400
+ if (enableDefaultSuggestions === false && !this.currentValue) {
20401
+ hasSuggestions = false;
20402
+ }
20403
+
20678
20404
  return h(Container, {
20679
20405
  "class": this.$props.className
20680
20406
  }, [this.$props.title && h(Title, {
@@ -21032,6 +20758,10 @@
21032
20758
  };
21033
20759
  };
21034
20760
 
20761
+ DataSearch.hasInternalComponent = function () {
20762
+ return true;
20763
+ };
20764
+
21035
20765
  var mapStateToProps$3 = function mapStateToProps(state, props) {
21036
20766
  return {
21037
20767
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
@@ -21069,7 +20799,7 @@
21069
20799
  };
21070
20800
  var DSConnected = ComponentWrapper$1(connect(mapStateToProps$3, mapDispatchToProps$2)(DataSearch), {
21071
20801
  componentType: constants_1$1.dataSearch,
21072
- internalComponent: true
20802
+ internalComponent: DataSearch.hasInternalComponent()
21073
20803
  });
21074
20804
 
21075
20805
  DataSearch.install = function (Vue) {
@@ -21243,7 +20973,9 @@
21243
20973
  applyStopwords: VueTypes.bool,
21244
20974
  customStopwords: types.stringArray,
21245
20975
  onData: types.func,
21246
- renderItem: types.func
20976
+ renderItem: types.func,
20977
+ enterButton: VueTypes.bool.def(false),
20978
+ renderEnterButton: VueTypes.any
21247
20979
  },
21248
20980
  mounted: function mounted() {
21249
20981
  this.listenForFocusShortcuts();
@@ -21356,7 +21088,7 @@
21356
21088
  this.triggerDefaultQuery(value);
21357
21089
  } else if (this.$props.autosuggest) {
21358
21090
  this.triggerDefaultQuery(value);
21359
- } else {
21091
+ } else if (!this.$props.enterButton) {
21360
21092
  this.triggerCustomQuery(value);
21361
21093
  }
21362
21094
  },
@@ -21403,7 +21135,7 @@
21403
21135
  // returns size and aggs property
21404
21136
  getBasicQueryOptions: function getBasicQueryOptions() {
21405
21137
  var aggregationField = this.$props.aggregationField;
21406
- var queryOptions = helper_20(this.$props);
21138
+ var queryOptions = helper_28(this.$props);
21407
21139
 
21408
21140
  if (aggregationField) {
21409
21141
  queryOptions.aggs = getCompositeAggsQuery$2({
@@ -21772,15 +21504,56 @@
21772
21504
 
21773
21505
  return null;
21774
21506
  },
21775
- renderIcons: function renderIcons() {
21507
+ renderEnterButtonElement: function renderEnterButtonElement() {
21508
+ var _this4 = this;
21509
+
21776
21510
  var h = this.$createElement;
21777
21511
  var _this$$props4 = this.$props,
21778
- iconPosition = _this$$props4.iconPosition,
21779
- showClear = _this$$props4.showClear,
21780
- innerClass = _this$$props4.innerClass,
21781
- getMicInstance = _this$$props4.getMicInstance,
21782
- showVoiceSearch = _this$$props4.showVoiceSearch,
21783
- showIcon = _this$$props4.showIcon;
21512
+ enterButton = _this$$props4.enterButton,
21513
+ innerClass = _this$$props4.innerClass;
21514
+ var renderEnterButton = this.$scopedSlots.renderEnterButton;
21515
+
21516
+ var enterButtonOnClick = function enterButtonOnClick() {
21517
+ return _this4.triggerQuery({
21518
+ isOpen: false,
21519
+ value: _this4.currentValue,
21520
+ customQuery: true
21521
+ });
21522
+ };
21523
+
21524
+ if (enterButton) {
21525
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
21526
+ if (renderEnterButton) {
21527
+ return renderEnterButton(enterButtonOnClick);
21528
+ }
21529
+
21530
+ return h(Button, {
21531
+ "class": "enter-btn " + getClassName$4(innerClass, 'enterButton'),
21532
+ "attrs": {
21533
+ "primary": true
21534
+ },
21535
+ "on": {
21536
+ "click": enterButtonOnClick
21537
+ }
21538
+ }, ["Search"]);
21539
+ };
21540
+
21541
+ return h("div", {
21542
+ "class": "enter-button-wrapper"
21543
+ }, [getEnterButtonMarkup()]);
21544
+ }
21545
+
21546
+ return null;
21547
+ },
21548
+ renderIcons: function renderIcons() {
21549
+ var h = this.$createElement;
21550
+ var _this$$props5 = this.$props,
21551
+ iconPosition = _this$$props5.iconPosition,
21552
+ showClear = _this$$props5.showClear,
21553
+ innerClass = _this$$props5.innerClass,
21554
+ getMicInstance = _this$$props5.getMicInstance,
21555
+ showVoiceSearch = _this$$props5.showVoiceSearch,
21556
+ showIcon = _this$$props5.showIcon;
21784
21557
  var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
21785
21558
  var currentValue = this.$data.currentValue;
21786
21559
  return h("div", [h(IconGroup, {
@@ -21832,7 +21605,7 @@
21832
21605
  (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
21833
21606
  },
21834
21607
  listenForFocusShortcuts: function listenForFocusShortcuts() {
21835
- var _this4 = this;
21608
+ var _this5 = this;
21836
21609
 
21837
21610
  var _this$$props$focusSho = this.$props.focusShortcuts,
21838
21611
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
@@ -21850,7 +21623,7 @@
21850
21623
  // Prevent the default refresh event under WINDOWS system
21851
21624
  event.preventDefault();
21852
21625
 
21853
- _this4.focusSearchBox(event);
21626
+ _this5.focusSearchBox(event);
21854
21627
  }); // if one of modifier keys are used, they are handled below
21855
21628
 
21856
21629
  hotkeys('*', function (event) {
@@ -21861,7 +21634,7 @@
21861
21634
  var element = modifierKeys[index];
21862
21635
 
21863
21636
  if (hotkeys[element]) {
21864
- _this4.focusSearchBox(event);
21637
+ _this5.focusSearchBox(event);
21865
21638
 
21866
21639
  break;
21867
21640
  }
@@ -21875,14 +21648,14 @@
21875
21648
  this.triggerDefaultQuery(value);
21876
21649
  },
21877
21650
  renderAutoFill: function renderAutoFill(suggestion) {
21878
- var _this5 = this;
21651
+ var _this6 = this;
21879
21652
 
21880
21653
  var h = this.$createElement;
21881
21654
 
21882
21655
  var handleAutoFillClick = function handleAutoFillClick(e) {
21883
21656
  e.stopPropagation();
21884
21657
 
21885
- _this5.onAutofillClick(suggestion);
21658
+ _this6.onAutofillClick(suggestion);
21886
21659
  };
21887
21660
  /* 👇 avoid showing autofill for category suggestions👇 */
21888
21661
 
@@ -21895,12 +21668,12 @@
21895
21668
  }
21896
21669
  },
21897
21670
  render: function render() {
21898
- var _this6 = this;
21671
+ var _this7 = this;
21899
21672
 
21900
21673
  var h = arguments[0];
21901
- var _this$$props5 = this.$props,
21902
- theme = _this$$props5.theme,
21903
- expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer;
21674
+ var _this$$props6 = this.$props,
21675
+ theme = _this$$props6.theme,
21676
+ expandSuggestionsContainer = _this$$props6.expandSuggestionsContainer;
21904
21677
  var _this$$scopedSlots = this.$scopedSlots,
21905
21678
  recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
21906
21679
  popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
@@ -21930,10 +21703,10 @@
21930
21703
  var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
21931
21704
  var getIcon = function getIcon(iconType) {
21932
21705
  switch (iconType) {
21933
- case helper_1.Recent:
21706
+ case helper_6.Recent:
21934
21707
  return recentSearchesIcon;
21935
21708
 
21936
- case helper_1.Popular:
21709
+ case helper_6.Popular:
21937
21710
  return popularSearchesIcon;
21938
21711
 
21939
21712
  default:
@@ -21941,14 +21714,14 @@
21941
21714
  }
21942
21715
  };
21943
21716
 
21944
- return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
21717
+ return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
21945
21718
  isOpen: isOpen,
21946
21719
  getItemProps: getItemProps,
21947
21720
  getItemEvents: getItemEvents,
21948
21721
  highlightedIndex: highlightedIndex
21949
- }), _this6.renderErrorComponent(), !_this6.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
21950
- "class": suggestions$1(_this6.themePreset, theme) + " " + getClassName$4(_this6.$props.innerClass, 'list')
21951
- }, [_this6.normalizedSuggestions.map(function (item, index) {
21722
+ }), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
21723
+ "class": suggestions$1(_this7.themePreset, theme) + " " + getClassName$4(_this7.$props.innerClass, 'list')
21724
+ }, [_this7.normalizedSuggestions.map(function (item, index) {
21952
21725
  return renderItem ? h("li", {
21953
21726
  "domProps": _extends({}, getItemProps({
21954
21727
  item: item
@@ -21958,7 +21731,7 @@
21958
21731
  })),
21959
21732
  "key": index + 1 + "-" + item.value,
21960
21733
  "style": {
21961
- backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
21734
+ backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
21962
21735
  justifyContent: 'flex-start',
21963
21736
  alignItems: 'center'
21964
21737
  }
@@ -21971,7 +21744,7 @@
21971
21744
  })),
21972
21745
  "key": index + 1 + "-" + item.value,
21973
21746
  "style": {
21974
- backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
21747
+ backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
21975
21748
  justifyContent: 'flex-start',
21976
21749
  alignItems: 'center'
21977
21750
  }
@@ -21982,61 +21755,61 @@
21982
21755
  }
21983
21756
  }, [h(CustomSvg, {
21984
21757
  "attrs": {
21985
- "className": getClassName$4(_this6.$props.innerClass, item._suggestion_type + "-search-icon") || null,
21758
+ "className": getClassName$4(_this7.$props.innerClass, item._suggestion_type + "-search-icon") || null,
21986
21759
  "icon": getIcon(item._suggestion_type),
21987
21760
  "type": item._suggestion_type + "-search-icon"
21988
21761
  }
21989
21762
  })]), h(SuggestionItem, {
21990
21763
  "attrs": {
21991
- "currentValue": _this6.currentValue,
21764
+ "currentValue": _this7.currentValue,
21992
21765
  "suggestion": item
21993
21766
  }
21994
- }), _this6.renderAutoFill(item)]);
21995
- })]) : _this6.renderNoSuggestions(_this6.normalizedSuggestions)]);
21767
+ }), _this7.renderAutoFill(item)]);
21768
+ })]) : _this7.renderNoSuggestions(_this7.normalizedSuggestions)]);
21996
21769
  };
21997
21770
 
21998
21771
  return h("div", {
21999
21772
  "class": suggestionsContainer
22000
- }, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
21773
+ }, [h(InputGroup, [_this7.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
22001
21774
  "attrs": {
22002
- "id": _this6.$props.componentId + "-input",
22003
- "showIcon": _this6.$props.showIcon,
22004
- "showClear": _this6.$props.showClear,
22005
- "iconPosition": _this6.$props.iconPosition,
22006
- "placeholder": _this6.$props.placeholder,
22007
- "autoFocus": _this6.$props.autoFocus,
22008
- "themePreset": _this6.themePreset,
21775
+ "id": _this7.$props.componentId + "-input",
21776
+ "showIcon": _this7.$props.showIcon,
21777
+ "showClear": _this7.$props.showClear,
21778
+ "iconPosition": _this7.$props.iconPosition,
21779
+ "placeholder": _this7.$props.placeholder,
21780
+ "autoFocus": _this7.$props.autoFocus,
21781
+ "themePreset": _this7.themePreset,
22009
21782
  "autocomplete": "off"
22010
21783
  },
22011
- "ref": _this6.$props.innerRef,
22012
- "class": getClassName$4(_this6.$props.innerClass, 'input'),
21784
+ "ref": _this7.$props.innerRef,
21785
+ "class": getClassName$4(_this7.$props.innerClass, 'input'),
22013
21786
  "on": _extends({}, getInputEvents({
22014
- onInput: _this6.onInputChange,
21787
+ onInput: _this7.onInputChange,
22015
21788
  onBlur: function onBlur(e) {
22016
- _this6.$emit('blur', e, _this6.triggerQuery);
21789
+ _this7.$emit('blur', e, _this7.triggerQuery);
22017
21790
  },
22018
- onFocus: _this6.handleFocus,
21791
+ onFocus: _this7.handleFocus,
22019
21792
  onKeyPress: function onKeyPress(e) {
22020
- _this6.$emit('keyPress', e, _this6.triggerQuery);
21793
+ _this7.$emit('keyPress', e, _this7.triggerQuery);
22021
21794
 
22022
- _this6.$emit('key-press', e, _this6.triggerQuery);
21795
+ _this7.$emit('key-press', e, _this7.triggerQuery);
22023
21796
  },
22024
21797
  onKeyDown: function onKeyDown(e) {
22025
- return _this6.handleKeyDown(e, highlightedIndex);
21798
+ return _this7.handleKeyDown(e, highlightedIndex);
22026
21799
  },
22027
21800
  onKeyUp: function onKeyUp(e) {
22028
- _this6.$emit('keyUp', e, _this6.triggerQuery);
21801
+ _this7.$emit('keyUp', e, _this7.triggerQuery);
22029
21802
 
22030
- _this6.$emit('key-up', e, _this6.triggerQuery);
21803
+ _this7.$emit('key-up', e, _this7.triggerQuery);
22031
21804
  },
22032
21805
  onClick: function onClick() {
22033
21806
  setHighlightedIndex(null);
22034
21807
  }
22035
21808
  })),
22036
21809
  "domProps": _extends({}, getInputProps({
22037
- value: _this6.$data.currentValue === null ? '' : _this6.$data.currentValue
21810
+ value: _this7.$data.currentValue === null ? '' : _this7.$data.currentValue
22038
21811
  }))
22039
- }), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
21812
+ }), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this7.renderInputAddonAfter(), _this7.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
22040
21813
  }
22041
21814
  }
22042
21815
  }) : h("div", {
@@ -22052,26 +21825,26 @@
22052
21825
  },
22053
21826
  "on": _extends({}, {
22054
21827
  blur: function blur(e) {
22055
- _this6.$emit('blur', e, _this6.triggerQuery);
21828
+ _this7.$emit('blur', e, _this7.triggerQuery);
22056
21829
  },
22057
21830
  keypress: function keypress(e) {
22058
- _this6.$emit('keyPress', e, _this6.triggerQuery);
21831
+ _this7.$emit('keyPress', e, _this7.triggerQuery);
22059
21832
 
22060
- _this6.$emit('key-press', e, _this6.triggerQuery);
21833
+ _this7.$emit('key-press', e, _this7.triggerQuery);
22061
21834
  },
22062
21835
  input: this.onInputChange,
22063
21836
  focus: function focus(e) {
22064
- _this6.$emit('focus', e, _this6.triggerQuery);
21837
+ _this7.$emit('focus', e, _this7.triggerQuery);
22065
21838
  },
22066
21839
  keydown: function keydown(e) {
22067
- _this6.$emit('keyDown', e, _this6.triggerQuery);
21840
+ _this7.$emit('keyDown', e, _this7.triggerQuery);
22068
21841
 
22069
- _this6.$emit('key-down', e, _this6.triggerQuery);
21842
+ _this7.$emit('key-down', e, _this7.triggerQuery);
22070
21843
  },
22071
21844
  keyup: function keyup(e) {
22072
- _this6.$emit('keyUp', e, _this6.triggerQuery);
21845
+ _this7.$emit('keyUp', e, _this7.triggerQuery);
22073
21846
 
22074
- _this6.$emit('key-up', e, _this6.triggerQuery);
21847
+ _this7.$emit('key-up', e, _this7.triggerQuery);
22075
21848
  }
22076
21849
  }),
22077
21850
  "domProps": _extends({}, {
@@ -22079,7 +21852,7 @@
22079
21852
  value: this.$data.currentValue ? this.$data.currentValue : ''
22080
21853
  }),
22081
21854
  "ref": this.$props.innerRef
22082
- }), this.renderIcons()]), this.renderInputAddonAfter()])])]);
21855
+ }), this.renderIcons()]), this.renderInputAddonAfter(), this.renderEnterButtonElement()])])]);
22083
21856
  },
22084
21857
  destroyed: function destroyed() {
22085
21858
  document.removeEventListener('keydown', this.onKeyDown);
@@ -22328,8 +22101,9 @@
22328
22101
  var getQueryOptions$1 = lib_8.getQueryOptions,
22329
22102
  checkValueChange$2 = lib_8.checkValueChange,
22330
22103
  getClassName$5 = lib_8.getClassName,
22331
- getOptionsFromQuery$2 = lib_8.getOptionsFromQuery,
22332
- isEqual$6 = lib_8.isEqual;
22104
+ isEqual$6 = lib_8.isEqual,
22105
+ extractQueryFromCustomQuery$2 = lib_8.extractQueryFromCustomQuery,
22106
+ getOptionsForCustomQuery$2 = lib_8.getOptionsForCustomQuery;
22333
22107
  var SingleList = {
22334
22108
  name: 'SingleList',
22335
22109
  props: {
@@ -22566,22 +22340,22 @@
22566
22340
  checkValueChange$2(props.componentId, value, props.beforeValueChange, performUpdate);
22567
22341
  },
22568
22342
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
22569
- var defaultQueryOptions;
22570
22343
  var query = SingleList.defaultQuery(value, props);
22571
22344
 
22572
22345
  if (this.defaultQuery) {
22573
22346
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
22347
+ var defaultQueryObj = extractQueryFromCustomQuery$2(defaultQueryToBeSet);
22574
22348
 
22575
- if (defaultQueryToBeSet.query) {
22576
- query = defaultQueryToBeSet.query;
22577
- }
22349
+ if (defaultQueryObj) {
22350
+ query = defaultQueryObj;
22351
+ } // Update calculated default query in store
22578
22352
 
22579
- defaultQueryOptions = getOptionsFromQuery$2(defaultQueryToBeSet); // Update calculated default query in store
22580
22353
 
22581
22354
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
22355
+ var defaultQueryOptions = getOptionsForCustomQuery$2(defaultQueryToBeSet);
22356
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
22582
22357
  }
22583
22358
 
22584
- this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
22585
22359
  this.updateQuery({
22586
22360
  componentId: this.internalComponent,
22587
22361
  query: query,
@@ -22592,17 +22366,15 @@
22592
22366
  updateQueryHandler: function updateQueryHandler(value, props) {
22593
22367
  var customQuery = props.customQuery;
22594
22368
  var query = SingleList.defaultQuery(value, props);
22595
- var customQueryOptions;
22596
22369
 
22597
22370
  if (customQuery) {
22598
- var _ref = customQuery(value, props) || {};
22599
-
22600
- query = _ref.query;
22601
- customQueryOptions = getOptionsFromQuery$2(customQuery(value, props));
22371
+ var customQueryCalc = customQuery(value, props);
22372
+ query = extractQueryFromCustomQuery$2(customQueryCalc);
22373
+ var customQueryOptions = getOptionsForCustomQuery$2(customQueryCalc);
22602
22374
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
22375
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
22603
22376
  }
22604
22377
 
22605
- this.setQueryOptions(props.componentId, customQueryOptions, false);
22606
22378
  this.updateQuery({
22607
22379
  componentId: props.componentId,
22608
22380
  query: query,
@@ -22622,7 +22394,7 @@
22622
22394
 
22623
22395
  if (props.defaultQuery) {
22624
22396
  var value = this.$data.currentValue;
22625
- var defaultQueryOptions = getOptionsFromQuery$2(props.defaultQuery(value, props));
22397
+ var defaultQueryOptions = getOptionsForCustomQuery$2(props.defaultQuery(value, props));
22626
22398
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
22627
22399
  } else {
22628
22400
  this.setQueryOptions(this.internalComponent, queryOptions);
@@ -22767,6 +22539,10 @@
22767
22539
  return query;
22768
22540
  };
22769
22541
 
22542
+ SingleList.hasInternalComponent = function () {
22543
+ return true;
22544
+ };
22545
+
22770
22546
  var mapStateToProps$5 = function mapStateToProps(state, props) {
22771
22547
  return {
22772
22548
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
@@ -22788,7 +22564,7 @@
22788
22564
  };
22789
22565
  var ListConnected = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
22790
22566
  componentType: constants_1$1.singleList,
22791
- internalComponent: true
22567
+ internalComponent: SingleList.hasInternalComponent()
22792
22568
  });
22793
22569
 
22794
22570
  SingleList.install = function (Vue) {
@@ -22806,7 +22582,8 @@
22806
22582
  getQueryOptions$2 = lib_8.getQueryOptions,
22807
22583
  checkValueChange$3 = lib_8.checkValueChange,
22808
22584
  getClassName$6 = lib_8.getClassName,
22809
- getOptionsFromQuery$3 = lib_8.getOptionsFromQuery;
22585
+ extractQueryFromCustomQuery$3 = lib_8.extractQueryFromCustomQuery,
22586
+ getOptionsForCustomQuery$3 = lib_8.getOptionsForCustomQuery;
22810
22587
  var MultiList = {
22811
22588
  name: 'MultiList',
22812
22589
  props: {
@@ -22833,7 +22610,7 @@
22833
22610
  showCount: VueTypes.bool.def(true),
22834
22611
  showFilter: VueTypes.bool.def(true),
22835
22612
  showSearch: VueTypes.bool.def(true),
22836
- size: VueTypes.number.def(100),
22613
+ size: VueTypes.number,
22837
22614
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
22838
22615
  title: types.title,
22839
22616
  URLParams: VueTypes.bool.def(false),
@@ -23120,22 +22897,22 @@
23120
22897
  checkValueChange$3(props.componentId, finalValues, props.beforeValueChange, performUpdate);
23121
22898
  },
23122
22899
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
23123
- var defaultQueryOptions;
23124
22900
  var query = MultiList.defaultQuery(value, props);
23125
22901
 
23126
22902
  if (this.defaultQuery) {
23127
22903
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
22904
+ var defaultQueryObj = extractQueryFromCustomQuery$3(defaultQueryToBeSet);
23128
22905
 
23129
- if (defaultQueryToBeSet.query) {
23130
- query = defaultQueryToBeSet.query;
23131
- }
22906
+ if (defaultQueryObj) {
22907
+ query = defaultQueryObj;
22908
+ } // Update calculated default query in store
23132
22909
 
23133
- defaultQueryOptions = getOptionsFromQuery$3(defaultQueryToBeSet); // Update calculated default query in store
23134
22910
 
23135
22911
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
22912
+ var defaultQueryOptions = getOptionsForCustomQuery$3(defaultQueryToBeSet);
22913
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
23136
22914
  }
23137
22915
 
23138
- this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
23139
22916
  this.updateQuery({
23140
22917
  componentId: this.internalComponent,
23141
22918
  query: query,
@@ -23146,17 +22923,15 @@
23146
22923
  updateQueryHandler: function updateQueryHandler(value, props) {
23147
22924
  var customQuery = props.customQuery;
23148
22925
  var query = MultiList.defaultQuery(value, props);
23149
- var customQueryOptions;
23150
22926
 
23151
22927
  if (customQuery) {
23152
- var _ref = customQuery(value, props) || {};
23153
-
23154
- query = _ref.query;
23155
- customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
22928
+ var customQueryCalc = customQuery(value, props);
22929
+ query = extractQueryFromCustomQuery$3(customQueryCalc);
23156
22930
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
22931
+ var customQueryOptions = getOptionsForCustomQuery$3(customQueryCalc);
22932
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
23157
22933
  }
23158
22934
 
23159
- this.setQueryOptions(props.componentId, customQueryOptions, false);
23160
22935
  this.updateQuery({
23161
22936
  componentId: props.componentId,
23162
22937
  query: query,
@@ -23176,7 +22951,7 @@
23176
22951
 
23177
22952
  if (props.defaultQuery) {
23178
22953
  var value = Object.keys(this.$data.currentValue);
23179
- var defaultQueryOptions = getOptionsFromQuery$3(props.defaultQuery(value, props));
22954
+ var defaultQueryOptions = getOptionsForCustomQuery$3(props.defaultQuery(value, props));
23180
22955
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
23181
22956
  } else {
23182
22957
  this.setQueryOptions(this.internalComponent, queryOptions);
@@ -23262,7 +23037,13 @@
23262
23037
 
23263
23038
  MultiList.defaultQuery = function (value, props) {
23264
23039
  var query = null;
23265
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
23040
+ var queryFormat = props.queryFormat;
23041
+
23042
+ if (queryFormat === undefined) {
23043
+ queryFormat = 'or';
23044
+ }
23045
+
23046
+ var type = queryFormat === 'or' ? 'terms' : 'term';
23266
23047
 
23267
23048
  if (!Array.isArray(value) || value.length === 0) {
23268
23049
  return null;
@@ -23283,14 +23064,14 @@
23283
23064
  } else if (value) {
23284
23065
  var listQuery;
23285
23066
 
23286
- if (props.queryFormat === 'or') {
23067
+ if (queryFormat === 'or') {
23287
23068
  if (props.showMissing) {
23288
- var _type, _ref2;
23069
+ var _type, _ref;
23289
23070
 
23290
23071
  var hasMissingTerm = value.includes(props.missingLabel);
23291
- var should = [(_ref2 = {}, _ref2[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
23072
+ var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
23292
23073
  return item !== props.missingLabel;
23293
- }), _type), _ref2)];
23074
+ }), _type), _ref)];
23294
23075
 
23295
23076
  if (hasMissingTerm) {
23296
23077
  should = should.concat({
@@ -23317,9 +23098,9 @@
23317
23098
  } else {
23318
23099
  // adds a sub-query with must as an array of objects for each term/value
23319
23100
  var queryArray = value.map(function (item) {
23320
- var _type3, _ref3;
23101
+ var _type3, _ref2;
23321
23102
 
23322
- return _ref3 = {}, _ref3[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref3;
23103
+ return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
23323
23104
  });
23324
23105
  listQuery = {
23325
23106
  bool: {
@@ -23369,9 +23150,14 @@
23369
23150
  setCustomQuery: setCustomQuery$3,
23370
23151
  setDefaultQuery: setDefaultQuery$4
23371
23152
  };
23153
+
23154
+ MultiList.hasInternalComponent = function () {
23155
+ return true;
23156
+ };
23157
+
23372
23158
  var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
23373
23159
  componentType: constants_1$1.multiList,
23374
- internalComponent: true
23160
+ internalComponent: MultiList.hasInternalComponent()
23375
23161
  });
23376
23162
 
23377
23163
  MultiList.install = function (Vue) {
@@ -23698,9 +23484,10 @@
23698
23484
  checkValueChange$4 = lib_8.checkValueChange,
23699
23485
  checkPropChange$1 = lib_8.checkPropChange,
23700
23486
  getClassName$8 = lib_8.getClassName,
23701
- getOptionsFromQuery$4 = lib_8.getOptionsFromQuery,
23702
23487
  isEqual$8 = lib_8.isEqual,
23703
- getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery;
23488
+ getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery,
23489
+ extractQueryFromCustomQuery$4 = lib_8.extractQueryFromCustomQuery,
23490
+ getOptionsForCustomQuery$4 = lib_8.getOptionsForCustomQuery;
23704
23491
  var SingleDropdownList = {
23705
23492
  name: 'SingleDropdownList',
23706
23493
  data: function data() {
@@ -23737,7 +23524,7 @@
23737
23524
  selectAllLabel: types.string,
23738
23525
  showCount: VueTypes.bool.def(true),
23739
23526
  showFilter: VueTypes.bool.def(true),
23740
- size: VueTypes.number.def(100),
23527
+ size: VueTypes.number,
23741
23528
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
23742
23529
  title: types.title,
23743
23530
  URLParams: VueTypes.bool.def(false),
@@ -23949,22 +23736,22 @@
23949
23736
  }
23950
23737
  },
23951
23738
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
23952
- var defaultQueryOptions;
23953
23739
  var query = SingleDropdownList.defaultQuery(value, props);
23954
23740
 
23955
23741
  if (this.defaultQuery) {
23956
23742
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
23743
+ var defaultQueryObj = extractQueryFromCustomQuery$4(defaultQueryToBeSet);
23957
23744
 
23958
- if (defaultQueryToBeSet.query) {
23959
- query = defaultQueryToBeSet.query;
23960
- }
23745
+ if (defaultQueryObj) {
23746
+ query = defaultQueryObj;
23747
+ } // Update calculated default query in store
23961
23748
 
23962
- defaultQueryOptions = getOptionsFromQuery$4(defaultQueryToBeSet); // Update calculated default query in store
23963
23749
 
23964
23750
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
23751
+ var defaultQueryOptions = getOptionsForCustomQuery$4(defaultQueryToBeSet);
23752
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
23965
23753
  }
23966
23754
 
23967
- this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
23968
23755
  this.updateQuery({
23969
23756
  componentId: this.internalComponent,
23970
23757
  query: query,
@@ -23975,17 +23762,15 @@
23975
23762
  updateQueryHandler: function updateQueryHandler(value, props) {
23976
23763
  var customQuery = props.customQuery;
23977
23764
  var query = SingleDropdownList.defaultQuery(value, props);
23978
- var customQueryOptions;
23979
23765
 
23980
23766
  if (customQuery) {
23981
- var _ref = customQuery(value, props) || {};
23982
-
23983
- query = _ref.query;
23984
- customQueryOptions = getOptionsFromQuery$4(customQuery(value, props));
23767
+ var customQueryCalc = customQuery(value, props);
23768
+ query = extractQueryFromCustomQuery$4(customQueryCalc);
23985
23769
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
23770
+ var customQueryOptions = getOptionsForCustomQuery$4(customQueryCalc);
23771
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
23986
23772
  }
23987
23773
 
23988
- this.setQueryOptions(props.componentId, customQueryOptions, false);
23989
23774
  this.updateQuery({
23990
23775
  componentId: props.componentId,
23991
23776
  query: query,
@@ -24019,7 +23804,7 @@
24019
23804
 
24020
23805
  if (props.defaultQuery) {
24021
23806
  var value = this.$data.currentValue;
24022
- var defaultQueryOptions = getOptionsFromQuery$4(props.defaultQuery(value, props));
23807
+ var defaultQueryOptions = getOptionsForCustomQuery$4(props.defaultQuery(value, props));
24023
23808
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
24024
23809
  } else {
24025
23810
  this.setQueryOptions(this.internalComponent, queryOptions);
@@ -24111,6 +23896,10 @@
24111
23896
  }) : getAggsQuery(queryOptions, props);
24112
23897
  };
24113
23898
 
23899
+ SingleDropdownList.hasInternalComponent = function () {
23900
+ return true;
23901
+ };
23902
+
24114
23903
  var mapStateToProps$7 = function mapStateToProps(state, props) {
24115
23904
  return {
24116
23905
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
@@ -24132,7 +23921,7 @@
24132
23921
  };
24133
23922
  var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
24134
23923
  componentType: constants_1$1.singleDropdownList,
24135
- internalComponent: true
23924
+ internalComponent: SingleDropdownList.hasInternalComponent()
24136
23925
  });
24137
23926
 
24138
23927
  SingleDropdownList.install = function (Vue) {
@@ -24151,8 +23940,9 @@
24151
23940
  checkValueChange$5 = lib_8.checkValueChange,
24152
23941
  checkPropChange$2 = lib_8.checkPropChange,
24153
23942
  getClassName$9 = lib_8.getClassName,
24154
- getOptionsFromQuery$5 = lib_8.getOptionsFromQuery,
24155
- getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery;
23943
+ getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery,
23944
+ extractQueryFromCustomQuery$5 = lib_8.extractQueryFromCustomQuery,
23945
+ getOptionsForCustomQuery$5 = lib_8.getOptionsForCustomQuery;
24156
23946
  var MultiDropdownList = {
24157
23947
  name: 'MultiDropdownList',
24158
23948
  data: function data() {
@@ -24190,7 +23980,7 @@
24190
23980
  selectAllLabel: types.string,
24191
23981
  showCount: VueTypes.bool.def(true),
24192
23982
  showFilter: VueTypes.bool.def(true),
24193
- size: VueTypes.number.def(100),
23983
+ size: VueTypes.number,
24194
23984
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
24195
23985
  title: types.title,
24196
23986
  URLParams: VueTypes.bool.def(false),
@@ -24476,22 +24266,22 @@
24476
24266
  checkValueChange$5(props.componentId, finalValues, props.beforeValueChange, performUpdate);
24477
24267
  },
24478
24268
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
24479
- var defaultQueryOptions;
24480
24269
  var query = MultiDropdownList.defaultQuery(value, props);
24481
24270
 
24482
24271
  if (this.defaultQuery) {
24483
24272
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
24273
+ var defaultQueryObj = extractQueryFromCustomQuery$5(defaultQueryToBeSet);
24484
24274
 
24485
- if (defaultQueryToBeSet.query) {
24486
- query = defaultQueryToBeSet.query;
24487
- }
24275
+ if (defaultQueryObj) {
24276
+ query = defaultQueryObj;
24277
+ } // Update calculated default query in store
24488
24278
 
24489
- defaultQueryOptions = getOptionsFromQuery$5(defaultQueryToBeSet); // Update calculated default query in store
24490
24279
 
24491
24280
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
24281
+ var defaultQueryOptions = getOptionsForCustomQuery$5(defaultQueryToBeSet);
24282
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
24492
24283
  }
24493
24284
 
24494
- this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
24495
24285
  this.updateQuery({
24496
24286
  componentId: this.internalComponent,
24497
24287
  query: query,
@@ -24502,17 +24292,15 @@
24502
24292
  updateQueryHandler: function updateQueryHandler(value, props) {
24503
24293
  var customQuery = props.customQuery;
24504
24294
  var query = MultiDropdownList.defaultQuery(value, props);
24505
- var customQueryOptions;
24506
24295
 
24507
24296
  if (customQuery) {
24508
- var _ref = customQuery(value, props) || {};
24509
-
24510
- query = _ref.query;
24511
- customQueryOptions = getOptionsFromQuery$5(customQuery(value, props));
24297
+ var customQueryCalc = customQuery(value, props);
24298
+ query = extractQueryFromCustomQuery$5(customQueryCalc);
24512
24299
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
24300
+ var customQueryOptions = getOptionsForCustomQuery$5(customQueryCalc);
24301
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
24513
24302
  }
24514
24303
 
24515
- this.setQueryOptions(props.componentId, customQueryOptions, false);
24516
24304
  this.updateQuery({
24517
24305
  componentId: props.componentId,
24518
24306
  query: query,
@@ -24546,7 +24334,7 @@
24546
24334
 
24547
24335
  if (props.defaultQuery) {
24548
24336
  var value = Object.keys(this.$data.currentValue);
24549
- var defaultQueryOptions = getOptionsFromQuery$5(props.defaultQuery(value, props));
24337
+ var defaultQueryOptions = getOptionsForCustomQuery$5(props.defaultQuery(value, props));
24550
24338
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
24551
24339
  } else {
24552
24340
  this.setQueryOptions(this.internalComponent, queryOptions);
@@ -24582,7 +24370,13 @@
24582
24370
 
24583
24371
  MultiDropdownList.defaultQuery = function (value, props) {
24584
24372
  var query = null;
24585
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
24373
+ var queryFormat = props.queryFormat;
24374
+
24375
+ if (queryFormat === undefined) {
24376
+ queryFormat = 'or';
24377
+ }
24378
+
24379
+ var type = queryFormat === 'or' ? 'terms' : 'term';
24586
24380
 
24587
24381
  if (!Array.isArray(value) || value.length === 0) {
24588
24382
  return null;
@@ -24603,14 +24397,14 @@
24603
24397
  } else if (value) {
24604
24398
  var listQuery;
24605
24399
 
24606
- if (props.queryFormat === 'or') {
24400
+ if (queryFormat === 'or') {
24607
24401
  if (props.showMissing) {
24608
- var _type, _ref2;
24402
+ var _type, _ref;
24609
24403
 
24610
24404
  var hasMissingTerm = value.includes(props.missingLabel);
24611
- var should = [(_ref2 = {}, _ref2[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
24405
+ var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
24612
24406
  return item !== props.missingLabel;
24613
- }), _type), _ref2)];
24407
+ }), _type), _ref)];
24614
24408
 
24615
24409
  if (hasMissingTerm) {
24616
24410
  should = should.concat({
@@ -24637,9 +24431,9 @@
24637
24431
  } else {
24638
24432
  // adds a sub-query with must as an array of objects for each term/value
24639
24433
  var queryArray = value.map(function (item) {
24640
- var _type3, _ref3;
24434
+ var _type3, _ref2;
24641
24435
 
24642
- return _ref3 = {}, _ref3[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref3;
24436
+ return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
24643
24437
  });
24644
24438
  listQuery = {
24645
24439
  bool: {
@@ -24674,6 +24468,10 @@
24674
24468
  }) : getAggsQuery(queryOptions, props);
24675
24469
  };
24676
24470
 
24471
+ MultiDropdownList.hasInternalComponent = function () {
24472
+ return true;
24473
+ };
24474
+
24677
24475
  var mapStateToProps$8 = function mapStateToProps(state, props) {
24678
24476
  return {
24679
24477
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
@@ -24695,7 +24493,7 @@
24695
24493
  };
24696
24494
  var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
24697
24495
  componentType: constants_1$1.multiDropdownList,
24698
- internalComponent: true
24496
+ internalComponent: MultiDropdownList.hasInternalComponent()
24699
24497
  });
24700
24498
 
24701
24499
  MultiDropdownList.install = function (Vue) {
@@ -24711,7 +24509,7 @@
24711
24509
  var isEqual$a = lib_8.isEqual,
24712
24510
  checkValueChange$6 = lib_8.checkValueChange,
24713
24511
  getClassName$a = lib_8.getClassName,
24714
- getOptionsFromQuery$6 = lib_8.getOptionsFromQuery,
24512
+ getOptionsFromQuery = lib_8.getOptionsFromQuery,
24715
24513
  handleA11yAction$1 = lib_8.handleA11yAction;
24716
24514
  var ToggleButton = {
24717
24515
  name: 'ToggleButton',
@@ -24877,7 +24675,7 @@
24877
24675
  var _ref = customQuery(value, props) || {};
24878
24676
 
24879
24677
  query = _ref.query;
24880
- this.setQueryOptions(props.componentId, getOptionsFromQuery$6(customQuery(value, props)), false);
24678
+ this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)), false);
24881
24679
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
24882
24680
  }
24883
24681
 
@@ -25035,10 +24833,7 @@
25035
24833
 
25036
24834
  ToggleButton.componentType = constants_1$1.toggleButton;
25037
24835
 
25038
- var _excluded = ["options"],
25039
- _excluded2 = ["query"],
25040
- _excluded3 = ["query"],
25041
- _excluded4 = ["query"];
24836
+ var _excluded = ["options"];
25042
24837
  var updateQuery$8 = lib_5.updateQuery,
25043
24838
  setQueryOptions$7 = lib_5.setQueryOptions,
25044
24839
  setCustomQuery$7 = lib_5.setCustomQuery,
@@ -25046,15 +24841,16 @@
25046
24841
  var parseHits$1 = lib_8.parseHits,
25047
24842
  isEqual$b = lib_8.isEqual,
25048
24843
  getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
25049
- getOptionsFromQuery$7 = lib_8.getOptionsFromQuery,
25050
- getResultStats$3 = lib_8.getResultStats;
24844
+ getResultStats$3 = lib_8.getResultStats,
24845
+ extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
24846
+ getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
25051
24847
  var ReactiveComponent = {
25052
24848
  name: 'ReactiveComponent',
25053
24849
  props: {
25054
24850
  componentId: types.stringRequired,
25055
24851
  aggregationField: types.string,
25056
24852
  aggregationSize: VueTypes.number,
25057
- size: VueTypes.number.def(20),
24853
+ size: VueTypes.number,
25058
24854
  defaultQuery: types.func,
25059
24855
  customQuery: types.func,
25060
24856
  filterLabel: types.string,
@@ -25096,25 +24892,16 @@
25096
24892
 
25097
24893
  if (customQuery) {
25098
24894
  var calcCustomQuery = customQuery(this.selectedValue, props);
25099
-
25100
- var _ref = calcCustomQuery || {},
25101
- query = _ref.query;
25102
-
25103
- var customQueryOptions = calcCustomQuery ? getOptionsFromQuery$7(calcCustomQuery) : null;
24895
+ var query = extractQueryFromCustomQuery$6(calcCustomQuery);
24896
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
25104
24897
 
25105
24898
  if (customQueryOptions) {
25106
24899
  this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
25107
24900
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
25108
24901
 
25109
- var queryToSet = query || null;
25110
-
25111
- if (calcCustomQuery && calcCustomQuery.id) {
25112
- queryToSet = calcCustomQuery;
25113
- }
25114
-
25115
24902
  this.updateQuery({
25116
24903
  componentId: componentId,
25117
- query: queryToSet,
24904
+ query: query,
25118
24905
  value: this.selectedValue || null,
25119
24906
  label: filterLabel,
25120
24907
  showFilter: showFilter,
@@ -25122,36 +24909,35 @@
25122
24909
  });
25123
24910
  }
25124
24911
 
25125
- this.setQuery = function (_ref2) {
25126
- var options = _ref2.options,
25127
- obj = _objectWithoutPropertiesLoose(_ref2, _excluded);
24912
+ this.setQuery = function (_ref) {
24913
+ var options = _ref.options,
24914
+ obj = _objectWithoutPropertiesLoose(_ref, _excluded);
25128
24915
 
25129
- if (options) {
25130
- _this.setQueryOptions(props.componentId, _extends({}, options, _this.getAggsQuery()), false);
24916
+ var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
24917
+
24918
+ if (queryToBeSet && queryToBeSet.query) {
24919
+ queryToBeSet = queryToBeSet.query;
25131
24920
  }
25132
24921
 
25133
- var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
24922
+ var customQueryCalc = _extends({}, options, {
24923
+ query: queryToBeSet
24924
+ });
25134
24925
 
25135
- if (obj && obj.query && obj.query.query) {
25136
- queryToBeSet = obj.query.query;
25137
- } // Update customQuery field for RS API
24926
+ var rsAPIQuery = customQueryCalc; // handle stored queries
25138
24927
 
24928
+ if (queryToBeSet && queryToBeSet.id) {
24929
+ rsAPIQuery = queryToBeSet;
24930
+ } // Update customQuery field for RS API
25139
24931
 
25140
- if (obj && obj.query || options) {
25141
- var customQueryCalc = _extends({}, options);
25142
24932
 
25143
- if (obj && obj.query) {
25144
- if (obj.query.id) {
25145
- customQueryCalc = queryToBeSet;
25146
- } else {
25147
- customQueryCalc.query = obj.query;
25148
- }
25149
- }
24933
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
25150
24934
 
25151
- _this.setCustomQuery(props.componentId, customQueryCalc);
24935
+ if (options) {
24936
+ _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
25152
24937
  }
25153
24938
 
25154
24939
  _this.updateQuery(_extends({}, obj, {
24940
+ query: customQueryCalc.query,
25155
24941
  componentId: props.componentId,
25156
24942
  label: props.filterLabel,
25157
24943
  showFilter: props.showFilter,
@@ -25162,29 +24948,22 @@
25162
24948
  if (props.defaultQuery) {
25163
24949
  this.internalComponent = props.componentId + "__internal";
25164
24950
  }
25165
- },
25166
- beforeMount: function beforeMount() {
24951
+
25167
24952
  if (this.internalComponent && this.$props.defaultQuery) {
25168
24953
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
25169
24954
  this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
25170
24955
 
25171
- var _ref3 = this.$defaultQuery || {},
25172
- query = _ref3.query,
25173
- queryOptions = _objectWithoutPropertiesLoose(_ref3, _excluded2);
24956
+ var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
24957
+
24958
+ var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
25174
24959
 
25175
24960
  if (queryOptions) {
25176
24961
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
25177
24962
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
25178
24963
 
25179
- var queryToSet = query || null;
25180
-
25181
- if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
25182
- queryToSet = this.$defaultQuery;
25183
- }
25184
-
25185
24964
  this.updateQuery({
25186
24965
  componentId: this.internalComponent,
25187
- query: queryToSet
24966
+ query: _query
25188
24967
  });
25189
24968
  }
25190
24969
  },
@@ -25232,10 +25011,8 @@
25232
25011
  defaultQuery: function defaultQuery(newVal, oldVal) {
25233
25012
  if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
25234
25013
  this.$defaultQuery = newVal(this.selectedValue, this.$props);
25235
-
25236
- var _ref4 = this.$defaultQuery || {},
25237
- query = _ref4.query,
25238
- queryOptions = _objectWithoutPropertiesLoose(_ref4, _excluded3);
25014
+ var query = extractQueryFromCustomQuery$6(this.$defaultQuery);
25015
+ var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
25239
25016
 
25240
25017
  if (queryOptions) {
25241
25018
  this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
@@ -25243,15 +25020,9 @@
25243
25020
 
25244
25021
 
25245
25022
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
25246
- var queryToSet = query || null;
25247
-
25248
- if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
25249
- queryToSet = this.$defaultQuery;
25250
- }
25251
-
25252
25023
  this.updateQuery({
25253
25024
  componentId: this.internalComponent,
25254
- query: queryToSet
25025
+ query: query
25255
25026
  });
25256
25027
  }
25257
25028
  },
@@ -25259,10 +25030,8 @@
25259
25030
  if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
25260
25031
  var componentId = this.$props.componentId;
25261
25032
  this.$customQuery = newVal(this.selectedValue, this.$props);
25262
-
25263
- var _ref5 = this.$customQuery || {},
25264
- query = _ref5.query,
25265
- queryOptions = _objectWithoutPropertiesLoose(_ref5, _excluded4);
25033
+ var query = extractQueryFromCustomQuery$6(this.$customQuery);
25034
+ var queryOptions = getOptionsForCustomQuery$6(this.$customQuery);
25266
25035
 
25267
25036
  if (queryOptions) {
25268
25037
  this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
@@ -25270,15 +25039,9 @@
25270
25039
 
25271
25040
 
25272
25041
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
25273
- var queryToSet = query || null;
25274
-
25275
- if (this.$customQuery && this.$customQuery.id) {
25276
- queryToSet = this.$customQuery;
25277
- }
25278
-
25279
25042
  this.updateQuery({
25280
25043
  componentId: componentId,
25281
- query: queryToSet
25044
+ query: query
25282
25045
  });
25283
25046
  }
25284
25047
  }
@@ -25358,6 +25121,10 @@
25358
25121
  }
25359
25122
  };
25360
25123
 
25124
+ ReactiveComponent.hasInternalComponent = function (props) {
25125
+ return !!props.defaultQuery;
25126
+ };
25127
+
25361
25128
  var mapStateToProps$a = function mapStateToProps(state, props) {
25362
25129
  return {
25363
25130
  aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
@@ -25407,6 +25174,7 @@
25407
25174
  showClearAll: VueTypes.bool.def(true),
25408
25175
  title: types.title,
25409
25176
  resetToDefault: VueTypes.bool.def(false),
25177
+ clearAllBlacklistComponents: VueTypes.array,
25410
25178
  resetToValues: VueTypes.object
25411
25179
  },
25412
25180
  inject: {
@@ -25461,12 +25229,13 @@
25461
25229
  },
25462
25230
  clearValues: function clearValues() {
25463
25231
  var resetToDefault = this.resetToDefault,
25464
- resetToValues = this.resetToValues;
25232
+ resetToValues = this.resetToValues,
25233
+ clearAllBlacklistComponents = this.clearAllBlacklistComponents;
25465
25234
 
25466
25235
  if (resetToDefault) {
25467
- this.resetValuesToDefault();
25236
+ this.resetValuesToDefault(clearAllBlacklistComponents);
25468
25237
  } else {
25469
- this.clearValuesAction(resetToValues);
25238
+ this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
25470
25239
  }
25471
25240
 
25472
25241
  this.$emit('clear', resetToValues);
@@ -25564,7 +25333,7 @@
25564
25333
  var isEqual$c = lib_8.isEqual,
25565
25334
  checkValueChange$7 = lib_8.checkValueChange,
25566
25335
  getClassName$c = lib_8.getClassName,
25567
- getOptionsFromQuery$8 = lib_8.getOptionsFromQuery;
25336
+ getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
25568
25337
  var SingleRange = {
25569
25338
  name: 'SingleRange',
25570
25339
  data: function data() {
@@ -25694,17 +25463,16 @@
25694
25463
  updateQueryHandler: function updateQueryHandler(value, props) {
25695
25464
  var customQuery = props.customQuery;
25696
25465
  var query = SingleRange.defaultQuery(value, props);
25697
- var customQueryOptions;
25698
25466
 
25699
25467
  if (customQuery) {
25700
25468
  var _ref = customQuery(value, props) || {};
25701
25469
 
25702
25470
  query = _ref.query;
25703
- customQueryOptions = getOptionsFromQuery$8(customQuery(value, props));
25471
+ var customQueryOptions = getOptionsFromQuery$1(customQuery(value, props));
25704
25472
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
25473
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
25705
25474
  }
25706
25475
 
25707
- this.setQueryOptions(props.componentId, customQueryOptions, false);
25708
25476
  this.updateQuery({
25709
25477
  componentId: props.componentId,
25710
25478
  query: query,
@@ -25792,7 +25560,7 @@
25792
25560
  var isEqual$d = lib_8.isEqual,
25793
25561
  checkValueChange$8 = lib_8.checkValueChange,
25794
25562
  getClassName$d = lib_8.getClassName,
25795
- getOptionsFromQuery$9 = lib_8.getOptionsFromQuery;
25563
+ getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
25796
25564
  var MultiRange = {
25797
25565
  name: 'MultiRange',
25798
25566
  data: function data() {
@@ -25903,17 +25671,16 @@
25903
25671
  updateQueryHandler: function updateQueryHandler(value, props) {
25904
25672
  var customQuery = props.customQuery;
25905
25673
  var query = MultiRange.defaultQuery(value, props);
25906
- var customQueryOptions;
25907
25674
 
25908
25675
  if (customQuery) {
25909
25676
  var _ref = customQuery(value, props) || {};
25910
25677
 
25911
25678
  query = _ref.query;
25912
- customQueryOptions = getOptionsFromQuery$9(customQuery(value, props));
25679
+ var customQueryOptions = getOptionsFromQuery$2(customQuery(value, props));
25913
25680
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
25681
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
25914
25682
  }
25915
25683
 
25916
- this.setQueryOptions(props.componentId, customQueryOptions, false);
25917
25684
  this.updateQuery({
25918
25685
  componentId: props.componentId,
25919
25686
  query: query,
@@ -26404,7 +26171,7 @@
26404
26171
  setCustomQuery$a = lib_5.setCustomQuery;
26405
26172
  var checkValueChange$9 = lib_8.checkValueChange,
26406
26173
  getClassName$e = lib_8.getClassName,
26407
- getOptionsFromQuery$a = lib_8.getOptionsFromQuery,
26174
+ getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
26408
26175
  isEqual$e = lib_8.isEqual;
26409
26176
  var RangeSlider = {
26410
26177
  name: 'RangeSlider',
@@ -26494,14 +26261,14 @@
26494
26261
  updateQueryHandler: function updateQueryHandler(value, props) {
26495
26262
  var customQuery = props.customQuery;
26496
26263
  var query = RangeSlider.defaultQuery(value, props);
26497
- var customQueryOptions;
26498
26264
 
26499
26265
  if (customQuery) {
26500
26266
  var _ref = customQuery(value, props) || {};
26501
26267
 
26502
26268
  query = _ref.query;
26503
- customQueryOptions = getOptionsFromQuery$a(customQuery(value, props));
26269
+ var customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
26504
26270
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
26271
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
26505
26272
  }
26506
26273
 
26507
26274
  var showFilter = props.showFilter,
@@ -26512,7 +26279,6 @@
26512
26279
  currentEnd = value[1]; // check if the slider is at its initial position
26513
26280
 
26514
26281
  var isInitialValue = currentStart === start && currentEnd === end;
26515
- this.setQueryOptions(props.componentId, customQueryOptions, false);
26516
26282
  this.updateQuery({
26517
26283
  componentId: props.componentId,
26518
26284
  query: query,
@@ -26686,9 +26452,10 @@
26686
26452
  updateComponentProps$2 = lib_5.updateComponentProps;
26687
26453
  var checkValueChange$a = lib_8.checkValueChange,
26688
26454
  getClassName$f = lib_8.getClassName,
26689
- getOptionsFromQuery$b = lib_8.getOptionsFromQuery,
26690
26455
  isEqual$f = lib_8.isEqual,
26691
- checkSomePropChange$1 = lib_8.checkSomePropChange;
26456
+ checkSomePropChange$1 = lib_8.checkSomePropChange,
26457
+ extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
26458
+ getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
26692
26459
  var DynamicRangeSlider = {
26693
26460
  name: 'DynamicRangeSlider',
26694
26461
  components: getComponents(),
@@ -26896,28 +26663,31 @@
26896
26663
  },
26897
26664
  updateQueryHandler: function updateQueryHandler(value) {
26898
26665
  var query = DynamicRangeSlider.defaultQuery(value, this.$props);
26899
- var customQueryOptions;
26900
26666
 
26901
26667
  if (this.$props.customQuery) {
26902
- var _ref2 = this.$props.customQuery(value, this.$props) || {};
26668
+ var customQueryTobeSet = this.$props.customQuery(value, this.$props);
26669
+ var queryTobeSet = extractQueryFromCustomQuery$7(customQueryTobeSet);
26670
+
26671
+ if (queryTobeSet) {
26672
+ query = queryTobeSet;
26673
+ }
26903
26674
 
26904
- query = _ref2.query;
26905
- customQueryOptions = getOptionsFromQuery$b(this.$props.customQuery(value, this.$props));
26675
+ var customQueryOptions = getOptionsForCustomQuery$7(customQueryTobeSet);
26906
26676
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
26677
+ this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
26907
26678
  }
26908
26679
 
26909
- var _ref3 = this.range || {
26680
+ var _ref2 = this.range || {
26910
26681
  start: value[0],
26911
26682
  end: value[1]
26912
26683
  },
26913
- start = _ref3.start,
26914
- end = _ref3.end;
26684
+ start = _ref2.start,
26685
+ end = _ref2.end;
26915
26686
 
26916
26687
  var currentStart = value[0],
26917
26688
  currentEnd = value[1]; // check if the slider is at its initial position
26918
26689
 
26919
26690
  var isInitialValue = currentStart === start && currentEnd === end;
26920
- this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
26921
26691
  this.updateQuery({
26922
26692
  componentId: this.$props.componentId,
26923
26693
  query: query,
@@ -26964,13 +26734,13 @@
26964
26734
  range: function range(newValue, oldValue) {
26965
26735
  if (isEqual$f(newValue, oldValue) || !this.currentValue) return;
26966
26736
 
26967
- var _ref4 = this.currentValue || [],
26968
- currentStart = _ref4[0],
26969
- currentEnd = _ref4[1];
26737
+ var _ref3 = this.currentValue || [],
26738
+ currentStart = _ref3[0],
26739
+ currentEnd = _ref3[1];
26970
26740
 
26971
- var _ref5 = oldValue || {},
26972
- oldStart = _ref5.start,
26973
- oldEnd = _ref5.end;
26741
+ var _ref4 = oldValue || {},
26742
+ oldStart = _ref4.start,
26743
+ oldEnd = _ref4.end;
26974
26744
 
26975
26745
  var newStart = currentStart === oldStart ? newValue.start : currentStart;
26976
26746
  var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
@@ -27065,6 +26835,10 @@
27065
26835
  return [];
27066
26836
  };
27067
26837
 
26838
+ DynamicRangeSlider.hasInternalComponent = function () {
26839
+ return true;
26840
+ };
26841
+
27068
26842
  var mapStateToProps$f = function mapStateToProps(state, props) {
27069
26843
  var componentId = state.aggregations[props.componentId];
27070
26844
  var internalRange = state.aggregations[props.componentId + "__range__internal"];
@@ -27290,10 +27064,10 @@
27290
27064
  Vue.component(StateProvider.name, StateProviderConnected);
27291
27065
  };
27292
27066
 
27293
- var _excluded$5 = ["aggs", "size"];
27067
+ var _excluded$5 = ["aggs", "size"],
27068
+ _excluded2 = ["query"],
27069
+ _excluded3 = ["query"];
27294
27070
  var X_SEARCH_CLIENT$1 = 'ReactiveSearch Vue';
27295
- var componentsWithHighlightQuery = [constants_1$1.dataSearch, constants_1$1.categorySearch];
27296
- var componentsWithOptions = [constants_1$1.reactiveList, constants_1$1.reactiveMap, constants_1$1.singleList, constants_1$1.multiList, constants_1$1.tagCloud].concat(componentsWithHighlightQuery);
27297
27071
  var componentsWithoutFilters = [constants_1$1.numberBox, constants_1$1.ratingsFilter];
27298
27072
  var resultComponents = [constants_1$1.reactiveList, constants_1$1.reactiveMap];
27299
27073
 
@@ -27327,23 +27101,40 @@
27327
27101
  }
27328
27102
 
27329
27103
  return value;
27330
- }
27104
+ } // Returns query DSL with query property and other options
27105
+
27331
27106
 
27332
- function getQuery(component, value, componentType) {
27333
- // get default query of result components
27334
- if (resultComponents.includes(componentType)) {
27335
- return component.defaultQuery ? component.defaultQuery() : {};
27336
- } // get custom or default query of sensor components
27107
+ function getDefaultQuery(component, value) {
27108
+ // get custom or default query of sensor components
27109
+ var currentValue = parseValue(value, component); // get default query of result components
27110
+
27111
+ if (component.defaultQuery) {
27112
+ var defaultQuery = component.defaultQuery(currentValue, component);
27113
+ return _extends({
27114
+ query: helper_14(defaultQuery)
27115
+ }, helper_15(defaultQuery));
27116
+ }
27117
+
27118
+ return component.source.defaultQuery ? {
27119
+ query: component.source.defaultQuery(currentValue, component)
27120
+ } : {};
27121
+ } // Only results the query part
27337
27122
 
27338
27123
 
27124
+ function getCustomQuery(component, value) {
27125
+ // get custom or default query of sensor components
27339
27126
  var currentValue = parseValue(value, component);
27340
27127
 
27341
27128
  if (component.customQuery) {
27342
27129
  var customQuery = component.customQuery(currentValue, component);
27343
- return customQuery && customQuery.query;
27130
+ return _extends({
27131
+ query: helper_14(customQuery)
27132
+ }, helper_15(customQuery));
27344
27133
  }
27345
27134
 
27346
- return component.source.defaultQuery ? component.source.defaultQuery(currentValue, component) : {};
27135
+ return component.source.defaultQuery ? {
27136
+ query: component.source.defaultQuery(currentValue, component)
27137
+ } : null;
27347
27138
  }
27348
27139
 
27349
27140
  function initReactivesearch(componentCollection, searchState, settings) {
@@ -27398,6 +27189,11 @@
27398
27189
  }
27399
27190
  });
27400
27191
  var isInternalComponentPresent = false;
27192
+
27193
+ if (component.source.hasInternalComponent) {
27194
+ isInternalComponentPresent = component.source.hasInternalComponent(component);
27195
+ }
27196
+
27401
27197
  var isResultComponent = resultComponents.includes(componentType);
27402
27198
  var internalComponent = component.componentId + "__internal";
27403
27199
  var label = component.filterLabel || component.componentId;
@@ -27429,74 +27225,66 @@
27429
27225
 
27430
27226
  if (component.defaultQuery && typeof component.defaultQuery === 'function') {
27431
27227
  defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
27432
- } // [2] set query options - main component query (valid for result components)
27433
-
27434
-
27435
- if (componentsWithOptions.includes(componentType)) {
27436
- var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
27437
- var highlightQuery = {};
27438
-
27439
- if (componentsWithHighlightQuery.includes(componentType) && component.highlight) {
27440
- highlightQuery = component.source.highlightQuery(component);
27441
- }
27228
+ }
27442
27229
 
27443
- if (options && Object.keys(options).length || highlightQuery && Object.keys(highlightQuery).length) {
27444
- // eslint-disable-next-line
27445
- var _ref = options || {},
27446
- aggs = _ref.aggs,
27447
- size = _ref.size,
27448
- otherQueryOptions = _objectWithoutPropertiesLoose(_ref, _excluded$5);
27230
+ var componentQueryOptions = {}; // [2] set query options - main component query (valid for result components)
27449
27231
 
27450
- if (aggs && Object.keys(aggs).length) {
27451
- isInternalComponentPresent = true; // query should be applied on the internal component
27452
- // to enable feeding the data to parent component
27232
+ if (component && component.source.generateQueryOptions) {
27233
+ componentQueryOptions = _extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
27234
+ }
27453
27235
 
27454
- queryOptions = queryOptionsReducer(queryOptions, {
27455
- type: 'SET_QUERY_OPTIONS',
27456
- component: internalComponent,
27457
- options: {
27458
- aggs: aggs,
27459
- size: typeof size === 'undefined' ? 100 : size
27460
- }
27461
- });
27462
- } // sort, highlight, size, from - query should be applied on the main component
27236
+ var highlightQuery = {};
27463
27237
 
27238
+ if (component.source.highlightQuery) {
27239
+ highlightQuery = component.source.highlightQuery(component);
27240
+ }
27464
27241
 
27465
- if (otherQueryOptions && Object.keys(otherQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
27466
- if (!otherQueryOptions) otherQueryOptions = {};
27467
- if (!highlightQuery) highlightQuery = {};
27242
+ if (componentQueryOptions && Object.keys(componentQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
27243
+ // eslint-disable-next-line
27244
+ var _ref = componentQueryOptions || {},
27245
+ aggs = _ref.aggs,
27246
+ size = _ref.size,
27247
+ otherQueryOptions = _objectWithoutPropertiesLoose(_ref, _excluded$5);
27248
+
27249
+ if (aggs && Object.keys(aggs).length) {
27250
+ isInternalComponentPresent = true;
27251
+ componentQueryOptions = _extends({}, componentQueryOptions, {
27252
+ aggs: aggs,
27253
+ size: typeof size === 'undefined' ? 100 : size
27254
+ });
27255
+ } // sort, highlight, size, from - query should be applied on the main component
27468
27256
 
27469
- var mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery, {
27470
- size: size
27471
- });
27472
27257
 
27473
- if (isInternalComponentPresent) {
27474
- mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery);
27475
- }
27258
+ if (otherQueryOptions && Object.keys(otherQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
27259
+ if (!otherQueryOptions) otherQueryOptions = {};
27260
+ if (!highlightQuery) highlightQuery = {};
27476
27261
 
27477
- if (isResultComponent) {
27478
- var currentPage = component.currentPage ? component.currentPage - 1 : 0;
27262
+ var mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery, {
27263
+ size: size
27264
+ });
27479
27265
 
27480
- if (selectedValues[component.componentId] && selectedValues[component.componentId].value) {
27481
- currentPage = selectedValues[component.componentId].value - 1 || 0;
27482
- }
27266
+ if (isInternalComponentPresent) {
27267
+ mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery);
27268
+ }
27483
27269
 
27484
- var resultSize = component.size || 10;
27485
- var from = currentPage * resultSize; // Update props for RS API
27270
+ if (isResultComponent) {
27271
+ var currentPage = component.currentPage ? component.currentPage - 1 : 0;
27486
27272
 
27487
- compProps.from = from;
27488
- mainQueryOptions = _extends({}, mainQueryOptions, highlightQuery, {
27489
- size: resultSize,
27490
- from: from
27491
- });
27273
+ if (selectedValues[component.componentId] && selectedValues[component.componentId].value) {
27274
+ currentPage = selectedValues[component.componentId].value - 1 || 0;
27492
27275
  }
27493
27276
 
27494
- queryOptions = queryOptionsReducer(queryOptions, {
27495
- type: 'SET_QUERY_OPTIONS',
27496
- component: component.componentId,
27497
- options: _extends({}, mainQueryOptions)
27277
+ var resultSize = component.size || 10;
27278
+ var from = currentPage * resultSize; // Update props for RS API
27279
+
27280
+ compProps.from = from;
27281
+ mainQueryOptions = _extends({}, mainQueryOptions, highlightQuery, {
27282
+ size: resultSize,
27283
+ from: from
27498
27284
  });
27499
27285
  }
27286
+
27287
+ componentQueryOptions = _extends({}, componentQueryOptions, mainQueryOptions);
27500
27288
  }
27501
27289
  } // [3] set dependency tree
27502
27290
 
@@ -27505,7 +27293,7 @@
27505
27293
  var react = component.react;
27506
27294
 
27507
27295
  if (isInternalComponentPresent || isResultComponent) {
27508
- react = helper_22(react, internalComponent);
27296
+ react = helper_30(react, internalComponent);
27509
27297
  }
27510
27298
 
27511
27299
  dependencyTree = dependencyTreeReducer(dependencyTree, {
@@ -27514,25 +27302,42 @@
27514
27302
  react: react
27515
27303
  });
27516
27304
  } // [4] set query list
27305
+ // Do not set default query for suggestions
27517
27306
 
27518
27307
 
27519
- if (isResultComponent) {
27520
- var _getQuery = getQuery(component, value, componentType),
27521
- query = _getQuery.query;
27308
+ if (isInternalComponentPresent && !transform_7(component.componentType)) {
27309
+ var _ref2 = getDefaultQuery(component, value) || {},
27310
+ defaultQuery = _ref2.query,
27311
+ defaultQueryOptions = _objectWithoutPropertiesLoose(_ref2, _excluded2);
27522
27312
 
27523
27313
  queryList = queryReducer(queryList, {
27524
27314
  type: 'SET_QUERY',
27525
27315
  component: internalComponent,
27526
- query: query
27316
+ query: defaultQuery
27527
27317
  });
27528
- } else {
27529
- queryList = queryReducer(queryList, {
27530
- type: 'SET_QUERY',
27531
- component: component.componentId,
27532
- query: getQuery(component, value, componentType)
27318
+ queryOptions = queryOptionsReducer(queryOptions, {
27319
+ type: 'SET_QUERY_OPTIONS',
27320
+ component: internalComponent,
27321
+ options: _extends({}, componentQueryOptions, defaultQueryOptions)
27533
27322
  });
27534
- } // Set component type in component props
27323
+ }
27324
+
27325
+ var _ref3 = getCustomQuery(component, value) || {},
27326
+ query = _ref3.query,
27327
+ options = _objectWithoutPropertiesLoose(_ref3, _excluded3);
27535
27328
 
27329
+ var customQuery = query; // set custom query for main component
27330
+
27331
+ queryList = queryReducer(queryList, {
27332
+ type: 'SET_QUERY',
27333
+ component: component.componentId,
27334
+ query: customQuery
27335
+ });
27336
+ queryOptions = queryOptionsReducer(queryOptions, {
27337
+ type: 'SET_QUERY_OPTIONS',
27338
+ component: component.componentId,
27339
+ options: _extends({}, options)
27340
+ }); // Set component type in component props
27536
27341
 
27537
27342
  compProps.componentType = componentType;
27538
27343
  componentProps[component.componentId] = compProps;
@@ -27551,13 +27356,14 @@
27551
27356
 
27552
27357
  componentCollection.forEach(function (component) {
27553
27358
  // eslint-disable-next-line
27554
- var _buildQuery = helper_21(component.componentId, dependencyTree, queryList, queryOptions),
27359
+ var _buildQuery = helper_29(component.componentId, dependencyTree, queryList, queryOptions),
27555
27360
  queryObj = _buildQuery.queryObj,
27556
27361
  options = _buildQuery.options;
27557
27362
 
27558
- var validOptions = ['aggs', 'from', 'sort']; // check if query or options are valid - non-empty
27363
+ var componentQueryOptions = options;
27364
+ var validOptions = ['aggs', 'from', 'sort']; // check if query or componentQueryOptions are valid - non-empty
27559
27365
 
27560
- if (queryObj && !!Object.keys(queryObj).length || options && Object.keys(options).some(function (item) {
27366
+ if (queryObj && !!Object.keys(queryObj).length || componentQueryOptions && Object.keys(componentQueryOptions).some(function (item) {
27561
27367
  return validOptions.includes(item);
27562
27368
  })) {
27563
27369
  var _extends2;
@@ -27572,7 +27378,7 @@
27572
27378
 
27573
27379
  var currentQuery = _extends({
27574
27380
  query: _extends({}, queryObj)
27575
- }, options, queryOptions[component.componentId]);
27381
+ }, componentQueryOptions, queryOptions[component.componentId]);
27576
27382
 
27577
27383
  queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
27578
27384
 
@@ -27760,7 +27566,7 @@
27760
27566
  });
27761
27567
  }
27762
27568
 
27763
- var version = "1.27.0-gamma.3";
27569
+ var version = "1.29.0";
27764
27570
 
27765
27571
  var _templateObject$o, _templateObject2$a;
27766
27572