@appbaseio/reactivesearch-vue 1.16.0-alpha.3 → 1.16.0-alpha.30
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 +7438 -6512
- 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-ab813390.js} +40 -21
- package/dist/cjs/{Container-f84e72fc.js → Container-8a08d663.js} +3 -11
- package/dist/cjs/DataSearch.js +341 -391
- package/dist/cjs/{DropDown-c66be1a8.js → DropDown-0359da33.js} +76 -96
- package/dist/cjs/DynamicRangeSlider.js +47 -24
- 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 +69 -45
- package/dist/cjs/MultiList.js +36 -21
- package/dist/cjs/MultiRange.js +20 -14
- package/dist/cjs/{Pagination-91df3b77.js → Pagination-1b2320a7.js} +4 -3
- package/dist/cjs/RangeInput.js +25 -45
- package/dist/cjs/RangeSlider.js +31 -28
- package/dist/cjs/ReactiveBase.js +55 -34
- package/dist/cjs/ReactiveComponent.js +80 -36
- package/dist/cjs/ReactiveGoogleMap.js +320 -234
- package/dist/cjs/ReactiveList.js +149 -202
- 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 +69 -45
- package/dist/cjs/SingleList.js +44 -26
- 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-2a8358cd.js} +77 -9
- package/dist/cjs/index.js +23 -19
- package/dist/cjs/initReactivesearch.js +80 -38
- 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-459505fd.js} +40 -21
- package/dist/es/Container-4383c6f0.js +10 -0
- package/dist/es/DataSearch.js +339 -389
- package/dist/es/{DropDown-5dbd69c2.js → DropDown-168b60f6.js} +75 -95
- package/dist/es/DynamicRangeSlider.js +47 -24
- 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 +69 -45
- package/dist/es/MultiList.js +36 -21
- package/dist/es/MultiRange.js +20 -14
- package/dist/es/{Pagination-800af44f.js → Pagination-b3e4054a.js} +4 -3
- package/dist/es/RangeInput.js +25 -45
- package/dist/es/RangeSlider.js +31 -28
- package/dist/es/ReactiveBase.js +55 -34
- package/dist/es/ReactiveComponent.js +80 -36
- package/dist/es/ReactiveGoogleMap.js +320 -234
- package/dist/es/ReactiveList.js +149 -202
- 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 +69 -45
- package/dist/es/SingleList.js +44 -26
- 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-4755c9a0.js} +74 -10
- package/dist/es/index.js +23 -19
- package/dist/es/initReactivesearch.js +80 -38
- 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 +86 -78
- 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/cjs/RangeSlider.js
CHANGED
|
@@ -6,19 +6,19 @@ 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-4abdbfff.js');
|
|
10
10
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
11
11
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
12
12
|
require('@appbaseio/vue-emotion');
|
|
13
|
-
var vueTypes = require('./vueTypes-
|
|
13
|
+
var vueTypes = require('./vueTypes-6de9d2a9.js');
|
|
14
14
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
15
15
|
require('redux');
|
|
16
|
-
var index = require('./index-
|
|
17
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
18
|
-
var Title = require('./Title-
|
|
19
|
-
var Container = require('./Container-
|
|
16
|
+
var index = require('./index-2a8358cd.js');
|
|
17
|
+
var ComponentWrapper = require('./ComponentWrapper-ab813390.js');
|
|
18
|
+
var Title = require('./Title-39765ee6.js');
|
|
19
|
+
var Container = require('./Container-8a08d663.js');
|
|
20
20
|
var NoSSR = _interopDefault(require('vue-no-ssr'));
|
|
21
|
-
var ssr = require('./ssr-
|
|
21
|
+
var ssr = require('./ssr-c333c82c.js');
|
|
22
22
|
|
|
23
23
|
var updateQuery = configureStore.Actions.updateQuery,
|
|
24
24
|
setQueryOptions = configureStore.Actions.setQueryOptions,
|
|
@@ -64,7 +64,8 @@ var RangeSlider = {
|
|
|
64
64
|
title: vueTypes.types.title,
|
|
65
65
|
URLParams: VueTypes.bool.def(false),
|
|
66
66
|
sliderOptions: VueTypes.object.def({}),
|
|
67
|
-
nestedField: vueTypes.types.string
|
|
67
|
+
nestedField: vueTypes.types.string,
|
|
68
|
+
index: VueTypes.string
|
|
68
69
|
},
|
|
69
70
|
methods: {
|
|
70
71
|
handleSliderChange: function handleSliderChange(values) {
|
|
@@ -79,32 +80,28 @@ var RangeSlider = {
|
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
|
-
handleSlider: function handleSlider(
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
clearTimeout(this.handleSliderChange._tId);
|
|
86
|
-
this.handleSliderChange._tId = setTimeout(function () {
|
|
87
|
-
_this.handleSliderChange(values);
|
|
88
|
-
}, 100);
|
|
83
|
+
handleSlider: function handleSlider() {
|
|
84
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
85
|
+
this.handleSliderChange(sliderValues);
|
|
89
86
|
},
|
|
90
87
|
handleChange: function handleChange(currentValue, props) {
|
|
91
|
-
var
|
|
88
|
+
var _this = this;
|
|
92
89
|
|
|
93
90
|
if (props === void 0) {
|
|
94
91
|
props = this.$props;
|
|
95
92
|
}
|
|
96
93
|
|
|
97
94
|
var performUpdate = function performUpdate() {
|
|
98
|
-
|
|
95
|
+
_this.currentValue = currentValue;
|
|
99
96
|
|
|
100
|
-
|
|
97
|
+
_this.updateQueryHandler([currentValue[0], currentValue[1]], props);
|
|
101
98
|
|
|
102
|
-
|
|
99
|
+
_this.$emit('valueChange', {
|
|
103
100
|
start: currentValue[0],
|
|
104
101
|
end: currentValue[1]
|
|
105
102
|
});
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
_this.$emit('value-change', {
|
|
108
105
|
start: currentValue[0],
|
|
109
106
|
end: currentValue[1]
|
|
110
107
|
});
|
|
@@ -136,7 +133,7 @@ var RangeSlider = {
|
|
|
136
133
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
137
134
|
|
|
138
135
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
139
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
136
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
140
137
|
this.updateQuery({
|
|
141
138
|
componentId: props.componentId,
|
|
142
139
|
query: query,
|
|
@@ -172,6 +169,10 @@ var RangeSlider = {
|
|
|
172
169
|
created: function created() {
|
|
173
170
|
if (!this.$props.range) {
|
|
174
171
|
console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
175
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
175
176
|
} // Set custom query in store
|
|
176
177
|
|
|
177
178
|
|
|
@@ -211,12 +212,13 @@ var RangeSlider = {
|
|
|
211
212
|
"max": this.$props.range.end,
|
|
212
213
|
"dotSize": 20,
|
|
213
214
|
"height": 4,
|
|
214
|
-
"enable-cross": false
|
|
215
|
+
"enable-cross": false,
|
|
216
|
+
"tooltip": "always"
|
|
217
|
+
},
|
|
218
|
+
"on": {
|
|
219
|
+
"drag-end": this.handleSlider
|
|
215
220
|
},
|
|
216
|
-
"props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
|
|
217
|
-
"on": _rollupPluginBabelHelpers._extends({}, {
|
|
218
|
-
input: this.handleSlider
|
|
219
|
-
})
|
|
221
|
+
"props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
|
|
220
222
|
}), this.$props.rangeLabels && h("div", {
|
|
221
223
|
"class": "label-container"
|
|
222
224
|
}, [h("label", {
|
|
@@ -258,7 +260,7 @@ RangeSlider.defaultQuery = function (values, props) {
|
|
|
258
260
|
|
|
259
261
|
RangeSlider.parseValue = function (value, props) {
|
|
260
262
|
if (value) {
|
|
261
|
-
return [value.start, value.end];
|
|
263
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
262
264
|
}
|
|
263
265
|
|
|
264
266
|
if (props.range) {
|
|
@@ -273,7 +275,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
273
275
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
274
276
|
: [],
|
|
275
277
|
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
276
|
-
componentProps: state.props[props.componentId]
|
|
278
|
+
componentProps: state.props[props.componentId],
|
|
279
|
+
enableAppbase: state.config.enableAppbase
|
|
277
280
|
};
|
|
278
281
|
};
|
|
279
282
|
|
package/dist/cjs/ReactiveBase.js
CHANGED
|
@@ -6,16 +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-4abdbfff.js');
|
|
10
10
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
11
11
|
require('@appbaseio/reactivecore/lib/utils/constants');
|
|
12
|
+
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
12
13
|
var styled = require('@appbaseio/vue-emotion');
|
|
13
14
|
var styled__default = _interopDefault(styled);
|
|
14
|
-
var vueTypes = require('./vueTypes-
|
|
15
|
+
var vueTypes = require('./vueTypes-6de9d2a9.js');
|
|
15
16
|
require('redux');
|
|
16
|
-
var index = require('./index-
|
|
17
|
+
var index = require('./index-2a8358cd.js');
|
|
17
18
|
var _mergeJSXProps = _interopDefault(require('@vue/babel-helper-vue-jsx-merge-props'));
|
|
18
|
-
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
19
19
|
var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
20
20
|
var Appbase = _interopDefault(require('appbase-js'));
|
|
21
21
|
require('url-search-params-polyfill');
|
|
@@ -49,15 +49,7 @@ var Provider = {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-family: ", ";\n\tfont-size: ", ";\n\tcolor: ", ";\n\twidth: 100%;\n\n\tinput,\n\tbutton,\n\ttextarea,\n\tselect {\n\t\tfont-family: ", ";\n\t}\n\n\t*,\n\t*:before,\n\t*:after {\n\t\tbox-sizing: border-box;\n\t}\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject = function _templateObject() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
52
|
+
var _templateObject;
|
|
61
53
|
var Base = {
|
|
62
54
|
functional: true,
|
|
63
55
|
render: function render(h, _ref) {
|
|
@@ -69,7 +61,7 @@ var Base = {
|
|
|
69
61
|
return h(T, _mergeJSXProps([{}, props]), [children]);
|
|
70
62
|
}
|
|
71
63
|
};
|
|
72
|
-
var Base$1 = styled__default(Base)(_templateObject(), function (_ref2) {
|
|
64
|
+
var Base$1 = styled__default(Base)(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-family: ", ";\n\tfont-size: ", ";\n\tcolor: ", ";\n\twidth: 100%;\n\n\tinput,\n\tbutton,\n\ttextarea,\n\tselect {\n\t\tfont-family: ", ";\n\t}\n\n\t*,\n\t*:before,\n\t*:after {\n\t\tbox-sizing: border-box;\n\t}\n"])), function (_ref2) {
|
|
73
65
|
var theme = _ref2.theme;
|
|
74
66
|
return theme.typography.fontFamily;
|
|
75
67
|
}, function (_ref3) {
|
|
@@ -93,7 +85,7 @@ var URLParamsProvider = {
|
|
|
93
85
|
headers: vueTypes.types.headers,
|
|
94
86
|
getSearchParams: vueTypes.types.func,
|
|
95
87
|
setSearchParams: vueTypes.types.func,
|
|
96
|
-
as:
|
|
88
|
+
as: VueTypes.string.def('div')
|
|
97
89
|
},
|
|
98
90
|
mounted: function mounted() {
|
|
99
91
|
var _this = this;
|
|
@@ -241,7 +233,9 @@ var URLParamsProvider = {
|
|
|
241
233
|
return value.map(function (item) {
|
|
242
234
|
return _this3.getValue(item);
|
|
243
235
|
});
|
|
244
|
-
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (value && typeof value === 'object') {
|
|
245
239
|
// TODO: support for NestedList
|
|
246
240
|
if (value.location) return value;
|
|
247
241
|
if (value.category) return value;
|
|
@@ -366,11 +360,11 @@ var ReactiveBase = {
|
|
|
366
360
|
}
|
|
367
361
|
},
|
|
368
362
|
props: {
|
|
369
|
-
app: vueTypes.types.
|
|
363
|
+
app: vueTypes.types.string,
|
|
370
364
|
analytics: VueTypes.bool,
|
|
371
365
|
analyticsConfig: vueTypes.types.analyticsConfig,
|
|
372
366
|
appbaseConfig: vueTypes.types.appbaseConfig,
|
|
373
|
-
enableAppbase:
|
|
367
|
+
enableAppbase: VueTypes.bool.def(false),
|
|
374
368
|
credentials: vueTypes.types.string,
|
|
375
369
|
headers: vueTypes.types.headers,
|
|
376
370
|
queryParams: vueTypes.types.string,
|
|
@@ -379,13 +373,15 @@ var ReactiveBase = {
|
|
|
379
373
|
type: vueTypes.types.string,
|
|
380
374
|
url: vueTypes.types.string,
|
|
381
375
|
mapKey: vueTypes.types.string,
|
|
376
|
+
initialQueriesSyncTime: vueTypes.types.number,
|
|
382
377
|
className: vueTypes.types.string,
|
|
383
378
|
initialState: VueTypes.object.def({}),
|
|
384
379
|
transformRequest: vueTypes.types.func,
|
|
385
380
|
transformResponse: vueTypes.types.func,
|
|
386
381
|
as: VueTypes.string.def('div'),
|
|
387
382
|
getSearchParams: vueTypes.types.func,
|
|
388
|
-
setSearchParams: vueTypes.types.func
|
|
383
|
+
setSearchParams: vueTypes.types.func,
|
|
384
|
+
mongodb: vueTypes.types.mongodb
|
|
389
385
|
},
|
|
390
386
|
provide: function provide() {
|
|
391
387
|
return {
|
|
@@ -425,6 +421,27 @@ var ReactiveBase = {
|
|
|
425
421
|
this.store.dispatch(analytics.updateAnalyticsConfig(newVal));
|
|
426
422
|
}
|
|
427
423
|
}
|
|
424
|
+
},
|
|
425
|
+
mongodb: function mongodb() {
|
|
426
|
+
this.updateState(this.$props);
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
computed: {
|
|
430
|
+
getHeaders: function getHeaders() {
|
|
431
|
+
var _this$$props = this.$props,
|
|
432
|
+
enableAppbase = _this$$props.enableAppbase,
|
|
433
|
+
headers = _this$$props.headers,
|
|
434
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
435
|
+
mongodb = _this$$props.mongodb;
|
|
436
|
+
|
|
437
|
+
var _ref = appbaseConfig || {},
|
|
438
|
+
enableTelemetry = _ref.enableTelemetry;
|
|
439
|
+
|
|
440
|
+
return _rollupPluginBabelHelpers._extends({}, enableAppbase && !mongodb && _rollupPluginBabelHelpers._extends({
|
|
441
|
+
'X-Search-Client': index.X_SEARCH_CLIENT
|
|
442
|
+
}, enableTelemetry === false && {
|
|
443
|
+
'X-Enable-Telemetry': false
|
|
444
|
+
}), headers);
|
|
428
445
|
}
|
|
429
446
|
},
|
|
430
447
|
methods: {
|
|
@@ -435,10 +452,10 @@ var ReactiveBase = {
|
|
|
435
452
|
setStore: function setStore(props) {
|
|
436
453
|
var credentials = props.url && props.url.trim() !== '' && !props.credentials ? null : props.credentials;
|
|
437
454
|
|
|
438
|
-
var appbaseConfig = _rollupPluginBabelHelpers._extends(
|
|
455
|
+
var appbaseConfig = _rollupPluginBabelHelpers._extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
439
456
|
|
|
440
457
|
var config = {
|
|
441
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
458
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
442
459
|
app: props.app,
|
|
443
460
|
credentials: credentials,
|
|
444
461
|
type: props.type ? props.type : '*',
|
|
@@ -446,7 +463,8 @@ var ReactiveBase = {
|
|
|
446
463
|
transformResponse: props.transformResponse,
|
|
447
464
|
enableAppbase: props.enableAppbase,
|
|
448
465
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
449
|
-
analyticsConfig: appbaseConfig
|
|
466
|
+
analyticsConfig: appbaseConfig,
|
|
467
|
+
mongodb: props.mongodb
|
|
450
468
|
};
|
|
451
469
|
var queryParams = '';
|
|
452
470
|
|
|
@@ -458,9 +476,10 @@ var ReactiveBase = {
|
|
|
458
476
|
|
|
459
477
|
var params = new URLSearchParams(queryParams);
|
|
460
478
|
var selectedValues = {};
|
|
479
|
+
var urlValues = {};
|
|
461
480
|
Array.from(params.keys()).forEach(function (key) {
|
|
462
481
|
try {
|
|
463
|
-
var _extends2;
|
|
482
|
+
var _extends2, _extends3;
|
|
464
483
|
|
|
465
484
|
var parsedParams = JSON.parse(params.get(key));
|
|
466
485
|
var selectedValue = {};
|
|
@@ -472,13 +491,13 @@ var ReactiveBase = {
|
|
|
472
491
|
}
|
|
473
492
|
|
|
474
493
|
if (parsedParams.category) selectedValue.category = parsedParams.category;
|
|
475
|
-
|
|
494
|
+
selectedValue.reference = 'URL';
|
|
495
|
+
selectedValues = _rollupPluginBabelHelpers._extends({}, selectedValues, (_extends2 = {}, _extends2[key] = selectedValue, _extends2));
|
|
496
|
+
urlValues = _rollupPluginBabelHelpers._extends({}, urlValues, (_extends3 = {}, _extends3[key] = selectedValue.value, _extends3));
|
|
476
497
|
} catch (e) {// Do not add to selectedValues if JSON parsing fails.
|
|
477
498
|
}
|
|
478
499
|
});
|
|
479
|
-
var
|
|
480
|
-
headers = _props$headers === void 0 ? {} : _props$headers,
|
|
481
|
-
themePreset = props.themePreset;
|
|
500
|
+
var themePreset = props.themePreset;
|
|
482
501
|
var appbaseRef = Appbase(config);
|
|
483
502
|
|
|
484
503
|
if (this.$props.transformRequest) {
|
|
@@ -490,13 +509,16 @@ var ReactiveBase = {
|
|
|
490
509
|
}
|
|
491
510
|
|
|
492
511
|
var initialState = _rollupPluginBabelHelpers._extends({
|
|
493
|
-
config: _rollupPluginBabelHelpers._extends(
|
|
512
|
+
config: _rollupPluginBabelHelpers._extends({}, config, {
|
|
513
|
+
initialQueriesSyncTime: props.initialQueriesSyncTime,
|
|
514
|
+
initialTimestamp: new Date().getTime(),
|
|
494
515
|
mapKey: props.mapKey,
|
|
495
516
|
themePreset: themePreset
|
|
496
517
|
}),
|
|
497
518
|
appbaseRef: appbaseRef,
|
|
498
519
|
selectedValues: selectedValues,
|
|
499
|
-
|
|
520
|
+
urlValues: urlValues,
|
|
521
|
+
headers: this.getHeaders
|
|
500
522
|
}, this.$props.initialState);
|
|
501
523
|
|
|
502
524
|
this.store = configureStore__default(initialState);
|
|
@@ -505,10 +527,9 @@ var ReactiveBase = {
|
|
|
505
527
|
render: function render() {
|
|
506
528
|
var h = arguments[0];
|
|
507
529
|
var children = this.$slots["default"];
|
|
508
|
-
var _this$$
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
className = _this$$props.className;
|
|
530
|
+
var _this$$props2 = this.$props,
|
|
531
|
+
style = _this$$props2.style,
|
|
532
|
+
className = _this$$props2.className;
|
|
512
533
|
return h(Provider, {
|
|
513
534
|
"attrs": {
|
|
514
535
|
"store": this.store
|
|
@@ -516,7 +537,7 @@ var ReactiveBase = {
|
|
|
516
537
|
}, [h(URLParamsProvider$1, {
|
|
517
538
|
"attrs": {
|
|
518
539
|
"as": this.$props.as,
|
|
519
|
-
"headers":
|
|
540
|
+
"headers": this.getHeaders,
|
|
520
541
|
"className": className,
|
|
521
542
|
"getSearchParams": this.getSearchParams,
|
|
522
543
|
"setSearchParams": this.setSearchParams
|
|
@@ -6,15 +6,19 @@ 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-4abdbfff.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-2a8358cd.js');
|
|
16
|
+
var ComponentWrapper = require('./ComponentWrapper-ab813390.js');
|
|
17
17
|
|
|
18
|
+
var _excluded = ["options"],
|
|
19
|
+
_excluded2 = ["query"],
|
|
20
|
+
_excluded3 = ["query"],
|
|
21
|
+
_excluded4 = ["query"];
|
|
18
22
|
var updateQuery = configureStore.Actions.updateQuery,
|
|
19
23
|
setQueryOptions = configureStore.Actions.setQueryOptions,
|
|
20
24
|
setCustomQuery = configureStore.Actions.setCustomQuery,
|
|
@@ -38,7 +42,8 @@ var ReactiveComponent = {
|
|
|
38
42
|
showFilter: VueTypes.bool.def(true),
|
|
39
43
|
URLParams: VueTypes.bool.def(false),
|
|
40
44
|
distinctField: vueTypes.types.string,
|
|
41
|
-
distinctFieldConfig: vueTypes.types.props
|
|
45
|
+
distinctFieldConfig: vueTypes.types.props,
|
|
46
|
+
index: VueTypes.string
|
|
42
47
|
},
|
|
43
48
|
created: function created() {
|
|
44
49
|
var _this = this;
|
|
@@ -47,25 +52,30 @@ var ReactiveComponent = {
|
|
|
47
52
|
this.internalComponent = null;
|
|
48
53
|
this.$defaultQuery = null; // Set custom query in store
|
|
49
54
|
|
|
50
|
-
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
55
|
+
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
51
56
|
var customQuery = props.customQuery,
|
|
52
57
|
componentId = props.componentId,
|
|
53
58
|
filterLabel = props.filterLabel,
|
|
54
59
|
showFilter = props.showFilter,
|
|
55
60
|
URLParams = props.URLParams,
|
|
56
61
|
distinctField = props.distinctField,
|
|
57
|
-
distinctFieldConfig = props.distinctFieldConfig
|
|
62
|
+
distinctFieldConfig = props.distinctFieldConfig,
|
|
63
|
+
index$1 = props.index;
|
|
58
64
|
|
|
59
|
-
if (this.
|
|
65
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
60
66
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
if (!this.
|
|
69
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
64
70
|
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
65
71
|
}
|
|
66
72
|
|
|
73
|
+
if (!this.enableAppbase && index$1) {
|
|
74
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
if (customQuery) {
|
|
68
|
-
var calcCustomQuery = customQuery(props);
|
|
78
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
69
79
|
|
|
70
80
|
var _ref = calcCustomQuery || {},
|
|
71
81
|
query = _ref.query;
|
|
@@ -73,12 +83,18 @@ var ReactiveComponent = {
|
|
|
73
83
|
var customQueryOptions = calcCustomQuery ? getOptionsFromQuery(calcCustomQuery) : null;
|
|
74
84
|
|
|
75
85
|
if (customQueryOptions) {
|
|
76
|
-
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(
|
|
86
|
+
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
77
87
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
78
88
|
|
|
89
|
+
var queryToSet = query || null;
|
|
90
|
+
|
|
91
|
+
if (calcCustomQuery && calcCustomQuery.id) {
|
|
92
|
+
queryToSet = calcCustomQuery;
|
|
93
|
+
}
|
|
94
|
+
|
|
79
95
|
this.updateQuery({
|
|
80
96
|
componentId: componentId,
|
|
81
|
-
query:
|
|
97
|
+
query: queryToSet,
|
|
82
98
|
value: this.selectedValue || null,
|
|
83
99
|
label: filterLabel,
|
|
84
100
|
showFilter: showFilter,
|
|
@@ -88,10 +104,16 @@ var ReactiveComponent = {
|
|
|
88
104
|
|
|
89
105
|
this.setQuery = function (_ref2) {
|
|
90
106
|
var options = _ref2.options,
|
|
91
|
-
obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref2,
|
|
107
|
+
obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
92
108
|
|
|
93
109
|
if (options) {
|
|
94
|
-
_this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends(
|
|
110
|
+
_this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, options, _this.getAggsQuery()), false);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
114
|
+
|
|
115
|
+
if (obj && obj.query && obj.query.query) {
|
|
116
|
+
queryToBeSet = obj.query.query;
|
|
95
117
|
} // Update customQuery field for RS API
|
|
96
118
|
|
|
97
119
|
|
|
@@ -99,13 +121,17 @@ var ReactiveComponent = {
|
|
|
99
121
|
var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options);
|
|
100
122
|
|
|
101
123
|
if (obj && obj.query) {
|
|
102
|
-
|
|
124
|
+
if (obj.query.id) {
|
|
125
|
+
customQueryCalc = queryToBeSet;
|
|
126
|
+
} else {
|
|
127
|
+
customQueryCalc.query = obj.query;
|
|
128
|
+
}
|
|
103
129
|
}
|
|
104
130
|
|
|
105
131
|
_this.setCustomQuery(props.componentId, customQueryCalc);
|
|
106
132
|
}
|
|
107
133
|
|
|
108
|
-
_this.updateQuery(_rollupPluginBabelHelpers._extends(
|
|
134
|
+
_this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
|
|
109
135
|
componentId: props.componentId,
|
|
110
136
|
label: props.filterLabel,
|
|
111
137
|
showFilter: props.showFilter,
|
|
@@ -119,20 +145,26 @@ var ReactiveComponent = {
|
|
|
119
145
|
},
|
|
120
146
|
beforeMount: function beforeMount() {
|
|
121
147
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
122
|
-
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
123
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
148
|
+
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
149
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
124
150
|
|
|
125
151
|
var _ref3 = this.$defaultQuery || {},
|
|
126
152
|
query = _ref3.query,
|
|
127
|
-
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref3,
|
|
153
|
+
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
128
154
|
|
|
129
155
|
if (queryOptions) {
|
|
130
|
-
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(
|
|
156
|
+
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
131
157
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
132
158
|
|
|
159
|
+
var queryToSet = query || null;
|
|
160
|
+
|
|
161
|
+
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
162
|
+
queryToSet = this.$defaultQuery;
|
|
163
|
+
}
|
|
164
|
+
|
|
133
165
|
this.updateQuery({
|
|
134
166
|
componentId: this.internalComponent,
|
|
135
|
-
query:
|
|
167
|
+
query: queryToSet
|
|
136
168
|
});
|
|
137
169
|
}
|
|
138
170
|
},
|
|
@@ -178,43 +210,55 @@ var ReactiveComponent = {
|
|
|
178
210
|
}
|
|
179
211
|
},
|
|
180
212
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
181
|
-
if (newVal && !index.isQueryIdentical(newVal, oldVal,
|
|
182
|
-
this.$defaultQuery = newVal();
|
|
213
|
+
if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
214
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
183
215
|
|
|
184
216
|
var _ref4 = this.$defaultQuery || {},
|
|
185
217
|
query = _ref4.query,
|
|
186
|
-
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref4,
|
|
218
|
+
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref4, _excluded3);
|
|
187
219
|
|
|
188
220
|
if (queryOptions) {
|
|
189
|
-
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends(
|
|
221
|
+
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
190
222
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
191
223
|
|
|
192
224
|
|
|
193
|
-
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
225
|
+
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
226
|
+
var queryToSet = query || null;
|
|
227
|
+
|
|
228
|
+
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
229
|
+
queryToSet = this.$defaultQuery;
|
|
230
|
+
}
|
|
231
|
+
|
|
194
232
|
this.updateQuery({
|
|
195
233
|
componentId: this.internalComponent,
|
|
196
|
-
query:
|
|
234
|
+
query: queryToSet
|
|
197
235
|
});
|
|
198
236
|
}
|
|
199
237
|
},
|
|
200
238
|
customQuery: function customQuery(newVal, oldVal) {
|
|
201
|
-
if (newVal && !index.isQueryIdentical(newVal, oldVal,
|
|
239
|
+
if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
202
240
|
var componentId = this.$props.componentId;
|
|
203
|
-
this.$customQuery = newVal(this.$props);
|
|
241
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
204
242
|
|
|
205
243
|
var _ref5 = this.$customQuery || {},
|
|
206
244
|
query = _ref5.query,
|
|
207
|
-
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref5,
|
|
245
|
+
queryOptions = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref5, _excluded4);
|
|
208
246
|
|
|
209
247
|
if (queryOptions) {
|
|
210
|
-
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends(
|
|
248
|
+
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
211
249
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
212
250
|
|
|
213
251
|
|
|
214
|
-
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
252
|
+
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
253
|
+
var queryToSet = query || null;
|
|
254
|
+
|
|
255
|
+
if (this.$customQuery && this.$customQuery.id) {
|
|
256
|
+
queryToSet = this.$customQuery;
|
|
257
|
+
}
|
|
258
|
+
|
|
215
259
|
this.updateQuery({
|
|
216
260
|
componentId: componentId,
|
|
217
|
-
query:
|
|
261
|
+
query: queryToSet
|
|
218
262
|
});
|
|
219
263
|
}
|
|
220
264
|
}
|
|
@@ -228,10 +272,10 @@ var ReactiveComponent = {
|
|
|
228
272
|
isLoading = this.isLoading,
|
|
229
273
|
selectedValue = this.selectedValue;
|
|
230
274
|
|
|
231
|
-
var propsToBePassed = _rollupPluginBabelHelpers._extends(
|
|
275
|
+
var propsToBePassed = _rollupPluginBabelHelpers._extends({
|
|
232
276
|
error: error,
|
|
233
277
|
loading: isLoading
|
|
234
|
-
}, this.getData()
|
|
278
|
+
}, this.getData(), {
|
|
235
279
|
value: selectedValue,
|
|
236
280
|
setQuery: this.setQuery
|
|
237
281
|
});
|
|
@@ -308,7 +352,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
308
352
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
309
353
|
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
310
354
|
componentProps: state.props[props.componentId],
|
|
311
|
-
|
|
355
|
+
enableAppbase: state.config.enableAppbase
|
|
312
356
|
};
|
|
313
357
|
};
|
|
314
358
|
|