@appbaseio/reactivesearch-vue 1.27.0-gamma.3 → 1.29.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +923 -1096
- 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/{Button-11307285.js → Button-e0b7c1f6.js} +1 -1
- package/dist/cjs/{DataSearch-0ef14926.js → DataSearch-eec21890.js} +30 -13
- package/dist/cjs/DataSearch.js +1 -1
- package/dist/cjs/DynamicRangeSlider.js +24 -16
- package/dist/cjs/MultiDropdownList.js +34 -25
- package/dist/cjs/MultiList.js +33 -23
- package/dist/cjs/MultiRange.js +2 -3
- package/dist/cjs/RangeSlider.js +2 -3
- package/dist/cjs/ReactiveComponent.js +41 -72
- package/dist/cjs/ReactiveList.js +38 -48
- package/dist/cjs/SelectedFilters.js +6 -4
- package/dist/cjs/SingleDropdownList.js +21 -18
- package/dist/cjs/SingleList.js +19 -16
- package/dist/cjs/SingleRange.js +2 -3
- package/dist/cjs/ToggleButton.js +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/initReactivesearch.js +109 -77
- package/dist/cjs/{install-311df9cc.js → install-b05fef06.js} +111 -64
- package/dist/cjs/install.js +3 -3
- package/dist/cjs/version.js +1 -1
- package/dist/es/{Button-91561391.js → Button-33de88e6.js} +1 -1
- package/dist/es/{DataSearch-be45e960.js → DataSearch-42f547cd.js} +30 -13
- package/dist/es/DataSearch.js +1 -1
- package/dist/es/DynamicRangeSlider.js +24 -16
- package/dist/es/MultiDropdownList.js +34 -25
- package/dist/es/MultiList.js +33 -23
- package/dist/es/MultiRange.js +2 -3
- package/dist/es/RangeSlider.js +2 -3
- package/dist/es/ReactiveComponent.js +41 -72
- package/dist/es/ReactiveList.js +38 -48
- package/dist/es/SelectedFilters.js +6 -4
- package/dist/es/SingleDropdownList.js +21 -18
- package/dist/es/SingleList.js +19 -16
- package/dist/es/SingleRange.js +2 -3
- package/dist/es/ToggleButton.js +1 -1
- package/dist/es/index.js +4 -4
- package/dist/es/initReactivesearch.js +111 -79
- package/dist/es/{install-af797de0.js → install-bd448c02.js} +111 -64
- package/dist/es/install.js +3 -3
- package/dist/es/version.js +1 -1
- package/package.json +2 -2
|
@@ -820,6 +820,9 @@
|
|
|
820
820
|
var RECENT_SEARCHES_ERROR = exports.RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR';
|
|
821
821
|
var SET_VALUE = exports.SET_VALUE = 'SET_VALUE';
|
|
822
822
|
var RESET_TO_DEFAULT = exports.RESET_TO_DEFAULT = 'RESET_TO_DEFAULT';
|
|
823
|
+
var SET_GOOGLE_MAP_SCRIPT_LOADING = exports.SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING';
|
|
824
|
+
var SET_GOOGLE_MAP_SCRIPT_LOADED = exports.SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED';
|
|
825
|
+
var SET_GOOGLE_MAP_SCRIPT_ERROR = exports.SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR';
|
|
823
826
|
});
|
|
824
827
|
unwrapExports(constants);
|
|
825
828
|
var constants_1 = constants.ADD_COMPONENT;
|
|
@@ -867,6 +870,9 @@
|
|
|
867
870
|
var constants_43 = constants.RECENT_SEARCHES_ERROR;
|
|
868
871
|
var constants_44 = constants.SET_VALUE;
|
|
869
872
|
var constants_45 = constants.RESET_TO_DEFAULT;
|
|
873
|
+
var constants_46 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
|
|
874
|
+
var constants_47 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
|
|
875
|
+
var constants_48 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
|
|
870
876
|
|
|
871
877
|
var componentsReducer_1 = createCommonjsModule(function (module, exports) {
|
|
872
878
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1729,17 +1735,25 @@
|
|
|
1729
1735
|
|
|
1730
1736
|
case constants.CLEAR_VALUES:
|
|
1731
1737
|
{
|
|
1738
|
+
var nextState = {};
|
|
1739
|
+
|
|
1732
1740
|
if (action.resetValues) {
|
|
1733
|
-
var nextState = {};
|
|
1734
1741
|
Object.keys(action.resetValues).forEach(function (componentId) {
|
|
1735
1742
|
nextState[componentId] = _extends({}, state[componentId], {
|
|
1736
1743
|
value: action.resetValues[componentId]
|
|
1737
1744
|
});
|
|
1738
1745
|
});
|
|
1739
|
-
return nextState;
|
|
1740
1746
|
}
|
|
1741
1747
|
|
|
1742
|
-
|
|
1748
|
+
if (Array.isArray(action.clearAllBlacklistComponents)) {
|
|
1749
|
+
Object.keys(state).forEach(function (componentId) {
|
|
1750
|
+
if (action.clearAllBlacklistComponents.includes(componentId)) {
|
|
1751
|
+
nextState[componentId] = state[componentId];
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
return nextState;
|
|
1743
1757
|
}
|
|
1744
1758
|
|
|
1745
1759
|
case constants.REMOVE_COMPONENT:
|
|
@@ -1822,7 +1836,30 @@
|
|
|
1822
1836
|
}));
|
|
1823
1837
|
|
|
1824
1838
|
case constants.CLEAR_VALUES:
|
|
1825
|
-
|
|
1839
|
+
{
|
|
1840
|
+
var nextState = {};
|
|
1841
|
+
|
|
1842
|
+
if (action.resetValues) {
|
|
1843
|
+
Object.keys(action.resetValues).forEach(function (componentId) {
|
|
1844
|
+
nextState[componentId] = _extends({}, state[componentId], {
|
|
1845
|
+
value: action.resetValues[componentId]
|
|
1846
|
+
});
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
if (Array.isArray(action.clearAllBlacklistComponents)) {
|
|
1851
|
+
Object.keys(state).forEach(function (componentId) {
|
|
1852
|
+
if (action.clearAllBlacklistComponents.includes(componentId)) {
|
|
1853
|
+
nextState[componentId] = state[componentId];
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
return nextState;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
case constants.RESET_TO_DEFAULT:
|
|
1862
|
+
return _extends({}, state, action.defaultValues);
|
|
1826
1863
|
|
|
1827
1864
|
case constants.REMOVE_COMPONENT:
|
|
1828
1865
|
{
|
|
@@ -3167,6 +3204,59 @@
|
|
|
3167
3204
|
});
|
|
3168
3205
|
unwrapExports(recentSearches);
|
|
3169
3206
|
|
|
3207
|
+
var googleMapScriptReducer_1 = createCommonjsModule(function (module, exports) {
|
|
3208
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3209
|
+
value: true
|
|
3210
|
+
});
|
|
3211
|
+
|
|
3212
|
+
var _extends = Object.assign || function (target) {
|
|
3213
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3214
|
+
var source = arguments[i];
|
|
3215
|
+
|
|
3216
|
+
for (var key in source) {
|
|
3217
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3218
|
+
target[key] = source[key];
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
return target;
|
|
3224
|
+
};
|
|
3225
|
+
|
|
3226
|
+
exports["default"] = googleMapScriptReducer;
|
|
3227
|
+
var INITIAL_STATE = {
|
|
3228
|
+
loading: false,
|
|
3229
|
+
loaded: false,
|
|
3230
|
+
error: null
|
|
3231
|
+
};
|
|
3232
|
+
|
|
3233
|
+
function googleMapScriptReducer() {
|
|
3234
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
|
|
3235
|
+
var action = arguments[1];
|
|
3236
|
+
var type = action.type,
|
|
3237
|
+
loading = action.loading,
|
|
3238
|
+
loaded = action.loaded,
|
|
3239
|
+
error = action.error;
|
|
3240
|
+
|
|
3241
|
+
if (type === constants.SET_GOOGLE_MAP_SCRIPT_LOADING) {
|
|
3242
|
+
return _extends({}, INITIAL_STATE, {
|
|
3243
|
+
loading: loading
|
|
3244
|
+
});
|
|
3245
|
+
} else if (type === constants.SET_GOOGLE_MAP_SCRIPT_LOADED) {
|
|
3246
|
+
return _extends({}, INITIAL_STATE, {
|
|
3247
|
+
loaded: loaded
|
|
3248
|
+
});
|
|
3249
|
+
} else if (type === constants.SET_GOOGLE_MAP_SCRIPT_ERROR) {
|
|
3250
|
+
return _extends({}, INITIAL_STATE, {
|
|
3251
|
+
error: error
|
|
3252
|
+
});
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
return state;
|
|
3256
|
+
}
|
|
3257
|
+
});
|
|
3258
|
+
unwrapExports(googleMapScriptReducer_1);
|
|
3259
|
+
|
|
3170
3260
|
var reducers = createCommonjsModule(function (module, exports) {
|
|
3171
3261
|
Object.defineProperty(exports, "__esModule", {
|
|
3172
3262
|
value: true
|
|
@@ -3238,6 +3328,8 @@
|
|
|
3238
3328
|
|
|
3239
3329
|
var _recentSearches2 = _interopRequireDefault(recentSearches);
|
|
3240
3330
|
|
|
3331
|
+
var _googleMapScriptReducer2 = _interopRequireDefault(googleMapScriptReducer_1);
|
|
3332
|
+
|
|
3241
3333
|
function _interopRequireDefault(obj) {
|
|
3242
3334
|
return obj && obj.__esModule ? obj : {
|
|
3243
3335
|
"default": obj
|
|
@@ -3281,7 +3373,8 @@
|
|
|
3281
3373
|
urlValues: function urlValues() {
|
|
3282
3374
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3283
3375
|
return state;
|
|
3284
|
-
}
|
|
3376
|
+
},
|
|
3377
|
+
googleMapScriptStatus: _googleMapScriptReducer2["default"]
|
|
3285
3378
|
});
|
|
3286
3379
|
});
|
|
3287
3380
|
unwrapExports(reducers);
|
|
@@ -4861,7 +4954,7 @@
|
|
|
4861
4954
|
Object.defineProperty(exports, "__esModule", {
|
|
4862
4955
|
value: true
|
|
4863
4956
|
});
|
|
4864
|
-
exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
|
|
4957
|
+
exports.hasCustomRenderer = exports.getComponent = exports.isFunction = exports.getCalendarIntervalErrorMessage = exports.queryFormatMillisecondsMap = exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.extractQueryFromCustomQuery = exports.getOptionsForCustomQuery = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
|
|
4865
4958
|
|
|
4866
4959
|
var _extends = Object.assign || function (target) {
|
|
4867
4960
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -4878,6 +4971,7 @@
|
|
|
4878
4971
|
};
|
|
4879
4972
|
|
|
4880
4973
|
exports.isEqual = isEqual;
|
|
4974
|
+
exports.compareQueries = compareQueries;
|
|
4881
4975
|
exports.debounce = debounce;
|
|
4882
4976
|
exports.getQueryOptions = getQueryOptions;
|
|
4883
4977
|
exports.buildQuery = buildQuery;
|
|
@@ -4972,6 +5066,14 @@
|
|
|
4972
5066
|
return true;
|
|
4973
5067
|
}
|
|
4974
5068
|
|
|
5069
|
+
function compareQueries(x, y) {
|
|
5070
|
+
try {
|
|
5071
|
+
return isEqual(JSON.parse(JSON.stringify(x)), JSON.parse(JSON.stringify(y)));
|
|
5072
|
+
} catch (e) {
|
|
5073
|
+
return false;
|
|
5074
|
+
}
|
|
5075
|
+
}
|
|
5076
|
+
|
|
4975
5077
|
function debounce(callback, wait) {
|
|
4976
5078
|
var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
|
|
4977
5079
|
var timeout = null;
|
|
@@ -5053,7 +5155,9 @@
|
|
|
5053
5155
|
if (typeof comp !== 'string') {
|
|
5054
5156
|
return getQuery(comp, queryList);
|
|
5055
5157
|
} else if (comp in queryList) {
|
|
5056
|
-
|
|
5158
|
+
if (queryList[comp] && Object.keys(queryList[comp]).length) {
|
|
5159
|
+
return queryList[comp];
|
|
5160
|
+
}
|
|
5057
5161
|
}
|
|
5058
5162
|
|
|
5059
5163
|
return null;
|
|
@@ -5062,7 +5166,7 @@
|
|
|
5062
5166
|
});
|
|
5063
5167
|
var boolQuery = createBoolQuery(operation, queryArr);
|
|
5064
5168
|
|
|
5065
|
-
if (boolQuery) {
|
|
5169
|
+
if (boolQuery && Object.keys(boolQuery).length) {
|
|
5066
5170
|
query = [].concat(_toConsumableArray(query), [boolQuery]);
|
|
5067
5171
|
}
|
|
5068
5172
|
} else if (typeof react[conjunction] === 'string') {
|
|
@@ -5070,13 +5174,13 @@
|
|
|
5070
5174
|
|
|
5071
5175
|
var _boolQuery = createBoolQuery(_operation, queryList[react[conjunction]]);
|
|
5072
5176
|
|
|
5073
|
-
if (_boolQuery) {
|
|
5177
|
+
if (_boolQuery && Object.keys(_boolQuery).length) {
|
|
5074
5178
|
query = [].concat(_toConsumableArray(query), [_boolQuery]);
|
|
5075
5179
|
}
|
|
5076
5180
|
} else if (typeof react[conjunction] === 'object' && react[conjunction] !== null) {
|
|
5077
5181
|
var _boolQuery2 = getQuery(react[conjunction], queryList);
|
|
5078
5182
|
|
|
5079
|
-
if (_boolQuery2) {
|
|
5183
|
+
if (_boolQuery2 && Object.keys(_boolQuery2).length) {
|
|
5080
5184
|
query = [].concat(_toConsumableArray(query), [_boolQuery2]);
|
|
5081
5185
|
}
|
|
5082
5186
|
}
|
|
@@ -5194,7 +5298,7 @@
|
|
|
5194
5298
|
}
|
|
5195
5299
|
|
|
5196
5300
|
return {
|
|
5197
|
-
|
|
5301
|
+
_key: sortBy
|
|
5198
5302
|
};
|
|
5199
5303
|
}
|
|
5200
5304
|
|
|
@@ -5307,6 +5411,38 @@
|
|
|
5307
5411
|
|
|
5308
5412
|
exports.getOptionsFromQuery = getOptionsFromQuery;
|
|
5309
5413
|
|
|
5414
|
+
var getOptionsForCustomQuery = function getOptionsForCustomQuery() {
|
|
5415
|
+
var customQuery = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5416
|
+
|
|
5417
|
+
if (customQuery) {
|
|
5418
|
+
var query = customQuery.query,
|
|
5419
|
+
id = customQuery.id,
|
|
5420
|
+
params = customQuery.params,
|
|
5421
|
+
rest = _objectWithoutProperties(customQuery, ['query', 'id', 'params']);
|
|
5422
|
+
|
|
5423
|
+
return Object.keys(rest).length ? rest : null;
|
|
5424
|
+
}
|
|
5425
|
+
|
|
5426
|
+
return null;
|
|
5427
|
+
};
|
|
5428
|
+
|
|
5429
|
+
exports.getOptionsForCustomQuery = getOptionsForCustomQuery;
|
|
5430
|
+
|
|
5431
|
+
var extractQueryFromCustomQuery = exports.extractQueryFromCustomQuery = function extractQueryFromCustomQuery(customQuery) {
|
|
5432
|
+
if (customQuery) {
|
|
5433
|
+
if (customQuery.id) {
|
|
5434
|
+
return {
|
|
5435
|
+
id: customQuery.id,
|
|
5436
|
+
params: customQuery.params
|
|
5437
|
+
};
|
|
5438
|
+
}
|
|
5439
|
+
|
|
5440
|
+
return customQuery.query;
|
|
5441
|
+
}
|
|
5442
|
+
|
|
5443
|
+
return null;
|
|
5444
|
+
};
|
|
5445
|
+
|
|
5310
5446
|
function computeResultStats(hits, searchState, promotedResults) {
|
|
5311
5447
|
Object.keys(hits).forEach(function (componentId) {
|
|
5312
5448
|
var _ref = hits[componentId] || {},
|
|
@@ -5682,38 +5818,112 @@
|
|
|
5682
5818
|
Recent: 'recent',
|
|
5683
5819
|
Promoted: 'promoted'
|
|
5684
5820
|
};
|
|
5821
|
+
var queryFormatMillisecondsMap = exports.queryFormatMillisecondsMap = {
|
|
5822
|
+
minute: 60000,
|
|
5823
|
+
hour: 3600000,
|
|
5824
|
+
day: 86400000,
|
|
5825
|
+
week: 604800000,
|
|
5826
|
+
month: 2629746000,
|
|
5827
|
+
quarter: 7889238000,
|
|
5828
|
+
year: 31556952000
|
|
5829
|
+
};
|
|
5830
|
+
|
|
5831
|
+
var getCalendarIntervalErrorMessage = exports.getCalendarIntervalErrorMessage = function getCalendarIntervalErrorMessage(totalRange) {
|
|
5832
|
+
var calendarInterval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'minute';
|
|
5833
|
+
var queryFormatMillisecondsMapKeys = Object.keys(queryFormatMillisecondsMap);
|
|
5834
|
+
var indexOfCurrentCalendarInterval = queryFormatMillisecondsMapKeys.indexOf(calendarInterval);
|
|
5835
|
+
|
|
5836
|
+
if (indexOfCurrentCalendarInterval === -1) {
|
|
5837
|
+
console.error('Invalid calendarInterval Passed');
|
|
5838
|
+
}
|
|
5839
|
+
|
|
5840
|
+
if (calendarInterval === 'year') {
|
|
5841
|
+
return 'Try using a shorter range of values.';
|
|
5842
|
+
}
|
|
5843
|
+
|
|
5844
|
+
for (var index = indexOfCurrentCalendarInterval + 1; index < queryFormatMillisecondsMapKeys.length; index += 1) {
|
|
5845
|
+
if (totalRange / Object.values(queryFormatMillisecondsMap)[index] <= 100) {
|
|
5846
|
+
var calendarIntervalKey = queryFormatMillisecondsMapKeys[index];
|
|
5847
|
+
return {
|
|
5848
|
+
errorMessage: 'Please pass calendarInterval prop with value greater than or equal to a `' + calendarIntervalKey + '` for a meaningful resolution of histogram.',
|
|
5849
|
+
calculatedCalendarInterval: calendarIntervalKey
|
|
5850
|
+
};
|
|
5851
|
+
}
|
|
5852
|
+
}
|
|
5853
|
+
|
|
5854
|
+
return {
|
|
5855
|
+
errorMessage: 'Try using a shorter range of values.',
|
|
5856
|
+
calculatedCalendarInterval: 'year'
|
|
5857
|
+
};
|
|
5858
|
+
};
|
|
5859
|
+
|
|
5860
|
+
var isFunction = exports.isFunction = function isFunction(element) {
|
|
5861
|
+
return typeof element === 'function';
|
|
5862
|
+
};
|
|
5863
|
+
|
|
5864
|
+
var getComponent = exports.getComponent = function getComponent() {
|
|
5865
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5866
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5867
|
+
var children = props.children,
|
|
5868
|
+
render = props.render;
|
|
5869
|
+
|
|
5870
|
+
if (isFunction(children)) {
|
|
5871
|
+
return children(data);
|
|
5872
|
+
}
|
|
5873
|
+
|
|
5874
|
+
if (isFunction(render)) {
|
|
5875
|
+
return render(data);
|
|
5876
|
+
}
|
|
5877
|
+
|
|
5878
|
+
return null;
|
|
5879
|
+
};
|
|
5880
|
+
|
|
5881
|
+
var hasCustomRenderer = exports.hasCustomRenderer = function hasCustomRenderer() {
|
|
5882
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5883
|
+
var render = props.render,
|
|
5884
|
+
children = props.children;
|
|
5885
|
+
return isFunction(children) || isFunction(render);
|
|
5886
|
+
};
|
|
5685
5887
|
});
|
|
5686
5888
|
unwrapExports(helper);
|
|
5687
|
-
var helper_1 = helper.
|
|
5688
|
-
var helper_2 = helper.
|
|
5689
|
-
var helper_3 = helper.
|
|
5690
|
-
var helper_4 = helper.
|
|
5691
|
-
var helper_5 = helper.
|
|
5692
|
-
var helper_6 = helper.
|
|
5693
|
-
var helper_7 = helper.
|
|
5694
|
-
var helper_8 = helper.
|
|
5695
|
-
var helper_9 = helper.
|
|
5696
|
-
var helper_10 = helper.
|
|
5697
|
-
var helper_11 = helper.
|
|
5698
|
-
var helper_12 = helper.
|
|
5699
|
-
var helper_13 = helper.
|
|
5700
|
-
var helper_14 = helper.
|
|
5701
|
-
var helper_15 = helper.
|
|
5702
|
-
var helper_16 = helper.
|
|
5703
|
-
var helper_17 = helper.
|
|
5704
|
-
var helper_18 = helper.
|
|
5705
|
-
var helper_19 = helper.
|
|
5706
|
-
var helper_20 = helper.
|
|
5707
|
-
var helper_21 = helper.
|
|
5708
|
-
var helper_22 = helper.
|
|
5709
|
-
var helper_23 = helper.
|
|
5710
|
-
var helper_24 = helper.
|
|
5711
|
-
var helper_25 = helper.
|
|
5712
|
-
var helper_26 = helper.
|
|
5713
|
-
var helper_27 = helper.
|
|
5714
|
-
var helper_28 = helper.
|
|
5715
|
-
var helper_29 = helper.
|
|
5716
|
-
var helper_30 = helper.
|
|
5889
|
+
var helper_1 = helper.hasCustomRenderer;
|
|
5890
|
+
var helper_2 = helper.getComponent;
|
|
5891
|
+
var helper_3 = helper.isFunction;
|
|
5892
|
+
var helper_4 = helper.getCalendarIntervalErrorMessage;
|
|
5893
|
+
var helper_5 = helper.queryFormatMillisecondsMap;
|
|
5894
|
+
var helper_6 = helper.suggestionTypes;
|
|
5895
|
+
var helper_7 = helper.getTopSuggestions;
|
|
5896
|
+
var helper_8 = helper.withClickIds;
|
|
5897
|
+
var helper_9 = helper.getCompositeAggsQuery;
|
|
5898
|
+
var helper_10 = helper.getAggsQuery;
|
|
5899
|
+
var helper_11 = helper.extractQueryFromDefaultQuery;
|
|
5900
|
+
var helper_12 = helper.updateInternalQuery;
|
|
5901
|
+
var helper_13 = helper.getSearchState;
|
|
5902
|
+
var helper_14 = helper.extractQueryFromCustomQuery;
|
|
5903
|
+
var helper_15 = helper.getOptionsForCustomQuery;
|
|
5904
|
+
var helper_16 = helper.getOptionsFromQuery;
|
|
5905
|
+
var helper_17 = helper.parseHits;
|
|
5906
|
+
var helper_18 = helper.handleA11yAction;
|
|
5907
|
+
var helper_19 = helper.getInnerKey;
|
|
5908
|
+
var helper_20 = helper.getClassName;
|
|
5909
|
+
var helper_21 = helper.checkSomePropChange;
|
|
5910
|
+
var helper_22 = helper.checkPropChange;
|
|
5911
|
+
var helper_23 = helper.updateDefaultQuery;
|
|
5912
|
+
var helper_24 = helper.updateCustomQuery;
|
|
5913
|
+
var helper_25 = helper.isEqual;
|
|
5914
|
+
var helper_26 = helper.compareQueries;
|
|
5915
|
+
var helper_27 = helper.debounce;
|
|
5916
|
+
var helper_28 = helper.getQueryOptions;
|
|
5917
|
+
var helper_29 = helper.buildQuery;
|
|
5918
|
+
var helper_30 = helper.pushToAndClause;
|
|
5919
|
+
var helper_31 = helper.checkValueChange;
|
|
5920
|
+
var helper_32 = helper.getAggsOrder;
|
|
5921
|
+
var helper_33 = helper.formatDate;
|
|
5922
|
+
var helper_34 = helper.getResultStats;
|
|
5923
|
+
var helper_35 = helper.extractFieldsFromSource;
|
|
5924
|
+
var helper_36 = helper.normalizeDataField;
|
|
5925
|
+
var helper_37 = helper.handleOnSuggestions;
|
|
5926
|
+
var helper_38 = helper.isValidDateRangeQueryFormat;
|
|
5717
5927
|
|
|
5718
5928
|
var value = createCommonjsModule(function (module, exports) {
|
|
5719
5929
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5781,7 +5991,7 @@
|
|
|
5781
5991
|
};
|
|
5782
5992
|
}
|
|
5783
5993
|
|
|
5784
|
-
function resetValuesToDefault() {
|
|
5994
|
+
function resetValuesToDefault(clearAllBlacklistComponents) {
|
|
5785
5995
|
return function (dispatch, getState) {
|
|
5786
5996
|
var _getState2 = getState(),
|
|
5787
5997
|
selectedValues = _getState2.selectedValues,
|
|
@@ -5790,23 +6000,23 @@
|
|
|
5790
6000
|
var defaultValues = {};
|
|
5791
6001
|
var valueToSet = void 0;
|
|
5792
6002
|
Object.keys(selectedValues).forEach(function (component) {
|
|
5793
|
-
if (!
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
6003
|
+
if (!(Array.isArray(clearAllBlacklistComponents) && clearAllBlacklistComponents.includes(component))) {
|
|
6004
|
+
if (!componentProps[component] || !componentProps[component].componentType || !componentProps[component].defaultValue) {
|
|
6005
|
+
valueToSet = null;
|
|
6006
|
+
} else if ([constants$1.componentTypes.rangeSlider, constants$1.componentTypes.rangeInput, constants$1.componentTypes.ratingsFilter, constants$1.componentTypes.dateRange].includes(componentProps[component].componentType)) {
|
|
6007
|
+
valueToSet = typeof componentProps[component].defaultValue === 'object' ? [componentProps[component].defaultValue.start, componentProps[component].defaultValue.end] : null;
|
|
6008
|
+
} else if ([constants$1.componentTypes.multiDropdownList, constants$1.componentTypes.multiDataList, constants$1.componentTypes.multiList, constants$1.componentTypes.singleDataList, constants$1.componentTypes.singleDropdownList, constants$1.componentTypes.singleList, constants$1.componentTypes.tagCloud, constants$1.componentTypes.toggleButton, constants$1.componentTypes.multiDropdownRange, constants$1.componentTypes.multiRange, constants$1.componentTypes.singleDropdownRange, constants$1.componentTypes.singleRange, constants$1.componentTypes.dataSearch, constants$1.componentTypes.datePicker].includes(componentProps[component].componentType)) {
|
|
6009
|
+
valueToSet = componentProps[component].defaultValue;
|
|
6010
|
+
} else if ([constants$1.componentTypes.categorySearch].includes(componentProps[component].componentType)) {
|
|
6011
|
+
valueToSet = componentProps[component].defaultValue ? componentProps[component].defaultValue.term : '';
|
|
6012
|
+
}
|
|
5802
6013
|
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
6014
|
+
if (!(0, helper.isEqual)(selectedValues[component].value, valueToSet)) {
|
|
6015
|
+
defaultValues = _extends({}, defaultValues, _defineProperty({}, component, _extends({}, selectedValues[component], {
|
|
6016
|
+
value: valueToSet
|
|
6017
|
+
})));
|
|
6018
|
+
}
|
|
5807
6019
|
}
|
|
5808
|
-
|
|
5809
|
-
return true;
|
|
5810
6020
|
});
|
|
5811
6021
|
dispatch({
|
|
5812
6022
|
type: constants.RESET_TO_DEFAULT,
|
|
@@ -5836,9 +6046,11 @@
|
|
|
5836
6046
|
|
|
5837
6047
|
function clearValues() {
|
|
5838
6048
|
var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6049
|
+
var clearAllBlacklistComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
5839
6050
|
return {
|
|
5840
6051
|
type: constants.CLEAR_VALUES,
|
|
5841
|
-
resetValues: resetValues
|
|
6052
|
+
resetValues: resetValues,
|
|
6053
|
+
clearAllBlacklistComponents: clearAllBlacklistComponents
|
|
5842
6054
|
};
|
|
5843
6055
|
}
|
|
5844
6056
|
});
|
|
@@ -5849,6 +6061,76 @@
|
|
|
5849
6061
|
var value_4 = value.patchValue;
|
|
5850
6062
|
var value_5 = value.clearValues;
|
|
5851
6063
|
|
|
6064
|
+
var hits = createCommonjsModule(function (module, exports) {
|
|
6065
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6066
|
+
value: true
|
|
6067
|
+
});
|
|
6068
|
+
exports.updateAggs = updateAggs;
|
|
6069
|
+
exports.updateCompositeAggs = updateCompositeAggs;
|
|
6070
|
+
exports.updateHits = updateHits;
|
|
6071
|
+
exports.saveQueryToHits = saveQueryToHits;
|
|
6072
|
+
exports.mockDataForTesting = mockDataForTesting;
|
|
6073
|
+
|
|
6074
|
+
function updateAggs(component, aggregations) {
|
|
6075
|
+
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
6076
|
+
return {
|
|
6077
|
+
type: constants.UPDATE_AGGS,
|
|
6078
|
+
component: component,
|
|
6079
|
+
aggregations: aggregations,
|
|
6080
|
+
append: append
|
|
6081
|
+
};
|
|
6082
|
+
}
|
|
6083
|
+
|
|
6084
|
+
function updateCompositeAggs(component, aggregations) {
|
|
6085
|
+
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
6086
|
+
return {
|
|
6087
|
+
type: constants.UPDATE_COMPOSITE_AGGS,
|
|
6088
|
+
component: component,
|
|
6089
|
+
aggregations: aggregations,
|
|
6090
|
+
append: append
|
|
6091
|
+
};
|
|
6092
|
+
}
|
|
6093
|
+
|
|
6094
|
+
function updateHits(component, hits, time, hidden) {
|
|
6095
|
+
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
6096
|
+
return {
|
|
6097
|
+
type: constants.UPDATE_HITS,
|
|
6098
|
+
component: component,
|
|
6099
|
+
hits: hits.hits,
|
|
6100
|
+
total: typeof hits.total === 'object' ? hits.total.value : hits.total,
|
|
6101
|
+
hidden: hidden,
|
|
6102
|
+
time: time,
|
|
6103
|
+
append: append
|
|
6104
|
+
};
|
|
6105
|
+
}
|
|
6106
|
+
|
|
6107
|
+
function saveQueryToHits(component, query) {
|
|
6108
|
+
return {
|
|
6109
|
+
type: constants.SET_QUERY_TO_HITS,
|
|
6110
|
+
component: component,
|
|
6111
|
+
query: query
|
|
6112
|
+
};
|
|
6113
|
+
}
|
|
6114
|
+
|
|
6115
|
+
function mockDataForTesting(component, data) {
|
|
6116
|
+
return function (dispatch) {
|
|
6117
|
+
if (data.hasOwnProperty('aggregations')) {
|
|
6118
|
+
dispatch(updateAggs(component, data.aggregations));
|
|
6119
|
+
}
|
|
6120
|
+
|
|
6121
|
+
if (data.hasOwnProperty('hits')) {
|
|
6122
|
+
dispatch(updateHits(component, data, data.time || undefined));
|
|
6123
|
+
}
|
|
6124
|
+
};
|
|
6125
|
+
}
|
|
6126
|
+
});
|
|
6127
|
+
unwrapExports(hits);
|
|
6128
|
+
var hits_1 = hits.updateAggs;
|
|
6129
|
+
var hits_2 = hits.updateCompositeAggs;
|
|
6130
|
+
var hits_3 = hits.updateHits;
|
|
6131
|
+
var hits_4 = hits.saveQueryToHits;
|
|
6132
|
+
var hits_5 = hits.mockDataForTesting;
|
|
6133
|
+
|
|
5852
6134
|
var misc = createCommonjsModule(function (module, exports) {
|
|
5853
6135
|
Object.defineProperty(exports, "__esModule", {
|
|
5854
6136
|
value: true
|
|
@@ -5873,6 +6155,10 @@
|
|
|
5873
6155
|
exports.setCustomData = setCustomData;
|
|
5874
6156
|
exports.setAppliedSettings = setAppliedSettings;
|
|
5875
6157
|
exports.setQueryListener = setQueryListener;
|
|
6158
|
+
exports.setGoogleMapScriptLoading = setGoogleMapScriptLoading;
|
|
6159
|
+
exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded;
|
|
6160
|
+
exports.setGoogleMapScriptError = setGoogleMapScriptError;
|
|
6161
|
+
exports.resetStoreForComponent = resetStoreForComponent;
|
|
5876
6162
|
|
|
5877
6163
|
function setRawData(component, response) {
|
|
5878
6164
|
return {
|
|
@@ -6043,6 +6329,43 @@
|
|
|
6043
6329
|
onError: onError
|
|
6044
6330
|
};
|
|
6045
6331
|
}
|
|
6332
|
+
|
|
6333
|
+
function setGoogleMapScriptLoading(bool) {
|
|
6334
|
+
return {
|
|
6335
|
+
type: constants.SET_GOOGLE_MAP_SCRIPT_LOADING,
|
|
6336
|
+
loading: bool
|
|
6337
|
+
};
|
|
6338
|
+
}
|
|
6339
|
+
|
|
6340
|
+
function setGoogleMapScriptLoaded(bool) {
|
|
6341
|
+
return {
|
|
6342
|
+
type: constants.SET_GOOGLE_MAP_SCRIPT_LOADED,
|
|
6343
|
+
loaded: bool
|
|
6344
|
+
};
|
|
6345
|
+
}
|
|
6346
|
+
|
|
6347
|
+
function setGoogleMapScriptError(error) {
|
|
6348
|
+
return {
|
|
6349
|
+
type: constants.SET_GOOGLE_MAP_SCRIPT_ERROR,
|
|
6350
|
+
error: error
|
|
6351
|
+
};
|
|
6352
|
+
}
|
|
6353
|
+
|
|
6354
|
+
function resetStoreForComponent(componentId) {
|
|
6355
|
+
return function (dispatch) {
|
|
6356
|
+
dispatch(setRawData(componentId, null));
|
|
6357
|
+
dispatch(setCustomData(null, componentId));
|
|
6358
|
+
dispatch(setPromotedResults([], componentId));
|
|
6359
|
+
dispatch(setPopularSuggestions([], componentId));
|
|
6360
|
+
dispatch(setDefaultPopularSuggestions([], componentId));
|
|
6361
|
+
dispatch((0, hits.updateAggs)(componentId, null));
|
|
6362
|
+
dispatch((0, hits.updateCompositeAggs)(componentId, {}));
|
|
6363
|
+
dispatch((0, hits.updateHits)(componentId, {
|
|
6364
|
+
hits: [],
|
|
6365
|
+
total: 0
|
|
6366
|
+
}, 0));
|
|
6367
|
+
};
|
|
6368
|
+
}
|
|
6046
6369
|
});
|
|
6047
6370
|
unwrapExports(misc);
|
|
6048
6371
|
var misc_1 = misc.setRawData;
|
|
@@ -6065,98 +6388,32 @@
|
|
|
6065
6388
|
var misc_18 = misc.setCustomData;
|
|
6066
6389
|
var misc_19 = misc.setAppliedSettings;
|
|
6067
6390
|
var misc_20 = misc.setQueryListener;
|
|
6391
|
+
var misc_21 = misc.setGoogleMapScriptLoading;
|
|
6392
|
+
var misc_22 = misc.setGoogleMapScriptLoaded;
|
|
6393
|
+
var misc_23 = misc.setGoogleMapScriptError;
|
|
6394
|
+
var misc_24 = misc.resetStoreForComponent;
|
|
6068
6395
|
|
|
6069
|
-
var
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
exports.updateCompositeAggs = updateCompositeAggs;
|
|
6075
|
-
exports.updateHits = updateHits;
|
|
6076
|
-
exports.saveQueryToHits = saveQueryToHits;
|
|
6077
|
-
exports.mockDataForTesting = mockDataForTesting;
|
|
6396
|
+
var xdate = createCommonjsModule(function (module) {
|
|
6397
|
+
/**
|
|
6398
|
+
* @preserve XDate v@VERSION
|
|
6399
|
+
* Docs & Licensing: http://arshaw.com/xdate/
|
|
6400
|
+
*/
|
|
6078
6401
|
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6402
|
+
/*
|
|
6403
|
+
* Internal Architecture
|
|
6404
|
+
* ---------------------
|
|
6405
|
+
* An XDate wraps a native Date. The native Date is stored in the '0' property of the object.
|
|
6406
|
+
* UTC-mode is determined by whether the internal native Date's toString method is set to
|
|
6407
|
+
* Date.prototype.toUTCString (see getUTCMode).
|
|
6408
|
+
*
|
|
6409
|
+
*/
|
|
6410
|
+
var XDate = function (Date, Math, Array, undefined$1) {
|
|
6411
|
+
/** @const */
|
|
6412
|
+
var FULLYEAR = 0;
|
|
6413
|
+
/** @const */
|
|
6088
6414
|
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
return {
|
|
6092
|
-
type: constants.UPDATE_COMPOSITE_AGGS,
|
|
6093
|
-
component: component,
|
|
6094
|
-
aggregations: aggregations,
|
|
6095
|
-
append: append
|
|
6096
|
-
};
|
|
6097
|
-
}
|
|
6098
|
-
|
|
6099
|
-
function updateHits(component, hits, time, hidden) {
|
|
6100
|
-
var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
6101
|
-
return {
|
|
6102
|
-
type: constants.UPDATE_HITS,
|
|
6103
|
-
component: component,
|
|
6104
|
-
hits: hits.hits,
|
|
6105
|
-
total: typeof hits.total === 'object' ? hits.total.value : hits.total,
|
|
6106
|
-
hidden: hidden,
|
|
6107
|
-
time: time,
|
|
6108
|
-
append: append
|
|
6109
|
-
};
|
|
6110
|
-
}
|
|
6111
|
-
|
|
6112
|
-
function saveQueryToHits(component, query) {
|
|
6113
|
-
return {
|
|
6114
|
-
type: constants.SET_QUERY_TO_HITS,
|
|
6115
|
-
component: component,
|
|
6116
|
-
query: query
|
|
6117
|
-
};
|
|
6118
|
-
}
|
|
6119
|
-
|
|
6120
|
-
function mockDataForTesting(component, data) {
|
|
6121
|
-
return function (dispatch) {
|
|
6122
|
-
if (data.hasOwnProperty('aggregations')) {
|
|
6123
|
-
dispatch(updateAggs(component, data.aggregations));
|
|
6124
|
-
}
|
|
6125
|
-
|
|
6126
|
-
if (data.hasOwnProperty('hits')) {
|
|
6127
|
-
dispatch(updateHits(component, data, data.time || undefined));
|
|
6128
|
-
}
|
|
6129
|
-
};
|
|
6130
|
-
}
|
|
6131
|
-
});
|
|
6132
|
-
unwrapExports(hits);
|
|
6133
|
-
var hits_1 = hits.updateAggs;
|
|
6134
|
-
var hits_2 = hits.updateCompositeAggs;
|
|
6135
|
-
var hits_3 = hits.updateHits;
|
|
6136
|
-
var hits_4 = hits.saveQueryToHits;
|
|
6137
|
-
var hits_5 = hits.mockDataForTesting;
|
|
6138
|
-
|
|
6139
|
-
var xdate = createCommonjsModule(function (module) {
|
|
6140
|
-
/**
|
|
6141
|
-
* @preserve XDate v@VERSION
|
|
6142
|
-
* Docs & Licensing: http://arshaw.com/xdate/
|
|
6143
|
-
*/
|
|
6144
|
-
|
|
6145
|
-
/*
|
|
6146
|
-
* Internal Architecture
|
|
6147
|
-
* ---------------------
|
|
6148
|
-
* An XDate wraps a native Date. The native Date is stored in the '0' property of the object.
|
|
6149
|
-
* UTC-mode is determined by whether the internal native Date's toString method is set to
|
|
6150
|
-
* Date.prototype.toUTCString (see getUTCMode).
|
|
6151
|
-
*
|
|
6152
|
-
*/
|
|
6153
|
-
var XDate = function (Date, Math, Array, undefined$1) {
|
|
6154
|
-
/** @const */
|
|
6155
|
-
var FULLYEAR = 0;
|
|
6156
|
-
/** @const */
|
|
6157
|
-
|
|
6158
|
-
var MONTH = 1;
|
|
6159
|
-
/** @const */
|
|
6415
|
+
var MONTH = 1;
|
|
6416
|
+
/** @const */
|
|
6160
6417
|
|
|
6161
6418
|
var DATE = 2;
|
|
6162
6419
|
/** @const */
|
|
@@ -7205,7 +7462,7 @@
|
|
|
7205
7462
|
}
|
|
7206
7463
|
|
|
7207
7464
|
if (componentProps.componentType === constants$1.componentTypes.dynamicRangeSlider || componentProps.componentType === constants$1.componentTypes.rangeSlider) {
|
|
7208
|
-
calendarInterval = Object.keys(_dateFormats2["default"]).includes(queryFormat) ? componentProps.calendarInterval
|
|
7465
|
+
calendarInterval = Object.keys(_dateFormats2["default"]).includes(queryFormat) ? componentProps.calendarInterval : undefined;
|
|
7209
7466
|
|
|
7210
7467
|
if (value) {
|
|
7211
7468
|
if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
|
|
@@ -8370,7 +8627,7 @@
|
|
|
8370
8627
|
exports.Response = ctx.Response;
|
|
8371
8628
|
module.exports = exports;
|
|
8372
8629
|
});
|
|
8373
|
-
unwrapExports(browserPonyfill);
|
|
8630
|
+
var fetch$1 = unwrapExports(browserPonyfill);
|
|
8374
8631
|
var browserPonyfill_1 = browserPonyfill.fetch;
|
|
8375
8632
|
var browserPonyfill_2 = browserPonyfill.Headers;
|
|
8376
8633
|
var browserPonyfill_3 = browserPonyfill.Request;
|
|
@@ -8794,7 +9051,7 @@
|
|
|
8794
9051
|
|
|
8795
9052
|
var oldQuery = queryLog[component];
|
|
8796
9053
|
|
|
8797
|
-
if (mustExecuteMapQuery || !(0, helper.
|
|
9054
|
+
if (mustExecuteMapQuery || !(0, helper.compareQueries)(currentQuery, oldQuery, false)) {
|
|
8798
9055
|
orderOfQueries = [].concat(_toConsumableArray(orderOfQueries), [component]);
|
|
8799
9056
|
dispatch((0, misc.logQuery)(component, queryToLog));
|
|
8800
9057
|
var isMapComponent = Object.keys(mapData).includes(component);
|
|
@@ -8814,7 +9071,7 @@
|
|
|
8814
9071
|
var _getState5 = getState(),
|
|
8815
9072
|
combinedLog = _getState5.combinedLog;
|
|
8816
9073
|
|
|
8817
|
-
if ((0, helper.
|
|
9074
|
+
if ((0, helper.compareQueries)(combinedLog[component], currentQuery)) return;
|
|
8818
9075
|
dispatch((0, misc.logCombinedQuery)(component, currentQuery));
|
|
8819
9076
|
}
|
|
8820
9077
|
|
|
@@ -9031,7 +9288,7 @@
|
|
|
9031
9288
|
query: _extends({}, queryObj)
|
|
9032
9289
|
}, options);
|
|
9033
9290
|
|
|
9034
|
-
if ((0, helper.
|
|
9291
|
+
if ((0, helper.compareQueries)(queryLog[component], currentQuery)) return;
|
|
9035
9292
|
dispatch((0, misc.logQuery)(component, currentQuery));
|
|
9036
9293
|
|
|
9037
9294
|
if (store.config && store.config.enableAppbase) {
|
|
@@ -12781,7 +13038,7 @@
|
|
|
12781
13038
|
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: #ccc;\n\tcursor: not-allowed;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor ? curriedLighten(0.1, theme.colors.backgroundColor) : '#fafafa', theme.colors.backgroundColor ? curriedLighten(0.2, theme.colors.backgroundColor) : '#fafafa');
|
|
12782
13039
|
};
|
|
12783
13040
|
|
|
12784
|
-
var Button = index$1('a')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\talign-items: center;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tmin-height: 30px;\n\tword-wrap: break-word;\n\tpadding: 5px 12px;\n\tline-height: 1.2rem;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:focus {\n\t\toutline: 0;\n\t\tborder-color: ", ";\n\t\tbox-shadow: ", ";\n\t}\n\n\t", ";\n\t", ";\n\t", ";\n"])), function (_ref4) {
|
|
13041
|
+
var Button = index$1('a')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\talign-items: center;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tmin-height: 30px;\n\tword-wrap: break-word;\n\tpadding: 5px 12px;\n\tline-height: 1.2rem;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:focus {\n\t\toutline: 0;\n\t\tborder-color: ", ";\n\t\tbox-shadow: ", ";\n\t}\n\n\t", ";\n\t", ";\n\t", ";\n\n\t&.enter-btn {\n\t\tborder-top-left-radius: 0px;\n\t\tborder-bottom-left-radius: 0px;\n\t\theight: 100%;\n\t}\n"])), function (_ref4) {
|
|
12785
13042
|
var theme = _ref4.theme;
|
|
12786
13043
|
return theme.colors.backgroundColor || '#eee';
|
|
12787
13044
|
}, function (_ref5) {
|
|
@@ -14023,9 +14280,10 @@
|
|
|
14023
14280
|
getQueryOptions = lib_8.getQueryOptions,
|
|
14024
14281
|
getClassName$1 = lib_8.getClassName,
|
|
14025
14282
|
parseHits = lib_8.parseHits,
|
|
14026
|
-
getOptionsFromQuery = lib_8.getOptionsFromQuery,
|
|
14027
14283
|
getCompositeAggsQuery = lib_8.getCompositeAggsQuery,
|
|
14028
|
-
getResultStats = lib_8.getResultStats
|
|
14284
|
+
getResultStats = lib_8.getResultStats,
|
|
14285
|
+
extractQueryFromCustomQuery = lib_8.extractQueryFromCustomQuery,
|
|
14286
|
+
getOptionsForCustomQuery = lib_8.getOptionsForCustomQuery;
|
|
14029
14287
|
var ReactiveList = {
|
|
14030
14288
|
name: 'ReactiveList',
|
|
14031
14289
|
components: {
|
|
@@ -14184,7 +14442,7 @@
|
|
|
14184
14442
|
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14185
14443
|
}
|
|
14186
14444
|
|
|
14187
|
-
return
|
|
14445
|
+
return helper_8(filteredResults);
|
|
14188
14446
|
}
|
|
14189
14447
|
},
|
|
14190
14448
|
watch: {
|
|
@@ -14223,19 +14481,11 @@
|
|
|
14223
14481
|
var options = getQueryOptions(this.$props);
|
|
14224
14482
|
options.from = 0;
|
|
14225
14483
|
this.$defaultQuery = newVal(null, this.$props);
|
|
14226
|
-
|
|
14227
|
-
var
|
|
14228
|
-
sort = _ref.sort,
|
|
14229
|
-
query = _ref.query;
|
|
14230
|
-
|
|
14231
|
-
if (sort) {
|
|
14232
|
-
options.sort = this.$defaultQuery.sort;
|
|
14233
|
-
}
|
|
14234
|
-
|
|
14235
|
-
var queryOptions = getOptionsFromQuery(this.$defaultQuery);
|
|
14484
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
14485
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
14236
14486
|
|
|
14237
14487
|
if (queryOptions) {
|
|
14238
|
-
options = _extends({}, options,
|
|
14488
|
+
options = _extends({}, options, queryOptions);
|
|
14239
14489
|
} // Update calculated default query in store
|
|
14240
14490
|
|
|
14241
14491
|
|
|
@@ -14326,24 +14576,24 @@
|
|
|
14326
14576
|
options.from = this.$data.from;
|
|
14327
14577
|
|
|
14328
14578
|
if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
|
|
14329
|
-
var
|
|
14579
|
+
var _ref;
|
|
14330
14580
|
|
|
14331
14581
|
var sortField = this.sortOptions[this.sortOptionIndex].dataField;
|
|
14332
14582
|
var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
|
|
14333
|
-
options.sort = [(
|
|
14583
|
+
options.sort = [(_ref = {}, _ref[sortField] = {
|
|
14334
14584
|
order: sortBy
|
|
14335
|
-
},
|
|
14585
|
+
}, _ref)]; // To handle sort options for RS API
|
|
14336
14586
|
|
|
14337
14587
|
this.updateComponentProps(this.componentId, {
|
|
14338
14588
|
dataField: sortField,
|
|
14339
14589
|
sortBy: sortBy
|
|
14340
14590
|
}, constants_1$1.reactiveList);
|
|
14341
14591
|
} else if (this.$props.sortBy) {
|
|
14342
|
-
var
|
|
14592
|
+
var _ref2;
|
|
14343
14593
|
|
|
14344
|
-
options.sort = [(
|
|
14594
|
+
options.sort = [(_ref2 = {}, _ref2[this.$props.dataField] = {
|
|
14345
14595
|
order: this.$props.sortBy
|
|
14346
|
-
},
|
|
14596
|
+
}, _ref2)];
|
|
14347
14597
|
} // Override sort query with defaultQuery's sort if defined
|
|
14348
14598
|
|
|
14349
14599
|
|
|
@@ -14351,20 +14601,13 @@
|
|
|
14351
14601
|
|
|
14352
14602
|
if (this.$props.defaultQuery) {
|
|
14353
14603
|
this.$defaultQuery = this.$props.defaultQuery();
|
|
14354
|
-
options = _extends({}, options,
|
|
14355
|
-
|
|
14356
|
-
if (this.$defaultQuery.sort) {
|
|
14357
|
-
options.sort = this.$defaultQuery.sort;
|
|
14358
|
-
} // Update calculated default query in store
|
|
14359
|
-
|
|
14604
|
+
options = _extends({}, options, getOptionsForCustomQuery(this.$defaultQuery)); // Update calculated default query in store
|
|
14360
14605
|
|
|
14361
14606
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props);
|
|
14362
14607
|
} // execute is set to false at the time of mount
|
|
14363
14608
|
|
|
14364
14609
|
|
|
14365
|
-
var
|
|
14366
|
-
query = _ref4.query;
|
|
14367
|
-
|
|
14610
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
14368
14611
|
var execute = false;
|
|
14369
14612
|
this.setQueryOptions(this.$props.componentId, _extends({}, options, this.getAggsQuery()), execute);
|
|
14370
14613
|
|
|
@@ -14479,18 +14722,18 @@
|
|
|
14479
14722
|
}) : 0;
|
|
14480
14723
|
|
|
14481
14724
|
if (props.sortOptions[sortOptionIndex]) {
|
|
14482
|
-
var
|
|
14725
|
+
var _ref3;
|
|
14483
14726
|
|
|
14484
|
-
options.sort = [(
|
|
14727
|
+
options.sort = [(_ref3 = {}, _ref3[props.sortOptions[sortOptionIndex].dataField] = {
|
|
14485
14728
|
order: props.sortOptions[sortOptionIndex].sortBy
|
|
14486
|
-
},
|
|
14729
|
+
}, _ref3)];
|
|
14487
14730
|
}
|
|
14488
14731
|
} else if (props.sortBy) {
|
|
14489
|
-
var
|
|
14732
|
+
var _ref4;
|
|
14490
14733
|
|
|
14491
|
-
options.sort = [(
|
|
14734
|
+
options.sort = [(_ref4 = {}, _ref4[props.dataField] = {
|
|
14492
14735
|
order: props.sortBy
|
|
14493
|
-
},
|
|
14736
|
+
}, _ref4)];
|
|
14494
14737
|
}
|
|
14495
14738
|
|
|
14496
14739
|
this.setQueryOptions(this.$props.componentId, _extends({}, options, this.getAggsQuery()), true);
|
|
@@ -14593,16 +14836,16 @@
|
|
|
14593
14836
|
var index = e.target.value;
|
|
14594
14837
|
|
|
14595
14838
|
if (this.sortOptions && this.sortOptions[index]) {
|
|
14596
|
-
var
|
|
14839
|
+
var _ref5;
|
|
14597
14840
|
|
|
14598
14841
|
// This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
|
|
14599
14842
|
var options = getQueryOptions(this.$props);
|
|
14600
14843
|
options.from = 0;
|
|
14601
14844
|
var sortField = this.sortOptions[index].dataField;
|
|
14602
14845
|
var sortBy = this.sortOptions[index].sortBy;
|
|
14603
|
-
options.sort = [(
|
|
14846
|
+
options.sort = [(_ref5 = {}, _ref5[sortField] = {
|
|
14604
14847
|
order: sortBy
|
|
14605
|
-
},
|
|
14848
|
+
}, _ref5)];
|
|
14606
14849
|
this.sortOptionIndex = index; // To handle sort options for RS API
|
|
14607
14850
|
|
|
14608
14851
|
this.updateComponentProps(this.componentId, {
|
|
@@ -14767,7 +15010,7 @@
|
|
|
14767
15010
|
options.size = size || 10;
|
|
14768
15011
|
|
|
14769
15012
|
var getSortOption = function getSortOption() {
|
|
14770
|
-
var
|
|
15013
|
+
var _ref7;
|
|
14771
15014
|
|
|
14772
15015
|
if (defaultSortOption) {
|
|
14773
15016
|
var sortOption = sortOptionsNew.find(function (option) {
|
|
@@ -14775,35 +15018,39 @@
|
|
|
14775
15018
|
});
|
|
14776
15019
|
|
|
14777
15020
|
if (sortOption) {
|
|
14778
|
-
var
|
|
15021
|
+
var _ref6;
|
|
14779
15022
|
|
|
14780
|
-
return
|
|
15023
|
+
return _ref6 = {}, _ref6[sortOption.dataField] = {
|
|
14781
15024
|
order: sortOption.sortBy
|
|
14782
|
-
},
|
|
15025
|
+
}, _ref6;
|
|
14783
15026
|
}
|
|
14784
15027
|
}
|
|
14785
15028
|
|
|
14786
|
-
return
|
|
15029
|
+
return _ref7 = {}, _ref7[sortOptionsNew[0].dataField] = {
|
|
14787
15030
|
order: sortOptionsNew[0].sortBy
|
|
14788
|
-
},
|
|
15031
|
+
}, _ref7;
|
|
14789
15032
|
};
|
|
14790
15033
|
|
|
14791
15034
|
if (sortOptionsNew) {
|
|
14792
15035
|
options.sort = [getSortOption()];
|
|
14793
15036
|
} else if (sortBy) {
|
|
14794
|
-
var
|
|
15037
|
+
var _ref8;
|
|
14795
15038
|
|
|
14796
|
-
options.sort = [(
|
|
15039
|
+
options.sort = [(_ref8 = {}, _ref8[dataField] = {
|
|
14797
15040
|
order: sortBy
|
|
14798
|
-
},
|
|
15041
|
+
}, _ref8)];
|
|
14799
15042
|
}
|
|
14800
15043
|
|
|
14801
15044
|
return options;
|
|
14802
15045
|
};
|
|
14803
15046
|
|
|
15047
|
+
ReactiveList.hasInternalComponent = function () {
|
|
15048
|
+
return true;
|
|
15049
|
+
};
|
|
15050
|
+
|
|
14804
15051
|
var RLConnected = ComponentWrapper$1(connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveList), {
|
|
14805
15052
|
componentType: constants_1$1.reactiveList,
|
|
14806
|
-
internalComponent:
|
|
15053
|
+
internalComponent: ReactiveList.hasInternalComponent()
|
|
14807
15054
|
});
|
|
14808
15055
|
|
|
14809
15056
|
ReactiveList.install = function (Vue) {
|
|
@@ -14914,552 +15161,37 @@
|
|
|
14914
15161
|
sep = sep || '&';
|
|
14915
15162
|
eq = eq || '=';
|
|
14916
15163
|
|
|
14917
|
-
if (obj === null) {
|
|
14918
|
-
obj = undefined;
|
|
14919
|
-
}
|
|
14920
|
-
|
|
14921
|
-
if (typeof obj === 'object') {
|
|
14922
|
-
return Object.keys(obj).map(function (k) {
|
|
14923
|
-
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
|
14924
|
-
|
|
14925
|
-
if (Array.isArray(obj[k])) {
|
|
14926
|
-
return obj[k].map(function (v) {
|
|
14927
|
-
return ks + encodeURIComponent(stringifyPrimitive(v));
|
|
14928
|
-
}).join(sep);
|
|
14929
|
-
} else {
|
|
14930
|
-
return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
|
|
14931
|
-
}
|
|
14932
|
-
}).filter(Boolean).join(sep);
|
|
14933
|
-
}
|
|
14934
|
-
|
|
14935
|
-
if (!name) return '';
|
|
14936
|
-
return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
|
|
14937
|
-
};
|
|
14938
|
-
|
|
14939
|
-
var querystring = createCommonjsModule(function (module, exports) {
|
|
14940
|
-
|
|
14941
|
-
exports.decode = exports.parse = decode;
|
|
14942
|
-
exports.encode = exports.stringify = encode;
|
|
14943
|
-
});
|
|
14944
|
-
var querystring_1 = querystring.decode;
|
|
14945
|
-
var querystring_2 = querystring.parse;
|
|
14946
|
-
var querystring_3 = querystring.encode;
|
|
14947
|
-
var querystring_4 = querystring.stringify;
|
|
14948
|
-
|
|
14949
|
-
var browserPonyfill$1 = createCommonjsModule(function (module) {
|
|
14950
|
-
var __root__ = function (root) {
|
|
14951
|
-
function F() {
|
|
14952
|
-
this.fetch = false;
|
|
14953
|
-
}
|
|
14954
|
-
|
|
14955
|
-
F.prototype = root;
|
|
14956
|
-
return new F();
|
|
14957
|
-
}(typeof self !== 'undefined' ? self : commonjsGlobal);
|
|
14958
|
-
|
|
14959
|
-
(function (self) {
|
|
14960
|
-
(function (self) {
|
|
14961
|
-
if (self.fetch) {
|
|
14962
|
-
return;
|
|
14963
|
-
}
|
|
14964
|
-
|
|
14965
|
-
var support = {
|
|
14966
|
-
searchParams: 'URLSearchParams' in self,
|
|
14967
|
-
iterable: 'Symbol' in self && 'iterator' in Symbol,
|
|
14968
|
-
blob: 'FileReader' in self && 'Blob' in self && function () {
|
|
14969
|
-
try {
|
|
14970
|
-
new Blob();
|
|
14971
|
-
return true;
|
|
14972
|
-
} catch (e) {
|
|
14973
|
-
return false;
|
|
14974
|
-
}
|
|
14975
|
-
}(),
|
|
14976
|
-
formData: 'FormData' in self,
|
|
14977
|
-
arrayBuffer: 'ArrayBuffer' in self
|
|
14978
|
-
};
|
|
14979
|
-
|
|
14980
|
-
if (support.arrayBuffer) {
|
|
14981
|
-
var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];
|
|
14982
|
-
|
|
14983
|
-
var isDataView = function isDataView(obj) {
|
|
14984
|
-
return obj && DataView.prototype.isPrototypeOf(obj);
|
|
14985
|
-
};
|
|
14986
|
-
|
|
14987
|
-
var isArrayBufferView = ArrayBuffer.isView || function (obj) {
|
|
14988
|
-
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
|
|
14989
|
-
};
|
|
14990
|
-
}
|
|
14991
|
-
|
|
14992
|
-
function normalizeName(name) {
|
|
14993
|
-
if (typeof name !== 'string') {
|
|
14994
|
-
name = String(name);
|
|
14995
|
-
}
|
|
14996
|
-
|
|
14997
|
-
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
|
|
14998
|
-
throw new TypeError('Invalid character in header field name');
|
|
14999
|
-
}
|
|
15000
|
-
|
|
15001
|
-
return name.toLowerCase();
|
|
15002
|
-
}
|
|
15003
|
-
|
|
15004
|
-
function normalizeValue(value) {
|
|
15005
|
-
if (typeof value !== 'string') {
|
|
15006
|
-
value = String(value);
|
|
15007
|
-
}
|
|
15008
|
-
|
|
15009
|
-
return value;
|
|
15010
|
-
} // Build a destructive iterator for the value list
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
function iteratorFor(items) {
|
|
15014
|
-
var iterator = {
|
|
15015
|
-
next: function next() {
|
|
15016
|
-
var value = items.shift();
|
|
15017
|
-
return {
|
|
15018
|
-
done: value === undefined,
|
|
15019
|
-
value: value
|
|
15020
|
-
};
|
|
15021
|
-
}
|
|
15022
|
-
};
|
|
15023
|
-
|
|
15024
|
-
if (support.iterable) {
|
|
15025
|
-
iterator[Symbol.iterator] = function () {
|
|
15026
|
-
return iterator;
|
|
15027
|
-
};
|
|
15028
|
-
}
|
|
15029
|
-
|
|
15030
|
-
return iterator;
|
|
15031
|
-
}
|
|
15032
|
-
|
|
15033
|
-
function Headers(headers) {
|
|
15034
|
-
this.map = {};
|
|
15035
|
-
|
|
15036
|
-
if (headers instanceof Headers) {
|
|
15037
|
-
headers.forEach(function (value, name) {
|
|
15038
|
-
this.append(name, value);
|
|
15039
|
-
}, this);
|
|
15040
|
-
} else if (Array.isArray(headers)) {
|
|
15041
|
-
headers.forEach(function (header) {
|
|
15042
|
-
this.append(header[0], header[1]);
|
|
15043
|
-
}, this);
|
|
15044
|
-
} else if (headers) {
|
|
15045
|
-
Object.getOwnPropertyNames(headers).forEach(function (name) {
|
|
15046
|
-
this.append(name, headers[name]);
|
|
15047
|
-
}, this);
|
|
15048
|
-
}
|
|
15049
|
-
}
|
|
15050
|
-
|
|
15051
|
-
Headers.prototype.append = function (name, value) {
|
|
15052
|
-
name = normalizeName(name);
|
|
15053
|
-
value = normalizeValue(value);
|
|
15054
|
-
var oldValue = this.map[name];
|
|
15055
|
-
this.map[name] = oldValue ? oldValue + ',' + value : value;
|
|
15056
|
-
};
|
|
15057
|
-
|
|
15058
|
-
Headers.prototype['delete'] = function (name) {
|
|
15059
|
-
delete this.map[normalizeName(name)];
|
|
15060
|
-
};
|
|
15061
|
-
|
|
15062
|
-
Headers.prototype.get = function (name) {
|
|
15063
|
-
name = normalizeName(name);
|
|
15064
|
-
return this.has(name) ? this.map[name] : null;
|
|
15065
|
-
};
|
|
15066
|
-
|
|
15067
|
-
Headers.prototype.has = function (name) {
|
|
15068
|
-
return this.map.hasOwnProperty(normalizeName(name));
|
|
15069
|
-
};
|
|
15070
|
-
|
|
15071
|
-
Headers.prototype.set = function (name, value) {
|
|
15072
|
-
this.map[normalizeName(name)] = normalizeValue(value);
|
|
15073
|
-
};
|
|
15074
|
-
|
|
15075
|
-
Headers.prototype.forEach = function (callback, thisArg) {
|
|
15076
|
-
for (var name in this.map) {
|
|
15077
|
-
if (this.map.hasOwnProperty(name)) {
|
|
15078
|
-
callback.call(thisArg, this.map[name], name, this);
|
|
15079
|
-
}
|
|
15080
|
-
}
|
|
15081
|
-
};
|
|
15082
|
-
|
|
15083
|
-
Headers.prototype.keys = function () {
|
|
15084
|
-
var items = [];
|
|
15085
|
-
this.forEach(function (value, name) {
|
|
15086
|
-
items.push(name);
|
|
15087
|
-
});
|
|
15088
|
-
return iteratorFor(items);
|
|
15089
|
-
};
|
|
15090
|
-
|
|
15091
|
-
Headers.prototype.values = function () {
|
|
15092
|
-
var items = [];
|
|
15093
|
-
this.forEach(function (value) {
|
|
15094
|
-
items.push(value);
|
|
15095
|
-
});
|
|
15096
|
-
return iteratorFor(items);
|
|
15097
|
-
};
|
|
15098
|
-
|
|
15099
|
-
Headers.prototype.entries = function () {
|
|
15100
|
-
var items = [];
|
|
15101
|
-
this.forEach(function (value, name) {
|
|
15102
|
-
items.push([name, value]);
|
|
15103
|
-
});
|
|
15104
|
-
return iteratorFor(items);
|
|
15105
|
-
};
|
|
15106
|
-
|
|
15107
|
-
if (support.iterable) {
|
|
15108
|
-
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
|
15109
|
-
}
|
|
15110
|
-
|
|
15111
|
-
function consumed(body) {
|
|
15112
|
-
if (body.bodyUsed) {
|
|
15113
|
-
return Promise.reject(new TypeError('Already read'));
|
|
15114
|
-
}
|
|
15115
|
-
|
|
15116
|
-
body.bodyUsed = true;
|
|
15117
|
-
}
|
|
15118
|
-
|
|
15119
|
-
function fileReaderReady(reader) {
|
|
15120
|
-
return new Promise(function (resolve, reject) {
|
|
15121
|
-
reader.onload = function () {
|
|
15122
|
-
resolve(reader.result);
|
|
15123
|
-
};
|
|
15124
|
-
|
|
15125
|
-
reader.onerror = function () {
|
|
15126
|
-
reject(reader.error);
|
|
15127
|
-
};
|
|
15128
|
-
});
|
|
15129
|
-
}
|
|
15130
|
-
|
|
15131
|
-
function readBlobAsArrayBuffer(blob) {
|
|
15132
|
-
var reader = new FileReader();
|
|
15133
|
-
var promise = fileReaderReady(reader);
|
|
15134
|
-
reader.readAsArrayBuffer(blob);
|
|
15135
|
-
return promise;
|
|
15136
|
-
}
|
|
15137
|
-
|
|
15138
|
-
function readBlobAsText(blob) {
|
|
15139
|
-
var reader = new FileReader();
|
|
15140
|
-
var promise = fileReaderReady(reader);
|
|
15141
|
-
reader.readAsText(blob);
|
|
15142
|
-
return promise;
|
|
15143
|
-
}
|
|
15144
|
-
|
|
15145
|
-
function readArrayBufferAsText(buf) {
|
|
15146
|
-
var view = new Uint8Array(buf);
|
|
15147
|
-
var chars = new Array(view.length);
|
|
15148
|
-
|
|
15149
|
-
for (var i = 0; i < view.length; i++) {
|
|
15150
|
-
chars[i] = String.fromCharCode(view[i]);
|
|
15151
|
-
}
|
|
15152
|
-
|
|
15153
|
-
return chars.join('');
|
|
15154
|
-
}
|
|
15155
|
-
|
|
15156
|
-
function bufferClone(buf) {
|
|
15157
|
-
if (buf.slice) {
|
|
15158
|
-
return buf.slice(0);
|
|
15159
|
-
} else {
|
|
15160
|
-
var view = new Uint8Array(buf.byteLength);
|
|
15161
|
-
view.set(new Uint8Array(buf));
|
|
15162
|
-
return view.buffer;
|
|
15163
|
-
}
|
|
15164
|
-
}
|
|
15165
|
-
|
|
15166
|
-
function Body() {
|
|
15167
|
-
this.bodyUsed = false;
|
|
15168
|
-
|
|
15169
|
-
this._initBody = function (body) {
|
|
15170
|
-
this._bodyInit = body;
|
|
15171
|
-
|
|
15172
|
-
if (!body) {
|
|
15173
|
-
this._bodyText = '';
|
|
15174
|
-
} else if (typeof body === 'string') {
|
|
15175
|
-
this._bodyText = body;
|
|
15176
|
-
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
|
15177
|
-
this._bodyBlob = body;
|
|
15178
|
-
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
|
15179
|
-
this._bodyFormData = body;
|
|
15180
|
-
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
15181
|
-
this._bodyText = body.toString();
|
|
15182
|
-
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
|
15183
|
-
this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body.
|
|
15184
|
-
|
|
15185
|
-
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
|
15186
|
-
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
|
15187
|
-
this._bodyArrayBuffer = bufferClone(body);
|
|
15188
|
-
} else {
|
|
15189
|
-
throw new Error('unsupported BodyInit type');
|
|
15190
|
-
}
|
|
15191
|
-
|
|
15192
|
-
if (!this.headers.get('content-type')) {
|
|
15193
|
-
if (typeof body === 'string') {
|
|
15194
|
-
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
|
15195
|
-
} else if (this._bodyBlob && this._bodyBlob.type) {
|
|
15196
|
-
this.headers.set('content-type', this._bodyBlob.type);
|
|
15197
|
-
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
15198
|
-
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
15199
|
-
}
|
|
15200
|
-
}
|
|
15201
|
-
};
|
|
15202
|
-
|
|
15203
|
-
if (support.blob) {
|
|
15204
|
-
this.blob = function () {
|
|
15205
|
-
var rejected = consumed(this);
|
|
15206
|
-
|
|
15207
|
-
if (rejected) {
|
|
15208
|
-
return rejected;
|
|
15209
|
-
}
|
|
15210
|
-
|
|
15211
|
-
if (this._bodyBlob) {
|
|
15212
|
-
return Promise.resolve(this._bodyBlob);
|
|
15213
|
-
} else if (this._bodyArrayBuffer) {
|
|
15214
|
-
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
15215
|
-
} else if (this._bodyFormData) {
|
|
15216
|
-
throw new Error('could not read FormData body as blob');
|
|
15217
|
-
} else {
|
|
15218
|
-
return Promise.resolve(new Blob([this._bodyText]));
|
|
15219
|
-
}
|
|
15220
|
-
};
|
|
15221
|
-
|
|
15222
|
-
this.arrayBuffer = function () {
|
|
15223
|
-
if (this._bodyArrayBuffer) {
|
|
15224
|
-
return consumed(this) || Promise.resolve(this._bodyArrayBuffer);
|
|
15225
|
-
} else {
|
|
15226
|
-
return this.blob().then(readBlobAsArrayBuffer);
|
|
15227
|
-
}
|
|
15228
|
-
};
|
|
15229
|
-
}
|
|
15230
|
-
|
|
15231
|
-
this.text = function () {
|
|
15232
|
-
var rejected = consumed(this);
|
|
15233
|
-
|
|
15234
|
-
if (rejected) {
|
|
15235
|
-
return rejected;
|
|
15236
|
-
}
|
|
15237
|
-
|
|
15238
|
-
if (this._bodyBlob) {
|
|
15239
|
-
return readBlobAsText(this._bodyBlob);
|
|
15240
|
-
} else if (this._bodyArrayBuffer) {
|
|
15241
|
-
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
|
|
15242
|
-
} else if (this._bodyFormData) {
|
|
15243
|
-
throw new Error('could not read FormData body as text');
|
|
15244
|
-
} else {
|
|
15245
|
-
return Promise.resolve(this._bodyText);
|
|
15246
|
-
}
|
|
15247
|
-
};
|
|
15248
|
-
|
|
15249
|
-
if (support.formData) {
|
|
15250
|
-
this.formData = function () {
|
|
15251
|
-
return this.text().then(decode);
|
|
15252
|
-
};
|
|
15253
|
-
}
|
|
15254
|
-
|
|
15255
|
-
this.json = function () {
|
|
15256
|
-
return this.text().then(JSON.parse);
|
|
15257
|
-
};
|
|
15258
|
-
|
|
15259
|
-
return this;
|
|
15260
|
-
} // HTTP methods whose capitalization should be normalized
|
|
15261
|
-
|
|
15262
|
-
|
|
15263
|
-
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
|
15264
|
-
|
|
15265
|
-
function normalizeMethod(method) {
|
|
15266
|
-
var upcased = method.toUpperCase();
|
|
15267
|
-
return methods.indexOf(upcased) > -1 ? upcased : method;
|
|
15268
|
-
}
|
|
15269
|
-
|
|
15270
|
-
function Request(input, options) {
|
|
15271
|
-
options = options || {};
|
|
15272
|
-
var body = options.body;
|
|
15273
|
-
|
|
15274
|
-
if (input instanceof Request) {
|
|
15275
|
-
if (input.bodyUsed) {
|
|
15276
|
-
throw new TypeError('Already read');
|
|
15277
|
-
}
|
|
15278
|
-
|
|
15279
|
-
this.url = input.url;
|
|
15280
|
-
this.credentials = input.credentials;
|
|
15281
|
-
|
|
15282
|
-
if (!options.headers) {
|
|
15283
|
-
this.headers = new Headers(input.headers);
|
|
15284
|
-
}
|
|
15285
|
-
|
|
15286
|
-
this.method = input.method;
|
|
15287
|
-
this.mode = input.mode;
|
|
15288
|
-
|
|
15289
|
-
if (!body && input._bodyInit != null) {
|
|
15290
|
-
body = input._bodyInit;
|
|
15291
|
-
input.bodyUsed = true;
|
|
15292
|
-
}
|
|
15293
|
-
} else {
|
|
15294
|
-
this.url = String(input);
|
|
15295
|
-
}
|
|
15296
|
-
|
|
15297
|
-
this.credentials = options.credentials || this.credentials || 'omit';
|
|
15298
|
-
|
|
15299
|
-
if (options.headers || !this.headers) {
|
|
15300
|
-
this.headers = new Headers(options.headers);
|
|
15301
|
-
}
|
|
15302
|
-
|
|
15303
|
-
this.method = normalizeMethod(options.method || this.method || 'GET');
|
|
15304
|
-
this.mode = options.mode || this.mode || null;
|
|
15305
|
-
this.referrer = null;
|
|
15306
|
-
|
|
15307
|
-
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
|
15308
|
-
throw new TypeError('Body not allowed for GET or HEAD requests');
|
|
15309
|
-
}
|
|
15310
|
-
|
|
15311
|
-
this._initBody(body);
|
|
15312
|
-
}
|
|
15313
|
-
|
|
15314
|
-
Request.prototype.clone = function () {
|
|
15315
|
-
return new Request(this, {
|
|
15316
|
-
body: this._bodyInit
|
|
15317
|
-
});
|
|
15318
|
-
};
|
|
15319
|
-
|
|
15320
|
-
function decode(body) {
|
|
15321
|
-
var form = new FormData();
|
|
15322
|
-
body.trim().split('&').forEach(function (bytes) {
|
|
15323
|
-
if (bytes) {
|
|
15324
|
-
var split = bytes.split('=');
|
|
15325
|
-
var name = split.shift().replace(/\+/g, ' ');
|
|
15326
|
-
var value = split.join('=').replace(/\+/g, ' ');
|
|
15327
|
-
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
15328
|
-
}
|
|
15329
|
-
});
|
|
15330
|
-
return form;
|
|
15331
|
-
}
|
|
15332
|
-
|
|
15333
|
-
function parseHeaders(rawHeaders) {
|
|
15334
|
-
var headers = new Headers(); // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
|
15335
|
-
// https://tools.ietf.org/html/rfc7230#section-3.2
|
|
15336
|
-
|
|
15337
|
-
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
|
15338
|
-
preProcessedHeaders.split(/\r?\n/).forEach(function (line) {
|
|
15339
|
-
var parts = line.split(':');
|
|
15340
|
-
var key = parts.shift().trim();
|
|
15341
|
-
|
|
15342
|
-
if (key) {
|
|
15343
|
-
var value = parts.join(':').trim();
|
|
15344
|
-
headers.append(key, value);
|
|
15345
|
-
}
|
|
15346
|
-
});
|
|
15347
|
-
return headers;
|
|
15348
|
-
}
|
|
15349
|
-
|
|
15350
|
-
Body.call(Request.prototype);
|
|
15351
|
-
|
|
15352
|
-
function Response(bodyInit, options) {
|
|
15353
|
-
if (!options) {
|
|
15354
|
-
options = {};
|
|
15355
|
-
}
|
|
15356
|
-
|
|
15357
|
-
this.type = 'default';
|
|
15358
|
-
this.status = options.status === undefined ? 200 : options.status;
|
|
15359
|
-
this.ok = this.status >= 200 && this.status < 300;
|
|
15360
|
-
this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
|
15361
|
-
this.headers = new Headers(options.headers);
|
|
15362
|
-
this.url = options.url || '';
|
|
15363
|
-
|
|
15364
|
-
this._initBody(bodyInit);
|
|
15365
|
-
}
|
|
15366
|
-
|
|
15367
|
-
Body.call(Response.prototype);
|
|
15368
|
-
|
|
15369
|
-
Response.prototype.clone = function () {
|
|
15370
|
-
return new Response(this._bodyInit, {
|
|
15371
|
-
status: this.status,
|
|
15372
|
-
statusText: this.statusText,
|
|
15373
|
-
headers: new Headers(this.headers),
|
|
15374
|
-
url: this.url
|
|
15375
|
-
});
|
|
15376
|
-
};
|
|
15377
|
-
|
|
15378
|
-
Response.error = function () {
|
|
15379
|
-
var response = new Response(null, {
|
|
15380
|
-
status: 0,
|
|
15381
|
-
statusText: ''
|
|
15382
|
-
});
|
|
15383
|
-
response.type = 'error';
|
|
15384
|
-
return response;
|
|
15385
|
-
};
|
|
15386
|
-
|
|
15387
|
-
var redirectStatuses = [301, 302, 303, 307, 308];
|
|
15388
|
-
|
|
15389
|
-
Response.redirect = function (url, status) {
|
|
15390
|
-
if (redirectStatuses.indexOf(status) === -1) {
|
|
15391
|
-
throw new RangeError('Invalid status code');
|
|
15392
|
-
}
|
|
15393
|
-
|
|
15394
|
-
return new Response(null, {
|
|
15395
|
-
status: status,
|
|
15396
|
-
headers: {
|
|
15397
|
-
location: url
|
|
15398
|
-
}
|
|
15399
|
-
});
|
|
15400
|
-
};
|
|
15401
|
-
|
|
15402
|
-
self.Headers = Headers;
|
|
15403
|
-
self.Request = Request;
|
|
15404
|
-
self.Response = Response;
|
|
15405
|
-
|
|
15406
|
-
self.fetch = function (input, init) {
|
|
15407
|
-
return new Promise(function (resolve, reject) {
|
|
15408
|
-
var request = new Request(input, init);
|
|
15409
|
-
var xhr = new XMLHttpRequest();
|
|
15410
|
-
|
|
15411
|
-
xhr.onload = function () {
|
|
15412
|
-
var options = {
|
|
15413
|
-
status: xhr.status,
|
|
15414
|
-
statusText: xhr.statusText,
|
|
15415
|
-
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
|
15416
|
-
};
|
|
15417
|
-
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
|
15418
|
-
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
|
15419
|
-
resolve(new Response(body, options));
|
|
15420
|
-
};
|
|
15421
|
-
|
|
15422
|
-
xhr.onerror = function () {
|
|
15423
|
-
reject(new TypeError('Network request failed'));
|
|
15424
|
-
};
|
|
15425
|
-
|
|
15426
|
-
xhr.ontimeout = function () {
|
|
15427
|
-
reject(new TypeError('Network request failed'));
|
|
15428
|
-
};
|
|
15429
|
-
|
|
15430
|
-
xhr.open(request.method, request.url, true);
|
|
15431
|
-
|
|
15432
|
-
if (request.credentials === 'include') {
|
|
15433
|
-
xhr.withCredentials = true;
|
|
15434
|
-
} else if (request.credentials === 'omit') {
|
|
15435
|
-
xhr.withCredentials = false;
|
|
15436
|
-
}
|
|
15164
|
+
if (obj === null) {
|
|
15165
|
+
obj = undefined;
|
|
15166
|
+
}
|
|
15437
15167
|
|
|
15438
|
-
|
|
15439
|
-
|
|
15440
|
-
|
|
15168
|
+
if (typeof obj === 'object') {
|
|
15169
|
+
return Object.keys(obj).map(function (k) {
|
|
15170
|
+
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
|
15441
15171
|
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
|
|
15445
|
-
|
|
15446
|
-
|
|
15447
|
-
|
|
15172
|
+
if (Array.isArray(obj[k])) {
|
|
15173
|
+
return obj[k].map(function (v) {
|
|
15174
|
+
return ks + encodeURIComponent(stringifyPrimitive(v));
|
|
15175
|
+
}).join(sep);
|
|
15176
|
+
} else {
|
|
15177
|
+
return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
|
|
15178
|
+
}
|
|
15179
|
+
}).filter(Boolean).join(sep);
|
|
15180
|
+
}
|
|
15448
15181
|
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
var fetch = __root__.fetch;
|
|
15453
|
-
var Response = fetch.Response = __root__.Response;
|
|
15454
|
-
var Request = fetch.Request = __root__.Request;
|
|
15455
|
-
var Headers = fetch.Headers = __root__.Headers;
|
|
15182
|
+
if (!name) return '';
|
|
15183
|
+
return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
|
|
15184
|
+
};
|
|
15456
15185
|
|
|
15457
|
-
|
|
15458
|
-
module.exports = fetch; // Needed for TypeScript consumers without esModuleInterop.
|
|
15186
|
+
var querystring = createCommonjsModule(function (module, exports) {
|
|
15459
15187
|
|
|
15460
|
-
|
|
15461
|
-
|
|
15188
|
+
exports.decode = exports.parse = decode;
|
|
15189
|
+
exports.encode = exports.stringify = encode;
|
|
15462
15190
|
});
|
|
15191
|
+
var querystring_1 = querystring.decode;
|
|
15192
|
+
var querystring_2 = querystring.parse;
|
|
15193
|
+
var querystring_3 = querystring.encode;
|
|
15194
|
+
var querystring_4 = querystring.stringify;
|
|
15463
15195
|
|
|
15464
15196
|
var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
|
15465
15197
|
return typeof obj;
|
|
@@ -15791,17 +15523,10 @@
|
|
|
15791
15523
|
}
|
|
15792
15524
|
|
|
15793
15525
|
var credentials = auth || null;
|
|
15794
|
-
|
|
15795
|
-
if (!config.mongodb) {
|
|
15796
|
-
if (isAppbase(url) && credentials === null) {
|
|
15797
|
-
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15798
|
-
}
|
|
15799
|
-
}
|
|
15800
15526
|
/**
|
|
15801
15527
|
* Credentials can be provided as a part of the URL,
|
|
15802
15528
|
* as username, password args or as a credentials argument directly */
|
|
15803
15529
|
|
|
15804
|
-
|
|
15805
15530
|
if (typeof config.credentials === 'string' && config.credentials !== '') {
|
|
15806
15531
|
// eslint-disable-next-line
|
|
15807
15532
|
credentials = config.credentials;
|
|
@@ -15809,6 +15534,12 @@
|
|
|
15809
15534
|
credentials = config.username + ':' + config.password;
|
|
15810
15535
|
}
|
|
15811
15536
|
|
|
15537
|
+
if (!config.mongodb) {
|
|
15538
|
+
if (isAppbase(url) && credentials === null) {
|
|
15539
|
+
throw new Error('Authentication information is not present. Did you add credentials?');
|
|
15540
|
+
}
|
|
15541
|
+
}
|
|
15542
|
+
|
|
15812
15543
|
this.url = url;
|
|
15813
15544
|
this.protocol = protocol;
|
|
15814
15545
|
this.app = config.app;
|
|
@@ -15906,7 +15637,7 @@
|
|
|
15906
15637
|
var transformedRequest = Object.assign({}, ts);
|
|
15907
15638
|
var url = transformedRequest.url;
|
|
15908
15639
|
delete transformedRequest.url;
|
|
15909
|
-
return
|
|
15640
|
+
return fetch$1(url || finalURL, Object.assign({}, transformedRequest, {
|
|
15910
15641
|
// apply timestamp header for RS API
|
|
15911
15642
|
headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
|
|
15912
15643
|
'x-timestamp': new Date().getTime()
|
|
@@ -17161,14 +16892,14 @@
|
|
|
17161
16892
|
this.updateState(this.$props);
|
|
17162
16893
|
},
|
|
17163
16894
|
analyticsConfig: function analyticsConfig(newVal, oldVal) {
|
|
17164
|
-
if (!
|
|
16895
|
+
if (!helper_25(newVal, oldVal)) {
|
|
17165
16896
|
if (this.store) {
|
|
17166
16897
|
this.store.dispatch(analytics_3$1(newVal));
|
|
17167
16898
|
}
|
|
17168
16899
|
}
|
|
17169
16900
|
},
|
|
17170
16901
|
appbaseConfig: function appbaseConfig(newVal, oldVal) {
|
|
17171
|
-
if (!
|
|
16902
|
+
if (!helper_25(newVal, oldVal)) {
|
|
17172
16903
|
if (this.store) {
|
|
17173
16904
|
this.store.dispatch(analytics_3$1(newVal));
|
|
17174
16905
|
}
|
|
@@ -19850,7 +19581,8 @@
|
|
|
19850
19581
|
var debounce$1 = lib_8.debounce,
|
|
19851
19582
|
checkValueChange = lib_8.checkValueChange,
|
|
19852
19583
|
getClassName$3 = lib_8.getClassName,
|
|
19853
|
-
|
|
19584
|
+
extractQueryFromCustomQuery$1 = lib_8.extractQueryFromCustomQuery,
|
|
19585
|
+
getOptionsForCustomQuery$1 = lib_8.getOptionsForCustomQuery,
|
|
19854
19586
|
isEqual$4 = lib_8.isEqual,
|
|
19855
19587
|
getCompositeAggsQuery$1 = lib_8.getCompositeAggsQuery,
|
|
19856
19588
|
withClickIds = lib_8.withClickIds,
|
|
@@ -19906,11 +19638,15 @@
|
|
|
19906
19638
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
19907
19639
|
}
|
|
19908
19640
|
|
|
19909
|
-
this.loadPopularSuggestions(this.$props.componentId);
|
|
19910
19641
|
this.currentValue = this.selectedValue || '';
|
|
19642
|
+
var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
|
|
19911
19643
|
|
|
19912
|
-
if (
|
|
19913
|
-
this.
|
|
19644
|
+
if (shouldFetchInitialSuggestions) {
|
|
19645
|
+
this.loadPopularSuggestions(this.$props.componentId);
|
|
19646
|
+
|
|
19647
|
+
if (enableRecentSearches) {
|
|
19648
|
+
this.getRecentSearches();
|
|
19649
|
+
}
|
|
19914
19650
|
}
|
|
19915
19651
|
|
|
19916
19652
|
this.handleTextChange = debounce$1(this.handleText, this.$props.debounce); // Set custom and default queries in store
|
|
@@ -19947,7 +19683,7 @@
|
|
|
19947
19683
|
defaultSearchSuggestions: function defaultSearchSuggestions() {
|
|
19948
19684
|
var isPopularSuggestionsEnabled = this.enableQuerySuggestions || this.enablePopularSuggestions;
|
|
19949
19685
|
|
|
19950
|
-
if (this.currentValue) {
|
|
19686
|
+
if (this.currentValue || !this.enableDefaultSuggestions) {
|
|
19951
19687
|
return [];
|
|
19952
19688
|
}
|
|
19953
19689
|
|
|
@@ -20044,7 +19780,8 @@
|
|
|
20044
19780
|
addonBefore: VueTypes.any,
|
|
20045
19781
|
addonAfter: VueTypes.any,
|
|
20046
19782
|
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
20047
|
-
index: VueTypes.string
|
|
19783
|
+
index: VueTypes.string,
|
|
19784
|
+
enableDefaultSuggestions: VueTypes.bool.def(true)
|
|
20048
19785
|
},
|
|
20049
19786
|
beforeMount: function beforeMount() {
|
|
20050
19787
|
if (this.$props.highlight) {
|
|
@@ -20212,7 +19949,7 @@
|
|
|
20212
19949
|
// returns size and aggs property
|
|
20213
19950
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
20214
19951
|
var aggregationField = this.$props.aggregationField;
|
|
20215
|
-
var queryOptions =
|
|
19952
|
+
var queryOptions = helper_28(this.$props);
|
|
20216
19953
|
|
|
20217
19954
|
if (aggregationField) {
|
|
20218
19955
|
queryOptions.aggs = getCompositeAggsQuery$1({
|
|
@@ -20308,12 +20045,13 @@
|
|
|
20308
20045
|
|
|
20309
20046
|
if (this.defaultQuery) {
|
|
20310
20047
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
20048
|
+
var defaultQueryObj = extractQueryFromCustomQuery$1(defaultQueryToBeSet);
|
|
20311
20049
|
|
|
20312
|
-
if (
|
|
20313
|
-
query =
|
|
20050
|
+
if (defaultQueryObj) {
|
|
20051
|
+
query = defaultQueryObj;
|
|
20314
20052
|
}
|
|
20315
20053
|
|
|
20316
|
-
defaultQueryOptions =
|
|
20054
|
+
defaultQueryOptions = getOptionsForCustomQuery$1(defaultQueryToBeSet); // Update calculated default query in store
|
|
20317
20055
|
|
|
20318
20056
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
20319
20057
|
}
|
|
@@ -20337,13 +20075,13 @@
|
|
|
20337
20075
|
|
|
20338
20076
|
if (customQuery) {
|
|
20339
20077
|
var customQueryTobeSet = customQuery(value, props);
|
|
20340
|
-
var queryTobeSet = customQueryTobeSet
|
|
20078
|
+
var queryTobeSet = extractQueryFromCustomQuery$1(customQueryTobeSet);
|
|
20341
20079
|
|
|
20342
20080
|
if (queryTobeSet) {
|
|
20343
20081
|
query = queryTobeSet;
|
|
20344
20082
|
}
|
|
20345
20083
|
|
|
20346
|
-
customQueryOptions =
|
|
20084
|
+
customQueryOptions = getOptionsForCustomQuery$1(customQueryTobeSet);
|
|
20347
20085
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
20348
20086
|
this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions), false);
|
|
20349
20087
|
}
|
|
@@ -20670,11 +20408,17 @@
|
|
|
20670
20408
|
var _this$$props4 = this.$props,
|
|
20671
20409
|
theme = _this$$props4.theme,
|
|
20672
20410
|
size = _this$$props4.size,
|
|
20673
|
-
expandSuggestionsContainer = _this$$props4.expandSuggestionsContainer
|
|
20411
|
+
expandSuggestionsContainer = _this$$props4.expandSuggestionsContainer,
|
|
20412
|
+
enableDefaultSuggestions = _this$$props4.enableDefaultSuggestions;
|
|
20674
20413
|
var _this$$scopedSlots = this.$scopedSlots,
|
|
20675
20414
|
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
20676
20415
|
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
20677
20416
|
var hasSuggestions = this.currentValue ? this.suggestionsList.length || this.topSuggestions.length : this.defaultSearchSuggestions.length;
|
|
20417
|
+
|
|
20418
|
+
if (enableDefaultSuggestions === false && !this.currentValue) {
|
|
20419
|
+
hasSuggestions = false;
|
|
20420
|
+
}
|
|
20421
|
+
|
|
20678
20422
|
return h(Container, {
|
|
20679
20423
|
"class": this.$props.className
|
|
20680
20424
|
}, [this.$props.title && h(Title, {
|
|
@@ -21032,6 +20776,10 @@
|
|
|
21032
20776
|
};
|
|
21033
20777
|
};
|
|
21034
20778
|
|
|
20779
|
+
DataSearch.hasInternalComponent = function () {
|
|
20780
|
+
return true;
|
|
20781
|
+
};
|
|
20782
|
+
|
|
21035
20783
|
var mapStateToProps$3 = function mapStateToProps(state, props) {
|
|
21036
20784
|
return {
|
|
21037
20785
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
@@ -21069,7 +20817,7 @@
|
|
|
21069
20817
|
};
|
|
21070
20818
|
var DSConnected = ComponentWrapper$1(connect(mapStateToProps$3, mapDispatchToProps$2)(DataSearch), {
|
|
21071
20819
|
componentType: constants_1$1.dataSearch,
|
|
21072
|
-
internalComponent:
|
|
20820
|
+
internalComponent: DataSearch.hasInternalComponent()
|
|
21073
20821
|
});
|
|
21074
20822
|
|
|
21075
20823
|
DataSearch.install = function (Vue) {
|
|
@@ -21243,7 +20991,9 @@
|
|
|
21243
20991
|
applyStopwords: VueTypes.bool,
|
|
21244
20992
|
customStopwords: types.stringArray,
|
|
21245
20993
|
onData: types.func,
|
|
21246
|
-
renderItem: types.func
|
|
20994
|
+
renderItem: types.func,
|
|
20995
|
+
enterButton: VueTypes.bool.def(false),
|
|
20996
|
+
renderEnterButton: VueTypes.any
|
|
21247
20997
|
},
|
|
21248
20998
|
mounted: function mounted() {
|
|
21249
20999
|
this.listenForFocusShortcuts();
|
|
@@ -21356,7 +21106,7 @@
|
|
|
21356
21106
|
this.triggerDefaultQuery(value);
|
|
21357
21107
|
} else if (this.$props.autosuggest) {
|
|
21358
21108
|
this.triggerDefaultQuery(value);
|
|
21359
|
-
} else {
|
|
21109
|
+
} else if (!this.$props.enterButton) {
|
|
21360
21110
|
this.triggerCustomQuery(value);
|
|
21361
21111
|
}
|
|
21362
21112
|
},
|
|
@@ -21403,7 +21153,7 @@
|
|
|
21403
21153
|
// returns size and aggs property
|
|
21404
21154
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
21405
21155
|
var aggregationField = this.$props.aggregationField;
|
|
21406
|
-
var queryOptions =
|
|
21156
|
+
var queryOptions = helper_28(this.$props);
|
|
21407
21157
|
|
|
21408
21158
|
if (aggregationField) {
|
|
21409
21159
|
queryOptions.aggs = getCompositeAggsQuery$2({
|
|
@@ -21597,10 +21347,18 @@
|
|
|
21597
21347
|
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
21598
21348
|
},
|
|
21599
21349
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
21350
|
+
if (highlightedIndex === void 0) {
|
|
21351
|
+
highlightedIndex = null;
|
|
21352
|
+
}
|
|
21353
|
+
|
|
21600
21354
|
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
21601
|
-
if (event.key === 'Enter'
|
|
21602
|
-
this.
|
|
21603
|
-
|
|
21355
|
+
if (event.key === 'Enter') {
|
|
21356
|
+
if (this.$props.autosuggest === false) {
|
|
21357
|
+
this.enterButtonOnClick();
|
|
21358
|
+
} else if (highlightedIndex === null) {
|
|
21359
|
+
this.setValue(event.target.value, true);
|
|
21360
|
+
this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
|
|
21361
|
+
}
|
|
21604
21362
|
} // Need to review
|
|
21605
21363
|
|
|
21606
21364
|
|
|
@@ -21772,15 +21530,55 @@
|
|
|
21772
21530
|
|
|
21773
21531
|
return null;
|
|
21774
21532
|
},
|
|
21775
|
-
|
|
21533
|
+
enterButtonOnClick: function enterButtonOnClick() {
|
|
21534
|
+
this.triggerQuery({
|
|
21535
|
+
isOpen: false,
|
|
21536
|
+
value: this.currentValue,
|
|
21537
|
+
customQuery: true
|
|
21538
|
+
});
|
|
21539
|
+
},
|
|
21540
|
+
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
21541
|
+
var _this4 = this;
|
|
21542
|
+
|
|
21776
21543
|
var h = this.$createElement;
|
|
21777
21544
|
var _this$$props4 = this.$props,
|
|
21778
|
-
|
|
21779
|
-
|
|
21780
|
-
|
|
21781
|
-
|
|
21782
|
-
|
|
21783
|
-
|
|
21545
|
+
enterButton = _this$$props4.enterButton,
|
|
21546
|
+
innerClass = _this$$props4.innerClass;
|
|
21547
|
+
var renderEnterButton = this.$scopedSlots.renderEnterButton;
|
|
21548
|
+
|
|
21549
|
+
if (enterButton) {
|
|
21550
|
+
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
21551
|
+
if (renderEnterButton) {
|
|
21552
|
+
return renderEnterButton(_this4.enterButtonOnClick);
|
|
21553
|
+
}
|
|
21554
|
+
|
|
21555
|
+
return h(Button, {
|
|
21556
|
+
"class": "enter-btn " + getClassName$4(innerClass, 'enterButton'),
|
|
21557
|
+
"attrs": {
|
|
21558
|
+
"primary": true
|
|
21559
|
+
},
|
|
21560
|
+
"on": {
|
|
21561
|
+
"click": _this4.enterButtonOnClick
|
|
21562
|
+
}
|
|
21563
|
+
}, ["Search"]);
|
|
21564
|
+
};
|
|
21565
|
+
|
|
21566
|
+
return h("div", {
|
|
21567
|
+
"class": "enter-button-wrapper"
|
|
21568
|
+
}, [getEnterButtonMarkup()]);
|
|
21569
|
+
}
|
|
21570
|
+
|
|
21571
|
+
return null;
|
|
21572
|
+
},
|
|
21573
|
+
renderIcons: function renderIcons() {
|
|
21574
|
+
var h = this.$createElement;
|
|
21575
|
+
var _this$$props5 = this.$props,
|
|
21576
|
+
iconPosition = _this$$props5.iconPosition,
|
|
21577
|
+
showClear = _this$$props5.showClear,
|
|
21578
|
+
innerClass = _this$$props5.innerClass,
|
|
21579
|
+
getMicInstance = _this$$props5.getMicInstance,
|
|
21580
|
+
showVoiceSearch = _this$$props5.showVoiceSearch,
|
|
21581
|
+
showIcon = _this$$props5.showIcon;
|
|
21784
21582
|
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
21785
21583
|
var currentValue = this.$data.currentValue;
|
|
21786
21584
|
return h("div", [h(IconGroup, {
|
|
@@ -21832,7 +21630,7 @@
|
|
|
21832
21630
|
(_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
|
|
21833
21631
|
},
|
|
21834
21632
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
21835
|
-
var
|
|
21633
|
+
var _this5 = this;
|
|
21836
21634
|
|
|
21837
21635
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
21838
21636
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
@@ -21850,7 +21648,7 @@
|
|
|
21850
21648
|
// Prevent the default refresh event under WINDOWS system
|
|
21851
21649
|
event.preventDefault();
|
|
21852
21650
|
|
|
21853
|
-
|
|
21651
|
+
_this5.focusSearchBox(event);
|
|
21854
21652
|
}); // if one of modifier keys are used, they are handled below
|
|
21855
21653
|
|
|
21856
21654
|
hotkeys('*', function (event) {
|
|
@@ -21861,7 +21659,7 @@
|
|
|
21861
21659
|
var element = modifierKeys[index];
|
|
21862
21660
|
|
|
21863
21661
|
if (hotkeys[element]) {
|
|
21864
|
-
|
|
21662
|
+
_this5.focusSearchBox(event);
|
|
21865
21663
|
|
|
21866
21664
|
break;
|
|
21867
21665
|
}
|
|
@@ -21875,14 +21673,14 @@
|
|
|
21875
21673
|
this.triggerDefaultQuery(value);
|
|
21876
21674
|
},
|
|
21877
21675
|
renderAutoFill: function renderAutoFill(suggestion) {
|
|
21878
|
-
var
|
|
21676
|
+
var _this6 = this;
|
|
21879
21677
|
|
|
21880
21678
|
var h = this.$createElement;
|
|
21881
21679
|
|
|
21882
21680
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
21883
21681
|
e.stopPropagation();
|
|
21884
21682
|
|
|
21885
|
-
|
|
21683
|
+
_this6.onAutofillClick(suggestion);
|
|
21886
21684
|
};
|
|
21887
21685
|
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
21888
21686
|
|
|
@@ -21895,12 +21693,12 @@
|
|
|
21895
21693
|
}
|
|
21896
21694
|
},
|
|
21897
21695
|
render: function render() {
|
|
21898
|
-
var
|
|
21696
|
+
var _this7 = this;
|
|
21899
21697
|
|
|
21900
21698
|
var h = arguments[0];
|
|
21901
|
-
var _this$$
|
|
21902
|
-
theme = _this$$
|
|
21903
|
-
expandSuggestionsContainer = _this$$
|
|
21699
|
+
var _this$$props6 = this.$props,
|
|
21700
|
+
theme = _this$$props6.theme,
|
|
21701
|
+
expandSuggestionsContainer = _this$$props6.expandSuggestionsContainer;
|
|
21904
21702
|
var _this$$scopedSlots = this.$scopedSlots,
|
|
21905
21703
|
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
21906
21704
|
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
@@ -21930,10 +21728,10 @@
|
|
|
21930
21728
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
21931
21729
|
var getIcon = function getIcon(iconType) {
|
|
21932
21730
|
switch (iconType) {
|
|
21933
|
-
case
|
|
21731
|
+
case helper_6.Recent:
|
|
21934
21732
|
return recentSearchesIcon;
|
|
21935
21733
|
|
|
21936
|
-
case
|
|
21734
|
+
case helper_6.Popular:
|
|
21937
21735
|
return popularSearchesIcon;
|
|
21938
21736
|
|
|
21939
21737
|
default:
|
|
@@ -21941,14 +21739,14 @@
|
|
|
21941
21739
|
}
|
|
21942
21740
|
};
|
|
21943
21741
|
|
|
21944
|
-
return h("div", [
|
|
21742
|
+
return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
|
|
21945
21743
|
isOpen: isOpen,
|
|
21946
21744
|
getItemProps: getItemProps,
|
|
21947
21745
|
getItemEvents: getItemEvents,
|
|
21948
21746
|
highlightedIndex: highlightedIndex
|
|
21949
|
-
}),
|
|
21950
|
-
"class": suggestions$1(
|
|
21951
|
-
}, [
|
|
21747
|
+
}), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
21748
|
+
"class": suggestions$1(_this7.themePreset, theme) + " " + getClassName$4(_this7.$props.innerClass, 'list')
|
|
21749
|
+
}, [_this7.normalizedSuggestions.map(function (item, index) {
|
|
21952
21750
|
return renderItem ? h("li", {
|
|
21953
21751
|
"domProps": _extends({}, getItemProps({
|
|
21954
21752
|
item: item
|
|
@@ -21958,7 +21756,7 @@
|
|
|
21958
21756
|
})),
|
|
21959
21757
|
"key": index + 1 + "-" + item.value,
|
|
21960
21758
|
"style": {
|
|
21961
|
-
backgroundColor:
|
|
21759
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
|
|
21962
21760
|
justifyContent: 'flex-start',
|
|
21963
21761
|
alignItems: 'center'
|
|
21964
21762
|
}
|
|
@@ -21971,7 +21769,7 @@
|
|
|
21971
21769
|
})),
|
|
21972
21770
|
"key": index + 1 + "-" + item.value,
|
|
21973
21771
|
"style": {
|
|
21974
|
-
backgroundColor:
|
|
21772
|
+
backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
|
|
21975
21773
|
justifyContent: 'flex-start',
|
|
21976
21774
|
alignItems: 'center'
|
|
21977
21775
|
}
|
|
@@ -21982,61 +21780,61 @@
|
|
|
21982
21780
|
}
|
|
21983
21781
|
}, [h(CustomSvg, {
|
|
21984
21782
|
"attrs": {
|
|
21985
|
-
"className": getClassName$4(
|
|
21783
|
+
"className": getClassName$4(_this7.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
21986
21784
|
"icon": getIcon(item._suggestion_type),
|
|
21987
21785
|
"type": item._suggestion_type + "-search-icon"
|
|
21988
21786
|
}
|
|
21989
21787
|
})]), h(SuggestionItem, {
|
|
21990
21788
|
"attrs": {
|
|
21991
|
-
"currentValue":
|
|
21789
|
+
"currentValue": _this7.currentValue,
|
|
21992
21790
|
"suggestion": item
|
|
21993
21791
|
}
|
|
21994
|
-
}),
|
|
21995
|
-
})]) :
|
|
21792
|
+
}), _this7.renderAutoFill(item)]);
|
|
21793
|
+
})]) : _this7.renderNoSuggestions(_this7.normalizedSuggestions)]);
|
|
21996
21794
|
};
|
|
21997
21795
|
|
|
21998
21796
|
return h("div", {
|
|
21999
21797
|
"class": suggestionsContainer
|
|
22000
|
-
}, [h(InputGroup, [
|
|
21798
|
+
}, [h(InputGroup, [_this7.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
22001
21799
|
"attrs": {
|
|
22002
|
-
"id":
|
|
22003
|
-
"showIcon":
|
|
22004
|
-
"showClear":
|
|
22005
|
-
"iconPosition":
|
|
22006
|
-
"placeholder":
|
|
22007
|
-
"autoFocus":
|
|
22008
|
-
"themePreset":
|
|
21800
|
+
"id": _this7.$props.componentId + "-input",
|
|
21801
|
+
"showIcon": _this7.$props.showIcon,
|
|
21802
|
+
"showClear": _this7.$props.showClear,
|
|
21803
|
+
"iconPosition": _this7.$props.iconPosition,
|
|
21804
|
+
"placeholder": _this7.$props.placeholder,
|
|
21805
|
+
"autoFocus": _this7.$props.autoFocus,
|
|
21806
|
+
"themePreset": _this7.themePreset,
|
|
22009
21807
|
"autocomplete": "off"
|
|
22010
21808
|
},
|
|
22011
|
-
"ref":
|
|
22012
|
-
"class": getClassName$4(
|
|
21809
|
+
"ref": _this7.$props.innerRef,
|
|
21810
|
+
"class": getClassName$4(_this7.$props.innerClass, 'input'),
|
|
22013
21811
|
"on": _extends({}, getInputEvents({
|
|
22014
|
-
onInput:
|
|
21812
|
+
onInput: _this7.onInputChange,
|
|
22015
21813
|
onBlur: function onBlur(e) {
|
|
22016
|
-
|
|
21814
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
22017
21815
|
},
|
|
22018
|
-
onFocus:
|
|
21816
|
+
onFocus: _this7.handleFocus,
|
|
22019
21817
|
onKeyPress: function onKeyPress(e) {
|
|
22020
|
-
|
|
21818
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
22021
21819
|
|
|
22022
|
-
|
|
21820
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
22023
21821
|
},
|
|
22024
21822
|
onKeyDown: function onKeyDown(e) {
|
|
22025
|
-
return
|
|
21823
|
+
return _this7.handleKeyDown(e, highlightedIndex);
|
|
22026
21824
|
},
|
|
22027
21825
|
onKeyUp: function onKeyUp(e) {
|
|
22028
|
-
|
|
21826
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
22029
21827
|
|
|
22030
|
-
|
|
21828
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
22031
21829
|
},
|
|
22032
21830
|
onClick: function onClick() {
|
|
22033
21831
|
setHighlightedIndex(null);
|
|
22034
21832
|
}
|
|
22035
21833
|
})),
|
|
22036
21834
|
"domProps": _extends({}, getInputProps({
|
|
22037
|
-
value:
|
|
21835
|
+
value: _this7.$data.currentValue === null ? '' : _this7.$data.currentValue
|
|
22038
21836
|
}))
|
|
22039
|
-
}),
|
|
21837
|
+
}), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this7.renderInputAddonAfter(), _this7.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
|
|
22040
21838
|
}
|
|
22041
21839
|
}
|
|
22042
21840
|
}) : h("div", {
|
|
@@ -22052,26 +21850,22 @@
|
|
|
22052
21850
|
},
|
|
22053
21851
|
"on": _extends({}, {
|
|
22054
21852
|
blur: function blur(e) {
|
|
22055
|
-
|
|
21853
|
+
_this7.$emit('blur', e, _this7.triggerQuery);
|
|
22056
21854
|
},
|
|
22057
21855
|
keypress: function keypress(e) {
|
|
22058
|
-
|
|
21856
|
+
_this7.$emit('keyPress', e, _this7.triggerQuery);
|
|
22059
21857
|
|
|
22060
|
-
|
|
21858
|
+
_this7.$emit('key-press', e, _this7.triggerQuery);
|
|
22061
21859
|
},
|
|
22062
21860
|
input: this.onInputChange,
|
|
22063
21861
|
focus: function focus(e) {
|
|
22064
|
-
|
|
22065
|
-
},
|
|
22066
|
-
keydown: function keydown(e) {
|
|
22067
|
-
_this6.$emit('keyDown', e, _this6.triggerQuery);
|
|
22068
|
-
|
|
22069
|
-
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
21862
|
+
_this7.$emit('focus', e, _this7.triggerQuery);
|
|
22070
21863
|
},
|
|
21864
|
+
keydown: this.handleKeyDown,
|
|
22071
21865
|
keyup: function keyup(e) {
|
|
22072
|
-
|
|
21866
|
+
_this7.$emit('keyUp', e, _this7.triggerQuery);
|
|
22073
21867
|
|
|
22074
|
-
|
|
21868
|
+
_this7.$emit('key-up', e, _this7.triggerQuery);
|
|
22075
21869
|
}
|
|
22076
21870
|
}),
|
|
22077
21871
|
"domProps": _extends({}, {
|
|
@@ -22079,7 +21873,7 @@
|
|
|
22079
21873
|
value: this.$data.currentValue ? this.$data.currentValue : ''
|
|
22080
21874
|
}),
|
|
22081
21875
|
"ref": this.$props.innerRef
|
|
22082
|
-
}), this.renderIcons()]), this.renderInputAddonAfter()])])]);
|
|
21876
|
+
}), this.renderIcons()]), this.renderInputAddonAfter(), this.renderEnterButtonElement()])])]);
|
|
22083
21877
|
},
|
|
22084
21878
|
destroyed: function destroyed() {
|
|
22085
21879
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
@@ -22328,8 +22122,9 @@
|
|
|
22328
22122
|
var getQueryOptions$1 = lib_8.getQueryOptions,
|
|
22329
22123
|
checkValueChange$2 = lib_8.checkValueChange,
|
|
22330
22124
|
getClassName$5 = lib_8.getClassName,
|
|
22331
|
-
|
|
22332
|
-
|
|
22125
|
+
isEqual$6 = lib_8.isEqual,
|
|
22126
|
+
extractQueryFromCustomQuery$2 = lib_8.extractQueryFromCustomQuery,
|
|
22127
|
+
getOptionsForCustomQuery$2 = lib_8.getOptionsForCustomQuery;
|
|
22333
22128
|
var SingleList = {
|
|
22334
22129
|
name: 'SingleList',
|
|
22335
22130
|
props: {
|
|
@@ -22566,22 +22361,22 @@
|
|
|
22566
22361
|
checkValueChange$2(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
22567
22362
|
},
|
|
22568
22363
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
22569
|
-
var defaultQueryOptions;
|
|
22570
22364
|
var query = SingleList.defaultQuery(value, props);
|
|
22571
22365
|
|
|
22572
22366
|
if (this.defaultQuery) {
|
|
22573
22367
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
22368
|
+
var defaultQueryObj = extractQueryFromCustomQuery$2(defaultQueryToBeSet);
|
|
22574
22369
|
|
|
22575
|
-
if (
|
|
22576
|
-
query =
|
|
22577
|
-
}
|
|
22370
|
+
if (defaultQueryObj) {
|
|
22371
|
+
query = defaultQueryObj;
|
|
22372
|
+
} // Update calculated default query in store
|
|
22578
22373
|
|
|
22579
|
-
defaultQueryOptions = getOptionsFromQuery$2(defaultQueryToBeSet); // Update calculated default query in store
|
|
22580
22374
|
|
|
22581
22375
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
22376
|
+
var defaultQueryOptions = getOptionsForCustomQuery$2(defaultQueryToBeSet);
|
|
22377
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
22582
22378
|
}
|
|
22583
22379
|
|
|
22584
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
22585
22380
|
this.updateQuery({
|
|
22586
22381
|
componentId: this.internalComponent,
|
|
22587
22382
|
query: query,
|
|
@@ -22592,17 +22387,15 @@
|
|
|
22592
22387
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
22593
22388
|
var customQuery = props.customQuery;
|
|
22594
22389
|
var query = SingleList.defaultQuery(value, props);
|
|
22595
|
-
var customQueryOptions;
|
|
22596
22390
|
|
|
22597
22391
|
if (customQuery) {
|
|
22598
|
-
var
|
|
22599
|
-
|
|
22600
|
-
|
|
22601
|
-
customQueryOptions = getOptionsFromQuery$2(customQuery(value, props));
|
|
22392
|
+
var customQueryCalc = customQuery(value, props);
|
|
22393
|
+
query = extractQueryFromCustomQuery$2(customQueryCalc);
|
|
22394
|
+
var customQueryOptions = getOptionsForCustomQuery$2(customQueryCalc);
|
|
22602
22395
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
22396
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
22603
22397
|
}
|
|
22604
22398
|
|
|
22605
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
22606
22399
|
this.updateQuery({
|
|
22607
22400
|
componentId: props.componentId,
|
|
22608
22401
|
query: query,
|
|
@@ -22622,7 +22415,7 @@
|
|
|
22622
22415
|
|
|
22623
22416
|
if (props.defaultQuery) {
|
|
22624
22417
|
var value = this.$data.currentValue;
|
|
22625
|
-
var defaultQueryOptions =
|
|
22418
|
+
var defaultQueryOptions = getOptionsForCustomQuery$2(props.defaultQuery(value, props));
|
|
22626
22419
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
22627
22420
|
} else {
|
|
22628
22421
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -22767,6 +22560,10 @@
|
|
|
22767
22560
|
return query;
|
|
22768
22561
|
};
|
|
22769
22562
|
|
|
22563
|
+
SingleList.hasInternalComponent = function () {
|
|
22564
|
+
return true;
|
|
22565
|
+
};
|
|
22566
|
+
|
|
22770
22567
|
var mapStateToProps$5 = function mapStateToProps(state, props) {
|
|
22771
22568
|
return {
|
|
22772
22569
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -22788,7 +22585,7 @@
|
|
|
22788
22585
|
};
|
|
22789
22586
|
var ListConnected = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
|
|
22790
22587
|
componentType: constants_1$1.singleList,
|
|
22791
|
-
internalComponent:
|
|
22588
|
+
internalComponent: SingleList.hasInternalComponent()
|
|
22792
22589
|
});
|
|
22793
22590
|
|
|
22794
22591
|
SingleList.install = function (Vue) {
|
|
@@ -22806,7 +22603,8 @@
|
|
|
22806
22603
|
getQueryOptions$2 = lib_8.getQueryOptions,
|
|
22807
22604
|
checkValueChange$3 = lib_8.checkValueChange,
|
|
22808
22605
|
getClassName$6 = lib_8.getClassName,
|
|
22809
|
-
|
|
22606
|
+
extractQueryFromCustomQuery$3 = lib_8.extractQueryFromCustomQuery,
|
|
22607
|
+
getOptionsForCustomQuery$3 = lib_8.getOptionsForCustomQuery;
|
|
22810
22608
|
var MultiList = {
|
|
22811
22609
|
name: 'MultiList',
|
|
22812
22610
|
props: {
|
|
@@ -22833,7 +22631,7 @@
|
|
|
22833
22631
|
showCount: VueTypes.bool.def(true),
|
|
22834
22632
|
showFilter: VueTypes.bool.def(true),
|
|
22835
22633
|
showSearch: VueTypes.bool.def(true),
|
|
22836
|
-
size: VueTypes.number
|
|
22634
|
+
size: VueTypes.number,
|
|
22837
22635
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
22838
22636
|
title: types.title,
|
|
22839
22637
|
URLParams: VueTypes.bool.def(false),
|
|
@@ -23120,22 +22918,22 @@
|
|
|
23120
22918
|
checkValueChange$3(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
23121
22919
|
},
|
|
23122
22920
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
23123
|
-
var defaultQueryOptions;
|
|
23124
22921
|
var query = MultiList.defaultQuery(value, props);
|
|
23125
22922
|
|
|
23126
22923
|
if (this.defaultQuery) {
|
|
23127
22924
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
22925
|
+
var defaultQueryObj = extractQueryFromCustomQuery$3(defaultQueryToBeSet);
|
|
23128
22926
|
|
|
23129
|
-
if (
|
|
23130
|
-
query =
|
|
23131
|
-
}
|
|
22927
|
+
if (defaultQueryObj) {
|
|
22928
|
+
query = defaultQueryObj;
|
|
22929
|
+
} // Update calculated default query in store
|
|
23132
22930
|
|
|
23133
|
-
defaultQueryOptions = getOptionsFromQuery$3(defaultQueryToBeSet); // Update calculated default query in store
|
|
23134
22931
|
|
|
23135
22932
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
22933
|
+
var defaultQueryOptions = getOptionsForCustomQuery$3(defaultQueryToBeSet);
|
|
22934
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
23136
22935
|
}
|
|
23137
22936
|
|
|
23138
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
23139
22937
|
this.updateQuery({
|
|
23140
22938
|
componentId: this.internalComponent,
|
|
23141
22939
|
query: query,
|
|
@@ -23146,17 +22944,15 @@
|
|
|
23146
22944
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
23147
22945
|
var customQuery = props.customQuery;
|
|
23148
22946
|
var query = MultiList.defaultQuery(value, props);
|
|
23149
|
-
var customQueryOptions;
|
|
23150
22947
|
|
|
23151
22948
|
if (customQuery) {
|
|
23152
|
-
var
|
|
23153
|
-
|
|
23154
|
-
query = _ref.query;
|
|
23155
|
-
customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
|
|
22949
|
+
var customQueryCalc = customQuery(value, props);
|
|
22950
|
+
query = extractQueryFromCustomQuery$3(customQueryCalc);
|
|
23156
22951
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
22952
|
+
var customQueryOptions = getOptionsForCustomQuery$3(customQueryCalc);
|
|
22953
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23157
22954
|
}
|
|
23158
22955
|
|
|
23159
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23160
22956
|
this.updateQuery({
|
|
23161
22957
|
componentId: props.componentId,
|
|
23162
22958
|
query: query,
|
|
@@ -23176,7 +22972,7 @@
|
|
|
23176
22972
|
|
|
23177
22973
|
if (props.defaultQuery) {
|
|
23178
22974
|
var value = Object.keys(this.$data.currentValue);
|
|
23179
|
-
var defaultQueryOptions =
|
|
22975
|
+
var defaultQueryOptions = getOptionsForCustomQuery$3(props.defaultQuery(value, props));
|
|
23180
22976
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
23181
22977
|
} else {
|
|
23182
22978
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -23262,7 +23058,13 @@
|
|
|
23262
23058
|
|
|
23263
23059
|
MultiList.defaultQuery = function (value, props) {
|
|
23264
23060
|
var query = null;
|
|
23265
|
-
var
|
|
23061
|
+
var queryFormat = props.queryFormat;
|
|
23062
|
+
|
|
23063
|
+
if (queryFormat === undefined) {
|
|
23064
|
+
queryFormat = 'or';
|
|
23065
|
+
}
|
|
23066
|
+
|
|
23067
|
+
var type = queryFormat === 'or' ? 'terms' : 'term';
|
|
23266
23068
|
|
|
23267
23069
|
if (!Array.isArray(value) || value.length === 0) {
|
|
23268
23070
|
return null;
|
|
@@ -23283,14 +23085,14 @@
|
|
|
23283
23085
|
} else if (value) {
|
|
23284
23086
|
var listQuery;
|
|
23285
23087
|
|
|
23286
|
-
if (
|
|
23088
|
+
if (queryFormat === 'or') {
|
|
23287
23089
|
if (props.showMissing) {
|
|
23288
|
-
var _type,
|
|
23090
|
+
var _type, _ref;
|
|
23289
23091
|
|
|
23290
23092
|
var hasMissingTerm = value.includes(props.missingLabel);
|
|
23291
|
-
var should = [(
|
|
23093
|
+
var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
|
|
23292
23094
|
return item !== props.missingLabel;
|
|
23293
|
-
}), _type),
|
|
23095
|
+
}), _type), _ref)];
|
|
23294
23096
|
|
|
23295
23097
|
if (hasMissingTerm) {
|
|
23296
23098
|
should = should.concat({
|
|
@@ -23317,9 +23119,9 @@
|
|
|
23317
23119
|
} else {
|
|
23318
23120
|
// adds a sub-query with must as an array of objects for each term/value
|
|
23319
23121
|
var queryArray = value.map(function (item) {
|
|
23320
|
-
var _type3,
|
|
23122
|
+
var _type3, _ref2;
|
|
23321
23123
|
|
|
23322
|
-
return
|
|
23124
|
+
return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
|
|
23323
23125
|
});
|
|
23324
23126
|
listQuery = {
|
|
23325
23127
|
bool: {
|
|
@@ -23369,9 +23171,14 @@
|
|
|
23369
23171
|
setCustomQuery: setCustomQuery$3,
|
|
23370
23172
|
setDefaultQuery: setDefaultQuery$4
|
|
23371
23173
|
};
|
|
23174
|
+
|
|
23175
|
+
MultiList.hasInternalComponent = function () {
|
|
23176
|
+
return true;
|
|
23177
|
+
};
|
|
23178
|
+
|
|
23372
23179
|
var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
|
|
23373
23180
|
componentType: constants_1$1.multiList,
|
|
23374
|
-
internalComponent:
|
|
23181
|
+
internalComponent: MultiList.hasInternalComponent()
|
|
23375
23182
|
});
|
|
23376
23183
|
|
|
23377
23184
|
MultiList.install = function (Vue) {
|
|
@@ -23698,9 +23505,10 @@
|
|
|
23698
23505
|
checkValueChange$4 = lib_8.checkValueChange,
|
|
23699
23506
|
checkPropChange$1 = lib_8.checkPropChange,
|
|
23700
23507
|
getClassName$8 = lib_8.getClassName,
|
|
23701
|
-
getOptionsFromQuery$4 = lib_8.getOptionsFromQuery,
|
|
23702
23508
|
isEqual$8 = lib_8.isEqual,
|
|
23703
|
-
getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery
|
|
23509
|
+
getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery,
|
|
23510
|
+
extractQueryFromCustomQuery$4 = lib_8.extractQueryFromCustomQuery,
|
|
23511
|
+
getOptionsForCustomQuery$4 = lib_8.getOptionsForCustomQuery;
|
|
23704
23512
|
var SingleDropdownList = {
|
|
23705
23513
|
name: 'SingleDropdownList',
|
|
23706
23514
|
data: function data() {
|
|
@@ -23737,7 +23545,7 @@
|
|
|
23737
23545
|
selectAllLabel: types.string,
|
|
23738
23546
|
showCount: VueTypes.bool.def(true),
|
|
23739
23547
|
showFilter: VueTypes.bool.def(true),
|
|
23740
|
-
size: VueTypes.number
|
|
23548
|
+
size: VueTypes.number,
|
|
23741
23549
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
23742
23550
|
title: types.title,
|
|
23743
23551
|
URLParams: VueTypes.bool.def(false),
|
|
@@ -23949,22 +23757,22 @@
|
|
|
23949
23757
|
}
|
|
23950
23758
|
},
|
|
23951
23759
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
23952
|
-
var defaultQueryOptions;
|
|
23953
23760
|
var query = SingleDropdownList.defaultQuery(value, props);
|
|
23954
23761
|
|
|
23955
23762
|
if (this.defaultQuery) {
|
|
23956
23763
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
23764
|
+
var defaultQueryObj = extractQueryFromCustomQuery$4(defaultQueryToBeSet);
|
|
23957
23765
|
|
|
23958
|
-
if (
|
|
23959
|
-
query =
|
|
23960
|
-
}
|
|
23766
|
+
if (defaultQueryObj) {
|
|
23767
|
+
query = defaultQueryObj;
|
|
23768
|
+
} // Update calculated default query in store
|
|
23961
23769
|
|
|
23962
|
-
defaultQueryOptions = getOptionsFromQuery$4(defaultQueryToBeSet); // Update calculated default query in store
|
|
23963
23770
|
|
|
23964
23771
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
23772
|
+
var defaultQueryOptions = getOptionsForCustomQuery$4(defaultQueryToBeSet);
|
|
23773
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
23965
23774
|
}
|
|
23966
23775
|
|
|
23967
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
23968
23776
|
this.updateQuery({
|
|
23969
23777
|
componentId: this.internalComponent,
|
|
23970
23778
|
query: query,
|
|
@@ -23975,17 +23783,15 @@
|
|
|
23975
23783
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
23976
23784
|
var customQuery = props.customQuery;
|
|
23977
23785
|
var query = SingleDropdownList.defaultQuery(value, props);
|
|
23978
|
-
var customQueryOptions;
|
|
23979
23786
|
|
|
23980
23787
|
if (customQuery) {
|
|
23981
|
-
var
|
|
23982
|
-
|
|
23983
|
-
query = _ref.query;
|
|
23984
|
-
customQueryOptions = getOptionsFromQuery$4(customQuery(value, props));
|
|
23788
|
+
var customQueryCalc = customQuery(value, props);
|
|
23789
|
+
query = extractQueryFromCustomQuery$4(customQueryCalc);
|
|
23985
23790
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
23791
|
+
var customQueryOptions = getOptionsForCustomQuery$4(customQueryCalc);
|
|
23792
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23986
23793
|
}
|
|
23987
23794
|
|
|
23988
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23989
23795
|
this.updateQuery({
|
|
23990
23796
|
componentId: props.componentId,
|
|
23991
23797
|
query: query,
|
|
@@ -24019,7 +23825,7 @@
|
|
|
24019
23825
|
|
|
24020
23826
|
if (props.defaultQuery) {
|
|
24021
23827
|
var value = this.$data.currentValue;
|
|
24022
|
-
var defaultQueryOptions =
|
|
23828
|
+
var defaultQueryOptions = getOptionsForCustomQuery$4(props.defaultQuery(value, props));
|
|
24023
23829
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
24024
23830
|
} else {
|
|
24025
23831
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -24111,6 +23917,10 @@
|
|
|
24111
23917
|
}) : getAggsQuery(queryOptions, props);
|
|
24112
23918
|
};
|
|
24113
23919
|
|
|
23920
|
+
SingleDropdownList.hasInternalComponent = function () {
|
|
23921
|
+
return true;
|
|
23922
|
+
};
|
|
23923
|
+
|
|
24114
23924
|
var mapStateToProps$7 = function mapStateToProps(state, props) {
|
|
24115
23925
|
return {
|
|
24116
23926
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -24132,7 +23942,7 @@
|
|
|
24132
23942
|
};
|
|
24133
23943
|
var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
|
|
24134
23944
|
componentType: constants_1$1.singleDropdownList,
|
|
24135
|
-
internalComponent:
|
|
23945
|
+
internalComponent: SingleDropdownList.hasInternalComponent()
|
|
24136
23946
|
});
|
|
24137
23947
|
|
|
24138
23948
|
SingleDropdownList.install = function (Vue) {
|
|
@@ -24151,8 +23961,9 @@
|
|
|
24151
23961
|
checkValueChange$5 = lib_8.checkValueChange,
|
|
24152
23962
|
checkPropChange$2 = lib_8.checkPropChange,
|
|
24153
23963
|
getClassName$9 = lib_8.getClassName,
|
|
24154
|
-
|
|
24155
|
-
|
|
23964
|
+
getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery,
|
|
23965
|
+
extractQueryFromCustomQuery$5 = lib_8.extractQueryFromCustomQuery,
|
|
23966
|
+
getOptionsForCustomQuery$5 = lib_8.getOptionsForCustomQuery;
|
|
24156
23967
|
var MultiDropdownList = {
|
|
24157
23968
|
name: 'MultiDropdownList',
|
|
24158
23969
|
data: function data() {
|
|
@@ -24190,7 +24001,7 @@
|
|
|
24190
24001
|
selectAllLabel: types.string,
|
|
24191
24002
|
showCount: VueTypes.bool.def(true),
|
|
24192
24003
|
showFilter: VueTypes.bool.def(true),
|
|
24193
|
-
size: VueTypes.number
|
|
24004
|
+
size: VueTypes.number,
|
|
24194
24005
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
24195
24006
|
title: types.title,
|
|
24196
24007
|
URLParams: VueTypes.bool.def(false),
|
|
@@ -24476,22 +24287,22 @@
|
|
|
24476
24287
|
checkValueChange$5(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
24477
24288
|
},
|
|
24478
24289
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
24479
|
-
var defaultQueryOptions;
|
|
24480
24290
|
var query = MultiDropdownList.defaultQuery(value, props);
|
|
24481
24291
|
|
|
24482
24292
|
if (this.defaultQuery) {
|
|
24483
24293
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
24294
|
+
var defaultQueryObj = extractQueryFromCustomQuery$5(defaultQueryToBeSet);
|
|
24484
24295
|
|
|
24485
|
-
if (
|
|
24486
|
-
query =
|
|
24487
|
-
}
|
|
24296
|
+
if (defaultQueryObj) {
|
|
24297
|
+
query = defaultQueryObj;
|
|
24298
|
+
} // Update calculated default query in store
|
|
24488
24299
|
|
|
24489
|
-
defaultQueryOptions = getOptionsFromQuery$5(defaultQueryToBeSet); // Update calculated default query in store
|
|
24490
24300
|
|
|
24491
24301
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
24302
|
+
var defaultQueryOptions = getOptionsForCustomQuery$5(defaultQueryToBeSet);
|
|
24303
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
24492
24304
|
}
|
|
24493
24305
|
|
|
24494
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
24495
24306
|
this.updateQuery({
|
|
24496
24307
|
componentId: this.internalComponent,
|
|
24497
24308
|
query: query,
|
|
@@ -24502,17 +24313,15 @@
|
|
|
24502
24313
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
24503
24314
|
var customQuery = props.customQuery;
|
|
24504
24315
|
var query = MultiDropdownList.defaultQuery(value, props);
|
|
24505
|
-
var customQueryOptions;
|
|
24506
24316
|
|
|
24507
24317
|
if (customQuery) {
|
|
24508
|
-
var
|
|
24509
|
-
|
|
24510
|
-
query = _ref.query;
|
|
24511
|
-
customQueryOptions = getOptionsFromQuery$5(customQuery(value, props));
|
|
24318
|
+
var customQueryCalc = customQuery(value, props);
|
|
24319
|
+
query = extractQueryFromCustomQuery$5(customQueryCalc);
|
|
24512
24320
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
24321
|
+
var customQueryOptions = getOptionsForCustomQuery$5(customQueryCalc);
|
|
24322
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
24513
24323
|
}
|
|
24514
24324
|
|
|
24515
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
24516
24325
|
this.updateQuery({
|
|
24517
24326
|
componentId: props.componentId,
|
|
24518
24327
|
query: query,
|
|
@@ -24546,7 +24355,7 @@
|
|
|
24546
24355
|
|
|
24547
24356
|
if (props.defaultQuery) {
|
|
24548
24357
|
var value = Object.keys(this.$data.currentValue);
|
|
24549
|
-
var defaultQueryOptions =
|
|
24358
|
+
var defaultQueryOptions = getOptionsForCustomQuery$5(props.defaultQuery(value, props));
|
|
24550
24359
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
24551
24360
|
} else {
|
|
24552
24361
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -24582,7 +24391,13 @@
|
|
|
24582
24391
|
|
|
24583
24392
|
MultiDropdownList.defaultQuery = function (value, props) {
|
|
24584
24393
|
var query = null;
|
|
24585
|
-
var
|
|
24394
|
+
var queryFormat = props.queryFormat;
|
|
24395
|
+
|
|
24396
|
+
if (queryFormat === undefined) {
|
|
24397
|
+
queryFormat = 'or';
|
|
24398
|
+
}
|
|
24399
|
+
|
|
24400
|
+
var type = queryFormat === 'or' ? 'terms' : 'term';
|
|
24586
24401
|
|
|
24587
24402
|
if (!Array.isArray(value) || value.length === 0) {
|
|
24588
24403
|
return null;
|
|
@@ -24603,14 +24418,14 @@
|
|
|
24603
24418
|
} else if (value) {
|
|
24604
24419
|
var listQuery;
|
|
24605
24420
|
|
|
24606
|
-
if (
|
|
24421
|
+
if (queryFormat === 'or') {
|
|
24607
24422
|
if (props.showMissing) {
|
|
24608
|
-
var _type,
|
|
24423
|
+
var _type, _ref;
|
|
24609
24424
|
|
|
24610
24425
|
var hasMissingTerm = value.includes(props.missingLabel);
|
|
24611
|
-
var should = [(
|
|
24426
|
+
var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
|
|
24612
24427
|
return item !== props.missingLabel;
|
|
24613
|
-
}), _type),
|
|
24428
|
+
}), _type), _ref)];
|
|
24614
24429
|
|
|
24615
24430
|
if (hasMissingTerm) {
|
|
24616
24431
|
should = should.concat({
|
|
@@ -24637,9 +24452,9 @@
|
|
|
24637
24452
|
} else {
|
|
24638
24453
|
// adds a sub-query with must as an array of objects for each term/value
|
|
24639
24454
|
var queryArray = value.map(function (item) {
|
|
24640
|
-
var _type3,
|
|
24455
|
+
var _type3, _ref2;
|
|
24641
24456
|
|
|
24642
|
-
return
|
|
24457
|
+
return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
|
|
24643
24458
|
});
|
|
24644
24459
|
listQuery = {
|
|
24645
24460
|
bool: {
|
|
@@ -24674,6 +24489,10 @@
|
|
|
24674
24489
|
}) : getAggsQuery(queryOptions, props);
|
|
24675
24490
|
};
|
|
24676
24491
|
|
|
24492
|
+
MultiDropdownList.hasInternalComponent = function () {
|
|
24493
|
+
return true;
|
|
24494
|
+
};
|
|
24495
|
+
|
|
24677
24496
|
var mapStateToProps$8 = function mapStateToProps(state, props) {
|
|
24678
24497
|
return {
|
|
24679
24498
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -24695,7 +24514,7 @@
|
|
|
24695
24514
|
};
|
|
24696
24515
|
var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
|
|
24697
24516
|
componentType: constants_1$1.multiDropdownList,
|
|
24698
|
-
internalComponent:
|
|
24517
|
+
internalComponent: MultiDropdownList.hasInternalComponent()
|
|
24699
24518
|
});
|
|
24700
24519
|
|
|
24701
24520
|
MultiDropdownList.install = function (Vue) {
|
|
@@ -24711,7 +24530,7 @@
|
|
|
24711
24530
|
var isEqual$a = lib_8.isEqual,
|
|
24712
24531
|
checkValueChange$6 = lib_8.checkValueChange,
|
|
24713
24532
|
getClassName$a = lib_8.getClassName,
|
|
24714
|
-
getOptionsFromQuery
|
|
24533
|
+
getOptionsFromQuery = lib_8.getOptionsFromQuery,
|
|
24715
24534
|
handleA11yAction$1 = lib_8.handleA11yAction;
|
|
24716
24535
|
var ToggleButton = {
|
|
24717
24536
|
name: 'ToggleButton',
|
|
@@ -24877,7 +24696,7 @@
|
|
|
24877
24696
|
var _ref = customQuery(value, props) || {};
|
|
24878
24697
|
|
|
24879
24698
|
query = _ref.query;
|
|
24880
|
-
this.setQueryOptions(props.componentId, getOptionsFromQuery
|
|
24699
|
+
this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)), false);
|
|
24881
24700
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
24882
24701
|
}
|
|
24883
24702
|
|
|
@@ -25035,10 +24854,7 @@
|
|
|
25035
24854
|
|
|
25036
24855
|
ToggleButton.componentType = constants_1$1.toggleButton;
|
|
25037
24856
|
|
|
25038
|
-
var _excluded = ["options"]
|
|
25039
|
-
_excluded2 = ["query"],
|
|
25040
|
-
_excluded3 = ["query"],
|
|
25041
|
-
_excluded4 = ["query"];
|
|
24857
|
+
var _excluded = ["options"];
|
|
25042
24858
|
var updateQuery$8 = lib_5.updateQuery,
|
|
25043
24859
|
setQueryOptions$7 = lib_5.setQueryOptions,
|
|
25044
24860
|
setCustomQuery$7 = lib_5.setCustomQuery,
|
|
@@ -25046,15 +24862,16 @@
|
|
|
25046
24862
|
var parseHits$1 = lib_8.parseHits,
|
|
25047
24863
|
isEqual$b = lib_8.isEqual,
|
|
25048
24864
|
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
25049
|
-
|
|
25050
|
-
|
|
24865
|
+
getResultStats$3 = lib_8.getResultStats,
|
|
24866
|
+
extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
|
|
24867
|
+
getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
|
|
25051
24868
|
var ReactiveComponent = {
|
|
25052
24869
|
name: 'ReactiveComponent',
|
|
25053
24870
|
props: {
|
|
25054
24871
|
componentId: types.stringRequired,
|
|
25055
24872
|
aggregationField: types.string,
|
|
25056
24873
|
aggregationSize: VueTypes.number,
|
|
25057
|
-
size: VueTypes.number
|
|
24874
|
+
size: VueTypes.number,
|
|
25058
24875
|
defaultQuery: types.func,
|
|
25059
24876
|
customQuery: types.func,
|
|
25060
24877
|
filterLabel: types.string,
|
|
@@ -25096,25 +24913,16 @@
|
|
|
25096
24913
|
|
|
25097
24914
|
if (customQuery) {
|
|
25098
24915
|
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
25099
|
-
|
|
25100
|
-
var
|
|
25101
|
-
query = _ref.query;
|
|
25102
|
-
|
|
25103
|
-
var customQueryOptions = calcCustomQuery ? getOptionsFromQuery$7(calcCustomQuery) : null;
|
|
24916
|
+
var query = extractQueryFromCustomQuery$6(calcCustomQuery);
|
|
24917
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
|
|
25104
24918
|
|
|
25105
24919
|
if (customQueryOptions) {
|
|
25106
24920
|
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
25107
24921
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
25108
24922
|
|
|
25109
|
-
var queryToSet = query || null;
|
|
25110
|
-
|
|
25111
|
-
if (calcCustomQuery && calcCustomQuery.id) {
|
|
25112
|
-
queryToSet = calcCustomQuery;
|
|
25113
|
-
}
|
|
25114
|
-
|
|
25115
24923
|
this.updateQuery({
|
|
25116
24924
|
componentId: componentId,
|
|
25117
|
-
query:
|
|
24925
|
+
query: query,
|
|
25118
24926
|
value: this.selectedValue || null,
|
|
25119
24927
|
label: filterLabel,
|
|
25120
24928
|
showFilter: showFilter,
|
|
@@ -25122,36 +24930,35 @@
|
|
|
25122
24930
|
});
|
|
25123
24931
|
}
|
|
25124
24932
|
|
|
25125
|
-
this.setQuery = function (
|
|
25126
|
-
var options =
|
|
25127
|
-
obj = _objectWithoutPropertiesLoose(
|
|
24933
|
+
this.setQuery = function (_ref) {
|
|
24934
|
+
var options = _ref.options,
|
|
24935
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25128
24936
|
|
|
25129
|
-
|
|
25130
|
-
|
|
24937
|
+
var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
24938
|
+
|
|
24939
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
24940
|
+
queryToBeSet = queryToBeSet.query;
|
|
25131
24941
|
}
|
|
25132
24942
|
|
|
25133
|
-
var
|
|
24943
|
+
var customQueryCalc = _extends({}, options, {
|
|
24944
|
+
query: queryToBeSet
|
|
24945
|
+
});
|
|
25134
24946
|
|
|
25135
|
-
|
|
25136
|
-
queryToBeSet = obj.query.query;
|
|
25137
|
-
} // Update customQuery field for RS API
|
|
24947
|
+
var rsAPIQuery = customQueryCalc; // handle stored queries
|
|
25138
24948
|
|
|
24949
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
24950
|
+
rsAPIQuery = queryToBeSet;
|
|
24951
|
+
} // Update customQuery field for RS API
|
|
25139
24952
|
|
|
25140
|
-
if (obj && obj.query || options) {
|
|
25141
|
-
var customQueryCalc = _extends({}, options);
|
|
25142
24953
|
|
|
25143
|
-
|
|
25144
|
-
if (obj.query.id) {
|
|
25145
|
-
customQueryCalc = queryToBeSet;
|
|
25146
|
-
} else {
|
|
25147
|
-
customQueryCalc.query = obj.query;
|
|
25148
|
-
}
|
|
25149
|
-
}
|
|
24954
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
25150
24955
|
|
|
25151
|
-
|
|
24956
|
+
if (options) {
|
|
24957
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
25152
24958
|
}
|
|
25153
24959
|
|
|
25154
24960
|
_this.updateQuery(_extends({}, obj, {
|
|
24961
|
+
query: customQueryCalc.query,
|
|
25155
24962
|
componentId: props.componentId,
|
|
25156
24963
|
label: props.filterLabel,
|
|
25157
24964
|
showFilter: props.showFilter,
|
|
@@ -25162,29 +24969,22 @@
|
|
|
25162
24969
|
if (props.defaultQuery) {
|
|
25163
24970
|
this.internalComponent = props.componentId + "__internal";
|
|
25164
24971
|
}
|
|
25165
|
-
|
|
25166
|
-
beforeMount: function beforeMount() {
|
|
24972
|
+
|
|
25167
24973
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
25168
24974
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
25169
24975
|
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
25170
24976
|
|
|
25171
|
-
var
|
|
25172
|
-
|
|
25173
|
-
|
|
24977
|
+
var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
24978
|
+
|
|
24979
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
25174
24980
|
|
|
25175
24981
|
if (queryOptions) {
|
|
25176
24982
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25177
24983
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
25178
24984
|
|
|
25179
|
-
var queryToSet = query || null;
|
|
25180
|
-
|
|
25181
|
-
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
25182
|
-
queryToSet = this.$defaultQuery;
|
|
25183
|
-
}
|
|
25184
|
-
|
|
25185
24985
|
this.updateQuery({
|
|
25186
24986
|
componentId: this.internalComponent,
|
|
25187
|
-
query:
|
|
24987
|
+
query: _query
|
|
25188
24988
|
});
|
|
25189
24989
|
}
|
|
25190
24990
|
},
|
|
@@ -25232,10 +25032,8 @@
|
|
|
25232
25032
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
25233
25033
|
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
25234
25034
|
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
25235
|
-
|
|
25236
|
-
var
|
|
25237
|
-
query = _ref4.query,
|
|
25238
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref4, _excluded3);
|
|
25035
|
+
var query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
25036
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
25239
25037
|
|
|
25240
25038
|
if (queryOptions) {
|
|
25241
25039
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
@@ -25243,15 +25041,9 @@
|
|
|
25243
25041
|
|
|
25244
25042
|
|
|
25245
25043
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
25246
|
-
var queryToSet = query || null;
|
|
25247
|
-
|
|
25248
|
-
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
25249
|
-
queryToSet = this.$defaultQuery;
|
|
25250
|
-
}
|
|
25251
|
-
|
|
25252
25044
|
this.updateQuery({
|
|
25253
25045
|
componentId: this.internalComponent,
|
|
25254
|
-
query:
|
|
25046
|
+
query: query
|
|
25255
25047
|
});
|
|
25256
25048
|
}
|
|
25257
25049
|
},
|
|
@@ -25259,10 +25051,8 @@
|
|
|
25259
25051
|
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
25260
25052
|
var componentId = this.$props.componentId;
|
|
25261
25053
|
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
25262
|
-
|
|
25263
|
-
var
|
|
25264
|
-
query = _ref5.query,
|
|
25265
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref5, _excluded4);
|
|
25054
|
+
var query = extractQueryFromCustomQuery$6(this.$customQuery);
|
|
25055
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$customQuery);
|
|
25266
25056
|
|
|
25267
25057
|
if (queryOptions) {
|
|
25268
25058
|
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
@@ -25270,15 +25060,9 @@
|
|
|
25270
25060
|
|
|
25271
25061
|
|
|
25272
25062
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
25273
|
-
var queryToSet = query || null;
|
|
25274
|
-
|
|
25275
|
-
if (this.$customQuery && this.$customQuery.id) {
|
|
25276
|
-
queryToSet = this.$customQuery;
|
|
25277
|
-
}
|
|
25278
|
-
|
|
25279
25063
|
this.updateQuery({
|
|
25280
25064
|
componentId: componentId,
|
|
25281
|
-
query:
|
|
25065
|
+
query: query
|
|
25282
25066
|
});
|
|
25283
25067
|
}
|
|
25284
25068
|
}
|
|
@@ -25358,6 +25142,10 @@
|
|
|
25358
25142
|
}
|
|
25359
25143
|
};
|
|
25360
25144
|
|
|
25145
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
25146
|
+
return !!props.defaultQuery;
|
|
25147
|
+
};
|
|
25148
|
+
|
|
25361
25149
|
var mapStateToProps$a = function mapStateToProps(state, props) {
|
|
25362
25150
|
return {
|
|
25363
25151
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
@@ -25407,6 +25195,7 @@
|
|
|
25407
25195
|
showClearAll: VueTypes.bool.def(true),
|
|
25408
25196
|
title: types.title,
|
|
25409
25197
|
resetToDefault: VueTypes.bool.def(false),
|
|
25198
|
+
clearAllBlacklistComponents: VueTypes.array,
|
|
25410
25199
|
resetToValues: VueTypes.object
|
|
25411
25200
|
},
|
|
25412
25201
|
inject: {
|
|
@@ -25461,12 +25250,13 @@
|
|
|
25461
25250
|
},
|
|
25462
25251
|
clearValues: function clearValues() {
|
|
25463
25252
|
var resetToDefault = this.resetToDefault,
|
|
25464
|
-
resetToValues = this.resetToValues
|
|
25253
|
+
resetToValues = this.resetToValues,
|
|
25254
|
+
clearAllBlacklistComponents = this.clearAllBlacklistComponents;
|
|
25465
25255
|
|
|
25466
25256
|
if (resetToDefault) {
|
|
25467
|
-
this.resetValuesToDefault();
|
|
25257
|
+
this.resetValuesToDefault(clearAllBlacklistComponents);
|
|
25468
25258
|
} else {
|
|
25469
|
-
this.clearValuesAction(resetToValues);
|
|
25259
|
+
this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
|
|
25470
25260
|
}
|
|
25471
25261
|
|
|
25472
25262
|
this.$emit('clear', resetToValues);
|
|
@@ -25564,7 +25354,7 @@
|
|
|
25564
25354
|
var isEqual$c = lib_8.isEqual,
|
|
25565
25355
|
checkValueChange$7 = lib_8.checkValueChange,
|
|
25566
25356
|
getClassName$c = lib_8.getClassName,
|
|
25567
|
-
getOptionsFromQuery$
|
|
25357
|
+
getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
|
|
25568
25358
|
var SingleRange = {
|
|
25569
25359
|
name: 'SingleRange',
|
|
25570
25360
|
data: function data() {
|
|
@@ -25694,17 +25484,16 @@
|
|
|
25694
25484
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
25695
25485
|
var customQuery = props.customQuery;
|
|
25696
25486
|
var query = SingleRange.defaultQuery(value, props);
|
|
25697
|
-
var customQueryOptions;
|
|
25698
25487
|
|
|
25699
25488
|
if (customQuery) {
|
|
25700
25489
|
var _ref = customQuery(value, props) || {};
|
|
25701
25490
|
|
|
25702
25491
|
query = _ref.query;
|
|
25703
|
-
customQueryOptions = getOptionsFromQuery$
|
|
25492
|
+
var customQueryOptions = getOptionsFromQuery$1(customQuery(value, props));
|
|
25704
25493
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
25494
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
25705
25495
|
}
|
|
25706
25496
|
|
|
25707
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
25708
25497
|
this.updateQuery({
|
|
25709
25498
|
componentId: props.componentId,
|
|
25710
25499
|
query: query,
|
|
@@ -25792,7 +25581,7 @@
|
|
|
25792
25581
|
var isEqual$d = lib_8.isEqual,
|
|
25793
25582
|
checkValueChange$8 = lib_8.checkValueChange,
|
|
25794
25583
|
getClassName$d = lib_8.getClassName,
|
|
25795
|
-
getOptionsFromQuery$
|
|
25584
|
+
getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
|
|
25796
25585
|
var MultiRange = {
|
|
25797
25586
|
name: 'MultiRange',
|
|
25798
25587
|
data: function data() {
|
|
@@ -25903,17 +25692,16 @@
|
|
|
25903
25692
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
25904
25693
|
var customQuery = props.customQuery;
|
|
25905
25694
|
var query = MultiRange.defaultQuery(value, props);
|
|
25906
|
-
var customQueryOptions;
|
|
25907
25695
|
|
|
25908
25696
|
if (customQuery) {
|
|
25909
25697
|
var _ref = customQuery(value, props) || {};
|
|
25910
25698
|
|
|
25911
25699
|
query = _ref.query;
|
|
25912
|
-
customQueryOptions = getOptionsFromQuery$
|
|
25700
|
+
var customQueryOptions = getOptionsFromQuery$2(customQuery(value, props));
|
|
25913
25701
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
25702
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
25914
25703
|
}
|
|
25915
25704
|
|
|
25916
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
25917
25705
|
this.updateQuery({
|
|
25918
25706
|
componentId: props.componentId,
|
|
25919
25707
|
query: query,
|
|
@@ -26404,7 +26192,7 @@
|
|
|
26404
26192
|
setCustomQuery$a = lib_5.setCustomQuery;
|
|
26405
26193
|
var checkValueChange$9 = lib_8.checkValueChange,
|
|
26406
26194
|
getClassName$e = lib_8.getClassName,
|
|
26407
|
-
getOptionsFromQuery$
|
|
26195
|
+
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
|
|
26408
26196
|
isEqual$e = lib_8.isEqual;
|
|
26409
26197
|
var RangeSlider = {
|
|
26410
26198
|
name: 'RangeSlider',
|
|
@@ -26494,14 +26282,14 @@
|
|
|
26494
26282
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
26495
26283
|
var customQuery = props.customQuery;
|
|
26496
26284
|
var query = RangeSlider.defaultQuery(value, props);
|
|
26497
|
-
var customQueryOptions;
|
|
26498
26285
|
|
|
26499
26286
|
if (customQuery) {
|
|
26500
26287
|
var _ref = customQuery(value, props) || {};
|
|
26501
26288
|
|
|
26502
26289
|
query = _ref.query;
|
|
26503
|
-
customQueryOptions = getOptionsFromQuery$
|
|
26290
|
+
var customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
|
|
26504
26291
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
26292
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
26505
26293
|
}
|
|
26506
26294
|
|
|
26507
26295
|
var showFilter = props.showFilter,
|
|
@@ -26512,7 +26300,6 @@
|
|
|
26512
26300
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
26513
26301
|
|
|
26514
26302
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
26515
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
26516
26303
|
this.updateQuery({
|
|
26517
26304
|
componentId: props.componentId,
|
|
26518
26305
|
query: query,
|
|
@@ -26686,9 +26473,10 @@
|
|
|
26686
26473
|
updateComponentProps$2 = lib_5.updateComponentProps;
|
|
26687
26474
|
var checkValueChange$a = lib_8.checkValueChange,
|
|
26688
26475
|
getClassName$f = lib_8.getClassName,
|
|
26689
|
-
getOptionsFromQuery$b = lib_8.getOptionsFromQuery,
|
|
26690
26476
|
isEqual$f = lib_8.isEqual,
|
|
26691
|
-
checkSomePropChange$1 = lib_8.checkSomePropChange
|
|
26477
|
+
checkSomePropChange$1 = lib_8.checkSomePropChange,
|
|
26478
|
+
extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
|
|
26479
|
+
getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
|
|
26692
26480
|
var DynamicRangeSlider = {
|
|
26693
26481
|
name: 'DynamicRangeSlider',
|
|
26694
26482
|
components: getComponents(),
|
|
@@ -26896,28 +26684,31 @@
|
|
|
26896
26684
|
},
|
|
26897
26685
|
updateQueryHandler: function updateQueryHandler(value) {
|
|
26898
26686
|
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
26899
|
-
var customQueryOptions;
|
|
26900
26687
|
|
|
26901
26688
|
if (this.$props.customQuery) {
|
|
26902
|
-
var
|
|
26689
|
+
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
26690
|
+
var queryTobeSet = extractQueryFromCustomQuery$7(customQueryTobeSet);
|
|
26691
|
+
|
|
26692
|
+
if (queryTobeSet) {
|
|
26693
|
+
query = queryTobeSet;
|
|
26694
|
+
}
|
|
26903
26695
|
|
|
26904
|
-
|
|
26905
|
-
customQueryOptions = getOptionsFromQuery$b(this.$props.customQuery(value, this.$props));
|
|
26696
|
+
var customQueryOptions = getOptionsForCustomQuery$7(customQueryTobeSet);
|
|
26906
26697
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
26698
|
+
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
26907
26699
|
}
|
|
26908
26700
|
|
|
26909
|
-
var
|
|
26701
|
+
var _ref2 = this.range || {
|
|
26910
26702
|
start: value[0],
|
|
26911
26703
|
end: value[1]
|
|
26912
26704
|
},
|
|
26913
|
-
start =
|
|
26914
|
-
end =
|
|
26705
|
+
start = _ref2.start,
|
|
26706
|
+
end = _ref2.end;
|
|
26915
26707
|
|
|
26916
26708
|
var currentStart = value[0],
|
|
26917
26709
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
26918
26710
|
|
|
26919
26711
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
26920
|
-
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
26921
26712
|
this.updateQuery({
|
|
26922
26713
|
componentId: this.$props.componentId,
|
|
26923
26714
|
query: query,
|
|
@@ -26964,13 +26755,13 @@
|
|
|
26964
26755
|
range: function range(newValue, oldValue) {
|
|
26965
26756
|
if (isEqual$f(newValue, oldValue) || !this.currentValue) return;
|
|
26966
26757
|
|
|
26967
|
-
var
|
|
26968
|
-
currentStart =
|
|
26969
|
-
currentEnd =
|
|
26758
|
+
var _ref3 = this.currentValue || [],
|
|
26759
|
+
currentStart = _ref3[0],
|
|
26760
|
+
currentEnd = _ref3[1];
|
|
26970
26761
|
|
|
26971
|
-
var
|
|
26972
|
-
oldStart =
|
|
26973
|
-
oldEnd =
|
|
26762
|
+
var _ref4 = oldValue || {},
|
|
26763
|
+
oldStart = _ref4.start,
|
|
26764
|
+
oldEnd = _ref4.end;
|
|
26974
26765
|
|
|
26975
26766
|
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
26976
26767
|
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
@@ -27065,6 +26856,10 @@
|
|
|
27065
26856
|
return [];
|
|
27066
26857
|
};
|
|
27067
26858
|
|
|
26859
|
+
DynamicRangeSlider.hasInternalComponent = function () {
|
|
26860
|
+
return true;
|
|
26861
|
+
};
|
|
26862
|
+
|
|
27068
26863
|
var mapStateToProps$f = function mapStateToProps(state, props) {
|
|
27069
26864
|
var componentId = state.aggregations[props.componentId];
|
|
27070
26865
|
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
@@ -27290,10 +27085,10 @@
|
|
|
27290
27085
|
Vue.component(StateProvider.name, StateProviderConnected);
|
|
27291
27086
|
};
|
|
27292
27087
|
|
|
27293
|
-
var _excluded$5 = ["aggs", "size"]
|
|
27088
|
+
var _excluded$5 = ["aggs", "size"],
|
|
27089
|
+
_excluded2 = ["query"],
|
|
27090
|
+
_excluded3 = ["query"];
|
|
27294
27091
|
var X_SEARCH_CLIENT$1 = 'ReactiveSearch Vue';
|
|
27295
|
-
var componentsWithHighlightQuery = [constants_1$1.dataSearch, constants_1$1.categorySearch];
|
|
27296
|
-
var componentsWithOptions = [constants_1$1.reactiveList, constants_1$1.reactiveMap, constants_1$1.singleList, constants_1$1.multiList, constants_1$1.tagCloud].concat(componentsWithHighlightQuery);
|
|
27297
27092
|
var componentsWithoutFilters = [constants_1$1.numberBox, constants_1$1.ratingsFilter];
|
|
27298
27093
|
var resultComponents = [constants_1$1.reactiveList, constants_1$1.reactiveMap];
|
|
27299
27094
|
|
|
@@ -27327,23 +27122,40 @@
|
|
|
27327
27122
|
}
|
|
27328
27123
|
|
|
27329
27124
|
return value;
|
|
27330
|
-
}
|
|
27125
|
+
} // Returns query DSL with query property and other options
|
|
27126
|
+
|
|
27331
27127
|
|
|
27332
|
-
function
|
|
27333
|
-
// get default query of
|
|
27334
|
-
|
|
27335
|
-
|
|
27336
|
-
|
|
27128
|
+
function getDefaultQuery(component, value) {
|
|
27129
|
+
// get custom or default query of sensor components
|
|
27130
|
+
var currentValue = parseValue(value, component); // get default query of result components
|
|
27131
|
+
|
|
27132
|
+
if (component.defaultQuery) {
|
|
27133
|
+
var defaultQuery = component.defaultQuery(currentValue, component);
|
|
27134
|
+
return _extends({
|
|
27135
|
+
query: helper_14(defaultQuery)
|
|
27136
|
+
}, helper_15(defaultQuery));
|
|
27137
|
+
}
|
|
27138
|
+
|
|
27139
|
+
return component.source.defaultQuery ? {
|
|
27140
|
+
query: component.source.defaultQuery(currentValue, component)
|
|
27141
|
+
} : {};
|
|
27142
|
+
} // Only results the query part
|
|
27337
27143
|
|
|
27338
27144
|
|
|
27145
|
+
function getCustomQuery(component, value) {
|
|
27146
|
+
// get custom or default query of sensor components
|
|
27339
27147
|
var currentValue = parseValue(value, component);
|
|
27340
27148
|
|
|
27341
27149
|
if (component.customQuery) {
|
|
27342
27150
|
var customQuery = component.customQuery(currentValue, component);
|
|
27343
|
-
return
|
|
27151
|
+
return _extends({
|
|
27152
|
+
query: helper_14(customQuery)
|
|
27153
|
+
}, helper_15(customQuery));
|
|
27344
27154
|
}
|
|
27345
27155
|
|
|
27346
|
-
return component.source.defaultQuery ?
|
|
27156
|
+
return component.source.defaultQuery ? {
|
|
27157
|
+
query: component.source.defaultQuery(currentValue, component)
|
|
27158
|
+
} : null;
|
|
27347
27159
|
}
|
|
27348
27160
|
|
|
27349
27161
|
function initReactivesearch(componentCollection, searchState, settings) {
|
|
@@ -27398,6 +27210,11 @@
|
|
|
27398
27210
|
}
|
|
27399
27211
|
});
|
|
27400
27212
|
var isInternalComponentPresent = false;
|
|
27213
|
+
|
|
27214
|
+
if (component.source.hasInternalComponent) {
|
|
27215
|
+
isInternalComponentPresent = component.source.hasInternalComponent(component);
|
|
27216
|
+
}
|
|
27217
|
+
|
|
27401
27218
|
var isResultComponent = resultComponents.includes(componentType);
|
|
27402
27219
|
var internalComponent = component.componentId + "__internal";
|
|
27403
27220
|
var label = component.filterLabel || component.componentId;
|
|
@@ -27429,74 +27246,66 @@
|
|
|
27429
27246
|
|
|
27430
27247
|
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
27431
27248
|
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
27432
|
-
}
|
|
27433
|
-
|
|
27434
|
-
|
|
27435
|
-
if (componentsWithOptions.includes(componentType)) {
|
|
27436
|
-
var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
|
|
27437
|
-
var highlightQuery = {};
|
|
27438
|
-
|
|
27439
|
-
if (componentsWithHighlightQuery.includes(componentType) && component.highlight) {
|
|
27440
|
-
highlightQuery = component.source.highlightQuery(component);
|
|
27441
|
-
}
|
|
27249
|
+
}
|
|
27442
27250
|
|
|
27443
|
-
|
|
27444
|
-
// eslint-disable-next-line
|
|
27445
|
-
var _ref = options || {},
|
|
27446
|
-
aggs = _ref.aggs,
|
|
27447
|
-
size = _ref.size,
|
|
27448
|
-
otherQueryOptions = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
27251
|
+
var componentQueryOptions = {}; // [2] set query options - main component query (valid for result components)
|
|
27449
27252
|
|
|
27450
|
-
|
|
27451
|
-
|
|
27452
|
-
|
|
27253
|
+
if (component && component.source.generateQueryOptions) {
|
|
27254
|
+
componentQueryOptions = _extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
|
|
27255
|
+
}
|
|
27453
27256
|
|
|
27454
|
-
|
|
27455
|
-
type: 'SET_QUERY_OPTIONS',
|
|
27456
|
-
component: internalComponent,
|
|
27457
|
-
options: {
|
|
27458
|
-
aggs: aggs,
|
|
27459
|
-
size: typeof size === 'undefined' ? 100 : size
|
|
27460
|
-
}
|
|
27461
|
-
});
|
|
27462
|
-
} // sort, highlight, size, from - query should be applied on the main component
|
|
27257
|
+
var highlightQuery = {};
|
|
27463
27258
|
|
|
27259
|
+
if (component.source.highlightQuery) {
|
|
27260
|
+
highlightQuery = component.source.highlightQuery(component);
|
|
27261
|
+
}
|
|
27464
27262
|
|
|
27465
|
-
|
|
27466
|
-
|
|
27467
|
-
|
|
27263
|
+
if (componentQueryOptions && Object.keys(componentQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
|
|
27264
|
+
// eslint-disable-next-line
|
|
27265
|
+
var _ref = componentQueryOptions || {},
|
|
27266
|
+
aggs = _ref.aggs,
|
|
27267
|
+
size = _ref.size,
|
|
27268
|
+
otherQueryOptions = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
27269
|
+
|
|
27270
|
+
if (aggs && Object.keys(aggs).length) {
|
|
27271
|
+
isInternalComponentPresent = true;
|
|
27272
|
+
componentQueryOptions = _extends({}, componentQueryOptions, {
|
|
27273
|
+
aggs: aggs,
|
|
27274
|
+
size: typeof size === 'undefined' ? 100 : size
|
|
27275
|
+
});
|
|
27276
|
+
} // sort, highlight, size, from - query should be applied on the main component
|
|
27468
27277
|
|
|
27469
|
-
var mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery, {
|
|
27470
|
-
size: size
|
|
27471
|
-
});
|
|
27472
27278
|
|
|
27473
|
-
|
|
27474
|
-
|
|
27475
|
-
|
|
27279
|
+
if (otherQueryOptions && Object.keys(otherQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
|
|
27280
|
+
if (!otherQueryOptions) otherQueryOptions = {};
|
|
27281
|
+
if (!highlightQuery) highlightQuery = {};
|
|
27476
27282
|
|
|
27477
|
-
|
|
27478
|
-
|
|
27283
|
+
var mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery, {
|
|
27284
|
+
size: size
|
|
27285
|
+
});
|
|
27479
27286
|
|
|
27480
|
-
|
|
27481
|
-
|
|
27482
|
-
|
|
27287
|
+
if (isInternalComponentPresent) {
|
|
27288
|
+
mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery);
|
|
27289
|
+
}
|
|
27483
27290
|
|
|
27484
|
-
|
|
27485
|
-
|
|
27291
|
+
if (isResultComponent) {
|
|
27292
|
+
var currentPage = component.currentPage ? component.currentPage - 1 : 0;
|
|
27486
27293
|
|
|
27487
|
-
|
|
27488
|
-
|
|
27489
|
-
size: resultSize,
|
|
27490
|
-
from: from
|
|
27491
|
-
});
|
|
27294
|
+
if (selectedValues[component.componentId] && selectedValues[component.componentId].value) {
|
|
27295
|
+
currentPage = selectedValues[component.componentId].value - 1 || 0;
|
|
27492
27296
|
}
|
|
27493
27297
|
|
|
27494
|
-
|
|
27495
|
-
|
|
27496
|
-
|
|
27497
|
-
|
|
27298
|
+
var resultSize = component.size || 10;
|
|
27299
|
+
var from = currentPage * resultSize; // Update props for RS API
|
|
27300
|
+
|
|
27301
|
+
compProps.from = from;
|
|
27302
|
+
mainQueryOptions = _extends({}, mainQueryOptions, highlightQuery, {
|
|
27303
|
+
size: resultSize,
|
|
27304
|
+
from: from
|
|
27498
27305
|
});
|
|
27499
27306
|
}
|
|
27307
|
+
|
|
27308
|
+
componentQueryOptions = _extends({}, componentQueryOptions, mainQueryOptions);
|
|
27500
27309
|
}
|
|
27501
27310
|
} // [3] set dependency tree
|
|
27502
27311
|
|
|
@@ -27505,7 +27314,7 @@
|
|
|
27505
27314
|
var react = component.react;
|
|
27506
27315
|
|
|
27507
27316
|
if (isInternalComponentPresent || isResultComponent) {
|
|
27508
|
-
react =
|
|
27317
|
+
react = helper_30(react, internalComponent);
|
|
27509
27318
|
}
|
|
27510
27319
|
|
|
27511
27320
|
dependencyTree = dependencyTreeReducer(dependencyTree, {
|
|
@@ -27514,25 +27323,42 @@
|
|
|
27514
27323
|
react: react
|
|
27515
27324
|
});
|
|
27516
27325
|
} // [4] set query list
|
|
27326
|
+
// Do not set default query for suggestions
|
|
27517
27327
|
|
|
27518
27328
|
|
|
27519
|
-
if (
|
|
27520
|
-
var
|
|
27521
|
-
|
|
27329
|
+
if (isInternalComponentPresent && !transform_7(component.componentType)) {
|
|
27330
|
+
var _ref2 = getDefaultQuery(component, value) || {},
|
|
27331
|
+
defaultQuery = _ref2.query,
|
|
27332
|
+
defaultQueryOptions = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
27522
27333
|
|
|
27523
27334
|
queryList = queryReducer(queryList, {
|
|
27524
27335
|
type: 'SET_QUERY',
|
|
27525
27336
|
component: internalComponent,
|
|
27526
|
-
query:
|
|
27337
|
+
query: defaultQuery
|
|
27527
27338
|
});
|
|
27528
|
-
|
|
27529
|
-
|
|
27530
|
-
|
|
27531
|
-
|
|
27532
|
-
query: getQuery(component, value, componentType)
|
|
27339
|
+
queryOptions = queryOptionsReducer(queryOptions, {
|
|
27340
|
+
type: 'SET_QUERY_OPTIONS',
|
|
27341
|
+
component: internalComponent,
|
|
27342
|
+
options: _extends({}, componentQueryOptions, defaultQueryOptions)
|
|
27533
27343
|
});
|
|
27534
|
-
}
|
|
27344
|
+
}
|
|
27345
|
+
|
|
27346
|
+
var _ref3 = getCustomQuery(component, value) || {},
|
|
27347
|
+
query = _ref3.query,
|
|
27348
|
+
options = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
27535
27349
|
|
|
27350
|
+
var customQuery = query; // set custom query for main component
|
|
27351
|
+
|
|
27352
|
+
queryList = queryReducer(queryList, {
|
|
27353
|
+
type: 'SET_QUERY',
|
|
27354
|
+
component: component.componentId,
|
|
27355
|
+
query: customQuery
|
|
27356
|
+
});
|
|
27357
|
+
queryOptions = queryOptionsReducer(queryOptions, {
|
|
27358
|
+
type: 'SET_QUERY_OPTIONS',
|
|
27359
|
+
component: component.componentId,
|
|
27360
|
+
options: _extends({}, options)
|
|
27361
|
+
}); // Set component type in component props
|
|
27536
27362
|
|
|
27537
27363
|
compProps.componentType = componentType;
|
|
27538
27364
|
componentProps[component.componentId] = compProps;
|
|
@@ -27551,13 +27377,14 @@
|
|
|
27551
27377
|
|
|
27552
27378
|
componentCollection.forEach(function (component) {
|
|
27553
27379
|
// eslint-disable-next-line
|
|
27554
|
-
var _buildQuery =
|
|
27380
|
+
var _buildQuery = helper_29(component.componentId, dependencyTree, queryList, queryOptions),
|
|
27555
27381
|
queryObj = _buildQuery.queryObj,
|
|
27556
27382
|
options = _buildQuery.options;
|
|
27557
27383
|
|
|
27558
|
-
var
|
|
27384
|
+
var componentQueryOptions = options;
|
|
27385
|
+
var validOptions = ['aggs', 'from', 'sort']; // check if query or componentQueryOptions are valid - non-empty
|
|
27559
27386
|
|
|
27560
|
-
if (queryObj && !!Object.keys(queryObj).length ||
|
|
27387
|
+
if (queryObj && !!Object.keys(queryObj).length || componentQueryOptions && Object.keys(componentQueryOptions).some(function (item) {
|
|
27561
27388
|
return validOptions.includes(item);
|
|
27562
27389
|
})) {
|
|
27563
27390
|
var _extends2;
|
|
@@ -27572,7 +27399,7 @@
|
|
|
27572
27399
|
|
|
27573
27400
|
var currentQuery = _extends({
|
|
27574
27401
|
query: _extends({}, queryObj)
|
|
27575
|
-
},
|
|
27402
|
+
}, componentQueryOptions, queryOptions[component.componentId]);
|
|
27576
27403
|
|
|
27577
27404
|
queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
|
|
27578
27405
|
|
|
@@ -27760,7 +27587,7 @@
|
|
|
27760
27587
|
});
|
|
27761
27588
|
}
|
|
27762
27589
|
|
|
27763
|
-
var version = "1.
|
|
27590
|
+
var version = "1.29.0-preview.1";
|
|
27764
27591
|
|
|
27765
27592
|
var _templateObject$o, _templateObject2$a;
|
|
27766
27593
|
|