@appbaseio/reactivesearch-vue 1.24.3 → 1.27.0-gamma.1

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 (69) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +2015 -567
  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/{DownShift-62e82255.js → CancelSvg-4aa35935.js} +58 -14
  6. package/dist/cjs/{ComponentWrapper-32481890.js → ComponentWrapper-10bad289.js} +1 -1
  7. package/dist/cjs/DataSearch-37dfdf39.js +2154 -0
  8. package/dist/cjs/DataSearch.js +18 -2152
  9. package/dist/cjs/{DropDown-6815b9b6.js → DropDown-0076babc.js} +66 -24
  10. package/dist/cjs/DynamicRangeSlider.js +48 -12
  11. package/dist/cjs/{Input-3cc3fa59.js → Input-a9ee53ed.js} +1 -1
  12. package/dist/cjs/MultiDropdownList.js +19 -11
  13. package/dist/cjs/MultiList.js +22 -16
  14. package/dist/cjs/MultiRange.js +4 -4
  15. package/dist/cjs/RangeInput.js +10 -6
  16. package/dist/cjs/RangeSlider.js +19 -22
  17. package/dist/cjs/ReactiveBase.js +6 -4
  18. package/dist/cjs/ReactiveComponent.js +3 -3
  19. package/dist/cjs/ReactiveList.js +61 -44
  20. package/dist/cjs/ResultCard.js +1 -1
  21. package/dist/cjs/ResultList.js +1 -1
  22. package/dist/cjs/SelectedFilters.js +8 -6
  23. package/dist/cjs/SingleDropdownList.js +18 -10
  24. package/dist/cjs/SingleList.js +10 -9
  25. package/dist/cjs/SingleRange.js +4 -4
  26. package/dist/cjs/StateProvider.js +7 -3
  27. package/dist/cjs/ToggleButton.js +5 -5
  28. package/dist/cjs/{index-89c39a9e.js → index-4509aa45.js} +10 -4
  29. package/dist/cjs/index.js +17 -13
  30. package/dist/cjs/initReactivesearch.js +19 -0
  31. package/dist/cjs/install-b7a80fc1.js +1196 -0
  32. package/dist/cjs/install.js +29 -33
  33. package/dist/cjs/ssr-0ee35a09.js +39 -0
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/cjs/{vueTypes-4c19b4c8.js → vueTypes-57d01f18.js} +3 -3
  36. package/dist/es/{DownShift-3558d402.js → CancelSvg-c2c03a35.js} +55 -16
  37. package/dist/es/{ComponentWrapper-4f85a67e.js → ComponentWrapper-0f3431d1.js} +1 -1
  38. package/dist/es/DataSearch-77325036.js +2141 -0
  39. package/dist/es/DataSearch.js +17 -2151
  40. package/dist/es/{DropDown-035c804f.js → DropDown-0dd8f2a3.js} +65 -23
  41. package/dist/es/DynamicRangeSlider.js +48 -12
  42. package/dist/es/{Input-08bb1bcf.js → Input-10b1d62d.js} +1 -1
  43. package/dist/es/MultiDropdownList.js +19 -11
  44. package/dist/es/MultiList.js +22 -16
  45. package/dist/es/MultiRange.js +4 -4
  46. package/dist/es/RangeInput.js +10 -6
  47. package/dist/es/RangeSlider.js +19 -22
  48. package/dist/es/ReactiveBase.js +6 -4
  49. package/dist/es/ReactiveComponent.js +3 -3
  50. package/dist/es/ReactiveList.js +61 -44
  51. package/dist/es/ResultCard.js +1 -1
  52. package/dist/es/ResultList.js +1 -1
  53. package/dist/es/SelectedFilters.js +8 -6
  54. package/dist/es/SingleDropdownList.js +18 -10
  55. package/dist/es/SingleList.js +10 -9
  56. package/dist/es/SingleRange.js +4 -4
  57. package/dist/es/StateProvider.js +7 -3
  58. package/dist/es/ToggleButton.js +5 -5
  59. package/dist/es/{index-cb1950b6.js → index-78920565.js} +10 -4
  60. package/dist/es/index.js +13 -10
  61. package/dist/es/initReactivesearch.js +19 -0
  62. package/dist/es/install-86388b0e.js +1189 -0
  63. package/dist/es/install.js +27 -35
  64. package/dist/es/ssr-a41dfea9.js +33 -0
  65. package/dist/es/version.js +1 -1
  66. package/dist/es/{vueTypes-fb61bb7b.js → vueTypes-687b2304.js} +3 -3
  67. package/package.json +4 -4
  68. package/dist/cjs/ssr-08e95ede.js +0 -39
  69. package/dist/es/ssr-5d255b08.js +0 -33
@@ -36,14 +36,9 @@
36
36
 
37
37
  if (Object.getOwnPropertySymbols) {
38
38
  var symbols = Object.getOwnPropertySymbols(object);
39
-
40
- if (enumerableOnly) {
41
- symbols = symbols.filter(function (sym) {
42
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
43
- });
44
- }
45
-
46
- keys.push.apply(keys, symbols);
39
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
40
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
41
+ })), keys.push.apply(keys, symbols);
47
42
  }
48
43
 
49
44
  return keys;
@@ -51,19 +46,12 @@
51
46
 
52
47
  function _objectSpread2(target) {
53
48
  for (var i = 1; i < arguments.length; i++) {
54
- var source = arguments[i] != null ? arguments[i] : {};
55
-
56
- if (i % 2) {
57
- ownKeys(Object(source), true).forEach(function (key) {
58
- _defineProperty(target, key, source[key]);
59
- });
60
- } else if (Object.getOwnPropertyDescriptors) {
61
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
62
- } else {
63
- ownKeys(Object(source)).forEach(function (key) {
64
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
65
- });
66
- }
49
+ var source = null != arguments[i] ? arguments[i] : {};
50
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
51
+ _defineProperty(target, key, source[key]);
52
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
53
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
54
+ });
67
55
  }
68
56
 
69
57
  return target;
@@ -751,23 +739,36 @@
751
739
  createStore: createStore
752
740
  });
753
741
 
742
+ /** A function that accepts a potential "extra argument" value to be injected later,
743
+ * and returns an instance of the thunk middleware that uses that value
744
+ */
754
745
  function createThunkMiddleware(extraArgument) {
755
- return function (_ref) {
746
+ // Standard Redux middleware definition pattern:
747
+ // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
748
+ var middleware = function middleware(_ref) {
756
749
  var dispatch = _ref.dispatch,
757
750
  getState = _ref.getState;
758
751
  return function (next) {
759
752
  return function (action) {
753
+ // The thunk middleware looks for any functions that were passed to `store.dispatch`.
754
+ // If this "action" is really a function, call it and return the result.
760
755
  if (typeof action === 'function') {
756
+ // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
761
757
  return action(dispatch, getState, extraArgument);
762
- }
758
+ } // Otherwise, pass the action down the middleware chain as usual
759
+
763
760
 
764
761
  return next(action);
765
762
  };
766
763
  };
767
764
  };
765
+
766
+ return middleware;
768
767
  }
769
768
 
770
- var thunk = createThunkMiddleware();
769
+ var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
770
+ // with whatever "extra arg" they want to inject into their thunks
771
+
771
772
  thunk.withExtraArgument = createThunkMiddleware;
772
773
 
773
774
  var constants = createCommonjsModule(function (module, exports) {
@@ -1193,6 +1194,7 @@
1193
1194
  reactiveList: 'REACTIVELIST',
1194
1195
  dataSearch: 'DATASEARCH',
1195
1196
  categorySearch: 'CATEGORYSEARCH',
1197
+ searchBox: 'SUGGESTION',
1196
1198
  singleList: 'SINGLELIST',
1197
1199
  multiList: 'MULTILIST',
1198
1200
  singleDataList: 'SINGLEDATALIST',
@@ -1221,9 +1223,10 @@
1221
1223
  search: 'search',
1222
1224
  term: 'term',
1223
1225
  range: 'range',
1224
- geo: 'geo'
1226
+ geo: 'geo',
1227
+ suggestion: 'suggestion'
1225
1228
  };
1226
- var validProps = exports.validProps = ['componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'enablePopularSuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'unit'];
1229
+ var validProps = exports.validProps = ['componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'enablePopularSuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'popularSuggestionsConfig', 'enableRecentSuggestions', 'recentSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords'];
1227
1230
  var CLEAR_ALL = exports.CLEAR_ALL = {
1228
1231
  NEVER: 'never',
1229
1232
  ALWAYS: 'always',
@@ -1348,7 +1351,6 @@
1348
1351
  }
1349
1352
 
1350
1353
  var defaultAnalyticsConfig = exports.defaultAnalyticsConfig = {
1351
- searchStateHeader: false,
1352
1354
  emptyQuery: true,
1353
1355
  suggestionAnalytics: true,
1354
1356
  userId: null,
@@ -1726,7 +1728,19 @@
1726
1728
  return _extends({}, state, _defineProperty({}, action.component, _extends({}, state[action.component], action.payload)));
1727
1729
 
1728
1730
  case constants.CLEAR_VALUES:
1729
- return {};
1731
+ {
1732
+ if (action.resetValues) {
1733
+ var nextState = {};
1734
+ Object.keys(action.resetValues).forEach(function (componentId) {
1735
+ nextState[componentId] = _extends({}, state[componentId], {
1736
+ value: action.resetValues[componentId]
1737
+ });
1738
+ });
1739
+ return nextState;
1740
+ }
1741
+
1742
+ return {};
1743
+ }
1730
1744
 
1731
1745
  case constants.REMOVE_COMPONENT:
1732
1746
  {
@@ -2749,7 +2763,12 @@
2749
2763
  var aggsResponse = Object.values(action.aggregations) && Object.values(action.aggregations)[0];
2750
2764
  var fieldName = Object.keys(action.aggregations)[0];
2751
2765
  if (!aggsResponse) return state;
2752
- var buckets = aggsResponse.buckets || [];
2766
+ var buckets = [];
2767
+
2768
+ if (aggsResponse.buckets && Array.isArray(aggsResponse.buckets)) {
2769
+ buckets = aggsResponse.buckets;
2770
+ }
2771
+
2753
2772
  var parsedAggs = buckets.map(function (bucket) {
2754
2773
  var doc_count = bucket.doc_count,
2755
2774
  key = bucket.key,
@@ -2765,7 +2784,7 @@
2765
2784
 
2766
2785
  return _extends({
2767
2786
  _doc_count: doc_count,
2768
- _key: key[fieldName],
2787
+ _key: typeof key === 'string' ? key : key[fieldName],
2769
2788
  top_hits: hitsData
2770
2789
  }, flatData, _source);
2771
2790
  });
@@ -2775,7 +2794,7 @@
2775
2794
  return state;
2776
2795
  }
2777
2796
  });
2778
- unwrapExports(compositeAggsReducer_1);
2797
+ var compositeAggsReducer = unwrapExports(compositeAggsReducer_1);
2779
2798
 
2780
2799
  var appliedSettingsReducer_1 = createCommonjsModule(function (module, exports) {
2781
2800
  Object.defineProperty(exports, "__esModule", {
@@ -4557,6 +4576,8 @@
4557
4576
  return target;
4558
4577
  };
4559
4578
 
4579
+ exports.replaceDiacritics = replaceDiacritics;
4580
+
4560
4581
  var _diacritics2 = _interopRequireDefault(diacritics_1);
4561
4582
 
4562
4583
  function _interopRequireDefault(obj) {
@@ -4834,12 +4855,13 @@
4834
4855
  exports["default"] = getSuggestions;
4835
4856
  });
4836
4857
  unwrapExports(suggestions);
4858
+ var suggestions_1 = suggestions.replaceDiacritics;
4837
4859
 
4838
4860
  var helper = createCommonjsModule(function (module, exports) {
4839
4861
  Object.defineProperty(exports, "__esModule", {
4840
4862
  value: true
4841
4863
  });
4842
- 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;
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;
4843
4865
 
4844
4866
  var _extends = Object.assign || function (target) {
4845
4867
  for (var i = 1; i < arguments.length; i++) {
@@ -4867,6 +4889,7 @@
4867
4889
  exports.extractFieldsFromSource = extractFieldsFromSource;
4868
4890
  exports.normalizeDataField = normalizeDataField;
4869
4891
  exports.handleOnSuggestions = handleOnSuggestions;
4892
+ exports.isValidDateRangeQueryFormat = isValidDateRangeQueryFormat;
4870
4893
 
4871
4894
  var _dateFormats2 = _interopRequireDefault(dateFormats_1);
4872
4895
 
@@ -5255,7 +5278,7 @@
5255
5278
  case 'epoch_millis':
5256
5279
  return date.getTime();
5257
5280
 
5258
- case 'epoch_seconds':
5281
+ case 'epoch_second':
5259
5282
  return Math.floor(date.getTime() / 1000);
5260
5283
 
5261
5284
  default:
@@ -5648,36 +5671,49 @@
5648
5671
  });
5649
5672
  return withClickIds(finalSuggestions);
5650
5673
  };
5674
+
5675
+ function isValidDateRangeQueryFormat(queryFormat) {
5676
+ return Object.keys(_dateFormats2["default"]).includes(queryFormat);
5677
+ }
5678
+
5679
+ var suggestionTypes = exports.suggestionTypes = {
5680
+ Popular: 'popular',
5681
+ Index: 'index',
5682
+ Recent: 'recent',
5683
+ Promoted: 'promoted'
5684
+ };
5651
5685
  });
5652
5686
  unwrapExports(helper);
5653
- var helper_1 = helper.getTopSuggestions;
5654
- var helper_2 = helper.withClickIds;
5655
- var helper_3 = helper.getCompositeAggsQuery;
5656
- var helper_4 = helper.getAggsQuery;
5657
- var helper_5 = helper.extractQueryFromDefaultQuery;
5658
- var helper_6 = helper.updateInternalQuery;
5659
- var helper_7 = helper.getSearchState;
5660
- var helper_8 = helper.getOptionsFromQuery;
5661
- var helper_9 = helper.parseHits;
5662
- var helper_10 = helper.handleA11yAction;
5663
- var helper_11 = helper.getInnerKey;
5664
- var helper_12 = helper.getClassName;
5665
- var helper_13 = helper.checkSomePropChange;
5666
- var helper_14 = helper.checkPropChange;
5667
- var helper_15 = helper.updateDefaultQuery;
5668
- var helper_16 = helper.updateCustomQuery;
5669
- var helper_17 = helper.isEqual;
5670
- var helper_18 = helper.debounce;
5671
- var helper_19 = helper.getQueryOptions;
5672
- var helper_20 = helper.buildQuery;
5673
- var helper_21 = helper.pushToAndClause;
5674
- var helper_22 = helper.checkValueChange;
5675
- var helper_23 = helper.getAggsOrder;
5676
- var helper_24 = helper.formatDate;
5677
- var helper_25 = helper.getResultStats;
5678
- var helper_26 = helper.extractFieldsFromSource;
5679
- var helper_27 = helper.normalizeDataField;
5680
- var helper_28 = helper.handleOnSuggestions;
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;
5681
5717
 
5682
5718
  var value = createCommonjsModule(function (module, exports) {
5683
5719
  Object.defineProperty(exports, "__esModule", {
@@ -5799,8 +5835,10 @@
5799
5835
  }
5800
5836
 
5801
5837
  function clearValues() {
5838
+ var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5802
5839
  return {
5803
- type: constants.CLEAR_VALUES
5840
+ type: constants.CLEAR_VALUES,
5841
+ resetValues: resetValues
5804
5842
  };
5805
5843
  }
5806
5844
  });
@@ -6036,6 +6074,7 @@
6036
6074
  exports.updateCompositeAggs = updateCompositeAggs;
6037
6075
  exports.updateHits = updateHits;
6038
6076
  exports.saveQueryToHits = saveQueryToHits;
6077
+ exports.mockDataForTesting = mockDataForTesting;
6039
6078
 
6040
6079
  function updateAggs(component, aggregations) {
6041
6080
  var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
@@ -6077,12 +6116,25 @@
6077
6116
  query: query
6078
6117
  };
6079
6118
  }
6119
+
6120
+ function mockDataForTesting(component, data) {
6121
+ return function (dispatch) {
6122
+ if (data.hasOwnProperty('aggregations')) {
6123
+ dispatch(updateAggs(component, data.aggregations));
6124
+ }
6125
+
6126
+ if (data.hasOwnProperty('hits')) {
6127
+ dispatch(updateHits(component, data, data.time || undefined));
6128
+ }
6129
+ };
6130
+ }
6080
6131
  });
6081
6132
  unwrapExports(hits);
6082
6133
  var hits_1 = hits.updateAggs;
6083
6134
  var hits_2 = hits.updateCompositeAggs;
6084
6135
  var hits_3 = hits.updateHits;
6085
6136
  var hits_4 = hits.saveQueryToHits;
6137
+ var hits_5 = hits.mockDataForTesting;
6086
6138
 
6087
6139
  var xdate = createCommonjsModule(function (module) {
6088
6140
  /**
@@ -6910,6 +6962,8 @@
6910
6962
 
6911
6963
  var _xdate2 = _interopRequireDefault(xdate);
6912
6964
 
6965
+ var _dateFormats2 = _interopRequireDefault(dateFormats_1);
6966
+
6913
6967
  function _interopRequireDefault(obj) {
6914
6968
  return obj && obj.__esModule ? obj : {
6915
6969
  "default": obj
@@ -6943,10 +6997,10 @@
6943
6997
  return obj;
6944
6998
  }
6945
6999
 
6946
- var componentToTypeMap = exports.componentToTypeMap = (_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, constants$1.componentTypes.reactiveList, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dataSearch, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.categorySearch, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDataList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDropdownList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDataList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDropdownList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.tagCloud, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.toggleButton, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.numberBox, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.datePicker, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dateRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dynamicRangeSlider, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDropdownRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDropdownRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.rangeSlider, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.ratingsFilter, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.rangeInput, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.geoDistanceDropdown, constants$1.queryTypes.geo), _defineProperty(_componentToTypeMap, constants$1.componentTypes.geoDistanceSlider, constants$1.queryTypes.geo), _defineProperty(_componentToTypeMap, constants$1.componentTypes.reactiveMap, constants$1.queryTypes.geo), _componentToTypeMap);
7000
+ var componentToTypeMap = exports.componentToTypeMap = (_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, constants$1.componentTypes.reactiveList, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dataSearch, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.categorySearch, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.searchBox, constants$1.queryTypes.suggestion), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDataList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDropdownList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDataList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDropdownList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.tagCloud, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.toggleButton, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.numberBox, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.datePicker, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dateRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dynamicRangeSlider, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDropdownRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDropdownRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.rangeSlider, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.ratingsFilter, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.rangeInput, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.geoDistanceDropdown, constants$1.queryTypes.geo), _defineProperty(_componentToTypeMap, constants$1.componentTypes.geoDistanceSlider, constants$1.queryTypes.geo), _defineProperty(_componentToTypeMap, constants$1.componentTypes.reactiveMap, constants$1.queryTypes.geo), _componentToTypeMap);
6947
7001
  var multiRangeComponents = [constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
6948
7002
  var dateRangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.datePicker];
6949
- var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch];
7003
+ var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch, constants$1.componentTypes.searchBox];
6950
7004
  var listComponentsWithPagination = [constants$1.componentTypes.singleList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.multiDropdownList];
6951
7005
 
6952
7006
  var getNormalizedField = exports.getNormalizedField = function getNormalizedField(field) {
@@ -7002,7 +7056,7 @@
7002
7056
  return null;
7003
7057
  }
7004
7058
 
7005
- return {
7059
+ return _extends({
7006
7060
  id: componentId,
7007
7061
  type: queryType,
7008
7062
  dataField: getNormalizedField(props.dataField),
@@ -7041,7 +7095,17 @@
7041
7095
  distinctField: props.distinctField,
7042
7096
  distinctFieldConfig: props.distinctFieldConfig,
7043
7097
  index: props.index
7044
- };
7098
+ }, queryType === constants$1.queryTypes.suggestion ? {
7099
+ enablePopularSuggestions: props.enablePopularSuggestions,
7100
+ enableRecentSuggestions: props.enableRecentSuggestions,
7101
+ popularSuggestionsConfig: props.popularSuggestionsConfig,
7102
+ recentSuggestionsConfig: props.recentSuggestionsConfig,
7103
+ applyStopwords: props.applyStopwords,
7104
+ customStopwords: props.customStopwords,
7105
+ enablePredictiveSuggestions: props.enablePredictiveSuggestions
7106
+ } : {}, {
7107
+ calendarInterval: props.calendarInterval
7108
+ });
7045
7109
  }
7046
7110
 
7047
7111
  return null;
@@ -7071,6 +7135,7 @@
7071
7135
  var calcValues = store.selectedValues[component] || store.internalValues[component];
7072
7136
  var value = calcValues !== undefined && calcValues !== null ? calcValues.value : undefined;
7073
7137
  var queryFormat = componentProps.queryFormat;
7138
+ var calendarInterval = void 0;
7074
7139
  var interval = componentProps.interval;
7075
7140
  var type = componentToTypeMap[componentProps.componentType];
7076
7141
  var dataField = componentProps.dataField;
@@ -7139,6 +7204,24 @@
7139
7204
  aggregations = ['histogram'];
7140
7205
  }
7141
7206
 
7207
+ 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;
7209
+
7210
+ if (value) {
7211
+ if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
7212
+ value = {
7213
+ start: (0, helper.formatDate)(new _xdate2["default"](value.start), componentProps),
7214
+ end: (0, helper.formatDate)(new _xdate2["default"](value.end), componentProps)
7215
+ };
7216
+ } else {
7217
+ value = {
7218
+ start: parseFloat(value.start),
7219
+ end: parseFloat(value.end)
7220
+ };
7221
+ }
7222
+ }
7223
+ }
7224
+
7142
7225
  if (dateRangeComponents.includes(componentProps.componentType)) {
7143
7226
  queryFormat = 'or';
7144
7227
 
@@ -7261,6 +7344,7 @@
7261
7344
  }
7262
7345
 
7263
7346
  return _extends({}, componentProps, {
7347
+ calendarInterval: calendarInterval,
7264
7348
  dataField: dataField,
7265
7349
  queryFormat: queryFormat,
7266
7350
  type: type,
@@ -7271,7 +7355,7 @@
7271
7355
  defaultQuery: store.defaultQueries ? store.defaultQueries[component] : undefined,
7272
7356
  customHighlight: store.customHighlightOptions ? store.customHighlightOptions[component] : undefined,
7273
7357
  categoryValue: store.internalValues[component] ? store.internalValues[component].category : undefined,
7274
- value: value,
7358
+ value: componentProps.componentType === constants$1.componentTypes.searchBox ? value || undefined : value,
7275
7359
  pagination: pagination,
7276
7360
  from: from
7277
7361
  }, customOptions);
@@ -7307,7 +7391,8 @@
7307
7391
  var orderOfQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
7308
7392
  var finalQuery = {};
7309
7393
  var react = flatReactProp(store.dependencyTree[componentID], componentID);
7310
- react.forEach(function (component) {
7394
+ react.forEach(function (componentObject) {
7395
+ var component = componentObject;
7311
7396
  var customQuery = store.customQueries[component];
7312
7397
 
7313
7398
  if (!isInternalComponent(component)) {
@@ -7320,7 +7405,12 @@
7320
7405
  execute = true;
7321
7406
  }
7322
7407
 
7323
- var dependentQuery = getRSQuery(component, extractPropsFromState(store, component), execute);
7408
+ var componentProps = store.props[component];
7409
+ var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _extends({}, componentProps && componentProps.componentType === constants$1.componentTypes.searchBox ? _extends({}, execute === false ? {
7410
+ type: constants$1.queryTypes.search
7411
+ } : {}, calcValues.category ? {
7412
+ categoryValue: calcValues.category
7413
+ } : {}) : {})), execute);
7324
7414
 
7325
7415
  if (dependentQuery) {
7326
7416
  finalQuery[component] = dependentQuery;
@@ -8291,6 +8381,20 @@
8291
8381
  value: true
8292
8382
  });
8293
8383
 
8384
+ var _extends = Object.assign || function (target) {
8385
+ for (var i = 1; i < arguments.length; i++) {
8386
+ var source = arguments[i];
8387
+
8388
+ for (var key in source) {
8389
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
8390
+ target[key] = source[key];
8391
+ }
8392
+ }
8393
+ }
8394
+
8395
+ return target;
8396
+ };
8397
+
8294
8398
  var _crossFetch2 = _interopRequireDefault(browserPonyfill);
8295
8399
 
8296
8400
  function _interopRequireDefault(obj) {
@@ -8299,20 +8403,26 @@
8299
8403
  };
8300
8404
  }
8301
8405
 
8302
- var fetchGraphQL = function fetchGraphQL(graphQLUrl, url, credentials, app, query) {
8406
+ var fetchGraphQL = function fetchGraphQL(requestOptions) {
8407
+ var graphQLUrl = requestOptions.graphQLUrl,
8408
+ url = requestOptions.url,
8409
+ credentials = requestOptions.credentials,
8410
+ app = requestOptions.app,
8411
+ query = requestOptions.query,
8412
+ headers = requestOptions.headers;
8303
8413
  var fetchUrl = credentials ? url.replace('//', '//' + credentials + '@') : url;
8304
8414
  return (0, _crossFetch2["default"])(graphQLUrl, {
8305
8415
  method: 'POST',
8306
- body: '\n\t\t\tquery{\n\t\t\t\telastic50(host: "' + fetchUrl + '"){\n\t\t\t\t\tmsearch(\n\t\t\t\t\t\tindex: "' + app + '"\n\t\t\t\t\t\tbody: ' + JSON.stringify(query.map(function (item) {
8416
+ body: '\n\t\t\tquery{\n\t\t\t\telastic77(host: "' + fetchUrl + '"){\n\t\t\t\t\tmsearch(\n\t\t\t\t\t\tindex: "' + app + '"\n\t\t\t\t\t\tbody: ' + JSON.stringify(query.map(function (item) {
8307
8417
  return JSON.stringify(item);
8308
8418
  })) + '\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t',
8309
- headers: {
8419
+ headers: _extends({}, headers, {
8310
8420
  'Content-Type': 'application/graphql'
8311
- }
8421
+ })
8312
8422
  }).then(function (res) {
8313
8423
  return res.json();
8314
8424
  }).then(function (jsonRes) {
8315
- return jsonRes.data.elastic50.msearch;
8425
+ return jsonRes.data.elastic77.msearch;
8316
8426
  })["catch"](function (error) {
8317
8427
  console.error(error);
8318
8428
  });
@@ -8422,6 +8532,15 @@
8422
8532
  };
8423
8533
  }
8424
8534
 
8535
+ var handleTransformRequest = function handleTransformRequest(transformRequest, res) {
8536
+ if (transformRequest && typeof transformRequest === 'function') {
8537
+ var transformRequestPromise = transformRequest(res);
8538
+ return transformRequestPromise instanceof Promise ? transformRequestPromise : Promise.resolve(transformRequestPromise);
8539
+ }
8540
+
8541
+ return Promise.resolve(res);
8542
+ };
8543
+
8425
8544
  function msearch(query, orderOfQueries) {
8426
8545
  var appendToHits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8427
8546
  var isInternalComponent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
@@ -8472,14 +8591,6 @@
8472
8591
  }
8473
8592
  }
8474
8593
 
8475
- if (config.analyticsConfig.searchStateHeader) {
8476
- var searchState = (0, helper.getSearchState)(getState(), true);
8477
-
8478
- if (searchState && Object.keys(searchState).length) {
8479
- searchHeaders['X-Search-State'] = JSON.stringify(searchState);
8480
- }
8481
- }
8482
-
8483
8594
  if (config.analyticsConfig.userId) {
8484
8595
  searchHeaders['X-User-Id'] = config.analyticsConfig.userId;
8485
8596
  }
@@ -8495,14 +8606,29 @@
8495
8606
  });
8496
8607
 
8497
8608
  if (config.graphQLUrl) {
8498
- (0, _graphQL2["default"])(config.graphQLUrl, config.url, config.credentials, config.app, query).then(function (res) {
8499
- (0, utils.handleResponseMSearch)({
8500
- res: res,
8501
- isSuggestionsQuery: isSuggestionsQuery,
8502
- orderOfQueries: orderOfQueries,
8503
- appendToHits: appendToHits,
8504
- appendToAggs: appendToAggs
8505
- }, getState, dispatch);
8609
+ var requestOptions = {
8610
+ graphQLUrl: config.graphQLUrl,
8611
+ url: config.url,
8612
+ credentials: config.credentials,
8613
+ app: config.app,
8614
+ query: query,
8615
+ headers: headers
8616
+ };
8617
+ handleTransformRequest(appbaseRef.transformRequest, requestOptions).then(function (modifiedRequest) {
8618
+ (0, _graphQL2["default"])(modifiedRequest).then(function (res) {
8619
+ (0, utils.handleResponseMSearch)({
8620
+ res: res,
8621
+ isSuggestionsQuery: isSuggestionsQuery,
8622
+ orderOfQueries: orderOfQueries,
8623
+ appendToHits: appendToHits,
8624
+ appendToAggs: appendToAggs
8625
+ }, getState, dispatch);
8626
+ })["catch"](function (err) {
8627
+ (0, utils.handleError)({
8628
+ orderOfQueries: orderOfQueries,
8629
+ error: err
8630
+ }, getState, dispatch);
8631
+ });
8506
8632
  })["catch"](function (err) {
8507
8633
  (0, utils.handleError)({
8508
8634
  orderOfQueries: orderOfQueries,
@@ -8699,7 +8825,7 @@
8699
8825
  var isInternalComponent = componentId.endsWith('__internal');
8700
8826
  var mainComponentProps = props[componentId];
8701
8827
 
8702
- if (isInternalComponent && (0, transform.isSearchComponent)(mainComponentProps.componentType)) {
8828
+ if (isInternalComponent && mainComponentProps && (0, transform.isSearchComponent)(mainComponentProps.componentType)) {
8703
8829
  value$1 = internalValues[componentId] && internalValues[componentId].value;
8704
8830
  }
8705
8831
 
@@ -12778,19 +12904,19 @@
12778
12904
  unit: VueTypes.oneOf(['mi', 'miles', 'yd', 'yards', 'ft', 'feet', 'in', 'inch', 'km', 'kilometers', 'm', 'meters', 'cm', 'centimeters', 'mm', 'millimeters', 'NM', 'nmi', 'nauticalmiles']),
12779
12905
  value: VueTypes.string.def(undefined),
12780
12906
  analyticsConfig: VueTypes.shape({
12781
- searchStateHeader: VueTypes.bool,
12782
12907
  emptyQuery: VueTypes.bool,
12783
12908
  suggestionAnalytics: VueTypes.bool,
12784
12909
  userId: VueTypes.string,
12785
12910
  customEvents: VueTypes.object
12786
12911
  }),
12787
12912
  appbaseConfig: VueTypes.shape({
12788
- enableQueryRules: VueTypes.bool,
12789
12913
  recordAnalytics: VueTypes.bool,
12790
- searchStateHeader: VueTypes.bool,
12791
12914
  emptyQuery: VueTypes.bool,
12792
12915
  suggestionAnalytics: VueTypes.bool,
12916
+ enableQueryRules: VueTypes.bool,
12917
+ enableSearchRelevancy: VueTypes.bool,
12793
12918
  userId: VueTypes.string,
12919
+ useCache: VueTypes.bool,
12794
12920
  customEvents: VueTypes.object,
12795
12921
  enableTelemetry: VueTypes.bool.def(true)
12796
12922
  }).def({}),
@@ -13138,10 +13264,16 @@
13138
13264
  }; // parses current array (i.e. this.$props.value) for `onChange` callback for multi-* components
13139
13265
 
13140
13266
  function parseValueArray(objectValues, currentValue) {
13141
- var keys = Object.keys(objectValues);
13142
- var selectedValues = keys.map(function (key) {
13143
- return objectValues[key] ? key : null;
13144
- });
13267
+ var selectedValues;
13268
+
13269
+ if (Array.isArray(objectValues)) {
13270
+ selectedValues = [].concat(objectValues);
13271
+ } else {
13272
+ var keys = Object.keys(objectValues);
13273
+ selectedValues = keys.map(function (key) {
13274
+ return objectValues[key] ? key : null;
13275
+ });
13276
+ }
13145
13277
 
13146
13278
  if (selectedValues.includes(currentValue)) {
13147
13279
  return selectedValues.filter(function (item) {
@@ -13948,9 +14080,20 @@
13948
14080
  }
13949
14081
 
13950
14082
  this.internalComponent = this.$props.componentId + "__internal";
13951
- this.sortOptionIndex = this.defaultSortOption ? this.sortOptions.findIndex(function (s) {
13952
- return s.label === _this.defaultSortOption;
13953
- }) : 0;
14083
+ this.sortOptionIndex = 0;
14084
+
14085
+ if (this.defaultSortOption && this.sortOptions && Array.isArray(this.sortOptions)) {
14086
+ this.sortOptionIndex = this.sortOptions.findIndex(function (s) {
14087
+ return s.label === _this.defaultSortOption;
14088
+ });
14089
+ }
14090
+
14091
+ if (this.urlSortOption) {
14092
+ this.sortOptionIndex = this.$props.sortOptions.findIndex(function (s) {
14093
+ return s.label === _this.urlSortOption;
14094
+ }) || 0;
14095
+ }
14096
+
13954
14097
  this.updateComponentProps(this.componentId, {
13955
14098
  from: this.from
13956
14099
  }, constants_1$1.reactiveList);
@@ -13960,7 +14103,7 @@
13960
14103
  },
13961
14104
  props: {
13962
14105
  currentPage: VueTypes.number.def(0),
13963
- includeFields: types.includeFields.def(['*']),
14106
+ includeFields: types.includeFields,
13964
14107
  // component props
13965
14108
  className: types.string,
13966
14109
  componentId: types.stringRequired,
@@ -13969,7 +14112,7 @@
13969
14112
  aggregationSize: VueTypes.number,
13970
14113
  defaultQuery: types.func,
13971
14114
  defaultSortOption: types.string,
13972
- excludeFields: types.excludeFields.def([]),
14115
+ excludeFields: types.excludeFields,
13973
14116
  innerClass: types.style,
13974
14117
  listClass: VueTypes.string.def(''),
13975
14118
  loader: types.title,
@@ -13981,7 +14124,7 @@
13981
14124
  pages: VueTypes.number.def(5),
13982
14125
  pagination: VueTypes.bool.def(false),
13983
14126
  infiniteScroll: VueTypes.bool.def(true),
13984
- paginationAt: types.paginationAt.def('bottom'),
14127
+ paginationAt: VueTypes.oneOf(['top', 'bottom', 'both']).def('bottom'),
13985
14128
  react: types.react,
13986
14129
  scrollOnChange: VueTypes.bool.def(true),
13987
14130
  showResultStats: VueTypes.bool.def(true),
@@ -14041,7 +14184,7 @@
14041
14184
  filteredResults = [].concat(parsedPromotedResults, filteredResults);
14042
14185
  }
14043
14186
 
14044
- return helper_2(filteredResults);
14187
+ return helper_3(filteredResults);
14045
14188
  }
14046
14189
  },
14047
14190
  watch: {
@@ -14182,11 +14325,11 @@
14182
14325
  var options = getQueryOptions(this.$props);
14183
14326
  options.from = this.$data.from;
14184
14327
 
14185
- if (this.$props.sortOptions) {
14328
+ if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
14186
14329
  var _ref2;
14187
14330
 
14188
- var sortField = this.$props.sortOptions[this.sortOptionIndex].dataField;
14189
- var sortBy = this.$props.sortOptions[this.sortOptionIndex].sortBy;
14331
+ var sortField = this.sortOptions[this.sortOptionIndex].dataField;
14332
+ var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
14190
14333
  options.sort = [(_ref2 = {}, _ref2[sortField] = {
14191
14334
  order: sortBy
14192
14335
  }, _ref2)]; // To handle sort options for RS API
@@ -14256,10 +14399,10 @@
14256
14399
  "class": this.$props.className
14257
14400
  }, [this.isLoading && this.shouldRenderPagination && this.showInfiniteScroll && (this.$scopedSlots.loader || this.$props.loader), this.renderErrorComponent(), h(Flex, {
14258
14401
  "attrs": {
14259
- "labelPosition": this.$props.sortOptions ? 'right' : 'left'
14402
+ "labelPosition": this.sortOptions ? 'right' : 'left'
14260
14403
  },
14261
14404
  "class": getClassName$1(this.$props.innerClass, 'resultsInfo')
14262
- }, [this.$props.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && results.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
14405
+ }, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && hits && hits.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
14263
14406
  "attrs": {
14264
14407
  "pages": this.$props.pages,
14265
14408
  "totalPages": this.totalPages,
@@ -14330,15 +14473,18 @@
14330
14473
  var options = getQueryOptions(props);
14331
14474
  options.from = this.$data.from;
14332
14475
 
14333
- if (props.sortOptions) {
14334
- var _ref5;
14335
-
14476
+ if (props.sortOptions && Array.isArray(props.sortOptions)) {
14336
14477
  var sortOptionIndex = props.defaultSortOption ? props.sortOptions.findIndex(function (s) {
14337
14478
  return s.label === props.defaultSortOption;
14338
14479
  }) : 0;
14339
- options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
14340
- order: props.sortOptions[sortOptionIndex].sortBy
14341
- }, _ref5)];
14480
+
14481
+ if (props.sortOptions[sortOptionIndex]) {
14482
+ var _ref5;
14483
+
14484
+ options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
14485
+ order: props.sortOptions[sortOptionIndex].sortBy
14486
+ }, _ref5)];
14487
+ }
14342
14488
  } else if (props.sortBy) {
14343
14489
  var _ref6;
14344
14490
 
@@ -14444,26 +14590,32 @@
14444
14590
  }, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
14445
14591
  },
14446
14592
  handleSortChange: function handleSortChange(e) {
14447
- var _ref7;
14448
-
14449
- var index = e.target.value; // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
14593
+ var index = e.target.value;
14450
14594
 
14451
- var options = getQueryOptions(this.$props);
14452
- options.from = 0;
14453
- var sortField = this.$props.sortOptions[index].dataField;
14454
- var sortBy = this.$props.sortOptions[index].sortBy;
14455
- options.sort = [(_ref7 = {}, _ref7[sortField] = {
14456
- order: sortBy
14457
- }, _ref7)];
14458
- this.sortOptionIndex = index; // To handle sort options for RS API
14595
+ if (this.sortOptions && this.sortOptions[index]) {
14596
+ var _ref7;
14459
14597
 
14460
- this.updateComponentProps(this.componentId, {
14461
- dataField: sortField,
14462
- sortBy: sortBy
14463
- }, constants_1$1.reactiveList);
14464
- this.setQueryOptions(this.$props.componentId, options, true);
14465
- this.currentPageState = 0;
14466
- this.from = 0;
14598
+ // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
14599
+ var options = getQueryOptions(this.$props);
14600
+ options.from = 0;
14601
+ var sortField = this.sortOptions[index].dataField;
14602
+ var sortBy = this.sortOptions[index].sortBy;
14603
+ options.sort = [(_ref7 = {}, _ref7[sortField] = {
14604
+ order: sortBy
14605
+ }, _ref7)];
14606
+ this.sortOptionIndex = index; // To handle sort options for RS API
14607
+
14608
+ this.updateComponentProps(this.componentId, {
14609
+ dataField: sortField,
14610
+ sortBy: sortBy
14611
+ }, constants_1$1.reactiveList);
14612
+ this.setQueryOptions(this.$props.componentId, options, true);
14613
+ this.setPage(0);
14614
+ this.currentPageState = 0;
14615
+ this.from = 0;
14616
+ var sortOption = this.$props.sortOptions[this.sortOptionIndex] ? this.$props.sortOptions[this.sortOptionIndex].label : null;
14617
+ this.setPageURL(this.$props.componentId + "sortOption", sortOption, this.$props.componentId + "sortOption", false, this.$props.URLParams);
14618
+ }
14467
14619
  },
14468
14620
  triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
14469
14621
  var docId = documentId;
@@ -14497,7 +14649,7 @@
14497
14649
  "domProps": {
14498
14650
  "value": this.sortOptionIndex
14499
14651
  }
14500
- }, [this.$props.sortOptions.map(function (sort, index) {
14652
+ }, [this.sortOptions.map(function (sort, index) {
14501
14653
  return h("option", {
14502
14654
  "key": sort.label,
14503
14655
  "domProps": {
@@ -14574,6 +14726,7 @@
14574
14726
  var mapStateToProps$1 = function mapStateToProps(state, props) {
14575
14727
  return {
14576
14728
  defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
14729
+ urlSortOption: state.selectedValues[props.componentId + "sortOption"] && state.selectedValues[props.componentId + "sortOption"].value,
14577
14730
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
14578
14731
  rawData: state.rawData[props.componentId],
14579
14732
  aggregationData: state.compositeAggregations[props.componentId],
@@ -14603,11 +14756,7 @@
14603
14756
  }; // Only used for SSR
14604
14757
 
14605
14758
  ReactiveList.generateQueryOptions = function (props) {
14606
- // simulate default (includeFields and excludeFields) props to generate consistent query
14607
- var options = getQueryOptions(_extends({
14608
- includeFields: ['*'],
14609
- excludeFields: []
14610
- }, props));
14759
+ var options = getQueryOptions(props);
14611
14760
  var size = props.size,
14612
14761
  dataField = props.dataField,
14613
14762
  defaultSortOption = props.defaultSortOption,
@@ -16688,7 +16837,7 @@
16688
16837
  headers: types.headers,
16689
16838
  getSearchParams: types.func,
16690
16839
  setSearchParams: types.func,
16691
- as: types.string.def('div')
16840
+ as: VueTypes.string.def('div')
16692
16841
  },
16693
16842
  mounted: function mounted() {
16694
16843
  var _this = this;
@@ -16836,7 +16985,9 @@
16836
16985
  return value.map(function (item) {
16837
16986
  return _this3.getValue(item);
16838
16987
  });
16839
- } else if (value && typeof value === 'object') {
16988
+ }
16989
+
16990
+ if (value && typeof value === 'object') {
16840
16991
  // TODO: support for NestedList
16841
16992
  if (value.location) return value;
16842
16993
  if (value.category) return value;
@@ -17010,14 +17161,14 @@
17010
17161
  this.updateState(this.$props);
17011
17162
  },
17012
17163
  analyticsConfig: function analyticsConfig(newVal, oldVal) {
17013
- if (!helper_17(newVal, oldVal)) {
17164
+ if (!helper_18(newVal, oldVal)) {
17014
17165
  if (this.store) {
17015
17166
  this.store.dispatch(analytics_3$1(newVal));
17016
17167
  }
17017
17168
  }
17018
17169
  },
17019
17170
  appbaseConfig: function appbaseConfig(newVal, oldVal) {
17020
- if (!helper_17(newVal, oldVal)) {
17171
+ if (!helper_18(newVal, oldVal)) {
17021
17172
  if (this.store) {
17022
17173
  this.store.dispatch(analytics_3$1(newVal));
17023
17174
  }
@@ -17794,7 +17945,7 @@
17794
17945
  });
17795
17946
 
17796
17947
  var suggestions$1 = function suggestions(themePreset, theme) {
17797
- return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 395px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark$1(theme));
17948
+ return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 395px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark$1(theme));
17798
17949
  };
17799
17950
 
17800
17951
  var suggestionsContainer = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
@@ -17950,8 +18101,7 @@
17950
18101
  internal_isOpen: false,
17951
18102
  internal_inputValue: '',
17952
18103
  internal_selectedItem: null,
17953
- internal_highlightedIndex: null,
17954
- internal_eventsCalled: {}
18104
+ internal_highlightedIndex: null
17955
18105
  };
17956
18106
  },
17957
18107
  computed: {
@@ -18136,23 +18286,11 @@
18136
18286
  }
18137
18287
 
18138
18288
  var vm = this;
18139
- setTimeout(function () {
18140
- vm.internal_eventsCalled[index] = false;
18141
- }, 0);
18142
18289
  return {
18143
18290
  mouseenter: function mouseenter() {
18144
18291
  vm.setHighlightedIndex(newIndex);
18145
18292
  },
18146
- // for browsers not supporting click event (e.g. firefox android)
18147
- mousedown: function mousedown(event) {
18148
- if (vm.internal_eventsCalled[index]) return;
18149
- vm.internal_eventsCalled[index] = true;
18150
- event.stopPropagation();
18151
- vm.selectItemAtIndex(newIndex);
18152
- },
18153
18293
  click: function click(event) {
18154
- if (vm.internal_eventsCalled[index]) return;
18155
- vm.internal_eventsCalled[index] = true;
18156
18294
  event.stopPropagation();
18157
18295
  vm.selectItemAtIndex(newIndex);
18158
18296
  }
@@ -18447,24 +18585,22 @@
18447
18585
 
18448
18586
  return __webpack_require__(0);
18449
18587
  /******/
18450
- }([
18451
- /* 0 */
18452
-
18453
- /***/
18454
-
18455
- /* 1 */
18456
-
18457
- /***/
18458
-
18459
- /* 2 */
18588
+ }
18589
+ /************************************************************************/
18460
18590
 
18461
- /***/
18591
+ /******/
18592
+ ([
18593
+ /* 0 */
18462
18594
 
18463
- /******/
18595
+ /***/
18464
18596
  function (module, exports, __webpack_require__) {
18465
18597
  module.exports = __webpack_require__(1);
18466
18598
  /***/
18467
- }, function (module, exports, __webpack_require__) {
18599
+ },
18600
+ /* 1 */
18601
+
18602
+ /***/
18603
+ function (module, exports, __webpack_require__) {
18468
18604
 
18469
18605
  Object.defineProperty(exports, "__esModule", {
18470
18606
  value: true
@@ -18497,7 +18633,11 @@
18497
18633
  }
18498
18634
  });
18499
18635
  /***/
18500
- }, function (module, exports) {
18636
+ },
18637
+ /* 2 */
18638
+
18639
+ /***/
18640
+ function (module, exports) {
18501
18641
 
18502
18642
  Object.defineProperty(exports, "__esModule", {
18503
18643
  value: true
@@ -18666,7 +18806,9 @@
18666
18806
  }
18667
18807
  /***/
18668
18808
 
18669
- }]);
18809
+ }
18810
+ /******/
18811
+ ]);
18670
18812
  });
18671
18813
  unwrapExports(dist);
18672
18814
  var dist_1 = dist.findAll;
@@ -18843,19 +18985,22 @@
18843
18985
  title = _this$suggestion.title,
18844
18986
  description = _this$suggestion.description,
18845
18987
  image = _this$suggestion.image,
18846
- isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion;
18988
+ isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
18989
+ _suggestion_type = _this$suggestion._suggestion_type,
18990
+ _category = _this$suggestion._category;
18847
18991
 
18848
18992
  if (label) {
18849
18993
  // label has highest precedence
18850
18994
  return typeof label === 'string' ? h("div", {
18851
18995
  "class": "trim"
18852
- }, [isPredictiveSuggestion ? h(PredictiveSuggestion, {
18996
+ }, [(_category ? false : isPredictiveSuggestion // eslint-disable-next-line
18997
+ || !!_suggestion_type) ? h(PredictiveSuggestion, {
18853
18998
  "domProps": {
18854
18999
  "innerHTML": label
18855
19000
  }
18856
19001
  }) : h(VueHighlightWords, {
18857
19002
  "attrs": {
18858
- "searchWords": this.currentValue.split(' '),
19003
+ "searchWords": _category ? [_category] : this.currentValue.split(' '),
18859
19004
  "textToHighlight": label,
18860
19005
  "autoEscape": true,
18861
19006
  "highlightStyle": highlightStyle
@@ -18924,17 +19069,22 @@
18924
19069
  };
18925
19070
 
18926
19071
  var SearchSvg = {
18927
- functional: true,
18928
- render: function render(h) {
19072
+ name: 'SearchSvg',
19073
+ props: ['styles'],
19074
+ render: function render() {
19075
+ var h = arguments[0];
18929
19076
  return h("svg", {
18930
19077
  "attrs": {
18931
19078
  "alt": "Search",
18932
- "height": "14",
18933
- "width": "10",
19079
+ "height": "12",
18934
19080
  "xmlns": "http://www.w3.org/2000/svg",
18935
19081
  "viewBox": "0 0 15 15"
18936
19082
  },
18937
- "class": "search-icon"
19083
+ "class": "search-icon",
19084
+ "style": _extends({
19085
+ transform: 'scale(1.35)',
19086
+ position: 'relative'
19087
+ }, this.$props.styles ? this.$props.styles : {})
18938
19088
  }, [h("title", ["Search"]), h("path", {
18939
19089
  "attrs": {
18940
19090
  "d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
@@ -19396,8 +19546,8 @@
19396
19546
  name: 'Mic',
19397
19547
  props: {
19398
19548
  children: types.title,
19399
- lang: types.string.def('en-US'),
19400
- iconPosition: types.string.def('left'),
19549
+ lang: VueTypes.string.def('en-US'),
19550
+ iconPosition: VueTypes.string.def('left'),
19401
19551
  handleResult: types.func,
19402
19552
  onNoMatch: types.func,
19403
19553
  onError: types.func,
@@ -19606,11 +19756,11 @@
19606
19756
  }, [this.customIcon]);
19607
19757
  }
19608
19758
 
19609
- if (this.$props.type === 'popular-search-icon') {
19759
+ if (this.$props.type === 'recent-search-icon') {
19610
19760
  return h("svg", {
19611
19761
  "attrs": {
19612
19762
  "xmlns": "http://www.w3.org/2000/svg",
19613
- "alt": "Popular Searches",
19763
+ "alt": "Recent Search",
19614
19764
  "height": "20",
19615
19765
  "width": "20",
19616
19766
  "viewBox": "0 0 24 24"
@@ -19626,14 +19776,36 @@
19626
19776
  }
19627
19777
  }), h("path", {
19628
19778
  "attrs": {
19629
- "d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
19779
+ "d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
19630
19780
  }
19631
19781
  })]);
19632
- } else {
19782
+ }
19783
+
19784
+ if (this.$props.type === 'promoted-search-icon') {
19785
+ return h("svg", {
19786
+ "attrs": {
19787
+ "xmlns": "http://www.w3.org/2000/svg",
19788
+ "width": "20",
19789
+ "alt": "promoted search",
19790
+ "height": "20",
19791
+ "viewBox": "0 0 24 24"
19792
+ },
19793
+ "class": this.$props.className,
19794
+ "style": {
19795
+ fill: '#707070'
19796
+ }
19797
+ }, [h("path", {
19798
+ "attrs": {
19799
+ "d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
19800
+ }
19801
+ })]);
19802
+ }
19803
+
19804
+ if (this.$props.type === 'popular-search-icon') {
19633
19805
  return h("svg", {
19634
19806
  "attrs": {
19635
19807
  "xmlns": "http://www.w3.org/2000/svg",
19636
- "alt": "Recent Searches",
19808
+ "alt": "Popular Search",
19637
19809
  "height": "20",
19638
19810
  "width": "20",
19639
19811
  "viewBox": "0 0 24 24"
@@ -19649,10 +19821,21 @@
19649
19821
  }
19650
19822
  }), h("path", {
19651
19823
  "attrs": {
19652
- "d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
19824
+ "d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
19653
19825
  }
19654
19826
  })]);
19655
19827
  }
19828
+
19829
+ return h(SearchSvg, {
19830
+ "attrs": {
19831
+ "styles": {
19832
+ position: 'relative',
19833
+ fill: '#707070',
19834
+ left: '3px',
19835
+ marginRight: '8px'
19836
+ }
19837
+ }
19838
+ });
19656
19839
  }
19657
19840
  };
19658
19841
 
@@ -19809,10 +19992,10 @@
19809
19992
  })]),
19810
19993
  aggregationField: types.string,
19811
19994
  aggregationSize: VueTypes.number,
19812
- size: VueTypes.number.def(10),
19995
+ size: VueTypes.number,
19813
19996
  debounce: VueTypes.number.def(0),
19814
19997
  defaultValue: types.string,
19815
- excludeFields: types.excludeFields.def([]),
19998
+ excludeFields: types.excludeFields,
19816
19999
  value: types.value,
19817
20000
  defaultSuggestions: types.suggestions,
19818
20001
  enableSynonyms: VueTypes.bool.def(true),
@@ -19826,9 +20009,9 @@
19826
20009
  highlightField: types.stringOrArray,
19827
20010
  icon: types.children,
19828
20011
  iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
19829
- includeFields: types.includeFields.def(['*']),
20012
+ includeFields: types.includeFields,
19830
20013
  innerClass: types.style,
19831
- innerRef: types.string.def('searchInputField'),
20014
+ innerRef: VueTypes.string.def('searchInputField'),
19832
20015
  render: types.func,
19833
20016
  renderQuerySuggestions: types.func,
19834
20017
  renderPopularSuggestions: types.func,
@@ -19860,7 +20043,7 @@
19860
20043
  focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
19861
20044
  addonBefore: VueTypes.any,
19862
20045
  addonAfter: VueTypes.any,
19863
- expandSuggestionsContainer: types.bool.def(true),
20046
+ expandSuggestionsContainer: VueTypes.bool.def(true),
19864
20047
  index: VueTypes.string
19865
20048
  },
19866
20049
  beforeMount: function beforeMount() {
@@ -20029,7 +20212,7 @@
20029
20212
  // returns size and aggs property
20030
20213
  getBasicQueryOptions: function getBasicQueryOptions() {
20031
20214
  var aggregationField = this.$props.aggregationField;
20032
- var queryOptions = helper_19(this.$props);
20215
+ var queryOptions = helper_20(this.$props);
20033
20216
 
20034
20217
  if (aggregationField) {
20035
20218
  queryOptions.aggs = getCompositeAggsQuery$1({
@@ -20135,7 +20318,7 @@
20135
20318
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
20136
20319
  }
20137
20320
 
20138
- this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions));
20321
+ this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), false);
20139
20322
  this.updateQuery({
20140
20323
  componentId: this.internalComponent,
20141
20324
  query: query,
@@ -20162,7 +20345,7 @@
20162
20345
 
20163
20346
  customQueryOptions = getOptionsFromQuery$1(customQueryTobeSet);
20164
20347
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
20165
- this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions));
20348
+ this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions), false);
20166
20349
  }
20167
20350
 
20168
20351
  if (!this.isPending) {
@@ -20521,7 +20704,7 @@
20521
20704
  highlightedIndex: highlightedIndex
20522
20705
  }), _this3.renderErrorComponent(), !_this3.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
20523
20706
  "class": suggestions$1(_this3.themePreset, theme) + " " + getClassName$3(_this3.$props.innerClass, 'list')
20524
- }, [_this3.suggestionsList.slice(0, size).map(function (item, index) {
20707
+ }, [_this3.suggestionsList.slice(0, size || 10).map(function (item, index) {
20525
20708
  return h("li", {
20526
20709
  "domProps": _extends({}, getItemProps({
20527
20710
  item: item
@@ -20896,77 +21079,1224 @@
20896
21079
 
20897
21080
  DataSearch.componentType = constants_1$1.dataSearch;
20898
21081
 
20899
- var _templateObject$j, _templateObject2$7, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$3;
20900
- var item = {
20901
- width: '15px',
20902
- height: '15px',
20903
- scale: '4px'
20904
- };
20905
- var vh = css(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n"])));
20906
- var hideInputControl = css(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n"])));
20907
-
20908
- var formItem = function formItem(_ref) {
20909
- var theme = _ref.theme;
20910
- return css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, curriedLighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
20911
- };
20912
-
20913
- var Radio = index$1('input')(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
20914
- return props.show ? null : hideInputControl;
20915
- }, function (_ref2) {
20916
- var theme = _ref2.theme;
20917
- return theme.colors.primaryColor;
20918
- }, function (_ref3) {
20919
- var theme = _ref3.theme;
20920
- return theme.colors.primaryColor;
20921
- });
20922
- var Checkbox = index$1('input')(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
20923
- return props.show ? null : hideInputControl;
20924
- }, item.width, item.width, item.width, item.height, function (_ref4) {
20925
- var theme = _ref4.theme;
20926
- return theme.colors.primaryColor;
20927
- }, function (_ref5) {
20928
- var theme = _ref5.theme;
20929
- return theme.colors.primaryColor;
20930
- });
20931
- var UL = index$1('ul')(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
20932
-
20933
- var getAggsOrder = lib_8.getAggsOrder;
20934
-
20935
- var extractQuery = function extractQuery(props) {
20936
- var queryToBeReturned = {};
20937
-
20938
- if (props.defaultQuery) {
20939
- var evaluateQuery = props.defaultQuery([], props);
20940
-
20941
- if (evaluateQuery) {
20942
- if (evaluateQuery.query) {
20943
- queryToBeReturned.query = evaluateQuery.query;
21082
+ var _templateObject$j;
21083
+ var AutofillSvgIcon = index$1('button')(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
21084
+ var AutoFillSvg = {
21085
+ name: 'AutoFillSvg',
21086
+ render: function render() {
21087
+ var h = arguments[0];
21088
+ return h(AutofillSvgIcon, {
21089
+ "on": {
21090
+ "click": this.$listeners.click
20944
21091
  }
20945
-
20946
- if (evaluateQuery.aggs) {
20947
- queryToBeReturned.aggs = evaluateQuery.aggs;
21092
+ }, [h("svg", {
21093
+ "attrs": {
21094
+ "viewBox": "0 0 24 24"
21095
+ }
21096
+ }, [h("path", {
21097
+ "attrs": {
21098
+ "d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
20948
21099
  }
21100
+ })])]);
21101
+ },
21102
+ methods: {
21103
+ clicked: function clicked(e) {
21104
+ e.stopPropagation();
21105
+ window.console.log('hey', e);
20949
21106
  }
20950
21107
  }
21108
+ };
20951
21109
 
20952
- return queryToBeReturned;
20953
- }; // eslint-disable-next-line import/prefer-default-export
20954
-
20955
-
20956
- var getAggsQuery = function getAggsQuery(query, props) {
20957
- var _clonedQuery$aggs;
20958
-
20959
- var clonedQuery = query;
20960
- var dataField = props.dataField,
20961
- size = props.size,
20962
- sortBy = props.sortBy,
20963
- showMissing = props.showMissing,
20964
- missingLabel = props.missingLabel;
20965
- clonedQuery.size = 0;
20966
- clonedQuery.aggs = (_clonedQuery$aggs = {}, _clonedQuery$aggs[dataField] = {
20967
- terms: _extends({
20968
- field: dataField,
20969
- size: size,
21110
+ var updateQuery$2 = lib_5.updateQuery,
21111
+ setCustomQuery$1 = lib_5.setCustomQuery,
21112
+ setDefaultQuery$2 = lib_5.setDefaultQuery,
21113
+ recordSuggestionClick$1 = lib_5.recordSuggestionClick;
21114
+ var _debounce = lib_8.debounce,
21115
+ checkValueChange$1 = lib_8.checkValueChange,
21116
+ getClassName$4 = lib_8.getClassName,
21117
+ isEqual$5 = lib_8.isEqual,
21118
+ getCompositeAggsQuery$2 = lib_8.getCompositeAggsQuery,
21119
+ withClickIds$1 = lib_8.withClickIds,
21120
+ getResultStats$2 = lib_8.getResultStats,
21121
+ normalizeDataField$1 = lib_8.normalizeDataField;
21122
+ var SearchBox = {
21123
+ name: 'SearchBox',
21124
+ data: function data() {
21125
+ var props = this.$props;
21126
+ this.__state = {
21127
+ currentValue: '',
21128
+ isOpen: false,
21129
+ normalizedSuggestions: []
21130
+ };
21131
+ this.internalComponent = props.componentId + "__internal";
21132
+ return this.__state;
21133
+ },
21134
+ inject: {
21135
+ theme: {
21136
+ from: 'theme_reactivesearch'
21137
+ }
21138
+ },
21139
+ created: function created() {
21140
+ var _this$$props = this.$props,
21141
+ distinctField = _this$$props.distinctField,
21142
+ distinctFieldConfig = _this$$props.distinctFieldConfig,
21143
+ index = _this$$props.index;
21144
+
21145
+ if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
21146
+ console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
21147
+ }
21148
+
21149
+ if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
21150
+ console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
21151
+ }
21152
+
21153
+ if (!this.enableAppbase && index) {
21154
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
21155
+ }
21156
+
21157
+ this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
21158
+ this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
21159
+ this.setValue(this.currentValue, true, this.$props, undefined, false, this.selectedCategory); // Set custom and default queries in store
21160
+
21161
+ this.triggerCustomQuery(this.currentValue, this.selectedCategory);
21162
+ this.triggerDefaultQuery(this.currentValue);
21163
+ },
21164
+ computed: {
21165
+ hasCustomRenderer: function hasCustomRenderer$1() {
21166
+ return hasCustomRenderer(this);
21167
+ },
21168
+ stats: function stats() {
21169
+ return getResultStats$2(this);
21170
+ }
21171
+ },
21172
+ props: {
21173
+ autoFocus: VueTypes.bool,
21174
+ autosuggest: VueTypes.bool.def(true),
21175
+ beforeValueChange: types.func,
21176
+ className: VueTypes.string.def(''),
21177
+ clearIcon: types.children,
21178
+ componentId: types.stringRequired,
21179
+ customHighlight: types.func,
21180
+ customQuery: types.func,
21181
+ defaultQuery: types.func,
21182
+ dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
21183
+ field: VueTypes.string,
21184
+ weight: VueTypes.number
21185
+ }), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
21186
+ field: VueTypes.string,
21187
+ weight: VueTypes.number
21188
+ })]),
21189
+ aggregationField: types.string,
21190
+ aggregationSize: VueTypes.number,
21191
+ size: VueTypes.number,
21192
+ debounce: VueTypes.number.def(0),
21193
+ defaultValue: types.string,
21194
+ excludeFields: types.excludeFields,
21195
+ value: types.value,
21196
+ defaultSuggestions: types.suggestions,
21197
+ enableSynonyms: VueTypes.bool.def(true),
21198
+ enableQuerySuggestions: VueTypes.bool.def(false),
21199
+ enablePopularSuggestions: VueTypes.bool.def(false),
21200
+ enableRecentSuggestions: VueTypes.bool.def(false),
21201
+ fieldWeights: types.fieldWeights,
21202
+ filterLabel: types.string,
21203
+ fuzziness: types.fuzziness,
21204
+ highlight: VueTypes.bool,
21205
+ highlightField: types.stringOrArray,
21206
+ icon: types.children,
21207
+ iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
21208
+ includeFields: types.includeFields,
21209
+ innerClass: types.style,
21210
+ innerRef: VueTypes.string.def('searchInputField'),
21211
+ render: types.func,
21212
+ renderNoSuggestion: types.title,
21213
+ renderError: types.title,
21214
+ placeholder: VueTypes.string.def('Search'),
21215
+ queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
21216
+ react: types.react,
21217
+ showClear: VueTypes.bool.def(true),
21218
+ showDistinctSuggestions: VueTypes.bool.def(true),
21219
+ showFilter: VueTypes.bool.def(true),
21220
+ showIcon: VueTypes.bool.def(true),
21221
+ title: types.title,
21222
+ theme: types.style,
21223
+ URLParams: VueTypes.bool.def(false),
21224
+ strictSelection: VueTypes.bool.def(false),
21225
+ nestedField: types.string,
21226
+ enablePredictiveSuggestions: VueTypes.bool.def(false),
21227
+ recentSearchesIcon: VueTypes.any,
21228
+ popularSearchesIcon: VueTypes.any,
21229
+ // mic props
21230
+ showVoiceSearch: VueTypes.bool.def(false),
21231
+ getMicInstance: types.func,
21232
+ renderMic: types.func,
21233
+ distinctField: types.string,
21234
+ distinctFieldConfig: types.props,
21235
+ //
21236
+ focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
21237
+ addonBefore: VueTypes.any,
21238
+ addonAfter: VueTypes.any,
21239
+ expandSuggestionsContainer: VueTypes.bool.def(true),
21240
+ index: VueTypes.string,
21241
+ popularSuggestionsConfig: VueTypes.object,
21242
+ recentSuggestionsConfig: VueTypes.object,
21243
+ applyStopwords: VueTypes.bool,
21244
+ customStopwords: types.stringArray,
21245
+ onData: types.func,
21246
+ renderItem: types.func
21247
+ },
21248
+ mounted: function mounted() {
21249
+ this.listenForFocusShortcuts();
21250
+ },
21251
+ watch: {
21252
+ dataField: function dataField(newVal, oldVal) {
21253
+ if (!isEqual$5(newVal, oldVal)) {
21254
+ this.triggerCustomQuery(this.$data.currentValue);
21255
+ }
21256
+ },
21257
+ fieldWeights: function fieldWeights() {
21258
+ this.triggerCustomQuery(this.$data.currentValue);
21259
+ },
21260
+ fuzziness: function fuzziness() {
21261
+ this.triggerCustomQuery(this.$data.currentValue);
21262
+ },
21263
+ queryFormat: function queryFormat() {
21264
+ this.triggerCustomQuery(this.$data.currentValue);
21265
+ },
21266
+ defaultValue: function defaultValue(newVal) {
21267
+ this.setValue(newVal, true, this.$props);
21268
+ },
21269
+ value: function value(newVal, oldVal) {
21270
+ if (!isEqual$5(newVal, oldVal)) {
21271
+ this.setValue(newVal, true, this.$props, newVal === '' ? lib_7.CLEAR_VALUE : undefined, false);
21272
+ }
21273
+ },
21274
+ defaultQuery: function defaultQuery(newVal, oldVal) {
21275
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
21276
+ this.triggerDefaultQuery(this.$data.currentValue);
21277
+ }
21278
+ },
21279
+ customQuery: function customQuery(newVal, oldVal) {
21280
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
21281
+ this.triggerCustomQuery(this.$data.currentValue);
21282
+ }
21283
+ },
21284
+ suggestions: function suggestions(newVal) {
21285
+ var suggestionsList = [];
21286
+
21287
+ if (Array.isArray(newVal) && newVal.length) {
21288
+ suggestionsList = [].concat(withClickIds$1(newVal));
21289
+ } else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
21290
+ suggestionsList = [].concat(withClickIds$1(this.$props.defaultSuggestions));
21291
+ }
21292
+
21293
+ this.normalizedSuggestions = suggestionsList;
21294
+ },
21295
+ selectedValue: function selectedValue(newVal, oldVal) {
21296
+ if (oldVal !== newVal && this.$data.currentValue !== newVal) {
21297
+ if (!newVal && this.$data.currentValue) {
21298
+ // selected value is cleared, call onValueSelected
21299
+ this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
21300
+ }
21301
+
21302
+ if (this.$props.value === undefined) {
21303
+ this.setValue(newVal || '', true, this.$props);
21304
+ }
21305
+ }
21306
+ },
21307
+ focusShortcuts: function focusShortcuts() {
21308
+ this.listenForFocusShortcuts();
21309
+ },
21310
+ rawData: function rawData(newVal) {
21311
+ this.$emit('on-data', {
21312
+ data: this.normalizedSuggestions,
21313
+ rawData: newVal,
21314
+ aggregationData: this.aggregationData,
21315
+ loading: this.isLoading,
21316
+ error: this.isError
21317
+ });
21318
+ },
21319
+ aggregationData: function aggregationData(newVal) {
21320
+ this.$emit('on-data', {
21321
+ data: this.normalizedSuggestions,
21322
+ rawData: this.rawData,
21323
+ aggregationData: newVal,
21324
+ loading: this.isLoading,
21325
+ error: this.isError
21326
+ });
21327
+ },
21328
+ loading: function loading(newVal) {
21329
+ this.$emit('on-data', {
21330
+ data: this.normalizedSuggestions,
21331
+ rawData: this.rawData,
21332
+ aggregationData: this.aggregationData,
21333
+ loading: newVal,
21334
+ error: this.isError
21335
+ });
21336
+ },
21337
+ error: function error(newVal) {
21338
+ this.$emit('on-data', {
21339
+ data: this.normalizedSuggestions,
21340
+ rawData: this.rawData,
21341
+ aggregationData: this.aggregationData,
21342
+ loading: this.isLoading,
21343
+ error: newVal
21344
+ });
21345
+ },
21346
+ debounce: function debounce(newVal, oldVal) {
21347
+ if (!isEqual$5(newVal, oldVal)) {
21348
+ this.handleTextChange = _debounce(this.handleText, newVal);
21349
+ }
21350
+ }
21351
+ },
21352
+ methods: {
21353
+ handleText: function handleText(value, cause) {
21354
+ if (cause === lib_7.CLEAR_VALUE) {
21355
+ this.triggerCustomQuery(value);
21356
+ this.triggerDefaultQuery(value);
21357
+ } else if (this.$props.autosuggest) {
21358
+ this.triggerDefaultQuery(value);
21359
+ } else {
21360
+ this.triggerCustomQuery(value);
21361
+ }
21362
+ },
21363
+ validateDataField: function validateDataField() {
21364
+ var propName = 'dataField';
21365
+ var componentName = SearchBox.name;
21366
+ var props = this.$props;
21367
+ var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
21368
+ var propValue = props[propName];
21369
+
21370
+ if (!this.enableAppbase) {
21371
+ if (!propValue) {
21372
+ console.error(requiredError);
21373
+ return;
21374
+ }
21375
+
21376
+ if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
21377
+ console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
21378
+ return;
21379
+ }
21380
+
21381
+ if (Array.isArray(propValue) && propValue.length === 0) {
21382
+ console.error(requiredError);
21383
+ }
21384
+ }
21385
+ },
21386
+ getComponent: function getComponent$1(downshiftProps) {
21387
+ if (downshiftProps === void 0) {
21388
+ downshiftProps = {};
21389
+ }
21390
+
21391
+ var currentValue = this.$data.currentValue;
21392
+ var data = {
21393
+ error: this.error,
21394
+ loading: this.isLoading,
21395
+ downshiftProps: downshiftProps,
21396
+ data: this.normalizedSuggestions,
21397
+ rawData: this.rawData,
21398
+ value: currentValue,
21399
+ resultStats: this.stats
21400
+ };
21401
+ return getComponent(data, this);
21402
+ },
21403
+ // returns size and aggs property
21404
+ getBasicQueryOptions: function getBasicQueryOptions() {
21405
+ var aggregationField = this.$props.aggregationField;
21406
+ var queryOptions = helper_20(this.$props);
21407
+
21408
+ if (aggregationField) {
21409
+ queryOptions.aggs = getCompositeAggsQuery$2({
21410
+ props: this.$props,
21411
+ showTopHits: true
21412
+ }).aggs;
21413
+ }
21414
+
21415
+ return queryOptions;
21416
+ },
21417
+ handleSearchIconClick: function handleSearchIconClick() {
21418
+ var currentValue = this.currentValue;
21419
+
21420
+ if (currentValue.trim()) {
21421
+ this.setValue(currentValue, true);
21422
+ this.onValueSelectedHandler(currentValue, lib_7.SEARCH_ICON_CLICK);
21423
+ }
21424
+ },
21425
+ setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
21426
+ var _this = this;
21427
+
21428
+ if (isDefaultValue === void 0) {
21429
+ isDefaultValue = false;
21430
+ }
21431
+
21432
+ if (props === void 0) {
21433
+ props = this.$props;
21434
+ }
21435
+
21436
+ if (toggleIsOpen === void 0) {
21437
+ toggleIsOpen = true;
21438
+ }
21439
+
21440
+ if (categoryValue === void 0) {
21441
+ categoryValue = undefined;
21442
+ }
21443
+
21444
+ var performUpdate = function performUpdate() {
21445
+ _this.currentValue = value;
21446
+
21447
+ if (isDefaultValue) {
21448
+ if (_this.$props.autosuggest) {
21449
+ if (toggleIsOpen) {
21450
+ _this.isOpen = false;
21451
+ }
21452
+
21453
+ _this.triggerDefaultQuery(value);
21454
+ } // in case of strict selection only SUGGESTION_SELECT should be able
21455
+ // to set the query otherwise the value should reset
21456
+
21457
+
21458
+ if (props.strictSelection) {
21459
+ if (cause === lib_7.SUGGESTION_SELECT || value === '') {
21460
+ _this.triggerCustomQuery(value, categoryValue);
21461
+ } else {
21462
+ _this.setValue('', true);
21463
+ }
21464
+ } else if (props.value === undefined) {
21465
+ _this.triggerCustomQuery(value, categoryValue);
21466
+ }
21467
+ } else {
21468
+ // debounce for handling text while typing
21469
+ _this.handleTextChange(value, cause);
21470
+ }
21471
+
21472
+ _this.$emit('valueChange', value);
21473
+
21474
+ _this.$emit('value-change', value);
21475
+ };
21476
+
21477
+ checkValueChange$1(props.componentId, value, props.beforeValueChange, performUpdate);
21478
+ },
21479
+ triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
21480
+ if (!this.$props.autosuggest) {
21481
+ return;
21482
+ }
21483
+
21484
+ var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
21485
+ var query = SearchBox.defaultQuery(value, this.$props);
21486
+
21487
+ if (this.defaultQuery) {
21488
+ var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
21489
+
21490
+ if (defaultQueryToBeSet.query) {
21491
+ query = defaultQueryToBeSet.query;
21492
+ } // Update calculated default query in store
21493
+
21494
+
21495
+ updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
21496
+ }
21497
+
21498
+ this.updateQuery({
21499
+ componentId: this.internalComponent,
21500
+ query: query,
21501
+ value: value,
21502
+ componentType: constants_1$1.searchBox
21503
+ });
21504
+ },
21505
+ triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
21506
+ if (categoryValue === void 0) {
21507
+ categoryValue = undefined;
21508
+ }
21509
+
21510
+ var _this$$props2 = this.$props,
21511
+ customQuery = _this$$props2.customQuery,
21512
+ filterLabel = _this$$props2.filterLabel,
21513
+ showFilter = _this$$props2.showFilter,
21514
+ URLParams = _this$$props2.URLParams;
21515
+ var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
21516
+ var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
21517
+ var query = defaultQueryTobeSet;
21518
+
21519
+ if (customQuery) {
21520
+ var customQueryTobeSet = customQuery(value, this.$props);
21521
+ var queryTobeSet = customQueryTobeSet.query;
21522
+
21523
+ if (queryTobeSet) {
21524
+ query = queryTobeSet;
21525
+ }
21526
+
21527
+ updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
21528
+ }
21529
+
21530
+ this.updateQuery({
21531
+ componentId: this.$props.componentId,
21532
+ query: query,
21533
+ value: value,
21534
+ label: filterLabel,
21535
+ showFilter: showFilter,
21536
+ URLParams: URLParams,
21537
+ componentType: constants_1$1.searchBox,
21538
+ category: categoryValue
21539
+ });
21540
+ },
21541
+ handleFocus: function handleFocus(event) {
21542
+ if (this.$props.autosuggest) {
21543
+ this.isOpen = true;
21544
+ }
21545
+
21546
+ this.$emit('focus', event);
21547
+ },
21548
+ handleVoiceResults: function handleVoiceResults(_ref) {
21549
+ var results = _ref.results;
21550
+
21551
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
21552
+ this.setValue(results[0][0].transcript.trim(), true);
21553
+ }
21554
+ },
21555
+ triggerQuery: function triggerQuery(_ref2) {
21556
+ var _ref2$isOpen = _ref2.isOpen,
21557
+ isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
21558
+ _ref2$customQuery = _ref2.customQuery,
21559
+ customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
21560
+ _ref2$defaultQuery = _ref2.defaultQuery,
21561
+ defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
21562
+ _ref2$value = _ref2.value,
21563
+ value = _ref2$value === void 0 ? undefined : _ref2$value,
21564
+ _ref2$categoryValue = _ref2.categoryValue,
21565
+ categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
21566
+
21567
+ if (typeof isOpen === 'boolean') {
21568
+ this.isOpen = isOpen;
21569
+ }
21570
+
21571
+ if (customQuery) {
21572
+ this.triggerCustomQuery(value, categoryValue);
21573
+ }
21574
+
21575
+ if (defaultQuery) {
21576
+ this.triggerDefaultQuery(value);
21577
+ }
21578
+ },
21579
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
21580
+ // click analytics would only work client side and after javascript loads
21581
+ var docId = documentId;
21582
+
21583
+ if (!docId) {
21584
+ var hitData = this.normalizedSuggestions.find(function (hit) {
21585
+ return hit._click_id === searchPosition;
21586
+ });
21587
+
21588
+ if (hitData && hitData.source && hitData.source._id) {
21589
+ docId = hitData.source._id;
21590
+ }
21591
+ }
21592
+
21593
+ this.recordSuggestionClick(searchPosition, docId);
21594
+ },
21595
+ clearValue: function clearValue() {
21596
+ this.setValue('', false, this.$props, lib_7.CLEAR_VALUE, false);
21597
+ this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
21598
+ },
21599
+ handleKeyDown: function handleKeyDown(event, highlightedIndex) {
21600
+ // if a suggestion was selected, delegate the handling to suggestion handler
21601
+ if (event.key === 'Enter' && highlightedIndex === null) {
21602
+ this.setValue(event.target.value, true);
21603
+ this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
21604
+ } // Need to review
21605
+
21606
+
21607
+ this.$emit('keyDown', event, this.triggerQuery);
21608
+ this.$emit('key-down', event, this.triggerQuery);
21609
+ },
21610
+ onInputChange: function onInputChange(e) {
21611
+ var _this2 = this;
21612
+
21613
+ var inputValue = e.target.value;
21614
+
21615
+ if (!this.$data.isOpen && this.$props.autosuggest) {
21616
+ this.isOpen = true;
21617
+ }
21618
+
21619
+ var value = this.$props.value;
21620
+
21621
+ if (value === undefined) {
21622
+ this.setValue(inputValue, false, this.$props, inputValue === '' ? lib_7.CLEAR_VALUE : undefined);
21623
+ } else {
21624
+ this.$emit('change', inputValue, function (_ref3) {
21625
+ var isOpen = _ref3.isOpen;
21626
+ return _this2.triggerQuery({
21627
+ defaultQuery: true,
21628
+ customQuery: true,
21629
+ value: inputValue,
21630
+ isOpen: isOpen
21631
+ });
21632
+ }, e);
21633
+ }
21634
+ },
21635
+ onSuggestionSelected: function onSuggestionSelected(suggestion) {
21636
+ var _this3 = this;
21637
+
21638
+ this.isOpen = false;
21639
+ var value = this.$props.value; // Record analytics for selected suggestions
21640
+
21641
+ this.triggerClickAnalytics(suggestion._click_id);
21642
+
21643
+ if (value === undefined) {
21644
+ this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT, false, suggestion._category);
21645
+ } else {
21646
+ this.$emit('change', suggestion.value, function (_ref4) {
21647
+ var isOpen = _ref4.isOpen;
21648
+ return _this3.triggerQuery({
21649
+ isOpen: isOpen,
21650
+ value: suggestion.value,
21651
+ categoryValue: suggestion._category
21652
+ });
21653
+ });
21654
+ }
21655
+
21656
+ this.onValueSelectedHandler(suggestion.value, lib_7.SUGGESTION_SELECT, suggestion.source);
21657
+ },
21658
+ onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
21659
+ if (currentValue === void 0) {
21660
+ currentValue = this.$data.currentValue;
21661
+ }
21662
+
21663
+ for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
21664
+ cause[_key - 1] = arguments[_key];
21665
+ }
21666
+
21667
+ this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
21668
+ this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
21669
+ },
21670
+ handleStateChange: function handleStateChange(changes) {
21671
+ var isOpen = changes.isOpen;
21672
+ this.isOpen = isOpen;
21673
+ },
21674
+ getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
21675
+ var isDark = this.themePreset === 'dark';
21676
+
21677
+ if (isDark) {
21678
+ return highlightedIndex === index ? '#555' : '#424242';
21679
+ }
21680
+
21681
+ return highlightedIndex === index ? '#eee' : '#fff';
21682
+ },
21683
+ renderIcon: function renderIcon() {
21684
+ var h = this.$createElement;
21685
+
21686
+ if (this.$props.showIcon) {
21687
+ return this.$props.icon || h(SearchSvg);
21688
+ }
21689
+
21690
+ return null;
21691
+ },
21692
+ renderErrorComponent: function renderErrorComponent() {
21693
+ var h = this.$createElement;
21694
+ var renderError = this.$scopedSlots.renderError || this.$props.renderError;
21695
+
21696
+ if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
21697
+ return h(SuggestionWrapper, {
21698
+ "attrs": {
21699
+ "innerClass": this.$props.innerClass,
21700
+ "innerClassName": "error",
21701
+ "theme": this.theme,
21702
+ "themePreset": this.themePreset
21703
+ }
21704
+ }, [isFunction$1(renderError) ? renderError(this.error) : renderError]);
21705
+ }
21706
+
21707
+ return null;
21708
+ },
21709
+ renderCancelIcon: function renderCancelIcon() {
21710
+ var h = this.$createElement;
21711
+
21712
+ if (this.$props.showClear) {
21713
+ return this.$props.clearIcon || h(CancelSvg);
21714
+ }
21715
+
21716
+ return null;
21717
+ },
21718
+ renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
21719
+ if (finalSuggestionsList === void 0) {
21720
+ finalSuggestionsList = [];
21721
+ }
21722
+
21723
+ var h = this.$createElement;
21724
+ var _this$$props3 = this.$props,
21725
+ theme = _this$$props3.theme,
21726
+ innerClass = _this$$props3.innerClass;
21727
+ var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
21728
+ var renderError = this.$scopedSlots.renderError || this.$props.renderError;
21729
+ var _this$$data = this.$data,
21730
+ isOpen = _this$$data.isOpen,
21731
+ currentValue = _this$$data.currentValue;
21732
+
21733
+ if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
21734
+ return h(SuggestionWrapper, {
21735
+ "attrs": {
21736
+ "innerClass": innerClass,
21737
+ "themePreset": this.themePreset,
21738
+ "theme": theme,
21739
+ "innerClassName": "noSuggestion"
21740
+ },
21741
+ "scopedSlots": {
21742
+ "default": function _default() {
21743
+ return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
21744
+ }
21745
+ }
21746
+ });
21747
+ }
21748
+
21749
+ return null;
21750
+ },
21751
+ renderInputAddonBefore: function renderInputAddonBefore() {
21752
+ var h = this.$createElement;
21753
+ var addonBefore = this.$scopedSlots.addonBefore;
21754
+
21755
+ if (addonBefore) {
21756
+ return h(InputAddon, [addonBefore()]);
21757
+ }
21758
+
21759
+ return null;
21760
+ },
21761
+ renderInputAddonAfter: function renderInputAddonAfter() {
21762
+ var h = this.$createElement;
21763
+ var addonAfter = this.$scopedSlots.addonAfter;
21764
+
21765
+ if (addonAfter) {
21766
+ return h(InputAddon, [addonAfter()]);
21767
+ }
21768
+
21769
+ return null;
21770
+ },
21771
+ renderIcons: function renderIcons() {
21772
+ var h = this.$createElement;
21773
+ var _this$$props4 = this.$props,
21774
+ iconPosition = _this$$props4.iconPosition,
21775
+ showClear = _this$$props4.showClear,
21776
+ innerClass = _this$$props4.innerClass,
21777
+ getMicInstance = _this$$props4.getMicInstance,
21778
+ showVoiceSearch = _this$$props4.showVoiceSearch,
21779
+ showIcon = _this$$props4.showIcon;
21780
+ var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
21781
+ var currentValue = this.$data.currentValue;
21782
+ return h("div", [h(IconGroup, {
21783
+ "attrs": {
21784
+ "groupPosition": "right",
21785
+ "positionType": "absolute"
21786
+ }
21787
+ }, [currentValue && showClear && h(IconWrapper, {
21788
+ "on": {
21789
+ "click": this.clearValue
21790
+ },
21791
+ "attrs": {
21792
+ "showIcon": showIcon,
21793
+ "isClearIcon": true
21794
+ }
21795
+ }, [this.renderCancelIcon()]), showVoiceSearch && h(Mic, {
21796
+ "attrs": {
21797
+ "getInstance": getMicInstance,
21798
+ "render": renderMic,
21799
+ "handleResult": this.handleVoiceResults,
21800
+ "className": getClassName$4(innerClass, 'mic') || null
21801
+ }
21802
+ }), iconPosition === 'right' && showIcon && h(IconWrapper, {
21803
+ "on": {
21804
+ "click": this.handleSearchIconClick
21805
+ }
21806
+ }, [this.renderIcon()])]), h(IconGroup, {
21807
+ "attrs": {
21808
+ "groupPosition": "left",
21809
+ "positionType": "absolute"
21810
+ }
21811
+ }, [iconPosition === 'left' && showIcon && h(IconWrapper, {
21812
+ "on": {
21813
+ "click": this.handleSearchIconClick
21814
+ }
21815
+ }, [this.renderIcon()])])]);
21816
+ },
21817
+ focusSearchBox: function focusSearchBox(event) {
21818
+ var _this$$refs, _this$$refs$this$$pro;
21819
+
21820
+ var elt = event.target || event.srcElement;
21821
+ var tagName = elt.tagName;
21822
+
21823
+ if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
21824
+ // already in an input
21825
+ return;
21826
+ }
21827
+
21828
+ (_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
21829
+ },
21830
+ listenForFocusShortcuts: function listenForFocusShortcuts() {
21831
+ var _this4 = this;
21832
+
21833
+ var _this$$props$focusSho = this.$props.focusShortcuts,
21834
+ focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
21835
+
21836
+ if (isEmpty(focusShortcuts)) {
21837
+ return;
21838
+ }
21839
+
21840
+ var shortcutsString = parseFocusShortcuts(focusShortcuts).join(','); // handler for alphabets and other key combinations
21841
+
21842
+ hotkeys(shortcutsString, // eslint-disable-next-line no-unused-vars
21843
+
21844
+ /* eslint-disable no-shadow */
21845
+ function (event, handler) {
21846
+ // Prevent the default refresh event under WINDOWS system
21847
+ event.preventDefault();
21848
+
21849
+ _this4.focusSearchBox(event);
21850
+ }); // if one of modifier keys are used, they are handled below
21851
+
21852
+ hotkeys('*', function (event) {
21853
+ var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
21854
+ if (modifierKeys.length === 0) return;
21855
+
21856
+ for (var index = 0; index < modifierKeys.length; index += 1) {
21857
+ var element = modifierKeys[index];
21858
+
21859
+ if (hotkeys[element]) {
21860
+ _this4.focusSearchBox(event);
21861
+
21862
+ break;
21863
+ }
21864
+ }
21865
+ });
21866
+ },
21867
+ onAutofillClick: function onAutofillClick(suggestion) {
21868
+ var value = suggestion.value;
21869
+ this.isOpen = true;
21870
+ this.currentValue = value;
21871
+ this.triggerDefaultQuery(value);
21872
+ },
21873
+ renderAutoFill: function renderAutoFill(suggestion) {
21874
+ var _this5 = this;
21875
+
21876
+ var h = this.$createElement;
21877
+
21878
+ var handleAutoFillClick = function handleAutoFillClick(e) {
21879
+ e.stopPropagation();
21880
+
21881
+ _this5.onAutofillClick(suggestion);
21882
+ };
21883
+ /* 👇 avoid showing autofill for category suggestions👇 */
21884
+
21885
+
21886
+ return suggestion._category ? null : h(AutoFillSvg, {
21887
+ "on": {
21888
+ "click": handleAutoFillClick
21889
+ }
21890
+ });
21891
+ }
21892
+ },
21893
+ render: function render() {
21894
+ var _this6 = this;
21895
+
21896
+ var h = arguments[0];
21897
+ var _this$$props5 = this.$props,
21898
+ theme = _this$$props5.theme,
21899
+ expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer;
21900
+ var _this$$scopedSlots = this.$scopedSlots,
21901
+ recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
21902
+ popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
21903
+ var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
21904
+ var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
21905
+ return h(Container, {
21906
+ "class": this.$props.className
21907
+ }, [this.$props.title && h(Title, {
21908
+ "class": getClassName$4(this.$props.innerClass, 'title') || ''
21909
+ }, [this.$props.title]), this.$props.autosuggest ? h(Downshift, {
21910
+ "attrs": {
21911
+ "id": this.$props.componentId + "-downshift",
21912
+ "handleChange": this.onSuggestionSelected,
21913
+ "handleMouseup": this.handleStateChange,
21914
+ "isOpen": this.$data.isOpen
21915
+ },
21916
+ "scopedSlots": {
21917
+ "default": function _default(_ref5) {
21918
+ var getInputEvents = _ref5.getInputEvents,
21919
+ getInputProps = _ref5.getInputProps,
21920
+ getItemProps = _ref5.getItemProps,
21921
+ getItemEvents = _ref5.getItemEvents,
21922
+ isOpen = _ref5.isOpen,
21923
+ highlightedIndex = _ref5.highlightedIndex,
21924
+ setHighlightedIndex = _ref5.setHighlightedIndex;
21925
+
21926
+ var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
21927
+ var getIcon = function getIcon(iconType) {
21928
+ switch (iconType) {
21929
+ case helper_1.Recent:
21930
+ return recentSearchesIcon;
21931
+
21932
+ case helper_1.Popular:
21933
+ return popularSearchesIcon;
21934
+
21935
+ default:
21936
+ return null;
21937
+ }
21938
+ };
21939
+
21940
+ return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
21941
+ isOpen: isOpen,
21942
+ getItemProps: getItemProps,
21943
+ getItemEvents: getItemEvents,
21944
+ highlightedIndex: highlightedIndex
21945
+ }), _this6.renderErrorComponent(), !_this6.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
21946
+ "class": suggestions$1(_this6.themePreset, theme) + " " + getClassName$4(_this6.$props.innerClass, 'list')
21947
+ }, [_this6.normalizedSuggestions.map(function (item, index) {
21948
+ return renderItem ? h("li", {
21949
+ "domProps": _extends({}, getItemProps({
21950
+ item: item
21951
+ })),
21952
+ "on": _extends({}, getItemEvents({
21953
+ item: item
21954
+ })),
21955
+ "key": index + 1 + "-" + item.value,
21956
+ "style": {
21957
+ backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
21958
+ justifyContent: 'flex-start',
21959
+ alignItems: 'center'
21960
+ }
21961
+ }, [renderItem(item)]) : h("li", {
21962
+ "domProps": _extends({}, getItemProps({
21963
+ item: item
21964
+ })),
21965
+ "on": _extends({}, getItemEvents({
21966
+ item: item
21967
+ })),
21968
+ "key": index + 1 + "-" + item.value,
21969
+ "style": {
21970
+ backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
21971
+ justifyContent: 'flex-start',
21972
+ alignItems: 'center'
21973
+ }
21974
+ }, [h("div", {
21975
+ "style": {
21976
+ padding: '0 10px 0 0',
21977
+ display: 'flex'
21978
+ }
21979
+ }, [h(CustomSvg, {
21980
+ "attrs": {
21981
+ "className": getClassName$4(_this6.$props.innerClass, item._suggestion_type + "-search-icon") || null,
21982
+ "icon": getIcon(item._suggestion_type),
21983
+ "type": item._suggestion_type + "-search-icon"
21984
+ }
21985
+ })]), h(SuggestionItem, {
21986
+ "attrs": {
21987
+ "currentValue": _this6.currentValue,
21988
+ "suggestion": item
21989
+ }
21990
+ }), _this6.renderAutoFill(item)]);
21991
+ })]) : _this6.renderNoSuggestions(_this6.normalizedSuggestions)]);
21992
+ };
21993
+
21994
+ return h("div", {
21995
+ "class": suggestionsContainer
21996
+ }, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
21997
+ "attrs": {
21998
+ "id": _this6.$props.componentId + "-input",
21999
+ "showIcon": _this6.$props.showIcon,
22000
+ "showClear": _this6.$props.showClear,
22001
+ "iconPosition": _this6.$props.iconPosition,
22002
+ "placeholder": _this6.$props.placeholder,
22003
+ "autoFocus": _this6.$props.autoFocus,
22004
+ "themePreset": _this6.themePreset,
22005
+ "autocomplete": "off"
22006
+ },
22007
+ "ref": _this6.$props.innerRef,
22008
+ "class": getClassName$4(_this6.$props.innerClass, 'input'),
22009
+ "on": _extends({}, getInputEvents({
22010
+ onInput: _this6.onInputChange,
22011
+ onBlur: function onBlur(e) {
22012
+ _this6.$emit('blur', e, _this6.triggerQuery);
22013
+ },
22014
+ onFocus: _this6.handleFocus,
22015
+ onKeyPress: function onKeyPress(e) {
22016
+ _this6.$emit('keyPress', e, _this6.triggerQuery);
22017
+
22018
+ _this6.$emit('key-press', e, _this6.triggerQuery);
22019
+ },
22020
+ onKeyDown: function onKeyDown(e) {
22021
+ return _this6.handleKeyDown(e, highlightedIndex);
22022
+ },
22023
+ onKeyUp: function onKeyUp(e) {
22024
+ _this6.$emit('keyUp', e, _this6.triggerQuery);
22025
+
22026
+ _this6.$emit('key-up', e, _this6.triggerQuery);
22027
+ },
22028
+ onClick: function onClick() {
22029
+ setHighlightedIndex(null);
22030
+ }
22031
+ })),
22032
+ "domProps": _extends({}, getInputProps({
22033
+ value: _this6.$data.currentValue === null ? '' : _this6.$data.currentValue
22034
+ }))
22035
+ }), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
22036
+ }
22037
+ }
22038
+ }) : h("div", {
22039
+ "class": suggestionsContainer
22040
+ }, [h(InputGroup, [this.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
22041
+ "class": getClassName$4(this.$props.innerClass, 'input') || '',
22042
+ "attrs": {
22043
+ "placeholder": this.$props.placeholder,
22044
+ "iconPosition": this.$props.iconPosition,
22045
+ "showIcon": this.$props.showIcon,
22046
+ "showClear": this.$props.showClear,
22047
+ "themePreset": this.themePreset
22048
+ },
22049
+ "on": _extends({}, {
22050
+ blur: function blur(e) {
22051
+ _this6.$emit('blur', e, _this6.triggerQuery);
22052
+ },
22053
+ keypress: function keypress(e) {
22054
+ _this6.$emit('keyPress', e, _this6.triggerQuery);
22055
+
22056
+ _this6.$emit('key-press', e, _this6.triggerQuery);
22057
+ },
22058
+ input: this.onInputChange,
22059
+ focus: function focus(e) {
22060
+ _this6.$emit('focus', e, _this6.triggerQuery);
22061
+ },
22062
+ keydown: function keydown(e) {
22063
+ _this6.$emit('keyDown', e, _this6.triggerQuery);
22064
+
22065
+ _this6.$emit('key-down', e, _this6.triggerQuery);
22066
+ },
22067
+ keyup: function keyup(e) {
22068
+ _this6.$emit('keyUp', e, _this6.triggerQuery);
22069
+
22070
+ _this6.$emit('key-up', e, _this6.triggerQuery);
22071
+ }
22072
+ }),
22073
+ "domProps": _extends({}, {
22074
+ autofocus: this.$props.autoFocus,
22075
+ value: this.$data.currentValue ? this.$data.currentValue : ''
22076
+ }),
22077
+ "ref": this.$props.innerRef
22078
+ }), this.renderIcons()]), this.renderInputAddonAfter()])])]);
22079
+ },
22080
+ destroyed: function destroyed() {
22081
+ document.removeEventListener('keydown', this.onKeyDown);
22082
+ }
22083
+ };
22084
+
22085
+ SearchBox.defaultQuery = function (value, props) {
22086
+ var finalQuery = null;
22087
+ var fields = normalizeDataField$1(props.dataField, props.fieldWeights);
22088
+ finalQuery = {
22089
+ bool: {
22090
+ should: SearchBox.shouldQuery(value, fields, props),
22091
+ minimum_should_match: '1'
22092
+ }
22093
+ };
22094
+
22095
+ if (finalQuery && props.nestedField) {
22096
+ return {
22097
+ query: {
22098
+ nested: {
22099
+ path: props.nestedField,
22100
+ query: finalQuery
22101
+ }
22102
+ }
22103
+ };
22104
+ }
22105
+
22106
+ return finalQuery;
22107
+ };
22108
+
22109
+ SearchBox.shouldQuery = function (value, dataFields, props) {
22110
+ var finalQuery = [];
22111
+ var phrasePrefixFields = [];
22112
+ var fields = dataFields.map(function (dataField) {
22113
+ var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
22114
+
22115
+ if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
22116
+ phrasePrefixFields.push(queryField);
22117
+ }
22118
+
22119
+ return queryField;
22120
+ });
22121
+
22122
+ if (props.searchOperators || props.queryString) {
22123
+ return {
22124
+ query: value,
22125
+ fields: fields,
22126
+ default_operator: props.queryFormat
22127
+ };
22128
+ }
22129
+
22130
+ if (props.queryFormat === 'and') {
22131
+ finalQuery.push({
22132
+ multi_match: {
22133
+ query: value,
22134
+ fields: fields,
22135
+ type: 'cross_fields',
22136
+ operator: 'and'
22137
+ }
22138
+ });
22139
+ finalQuery.push({
22140
+ multi_match: {
22141
+ query: value,
22142
+ fields: fields,
22143
+ type: 'phrase',
22144
+ operator: 'and'
22145
+ }
22146
+ });
22147
+
22148
+ if (phrasePrefixFields.length > 0) {
22149
+ finalQuery.push({
22150
+ multi_match: {
22151
+ query: value,
22152
+ fields: phrasePrefixFields,
22153
+ type: 'phrase_prefix',
22154
+ operator: 'and'
22155
+ }
22156
+ });
22157
+ }
22158
+
22159
+ return finalQuery;
22160
+ }
22161
+
22162
+ finalQuery.push({
22163
+ multi_match: {
22164
+ query: value,
22165
+ fields: fields,
22166
+ type: 'best_fields',
22167
+ operator: 'or',
22168
+ fuzziness: props.fuzziness ? props.fuzziness : 0
22169
+ }
22170
+ });
22171
+ finalQuery.push({
22172
+ multi_match: {
22173
+ query: value,
22174
+ fields: fields,
22175
+ type: 'phrase',
22176
+ operator: 'or'
22177
+ }
22178
+ });
22179
+
22180
+ if (phrasePrefixFields.length > 0) {
22181
+ finalQuery.push({
22182
+ multi_match: {
22183
+ query: value,
22184
+ fields: phrasePrefixFields,
22185
+ type: 'phrase_prefix',
22186
+ operator: 'or'
22187
+ }
22188
+ });
22189
+ }
22190
+
22191
+ return finalQuery;
22192
+ };
22193
+
22194
+ var mapStateToProps$4 = function mapStateToProps(state, props) {
22195
+ return {
22196
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
22197
+ selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
22198
+ suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
22199
+ rawData: state.rawData[props.componentId],
22200
+ aggregationData: state.compositeAggregations[props.componentId] || [],
22201
+ themePreset: state.config.themePreset,
22202
+ isLoading: !!state.isLoading[props.componentId + "_active"],
22203
+ error: state.error[props.componentId],
22204
+ enableAppbase: state.config.enableAppbase,
22205
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
22206
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
22207
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
22208
+ };
22209
+ };
22210
+
22211
+ var mapDispatchToProps$3 = {
22212
+ updateQuery: updateQuery$2,
22213
+ setCustomQuery: setCustomQuery$1,
22214
+ setDefaultQuery: setDefaultQuery$2,
22215
+ recordSuggestionClick: recordSuggestionClick$1
22216
+ };
22217
+ var DSConnected$1 = ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(SearchBox), {
22218
+ componentType: constants_1$1.searchBox,
22219
+ internalComponent: true
22220
+ });
22221
+
22222
+ SearchBox.install = function (Vue) {
22223
+ Vue.component(SearchBox.name, DSConnected$1);
22224
+ }; // Add componentType for SSR
22225
+
22226
+
22227
+ SearchBox.componentType = constants_1$1.searchBox;
22228
+
22229
+ var _templateObject$k, _templateObject2$7, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$3;
22230
+ var item = {
22231
+ width: '15px',
22232
+ height: '15px',
22233
+ scale: '4px'
22234
+ };
22235
+ var vh = css(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n"])));
22236
+ var hideInputControl = css(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n"])));
22237
+
22238
+ var formItem = function formItem(_ref) {
22239
+ var theme = _ref.theme;
22240
+ return css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, curriedLighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
22241
+ };
22242
+
22243
+ var Radio = index$1('input')(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
22244
+ return props.show ? null : hideInputControl;
22245
+ }, function (_ref2) {
22246
+ var theme = _ref2.theme;
22247
+ return theme.colors.primaryColor;
22248
+ }, function (_ref3) {
22249
+ var theme = _ref3.theme;
22250
+ return theme.colors.primaryColor;
22251
+ });
22252
+ var Checkbox = index$1('input')(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
22253
+ return props.show ? null : hideInputControl;
22254
+ }, item.width, item.width, item.width, item.height, function (_ref4) {
22255
+ var theme = _ref4.theme;
22256
+ return theme.colors.primaryColor;
22257
+ }, function (_ref5) {
22258
+ var theme = _ref5.theme;
22259
+ return theme.colors.primaryColor;
22260
+ });
22261
+ var UL = index$1('ul')(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
22262
+
22263
+ var getAggsOrder = lib_8.getAggsOrder;
22264
+
22265
+ var extractQuery = function extractQuery(props) {
22266
+ var queryToBeReturned = {};
22267
+
22268
+ if (props.defaultQuery) {
22269
+ var evaluateQuery = props.defaultQuery([], props);
22270
+
22271
+ if (evaluateQuery) {
22272
+ if (evaluateQuery.query) {
22273
+ queryToBeReturned.query = evaluateQuery.query;
22274
+ }
22275
+
22276
+ if (evaluateQuery.aggs) {
22277
+ queryToBeReturned.aggs = evaluateQuery.aggs;
22278
+ }
22279
+ }
22280
+ }
22281
+
22282
+ return queryToBeReturned;
22283
+ }; // eslint-disable-next-line import/prefer-default-export
22284
+
22285
+
22286
+ var getAggsQuery = function getAggsQuery(query, props) {
22287
+ var _clonedQuery$aggs;
22288
+
22289
+ var clonedQuery = query;
22290
+ var dataField = props.dataField,
22291
+ size = props.size,
22292
+ sortBy = props.sortBy,
22293
+ showMissing = props.showMissing,
22294
+ missingLabel = props.missingLabel;
22295
+ clonedQuery.size = 0;
22296
+ clonedQuery.aggs = (_clonedQuery$aggs = {}, _clonedQuery$aggs[dataField] = {
22297
+ terms: _extends({
22298
+ field: dataField,
22299
+ size: size,
20970
22300
  order: getAggsOrder(sortBy || 'count')
20971
22301
  }, showMissing ? {
20972
22302
  missing: missingLabel
@@ -20987,20 +22317,20 @@
20987
22317
  return _extends({}, clonedQuery, extractQuery(props));
20988
22318
  };
20989
22319
 
20990
- var updateQuery$2 = lib_5.updateQuery,
22320
+ var updateQuery$3 = lib_5.updateQuery,
20991
22321
  setQueryOptions$2 = lib_5.setQueryOptions,
20992
- setCustomQuery$1 = lib_5.setCustomQuery,
20993
- setDefaultQuery$2 = lib_5.setDefaultQuery;
22322
+ setCustomQuery$2 = lib_5.setCustomQuery,
22323
+ setDefaultQuery$3 = lib_5.setDefaultQuery;
20994
22324
  var getQueryOptions$1 = lib_8.getQueryOptions,
20995
- checkValueChange$1 = lib_8.checkValueChange,
20996
- getClassName$4 = lib_8.getClassName,
22325
+ checkValueChange$2 = lib_8.checkValueChange,
22326
+ getClassName$5 = lib_8.getClassName,
20997
22327
  getOptionsFromQuery$2 = lib_8.getOptionsFromQuery,
20998
- isEqual$5 = lib_8.isEqual;
22328
+ isEqual$6 = lib_8.isEqual;
20999
22329
  var SingleList = {
21000
22330
  name: 'SingleList',
21001
22331
  props: {
21002
22332
  beforeValueChange: types.func,
21003
- className: types.string.def(''),
22333
+ className: VueTypes.string.def(''),
21004
22334
  componentId: types.stringRequired,
21005
22335
  customQuery: types.func,
21006
22336
  dataField: types.stringRequired,
@@ -21020,7 +22350,7 @@
21020
22350
  showFilter: VueTypes.bool.def(true),
21021
22351
  showRadio: VueTypes.bool.def(true),
21022
22352
  showSearch: VueTypes.bool.def(true),
21023
- size: VueTypes.number.def(100),
22353
+ size: VueTypes.number,
21024
22354
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
21025
22355
  title: types.title,
21026
22356
  URLParams: VueTypes.bool.def(false),
@@ -21082,7 +22412,7 @@
21082
22412
  this.setValue(newVal);
21083
22413
  },
21084
22414
  value: function value(newVal, oldVal) {
21085
- if (!isEqual$5(newVal, oldVal)) {
22415
+ if (!isEqual$6(newVal, oldVal)) {
21086
22416
  this.setValue(newVal);
21087
22417
  }
21088
22418
  },
@@ -21134,7 +22464,7 @@
21134
22464
  var filteredItemsToRender = itemsToRender.filter(function (item) {
21135
22465
  if (String(item.key).length) {
21136
22466
  if (_this.$props.showSearch && _this.$data.searchTerm) {
21137
- return String(item.key).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
22467
+ return suggestions_1(String(item.key)).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
21138
22468
  }
21139
22469
 
21140
22470
  return true;
@@ -21145,14 +22475,14 @@
21145
22475
  return h(Container, {
21146
22476
  "class": this.$props.className
21147
22477
  }, [this.$props.title && h(Title, {
21148
- "class": getClassName$4(this.$props.innerClass, 'title') || ''
22478
+ "class": getClassName$5(this.$props.innerClass, 'title') || ''
21149
22479
  }, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
21150
- "class": getClassName$4(this.$props.innerClass, 'list') || ''
22480
+ "class": getClassName$5(this.$props.innerClass, 'list') || ''
21151
22481
  }, [selectAllLabel ? h("li", {
21152
22482
  "key": selectAllLabel,
21153
22483
  "class": "" + (this.$data.currentValue === selectAllLabel ? 'active' : '')
21154
22484
  }, [h(Radio, {
21155
- "class": getClassName$4(this.$props.innerClass, 'radio'),
22485
+ "class": getClassName$5(this.$props.innerClass, 'radio'),
21156
22486
  "attrs": {
21157
22487
  "id": this.$props.componentId + "-" + selectAllLabel,
21158
22488
  "name": this.$props.componentId,
@@ -21167,7 +22497,7 @@
21167
22497
  checked: this.$data.currentValue === selectAllLabel
21168
22498
  })
21169
22499
  }), h("label", {
21170
- "class": getClassName$4(this.$props.innerClass, 'label') || null,
22500
+ "class": getClassName$5(this.$props.innerClass, 'label') || null,
21171
22501
  "attrs": {
21172
22502
  "for": this.$props.componentId + "-" + selectAllLabel
21173
22503
  }
@@ -21176,7 +22506,7 @@
21176
22506
  "key": item.key,
21177
22507
  "class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
21178
22508
  }, [h(Radio, {
21179
- "class": getClassName$4(_this.$props.innerClass, 'radio'),
22509
+ "class": getClassName$5(_this.$props.innerClass, 'radio'),
21180
22510
  "attrs": {
21181
22511
  "id": _this.$props.componentId + "-" + item.key,
21182
22512
  "name": _this.$props.componentId,
@@ -21192,7 +22522,7 @@
21192
22522
  checked: _this.currentValue === String(item.key)
21193
22523
  })
21194
22524
  }), h("label", {
21195
- "class": getClassName$4(_this.$props.innerClass, 'label') || null,
22525
+ "class": getClassName$5(_this.$props.innerClass, 'label') || null,
21196
22526
  "attrs": {
21197
22527
  "for": _this.$props.componentId + "-" + item.key
21198
22528
  }
@@ -21201,7 +22531,7 @@
21201
22531
  count: item.doc_count,
21202
22532
  isChecked: _this.currentValue === String(item.key)
21203
22533
  }) : h("span", [item.key, _this.$props.showCount && h("span", {
21204
- "class": getClassName$4(_this.$props.innerClass, 'count') || null
22534
+ "class": getClassName$5(_this.$props.innerClass, 'count') || null
21205
22535
  }, ["\xA0(", item.doc_count, ")"])])])]);
21206
22536
  })])]);
21207
22537
  },
@@ -21229,7 +22559,7 @@
21229
22559
  _this2.$emit('value-change', value);
21230
22560
  };
21231
22561
 
21232
- checkValueChange$1(props.componentId, value, props.beforeValueChange, performUpdate);
22562
+ checkValueChange$2(props.componentId, value, props.beforeValueChange, performUpdate);
21233
22563
  },
21234
22564
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
21235
22565
  var defaultQueryOptions;
@@ -21247,7 +22577,7 @@
21247
22577
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
21248
22578
  }
21249
22579
 
21250
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
22580
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
21251
22581
  this.updateQuery({
21252
22582
  componentId: this.internalComponent,
21253
22583
  query: query,
@@ -21268,7 +22598,7 @@
21268
22598
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
21269
22599
  }
21270
22600
 
21271
- this.setQueryOptions(props.componentId, customQueryOptions);
22601
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
21272
22602
  this.updateQuery({
21273
22603
  componentId: props.componentId,
21274
22604
  query: query,
@@ -21303,7 +22633,7 @@
21303
22633
 
21304
22634
  if (this.$props.showSearch) {
21305
22635
  return h(Input, {
21306
- "class": getClassName$4(this.$props.innerClass, 'input') || '',
22636
+ "class": getClassName$5(this.$props.innerClass, 'input') || '',
21307
22637
  "on": {
21308
22638
  "input": this.handleInputChange
21309
22639
  },
@@ -21366,7 +22696,7 @@
21366
22696
  var h = this.$createElement;
21367
22697
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
21368
22698
  return h("p", {
21369
- "class": getClassName$4(this.$props.innerClass, 'noResults') || null
22699
+ "class": getClassName$5(this.$props.innerClass, 'noResults') || null
21370
22700
  }, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
21371
22701
  }
21372
22702
  },
@@ -21433,7 +22763,7 @@
21433
22763
  return query;
21434
22764
  };
21435
22765
 
21436
- var mapStateToProps$4 = function mapStateToProps(state, props) {
22766
+ var mapStateToProps$5 = function mapStateToProps(state, props) {
21437
22767
  return {
21438
22768
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
21439
22769
  rawData: state.rawData[props.componentId],
@@ -21448,11 +22778,11 @@
21448
22778
 
21449
22779
  var mapDispatchtoProps$2 = {
21450
22780
  setQueryOptions: setQueryOptions$2,
21451
- updateQuery: updateQuery$2,
21452
- setCustomQuery: setCustomQuery$1,
21453
- setDefaultQuery: setDefaultQuery$2
22781
+ updateQuery: updateQuery$3,
22782
+ setCustomQuery: setCustomQuery$2,
22783
+ setDefaultQuery: setDefaultQuery$3
21454
22784
  };
21455
- var ListConnected = ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchtoProps$2)(SingleList), {
22785
+ var ListConnected = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
21456
22786
  componentType: constants_1$1.singleList,
21457
22787
  internalComponent: true
21458
22788
  });
@@ -21464,14 +22794,14 @@
21464
22794
 
21465
22795
  SingleList.componentType = constants_1$1.singleList;
21466
22796
 
21467
- var updateQuery$3 = lib_5.updateQuery,
22797
+ var updateQuery$4 = lib_5.updateQuery,
21468
22798
  setQueryOptions$3 = lib_5.setQueryOptions,
21469
- setCustomQuery$2 = lib_5.setCustomQuery,
21470
- setDefaultQuery$3 = lib_5.setDefaultQuery;
21471
- var isEqual$6 = lib_8.isEqual,
22799
+ setCustomQuery$3 = lib_5.setCustomQuery,
22800
+ setDefaultQuery$4 = lib_5.setDefaultQuery;
22801
+ var isEqual$7 = lib_8.isEqual,
21472
22802
  getQueryOptions$2 = lib_8.getQueryOptions,
21473
- checkValueChange$2 = lib_8.checkValueChange,
21474
- getClassName$5 = lib_8.getClassName,
22803
+ checkValueChange$3 = lib_8.checkValueChange,
22804
+ getClassName$6 = lib_8.getClassName,
21475
22805
  getOptionsFromQuery$3 = lib_8.getOptionsFromQuery;
21476
22806
  var MultiList = {
21477
22807
  name: 'MultiList',
@@ -21481,7 +22811,7 @@
21481
22811
  queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
21482
22812
  showCheckbox: VueTypes.bool.def(true),
21483
22813
  beforeValueChange: types.func,
21484
- className: types.string.def(''),
22814
+ className: VueTypes.string.def(''),
21485
22815
  componentId: types.stringRequired,
21486
22816
  customQuery: types.func,
21487
22817
  dataField: types.stringRequired,
@@ -21531,13 +22861,14 @@
21531
22861
  },
21532
22862
  beforeMount: function beforeMount() {
21533
22863
  this.updateQueryHandlerOptions(this.$props);
22864
+ var value = this.selectedValue || this.$props.value || this.$props.defaultValue;
22865
+ this.setValue(value, !this.selectedValue);
22866
+ },
22867
+ mounted: function mounted() {
22868
+ var currentValue = Object.keys(this.$data.currentValue);
21534
22869
 
21535
- if (this.selectedValue) {
21536
- this.setValue(this.selectedValue);
21537
- } else if (this.$props.value) {
21538
- this.setValue(this.$props.value, true);
21539
- } else if (this.$props.defaultValue) {
21540
- this.setValue(this.$props.defaultValue, true);
22870
+ if (this.$props.value !== undefined && !isEqual$7(this.$props.value, currentValue)) {
22871
+ this.$emit('change', currentValue);
21541
22872
  }
21542
22873
  },
21543
22874
  watch: {
@@ -21557,12 +22888,12 @@
21557
22888
  this.updateQueryHandler(this.$data.currentValue, this.$props);
21558
22889
  },
21559
22890
  value: function value(newVal, oldVal) {
21560
- if (!isEqual$6(oldVal, newVal)) {
22891
+ if (!isEqual$7(oldVal, newVal)) {
21561
22892
  this.setValue(newVal, true);
21562
22893
  }
21563
22894
  },
21564
22895
  defaultValue: function defaultValue(newVal, oldVal) {
21565
- if (!isEqual$6(oldVal, newVal)) {
22896
+ if (!isEqual$7(oldVal, newVal)) {
21566
22897
  this.setValue(newVal, true);
21567
22898
  }
21568
22899
  },
@@ -21581,8 +22912,12 @@
21581
22912
  }
21582
22913
  }
21583
22914
 
21584
- if (!isEqual$6(selectedValue, newVal)) {
21585
- this.setValue(newVal || [], true);
22915
+ if (!isEqual$7(selectedValue, newVal)) {
22916
+ if (this.value === undefined) {
22917
+ this.setValue(newVal, true);
22918
+ } else {
22919
+ this.$emit('change', newVal);
22920
+ }
21586
22921
  }
21587
22922
  },
21588
22923
  defaultQuery: function defaultQuery(newVal, oldVal) {
@@ -21628,7 +22963,7 @@
21628
22963
  var filteredItemsToRender = itemsToRender.filter(function (item) {
21629
22964
  if (String(item.key).length) {
21630
22965
  if (_this2.$props.showSearch && _this2.$data.searchTerm) {
21631
- return String(item.key).toLowerCase().includes(_this2.$data.searchTerm.toLowerCase());
22966
+ return suggestions_1(String(item.key)).toLowerCase().includes(suggestions_1(_this2.$data.searchTerm).toLowerCase());
21632
22967
  }
21633
22968
 
21634
22969
  return true;
@@ -21639,9 +22974,9 @@
21639
22974
  return h(Container, {
21640
22975
  "class": this.$props.className
21641
22976
  }, [this.$props.title && h(Title, {
21642
- "class": getClassName$5(this.$props.innerClass, 'title')
22977
+ "class": getClassName$6(this.$props.innerClass, 'title')
21643
22978
  }, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
21644
- "class": getClassName$5(this.$props.innerClass, 'list')
22979
+ "class": getClassName$6(this.$props.innerClass, 'list')
21645
22980
  }, [selectAllLabel ? h("li", {
21646
22981
  "key": selectAllLabel,
21647
22982
  "class": "" + (this.currentValue[selectAllLabel] ? 'active' : '')
@@ -21653,7 +22988,7 @@
21653
22988
  "value": selectAllLabel,
21654
22989
  "show": this.$props.showCheckbox
21655
22990
  },
21656
- "class": getClassName$5(this.$props.innerClass, 'checkbox'),
22991
+ "class": getClassName$6(this.$props.innerClass, 'checkbox'),
21657
22992
  "on": {
21658
22993
  "click": this.handleClick
21659
22994
  },
@@ -21661,7 +22996,7 @@
21661
22996
  checked: !!this.currentValue[selectAllLabel]
21662
22997
  })
21663
22998
  }), h("label", {
21664
- "class": getClassName$5(this.$props.innerClass, 'label'),
22999
+ "class": getClassName$6(this.$props.innerClass, 'label'),
21665
23000
  "attrs": {
21666
23001
  "for": this.$props.componentId + "-" + selectAllLabel
21667
23002
  }
@@ -21677,7 +23012,7 @@
21677
23012
  "value": item.key,
21678
23013
  "show": _this2.$props.showCheckbox
21679
23014
  },
21680
- "class": getClassName$5(_this2.$props.innerClass, 'checkbox'),
23015
+ "class": getClassName$6(_this2.$props.innerClass, 'checkbox'),
21681
23016
  "on": {
21682
23017
  "click": _this2.handleClick
21683
23018
  },
@@ -21685,7 +23020,7 @@
21685
23020
  checked: !!_this2.$data.currentValue[item.key]
21686
23021
  })
21687
23022
  }), h("label", {
21688
- "class": getClassName$5(_this2.$props.innerClass, 'label'),
23023
+ "class": getClassName$6(_this2.$props.innerClass, 'label'),
21689
23024
  "attrs": {
21690
23025
  "for": _this2.$props.componentId + "-" + item.key
21691
23026
  }
@@ -21694,7 +23029,7 @@
21694
23029
  count: item.doc_count,
21695
23030
  isChecked: !!_this2.$data.currentValue[item.key]
21696
23031
  }) : h("span", [item.key, _this2.$props.showCount && h("span", {
21697
- "class": getClassName$5(_this2.$props.innerClass, 'count')
23032
+ "class": getClassName$6(_this2.$props.innerClass, 'count')
21698
23033
  }, ["\xA0(", item.doc_count, ")"])])])]);
21699
23034
  })])]);
21700
23035
  },
@@ -21778,7 +23113,7 @@
21778
23113
  _this3.$emit('value-change', finalValues);
21779
23114
  };
21780
23115
 
21781
- checkValueChange$2(props.componentId, finalValues, props.beforeValueChange, performUpdate);
23116
+ checkValueChange$3(props.componentId, finalValues, props.beforeValueChange, performUpdate);
21782
23117
  },
21783
23118
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
21784
23119
  var defaultQueryOptions;
@@ -21796,7 +23131,7 @@
21796
23131
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
21797
23132
  }
21798
23133
 
21799
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
23134
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
21800
23135
  this.updateQuery({
21801
23136
  componentId: this.internalComponent,
21802
23137
  query: query,
@@ -21817,7 +23152,7 @@
21817
23152
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
21818
23153
  }
21819
23154
 
21820
- this.setQueryOptions(props.componentId, customQueryOptions);
23155
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
21821
23156
  this.updateQuery({
21822
23157
  componentId: props.componentId,
21823
23158
  query: query,
@@ -21852,7 +23187,7 @@
21852
23187
 
21853
23188
  if (this.$props.showSearch) {
21854
23189
  return h(Input, {
21855
- "class": getClassName$5(this.$props.innerClass, 'input') || '',
23190
+ "class": getClassName$6(this.$props.innerClass, 'input') || '',
21856
23191
  "on": {
21857
23192
  "input": this.handleInputChange
21858
23193
  },
@@ -21881,7 +23216,7 @@
21881
23216
  if (value === undefined) {
21882
23217
  this.setValue(currentValue);
21883
23218
  } else {
21884
- var values = parseValueArray(value, currentValue);
23219
+ var values = parseValueArray(value || [], currentValue);
21885
23220
  this.$emit('change', values);
21886
23221
  }
21887
23222
  },
@@ -21910,7 +23245,7 @@
21910
23245
  var h = this.$createElement;
21911
23246
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
21912
23247
  return h("p", {
21913
- "class": getClassName$5(this.$props.innerClass, 'noResults') || null
23248
+ "class": getClassName$6(this.$props.innerClass, 'noResults') || null
21914
23249
  }, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
21915
23250
  }
21916
23251
  },
@@ -22011,7 +23346,7 @@
22011
23346
  return getAggsQuery(queryOptions, props);
22012
23347
  };
22013
23348
 
22014
- var mapStateToProps$5 = function mapStateToProps(state, props) {
23349
+ var mapStateToProps$6 = function mapStateToProps(state, props) {
22015
23350
  return {
22016
23351
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
22017
23352
  rawData: state.rawData[props.componentId],
@@ -22026,11 +23361,11 @@
22026
23361
 
22027
23362
  var mapDispatchtoProps$3 = {
22028
23363
  setQueryOptions: setQueryOptions$3,
22029
- updateQuery: updateQuery$3,
22030
- setCustomQuery: setCustomQuery$2,
22031
- setDefaultQuery: setDefaultQuery$3
23364
+ updateQuery: updateQuery$4,
23365
+ setCustomQuery: setCustomQuery$3,
23366
+ setDefaultQuery: setDefaultQuery$4
22032
23367
  };
22033
- var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$3)(MultiList), {
23368
+ var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
22034
23369
  componentType: constants_1$1.multiList,
22035
23370
  internalComponent: true
22036
23371
  });
@@ -22042,8 +23377,8 @@
22042
23377
 
22043
23378
  MultiList.componentType = constants_1$1.multiList;
22044
23379
 
22045
- var _templateObject$k, _templateObject2$8, _templateObject3$7, _templateObject4$6;
22046
- var small = css(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"])));
23380
+ var _templateObject$l, _templateObject2$8, _templateObject3$7, _templateObject4$6;
23381
+ var small = css(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"])));
22047
23382
 
22048
23383
  var dark$2 = function dark(_ref) {
22049
23384
  var theme = _ref.theme;
@@ -22061,13 +23396,13 @@
22061
23396
  return theme.colors.primaryColor;
22062
23397
  });
22063
23398
 
22064
- var _templateObject$l, _templateObject2$9;
22065
- var open = css(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
23399
+ var _templateObject$m, _templateObject2$9;
23400
+ var open = css(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
22066
23401
  var Chevron = index$1('span')(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
22067
23402
  return props.open ? open : null;
22068
23403
  });
22069
23404
 
22070
- var getClassName$6 = lib_8.getClassName;
23405
+ var getClassName$7 = lib_8.getClassName;
22071
23406
  var Dropdown = {
22072
23407
  data: function data() {
22073
23408
  this.__state = {
@@ -22102,7 +23437,9 @@
22102
23437
  single: VueTypes.bool,
22103
23438
  small: VueTypes.bool.def(false),
22104
23439
  themePreset: types.themePreset,
22105
- showSearch: VueTypes.bool
23440
+ showSearch: VueTypes.bool,
23441
+ showClear: VueTypes.bool,
23442
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
22106
23443
  },
22107
23444
  render: function render() {
22108
23445
  var _this = this;
@@ -22130,7 +23467,7 @@
22130
23467
  var filteredItemsToRender = itemsToRender.filter(function (item) {
22131
23468
  if (String(item[labelField]).length) {
22132
23469
  if (_this.$props.showSearch && _this.$data.searchTerm) {
22133
- return String(item[labelField]).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
23470
+ return suggestions_1(String(item[labelField])).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
22134
23471
  }
22135
23472
 
22136
23473
  return true;
@@ -22151,14 +23488,15 @@
22151
23488
  isOpen = _ref.isOpen,
22152
23489
  highlightedIndex = _ref.highlightedIndex,
22153
23490
  getButtonProps = _ref.getButtonProps,
22154
- getItemEvents = _ref.getItemEvents;
23491
+ getItemEvents = _ref.getItemEvents,
23492
+ getInputEvents = _ref.getInputEvents;
22155
23493
  return h("div", {
22156
23494
  "class": suggestionsContainer
22157
23495
  }, [h(Select, {
22158
23496
  "on": _extends({}, _extends({}, getButtonProps({
22159
23497
  onClick: _this.toggle
22160
23498
  }))),
22161
- "class": getClassName$6(_this.$props.innerClass, 'select') || '',
23499
+ "class": getClassName$7(_this.$props.innerClass, 'select') || '',
22162
23500
  "attrs": {
22163
23501
  "title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
22164
23502
  "small": _this.$props.small,
@@ -22175,26 +23513,17 @@
22175
23513
  getButtonProps: getButtonProps,
22176
23514
  getItemEvents: getItemEvents
22177
23515
  }) : isOpen && itemsToRender.length ? h("ul", {
22178
- "class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$6(_this.$props.innerClass, 'list')
22179
- }, [_this.$props.showSearch ? h(Input, {
22180
- "attrs": {
22181
- "id": _this.$props.componentId + "-input",
22182
- "showIcon": false,
22183
- "placeholder": "Type here to search...",
22184
- "value": _this.$data.searchTerm,
22185
- "themePreset": themePreset
22186
- },
22187
- "style": {
22188
- border: 0,
22189
- borderBottom: '1px solid #ddd'
22190
- },
22191
- "class": getClassName$6(_this.$props.innerClass, 'input'),
22192
- "on": {
22193
- "change": _this.handleInputChange
23516
+ "class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$7(_this.$props.innerClass, 'list')
23517
+ }, [_this.$props.showSearch ? _this.renderSearchbox({
23518
+ on: {
23519
+ input: getInputEvents({
23520
+ onInput: _this.handleInputChange
23521
+ }).input
22194
23522
  }
22195
23523
  }) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
22196
23524
  var selected = _this.$props.multi // MultiDropdownList
22197
- && (selectedItem && !!selectedItem[item[keyField]] || Array.isArray(selectedItem) && selectedItem.find(function (value) {
23525
+ && (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
23526
+ || Array.isArray(selectedItem) && selectedItem.find(function (value) {
22198
23527
  return value[labelField] === item[labelField];
22199
23528
  }));
22200
23529
  if (!_this.$props.multi) selected = item.key === selectedItem;
@@ -22219,9 +23548,9 @@
22219
23548
  "innerHTML": item[labelField]
22220
23549
  }
22221
23550
  }) : item[labelField], _this.$props.showCount && item.doc_count && h("span", {
22222
- "class": getClassName$6(_this.$props.innerClass, 'count') || ''
23551
+ "class": getClassName$7(_this.$props.innerClass, 'count') || ''
22223
23552
  }, ["\xA0(", item.doc_count, ")"])]), selected && _this.$props.multi ? h(Tick, {
22224
- "class": getClassName$6(_this.$props.innerClass, 'icon') || ''
23553
+ "class": getClassName$7(_this.$props.innerClass, 'icon') || ''
22225
23554
  }) : null]);
22226
23555
  }), footer]) : null]);
22227
23556
  }
@@ -22244,6 +23573,7 @@
22244
23573
 
22245
23574
  if (!this.$props.multi) {
22246
23575
  this.isOpen = false;
23576
+ this.searchTerm = '';
22247
23577
  }
22248
23578
  },
22249
23579
  handleStateChange: function handleStateChange(_ref2) {
@@ -22267,6 +23597,9 @@
22267
23597
  var value = e.target.value;
22268
23598
  this.searchTerm = value;
22269
23599
  },
23600
+ clearSearchTerm: function clearSearchTerm() {
23601
+ this.searchTerm = '';
23602
+ },
22270
23603
  renderToString: function renderToString(value) {
22271
23604
  var _this2 = this;
22272
23605
 
@@ -22305,23 +23638,65 @@
22305
23638
  var h = this.$createElement;
22306
23639
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
22307
23640
  return h("p", {
22308
- "class": getClassName$6(this.$props.innerClass, 'noResults') || null
23641
+ "class": getClassName$7(this.$props.innerClass, 'noResults') || null
22309
23642
  }, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
23643
+ },
23644
+ renderSearchbox: function renderSearchbox(eventObject) {
23645
+ var h = this.$createElement;
23646
+ var _this$$props2 = this.$props,
23647
+ componentId = _this$$props2.componentId,
23648
+ searchPlaceholder = _this$$props2.searchPlaceholder,
23649
+ showClear = _this$$props2.showClear,
23650
+ themePreset = _this$$props2.themePreset,
23651
+ innerClass = _this$$props2.innerClass;
23652
+ var InputComponent = h(Input, helper$1([{
23653
+ "attrs": {
23654
+ "id": componentId + "-input",
23655
+ "showIcon": false,
23656
+ "showClear": showClear,
23657
+ "placeholder": searchPlaceholder,
23658
+ "value": this.$data.searchTerm,
23659
+ "themePreset": themePreset
23660
+ },
23661
+ "style": {
23662
+ border: 0,
23663
+ borderBottom: '1px solid #ddd'
23664
+ },
23665
+ "class": getClassName$7(innerClass, 'input')
23666
+ }, eventObject]));
23667
+
23668
+ if (showClear) {
23669
+ return h(InputWrapper, [InputComponent, this.searchTerm && h(IconGroup, {
23670
+ "attrs": {
23671
+ "groupPosition": "right",
23672
+ "positionType": "absolute"
23673
+ }
23674
+ }, [h(IconWrapper, {
23675
+ "on": {
23676
+ "click": this.clearSearchTerm
23677
+ },
23678
+ "attrs": {
23679
+ "isClearIcon": true
23680
+ }
23681
+ }, [h(CancelSvg)])])]);
23682
+ }
23683
+
23684
+ return InputComponent;
22310
23685
  }
22311
23686
  }
22312
23687
  };
22313
23688
 
22314
- var updateQuery$4 = lib_5.updateQuery,
23689
+ var updateQuery$5 = lib_5.updateQuery,
22315
23690
  setQueryOptions$4 = lib_5.setQueryOptions,
22316
- setCustomQuery$3 = lib_5.setCustomQuery,
22317
- setDefaultQuery$4 = lib_5.setDefaultQuery;
23691
+ setCustomQuery$4 = lib_5.setCustomQuery,
23692
+ setDefaultQuery$5 = lib_5.setDefaultQuery;
22318
23693
  var getQueryOptions$3 = lib_8.getQueryOptions,
22319
- checkValueChange$3 = lib_8.checkValueChange,
23694
+ checkValueChange$4 = lib_8.checkValueChange,
22320
23695
  checkPropChange$1 = lib_8.checkPropChange,
22321
- getClassName$7 = lib_8.getClassName,
23696
+ getClassName$8 = lib_8.getClassName,
22322
23697
  getOptionsFromQuery$4 = lib_8.getOptionsFromQuery,
22323
- isEqual$7 = lib_8.isEqual,
22324
- getCompositeAggsQuery$2 = lib_8.getCompositeAggsQuery;
23698
+ isEqual$8 = lib_8.isEqual,
23699
+ getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery;
22325
23700
  var SingleDropdownList = {
22326
23701
  name: 'SingleDropdownList',
22327
23702
  data: function data() {
@@ -22365,10 +23740,12 @@
22365
23740
  showMissing: VueTypes.bool.def(false),
22366
23741
  missingLabel: VueTypes.string.def('N/A'),
22367
23742
  showSearch: VueTypes.bool.def(false),
23743
+ showClear: VueTypes.bool.def(false),
22368
23744
  showLoadMore: VueTypes.bool.def(false),
22369
23745
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
22370
23746
  nestedField: types.string,
22371
- index: VueTypes.string
23747
+ index: VueTypes.string,
23748
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
22372
23749
  },
22373
23750
  created: function created() {
22374
23751
  if (!this.enableAppbase && this.$props.index) {
@@ -22440,7 +23817,7 @@
22440
23817
  this.setValue(newVal);
22441
23818
  },
22442
23819
  value: function value(newVal, oldVal) {
22443
- if (!isEqual$7(newVal, oldVal)) {
23820
+ if (!isEqual$8(newVal, oldVal)) {
22444
23821
  this.setValue(newVal);
22445
23822
  }
22446
23823
  },
@@ -22482,7 +23859,9 @@
22482
23859
  if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
22483
23860
  if (renderNoResults && isFunction$1(renderNoResults)) {
22484
23861
  return h("div", [renderNoResults()]);
22485
- } else if (renderNoResults && !isFunction$1(renderNoResults)) {
23862
+ }
23863
+
23864
+ if (renderNoResults && !isFunction$1(renderNoResults)) {
22486
23865
  return renderNoResults;
22487
23866
  }
22488
23867
 
@@ -22498,7 +23877,7 @@
22498
23877
  return h(Container, {
22499
23878
  "class": this.$props.className
22500
23879
  }, [this.$props.title && h(Title, {
22501
- "class": getClassName$7(this.$props.innerClass, 'title') || ''
23880
+ "class": getClassName$8(this.$props.innerClass, 'title') || ''
22502
23881
  }, [this.$props.title]), h(Dropdown, {
22503
23882
  "attrs": {
22504
23883
  "innerClass": this.$props.innerClass,
@@ -22520,6 +23899,8 @@
22520
23899
  "renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
22521
23900
  "themePreset": this.themePreset,
22522
23901
  "showSearch": this.$props.showSearch,
23902
+ "showClear": this.$props.showClear,
23903
+ "searchPlaceholder": this.$props.searchPlaceholder,
22523
23904
  "transformData": this.$props.transformData,
22524
23905
  "footer": showLoadMore && !isLastBucket && h("div", {
22525
23906
  "attrs": {
@@ -22552,7 +23933,7 @@
22552
23933
  _this2.$emit('value-change', value);
22553
23934
  };
22554
23935
 
22555
- checkValueChange$3(props.componentId, value, props.beforeValueChange, performUpdate);
23936
+ checkValueChange$4(props.componentId, value, props.beforeValueChange, performUpdate);
22556
23937
  },
22557
23938
  handleChange: function handleChange(item) {
22558
23939
  var value = this.$props.value;
@@ -22579,7 +23960,7 @@
22579
23960
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
22580
23961
  }
22581
23962
 
22582
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
23963
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
22583
23964
  this.updateQuery({
22584
23965
  componentId: this.internalComponent,
22585
23966
  query: query,
@@ -22600,7 +23981,7 @@
22600
23981
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
22601
23982
  }
22602
23983
 
22603
- this.setQueryOptions(props.componentId, customQueryOptions);
23984
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
22604
23985
  this.updateQuery({
22605
23986
  componentId: props.componentId,
22606
23987
  query: query,
@@ -22613,7 +23994,7 @@
22613
23994
  },
22614
23995
  generateQueryOptions: function generateQueryOptions(props, after) {
22615
23996
  var queryOptions = getQueryOptions$3(props);
22616
- return props.showLoadMore ? getCompositeAggsQuery$2({
23997
+ return props.showLoadMore ? getCompositeAggsQuery$3({
22617
23998
  query: queryOptions,
22618
23999
  props: props,
22619
24000
  after: after
@@ -22719,14 +24100,14 @@
22719
24100
 
22720
24101
  SingleDropdownList.generateQueryOptions = function (props, after) {
22721
24102
  var queryOptions = getQueryOptions$3(props);
22722
- return props.showLoadMore ? getCompositeAggsQuery$2({
24103
+ return props.showLoadMore ? getCompositeAggsQuery$3({
22723
24104
  query: queryOptions,
22724
24105
  props: props,
22725
24106
  after: after
22726
24107
  }) : getAggsQuery(queryOptions, props);
22727
24108
  };
22728
24109
 
22729
- var mapStateToProps$6 = function mapStateToProps(state, props) {
24110
+ var mapStateToProps$7 = function mapStateToProps(state, props) {
22730
24111
  return {
22731
24112
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
22732
24113
  rawData: state.rawData[props.componentId],
@@ -22741,11 +24122,11 @@
22741
24122
 
22742
24123
  var mapDispatchtoProps$4 = {
22743
24124
  setQueryOptions: setQueryOptions$4,
22744
- updateQuery: updateQuery$4,
22745
- setCustomQuery: setCustomQuery$3,
22746
- setDefaultQuery: setDefaultQuery$4
24125
+ updateQuery: updateQuery$5,
24126
+ setCustomQuery: setCustomQuery$4,
24127
+ setDefaultQuery: setDefaultQuery$5
22747
24128
  };
22748
- var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$4)(SingleDropdownList), {
24129
+ var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
22749
24130
  componentType: constants_1$1.singleDropdownList,
22750
24131
  internalComponent: true
22751
24132
  });
@@ -22757,17 +24138,17 @@
22757
24138
 
22758
24139
  SingleDropdownList.componentType = constants_1$1.singleDropdownList;
22759
24140
 
22760
- var updateQuery$5 = lib_5.updateQuery,
24141
+ var updateQuery$6 = lib_5.updateQuery,
22761
24142
  setQueryOptions$5 = lib_5.setQueryOptions,
22762
- setCustomQuery$4 = lib_5.setCustomQuery,
22763
- setDefaultQuery$5 = lib_5.setDefaultQuery;
22764
- var isEqual$8 = lib_8.isEqual,
24143
+ setCustomQuery$5 = lib_5.setCustomQuery,
24144
+ setDefaultQuery$6 = lib_5.setDefaultQuery;
24145
+ var isEqual$9 = lib_8.isEqual,
22765
24146
  getQueryOptions$4 = lib_8.getQueryOptions,
22766
- checkValueChange$4 = lib_8.checkValueChange,
24147
+ checkValueChange$5 = lib_8.checkValueChange,
22767
24148
  checkPropChange$2 = lib_8.checkPropChange,
22768
- getClassName$8 = lib_8.getClassName,
24149
+ getClassName$9 = lib_8.getClassName,
22769
24150
  getOptionsFromQuery$5 = lib_8.getOptionsFromQuery,
22770
- getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery;
24151
+ getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery;
22771
24152
  var MultiDropdownList = {
22772
24153
  name: 'MultiDropdownList',
22773
24154
  data: function data() {
@@ -22812,10 +24193,12 @@
22812
24193
  showMissing: VueTypes.bool.def(false),
22813
24194
  missingLabel: VueTypes.string.def('N/A'),
22814
24195
  showSearch: VueTypes.bool.def(false),
24196
+ showClear: VueTypes.bool.def(false),
22815
24197
  showLoadMore: VueTypes.bool.def(false),
22816
24198
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
22817
24199
  nestedField: types.string,
22818
- index: VueTypes.string
24200
+ index: VueTypes.string,
24201
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
22819
24202
  },
22820
24203
  created: function created() {
22821
24204
  if (!this.enableAppbase && this.$props.index) {
@@ -22855,7 +24238,7 @@
22855
24238
  }
22856
24239
  }
22857
24240
 
22858
- if (!isEqual$8(selectedValue, newVal)) {
24241
+ if (!isEqual$9(selectedValue, newVal)) {
22859
24242
  this.setValue(newVal || [], true);
22860
24243
  }
22861
24244
  },
@@ -22906,7 +24289,7 @@
22906
24289
  this.setValue(newVal, true);
22907
24290
  },
22908
24291
  value: function value(newVal, oldVal) {
22909
- if (!isEqual$8(newVal, oldVal)) {
24292
+ if (!isEqual$9(newVal, oldVal)) {
22910
24293
  this.setValue(newVal, true);
22911
24294
  }
22912
24295
  },
@@ -22943,7 +24326,9 @@
22943
24326
  if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
22944
24327
  if (renderNoResults && isFunction$1(renderNoResults)) {
22945
24328
  return h("div", [renderNoResults()]);
22946
- } else if (renderNoResults && !isFunction$1(renderNoResults)) {
24329
+ }
24330
+
24331
+ if (renderNoResults && !isFunction$1(renderNoResults)) {
22947
24332
  return renderNoResults;
22948
24333
  }
22949
24334
 
@@ -22959,7 +24344,7 @@
22959
24344
  return h(Container, {
22960
24345
  "class": this.$props.className
22961
24346
  }, [this.$props.title && h(Title, {
22962
- "class": getClassName$8(this.$props.innerClass, 'title') || ''
24347
+ "class": getClassName$9(this.$props.innerClass, 'title') || ''
22963
24348
  }, [this.$props.title]), h(Dropdown, {
22964
24349
  "attrs": {
22965
24350
  "innerClass": this.$props.innerClass,
@@ -22982,6 +24367,8 @@
22982
24367
  "renderItem": renderItemCalc,
22983
24368
  "renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
22984
24369
  "showSearch": this.$props.showSearch,
24370
+ "showClear": this.$props.showClear,
24371
+ "searchPlaceholder": this.$props.searchPlaceholder,
22985
24372
  "transformData": this.$props.transformData,
22986
24373
  "footer": showLoadMore && !isLastBucket && h("div", {
22987
24374
  "attrs": {
@@ -23073,7 +24460,7 @@
23073
24460
  }
23074
24461
 
23075
24462
  var performUpdate = function performUpdate() {
23076
- _this3.currentValue = currentValue;
24463
+ _this3.currentValue = _extends({}, currentValue);
23077
24464
 
23078
24465
  _this3.updateQueryHandler(finalValues, props);
23079
24466
 
@@ -23082,7 +24469,7 @@
23082
24469
  _this3.$emit('value-change', finalValues);
23083
24470
  };
23084
24471
 
23085
- checkValueChange$4(props.componentId, finalValues, props.beforeValueChange, performUpdate);
24472
+ checkValueChange$5(props.componentId, finalValues, props.beforeValueChange, performUpdate);
23086
24473
  },
23087
24474
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
23088
24475
  var defaultQueryOptions;
@@ -23100,7 +24487,7 @@
23100
24487
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
23101
24488
  }
23102
24489
 
23103
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
24490
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
23104
24491
  this.updateQuery({
23105
24492
  componentId: this.internalComponent,
23106
24493
  query: query,
@@ -23121,7 +24508,7 @@
23121
24508
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
23122
24509
  }
23123
24510
 
23124
- this.setQueryOptions(props.componentId, customQueryOptions);
24511
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
23125
24512
  this.updateQuery({
23126
24513
  componentId: props.componentId,
23127
24514
  query: query,
@@ -23134,7 +24521,7 @@
23134
24521
  },
23135
24522
  generateQueryOptions: function generateQueryOptions(props, after) {
23136
24523
  var queryOptions = getQueryOptions$4(props);
23137
- return props.showLoadMore ? getCompositeAggsQuery$3({
24524
+ return props.showLoadMore ? getCompositeAggsQuery$4({
23138
24525
  query: queryOptions,
23139
24526
  props: props,
23140
24527
  after: after
@@ -23276,14 +24663,14 @@
23276
24663
 
23277
24664
  MultiDropdownList.generateQueryOptions = function (props, after) {
23278
24665
  var queryOptions = getQueryOptions$4(props);
23279
- return props.showLoadMore ? getCompositeAggsQuery$3({
24666
+ return props.showLoadMore ? getCompositeAggsQuery$4({
23280
24667
  query: queryOptions,
23281
24668
  props: props,
23282
24669
  after: after
23283
24670
  }) : getAggsQuery(queryOptions, props);
23284
24671
  };
23285
24672
 
23286
- var mapStateToProps$7 = function mapStateToProps(state, props) {
24673
+ var mapStateToProps$8 = function mapStateToProps(state, props) {
23287
24674
  return {
23288
24675
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
23289
24676
  rawData: state.rawData[props.componentId],
@@ -23298,11 +24685,11 @@
23298
24685
 
23299
24686
  var mapDispatchtoProps$5 = {
23300
24687
  setQueryOptions: setQueryOptions$5,
23301
- updateQuery: updateQuery$5,
23302
- setCustomQuery: setCustomQuery$4,
23303
- setDefaultQuery: setDefaultQuery$5
24688
+ updateQuery: updateQuery$6,
24689
+ setCustomQuery: setCustomQuery$5,
24690
+ setDefaultQuery: setDefaultQuery$6
23304
24691
  };
23305
- var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$5)(MultiDropdownList), {
24692
+ var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
23306
24693
  componentType: constants_1$1.multiDropdownList,
23307
24694
  internalComponent: true
23308
24695
  });
@@ -23314,12 +24701,12 @@
23314
24701
 
23315
24702
  MultiDropdownList.componentType = constants_1$1.multiDropdownList;
23316
24703
 
23317
- var updateQuery$6 = lib_5.updateQuery,
24704
+ var updateQuery$7 = lib_5.updateQuery,
23318
24705
  setQueryOptions$6 = lib_5.setQueryOptions,
23319
- setCustomQuery$5 = lib_5.setCustomQuery;
23320
- var isEqual$9 = lib_8.isEqual,
23321
- checkValueChange$5 = lib_8.checkValueChange,
23322
- getClassName$9 = lib_8.getClassName,
24706
+ setCustomQuery$6 = lib_5.setCustomQuery;
24707
+ var isEqual$a = lib_8.isEqual,
24708
+ checkValueChange$6 = lib_8.checkValueChange,
24709
+ getClassName$a = lib_8.getClassName,
23323
24710
  getOptionsFromQuery$6 = lib_8.getOptionsFromQuery,
23324
24711
  handleA11yAction$1 = lib_8.handleA11yAction;
23325
24712
  var ToggleButton = {
@@ -23328,7 +24715,7 @@
23328
24715
  componentId: types.stringRequired,
23329
24716
  data: types.data,
23330
24717
  dataField: types.stringRequired,
23331
- defaultValue: types.stringOrArray,
24718
+ defaultValue: types.any,
23332
24719
  value: types.stringOrArray,
23333
24720
  filterLabel: types.string,
23334
24721
  nestedField: types.string,
@@ -23378,21 +24765,21 @@
23378
24765
  this.updateQuery(this.$data.currentValue, this.$props);
23379
24766
  },
23380
24767
  value: function value(newVal, oldVal) {
23381
- if (!isEqual$9(newVal, oldVal)) {
24768
+ if (!isEqual$a(newVal, oldVal)) {
23382
24769
  this.handleToggle(newVal, true, this.$props);
23383
24770
  }
23384
24771
  },
23385
24772
  selectedValue: function selectedValue(newVal, oldVal) {
23386
24773
  if (this.$props.multiSelect) {
23387
24774
  // for multiselect selectedValue will be an array
23388
- if (!isEqual$9(this.$data.currentValue, newVal) && !isEqual$9(oldVal, newVal)) {
24775
+ if (!isEqual$a(this.$data.currentValue, newVal) && !isEqual$a(oldVal, newVal)) {
23389
24776
  this.handleToggle(newVal || [], true, this.$props);
23390
24777
  }
23391
24778
  } else {
23392
24779
  // else selectedValue will be a string
23393
24780
  var currentValue = this.$data.currentValue[0] ? this.$data.currentValue[0].value : null;
23394
24781
 
23395
- if (!isEqual$9(currentValue, this.selectedValue) && !isEqual$9(oldVal, this.selectedValue)) {
24782
+ if (!isEqual$a(currentValue, this.selectedValue) && !isEqual$a(oldVal, this.selectedValue)) {
23396
24783
  this.handleToggle(this.selectedValue || [], true, this.$props);
23397
24784
  }
23398
24785
  }
@@ -23470,7 +24857,7 @@
23470
24857
  }
23471
24858
  };
23472
24859
 
23473
- checkValueChange$5(props.componentId, props.multiSelect ? value : value[0], props.beforeValueChange, performUpdate);
24860
+ checkValueChange$6(props.componentId, props.multiSelect ? value : value[0], props.beforeValueChange, performUpdate);
23474
24861
  },
23475
24862
  updateQuery: function updateQuery(value, props) {
23476
24863
  var filterValue = value;
@@ -23486,7 +24873,7 @@
23486
24873
  var _ref = customQuery(value, props) || {};
23487
24874
 
23488
24875
  query = _ref.query;
23489
- this.setQueryOptions(props.componentId, getOptionsFromQuery$6(customQuery(value, props)));
24876
+ this.setQueryOptions(props.componentId, getOptionsFromQuery$6(customQuery(value, props)), false);
23490
24877
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
23491
24878
  }
23492
24879
 
@@ -23507,7 +24894,7 @@
23507
24894
  multiSelect = _this$$props.multiSelect;
23508
24895
 
23509
24896
  if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
23510
- return isEqual$9(item, stateItem);
24897
+ return isEqual$a(item, stateItem);
23511
24898
  })) {
23512
24899
  return false;
23513
24900
  }
@@ -23537,7 +24924,7 @@
23537
24924
  return _this2.handleClick(item);
23538
24925
  }
23539
24926
  }) : h(Button, {
23540
- "class": getClassName$9(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
24927
+ "class": getClassName$a(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
23541
24928
  "on": {
23542
24929
  "click": function click() {
23543
24930
  return _this2.handleClick(item);
@@ -23564,7 +24951,7 @@
23564
24951
  return h(Container, {
23565
24952
  "class": toggleButtons
23566
24953
  }, [this.$props.title && h(Title, {
23567
- "class": getClassName$9(this.$props.innerClass, 'title')
24954
+ "class": getClassName$a(this.$props.innerClass, 'title')
23568
24955
  }, [this.$props.title]), this.$props.data.map(function (item) {
23569
24956
  return _this3.renderButton(item);
23570
24957
  })]);
@@ -23620,7 +25007,7 @@
23620
25007
  return query;
23621
25008
  };
23622
25009
 
23623
- var mapStateToProps$8 = function mapStateToProps(state, props) {
25010
+ var mapStateToProps$9 = function mapStateToProps(state, props) {
23624
25011
  return {
23625
25012
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
23626
25013
  componentProps: state.props[props.componentId],
@@ -23629,11 +25016,11 @@
23629
25016
  };
23630
25017
 
23631
25018
  var mapDispatchtoProps$6 = {
23632
- updateQueryHandler: updateQuery$6,
25019
+ updateQueryHandler: updateQuery$7,
23633
25020
  setQueryOptions: setQueryOptions$6,
23634
- setCustomQuery: setCustomQuery$5
25021
+ setCustomQuery: setCustomQuery$6
23635
25022
  };
23636
- var RcConnected = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$6)(ToggleButton), {
25023
+ var RcConnected = ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$6)(ToggleButton), {
23637
25024
  componentType: constants_1$1.toggleButton
23638
25025
  });
23639
25026
 
@@ -23648,15 +25035,15 @@
23648
25035
  _excluded2 = ["query"],
23649
25036
  _excluded3 = ["query"],
23650
25037
  _excluded4 = ["query"];
23651
- var updateQuery$7 = lib_5.updateQuery,
25038
+ var updateQuery$8 = lib_5.updateQuery,
23652
25039
  setQueryOptions$7 = lib_5.setQueryOptions,
23653
- setCustomQuery$6 = lib_5.setCustomQuery,
23654
- setDefaultQuery$6 = lib_5.setDefaultQuery;
25040
+ setCustomQuery$7 = lib_5.setCustomQuery,
25041
+ setDefaultQuery$7 = lib_5.setDefaultQuery;
23655
25042
  var parseHits$1 = lib_8.parseHits,
23656
- isEqual$a = lib_8.isEqual,
23657
- getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery,
25043
+ isEqual$b = lib_8.isEqual,
25044
+ getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
23658
25045
  getOptionsFromQuery$7 = lib_8.getOptionsFromQuery,
23659
- getResultStats$2 = lib_8.getResultStats;
25046
+ getResultStats$3 = lib_8.getResultStats;
23660
25047
  var ReactiveComponent = {
23661
25048
  name: 'ReactiveComponent',
23662
25049
  props: {
@@ -23799,42 +25186,42 @@
23799
25186
  },
23800
25187
  watch: {
23801
25188
  hits: function hits(newVal, oldVal) {
23802
- if (!isEqual$a(newVal, oldVal)) {
25189
+ if (!isEqual$b(newVal, oldVal)) {
23803
25190
  this.$emit('data', this.getData());
23804
25191
  }
23805
25192
  },
23806
25193
  rawData: function rawData(newVal, oldVal) {
23807
- if (!isEqual$a(newVal, oldVal)) {
25194
+ if (!isEqual$b(newVal, oldVal)) {
23808
25195
  this.$emit('data', this.getData());
23809
25196
  }
23810
25197
  },
23811
25198
  aggregations: function aggregations(newVal, oldVal) {
23812
- if (!isEqual$a(newVal, oldVal)) {
25199
+ if (!isEqual$b(newVal, oldVal)) {
23813
25200
  this.$emit('data', this.getData());
23814
25201
  }
23815
25202
  },
23816
25203
  aggregationData: function aggregationData(newVal, oldVal) {
23817
- if (!isEqual$a(newVal, oldVal)) {
25204
+ if (!isEqual$b(newVal, oldVal)) {
23818
25205
  this.$emit('data', this.getData());
23819
25206
  }
23820
25207
  },
23821
25208
  promotedResults: function promotedResults(newVal, oldVal) {
23822
- if (!isEqual$a(newVal, oldVal)) {
25209
+ if (!isEqual$b(newVal, oldVal)) {
23823
25210
  this.$emit('data', this.getData());
23824
25211
  }
23825
25212
  },
23826
25213
  hidden: function hidden(newVal, oldVal) {
23827
- if (!isEqual$a(newVal, oldVal)) {
25214
+ if (!isEqual$b(newVal, oldVal)) {
23828
25215
  this.$emit('data', this.getData());
23829
25216
  }
23830
25217
  },
23831
25218
  total: function total(newVal, oldVal) {
23832
- if (!isEqual$a(newVal, oldVal)) {
25219
+ if (!isEqual$b(newVal, oldVal)) {
23833
25220
  this.$emit('data', this.getData());
23834
25221
  }
23835
25222
  },
23836
25223
  time: function time(newVal, oldVal) {
23837
- if (!isEqual$a(newVal, oldVal)) {
25224
+ if (!isEqual$b(newVal, oldVal)) {
23838
25225
  this.$emit('data', this.getData());
23839
25226
  }
23840
25227
  },
@@ -23918,7 +25305,7 @@
23918
25305
  getAggsQuery: function getAggsQuery() {
23919
25306
  if (this.aggregationField) {
23920
25307
  return {
23921
- aggs: getCompositeAggsQuery$4({
25308
+ aggs: getCompositeAggsQuery$5({
23922
25309
  props: this.$props,
23923
25310
  showTopHits: true,
23924
25311
  value: this.selectedValue
@@ -23962,12 +25349,12 @@
23962
25349
  },
23963
25350
  computed: {
23964
25351
  stats: function stats() {
23965
- return getResultStats$2(this);
25352
+ return getResultStats$3(this);
23966
25353
  }
23967
25354
  }
23968
25355
  };
23969
25356
 
23970
- var mapStateToProps$9 = function mapStateToProps(state, props) {
25357
+ var mapStateToProps$a = function mapStateToProps(state, props) {
23971
25358
  return {
23972
25359
  aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
23973
25360
  aggregationData: state.compositeAggregations[props.componentId] || [],
@@ -23987,11 +25374,11 @@
23987
25374
 
23988
25375
  var mapDispatchtoProps$7 = {
23989
25376
  setQueryOptions: setQueryOptions$7,
23990
- updateQuery: updateQuery$7,
23991
- setCustomQuery: setCustomQuery$6,
23992
- setDefaultQuery: setDefaultQuery$6
25377
+ updateQuery: updateQuery$8,
25378
+ setCustomQuery: setCustomQuery$7,
25379
+ setDefaultQuery: setDefaultQuery$7
23993
25380
  };
23994
- var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$7)(ReactiveComponent), {
25381
+ var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$7)(ReactiveComponent), {
23995
25382
  componentType: constants_1$1.reactiveComponent
23996
25383
  });
23997
25384
 
@@ -24005,7 +25392,7 @@
24005
25392
  var setValue$2 = lib_5.setValue,
24006
25393
  clearValues = lib_5.clearValues,
24007
25394
  resetValuesToDefault = lib_5.resetValuesToDefault;
24008
- var getClassName$a = lib_8.getClassName,
25395
+ var getClassName$b = lib_8.getClassName,
24009
25396
  handleA11yAction$2 = lib_8.handleA11yAction;
24010
25397
  var SelectedFilters = {
24011
25398
  name: 'SelectedFilters',
@@ -24015,7 +25402,8 @@
24015
25402
  innerClass: types.style,
24016
25403
  showClearAll: VueTypes.bool.def(true),
24017
25404
  title: types.title,
24018
- resetToDefault: VueTypes.bool.def(false)
25405
+ resetToDefault: VueTypes.bool.def(false),
25406
+ resetToValues: VueTypes.object
24019
25407
  },
24020
25408
  inject: {
24021
25409
  theme: {
@@ -24042,9 +25430,9 @@
24042
25430
  return h(Container, {
24043
25431
  "class": filters(this.theme) + " " + (this.$props.className || '')
24044
25432
  }, [this.$props.title && hasValues && h(Title, {
24045
- "class": getClassName$a(this.$props.innerClass, 'title') || ''
25433
+ "class": getClassName$b(this.$props.innerClass, 'title') || ''
24046
25434
  }, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues ? h(Button, {
24047
- "class": getClassName$a(this.$props.innerClass, 'button') || '',
25435
+ "class": getClassName$b(this.$props.innerClass, 'button') || '',
24048
25436
  "on": _extends({}, {
24049
25437
  click: this.clearValues,
24050
25438
  keypress: function keypress(event) {
@@ -24068,15 +25456,16 @@
24068
25456
  this.$emit('clear', component, value);
24069
25457
  },
24070
25458
  clearValues: function clearValues() {
24071
- var resetToDefault = this.resetToDefault;
25459
+ var resetToDefault = this.resetToDefault,
25460
+ resetToValues = this.resetToValues;
24072
25461
 
24073
25462
  if (resetToDefault) {
24074
25463
  this.resetValuesToDefault();
24075
25464
  } else {
24076
- this.clearValuesAction();
25465
+ this.clearValuesAction(resetToValues);
24077
25466
  }
24078
25467
 
24079
- this.$emit('clear', null);
25468
+ this.$emit('clear', resetToValues);
24080
25469
  },
24081
25470
  renderValue: function renderValue(value, isArray) {
24082
25471
  var _this2 = this;
@@ -24118,7 +25507,7 @@
24118
25507
  var valueToRender = _this3.renderValue(value, isArray);
24119
25508
 
24120
25509
  return h(Button, {
24121
- "class": getClassName$a(_this3.$props.innerClass, 'button') || '',
25510
+ "class": getClassName$b(_this3.$props.innerClass, 'button') || '',
24122
25511
  "key": component + "-" + (index + 1),
24123
25512
  "on": _extends({}, {
24124
25513
  click: function click() {
@@ -24147,7 +25536,7 @@
24147
25536
  }
24148
25537
  };
24149
25538
 
24150
- var mapStateToProps$a = function mapStateToProps(state) {
25539
+ var mapStateToProps$b = function mapStateToProps(state) {
24151
25540
  return {
24152
25541
  components: state.components,
24153
25542
  selectedValues: state.selectedValues
@@ -24159,18 +25548,18 @@
24159
25548
  setValue: setValue$2,
24160
25549
  resetValuesToDefault: resetValuesToDefault
24161
25550
  };
24162
- var RcConnected$2 = connect(mapStateToProps$a, mapDispatchtoProps$8)(SelectedFilters);
25551
+ var RcConnected$2 = connect(mapStateToProps$b, mapDispatchtoProps$8)(SelectedFilters);
24163
25552
 
24164
25553
  SelectedFilters.install = function (Vue) {
24165
25554
  Vue.component(SelectedFilters.name, RcConnected$2);
24166
25555
  };
24167
25556
 
24168
- var updateQuery$8 = lib_5.updateQuery,
25557
+ var updateQuery$9 = lib_5.updateQuery,
24169
25558
  setQueryOptions$8 = lib_5.setQueryOptions,
24170
- setCustomQuery$7 = lib_5.setCustomQuery;
24171
- var isEqual$b = lib_8.isEqual,
24172
- checkValueChange$6 = lib_8.checkValueChange,
24173
- getClassName$b = lib_8.getClassName,
25559
+ setCustomQuery$8 = lib_5.setCustomQuery;
25560
+ var isEqual$c = lib_8.isEqual,
25561
+ checkValueChange$7 = lib_8.checkValueChange,
25562
+ getClassName$c = lib_8.getClassName,
24174
25563
  getOptionsFromQuery$8 = lib_8.getOptionsFromQuery;
24175
25564
  var SingleRange = {
24176
25565
  name: 'SingleRange',
@@ -24225,12 +25614,12 @@
24225
25614
  this.setValue(newVal);
24226
25615
  },
24227
25616
  value: function value(newVal, oldVal) {
24228
- if (!isEqual$b(newVal, oldVal)) {
25617
+ if (!isEqual$c(newVal, oldVal)) {
24229
25618
  this.setValue(newVal);
24230
25619
  }
24231
25620
  },
24232
25621
  selectedValue: function selectedValue(newVal) {
24233
- if (!isEqual$b(this.$data.currentValue, newVal)) {
25622
+ if (!isEqual$c(this.$data.currentValue, newVal)) {
24234
25623
  this.setValue(newVal);
24235
25624
  }
24236
25625
  },
@@ -24247,16 +25636,16 @@
24247
25636
  return h(Container, {
24248
25637
  "class": this.$props.className
24249
25638
  }, [this.$props.title && h(Title, {
24250
- "class": getClassName$b(this.$props.innerClass, 'title')
25639
+ "class": getClassName$c(this.$props.innerClass, 'title')
24251
25640
  }, [this.$props.title]), h(UL, {
24252
- "class": getClassName$b(this.$props.innerClass, 'list')
25641
+ "class": getClassName$c(this.$props.innerClass, 'list')
24253
25642
  }, [this.$props.data.map(function (item) {
24254
25643
  var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
24255
25644
  return h("li", {
24256
25645
  "key": item.label,
24257
25646
  "class": "" + (selected ? 'active' : '')
24258
25647
  }, [h(Radio, {
24259
- "class": getClassName$b(_this.$props.innerClass, 'radio'),
25648
+ "class": getClassName$c(_this.$props.innerClass, 'radio'),
24260
25649
  "attrs": {
24261
25650
  "id": _this.$props.componentId + "-" + item.label,
24262
25651
  "name": _this.$props.componentId,
@@ -24269,7 +25658,7 @@
24269
25658
  "change": _this.handleChange
24270
25659
  }
24271
25660
  }), h("label", {
24272
- "class": getClassName$b(_this.$props.innerClass, 'label'),
25661
+ "class": getClassName$c(_this.$props.innerClass, 'label'),
24273
25662
  "attrs": {
24274
25663
  "for": _this.$props.componentId + "-" + item.label
24275
25664
  }
@@ -24296,7 +25685,7 @@
24296
25685
  _this2.$emit('value-change', currentValue);
24297
25686
  };
24298
25687
 
24299
- checkValueChange$6(props.componentId, currentValue, props.beforeValueChange, performUpdate);
25688
+ checkValueChange$7(props.componentId, currentValue, props.beforeValueChange, performUpdate);
24300
25689
  },
24301
25690
  updateQueryHandler: function updateQueryHandler(value, props) {
24302
25691
  var customQuery = props.customQuery;
@@ -24311,7 +25700,7 @@
24311
25700
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
24312
25701
  }
24313
25702
 
24314
- this.setQueryOptions(props.componentId, customQueryOptions);
25703
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
24315
25704
  this.updateQuery({
24316
25705
  componentId: props.componentId,
24317
25706
  query: query,
@@ -24369,7 +25758,7 @@
24369
25758
  return query;
24370
25759
  };
24371
25760
 
24372
- var mapStateToProps$b = function mapStateToProps(state, props) {
25761
+ var mapStateToProps$c = function mapStateToProps(state, props) {
24373
25762
  return {
24374
25763
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
24375
25764
  componentProps: state.props[props.componentId],
@@ -24378,11 +25767,11 @@
24378
25767
  };
24379
25768
 
24380
25769
  var mapDispatchtoProps$9 = {
24381
- updateQuery: updateQuery$8,
25770
+ updateQuery: updateQuery$9,
24382
25771
  setQueryOptions: setQueryOptions$8,
24383
- setCustomQuery: setCustomQuery$7
25772
+ setCustomQuery: setCustomQuery$8
24384
25773
  };
24385
- var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$b, mapDispatchtoProps$9)(SingleRange), {
25774
+ var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(SingleRange), {
24386
25775
  componentType: constants_1$1.singleRange
24387
25776
  });
24388
25777
 
@@ -24393,12 +25782,12 @@
24393
25782
 
24394
25783
  SingleRange.componentType = constants_1$1.singleRange;
24395
25784
 
24396
- var updateQuery$9 = lib_5.updateQuery,
25785
+ var updateQuery$a = lib_5.updateQuery,
24397
25786
  setQueryOptions$9 = lib_5.setQueryOptions,
24398
- setCustomQuery$8 = lib_5.setCustomQuery;
24399
- var isEqual$c = lib_8.isEqual,
24400
- checkValueChange$7 = lib_8.checkValueChange,
24401
- getClassName$c = lib_8.getClassName,
25787
+ setCustomQuery$9 = lib_5.setCustomQuery;
25788
+ var isEqual$d = lib_8.isEqual,
25789
+ checkValueChange$8 = lib_8.checkValueChange,
25790
+ getClassName$d = lib_8.getClassName,
24402
25791
  getOptionsFromQuery$9 = lib_8.getOptionsFromQuery;
24403
25792
  var MultiRange = {
24404
25793
  name: 'MultiRange',
@@ -24505,7 +25894,7 @@
24505
25894
  _this.$emit('value-change', Object.keys(selectedValues));
24506
25895
  };
24507
25896
 
24508
- checkValueChange$7(props.componentId, currentValue, props.beforeValueChange, performUpdate);
25897
+ checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
24509
25898
  },
24510
25899
  updateQueryHandler: function updateQueryHandler(value, props) {
24511
25900
  var customQuery = props.customQuery;
@@ -24520,7 +25909,7 @@
24520
25909
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
24521
25910
  }
24522
25911
 
24523
- this.setQueryOptions(props.componentId, customQueryOptions);
25912
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
24524
25913
  this.updateQuery({
24525
25914
  componentId: props.componentId,
24526
25915
  query: query,
@@ -24540,12 +25929,12 @@
24540
25929
  this.selectItem(newVal, true, undefined, true);
24541
25930
  },
24542
25931
  value: function value(newVal, oldVal) {
24543
- if (!isEqual$c(newVal, oldVal)) {
25932
+ if (!isEqual$d(newVal, oldVal)) {
24544
25933
  this.selectItem(newVal, true, undefined, true);
24545
25934
  }
24546
25935
  },
24547
25936
  selectedValue: function selectedValue(newVal) {
24548
- if (!isEqual$c(this.$data.currentValue, newVal)) {
25937
+ if (!isEqual$d(this.$data.currentValue, newVal)) {
24549
25938
  this.selectItem(newVal, true, undefined, true);
24550
25939
  }
24551
25940
  },
@@ -24579,16 +25968,16 @@
24579
25968
  return h(Container, {
24580
25969
  "class": this.$props.className
24581
25970
  }, [this.$props.title && h(Title, {
24582
- "class": getClassName$c(this.$props.innerClass, 'title')
25971
+ "class": getClassName$d(this.$props.innerClass, 'title')
24583
25972
  }, [this.$props.title]), h(UL, {
24584
- "class": getClassName$c(this.$props.innerClass, 'list')
25973
+ "class": getClassName$d(this.$props.innerClass, 'list')
24585
25974
  }, [this.$props.data.map(function (item) {
24586
25975
  var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
24587
25976
  return h("li", {
24588
25977
  "key": item.label,
24589
25978
  "class": "" + (selected ? 'active' : '')
24590
25979
  }, [h(Checkbox, {
24591
- "class": getClassName$c(_this2.$props.innerClass, 'checkbox'),
25980
+ "class": getClassName$d(_this2.$props.innerClass, 'checkbox'),
24592
25981
  "attrs": {
24593
25982
  "id": _this2.$props.componentId + "-" + item.label,
24594
25983
  "name": _this2.$props.componentId,
@@ -24603,7 +25992,7 @@
24603
25992
  click: _this2.handleClick
24604
25993
  })
24605
25994
  }), h("label", {
24606
- "class": getClassName$c(_this2.$props.innerClass, 'label'),
25995
+ "class": getClassName$d(_this2.$props.innerClass, 'label'),
24607
25996
  "attrs": {
24608
25997
  "for": _this2.$props.componentId + "-" + item.label
24609
25998
  }
@@ -24663,7 +26052,7 @@
24663
26052
  return query;
24664
26053
  };
24665
26054
 
24666
- var mapStateToProps$c = function mapStateToProps(state, props) {
26055
+ var mapStateToProps$d = function mapStateToProps(state, props) {
24667
26056
  return {
24668
26057
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
24669
26058
  componentProps: state.props[props.componentId],
@@ -24672,11 +26061,11 @@
24672
26061
  };
24673
26062
 
24674
26063
  var mapDispatchtoProps$a = {
24675
- updateQuery: updateQuery$9,
26064
+ updateQuery: updateQuery$a,
24676
26065
  setQueryOptions: setQueryOptions$9,
24677
- setCustomQuery: setCustomQuery$8
26066
+ setCustomQuery: setCustomQuery$9
24678
26067
  };
24679
- var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$a)(MultiRange), {
26068
+ var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(MultiRange), {
24680
26069
  componentType: constants_1$1.multiRange
24681
26070
  });
24682
26071
 
@@ -24962,15 +26351,15 @@
24962
26351
  };
24963
26352
  var vueNoSsr_common = index$2;
24964
26353
 
24965
- var _templateObject$m;
24966
- var Slider = index$1('div')(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot{\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder-color: #000;\n\t\tbackground-color: #000;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: \"\";\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot -tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
26354
+ var _templateObject$n;
26355
+ var Slider = index$1('div')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
24967
26356
 
24968
26357
  /**
24969
26358
  * Caution: Please do not change this file without having a discussion with the Team.
24970
26359
  * Any change may break the umd build, we're directly replacing the line no: 14
24971
26360
  * `
24972
26361
  var s = document.createElement("script");
24973
- s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@2.8.2/dist/index.js");
26362
+ s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
24974
26363
  s.onload = function(){
24975
26364
  var VueSlider = global['vue-slider-component'];
24976
26365
  components['vue-slider-component'] = VueSlider;
@@ -24991,7 +26380,7 @@
24991
26380
  // eslint-disable-next-line
24992
26381
 
24993
26382
  var s = document.createElement("script");
24994
- s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@2.8.2/dist/index.js");
26383
+ s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
24995
26384
  s.onload = function(){
24996
26385
  var VueSlider = global$1['vue-slider-component'];
24997
26386
  components['vue-slider-component'] = VueSlider;
@@ -25006,13 +26395,13 @@
25006
26395
  return components;
25007
26396
  };
25008
26397
 
25009
- var updateQuery$a = lib_5.updateQuery,
26398
+ var updateQuery$b = lib_5.updateQuery,
25010
26399
  setQueryOptions$a = lib_5.setQueryOptions,
25011
- setCustomQuery$9 = lib_5.setCustomQuery;
25012
- var checkValueChange$8 = lib_8.checkValueChange,
25013
- getClassName$d = lib_8.getClassName,
26400
+ setCustomQuery$a = lib_5.setCustomQuery;
26401
+ var checkValueChange$9 = lib_8.checkValueChange,
26402
+ getClassName$e = lib_8.getClassName,
25014
26403
  getOptionsFromQuery$a = lib_8.getOptionsFromQuery,
25015
- isEqual$d = lib_8.isEqual;
26404
+ isEqual$e = lib_8.isEqual;
25016
26405
  var RangeSlider = {
25017
26406
  name: 'RangeSlider',
25018
26407
  components: getComponents(),
@@ -25066,38 +26455,34 @@
25066
26455
  });
25067
26456
  }
25068
26457
  },
25069
- handleSlider: function handleSlider(values) {
25070
- var _this = this;
25071
-
25072
- clearTimeout(this.handleSliderChange._tId);
25073
- this.handleSliderChange._tId = setTimeout(function () {
25074
- _this.handleSliderChange(values);
25075
- }, 100);
26458
+ handleSlider: function handleSlider() {
26459
+ var sliderValues = this.$refs.slider.getValue();
26460
+ this.handleSliderChange(sliderValues);
25076
26461
  },
25077
26462
  handleChange: function handleChange(currentValue, props) {
25078
- var _this2 = this;
26463
+ var _this = this;
25079
26464
 
25080
26465
  if (props === void 0) {
25081
26466
  props = this.$props;
25082
26467
  }
25083
26468
 
25084
26469
  var performUpdate = function performUpdate() {
25085
- _this2.currentValue = currentValue;
26470
+ _this.currentValue = currentValue;
25086
26471
 
25087
- _this2.updateQueryHandler([currentValue[0], currentValue[1]], props);
26472
+ _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
25088
26473
 
25089
- _this2.$emit('valueChange', {
26474
+ _this.$emit('valueChange', {
25090
26475
  start: currentValue[0],
25091
26476
  end: currentValue[1]
25092
26477
  });
25093
26478
 
25094
- _this2.$emit('value-change', {
26479
+ _this.$emit('value-change', {
25095
26480
  start: currentValue[0],
25096
26481
  end: currentValue[1]
25097
26482
  });
25098
26483
  };
25099
26484
 
25100
- checkValueChange$8(props.componentId, {
26485
+ checkValueChange$9(props.componentId, {
25101
26486
  start: currentValue[0],
25102
26487
  end: currentValue[1]
25103
26488
  }, props.beforeValueChange, performUpdate);
@@ -25123,7 +26508,7 @@
25123
26508
  currentEnd = value[1]; // check if the slider is at its initial position
25124
26509
 
25125
26510
  var isInitialValue = currentStart === start && currentEnd === end;
25126
- this.setQueryOptions(props.componentId, customQueryOptions);
26511
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
25127
26512
  this.updateQuery({
25128
26513
  componentId: props.componentId,
25129
26514
  query: query,
@@ -25140,12 +26525,12 @@
25140
26525
  this.handleChange(RangeSlider.parseValue(newVal, this.$props));
25141
26526
  },
25142
26527
  value: function value(newVal, oldVal) {
25143
- if (!isEqual$d(newVal, oldVal)) {
26528
+ if (!isEqual$e(newVal, oldVal)) {
25144
26529
  this.handleChange(RangeSlider.parseValue(newVal, this.$props));
25145
26530
  }
25146
26531
  },
25147
26532
  selectedValue: function selectedValue(newVal) {
25148
- if (!isEqual$d(this.$data.currentValue, newVal)) {
26533
+ if (!isEqual$e(this.$data.currentValue, newVal)) {
25149
26534
  this.handleChange(RangeSlider.parseValue(newVal, this.$props));
25150
26535
  this.$emit('change', newVal);
25151
26536
  }
@@ -25191,9 +26576,9 @@
25191
26576
  return h(Container, {
25192
26577
  "class": this.$props.className
25193
26578
  }, [this.$props.title && h(Title, {
25194
- "class": getClassName$d(this.$props.innerClass, 'title')
26579
+ "class": getClassName$e(this.$props.innerClass, 'title')
25195
26580
  }, [this.$props.title]), this.$props.range ? h(vueNoSsr_common, [h(Slider, {
25196
- "class": getClassName$d(this.$props.innerClass, 'slider')
26581
+ "class": getClassName$e(this.$props.innerClass, 'slider')
25197
26582
  }, [h("vue-slider-component", {
25198
26583
  "ref": "slider",
25199
26584
  "attrs": {
@@ -25202,18 +26587,19 @@
25202
26587
  "max": this.$props.range.end,
25203
26588
  "dotSize": 20,
25204
26589
  "height": 4,
25205
- "enable-cross": false
26590
+ "enable-cross": false,
26591
+ "tooltip": "always"
25206
26592
  },
25207
- "props": _extends({}, this.$props.sliderOptions),
25208
- "on": _extends({}, {
25209
- input: this.handleSlider
25210
- })
26593
+ "on": {
26594
+ "drag-end": this.handleSlider
26595
+ },
26596
+ "props": _extends({}, this.$props.sliderOptions)
25211
26597
  }), this.$props.rangeLabels && h("div", {
25212
26598
  "class": "label-container"
25213
26599
  }, [h("label", {
25214
- "class": getClassName$d(this.$props.innerClass, 'label') || 'range-label-left'
26600
+ "class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-left'
25215
26601
  }, [this.$props.rangeLabels.start]), h("label", {
25216
- "class": getClassName$d(this.$props.innerClass, 'label') || 'range-label-right'
26602
+ "class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-right'
25217
26603
  }, [this.$props.rangeLabels.end])])])]) : null]);
25218
26604
  }
25219
26605
  };
@@ -25259,7 +26645,7 @@
25259
26645
  return [];
25260
26646
  };
25261
26647
 
25262
- var mapStateToProps$d = function mapStateToProps(state, props) {
26648
+ var mapStateToProps$e = function mapStateToProps(state, props) {
25263
26649
  return {
25264
26650
  options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
25265
26651
  : [],
@@ -25270,11 +26656,11 @@
25270
26656
  };
25271
26657
 
25272
26658
  var mapDispatchtoProps$b = {
25273
- updateQuery: updateQuery$a,
26659
+ updateQuery: updateQuery$b,
25274
26660
  setQueryOptions: setQueryOptions$a,
25275
- setCustomQuery: setCustomQuery$9
26661
+ setCustomQuery: setCustomQuery$a
25276
26662
  };
25277
- var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$b)(RangeSlider), {
26663
+ var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(RangeSlider), {
25278
26664
  componentType: constants_1$1.rangeSlider
25279
26665
  });
25280
26666
 
@@ -25288,16 +26674,16 @@
25288
26674
  var addComponent$1 = lib_5.addComponent,
25289
26675
  removeComponent$1 = lib_5.removeComponent,
25290
26676
  watchComponent$1 = lib_5.watchComponent,
25291
- updateQuery$b = lib_5.updateQuery,
26677
+ updateQuery$c = lib_5.updateQuery,
25292
26678
  setQueryListener$1 = lib_5.setQueryListener,
25293
26679
  setQueryOptions$b = lib_5.setQueryOptions,
25294
26680
  setComponentProps$1 = lib_5.setComponentProps,
25295
- setCustomQuery$a = lib_5.setCustomQuery,
26681
+ setCustomQuery$b = lib_5.setCustomQuery,
25296
26682
  updateComponentProps$2 = lib_5.updateComponentProps;
25297
- var checkValueChange$9 = lib_8.checkValueChange,
25298
- getClassName$e = lib_8.getClassName,
26683
+ var checkValueChange$a = lib_8.checkValueChange,
26684
+ getClassName$f = lib_8.getClassName,
25299
26685
  getOptionsFromQuery$b = lib_8.getOptionsFromQuery,
25300
- isEqual$e = lib_8.isEqual,
26686
+ isEqual$f = lib_8.isEqual,
25301
26687
  checkSomePropChange$1 = lib_8.checkSomePropChange;
25302
26688
  var DynamicRangeSlider = {
25303
26689
  name: 'DynamicRangeSlider',
@@ -25321,7 +26707,8 @@
25321
26707
  URLParams: VueTypes.bool.def(false),
25322
26708
  sliderOptions: VueTypes.object.def({}),
25323
26709
  nestedField: types.string,
25324
- index: VueTypes.string
26710
+ index: VueTypes.string,
26711
+ value: types.range
25325
26712
  },
25326
26713
  data: function data() {
25327
26714
  this.internalRangeComponent = this.$props.componentId + "__range__internal";
@@ -25367,6 +26754,8 @@
25367
26754
  components = _this$$$store$getStat.components;
25368
26755
  }
25369
26756
 
26757
+ var value = this.$props.value;
26758
+
25370
26759
  if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
25371
26760
  this.addComponent(this.componentId);
25372
26761
  this.addComponent(this.internalRangeComponent);
@@ -25375,6 +26764,8 @@
25375
26764
  this.handleChange(this.selectedValue);
25376
26765
  } else if (this.selectedValue) {
25377
26766
  this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
26767
+ } else if (value) {
26768
+ this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
25378
26769
  } // get range before executing other queries
25379
26770
 
25380
26771
 
@@ -25393,6 +26784,13 @@
25393
26784
  }
25394
26785
  },
25395
26786
  methods: {
26787
+ isControlled: function isControlled() {
26788
+ if (this.$props.value && this.$listeners) {
26789
+ return true;
26790
+ }
26791
+
26792
+ return false;
26793
+ },
25396
26794
  setDefaultValue: function setDefaultValue(_ref) {
25397
26795
  var start = _ref.start,
25398
26796
  end = _ref.end;
@@ -25403,6 +26801,8 @@
25403
26801
  defaultEnd = _this$$props$defaultV.end;
25404
26802
 
25405
26803
  this.handleChange([defaultStart, defaultEnd]);
26804
+ } else if (this.isControlled()) {
26805
+ this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
25406
26806
  } else {
25407
26807
  this.currentValue = [start, end];
25408
26808
  }
@@ -25450,8 +26850,18 @@
25450
26850
  aggs: aggs
25451
26851
  });
25452
26852
  },
25453
- handleSlider: function handleSlider(values) {
25454
- this.handleChange(values.currentValue);
26853
+ handleSlider: function handleSlider() {
26854
+ var sliderValues = this.$refs.slider.getValue();
26855
+ var value = this.$props.value;
26856
+
26857
+ if (value === undefined) {
26858
+ this.handleChange(sliderValues);
26859
+ } else {
26860
+ this.$emit('change', {
26861
+ start: sliderValues[0],
26862
+ end: sliderValues[1]
26863
+ });
26864
+ }
25455
26865
  },
25456
26866
  handleChange: function handleChange(currentValue) {
25457
26867
  var _this2 = this;
@@ -25475,7 +26885,7 @@
25475
26885
  });
25476
26886
  };
25477
26887
 
25478
- checkValueChange$9(this.$props.componentId, {
26888
+ checkValueChange$a(this.$props.componentId, {
25479
26889
  start: normalizedValue[0],
25480
26890
  end: normalizedValue[1]
25481
26891
  }, this.$props.beforeValueChange, performUpdate);
@@ -25503,7 +26913,7 @@
25503
26913
  currentEnd = value[1]; // check if the slider is at its initial position
25504
26914
 
25505
26915
  var isInitialValue = currentStart === start && currentEnd === end;
25506
- this.setQueryOptions(this.$props.componentId, customQueryOptions);
26916
+ this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
25507
26917
  this.updateQuery({
25508
26918
  componentId: this.$props.componentId,
25509
26919
  query: query,
@@ -25539,15 +26949,16 @@
25539
26949
  this.setReact();
25540
26950
  },
25541
26951
  selectedValue: function selectedValue(newValue) {
25542
- if (isEqual$e(newValue, this.currentValue)) return;
26952
+ if (isEqual$f(newValue, this.currentValue)) return;
25543
26953
  var value = newValue || {
25544
26954
  start: this.range.start,
25545
26955
  end: this.range.end
25546
26956
  };
26957
+ this.$emit('change', value);
25547
26958
  this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
25548
26959
  },
25549
26960
  range: function range(newValue, oldValue) {
25550
- if (isEqual$e(newValue, oldValue) || !this.currentValue) return;
26961
+ if (isEqual$f(newValue, oldValue) || !this.currentValue) return;
25551
26962
 
25552
26963
  var _ref4 = this.currentValue || [],
25553
26964
  currentStart = _ref4[0],
@@ -25565,6 +26976,11 @@
25565
26976
  if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
25566
26977
  this.updateQueryHandler(this.$data.currentValue);
25567
26978
  }
26979
+ },
26980
+ value: function value(newVal, oldVal) {
26981
+ if (!isEqual$f(newVal, oldVal)) {
26982
+ this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
26983
+ }
25568
26984
  }
25569
26985
  },
25570
26986
  render: function render() {
@@ -25580,17 +26996,19 @@
25580
26996
  return h(Container, {
25581
26997
  "class": this.$props.className
25582
26998
  }, [this.$props.title && h(Title, {
25583
- "class": getClassName$e(this.$props.innerClass, 'title')
26999
+ "class": getClassName$f(this.$props.innerClass, 'title')
25584
27000
  }, [this.$props.title]), h(vueNoSsr_common, [h(Slider, {
25585
- "class": getClassName$e(this.$props.innerClass, 'slider')
27001
+ "class": getClassName$f(this.$props.innerClass, 'slider')
25586
27002
  }, [h("vue-slider-component", {
27003
+ "ref": "slider",
25587
27004
  "attrs": {
25588
- "value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
25589
- "min": Math.min(start, this.currentValue[0]),
25590
- "max": Math.max(end, this.currentValue[1]),
27005
+ "value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
27006
+ "min": Math.floor(Math.min(start, this.currentValue[0])),
27007
+ "max": Math.ceil(Math.max(end, this.currentValue[1])),
25591
27008
  "dotSize": 20,
25592
27009
  "height": 4,
25593
- "enable-cross": false
27010
+ "enable-cross": false,
27011
+ "tooltip": "always"
25594
27012
  },
25595
27013
  "on": {
25596
27014
  "drag-end": this.handleSlider
@@ -25599,9 +27017,9 @@
25599
27017
  }), this.labels ? h("div", {
25600
27018
  "class": "label-container"
25601
27019
  }, [h("label", {
25602
- "class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-left'
27020
+ "class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-left'
25603
27021
  }, [this.labels.start]), h("label", {
25604
- "class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-right'
27022
+ "class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-right'
25605
27023
  }, [this.labels.end])]) : null])])]);
25606
27024
  }
25607
27025
  };
@@ -25636,10 +27054,14 @@
25636
27054
  };
25637
27055
 
25638
27056
  DynamicRangeSlider.parseValue = function (value) {
25639
- return [value.start, value.end];
27057
+ if (value) {
27058
+ return Array.isArray(value) ? value : [value.start, value.end];
27059
+ }
27060
+
27061
+ return [];
25640
27062
  };
25641
27063
 
25642
- var mapStateToProps$e = function mapStateToProps(state, props) {
27064
+ var mapStateToProps$f = function mapStateToProps(state, props) {
25643
27065
  var componentId = state.aggregations[props.componentId];
25644
27066
  var internalRange = state.aggregations[props.componentId + "__range__internal"];
25645
27067
  var options = componentId && componentId[props.dataField];
@@ -25671,15 +27093,15 @@
25671
27093
  var mapDispatchtoProps$c = {
25672
27094
  addComponent: addComponent$1,
25673
27095
  removeComponent: removeComponent$1,
25674
- updateQuery: updateQuery$b,
27096
+ updateQuery: updateQuery$c,
25675
27097
  watchComponent: watchComponent$1,
25676
27098
  setQueryListener: setQueryListener$1,
25677
27099
  setQueryOptions: setQueryOptions$b,
25678
27100
  setComponentProps: setComponentProps$1,
25679
- setCustomQuery: setCustomQuery$a,
27101
+ setCustomQuery: setCustomQuery$b,
25680
27102
  updateComponentProps: updateComponentProps$2
25681
27103
  };
25682
- var RangeConnected$3 = connect(mapStateToProps$e, mapDispatchtoProps$c)(DynamicRangeSlider);
27104
+ var RangeConnected$3 = connect(mapStateToProps$f, mapDispatchtoProps$c)(DynamicRangeSlider);
25683
27105
 
25684
27106
  DynamicRangeSlider.install = function (Vue) {
25685
27107
  Vue.component(DynamicRangeSlider.name, RangeConnected$3);
@@ -25692,6 +27114,10 @@
25692
27114
  var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
25693
27115
 
25694
27116
  var filterProps = function filterProps(props) {
27117
+ if (props === void 0) {
27118
+ props = {};
27119
+ }
27120
+
25695
27121
  return _extends({}, props, {
25696
27122
  props: props.componentProps
25697
27123
  });
@@ -25711,7 +27137,7 @@
25711
27137
  return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
25712
27138
  }
25713
27139
 
25714
- if (componentIds instanceof Array) {
27140
+ if (Array.isArray(componentIds)) {
25715
27141
  var filteredState = {};
25716
27142
  componentIds.forEach(function (componentId) {
25717
27143
  filteredState[componentId] = state[componentId];
@@ -25750,7 +27176,7 @@
25750
27176
  };
25751
27177
  return this.__state;
25752
27178
  },
25753
- mounted: function mounted() {
27179
+ created: function created() {
25754
27180
  this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
25755
27181
  },
25756
27182
  computed: {
@@ -25837,7 +27263,7 @@
25837
27263
  }
25838
27264
  };
25839
27265
 
25840
- var mapStateToProps$f = function mapStateToProps(state, props) {
27266
+ var mapStateToProps$g = function mapStateToProps(state, props) {
25841
27267
  return {
25842
27268
  selectedValues: filterByComponentIds(state.selectedValues, props),
25843
27269
  queryLog: filterByComponentIds(state.queryLog, props),
@@ -25854,7 +27280,7 @@
25854
27280
  };
25855
27281
  };
25856
27282
 
25857
- var StateProviderConnected = connect(mapStateToProps$f, {})(StateProvider);
27283
+ var StateProviderConnected = connect(mapStateToProps$g, {})(StateProvider);
25858
27284
 
25859
27285
  StateProvider.install = function (Vue) {
25860
27286
  Vue.component(StateProvider.name, StateProviderConnected);
@@ -25952,6 +27378,7 @@
25952
27378
  var orderOfQueries = [];
25953
27379
  var hits = {};
25954
27380
  var aggregations = {};
27381
+ var compositeAggregations = {};
25955
27382
  var state = {};
25956
27383
  var customQueries = {};
25957
27384
  var defaultQueries = {};
@@ -26074,7 +27501,7 @@
26074
27501
  var react = component.react;
26075
27502
 
26076
27503
  if (isInternalComponentPresent || isResultComponent) {
26077
- react = helper_21(react, internalComponent);
27504
+ react = helper_22(react, internalComponent);
26078
27505
  }
26079
27506
 
26080
27507
  dependencyTree = dependencyTreeReducer(dependencyTree, {
@@ -26120,7 +27547,7 @@
26120
27547
 
26121
27548
  componentCollection.forEach(function (component) {
26122
27549
  // eslint-disable-next-line
26123
- var _buildQuery = helper_20(component.componentId, dependencyTree, queryList, queryOptions),
27550
+ var _buildQuery = helper_21(component.componentId, dependencyTree, queryList, queryOptions),
26124
27551
  queryObj = _buildQuery.queryObj,
26125
27552
  options = _buildQuery.options;
26126
27553
 
@@ -26186,6 +27613,11 @@
26186
27613
  var _extends4;
26187
27614
 
26188
27615
  aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
27616
+ compositeAggregations = compositeAggsReducer(compositeAggregations, {
27617
+ type: constants_9,
27618
+ aggregations: response.aggregations,
27619
+ append: false
27620
+ });
26189
27621
  }
26190
27622
 
26191
27623
  hits = _extends({}, hits, (_extends5 = {}, _extends5[component] = {
@@ -26212,6 +27644,8 @@
26212
27644
  var promotedResults = {};
26213
27645
  var rawData = {};
26214
27646
  var customData = {};
27647
+ var settingsResponse = {};
27648
+ var timestamp = {};
26215
27649
  var allPromises = orderOfQueries.map(function (component) {
26216
27650
  return new Promise(function (responseResolve, responseReject) {
26217
27651
  handleTransformResponse(res[component], component).then(function (response) {
@@ -26230,6 +27664,11 @@
26230
27664
 
26231
27665
  if (response.customData) {
26232
27666
  customData[component] = response.customData;
27667
+ } // Update settings
27668
+
27669
+
27670
+ if (response.settings) {
27671
+ settingsResponse[component] = response.settings;
26233
27672
  }
26234
27673
 
26235
27674
  if (response.aggregations) {
@@ -26238,6 +27677,7 @@
26238
27677
  aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
26239
27678
  }
26240
27679
 
27680
+ timestamp[component] = res._timestamp;
26241
27681
  hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
26242
27682
  hits: response.hits.hits,
26243
27683
  total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
@@ -26253,8 +27693,11 @@
26253
27693
  Promise.all(allPromises).then(function () {
26254
27694
  state = _extends({}, state, {
26255
27695
  hits: hits,
27696
+ timestamp: timestamp,
26256
27697
  aggregations: aggregations,
27698
+ compositeAggregations: compositeAggregations,
26257
27699
  promotedResults: promotedResults,
27700
+ settings: settingsResponse,
26258
27701
  customData: customData,
26259
27702
  rawData: rawData
26260
27703
  });
@@ -26313,21 +27756,21 @@
26313
27756
  });
26314
27757
  }
26315
27758
 
26316
- var version = "1.24.3";
27759
+ var version = "1.27.0-gamma.1";
26317
27760
 
26318
- var _templateObject$n, _templateObject2$a;
27761
+ var _templateObject$o, _templateObject2$a;
26319
27762
 
26320
27763
  var alert = function alert(_ref) {
26321
27764
  var theme = _ref.theme;
26322
- return css(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
27765
+ return css(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
26323
27766
  };
26324
27767
 
26325
27768
  var Content = index$1('div')(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
26326
27769
  return props.alert && alert;
26327
27770
  });
26328
27771
 
26329
- var getClassName$f = lib_8.getClassName,
26330
- isEqual$f = lib_8.isEqual;
27772
+ var getClassName$g = lib_8.getClassName,
27773
+ isEqual$g = lib_8.isEqual;
26331
27774
  var RangeInput = {
26332
27775
  name: 'RangeInput',
26333
27776
  components: {
@@ -26409,7 +27852,7 @@
26409
27852
  handleChange: function handleChange(value, event) {
26410
27853
  var currentValue = value;
26411
27854
 
26412
- if (this.shouldUpdate(value) && !isEqual$f(value, this.currentValue)) {
27855
+ if (this.shouldUpdate(value) && !isEqual$g(value, this.currentValue)) {
26413
27856
  switch (event) {
26414
27857
  case 'change':
26415
27858
  if (!value) {
@@ -26435,7 +27878,7 @@
26435
27878
  }
26436
27879
  },
26437
27880
  handleOnChange: function handleOnChange(value) {
26438
- this.handleChange(value, 'change');
27881
+ this.handleChange(value || this.$props.range, 'change');
26439
27882
  },
26440
27883
  handleValueChange: function handleValueChange(value) {
26441
27884
  this.handleChange(value, 'value-change');
@@ -26479,7 +27922,7 @@
26479
27922
  }
26480
27923
  },
26481
27924
  value: function value(newVal, oldVal) {
26482
- if (!isEqual$f(newVal, oldVal)) {
27925
+ if (!isEqual$g(newVal, oldVal)) {
26483
27926
  if (this.isControlled()) {
26484
27927
  this.handleChange(newVal, 'change');
26485
27928
  }
@@ -26490,6 +27933,10 @@
26490
27933
  if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
26491
27934
  this.handleChange(this.$props.defaultValue);
26492
27935
  }
27936
+
27937
+ if (this.isControlled()) {
27938
+ this.handleChange(this.$props.value, 'change');
27939
+ }
26493
27940
  },
26494
27941
  render: function render() {
26495
27942
  var h = arguments[0];
@@ -26546,7 +27993,7 @@
26546
27993
  "value-change": this.handleValueChange
26547
27994
  }
26548
27995
  }), h(Flex, {
26549
- "class": getClassName$f(innerClass, 'input-container') || ''
27996
+ "class": getClassName$g(innerClass, 'input-container') || ''
26550
27997
  }, [h(Flex, {
26551
27998
  "attrs": {
26552
27999
  "direction": "column",
@@ -26566,7 +28013,7 @@
26566
28013
  "on": {
26567
28014
  "change": this.handleInputChange
26568
28015
  },
26569
- "class": getClassName$f(innerClass, 'input') || '',
28016
+ "class": getClassName$g(innerClass, 'input') || '',
26570
28017
  "domProps": _extends({}, {
26571
28018
  value: this.currentValue.start
26572
28019
  })
@@ -26599,7 +28046,7 @@
26599
28046
  "on": {
26600
28047
  "change": this.handleInputChange
26601
28048
  },
26602
- "class": getClassName$f(innerClass, 'input') || '',
28049
+ "class": getClassName$g(innerClass, 'input') || '',
26603
28050
  "domProps": _extends({}, {
26604
28051
  value: this.currentValue.end
26605
28052
  })
@@ -26611,13 +28058,13 @@
26611
28058
  }
26612
28059
  };
26613
28060
 
26614
- var mapStateToProps$g = function mapStateToProps(state) {
28061
+ var mapStateToProps$h = function mapStateToProps(state) {
26615
28062
  return {
26616
28063
  themePreset: state.config.themePreset
26617
28064
  };
26618
28065
  };
26619
28066
 
26620
- var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$g, {})(RangeInput), {
28067
+ var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$h, {})(RangeInput), {
26621
28068
  componentType: constants_1$1.rangeInput
26622
28069
  });
26623
28070
 
@@ -26628,7 +28075,7 @@
26628
28075
 
26629
28076
  RangeInput.componentType = constants_1$1.rangeInput;
26630
28077
 
26631
- var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
28078
+ var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SearchBox, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
26632
28079
  function install (Vue) {
26633
28080
  components.map(function (component) {
26634
28081
  Vue.use(component);
@@ -26658,6 +28105,7 @@
26658
28105
  exports.ReactiveList = ReactiveList;
26659
28106
  exports.ResultCard = ResultCard;
26660
28107
  exports.ResultList = ResultList;
28108
+ exports.SearchBox = SearchBox;
26661
28109
  exports.SelectedFilters = SelectedFilters;
26662
28110
  exports.SingleDropdownList = SingleDropdownList;
26663
28111
  exports.SingleList = SingleList;