@appbaseio/reactivesearch-vue 1.30.0 → 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.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +553 -195
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{ComponentWrapper-5cb08414.js → ComponentWrapper-6909bc2a.js} +1 -1
- package/dist/cjs/{DataSearch-e550096e.js → DataSearch-a8fabd77.js} +5 -4
- package/dist/cjs/DataSearch.js +4 -4
- package/dist/cjs/{DropDown-fc59f1ee.js → DropDown-aa358fff.js} +2 -2
- package/dist/cjs/DynamicRangeSlider.js +4 -3
- package/dist/cjs/MultiDropdownList.js +6 -5
- package/dist/cjs/MultiList.js +5 -4
- package/dist/cjs/MultiRange.js +5 -4
- package/dist/cjs/RangeInput.js +5 -4
- package/dist/cjs/RangeSlider.js +5 -4
- package/dist/cjs/ReactiveBase.js +36 -12
- package/dist/cjs/ReactiveComponent.js +5 -4
- package/dist/cjs/ReactiveList.js +15 -9
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +5 -5
- package/dist/cjs/SingleDropdownList.js +6 -5
- package/dist/cjs/SingleList.js +5 -4
- package/dist/cjs/SingleRange.js +5 -4
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/ToggleButton.js +5 -4
- package/dist/cjs/{index-2cd3650b.js → index-2e0ea8d8.js} +12 -0
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/initReactivesearch.js +38 -6
- package/dist/cjs/{install-250a14f1.js → install-27314778.js} +12 -10
- package/dist/cjs/install.js +6 -6
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-3970ff42.js} +6 -0
- package/dist/es/{ComponentWrapper-dc92772a.js → ComponentWrapper-ca0354ea.js} +1 -1
- package/dist/es/{DataSearch-8e5d0972.js → DataSearch-da9347f7.js} +5 -4
- package/dist/es/DataSearch.js +4 -4
- package/dist/es/{DropDown-565fad6f.js → DropDown-604374d2.js} +2 -2
- package/dist/es/DynamicRangeSlider.js +4 -3
- package/dist/es/MultiDropdownList.js +6 -5
- package/dist/es/MultiList.js +5 -4
- package/dist/es/MultiRange.js +5 -4
- package/dist/es/RangeInput.js +5 -4
- package/dist/es/RangeSlider.js +5 -4
- package/dist/es/ReactiveBase.js +37 -13
- package/dist/es/ReactiveComponent.js +5 -4
- package/dist/es/ReactiveList.js +15 -9
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +3 -3
- package/dist/es/SingleDropdownList.js +6 -5
- package/dist/es/SingleList.js +5 -4
- package/dist/es/SingleRange.js +5 -4
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/ToggleButton.js +5 -4
- package/dist/es/{index-5371a13f.js → index-4715798c.js} +12 -1
- package/dist/es/index.js +7 -7
- package/dist/es/initReactivesearch.js +39 -7
- package/dist/es/{install-9faa87f1.js → install-5d9cb7ed.js} +10 -8
- package/dist/es/install.js +6 -6
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-687b2304.js → vueTypes-c0d8b875.js} +6 -0
- package/package.json +3 -3
|
@@ -154,29 +154,29 @@
|
|
|
154
154
|
return typeOfVal;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
* The only way to change the data in the store is to call `dispatch()` on it.
|
|
157
|
+
* @deprecated
|
|
159
158
|
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
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
|
-
*
|
|
165
|
-
*
|
|
162
|
+
* Redux Toolkit is our recommended approach for writing Redux logic today,
|
|
163
|
+
* including store setup, reducers, data fetching, and more.
|
|
166
164
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
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
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
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,
|
|
@@ -798,6 +831,7 @@
|
|
|
798
831
|
var SET_TIMESTAMP = exports.SET_TIMESTAMP = 'SET_TIMESTAMP';
|
|
799
832
|
var SET_HEADERS = exports.SET_HEADERS = 'SET_HEADERS';
|
|
800
833
|
var SET_MAP_DATA = exports.SET_MAP_DATA = 'SET_MAP_DATA';
|
|
834
|
+
var SET_MAP_RESULTS = exports.SET_MAP_RESULTS = 'SET_MAP_RESULTS';
|
|
801
835
|
var SET_QUERY_LISTENER = exports.SET_QUERY_LISTENER = 'SET_QUERY_LISTENER';
|
|
802
836
|
var STORE_KEY = exports.STORE_KEY = '__REACTIVESEARCH__';
|
|
803
837
|
var SET_SEARCH_ID = exports.SET_SEARCH_ID = 'SET_SEARCH_ID';
|
|
@@ -851,34 +885,35 @@
|
|
|
851
885
|
var constants_21 = constants.SET_TIMESTAMP;
|
|
852
886
|
var constants_22 = constants.SET_HEADERS;
|
|
853
887
|
var constants_23 = constants.SET_MAP_DATA;
|
|
854
|
-
var constants_24 = constants.
|
|
855
|
-
var constants_25 = constants.
|
|
856
|
-
var constants_26 = constants.
|
|
857
|
-
var constants_27 = constants.
|
|
858
|
-
var constants_28 = constants.
|
|
859
|
-
var constants_29 = constants.
|
|
860
|
-
var constants_30 = constants.
|
|
861
|
-
var constants_31 = constants.
|
|
862
|
-
var constants_32 = constants.
|
|
863
|
-
var constants_33 = constants.
|
|
864
|
-
var constants_34 = constants.
|
|
865
|
-
var constants_35 = constants.
|
|
866
|
-
var constants_36 = constants.
|
|
867
|
-
var constants_37 = constants.
|
|
868
|
-
var constants_38 = constants.
|
|
869
|
-
var constants_39 = constants.
|
|
870
|
-
var constants_40 = constants.
|
|
871
|
-
var constants_41 = constants.
|
|
872
|
-
var constants_42 = constants.
|
|
873
|
-
var constants_43 = constants.
|
|
874
|
-
var constants_44 = constants.
|
|
875
|
-
var constants_45 = constants.
|
|
876
|
-
var constants_46 = constants.
|
|
877
|
-
var constants_47 = constants.
|
|
878
|
-
var constants_48 = constants.
|
|
879
|
-
var constants_49 = constants.
|
|
880
|
-
var constants_50 = constants.
|
|
881
|
-
var constants_51 = constants.
|
|
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;
|
|
882
917
|
|
|
883
918
|
var componentsReducer_1 = createCommonjsModule(function (module, exports) {
|
|
884
919
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1249,6 +1284,7 @@
|
|
|
1249
1284
|
multiDataList: 'MULTIDATALIST',
|
|
1250
1285
|
multiDropdownList: 'MULTIDROPDOWNLIST',
|
|
1251
1286
|
singleDropdownRange: 'SINGLEDROPDOWNRANGE',
|
|
1287
|
+
treeList: 'TREELIST',
|
|
1252
1288
|
numberBox: 'NUMBERBOX',
|
|
1253
1289
|
tagCloud: 'TAGCLOUD',
|
|
1254
1290
|
toggleButton: 'TOGGLEBUTTON',
|
|
@@ -1274,7 +1310,7 @@
|
|
|
1274
1310
|
geo: 'geo',
|
|
1275
1311
|
suggestion: 'suggestion'
|
|
1276
1312
|
};
|
|
1277
|
-
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'];
|
|
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'];
|
|
1278
1314
|
var CLEAR_ALL = exports.CLEAR_ALL = {
|
|
1279
1315
|
NEVER: 'never',
|
|
1280
1316
|
ALWAYS: 'always',
|
|
@@ -1336,7 +1372,7 @@
|
|
|
1336
1372
|
};
|
|
1337
1373
|
}();
|
|
1338
1374
|
|
|
1339
|
-
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];
|
|
1340
1376
|
var rangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.dynamicRangeSlider, constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter];
|
|
1341
1377
|
var rangeObjectComponents = [constants$1.componentTypes.singleRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
|
|
1342
1378
|
|
|
@@ -2182,6 +2218,21 @@
|
|
|
2182
2218
|
Object.defineProperty(exports, "__esModule", {
|
|
2183
2219
|
value: true
|
|
2184
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
|
+
|
|
2185
2236
|
exports["default"] = mapDataReducer;
|
|
2186
2237
|
|
|
2187
2238
|
function _objectWithoutProperties(obj, keys) {
|
|
@@ -2216,10 +2267,12 @@
|
|
|
2216
2267
|
var action = arguments[1];
|
|
2217
2268
|
|
|
2218
2269
|
if (action.type === constants.SET_MAP_DATA) {
|
|
2219
|
-
return _defineProperty({}, action.componentId, {
|
|
2270
|
+
return _extends({}, state, _defineProperty({}, action.componentId, {
|
|
2220
2271
|
query: action.query,
|
|
2221
2272
|
persistMapQuery: action.persistMapQuery
|
|
2222
|
-
});
|
|
2273
|
+
}));
|
|
2274
|
+
} else if (action.type === constants.SET_MAP_RESULTS) {
|
|
2275
|
+
return _extends({}, state, _defineProperty({}, action.componentId, _extends({}, state[action.componentId], action.payload)));
|
|
2223
2276
|
} else if (action.type === constants.REMOVE_COMPONENT) {
|
|
2224
2277
|
var del = state[action.component],
|
|
2225
2278
|
obj = _objectWithoutProperties(state, [action.component]);
|
|
@@ -5031,7 +5084,7 @@
|
|
|
5031
5084
|
Object.defineProperty(exports, "__esModule", {
|
|
5032
5085
|
value: true
|
|
5033
5086
|
});
|
|
5034
|
-
exports.flatten = exports.saveDataAsFile = 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;
|
|
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;
|
|
5035
5088
|
|
|
5036
5089
|
var _extends = Object.assign || function (target) {
|
|
5037
5090
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -5061,6 +5114,7 @@
|
|
|
5061
5114
|
exports.normalizeDataField = normalizeDataField;
|
|
5062
5115
|
exports.handleOnSuggestions = handleOnSuggestions;
|
|
5063
5116
|
exports.isValidDateRangeQueryFormat = isValidDateRangeQueryFormat;
|
|
5117
|
+
exports.setDeep = setDeep;
|
|
5064
5118
|
|
|
5065
5119
|
var _dateFormats2 = _interopRequireDefault(dateFormats_1);
|
|
5066
5120
|
|
|
@@ -5968,6 +6022,84 @@
|
|
|
5968
6022
|
return isFunction(children) || isFunction(render);
|
|
5969
6023
|
};
|
|
5970
6024
|
|
|
6025
|
+
var recLookup = exports.recLookup = function recLookup(obj, path) {
|
|
6026
|
+
try {
|
|
6027
|
+
var parts = path.split('.');
|
|
6028
|
+
|
|
6029
|
+
if (parts.length === 1) {
|
|
6030
|
+
return obj[parts[0]];
|
|
6031
|
+
}
|
|
6032
|
+
|
|
6033
|
+
return recLookup(obj[parts[0]], parts.slice(1).join('.'));
|
|
6034
|
+
} catch (e) {
|
|
6035
|
+
return false;
|
|
6036
|
+
}
|
|
6037
|
+
};
|
|
6038
|
+
|
|
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
|
+
}
|
|
6046
|
+
|
|
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
|
+
}
|
|
6074
|
+
});
|
|
6075
|
+
}
|
|
6076
|
+
|
|
6077
|
+
return newState;
|
|
6078
|
+
};
|
|
6079
|
+
|
|
6080
|
+
var transformTreeListLocalStateIntoQueryComptaibleFormat = exports.transformTreeListLocalStateIntoQueryComptaibleFormat = function transformTreeListLocalStateIntoQueryComptaibleFormat(obj) {
|
|
6081
|
+
var currentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
6082
|
+
var result = [];
|
|
6083
|
+
|
|
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
|
+
}
|
|
6090
|
+
|
|
6091
|
+
if (obj[key] === true) {
|
|
6092
|
+
result.push(currentPath ? currentPath + ' > ' + key : key);
|
|
6093
|
+
}
|
|
6094
|
+
});
|
|
6095
|
+
} else if (currentPath) {
|
|
6096
|
+
result.push(currentPath);
|
|
6097
|
+
}
|
|
6098
|
+
}
|
|
6099
|
+
|
|
6100
|
+
return result;
|
|
6101
|
+
};
|
|
6102
|
+
|
|
5971
6103
|
var saveDataAsFile = exports.saveDataAsFile = function saveDataAsFile() {
|
|
5972
6104
|
var filename = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'exportedData';
|
|
5973
6105
|
var data = arguments[1];
|
|
@@ -6021,49 +6153,75 @@
|
|
|
6021
6153
|
recurse(data);
|
|
6022
6154
|
return result;
|
|
6023
6155
|
};
|
|
6156
|
+
|
|
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']);
|
|
6163
|
+
|
|
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;
|
|
6024
6177
|
});
|
|
6025
6178
|
unwrapExports(helper);
|
|
6026
|
-
var helper_1 = helper.
|
|
6027
|
-
var helper_2 = helper.
|
|
6028
|
-
var helper_3 = helper.
|
|
6029
|
-
var helper_4 = helper.
|
|
6030
|
-
var helper_5 = helper.
|
|
6031
|
-
var helper_6 = helper.
|
|
6032
|
-
var helper_7 = helper.
|
|
6033
|
-
var helper_8 = helper.
|
|
6034
|
-
var helper_9 = helper.
|
|
6035
|
-
var helper_10 = helper.
|
|
6036
|
-
var helper_11 = helper.
|
|
6037
|
-
var helper_12 = helper.
|
|
6038
|
-
var helper_13 = helper.
|
|
6039
|
-
var helper_14 = helper.
|
|
6040
|
-
var helper_15 = helper.
|
|
6041
|
-
var helper_16 = helper.
|
|
6042
|
-
var helper_17 = helper.
|
|
6043
|
-
var helper_18 = helper.
|
|
6044
|
-
var helper_19 = helper.
|
|
6045
|
-
var helper_20 = helper.
|
|
6046
|
-
var helper_21 = helper.
|
|
6047
|
-
var helper_22 = helper.
|
|
6048
|
-
var helper_23 = helper.
|
|
6049
|
-
var helper_24 = helper.
|
|
6050
|
-
var helper_25 = helper.
|
|
6051
|
-
var helper_26 = helper.
|
|
6052
|
-
var helper_27 = helper.
|
|
6053
|
-
var helper_28 = helper.
|
|
6054
|
-
var helper_29 = helper.
|
|
6055
|
-
var helper_30 = helper.
|
|
6056
|
-
var helper_31 = helper.
|
|
6057
|
-
var helper_32 = helper.
|
|
6058
|
-
var helper_33 = helper.
|
|
6059
|
-
var helper_34 = helper.
|
|
6060
|
-
var helper_35 = helper.
|
|
6061
|
-
var helper_36 = helper.
|
|
6062
|
-
var helper_37 = helper.
|
|
6063
|
-
var helper_38 = helper.
|
|
6064
|
-
var helper_39 = helper.
|
|
6065
|
-
var helper_40 = helper.
|
|
6066
|
-
var helper_41 = 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;
|
|
6067
6225
|
|
|
6068
6226
|
var hits = createCommonjsModule(function (module, exports) {
|
|
6069
6227
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -7271,7 +7429,7 @@
|
|
|
7271
7429
|
return obj;
|
|
7272
7430
|
}
|
|
7273
7431
|
|
|
7274
|
-
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.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);
|
|
7275
7433
|
var multiRangeComponents = [constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
|
|
7276
7434
|
var dateRangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.datePicker];
|
|
7277
7435
|
var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch, constants$1.componentTypes.searchBox];
|
|
@@ -7312,7 +7470,7 @@
|
|
|
7312
7470
|
|
|
7313
7471
|
var isComponentUsesLabelAsValue = exports.isComponentUsesLabelAsValue = function isComponentUsesLabelAsValue() {
|
|
7314
7472
|
var componentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
7315
|
-
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;
|
|
7316
7474
|
};
|
|
7317
7475
|
|
|
7318
7476
|
var hasPaginationSupport = exports.hasPaginationSupport = function hasPaginationSupport() {
|
|
@@ -7330,6 +7488,12 @@
|
|
|
7330
7488
|
return null;
|
|
7331
7489
|
}
|
|
7332
7490
|
|
|
7491
|
+
var endpoint = void 0;
|
|
7492
|
+
|
|
7493
|
+
if (props.endpoint instanceof Object) {
|
|
7494
|
+
endpoint = props.endpoint;
|
|
7495
|
+
}
|
|
7496
|
+
|
|
7333
7497
|
return _extends({
|
|
7334
7498
|
id: componentId,
|
|
7335
7499
|
type: queryType,
|
|
@@ -7369,7 +7533,7 @@
|
|
|
7369
7533
|
distinctField: props.distinctField,
|
|
7370
7534
|
distinctFieldConfig: props.distinctFieldConfig,
|
|
7371
7535
|
index: props.index
|
|
7372
|
-
}, queryType === constants$1.queryTypes.suggestion ? {
|
|
7536
|
+
}, queryType === constants$1.queryTypes.suggestion ? _extends({
|
|
7373
7537
|
enablePopularSuggestions: props.enablePopularSuggestions,
|
|
7374
7538
|
enableRecentSuggestions: props.enableRecentSuggestions,
|
|
7375
7539
|
popularSuggestionsConfig: props.popularSuggestionsConfig,
|
|
@@ -7381,8 +7545,11 @@
|
|
|
7381
7545
|
indexSuggestionsConfig: props.indexSuggestionsConfig,
|
|
7382
7546
|
enableFeaturedSuggestions: props.enableFeaturedSuggestions,
|
|
7383
7547
|
enableIndexSuggestions: props.enableIndexSuggestions
|
|
7384
|
-
}
|
|
7385
|
-
|
|
7548
|
+
}, props.searchboxId ? {
|
|
7549
|
+
searchboxId: props.searchboxId
|
|
7550
|
+
} : {}) : {}, {
|
|
7551
|
+
calendarInterval: props.calendarInterval,
|
|
7552
|
+
endpoint: endpoint
|
|
7386
7553
|
});
|
|
7387
7554
|
}
|
|
7388
7555
|
|
|
@@ -7629,7 +7796,18 @@
|
|
|
7629
7796
|
}
|
|
7630
7797
|
}
|
|
7631
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
|
+
|
|
7632
7809
|
return _extends({}, componentProps, {
|
|
7810
|
+
endpoint: endpoint,
|
|
7633
7811
|
calendarInterval: calendarInterval,
|
|
7634
7812
|
dataField: dataField,
|
|
7635
7813
|
queryFormat: queryFormat,
|
|
@@ -7838,14 +8016,16 @@
|
|
|
7838
8016
|
appendToAggs = _ref2$appendToAggs === undefined ? false : _ref2$appendToAggs,
|
|
7839
8017
|
_ref2$isSuggestionsQu = _ref2.isSuggestionsQuery,
|
|
7840
8018
|
isSuggestionsQuery = _ref2$isSuggestionsQu === undefined ? false : _ref2$isSuggestionsQu,
|
|
7841
|
-
query = _ref2.query
|
|
8019
|
+
query = _ref2.query,
|
|
8020
|
+
queryId = _ref2.queryId;
|
|
7842
8021
|
|
|
7843
8022
|
var getState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
|
7844
8023
|
var dispatch = arguments[2];
|
|
7845
8024
|
|
|
7846
8025
|
var _getState3 = getState(),
|
|
7847
8026
|
config = _getState3.config,
|
|
7848
|
-
internalValues = _getState3.internalValues
|
|
8027
|
+
internalValues = _getState3.internalValues,
|
|
8028
|
+
lastUsedAppbaseQuery = _getState3.lastUsedAppbaseQuery;
|
|
7849
8029
|
|
|
7850
8030
|
var searchId = res._headers ? res._headers.get('X-Search-Id') : null;
|
|
7851
8031
|
|
|
@@ -7859,6 +8039,10 @@
|
|
|
7859
8039
|
|
|
7860
8040
|
orderOfQueries.forEach(function (component) {
|
|
7861
8041
|
if (isComponentActive(getState, component)) {
|
|
8042
|
+
if (lastUsedAppbaseQuery[component] && lastUsedAppbaseQuery[component].queryId && queryId && lastUsedAppbaseQuery[component].queryId !== queryId) {
|
|
8043
|
+
return;
|
|
8044
|
+
}
|
|
8045
|
+
|
|
7862
8046
|
if (res.settings) {
|
|
7863
8047
|
dispatch((0, misc.setAppliedSettings)(res.settings, component));
|
|
7864
8048
|
}
|
|
@@ -8205,7 +8389,7 @@
|
|
|
8205
8389
|
valueToSet = null;
|
|
8206
8390
|
} else if ([constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.dateRange].includes(componentProps[component].componentType)) {
|
|
8207
8391
|
valueToSet = typeof componentProps[component].defaultValue === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null;
|
|
8208
|
-
} 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)) {
|
|
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)) {
|
|
8209
8393
|
valueToSet = componentProps[component].defaultValue;
|
|
8210
8394
|
} else if ([constants$1.componentTypes.categorySearch].includes(componentProps[component].componentType)) {
|
|
8211
8395
|
valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : '';
|
|
@@ -8283,6 +8467,7 @@
|
|
|
8283
8467
|
});
|
|
8284
8468
|
exports.updateMapData = updateMapData;
|
|
8285
8469
|
exports.setMapData = setMapData;
|
|
8470
|
+
exports.setMapResults = setMapResults;
|
|
8286
8471
|
|
|
8287
8472
|
function updateMapData(componentId, query, persistMapQuery) {
|
|
8288
8473
|
return {
|
|
@@ -8295,6 +8480,7 @@
|
|
|
8295
8480
|
|
|
8296
8481
|
function setMapData(componentId, query$1, persistMapQuery, forceExecute) {
|
|
8297
8482
|
var meta = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
8483
|
+
var queryId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
|
|
8298
8484
|
return function (dispatch) {
|
|
8299
8485
|
dispatch(updateMapData(componentId, query$1, persistMapQuery));
|
|
8300
8486
|
dispatch((0, value.setInternalValue)((0, transform.getInternalComponentID)(componentId), undefined, undefined, undefined, meta));
|
|
@@ -8302,7 +8488,22 @@
|
|
|
8302
8488
|
if (forceExecute) {
|
|
8303
8489
|
var executeWatchList = false;
|
|
8304
8490
|
var mustExecuteMapQuery = true;
|
|
8305
|
-
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
|
|
8306
8507
|
}
|
|
8307
8508
|
};
|
|
8308
8509
|
}
|
|
@@ -8310,6 +8511,7 @@
|
|
|
8310
8511
|
unwrapExports(maps);
|
|
8311
8512
|
var maps_1 = maps.updateMapData;
|
|
8312
8513
|
var maps_2 = maps.setMapData;
|
|
8514
|
+
var maps_3 = maps.setMapResults;
|
|
8313
8515
|
|
|
8314
8516
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
|
8315
8517
|
var global = typeof self !== 'undefined' ? self : commonjsGlobal;
|
|
@@ -9178,6 +9380,7 @@
|
|
|
9178
9380
|
|
|
9179
9381
|
function appbaseSearch() {
|
|
9180
9382
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
9383
|
+
queryId = _ref.queryId,
|
|
9181
9384
|
query = _ref.query,
|
|
9182
9385
|
orderOfQueries = _ref.orderOfQueries,
|
|
9183
9386
|
_ref$appendToHits = _ref.appendToHits,
|
|
@@ -9234,12 +9437,14 @@
|
|
|
9234
9437
|
orderOfQueries: orderOfQueries,
|
|
9235
9438
|
appendToHits: appendToHits,
|
|
9236
9439
|
appendToAggs: appendToAggs,
|
|
9237
|
-
query: query
|
|
9440
|
+
query: query,
|
|
9441
|
+
queryId: queryId
|
|
9238
9442
|
}, getState, dispatch);
|
|
9239
9443
|
})["catch"](function (err) {
|
|
9240
9444
|
(0, utils.handleError)({
|
|
9241
9445
|
orderOfQueries: orderOfQueries,
|
|
9242
|
-
error: err
|
|
9446
|
+
error: err,
|
|
9447
|
+
queryId: queryId
|
|
9243
9448
|
}, getState, dispatch);
|
|
9244
9449
|
});
|
|
9245
9450
|
};
|
|
@@ -9253,6 +9458,7 @@
|
|
|
9253
9458
|
var mustExecuteMapQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
9254
9459
|
var componentType = arguments[3];
|
|
9255
9460
|
var metaOptions = arguments[4];
|
|
9461
|
+
var requestId = arguments[5];
|
|
9256
9462
|
return function (dispatch, getState) {
|
|
9257
9463
|
var _getState4 = getState(),
|
|
9258
9464
|
queryLog = _getState4.queryLog,
|
|
@@ -9268,6 +9474,7 @@
|
|
|
9268
9474
|
|
|
9269
9475
|
var lockTime = config.initialQueriesSyncTime;
|
|
9270
9476
|
var initialTimestamp = config.initialTimestamp;
|
|
9477
|
+
var queryId = requestId || new Date().getTime();
|
|
9271
9478
|
|
|
9272
9479
|
if (config.queryLockConfig instanceof Object) {
|
|
9273
9480
|
lockTime = config.queryLockConfig.lockTime;
|
|
@@ -9314,9 +9521,16 @@
|
|
|
9314
9521
|
|
|
9315
9522
|
if (mustExecuteMapQuery || !(0, helper.compareQueries)(currentQuery, oldQuery, false)) {
|
|
9316
9523
|
orderOfQueries = [].concat(_toConsumableArray(orderOfQueries), [component]);
|
|
9317
|
-
dispatch((0, misc.logQuery)(component, queryToLog));
|
|
9318
9524
|
var isMapComponent = Object.keys(mapData).includes(component);
|
|
9319
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
|
+
|
|
9320
9534
|
if (isMapComponent && mapData[component].query) {
|
|
9321
9535
|
var existingQuery = currentQuery.query;
|
|
9322
9536
|
currentQuery.query = {
|
|
@@ -9463,6 +9677,7 @@
|
|
|
9463
9677
|
});
|
|
9464
9678
|
} else {
|
|
9465
9679
|
dispatch(appbaseSearch({
|
|
9680
|
+
queryId: queryId,
|
|
9466
9681
|
query: finalQuery,
|
|
9467
9682
|
orderOfQueries: orderOfQueries,
|
|
9468
9683
|
isSuggestionsQuery: isSuggestionsQuery,
|
|
@@ -9626,6 +9841,11 @@
|
|
|
9626
9841
|
|
|
9627
9842
|
return appbaseRef.reactiveSearchv3(query).then(function (res) {
|
|
9628
9843
|
var newDataChunk = res[componentId].hits.hits;
|
|
9844
|
+
|
|
9845
|
+
if (!Array.isArray(newDataChunk) || newDataChunk.length === 0) {
|
|
9846
|
+
return data;
|
|
9847
|
+
}
|
|
9848
|
+
|
|
9629
9849
|
return dispatch(loadDataToExport(componentId, newDataChunk[newDataChunk.length - 1]._id, res[componentId].hits.total.value, [].concat(_toConsumableArray(data), _toConsumableArray(newDataChunk))));
|
|
9630
9850
|
})["catch"](function (err) {
|
|
9631
9851
|
console.error('Error fetching data to export! ', err);
|
|
@@ -12543,7 +12763,7 @@
|
|
|
12543
12763
|
};
|
|
12544
12764
|
|
|
12545
12765
|
function _extends$1() {
|
|
12546
|
-
_extends$1 = Object.assign
|
|
12766
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
12547
12767
|
for (var i = 1; i < arguments.length; i++) {
|
|
12548
12768
|
var source = arguments[i];
|
|
12549
12769
|
|
|
@@ -12556,7 +12776,6 @@
|
|
|
12556
12776
|
|
|
12557
12777
|
return target;
|
|
12558
12778
|
};
|
|
12559
|
-
|
|
12560
12779
|
return _extends$1.apply(this, arguments);
|
|
12561
12780
|
}
|
|
12562
12781
|
|
|
@@ -13491,6 +13710,12 @@
|
|
|
13491
13710
|
mongodb: VueTypes.shape({
|
|
13492
13711
|
db: VueTypes.string,
|
|
13493
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
|
|
13494
13719
|
})
|
|
13495
13720
|
};
|
|
13496
13721
|
|
|
@@ -13548,6 +13773,7 @@
|
|
|
13548
13773
|
showEndPage = props.showEndPage;
|
|
13549
13774
|
var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
|
|
13550
13775
|
var paginationButtons = [];
|
|
13776
|
+
var endPage = start;
|
|
13551
13777
|
|
|
13552
13778
|
if (start <= totalPages) {
|
|
13553
13779
|
var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
|
|
@@ -13585,6 +13811,10 @@
|
|
|
13585
13811
|
|
|
13586
13812
|
if (i <= totalPages + 1) {
|
|
13587
13813
|
paginationButtons.push(pageBtn);
|
|
13814
|
+
|
|
13815
|
+
if (i === Math.min(totalPages + 1, totalPagesToShow) - 1) {
|
|
13816
|
+
endPage = i;
|
|
13817
|
+
}
|
|
13588
13818
|
}
|
|
13589
13819
|
};
|
|
13590
13820
|
|
|
@@ -13593,7 +13823,7 @@
|
|
|
13593
13823
|
}
|
|
13594
13824
|
}
|
|
13595
13825
|
|
|
13596
|
-
return paginationButtons;
|
|
13826
|
+
return [paginationButtons, start, endPage];
|
|
13597
13827
|
};
|
|
13598
13828
|
|
|
13599
13829
|
var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
|
|
@@ -13601,10 +13831,10 @@
|
|
|
13601
13831
|
currentPage = props.currentPage,
|
|
13602
13832
|
totalPages = props.totalPages,
|
|
13603
13833
|
pages = props.pages;
|
|
13604
|
-
if (!showEndPage) return buildPaginationDOM('start');
|
|
13834
|
+
if (!showEndPage) return buildPaginationDOM('start')[0];
|
|
13605
13835
|
|
|
13606
|
-
if (currentPage <= totalPages - pages + 2 || totalPages
|
|
13607
|
-
return buildPaginationDOM('start');
|
|
13836
|
+
if (currentPage <= totalPages - pages + 2 || totalPages < pages) {
|
|
13837
|
+
return buildPaginationDOM('start')[0];
|
|
13608
13838
|
}
|
|
13609
13839
|
|
|
13610
13840
|
return null;
|
|
@@ -13640,7 +13870,7 @@
|
|
|
13640
13870
|
return props.setPage(0);
|
|
13641
13871
|
}
|
|
13642
13872
|
}
|
|
13643
|
-
}, ["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, {
|
|
13644
13874
|
"class": getClassName(props.innerClass, 'button') || '',
|
|
13645
13875
|
"attrs": {
|
|
13646
13876
|
"disabled": props.currentPage >= props.totalPages - 1,
|
|
@@ -14041,6 +14271,17 @@
|
|
|
14041
14271
|
return MODIFIER_KEYS.includes(shortcutKey);
|
|
14042
14272
|
});
|
|
14043
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
|
+
}
|
|
14044
14285
|
|
|
14045
14286
|
var addComponent = lib_5.addComponent,
|
|
14046
14287
|
removeComponent = lib_5.removeComponent,
|
|
@@ -14706,7 +14947,8 @@
|
|
|
14706
14947
|
nextLabel: types.string,
|
|
14707
14948
|
distinctField: types.string,
|
|
14708
14949
|
distinctFieldConfig: types.props,
|
|
14709
|
-
index: VueTypes.string
|
|
14950
|
+
index: VueTypes.string,
|
|
14951
|
+
endpoint: types.endpointConfig
|
|
14710
14952
|
},
|
|
14711
14953
|
computed: {
|
|
14712
14954
|
shouldRenderPagination: function shouldRenderPagination() {
|
|
@@ -14753,7 +14995,7 @@
|
|
|
14753
14995
|
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14754
14996
|
}
|
|
14755
14997
|
|
|
14756
|
-
return
|
|
14998
|
+
return helper_15(filteredResults);
|
|
14757
14999
|
}
|
|
14758
15000
|
},
|
|
14759
15001
|
watch: {
|
|
@@ -15374,7 +15616,7 @@
|
|
|
15374
15616
|
|
|
15375
15617
|
ReactiveList.componentType = constants_1$1.reactiveList;
|
|
15376
15618
|
|
|
15377
|
-
function URL(url) {
|
|
15619
|
+
function URL$1(url) {
|
|
15378
15620
|
var pattern = RegExp("^(([^:/?#]*)?://)?(((.*)?@)?([^/?#]*)?)([^?#]*)(\\?([^#]*))?(#(.*))?");
|
|
15379
15621
|
var matches = url.match(pattern);
|
|
15380
15622
|
return {
|
|
@@ -15387,7 +15629,7 @@
|
|
|
15387
15629
|
};
|
|
15388
15630
|
}
|
|
15389
15631
|
|
|
15390
|
-
var urlParserLite = URL;
|
|
15632
|
+
var urlParserLite = URL$1;
|
|
15391
15633
|
|
|
15392
15634
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
15393
15635
|
// obj.hasOwnProperty(prop) will break.
|
|
@@ -15726,6 +15968,18 @@
|
|
|
15726
15968
|
});
|
|
15727
15969
|
}
|
|
15728
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:';
|
|
15981
|
+
}
|
|
15982
|
+
|
|
15729
15983
|
var mongodb = {
|
|
15730
15984
|
url: {
|
|
15731
15985
|
type: dataTypes.STRING,
|
|
@@ -15796,11 +16050,12 @@
|
|
|
15796
16050
|
* @param {String} config.password
|
|
15797
16051
|
* @param {Boolean} config.enableTelemetry
|
|
15798
16052
|
* @param {Object} config.mongodb
|
|
16053
|
+
* @param {Object} config.endpoint
|
|
15799
16054
|
* A callback function which will be invoked before a fetch request made
|
|
15800
16055
|
*/
|
|
15801
16056
|
|
|
15802
16057
|
function AppBase(config) {
|
|
15803
|
-
var _URL = urlParserLite(config.url
|
|
16058
|
+
var _URL = urlParserLite((config.endpoint ? config.endpoint.url : '') || config.url),
|
|
15804
16059
|
_URL$auth = _URL.auth,
|
|
15805
16060
|
auth = _URL$auth === undefined ? null : _URL$auth,
|
|
15806
16061
|
_URL$host = _URL.host,
|
|
@@ -15820,6 +16075,13 @@
|
|
|
15820
16075
|
var backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH']; // eslint-disable-next-line
|
|
15821
16076
|
|
|
15822
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
|
+
|
|
15823
16085
|
validateSchema({
|
|
15824
16086
|
url: config.url,
|
|
15825
16087
|
app: config.app,
|
|
@@ -17158,11 +17420,17 @@
|
|
|
17158
17420
|
this.setStore(this.$props);
|
|
17159
17421
|
},
|
|
17160
17422
|
mounted: function mounted() {
|
|
17161
|
-
var analyticsConfig = this.analyticsConfig
|
|
17423
|
+
var analyticsConfig = this.analyticsConfig,
|
|
17424
|
+
enableAppbase = this.enableAppbase,
|
|
17425
|
+
endpoint = this.endpoint; // TODO: Remove in 2.0
|
|
17162
17426
|
|
|
17163
17427
|
if (analyticsConfig !== undefined) {
|
|
17164
17428
|
console.warn('Warning(ReactiveSearch): The `analyticsConfig` prop has been marked as deprecated, please use the `appbaseConfig` prop instead.');
|
|
17165
17429
|
}
|
|
17430
|
+
|
|
17431
|
+
if (!enableAppbase && endpoint) {
|
|
17432
|
+
console.warn('Warning(ReactiveSearch): The `endpoint` prop works only when `enableAppbase` prop is set to true.');
|
|
17433
|
+
}
|
|
17166
17434
|
},
|
|
17167
17435
|
props: {
|
|
17168
17436
|
app: types.string,
|
|
@@ -17186,7 +17454,8 @@
|
|
|
17186
17454
|
as: VueTypes.string.def('div'),
|
|
17187
17455
|
getSearchParams: types.func,
|
|
17188
17456
|
setSearchParams: types.func,
|
|
17189
|
-
mongodb: types.mongodb
|
|
17457
|
+
mongodb: types.mongodb,
|
|
17458
|
+
endpoint: types.endpointConfig
|
|
17190
17459
|
},
|
|
17191
17460
|
provide: function provide() {
|
|
17192
17461
|
return {
|
|
@@ -17214,14 +17483,14 @@
|
|
|
17214
17483
|
this.updateState(this.$props);
|
|
17215
17484
|
},
|
|
17216
17485
|
analyticsConfig: function analyticsConfig(newVal, oldVal) {
|
|
17217
|
-
if (!
|
|
17486
|
+
if (!helper_32(newVal, oldVal)) {
|
|
17218
17487
|
if (this.store) {
|
|
17219
17488
|
this.store.dispatch(analytics_3$1(newVal));
|
|
17220
17489
|
}
|
|
17221
17490
|
}
|
|
17222
17491
|
},
|
|
17223
17492
|
appbaseConfig: function appbaseConfig(newVal, oldVal) {
|
|
17224
|
-
if (!
|
|
17493
|
+
if (!helper_32(newVal, oldVal)) {
|
|
17225
17494
|
if (this.store) {
|
|
17226
17495
|
this.store.dispatch(analytics_3$1(newVal));
|
|
17227
17496
|
}
|
|
@@ -17237,7 +17506,8 @@
|
|
|
17237
17506
|
enableAppbase = _this$$props.enableAppbase,
|
|
17238
17507
|
headers = _this$$props.headers,
|
|
17239
17508
|
appbaseConfig = _this$$props.appbaseConfig,
|
|
17240
|
-
mongodb = _this$$props.mongodb
|
|
17509
|
+
mongodb = _this$$props.mongodb,
|
|
17510
|
+
endpoint = _this$$props.endpoint;
|
|
17241
17511
|
|
|
17242
17512
|
var _ref = appbaseConfig || {},
|
|
17243
17513
|
enableTelemetry = _ref.enableTelemetry;
|
|
@@ -17246,7 +17516,7 @@
|
|
|
17246
17516
|
'X-Search-Client': X_SEARCH_CLIENT
|
|
17247
17517
|
}, enableTelemetry === false && {
|
|
17248
17518
|
'X-Enable-Telemetry': false
|
|
17249
|
-
}), headers);
|
|
17519
|
+
}), headers, enableAppbase && endpoint && endpoint.headers && _extends({}, endpoint.headers));
|
|
17250
17520
|
}
|
|
17251
17521
|
},
|
|
17252
17522
|
methods: {
|
|
@@ -17259,8 +17529,19 @@
|
|
|
17259
17529
|
|
|
17260
17530
|
var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
17261
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
|
+
|
|
17262
17543
|
var config = {
|
|
17263
|
-
url:
|
|
17544
|
+
url: url,
|
|
17264
17545
|
app: props.app,
|
|
17265
17546
|
credentials: credentials,
|
|
17266
17547
|
type: props.type ? props.type : '*',
|
|
@@ -17269,7 +17550,8 @@
|
|
|
17269
17550
|
enableAppbase: props.enableAppbase,
|
|
17270
17551
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
17271
17552
|
analyticsConfig: appbaseConfig,
|
|
17272
|
-
mongodb: props.mongodb
|
|
17553
|
+
mongodb: props.mongodb,
|
|
17554
|
+
endpoint: props.endpoint
|
|
17273
17555
|
};
|
|
17274
17556
|
var queryParams = '';
|
|
17275
17557
|
|
|
@@ -17302,12 +17584,16 @@
|
|
|
17302
17584
|
} catch (e) {// Do not add to selectedValues if JSON parsing fails.
|
|
17303
17585
|
}
|
|
17304
17586
|
});
|
|
17305
|
-
var themePreset = props.themePreset
|
|
17587
|
+
var themePreset = props.themePreset,
|
|
17588
|
+
enableAppbase = props.enableAppbase,
|
|
17589
|
+
endpoint = props.endpoint;
|
|
17306
17590
|
var appbaseRef = appbasejs(config);
|
|
17307
17591
|
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
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
|
+
};
|
|
17311
17597
|
|
|
17312
17598
|
if (this.$props.transformResponse) {
|
|
17313
17599
|
appbaseRef.transformResponse = this.$props.transformResponse;
|
|
@@ -17356,20 +17642,19 @@
|
|
|
17356
17642
|
Vue.component(ReactiveBase.name, ReactiveBase);
|
|
17357
17643
|
};
|
|
17358
17644
|
|
|
17359
|
-
|
|
17360
|
-
* hotkeys-js v3.
|
|
17361
|
-
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
|
|
17362
|
-
*
|
|
17363
|
-
* Copyright (c) 2021 kenny wong <wowohoo@qq.com>
|
|
17364
|
-
* http://jaywcjlove.github.io/hotkeys
|
|
17645
|
+
/**!
|
|
17646
|
+
* hotkeys-js v3.9.4
|
|
17647
|
+
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
|
|
17365
17648
|
*
|
|
17366
|
-
*
|
|
17649
|
+
* Copyright (c) 2022 kenny wong <wowohoo@qq.com>
|
|
17650
|
+
* http://jaywcjlove.github.io/hotkeys
|
|
17651
|
+
* Licensed under the MIT license
|
|
17367
17652
|
*/
|
|
17368
17653
|
var isff = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase().indexOf('firefox') > 0 : false; // 绑定事件
|
|
17369
17654
|
|
|
17370
|
-
function addEvent(object, event, method) {
|
|
17655
|
+
function addEvent(object, event, method, useCapture) {
|
|
17371
17656
|
if (object.addEventListener) {
|
|
17372
|
-
object.addEventListener(event, method,
|
|
17657
|
+
object.addEventListener(event, method, useCapture);
|
|
17373
17658
|
} else if (object.attachEvent) {
|
|
17374
17659
|
object.attachEvent("on".concat(event), function () {
|
|
17375
17660
|
method(window.event);
|
|
@@ -17512,6 +17797,8 @@
|
|
|
17512
17797
|
|
|
17513
17798
|
var _downKeys = []; // 记录摁下的绑定键
|
|
17514
17799
|
|
|
17800
|
+
var winListendFocus = false; // window是否已经监听了focus事件
|
|
17801
|
+
|
|
17515
17802
|
var _scope = 'all'; // 默认热键范围
|
|
17516
17803
|
|
|
17517
17804
|
var elementHasBindEvent = []; // 已绑定事件的节点记录
|
|
@@ -17610,7 +17897,7 @@
|
|
|
17610
17897
|
|
|
17611
17898
|
function unbind(keysInfo) {
|
|
17612
17899
|
// unbind(), unbind all keys
|
|
17613
|
-
if (
|
|
17900
|
+
if (typeof keysInfo === 'undefined') {
|
|
17614
17901
|
Object.keys(_handlers).forEach(function (key) {
|
|
17615
17902
|
return delete _handlers[key];
|
|
17616
17903
|
});
|
|
@@ -17663,21 +17950,20 @@
|
|
|
17663
17950
|
|
|
17664
17951
|
if (!scope) scope = getScope();
|
|
17665
17952
|
var mods = len > 1 ? getMods(_modifier, unbindKeys) : [];
|
|
17666
|
-
_handlers[keyCode] = _handlers[keyCode].
|
|
17953
|
+
_handlers[keyCode] = _handlers[keyCode].filter(function (record) {
|
|
17667
17954
|
// 通过函数判断,是否解除绑定,函数相等直接返回
|
|
17668
17955
|
var isMatchingMethod = method ? record.method === method : true;
|
|
17669
|
-
|
|
17670
|
-
if (isMatchingMethod && record.scope === scope && compareArray(record.mods, mods)) {
|
|
17671
|
-
return {};
|
|
17672
|
-
}
|
|
17673
|
-
|
|
17674
|
-
return record;
|
|
17956
|
+
return !(isMatchingMethod && record.scope === scope && compareArray(record.mods, mods));
|
|
17675
17957
|
});
|
|
17676
17958
|
});
|
|
17677
17959
|
}; // 对监听对应快捷键的回调函数进行处理
|
|
17678
17960
|
|
|
17679
17961
|
|
|
17680
|
-
function eventHandler(event, handler, scope) {
|
|
17962
|
+
function eventHandler(event, handler, scope, element) {
|
|
17963
|
+
if (handler.element !== element) {
|
|
17964
|
+
return;
|
|
17965
|
+
}
|
|
17966
|
+
|
|
17681
17967
|
var modifiersMatch; // 看它是否在当前范围
|
|
17682
17968
|
|
|
17683
17969
|
if (handler.scope === scope || handler.scope === 'all') {
|
|
@@ -17704,7 +17990,7 @@
|
|
|
17704
17990
|
} // 处理keydown事件
|
|
17705
17991
|
|
|
17706
17992
|
|
|
17707
|
-
function dispatch(event) {
|
|
17993
|
+
function dispatch(event, element) {
|
|
17708
17994
|
var asterisk = _handlers['*'];
|
|
17709
17995
|
var key = event.keyCode || event.which || event.charCode; // 表单控件过滤 默认表单控件不触发快捷键
|
|
17710
17996
|
|
|
@@ -17789,7 +18075,7 @@
|
|
|
17789
18075
|
if (asterisk) {
|
|
17790
18076
|
for (var i = 0; i < asterisk.length; i++) {
|
|
17791
18077
|
if (asterisk[i].scope === scope && (event.type === 'keydown' && asterisk[i].keydown || event.type === 'keyup' && asterisk[i].keyup)) {
|
|
17792
|
-
eventHandler(event, asterisk[i], scope);
|
|
18078
|
+
eventHandler(event, asterisk[i], scope, element);
|
|
17793
18079
|
}
|
|
17794
18080
|
}
|
|
17795
18081
|
} // key 不在 _handlers 中返回
|
|
@@ -17811,7 +18097,7 @@
|
|
|
17811
18097
|
|
|
17812
18098
|
if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {
|
|
17813
18099
|
// 找到处理内容
|
|
17814
|
-
eventHandler(event, record, scope);
|
|
18100
|
+
eventHandler(event, record, scope, element);
|
|
17815
18101
|
}
|
|
17816
18102
|
}
|
|
17817
18103
|
}
|
|
@@ -17835,7 +18121,8 @@
|
|
|
17835
18121
|
var i = 0;
|
|
17836
18122
|
var keyup = false;
|
|
17837
18123
|
var keydown = true;
|
|
17838
|
-
var splitKey = '+';
|
|
18124
|
+
var splitKey = '+';
|
|
18125
|
+
var capture = false; // 对为设定范围的判断
|
|
17839
18126
|
|
|
17840
18127
|
if (method === undefined && typeof option === 'function') {
|
|
17841
18128
|
method = option;
|
|
@@ -17850,6 +18137,8 @@
|
|
|
17850
18137
|
|
|
17851
18138
|
if (option.keydown !== undefined) keydown = option.keydown; // eslint-disable-line
|
|
17852
18139
|
|
|
18140
|
+
if (option.capture !== undefined) capture = option.capture; // eslint-disable-line
|
|
18141
|
+
|
|
17853
18142
|
if (typeof option.splitKey === 'string') splitKey = option.splitKey; // eslint-disable-line
|
|
17854
18143
|
}
|
|
17855
18144
|
|
|
@@ -17876,7 +18165,8 @@
|
|
|
17876
18165
|
shortcut: keys[i],
|
|
17877
18166
|
method: method,
|
|
17878
18167
|
key: keys[i],
|
|
17879
|
-
splitKey: splitKey
|
|
18168
|
+
splitKey: splitKey,
|
|
18169
|
+
element: element
|
|
17880
18170
|
});
|
|
17881
18171
|
} // 在全局document上设置快捷键
|
|
17882
18172
|
|
|
@@ -17884,18 +18174,36 @@
|
|
|
17884
18174
|
if (typeof element !== 'undefined' && !isElementBind(element) && window) {
|
|
17885
18175
|
elementHasBindEvent.push(element);
|
|
17886
18176
|
addEvent(element, 'keydown', function (e) {
|
|
17887
|
-
dispatch(e);
|
|
17888
|
-
});
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
18177
|
+
dispatch(e, element);
|
|
18178
|
+
}, capture);
|
|
18179
|
+
|
|
18180
|
+
if (!winListendFocus) {
|
|
18181
|
+
winListendFocus = true;
|
|
18182
|
+
addEvent(window, 'focus', function () {
|
|
18183
|
+
_downKeys = [];
|
|
18184
|
+
}, capture);
|
|
18185
|
+
}
|
|
18186
|
+
|
|
17892
18187
|
addEvent(element, 'keyup', function (e) {
|
|
17893
|
-
dispatch(e);
|
|
18188
|
+
dispatch(e, element);
|
|
17894
18189
|
clearModifier(e);
|
|
17895
|
-
});
|
|
18190
|
+
}, capture);
|
|
17896
18191
|
}
|
|
17897
18192
|
}
|
|
17898
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
|
+
|
|
17899
18207
|
var _api = {
|
|
17900
18208
|
setScope: setScope,
|
|
17901
18209
|
getScope: getScope,
|
|
@@ -17903,7 +18211,11 @@
|
|
|
17903
18211
|
getPressedKeyCodes: getPressedKeyCodes,
|
|
17904
18212
|
isPressed: isPressed,
|
|
17905
18213
|
filter: filter,
|
|
17906
|
-
|
|
18214
|
+
trigger: trigger,
|
|
18215
|
+
unbind: unbind,
|
|
18216
|
+
keyMap: _keyMap,
|
|
18217
|
+
modifier: _modifier,
|
|
18218
|
+
modifierMap: modifierMap
|
|
17907
18219
|
};
|
|
17908
18220
|
|
|
17909
18221
|
for (var a in _api) {
|
|
@@ -20123,7 +20435,8 @@
|
|
|
20123
20435
|
index: VueTypes.string,
|
|
20124
20436
|
enableDefaultSuggestions: VueTypes.bool.def(true),
|
|
20125
20437
|
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
20126
|
-
renderSelectedTags: VueTypes.any
|
|
20438
|
+
renderSelectedTags: VueTypes.any,
|
|
20439
|
+
endpoint: types.endpointConfig
|
|
20127
20440
|
},
|
|
20128
20441
|
beforeMount: function beforeMount() {
|
|
20129
20442
|
if (this.$props.highlight) {
|
|
@@ -20296,7 +20609,7 @@
|
|
|
20296
20609
|
// returns size and aggs property
|
|
20297
20610
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
20298
20611
|
var aggregationField = this.$props.aggregationField;
|
|
20299
|
-
var queryOptions =
|
|
20612
|
+
var queryOptions = helper_35(this.$props);
|
|
20300
20613
|
|
|
20301
20614
|
if (aggregationField) {
|
|
20302
20615
|
queryOptions.aggs = getCompositeAggsQuery$1({
|
|
@@ -21384,7 +21697,7 @@
|
|
|
21384
21697
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
21385
21698
|
}
|
|
21386
21699
|
|
|
21387
|
-
this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
|
|
21700
|
+
this.currentValue = decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
|
|
21388
21701
|
|
|
21389
21702
|
if (this.$options.isTagsMode) {
|
|
21390
21703
|
this.currentValue = '';
|
|
@@ -21481,7 +21794,9 @@
|
|
|
21481
21794
|
enterButton: VueTypes.bool.def(false),
|
|
21482
21795
|
renderEnterButton: VueTypes.any,
|
|
21483
21796
|
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
21484
|
-
renderSelectedTags: VueTypes.any
|
|
21797
|
+
renderSelectedTags: VueTypes.any,
|
|
21798
|
+
searchboxId: VueTypes.string,
|
|
21799
|
+
endpoint: types.endpointConfig
|
|
21485
21800
|
},
|
|
21486
21801
|
beforeMount: function beforeMount() {
|
|
21487
21802
|
if (this.selectedValue) {
|
|
@@ -21660,7 +21975,7 @@
|
|
|
21660
21975
|
// returns size and aggs property
|
|
21661
21976
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
21662
21977
|
var aggregationField = this.$props.aggregationField;
|
|
21663
|
-
var queryOptions =
|
|
21978
|
+
var queryOptions = helper_35(this.$props);
|
|
21664
21979
|
|
|
21665
21980
|
if (aggregationField) {
|
|
21666
21981
|
queryOptions.aggs = getCompositeAggsQuery$2({
|
|
@@ -21725,7 +22040,7 @@
|
|
|
21725
22040
|
|
|
21726
22041
|
_this.currentValue = '';
|
|
21727
22042
|
} else {
|
|
21728
|
-
_this.currentValue = value;
|
|
22043
|
+
_this.currentValue = decodeHtml(value);
|
|
21729
22044
|
}
|
|
21730
22045
|
|
|
21731
22046
|
var queryHandlerValue = value;
|
|
@@ -22231,7 +22546,7 @@
|
|
|
22231
22546
|
onAutofillClick: function onAutofillClick(suggestion) {
|
|
22232
22547
|
var value = suggestion.value;
|
|
22233
22548
|
this.isOpen = true;
|
|
22234
|
-
this.currentValue = value;
|
|
22549
|
+
this.currentValue = decodeHtml(value);
|
|
22235
22550
|
this.triggerDefaultQuery(value);
|
|
22236
22551
|
},
|
|
22237
22552
|
renderAutoFill: function renderAutoFill(suggestion) {
|
|
@@ -22359,10 +22674,10 @@
|
|
|
22359
22674
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
22360
22675
|
var getIcon = function getIcon(iconType) {
|
|
22361
22676
|
switch (iconType) {
|
|
22362
|
-
case
|
|
22677
|
+
case helper_13.Recent:
|
|
22363
22678
|
return recentSearchesIcon;
|
|
22364
22679
|
|
|
22365
|
-
case
|
|
22680
|
+
case helper_13.Popular:
|
|
22366
22681
|
return popularSearchesIcon;
|
|
22367
22682
|
|
|
22368
22683
|
default:
|
|
@@ -22788,7 +23103,8 @@
|
|
|
22788
23103
|
missingLabel: VueTypes.string.def('N/A'),
|
|
22789
23104
|
nestedField: types.string,
|
|
22790
23105
|
index: VueTypes.string,
|
|
22791
|
-
enableStrictSelection: VueTypes.bool.def(false)
|
|
23106
|
+
enableStrictSelection: VueTypes.bool.def(false),
|
|
23107
|
+
endpoint: types.endpointConfig
|
|
22792
23108
|
},
|
|
22793
23109
|
data: function data() {
|
|
22794
23110
|
var props = this.$props;
|
|
@@ -23269,7 +23585,8 @@
|
|
|
23269
23585
|
showMissing: VueTypes.bool.def(false),
|
|
23270
23586
|
missingLabel: VueTypes.string.def('N/A'),
|
|
23271
23587
|
nestedField: types.string,
|
|
23272
|
-
index: VueTypes.string
|
|
23588
|
+
index: VueTypes.string,
|
|
23589
|
+
endpoint: types.endpointConfig
|
|
23273
23590
|
},
|
|
23274
23591
|
data: function data() {
|
|
23275
23592
|
var props = this.$props;
|
|
@@ -24188,7 +24505,8 @@
|
|
|
24188
24505
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
24189
24506
|
nestedField: types.string,
|
|
24190
24507
|
index: VueTypes.string,
|
|
24191
|
-
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
24508
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...'),
|
|
24509
|
+
endpoint: types.endpointConfig
|
|
24192
24510
|
},
|
|
24193
24511
|
created: function created() {
|
|
24194
24512
|
if (!this.enableAppbase && this.$props.index) {
|
|
@@ -24644,7 +24962,8 @@
|
|
|
24644
24962
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
24645
24963
|
nestedField: types.string,
|
|
24646
24964
|
index: VueTypes.string,
|
|
24647
|
-
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
24965
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...'),
|
|
24966
|
+
endpoint: types.endpointConfig
|
|
24648
24967
|
},
|
|
24649
24968
|
created: function created() {
|
|
24650
24969
|
if (!this.enableAppbase && this.$props.index) {
|
|
@@ -25182,7 +25501,8 @@
|
|
|
25182
25501
|
URLParams: VueTypes.bool,
|
|
25183
25502
|
renderItem: types.func,
|
|
25184
25503
|
index: VueTypes.string,
|
|
25185
|
-
enableStrictSelection: VueTypes.bool
|
|
25504
|
+
enableStrictSelection: VueTypes.bool,
|
|
25505
|
+
endpoint: types.endpointConfig
|
|
25186
25506
|
},
|
|
25187
25507
|
data: function data() {
|
|
25188
25508
|
this.__state = {
|
|
@@ -25512,7 +25832,8 @@
|
|
|
25512
25832
|
URLParams: VueTypes.bool.def(false),
|
|
25513
25833
|
distinctField: types.string,
|
|
25514
25834
|
distinctFieldConfig: types.props,
|
|
25515
|
-
index: VueTypes.string
|
|
25835
|
+
index: VueTypes.string,
|
|
25836
|
+
endpoint: types.endpointConfig
|
|
25516
25837
|
},
|
|
25517
25838
|
created: function created() {
|
|
25518
25839
|
var _this = this;
|
|
@@ -25965,7 +26286,7 @@
|
|
|
25965
26286
|
|
|
25966
26287
|
return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
|
|
25967
26288
|
return _this3.remove(component, value);
|
|
25968
|
-
}, selectedValues[component].label + ": " + valueToRender);
|
|
26289
|
+
}, selectedValues[component].label + ": " + decodeHtml(valueToRender));
|
|
25969
26290
|
}
|
|
25970
26291
|
|
|
25971
26292
|
return null;
|
|
@@ -26030,7 +26351,8 @@
|
|
|
26030
26351
|
title: types.title,
|
|
26031
26352
|
URLParams: VueTypes.bool.def(false),
|
|
26032
26353
|
nestedField: types.string,
|
|
26033
|
-
index: VueTypes.string
|
|
26354
|
+
index: VueTypes.string,
|
|
26355
|
+
endpoint: types.endpointConfig
|
|
26034
26356
|
},
|
|
26035
26357
|
created: function created() {
|
|
26036
26358
|
if (!this.enableAppbase && this.$props.index) {
|
|
@@ -26259,7 +26581,8 @@
|
|
|
26259
26581
|
title: types.title,
|
|
26260
26582
|
URLParams: VueTypes.bool.def(false),
|
|
26261
26583
|
nestedField: types.string,
|
|
26262
|
-
index: VueTypes.string
|
|
26584
|
+
index: VueTypes.string,
|
|
26585
|
+
endpoint: types.endpointConfig
|
|
26263
26586
|
},
|
|
26264
26587
|
methods: {
|
|
26265
26588
|
handleClick: function handleClick(e) {
|
|
@@ -26881,7 +27204,8 @@
|
|
|
26881
27204
|
URLParams: VueTypes.bool.def(false),
|
|
26882
27205
|
sliderOptions: VueTypes.object.def({}),
|
|
26883
27206
|
nestedField: types.string,
|
|
26884
|
-
index: VueTypes.string
|
|
27207
|
+
index: VueTypes.string,
|
|
27208
|
+
endpoint: types.endpointConfig
|
|
26885
27209
|
},
|
|
26886
27210
|
methods: {
|
|
26887
27211
|
handleSliderChange: function handleSliderChange(values) {
|
|
@@ -27149,7 +27473,8 @@
|
|
|
27149
27473
|
sliderOptions: VueTypes.object.def({}),
|
|
27150
27474
|
nestedField: types.string,
|
|
27151
27475
|
index: VueTypes.string,
|
|
27152
|
-
value: types.range
|
|
27476
|
+
value: types.range,
|
|
27477
|
+
endpoint: types.endpointConfig
|
|
27153
27478
|
},
|
|
27154
27479
|
data: function data() {
|
|
27155
27480
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -27804,8 +28129,8 @@
|
|
|
27804
28129
|
if (component.defaultQuery) {
|
|
27805
28130
|
var defaultQuery = component.defaultQuery(currentValue, component);
|
|
27806
28131
|
return _extends({
|
|
27807
|
-
query:
|
|
27808
|
-
},
|
|
28132
|
+
query: helper_21(defaultQuery)
|
|
28133
|
+
}, helper_22(defaultQuery));
|
|
27809
28134
|
}
|
|
27810
28135
|
|
|
27811
28136
|
return component.source.defaultQuery ? {
|
|
@@ -27821,8 +28146,8 @@
|
|
|
27821
28146
|
if (component.customQuery) {
|
|
27822
28147
|
var customQuery = component.customQuery(currentValue, component);
|
|
27823
28148
|
return _extends({
|
|
27824
|
-
query:
|
|
27825
|
-
},
|
|
28149
|
+
query: helper_21(customQuery)
|
|
28150
|
+
}, helper_22(customQuery));
|
|
27826
28151
|
}
|
|
27827
28152
|
|
|
27828
28153
|
return component.source.defaultQuery ? {
|
|
@@ -27839,20 +28164,51 @@
|
|
|
27839
28164
|
'X-Search-Client': X_SEARCH_CLIENT$1
|
|
27840
28165
|
}, enableTelemetry === false && {
|
|
27841
28166
|
'X-Enable-Telemetry': false
|
|
27842
|
-
}), 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
|
+
}
|
|
27843
28188
|
|
|
27844
28189
|
var config = {
|
|
27845
|
-
url:
|
|
28190
|
+
url: url,
|
|
27846
28191
|
app: settings.app,
|
|
27847
28192
|
credentials: credentials,
|
|
27848
|
-
transformRequest:
|
|
28193
|
+
transformRequest: transformRequest,
|
|
27849
28194
|
type: settings.type ? settings.type : '*',
|
|
27850
28195
|
transformResponse: settings.transformResponse || null,
|
|
27851
28196
|
graphQLUrl: settings.graphQLUrl || '',
|
|
27852
28197
|
headers: headers,
|
|
27853
|
-
analyticsConfig: settings.appbaseConfig || null
|
|
28198
|
+
analyticsConfig: settings.appbaseConfig || null,
|
|
28199
|
+
enableAppbase: settings.enableAppbase,
|
|
28200
|
+
endpoint: settings.endpoint
|
|
27854
28201
|
};
|
|
27855
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
|
+
|
|
27856
28212
|
var components = [];
|
|
27857
28213
|
var selectedValues = {};
|
|
27858
28214
|
var internalValues = {};
|
|
@@ -27986,7 +28342,7 @@
|
|
|
27986
28342
|
var react = component.react;
|
|
27987
28343
|
|
|
27988
28344
|
if (isInternalComponentPresent || isResultComponent) {
|
|
27989
|
-
react =
|
|
28345
|
+
react = helper_37(react, internalComponent);
|
|
27990
28346
|
}
|
|
27991
28347
|
|
|
27992
28348
|
dependencyTree = dependencyTreeReducer(dependencyTree, {
|
|
@@ -28049,7 +28405,7 @@
|
|
|
28049
28405
|
|
|
28050
28406
|
componentCollection.forEach(function (component) {
|
|
28051
28407
|
// eslint-disable-next-line
|
|
28052
|
-
var _buildQuery =
|
|
28408
|
+
var _buildQuery = helper_36(component.componentId, dependencyTree, queryList, queryOptions),
|
|
28053
28409
|
queryObj = _buildQuery.queryObj,
|
|
28054
28410
|
options = _buildQuery.options;
|
|
28055
28411
|
|
|
@@ -28181,9 +28537,10 @@
|
|
|
28181
28537
|
}
|
|
28182
28538
|
|
|
28183
28539
|
timestamp[component] = res._timestamp;
|
|
28540
|
+
var hitsObj = response.hits ? response.hits : response[component].hits;
|
|
28184
28541
|
hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
|
|
28185
|
-
hits:
|
|
28186
|
-
total: typeof
|
|
28542
|
+
hits: hitsObj.hits,
|
|
28543
|
+
total: typeof hitsObj.total === 'object' ? hitsObj.total.value : hitsObj.total,
|
|
28187
28544
|
time: response.took
|
|
28188
28545
|
}, _extends7));
|
|
28189
28546
|
responseResolve();
|
|
@@ -28259,7 +28616,7 @@
|
|
|
28259
28616
|
});
|
|
28260
28617
|
}
|
|
28261
28618
|
|
|
28262
|
-
var version = "1.
|
|
28619
|
+
var version = "1.31.0";
|
|
28263
28620
|
|
|
28264
28621
|
var _templateObject$p, _templateObject2$b;
|
|
28265
28622
|
|
|
@@ -28329,7 +28686,8 @@
|
|
|
28329
28686
|
title: types.title,
|
|
28330
28687
|
URLParams: VueTypes.bool.def(false),
|
|
28331
28688
|
sliderOptions: VueTypes.object.def({}),
|
|
28332
|
-
nestedField: types.string
|
|
28689
|
+
nestedField: types.string,
|
|
28690
|
+
endpoint: types.endpointConfig
|
|
28333
28691
|
},
|
|
28334
28692
|
methods: {
|
|
28335
28693
|
shouldUpdate: function shouldUpdate(value) {
|