@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
|
@@ -6,15 +6,16 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
6
6
|
|
|
7
7
|
var configureStore = require('@appbaseio/reactivecore');
|
|
8
8
|
var configureStore__default = _interopDefault(configureStore);
|
|
9
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
9
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
|
|
10
10
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
11
11
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
12
|
-
var vueTypes = require('./vueTypes-
|
|
12
|
+
var vueTypes = require('./vueTypes-6de9d2a9.js');
|
|
13
13
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
14
14
|
require('redux');
|
|
15
|
-
var index = require('./index-
|
|
16
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
15
|
+
var index = require('./index-6a167fe0.js');
|
|
16
|
+
var ComponentWrapper = require('./ComponentWrapper-ad3dad02.js');
|
|
17
17
|
|
|
18
|
+
var _excluded = ["options"];
|
|
18
19
|
var updateQuery = configureStore.Actions.updateQuery,
|
|
19
20
|
setQueryOptions = configureStore.Actions.setQueryOptions,
|
|
20
21
|
setCustomQuery = configureStore.Actions.setCustomQuery,
|
|
@@ -22,15 +23,16 @@ var updateQuery = configureStore.Actions.updateQuery,
|
|
|
22
23
|
var parseHits = configureStore.helper.parseHits,
|
|
23
24
|
isEqual = configureStore.helper.isEqual,
|
|
24
25
|
getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
getResultStats = configureStore.helper.getResultStats,
|
|
27
|
+
extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
|
|
28
|
+
getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
|
|
27
29
|
var ReactiveComponent = {
|
|
28
30
|
name: 'ReactiveComponent',
|
|
29
31
|
props: {
|
|
30
32
|
componentId: vueTypes.types.stringRequired,
|
|
31
33
|
aggregationField: vueTypes.types.string,
|
|
32
34
|
aggregationSize: VueTypes.number,
|
|
33
|
-
size: VueTypes.number
|
|
35
|
+
size: VueTypes.number,
|
|
34
36
|
defaultQuery: vueTypes.types.func,
|
|
35
37
|
customQuery: vueTypes.types.func,
|
|
36
38
|
filterLabel: vueTypes.types.string,
|
|
@@ -38,7 +40,8 @@ var ReactiveComponent = {
|
|
|
38
40
|
showFilter: VueTypes.bool.def(true),
|
|
39
41
|
URLParams: VueTypes.bool.def(false),
|
|
40
42
|
distinctField: vueTypes.types.string,
|
|
41
|
-
distinctFieldConfig: vueTypes.types.props
|
|
43
|
+
distinctFieldConfig: vueTypes.types.props,
|
|
44
|
+
index: VueTypes.string
|
|
42
45
|
},
|
|
43
46
|
created: function created() {
|
|
44
47
|
var _this = this;
|
|
@@ -47,33 +50,35 @@ var ReactiveComponent = {
|
|
|
47
50
|
this.internalComponent = null;
|
|
48
51
|
this.$defaultQuery = null; // Set custom query in store
|
|
49
52
|
|
|
50
|
-
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
53
|
+
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
51
54
|
var customQuery = props.customQuery,
|
|
52
55
|
componentId = props.componentId,
|
|
53
56
|
filterLabel = props.filterLabel,
|
|
54
57
|
showFilter = props.showFilter,
|
|
55
58
|
URLParams = props.URLParams,
|
|
56
59
|
distinctField = props.distinctField,
|
|
57
|
-
distinctFieldConfig = props.distinctFieldConfig
|
|
60
|
+
distinctFieldConfig = props.distinctFieldConfig,
|
|
61
|
+
index$1 = props.index;
|
|
58
62
|
|
|
59
|
-
if (this.
|
|
63
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
60
64
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
if (!this.
|
|
67
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
64
68
|
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var _ref = calcCustomQuery || {},
|
|
71
|
-
query = _ref.query;
|
|
71
|
+
if (!this.enableAppbase && index$1) {
|
|
72
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
73
|
+
}
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
if (customQuery) {
|
|
76
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
77
|
+
var query = extractQueryFromCustomQuery(calcCustomQuery);
|
|
78
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
|
|
74
79
|
|
|
75
80
|
if (customQueryOptions) {
|
|
76
|
-
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(
|
|
81
|
+
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
77
82
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
78
83
|
|
|
79
84
|
this.updateQuery({
|
|
@@ -86,26 +91,35 @@ var ReactiveComponent = {
|
|
|
86
91
|
});
|
|
87
92
|
}
|
|
88
93
|
|
|
89
|
-
this.setQuery = function (
|
|
90
|
-
var options =
|
|
91
|
-
obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(
|
|
94
|
+
this.setQuery = function (_ref) {
|
|
95
|
+
var options = _ref.options,
|
|
96
|
+
obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
_this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends(_rollupPluginBabelHelpers._extends({}, options), _this.getAggsQuery()), false);
|
|
95
|
-
} // Update customQuery field for RS API
|
|
98
|
+
var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
96
99
|
|
|
100
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
101
|
+
queryToBeSet = queryToBeSet.query;
|
|
102
|
+
}
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
|
|
105
|
+
query: queryToBeSet
|
|
106
|
+
});
|
|
100
107
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
var rsAPIQuery = customQueryCalc; // handle stored queries
|
|
109
|
+
|
|
110
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
111
|
+
rsAPIQuery = queryToBeSet;
|
|
112
|
+
} // Update customQuery field for RS API
|
|
104
113
|
|
|
105
|
-
|
|
114
|
+
|
|
115
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
116
|
+
|
|
117
|
+
if (options) {
|
|
118
|
+
_this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
|
|
106
119
|
}
|
|
107
120
|
|
|
108
|
-
_this.updateQuery(_rollupPluginBabelHelpers._extends(
|
|
121
|
+
_this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
|
|
122
|
+
query: customQueryCalc.query,
|
|
109
123
|
componentId: props.componentId,
|
|
110
124
|
label: props.filterLabel,
|
|
111
125
|
showFilter: props.showFilter,
|
|
@@ -116,23 +130,22 @@ var ReactiveComponent = {
|
|
|
116
130
|
if (props.defaultQuery) {
|
|
117
131
|
this.internalComponent = props.componentId + "__internal";
|
|
118
132
|
}
|
|
119
|
-
|
|
120
|
-
beforeMount: function beforeMount() {
|
|
133
|
+
|
|
121
134
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
122
|
-
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
123
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
135
|
+
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
136
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
124
137
|
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
var _query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
139
|
+
|
|
140
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
128
141
|
|
|
129
142
|
if (queryOptions) {
|
|
130
|
-
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(
|
|
143
|
+
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
131
144
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
132
145
|
|
|
133
146
|
this.updateQuery({
|
|
134
147
|
componentId: this.internalComponent,
|
|
135
|
-
query:
|
|
148
|
+
query: _query
|
|
136
149
|
});
|
|
137
150
|
}
|
|
138
151
|
},
|
|
@@ -178,43 +191,39 @@ var ReactiveComponent = {
|
|
|
178
191
|
}
|
|
179
192
|
},
|
|
180
193
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
181
|
-
if (newVal && !index.isQueryIdentical(newVal, oldVal,
|
|
182
|
-
this.$defaultQuery = newVal();
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
query = _ref4.query,
|
|
186
|
-
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref4, ["query"]);
|
|
194
|
+
if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
195
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
196
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
197
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
187
198
|
|
|
188
199
|
if (queryOptions) {
|
|
189
|
-
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(
|
|
200
|
+
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
190
201
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
191
202
|
|
|
192
203
|
|
|
193
|
-
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
204
|
+
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
194
205
|
this.updateQuery({
|
|
195
206
|
componentId: this.internalComponent,
|
|
196
|
-
query: query
|
|
207
|
+
query: query
|
|
197
208
|
});
|
|
198
209
|
}
|
|
199
210
|
},
|
|
200
211
|
customQuery: function customQuery(newVal, oldVal) {
|
|
201
|
-
if (newVal && !index.isQueryIdentical(newVal, oldVal,
|
|
212
|
+
if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
202
213
|
var componentId = this.$props.componentId;
|
|
203
|
-
this.$customQuery = newVal(this.$props);
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
query = _ref5.query,
|
|
207
|
-
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref5, ["query"]);
|
|
214
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
215
|
+
var query = extractQueryFromCustomQuery(this.$customQuery);
|
|
216
|
+
var queryOptions = getOptionsForCustomQuery(this.$customQuery);
|
|
208
217
|
|
|
209
218
|
if (queryOptions) {
|
|
210
|
-
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(
|
|
219
|
+
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
211
220
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
212
221
|
|
|
213
222
|
|
|
214
|
-
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
223
|
+
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
215
224
|
this.updateQuery({
|
|
216
225
|
componentId: componentId,
|
|
217
|
-
query: query
|
|
226
|
+
query: query
|
|
218
227
|
});
|
|
219
228
|
}
|
|
220
229
|
}
|
|
@@ -228,10 +237,10 @@ var ReactiveComponent = {
|
|
|
228
237
|
isLoading = this.isLoading,
|
|
229
238
|
selectedValue = this.selectedValue;
|
|
230
239
|
|
|
231
|
-
var propsToBePassed = _rollupPluginBabelHelpers._extends(
|
|
240
|
+
var propsToBePassed = _rollupPluginBabelHelpers._extends({
|
|
232
241
|
error: error,
|
|
233
242
|
loading: isLoading
|
|
234
|
-
}, this.getData()
|
|
243
|
+
}, this.getData(), {
|
|
235
244
|
value: selectedValue,
|
|
236
245
|
setQuery: this.setQuery
|
|
237
246
|
});
|
|
@@ -294,6 +303,10 @@ var ReactiveComponent = {
|
|
|
294
303
|
}
|
|
295
304
|
};
|
|
296
305
|
|
|
306
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
307
|
+
return !!props.defaultQuery;
|
|
308
|
+
};
|
|
309
|
+
|
|
297
310
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
298
311
|
return {
|
|
299
312
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
@@ -308,7 +321,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
308
321
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
309
322
|
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
310
323
|
componentProps: state.props[props.componentId],
|
|
311
|
-
|
|
324
|
+
enableAppbase: state.config.enableAppbase
|
|
312
325
|
};
|
|
313
326
|
};
|
|
314
327
|
|