@appbaseio/reactivesearch-vue 1.16.0-alpha.25 → 1.16.0-alpha.29
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 +562 -194
- 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/{DownShift-d41f2442.js → CancelSvg-b14dd012.js} +57 -0
- package/dist/cjs/DataSearch.js +29 -80
- package/dist/cjs/{DropDown-d3c78c41.js → DropDown-dc042720.js} +60 -23
- package/dist/cjs/DynamicRangeSlider.js +1 -1
- package/dist/cjs/MultiDropdownList.js +12 -5
- package/dist/cjs/MultiList.js +4 -3
- package/dist/cjs/MultiRange.js +1 -1
- package/dist/cjs/{Pagination-d4dbfd5a.js → Pagination-0b9ec0fc.js} +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/RangeSlider.js +1 -1
- package/dist/cjs/ReactiveBase.js +17 -9
- package/dist/cjs/ReactiveComponent.js +12 -12
- package/dist/cjs/ReactiveGoogleMap.js +2 -2
- package/dist/cjs/ReactiveList.js +55 -43
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +1 -1
- package/dist/cjs/SingleDropdownList.js +12 -5
- package/dist/cjs/SingleList.js +5 -4
- package/dist/cjs/SingleRange.js +1 -1
- package/dist/cjs/StateProvider.js +6 -2
- package/dist/cjs/ToggleButton.js +2 -2
- package/dist/cjs/index.js +7 -4
- package/dist/cjs/initReactivesearch.js +31 -12
- package/dist/cjs/install.js +5 -4
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-409348b0.js → vueTypes-829a5f2c.js} +5 -1
- package/dist/es/{DownShift-e7ccf2a7.js → CancelSvg-282ae799.js} +54 -2
- package/dist/es/DataSearch.js +19 -70
- package/dist/es/{DropDown-8894cc22.js → DropDown-d9686568.js} +59 -22
- package/dist/es/DynamicRangeSlider.js +1 -1
- package/dist/es/MultiDropdownList.js +12 -5
- package/dist/es/MultiList.js +4 -3
- package/dist/es/MultiRange.js +1 -1
- package/dist/es/{Pagination-a2ab7fcb.js → Pagination-e8216949.js} +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/RangeSlider.js +1 -1
- package/dist/es/ReactiveBase.js +17 -9
- package/dist/es/ReactiveComponent.js +12 -12
- package/dist/es/ReactiveGoogleMap.js +2 -2
- package/dist/es/ReactiveList.js +55 -43
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +1 -1
- package/dist/es/SingleDropdownList.js +12 -5
- package/dist/es/SingleList.js +5 -4
- package/dist/es/SingleRange.js +1 -1
- package/dist/es/StateProvider.js +6 -2
- package/dist/es/ToggleButton.js +2 -2
- package/dist/es/index.js +7 -4
- package/dist/es/initReactivesearch.js +31 -12
- package/dist/es/install.js +5 -4
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-a9b9d5c9.js → vueTypes-98819a12.js} +5 -1
- package/package.json +3 -3
|
@@ -40,14 +40,9 @@
|
|
|
40
40
|
|
|
41
41
|
if (Object.getOwnPropertySymbols) {
|
|
42
42
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
keys.push.apply(keys, symbols);
|
|
43
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
44
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
45
|
+
})), keys.push.apply(keys, symbols);
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
return keys;
|
|
@@ -55,19 +50,12 @@
|
|
|
55
50
|
|
|
56
51
|
function _objectSpread2(target) {
|
|
57
52
|
for (var i = 1; i < arguments.length; i++) {
|
|
58
|
-
var source = arguments[i]
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
65
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
66
|
-
} else {
|
|
67
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
68
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
-
});
|
|
70
|
-
}
|
|
53
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
54
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
55
|
+
_defineProperty(target, key, source[key]);
|
|
56
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
57
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
58
|
+
});
|
|
71
59
|
}
|
|
72
60
|
|
|
73
61
|
return target;
|
|
@@ -755,23 +743,36 @@
|
|
|
755
743
|
createStore: createStore
|
|
756
744
|
});
|
|
757
745
|
|
|
746
|
+
/** A function that accepts a potential "extra argument" value to be injected later,
|
|
747
|
+
* and returns an instance of the thunk middleware that uses that value
|
|
748
|
+
*/
|
|
758
749
|
function createThunkMiddleware(extraArgument) {
|
|
759
|
-
|
|
750
|
+
// Standard Redux middleware definition pattern:
|
|
751
|
+
// See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
|
|
752
|
+
var middleware = function middleware(_ref) {
|
|
760
753
|
var dispatch = _ref.dispatch,
|
|
761
754
|
getState = _ref.getState;
|
|
762
755
|
return function (next) {
|
|
763
756
|
return function (action) {
|
|
757
|
+
// The thunk middleware looks for any functions that were passed to `store.dispatch`.
|
|
758
|
+
// If this "action" is really a function, call it and return the result.
|
|
764
759
|
if (typeof action === 'function') {
|
|
760
|
+
// Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
|
|
765
761
|
return action(dispatch, getState, extraArgument);
|
|
766
|
-
}
|
|
762
|
+
} // Otherwise, pass the action down the middleware chain as usual
|
|
763
|
+
|
|
767
764
|
|
|
768
765
|
return next(action);
|
|
769
766
|
};
|
|
770
767
|
};
|
|
771
768
|
};
|
|
769
|
+
|
|
770
|
+
return middleware;
|
|
772
771
|
}
|
|
773
772
|
|
|
774
|
-
var thunk = createThunkMiddleware();
|
|
773
|
+
var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
|
|
774
|
+
// with whatever "extra arg" they want to inject into their thunks
|
|
775
|
+
|
|
775
776
|
thunk.withExtraArgument = createThunkMiddleware;
|
|
776
777
|
|
|
777
778
|
var constants = createCommonjsModule(function (module, exports) {
|
|
@@ -1197,6 +1198,7 @@
|
|
|
1197
1198
|
reactiveList: 'REACTIVELIST',
|
|
1198
1199
|
dataSearch: 'DATASEARCH',
|
|
1199
1200
|
categorySearch: 'CATEGORYSEARCH',
|
|
1201
|
+
searchBox: 'SUGGESTION',
|
|
1200
1202
|
singleList: 'SINGLELIST',
|
|
1201
1203
|
multiList: 'MULTILIST',
|
|
1202
1204
|
singleDataList: 'SINGLEDATALIST',
|
|
@@ -1225,9 +1227,10 @@
|
|
|
1225
1227
|
search: 'search',
|
|
1226
1228
|
term: 'term',
|
|
1227
1229
|
range: 'range',
|
|
1228
|
-
geo: 'geo'
|
|
1230
|
+
geo: 'geo',
|
|
1231
|
+
suggestion: 'suggestion'
|
|
1229
1232
|
};
|
|
1230
|
-
var validProps = exports.validProps = ['componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'enablePopularSuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'unit'];
|
|
1233
|
+
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'];
|
|
1231
1234
|
var CLEAR_ALL = exports.CLEAR_ALL = {
|
|
1232
1235
|
NEVER: 'never',
|
|
1233
1236
|
ALWAYS: 'always',
|
|
@@ -2753,7 +2756,12 @@
|
|
|
2753
2756
|
var aggsResponse = Object.values(action.aggregations) && Object.values(action.aggregations)[0];
|
|
2754
2757
|
var fieldName = Object.keys(action.aggregations)[0];
|
|
2755
2758
|
if (!aggsResponse) return state;
|
|
2756
|
-
var buckets =
|
|
2759
|
+
var buckets = [];
|
|
2760
|
+
|
|
2761
|
+
if (aggsResponse.buckets && Array.isArray(aggsResponse.buckets)) {
|
|
2762
|
+
buckets = aggsResponse.buckets;
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2757
2765
|
var parsedAggs = buckets.map(function (bucket) {
|
|
2758
2766
|
var doc_count = bucket.doc_count,
|
|
2759
2767
|
key = bucket.key,
|
|
@@ -2769,7 +2777,7 @@
|
|
|
2769
2777
|
|
|
2770
2778
|
return _extends({
|
|
2771
2779
|
_doc_count: doc_count,
|
|
2772
|
-
_key: key[fieldName],
|
|
2780
|
+
_key: typeof key === 'string' ? key : key[fieldName],
|
|
2773
2781
|
top_hits: hitsData
|
|
2774
2782
|
}, flatData, _source);
|
|
2775
2783
|
});
|
|
@@ -2779,7 +2787,7 @@
|
|
|
2779
2787
|
return state;
|
|
2780
2788
|
}
|
|
2781
2789
|
});
|
|
2782
|
-
unwrapExports(compositeAggsReducer_1);
|
|
2790
|
+
var compositeAggsReducer = unwrapExports(compositeAggsReducer_1);
|
|
2783
2791
|
|
|
2784
2792
|
var appliedSettingsReducer_1 = createCommonjsModule(function (module, exports) {
|
|
2785
2793
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4561,6 +4569,8 @@
|
|
|
4561
4569
|
return target;
|
|
4562
4570
|
};
|
|
4563
4571
|
|
|
4572
|
+
exports.replaceDiacritics = replaceDiacritics;
|
|
4573
|
+
|
|
4564
4574
|
var _diacritics2 = _interopRequireDefault(diacritics_1);
|
|
4565
4575
|
|
|
4566
4576
|
function _interopRequireDefault(obj) {
|
|
@@ -4838,6 +4848,7 @@
|
|
|
4838
4848
|
exports["default"] = getSuggestions;
|
|
4839
4849
|
});
|
|
4840
4850
|
unwrapExports(suggestions);
|
|
4851
|
+
var suggestions_1 = suggestions.replaceDiacritics;
|
|
4841
4852
|
|
|
4842
4853
|
var helper = createCommonjsModule(function (module, exports) {
|
|
4843
4854
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4871,6 +4882,7 @@
|
|
|
4871
4882
|
exports.extractFieldsFromSource = extractFieldsFromSource;
|
|
4872
4883
|
exports.normalizeDataField = normalizeDataField;
|
|
4873
4884
|
exports.handleOnSuggestions = handleOnSuggestions;
|
|
4885
|
+
exports.isValidDateRangeQueryFormat = isValidDateRangeQueryFormat;
|
|
4874
4886
|
|
|
4875
4887
|
var _dateFormats2 = _interopRequireDefault(dateFormats_1);
|
|
4876
4888
|
|
|
@@ -5259,7 +5271,7 @@
|
|
|
5259
5271
|
case 'epoch_millis':
|
|
5260
5272
|
return date.getTime();
|
|
5261
5273
|
|
|
5262
|
-
case '
|
|
5274
|
+
case 'epoch_second':
|
|
5263
5275
|
return Math.floor(date.getTime() / 1000);
|
|
5264
5276
|
|
|
5265
5277
|
default:
|
|
@@ -5652,6 +5664,10 @@
|
|
|
5652
5664
|
});
|
|
5653
5665
|
return withClickIds(finalSuggestions);
|
|
5654
5666
|
};
|
|
5667
|
+
|
|
5668
|
+
function isValidDateRangeQueryFormat(queryFormat) {
|
|
5669
|
+
return Object.keys(_dateFormats2["default"]).includes(queryFormat);
|
|
5670
|
+
}
|
|
5655
5671
|
});
|
|
5656
5672
|
unwrapExports(helper);
|
|
5657
5673
|
var helper_1 = helper.getTopSuggestions;
|
|
@@ -5682,6 +5698,7 @@
|
|
|
5682
5698
|
var helper_26 = helper.extractFieldsFromSource;
|
|
5683
5699
|
var helper_27 = helper.normalizeDataField;
|
|
5684
5700
|
var helper_28 = helper.handleOnSuggestions;
|
|
5701
|
+
var helper_29 = helper.isValidDateRangeQueryFormat;
|
|
5685
5702
|
|
|
5686
5703
|
var value = createCommonjsModule(function (module, exports) {
|
|
5687
5704
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -6040,6 +6057,7 @@
|
|
|
6040
6057
|
exports.updateCompositeAggs = updateCompositeAggs;
|
|
6041
6058
|
exports.updateHits = updateHits;
|
|
6042
6059
|
exports.saveQueryToHits = saveQueryToHits;
|
|
6060
|
+
exports.mockDataForTesting = mockDataForTesting;
|
|
6043
6061
|
|
|
6044
6062
|
function updateAggs(component, aggregations) {
|
|
6045
6063
|
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -6081,12 +6099,25 @@
|
|
|
6081
6099
|
query: query
|
|
6082
6100
|
};
|
|
6083
6101
|
}
|
|
6102
|
+
|
|
6103
|
+
function mockDataForTesting(component, data) {
|
|
6104
|
+
return function (dispatch) {
|
|
6105
|
+
if (data.hasOwnProperty('aggregations')) {
|
|
6106
|
+
dispatch(updateAggs(component, data.aggregations));
|
|
6107
|
+
}
|
|
6108
|
+
|
|
6109
|
+
if (data.hasOwnProperty('hits')) {
|
|
6110
|
+
dispatch(updateHits(component, data, data.time || undefined));
|
|
6111
|
+
}
|
|
6112
|
+
};
|
|
6113
|
+
}
|
|
6084
6114
|
});
|
|
6085
6115
|
unwrapExports(hits);
|
|
6086
6116
|
var hits_1 = hits.updateAggs;
|
|
6087
6117
|
var hits_2 = hits.updateCompositeAggs;
|
|
6088
6118
|
var hits_3 = hits.updateHits;
|
|
6089
6119
|
var hits_4 = hits.saveQueryToHits;
|
|
6120
|
+
var hits_5 = hits.mockDataForTesting;
|
|
6090
6121
|
|
|
6091
6122
|
var xdate = createCommonjsModule(function (module) {
|
|
6092
6123
|
/**
|
|
@@ -6914,6 +6945,8 @@
|
|
|
6914
6945
|
|
|
6915
6946
|
var _xdate2 = _interopRequireDefault(xdate);
|
|
6916
6947
|
|
|
6948
|
+
var _dateFormats2 = _interopRequireDefault(dateFormats_1);
|
|
6949
|
+
|
|
6917
6950
|
function _interopRequireDefault(obj) {
|
|
6918
6951
|
return obj && obj.__esModule ? obj : {
|
|
6919
6952
|
"default": obj
|
|
@@ -6947,10 +6980,10 @@
|
|
|
6947
6980
|
return obj;
|
|
6948
6981
|
}
|
|
6949
6982
|
|
|
6950
|
-
var componentToTypeMap = exports.componentToTypeMap = (_componentToTypeMap = {}, _defineProperty(_componentToTypeMap, constants$1.componentTypes.reactiveList, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dataSearch, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.categorySearch, constants$1.queryTypes.search), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDataList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDropdownList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDataList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDropdownList, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.tagCloud, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.toggleButton, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.numberBox, constants$1.queryTypes.term), _defineProperty(_componentToTypeMap, constants$1.componentTypes.datePicker, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dateRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.dynamicRangeSlider, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleDropdownRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiDropdownRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.singleRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.multiRange, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.rangeSlider, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.ratingsFilter, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.rangeInput, constants$1.queryTypes.range), _defineProperty(_componentToTypeMap, constants$1.componentTypes.geoDistanceDropdown, constants$1.queryTypes.geo), _defineProperty(_componentToTypeMap, constants$1.componentTypes.geoDistanceSlider, constants$1.queryTypes.geo), _defineProperty(_componentToTypeMap, constants$1.componentTypes.reactiveMap, constants$1.queryTypes.geo), _componentToTypeMap);
|
|
6983
|
+
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);
|
|
6951
6984
|
var multiRangeComponents = [constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
|
|
6952
6985
|
var dateRangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.datePicker];
|
|
6953
|
-
var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch];
|
|
6986
|
+
var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch, constants$1.componentTypes.searchBox];
|
|
6954
6987
|
var listComponentsWithPagination = [constants$1.componentTypes.singleList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.multiDropdownList];
|
|
6955
6988
|
|
|
6956
6989
|
var getNormalizedField = exports.getNormalizedField = function getNormalizedField(field) {
|
|
@@ -7006,7 +7039,7 @@
|
|
|
7006
7039
|
return null;
|
|
7007
7040
|
}
|
|
7008
7041
|
|
|
7009
|
-
return {
|
|
7042
|
+
return _extends({
|
|
7010
7043
|
id: componentId,
|
|
7011
7044
|
type: queryType,
|
|
7012
7045
|
dataField: getNormalizedField(props.dataField),
|
|
@@ -7045,7 +7078,17 @@
|
|
|
7045
7078
|
distinctField: props.distinctField,
|
|
7046
7079
|
distinctFieldConfig: props.distinctFieldConfig,
|
|
7047
7080
|
index: props.index
|
|
7048
|
-
}
|
|
7081
|
+
}, queryType === constants$1.queryTypes.suggestion ? {
|
|
7082
|
+
enablePopularSuggestions: props.enablePopularSuggestions,
|
|
7083
|
+
enableRecentSuggestions: props.enableRecentSuggestions,
|
|
7084
|
+
popularSuggestionsConfig: props.popularSuggestionsConfig,
|
|
7085
|
+
recentSuggestionsConfig: props.recentSuggestionsConfig,
|
|
7086
|
+
applyStopwords: props.applyStopwords,
|
|
7087
|
+
customStopwords: props.customStopwords,
|
|
7088
|
+
enablePredictiveSuggestions: props.enablePredictiveSuggestions
|
|
7089
|
+
} : {}, {
|
|
7090
|
+
calendarInterval: props.calendarInterval
|
|
7091
|
+
});
|
|
7049
7092
|
}
|
|
7050
7093
|
|
|
7051
7094
|
return null;
|
|
@@ -7075,6 +7118,7 @@
|
|
|
7075
7118
|
var calcValues = store.selectedValues[component] || store.internalValues[component];
|
|
7076
7119
|
var value = calcValues !== undefined && calcValues !== null ? calcValues.value : undefined;
|
|
7077
7120
|
var queryFormat = componentProps.queryFormat;
|
|
7121
|
+
var calendarInterval = void 0;
|
|
7078
7122
|
var interval = componentProps.interval;
|
|
7079
7123
|
var type = componentToTypeMap[componentProps.componentType];
|
|
7080
7124
|
var dataField = componentProps.dataField;
|
|
@@ -7143,6 +7187,24 @@
|
|
|
7143
7187
|
aggregations = ['histogram'];
|
|
7144
7188
|
}
|
|
7145
7189
|
|
|
7190
|
+
if (componentProps.componentType === constants$1.componentTypes.dynamicRangeSlider || componentProps.componentType === constants$1.componentTypes.rangeSlider) {
|
|
7191
|
+
calendarInterval = Object.keys(_dateFormats2["default"]).includes(queryFormat) ? componentProps.calendarInterval || 'month' : undefined;
|
|
7192
|
+
|
|
7193
|
+
if (value) {
|
|
7194
|
+
if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
|
|
7195
|
+
value = {
|
|
7196
|
+
start: (0, helper.formatDate)(new _xdate2["default"](value.start), componentProps),
|
|
7197
|
+
end: (0, helper.formatDate)(new _xdate2["default"](value.end), componentProps)
|
|
7198
|
+
};
|
|
7199
|
+
} else {
|
|
7200
|
+
value = {
|
|
7201
|
+
start: parseFloat(value.start),
|
|
7202
|
+
end: parseFloat(value.end)
|
|
7203
|
+
};
|
|
7204
|
+
}
|
|
7205
|
+
}
|
|
7206
|
+
}
|
|
7207
|
+
|
|
7146
7208
|
if (dateRangeComponents.includes(componentProps.componentType)) {
|
|
7147
7209
|
queryFormat = 'or';
|
|
7148
7210
|
|
|
@@ -7265,6 +7327,7 @@
|
|
|
7265
7327
|
}
|
|
7266
7328
|
|
|
7267
7329
|
return _extends({}, componentProps, {
|
|
7330
|
+
calendarInterval: calendarInterval,
|
|
7268
7331
|
dataField: dataField,
|
|
7269
7332
|
queryFormat: queryFormat,
|
|
7270
7333
|
type: type,
|
|
@@ -7275,7 +7338,7 @@
|
|
|
7275
7338
|
defaultQuery: store.defaultQueries ? store.defaultQueries[component] : undefined,
|
|
7276
7339
|
customHighlight: store.customHighlightOptions ? store.customHighlightOptions[component] : undefined,
|
|
7277
7340
|
categoryValue: store.internalValues[component] ? store.internalValues[component].category : undefined,
|
|
7278
|
-
value: value,
|
|
7341
|
+
value: componentProps.componentType === constants$1.componentTypes.searchBox ? value || undefined : value,
|
|
7279
7342
|
pagination: pagination,
|
|
7280
7343
|
from: from
|
|
7281
7344
|
}, customOptions);
|
|
@@ -7311,7 +7374,8 @@
|
|
|
7311
7374
|
var orderOfQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
7312
7375
|
var finalQuery = {};
|
|
7313
7376
|
var react = flatReactProp(store.dependencyTree[componentID], componentID);
|
|
7314
|
-
react.forEach(function (
|
|
7377
|
+
react.forEach(function (componentObject) {
|
|
7378
|
+
var component = componentObject;
|
|
7315
7379
|
var customQuery = store.customQueries[component];
|
|
7316
7380
|
|
|
7317
7381
|
if (!isInternalComponent(component)) {
|
|
@@ -7324,7 +7388,11 @@
|
|
|
7324
7388
|
execute = true;
|
|
7325
7389
|
}
|
|
7326
7390
|
|
|
7327
|
-
var dependentQuery = getRSQuery(component, extractPropsFromState(store, component
|
|
7391
|
+
var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _extends({}, store.props[component].componentType === constants$1.componentTypes.searchBox ? _extends({}, execute === false ? {
|
|
7392
|
+
type: constants$1.queryTypes.search
|
|
7393
|
+
} : {}, calcValues.category ? {
|
|
7394
|
+
categoryValue: calcValues.category
|
|
7395
|
+
} : {}) : {})), execute);
|
|
7328
7396
|
|
|
7329
7397
|
if (dependentQuery) {
|
|
7330
7398
|
finalQuery[component] = dependentQuery;
|
|
@@ -8402,6 +8470,11 @@
|
|
|
8402
8470
|
var value = internalValue && internalValue.value || '';
|
|
8403
8471
|
|
|
8404
8472
|
if (isAppbaseEnabled && (componentProps.enablePopularSuggestions || componentProps.enableQuerySuggestions)) {
|
|
8473
|
+
if (config.mongodb) {
|
|
8474
|
+
dispatch((0, misc.setDefaultPopularSuggestions)([], componentId.split('__internal')[0]));
|
|
8475
|
+
return;
|
|
8476
|
+
}
|
|
8477
|
+
|
|
8405
8478
|
var suggQuery = (0, utils.getSuggestionQuery)(getState, componentId);
|
|
8406
8479
|
appbaseRef.getQuerySuggestions(suggQuery).then(function (suggestions) {
|
|
8407
8480
|
var querySuggestion = suggestions[(0, utils.getQuerySuggestionsId)(componentId)];
|
|
@@ -9132,7 +9205,8 @@
|
|
|
9132
9205
|
protocol = _getState$appbaseRef.protocol,
|
|
9133
9206
|
credentials = _getState$appbaseRef.credentials;
|
|
9134
9207
|
|
|
9135
|
-
var app = config.app
|
|
9208
|
+
var app = config.app,
|
|
9209
|
+
mongodb = config.mongodb;
|
|
9136
9210
|
var esURL = protocol + '://' + url;
|
|
9137
9211
|
var parsedURL = (esURL || '').replace(/\/+$/, '');
|
|
9138
9212
|
var requestOptions = {
|
|
@@ -9179,7 +9253,14 @@
|
|
|
9179
9253
|
}
|
|
9180
9254
|
}
|
|
9181
9255
|
|
|
9182
|
-
|
|
9256
|
+
if (mongodb) {
|
|
9257
|
+
return dispatch({
|
|
9258
|
+
type: constants.RECENT_SEARCHES_SUCCESS,
|
|
9259
|
+
data: []
|
|
9260
|
+
});
|
|
9261
|
+
}
|
|
9262
|
+
|
|
9263
|
+
return fetch(parsedURL + '/_analytics/' + app + '/recent-searches?' + queryString, requestOptions).then(function (res) {
|
|
9183
9264
|
if (res.status >= 500 || res.status >= 400) {
|
|
9184
9265
|
return dispatch({
|
|
9185
9266
|
type: constants.RECENT_SEARCHES_ERROR,
|
|
@@ -12811,7 +12892,11 @@
|
|
|
12811
12892
|
userId: VueTypes.string,
|
|
12812
12893
|
customEvents: VueTypes.object,
|
|
12813
12894
|
enableTelemetry: VueTypes.bool.def(true)
|
|
12814
|
-
}).def({})
|
|
12895
|
+
}).def({}),
|
|
12896
|
+
mongodb: VueTypes.shape({
|
|
12897
|
+
db: VueTypes.string,
|
|
12898
|
+
collection: VueTypes.string
|
|
12899
|
+
})
|
|
12815
12900
|
};
|
|
12816
12901
|
|
|
12817
12902
|
var getClassName = lib_8.getClassName,
|
|
@@ -13962,9 +14047,14 @@
|
|
|
13962
14047
|
}
|
|
13963
14048
|
|
|
13964
14049
|
this.internalComponent = this.$props.componentId + "__internal";
|
|
13965
|
-
this.sortOptionIndex =
|
|
13966
|
-
|
|
13967
|
-
|
|
14050
|
+
this.sortOptionIndex = 0;
|
|
14051
|
+
|
|
14052
|
+
if (this.defaultSortOption && this.sortOptions && Array.isArray(this.sortOptions)) {
|
|
14053
|
+
this.sortOptionIndex = this.sortOptions.findIndex(function (s) {
|
|
14054
|
+
return s.label === _this.defaultSortOption;
|
|
14055
|
+
});
|
|
14056
|
+
}
|
|
14057
|
+
|
|
13968
14058
|
this.updateComponentProps(this.componentId, {
|
|
13969
14059
|
from: this.from
|
|
13970
14060
|
}, constants_1$1.reactiveList);
|
|
@@ -13974,7 +14064,7 @@
|
|
|
13974
14064
|
},
|
|
13975
14065
|
props: {
|
|
13976
14066
|
currentPage: VueTypes.number.def(0),
|
|
13977
|
-
includeFields: types.includeFields
|
|
14067
|
+
includeFields: types.includeFields,
|
|
13978
14068
|
// component props
|
|
13979
14069
|
className: types.string,
|
|
13980
14070
|
componentId: types.stringRequired,
|
|
@@ -13983,7 +14073,7 @@
|
|
|
13983
14073
|
aggregationSize: VueTypes.number,
|
|
13984
14074
|
defaultQuery: types.func,
|
|
13985
14075
|
defaultSortOption: types.string,
|
|
13986
|
-
excludeFields: types.excludeFields
|
|
14076
|
+
excludeFields: types.excludeFields,
|
|
13987
14077
|
innerClass: types.style,
|
|
13988
14078
|
listClass: VueTypes.string.def(''),
|
|
13989
14079
|
loader: types.title,
|
|
@@ -13995,7 +14085,7 @@
|
|
|
13995
14085
|
pages: VueTypes.number.def(5),
|
|
13996
14086
|
pagination: VueTypes.bool.def(false),
|
|
13997
14087
|
infiniteScroll: VueTypes.bool.def(true),
|
|
13998
|
-
paginationAt:
|
|
14088
|
+
paginationAt: VueTypes.oneOf(['top', 'bottom', 'both']).def('bottom'),
|
|
13999
14089
|
react: types.react,
|
|
14000
14090
|
scrollOnChange: VueTypes.bool.def(true),
|
|
14001
14091
|
showResultStats: VueTypes.bool.def(true),
|
|
@@ -14196,11 +14286,11 @@
|
|
|
14196
14286
|
var options = getQueryOptions(this.$props);
|
|
14197
14287
|
options.from = this.$data.from;
|
|
14198
14288
|
|
|
14199
|
-
if (this
|
|
14289
|
+
if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
|
|
14200
14290
|
var _ref2;
|
|
14201
14291
|
|
|
14202
|
-
var sortField = this
|
|
14203
|
-
var sortBy = this
|
|
14292
|
+
var sortField = this.sortOptions[this.sortOptionIndex].dataField;
|
|
14293
|
+
var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
|
|
14204
14294
|
options.sort = [(_ref2 = {}, _ref2[sortField] = {
|
|
14205
14295
|
order: sortBy
|
|
14206
14296
|
}, _ref2)]; // To handle sort options for RS API
|
|
@@ -14270,10 +14360,10 @@
|
|
|
14270
14360
|
"class": this.$props.className
|
|
14271
14361
|
}, [this.isLoading && this.shouldRenderPagination && this.showInfiniteScroll && (this.$scopedSlots.loader || this.$props.loader), this.renderErrorComponent(), h(Flex, {
|
|
14272
14362
|
"attrs": {
|
|
14273
|
-
"labelPosition": this
|
|
14363
|
+
"labelPosition": this.sortOptions ? 'right' : 'left'
|
|
14274
14364
|
},
|
|
14275
14365
|
"class": getClassName$1(this.$props.innerClass, 'resultsInfo')
|
|
14276
|
-
}, [this
|
|
14366
|
+
}, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && results.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
|
|
14277
14367
|
"attrs": {
|
|
14278
14368
|
"pages": this.$props.pages,
|
|
14279
14369
|
"totalPages": this.totalPages,
|
|
@@ -14344,15 +14434,18 @@
|
|
|
14344
14434
|
var options = getQueryOptions(props);
|
|
14345
14435
|
options.from = this.$data.from;
|
|
14346
14436
|
|
|
14347
|
-
if (props.sortOptions) {
|
|
14348
|
-
var _ref5;
|
|
14349
|
-
|
|
14437
|
+
if (props.sortOptions && Array.isArray(props.sortOptions)) {
|
|
14350
14438
|
var sortOptionIndex = props.defaultSortOption ? props.sortOptions.findIndex(function (s) {
|
|
14351
14439
|
return s.label === props.defaultSortOption;
|
|
14352
14440
|
}) : 0;
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14441
|
+
|
|
14442
|
+
if (props.sortOptions[sortOptionIndex]) {
|
|
14443
|
+
var _ref5;
|
|
14444
|
+
|
|
14445
|
+
options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
|
|
14446
|
+
order: props.sortOptions[sortOptionIndex].sortBy
|
|
14447
|
+
}, _ref5)];
|
|
14448
|
+
}
|
|
14356
14449
|
} else if (props.sortBy) {
|
|
14357
14450
|
var _ref6;
|
|
14358
14451
|
|
|
@@ -14448,31 +14541,39 @@
|
|
|
14448
14541
|
renderNoResult: function renderNoResult() {
|
|
14449
14542
|
var h = this.$createElement;
|
|
14450
14543
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
14544
|
+
|
|
14545
|
+
if (this.$scopedSlots.renderNoResults) {
|
|
14546
|
+
return isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults;
|
|
14547
|
+
}
|
|
14548
|
+
|
|
14451
14549
|
return h("p", {
|
|
14452
14550
|
"class": getClassName$1(this.$props.innerClass, 'noResults') || null
|
|
14453
14551
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
14454
14552
|
},
|
|
14455
14553
|
handleSortChange: function handleSortChange(e) {
|
|
14456
|
-
var
|
|
14554
|
+
var index = e.target.value;
|
|
14457
14555
|
|
|
14458
|
-
|
|
14556
|
+
if (this.sortOptions && this.sortOptions[index]) {
|
|
14557
|
+
var _ref7;
|
|
14459
14558
|
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14559
|
+
// This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
|
|
14560
|
+
var options = getQueryOptions(this.$props);
|
|
14561
|
+
options.from = 0;
|
|
14562
|
+
var sortField = this.sortOptions[index].dataField;
|
|
14563
|
+
var sortBy = this.sortOptions[index].sortBy;
|
|
14564
|
+
options.sort = [(_ref7 = {}, _ref7[sortField] = {
|
|
14565
|
+
order: sortBy
|
|
14566
|
+
}, _ref7)];
|
|
14567
|
+
this.sortOptionIndex = index; // To handle sort options for RS API
|
|
14568
|
+
|
|
14569
|
+
this.updateComponentProps(this.componentId, {
|
|
14570
|
+
dataField: sortField,
|
|
14571
|
+
sortBy: sortBy
|
|
14572
|
+
}, constants_1$1.reactiveList);
|
|
14573
|
+
this.setQueryOptions(this.$props.componentId, options, true);
|
|
14574
|
+
this.currentPageState = 0;
|
|
14575
|
+
this.from = 0;
|
|
14576
|
+
}
|
|
14476
14577
|
},
|
|
14477
14578
|
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
14478
14579
|
var docId = documentId;
|
|
@@ -14506,7 +14607,7 @@
|
|
|
14506
14607
|
"domProps": {
|
|
14507
14608
|
"value": this.sortOptionIndex
|
|
14508
14609
|
}
|
|
14509
|
-
}, [this
|
|
14610
|
+
}, [this.sortOptions.map(function (sort, index) {
|
|
14510
14611
|
return h("option", {
|
|
14511
14612
|
"key": sort.label,
|
|
14512
14613
|
"domProps": {
|
|
@@ -14612,11 +14713,7 @@
|
|
|
14612
14713
|
}; // Only used for SSR
|
|
14613
14714
|
|
|
14614
14715
|
ReactiveList.generateQueryOptions = function (props) {
|
|
14615
|
-
|
|
14616
|
-
var options = getQueryOptions(_extends({
|
|
14617
|
-
includeFields: ['*'],
|
|
14618
|
-
excludeFields: []
|
|
14619
|
-
}, props));
|
|
14716
|
+
var options = getQueryOptions(props);
|
|
14620
14717
|
var size = props.size,
|
|
14621
14718
|
dataField = props.dataField,
|
|
14622
14719
|
defaultSortOption = props.defaultSortOption,
|
|
@@ -15436,8 +15533,33 @@
|
|
|
15436
15533
|
return encodedHeaders;
|
|
15437
15534
|
}
|
|
15438
15535
|
|
|
15439
|
-
function
|
|
15536
|
+
function getMongoRequest(app, mongo) {
|
|
15537
|
+
var mongodb = {};
|
|
15538
|
+
|
|
15539
|
+
if (app) {
|
|
15540
|
+
mongodb.index = app;
|
|
15541
|
+
}
|
|
15542
|
+
|
|
15543
|
+
if (mongo) {
|
|
15544
|
+
if (mongo.db) {
|
|
15545
|
+
mongodb.db = mongo.db;
|
|
15546
|
+
}
|
|
15547
|
+
|
|
15548
|
+
if (mongo.collection) {
|
|
15549
|
+
mongodb.collection = mongo.collection;
|
|
15550
|
+
}
|
|
15551
|
+
}
|
|
15552
|
+
|
|
15553
|
+
return mongodb;
|
|
15554
|
+
}
|
|
15555
|
+
|
|
15556
|
+
function getTelemetryHeaders(enableTelemetry, shouldSetHeaders) {
|
|
15440
15557
|
var headers = {};
|
|
15558
|
+
|
|
15559
|
+
if (!shouldSetHeaders) {
|
|
15560
|
+
return headers;
|
|
15561
|
+
}
|
|
15562
|
+
|
|
15441
15563
|
Object.assign(headers, {
|
|
15442
15564
|
'X-Search-Client': 'Appbase JS'
|
|
15443
15565
|
});
|
|
@@ -15450,6 +15572,133 @@
|
|
|
15450
15572
|
|
|
15451
15573
|
return headers;
|
|
15452
15574
|
}
|
|
15575
|
+
|
|
15576
|
+
var backendAlias = {
|
|
15577
|
+
MONGODB: 'mongodb',
|
|
15578
|
+
// mongodb
|
|
15579
|
+
ELASTICSEARCH: 'elasticsearch' // elasticsearch
|
|
15580
|
+
|
|
15581
|
+
};
|
|
15582
|
+
var dataTypes = {
|
|
15583
|
+
ARRAY: 'array',
|
|
15584
|
+
FUNCTION: 'function',
|
|
15585
|
+
OBJECT: 'object',
|
|
15586
|
+
NUMBER: 'number',
|
|
15587
|
+
BOOLEAN: 'boolean',
|
|
15588
|
+
STRING: 'string'
|
|
15589
|
+
};
|
|
15590
|
+
|
|
15591
|
+
var checkDataType = function checkDataType(temp) {
|
|
15592
|
+
// eslint-disable-next-line
|
|
15593
|
+
if ((typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp)) === dataTypes.OBJECT) {
|
|
15594
|
+
if (Array.isArray(temp)) {
|
|
15595
|
+
return dataTypes.ARRAY;
|
|
15596
|
+
}
|
|
15597
|
+
|
|
15598
|
+
return dataTypes.OBJECT;
|
|
15599
|
+
}
|
|
15600
|
+
|
|
15601
|
+
return typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp);
|
|
15602
|
+
};
|
|
15603
|
+
|
|
15604
|
+
function validateSchema() {
|
|
15605
|
+
var passedProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15606
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15607
|
+
var backendName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
15608
|
+
var passedPropertiesKeys = Object.keys(passedProperties).filter(function (propertyKey) {
|
|
15609
|
+
return !!passedProperties[propertyKey];
|
|
15610
|
+
});
|
|
15611
|
+
var acceptedProperties = Object.keys(schema);
|
|
15612
|
+
var requiredProperties = []; // fetch required properties
|
|
15613
|
+
|
|
15614
|
+
acceptedProperties.forEach(function (propName) {
|
|
15615
|
+
var currentProperty = schema[propName];
|
|
15616
|
+
|
|
15617
|
+
if (currentProperty.required) {
|
|
15618
|
+
requiredProperties.push(propName);
|
|
15619
|
+
}
|
|
15620
|
+
}); // check for required properties
|
|
15621
|
+
|
|
15622
|
+
requiredProperties.forEach(function (requiredProperty) {
|
|
15623
|
+
if (!passedPropertiesKeys.includes(requiredProperty)) {
|
|
15624
|
+
throw new Error(requiredProperty + ' is required when using the ' + backendName + ' Search backend.');
|
|
15625
|
+
}
|
|
15626
|
+
}); // check for accepted properties
|
|
15627
|
+
|
|
15628
|
+
passedPropertiesKeys.forEach(function (passedPropertyKey) {
|
|
15629
|
+
if (!acceptedProperties.includes(passedPropertyKey)) {
|
|
15630
|
+
throw new Error(passedPropertyKey + ' property isn\'t accepted property by ' + backendName + ' backend.');
|
|
15631
|
+
}
|
|
15632
|
+
|
|
15633
|
+
var acceptedTypes = Array.isArray(schema[passedPropertyKey].type) ? schema[passedPropertyKey].type : [].concat(schema[passedPropertyKey].type);
|
|
15634
|
+
var receivedPropertyType = checkDataType(passedProperties[passedPropertyKey]);
|
|
15635
|
+
|
|
15636
|
+
if (!acceptedTypes.includes(receivedPropertyType)) {
|
|
15637
|
+
throw new Error('The property ' + passedPropertyKey + ' is expected with type(s) [' + acceptedTypes.join(', ') + '], but type was set as ' + receivedPropertyType + '.');
|
|
15638
|
+
}
|
|
15639
|
+
});
|
|
15640
|
+
}
|
|
15641
|
+
|
|
15642
|
+
var mongodb = {
|
|
15643
|
+
url: {
|
|
15644
|
+
type: dataTypes.STRING,
|
|
15645
|
+
required: true
|
|
15646
|
+
},
|
|
15647
|
+
app: {
|
|
15648
|
+
type: dataTypes.STRING,
|
|
15649
|
+
required: false
|
|
15650
|
+
},
|
|
15651
|
+
credentials: {
|
|
15652
|
+
type: dataTypes.STRING,
|
|
15653
|
+
required: false
|
|
15654
|
+
},
|
|
15655
|
+
enableTelemetry: {
|
|
15656
|
+
type: dataTypes.BOOLEAN,
|
|
15657
|
+
required: false
|
|
15658
|
+
},
|
|
15659
|
+
mongodb: {
|
|
15660
|
+
type: dataTypes.OBJECT,
|
|
15661
|
+
required: true
|
|
15662
|
+
},
|
|
15663
|
+
username: {
|
|
15664
|
+
type: dataTypes.STRING,
|
|
15665
|
+
required: false
|
|
15666
|
+
},
|
|
15667
|
+
password: {
|
|
15668
|
+
type: dataTypes.STRING,
|
|
15669
|
+
required: false
|
|
15670
|
+
}
|
|
15671
|
+
};
|
|
15672
|
+
var elasticsearch = {
|
|
15673
|
+
url: {
|
|
15674
|
+
type: dataTypes.STRING,
|
|
15675
|
+
required: true
|
|
15676
|
+
},
|
|
15677
|
+
app: {
|
|
15678
|
+
type: dataTypes.STRING,
|
|
15679
|
+
required: true
|
|
15680
|
+
},
|
|
15681
|
+
credentials: {
|
|
15682
|
+
type: dataTypes.STRING,
|
|
15683
|
+
required: false
|
|
15684
|
+
},
|
|
15685
|
+
enableTelemetry: {
|
|
15686
|
+
type: dataTypes.BOOLEAN,
|
|
15687
|
+
required: false
|
|
15688
|
+
},
|
|
15689
|
+
username: {
|
|
15690
|
+
type: dataTypes.STRING,
|
|
15691
|
+
required: false
|
|
15692
|
+
},
|
|
15693
|
+
password: {
|
|
15694
|
+
type: dataTypes.STRING,
|
|
15695
|
+
required: false
|
|
15696
|
+
}
|
|
15697
|
+
};
|
|
15698
|
+
var SCHEMA = {
|
|
15699
|
+
mongodb: mongodb,
|
|
15700
|
+
elasticsearch: elasticsearch
|
|
15701
|
+
};
|
|
15453
15702
|
/**
|
|
15454
15703
|
* Returns an instance of Appbase client
|
|
15455
15704
|
* @param {Object} config To configure properties
|
|
@@ -15459,10 +15708,10 @@
|
|
|
15459
15708
|
* @param {String} config.username
|
|
15460
15709
|
* @param {String} config.password
|
|
15461
15710
|
* @param {Boolean} config.enableTelemetry
|
|
15711
|
+
* @param {Object} config.mongodb
|
|
15462
15712
|
* A callback function which will be invoked before a fetch request made
|
|
15463
15713
|
*/
|
|
15464
15714
|
|
|
15465
|
-
|
|
15466
15715
|
function AppBase(config) {
|
|
15467
15716
|
var _URL = urlParserLite(config.url || ''),
|
|
15468
15717
|
_URL$auth = _URL.auth,
|
|
@@ -15474,30 +15723,42 @@
|
|
|
15474
15723
|
_URL$protocol = _URL.protocol,
|
|
15475
15724
|
protocol = _URL$protocol === undefined ? '' : _URL$protocol;
|
|
15476
15725
|
|
|
15477
|
-
var url =
|
|
15726
|
+
var url = config.url;
|
|
15727
|
+
url = host + path; // Parse url
|
|
15478
15728
|
|
|
15479
|
-
if (
|
|
15480
|
-
|
|
15729
|
+
if (url.slice(-1) === '/') {
|
|
15730
|
+
url = url.slice(0, -1);
|
|
15481
15731
|
}
|
|
15482
15732
|
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15733
|
+
var backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH']; // eslint-disable-next-line
|
|
15734
|
+
|
|
15735
|
+
var schema = SCHEMA[backendName];
|
|
15736
|
+
validateSchema({
|
|
15737
|
+
url: config.url,
|
|
15738
|
+
app: config.app,
|
|
15739
|
+
credentials: config.credentials,
|
|
15740
|
+
username: config.username,
|
|
15741
|
+
password: config.password,
|
|
15742
|
+
enableTelemetry: config.enableTelemetry,
|
|
15743
|
+
mongodb: config.mongodb
|
|
15744
|
+
}, schema, backendName);
|
|
15486
15745
|
|
|
15487
15746
|
if (typeof protocol !== 'string' || protocol === '') {
|
|
15488
15747
|
throw new Error('Protocol is not present in url. URL should be of the form https://appbase-demo-ansible-abxiydt-arc.searchbase.io');
|
|
15489
|
-
} // Parse url
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
if (url.slice(-1) === '/') {
|
|
15493
|
-
url = url.slice(0, -1);
|
|
15494
15748
|
}
|
|
15495
15749
|
|
|
15496
15750
|
var credentials = auth || null;
|
|
15751
|
+
|
|
15752
|
+
if (!config.mongodb) {
|
|
15753
|
+
if (isAppbase(url) && credentials === null) {
|
|
15754
|
+
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15755
|
+
}
|
|
15756
|
+
}
|
|
15497
15757
|
/**
|
|
15498
15758
|
* Credentials can be provided as a part of the URL,
|
|
15499
15759
|
* as username, password args or as a credentials argument directly */
|
|
15500
15760
|
|
|
15761
|
+
|
|
15501
15762
|
if (typeof config.credentials === 'string' && config.credentials !== '') {
|
|
15502
15763
|
// eslint-disable-next-line
|
|
15503
15764
|
credentials = config.credentials;
|
|
@@ -15505,15 +15766,15 @@
|
|
|
15505
15766
|
credentials = config.username + ':' + config.password;
|
|
15506
15767
|
}
|
|
15507
15768
|
|
|
15508
|
-
if (isAppbase(url) && credentials === null) {
|
|
15509
|
-
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15510
|
-
}
|
|
15511
|
-
|
|
15512
15769
|
this.url = url;
|
|
15513
15770
|
this.protocol = protocol;
|
|
15514
15771
|
this.app = config.app;
|
|
15515
15772
|
this.credentials = credentials;
|
|
15516
15773
|
|
|
15774
|
+
if (config.mongodb) {
|
|
15775
|
+
this.mongodb = config.mongodb;
|
|
15776
|
+
}
|
|
15777
|
+
|
|
15517
15778
|
if (typeof config.enableTelemetry === 'boolean') {
|
|
15518
15779
|
this.enableTelemetry = config.enableTelemetry;
|
|
15519
15780
|
}
|
|
@@ -15542,7 +15803,9 @@
|
|
|
15542
15803
|
params = parsedArgs.params,
|
|
15543
15804
|
body = parsedArgs.body,
|
|
15544
15805
|
isRSAPI = parsedArgs.isRSAPI,
|
|
15545
|
-
isSuggestionsAPI = parsedArgs.isSuggestionsAPI
|
|
15806
|
+
isSuggestionsAPI = parsedArgs.isSuggestionsAPI,
|
|
15807
|
+
_parsedArgs$isMongoRe = parsedArgs.isMongoRequest,
|
|
15808
|
+
isMongoRequest = _parsedArgs$isMongoRe === undefined ? false : _parsedArgs$isMongoRe;
|
|
15546
15809
|
var app = isSuggestionsAPI ? '.suggestions' : _this.app;
|
|
15547
15810
|
var bodyCopy = body;
|
|
15548
15811
|
var contentType = path.endsWith('msearch') || path.endsWith('bulk') ? 'application/x-ndjson' : 'application/json';
|
|
@@ -15593,7 +15856,7 @@
|
|
|
15593
15856
|
paramsString = '?' + querystring.stringify(params);
|
|
15594
15857
|
}
|
|
15595
15858
|
|
|
15596
|
-
var finalURL = _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15859
|
+
var finalURL = isMongoRequest ? _this.protocol + '://' + _this.url : _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15597
15860
|
return handleTransformRequest(Object.assign({}, {
|
|
15598
15861
|
url: finalURL
|
|
15599
15862
|
}, requestOptions)).then(function (ts) {
|
|
@@ -15602,7 +15865,7 @@
|
|
|
15602
15865
|
delete transformedRequest.url;
|
|
15603
15866
|
return browserPonyfill$1(url || finalURL, Object.assign({}, transformedRequest, {
|
|
15604
15867
|
// apply timestamp header for RS API
|
|
15605
|
-
headers: isRSAPI ? Object.assign({}, transformedRequest.headers, {
|
|
15868
|
+
headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
|
|
15606
15869
|
'x-timestamp': new Date().getTime()
|
|
15607
15870
|
}) : transformedRequest.headers
|
|
15608
15871
|
})).then(function (res) {
|
|
@@ -15630,7 +15893,7 @@
|
|
|
15630
15893
|
|
|
15631
15894
|
if (data) {
|
|
15632
15895
|
Object.keys(data).forEach(function (key) {
|
|
15633
|
-
if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error')) {
|
|
15896
|
+
if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error') && !!data[key].error) {
|
|
15634
15897
|
errorResponses += 1;
|
|
15635
15898
|
}
|
|
15636
15899
|
});
|
|
@@ -15967,12 +16230,20 @@
|
|
|
15967
16230
|
settings: parsedSettings,
|
|
15968
16231
|
query: query
|
|
15969
16232
|
};
|
|
16233
|
+
|
|
16234
|
+
if (this.mongodb) {
|
|
16235
|
+
Object.assign(body, {
|
|
16236
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16237
|
+
});
|
|
16238
|
+
}
|
|
16239
|
+
|
|
15970
16240
|
return this.performFetchRequest({
|
|
15971
16241
|
method: 'POST',
|
|
15972
16242
|
path: '_reactivesearch',
|
|
15973
16243
|
body: body,
|
|
15974
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
15975
|
-
isRSAPI: true
|
|
16244
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16245
|
+
isRSAPI: true,
|
|
16246
|
+
isMongoRequest: !!this.mongodb
|
|
15976
16247
|
});
|
|
15977
16248
|
}
|
|
15978
16249
|
/**
|
|
@@ -15999,12 +16270,20 @@
|
|
|
15999
16270
|
settings: parsedSettings,
|
|
16000
16271
|
query: query
|
|
16001
16272
|
};
|
|
16273
|
+
|
|
16274
|
+
if (this.mongodb) {
|
|
16275
|
+
Object.assign(body, {
|
|
16276
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16277
|
+
});
|
|
16278
|
+
}
|
|
16279
|
+
|
|
16002
16280
|
return this.performFetchRequest({
|
|
16003
16281
|
method: 'POST',
|
|
16004
16282
|
path: '_reactivesearch.v3',
|
|
16005
16283
|
body: body,
|
|
16006
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16007
|
-
isRSAPI: true
|
|
16284
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16285
|
+
isRSAPI: true,
|
|
16286
|
+
isMongoRequest: !!this.mongodb
|
|
16008
16287
|
});
|
|
16009
16288
|
}
|
|
16010
16289
|
/**
|
|
@@ -16042,13 +16321,21 @@
|
|
|
16042
16321
|
settings: parsedSettings,
|
|
16043
16322
|
query: query
|
|
16044
16323
|
};
|
|
16324
|
+
|
|
16325
|
+
if (this.mongodb) {
|
|
16326
|
+
Object.assign(body, {
|
|
16327
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16328
|
+
});
|
|
16329
|
+
}
|
|
16330
|
+
|
|
16045
16331
|
return this.performFetchRequest({
|
|
16046
16332
|
method: 'POST',
|
|
16047
16333
|
path: '_reactivesearch.v3',
|
|
16048
16334
|
body: body,
|
|
16049
16335
|
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16050
16336
|
isRSAPI: true,
|
|
16051
|
-
isSuggestionsAPI: true
|
|
16337
|
+
isSuggestionsAPI: true,
|
|
16338
|
+
isMongoRequest: !!this.mongodb
|
|
16052
16339
|
});
|
|
16053
16340
|
}
|
|
16054
16341
|
|
|
@@ -16508,7 +16795,7 @@
|
|
|
16508
16795
|
headers: types.headers,
|
|
16509
16796
|
getSearchParams: types.func,
|
|
16510
16797
|
setSearchParams: types.func,
|
|
16511
|
-
as:
|
|
16798
|
+
as: VueTypes.string.def('div')
|
|
16512
16799
|
},
|
|
16513
16800
|
mounted: function mounted() {
|
|
16514
16801
|
var _this = this;
|
|
@@ -16656,7 +16943,9 @@
|
|
|
16656
16943
|
return value.map(function (item) {
|
|
16657
16944
|
return _this3.getValue(item);
|
|
16658
16945
|
});
|
|
16659
|
-
}
|
|
16946
|
+
}
|
|
16947
|
+
|
|
16948
|
+
if (value && typeof value === 'object') {
|
|
16660
16949
|
// TODO: support for NestedList
|
|
16661
16950
|
if (value.location) return value;
|
|
16662
16951
|
if (value.category) return value;
|
|
@@ -16781,7 +17070,7 @@
|
|
|
16781
17070
|
}
|
|
16782
17071
|
},
|
|
16783
17072
|
props: {
|
|
16784
|
-
app: types.
|
|
17073
|
+
app: types.string,
|
|
16785
17074
|
analytics: VueTypes.bool,
|
|
16786
17075
|
analyticsConfig: types.analyticsConfig,
|
|
16787
17076
|
appbaseConfig: types.appbaseConfig,
|
|
@@ -16801,7 +17090,8 @@
|
|
|
16801
17090
|
transformResponse: types.func,
|
|
16802
17091
|
as: VueTypes.string.def('div'),
|
|
16803
17092
|
getSearchParams: types.func,
|
|
16804
|
-
setSearchParams: types.func
|
|
17093
|
+
setSearchParams: types.func,
|
|
17094
|
+
mongodb: types.mongodb
|
|
16805
17095
|
},
|
|
16806
17096
|
provide: function provide() {
|
|
16807
17097
|
return {
|
|
@@ -16841,6 +17131,9 @@
|
|
|
16841
17131
|
this.store.dispatch(analytics_3$1(newVal));
|
|
16842
17132
|
}
|
|
16843
17133
|
}
|
|
17134
|
+
},
|
|
17135
|
+
mongodb: function mongodb() {
|
|
17136
|
+
this.updateState(this.$props);
|
|
16844
17137
|
}
|
|
16845
17138
|
},
|
|
16846
17139
|
computed: {
|
|
@@ -16848,12 +17141,13 @@
|
|
|
16848
17141
|
var _this$$props = this.$props,
|
|
16849
17142
|
enableAppbase = _this$$props.enableAppbase,
|
|
16850
17143
|
headers = _this$$props.headers,
|
|
16851
|
-
appbaseConfig = _this$$props.appbaseConfig
|
|
17144
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
17145
|
+
mongodb = _this$$props.mongodb;
|
|
16852
17146
|
|
|
16853
17147
|
var _ref = appbaseConfig || {},
|
|
16854
17148
|
enableTelemetry = _ref.enableTelemetry;
|
|
16855
17149
|
|
|
16856
|
-
return _extends({}, enableAppbase && _extends({
|
|
17150
|
+
return _extends({}, enableAppbase && !mongodb && _extends({
|
|
16857
17151
|
'X-Search-Client': X_SEARCH_CLIENT
|
|
16858
17152
|
}, enableTelemetry === false && {
|
|
16859
17153
|
'X-Enable-Telemetry': false
|
|
@@ -16871,7 +17165,7 @@
|
|
|
16871
17165
|
var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
16872
17166
|
|
|
16873
17167
|
var config = {
|
|
16874
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
17168
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
16875
17169
|
app: props.app,
|
|
16876
17170
|
credentials: credentials,
|
|
16877
17171
|
type: props.type ? props.type : '*',
|
|
@@ -16879,7 +17173,8 @@
|
|
|
16879
17173
|
transformResponse: props.transformResponse,
|
|
16880
17174
|
enableAppbase: props.enableAppbase,
|
|
16881
17175
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
16882
|
-
analyticsConfig: appbaseConfig
|
|
17176
|
+
analyticsConfig: appbaseConfig,
|
|
17177
|
+
mongodb: props.mongodb
|
|
16883
17178
|
};
|
|
16884
17179
|
var queryParams = '';
|
|
16885
17180
|
|
|
@@ -18261,24 +18556,22 @@
|
|
|
18261
18556
|
|
|
18262
18557
|
return __webpack_require__(0);
|
|
18263
18558
|
/******/
|
|
18264
|
-
}
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
/***/
|
|
18268
|
-
|
|
18269
|
-
/* 1 */
|
|
18270
|
-
|
|
18271
|
-
/***/
|
|
18272
|
-
|
|
18273
|
-
/* 2 */
|
|
18559
|
+
}
|
|
18560
|
+
/************************************************************************/
|
|
18274
18561
|
|
|
18275
|
-
|
|
18562
|
+
/******/
|
|
18563
|
+
([
|
|
18564
|
+
/* 0 */
|
|
18276
18565
|
|
|
18277
|
-
|
|
18566
|
+
/***/
|
|
18278
18567
|
function (module, exports, __webpack_require__) {
|
|
18279
18568
|
module.exports = __webpack_require__(1);
|
|
18280
18569
|
/***/
|
|
18281
|
-
},
|
|
18570
|
+
},
|
|
18571
|
+
/* 1 */
|
|
18572
|
+
|
|
18573
|
+
/***/
|
|
18574
|
+
function (module, exports, __webpack_require__) {
|
|
18282
18575
|
|
|
18283
18576
|
Object.defineProperty(exports, "__esModule", {
|
|
18284
18577
|
value: true
|
|
@@ -18311,7 +18604,11 @@
|
|
|
18311
18604
|
}
|
|
18312
18605
|
});
|
|
18313
18606
|
/***/
|
|
18314
|
-
},
|
|
18607
|
+
},
|
|
18608
|
+
/* 2 */
|
|
18609
|
+
|
|
18610
|
+
/***/
|
|
18611
|
+
function (module, exports) {
|
|
18315
18612
|
|
|
18316
18613
|
Object.defineProperty(exports, "__esModule", {
|
|
18317
18614
|
value: true
|
|
@@ -18480,7 +18777,9 @@
|
|
|
18480
18777
|
}
|
|
18481
18778
|
/***/
|
|
18482
18779
|
|
|
18483
|
-
}
|
|
18780
|
+
}
|
|
18781
|
+
/******/
|
|
18782
|
+
]);
|
|
18484
18783
|
});
|
|
18485
18784
|
unwrapExports(dist);
|
|
18486
18785
|
var dist_1 = dist.findAll;
|
|
@@ -19210,8 +19509,8 @@
|
|
|
19210
19509
|
name: 'Mic',
|
|
19211
19510
|
props: {
|
|
19212
19511
|
children: types.title,
|
|
19213
|
-
lang:
|
|
19214
|
-
iconPosition:
|
|
19512
|
+
lang: VueTypes.string.def('en-US'),
|
|
19513
|
+
iconPosition: VueTypes.string.def('left'),
|
|
19215
19514
|
handleResult: types.func,
|
|
19216
19515
|
onNoMatch: types.func,
|
|
19217
19516
|
onError: types.func,
|
|
@@ -19623,10 +19922,10 @@
|
|
|
19623
19922
|
})]),
|
|
19624
19923
|
aggregationField: types.string,
|
|
19625
19924
|
aggregationSize: VueTypes.number,
|
|
19626
|
-
size: VueTypes.number
|
|
19925
|
+
size: VueTypes.number,
|
|
19627
19926
|
debounce: VueTypes.number.def(0),
|
|
19628
19927
|
defaultValue: types.string,
|
|
19629
|
-
excludeFields: types.excludeFields
|
|
19928
|
+
excludeFields: types.excludeFields,
|
|
19630
19929
|
value: types.value,
|
|
19631
19930
|
defaultSuggestions: types.suggestions,
|
|
19632
19931
|
enableSynonyms: VueTypes.bool.def(true),
|
|
@@ -19640,9 +19939,9 @@
|
|
|
19640
19939
|
highlightField: types.stringOrArray,
|
|
19641
19940
|
icon: types.children,
|
|
19642
19941
|
iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
|
|
19643
|
-
includeFields: types.includeFields
|
|
19942
|
+
includeFields: types.includeFields,
|
|
19644
19943
|
innerClass: types.style,
|
|
19645
|
-
innerRef:
|
|
19944
|
+
innerRef: VueTypes.string.def('searchInputField'),
|
|
19646
19945
|
render: types.func,
|
|
19647
19946
|
renderQuerySuggestions: types.func,
|
|
19648
19947
|
renderPopularSuggestions: types.func,
|
|
@@ -19674,7 +19973,7 @@
|
|
|
19674
19973
|
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
19675
19974
|
addonBefore: VueTypes.any,
|
|
19676
19975
|
addonAfter: VueTypes.any,
|
|
19677
|
-
expandSuggestionsContainer:
|
|
19976
|
+
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
19678
19977
|
index: VueTypes.string
|
|
19679
19978
|
},
|
|
19680
19979
|
beforeMount: function beforeMount() {
|
|
@@ -20335,7 +20634,7 @@
|
|
|
20335
20634
|
highlightedIndex: highlightedIndex
|
|
20336
20635
|
}), _this3.renderErrorComponent(), !_this3.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
20337
20636
|
"class": suggestions$1(_this3.themePreset, theme) + " " + getClassName$3(_this3.$props.innerClass, 'list')
|
|
20338
|
-
}, [_this3.suggestionsList.slice(0, size).map(function (item, index) {
|
|
20637
|
+
}, [_this3.suggestionsList.slice(0, size || 10).map(function (item, index) {
|
|
20339
20638
|
return h("li", {
|
|
20340
20639
|
"domProps": _extends({}, getItemProps({
|
|
20341
20640
|
item: item
|
|
@@ -20814,7 +21113,7 @@
|
|
|
20814
21113
|
name: 'SingleList',
|
|
20815
21114
|
props: {
|
|
20816
21115
|
beforeValueChange: types.func,
|
|
20817
|
-
className:
|
|
21116
|
+
className: VueTypes.string.def(''),
|
|
20818
21117
|
componentId: types.stringRequired,
|
|
20819
21118
|
customQuery: types.func,
|
|
20820
21119
|
dataField: types.stringRequired,
|
|
@@ -20834,7 +21133,7 @@
|
|
|
20834
21133
|
showFilter: VueTypes.bool.def(true),
|
|
20835
21134
|
showRadio: VueTypes.bool.def(true),
|
|
20836
21135
|
showSearch: VueTypes.bool.def(true),
|
|
20837
|
-
size: VueTypes.number
|
|
21136
|
+
size: VueTypes.number,
|
|
20838
21137
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
20839
21138
|
title: types.title,
|
|
20840
21139
|
URLParams: VueTypes.bool.def(false),
|
|
@@ -20948,7 +21247,7 @@
|
|
|
20948
21247
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
20949
21248
|
if (String(item.key).length) {
|
|
20950
21249
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
20951
|
-
return String(item.key).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
21250
|
+
return suggestions_1(String(item.key)).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
|
|
20952
21251
|
}
|
|
20953
21252
|
|
|
20954
21253
|
return true;
|
|
@@ -21295,7 +21594,7 @@
|
|
|
21295
21594
|
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
21296
21595
|
showCheckbox: VueTypes.bool.def(true),
|
|
21297
21596
|
beforeValueChange: types.func,
|
|
21298
|
-
className:
|
|
21597
|
+
className: VueTypes.string.def(''),
|
|
21299
21598
|
componentId: types.stringRequired,
|
|
21300
21599
|
customQuery: types.func,
|
|
21301
21600
|
dataField: types.stringRequired,
|
|
@@ -21442,7 +21741,7 @@
|
|
|
21442
21741
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
21443
21742
|
if (String(item.key).length) {
|
|
21444
21743
|
if (_this2.$props.showSearch && _this2.$data.searchTerm) {
|
|
21445
|
-
return String(item.key).toLowerCase().includes(_this2.$data.searchTerm.toLowerCase());
|
|
21744
|
+
return suggestions_1(String(item.key)).toLowerCase().includes(suggestions_1(_this2.$data.searchTerm).toLowerCase());
|
|
21446
21745
|
}
|
|
21447
21746
|
|
|
21448
21747
|
return true;
|
|
@@ -21916,7 +22215,9 @@
|
|
|
21916
22215
|
single: VueTypes.bool,
|
|
21917
22216
|
small: VueTypes.bool.def(false),
|
|
21918
22217
|
themePreset: types.themePreset,
|
|
21919
|
-
showSearch: VueTypes.bool
|
|
22218
|
+
showSearch: VueTypes.bool,
|
|
22219
|
+
showClear: VueTypes.bool,
|
|
22220
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
21920
22221
|
},
|
|
21921
22222
|
render: function render() {
|
|
21922
22223
|
var _this = this;
|
|
@@ -21944,7 +22245,7 @@
|
|
|
21944
22245
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
21945
22246
|
if (String(item[labelField]).length) {
|
|
21946
22247
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
21947
|
-
return String(item[labelField]).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
22248
|
+
return suggestions_1(String(item[labelField])).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
|
|
21948
22249
|
}
|
|
21949
22250
|
|
|
21950
22251
|
return true;
|
|
@@ -21990,25 +22291,10 @@
|
|
|
21990
22291
|
getItemEvents: getItemEvents
|
|
21991
22292
|
}) : isOpen && itemsToRender.length ? h("ul", {
|
|
21992
22293
|
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$6(_this.$props.innerClass, 'list')
|
|
21993
|
-
}, [_this.$props.showSearch ?
|
|
21994
|
-
"attrs": {
|
|
21995
|
-
"id": _this.$props.componentId + "-input",
|
|
21996
|
-
"showIcon": false,
|
|
21997
|
-
"placeholder": "Type here to search...",
|
|
21998
|
-
"value": _this.$data.searchTerm,
|
|
21999
|
-
"themePreset": themePreset
|
|
22000
|
-
},
|
|
22001
|
-
"style": {
|
|
22002
|
-
border: 0,
|
|
22003
|
-
borderBottom: '1px solid #ddd'
|
|
22004
|
-
},
|
|
22005
|
-
"class": getClassName$6(_this.$props.innerClass, 'input'),
|
|
22006
|
-
"on": {
|
|
22007
|
-
"change": _this.handleInputChange
|
|
22008
|
-
}
|
|
22009
|
-
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
22294
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox() : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
22010
22295
|
var selected = _this.$props.multi // MultiDropdownList
|
|
22011
|
-
&& (selectedItem && !!selectedItem[item[keyField]]
|
|
22296
|
+
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
22297
|
+
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
22012
22298
|
return value[labelField] === item[labelField];
|
|
22013
22299
|
}));
|
|
22014
22300
|
if (!_this.$props.multi) selected = item.key === selectedItem;
|
|
@@ -22058,6 +22344,7 @@
|
|
|
22058
22344
|
|
|
22059
22345
|
if (!this.$props.multi) {
|
|
22060
22346
|
this.isOpen = false;
|
|
22347
|
+
this.searchTerm = '';
|
|
22061
22348
|
}
|
|
22062
22349
|
},
|
|
22063
22350
|
handleStateChange: function handleStateChange(_ref2) {
|
|
@@ -22081,6 +22368,9 @@
|
|
|
22081
22368
|
var value = e.target.value;
|
|
22082
22369
|
this.searchTerm = value;
|
|
22083
22370
|
},
|
|
22371
|
+
clearSearchTerm: function clearSearchTerm() {
|
|
22372
|
+
this.searchTerm = '';
|
|
22373
|
+
},
|
|
22084
22374
|
renderToString: function renderToString(value) {
|
|
22085
22375
|
var _this2 = this;
|
|
22086
22376
|
|
|
@@ -22121,6 +22411,51 @@
|
|
|
22121
22411
|
return h("p", {
|
|
22122
22412
|
"class": getClassName$6(this.$props.innerClass, 'noResults') || null
|
|
22123
22413
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
22414
|
+
},
|
|
22415
|
+
renderSearchbox: function renderSearchbox() {
|
|
22416
|
+
var h = this.$createElement;
|
|
22417
|
+
var _this$$props2 = this.$props,
|
|
22418
|
+
componentId = _this$$props2.componentId,
|
|
22419
|
+
searchPlaceholder = _this$$props2.searchPlaceholder,
|
|
22420
|
+
showClear = _this$$props2.showClear,
|
|
22421
|
+
themePreset = _this$$props2.themePreset,
|
|
22422
|
+
innerClass = _this$$props2.innerClass;
|
|
22423
|
+
var InputComponent = h(Input, {
|
|
22424
|
+
"attrs": {
|
|
22425
|
+
"id": componentId + "-input",
|
|
22426
|
+
"showIcon": false,
|
|
22427
|
+
"showClear": showClear,
|
|
22428
|
+
"placeholder": searchPlaceholder,
|
|
22429
|
+
"value": this.$data.searchTerm,
|
|
22430
|
+
"themePreset": themePreset
|
|
22431
|
+
},
|
|
22432
|
+
"style": {
|
|
22433
|
+
border: 0,
|
|
22434
|
+
borderBottom: '1px solid #ddd'
|
|
22435
|
+
},
|
|
22436
|
+
"class": getClassName$6(innerClass, 'input'),
|
|
22437
|
+
"on": {
|
|
22438
|
+
"change": this.handleInputChange
|
|
22439
|
+
}
|
|
22440
|
+
});
|
|
22441
|
+
|
|
22442
|
+
if (showClear) {
|
|
22443
|
+
return h(InputWrapper, [InputComponent, this.searchTerm && h(IconGroup, {
|
|
22444
|
+
"attrs": {
|
|
22445
|
+
"groupPosition": "right",
|
|
22446
|
+
"positionType": "absolute"
|
|
22447
|
+
}
|
|
22448
|
+
}, [h(IconWrapper, {
|
|
22449
|
+
"on": {
|
|
22450
|
+
"click": this.clearSearchTerm
|
|
22451
|
+
},
|
|
22452
|
+
"attrs": {
|
|
22453
|
+
"isClearIcon": true
|
|
22454
|
+
}
|
|
22455
|
+
}, [h(CancelSvg)])])]);
|
|
22456
|
+
}
|
|
22457
|
+
|
|
22458
|
+
return InputComponent;
|
|
22124
22459
|
}
|
|
22125
22460
|
}
|
|
22126
22461
|
};
|
|
@@ -22179,10 +22514,12 @@
|
|
|
22179
22514
|
showMissing: VueTypes.bool.def(false),
|
|
22180
22515
|
missingLabel: VueTypes.string.def('N/A'),
|
|
22181
22516
|
showSearch: VueTypes.bool.def(false),
|
|
22517
|
+
showClear: VueTypes.bool.def(false),
|
|
22182
22518
|
showLoadMore: VueTypes.bool.def(false),
|
|
22183
22519
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
22184
22520
|
nestedField: types.string,
|
|
22185
|
-
index: VueTypes.string
|
|
22521
|
+
index: VueTypes.string,
|
|
22522
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
22186
22523
|
},
|
|
22187
22524
|
created: function created() {
|
|
22188
22525
|
if (!this.enableAppbase && this.$props.index) {
|
|
@@ -22296,7 +22633,9 @@
|
|
|
22296
22633
|
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
22297
22634
|
if (renderNoResults && isFunction$1(renderNoResults)) {
|
|
22298
22635
|
return h("div", [renderNoResults()]);
|
|
22299
|
-
}
|
|
22636
|
+
}
|
|
22637
|
+
|
|
22638
|
+
if (renderNoResults && !isFunction$1(renderNoResults)) {
|
|
22300
22639
|
return renderNoResults;
|
|
22301
22640
|
}
|
|
22302
22641
|
|
|
@@ -22334,6 +22673,8 @@
|
|
|
22334
22673
|
"renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
|
|
22335
22674
|
"themePreset": this.themePreset,
|
|
22336
22675
|
"showSearch": this.$props.showSearch,
|
|
22676
|
+
"showClear": this.$props.showClear,
|
|
22677
|
+
"searchPlaceholder": this.$props.searchPlaceholder,
|
|
22337
22678
|
"transformData": this.$props.transformData,
|
|
22338
22679
|
"footer": showLoadMore && !isLastBucket && h("div", {
|
|
22339
22680
|
"attrs": {
|
|
@@ -22626,10 +22967,12 @@
|
|
|
22626
22967
|
showMissing: VueTypes.bool.def(false),
|
|
22627
22968
|
missingLabel: VueTypes.string.def('N/A'),
|
|
22628
22969
|
showSearch: VueTypes.bool.def(false),
|
|
22970
|
+
showClear: VueTypes.bool.def(false),
|
|
22629
22971
|
showLoadMore: VueTypes.bool.def(false),
|
|
22630
22972
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
22631
22973
|
nestedField: types.string,
|
|
22632
|
-
index: VueTypes.string
|
|
22974
|
+
index: VueTypes.string,
|
|
22975
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
22633
22976
|
},
|
|
22634
22977
|
created: function created() {
|
|
22635
22978
|
if (!this.enableAppbase && this.$props.index) {
|
|
@@ -22757,7 +23100,9 @@
|
|
|
22757
23100
|
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
22758
23101
|
if (renderNoResults && isFunction$1(renderNoResults)) {
|
|
22759
23102
|
return h("div", [renderNoResults()]);
|
|
22760
|
-
}
|
|
23103
|
+
}
|
|
23104
|
+
|
|
23105
|
+
if (renderNoResults && !isFunction$1(renderNoResults)) {
|
|
22761
23106
|
return renderNoResults;
|
|
22762
23107
|
}
|
|
22763
23108
|
|
|
@@ -22796,6 +23141,8 @@
|
|
|
22796
23141
|
"renderItem": renderItemCalc,
|
|
22797
23142
|
"renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
|
|
22798
23143
|
"showSearch": this.$props.showSearch,
|
|
23144
|
+
"showClear": this.$props.showClear,
|
|
23145
|
+
"searchPlaceholder": this.$props.searchPlaceholder,
|
|
22799
23146
|
"transformData": this.$props.transformData,
|
|
22800
23147
|
"footer": showLoadMore && !isLastBucket && h("div", {
|
|
22801
23148
|
"attrs": {
|
|
@@ -23142,7 +23489,7 @@
|
|
|
23142
23489
|
componentId: types.stringRequired,
|
|
23143
23490
|
data: types.data,
|
|
23144
23491
|
dataField: types.stringRequired,
|
|
23145
|
-
defaultValue: types.
|
|
23492
|
+
defaultValue: types.any,
|
|
23146
23493
|
value: types.stringOrArray,
|
|
23147
23494
|
filterLabel: types.string,
|
|
23148
23495
|
nestedField: types.string,
|
|
@@ -23495,7 +23842,7 @@
|
|
|
23495
23842
|
this.internalComponent = null;
|
|
23496
23843
|
this.$defaultQuery = null; // Set custom query in store
|
|
23497
23844
|
|
|
23498
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
23845
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23499
23846
|
var customQuery = props.customQuery,
|
|
23500
23847
|
componentId = props.componentId,
|
|
23501
23848
|
filterLabel = props.filterLabel,
|
|
@@ -23518,7 +23865,7 @@
|
|
|
23518
23865
|
}
|
|
23519
23866
|
|
|
23520
23867
|
if (customQuery) {
|
|
23521
|
-
var calcCustomQuery = customQuery(props);
|
|
23868
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
23522
23869
|
|
|
23523
23870
|
var _ref = calcCustomQuery || {},
|
|
23524
23871
|
query = _ref.query;
|
|
@@ -23537,7 +23884,7 @@
|
|
|
23537
23884
|
|
|
23538
23885
|
this.updateQuery({
|
|
23539
23886
|
componentId: componentId,
|
|
23540
|
-
|
|
23887
|
+
query: queryToSet,
|
|
23541
23888
|
value: this.selectedValue || null,
|
|
23542
23889
|
label: filterLabel,
|
|
23543
23890
|
showFilter: showFilter,
|
|
@@ -23588,8 +23935,8 @@
|
|
|
23588
23935
|
},
|
|
23589
23936
|
beforeMount: function beforeMount() {
|
|
23590
23937
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
23591
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
23592
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
23938
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23939
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
23593
23940
|
|
|
23594
23941
|
var _ref3 = this.$defaultQuery || {},
|
|
23595
23942
|
query = _ref3.query,
|
|
@@ -23653,8 +24000,8 @@
|
|
|
23653
24000
|
}
|
|
23654
24001
|
},
|
|
23655
24002
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
23656
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
23657
|
-
this.$defaultQuery = newVal();
|
|
24003
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
24004
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
23658
24005
|
|
|
23659
24006
|
var _ref4 = this.$defaultQuery || {},
|
|
23660
24007
|
query = _ref4.query,
|
|
@@ -23665,7 +24012,7 @@
|
|
|
23665
24012
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
23666
24013
|
|
|
23667
24014
|
|
|
23668
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
24015
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23669
24016
|
var queryToSet = query || null;
|
|
23670
24017
|
|
|
23671
24018
|
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
@@ -23679,9 +24026,9 @@
|
|
|
23679
24026
|
}
|
|
23680
24027
|
},
|
|
23681
24028
|
customQuery: function customQuery(newVal, oldVal) {
|
|
23682
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
24029
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23683
24030
|
var componentId = this.$props.componentId;
|
|
23684
|
-
this.$customQuery = newVal(this.$props);
|
|
24031
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
23685
24032
|
|
|
23686
24033
|
var _ref5 = this.$customQuery || {},
|
|
23687
24034
|
query = _ref5.query,
|
|
@@ -23692,7 +24039,7 @@
|
|
|
23692
24039
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
23693
24040
|
|
|
23694
24041
|
|
|
23695
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
24042
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23696
24043
|
var queryToSet = query || null;
|
|
23697
24044
|
|
|
23698
24045
|
if (this.$customQuery && this.$customQuery.id) {
|
|
@@ -25506,6 +25853,10 @@
|
|
|
25506
25853
|
var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
|
|
25507
25854
|
|
|
25508
25855
|
var filterProps = function filterProps(props) {
|
|
25856
|
+
if (props === void 0) {
|
|
25857
|
+
props = {};
|
|
25858
|
+
}
|
|
25859
|
+
|
|
25509
25860
|
return _extends({}, props, {
|
|
25510
25861
|
props: props.componentProps
|
|
25511
25862
|
});
|
|
@@ -25525,7 +25876,7 @@
|
|
|
25525
25876
|
return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
|
|
25526
25877
|
}
|
|
25527
25878
|
|
|
25528
|
-
if (componentIds
|
|
25879
|
+
if (Array.isArray(componentIds)) {
|
|
25529
25880
|
var filteredState = {};
|
|
25530
25881
|
componentIds.forEach(function (componentId) {
|
|
25531
25882
|
filteredState[componentId] = state[componentId];
|
|
@@ -25564,7 +25915,7 @@
|
|
|
25564
25915
|
};
|
|
25565
25916
|
return this.__state;
|
|
25566
25917
|
},
|
|
25567
|
-
|
|
25918
|
+
created: function created() {
|
|
25568
25919
|
this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
|
|
25569
25920
|
},
|
|
25570
25921
|
computed: {
|
|
@@ -32552,6 +32903,7 @@
|
|
|
32552
32903
|
var orderOfQueries = [];
|
|
32553
32904
|
var hits = {};
|
|
32554
32905
|
var aggregations = {};
|
|
32906
|
+
var compositeAggregations = {};
|
|
32555
32907
|
var state = {};
|
|
32556
32908
|
var customQueries = {};
|
|
32557
32909
|
var defaultQueries = {};
|
|
@@ -32566,16 +32918,7 @@
|
|
|
32566
32918
|
compProps[key] = component[key];
|
|
32567
32919
|
}
|
|
32568
32920
|
});
|
|
32569
|
-
var isInternalComponentPresent = false;
|
|
32570
|
-
|
|
32571
|
-
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
32572
|
-
customQueries[component.componentId] = component.customQuery(component.value, compProps);
|
|
32573
|
-
}
|
|
32574
|
-
|
|
32575
|
-
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
32576
|
-
defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
|
|
32577
|
-
}
|
|
32578
|
-
|
|
32921
|
+
var isInternalComponentPresent = false;
|
|
32579
32922
|
var isResultComponent = resultComponents.includes(componentType);
|
|
32580
32923
|
var internalComponent = component.componentId + "__internal";
|
|
32581
32924
|
var label = component.filterLabel || component.componentId;
|
|
@@ -32599,7 +32942,16 @@
|
|
|
32599
32942
|
reference: reference,
|
|
32600
32943
|
showFilter: showFilter,
|
|
32601
32944
|
URLParams: component.URLParams || false
|
|
32602
|
-
}); //
|
|
32945
|
+
}); // Set custom and default queries
|
|
32946
|
+
|
|
32947
|
+
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
32948
|
+
customQueries[component.componentId] = component.customQuery(value, compProps);
|
|
32949
|
+
}
|
|
32950
|
+
|
|
32951
|
+
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
32952
|
+
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
32953
|
+
} // [2] set query options - main component query (valid for result components)
|
|
32954
|
+
|
|
32603
32955
|
|
|
32604
32956
|
if (componentsWithOptions.includes(componentType)) {
|
|
32605
32957
|
var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
|
|
@@ -32686,7 +33038,7 @@
|
|
|
32686
33038
|
|
|
32687
33039
|
|
|
32688
33040
|
if (isResultComponent) {
|
|
32689
|
-
var _getQuery = getQuery(component,
|
|
33041
|
+
var _getQuery = getQuery(component, value, componentType),
|
|
32690
33042
|
query = _getQuery.query;
|
|
32691
33043
|
|
|
32692
33044
|
queryList = queryReducer(queryList, {
|
|
@@ -32786,6 +33138,11 @@
|
|
|
32786
33138
|
var _extends4;
|
|
32787
33139
|
|
|
32788
33140
|
aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
|
|
33141
|
+
compositeAggregations = compositeAggsReducer(compositeAggregations, {
|
|
33142
|
+
type: constants_9,
|
|
33143
|
+
aggregations: response.aggregations,
|
|
33144
|
+
append: false
|
|
33145
|
+
});
|
|
32789
33146
|
}
|
|
32790
33147
|
|
|
32791
33148
|
hits = _extends({}, hits, (_extends5 = {}, _extends5[component] = {
|
|
@@ -32812,6 +33169,8 @@
|
|
|
32812
33169
|
var promotedResults = {};
|
|
32813
33170
|
var rawData = {};
|
|
32814
33171
|
var customData = {};
|
|
33172
|
+
var settingsResponse = {};
|
|
33173
|
+
var timestamp = {};
|
|
32815
33174
|
var allPromises = orderOfQueries.map(function (component) {
|
|
32816
33175
|
return new Promise(function (responseResolve, responseReject) {
|
|
32817
33176
|
handleTransformResponse(res[component], component).then(function (response) {
|
|
@@ -32830,6 +33189,11 @@
|
|
|
32830
33189
|
|
|
32831
33190
|
if (response.customData) {
|
|
32832
33191
|
customData[component] = response.customData;
|
|
33192
|
+
} // Update settings
|
|
33193
|
+
|
|
33194
|
+
|
|
33195
|
+
if (response.settings) {
|
|
33196
|
+
settingsResponse[component] = response.settings;
|
|
32833
33197
|
}
|
|
32834
33198
|
|
|
32835
33199
|
if (response.aggregations) {
|
|
@@ -32838,6 +33202,7 @@
|
|
|
32838
33202
|
aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
|
|
32839
33203
|
}
|
|
32840
33204
|
|
|
33205
|
+
timestamp[component] = res._timestamp;
|
|
32841
33206
|
hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
|
|
32842
33207
|
hits: response.hits.hits,
|
|
32843
33208
|
total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
|
|
@@ -32853,8 +33218,11 @@
|
|
|
32853
33218
|
Promise.all(allPromises).then(function () {
|
|
32854
33219
|
state = _extends({}, state, {
|
|
32855
33220
|
hits: hits,
|
|
33221
|
+
timestamp: timestamp,
|
|
32856
33222
|
aggregations: aggregations,
|
|
33223
|
+
compositeAggregations: compositeAggregations,
|
|
32857
33224
|
promotedResults: promotedResults,
|
|
33225
|
+
settings: settingsResponse,
|
|
32858
33226
|
customData: customData,
|
|
32859
33227
|
rawData: rawData
|
|
32860
33228
|
});
|
|
@@ -32913,7 +33281,7 @@
|
|
|
32913
33281
|
});
|
|
32914
33282
|
}
|
|
32915
33283
|
|
|
32916
|
-
var version = "1.16.0-alpha.
|
|
33284
|
+
var version = "1.16.0-alpha.29";
|
|
32917
33285
|
|
|
32918
33286
|
var _templateObject$o, _templateObject2$b;
|
|
32919
33287
|
|