@appbaseio/reactivesearch-vue 1.16.0-alpha.40 → 1.16.0-alpha.43
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 +62 -57
- 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/ReactiveComponent.js +14 -21
- package/dist/cjs/initReactivesearch.js +19 -15
- package/dist/cjs/version.js +1 -1
- package/dist/es/ReactiveComponent.js +14 -21
- package/dist/es/initReactivesearch.js +19 -15
- package/dist/es/version.js +1 -1
- package/package.json +1 -1
|
@@ -4882,6 +4882,7 @@
|
|
|
4882
4882
|
};
|
|
4883
4883
|
|
|
4884
4884
|
exports.isEqual = isEqual;
|
|
4885
|
+
exports.compareQueries = compareQueries;
|
|
4885
4886
|
exports.debounce = debounce;
|
|
4886
4887
|
exports.getQueryOptions = getQueryOptions;
|
|
4887
4888
|
exports.buildQuery = buildQuery;
|
|
@@ -4976,6 +4977,14 @@
|
|
|
4976
4977
|
return true;
|
|
4977
4978
|
}
|
|
4978
4979
|
|
|
4980
|
+
function compareQueries(x, y) {
|
|
4981
|
+
try {
|
|
4982
|
+
return isEqual(JSON.parse(JSON.stringify(x)), JSON.parse(JSON.stringify(y)));
|
|
4983
|
+
} catch (e) {
|
|
4984
|
+
return false;
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
|
|
4979
4988
|
function debounce(callback, wait) {
|
|
4980
4989
|
var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
|
|
4981
4990
|
var timeout = null;
|
|
@@ -5782,18 +5791,19 @@
|
|
|
5782
5791
|
var helper_20 = helper.updateDefaultQuery;
|
|
5783
5792
|
var helper_21 = helper.updateCustomQuery;
|
|
5784
5793
|
var helper_22 = helper.isEqual;
|
|
5785
|
-
var helper_23 = helper.
|
|
5786
|
-
var helper_24 = helper.
|
|
5787
|
-
var helper_25 = helper.
|
|
5788
|
-
var helper_26 = helper.
|
|
5789
|
-
var helper_27 = helper.
|
|
5790
|
-
var helper_28 = helper.
|
|
5791
|
-
var helper_29 = helper.
|
|
5792
|
-
var helper_30 = helper.
|
|
5793
|
-
var helper_31 = helper.
|
|
5794
|
-
var helper_32 = helper.
|
|
5795
|
-
var helper_33 = helper.
|
|
5796
|
-
var helper_34 = helper.
|
|
5794
|
+
var helper_23 = helper.compareQueries;
|
|
5795
|
+
var helper_24 = helper.debounce;
|
|
5796
|
+
var helper_25 = helper.getQueryOptions;
|
|
5797
|
+
var helper_26 = helper.buildQuery;
|
|
5798
|
+
var helper_27 = helper.pushToAndClause;
|
|
5799
|
+
var helper_28 = helper.checkValueChange;
|
|
5800
|
+
var helper_29 = helper.getAggsOrder;
|
|
5801
|
+
var helper_30 = helper.formatDate;
|
|
5802
|
+
var helper_31 = helper.getResultStats;
|
|
5803
|
+
var helper_32 = helper.extractFieldsFromSource;
|
|
5804
|
+
var helper_33 = helper.normalizeDataField;
|
|
5805
|
+
var helper_34 = helper.handleOnSuggestions;
|
|
5806
|
+
var helper_35 = helper.isValidDateRangeQueryFormat;
|
|
5797
5807
|
|
|
5798
5808
|
var value = createCommonjsModule(function (module, exports) {
|
|
5799
5809
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -8873,10 +8883,8 @@
|
|
|
8873
8883
|
}, options, queryOptions[component]);
|
|
8874
8884
|
|
|
8875
8885
|
var oldQuery = queryLog[component];
|
|
8876
|
-
console.log('OLD QUERY', component, JSON.stringify(oldQuery));
|
|
8877
|
-
console.log('NEW QUERY', component, JSON.stringify(currentQuery));
|
|
8878
8886
|
|
|
8879
|
-
if (mustExecuteMapQuery || !(0, helper.
|
|
8887
|
+
if (mustExecuteMapQuery || !(0, helper.compareQueries)(currentQuery, oldQuery, false)) {
|
|
8880
8888
|
orderOfQueries = [].concat(_toConsumableArray(orderOfQueries), [component]);
|
|
8881
8889
|
dispatch((0, misc.logQuery)(component, queryToLog));
|
|
8882
8890
|
var isMapComponent = Object.keys(mapData).includes(component);
|
|
@@ -8896,7 +8904,7 @@
|
|
|
8896
8904
|
var _getState5 = getState(),
|
|
8897
8905
|
combinedLog = _getState5.combinedLog;
|
|
8898
8906
|
|
|
8899
|
-
if ((0, helper.
|
|
8907
|
+
if ((0, helper.compareQueries)(combinedLog[component], currentQuery)) return;
|
|
8900
8908
|
dispatch((0, misc.logCombinedQuery)(component, currentQuery));
|
|
8901
8909
|
}
|
|
8902
8910
|
|
|
@@ -9113,7 +9121,7 @@
|
|
|
9113
9121
|
query: _extends({}, queryObj)
|
|
9114
9122
|
}, options);
|
|
9115
9123
|
|
|
9116
|
-
if ((0, helper.
|
|
9124
|
+
if ((0, helper.compareQueries)(queryLog[component], currentQuery)) return;
|
|
9117
9125
|
dispatch((0, misc.logQuery)(component, currentQuery));
|
|
9118
9126
|
|
|
9119
9127
|
if (store.config && store.config.enableAppbase) {
|
|
@@ -19756,7 +19764,7 @@
|
|
|
19756
19764
|
// returns size and aggs property
|
|
19757
19765
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
19758
19766
|
var aggregationField = this.$props.aggregationField;
|
|
19759
|
-
var queryOptions =
|
|
19767
|
+
var queryOptions = helper_25(this.$props);
|
|
19760
19768
|
|
|
19761
19769
|
if (aggregationField) {
|
|
19762
19770
|
queryOptions.aggs = getCompositeAggsQuery$1({
|
|
@@ -23546,33 +23554,25 @@
|
|
|
23546
23554
|
var options = _ref.options,
|
|
23547
23555
|
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23548
23556
|
|
|
23549
|
-
if (options) {
|
|
23550
|
-
_this.setQueryOptions(props.componentId, _extends({}, options, _this.getAggsQuery()), false);
|
|
23551
|
-
}
|
|
23552
|
-
|
|
23553
23557
|
var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
23554
23558
|
|
|
23555
|
-
if (
|
|
23556
|
-
queryToBeSet =
|
|
23559
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
23560
|
+
queryToBeSet = queryToBeSet.query;
|
|
23557
23561
|
}
|
|
23558
23562
|
|
|
23559
|
-
var customQueryCalc = _extends({}, options
|
|
23563
|
+
var customQueryCalc = _extends({}, options, {
|
|
23564
|
+
query: extractQueryFromCustomQuery$6(queryToBeSet)
|
|
23565
|
+
}); // Update customQuery field for RS API
|
|
23560
23566
|
|
|
23561
23567
|
|
|
23562
|
-
|
|
23563
|
-
if (queryToBeSet.query) {
|
|
23564
|
-
if (queryToBeSet.id) {
|
|
23565
|
-
customQueryCalc = queryToBeSet;
|
|
23566
|
-
} else {
|
|
23567
|
-
customQueryCalc.query = queryToBeSet;
|
|
23568
|
-
}
|
|
23569
|
-
}
|
|
23568
|
+
_this.setCustomQuery(props.componentId, customQueryCalc);
|
|
23570
23569
|
|
|
23571
|
-
|
|
23570
|
+
if (options) {
|
|
23571
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
23572
23572
|
}
|
|
23573
23573
|
|
|
23574
23574
|
_this.updateQuery(_extends({}, obj, {
|
|
23575
|
-
query: customQueryCalc,
|
|
23575
|
+
query: customQueryCalc.query,
|
|
23576
23576
|
componentId: props.componentId,
|
|
23577
23577
|
label: props.filterLabel,
|
|
23578
23578
|
showFilter: props.showFilter,
|
|
@@ -23583,12 +23583,13 @@
|
|
|
23583
23583
|
if (props.defaultQuery) {
|
|
23584
23584
|
this.internalComponent = props.componentId + "__internal";
|
|
23585
23585
|
}
|
|
23586
|
-
|
|
23587
|
-
beforeMount: function beforeMount() {
|
|
23586
|
+
|
|
23588
23587
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
23589
23588
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
23590
23589
|
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
23591
|
-
|
|
23590
|
+
|
|
23591
|
+
var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
23592
|
+
|
|
23592
23593
|
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
23593
23594
|
|
|
23594
23595
|
if (queryOptions) {
|
|
@@ -23597,7 +23598,7 @@
|
|
|
23597
23598
|
|
|
23598
23599
|
this.updateQuery({
|
|
23599
23600
|
componentId: this.internalComponent,
|
|
23600
|
-
query:
|
|
23601
|
+
query: _query
|
|
23601
23602
|
});
|
|
23602
23603
|
}
|
|
23603
23604
|
},
|
|
@@ -32495,7 +32496,8 @@
|
|
|
32495
32496
|
|
|
32496
32497
|
var _excluded$5 = ["aggs", "size"],
|
|
32497
32498
|
_excluded2 = ["query"],
|
|
32498
|
-
_excluded3 = ["
|
|
32499
|
+
_excluded3 = ["query"],
|
|
32500
|
+
_excluded4 = ["aggs", "size"];
|
|
32499
32501
|
var X_SEARCH_CLIENT$1 = 'ReactiveSearch Vue';
|
|
32500
32502
|
var componentsWithoutFilters = [constants_1$1.numberBox, constants_1$1.ratingsFilter];
|
|
32501
32503
|
var resultComponents = [constants_1$1.reactiveList, constants_1$1.reactiveMap];
|
|
@@ -32555,10 +32557,15 @@
|
|
|
32555
32557
|
var currentValue = parseValue(value, component);
|
|
32556
32558
|
|
|
32557
32559
|
if (component.customQuery) {
|
|
32558
|
-
|
|
32560
|
+
var customQuery = component.customQuery(currentValue, component);
|
|
32561
|
+
return _extends({
|
|
32562
|
+
query: helper_11(customQuery)
|
|
32563
|
+
}, helper_12(customQuery));
|
|
32559
32564
|
}
|
|
32560
32565
|
|
|
32561
|
-
return component.source.defaultQuery ?
|
|
32566
|
+
return component.source.defaultQuery ? {
|
|
32567
|
+
query: component.source.defaultQuery(currentValue, component)
|
|
32568
|
+
} : null;
|
|
32562
32569
|
}
|
|
32563
32570
|
|
|
32564
32571
|
function initReactivesearch(componentCollection, searchState, settings) {
|
|
@@ -32657,7 +32664,6 @@
|
|
|
32657
32664
|
componentQueryOptions = _extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
|
|
32658
32665
|
}
|
|
32659
32666
|
|
|
32660
|
-
console.log('QUERY LOG componentQueryOptions', component.componentId, componentQueryOptions);
|
|
32661
32667
|
var highlightQuery = {};
|
|
32662
32668
|
|
|
32663
32669
|
if (component.source.highlightQuery) {
|
|
@@ -32718,7 +32724,7 @@
|
|
|
32718
32724
|
var react = component.react;
|
|
32719
32725
|
|
|
32720
32726
|
if (isInternalComponentPresent || isResultComponent) {
|
|
32721
|
-
react =
|
|
32727
|
+
react = helper_27(react, internalComponent);
|
|
32722
32728
|
}
|
|
32723
32729
|
|
|
32724
32730
|
dependencyTree = dependencyTreeReducer(dependencyTree, {
|
|
@@ -32747,7 +32753,11 @@
|
|
|
32747
32753
|
});
|
|
32748
32754
|
}
|
|
32749
32755
|
|
|
32750
|
-
var
|
|
32756
|
+
var _ref3 = getCustomQuery(component, value) || {},
|
|
32757
|
+
query = _ref3.query,
|
|
32758
|
+
options = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
32759
|
+
|
|
32760
|
+
var customQuery = query; // set custom query for main component
|
|
32751
32761
|
|
|
32752
32762
|
queryList = queryReducer(queryList, {
|
|
32753
32763
|
type: 'SET_QUERY',
|
|
@@ -32757,7 +32767,7 @@
|
|
|
32757
32767
|
queryOptions = queryOptionsReducer(queryOptions, {
|
|
32758
32768
|
type: 'SET_QUERY_OPTIONS',
|
|
32759
32769
|
component: component.componentId,
|
|
32760
|
-
options: _extends({}, componentQueryOptions)
|
|
32770
|
+
options: _extends({}, componentQueryOptions, options)
|
|
32761
32771
|
}); // Set component type in component props
|
|
32762
32772
|
|
|
32763
32773
|
compProps.componentType = componentType;
|
|
@@ -32777,20 +32787,19 @@
|
|
|
32777
32787
|
|
|
32778
32788
|
componentCollection.forEach(function (component) {
|
|
32779
32789
|
// eslint-disable-next-line
|
|
32780
|
-
var _buildQuery =
|
|
32790
|
+
var _buildQuery = helper_26(component.componentId, dependencyTree, queryList, queryOptions),
|
|
32781
32791
|
queryObj = _buildQuery.queryObj,
|
|
32782
32792
|
options = _buildQuery.options;
|
|
32783
32793
|
|
|
32784
32794
|
var componentQueryOptions = options;
|
|
32785
32795
|
var componentType = component.source.componentType;
|
|
32786
|
-
console.log('COMPONENT TYPE', componentType);
|
|
32787
32796
|
|
|
32788
32797
|
if (componentType !== constants_1$1.reactiveComponent) {
|
|
32789
32798
|
// don't merge aggs, size
|
|
32790
|
-
var
|
|
32791
|
-
aggs =
|
|
32792
|
-
size =
|
|
32793
|
-
rest = _objectWithoutPropertiesLoose(
|
|
32799
|
+
var _ref4 = options || {},
|
|
32800
|
+
aggs = _ref4.aggs,
|
|
32801
|
+
size = _ref4.size,
|
|
32802
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
32794
32803
|
|
|
32795
32804
|
componentQueryOptions = rest;
|
|
32796
32805
|
}
|
|
@@ -32814,10 +32823,6 @@
|
|
|
32814
32823
|
query: _extends({}, queryObj)
|
|
32815
32824
|
}, componentQueryOptions, queryOptions[component.componentId]);
|
|
32816
32825
|
|
|
32817
|
-
console.log('QUERY LOG build QUERY', component.componentId, queryObj);
|
|
32818
|
-
console.log('QUERY LOG build OPTIONS', component.componentId, componentQueryOptions);
|
|
32819
|
-
console.log('QUERY LOG OPTIONS (component)', component.componentId, queryOptions[component.componentId]);
|
|
32820
|
-
console.log('QUERY LOG', component.componentId, currentQuery);
|
|
32821
32826
|
queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
|
|
32822
32827
|
|
|
32823
32828
|
if (settings.enableAppbase) {
|
|
@@ -33004,7 +33009,7 @@
|
|
|
33004
33009
|
});
|
|
33005
33010
|
}
|
|
33006
33011
|
|
|
33007
|
-
var version = "1.16.0-alpha.
|
|
33012
|
+
var version = "1.16.0-alpha.43";
|
|
33008
33013
|
|
|
33009
33014
|
var _templateObject$o, _templateObject2$b;
|
|
33010
33015
|
|