@appbaseio/reactivesearch-vue 1.33.2 → 1.33.3
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 +994 -474
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +7 -7
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{DataSearch-99a6a2e8.js → DataSearch-e4822dbf.js} +10 -6
- package/dist/cjs/DataSearch.js +1 -1
- package/dist/cjs/MultiRange.js +7 -1
- package/dist/cjs/ReactiveBase.js +32 -2
- package/dist/cjs/{ReactiveComponent-805201c6.js → ReactiveComponent-b8efb0cf.js} +1 -1
- package/dist/cjs/ReactiveComponent.js +2 -2
- package/dist/cjs/StateProvider.js +22 -6
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/install.js +3 -3
- package/dist/cjs/version.js +1 -1
- package/dist/es/{DataSearch-20f0d8f1.js → DataSearch-5ddfba23.js} +10 -6
- package/dist/es/DataSearch.js +1 -1
- package/dist/es/MultiRange.js +7 -1
- package/dist/es/ReactiveBase.js +32 -2
- package/dist/es/{ReactiveComponent-dd85aa9c.js → ReactiveComponent-59107264.js} +1 -1
- package/dist/es/ReactiveComponent.js +2 -2
- package/dist/es/StateProvider.js +23 -7
- package/dist/es/index.js +3 -3
- package/dist/es/install.js +3 -3
- package/dist/es/version.js +1 -1
- package/package.json +3 -2
|
@@ -951,10 +951,11 @@ var DataSearch = {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
this.handleTextChange = debounce(this.handleText, this.$props.debounce);
|
|
954
|
+
this.updateDefaultQueryHandlerDebounced = debounce(this.updateDefaultQueryHandler, this.$props.debounce);
|
|
954
955
|
// Set custom and default queries in store
|
|
955
956
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
956
957
|
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
957
|
-
this.
|
|
958
|
+
this.updateDefaultQueryHandlerDebounced(this.currentValue, this.$props, false);
|
|
958
959
|
},
|
|
959
960
|
computed: {
|
|
960
961
|
suggestionsList: function suggestionsList() {
|
|
@@ -1139,7 +1140,7 @@ var DataSearch = {
|
|
|
1139
1140
|
},
|
|
1140
1141
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
1141
1142
|
if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
1142
|
-
this.
|
|
1143
|
+
this.updateDefaultQueryHandlerDebounced(this.$data.currentValue, this.$props);
|
|
1143
1144
|
}
|
|
1144
1145
|
},
|
|
1145
1146
|
customQuery: function customQuery(newVal, oldVal) {
|
|
@@ -1175,9 +1176,9 @@ var DataSearch = {
|
|
|
1175
1176
|
methods: {
|
|
1176
1177
|
handleText: function handleText(value) {
|
|
1177
1178
|
if (this.$props.autosuggest) {
|
|
1178
|
-
this.
|
|
1179
|
+
this.updateDefaultQueryHandlerDebounced(value, this.$props);
|
|
1179
1180
|
} else {
|
|
1180
|
-
this.
|
|
1181
|
+
this.updateDefaultQueryHandlerDebounced(this.$props.componentId, value, this.$props);
|
|
1181
1182
|
}
|
|
1182
1183
|
},
|
|
1183
1184
|
validateDataField: function validateDataField() {
|
|
@@ -1318,7 +1319,7 @@ var DataSearch = {
|
|
|
1318
1319
|
if (toggleIsOpen) {
|
|
1319
1320
|
_this.isOpen = false;
|
|
1320
1321
|
}
|
|
1321
|
-
if (typeof value === 'string') _this.
|
|
1322
|
+
if (typeof value === 'string') _this.updateDefaultQueryHandlerDebounced(value, _this.$props);
|
|
1322
1323
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1323
1324
|
// to set the query otherwise the value should reset
|
|
1324
1325
|
|
|
@@ -1352,6 +1353,9 @@ var DataSearch = {
|
|
|
1352
1353
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1353
1354
|
},
|
|
1354
1355
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
|
|
1356
|
+
if (props === void 0) {
|
|
1357
|
+
props = this.$props;
|
|
1358
|
+
}
|
|
1355
1359
|
if (!value && props.enableDefaultSuggestions === false) {
|
|
1356
1360
|
// clear Component data from store
|
|
1357
1361
|
this.resetStoreForComponent(props.componentId);
|
|
@@ -1484,7 +1488,7 @@ var DataSearch = {
|
|
|
1484
1488
|
if (_this2.$options.isTagsMode && autosuggest) {
|
|
1485
1489
|
_this2.currentValue = value;
|
|
1486
1490
|
_this2.isOpen = isOpen;
|
|
1487
|
-
_this2.
|
|
1491
|
+
_this2.updateDefaultQueryHandlerDebounced(_this2.currentValue, _this2.$props);
|
|
1488
1492
|
return;
|
|
1489
1493
|
}
|
|
1490
1494
|
_this2.triggerQuery({
|
package/dist/cjs/DataSearch.js
CHANGED
|
@@ -19,7 +19,7 @@ require('./PreferencesConsumer-5d67b486.js');
|
|
|
19
19
|
require('./Title-16042ea0.js');
|
|
20
20
|
require('./Flex-ddd7cb6b.js');
|
|
21
21
|
require('hotkeys-js');
|
|
22
|
-
var DataSearch = require('./DataSearch-
|
|
22
|
+
var DataSearch = require('./DataSearch-e4822dbf.js');
|
|
23
23
|
require('./CancelSvg-220a7cc3.js');
|
|
24
24
|
require('./Input-ead4cd84.js');
|
|
25
25
|
require('compute-scroll-into-view');
|
package/dist/cjs/MultiRange.js
CHANGED
|
@@ -157,7 +157,13 @@ var MultiRange = {
|
|
|
157
157
|
},
|
|
158
158
|
selectedValue: function selectedValue(newVal) {
|
|
159
159
|
if (!isEqual(this.$data.currentValue, newVal)) {
|
|
160
|
-
|
|
160
|
+
var processSelectedValues = newVal ? newVal.map(function (item) {
|
|
161
|
+
if (typeof item === 'object' && 'label' in item) {
|
|
162
|
+
return item.label;
|
|
163
|
+
}
|
|
164
|
+
return item;
|
|
165
|
+
}) : null;
|
|
166
|
+
this.selectItem(processSelectedValues, true, undefined, true);
|
|
161
167
|
}
|
|
162
168
|
},
|
|
163
169
|
customQuery: function customQuery(newVal, oldVal) {
|
package/dist/cjs/ReactiveBase.js
CHANGED
|
@@ -18,6 +18,7 @@ var index = require('./index-30126fd0.js');
|
|
|
18
18
|
var _mergeJSXProps = _interopDefault(require('@vue/babel-helper-vue-jsx-merge-props'));
|
|
19
19
|
var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
20
20
|
var Appbase = _interopDefault(require('appbase-js'));
|
|
21
|
+
var AppbaseAnalytics = _interopDefault(require('@appbaseio/analytics'));
|
|
21
22
|
require('url-search-params-polyfill');
|
|
22
23
|
|
|
23
24
|
var Provider = {
|
|
@@ -32,11 +33,16 @@ var Provider = {
|
|
|
32
33
|
}
|
|
33
34
|
return true;
|
|
34
35
|
}
|
|
36
|
+
},
|
|
37
|
+
analyticsRef: {
|
|
38
|
+
type: Object,
|
|
39
|
+
required: true
|
|
35
40
|
}
|
|
36
41
|
},
|
|
37
42
|
provide: function provide() {
|
|
38
43
|
return {
|
|
39
|
-
$$store: this.store
|
|
44
|
+
$$store: this.store,
|
|
45
|
+
$analytics: this.analyticsRef
|
|
40
46
|
};
|
|
41
47
|
},
|
|
42
48
|
render: function render(h) {
|
|
@@ -485,6 +491,27 @@ var ReactiveBase = {
|
|
|
485
491
|
if (this.$props.transformResponse) {
|
|
486
492
|
appbaseRef.transformResponse = this.$props.transformResponse;
|
|
487
493
|
}
|
|
494
|
+
var analyticsInitConfig = {
|
|
495
|
+
url: url && url.replace(/\/\/.*@/, '//'),
|
|
496
|
+
credentials: appbaseRef.credentials,
|
|
497
|
+
// When endpoint prop is used index is not defined, so we use _default
|
|
498
|
+
index: appbaseRef.app || '_default',
|
|
499
|
+
globalCustomEvents: this.$props.appbaseConfig && this.$props.appbaseConfig.customEvents
|
|
500
|
+
};
|
|
501
|
+
try {
|
|
502
|
+
if (this.$props.endpoint && this.$props.endpoint.url) {
|
|
503
|
+
// Remove parts between '//' and first '/' in the url
|
|
504
|
+
analyticsInitConfig.url = this.$props.endpoint.url.replace(/\/\/(.*?)\/.*/, '//$1');
|
|
505
|
+
var headerCredentials = this.$props.endpoint.headers && this.$props.endpoint.headers.Authorization;
|
|
506
|
+
analyticsInitConfig.credentials = headerCredentials && headerCredentials.replace('Basic ', '');
|
|
507
|
+
// Decode the credentials
|
|
508
|
+
analyticsInitConfig.credentials = analyticsInitConfig.credentials && atob(analyticsInitConfig.credentials);
|
|
509
|
+
}
|
|
510
|
+
} catch (e) {
|
|
511
|
+
console.error('Endpoint not set correctly for analytics');
|
|
512
|
+
console.error(e);
|
|
513
|
+
}
|
|
514
|
+
var analyticsRef = AppbaseAnalytics.init(analyticsInitConfig);
|
|
488
515
|
var initialState = _rollupPluginBabelHelpers._extends({
|
|
489
516
|
config: _rollupPluginBabelHelpers._extends({}, config, {
|
|
490
517
|
initialQueriesSyncTime: props.initialQueriesSyncTime,
|
|
@@ -493,11 +520,13 @@ var ReactiveBase = {
|
|
|
493
520
|
themePreset: themePreset
|
|
494
521
|
}),
|
|
495
522
|
appbaseRef: appbaseRef,
|
|
523
|
+
analyticsRef: analyticsRef,
|
|
496
524
|
selectedValues: selectedValues,
|
|
497
525
|
urlValues: urlValues,
|
|
498
526
|
headers: this.getHeaders
|
|
499
527
|
}, this.$props.initialState);
|
|
500
528
|
this.store = configureStore__default(initialState);
|
|
529
|
+
this.analyticsRef = analyticsRef;
|
|
501
530
|
}
|
|
502
531
|
},
|
|
503
532
|
render: function render() {
|
|
@@ -508,7 +537,8 @@ var ReactiveBase = {
|
|
|
508
537
|
className = _this$$props2.className;
|
|
509
538
|
return h(Provider, {
|
|
510
539
|
"attrs": {
|
|
511
|
-
"store": this.store
|
|
540
|
+
"store": this.store,
|
|
541
|
+
"analyticsRef": this.analyticsRef
|
|
512
542
|
}
|
|
513
543
|
}, [h(URLParamsProvider$1, {
|
|
514
544
|
"attrs": {
|
|
@@ -18,7 +18,7 @@ var ComponentWrapper = require('./ComponentWrapper-9318cece.js');
|
|
|
18
18
|
var PreferencesConsumer = require('./PreferencesConsumer-5d67b486.js');
|
|
19
19
|
var Title = require('./Title-16042ea0.js');
|
|
20
20
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
21
|
-
var DataSearch = require('./DataSearch-
|
|
21
|
+
var DataSearch = require('./DataSearch-e4822dbf.js');
|
|
22
22
|
var CancelSvg = require('./CancelSvg-220a7cc3.js');
|
|
23
23
|
var Input = require('./Input-ead4cd84.js');
|
|
24
24
|
var Container = require('./Container-e699ea95.js');
|
|
@@ -25,13 +25,13 @@ require('./ListItem-5088bd6a.js');
|
|
|
25
25
|
require('./Card-240f283d.js');
|
|
26
26
|
require('./Flex-ddd7cb6b.js');
|
|
27
27
|
require('hotkeys-js');
|
|
28
|
-
require('./DataSearch-
|
|
28
|
+
require('./DataSearch-e4822dbf.js');
|
|
29
29
|
require('./CancelSvg-220a7cc3.js');
|
|
30
30
|
require('./Input-ead4cd84.js');
|
|
31
31
|
require('compute-scroll-into-view');
|
|
32
32
|
require('./Container-e699ea95.js');
|
|
33
33
|
require('vue-highlight-words');
|
|
34
|
-
var ReactiveComponent = require('./ReactiveComponent-
|
|
34
|
+
var ReactiveComponent = require('./ReactiveComponent-b8efb0cf.js');
|
|
35
35
|
require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
36
36
|
require('./FormControlList-bbb5cd24.js');
|
|
37
37
|
require('./utils-83fd01e9.js');
|
|
@@ -12,8 +12,8 @@ var VueTypes = _interopDefault(require('vue-types'));
|
|
|
12
12
|
var transform = require('@appbaseio/reactivecore/lib/utils/transform');
|
|
13
13
|
require('redux');
|
|
14
14
|
var index = require('./index-30126fd0.js');
|
|
15
|
-
var value = require('@appbaseio/reactivecore/lib/actions/value');
|
|
16
15
|
|
|
16
|
+
var setSearchState = configureStore.Actions.setSearchState;
|
|
17
17
|
var getSearchState = configureStore.helper.getSearchState;
|
|
18
18
|
var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
|
|
19
19
|
var filterProps = function filterProps(props) {
|
|
@@ -24,6 +24,15 @@ var filterProps = function filterProps(props) {
|
|
|
24
24
|
props: props.componentProps
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
+
var convertArrayLike = function convertArrayLike(arrayLike) {
|
|
28
|
+
var arr = [];
|
|
29
|
+
var i = 0;
|
|
30
|
+
while (arrayLike[i]) {
|
|
31
|
+
arr[i] = arrayLike[i];
|
|
32
|
+
i += 1;
|
|
33
|
+
}
|
|
34
|
+
return arr;
|
|
35
|
+
};
|
|
27
36
|
var filterByComponentIds = function filterByComponentIds(state, props) {
|
|
28
37
|
if (props === void 0) {
|
|
29
38
|
props = {};
|
|
@@ -185,21 +194,28 @@ var StateProvider = {
|
|
|
185
194
|
}
|
|
186
195
|
},
|
|
187
196
|
setSearchState: function setSearchState(valuesMap) {
|
|
197
|
+
var _this = this;
|
|
188
198
|
if (valuesMap === void 0) {
|
|
189
199
|
valuesMap = {};
|
|
190
200
|
}
|
|
191
201
|
var components = this.components;
|
|
192
202
|
var computedValuesMap = {};
|
|
193
|
-
components.filter(function (component) {
|
|
203
|
+
convertArrayLike(components).filter(function (component) {
|
|
194
204
|
return !transform.isInternalComponent(component);
|
|
195
205
|
}).forEach(function (component) {
|
|
196
206
|
if (component in valuesMap) {
|
|
197
|
-
computedValuesMap[component] =
|
|
207
|
+
computedValuesMap[component] = {
|
|
208
|
+
value: valuesMap[component],
|
|
209
|
+
componentProps: _this.componentProps[component]
|
|
210
|
+
};
|
|
198
211
|
} else {
|
|
199
|
-
computedValuesMap[component] =
|
|
212
|
+
computedValuesMap[component] = {
|
|
213
|
+
value: null,
|
|
214
|
+
componentProps: _this.componentProps[component]
|
|
215
|
+
};
|
|
200
216
|
}
|
|
201
217
|
});
|
|
202
|
-
this.
|
|
218
|
+
this.setSearchStateFn(computedValuesMap);
|
|
203
219
|
}
|
|
204
220
|
},
|
|
205
221
|
render: function render() {
|
|
@@ -229,7 +245,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
229
245
|
};
|
|
230
246
|
};
|
|
231
247
|
var mapDispatchtoProps = {
|
|
232
|
-
|
|
248
|
+
setSearchStateFn: setSearchState
|
|
233
249
|
};
|
|
234
250
|
var StateProviderConnected = index.connect(mapStateToProps, mapDispatchtoProps)(StateProvider);
|
|
235
251
|
StateProvider.install = function (Vue) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -26,16 +26,17 @@ require('./Card-240f283d.js');
|
|
|
26
26
|
require('./Flex-ddd7cb6b.js');
|
|
27
27
|
require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
28
28
|
require('appbase-js');
|
|
29
|
+
require('@appbaseio/analytics');
|
|
29
30
|
require('url-search-params-polyfill');
|
|
30
31
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
31
32
|
require('hotkeys-js');
|
|
32
|
-
var DataSearch = require('./DataSearch-
|
|
33
|
+
var DataSearch = require('./DataSearch-e4822dbf.js');
|
|
33
34
|
require('./CancelSvg-220a7cc3.js');
|
|
34
35
|
require('./Input-ead4cd84.js');
|
|
35
36
|
require('compute-scroll-into-view');
|
|
36
37
|
require('./Container-e699ea95.js');
|
|
37
38
|
require('vue-highlight-words');
|
|
38
|
-
var ReactiveComponent = require('./ReactiveComponent-
|
|
39
|
+
var ReactiveComponent = require('./ReactiveComponent-b8efb0cf.js');
|
|
39
40
|
require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
40
41
|
require('./FormControlList-bbb5cd24.js');
|
|
41
42
|
require('./utils-83fd01e9.js');
|
|
@@ -55,7 +56,6 @@ var RangeInput = require('./RangeInput.js');
|
|
|
55
56
|
var SelectedFilters = require('./SelectedFilters.js');
|
|
56
57
|
var ResultCard = require('./ResultCard.js');
|
|
57
58
|
var ResultList = require('./ResultList.js');
|
|
58
|
-
require('@appbaseio/reactivecore/lib/actions/value');
|
|
59
59
|
var StateProvider = require('./StateProvider.js');
|
|
60
60
|
require('gmap-vue');
|
|
61
61
|
require('ngeohash');
|
package/dist/cjs/install.js
CHANGED
|
@@ -26,16 +26,17 @@ require('./Card-240f283d.js');
|
|
|
26
26
|
require('./Flex-ddd7cb6b.js');
|
|
27
27
|
require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
28
28
|
require('appbase-js');
|
|
29
|
+
require('@appbaseio/analytics');
|
|
29
30
|
require('url-search-params-polyfill');
|
|
30
31
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
31
32
|
require('hotkeys-js');
|
|
32
|
-
var DataSearch = require('./DataSearch-
|
|
33
|
+
var DataSearch = require('./DataSearch-e4822dbf.js');
|
|
33
34
|
require('./CancelSvg-220a7cc3.js');
|
|
34
35
|
require('./Input-ead4cd84.js');
|
|
35
36
|
require('compute-scroll-into-view');
|
|
36
37
|
require('./Container-e699ea95.js');
|
|
37
38
|
require('vue-highlight-words');
|
|
38
|
-
var ReactiveComponent = require('./ReactiveComponent-
|
|
39
|
+
var ReactiveComponent = require('./ReactiveComponent-b8efb0cf.js');
|
|
39
40
|
require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
40
41
|
require('./FormControlList-bbb5cd24.js');
|
|
41
42
|
require('./utils-83fd01e9.js');
|
|
@@ -55,7 +56,6 @@ var RangeInput = require('./RangeInput.js');
|
|
|
55
56
|
var SelectedFilters = require('./SelectedFilters.js');
|
|
56
57
|
var ResultCard = require('./ResultCard.js');
|
|
57
58
|
var ResultList = require('./ResultList.js');
|
|
58
|
-
require('@appbaseio/reactivecore/lib/actions/value');
|
|
59
59
|
var StateProvider = require('./StateProvider.js');
|
|
60
60
|
|
|
61
61
|
var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, DataSearch.DataSearch, ReactiveComponent.SearchBox, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.ReactiveComponent, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default];
|
package/dist/cjs/version.js
CHANGED
|
@@ -945,10 +945,11 @@ var DataSearch = {
|
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
this.handleTextChange = debounce(this.handleText, this.$props.debounce);
|
|
948
|
+
this.updateDefaultQueryHandlerDebounced = debounce(this.updateDefaultQueryHandler, this.$props.debounce);
|
|
948
949
|
// Set custom and default queries in store
|
|
949
950
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
950
951
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
951
|
-
this.
|
|
952
|
+
this.updateDefaultQueryHandlerDebounced(this.currentValue, this.$props, false);
|
|
952
953
|
},
|
|
953
954
|
computed: {
|
|
954
955
|
suggestionsList: function suggestionsList() {
|
|
@@ -1133,7 +1134,7 @@ var DataSearch = {
|
|
|
1133
1134
|
},
|
|
1134
1135
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
1135
1136
|
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
1136
|
-
this.
|
|
1137
|
+
this.updateDefaultQueryHandlerDebounced(this.$data.currentValue, this.$props);
|
|
1137
1138
|
}
|
|
1138
1139
|
},
|
|
1139
1140
|
customQuery: function customQuery(newVal, oldVal) {
|
|
@@ -1169,9 +1170,9 @@ var DataSearch = {
|
|
|
1169
1170
|
methods: {
|
|
1170
1171
|
handleText: function handleText(value) {
|
|
1171
1172
|
if (this.$props.autosuggest) {
|
|
1172
|
-
this.
|
|
1173
|
+
this.updateDefaultQueryHandlerDebounced(value, this.$props);
|
|
1173
1174
|
} else {
|
|
1174
|
-
this.
|
|
1175
|
+
this.updateDefaultQueryHandlerDebounced(this.$props.componentId, value, this.$props);
|
|
1175
1176
|
}
|
|
1176
1177
|
},
|
|
1177
1178
|
validateDataField: function validateDataField() {
|
|
@@ -1312,7 +1313,7 @@ var DataSearch = {
|
|
|
1312
1313
|
if (toggleIsOpen) {
|
|
1313
1314
|
_this.isOpen = false;
|
|
1314
1315
|
}
|
|
1315
|
-
if (typeof value === 'string') _this.
|
|
1316
|
+
if (typeof value === 'string') _this.updateDefaultQueryHandlerDebounced(value, _this.$props);
|
|
1316
1317
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1317
1318
|
// to set the query otherwise the value should reset
|
|
1318
1319
|
|
|
@@ -1346,6 +1347,9 @@ var DataSearch = {
|
|
|
1346
1347
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1347
1348
|
},
|
|
1348
1349
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
|
|
1350
|
+
if (props === void 0) {
|
|
1351
|
+
props = this.$props;
|
|
1352
|
+
}
|
|
1349
1353
|
if (!value && props.enableDefaultSuggestions === false) {
|
|
1350
1354
|
// clear Component data from store
|
|
1351
1355
|
this.resetStoreForComponent(props.componentId);
|
|
@@ -1478,7 +1482,7 @@ var DataSearch = {
|
|
|
1478
1482
|
if (_this2.$options.isTagsMode && autosuggest) {
|
|
1479
1483
|
_this2.currentValue = value;
|
|
1480
1484
|
_this2.isOpen = isOpen;
|
|
1481
|
-
_this2.
|
|
1485
|
+
_this2.updateDefaultQueryHandlerDebounced(_this2.currentValue, _this2.$props);
|
|
1482
1486
|
return;
|
|
1483
1487
|
}
|
|
1484
1488
|
_this2.triggerQuery({
|
package/dist/es/DataSearch.js
CHANGED
|
@@ -15,7 +15,7 @@ import './PreferencesConsumer-bc097ebb.js';
|
|
|
15
15
|
import './Title-863dfa42.js';
|
|
16
16
|
import './Flex-7c177a10.js';
|
|
17
17
|
import 'hotkeys-js';
|
|
18
|
-
export { D as DSConnected, a as default } from './DataSearch-
|
|
18
|
+
export { D as DSConnected, a as default } from './DataSearch-5ddfba23.js';
|
|
19
19
|
import './CancelSvg-e40552a5.js';
|
|
20
20
|
import './Input-c09c0b56.js';
|
|
21
21
|
import 'compute-scroll-into-view';
|
package/dist/es/MultiRange.js
CHANGED
|
@@ -150,7 +150,13 @@ var MultiRange = {
|
|
|
150
150
|
},
|
|
151
151
|
selectedValue: function selectedValue(newVal) {
|
|
152
152
|
if (!isEqual(this.$data.currentValue, newVal)) {
|
|
153
|
-
|
|
153
|
+
var processSelectedValues = newVal ? newVal.map(function (item) {
|
|
154
|
+
if (typeof item === 'object' && 'label' in item) {
|
|
155
|
+
return item.label;
|
|
156
|
+
}
|
|
157
|
+
return item;
|
|
158
|
+
}) : null;
|
|
159
|
+
this.selectItem(processSelectedValues, true, undefined, true);
|
|
154
160
|
}
|
|
155
161
|
},
|
|
156
162
|
customQuery: function customQuery(newVal, oldVal) {
|
package/dist/es/ReactiveBase.js
CHANGED
|
@@ -10,6 +10,7 @@ import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './i
|
|
|
10
10
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
11
11
|
import { updateAnalyticsConfig } from '@appbaseio/reactivecore/lib/actions/analytics';
|
|
12
12
|
import Appbase from 'appbase-js';
|
|
13
|
+
import AppbaseAnalytics from '@appbaseio/analytics';
|
|
13
14
|
import 'url-search-params-polyfill';
|
|
14
15
|
|
|
15
16
|
var Provider = {
|
|
@@ -24,11 +25,16 @@ var Provider = {
|
|
|
24
25
|
}
|
|
25
26
|
return true;
|
|
26
27
|
}
|
|
28
|
+
},
|
|
29
|
+
analyticsRef: {
|
|
30
|
+
type: Object,
|
|
31
|
+
required: true
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
34
|
provide: function provide() {
|
|
30
35
|
return {
|
|
31
|
-
$$store: this.store
|
|
36
|
+
$$store: this.store,
|
|
37
|
+
$analytics: this.analyticsRef
|
|
32
38
|
};
|
|
33
39
|
},
|
|
34
40
|
render: function render(h) {
|
|
@@ -477,6 +483,27 @@ var ReactiveBase = {
|
|
|
477
483
|
if (this.$props.transformResponse) {
|
|
478
484
|
appbaseRef.transformResponse = this.$props.transformResponse;
|
|
479
485
|
}
|
|
486
|
+
var analyticsInitConfig = {
|
|
487
|
+
url: url && url.replace(/\/\/.*@/, '//'),
|
|
488
|
+
credentials: appbaseRef.credentials,
|
|
489
|
+
// When endpoint prop is used index is not defined, so we use _default
|
|
490
|
+
index: appbaseRef.app || '_default',
|
|
491
|
+
globalCustomEvents: this.$props.appbaseConfig && this.$props.appbaseConfig.customEvents
|
|
492
|
+
};
|
|
493
|
+
try {
|
|
494
|
+
if (this.$props.endpoint && this.$props.endpoint.url) {
|
|
495
|
+
// Remove parts between '//' and first '/' in the url
|
|
496
|
+
analyticsInitConfig.url = this.$props.endpoint.url.replace(/\/\/(.*?)\/.*/, '//$1');
|
|
497
|
+
var headerCredentials = this.$props.endpoint.headers && this.$props.endpoint.headers.Authorization;
|
|
498
|
+
analyticsInitConfig.credentials = headerCredentials && headerCredentials.replace('Basic ', '');
|
|
499
|
+
// Decode the credentials
|
|
500
|
+
analyticsInitConfig.credentials = analyticsInitConfig.credentials && atob(analyticsInitConfig.credentials);
|
|
501
|
+
}
|
|
502
|
+
} catch (e) {
|
|
503
|
+
console.error('Endpoint not set correctly for analytics');
|
|
504
|
+
console.error(e);
|
|
505
|
+
}
|
|
506
|
+
var analyticsRef = AppbaseAnalytics.init(analyticsInitConfig);
|
|
480
507
|
var initialState = _extends({
|
|
481
508
|
config: _extends({}, config, {
|
|
482
509
|
initialQueriesSyncTime: props.initialQueriesSyncTime,
|
|
@@ -485,11 +512,13 @@ var ReactiveBase = {
|
|
|
485
512
|
themePreset: themePreset
|
|
486
513
|
}),
|
|
487
514
|
appbaseRef: appbaseRef,
|
|
515
|
+
analyticsRef: analyticsRef,
|
|
488
516
|
selectedValues: selectedValues,
|
|
489
517
|
urlValues: urlValues,
|
|
490
518
|
headers: this.getHeaders
|
|
491
519
|
}, this.$props.initialState);
|
|
492
520
|
this.store = configureStore(initialState);
|
|
521
|
+
this.analyticsRef = analyticsRef;
|
|
493
522
|
}
|
|
494
523
|
},
|
|
495
524
|
render: function render() {
|
|
@@ -500,7 +529,8 @@ var ReactiveBase = {
|
|
|
500
529
|
className = _this$$props2.className;
|
|
501
530
|
return h(Provider, {
|
|
502
531
|
"attrs": {
|
|
503
|
-
"store": this.store
|
|
532
|
+
"store": this.store,
|
|
533
|
+
"analyticsRef": this.analyticsRef
|
|
504
534
|
}
|
|
505
535
|
}, [h(URLParamsProvider$1, {
|
|
506
536
|
"attrs": {
|
|
@@ -12,7 +12,7 @@ import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
|
|
|
12
12
|
import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
|
|
13
13
|
import { T as Title } from './Title-863dfa42.js';
|
|
14
14
|
import hotkeys from 'hotkeys-js';
|
|
15
|
-
import { S as SearchSvg, b as SuggestionWrapper, I as InputAddon, M as Mic, T as TagItem, c as TagsContainer, d as InputGroup, C as CustomSvg, e as SuggestionItem, D as DSConnected } from './DataSearch-
|
|
15
|
+
import { S as SearchSvg, b as SuggestionWrapper, I as InputAddon, M as Mic, T as TagItem, c as TagsContainer, d as InputGroup, C as CustomSvg, e as SuggestionItem, D as DSConnected } from './DataSearch-5ddfba23.js';
|
|
16
16
|
import { C as CancelSvg, a as IconGroup, I as IconWrapper, D as Downshift, b as InputWrapper } from './CancelSvg-e40552a5.js';
|
|
17
17
|
import { s as suggestionsContainer, I as Input, a as suggestions } from './Input-c09c0b56.js';
|
|
18
18
|
import { C as Container } from './Container-d00219f7.js';
|
|
@@ -21,13 +21,13 @@ import './ListItem-07888a65.js';
|
|
|
21
21
|
import './Card-19ad6d90.js';
|
|
22
22
|
import './Flex-7c177a10.js';
|
|
23
23
|
import 'hotkeys-js';
|
|
24
|
-
import './DataSearch-
|
|
24
|
+
import './DataSearch-5ddfba23.js';
|
|
25
25
|
import './CancelSvg-e40552a5.js';
|
|
26
26
|
import './Input-c09c0b56.js';
|
|
27
27
|
import 'compute-scroll-into-view';
|
|
28
28
|
import './Container-d00219f7.js';
|
|
29
29
|
import 'vue-highlight-words';
|
|
30
|
-
export { R as default } from './ReactiveComponent-
|
|
30
|
+
export { R as default } from './ReactiveComponent-59107264.js';
|
|
31
31
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
32
32
|
import './FormControlList-99797d0a.js';
|
|
33
33
|
import './utils-9e5a16a1.js';
|
package/dist/es/StateProvider.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { helper } from '@appbaseio/reactivecore';
|
|
1
|
+
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
3
|
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
5
5
|
import { isInternalComponent } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
6
6
|
import 'redux';
|
|
7
7
|
import { c as connect } from './index-0444a498.js';
|
|
8
|
-
import { setValues } from '@appbaseio/reactivecore/lib/actions/value';
|
|
9
8
|
|
|
9
|
+
var setSearchState = Actions.setSearchState;
|
|
10
10
|
var getSearchState = helper.getSearchState;
|
|
11
11
|
var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
|
|
12
12
|
var filterProps = function filterProps(props) {
|
|
@@ -17,6 +17,15 @@ var filterProps = function filterProps(props) {
|
|
|
17
17
|
props: props.componentProps
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
+
var convertArrayLike = function convertArrayLike(arrayLike) {
|
|
21
|
+
var arr = [];
|
|
22
|
+
var i = 0;
|
|
23
|
+
while (arrayLike[i]) {
|
|
24
|
+
arr[i] = arrayLike[i];
|
|
25
|
+
i += 1;
|
|
26
|
+
}
|
|
27
|
+
return arr;
|
|
28
|
+
};
|
|
20
29
|
var filterByComponentIds = function filterByComponentIds(state, props) {
|
|
21
30
|
if (props === void 0) {
|
|
22
31
|
props = {};
|
|
@@ -178,21 +187,28 @@ var StateProvider = {
|
|
|
178
187
|
}
|
|
179
188
|
},
|
|
180
189
|
setSearchState: function setSearchState(valuesMap) {
|
|
190
|
+
var _this = this;
|
|
181
191
|
if (valuesMap === void 0) {
|
|
182
192
|
valuesMap = {};
|
|
183
193
|
}
|
|
184
194
|
var components = this.components;
|
|
185
195
|
var computedValuesMap = {};
|
|
186
|
-
components.filter(function (component) {
|
|
196
|
+
convertArrayLike(components).filter(function (component) {
|
|
187
197
|
return !isInternalComponent(component);
|
|
188
198
|
}).forEach(function (component) {
|
|
189
199
|
if (component in valuesMap) {
|
|
190
|
-
computedValuesMap[component] =
|
|
200
|
+
computedValuesMap[component] = {
|
|
201
|
+
value: valuesMap[component],
|
|
202
|
+
componentProps: _this.componentProps[component]
|
|
203
|
+
};
|
|
191
204
|
} else {
|
|
192
|
-
computedValuesMap[component] =
|
|
205
|
+
computedValuesMap[component] = {
|
|
206
|
+
value: null,
|
|
207
|
+
componentProps: _this.componentProps[component]
|
|
208
|
+
};
|
|
193
209
|
}
|
|
194
210
|
});
|
|
195
|
-
this.
|
|
211
|
+
this.setSearchStateFn(computedValuesMap);
|
|
196
212
|
}
|
|
197
213
|
},
|
|
198
214
|
render: function render() {
|
|
@@ -222,7 +238,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
222
238
|
};
|
|
223
239
|
};
|
|
224
240
|
var mapDispatchtoProps = {
|
|
225
|
-
|
|
241
|
+
setSearchStateFn: setSearchState
|
|
226
242
|
};
|
|
227
243
|
var StateProviderConnected = connect(mapStateToProps, mapDispatchtoProps)(StateProvider);
|
|
228
244
|
StateProvider.install = function (Vue) {
|
package/dist/es/index.js
CHANGED
|
@@ -22,16 +22,17 @@ import './Card-19ad6d90.js';
|
|
|
22
22
|
import './Flex-7c177a10.js';
|
|
23
23
|
import '@appbaseio/reactivecore/lib/actions/analytics';
|
|
24
24
|
import 'appbase-js';
|
|
25
|
+
import '@appbaseio/analytics';
|
|
25
26
|
import 'url-search-params-polyfill';
|
|
26
27
|
export { default as ReactiveBase } from './ReactiveBase.js';
|
|
27
28
|
import 'hotkeys-js';
|
|
28
|
-
export { a as DataSearch } from './DataSearch-
|
|
29
|
+
export { a as DataSearch } from './DataSearch-5ddfba23.js';
|
|
29
30
|
import './CancelSvg-e40552a5.js';
|
|
30
31
|
import './Input-c09c0b56.js';
|
|
31
32
|
import 'compute-scroll-into-view';
|
|
32
33
|
import './Container-d00219f7.js';
|
|
33
34
|
import 'vue-highlight-words';
|
|
34
|
-
export { R as ReactiveComponent, S as SearchBox } from './ReactiveComponent-
|
|
35
|
+
export { R as ReactiveComponent, S as SearchBox } from './ReactiveComponent-59107264.js';
|
|
35
36
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
36
37
|
import './FormControlList-99797d0a.js';
|
|
37
38
|
import './utils-9e5a16a1.js';
|
|
@@ -51,7 +52,6 @@ export { default as RangeInput } from './RangeInput.js';
|
|
|
51
52
|
export { default as SelectedFilters } from './SelectedFilters.js';
|
|
52
53
|
export { default as ResultCard } from './ResultCard.js';
|
|
53
54
|
export { default as ResultList } from './ResultList.js';
|
|
54
|
-
import '@appbaseio/reactivecore/lib/actions/value';
|
|
55
55
|
export { default as StateProvider } from './StateProvider.js';
|
|
56
56
|
import 'gmap-vue';
|
|
57
57
|
import 'ngeohash';
|
package/dist/es/install.js
CHANGED
|
@@ -22,16 +22,17 @@ import './Card-19ad6d90.js';
|
|
|
22
22
|
import './Flex-7c177a10.js';
|
|
23
23
|
import '@appbaseio/reactivecore/lib/actions/analytics';
|
|
24
24
|
import 'appbase-js';
|
|
25
|
+
import '@appbaseio/analytics';
|
|
25
26
|
import 'url-search-params-polyfill';
|
|
26
27
|
import ReactiveBase from './ReactiveBase.js';
|
|
27
28
|
import 'hotkeys-js';
|
|
28
|
-
import { a as DataSearch } from './DataSearch-
|
|
29
|
+
import { a as DataSearch } from './DataSearch-5ddfba23.js';
|
|
29
30
|
import './CancelSvg-e40552a5.js';
|
|
30
31
|
import './Input-c09c0b56.js';
|
|
31
32
|
import 'compute-scroll-into-view';
|
|
32
33
|
import './Container-d00219f7.js';
|
|
33
34
|
import 'vue-highlight-words';
|
|
34
|
-
import { S as SearchBox, R as ReactiveComponent } from './ReactiveComponent-
|
|
35
|
+
import { S as SearchBox, R as ReactiveComponent } from './ReactiveComponent-59107264.js';
|
|
35
36
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
36
37
|
import './FormControlList-99797d0a.js';
|
|
37
38
|
import './utils-9e5a16a1.js';
|
|
@@ -51,7 +52,6 @@ import RangeInput from './RangeInput.js';
|
|
|
51
52
|
import SelectedFilters from './SelectedFilters.js';
|
|
52
53
|
import ResultCard from './ResultCard.js';
|
|
53
54
|
import ResultList from './ResultList.js';
|
|
54
|
-
import '@appbaseio/reactivecore/lib/actions/value';
|
|
55
55
|
import StateProvider from './StateProvider.js';
|
|
56
56
|
|
|
57
57
|
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SearchBox, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
|
package/dist/es/version.js
CHANGED