@appbaseio/reactivesearch-vue 1.16.0-alpha.24 → 1.16.0-alpha.28
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 +581 -262
- 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/DataSearch.js +10 -10
- package/dist/cjs/{DropDown-d3c78c41.js → DropDown-3c343026.js} +5 -3
- package/dist/cjs/DynamicRangeSlider.js +1 -1
- package/dist/cjs/MultiDropdownList.js +3 -2
- 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 +18 -10
- package/dist/cjs/ReactiveComponent.js +12 -12
- package/dist/cjs/ReactiveGoogleMap.js +2 -2
- package/dist/cjs/ReactiveList.js +88 -78
- 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 +6 -3
- package/dist/cjs/SingleList.js +5 -4
- package/dist/cjs/SingleRange.js +1 -1
- package/dist/cjs/ToggleButton.js +2 -2
- package/dist/cjs/index.js +7 -4
- package/dist/cjs/initReactivesearch.js +32 -13
- 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/DataSearch.js +10 -10
- package/dist/es/{DropDown-8894cc22.js → DropDown-c5ab660f.js} +5 -3
- package/dist/es/DynamicRangeSlider.js +1 -1
- package/dist/es/MultiDropdownList.js +3 -2
- 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 +18 -10
- package/dist/es/ReactiveComponent.js +12 -12
- package/dist/es/ReactiveGoogleMap.js +2 -2
- package/dist/es/ReactiveList.js +88 -78
- 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 +6 -3
- package/dist/es/SingleList.js +5 -4
- package/dist/es/SingleRange.js +1 -1
- package/dist/es/ToggleButton.js +2 -2
- package/dist/es/index.js +7 -4
- package/dist/es/initReactivesearch.js +32 -13
- 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", {
|
|
@@ -6032,62 +6049,6 @@
|
|
|
6032
6049
|
var misc_19 = misc.setAppliedSettings;
|
|
6033
6050
|
var misc_20 = misc.setQueryListener;
|
|
6034
6051
|
|
|
6035
|
-
var hits = createCommonjsModule(function (module, exports) {
|
|
6036
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6037
|
-
value: true
|
|
6038
|
-
});
|
|
6039
|
-
exports.updateAggs = updateAggs;
|
|
6040
|
-
exports.updateCompositeAggs = updateCompositeAggs;
|
|
6041
|
-
exports.updateHits = updateHits;
|
|
6042
|
-
exports.saveQueryToHits = saveQueryToHits;
|
|
6043
|
-
|
|
6044
|
-
function updateAggs(component, aggregations) {
|
|
6045
|
-
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
6046
|
-
return {
|
|
6047
|
-
type: constants.UPDATE_AGGS,
|
|
6048
|
-
component: component,
|
|
6049
|
-
aggregations: aggregations,
|
|
6050
|
-
append: append
|
|
6051
|
-
};
|
|
6052
|
-
}
|
|
6053
|
-
|
|
6054
|
-
function updateCompositeAggs(component, aggregations) {
|
|
6055
|
-
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
6056
|
-
return {
|
|
6057
|
-
type: constants.UPDATE_COMPOSITE_AGGS,
|
|
6058
|
-
component: component,
|
|
6059
|
-
aggregations: aggregations,
|
|
6060
|
-
append: append
|
|
6061
|
-
};
|
|
6062
|
-
}
|
|
6063
|
-
|
|
6064
|
-
function updateHits(component, hits, time, hidden) {
|
|
6065
|
-
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
6066
|
-
return {
|
|
6067
|
-
type: constants.UPDATE_HITS,
|
|
6068
|
-
component: component,
|
|
6069
|
-
hits: hits.hits,
|
|
6070
|
-
total: typeof hits.total === 'object' ? hits.total.value : hits.total,
|
|
6071
|
-
hidden: hidden,
|
|
6072
|
-
time: time,
|
|
6073
|
-
append: append
|
|
6074
|
-
};
|
|
6075
|
-
}
|
|
6076
|
-
|
|
6077
|
-
function saveQueryToHits(component, query) {
|
|
6078
|
-
return {
|
|
6079
|
-
type: constants.SET_QUERY_TO_HITS,
|
|
6080
|
-
component: component,
|
|
6081
|
-
query: query
|
|
6082
|
-
};
|
|
6083
|
-
}
|
|
6084
|
-
});
|
|
6085
|
-
unwrapExports(hits);
|
|
6086
|
-
var hits_1 = hits.updateAggs;
|
|
6087
|
-
var hits_2 = hits.updateCompositeAggs;
|
|
6088
|
-
var hits_3 = hits.updateHits;
|
|
6089
|
-
var hits_4 = hits.saveQueryToHits;
|
|
6090
|
-
|
|
6091
6052
|
var xdate = createCommonjsModule(function (module) {
|
|
6092
6053
|
/**
|
|
6093
6054
|
* @preserve XDate v@VERSION
|
|
@@ -6914,6 +6875,8 @@
|
|
|
6914
6875
|
|
|
6915
6876
|
var _xdate2 = _interopRequireDefault(xdate);
|
|
6916
6877
|
|
|
6878
|
+
var _dateFormats2 = _interopRequireDefault(dateFormats_1);
|
|
6879
|
+
|
|
6917
6880
|
function _interopRequireDefault(obj) {
|
|
6918
6881
|
return obj && obj.__esModule ? obj : {
|
|
6919
6882
|
"default": obj
|
|
@@ -6947,10 +6910,10 @@
|
|
|
6947
6910
|
return obj;
|
|
6948
6911
|
}
|
|
6949
6912
|
|
|
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);
|
|
6913
|
+
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
6914
|
var multiRangeComponents = [constants$1.componentTypes.multiRange, constants$1.componentTypes.multiDropdownRange];
|
|
6952
6915
|
var dateRangeComponents = [constants$1.componentTypes.dateRange, constants$1.componentTypes.datePicker];
|
|
6953
|
-
var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch];
|
|
6916
|
+
var searchComponents = [constants$1.componentTypes.categorySearch, constants$1.componentTypes.dataSearch, constants$1.componentTypes.searchBox];
|
|
6954
6917
|
var listComponentsWithPagination = [constants$1.componentTypes.singleList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.multiDropdownList];
|
|
6955
6918
|
|
|
6956
6919
|
var getNormalizedField = exports.getNormalizedField = function getNormalizedField(field) {
|
|
@@ -7006,7 +6969,7 @@
|
|
|
7006
6969
|
return null;
|
|
7007
6970
|
}
|
|
7008
6971
|
|
|
7009
|
-
return {
|
|
6972
|
+
return _extends({
|
|
7010
6973
|
id: componentId,
|
|
7011
6974
|
type: queryType,
|
|
7012
6975
|
dataField: getNormalizedField(props.dataField),
|
|
@@ -7045,7 +7008,17 @@
|
|
|
7045
7008
|
distinctField: props.distinctField,
|
|
7046
7009
|
distinctFieldConfig: props.distinctFieldConfig,
|
|
7047
7010
|
index: props.index
|
|
7048
|
-
}
|
|
7011
|
+
}, queryType === constants$1.queryTypes.suggestion ? {
|
|
7012
|
+
enablePopularSuggestions: props.enablePopularSuggestions,
|
|
7013
|
+
enableRecentSuggestions: props.enableRecentSuggestions,
|
|
7014
|
+
popularSuggestionsConfig: props.popularSuggestionsConfig,
|
|
7015
|
+
recentSuggestionsConfig: props.recentSuggestionsConfig,
|
|
7016
|
+
applyStopwords: props.applyStopwords,
|
|
7017
|
+
customStopwords: props.customStopwords,
|
|
7018
|
+
enablePredictiveSuggestions: props.enablePredictiveSuggestions
|
|
7019
|
+
} : {}, {
|
|
7020
|
+
calendarInterval: props.calendarInterval
|
|
7021
|
+
});
|
|
7049
7022
|
}
|
|
7050
7023
|
|
|
7051
7024
|
return null;
|
|
@@ -7075,6 +7048,7 @@
|
|
|
7075
7048
|
var calcValues = store.selectedValues[component] || store.internalValues[component];
|
|
7076
7049
|
var value = calcValues !== undefined && calcValues !== null ? calcValues.value : undefined;
|
|
7077
7050
|
var queryFormat = componentProps.queryFormat;
|
|
7051
|
+
var calendarInterval = void 0;
|
|
7078
7052
|
var interval = componentProps.interval;
|
|
7079
7053
|
var type = componentToTypeMap[componentProps.componentType];
|
|
7080
7054
|
var dataField = componentProps.dataField;
|
|
@@ -7143,6 +7117,24 @@
|
|
|
7143
7117
|
aggregations = ['histogram'];
|
|
7144
7118
|
}
|
|
7145
7119
|
|
|
7120
|
+
if (componentProps.componentType === constants$1.componentTypes.dynamicRangeSlider || componentProps.componentType === constants$1.componentTypes.rangeSlider) {
|
|
7121
|
+
calendarInterval = Object.keys(_dateFormats2["default"]).includes(queryFormat) ? componentProps.calendarInterval || 'month' : undefined;
|
|
7122
|
+
|
|
7123
|
+
if (value) {
|
|
7124
|
+
if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
|
|
7125
|
+
value = {
|
|
7126
|
+
start: (0, helper.formatDate)(new _xdate2["default"](value.start), componentProps),
|
|
7127
|
+
end: (0, helper.formatDate)(new _xdate2["default"](value.end), componentProps)
|
|
7128
|
+
};
|
|
7129
|
+
} else {
|
|
7130
|
+
value = {
|
|
7131
|
+
start: parseFloat(value.start),
|
|
7132
|
+
end: parseFloat(value.end)
|
|
7133
|
+
};
|
|
7134
|
+
}
|
|
7135
|
+
}
|
|
7136
|
+
}
|
|
7137
|
+
|
|
7146
7138
|
if (dateRangeComponents.includes(componentProps.componentType)) {
|
|
7147
7139
|
queryFormat = 'or';
|
|
7148
7140
|
|
|
@@ -7265,6 +7257,7 @@
|
|
|
7265
7257
|
}
|
|
7266
7258
|
|
|
7267
7259
|
return _extends({}, componentProps, {
|
|
7260
|
+
calendarInterval: calendarInterval,
|
|
7268
7261
|
dataField: dataField,
|
|
7269
7262
|
queryFormat: queryFormat,
|
|
7270
7263
|
type: type,
|
|
@@ -7275,7 +7268,7 @@
|
|
|
7275
7268
|
defaultQuery: store.defaultQueries ? store.defaultQueries[component] : undefined,
|
|
7276
7269
|
customHighlight: store.customHighlightOptions ? store.customHighlightOptions[component] : undefined,
|
|
7277
7270
|
categoryValue: store.internalValues[component] ? store.internalValues[component].category : undefined,
|
|
7278
|
-
value: value,
|
|
7271
|
+
value: componentProps.componentType === constants$1.componentTypes.searchBox ? value || undefined : value,
|
|
7279
7272
|
pagination: pagination,
|
|
7280
7273
|
from: from
|
|
7281
7274
|
}, customOptions);
|
|
@@ -7311,7 +7304,8 @@
|
|
|
7311
7304
|
var orderOfQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
7312
7305
|
var finalQuery = {};
|
|
7313
7306
|
var react = flatReactProp(store.dependencyTree[componentID], componentID);
|
|
7314
|
-
react.forEach(function (
|
|
7307
|
+
react.forEach(function (componentObject) {
|
|
7308
|
+
var component = componentObject;
|
|
7315
7309
|
var customQuery = store.customQueries[component];
|
|
7316
7310
|
|
|
7317
7311
|
if (!isInternalComponent(component)) {
|
|
@@ -7324,7 +7318,11 @@
|
|
|
7324
7318
|
execute = true;
|
|
7325
7319
|
}
|
|
7326
7320
|
|
|
7327
|
-
var dependentQuery = getRSQuery(component, extractPropsFromState(store, component
|
|
7321
|
+
var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _extends({}, store.props[component].componentType === constants$1.componentTypes.searchBox ? _extends({}, execute === false ? {
|
|
7322
|
+
type: constants$1.queryTypes.search
|
|
7323
|
+
} : {}, calcValues.category ? {
|
|
7324
|
+
categoryValue: calcValues.category
|
|
7325
|
+
} : {}) : {})), execute);
|
|
7328
7326
|
|
|
7329
7327
|
if (dependentQuery) {
|
|
7330
7328
|
finalQuery[component] = dependentQuery;
|
|
@@ -7351,6 +7349,79 @@
|
|
|
7351
7349
|
var transform_13 = transform.componentToTypeMap;
|
|
7352
7350
|
var transform_14 = transform.flatReactProp;
|
|
7353
7351
|
|
|
7352
|
+
var hits = createCommonjsModule(function (module, exports) {
|
|
7353
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7354
|
+
value: true
|
|
7355
|
+
});
|
|
7356
|
+
exports.updateAggs = updateAggs;
|
|
7357
|
+
exports.updateCompositeAggs = updateCompositeAggs;
|
|
7358
|
+
exports.updateHits = updateHits;
|
|
7359
|
+
exports.saveQueryToHits = saveQueryToHits;
|
|
7360
|
+
exports.mockDataForTesting = mockDataForTesting;
|
|
7361
|
+
|
|
7362
|
+
function updateAggs(component, aggregations) {
|
|
7363
|
+
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7364
|
+
return {
|
|
7365
|
+
type: constants.UPDATE_AGGS,
|
|
7366
|
+
component: component,
|
|
7367
|
+
aggregations: aggregations,
|
|
7368
|
+
append: append
|
|
7369
|
+
};
|
|
7370
|
+
}
|
|
7371
|
+
|
|
7372
|
+
function updateCompositeAggs(component, aggregations) {
|
|
7373
|
+
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7374
|
+
return {
|
|
7375
|
+
type: constants.UPDATE_COMPOSITE_AGGS,
|
|
7376
|
+
component: component,
|
|
7377
|
+
aggregations: aggregations,
|
|
7378
|
+
append: append
|
|
7379
|
+
};
|
|
7380
|
+
}
|
|
7381
|
+
|
|
7382
|
+
function updateHits(component, hits, time, hidden) {
|
|
7383
|
+
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
7384
|
+
return {
|
|
7385
|
+
type: constants.UPDATE_HITS,
|
|
7386
|
+
component: component,
|
|
7387
|
+
hits: hits.hits,
|
|
7388
|
+
total: typeof hits.total === 'object' ? hits.total.value : hits.total,
|
|
7389
|
+
hidden: hidden,
|
|
7390
|
+
time: time,
|
|
7391
|
+
append: append
|
|
7392
|
+
};
|
|
7393
|
+
}
|
|
7394
|
+
|
|
7395
|
+
function saveQueryToHits(component, query) {
|
|
7396
|
+
return {
|
|
7397
|
+
type: constants.SET_QUERY_TO_HITS,
|
|
7398
|
+
component: component,
|
|
7399
|
+
query: query
|
|
7400
|
+
};
|
|
7401
|
+
}
|
|
7402
|
+
|
|
7403
|
+
function mockDataForTesting(component, data) {
|
|
7404
|
+
return function (dispatch, getState) {
|
|
7405
|
+
var _getState = getState(),
|
|
7406
|
+
props = _getState.props;
|
|
7407
|
+
|
|
7408
|
+
var componentProps = props[component];
|
|
7409
|
+
|
|
7410
|
+
if (transform.componentToTypeMap[componentProps.componentType] === 'term') {
|
|
7411
|
+
dispatch(updateAggs(component, data));
|
|
7412
|
+
} else {
|
|
7413
|
+
dispatch(updateHits(component, data));
|
|
7414
|
+
}
|
|
7415
|
+
};
|
|
7416
|
+
}
|
|
7417
|
+
});
|
|
7418
|
+
unwrapExports(hits);
|
|
7419
|
+
var hits_1 = hits.updateAggs;
|
|
7420
|
+
var hits_2 = hits.updateCompositeAggs;
|
|
7421
|
+
var hits_3 = hits.updateHits;
|
|
7422
|
+
var hits_4 = hits.saveQueryToHits;
|
|
7423
|
+
var hits_5 = hits.mockDataForTesting;
|
|
7424
|
+
|
|
7354
7425
|
var utils = createCommonjsModule(function (module, exports) {
|
|
7355
7426
|
Object.defineProperty(exports, "__esModule", {
|
|
7356
7427
|
value: true
|
|
@@ -8402,6 +8473,11 @@
|
|
|
8402
8473
|
var value = internalValue && internalValue.value || '';
|
|
8403
8474
|
|
|
8404
8475
|
if (isAppbaseEnabled && (componentProps.enablePopularSuggestions || componentProps.enableQuerySuggestions)) {
|
|
8476
|
+
if (config.mongodb) {
|
|
8477
|
+
dispatch((0, misc.setDefaultPopularSuggestions)([], componentId.split('__internal')[0]));
|
|
8478
|
+
return;
|
|
8479
|
+
}
|
|
8480
|
+
|
|
8405
8481
|
var suggQuery = (0, utils.getSuggestionQuery)(getState, componentId);
|
|
8406
8482
|
appbaseRef.getQuerySuggestions(suggQuery).then(function (suggestions) {
|
|
8407
8483
|
var querySuggestion = suggestions[(0, utils.getQuerySuggestionsId)(componentId)];
|
|
@@ -9132,7 +9208,8 @@
|
|
|
9132
9208
|
protocol = _getState$appbaseRef.protocol,
|
|
9133
9209
|
credentials = _getState$appbaseRef.credentials;
|
|
9134
9210
|
|
|
9135
|
-
var app = config.app
|
|
9211
|
+
var app = config.app,
|
|
9212
|
+
mongodb = config.mongodb;
|
|
9136
9213
|
var esURL = protocol + '://' + url;
|
|
9137
9214
|
var parsedURL = (esURL || '').replace(/\/+$/, '');
|
|
9138
9215
|
var requestOptions = {
|
|
@@ -9179,7 +9256,14 @@
|
|
|
9179
9256
|
}
|
|
9180
9257
|
}
|
|
9181
9258
|
|
|
9182
|
-
|
|
9259
|
+
if (mongodb) {
|
|
9260
|
+
return dispatch({
|
|
9261
|
+
type: constants.RECENT_SEARCHES_SUCCESS,
|
|
9262
|
+
data: []
|
|
9263
|
+
});
|
|
9264
|
+
}
|
|
9265
|
+
|
|
9266
|
+
return fetch(parsedURL + '/_analytics/' + app + '/recent-searches?' + queryString, requestOptions).then(function (res) {
|
|
9183
9267
|
if (res.status >= 500 || res.status >= 400) {
|
|
9184
9268
|
return dispatch({
|
|
9185
9269
|
type: constants.RECENT_SEARCHES_ERROR,
|
|
@@ -12811,7 +12895,11 @@
|
|
|
12811
12895
|
userId: VueTypes.string,
|
|
12812
12896
|
customEvents: VueTypes.object,
|
|
12813
12897
|
enableTelemetry: VueTypes.bool.def(true)
|
|
12814
|
-
}).def({})
|
|
12898
|
+
}).def({}),
|
|
12899
|
+
mongodb: VueTypes.shape({
|
|
12900
|
+
db: VueTypes.string,
|
|
12901
|
+
collection: VueTypes.string
|
|
12902
|
+
})
|
|
12815
12903
|
};
|
|
12816
12904
|
|
|
12817
12905
|
var getClassName = lib_8.getClassName,
|
|
@@ -13962,9 +14050,14 @@
|
|
|
13962
14050
|
}
|
|
13963
14051
|
|
|
13964
14052
|
this.internalComponent = this.$props.componentId + "__internal";
|
|
13965
|
-
this.sortOptionIndex =
|
|
13966
|
-
|
|
13967
|
-
|
|
14053
|
+
this.sortOptionIndex = 0;
|
|
14054
|
+
|
|
14055
|
+
if (this.defaultSortOption && this.sortOptions && Array.isArray(this.sortOptions)) {
|
|
14056
|
+
this.sortOptionIndex = this.sortOptions.findIndex(function (s) {
|
|
14057
|
+
return s.label === _this.defaultSortOption;
|
|
14058
|
+
});
|
|
14059
|
+
}
|
|
14060
|
+
|
|
13968
14061
|
this.updateComponentProps(this.componentId, {
|
|
13969
14062
|
from: this.from
|
|
13970
14063
|
}, constants_1$1.reactiveList);
|
|
@@ -13974,7 +14067,7 @@
|
|
|
13974
14067
|
},
|
|
13975
14068
|
props: {
|
|
13976
14069
|
currentPage: VueTypes.number.def(0),
|
|
13977
|
-
includeFields: types.includeFields
|
|
14070
|
+
includeFields: types.includeFields,
|
|
13978
14071
|
// component props
|
|
13979
14072
|
className: types.string,
|
|
13980
14073
|
componentId: types.stringRequired,
|
|
@@ -13983,7 +14076,7 @@
|
|
|
13983
14076
|
aggregationSize: VueTypes.number,
|
|
13984
14077
|
defaultQuery: types.func,
|
|
13985
14078
|
defaultSortOption: types.string,
|
|
13986
|
-
excludeFields: types.excludeFields
|
|
14079
|
+
excludeFields: types.excludeFields,
|
|
13987
14080
|
innerClass: types.style,
|
|
13988
14081
|
listClass: VueTypes.string.def(''),
|
|
13989
14082
|
loader: types.title,
|
|
@@ -13995,7 +14088,7 @@
|
|
|
13995
14088
|
pages: VueTypes.number.def(5),
|
|
13996
14089
|
pagination: VueTypes.bool.def(false),
|
|
13997
14090
|
infiniteScroll: VueTypes.bool.def(true),
|
|
13998
|
-
paginationAt:
|
|
14091
|
+
paginationAt: VueTypes.oneOf(['top', 'bottom', 'both']).def('bottom'),
|
|
13999
14092
|
react: types.react,
|
|
14000
14093
|
scrollOnChange: VueTypes.bool.def(true),
|
|
14001
14094
|
showResultStats: VueTypes.bool.def(true),
|
|
@@ -14024,12 +14117,9 @@
|
|
|
14024
14117
|
return this.$listeners && this.$listeners.resultStats;
|
|
14025
14118
|
},
|
|
14026
14119
|
stats: function stats() {
|
|
14027
|
-
var _this$getAllData = this.getAllData(),
|
|
14028
|
-
filteredResults = _this$getAllData.filteredResults;
|
|
14029
|
-
|
|
14030
14120
|
return _extends({}, getResultStats(this), {
|
|
14031
14121
|
currentPage: this.currentPageState,
|
|
14032
|
-
displayedResults:
|
|
14122
|
+
displayedResults: this.data.length
|
|
14033
14123
|
});
|
|
14034
14124
|
},
|
|
14035
14125
|
hasCustomRender: function hasCustomRender() {
|
|
@@ -14038,6 +14128,27 @@
|
|
|
14038
14128
|
showInfiniteScroll: function showInfiniteScroll() {
|
|
14039
14129
|
// Pagination has higher priority then infinite scroll
|
|
14040
14130
|
return this.infiniteScroll && !this.shouldRenderPagination;
|
|
14131
|
+
},
|
|
14132
|
+
data: function data() {
|
|
14133
|
+
var results = parseHits(this.hits) || [];
|
|
14134
|
+
var parsedPromotedResults = parseHits(this.promotedResults) || [];
|
|
14135
|
+
var filteredResults = results;
|
|
14136
|
+
|
|
14137
|
+
if (parsedPromotedResults.length) {
|
|
14138
|
+
var ids = parsedPromotedResults.map(function (item) {
|
|
14139
|
+
return item._id;
|
|
14140
|
+
}).filter(Boolean);
|
|
14141
|
+
|
|
14142
|
+
if (ids) {
|
|
14143
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
14144
|
+
return !ids.includes(item._id);
|
|
14145
|
+
});
|
|
14146
|
+
}
|
|
14147
|
+
|
|
14148
|
+
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14149
|
+
}
|
|
14150
|
+
|
|
14151
|
+
return helper_2(filteredResults);
|
|
14041
14152
|
}
|
|
14042
14153
|
},
|
|
14043
14154
|
watch: {
|
|
@@ -14119,7 +14230,7 @@
|
|
|
14119
14230
|
}
|
|
14120
14231
|
},
|
|
14121
14232
|
hits: function hits(newVal, oldVal) {
|
|
14122
|
-
this.$emit('data', this.
|
|
14233
|
+
this.$emit('data', this.getData());
|
|
14123
14234
|
|
|
14124
14235
|
if (this.shouldRenderPagination) {
|
|
14125
14236
|
// called when page is changed
|
|
@@ -14178,11 +14289,11 @@
|
|
|
14178
14289
|
var options = getQueryOptions(this.$props);
|
|
14179
14290
|
options.from = this.$data.from;
|
|
14180
14291
|
|
|
14181
|
-
if (this
|
|
14292
|
+
if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
|
|
14182
14293
|
var _ref2;
|
|
14183
14294
|
|
|
14184
|
-
var sortField = this
|
|
14185
|
-
var sortBy = this
|
|
14295
|
+
var sortField = this.sortOptions[this.sortOptionIndex].dataField;
|
|
14296
|
+
var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
|
|
14186
14297
|
options.sort = [(_ref2 = {}, _ref2[sortField] = {
|
|
14187
14298
|
order: sortBy
|
|
14188
14299
|
}, _ref2)]; // To handle sort options for RS API
|
|
@@ -14252,10 +14363,10 @@
|
|
|
14252
14363
|
"class": this.$props.className
|
|
14253
14364
|
}, [this.isLoading && this.shouldRenderPagination && this.showInfiniteScroll && (this.$scopedSlots.loader || this.$props.loader), this.renderErrorComponent(), h(Flex, {
|
|
14254
14365
|
"attrs": {
|
|
14255
|
-
"labelPosition": this
|
|
14366
|
+
"labelPosition": this.sortOptions ? 'right' : 'left'
|
|
14256
14367
|
},
|
|
14257
14368
|
"class": getClassName$1(this.$props.innerClass, 'resultsInfo')
|
|
14258
|
-
}, [this
|
|
14369
|
+
}, [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, {
|
|
14259
14370
|
"attrs": {
|
|
14260
14371
|
"pages": this.$props.pages,
|
|
14261
14372
|
"totalPages": this.totalPages,
|
|
@@ -14304,13 +14415,10 @@
|
|
|
14304
14415
|
|
|
14305
14416
|
var h = this.$createElement;
|
|
14306
14417
|
var size = this.$props.size;
|
|
14307
|
-
var hits = this.$data.hits;
|
|
14308
|
-
var results = parseHits(hits) || [];
|
|
14309
|
-
var filteredResults = results;
|
|
14310
14418
|
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
14311
14419
|
var element = this.hasCustomRender ? this.getComponent() : h("div", {
|
|
14312
14420
|
"class": this.$props.listClass + " " + getClassName$1(this.$props.innerClass, 'list')
|
|
14313
|
-
}, [
|
|
14421
|
+
}, [this.data.map(function (item, index) {
|
|
14314
14422
|
return renderItem({
|
|
14315
14423
|
item: item,
|
|
14316
14424
|
triggerClickAnalytics: function triggerClickAnalytics() {
|
|
@@ -14321,7 +14429,7 @@
|
|
|
14321
14429
|
|
|
14322
14430
|
return this.analytics ? h(ImpressionTracker$1, {
|
|
14323
14431
|
"attrs": {
|
|
14324
|
-
"hits":
|
|
14432
|
+
"hits": this.data
|
|
14325
14433
|
}
|
|
14326
14434
|
}, [element]) : element;
|
|
14327
14435
|
},
|
|
@@ -14329,15 +14437,18 @@
|
|
|
14329
14437
|
var options = getQueryOptions(props);
|
|
14330
14438
|
options.from = this.$data.from;
|
|
14331
14439
|
|
|
14332
|
-
if (props.sortOptions) {
|
|
14333
|
-
var _ref5;
|
|
14334
|
-
|
|
14440
|
+
if (props.sortOptions && Array.isArray(props.sortOptions)) {
|
|
14335
14441
|
var sortOptionIndex = props.defaultSortOption ? props.sortOptions.findIndex(function (s) {
|
|
14336
14442
|
return s.label === props.defaultSortOption;
|
|
14337
14443
|
}) : 0;
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
|
|
14444
|
+
|
|
14445
|
+
if (props.sortOptions[sortOptionIndex]) {
|
|
14446
|
+
var _ref5;
|
|
14447
|
+
|
|
14448
|
+
options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
|
|
14449
|
+
order: props.sortOptions[sortOptionIndex].sortBy
|
|
14450
|
+
}, _ref5)];
|
|
14451
|
+
}
|
|
14341
14452
|
} else if (props.sortBy) {
|
|
14342
14453
|
var _ref6;
|
|
14343
14454
|
|
|
@@ -14433,31 +14544,39 @@
|
|
|
14433
14544
|
renderNoResult: function renderNoResult() {
|
|
14434
14545
|
var h = this.$createElement;
|
|
14435
14546
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
14547
|
+
|
|
14548
|
+
if (this.$scopedSlots.renderNoResults) {
|
|
14549
|
+
return isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults;
|
|
14550
|
+
}
|
|
14551
|
+
|
|
14436
14552
|
return h("p", {
|
|
14437
14553
|
"class": getClassName$1(this.$props.innerClass, 'noResults') || null
|
|
14438
14554
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
14439
14555
|
},
|
|
14440
14556
|
handleSortChange: function handleSortChange(e) {
|
|
14441
|
-
var
|
|
14557
|
+
var index = e.target.value;
|
|
14442
14558
|
|
|
14443
|
-
|
|
14559
|
+
if (this.sortOptions && this.sortOptions[index]) {
|
|
14560
|
+
var _ref7;
|
|
14444
14561
|
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14562
|
+
// This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
|
|
14563
|
+
var options = getQueryOptions(this.$props);
|
|
14564
|
+
options.from = 0;
|
|
14565
|
+
var sortField = this.sortOptions[index].dataField;
|
|
14566
|
+
var sortBy = this.sortOptions[index].sortBy;
|
|
14567
|
+
options.sort = [(_ref7 = {}, _ref7[sortField] = {
|
|
14568
|
+
order: sortBy
|
|
14569
|
+
}, _ref7)];
|
|
14570
|
+
this.sortOptionIndex = index; // To handle sort options for RS API
|
|
14571
|
+
|
|
14572
|
+
this.updateComponentProps(this.componentId, {
|
|
14573
|
+
dataField: sortField,
|
|
14574
|
+
sortBy: sortBy
|
|
14575
|
+
}, constants_1$1.reactiveList);
|
|
14576
|
+
this.setQueryOptions(this.$props.componentId, options, true);
|
|
14577
|
+
this.currentPageState = 0;
|
|
14578
|
+
this.from = 0;
|
|
14579
|
+
}
|
|
14461
14580
|
},
|
|
14462
14581
|
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
14463
14582
|
var docId = documentId;
|
|
@@ -14491,7 +14610,7 @@
|
|
|
14491
14610
|
"domProps": {
|
|
14492
14611
|
"value": this.sortOptionIndex
|
|
14493
14612
|
}
|
|
14494
|
-
}, [this
|
|
14613
|
+
}, [this.sortOptions.map(function (sort, index) {
|
|
14495
14614
|
return h("option", {
|
|
14496
14615
|
"key": sort.label,
|
|
14497
14616
|
"domProps": {
|
|
@@ -14501,8 +14620,8 @@
|
|
|
14501
14620
|
})]);
|
|
14502
14621
|
},
|
|
14503
14622
|
withClickIds: function withClickIds(results) {
|
|
14504
|
-
var _this$
|
|
14505
|
-
base = _this$
|
|
14623
|
+
var _this$getAllData = this.getAllData(),
|
|
14624
|
+
base = _this$getAllData.base;
|
|
14506
14625
|
|
|
14507
14626
|
return results.map(function (result, index) {
|
|
14508
14627
|
return _extends({}, result, {
|
|
@@ -14520,26 +14639,9 @@
|
|
|
14520
14639
|
hits = this.hits;
|
|
14521
14640
|
var results = parseHits(hits) || [];
|
|
14522
14641
|
var parsedPromotedResults = parseHits(promotedResults) || [];
|
|
14523
|
-
var filteredResults = results;
|
|
14524
14642
|
var base = currentPage * size;
|
|
14525
|
-
|
|
14526
|
-
if (parsedPromotedResults.length) {
|
|
14527
|
-
var ids = parsedPromotedResults.map(function (item) {
|
|
14528
|
-
return item._id;
|
|
14529
|
-
}).filter(Boolean);
|
|
14530
|
-
|
|
14531
|
-
if (ids) {
|
|
14532
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
14533
|
-
return !ids.includes(item._id);
|
|
14534
|
-
});
|
|
14535
|
-
}
|
|
14536
|
-
|
|
14537
|
-
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14538
|
-
}
|
|
14539
|
-
|
|
14540
14643
|
return {
|
|
14541
14644
|
results: results,
|
|
14542
|
-
filteredResults: filteredResults,
|
|
14543
14645
|
customData: customData || {},
|
|
14544
14646
|
promotedResults: parsedPromotedResults,
|
|
14545
14647
|
aggregationData: aggregationData,
|
|
@@ -14549,14 +14651,13 @@
|
|
|
14549
14651
|
};
|
|
14550
14652
|
},
|
|
14551
14653
|
getData: function getData() {
|
|
14552
|
-
var _this$
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
customData = _this$getAllData3.customData;
|
|
14654
|
+
var _this$getAllData2 = this.getAllData(),
|
|
14655
|
+
promotedResults = _this$getAllData2.promotedResults,
|
|
14656
|
+
aggregationData = _this$getAllData2.aggregationData,
|
|
14657
|
+
customData = _this$getAllData2.customData;
|
|
14557
14658
|
|
|
14558
14659
|
return {
|
|
14559
|
-
data: this.
|
|
14660
|
+
data: this.data,
|
|
14560
14661
|
aggregationData: this.withClickIds(aggregationData || []),
|
|
14561
14662
|
promotedData: this.withClickIds(promotedResults || []),
|
|
14562
14663
|
rawData: this.rawData,
|
|
@@ -14615,11 +14716,7 @@
|
|
|
14615
14716
|
}; // Only used for SSR
|
|
14616
14717
|
|
|
14617
14718
|
ReactiveList.generateQueryOptions = function (props) {
|
|
14618
|
-
|
|
14619
|
-
var options = getQueryOptions(_extends({
|
|
14620
|
-
includeFields: ['*'],
|
|
14621
|
-
excludeFields: []
|
|
14622
|
-
}, props));
|
|
14719
|
+
var options = getQueryOptions(props);
|
|
14623
14720
|
var size = props.size,
|
|
14624
14721
|
dataField = props.dataField,
|
|
14625
14722
|
defaultSortOption = props.defaultSortOption,
|
|
@@ -15439,8 +15536,33 @@
|
|
|
15439
15536
|
return encodedHeaders;
|
|
15440
15537
|
}
|
|
15441
15538
|
|
|
15442
|
-
function
|
|
15539
|
+
function getMongoRequest(app, mongo) {
|
|
15540
|
+
var mongodb = {};
|
|
15541
|
+
|
|
15542
|
+
if (app) {
|
|
15543
|
+
mongodb.index = app;
|
|
15544
|
+
}
|
|
15545
|
+
|
|
15546
|
+
if (mongo) {
|
|
15547
|
+
if (mongo.db) {
|
|
15548
|
+
mongodb.db = mongo.db;
|
|
15549
|
+
}
|
|
15550
|
+
|
|
15551
|
+
if (mongo.collection) {
|
|
15552
|
+
mongodb.collection = mongo.collection;
|
|
15553
|
+
}
|
|
15554
|
+
}
|
|
15555
|
+
|
|
15556
|
+
return mongodb;
|
|
15557
|
+
}
|
|
15558
|
+
|
|
15559
|
+
function getTelemetryHeaders(enableTelemetry, shouldSetHeaders) {
|
|
15443
15560
|
var headers = {};
|
|
15561
|
+
|
|
15562
|
+
if (!shouldSetHeaders) {
|
|
15563
|
+
return headers;
|
|
15564
|
+
}
|
|
15565
|
+
|
|
15444
15566
|
Object.assign(headers, {
|
|
15445
15567
|
'X-Search-Client': 'Appbase JS'
|
|
15446
15568
|
});
|
|
@@ -15453,6 +15575,133 @@
|
|
|
15453
15575
|
|
|
15454
15576
|
return headers;
|
|
15455
15577
|
}
|
|
15578
|
+
|
|
15579
|
+
var backendAlias = {
|
|
15580
|
+
MONGODB: 'mongodb',
|
|
15581
|
+
// mongodb
|
|
15582
|
+
ELASTICSEARCH: 'elasticsearch' // elasticsearch
|
|
15583
|
+
|
|
15584
|
+
};
|
|
15585
|
+
var dataTypes = {
|
|
15586
|
+
ARRAY: 'array',
|
|
15587
|
+
FUNCTION: 'function',
|
|
15588
|
+
OBJECT: 'object',
|
|
15589
|
+
NUMBER: 'number',
|
|
15590
|
+
BOOLEAN: 'boolean',
|
|
15591
|
+
STRING: 'string'
|
|
15592
|
+
};
|
|
15593
|
+
|
|
15594
|
+
var checkDataType = function checkDataType(temp) {
|
|
15595
|
+
// eslint-disable-next-line
|
|
15596
|
+
if ((typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp)) === dataTypes.OBJECT) {
|
|
15597
|
+
if (Array.isArray(temp)) {
|
|
15598
|
+
return dataTypes.ARRAY;
|
|
15599
|
+
}
|
|
15600
|
+
|
|
15601
|
+
return dataTypes.OBJECT;
|
|
15602
|
+
}
|
|
15603
|
+
|
|
15604
|
+
return typeof temp === 'undefined' ? 'undefined' : _typeof$1(temp);
|
|
15605
|
+
};
|
|
15606
|
+
|
|
15607
|
+
function validateSchema() {
|
|
15608
|
+
var passedProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15609
|
+
var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15610
|
+
var backendName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
15611
|
+
var passedPropertiesKeys = Object.keys(passedProperties).filter(function (propertyKey) {
|
|
15612
|
+
return !!passedProperties[propertyKey];
|
|
15613
|
+
});
|
|
15614
|
+
var acceptedProperties = Object.keys(schema);
|
|
15615
|
+
var requiredProperties = []; // fetch required properties
|
|
15616
|
+
|
|
15617
|
+
acceptedProperties.forEach(function (propName) {
|
|
15618
|
+
var currentProperty = schema[propName];
|
|
15619
|
+
|
|
15620
|
+
if (currentProperty.required) {
|
|
15621
|
+
requiredProperties.push(propName);
|
|
15622
|
+
}
|
|
15623
|
+
}); // check for required properties
|
|
15624
|
+
|
|
15625
|
+
requiredProperties.forEach(function (requiredProperty) {
|
|
15626
|
+
if (!passedPropertiesKeys.includes(requiredProperty)) {
|
|
15627
|
+
throw new Error(requiredProperty + ' is required when using the ' + backendName + ' Search backend.');
|
|
15628
|
+
}
|
|
15629
|
+
}); // check for accepted properties
|
|
15630
|
+
|
|
15631
|
+
passedPropertiesKeys.forEach(function (passedPropertyKey) {
|
|
15632
|
+
if (!acceptedProperties.includes(passedPropertyKey)) {
|
|
15633
|
+
throw new Error(passedPropertyKey + ' property isn\'t accepted property by ' + backendName + ' backend.');
|
|
15634
|
+
}
|
|
15635
|
+
|
|
15636
|
+
var acceptedTypes = Array.isArray(schema[passedPropertyKey].type) ? schema[passedPropertyKey].type : [].concat(schema[passedPropertyKey].type);
|
|
15637
|
+
var receivedPropertyType = checkDataType(passedProperties[passedPropertyKey]);
|
|
15638
|
+
|
|
15639
|
+
if (!acceptedTypes.includes(receivedPropertyType)) {
|
|
15640
|
+
throw new Error('The property ' + passedPropertyKey + ' is expected with type(s) [' + acceptedTypes.join(', ') + '], but type was set as ' + receivedPropertyType + '.');
|
|
15641
|
+
}
|
|
15642
|
+
});
|
|
15643
|
+
}
|
|
15644
|
+
|
|
15645
|
+
var mongodb = {
|
|
15646
|
+
url: {
|
|
15647
|
+
type: dataTypes.STRING,
|
|
15648
|
+
required: true
|
|
15649
|
+
},
|
|
15650
|
+
app: {
|
|
15651
|
+
type: dataTypes.STRING,
|
|
15652
|
+
required: false
|
|
15653
|
+
},
|
|
15654
|
+
credentials: {
|
|
15655
|
+
type: dataTypes.STRING,
|
|
15656
|
+
required: false
|
|
15657
|
+
},
|
|
15658
|
+
enableTelemetry: {
|
|
15659
|
+
type: dataTypes.BOOLEAN,
|
|
15660
|
+
required: false
|
|
15661
|
+
},
|
|
15662
|
+
mongodb: {
|
|
15663
|
+
type: dataTypes.OBJECT,
|
|
15664
|
+
required: true
|
|
15665
|
+
},
|
|
15666
|
+
username: {
|
|
15667
|
+
type: dataTypes.STRING,
|
|
15668
|
+
required: false
|
|
15669
|
+
},
|
|
15670
|
+
password: {
|
|
15671
|
+
type: dataTypes.STRING,
|
|
15672
|
+
required: false
|
|
15673
|
+
}
|
|
15674
|
+
};
|
|
15675
|
+
var elasticsearch = {
|
|
15676
|
+
url: {
|
|
15677
|
+
type: dataTypes.STRING,
|
|
15678
|
+
required: true
|
|
15679
|
+
},
|
|
15680
|
+
app: {
|
|
15681
|
+
type: dataTypes.STRING,
|
|
15682
|
+
required: true
|
|
15683
|
+
},
|
|
15684
|
+
credentials: {
|
|
15685
|
+
type: dataTypes.STRING,
|
|
15686
|
+
required: false
|
|
15687
|
+
},
|
|
15688
|
+
enableTelemetry: {
|
|
15689
|
+
type: dataTypes.BOOLEAN,
|
|
15690
|
+
required: false
|
|
15691
|
+
},
|
|
15692
|
+
username: {
|
|
15693
|
+
type: dataTypes.STRING,
|
|
15694
|
+
required: false
|
|
15695
|
+
},
|
|
15696
|
+
password: {
|
|
15697
|
+
type: dataTypes.STRING,
|
|
15698
|
+
required: false
|
|
15699
|
+
}
|
|
15700
|
+
};
|
|
15701
|
+
var SCHEMA = {
|
|
15702
|
+
mongodb: mongodb,
|
|
15703
|
+
elasticsearch: elasticsearch
|
|
15704
|
+
};
|
|
15456
15705
|
/**
|
|
15457
15706
|
* Returns an instance of Appbase client
|
|
15458
15707
|
* @param {Object} config To configure properties
|
|
@@ -15462,10 +15711,10 @@
|
|
|
15462
15711
|
* @param {String} config.username
|
|
15463
15712
|
* @param {String} config.password
|
|
15464
15713
|
* @param {Boolean} config.enableTelemetry
|
|
15714
|
+
* @param {Object} config.mongodb
|
|
15465
15715
|
* A callback function which will be invoked before a fetch request made
|
|
15466
15716
|
*/
|
|
15467
15717
|
|
|
15468
|
-
|
|
15469
15718
|
function AppBase(config) {
|
|
15470
15719
|
var _URL = urlParserLite(config.url || ''),
|
|
15471
15720
|
_URL$auth = _URL.auth,
|
|
@@ -15477,30 +15726,42 @@
|
|
|
15477
15726
|
_URL$protocol = _URL.protocol,
|
|
15478
15727
|
protocol = _URL$protocol === undefined ? '' : _URL$protocol;
|
|
15479
15728
|
|
|
15480
|
-
var url =
|
|
15729
|
+
var url = config.url;
|
|
15730
|
+
url = host + path; // Parse url
|
|
15481
15731
|
|
|
15482
|
-
if (
|
|
15483
|
-
|
|
15732
|
+
if (url.slice(-1) === '/') {
|
|
15733
|
+
url = url.slice(0, -1);
|
|
15484
15734
|
}
|
|
15485
15735
|
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15736
|
+
var backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH']; // eslint-disable-next-line
|
|
15737
|
+
|
|
15738
|
+
var schema = SCHEMA[backendName];
|
|
15739
|
+
validateSchema({
|
|
15740
|
+
url: config.url,
|
|
15741
|
+
app: config.app,
|
|
15742
|
+
credentials: config.credentials,
|
|
15743
|
+
username: config.username,
|
|
15744
|
+
password: config.password,
|
|
15745
|
+
enableTelemetry: config.enableTelemetry,
|
|
15746
|
+
mongodb: config.mongodb
|
|
15747
|
+
}, schema, backendName);
|
|
15489
15748
|
|
|
15490
15749
|
if (typeof protocol !== 'string' || protocol === '') {
|
|
15491
15750
|
throw new Error('Protocol is not present in url. URL should be of the form https://appbase-demo-ansible-abxiydt-arc.searchbase.io');
|
|
15492
|
-
} // Parse url
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
if (url.slice(-1) === '/') {
|
|
15496
|
-
url = url.slice(0, -1);
|
|
15497
15751
|
}
|
|
15498
15752
|
|
|
15499
15753
|
var credentials = auth || null;
|
|
15754
|
+
|
|
15755
|
+
if (!config.mongodb) {
|
|
15756
|
+
if (isAppbase(url) && credentials === null) {
|
|
15757
|
+
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15758
|
+
}
|
|
15759
|
+
}
|
|
15500
15760
|
/**
|
|
15501
15761
|
* Credentials can be provided as a part of the URL,
|
|
15502
15762
|
* as username, password args or as a credentials argument directly */
|
|
15503
15763
|
|
|
15764
|
+
|
|
15504
15765
|
if (typeof config.credentials === 'string' && config.credentials !== '') {
|
|
15505
15766
|
// eslint-disable-next-line
|
|
15506
15767
|
credentials = config.credentials;
|
|
@@ -15508,15 +15769,15 @@
|
|
|
15508
15769
|
credentials = config.username + ':' + config.password;
|
|
15509
15770
|
}
|
|
15510
15771
|
|
|
15511
|
-
if (isAppbase(url) && credentials === null) {
|
|
15512
|
-
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15513
|
-
}
|
|
15514
|
-
|
|
15515
15772
|
this.url = url;
|
|
15516
15773
|
this.protocol = protocol;
|
|
15517
15774
|
this.app = config.app;
|
|
15518
15775
|
this.credentials = credentials;
|
|
15519
15776
|
|
|
15777
|
+
if (config.mongodb) {
|
|
15778
|
+
this.mongodb = config.mongodb;
|
|
15779
|
+
}
|
|
15780
|
+
|
|
15520
15781
|
if (typeof config.enableTelemetry === 'boolean') {
|
|
15521
15782
|
this.enableTelemetry = config.enableTelemetry;
|
|
15522
15783
|
}
|
|
@@ -15545,7 +15806,9 @@
|
|
|
15545
15806
|
params = parsedArgs.params,
|
|
15546
15807
|
body = parsedArgs.body,
|
|
15547
15808
|
isRSAPI = parsedArgs.isRSAPI,
|
|
15548
|
-
isSuggestionsAPI = parsedArgs.isSuggestionsAPI
|
|
15809
|
+
isSuggestionsAPI = parsedArgs.isSuggestionsAPI,
|
|
15810
|
+
_parsedArgs$isMongoRe = parsedArgs.isMongoRequest,
|
|
15811
|
+
isMongoRequest = _parsedArgs$isMongoRe === undefined ? false : _parsedArgs$isMongoRe;
|
|
15549
15812
|
var app = isSuggestionsAPI ? '.suggestions' : _this.app;
|
|
15550
15813
|
var bodyCopy = body;
|
|
15551
15814
|
var contentType = path.endsWith('msearch') || path.endsWith('bulk') ? 'application/x-ndjson' : 'application/json';
|
|
@@ -15596,7 +15859,7 @@
|
|
|
15596
15859
|
paramsString = '?' + querystring.stringify(params);
|
|
15597
15860
|
}
|
|
15598
15861
|
|
|
15599
|
-
var finalURL = _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15862
|
+
var finalURL = isMongoRequest ? _this.protocol + '://' + _this.url : _this.protocol + '://' + _this.url + '/' + app + '/' + path + paramsString;
|
|
15600
15863
|
return handleTransformRequest(Object.assign({}, {
|
|
15601
15864
|
url: finalURL
|
|
15602
15865
|
}, requestOptions)).then(function (ts) {
|
|
@@ -15605,7 +15868,7 @@
|
|
|
15605
15868
|
delete transformedRequest.url;
|
|
15606
15869
|
return browserPonyfill$1(url || finalURL, Object.assign({}, transformedRequest, {
|
|
15607
15870
|
// apply timestamp header for RS API
|
|
15608
|
-
headers: isRSAPI ? Object.assign({}, transformedRequest.headers, {
|
|
15871
|
+
headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
|
|
15609
15872
|
'x-timestamp': new Date().getTime()
|
|
15610
15873
|
}) : transformedRequest.headers
|
|
15611
15874
|
})).then(function (res) {
|
|
@@ -15633,7 +15896,7 @@
|
|
|
15633
15896
|
|
|
15634
15897
|
if (data) {
|
|
15635
15898
|
Object.keys(data).forEach(function (key) {
|
|
15636
|
-
if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error')) {
|
|
15899
|
+
if (data[key] && Object.prototype.hasOwnProperty.call(data[key], 'error') && !!data[key].error) {
|
|
15637
15900
|
errorResponses += 1;
|
|
15638
15901
|
}
|
|
15639
15902
|
});
|
|
@@ -15970,12 +16233,20 @@
|
|
|
15970
16233
|
settings: parsedSettings,
|
|
15971
16234
|
query: query
|
|
15972
16235
|
};
|
|
16236
|
+
|
|
16237
|
+
if (this.mongodb) {
|
|
16238
|
+
Object.assign(body, {
|
|
16239
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16240
|
+
});
|
|
16241
|
+
}
|
|
16242
|
+
|
|
15973
16243
|
return this.performFetchRequest({
|
|
15974
16244
|
method: 'POST',
|
|
15975
16245
|
path: '_reactivesearch',
|
|
15976
16246
|
body: body,
|
|
15977
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
15978
|
-
isRSAPI: true
|
|
16247
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16248
|
+
isRSAPI: true,
|
|
16249
|
+
isMongoRequest: !!this.mongodb
|
|
15979
16250
|
});
|
|
15980
16251
|
}
|
|
15981
16252
|
/**
|
|
@@ -16002,12 +16273,20 @@
|
|
|
16002
16273
|
settings: parsedSettings,
|
|
16003
16274
|
query: query
|
|
16004
16275
|
};
|
|
16276
|
+
|
|
16277
|
+
if (this.mongodb) {
|
|
16278
|
+
Object.assign(body, {
|
|
16279
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16280
|
+
});
|
|
16281
|
+
}
|
|
16282
|
+
|
|
16005
16283
|
return this.performFetchRequest({
|
|
16006
16284
|
method: 'POST',
|
|
16007
16285
|
path: '_reactivesearch.v3',
|
|
16008
16286
|
body: body,
|
|
16009
|
-
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16010
|
-
isRSAPI: true
|
|
16287
|
+
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
16288
|
+
isRSAPI: true,
|
|
16289
|
+
isMongoRequest: !!this.mongodb
|
|
16011
16290
|
});
|
|
16012
16291
|
}
|
|
16013
16292
|
/**
|
|
@@ -16045,13 +16324,21 @@
|
|
|
16045
16324
|
settings: parsedSettings,
|
|
16046
16325
|
query: query
|
|
16047
16326
|
};
|
|
16327
|
+
|
|
16328
|
+
if (this.mongodb) {
|
|
16329
|
+
Object.assign(body, {
|
|
16330
|
+
mongodb: getMongoRequest(this.app, this.mongodb)
|
|
16331
|
+
});
|
|
16332
|
+
}
|
|
16333
|
+
|
|
16048
16334
|
return this.performFetchRequest({
|
|
16049
16335
|
method: 'POST',
|
|
16050
16336
|
path: '_reactivesearch.v3',
|
|
16051
16337
|
body: body,
|
|
16052
16338
|
headers: getTelemetryHeaders(this.enableTelemetry),
|
|
16053
16339
|
isRSAPI: true,
|
|
16054
|
-
isSuggestionsAPI: true
|
|
16340
|
+
isSuggestionsAPI: true,
|
|
16341
|
+
isMongoRequest: !!this.mongodb
|
|
16055
16342
|
});
|
|
16056
16343
|
}
|
|
16057
16344
|
|
|
@@ -16511,7 +16798,7 @@
|
|
|
16511
16798
|
headers: types.headers,
|
|
16512
16799
|
getSearchParams: types.func,
|
|
16513
16800
|
setSearchParams: types.func,
|
|
16514
|
-
as:
|
|
16801
|
+
as: VueTypes.string.def('div')
|
|
16515
16802
|
},
|
|
16516
16803
|
mounted: function mounted() {
|
|
16517
16804
|
var _this = this;
|
|
@@ -16659,7 +16946,9 @@
|
|
|
16659
16946
|
return value.map(function (item) {
|
|
16660
16947
|
return _this3.getValue(item);
|
|
16661
16948
|
});
|
|
16662
|
-
}
|
|
16949
|
+
}
|
|
16950
|
+
|
|
16951
|
+
if (value && typeof value === 'object') {
|
|
16663
16952
|
// TODO: support for NestedList
|
|
16664
16953
|
if (value.location) return value;
|
|
16665
16954
|
if (value.category) return value;
|
|
@@ -16784,7 +17073,7 @@
|
|
|
16784
17073
|
}
|
|
16785
17074
|
},
|
|
16786
17075
|
props: {
|
|
16787
|
-
app: types.
|
|
17076
|
+
app: types.string,
|
|
16788
17077
|
analytics: VueTypes.bool,
|
|
16789
17078
|
analyticsConfig: types.analyticsConfig,
|
|
16790
17079
|
appbaseConfig: types.appbaseConfig,
|
|
@@ -16804,7 +17093,8 @@
|
|
|
16804
17093
|
transformResponse: types.func,
|
|
16805
17094
|
as: VueTypes.string.def('div'),
|
|
16806
17095
|
getSearchParams: types.func,
|
|
16807
|
-
setSearchParams: types.func
|
|
17096
|
+
setSearchParams: types.func,
|
|
17097
|
+
mongodb: types.mongodb
|
|
16808
17098
|
},
|
|
16809
17099
|
provide: function provide() {
|
|
16810
17100
|
return {
|
|
@@ -16844,6 +17134,9 @@
|
|
|
16844
17134
|
this.store.dispatch(analytics_3$1(newVal));
|
|
16845
17135
|
}
|
|
16846
17136
|
}
|
|
17137
|
+
},
|
|
17138
|
+
mongodb: function mongodb() {
|
|
17139
|
+
this.updateState(this.$props);
|
|
16847
17140
|
}
|
|
16848
17141
|
},
|
|
16849
17142
|
computed: {
|
|
@@ -16851,12 +17144,13 @@
|
|
|
16851
17144
|
var _this$$props = this.$props,
|
|
16852
17145
|
enableAppbase = _this$$props.enableAppbase,
|
|
16853
17146
|
headers = _this$$props.headers,
|
|
16854
|
-
appbaseConfig = _this$$props.appbaseConfig
|
|
17147
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
17148
|
+
mongodb = _this$$props.mongodb;
|
|
16855
17149
|
|
|
16856
17150
|
var _ref = appbaseConfig || {},
|
|
16857
17151
|
enableTelemetry = _ref.enableTelemetry;
|
|
16858
17152
|
|
|
16859
|
-
return _extends({}, enableAppbase && _extends({
|
|
17153
|
+
return _extends({}, enableAppbase && !mongodb && _extends({
|
|
16860
17154
|
'X-Search-Client': X_SEARCH_CLIENT
|
|
16861
17155
|
}, enableTelemetry === false && {
|
|
16862
17156
|
'X-Enable-Telemetry': false
|
|
@@ -16874,7 +17168,7 @@
|
|
|
16874
17168
|
var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
16875
17169
|
|
|
16876
17170
|
var config = {
|
|
16877
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
17171
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
16878
17172
|
app: props.app,
|
|
16879
17173
|
credentials: credentials,
|
|
16880
17174
|
type: props.type ? props.type : '*',
|
|
@@ -16882,7 +17176,8 @@
|
|
|
16882
17176
|
transformResponse: props.transformResponse,
|
|
16883
17177
|
enableAppbase: props.enableAppbase,
|
|
16884
17178
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
16885
|
-
analyticsConfig: appbaseConfig
|
|
17179
|
+
analyticsConfig: appbaseConfig,
|
|
17180
|
+
mongodb: props.mongodb
|
|
16886
17181
|
};
|
|
16887
17182
|
var queryParams = '';
|
|
16888
17183
|
|
|
@@ -18264,24 +18559,22 @@
|
|
|
18264
18559
|
|
|
18265
18560
|
return __webpack_require__(0);
|
|
18266
18561
|
/******/
|
|
18267
|
-
}
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
/***/
|
|
18271
|
-
|
|
18272
|
-
/* 1 */
|
|
18273
|
-
|
|
18274
|
-
/***/
|
|
18275
|
-
|
|
18276
|
-
/* 2 */
|
|
18562
|
+
}
|
|
18563
|
+
/************************************************************************/
|
|
18277
18564
|
|
|
18278
|
-
|
|
18565
|
+
/******/
|
|
18566
|
+
([
|
|
18567
|
+
/* 0 */
|
|
18279
18568
|
|
|
18280
|
-
|
|
18569
|
+
/***/
|
|
18281
18570
|
function (module, exports, __webpack_require__) {
|
|
18282
18571
|
module.exports = __webpack_require__(1);
|
|
18283
18572
|
/***/
|
|
18284
|
-
},
|
|
18573
|
+
},
|
|
18574
|
+
/* 1 */
|
|
18575
|
+
|
|
18576
|
+
/***/
|
|
18577
|
+
function (module, exports, __webpack_require__) {
|
|
18285
18578
|
|
|
18286
18579
|
Object.defineProperty(exports, "__esModule", {
|
|
18287
18580
|
value: true
|
|
@@ -18314,7 +18607,11 @@
|
|
|
18314
18607
|
}
|
|
18315
18608
|
});
|
|
18316
18609
|
/***/
|
|
18317
|
-
},
|
|
18610
|
+
},
|
|
18611
|
+
/* 2 */
|
|
18612
|
+
|
|
18613
|
+
/***/
|
|
18614
|
+
function (module, exports) {
|
|
18318
18615
|
|
|
18319
18616
|
Object.defineProperty(exports, "__esModule", {
|
|
18320
18617
|
value: true
|
|
@@ -18483,7 +18780,9 @@
|
|
|
18483
18780
|
}
|
|
18484
18781
|
/***/
|
|
18485
18782
|
|
|
18486
|
-
}
|
|
18783
|
+
}
|
|
18784
|
+
/******/
|
|
18785
|
+
]);
|
|
18487
18786
|
});
|
|
18488
18787
|
unwrapExports(dist);
|
|
18489
18788
|
var dist_1 = dist.findAll;
|
|
@@ -19213,8 +19512,8 @@
|
|
|
19213
19512
|
name: 'Mic',
|
|
19214
19513
|
props: {
|
|
19215
19514
|
children: types.title,
|
|
19216
|
-
lang:
|
|
19217
|
-
iconPosition:
|
|
19515
|
+
lang: VueTypes.string.def('en-US'),
|
|
19516
|
+
iconPosition: VueTypes.string.def('left'),
|
|
19218
19517
|
handleResult: types.func,
|
|
19219
19518
|
onNoMatch: types.func,
|
|
19220
19519
|
onError: types.func,
|
|
@@ -19626,10 +19925,10 @@
|
|
|
19626
19925
|
})]),
|
|
19627
19926
|
aggregationField: types.string,
|
|
19628
19927
|
aggregationSize: VueTypes.number,
|
|
19629
|
-
size: VueTypes.number
|
|
19928
|
+
size: VueTypes.number,
|
|
19630
19929
|
debounce: VueTypes.number.def(0),
|
|
19631
19930
|
defaultValue: types.string,
|
|
19632
|
-
excludeFields: types.excludeFields
|
|
19931
|
+
excludeFields: types.excludeFields,
|
|
19633
19932
|
value: types.value,
|
|
19634
19933
|
defaultSuggestions: types.suggestions,
|
|
19635
19934
|
enableSynonyms: VueTypes.bool.def(true),
|
|
@@ -19643,9 +19942,9 @@
|
|
|
19643
19942
|
highlightField: types.stringOrArray,
|
|
19644
19943
|
icon: types.children,
|
|
19645
19944
|
iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
|
|
19646
|
-
includeFields: types.includeFields
|
|
19945
|
+
includeFields: types.includeFields,
|
|
19647
19946
|
innerClass: types.style,
|
|
19648
|
-
innerRef:
|
|
19947
|
+
innerRef: VueTypes.string.def('searchInputField'),
|
|
19649
19948
|
render: types.func,
|
|
19650
19949
|
renderQuerySuggestions: types.func,
|
|
19651
19950
|
renderPopularSuggestions: types.func,
|
|
@@ -19677,7 +19976,7 @@
|
|
|
19677
19976
|
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
19678
19977
|
addonBefore: VueTypes.any,
|
|
19679
19978
|
addonAfter: VueTypes.any,
|
|
19680
|
-
expandSuggestionsContainer:
|
|
19979
|
+
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
19681
19980
|
index: VueTypes.string
|
|
19682
19981
|
},
|
|
19683
19982
|
beforeMount: function beforeMount() {
|
|
@@ -20338,7 +20637,7 @@
|
|
|
20338
20637
|
highlightedIndex: highlightedIndex
|
|
20339
20638
|
}), _this3.renderErrorComponent(), !_this3.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
20340
20639
|
"class": suggestions$1(_this3.themePreset, theme) + " " + getClassName$3(_this3.$props.innerClass, 'list')
|
|
20341
|
-
}, [_this3.suggestionsList.slice(0, size).map(function (item, index) {
|
|
20640
|
+
}, [_this3.suggestionsList.slice(0, size || 10).map(function (item, index) {
|
|
20342
20641
|
return h("li", {
|
|
20343
20642
|
"domProps": _extends({}, getItemProps({
|
|
20344
20643
|
item: item
|
|
@@ -20817,7 +21116,7 @@
|
|
|
20817
21116
|
name: 'SingleList',
|
|
20818
21117
|
props: {
|
|
20819
21118
|
beforeValueChange: types.func,
|
|
20820
|
-
className:
|
|
21119
|
+
className: VueTypes.string.def(''),
|
|
20821
21120
|
componentId: types.stringRequired,
|
|
20822
21121
|
customQuery: types.func,
|
|
20823
21122
|
dataField: types.stringRequired,
|
|
@@ -20837,7 +21136,7 @@
|
|
|
20837
21136
|
showFilter: VueTypes.bool.def(true),
|
|
20838
21137
|
showRadio: VueTypes.bool.def(true),
|
|
20839
21138
|
showSearch: VueTypes.bool.def(true),
|
|
20840
|
-
size: VueTypes.number
|
|
21139
|
+
size: VueTypes.number,
|
|
20841
21140
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
20842
21141
|
title: types.title,
|
|
20843
21142
|
URLParams: VueTypes.bool.def(false),
|
|
@@ -20951,7 +21250,7 @@
|
|
|
20951
21250
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
20952
21251
|
if (String(item.key).length) {
|
|
20953
21252
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
20954
|
-
return String(item.key).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
21253
|
+
return suggestions_1(String(item.key)).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
|
|
20955
21254
|
}
|
|
20956
21255
|
|
|
20957
21256
|
return true;
|
|
@@ -21298,7 +21597,7 @@
|
|
|
21298
21597
|
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
21299
21598
|
showCheckbox: VueTypes.bool.def(true),
|
|
21300
21599
|
beforeValueChange: types.func,
|
|
21301
|
-
className:
|
|
21600
|
+
className: VueTypes.string.def(''),
|
|
21302
21601
|
componentId: types.stringRequired,
|
|
21303
21602
|
customQuery: types.func,
|
|
21304
21603
|
dataField: types.stringRequired,
|
|
@@ -21445,7 +21744,7 @@
|
|
|
21445
21744
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
21446
21745
|
if (String(item.key).length) {
|
|
21447
21746
|
if (_this2.$props.showSearch && _this2.$data.searchTerm) {
|
|
21448
|
-
return String(item.key).toLowerCase().includes(_this2.$data.searchTerm.toLowerCase());
|
|
21747
|
+
return suggestions_1(String(item.key)).toLowerCase().includes(suggestions_1(_this2.$data.searchTerm).toLowerCase());
|
|
21449
21748
|
}
|
|
21450
21749
|
|
|
21451
21750
|
return true;
|
|
@@ -21947,7 +22246,7 @@
|
|
|
21947
22246
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
21948
22247
|
if (String(item[labelField]).length) {
|
|
21949
22248
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
21950
|
-
return String(item[labelField]).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
22249
|
+
return suggestions_1(String(item[labelField])).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
|
|
21951
22250
|
}
|
|
21952
22251
|
|
|
21953
22252
|
return true;
|
|
@@ -22011,7 +22310,8 @@
|
|
|
22011
22310
|
}
|
|
22012
22311
|
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
22013
22312
|
var selected = _this.$props.multi // MultiDropdownList
|
|
22014
|
-
&& (selectedItem && !!selectedItem[item[keyField]]
|
|
22313
|
+
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
22314
|
+
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
22015
22315
|
return value[labelField] === item[labelField];
|
|
22016
22316
|
}));
|
|
22017
22317
|
if (!_this.$props.multi) selected = item.key === selectedItem;
|
|
@@ -22299,7 +22599,9 @@
|
|
|
22299
22599
|
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
22300
22600
|
if (renderNoResults && isFunction$1(renderNoResults)) {
|
|
22301
22601
|
return h("div", [renderNoResults()]);
|
|
22302
|
-
}
|
|
22602
|
+
}
|
|
22603
|
+
|
|
22604
|
+
if (renderNoResults && !isFunction$1(renderNoResults)) {
|
|
22303
22605
|
return renderNoResults;
|
|
22304
22606
|
}
|
|
22305
22607
|
|
|
@@ -23145,7 +23447,7 @@
|
|
|
23145
23447
|
componentId: types.stringRequired,
|
|
23146
23448
|
data: types.data,
|
|
23147
23449
|
dataField: types.stringRequired,
|
|
23148
|
-
defaultValue: types.
|
|
23450
|
+
defaultValue: types.any,
|
|
23149
23451
|
value: types.stringOrArray,
|
|
23150
23452
|
filterLabel: types.string,
|
|
23151
23453
|
nestedField: types.string,
|
|
@@ -23498,7 +23800,7 @@
|
|
|
23498
23800
|
this.internalComponent = null;
|
|
23499
23801
|
this.$defaultQuery = null; // Set custom query in store
|
|
23500
23802
|
|
|
23501
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
23803
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23502
23804
|
var customQuery = props.customQuery,
|
|
23503
23805
|
componentId = props.componentId,
|
|
23504
23806
|
filterLabel = props.filterLabel,
|
|
@@ -23521,7 +23823,7 @@
|
|
|
23521
23823
|
}
|
|
23522
23824
|
|
|
23523
23825
|
if (customQuery) {
|
|
23524
|
-
var calcCustomQuery = customQuery(props);
|
|
23826
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
23525
23827
|
|
|
23526
23828
|
var _ref = calcCustomQuery || {},
|
|
23527
23829
|
query = _ref.query;
|
|
@@ -23540,7 +23842,7 @@
|
|
|
23540
23842
|
|
|
23541
23843
|
this.updateQuery({
|
|
23542
23844
|
componentId: componentId,
|
|
23543
|
-
|
|
23845
|
+
query: queryToSet,
|
|
23544
23846
|
value: this.selectedValue || null,
|
|
23545
23847
|
label: filterLabel,
|
|
23546
23848
|
showFilter: showFilter,
|
|
@@ -23591,8 +23893,8 @@
|
|
|
23591
23893
|
},
|
|
23592
23894
|
beforeMount: function beforeMount() {
|
|
23593
23895
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
23594
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
23595
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
23896
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23897
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
23596
23898
|
|
|
23597
23899
|
var _ref3 = this.$defaultQuery || {},
|
|
23598
23900
|
query = _ref3.query,
|
|
@@ -23656,8 +23958,8 @@
|
|
|
23656
23958
|
}
|
|
23657
23959
|
},
|
|
23658
23960
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
23659
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
23660
|
-
this.$defaultQuery = newVal();
|
|
23961
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23962
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
23661
23963
|
|
|
23662
23964
|
var _ref4 = this.$defaultQuery || {},
|
|
23663
23965
|
query = _ref4.query,
|
|
@@ -23668,7 +23970,7 @@
|
|
|
23668
23970
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
23669
23971
|
|
|
23670
23972
|
|
|
23671
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
23973
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23672
23974
|
var queryToSet = query || null;
|
|
23673
23975
|
|
|
23674
23976
|
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
@@ -23682,9 +23984,9 @@
|
|
|
23682
23984
|
}
|
|
23683
23985
|
},
|
|
23684
23986
|
customQuery: function customQuery(newVal, oldVal) {
|
|
23685
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
23987
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23686
23988
|
var componentId = this.$props.componentId;
|
|
23687
|
-
this.$customQuery = newVal(this.$props);
|
|
23989
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
23688
23990
|
|
|
23689
23991
|
var _ref5 = this.$customQuery || {},
|
|
23690
23992
|
query = _ref5.query,
|
|
@@ -23695,7 +23997,7 @@
|
|
|
23695
23997
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
23696
23998
|
|
|
23697
23999
|
|
|
23698
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
24000
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23699
24001
|
var queryToSet = query || null;
|
|
23700
24002
|
|
|
23701
24003
|
if (this.$customQuery && this.$customQuery.id) {
|
|
@@ -32555,6 +32857,7 @@
|
|
|
32555
32857
|
var orderOfQueries = [];
|
|
32556
32858
|
var hits = {};
|
|
32557
32859
|
var aggregations = {};
|
|
32860
|
+
var compositeAggregations = {};
|
|
32558
32861
|
var state = {};
|
|
32559
32862
|
var customQueries = {};
|
|
32560
32863
|
var defaultQueries = {};
|
|
@@ -32569,16 +32872,7 @@
|
|
|
32569
32872
|
compProps[key] = component[key];
|
|
32570
32873
|
}
|
|
32571
32874
|
});
|
|
32572
|
-
var isInternalComponentPresent = false;
|
|
32573
|
-
|
|
32574
|
-
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
32575
|
-
customQueries[component.componentId] = component.customQuery(component.value, compProps);
|
|
32576
|
-
}
|
|
32577
|
-
|
|
32578
|
-
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
32579
|
-
defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
|
|
32580
|
-
}
|
|
32581
|
-
|
|
32875
|
+
var isInternalComponentPresent = false;
|
|
32582
32876
|
var isResultComponent = resultComponents.includes(componentType);
|
|
32583
32877
|
var internalComponent = component.componentId + "__internal";
|
|
32584
32878
|
var label = component.filterLabel || component.componentId;
|
|
@@ -32602,7 +32896,16 @@
|
|
|
32602
32896
|
reference: reference,
|
|
32603
32897
|
showFilter: showFilter,
|
|
32604
32898
|
URLParams: component.URLParams || false
|
|
32605
|
-
}); //
|
|
32899
|
+
}); // Set custom and default queries
|
|
32900
|
+
|
|
32901
|
+
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
32902
|
+
customQueries[component.componentId] = component.customQuery(value, compProps);
|
|
32903
|
+
}
|
|
32904
|
+
|
|
32905
|
+
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
32906
|
+
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
32907
|
+
} // [2] set query options - main component query (valid for result components)
|
|
32908
|
+
|
|
32606
32909
|
|
|
32607
32910
|
if (componentsWithOptions.includes(componentType)) {
|
|
32608
32911
|
var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
|
|
@@ -32689,7 +32992,7 @@
|
|
|
32689
32992
|
|
|
32690
32993
|
|
|
32691
32994
|
if (isResultComponent) {
|
|
32692
|
-
var _getQuery = getQuery(component,
|
|
32995
|
+
var _getQuery = getQuery(component, value, componentType),
|
|
32693
32996
|
query = _getQuery.query;
|
|
32694
32997
|
|
|
32695
32998
|
queryList = queryReducer(queryList, {
|
|
@@ -32789,6 +33092,11 @@
|
|
|
32789
33092
|
var _extends4;
|
|
32790
33093
|
|
|
32791
33094
|
aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
|
|
33095
|
+
compositeAggregations = compositeAggsReducer(compositeAggregations, {
|
|
33096
|
+
type: constants_9,
|
|
33097
|
+
aggregations: response.aggregations,
|
|
33098
|
+
append: false
|
|
33099
|
+
});
|
|
32792
33100
|
}
|
|
32793
33101
|
|
|
32794
33102
|
hits = _extends({}, hits, (_extends5 = {}, _extends5[component] = {
|
|
@@ -32815,6 +33123,8 @@
|
|
|
32815
33123
|
var promotedResults = {};
|
|
32816
33124
|
var rawData = {};
|
|
32817
33125
|
var customData = {};
|
|
33126
|
+
var settingsResponse = {};
|
|
33127
|
+
var timestamp = {};
|
|
32818
33128
|
var allPromises = orderOfQueries.map(function (component) {
|
|
32819
33129
|
return new Promise(function (responseResolve, responseReject) {
|
|
32820
33130
|
handleTransformResponse(res[component], component).then(function (response) {
|
|
@@ -32833,6 +33143,11 @@
|
|
|
32833
33143
|
|
|
32834
33144
|
if (response.customData) {
|
|
32835
33145
|
customData[component] = response.customData;
|
|
33146
|
+
} // Update settings
|
|
33147
|
+
|
|
33148
|
+
|
|
33149
|
+
if (response.settings) {
|
|
33150
|
+
settingsResponse[component] = response.settings;
|
|
32836
33151
|
}
|
|
32837
33152
|
|
|
32838
33153
|
if (response.aggregations) {
|
|
@@ -32841,6 +33156,7 @@
|
|
|
32841
33156
|
aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
|
|
32842
33157
|
}
|
|
32843
33158
|
|
|
33159
|
+
timestamp[component] = res._timestamp;
|
|
32844
33160
|
hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
|
|
32845
33161
|
hits: response.hits.hits,
|
|
32846
33162
|
total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
|
|
@@ -32856,8 +33172,11 @@
|
|
|
32856
33172
|
Promise.all(allPromises).then(function () {
|
|
32857
33173
|
state = _extends({}, state, {
|
|
32858
33174
|
hits: hits,
|
|
33175
|
+
timestamp: timestamp,
|
|
32859
33176
|
aggregations: aggregations,
|
|
33177
|
+
compositeAggregations: compositeAggregations,
|
|
32860
33178
|
promotedResults: promotedResults,
|
|
33179
|
+
settings: settingsResponse,
|
|
32861
33180
|
customData: customData,
|
|
32862
33181
|
rawData: rawData
|
|
32863
33182
|
});
|
|
@@ -32916,7 +33235,7 @@
|
|
|
32916
33235
|
});
|
|
32917
33236
|
}
|
|
32918
33237
|
|
|
32919
|
-
var version = "1.16.0-alpha.
|
|
33238
|
+
var version = "1.16.0-alpha.28";
|
|
32920
33239
|
|
|
32921
33240
|
var _templateObject$o, _templateObject2$b;
|
|
32922
33241
|
|