@appbaseio/reactivesearch-vue 1.34.0-alpha.1 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +1175 -1297
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -11
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{ComponentWrapper-9318cece.js → ComponentWrapper-94c50228.js} +16 -7
- package/dist/cjs/DataSearch.js +1310 -17
- package/dist/cjs/{DropDown-8984b544.js → DropDown-7a52c661.js} +2 -2
- package/dist/cjs/DynamicRangeSlider.js +12 -8
- package/dist/cjs/MultiDropdownList.js +11 -8
- package/dist/cjs/MultiList.js +10 -8
- package/dist/cjs/MultiRange.js +7 -4
- package/dist/cjs/{Pagination-07f4dbad.js → Pagination-e56a5b79.js} +1 -1
- package/dist/cjs/{PreferencesConsumer-5d67b486.js → PreferencesConsumer-5e6e84a2.js} +1 -1
- package/dist/cjs/RangeInput.js +4 -4
- package/dist/cjs/RangeSlider.js +7 -4
- package/dist/cjs/ReactiveBase.js +10 -6
- package/dist/cjs/ReactiveComponent.js +316 -45
- package/dist/cjs/{ReactiveComponent-0a354ed7.js → ReactiveComponentPrivate-244c6055.js} +32 -318
- package/dist/cjs/ReactiveComponentPrivate.js +55 -0
- package/dist/cjs/ReactiveGoogleMap.js +139 -108
- package/dist/cjs/ReactiveList.js +17 -6
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +2 -2
- package/dist/cjs/SingleDropdownList.js +10 -8
- package/dist/cjs/SingleList.js +10 -8
- package/dist/cjs/SingleRange.js +7 -4
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/Tags-4ec43831.js +883 -0
- package/dist/cjs/ToggleButton.js +6 -4
- package/dist/cjs/{index-30126fd0.js → index-de136c17.js} +2 -0
- package/dist/cjs/index.js +14 -11
- package/dist/cjs/initReactivesearch.js +0 -3
- package/dist/cjs/install.js +11 -9
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-7cfc2f98.js → vueTypes-b7007f5f.js} +2 -1
- package/dist/es/{ComponentWrapper-240450cc.js → ComponentWrapper-edaeaceb.js} +16 -7
- package/dist/es/DataSearch.js +1310 -15
- package/dist/es/{DropDown-28ddce07.js → DropDown-2c0dd714.js} +2 -2
- package/dist/es/DynamicRangeSlider.js +12 -8
- package/dist/es/MultiDropdownList.js +11 -8
- package/dist/es/MultiList.js +10 -8
- package/dist/es/MultiRange.js +7 -4
- package/dist/es/{Pagination-28e56c5c.js → Pagination-edeb7dbe.js} +1 -1
- package/dist/es/{PreferencesConsumer-bc097ebb.js → PreferencesConsumer-86a676c8.js} +1 -1
- package/dist/es/RangeInput.js +4 -4
- package/dist/es/RangeSlider.js +7 -4
- package/dist/es/ReactiveBase.js +10 -6
- package/dist/es/ReactiveComponent.js +316 -44
- package/dist/es/{ReactiveComponent-9352370c.js → ReactiveComponentPrivate-6f16e1b7.js} +19 -305
- package/dist/es/ReactiveComponentPrivate.js +47 -0
- package/dist/es/ReactiveGoogleMap.js +139 -108
- package/dist/es/ReactiveList.js +17 -6
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +2 -2
- package/dist/es/SingleDropdownList.js +10 -8
- package/dist/es/SingleList.js +10 -8
- package/dist/es/SingleRange.js +7 -4
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/Tags-1c2d6c4d.js +869 -0
- package/dist/es/ToggleButton.js +6 -4
- package/dist/es/{index-0444a498.js → index-5509c0bc.js} +2 -0
- package/dist/es/index.js +10 -8
- package/dist/es/initReactivesearch.js +0 -3
- package/dist/es/install.js +11 -9
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-8986b709.js → vueTypes-66ebc93e.js} +2 -1
- package/package.json +87 -87
- package/dist/cjs/DataSearch-8ea2651a.js +0 -2175
- package/dist/es/DataSearch-dcaa106b.js +0 -2159
|
@@ -771,6 +771,8 @@
|
|
|
771
771
|
var SET_GOOGLE_MAP_SCRIPT_LOADING = exports.SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING';
|
|
772
772
|
var SET_GOOGLE_MAP_SCRIPT_LOADED = exports.SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED';
|
|
773
773
|
var SET_GOOGLE_MAP_SCRIPT_ERROR = exports.SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR';
|
|
774
|
+
var SET_REGISTERED_COMPONENT_TIMESTAMP = exports.SET_REGISTERED_COMPONENT_TIMESTAMP = 'SET_REGISTERED_COMPONENT_TIMESTAMP';
|
|
775
|
+
var REMOVE_REGISTERED_COMPONENT_TIMESTAMP = exports.REMOVE_REGISTERED_COMPONENT_TIMESTAMP = 'REMOVE_REGISTERED_COMPONENT_TIMESTAMP';
|
|
774
776
|
});
|
|
775
777
|
unwrapExports(constants);
|
|
776
778
|
var constants_1 = constants.ADD_COMPONENT;
|
|
@@ -826,6 +828,8 @@
|
|
|
826
828
|
var constants_51 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
|
|
827
829
|
var constants_52 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
|
|
828
830
|
var constants_53 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
|
|
831
|
+
var constants_54 = constants.SET_REGISTERED_COMPONENT_TIMESTAMP;
|
|
832
|
+
var constants_55 = constants.REMOVE_REGISTERED_COMPONENT_TIMESTAMP;
|
|
829
833
|
|
|
830
834
|
var componentsReducer_1 = createCommonjsModule(function (module, exports) {
|
|
831
835
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2881,6 +2885,59 @@
|
|
|
2881
2885
|
});
|
|
2882
2886
|
unwrapExports(analyticsRefReducer_1);
|
|
2883
2887
|
|
|
2888
|
+
var registeredComponentReducer = createCommonjsModule(function (module, exports) {
|
|
2889
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2890
|
+
value: true
|
|
2891
|
+
});
|
|
2892
|
+
var _extends = Object.assign || function (target) {
|
|
2893
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2894
|
+
var source = arguments[i];
|
|
2895
|
+
for (var key in source) {
|
|
2896
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2897
|
+
target[key] = source[key];
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
return target;
|
|
2902
|
+
};
|
|
2903
|
+
exports["default"] = timestampReducer;
|
|
2904
|
+
function _objectWithoutProperties(obj, keys) {
|
|
2905
|
+
var target = {};
|
|
2906
|
+
for (var i in obj) {
|
|
2907
|
+
if (keys.indexOf(i) >= 0) continue;
|
|
2908
|
+
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
|
2909
|
+
target[i] = obj[i];
|
|
2910
|
+
}
|
|
2911
|
+
return target;
|
|
2912
|
+
}
|
|
2913
|
+
function _defineProperty(obj, key, value) {
|
|
2914
|
+
if (key in obj) {
|
|
2915
|
+
Object.defineProperty(obj, key, {
|
|
2916
|
+
value: value,
|
|
2917
|
+
enumerable: true,
|
|
2918
|
+
configurable: true,
|
|
2919
|
+
writable: true
|
|
2920
|
+
});
|
|
2921
|
+
} else {
|
|
2922
|
+
obj[key] = value;
|
|
2923
|
+
}
|
|
2924
|
+
return obj;
|
|
2925
|
+
}
|
|
2926
|
+
function timestampReducer() {
|
|
2927
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2928
|
+
var action = arguments[1];
|
|
2929
|
+
if (action.type === constants.SET_REGISTERED_COMPONENT_TIMESTAMP) {
|
|
2930
|
+
return _extends({}, state, _defineProperty({}, action.component, action.timestamp));
|
|
2931
|
+
} else if (action.type === constants.REMOVE_REGISTERED_COMPONENT_TIMESTAMP) {
|
|
2932
|
+
var del = state[action.component],
|
|
2933
|
+
obj = _objectWithoutProperties(state, [action.component]);
|
|
2934
|
+
return obj;
|
|
2935
|
+
}
|
|
2936
|
+
return state;
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
unwrapExports(registeredComponentReducer);
|
|
2940
|
+
|
|
2884
2941
|
var reducers = createCommonjsModule(function (module, exports) {
|
|
2885
2942
|
Object.defineProperty(exports, "__esModule", {
|
|
2886
2943
|
value: true
|
|
@@ -2921,6 +2978,7 @@
|
|
|
2921
2978
|
var _recentSearches2 = _interopRequireDefault(recentSearches);
|
|
2922
2979
|
var _googleMapScriptReducer2 = _interopRequireDefault(googleMapScriptReducer_1);
|
|
2923
2980
|
var _analyticsRefReducer2 = _interopRequireDefault(analyticsRefReducer_1);
|
|
2981
|
+
var _registeredComponentReducer2 = _interopRequireDefault(registeredComponentReducer);
|
|
2924
2982
|
function _interopRequireDefault(obj) {
|
|
2925
2983
|
return obj && obj.__esModule ? obj : {
|
|
2926
2984
|
"default": obj
|
|
@@ -2966,7 +3024,8 @@
|
|
|
2966
3024
|
return state;
|
|
2967
3025
|
},
|
|
2968
3026
|
googleMapScriptStatus: _googleMapScriptReducer2["default"],
|
|
2969
|
-
lastUsedAppbaseQuery: _appbaseQueryReducer2["default"]
|
|
3027
|
+
lastUsedAppbaseQuery: _appbaseQueryReducer2["default"],
|
|
3028
|
+
registeredComponentsTimestamps: _registeredComponentReducer2["default"]
|
|
2970
3029
|
});
|
|
2971
3030
|
});
|
|
2972
3031
|
unwrapExports(reducers);
|
|
@@ -2976,13 +3035,13 @@
|
|
|
2976
3035
|
value: true
|
|
2977
3036
|
});
|
|
2978
3037
|
var dateFormats = {
|
|
2979
|
-
date: '
|
|
2980
|
-
basic_date: '
|
|
2981
|
-
basic_date_time:
|
|
2982
|
-
basic_date_time_no_millis:
|
|
2983
|
-
date_time_no_millis:
|
|
2984
|
-
basic_time: 'HHmmss.
|
|
2985
|
-
basic_time_no_millis: '
|
|
3038
|
+
date: 'YYYY-MM-DD',
|
|
3039
|
+
basic_date: 'YYYYMMDD',
|
|
3040
|
+
basic_date_time: 'YYYYMMDD[T]HHmmss.SSSZ',
|
|
3041
|
+
basic_date_time_no_millis: 'YYYYMMDD[T]HHmmssZ',
|
|
3042
|
+
date_time_no_millis: 'YYYY-MM-DD[T]HH:mm:ssZ',
|
|
3043
|
+
basic_time: 'HHmmss.SSSZ',
|
|
3044
|
+
basic_time_no_millis: 'HHmmssZ',
|
|
2986
3045
|
epoch_millis: 'epoch_millis',
|
|
2987
3046
|
epoch_second: 'epoch_second'
|
|
2988
3047
|
};
|
|
@@ -4512,6 +4571,7 @@
|
|
|
4512
4571
|
exports.checkValueChange = checkValueChange;
|
|
4513
4572
|
exports.getAggsOrder = getAggsOrder;
|
|
4514
4573
|
exports.formatDate = formatDate;
|
|
4574
|
+
exports.unwrapToNativeDate = unwrapToNativeDate;
|
|
4515
4575
|
exports.getResultStats = getResultStats;
|
|
4516
4576
|
exports.extractFieldsFromSource = extractFieldsFromSource;
|
|
4517
4577
|
exports.normalizeDataField = normalizeDataField;
|
|
@@ -4842,18 +4902,24 @@
|
|
|
4842
4902
|
}
|
|
4843
4903
|
switch (props.queryFormat) {
|
|
4844
4904
|
case 'epoch_millis':
|
|
4845
|
-
return date.
|
|
4905
|
+
return date.valueOf();
|
|
4846
4906
|
case 'epoch_second':
|
|
4847
|
-
return Math.floor(date.
|
|
4907
|
+
return Math.floor(date.valueOf() / 1000);
|
|
4848
4908
|
default:
|
|
4849
4909
|
{
|
|
4850
4910
|
if (_dateFormats2["default"][props.queryFormat]) {
|
|
4851
|
-
return date.
|
|
4911
|
+
return date.format(_dateFormats2["default"][props.queryFormat]);
|
|
4852
4912
|
}
|
|
4853
|
-
return date.
|
|
4913
|
+
return date.valueOf();
|
|
4854
4914
|
}
|
|
4855
4915
|
}
|
|
4856
4916
|
}
|
|
4917
|
+
function unwrapToNativeDate(wrappedDateInstance) {
|
|
4918
|
+
if (wrappedDateInstance) {
|
|
4919
|
+
return new Date(wrappedDateInstance.valueOf());
|
|
4920
|
+
}
|
|
4921
|
+
return wrappedDateInstance;
|
|
4922
|
+
}
|
|
4857
4923
|
var getOptionsFromQuery = function getOptionsFromQuery() {
|
|
4858
4924
|
var customQuery = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4859
4925
|
if (customQuery) {
|
|
@@ -5011,13 +5077,15 @@
|
|
|
5011
5077
|
size = props.size,
|
|
5012
5078
|
sortBy = props.sortBy,
|
|
5013
5079
|
showMissing = props.showMissing,
|
|
5014
|
-
missingLabel = props.missingLabel
|
|
5080
|
+
missingLabel = props.missingLabel,
|
|
5081
|
+
aggregationSize = props.aggregationSize;
|
|
5015
5082
|
clonedQuery.size = 0;
|
|
5016
5083
|
if (typeof dataField === 'string') {
|
|
5017
5084
|
clonedQuery.aggs = _defineProperty({}, dataField, {
|
|
5018
5085
|
terms: _extends({
|
|
5019
5086
|
field: dataField,
|
|
5020
5087
|
size: size,
|
|
5088
|
+
aggregationSize: aggregationSize,
|
|
5021
5089
|
order: getAggsOrder(sortBy || 'count')
|
|
5022
5090
|
}, showMissing ? {
|
|
5023
5091
|
missing: missingLabel
|
|
@@ -5030,6 +5098,7 @@
|
|
|
5030
5098
|
terms: _extends({
|
|
5031
5099
|
field: dataFieldItem,
|
|
5032
5100
|
size: size,
|
|
5101
|
+
aggregationSize: aggregationSize,
|
|
5033
5102
|
order: getAggsOrder(sortBy || 'count')
|
|
5034
5103
|
}, showMissing ? {
|
|
5035
5104
|
missing: missingLabel
|
|
@@ -5241,7 +5310,8 @@
|
|
|
5241
5310
|
};
|
|
5242
5311
|
var featuredSuggestionsActionTypes = exports.featuredSuggestionsActionTypes = {
|
|
5243
5312
|
NAVIGATE: 'navigate',
|
|
5244
|
-
FUNCTION: 'function'
|
|
5313
|
+
FUNCTION: 'function',
|
|
5314
|
+
SELECT: 'select'
|
|
5245
5315
|
};
|
|
5246
5316
|
var queryFormatMillisecondsMap = exports.queryFormatMillisecondsMap = {
|
|
5247
5317
|
minute: 60000,
|
|
@@ -5469,708 +5539,326 @@
|
|
|
5469
5539
|
var helper_39 = helper.checkValueChange;
|
|
5470
5540
|
var helper_40 = helper.getAggsOrder;
|
|
5471
5541
|
var helper_41 = helper.formatDate;
|
|
5472
|
-
var helper_42 = helper.
|
|
5473
|
-
var helper_43 = helper.
|
|
5474
|
-
var helper_44 = helper.
|
|
5475
|
-
var helper_45 = helper.
|
|
5476
|
-
var helper_46 = helper.
|
|
5477
|
-
var helper_47 = helper.
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
var DAY = 7;
|
|
5510
|
-
/** @const */
|
|
5511
|
-
var YEAR = 8;
|
|
5512
|
-
/** @const */
|
|
5513
|
-
var DAY_MS = 86400000;
|
|
5514
|
-
var ISO_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss(.fff)";
|
|
5515
|
-
var ISO_FORMAT_STRING_TZ = ISO_FORMAT_STRING + "zzz";
|
|
5516
|
-
var methodSubjects = ['FullYear',
|
|
5517
|
-
// 0
|
|
5518
|
-
'Month',
|
|
5519
|
-
// 1
|
|
5520
|
-
'Date',
|
|
5521
|
-
// 2
|
|
5522
|
-
'Hours',
|
|
5523
|
-
// 3
|
|
5524
|
-
'Minutes',
|
|
5525
|
-
// 4
|
|
5526
|
-
'Seconds',
|
|
5527
|
-
// 5
|
|
5528
|
-
'Milliseconds',
|
|
5529
|
-
// 6
|
|
5530
|
-
'Day',
|
|
5531
|
-
// 7
|
|
5532
|
-
'Year' // 8
|
|
5533
|
-
];
|
|
5534
|
-
|
|
5535
|
-
var subjectPlurals = ['Years',
|
|
5536
|
-
// 0
|
|
5537
|
-
'Months',
|
|
5538
|
-
// 1
|
|
5539
|
-
'Days' // 2
|
|
5540
|
-
];
|
|
5541
|
-
|
|
5542
|
-
var unitsWithin = [12,
|
|
5543
|
-
// months in year
|
|
5544
|
-
31,
|
|
5545
|
-
// days in month (sort of)
|
|
5546
|
-
24,
|
|
5547
|
-
// hours in day
|
|
5548
|
-
60,
|
|
5549
|
-
// minutes in hour
|
|
5550
|
-
60,
|
|
5551
|
-
// seconds in minute
|
|
5552
|
-
1000,
|
|
5553
|
-
// milliseconds in second
|
|
5554
|
-
1 //
|
|
5555
|
-
];
|
|
5556
|
-
|
|
5557
|
-
var formatStringRE = new RegExp("(([a-zA-Z])\\2*)|" +
|
|
5558
|
-
// 1, 2
|
|
5559
|
-
"(\\(" + "(('.*?'|\\(.*?\\)|.)*?)" + "\\))|" +
|
|
5560
|
-
// 3, 4, 5 (allows for 1 level of inner quotes or parens)
|
|
5561
|
-
"('(.*?)')" // 6, 7
|
|
5562
|
-
);
|
|
5563
|
-
|
|
5564
|
-
var UTC = Date.UTC;
|
|
5565
|
-
var toUTCString = Date.prototype.toUTCString;
|
|
5566
|
-
var proto = XDate.prototype;
|
|
5567
|
-
|
|
5568
|
-
// This makes an XDate look pretty in Firebug and Web Inspector.
|
|
5569
|
-
// It makes an XDate seem array-like, and displays [ <internal-date>.toString() ]
|
|
5570
|
-
proto.length = 1;
|
|
5571
|
-
proto.splice = Array.prototype.splice;
|
|
5572
|
-
|
|
5573
|
-
/* Constructor
|
|
5574
|
-
---------------------------------------------------------------------------------*/
|
|
5575
|
-
|
|
5576
|
-
// TODO: in future, I'd change signature for the constructor regarding the `true` utc-mode param. ~ashaw
|
|
5577
|
-
// I'd move the boolean to be the *first* argument. Still optional. Seems cleaner.
|
|
5578
|
-
// I'd remove it from the `xdate`, `nativeDate`, and `milliseconds` constructors.
|
|
5579
|
-
// (because you can simply call .setUTCMode(true) after)
|
|
5580
|
-
// And I'd only leave it for the y/m/d/h/m/s/m and `dateString` constructors
|
|
5581
|
-
// (because those are the only constructors that need it for DST-gap data-loss reasons)
|
|
5582
|
-
// Should do this for 1.0
|
|
5583
|
-
|
|
5584
|
-
function XDate() {
|
|
5585
|
-
return init(this instanceof XDate ? this : new XDate(), arguments);
|
|
5586
|
-
}
|
|
5587
|
-
function init(xdate, args) {
|
|
5588
|
-
var len = args.length;
|
|
5589
|
-
var utcMode;
|
|
5590
|
-
if (isBoolean(args[len - 1])) {
|
|
5591
|
-
utcMode = args[--len];
|
|
5592
|
-
args = slice(args, 0, len);
|
|
5593
|
-
}
|
|
5594
|
-
if (!len) {
|
|
5595
|
-
xdate[0] = new Date();
|
|
5596
|
-
} else if (len == 1) {
|
|
5597
|
-
var arg = args[0];
|
|
5598
|
-
if (arg instanceof Date) {
|
|
5599
|
-
xdate[0] = new Date(arg.getTime());
|
|
5600
|
-
} else if (isNumber(arg)) {
|
|
5601
|
-
xdate[0] = new Date(arg);
|
|
5602
|
-
} else if (arg instanceof XDate) {
|
|
5603
|
-
xdate[0] = _clone(arg);
|
|
5604
|
-
} else if (isString(arg)) {
|
|
5605
|
-
xdate[0] = new Date(0);
|
|
5606
|
-
xdate = parse(arg, utcMode || false, xdate);
|
|
5607
|
-
}
|
|
5608
|
-
} else {
|
|
5609
|
-
xdate[0] = new Date(UTC.apply(Date, args));
|
|
5610
|
-
if (!utcMode) {
|
|
5611
|
-
xdate[0] = coerceToLocal(xdate[0]);
|
|
5542
|
+
var helper_42 = helper.unwrapToNativeDate;
|
|
5543
|
+
var helper_43 = helper.getResultStats;
|
|
5544
|
+
var helper_44 = helper.extractFieldsFromSource;
|
|
5545
|
+
var helper_45 = helper.normalizeDataField;
|
|
5546
|
+
var helper_46 = helper.handleOnSuggestions;
|
|
5547
|
+
var helper_47 = helper.isValidDateRangeQueryFormat;
|
|
5548
|
+
var helper_48 = helper.setDeep;
|
|
5549
|
+
|
|
5550
|
+
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
5551
|
+
!function (t, e) {
|
|
5552
|
+
module.exports = e() ;
|
|
5553
|
+
}(commonjsGlobal, function () {
|
|
5554
|
+
|
|
5555
|
+
var t = 1e3,
|
|
5556
|
+
e = 6e4,
|
|
5557
|
+
n = 36e5,
|
|
5558
|
+
r = "millisecond",
|
|
5559
|
+
i = "second",
|
|
5560
|
+
s = "minute",
|
|
5561
|
+
u = "hour",
|
|
5562
|
+
a = "day",
|
|
5563
|
+
o = "week",
|
|
5564
|
+
f = "month",
|
|
5565
|
+
h = "quarter",
|
|
5566
|
+
c = "year",
|
|
5567
|
+
d = "date",
|
|
5568
|
+
l = "Invalid Date",
|
|
5569
|
+
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
5570
|
+
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
5571
|
+
M = {
|
|
5572
|
+
name: "en",
|
|
5573
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
5574
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
5575
|
+
ordinal: function ordinal(t) {
|
|
5576
|
+
var e = ["th", "st", "nd", "rd"],
|
|
5577
|
+
n = t % 100;
|
|
5578
|
+
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
|
|
5612
5579
|
}
|
|
5613
|
-
}
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
return this[0].getTimezoneOffset();
|
|
5655
|
-
}
|
|
5656
|
-
};
|
|
5657
|
-
|
|
5658
|
-
/* get / set / add / diff Methods (except for week-related)
|
|
5659
|
-
---------------------------------------------------------------------------------*/
|
|
5660
|
-
|
|
5661
|
-
each(methodSubjects, function (subject, fieldIndex) {
|
|
5662
|
-
proto['get' + subject] = function () {
|
|
5663
|
-
return _getField(this[0], getUTCMode(this), fieldIndex);
|
|
5664
|
-
};
|
|
5665
|
-
if (fieldIndex != YEAR) {
|
|
5666
|
-
// because there is no getUTCYear
|
|
5667
|
-
|
|
5668
|
-
proto['getUTC' + subject] = function () {
|
|
5669
|
-
return _getField(this[0], true, fieldIndex);
|
|
5670
|
-
};
|
|
5671
|
-
}
|
|
5672
|
-
if (fieldIndex != DAY) {
|
|
5673
|
-
// because there is no setDay or setUTCDay
|
|
5674
|
-
// and the add* and diff* methods use DATE instead
|
|
5675
|
-
|
|
5676
|
-
proto['set' + subject] = function (value) {
|
|
5677
|
-
_set(this, fieldIndex, value, arguments, getUTCMode(this));
|
|
5678
|
-
return this; // for chaining
|
|
5679
|
-
};
|
|
5680
|
-
|
|
5681
|
-
if (fieldIndex != YEAR) {
|
|
5682
|
-
// because there is no setUTCYear
|
|
5683
|
-
// and the add* and diff* methods use FULLYEAR instead
|
|
5684
|
-
|
|
5685
|
-
proto['setUTC' + subject] = function (value) {
|
|
5686
|
-
_set(this, fieldIndex, value, arguments, true);
|
|
5687
|
-
return this; // for chaining
|
|
5688
|
-
};
|
|
5689
|
-
|
|
5690
|
-
proto['add' + (subjectPlurals[fieldIndex] || subject)] = function (delta, preventOverflow) {
|
|
5691
|
-
_add(this, fieldIndex, delta, preventOverflow);
|
|
5692
|
-
return this; // for chaining
|
|
5693
|
-
};
|
|
5694
|
-
|
|
5695
|
-
proto['diff' + (subjectPlurals[fieldIndex] || subject)] = function (otherDate) {
|
|
5696
|
-
return _diff(this, otherDate, fieldIndex);
|
|
5697
|
-
};
|
|
5580
|
+
},
|
|
5581
|
+
m = function m(t, e, n) {
|
|
5582
|
+
var r = String(t);
|
|
5583
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
5584
|
+
},
|
|
5585
|
+
v = {
|
|
5586
|
+
s: m,
|
|
5587
|
+
z: function z(t) {
|
|
5588
|
+
var e = -t.utcOffset(),
|
|
5589
|
+
n = Math.abs(e),
|
|
5590
|
+
r = Math.floor(n / 60),
|
|
5591
|
+
i = n % 60;
|
|
5592
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
5593
|
+
},
|
|
5594
|
+
m: function t(e, n) {
|
|
5595
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
5596
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
5597
|
+
i = e.clone().add(r, f),
|
|
5598
|
+
s = n - i < 0,
|
|
5599
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
5600
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
5601
|
+
},
|
|
5602
|
+
a: function a(t) {
|
|
5603
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
5604
|
+
},
|
|
5605
|
+
p: function p(t) {
|
|
5606
|
+
return {
|
|
5607
|
+
M: f,
|
|
5608
|
+
y: c,
|
|
5609
|
+
w: o,
|
|
5610
|
+
d: a,
|
|
5611
|
+
D: d,
|
|
5612
|
+
h: u,
|
|
5613
|
+
m: s,
|
|
5614
|
+
s: i,
|
|
5615
|
+
ms: r,
|
|
5616
|
+
Q: h
|
|
5617
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
5618
|
+
},
|
|
5619
|
+
u: function u(t) {
|
|
5620
|
+
return void 0 === t;
|
|
5698
5621
|
}
|
|
5699
|
-
}
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
}
|
|
5715
|
-
setField(fieldIndex, args);
|
|
5716
|
-
if (preventOverflow && getField(MONTH) != expectedMonth) {
|
|
5717
|
-
setField(MONTH, [getField(MONTH) - 1]);
|
|
5718
|
-
setField(DATE, [getDaysInMonth(getField(FULLYEAR), getField(MONTH))]);
|
|
5719
|
-
}
|
|
5720
|
-
}
|
|
5721
|
-
function _add(xdate, fieldIndex, delta, preventOverflow) {
|
|
5722
|
-
delta = Number(delta);
|
|
5723
|
-
var intDelta = Math.floor(delta);
|
|
5724
|
-
xdate['set' + methodSubjects[fieldIndex]](xdate['get' + methodSubjects[fieldIndex]]() + intDelta, preventOverflow || false);
|
|
5725
|
-
if (intDelta != delta && fieldIndex < MILLISECONDS) {
|
|
5726
|
-
_add(xdate, fieldIndex + 1, (delta - intDelta) * unitsWithin[fieldIndex], preventOverflow);
|
|
5727
|
-
}
|
|
5728
|
-
}
|
|
5729
|
-
function _diff(xdate1, xdate2, fieldIndex) {
|
|
5730
|
-
// fieldIndex=FULLYEAR is for years, fieldIndex=DATE is for days
|
|
5731
|
-
xdate1 = xdate1.clone().setUTCMode(true, true);
|
|
5732
|
-
xdate2 = XDate(xdate2).setUTCMode(true, true);
|
|
5733
|
-
var v = 0;
|
|
5734
|
-
if (fieldIndex == FULLYEAR || fieldIndex == MONTH) {
|
|
5735
|
-
for (var i = MILLISECONDS; i >= fieldIndex; i--) {
|
|
5736
|
-
v /= unitsWithin[i];
|
|
5737
|
-
v += _getField(xdate2, false, i) - _getField(xdate1, false, i);
|
|
5738
|
-
}
|
|
5739
|
-
if (fieldIndex == MONTH) {
|
|
5740
|
-
v += (xdate2.getFullYear() - xdate1.getFullYear()) * 12;
|
|
5741
|
-
}
|
|
5742
|
-
} else if (fieldIndex == DATE) {
|
|
5743
|
-
var clear1 = xdate1.toDate().setUTCHours(0, 0, 0, 0); // returns an ms value
|
|
5744
|
-
var clear2 = xdate2.toDate().setUTCHours(0, 0, 0, 0); // returns an ms value
|
|
5745
|
-
v = Math.round((clear2 - clear1) / DAY_MS) + (xdate2 - clear2 - (xdate1 - clear1)) / DAY_MS;
|
|
5746
|
-
} else {
|
|
5747
|
-
v = (xdate2 - xdate1) / [3600000,
|
|
5748
|
-
// milliseconds in hour
|
|
5749
|
-
60000,
|
|
5750
|
-
// milliseconds in minute
|
|
5751
|
-
1000,
|
|
5752
|
-
// milliseconds in second
|
|
5753
|
-
1 //
|
|
5754
|
-
][fieldIndex - 3];
|
|
5755
|
-
}
|
|
5756
|
-
return v;
|
|
5757
|
-
}
|
|
5758
|
-
|
|
5759
|
-
/* Week Methods
|
|
5760
|
-
---------------------------------------------------------------------------------*/
|
|
5761
|
-
|
|
5762
|
-
proto.getWeek = function () {
|
|
5763
|
-
return _getWeek(curry(_getField, this, false));
|
|
5764
|
-
};
|
|
5765
|
-
proto.getUTCWeek = function () {
|
|
5766
|
-
return _getWeek(curry(_getField, this, true));
|
|
5767
|
-
};
|
|
5768
|
-
proto.setWeek = function (n, year) {
|
|
5769
|
-
_setWeek(this, n, year, false);
|
|
5770
|
-
return this; // for chaining
|
|
5771
|
-
};
|
|
5772
|
-
|
|
5773
|
-
proto.setUTCWeek = function (n, year) {
|
|
5774
|
-
_setWeek(this, n, year, true);
|
|
5775
|
-
return this; // for chaining
|
|
5776
|
-
};
|
|
5777
|
-
|
|
5778
|
-
proto.addWeeks = function (delta) {
|
|
5779
|
-
return this.addDays(Number(delta) * 7);
|
|
5780
|
-
};
|
|
5781
|
-
proto.diffWeeks = function (otherDate) {
|
|
5782
|
-
return _diff(this, otherDate, DATE) / 7;
|
|
5783
|
-
};
|
|
5784
|
-
function _getWeek(getField) {
|
|
5785
|
-
return getWeek(getField(FULLYEAR), getField(MONTH), getField(DATE));
|
|
5786
|
-
}
|
|
5787
|
-
function getWeek(year, month, date) {
|
|
5788
|
-
var d = new Date(UTC(year, month, date));
|
|
5789
|
-
var week1 = getWeek1(getWeekYear(year, month, date));
|
|
5790
|
-
return Math.floor(Math.round((d - week1) / DAY_MS) / 7) + 1;
|
|
5791
|
-
}
|
|
5792
|
-
function getWeekYear(year, month, date) {
|
|
5793
|
-
// get the year that the date's week # belongs to
|
|
5794
|
-
var d = new Date(UTC(year, month, date));
|
|
5795
|
-
if (d < getWeek1(year)) {
|
|
5796
|
-
return year - 1;
|
|
5797
|
-
} else if (d >= getWeek1(year + 1)) {
|
|
5798
|
-
return year + 1;
|
|
5799
|
-
}
|
|
5800
|
-
return year;
|
|
5801
|
-
}
|
|
5802
|
-
function getWeek1(year) {
|
|
5803
|
-
// returns Date of first week of year, in UTC
|
|
5804
|
-
var d = new Date(UTC(year, 0, 4));
|
|
5805
|
-
d.setUTCDate(d.getUTCDate() - (d.getUTCDay() + 6) % 7); // make it Monday of the week
|
|
5806
|
-
return d;
|
|
5807
|
-
}
|
|
5808
|
-
function _setWeek(xdate, n, year, useUTC) {
|
|
5809
|
-
var getField = curry(_getField, xdate, useUTC);
|
|
5810
|
-
var setField = curry(_setField, xdate, useUTC);
|
|
5811
|
-
if (year === undefined$1) {
|
|
5812
|
-
year = getWeekYear(getField(FULLYEAR), getField(MONTH), getField(DATE));
|
|
5813
|
-
}
|
|
5814
|
-
var week1 = getWeek1(year);
|
|
5815
|
-
if (!useUTC) {
|
|
5816
|
-
week1 = coerceToLocal(week1);
|
|
5817
|
-
}
|
|
5818
|
-
xdate.setTime(week1.getTime());
|
|
5819
|
-
setField(DATE, [getField(DATE) + (n - 1) * 7]); // would have used xdate.addUTCWeeks :(
|
|
5820
|
-
// n-1 because n is 1-based
|
|
5821
|
-
}
|
|
5822
|
-
|
|
5823
|
-
/* Parsing
|
|
5824
|
-
---------------------------------------------------------------------------------*/
|
|
5825
|
-
|
|
5826
|
-
XDate.parsers = [parseISO];
|
|
5827
|
-
XDate.parse = function (str) {
|
|
5828
|
-
return +XDate('' + str);
|
|
5829
|
-
};
|
|
5830
|
-
function parse(str, utcMode, xdate) {
|
|
5831
|
-
var parsers = XDate.parsers;
|
|
5832
|
-
var i = 0;
|
|
5833
|
-
var res;
|
|
5834
|
-
for (; i < parsers.length; i++) {
|
|
5835
|
-
res = parsers[i](str, utcMode, xdate);
|
|
5836
|
-
if (res) {
|
|
5837
|
-
return res;
|
|
5838
|
-
}
|
|
5839
|
-
}
|
|
5840
|
-
xdate[0] = new Date(str);
|
|
5841
|
-
return xdate;
|
|
5842
|
-
}
|
|
5843
|
-
function parseISO(str, utcMode, xdate) {
|
|
5844
|
-
var m = str.match(/^(\d{4})(-(\d{2})(-(\d{2})([T ](\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/);
|
|
5845
|
-
if (m) {
|
|
5846
|
-
var d = new Date(UTC(m[1], m[3] ? m[3] - 1 : 0, m[5] || 1, m[7] || 0, m[8] || 0, m[10] || 0, m[12] ? Number('0.' + m[12]) * 1000 : 0));
|
|
5847
|
-
if (m[13]) {
|
|
5848
|
-
// has gmt offset or Z
|
|
5849
|
-
if (m[14]) {
|
|
5850
|
-
// has gmt offset
|
|
5851
|
-
d.setUTCMinutes(d.getUTCMinutes() + (m[15] == '-' ? 1 : -1) * (Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0)));
|
|
5852
|
-
}
|
|
5622
|
+
},
|
|
5623
|
+
g = "en",
|
|
5624
|
+
D = {};
|
|
5625
|
+
D[g] = M;
|
|
5626
|
+
var p = function p(t) {
|
|
5627
|
+
return t instanceof _;
|
|
5628
|
+
},
|
|
5629
|
+
S = function t(e, n, r) {
|
|
5630
|
+
var i;
|
|
5631
|
+
if (!e) return g;
|
|
5632
|
+
if ("string" == typeof e) {
|
|
5633
|
+
var s = e.toLowerCase();
|
|
5634
|
+
D[s] && (i = s), n && (D[s] = n, i = s);
|
|
5635
|
+
var u = e.split("-");
|
|
5636
|
+
if (!i && u.length > 1) return t(u[0]);
|
|
5853
5637
|
} else {
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
d = coerceToLocal(d);
|
|
5857
|
-
}
|
|
5638
|
+
var a = e.name;
|
|
5639
|
+
D[a] = e, i = a;
|
|
5858
5640
|
}
|
|
5859
|
-
return
|
|
5860
|
-
}
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
if (formatString === undefined$1 || !valid(this)) {
|
|
5875
|
-
return this[0].toUTCString();
|
|
5876
|
-
} else {
|
|
5877
|
-
return format(this, formatString, settings, uniqueness, true);
|
|
5878
|
-
}
|
|
5879
|
-
};
|
|
5880
|
-
proto.toISOString = function () {
|
|
5881
|
-
return this.toUTCString(ISO_FORMAT_STRING_TZ);
|
|
5882
|
-
};
|
|
5883
|
-
XDate.defaultLocale = '';
|
|
5884
|
-
XDate.locales = {
|
|
5885
|
-
'': {
|
|
5886
|
-
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
5887
|
-
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
5888
|
-
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
5889
|
-
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
5890
|
-
amDesignator: 'AM',
|
|
5891
|
-
pmDesignator: 'PM'
|
|
5892
|
-
}
|
|
5893
|
-
};
|
|
5894
|
-
XDate.formatters = {
|
|
5895
|
-
i: ISO_FORMAT_STRING,
|
|
5896
|
-
u: ISO_FORMAT_STRING_TZ
|
|
5641
|
+
return !r && i && (g = i), i || !r && g;
|
|
5642
|
+
},
|
|
5643
|
+
w = function w(t, e) {
|
|
5644
|
+
if (p(t)) return t.clone();
|
|
5645
|
+
var n = "object" == typeof e ? e : {};
|
|
5646
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
5647
|
+
},
|
|
5648
|
+
O = v;
|
|
5649
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
5650
|
+
return w(t, {
|
|
5651
|
+
locale: e.$L,
|
|
5652
|
+
utc: e.$u,
|
|
5653
|
+
x: e.$x,
|
|
5654
|
+
$offset: e.$offset
|
|
5655
|
+
});
|
|
5897
5656
|
};
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5657
|
+
var _ = function () {
|
|
5658
|
+
function M(t) {
|
|
5659
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
5660
|
+
}
|
|
5661
|
+
var m = M.prototype;
|
|
5662
|
+
return m.parse = function (t) {
|
|
5663
|
+
this.$d = function (t) {
|
|
5664
|
+
var e = t.date,
|
|
5665
|
+
n = t.utc;
|
|
5666
|
+
if (null === e) return new Date(NaN);
|
|
5667
|
+
if (O.u(e)) return new Date();
|
|
5668
|
+
if (e instanceof Date) return new Date(e);
|
|
5669
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
5670
|
+
var r = e.match($);
|
|
5671
|
+
if (r) {
|
|
5672
|
+
var i = r[2] - 1 || 0,
|
|
5673
|
+
s = (r[7] || "0").substring(0, 3);
|
|
5674
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
5675
|
+
}
|
|
5676
|
+
}
|
|
5677
|
+
return new Date(e);
|
|
5678
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
5679
|
+
}, m.init = function () {
|
|
5680
|
+
var t = this.$d;
|
|
5681
|
+
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
5682
|
+
}, m.$utils = function () {
|
|
5683
|
+
return O;
|
|
5684
|
+
}, m.isValid = function () {
|
|
5685
|
+
return !(this.$d.toString() === l);
|
|
5686
|
+
}, m.isSame = function (t, e) {
|
|
5687
|
+
var n = w(t);
|
|
5688
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
5689
|
+
}, m.isAfter = function (t, e) {
|
|
5690
|
+
return w(t) < this.startOf(e);
|
|
5691
|
+
}, m.isBefore = function (t, e) {
|
|
5692
|
+
return this.endOf(e) < w(t);
|
|
5693
|
+
}, m.$g = function (t, e, n) {
|
|
5694
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
5695
|
+
}, m.unix = function () {
|
|
5696
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
5697
|
+
}, m.valueOf = function () {
|
|
5698
|
+
return this.$d.getTime();
|
|
5699
|
+
}, m.startOf = function (t, e) {
|
|
5700
|
+
var n = this,
|
|
5701
|
+
r = !!O.u(e) || e,
|
|
5702
|
+
h = O.p(t),
|
|
5703
|
+
l = function l(t, e) {
|
|
5704
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
5705
|
+
return r ? i : i.endOf(a);
|
|
5706
|
+
},
|
|
5707
|
+
$ = function $(t, e) {
|
|
5708
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
5709
|
+
},
|
|
5710
|
+
y = this.$W,
|
|
5711
|
+
M = this.$M,
|
|
5712
|
+
m = this.$D,
|
|
5713
|
+
v = "set" + (this.$u ? "UTC" : "");
|
|
5714
|
+
switch (h) {
|
|
5715
|
+
case c:
|
|
5716
|
+
return r ? l(1, 0) : l(31, 11);
|
|
5717
|
+
case f:
|
|
5718
|
+
return r ? l(1, M) : l(0, M + 1);
|
|
5719
|
+
case o:
|
|
5720
|
+
var g = this.$locale().weekStart || 0,
|
|
5721
|
+
D = (y < g ? y + 7 : y) - g;
|
|
5722
|
+
return l(r ? m - D : m + (6 - D), M);
|
|
5723
|
+
case a:
|
|
5724
|
+
case d:
|
|
5725
|
+
return $(v + "Hours", 0);
|
|
5726
|
+
case u:
|
|
5727
|
+
return $(v + "Minutes", 1);
|
|
5728
|
+
case s:
|
|
5729
|
+
return $(v + "Seconds", 2);
|
|
5730
|
+
case i:
|
|
5731
|
+
return $(v + "Milliseconds", 3);
|
|
5732
|
+
default:
|
|
5733
|
+
return this.clone();
|
|
5932
5734
|
}
|
|
5933
|
-
}
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
return
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
return
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
return
|
|
6020
|
-
|
|
6021
|
-
var
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
proto.setTime = function (t) {
|
|
6054
|
-
this[0].setTime(t);
|
|
6055
|
-
return this; // for chaining
|
|
6056
|
-
};
|
|
6057
|
-
|
|
6058
|
-
proto.valid = methodize(valid);
|
|
6059
|
-
function valid(xdate) {
|
|
6060
|
-
return !isNaN(xdate[0].getTime());
|
|
6061
|
-
}
|
|
6062
|
-
proto.clone = function () {
|
|
6063
|
-
return new XDate(this);
|
|
6064
|
-
};
|
|
6065
|
-
proto.clearTime = function () {
|
|
6066
|
-
return this.setHours(0, 0, 0, 0); // will return an XDate for chaining
|
|
6067
|
-
};
|
|
6068
|
-
|
|
6069
|
-
proto.toDate = function () {
|
|
6070
|
-
return new Date(this[0].getTime());
|
|
6071
|
-
};
|
|
6072
|
-
|
|
6073
|
-
/* Misc Class Methods
|
|
6074
|
-
---------------------------------------------------------------------------------*/
|
|
6075
|
-
|
|
6076
|
-
XDate.now = function () {
|
|
6077
|
-
return new Date().getTime();
|
|
6078
|
-
};
|
|
6079
|
-
XDate.today = function () {
|
|
6080
|
-
return new XDate().clearTime();
|
|
6081
|
-
};
|
|
6082
|
-
XDate.UTC = UTC;
|
|
6083
|
-
XDate.getDaysInMonth = getDaysInMonth;
|
|
6084
|
-
|
|
6085
|
-
/* Internal Utilities
|
|
6086
|
-
---------------------------------------------------------------------------------*/
|
|
6087
|
-
|
|
6088
|
-
function _clone(xdate) {
|
|
6089
|
-
// returns the internal Date object that should be used
|
|
6090
|
-
var d = new Date(xdate[0].getTime());
|
|
6091
|
-
if (getUTCMode(xdate)) {
|
|
6092
|
-
d.toString = toUTCString;
|
|
6093
|
-
}
|
|
6094
|
-
return d;
|
|
6095
|
-
}
|
|
6096
|
-
function _getField(d, useUTC, fieldIndex) {
|
|
6097
|
-
return d['get' + (useUTC ? 'UTC' : '') + methodSubjects[fieldIndex]]();
|
|
6098
|
-
}
|
|
6099
|
-
function _setField(d, useUTC, fieldIndex, args) {
|
|
6100
|
-
d['set' + (useUTC ? 'UTC' : '') + methodSubjects[fieldIndex]].apply(d, args);
|
|
6101
|
-
}
|
|
6102
|
-
|
|
6103
|
-
/* Date Math Utilities
|
|
6104
|
-
---------------------------------------------------------------------------------*/
|
|
6105
|
-
|
|
6106
|
-
function coerceToUTC(date) {
|
|
6107
|
-
return new Date(UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
6108
|
-
}
|
|
6109
|
-
function coerceToLocal(date) {
|
|
6110
|
-
return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
|
|
6111
|
-
}
|
|
6112
|
-
function getDaysInMonth(year, month) {
|
|
6113
|
-
return 32 - new Date(UTC(year, month, 32)).getUTCDate();
|
|
6114
|
-
}
|
|
6115
|
-
|
|
6116
|
-
/* General Utilities
|
|
6117
|
-
---------------------------------------------------------------------------------*/
|
|
6118
|
-
|
|
6119
|
-
function methodize(f) {
|
|
6120
|
-
return function () {
|
|
6121
|
-
return f.apply(undefined$1, [this].concat(slice(arguments)));
|
|
6122
|
-
};
|
|
6123
|
-
}
|
|
6124
|
-
function curry(f) {
|
|
6125
|
-
var firstArgs = slice(arguments, 1);
|
|
6126
|
-
return function () {
|
|
6127
|
-
return f.apply(undefined$1, firstArgs.concat(slice(arguments)));
|
|
5735
|
+
}, m.endOf = function (t) {
|
|
5736
|
+
return this.startOf(t, !1);
|
|
5737
|
+
}, m.$set = function (t, e) {
|
|
5738
|
+
var n,
|
|
5739
|
+
o = O.p(t),
|
|
5740
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
5741
|
+
l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
|
5742
|
+
$ = o === a ? this.$D + (e - this.$W) : e;
|
|
5743
|
+
if (o === f || o === c) {
|
|
5744
|
+
var y = this.clone().set(d, 1);
|
|
5745
|
+
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
5746
|
+
} else l && this.$d[l]($);
|
|
5747
|
+
return this.init(), this;
|
|
5748
|
+
}, m.set = function (t, e) {
|
|
5749
|
+
return this.clone().$set(t, e);
|
|
5750
|
+
}, m.get = function (t) {
|
|
5751
|
+
return this[O.p(t)]();
|
|
5752
|
+
}, m.add = function (r, h) {
|
|
5753
|
+
var d,
|
|
5754
|
+
l = this;
|
|
5755
|
+
r = Number(r);
|
|
5756
|
+
var $ = O.p(h),
|
|
5757
|
+
y = function y(t) {
|
|
5758
|
+
var e = w(l);
|
|
5759
|
+
return O.w(e.date(e.date() + Math.round(t * r)), l);
|
|
5760
|
+
};
|
|
5761
|
+
if ($ === f) return this.set(f, this.$M + r);
|
|
5762
|
+
if ($ === c) return this.set(c, this.$y + r);
|
|
5763
|
+
if ($ === a) return y(1);
|
|
5764
|
+
if ($ === o) return y(7);
|
|
5765
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1,
|
|
5766
|
+
m = this.$d.getTime() + r * M;
|
|
5767
|
+
return O.w(m, this);
|
|
5768
|
+
}, m.subtract = function (t, e) {
|
|
5769
|
+
return this.add(-1 * t, e);
|
|
5770
|
+
}, m.format = function (t) {
|
|
5771
|
+
var e = this,
|
|
5772
|
+
n = this.$locale();
|
|
5773
|
+
if (!this.isValid()) return n.invalidDate || l;
|
|
5774
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
5775
|
+
i = O.z(this),
|
|
5776
|
+
s = this.$H,
|
|
5777
|
+
u = this.$m,
|
|
5778
|
+
a = this.$M,
|
|
5779
|
+
o = n.weekdays,
|
|
5780
|
+
f = n.months,
|
|
5781
|
+
h = function h(t, n, i, s) {
|
|
5782
|
+
return t && (t[n] || t(e, r)) || i[n].slice(0, s);
|
|
5783
|
+
},
|
|
5784
|
+
c = function c(t) {
|
|
5785
|
+
return O.s(s % 12 || 12, t, "0");
|
|
5786
|
+
},
|
|
5787
|
+
d = n.meridiem || function (t, e, n) {
|
|
5788
|
+
var r = t < 12 ? "AM" : "PM";
|
|
5789
|
+
return n ? r.toLowerCase() : r;
|
|
5790
|
+
},
|
|
5791
|
+
$ = {
|
|
5792
|
+
YY: String(this.$y).slice(-2),
|
|
5793
|
+
YYYY: this.$y,
|
|
5794
|
+
M: a + 1,
|
|
5795
|
+
MM: O.s(a + 1, 2, "0"),
|
|
5796
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
5797
|
+
MMMM: h(f, a),
|
|
5798
|
+
D: this.$D,
|
|
5799
|
+
DD: O.s(this.$D, 2, "0"),
|
|
5800
|
+
d: String(this.$W),
|
|
5801
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
5802
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
5803
|
+
dddd: o[this.$W],
|
|
5804
|
+
H: String(s),
|
|
5805
|
+
HH: O.s(s, 2, "0"),
|
|
5806
|
+
h: c(1),
|
|
5807
|
+
hh: c(2),
|
|
5808
|
+
a: d(s, u, !0),
|
|
5809
|
+
A: d(s, u, !1),
|
|
5810
|
+
m: String(u),
|
|
5811
|
+
mm: O.s(u, 2, "0"),
|
|
5812
|
+
s: String(this.$s),
|
|
5813
|
+
ss: O.s(this.$s, 2, "0"),
|
|
5814
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
5815
|
+
Z: i
|
|
5816
|
+
};
|
|
5817
|
+
return r.replace(y, function (t, e) {
|
|
5818
|
+
return e || $[t] || i.replace(":", "");
|
|
5819
|
+
});
|
|
5820
|
+
}, m.utcOffset = function () {
|
|
5821
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
5822
|
+
}, m.diff = function (r, d, l) {
|
|
5823
|
+
var $,
|
|
5824
|
+
y = O.p(d),
|
|
5825
|
+
M = w(r),
|
|
5826
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
5827
|
+
v = this - M,
|
|
5828
|
+
g = O.m(this, M);
|
|
5829
|
+
return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g);
|
|
5830
|
+
}, m.daysInMonth = function () {
|
|
5831
|
+
return this.endOf(f).$D;
|
|
5832
|
+
}, m.$locale = function () {
|
|
5833
|
+
return D[this.$L];
|
|
5834
|
+
}, m.locale = function (t, e) {
|
|
5835
|
+
if (!t) return this.$L;
|
|
5836
|
+
var n = this.clone(),
|
|
5837
|
+
r = S(t, e, !0);
|
|
5838
|
+
return r && (n.$L = r), n;
|
|
5839
|
+
}, m.clone = function () {
|
|
5840
|
+
return O.w(this.$d, this);
|
|
5841
|
+
}, m.toDate = function () {
|
|
5842
|
+
return new Date(this.valueOf());
|
|
5843
|
+
}, m.toJSON = function () {
|
|
5844
|
+
return this.isValid() ? this.toISOString() : null;
|
|
5845
|
+
}, m.toISOString = function () {
|
|
5846
|
+
return this.$d.toISOString();
|
|
5847
|
+
}, m.toString = function () {
|
|
5848
|
+
return this.$d.toUTCString();
|
|
5849
|
+
}, M;
|
|
5850
|
+
}(),
|
|
5851
|
+
T = _.prototype;
|
|
5852
|
+
return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
5853
|
+
T[t[1]] = function (e) {
|
|
5854
|
+
return this.$g(e, t[0], t[1]);
|
|
6128
5855
|
};
|
|
6129
|
-
}
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
function each(a, f) {
|
|
6136
|
-
for (var i = 0; i < a.length; i++) {
|
|
6137
|
-
f(a[i], i);
|
|
6138
|
-
}
|
|
6139
|
-
}
|
|
6140
|
-
function isString(arg) {
|
|
6141
|
-
return typeof arg == 'string';
|
|
6142
|
-
}
|
|
6143
|
-
function isNumber(arg) {
|
|
6144
|
-
return typeof arg == 'number';
|
|
6145
|
-
}
|
|
6146
|
-
function isBoolean(arg) {
|
|
6147
|
-
return typeof arg == 'boolean';
|
|
6148
|
-
}
|
|
6149
|
-
function isFunction(arg) {
|
|
6150
|
-
return typeof arg == 'function';
|
|
6151
|
-
}
|
|
6152
|
-
function zeroPad(n, len) {
|
|
6153
|
-
len = len || 2;
|
|
6154
|
-
n += '';
|
|
6155
|
-
while (n.length < len) {
|
|
6156
|
-
n = '0' + n;
|
|
6157
|
-
}
|
|
6158
|
-
return n;
|
|
6159
|
-
}
|
|
6160
|
-
|
|
6161
|
-
// Export for Node.js
|
|
6162
|
-
if ( module.exports) {
|
|
6163
|
-
module.exports = XDate;
|
|
6164
|
-
}
|
|
6165
|
-
|
|
6166
|
-
// AMD
|
|
6167
|
-
if (typeof undefined$1 === 'function' && undefined$1.amd) {
|
|
6168
|
-
undefined$1([], function () {
|
|
6169
|
-
return XDate;
|
|
6170
|
-
});
|
|
6171
|
-
}
|
|
6172
|
-
return XDate;
|
|
6173
|
-
}(Date, Math, Array);
|
|
5856
|
+
}), w.extend = function (t, e) {
|
|
5857
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
5858
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
5859
|
+
return w(1e3 * t);
|
|
5860
|
+
}, w.en = D[g], w.Ls = D, w.p = {}, w;
|
|
5861
|
+
});
|
|
6174
5862
|
});
|
|
6175
5863
|
|
|
6176
5864
|
var transform = createCommonjsModule(function (module, exports) {
|
|
@@ -6191,7 +5879,7 @@
|
|
|
6191
5879
|
};
|
|
6192
5880
|
var _componentToTypeMap;
|
|
6193
5881
|
exports.flatReactProp = flatReactProp;
|
|
6194
|
-
var
|
|
5882
|
+
var _dayjs2 = _interopRequireDefault(dayjs_min);
|
|
6195
5883
|
var _dateFormats2 = _interopRequireDefault(dateFormats_1);
|
|
6196
5884
|
function _interopRequireDefault(obj) {
|
|
6197
5885
|
return obj && obj.__esModule ? obj : {
|
|
@@ -6263,6 +5951,9 @@
|
|
|
6263
5951
|
var getRSQuery = exports.getRSQuery = function getRSQuery(componentId, props) {
|
|
6264
5952
|
var execute = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
6265
5953
|
if (props && componentId) {
|
|
5954
|
+
if (props.defaultQuery === null) {
|
|
5955
|
+
return null;
|
|
5956
|
+
}
|
|
6266
5957
|
var queryType = props.type ? props.type : componentToTypeMap[props.componentType];
|
|
6267
5958
|
if (!isSearchComponent(props.componentType) && !props.dataField) {
|
|
6268
5959
|
return null;
|
|
@@ -6327,7 +6018,8 @@
|
|
|
6327
6018
|
searchboxId: props.searchboxId
|
|
6328
6019
|
} : {}) : {}, {
|
|
6329
6020
|
calendarInterval: props.calendarInterval,
|
|
6330
|
-
endpoint: endpoint
|
|
6021
|
+
endpoint: endpoint,
|
|
6022
|
+
range: props.range
|
|
6331
6023
|
});
|
|
6332
6024
|
}
|
|
6333
6025
|
return null;
|
|
@@ -6358,6 +6050,7 @@
|
|
|
6358
6050
|
var aggregations = componentProps.aggregations;
|
|
6359
6051
|
var pagination = void 0;
|
|
6360
6052
|
var from = componentProps.from;
|
|
6053
|
+
var range = void 0;
|
|
6361
6054
|
if (queryType === constants$1.queryTypes.term) {
|
|
6362
6055
|
if (componentProps.showLoadMore && hasPaginationSupport(componentProps.componentType)) {
|
|
6363
6056
|
pagination = true;
|
|
@@ -6418,8 +6111,8 @@
|
|
|
6418
6111
|
if (value) {
|
|
6419
6112
|
if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
|
|
6420
6113
|
value = {
|
|
6421
|
-
start: (0, helper.formatDate)(
|
|
6422
|
-
end: (0, helper.formatDate)(
|
|
6114
|
+
start: (0, helper.formatDate)((0, _dayjs2["default"])(new Date(value.start)), componentProps),
|
|
6115
|
+
end: (0, helper.formatDate)((0, _dayjs2["default"])(new Date(value.end)), componentProps)
|
|
6423
6116
|
};
|
|
6424
6117
|
} else {
|
|
6425
6118
|
value = {
|
|
@@ -6428,26 +6121,56 @@
|
|
|
6428
6121
|
};
|
|
6429
6122
|
}
|
|
6430
6123
|
}
|
|
6124
|
+
var rangeValue = void 0;
|
|
6125
|
+
if (componentProps.componentType === constants$1.componentTypes.dynamicRangeSlider) {
|
|
6126
|
+
rangeValue = store.aggregations[component + '__range__internal'];
|
|
6127
|
+
if (componentProps.nestedField) {
|
|
6128
|
+
rangeValue = rangeValue && store.aggregations[component + '__range__internal'][componentProps.nestedField].min ? {
|
|
6129
|
+
start: store.aggregations[component + '__range__internal'][componentProps.nestedField].min.value,
|
|
6130
|
+
end: store.aggregations[component + '__range__internal'][componentProps.nestedField].max.value
|
|
6131
|
+
} : null;
|
|
6132
|
+
} else {
|
|
6133
|
+
rangeValue = rangeValue && store.aggregations[component + '__range__internal'].min && store.aggregations[component + '__range__internal'].min.value ? {
|
|
6134
|
+
start: store.aggregations[component + '__range__internal'].min.value,
|
|
6135
|
+
end: store.aggregations[component + '__range__internal'].max.value
|
|
6136
|
+
} : null;
|
|
6137
|
+
}
|
|
6138
|
+
} else {
|
|
6139
|
+
rangeValue = componentProps.range;
|
|
6140
|
+
}
|
|
6141
|
+
if (rangeValue) {
|
|
6142
|
+
if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
|
|
6143
|
+
range = {
|
|
6144
|
+
start: (0, helper.formatDate)((0, _dayjs2["default"])(rangeValue.start), componentProps),
|
|
6145
|
+
end: (0, helper.formatDate)((0, _dayjs2["default"])(rangeValue.end), componentProps)
|
|
6146
|
+
};
|
|
6147
|
+
} else {
|
|
6148
|
+
range = {
|
|
6149
|
+
start: parseFloat(rangeValue.start),
|
|
6150
|
+
end: parseFloat(rangeValue.end)
|
|
6151
|
+
};
|
|
6152
|
+
}
|
|
6153
|
+
}
|
|
6431
6154
|
}
|
|
6432
6155
|
if (dateRangeComponents.includes(componentProps.componentType)) {
|
|
6433
6156
|
if (value) {
|
|
6434
6157
|
if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
|
|
6435
6158
|
if (typeof value === 'string') {
|
|
6436
6159
|
value = {
|
|
6437
|
-
start: (0, helper.formatDate)(
|
|
6438
|
-
end: (0, helper.formatDate)(
|
|
6160
|
+
start: (0, helper.formatDate)((0, _dayjs2["default"])(value).subtract(24, 'hour'), componentProps),
|
|
6161
|
+
end: (0, helper.formatDate)((0, _dayjs2["default"])(value), componentProps)
|
|
6439
6162
|
};
|
|
6440
6163
|
} else if (Array.isArray(value)) {
|
|
6441
6164
|
value = value.map(function (val) {
|
|
6442
6165
|
return {
|
|
6443
|
-
start: (0, helper.formatDate)(
|
|
6444
|
-
end: (0, helper.formatDate)(
|
|
6166
|
+
start: (0, helper.formatDate)((0, _dayjs2["default"])(val).subtract(24, 'hour'), componentProps),
|
|
6167
|
+
end: (0, helper.formatDate)((0, _dayjs2["default"])(val), componentProps)
|
|
6445
6168
|
};
|
|
6446
6169
|
});
|
|
6447
6170
|
} else {
|
|
6448
6171
|
value = {
|
|
6449
|
-
start: (0, helper.formatDate)(
|
|
6450
|
-
end: (0, helper.formatDate)(
|
|
6172
|
+
start: (0, helper.formatDate)((0, _dayjs2["default"])(value.start).subtract(24, 'hour'), componentProps),
|
|
6173
|
+
end: (0, helper.formatDate)((0, _dayjs2["default"])(value.end), componentProps)
|
|
6451
6174
|
};
|
|
6452
6175
|
}
|
|
6453
6176
|
}
|
|
@@ -6538,6 +6261,8 @@
|
|
|
6538
6261
|
if (componentProps.componentType === constants$1.componentTypes.reactiveList) {
|
|
6539
6262
|
if (value > 0) {
|
|
6540
6263
|
from = (value - 1) * (componentProps.size || 10);
|
|
6264
|
+
} else {
|
|
6265
|
+
from = 0;
|
|
6541
6266
|
}
|
|
6542
6267
|
value = undefined;
|
|
6543
6268
|
}
|
|
@@ -6561,12 +6286,13 @@
|
|
|
6561
6286
|
interval: interval,
|
|
6562
6287
|
react: store.dependencyTree ? store.dependencyTree[component] : undefined,
|
|
6563
6288
|
customQuery: store.customQueries ? store.customQueries[component] : undefined,
|
|
6564
|
-
defaultQuery: store.defaultQueries
|
|
6289
|
+
defaultQuery: store.defaultQueries[component],
|
|
6565
6290
|
customHighlight: store.customHighlightOptions ? store.customHighlightOptions[component] : undefined,
|
|
6566
6291
|
categoryValue: store.internalValues[component] ? store.internalValues[component].category : undefined,
|
|
6567
6292
|
value: queryValue,
|
|
6568
6293
|
pagination: pagination,
|
|
6569
|
-
from: from
|
|
6294
|
+
from: from,
|
|
6295
|
+
range: range
|
|
6570
6296
|
}, customOptions);
|
|
6571
6297
|
};
|
|
6572
6298
|
function flatReactProp(reactProp, componentID) {
|
|
@@ -6728,10 +6454,10 @@
|
|
|
6728
6454
|
if (queryFormat) {
|
|
6729
6455
|
if (Array.isArray(value)) {
|
|
6730
6456
|
transformedValue = value.map(function (item) {
|
|
6731
|
-
return (0, helper.formatDate)(
|
|
6457
|
+
return (0, helper.formatDate)((0, _dayjs2["default"])(item), componentProps);
|
|
6732
6458
|
});
|
|
6733
6459
|
} else if (typeof value === 'object') {
|
|
6734
|
-
transformedValue = [(0, helper.formatDate)(
|
|
6460
|
+
transformedValue = [(0, helper.formatDate)((0, _dayjs2["default"])(value.start), componentProps), (0, helper.formatDate)((0, _dayjs2["default"])(value.end), componentProps)];
|
|
6735
6461
|
}
|
|
6736
6462
|
} else if (Array.isArray(value)) {
|
|
6737
6463
|
transformedValue = [].concat(_toConsumableArray(value));
|
|
@@ -6752,21 +6478,21 @@
|
|
|
6752
6478
|
case constants$1.componentTypes.datePicker:
|
|
6753
6479
|
transformedValue = '';
|
|
6754
6480
|
if (typeof value !== 'object') {
|
|
6755
|
-
transformedValue =
|
|
6481
|
+
transformedValue = (0, _dayjs2["default"])(value).format('YYYY-MM-DD');
|
|
6756
6482
|
} else if (value.end) {
|
|
6757
|
-
transformedValue =
|
|
6483
|
+
transformedValue = (0, _dayjs2["default"])(value.end).format('YYYY-MM-DD');
|
|
6758
6484
|
} else if (value.start) {
|
|
6759
|
-
transformedValue =
|
|
6485
|
+
transformedValue = (0, _dayjs2["default"])(value.start).add(24, 'hour').format('YYYY-MM-DD');
|
|
6760
6486
|
}
|
|
6761
6487
|
break;
|
|
6762
6488
|
case constants$1.componentTypes.dateRange:
|
|
6763
6489
|
transformedValue = [];
|
|
6764
6490
|
if (Array.isArray(value)) {
|
|
6765
6491
|
transformedValue = value.map(function (t) {
|
|
6766
|
-
return
|
|
6492
|
+
return (0, _dayjs2["default"])(t).format('YYYY-MM-DD');
|
|
6767
6493
|
});
|
|
6768
6494
|
} else if (typeof value === 'object') {
|
|
6769
|
-
transformedValue = [
|
|
6495
|
+
transformedValue = [(0, _dayjs2["default"])(value.start).format('YYYY-MM-DD'), (0, _dayjs2["default"])(value.end).format('YYYY-MM-DD')];
|
|
6770
6496
|
}
|
|
6771
6497
|
break;
|
|
6772
6498
|
case constants$1.componentTypes.categorySearch:
|
|
@@ -7534,7 +7260,7 @@
|
|
|
7534
7260
|
var componentProps = props[comp];
|
|
7535
7261
|
if (reference !== 'URL' && componentProps && [constants$1.componentTypes.reactiveList, constants$1.componentTypes.reactiveMap].includes(componentProps.componentType)) {
|
|
7536
7262
|
if (selectedValues[comp] !== null) {
|
|
7537
|
-
componentsToReset[comp] =
|
|
7263
|
+
componentsToReset[comp] = 0;
|
|
7538
7264
|
}
|
|
7539
7265
|
}
|
|
7540
7266
|
});
|
|
@@ -8452,7 +8178,8 @@
|
|
|
8452
8178
|
settings.enableQueryRules = (0, utils.isPropertyDefined)(config.analyticsConfig.enableQueryRules) ? config.analyticsConfig.enableQueryRules : undefined;
|
|
8453
8179
|
settings.customEvents = (0, utils.isPropertyDefined)(config.analyticsConfig.customEvents) ? config.analyticsConfig.customEvents : undefined;
|
|
8454
8180
|
settings.emptyQuery = (0, utils.isPropertyDefined)(config.analyticsConfig.emptyQuery) ? config.analyticsConfig.emptyQuery : undefined;
|
|
8455
|
-
|
|
8181
|
+
var searchRelevancy = config.analyticsConfig.enableSearchRelevancy;
|
|
8182
|
+
settings.enableSearchRelevancy = (0, utils.isPropertyDefined)(searchRelevancy) ? searchRelevancy : undefined;
|
|
8456
8183
|
settings.suggestionAnalytics = (0, utils.isPropertyDefined)(config.analyticsConfig.suggestionAnalytics) ? config.analyticsConfig.suggestionAnalytics : undefined;
|
|
8457
8184
|
settings.useCache = (0, utils.isPropertyDefined)(config.analyticsConfig.useCache) ? config.analyticsConfig.useCache : undefined;
|
|
8458
8185
|
settings.queryParams = (0, utils.isPropertyDefined)(config.analyticsConfig.queryParams) ? config.analyticsConfig.queryParams : undefined;
|
|
@@ -8502,8 +8229,9 @@
|
|
|
8502
8229
|
queryListener = _getState4.queryListener,
|
|
8503
8230
|
props = _getState4.props,
|
|
8504
8231
|
internalValues = _getState4.internalValues,
|
|
8505
|
-
lock = _getState4.lock
|
|
8506
|
-
|
|
8232
|
+
lock = _getState4.lock,
|
|
8233
|
+
selectedValues = _getState4.selectedValues;
|
|
8234
|
+
var lockTime = config.initialQueriesSyncTime || 50;
|
|
8507
8235
|
var initialTimestamp = config.initialTimestamp;
|
|
8508
8236
|
var queryId = requestId || new Date().getTime();
|
|
8509
8237
|
if (config.queryLockConfig instanceof Object) {
|
|
@@ -8533,12 +8261,29 @@
|
|
|
8533
8261
|
if (!queryObj || queryObj && !Object.keys(queryObj).length) {
|
|
8534
8262
|
queryObj = _extends({}, matchAllQuery);
|
|
8535
8263
|
}
|
|
8264
|
+
var from = void 0;
|
|
8265
|
+
var depComponentType = props[component] ? props[component].componentType : null;
|
|
8266
|
+
if (depComponentType === constants$1.componentTypes.reactiveList) {
|
|
8267
|
+
var componentValue = selectedValues[component] ? selectedValues[component].value : undefined;
|
|
8268
|
+
var componentProps = props[component];
|
|
8269
|
+
if (componentValue !== undefined && componentProps) {
|
|
8270
|
+
if (componentValue > 0) {
|
|
8271
|
+
from = (componentValue - 1) * (componentProps.size || 10);
|
|
8272
|
+
} else {
|
|
8273
|
+
from = 0;
|
|
8274
|
+
}
|
|
8275
|
+
}
|
|
8276
|
+
}
|
|
8536
8277
|
var currentQuery = _extends({
|
|
8537
8278
|
query: _extends({}, queryObj)
|
|
8538
|
-
}, options, queryOptions[component]
|
|
8279
|
+
}, options, queryOptions[component], {
|
|
8280
|
+
from: from
|
|
8281
|
+
});
|
|
8539
8282
|
var queryToLog = _extends({
|
|
8540
8283
|
query: _extends({}, queryObj)
|
|
8541
|
-
}, options, queryOptions[component]
|
|
8284
|
+
}, options, queryOptions[component], {
|
|
8285
|
+
from: from
|
|
8286
|
+
});
|
|
8542
8287
|
var oldQuery = queryLog[component];
|
|
8543
8288
|
if (mustExecuteMapQuery || !(0, helper.compareQueries)(currentQuery, oldQuery, false)) {
|
|
8544
8289
|
orderOfQueries = [].concat(_toConsumableArray(orderOfQueries), [component]);
|
|
@@ -8853,12 +8598,25 @@
|
|
|
8853
8598
|
exports.addComponent = addComponent;
|
|
8854
8599
|
exports.removeComponent = removeComponent;
|
|
8855
8600
|
exports.watchComponent = watchComponent;
|
|
8856
|
-
function
|
|
8601
|
+
function addComponentToList(component) {
|
|
8857
8602
|
return {
|
|
8858
8603
|
type: constants.ADD_COMPONENT,
|
|
8859
8604
|
component: component
|
|
8860
8605
|
};
|
|
8861
8606
|
}
|
|
8607
|
+
function addComponentTimestamp(component, timestamp) {
|
|
8608
|
+
return {
|
|
8609
|
+
type: constants.SET_REGISTERED_COMPONENT_TIMESTAMP,
|
|
8610
|
+
component: component,
|
|
8611
|
+
timestamp: timestamp
|
|
8612
|
+
};
|
|
8613
|
+
}
|
|
8614
|
+
function addComponent(component, timestamp) {
|
|
8615
|
+
return function (dispatch) {
|
|
8616
|
+
dispatch(addComponentToList(component));
|
|
8617
|
+
dispatch(addComponentTimestamp(component, timestamp));
|
|
8618
|
+
};
|
|
8619
|
+
}
|
|
8862
8620
|
function removeComponent(component) {
|
|
8863
8621
|
return {
|
|
8864
8622
|
type: constants.REMOVE_COMPONENT,
|
|
@@ -9569,14 +9327,9 @@
|
|
|
9569
9327
|
};
|
|
9570
9328
|
}
|
|
9571
9329
|
function maybeInvokeDelegate(delegate, context) {
|
|
9572
|
-
var
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
9576
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
9577
|
-
}
|
|
9578
|
-
return ContinueSentinel;
|
|
9579
|
-
}
|
|
9330
|
+
var methodName = context.method,
|
|
9331
|
+
method = delegate.iterator[methodName];
|
|
9332
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
9580
9333
|
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
9581
9334
|
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
9582
9335
|
var info = record.arg;
|
|
@@ -9776,7 +9529,7 @@
|
|
|
9776
9529
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
9777
9530
|
descriptor.configurable = true;
|
|
9778
9531
|
if ("value" in descriptor) descriptor.writable = true;
|
|
9779
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9532
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
9780
9533
|
}
|
|
9781
9534
|
}
|
|
9782
9535
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -12587,7 +12340,8 @@
|
|
|
12587
12340
|
userId: VueTypes.string,
|
|
12588
12341
|
useCache: VueTypes.bool,
|
|
12589
12342
|
customEvents: VueTypes.object,
|
|
12590
|
-
enableTelemetry: VueTypes.bool.def(true)
|
|
12343
|
+
enableTelemetry: VueTypes.bool.def(true),
|
|
12344
|
+
queryParams: VueTypes.object
|
|
12591
12345
|
}).def({}),
|
|
12592
12346
|
mongodb: VueTypes.shape({
|
|
12593
12347
|
db: VueTypes.string,
|
|
@@ -13026,12 +12780,14 @@
|
|
|
13026
12780
|
if (str === void 0) {
|
|
13027
12781
|
str = '';
|
|
13028
12782
|
}
|
|
12783
|
+
var propsWhichRequirePascalCase = ['u-r-l-params'];
|
|
13029
12784
|
var arr = str.split('-');
|
|
13030
12785
|
var capital = arr.map(function (item, index) {
|
|
13031
12786
|
return index ? item.charAt(0).toUpperCase() + item.slice(1).toLowerCase() : item;
|
|
13032
12787
|
});
|
|
13033
12788
|
// ^-- change here.
|
|
13034
12789
|
var capitalString = capital.join('');
|
|
12790
|
+
if (propsWhichRequirePascalCase.includes(str)) capitalString = capitalString[0].toUpperCase() + capitalString.substring(1);
|
|
13035
12791
|
return capitalString || '';
|
|
13036
12792
|
};
|
|
13037
12793
|
var isEmpty = function isEmpty(val) {
|
|
@@ -13139,8 +12895,9 @@
|
|
|
13139
12895
|
}
|
|
13140
12896
|
return {
|
|
13141
12897
|
name: 'ComponentWrapper',
|
|
12898
|
+
$timestamp: null,
|
|
13142
12899
|
props: {
|
|
13143
|
-
destroyOnUnmount: VueTypes.bool.def(
|
|
12900
|
+
destroyOnUnmount: VueTypes.bool.def(true)
|
|
13144
12901
|
},
|
|
13145
12902
|
created: function created() {
|
|
13146
12903
|
// clone the props for component it is needed because attrs gets changed on time
|
|
@@ -13153,6 +12910,7 @@
|
|
|
13153
12910
|
this.componentProps = parsedProps;
|
|
13154
12911
|
this.componentId = this.componentProps.componentId;
|
|
13155
12912
|
this.react = this.componentProps.react;
|
|
12913
|
+
this.$timestamp = new Date().getTime();
|
|
13156
12914
|
},
|
|
13157
12915
|
beforeMount: function beforeMount() {
|
|
13158
12916
|
var _this = this;
|
|
@@ -13165,7 +12923,7 @@
|
|
|
13165
12923
|
// or component is not present in store
|
|
13166
12924
|
if (this.destroyOnUnmount || components.indexOf(this.componentProps.componentId) === -1) {
|
|
13167
12925
|
// Register component
|
|
13168
|
-
this.addComponent(this.componentId);
|
|
12926
|
+
this.addComponent(this.componentId, this.$timestamp);
|
|
13169
12927
|
var onQueryChange = function onQueryChange() {
|
|
13170
12928
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13171
12929
|
args[_key] = arguments[_key];
|
|
@@ -13187,7 +12945,7 @@
|
|
|
13187
12945
|
}
|
|
13188
12946
|
// Register internal component
|
|
13189
12947
|
if (this.internalComponent && (this.destroyOnUnmount || components.indexOf(this.internalComponent) === -1)) {
|
|
13190
|
-
this.addComponent(this.internalComponent);
|
|
12948
|
+
this.addComponent(this.internalComponent, this.$timestamp);
|
|
13191
12949
|
this.setComponentProps(this.internalComponent, this.componentProps, options.componentType);
|
|
13192
12950
|
}
|
|
13193
12951
|
},
|
|
@@ -13199,10 +12957,17 @@
|
|
|
13199
12957
|
},
|
|
13200
12958
|
beforeDestroy: function beforeDestroy() {
|
|
13201
12959
|
if (this.destroyOnUnmount) {
|
|
12960
|
+
var registeredComponentsTimestamps = {};
|
|
12961
|
+
if (this.$$store) {
|
|
12962
|
+
var _this$$$store$getStat2 = this.$$store.getState();
|
|
12963
|
+
registeredComponentsTimestamps = _this$$$store$getStat2.registeredComponentsTimestamps;
|
|
12964
|
+
}
|
|
13202
12965
|
// Unregister components
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
12966
|
+
if (registeredComponentsTimestamps[this.componentId] === this.$timestamp) {
|
|
12967
|
+
this.removeComponent(this.componentId);
|
|
12968
|
+
if (this.internalComponent) {
|
|
12969
|
+
this.removeComponent(this.internalComponent);
|
|
12970
|
+
}
|
|
13206
12971
|
}
|
|
13207
12972
|
}
|
|
13208
12973
|
},
|
|
@@ -13939,7 +13704,16 @@
|
|
|
13939
13704
|
},
|
|
13940
13705
|
infiniteScroll: function infiniteScroll(newVal, oldVal) {
|
|
13941
13706
|
if (newVal !== oldVal) {
|
|
13942
|
-
if (!
|
|
13707
|
+
if (newVal && !this.pagination) {
|
|
13708
|
+
window.addEventListener('scroll', this.scrollHandler);
|
|
13709
|
+
} else {
|
|
13710
|
+
window.removeEventListener('scroll', this.scrollHandler);
|
|
13711
|
+
}
|
|
13712
|
+
}
|
|
13713
|
+
},
|
|
13714
|
+
pagination: function pagination(newVal, oldVal) {
|
|
13715
|
+
if (newVal !== oldVal) {
|
|
13716
|
+
if (!newVal && this.infiniteScroll) {
|
|
13943
13717
|
window.addEventListener('scroll', this.scrollHandler);
|
|
13944
13718
|
} else {
|
|
13945
13719
|
window.removeEventListener('scroll', this.scrollHandler);
|
|
@@ -14390,6 +14164,8 @@
|
|
|
14390
14164
|
internalComponent: ReactiveList.hasInternalComponent()
|
|
14391
14165
|
}));
|
|
14392
14166
|
RLConnected.name = ReactiveList.name;
|
|
14167
|
+
RLConnected.generateQueryOptions = ReactiveList.generateQueryOptions;
|
|
14168
|
+
RLConnected.hasInternalComponent = ReactiveList.hasInternalComponent;
|
|
14393
14169
|
RLConnected.install = function (Vue) {
|
|
14394
14170
|
Vue.component(RLConnected.name, RLConnected);
|
|
14395
14171
|
Vue.component(ResultListWrapper.name, ResultListWrapper);
|
|
@@ -14779,6 +14555,7 @@
|
|
|
14779
14555
|
* @param {Boolean} config.enableTelemetry
|
|
14780
14556
|
* @param {Object} config.mongodb
|
|
14781
14557
|
* @param {Object} config.endpoint
|
|
14558
|
+
* @param {Object} config.httpRequestTimeout
|
|
14782
14559
|
* A callback function which will be invoked before a fetch request made
|
|
14783
14560
|
*/
|
|
14784
14561
|
function AppBase(config) {
|
|
@@ -14839,6 +14616,9 @@
|
|
|
14839
14616
|
if (config.mongodb) {
|
|
14840
14617
|
this.mongodb = config.mongodb;
|
|
14841
14618
|
}
|
|
14619
|
+
if (config.httpRequestTimeout) {
|
|
14620
|
+
this.httpRequestTimeout = config.httpRequestTimeout;
|
|
14621
|
+
}
|
|
14842
14622
|
if (typeof config.enableTelemetry === 'boolean') {
|
|
14843
14623
|
this.enableTelemetry = config.enableTelemetry;
|
|
14844
14624
|
}
|
|
@@ -14853,6 +14633,7 @@
|
|
|
14853
14633
|
* @param {Object} args.body
|
|
14854
14634
|
* @param {Object} args.headers
|
|
14855
14635
|
* @param {boolean} args.isSuggestionsAPI
|
|
14636
|
+
* @param {number} args.httpRequestTimeout - Timeout duration in milliseconds
|
|
14856
14637
|
*/
|
|
14857
14638
|
function fetchRequest(args) {
|
|
14858
14639
|
var _this = this;
|
|
@@ -14866,7 +14647,9 @@
|
|
|
14866
14647
|
isRSAPI = parsedArgs.isRSAPI,
|
|
14867
14648
|
isSuggestionsAPI = parsedArgs.isSuggestionsAPI,
|
|
14868
14649
|
_parsedArgs$isMongoRe = parsedArgs.isMongoRequest,
|
|
14869
|
-
isMongoRequest = _parsedArgs$isMongoRe === undefined ? false : _parsedArgs$isMongoRe
|
|
14650
|
+
isMongoRequest = _parsedArgs$isMongoRe === undefined ? false : _parsedArgs$isMongoRe,
|
|
14651
|
+
_parsedArgs$httpReque = parsedArgs.httpRequestTimeout,
|
|
14652
|
+
httpRequestTimeout = _parsedArgs$httpReque === undefined ? 0 : _parsedArgs$httpReque;
|
|
14870
14653
|
var app = isSuggestionsAPI ? '.suggestions' : _this.app;
|
|
14871
14654
|
var bodyCopy = body;
|
|
14872
14655
|
var contentType = path.endsWith('msearch') || path.endsWith('bulk') ? 'application/x-ndjson' : 'application/json';
|
|
@@ -14897,8 +14680,8 @@
|
|
|
14897
14680
|
}
|
|
14898
14681
|
var handleTransformRequest = function handleTransformRequest(res) {
|
|
14899
14682
|
if (_this.transformRequest && typeof _this.transformRequest === 'function') {
|
|
14900
|
-
var
|
|
14901
|
-
return
|
|
14683
|
+
var transformRequestPromise = _this.transformRequest(res);
|
|
14684
|
+
return transformRequestPromise instanceof Promise ? transformRequestPromise : Promise.resolve(transformRequestPromise);
|
|
14902
14685
|
}
|
|
14903
14686
|
return Promise.resolve(res);
|
|
14904
14687
|
};
|
|
@@ -14914,12 +14697,20 @@
|
|
|
14914
14697
|
var transformedRequest = Object.assign({}, ts);
|
|
14915
14698
|
var url = transformedRequest.url;
|
|
14916
14699
|
delete transformedRequest.url;
|
|
14917
|
-
|
|
14700
|
+
var fetchPromise = fetch$1(url || finalURL, Object.assign({}, transformedRequest, {
|
|
14918
14701
|
// apply timestamp header for RS API
|
|
14919
14702
|
headers: isRSAPI && !isMongoRequest ? Object.assign({}, transformedRequest.headers, {
|
|
14920
14703
|
'x-timestamp': new Date().getTime()
|
|
14921
14704
|
}) : transformedRequest.headers
|
|
14922
|
-
}))
|
|
14705
|
+
}));
|
|
14706
|
+
var timeoutPromise = new Promise(function (_, rejectTP) {
|
|
14707
|
+
if (httpRequestTimeout > 0) {
|
|
14708
|
+
setTimeout(function () {
|
|
14709
|
+
rejectTP(new Error('Request timeout'));
|
|
14710
|
+
}, httpRequestTimeout);
|
|
14711
|
+
}
|
|
14712
|
+
});
|
|
14713
|
+
return Promise.race([fetchPromise, timeoutPromise]).then(function (res) {
|
|
14923
14714
|
if (res.status >= 500) {
|
|
14924
14715
|
return reject(res);
|
|
14925
14716
|
}
|
|
@@ -14945,7 +14736,7 @@
|
|
|
14945
14736
|
}
|
|
14946
14737
|
});
|
|
14947
14738
|
}
|
|
14948
|
-
// reject only when all responses
|
|
14739
|
+
// reject only when all responses have an error
|
|
14949
14740
|
if (errorResponses > 0 && allResponses === errorResponses) {
|
|
14950
14741
|
return reject(data);
|
|
14951
14742
|
}
|
|
@@ -14958,7 +14749,7 @@
|
|
|
14958
14749
|
var _errorResponses = data.responses.filter(function (entry) {
|
|
14959
14750
|
return Object.prototype.hasOwnProperty.call(entry, 'error');
|
|
14960
14751
|
}).length;
|
|
14961
|
-
// reject only when all responses
|
|
14752
|
+
// reject only when all responses have an error
|
|
14962
14753
|
if (_allResponses === _errorResponses) {
|
|
14963
14754
|
return reject(data);
|
|
14964
14755
|
}
|
|
@@ -15252,7 +15043,8 @@
|
|
|
15252
15043
|
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
15253
15044
|
isRSAPI: true,
|
|
15254
15045
|
isMongoRequest: !!this.mongodb,
|
|
15255
|
-
params: params
|
|
15046
|
+
params: params,
|
|
15047
|
+
httpRequestTimeout: this.httpRequestTimeout || 0
|
|
15256
15048
|
});
|
|
15257
15049
|
}
|
|
15258
15050
|
|
|
@@ -15289,7 +15081,8 @@
|
|
|
15289
15081
|
headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
|
|
15290
15082
|
isRSAPI: true,
|
|
15291
15083
|
isMongoRequest: !!this.mongodb,
|
|
15292
|
-
params: params
|
|
15084
|
+
params: params,
|
|
15085
|
+
httpRequestTimeout: this.httpRequestTimeout || 0
|
|
15293
15086
|
});
|
|
15294
15087
|
}
|
|
15295
15088
|
|
|
@@ -15959,7 +15752,7 @@
|
|
|
15959
15752
|
},
|
|
15960
15753
|
analyticsRef: {
|
|
15961
15754
|
type: Object,
|
|
15962
|
-
required:
|
|
15755
|
+
required: false
|
|
15963
15756
|
}
|
|
15964
15757
|
},
|
|
15965
15758
|
provide: function provide() {
|
|
@@ -16274,7 +16067,6 @@
|
|
|
16274
16067
|
enableAppbase: VueTypes.bool.def(false),
|
|
16275
16068
|
credentials: types.string,
|
|
16276
16069
|
headers: types.headers,
|
|
16277
|
-
queryParams: types.string,
|
|
16278
16070
|
theme: VueTypes.object.def({}),
|
|
16279
16071
|
themePreset: VueTypes.string.def('light'),
|
|
16280
16072
|
type: types.string,
|
|
@@ -16290,7 +16082,8 @@
|
|
|
16290
16082
|
setSearchParams: types.func,
|
|
16291
16083
|
mongodb: types.mongodb,
|
|
16292
16084
|
endpoint: types.endpointConfig,
|
|
16293
|
-
preferences: VueTypes.object
|
|
16085
|
+
preferences: VueTypes.object,
|
|
16086
|
+
httpRequestTimeout: VueTypes.number.def(30)
|
|
16294
16087
|
},
|
|
16295
16088
|
provide: function provide() {
|
|
16296
16089
|
return {
|
|
@@ -16327,6 +16120,9 @@
|
|
|
16327
16120
|
},
|
|
16328
16121
|
mongodb: function mongodb() {
|
|
16329
16122
|
this.updateState(this.$props);
|
|
16123
|
+
},
|
|
16124
|
+
httpRequestTimeout: function httpRequestTimeout() {
|
|
16125
|
+
this.updateState(this.$props);
|
|
16330
16126
|
}
|
|
16331
16127
|
},
|
|
16332
16128
|
computed: {
|
|
@@ -16373,7 +16169,8 @@
|
|
|
16373
16169
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
16374
16170
|
analyticsConfig: props.appbaseConfig,
|
|
16375
16171
|
mongodb: props.mongodb,
|
|
16376
|
-
endpoint: props.endpoint
|
|
16172
|
+
endpoint: props.endpoint,
|
|
16173
|
+
httpRequestTimeout: (props.httpRequestTimeout || 0) * 1000 || 30000
|
|
16377
16174
|
};
|
|
16378
16175
|
var queryParams = '';
|
|
16379
16176
|
if (typeof window !== 'undefined') {
|
|
@@ -18916,6 +18713,7 @@
|
|
|
18916
18713
|
}
|
|
18917
18714
|
this.handleTextChange = debounce$1(this.handleText, this.$props.debounce);
|
|
18918
18715
|
this.updateDefaultQueryHandlerDebounced = debounce$1(this.updateDefaultQueryHandler, this.$props.debounce);
|
|
18716
|
+
this.updateQueryHandlerDebounced = debounce$1(this.updateQueryHandler, this.$props.debounce);
|
|
18919
18717
|
// Set custom and default queries in store
|
|
18920
18718
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
18921
18719
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
@@ -19099,7 +18897,7 @@
|
|
|
19099
18897
|
if (this.isPending && this.$options.isTagsMode && Array.isArray(newVal)) {
|
|
19100
18898
|
this.isPending = false;
|
|
19101
18899
|
}
|
|
19102
|
-
this.setValue(newVal, true, this.$props, undefined, false, typeof newVal !== 'string' && this.$options.isTagsMode);
|
|
18900
|
+
this.setValue(newVal, true, this.$props, newVal === '' ? lib_7.CLEAR_VALUE : undefined, false, typeof newVal !== 'string' && this.$options.isTagsMode);
|
|
19103
18901
|
}
|
|
19104
18902
|
},
|
|
19105
18903
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -19141,8 +18939,10 @@
|
|
|
19141
18939
|
handleText: function handleText(value) {
|
|
19142
18940
|
if (this.$props.autosuggest) {
|
|
19143
18941
|
this.updateDefaultQueryHandlerDebounced(value, this.$props);
|
|
19144
|
-
} else {
|
|
19145
|
-
this.
|
|
18942
|
+
} else if (!this.$options.isTagsMode) {
|
|
18943
|
+
this.updateQueryHandlerDebounced(this.$props.componentId, value, this.$props);
|
|
18944
|
+
} else if (this.$options.isTagsMode) {
|
|
18945
|
+
this.$data.currentValue = value;
|
|
19146
18946
|
}
|
|
19147
18947
|
},
|
|
19148
18948
|
validateDataField: function validateDataField() {
|
|
@@ -19287,10 +19087,10 @@
|
|
|
19287
19087
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
19288
19088
|
// to set the query otherwise the value should reset
|
|
19289
19089
|
|
|
19290
|
-
if (props.strictSelection) {
|
|
19291
|
-
if (cause === lib_7.SUGGESTION_SELECT ||
|
|
19090
|
+
if (props.strictSelection && props.autosuggest) {
|
|
19091
|
+
if (cause === lib_7.SUGGESTION_SELECT || props.value !== undefined) {
|
|
19292
19092
|
_this.updateQueryHandler(props.componentId, queryHandlerValue, props);
|
|
19293
|
-
} else {
|
|
19093
|
+
} else if (_this.currentValue !== '') {
|
|
19294
19094
|
_this.setValue('', true);
|
|
19295
19095
|
}
|
|
19296
19096
|
} else {
|
|
@@ -19416,17 +19216,20 @@
|
|
|
19416
19216
|
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
19417
19217
|
},
|
|
19418
19218
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
19419
|
-
var
|
|
19219
|
+
var targetValue = event.target.value;
|
|
19220
|
+
var _this$$props2 = this.$props,
|
|
19221
|
+
value = _this$$props2.value,
|
|
19222
|
+
strictSelection = _this$$props2.strictSelection,
|
|
19223
|
+
size = _this$$props2.size,
|
|
19224
|
+
autosuggest = _this$$props2.autosuggest;
|
|
19420
19225
|
if (value !== undefined) {
|
|
19421
19226
|
this.isPending = true;
|
|
19422
19227
|
}
|
|
19423
|
-
|
|
19424
19228
|
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
19425
|
-
if (event.key === 'Enter' && highlightedIndex === null) {
|
|
19426
|
-
this.
|
|
19427
|
-
);
|
|
19428
|
-
|
|
19429
|
-
this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
|
|
19229
|
+
if (event.key === 'Enter' && (highlightedIndex === null || highlightedIndex < 0 || highlightedIndex === [].concat([].concat(this.suggestionsList).slice(0, size || 10), this.defaultSearchSuggestions, this.topSuggestions).length)) {
|
|
19230
|
+
this.isPending = false;
|
|
19231
|
+
this.setValue(this.$options.isTagsMode && autosuggest && strictSelection ? '' : targetValue, true, this.$props, undefined, false);
|
|
19232
|
+
this.onValueSelectedHandler(targetValue, lib_7.ENTER_PRESS);
|
|
19430
19233
|
}
|
|
19431
19234
|
// Need to review
|
|
19432
19235
|
this.$emit('keyDown', event, this.triggerQuery);
|
|
@@ -19438,19 +19241,19 @@
|
|
|
19438
19241
|
if (!this.$data.isOpen) {
|
|
19439
19242
|
this.isOpen = true;
|
|
19440
19243
|
}
|
|
19441
|
-
var _this$$
|
|
19442
|
-
value = _this$$
|
|
19443
|
-
autosuggest = _this$$
|
|
19244
|
+
var _this$$props3 = this.$props,
|
|
19245
|
+
value = _this$$props3.value,
|
|
19246
|
+
autosuggest = _this$$props3.autosuggest;
|
|
19444
19247
|
if (value === undefined) {
|
|
19445
19248
|
this.setValue(inputValue, false, this.$props, undefined, true, false);
|
|
19446
19249
|
} else {
|
|
19447
19250
|
this.isPending = true;
|
|
19251
|
+
this.currentValue = inputValue;
|
|
19448
19252
|
this.$emit('change', inputValue, function (_temp2) {
|
|
19449
19253
|
var _ref3 = _temp2 === void 0 ? {} : _temp2,
|
|
19450
19254
|
_ref3$isOpen = _ref3.isOpen,
|
|
19451
19255
|
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen;
|
|
19452
19256
|
if (_this2.$options.isTagsMode && autosuggest) {
|
|
19453
|
-
_this2.currentValue = value;
|
|
19454
19257
|
_this2.isOpen = isOpen;
|
|
19455
19258
|
_this2.updateDefaultQueryHandlerDebounced(_this2.currentValue, _this2.$props);
|
|
19456
19259
|
return;
|
|
@@ -19538,9 +19341,9 @@
|
|
|
19538
19341
|
finalSuggestionsList = [];
|
|
19539
19342
|
}
|
|
19540
19343
|
var h = this.$createElement;
|
|
19541
|
-
var _this$$
|
|
19542
|
-
theme = _this$$
|
|
19543
|
-
innerClass = _this$$
|
|
19344
|
+
var _this$$props4 = this.$props,
|
|
19345
|
+
theme = _this$$props4.theme,
|
|
19346
|
+
innerClass = _this$$props4.innerClass;
|
|
19544
19347
|
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
19545
19348
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
19546
19349
|
var _this$$data = this.$data,
|
|
@@ -19644,13 +19447,13 @@
|
|
|
19644
19447
|
},
|
|
19645
19448
|
renderIcons: function renderIcons() {
|
|
19646
19449
|
var h = this.$createElement;
|
|
19647
|
-
var _this$$
|
|
19648
|
-
iconPosition = _this$$
|
|
19649
|
-
showClear = _this$$
|
|
19650
|
-
innerClass = _this$$
|
|
19651
|
-
getMicInstance = _this$$
|
|
19652
|
-
showVoiceSearch = _this$$
|
|
19653
|
-
showIcon = _this$$
|
|
19450
|
+
var _this$$props5 = this.$props,
|
|
19451
|
+
iconPosition = _this$$props5.iconPosition,
|
|
19452
|
+
showClear = _this$$props5.showClear,
|
|
19453
|
+
innerClass = _this$$props5.innerClass,
|
|
19454
|
+
getMicInstance = _this$$props5.getMicInstance,
|
|
19455
|
+
showVoiceSearch = _this$$props5.showVoiceSearch,
|
|
19456
|
+
showIcon = _this$$props5.showIcon;
|
|
19654
19457
|
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
19655
19458
|
var currentValue = this.$data.currentValue;
|
|
19656
19459
|
return h("div", [h(IconGroup, {
|
|
@@ -19734,11 +19537,11 @@
|
|
|
19734
19537
|
render: function render() {
|
|
19735
19538
|
var _this6 = this;
|
|
19736
19539
|
var h = arguments[0];
|
|
19737
|
-
var _this$$
|
|
19738
|
-
theme = _this$$
|
|
19739
|
-
size = _this$$
|
|
19740
|
-
expandSuggestionsContainer = _this$$
|
|
19741
|
-
enableDefaultSuggestions = _this$$
|
|
19540
|
+
var _this$$props6 = this.$props,
|
|
19541
|
+
theme = _this$$props6.theme,
|
|
19542
|
+
size = _this$$props6.size,
|
|
19543
|
+
expandSuggestionsContainer = _this$$props6.expandSuggestionsContainer,
|
|
19544
|
+
enableDefaultSuggestions = _this$$props6.enableDefaultSuggestions;
|
|
19742
19545
|
var _this$$scopedSlots = this.$scopedSlots,
|
|
19743
19546
|
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
19744
19547
|
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
@@ -19900,7 +19703,7 @@
|
|
|
19900
19703
|
}
|
|
19901
19704
|
})),
|
|
19902
19705
|
"domProps": _extends({}, getInputProps({
|
|
19903
|
-
value: _this6.$data.currentValue === null ? '' : _this6.$data.currentValue
|
|
19706
|
+
value: _this6.$data.currentValue === null || typeof _this6.$data.currentValue !== 'string' ? '' : _this6.$data.currentValue
|
|
19904
19707
|
}))
|
|
19905
19708
|
}), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this6.renderTags()]);
|
|
19906
19709
|
}
|
|
@@ -19929,8 +19732,7 @@
|
|
|
19929
19732
|
_this6.$emit('focus', e, _this6.triggerQuery);
|
|
19930
19733
|
},
|
|
19931
19734
|
keydown: function keydown(e) {
|
|
19932
|
-
_this6
|
|
19933
|
-
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
19735
|
+
_this6.handleKeyDown(e, null);
|
|
19934
19736
|
},
|
|
19935
19737
|
keyup: function keyup(e) {
|
|
19936
19738
|
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
@@ -19942,7 +19744,7 @@
|
|
|
19942
19744
|
value: this.$data.currentValue ? this.$data.currentValue : ''
|
|
19943
19745
|
}),
|
|
19944
19746
|
"ref": this.$props.innerRef
|
|
19945
|
-
}), this.renderIcons()]), this.renderInputAddonAfter()])])]);
|
|
19747
|
+
}), this.renderIcons()]), this.renderInputAddonAfter()]), this.renderTags()])]);
|
|
19946
19748
|
},
|
|
19947
19749
|
destroyed: function destroyed() {
|
|
19948
19750
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
@@ -20117,6 +19919,10 @@
|
|
|
20117
19919
|
componentType: constants_1$1.dataSearch,
|
|
20118
19920
|
internalComponent: DataSearch.hasInternalComponent()
|
|
20119
19921
|
}));
|
|
19922
|
+
DSConnected.defaultQuery = DataSearch.defaultQuery;
|
|
19923
|
+
DSConnected.shouldQuery = DataSearch.shouldQuery;
|
|
19924
|
+
DSConnected.highlightQuery = DataSearch.highlightQuery;
|
|
19925
|
+
DSConnected.hasInternalComponent = DataSearch.hasInternalComponent;
|
|
20120
19926
|
DSConnected.name = DataSearch.name;
|
|
20121
19927
|
|
|
20122
19928
|
// plugins usage
|
|
@@ -20366,7 +20172,6 @@
|
|
|
20366
20172
|
// selected value is cleared, call onValueSelected
|
|
20367
20173
|
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
20368
20174
|
}
|
|
20369
|
-
// if (this.$props.value === undefined) {
|
|
20370
20175
|
if (this.$options.isTagsMode) {
|
|
20371
20176
|
// handling reset of tags through SelectedFilters or URL
|
|
20372
20177
|
this.selectedTags = [];
|
|
@@ -20376,7 +20181,6 @@
|
|
|
20376
20181
|
cause = lib_7.SUGGESTION_SELECT;
|
|
20377
20182
|
}
|
|
20378
20183
|
this.setValue(newVal || '', true, this.$props, cause);
|
|
20379
|
-
// }
|
|
20380
20184
|
}
|
|
20381
20185
|
},
|
|
20382
20186
|
focusShortcuts: function focusShortcuts() {
|
|
@@ -20519,8 +20323,7 @@
|
|
|
20519
20323
|
if (typeof value === 'string' && !!value) {
|
|
20520
20324
|
_this.selectedTags.push(value);
|
|
20521
20325
|
} else if (Array.isArray(value) && !isEqual$5(_this.selectedTags, value)) {
|
|
20522
|
-
|
|
20523
|
-
_this.selectedTags = mergedArray;
|
|
20326
|
+
_this.selectedTags = value;
|
|
20524
20327
|
}
|
|
20525
20328
|
} else if (value) {
|
|
20526
20329
|
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
@@ -21222,6 +21025,9 @@
|
|
|
21222
21025
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
21223
21026
|
}
|
|
21224
21027
|
};
|
|
21028
|
+
SearchBox.hasInternalComponent = function () {
|
|
21029
|
+
return true;
|
|
21030
|
+
};
|
|
21225
21031
|
SearchBox.defaultQuery = function (value, props) {
|
|
21226
21032
|
var finalQuery = null;
|
|
21227
21033
|
var fields = normalizeDataField$1(props.dataField, props.fieldWeights);
|
|
@@ -21345,6 +21151,9 @@
|
|
|
21345
21151
|
internalComponent: true
|
|
21346
21152
|
}));
|
|
21347
21153
|
SBConnected.name = SearchBox.name;
|
|
21154
|
+
SBConnected.defaultQuery = SearchBox.defaultQuery;
|
|
21155
|
+
SBConnected.shouldQuery = SearchBox.shouldQuery;
|
|
21156
|
+
SBConnected.hasInternalComponent = SearchBox.hasInternalComponent;
|
|
21348
21157
|
SBConnected.install = function (Vue) {
|
|
21349
21158
|
Vue.component(SBConnected.name, SBConnected);
|
|
21350
21159
|
};
|
|
@@ -21559,7 +21368,7 @@
|
|
|
21559
21368
|
return isFunction$1(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
21560
21369
|
}
|
|
21561
21370
|
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
21562
|
-
if (this.
|
|
21371
|
+
if (this.renderNoResults) {
|
|
21563
21372
|
this.renderNoResult();
|
|
21564
21373
|
} else {
|
|
21565
21374
|
return null;
|
|
@@ -21864,13 +21673,15 @@
|
|
|
21864
21673
|
internalComponent: SingleList.hasInternalComponent()
|
|
21865
21674
|
}));
|
|
21866
21675
|
ListConnected.name = SingleList.name;
|
|
21676
|
+
ListConnected.defaultQuery = SingleList.defaultQuery;
|
|
21677
|
+
ListConnected.generateQueryOptions = SingleList.generateQueryOptions;
|
|
21678
|
+
ListConnected.hasInternalComponent = SingleList.hasInternalComponent;
|
|
21679
|
+
// Add componentType for SSR
|
|
21680
|
+
ListConnected.componentType = constants_1$1.singleList;
|
|
21867
21681
|
ListConnected.install = function (Vue) {
|
|
21868
21682
|
Vue.component(ListConnected.name, ListConnected);
|
|
21869
21683
|
};
|
|
21870
21684
|
|
|
21871
|
-
// Add componentType for SSR
|
|
21872
|
-
ListConnected.componentType = constants_1$1.singleList;
|
|
21873
|
-
|
|
21874
21685
|
var updateQuery$4 = lib_5.updateQuery,
|
|
21875
21686
|
setQueryOptions$3 = lib_5.setQueryOptions,
|
|
21876
21687
|
setCustomQuery$3 = lib_5.setCustomQuery,
|
|
@@ -22017,7 +21828,7 @@
|
|
|
22017
21828
|
return isFunction$1(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
22018
21829
|
}
|
|
22019
21830
|
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
22020
|
-
if (this.
|
|
21831
|
+
if (this.renderNoResults) {
|
|
22021
21832
|
this.renderNoResult();
|
|
22022
21833
|
} else {
|
|
22023
21834
|
return null;
|
|
@@ -22399,13 +22210,15 @@
|
|
|
22399
22210
|
internalComponent: MultiList.hasInternalComponent()
|
|
22400
22211
|
}));
|
|
22401
22212
|
ListConnected$1.name = MultiList.name;
|
|
22213
|
+
ListConnected$1.defaultQuery = MultiList.defaultQuery;
|
|
22214
|
+
ListConnected$1.generateQueryOptions = MultiList.generateQueryOptions;
|
|
22215
|
+
ListConnected$1.hasInternalComponent = MultiList.hasInternalComponent;
|
|
22216
|
+
// Add componentType for SSR
|
|
22217
|
+
ListConnected$1.componentType = constants_1$1.multiList;
|
|
22402
22218
|
ListConnected$1.install = function (Vue) {
|
|
22403
22219
|
Vue.component(ListConnected$1.name, ListConnected$1);
|
|
22404
22220
|
};
|
|
22405
22221
|
|
|
22406
|
-
// Add componentType for SSR
|
|
22407
|
-
ListConnected$1.componentType = constants_1$1.multiList;
|
|
22408
|
-
|
|
22409
22222
|
var _templateObject$m, _templateObject2$9, _templateObject3$7, _templateObject4$6;
|
|
22410
22223
|
var small = css(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"])));
|
|
22411
22224
|
var dark$2 = function dark(_ref) {
|
|
@@ -23105,14 +22918,16 @@
|
|
|
23105
22918
|
componentType: constants_1$1.singleDropdownList,
|
|
23106
22919
|
internalComponent: SingleDropdownList.hasInternalComponent()
|
|
23107
22920
|
}));
|
|
22921
|
+
ListConnected$2.defaultQuery = SingleDropdownList.defaultQuery;
|
|
22922
|
+
ListConnected$2.generateQueryOptions = SingleDropdownList.generateQueryOptions;
|
|
22923
|
+
ListConnected$2.hasInternalComponent = SingleDropdownList.hasInternalComponent;
|
|
23108
22924
|
ListConnected$2.name = SingleDropdownList.name;
|
|
22925
|
+
// Add componentType for SSR
|
|
22926
|
+
ListConnected$2.componentType = constants_1$1.singleDropdownList;
|
|
23109
22927
|
ListConnected$2.install = function (Vue) {
|
|
23110
22928
|
Vue.component(ListConnected$2.name, ListConnected$2);
|
|
23111
22929
|
};
|
|
23112
22930
|
|
|
23113
|
-
// Add componentType for SSR
|
|
23114
|
-
ListConnected$2.componentType = constants_1$1.singleDropdownList;
|
|
23115
|
-
|
|
23116
22931
|
var updateQuery$6 = lib_5.updateQuery,
|
|
23117
22932
|
setQueryOptions$5 = lib_5.setQueryOptions,
|
|
23118
22933
|
setCustomQuery$5 = lib_5.setCustomQuery,
|
|
@@ -23621,12 +23436,15 @@
|
|
|
23621
23436
|
internalComponent: MultiDropdownList.hasInternalComponent()
|
|
23622
23437
|
}));
|
|
23623
23438
|
ListConnected$3.name = MultiDropdownList.name;
|
|
23624
|
-
ListConnected$3.install = function (Vue) {
|
|
23625
|
-
Vue.component(ListConnected$3.name, ListConnected$3);
|
|
23626
|
-
};
|
|
23627
23439
|
|
|
23628
23440
|
// Add componentType for SSR
|
|
23629
23441
|
ListConnected$3.componentType = constants_1$1.multiDropdownList;
|
|
23442
|
+
ListConnected$3.defaultQuery = MultiDropdownList.defaultQuery;
|
|
23443
|
+
ListConnected$3.generateQueryOptions = MultiDropdownList.generateQueryOptions;
|
|
23444
|
+
ListConnected$3.hasInternalComponent = MultiDropdownList.hasInternalComponent;
|
|
23445
|
+
ListConnected$3.install = function (Vue) {
|
|
23446
|
+
Vue.component(ListConnected$3.name, ListConnected$3);
|
|
23447
|
+
};
|
|
23630
23448
|
|
|
23631
23449
|
var updateQuery$7 = lib_5.updateQuery,
|
|
23632
23450
|
setQueryOptions$6 = lib_5.setQueryOptions,
|
|
@@ -23916,6 +23734,8 @@
|
|
|
23916
23734
|
var TBConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$6)(ToggleButton), {
|
|
23917
23735
|
componentType: constants_1$1.toggleButton
|
|
23918
23736
|
}));
|
|
23737
|
+
TBConnected.parseValue = ToggleButton.parseValue;
|
|
23738
|
+
TBConnected.defaultQuery = ToggleButton.defaultQuery;
|
|
23919
23739
|
TBConnected.name = ToggleButton.name;
|
|
23920
23740
|
TBConnected.install = function (Vue) {
|
|
23921
23741
|
Vue.component(TBConnected.name, TBConnected);
|
|
@@ -23923,6 +23743,312 @@
|
|
|
23923
23743
|
// Add componentType for SSR
|
|
23924
23744
|
TBConnected.componentType = constants_1$1.toggleButton;
|
|
23925
23745
|
|
|
23746
|
+
var _excluded = ["options"];
|
|
23747
|
+
var updateQuery$8 = lib_5.updateQuery,
|
|
23748
|
+
setQueryOptions$7 = lib_5.setQueryOptions,
|
|
23749
|
+
setCustomQuery$7 = lib_5.setCustomQuery,
|
|
23750
|
+
setDefaultQuery$7 = lib_5.setDefaultQuery;
|
|
23751
|
+
var parseHits$1 = lib_8.parseHits,
|
|
23752
|
+
isEqual$b = lib_8.isEqual,
|
|
23753
|
+
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
23754
|
+
getResultStats$3 = lib_8.getResultStats,
|
|
23755
|
+
extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
|
|
23756
|
+
getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
|
|
23757
|
+
var ReactiveComponent = {
|
|
23758
|
+
name: 'ReactiveComponent',
|
|
23759
|
+
props: {
|
|
23760
|
+
componentId: types.stringRequired,
|
|
23761
|
+
aggregationField: types.string,
|
|
23762
|
+
aggregationSize: VueTypes.number,
|
|
23763
|
+
size: VueTypes.number,
|
|
23764
|
+
defaultQuery: types.func,
|
|
23765
|
+
customQuery: types.func,
|
|
23766
|
+
filterLabel: types.string,
|
|
23767
|
+
react: types.react,
|
|
23768
|
+
showFilter: VueTypes.bool.def(true),
|
|
23769
|
+
URLParams: VueTypes.bool.def(false),
|
|
23770
|
+
distinctField: types.string,
|
|
23771
|
+
distinctFieldConfig: types.props,
|
|
23772
|
+
index: VueTypes.string,
|
|
23773
|
+
endpoint: types.endpointConfig
|
|
23774
|
+
},
|
|
23775
|
+
created: function created() {
|
|
23776
|
+
var _this = this;
|
|
23777
|
+
var props = this.$props;
|
|
23778
|
+
this.internalComponent = null;
|
|
23779
|
+
this.$defaultQuery = null;
|
|
23780
|
+
// Set custom query in store
|
|
23781
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23782
|
+
var customQuery = props.customQuery,
|
|
23783
|
+
componentId = props.componentId,
|
|
23784
|
+
filterLabel = props.filterLabel,
|
|
23785
|
+
showFilter = props.showFilter,
|
|
23786
|
+
URLParams = props.URLParams,
|
|
23787
|
+
distinctField = props.distinctField,
|
|
23788
|
+
distinctFieldConfig = props.distinctFieldConfig,
|
|
23789
|
+
index = props.index;
|
|
23790
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
23791
|
+
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
23792
|
+
}
|
|
23793
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
23794
|
+
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
23795
|
+
}
|
|
23796
|
+
if (!this.enableAppbase && index) {
|
|
23797
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
23798
|
+
}
|
|
23799
|
+
if (customQuery) {
|
|
23800
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
23801
|
+
var query = extractQueryFromCustomQuery$6(calcCustomQuery);
|
|
23802
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
|
|
23803
|
+
if (customQueryOptions) {
|
|
23804
|
+
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
23805
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
23806
|
+
this.updateQuery({
|
|
23807
|
+
componentId: componentId,
|
|
23808
|
+
query: query,
|
|
23809
|
+
value: this.selectedValue || null,
|
|
23810
|
+
label: filterLabel,
|
|
23811
|
+
showFilter: showFilter,
|
|
23812
|
+
URLParams: URLParams
|
|
23813
|
+
});
|
|
23814
|
+
}
|
|
23815
|
+
this.setQuery = function (_ref) {
|
|
23816
|
+
var options = _ref.options,
|
|
23817
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23818
|
+
var queryToBeSet = obj.query;
|
|
23819
|
+
|
|
23820
|
+
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
23821
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
23822
|
+
queryToBeSet = queryToBeSet.query;
|
|
23823
|
+
}
|
|
23824
|
+
var customQueryCalc = _extends({}, options, {
|
|
23825
|
+
query: queryToBeSet
|
|
23826
|
+
});
|
|
23827
|
+
var rsAPIQuery = customQueryCalc;
|
|
23828
|
+
// handle stored queries
|
|
23829
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
23830
|
+
rsAPIQuery = queryToBeSet;
|
|
23831
|
+
}
|
|
23832
|
+
// Update customQuery field for RS API
|
|
23833
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
23834
|
+
if (options) {
|
|
23835
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
23836
|
+
}
|
|
23837
|
+
_this.updateQuery(_extends({}, obj, {
|
|
23838
|
+
query: customQueryCalc.query,
|
|
23839
|
+
componentId: props.componentId,
|
|
23840
|
+
label: props.filterLabel,
|
|
23841
|
+
showFilter: props.showFilter,
|
|
23842
|
+
URLParams: props.URLParams
|
|
23843
|
+
}));
|
|
23844
|
+
};
|
|
23845
|
+
if (props.defaultQuery) {
|
|
23846
|
+
this.internalComponent = props.componentId + "__internal";
|
|
23847
|
+
}
|
|
23848
|
+
if (this.internalComponent && this.$props.defaultQuery) {
|
|
23849
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23850
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
23851
|
+
var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
23852
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
23853
|
+
if (queryOptions) {
|
|
23854
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
23855
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
23856
|
+
this.updateQuery({
|
|
23857
|
+
componentId: this.internalComponent,
|
|
23858
|
+
query: _query
|
|
23859
|
+
});
|
|
23860
|
+
}
|
|
23861
|
+
},
|
|
23862
|
+
watch: {
|
|
23863
|
+
hits: function hits(newVal, oldVal) {
|
|
23864
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23865
|
+
this.$emit('data', this.getData());
|
|
23866
|
+
}
|
|
23867
|
+
},
|
|
23868
|
+
rawData: function rawData(newVal, oldVal) {
|
|
23869
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23870
|
+
this.$emit('data', this.getData());
|
|
23871
|
+
}
|
|
23872
|
+
},
|
|
23873
|
+
aggregations: function aggregations(newVal, oldVal) {
|
|
23874
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23875
|
+
this.$emit('data', this.getData());
|
|
23876
|
+
}
|
|
23877
|
+
},
|
|
23878
|
+
aggregationData: function aggregationData(newVal, oldVal) {
|
|
23879
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23880
|
+
this.$emit('data', this.getData());
|
|
23881
|
+
}
|
|
23882
|
+
},
|
|
23883
|
+
promotedResults: function promotedResults(newVal, oldVal) {
|
|
23884
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23885
|
+
this.$emit('data', this.getData());
|
|
23886
|
+
}
|
|
23887
|
+
},
|
|
23888
|
+
hidden: function hidden(newVal, oldVal) {
|
|
23889
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23890
|
+
this.$emit('data', this.getData());
|
|
23891
|
+
}
|
|
23892
|
+
},
|
|
23893
|
+
total: function total(newVal, oldVal) {
|
|
23894
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23895
|
+
this.$emit('data', this.getData());
|
|
23896
|
+
}
|
|
23897
|
+
},
|
|
23898
|
+
time: function time(newVal, oldVal) {
|
|
23899
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23900
|
+
this.$emit('data', this.getData());
|
|
23901
|
+
}
|
|
23902
|
+
},
|
|
23903
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
23904
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23905
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
23906
|
+
var query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
23907
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
23908
|
+
if (queryOptions) {
|
|
23909
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
23910
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
23911
|
+
// Update default query for RS API
|
|
23912
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23913
|
+
this.updateQuery({
|
|
23914
|
+
componentId: this.internalComponent,
|
|
23915
|
+
query: query
|
|
23916
|
+
});
|
|
23917
|
+
}
|
|
23918
|
+
},
|
|
23919
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
23920
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
23921
|
+
var componentId = this.$props.componentId;
|
|
23922
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
23923
|
+
var query = extractQueryFromCustomQuery$6(this.$customQuery);
|
|
23924
|
+
var queryOptions = getOptionsForCustomQuery$6(this.$customQuery);
|
|
23925
|
+
if (queryOptions) {
|
|
23926
|
+
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
23927
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
23928
|
+
|
|
23929
|
+
// Update custom query for RS API
|
|
23930
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
23931
|
+
this.updateQuery({
|
|
23932
|
+
componentId: componentId,
|
|
23933
|
+
query: query
|
|
23934
|
+
});
|
|
23935
|
+
}
|
|
23936
|
+
}
|
|
23937
|
+
},
|
|
23938
|
+
render: function render() {
|
|
23939
|
+
var h = arguments[0];
|
|
23940
|
+
try {
|
|
23941
|
+
var dom = this.$scopedSlots["default"];
|
|
23942
|
+
var error = this.error,
|
|
23943
|
+
isLoading = this.isLoading,
|
|
23944
|
+
selectedValue = this.selectedValue;
|
|
23945
|
+
var propsToBePassed = _extends({
|
|
23946
|
+
error: error,
|
|
23947
|
+
loading: isLoading
|
|
23948
|
+
}, this.getData(), {
|
|
23949
|
+
value: selectedValue,
|
|
23950
|
+
setQuery: this.setQuery
|
|
23951
|
+
});
|
|
23952
|
+
return h("div", [dom(propsToBePassed)]);
|
|
23953
|
+
} catch (e) {
|
|
23954
|
+
return null;
|
|
23955
|
+
}
|
|
23956
|
+
},
|
|
23957
|
+
methods: {
|
|
23958
|
+
getAggsQuery: function getAggsQuery() {
|
|
23959
|
+
if (this.aggregationField) {
|
|
23960
|
+
return {
|
|
23961
|
+
aggs: getCompositeAggsQuery$5({
|
|
23962
|
+
props: this.$props,
|
|
23963
|
+
showTopHits: true,
|
|
23964
|
+
value: this.selectedValue
|
|
23965
|
+
}).aggs
|
|
23966
|
+
};
|
|
23967
|
+
}
|
|
23968
|
+
return {};
|
|
23969
|
+
},
|
|
23970
|
+
getData: function getData() {
|
|
23971
|
+
var hits = this.hits,
|
|
23972
|
+
aggregations = this.aggregations,
|
|
23973
|
+
aggregationData = this.aggregationData,
|
|
23974
|
+
promotedResults = this.promotedResults,
|
|
23975
|
+
rawData = this.rawData;
|
|
23976
|
+
var filteredResults = parseHits$1(hits);
|
|
23977
|
+
if (promotedResults.length) {
|
|
23978
|
+
var ids = promotedResults.map(function (item) {
|
|
23979
|
+
return item._id;
|
|
23980
|
+
}).filter(Boolean);
|
|
23981
|
+
if (ids) {
|
|
23982
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
23983
|
+
return !ids.includes(item._id);
|
|
23984
|
+
});
|
|
23985
|
+
}
|
|
23986
|
+
filteredResults = [].concat(promotedResults, filteredResults);
|
|
23987
|
+
}
|
|
23988
|
+
return {
|
|
23989
|
+
data: filteredResults,
|
|
23990
|
+
aggregationData: aggregationData,
|
|
23991
|
+
rawData: rawData,
|
|
23992
|
+
aggregations: aggregations,
|
|
23993
|
+
promotedData: promotedResults,
|
|
23994
|
+
resultStats: this.stats
|
|
23995
|
+
};
|
|
23996
|
+
}
|
|
23997
|
+
},
|
|
23998
|
+
computed: {
|
|
23999
|
+
stats: function stats() {
|
|
24000
|
+
return getResultStats$3(this);
|
|
24001
|
+
}
|
|
24002
|
+
}
|
|
24003
|
+
};
|
|
24004
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
24005
|
+
return !!props.defaultQuery;
|
|
24006
|
+
};
|
|
24007
|
+
var mapStateToProps$a = function mapStateToProps(state, props) {
|
|
24008
|
+
return {
|
|
24009
|
+
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
24010
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
24011
|
+
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
24012
|
+
rawData: state.rawData[props.componentId],
|
|
24013
|
+
error: state.error[props.componentId],
|
|
24014
|
+
isLoading: state.isLoading[props.componentId],
|
|
24015
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24016
|
+
promotedResults: state.promotedResults[props.componentId] || [],
|
|
24017
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
24018
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
24019
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
24020
|
+
componentProps: state.props[props.componentId],
|
|
24021
|
+
enableAppbase: state.config.enableAppbase
|
|
24022
|
+
};
|
|
24023
|
+
};
|
|
24024
|
+
var mapDispatchtoProps$7 = {
|
|
24025
|
+
setQueryOptions: setQueryOptions$7,
|
|
24026
|
+
updateQuery: updateQuery$8,
|
|
24027
|
+
setCustomQuery: setCustomQuery$7,
|
|
24028
|
+
setDefaultQuery: setDefaultQuery$7
|
|
24029
|
+
};
|
|
24030
|
+
var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$7)(ReactiveComponent), {
|
|
24031
|
+
componentType: constants_1$1.reactiveComponent
|
|
24032
|
+
});
|
|
24033
|
+
var RcConnected = PreferencesConsumer({
|
|
24034
|
+
name: 'RcConnected',
|
|
24035
|
+
render: function render(h) {
|
|
24036
|
+
return h(ConnectedComponent, {
|
|
24037
|
+
attrs: this.$attrs,
|
|
24038
|
+
on: this.$listeners,
|
|
24039
|
+
scopedSlots: this.$scopedSlots,
|
|
24040
|
+
slots: this.$slots
|
|
24041
|
+
});
|
|
24042
|
+
}
|
|
24043
|
+
});
|
|
24044
|
+
RcConnected.name = ReactiveComponent.name;
|
|
24045
|
+
RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
|
|
24046
|
+
// Add componentType for SSR
|
|
24047
|
+
RcConnected.componentType = constants_1$1.reactiveComponent;
|
|
24048
|
+
RcConnected.install = function (Vue) {
|
|
24049
|
+
Vue.component(RcConnected.name, RcConnected);
|
|
24050
|
+
};
|
|
24051
|
+
|
|
23926
24052
|
/*!
|
|
23927
24053
|
* vue-no-ssr v1.1.1
|
|
23928
24054
|
* (c) 2018-present egoist <0x142857@gmail.com>
|
|
@@ -24012,18 +24138,18 @@
|
|
|
24012
24138
|
var addComponent$1 = lib_5.addComponent,
|
|
24013
24139
|
removeComponent$1 = lib_5.removeComponent,
|
|
24014
24140
|
watchComponent$1 = lib_5.watchComponent,
|
|
24015
|
-
updateQuery$
|
|
24141
|
+
updateQuery$9 = lib_5.updateQuery,
|
|
24016
24142
|
setQueryListener$1 = lib_5.setQueryListener,
|
|
24017
|
-
setQueryOptions$
|
|
24143
|
+
setQueryOptions$8 = lib_5.setQueryOptions,
|
|
24018
24144
|
setComponentProps$1 = lib_5.setComponentProps,
|
|
24019
|
-
setCustomQuery$
|
|
24145
|
+
setCustomQuery$8 = lib_5.setCustomQuery,
|
|
24020
24146
|
updateComponentProps$2 = lib_5.updateComponentProps;
|
|
24021
24147
|
var checkValueChange$7 = lib_8.checkValueChange,
|
|
24022
24148
|
getClassName$b = lib_8.getClassName,
|
|
24023
|
-
isEqual$
|
|
24149
|
+
isEqual$c = lib_8.isEqual,
|
|
24024
24150
|
checkSomePropChange$1 = lib_8.checkSomePropChange,
|
|
24025
|
-
extractQueryFromCustomQuery$
|
|
24026
|
-
getOptionsForCustomQuery$
|
|
24151
|
+
extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
|
|
24152
|
+
getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
|
|
24027
24153
|
var DynamicRangeSlider = {
|
|
24028
24154
|
name: 'DynamicRangeSlider',
|
|
24029
24155
|
components: getComponents(),
|
|
@@ -24059,6 +24185,7 @@
|
|
|
24059
24185
|
},
|
|
24060
24186
|
created: function created() {
|
|
24061
24187
|
var _this = this;
|
|
24188
|
+
this.$timestamp = new Date().getTime();
|
|
24062
24189
|
var onQueryChange = function onQueryChange() {
|
|
24063
24190
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24064
24191
|
args[_key] = arguments[_key];
|
|
@@ -24087,8 +24214,8 @@
|
|
|
24087
24214
|
}
|
|
24088
24215
|
var value = this.$props.value;
|
|
24089
24216
|
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
24090
|
-
this.addComponent(this.componentId);
|
|
24091
|
-
this.addComponent(this.internalRangeComponent);
|
|
24217
|
+
this.addComponent(this.componentId, this.$timestamp);
|
|
24218
|
+
this.addComponent(this.internalRangeComponent, this.$timestamp);
|
|
24092
24219
|
if (Array.isArray(this.selectedValue)) {
|
|
24093
24220
|
this.handleChange(this.selectedValue);
|
|
24094
24221
|
} else if (this.selectedValue) {
|
|
@@ -24210,11 +24337,11 @@
|
|
|
24210
24337
|
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
24211
24338
|
if (this.$props.customQuery) {
|
|
24212
24339
|
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
24213
|
-
var queryTobeSet = extractQueryFromCustomQuery$
|
|
24340
|
+
var queryTobeSet = extractQueryFromCustomQuery$7(customQueryTobeSet);
|
|
24214
24341
|
if (queryTobeSet) {
|
|
24215
24342
|
query = queryTobeSet;
|
|
24216
24343
|
}
|
|
24217
|
-
var customQueryOptions = getOptionsForCustomQuery$
|
|
24344
|
+
var customQueryOptions = getOptionsForCustomQuery$7(customQueryTobeSet);
|
|
24218
24345
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
24219
24346
|
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
24220
24347
|
}
|
|
@@ -24261,7 +24388,7 @@
|
|
|
24261
24388
|
this.setReact();
|
|
24262
24389
|
},
|
|
24263
24390
|
selectedValue: function selectedValue(newValue) {
|
|
24264
|
-
if (isEqual$
|
|
24391
|
+
if (isEqual$c(newValue, this.currentValue)) return;
|
|
24265
24392
|
var value = newValue || {
|
|
24266
24393
|
start: this.range.start,
|
|
24267
24394
|
end: this.range.end
|
|
@@ -24270,7 +24397,7 @@
|
|
|
24270
24397
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
24271
24398
|
},
|
|
24272
24399
|
range: function range(newValue, oldValue) {
|
|
24273
|
-
if (isEqual$
|
|
24400
|
+
if (isEqual$c(newValue, oldValue) || !this.currentValue) return;
|
|
24274
24401
|
var _ref3 = this.currentValue || [],
|
|
24275
24402
|
currentStart = _ref3[0],
|
|
24276
24403
|
currentEnd = _ref3[1];
|
|
@@ -24287,7 +24414,7 @@
|
|
|
24287
24414
|
}
|
|
24288
24415
|
},
|
|
24289
24416
|
value: function value(newVal, oldVal) {
|
|
24290
|
-
if (!isEqual$
|
|
24417
|
+
if (!isEqual$c(newVal, oldVal)) {
|
|
24291
24418
|
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
24292
24419
|
}
|
|
24293
24420
|
}
|
|
@@ -24363,7 +24490,7 @@
|
|
|
24363
24490
|
DynamicRangeSlider.hasInternalComponent = function () {
|
|
24364
24491
|
return true;
|
|
24365
24492
|
};
|
|
24366
|
-
var mapStateToProps$
|
|
24493
|
+
var mapStateToProps$b = function mapStateToProps(state, props) {
|
|
24367
24494
|
var componentId = state.aggregations[props.componentId];
|
|
24368
24495
|
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
24369
24496
|
var options = componentId && componentId[props.dataField];
|
|
@@ -24389,30 +24516,33 @@
|
|
|
24389
24516
|
enableAppbase: state.config.enableAppbase
|
|
24390
24517
|
};
|
|
24391
24518
|
};
|
|
24392
|
-
var mapDispatchtoProps$
|
|
24519
|
+
var mapDispatchtoProps$8 = {
|
|
24393
24520
|
addComponent: addComponent$1,
|
|
24394
24521
|
removeComponent: removeComponent$1,
|
|
24395
|
-
updateQuery: updateQuery$
|
|
24522
|
+
updateQuery: updateQuery$9,
|
|
24396
24523
|
watchComponent: watchComponent$1,
|
|
24397
24524
|
setQueryListener: setQueryListener$1,
|
|
24398
|
-
setQueryOptions: setQueryOptions$
|
|
24525
|
+
setQueryOptions: setQueryOptions$8,
|
|
24399
24526
|
setComponentProps: setComponentProps$1,
|
|
24400
|
-
setCustomQuery: setCustomQuery$
|
|
24527
|
+
setCustomQuery: setCustomQuery$8,
|
|
24401
24528
|
updateComponentProps: updateComponentProps$2
|
|
24402
24529
|
};
|
|
24403
|
-
var RangeConnected = PreferencesConsumer(connect(mapStateToProps$
|
|
24530
|
+
var RangeConnected = PreferencesConsumer(connect(mapStateToProps$b, mapDispatchtoProps$8)(DynamicRangeSlider));
|
|
24531
|
+
RangeConnected.defaultQuery = DynamicRangeSlider.defaultQuery;
|
|
24532
|
+
RangeConnected.parseValue = DynamicRangeSlider.parseValue;
|
|
24533
|
+
RangeConnected.hasInternalComponent = DynamicRangeSlider.hasInternalComponent;
|
|
24404
24534
|
RangeConnected.name = DynamicRangeSlider.name;
|
|
24405
|
-
RangeConnected.install = function (Vue) {
|
|
24406
|
-
Vue.component(RangeConnected.name, RangeConnected);
|
|
24407
|
-
};
|
|
24408
24535
|
|
|
24409
24536
|
// Add componentType for SSR
|
|
24410
24537
|
RangeConnected.componentType = constants_1$1.dynamicRangeSlider;
|
|
24538
|
+
RangeConnected.install = function (Vue) {
|
|
24539
|
+
Vue.component(RangeConnected.name, RangeConnected);
|
|
24540
|
+
};
|
|
24411
24541
|
|
|
24412
|
-
var updateQuery$
|
|
24413
|
-
setQueryOptions$
|
|
24414
|
-
setCustomQuery$
|
|
24415
|
-
var isEqual$
|
|
24542
|
+
var updateQuery$a = lib_5.updateQuery,
|
|
24543
|
+
setQueryOptions$9 = lib_5.setQueryOptions,
|
|
24544
|
+
setCustomQuery$9 = lib_5.setCustomQuery;
|
|
24545
|
+
var isEqual$d = lib_8.isEqual,
|
|
24416
24546
|
checkValueChange$8 = lib_8.checkValueChange,
|
|
24417
24547
|
getClassName$c = lib_8.getClassName,
|
|
24418
24548
|
getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
|
|
@@ -24469,12 +24599,12 @@
|
|
|
24469
24599
|
this.setValue(newVal);
|
|
24470
24600
|
},
|
|
24471
24601
|
value: function value(newVal, oldVal) {
|
|
24472
|
-
if (!isEqual$
|
|
24602
|
+
if (!isEqual$d(newVal, oldVal)) {
|
|
24473
24603
|
this.setValue(newVal);
|
|
24474
24604
|
}
|
|
24475
24605
|
},
|
|
24476
24606
|
selectedValue: function selectedValue(newVal) {
|
|
24477
|
-
if (!isEqual$
|
|
24607
|
+
if (!isEqual$d(this.$data.currentValue, newVal)) {
|
|
24478
24608
|
this.setValue(newVal);
|
|
24479
24609
|
}
|
|
24480
24610
|
},
|
|
@@ -24593,32 +24723,35 @@
|
|
|
24593
24723
|
}
|
|
24594
24724
|
return query;
|
|
24595
24725
|
};
|
|
24596
|
-
var mapStateToProps$
|
|
24726
|
+
var mapStateToProps$c = function mapStateToProps(state, props) {
|
|
24597
24727
|
return {
|
|
24598
24728
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24599
24729
|
componentProps: state.props[props.componentId],
|
|
24600
24730
|
enableAppbase: state.config.enableAppbase
|
|
24601
24731
|
};
|
|
24602
24732
|
};
|
|
24603
|
-
var mapDispatchtoProps$
|
|
24604
|
-
updateQuery: updateQuery$
|
|
24605
|
-
setQueryOptions: setQueryOptions$
|
|
24606
|
-
setCustomQuery: setCustomQuery$
|
|
24733
|
+
var mapDispatchtoProps$9 = {
|
|
24734
|
+
updateQuery: updateQuery$a,
|
|
24735
|
+
setQueryOptions: setQueryOptions$9,
|
|
24736
|
+
setCustomQuery: setCustomQuery$9
|
|
24607
24737
|
};
|
|
24608
|
-
var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
24738
|
+
var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(SingleRange), {
|
|
24609
24739
|
componentType: constants_1$1.singleRange
|
|
24610
24740
|
}));
|
|
24611
24741
|
RangeConnected$1.name = SingleRange.name;
|
|
24742
|
+
RangeConnected$1.defaultQuery = SingleRange.defaultQuery;
|
|
24743
|
+
RangeConnected$1.parseValue = SingleRange.parseValue;
|
|
24744
|
+
RangeConnected$1.hasInternalComponent = SingleRange.hasInternalComponent;
|
|
24612
24745
|
RangeConnected$1.install = function (Vue) {
|
|
24613
24746
|
Vue.component(RangeConnected$1.name, RangeConnected$1);
|
|
24614
24747
|
};
|
|
24615
24748
|
// Add componentType for SSR
|
|
24616
24749
|
RangeConnected$1.componentType = constants_1$1.singleRange;
|
|
24617
24750
|
|
|
24618
|
-
var updateQuery$
|
|
24619
|
-
setQueryOptions$
|
|
24620
|
-
setCustomQuery$
|
|
24621
|
-
var isEqual$
|
|
24751
|
+
var updateQuery$b = lib_5.updateQuery,
|
|
24752
|
+
setQueryOptions$a = lib_5.setQueryOptions,
|
|
24753
|
+
setCustomQuery$a = lib_5.setCustomQuery;
|
|
24754
|
+
var isEqual$e = lib_8.isEqual,
|
|
24622
24755
|
checkValueChange$9 = lib_8.checkValueChange,
|
|
24623
24756
|
getClassName$d = lib_8.getClassName,
|
|
24624
24757
|
getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
|
|
@@ -24744,12 +24877,12 @@
|
|
|
24744
24877
|
this.selectItem(newVal, true, undefined, true);
|
|
24745
24878
|
},
|
|
24746
24879
|
value: function value(newVal, oldVal) {
|
|
24747
|
-
if (!isEqual$
|
|
24880
|
+
if (!isEqual$e(newVal, oldVal)) {
|
|
24748
24881
|
this.selectItem(newVal, true, undefined, true);
|
|
24749
24882
|
}
|
|
24750
24883
|
},
|
|
24751
24884
|
selectedValue: function selectedValue(newVal) {
|
|
24752
|
-
if (!isEqual$
|
|
24885
|
+
if (!isEqual$e(this.$data.currentValue, newVal)) {
|
|
24753
24886
|
var processSelectedValues = newVal ? newVal.map(function (item) {
|
|
24754
24887
|
if (typeof item === 'object' && 'label' in item) {
|
|
24755
24888
|
return item.label;
|
|
@@ -24862,35 +24995,38 @@
|
|
|
24862
24995
|
}
|
|
24863
24996
|
return query;
|
|
24864
24997
|
};
|
|
24865
|
-
var mapStateToProps$
|
|
24998
|
+
var mapStateToProps$d = function mapStateToProps(state, props) {
|
|
24866
24999
|
return {
|
|
24867
25000
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24868
25001
|
componentProps: state.props[props.componentId],
|
|
24869
25002
|
enableAppbase: state.config.enableAppbase
|
|
24870
25003
|
};
|
|
24871
25004
|
};
|
|
24872
|
-
var mapDispatchtoProps$
|
|
24873
|
-
updateQuery: updateQuery$
|
|
24874
|
-
setQueryOptions: setQueryOptions$
|
|
24875
|
-
setCustomQuery: setCustomQuery$
|
|
25005
|
+
var mapDispatchtoProps$a = {
|
|
25006
|
+
updateQuery: updateQuery$b,
|
|
25007
|
+
setQueryOptions: setQueryOptions$a,
|
|
25008
|
+
setCustomQuery: setCustomQuery$a
|
|
24876
25009
|
};
|
|
24877
|
-
var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
25010
|
+
var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(MultiRange), {
|
|
24878
25011
|
componentType: constants_1$1.multiRange
|
|
24879
25012
|
}));
|
|
24880
25013
|
RangeConnected$2.name = MultiRange.name;
|
|
25014
|
+
RangeConnected$2.defaultQuery = MultiRange.defaultQuery;
|
|
25015
|
+
RangeConnected$2.parseValue = MultiRange.parseValue;
|
|
25016
|
+
RangeConnected$2.hasInternalComponent = MultiRange.hasInternalComponent;
|
|
24881
25017
|
RangeConnected$2.install = function (Vue) {
|
|
24882
25018
|
Vue.component(RangeConnected$2.name, RangeConnected$2);
|
|
24883
25019
|
};
|
|
24884
25020
|
// Add componentType for SSR
|
|
24885
25021
|
RangeConnected$2.componentType = constants_1$1.multiRange;
|
|
24886
25022
|
|
|
24887
|
-
var updateQuery$
|
|
24888
|
-
setQueryOptions$
|
|
24889
|
-
setCustomQuery$
|
|
25023
|
+
var updateQuery$c = lib_5.updateQuery,
|
|
25024
|
+
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25025
|
+
setCustomQuery$b = lib_5.setCustomQuery;
|
|
24890
25026
|
var checkValueChange$a = lib_8.checkValueChange,
|
|
24891
25027
|
getClassName$e = lib_8.getClassName,
|
|
24892
25028
|
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
|
|
24893
|
-
isEqual$
|
|
25029
|
+
isEqual$f = lib_8.isEqual;
|
|
24894
25030
|
var RangeSlider = {
|
|
24895
25031
|
name: 'RangeSlider',
|
|
24896
25032
|
components: getComponents(),
|
|
@@ -25004,12 +25140,12 @@
|
|
|
25004
25140
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25005
25141
|
},
|
|
25006
25142
|
value: function value(newVal, oldVal) {
|
|
25007
|
-
if (!isEqual$
|
|
25143
|
+
if (!isEqual$f(newVal, oldVal)) {
|
|
25008
25144
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25009
25145
|
}
|
|
25010
25146
|
},
|
|
25011
25147
|
selectedValue: function selectedValue(newVal) {
|
|
25012
|
-
if (!isEqual$
|
|
25148
|
+
if (!isEqual$f(this.$data.currentValue, newVal)) {
|
|
25013
25149
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25014
25150
|
this.$emit('change', newVal);
|
|
25015
25151
|
}
|
|
@@ -25112,7 +25248,7 @@
|
|
|
25112
25248
|
}
|
|
25113
25249
|
return [];
|
|
25114
25250
|
};
|
|
25115
|
-
var mapStateToProps$
|
|
25251
|
+
var mapStateToProps$e = function mapStateToProps(state, props) {
|
|
25116
25252
|
return {
|
|
25117
25253
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
25118
25254
|
: [],
|
|
@@ -25121,15 +25257,18 @@
|
|
|
25121
25257
|
enableAppbase: state.config.enableAppbase
|
|
25122
25258
|
};
|
|
25123
25259
|
};
|
|
25124
|
-
var mapDispatchtoProps$
|
|
25125
|
-
updateQuery: updateQuery$
|
|
25126
|
-
setQueryOptions: setQueryOptions$
|
|
25127
|
-
setCustomQuery: setCustomQuery$
|
|
25260
|
+
var mapDispatchtoProps$b = {
|
|
25261
|
+
updateQuery: updateQuery$c,
|
|
25262
|
+
setQueryOptions: setQueryOptions$b,
|
|
25263
|
+
setCustomQuery: setCustomQuery$b
|
|
25128
25264
|
};
|
|
25129
|
-
var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
25265
|
+
var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(RangeSlider), {
|
|
25130
25266
|
componentType: constants_1$1.rangeSlider
|
|
25131
25267
|
}));
|
|
25132
25268
|
RangeConnected$3.name = RangeSlider.name;
|
|
25269
|
+
RangeConnected$3.defaultQuery = RangeSlider.defaultQuery;
|
|
25270
|
+
RangeConnected$3.parseValue = RangeSlider.parseValue;
|
|
25271
|
+
RangeConnected$3.hasInternalComponent = RangeSlider.hasInternalComponent;
|
|
25133
25272
|
RangeConnected$3.install = function (Vue) {
|
|
25134
25273
|
Vue.component(RangeConnected$3.name, RangeConnected$3);
|
|
25135
25274
|
};
|
|
@@ -25147,7 +25286,7 @@
|
|
|
25147
25286
|
});
|
|
25148
25287
|
|
|
25149
25288
|
var getClassName$f = lib_8.getClassName,
|
|
25150
|
-
isEqual$
|
|
25289
|
+
isEqual$g = lib_8.isEqual;
|
|
25151
25290
|
var RangeInput = {
|
|
25152
25291
|
name: 'RangeInput',
|
|
25153
25292
|
components: {
|
|
@@ -25225,7 +25364,7 @@
|
|
|
25225
25364
|
},
|
|
25226
25365
|
handleChange: function handleChange(value, event) {
|
|
25227
25366
|
var currentValue = value;
|
|
25228
|
-
if (this.shouldUpdate(value) && !isEqual$
|
|
25367
|
+
if (this.shouldUpdate(value) && !isEqual$g(value, this.currentValue)) {
|
|
25229
25368
|
switch (event) {
|
|
25230
25369
|
case 'change':
|
|
25231
25370
|
if (!value) {
|
|
@@ -25290,7 +25429,7 @@
|
|
|
25290
25429
|
}
|
|
25291
25430
|
},
|
|
25292
25431
|
value: function value(newVal, oldVal) {
|
|
25293
|
-
if (!isEqual$
|
|
25432
|
+
if (!isEqual$g(newVal, oldVal)) {
|
|
25294
25433
|
if (this.isControlled()) {
|
|
25295
25434
|
this.handleChange(newVal, 'change');
|
|
25296
25435
|
}
|
|
@@ -25424,12 +25563,12 @@
|
|
|
25424
25563
|
}, ["Input range is invalid"])])])]);
|
|
25425
25564
|
}
|
|
25426
25565
|
};
|
|
25427
|
-
var mapStateToProps$
|
|
25566
|
+
var mapStateToProps$f = function mapStateToProps(state) {
|
|
25428
25567
|
return {
|
|
25429
25568
|
themePreset: state.config.themePreset
|
|
25430
25569
|
};
|
|
25431
25570
|
};
|
|
25432
|
-
var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
25571
|
+
var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$f, {})(RangeInput), {
|
|
25433
25572
|
componentType: constants_1$1.rangeInput
|
|
25434
25573
|
}));
|
|
25435
25574
|
RangeConnected$4.name = RangeInput.name;
|
|
@@ -25440,304 +25579,14 @@
|
|
|
25440
25579
|
// Add componentType for SSR
|
|
25441
25580
|
RangeConnected$4.componentType = constants_1$1.rangeInput;
|
|
25442
25581
|
|
|
25443
|
-
var
|
|
25444
|
-
var updateQuery$c = lib_5.updateQuery,
|
|
25445
|
-
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25446
|
-
setCustomQuery$b = lib_5.setCustomQuery,
|
|
25447
|
-
setDefaultQuery$7 = lib_5.setDefaultQuery;
|
|
25448
|
-
var parseHits$1 = lib_8.parseHits,
|
|
25449
|
-
isEqual$g = lib_8.isEqual,
|
|
25450
|
-
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
25451
|
-
getResultStats$3 = lib_8.getResultStats,
|
|
25452
|
-
extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
|
|
25453
|
-
getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
|
|
25454
|
-
var ReactiveComponent = {
|
|
25455
|
-
name: 'ReactiveComponent',
|
|
25456
|
-
props: {
|
|
25457
|
-
componentId: types.stringRequired,
|
|
25458
|
-
aggregationField: types.string,
|
|
25459
|
-
aggregationSize: VueTypes.number,
|
|
25460
|
-
size: VueTypes.number,
|
|
25461
|
-
defaultQuery: types.func,
|
|
25462
|
-
customQuery: types.func,
|
|
25463
|
-
filterLabel: types.string,
|
|
25464
|
-
react: types.react,
|
|
25465
|
-
showFilter: VueTypes.bool.def(true),
|
|
25466
|
-
URLParams: VueTypes.bool.def(false),
|
|
25467
|
-
distinctField: types.string,
|
|
25468
|
-
distinctFieldConfig: types.props,
|
|
25469
|
-
index: VueTypes.string,
|
|
25470
|
-
endpoint: types.endpointConfig
|
|
25471
|
-
},
|
|
25472
|
-
created: function created() {
|
|
25473
|
-
var _this = this;
|
|
25474
|
-
var props = this.$props;
|
|
25475
|
-
this.internalComponent = null;
|
|
25476
|
-
this.$defaultQuery = null;
|
|
25477
|
-
// Set custom query in store
|
|
25478
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
25479
|
-
var customQuery = props.customQuery,
|
|
25480
|
-
componentId = props.componentId,
|
|
25481
|
-
filterLabel = props.filterLabel,
|
|
25482
|
-
showFilter = props.showFilter,
|
|
25483
|
-
URLParams = props.URLParams,
|
|
25484
|
-
distinctField = props.distinctField,
|
|
25485
|
-
distinctFieldConfig = props.distinctFieldConfig,
|
|
25486
|
-
index = props.index;
|
|
25487
|
-
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
25488
|
-
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
25489
|
-
}
|
|
25490
|
-
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
25491
|
-
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
25492
|
-
}
|
|
25493
|
-
if (!this.enableAppbase && index) {
|
|
25494
|
-
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
25495
|
-
}
|
|
25496
|
-
if (customQuery) {
|
|
25497
|
-
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
25498
|
-
var query = extractQueryFromCustomQuery$7(calcCustomQuery);
|
|
25499
|
-
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$7(calcCustomQuery) : null;
|
|
25500
|
-
if (customQueryOptions) {
|
|
25501
|
-
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
25502
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
25503
|
-
this.updateQuery({
|
|
25504
|
-
componentId: componentId,
|
|
25505
|
-
query: query,
|
|
25506
|
-
value: this.selectedValue || null,
|
|
25507
|
-
label: filterLabel,
|
|
25508
|
-
showFilter: showFilter,
|
|
25509
|
-
URLParams: URLParams
|
|
25510
|
-
});
|
|
25511
|
-
}
|
|
25512
|
-
this.setQuery = function (_ref) {
|
|
25513
|
-
var options = _ref.options,
|
|
25514
|
-
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25515
|
-
var queryToBeSet = obj.query;
|
|
25516
|
-
|
|
25517
|
-
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
25518
|
-
if (queryToBeSet && queryToBeSet.query) {
|
|
25519
|
-
queryToBeSet = queryToBeSet.query;
|
|
25520
|
-
}
|
|
25521
|
-
var customQueryCalc = _extends({}, options, {
|
|
25522
|
-
query: queryToBeSet
|
|
25523
|
-
});
|
|
25524
|
-
var rsAPIQuery = customQueryCalc;
|
|
25525
|
-
// handle stored queries
|
|
25526
|
-
if (queryToBeSet && queryToBeSet.id) {
|
|
25527
|
-
rsAPIQuery = queryToBeSet;
|
|
25528
|
-
}
|
|
25529
|
-
// Update customQuery field for RS API
|
|
25530
|
-
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
25531
|
-
if (options) {
|
|
25532
|
-
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
25533
|
-
}
|
|
25534
|
-
_this.updateQuery(_extends({}, obj, {
|
|
25535
|
-
query: customQueryCalc.query,
|
|
25536
|
-
componentId: props.componentId,
|
|
25537
|
-
label: props.filterLabel,
|
|
25538
|
-
showFilter: props.showFilter,
|
|
25539
|
-
URLParams: props.URLParams
|
|
25540
|
-
}));
|
|
25541
|
-
};
|
|
25542
|
-
if (props.defaultQuery) {
|
|
25543
|
-
this.internalComponent = props.componentId + "__internal";
|
|
25544
|
-
}
|
|
25545
|
-
if (this.internalComponent && this.$props.defaultQuery) {
|
|
25546
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
25547
|
-
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
25548
|
-
var _query = extractQueryFromCustomQuery$7(this.$defaultQuery);
|
|
25549
|
-
var queryOptions = getOptionsForCustomQuery$7(this.$defaultQuery);
|
|
25550
|
-
if (queryOptions) {
|
|
25551
|
-
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25552
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
25553
|
-
this.updateQuery({
|
|
25554
|
-
componentId: this.internalComponent,
|
|
25555
|
-
query: _query
|
|
25556
|
-
});
|
|
25557
|
-
}
|
|
25558
|
-
},
|
|
25559
|
-
watch: {
|
|
25560
|
-
hits: function hits(newVal, oldVal) {
|
|
25561
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25562
|
-
this.$emit('data', this.getData());
|
|
25563
|
-
}
|
|
25564
|
-
},
|
|
25565
|
-
rawData: function rawData(newVal, oldVal) {
|
|
25566
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25567
|
-
this.$emit('data', this.getData());
|
|
25568
|
-
}
|
|
25569
|
-
},
|
|
25570
|
-
aggregations: function aggregations(newVal, oldVal) {
|
|
25571
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25572
|
-
this.$emit('data', this.getData());
|
|
25573
|
-
}
|
|
25574
|
-
},
|
|
25575
|
-
aggregationData: function aggregationData(newVal, oldVal) {
|
|
25576
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25577
|
-
this.$emit('data', this.getData());
|
|
25578
|
-
}
|
|
25579
|
-
},
|
|
25580
|
-
promotedResults: function promotedResults(newVal, oldVal) {
|
|
25581
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25582
|
-
this.$emit('data', this.getData());
|
|
25583
|
-
}
|
|
25584
|
-
},
|
|
25585
|
-
hidden: function hidden(newVal, oldVal) {
|
|
25586
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25587
|
-
this.$emit('data', this.getData());
|
|
25588
|
-
}
|
|
25589
|
-
},
|
|
25590
|
-
total: function total(newVal, oldVal) {
|
|
25591
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25592
|
-
this.$emit('data', this.getData());
|
|
25593
|
-
}
|
|
25594
|
-
},
|
|
25595
|
-
time: function time(newVal, oldVal) {
|
|
25596
|
-
if (!isEqual$g(newVal, oldVal)) {
|
|
25597
|
-
this.$emit('data', this.getData());
|
|
25598
|
-
}
|
|
25599
|
-
},
|
|
25600
|
-
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
25601
|
-
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
25602
|
-
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
25603
|
-
var query = extractQueryFromCustomQuery$7(this.$defaultQuery);
|
|
25604
|
-
var queryOptions = getOptionsForCustomQuery$7(this.$defaultQuery);
|
|
25605
|
-
if (queryOptions) {
|
|
25606
|
-
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25607
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
25608
|
-
// Update default query for RS API
|
|
25609
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
25610
|
-
this.updateQuery({
|
|
25611
|
-
componentId: this.internalComponent,
|
|
25612
|
-
query: query
|
|
25613
|
-
});
|
|
25614
|
-
}
|
|
25615
|
-
},
|
|
25616
|
-
customQuery: function customQuery(newVal, oldVal) {
|
|
25617
|
-
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
25618
|
-
var componentId = this.$props.componentId;
|
|
25619
|
-
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
25620
|
-
var query = extractQueryFromCustomQuery$7(this.$customQuery);
|
|
25621
|
-
var queryOptions = getOptionsForCustomQuery$7(this.$customQuery);
|
|
25622
|
-
if (queryOptions) {
|
|
25623
|
-
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
25624
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
25625
|
-
|
|
25626
|
-
// Update custom query for RS API
|
|
25627
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
25628
|
-
this.updateQuery({
|
|
25629
|
-
componentId: componentId,
|
|
25630
|
-
query: query
|
|
25631
|
-
});
|
|
25632
|
-
}
|
|
25633
|
-
}
|
|
25634
|
-
},
|
|
25635
|
-
render: function render() {
|
|
25636
|
-
var h = arguments[0];
|
|
25637
|
-
try {
|
|
25638
|
-
var dom = this.$scopedSlots["default"];
|
|
25639
|
-
var error = this.error,
|
|
25640
|
-
isLoading = this.isLoading,
|
|
25641
|
-
selectedValue = this.selectedValue;
|
|
25642
|
-
var propsToBePassed = _extends({
|
|
25643
|
-
error: error,
|
|
25644
|
-
loading: isLoading
|
|
25645
|
-
}, this.getData(), {
|
|
25646
|
-
value: selectedValue,
|
|
25647
|
-
setQuery: this.setQuery
|
|
25648
|
-
});
|
|
25649
|
-
return h("div", [dom(propsToBePassed)]);
|
|
25650
|
-
} catch (e) {
|
|
25651
|
-
return null;
|
|
25652
|
-
}
|
|
25653
|
-
},
|
|
25654
|
-
methods: {
|
|
25655
|
-
getAggsQuery: function getAggsQuery() {
|
|
25656
|
-
if (this.aggregationField) {
|
|
25657
|
-
return {
|
|
25658
|
-
aggs: getCompositeAggsQuery$5({
|
|
25659
|
-
props: this.$props,
|
|
25660
|
-
showTopHits: true,
|
|
25661
|
-
value: this.selectedValue
|
|
25662
|
-
}).aggs
|
|
25663
|
-
};
|
|
25664
|
-
}
|
|
25665
|
-
return {};
|
|
25666
|
-
},
|
|
25667
|
-
getData: function getData() {
|
|
25668
|
-
var hits = this.hits,
|
|
25669
|
-
aggregations = this.aggregations,
|
|
25670
|
-
aggregationData = this.aggregationData,
|
|
25671
|
-
promotedResults = this.promotedResults,
|
|
25672
|
-
rawData = this.rawData;
|
|
25673
|
-
var filteredResults = parseHits$1(hits);
|
|
25674
|
-
if (promotedResults.length) {
|
|
25675
|
-
var ids = promotedResults.map(function (item) {
|
|
25676
|
-
return item._id;
|
|
25677
|
-
}).filter(Boolean);
|
|
25678
|
-
if (ids) {
|
|
25679
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
25680
|
-
return !ids.includes(item._id);
|
|
25681
|
-
});
|
|
25682
|
-
}
|
|
25683
|
-
filteredResults = [].concat(promotedResults, filteredResults);
|
|
25684
|
-
}
|
|
25685
|
-
return {
|
|
25686
|
-
data: filteredResults,
|
|
25687
|
-
aggregationData: aggregationData,
|
|
25688
|
-
rawData: rawData,
|
|
25689
|
-
aggregations: aggregations,
|
|
25690
|
-
promotedData: promotedResults,
|
|
25691
|
-
resultStats: this.stats
|
|
25692
|
-
};
|
|
25693
|
-
}
|
|
25694
|
-
},
|
|
25695
|
-
computed: {
|
|
25696
|
-
stats: function stats() {
|
|
25697
|
-
return getResultStats$3(this);
|
|
25698
|
-
}
|
|
25699
|
-
}
|
|
25700
|
-
};
|
|
25701
|
-
ReactiveComponent.hasInternalComponent = function (props) {
|
|
25702
|
-
return !!props.defaultQuery;
|
|
25703
|
-
};
|
|
25704
|
-
var mapStateToProps$f = function mapStateToProps(state, props) {
|
|
25705
|
-
return {
|
|
25706
|
-
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
25707
|
-
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
25708
|
-
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
25709
|
-
rawData: state.rawData[props.componentId],
|
|
25710
|
-
error: state.error[props.componentId],
|
|
25711
|
-
isLoading: state.isLoading[props.componentId],
|
|
25712
|
-
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
25713
|
-
promotedResults: state.promotedResults[props.componentId] || [],
|
|
25714
|
-
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
25715
|
-
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
25716
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
25717
|
-
componentProps: state.props[props.componentId],
|
|
25718
|
-
enableAppbase: state.config.enableAppbase
|
|
25719
|
-
};
|
|
25720
|
-
};
|
|
25721
|
-
var mapDispatchtoProps$b = {
|
|
25722
|
-
setQueryOptions: setQueryOptions$b,
|
|
25723
|
-
updateQuery: updateQuery$c,
|
|
25724
|
-
setCustomQuery: setCustomQuery$b,
|
|
25725
|
-
setDefaultQuery: setDefaultQuery$7
|
|
25726
|
-
};
|
|
25727
|
-
var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$f, mapDispatchtoProps$b)(ReactiveComponent), {
|
|
25728
|
-
componentType: constants_1$1.reactiveComponent
|
|
25729
|
-
});
|
|
25730
|
-
var RcConnected = PreferencesConsumer({
|
|
25582
|
+
var RcConnected$1 = PreferencesConsumer({
|
|
25731
25583
|
name: 'RcConnected',
|
|
25732
25584
|
render: function render(h) {
|
|
25733
|
-
var component =
|
|
25585
|
+
var component = RcConnected;
|
|
25734
25586
|
switch (this.$attrs.componentType) {
|
|
25735
25587
|
case constants_1$1.reactiveList:
|
|
25736
25588
|
component = RLConnected;
|
|
25737
25589
|
break;
|
|
25738
|
-
case constants_1$1.dataSearch:
|
|
25739
|
-
component = DSConnected;
|
|
25740
|
-
break;
|
|
25741
25590
|
case constants_1$1.searchBox:
|
|
25742
25591
|
component = SBConnected;
|
|
25743
25592
|
break;
|
|
@@ -25783,13 +25632,13 @@
|
|
|
25783
25632
|
});
|
|
25784
25633
|
}
|
|
25785
25634
|
});
|
|
25786
|
-
RcConnected.name =
|
|
25787
|
-
RcConnected.
|
|
25788
|
-
Vue.component(RcConnected.name, RcConnected);
|
|
25789
|
-
};
|
|
25790
|
-
|
|
25635
|
+
RcConnected$1.name = 'ReactiveComponentPrivate';
|
|
25636
|
+
RcConnected$1.hasInternalComponent = RcConnected.hasInternalComponent;
|
|
25791
25637
|
// Add componentType for SSR
|
|
25792
|
-
RcConnected.componentType = constants_1$1.reactiveComponent;
|
|
25638
|
+
RcConnected$1.componentType = constants_1$1.reactiveComponent;
|
|
25639
|
+
RcConnected$1.install = function (Vue) {
|
|
25640
|
+
Vue.component(RcConnected$1.name, RcConnected$1);
|
|
25641
|
+
};
|
|
25793
25642
|
|
|
25794
25643
|
var setValue$2 = lib_5.setValue,
|
|
25795
25644
|
clearValues = lib_5.clearValues,
|
|
@@ -25952,10 +25801,10 @@
|
|
|
25952
25801
|
setValue: setValue$2,
|
|
25953
25802
|
resetValuesToDefault: resetValuesToDefault
|
|
25954
25803
|
};
|
|
25955
|
-
var RcConnected$
|
|
25956
|
-
RcConnected$
|
|
25957
|
-
RcConnected$
|
|
25958
|
-
Vue.component(RcConnected$
|
|
25804
|
+
var RcConnected$2 = connect(mapStateToProps$g, mapDispatchtoProps$c)(SelectedFilters);
|
|
25805
|
+
RcConnected$2.name = SelectedFilters.name;
|
|
25806
|
+
RcConnected$2.install = function (Vue) {
|
|
25807
|
+
Vue.component(RcConnected$2.name, RcConnected$2);
|
|
25959
25808
|
};
|
|
25960
25809
|
|
|
25961
25810
|
var ResultCardTitle = {
|
|
@@ -32460,6 +32309,7 @@
|
|
|
32460
32309
|
URLParams: VueTypes.bool,
|
|
32461
32310
|
autoCenter: VueTypes.bool,
|
|
32462
32311
|
getMapRef: VueTypes.func.isRequired,
|
|
32312
|
+
getMapPromise: VueTypes.func,
|
|
32463
32313
|
center: types.location,
|
|
32464
32314
|
defaultCenter: types.location,
|
|
32465
32315
|
defaultPin: types.string,
|
|
@@ -32527,32 +32377,37 @@
|
|
|
32527
32377
|
}
|
|
32528
32378
|
},
|
|
32529
32379
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
32380
|
+
var _this = this;
|
|
32530
32381
|
if (!isQueryIdentical(newVal, oldVal, null, this.$props)) {
|
|
32531
|
-
|
|
32532
|
-
|
|
32533
|
-
|
|
32534
|
-
|
|
32535
|
-
|
|
32536
|
-
|
|
32537
|
-
|
|
32538
|
-
|
|
32539
|
-
|
|
32540
|
-
|
|
32541
|
-
|
|
32542
|
-
|
|
32543
|
-
|
|
32544
|
-
|
|
32545
|
-
|
|
32546
|
-
|
|
32547
|
-
|
|
32548
|
-
|
|
32549
|
-
|
|
32550
|
-
|
|
32551
|
-
|
|
32552
|
-
|
|
32553
|
-
|
|
32554
|
-
|
|
32555
|
-
|
|
32382
|
+
this.getMapPromise().then(function () {
|
|
32383
|
+
var options = getQueryOptions$5(_this.$props);
|
|
32384
|
+
options.from = 0;
|
|
32385
|
+
_this.$defaultQuery = newVal(null, _this.$props);
|
|
32386
|
+
// Update default query to include the geo bounding box query
|
|
32387
|
+
_this.setDefaultQueryForRSAPI();
|
|
32388
|
+
if (_this.$defaultQuery) {
|
|
32389
|
+
var _ref = _this.$defaultQuery || {},
|
|
32390
|
+
sort = _ref.sort,
|
|
32391
|
+
query = _ref.query;
|
|
32392
|
+
if (sort) {
|
|
32393
|
+
options.sort = _this.$defaultQuery.sort;
|
|
32394
|
+
}
|
|
32395
|
+
var queryOptions = getOptionsFromQuery$4(_this.$defaultQuery);
|
|
32396
|
+
if (queryOptions) {
|
|
32397
|
+
options = _extends({}, options, getOptionsFromQuery$4(_this.$defaultQuery));
|
|
32398
|
+
}
|
|
32399
|
+
// Update calculated default query in store
|
|
32400
|
+
_this.setQueryOptions(_this.$props.componentId, options, false);
|
|
32401
|
+
var persistMapQuery = true;
|
|
32402
|
+
var forceExecute = true;
|
|
32403
|
+
var meta = {
|
|
32404
|
+
mapBoxBounds: _this.mapBoxBounds
|
|
32405
|
+
};
|
|
32406
|
+
_this.setMapData(_this.componentId, query, persistMapQuery, forceExecute, meta);
|
|
32407
|
+
_this.currentPageState = 0;
|
|
32408
|
+
_this.from = 0;
|
|
32409
|
+
}
|
|
32410
|
+
});
|
|
32556
32411
|
}
|
|
32557
32412
|
},
|
|
32558
32413
|
promotedResults: function promotedResults(newVal, oldVal) {
|
|
@@ -32580,7 +32435,7 @@
|
|
|
32580
32435
|
}
|
|
32581
32436
|
},
|
|
32582
32437
|
rawData: function rawData(newVal, oldVal) {
|
|
32583
|
-
var
|
|
32438
|
+
var _this2 = this;
|
|
32584
32439
|
if (!isEqual$h(newVal, oldVal)) {
|
|
32585
32440
|
var promotedResults = this.promotedResults,
|
|
32586
32441
|
hits = this.hits;
|
|
@@ -32599,10 +32454,10 @@
|
|
|
32599
32454
|
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
32600
32455
|
}
|
|
32601
32456
|
filteredResults = filteredResults.filter(function (item) {
|
|
32602
|
-
return !!item[
|
|
32457
|
+
return !!item[_this2.dataField];
|
|
32603
32458
|
}).map(function (item) {
|
|
32604
32459
|
var _extends2;
|
|
32605
|
-
return _extends({}, item, (_extends2 = {}, _extends2[
|
|
32460
|
+
return _extends({}, item, (_extends2 = {}, _extends2[_this2.dataField] = getLocationObject(item[_this2.dataField]), _extends2));
|
|
32606
32461
|
});
|
|
32607
32462
|
this.filteredResults = this.addNoise(filteredResults);
|
|
32608
32463
|
if (this.calculateMarkers) {
|
|
@@ -32647,15 +32502,15 @@
|
|
|
32647
32502
|
return this.parseLocation(MAP_CENTER);
|
|
32648
32503
|
},
|
|
32649
32504
|
addNoise: function addNoise(hits) {
|
|
32650
|
-
var
|
|
32505
|
+
var _this3 = this;
|
|
32651
32506
|
var hitMap = {};
|
|
32652
32507
|
var updatedHits = [];
|
|
32653
32508
|
hits.forEach(function (item) {
|
|
32654
32509
|
var updatedItem = _extends({}, item);
|
|
32655
|
-
var location =
|
|
32510
|
+
var location = _this3.parseLocation(item[_this3.dataField]);
|
|
32656
32511
|
var key = JSON.stringify(location);
|
|
32657
32512
|
var count = hitMap[key] || 0;
|
|
32658
|
-
updatedItem[
|
|
32513
|
+
updatedItem[_this3.dataField] = count ? withDistinctLat(location, count) : location;
|
|
32659
32514
|
updatedHits = [].concat(updatedHits, [updatedItem]);
|
|
32660
32515
|
hitMap[key] = count + 1;
|
|
32661
32516
|
});
|
|
@@ -32668,9 +32523,9 @@
|
|
|
32668
32523
|
return null;
|
|
32669
32524
|
},
|
|
32670
32525
|
getHitsCenter: function getHitsCenter(hits) {
|
|
32671
|
-
var
|
|
32526
|
+
var _this4 = this;
|
|
32672
32527
|
var data = hits.map(function (hit) {
|
|
32673
|
-
return hit[
|
|
32528
|
+
return hit[_this4.dataField];
|
|
32674
32529
|
});
|
|
32675
32530
|
if (data.length) {
|
|
32676
32531
|
var numCoords = data.length;
|
|
@@ -32709,7 +32564,7 @@
|
|
|
32709
32564
|
return false;
|
|
32710
32565
|
},
|
|
32711
32566
|
getCenter: function getCenter(hits) {
|
|
32712
|
-
var
|
|
32567
|
+
var _this5 = this;
|
|
32713
32568
|
if (this.center) {
|
|
32714
32569
|
return this.parseLocation(this.center);
|
|
32715
32570
|
}
|
|
@@ -32717,7 +32572,7 @@
|
|
|
32717
32572
|
if (mapRef && typeof mapRef.getCenter === 'function' && this.$options.preserveCenter) {
|
|
32718
32573
|
var currentCenter = mapRef.getCenter();
|
|
32719
32574
|
setTimeout(function () {
|
|
32720
|
-
|
|
32575
|
+
_this5.$options.preserveCenter = false;
|
|
32721
32576
|
}, 100);
|
|
32722
32577
|
return this.parseLocation({
|
|
32723
32578
|
lat: currentCenter.lat(),
|
|
@@ -32775,12 +32630,14 @@
|
|
|
32775
32630
|
// or whenever searchAsMove is true and the map is dragged
|
|
32776
32631
|
if (executeUpdate || !this.skipBoundingBox && !this.mapBoxBounds) {
|
|
32777
32632
|
this.$defaultQuery = this.getGeoQuery();
|
|
32778
|
-
|
|
32779
|
-
|
|
32780
|
-
|
|
32781
|
-
|
|
32782
|
-
|
|
32783
|
-
|
|
32633
|
+
if (this.$defaultQuery) {
|
|
32634
|
+
var persistMapQuery = !!this.center;
|
|
32635
|
+
var forceExecute = this.searchAsMove;
|
|
32636
|
+
var meta = {
|
|
32637
|
+
mapBoxBounds: this.mapBoxBounds
|
|
32638
|
+
};
|
|
32639
|
+
this.setMapData(this.componentId, this.$defaultQuery, persistMapQuery, forceExecute, meta);
|
|
32640
|
+
}
|
|
32784
32641
|
}
|
|
32785
32642
|
this.skipBoundingBox = false;
|
|
32786
32643
|
},
|
|
@@ -32916,7 +32773,8 @@
|
|
|
32916
32773
|
geo_bounding_box: (_geo_bounding_box = {}, _geo_bounding_box[this.dataField] = boundingBoxCoordinates, _geo_bounding_box)
|
|
32917
32774
|
};
|
|
32918
32775
|
if (this.$defaultQuery) {
|
|
32919
|
-
var
|
|
32776
|
+
var _ref2 = this.$defaultQuery || {},
|
|
32777
|
+
query = _ref2.query;
|
|
32920
32778
|
if (query) {
|
|
32921
32779
|
// adds defaultQuery's query to geo-query
|
|
32922
32780
|
// to generate a map query
|
|
@@ -33053,69 +32911,77 @@
|
|
|
33053
32911
|
this.updateComponentProps(this.internalComponent, {
|
|
33054
32912
|
from: this.from
|
|
33055
32913
|
}, constants_1$1.reactiveMap);
|
|
32914
|
+
this.setDefaultQueryForRSAPI();
|
|
33056
32915
|
},
|
|
33057
32916
|
mounted: function mounted() {
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
|
|
33062
|
-
|
|
33063
|
-
|
|
33064
|
-
|
|
33065
|
-
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
|
|
33071
|
-
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
|
|
33083
|
-
|
|
33084
|
-
|
|
33085
|
-
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
|
|
33093
|
-
|
|
33094
|
-
|
|
33095
|
-
|
|
33096
|
-
|
|
33097
|
-
|
|
33098
|
-
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33102
|
-
|
|
33103
|
-
|
|
33104
|
-
|
|
33105
|
-
|
|
33106
|
-
|
|
33107
|
-
|
|
33108
|
-
|
|
33109
|
-
|
|
33110
|
-
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
|
|
33114
|
-
|
|
33115
|
-
|
|
32917
|
+
var _this6 = this;
|
|
32918
|
+
this.getMapPromise().then(function () {
|
|
32919
|
+
if (_this6.defaultPage < 0 && _this6.currentPage > 0) {
|
|
32920
|
+
if (_this6.$props.URLParams) {
|
|
32921
|
+
_this6.setPageURL(_this6.$props.componentId, _this6.currentPage, _this6.$props.componentId, false, true);
|
|
32922
|
+
}
|
|
32923
|
+
}
|
|
32924
|
+
var options = getQueryOptions$5(_this6.$props);
|
|
32925
|
+
options.from = _this6.$data.from;
|
|
32926
|
+
if (_this6.$props.sortBy) {
|
|
32927
|
+
var _ref3;
|
|
32928
|
+
options.sort = [(_ref3 = {}, _ref3[_this6.$props.dataField] = {
|
|
32929
|
+
order: _this6.$props.sortBy
|
|
32930
|
+
}, _ref3)];
|
|
32931
|
+
}
|
|
32932
|
+
_this6.$defaultQuery = null;
|
|
32933
|
+
if (_this6.$props.defaultQuery) {
|
|
32934
|
+
_this6.$defaultQuery = _this6.$props.defaultQuery();
|
|
32935
|
+
// Update default query for RS API
|
|
32936
|
+
_this6.setDefaultQueryForRSAPI();
|
|
32937
|
+
if (_this6.$defaultQuery) {
|
|
32938
|
+
options = _extends({}, options, getOptionsFromQuery$4(_this6.$defaultQuery));
|
|
32939
|
+
|
|
32940
|
+
// Override sort query with defaultQuery's sort if defined
|
|
32941
|
+
if (_this6.$defaultQuery.sort) {
|
|
32942
|
+
options.sort = _this6.$defaultQuery.sort;
|
|
32943
|
+
}
|
|
32944
|
+
// since we want defaultQuery to be executed anytime
|
|
32945
|
+
// map component's query is being executed
|
|
32946
|
+
var persistMapQuery = true;
|
|
32947
|
+
// no need to forceExecute because setReact() will capture the main query
|
|
32948
|
+
// and execute the defaultQuery along with it
|
|
32949
|
+
var forceExecute = false;
|
|
32950
|
+
var meta = {
|
|
32951
|
+
mapBoxBounds: _this6.mapBoxBounds
|
|
32952
|
+
};
|
|
32953
|
+
if (_this6.$defaultQuery) {
|
|
32954
|
+
_this6.setMapData(_this6.componentId, _this6.$defaultQuery.query, persistMapQuery, forceExecute, meta);
|
|
32955
|
+
_this6.setQueryOptions(_this6.componentId, options);
|
|
32956
|
+
}
|
|
32957
|
+
}
|
|
32958
|
+
} else {
|
|
32959
|
+
// only apply geo-distance when defaultQuery prop is not set
|
|
32960
|
+
var query = _this6.getGeoDistanceQuery();
|
|
32961
|
+
if (query) {
|
|
32962
|
+
// - only persist the map query if center prop is set
|
|
32963
|
+
// - ideally, persist the map query if you want to keep executing it
|
|
32964
|
+
// whenever there is a change (due to subscription) in the component query
|
|
32965
|
+
var _persistMapQuery = !!_this6.center;
|
|
32966
|
+
|
|
32967
|
+
// - forceExecute will make sure that the component query + Map query gets executed
|
|
32968
|
+
// irrespective of the changes in the component query
|
|
32969
|
+
// - forceExecute will only come into play when searchAsMove is true
|
|
32970
|
+
// - kindly note that forceExecute may result in one additional network request
|
|
32971
|
+
// since it bypasses the gatekeeping
|
|
32972
|
+
var _forceExecute = _this6.searchAsMove;
|
|
32973
|
+
// Set meta for `distance` and `coordinates` in selected value
|
|
32974
|
+
var center = _this6.center || _this6.defaultCenter;
|
|
32975
|
+
var coordinatesObject = _this6.getArrPosition(center);
|
|
32976
|
+
var _meta = {
|
|
32977
|
+
distance: _this6.defaultRadius,
|
|
32978
|
+
coordinates: coordinatesObject.lat + ", " + coordinatesObject.lon
|
|
32979
|
+
};
|
|
32980
|
+
_this6.setMapData(_this6.componentId, query, _persistMapQuery, _forceExecute, _meta);
|
|
32981
|
+
}
|
|
32982
|
+
_this6.setQueryOptions(_this6.componentId, options);
|
|
33116
32983
|
}
|
|
33117
|
-
}
|
|
33118
|
-
this.setQueryOptions(this.componentId, options, !(this.$defaultQuery && this.$defaultQuery.query));
|
|
32984
|
+
});
|
|
33119
32985
|
},
|
|
33120
32986
|
render: function render() {
|
|
33121
32987
|
var h = arguments[0];
|
|
@@ -34371,9 +34237,18 @@
|
|
|
34371
34237
|
calculateMarkers: VueTypes.func,
|
|
34372
34238
|
highlightMarkerOnHover: VueTypes.bool.def(true)
|
|
34373
34239
|
},
|
|
34240
|
+
created: function created() {
|
|
34241
|
+
var _this = this;
|
|
34242
|
+
this.mapRefPromiseResolve = null;
|
|
34243
|
+
this.mapRefPromiseRejecter = null;
|
|
34244
|
+
this.mapRefPromise = new Promise(function (resolve, reject) {
|
|
34245
|
+
_this.mapRefPromiseResolver = resolve;
|
|
34246
|
+
_this.mapRefPromiseRejecter = reject;
|
|
34247
|
+
});
|
|
34248
|
+
},
|
|
34374
34249
|
methods: {
|
|
34375
34250
|
renderMap: function renderMap(_ref) {
|
|
34376
|
-
var
|
|
34251
|
+
var _this2 = this;
|
|
34377
34252
|
var resultsToRender = _ref.resultsToRender,
|
|
34378
34253
|
center = _ref.center,
|
|
34379
34254
|
zoom = _ref.zoom,
|
|
@@ -34422,7 +34297,7 @@
|
|
|
34422
34297
|
"highlightMarkerOnHover": this.highlightMarkerOnHover,
|
|
34423
34298
|
"renderItem": this.$scopedSlots.renderItem ? function () {
|
|
34424
34299
|
return {
|
|
34425
|
-
custom:
|
|
34300
|
+
custom: _this2.$scopedSlots.renderItem
|
|
34426
34301
|
};
|
|
34427
34302
|
} : this.renderItem,
|
|
34428
34303
|
"defaultPin": defaultPin,
|
|
@@ -34437,6 +34312,9 @@
|
|
|
34437
34312
|
getMapRef: function getMapRef() {
|
|
34438
34313
|
return this.mapRef;
|
|
34439
34314
|
},
|
|
34315
|
+
getMapRefPromise: function getMapRefPromise() {
|
|
34316
|
+
return this.mapRefPromise;
|
|
34317
|
+
},
|
|
34440
34318
|
removeMarkers: function removeMarkers() {
|
|
34441
34319
|
var clusterManagerInstance;
|
|
34442
34320
|
var currentInstance = this;
|
|
@@ -34457,11 +34335,12 @@
|
|
|
34457
34335
|
}
|
|
34458
34336
|
},
|
|
34459
34337
|
mounted: function mounted() {
|
|
34460
|
-
var
|
|
34338
|
+
var _this3 = this;
|
|
34461
34339
|
if (this.$refs.mapRef) {
|
|
34462
34340
|
this.$refs.mapRef.$mapPromise.then(function (map) {
|
|
34463
|
-
|
|
34464
|
-
|
|
34341
|
+
_this3.mapRef = map;
|
|
34342
|
+
_this3.mapRefPromiseResolver(_this3.mapRef);
|
|
34343
|
+
})["catch"](this.mapRefPromiseRejecter);
|
|
34465
34344
|
}
|
|
34466
34345
|
},
|
|
34467
34346
|
render: function render() {
|
|
@@ -34469,6 +34348,7 @@
|
|
|
34469
34348
|
return h(RMConnected, helper$1([{
|
|
34470
34349
|
"attrs": {
|
|
34471
34350
|
"getMapRef": this.getMapRef,
|
|
34351
|
+
"getMapPromise": this.getMapRefPromise,
|
|
34472
34352
|
"renderMap": this.renderMap,
|
|
34473
34353
|
"componentId": this.componentId,
|
|
34474
34354
|
"className": this.className,
|
|
@@ -34883,7 +34763,6 @@
|
|
|
34883
34763
|
var rawData = {};
|
|
34884
34764
|
var customData = {};
|
|
34885
34765
|
var settingsResponse = {};
|
|
34886
|
-
var timestamp = {};
|
|
34887
34766
|
var allPromises = orderOfQueries.map(function (component) {
|
|
34888
34767
|
return new Promise(function (responseResolve, responseReject) {
|
|
34889
34768
|
handleTransformResponse(res[component], component).then(function (response) {
|
|
@@ -34910,7 +34789,6 @@
|
|
|
34910
34789
|
var _extends6;
|
|
34911
34790
|
aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
|
|
34912
34791
|
}
|
|
34913
|
-
timestamp[component] = res._timestamp;
|
|
34914
34792
|
var hitsObj = response.hits ? response.hits : response[component].hits;
|
|
34915
34793
|
hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
|
|
34916
34794
|
hits: hitsObj.hits,
|
|
@@ -34927,7 +34805,6 @@
|
|
|
34927
34805
|
Promise.all(allPromises).then(function () {
|
|
34928
34806
|
state = _extends({}, state, {
|
|
34929
34807
|
hits: hits,
|
|
34930
|
-
timestamp: timestamp,
|
|
34931
34808
|
aggregations: aggregations,
|
|
34932
34809
|
compositeAggregations: compositeAggregations,
|
|
34933
34810
|
promotedResults: promotedResults,
|
|
@@ -34985,9 +34862,9 @@
|
|
|
34985
34862
|
});
|
|
34986
34863
|
}
|
|
34987
34864
|
|
|
34988
|
-
var version = "1.34.0
|
|
34865
|
+
var version = "1.34.0";
|
|
34989
34866
|
|
|
34990
|
-
var components$1 = [RLConnected, ResultCard, ResultList, ReactiveBase, DSConnected, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
|
|
34867
|
+
var components$1 = [RLConnected, ResultCard, ResultList, ReactiveBase, DSConnected, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
|
|
34991
34868
|
function install (Vue) {
|
|
34992
34869
|
components$1.map(function (component) {
|
|
34993
34870
|
Vue.use(component);
|
|
@@ -35013,12 +34890,13 @@
|
|
|
35013
34890
|
exports.RangeSlider = RangeConnected$3;
|
|
35014
34891
|
exports.ReactiveBase = ReactiveBase;
|
|
35015
34892
|
exports.ReactiveComponent = RcConnected;
|
|
34893
|
+
exports.ReactiveComponentPrivate = RcConnected$1;
|
|
35016
34894
|
exports.ReactiveGoogleMap = ReactiveGoogleMap;
|
|
35017
34895
|
exports.ReactiveList = RLConnected;
|
|
35018
34896
|
exports.ResultCard = ResultCard;
|
|
35019
34897
|
exports.ResultList = ResultList;
|
|
35020
34898
|
exports.SearchBox = SBConnected;
|
|
35021
|
-
exports.SelectedFilters = RcConnected$
|
|
34899
|
+
exports.SelectedFilters = RcConnected$2;
|
|
35022
34900
|
exports.SingleDropdownList = ListConnected$2;
|
|
35023
34901
|
exports.SingleList = ListConnected;
|
|
35024
34902
|
exports.SingleRange = RangeConnected$1;
|