@appbaseio/reactivesearch-vue 1.34.0-alpha.1 → 1.34.0
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 +1175 -1297
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -11
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{ComponentWrapper-9318cece.js → ComponentWrapper-94c50228.js} +16 -7
- package/dist/cjs/DataSearch.js +1310 -17
- package/dist/cjs/{DropDown-8984b544.js → DropDown-7a52c661.js} +2 -2
- package/dist/cjs/DynamicRangeSlider.js +12 -8
- package/dist/cjs/MultiDropdownList.js +11 -8
- package/dist/cjs/MultiList.js +10 -8
- package/dist/cjs/MultiRange.js +7 -4
- package/dist/cjs/{Pagination-07f4dbad.js → Pagination-e56a5b79.js} +1 -1
- package/dist/cjs/{PreferencesConsumer-5d67b486.js → PreferencesConsumer-5e6e84a2.js} +1 -1
- package/dist/cjs/RangeInput.js +4 -4
- package/dist/cjs/RangeSlider.js +7 -4
- package/dist/cjs/ReactiveBase.js +10 -6
- package/dist/cjs/ReactiveComponent.js +316 -45
- package/dist/cjs/{ReactiveComponent-0a354ed7.js → ReactiveComponentPrivate-244c6055.js} +32 -318
- package/dist/cjs/ReactiveComponentPrivate.js +55 -0
- package/dist/cjs/ReactiveGoogleMap.js +139 -108
- package/dist/cjs/ReactiveList.js +17 -6
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +2 -2
- package/dist/cjs/SingleDropdownList.js +10 -8
- package/dist/cjs/SingleList.js +10 -8
- package/dist/cjs/SingleRange.js +7 -4
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/Tags-4ec43831.js +883 -0
- package/dist/cjs/ToggleButton.js +6 -4
- package/dist/cjs/{index-30126fd0.js → index-de136c17.js} +2 -0
- package/dist/cjs/index.js +14 -11
- package/dist/cjs/initReactivesearch.js +0 -3
- package/dist/cjs/install.js +11 -9
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-7cfc2f98.js → vueTypes-b7007f5f.js} +2 -1
- package/dist/es/{ComponentWrapper-240450cc.js → ComponentWrapper-edaeaceb.js} +16 -7
- package/dist/es/DataSearch.js +1310 -15
- package/dist/es/{DropDown-28ddce07.js → DropDown-2c0dd714.js} +2 -2
- package/dist/es/DynamicRangeSlider.js +12 -8
- package/dist/es/MultiDropdownList.js +11 -8
- package/dist/es/MultiList.js +10 -8
- package/dist/es/MultiRange.js +7 -4
- package/dist/es/{Pagination-28e56c5c.js → Pagination-edeb7dbe.js} +1 -1
- package/dist/es/{PreferencesConsumer-bc097ebb.js → PreferencesConsumer-86a676c8.js} +1 -1
- package/dist/es/RangeInput.js +4 -4
- package/dist/es/RangeSlider.js +7 -4
- package/dist/es/ReactiveBase.js +10 -6
- package/dist/es/ReactiveComponent.js +316 -44
- package/dist/es/{ReactiveComponent-9352370c.js → ReactiveComponentPrivate-6f16e1b7.js} +19 -305
- package/dist/es/ReactiveComponentPrivate.js +47 -0
- package/dist/es/ReactiveGoogleMap.js +139 -108
- package/dist/es/ReactiveList.js +17 -6
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +2 -2
- package/dist/es/SingleDropdownList.js +10 -8
- package/dist/es/SingleList.js +10 -8
- package/dist/es/SingleRange.js +7 -4
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/Tags-1c2d6c4d.js +869 -0
- package/dist/es/ToggleButton.js +6 -4
- package/dist/es/{index-0444a498.js → index-5509c0bc.js} +2 -0
- package/dist/es/index.js +10 -8
- package/dist/es/initReactivesearch.js +0 -3
- package/dist/es/install.js +11 -9
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-8986b709.js → vueTypes-66ebc93e.js} +2 -1
- package/package.json +87 -87
- package/dist/cjs/DataSearch-8ea2651a.js +0 -2175
- package/dist/es/DataSearch-dcaa106b.js +0 -2159
|
@@ -3,8 +3,8 @@ 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-
|
|
7
|
-
import { a as isFunction } from './index-
|
|
6
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
7
|
+
import { a as isFunction } from './index-5509c0bc.js';
|
|
8
8
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
9
9
|
import { D as Downshift, b as InputWrapper, a as IconGroup, I as IconWrapper, C as CancelSvg } from './CancelSvg-e40552a5.js';
|
|
10
10
|
import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-c09c0b56.js';
|
|
@@ -3,10 +3,10 @@ import { componentTypes } from '@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 '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
7
7
|
import 'redux';
|
|
8
|
-
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-
|
|
9
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
8
|
+
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-5509c0bc.js';
|
|
9
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
10
10
|
import { T as Title } from './Title-863dfa42.js';
|
|
11
11
|
import { C as Container } from './Container-d00219f7.js';
|
|
12
12
|
import NoSSR from 'vue-no-ssr';
|
|
@@ -62,6 +62,7 @@ var DynamicRangeSlider = {
|
|
|
62
62
|
},
|
|
63
63
|
created: function created() {
|
|
64
64
|
var _this = this;
|
|
65
|
+
this.$timestamp = new Date().getTime();
|
|
65
66
|
var onQueryChange = function onQueryChange() {
|
|
66
67
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
67
68
|
args[_key] = arguments[_key];
|
|
@@ -90,8 +91,8 @@ var DynamicRangeSlider = {
|
|
|
90
91
|
}
|
|
91
92
|
var value = this.$props.value;
|
|
92
93
|
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
93
|
-
this.addComponent(this.componentId);
|
|
94
|
-
this.addComponent(this.internalRangeComponent);
|
|
94
|
+
this.addComponent(this.componentId, this.$timestamp);
|
|
95
|
+
this.addComponent(this.internalRangeComponent, this.$timestamp);
|
|
95
96
|
if (Array.isArray(this.selectedValue)) {
|
|
96
97
|
this.handleChange(this.selectedValue);
|
|
97
98
|
} else if (this.selectedValue) {
|
|
@@ -404,13 +405,16 @@ var mapDispatchtoProps = {
|
|
|
404
405
|
updateComponentProps: updateComponentProps
|
|
405
406
|
};
|
|
406
407
|
var RangeConnected = PreferencesConsumer(connect(mapStateToProps, mapDispatchtoProps)(DynamicRangeSlider));
|
|
408
|
+
RangeConnected.defaultQuery = DynamicRangeSlider.defaultQuery;
|
|
409
|
+
RangeConnected.parseValue = DynamicRangeSlider.parseValue;
|
|
410
|
+
RangeConnected.hasInternalComponent = DynamicRangeSlider.hasInternalComponent;
|
|
407
411
|
RangeConnected.name = DynamicRangeSlider.name;
|
|
408
|
-
RangeConnected.install = function (Vue) {
|
|
409
|
-
Vue.component(RangeConnected.name, RangeConnected);
|
|
410
|
-
};
|
|
411
412
|
|
|
412
413
|
// Add componentType for SSR
|
|
413
414
|
RangeConnected.componentType = componentTypes.dynamicRangeSlider;
|
|
415
|
+
RangeConnected.install = function (Vue) {
|
|
416
|
+
Vue.component(RangeConnected.name, RangeConnected);
|
|
417
|
+
};
|
|
414
418
|
|
|
415
419
|
export default RangeConnected;
|
|
416
420
|
export { RangeConnected };
|
|
@@ -6,12 +6,12 @@ import 'emotion';
|
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
8
|
import { l as loadMoreContainer, B as Button } from './Button-153cd885.js';
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
9
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
10
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
11
11
|
import 'redux';
|
|
12
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5509c0bc.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
14
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
15
15
|
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
16
16
|
import { T as Title } from './Title-863dfa42.js';
|
|
17
17
|
import './CancelSvg-e40552a5.js';
|
|
@@ -20,7 +20,7 @@ import 'compute-scroll-into-view';
|
|
|
20
20
|
import { C as Container } from './Container-d00219f7.js';
|
|
21
21
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
22
22
|
import { g as getAggsQuery } from './utils-9e5a16a1.js';
|
|
23
|
-
import { D as Dropdown } from './DropDown-
|
|
23
|
+
import { D as Dropdown } from './DropDown-2c0dd714.js';
|
|
24
24
|
|
|
25
25
|
var updateQuery = Actions.updateQuery,
|
|
26
26
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -530,12 +530,15 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
|
|
|
530
530
|
internalComponent: MultiDropdownList.hasInternalComponent()
|
|
531
531
|
}));
|
|
532
532
|
ListConnected.name = MultiDropdownList.name;
|
|
533
|
-
ListConnected.install = function (Vue) {
|
|
534
|
-
Vue.component(ListConnected.name, ListConnected);
|
|
535
|
-
};
|
|
536
533
|
|
|
537
534
|
// Add componentType for SSR
|
|
538
535
|
ListConnected.componentType = componentTypes.multiDropdownList;
|
|
536
|
+
ListConnected.defaultQuery = MultiDropdownList.defaultQuery;
|
|
537
|
+
ListConnected.generateQueryOptions = MultiDropdownList.generateQueryOptions;
|
|
538
|
+
ListConnected.hasInternalComponent = MultiDropdownList.hasInternalComponent;
|
|
539
|
+
ListConnected.install = function (Vue) {
|
|
540
|
+
Vue.component(ListConnected.name, ListConnected);
|
|
541
|
+
};
|
|
539
542
|
|
|
540
543
|
export default ListConnected;
|
|
541
544
|
export { ListConnected };
|
package/dist/es/MultiList.js
CHANGED
|
@@ -5,12 +5,12 @@ import VueTypes from 'vue-types';
|
|
|
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-66ebc93e.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as isEvent, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
11
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as isEvent, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5509c0bc.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
13
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
14
14
|
import { T as Title } from './Title-863dfa42.js';
|
|
15
15
|
import { I as Input } from './Input-c09c0b56.js';
|
|
16
16
|
import { C as Container } from './Container-d00219f7.js';
|
|
@@ -164,7 +164,7 @@ var MultiList = {
|
|
|
164
164
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
165
165
|
}
|
|
166
166
|
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
167
|
-
if (this.
|
|
167
|
+
if (this.renderNoResults) {
|
|
168
168
|
this.renderNoResult();
|
|
169
169
|
} else {
|
|
170
170
|
return null;
|
|
@@ -546,12 +546,14 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
|
|
|
546
546
|
internalComponent: MultiList.hasInternalComponent()
|
|
547
547
|
}));
|
|
548
548
|
ListConnected.name = MultiList.name;
|
|
549
|
+
ListConnected.defaultQuery = MultiList.defaultQuery;
|
|
550
|
+
ListConnected.generateQueryOptions = MultiList.generateQueryOptions;
|
|
551
|
+
ListConnected.hasInternalComponent = MultiList.hasInternalComponent;
|
|
552
|
+
// Add componentType for SSR
|
|
553
|
+
ListConnected.componentType = componentTypes.multiList;
|
|
549
554
|
ListConnected.install = function (Vue) {
|
|
550
555
|
Vue.component(ListConnected.name, ListConnected);
|
|
551
556
|
};
|
|
552
557
|
|
|
553
|
-
// Add componentType for SSR
|
|
554
|
-
ListConnected.componentType = componentTypes.multiList;
|
|
555
|
-
|
|
556
558
|
export default ListConnected;
|
|
557
559
|
export { ListConnected };
|
package/dist/es/MultiRange.js
CHANGED
|
@@ -5,12 +5,12 @@ import VueTypes from 'vue-types';
|
|
|
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-66ebc93e.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { q as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
11
|
+
import { q as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-5509c0bc.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
13
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
14
14
|
import { T as Title } from './Title-863dfa42.js';
|
|
15
15
|
import { C as Container } from './Container-d00219f7.js';
|
|
16
16
|
import { U as UL, C as Checkbox } from './FormControlList-99797d0a.js';
|
|
@@ -278,6 +278,9 @@ var RangeConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProp
|
|
|
278
278
|
componentType: componentTypes.multiRange
|
|
279
279
|
}));
|
|
280
280
|
RangeConnected.name = MultiRange.name;
|
|
281
|
+
RangeConnected.defaultQuery = MultiRange.defaultQuery;
|
|
282
|
+
RangeConnected.parseValue = MultiRange.parseValue;
|
|
283
|
+
RangeConnected.hasInternalComponent = MultiRange.hasInternalComponent;
|
|
281
284
|
RangeConnected.install = function (Vue) {
|
|
282
285
|
Vue.component(RangeConnected.name, RangeConnected);
|
|
283
286
|
};
|
|
@@ -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-153cd885.js';
|
|
4
|
-
import { t as types } from './vueTypes-
|
|
4
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
5
5
|
|
|
6
6
|
var getClassName = helper.getClassName,
|
|
7
7
|
handleA11yAction = helper.handleA11yAction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
|
-
import { b as getCamelCase } from './index-
|
|
2
|
+
import { b as getCamelCase } from './index-5509c0bc.js';
|
|
3
3
|
|
|
4
4
|
var deepValue = function deepValue(o, p) {
|
|
5
5
|
return p.split('.').reduce(function (a, v) {
|
package/dist/es/RangeInput.js
CHANGED
|
@@ -5,12 +5,12 @@ import VueTypes from 'vue-types';
|
|
|
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-66ebc93e.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
11
|
+
import { c as connect } from './index-5509c0bc.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
13
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
14
14
|
import './Title-863dfa42.js';
|
|
15
15
|
import { F as Flex } from './Flex-7c177a10.js';
|
|
16
16
|
import { I as Input } from './Input-c09c0b56.js';
|
package/dist/es/RangeSlider.js
CHANGED
|
@@ -3,12 +3,12 @@ import { componentTypes } from '@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 '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
7
7
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
8
8
|
import 'redux';
|
|
9
|
-
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-
|
|
10
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
11
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
9
|
+
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-5509c0bc.js';
|
|
10
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
11
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
12
12
|
import { T as Title } from './Title-863dfa42.js';
|
|
13
13
|
import { C as Container } from './Container-d00219f7.js';
|
|
14
14
|
import NoSSR from 'vue-no-ssr';
|
|
@@ -260,6 +260,9 @@ var RangeConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProp
|
|
|
260
260
|
componentType: componentTypes.rangeSlider
|
|
261
261
|
}));
|
|
262
262
|
RangeConnected.name = RangeSlider.name;
|
|
263
|
+
RangeConnected.defaultQuery = RangeSlider.defaultQuery;
|
|
264
|
+
RangeConnected.parseValue = RangeSlider.parseValue;
|
|
265
|
+
RangeConnected.hasInternalComponent = RangeSlider.hasInternalComponent;
|
|
263
266
|
RangeConnected.install = function (Vue) {
|
|
264
267
|
Vue.component(RangeConnected.name, RangeConnected);
|
|
265
268
|
};
|
package/dist/es/ReactiveBase.js
CHANGED
|
@@ -4,9 +4,9 @@ import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPlugin
|
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
5
5
|
import { isEqual as isEqual$1, transformRequestUsingEndpoint } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
6
6
|
import styled from '@appbaseio/vue-emotion';
|
|
7
|
-
import { t as types } from './vueTypes-
|
|
7
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
8
8
|
import 'redux';
|
|
9
|
-
import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-
|
|
9
|
+
import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-5509c0bc.js';
|
|
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';
|
|
@@ -28,7 +28,7 @@ var Provider = {
|
|
|
28
28
|
},
|
|
29
29
|
analyticsRef: {
|
|
30
30
|
type: Object,
|
|
31
|
-
required:
|
|
31
|
+
required: false
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
provide: function provide() {
|
|
@@ -343,7 +343,6 @@ var ReactiveBase = {
|
|
|
343
343
|
enableAppbase: VueTypes.bool.def(false),
|
|
344
344
|
credentials: types.string,
|
|
345
345
|
headers: types.headers,
|
|
346
|
-
queryParams: types.string,
|
|
347
346
|
theme: VueTypes.object.def({}),
|
|
348
347
|
themePreset: VueTypes.string.def('light'),
|
|
349
348
|
type: types.string,
|
|
@@ -359,7 +358,8 @@ var ReactiveBase = {
|
|
|
359
358
|
setSearchParams: types.func,
|
|
360
359
|
mongodb: types.mongodb,
|
|
361
360
|
endpoint: types.endpointConfig,
|
|
362
|
-
preferences: VueTypes.object
|
|
361
|
+
preferences: VueTypes.object,
|
|
362
|
+
httpRequestTimeout: VueTypes.number.def(30)
|
|
363
363
|
},
|
|
364
364
|
provide: function provide() {
|
|
365
365
|
return {
|
|
@@ -396,6 +396,9 @@ var ReactiveBase = {
|
|
|
396
396
|
},
|
|
397
397
|
mongodb: function mongodb() {
|
|
398
398
|
this.updateState(this.$props);
|
|
399
|
+
},
|
|
400
|
+
httpRequestTimeout: function httpRequestTimeout() {
|
|
401
|
+
this.updateState(this.$props);
|
|
399
402
|
}
|
|
400
403
|
},
|
|
401
404
|
computed: {
|
|
@@ -442,7 +445,8 @@ var ReactiveBase = {
|
|
|
442
445
|
analytics: props.appbaseConfig ? props.appbaseConfig.recordAnalytics : props.analytics,
|
|
443
446
|
analyticsConfig: props.appbaseConfig,
|
|
444
447
|
mongodb: props.mongodb,
|
|
445
|
-
endpoint: props.endpoint
|
|
448
|
+
endpoint: props.endpoint,
|
|
449
|
+
httpRequestTimeout: (props.httpRequestTimeout || 0) * 1000 || 30000
|
|
446
450
|
};
|
|
447
451
|
var queryParams = '';
|
|
448
452
|
if (typeof window !== 'undefined') {
|
|
@@ -1,46 +1,318 @@
|
|
|
1
|
-
import '@appbaseio/reactivecore';
|
|
2
|
-
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
-
import 'vue-types';
|
|
5
|
-
import '
|
|
6
|
-
import 'emotion';
|
|
7
|
-
import '@appbaseio/vue-emotion';
|
|
8
|
-
import 'polished';
|
|
9
|
-
import './Button-153cd885.js';
|
|
10
|
-
import './vueTypes-8986b709.js';
|
|
11
|
-
import './Pagination-28e56c5c.js';
|
|
12
|
-
import './ReactiveList.js';
|
|
1
|
+
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
+
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
+
import VueTypes from 'vue-types';
|
|
5
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
13
6
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
14
7
|
import 'redux';
|
|
15
|
-
import './index-
|
|
16
|
-
import './ComponentWrapper-
|
|
17
|
-
import './PreferencesConsumer-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
8
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-5509c0bc.js';
|
|
9
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
10
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
11
|
+
|
|
12
|
+
var _excluded = ["options"];
|
|
13
|
+
var updateQuery = Actions.updateQuery,
|
|
14
|
+
setQueryOptions = Actions.setQueryOptions,
|
|
15
|
+
setCustomQuery = Actions.setCustomQuery,
|
|
16
|
+
setDefaultQuery = Actions.setDefaultQuery;
|
|
17
|
+
var parseHits = helper.parseHits,
|
|
18
|
+
isEqual = helper.isEqual,
|
|
19
|
+
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
20
|
+
getResultStats = helper.getResultStats,
|
|
21
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
22
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
23
|
+
var ReactiveComponent = {
|
|
24
|
+
name: 'ReactiveComponent',
|
|
25
|
+
props: {
|
|
26
|
+
componentId: types.stringRequired,
|
|
27
|
+
aggregationField: types.string,
|
|
28
|
+
aggregationSize: VueTypes.number,
|
|
29
|
+
size: VueTypes.number,
|
|
30
|
+
defaultQuery: types.func,
|
|
31
|
+
customQuery: types.func,
|
|
32
|
+
filterLabel: types.string,
|
|
33
|
+
react: types.react,
|
|
34
|
+
showFilter: VueTypes.bool.def(true),
|
|
35
|
+
URLParams: VueTypes.bool.def(false),
|
|
36
|
+
distinctField: types.string,
|
|
37
|
+
distinctFieldConfig: types.props,
|
|
38
|
+
index: VueTypes.string,
|
|
39
|
+
endpoint: types.endpointConfig
|
|
40
|
+
},
|
|
41
|
+
created: function created() {
|
|
42
|
+
var _this = this;
|
|
43
|
+
var props = this.$props;
|
|
44
|
+
this.internalComponent = null;
|
|
45
|
+
this.$defaultQuery = null;
|
|
46
|
+
// Set custom query in store
|
|
47
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
48
|
+
var customQuery = props.customQuery,
|
|
49
|
+
componentId = props.componentId,
|
|
50
|
+
filterLabel = props.filterLabel,
|
|
51
|
+
showFilter = props.showFilter,
|
|
52
|
+
URLParams = props.URLParams,
|
|
53
|
+
distinctField = props.distinctField,
|
|
54
|
+
distinctFieldConfig = props.distinctFieldConfig,
|
|
55
|
+
index = props.index;
|
|
56
|
+
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
57
|
+
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
58
|
+
}
|
|
59
|
+
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
60
|
+
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
61
|
+
}
|
|
62
|
+
if (!this.enableAppbase && index) {
|
|
63
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
64
|
+
}
|
|
65
|
+
if (customQuery) {
|
|
66
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
67
|
+
var query = extractQueryFromCustomQuery(calcCustomQuery);
|
|
68
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
|
|
69
|
+
if (customQueryOptions) {
|
|
70
|
+
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
71
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
72
|
+
this.updateQuery({
|
|
73
|
+
componentId: componentId,
|
|
74
|
+
query: query,
|
|
75
|
+
value: this.selectedValue || null,
|
|
76
|
+
label: filterLabel,
|
|
77
|
+
showFilter: showFilter,
|
|
78
|
+
URLParams: URLParams
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
this.setQuery = function (_ref) {
|
|
82
|
+
var options = _ref.options,
|
|
83
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
84
|
+
var queryToBeSet = obj.query;
|
|
85
|
+
|
|
86
|
+
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
87
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
88
|
+
queryToBeSet = queryToBeSet.query;
|
|
89
|
+
}
|
|
90
|
+
var customQueryCalc = _extends({}, options, {
|
|
91
|
+
query: queryToBeSet
|
|
92
|
+
});
|
|
93
|
+
var rsAPIQuery = customQueryCalc;
|
|
94
|
+
// handle stored queries
|
|
95
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
96
|
+
rsAPIQuery = queryToBeSet;
|
|
97
|
+
}
|
|
98
|
+
// Update customQuery field for RS API
|
|
99
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
100
|
+
if (options) {
|
|
101
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
102
|
+
}
|
|
103
|
+
_this.updateQuery(_extends({}, obj, {
|
|
104
|
+
query: customQueryCalc.query,
|
|
105
|
+
componentId: props.componentId,
|
|
106
|
+
label: props.filterLabel,
|
|
107
|
+
showFilter: props.showFilter,
|
|
108
|
+
URLParams: props.URLParams
|
|
109
|
+
}));
|
|
110
|
+
};
|
|
111
|
+
if (props.defaultQuery) {
|
|
112
|
+
this.internalComponent = props.componentId + "__internal";
|
|
113
|
+
}
|
|
114
|
+
if (this.internalComponent && this.$props.defaultQuery) {
|
|
115
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
116
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
117
|
+
var _query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
118
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
119
|
+
if (queryOptions) {
|
|
120
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
121
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
122
|
+
this.updateQuery({
|
|
123
|
+
componentId: this.internalComponent,
|
|
124
|
+
query: _query
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
watch: {
|
|
129
|
+
hits: function hits(newVal, oldVal) {
|
|
130
|
+
if (!isEqual(newVal, oldVal)) {
|
|
131
|
+
this.$emit('data', this.getData());
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
rawData: function rawData(newVal, oldVal) {
|
|
135
|
+
if (!isEqual(newVal, oldVal)) {
|
|
136
|
+
this.$emit('data', this.getData());
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
aggregations: function aggregations(newVal, oldVal) {
|
|
140
|
+
if (!isEqual(newVal, oldVal)) {
|
|
141
|
+
this.$emit('data', this.getData());
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
aggregationData: function aggregationData(newVal, oldVal) {
|
|
145
|
+
if (!isEqual(newVal, oldVal)) {
|
|
146
|
+
this.$emit('data', this.getData());
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
promotedResults: function promotedResults(newVal, oldVal) {
|
|
150
|
+
if (!isEqual(newVal, oldVal)) {
|
|
151
|
+
this.$emit('data', this.getData());
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
hidden: function hidden(newVal, oldVal) {
|
|
155
|
+
if (!isEqual(newVal, oldVal)) {
|
|
156
|
+
this.$emit('data', this.getData());
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
total: function total(newVal, oldVal) {
|
|
160
|
+
if (!isEqual(newVal, oldVal)) {
|
|
161
|
+
this.$emit('data', this.getData());
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
time: function time(newVal, oldVal) {
|
|
165
|
+
if (!isEqual(newVal, oldVal)) {
|
|
166
|
+
this.$emit('data', this.getData());
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
170
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
171
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
172
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
173
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
174
|
+
if (queryOptions) {
|
|
175
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
176
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
177
|
+
// Update default query for RS API
|
|
178
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
179
|
+
this.updateQuery({
|
|
180
|
+
componentId: this.internalComponent,
|
|
181
|
+
query: query
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
186
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
187
|
+
var componentId = this.$props.componentId;
|
|
188
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
189
|
+
var query = extractQueryFromCustomQuery(this.$customQuery);
|
|
190
|
+
var queryOptions = getOptionsForCustomQuery(this.$customQuery);
|
|
191
|
+
if (queryOptions) {
|
|
192
|
+
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
193
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
194
|
+
|
|
195
|
+
// Update custom query for RS API
|
|
196
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
197
|
+
this.updateQuery({
|
|
198
|
+
componentId: componentId,
|
|
199
|
+
query: query
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
render: function render() {
|
|
205
|
+
var h = arguments[0];
|
|
206
|
+
try {
|
|
207
|
+
var dom = this.$scopedSlots["default"];
|
|
208
|
+
var error = this.error,
|
|
209
|
+
isLoading = this.isLoading,
|
|
210
|
+
selectedValue = this.selectedValue;
|
|
211
|
+
var propsToBePassed = _extends({
|
|
212
|
+
error: error,
|
|
213
|
+
loading: isLoading
|
|
214
|
+
}, this.getData(), {
|
|
215
|
+
value: selectedValue,
|
|
216
|
+
setQuery: this.setQuery
|
|
217
|
+
});
|
|
218
|
+
return h("div", [dom(propsToBePassed)]);
|
|
219
|
+
} catch (e) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
methods: {
|
|
224
|
+
getAggsQuery: function getAggsQuery() {
|
|
225
|
+
if (this.aggregationField) {
|
|
226
|
+
return {
|
|
227
|
+
aggs: getCompositeAggsQuery({
|
|
228
|
+
props: this.$props,
|
|
229
|
+
showTopHits: true,
|
|
230
|
+
value: this.selectedValue
|
|
231
|
+
}).aggs
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return {};
|
|
235
|
+
},
|
|
236
|
+
getData: function getData() {
|
|
237
|
+
var hits = this.hits,
|
|
238
|
+
aggregations = this.aggregations,
|
|
239
|
+
aggregationData = this.aggregationData,
|
|
240
|
+
promotedResults = this.promotedResults,
|
|
241
|
+
rawData = this.rawData;
|
|
242
|
+
var filteredResults = parseHits(hits);
|
|
243
|
+
if (promotedResults.length) {
|
|
244
|
+
var ids = promotedResults.map(function (item) {
|
|
245
|
+
return item._id;
|
|
246
|
+
}).filter(Boolean);
|
|
247
|
+
if (ids) {
|
|
248
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
249
|
+
return !ids.includes(item._id);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
filteredResults = [].concat(promotedResults, filteredResults);
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
data: filteredResults,
|
|
256
|
+
aggregationData: aggregationData,
|
|
257
|
+
rawData: rawData,
|
|
258
|
+
aggregations: aggregations,
|
|
259
|
+
promotedData: promotedResults,
|
|
260
|
+
resultStats: this.stats
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
computed: {
|
|
265
|
+
stats: function stats() {
|
|
266
|
+
return getResultStats(this);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
271
|
+
return !!props.defaultQuery;
|
|
272
|
+
};
|
|
273
|
+
var mapStateToProps = function mapStateToProps(state, props) {
|
|
274
|
+
return {
|
|
275
|
+
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
276
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
277
|
+
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
278
|
+
rawData: state.rawData[props.componentId],
|
|
279
|
+
error: state.error[props.componentId],
|
|
280
|
+
isLoading: state.isLoading[props.componentId],
|
|
281
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
282
|
+
promotedResults: state.promotedResults[props.componentId] || [],
|
|
283
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
284
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
285
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
286
|
+
componentProps: state.props[props.componentId],
|
|
287
|
+
enableAppbase: state.config.enableAppbase
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
var mapDispatchtoProps = {
|
|
291
|
+
setQueryOptions: setQueryOptions,
|
|
292
|
+
updateQuery: updateQuery,
|
|
293
|
+
setCustomQuery: setCustomQuery,
|
|
294
|
+
setDefaultQuery: setDefaultQuery
|
|
295
|
+
};
|
|
296
|
+
var ConnectedComponent = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(ReactiveComponent), {
|
|
297
|
+
componentType: componentTypes.reactiveComponent
|
|
298
|
+
});
|
|
299
|
+
var RcConnected = PreferencesConsumer({
|
|
300
|
+
name: 'RcConnected',
|
|
301
|
+
render: function render(h) {
|
|
302
|
+
return h(ConnectedComponent, {
|
|
303
|
+
attrs: this.$attrs,
|
|
304
|
+
on: this.$listeners,
|
|
305
|
+
scopedSlots: this.$scopedSlots,
|
|
306
|
+
slots: this.$slots
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
RcConnected.name = ReactiveComponent.name;
|
|
311
|
+
RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
|
|
312
|
+
// Add componentType for SSR
|
|
313
|
+
RcConnected.componentType = componentTypes.reactiveComponent;
|
|
314
|
+
RcConnected.install = function (Vue) {
|
|
315
|
+
Vue.component(RcConnected.name, RcConnected);
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export default RcConnected;
|