@appbaseio/reactivesearch-vue 1.25.0 → 1.27.0-gamma.2
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 +1822 -512
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{CancelSvg-62d42af4.js → CancelSvg-4aa35935.js} +1 -14
- package/dist/cjs/{ComponentWrapper-32481890.js → ComponentWrapper-10bad289.js} +1 -1
- package/dist/cjs/DataSearch-37dfdf39.js +2154 -0
- package/dist/cjs/DataSearch.js +18 -2101
- package/dist/cjs/{DropDown-5847d6e4.js → DropDown-0076babc.js} +18 -13
- package/dist/cjs/DynamicRangeSlider.js +48 -12
- package/dist/cjs/{Input-3cc3fa59.js → Input-a9ee53ed.js} +1 -1
- package/dist/cjs/MultiDropdownList.js +10 -9
- package/dist/cjs/MultiList.js +19 -14
- package/dist/cjs/MultiRange.js +4 -4
- package/dist/cjs/RangeInput.js +10 -6
- package/dist/cjs/RangeSlider.js +19 -22
- package/dist/cjs/ReactiveBase.js +2 -2
- package/dist/cjs/ReactiveComponent.js +3 -3
- package/dist/cjs/ReactiveList.js +14 -4
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +8 -6
- package/dist/cjs/SingleDropdownList.js +9 -8
- package/dist/cjs/SingleList.js +6 -6
- package/dist/cjs/SingleRange.js +4 -4
- package/dist/cjs/StateProvider.js +7 -3
- package/dist/cjs/ToggleButton.js +4 -4
- package/dist/cjs/{index-89c39a9e.js → index-4509aa45.js} +10 -4
- package/dist/cjs/index.js +14 -13
- package/dist/cjs/install-d95c7185.js +1204 -0
- package/dist/cjs/install.js +28 -33
- package/dist/cjs/ssr-0ee35a09.js +39 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-4c19b4c8.js → vueTypes-57d01f18.js} +3 -3
- package/dist/es/{CancelSvg-e0cace2d.js → CancelSvg-c2c03a35.js} +1 -14
- package/dist/es/{ComponentWrapper-4f85a67e.js → ComponentWrapper-0f3431d1.js} +1 -1
- package/dist/es/DataSearch-77325036.js +2141 -0
- package/dist/es/DataSearch.js +17 -2100
- package/dist/es/{DropDown-1ee01031.js → DropDown-0dd8f2a3.js} +18 -13
- package/dist/es/DynamicRangeSlider.js +48 -12
- package/dist/es/{Input-08bb1bcf.js → Input-10b1d62d.js} +1 -1
- package/dist/es/MultiDropdownList.js +10 -9
- package/dist/es/MultiList.js +19 -14
- package/dist/es/MultiRange.js +4 -4
- package/dist/es/RangeInput.js +10 -6
- package/dist/es/RangeSlider.js +19 -22
- package/dist/es/ReactiveBase.js +2 -2
- package/dist/es/ReactiveComponent.js +3 -3
- package/dist/es/ReactiveList.js +14 -4
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +8 -6
- package/dist/es/SingleDropdownList.js +9 -8
- package/dist/es/SingleList.js +6 -6
- package/dist/es/SingleRange.js +4 -4
- package/dist/es/StateProvider.js +7 -3
- package/dist/es/ToggleButton.js +4 -4
- package/dist/es/{index-cb1950b6.js → index-78920565.js} +10 -4
- package/dist/es/index.js +10 -10
- package/dist/es/install-432674ef.js +1197 -0
- package/dist/es/install.js +26 -35
- package/dist/es/ssr-a41dfea9.js +33 -0
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-fb61bb7b.js → vueTypes-687b2304.js} +3 -3
- package/package.json +5 -5
- package/dist/cjs/ssr-08e95ede.js +0 -39
- package/dist/es/ssr-5d255b08.js +0 -33
|
@@ -1351,7 +1351,6 @@
|
|
|
1351
1351
|
}
|
|
1352
1352
|
|
|
1353
1353
|
var defaultAnalyticsConfig = exports.defaultAnalyticsConfig = {
|
|
1354
|
-
searchStateHeader: false,
|
|
1355
1354
|
emptyQuery: true,
|
|
1356
1355
|
suggestionAnalytics: true,
|
|
1357
1356
|
userId: null,
|
|
@@ -1729,7 +1728,19 @@
|
|
|
1729
1728
|
return _extends({}, state, _defineProperty({}, action.component, _extends({}, state[action.component], action.payload)));
|
|
1730
1729
|
|
|
1731
1730
|
case constants.CLEAR_VALUES:
|
|
1732
|
-
|
|
1731
|
+
{
|
|
1732
|
+
if (action.resetValues) {
|
|
1733
|
+
var nextState = {};
|
|
1734
|
+
Object.keys(action.resetValues).forEach(function (componentId) {
|
|
1735
|
+
nextState[componentId] = _extends({}, state[componentId], {
|
|
1736
|
+
value: action.resetValues[componentId]
|
|
1737
|
+
});
|
|
1738
|
+
});
|
|
1739
|
+
return nextState;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
return {};
|
|
1743
|
+
}
|
|
1733
1744
|
|
|
1734
1745
|
case constants.REMOVE_COMPONENT:
|
|
1735
1746
|
{
|
|
@@ -4850,7 +4861,7 @@
|
|
|
4850
4861
|
Object.defineProperty(exports, "__esModule", {
|
|
4851
4862
|
value: true
|
|
4852
4863
|
});
|
|
4853
|
-
exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
|
|
4864
|
+
exports.suggestionTypes = exports.getTopSuggestions = exports.withClickIds = exports.getCompositeAggsQuery = exports.getAggsQuery = exports.extractQueryFromDefaultQuery = exports.updateInternalQuery = exports.getSearchState = exports.getOptionsFromQuery = exports.parseHits = exports.handleA11yAction = exports.getInnerKey = exports.getClassName = exports.checkSomePropChange = exports.checkPropChange = exports.updateDefaultQuery = exports.updateCustomQuery = undefined;
|
|
4854
4865
|
|
|
4855
4866
|
var _extends = Object.assign || function (target) {
|
|
4856
4867
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -5664,37 +5675,45 @@
|
|
|
5664
5675
|
function isValidDateRangeQueryFormat(queryFormat) {
|
|
5665
5676
|
return Object.keys(_dateFormats2["default"]).includes(queryFormat);
|
|
5666
5677
|
}
|
|
5678
|
+
|
|
5679
|
+
var suggestionTypes = exports.suggestionTypes = {
|
|
5680
|
+
Popular: 'popular',
|
|
5681
|
+
Index: 'index',
|
|
5682
|
+
Recent: 'recent',
|
|
5683
|
+
Promoted: 'promoted'
|
|
5684
|
+
};
|
|
5667
5685
|
});
|
|
5668
5686
|
unwrapExports(helper);
|
|
5669
|
-
var helper_1 = helper.
|
|
5670
|
-
var helper_2 = helper.
|
|
5671
|
-
var helper_3 = helper.
|
|
5672
|
-
var helper_4 = helper.
|
|
5673
|
-
var helper_5 = helper.
|
|
5674
|
-
var helper_6 = helper.
|
|
5675
|
-
var helper_7 = helper.
|
|
5676
|
-
var helper_8 = helper.
|
|
5677
|
-
var helper_9 = helper.
|
|
5678
|
-
var helper_10 = helper.
|
|
5679
|
-
var helper_11 = helper.
|
|
5680
|
-
var helper_12 = helper.
|
|
5681
|
-
var helper_13 = helper.
|
|
5682
|
-
var helper_14 = helper.
|
|
5683
|
-
var helper_15 = helper.
|
|
5684
|
-
var helper_16 = helper.
|
|
5685
|
-
var helper_17 = helper.
|
|
5686
|
-
var helper_18 = helper.
|
|
5687
|
-
var helper_19 = helper.
|
|
5688
|
-
var helper_20 = helper.
|
|
5689
|
-
var helper_21 = helper.
|
|
5690
|
-
var helper_22 = helper.
|
|
5691
|
-
var helper_23 = helper.
|
|
5692
|
-
var helper_24 = helper.
|
|
5693
|
-
var helper_25 = helper.
|
|
5694
|
-
var helper_26 = helper.
|
|
5695
|
-
var helper_27 = helper.
|
|
5696
|
-
var helper_28 = helper.
|
|
5697
|
-
var helper_29 = helper.
|
|
5687
|
+
var helper_1 = helper.suggestionTypes;
|
|
5688
|
+
var helper_2 = helper.getTopSuggestions;
|
|
5689
|
+
var helper_3 = helper.withClickIds;
|
|
5690
|
+
var helper_4 = helper.getCompositeAggsQuery;
|
|
5691
|
+
var helper_5 = helper.getAggsQuery;
|
|
5692
|
+
var helper_6 = helper.extractQueryFromDefaultQuery;
|
|
5693
|
+
var helper_7 = helper.updateInternalQuery;
|
|
5694
|
+
var helper_8 = helper.getSearchState;
|
|
5695
|
+
var helper_9 = helper.getOptionsFromQuery;
|
|
5696
|
+
var helper_10 = helper.parseHits;
|
|
5697
|
+
var helper_11 = helper.handleA11yAction;
|
|
5698
|
+
var helper_12 = helper.getInnerKey;
|
|
5699
|
+
var helper_13 = helper.getClassName;
|
|
5700
|
+
var helper_14 = helper.checkSomePropChange;
|
|
5701
|
+
var helper_15 = helper.checkPropChange;
|
|
5702
|
+
var helper_16 = helper.updateDefaultQuery;
|
|
5703
|
+
var helper_17 = helper.updateCustomQuery;
|
|
5704
|
+
var helper_18 = helper.isEqual;
|
|
5705
|
+
var helper_19 = helper.debounce;
|
|
5706
|
+
var helper_20 = helper.getQueryOptions;
|
|
5707
|
+
var helper_21 = helper.buildQuery;
|
|
5708
|
+
var helper_22 = helper.pushToAndClause;
|
|
5709
|
+
var helper_23 = helper.checkValueChange;
|
|
5710
|
+
var helper_24 = helper.getAggsOrder;
|
|
5711
|
+
var helper_25 = helper.formatDate;
|
|
5712
|
+
var helper_26 = helper.getResultStats;
|
|
5713
|
+
var helper_27 = helper.extractFieldsFromSource;
|
|
5714
|
+
var helper_28 = helper.normalizeDataField;
|
|
5715
|
+
var helper_29 = helper.handleOnSuggestions;
|
|
5716
|
+
var helper_30 = helper.isValidDateRangeQueryFormat;
|
|
5698
5717
|
|
|
5699
5718
|
var value = createCommonjsModule(function (module, exports) {
|
|
5700
5719
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5816,8 +5835,10 @@
|
|
|
5816
5835
|
}
|
|
5817
5836
|
|
|
5818
5837
|
function clearValues() {
|
|
5838
|
+
var resetValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5819
5839
|
return {
|
|
5820
|
-
type: constants.CLEAR_VALUES
|
|
5840
|
+
type: constants.CLEAR_VALUES,
|
|
5841
|
+
resetValues: resetValues
|
|
5821
5842
|
};
|
|
5822
5843
|
}
|
|
5823
5844
|
});
|
|
@@ -7384,7 +7405,8 @@
|
|
|
7384
7405
|
execute = true;
|
|
7385
7406
|
}
|
|
7386
7407
|
|
|
7387
|
-
var
|
|
7408
|
+
var componentProps = store.props[component];
|
|
7409
|
+
var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _extends({}, componentProps && componentProps.componentType === constants$1.componentTypes.searchBox ? _extends({}, execute === false ? {
|
|
7388
7410
|
type: constants$1.queryTypes.search
|
|
7389
7411
|
} : {}, calcValues.category ? {
|
|
7390
7412
|
categoryValue: calcValues.category
|
|
@@ -8359,6 +8381,20 @@
|
|
|
8359
8381
|
value: true
|
|
8360
8382
|
});
|
|
8361
8383
|
|
|
8384
|
+
var _extends = Object.assign || function (target) {
|
|
8385
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8386
|
+
var source = arguments[i];
|
|
8387
|
+
|
|
8388
|
+
for (var key in source) {
|
|
8389
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8390
|
+
target[key] = source[key];
|
|
8391
|
+
}
|
|
8392
|
+
}
|
|
8393
|
+
}
|
|
8394
|
+
|
|
8395
|
+
return target;
|
|
8396
|
+
};
|
|
8397
|
+
|
|
8362
8398
|
var _crossFetch2 = _interopRequireDefault(browserPonyfill);
|
|
8363
8399
|
|
|
8364
8400
|
function _interopRequireDefault(obj) {
|
|
@@ -8367,20 +8403,26 @@
|
|
|
8367
8403
|
};
|
|
8368
8404
|
}
|
|
8369
8405
|
|
|
8370
|
-
var fetchGraphQL = function fetchGraphQL(
|
|
8406
|
+
var fetchGraphQL = function fetchGraphQL(requestOptions) {
|
|
8407
|
+
var graphQLUrl = requestOptions.graphQLUrl,
|
|
8408
|
+
url = requestOptions.url,
|
|
8409
|
+
credentials = requestOptions.credentials,
|
|
8410
|
+
app = requestOptions.app,
|
|
8411
|
+
query = requestOptions.query,
|
|
8412
|
+
headers = requestOptions.headers;
|
|
8371
8413
|
var fetchUrl = credentials ? url.replace('//', '//' + credentials + '@') : url;
|
|
8372
8414
|
return (0, _crossFetch2["default"])(graphQLUrl, {
|
|
8373
8415
|
method: 'POST',
|
|
8374
|
-
body: '\n\t\t\tquery{\n\t\t\t\
|
|
8416
|
+
body: '\n\t\t\tquery{\n\t\t\t\telastic77(host: "' + fetchUrl + '"){\n\t\t\t\t\tmsearch(\n\t\t\t\t\t\tindex: "' + app + '"\n\t\t\t\t\t\tbody: ' + JSON.stringify(query.map(function (item) {
|
|
8375
8417
|
return JSON.stringify(item);
|
|
8376
8418
|
})) + '\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t',
|
|
8377
|
-
headers: {
|
|
8419
|
+
headers: _extends({}, headers, {
|
|
8378
8420
|
'Content-Type': 'application/graphql'
|
|
8379
|
-
}
|
|
8421
|
+
})
|
|
8380
8422
|
}).then(function (res) {
|
|
8381
8423
|
return res.json();
|
|
8382
8424
|
}).then(function (jsonRes) {
|
|
8383
|
-
return jsonRes.data.
|
|
8425
|
+
return jsonRes.data.elastic77.msearch;
|
|
8384
8426
|
})["catch"](function (error) {
|
|
8385
8427
|
console.error(error);
|
|
8386
8428
|
});
|
|
@@ -8490,6 +8532,15 @@
|
|
|
8490
8532
|
};
|
|
8491
8533
|
}
|
|
8492
8534
|
|
|
8535
|
+
var handleTransformRequest = function handleTransformRequest(transformRequest, res) {
|
|
8536
|
+
if (transformRequest && typeof transformRequest === 'function') {
|
|
8537
|
+
var transformRequestPromise = transformRequest(res);
|
|
8538
|
+
return transformRequestPromise instanceof Promise ? transformRequestPromise : Promise.resolve(transformRequestPromise);
|
|
8539
|
+
}
|
|
8540
|
+
|
|
8541
|
+
return Promise.resolve(res);
|
|
8542
|
+
};
|
|
8543
|
+
|
|
8493
8544
|
function msearch(query, orderOfQueries) {
|
|
8494
8545
|
var appendToHits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8495
8546
|
var isInternalComponent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
@@ -8540,14 +8591,6 @@
|
|
|
8540
8591
|
}
|
|
8541
8592
|
}
|
|
8542
8593
|
|
|
8543
|
-
if (config.analyticsConfig.searchStateHeader) {
|
|
8544
|
-
var searchState = (0, helper.getSearchState)(getState(), true);
|
|
8545
|
-
|
|
8546
|
-
if (searchState && Object.keys(searchState).length) {
|
|
8547
|
-
searchHeaders['X-Search-State'] = JSON.stringify(searchState);
|
|
8548
|
-
}
|
|
8549
|
-
}
|
|
8550
|
-
|
|
8551
8594
|
if (config.analyticsConfig.userId) {
|
|
8552
8595
|
searchHeaders['X-User-Id'] = config.analyticsConfig.userId;
|
|
8553
8596
|
}
|
|
@@ -8563,14 +8606,29 @@
|
|
|
8563
8606
|
});
|
|
8564
8607
|
|
|
8565
8608
|
if (config.graphQLUrl) {
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8609
|
+
var requestOptions = {
|
|
8610
|
+
graphQLUrl: config.graphQLUrl,
|
|
8611
|
+
url: config.url,
|
|
8612
|
+
credentials: config.credentials,
|
|
8613
|
+
app: config.app,
|
|
8614
|
+
query: query,
|
|
8615
|
+
headers: headers
|
|
8616
|
+
};
|
|
8617
|
+
handleTransformRequest(appbaseRef.transformRequest, requestOptions).then(function (modifiedRequest) {
|
|
8618
|
+
(0, _graphQL2["default"])(modifiedRequest).then(function (res) {
|
|
8619
|
+
(0, utils.handleResponseMSearch)({
|
|
8620
|
+
res: res,
|
|
8621
|
+
isSuggestionsQuery: isSuggestionsQuery,
|
|
8622
|
+
orderOfQueries: orderOfQueries,
|
|
8623
|
+
appendToHits: appendToHits,
|
|
8624
|
+
appendToAggs: appendToAggs
|
|
8625
|
+
}, getState, dispatch);
|
|
8626
|
+
})["catch"](function (err) {
|
|
8627
|
+
(0, utils.handleError)({
|
|
8628
|
+
orderOfQueries: orderOfQueries,
|
|
8629
|
+
error: err
|
|
8630
|
+
}, getState, dispatch);
|
|
8631
|
+
});
|
|
8574
8632
|
})["catch"](function (err) {
|
|
8575
8633
|
(0, utils.handleError)({
|
|
8576
8634
|
orderOfQueries: orderOfQueries,
|
|
@@ -8767,7 +8825,7 @@
|
|
|
8767
8825
|
var isInternalComponent = componentId.endsWith('__internal');
|
|
8768
8826
|
var mainComponentProps = props[componentId];
|
|
8769
8827
|
|
|
8770
|
-
if (isInternalComponent && (0, transform.isSearchComponent)(mainComponentProps.componentType)) {
|
|
8828
|
+
if (isInternalComponent && mainComponentProps && (0, transform.isSearchComponent)(mainComponentProps.componentType)) {
|
|
8771
8829
|
value$1 = internalValues[componentId] && internalValues[componentId].value;
|
|
8772
8830
|
}
|
|
8773
8831
|
|
|
@@ -12846,19 +12904,19 @@
|
|
|
12846
12904
|
unit: VueTypes.oneOf(['mi', 'miles', 'yd', 'yards', 'ft', 'feet', 'in', 'inch', 'km', 'kilometers', 'm', 'meters', 'cm', 'centimeters', 'mm', 'millimeters', 'NM', 'nmi', 'nauticalmiles']),
|
|
12847
12905
|
value: VueTypes.string.def(undefined),
|
|
12848
12906
|
analyticsConfig: VueTypes.shape({
|
|
12849
|
-
searchStateHeader: VueTypes.bool,
|
|
12850
12907
|
emptyQuery: VueTypes.bool,
|
|
12851
12908
|
suggestionAnalytics: VueTypes.bool,
|
|
12852
12909
|
userId: VueTypes.string,
|
|
12853
12910
|
customEvents: VueTypes.object
|
|
12854
12911
|
}),
|
|
12855
12912
|
appbaseConfig: VueTypes.shape({
|
|
12856
|
-
enableQueryRules: VueTypes.bool,
|
|
12857
12913
|
recordAnalytics: VueTypes.bool,
|
|
12858
|
-
searchStateHeader: VueTypes.bool,
|
|
12859
12914
|
emptyQuery: VueTypes.bool,
|
|
12860
12915
|
suggestionAnalytics: VueTypes.bool,
|
|
12916
|
+
enableQueryRules: VueTypes.bool,
|
|
12917
|
+
enableSearchRelevancy: VueTypes.bool,
|
|
12861
12918
|
userId: VueTypes.string,
|
|
12919
|
+
useCache: VueTypes.bool,
|
|
12862
12920
|
customEvents: VueTypes.object,
|
|
12863
12921
|
enableTelemetry: VueTypes.bool.def(true)
|
|
12864
12922
|
}).def({}),
|
|
@@ -13206,10 +13264,16 @@
|
|
|
13206
13264
|
}; // parses current array (i.e. this.$props.value) for `onChange` callback for multi-* components
|
|
13207
13265
|
|
|
13208
13266
|
function parseValueArray(objectValues, currentValue) {
|
|
13209
|
-
var
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13267
|
+
var selectedValues;
|
|
13268
|
+
|
|
13269
|
+
if (Array.isArray(objectValues)) {
|
|
13270
|
+
selectedValues = [].concat(objectValues);
|
|
13271
|
+
} else {
|
|
13272
|
+
var keys = Object.keys(objectValues);
|
|
13273
|
+
selectedValues = keys.map(function (key) {
|
|
13274
|
+
return objectValues[key] ? key : null;
|
|
13275
|
+
});
|
|
13276
|
+
}
|
|
13213
13277
|
|
|
13214
13278
|
if (selectedValues.includes(currentValue)) {
|
|
13215
13279
|
return selectedValues.filter(function (item) {
|
|
@@ -14024,6 +14088,12 @@
|
|
|
14024
14088
|
});
|
|
14025
14089
|
}
|
|
14026
14090
|
|
|
14091
|
+
if (this.urlSortOption) {
|
|
14092
|
+
this.sortOptionIndex = this.$props.sortOptions.findIndex(function (s) {
|
|
14093
|
+
return s.label === _this.urlSortOption;
|
|
14094
|
+
}) || 0;
|
|
14095
|
+
}
|
|
14096
|
+
|
|
14027
14097
|
this.updateComponentProps(this.componentId, {
|
|
14028
14098
|
from: this.from
|
|
14029
14099
|
}, constants_1$1.reactiveList);
|
|
@@ -14114,7 +14184,7 @@
|
|
|
14114
14184
|
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
14115
14185
|
}
|
|
14116
14186
|
|
|
14117
|
-
return
|
|
14187
|
+
return helper_3(filteredResults);
|
|
14118
14188
|
}
|
|
14119
14189
|
},
|
|
14120
14190
|
watch: {
|
|
@@ -14332,7 +14402,7 @@
|
|
|
14332
14402
|
"labelPosition": this.sortOptions ? 'right' : 'left'
|
|
14333
14403
|
},
|
|
14334
14404
|
"class": getClassName$1(this.$props.innerClass, 'resultsInfo')
|
|
14335
|
-
}, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading &&
|
|
14405
|
+
}, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && hits && hits.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
|
|
14336
14406
|
"attrs": {
|
|
14337
14407
|
"pages": this.$props.pages,
|
|
14338
14408
|
"totalPages": this.totalPages,
|
|
@@ -14540,8 +14610,11 @@
|
|
|
14540
14610
|
sortBy: sortBy
|
|
14541
14611
|
}, constants_1$1.reactiveList);
|
|
14542
14612
|
this.setQueryOptions(this.$props.componentId, options, true);
|
|
14613
|
+
this.setPage(0);
|
|
14543
14614
|
this.currentPageState = 0;
|
|
14544
14615
|
this.from = 0;
|
|
14616
|
+
var sortOption = this.$props.sortOptions[this.sortOptionIndex] ? this.$props.sortOptions[this.sortOptionIndex].label : null;
|
|
14617
|
+
this.setPageURL(this.$props.componentId + "sortOption", sortOption, this.$props.componentId + "sortOption", false, this.$props.URLParams);
|
|
14545
14618
|
}
|
|
14546
14619
|
},
|
|
14547
14620
|
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
@@ -14653,6 +14726,7 @@
|
|
|
14653
14726
|
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
14654
14727
|
return {
|
|
14655
14728
|
defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
|
|
14729
|
+
urlSortOption: state.selectedValues[props.componentId + "sortOption"] && state.selectedValues[props.componentId + "sortOption"].value,
|
|
14656
14730
|
hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
14657
14731
|
rawData: state.rawData[props.componentId],
|
|
14658
14732
|
aggregationData: state.compositeAggregations[props.componentId],
|
|
@@ -17087,14 +17161,14 @@
|
|
|
17087
17161
|
this.updateState(this.$props);
|
|
17088
17162
|
},
|
|
17089
17163
|
analyticsConfig: function analyticsConfig(newVal, oldVal) {
|
|
17090
|
-
if (!
|
|
17164
|
+
if (!helper_18(newVal, oldVal)) {
|
|
17091
17165
|
if (this.store) {
|
|
17092
17166
|
this.store.dispatch(analytics_3$1(newVal));
|
|
17093
17167
|
}
|
|
17094
17168
|
}
|
|
17095
17169
|
},
|
|
17096
17170
|
appbaseConfig: function appbaseConfig(newVal, oldVal) {
|
|
17097
|
-
if (!
|
|
17171
|
+
if (!helper_18(newVal, oldVal)) {
|
|
17098
17172
|
if (this.store) {
|
|
17099
17173
|
this.store.dispatch(analytics_3$1(newVal));
|
|
17100
17174
|
}
|
|
@@ -17871,7 +17945,7 @@
|
|
|
17871
17945
|
});
|
|
17872
17946
|
|
|
17873
17947
|
var suggestions$1 = function suggestions(themePreset, theme) {
|
|
17874
|
-
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 395px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark$1(theme));
|
|
17948
|
+
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 395px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark$1(theme));
|
|
17875
17949
|
};
|
|
17876
17950
|
|
|
17877
17951
|
var suggestionsContainer = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
@@ -18027,8 +18101,7 @@
|
|
|
18027
18101
|
internal_isOpen: false,
|
|
18028
18102
|
internal_inputValue: '',
|
|
18029
18103
|
internal_selectedItem: null,
|
|
18030
|
-
internal_highlightedIndex: null
|
|
18031
|
-
internal_eventsCalled: {}
|
|
18104
|
+
internal_highlightedIndex: null
|
|
18032
18105
|
};
|
|
18033
18106
|
},
|
|
18034
18107
|
computed: {
|
|
@@ -18213,23 +18286,11 @@
|
|
|
18213
18286
|
}
|
|
18214
18287
|
|
|
18215
18288
|
var vm = this;
|
|
18216
|
-
setTimeout(function () {
|
|
18217
|
-
vm.internal_eventsCalled[index] = false;
|
|
18218
|
-
}, 0);
|
|
18219
18289
|
return {
|
|
18220
18290
|
mouseenter: function mouseenter() {
|
|
18221
18291
|
vm.setHighlightedIndex(newIndex);
|
|
18222
18292
|
},
|
|
18223
|
-
// for browsers not supporting click event (e.g. firefox android)
|
|
18224
|
-
mousedown: function mousedown(event) {
|
|
18225
|
-
if (vm.internal_eventsCalled[index]) return;
|
|
18226
|
-
vm.internal_eventsCalled[index] = true;
|
|
18227
|
-
event.stopPropagation();
|
|
18228
|
-
vm.selectItemAtIndex(newIndex);
|
|
18229
|
-
},
|
|
18230
18293
|
click: function click(event) {
|
|
18231
|
-
if (vm.internal_eventsCalled[index]) return;
|
|
18232
|
-
vm.internal_eventsCalled[index] = true;
|
|
18233
18294
|
event.stopPropagation();
|
|
18234
18295
|
vm.selectItemAtIndex(newIndex);
|
|
18235
18296
|
}
|
|
@@ -18924,19 +18985,22 @@
|
|
|
18924
18985
|
title = _this$suggestion.title,
|
|
18925
18986
|
description = _this$suggestion.description,
|
|
18926
18987
|
image = _this$suggestion.image,
|
|
18927
|
-
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion
|
|
18988
|
+
isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
|
|
18989
|
+
_suggestion_type = _this$suggestion._suggestion_type,
|
|
18990
|
+
_category = _this$suggestion._category;
|
|
18928
18991
|
|
|
18929
18992
|
if (label) {
|
|
18930
18993
|
// label has highest precedence
|
|
18931
18994
|
return typeof label === 'string' ? h("div", {
|
|
18932
18995
|
"class": "trim"
|
|
18933
|
-
}, [
|
|
18996
|
+
}, [(_category ? false : isPredictiveSuggestion // eslint-disable-next-line
|
|
18997
|
+
|| !!_suggestion_type) ? h(PredictiveSuggestion, {
|
|
18934
18998
|
"domProps": {
|
|
18935
18999
|
"innerHTML": label
|
|
18936
19000
|
}
|
|
18937
19001
|
}) : h(VueHighlightWords, {
|
|
18938
19002
|
"attrs": {
|
|
18939
|
-
"searchWords": this.currentValue.split(' '),
|
|
19003
|
+
"searchWords": _category ? [_category] : this.currentValue.split(' '),
|
|
18940
19004
|
"textToHighlight": label,
|
|
18941
19005
|
"autoEscape": true,
|
|
18942
19006
|
"highlightStyle": highlightStyle
|
|
@@ -19005,17 +19069,22 @@
|
|
|
19005
19069
|
};
|
|
19006
19070
|
|
|
19007
19071
|
var SearchSvg = {
|
|
19008
|
-
|
|
19009
|
-
|
|
19072
|
+
name: 'SearchSvg',
|
|
19073
|
+
props: ['styles'],
|
|
19074
|
+
render: function render() {
|
|
19075
|
+
var h = arguments[0];
|
|
19010
19076
|
return h("svg", {
|
|
19011
19077
|
"attrs": {
|
|
19012
19078
|
"alt": "Search",
|
|
19013
|
-
"height": "
|
|
19014
|
-
"width": "10",
|
|
19079
|
+
"height": "12",
|
|
19015
19080
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
19016
19081
|
"viewBox": "0 0 15 15"
|
|
19017
19082
|
},
|
|
19018
|
-
"class": "search-icon"
|
|
19083
|
+
"class": "search-icon",
|
|
19084
|
+
"style": _extends({
|
|
19085
|
+
transform: 'scale(1.35)',
|
|
19086
|
+
position: 'relative'
|
|
19087
|
+
}, this.$props.styles ? this.$props.styles : {})
|
|
19019
19088
|
}, [h("title", ["Search"]), h("path", {
|
|
19020
19089
|
"attrs": {
|
|
19021
19090
|
"d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
|
|
@@ -19687,11 +19756,11 @@
|
|
|
19687
19756
|
}, [this.customIcon]);
|
|
19688
19757
|
}
|
|
19689
19758
|
|
|
19690
|
-
if (this.$props.type === '
|
|
19759
|
+
if (this.$props.type === 'recent-search-icon') {
|
|
19691
19760
|
return h("svg", {
|
|
19692
19761
|
"attrs": {
|
|
19693
19762
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
19694
|
-
"alt": "
|
|
19763
|
+
"alt": "Recent Search",
|
|
19695
19764
|
"height": "20",
|
|
19696
19765
|
"width": "20",
|
|
19697
19766
|
"viewBox": "0 0 24 24"
|
|
@@ -19707,14 +19776,36 @@
|
|
|
19707
19776
|
}
|
|
19708
19777
|
}), h("path", {
|
|
19709
19778
|
"attrs": {
|
|
19710
|
-
"d": "
|
|
19779
|
+
"d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
|
|
19711
19780
|
}
|
|
19712
19781
|
})]);
|
|
19713
|
-
}
|
|
19782
|
+
}
|
|
19783
|
+
|
|
19784
|
+
if (this.$props.type === 'promoted-search-icon') {
|
|
19785
|
+
return h("svg", {
|
|
19786
|
+
"attrs": {
|
|
19787
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
19788
|
+
"width": "20",
|
|
19789
|
+
"alt": "promoted search",
|
|
19790
|
+
"height": "20",
|
|
19791
|
+
"viewBox": "0 0 24 24"
|
|
19792
|
+
},
|
|
19793
|
+
"class": this.$props.className,
|
|
19794
|
+
"style": {
|
|
19795
|
+
fill: '#707070'
|
|
19796
|
+
}
|
|
19797
|
+
}, [h("path", {
|
|
19798
|
+
"attrs": {
|
|
19799
|
+
"d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
|
|
19800
|
+
}
|
|
19801
|
+
})]);
|
|
19802
|
+
}
|
|
19803
|
+
|
|
19804
|
+
if (this.$props.type === 'popular-search-icon') {
|
|
19714
19805
|
return h("svg", {
|
|
19715
19806
|
"attrs": {
|
|
19716
19807
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
19717
|
-
"alt": "
|
|
19808
|
+
"alt": "Popular Search",
|
|
19718
19809
|
"height": "20",
|
|
19719
19810
|
"width": "20",
|
|
19720
19811
|
"viewBox": "0 0 24 24"
|
|
@@ -19730,10 +19821,21 @@
|
|
|
19730
19821
|
}
|
|
19731
19822
|
}), h("path", {
|
|
19732
19823
|
"attrs": {
|
|
19733
|
-
"d": "
|
|
19824
|
+
"d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
|
|
19734
19825
|
}
|
|
19735
19826
|
})]);
|
|
19736
19827
|
}
|
|
19828
|
+
|
|
19829
|
+
return h(SearchSvg, {
|
|
19830
|
+
"attrs": {
|
|
19831
|
+
"styles": {
|
|
19832
|
+
position: 'relative',
|
|
19833
|
+
fill: '#707070',
|
|
19834
|
+
left: '3px',
|
|
19835
|
+
marginRight: '8px'
|
|
19836
|
+
}
|
|
19837
|
+
}
|
|
19838
|
+
});
|
|
19737
19839
|
}
|
|
19738
19840
|
};
|
|
19739
19841
|
|
|
@@ -20110,7 +20212,7 @@
|
|
|
20110
20212
|
// returns size and aggs property
|
|
20111
20213
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
20112
20214
|
var aggregationField = this.$props.aggregationField;
|
|
20113
|
-
var queryOptions =
|
|
20215
|
+
var queryOptions = helper_20(this.$props);
|
|
20114
20216
|
|
|
20115
20217
|
if (aggregationField) {
|
|
20116
20218
|
queryOptions.aggs = getCompositeAggsQuery$1({
|
|
@@ -20216,7 +20318,7 @@
|
|
|
20216
20318
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
20217
20319
|
}
|
|
20218
20320
|
|
|
20219
|
-
this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions));
|
|
20321
|
+
this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), false);
|
|
20220
20322
|
this.updateQuery({
|
|
20221
20323
|
componentId: this.internalComponent,
|
|
20222
20324
|
query: query,
|
|
@@ -20243,7 +20345,7 @@
|
|
|
20243
20345
|
|
|
20244
20346
|
customQueryOptions = getOptionsFromQuery$1(customQueryTobeSet);
|
|
20245
20347
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
20246
|
-
this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions));
|
|
20348
|
+
this.setQueryOptions(componentId, _extends({}, this.queryOptions, customQueryOptions), false);
|
|
20247
20349
|
}
|
|
20248
20350
|
|
|
20249
20351
|
if (!this.isPending) {
|
|
@@ -20977,167 +21079,1322 @@
|
|
|
20977
21079
|
|
|
20978
21080
|
DataSearch.componentType = constants_1$1.dataSearch;
|
|
20979
21081
|
|
|
20980
|
-
var _templateObject$j
|
|
20981
|
-
var
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
|
|
20985
|
-
|
|
20986
|
-
|
|
20987
|
-
|
|
20988
|
-
|
|
20989
|
-
var formItem = function formItem(_ref) {
|
|
20990
|
-
var theme = _ref.theme;
|
|
20991
|
-
return css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, curriedLighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
|
|
20992
|
-
};
|
|
20993
|
-
|
|
20994
|
-
var Radio = index$1('input')(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
20995
|
-
return props.show ? null : hideInputControl;
|
|
20996
|
-
}, function (_ref2) {
|
|
20997
|
-
var theme = _ref2.theme;
|
|
20998
|
-
return theme.colors.primaryColor;
|
|
20999
|
-
}, function (_ref3) {
|
|
21000
|
-
var theme = _ref3.theme;
|
|
21001
|
-
return theme.colors.primaryColor;
|
|
21002
|
-
});
|
|
21003
|
-
var Checkbox = index$1('input')(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
21004
|
-
return props.show ? null : hideInputControl;
|
|
21005
|
-
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
21006
|
-
var theme = _ref4.theme;
|
|
21007
|
-
return theme.colors.primaryColor;
|
|
21008
|
-
}, function (_ref5) {
|
|
21009
|
-
var theme = _ref5.theme;
|
|
21010
|
-
return theme.colors.primaryColor;
|
|
21011
|
-
});
|
|
21012
|
-
var UL = index$1('ul')(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
|
|
21013
|
-
|
|
21014
|
-
var getAggsOrder = lib_8.getAggsOrder;
|
|
21015
|
-
|
|
21016
|
-
var extractQuery = function extractQuery(props) {
|
|
21017
|
-
var queryToBeReturned = {};
|
|
21018
|
-
|
|
21019
|
-
if (props.defaultQuery) {
|
|
21020
|
-
var evaluateQuery = props.defaultQuery([], props);
|
|
21021
|
-
|
|
21022
|
-
if (evaluateQuery) {
|
|
21023
|
-
if (evaluateQuery.query) {
|
|
21024
|
-
queryToBeReturned.query = evaluateQuery.query;
|
|
21082
|
+
var _templateObject$j;
|
|
21083
|
+
var AutofillSvgIcon = index$1('button')(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
|
|
21084
|
+
var AutoFillSvg = {
|
|
21085
|
+
name: 'AutoFillSvg',
|
|
21086
|
+
render: function render() {
|
|
21087
|
+
var h = arguments[0];
|
|
21088
|
+
return h(AutofillSvgIcon, {
|
|
21089
|
+
"on": {
|
|
21090
|
+
"click": this.$listeners.click
|
|
21025
21091
|
}
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21092
|
+
}, [h("svg", {
|
|
21093
|
+
"attrs": {
|
|
21094
|
+
"viewBox": "0 0 24 24"
|
|
21029
21095
|
}
|
|
21030
|
-
}
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
return queryToBeReturned;
|
|
21034
|
-
}; // eslint-disable-next-line import/prefer-default-export
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
var getAggsQuery = function getAggsQuery(query, props) {
|
|
21038
|
-
var _clonedQuery$aggs;
|
|
21039
|
-
|
|
21040
|
-
var clonedQuery = query;
|
|
21041
|
-
var dataField = props.dataField,
|
|
21042
|
-
size = props.size,
|
|
21043
|
-
sortBy = props.sortBy,
|
|
21044
|
-
showMissing = props.showMissing,
|
|
21045
|
-
missingLabel = props.missingLabel;
|
|
21046
|
-
clonedQuery.size = 0;
|
|
21047
|
-
clonedQuery.aggs = (_clonedQuery$aggs = {}, _clonedQuery$aggs[dataField] = {
|
|
21048
|
-
terms: _extends({
|
|
21049
|
-
field: dataField,
|
|
21050
|
-
size: size,
|
|
21051
|
-
order: getAggsOrder(sortBy || 'count')
|
|
21052
|
-
}, showMissing ? {
|
|
21053
|
-
missing: missingLabel
|
|
21054
|
-
} : {})
|
|
21055
|
-
}, _clonedQuery$aggs);
|
|
21056
|
-
|
|
21057
|
-
if (props.nestedField) {
|
|
21058
|
-
clonedQuery.aggs = {
|
|
21059
|
-
reactivesearch_nested: {
|
|
21060
|
-
nested: {
|
|
21061
|
-
path: props.nestedField
|
|
21062
|
-
},
|
|
21063
|
-
aggs: clonedQuery.aggs
|
|
21096
|
+
}, [h("path", {
|
|
21097
|
+
"attrs": {
|
|
21098
|
+
"d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
|
|
21064
21099
|
}
|
|
21065
|
-
};
|
|
21100
|
+
})])]);
|
|
21101
|
+
},
|
|
21102
|
+
methods: {
|
|
21103
|
+
clicked: function clicked(e) {
|
|
21104
|
+
e.stopPropagation();
|
|
21105
|
+
window.console.log('hey', e);
|
|
21106
|
+
}
|
|
21066
21107
|
}
|
|
21067
|
-
|
|
21068
|
-
return _extends({}, clonedQuery, extractQuery(props));
|
|
21069
21108
|
};
|
|
21070
21109
|
|
|
21071
21110
|
var updateQuery$2 = lib_5.updateQuery,
|
|
21072
|
-
setQueryOptions$2 = lib_5.setQueryOptions,
|
|
21073
21111
|
setCustomQuery$1 = lib_5.setCustomQuery,
|
|
21074
|
-
setDefaultQuery$2 = lib_5.setDefaultQuery
|
|
21075
|
-
|
|
21112
|
+
setDefaultQuery$2 = lib_5.setDefaultQuery,
|
|
21113
|
+
recordSuggestionClick$1 = lib_5.recordSuggestionClick;
|
|
21114
|
+
var _debounce = lib_8.debounce,
|
|
21076
21115
|
checkValueChange$1 = lib_8.checkValueChange,
|
|
21077
21116
|
getClassName$4 = lib_8.getClassName,
|
|
21078
|
-
|
|
21079
|
-
|
|
21080
|
-
|
|
21081
|
-
|
|
21082
|
-
|
|
21083
|
-
|
|
21084
|
-
|
|
21085
|
-
componentId: types.stringRequired,
|
|
21086
|
-
customQuery: types.func,
|
|
21087
|
-
dataField: types.stringRequired,
|
|
21088
|
-
defaultValue: types.string,
|
|
21089
|
-
value: types.value,
|
|
21090
|
-
defaultQuery: types.func,
|
|
21091
|
-
filterLabel: types.string,
|
|
21092
|
-
innerClass: types.style,
|
|
21093
|
-
placeholder: VueTypes.string.def('Search'),
|
|
21094
|
-
react: types.react,
|
|
21095
|
-
render: types.func,
|
|
21096
|
-
renderItem: types.func,
|
|
21097
|
-
renderNoResults: VueTypes.any,
|
|
21098
|
-
transformData: types.func,
|
|
21099
|
-
selectAllLabel: types.string,
|
|
21100
|
-
showCount: VueTypes.bool.def(true),
|
|
21101
|
-
showFilter: VueTypes.bool.def(true),
|
|
21102
|
-
showRadio: VueTypes.bool.def(true),
|
|
21103
|
-
showSearch: VueTypes.bool.def(true),
|
|
21104
|
-
size: VueTypes.number,
|
|
21105
|
-
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
21106
|
-
title: types.title,
|
|
21107
|
-
URLParams: VueTypes.bool.def(false),
|
|
21108
|
-
showMissing: VueTypes.bool.def(false),
|
|
21109
|
-
missingLabel: VueTypes.string.def('N/A'),
|
|
21110
|
-
nestedField: types.string,
|
|
21111
|
-
index: VueTypes.string,
|
|
21112
|
-
enableStrictSelection: VueTypes.bool.def(false)
|
|
21113
|
-
},
|
|
21117
|
+
isEqual$5 = lib_8.isEqual,
|
|
21118
|
+
getCompositeAggsQuery$2 = lib_8.getCompositeAggsQuery,
|
|
21119
|
+
withClickIds$1 = lib_8.withClickIds,
|
|
21120
|
+
getResultStats$2 = lib_8.getResultStats,
|
|
21121
|
+
normalizeDataField$1 = lib_8.normalizeDataField;
|
|
21122
|
+
var SearchBox = {
|
|
21123
|
+
name: 'SearchBox',
|
|
21114
21124
|
data: function data() {
|
|
21115
21125
|
var props = this.$props;
|
|
21116
21126
|
this.__state = {
|
|
21117
21127
|
currentValue: '',
|
|
21118
|
-
|
|
21119
|
-
|
|
21128
|
+
isOpen: false,
|
|
21129
|
+
normalizedSuggestions: []
|
|
21120
21130
|
};
|
|
21121
21131
|
this.internalComponent = props.componentId + "__internal";
|
|
21122
21132
|
return this.__state;
|
|
21123
21133
|
},
|
|
21134
|
+
inject: {
|
|
21135
|
+
theme: {
|
|
21136
|
+
from: 'theme_reactivesearch'
|
|
21137
|
+
}
|
|
21138
|
+
},
|
|
21124
21139
|
created: function created() {
|
|
21125
|
-
|
|
21140
|
+
var _this$$props = this.$props,
|
|
21141
|
+
distinctField = _this$$props.distinctField,
|
|
21142
|
+
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
21143
|
+
index = _this$$props.index;
|
|
21144
|
+
|
|
21145
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
21146
|
+
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
21147
|
+
}
|
|
21148
|
+
|
|
21149
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
21150
|
+
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
21151
|
+
}
|
|
21152
|
+
|
|
21153
|
+
if (!this.enableAppbase && index) {
|
|
21126
21154
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
21127
21155
|
}
|
|
21128
21156
|
|
|
21129
|
-
|
|
21130
|
-
this.
|
|
21157
|
+
this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
|
|
21158
|
+
this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
|
|
21159
|
+
this.setValue(this.currentValue, true, this.$props, undefined, false, this.selectedCategory); // Set custom and default queries in store
|
|
21131
21160
|
|
|
21132
|
-
|
|
21133
|
-
|
|
21161
|
+
this.triggerCustomQuery(this.currentValue, this.selectedCategory);
|
|
21162
|
+
this.triggerDefaultQuery(this.currentValue);
|
|
21134
21163
|
},
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21164
|
+
computed: {
|
|
21165
|
+
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
21166
|
+
return hasCustomRenderer(this);
|
|
21167
|
+
},
|
|
21168
|
+
stats: function stats() {
|
|
21169
|
+
return getResultStats$2(this);
|
|
21170
|
+
}
|
|
21171
|
+
},
|
|
21172
|
+
props: {
|
|
21173
|
+
autoFocus: VueTypes.bool,
|
|
21174
|
+
autosuggest: VueTypes.bool.def(true),
|
|
21175
|
+
beforeValueChange: types.func,
|
|
21176
|
+
className: VueTypes.string.def(''),
|
|
21177
|
+
clearIcon: types.children,
|
|
21178
|
+
componentId: types.stringRequired,
|
|
21179
|
+
customHighlight: types.func,
|
|
21180
|
+
customQuery: types.func,
|
|
21181
|
+
defaultQuery: types.func,
|
|
21182
|
+
dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
|
|
21183
|
+
field: VueTypes.string,
|
|
21184
|
+
weight: VueTypes.number
|
|
21185
|
+
}), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
|
|
21186
|
+
field: VueTypes.string,
|
|
21187
|
+
weight: VueTypes.number
|
|
21188
|
+
})]),
|
|
21189
|
+
aggregationField: types.string,
|
|
21190
|
+
aggregationSize: VueTypes.number,
|
|
21191
|
+
size: VueTypes.number,
|
|
21192
|
+
debounce: VueTypes.number.def(0),
|
|
21193
|
+
defaultValue: types.string,
|
|
21194
|
+
excludeFields: types.excludeFields,
|
|
21195
|
+
value: types.value,
|
|
21196
|
+
defaultSuggestions: types.suggestions,
|
|
21197
|
+
enableSynonyms: VueTypes.bool.def(true),
|
|
21198
|
+
enableQuerySuggestions: VueTypes.bool.def(false),
|
|
21199
|
+
enablePopularSuggestions: VueTypes.bool.def(false),
|
|
21200
|
+
enableRecentSuggestions: VueTypes.bool.def(false),
|
|
21201
|
+
fieldWeights: types.fieldWeights,
|
|
21202
|
+
filterLabel: types.string,
|
|
21203
|
+
fuzziness: types.fuzziness,
|
|
21204
|
+
highlight: VueTypes.bool,
|
|
21205
|
+
highlightField: types.stringOrArray,
|
|
21206
|
+
icon: types.children,
|
|
21207
|
+
iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
|
|
21208
|
+
includeFields: types.includeFields,
|
|
21209
|
+
innerClass: types.style,
|
|
21210
|
+
innerRef: VueTypes.string.def('searchInputField'),
|
|
21211
|
+
render: types.func,
|
|
21212
|
+
renderNoSuggestion: types.title,
|
|
21213
|
+
renderError: types.title,
|
|
21214
|
+
placeholder: VueTypes.string.def('Search'),
|
|
21215
|
+
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
21216
|
+
react: types.react,
|
|
21217
|
+
showClear: VueTypes.bool.def(true),
|
|
21218
|
+
showDistinctSuggestions: VueTypes.bool.def(true),
|
|
21219
|
+
showFilter: VueTypes.bool.def(true),
|
|
21220
|
+
showIcon: VueTypes.bool.def(true),
|
|
21221
|
+
title: types.title,
|
|
21222
|
+
theme: types.style,
|
|
21223
|
+
URLParams: VueTypes.bool.def(false),
|
|
21224
|
+
strictSelection: VueTypes.bool.def(false),
|
|
21225
|
+
nestedField: types.string,
|
|
21226
|
+
enablePredictiveSuggestions: VueTypes.bool.def(false),
|
|
21227
|
+
recentSearchesIcon: VueTypes.any,
|
|
21228
|
+
popularSearchesIcon: VueTypes.any,
|
|
21229
|
+
// mic props
|
|
21230
|
+
showVoiceSearch: VueTypes.bool.def(false),
|
|
21231
|
+
getMicInstance: types.func,
|
|
21232
|
+
renderMic: types.func,
|
|
21233
|
+
distinctField: types.string,
|
|
21234
|
+
distinctFieldConfig: types.props,
|
|
21235
|
+
//
|
|
21236
|
+
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
21237
|
+
addonBefore: VueTypes.any,
|
|
21238
|
+
addonAfter: VueTypes.any,
|
|
21239
|
+
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
21240
|
+
index: VueTypes.string,
|
|
21241
|
+
popularSuggestionsConfig: VueTypes.object,
|
|
21242
|
+
recentSuggestionsConfig: VueTypes.object,
|
|
21243
|
+
applyStopwords: VueTypes.bool,
|
|
21244
|
+
customStopwords: types.stringArray,
|
|
21245
|
+
onData: types.func,
|
|
21246
|
+
renderItem: types.func
|
|
21247
|
+
},
|
|
21248
|
+
mounted: function mounted() {
|
|
21249
|
+
this.listenForFocusShortcuts();
|
|
21250
|
+
},
|
|
21251
|
+
watch: {
|
|
21252
|
+
dataField: function dataField(newVal, oldVal) {
|
|
21253
|
+
if (!isEqual$5(newVal, oldVal)) {
|
|
21254
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21255
|
+
}
|
|
21256
|
+
},
|
|
21257
|
+
fieldWeights: function fieldWeights() {
|
|
21258
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21259
|
+
},
|
|
21260
|
+
fuzziness: function fuzziness() {
|
|
21261
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21262
|
+
},
|
|
21263
|
+
queryFormat: function queryFormat() {
|
|
21264
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21265
|
+
},
|
|
21266
|
+
defaultValue: function defaultValue(newVal) {
|
|
21267
|
+
this.setValue(newVal, true, this.$props);
|
|
21268
|
+
},
|
|
21269
|
+
value: function value(newVal, oldVal) {
|
|
21270
|
+
if (!isEqual$5(newVal, oldVal)) {
|
|
21271
|
+
this.setValue(newVal, true, this.$props, newVal === '' ? lib_7.CLEAR_VALUE : undefined, false);
|
|
21272
|
+
}
|
|
21273
|
+
},
|
|
21274
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
21275
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
21276
|
+
this.triggerDefaultQuery(this.$data.currentValue);
|
|
21277
|
+
}
|
|
21278
|
+
},
|
|
21279
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
21280
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
21281
|
+
this.triggerCustomQuery(this.$data.currentValue);
|
|
21282
|
+
}
|
|
21283
|
+
},
|
|
21284
|
+
suggestions: function suggestions(newVal) {
|
|
21285
|
+
var suggestionsList = [];
|
|
21286
|
+
|
|
21287
|
+
if (Array.isArray(newVal) && newVal.length) {
|
|
21288
|
+
suggestionsList = [].concat(withClickIds$1(newVal));
|
|
21289
|
+
} else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
|
|
21290
|
+
suggestionsList = [].concat(withClickIds$1(this.$props.defaultSuggestions));
|
|
21291
|
+
}
|
|
21292
|
+
|
|
21293
|
+
this.normalizedSuggestions = suggestionsList;
|
|
21294
|
+
},
|
|
21295
|
+
selectedValue: function selectedValue(newVal, oldVal) {
|
|
21296
|
+
if (oldVal !== newVal && this.$data.currentValue !== newVal) {
|
|
21297
|
+
if (!newVal && this.$data.currentValue) {
|
|
21298
|
+
// selected value is cleared, call onValueSelected
|
|
21299
|
+
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
21300
|
+
}
|
|
21301
|
+
|
|
21302
|
+
if (this.$props.value === undefined) {
|
|
21303
|
+
this.setValue(newVal || '', true, this.$props);
|
|
21304
|
+
}
|
|
21305
|
+
}
|
|
21306
|
+
},
|
|
21307
|
+
focusShortcuts: function focusShortcuts() {
|
|
21308
|
+
this.listenForFocusShortcuts();
|
|
21309
|
+
},
|
|
21310
|
+
rawData: function rawData(newVal) {
|
|
21311
|
+
this.$emit('on-data', {
|
|
21312
|
+
data: this.normalizedSuggestions,
|
|
21313
|
+
rawData: newVal,
|
|
21314
|
+
aggregationData: this.aggregationData,
|
|
21315
|
+
loading: this.isLoading,
|
|
21316
|
+
error: this.isError
|
|
21317
|
+
});
|
|
21318
|
+
},
|
|
21319
|
+
aggregationData: function aggregationData(newVal) {
|
|
21320
|
+
this.$emit('on-data', {
|
|
21321
|
+
data: this.normalizedSuggestions,
|
|
21322
|
+
rawData: this.rawData,
|
|
21323
|
+
aggregationData: newVal,
|
|
21324
|
+
loading: this.isLoading,
|
|
21325
|
+
error: this.isError
|
|
21326
|
+
});
|
|
21327
|
+
},
|
|
21328
|
+
loading: function loading(newVal) {
|
|
21329
|
+
this.$emit('on-data', {
|
|
21330
|
+
data: this.normalizedSuggestions,
|
|
21331
|
+
rawData: this.rawData,
|
|
21332
|
+
aggregationData: this.aggregationData,
|
|
21333
|
+
loading: newVal,
|
|
21334
|
+
error: this.isError
|
|
21335
|
+
});
|
|
21336
|
+
},
|
|
21337
|
+
error: function error(newVal) {
|
|
21338
|
+
this.$emit('on-data', {
|
|
21339
|
+
data: this.normalizedSuggestions,
|
|
21340
|
+
rawData: this.rawData,
|
|
21341
|
+
aggregationData: this.aggregationData,
|
|
21342
|
+
loading: this.isLoading,
|
|
21343
|
+
error: newVal
|
|
21344
|
+
});
|
|
21345
|
+
},
|
|
21346
|
+
debounce: function debounce(newVal, oldVal) {
|
|
21347
|
+
if (!isEqual$5(newVal, oldVal)) {
|
|
21348
|
+
this.handleTextChange = _debounce(this.handleText, newVal);
|
|
21349
|
+
}
|
|
21350
|
+
}
|
|
21351
|
+
},
|
|
21352
|
+
methods: {
|
|
21353
|
+
handleText: function handleText(value, cause) {
|
|
21354
|
+
if (cause === lib_7.CLEAR_VALUE) {
|
|
21355
|
+
this.triggerCustomQuery(value);
|
|
21356
|
+
this.triggerDefaultQuery(value);
|
|
21357
|
+
} else if (this.$props.autosuggest) {
|
|
21358
|
+
this.triggerDefaultQuery(value);
|
|
21359
|
+
} else {
|
|
21360
|
+
this.triggerCustomQuery(value);
|
|
21361
|
+
}
|
|
21362
|
+
},
|
|
21363
|
+
validateDataField: function validateDataField() {
|
|
21364
|
+
var propName = 'dataField';
|
|
21365
|
+
var componentName = SearchBox.name;
|
|
21366
|
+
var props = this.$props;
|
|
21367
|
+
var requiredError = propName + " supplied to " + componentName + " is required. Validation failed.";
|
|
21368
|
+
var propValue = props[propName];
|
|
21369
|
+
|
|
21370
|
+
if (!this.enableAppbase) {
|
|
21371
|
+
if (!propValue) {
|
|
21372
|
+
console.error(requiredError);
|
|
21373
|
+
return;
|
|
21374
|
+
}
|
|
21375
|
+
|
|
21376
|
+
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
21377
|
+
console.error("Invalid " + propName + " supplied to " + componentName + ". Validation failed.");
|
|
21378
|
+
return;
|
|
21379
|
+
}
|
|
21380
|
+
|
|
21381
|
+
if (Array.isArray(propValue) && propValue.length === 0) {
|
|
21382
|
+
console.error(requiredError);
|
|
21383
|
+
}
|
|
21384
|
+
}
|
|
21385
|
+
},
|
|
21386
|
+
getComponent: function getComponent$1(downshiftProps) {
|
|
21387
|
+
if (downshiftProps === void 0) {
|
|
21388
|
+
downshiftProps = {};
|
|
21389
|
+
}
|
|
21390
|
+
|
|
21391
|
+
var currentValue = this.$data.currentValue;
|
|
21392
|
+
var data = {
|
|
21393
|
+
error: this.error,
|
|
21394
|
+
loading: this.isLoading,
|
|
21395
|
+
downshiftProps: downshiftProps,
|
|
21396
|
+
data: this.normalizedSuggestions,
|
|
21397
|
+
rawData: this.rawData,
|
|
21398
|
+
value: currentValue,
|
|
21399
|
+
resultStats: this.stats
|
|
21400
|
+
};
|
|
21401
|
+
return getComponent(data, this);
|
|
21402
|
+
},
|
|
21403
|
+
// returns size and aggs property
|
|
21404
|
+
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
21405
|
+
var aggregationField = this.$props.aggregationField;
|
|
21406
|
+
var queryOptions = helper_20(this.$props);
|
|
21407
|
+
|
|
21408
|
+
if (aggregationField) {
|
|
21409
|
+
queryOptions.aggs = getCompositeAggsQuery$2({
|
|
21410
|
+
props: this.$props,
|
|
21411
|
+
showTopHits: true
|
|
21412
|
+
}).aggs;
|
|
21413
|
+
}
|
|
21414
|
+
|
|
21415
|
+
return queryOptions;
|
|
21416
|
+
},
|
|
21417
|
+
handleSearchIconClick: function handleSearchIconClick() {
|
|
21418
|
+
var currentValue = this.currentValue;
|
|
21419
|
+
|
|
21420
|
+
if (currentValue.trim()) {
|
|
21421
|
+
this.setValue(currentValue, true);
|
|
21422
|
+
this.onValueSelectedHandler(currentValue, lib_7.SEARCH_ICON_CLICK);
|
|
21423
|
+
}
|
|
21424
|
+
},
|
|
21425
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
21426
|
+
var _this = this;
|
|
21427
|
+
|
|
21428
|
+
if (isDefaultValue === void 0) {
|
|
21429
|
+
isDefaultValue = false;
|
|
21430
|
+
}
|
|
21431
|
+
|
|
21432
|
+
if (props === void 0) {
|
|
21433
|
+
props = this.$props;
|
|
21434
|
+
}
|
|
21435
|
+
|
|
21436
|
+
if (toggleIsOpen === void 0) {
|
|
21437
|
+
toggleIsOpen = true;
|
|
21438
|
+
}
|
|
21439
|
+
|
|
21440
|
+
if (categoryValue === void 0) {
|
|
21441
|
+
categoryValue = undefined;
|
|
21442
|
+
}
|
|
21443
|
+
|
|
21444
|
+
var performUpdate = function performUpdate() {
|
|
21445
|
+
_this.currentValue = value;
|
|
21446
|
+
|
|
21447
|
+
if (isDefaultValue) {
|
|
21448
|
+
if (_this.$props.autosuggest) {
|
|
21449
|
+
if (toggleIsOpen) {
|
|
21450
|
+
_this.isOpen = false;
|
|
21451
|
+
}
|
|
21452
|
+
|
|
21453
|
+
_this.triggerDefaultQuery(value);
|
|
21454
|
+
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
21455
|
+
// to set the query otherwise the value should reset
|
|
21456
|
+
|
|
21457
|
+
|
|
21458
|
+
if (props.strictSelection) {
|
|
21459
|
+
if (cause === lib_7.SUGGESTION_SELECT || value === '') {
|
|
21460
|
+
_this.triggerCustomQuery(value, categoryValue);
|
|
21461
|
+
} else {
|
|
21462
|
+
_this.setValue('', true);
|
|
21463
|
+
}
|
|
21464
|
+
} else if (props.value === undefined) {
|
|
21465
|
+
_this.triggerCustomQuery(value, categoryValue);
|
|
21466
|
+
}
|
|
21467
|
+
} else {
|
|
21468
|
+
// debounce for handling text while typing
|
|
21469
|
+
_this.handleTextChange(value, cause);
|
|
21470
|
+
}
|
|
21471
|
+
|
|
21472
|
+
_this.$emit('valueChange', value);
|
|
21473
|
+
|
|
21474
|
+
_this.$emit('value-change', value);
|
|
21475
|
+
};
|
|
21476
|
+
|
|
21477
|
+
checkValueChange$1(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
21478
|
+
},
|
|
21479
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
|
|
21480
|
+
if (!this.$props.autosuggest) {
|
|
21481
|
+
return;
|
|
21482
|
+
}
|
|
21483
|
+
|
|
21484
|
+
var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
|
|
21485
|
+
var query = SearchBox.defaultQuery(value, this.$props);
|
|
21486
|
+
|
|
21487
|
+
if (this.defaultQuery) {
|
|
21488
|
+
var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
|
|
21489
|
+
|
|
21490
|
+
if (defaultQueryToBeSet.query) {
|
|
21491
|
+
query = defaultQueryToBeSet.query;
|
|
21492
|
+
} // Update calculated default query in store
|
|
21493
|
+
|
|
21494
|
+
|
|
21495
|
+
updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
|
|
21496
|
+
}
|
|
21497
|
+
|
|
21498
|
+
this.updateQuery({
|
|
21499
|
+
componentId: this.internalComponent,
|
|
21500
|
+
query: query,
|
|
21501
|
+
value: value,
|
|
21502
|
+
componentType: constants_1$1.searchBox
|
|
21503
|
+
});
|
|
21504
|
+
},
|
|
21505
|
+
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
21506
|
+
if (categoryValue === void 0) {
|
|
21507
|
+
categoryValue = undefined;
|
|
21508
|
+
}
|
|
21509
|
+
|
|
21510
|
+
var _this$$props2 = this.$props,
|
|
21511
|
+
customQuery = _this$$props2.customQuery,
|
|
21512
|
+
filterLabel = _this$$props2.filterLabel,
|
|
21513
|
+
showFilter = _this$$props2.showFilter,
|
|
21514
|
+
URLParams = _this$$props2.URLParams;
|
|
21515
|
+
var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
|
|
21516
|
+
var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
|
|
21517
|
+
var query = defaultQueryTobeSet;
|
|
21518
|
+
|
|
21519
|
+
if (customQuery) {
|
|
21520
|
+
var customQueryTobeSet = customQuery(value, this.$props);
|
|
21521
|
+
var queryTobeSet = customQueryTobeSet.query;
|
|
21522
|
+
|
|
21523
|
+
if (queryTobeSet) {
|
|
21524
|
+
query = queryTobeSet;
|
|
21525
|
+
}
|
|
21526
|
+
|
|
21527
|
+
updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
|
|
21528
|
+
}
|
|
21529
|
+
|
|
21530
|
+
this.updateQuery({
|
|
21531
|
+
componentId: this.$props.componentId,
|
|
21532
|
+
query: query,
|
|
21533
|
+
value: value,
|
|
21534
|
+
label: filterLabel,
|
|
21535
|
+
showFilter: showFilter,
|
|
21536
|
+
URLParams: URLParams,
|
|
21537
|
+
componentType: constants_1$1.searchBox,
|
|
21538
|
+
category: categoryValue
|
|
21539
|
+
});
|
|
21540
|
+
},
|
|
21541
|
+
handleFocus: function handleFocus(event) {
|
|
21542
|
+
if (this.$props.autosuggest) {
|
|
21543
|
+
this.isOpen = true;
|
|
21544
|
+
}
|
|
21545
|
+
|
|
21546
|
+
this.$emit('focus', event);
|
|
21547
|
+
},
|
|
21548
|
+
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
21549
|
+
var results = _ref.results;
|
|
21550
|
+
|
|
21551
|
+
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
21552
|
+
this.setValue(results[0][0].transcript.trim(), true);
|
|
21553
|
+
}
|
|
21554
|
+
},
|
|
21555
|
+
triggerQuery: function triggerQuery(_ref2) {
|
|
21556
|
+
var _ref2$isOpen = _ref2.isOpen,
|
|
21557
|
+
isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
|
|
21558
|
+
_ref2$customQuery = _ref2.customQuery,
|
|
21559
|
+
customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
|
|
21560
|
+
_ref2$defaultQuery = _ref2.defaultQuery,
|
|
21561
|
+
defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
|
|
21562
|
+
_ref2$value = _ref2.value,
|
|
21563
|
+
value = _ref2$value === void 0 ? undefined : _ref2$value,
|
|
21564
|
+
_ref2$categoryValue = _ref2.categoryValue,
|
|
21565
|
+
categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
|
|
21566
|
+
|
|
21567
|
+
if (typeof isOpen === 'boolean') {
|
|
21568
|
+
this.isOpen = isOpen;
|
|
21569
|
+
}
|
|
21570
|
+
|
|
21571
|
+
if (customQuery) {
|
|
21572
|
+
this.triggerCustomQuery(value, categoryValue);
|
|
21573
|
+
}
|
|
21574
|
+
|
|
21575
|
+
if (defaultQuery) {
|
|
21576
|
+
this.triggerDefaultQuery(value);
|
|
21577
|
+
}
|
|
21578
|
+
},
|
|
21579
|
+
triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
|
|
21580
|
+
// click analytics would only work client side and after javascript loads
|
|
21581
|
+
var docId = documentId;
|
|
21582
|
+
|
|
21583
|
+
if (!docId) {
|
|
21584
|
+
var hitData = this.normalizedSuggestions.find(function (hit) {
|
|
21585
|
+
return hit._click_id === searchPosition;
|
|
21586
|
+
});
|
|
21587
|
+
|
|
21588
|
+
if (hitData && hitData.source && hitData.source._id) {
|
|
21589
|
+
docId = hitData.source._id;
|
|
21590
|
+
}
|
|
21591
|
+
}
|
|
21592
|
+
|
|
21593
|
+
this.recordSuggestionClick(searchPosition, docId);
|
|
21594
|
+
},
|
|
21595
|
+
clearValue: function clearValue() {
|
|
21596
|
+
this.setValue('', false, this.$props, lib_7.CLEAR_VALUE, false);
|
|
21597
|
+
this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
|
|
21598
|
+
},
|
|
21599
|
+
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
21600
|
+
// if a suggestion was selected, delegate the handling to suggestion handler
|
|
21601
|
+
if (event.key === 'Enter' && highlightedIndex === null) {
|
|
21602
|
+
this.setValue(event.target.value, true);
|
|
21603
|
+
this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
|
|
21604
|
+
} // Need to review
|
|
21605
|
+
|
|
21606
|
+
|
|
21607
|
+
this.$emit('keyDown', event, this.triggerQuery);
|
|
21608
|
+
this.$emit('key-down', event, this.triggerQuery);
|
|
21609
|
+
},
|
|
21610
|
+
onInputChange: function onInputChange(e) {
|
|
21611
|
+
var _this2 = this;
|
|
21612
|
+
|
|
21613
|
+
var inputValue = e.target.value;
|
|
21614
|
+
|
|
21615
|
+
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
21616
|
+
this.isOpen = true;
|
|
21617
|
+
}
|
|
21618
|
+
|
|
21619
|
+
var value = this.$props.value;
|
|
21620
|
+
|
|
21621
|
+
if (value === undefined) {
|
|
21622
|
+
this.setValue(inputValue, false, this.$props, inputValue === '' ? lib_7.CLEAR_VALUE : undefined);
|
|
21623
|
+
} else {
|
|
21624
|
+
this.$emit('change', inputValue, function (_ref3) {
|
|
21625
|
+
var isOpen = _ref3.isOpen;
|
|
21626
|
+
return _this2.triggerQuery({
|
|
21627
|
+
defaultQuery: true,
|
|
21628
|
+
customQuery: true,
|
|
21629
|
+
value: inputValue,
|
|
21630
|
+
isOpen: isOpen
|
|
21631
|
+
});
|
|
21632
|
+
}, e);
|
|
21633
|
+
}
|
|
21634
|
+
},
|
|
21635
|
+
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
21636
|
+
var _this3 = this;
|
|
21637
|
+
|
|
21638
|
+
this.isOpen = false;
|
|
21639
|
+
var value = this.$props.value; // Record analytics for selected suggestions
|
|
21640
|
+
|
|
21641
|
+
this.triggerClickAnalytics(suggestion._click_id);
|
|
21642
|
+
|
|
21643
|
+
if (value === undefined) {
|
|
21644
|
+
this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT, false, suggestion._category);
|
|
21645
|
+
} else {
|
|
21646
|
+
this.$emit('change', suggestion.value, function (_ref4) {
|
|
21647
|
+
var isOpen = _ref4.isOpen;
|
|
21648
|
+
return _this3.triggerQuery({
|
|
21649
|
+
isOpen: isOpen,
|
|
21650
|
+
value: suggestion.value,
|
|
21651
|
+
categoryValue: suggestion._category
|
|
21652
|
+
});
|
|
21653
|
+
});
|
|
21654
|
+
}
|
|
21655
|
+
|
|
21656
|
+
this.onValueSelectedHandler(suggestion.value, lib_7.SUGGESTION_SELECT, suggestion.source);
|
|
21657
|
+
},
|
|
21658
|
+
onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
|
|
21659
|
+
if (currentValue === void 0) {
|
|
21660
|
+
currentValue = this.$data.currentValue;
|
|
21661
|
+
}
|
|
21662
|
+
|
|
21663
|
+
for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
21664
|
+
cause[_key - 1] = arguments[_key];
|
|
21665
|
+
}
|
|
21666
|
+
|
|
21667
|
+
this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
|
|
21668
|
+
this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
|
|
21669
|
+
},
|
|
21670
|
+
handleStateChange: function handleStateChange(changes) {
|
|
21671
|
+
var isOpen = changes.isOpen;
|
|
21672
|
+
this.isOpen = isOpen;
|
|
21673
|
+
},
|
|
21674
|
+
getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
|
|
21675
|
+
var isDark = this.themePreset === 'dark';
|
|
21676
|
+
|
|
21677
|
+
if (isDark) {
|
|
21678
|
+
return highlightedIndex === index ? '#555' : '#424242';
|
|
21679
|
+
}
|
|
21680
|
+
|
|
21681
|
+
return highlightedIndex === index ? '#eee' : '#fff';
|
|
21682
|
+
},
|
|
21683
|
+
renderIcon: function renderIcon() {
|
|
21684
|
+
var h = this.$createElement;
|
|
21685
|
+
|
|
21686
|
+
if (this.$props.showIcon) {
|
|
21687
|
+
return this.$props.icon || h(SearchSvg);
|
|
21688
|
+
}
|
|
21689
|
+
|
|
21690
|
+
return null;
|
|
21691
|
+
},
|
|
21692
|
+
renderErrorComponent: function renderErrorComponent() {
|
|
21693
|
+
var h = this.$createElement;
|
|
21694
|
+
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
21695
|
+
|
|
21696
|
+
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
21697
|
+
return h(SuggestionWrapper, {
|
|
21698
|
+
"attrs": {
|
|
21699
|
+
"innerClass": this.$props.innerClass,
|
|
21700
|
+
"innerClassName": "error",
|
|
21701
|
+
"theme": this.theme,
|
|
21702
|
+
"themePreset": this.themePreset
|
|
21703
|
+
}
|
|
21704
|
+
}, [isFunction$1(renderError) ? renderError(this.error) : renderError]);
|
|
21705
|
+
}
|
|
21706
|
+
|
|
21707
|
+
return null;
|
|
21708
|
+
},
|
|
21709
|
+
renderCancelIcon: function renderCancelIcon() {
|
|
21710
|
+
var h = this.$createElement;
|
|
21711
|
+
|
|
21712
|
+
if (this.$props.showClear) {
|
|
21713
|
+
return this.$props.clearIcon || h(CancelSvg);
|
|
21714
|
+
}
|
|
21715
|
+
|
|
21716
|
+
return null;
|
|
21717
|
+
},
|
|
21718
|
+
renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
|
|
21719
|
+
if (finalSuggestionsList === void 0) {
|
|
21720
|
+
finalSuggestionsList = [];
|
|
21721
|
+
}
|
|
21722
|
+
|
|
21723
|
+
var h = this.$createElement;
|
|
21724
|
+
var _this$$props3 = this.$props,
|
|
21725
|
+
theme = _this$$props3.theme,
|
|
21726
|
+
innerClass = _this$$props3.innerClass;
|
|
21727
|
+
var renderNoSuggestion = this.$scopedSlots.renderNoSuggestion || this.$props.renderNoSuggestion;
|
|
21728
|
+
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
21729
|
+
var _this$$data = this.$data,
|
|
21730
|
+
isOpen = _this$$data.isOpen,
|
|
21731
|
+
currentValue = _this$$data.currentValue;
|
|
21732
|
+
|
|
21733
|
+
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
21734
|
+
return h(SuggestionWrapper, {
|
|
21735
|
+
"attrs": {
|
|
21736
|
+
"innerClass": innerClass,
|
|
21737
|
+
"themePreset": this.themePreset,
|
|
21738
|
+
"theme": theme,
|
|
21739
|
+
"innerClassName": "noSuggestion"
|
|
21740
|
+
},
|
|
21741
|
+
"scopedSlots": {
|
|
21742
|
+
"default": function _default() {
|
|
21743
|
+
return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
|
|
21744
|
+
}
|
|
21745
|
+
}
|
|
21746
|
+
});
|
|
21747
|
+
}
|
|
21748
|
+
|
|
21749
|
+
return null;
|
|
21750
|
+
},
|
|
21751
|
+
renderInputAddonBefore: function renderInputAddonBefore() {
|
|
21752
|
+
var h = this.$createElement;
|
|
21753
|
+
var addonBefore = this.$scopedSlots.addonBefore;
|
|
21754
|
+
|
|
21755
|
+
if (addonBefore) {
|
|
21756
|
+
return h(InputAddon, {
|
|
21757
|
+
"attrs": {
|
|
21758
|
+
"className": "addon-before"
|
|
21759
|
+
}
|
|
21760
|
+
}, [addonBefore()]);
|
|
21761
|
+
}
|
|
21762
|
+
|
|
21763
|
+
return null;
|
|
21764
|
+
},
|
|
21765
|
+
renderInputAddonAfter: function renderInputAddonAfter() {
|
|
21766
|
+
var h = this.$createElement;
|
|
21767
|
+
var addonAfter = this.$scopedSlots.addonAfter;
|
|
21768
|
+
|
|
21769
|
+
if (addonAfter) {
|
|
21770
|
+
return h(InputAddon, {
|
|
21771
|
+
"attrs": {
|
|
21772
|
+
"className": "addon-after"
|
|
21773
|
+
}
|
|
21774
|
+
}, [addonAfter()]);
|
|
21775
|
+
}
|
|
21776
|
+
|
|
21777
|
+
return null;
|
|
21778
|
+
},
|
|
21779
|
+
renderIcons: function renderIcons() {
|
|
21780
|
+
var h = this.$createElement;
|
|
21781
|
+
var _this$$props4 = this.$props,
|
|
21782
|
+
iconPosition = _this$$props4.iconPosition,
|
|
21783
|
+
showClear = _this$$props4.showClear,
|
|
21784
|
+
innerClass = _this$$props4.innerClass,
|
|
21785
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
21786
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
21787
|
+
showIcon = _this$$props4.showIcon;
|
|
21788
|
+
var renderMic = this.$scopedSlots.renderMic || this.$props.renderMic;
|
|
21789
|
+
var currentValue = this.$data.currentValue;
|
|
21790
|
+
return h("div", [h(IconGroup, {
|
|
21791
|
+
"attrs": {
|
|
21792
|
+
"groupPosition": "right",
|
|
21793
|
+
"positionType": "absolute"
|
|
21794
|
+
}
|
|
21795
|
+
}, [currentValue && showClear && h(IconWrapper, {
|
|
21796
|
+
"on": {
|
|
21797
|
+
"click": this.clearValue
|
|
21798
|
+
},
|
|
21799
|
+
"attrs": {
|
|
21800
|
+
"showIcon": showIcon,
|
|
21801
|
+
"isClearIcon": true
|
|
21802
|
+
}
|
|
21803
|
+
}, [this.renderCancelIcon()]), showVoiceSearch && h(Mic, {
|
|
21804
|
+
"attrs": {
|
|
21805
|
+
"getInstance": getMicInstance,
|
|
21806
|
+
"render": renderMic,
|
|
21807
|
+
"handleResult": this.handleVoiceResults,
|
|
21808
|
+
"className": getClassName$4(innerClass, 'mic') || null
|
|
21809
|
+
}
|
|
21810
|
+
}), iconPosition === 'right' && showIcon && h(IconWrapper, {
|
|
21811
|
+
"on": {
|
|
21812
|
+
"click": this.handleSearchIconClick
|
|
21813
|
+
}
|
|
21814
|
+
}, [this.renderIcon()])]), h(IconGroup, {
|
|
21815
|
+
"attrs": {
|
|
21816
|
+
"groupPosition": "left",
|
|
21817
|
+
"positionType": "absolute"
|
|
21818
|
+
}
|
|
21819
|
+
}, [iconPosition === 'left' && showIcon && h(IconWrapper, {
|
|
21820
|
+
"on": {
|
|
21821
|
+
"click": this.handleSearchIconClick
|
|
21822
|
+
}
|
|
21823
|
+
}, [this.renderIcon()])])]);
|
|
21824
|
+
},
|
|
21825
|
+
focusSearchBox: function focusSearchBox(event) {
|
|
21826
|
+
var _this$$refs, _this$$refs$this$$pro;
|
|
21827
|
+
|
|
21828
|
+
var elt = event.target || event.srcElement;
|
|
21829
|
+
var tagName = elt.tagName;
|
|
21830
|
+
|
|
21831
|
+
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
21832
|
+
// already in an input
|
|
21833
|
+
return;
|
|
21834
|
+
}
|
|
21835
|
+
|
|
21836
|
+
(_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
|
|
21837
|
+
},
|
|
21838
|
+
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
21839
|
+
var _this4 = this;
|
|
21840
|
+
|
|
21841
|
+
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
21842
|
+
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
21843
|
+
|
|
21844
|
+
if (isEmpty(focusShortcuts)) {
|
|
21845
|
+
return;
|
|
21846
|
+
}
|
|
21847
|
+
|
|
21848
|
+
var shortcutsString = parseFocusShortcuts(focusShortcuts).join(','); // handler for alphabets and other key combinations
|
|
21849
|
+
|
|
21850
|
+
hotkeys(shortcutsString, // eslint-disable-next-line no-unused-vars
|
|
21851
|
+
|
|
21852
|
+
/* eslint-disable no-shadow */
|
|
21853
|
+
function (event, handler) {
|
|
21854
|
+
// Prevent the default refresh event under WINDOWS system
|
|
21855
|
+
event.preventDefault();
|
|
21856
|
+
|
|
21857
|
+
_this4.focusSearchBox(event);
|
|
21858
|
+
}); // if one of modifier keys are used, they are handled below
|
|
21859
|
+
|
|
21860
|
+
hotkeys('*', function (event) {
|
|
21861
|
+
var modifierKeys = extractModifierKeysFromFocusShortcuts(focusShortcuts);
|
|
21862
|
+
if (modifierKeys.length === 0) return;
|
|
21863
|
+
|
|
21864
|
+
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
21865
|
+
var element = modifierKeys[index];
|
|
21866
|
+
|
|
21867
|
+
if (hotkeys[element]) {
|
|
21868
|
+
_this4.focusSearchBox(event);
|
|
21869
|
+
|
|
21870
|
+
break;
|
|
21871
|
+
}
|
|
21872
|
+
}
|
|
21873
|
+
});
|
|
21874
|
+
},
|
|
21875
|
+
onAutofillClick: function onAutofillClick(suggestion) {
|
|
21876
|
+
var value = suggestion.value;
|
|
21877
|
+
this.isOpen = true;
|
|
21878
|
+
this.currentValue = value;
|
|
21879
|
+
this.triggerDefaultQuery(value);
|
|
21880
|
+
},
|
|
21881
|
+
renderAutoFill: function renderAutoFill(suggestion) {
|
|
21882
|
+
var _this5 = this;
|
|
21883
|
+
|
|
21884
|
+
var h = this.$createElement;
|
|
21885
|
+
|
|
21886
|
+
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
21887
|
+
e.stopPropagation();
|
|
21888
|
+
|
|
21889
|
+
_this5.onAutofillClick(suggestion);
|
|
21890
|
+
};
|
|
21891
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
21892
|
+
|
|
21893
|
+
|
|
21894
|
+
return suggestion._category ? null : h(AutoFillSvg, {
|
|
21895
|
+
"on": {
|
|
21896
|
+
"click": handleAutoFillClick
|
|
21897
|
+
}
|
|
21898
|
+
});
|
|
21899
|
+
}
|
|
21900
|
+
},
|
|
21901
|
+
render: function render() {
|
|
21902
|
+
var _this6 = this;
|
|
21903
|
+
|
|
21904
|
+
var h = arguments[0];
|
|
21905
|
+
var _this$$props5 = this.$props,
|
|
21906
|
+
theme = _this$$props5.theme,
|
|
21907
|
+
expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer;
|
|
21908
|
+
var _this$$scopedSlots = this.$scopedSlots,
|
|
21909
|
+
recentSearchesIcon = _this$$scopedSlots.recentSearchesIcon,
|
|
21910
|
+
popularSearchesIcon = _this$$scopedSlots.popularSearchesIcon;
|
|
21911
|
+
var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
|
|
21912
|
+
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
21913
|
+
return h(Container, {
|
|
21914
|
+
"class": this.$props.className
|
|
21915
|
+
}, [this.$props.title && h(Title, {
|
|
21916
|
+
"class": getClassName$4(this.$props.innerClass, 'title') || ''
|
|
21917
|
+
}, [this.$props.title]), this.$props.autosuggest ? h(Downshift, {
|
|
21918
|
+
"attrs": {
|
|
21919
|
+
"id": this.$props.componentId + "-downshift",
|
|
21920
|
+
"handleChange": this.onSuggestionSelected,
|
|
21921
|
+
"handleMouseup": this.handleStateChange,
|
|
21922
|
+
"isOpen": this.$data.isOpen
|
|
21923
|
+
},
|
|
21924
|
+
"scopedSlots": {
|
|
21925
|
+
"default": function _default(_ref5) {
|
|
21926
|
+
var getInputEvents = _ref5.getInputEvents,
|
|
21927
|
+
getInputProps = _ref5.getInputProps,
|
|
21928
|
+
getItemProps = _ref5.getItemProps,
|
|
21929
|
+
getItemEvents = _ref5.getItemEvents,
|
|
21930
|
+
isOpen = _ref5.isOpen,
|
|
21931
|
+
highlightedIndex = _ref5.highlightedIndex,
|
|
21932
|
+
setHighlightedIndex = _ref5.setHighlightedIndex;
|
|
21933
|
+
|
|
21934
|
+
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
21935
|
+
var getIcon = function getIcon(iconType) {
|
|
21936
|
+
switch (iconType) {
|
|
21937
|
+
case helper_1.Recent:
|
|
21938
|
+
return recentSearchesIcon;
|
|
21939
|
+
|
|
21940
|
+
case helper_1.Popular:
|
|
21941
|
+
return popularSearchesIcon;
|
|
21942
|
+
|
|
21943
|
+
default:
|
|
21944
|
+
return null;
|
|
21945
|
+
}
|
|
21946
|
+
};
|
|
21947
|
+
|
|
21948
|
+
return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
|
|
21949
|
+
isOpen: isOpen,
|
|
21950
|
+
getItemProps: getItemProps,
|
|
21951
|
+
getItemEvents: getItemEvents,
|
|
21952
|
+
highlightedIndex: highlightedIndex
|
|
21953
|
+
}), _this6.renderErrorComponent(), !_this6.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
21954
|
+
"class": suggestions$1(_this6.themePreset, theme) + " " + getClassName$4(_this6.$props.innerClass, 'list')
|
|
21955
|
+
}, [_this6.normalizedSuggestions.map(function (item, index) {
|
|
21956
|
+
return renderItem ? h("li", {
|
|
21957
|
+
"domProps": _extends({}, getItemProps({
|
|
21958
|
+
item: item
|
|
21959
|
+
})),
|
|
21960
|
+
"on": _extends({}, getItemEvents({
|
|
21961
|
+
item: item
|
|
21962
|
+
})),
|
|
21963
|
+
"key": index + 1 + "-" + item.value,
|
|
21964
|
+
"style": {
|
|
21965
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
|
|
21966
|
+
justifyContent: 'flex-start',
|
|
21967
|
+
alignItems: 'center'
|
|
21968
|
+
}
|
|
21969
|
+
}, [renderItem(item)]) : h("li", {
|
|
21970
|
+
"domProps": _extends({}, getItemProps({
|
|
21971
|
+
item: item
|
|
21972
|
+
})),
|
|
21973
|
+
"on": _extends({}, getItemEvents({
|
|
21974
|
+
item: item
|
|
21975
|
+
})),
|
|
21976
|
+
"key": index + 1 + "-" + item.value,
|
|
21977
|
+
"style": {
|
|
21978
|
+
backgroundColor: _this6.getBackgroundColor(highlightedIndex, index),
|
|
21979
|
+
justifyContent: 'flex-start',
|
|
21980
|
+
alignItems: 'center'
|
|
21981
|
+
}
|
|
21982
|
+
}, [h("div", {
|
|
21983
|
+
"style": {
|
|
21984
|
+
padding: '0 10px 0 0',
|
|
21985
|
+
display: 'flex'
|
|
21986
|
+
}
|
|
21987
|
+
}, [h(CustomSvg, {
|
|
21988
|
+
"attrs": {
|
|
21989
|
+
"className": getClassName$4(_this6.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
21990
|
+
"icon": getIcon(item._suggestion_type),
|
|
21991
|
+
"type": item._suggestion_type + "-search-icon"
|
|
21992
|
+
}
|
|
21993
|
+
})]), h(SuggestionItem, {
|
|
21994
|
+
"attrs": {
|
|
21995
|
+
"currentValue": _this6.currentValue,
|
|
21996
|
+
"suggestion": item
|
|
21997
|
+
}
|
|
21998
|
+
}), _this6.renderAutoFill(item)]);
|
|
21999
|
+
})]) : _this6.renderNoSuggestions(_this6.normalizedSuggestions)]);
|
|
22000
|
+
};
|
|
22001
|
+
|
|
22002
|
+
return h("div", {
|
|
22003
|
+
"class": suggestionsContainer
|
|
22004
|
+
}, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
22005
|
+
"attrs": {
|
|
22006
|
+
"id": _this6.$props.componentId + "-input",
|
|
22007
|
+
"showIcon": _this6.$props.showIcon,
|
|
22008
|
+
"showClear": _this6.$props.showClear,
|
|
22009
|
+
"iconPosition": _this6.$props.iconPosition,
|
|
22010
|
+
"placeholder": _this6.$props.placeholder,
|
|
22011
|
+
"autoFocus": _this6.$props.autoFocus,
|
|
22012
|
+
"themePreset": _this6.themePreset,
|
|
22013
|
+
"autocomplete": "off"
|
|
22014
|
+
},
|
|
22015
|
+
"ref": _this6.$props.innerRef,
|
|
22016
|
+
"class": getClassName$4(_this6.$props.innerClass, 'input'),
|
|
22017
|
+
"on": _extends({}, getInputEvents({
|
|
22018
|
+
onInput: _this6.onInputChange,
|
|
22019
|
+
onBlur: function onBlur(e) {
|
|
22020
|
+
_this6.$emit('blur', e, _this6.triggerQuery);
|
|
22021
|
+
},
|
|
22022
|
+
onFocus: _this6.handleFocus,
|
|
22023
|
+
onKeyPress: function onKeyPress(e) {
|
|
22024
|
+
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
22025
|
+
|
|
22026
|
+
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
22027
|
+
},
|
|
22028
|
+
onKeyDown: function onKeyDown(e) {
|
|
22029
|
+
return _this6.handleKeyDown(e, highlightedIndex);
|
|
22030
|
+
},
|
|
22031
|
+
onKeyUp: function onKeyUp(e) {
|
|
22032
|
+
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
22033
|
+
|
|
22034
|
+
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
22035
|
+
},
|
|
22036
|
+
onClick: function onClick() {
|
|
22037
|
+
setHighlightedIndex(null);
|
|
22038
|
+
}
|
|
22039
|
+
})),
|
|
22040
|
+
"domProps": _extends({}, getInputProps({
|
|
22041
|
+
value: _this6.$data.currentValue === null ? '' : _this6.$data.currentValue
|
|
22042
|
+
}))
|
|
22043
|
+
}), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
|
|
22044
|
+
}
|
|
22045
|
+
}
|
|
22046
|
+
}) : h("div", {
|
|
22047
|
+
"class": suggestionsContainer
|
|
22048
|
+
}, [h(InputGroup, [this.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
|
|
22049
|
+
"class": getClassName$4(this.$props.innerClass, 'input') || '',
|
|
22050
|
+
"attrs": {
|
|
22051
|
+
"placeholder": this.$props.placeholder,
|
|
22052
|
+
"iconPosition": this.$props.iconPosition,
|
|
22053
|
+
"showIcon": this.$props.showIcon,
|
|
22054
|
+
"showClear": this.$props.showClear,
|
|
22055
|
+
"themePreset": this.themePreset
|
|
22056
|
+
},
|
|
22057
|
+
"on": _extends({}, {
|
|
22058
|
+
blur: function blur(e) {
|
|
22059
|
+
_this6.$emit('blur', e, _this6.triggerQuery);
|
|
22060
|
+
},
|
|
22061
|
+
keypress: function keypress(e) {
|
|
22062
|
+
_this6.$emit('keyPress', e, _this6.triggerQuery);
|
|
22063
|
+
|
|
22064
|
+
_this6.$emit('key-press', e, _this6.triggerQuery);
|
|
22065
|
+
},
|
|
22066
|
+
input: this.onInputChange,
|
|
22067
|
+
focus: function focus(e) {
|
|
22068
|
+
_this6.$emit('focus', e, _this6.triggerQuery);
|
|
22069
|
+
},
|
|
22070
|
+
keydown: function keydown(e) {
|
|
22071
|
+
_this6.$emit('keyDown', e, _this6.triggerQuery);
|
|
22072
|
+
|
|
22073
|
+
_this6.$emit('key-down', e, _this6.triggerQuery);
|
|
22074
|
+
},
|
|
22075
|
+
keyup: function keyup(e) {
|
|
22076
|
+
_this6.$emit('keyUp', e, _this6.triggerQuery);
|
|
22077
|
+
|
|
22078
|
+
_this6.$emit('key-up', e, _this6.triggerQuery);
|
|
22079
|
+
}
|
|
22080
|
+
}),
|
|
22081
|
+
"domProps": _extends({}, {
|
|
22082
|
+
autofocus: this.$props.autoFocus,
|
|
22083
|
+
value: this.$data.currentValue ? this.$data.currentValue : ''
|
|
22084
|
+
}),
|
|
22085
|
+
"ref": this.$props.innerRef
|
|
22086
|
+
}), this.renderIcons()]), this.renderInputAddonAfter()])])]);
|
|
22087
|
+
},
|
|
22088
|
+
destroyed: function destroyed() {
|
|
22089
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
22090
|
+
}
|
|
22091
|
+
};
|
|
22092
|
+
|
|
22093
|
+
SearchBox.defaultQuery = function (value, props) {
|
|
22094
|
+
var finalQuery = null;
|
|
22095
|
+
var fields = normalizeDataField$1(props.dataField, props.fieldWeights);
|
|
22096
|
+
finalQuery = {
|
|
22097
|
+
bool: {
|
|
22098
|
+
should: SearchBox.shouldQuery(value, fields, props),
|
|
22099
|
+
minimum_should_match: '1'
|
|
22100
|
+
}
|
|
22101
|
+
};
|
|
22102
|
+
|
|
22103
|
+
if (finalQuery && props.nestedField) {
|
|
22104
|
+
return {
|
|
22105
|
+
query: {
|
|
22106
|
+
nested: {
|
|
22107
|
+
path: props.nestedField,
|
|
22108
|
+
query: finalQuery
|
|
22109
|
+
}
|
|
22110
|
+
}
|
|
22111
|
+
};
|
|
22112
|
+
}
|
|
22113
|
+
|
|
22114
|
+
return finalQuery;
|
|
22115
|
+
};
|
|
22116
|
+
|
|
22117
|
+
SearchBox.shouldQuery = function (value, dataFields, props) {
|
|
22118
|
+
var finalQuery = [];
|
|
22119
|
+
var phrasePrefixFields = [];
|
|
22120
|
+
var fields = dataFields.map(function (dataField) {
|
|
22121
|
+
var queryField = "" + dataField.field + (dataField.weight ? "^" + dataField.weight : '');
|
|
22122
|
+
|
|
22123
|
+
if (!(dataField.field.endsWith('.keyword') || dataField.field.endsWith('.autosuggest') || dataField.field.endsWith('.search'))) {
|
|
22124
|
+
phrasePrefixFields.push(queryField);
|
|
22125
|
+
}
|
|
22126
|
+
|
|
22127
|
+
return queryField;
|
|
22128
|
+
});
|
|
22129
|
+
|
|
22130
|
+
if (props.searchOperators || props.queryString) {
|
|
22131
|
+
return {
|
|
22132
|
+
query: value,
|
|
22133
|
+
fields: fields,
|
|
22134
|
+
default_operator: props.queryFormat
|
|
22135
|
+
};
|
|
22136
|
+
}
|
|
22137
|
+
|
|
22138
|
+
if (props.queryFormat === 'and') {
|
|
22139
|
+
finalQuery.push({
|
|
22140
|
+
multi_match: {
|
|
22141
|
+
query: value,
|
|
22142
|
+
fields: fields,
|
|
22143
|
+
type: 'cross_fields',
|
|
22144
|
+
operator: 'and'
|
|
22145
|
+
}
|
|
22146
|
+
});
|
|
22147
|
+
finalQuery.push({
|
|
22148
|
+
multi_match: {
|
|
22149
|
+
query: value,
|
|
22150
|
+
fields: fields,
|
|
22151
|
+
type: 'phrase',
|
|
22152
|
+
operator: 'and'
|
|
22153
|
+
}
|
|
22154
|
+
});
|
|
22155
|
+
|
|
22156
|
+
if (phrasePrefixFields.length > 0) {
|
|
22157
|
+
finalQuery.push({
|
|
22158
|
+
multi_match: {
|
|
22159
|
+
query: value,
|
|
22160
|
+
fields: phrasePrefixFields,
|
|
22161
|
+
type: 'phrase_prefix',
|
|
22162
|
+
operator: 'and'
|
|
22163
|
+
}
|
|
22164
|
+
});
|
|
22165
|
+
}
|
|
22166
|
+
|
|
22167
|
+
return finalQuery;
|
|
22168
|
+
}
|
|
22169
|
+
|
|
22170
|
+
finalQuery.push({
|
|
22171
|
+
multi_match: {
|
|
22172
|
+
query: value,
|
|
22173
|
+
fields: fields,
|
|
22174
|
+
type: 'best_fields',
|
|
22175
|
+
operator: 'or',
|
|
22176
|
+
fuzziness: props.fuzziness ? props.fuzziness : 0
|
|
22177
|
+
}
|
|
22178
|
+
});
|
|
22179
|
+
finalQuery.push({
|
|
22180
|
+
multi_match: {
|
|
22181
|
+
query: value,
|
|
22182
|
+
fields: fields,
|
|
22183
|
+
type: 'phrase',
|
|
22184
|
+
operator: 'or'
|
|
22185
|
+
}
|
|
22186
|
+
});
|
|
22187
|
+
|
|
22188
|
+
if (phrasePrefixFields.length > 0) {
|
|
22189
|
+
finalQuery.push({
|
|
22190
|
+
multi_match: {
|
|
22191
|
+
query: value,
|
|
22192
|
+
fields: phrasePrefixFields,
|
|
22193
|
+
type: 'phrase_prefix',
|
|
22194
|
+
operator: 'or'
|
|
22195
|
+
}
|
|
22196
|
+
});
|
|
22197
|
+
}
|
|
22198
|
+
|
|
22199
|
+
return finalQuery;
|
|
22200
|
+
};
|
|
22201
|
+
|
|
22202
|
+
var mapStateToProps$4 = function mapStateToProps(state, props) {
|
|
22203
|
+
return {
|
|
22204
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
22205
|
+
selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
|
|
22206
|
+
suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
22207
|
+
rawData: state.rawData[props.componentId],
|
|
22208
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
22209
|
+
themePreset: state.config.themePreset,
|
|
22210
|
+
isLoading: !!state.isLoading[props.componentId + "_active"],
|
|
22211
|
+
error: state.error[props.componentId],
|
|
22212
|
+
enableAppbase: state.config.enableAppbase,
|
|
22213
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
22214
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
22215
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
22216
|
+
};
|
|
22217
|
+
};
|
|
22218
|
+
|
|
22219
|
+
var mapDispatchToProps$3 = {
|
|
22220
|
+
updateQuery: updateQuery$2,
|
|
22221
|
+
setCustomQuery: setCustomQuery$1,
|
|
22222
|
+
setDefaultQuery: setDefaultQuery$2,
|
|
22223
|
+
recordSuggestionClick: recordSuggestionClick$1
|
|
22224
|
+
};
|
|
22225
|
+
var DSConnected$1 = ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(SearchBox), {
|
|
22226
|
+
componentType: constants_1$1.searchBox,
|
|
22227
|
+
internalComponent: true
|
|
22228
|
+
});
|
|
22229
|
+
|
|
22230
|
+
SearchBox.install = function (Vue) {
|
|
22231
|
+
Vue.component(SearchBox.name, DSConnected$1);
|
|
22232
|
+
}; // Add componentType for SSR
|
|
22233
|
+
|
|
22234
|
+
|
|
22235
|
+
SearchBox.componentType = constants_1$1.searchBox;
|
|
22236
|
+
|
|
22237
|
+
var _templateObject$k, _templateObject2$7, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$3;
|
|
22238
|
+
var item = {
|
|
22239
|
+
width: '15px',
|
|
22240
|
+
height: '15px',
|
|
22241
|
+
scale: '4px'
|
|
22242
|
+
};
|
|
22243
|
+
var vh = css(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n"])));
|
|
22244
|
+
var hideInputControl = css(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n"])));
|
|
22245
|
+
|
|
22246
|
+
var formItem = function formItem(_ref) {
|
|
22247
|
+
var theme = _ref.theme;
|
|
22248
|
+
return css(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, curriedLighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
|
|
22249
|
+
};
|
|
22250
|
+
|
|
22251
|
+
var Radio = index$1('input')(_templateObject4$5 || (_templateObject4$5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
22252
|
+
return props.show ? null : hideInputControl;
|
|
22253
|
+
}, function (_ref2) {
|
|
22254
|
+
var theme = _ref2.theme;
|
|
22255
|
+
return theme.colors.primaryColor;
|
|
22256
|
+
}, function (_ref3) {
|
|
22257
|
+
var theme = _ref3.theme;
|
|
22258
|
+
return theme.colors.primaryColor;
|
|
22259
|
+
});
|
|
22260
|
+
var Checkbox = index$1('input')(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
22261
|
+
return props.show ? null : hideInputControl;
|
|
22262
|
+
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
22263
|
+
var theme = _ref4.theme;
|
|
22264
|
+
return theme.colors.primaryColor;
|
|
22265
|
+
}, function (_ref5) {
|
|
22266
|
+
var theme = _ref5.theme;
|
|
22267
|
+
return theme.colors.primaryColor;
|
|
22268
|
+
});
|
|
22269
|
+
var UL = index$1('ul')(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
|
|
22270
|
+
|
|
22271
|
+
var getAggsOrder = lib_8.getAggsOrder;
|
|
22272
|
+
|
|
22273
|
+
var extractQuery = function extractQuery(props) {
|
|
22274
|
+
var queryToBeReturned = {};
|
|
22275
|
+
|
|
22276
|
+
if (props.defaultQuery) {
|
|
22277
|
+
var evaluateQuery = props.defaultQuery([], props);
|
|
22278
|
+
|
|
22279
|
+
if (evaluateQuery) {
|
|
22280
|
+
if (evaluateQuery.query) {
|
|
22281
|
+
queryToBeReturned.query = evaluateQuery.query;
|
|
22282
|
+
}
|
|
22283
|
+
|
|
22284
|
+
if (evaluateQuery.aggs) {
|
|
22285
|
+
queryToBeReturned.aggs = evaluateQuery.aggs;
|
|
22286
|
+
}
|
|
22287
|
+
}
|
|
22288
|
+
}
|
|
22289
|
+
|
|
22290
|
+
return queryToBeReturned;
|
|
22291
|
+
}; // eslint-disable-next-line import/prefer-default-export
|
|
22292
|
+
|
|
22293
|
+
|
|
22294
|
+
var getAggsQuery = function getAggsQuery(query, props) {
|
|
22295
|
+
var _clonedQuery$aggs;
|
|
22296
|
+
|
|
22297
|
+
var clonedQuery = query;
|
|
22298
|
+
var dataField = props.dataField,
|
|
22299
|
+
size = props.size,
|
|
22300
|
+
sortBy = props.sortBy,
|
|
22301
|
+
showMissing = props.showMissing,
|
|
22302
|
+
missingLabel = props.missingLabel;
|
|
22303
|
+
clonedQuery.size = 0;
|
|
22304
|
+
clonedQuery.aggs = (_clonedQuery$aggs = {}, _clonedQuery$aggs[dataField] = {
|
|
22305
|
+
terms: _extends({
|
|
22306
|
+
field: dataField,
|
|
22307
|
+
size: size,
|
|
22308
|
+
order: getAggsOrder(sortBy || 'count')
|
|
22309
|
+
}, showMissing ? {
|
|
22310
|
+
missing: missingLabel
|
|
22311
|
+
} : {})
|
|
22312
|
+
}, _clonedQuery$aggs);
|
|
22313
|
+
|
|
22314
|
+
if (props.nestedField) {
|
|
22315
|
+
clonedQuery.aggs = {
|
|
22316
|
+
reactivesearch_nested: {
|
|
22317
|
+
nested: {
|
|
22318
|
+
path: props.nestedField
|
|
22319
|
+
},
|
|
22320
|
+
aggs: clonedQuery.aggs
|
|
22321
|
+
}
|
|
22322
|
+
};
|
|
22323
|
+
}
|
|
22324
|
+
|
|
22325
|
+
return _extends({}, clonedQuery, extractQuery(props));
|
|
22326
|
+
};
|
|
22327
|
+
|
|
22328
|
+
var updateQuery$3 = lib_5.updateQuery,
|
|
22329
|
+
setQueryOptions$2 = lib_5.setQueryOptions,
|
|
22330
|
+
setCustomQuery$2 = lib_5.setCustomQuery,
|
|
22331
|
+
setDefaultQuery$3 = lib_5.setDefaultQuery;
|
|
22332
|
+
var getQueryOptions$1 = lib_8.getQueryOptions,
|
|
22333
|
+
checkValueChange$2 = lib_8.checkValueChange,
|
|
22334
|
+
getClassName$5 = lib_8.getClassName,
|
|
22335
|
+
getOptionsFromQuery$2 = lib_8.getOptionsFromQuery,
|
|
22336
|
+
isEqual$6 = lib_8.isEqual;
|
|
22337
|
+
var SingleList = {
|
|
22338
|
+
name: 'SingleList',
|
|
22339
|
+
props: {
|
|
22340
|
+
beforeValueChange: types.func,
|
|
22341
|
+
className: VueTypes.string.def(''),
|
|
22342
|
+
componentId: types.stringRequired,
|
|
22343
|
+
customQuery: types.func,
|
|
22344
|
+
dataField: types.stringRequired,
|
|
22345
|
+
defaultValue: types.string,
|
|
22346
|
+
value: types.value,
|
|
22347
|
+
defaultQuery: types.func,
|
|
22348
|
+
filterLabel: types.string,
|
|
22349
|
+
innerClass: types.style,
|
|
22350
|
+
placeholder: VueTypes.string.def('Search'),
|
|
22351
|
+
react: types.react,
|
|
22352
|
+
render: types.func,
|
|
22353
|
+
renderItem: types.func,
|
|
22354
|
+
renderNoResults: VueTypes.any,
|
|
22355
|
+
transformData: types.func,
|
|
22356
|
+
selectAllLabel: types.string,
|
|
22357
|
+
showCount: VueTypes.bool.def(true),
|
|
22358
|
+
showFilter: VueTypes.bool.def(true),
|
|
22359
|
+
showRadio: VueTypes.bool.def(true),
|
|
22360
|
+
showSearch: VueTypes.bool.def(true),
|
|
22361
|
+
size: VueTypes.number,
|
|
22362
|
+
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
22363
|
+
title: types.title,
|
|
22364
|
+
URLParams: VueTypes.bool.def(false),
|
|
22365
|
+
showMissing: VueTypes.bool.def(false),
|
|
22366
|
+
missingLabel: VueTypes.string.def('N/A'),
|
|
22367
|
+
nestedField: types.string,
|
|
22368
|
+
index: VueTypes.string,
|
|
22369
|
+
enableStrictSelection: VueTypes.bool.def(false)
|
|
22370
|
+
},
|
|
22371
|
+
data: function data() {
|
|
22372
|
+
var props = this.$props;
|
|
22373
|
+
this.__state = {
|
|
22374
|
+
currentValue: '',
|
|
22375
|
+
modifiedOptions: [],
|
|
22376
|
+
searchTerm: ''
|
|
22377
|
+
};
|
|
22378
|
+
this.internalComponent = props.componentId + "__internal";
|
|
22379
|
+
return this.__state;
|
|
22380
|
+
},
|
|
22381
|
+
created: function created() {
|
|
22382
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
22383
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
22384
|
+
}
|
|
22385
|
+
|
|
22386
|
+
var props = this.$props;
|
|
22387
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
22388
|
+
|
|
22389
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
22390
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
22391
|
+
},
|
|
22392
|
+
beforeMount: function beforeMount() {
|
|
22393
|
+
this.updateQueryHandlerOptions(this.$props);
|
|
22394
|
+
|
|
22395
|
+
if (this.selectedValue) {
|
|
22396
|
+
this.setValue(this.selectedValue);
|
|
22397
|
+
} else if (this.$props.value) {
|
|
21141
22398
|
this.setValue(this.$props.value);
|
|
21142
22399
|
} else if (this.$props.defaultValue) {
|
|
21143
22400
|
this.setValue(this.$props.defaultValue);
|
|
@@ -21163,7 +22420,7 @@
|
|
|
21163
22420
|
this.setValue(newVal);
|
|
21164
22421
|
},
|
|
21165
22422
|
value: function value(newVal, oldVal) {
|
|
21166
|
-
if (!isEqual$
|
|
22423
|
+
if (!isEqual$6(newVal, oldVal)) {
|
|
21167
22424
|
this.setValue(newVal);
|
|
21168
22425
|
}
|
|
21169
22426
|
},
|
|
@@ -21226,14 +22483,14 @@
|
|
|
21226
22483
|
return h(Container, {
|
|
21227
22484
|
"class": this.$props.className
|
|
21228
22485
|
}, [this.$props.title && h(Title, {
|
|
21229
|
-
"class": getClassName$
|
|
22486
|
+
"class": getClassName$5(this.$props.innerClass, 'title') || ''
|
|
21230
22487
|
}, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
|
|
21231
|
-
"class": getClassName$
|
|
22488
|
+
"class": getClassName$5(this.$props.innerClass, 'list') || ''
|
|
21232
22489
|
}, [selectAllLabel ? h("li", {
|
|
21233
22490
|
"key": selectAllLabel,
|
|
21234
22491
|
"class": "" + (this.$data.currentValue === selectAllLabel ? 'active' : '')
|
|
21235
22492
|
}, [h(Radio, {
|
|
21236
|
-
"class": getClassName$
|
|
22493
|
+
"class": getClassName$5(this.$props.innerClass, 'radio'),
|
|
21237
22494
|
"attrs": {
|
|
21238
22495
|
"id": this.$props.componentId + "-" + selectAllLabel,
|
|
21239
22496
|
"name": this.$props.componentId,
|
|
@@ -21248,7 +22505,7 @@
|
|
|
21248
22505
|
checked: this.$data.currentValue === selectAllLabel
|
|
21249
22506
|
})
|
|
21250
22507
|
}), h("label", {
|
|
21251
|
-
"class": getClassName$
|
|
22508
|
+
"class": getClassName$5(this.$props.innerClass, 'label') || null,
|
|
21252
22509
|
"attrs": {
|
|
21253
22510
|
"for": this.$props.componentId + "-" + selectAllLabel
|
|
21254
22511
|
}
|
|
@@ -21257,7 +22514,7 @@
|
|
|
21257
22514
|
"key": item.key,
|
|
21258
22515
|
"class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
|
|
21259
22516
|
}, [h(Radio, {
|
|
21260
|
-
"class": getClassName$
|
|
22517
|
+
"class": getClassName$5(_this.$props.innerClass, 'radio'),
|
|
21261
22518
|
"attrs": {
|
|
21262
22519
|
"id": _this.$props.componentId + "-" + item.key,
|
|
21263
22520
|
"name": _this.$props.componentId,
|
|
@@ -21273,7 +22530,7 @@
|
|
|
21273
22530
|
checked: _this.currentValue === String(item.key)
|
|
21274
22531
|
})
|
|
21275
22532
|
}), h("label", {
|
|
21276
|
-
"class": getClassName$
|
|
22533
|
+
"class": getClassName$5(_this.$props.innerClass, 'label') || null,
|
|
21277
22534
|
"attrs": {
|
|
21278
22535
|
"for": _this.$props.componentId + "-" + item.key
|
|
21279
22536
|
}
|
|
@@ -21282,7 +22539,7 @@
|
|
|
21282
22539
|
count: item.doc_count,
|
|
21283
22540
|
isChecked: _this.currentValue === String(item.key)
|
|
21284
22541
|
}) : h("span", [item.key, _this.$props.showCount && h("span", {
|
|
21285
|
-
"class": getClassName$
|
|
22542
|
+
"class": getClassName$5(_this.$props.innerClass, 'count') || null
|
|
21286
22543
|
}, ["\xA0(", item.doc_count, ")"])])])]);
|
|
21287
22544
|
})])]);
|
|
21288
22545
|
},
|
|
@@ -21310,7 +22567,7 @@
|
|
|
21310
22567
|
_this2.$emit('value-change', value);
|
|
21311
22568
|
};
|
|
21312
22569
|
|
|
21313
|
-
checkValueChange$
|
|
22570
|
+
checkValueChange$2(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
21314
22571
|
},
|
|
21315
22572
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
21316
22573
|
var defaultQueryOptions;
|
|
@@ -21328,7 +22585,7 @@
|
|
|
21328
22585
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
21329
22586
|
}
|
|
21330
22587
|
|
|
21331
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
22588
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
21332
22589
|
this.updateQuery({
|
|
21333
22590
|
componentId: this.internalComponent,
|
|
21334
22591
|
query: query,
|
|
@@ -21349,7 +22606,7 @@
|
|
|
21349
22606
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
21350
22607
|
}
|
|
21351
22608
|
|
|
21352
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
22609
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
21353
22610
|
this.updateQuery({
|
|
21354
22611
|
componentId: props.componentId,
|
|
21355
22612
|
query: query,
|
|
@@ -21384,7 +22641,7 @@
|
|
|
21384
22641
|
|
|
21385
22642
|
if (this.$props.showSearch) {
|
|
21386
22643
|
return h(Input, {
|
|
21387
|
-
"class": getClassName$
|
|
22644
|
+
"class": getClassName$5(this.$props.innerClass, 'input') || '',
|
|
21388
22645
|
"on": {
|
|
21389
22646
|
"input": this.handleInputChange
|
|
21390
22647
|
},
|
|
@@ -21447,7 +22704,7 @@
|
|
|
21447
22704
|
var h = this.$createElement;
|
|
21448
22705
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
21449
22706
|
return h("p", {
|
|
21450
|
-
"class": getClassName$
|
|
22707
|
+
"class": getClassName$5(this.$props.innerClass, 'noResults') || null
|
|
21451
22708
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
21452
22709
|
}
|
|
21453
22710
|
},
|
|
@@ -21514,7 +22771,7 @@
|
|
|
21514
22771
|
return query;
|
|
21515
22772
|
};
|
|
21516
22773
|
|
|
21517
|
-
var mapStateToProps$
|
|
22774
|
+
var mapStateToProps$5 = function mapStateToProps(state, props) {
|
|
21518
22775
|
return {
|
|
21519
22776
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
21520
22777
|
rawData: state.rawData[props.componentId],
|
|
@@ -21529,11 +22786,11 @@
|
|
|
21529
22786
|
|
|
21530
22787
|
var mapDispatchtoProps$2 = {
|
|
21531
22788
|
setQueryOptions: setQueryOptions$2,
|
|
21532
|
-
updateQuery: updateQuery$
|
|
21533
|
-
setCustomQuery: setCustomQuery$
|
|
21534
|
-
setDefaultQuery: setDefaultQuery$
|
|
22789
|
+
updateQuery: updateQuery$3,
|
|
22790
|
+
setCustomQuery: setCustomQuery$2,
|
|
22791
|
+
setDefaultQuery: setDefaultQuery$3
|
|
21535
22792
|
};
|
|
21536
|
-
var ListConnected = ComponentWrapper$1(connect(mapStateToProps$
|
|
22793
|
+
var ListConnected = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
|
|
21537
22794
|
componentType: constants_1$1.singleList,
|
|
21538
22795
|
internalComponent: true
|
|
21539
22796
|
});
|
|
@@ -21545,14 +22802,14 @@
|
|
|
21545
22802
|
|
|
21546
22803
|
SingleList.componentType = constants_1$1.singleList;
|
|
21547
22804
|
|
|
21548
|
-
var updateQuery$
|
|
22805
|
+
var updateQuery$4 = lib_5.updateQuery,
|
|
21549
22806
|
setQueryOptions$3 = lib_5.setQueryOptions,
|
|
21550
|
-
setCustomQuery$
|
|
21551
|
-
setDefaultQuery$
|
|
21552
|
-
var isEqual$
|
|
22807
|
+
setCustomQuery$3 = lib_5.setCustomQuery,
|
|
22808
|
+
setDefaultQuery$4 = lib_5.setDefaultQuery;
|
|
22809
|
+
var isEqual$7 = lib_8.isEqual,
|
|
21553
22810
|
getQueryOptions$2 = lib_8.getQueryOptions,
|
|
21554
|
-
checkValueChange$
|
|
21555
|
-
getClassName$
|
|
22811
|
+
checkValueChange$3 = lib_8.checkValueChange,
|
|
22812
|
+
getClassName$6 = lib_8.getClassName,
|
|
21556
22813
|
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery;
|
|
21557
22814
|
var MultiList = {
|
|
21558
22815
|
name: 'MultiList',
|
|
@@ -21612,13 +22869,14 @@
|
|
|
21612
22869
|
},
|
|
21613
22870
|
beforeMount: function beforeMount() {
|
|
21614
22871
|
this.updateQueryHandlerOptions(this.$props);
|
|
22872
|
+
var value = this.selectedValue || this.$props.value || this.$props.defaultValue;
|
|
22873
|
+
this.setValue(value, !this.selectedValue);
|
|
22874
|
+
},
|
|
22875
|
+
mounted: function mounted() {
|
|
22876
|
+
var currentValue = Object.keys(this.$data.currentValue);
|
|
21615
22877
|
|
|
21616
|
-
if (this.
|
|
21617
|
-
this
|
|
21618
|
-
} else if (this.$props.value) {
|
|
21619
|
-
this.setValue(this.$props.value, true);
|
|
21620
|
-
} else if (this.$props.defaultValue) {
|
|
21621
|
-
this.setValue(this.$props.defaultValue, true);
|
|
22878
|
+
if (this.$props.value !== undefined && !isEqual$7(this.$props.value, currentValue)) {
|
|
22879
|
+
this.$emit('change', currentValue);
|
|
21622
22880
|
}
|
|
21623
22881
|
},
|
|
21624
22882
|
watch: {
|
|
@@ -21638,12 +22896,12 @@
|
|
|
21638
22896
|
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
21639
22897
|
},
|
|
21640
22898
|
value: function value(newVal, oldVal) {
|
|
21641
|
-
if (!isEqual$
|
|
22899
|
+
if (!isEqual$7(oldVal, newVal)) {
|
|
21642
22900
|
this.setValue(newVal, true);
|
|
21643
22901
|
}
|
|
21644
22902
|
},
|
|
21645
22903
|
defaultValue: function defaultValue(newVal, oldVal) {
|
|
21646
|
-
if (!isEqual$
|
|
22904
|
+
if (!isEqual$7(oldVal, newVal)) {
|
|
21647
22905
|
this.setValue(newVal, true);
|
|
21648
22906
|
}
|
|
21649
22907
|
},
|
|
@@ -21662,8 +22920,12 @@
|
|
|
21662
22920
|
}
|
|
21663
22921
|
}
|
|
21664
22922
|
|
|
21665
|
-
if (!isEqual$
|
|
21666
|
-
this.
|
|
22923
|
+
if (!isEqual$7(selectedValue, newVal)) {
|
|
22924
|
+
if (this.value === undefined) {
|
|
22925
|
+
this.setValue(newVal, true);
|
|
22926
|
+
} else {
|
|
22927
|
+
this.$emit('change', newVal);
|
|
22928
|
+
}
|
|
21667
22929
|
}
|
|
21668
22930
|
},
|
|
21669
22931
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -21720,9 +22982,9 @@
|
|
|
21720
22982
|
return h(Container, {
|
|
21721
22983
|
"class": this.$props.className
|
|
21722
22984
|
}, [this.$props.title && h(Title, {
|
|
21723
|
-
"class": getClassName$
|
|
22985
|
+
"class": getClassName$6(this.$props.innerClass, 'title')
|
|
21724
22986
|
}, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
|
|
21725
|
-
"class": getClassName$
|
|
22987
|
+
"class": getClassName$6(this.$props.innerClass, 'list')
|
|
21726
22988
|
}, [selectAllLabel ? h("li", {
|
|
21727
22989
|
"key": selectAllLabel,
|
|
21728
22990
|
"class": "" + (this.currentValue[selectAllLabel] ? 'active' : '')
|
|
@@ -21734,7 +22996,7 @@
|
|
|
21734
22996
|
"value": selectAllLabel,
|
|
21735
22997
|
"show": this.$props.showCheckbox
|
|
21736
22998
|
},
|
|
21737
|
-
"class": getClassName$
|
|
22999
|
+
"class": getClassName$6(this.$props.innerClass, 'checkbox'),
|
|
21738
23000
|
"on": {
|
|
21739
23001
|
"click": this.handleClick
|
|
21740
23002
|
},
|
|
@@ -21742,7 +23004,7 @@
|
|
|
21742
23004
|
checked: !!this.currentValue[selectAllLabel]
|
|
21743
23005
|
})
|
|
21744
23006
|
}), h("label", {
|
|
21745
|
-
"class": getClassName$
|
|
23007
|
+
"class": getClassName$6(this.$props.innerClass, 'label'),
|
|
21746
23008
|
"attrs": {
|
|
21747
23009
|
"for": this.$props.componentId + "-" + selectAllLabel
|
|
21748
23010
|
}
|
|
@@ -21758,7 +23020,7 @@
|
|
|
21758
23020
|
"value": item.key,
|
|
21759
23021
|
"show": _this2.$props.showCheckbox
|
|
21760
23022
|
},
|
|
21761
|
-
"class": getClassName$
|
|
23023
|
+
"class": getClassName$6(_this2.$props.innerClass, 'checkbox'),
|
|
21762
23024
|
"on": {
|
|
21763
23025
|
"click": _this2.handleClick
|
|
21764
23026
|
},
|
|
@@ -21766,7 +23028,7 @@
|
|
|
21766
23028
|
checked: !!_this2.$data.currentValue[item.key]
|
|
21767
23029
|
})
|
|
21768
23030
|
}), h("label", {
|
|
21769
|
-
"class": getClassName$
|
|
23031
|
+
"class": getClassName$6(_this2.$props.innerClass, 'label'),
|
|
21770
23032
|
"attrs": {
|
|
21771
23033
|
"for": _this2.$props.componentId + "-" + item.key
|
|
21772
23034
|
}
|
|
@@ -21775,7 +23037,7 @@
|
|
|
21775
23037
|
count: item.doc_count,
|
|
21776
23038
|
isChecked: !!_this2.$data.currentValue[item.key]
|
|
21777
23039
|
}) : h("span", [item.key, _this2.$props.showCount && h("span", {
|
|
21778
|
-
"class": getClassName$
|
|
23040
|
+
"class": getClassName$6(_this2.$props.innerClass, 'count')
|
|
21779
23041
|
}, ["\xA0(", item.doc_count, ")"])])])]);
|
|
21780
23042
|
})])]);
|
|
21781
23043
|
},
|
|
@@ -21859,7 +23121,7 @@
|
|
|
21859
23121
|
_this3.$emit('value-change', finalValues);
|
|
21860
23122
|
};
|
|
21861
23123
|
|
|
21862
|
-
checkValueChange$
|
|
23124
|
+
checkValueChange$3(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
21863
23125
|
},
|
|
21864
23126
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
21865
23127
|
var defaultQueryOptions;
|
|
@@ -21877,7 +23139,7 @@
|
|
|
21877
23139
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
21878
23140
|
}
|
|
21879
23141
|
|
|
21880
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
23142
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
21881
23143
|
this.updateQuery({
|
|
21882
23144
|
componentId: this.internalComponent,
|
|
21883
23145
|
query: query,
|
|
@@ -21898,7 +23160,7 @@
|
|
|
21898
23160
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
21899
23161
|
}
|
|
21900
23162
|
|
|
21901
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
23163
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
21902
23164
|
this.updateQuery({
|
|
21903
23165
|
componentId: props.componentId,
|
|
21904
23166
|
query: query,
|
|
@@ -21933,7 +23195,7 @@
|
|
|
21933
23195
|
|
|
21934
23196
|
if (this.$props.showSearch) {
|
|
21935
23197
|
return h(Input, {
|
|
21936
|
-
"class": getClassName$
|
|
23198
|
+
"class": getClassName$6(this.$props.innerClass, 'input') || '',
|
|
21937
23199
|
"on": {
|
|
21938
23200
|
"input": this.handleInputChange
|
|
21939
23201
|
},
|
|
@@ -21962,7 +23224,7 @@
|
|
|
21962
23224
|
if (value === undefined) {
|
|
21963
23225
|
this.setValue(currentValue);
|
|
21964
23226
|
} else {
|
|
21965
|
-
var values = parseValueArray(value, currentValue);
|
|
23227
|
+
var values = parseValueArray(value || [], currentValue);
|
|
21966
23228
|
this.$emit('change', values);
|
|
21967
23229
|
}
|
|
21968
23230
|
},
|
|
@@ -21991,7 +23253,7 @@
|
|
|
21991
23253
|
var h = this.$createElement;
|
|
21992
23254
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
21993
23255
|
return h("p", {
|
|
21994
|
-
"class": getClassName$
|
|
23256
|
+
"class": getClassName$6(this.$props.innerClass, 'noResults') || null
|
|
21995
23257
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
21996
23258
|
}
|
|
21997
23259
|
},
|
|
@@ -22092,7 +23354,7 @@
|
|
|
22092
23354
|
return getAggsQuery(queryOptions, props);
|
|
22093
23355
|
};
|
|
22094
23356
|
|
|
22095
|
-
var mapStateToProps$
|
|
23357
|
+
var mapStateToProps$6 = function mapStateToProps(state, props) {
|
|
22096
23358
|
return {
|
|
22097
23359
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
22098
23360
|
rawData: state.rawData[props.componentId],
|
|
@@ -22107,11 +23369,11 @@
|
|
|
22107
23369
|
|
|
22108
23370
|
var mapDispatchtoProps$3 = {
|
|
22109
23371
|
setQueryOptions: setQueryOptions$3,
|
|
22110
|
-
updateQuery: updateQuery$
|
|
22111
|
-
setCustomQuery: setCustomQuery$
|
|
22112
|
-
setDefaultQuery: setDefaultQuery$
|
|
23372
|
+
updateQuery: updateQuery$4,
|
|
23373
|
+
setCustomQuery: setCustomQuery$3,
|
|
23374
|
+
setDefaultQuery: setDefaultQuery$4
|
|
22113
23375
|
};
|
|
22114
|
-
var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$
|
|
23376
|
+
var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
|
|
22115
23377
|
componentType: constants_1$1.multiList,
|
|
22116
23378
|
internalComponent: true
|
|
22117
23379
|
});
|
|
@@ -22123,8 +23385,8 @@
|
|
|
22123
23385
|
|
|
22124
23386
|
MultiList.componentType = constants_1$1.multiList;
|
|
22125
23387
|
|
|
22126
|
-
var _templateObject$
|
|
22127
|
-
var small = css(_templateObject$
|
|
23388
|
+
var _templateObject$l, _templateObject2$8, _templateObject3$7, _templateObject4$6;
|
|
23389
|
+
var small = css(_templateObject$l || (_templateObject$l = _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"])));
|
|
22128
23390
|
|
|
22129
23391
|
var dark$2 = function dark(_ref) {
|
|
22130
23392
|
var theme = _ref.theme;
|
|
@@ -22142,13 +23404,13 @@
|
|
|
22142
23404
|
return theme.colors.primaryColor;
|
|
22143
23405
|
});
|
|
22144
23406
|
|
|
22145
|
-
var _templateObject$
|
|
22146
|
-
var open = css(_templateObject$
|
|
23407
|
+
var _templateObject$m, _templateObject2$9;
|
|
23408
|
+
var open = css(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
|
|
22147
23409
|
var Chevron = index$1('span')(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
|
|
22148
23410
|
return props.open ? open : null;
|
|
22149
23411
|
});
|
|
22150
23412
|
|
|
22151
|
-
var getClassName$
|
|
23413
|
+
var getClassName$7 = lib_8.getClassName;
|
|
22152
23414
|
var Dropdown = {
|
|
22153
23415
|
data: function data() {
|
|
22154
23416
|
this.__state = {
|
|
@@ -22234,14 +23496,15 @@
|
|
|
22234
23496
|
isOpen = _ref.isOpen,
|
|
22235
23497
|
highlightedIndex = _ref.highlightedIndex,
|
|
22236
23498
|
getButtonProps = _ref.getButtonProps,
|
|
22237
|
-
getItemEvents = _ref.getItemEvents
|
|
23499
|
+
getItemEvents = _ref.getItemEvents,
|
|
23500
|
+
getInputEvents = _ref.getInputEvents;
|
|
22238
23501
|
return h("div", {
|
|
22239
23502
|
"class": suggestionsContainer
|
|
22240
23503
|
}, [h(Select, {
|
|
22241
23504
|
"on": _extends({}, _extends({}, getButtonProps({
|
|
22242
23505
|
onClick: _this.toggle
|
|
22243
23506
|
}))),
|
|
22244
|
-
"class": getClassName$
|
|
23507
|
+
"class": getClassName$7(_this.$props.innerClass, 'select') || '',
|
|
22245
23508
|
"attrs": {
|
|
22246
23509
|
"title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
|
|
22247
23510
|
"small": _this.$props.small,
|
|
@@ -22258,8 +23521,14 @@
|
|
|
22258
23521
|
getButtonProps: getButtonProps,
|
|
22259
23522
|
getItemEvents: getItemEvents
|
|
22260
23523
|
}) : isOpen && itemsToRender.length ? h("ul", {
|
|
22261
|
-
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$
|
|
22262
|
-
}, [_this.$props.showSearch ? _this.renderSearchbox(
|
|
23524
|
+
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$7(_this.$props.innerClass, 'list')
|
|
23525
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
23526
|
+
on: {
|
|
23527
|
+
input: getInputEvents({
|
|
23528
|
+
onInput: _this.handleInputChange
|
|
23529
|
+
}).input
|
|
23530
|
+
}
|
|
23531
|
+
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
22263
23532
|
var selected = _this.$props.multi // MultiDropdownList
|
|
22264
23533
|
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
22265
23534
|
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
@@ -22287,9 +23556,9 @@
|
|
|
22287
23556
|
"innerHTML": item[labelField]
|
|
22288
23557
|
}
|
|
22289
23558
|
}) : item[labelField], _this.$props.showCount && item.doc_count && h("span", {
|
|
22290
|
-
"class": getClassName$
|
|
23559
|
+
"class": getClassName$7(_this.$props.innerClass, 'count') || ''
|
|
22291
23560
|
}, ["\xA0(", item.doc_count, ")"])]), selected && _this.$props.multi ? h(Tick, {
|
|
22292
|
-
"class": getClassName$
|
|
23561
|
+
"class": getClassName$7(_this.$props.innerClass, 'icon') || ''
|
|
22293
23562
|
}) : null]);
|
|
22294
23563
|
}), footer]) : null]);
|
|
22295
23564
|
}
|
|
@@ -22377,10 +23646,10 @@
|
|
|
22377
23646
|
var h = this.$createElement;
|
|
22378
23647
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
22379
23648
|
return h("p", {
|
|
22380
|
-
"class": getClassName$
|
|
23649
|
+
"class": getClassName$7(this.$props.innerClass, 'noResults') || null
|
|
22381
23650
|
}, [isFunction$1(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
22382
23651
|
},
|
|
22383
|
-
renderSearchbox: function renderSearchbox() {
|
|
23652
|
+
renderSearchbox: function renderSearchbox(eventObject) {
|
|
22384
23653
|
var h = this.$createElement;
|
|
22385
23654
|
var _this$$props2 = this.$props,
|
|
22386
23655
|
componentId = _this$$props2.componentId,
|
|
@@ -22388,7 +23657,7 @@
|
|
|
22388
23657
|
showClear = _this$$props2.showClear,
|
|
22389
23658
|
themePreset = _this$$props2.themePreset,
|
|
22390
23659
|
innerClass = _this$$props2.innerClass;
|
|
22391
|
-
var InputComponent = h(Input, {
|
|
23660
|
+
var InputComponent = h(Input, helper$1([{
|
|
22392
23661
|
"attrs": {
|
|
22393
23662
|
"id": componentId + "-input",
|
|
22394
23663
|
"showIcon": false,
|
|
@@ -22401,11 +23670,8 @@
|
|
|
22401
23670
|
border: 0,
|
|
22402
23671
|
borderBottom: '1px solid #ddd'
|
|
22403
23672
|
},
|
|
22404
|
-
"class": getClassName$
|
|
22405
|
-
|
|
22406
|
-
"change": this.handleInputChange
|
|
22407
|
-
}
|
|
22408
|
-
});
|
|
23673
|
+
"class": getClassName$7(innerClass, 'input')
|
|
23674
|
+
}, eventObject]));
|
|
22409
23675
|
|
|
22410
23676
|
if (showClear) {
|
|
22411
23677
|
return h(InputWrapper, [InputComponent, this.searchTerm && h(IconGroup, {
|
|
@@ -22428,17 +23694,17 @@
|
|
|
22428
23694
|
}
|
|
22429
23695
|
};
|
|
22430
23696
|
|
|
22431
|
-
var updateQuery$
|
|
23697
|
+
var updateQuery$5 = lib_5.updateQuery,
|
|
22432
23698
|
setQueryOptions$4 = lib_5.setQueryOptions,
|
|
22433
|
-
setCustomQuery$
|
|
22434
|
-
setDefaultQuery$
|
|
23699
|
+
setCustomQuery$4 = lib_5.setCustomQuery,
|
|
23700
|
+
setDefaultQuery$5 = lib_5.setDefaultQuery;
|
|
22435
23701
|
var getQueryOptions$3 = lib_8.getQueryOptions,
|
|
22436
|
-
checkValueChange$
|
|
23702
|
+
checkValueChange$4 = lib_8.checkValueChange,
|
|
22437
23703
|
checkPropChange$1 = lib_8.checkPropChange,
|
|
22438
|
-
getClassName$
|
|
23704
|
+
getClassName$8 = lib_8.getClassName,
|
|
22439
23705
|
getOptionsFromQuery$4 = lib_8.getOptionsFromQuery,
|
|
22440
|
-
isEqual$
|
|
22441
|
-
getCompositeAggsQuery$
|
|
23706
|
+
isEqual$8 = lib_8.isEqual,
|
|
23707
|
+
getCompositeAggsQuery$3 = lib_8.getCompositeAggsQuery;
|
|
22442
23708
|
var SingleDropdownList = {
|
|
22443
23709
|
name: 'SingleDropdownList',
|
|
22444
23710
|
data: function data() {
|
|
@@ -22559,7 +23825,7 @@
|
|
|
22559
23825
|
this.setValue(newVal);
|
|
22560
23826
|
},
|
|
22561
23827
|
value: function value(newVal, oldVal) {
|
|
22562
|
-
if (!isEqual$
|
|
23828
|
+
if (!isEqual$8(newVal, oldVal)) {
|
|
22563
23829
|
this.setValue(newVal);
|
|
22564
23830
|
}
|
|
22565
23831
|
},
|
|
@@ -22619,7 +23885,7 @@
|
|
|
22619
23885
|
return h(Container, {
|
|
22620
23886
|
"class": this.$props.className
|
|
22621
23887
|
}, [this.$props.title && h(Title, {
|
|
22622
|
-
"class": getClassName$
|
|
23888
|
+
"class": getClassName$8(this.$props.innerClass, 'title') || ''
|
|
22623
23889
|
}, [this.$props.title]), h(Dropdown, {
|
|
22624
23890
|
"attrs": {
|
|
22625
23891
|
"innerClass": this.$props.innerClass,
|
|
@@ -22675,7 +23941,7 @@
|
|
|
22675
23941
|
_this2.$emit('value-change', value);
|
|
22676
23942
|
};
|
|
22677
23943
|
|
|
22678
|
-
checkValueChange$
|
|
23944
|
+
checkValueChange$4(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
22679
23945
|
},
|
|
22680
23946
|
handleChange: function handleChange(item) {
|
|
22681
23947
|
var value = this.$props.value;
|
|
@@ -22702,7 +23968,7 @@
|
|
|
22702
23968
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
22703
23969
|
}
|
|
22704
23970
|
|
|
22705
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
23971
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
22706
23972
|
this.updateQuery({
|
|
22707
23973
|
componentId: this.internalComponent,
|
|
22708
23974
|
query: query,
|
|
@@ -22723,7 +23989,7 @@
|
|
|
22723
23989
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
22724
23990
|
}
|
|
22725
23991
|
|
|
22726
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
23992
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
22727
23993
|
this.updateQuery({
|
|
22728
23994
|
componentId: props.componentId,
|
|
22729
23995
|
query: query,
|
|
@@ -22736,7 +24002,7 @@
|
|
|
22736
24002
|
},
|
|
22737
24003
|
generateQueryOptions: function generateQueryOptions(props, after) {
|
|
22738
24004
|
var queryOptions = getQueryOptions$3(props);
|
|
22739
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24005
|
+
return props.showLoadMore ? getCompositeAggsQuery$3({
|
|
22740
24006
|
query: queryOptions,
|
|
22741
24007
|
props: props,
|
|
22742
24008
|
after: after
|
|
@@ -22842,14 +24108,14 @@
|
|
|
22842
24108
|
|
|
22843
24109
|
SingleDropdownList.generateQueryOptions = function (props, after) {
|
|
22844
24110
|
var queryOptions = getQueryOptions$3(props);
|
|
22845
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24111
|
+
return props.showLoadMore ? getCompositeAggsQuery$3({
|
|
22846
24112
|
query: queryOptions,
|
|
22847
24113
|
props: props,
|
|
22848
24114
|
after: after
|
|
22849
24115
|
}) : getAggsQuery(queryOptions, props);
|
|
22850
24116
|
};
|
|
22851
24117
|
|
|
22852
|
-
var mapStateToProps$
|
|
24118
|
+
var mapStateToProps$7 = function mapStateToProps(state, props) {
|
|
22853
24119
|
return {
|
|
22854
24120
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
22855
24121
|
rawData: state.rawData[props.componentId],
|
|
@@ -22864,11 +24130,11 @@
|
|
|
22864
24130
|
|
|
22865
24131
|
var mapDispatchtoProps$4 = {
|
|
22866
24132
|
setQueryOptions: setQueryOptions$4,
|
|
22867
|
-
updateQuery: updateQuery$
|
|
22868
|
-
setCustomQuery: setCustomQuery$
|
|
22869
|
-
setDefaultQuery: setDefaultQuery$
|
|
24133
|
+
updateQuery: updateQuery$5,
|
|
24134
|
+
setCustomQuery: setCustomQuery$4,
|
|
24135
|
+
setDefaultQuery: setDefaultQuery$5
|
|
22870
24136
|
};
|
|
22871
|
-
var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$
|
|
24137
|
+
var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
|
|
22872
24138
|
componentType: constants_1$1.singleDropdownList,
|
|
22873
24139
|
internalComponent: true
|
|
22874
24140
|
});
|
|
@@ -22880,17 +24146,17 @@
|
|
|
22880
24146
|
|
|
22881
24147
|
SingleDropdownList.componentType = constants_1$1.singleDropdownList;
|
|
22882
24148
|
|
|
22883
|
-
var updateQuery$
|
|
24149
|
+
var updateQuery$6 = lib_5.updateQuery,
|
|
22884
24150
|
setQueryOptions$5 = lib_5.setQueryOptions,
|
|
22885
|
-
setCustomQuery$
|
|
22886
|
-
setDefaultQuery$
|
|
22887
|
-
var isEqual$
|
|
24151
|
+
setCustomQuery$5 = lib_5.setCustomQuery,
|
|
24152
|
+
setDefaultQuery$6 = lib_5.setDefaultQuery;
|
|
24153
|
+
var isEqual$9 = lib_8.isEqual,
|
|
22888
24154
|
getQueryOptions$4 = lib_8.getQueryOptions,
|
|
22889
|
-
checkValueChange$
|
|
24155
|
+
checkValueChange$5 = lib_8.checkValueChange,
|
|
22890
24156
|
checkPropChange$2 = lib_8.checkPropChange,
|
|
22891
|
-
getClassName$
|
|
24157
|
+
getClassName$9 = lib_8.getClassName,
|
|
22892
24158
|
getOptionsFromQuery$5 = lib_8.getOptionsFromQuery,
|
|
22893
|
-
getCompositeAggsQuery$
|
|
24159
|
+
getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery;
|
|
22894
24160
|
var MultiDropdownList = {
|
|
22895
24161
|
name: 'MultiDropdownList',
|
|
22896
24162
|
data: function data() {
|
|
@@ -22980,7 +24246,7 @@
|
|
|
22980
24246
|
}
|
|
22981
24247
|
}
|
|
22982
24248
|
|
|
22983
|
-
if (!isEqual$
|
|
24249
|
+
if (!isEqual$9(selectedValue, newVal)) {
|
|
22984
24250
|
this.setValue(newVal || [], true);
|
|
22985
24251
|
}
|
|
22986
24252
|
},
|
|
@@ -23031,7 +24297,7 @@
|
|
|
23031
24297
|
this.setValue(newVal, true);
|
|
23032
24298
|
},
|
|
23033
24299
|
value: function value(newVal, oldVal) {
|
|
23034
|
-
if (!isEqual$
|
|
24300
|
+
if (!isEqual$9(newVal, oldVal)) {
|
|
23035
24301
|
this.setValue(newVal, true);
|
|
23036
24302
|
}
|
|
23037
24303
|
},
|
|
@@ -23086,7 +24352,7 @@
|
|
|
23086
24352
|
return h(Container, {
|
|
23087
24353
|
"class": this.$props.className
|
|
23088
24354
|
}, [this.$props.title && h(Title, {
|
|
23089
|
-
"class": getClassName$
|
|
24355
|
+
"class": getClassName$9(this.$props.innerClass, 'title') || ''
|
|
23090
24356
|
}, [this.$props.title]), h(Dropdown, {
|
|
23091
24357
|
"attrs": {
|
|
23092
24358
|
"innerClass": this.$props.innerClass,
|
|
@@ -23202,7 +24468,7 @@
|
|
|
23202
24468
|
}
|
|
23203
24469
|
|
|
23204
24470
|
var performUpdate = function performUpdate() {
|
|
23205
|
-
_this3.currentValue = currentValue;
|
|
24471
|
+
_this3.currentValue = _extends({}, currentValue);
|
|
23206
24472
|
|
|
23207
24473
|
_this3.updateQueryHandler(finalValues, props);
|
|
23208
24474
|
|
|
@@ -23211,7 +24477,7 @@
|
|
|
23211
24477
|
_this3.$emit('value-change', finalValues);
|
|
23212
24478
|
};
|
|
23213
24479
|
|
|
23214
|
-
checkValueChange$
|
|
24480
|
+
checkValueChange$5(props.componentId, finalValues, props.beforeValueChange, performUpdate);
|
|
23215
24481
|
},
|
|
23216
24482
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
23217
24483
|
var defaultQueryOptions;
|
|
@@ -23229,7 +24495,7 @@
|
|
|
23229
24495
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
23230
24496
|
}
|
|
23231
24497
|
|
|
23232
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
24498
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
23233
24499
|
this.updateQuery({
|
|
23234
24500
|
componentId: this.internalComponent,
|
|
23235
24501
|
query: query,
|
|
@@ -23250,7 +24516,7 @@
|
|
|
23250
24516
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
23251
24517
|
}
|
|
23252
24518
|
|
|
23253
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
24519
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23254
24520
|
this.updateQuery({
|
|
23255
24521
|
componentId: props.componentId,
|
|
23256
24522
|
query: query,
|
|
@@ -23263,7 +24529,7 @@
|
|
|
23263
24529
|
},
|
|
23264
24530
|
generateQueryOptions: function generateQueryOptions(props, after) {
|
|
23265
24531
|
var queryOptions = getQueryOptions$4(props);
|
|
23266
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24532
|
+
return props.showLoadMore ? getCompositeAggsQuery$4({
|
|
23267
24533
|
query: queryOptions,
|
|
23268
24534
|
props: props,
|
|
23269
24535
|
after: after
|
|
@@ -23405,14 +24671,14 @@
|
|
|
23405
24671
|
|
|
23406
24672
|
MultiDropdownList.generateQueryOptions = function (props, after) {
|
|
23407
24673
|
var queryOptions = getQueryOptions$4(props);
|
|
23408
|
-
return props.showLoadMore ? getCompositeAggsQuery$
|
|
24674
|
+
return props.showLoadMore ? getCompositeAggsQuery$4({
|
|
23409
24675
|
query: queryOptions,
|
|
23410
24676
|
props: props,
|
|
23411
24677
|
after: after
|
|
23412
24678
|
}) : getAggsQuery(queryOptions, props);
|
|
23413
24679
|
};
|
|
23414
24680
|
|
|
23415
|
-
var mapStateToProps$
|
|
24681
|
+
var mapStateToProps$8 = function mapStateToProps(state, props) {
|
|
23416
24682
|
return {
|
|
23417
24683
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
23418
24684
|
rawData: state.rawData[props.componentId],
|
|
@@ -23427,11 +24693,11 @@
|
|
|
23427
24693
|
|
|
23428
24694
|
var mapDispatchtoProps$5 = {
|
|
23429
24695
|
setQueryOptions: setQueryOptions$5,
|
|
23430
|
-
updateQuery: updateQuery$
|
|
23431
|
-
setCustomQuery: setCustomQuery$
|
|
23432
|
-
setDefaultQuery: setDefaultQuery$
|
|
24696
|
+
updateQuery: updateQuery$6,
|
|
24697
|
+
setCustomQuery: setCustomQuery$5,
|
|
24698
|
+
setDefaultQuery: setDefaultQuery$6
|
|
23433
24699
|
};
|
|
23434
|
-
var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$
|
|
24700
|
+
var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
|
|
23435
24701
|
componentType: constants_1$1.multiDropdownList,
|
|
23436
24702
|
internalComponent: true
|
|
23437
24703
|
});
|
|
@@ -23443,12 +24709,12 @@
|
|
|
23443
24709
|
|
|
23444
24710
|
MultiDropdownList.componentType = constants_1$1.multiDropdownList;
|
|
23445
24711
|
|
|
23446
|
-
var updateQuery$
|
|
24712
|
+
var updateQuery$7 = lib_5.updateQuery,
|
|
23447
24713
|
setQueryOptions$6 = lib_5.setQueryOptions,
|
|
23448
|
-
setCustomQuery$
|
|
23449
|
-
var isEqual$
|
|
23450
|
-
checkValueChange$
|
|
23451
|
-
getClassName$
|
|
24714
|
+
setCustomQuery$6 = lib_5.setCustomQuery;
|
|
24715
|
+
var isEqual$a = lib_8.isEqual,
|
|
24716
|
+
checkValueChange$6 = lib_8.checkValueChange,
|
|
24717
|
+
getClassName$a = lib_8.getClassName,
|
|
23452
24718
|
getOptionsFromQuery$6 = lib_8.getOptionsFromQuery,
|
|
23453
24719
|
handleA11yAction$1 = lib_8.handleA11yAction;
|
|
23454
24720
|
var ToggleButton = {
|
|
@@ -23507,21 +24773,21 @@
|
|
|
23507
24773
|
this.updateQuery(this.$data.currentValue, this.$props);
|
|
23508
24774
|
},
|
|
23509
24775
|
value: function value(newVal, oldVal) {
|
|
23510
|
-
if (!isEqual$
|
|
24776
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
23511
24777
|
this.handleToggle(newVal, true, this.$props);
|
|
23512
24778
|
}
|
|
23513
24779
|
},
|
|
23514
24780
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
23515
24781
|
if (this.$props.multiSelect) {
|
|
23516
24782
|
// for multiselect selectedValue will be an array
|
|
23517
|
-
if (!isEqual$
|
|
24783
|
+
if (!isEqual$a(this.$data.currentValue, newVal) && !isEqual$a(oldVal, newVal)) {
|
|
23518
24784
|
this.handleToggle(newVal || [], true, this.$props);
|
|
23519
24785
|
}
|
|
23520
24786
|
} else {
|
|
23521
24787
|
// else selectedValue will be a string
|
|
23522
24788
|
var currentValue = this.$data.currentValue[0] ? this.$data.currentValue[0].value : null;
|
|
23523
24789
|
|
|
23524
|
-
if (!isEqual$
|
|
24790
|
+
if (!isEqual$a(currentValue, this.selectedValue) && !isEqual$a(oldVal, this.selectedValue)) {
|
|
23525
24791
|
this.handleToggle(this.selectedValue || [], true, this.$props);
|
|
23526
24792
|
}
|
|
23527
24793
|
}
|
|
@@ -23599,7 +24865,7 @@
|
|
|
23599
24865
|
}
|
|
23600
24866
|
};
|
|
23601
24867
|
|
|
23602
|
-
checkValueChange$
|
|
24868
|
+
checkValueChange$6(props.componentId, props.multiSelect ? value : value[0], props.beforeValueChange, performUpdate);
|
|
23603
24869
|
},
|
|
23604
24870
|
updateQuery: function updateQuery(value, props) {
|
|
23605
24871
|
var filterValue = value;
|
|
@@ -23615,7 +24881,7 @@
|
|
|
23615
24881
|
var _ref = customQuery(value, props) || {};
|
|
23616
24882
|
|
|
23617
24883
|
query = _ref.query;
|
|
23618
|
-
this.setQueryOptions(props.componentId, getOptionsFromQuery$6(customQuery(value, props)));
|
|
24884
|
+
this.setQueryOptions(props.componentId, getOptionsFromQuery$6(customQuery(value, props)), false);
|
|
23619
24885
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
23620
24886
|
}
|
|
23621
24887
|
|
|
@@ -23636,7 +24902,7 @@
|
|
|
23636
24902
|
multiSelect = _this$$props.multiSelect;
|
|
23637
24903
|
|
|
23638
24904
|
if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
|
|
23639
|
-
return isEqual$
|
|
24905
|
+
return isEqual$a(item, stateItem);
|
|
23640
24906
|
})) {
|
|
23641
24907
|
return false;
|
|
23642
24908
|
}
|
|
@@ -23666,7 +24932,7 @@
|
|
|
23666
24932
|
return _this2.handleClick(item);
|
|
23667
24933
|
}
|
|
23668
24934
|
}) : h(Button, {
|
|
23669
|
-
"class": getClassName$
|
|
24935
|
+
"class": getClassName$a(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
|
|
23670
24936
|
"on": {
|
|
23671
24937
|
"click": function click() {
|
|
23672
24938
|
return _this2.handleClick(item);
|
|
@@ -23693,7 +24959,7 @@
|
|
|
23693
24959
|
return h(Container, {
|
|
23694
24960
|
"class": toggleButtons
|
|
23695
24961
|
}, [this.$props.title && h(Title, {
|
|
23696
|
-
"class": getClassName$
|
|
24962
|
+
"class": getClassName$a(this.$props.innerClass, 'title')
|
|
23697
24963
|
}, [this.$props.title]), this.$props.data.map(function (item) {
|
|
23698
24964
|
return _this3.renderButton(item);
|
|
23699
24965
|
})]);
|
|
@@ -23749,7 +25015,7 @@
|
|
|
23749
25015
|
return query;
|
|
23750
25016
|
};
|
|
23751
25017
|
|
|
23752
|
-
var mapStateToProps$
|
|
25018
|
+
var mapStateToProps$9 = function mapStateToProps(state, props) {
|
|
23753
25019
|
return {
|
|
23754
25020
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
23755
25021
|
componentProps: state.props[props.componentId],
|
|
@@ -23758,11 +25024,11 @@
|
|
|
23758
25024
|
};
|
|
23759
25025
|
|
|
23760
25026
|
var mapDispatchtoProps$6 = {
|
|
23761
|
-
updateQueryHandler: updateQuery$
|
|
25027
|
+
updateQueryHandler: updateQuery$7,
|
|
23762
25028
|
setQueryOptions: setQueryOptions$6,
|
|
23763
|
-
setCustomQuery: setCustomQuery$
|
|
25029
|
+
setCustomQuery: setCustomQuery$6
|
|
23764
25030
|
};
|
|
23765
|
-
var RcConnected = ComponentWrapper$1(connect(mapStateToProps$
|
|
25031
|
+
var RcConnected = ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$6)(ToggleButton), {
|
|
23766
25032
|
componentType: constants_1$1.toggleButton
|
|
23767
25033
|
});
|
|
23768
25034
|
|
|
@@ -23777,15 +25043,15 @@
|
|
|
23777
25043
|
_excluded2 = ["query"],
|
|
23778
25044
|
_excluded3 = ["query"],
|
|
23779
25045
|
_excluded4 = ["query"];
|
|
23780
|
-
var updateQuery$
|
|
25046
|
+
var updateQuery$8 = lib_5.updateQuery,
|
|
23781
25047
|
setQueryOptions$7 = lib_5.setQueryOptions,
|
|
23782
|
-
setCustomQuery$
|
|
23783
|
-
setDefaultQuery$
|
|
25048
|
+
setCustomQuery$7 = lib_5.setCustomQuery,
|
|
25049
|
+
setDefaultQuery$7 = lib_5.setDefaultQuery;
|
|
23784
25050
|
var parseHits$1 = lib_8.parseHits,
|
|
23785
|
-
isEqual$
|
|
23786
|
-
getCompositeAggsQuery$
|
|
25051
|
+
isEqual$b = lib_8.isEqual,
|
|
25052
|
+
getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
|
|
23787
25053
|
getOptionsFromQuery$7 = lib_8.getOptionsFromQuery,
|
|
23788
|
-
getResultStats$
|
|
25054
|
+
getResultStats$3 = lib_8.getResultStats;
|
|
23789
25055
|
var ReactiveComponent = {
|
|
23790
25056
|
name: 'ReactiveComponent',
|
|
23791
25057
|
props: {
|
|
@@ -23928,42 +25194,42 @@
|
|
|
23928
25194
|
},
|
|
23929
25195
|
watch: {
|
|
23930
25196
|
hits: function hits(newVal, oldVal) {
|
|
23931
|
-
if (!isEqual$
|
|
25197
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23932
25198
|
this.$emit('data', this.getData());
|
|
23933
25199
|
}
|
|
23934
25200
|
},
|
|
23935
25201
|
rawData: function rawData(newVal, oldVal) {
|
|
23936
|
-
if (!isEqual$
|
|
25202
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23937
25203
|
this.$emit('data', this.getData());
|
|
23938
25204
|
}
|
|
23939
25205
|
},
|
|
23940
25206
|
aggregations: function aggregations(newVal, oldVal) {
|
|
23941
|
-
if (!isEqual$
|
|
25207
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23942
25208
|
this.$emit('data', this.getData());
|
|
23943
25209
|
}
|
|
23944
25210
|
},
|
|
23945
25211
|
aggregationData: function aggregationData(newVal, oldVal) {
|
|
23946
|
-
if (!isEqual$
|
|
25212
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23947
25213
|
this.$emit('data', this.getData());
|
|
23948
25214
|
}
|
|
23949
25215
|
},
|
|
23950
25216
|
promotedResults: function promotedResults(newVal, oldVal) {
|
|
23951
|
-
if (!isEqual$
|
|
25217
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23952
25218
|
this.$emit('data', this.getData());
|
|
23953
25219
|
}
|
|
23954
25220
|
},
|
|
23955
25221
|
hidden: function hidden(newVal, oldVal) {
|
|
23956
|
-
if (!isEqual$
|
|
25222
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23957
25223
|
this.$emit('data', this.getData());
|
|
23958
25224
|
}
|
|
23959
25225
|
},
|
|
23960
25226
|
total: function total(newVal, oldVal) {
|
|
23961
|
-
if (!isEqual$
|
|
25227
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23962
25228
|
this.$emit('data', this.getData());
|
|
23963
25229
|
}
|
|
23964
25230
|
},
|
|
23965
25231
|
time: function time(newVal, oldVal) {
|
|
23966
|
-
if (!isEqual$
|
|
25232
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
23967
25233
|
this.$emit('data', this.getData());
|
|
23968
25234
|
}
|
|
23969
25235
|
},
|
|
@@ -24047,7 +25313,7 @@
|
|
|
24047
25313
|
getAggsQuery: function getAggsQuery() {
|
|
24048
25314
|
if (this.aggregationField) {
|
|
24049
25315
|
return {
|
|
24050
|
-
aggs: getCompositeAggsQuery$
|
|
25316
|
+
aggs: getCompositeAggsQuery$5({
|
|
24051
25317
|
props: this.$props,
|
|
24052
25318
|
showTopHits: true,
|
|
24053
25319
|
value: this.selectedValue
|
|
@@ -24091,12 +25357,12 @@
|
|
|
24091
25357
|
},
|
|
24092
25358
|
computed: {
|
|
24093
25359
|
stats: function stats() {
|
|
24094
|
-
return getResultStats$
|
|
25360
|
+
return getResultStats$3(this);
|
|
24095
25361
|
}
|
|
24096
25362
|
}
|
|
24097
25363
|
};
|
|
24098
25364
|
|
|
24099
|
-
var mapStateToProps$
|
|
25365
|
+
var mapStateToProps$a = function mapStateToProps(state, props) {
|
|
24100
25366
|
return {
|
|
24101
25367
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
24102
25368
|
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
@@ -24116,11 +25382,11 @@
|
|
|
24116
25382
|
|
|
24117
25383
|
var mapDispatchtoProps$7 = {
|
|
24118
25384
|
setQueryOptions: setQueryOptions$7,
|
|
24119
|
-
updateQuery: updateQuery$
|
|
24120
|
-
setCustomQuery: setCustomQuery$
|
|
24121
|
-
setDefaultQuery: setDefaultQuery$
|
|
25385
|
+
updateQuery: updateQuery$8,
|
|
25386
|
+
setCustomQuery: setCustomQuery$7,
|
|
25387
|
+
setDefaultQuery: setDefaultQuery$7
|
|
24122
25388
|
};
|
|
24123
|
-
var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$
|
|
25389
|
+
var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$7)(ReactiveComponent), {
|
|
24124
25390
|
componentType: constants_1$1.reactiveComponent
|
|
24125
25391
|
});
|
|
24126
25392
|
|
|
@@ -24134,7 +25400,7 @@
|
|
|
24134
25400
|
var setValue$2 = lib_5.setValue,
|
|
24135
25401
|
clearValues = lib_5.clearValues,
|
|
24136
25402
|
resetValuesToDefault = lib_5.resetValuesToDefault;
|
|
24137
|
-
var getClassName$
|
|
25403
|
+
var getClassName$b = lib_8.getClassName,
|
|
24138
25404
|
handleA11yAction$2 = lib_8.handleA11yAction;
|
|
24139
25405
|
var SelectedFilters = {
|
|
24140
25406
|
name: 'SelectedFilters',
|
|
@@ -24144,7 +25410,8 @@
|
|
|
24144
25410
|
innerClass: types.style,
|
|
24145
25411
|
showClearAll: VueTypes.bool.def(true),
|
|
24146
25412
|
title: types.title,
|
|
24147
|
-
resetToDefault: VueTypes.bool.def(false)
|
|
25413
|
+
resetToDefault: VueTypes.bool.def(false),
|
|
25414
|
+
resetToValues: VueTypes.object
|
|
24148
25415
|
},
|
|
24149
25416
|
inject: {
|
|
24150
25417
|
theme: {
|
|
@@ -24171,9 +25438,9 @@
|
|
|
24171
25438
|
return h(Container, {
|
|
24172
25439
|
"class": filters(this.theme) + " " + (this.$props.className || '')
|
|
24173
25440
|
}, [this.$props.title && hasValues && h(Title, {
|
|
24174
|
-
"class": getClassName$
|
|
25441
|
+
"class": getClassName$b(this.$props.innerClass, 'title') || ''
|
|
24175
25442
|
}, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues ? h(Button, {
|
|
24176
|
-
"class": getClassName$
|
|
25443
|
+
"class": getClassName$b(this.$props.innerClass, 'button') || '',
|
|
24177
25444
|
"on": _extends({}, {
|
|
24178
25445
|
click: this.clearValues,
|
|
24179
25446
|
keypress: function keypress(event) {
|
|
@@ -24197,15 +25464,16 @@
|
|
|
24197
25464
|
this.$emit('clear', component, value);
|
|
24198
25465
|
},
|
|
24199
25466
|
clearValues: function clearValues() {
|
|
24200
|
-
var resetToDefault = this.resetToDefault
|
|
25467
|
+
var resetToDefault = this.resetToDefault,
|
|
25468
|
+
resetToValues = this.resetToValues;
|
|
24201
25469
|
|
|
24202
25470
|
if (resetToDefault) {
|
|
24203
25471
|
this.resetValuesToDefault();
|
|
24204
25472
|
} else {
|
|
24205
|
-
this.clearValuesAction();
|
|
25473
|
+
this.clearValuesAction(resetToValues);
|
|
24206
25474
|
}
|
|
24207
25475
|
|
|
24208
|
-
this.$emit('clear',
|
|
25476
|
+
this.$emit('clear', resetToValues);
|
|
24209
25477
|
},
|
|
24210
25478
|
renderValue: function renderValue(value, isArray) {
|
|
24211
25479
|
var _this2 = this;
|
|
@@ -24247,7 +25515,7 @@
|
|
|
24247
25515
|
var valueToRender = _this3.renderValue(value, isArray);
|
|
24248
25516
|
|
|
24249
25517
|
return h(Button, {
|
|
24250
|
-
"class": getClassName$
|
|
25518
|
+
"class": getClassName$b(_this3.$props.innerClass, 'button') || '',
|
|
24251
25519
|
"key": component + "-" + (index + 1),
|
|
24252
25520
|
"on": _extends({}, {
|
|
24253
25521
|
click: function click() {
|
|
@@ -24276,7 +25544,7 @@
|
|
|
24276
25544
|
}
|
|
24277
25545
|
};
|
|
24278
25546
|
|
|
24279
|
-
var mapStateToProps$
|
|
25547
|
+
var mapStateToProps$b = function mapStateToProps(state) {
|
|
24280
25548
|
return {
|
|
24281
25549
|
components: state.components,
|
|
24282
25550
|
selectedValues: state.selectedValues
|
|
@@ -24288,18 +25556,18 @@
|
|
|
24288
25556
|
setValue: setValue$2,
|
|
24289
25557
|
resetValuesToDefault: resetValuesToDefault
|
|
24290
25558
|
};
|
|
24291
|
-
var RcConnected$2 = connect(mapStateToProps$
|
|
25559
|
+
var RcConnected$2 = connect(mapStateToProps$b, mapDispatchtoProps$8)(SelectedFilters);
|
|
24292
25560
|
|
|
24293
25561
|
SelectedFilters.install = function (Vue) {
|
|
24294
25562
|
Vue.component(SelectedFilters.name, RcConnected$2);
|
|
24295
25563
|
};
|
|
24296
25564
|
|
|
24297
|
-
var updateQuery$
|
|
25565
|
+
var updateQuery$9 = lib_5.updateQuery,
|
|
24298
25566
|
setQueryOptions$8 = lib_5.setQueryOptions,
|
|
24299
|
-
setCustomQuery$
|
|
24300
|
-
var isEqual$
|
|
24301
|
-
checkValueChange$
|
|
24302
|
-
getClassName$
|
|
25567
|
+
setCustomQuery$8 = lib_5.setCustomQuery;
|
|
25568
|
+
var isEqual$c = lib_8.isEqual,
|
|
25569
|
+
checkValueChange$7 = lib_8.checkValueChange,
|
|
25570
|
+
getClassName$c = lib_8.getClassName,
|
|
24303
25571
|
getOptionsFromQuery$8 = lib_8.getOptionsFromQuery;
|
|
24304
25572
|
var SingleRange = {
|
|
24305
25573
|
name: 'SingleRange',
|
|
@@ -24354,12 +25622,12 @@
|
|
|
24354
25622
|
this.setValue(newVal);
|
|
24355
25623
|
},
|
|
24356
25624
|
value: function value(newVal, oldVal) {
|
|
24357
|
-
if (!isEqual$
|
|
25625
|
+
if (!isEqual$c(newVal, oldVal)) {
|
|
24358
25626
|
this.setValue(newVal);
|
|
24359
25627
|
}
|
|
24360
25628
|
},
|
|
24361
25629
|
selectedValue: function selectedValue(newVal) {
|
|
24362
|
-
if (!isEqual$
|
|
25630
|
+
if (!isEqual$c(this.$data.currentValue, newVal)) {
|
|
24363
25631
|
this.setValue(newVal);
|
|
24364
25632
|
}
|
|
24365
25633
|
},
|
|
@@ -24376,16 +25644,16 @@
|
|
|
24376
25644
|
return h(Container, {
|
|
24377
25645
|
"class": this.$props.className
|
|
24378
25646
|
}, [this.$props.title && h(Title, {
|
|
24379
|
-
"class": getClassName$
|
|
25647
|
+
"class": getClassName$c(this.$props.innerClass, 'title')
|
|
24380
25648
|
}, [this.$props.title]), h(UL, {
|
|
24381
|
-
"class": getClassName$
|
|
25649
|
+
"class": getClassName$c(this.$props.innerClass, 'list')
|
|
24382
25650
|
}, [this.$props.data.map(function (item) {
|
|
24383
25651
|
var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
|
|
24384
25652
|
return h("li", {
|
|
24385
25653
|
"key": item.label,
|
|
24386
25654
|
"class": "" + (selected ? 'active' : '')
|
|
24387
25655
|
}, [h(Radio, {
|
|
24388
|
-
"class": getClassName$
|
|
25656
|
+
"class": getClassName$c(_this.$props.innerClass, 'radio'),
|
|
24389
25657
|
"attrs": {
|
|
24390
25658
|
"id": _this.$props.componentId + "-" + item.label,
|
|
24391
25659
|
"name": _this.$props.componentId,
|
|
@@ -24398,7 +25666,7 @@
|
|
|
24398
25666
|
"change": _this.handleChange
|
|
24399
25667
|
}
|
|
24400
25668
|
}), h("label", {
|
|
24401
|
-
"class": getClassName$
|
|
25669
|
+
"class": getClassName$c(_this.$props.innerClass, 'label'),
|
|
24402
25670
|
"attrs": {
|
|
24403
25671
|
"for": _this.$props.componentId + "-" + item.label
|
|
24404
25672
|
}
|
|
@@ -24425,7 +25693,7 @@
|
|
|
24425
25693
|
_this2.$emit('value-change', currentValue);
|
|
24426
25694
|
};
|
|
24427
25695
|
|
|
24428
|
-
checkValueChange$
|
|
25696
|
+
checkValueChange$7(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
24429
25697
|
},
|
|
24430
25698
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
24431
25699
|
var customQuery = props.customQuery;
|
|
@@ -24440,7 +25708,7 @@
|
|
|
24440
25708
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
24441
25709
|
}
|
|
24442
25710
|
|
|
24443
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
25711
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
24444
25712
|
this.updateQuery({
|
|
24445
25713
|
componentId: props.componentId,
|
|
24446
25714
|
query: query,
|
|
@@ -24498,7 +25766,7 @@
|
|
|
24498
25766
|
return query;
|
|
24499
25767
|
};
|
|
24500
25768
|
|
|
24501
|
-
var mapStateToProps$
|
|
25769
|
+
var mapStateToProps$c = function mapStateToProps(state, props) {
|
|
24502
25770
|
return {
|
|
24503
25771
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24504
25772
|
componentProps: state.props[props.componentId],
|
|
@@ -24507,11 +25775,11 @@
|
|
|
24507
25775
|
};
|
|
24508
25776
|
|
|
24509
25777
|
var mapDispatchtoProps$9 = {
|
|
24510
|
-
updateQuery: updateQuery$
|
|
25778
|
+
updateQuery: updateQuery$9,
|
|
24511
25779
|
setQueryOptions: setQueryOptions$8,
|
|
24512
|
-
setCustomQuery: setCustomQuery$
|
|
25780
|
+
setCustomQuery: setCustomQuery$8
|
|
24513
25781
|
};
|
|
24514
|
-
var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$
|
|
25782
|
+
var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(SingleRange), {
|
|
24515
25783
|
componentType: constants_1$1.singleRange
|
|
24516
25784
|
});
|
|
24517
25785
|
|
|
@@ -24522,12 +25790,12 @@
|
|
|
24522
25790
|
|
|
24523
25791
|
SingleRange.componentType = constants_1$1.singleRange;
|
|
24524
25792
|
|
|
24525
|
-
var updateQuery$
|
|
25793
|
+
var updateQuery$a = lib_5.updateQuery,
|
|
24526
25794
|
setQueryOptions$9 = lib_5.setQueryOptions,
|
|
24527
|
-
setCustomQuery$
|
|
24528
|
-
var isEqual$
|
|
24529
|
-
checkValueChange$
|
|
24530
|
-
getClassName$
|
|
25795
|
+
setCustomQuery$9 = lib_5.setCustomQuery;
|
|
25796
|
+
var isEqual$d = lib_8.isEqual,
|
|
25797
|
+
checkValueChange$8 = lib_8.checkValueChange,
|
|
25798
|
+
getClassName$d = lib_8.getClassName,
|
|
24531
25799
|
getOptionsFromQuery$9 = lib_8.getOptionsFromQuery;
|
|
24532
25800
|
var MultiRange = {
|
|
24533
25801
|
name: 'MultiRange',
|
|
@@ -24634,7 +25902,7 @@
|
|
|
24634
25902
|
_this.$emit('value-change', Object.keys(selectedValues));
|
|
24635
25903
|
};
|
|
24636
25904
|
|
|
24637
|
-
checkValueChange$
|
|
25905
|
+
checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
24638
25906
|
},
|
|
24639
25907
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
24640
25908
|
var customQuery = props.customQuery;
|
|
@@ -24649,7 +25917,7 @@
|
|
|
24649
25917
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
24650
25918
|
}
|
|
24651
25919
|
|
|
24652
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
25920
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
24653
25921
|
this.updateQuery({
|
|
24654
25922
|
componentId: props.componentId,
|
|
24655
25923
|
query: query,
|
|
@@ -24669,12 +25937,12 @@
|
|
|
24669
25937
|
this.selectItem(newVal, true, undefined, true);
|
|
24670
25938
|
},
|
|
24671
25939
|
value: function value(newVal, oldVal) {
|
|
24672
|
-
if (!isEqual$
|
|
25940
|
+
if (!isEqual$d(newVal, oldVal)) {
|
|
24673
25941
|
this.selectItem(newVal, true, undefined, true);
|
|
24674
25942
|
}
|
|
24675
25943
|
},
|
|
24676
25944
|
selectedValue: function selectedValue(newVal) {
|
|
24677
|
-
if (!isEqual$
|
|
25945
|
+
if (!isEqual$d(this.$data.currentValue, newVal)) {
|
|
24678
25946
|
this.selectItem(newVal, true, undefined, true);
|
|
24679
25947
|
}
|
|
24680
25948
|
},
|
|
@@ -24708,16 +25976,16 @@
|
|
|
24708
25976
|
return h(Container, {
|
|
24709
25977
|
"class": this.$props.className
|
|
24710
25978
|
}, [this.$props.title && h(Title, {
|
|
24711
|
-
"class": getClassName$
|
|
25979
|
+
"class": getClassName$d(this.$props.innerClass, 'title')
|
|
24712
25980
|
}, [this.$props.title]), h(UL, {
|
|
24713
|
-
"class": getClassName$
|
|
25981
|
+
"class": getClassName$d(this.$props.innerClass, 'list')
|
|
24714
25982
|
}, [this.$props.data.map(function (item) {
|
|
24715
25983
|
var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
|
|
24716
25984
|
return h("li", {
|
|
24717
25985
|
"key": item.label,
|
|
24718
25986
|
"class": "" + (selected ? 'active' : '')
|
|
24719
25987
|
}, [h(Checkbox, {
|
|
24720
|
-
"class": getClassName$
|
|
25988
|
+
"class": getClassName$d(_this2.$props.innerClass, 'checkbox'),
|
|
24721
25989
|
"attrs": {
|
|
24722
25990
|
"id": _this2.$props.componentId + "-" + item.label,
|
|
24723
25991
|
"name": _this2.$props.componentId,
|
|
@@ -24732,7 +26000,7 @@
|
|
|
24732
26000
|
click: _this2.handleClick
|
|
24733
26001
|
})
|
|
24734
26002
|
}), h("label", {
|
|
24735
|
-
"class": getClassName$
|
|
26003
|
+
"class": getClassName$d(_this2.$props.innerClass, 'label'),
|
|
24736
26004
|
"attrs": {
|
|
24737
26005
|
"for": _this2.$props.componentId + "-" + item.label
|
|
24738
26006
|
}
|
|
@@ -24792,7 +26060,7 @@
|
|
|
24792
26060
|
return query;
|
|
24793
26061
|
};
|
|
24794
26062
|
|
|
24795
|
-
var mapStateToProps$
|
|
26063
|
+
var mapStateToProps$d = function mapStateToProps(state, props) {
|
|
24796
26064
|
return {
|
|
24797
26065
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24798
26066
|
componentProps: state.props[props.componentId],
|
|
@@ -24801,11 +26069,11 @@
|
|
|
24801
26069
|
};
|
|
24802
26070
|
|
|
24803
26071
|
var mapDispatchtoProps$a = {
|
|
24804
|
-
updateQuery: updateQuery$
|
|
26072
|
+
updateQuery: updateQuery$a,
|
|
24805
26073
|
setQueryOptions: setQueryOptions$9,
|
|
24806
|
-
setCustomQuery: setCustomQuery$
|
|
26074
|
+
setCustomQuery: setCustomQuery$9
|
|
24807
26075
|
};
|
|
24808
|
-
var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$
|
|
26076
|
+
var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(MultiRange), {
|
|
24809
26077
|
componentType: constants_1$1.multiRange
|
|
24810
26078
|
});
|
|
24811
26079
|
|
|
@@ -25091,15 +26359,15 @@
|
|
|
25091
26359
|
};
|
|
25092
26360
|
var vueNoSsr_common = index$2;
|
|
25093
26361
|
|
|
25094
|
-
var _templateObject$
|
|
25095
|
-
var Slider = index$1('div')(_templateObject$
|
|
26362
|
+
var _templateObject$n;
|
|
26363
|
+
var Slider = index$1('div')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
|
|
25096
26364
|
|
|
25097
26365
|
/**
|
|
25098
26366
|
* Caution: Please do not change this file without having a discussion with the Team.
|
|
25099
26367
|
* Any change may break the umd build, we're directly replacing the line no: 14
|
|
25100
26368
|
* `
|
|
25101
26369
|
var s = document.createElement("script");
|
|
25102
|
-
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@2.
|
|
26370
|
+
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
|
|
25103
26371
|
s.onload = function(){
|
|
25104
26372
|
var VueSlider = global['vue-slider-component'];
|
|
25105
26373
|
components['vue-slider-component'] = VueSlider;
|
|
@@ -25120,7 +26388,7 @@
|
|
|
25120
26388
|
// eslint-disable-next-line
|
|
25121
26389
|
|
|
25122
26390
|
var s = document.createElement("script");
|
|
25123
|
-
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@2.
|
|
26391
|
+
s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
|
|
25124
26392
|
s.onload = function(){
|
|
25125
26393
|
var VueSlider = global$1['vue-slider-component'];
|
|
25126
26394
|
components['vue-slider-component'] = VueSlider;
|
|
@@ -25135,13 +26403,13 @@
|
|
|
25135
26403
|
return components;
|
|
25136
26404
|
};
|
|
25137
26405
|
|
|
25138
|
-
var updateQuery$
|
|
26406
|
+
var updateQuery$b = lib_5.updateQuery,
|
|
25139
26407
|
setQueryOptions$a = lib_5.setQueryOptions,
|
|
25140
|
-
setCustomQuery$
|
|
25141
|
-
var checkValueChange$
|
|
25142
|
-
getClassName$
|
|
26408
|
+
setCustomQuery$a = lib_5.setCustomQuery;
|
|
26409
|
+
var checkValueChange$9 = lib_8.checkValueChange,
|
|
26410
|
+
getClassName$e = lib_8.getClassName,
|
|
25143
26411
|
getOptionsFromQuery$a = lib_8.getOptionsFromQuery,
|
|
25144
|
-
isEqual$
|
|
26412
|
+
isEqual$e = lib_8.isEqual;
|
|
25145
26413
|
var RangeSlider = {
|
|
25146
26414
|
name: 'RangeSlider',
|
|
25147
26415
|
components: getComponents(),
|
|
@@ -25195,38 +26463,34 @@
|
|
|
25195
26463
|
});
|
|
25196
26464
|
}
|
|
25197
26465
|
},
|
|
25198
|
-
handleSlider: function handleSlider(
|
|
25199
|
-
var
|
|
25200
|
-
|
|
25201
|
-
clearTimeout(this.handleSliderChange._tId);
|
|
25202
|
-
this.handleSliderChange._tId = setTimeout(function () {
|
|
25203
|
-
_this.handleSliderChange(values);
|
|
25204
|
-
}, 100);
|
|
26466
|
+
handleSlider: function handleSlider() {
|
|
26467
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
26468
|
+
this.handleSliderChange(sliderValues);
|
|
25205
26469
|
},
|
|
25206
26470
|
handleChange: function handleChange(currentValue, props) {
|
|
25207
|
-
var
|
|
26471
|
+
var _this = this;
|
|
25208
26472
|
|
|
25209
26473
|
if (props === void 0) {
|
|
25210
26474
|
props = this.$props;
|
|
25211
26475
|
}
|
|
25212
26476
|
|
|
25213
26477
|
var performUpdate = function performUpdate() {
|
|
25214
|
-
|
|
26478
|
+
_this.currentValue = currentValue;
|
|
25215
26479
|
|
|
25216
|
-
|
|
26480
|
+
_this.updateQueryHandler([currentValue[0], currentValue[1]], props);
|
|
25217
26481
|
|
|
25218
|
-
|
|
26482
|
+
_this.$emit('valueChange', {
|
|
25219
26483
|
start: currentValue[0],
|
|
25220
26484
|
end: currentValue[1]
|
|
25221
26485
|
});
|
|
25222
26486
|
|
|
25223
|
-
|
|
26487
|
+
_this.$emit('value-change', {
|
|
25224
26488
|
start: currentValue[0],
|
|
25225
26489
|
end: currentValue[1]
|
|
25226
26490
|
});
|
|
25227
26491
|
};
|
|
25228
26492
|
|
|
25229
|
-
checkValueChange$
|
|
26493
|
+
checkValueChange$9(props.componentId, {
|
|
25230
26494
|
start: currentValue[0],
|
|
25231
26495
|
end: currentValue[1]
|
|
25232
26496
|
}, props.beforeValueChange, performUpdate);
|
|
@@ -25252,7 +26516,7 @@
|
|
|
25252
26516
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
25253
26517
|
|
|
25254
26518
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
25255
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
26519
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
25256
26520
|
this.updateQuery({
|
|
25257
26521
|
componentId: props.componentId,
|
|
25258
26522
|
query: query,
|
|
@@ -25269,12 +26533,12 @@
|
|
|
25269
26533
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25270
26534
|
},
|
|
25271
26535
|
value: function value(newVal, oldVal) {
|
|
25272
|
-
if (!isEqual$
|
|
26536
|
+
if (!isEqual$e(newVal, oldVal)) {
|
|
25273
26537
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25274
26538
|
}
|
|
25275
26539
|
},
|
|
25276
26540
|
selectedValue: function selectedValue(newVal) {
|
|
25277
|
-
if (!isEqual$
|
|
26541
|
+
if (!isEqual$e(this.$data.currentValue, newVal)) {
|
|
25278
26542
|
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25279
26543
|
this.$emit('change', newVal);
|
|
25280
26544
|
}
|
|
@@ -25320,9 +26584,9 @@
|
|
|
25320
26584
|
return h(Container, {
|
|
25321
26585
|
"class": this.$props.className
|
|
25322
26586
|
}, [this.$props.title && h(Title, {
|
|
25323
|
-
"class": getClassName$
|
|
26587
|
+
"class": getClassName$e(this.$props.innerClass, 'title')
|
|
25324
26588
|
}, [this.$props.title]), this.$props.range ? h(vueNoSsr_common, [h(Slider, {
|
|
25325
|
-
"class": getClassName$
|
|
26589
|
+
"class": getClassName$e(this.$props.innerClass, 'slider')
|
|
25326
26590
|
}, [h("vue-slider-component", {
|
|
25327
26591
|
"ref": "slider",
|
|
25328
26592
|
"attrs": {
|
|
@@ -25331,18 +26595,19 @@
|
|
|
25331
26595
|
"max": this.$props.range.end,
|
|
25332
26596
|
"dotSize": 20,
|
|
25333
26597
|
"height": 4,
|
|
25334
|
-
"enable-cross": false
|
|
26598
|
+
"enable-cross": false,
|
|
26599
|
+
"tooltip": "always"
|
|
25335
26600
|
},
|
|
25336
|
-
"
|
|
25337
|
-
|
|
25338
|
-
|
|
25339
|
-
})
|
|
26601
|
+
"on": {
|
|
26602
|
+
"drag-end": this.handleSlider
|
|
26603
|
+
},
|
|
26604
|
+
"props": _extends({}, this.$props.sliderOptions)
|
|
25340
26605
|
}), this.$props.rangeLabels && h("div", {
|
|
25341
26606
|
"class": "label-container"
|
|
25342
26607
|
}, [h("label", {
|
|
25343
|
-
"class": getClassName$
|
|
26608
|
+
"class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-left'
|
|
25344
26609
|
}, [this.$props.rangeLabels.start]), h("label", {
|
|
25345
|
-
"class": getClassName$
|
|
26610
|
+
"class": getClassName$e(this.$props.innerClass, 'label') || 'range-label-right'
|
|
25346
26611
|
}, [this.$props.rangeLabels.end])])])]) : null]);
|
|
25347
26612
|
}
|
|
25348
26613
|
};
|
|
@@ -25388,7 +26653,7 @@
|
|
|
25388
26653
|
return [];
|
|
25389
26654
|
};
|
|
25390
26655
|
|
|
25391
|
-
var mapStateToProps$
|
|
26656
|
+
var mapStateToProps$e = function mapStateToProps(state, props) {
|
|
25392
26657
|
return {
|
|
25393
26658
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
25394
26659
|
: [],
|
|
@@ -25399,11 +26664,11 @@
|
|
|
25399
26664
|
};
|
|
25400
26665
|
|
|
25401
26666
|
var mapDispatchtoProps$b = {
|
|
25402
|
-
updateQuery: updateQuery$
|
|
26667
|
+
updateQuery: updateQuery$b,
|
|
25403
26668
|
setQueryOptions: setQueryOptions$a,
|
|
25404
|
-
setCustomQuery: setCustomQuery$
|
|
26669
|
+
setCustomQuery: setCustomQuery$a
|
|
25405
26670
|
};
|
|
25406
|
-
var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$
|
|
26671
|
+
var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(RangeSlider), {
|
|
25407
26672
|
componentType: constants_1$1.rangeSlider
|
|
25408
26673
|
});
|
|
25409
26674
|
|
|
@@ -25417,16 +26682,16 @@
|
|
|
25417
26682
|
var addComponent$1 = lib_5.addComponent,
|
|
25418
26683
|
removeComponent$1 = lib_5.removeComponent,
|
|
25419
26684
|
watchComponent$1 = lib_5.watchComponent,
|
|
25420
|
-
updateQuery$
|
|
26685
|
+
updateQuery$c = lib_5.updateQuery,
|
|
25421
26686
|
setQueryListener$1 = lib_5.setQueryListener,
|
|
25422
26687
|
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25423
26688
|
setComponentProps$1 = lib_5.setComponentProps,
|
|
25424
|
-
setCustomQuery$
|
|
26689
|
+
setCustomQuery$b = lib_5.setCustomQuery,
|
|
25425
26690
|
updateComponentProps$2 = lib_5.updateComponentProps;
|
|
25426
|
-
var checkValueChange$
|
|
25427
|
-
getClassName$
|
|
26691
|
+
var checkValueChange$a = lib_8.checkValueChange,
|
|
26692
|
+
getClassName$f = lib_8.getClassName,
|
|
25428
26693
|
getOptionsFromQuery$b = lib_8.getOptionsFromQuery,
|
|
25429
|
-
isEqual$
|
|
26694
|
+
isEqual$f = lib_8.isEqual,
|
|
25430
26695
|
checkSomePropChange$1 = lib_8.checkSomePropChange;
|
|
25431
26696
|
var DynamicRangeSlider = {
|
|
25432
26697
|
name: 'DynamicRangeSlider',
|
|
@@ -25450,7 +26715,8 @@
|
|
|
25450
26715
|
URLParams: VueTypes.bool.def(false),
|
|
25451
26716
|
sliderOptions: VueTypes.object.def({}),
|
|
25452
26717
|
nestedField: types.string,
|
|
25453
|
-
index: VueTypes.string
|
|
26718
|
+
index: VueTypes.string,
|
|
26719
|
+
value: types.range
|
|
25454
26720
|
},
|
|
25455
26721
|
data: function data() {
|
|
25456
26722
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -25496,6 +26762,8 @@
|
|
|
25496
26762
|
components = _this$$$store$getStat.components;
|
|
25497
26763
|
}
|
|
25498
26764
|
|
|
26765
|
+
var value = this.$props.value;
|
|
26766
|
+
|
|
25499
26767
|
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
25500
26768
|
this.addComponent(this.componentId);
|
|
25501
26769
|
this.addComponent(this.internalRangeComponent);
|
|
@@ -25504,6 +26772,8 @@
|
|
|
25504
26772
|
this.handleChange(this.selectedValue);
|
|
25505
26773
|
} else if (this.selectedValue) {
|
|
25506
26774
|
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
26775
|
+
} else if (value) {
|
|
26776
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
25507
26777
|
} // get range before executing other queries
|
|
25508
26778
|
|
|
25509
26779
|
|
|
@@ -25522,6 +26792,13 @@
|
|
|
25522
26792
|
}
|
|
25523
26793
|
},
|
|
25524
26794
|
methods: {
|
|
26795
|
+
isControlled: function isControlled() {
|
|
26796
|
+
if (this.$props.value && this.$listeners) {
|
|
26797
|
+
return true;
|
|
26798
|
+
}
|
|
26799
|
+
|
|
26800
|
+
return false;
|
|
26801
|
+
},
|
|
25525
26802
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
25526
26803
|
var start = _ref.start,
|
|
25527
26804
|
end = _ref.end;
|
|
@@ -25532,6 +26809,8 @@
|
|
|
25532
26809
|
defaultEnd = _this$$props$defaultV.end;
|
|
25533
26810
|
|
|
25534
26811
|
this.handleChange([defaultStart, defaultEnd]);
|
|
26812
|
+
} else if (this.isControlled()) {
|
|
26813
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
25535
26814
|
} else {
|
|
25536
26815
|
this.currentValue = [start, end];
|
|
25537
26816
|
}
|
|
@@ -25579,8 +26858,18 @@
|
|
|
25579
26858
|
aggs: aggs
|
|
25580
26859
|
});
|
|
25581
26860
|
},
|
|
25582
|
-
handleSlider: function handleSlider(
|
|
25583
|
-
this.
|
|
26861
|
+
handleSlider: function handleSlider() {
|
|
26862
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
26863
|
+
var value = this.$props.value;
|
|
26864
|
+
|
|
26865
|
+
if (value === undefined) {
|
|
26866
|
+
this.handleChange(sliderValues);
|
|
26867
|
+
} else {
|
|
26868
|
+
this.$emit('change', {
|
|
26869
|
+
start: sliderValues[0],
|
|
26870
|
+
end: sliderValues[1]
|
|
26871
|
+
});
|
|
26872
|
+
}
|
|
25584
26873
|
},
|
|
25585
26874
|
handleChange: function handleChange(currentValue) {
|
|
25586
26875
|
var _this2 = this;
|
|
@@ -25604,7 +26893,7 @@
|
|
|
25604
26893
|
});
|
|
25605
26894
|
};
|
|
25606
26895
|
|
|
25607
|
-
checkValueChange$
|
|
26896
|
+
checkValueChange$a(this.$props.componentId, {
|
|
25608
26897
|
start: normalizedValue[0],
|
|
25609
26898
|
end: normalizedValue[1]
|
|
25610
26899
|
}, this.$props.beforeValueChange, performUpdate);
|
|
@@ -25632,7 +26921,7 @@
|
|
|
25632
26921
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
25633
26922
|
|
|
25634
26923
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
25635
|
-
this.setQueryOptions(this.$props.componentId, customQueryOptions);
|
|
26924
|
+
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
25636
26925
|
this.updateQuery({
|
|
25637
26926
|
componentId: this.$props.componentId,
|
|
25638
26927
|
query: query,
|
|
@@ -25668,15 +26957,16 @@
|
|
|
25668
26957
|
this.setReact();
|
|
25669
26958
|
},
|
|
25670
26959
|
selectedValue: function selectedValue(newValue) {
|
|
25671
|
-
if (isEqual$
|
|
26960
|
+
if (isEqual$f(newValue, this.currentValue)) return;
|
|
25672
26961
|
var value = newValue || {
|
|
25673
26962
|
start: this.range.start,
|
|
25674
26963
|
end: this.range.end
|
|
25675
26964
|
};
|
|
26965
|
+
this.$emit('change', value);
|
|
25676
26966
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
25677
26967
|
},
|
|
25678
26968
|
range: function range(newValue, oldValue) {
|
|
25679
|
-
if (isEqual$
|
|
26969
|
+
if (isEqual$f(newValue, oldValue) || !this.currentValue) return;
|
|
25680
26970
|
|
|
25681
26971
|
var _ref4 = this.currentValue || [],
|
|
25682
26972
|
currentStart = _ref4[0],
|
|
@@ -25694,6 +26984,11 @@
|
|
|
25694
26984
|
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
25695
26985
|
this.updateQueryHandler(this.$data.currentValue);
|
|
25696
26986
|
}
|
|
26987
|
+
},
|
|
26988
|
+
value: function value(newVal, oldVal) {
|
|
26989
|
+
if (!isEqual$f(newVal, oldVal)) {
|
|
26990
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
26991
|
+
}
|
|
25697
26992
|
}
|
|
25698
26993
|
},
|
|
25699
26994
|
render: function render() {
|
|
@@ -25709,17 +27004,19 @@
|
|
|
25709
27004
|
return h(Container, {
|
|
25710
27005
|
"class": this.$props.className
|
|
25711
27006
|
}, [this.$props.title && h(Title, {
|
|
25712
|
-
"class": getClassName$
|
|
27007
|
+
"class": getClassName$f(this.$props.innerClass, 'title')
|
|
25713
27008
|
}, [this.$props.title]), h(vueNoSsr_common, [h(Slider, {
|
|
25714
|
-
"class": getClassName$
|
|
27009
|
+
"class": getClassName$f(this.$props.innerClass, 'slider')
|
|
25715
27010
|
}, [h("vue-slider-component", {
|
|
27011
|
+
"ref": "slider",
|
|
25716
27012
|
"attrs": {
|
|
25717
|
-
"value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
|
|
25718
|
-
"min": Math.min(start, this.currentValue[0]),
|
|
25719
|
-
"max": Math.max(end, this.currentValue[1]),
|
|
27013
|
+
"value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
|
|
27014
|
+
"min": Math.floor(Math.min(start, this.currentValue[0])),
|
|
27015
|
+
"max": Math.ceil(Math.max(end, this.currentValue[1])),
|
|
25720
27016
|
"dotSize": 20,
|
|
25721
27017
|
"height": 4,
|
|
25722
|
-
"enable-cross": false
|
|
27018
|
+
"enable-cross": false,
|
|
27019
|
+
"tooltip": "always"
|
|
25723
27020
|
},
|
|
25724
27021
|
"on": {
|
|
25725
27022
|
"drag-end": this.handleSlider
|
|
@@ -25728,9 +27025,9 @@
|
|
|
25728
27025
|
}), this.labels ? h("div", {
|
|
25729
27026
|
"class": "label-container"
|
|
25730
27027
|
}, [h("label", {
|
|
25731
|
-
"class": getClassName$
|
|
27028
|
+
"class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-left'
|
|
25732
27029
|
}, [this.labels.start]), h("label", {
|
|
25733
|
-
"class": getClassName$
|
|
27030
|
+
"class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-right'
|
|
25734
27031
|
}, [this.labels.end])]) : null])])]);
|
|
25735
27032
|
}
|
|
25736
27033
|
};
|
|
@@ -25765,10 +27062,14 @@
|
|
|
25765
27062
|
};
|
|
25766
27063
|
|
|
25767
27064
|
DynamicRangeSlider.parseValue = function (value) {
|
|
25768
|
-
|
|
27065
|
+
if (value) {
|
|
27066
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
27067
|
+
}
|
|
27068
|
+
|
|
27069
|
+
return [];
|
|
25769
27070
|
};
|
|
25770
27071
|
|
|
25771
|
-
var mapStateToProps$
|
|
27072
|
+
var mapStateToProps$f = function mapStateToProps(state, props) {
|
|
25772
27073
|
var componentId = state.aggregations[props.componentId];
|
|
25773
27074
|
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
25774
27075
|
var options = componentId && componentId[props.dataField];
|
|
@@ -25800,15 +27101,15 @@
|
|
|
25800
27101
|
var mapDispatchtoProps$c = {
|
|
25801
27102
|
addComponent: addComponent$1,
|
|
25802
27103
|
removeComponent: removeComponent$1,
|
|
25803
|
-
updateQuery: updateQuery$
|
|
27104
|
+
updateQuery: updateQuery$c,
|
|
25804
27105
|
watchComponent: watchComponent$1,
|
|
25805
27106
|
setQueryListener: setQueryListener$1,
|
|
25806
27107
|
setQueryOptions: setQueryOptions$b,
|
|
25807
27108
|
setComponentProps: setComponentProps$1,
|
|
25808
|
-
setCustomQuery: setCustomQuery$
|
|
27109
|
+
setCustomQuery: setCustomQuery$b,
|
|
25809
27110
|
updateComponentProps: updateComponentProps$2
|
|
25810
27111
|
};
|
|
25811
|
-
var RangeConnected$3 = connect(mapStateToProps$
|
|
27112
|
+
var RangeConnected$3 = connect(mapStateToProps$f, mapDispatchtoProps$c)(DynamicRangeSlider);
|
|
25812
27113
|
|
|
25813
27114
|
DynamicRangeSlider.install = function (Vue) {
|
|
25814
27115
|
Vue.component(DynamicRangeSlider.name, RangeConnected$3);
|
|
@@ -25821,6 +27122,10 @@
|
|
|
25821
27122
|
var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
|
|
25822
27123
|
|
|
25823
27124
|
var filterProps = function filterProps(props) {
|
|
27125
|
+
if (props === void 0) {
|
|
27126
|
+
props = {};
|
|
27127
|
+
}
|
|
27128
|
+
|
|
25824
27129
|
return _extends({}, props, {
|
|
25825
27130
|
props: props.componentProps
|
|
25826
27131
|
});
|
|
@@ -25840,7 +27145,7 @@
|
|
|
25840
27145
|
return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
|
|
25841
27146
|
}
|
|
25842
27147
|
|
|
25843
|
-
if (componentIds
|
|
27148
|
+
if (Array.isArray(componentIds)) {
|
|
25844
27149
|
var filteredState = {};
|
|
25845
27150
|
componentIds.forEach(function (componentId) {
|
|
25846
27151
|
filteredState[componentId] = state[componentId];
|
|
@@ -25879,7 +27184,7 @@
|
|
|
25879
27184
|
};
|
|
25880
27185
|
return this.__state;
|
|
25881
27186
|
},
|
|
25882
|
-
|
|
27187
|
+
created: function created() {
|
|
25883
27188
|
this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
|
|
25884
27189
|
},
|
|
25885
27190
|
computed: {
|
|
@@ -25966,7 +27271,7 @@
|
|
|
25966
27271
|
}
|
|
25967
27272
|
};
|
|
25968
27273
|
|
|
25969
|
-
var mapStateToProps$
|
|
27274
|
+
var mapStateToProps$g = function mapStateToProps(state, props) {
|
|
25970
27275
|
return {
|
|
25971
27276
|
selectedValues: filterByComponentIds(state.selectedValues, props),
|
|
25972
27277
|
queryLog: filterByComponentIds(state.queryLog, props),
|
|
@@ -25983,7 +27288,7 @@
|
|
|
25983
27288
|
};
|
|
25984
27289
|
};
|
|
25985
27290
|
|
|
25986
|
-
var StateProviderConnected = connect(mapStateToProps$
|
|
27291
|
+
var StateProviderConnected = connect(mapStateToProps$g, {})(StateProvider);
|
|
25987
27292
|
|
|
25988
27293
|
StateProvider.install = function (Vue) {
|
|
25989
27294
|
Vue.component(StateProvider.name, StateProviderConnected);
|
|
@@ -26204,7 +27509,7 @@
|
|
|
26204
27509
|
var react = component.react;
|
|
26205
27510
|
|
|
26206
27511
|
if (isInternalComponentPresent || isResultComponent) {
|
|
26207
|
-
react =
|
|
27512
|
+
react = helper_22(react, internalComponent);
|
|
26208
27513
|
}
|
|
26209
27514
|
|
|
26210
27515
|
dependencyTree = dependencyTreeReducer(dependencyTree, {
|
|
@@ -26250,7 +27555,7 @@
|
|
|
26250
27555
|
|
|
26251
27556
|
componentCollection.forEach(function (component) {
|
|
26252
27557
|
// eslint-disable-next-line
|
|
26253
|
-
var _buildQuery =
|
|
27558
|
+
var _buildQuery = helper_21(component.componentId, dependencyTree, queryList, queryOptions),
|
|
26254
27559
|
queryObj = _buildQuery.queryObj,
|
|
26255
27560
|
options = _buildQuery.options;
|
|
26256
27561
|
|
|
@@ -26459,21 +27764,21 @@
|
|
|
26459
27764
|
});
|
|
26460
27765
|
}
|
|
26461
27766
|
|
|
26462
|
-
var version = "1.
|
|
27767
|
+
var version = "1.27.0-gamma.2";
|
|
26463
27768
|
|
|
26464
|
-
var _templateObject$
|
|
27769
|
+
var _templateObject$o, _templateObject2$a;
|
|
26465
27770
|
|
|
26466
27771
|
var alert = function alert(_ref) {
|
|
26467
27772
|
var theme = _ref.theme;
|
|
26468
|
-
return css(_templateObject$
|
|
27773
|
+
return css(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
|
|
26469
27774
|
};
|
|
26470
27775
|
|
|
26471
27776
|
var Content = index$1('div')(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
26472
27777
|
return props.alert && alert;
|
|
26473
27778
|
});
|
|
26474
27779
|
|
|
26475
|
-
var getClassName$
|
|
26476
|
-
isEqual$
|
|
27780
|
+
var getClassName$g = lib_8.getClassName,
|
|
27781
|
+
isEqual$g = lib_8.isEqual;
|
|
26477
27782
|
var RangeInput = {
|
|
26478
27783
|
name: 'RangeInput',
|
|
26479
27784
|
components: {
|
|
@@ -26555,7 +27860,7 @@
|
|
|
26555
27860
|
handleChange: function handleChange(value, event) {
|
|
26556
27861
|
var currentValue = value;
|
|
26557
27862
|
|
|
26558
|
-
if (this.shouldUpdate(value) && !isEqual$
|
|
27863
|
+
if (this.shouldUpdate(value) && !isEqual$g(value, this.currentValue)) {
|
|
26559
27864
|
switch (event) {
|
|
26560
27865
|
case 'change':
|
|
26561
27866
|
if (!value) {
|
|
@@ -26581,7 +27886,7 @@
|
|
|
26581
27886
|
}
|
|
26582
27887
|
},
|
|
26583
27888
|
handleOnChange: function handleOnChange(value) {
|
|
26584
|
-
this.handleChange(value, 'change');
|
|
27889
|
+
this.handleChange(value || this.$props.range, 'change');
|
|
26585
27890
|
},
|
|
26586
27891
|
handleValueChange: function handleValueChange(value) {
|
|
26587
27892
|
this.handleChange(value, 'value-change');
|
|
@@ -26625,7 +27930,7 @@
|
|
|
26625
27930
|
}
|
|
26626
27931
|
},
|
|
26627
27932
|
value: function value(newVal, oldVal) {
|
|
26628
|
-
if (!isEqual$
|
|
27933
|
+
if (!isEqual$g(newVal, oldVal)) {
|
|
26629
27934
|
if (this.isControlled()) {
|
|
26630
27935
|
this.handleChange(newVal, 'change');
|
|
26631
27936
|
}
|
|
@@ -26636,6 +27941,10 @@
|
|
|
26636
27941
|
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
26637
27942
|
this.handleChange(this.$props.defaultValue);
|
|
26638
27943
|
}
|
|
27944
|
+
|
|
27945
|
+
if (this.isControlled()) {
|
|
27946
|
+
this.handleChange(this.$props.value, 'change');
|
|
27947
|
+
}
|
|
26639
27948
|
},
|
|
26640
27949
|
render: function render() {
|
|
26641
27950
|
var h = arguments[0];
|
|
@@ -26692,7 +28001,7 @@
|
|
|
26692
28001
|
"value-change": this.handleValueChange
|
|
26693
28002
|
}
|
|
26694
28003
|
}), h(Flex, {
|
|
26695
|
-
"class": getClassName$
|
|
28004
|
+
"class": getClassName$g(innerClass, 'input-container') || ''
|
|
26696
28005
|
}, [h(Flex, {
|
|
26697
28006
|
"attrs": {
|
|
26698
28007
|
"direction": "column",
|
|
@@ -26712,7 +28021,7 @@
|
|
|
26712
28021
|
"on": {
|
|
26713
28022
|
"change": this.handleInputChange
|
|
26714
28023
|
},
|
|
26715
|
-
"class": getClassName$
|
|
28024
|
+
"class": getClassName$g(innerClass, 'input') || '',
|
|
26716
28025
|
"domProps": _extends({}, {
|
|
26717
28026
|
value: this.currentValue.start
|
|
26718
28027
|
})
|
|
@@ -26745,7 +28054,7 @@
|
|
|
26745
28054
|
"on": {
|
|
26746
28055
|
"change": this.handleInputChange
|
|
26747
28056
|
},
|
|
26748
|
-
"class": getClassName$
|
|
28057
|
+
"class": getClassName$g(innerClass, 'input') || '',
|
|
26749
28058
|
"domProps": _extends({}, {
|
|
26750
28059
|
value: this.currentValue.end
|
|
26751
28060
|
})
|
|
@@ -26757,13 +28066,13 @@
|
|
|
26757
28066
|
}
|
|
26758
28067
|
};
|
|
26759
28068
|
|
|
26760
|
-
var mapStateToProps$
|
|
28069
|
+
var mapStateToProps$h = function mapStateToProps(state) {
|
|
26761
28070
|
return {
|
|
26762
28071
|
themePreset: state.config.themePreset
|
|
26763
28072
|
};
|
|
26764
28073
|
};
|
|
26765
28074
|
|
|
26766
|
-
var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$
|
|
28075
|
+
var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$h, {})(RangeInput), {
|
|
26767
28076
|
componentType: constants_1$1.rangeInput
|
|
26768
28077
|
});
|
|
26769
28078
|
|
|
@@ -26774,7 +28083,7 @@
|
|
|
26774
28083
|
|
|
26775
28084
|
RangeInput.componentType = constants_1$1.rangeInput;
|
|
26776
28085
|
|
|
26777
|
-
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
|
|
28086
|
+
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SearchBox, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
|
|
26778
28087
|
function install (Vue) {
|
|
26779
28088
|
components.map(function (component) {
|
|
26780
28089
|
Vue.use(component);
|
|
@@ -26804,6 +28113,7 @@
|
|
|
26804
28113
|
exports.ReactiveList = ReactiveList;
|
|
26805
28114
|
exports.ResultCard = ResultCard;
|
|
26806
28115
|
exports.ResultList = ResultList;
|
|
28116
|
+
exports.SearchBox = SearchBox;
|
|
26807
28117
|
exports.SelectedFilters = SelectedFilters;
|
|
26808
28118
|
exports.SingleDropdownList = SingleDropdownList;
|
|
26809
28119
|
exports.SingleList = SingleList;
|