@appbaseio/reactivesearch-vue 1.29.0-preview.1 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1596 -566
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-e0b7c1f6.js → Button-0e2e2c02.js} +1 -1
  6. package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-c48c1085.js} +1 -1
  7. package/dist/cjs/{Card-fd94ef07.js → Card-4fa0f769.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-10bad289.js → ComponentWrapper-6909bc2a.js} +2 -2
  9. package/dist/cjs/{Container-526efa6a.js → Container-cfd69a34.js} +1 -1
  10. package/dist/cjs/{DataSearch-eec21890.js → DataSearch-a8fabd77.js} +236 -84
  11. package/dist/cjs/DataSearch.js +10 -10
  12. package/dist/cjs/{DropDown-e4381fcc.js → DropDown-aa358fff.js} +5 -5
  13. package/dist/cjs/DynamicRangeSlider.js +8 -7
  14. package/dist/cjs/{Flex-f146cdad.js → Flex-63774e4d.js} +1 -1
  15. package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-a9c64bb8.js} +1 -1
  16. package/dist/cjs/{Input-0d7b25ad.js → Input-43868594.js} +1 -1
  17. package/dist/cjs/{ListItem-b40adb04.js → ListItem-38962297.js} +2 -2
  18. package/dist/cjs/MultiDropdownList.js +13 -12
  19. package/dist/cjs/MultiList.js +11 -10
  20. package/dist/cjs/MultiRange.js +9 -8
  21. package/dist/cjs/RangeInput.js +11 -10
  22. package/dist/cjs/RangeSlider.js +9 -8
  23. package/dist/cjs/ReactiveBase.js +69 -35
  24. package/dist/cjs/ReactiveComponent.js +6 -5
  25. package/dist/cjs/ReactiveList.js +22 -15
  26. package/dist/cjs/ResultCard.js +4 -4
  27. package/dist/cjs/ResultList.js +4 -4
  28. package/dist/cjs/SelectedFilters.js +45 -28
  29. package/dist/cjs/SingleDropdownList.js +13 -12
  30. package/dist/cjs/SingleList.js +11 -10
  31. package/dist/cjs/SingleRange.js +10 -9
  32. package/dist/cjs/StateProvider.js +30 -5
  33. package/dist/cjs/{Title-584a8cc8.js → Title-26661936.js} +1 -1
  34. package/dist/cjs/ToggleButton.js +10 -8
  35. package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-91d4b5a6.js} +1 -2
  36. package/dist/cjs/{index-4509aa45.js → index-2e0ea8d8.js} +13 -1
  37. package/dist/cjs/index.js +19 -18
  38. package/dist/cjs/initReactivesearch.js +40 -8
  39. package/dist/cjs/{install-b05fef06.js → install-27314778.js} +232 -70
  40. package/dist/cjs/install.js +19 -18
  41. package/dist/cjs/{ssr-0ee35a09.js → ssr-949cafb5.js} +1 -1
  42. package/dist/cjs/{utils-1219e1fe.js → utils-0df3cb93.js} +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-3970ff42.js} +6 -0
  45. package/dist/es/{Button-33de88e6.js → Button-e18ad90f.js} +1 -1
  46. package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-e3b33cdd.js} +1 -1
  47. package/dist/es/{Card-6446f1b7.js → Card-ad6ba09f.js} +2 -2
  48. package/dist/es/{ComponentWrapper-0f3431d1.js → ComponentWrapper-ca0354ea.js} +2 -2
  49. package/dist/es/{Container-18b03fde.js → Container-421450dc.js} +1 -1
  50. package/dist/es/{DataSearch-42f547cd.js → DataSearch-da9347f7.js} +236 -86
  51. package/dist/es/DataSearch.js +10 -10
  52. package/dist/es/{DropDown-ff6ad982.js → DropDown-604374d2.js} +5 -5
  53. package/dist/es/DynamicRangeSlider.js +8 -7
  54. package/dist/es/{Flex-8770345d.js → Flex-09d40927.js} +1 -1
  55. package/dist/es/{FormControlList-704f8dee.js → FormControlList-38ffe3d3.js} +1 -1
  56. package/dist/es/{Input-e339e63a.js → Input-c9d757bc.js} +1 -1
  57. package/dist/es/{ListItem-8e8fb535.js → ListItem-41d6ddd7.js} +2 -2
  58. package/dist/es/MultiDropdownList.js +13 -12
  59. package/dist/es/MultiList.js +11 -10
  60. package/dist/es/MultiRange.js +9 -8
  61. package/dist/es/RangeInput.js +11 -10
  62. package/dist/es/RangeSlider.js +9 -8
  63. package/dist/es/ReactiveBase.js +70 -36
  64. package/dist/es/ReactiveComponent.js +6 -5
  65. package/dist/es/ReactiveList.js +22 -15
  66. package/dist/es/ResultCard.js +4 -4
  67. package/dist/es/ResultList.js +4 -4
  68. package/dist/es/SelectedFilters.js +45 -28
  69. package/dist/es/SingleDropdownList.js +13 -12
  70. package/dist/es/SingleList.js +11 -10
  71. package/dist/es/SingleRange.js +10 -9
  72. package/dist/es/StateProvider.js +30 -5
  73. package/dist/es/{Title-3522ff56.js → Title-35edd732.js} +1 -1
  74. package/dist/es/ToggleButton.js +10 -8
  75. package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-51ce1182.js} +1 -2
  76. package/dist/es/{index-78920565.js → index-4715798c.js} +13 -2
  77. package/dist/es/index.js +20 -19
  78. package/dist/es/initReactivesearch.js +41 -9
  79. package/dist/es/{install-bd448c02.js → install-5d9cb7ed.js} +232 -70
  80. package/dist/es/install.js +19 -18
  81. package/dist/es/{ssr-a41dfea9.js → ssr-ad57b0ad.js} +1 -1
  82. package/dist/es/{utils-64a2e5f0.js → utils-9b45e0ab.js} +1 -1
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-687b2304.js → vueTypes-c0d8b875.js} +6 -0
  85. package/package.json +3 -3
@@ -154,29 +154,29 @@
154
154
  return typeOfVal;
155
155
  }
156
156
  /**
157
- * Creates a Redux store that holds the state tree.
158
- * The only way to change the data in the store is to call `dispatch()` on it.
157
+ * @deprecated
159
158
  *
160
- * There should only be a single store in your app. To specify how different
161
- * parts of the state tree respond to actions, you may combine several reducers
162
- * into a single reducer function by using `combineReducers`.
159
+ * **We recommend using the `configureStore` method
160
+ * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
163
161
  *
164
- * @param {Function} reducer A function that returns the next state tree, given
165
- * the current state tree and the action to handle.
162
+ * Redux Toolkit is our recommended approach for writing Redux logic today,
163
+ * including store setup, reducers, data fetching, and more.
166
164
  *
167
- * @param {any} [preloadedState] The initial state. You may optionally specify it
168
- * to hydrate the state from the server in universal apps, or to restore a
169
- * previously serialized user session.
170
- * If you use `combineReducers` to produce the root reducer function, this must be
171
- * an object with the same shape as `combineReducers` keys.
165
+ * **For more details, please read this Redux docs page:**
166
+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
172
167
  *
173
- * @param {Function} [enhancer] The store enhancer. You may optionally specify it
174
- * to enhance the store with third-party capabilities such as middleware,
175
- * time travel, persistence, etc. The only store enhancer that ships with Redux
176
- * is `applyMiddleware()`.
168
+ * `configureStore` from Redux Toolkit is an improved version of `createStore` that
169
+ * simplifies setup and helps avoid common bugs.
170
+ *
171
+ * You should not be using the `redux` core package by itself today, except for learning purposes.
172
+ * The `createStore` method from the core `redux` package will not be removed, but we encourage
173
+ * all users to migrate to using Redux Toolkit for all Redux code.
174
+ *
175
+ * If you want to use `createStore` without this visual deprecation warning, use
176
+ * the `legacy_createStore` import instead:
177
+ *
178
+ * `import { legacy_createStore as createStore} from 'redux'`
177
179
  *
178
- * @returns {Store} A Redux store that lets you read the state, dispatch actions
179
- * and subscribe to changes.
180
180
  */
181
181
 
182
182
 
@@ -427,6 +427,39 @@
427
427
  replaceReducer: replaceReducer
428
428
  }, _ref2[$$observable] = observable, _ref2;
429
429
  }
430
+ /**
431
+ * Creates a Redux store that holds the state tree.
432
+ *
433
+ * **We recommend using `configureStore` from the
434
+ * `@reduxjs/toolkit` package**, which replaces `createStore`:
435
+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
436
+ *
437
+ * The only way to change the data in the store is to call `dispatch()` on it.
438
+ *
439
+ * There should only be a single store in your app. To specify how different
440
+ * parts of the state tree respond to actions, you may combine several reducers
441
+ * into a single reducer function by using `combineReducers`.
442
+ *
443
+ * @param {Function} reducer A function that returns the next state tree, given
444
+ * the current state tree and the action to handle.
445
+ *
446
+ * @param {any} [preloadedState] The initial state. You may optionally specify it
447
+ * to hydrate the state from the server in universal apps, or to restore a
448
+ * previously serialized user session.
449
+ * If you use `combineReducers` to produce the root reducer function, this must be
450
+ * an object with the same shape as `combineReducers` keys.
451
+ *
452
+ * @param {Function} [enhancer] The store enhancer. You may optionally specify it
453
+ * to enhance the store with third-party capabilities such as middleware,
454
+ * time travel, persistence, etc. The only store enhancer that ships with Redux
455
+ * is `applyMiddleware()`.
456
+ *
457
+ * @returns {Store} A Redux store that lets you read the state, dispatch actions
458
+ * and subscribe to changes.
459
+ */
460
+
461
+
462
+ var legacy_createStore = createStore;
430
463
  /**
431
464
  * Prints a warning in the console if it exists.
432
465
  *
@@ -434,7 +467,6 @@
434
467
  * @returns {void}
435
468
  */
436
469
 
437
-
438
470
  function warning(message) {
439
471
  /* eslint-disable no-console */
440
472
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
@@ -736,7 +768,8 @@
736
768
  bindActionCreators: bindActionCreators,
737
769
  combineReducers: combineReducers,
738
770
  compose: compose,
739
- createStore: createStore
771
+ createStore: createStore,
772
+ legacy_createStore: legacy_createStore
740
773
  });
741
774
 
742
775
  /** A function that accepts a potential "extra argument" value to be injected later,
@@ -779,12 +812,14 @@
779
812
  var REMOVE_COMPONENT = exports.REMOVE_COMPONENT = 'REMOVE_COMPONENT';
780
813
  var WATCH_COMPONENT = exports.WATCH_COMPONENT = 'WATCH_COMPONENT';
781
814
  var SET_QUERY = exports.SET_QUERY = 'SET_QUERY';
815
+ var SET_APPBASE_QUERY = exports.SET_APPBASE_QUERY = 'SET_APPBASE_QUERY';
782
816
  var SET_QUERY_OPTIONS = exports.SET_QUERY_OPTIONS = 'SET_QUERY_OPTIONS';
783
817
  var EXECUTE_QUERY = exports.EXECUTE_QUERY = 'EXECUTE_QUERY';
784
818
  var UPDATE_HITS = exports.UPDATE_HITS = 'UPDATE_HITS';
785
819
  var UPDATE_AGGS = exports.UPDATE_AGGS = 'UPDATE_AGGS';
786
820
  var UPDATE_COMPOSITE_AGGS = exports.UPDATE_COMPOSITE_AGGS = 'UPDATE_COMPOSITE_AGGS';
787
821
  var ADD_CONFIG = exports.ADD_CONFIG = 'ADD_CONFIG';
822
+ var UPDATE_CONFIG = exports.UPDATE_CONFIG = 'UPDATE_CONFIG';
788
823
  var ADD_APPBASE_REF = exports.ADD_APPBASE_REF = 'ADD_APPBASE_REF';
789
824
  var LOG_QUERY = exports.LOG_QUERY = 'LOG_QUERY';
790
825
  var LOG_COMBINED_QUERY = exports.LOG_COMBINED_QUERY = 'LOG_COMBINED_QUERY';
@@ -796,6 +831,7 @@
796
831
  var SET_TIMESTAMP = exports.SET_TIMESTAMP = 'SET_TIMESTAMP';
797
832
  var SET_HEADERS = exports.SET_HEADERS = 'SET_HEADERS';
798
833
  var SET_MAP_DATA = exports.SET_MAP_DATA = 'SET_MAP_DATA';
834
+ var SET_MAP_RESULTS = exports.SET_MAP_RESULTS = 'SET_MAP_RESULTS';
799
835
  var SET_QUERY_LISTENER = exports.SET_QUERY_LISTENER = 'SET_QUERY_LISTENER';
800
836
  var STORE_KEY = exports.STORE_KEY = '__REACTIVESEARCH__';
801
837
  var SET_SEARCH_ID = exports.SET_SEARCH_ID = 'SET_SEARCH_ID';
@@ -819,6 +855,7 @@
819
855
  var RECENT_SEARCHES_SUCCESS = exports.RECENT_SEARCHES_SUCCESS = 'RECENT_SEARCHES_SUCCESS';
820
856
  var RECENT_SEARCHES_ERROR = exports.RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR';
821
857
  var SET_VALUE = exports.SET_VALUE = 'SET_VALUE';
858
+ var SET_VALUES = exports.SET_VALUES = 'SET_VALUES';
822
859
  var RESET_TO_DEFAULT = exports.RESET_TO_DEFAULT = 'RESET_TO_DEFAULT';
823
860
  var SET_GOOGLE_MAP_SCRIPT_LOADING = exports.SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING';
824
861
  var SET_GOOGLE_MAP_SCRIPT_LOADED = exports.SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED';
@@ -829,50 +866,54 @@
829
866
  var constants_2 = constants.REMOVE_COMPONENT;
830
867
  var constants_3 = constants.WATCH_COMPONENT;
831
868
  var constants_4 = constants.SET_QUERY;
832
- var constants_5 = constants.SET_QUERY_OPTIONS;
833
- var constants_6 = constants.EXECUTE_QUERY;
834
- var constants_7 = constants.UPDATE_HITS;
835
- var constants_8 = constants.UPDATE_AGGS;
836
- var constants_9 = constants.UPDATE_COMPOSITE_AGGS;
837
- var constants_10 = constants.ADD_CONFIG;
838
- var constants_11 = constants.ADD_APPBASE_REF;
839
- var constants_12 = constants.LOG_QUERY;
840
- var constants_13 = constants.LOG_COMBINED_QUERY;
841
- var constants_14 = constants.SET_INTERNAL_VALUE;
842
- var constants_15 = constants.PATCH_VALUE;
843
- var constants_16 = constants.CLEAR_VALUES;
844
- var constants_17 = constants.SET_LOADING;
845
- var constants_18 = constants.SET_ERROR;
846
- var constants_19 = constants.SET_TIMESTAMP;
847
- var constants_20 = constants.SET_HEADERS;
848
- var constants_21 = constants.SET_MAP_DATA;
849
- var constants_22 = constants.SET_QUERY_LISTENER;
850
- var constants_23 = constants.STORE_KEY;
851
- var constants_24 = constants.SET_SEARCH_ID;
852
- var constants_25 = constants.SET_PROMOTED_RESULTS;
853
- var constants_26 = constants.SET_DEFAULT_QUERY;
854
- var constants_27 = constants.SET_CUSTOM_QUERY;
855
- var constants_28 = constants.SET_CUSTOM_HIGHLIGHT_OPTIONS;
856
- var constants_29 = constants.SET_CUSTOM_DATA;
857
- var constants_30 = constants.SET_APPLIED_SETTINGS;
858
- var constants_31 = constants.SET_PROPS;
859
- var constants_32 = constants.UPDATE_PROPS;
860
- var constants_33 = constants.REMOVE_PROPS;
861
- var constants_34 = constants.SET_SUGGESTIONS_SEARCH_VALUE;
862
- var constants_35 = constants.CLEAR_SUGGESTIONS_SEARCH_VALUE;
863
- var constants_36 = constants.SET_SUGGESTIONS_SEARCH_ID;
864
- var constants_37 = constants.UPDATE_ANALYTICS_CONFIG;
865
- var constants_38 = constants.SET_RAW_DATA;
866
- var constants_39 = constants.SET_POPULAR_SUGGESTIONS;
867
- var constants_40 = constants.SET_DEFAULT_POPULAR_SUGGESTIONS;
868
- var constants_41 = constants.SET_QUERY_TO_HITS;
869
- var constants_42 = constants.RECENT_SEARCHES_SUCCESS;
870
- var constants_43 = constants.RECENT_SEARCHES_ERROR;
871
- var constants_44 = constants.SET_VALUE;
872
- var constants_45 = constants.RESET_TO_DEFAULT;
873
- var constants_46 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
874
- var constants_47 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
875
- var constants_48 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
869
+ var constants_5 = constants.SET_APPBASE_QUERY;
870
+ var constants_6 = constants.SET_QUERY_OPTIONS;
871
+ var constants_7 = constants.EXECUTE_QUERY;
872
+ var constants_8 = constants.UPDATE_HITS;
873
+ var constants_9 = constants.UPDATE_AGGS;
874
+ var constants_10 = constants.UPDATE_COMPOSITE_AGGS;
875
+ var constants_11 = constants.ADD_CONFIG;
876
+ var constants_12 = constants.UPDATE_CONFIG;
877
+ var constants_13 = constants.ADD_APPBASE_REF;
878
+ var constants_14 = constants.LOG_QUERY;
879
+ var constants_15 = constants.LOG_COMBINED_QUERY;
880
+ var constants_16 = constants.SET_INTERNAL_VALUE;
881
+ var constants_17 = constants.PATCH_VALUE;
882
+ var constants_18 = constants.CLEAR_VALUES;
883
+ var constants_19 = constants.SET_LOADING;
884
+ var constants_20 = constants.SET_ERROR;
885
+ var constants_21 = constants.SET_TIMESTAMP;
886
+ var constants_22 = constants.SET_HEADERS;
887
+ var constants_23 = constants.SET_MAP_DATA;
888
+ var constants_24 = constants.SET_MAP_RESULTS;
889
+ var constants_25 = constants.SET_QUERY_LISTENER;
890
+ var constants_26 = constants.STORE_KEY;
891
+ var constants_27 = constants.SET_SEARCH_ID;
892
+ var constants_28 = constants.SET_PROMOTED_RESULTS;
893
+ var constants_29 = constants.SET_DEFAULT_QUERY;
894
+ var constants_30 = constants.SET_CUSTOM_QUERY;
895
+ var constants_31 = constants.SET_CUSTOM_HIGHLIGHT_OPTIONS;
896
+ var constants_32 = constants.SET_CUSTOM_DATA;
897
+ var constants_33 = constants.SET_APPLIED_SETTINGS;
898
+ var constants_34 = constants.SET_PROPS;
899
+ var constants_35 = constants.UPDATE_PROPS;
900
+ var constants_36 = constants.REMOVE_PROPS;
901
+ var constants_37 = constants.SET_SUGGESTIONS_SEARCH_VALUE;
902
+ var constants_38 = constants.CLEAR_SUGGESTIONS_SEARCH_VALUE;
903
+ var constants_39 = constants.SET_SUGGESTIONS_SEARCH_ID;
904
+ var constants_40 = constants.UPDATE_ANALYTICS_CONFIG;
905
+ var constants_41 = constants.SET_RAW_DATA;
906
+ var constants_42 = constants.SET_POPULAR_SUGGESTIONS;
907
+ var constants_43 = constants.SET_DEFAULT_POPULAR_SUGGESTIONS;
908
+ var constants_44 = constants.SET_QUERY_TO_HITS;
909
+ var constants_45 = constants.RECENT_SEARCHES_SUCCESS;
910
+ var constants_46 = constants.RECENT_SEARCHES_ERROR;
911
+ var constants_47 = constants.SET_VALUE;
912
+ var constants_48 = constants.SET_VALUES;
913
+ var constants_49 = constants.RESET_TO_DEFAULT;
914
+ var constants_50 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
915
+ var constants_51 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
916
+ var constants_52 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
876
917
 
877
918
  var componentsReducer_1 = createCommonjsModule(function (module, exports) {
878
919
  Object.defineProperty(exports, "__esModule", {
@@ -1126,6 +1167,40 @@
1126
1167
  });
1127
1168
  var queryReducer = unwrapExports(queryReducer_1);
1128
1169
 
1170
+ var appbaseQueryReducer_1 = createCommonjsModule(function (module, exports) {
1171
+ Object.defineProperty(exports, "__esModule", {
1172
+ value: true
1173
+ });
1174
+
1175
+ var _extends = Object.assign || function (target) {
1176
+ for (var i = 1; i < arguments.length; i++) {
1177
+ var source = arguments[i];
1178
+
1179
+ for (var key in source) {
1180
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1181
+ target[key] = source[key];
1182
+ }
1183
+ }
1184
+ }
1185
+
1186
+ return target;
1187
+ };
1188
+
1189
+ exports["default"] = appbaseQueryReducer;
1190
+
1191
+ function appbaseQueryReducer() {
1192
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1193
+ var action = arguments[1];
1194
+
1195
+ if (action.type === constants.SET_APPBASE_QUERY) {
1196
+ return _extends({}, state, action.query);
1197
+ }
1198
+
1199
+ return state;
1200
+ }
1201
+ });
1202
+ unwrapExports(appbaseQueryReducer_1);
1203
+
1129
1204
  var queryOptionsReducer_1 = createCommonjsModule(function (module, exports) {
1130
1205
  Object.defineProperty(exports, "__esModule", {
1131
1206
  value: true
@@ -1200,14 +1275,16 @@
1200
1275
  reactiveList: 'REACTIVELIST',
1201
1276
  dataSearch: 'DATASEARCH',
1202
1277
  categorySearch: 'CATEGORYSEARCH',
1203
- searchBox: 'SUGGESTION',
1278
+ searchBox: 'SEARCHBOX',
1204
1279
  singleList: 'SINGLELIST',
1205
1280
  multiList: 'MULTILIST',
1206
1281
  singleDataList: 'SINGLEDATALIST',
1282
+ tabDataList: 'TABDATALIST',
1207
1283
  singleDropdownList: 'SINGLEDROPDOWNLIST',
1208
1284
  multiDataList: 'MULTIDATALIST',
1209
1285
  multiDropdownList: 'MULTIDROPDOWNLIST',
1210
1286
  singleDropdownRange: 'SINGLEDROPDOWNRANGE',
1287
+ treeList: 'TREELIST',
1211
1288
  numberBox: 'NUMBERBOX',
1212
1289
  tagCloud: 'TAGCLOUD',
1213
1290
  toggleButton: 'TOGGLEBUTTON',
@@ -1223,7 +1300,8 @@
1223
1300
  rangeInput: 'RANGEINPUT',
1224
1301
  geoDistanceDropdown: 'GEO_DISTANCE_DROPDOWN',
1225
1302
  geoDistanceSlider: 'GEO_DISTANCE_SLIDER',
1226
- reactiveMap: 'REACTIVE_MAP'
1303
+ reactiveMap: 'REACTIVE_MAP',
1304
+ reactiveChart: 'REACTIVE_CHART'
1227
1305
  };
1228
1306
  var queryTypes = exports.queryTypes = {
1229
1307
  search: 'search',
@@ -1232,18 +1310,23 @@
1232
1310
  geo: 'geo',
1233
1311
  suggestion: 'suggestion'
1234
1312
  };
1235
- 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'];
1313
+ var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', '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', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint'];
1236
1314
  var CLEAR_ALL = exports.CLEAR_ALL = {
1237
1315
  NEVER: 'never',
1238
1316
  ALWAYS: 'always',
1239
1317
  DEFAULT: 'default'
1240
1318
  };
1319
+ var SEARCH_COMPONENTS_MODES = exports.SEARCH_COMPONENTS_MODES = {
1320
+ SELECT: 'select',
1321
+ TAG: 'tag'
1322
+ };
1241
1323
  });
1242
1324
  unwrapExports(constants$1);
1243
1325
  var constants_1$1 = constants$1.componentTypes;
1244
1326
  var constants_2$1 = constants$1.queryTypes;
1245
1327
  var constants_3$1 = constants$1.validProps;
1246
1328
  var constants_4$1 = constants$1.CLEAR_ALL;
1329
+ var constants_5$1 = constants$1.SEARCH_COMPONENTS_MODES;
1247
1330
 
1248
1331
  var analytics = createCommonjsModule(function (module, exports) {
1249
1332
  Object.defineProperty(exports, "__esModule", {
@@ -1289,7 +1372,7 @@
1289
1372
  };
1290
1373
  }();
1291
1374
 
1292
- var filterComponents = [constants$1.componentTypes.numberBox, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.datePicker, constants$1.componentTypes.dateRange, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.dynamicRangeSlider, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.rangeSlider, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange];
1375
+ var filterComponents = [constants$1.componentTypes.numberBox, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.datePicker, constants$1.componentTypes.dateRange, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.dynamicRangeSlider, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.rangeSlider, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange, constants$1.componentTypes.treeList];
1293
1376
  var rangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.dynamicRangeSlider, constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter];
1294
1377
  var rangeObjectComponents = [constants$1.componentTypes.singleRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
1295
1378
 
@@ -1415,6 +1498,8 @@
1415
1498
  return _extends({}, state, {
1416
1499
  analyticsConfig: _extends({}, state.analyticsConfig, action.analyticsConfig)
1417
1500
  });
1501
+ } else if (action.type === constants.UPDATE_CONFIG) {
1502
+ return _extends({}, state, action.config);
1418
1503
  }
1419
1504
 
1420
1505
  return state;
@@ -1719,16 +1804,41 @@
1719
1804
 
1720
1805
  switch (action.type) {
1721
1806
  case constants.SET_VALUE:
1722
- return _extends({}, state, _defineProperty({}, action.component, {
1723
- value: action.value,
1724
- label: action.label || action.component,
1725
- showFilter: action.showFilter,
1726
- URLParams: action.URLParams,
1727
- componentType: action.componentType,
1728
- category: action.category,
1729
- meta: action.meta,
1730
- reference: action.reference
1731
- }));
1807
+ {
1808
+ var newState = {};
1809
+ Object.keys(action.componentsToReset || {}).forEach(function (id) {
1810
+ newState[id] = _extends({}, state[id], {
1811
+ value: action.componentsToReset[id]
1812
+ });
1813
+ });
1814
+ return _extends({}, state, newState, _defineProperty({}, action.component, {
1815
+ value: action.value,
1816
+ label: action.label || action.component,
1817
+ showFilter: action.showFilter,
1818
+ URLParams: action.URLParams,
1819
+ componentType: action.componentType,
1820
+ category: action.category,
1821
+ meta: action.meta,
1822
+ reference: action.reference
1823
+ }));
1824
+ }
1825
+
1826
+ case constants.SET_VALUES:
1827
+ {
1828
+ var componentKeys = action.componentsValues ? Object.keys(action.componentsValues) : [];
1829
+
1830
+ if (componentKeys.length) {
1831
+ var _newState = {};
1832
+ componentKeys.forEach(function (component) {
1833
+ _newState[component] = _extends({}, state[component], {
1834
+ value: action.componentsValues[component]
1835
+ });
1836
+ });
1837
+ return _extends({}, state, _newState);
1838
+ }
1839
+
1840
+ return state;
1841
+ }
1732
1842
 
1733
1843
  case constants.PATCH_VALUE:
1734
1844
  return _extends({}, state, _defineProperty({}, action.component, _extends({}, state[action.component], action.payload)));
@@ -2108,6 +2218,21 @@
2108
2218
  Object.defineProperty(exports, "__esModule", {
2109
2219
  value: true
2110
2220
  });
2221
+
2222
+ var _extends = Object.assign || function (target) {
2223
+ for (var i = 1; i < arguments.length; i++) {
2224
+ var source = arguments[i];
2225
+
2226
+ for (var key in source) {
2227
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2228
+ target[key] = source[key];
2229
+ }
2230
+ }
2231
+ }
2232
+
2233
+ return target;
2234
+ };
2235
+
2111
2236
  exports["default"] = mapDataReducer;
2112
2237
 
2113
2238
  function _objectWithoutProperties(obj, keys) {
@@ -2142,10 +2267,12 @@
2142
2267
  var action = arguments[1];
2143
2268
 
2144
2269
  if (action.type === constants.SET_MAP_DATA) {
2145
- return _defineProperty({}, action.componentId, {
2270
+ return _extends({}, state, _defineProperty({}, action.componentId, {
2146
2271
  query: action.query,
2147
2272
  persistMapQuery: action.persistMapQuery
2148
- });
2273
+ }));
2274
+ } else if (action.type === constants.SET_MAP_RESULTS) {
2275
+ return _extends({}, state, _defineProperty({}, action.componentId, _extends({}, state[action.componentId], action.payload)));
2149
2276
  } else if (action.type === constants.REMOVE_COMPONENT) {
2150
2277
  var del = state[action.component],
2151
2278
  obj = _objectWithoutProperties(state, [action.component]);
@@ -3270,6 +3397,8 @@
3270
3397
 
3271
3398
  var _queryReducer2 = _interopRequireDefault(queryReducer_1);
3272
3399
 
3400
+ var _appbaseQueryReducer2 = _interopRequireDefault(appbaseQueryReducer_1);
3401
+
3273
3402
  var _queryOptionsReducer2 = _interopRequireDefault(queryOptionsReducer_1);
3274
3403
 
3275
3404
  var _configReducer2 = _interopRequireDefault(configReducer_1);
@@ -3374,7 +3503,8 @@
3374
3503
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3375
3504
  return state;
3376
3505
  },
3377
- googleMapScriptStatus: _googleMapScriptReducer2["default"]
3506
+ googleMapScriptStatus: _googleMapScriptReducer2["default"],
3507
+ lastUsedAppbaseQuery: _appbaseQueryReducer2["default"]
3378
3508
  });
3379
3509
  });
3380
3510
  unwrapExports(reducers);
@@ -4954,7 +5084,7 @@
4954
5084
  Object.defineProperty(exports, "__esModule", {
4955
5085
  value: true
4956
5086
  });
4957
- exports.hasCustomRenderer = exports.getComponent = exports.isFunction = exports.getCalendarIntervalErrorMessage = exports.queryFormatMillisecondsMap = exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.extractQueryFromCustomQuery = exports.getOptionsForCustomQuery = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
5087
+ exports.transformRequestUsingEndpoint = exports.flatten = exports.saveDataAsFile = exports.transformTreeListLocalStateIntoQueryComptaibleFormat = exports.transformRawTreeListData = exports.recLookup = exports.hasCustomRenderer = exports.getComponent = exports.isFunction = exports.getCalendarIntervalErrorMessage = exports.queryFormatMillisecondsMap = exports.featuredSuggestionsActionTypes = exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.extractQueryFromCustomQuery = exports.getOptionsForCustomQuery = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
4958
5088
 
4959
5089
  var _extends = Object.assign || function (target) {
4960
5090
  for (var i = 1; i < arguments.length; i++) {
@@ -4984,6 +5114,7 @@
4984
5114
  exports.normalizeDataField = normalizeDataField;
4985
5115
  exports.handleOnSuggestions = handleOnSuggestions;
4986
5116
  exports.isValidDateRangeQueryFormat = isValidDateRangeQueryFormat;
5117
+ exports.setDeep = setDeep;
4987
5118
 
4988
5119
  var _dateFormats2 = _interopRequireDefault(dateFormats_1);
4989
5120
 
@@ -5524,7 +5655,7 @@
5524
5655
  var updateInternalQuery = exports.updateInternalQuery = function updateInternalQuery(componentId, queryOptions, value, props, defaultQueryToExecute, queryParams) {
5525
5656
  var defaultQuery = props.defaultQuery;
5526
5657
  var defaultQueryOptions = void 0;
5527
- var query = void 0;
5658
+ var query = defaultQueryToExecute;
5528
5659
 
5529
5660
  if (defaultQuery) {
5530
5661
  var queryTobeSet = defaultQuery(value, props);
@@ -5536,14 +5667,15 @@
5536
5667
  updateDefaultQuery(componentId, props, value);
5537
5668
  }
5538
5669
 
5539
- props.setQueryOptions(componentId, _extends({}, defaultQueryOptions, queryOptions || defaultQueryToExecute));
5540
-
5541
5670
  if (query) {
5671
+ props.setQueryOptions(componentId, _extends({}, defaultQueryOptions, queryOptions || defaultQueryToExecute));
5542
5672
  props.updateQuery(_extends({
5543
5673
  componentId: componentId,
5544
5674
  query: query,
5545
5675
  value: value
5546
5676
  }, queryParams));
5677
+ } else {
5678
+ props.setQueryOptions(componentId, _extends({}, defaultQueryOptions, queryOptions || defaultQueryToExecute));
5547
5679
  }
5548
5680
  };
5549
5681
 
@@ -5678,7 +5810,7 @@
5678
5810
  } : null, {
5679
5811
  time: time || 0,
5680
5812
  hidden: hidden,
5681
- promoted: promotedResults && promotedResults.length
5813
+ promoted: promotedResults ? promotedResults.length : 0
5682
5814
  });
5683
5815
  }
5684
5816
 
@@ -5816,7 +5948,12 @@
5816
5948
  Popular: 'popular',
5817
5949
  Index: 'index',
5818
5950
  Recent: 'recent',
5819
- Promoted: 'promoted'
5951
+ Promoted: 'promoted',
5952
+ Featured: 'featured'
5953
+ };
5954
+ var featuredSuggestionsActionTypes = exports.featuredSuggestionsActionTypes = {
5955
+ NAVIGATE: 'navigate',
5956
+ FUNCTION: 'function'
5820
5957
  };
5821
5958
  var queryFormatMillisecondsMap = exports.queryFormatMillisecondsMap = {
5822
5959
  minute: 60000,
@@ -5884,182 +6021,207 @@
5884
6021
  children = props.children;
5885
6022
  return isFunction(children) || isFunction(render);
5886
6023
  };
5887
- });
5888
- unwrapExports(helper);
5889
- var helper_1 = helper.hasCustomRenderer;
5890
- var helper_2 = helper.getComponent;
5891
- var helper_3 = helper.isFunction;
5892
- var helper_4 = helper.getCalendarIntervalErrorMessage;
5893
- var helper_5 = helper.queryFormatMillisecondsMap;
5894
- var helper_6 = helper.suggestionTypes;
5895
- var helper_7 = helper.getTopSuggestions;
5896
- var helper_8 = helper.withClickIds;
5897
- var helper_9 = helper.getCompositeAggsQuery;
5898
- var helper_10 = helper.getAggsQuery;
5899
- var helper_11 = helper.extractQueryFromDefaultQuery;
5900
- var helper_12 = helper.updateInternalQuery;
5901
- var helper_13 = helper.getSearchState;
5902
- var helper_14 = helper.extractQueryFromCustomQuery;
5903
- var helper_15 = helper.getOptionsForCustomQuery;
5904
- var helper_16 = helper.getOptionsFromQuery;
5905
- var helper_17 = helper.parseHits;
5906
- var helper_18 = helper.handleA11yAction;
5907
- var helper_19 = helper.getInnerKey;
5908
- var helper_20 = helper.getClassName;
5909
- var helper_21 = helper.checkSomePropChange;
5910
- var helper_22 = helper.checkPropChange;
5911
- var helper_23 = helper.updateDefaultQuery;
5912
- var helper_24 = helper.updateCustomQuery;
5913
- var helper_25 = helper.isEqual;
5914
- var helper_26 = helper.compareQueries;
5915
- var helper_27 = helper.debounce;
5916
- var helper_28 = helper.getQueryOptions;
5917
- var helper_29 = helper.buildQuery;
5918
- var helper_30 = helper.pushToAndClause;
5919
- var helper_31 = helper.checkValueChange;
5920
- var helper_32 = helper.getAggsOrder;
5921
- var helper_33 = helper.formatDate;
5922
- var helper_34 = helper.getResultStats;
5923
- var helper_35 = helper.extractFieldsFromSource;
5924
- var helper_36 = helper.normalizeDataField;
5925
- var helper_37 = helper.handleOnSuggestions;
5926
- var helper_38 = helper.isValidDateRangeQueryFormat;
5927
-
5928
- var value = createCommonjsModule(function (module, exports) {
5929
- Object.defineProperty(exports, "__esModule", {
5930
- value: true
5931
- });
5932
6024
 
5933
- var _extends = Object.assign || function (target) {
5934
- for (var i = 1; i < arguments.length; i++) {
5935
- var source = arguments[i];
6025
+ var recLookup = exports.recLookup = function recLookup(obj, path) {
6026
+ try {
6027
+ var parts = path.split('.');
5936
6028
 
5937
- for (var key in source) {
5938
- if (Object.prototype.hasOwnProperty.call(source, key)) {
5939
- target[key] = source[key];
5940
- }
6029
+ if (parts.length === 1) {
6030
+ return obj[parts[0]];
5941
6031
  }
5942
- }
5943
6032
 
5944
- return target;
6033
+ return recLookup(obj[parts[0]], parts.slice(1).join('.'));
6034
+ } catch (e) {
6035
+ return false;
6036
+ }
5945
6037
  };
5946
6038
 
5947
- exports.setValue = setValue;
5948
- exports.resetValuesToDefault = resetValuesToDefault;
5949
- exports.setInternalValue = setInternalValue;
5950
- exports.patchValue = patchValue;
5951
- exports.clearValues = clearValues;
6039
+ function setDeep(obj, path, value) {
6040
+ var setrecursively = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
6041
+ path.reduce(function (acc, currentItem, level) {
6042
+ if (setrecursively && typeof acc[currentItem] !== 'object' && level !== path.length - 1) {
6043
+ acc[currentItem] = {};
6044
+ return acc[currentItem];
6045
+ }
5952
6046
 
5953
- function _defineProperty(obj, key, value) {
5954
- if (key in obj) {
5955
- Object.defineProperty(obj, key, {
5956
- value: value,
5957
- enumerable: true,
5958
- configurable: true,
5959
- writable: true
6047
+ if (level === path.length - 1) {
6048
+ acc[currentItem] = value;
6049
+ return value;
6050
+ }
6051
+
6052
+ return typeof acc[currentItem] === 'object' ? acc[currentItem] : {};
6053
+ }, obj);
6054
+ }
6055
+
6056
+ var transformRawTreeListData = exports.transformRawTreeListData = function transformRawTreeListData(data, dataField) {
6057
+ var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
6058
+ var newState = [];
6059
+
6060
+ if (data instanceof Object) {
6061
+ var aggsKeys = Object.keys(data);
6062
+ aggsKeys.forEach(function (key) {
6063
+ if (Array.isArray(data[key].buckets)) {
6064
+ data[key].buckets.forEach(function (bucket) {
6065
+ newState.push(_extends({
6066
+ key: bucket.key,
6067
+ count: bucket.doc_count,
6068
+ level: level
6069
+ }, bucket[dataField[level + 1]] instanceof Object ? {
6070
+ list: transformRawTreeListData(_defineProperty({}, dataField[level + 1], bucket[dataField[level + 1]]), dataField, level + 1)
6071
+ } : {}));
6072
+ });
6073
+ }
5960
6074
  });
5961
- } else {
5962
- obj[key] = value;
5963
6075
  }
5964
6076
 
5965
- return obj;
5966
- }
6077
+ return newState;
6078
+ };
5967
6079
 
5968
- function setValue(component, value, label, showFilter, URLParams, componentType, category, meta) {
5969
- return function (dispatch, getState) {
5970
- var _getState = getState(),
5971
- urlValues = _getState.urlValues;
6080
+ var transformTreeListLocalStateIntoQueryComptaibleFormat = exports.transformTreeListLocalStateIntoQueryComptaibleFormat = function transformTreeListLocalStateIntoQueryComptaibleFormat(obj) {
6081
+ var currentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
6082
+ var result = [];
5972
6083
 
5973
- var reference = void 0;
6084
+ if (obj instanceof Object) {
6085
+ if (Object.keys(obj).length) {
6086
+ Object.keys(obj).forEach(function (key) {
6087
+ if (obj[key] instanceof Object) {
6088
+ result.push.apply(result, _toConsumableArray(transformTreeListLocalStateIntoQueryComptaibleFormat(obj[key], currentPath ? currentPath + ' > ' + key : key)));
6089
+ }
5974
6090
 
5975
- if ((0, helper.isEqual)(urlValues[component], value)) {
5976
- reference = 'URL';
6091
+ if (obj[key] === true) {
6092
+ result.push(currentPath ? currentPath + ' > ' + key : key);
6093
+ }
6094
+ });
6095
+ } else if (currentPath) {
6096
+ result.push(currentPath);
5977
6097
  }
6098
+ }
5978
6099
 
5979
- dispatch({
5980
- type: constants.SET_VALUE,
5981
- component: component,
5982
- reference: reference,
5983
- value: value,
5984
- label: label,
5985
- showFilter: showFilter,
5986
- URLParams: URLParams,
5987
- componentType: componentType,
5988
- category: category,
5989
- meta: meta
5990
- });
5991
- };
5992
- }
6100
+ return result;
6101
+ };
5993
6102
 
5994
- function resetValuesToDefault(clearAllBlacklistComponents) {
5995
- return function (dispatch, getState) {
5996
- var _getState2 = getState(),
5997
- selectedValues = _getState2.selectedValues,
5998
- componentProps = _getState2.props;
6103
+ var saveDataAsFile = exports.saveDataAsFile = function saveDataAsFile() {
6104
+ var filename = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'exportedData';
6105
+ var data = arguments[1];
6106
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'csv';
6107
+ var dataToWrite = data;
6108
+ var dataType = 'text/' + format;
5999
6109
 
6000
- var defaultValues = {};
6001
- var valueToSet = void 0;
6002
- Object.keys(selectedValues).forEach(function (component) {
6003
- if (!(Array.isArray(clearAllBlacklistComponents) && clearAllBlacklistComponents.includes(component))) {
6004
- if (!componentProps[component] || !componentProps[component].componentType || !componentProps[component].defaultValue) {
6005
- valueToSet = null;
6006
- } else if ([constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.dateRange].includes(componentProps[component].componentType)) {
6007
- valueToSet = typeof componentProps[component].defaultValue === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null;
6008
- } else if ([constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange, constants$1.componentTypes.dataSearch, constants$1.componentTypes.datePicker].includes(componentProps[component].componentType)) {
6009
- valueToSet = componentProps[component].defaultValue;
6010
- } else if ([constants$1.componentTypes.categorySearch].includes(componentProps[component].componentType)) {
6011
- valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : '';
6012
- }
6110
+ if (format === 'json') {
6111
+ dataToWrite = JSON.stringify(dataToWrite, 0, 4);
6112
+ }
6013
6113
 
6014
- if (!(0, helper.isEqual)(selectedValues[component].value, valueToSet)) {
6015
- defaultValues = _extends({}, defaultValues, _defineProperty({}, component, _extends({}, selectedValues[component], {
6016
- value: valueToSet
6017
- })));
6018
- }
6114
+ var blob = new Blob([dataToWrite], {
6115
+ type: dataType
6116
+ });
6117
+ var link = document.createElement('a');
6118
+ link.download = filename + '.' + format;
6119
+ link.href = window.URL.createObjectURL(blob);
6120
+ link.dataset.downloadurl = [dataType, link.download, link.href].join(':');
6121
+ var evt = new MouseEvent('click', {
6122
+ view: window,
6123
+ bubbles: true,
6124
+ cancelable: true
6125
+ });
6126
+ link.dispatchEvent(evt);
6127
+ link.remove();
6128
+ };
6129
+
6130
+ var flatten = exports.flatten = function flatten(data) {
6131
+ var result = {};
6132
+
6133
+ function recurse(cur) {
6134
+ var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
6135
+
6136
+ if (Object(cur) !== cur) {
6137
+ result[prop] = cur;
6138
+ } else if (Array.isArray(cur)) {
6139
+ result[prop] = JSON.stringify(cur);
6140
+ } else {
6141
+ var isEmpty = true;
6142
+ Object.keys(cur).forEach(function (p) {
6143
+ isEmpty = false;
6144
+ recurse(cur[p], prop ? prop + '.' + p : p);
6145
+ });
6146
+
6147
+ if (isEmpty && prop) {
6148
+ result[prop] = {};
6019
6149
  }
6020
- });
6021
- dispatch({
6022
- type: constants.RESET_TO_DEFAULT,
6023
- defaultValues: defaultValues
6024
- });
6025
- };
6026
- }
6150
+ }
6151
+ }
6027
6152
 
6028
- function setInternalValue(component, value, componentType, category, meta) {
6029
- return {
6030
- type: constants.SET_INTERNAL_VALUE,
6031
- component: component,
6032
- value: value,
6033
- componentType: componentType,
6034
- category: category,
6035
- meta: meta
6036
- };
6037
- }
6153
+ recurse(data);
6154
+ return result;
6155
+ };
6038
6156
 
6039
- function patchValue(component, payload) {
6040
- return {
6041
- type: constants.PATCH_VALUE,
6042
- component: component,
6043
- payload: payload
6044
- };
6045
- }
6157
+ var transformRequestUsingEndpoint = function transformRequestUsingEndpoint(request, endpointParam) {
6158
+ if (endpointParam instanceof Object) {
6159
+ var _endpointParam$header = endpointParam.headers,
6160
+ headers = _endpointParam$header === undefined ? {} : _endpointParam$header,
6161
+ body = endpointParam.body,
6162
+ rest = _objectWithoutProperties(endpointParam, ['headers', 'body']);
6046
6163
 
6047
- function clearValues() {
6048
- var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6049
- var clearAllBlacklistComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6050
- return {
6051
- type: constants.CLEAR_VALUES,
6052
- resetValues: resetValues,
6053
- clearAllBlacklistComponents: clearAllBlacklistComponents
6054
- };
6055
- }
6164
+ var endpointModifiedRequest = _extends({}, request, rest, {
6165
+ headers: _extends({}, request.headers, headers)
6166
+ }, body instanceof Object ? {
6167
+ body: JSON.stringify(body)
6168
+ } : {});
6169
+
6170
+ return endpointModifiedRequest;
6171
+ }
6172
+
6173
+ return request;
6174
+ };
6175
+
6176
+ exports.transformRequestUsingEndpoint = transformRequestUsingEndpoint;
6056
6177
  });
6057
- unwrapExports(value);
6058
- var value_1 = value.setValue;
6059
- var value_2 = value.resetValuesToDefault;
6060
- var value_3 = value.setInternalValue;
6061
- var value_4 = value.patchValue;
6062
- var value_5 = value.clearValues;
6178
+ unwrapExports(helper);
6179
+ var helper_1 = helper.transformRequestUsingEndpoint;
6180
+ var helper_2 = helper.flatten;
6181
+ var helper_3 = helper.saveDataAsFile;
6182
+ var helper_4 = helper.transformTreeListLocalStateIntoQueryComptaibleFormat;
6183
+ var helper_5 = helper.transformRawTreeListData;
6184
+ var helper_6 = helper.recLookup;
6185
+ var helper_7 = helper.hasCustomRenderer;
6186
+ var helper_8 = helper.getComponent;
6187
+ var helper_9 = helper.isFunction;
6188
+ var helper_10 = helper.getCalendarIntervalErrorMessage;
6189
+ var helper_11 = helper.queryFormatMillisecondsMap;
6190
+ var helper_12 = helper.featuredSuggestionsActionTypes;
6191
+ var helper_13 = helper.suggestionTypes;
6192
+ var helper_14 = helper.getTopSuggestions;
6193
+ var helper_15 = helper.withClickIds;
6194
+ var helper_16 = helper.getCompositeAggsQuery;
6195
+ var helper_17 = helper.getAggsQuery;
6196
+ var helper_18 = helper.extractQueryFromDefaultQuery;
6197
+ var helper_19 = helper.updateInternalQuery;
6198
+ var helper_20 = helper.getSearchState;
6199
+ var helper_21 = helper.extractQueryFromCustomQuery;
6200
+ var helper_22 = helper.getOptionsForCustomQuery;
6201
+ var helper_23 = helper.getOptionsFromQuery;
6202
+ var helper_24 = helper.parseHits;
6203
+ var helper_25 = helper.handleA11yAction;
6204
+ var helper_26 = helper.getInnerKey;
6205
+ var helper_27 = helper.getClassName;
6206
+ var helper_28 = helper.checkSomePropChange;
6207
+ var helper_29 = helper.checkPropChange;
6208
+ var helper_30 = helper.updateDefaultQuery;
6209
+ var helper_31 = helper.updateCustomQuery;
6210
+ var helper_32 = helper.isEqual;
6211
+ var helper_33 = helper.compareQueries;
6212
+ var helper_34 = helper.debounce;
6213
+ var helper_35 = helper.getQueryOptions;
6214
+ var helper_36 = helper.buildQuery;
6215
+ var helper_37 = helper.pushToAndClause;
6216
+ var helper_38 = helper.checkValueChange;
6217
+ var helper_39 = helper.getAggsOrder;
6218
+ var helper_40 = helper.formatDate;
6219
+ var helper_41 = helper.getResultStats;
6220
+ var helper_42 = helper.extractFieldsFromSource;
6221
+ var helper_43 = helper.normalizeDataField;
6222
+ var helper_44 = helper.handleOnSuggestions;
6223
+ var helper_45 = helper.isValidDateRangeQueryFormat;
6224
+ var helper_46 = helper.setDeep;
6063
6225
 
6064
6226
  var hits = createCommonjsModule(function (module, exports) {
6065
6227
  Object.defineProperty(exports, "__esModule", {
@@ -6114,6 +6276,10 @@
6114
6276
 
6115
6277
  function mockDataForTesting(component, data) {
6116
6278
  return function (dispatch) {
6279
+ if (data.hasOwnProperty('error')) {
6280
+ dispatch((0, misc.setError)(component, data.error));
6281
+ }
6282
+
6117
6283
  if (data.hasOwnProperty('aggregations')) {
6118
6284
  dispatch(updateAggs(component, data.aggregations));
6119
6285
  }
@@ -6159,6 +6325,7 @@
6159
6325
  exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded;
6160
6326
  exports.setGoogleMapScriptError = setGoogleMapScriptError;
6161
6327
  exports.resetStoreForComponent = resetStoreForComponent;
6328
+ exports.setLastUsedAppbaseQuery = setLastUsedAppbaseQuery;
6162
6329
 
6163
6330
  function setRawData(component, response) {
6164
6331
  return {
@@ -6366,6 +6533,13 @@
6366
6533
  }, 0));
6367
6534
  };
6368
6535
  }
6536
+
6537
+ function setLastUsedAppbaseQuery(query) {
6538
+ return {
6539
+ type: constants.SET_APPBASE_QUERY,
6540
+ query: query
6541
+ };
6542
+ }
6369
6543
  });
6370
6544
  unwrapExports(misc);
6371
6545
  var misc_1 = misc.setRawData;
@@ -6392,6 +6566,7 @@
6392
6566
  var misc_22 = misc.setGoogleMapScriptLoaded;
6393
6567
  var misc_23 = misc.setGoogleMapScriptError;
6394
6568
  var misc_24 = misc.resetStoreForComponent;
6569
+ var misc_25 = misc.setLastUsedAppbaseQuery;
6395
6570
 
6396
6571
  var xdate = createCommonjsModule(function (module) {
6397
6572
  /**
@@ -7254,7 +7429,7 @@
7254
7429
  return obj;
7255
7430
  }
7256
7431
 
7257
- 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);
7432
+ 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.reactiveChart, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.treeList, 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);
7258
7433
  var multiRangeComponents = [constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
7259
7434
  var dateRangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.datePicker];
7260
7435
  var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch, constants$1.componentTypes.searchBox];
@@ -7295,7 +7470,7 @@
7295
7470
 
7296
7471
  var isComponentUsesLabelAsValue = exports.isComponentUsesLabelAsValue = function isComponentUsesLabelAsValue() {
7297
7472
  var componentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
7298
- return componentType === constants$1.componentTypes.multiDataList || componentType === constants$1.componentTypes.singleDataList;
7473
+ return componentType === constants$1.componentTypes.multiDataList || componentType === constants$1.componentTypes.singleDataList || componentType === constants$1.componentTypes.tabDataList;
7299
7474
  };
7300
7475
 
7301
7476
  var hasPaginationSupport = exports.hasPaginationSupport = function hasPaginationSupport() {
@@ -7313,6 +7488,12 @@
7313
7488
  return null;
7314
7489
  }
7315
7490
 
7491
+ var endpoint = void 0;
7492
+
7493
+ if (props.endpoint instanceof Object) {
7494
+ endpoint = props.endpoint;
7495
+ }
7496
+
7316
7497
  return _extends({
7317
7498
  id: componentId,
7318
7499
  type: queryType,
@@ -7352,16 +7533,23 @@
7352
7533
  distinctField: props.distinctField,
7353
7534
  distinctFieldConfig: props.distinctFieldConfig,
7354
7535
  index: props.index
7355
- }, queryType === constants$1.queryTypes.suggestion ? {
7536
+ }, queryType === constants$1.queryTypes.suggestion ? _extends({
7356
7537
  enablePopularSuggestions: props.enablePopularSuggestions,
7357
7538
  enableRecentSuggestions: props.enableRecentSuggestions,
7358
7539
  popularSuggestionsConfig: props.popularSuggestionsConfig,
7359
7540
  recentSuggestionsConfig: props.recentSuggestionsConfig,
7360
7541
  applyStopwords: props.applyStopwords,
7361
7542
  customStopwords: props.customStopwords,
7362
- enablePredictiveSuggestions: props.enablePredictiveSuggestions
7363
- } : {}, {
7364
- calendarInterval: props.calendarInterval
7543
+ enablePredictiveSuggestions: props.enablePredictiveSuggestions,
7544
+ featuredSuggestionsConfig: props.featuredSuggestionsConfig,
7545
+ indexSuggestionsConfig: props.indexSuggestionsConfig,
7546
+ enableFeaturedSuggestions: props.enableFeaturedSuggestions,
7547
+ enableIndexSuggestions: props.enableIndexSuggestions
7548
+ }, props.searchboxId ? {
7549
+ searchboxId: props.searchboxId
7550
+ } : {}) : {}, {
7551
+ calendarInterval: props.calendarInterval,
7552
+ endpoint: endpoint
7365
7553
  });
7366
7554
  }
7367
7555
 
@@ -7388,15 +7576,15 @@
7388
7576
  return null;
7389
7577
  }
7390
7578
 
7391
- var queryType = componentToTypeMap[componentProps.componentType];
7579
+ var queryType = componentProps.type ? componentProps.type : componentToTypeMap[componentProps.componentType];
7392
7580
  var calcValues = store.selectedValues[component] || store.internalValues[component];
7393
7581
  var value = calcValues !== undefined && calcValues !== null ? calcValues.value : undefined;
7394
7582
  var queryFormat = componentProps.queryFormat;
7395
7583
  var calendarInterval = void 0;
7396
7584
  var interval = componentProps.interval;
7397
- var type = componentToTypeMap[componentProps.componentType];
7585
+ var type = queryType;
7398
7586
  var dataField = componentProps.dataField;
7399
- var aggregations = void 0;
7587
+ var aggregations = componentProps.aggregations;
7400
7588
  var pagination = void 0;
7401
7589
  var from = componentProps.from;
7402
7590
 
@@ -7600,7 +7788,26 @@
7600
7788
  value = undefined;
7601
7789
  }
7602
7790
 
7791
+ var queryValue = value || undefined;
7792
+
7793
+ if (componentProps.componentType === constants$1.componentTypes.searchBox) {
7794
+ if (Array.isArray(queryValue)) {
7795
+ queryValue = undefined;
7796
+ }
7797
+ }
7798
+
7799
+ var endpoint = void 0;
7800
+
7801
+ if (store.config && store.config.endpoint instanceof Object) {
7802
+ endpoint = store.config.endpoint;
7803
+ }
7804
+
7805
+ if (componentProps.endpoint instanceof Object) {
7806
+ endpoint = _extends({}, endpoint || {}, componentProps.endpoint);
7807
+ }
7808
+
7603
7809
  return _extends({}, componentProps, {
7810
+ endpoint: endpoint,
7604
7811
  calendarInterval: calendarInterval,
7605
7812
  dataField: dataField,
7606
7813
  queryFormat: queryFormat,
@@ -7612,7 +7819,7 @@
7612
7819
  defaultQuery: store.defaultQueries ? store.defaultQueries[component] : undefined,
7613
7820
  customHighlight: store.customHighlightOptions ? store.customHighlightOptions[component] : undefined,
7614
7821
  categoryValue: store.internalValues[component] ? store.internalValues[component].category : undefined,
7615
- value: componentProps.componentType === constants$1.componentTypes.searchBox ? value || undefined : value,
7822
+ value: queryValue,
7616
7823
  pagination: pagination,
7617
7824
  from: from
7618
7825
  }, customOptions);
@@ -7667,6 +7874,8 @@
7667
7874
  type: constants$1.queryTypes.search
7668
7875
  } : {}, calcValues.category ? {
7669
7876
  categoryValue: calcValues.category
7877
+ } : {}, calcValues.value ? {
7878
+ value: calcValues.value
7670
7879
  } : {}) : {})), execute);
7671
7880
 
7672
7881
  if (dependentQuery) {
@@ -7711,10 +7920,26 @@
7711
7920
  }
7712
7921
  }
7713
7922
 
7714
- return target;
7715
- };
7716
-
7717
- exports.executeQueryListener = executeQueryListener;
7923
+ return target;
7924
+ };
7925
+
7926
+ exports.executeQueryListener = executeQueryListener;
7927
+ exports.updateStoreConfig = updateStoreConfig;
7928
+
7929
+ function _defineProperty(obj, key, value) {
7930
+ if (key in obj) {
7931
+ Object.defineProperty(obj, key, {
7932
+ value: value,
7933
+ enumerable: true,
7934
+ configurable: true,
7935
+ writable: true
7936
+ });
7937
+ } else {
7938
+ obj[key] = value;
7939
+ }
7940
+
7941
+ return obj;
7942
+ }
7718
7943
 
7719
7944
  var handleTransformResponse = exports.handleTransformResponse = function handleTransformResponse() {
7720
7945
  var res = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
@@ -7790,14 +8015,17 @@
7790
8015
  _ref2$appendToAggs = _ref2.appendToAggs,
7791
8016
  appendToAggs = _ref2$appendToAggs === undefined ? false : _ref2$appendToAggs,
7792
8017
  _ref2$isSuggestionsQu = _ref2.isSuggestionsQuery,
7793
- isSuggestionsQuery = _ref2$isSuggestionsQu === undefined ? false : _ref2$isSuggestionsQu;
8018
+ isSuggestionsQuery = _ref2$isSuggestionsQu === undefined ? false : _ref2$isSuggestionsQu,
8019
+ query = _ref2.query,
8020
+ queryId = _ref2.queryId;
7794
8021
 
7795
8022
  var getState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
7796
8023
  var dispatch = arguments[2];
7797
8024
 
7798
8025
  var _getState3 = getState(),
7799
8026
  config = _getState3.config,
7800
- internalValues = _getState3.internalValues;
8027
+ internalValues = _getState3.internalValues,
8028
+ lastUsedAppbaseQuery = _getState3.lastUsedAppbaseQuery;
7801
8029
 
7802
8030
  var searchId = res._headers ? res._headers.get('X-Search-Id') : null;
7803
8031
 
@@ -7811,6 +8039,10 @@
7811
8039
 
7812
8040
  orderOfQueries.forEach(function (component) {
7813
8041
  if (isComponentActive(getState, component)) {
8042
+ if (lastUsedAppbaseQuery[component] && lastUsedAppbaseQuery[component].queryId && queryId && lastUsedAppbaseQuery[component].queryId !== queryId) {
8043
+ return;
8044
+ }
8045
+
7814
8046
  if (res.settings) {
7815
8047
  dispatch((0, misc.setAppliedSettings)(res.settings, component));
7816
8048
  }
@@ -7818,7 +8050,8 @@
7818
8050
  handleTransformResponse(res[component], config, component).then(function (response) {
7819
8051
  if (response) {
7820
8052
  var _getState4 = getState(),
7821
- timestamp = _getState4.timestamp;
8053
+ timestamp = _getState4.timestamp,
8054
+ props = _getState4.props;
7822
8055
 
7823
8056
  if (timestamp[component] === undefined || timestamp[component] < res._timestamp) {
7824
8057
  var promotedResults = response.promoted;
@@ -7839,6 +8072,13 @@
7839
8072
 
7840
8073
  if (response.hits) {
7841
8074
  dispatch((0, misc.setTimestamp)(component, res._timestamp));
8075
+
8076
+ if (props[component].componentType === constants$1.componentTypes.reactiveList && query.find(function (queryItem) {
8077
+ return queryItem.id === component;
8078
+ }).execute) {
8079
+ dispatch((0, misc.setLastUsedAppbaseQuery)(_defineProperty({}, component, query)));
8080
+ }
8081
+
7842
8082
  dispatch((0, hits.updateHits)(component, response.hits, response.took, response.hits && response.hits.hidden, appendToHits));
7843
8083
  var internalComponentID = (0, transform.getInternalComponentID)(component);
7844
8084
 
@@ -8005,6 +8245,15 @@
8005
8245
  listener.onQueryChange(oldQuery, newQuery);
8006
8246
  }
8007
8247
  }
8248
+
8249
+ function updateStoreConfig(payload) {
8250
+ return function (dispatch) {
8251
+ dispatch({
8252
+ type: constants.UPDATE_CONFIG,
8253
+ config: payload
8254
+ });
8255
+ };
8256
+ }
8008
8257
  });
8009
8258
  unwrapExports(utils);
8010
8259
  var utils_1 = utils.getSuggestionQuery;
@@ -8016,6 +8265,201 @@
8016
8265
  var utils_7 = utils.isComponentActive;
8017
8266
  var utils_8 = utils.handleTransformResponse;
8018
8267
  var utils_9 = utils.executeQueryListener;
8268
+ var utils_10 = utils.updateStoreConfig;
8269
+
8270
+ var value = createCommonjsModule(function (module, exports) {
8271
+ Object.defineProperty(exports, "__esModule", {
8272
+ value: true
8273
+ });
8274
+
8275
+ var _extends = Object.assign || function (target) {
8276
+ for (var i = 1; i < arguments.length; i++) {
8277
+ var source = arguments[i];
8278
+
8279
+ for (var key in source) {
8280
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
8281
+ target[key] = source[key];
8282
+ }
8283
+ }
8284
+ }
8285
+
8286
+ return target;
8287
+ };
8288
+
8289
+ exports.setValue = setValue;
8290
+ exports.resetValuesToDefault = resetValuesToDefault;
8291
+ exports.setInternalValue = setInternalValue;
8292
+ exports.patchValue = patchValue;
8293
+ exports.clearValues = clearValues;
8294
+ exports.setValues = setValues;
8295
+
8296
+ function _defineProperty(obj, key, value) {
8297
+ if (key in obj) {
8298
+ Object.defineProperty(obj, key, {
8299
+ value: value,
8300
+ enumerable: true,
8301
+ configurable: true,
8302
+ writable: true
8303
+ });
8304
+ } else {
8305
+ obj[key] = value;
8306
+ }
8307
+
8308
+ return obj;
8309
+ }
8310
+
8311
+ function _toConsumableArray(arr) {
8312
+ if (Array.isArray(arr)) {
8313
+ for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
8314
+ arr2[i] = arr[i];
8315
+ }
8316
+
8317
+ return arr2;
8318
+ } else {
8319
+ return Array.from(arr);
8320
+ }
8321
+ }
8322
+
8323
+ function setValue(component, value, label, showFilter, URLParams, componentType, category, meta, updateSource) {
8324
+ return function (dispatch, getState) {
8325
+ var _getState = getState(),
8326
+ urlValues = _getState.urlValues,
8327
+ selectedValues = _getState.selectedValues,
8328
+ watchMan = _getState.watchMan,
8329
+ props = _getState.props;
8330
+
8331
+ var reference = updateSource;
8332
+
8333
+ if ((0, helper.isEqual)(urlValues[component], value)) {
8334
+ reference = 'URL';
8335
+ }
8336
+
8337
+ var componentsToReset = {};
8338
+ var isResultComponent = [constants$1.componentTypes.reactiveList, constants$1.componentTypes.reactiveMap].includes(props[component] && props[component].componentType);
8339
+ var previousValue = selectedValues[component] && selectedValues[component].value;
8340
+
8341
+ if (!(0, helper.isEqual)(previousValue, value) && props[component] && !isResultComponent) {
8342
+ var componentList = [component];
8343
+ var watchList = watchMan[component] || [];
8344
+ componentList = [].concat(_toConsumableArray(componentList), _toConsumableArray(watchList));
8345
+ componentList.forEach(function (comp) {
8346
+ var componentProps = props[comp];
8347
+
8348
+ if (reference !== 'URL' && componentProps && [constants$1.componentTypes.reactiveList, constants$1.componentTypes.reactiveMap].includes(componentProps.componentType)) {
8349
+ if (selectedValues[comp] !== null) {
8350
+ componentsToReset[comp] = null;
8351
+ }
8352
+ }
8353
+ });
8354
+ }
8355
+
8356
+ if (isResultComponent) {
8357
+ if (value < 2 && (!previousValue || previousValue < 2)) {
8358
+ return;
8359
+ }
8360
+ }
8361
+
8362
+ dispatch({
8363
+ type: constants.SET_VALUE,
8364
+ component: component,
8365
+ reference: reference,
8366
+ value: value,
8367
+ label: label,
8368
+ showFilter: showFilter,
8369
+ URLParams: URLParams,
8370
+ componentType: componentType,
8371
+ category: category,
8372
+ meta: meta,
8373
+ componentsToReset: componentsToReset
8374
+ });
8375
+ };
8376
+ }
8377
+
8378
+ function resetValuesToDefault(clearAllBlacklistComponents) {
8379
+ return function (dispatch, getState) {
8380
+ var _getState2 = getState(),
8381
+ selectedValues = _getState2.selectedValues,
8382
+ componentProps = _getState2.props;
8383
+
8384
+ var defaultValues = {};
8385
+ var valueToSet = void 0;
8386
+ Object.keys(selectedValues).forEach(function (component) {
8387
+ if (!(Array.isArray(clearAllBlacklistComponents) && clearAllBlacklistComponents.includes(component))) {
8388
+ if (!componentProps[component] || !componentProps[component].componentType || !componentProps[component].defaultValue) {
8389
+ valueToSet = null;
8390
+ } else if ([constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.dateRange].includes(componentProps[component].componentType)) {
8391
+ valueToSet = typeof componentProps[component].defaultValue === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null;
8392
+ } else if ([constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange, constants$1.componentTypes.dataSearch, constants$1.componentTypes.datePicker, constants$1.componentTypes.treeList].includes(componentProps[component].componentType)) {
8393
+ valueToSet = componentProps[component].defaultValue;
8394
+ } else if ([constants$1.componentTypes.categorySearch].includes(componentProps[component].componentType)) {
8395
+ valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : '';
8396
+ }
8397
+
8398
+ if (!(0, helper.isEqual)(selectedValues[component].value, valueToSet)) {
8399
+ defaultValues = _extends({}, defaultValues, _defineProperty({}, component, _extends({}, selectedValues[component], {
8400
+ value: valueToSet
8401
+ })));
8402
+ }
8403
+ }
8404
+ });
8405
+ dispatch({
8406
+ type: constants.RESET_TO_DEFAULT,
8407
+ defaultValues: defaultValues
8408
+ });
8409
+ };
8410
+ }
8411
+
8412
+ function setInternalValue(component, value, componentType, category, meta) {
8413
+ return {
8414
+ type: constants.SET_INTERNAL_VALUE,
8415
+ component: component,
8416
+ value: value,
8417
+ componentType: componentType,
8418
+ category: category,
8419
+ meta: meta
8420
+ };
8421
+ }
8422
+
8423
+ function patchValue(component, payload) {
8424
+ return {
8425
+ type: constants.PATCH_VALUE,
8426
+ component: component,
8427
+ payload: payload
8428
+ };
8429
+ }
8430
+
8431
+ function clearValues() {
8432
+ var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8433
+ var clearAllBlacklistComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
8434
+ return {
8435
+ type: constants.CLEAR_VALUES,
8436
+ resetValues: resetValues,
8437
+ clearAllBlacklistComponents: clearAllBlacklistComponents
8438
+ };
8439
+ }
8440
+
8441
+ function setValues(componentsValues) {
8442
+ return function (dispatch) {
8443
+ dispatch((0, utils.updateStoreConfig)({
8444
+ queryLockConfig: {
8445
+ initialTimestamp: new Date().getTime(),
8446
+ lockTime: 300
8447
+ }
8448
+ }));
8449
+ dispatch({
8450
+ type: constants.SET_VALUES,
8451
+ componentsValues: componentsValues
8452
+ });
8453
+ };
8454
+ }
8455
+ });
8456
+ unwrapExports(value);
8457
+ var value_1 = value.setValue;
8458
+ var value_2 = value.resetValuesToDefault;
8459
+ var value_3 = value.setInternalValue;
8460
+ var value_4 = value.patchValue;
8461
+ var value_5 = value.clearValues;
8462
+ var value_6 = value.setValues;
8019
8463
 
8020
8464
  var maps = createCommonjsModule(function (module, exports) {
8021
8465
  Object.defineProperty(exports, "__esModule", {
@@ -8023,6 +8467,7 @@
8023
8467
  });
8024
8468
  exports.updateMapData = updateMapData;
8025
8469
  exports.setMapData = setMapData;
8470
+ exports.setMapResults = setMapResults;
8026
8471
 
8027
8472
  function updateMapData(componentId, query, persistMapQuery) {
8028
8473
  return {
@@ -8035,6 +8480,7 @@
8035
8480
 
8036
8481
  function setMapData(componentId, query$1, persistMapQuery, forceExecute) {
8037
8482
  var meta = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
8483
+ var queryId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
8038
8484
  return function (dispatch) {
8039
8485
  dispatch(updateMapData(componentId, query$1, persistMapQuery));
8040
8486
  dispatch((0, value.setInternalValue)((0, transform.getInternalComponentID)(componentId), undefined, undefined, undefined, meta));
@@ -8042,7 +8488,22 @@
8042
8488
  if (forceExecute) {
8043
8489
  var executeWatchList = false;
8044
8490
  var mustExecuteMapQuery = true;
8045
- dispatch((0, query.executeQuery)(componentId, executeWatchList, mustExecuteMapQuery));
8491
+ dispatch((0, query.executeQuery)(componentId, executeWatchList, mustExecuteMapQuery, constants$1.componentTypes.reactiveMap, {}, queryId));
8492
+ }
8493
+ };
8494
+ }
8495
+
8496
+ function setMapResults(componentId, _ref) {
8497
+ var center = _ref.center,
8498
+ zoom = _ref.zoom,
8499
+ markers = _ref.markers;
8500
+ return {
8501
+ type: constants.SET_MAP_RESULTS,
8502
+ componentId: componentId,
8503
+ payload: {
8504
+ center: center,
8505
+ zoom: zoom,
8506
+ markers: markers
8046
8507
  }
8047
8508
  };
8048
8509
  }
@@ -8050,6 +8511,7 @@
8050
8511
  unwrapExports(maps);
8051
8512
  var maps_1 = maps.updateMapData;
8052
8513
  var maps_2 = maps.setMapData;
8514
+ var maps_3 = maps.setMapResults;
8053
8515
 
8054
8516
  var browserPonyfill = createCommonjsModule(function (module, exports) {
8055
8517
  var global = typeof self !== 'undefined' ? self : commonjsGlobal;
@@ -8713,6 +9175,7 @@
8713
9175
  exports.setQueryOptions = setQueryOptions;
8714
9176
  exports.updateQuery = updateQuery;
8715
9177
  exports.loadMore = loadMore;
9178
+ exports.loadDataToExport = loadDataToExport;
8716
9179
 
8717
9180
  var _analytics2 = _interopRequireDefault(analytics);
8718
9181
 
@@ -8917,6 +9380,7 @@
8917
9380
 
8918
9381
  function appbaseSearch() {
8919
9382
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
9383
+ queryId = _ref.queryId,
8920
9384
  query = _ref.query,
8921
9385
  orderOfQueries = _ref.orderOfQueries,
8922
9386
  _ref$appendToHits = _ref.appendToHits,
@@ -8972,12 +9436,15 @@
8972
9436
  res: res,
8973
9437
  orderOfQueries: orderOfQueries,
8974
9438
  appendToHits: appendToHits,
8975
- appendToAggs: appendToAggs
9439
+ appendToAggs: appendToAggs,
9440
+ query: query,
9441
+ queryId: queryId
8976
9442
  }, getState, dispatch);
8977
9443
  })["catch"](function (err) {
8978
9444
  (0, utils.handleError)({
8979
9445
  orderOfQueries: orderOfQueries,
8980
- error: err
9446
+ error: err,
9447
+ queryId: queryId
8981
9448
  }, getState, dispatch);
8982
9449
  });
8983
9450
  };
@@ -8991,6 +9458,7 @@
8991
9458
  var mustExecuteMapQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8992
9459
  var componentType = arguments[3];
8993
9460
  var metaOptions = arguments[4];
9461
+ var requestId = arguments[5];
8994
9462
  return function (dispatch, getState) {
8995
9463
  var _getState4 = getState(),
8996
9464
  queryLog = _getState4.queryLog,
@@ -9002,11 +9470,17 @@
9002
9470
  queryOptions = _getState4.queryOptions,
9003
9471
  queryListener = _getState4.queryListener,
9004
9472
  props = _getState4.props,
9005
- selectedValues = _getState4.selectedValues,
9006
9473
  internalValues = _getState4.internalValues;
9007
9474
 
9008
9475
  var lockTime = config.initialQueriesSyncTime;
9009
9476
  var initialTimestamp = config.initialTimestamp;
9477
+ var queryId = requestId || new Date().getTime();
9478
+
9479
+ if (config.queryLockConfig instanceof Object) {
9480
+ lockTime = config.queryLockConfig.lockTime;
9481
+ initialTimestamp = config.queryLockConfig.initialTimestamp;
9482
+ }
9483
+
9010
9484
  var componentList = [componentId];
9011
9485
  var finalQuery = [];
9012
9486
  var appbaseQuery = {};
@@ -9022,12 +9496,6 @@
9022
9496
  match_all: {}
9023
9497
  };
9024
9498
  componentList.forEach(function (component) {
9025
- var componentProps = props[component];
9026
-
9027
- if (selectedValues[componentId] && selectedValues[componentId].reference !== 'URL' && componentProps && [constants$1.componentTypes.reactiveList, constants$1.componentTypes.reactiveMap].includes(componentProps.componentType)) {
9028
- dispatch((0, value.setValue)(component, null));
9029
- }
9030
-
9031
9499
  var _buildQuery = (0, helper.buildQuery)(component, dependencyTree, queryList, queryOptions),
9032
9500
  queryObj = _buildQuery.queryObj,
9033
9501
  options = _buildQuery.options;
@@ -9053,9 +9521,16 @@
9053
9521
 
9054
9522
  if (mustExecuteMapQuery || !(0, helper.compareQueries)(currentQuery, oldQuery, false)) {
9055
9523
  orderOfQueries = [].concat(_toConsumableArray(orderOfQueries), [component]);
9056
- dispatch((0, misc.logQuery)(component, queryToLog));
9057
9524
  var isMapComponent = Object.keys(mapData).includes(component);
9058
9525
 
9526
+ if (isMapComponent) {
9527
+ dispatch((0, misc.setLastUsedAppbaseQuery)(_defineProperty({}, component, {
9528
+ queryId: queryId
9529
+ })));
9530
+ }
9531
+
9532
+ dispatch((0, misc.logQuery)(component, queryToLog));
9533
+
9059
9534
  if (isMapComponent && mapData[component].query) {
9060
9535
  var existingQuery = currentQuery.query;
9061
9536
  currentQuery.query = {
@@ -9078,16 +9553,16 @@
9078
9553
  (0, utils.executeQueryListener)(queryListener[component], oldQuery, currentQuery);
9079
9554
 
9080
9555
  if (isAppbaseEnabled) {
9081
- var value$1 = void 0;
9556
+ var value = void 0;
9082
9557
  var isInternalComponent = componentId.endsWith('__internal');
9083
9558
  var mainComponentProps = props[componentId];
9084
9559
 
9085
9560
  if (isInternalComponent && mainComponentProps && (0, transform.isSearchComponent)(mainComponentProps.componentType)) {
9086
- value$1 = internalValues[componentId] && internalValues[componentId].value;
9561
+ value = internalValues[componentId] && internalValues[componentId].value;
9087
9562
  }
9088
9563
 
9089
- var query = (0, transform.getRSQuery)(component, (0, transform.extractPropsFromState)(getState(), component, _extends({}, value$1 ? {
9090
- value: value$1
9564
+ var query = (0, transform.getRSQuery)(component, (0, transform.extractPropsFromState)(getState(), component, _extends({}, value ? {
9565
+ value: value
9091
9566
  } : null, metaOptions ? {
9092
9567
  from: metaOptions.from
9093
9568
  } : null)));
@@ -9132,7 +9607,7 @@
9132
9607
  var currentTime = new Date().getTime();
9133
9608
 
9134
9609
  if (currentTime - initialTimestamp < lockTime) {
9135
- if (!lock) {
9610
+ if (!lock || config.queryLockConfig) {
9136
9611
  setTimeout(function () {
9137
9612
  var finalOrderOfQueries = [];
9138
9613
  var finalIsSuggestionsQuery = false;
@@ -9187,6 +9662,9 @@
9187
9662
  }
9188
9663
 
9189
9664
  requestStack = [];
9665
+ dispatch((0, utils.updateStoreConfig)({
9666
+ queryLockConfig: undefined
9667
+ }));
9190
9668
  }, lockTime);
9191
9669
  }
9192
9670
 
@@ -9199,6 +9677,7 @@
9199
9677
  });
9200
9678
  } else {
9201
9679
  dispatch(appbaseSearch({
9680
+ queryId: queryId,
9202
9681
  query: finalQuery,
9203
9682
  orderOfQueries: orderOfQueries,
9204
9683
  isSuggestionsQuery: isSuggestionsQuery,
@@ -9240,6 +9719,7 @@
9240
9719
  _ref2$meta = _ref2.meta,
9241
9720
  meta = _ref2$meta === undefined ? {} : _ref2$meta;
9242
9721
  var execute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
9722
+ var shouldSetInternalValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
9243
9723
  return function (dispatch) {
9244
9724
  var queryToDispatch = query;
9245
9725
 
@@ -9250,10 +9730,12 @@
9250
9730
  if (!componentId.endsWith('__internal')) {
9251
9731
  dispatch((0, value.setValue)(componentId, value$1, label, showFilter, URLParams, componentType, category, meta));
9252
9732
 
9253
- if (componentType === constants$1.componentTypes.dynamicRangeSlider) {
9254
- dispatch((0, value.setInternalValue)((0, transform.getHistogramComponentID)(componentId), value$1, componentType, category, meta));
9255
- } else {
9256
- dispatch((0, value.setInternalValue)(componentId + '__internal', value$1, componentType, category, meta));
9733
+ if (shouldSetInternalValue) {
9734
+ if (componentType === constants$1.componentTypes.dynamicRangeSlider) {
9735
+ dispatch((0, value.setInternalValue)((0, transform.getHistogramComponentID)(componentId), value$1, componentType, category, meta));
9736
+ } else {
9737
+ dispatch((0, value.setInternalValue)(componentId + '__internal', value$1, componentType, category, meta));
9738
+ }
9257
9739
  }
9258
9740
  } else {
9259
9741
  dispatch((0, value.setInternalValue)(componentId, value$1, componentType, category, meta));
@@ -9324,6 +9806,55 @@
9324
9806
  }
9325
9807
  };
9326
9808
  }
9809
+
9810
+ function loadDataToExport(componentId) {
9811
+ var deepPaginationCursor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
9812
+ var totalResults = arguments[2];
9813
+ var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
9814
+ return function (dispatch, getState) {
9815
+ var _getState6 = getState(),
9816
+ appbaseRef = _getState6.appbaseRef,
9817
+ lastUsedAppbaseQuery = _getState6.lastUsedAppbaseQuery;
9818
+
9819
+ var queryFromStore = lastUsedAppbaseQuery[componentId];
9820
+
9821
+ if (queryFromStore) {
9822
+ var query = queryFromStore.map(function (queryItem) {
9823
+ if (queryItem.id === componentId) {
9824
+ return _extends({}, queryItem, {
9825
+ deepPaginationConfig: {
9826
+ cursor: deepPaginationCursor
9827
+ },
9828
+ deepPagination: true,
9829
+ size: totalResults < 1000 ? totalResults : 1000,
9830
+ sortField: '_id',
9831
+ sortBy: 'asc'
9832
+ });
9833
+ }
9834
+
9835
+ return queryItem;
9836
+ });
9837
+
9838
+ if (totalResults && Array.isArray(data) && totalResults <= data.length) {
9839
+ return data;
9840
+ }
9841
+
9842
+ return appbaseRef.reactiveSearchv3(query).then(function (res) {
9843
+ var newDataChunk = res[componentId].hits.hits;
9844
+
9845
+ if (!Array.isArray(newDataChunk) || newDataChunk.length === 0) {
9846
+ return data;
9847
+ }
9848
+
9849
+ return dispatch(loadDataToExport(componentId, newDataChunk[newDataChunk.length - 1]._id, res[componentId].hits.total.value, [].concat(_toConsumableArray(data), _toConsumableArray(newDataChunk))));
9850
+ })["catch"](function (err) {
9851
+ console.error('Error fetching data to export! ', err);
9852
+ });
9853
+ }
9854
+
9855
+ return console.error('Error fetching data to export!');
9856
+ };
9857
+ }
9327
9858
  });
9328
9859
  unwrapExports(query);
9329
9860
  var query_1 = query.loadPopularSuggestions;
@@ -9331,6 +9862,7 @@
9331
9862
  var query_3 = query.setQueryOptions;
9332
9863
  var query_4 = query.updateQuery;
9333
9864
  var query_5 = query.loadMore;
9865
+ var query_6 = query.loadDataToExport;
9334
9866
 
9335
9867
  var component = createCommonjsModule(function (module, exports) {
9336
9868
  Object.defineProperty(exports, "__esModule", {
@@ -10025,7 +10557,7 @@
10025
10557
  var lib_8 = lib.helper;
10026
10558
 
10027
10559
  function _extends() {
10028
- _extends = Object.assign || function (target) {
10560
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
10029
10561
  for (var i = 1; i < arguments.length; i++) {
10030
10562
  var source = arguments[i];
10031
10563
 
@@ -10038,7 +10570,6 @@
10038
10570
 
10039
10571
  return target;
10040
10572
  };
10041
-
10042
10573
  return _extends.apply(this, arguments);
10043
10574
  }
10044
10575
 
@@ -12232,7 +12763,7 @@
12232
12763
  };
12233
12764
 
12234
12765
  function _extends$1() {
12235
- _extends$1 = Object.assign || function (target) {
12766
+ _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
12236
12767
  for (var i = 1; i < arguments.length; i++) {
12237
12768
  var source = arguments[i];
12238
12769
 
@@ -12245,7 +12776,6 @@
12245
12776
 
12246
12777
  return target;
12247
12778
  };
12248
-
12249
12779
  return _extends$1.apply(this, arguments);
12250
12780
  }
12251
12781
 
@@ -13180,6 +13710,12 @@
13180
13710
  mongodb: VueTypes.shape({
13181
13711
  db: VueTypes.string,
13182
13712
  collection: VueTypes.string
13713
+ }),
13714
+ endpointConfig: VueTypes.shape({
13715
+ url: VueTypes.string.isRequired,
13716
+ method: VueTypes.string,
13717
+ headers: VueTypes.object,
13718
+ body: VueTypes.object
13183
13719
  })
13184
13720
  };
13185
13721
 
@@ -13237,6 +13773,7 @@
13237
13773
  showEndPage = props.showEndPage;
13238
13774
  var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
13239
13775
  var paginationButtons = [];
13776
+ var endPage = start;
13240
13777
 
13241
13778
  if (start <= totalPages) {
13242
13779
  var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
@@ -13274,6 +13811,10 @@
13274
13811
 
13275
13812
  if (i <= totalPages + 1) {
13276
13813
  paginationButtons.push(pageBtn);
13814
+
13815
+ if (i === Math.min(totalPages + 1, totalPagesToShow) - 1) {
13816
+ endPage = i;
13817
+ }
13277
13818
  }
13278
13819
  };
13279
13820
 
@@ -13282,7 +13823,7 @@
13282
13823
  }
13283
13824
  }
13284
13825
 
13285
- return paginationButtons;
13826
+ return [paginationButtons, start, endPage];
13286
13827
  };
13287
13828
 
13288
13829
  var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
@@ -13290,10 +13831,10 @@
13290
13831
  currentPage = props.currentPage,
13291
13832
  totalPages = props.totalPages,
13292
13833
  pages = props.pages;
13293
- if (!showEndPage) return buildPaginationDOM('start');
13834
+ if (!showEndPage) return buildPaginationDOM('start')[0];
13294
13835
 
13295
- if (currentPage <= totalPages - pages + 2 || totalPages <= pages) {
13296
- return buildPaginationDOM('start');
13836
+ if (currentPage <= totalPages - pages + 2 || totalPages < pages) {
13837
+ return buildPaginationDOM('start')[0];
13297
13838
  }
13298
13839
 
13299
13840
  return null;
@@ -13329,7 +13870,7 @@
13329
13870
  return props.setPage(0);
13330
13871
  }
13331
13872
  }
13332
- }, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end'), h(Button, {
13873
+ }, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) && buildPaginationDOM('start')[1] !== 2 ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) && buildPaginationDOM('start')[2] !== buildPaginationDOM('end')[1] - 1 ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end')[0], h(Button, {
13333
13874
  "class": getClassName(props.innerClass, 'button') || '',
13334
13875
  "attrs": {
13335
13876
  "disabled": props.currentPage >= props.totalPages - 1,
@@ -13730,6 +14271,17 @@
13730
14271
  return MODIFIER_KEYS.includes(shortcutKey);
13731
14272
  });
13732
14273
  }
14274
+ function decodeHtml(str) {
14275
+ if (typeof str !== 'string') {
14276
+ return str;
14277
+ }
14278
+
14279
+ return str.replace(/&#([0-9]{1,3});/gi, function (match, numStr) {
14280
+ var num = parseInt(numStr, 10); // read num as normal number
14281
+
14282
+ return String.fromCharCode(num);
14283
+ });
14284
+ }
13733
14285
 
13734
14286
  var addComponent = lib_5.addComponent,
13735
14287
  removeComponent = lib_5.removeComponent,
@@ -14395,7 +14947,8 @@
14395
14947
  nextLabel: types.string,
14396
14948
  distinctField: types.string,
14397
14949
  distinctFieldConfig: types.props,
14398
- index: VueTypes.string
14950
+ index: VueTypes.string,
14951
+ endpoint: types.endpointConfig
14399
14952
  },
14400
14953
  computed: {
14401
14954
  shouldRenderPagination: function shouldRenderPagination() {
@@ -14442,7 +14995,7 @@
14442
14995
  filteredResults = [].concat(parsedPromotedResults, filteredResults);
14443
14996
  }
14444
14997
 
14445
- return helper_8(filteredResults);
14998
+ return helper_15(filteredResults);
14446
14999
  }
14447
15000
  },
14448
15001
  watch: {
@@ -14700,6 +15253,7 @@
14700
15253
  }, [this.data.map(function (item, index) {
14701
15254
  return renderItem({
14702
15255
  item: item,
15256
+ count: _this2.currentPageState * size + index + 1,
14703
15257
  triggerClickAnalytics: function triggerClickAnalytics() {
14704
15258
  return _this2.triggerClickAnalytics(_this2.currentPageState * size + index);
14705
15259
  }
@@ -15062,7 +15616,7 @@
15062
15616
 
15063
15617
  ReactiveList.componentType = constants_1$1.reactiveList;
15064
15618
 
15065
- function URL(url) {
15619
+ function URL$1(url) {
15066
15620
  var pattern = RegExp("^(([^:/?#]*)?://)?(((.*)?@)?([^/?#]*)?)([^?#]*)(\\?([^#]*))?(#(.*))?");
15067
15621
  var matches = url.match(pattern);
15068
15622
  return {
@@ -15075,7 +15629,7 @@
15075
15629
  };
15076
15630
  }
15077
15631
 
15078
- var urlParserLite = URL;
15632
+ var urlParserLite = URL$1;
15079
15633
 
15080
15634
  // Copyright Joyent, Inc. and other Node contributors.
15081
15635
  // obj.hasOwnProperty(prop) will break.
@@ -15408,10 +15962,22 @@
15408
15962
  var acceptedTypes = Array.isArray(schema[passedPropertyKey].type) ? schema[passedPropertyKey].type : [].concat(schema[passedPropertyKey].type);
15409
15963
  var receivedPropertyType = checkDataType(passedProperties[passedPropertyKey]);
15410
15964
 
15411
- if (!acceptedTypes.includes(receivedPropertyType)) {
15412
- throw new Error('The property ' + passedPropertyKey + ' is expected with type(s) [' + acceptedTypes.join(', ') + '], but type was set as ' + receivedPropertyType + '.');
15413
- }
15414
- });
15965
+ if (!acceptedTypes.includes(receivedPropertyType)) {
15966
+ throw new Error('The property ' + passedPropertyKey + ' is expected with type(s) [' + acceptedTypes.join(', ') + '], but type was set as ' + receivedPropertyType + '.');
15967
+ }
15968
+ });
15969
+ }
15970
+
15971
+ function isValidHttpUrl(string) {
15972
+ var url = void 0;
15973
+
15974
+ try {
15975
+ url = new URL(string);
15976
+ } catch (_) {
15977
+ return false;
15978
+ }
15979
+
15980
+ return url.protocol === 'http:' || url.protocol === 'https:';
15415
15981
  }
15416
15982
 
15417
15983
  var mongodb = {
@@ -15484,11 +16050,12 @@
15484
16050
  * @param {String} config.password
15485
16051
  * @param {Boolean} config.enableTelemetry
15486
16052
  * @param {Object} config.mongodb
16053
+ * @param {Object} config.endpoint
15487
16054
  * A callback function which will be invoked before a fetch request made
15488
16055
  */
15489
16056
 
15490
16057
  function AppBase(config) {
15491
- var _URL = urlParserLite(config.url || ''),
16058
+ var _URL = urlParserLite((config.endpoint ? config.endpoint.url : '') || config.url),
15492
16059
  _URL$auth = _URL.auth,
15493
16060
  auth = _URL$auth === undefined ? null : _URL$auth,
15494
16061
  _URL$host = _URL.host,
@@ -15508,6 +16075,13 @@
15508
16075
  var backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH']; // eslint-disable-next-line
15509
16076
 
15510
16077
  var schema = SCHEMA[backendName];
16078
+
16079
+ if (config.endpoint && isValidHttpUrl(config.endpoint.url)) {
16080
+ schema.url.required = false;
16081
+ schema.app.required = false;
16082
+ schema.credentials.required = false;
16083
+ }
16084
+
15511
16085
  validateSchema({
15512
16086
  url: config.url,
15513
16087
  app: config.app,
@@ -16583,7 +17157,7 @@
16583
17157
  Object.keys(_this.currentSelectedState).filter(function (item) {
16584
17158
  return !activeComponents.includes(item);
16585
17159
  }).forEach(function (component) {
16586
- _this.setValue(component, null);
17160
+ _this.setValue(component, null, undefined, undefined, undefined, undefined, undefined, undefined, 'URL');
16587
17161
  }); // update active components in selectedValues
16588
17162
 
16589
17163
  Array.from(_this.params.entries()).forEach(function (item) {
@@ -16598,7 +17172,7 @@
16598
17172
  showFilter = _ref.showFilter,
16599
17173
  URLParams = _ref.URLParams;
16600
17174
 
16601
- _this.setValue(component, JSON.parse(value), label, showFilter, URLParams);
17175
+ _this.setValue(component, JSON.parse(value), label, showFilter, URLParams, undefined, undefined, undefined, 'URL');
16602
17176
  } catch (e) {
16603
17177
  // Do not set value if JSON parsing fails.
16604
17178
  console.error(e);
@@ -16616,39 +17190,45 @@
16616
17190
  selectedValues: function selectedValues(newVal, oldVal) {
16617
17191
  var _this2 = this;
16618
17192
 
16619
- this.currentSelectedState = newVal;
16620
-
16621
17193
  if (!isEqual$3(newVal, oldVal)) {
16622
17194
  this.searchString = this.$props.getSearchParams ? this.$props.getSearchParams() : window.location.search;
16623
17195
  this.params = new URLSearchParams(this.searchString);
16624
17196
  var currentComponents = Object.keys(newVal);
16625
17197
  var urlComponents = Array.from(this.params.keys());
17198
+ var shouldPushHistory = false;
16626
17199
  currentComponents.filter(function (component) {
16627
17200
  return newVal[component].URLParams;
16628
17201
  }).forEach(function (component) {
16629
- // prevents empty history pollution on initial load
16630
- if (_this2.hasValidValue(newVal[component]) || _this2.hasValidValue(oldVal[component])) {
16631
- var selectedValues = newVal[component];
17202
+ var selectedValues = newVal[component]; // prevents empty history pollution on initial load
16632
17203
 
17204
+ if (_this2.hasValidValue(newVal[component]) || _this2.hasValidValue(oldVal[component])) {
16633
17205
  if (selectedValues.URLParams) {
16634
17206
  if (selectedValues.category) {
16635
- _this2.setURL(component, _this2.getValue({
17207
+ var shouldUpdateHistory = _this2.setURL(component, _this2.getValue({
16636
17208
  category: selectedValues.category,
16637
17209
  value: selectedValues.value
16638
17210
  }));
17211
+
17212
+ if (shouldUpdateHistory) {
17213
+ shouldPushHistory = true;
17214
+ }
16639
17215
  } else {
16640
- _this2.setURL(component, _this2.getValue(selectedValues.value));
17216
+ var _shouldUpdateHistory = _this2.setURL(component, _this2.getValue(selectedValues.value));
17217
+
17218
+ if (_shouldUpdateHistory) {
17219
+ shouldPushHistory = true;
17220
+ }
16641
17221
  }
16642
17222
  } else {
16643
17223
  _this2.params["delete"](component);
16644
17224
 
16645
- _this2.pushToHistory();
17225
+ shouldPushHistory = true;
16646
17226
  }
16647
17227
  } else if (!_this2.hasValidValue(newVal[component]) && urlComponents.includes(component)) {
16648
17228
  // doesn't have a valid value, but the url has a (stale) valid value set
16649
17229
  _this2.params["delete"](component);
16650
17230
 
16651
- _this2.pushToHistory();
17231
+ shouldPushHistory = true;
16652
17232
  }
16653
17233
  }); // remove unmounted components
16654
17234
 
@@ -16657,15 +17237,20 @@
16657
17237
  }).forEach(function (component) {
16658
17238
  _this2.params["delete"](component);
16659
17239
 
16660
- _this2.pushToHistory();
17240
+ shouldPushHistory = true;
16661
17241
  });
16662
17242
 
16663
17243
  if (!currentComponents.length) {
16664
17244
  Array.from(this.params.keys()).forEach(function (item) {
16665
17245
  if (_this2.searchComponents && _this2.searchComponents.includes(item)) {
16666
17246
  _this2.params["delete"](item);
17247
+
17248
+ shouldPushHistory = true;
16667
17249
  }
16668
17250
  });
17251
+ }
17252
+
17253
+ if (shouldPushHistory) {
16669
17254
  this.pushToHistory();
16670
17255
  }
16671
17256
  }
@@ -16728,20 +17313,19 @@
16728
17313
  return value;
16729
17314
  },
16730
17315
  setURL: function setURL(component, value) {
16731
- this.searchString = this.$props.getSearchParams ? this.$props.getSearchParams() : window.location.search;
16732
- this.params = new URLSearchParams(this.searchString);
16733
-
16734
17316
  if (!value || typeof value === 'string' && value.trim() === '' || Array.isArray(value) && value.length === 0) {
16735
17317
  this.params["delete"](component);
16736
- this.pushToHistory();
16737
- } else {
16738
- var data = JSON.stringify(this.getValue(value));
17318
+ return true;
17319
+ }
16739
17320
 
16740
- if (data !== this.params.get(component)) {
16741
- this.params.set(component, data);
16742
- this.pushToHistory();
16743
- }
17321
+ var data = JSON.stringify(value);
17322
+
17323
+ if (data !== this.params.get(component)) {
17324
+ this.params.set(component, data);
17325
+ return true;
16744
17326
  }
17327
+
17328
+ return false;
16745
17329
  },
16746
17330
  pushToHistory: function pushToHistory() {
16747
17331
  var paramsSting = this.params.toString() ? "?" + this.params.toString() : '';
@@ -16836,11 +17420,17 @@
16836
17420
  this.setStore(this.$props);
16837
17421
  },
16838
17422
  mounted: function mounted() {
16839
- var analyticsConfig = this.analyticsConfig; // TODO: Remove in 2.0
17423
+ var analyticsConfig = this.analyticsConfig,
17424
+ enableAppbase = this.enableAppbase,
17425
+ endpoint = this.endpoint; // TODO: Remove in 2.0
16840
17426
 
16841
17427
  if (analyticsConfig !== undefined) {
16842
17428
  console.warn('Warning(ReactiveSearch): The `analyticsConfig` prop has been marked as deprecated, please use the `appbaseConfig` prop instead.');
16843
17429
  }
17430
+
17431
+ if (!enableAppbase && endpoint) {
17432
+ console.warn('Warning(ReactiveSearch): The `endpoint` prop works only when `enableAppbase` prop is set to true.');
17433
+ }
16844
17434
  },
16845
17435
  props: {
16846
17436
  app: types.string,
@@ -16864,7 +17454,8 @@
16864
17454
  as: VueTypes.string.def('div'),
16865
17455
  getSearchParams: types.func,
16866
17456
  setSearchParams: types.func,
16867
- mongodb: types.mongodb
17457
+ mongodb: types.mongodb,
17458
+ endpoint: types.endpointConfig
16868
17459
  },
16869
17460
  provide: function provide() {
16870
17461
  return {
@@ -16892,14 +17483,14 @@
16892
17483
  this.updateState(this.$props);
16893
17484
  },
16894
17485
  analyticsConfig: function analyticsConfig(newVal, oldVal) {
16895
- if (!helper_25(newVal, oldVal)) {
17486
+ if (!helper_32(newVal, oldVal)) {
16896
17487
  if (this.store) {
16897
17488
  this.store.dispatch(analytics_3$1(newVal));
16898
17489
  }
16899
17490
  }
16900
17491
  },
16901
17492
  appbaseConfig: function appbaseConfig(newVal, oldVal) {
16902
- if (!helper_25(newVal, oldVal)) {
17493
+ if (!helper_32(newVal, oldVal)) {
16903
17494
  if (this.store) {
16904
17495
  this.store.dispatch(analytics_3$1(newVal));
16905
17496
  }
@@ -16915,7 +17506,8 @@
16915
17506
  enableAppbase = _this$$props.enableAppbase,
16916
17507
  headers = _this$$props.headers,
16917
17508
  appbaseConfig = _this$$props.appbaseConfig,
16918
- mongodb = _this$$props.mongodb;
17509
+ mongodb = _this$$props.mongodb,
17510
+ endpoint = _this$$props.endpoint;
16919
17511
 
16920
17512
  var _ref = appbaseConfig || {},
16921
17513
  enableTelemetry = _ref.enableTelemetry;
@@ -16924,7 +17516,7 @@
16924
17516
  'X-Search-Client': X_SEARCH_CLIENT
16925
17517
  }, enableTelemetry === false && {
16926
17518
  'X-Enable-Telemetry': false
16927
- }), headers);
17519
+ }), headers, enableAppbase && endpoint && endpoint.headers && _extends({}, endpoint.headers));
16928
17520
  }
16929
17521
  },
16930
17522
  methods: {
@@ -16937,8 +17529,19 @@
16937
17529
 
16938
17530
  var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
16939
17531
 
17532
+ var url = props.url && props.url.trim() !== '' ? props.url : '';
17533
+
17534
+ if (props.enableAppbase && props.endpoint) {
17535
+ if (props.endpoint.url) {
17536
+ // eslint-disable-next-line prefer-destructuring
17537
+ url = props.endpoint.url;
17538
+ } else {
17539
+ throw Error('Error(ReactiveSearch): The `endpoint` prop object requires `url` property.');
17540
+ }
17541
+ }
17542
+
16940
17543
  var config = {
16941
- url: props.url && props.url.trim() !== '' ? props.url : '',
17544
+ url: url,
16942
17545
  app: props.app,
16943
17546
  credentials: credentials,
16944
17547
  type: props.type ? props.type : '*',
@@ -16947,7 +17550,8 @@
16947
17550
  enableAppbase: props.enableAppbase,
16948
17551
  analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
16949
17552
  analyticsConfig: appbaseConfig,
16950
- mongodb: props.mongodb
17553
+ mongodb: props.mongodb,
17554
+ endpoint: props.endpoint
16951
17555
  };
16952
17556
  var queryParams = '';
16953
17557
 
@@ -16980,12 +17584,16 @@
16980
17584
  } catch (e) {// Do not add to selectedValues if JSON parsing fails.
16981
17585
  }
16982
17586
  });
16983
- var themePreset = props.themePreset;
17587
+ var themePreset = props.themePreset,
17588
+ enableAppbase = props.enableAppbase,
17589
+ endpoint = props.endpoint;
16984
17590
  var appbaseRef = appbasejs(config);
16985
17591
 
16986
- if (this.$props.transformRequest) {
16987
- appbaseRef.transformRequest = this.$props.transformRequest;
16988
- }
17592
+ appbaseRef.transformRequest = function (request) {
17593
+ var modifiedRequest = enableAppbase ? helper_1(request, endpoint) : request;
17594
+ if (props.transformRequest) return props.transformRequest(modifiedRequest);
17595
+ return modifiedRequest;
17596
+ };
16989
17597
 
16990
17598
  if (this.$props.transformResponse) {
16991
17599
  appbaseRef.transformResponse = this.$props.transformResponse;
@@ -17034,20 +17642,19 @@
17034
17642
  Vue.component(ReactiveBase.name, ReactiveBase);
17035
17643
  };
17036
17644
 
17037
- /*!
17038
- * hotkeys-js v3.8.7
17039
- * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
17645
+ /**!
17646
+ * hotkeys-js v3.9.4
17647
+ * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
17040
17648
  *
17041
- * Copyright (c) 2021 kenny wong <wowohoo@qq.com>
17042
- * http://jaywcjlove.github.io/hotkeys
17043
- *
17044
- * Licensed under the MIT license.
17649
+ * Copyright (c) 2022 kenny wong <wowohoo@qq.com>
17650
+ * http://jaywcjlove.github.io/hotkeys
17651
+ * Licensed under the MIT license
17045
17652
  */
17046
17653
  var isff = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase().indexOf('firefox') > 0 : false; // 绑定事件
17047
17654
 
17048
- function addEvent(object, event, method) {
17655
+ function addEvent(object, event, method, useCapture) {
17049
17656
  if (object.addEventListener) {
17050
- object.addEventListener(event, method, false);
17657
+ object.addEventListener(event, method, useCapture);
17051
17658
  } else if (object.attachEvent) {
17052
17659
  object.attachEvent("on".concat(event), function () {
17053
17660
  method(window.event);
@@ -17190,6 +17797,8 @@
17190
17797
 
17191
17798
  var _downKeys = []; // 记录摁下的绑定键
17192
17799
 
17800
+ var winListendFocus = false; // window是否已经监听了focus事件
17801
+
17193
17802
  var _scope = 'all'; // 默认热键范围
17194
17803
 
17195
17804
  var elementHasBindEvent = []; // 已绑定事件的节点记录
@@ -17288,7 +17897,7 @@
17288
17897
 
17289
17898
  function unbind(keysInfo) {
17290
17899
  // unbind(), unbind all keys
17291
- if (!keysInfo) {
17900
+ if (typeof keysInfo === 'undefined') {
17292
17901
  Object.keys(_handlers).forEach(function (key) {
17293
17902
  return delete _handlers[key];
17294
17903
  });
@@ -17341,21 +17950,20 @@
17341
17950
 
17342
17951
  if (!scope) scope = getScope();
17343
17952
  var mods = len > 1 ? getMods(_modifier, unbindKeys) : [];
17344
- _handlers[keyCode] = _handlers[keyCode].map(function (record) {
17953
+ _handlers[keyCode] = _handlers[keyCode].filter(function (record) {
17345
17954
  // 通过函数判断,是否解除绑定,函数相等直接返回
17346
17955
  var isMatchingMethod = method ? record.method === method : true;
17347
-
17348
- if (isMatchingMethod && record.scope === scope && compareArray(record.mods, mods)) {
17349
- return {};
17350
- }
17351
-
17352
- return record;
17956
+ return !(isMatchingMethod && record.scope === scope && compareArray(record.mods, mods));
17353
17957
  });
17354
17958
  });
17355
17959
  }; // 对监听对应快捷键的回调函数进行处理
17356
17960
 
17357
17961
 
17358
- function eventHandler(event, handler, scope) {
17962
+ function eventHandler(event, handler, scope, element) {
17963
+ if (handler.element !== element) {
17964
+ return;
17965
+ }
17966
+
17359
17967
  var modifiersMatch; // 看它是否在当前范围
17360
17968
 
17361
17969
  if (handler.scope === scope || handler.scope === 'all') {
@@ -17382,7 +17990,7 @@
17382
17990
  } // 处理keydown事件
17383
17991
 
17384
17992
 
17385
- function dispatch(event) {
17993
+ function dispatch(event, element) {
17386
17994
  var asterisk = _handlers['*'];
17387
17995
  var key = event.keyCode || event.which || event.charCode; // 表单控件过滤 默认表单控件不触发快捷键
17388
17996
 
@@ -17467,7 +18075,7 @@
17467
18075
  if (asterisk) {
17468
18076
  for (var i = 0; i < asterisk.length; i++) {
17469
18077
  if (asterisk[i].scope === scope && (event.type === 'keydown' && asterisk[i].keydown || event.type === 'keyup' && asterisk[i].keyup)) {
17470
- eventHandler(event, asterisk[i], scope);
18078
+ eventHandler(event, asterisk[i], scope, element);
17471
18079
  }
17472
18080
  }
17473
18081
  } // key 不在 _handlers 中返回
@@ -17489,7 +18097,7 @@
17489
18097
 
17490
18098
  if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {
17491
18099
  // 找到处理内容
17492
- eventHandler(event, record, scope);
18100
+ eventHandler(event, record, scope, element);
17493
18101
  }
17494
18102
  }
17495
18103
  }
@@ -17513,7 +18121,8 @@
17513
18121
  var i = 0;
17514
18122
  var keyup = false;
17515
18123
  var keydown = true;
17516
- var splitKey = '+'; // 对为设定范围的判断
18124
+ var splitKey = '+';
18125
+ var capture = false; // 对为设定范围的判断
17517
18126
 
17518
18127
  if (method === undefined && typeof option === 'function') {
17519
18128
  method = option;
@@ -17528,6 +18137,8 @@
17528
18137
 
17529
18138
  if (option.keydown !== undefined) keydown = option.keydown; // eslint-disable-line
17530
18139
 
18140
+ if (option.capture !== undefined) capture = option.capture; // eslint-disable-line
18141
+
17531
18142
  if (typeof option.splitKey === 'string') splitKey = option.splitKey; // eslint-disable-line
17532
18143
  }
17533
18144
 
@@ -17554,7 +18165,8 @@
17554
18165
  shortcut: keys[i],
17555
18166
  method: method,
17556
18167
  key: keys[i],
17557
- splitKey: splitKey
18168
+ splitKey: splitKey,
18169
+ element: element
17558
18170
  });
17559
18171
  } // 在全局document上设置快捷键
17560
18172
 
@@ -17562,18 +18174,36 @@
17562
18174
  if (typeof element !== 'undefined' && !isElementBind(element) && window) {
17563
18175
  elementHasBindEvent.push(element);
17564
18176
  addEvent(element, 'keydown', function (e) {
17565
- dispatch(e);
17566
- });
17567
- addEvent(window, 'focus', function () {
17568
- _downKeys = [];
17569
- });
18177
+ dispatch(e, element);
18178
+ }, capture);
18179
+
18180
+ if (!winListendFocus) {
18181
+ winListendFocus = true;
18182
+ addEvent(window, 'focus', function () {
18183
+ _downKeys = [];
18184
+ }, capture);
18185
+ }
18186
+
17570
18187
  addEvent(element, 'keyup', function (e) {
17571
- dispatch(e);
18188
+ dispatch(e, element);
17572
18189
  clearModifier(e);
17573
- });
18190
+ }, capture);
17574
18191
  }
17575
18192
  }
17576
18193
 
18194
+ function trigger(shortcut) {
18195
+ var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
18196
+ Object.keys(_handlers).forEach(function (key) {
18197
+ var data = _handlers[key].find(function (item) {
18198
+ return item.scope === scope && item.shortcut === shortcut;
18199
+ });
18200
+
18201
+ if (data && data.method) {
18202
+ data.method();
18203
+ }
18204
+ });
18205
+ }
18206
+
17577
18207
  var _api = {
17578
18208
  setScope: setScope,
17579
18209
  getScope: getScope,
@@ -17581,7 +18211,11 @@
17581
18211
  getPressedKeyCodes: getPressedKeyCodes,
17582
18212
  isPressed: isPressed,
17583
18213
  filter: filter,
17584
- unbind: unbind
18214
+ trigger: trigger,
18215
+ unbind: unbind,
18216
+ keyMap: _keyMap,
18217
+ modifier: _modifier,
18218
+ modifierMap: modifierMap
17585
18219
  };
17586
18220
 
17587
18221
  for (var a in _api) {
@@ -19570,6 +20204,10 @@
19570
20204
  }
19571
20205
  };
19572
20206
 
20207
+ var _templateObject$j, _templateObject2$7;
20208
+ var TagsContainer = index$1('div')(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
20209
+ var TagItem = index$1('span')(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
20210
+
19573
20211
  var updateQuery$1 = lib_5.updateQuery,
19574
20212
  setQueryOptions$1 = lib_5.setQueryOptions,
19575
20213
  setCustomQuery = lib_5.setCustomQuery,
@@ -19577,7 +20215,8 @@
19577
20215
  setCustomHighlightOptions = lib_5.setCustomHighlightOptions,
19578
20216
  recordSuggestionClick = lib_5.recordSuggestionClick,
19579
20217
  loadPopularSuggestions = lib_5.loadPopularSuggestions,
19580
- getRecentSearches = lib_5.getRecentSearches;
20218
+ getRecentSearches = lib_5.getRecentSearches,
20219
+ resetStoreForComponent = lib_5.resetStoreForComponent;
19581
20220
  var debounce$1 = lib_8.debounce,
19582
20221
  checkValueChange = lib_8.checkValueChange,
19583
20222
  getClassName$3 = lib_8.getClassName,
@@ -19592,10 +20231,12 @@
19592
20231
  normalizeDataField = lib_8.normalizeDataField;
19593
20232
  var DataSearch = {
19594
20233
  name: 'DataSearch',
20234
+ isTagsMode: false,
19595
20235
  data: function data() {
19596
20236
  var props = this.$props;
19597
20237
  this.__state = {
19598
20238
  currentValue: '',
20239
+ selectedTags: [],
19599
20240
  isOpen: false,
19600
20241
  normalizedSuggestions: [],
19601
20242
  isPending: false
@@ -19615,7 +20256,13 @@
19615
20256
  enableRecentSearches = _this$$props.enableRecentSearches,
19616
20257
  distinctField = _this$$props.distinctField,
19617
20258
  distinctFieldConfig = _this$$props.distinctFieldConfig,
19618
- index = _this$$props.index; // TODO: Remove in 2.0
20259
+ index = _this$$props.index,
20260
+ mode = _this$$props.mode;
20261
+
20262
+ if (mode === constants_5$1.TAG) {
20263
+ this.$options.isTagsMode = true;
20264
+ } // TODO: Remove in 2.0
20265
+
19619
20266
 
19620
20267
  if (enableQuerySuggestions) {
19621
20268
  console.warn('Warning(ReactiveSearch): The `enableQuerySuggestions` prop has been marked as deprecated, please use the `enablePopularSuggestions` prop instead.');
@@ -19638,7 +20285,12 @@
19638
20285
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
19639
20286
  }
19640
20287
 
19641
- this.currentValue = this.selectedValue || '';
20288
+ this.currentValue = '';
20289
+
20290
+ if (this.$options.isTagsMode) {
20291
+ this.currentValue = '';
20292
+ }
20293
+
19642
20294
  var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
19643
20295
 
19644
20296
  if (shouldFetchInitialSuggestions) {
@@ -19732,7 +20384,7 @@
19732
20384
  debounce: VueTypes.number.def(0),
19733
20385
  defaultValue: types.string,
19734
20386
  excludeFields: types.excludeFields,
19735
- value: types.value,
20387
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), types.value]),
19736
20388
  defaultSuggestions: types.suggestions,
19737
20389
  enableSynonyms: VueTypes.bool.def(true),
19738
20390
  enableQuerySuggestions: VueTypes.bool.def(false),
@@ -19781,7 +20433,10 @@
19781
20433
  addonAfter: VueTypes.any,
19782
20434
  expandSuggestionsContainer: VueTypes.bool.def(true),
19783
20435
  index: VueTypes.string,
19784
- enableDefaultSuggestions: VueTypes.bool.def(true)
20436
+ enableDefaultSuggestions: VueTypes.bool.def(true),
20437
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
20438
+ renderSelectedTags: VueTypes.any,
20439
+ endpoint: types.endpointConfig
19785
20440
  },
19786
20441
  beforeMount: function beforeMount() {
19787
20442
  if (this.$props.highlight) {
@@ -19798,11 +20453,11 @@
19798
20453
  }
19799
20454
 
19800
20455
  if (this.selectedValue) {
19801
- this.setValue(this.selectedValue, true);
20456
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
19802
20457
  } else if (this.$props.value) {
19803
- this.setValue(this.$props.value, true);
20458
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
19804
20459
  } else if (this.$props.defaultValue) {
19805
- this.setValue(this.$props.defaultValue, true);
20460
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
19806
20461
  }
19807
20462
  },
19808
20463
  mounted: function mounted() {
@@ -19814,19 +20469,19 @@
19814
20469
  },
19815
20470
  dataField: function dataField() {
19816
20471
  this.updateQueryOptions();
19817
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
20472
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
19818
20473
  },
19819
20474
  highlightField: function highlightField() {
19820
20475
  this.updateQueryOptions();
19821
20476
  },
19822
20477
  fieldWeights: function fieldWeights() {
19823
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
20478
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
19824
20479
  },
19825
20480
  fuzziness: function fuzziness() {
19826
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
20481
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
19827
20482
  },
19828
20483
  queryFormat: function queryFormat() {
19829
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
20484
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
19830
20485
  },
19831
20486
  defaultValue: function defaultValue(newVal) {
19832
20487
  this.setValue(newVal, true, this.$props);
@@ -19855,13 +20510,18 @@
19855
20510
  }
19856
20511
  },
19857
20512
  selectedValue: function selectedValue(newVal, oldVal) {
19858
- if (oldVal !== newVal && this.$data.currentValue !== newVal) {
20513
+ if (!isEqual$4(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual$4(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
19859
20514
  if (!newVal && this.$data.currentValue) {
19860
20515
  // selected value is cleared, call onValueSelected
19861
20516
  this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
19862
20517
  }
19863
20518
 
19864
- this.setValue(newVal || '', true, this.$props);
20519
+ if (this.$options.isTagsMode) {
20520
+ // handling reset of tags through SelectedFilters or URL
20521
+ this.selectedTags = [];
20522
+ }
20523
+
20524
+ this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
19865
20525
  }
19866
20526
  },
19867
20527
  focusShortcuts: function focusShortcuts() {
@@ -19949,7 +20609,7 @@
19949
20609
  // returns size and aggs property
19950
20610
  getBasicQueryOptions: function getBasicQueryOptions() {
19951
20611
  var aggregationField = this.$props.aggregationField;
19952
- var queryOptions = helper_28(this.$props);
20612
+ var queryOptions = helper_35(this.$props);
19953
20613
 
19954
20614
  if (aggregationField) {
19955
20615
  queryOptions.aggs = getCompositeAggsQuery$1({
@@ -19988,12 +20648,47 @@
19988
20648
  }
19989
20649
 
19990
20650
  var performUpdate = function performUpdate() {
19991
- // Refresh recent searches when value becomes empty
19992
- if (!value && _this.currentValue && _this.enableRecentSearches) {
20651
+ if (_this.$options.isTagsMode && isEqual$4(value, _this.selectedTags)) {
20652
+ return;
20653
+ } // Refresh recent searches when value becomes empty
20654
+
20655
+
20656
+ if (!value && props.enableDefaultSuggestions === false) {
20657
+ _this.resetStoreForComponent(props.componentId);
20658
+ } else if (!value && _this.currentValue && _this.enableRecentSearches) {
19993
20659
  _this.getRecentSearches();
19994
20660
  }
19995
20661
 
19996
- _this.currentValue = value;
20662
+ if (_this.$options.isTagsMode && cause === lib_7.SUGGESTION_SELECT) {
20663
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
20664
+ // check if value already present in selectedTags
20665
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
20666
+ _this.isOpen = false;
20667
+ return;
20668
+ }
20669
+
20670
+ _this.selectedTags = [].concat(_this.selectedTags);
20671
+
20672
+ if (typeof value === 'string' && !!value) {
20673
+ _this.selectedTags.push(value);
20674
+ } else if (Array.isArray(value) && !isEqual$4(_this.selectedTags, value)) {
20675
+ var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
20676
+ _this.selectedTags = mergedArray;
20677
+ }
20678
+ } else if (value) {
20679
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
20680
+ }
20681
+
20682
+ _this.currentValue = '';
20683
+ } else {
20684
+ _this.currentValue = value;
20685
+ }
20686
+
20687
+ var queryHandlerValue = value;
20688
+
20689
+ if (_this.$options.isTagsMode && cause === lib_7.SUGGESTION_SELECT) {
20690
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
20691
+ }
19997
20692
 
19998
20693
  if (isDefaultValue) {
19999
20694
  if (_this.$props.autosuggest) {
@@ -20001,19 +20696,19 @@
20001
20696
  _this.isOpen = false;
20002
20697
  }
20003
20698
 
20004
- _this.updateDefaultQueryHandler(value, _this.$props);
20699
+ if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
20005
20700
  } // in case of strict selection only SUGGESTION_SELECT should be able
20006
20701
  // to set the query otherwise the value should reset
20007
20702
 
20008
20703
 
20009
20704
  if (props.strictSelection) {
20010
- if (cause === lib_7.SUGGESTION_SELECT || value === '') {
20011
- _this.updateQueryHandler(props.componentId, value, props);
20705
+ if (cause === lib_7.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
20706
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
20012
20707
  } else {
20013
20708
  _this.setValue('', true);
20014
20709
  }
20015
20710
  } else {
20016
- _this.updateQueryHandler(props.componentId, value, props);
20711
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
20017
20712
  }
20018
20713
  } else {
20019
20714
  // debounce for handling text while typing
@@ -20040,6 +20735,12 @@
20040
20735
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
20041
20736
  },
20042
20737
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
20738
+ if (!value && props.enableDefaultSuggestions === false) {
20739
+ // clear Component data from store
20740
+ this.resetStoreForComponent(props.componentId);
20741
+ return;
20742
+ }
20743
+
20043
20744
  var defaultQueryOptions;
20044
20745
  var query = DataSearch.defaultQuery(value, props);
20045
20746
 
@@ -20153,7 +20854,8 @@
20153
20854
 
20154
20855
 
20155
20856
  if (event.key === 'Enter' && highlightedIndex === null) {
20156
- this.setValue(event.target.value, true);
20857
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined // to handle tags
20858
+ );
20157
20859
  this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
20158
20860
  } // Need to review
20159
20861
 
@@ -20184,11 +20886,23 @@
20184
20886
 
20185
20887
  if (value === undefined) {
20186
20888
  this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT);
20889
+ } else if (this.$options.isTagsMode) {
20890
+ var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
20891
+
20892
+ if (this.selectedTags.includes(suggestion.value)) {
20893
+ // avoid duplicates in tags array
20894
+ this.isOpen = false;
20895
+ return;
20896
+ }
20897
+
20898
+ emitValue.push(suggestion.value);
20899
+ this.setValue(emitValue, true, this.$props, lib_7.SUGGESTION_SELECT, true);
20900
+ this.$emit('change', emitValue, this.triggerQuery);
20187
20901
  } else {
20188
- this.isPending = false;
20189
20902
  this.$emit('change', suggestion.value, this.triggerQuery);
20190
20903
  }
20191
20904
 
20905
+ this.isPending = false;
20192
20906
  this.onValueSelectedHandler(suggestion.value, lib_7.SUGGESTION_SELECT, suggestion.source);
20193
20907
  },
20194
20908
  onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
@@ -20294,6 +21008,75 @@
20294
21008
 
20295
21009
  return null;
20296
21010
  },
21011
+ renderTag: function renderTag(item) {
21012
+ var _this2 = this;
21013
+
21014
+ var h = this.$createElement;
21015
+ var innerClass = this.$props.innerClass;
21016
+ return h(TagItem, {
21017
+ "class": getClassName$3(innerClass, 'selected-tag') || ''
21018
+ }, [h("span", [item]), h("span", {
21019
+ "attrs": {
21020
+ "role": "img",
21021
+ "aria-label": "delete-tag"
21022
+ },
21023
+ "class": "close-icon",
21024
+ "on": {
21025
+ "click": function click() {
21026
+ return _this2.clearTag(item);
21027
+ }
21028
+ }
21029
+ }, [h(CancelSvg)])]);
21030
+ },
21031
+ clearAllTags: function clearAllTags() {
21032
+ this.selectedTags = [];
21033
+ this.setValue('', true, this.$props, lib_7.SUGGESTION_SELECT);
21034
+
21035
+ if (this.$props.value !== undefined) {
21036
+ this.$emit('change', this.selectedTags, this.triggerQuery);
21037
+ }
21038
+ },
21039
+ clearTag: function clearTag(tagValue) {
21040
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
21041
+ return tag !== tagValue;
21042
+ }));
21043
+ this.setValue('', true, this.$props, lib_7.SUGGESTION_SELECT);
21044
+
21045
+ if (this.$props.value !== undefined) {
21046
+ this.$emit('change', this.selectedTags, this.triggerQuery);
21047
+ }
21048
+ },
21049
+ renderTags: function renderTags() {
21050
+ var _this3 = this;
21051
+
21052
+ var h = this.$createElement;
21053
+
21054
+ if (!Array.isArray(this.selectedTags)) {
21055
+ return null;
21056
+ }
21057
+
21058
+ var tagsList = [].concat(this.selectedTags);
21059
+ var shouldRenderClearAllTag = tagsList.length > 1;
21060
+ var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
21061
+ return renderSelectedTags ? renderSelectedTags({
21062
+ values: this.selectedTags,
21063
+ handleClear: this.clearTag,
21064
+ handleClearAll: this.clearAllTags
21065
+ }) : h(TagsContainer, [tagsList.map(function (item) {
21066
+ return _this3.renderTag(item);
21067
+ }), shouldRenderClearAllTag && h(TagItem, {
21068
+ "class": getClassName$3(this.$props.innerClass, 'selected-tag') || ''
21069
+ }, [h("span", ["Clear All"]), h("span", {
21070
+ "attrs": {
21071
+ "role": "img",
21072
+ "aria-label": "delete-tag"
21073
+ },
21074
+ "class": "close-icon",
21075
+ "on": {
21076
+ "click": this.clearAllTags
21077
+ }
21078
+ }, [h(CancelSvg)])])]);
21079
+ },
20297
21080
  renderInputAddonAfter: function renderInputAddonAfter() {
20298
21081
  var h = this.$createElement;
20299
21082
  var addonAfter = this.$scopedSlots.addonAfter;
@@ -20364,7 +21147,7 @@
20364
21147
  (_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
20365
21148
  },
20366
21149
  listenForFocusShortcuts: function listenForFocusShortcuts() {
20367
- var _this2 = this;
21150
+ var _this4 = this;
20368
21151
 
20369
21152
  var _this$$props$focusSho = this.$props.focusShortcuts,
20370
21153
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
@@ -20382,7 +21165,7 @@
20382
21165
  // Prevent the default refresh event under WINDOWS system
20383
21166
  event.preventDefault();
20384
21167
 
20385
- _this2.focusSearchBox(event);
21168
+ _this4.focusSearchBox(event);
20386
21169
  }); // if one of modifier keys are used, they are handled below
20387
21170
 
20388
21171
  hotkeys('*', function (event) {
@@ -20393,7 +21176,7 @@
20393
21176
  var element = modifierKeys[index];
20394
21177
 
20395
21178
  if (hotkeys[element]) {
20396
- _this2.focusSearchBox(event);
21179
+ _this4.focusSearchBox(event);
20397
21180
 
20398
21181
  break;
20399
21182
  }
@@ -20402,7 +21185,7 @@
20402
21185
  }
20403
21186
  },
20404
21187
  render: function render() {
20405
- var _this3 = this;
21188
+ var _this5 = this;
20406
21189
 
20407
21190
  var h = arguments[0];
20408
21191
  var _this$$props4 = this.$props,
@@ -20441,14 +21224,14 @@
20441
21224
  setHighlightedIndex = _ref3.setHighlightedIndex;
20442
21225
 
20443
21226
  var renderSuggestionsContainer = function renderSuggestionsContainer() {
20444
- return h("div", [_this3.hasCustomRenderer && _this3.getComponent({
21227
+ return h("div", [_this5.hasCustomRenderer && _this5.getComponent({
20445
21228
  isOpen: isOpen,
20446
21229
  getItemProps: getItemProps,
20447
21230
  getItemEvents: getItemEvents,
20448
21231
  highlightedIndex: highlightedIndex
20449
- }), _this3.renderErrorComponent(), !_this3.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
20450
- "class": suggestions$1(_this3.themePreset, theme) + " " + getClassName$3(_this3.$props.innerClass, 'list')
20451
- }, [_this3.suggestionsList.slice(0, size || 10).map(function (item, index) {
21232
+ }), _this5.renderErrorComponent(), !_this5.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
21233
+ "class": suggestions$1(_this5.themePreset, theme) + " " + getClassName$3(_this5.$props.innerClass, 'list')
21234
+ }, [_this5.suggestionsList.slice(0, size || 10).map(function (item, index) {
20452
21235
  return h("li", {
20453
21236
  "domProps": _extends({}, getItemProps({
20454
21237
  item: item
@@ -20458,15 +21241,15 @@
20458
21241
  })),
20459
21242
  "key": index + 1 + "-" + item.value,
20460
21243
  "style": {
20461
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, index)
21244
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, index)
20462
21245
  }
20463
21246
  }, [h(SuggestionItem, {
20464
21247
  "attrs": {
20465
- "currentValue": _this3.currentValue,
21248
+ "currentValue": _this5.currentValue,
20466
21249
  "suggestion": item
20467
21250
  }
20468
21251
  })]);
20469
- }), _this3.defaultSearchSuggestions.map(function (sugg, index) {
21252
+ }), _this5.defaultSearchSuggestions.map(function (sugg, index) {
20470
21253
  return h("li", {
20471
21254
  "domProps": _extends({}, getItemProps({
20472
21255
  item: sugg
@@ -20474,9 +21257,9 @@
20474
21257
  "on": _extends({}, getItemEvents({
20475
21258
  item: sugg
20476
21259
  })),
20477
- "key": _this3.suggestionsList.length + index + 1 + "-" + sugg.value,
21260
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
20478
21261
  "style": {
20479
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, _this3.suggestionsList.length + index),
21262
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
20480
21263
  justifyContent: 'flex-start'
20481
21264
  }
20482
21265
  }, [h("div", {
@@ -20485,28 +21268,28 @@
20485
21268
  }
20486
21269
  }, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
20487
21270
  "attrs": {
20488
- "className": getClassName$3(_this3.$props.innerClass, 'recent-search-icon') || null,
21271
+ "className": getClassName$3(_this5.$props.innerClass, 'recent-search-icon') || null,
20489
21272
  "icon": recentSearchesIcon,
20490
21273
  "type": "recent-search-icon"
20491
21274
  }
20492
21275
  }), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
20493
21276
  "attrs": {
20494
- "className": getClassName$3(_this3.$props.innerClass, 'popular-search-icon') || null,
21277
+ "className": getClassName$3(_this5.$props.innerClass, 'popular-search-icon') || null,
20495
21278
  "icon": popularSearchesIcon,
20496
21279
  "type": "popular-search-icon"
20497
21280
  }
20498
21281
  })]), h(SuggestionItem, {
20499
21282
  "attrs": {
20500
- "currentValue": _this3.currentValue,
21283
+ "currentValue": _this5.currentValue,
20501
21284
  "suggestion": sugg
20502
21285
  }
20503
21286
  })]);
20504
- }), hasQuerySuggestionsRenderer(_this3) ? _this3.getComponent({
21287
+ }), hasQuerySuggestionsRenderer(_this5) ? _this5.getComponent({
20505
21288
  isOpen: isOpen,
20506
21289
  getItemProps: getItemProps,
20507
21290
  getItemEvents: getItemEvents,
20508
21291
  highlightedIndex: highlightedIndex
20509
- }, true) : _this3.topSuggestions.map(function (sugg, index) {
21292
+ }, true) : _this5.topSuggestions.map(function (sugg, index) {
20510
21293
  return h("li", {
20511
21294
  "domProps": _extends({}, getItemProps({
20512
21295
  item: sugg
@@ -20514,9 +21297,9 @@
20514
21297
  "on": _extends({}, getItemEvents({
20515
21298
  item: sugg
20516
21299
  })),
20517
- "key": _this3.suggestionsList.length + index + 1 + "-" + sugg.value,
21300
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
20518
21301
  "style": {
20519
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, _this3.suggestionsList.length + index),
21302
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
20520
21303
  justifyContent: 'flex-start'
20521
21304
  }
20522
21305
  }, [h("div", {
@@ -20525,61 +21308,61 @@
20525
21308
  }
20526
21309
  }, [h(CustomSvg, {
20527
21310
  "attrs": {
20528
- "className": getClassName$3(_this3.$props.innerClass, 'popular-search-icon') || null,
21311
+ "className": getClassName$3(_this5.$props.innerClass, 'popular-search-icon') || null,
20529
21312
  "icon": popularSearchesIcon,
20530
21313
  "type": "popular-search-icon"
20531
21314
  }
20532
21315
  })]), h(SuggestionItem, {
20533
21316
  "attrs": {
20534
- "currentValue": _this3.currentValue,
21317
+ "currentValue": _this5.currentValue,
20535
21318
  "suggestion": sugg
20536
21319
  }
20537
21320
  })]);
20538
- })]) : _this3.renderNoSuggestions(_this3.suggestionsList)]);
21321
+ })]) : _this5.renderNoSuggestions(_this5.suggestionsList)]);
20539
21322
  };
20540
21323
 
20541
21324
  return h("div", {
20542
21325
  "class": suggestionsContainer
20543
- }, [h(InputGroup, [_this3.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
21326
+ }, [h(InputGroup, [_this5.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
20544
21327
  "attrs": {
20545
- "id": _this3.$props.componentId + "-input",
20546
- "showIcon": _this3.$props.showIcon,
20547
- "showClear": _this3.$props.showClear,
20548
- "iconPosition": _this3.$props.iconPosition,
20549
- "placeholder": _this3.$props.placeholder,
20550
- "autoFocus": _this3.$props.autoFocus,
20551
- "themePreset": _this3.themePreset,
21328
+ "id": _this5.$props.componentId + "-input",
21329
+ "showIcon": _this5.$props.showIcon,
21330
+ "showClear": _this5.$props.showClear,
21331
+ "iconPosition": _this5.$props.iconPosition,
21332
+ "placeholder": _this5.$props.placeholder,
21333
+ "autoFocus": _this5.$props.autoFocus,
21334
+ "themePreset": _this5.themePreset,
20552
21335
  "autocomplete": "off"
20553
21336
  },
20554
- "ref": _this3.$props.innerRef,
20555
- "class": getClassName$3(_this3.$props.innerClass, 'input'),
21337
+ "ref": _this5.$props.innerRef,
21338
+ "class": getClassName$3(_this5.$props.innerClass, 'input'),
20556
21339
  "on": _extends({}, getInputEvents({
20557
- onInput: _this3.onInputChange,
21340
+ onInput: _this5.onInputChange,
20558
21341
  onBlur: function onBlur(e) {
20559
- _this3.$emit('blur', e, _this3.triggerQuery);
21342
+ _this5.$emit('blur', e, _this5.triggerQuery);
20560
21343
  },
20561
- onFocus: _this3.handleFocus,
21344
+ onFocus: _this5.handleFocus,
20562
21345
  onKeyPress: function onKeyPress(e) {
20563
- _this3.$emit('keyPress', e, _this3.triggerQuery);
21346
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
20564
21347
 
20565
- _this3.$emit('key-press', e, _this3.triggerQuery);
21348
+ _this5.$emit('key-press', e, _this5.triggerQuery);
20566
21349
  },
20567
21350
  onKeyDown: function onKeyDown(e) {
20568
- return _this3.handleKeyDown(e, highlightedIndex);
21351
+ return _this5.handleKeyDown(e, highlightedIndex);
20569
21352
  },
20570
21353
  onKeyUp: function onKeyUp(e) {
20571
- _this3.$emit('keyUp', e, _this3.triggerQuery);
21354
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
20572
21355
 
20573
- _this3.$emit('key-up', e, _this3.triggerQuery);
21356
+ _this5.$emit('key-up', e, _this5.triggerQuery);
20574
21357
  },
20575
21358
  onClick: function onClick() {
20576
21359
  setHighlightedIndex(null);
20577
21360
  }
20578
21361
  })),
20579
21362
  "domProps": _extends({}, getInputProps({
20580
- value: _this3.$data.currentValue === null ? '' : _this3.$data.currentValue
21363
+ value: _this5.$data.currentValue === null ? '' : _this5.$data.currentValue
20581
21364
  }))
20582
- }), _this3.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this3.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer()]);
21365
+ }), _this5.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this5.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this5.renderTags()]);
20583
21366
  }
20584
21367
  }
20585
21368
  }) : h("div", {
@@ -20595,26 +21378,26 @@
20595
21378
  },
20596
21379
  "on": _extends({}, {
20597
21380
  blur: function blur(e) {
20598
- _this3.$emit('blur', e, _this3.triggerQuery);
21381
+ _this5.$emit('blur', e, _this5.triggerQuery);
20599
21382
  },
20600
21383
  keypress: function keypress(e) {
20601
- _this3.$emit('keyPress', e, _this3.triggerQuery);
21384
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
20602
21385
 
20603
- _this3.$emit('key-press', e, _this3.triggerQuery);
21386
+ _this5.$emit('key-press', e, _this5.triggerQuery);
20604
21387
  },
20605
21388
  input: this.onInputChange,
20606
21389
  focus: function focus(e) {
20607
- _this3.$emit('focus', e, _this3.triggerQuery);
21390
+ _this5.$emit('focus', e, _this5.triggerQuery);
20608
21391
  },
20609
21392
  keydown: function keydown(e) {
20610
- _this3.$emit('keyDown', e, _this3.triggerQuery);
21393
+ _this5.$emit('keyDown', e, _this5.triggerQuery);
20611
21394
 
20612
- _this3.$emit('key-down', e, _this3.triggerQuery);
21395
+ _this5.$emit('key-down', e, _this5.triggerQuery);
20613
21396
  },
20614
21397
  keyup: function keyup(e) {
20615
- _this3.$emit('keyUp', e, _this3.triggerQuery);
21398
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
20616
21399
 
20617
- _this3.$emit('key-up', e, _this3.triggerQuery);
21400
+ _this5.$emit('key-up', e, _this5.triggerQuery);
20618
21401
  }
20619
21402
  }),
20620
21403
  "domProps": _extends({}, {
@@ -20813,7 +21596,8 @@
20813
21596
  setCustomHighlightOptions: setCustomHighlightOptions,
20814
21597
  recordSuggestionClick: recordSuggestionClick,
20815
21598
  loadPopularSuggestions: loadPopularSuggestions,
20816
- getRecentSearches: getRecentSearches
21599
+ getRecentSearches: getRecentSearches,
21600
+ resetStoreForComponent: resetStoreForComponent
20817
21601
  };
20818
21602
  var DSConnected = ComponentWrapper$1(connect(mapStateToProps$3, mapDispatchToProps$2)(DataSearch), {
20819
21603
  componentType: constants_1$1.dataSearch,
@@ -20827,8 +21611,8 @@
20827
21611
 
20828
21612
  DataSearch.componentType = constants_1$1.dataSearch;
20829
21613
 
20830
- var _templateObject$j;
20831
- 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"])));
21614
+ var _templateObject$k;
21615
+ var AutofillSvgIcon = index$1('button')(_templateObject$k || (_templateObject$k = _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"])));
20832
21616
  var AutoFillSvg = {
20833
21617
  name: 'AutoFillSvg',
20834
21618
  render: function render() {
@@ -20869,10 +21653,12 @@
20869
21653
  normalizeDataField$1 = lib_8.normalizeDataField;
20870
21654
  var SearchBox = {
20871
21655
  name: 'SearchBox',
21656
+ isTagsMode: false,
20872
21657
  data: function data() {
20873
21658
  var props = this.$props;
20874
21659
  this.__state = {
20875
21660
  currentValue: '',
21661
+ selectedTags: [],
20876
21662
  isOpen: false,
20877
21663
  normalizedSuggestions: []
20878
21664
  };
@@ -20888,7 +21674,16 @@
20888
21674
  var _this$$props = this.$props,
20889
21675
  distinctField = _this$$props.distinctField,
20890
21676
  distinctFieldConfig = _this$$props.distinctFieldConfig,
20891
- index = _this$$props.index;
21677
+ index = _this$$props.index,
21678
+ mode = _this$$props.mode;
21679
+
21680
+ if (mode === constants_5$1.TAG) {
21681
+ this.$options.isTagsMode = true;
21682
+ }
21683
+
21684
+ if (this.$options.isTagsMode) {
21685
+ console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
21686
+ }
20892
21687
 
20893
21688
  if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
20894
21689
  console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
@@ -20902,9 +21697,13 @@
20902
21697
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
20903
21698
  }
20904
21699
 
20905
- this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
20906
- this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
20907
- this.setValue(this.currentValue, true, this.$props, undefined, false, this.selectedCategory); // Set custom and default queries in store
21700
+ this.currentValue = decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
21701
+
21702
+ if (this.$options.isTagsMode) {
21703
+ this.currentValue = '';
21704
+ }
21705
+
21706
+ this.handleTextChange = _debounce(this.handleText, this.$props.debounce); // Set custom and default queries in store
20908
21707
 
20909
21708
  this.triggerCustomQuery(this.currentValue, this.selectedCategory);
20910
21709
  this.triggerDefaultQuery(this.currentValue);
@@ -20940,7 +21739,7 @@
20940
21739
  debounce: VueTypes.number.def(0),
20941
21740
  defaultValue: types.string,
20942
21741
  excludeFields: types.excludeFields,
20943
- value: types.value,
21742
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), types.value]),
20944
21743
  defaultSuggestions: types.suggestions,
20945
21744
  enableSynonyms: VueTypes.bool.def(true),
20946
21745
  enableQuerySuggestions: VueTypes.bool.def(false),
@@ -20993,7 +21792,20 @@
20993
21792
  onData: types.func,
20994
21793
  renderItem: types.func,
20995
21794
  enterButton: VueTypes.bool.def(false),
20996
- renderEnterButton: VueTypes.any
21795
+ renderEnterButton: VueTypes.any,
21796
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
21797
+ renderSelectedTags: VueTypes.any,
21798
+ searchboxId: VueTypes.string,
21799
+ endpoint: types.endpointConfig
21800
+ },
21801
+ beforeMount: function beforeMount() {
21802
+ if (this.selectedValue) {
21803
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
21804
+ } else if (this.$props.value) {
21805
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
21806
+ } else if (this.$props.defaultValue) {
21807
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined);
21808
+ }
20997
21809
  },
20998
21810
  mounted: function mounted() {
20999
21811
  this.listenForFocusShortcuts();
@@ -21043,15 +21855,25 @@
21043
21855
  this.normalizedSuggestions = suggestionsList;
21044
21856
  },
21045
21857
  selectedValue: function selectedValue(newVal, oldVal) {
21046
- if (oldVal !== newVal && this.$data.currentValue !== newVal) {
21858
+ if (!isEqual$5(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual$5(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
21047
21859
  if (!newVal && this.$data.currentValue) {
21048
21860
  // selected value is cleared, call onValueSelected
21049
21861
  this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
21862
+ } // if (this.$props.value === undefined) {
21863
+
21864
+
21865
+ if (this.$options.isTagsMode) {
21866
+ // handling reset of tags through SelectedFilters or URL
21867
+ this.selectedTags = [];
21050
21868
  }
21051
21869
 
21052
- if (this.$props.value === undefined) {
21053
- this.setValue(newVal || '', true, this.$props);
21870
+ var cause = !newVal ? lib_7.CLEAR_VALUE : undefined;
21871
+
21872
+ if (this.$options.isTagsMode) {
21873
+ cause = lib_7.SUGGESTION_SELECT;
21054
21874
  }
21875
+
21876
+ this.setValue(newVal || '', true, this.$props, cause); // }
21055
21877
  }
21056
21878
  },
21057
21879
  focusShortcuts: function focusShortcuts() {
@@ -21153,7 +21975,7 @@
21153
21975
  // returns size and aggs property
21154
21976
  getBasicQueryOptions: function getBasicQueryOptions() {
21155
21977
  var aggregationField = this.$props.aggregationField;
21156
- var queryOptions = helper_28(this.$props);
21978
+ var queryOptions = helper_35(this.$props);
21157
21979
 
21158
21980
  if (aggregationField) {
21159
21981
  queryOptions.aggs = getCompositeAggsQuery$2({
@@ -21192,7 +22014,40 @@
21192
22014
  }
21193
22015
 
21194
22016
  var performUpdate = function performUpdate() {
21195
- _this.currentValue = value;
22017
+ if (_this.$options.isTagsMode && isEqual$5(value, _this.selectedTags)) {
22018
+ return;
22019
+ }
22020
+
22021
+ if (_this.$options.isTagsMode && cause === lib_7.SUGGESTION_SELECT) {
22022
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
22023
+ // check if value already present in selectedTags
22024
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
22025
+ _this.isOpen = false;
22026
+ return;
22027
+ }
22028
+
22029
+ _this.selectedTags = [].concat(_this.selectedTags);
22030
+
22031
+ if (typeof value === 'string' && !!value) {
22032
+ _this.selectedTags.push(value);
22033
+ } else if (Array.isArray(value) && !isEqual$5(_this.selectedTags, value)) {
22034
+ var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
22035
+ _this.selectedTags = mergedArray;
22036
+ }
22037
+ } else if (value) {
22038
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
22039
+ }
22040
+
22041
+ _this.currentValue = '';
22042
+ } else {
22043
+ _this.currentValue = decodeHtml(value);
22044
+ }
22045
+
22046
+ var queryHandlerValue = value;
22047
+
22048
+ if (_this.$options.isTagsMode && cause === lib_7.SUGGESTION_SELECT) {
22049
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
22050
+ }
21196
22051
 
21197
22052
  if (isDefaultValue) {
21198
22053
  if (_this.$props.autosuggest) {
@@ -21200,19 +22055,19 @@
21200
22055
  _this.isOpen = false;
21201
22056
  }
21202
22057
 
21203
- _this.triggerDefaultQuery(value);
22058
+ if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
21204
22059
  } // in case of strict selection only SUGGESTION_SELECT should be able
21205
22060
  // to set the query otherwise the value should reset
21206
22061
 
21207
22062
 
21208
22063
  if (props.strictSelection) {
21209
- if (cause === lib_7.SUGGESTION_SELECT || value === '') {
21210
- _this.triggerCustomQuery(value, categoryValue);
22064
+ if (cause === lib_7.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
22065
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
21211
22066
  } else {
21212
22067
  _this.setValue('', true);
21213
22068
  }
21214
- } else if (props.value === undefined) {
21215
- _this.triggerCustomQuery(value, categoryValue);
22069
+ } else if (props.value === undefined || cause === lib_7.SUGGESTION_SELECT || cause === lib_7.CLEAR_VALUE) {
22070
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
21216
22071
  }
21217
22072
  } else {
21218
22073
  // debounce for handling text while typing
@@ -21263,6 +22118,11 @@
21263
22118
  showFilter = _this$$props2.showFilter,
21264
22119
  URLParams = _this$$props2.URLParams;
21265
22120
  var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
22121
+
22122
+ if (this.$options.isTagsMode) {
22123
+ value = paramValue;
22124
+ }
22125
+
21266
22126
  var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
21267
22127
  var query = defaultQueryTobeSet;
21268
22128
 
@@ -21356,7 +22216,8 @@
21356
22216
  if (this.$props.autosuggest === false) {
21357
22217
  this.enterButtonOnClick();
21358
22218
  } else if (highlightedIndex === null) {
21359
- this.setValue(event.target.value, true);
22219
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined // to handle tags
22220
+ );
21360
22221
  this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
21361
22222
  }
21362
22223
  } // Need to review
@@ -21401,13 +22262,29 @@
21401
22262
  if (value === undefined) {
21402
22263
  this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT, false, suggestion._category);
21403
22264
  } else {
21404
- this.$emit('change', suggestion.value, function (_ref4) {
22265
+ var emitValue = suggestion.value;
22266
+
22267
+ if (this.$options.isTagsMode) {
22268
+ emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
22269
+
22270
+ if (this.selectedTags.includes(suggestion.value)) {
22271
+ // avoid duplicates in tags array
22272
+ this.isOpen = false;
22273
+ return;
22274
+ }
22275
+
22276
+ emitValue.push(suggestion.value);
22277
+ }
22278
+
22279
+ this.setValue(emitValue, true, this.$props, lib_7.SUGGESTION_SELECT, false, suggestion._category);
22280
+ this.$emit('change', emitValue, function (_ref4) {
21405
22281
  var isOpen = _ref4.isOpen;
21406
- return _this3.triggerQuery({
22282
+ return _this3.triggerQuery(_extends({
21407
22283
  isOpen: isOpen,
21408
- value: suggestion.value,
22284
+ value: emitValue
22285
+ }, !_this3.$options.isTagsMode && {
21409
22286
  categoryValue: suggestion._category
21410
- });
22287
+ }));
21411
22288
  });
21412
22289
  }
21413
22290
 
@@ -21553,7 +22430,7 @@
21553
22430
  }
21554
22431
 
21555
22432
  return h(Button, {
21556
- "class": "enter-btn " + getClassName$4(innerClass, 'enterButton'),
22433
+ "class": "enter-btn " + getClassName$4(innerClass, 'enter-button'),
21557
22434
  "attrs": {
21558
22435
  "primary": true
21559
22436
  },
@@ -21669,7 +22546,7 @@
21669
22546
  onAutofillClick: function onAutofillClick(suggestion) {
21670
22547
  var value = suggestion.value;
21671
22548
  this.isOpen = true;
21672
- this.currentValue = value;
22549
+ this.currentValue = decodeHtml(value);
21673
22550
  this.triggerDefaultQuery(value);
21674
22551
  },
21675
22552
  renderAutoFill: function renderAutoFill(suggestion) {
@@ -21690,10 +22567,79 @@
21690
22567
  "click": handleAutoFillClick
21691
22568
  }
21692
22569
  });
22570
+ },
22571
+ renderTag: function renderTag(item) {
22572
+ var _this7 = this;
22573
+
22574
+ var h = this.$createElement;
22575
+ var innerClass = this.$props.innerClass;
22576
+ return h(TagItem, {
22577
+ "class": getClassName$4(innerClass, 'selected-tag') || ''
22578
+ }, [h("span", [item]), h("span", {
22579
+ "attrs": {
22580
+ "role": "img",
22581
+ "aria-label": "delete-tag"
22582
+ },
22583
+ "class": "close-icon",
22584
+ "on": {
22585
+ "click": function click() {
22586
+ return _this7.clearTag(item);
22587
+ }
22588
+ }
22589
+ }, [h(CancelSvg)])]);
22590
+ },
22591
+ clearAllTags: function clearAllTags() {
22592
+ this.selectedTags = [];
22593
+ this.setValue('', true, this.$props, lib_7.SUGGESTION_SELECT);
22594
+
22595
+ if (this.$props.value !== undefined) {
22596
+ this.$emit('change', this.selectedTags, this.triggerQuery);
22597
+ }
22598
+ },
22599
+ clearTag: function clearTag(tagValue) {
22600
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
22601
+ return tag !== tagValue;
22602
+ }));
22603
+ this.setValue('', true, this.$props, lib_7.SUGGESTION_SELECT);
22604
+
22605
+ if (this.$props.value !== undefined) {
22606
+ this.$emit('change', this.selectedTags, this.triggerQuery);
22607
+ }
22608
+ },
22609
+ renderTags: function renderTags() {
22610
+ var _this8 = this;
22611
+
22612
+ var h = this.$createElement;
22613
+
22614
+ if (!Array.isArray(this.selectedTags)) {
22615
+ return null;
22616
+ }
22617
+
22618
+ var tagsList = [].concat(this.selectedTags);
22619
+ var shouldRenderClearAllTag = tagsList.length > 1;
22620
+ var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
22621
+ return renderSelectedTags ? renderSelectedTags({
22622
+ values: this.selectedTags,
22623
+ handleClear: this.clearTag,
22624
+ handleClearAll: this.clearAllTags
22625
+ }) : h(TagsContainer, [tagsList.map(function (item) {
22626
+ return _this8.renderTag(item);
22627
+ }), shouldRenderClearAllTag && h(TagItem, {
22628
+ "class": getClassName$4(this.$props.innerClass, 'selected-tag') || ''
22629
+ }, [h("span", ["Clear All"]), h("span", {
22630
+ "attrs": {
22631
+ "role": "img",
22632
+ "aria-label": "delete-tag"
22633
+ },
22634
+ "class": "close-icon",
22635
+ "on": {
22636
+ "click": this.clearAllTags
22637
+ }
22638
+ }, [h(CancelSvg)])])]);
21693
22639
  }
21694
22640
  },
21695
22641
  render: function render() {
21696
- var _this7 = this;
22642
+ var _this9 = this;
21697
22643
 
21698
22644
  var h = arguments[0];
21699
22645
  var _this$$props6 = this.$props,
@@ -21728,10 +22674,10 @@
21728
22674
  var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
21729
22675
  var getIcon = function getIcon(iconType) {
21730
22676
  switch (iconType) {
21731
- case helper_6.Recent:
22677
+ case helper_13.Recent:
21732
22678
  return recentSearchesIcon;
21733
22679
 
21734
- case helper_6.Popular:
22680
+ case helper_13.Popular:
21735
22681
  return popularSearchesIcon;
21736
22682
 
21737
22683
  default:
@@ -21739,14 +22685,14 @@
21739
22685
  }
21740
22686
  };
21741
22687
 
21742
- return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
22688
+ return h("div", [_this9.hasCustomRenderer && _this9.getComponent({
21743
22689
  isOpen: isOpen,
21744
22690
  getItemProps: getItemProps,
21745
22691
  getItemEvents: getItemEvents,
21746
22692
  highlightedIndex: highlightedIndex
21747
- }), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
21748
- "class": suggestions$1(_this7.themePreset, theme) + " " + getClassName$4(_this7.$props.innerClass, 'list')
21749
- }, [_this7.normalizedSuggestions.map(function (item, index) {
22693
+ }), _this9.renderErrorComponent(), !_this9.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
22694
+ "class": suggestions$1(_this9.themePreset, theme) + " " + getClassName$4(_this9.$props.innerClass, 'list')
22695
+ }, [_this9.normalizedSuggestions.map(function (item, index) {
21750
22696
  return renderItem ? h("li", {
21751
22697
  "domProps": _extends({}, getItemProps({
21752
22698
  item: item
@@ -21756,7 +22702,7 @@
21756
22702
  })),
21757
22703
  "key": index + 1 + "-" + item.value,
21758
22704
  "style": {
21759
- backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
22705
+ backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
21760
22706
  justifyContent: 'flex-start',
21761
22707
  alignItems: 'center'
21762
22708
  }
@@ -21769,7 +22715,7 @@
21769
22715
  })),
21770
22716
  "key": index + 1 + "-" + item.value,
21771
22717
  "style": {
21772
- backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
22718
+ backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
21773
22719
  justifyContent: 'flex-start',
21774
22720
  alignItems: 'center'
21775
22721
  }
@@ -21780,61 +22726,61 @@
21780
22726
  }
21781
22727
  }, [h(CustomSvg, {
21782
22728
  "attrs": {
21783
- "className": getClassName$4(_this7.$props.innerClass, item._suggestion_type + "-search-icon") || null,
22729
+ "className": getClassName$4(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
21784
22730
  "icon": getIcon(item._suggestion_type),
21785
22731
  "type": item._suggestion_type + "-search-icon"
21786
22732
  }
21787
22733
  })]), h(SuggestionItem, {
21788
22734
  "attrs": {
21789
- "currentValue": _this7.currentValue,
22735
+ "currentValue": _this9.currentValue,
21790
22736
  "suggestion": item
21791
22737
  }
21792
- }), _this7.renderAutoFill(item)]);
21793
- })]) : _this7.renderNoSuggestions(_this7.normalizedSuggestions)]);
22738
+ }), _this9.renderAutoFill(item)]);
22739
+ })]) : _this9.renderNoSuggestions(_this9.normalizedSuggestions)]);
21794
22740
  };
21795
22741
 
21796
22742
  return h("div", {
21797
22743
  "class": suggestionsContainer
21798
- }, [h(InputGroup, [_this7.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
22744
+ }, [h(InputGroup, [_this9.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
21799
22745
  "attrs": {
21800
- "id": _this7.$props.componentId + "-input",
21801
- "showIcon": _this7.$props.showIcon,
21802
- "showClear": _this7.$props.showClear,
21803
- "iconPosition": _this7.$props.iconPosition,
21804
- "placeholder": _this7.$props.placeholder,
21805
- "autoFocus": _this7.$props.autoFocus,
21806
- "themePreset": _this7.themePreset,
22746
+ "id": _this9.$props.componentId + "-input",
22747
+ "showIcon": _this9.$props.showIcon,
22748
+ "showClear": _this9.$props.showClear,
22749
+ "iconPosition": _this9.$props.iconPosition,
22750
+ "placeholder": _this9.$props.placeholder,
22751
+ "autoFocus": _this9.$props.autoFocus,
22752
+ "themePreset": _this9.themePreset,
21807
22753
  "autocomplete": "off"
21808
22754
  },
21809
- "ref": _this7.$props.innerRef,
21810
- "class": getClassName$4(_this7.$props.innerClass, 'input'),
22755
+ "ref": _this9.$props.innerRef,
22756
+ "class": getClassName$4(_this9.$props.innerClass, 'input'),
21811
22757
  "on": _extends({}, getInputEvents({
21812
- onInput: _this7.onInputChange,
22758
+ onInput: _this9.onInputChange,
21813
22759
  onBlur: function onBlur(e) {
21814
- _this7.$emit('blur', e, _this7.triggerQuery);
22760
+ _this9.$emit('blur', e, _this9.triggerQuery);
21815
22761
  },
21816
- onFocus: _this7.handleFocus,
22762
+ onFocus: _this9.handleFocus,
21817
22763
  onKeyPress: function onKeyPress(e) {
21818
- _this7.$emit('keyPress', e, _this7.triggerQuery);
22764
+ _this9.$emit('keyPress', e, _this9.triggerQuery);
21819
22765
 
21820
- _this7.$emit('key-press', e, _this7.triggerQuery);
22766
+ _this9.$emit('key-press', e, _this9.triggerQuery);
21821
22767
  },
21822
22768
  onKeyDown: function onKeyDown(e) {
21823
- return _this7.handleKeyDown(e, highlightedIndex);
22769
+ return _this9.handleKeyDown(e, highlightedIndex);
21824
22770
  },
21825
22771
  onKeyUp: function onKeyUp(e) {
21826
- _this7.$emit('keyUp', e, _this7.triggerQuery);
22772
+ _this9.$emit('keyUp', e, _this9.triggerQuery);
21827
22773
 
21828
- _this7.$emit('key-up', e, _this7.triggerQuery);
22774
+ _this9.$emit('key-up', e, _this9.triggerQuery);
21829
22775
  },
21830
22776
  onClick: function onClick() {
21831
22777
  setHighlightedIndex(null);
21832
22778
  }
21833
22779
  })),
21834
22780
  "domProps": _extends({}, getInputProps({
21835
- value: _this7.$data.currentValue === null ? '' : _this7.$data.currentValue
22781
+ value: _this9.$data.currentValue === null ? '' : _this9.$data.currentValue
21836
22782
  }))
21837
- }), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this7.renderInputAddonAfter(), _this7.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
22783
+ }), _this9.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this9.renderInputAddonAfter(), _this9.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown(), _this9.renderTags()]);
21838
22784
  }
21839
22785
  }
21840
22786
  }) : h("div", {
@@ -21850,22 +22796,22 @@
21850
22796
  },
21851
22797
  "on": _extends({}, {
21852
22798
  blur: function blur(e) {
21853
- _this7.$emit('blur', e, _this7.triggerQuery);
22799
+ _this9.$emit('blur', e, _this9.triggerQuery);
21854
22800
  },
21855
22801
  keypress: function keypress(e) {
21856
- _this7.$emit('keyPress', e, _this7.triggerQuery);
22802
+ _this9.$emit('keyPress', e, _this9.triggerQuery);
21857
22803
 
21858
- _this7.$emit('key-press', e, _this7.triggerQuery);
22804
+ _this9.$emit('key-press', e, _this9.triggerQuery);
21859
22805
  },
21860
22806
  input: this.onInputChange,
21861
22807
  focus: function focus(e) {
21862
- _this7.$emit('focus', e, _this7.triggerQuery);
22808
+ _this9.$emit('focus', e, _this9.triggerQuery);
21863
22809
  },
21864
22810
  keydown: this.handleKeyDown,
21865
22811
  keyup: function keyup(e) {
21866
- _this7.$emit('keyUp', e, _this7.triggerQuery);
22812
+ _this9.$emit('keyUp', e, _this9.triggerQuery);
21867
22813
 
21868
- _this7.$emit('key-up', e, _this7.triggerQuery);
22814
+ _this9.$emit('key-up', e, _this9.triggerQuery);
21869
22815
  }
21870
22816
  }),
21871
22817
  "domProps": _extends({}, {
@@ -22024,14 +22970,14 @@
22024
22970
 
22025
22971
  SearchBox.componentType = constants_1$1.searchBox;
22026
22972
 
22027
- var _templateObject$k, _templateObject2$7, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$3;
22973
+ var _templateObject$l, _templateObject2$8, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$3;
22028
22974
  var item = {
22029
22975
  width: '15px',
22030
22976
  height: '15px',
22031
22977
  scale: '4px'
22032
22978
  };
22033
- 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"])));
22034
- 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"])));
22979
+ var vh = css(_templateObject$l || (_templateObject$l = _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"])));
22980
+ var hideInputControl = css(_templateObject2$8 || (_templateObject2$8 = _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"])));
22035
22981
 
22036
22982
  var formItem = function formItem(_ref) {
22037
22983
  var theme = _ref.theme;
@@ -22157,7 +23103,8 @@
22157
23103
  missingLabel: VueTypes.string.def('N/A'),
22158
23104
  nestedField: types.string,
22159
23105
  index: VueTypes.string,
22160
- enableStrictSelection: VueTypes.bool.def(false)
23106
+ enableStrictSelection: VueTypes.bool.def(false),
23107
+ endpoint: types.endpointConfig
22161
23108
  },
22162
23109
  data: function data() {
22163
23110
  var props = this.$props;
@@ -22638,7 +23585,8 @@
22638
23585
  showMissing: VueTypes.bool.def(false),
22639
23586
  missingLabel: VueTypes.string.def('N/A'),
22640
23587
  nestedField: types.string,
22641
- index: VueTypes.string
23588
+ index: VueTypes.string,
23589
+ endpoint: types.endpointConfig
22642
23590
  },
22643
23591
  data: function data() {
22644
23592
  var props = this.$props;
@@ -23188,12 +24136,12 @@
23188
24136
 
23189
24137
  MultiList.componentType = constants_1$1.multiList;
23190
24138
 
23191
- var _templateObject$l, _templateObject2$8, _templateObject3$7, _templateObject4$6;
23192
- 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"])));
24139
+ var _templateObject$m, _templateObject2$9, _templateObject3$7, _templateObject4$6;
24140
+ var small = css(_templateObject$m || (_templateObject$m = _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"])));
23193
24141
 
23194
24142
  var dark$2 = function dark(_ref) {
23195
24143
  var theme = _ref.theme;
23196
- return css(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
24144
+ return css(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
23197
24145
  };
23198
24146
 
23199
24147
  var Select = index$1('button')(_templateObject3$7 || (_templateObject3$7 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
@@ -23207,9 +24155,9 @@
23207
24155
  return theme.colors.primaryColor;
23208
24156
  });
23209
24157
 
23210
- var _templateObject$m, _templateObject2$9;
23211
- var open = css(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
23212
- 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) {
24158
+ var _templateObject$n, _templateObject2$a;
24159
+ var open = css(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
24160
+ var Chevron = index$1('span')(_templateObject2$a || (_templateObject2$a = _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) {
23213
24161
  return props.open ? open : null;
23214
24162
  });
23215
24163
 
@@ -23557,7 +24505,8 @@
23557
24505
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
23558
24506
  nestedField: types.string,
23559
24507
  index: VueTypes.string,
23560
- searchPlaceholder: VueTypes.string.def('Type here to search...')
24508
+ searchPlaceholder: VueTypes.string.def('Type here to search...'),
24509
+ endpoint: types.endpointConfig
23561
24510
  },
23562
24511
  created: function created() {
23563
24512
  if (!this.enableAppbase && this.$props.index) {
@@ -24013,7 +24962,8 @@
24013
24962
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
24014
24963
  nestedField: types.string,
24015
24964
  index: VueTypes.string,
24016
- searchPlaceholder: VueTypes.string.def('Type here to search...')
24965
+ searchPlaceholder: VueTypes.string.def('Type here to search...'),
24966
+ endpoint: types.endpointConfig
24017
24967
  },
24018
24968
  created: function created() {
24019
24969
  if (!this.enableAppbase && this.$props.index) {
@@ -24536,6 +25486,7 @@
24536
25486
  name: 'ToggleButton',
24537
25487
  props: {
24538
25488
  componentId: types.stringRequired,
25489
+ customQuery: types.func,
24539
25490
  data: types.data,
24540
25491
  dataField: types.stringRequired,
24541
25492
  defaultValue: types.any,
@@ -24550,7 +25501,8 @@
24550
25501
  URLParams: VueTypes.bool,
24551
25502
  renderItem: types.func,
24552
25503
  index: VueTypes.string,
24553
- enableStrictSelection: VueTypes.bool
25504
+ enableStrictSelection: VueTypes.bool,
25505
+ endpoint: types.endpointConfig
24554
25506
  },
24555
25507
  data: function data() {
24556
25508
  this.__state = {
@@ -24880,7 +25832,8 @@
24880
25832
  URLParams: VueTypes.bool.def(false),
24881
25833
  distinctField: types.string,
24882
25834
  distinctFieldConfig: types.props,
24883
- index: VueTypes.string
25835
+ index: VueTypes.string,
25836
+ endpoint: types.endpointConfig
24884
25837
  },
24885
25838
  created: function created() {
24886
25839
  var _this = this;
@@ -25213,6 +26166,7 @@
25213
26166
  components: this.components,
25214
26167
  selectedValues: this.selectedValues,
25215
26168
  clearValues: this.clearValues,
26169
+ clearValue: this.clearValue,
25216
26170
  setValue: this.setValue,
25217
26171
  resetValuesToDefault: this.resetValuesToDefault
25218
26172
  });
@@ -25224,7 +26178,7 @@
25224
26178
  "class": filters(this.theme) + " " + (this.$props.className || '')
25225
26179
  }, [this.$props.title && hasValues && h(Title, {
25226
26180
  "class": getClassName$b(this.$props.innerClass, 'title') || ''
25227
- }, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues ? h(Button, {
26181
+ }, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? h(Button, {
25228
26182
  "class": getClassName$b(this.$props.innerClass, 'button') || '',
25229
26183
  "on": _extends({}, {
25230
26184
  click: this.clearValues,
@@ -25261,6 +26215,20 @@
25261
26215
 
25262
26216
  this.$emit('clear', resetToValues);
25263
26217
  },
26218
+ clearValue: function clearValue(componentId) {
26219
+ var resetToDefault = this.resetToDefault,
26220
+ resetToValues = this.resetToValues;
26221
+
26222
+ if (resetToDefault) {
26223
+ this.resetValuesToDefault(this.components.filter(function (component) {
26224
+ return component !== componentId;
26225
+ }));
26226
+ } else {
26227
+ this.setValue(componentId, (resetToValues == null ? void 0 : resetToValues[componentId]) || null);
26228
+ }
26229
+
26230
+ this.$emit('clear', resetToValues == null ? void 0 : resetToValues[componentId]);
26231
+ },
25264
26232
  renderValue: function renderValue(value, isArray) {
25265
26233
  var _this2 = this;
25266
26234
 
@@ -25284,39 +26252,41 @@
25284
26252
 
25285
26253
  return value;
25286
26254
  },
26255
+ renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
26256
+ var h = this.$createElement;
26257
+ return h(Button, {
26258
+ "class": getClassName$b(this.$props.innerClass, 'button') || '',
26259
+ "key": keyProp,
26260
+ "on": _extends({}, {
26261
+ click: handleRemove,
26262
+ keypress: function keypress(event) {
26263
+ return handleA11yAction$2(event, handleRemove);
26264
+ }
26265
+ }),
26266
+ "attrs": {
26267
+ "tabIndex": "0"
26268
+ }
26269
+ }, [h("span", [label]), h("span", ["\u2715"])]);
26270
+ },
25287
26271
  renderFilters: function renderFilters() {
25288
26272
  var _this3 = this;
25289
26273
 
25290
- var h = this.$createElement;
25291
26274
  var selectedValues = this.selectedValues;
25292
- return Object.keys(selectedValues).filter(function (id) {
26275
+ var filterComponents = Object.keys(selectedValues).filter(function (id) {
25293
26276
  return _this3.components.includes(id) && selectedValues[id].showFilter;
25294
- }).map(function (component, index) {
26277
+ });
26278
+ return filterComponents.map(function (component, index) {
25295
26279
  var _selectedValues$compo = selectedValues[component],
25296
26280
  label = _selectedValues$compo.label,
25297
26281
  value = _selectedValues$compo.value;
25298
- var isArray = Array.isArray(value);
26282
+ var isArray = Array.isArray(value); // default behaviour
25299
26283
 
25300
26284
  if (label && (isArray && value.length || !isArray && value)) {
25301
26285
  var valueToRender = _this3.renderValue(value, isArray);
25302
26286
 
25303
- return h(Button, {
25304
- "class": getClassName$b(_this3.$props.innerClass, 'button') || '',
25305
- "key": component + "-" + (index + 1),
25306
- "on": _extends({}, {
25307
- click: function click() {
25308
- return _this3.remove(component, value);
25309
- },
25310
- keypress: function keypress(event) {
25311
- return handleA11yAction$2(event, function () {
25312
- return _this3.remove(component, value);
25313
- });
25314
- }
25315
- }),
25316
- "attrs": {
25317
- "tabIndex": "0"
25318
- }
25319
- }, [h("span", [selectedValues[component].label, ": ", valueToRender]), h("span", ["\u2715"])]);
26287
+ return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
26288
+ return _this3.remove(component, value);
26289
+ }, selectedValues[component].label + ": " + decodeHtml(valueToRender));
25320
26290
  }
25321
26291
 
25322
26292
  return null;
@@ -25381,7 +26351,8 @@
25381
26351
  title: types.title,
25382
26352
  URLParams: VueTypes.bool.def(false),
25383
26353
  nestedField: types.string,
25384
- index: VueTypes.string
26354
+ index: VueTypes.string,
26355
+ endpoint: types.endpointConfig
25385
26356
  },
25386
26357
  created: function created() {
25387
26358
  if (!this.enableAppbase && this.$props.index) {
@@ -25467,7 +26438,7 @@
25467
26438
  props = this.$props;
25468
26439
  }
25469
26440
 
25470
- var currentValue = SingleRange.parseValue(value, props);
26441
+ var currentValue = typeof value === 'string' ? SingleRange.parseValue(value, props) : value;
25471
26442
 
25472
26443
  var performUpdate = function performUpdate() {
25473
26444
  _this2.currentValue = currentValue;
@@ -25610,7 +26581,8 @@
25610
26581
  title: types.title,
25611
26582
  URLParams: VueTypes.bool.def(false),
25612
26583
  nestedField: types.string,
25613
- index: VueTypes.string
26584
+ index: VueTypes.string,
26585
+ endpoint: types.endpointConfig
25614
26586
  },
25615
26587
  methods: {
25616
26588
  handleClick: function handleClick(e) {
@@ -26143,8 +27115,8 @@
26143
27115
  };
26144
27116
  var vueNoSsr_common = index$2;
26145
27117
 
26146
- var _templateObject$n;
26147
- 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"])));
27118
+ var _templateObject$o;
27119
+ var Slider = index$1('div')(_templateObject$o || (_templateObject$o = _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"])));
26148
27120
 
26149
27121
  /**
26150
27122
  * Caution: Please do not change this file without having a discussion with the Team.
@@ -26232,7 +27204,8 @@
26232
27204
  URLParams: VueTypes.bool.def(false),
26233
27205
  sliderOptions: VueTypes.object.def({}),
26234
27206
  nestedField: types.string,
26235
- index: VueTypes.string
27207
+ index: VueTypes.string,
27208
+ endpoint: types.endpointConfig
26236
27209
  },
26237
27210
  methods: {
26238
27211
  handleSliderChange: function handleSliderChange(values) {
@@ -26500,7 +27473,8 @@
26500
27473
  sliderOptions: VueTypes.object.def({}),
26501
27474
  nestedField: types.string,
26502
27475
  index: VueTypes.string,
26503
- value: types.range
27476
+ value: types.range,
27477
+ endpoint: types.endpointConfig
26504
27478
  },
26505
27479
  data: function data() {
26506
27480
  this.internalRangeComponent = this.$props.componentId + "__range__internal";
@@ -27051,13 +28025,32 @@
27051
28025
  if (this.isStateChanged(newVal, oldVal)) {
27052
28026
  this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
27053
28027
  }
28028
+ },
28029
+ setSearchState: function setSearchState(valuesMap) {
28030
+ if (valuesMap === void 0) {
28031
+ valuesMap = {};
28032
+ }
28033
+
28034
+ var components = this.components;
28035
+ var computedValuesMap = {};
28036
+ components.filter(function (component) {
28037
+ return !transform_11(component);
28038
+ }).forEach(function (component) {
28039
+ if (component in valuesMap) {
28040
+ computedValuesMap[component] = valuesMap[component];
28041
+ } else {
28042
+ computedValuesMap[component] = null;
28043
+ }
28044
+ });
28045
+ this.setValues(computedValuesMap);
27054
28046
  }
27055
28047
  },
27056
28048
  render: function render() {
27057
28049
  var searchState = this.searchState;
27058
28050
  var dom = this.$scopedSlots["default"];
27059
28051
  return dom ? dom({
27060
- searchState: searchState
28052
+ searchState: searchState,
28053
+ setSearchState: this.setSearchState
27061
28054
  }) : null;
27062
28055
  }
27063
28056
  };
@@ -27075,11 +28068,15 @@
27075
28068
  promotedResults: filterByComponentIds(state.promotedResults, props),
27076
28069
  customData: filterByComponentIds(state.customData, props),
27077
28070
  settings: filterByComponentIds(state.settings, props),
27078
- rawData: filterByComponentIds(state.rawData, props)
28071
+ rawData: filterByComponentIds(state.rawData, props),
28072
+ components: filterByComponentIds(state.components, props)
27079
28073
  };
27080
28074
  };
27081
28075
 
27082
- var StateProviderConnected = connect(mapStateToProps$g, {})(StateProvider);
28076
+ var mapDispatchtoProps$d = {
28077
+ setValues: value_6
28078
+ };
28079
+ var StateProviderConnected = connect(mapStateToProps$g, mapDispatchtoProps$d)(StateProvider);
27083
28080
 
27084
28081
  StateProvider.install = function (Vue) {
27085
28082
  Vue.component(StateProvider.name, StateProviderConnected);
@@ -27132,8 +28129,8 @@
27132
28129
  if (component.defaultQuery) {
27133
28130
  var defaultQuery = component.defaultQuery(currentValue, component);
27134
28131
  return _extends({
27135
- query: helper_14(defaultQuery)
27136
- }, helper_15(defaultQuery));
28132
+ query: helper_21(defaultQuery)
28133
+ }, helper_22(defaultQuery));
27137
28134
  }
27138
28135
 
27139
28136
  return component.source.defaultQuery ? {
@@ -27149,8 +28146,8 @@
27149
28146
  if (component.customQuery) {
27150
28147
  var customQuery = component.customQuery(currentValue, component);
27151
28148
  return _extends({
27152
- query: helper_14(customQuery)
27153
- }, helper_15(customQuery));
28149
+ query: helper_21(customQuery)
28150
+ }, helper_22(customQuery));
27154
28151
  }
27155
28152
 
27156
28153
  return component.source.defaultQuery ? {
@@ -27167,20 +28164,51 @@
27167
28164
  'X-Search-Client': X_SEARCH_CLIENT$1
27168
28165
  }, enableTelemetry === false && {
27169
28166
  'X-Enable-Telemetry': false
27170
- }), settings.headers);
28167
+ }), settings.headers, settings.enableAppbase && settings.endpoint && settings.endpoint.headers ? settings.endpoint.headers : {});
28168
+
28169
+ var url = settings.url && settings.url.trim() !== '' ? settings.url : 'https://scalr.api.appbase.io';
28170
+ var transformRequest = settings.transformRequest || null;
28171
+
28172
+ if (settings.enableAppbase && settings.endpoint) {
28173
+ if (settings.endpoint.url) {
28174
+ // eslint-disable-next-line prefer-destructuring
28175
+ url = settings.endpoint.url;
28176
+ }
28177
+
28178
+ transformRequest = function transformRequest(request) {
28179
+ var modifiedRequest = helper_1(request, settings.endpoint);
28180
+
28181
+ if (settings.transformRequest) {
28182
+ return settings.transformRequest(modifiedRequest);
28183
+ }
28184
+
28185
+ return modifiedRequest;
28186
+ };
28187
+ }
27171
28188
 
27172
28189
  var config = {
27173
- url: settings.url && settings.url.trim() !== '' ? settings.url : 'https://scalr.api.appbase.io',
28190
+ url: url,
27174
28191
  app: settings.app,
27175
28192
  credentials: credentials,
27176
- transformRequest: settings.transformRequest || null,
28193
+ transformRequest: transformRequest,
27177
28194
  type: settings.type ? settings.type : '*',
27178
28195
  transformResponse: settings.transformResponse || null,
27179
28196
  graphQLUrl: settings.graphQLUrl || '',
27180
28197
  headers: headers,
27181
- analyticsConfig: settings.appbaseConfig || null
28198
+ analyticsConfig: settings.appbaseConfig || null,
28199
+ enableAppbase: settings.enableAppbase,
28200
+ endpoint: settings.endpoint
27182
28201
  };
27183
28202
  var appbaseRef = appbasejs(config);
28203
+
28204
+ if (config.transformRequest) {
28205
+ appbaseRef.transformRequest = config.transformRequest;
28206
+ }
28207
+
28208
+ if (config.transformResponse) {
28209
+ appbaseRef.transformResponse = config.transformResponse;
28210
+ }
28211
+
27184
28212
  var components = [];
27185
28213
  var selectedValues = {};
27186
28214
  var internalValues = {};
@@ -27314,7 +28342,7 @@
27314
28342
  var react = component.react;
27315
28343
 
27316
28344
  if (isInternalComponentPresent || isResultComponent) {
27317
- react = helper_30(react, internalComponent);
28345
+ react = helper_37(react, internalComponent);
27318
28346
  }
27319
28347
 
27320
28348
  dependencyTree = dependencyTreeReducer(dependencyTree, {
@@ -27377,7 +28405,7 @@
27377
28405
 
27378
28406
  componentCollection.forEach(function (component) {
27379
28407
  // eslint-disable-next-line
27380
- var _buildQuery = helper_29(component.componentId, dependencyTree, queryList, queryOptions),
28408
+ var _buildQuery = helper_36(component.componentId, dependencyTree, queryList, queryOptions),
27381
28409
  queryObj = _buildQuery.queryObj,
27382
28410
  options = _buildQuery.options;
27383
28411
 
@@ -27404,7 +28432,7 @@
27404
28432
  queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
27405
28433
 
27406
28434
  if (settings.enableAppbase) {
27407
- var query = transform_4(component.componentId, transform_2(state, component.componentId, queryOptions && queryOptions[component.componentId] ? {
28435
+ var query = transform_4(component.componentId, transform_2(state, component.componentId, queryOptions && Object.keys(queryOptions[component.componentId]).length ? {
27408
28436
  from: queryOptions[component.componentId].from
27409
28437
  } : null));
27410
28438
 
@@ -27445,7 +28473,7 @@
27445
28473
 
27446
28474
  aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
27447
28475
  compositeAggregations = compositeAggsReducer(compositeAggregations, {
27448
- type: constants_9,
28476
+ type: constants_10,
27449
28477
  aggregations: response.aggregations,
27450
28478
  append: false
27451
28479
  });
@@ -27509,9 +28537,10 @@
27509
28537
  }
27510
28538
 
27511
28539
  timestamp[component] = res._timestamp;
28540
+ var hitsObj = response.hits ? response.hits : response[component].hits;
27512
28541
  hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
27513
- hits: response.hits.hits,
27514
- total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
28542
+ hits: hitsObj.hits,
28543
+ total: typeof hitsObj.total === 'object' ? hitsObj.total.value : hitsObj.total,
27515
28544
  time: response.took
27516
28545
  }, _extends7));
27517
28546
  responseResolve();
@@ -27587,16 +28616,16 @@
27587
28616
  });
27588
28617
  }
27589
28618
 
27590
- var version = "1.29.0-preview.1";
28619
+ var version = "1.31.0";
27591
28620
 
27592
- var _templateObject$o, _templateObject2$a;
28621
+ var _templateObject$p, _templateObject2$b;
27593
28622
 
27594
28623
  var alert = function alert(_ref) {
27595
28624
  var theme = _ref.theme;
27596
- return css(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
28625
+ return css(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
27597
28626
  };
27598
28627
 
27599
- var Content = index$1('div')(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
28628
+ var Content = index$1('div')(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
27600
28629
  return props.alert && alert;
27601
28630
  });
27602
28631
 
@@ -27657,7 +28686,8 @@
27657
28686
  title: types.title,
27658
28687
  URLParams: VueTypes.bool.def(false),
27659
28688
  sliderOptions: VueTypes.object.def({}),
27660
- nestedField: types.string
28689
+ nestedField: types.string,
28690
+ endpoint: types.endpointConfig
27661
28691
  },
27662
28692
  methods: {
27663
28693
  shouldUpdate: function shouldUpdate(value) {