@appbaseio/reactivesearch-vue 1.16.0-alpha.6 → 1.16.0-alpha.62
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 +16030 -13113
- 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-446f819e.js +68 -0
- package/dist/cjs/{DownShift-966a58cb.js → CancelSvg-9f258f4f.js} +60 -16
- package/dist/cjs/Card-642547a8.js +30 -0
- package/dist/cjs/{ComponentWrapper-603848ed.js → ComponentWrapper-ad3dad02.js} +40 -21
- package/dist/cjs/{Container-6cdd3864.js → Container-daf30918.js} +3 -11
- package/dist/cjs/DataSearch-86914b10.js +2322 -0
- package/dist/cjs/DataSearch.js +18 -2151
- package/dist/cjs/{DropDown-f6224ac8.js → DropDown-5513ea77.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +107 -43
- package/dist/cjs/Flex-aa517a13.js +52 -0
- package/dist/cjs/FormControlList-c195a592.js +47 -0
- package/dist/cjs/Input-e6603a7e.js +79 -0
- package/dist/cjs/ListItem-8c9e0d68.js +46 -0
- package/dist/cjs/MultiDropdownList.js +102 -68
- package/dist/cjs/MultiList.js +80 -50
- package/dist/cjs/MultiRange.js +21 -16
- package/dist/cjs/{Pagination-af399262.js → Pagination-fe5452fc.js} +14 -8
- package/dist/cjs/RangeInput.js +29 -45
- package/dist/cjs/RangeSlider.js +32 -30
- package/dist/cjs/ReactiveBase.js +87 -56
- package/dist/cjs/ReactiveComponent.js +75 -62
- package/dist/cjs/ReactiveGoogleMap.js +262 -191
- package/dist/cjs/ReactiveList.js +189 -241
- package/dist/cjs/ResultCard.js +8 -6
- package/dist/cjs/ResultList.js +8 -6
- package/dist/cjs/SelectedFilters.js +66 -34
- package/dist/cjs/SingleDropdownList.js +88 -60
- package/dist/cjs/SingleList.js +53 -35
- package/dist/cjs/SingleRange.js +19 -14
- package/dist/cjs/StateProvider.js +39 -10
- package/dist/cjs/{Title-65d39104.js → Title-1de7d0f4.js} +3 -11
- package/dist/cjs/ToggleButton.js +36 -16
- package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
- package/dist/cjs/{index-baca18c4.js → index-6a167fe0.js} +99 -13
- package/dist/cjs/index.js +31 -25
- package/dist/cjs/initReactivesearch.js +178 -104
- package/dist/cjs/install-004c6aa4.js +1408 -0
- package/dist/cjs/install.js +42 -44
- package/dist/cjs/ssr-3027b848.js +39 -0
- package/dist/cjs/{utils-ea846a20.js → utils-d6a52588.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-d8bc15ea.js +59 -0
- package/dist/es/{DownShift-92347b5e.js → CancelSvg-4cfae5fd.js} +56 -17
- package/dist/es/Card-450683f1.js +23 -0
- package/dist/es/{ComponentWrapper-c4c91949.js → ComponentWrapper-424e86fd.js} +40 -21
- package/dist/es/Container-ba826e96.js +10 -0
- package/dist/es/DataSearch-e71a1014.js +2307 -0
- package/dist/es/DataSearch.js +17 -2150
- package/dist/es/{DropDown-3d4291f1.js → DropDown-7d9a15c1.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +107 -43
- package/dist/es/Flex-1f0795c3.js +47 -0
- package/dist/es/FormControlList-c22d64f6.js +40 -0
- package/dist/es/Input-7a2a9fac.js +71 -0
- package/dist/es/ListItem-cad14c5e.js +39 -0
- package/dist/es/MultiDropdownList.js +102 -68
- package/dist/es/MultiList.js +80 -50
- package/dist/es/MultiRange.js +21 -16
- package/dist/es/{Pagination-c2a00175.js → Pagination-3f350098.js} +14 -8
- package/dist/es/RangeInput.js +29 -45
- package/dist/es/RangeSlider.js +32 -30
- package/dist/es/ReactiveBase.js +87 -56
- package/dist/es/ReactiveComponent.js +75 -62
- package/dist/es/ReactiveGoogleMap.js +262 -191
- package/dist/es/ReactiveList.js +189 -241
- package/dist/es/ResultCard.js +8 -6
- package/dist/es/ResultList.js +8 -6
- package/dist/es/SelectedFilters.js +66 -34
- package/dist/es/SingleDropdownList.js +88 -60
- package/dist/es/SingleList.js +53 -35
- package/dist/es/SingleRange.js +19 -14
- package/dist/es/StateProvider.js +39 -10
- package/dist/es/Title-3342664a.js +10 -0
- package/dist/es/ToggleButton.js +36 -16
- package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
- package/dist/es/{index-185b6266.js → index-7788a843.js} +95 -14
- package/dist/es/index.js +27 -22
- package/dist/es/initReactivesearch.js +179 -105
- package/dist/es/install-b7b604cc.js +1401 -0
- package/dist/es/install.js +40 -46
- package/dist/es/ssr-b2c0b401.js +33 -0
- package/dist/es/{utils-57cc8789.js → utils-9e68acee.js} +2 -2
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
- package/package.json +6 -4
- package/dist/cjs/Button-d48d4365.js +0 -146
- package/dist/cjs/Card-9748fbb2.js +0 -58
- package/dist/cjs/Flex-befd65fc.js +0 -160
- package/dist/cjs/FormControlList-f3857d4b.js +0 -105
- package/dist/cjs/Input-95cb19f8.js +0 -178
- package/dist/cjs/ListItem-84d185cf.js +0 -84
- package/dist/cjs/ssr-3ca8a14f.js +0 -47
- package/dist/es/Button-27cc8574.js +0 -137
- package/dist/es/Card-1f93780d.js +0 -51
- package/dist/es/Container-88c805ef.js +0 -18
- package/dist/es/Flex-16d1103a.js +0 -155
- package/dist/es/FormControlList-96d44e7b.js +0 -98
- package/dist/es/Input-1159c4b5.js +0 -170
- package/dist/es/ListItem-d22510c9.js +0 -77
- package/dist/es/Title-f0217338.js +0 -18
- package/dist/es/ssr-a710392b.js +0 -41
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
-
import { t as types } from './vueTypes-
|
|
5
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
6
6
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
7
7
|
import 'redux';
|
|
8
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-
|
|
9
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
8
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
|
|
9
|
+
import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
|
|
10
10
|
|
|
11
|
+
var _excluded = ["options"];
|
|
11
12
|
var updateQuery = Actions.updateQuery,
|
|
12
13
|
setQueryOptions = Actions.setQueryOptions,
|
|
13
14
|
setCustomQuery = Actions.setCustomQuery,
|
|
@@ -15,15 +16,16 @@ var updateQuery = Actions.updateQuery,
|
|
|
15
16
|
var parseHits = helper.parseHits,
|
|
16
17
|
isEqual = helper.isEqual,
|
|
17
18
|
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
getResultStats = helper.getResultStats,
|
|
20
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
21
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
20
22
|
var ReactiveComponent = {
|
|
21
23
|
name: 'ReactiveComponent',
|
|
22
24
|
props: {
|
|
23
25
|
componentId: types.stringRequired,
|
|
24
26
|
aggregationField: types.string,
|
|
25
27
|
aggregationSize: VueTypes.number,
|
|
26
|
-
size: VueTypes.number
|
|
28
|
+
size: VueTypes.number,
|
|
27
29
|
defaultQuery: types.func,
|
|
28
30
|
customQuery: types.func,
|
|
29
31
|
filterLabel: types.string,
|
|
@@ -31,7 +33,8 @@ var ReactiveComponent = {
|
|
|
31
33
|
showFilter: VueTypes.bool.def(true),
|
|
32
34
|
URLParams: VueTypes.bool.def(false),
|
|
33
35
|
distinctField: types.string,
|
|
34
|
-
distinctFieldConfig: types.props
|
|
36
|
+
distinctFieldConfig: types.props,
|
|
37
|
+
index: VueTypes.string
|
|
35
38
|
},
|
|
36
39
|
created: function created() {
|
|
37
40
|
var _this = this;
|
|
@@ -40,33 +43,35 @@ var ReactiveComponent = {
|
|
|
40
43
|
this.internalComponent = null;
|
|
41
44
|
this.$defaultQuery = null; // Set custom query in store
|
|
42
45
|
|
|
43
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
46
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
44
47
|
var customQuery = props.customQuery,
|
|
45
48
|
componentId = props.componentId,
|
|
46
49
|
filterLabel = props.filterLabel,
|
|
47
50
|
showFilter = props.showFilter,
|
|
48
51
|
URLParams = props.URLParams,
|
|
49
52
|
distinctField = props.distinctField,
|
|
50
|
-
distinctFieldConfig = props.distinctFieldConfig
|
|
53
|
+
distinctFieldConfig = props.distinctFieldConfig,
|
|
54
|
+
index = props.index;
|
|
51
55
|
|
|
52
|
-
if (this.
|
|
56
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
53
57
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
if (!this.
|
|
60
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
57
61
|
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
58
62
|
}
|
|
59
63
|
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var _ref = calcCustomQuery || {},
|
|
64
|
-
query = _ref.query;
|
|
64
|
+
if (!this.enableAppbase && index) {
|
|
65
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
66
|
+
}
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
if (customQuery) {
|
|
69
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
70
|
+
var query = extractQueryFromCustomQuery(calcCustomQuery);
|
|
71
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
|
|
67
72
|
|
|
68
73
|
if (customQueryOptions) {
|
|
69
|
-
this.setQueryOptions(componentId, _extends(
|
|
74
|
+
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
70
75
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
71
76
|
|
|
72
77
|
this.updateQuery({
|
|
@@ -79,26 +84,35 @@ var ReactiveComponent = {
|
|
|
79
84
|
});
|
|
80
85
|
}
|
|
81
86
|
|
|
82
|
-
this.setQuery = function (
|
|
83
|
-
var options =
|
|
84
|
-
obj = _objectWithoutPropertiesLoose(
|
|
87
|
+
this.setQuery = function (_ref) {
|
|
88
|
+
var options = _ref.options,
|
|
89
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
85
90
|
|
|
86
|
-
|
|
87
|
-
_this.setQueryOptions(props.componentId, _extends(_extends({}, options), _this.getAggsQuery()), false);
|
|
88
|
-
} // Update customQuery field for RS API
|
|
91
|
+
var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
89
92
|
|
|
93
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
94
|
+
queryToBeSet = queryToBeSet.query;
|
|
95
|
+
}
|
|
90
96
|
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
var customQueryCalc = _extends({}, options, {
|
|
98
|
+
query: queryToBeSet
|
|
99
|
+
});
|
|
93
100
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
var rsAPIQuery = customQueryCalc; // handle stored queries
|
|
102
|
+
|
|
103
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
104
|
+
rsAPIQuery = queryToBeSet;
|
|
105
|
+
} // Update customQuery field for RS API
|
|
97
106
|
|
|
98
|
-
|
|
107
|
+
|
|
108
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
109
|
+
|
|
110
|
+
if (options) {
|
|
111
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
99
112
|
}
|
|
100
113
|
|
|
101
|
-
_this.updateQuery(_extends(
|
|
114
|
+
_this.updateQuery(_extends({}, obj, {
|
|
115
|
+
query: customQueryCalc.query,
|
|
102
116
|
componentId: props.componentId,
|
|
103
117
|
label: props.filterLabel,
|
|
104
118
|
showFilter: props.showFilter,
|
|
@@ -109,23 +123,22 @@ var ReactiveComponent = {
|
|
|
109
123
|
if (props.defaultQuery) {
|
|
110
124
|
this.internalComponent = props.componentId + "__internal";
|
|
111
125
|
}
|
|
112
|
-
|
|
113
|
-
beforeMount: function beforeMount() {
|
|
126
|
+
|
|
114
127
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
115
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
116
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
128
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
129
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
117
130
|
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
var _query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
132
|
+
|
|
133
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
121
134
|
|
|
122
135
|
if (queryOptions) {
|
|
123
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
136
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
124
137
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
125
138
|
|
|
126
139
|
this.updateQuery({
|
|
127
140
|
componentId: this.internalComponent,
|
|
128
|
-
query:
|
|
141
|
+
query: _query
|
|
129
142
|
});
|
|
130
143
|
}
|
|
131
144
|
},
|
|
@@ -171,43 +184,39 @@ var ReactiveComponent = {
|
|
|
171
184
|
}
|
|
172
185
|
},
|
|
173
186
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
174
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
175
|
-
this.$defaultQuery = newVal();
|
|
176
|
-
|
|
177
|
-
var
|
|
178
|
-
query = _ref4.query,
|
|
179
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref4, ["query"]);
|
|
187
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
188
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
189
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
190
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
180
191
|
|
|
181
192
|
if (queryOptions) {
|
|
182
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
193
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
183
194
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
184
195
|
|
|
185
196
|
|
|
186
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
197
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
187
198
|
this.updateQuery({
|
|
188
199
|
componentId: this.internalComponent,
|
|
189
|
-
query: query
|
|
200
|
+
query: query
|
|
190
201
|
});
|
|
191
202
|
}
|
|
192
203
|
},
|
|
193
204
|
customQuery: function customQuery(newVal, oldVal) {
|
|
194
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
205
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
195
206
|
var componentId = this.$props.componentId;
|
|
196
|
-
this.$customQuery = newVal(this.$props);
|
|
197
|
-
|
|
198
|
-
var
|
|
199
|
-
query = _ref5.query,
|
|
200
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref5, ["query"]);
|
|
207
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
208
|
+
var query = extractQueryFromCustomQuery(this.$customQuery);
|
|
209
|
+
var queryOptions = getOptionsForCustomQuery(this.$customQuery);
|
|
201
210
|
|
|
202
211
|
if (queryOptions) {
|
|
203
|
-
this.setQueryOptions(componentId, _extends(
|
|
212
|
+
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
204
213
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
205
214
|
|
|
206
215
|
|
|
207
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
216
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
208
217
|
this.updateQuery({
|
|
209
218
|
componentId: componentId,
|
|
210
|
-
query: query
|
|
219
|
+
query: query
|
|
211
220
|
});
|
|
212
221
|
}
|
|
213
222
|
}
|
|
@@ -221,10 +230,10 @@ var ReactiveComponent = {
|
|
|
221
230
|
isLoading = this.isLoading,
|
|
222
231
|
selectedValue = this.selectedValue;
|
|
223
232
|
|
|
224
|
-
var propsToBePassed = _extends(
|
|
233
|
+
var propsToBePassed = _extends({
|
|
225
234
|
error: error,
|
|
226
235
|
loading: isLoading
|
|
227
|
-
}, this.getData()
|
|
236
|
+
}, this.getData(), {
|
|
228
237
|
value: selectedValue,
|
|
229
238
|
setQuery: this.setQuery
|
|
230
239
|
});
|
|
@@ -287,6 +296,10 @@ var ReactiveComponent = {
|
|
|
287
296
|
}
|
|
288
297
|
};
|
|
289
298
|
|
|
299
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
300
|
+
return !!props.defaultQuery;
|
|
301
|
+
};
|
|
302
|
+
|
|
290
303
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
291
304
|
return {
|
|
292
305
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
@@ -301,7 +314,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
301
314
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
302
315
|
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
303
316
|
componentProps: state.props[props.componentId],
|
|
304
|
-
|
|
317
|
+
enableAppbase: state.config.enableAppbase
|
|
305
318
|
};
|
|
306
319
|
};
|
|
307
320
|
|