@appbaseio/reactivesearch-vue 1.16.0-alpha.4 → 1.16.0-alpha.42
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 +8110 -7499
- 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 +69 -62
- 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 +190 -103
- 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 +69 -62
- 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 +191 -104
- 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,47 @@
|
|
|
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 = ["query"],
|
|
18
|
+
_excluded4 = ["aggs", "size"];
|
|
19
|
+
var X_SEARCH_CLIENT = 'ReactiveSearch Vue';
|
|
15
20
|
var componentsWithoutFilters = [componentTypes.numberBox, componentTypes.ratingsFilter];
|
|
16
21
|
var resultComponents = [componentTypes.reactiveList, componentTypes.reactiveMap];
|
|
17
22
|
|
|
18
23
|
function getValue(state, id, defaultValue) {
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
if (state[id]) {
|
|
24
|
+
if (state && state[id]) {
|
|
22
25
|
try {
|
|
23
26
|
// parsing for next.js - since it uses extra set of quotes to wrap params
|
|
24
27
|
var parsedValue = JSON.parse(state[id]);
|
|
25
|
-
return
|
|
28
|
+
return {
|
|
29
|
+
value: parsedValue,
|
|
30
|
+
reference: 'URL'
|
|
31
|
+
};
|
|
26
32
|
} catch (error) {
|
|
27
33
|
// using react-dom-server for ssr
|
|
28
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
value: state[id],
|
|
36
|
+
reference: 'URL'
|
|
37
|
+
};
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
|
|
32
|
-
return
|
|
41
|
+
return {
|
|
42
|
+
value: defaultValue,
|
|
43
|
+
reference: 'DEFAULT'
|
|
44
|
+
};
|
|
33
45
|
}
|
|
34
46
|
|
|
35
47
|
function parseValue(value, component) {
|
|
@@ -38,28 +50,53 @@ function parseValue(value, component) {
|
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
return value;
|
|
41
|
-
}
|
|
53
|
+
} // Returns query DSL with query property and other options
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
function getDefaultQuery(component, value) {
|
|
57
|
+
// get custom or default query of sensor components
|
|
58
|
+
var currentValue = parseValue(value, component); // get default query of result components
|
|
59
|
+
|
|
60
|
+
if (component.defaultQuery) {
|
|
61
|
+
var defaultQuery = component.defaultQuery(currentValue, component);
|
|
62
|
+
return _extends({
|
|
63
|
+
query: extractQueryFromCustomQuery(defaultQuery)
|
|
64
|
+
}, getOptionsForCustomQuery(defaultQuery));
|
|
65
|
+
}
|
|
42
66
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} // get custom or default query of sensor components
|
|
67
|
+
return component.source.defaultQuery ? {
|
|
68
|
+
query: component.source.defaultQuery(currentValue, component)
|
|
69
|
+
} : {};
|
|
70
|
+
} // Only results the query part
|
|
48
71
|
|
|
49
72
|
|
|
73
|
+
function getCustomQuery(component, value) {
|
|
74
|
+
// get custom or default query of sensor components
|
|
50
75
|
var currentValue = parseValue(value, component);
|
|
51
76
|
|
|
52
77
|
if (component.customQuery) {
|
|
53
78
|
var customQuery = component.customQuery(currentValue, component);
|
|
54
|
-
return
|
|
79
|
+
return _extends({
|
|
80
|
+
query: extractQueryFromCustomQuery(customQuery)
|
|
81
|
+
}, getOptionsForCustomQuery(customQuery));
|
|
55
82
|
}
|
|
56
83
|
|
|
57
|
-
return component.source.defaultQuery ?
|
|
84
|
+
return component.source.defaultQuery ? {
|
|
85
|
+
query: component.source.defaultQuery(currentValue, component)
|
|
86
|
+
} : null;
|
|
58
87
|
}
|
|
59
88
|
|
|
60
89
|
function initReactivesearch(componentCollection, searchState, settings) {
|
|
61
90
|
return new Promise(function (resolve, reject) {
|
|
62
91
|
var credentials = settings.url && settings.url.trim() !== '' && !settings.credentials ? null : settings.credentials;
|
|
92
|
+
var enableTelemetry = settings.appbaseConfig && settings.appbaseConfig.enableTelemetry !== undefined ? settings.appbaseConfig.enableTelemetry : true;
|
|
93
|
+
|
|
94
|
+
var headers = _extends({}, settings.enableAppbase && _extends({
|
|
95
|
+
'X-Search-Client': X_SEARCH_CLIENT
|
|
96
|
+
}, enableTelemetry === false && {
|
|
97
|
+
'X-Enable-Telemetry': false
|
|
98
|
+
}), settings.headers);
|
|
99
|
+
|
|
63
100
|
var config = {
|
|
64
101
|
url: settings.url && settings.url.trim() !== '' ? settings.url : 'https://scalr.api.appbase.io',
|
|
65
102
|
app: settings.app,
|
|
@@ -68,7 +105,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
68
105
|
type: settings.type ? settings.type : '*',
|
|
69
106
|
transformResponse: settings.transformResponse || null,
|
|
70
107
|
graphQLUrl: settings.graphQLUrl || '',
|
|
71
|
-
headers:
|
|
108
|
+
headers: headers,
|
|
72
109
|
analyticsConfig: settings.appbaseConfig || null
|
|
73
110
|
};
|
|
74
111
|
var appbaseRef = Appbase(config);
|
|
@@ -85,6 +122,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
85
122
|
var orderOfQueries = [];
|
|
86
123
|
var hits = {};
|
|
87
124
|
var aggregations = {};
|
|
125
|
+
var compositeAggregations = {};
|
|
88
126
|
var state = {};
|
|
89
127
|
var customQueries = {};
|
|
90
128
|
var defaultQueries = {};
|
|
@@ -99,20 +137,20 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
99
137
|
compProps[key] = component[key];
|
|
100
138
|
}
|
|
101
139
|
});
|
|
102
|
-
var isInternalComponentPresent = false;
|
|
140
|
+
var isInternalComponentPresent = false;
|
|
103
141
|
|
|
104
|
-
if (component.
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
109
|
-
defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
|
|
142
|
+
if (component.source.hasInternalComponent) {
|
|
143
|
+
isInternalComponentPresent = component.source.hasInternalComponent(component);
|
|
110
144
|
}
|
|
111
145
|
|
|
112
146
|
var isResultComponent = resultComponents.includes(componentType);
|
|
113
147
|
var internalComponent = component.componentId + "__internal";
|
|
114
148
|
var label = component.filterLabel || component.componentId;
|
|
115
|
-
|
|
149
|
+
|
|
150
|
+
var _getValue = getValue(searchState, component.componentId, component.value || component.defaultValue),
|
|
151
|
+
value = _getValue.value,
|
|
152
|
+
reference = _getValue.reference; // [1] set selected values
|
|
153
|
+
|
|
116
154
|
|
|
117
155
|
var showFilter = component.showFilter !== undefined ? component.showFilter : true;
|
|
118
156
|
|
|
@@ -125,75 +163,77 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
125
163
|
component: component.componentId,
|
|
126
164
|
label: label,
|
|
127
165
|
value: value,
|
|
166
|
+
reference: reference,
|
|
128
167
|
showFilter: showFilter,
|
|
129
168
|
URLParams: component.URLParams || false
|
|
130
|
-
}); //
|
|
169
|
+
}); // Set custom and default queries
|
|
131
170
|
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
171
|
+
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
172
|
+
customQueries[component.componentId] = component.customQuery(value, compProps);
|
|
173
|
+
}
|
|
135
174
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
175
|
+
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
176
|
+
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
177
|
+
}
|
|
139
178
|
|
|
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
|
|
179
|
+
var componentQueryOptions = {}; // [2] set query options - main component query (valid for result components)
|
|
160
180
|
|
|
181
|
+
if (component && component.source.generateQueryOptions) {
|
|
182
|
+
componentQueryOptions = _extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
|
|
183
|
+
}
|
|
161
184
|
|
|
162
|
-
|
|
163
|
-
if (!otherQueryOptions) otherQueryOptions = {};
|
|
164
|
-
if (!highlightQuery) highlightQuery = {};
|
|
185
|
+
var highlightQuery = {};
|
|
165
186
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
if (component.source.highlightQuery) {
|
|
188
|
+
highlightQuery = component.source.highlightQuery(component);
|
|
189
|
+
}
|
|
169
190
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
if (componentQueryOptions && Object.keys(componentQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
|
|
192
|
+
// eslint-disable-next-line
|
|
193
|
+
var _ref = componentQueryOptions || {},
|
|
194
|
+
aggs = _ref.aggs,
|
|
195
|
+
size = _ref.size,
|
|
196
|
+
otherQueryOptions = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
197
|
+
|
|
198
|
+
if (aggs && Object.keys(aggs).length) {
|
|
199
|
+
isInternalComponentPresent = true;
|
|
200
|
+
componentQueryOptions = _extends({}, componentQueryOptions, {
|
|
201
|
+
aggs: aggs,
|
|
202
|
+
size: typeof size === 'undefined' ? 100 : size
|
|
203
|
+
});
|
|
204
|
+
} // sort, highlight, size, from - query should be applied on the main component
|
|
173
205
|
|
|
174
|
-
if (isResultComponent) {
|
|
175
|
-
var currentPage = component.currentPage ? component.currentPage - 1 : 0;
|
|
176
206
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
207
|
+
if (otherQueryOptions && Object.keys(otherQueryOptions).length || highlightQuery && Object.keys(highlightQuery).length) {
|
|
208
|
+
if (!otherQueryOptions) otherQueryOptions = {};
|
|
209
|
+
if (!highlightQuery) highlightQuery = {};
|
|
180
210
|
|
|
181
|
-
|
|
182
|
-
|
|
211
|
+
var mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery, {
|
|
212
|
+
size: size
|
|
213
|
+
});
|
|
183
214
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
215
|
+
if (isInternalComponentPresent) {
|
|
216
|
+
mainQueryOptions = _extends({}, otherQueryOptions, highlightQuery);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (isResultComponent) {
|
|
220
|
+
var currentPage = component.currentPage ? component.currentPage - 1 : 0;
|
|
221
|
+
|
|
222
|
+
if (selectedValues[component.componentId] && selectedValues[component.componentId].value) {
|
|
223
|
+
currentPage = selectedValues[component.componentId].value - 1 || 0;
|
|
189
224
|
}
|
|
190
225
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
226
|
+
var resultSize = component.size || 10;
|
|
227
|
+
var from = currentPage * resultSize; // Update props for RS API
|
|
228
|
+
|
|
229
|
+
compProps.from = from;
|
|
230
|
+
mainQueryOptions = _extends({}, mainQueryOptions, highlightQuery, {
|
|
231
|
+
size: resultSize,
|
|
232
|
+
from: from
|
|
195
233
|
});
|
|
196
234
|
}
|
|
235
|
+
|
|
236
|
+
componentQueryOptions = _extends({}, componentQueryOptions, mainQueryOptions);
|
|
197
237
|
}
|
|
198
238
|
} // [3] set dependency tree
|
|
199
239
|
|
|
@@ -211,25 +251,42 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
211
251
|
react: react
|
|
212
252
|
});
|
|
213
253
|
} // [4] set query list
|
|
254
|
+
// Do not set default query for suggestions
|
|
214
255
|
|
|
215
256
|
|
|
216
|
-
if (
|
|
217
|
-
var
|
|
218
|
-
|
|
257
|
+
if (isInternalComponentPresent && !isSearchComponent(component.componentType)) {
|
|
258
|
+
var _ref2 = getDefaultQuery(component, value) || {},
|
|
259
|
+
defaultQuery = _ref2.query,
|
|
260
|
+
defaultQueryOptions = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
219
261
|
|
|
220
262
|
queryList = queryReducer(queryList, {
|
|
221
263
|
type: 'SET_QUERY',
|
|
222
264
|
component: internalComponent,
|
|
223
|
-
query:
|
|
265
|
+
query: defaultQuery
|
|
224
266
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
query: getQuery(component, value, componentType)
|
|
267
|
+
queryOptions = queryOptionsReducer(queryOptions, {
|
|
268
|
+
type: 'SET_QUERY_OPTIONS',
|
|
269
|
+
component: internalComponent,
|
|
270
|
+
options: _extends({}, componentQueryOptions, defaultQueryOptions)
|
|
230
271
|
});
|
|
231
|
-
}
|
|
272
|
+
}
|
|
232
273
|
|
|
274
|
+
var _ref3 = getCustomQuery(component, value) || {},
|
|
275
|
+
query = _ref3.query,
|
|
276
|
+
options = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
277
|
+
|
|
278
|
+
var customQuery = query; // set custom query for main component
|
|
279
|
+
|
|
280
|
+
queryList = queryReducer(queryList, {
|
|
281
|
+
type: 'SET_QUERY',
|
|
282
|
+
component: component.componentId,
|
|
283
|
+
query: customQuery
|
|
284
|
+
});
|
|
285
|
+
queryOptions = queryOptionsReducer(queryOptions, {
|
|
286
|
+
type: 'SET_QUERY_OPTIONS',
|
|
287
|
+
component: component.componentId,
|
|
288
|
+
options: _extends({}, componentQueryOptions, options)
|
|
289
|
+
}); // Set component type in component props
|
|
233
290
|
|
|
234
291
|
compProps.componentType = componentType;
|
|
235
292
|
componentProps[component.componentId] = compProps;
|
|
@@ -252,9 +309,22 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
252
309
|
queryObj = _buildQuery.queryObj,
|
|
253
310
|
options = _buildQuery.options;
|
|
254
311
|
|
|
255
|
-
var
|
|
312
|
+
var componentQueryOptions = options;
|
|
313
|
+
var componentType = component.source.componentType;
|
|
314
|
+
|
|
315
|
+
if (componentType !== componentTypes.reactiveComponent) {
|
|
316
|
+
// don't merge aggs, size
|
|
317
|
+
var _ref4 = options || {},
|
|
318
|
+
aggs = _ref4.aggs,
|
|
319
|
+
size = _ref4.size,
|
|
320
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
256
321
|
|
|
257
|
-
|
|
322
|
+
componentQueryOptions = rest;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
var validOptions = ['aggs', 'from', 'sort']; // check if query or componentQueryOptions are valid - non-empty
|
|
326
|
+
|
|
327
|
+
if (queryObj && !!Object.keys(queryObj).length || componentQueryOptions && Object.keys(componentQueryOptions).some(function (item) {
|
|
258
328
|
return validOptions.includes(item);
|
|
259
329
|
})) {
|
|
260
330
|
var _extends2;
|
|
@@ -267,11 +337,11 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
267
337
|
|
|
268
338
|
orderOfQueries = [].concat(orderOfQueries, [component.componentId]);
|
|
269
339
|
|
|
270
|
-
var currentQuery = _extends(
|
|
340
|
+
var currentQuery = _extends({
|
|
271
341
|
query: _extends({}, queryObj)
|
|
272
|
-
},
|
|
342
|
+
}, componentQueryOptions, queryOptions[component.componentId]);
|
|
273
343
|
|
|
274
|
-
queryLog = _extends(
|
|
344
|
+
queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
|
|
275
345
|
|
|
276
346
|
if (settings.enableAppbase) {
|
|
277
347
|
var query = getRSQuery(component.componentId, extractPropsFromState(state, component.componentId, queryOptions && queryOptions[component.componentId] ? {
|
|
@@ -282,11 +352,12 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
282
352
|
var _extends3;
|
|
283
353
|
|
|
284
354
|
// Apply dependent queries
|
|
285
|
-
appbaseQuery = _extends(
|
|
355
|
+
appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), getDependentQueries(state, component.componentId, orderOfQueries));
|
|
286
356
|
}
|
|
287
357
|
} else {
|
|
358
|
+
var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
|
|
288
359
|
finalQuery = [].concat(finalQuery, [{
|
|
289
|
-
preference:
|
|
360
|
+
preference: preference
|
|
290
361
|
}, currentQuery]);
|
|
291
362
|
}
|
|
292
363
|
}
|
|
@@ -312,10 +383,15 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
312
383
|
if (response.aggregations) {
|
|
313
384
|
var _extends4;
|
|
314
385
|
|
|
315
|
-
aggregations = _extends(
|
|
386
|
+
aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
|
|
387
|
+
compositeAggregations = compositeAggsReducer(compositeAggregations, {
|
|
388
|
+
type: UPDATE_COMPOSITE_AGGS,
|
|
389
|
+
aggregations: response.aggregations,
|
|
390
|
+
append: false
|
|
391
|
+
});
|
|
316
392
|
}
|
|
317
393
|
|
|
318
|
-
hits = _extends(
|
|
394
|
+
hits = _extends({}, hits, (_extends5 = {}, _extends5[component] = {
|
|
319
395
|
hits: response.hits.hits,
|
|
320
396
|
total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
|
|
321
397
|
time: response.took
|
|
@@ -327,7 +403,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
327
403
|
});
|
|
328
404
|
});
|
|
329
405
|
Promise.all(allPromises).then(function () {
|
|
330
|
-
state = _extends(
|
|
406
|
+
state = _extends({}, state, {
|
|
331
407
|
hits: hits,
|
|
332
408
|
aggregations: aggregations
|
|
333
409
|
});
|
|
@@ -339,6 +415,8 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
339
415
|
var promotedResults = {};
|
|
340
416
|
var rawData = {};
|
|
341
417
|
var customData = {};
|
|
418
|
+
var settingsResponse = {};
|
|
419
|
+
var timestamp = {};
|
|
342
420
|
var allPromises = orderOfQueries.map(function (component) {
|
|
343
421
|
return new Promise(function (responseResolve, responseReject) {
|
|
344
422
|
handleTransformResponse(res[component], component).then(function (response) {
|
|
@@ -347,7 +425,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
347
425
|
|
|
348
426
|
if (response.promoted) {
|
|
349
427
|
promotedResults[component] = response.promoted.map(function (promoted) {
|
|
350
|
-
return _extends(
|
|
428
|
+
return _extends({}, promoted.doc, {
|
|
351
429
|
_position: promoted.position
|
|
352
430
|
});
|
|
353
431
|
});
|
|
@@ -357,15 +435,21 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
357
435
|
|
|
358
436
|
if (response.customData) {
|
|
359
437
|
customData[component] = response.customData;
|
|
438
|
+
} // Update settings
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
if (response.settings) {
|
|
442
|
+
settingsResponse[component] = response.settings;
|
|
360
443
|
}
|
|
361
444
|
|
|
362
445
|
if (response.aggregations) {
|
|
363
446
|
var _extends6;
|
|
364
447
|
|
|
365
|
-
aggregations = _extends(
|
|
448
|
+
aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
|
|
366
449
|
}
|
|
367
450
|
|
|
368
|
-
|
|
451
|
+
timestamp[component] = res._timestamp;
|
|
452
|
+
hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
|
|
369
453
|
hits: response.hits.hits,
|
|
370
454
|
total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
|
|
371
455
|
time: response.took
|
|
@@ -378,10 +462,13 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
378
462
|
});
|
|
379
463
|
});
|
|
380
464
|
Promise.all(allPromises).then(function () {
|
|
381
|
-
state = _extends(
|
|
465
|
+
state = _extends({}, state, {
|
|
382
466
|
hits: hits,
|
|
467
|
+
timestamp: timestamp,
|
|
383
468
|
aggregations: aggregations,
|
|
469
|
+
compositeAggregations: compositeAggregations,
|
|
384
470
|
promotedResults: promotedResults,
|
|
471
|
+
settings: settingsResponse,
|
|
385
472
|
customData: customData,
|
|
386
473
|
rawData: rawData
|
|
387
474
|
});
|
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';
|