@appbaseio/reactivesearch-vue 1.16.0-alpha.5 → 1.16.0-alpha.52
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 +15109 -13024
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/Button-10e5cf51.js +68 -0
- package/dist/cjs/{DownShift-b09da079.js → CancelSvg-82021d23.js} +60 -16
- package/dist/cjs/Card-4b915733.js +30 -0
- package/dist/cjs/{ComponentWrapper-5a0a8849.js → ComponentWrapper-7302fe1a.js} +40 -21
- package/dist/cjs/{Container-f84e72fc.js → Container-8a08d663.js} +3 -11
- package/dist/cjs/DataSearch-7fd1b95d.js +2181 -0
- package/dist/cjs/DataSearch.js +18 -2151
- package/dist/cjs/{DropDown-c66be1a8.js → DropDown-16a2a728.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +107 -43
- package/dist/cjs/Flex-699639d2.js +52 -0
- package/dist/cjs/FormControlList-73497794.js +47 -0
- package/dist/cjs/Input-64087a69.js +79 -0
- package/dist/cjs/ListItem-933c27e4.js +46 -0
- package/dist/cjs/MultiDropdownList.js +102 -68
- package/dist/cjs/MultiList.js +80 -50
- package/dist/cjs/MultiRange.js +21 -16
- package/dist/cjs/{Pagination-91df3b77.js → Pagination-e0654529.js} +4 -3
- package/dist/cjs/RangeInput.js +29 -45
- package/dist/cjs/RangeSlider.js +32 -30
- package/dist/cjs/ReactiveBase.js +87 -56
- package/dist/cjs/ReactiveComponent.js +75 -62
- package/dist/cjs/ReactiveGoogleMap.js +326 -235
- package/dist/cjs/ReactiveList.js +189 -241
- package/dist/cjs/ResultCard.js +8 -6
- package/dist/cjs/ResultList.js +8 -6
- package/dist/cjs/SelectedFilters.js +27 -12
- package/dist/cjs/SingleDropdownList.js +88 -60
- package/dist/cjs/SingleList.js +53 -35
- package/dist/cjs/SingleRange.js +18 -13
- package/dist/cjs/StateProvider.js +11 -7
- package/dist/cjs/{Title-e9beb554.js → Title-39765ee6.js} +3 -11
- package/dist/cjs/ToggleButton.js +35 -16
- package/dist/cjs/{_rollupPluginBabelHelpers-280a574c.js → _rollupPluginBabelHelpers-4abdbfff.js} +11 -1
- package/dist/cjs/{index-e0583d76.js → index-d44a0a21.js} +87 -13
- package/dist/cjs/index.js +30 -25
- package/dist/cjs/initReactivesearch.js +177 -103
- package/dist/cjs/install-856cc730.js +1247 -0
- package/dist/cjs/install.js +41 -44
- package/dist/cjs/ssr-c333c82c.js +39 -0
- package/dist/cjs/{utils-d1ea9f95.js → utils-23afb20b.js} +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
- package/dist/es/Button-8b211174.js +59 -0
- package/dist/es/{DownShift-d8f2500f.js → CancelSvg-4d9e0857.js} +56 -17
- package/dist/es/Card-04b3c33e.js +23 -0
- package/dist/es/{ComponentWrapper-d0b21b95.js → ComponentWrapper-bbb717bc.js} +40 -21
- package/dist/es/Container-4383c6f0.js +10 -0
- package/dist/es/DataSearch-a5aaa29e.js +2168 -0
- package/dist/es/DataSearch.js +17 -2150
- package/dist/es/{DropDown-5dbd69c2.js → DropDown-7639f223.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +107 -43
- package/dist/es/Flex-aac91505.js +47 -0
- package/dist/es/FormControlList-fe389a2e.js +40 -0
- package/dist/es/Input-d1bb4868.js +71 -0
- package/dist/es/ListItem-bdb6d53d.js +39 -0
- package/dist/es/MultiDropdownList.js +102 -68
- package/dist/es/MultiList.js +80 -50
- package/dist/es/MultiRange.js +21 -16
- package/dist/es/{Pagination-800af44f.js → Pagination-3c50d4ba.js} +4 -3
- package/dist/es/RangeInput.js +29 -45
- package/dist/es/RangeSlider.js +32 -30
- package/dist/es/ReactiveBase.js +87 -56
- package/dist/es/ReactiveComponent.js +75 -62
- package/dist/es/ReactiveGoogleMap.js +326 -235
- package/dist/es/ReactiveList.js +189 -241
- package/dist/es/ResultCard.js +8 -6
- package/dist/es/ResultList.js +8 -6
- package/dist/es/SelectedFilters.js +27 -12
- package/dist/es/SingleDropdownList.js +88 -60
- package/dist/es/SingleList.js +53 -35
- package/dist/es/SingleRange.js +18 -13
- package/dist/es/StateProvider.js +11 -7
- package/dist/es/Title-579f8d6c.js +10 -0
- package/dist/es/ToggleButton.js +35 -16
- package/dist/es/{_rollupPluginBabelHelpers-c9fbe19f.js → _rollupPluginBabelHelpers-ecf6c03c.js} +11 -1
- package/dist/es/{index-1fe91a0a.js → index-5daa8276.js} +84 -14
- package/dist/es/index.js +26 -22
- package/dist/es/initReactivesearch.js +178 -104
- package/dist/es/install-d1a27419.js +1240 -0
- package/dist/es/install.js +39 -46
- package/dist/es/ssr-e3196de1.js +33 -0
- package/dist/es/{utils-ce3d86fd.js → utils-3a32e13f.js} +2 -2
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
- package/package.json +6 -4
- package/dist/cjs/Button-78d8bc26.js +0 -146
- package/dist/cjs/Card-b4af314f.js +0 -58
- package/dist/cjs/Flex-737c55be.js +0 -160
- package/dist/cjs/FormControlList-08dfb28e.js +0 -105
- package/dist/cjs/Input-643d02a7.js +0 -178
- package/dist/cjs/ListItem-0c58c5d2.js +0 -84
- package/dist/cjs/ssr-b7a729f9.js +0 -47
- package/dist/es/Button-6c71c66e.js +0 -137
- package/dist/es/Card-ecf70ba1.js +0 -51
- package/dist/es/Container-f5efec9e.js +0 -18
- package/dist/es/Flex-40a74d8a.js +0 -155
- package/dist/es/FormControlList-b96aebef.js +0 -98
- package/dist/es/Input-dfd9dd40.js +0 -170
- package/dist/es/ListItem-da73bc7d.js +0 -77
- package/dist/es/Title-22c2f3bf.js +0 -18
- package/dist/es/ssr-2f57791d.js +0 -41
package/dist/es/ResultCard.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
2
|
import VueTypes from 'vue-types';
|
|
3
3
|
import 'emotion';
|
|
4
4
|
import '@appbaseio/vue-emotion';
|
|
5
5
|
import 'polished';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
7
7
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
8
|
-
import { T as Title } from './Title-
|
|
9
|
-
import { I as Image, C as Card } from './Card-
|
|
8
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
9
|
+
import { I as Image, C as Card } from './Card-04b3c33e.js';
|
|
10
10
|
|
|
11
11
|
var ResultCardTitle = {
|
|
12
12
|
name: 'ResultCardTitle',
|
|
@@ -21,6 +21,7 @@ ResultCardTitle.install = function (Vue) {
|
|
|
21
21
|
Vue.component(ResultCardTitle.name, ResultCardTitle);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
var _excluded = ["src"];
|
|
24
25
|
var ResultCardImage = {
|
|
25
26
|
name: 'ResultCardImage',
|
|
26
27
|
props: {
|
|
@@ -31,7 +32,7 @@ var ResultCardImage = {
|
|
|
31
32
|
|
|
32
33
|
var _this$$props = this.$props,
|
|
33
34
|
src = _this$$props.src,
|
|
34
|
-
props = _objectWithoutPropertiesLoose(_this$$props,
|
|
35
|
+
props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
|
|
35
36
|
|
|
36
37
|
return h(Image, _mergeJSXProps([{
|
|
37
38
|
"style": {
|
|
@@ -60,6 +61,7 @@ ResultCardDescription.install = function (Vue) {
|
|
|
60
61
|
Vue.component(ResultCardDescription.name, ResultCardDescription);
|
|
61
62
|
};
|
|
62
63
|
|
|
64
|
+
var _excluded$1 = ["href", "target"];
|
|
63
65
|
var ResultCard = {
|
|
64
66
|
name: 'ResultCard',
|
|
65
67
|
components: {
|
|
@@ -78,7 +80,7 @@ var ResultCard = {
|
|
|
78
80
|
var _this$$props = this.$props,
|
|
79
81
|
href = _this$$props.href,
|
|
80
82
|
target = _this$$props.target,
|
|
81
|
-
rest = _objectWithoutPropertiesLoose(_this$$props,
|
|
83
|
+
rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
|
|
82
84
|
|
|
83
85
|
return h(Card, _mergeJSXProps([{
|
|
84
86
|
"attrs": {
|
package/dist/es/ResultList.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
2
|
import VueTypes from 'vue-types';
|
|
3
3
|
import 'emotion';
|
|
4
4
|
import '@appbaseio/vue-emotion';
|
|
5
5
|
import 'polished';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
7
7
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
8
|
-
import { T as Title } from './Title-
|
|
9
|
-
import { I as Image, L as ListItem } from './ListItem-
|
|
8
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
9
|
+
import { I as Image, L as ListItem } from './ListItem-bdb6d53d.js';
|
|
10
10
|
|
|
11
11
|
var ResultListContent = {
|
|
12
12
|
name: 'ResultListContent',
|
|
@@ -38,6 +38,7 @@ ResultListDescription.install = function (Vue) {
|
|
|
38
38
|
Vue.component(ResultListDescription.name, ResultListDescription);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
var _excluded = ["src", "small"];
|
|
41
42
|
var ResultListImage = {
|
|
42
43
|
name: 'ResultListImage',
|
|
43
44
|
props: {
|
|
@@ -50,7 +51,7 @@ var ResultListImage = {
|
|
|
50
51
|
var _this$$props = this.$props,
|
|
51
52
|
src = _this$$props.src,
|
|
52
53
|
small = _this$$props.small,
|
|
53
|
-
props = _objectWithoutPropertiesLoose(_this$$props,
|
|
54
|
+
props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
|
|
54
55
|
|
|
55
56
|
return h(Image, _mergeJSXProps([{
|
|
56
57
|
"attrs": {
|
|
@@ -78,6 +79,7 @@ ResultListTitle.install = function (Vue) {
|
|
|
78
79
|
Vue.component(ResultListTitle.name, ResultListTitle);
|
|
79
80
|
};
|
|
80
81
|
|
|
82
|
+
var _excluded$1 = ["href", "target"];
|
|
81
83
|
var ResultList = {
|
|
82
84
|
name: 'ResultList',
|
|
83
85
|
props: {
|
|
@@ -117,7 +119,7 @@ var ResultList = {
|
|
|
117
119
|
var _this$$props = this.$props,
|
|
118
120
|
href = _this$$props.href,
|
|
119
121
|
target = _this$$props.target,
|
|
120
|
-
props = _objectWithoutPropertiesLoose(_this$$props,
|
|
122
|
+
props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
|
|
121
123
|
|
|
122
124
|
var hasImage = this.hasImage,
|
|
123
125
|
isSmall = this.isSmall;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { f as filters, B as Button } from './Button-
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { f as filters, B as Button } from './Button-8b211174.js';
|
|
9
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { c as connect } from './index-
|
|
12
|
-
import { T as Title } from './Title-
|
|
13
|
-
import { C as Container } from './Container-
|
|
11
|
+
import { c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
13
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
14
14
|
|
|
15
15
|
var setValue = Actions.setValue,
|
|
16
|
-
clearValues = Actions.clearValues
|
|
16
|
+
clearValues = Actions.clearValues,
|
|
17
|
+
resetValuesToDefault = Actions.resetValuesToDefault;
|
|
17
18
|
var getClassName = helper.getClassName,
|
|
18
19
|
handleA11yAction = helper.handleA11yAction;
|
|
19
20
|
var SelectedFilters = {
|
|
@@ -23,7 +24,10 @@ var SelectedFilters = {
|
|
|
23
24
|
clearAllLabel: VueTypes.string.def('Clear All'),
|
|
24
25
|
innerClass: types.style,
|
|
25
26
|
showClearAll: VueTypes.bool.def(true),
|
|
26
|
-
title: types.title
|
|
27
|
+
title: types.title,
|
|
28
|
+
resetToDefault: VueTypes.bool.def(false),
|
|
29
|
+
clearAllBlacklistComponents: VueTypes.array,
|
|
30
|
+
resetToValues: VueTypes.object
|
|
27
31
|
},
|
|
28
32
|
inject: {
|
|
29
33
|
theme: {
|
|
@@ -40,7 +44,8 @@ var SelectedFilters = {
|
|
|
40
44
|
components: this.components,
|
|
41
45
|
selectedValues: this.selectedValues,
|
|
42
46
|
clearValues: this.clearValues,
|
|
43
|
-
setValue: this.setValue
|
|
47
|
+
setValue: this.setValue,
|
|
48
|
+
resetValuesToDefault: this.resetValuesToDefault
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -75,8 +80,17 @@ var SelectedFilters = {
|
|
|
75
80
|
this.$emit('clear', component, value);
|
|
76
81
|
},
|
|
77
82
|
clearValues: function clearValues() {
|
|
78
|
-
this.
|
|
79
|
-
|
|
83
|
+
var resetToDefault = this.resetToDefault,
|
|
84
|
+
resetToValues = this.resetToValues,
|
|
85
|
+
clearAllBlacklistComponents = this.clearAllBlacklistComponents;
|
|
86
|
+
|
|
87
|
+
if (resetToDefault) {
|
|
88
|
+
this.resetValuesToDefault(clearAllBlacklistComponents);
|
|
89
|
+
} else {
|
|
90
|
+
this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
this.$emit('clear', resetToValues);
|
|
80
94
|
},
|
|
81
95
|
renderValue: function renderValue(value, isArray) {
|
|
82
96
|
var _this2 = this;
|
|
@@ -156,7 +170,8 @@ var mapStateToProps = function mapStateToProps(state) {
|
|
|
156
170
|
|
|
157
171
|
var mapDispatchtoProps = {
|
|
158
172
|
clearValuesAction: clearValues,
|
|
159
|
-
setValue: setValue
|
|
173
|
+
setValue: setValue,
|
|
174
|
+
resetValuesToDefault: resetValuesToDefault
|
|
160
175
|
};
|
|
161
176
|
var RcConnected = connect(mapStateToProps, mapDispatchtoProps)(SelectedFilters);
|
|
162
177
|
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
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 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { l as loadMoreContainer, B as Button } from './Button-
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { l as loadMoreContainer, B as Button } from './Button-8b211174.js';
|
|
9
|
+
import { t as types } from './vueTypes-9326e0be.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, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
-
import
|
|
15
|
-
import './
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5daa8276.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
14
|
+
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
15
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
16
|
+
import './CancelSvg-4d9e0857.js';
|
|
17
|
+
import './Input-d1bb4868.js';
|
|
16
18
|
import 'compute-scroll-into-view';
|
|
17
|
-
import './
|
|
18
|
-
import
|
|
19
|
-
import { g as getAggsQuery } from './utils-
|
|
20
|
-
import { D as Dropdown } from './DropDown-
|
|
19
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
20
|
+
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
21
|
+
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
22
|
+
import { D as Dropdown } from './DropDown-7639f223.js';
|
|
21
23
|
|
|
22
24
|
var updateQuery = Actions.updateQuery,
|
|
23
25
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -27,9 +29,10 @@ var getQueryOptions = helper.getQueryOptions,
|
|
|
27
29
|
checkValueChange = helper.checkValueChange,
|
|
28
30
|
checkPropChange = helper.checkPropChange,
|
|
29
31
|
getClassName = helper.getClassName,
|
|
30
|
-
getOptionsFromQuery = helper.getOptionsFromQuery,
|
|
31
32
|
isEqual = helper.isEqual,
|
|
32
|
-
getCompositeAggsQuery = helper.getCompositeAggsQuery
|
|
33
|
+
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
34
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
35
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
33
36
|
var SingleDropdownList = {
|
|
34
37
|
name: 'SingleDropdownList',
|
|
35
38
|
data: function data() {
|
|
@@ -66,19 +69,28 @@ var SingleDropdownList = {
|
|
|
66
69
|
selectAllLabel: types.string,
|
|
67
70
|
showCount: VueTypes.bool.def(true),
|
|
68
71
|
showFilter: VueTypes.bool.def(true),
|
|
69
|
-
size: VueTypes.number
|
|
72
|
+
size: VueTypes.number,
|
|
70
73
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
71
74
|
title: types.title,
|
|
72
75
|
URLParams: VueTypes.bool.def(false),
|
|
73
76
|
showMissing: VueTypes.bool.def(false),
|
|
74
77
|
missingLabel: VueTypes.string.def('N/A'),
|
|
75
78
|
showSearch: VueTypes.bool.def(false),
|
|
79
|
+
showClear: VueTypes.bool.def(false),
|
|
76
80
|
showLoadMore: VueTypes.bool.def(false),
|
|
77
81
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
78
|
-
nestedField: types.string
|
|
82
|
+
nestedField: types.string,
|
|
83
|
+
index: VueTypes.string,
|
|
84
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
79
85
|
},
|
|
80
86
|
created: function created() {
|
|
81
|
-
|
|
87
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
88
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var props = this.$props;
|
|
92
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
93
|
+
|
|
82
94
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
83
95
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
84
96
|
},
|
|
@@ -97,33 +109,35 @@ var SingleDropdownList = {
|
|
|
97
109
|
options: function options(newVal, oldVal) {
|
|
98
110
|
var _this = this;
|
|
99
111
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
if (newVal) {
|
|
113
|
+
checkPropChange(oldVal, newVal, function () {
|
|
114
|
+
var _this$$props = _this.$props,
|
|
115
|
+
showLoadMore = _this$$props.showLoadMore,
|
|
116
|
+
dataField = _this$$props.dataField;
|
|
117
|
+
var modifiedOptions = _this.$data.modifiedOptions;
|
|
118
|
+
|
|
119
|
+
if (showLoadMore) {
|
|
120
|
+
// append options with showLoadMore
|
|
121
|
+
var buckets = newVal[dataField].buckets;
|
|
122
|
+
var nextOptions = [].concat(modifiedOptions, buckets.map(function (bucket) {
|
|
123
|
+
return {
|
|
124
|
+
key: bucket.key[dataField],
|
|
125
|
+
doc_count: bucket.doc_count
|
|
126
|
+
};
|
|
127
|
+
}));
|
|
128
|
+
var after = newVal[dataField].after_key; // detect the last bucket by checking if the next set of buckets were empty
|
|
129
|
+
|
|
130
|
+
var isLastBucket = !buckets.length;
|
|
131
|
+
_this.after = {
|
|
132
|
+
after: after
|
|
113
133
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
_this.isLastBucket = isLastBucket;
|
|
122
|
-
_this.modifiedOptions = nextOptions;
|
|
123
|
-
} else {
|
|
124
|
-
_this.modifiedOptions = newVal[_this.$props.dataField] ? newVal[_this.$props.dataField].buckets : [];
|
|
125
|
-
}
|
|
126
|
-
});
|
|
134
|
+
_this.isLastBucket = isLastBucket;
|
|
135
|
+
_this.modifiedOptions = nextOptions;
|
|
136
|
+
} else {
|
|
137
|
+
_this.modifiedOptions = newVal[_this.$props.dataField] ? newVal[_this.$props.dataField].buckets : [];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
127
141
|
},
|
|
128
142
|
size: function size() {
|
|
129
143
|
this.updateQueryOptions(this.$props);
|
|
@@ -172,12 +186,21 @@ var SingleDropdownList = {
|
|
|
172
186
|
var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
|
|
173
187
|
var renderErrorCalc = this.$scopedSlots.renderError || renderError;
|
|
174
188
|
var renderLabelCalc = this.$scopedSlots.renderLabel || renderLabel;
|
|
189
|
+
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
175
190
|
|
|
176
191
|
if (renderErrorCalc && this.error) {
|
|
177
192
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
178
193
|
}
|
|
179
194
|
|
|
180
|
-
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0) {
|
|
195
|
+
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
196
|
+
if (renderNoResults && isFunction(renderNoResults)) {
|
|
197
|
+
return h("div", [renderNoResults()]);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (renderNoResults && !isFunction(renderNoResults)) {
|
|
201
|
+
return renderNoResults;
|
|
202
|
+
}
|
|
203
|
+
|
|
181
204
|
return null;
|
|
182
205
|
}
|
|
183
206
|
|
|
@@ -197,7 +220,7 @@ var SingleDropdownList = {
|
|
|
197
220
|
"items": [].concat(selectAll, this.$data.modifiedOptions.filter(function (item) {
|
|
198
221
|
return String(item.key).trim().length;
|
|
199
222
|
}).map(function (item) {
|
|
200
|
-
return _extends(
|
|
223
|
+
return _extends({}, item, {
|
|
201
224
|
key: String(item.key)
|
|
202
225
|
});
|
|
203
226
|
})),
|
|
@@ -212,6 +235,8 @@ var SingleDropdownList = {
|
|
|
212
235
|
"renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
|
|
213
236
|
"themePreset": this.themePreset,
|
|
214
237
|
"showSearch": this.$props.showSearch,
|
|
238
|
+
"showClear": this.$props.showClear,
|
|
239
|
+
"searchPlaceholder": this.$props.searchPlaceholder,
|
|
215
240
|
"transformData": this.$props.transformData,
|
|
216
241
|
"footer": showLoadMore && !isLastBucket && h("div", {
|
|
217
242
|
"attrs": {
|
|
@@ -256,22 +281,22 @@ var SingleDropdownList = {
|
|
|
256
281
|
}
|
|
257
282
|
},
|
|
258
283
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
259
|
-
var defaultQueryOptions;
|
|
260
284
|
var query = SingleDropdownList.defaultQuery(value, props);
|
|
261
285
|
|
|
262
286
|
if (this.defaultQuery) {
|
|
263
287
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
288
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
264
289
|
|
|
265
|
-
if (
|
|
266
|
-
query =
|
|
267
|
-
}
|
|
290
|
+
if (defaultQueryObj) {
|
|
291
|
+
query = defaultQueryObj;
|
|
292
|
+
} // Update calculated default query in store
|
|
268
293
|
|
|
269
|
-
defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
270
294
|
|
|
271
295
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
296
|
+
var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
297
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
272
298
|
}
|
|
273
299
|
|
|
274
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
275
300
|
this.updateQuery({
|
|
276
301
|
componentId: this.internalComponent,
|
|
277
302
|
query: query,
|
|
@@ -282,17 +307,15 @@ var SingleDropdownList = {
|
|
|
282
307
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
283
308
|
var customQuery = props.customQuery;
|
|
284
309
|
var query = SingleDropdownList.defaultQuery(value, props);
|
|
285
|
-
var customQueryOptions;
|
|
286
310
|
|
|
287
311
|
if (customQuery) {
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
query = _ref.query;
|
|
291
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
312
|
+
var customQueryCalc = customQuery(value, props);
|
|
313
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
292
314
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
315
|
+
var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
316
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
293
317
|
}
|
|
294
318
|
|
|
295
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
296
319
|
this.updateQuery({
|
|
297
320
|
componentId: props.componentId,
|
|
298
321
|
query: query,
|
|
@@ -326,8 +349,8 @@ var SingleDropdownList = {
|
|
|
326
349
|
|
|
327
350
|
if (props.defaultQuery) {
|
|
328
351
|
var value = this.$data.currentValue;
|
|
329
|
-
var defaultQueryOptions =
|
|
330
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
352
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
353
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
331
354
|
} else {
|
|
332
355
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
333
356
|
}
|
|
@@ -418,6 +441,10 @@ SingleDropdownList.generateQueryOptions = function (props, after) {
|
|
|
418
441
|
}) : getAggsQuery(queryOptions, props);
|
|
419
442
|
};
|
|
420
443
|
|
|
444
|
+
SingleDropdownList.hasInternalComponent = function () {
|
|
445
|
+
return true;
|
|
446
|
+
};
|
|
447
|
+
|
|
421
448
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
422
449
|
return {
|
|
423
450
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -426,7 +453,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
426
453
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || '',
|
|
427
454
|
themePreset: state.config.themePreset,
|
|
428
455
|
error: state.error[props.componentId],
|
|
429
|
-
componentProps: state.props[props.componentId]
|
|
456
|
+
componentProps: state.props[props.componentId],
|
|
457
|
+
enableAppbase: state.config.enableAppbase
|
|
430
458
|
};
|
|
431
459
|
};
|
|
432
460
|
|
|
@@ -438,7 +466,7 @@ var mapDispatchtoProps = {
|
|
|
438
466
|
};
|
|
439
467
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleDropdownList), {
|
|
440
468
|
componentType: componentTypes.singleDropdownList,
|
|
441
|
-
internalComponent:
|
|
469
|
+
internalComponent: SingleDropdownList.hasInternalComponent()
|
|
442
470
|
});
|
|
443
471
|
|
|
444
472
|
SingleDropdownList.install = function (Vue) {
|
package/dist/es/SingleList.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
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 '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-9326e0be.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, g as getComponent,
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { T as Title } from './Title-
|
|
14
|
-
import { I as Input } from './Input-
|
|
15
|
-
import { C as Container } from './Container-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
11
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, n as isEvent, h as hasCustomRenderer, c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
14
|
+
import { I as Input } from './Input-d1bb4868.js';
|
|
15
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
16
|
+
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
17
|
+
import { U as UL, R as Radio } from './FormControlList-fe389a2e.js';
|
|
18
|
+
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
18
19
|
|
|
19
20
|
var updateQuery = Actions.updateQuery,
|
|
20
21
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -23,13 +24,14 @@ var updateQuery = Actions.updateQuery,
|
|
|
23
24
|
var getQueryOptions = helper.getQueryOptions,
|
|
24
25
|
checkValueChange = helper.checkValueChange,
|
|
25
26
|
getClassName = helper.getClassName,
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
isEqual = helper.isEqual,
|
|
28
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
29
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
28
30
|
var SingleList = {
|
|
29
31
|
name: 'SingleList',
|
|
30
32
|
props: {
|
|
31
33
|
beforeValueChange: types.func,
|
|
32
|
-
className:
|
|
34
|
+
className: VueTypes.string.def(''),
|
|
33
35
|
componentId: types.stringRequired,
|
|
34
36
|
customQuery: types.func,
|
|
35
37
|
dataField: types.stringRequired,
|
|
@@ -49,27 +51,34 @@ var SingleList = {
|
|
|
49
51
|
showFilter: VueTypes.bool.def(true),
|
|
50
52
|
showRadio: VueTypes.bool.def(true),
|
|
51
53
|
showSearch: VueTypes.bool.def(true),
|
|
52
|
-
size: VueTypes.number
|
|
54
|
+
size: VueTypes.number,
|
|
53
55
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
54
56
|
title: types.title,
|
|
55
57
|
URLParams: VueTypes.bool.def(false),
|
|
56
58
|
showMissing: VueTypes.bool.def(false),
|
|
57
59
|
missingLabel: VueTypes.string.def('N/A'),
|
|
58
60
|
nestedField: types.string,
|
|
61
|
+
index: VueTypes.string,
|
|
59
62
|
enableStrictSelection: VueTypes.bool.def(false)
|
|
60
63
|
},
|
|
61
64
|
data: function data() {
|
|
62
65
|
var props = this.$props;
|
|
63
66
|
this.__state = {
|
|
64
67
|
currentValue: '',
|
|
65
|
-
modifiedOptions:
|
|
68
|
+
modifiedOptions: [],
|
|
66
69
|
searchTerm: ''
|
|
67
70
|
};
|
|
68
71
|
this.internalComponent = props.componentId + "__internal";
|
|
69
72
|
return this.__state;
|
|
70
73
|
},
|
|
71
74
|
created: function created() {
|
|
72
|
-
|
|
75
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
76
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var props = this.$props;
|
|
80
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
81
|
+
|
|
73
82
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
74
83
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
75
84
|
},
|
|
@@ -86,7 +95,9 @@ var SingleList = {
|
|
|
86
95
|
},
|
|
87
96
|
watch: {
|
|
88
97
|
options: function options(newVal) {
|
|
89
|
-
|
|
98
|
+
if (newVal) {
|
|
99
|
+
this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
|
|
100
|
+
}
|
|
90
101
|
},
|
|
91
102
|
size: function size() {
|
|
92
103
|
this.updateQueryHandlerOptions(this.$props);
|
|
@@ -137,8 +148,12 @@ var SingleList = {
|
|
|
137
148
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
138
149
|
}
|
|
139
150
|
|
|
140
|
-
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0) {
|
|
141
|
-
|
|
151
|
+
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
152
|
+
if (this.renderNoResult) {
|
|
153
|
+
this.renderNoResult();
|
|
154
|
+
} else {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
142
157
|
}
|
|
143
158
|
|
|
144
159
|
var itemsToRender = this.$data.modifiedOptions;
|
|
@@ -150,7 +165,7 @@ var SingleList = {
|
|
|
150
165
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
151
166
|
if (String(item.key).length) {
|
|
152
167
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
153
|
-
return String(item.key).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
168
|
+
return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
|
|
154
169
|
}
|
|
155
170
|
|
|
156
171
|
return true;
|
|
@@ -248,22 +263,22 @@ var SingleList = {
|
|
|
248
263
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
249
264
|
},
|
|
250
265
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
251
|
-
var defaultQueryOptions;
|
|
252
266
|
var query = SingleList.defaultQuery(value, props);
|
|
253
267
|
|
|
254
268
|
if (this.defaultQuery) {
|
|
255
269
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
270
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
256
271
|
|
|
257
|
-
if (
|
|
258
|
-
query =
|
|
259
|
-
}
|
|
272
|
+
if (defaultQueryObj) {
|
|
273
|
+
query = defaultQueryObj;
|
|
274
|
+
} // Update calculated default query in store
|
|
260
275
|
|
|
261
|
-
defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
262
276
|
|
|
263
277
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
278
|
+
var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
279
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
264
280
|
}
|
|
265
281
|
|
|
266
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
267
282
|
this.updateQuery({
|
|
268
283
|
componentId: this.internalComponent,
|
|
269
284
|
query: query,
|
|
@@ -274,17 +289,15 @@ var SingleList = {
|
|
|
274
289
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
275
290
|
var customQuery = props.customQuery;
|
|
276
291
|
var query = SingleList.defaultQuery(value, props);
|
|
277
|
-
var customQueryOptions;
|
|
278
292
|
|
|
279
293
|
if (customQuery) {
|
|
280
|
-
var
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
294
|
+
var customQueryCalc = customQuery(value, props);
|
|
295
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
296
|
+
var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
284
297
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
298
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
285
299
|
}
|
|
286
300
|
|
|
287
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
288
301
|
this.updateQuery({
|
|
289
302
|
componentId: props.componentId,
|
|
290
303
|
query: query,
|
|
@@ -304,8 +317,8 @@ var SingleList = {
|
|
|
304
317
|
|
|
305
318
|
if (props.defaultQuery) {
|
|
306
319
|
var value = this.$data.currentValue;
|
|
307
|
-
var defaultQueryOptions =
|
|
308
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
320
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
321
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
309
322
|
} else {
|
|
310
323
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
311
324
|
}
|
|
@@ -449,6 +462,10 @@ SingleList.defaultQuery = function (value, props) {
|
|
|
449
462
|
return query;
|
|
450
463
|
};
|
|
451
464
|
|
|
465
|
+
SingleList.hasInternalComponent = function () {
|
|
466
|
+
return true;
|
|
467
|
+
};
|
|
468
|
+
|
|
452
469
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
453
470
|
return {
|
|
454
471
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -457,7 +474,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
457
474
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || '',
|
|
458
475
|
themePreset: state.config.themePreset,
|
|
459
476
|
error: state.error[props.componentId],
|
|
460
|
-
componentProps: state.props[props.componentId]
|
|
477
|
+
componentProps: state.props[props.componentId],
|
|
478
|
+
enableAppbase: state.config.enableAppbase
|
|
461
479
|
};
|
|
462
480
|
};
|
|
463
481
|
|
|
@@ -469,7 +487,7 @@ var mapDispatchtoProps = {
|
|
|
469
487
|
};
|
|
470
488
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleList), {
|
|
471
489
|
componentType: componentTypes.singleList,
|
|
472
|
-
internalComponent:
|
|
490
|
+
internalComponent: SingleList.hasInternalComponent()
|
|
473
491
|
});
|
|
474
492
|
|
|
475
493
|
SingleList.install = function (Vue) {
|