@appbaseio/reactivesearch-vue 1.16.0-alpha.4 → 1.16.0-alpha.40
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 +8107 -7501
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/Button-d2f1aeda.js +68 -0
- package/dist/cjs/{DownShift-b09da079.js → CancelSvg-82021d23.js} +60 -16
- package/dist/cjs/Card-4b915733.js +30 -0
- package/dist/cjs/{ComponentWrapper-5a0a8849.js → ComponentWrapper-7302fe1a.js} +40 -21
- package/dist/cjs/{Container-f84e72fc.js → Container-8a08d663.js} +3 -11
- package/dist/cjs/DataSearch.js +354 -398
- package/dist/cjs/{DropDown-c66be1a8.js → DropDown-c46d8b0c.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +107 -42
- package/dist/cjs/Flex-699639d2.js +52 -0
- package/dist/cjs/FormControlList-73497794.js +47 -0
- package/dist/cjs/Input-c6f181d5.js +79 -0
- package/dist/cjs/ListItem-933c27e4.js +46 -0
- package/dist/cjs/MultiDropdownList.js +101 -65
- package/dist/cjs/MultiList.js +79 -47
- package/dist/cjs/MultiRange.js +20 -14
- package/dist/cjs/{Pagination-91df3b77.js → Pagination-1b2320a7.js} +4 -3
- package/dist/cjs/RangeInput.js +29 -45
- package/dist/cjs/RangeSlider.js +31 -28
- package/dist/cjs/ReactiveBase.js +55 -34
- package/dist/cjs/ReactiveComponent.js +72 -58
- package/dist/cjs/ReactiveGoogleMap.js +326 -235
- package/dist/cjs/ReactiveList.js +188 -241
- package/dist/cjs/ResultCard.js +8 -6
- package/dist/cjs/ResultList.js +8 -6
- package/dist/cjs/SelectedFilters.js +25 -12
- package/dist/cjs/SingleDropdownList.js +87 -57
- package/dist/cjs/SingleList.js +60 -37
- package/dist/cjs/SingleRange.js +17 -11
- package/dist/cjs/StateProvider.js +11 -7
- package/dist/cjs/{Title-e9beb554.js → Title-39765ee6.js} +3 -11
- package/dist/cjs/ToggleButton.js +35 -16
- package/dist/cjs/{_rollupPluginBabelHelpers-280a574c.js → _rollupPluginBabelHelpers-4abdbfff.js} +11 -1
- package/dist/cjs/{index-e0583d76.js → index-d44a0a21.js} +87 -13
- package/dist/cjs/index.js +23 -19
- package/dist/cjs/initReactivesearch.js +187 -104
- package/dist/cjs/install.js +20 -18
- package/dist/cjs/ssr-c333c82c.js +39 -0
- package/dist/cjs/{utils-d1ea9f95.js → utils-23afb20b.js} +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
- package/dist/es/Button-799185e2.js +59 -0
- package/dist/es/{DownShift-d8f2500f.js → CancelSvg-4d9e0857.js} +56 -17
- package/dist/es/Card-04b3c33e.js +23 -0
- package/dist/es/{ComponentWrapper-d0b21b95.js → ComponentWrapper-bbb717bc.js} +40 -21
- package/dist/es/Container-4383c6f0.js +10 -0
- package/dist/es/DataSearch.js +352 -396
- package/dist/es/{DropDown-5dbd69c2.js → DropDown-4edaa621.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +107 -42
- package/dist/es/Flex-aac91505.js +47 -0
- package/dist/es/FormControlList-fe389a2e.js +40 -0
- package/dist/es/Input-d8519224.js +71 -0
- package/dist/es/ListItem-bdb6d53d.js +39 -0
- package/dist/es/MultiDropdownList.js +101 -65
- package/dist/es/MultiList.js +79 -47
- package/dist/es/MultiRange.js +20 -14
- package/dist/es/{Pagination-800af44f.js → Pagination-b3e4054a.js} +4 -3
- package/dist/es/RangeInput.js +29 -45
- package/dist/es/RangeSlider.js +31 -28
- package/dist/es/ReactiveBase.js +55 -34
- package/dist/es/ReactiveComponent.js +72 -58
- package/dist/es/ReactiveGoogleMap.js +326 -235
- package/dist/es/ReactiveList.js +188 -241
- package/dist/es/ResultCard.js +8 -6
- package/dist/es/ResultList.js +8 -6
- package/dist/es/SelectedFilters.js +25 -12
- package/dist/es/SingleDropdownList.js +87 -57
- package/dist/es/SingleList.js +60 -37
- package/dist/es/SingleRange.js +17 -11
- package/dist/es/StateProvider.js +11 -7
- package/dist/es/Title-579f8d6c.js +10 -0
- package/dist/es/ToggleButton.js +35 -16
- package/dist/es/{_rollupPluginBabelHelpers-c9fbe19f.js → _rollupPluginBabelHelpers-ecf6c03c.js} +11 -1
- package/dist/es/{index-1fe91a0a.js → index-5daa8276.js} +84 -14
- package/dist/es/index.js +23 -19
- package/dist/es/initReactivesearch.js +188 -105
- package/dist/es/install.js +20 -18
- package/dist/es/ssr-e3196de1.js +33 -0
- package/dist/es/{utils-ce3d86fd.js → utils-3a32e13f.js} +2 -2
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
- package/package.json +7 -5
- package/dist/cjs/Button-78d8bc26.js +0 -146
- package/dist/cjs/Card-b4af314f.js +0 -58
- package/dist/cjs/Flex-737c55be.js +0 -160
- package/dist/cjs/FormControlList-08dfb28e.js +0 -105
- package/dist/cjs/Input-643d02a7.js +0 -178
- package/dist/cjs/ListItem-0c58c5d2.js +0 -84
- package/dist/cjs/ssr-b7a729f9.js +0 -47
- package/dist/es/Button-6c71c66e.js +0 -137
- package/dist/es/Card-ecf70ba1.js +0 -51
- package/dist/es/Container-f5efec9e.js +0 -18
- package/dist/es/Flex-40a74d8a.js +0 -155
- package/dist/es/FormControlList-b96aebef.js +0 -98
- package/dist/es/Input-dfd9dd40.js +0 -170
- package/dist/es/ListItem-da73bc7d.js +0 -77
- package/dist/es/Title-22c2f3bf.js +0 -18
- package/dist/es/ssr-2f57791d.js +0 -41
package/dist/es/index.js
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import '@appbaseio/reactivecore';
|
|
2
|
-
import './_rollupPluginBabelHelpers-
|
|
2
|
+
import './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import 'vue-types';
|
|
4
4
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
+
import '@appbaseio/reactivecore/lib/utils/helper';
|
|
5
6
|
import 'emotion';
|
|
6
7
|
import '@appbaseio/vue-emotion';
|
|
7
8
|
import 'polished';
|
|
8
|
-
import './Button-
|
|
9
|
-
import './vueTypes-
|
|
10
|
-
import './Pagination-
|
|
9
|
+
import './Button-799185e2.js';
|
|
10
|
+
import './vueTypes-9326e0be.js';
|
|
11
|
+
import './Pagination-b3e4054a.js';
|
|
11
12
|
export { default as ReactiveList } from './ReactiveList.js';
|
|
12
13
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
13
14
|
import 'redux';
|
|
14
|
-
import './index-
|
|
15
|
-
import './ComponentWrapper-
|
|
15
|
+
import './index-5daa8276.js';
|
|
16
|
+
import './ComponentWrapper-bbb717bc.js';
|
|
16
17
|
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
17
|
-
import './Title-
|
|
18
|
-
import './ListItem-
|
|
19
|
-
import './Card-
|
|
20
|
-
import './Flex-
|
|
21
|
-
import '@appbaseio/reactivecore/lib/utils/helper';
|
|
18
|
+
import './Title-579f8d6c.js';
|
|
19
|
+
import './ListItem-bdb6d53d.js';
|
|
20
|
+
import './Card-04b3c33e.js';
|
|
21
|
+
import './Flex-aac91505.js';
|
|
22
22
|
import '@appbaseio/reactivecore/lib/actions/analytics';
|
|
23
23
|
import 'appbase-js';
|
|
24
24
|
import 'url-search-params-polyfill';
|
|
25
25
|
export { default as ReactiveBase } from './ReactiveBase.js';
|
|
26
|
-
import '
|
|
26
|
+
import 'hotkeys-js';
|
|
27
27
|
export { default as DataSearch } from './DataSearch.js';
|
|
28
|
+
import './CancelSvg-4d9e0857.js';
|
|
29
|
+
import './Input-d8519224.js';
|
|
28
30
|
import 'compute-scroll-into-view';
|
|
29
|
-
import './
|
|
30
|
-
import './Container-f5efec9e.js';
|
|
31
|
+
import './Container-4383c6f0.js';
|
|
31
32
|
import 'vue-highlight-words';
|
|
32
|
-
import '
|
|
33
|
-
import './
|
|
33
|
+
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
34
|
+
import './FormControlList-fe389a2e.js';
|
|
35
|
+
import './utils-3a32e13f.js';
|
|
34
36
|
export { default as SingleList } from './SingleList.js';
|
|
35
37
|
export { default as MultiList } from './MultiList.js';
|
|
36
|
-
import './DropDown-
|
|
38
|
+
import './DropDown-4edaa621.js';
|
|
37
39
|
export { default as SingleDropdownList } from './SingleDropdownList.js';
|
|
38
40
|
export { default as MultiDropdownList } from './MultiDropdownList.js';
|
|
39
41
|
export { default as ToggleButton } from './ToggleButton.js';
|
|
@@ -44,7 +46,7 @@ export { default as MultiRange } from './MultiRange.js';
|
|
|
44
46
|
export { default as ResultCard } from './ResultCard.js';
|
|
45
47
|
export { default as ResultList } from './ResultList.js';
|
|
46
48
|
import 'vue-no-ssr';
|
|
47
|
-
import './ssr-
|
|
49
|
+
import './ssr-e3196de1.js';
|
|
48
50
|
export { default as RangeSlider } from './RangeSlider.js';
|
|
49
51
|
export { default as DynamicRangeSlider } from './DynamicRangeSlider.js';
|
|
50
52
|
export { default as StateProvider } from './StateProvider.js';
|
|
@@ -53,12 +55,14 @@ import 'gmap-vue/dist/components-implementation/map';
|
|
|
53
55
|
import 'ngeohash';
|
|
54
56
|
export { default as ReactiveGoogleMap } from './ReactiveGoogleMap.js';
|
|
55
57
|
import 'gmap-vue/dist/components/cluster';
|
|
56
|
-
import 'gmap-vue/dist/components/marker';
|
|
57
58
|
import 'gmap-vue/dist/components-implementation/info-window';
|
|
59
|
+
import 'gmap-vue/dist/components/marker';
|
|
58
60
|
import 'gmap-vue/dist/mixins/map-element';
|
|
59
61
|
import '@appbaseio/reactivecore/lib/reducers/valueReducer';
|
|
60
62
|
import '@appbaseio/reactivecore/lib/reducers/queryReducer';
|
|
61
63
|
import '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
|
|
64
|
+
import '@appbaseio/reactivecore/lib/reducers/compositeAggsReducer';
|
|
65
|
+
import '@appbaseio/reactivecore/lib/constants';
|
|
62
66
|
import '@appbaseio/reactivecore/lib/reducers/dependencyTreeReducer';
|
|
63
67
|
import '@appbaseio/reactivecore/lib/utils/graphQL';
|
|
64
68
|
import '@appbaseio/reactivecore/lib/actions/utils';
|
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
2
|
import { validProps, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { pushToAndClause, buildQuery, extractQueryFromCustomQuery, getOptionsForCustomQuery } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
4
|
+
import { isSearchComponent, getRSQuery, extractPropsFromState, getDependentQueries } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
5
5
|
import Appbase from 'appbase-js';
|
|
6
6
|
import valueReducer from '@appbaseio/reactivecore/lib/reducers/valueReducer';
|
|
7
7
|
import queryReducer from '@appbaseio/reactivecore/lib/reducers/queryReducer';
|
|
8
8
|
import queryOptionsReducer from '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
|
|
9
|
+
import compositeAggsReducer from '@appbaseio/reactivecore/lib/reducers/compositeAggsReducer';
|
|
10
|
+
import { UPDATE_COMPOSITE_AGGS } from '@appbaseio/reactivecore/lib/constants';
|
|
9
11
|
import dependencyTreeReducer from '@appbaseio/reactivecore/lib/reducers/dependencyTreeReducer';
|
|
10
12
|
import fetchGraphQL from '@appbaseio/reactivecore/lib/utils/graphQL';
|
|
11
13
|
import { isPropertyDefined } from '@appbaseio/reactivecore/lib/actions/utils';
|
|
12
14
|
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
+
var _excluded = ["aggs", "size"],
|
|
16
|
+
_excluded2 = ["query"],
|
|
17
|
+
_excluded3 = ["aggs", "size"];
|
|
18
|
+
var X_SEARCH_CLIENT = 'ReactiveSearch Vue';
|
|
15
19
|
var componentsWithoutFilters = [componentTypes.numberBox, componentTypes.ratingsFilter];
|
|
16
20
|
var resultComponents = [componentTypes.reactiveList, componentTypes.reactiveMap];
|
|
17
21
|
|
|
18
22
|
function getValue(state, id, defaultValue) {
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
if (state[id]) {
|
|
23
|
+
if (state && state[id]) {
|
|
22
24
|
try {
|
|
23
25
|
// parsing for next.js - since it uses extra set of quotes to wrap params
|
|
24
26
|
var parsedValue = JSON.parse(state[id]);
|
|
25
|
-
return
|
|
27
|
+
return {
|
|
28
|
+
value: parsedValue,
|
|
29
|
+
reference: 'URL'
|
|
30
|
+
};
|
|
26
31
|
} catch (error) {
|
|
27
32
|
// using react-dom-server for ssr
|
|
28
|
-
return
|
|
33
|
+
return {
|
|
34
|
+
value: state[id],
|
|
35
|
+
reference: 'URL'
|
|
36
|
+
};
|
|
29
37
|
}
|
|
30
38
|
}
|
|
31
39
|
|
|
32
|
-
return
|
|
40
|
+
return {
|
|
41
|
+
value: defaultValue,
|
|
42
|
+
reference: 'DEFAULT'
|
|
43
|
+
};
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
function parseValue(value, component) {
|
|
@@ -38,28 +49,48 @@ function parseValue(value, component) {
|
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
return value;
|
|
41
|
-
}
|
|
52
|
+
} // Returns query DSL with query property and other options
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
function getDefaultQuery(component, value) {
|
|
56
|
+
// get custom or default query of sensor components
|
|
57
|
+
var currentValue = parseValue(value, component); // get default query of result components
|
|
58
|
+
|
|
59
|
+
if (component.defaultQuery) {
|
|
60
|
+
var defaultQuery = component.defaultQuery(currentValue, component);
|
|
61
|
+
return _extends({
|
|
62
|
+
query: extractQueryFromCustomQuery(defaultQuery)
|
|
63
|
+
}, getOptionsForCustomQuery(defaultQuery));
|
|
64
|
+
}
|
|
42
65
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} // get custom or default query of sensor components
|
|
66
|
+
return component.source.defaultQuery ? {
|
|
67
|
+
query: component.source.defaultQuery(currentValue, component)
|
|
68
|
+
} : {};
|
|
69
|
+
} // Only results the query part
|
|
48
70
|
|
|
49
71
|
|
|
72
|
+
function getCustomQuery(component, value) {
|
|
73
|
+
// get custom or default query of sensor components
|
|
50
74
|
var currentValue = parseValue(value, component);
|
|
51
75
|
|
|
52
76
|
if (component.customQuery) {
|
|
53
|
-
|
|
54
|
-
return customQuery && customQuery.query;
|
|
77
|
+
return extractQueryFromCustomQuery(component.customQuery(currentValue, component));
|
|
55
78
|
}
|
|
56
79
|
|
|
57
|
-
return component.source.defaultQuery ? component.source.defaultQuery(currentValue, component) :
|
|
80
|
+
return component.source.defaultQuery ? component.source.defaultQuery(currentValue, component) : null;
|
|
58
81
|
}
|
|
59
82
|
|
|
60
83
|
function initReactivesearch(componentCollection, searchState, settings) {
|
|
61
84
|
return new Promise(function (resolve, reject) {
|
|
62
85
|
var credentials = settings.url && settings.url.trim() !== '' && !settings.credentials ? null : settings.credentials;
|
|
86
|
+
var enableTelemetry = settings.appbaseConfig && settings.appbaseConfig.enableTelemetry !== undefined ? settings.appbaseConfig.enableTelemetry : true;
|
|
87
|
+
|
|
88
|
+
var headers = _extends({}, settings.enableAppbase && _extends({
|
|
89
|
+
'X-Search-Client': X_SEARCH_CLIENT
|
|
90
|
+
}, enableTelemetry === false && {
|
|
91
|
+
'X-Enable-Telemetry': false
|
|
92
|
+
}), settings.headers);
|
|
93
|
+
|
|
63
94
|
var config = {
|
|
64
95
|
url: settings.url && settings.url.trim() !== '' ? settings.url : 'https://scalr.api.appbase.io',
|
|
65
96
|
app: settings.app,
|
|
@@ -68,7 +99,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
68
99
|
type: settings.type ? settings.type : '*',
|
|
69
100
|
transformResponse: settings.transformResponse || null,
|
|
70
101
|
graphQLUrl: settings.graphQLUrl || '',
|
|
71
|
-
headers:
|
|
102
|
+
headers: headers,
|
|
72
103
|
analyticsConfig: settings.appbaseConfig || null
|
|
73
104
|
};
|
|
74
105
|
var appbaseRef = Appbase(config);
|
|
@@ -85,6 +116,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
85
116
|
var orderOfQueries = [];
|
|
86
117
|
var hits = {};
|
|
87
118
|
var aggregations = {};
|
|
119
|
+
var compositeAggregations = {};
|
|
88
120
|
var state = {};
|
|
89
121
|
var customQueries = {};
|
|
90
122
|
var defaultQueries = {};
|
|
@@ -99,20 +131,20 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
99
131
|
compProps[key] = component[key];
|
|
100
132
|
}
|
|
101
133
|
});
|
|
102
|
-
var isInternalComponentPresent = false;
|
|
134
|
+
var isInternalComponentPresent = false;
|
|
103
135
|
|
|
104
|
-
if (component.
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
109
|
-
defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
|
|
136
|
+
if (component.source.hasInternalComponent) {
|
|
137
|
+
isInternalComponentPresent = component.source.hasInternalComponent(component);
|
|
110
138
|
}
|
|
111
139
|
|
|
112
140
|
var isResultComponent = resultComponents.includes(componentType);
|
|
113
141
|
var internalComponent = component.componentId + "__internal";
|
|
114
142
|
var label = component.filterLabel || component.componentId;
|
|
115
|
-
|
|
143
|
+
|
|
144
|
+
var _getValue = getValue(searchState, component.componentId, component.value || component.defaultValue),
|
|
145
|
+
value = _getValue.value,
|
|
146
|
+
reference = _getValue.reference; // [1] set selected values
|
|
147
|
+
|
|
116
148
|
|
|
117
149
|
var showFilter = component.showFilter !== undefined ? component.showFilter : true;
|
|
118
150
|
|
|
@@ -125,75 +157,78 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
125
157
|
component: component.componentId,
|
|
126
158
|
label: label,
|
|
127
159
|
value: value,
|
|
160
|
+
reference: reference,
|
|
128
161
|
showFilter: showFilter,
|
|
129
162
|
URLParams: component.URLParams || false
|
|
130
|
-
}); //
|
|
163
|
+
}); // Set custom and default queries
|
|
131
164
|
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
165
|
+
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
166
|
+
customQueries[component.componentId] = component.customQuery(value, compProps);
|
|
167
|
+
}
|
|
135
168
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
169
|
+
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
170
|
+
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
171
|
+
}
|
|
139
172
|
|
|
140
|
-
|
|
141
|
-
// eslint-disable-next-line
|
|
142
|
-
var _ref = options || {},
|
|
143
|
-
aggs = _ref.aggs,
|
|
144
|
-
size = _ref.size,
|
|
145
|
-
otherQueryOptions = _objectWithoutPropertiesLoose(_ref, ["aggs", "size"]);
|
|
146
|
-
|
|
147
|
-
if (aggs && Object.keys(aggs).length) {
|
|
148
|
-
isInternalComponentPresent = true; // query should be applied on the internal component
|
|
149
|
-
// to enable feeding the data to parent component
|
|
150
|
-
|
|
151
|
-
queryOptions = queryOptionsReducer(queryOptions, {
|
|
152
|
-
type: 'SET_QUERY_OPTIONS',
|
|
153
|
-
component: internalComponent,
|
|
154
|
-
options: {
|
|
155
|
-
aggs: aggs,
|
|
156
|
-
size: typeof size === 'undefined' ? 100 : size
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
} // sort, highlight, size, from - query should be applied on the main component
|
|
173
|
+
var componentQueryOptions = {}; // [2] set query options - main component query (valid for result components)
|
|
160
174
|
|
|
175
|
+
if (component && component.source.generateQueryOptions) {
|
|
176
|
+
componentQueryOptions = _extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
|
|
177
|
+
}
|
|
161
178
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (!highlightQuery) highlightQuery = {};
|
|
179
|
+
console.log('QUERY LOG componentQueryOptions', component.componentId, componentQueryOptions);
|
|
180
|
+
var highlightQuery = {};
|
|
165
181
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
182
|
+
if (component.source.highlightQuery) {
|
|
183
|
+
highlightQuery = component.source.highlightQuery(component);
|
|
184
|
+
}
|
|
169
185
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
186
|
+
if (componentQueryOptions && Object.keys(componentQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
|
|
187
|
+
// eslint-disable-next-line
|
|
188
|
+
var _ref = componentQueryOptions || {},
|
|
189
|
+
aggs = _ref.aggs,
|
|
190
|
+
size = _ref.size,
|
|
191
|
+
otherQueryOptions = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
192
|
+
|
|
193
|
+
if (aggs && Object.keys(aggs).length) {
|
|
194
|
+
isInternalComponentPresent = true;
|
|
195
|
+
componentQueryOptions = _extends({}, componentQueryOptions, {
|
|
196
|
+
aggs: aggs,
|
|
197
|
+
size: typeof size === 'undefined' ? 100 : size
|
|
198
|
+
});
|
|
199
|
+
} // sort, highlight, size, from - query should be applied on the main component
|
|
173
200
|
|
|
174
|
-
if (isResultComponent) {
|
|
175
|
-
var currentPage = component.currentPage ? component.currentPage - 1 : 0;
|
|
176
201
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
202
|
+
if (otherQueryOptions && Object.keys(otherQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
|
|
203
|
+
if (!otherQueryOptions) otherQueryOptions = {};
|
|
204
|
+
if (!highlightQuery) highlightQuery = {};
|
|
180
205
|
|
|
181
|
-
|
|
182
|
-
|
|
206
|
+
var mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery, {
|
|
207
|
+
size: size
|
|
208
|
+
});
|
|
183
209
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
210
|
+
if (isInternalComponentPresent) {
|
|
211
|
+
mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (isResultComponent) {
|
|
215
|
+
var currentPage = component.currentPage ? component.currentPage - 1 : 0;
|
|
216
|
+
|
|
217
|
+
if (selectedValues[component.componentId] && selectedValues[component.componentId].value) {
|
|
218
|
+
currentPage = selectedValues[component.componentId].value - 1 || 0;
|
|
189
219
|
}
|
|
190
220
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
221
|
+
var resultSize = component.size || 10;
|
|
222
|
+
var from = currentPage * resultSize; // Update props for RS API
|
|
223
|
+
|
|
224
|
+
compProps.from = from;
|
|
225
|
+
mainQueryOptions = _extends({}, mainQueryOptions, highlightQuery, {
|
|
226
|
+
size: resultSize,
|
|
227
|
+
from: from
|
|
195
228
|
});
|
|
196
229
|
}
|
|
230
|
+
|
|
231
|
+
componentQueryOptions = _extends({}, componentQueryOptions, mainQueryOptions);
|
|
197
232
|
}
|
|
198
233
|
} // [3] set dependency tree
|
|
199
234
|
|
|
@@ -211,25 +246,38 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
211
246
|
react: react
|
|
212
247
|
});
|
|
213
248
|
} // [4] set query list
|
|
249
|
+
// Do not set default query for suggestions
|
|
214
250
|
|
|
215
251
|
|
|
216
|
-
if (
|
|
217
|
-
var
|
|
218
|
-
|
|
252
|
+
if (isInternalComponentPresent && !isSearchComponent(component.componentType)) {
|
|
253
|
+
var _ref2 = getDefaultQuery(component, value) || {},
|
|
254
|
+
defaultQuery = _ref2.query,
|
|
255
|
+
defaultQueryOptions = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
219
256
|
|
|
220
257
|
queryList = queryReducer(queryList, {
|
|
221
258
|
type: 'SET_QUERY',
|
|
222
259
|
component: internalComponent,
|
|
223
|
-
query:
|
|
260
|
+
query: defaultQuery
|
|
224
261
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
query: getQuery(component, value, componentType)
|
|
262
|
+
queryOptions = queryOptionsReducer(queryOptions, {
|
|
263
|
+
type: 'SET_QUERY_OPTIONS',
|
|
264
|
+
component: internalComponent,
|
|
265
|
+
options: _extends({}, componentQueryOptions, defaultQueryOptions)
|
|
230
266
|
});
|
|
231
|
-
}
|
|
267
|
+
}
|
|
232
268
|
|
|
269
|
+
var customQuery = getCustomQuery(component, value); // set custom query for main component
|
|
270
|
+
|
|
271
|
+
queryList = queryReducer(queryList, {
|
|
272
|
+
type: 'SET_QUERY',
|
|
273
|
+
component: component.componentId,
|
|
274
|
+
query: customQuery
|
|
275
|
+
});
|
|
276
|
+
queryOptions = queryOptionsReducer(queryOptions, {
|
|
277
|
+
type: 'SET_QUERY_OPTIONS',
|
|
278
|
+
component: component.componentId,
|
|
279
|
+
options: _extends({}, componentQueryOptions)
|
|
280
|
+
}); // Set component type in component props
|
|
233
281
|
|
|
234
282
|
compProps.componentType = componentType;
|
|
235
283
|
componentProps[component.componentId] = compProps;
|
|
@@ -252,9 +300,23 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
252
300
|
queryObj = _buildQuery.queryObj,
|
|
253
301
|
options = _buildQuery.options;
|
|
254
302
|
|
|
255
|
-
var
|
|
303
|
+
var componentQueryOptions = options;
|
|
304
|
+
var componentType = component.source.componentType;
|
|
305
|
+
console.log('COMPONENT TYPE', componentType);
|
|
306
|
+
|
|
307
|
+
if (componentType !== componentTypes.reactiveComponent) {
|
|
308
|
+
// don't merge aggs, size
|
|
309
|
+
var _ref3 = options || {},
|
|
310
|
+
aggs = _ref3.aggs,
|
|
311
|
+
size = _ref3.size,
|
|
312
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
256
313
|
|
|
257
|
-
|
|
314
|
+
componentQueryOptions = rest;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
var validOptions = ['aggs', 'from', 'sort']; // check if query or componentQueryOptions are valid - non-empty
|
|
318
|
+
|
|
319
|
+
if (queryObj && !!Object.keys(queryObj).length || componentQueryOptions && Object.keys(componentQueryOptions).some(function (item) {
|
|
258
320
|
return validOptions.includes(item);
|
|
259
321
|
})) {
|
|
260
322
|
var _extends2;
|
|
@@ -267,11 +329,15 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
267
329
|
|
|
268
330
|
orderOfQueries = [].concat(orderOfQueries, [component.componentId]);
|
|
269
331
|
|
|
270
|
-
var currentQuery = _extends(
|
|
332
|
+
var currentQuery = _extends({
|
|
271
333
|
query: _extends({}, queryObj)
|
|
272
|
-
},
|
|
334
|
+
}, componentQueryOptions, queryOptions[component.componentId]);
|
|
273
335
|
|
|
274
|
-
|
|
336
|
+
console.log('QUERY LOG build QUERY', component.componentId, queryObj);
|
|
337
|
+
console.log('QUERY LOG build OPTIONS', component.componentId, componentQueryOptions);
|
|
338
|
+
console.log('QUERY LOG OPTIONS (component)', component.componentId, queryOptions[component.componentId]);
|
|
339
|
+
console.log('QUERY LOG', component.componentId, currentQuery);
|
|
340
|
+
queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
|
|
275
341
|
|
|
276
342
|
if (settings.enableAppbase) {
|
|
277
343
|
var query = getRSQuery(component.componentId, extractPropsFromState(state, component.componentId, queryOptions && queryOptions[component.componentId] ? {
|
|
@@ -282,11 +348,12 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
282
348
|
var _extends3;
|
|
283
349
|
|
|
284
350
|
// Apply dependent queries
|
|
285
|
-
appbaseQuery = _extends(
|
|
351
|
+
appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), getDependentQueries(state, component.componentId, orderOfQueries));
|
|
286
352
|
}
|
|
287
353
|
} else {
|
|
354
|
+
var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
|
|
288
355
|
finalQuery = [].concat(finalQuery, [{
|
|
289
|
-
preference:
|
|
356
|
+
preference: preference
|
|
290
357
|
}, currentQuery]);
|
|
291
358
|
}
|
|
292
359
|
}
|
|
@@ -312,10 +379,15 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
312
379
|
if (response.aggregations) {
|
|
313
380
|
var _extends4;
|
|
314
381
|
|
|
315
|
-
aggregations = _extends(
|
|
382
|
+
aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
|
|
383
|
+
compositeAggregations = compositeAggsReducer(compositeAggregations, {
|
|
384
|
+
type: UPDATE_COMPOSITE_AGGS,
|
|
385
|
+
aggregations: response.aggregations,
|
|
386
|
+
append: false
|
|
387
|
+
});
|
|
316
388
|
}
|
|
317
389
|
|
|
318
|
-
hits = _extends(
|
|
390
|
+
hits = _extends({}, hits, (_extends5 = {}, _extends5[component] = {
|
|
319
391
|
hits: response.hits.hits,
|
|
320
392
|
total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
|
|
321
393
|
time: response.took
|
|
@@ -327,7 +399,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
327
399
|
});
|
|
328
400
|
});
|
|
329
401
|
Promise.all(allPromises).then(function () {
|
|
330
|
-
state = _extends(
|
|
402
|
+
state = _extends({}, state, {
|
|
331
403
|
hits: hits,
|
|
332
404
|
aggregations: aggregations
|
|
333
405
|
});
|
|
@@ -339,6 +411,8 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
339
411
|
var promotedResults = {};
|
|
340
412
|
var rawData = {};
|
|
341
413
|
var customData = {};
|
|
414
|
+
var settingsResponse = {};
|
|
415
|
+
var timestamp = {};
|
|
342
416
|
var allPromises = orderOfQueries.map(function (component) {
|
|
343
417
|
return new Promise(function (responseResolve, responseReject) {
|
|
344
418
|
handleTransformResponse(res[component], component).then(function (response) {
|
|
@@ -347,7 +421,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
347
421
|
|
|
348
422
|
if (response.promoted) {
|
|
349
423
|
promotedResults[component] = response.promoted.map(function (promoted) {
|
|
350
|
-
return _extends(
|
|
424
|
+
return _extends({}, promoted.doc, {
|
|
351
425
|
_position: promoted.position
|
|
352
426
|
});
|
|
353
427
|
});
|
|
@@ -357,15 +431,21 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
357
431
|
|
|
358
432
|
if (response.customData) {
|
|
359
433
|
customData[component] = response.customData;
|
|
434
|
+
} // Update settings
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
if (response.settings) {
|
|
438
|
+
settingsResponse[component] = response.settings;
|
|
360
439
|
}
|
|
361
440
|
|
|
362
441
|
if (response.aggregations) {
|
|
363
442
|
var _extends6;
|
|
364
443
|
|
|
365
|
-
aggregations = _extends(
|
|
444
|
+
aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
|
|
366
445
|
}
|
|
367
446
|
|
|
368
|
-
|
|
447
|
+
timestamp[component] = res._timestamp;
|
|
448
|
+
hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
|
|
369
449
|
hits: response.hits.hits,
|
|
370
450
|
total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
|
|
371
451
|
time: response.took
|
|
@@ -378,10 +458,13 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
378
458
|
});
|
|
379
459
|
});
|
|
380
460
|
Promise.all(allPromises).then(function () {
|
|
381
|
-
state = _extends(
|
|
461
|
+
state = _extends({}, state, {
|
|
382
462
|
hits: hits,
|
|
463
|
+
timestamp: timestamp,
|
|
383
464
|
aggregations: aggregations,
|
|
465
|
+
compositeAggregations: compositeAggregations,
|
|
384
466
|
promotedResults: promotedResults,
|
|
467
|
+
settings: settingsResponse,
|
|
385
468
|
customData: customData,
|
|
386
469
|
rawData: rawData
|
|
387
470
|
});
|
package/dist/es/install.js
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import '@appbaseio/reactivecore';
|
|
2
|
-
import './_rollupPluginBabelHelpers-
|
|
2
|
+
import './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import 'vue-types';
|
|
4
4
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
+
import '@appbaseio/reactivecore/lib/utils/helper';
|
|
5
6
|
import 'emotion';
|
|
6
7
|
import '@appbaseio/vue-emotion';
|
|
7
8
|
import 'polished';
|
|
8
|
-
import './Button-
|
|
9
|
-
import './vueTypes-
|
|
10
|
-
import './Pagination-
|
|
9
|
+
import './Button-799185e2.js';
|
|
10
|
+
import './vueTypes-9326e0be.js';
|
|
11
|
+
import './Pagination-b3e4054a.js';
|
|
11
12
|
import ReactiveList from './ReactiveList.js';
|
|
12
13
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
13
14
|
import 'redux';
|
|
14
|
-
import './index-
|
|
15
|
-
import './ComponentWrapper-
|
|
15
|
+
import './index-5daa8276.js';
|
|
16
|
+
import './ComponentWrapper-bbb717bc.js';
|
|
16
17
|
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
17
|
-
import './Title-
|
|
18
|
-
import './ListItem-
|
|
19
|
-
import './Card-
|
|
20
|
-
import './Flex-
|
|
21
|
-
import '@appbaseio/reactivecore/lib/utils/helper';
|
|
18
|
+
import './Title-579f8d6c.js';
|
|
19
|
+
import './ListItem-bdb6d53d.js';
|
|
20
|
+
import './Card-04b3c33e.js';
|
|
21
|
+
import './Flex-aac91505.js';
|
|
22
22
|
import '@appbaseio/reactivecore/lib/actions/analytics';
|
|
23
23
|
import 'appbase-js';
|
|
24
24
|
import 'url-search-params-polyfill';
|
|
25
25
|
import ReactiveBase from './ReactiveBase.js';
|
|
26
|
-
import '
|
|
26
|
+
import 'hotkeys-js';
|
|
27
27
|
import DataSearch from './DataSearch.js';
|
|
28
|
+
import './CancelSvg-4d9e0857.js';
|
|
29
|
+
import './Input-d8519224.js';
|
|
28
30
|
import 'compute-scroll-into-view';
|
|
29
|
-
import './
|
|
30
|
-
import './Container-f5efec9e.js';
|
|
31
|
+
import './Container-4383c6f0.js';
|
|
31
32
|
import 'vue-highlight-words';
|
|
32
|
-
import '
|
|
33
|
-
import './
|
|
33
|
+
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
34
|
+
import './FormControlList-fe389a2e.js';
|
|
35
|
+
import './utils-3a32e13f.js';
|
|
34
36
|
import SingleList from './SingleList.js';
|
|
35
37
|
import MultiList from './MultiList.js';
|
|
36
|
-
import './DropDown-
|
|
38
|
+
import './DropDown-4edaa621.js';
|
|
37
39
|
import SingleDropdownList from './SingleDropdownList.js';
|
|
38
40
|
import MultiDropdownList from './MultiDropdownList.js';
|
|
39
41
|
import ToggleButton from './ToggleButton.js';
|
|
@@ -44,7 +46,7 @@ import MultiRange from './MultiRange.js';
|
|
|
44
46
|
import ResultCard from './ResultCard.js';
|
|
45
47
|
import ResultList from './ResultList.js';
|
|
46
48
|
import 'vue-no-ssr';
|
|
47
|
-
import './ssr-
|
|
49
|
+
import './ssr-e3196de1.js';
|
|
48
50
|
import RangeSlider from './RangeSlider.js';
|
|
49
51
|
import DynamicRangeSlider from './DynamicRangeSlider.js';
|
|
50
52
|
import StateProvider from './StateProvider.js';
|