@appbaseio/reactivesearch-vue 1.16.0-alpha.22 → 1.16.0-alpha.26
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 +335 -116
- 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/DataSearch.js +2 -2
- package/dist/cjs/{DropDown-d3c78c41.js → DropDown-323d7048.js} +1 -1
- package/dist/cjs/DynamicRangeSlider.js +1 -1
- package/dist/cjs/MultiDropdownList.js +2 -2
- package/dist/cjs/MultiList.js +1 -1
- package/dist/cjs/MultiRange.js +1 -1
- package/dist/cjs/{Pagination-d4dbfd5a.js → Pagination-0b9ec0fc.js} +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/RangeSlider.js +1 -1
- package/dist/cjs/ReactiveBase.js +14 -8
- package/dist/cjs/ReactiveComponent.js +12 -12
- package/dist/cjs/ReactiveGoogleMap.js +2 -2
- package/dist/cjs/ReactiveList.js +58 -54
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +1 -1
- package/dist/cjs/SingleDropdownList.js +2 -2
- package/dist/cjs/SingleList.js +1 -1
- package/dist/cjs/SingleRange.js +1 -1
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/ToggleButton.js +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/initReactivesearch.js +15 -14
- package/dist/cjs/install.js +4 -4
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-409348b0.js → vueTypes-829a5f2c.js} +5 -1
- package/dist/es/DataSearch.js +2 -2
- package/dist/es/{DropDown-8894cc22.js → DropDown-c4ef3292.js} +1 -1
- package/dist/es/DynamicRangeSlider.js +1 -1
- package/dist/es/MultiDropdownList.js +2 -2
- package/dist/es/MultiList.js +1 -1
- package/dist/es/MultiRange.js +1 -1
- package/dist/es/{Pagination-a2ab7fcb.js → Pagination-e8216949.js} +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/RangeSlider.js +1 -1
- package/dist/es/ReactiveBase.js +14 -8
- package/dist/es/ReactiveComponent.js +12 -12
- package/dist/es/ReactiveGoogleMap.js +2 -2
- package/dist/es/ReactiveList.js +58 -54
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +1 -1
- package/dist/es/SingleDropdownList.js +2 -2
- package/dist/es/SingleList.js +1 -1
- package/dist/es/SingleRange.js +1 -1
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/ToggleButton.js +1 -1
- package/dist/es/index.js +4 -4
- package/dist/es/initReactivesearch.js +15 -14
- package/dist/es/install.js +4 -4
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-a9b9d5c9.js → vueTypes-98819a12.js} +5 -1
- package/package.json +3 -3
|
@@ -6,8 +6,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
6
6
|
|
|
7
7
|
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.js');
|
|
8
8
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
9
|
-
var transform = require('@appbaseio/reactivecore/lib/utils/transform');
|
|
10
9
|
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
10
|
+
var transform = require('@appbaseio/reactivecore/lib/utils/transform');
|
|
11
11
|
var Appbase = _interopDefault(require('appbase-js'));
|
|
12
12
|
var valueReducer = _interopDefault(require('@appbaseio/reactivecore/lib/reducers/valueReducer'));
|
|
13
13
|
var queryReducer = _interopDefault(require('@appbaseio/reactivecore/lib/reducers/queryReducer'));
|
|
@@ -122,16 +122,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
122
122
|
compProps[key] = component[key];
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
var isInternalComponentPresent = false;
|
|
126
|
-
|
|
127
|
-
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
128
|
-
customQueries[component.componentId] = component.customQuery(component.value, compProps);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
132
|
-
defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
|
|
133
|
-
}
|
|
134
|
-
|
|
125
|
+
var isInternalComponentPresent = false;
|
|
135
126
|
var isResultComponent = resultComponents.includes(componentType);
|
|
136
127
|
var internalComponent = component.componentId + "__internal";
|
|
137
128
|
var label = component.filterLabel || component.componentId;
|
|
@@ -155,7 +146,16 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
155
146
|
reference: reference,
|
|
156
147
|
showFilter: showFilter,
|
|
157
148
|
URLParams: component.URLParams || false
|
|
158
|
-
}); //
|
|
149
|
+
}); // Set custom and default queries
|
|
150
|
+
|
|
151
|
+
if (component.customQuery && typeof component.customQuery === 'function') {
|
|
152
|
+
customQueries[component.componentId] = component.customQuery(value, compProps);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (component.defaultQuery && typeof component.defaultQuery === 'function') {
|
|
156
|
+
defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
|
|
157
|
+
} // [2] set query options - main component query (valid for result components)
|
|
158
|
+
|
|
159
159
|
|
|
160
160
|
if (componentsWithOptions.includes(componentType)) {
|
|
161
161
|
var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
|
|
@@ -242,7 +242,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
242
242
|
|
|
243
243
|
|
|
244
244
|
if (isResultComponent) {
|
|
245
|
-
var _getQuery = getQuery(component,
|
|
245
|
+
var _getQuery = getQuery(component, value, componentType),
|
|
246
246
|
query = _getQuery.query;
|
|
247
247
|
|
|
248
248
|
queryList = queryReducer(queryList, {
|
|
@@ -313,8 +313,9 @@ function initReactivesearch(componentCollection, searchState, settings) {
|
|
|
313
313
|
appbaseQuery = _rollupPluginBabelHelpers._extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), transform.getDependentQueries(state, component.componentId, orderOfQueries));
|
|
314
314
|
}
|
|
315
315
|
} else {
|
|
316
|
+
var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
|
|
316
317
|
finalQuery = [].concat(finalQuery, [{
|
|
317
|
-
preference:
|
|
318
|
+
preference: preference
|
|
318
319
|
}, currentQuery]);
|
|
319
320
|
}
|
|
320
321
|
}
|
package/dist/cjs/install.js
CHANGED
|
@@ -6,12 +6,13 @@ require('@appbaseio/reactivecore');
|
|
|
6
6
|
require('./_rollupPluginBabelHelpers-4abdbfff.js');
|
|
7
7
|
require('vue-types');
|
|
8
8
|
require('@appbaseio/reactivecore/lib/utils/constants');
|
|
9
|
+
require('@appbaseio/reactivecore/lib/utils/helper');
|
|
9
10
|
require('emotion');
|
|
10
11
|
require('@appbaseio/vue-emotion');
|
|
11
12
|
require('polished');
|
|
12
13
|
require('./Button-d2f1aeda.js');
|
|
13
|
-
require('./vueTypes-
|
|
14
|
-
require('./Pagination-
|
|
14
|
+
require('./vueTypes-829a5f2c.js');
|
|
15
|
+
require('./Pagination-0b9ec0fc.js');
|
|
15
16
|
var ReactiveList = require('./ReactiveList.js');
|
|
16
17
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
17
18
|
require('redux');
|
|
@@ -22,7 +23,6 @@ require('./Title-39765ee6.js');
|
|
|
22
23
|
require('./ListItem-933c27e4.js');
|
|
23
24
|
require('./Card-4b915733.js');
|
|
24
25
|
require('./Flex-699639d2.js');
|
|
25
|
-
require('@appbaseio/reactivecore/lib/utils/helper');
|
|
26
26
|
require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
27
27
|
require('appbase-js');
|
|
28
28
|
require('url-search-params-polyfill');
|
|
@@ -38,7 +38,7 @@ require('./FormControlList-73497794.js');
|
|
|
38
38
|
require('./utils-23afb20b.js');
|
|
39
39
|
var SingleList = require('./SingleList.js');
|
|
40
40
|
var MultiList = require('./MultiList.js');
|
|
41
|
-
require('./DropDown-
|
|
41
|
+
require('./DropDown-323d7048.js');
|
|
42
42
|
var SingleDropdownList = require('./SingleDropdownList.js');
|
|
43
43
|
var MultiDropdownList = require('./MultiDropdownList.js');
|
|
44
44
|
var ToggleButton = require('./ToggleButton.js');
|
package/dist/cjs/version.js
CHANGED
|
@@ -125,7 +125,11 @@ var types = {
|
|
|
125
125
|
userId: VueTypes.string,
|
|
126
126
|
customEvents: VueTypes.object,
|
|
127
127
|
enableTelemetry: VueTypes.bool.def(true)
|
|
128
|
-
}).def({})
|
|
128
|
+
}).def({}),
|
|
129
|
+
mongodb: VueTypes.shape({
|
|
130
|
+
db: VueTypes.string,
|
|
131
|
+
collection: VueTypes.string
|
|
132
|
+
})
|
|
129
133
|
};
|
|
130
134
|
|
|
131
135
|
exports.types = types;
|
package/dist/es/DataSearch.js
CHANGED
|
@@ -2,17 +2,17 @@ import { helper, Actions, causes } from '@appbaseio/reactivecore';
|
|
|
2
2
|
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
+
import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
5
6
|
import 'emotion';
|
|
6
7
|
import styled, { css, cx, injectGlobal } from '@appbaseio/vue-emotion';
|
|
7
8
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
9
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
9
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
11
|
import 'redux';
|
|
11
12
|
import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, j as getQuerySuggestionsComponent, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, m as hasQuerySuggestionsRenderer, c as connect } from './index-4755c9a0.js';
|
|
12
13
|
import { C as ComponentWrapper } from './ComponentWrapper-459505fd.js';
|
|
13
14
|
import { T as Title } from './Title-579f8d6c.js';
|
|
14
15
|
import { F as Flex } from './Flex-aac91505.js';
|
|
15
|
-
import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
16
16
|
import hotkeys from 'hotkeys-js';
|
|
17
17
|
import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-d8519224.js';
|
|
18
18
|
import 'compute-scroll-into-view';
|
|
@@ -3,7 +3,7 @@ import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPlugin
|
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { css } from 'emotion';
|
|
5
5
|
import styled from '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
7
7
|
import { a as isFunction } from './index-4755c9a0.js';
|
|
8
8
|
import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-d8519224.js';
|
|
9
9
|
import { D as Downshift } from './DownShift-e7ccf2a7.js';
|
|
@@ -3,7 +3,7 @@ import { a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
7
7
|
import 'redux';
|
|
8
8
|
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-4755c9a0.js';
|
|
9
9
|
import { T as Title } from './Title-579f8d6c.js';
|
|
@@ -6,7 +6,7 @@ import 'emotion';
|
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
8
|
import { l as loadMoreContainer, B as Button } from './Button-799185e2.js';
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
9
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
10
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
11
11
|
import 'redux';
|
|
12
12
|
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-4755c9a0.js';
|
|
@@ -17,7 +17,7 @@ import 'compute-scroll-into-view';
|
|
|
17
17
|
import './DownShift-e7ccf2a7.js';
|
|
18
18
|
import { C as Container } from './Container-4383c6f0.js';
|
|
19
19
|
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
20
|
-
import { D as Dropdown } from './DropDown-
|
|
20
|
+
import { D as Dropdown } from './DropDown-c4ef3292.js';
|
|
21
21
|
|
|
22
22
|
var updateQuery = Actions.updateQuery,
|
|
23
23
|
setQueryOptions = Actions.setQueryOptions,
|
package/dist/es/MultiList.js
CHANGED
|
@@ -5,7 +5,7 @@ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
11
|
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, n as isEvent, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-4755c9a0.js';
|
package/dist/es/MultiRange.js
CHANGED
|
@@ -5,7 +5,7 @@ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
11
|
import { o as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4755c9a0.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import VueTypes from 'vue-types';
|
|
3
3
|
import { p as pagination, B as Button } from './Button-799185e2.js';
|
|
4
|
-
import { t as types } from './vueTypes-
|
|
4
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
5
5
|
|
|
6
6
|
var getClassName = helper.getClassName,
|
|
7
7
|
handleA11yAction = helper.handleA11yAction;
|
package/dist/es/RangeInput.js
CHANGED
|
@@ -5,7 +5,7 @@ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
|
5
5
|
import { css } from 'emotion';
|
|
6
6
|
import styled from '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
11
|
import { c as connect } from './index-4755c9a0.js';
|
package/dist/es/RangeSlider.js
CHANGED
|
@@ -3,7 +3,7 @@ import { a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
7
7
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
8
8
|
import 'redux';
|
|
9
9
|
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4755c9a0.js';
|
package/dist/es/ReactiveBase.js
CHANGED
|
@@ -2,12 +2,12 @@ import configureStore, { Actions, helper } from '@appbaseio/reactivecore';
|
|
|
2
2
|
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
+
import { isEqual as isEqual$1 } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
5
6
|
import styled from '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
7
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
7
8
|
import 'redux';
|
|
8
9
|
import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-4755c9a0.js';
|
|
9
10
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
10
|
-
import { isEqual as isEqual$1 } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
11
11
|
import { updateAnalyticsConfig } from '@appbaseio/reactivecore/lib/actions/analytics';
|
|
12
12
|
import Appbase from 'appbase-js';
|
|
13
13
|
import 'url-search-params-polyfill';
|
|
@@ -350,7 +350,7 @@ var ReactiveBase = {
|
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
props: {
|
|
353
|
-
app: types.
|
|
353
|
+
app: types.string,
|
|
354
354
|
analytics: VueTypes.bool,
|
|
355
355
|
analyticsConfig: types.analyticsConfig,
|
|
356
356
|
appbaseConfig: types.appbaseConfig,
|
|
@@ -370,7 +370,8 @@ var ReactiveBase = {
|
|
|
370
370
|
transformResponse: types.func,
|
|
371
371
|
as: VueTypes.string.def('div'),
|
|
372
372
|
getSearchParams: types.func,
|
|
373
|
-
setSearchParams: types.func
|
|
373
|
+
setSearchParams: types.func,
|
|
374
|
+
mongodb: types.mongodb
|
|
374
375
|
},
|
|
375
376
|
provide: function provide() {
|
|
376
377
|
return {
|
|
@@ -410,6 +411,9 @@ var ReactiveBase = {
|
|
|
410
411
|
this.store.dispatch(updateAnalyticsConfig(newVal));
|
|
411
412
|
}
|
|
412
413
|
}
|
|
414
|
+
},
|
|
415
|
+
mongodb: function mongodb() {
|
|
416
|
+
this.updateState(this.$props);
|
|
413
417
|
}
|
|
414
418
|
},
|
|
415
419
|
computed: {
|
|
@@ -417,12 +421,13 @@ var ReactiveBase = {
|
|
|
417
421
|
var _this$$props = this.$props,
|
|
418
422
|
enableAppbase = _this$$props.enableAppbase,
|
|
419
423
|
headers = _this$$props.headers,
|
|
420
|
-
appbaseConfig = _this$$props.appbaseConfig
|
|
424
|
+
appbaseConfig = _this$$props.appbaseConfig,
|
|
425
|
+
mongodb = _this$$props.mongodb;
|
|
421
426
|
|
|
422
427
|
var _ref = appbaseConfig || {},
|
|
423
428
|
enableTelemetry = _ref.enableTelemetry;
|
|
424
429
|
|
|
425
|
-
return _extends({}, enableAppbase && _extends({
|
|
430
|
+
return _extends({}, enableAppbase && !mongodb && _extends({
|
|
426
431
|
'X-Search-Client': X_SEARCH_CLIENT
|
|
427
432
|
}, enableTelemetry === false && {
|
|
428
433
|
'X-Enable-Telemetry': false
|
|
@@ -440,7 +445,7 @@ var ReactiveBase = {
|
|
|
440
445
|
var appbaseConfig = _extends({}, props.analyticsConfig, props.appbaseConfig);
|
|
441
446
|
|
|
442
447
|
var config = {
|
|
443
|
-
url: props.url && props.url.trim() !== '' ? props.url : '
|
|
448
|
+
url: props.url && props.url.trim() !== '' ? props.url : '',
|
|
444
449
|
app: props.app,
|
|
445
450
|
credentials: credentials,
|
|
446
451
|
type: props.type ? props.type : '*',
|
|
@@ -448,7 +453,8 @@ var ReactiveBase = {
|
|
|
448
453
|
transformResponse: props.transformResponse,
|
|
449
454
|
enableAppbase: props.enableAppbase,
|
|
450
455
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
451
|
-
analyticsConfig: appbaseConfig
|
|
456
|
+
analyticsConfig: appbaseConfig,
|
|
457
|
+
mongodb: props.mongodb
|
|
452
458
|
};
|
|
453
459
|
var queryParams = '';
|
|
454
460
|
|
|
@@ -2,7 +2,7 @@ import { Actions, helper } from '@appbaseio/reactivecore';
|
|
|
2
2
|
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
-
import { t as types } from './vueTypes-
|
|
5
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
6
6
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
7
7
|
import 'redux';
|
|
8
8
|
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-4755c9a0.js';
|
|
@@ -45,7 +45,7 @@ var ReactiveComponent = {
|
|
|
45
45
|
this.internalComponent = null;
|
|
46
46
|
this.$defaultQuery = null; // Set custom query in store
|
|
47
47
|
|
|
48
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
48
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
49
49
|
var customQuery = props.customQuery,
|
|
50
50
|
componentId = props.componentId,
|
|
51
51
|
filterLabel = props.filterLabel,
|
|
@@ -68,7 +68,7 @@ var ReactiveComponent = {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (customQuery) {
|
|
71
|
-
var calcCustomQuery = customQuery(props);
|
|
71
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
72
72
|
|
|
73
73
|
var _ref = calcCustomQuery || {},
|
|
74
74
|
query = _ref.query;
|
|
@@ -87,7 +87,7 @@ var ReactiveComponent = {
|
|
|
87
87
|
|
|
88
88
|
this.updateQuery({
|
|
89
89
|
componentId: componentId,
|
|
90
|
-
|
|
90
|
+
query: queryToSet,
|
|
91
91
|
value: this.selectedValue || null,
|
|
92
92
|
label: filterLabel,
|
|
93
93
|
showFilter: showFilter,
|
|
@@ -138,8 +138,8 @@ var ReactiveComponent = {
|
|
|
138
138
|
},
|
|
139
139
|
beforeMount: function beforeMount() {
|
|
140
140
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
141
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
142
|
-
this.$defaultQuery = this.$props.defaultQuery();
|
|
141
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
142
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
143
143
|
|
|
144
144
|
var _ref3 = this.$defaultQuery || {},
|
|
145
145
|
query = _ref3.query,
|
|
@@ -203,8 +203,8 @@ var ReactiveComponent = {
|
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
205
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
206
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
207
|
-
this.$defaultQuery = newVal();
|
|
206
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
207
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
208
208
|
|
|
209
209
|
var _ref4 = this.$defaultQuery || {},
|
|
210
210
|
query = _ref4.query,
|
|
@@ -215,7 +215,7 @@ var ReactiveComponent = {
|
|
|
215
215
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
|
|
216
216
|
|
|
217
217
|
|
|
218
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props,
|
|
218
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
219
219
|
var queryToSet = query || null;
|
|
220
220
|
|
|
221
221
|
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
@@ -229,9 +229,9 @@ var ReactiveComponent = {
|
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
231
|
customQuery: function customQuery(newVal, oldVal) {
|
|
232
|
-
if (newVal && !isQueryIdentical(newVal, oldVal,
|
|
232
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
233
233
|
var componentId = this.$props.componentId;
|
|
234
|
-
this.$customQuery = newVal(this.$props);
|
|
234
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
235
235
|
|
|
236
236
|
var _ref5 = this.$customQuery || {},
|
|
237
237
|
query = _ref5.query,
|
|
@@ -242,7 +242,7 @@ var ReactiveComponent = {
|
|
|
242
242
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
|
|
243
243
|
|
|
244
244
|
|
|
245
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props,
|
|
245
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
246
246
|
var queryToSet = query || null;
|
|
247
247
|
|
|
248
248
|
if (this.$customQuery && this.$customQuery.id) {
|
|
@@ -6,8 +6,8 @@ import 'emotion';
|
|
|
6
6
|
import styled, { css } from '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
8
|
import './Button-799185e2.js';
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
10
|
-
import { P as Pagination } from './Pagination-
|
|
9
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
10
|
+
import { P as Pagination } from './Pagination-e8216949.js';
|
|
11
11
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
12
12
|
import 'redux';
|
|
13
13
|
import { h as hasCustomRenderer, i as isQueryIdentical, g as getComponent, a as isFunction, c as connect } from './index-4755c9a0.js';
|
package/dist/es/ReactiveList.js
CHANGED
|
@@ -2,12 +2,13 @@ import { Actions, helper } from '@appbaseio/reactivecore';
|
|
|
2
2
|
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
+
import { withClickIds } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
5
6
|
import { css } from 'emotion';
|
|
6
7
|
import styled from '@appbaseio/vue-emotion';
|
|
7
8
|
import 'polished';
|
|
8
9
|
import './Button-799185e2.js';
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
10
|
-
import { P as Pagination } from './Pagination-
|
|
10
|
+
import { t as types } from './vueTypes-98819a12.js';
|
|
11
|
+
import { P as Pagination } from './Pagination-e8216949.js';
|
|
11
12
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
12
13
|
import 'redux';
|
|
13
14
|
import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-4755c9a0.js';
|
|
@@ -273,18 +274,17 @@ var ReactiveList = {
|
|
|
273
274
|
ResultCardsWrapper: ResultCardsWrapper
|
|
274
275
|
},
|
|
275
276
|
data: function data() {
|
|
276
|
-
var props = this.$props;
|
|
277
277
|
var currentPageState = 0;
|
|
278
|
+
var defaultPage = this.defaultPage || -1;
|
|
278
279
|
|
|
279
|
-
if (
|
|
280
|
-
currentPageState =
|
|
281
|
-
} else if (
|
|
282
|
-
currentPageState = Math.max(
|
|
280
|
+
if (defaultPage >= 0) {
|
|
281
|
+
currentPageState = defaultPage;
|
|
282
|
+
} else if (this.currentPage) {
|
|
283
|
+
currentPageState = Math.max(this.currentPage - 1, 0);
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
this.__state = {
|
|
286
|
-
from: currentPageState *
|
|
287
|
-
isLoading: true,
|
|
287
|
+
from: currentPageState * this.size,
|
|
288
288
|
currentPageState: currentPageState
|
|
289
289
|
};
|
|
290
290
|
return this.__state;
|
|
@@ -313,8 +313,10 @@ var ReactiveList = {
|
|
|
313
313
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
var defaultPage = this.defaultPage || -1;
|
|
317
|
+
|
|
318
|
+
if (defaultPage >= 0) {
|
|
319
|
+
this.currentPageState = defaultPage;
|
|
318
320
|
this.from = this.currentPageState * this.$props.size;
|
|
319
321
|
}
|
|
320
322
|
|
|
@@ -381,12 +383,9 @@ var ReactiveList = {
|
|
|
381
383
|
return this.$listeners && this.$listeners.resultStats;
|
|
382
384
|
},
|
|
383
385
|
stats: function stats() {
|
|
384
|
-
var _this$getAllData = this.getAllData(),
|
|
385
|
-
filteredResults = _this$getAllData.filteredResults;
|
|
386
|
-
|
|
387
386
|
return _extends({}, getResultStats(this), {
|
|
388
387
|
currentPage: this.currentPageState,
|
|
389
|
-
displayedResults:
|
|
388
|
+
displayedResults: this.data.length
|
|
390
389
|
});
|
|
391
390
|
},
|
|
392
391
|
hasCustomRender: function hasCustomRender() {
|
|
@@ -395,6 +394,27 @@ var ReactiveList = {
|
|
|
395
394
|
showInfiniteScroll: function showInfiniteScroll() {
|
|
396
395
|
// Pagination has higher priority then infinite scroll
|
|
397
396
|
return this.infiniteScroll && !this.shouldRenderPagination;
|
|
397
|
+
},
|
|
398
|
+
data: function data() {
|
|
399
|
+
var results = parseHits(this.hits) || [];
|
|
400
|
+
var parsedPromotedResults = parseHits(this.promotedResults) || [];
|
|
401
|
+
var filteredResults = results;
|
|
402
|
+
|
|
403
|
+
if (parsedPromotedResults.length) {
|
|
404
|
+
var ids = parsedPromotedResults.map(function (item) {
|
|
405
|
+
return item._id;
|
|
406
|
+
}).filter(Boolean);
|
|
407
|
+
|
|
408
|
+
if (ids) {
|
|
409
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
410
|
+
return !ids.includes(item._id);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return withClickIds(filteredResults);
|
|
398
418
|
}
|
|
399
419
|
},
|
|
400
420
|
watch: {
|
|
@@ -476,7 +496,7 @@ var ReactiveList = {
|
|
|
476
496
|
}
|
|
477
497
|
},
|
|
478
498
|
hits: function hits(newVal, oldVal) {
|
|
479
|
-
this.$emit('data', this.
|
|
499
|
+
this.$emit('data', this.getData());
|
|
480
500
|
|
|
481
501
|
if (this.shouldRenderPagination) {
|
|
482
502
|
// called when page is changed
|
|
@@ -661,13 +681,10 @@ var ReactiveList = {
|
|
|
661
681
|
|
|
662
682
|
var h = this.$createElement;
|
|
663
683
|
var size = this.$props.size;
|
|
664
|
-
var hits = this.$data.hits;
|
|
665
|
-
var results = parseHits(hits) || [];
|
|
666
|
-
var filteredResults = results;
|
|
667
684
|
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
668
685
|
var element = this.hasCustomRender ? this.getComponent() : h("div", {
|
|
669
686
|
"class": this.$props.listClass + " " + getClassName(this.$props.innerClass, 'list')
|
|
670
|
-
}, [
|
|
687
|
+
}, [this.data.map(function (item, index) {
|
|
671
688
|
return renderItem({
|
|
672
689
|
item: item,
|
|
673
690
|
triggerClickAnalytics: function triggerClickAnalytics() {
|
|
@@ -678,7 +695,7 @@ var ReactiveList = {
|
|
|
678
695
|
|
|
679
696
|
return this.analytics ? h(ImpressionTracker$1, {
|
|
680
697
|
"attrs": {
|
|
681
|
-
"hits":
|
|
698
|
+
"hits": this.data
|
|
682
699
|
}
|
|
683
700
|
}, [element]) : element;
|
|
684
701
|
},
|
|
@@ -782,7 +799,7 @@ var ReactiveList = {
|
|
|
782
799
|
if (this.stats.numberOfResults) {
|
|
783
800
|
return h("p", {
|
|
784
801
|
"class": resultStats + " " + getClassName(this.$props.innerClass, 'resultStats')
|
|
785
|
-
}, [this.stats.numberOfResults, " results found in ", this.stats.time, "ms"]);
|
|
802
|
+
}, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
|
|
786
803
|
}
|
|
787
804
|
|
|
788
805
|
return null;
|
|
@@ -790,6 +807,11 @@ var ReactiveList = {
|
|
|
790
807
|
renderNoResult: function renderNoResult() {
|
|
791
808
|
var h = this.$createElement;
|
|
792
809
|
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
810
|
+
|
|
811
|
+
if (this.$scopedSlots.renderNoResults) {
|
|
812
|
+
return isFunction(renderNoResults) ? renderNoResults() : renderNoResults;
|
|
813
|
+
}
|
|
814
|
+
|
|
793
815
|
return h("p", {
|
|
794
816
|
"class": getClassName(this.$props.innerClass, 'noResults') || null
|
|
795
817
|
}, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
@@ -858,8 +880,8 @@ var ReactiveList = {
|
|
|
858
880
|
})]);
|
|
859
881
|
},
|
|
860
882
|
withClickIds: function withClickIds(results) {
|
|
861
|
-
var _this$
|
|
862
|
-
base = _this$
|
|
883
|
+
var _this$getAllData = this.getAllData(),
|
|
884
|
+
base = _this$getAllData.base;
|
|
863
885
|
|
|
864
886
|
return results.map(function (result, index) {
|
|
865
887
|
return _extends({}, result, {
|
|
@@ -877,26 +899,9 @@ var ReactiveList = {
|
|
|
877
899
|
hits = this.hits;
|
|
878
900
|
var results = parseHits(hits) || [];
|
|
879
901
|
var parsedPromotedResults = parseHits(promotedResults) || [];
|
|
880
|
-
var filteredResults = results;
|
|
881
902
|
var base = currentPage * size;
|
|
882
|
-
|
|
883
|
-
if (parsedPromotedResults.length) {
|
|
884
|
-
var ids = parsedPromotedResults.map(function (item) {
|
|
885
|
-
return item._id;
|
|
886
|
-
}).filter(Boolean);
|
|
887
|
-
|
|
888
|
-
if (ids) {
|
|
889
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
890
|
-
return !ids.includes(item._id);
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
filteredResults = [].concat(parsedPromotedResults, filteredResults);
|
|
895
|
-
}
|
|
896
|
-
|
|
897
903
|
return {
|
|
898
904
|
results: results,
|
|
899
|
-
filteredResults: filteredResults,
|
|
900
905
|
customData: customData || {},
|
|
901
906
|
promotedResults: parsedPromotedResults,
|
|
902
907
|
aggregationData: aggregationData,
|
|
@@ -906,16 +911,15 @@ var ReactiveList = {
|
|
|
906
911
|
};
|
|
907
912
|
},
|
|
908
913
|
getData: function getData() {
|
|
909
|
-
var _this$
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
customData = _this$getAllData3.customData;
|
|
914
|
+
var _this$getAllData2 = this.getAllData(),
|
|
915
|
+
promotedResults = _this$getAllData2.promotedResults,
|
|
916
|
+
aggregationData = _this$getAllData2.aggregationData,
|
|
917
|
+
customData = _this$getAllData2.customData;
|
|
914
918
|
|
|
915
919
|
return {
|
|
916
|
-
data: this.
|
|
920
|
+
data: this.data,
|
|
917
921
|
aggregationData: this.withClickIds(aggregationData || []),
|
|
918
|
-
promotedData: this.withClickIds(promotedResults),
|
|
922
|
+
promotedData: this.withClickIds(promotedResults || []),
|
|
919
923
|
rawData: this.rawData,
|
|
920
924
|
resultStats: this.stats,
|
|
921
925
|
customData: customData
|
|
@@ -927,7 +931,7 @@ var ReactiveList = {
|
|
|
927
931
|
|
|
928
932
|
var data = _extends({
|
|
929
933
|
error: error,
|
|
930
|
-
loading: isLoading,
|
|
934
|
+
loading: isLoading || false,
|
|
931
935
|
loadMore: this.loadMore,
|
|
932
936
|
// TODO: Remove in v2
|
|
933
937
|
triggerAnalytics: this.triggerClickAnalytics,
|
|
@@ -942,13 +946,13 @@ var ReactiveList = {
|
|
|
942
946
|
|
|
943
947
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
944
948
|
return {
|
|
945
|
-
defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1
|
|
949
|
+
defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
|
|
946
950
|
hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
|
|
947
951
|
rawData: state.rawData[props.componentId],
|
|
948
|
-
aggregationData: state.compositeAggregations[props.componentId]
|
|
949
|
-
promotedResults: state.promotedResults[props.componentId]
|
|
952
|
+
aggregationData: state.compositeAggregations[props.componentId],
|
|
953
|
+
promotedResults: state.promotedResults[props.componentId],
|
|
950
954
|
customData: state.customData[props.componentId],
|
|
951
|
-
time: state.hits[props.componentId] && state.hits[props.componentId].time
|
|
955
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time,
|
|
952
956
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
953
957
|
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
954
958
|
analytics: state.config && state.config.analytics,
|
|
@@ -957,7 +961,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
957
961
|
error: state.error[props.componentId],
|
|
958
962
|
afterKey: state.aggregations[props.componentId] && state.aggregations[props.componentId][props.aggregationField] && state.aggregations[props.componentId][props.aggregationField].after_key,
|
|
959
963
|
componentProps: state.props[props.componentId],
|
|
960
|
-
isLoading: state.isLoading[props.componentId]
|
|
964
|
+
isLoading: state.isLoading[props.componentId]
|
|
961
965
|
};
|
|
962
966
|
};
|
|
963
967
|
|