@appbaseio/reactivesearch-vue 1.33.0 → 1.33.2
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 +1916 -6072
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +3 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-0673191e.js → Button-841fd06d.js} +1 -7
- package/dist/cjs/{CancelSvg-9f258f4f.js → CancelSvg-220a7cc3.js} +24 -58
- package/dist/cjs/{Card-642547a8.js → Card-240f283d.js} +2 -2
- package/dist/cjs/{ComponentWrapper-981ab977.js → ComponentWrapper-9318cece.js} +21 -41
- package/dist/cjs/{Container-daf30918.js → Container-e699ea95.js} +1 -1
- package/dist/cjs/{DataSearch-708b183d.js → DataSearch-99a6a2e8.js} +121 -293
- package/dist/cjs/DataSearch.js +11 -11
- package/dist/cjs/{DropDown-c479bbb0.js → DropDown-8984b544.js} +27 -48
- package/dist/cjs/DynamicRangeSlider.js +44 -93
- package/dist/cjs/{Flex-aa517a13.js → Flex-ddd7cb6b.js} +1 -3
- package/dist/cjs/{FormControlList-c195a592.js → FormControlList-bbb5cd24.js} +1 -3
- package/dist/cjs/{Input-e6603a7e.js → Input-ead4cd84.js} +14 -16
- package/dist/cjs/{ListItem-8c9e0d68.js → ListItem-5088bd6a.js} +2 -3
- package/dist/cjs/MultiDropdownList.js +41 -102
- package/dist/cjs/MultiList.js +35 -98
- package/dist/cjs/MultiRange.js +20 -52
- package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
- package/dist/cjs/{PreferencesConsumer-7be03476.js → PreferencesConsumer-5d67b486.js} +13 -16
- package/dist/cjs/RangeInput.js +36 -52
- package/dist/cjs/RangeSlider.js +24 -48
- package/dist/cjs/ReactiveBase.js +34 -79
- package/dist/cjs/{ReactiveComponent-5ff98cce.js → ReactiveComponent-805201c6.js} +118 -301
- package/dist/cjs/ReactiveComponent.js +20 -20
- package/dist/cjs/ReactiveGoogleMap.js +167 -353
- package/dist/cjs/ReactiveList.js +88 -176
- package/dist/cjs/ResultCard.js +10 -18
- package/dist/cjs/ResultList.js +13 -24
- package/dist/cjs/SelectedFilters.js +16 -34
- package/dist/cjs/SingleDropdownList.js +35 -75
- package/dist/cjs/SingleList.js +29 -75
- package/dist/cjs/SingleRange.js +17 -40
- package/dist/cjs/StateProvider.js +6 -26
- package/dist/cjs/{Title-1de7d0f4.js → Title-16042ea0.js} +1 -1
- package/dist/cjs/ToggleButton.js +20 -58
- package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
- package/dist/cjs/{index-08f8dfa3.js → index-30126fd0.js} +39 -75
- package/dist/cjs/index.js +20 -21
- package/dist/cjs/initReactivesearch.js +49 -120
- package/dist/cjs/install.js +20 -20
- package/dist/cjs/{ssr-3027b848.js → ssr-f2fc1bf6.js} +1 -4
- package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-7cfc2f98.js} +6 -11
- package/dist/es/{Button-35aa984e.js → Button-153cd885.js} +1 -7
- package/dist/es/{CancelSvg-4cfae5fd.js → CancelSvg-e40552a5.js} +24 -58
- package/dist/es/{Card-450683f1.js → Card-19ad6d90.js} +2 -2
- package/dist/es/{ComponentWrapper-d5e814a4.js → ComponentWrapper-240450cc.js} +21 -41
- package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +1 -1
- package/dist/es/{DataSearch-5376d39a.js → DataSearch-20f0d8f1.js} +121 -293
- package/dist/es/DataSearch.js +11 -11
- package/dist/es/{DropDown-05a644a5.js → DropDown-28ddce07.js} +27 -48
- package/dist/es/DynamicRangeSlider.js +44 -93
- package/dist/es/{Flex-1f0795c3.js → Flex-7c177a10.js} +1 -3
- package/dist/es/{FormControlList-c22d64f6.js → FormControlList-99797d0a.js} +1 -3
- package/dist/es/{Input-7a2a9fac.js → Input-c09c0b56.js} +14 -16
- package/dist/es/{ListItem-cad14c5e.js → ListItem-07888a65.js} +2 -3
- package/dist/es/MultiDropdownList.js +41 -102
- package/dist/es/MultiList.js +35 -98
- package/dist/es/MultiRange.js +20 -52
- package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
- package/dist/es/{PreferencesConsumer-c30605fe.js → PreferencesConsumer-bc097ebb.js} +13 -16
- package/dist/es/RangeInput.js +36 -52
- package/dist/es/RangeSlider.js +24 -48
- package/dist/es/ReactiveBase.js +34 -79
- package/dist/es/{ReactiveComponent-ee01562d.js → ReactiveComponent-dd85aa9c.js} +118 -301
- package/dist/es/ReactiveComponent.js +20 -20
- package/dist/es/ReactiveGoogleMap.js +167 -353
- package/dist/es/ReactiveList.js +88 -176
- package/dist/es/ResultCard.js +10 -18
- package/dist/es/ResultList.js +13 -24
- package/dist/es/SelectedFilters.js +16 -34
- package/dist/es/SingleDropdownList.js +35 -75
- package/dist/es/SingleList.js +29 -75
- package/dist/es/SingleRange.js +17 -40
- package/dist/es/StateProvider.js +6 -26
- package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +1 -1
- package/dist/es/ToggleButton.js +20 -58
- package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
- package/dist/es/{index-99c5f9c9.js → index-0444a498.js} +39 -75
- package/dist/es/index.js +20 -21
- package/dist/es/initReactivesearch.js +49 -120
- package/dist/es/install.js +20 -20
- package/dist/es/{ssr-b2c0b401.js → ssr-03607d84.js} +1 -4
- package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-b8146772.js → vueTypes-8986b709.js} +6 -11
- package/package.json +1 -1
|
@@ -5,18 +5,16 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
5
5
|
var configureStore = require('@appbaseio/reactivecore');
|
|
6
6
|
var configureStore__default = _interopDefault(configureStore);
|
|
7
7
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
8
|
-
var Button = require('./Button-
|
|
9
|
-
var vueTypes = require('./vueTypes-
|
|
8
|
+
var Button = require('./Button-841fd06d.js');
|
|
9
|
+
var vueTypes = require('./vueTypes-7cfc2f98.js');
|
|
10
10
|
|
|
11
11
|
var getClassName = configureStore.helper.getClassName,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
handleA11yAction = configureStore.helper.handleA11yAction;
|
|
14
13
|
function getStartPage(totalPages, currentPage, showEndPage) {
|
|
15
14
|
var midValue = parseInt(totalPages / 2, 10);
|
|
16
15
|
var start = currentPage - (showEndPage ? Math.ceil(midValue / 2) - 1 : midValue);
|
|
17
16
|
return start > 1 ? start : 2;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
var Pagination = {
|
|
21
19
|
name: 'Pagination',
|
|
22
20
|
functional: true,
|
|
@@ -33,49 +31,40 @@ var Pagination = {
|
|
|
33
31
|
render: function render(createElement, context) {
|
|
34
32
|
var h = arguments[0];
|
|
35
33
|
var props = context.props;
|
|
36
|
-
|
|
37
34
|
var onPrevPage = function onPrevPage() {
|
|
38
35
|
if (props.currentPage) {
|
|
39
36
|
props.setPage(props.currentPage - 1);
|
|
40
37
|
}
|
|
41
38
|
};
|
|
42
|
-
|
|
43
39
|
var onNextPage = function onNextPage() {
|
|
44
40
|
if (props.currentPage < props.totalPages - 1) {
|
|
45
41
|
props.setPage(props.currentPage + 1);
|
|
46
42
|
}
|
|
47
43
|
};
|
|
48
|
-
|
|
49
44
|
if (!props.totalPages) {
|
|
50
45
|
return null;
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
var innerClassName = getClassName(props.innerClass, 'button');
|
|
54
48
|
var primary = props.currentPage === 0;
|
|
55
49
|
var className = innerClassName || primary ? innerClassName + " " + (primary ? 'active' : '') : '';
|
|
56
|
-
|
|
57
50
|
var buildPaginationDOM = function buildPaginationDOM(position) {
|
|
58
51
|
var pages = props.pages,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
currentPage = props.currentPage,
|
|
53
|
+
totalPages = props.totalPages,
|
|
54
|
+
setPage = props.setPage,
|
|
55
|
+
showEndPage = props.showEndPage;
|
|
63
56
|
var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
|
|
64
57
|
var paginationButtons = [];
|
|
65
58
|
var endPage = start;
|
|
66
|
-
|
|
67
59
|
if (start <= totalPages) {
|
|
68
60
|
var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
|
|
69
|
-
|
|
70
61
|
if (showEndPage) {
|
|
71
62
|
totalPagesToShow = position === 'start' ? start + (Math.ceil(pages / 2) - pages % 2) : totalPages + 1;
|
|
72
63
|
}
|
|
73
|
-
|
|
74
64
|
if (currentPage > totalPages - pages + 2) {
|
|
75
65
|
start = Math.max(2, totalPages - pages + 2);
|
|
76
66
|
totalPagesToShow = start + pages;
|
|
77
67
|
}
|
|
78
|
-
|
|
79
68
|
var _loop = function _loop(i) {
|
|
80
69
|
var activeButton = currentPage === i - 1;
|
|
81
70
|
var classNameBtn = innerClassName || activeButton ? innerClassName + " " + (activeButton ? 'active' : '') : '';
|
|
@@ -97,38 +86,30 @@ var Pagination = {
|
|
|
97
86
|
}
|
|
98
87
|
}
|
|
99
88
|
}, [i]);
|
|
100
|
-
|
|
101
89
|
if (i <= totalPages + 1) {
|
|
102
90
|
paginationButtons.push(pageBtn);
|
|
103
|
-
|
|
104
91
|
if (i === Math.min(totalPages + 1, totalPagesToShow) - 1) {
|
|
105
92
|
endPage = i;
|
|
106
93
|
}
|
|
107
94
|
}
|
|
108
95
|
};
|
|
109
|
-
|
|
110
96
|
for (var i = start; i < Math.min(totalPages + 1, totalPagesToShow); i += 1) {
|
|
111
97
|
_loop(i);
|
|
112
98
|
}
|
|
113
99
|
}
|
|
114
|
-
|
|
115
100
|
return [paginationButtons, start, endPage];
|
|
116
101
|
};
|
|
117
|
-
|
|
118
102
|
var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
|
|
119
103
|
var showEndPage = props.showEndPage,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
104
|
+
currentPage = props.currentPage,
|
|
105
|
+
totalPages = props.totalPages,
|
|
106
|
+
pages = props.pages;
|
|
123
107
|
if (!showEndPage) return buildPaginationDOM('start')[0];
|
|
124
|
-
|
|
125
108
|
if (currentPage <= totalPages - pages + 2 || totalPages < pages) {
|
|
126
109
|
return buildPaginationDOM('start')[0];
|
|
127
110
|
}
|
|
128
|
-
|
|
129
111
|
return null;
|
|
130
112
|
};
|
|
131
|
-
|
|
132
113
|
return h("div", {
|
|
133
114
|
"class": Button.pagination + " " + getClassName(props.innerClass, 'pagination')
|
|
134
115
|
}, [h(Button.Button, {
|
|
@@ -174,7 +155,6 @@ var Pagination = {
|
|
|
174
155
|
}, [props.nextLabel || 'Next'])]);
|
|
175
156
|
}
|
|
176
157
|
};
|
|
177
|
-
|
|
178
158
|
Pagination.install = function (Vue) {
|
|
179
159
|
Vue.component(Pagination.name, Pagination);
|
|
180
160
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
3
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
|
|
4
|
+
var index = require('./index-30126fd0.js');
|
|
4
5
|
|
|
5
6
|
var deepValue = function deepValue(o, p) {
|
|
6
7
|
return p.split('.').reduce(function (a, v) {
|
|
@@ -12,8 +13,6 @@ var deepValue = function deepValue(o, p) {
|
|
|
12
13
|
* and set the props from preferences to the component
|
|
13
14
|
*
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
16
|
var PreferencesConsumer = function PreferencesConsumer(component) {
|
|
18
17
|
return {
|
|
19
18
|
name: 'PreferencesConsumer',
|
|
@@ -23,42 +22,40 @@ var PreferencesConsumer = function PreferencesConsumer(component) {
|
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
24
|
render: function render(h) {
|
|
26
|
-
var
|
|
25
|
+
var _this = this;
|
|
26
|
+
var userProps = Object.keys(this.$attrs).reduce(function (result, key) {
|
|
27
|
+
var _extends2;
|
|
28
|
+
return _rollupPluginBabelHelpers._extends({}, result, (_extends2 = {}, _extends2[index.getCamelCase(key)] = _this.$attrs[key], _extends2));
|
|
29
|
+
}, {});
|
|
27
30
|
var context = this.$searchPreferences;
|
|
28
|
-
|
|
29
31
|
if (!userProps || !userProps.componentId) {
|
|
30
32
|
throw Error('ReactiveSearch: componentId is required');
|
|
31
33
|
}
|
|
32
|
-
|
|
33
34
|
var componentId = userProps.componentId;
|
|
34
35
|
var preferencesPath = userProps.preferencesPath;
|
|
35
36
|
var preferences;
|
|
36
|
-
|
|
37
37
|
if (context) {
|
|
38
38
|
if (preferencesPath) {
|
|
39
39
|
// read preferences from path
|
|
40
40
|
preferences = deepValue(context, preferencesPath);
|
|
41
41
|
} else {
|
|
42
|
-
preferences = deepValue(context, ['componentSettings', componentId].join('.'));
|
|
42
|
+
preferences = deepValue(context, ['componentSettings', componentId].join('.'));
|
|
43
|
+
// read preferences from componentSettings
|
|
43
44
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}
|
|
46
|
+
// Retrieve component specific preferences
|
|
47
47
|
var componentProps = userProps;
|
|
48
|
-
|
|
49
48
|
if (preferences) {
|
|
50
49
|
if (preferences.rsConfig) {
|
|
51
50
|
componentProps = _rollupPluginBabelHelpers._extends({}, preferences.rsConfig, componentProps);
|
|
52
51
|
} else {
|
|
53
52
|
componentProps = _rollupPluginBabelHelpers._extends({}, preferences, componentProps);
|
|
54
53
|
}
|
|
55
|
-
|
|
56
54
|
if (preferences.enabled !== undefined && !preferences.enabled) {
|
|
57
55
|
return null;
|
|
58
56
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
}
|
|
58
|
+
// Parse component props
|
|
62
59
|
Object.keys(componentProps).forEach(function (p) {
|
|
63
60
|
if (typeof componentProps[p] === 'string') {
|
|
64
61
|
if (['defaultQuery', 'customQuery', 'setOption'].includes(p)) {
|
package/dist/cjs/RangeInput.js
CHANGED
|
@@ -7,39 +7,37 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var configureStore = require('@appbaseio/reactivecore');
|
|
8
8
|
var configureStore__default = _interopDefault(configureStore);
|
|
9
9
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
10
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
10
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
|
|
11
11
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
12
12
|
var emotion = require('emotion');
|
|
13
13
|
var styled = require('@appbaseio/vue-emotion');
|
|
14
14
|
var styled__default = _interopDefault(styled);
|
|
15
15
|
require('polished');
|
|
16
|
-
var vueTypes = require('./vueTypes-
|
|
16
|
+
var vueTypes = require('./vueTypes-7cfc2f98.js');
|
|
17
17
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
18
18
|
require('redux');
|
|
19
|
-
var index = require('./index-
|
|
20
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
21
|
-
var PreferencesConsumer = require('./PreferencesConsumer-
|
|
22
|
-
require('./Title-
|
|
23
|
-
var Flex = require('./Flex-
|
|
24
|
-
var Input = require('./Input-
|
|
25
|
-
var Container = require('./Container-
|
|
19
|
+
var index = require('./index-30126fd0.js');
|
|
20
|
+
var ComponentWrapper = require('./ComponentWrapper-9318cece.js');
|
|
21
|
+
var PreferencesConsumer = require('./PreferencesConsumer-5d67b486.js');
|
|
22
|
+
require('./Title-16042ea0.js');
|
|
23
|
+
var Flex = require('./Flex-ddd7cb6b.js');
|
|
24
|
+
var Input = require('./Input-ead4cd84.js');
|
|
25
|
+
var Container = require('./Container-e699ea95.js');
|
|
26
26
|
require('vue-no-ssr');
|
|
27
|
-
require('./ssr-
|
|
27
|
+
require('./ssr-f2fc1bf6.js');
|
|
28
28
|
var RangeSlider = require('./RangeSlider.js');
|
|
29
29
|
|
|
30
30
|
var _templateObject, _templateObject2;
|
|
31
|
-
|
|
32
31
|
var alert = function alert(_ref) {
|
|
33
32
|
var theme = _ref.theme;
|
|
34
33
|
return emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
var Content = styled__default('div')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
38
36
|
return props.alert && alert;
|
|
39
37
|
});
|
|
40
38
|
|
|
41
39
|
var getClassName = configureStore.helper.getClassName,
|
|
42
|
-
|
|
40
|
+
isEqual = configureStore.helper.isEqual;
|
|
43
41
|
var RangeInput = {
|
|
44
42
|
name: 'RangeInput',
|
|
45
43
|
components: {
|
|
@@ -101,27 +99,22 @@ var RangeInput = {
|
|
|
101
99
|
methods: {
|
|
102
100
|
shouldUpdate: function shouldUpdate(value) {
|
|
103
101
|
var validateRange = this.$props.validateRange;
|
|
104
|
-
|
|
105
102
|
if (validateRange && value) {
|
|
106
103
|
return validateRange([value.start, value.end]);
|
|
107
104
|
}
|
|
108
|
-
|
|
109
105
|
if (value) {
|
|
110
106
|
return value.start <= value.end;
|
|
111
107
|
}
|
|
112
|
-
|
|
113
108
|
return false;
|
|
114
109
|
},
|
|
115
110
|
isControlled: function isControlled() {
|
|
116
111
|
if (this.$props.value && this.$listeners) {
|
|
117
112
|
return true;
|
|
118
113
|
}
|
|
119
|
-
|
|
120
114
|
return false;
|
|
121
115
|
},
|
|
122
116
|
handleChange: function handleChange(value, event) {
|
|
123
117
|
var currentValue = value;
|
|
124
|
-
|
|
125
118
|
if (this.shouldUpdate(value) && !isEqual(value, this.currentValue)) {
|
|
126
119
|
switch (event) {
|
|
127
120
|
case 'change':
|
|
@@ -131,16 +124,13 @@ var RangeInput = {
|
|
|
131
124
|
end: this.$props.range ? this.$props.range.end : 10
|
|
132
125
|
};
|
|
133
126
|
}
|
|
134
|
-
|
|
135
127
|
this.$data.currentValue = _rollupPluginBabelHelpers._extends({}, currentValue);
|
|
136
128
|
this.$emit('change', this.$data.currentValue);
|
|
137
129
|
break;
|
|
138
|
-
|
|
139
130
|
case 'value-change':
|
|
140
131
|
this.$emit('valueChange', this.$data.currentValue);
|
|
141
132
|
this.$emit('value-change', this.$data.currentValue);
|
|
142
133
|
break;
|
|
143
|
-
|
|
144
134
|
default:
|
|
145
135
|
this.$data.currentValue = _rollupPluginBabelHelpers._extends({}, currentValue);
|
|
146
136
|
break;
|
|
@@ -155,9 +145,8 @@ var RangeInput = {
|
|
|
155
145
|
},
|
|
156
146
|
handleInputChange: function handleInputChange(e) {
|
|
157
147
|
var _e$target = e.target,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
148
|
+
name = _e$target.name,
|
|
149
|
+
value = _e$target.value;
|
|
161
150
|
if (Number.isNaN(value)) {
|
|
162
151
|
if (name === 'start') {
|
|
163
152
|
this.$data.isStartValid = false;
|
|
@@ -169,7 +158,6 @@ var RangeInput = {
|
|
|
169
158
|
} else if (name === 'end' && !this.$data.isEndValid) {
|
|
170
159
|
this.$data.isEndValid = true;
|
|
171
160
|
}
|
|
172
|
-
|
|
173
161
|
if (this.$data.isStartValid && this.$data.isEndValid) {
|
|
174
162
|
if (name === 'start') {
|
|
175
163
|
this.handleChange({
|
|
@@ -203,7 +191,6 @@ var RangeInput = {
|
|
|
203
191
|
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
204
192
|
this.handleChange(this.$props.defaultValue);
|
|
205
193
|
}
|
|
206
|
-
|
|
207
194
|
if (this.isControlled()) {
|
|
208
195
|
this.handleChange(this.$props.value, 'change');
|
|
209
196
|
}
|
|
@@ -211,27 +198,27 @@ var RangeInput = {
|
|
|
211
198
|
render: function render() {
|
|
212
199
|
var h = arguments[0];
|
|
213
200
|
var _this$$props = this.$props,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
201
|
+
className = _this$$props.className,
|
|
202
|
+
dataField = _this$$props.dataField,
|
|
203
|
+
range = _this$$props.range,
|
|
204
|
+
rangeLabels = _this$$props.rangeLabels,
|
|
205
|
+
componentId = _this$$props.componentId,
|
|
206
|
+
innerClass = _this$$props.innerClass,
|
|
207
|
+
stepValue = _this$$props.stepValue,
|
|
208
|
+
componentStyle = _this$$props.componentStyle,
|
|
209
|
+
themePreset = _this$$props.themePreset,
|
|
210
|
+
includeNullValues = _this$$props.includeNullValues,
|
|
211
|
+
beforeValueChange = _this$$props.beforeValueChange,
|
|
212
|
+
customQuery = _this$$props.customQuery,
|
|
213
|
+
data = _this$$props.data,
|
|
214
|
+
filterLabel = _this$$props.filterLabel,
|
|
215
|
+
react = _this$$props.react,
|
|
216
|
+
showFilter = _this$$props.showFilter,
|
|
217
|
+
showCheckbox = _this$$props.showCheckbox,
|
|
218
|
+
title = _this$$props.title,
|
|
219
|
+
URLParams = _this$$props.URLParams,
|
|
220
|
+
sliderOptions = _this$$props.sliderOptions,
|
|
221
|
+
nestedField = _this$$props.nestedField;
|
|
235
222
|
return h(Container.Container, {
|
|
236
223
|
"style": componentStyle,
|
|
237
224
|
"class": className
|
|
@@ -327,22 +314,19 @@ var RangeInput = {
|
|
|
327
314
|
}, ["Input range is invalid"])])])]);
|
|
328
315
|
}
|
|
329
316
|
};
|
|
330
|
-
|
|
331
317
|
var mapStateToProps = function mapStateToProps(state) {
|
|
332
318
|
return {
|
|
333
319
|
themePreset: state.config.themePreset
|
|
334
320
|
};
|
|
335
321
|
};
|
|
336
|
-
|
|
337
322
|
var RangeConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, {})(RangeInput), {
|
|
338
323
|
componentType: constants.componentTypes.rangeInput
|
|
339
324
|
}));
|
|
340
|
-
|
|
341
325
|
RangeInput.install = function (Vue) {
|
|
342
326
|
Vue.component(RangeInput.name, RangeConnected);
|
|
343
|
-
};
|
|
344
|
-
|
|
327
|
+
};
|
|
345
328
|
|
|
329
|
+
// Add componentType for SSR
|
|
346
330
|
RangeInput.componentType = constants.componentTypes.rangeInput;
|
|
347
331
|
|
|
348
332
|
exports.RangeConnected = RangeConnected;
|
package/dist/cjs/RangeSlider.js
CHANGED
|
@@ -7,27 +7,27 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var configureStore = require('@appbaseio/reactivecore');
|
|
8
8
|
var configureStore__default = _interopDefault(configureStore);
|
|
9
9
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
10
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
10
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
|
|
11
11
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
12
12
|
require('@appbaseio/vue-emotion');
|
|
13
|
-
var vueTypes = require('./vueTypes-
|
|
13
|
+
var vueTypes = require('./vueTypes-7cfc2f98.js');
|
|
14
14
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
15
15
|
require('redux');
|
|
16
|
-
var index = require('./index-
|
|
17
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
18
|
-
var PreferencesConsumer = require('./PreferencesConsumer-
|
|
19
|
-
var Title = require('./Title-
|
|
20
|
-
var Container = require('./Container-
|
|
16
|
+
var index = require('./index-30126fd0.js');
|
|
17
|
+
var ComponentWrapper = require('./ComponentWrapper-9318cece.js');
|
|
18
|
+
var PreferencesConsumer = require('./PreferencesConsumer-5d67b486.js');
|
|
19
|
+
var Title = require('./Title-16042ea0.js');
|
|
20
|
+
var Container = require('./Container-e699ea95.js');
|
|
21
21
|
var NoSSR = _interopDefault(require('vue-no-ssr'));
|
|
22
|
-
var ssr = require('./ssr-
|
|
22
|
+
var ssr = require('./ssr-f2fc1bf6.js');
|
|
23
23
|
|
|
24
24
|
var updateQuery = configureStore.Actions.updateQuery,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
setQueryOptions = configureStore.Actions.setQueryOptions,
|
|
26
|
+
setCustomQuery = configureStore.Actions.setCustomQuery;
|
|
27
27
|
var checkValueChange = configureStore.helper.checkValueChange,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
getClassName = configureStore.helper.getClassName,
|
|
29
|
+
getOptionsFromQuery = configureStore.helper.getOptionsFromQuery,
|
|
30
|
+
isEqual = configureStore.helper.isEqual;
|
|
31
31
|
var RangeSlider = {
|
|
32
32
|
name: 'RangeSlider',
|
|
33
33
|
components: ssr.getComponents(),
|
|
@@ -72,7 +72,6 @@ var RangeSlider = {
|
|
|
72
72
|
methods: {
|
|
73
73
|
handleSliderChange: function handleSliderChange(values) {
|
|
74
74
|
var value = this.$props.value;
|
|
75
|
-
|
|
76
75
|
if (value === undefined) {
|
|
77
76
|
this.handleChange(values);
|
|
78
77
|
} else {
|
|
@@ -88,27 +87,21 @@ var RangeSlider = {
|
|
|
88
87
|
},
|
|
89
88
|
handleChange: function handleChange(currentValue, props) {
|
|
90
89
|
var _this = this;
|
|
91
|
-
|
|
92
90
|
if (props === void 0) {
|
|
93
91
|
props = this.$props;
|
|
94
92
|
}
|
|
95
|
-
|
|
96
93
|
var performUpdate = function performUpdate() {
|
|
97
94
|
_this.currentValue = currentValue;
|
|
98
|
-
|
|
99
95
|
_this.updateQueryHandler([currentValue[0], currentValue[1]], props);
|
|
100
|
-
|
|
101
96
|
_this.$emit('valueChange', {
|
|
102
97
|
start: currentValue[0],
|
|
103
98
|
end: currentValue[1]
|
|
104
99
|
});
|
|
105
|
-
|
|
106
100
|
_this.$emit('value-change', {
|
|
107
101
|
start: currentValue[0],
|
|
108
102
|
end: currentValue[1]
|
|
109
103
|
});
|
|
110
104
|
};
|
|
111
|
-
|
|
112
105
|
checkValueChange(props.componentId, {
|
|
113
106
|
start: currentValue[0],
|
|
114
107
|
end: currentValue[1]
|
|
@@ -117,23 +110,20 @@ var RangeSlider = {
|
|
|
117
110
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
118
111
|
var customQuery = props.customQuery;
|
|
119
112
|
var query = RangeSlider.defaultQuery(value, props);
|
|
120
|
-
|
|
121
113
|
if (customQuery) {
|
|
122
114
|
var _ref = customQuery(value, props) || {};
|
|
123
|
-
|
|
124
115
|
query = _ref.query;
|
|
125
116
|
var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
126
117
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
127
118
|
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
128
119
|
}
|
|
129
|
-
|
|
130
120
|
var showFilter = props.showFilter,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
_props$range = props.range,
|
|
122
|
+
start = _props$range.start,
|
|
123
|
+
end = _props$range.end;
|
|
134
124
|
var currentStart = value[0],
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
currentEnd = value[1];
|
|
126
|
+
// check if the slider is at its initial position
|
|
137
127
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
138
128
|
this.updateQuery({
|
|
139
129
|
componentId: props.componentId,
|
|
@@ -171,20 +161,17 @@ var RangeSlider = {
|
|
|
171
161
|
if (!this.$props.range) {
|
|
172
162
|
console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
|
|
173
163
|
}
|
|
174
|
-
|
|
175
164
|
if (!this.enableAppbase && this.$props.index) {
|
|
176
165
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
}
|
|
167
|
+
// Set custom query in store
|
|
180
168
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
181
169
|
},
|
|
182
170
|
beforeMount: function beforeMount() {
|
|
183
171
|
var _this$$props = this.$props,
|
|
184
|
-
|
|
185
|
-
|
|
172
|
+
value = _this$$props.value,
|
|
173
|
+
defaultValue = _this$$props.defaultValue;
|
|
186
174
|
var selectedValue = this.selectedValue;
|
|
187
|
-
|
|
188
175
|
if (this.$props.range) {
|
|
189
176
|
if (Array.isArray(selectedValue)) {
|
|
190
177
|
this.handleChange(selectedValue);
|
|
@@ -229,13 +216,10 @@ var RangeSlider = {
|
|
|
229
216
|
}, [this.$props.rangeLabels.end])])])]) : null]);
|
|
230
217
|
}
|
|
231
218
|
};
|
|
232
|
-
|
|
233
219
|
RangeSlider.defaultQuery = function (values, props) {
|
|
234
220
|
var query = null;
|
|
235
|
-
|
|
236
221
|
if (Array.isArray(values) && values.length) {
|
|
237
222
|
var _range;
|
|
238
|
-
|
|
239
223
|
query = {
|
|
240
224
|
range: (_range = {}, _range[props.dataField] = {
|
|
241
225
|
gte: values[0],
|
|
@@ -244,7 +228,6 @@ RangeSlider.defaultQuery = function (values, props) {
|
|
|
244
228
|
}, _range)
|
|
245
229
|
};
|
|
246
230
|
}
|
|
247
|
-
|
|
248
231
|
if (query && props.nestedField) {
|
|
249
232
|
return {
|
|
250
233
|
query: {
|
|
@@ -255,22 +238,17 @@ RangeSlider.defaultQuery = function (values, props) {
|
|
|
255
238
|
}
|
|
256
239
|
};
|
|
257
240
|
}
|
|
258
|
-
|
|
259
241
|
return query;
|
|
260
242
|
};
|
|
261
|
-
|
|
262
243
|
RangeSlider.parseValue = function (value, props) {
|
|
263
244
|
if (value) {
|
|
264
245
|
return Array.isArray(value) ? value : [value.start, value.end];
|
|
265
246
|
}
|
|
266
|
-
|
|
267
247
|
if (props.range) {
|
|
268
248
|
return [props.range.start, props.range.end];
|
|
269
249
|
}
|
|
270
|
-
|
|
271
250
|
return [];
|
|
272
251
|
};
|
|
273
|
-
|
|
274
252
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
275
253
|
return {
|
|
276
254
|
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
@@ -280,7 +258,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
280
258
|
enableAppbase: state.config.enableAppbase
|
|
281
259
|
};
|
|
282
260
|
};
|
|
283
|
-
|
|
284
261
|
var mapDispatchtoProps = {
|
|
285
262
|
updateQuery: updateQuery,
|
|
286
263
|
setQueryOptions: setQueryOptions,
|
|
@@ -289,12 +266,11 @@ var mapDispatchtoProps = {
|
|
|
289
266
|
var RangeConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchtoProps)(RangeSlider), {
|
|
290
267
|
componentType: constants.componentTypes.rangeSlider
|
|
291
268
|
}));
|
|
292
|
-
|
|
293
269
|
RangeSlider.install = function (Vue) {
|
|
294
270
|
Vue.component(RangeSlider.name, RangeConnected);
|
|
295
|
-
};
|
|
296
|
-
|
|
271
|
+
};
|
|
297
272
|
|
|
273
|
+
// Add componentType for SSR
|
|
298
274
|
RangeSlider.componentType = constants.componentTypes.rangeSlider;
|
|
299
275
|
|
|
300
276
|
exports.RangeConnected = RangeConnected;
|