@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
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-c705cbe6.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-6a167fe0.js');
|
|
17
|
+
var ComponentWrapper = require('./ComponentWrapper-ad3dad02.js');
|
|
18
|
+
var Title = require('./Title-1de7d0f4.js');
|
|
19
|
+
var Container = require('./Container-daf30918.js');
|
|
20
20
|
var NoSSR = _interopDefault(require('vue-no-ssr'));
|
|
21
|
-
var ssr = require('./ssr-
|
|
21
|
+
var ssr = require('./ssr-3027b848.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
|
});
|
|
@@ -118,14 +115,14 @@ var RangeSlider = {
|
|
|
118
115
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
119
116
|
var customQuery = props.customQuery;
|
|
120
117
|
var query = RangeSlider.defaultQuery(value, props);
|
|
121
|
-
var customQueryOptions;
|
|
122
118
|
|
|
123
119
|
if (customQuery) {
|
|
124
120
|
var _ref = customQuery(value, props) || {};
|
|
125
121
|
|
|
126
122
|
query = _ref.query;
|
|
127
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
123
|
+
var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
128
124
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
125
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
129
126
|
}
|
|
130
127
|
|
|
131
128
|
var showFilter = props.showFilter,
|
|
@@ -136,7 +133,6 @@ 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);
|
|
140
136
|
this.updateQuery({
|
|
141
137
|
componentId: props.componentId,
|
|
142
138
|
query: query,
|
|
@@ -172,6 +168,10 @@ var RangeSlider = {
|
|
|
172
168
|
created: function created() {
|
|
173
169
|
if (!this.$props.range) {
|
|
174
170
|
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;');
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
174
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
175
175
|
} // Set custom query in store
|
|
176
176
|
|
|
177
177
|
|
|
@@ -211,12 +211,13 @@ var RangeSlider = {
|
|
|
211
211
|
"max": this.$props.range.end,
|
|
212
212
|
"dotSize": 20,
|
|
213
213
|
"height": 4,
|
|
214
|
-
"enable-cross": false
|
|
214
|
+
"enable-cross": false,
|
|
215
|
+
"tooltip": "always"
|
|
216
|
+
},
|
|
217
|
+
"on": {
|
|
218
|
+
"drag-end": this.handleSlider
|
|
215
219
|
},
|
|
216
|
-
"props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
|
|
217
|
-
"on": _rollupPluginBabelHelpers._extends({}, {
|
|
218
|
-
input: this.handleSlider
|
|
219
|
-
})
|
|
220
|
+
"props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
|
|
220
221
|
}), this.$props.rangeLabels && h("div", {
|
|
221
222
|
"class": "label-container"
|
|
222
223
|
}, [h("label", {
|
|
@@ -258,7 +259,7 @@ RangeSlider.defaultQuery = function (values, props) {
|
|
|
258
259
|
|
|
259
260
|
RangeSlider.parseValue = function (value, props) {
|
|
260
261
|
if (value) {
|
|
261
|
-
return [value.start, value.end];
|
|
262
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
if (props.range) {
|
|
@@ -273,7 +274,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
273
274
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
274
275
|
: [],
|
|
275
276
|
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
276
|
-
componentProps: state.props[props.componentId]
|
|
277
|
+
componentProps: state.props[props.componentId],
|
|
278
|
+
enableAppbase: state.config.enableAppbase
|
|
277
279
|
};
|
|
278
280
|
};
|
|
279
281
|
|
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-c705cbe6.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-6a167fe0.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;
|
|
@@ -108,7 +100,7 @@ var URLParamsProvider = {
|
|
|
108
100
|
Object.keys(_this.currentSelectedState).filter(function (item) {
|
|
109
101
|
return !activeComponents.includes(item);
|
|
110
102
|
}).forEach(function (component) {
|
|
111
|
-
_this.setValue(component, null);
|
|
103
|
+
_this.setValue(component, null, undefined, undefined, undefined, undefined, undefined, undefined, 'URL');
|
|
112
104
|
}); // update active components in selectedValues
|
|
113
105
|
|
|
114
106
|
Array.from(_this.params.entries()).forEach(function (item) {
|
|
@@ -123,7 +115,7 @@ var URLParamsProvider = {
|
|
|
123
115
|
showFilter = _ref.showFilter,
|
|
124
116
|
URLParams = _ref.URLParams;
|
|
125
117
|
|
|
126
|
-
_this.setValue(component, JSON.parse(value), label, showFilter, URLParams);
|
|
118
|
+
_this.setValue(component, JSON.parse(value), label, showFilter, URLParams, undefined, undefined, undefined, 'URL');
|
|
127
119
|
} catch (e) {
|
|
128
120
|
// Do not set value if JSON parsing fails.
|
|
129
121
|
console.error(e);
|
|
@@ -141,39 +133,45 @@ var URLParamsProvider = {
|
|
|
141
133
|
selectedValues: function selectedValues(newVal, oldVal) {
|
|
142
134
|
var _this2 = this;
|
|
143
135
|
|
|
144
|
-
this.currentSelectedState = newVal;
|
|
145
|
-
|
|
146
136
|
if (!isEqual(newVal, oldVal)) {
|
|
147
137
|
this.searchString = this.$props.getSearchParams ? this.$props.getSearchParams() : window.location.search;
|
|
148
138
|
this.params = new URLSearchParams(this.searchString);
|
|
149
139
|
var currentComponents = Object.keys(newVal);
|
|
150
140
|
var urlComponents = Array.from(this.params.keys());
|
|
141
|
+
var shouldPushHistory = false;
|
|
151
142
|
currentComponents.filter(function (component) {
|
|
152
143
|
return newVal[component].URLParams;
|
|
153
144
|
}).forEach(function (component) {
|
|
154
|
-
// prevents empty history pollution on initial load
|
|
155
|
-
if (_this2.hasValidValue(newVal[component]) || _this2.hasValidValue(oldVal[component])) {
|
|
156
|
-
var selectedValues = newVal[component];
|
|
145
|
+
var selectedValues = newVal[component]; // prevents empty history pollution on initial load
|
|
157
146
|
|
|
147
|
+
if (_this2.hasValidValue(newVal[component]) || _this2.hasValidValue(oldVal[component])) {
|
|
158
148
|
if (selectedValues.URLParams) {
|
|
159
149
|
if (selectedValues.category) {
|
|
160
|
-
_this2.setURL(component, _this2.getValue({
|
|
150
|
+
var shouldUpdateHistory = _this2.setURL(component, _this2.getValue({
|
|
161
151
|
category: selectedValues.category,
|
|
162
152
|
value: selectedValues.value
|
|
163
153
|
}));
|
|
154
|
+
|
|
155
|
+
if (shouldUpdateHistory) {
|
|
156
|
+
shouldPushHistory = true;
|
|
157
|
+
}
|
|
164
158
|
} else {
|
|
165
|
-
_this2.setURL(component, _this2.getValue(selectedValues.value));
|
|
159
|
+
var _shouldUpdateHistory = _this2.setURL(component, _this2.getValue(selectedValues.value));
|
|
160
|
+
|
|
161
|
+
if (_shouldUpdateHistory) {
|
|
162
|
+
shouldPushHistory = true;
|
|
163
|
+
}
|
|
166
164
|
}
|
|
167
165
|
} else {
|
|
168
166
|
_this2.params["delete"](component);
|
|
169
167
|
|
|
170
|
-
|
|
168
|
+
shouldPushHistory = true;
|
|
171
169
|
}
|
|
172
170
|
} else if (!_this2.hasValidValue(newVal[component]) && urlComponents.includes(component)) {
|
|
173
171
|
// doesn't have a valid value, but the url has a (stale) valid value set
|
|
174
172
|
_this2.params["delete"](component);
|
|
175
173
|
|
|
176
|
-
|
|
174
|
+
shouldPushHistory = true;
|
|
177
175
|
}
|
|
178
176
|
}); // remove unmounted components
|
|
179
177
|
|
|
@@ -182,15 +180,20 @@ var URLParamsProvider = {
|
|
|
182
180
|
}).forEach(function (component) {
|
|
183
181
|
_this2.params["delete"](component);
|
|
184
182
|
|
|
185
|
-
|
|
183
|
+
shouldPushHistory = true;
|
|
186
184
|
});
|
|
187
185
|
|
|
188
186
|
if (!currentComponents.length) {
|
|
189
187
|
Array.from(this.params.keys()).forEach(function (item) {
|
|
190
188
|
if (_this2.searchComponents && _this2.searchComponents.includes(item)) {
|
|
191
189
|
_this2.params["delete"](item);
|
|
190
|
+
|
|
191
|
+
shouldPushHistory = true;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (shouldPushHistory) {
|
|
194
197
|
this.pushToHistory();
|
|
195
198
|
}
|
|
196
199
|
}
|
|
@@ -241,7 +244,9 @@ var URLParamsProvider = {
|
|
|
241
244
|
return value.map(function (item) {
|
|
242
245
|
return _this3.getValue(item);
|
|
243
246
|
});
|
|
244
|
-
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (value && typeof value === 'object') {
|
|
245
250
|
// TODO: support for NestedList
|
|
246
251
|
if (value.location) return value;
|
|
247
252
|
if (value.category) return value;
|
|
@@ -251,20 +256,19 @@ var URLParamsProvider = {
|
|
|
251
256
|
return value;
|
|
252
257
|
},
|
|
253
258
|
setURL: function setURL(component, value) {
|
|
254
|
-
this.searchString = this.$props.getSearchParams ? this.$props.getSearchParams() : window.location.search;
|
|
255
|
-
this.params = new URLSearchParams(this.searchString);
|
|
256
|
-
|
|
257
259
|
if (!value || typeof value === 'string' && value.trim() === '' || Array.isArray(value) && value.length === 0) {
|
|
258
260
|
this.params["delete"](component);
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
var data = JSON.stringify(this.getValue(value));
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
262
263
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
var data = JSON.stringify(value);
|
|
265
|
+
|
|
266
|
+
if (data !== this.params.get(component)) {
|
|
267
|
+
this.params.set(component, data);
|
|
268
|
+
return true;
|
|
267
269
|
}
|
|
270
|
+
|
|
271
|
+
return false;
|
|
268
272
|
},
|
|
269
273
|
pushToHistory: function pushToHistory() {
|
|
270
274
|
var paramsSting = this.params.toString() ? "?" + this.params.toString() : '';
|
|
@@ -366,11 +370,11 @@ var ReactiveBase = {
|
|
|
366
370
|
}
|
|
367
371
|
},
|
|
368
372
|
props: {
|
|
369
|
-
app: vueTypes.types.
|
|
373
|
+
app: vueTypes.types.string,
|
|
370
374
|
analytics: VueTypes.bool,
|
|
371
375
|
analyticsConfig: vueTypes.types.analyticsConfig,
|
|
372
376
|
appbaseConfig: vueTypes.types.appbaseConfig,
|
|
373
|
-
enableAppbase:
|
|
377
|
+
enableAppbase: VueTypes.bool.def(false),
|
|
374
378
|
credentials: vueTypes.types.string,
|
|
375
379
|
headers: vueTypes.types.headers,
|
|
376
380
|
queryParams: vueTypes.types.string,
|
|
@@ -379,13 +383,15 @@ var ReactiveBase = {
|
|
|
379
383
|
type: vueTypes.types.string,
|
|
380
384
|
url: vueTypes.types.string,
|
|
381
385
|
mapKey: vueTypes.types.string,
|
|
386
|
+
initialQueriesSyncTime: vueTypes.types.number,
|
|
382
387
|
className: vueTypes.types.string,
|
|
383
388
|
initialState: VueTypes.object.def({}),
|
|
384
389
|
transformRequest: vueTypes.types.func,
|
|
385
390
|
transformResponse: vueTypes.types.func,
|
|
386
391
|
as: VueTypes.string.def('div'),
|
|
387
392
|
getSearchParams: vueTypes.types.func,
|
|
388
|
-
setSearchParams: vueTypes.types.func
|
|
393
|
+
setSearchParams: vueTypes.types.func,
|
|
394
|
+
mongodb: vueTypes.types.mongodb
|
|
389
395
|
},
|
|
390
396
|
provide: function provide() {
|
|
391
397
|
return {
|
|
@@ -425,6 +431,27 @@ var ReactiveBase = {
|
|
|
425
431
|
this.store.dispatch(analytics.updateAnalyticsConfig(newVal));
|
|
426
432
|
}
|
|
427
433
|
}
|
|
434
|
+
},
|
|
435
|
+
mongodb: function mongodb() {
|
|
436
|
+
this.updateState(this.$props);
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
computed: {
|
|
440
|
+
getHeaders: function getHeaders() {
|
|
441
|
+
var _this$$props = this.$props,
|
|
442
|
+
enableAppbase = _this$$props.enableAppbase,
|
|
443
|
+
headers = _this$$props.headers,
|
|
444
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
445
|
+
mongodb = _this$$props.mongodb;
|
|
446
|
+
|
|
447
|
+
var _ref = appbaseConfig || {},
|
|
448
|
+
enableTelemetry = _ref.enableTelemetry;
|
|
449
|
+
|
|
450
|
+
return _rollupPluginBabelHelpers._extends({}, enableAppbase && !mongodb && _rollupPluginBabelHelpers._extends({
|
|
451
|
+
'X-Search-Client': index.X_SEARCH_CLIENT
|
|
452
|
+
}, enableTelemetry === false && {
|
|
453
|
+
'X-Enable-Telemetry': false
|
|
454
|
+
}), headers);
|
|
428
455
|
}
|
|
429
456
|
},
|
|
430
457
|
methods: {
|
|
@@ -435,10 +462,10 @@ var ReactiveBase = {
|
|
|
435
462
|
setStore: function setStore(props) {
|
|
436
463
|
var credentials = props.url && props.url.trim() !== '' && !props.credentials ? null : props.credentials;
|
|
437
464
|
|
|
438
|
-
var appbaseConfig = _rollupPluginBabelHelpers._extends(
|
|
465
|
+
var appbaseConfig = _rollupPluginBabelHelpers._extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
439
466
|
|
|
440
467
|
var config = {
|
|
441
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
468
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
442
469
|
app: props.app,
|
|
443
470
|
credentials: credentials,
|
|
444
471
|
type: props.type ? props.type : '*',
|
|
@@ -446,7 +473,8 @@ var ReactiveBase = {
|
|
|
446
473
|
transformResponse: props.transformResponse,
|
|
447
474
|
enableAppbase: props.enableAppbase,
|
|
448
475
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
449
|
-
analyticsConfig: appbaseConfig
|
|
476
|
+
analyticsConfig: appbaseConfig,
|
|
477
|
+
mongodb: props.mongodb
|
|
450
478
|
};
|
|
451
479
|
var queryParams = '';
|
|
452
480
|
|
|
@@ -458,9 +486,10 @@ var ReactiveBase = {
|
|
|
458
486
|
|
|
459
487
|
var params = new URLSearchParams(queryParams);
|
|
460
488
|
var selectedValues = {};
|
|
489
|
+
var urlValues = {};
|
|
461
490
|
Array.from(params.keys()).forEach(function (key) {
|
|
462
491
|
try {
|
|
463
|
-
var _extends2;
|
|
492
|
+
var _extends2, _extends3;
|
|
464
493
|
|
|
465
494
|
var parsedParams = JSON.parse(params.get(key));
|
|
466
495
|
var selectedValue = {};
|
|
@@ -472,13 +501,13 @@ var ReactiveBase = {
|
|
|
472
501
|
}
|
|
473
502
|
|
|
474
503
|
if (parsedParams.category) selectedValue.category = parsedParams.category;
|
|
475
|
-
|
|
504
|
+
selectedValue.reference = 'URL';
|
|
505
|
+
selectedValues = _rollupPluginBabelHelpers._extends({}, selectedValues, (_extends2 = {}, _extends2[key] = selectedValue, _extends2));
|
|
506
|
+
urlValues = _rollupPluginBabelHelpers._extends({}, urlValues, (_extends3 = {}, _extends3[key] = selectedValue.value, _extends3));
|
|
476
507
|
} catch (e) {// Do not add to selectedValues if JSON parsing fails.
|
|
477
508
|
}
|
|
478
509
|
});
|
|
479
|
-
var
|
|
480
|
-
headers = _props$headers === void 0 ? {} : _props$headers,
|
|
481
|
-
themePreset = props.themePreset;
|
|
510
|
+
var themePreset = props.themePreset;
|
|
482
511
|
var appbaseRef = Appbase(config);
|
|
483
512
|
|
|
484
513
|
if (this.$props.transformRequest) {
|
|
@@ -490,13 +519,16 @@ var ReactiveBase = {
|
|
|
490
519
|
}
|
|
491
520
|
|
|
492
521
|
var initialState = _rollupPluginBabelHelpers._extends({
|
|
493
|
-
config: _rollupPluginBabelHelpers._extends(
|
|
522
|
+
config: _rollupPluginBabelHelpers._extends({}, config, {
|
|
523
|
+
initialQueriesSyncTime: props.initialQueriesSyncTime,
|
|
524
|
+
initialTimestamp: new Date().getTime(),
|
|
494
525
|
mapKey: props.mapKey,
|
|
495
526
|
themePreset: themePreset
|
|
496
527
|
}),
|
|
497
528
|
appbaseRef: appbaseRef,
|
|
498
529
|
selectedValues: selectedValues,
|
|
499
|
-
|
|
530
|
+
urlValues: urlValues,
|
|
531
|
+
headers: this.getHeaders
|
|
500
532
|
}, this.$props.initialState);
|
|
501
533
|
|
|
502
534
|
this.store = configureStore__default(initialState);
|
|
@@ -505,10 +537,9 @@ var ReactiveBase = {
|
|
|
505
537
|
render: function render() {
|
|
506
538
|
var h = arguments[0];
|
|
507
539
|
var children = this.$slots["default"];
|
|
508
|
-
var _this$$
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
className = _this$$props.className;
|
|
540
|
+
var _this$$props2 = this.$props,
|
|
541
|
+
style = _this$$props2.style,
|
|
542
|
+
className = _this$$props2.className;
|
|
512
543
|
return h(Provider, {
|
|
513
544
|
"attrs": {
|
|
514
545
|
"store": this.store
|
|
@@ -516,7 +547,7 @@ var ReactiveBase = {
|
|
|
516
547
|
}, [h(URLParamsProvider$1, {
|
|
517
548
|
"attrs": {
|
|
518
549
|
"as": this.$props.as,
|
|
519
|
-
"headers":
|
|
550
|
+
"headers": this.getHeaders,
|
|
520
551
|
"className": className,
|
|
521
552
|
"getSearchParams": this.getSearchParams,
|
|
522
553
|
"setSearchParams": this.setSearchParams
|