@appbaseio/reactivesearch-vue 1.33.1 → 1.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +2888 -6530
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +7 -9
- 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-c42d8681.js → DataSearch-e4822dbf.js} +131 -299
- 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 +27 -53
- package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
- package/dist/cjs/{PreferencesConsumer-4707bd94.js → PreferencesConsumer-5d67b486.js} +8 -18
- package/dist/cjs/RangeInput.js +36 -52
- package/dist/cjs/RangeSlider.js +24 -48
- package/dist/cjs/ReactiveBase.js +66 -81
- package/dist/cjs/{ReactiveComponent-63ef70c2.js → ReactiveComponent-b8efb0cf.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 +28 -32
- 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 +21 -22
- package/dist/cjs/initReactivesearch.js +49 -120
- package/dist/cjs/install.js +21 -21
- 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-d56bf07a.js → DataSearch-5ddfba23.js} +131 -299
- 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 +27 -53
- package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
- package/dist/es/{PreferencesConsumer-4169deb1.js → PreferencesConsumer-bc097ebb.js} +8 -18
- package/dist/es/RangeInput.js +36 -52
- package/dist/es/RangeSlider.js +24 -48
- package/dist/es/ReactiveBase.js +66 -81
- package/dist/es/{ReactiveComponent-9e4721e1.js → ReactiveComponent-59107264.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 +29 -33
- 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 +21 -22
- package/dist/es/initReactivesearch.js +49 -120
- package/dist/es/install.js +21 -21
- 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 +3 -2
package/dist/cjs/version.js
CHANGED
|
@@ -4,40 +4,35 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
4
4
|
|
|
5
5
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
6
6
|
|
|
7
|
+
// import dateFormats from './dateFormats';
|
|
8
|
+
|
|
7
9
|
VueTypes.sensibleDefaults = false;
|
|
8
10
|
var reactKeyType = VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string), VueTypes.object, VueTypes.arrayOf(VueTypes.object)]);
|
|
9
|
-
|
|
10
11
|
function validateLocation(value) {
|
|
11
12
|
if (!value || !value.lat || !value.lng) {
|
|
12
13
|
console.error(new Error('location must be an object with lat and lng keys defined'));
|
|
13
14
|
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
}
|
|
16
|
+
// eslint-disable-next-line
|
|
17
17
|
if (isNaN(value.lat)) {
|
|
18
18
|
console.error(new Error('lat value must be a number'));
|
|
19
19
|
return false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
}
|
|
21
|
+
// eslint-disable-next-line
|
|
23
22
|
if (isNaN(value.lat)) {
|
|
24
23
|
console.error(new Error('lng value must be a number'));
|
|
25
24
|
return false;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
if (value.lat < -90 || value.lat > 90) {
|
|
29
27
|
console.error(new Error('lat value should be between -90 and 90.'));
|
|
30
28
|
return false;
|
|
31
29
|
}
|
|
32
|
-
|
|
33
30
|
if (value.lat < -180 || value.lat > 180) {
|
|
34
31
|
console.error(new Error('lng value should be between -180 and 180.'));
|
|
35
32
|
return false;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
return true;
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
var types = {
|
|
42
37
|
any: VueTypes.any,
|
|
43
38
|
bool: VueTypes.bool,
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { darken, rgba, lighten } from 'polished';
|
|
5
5
|
|
|
6
6
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
7
|
-
|
|
8
7
|
var filters = function filters(_ref) {
|
|
9
8
|
var borderColor = _ref.colors.borderColor;
|
|
10
9
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tmargin: 0 -3px;\n\tmax-width: 100%;\n\n\tbutton {\n\t\tmargin: 2px 3px;\n\t\tpadding: 5px 8px;\n\t\tfont-size: 0.85rem;\n\t\tposition: relative;\n\n\t\tspan:first-child {\n\t\t\tmax-width: 260px;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-right: 26px;\n\t\t}\n\n\t\tspan:last-child {\n\t\t\tdisplay: flex;\n\t\t\theight: 100%;\n\t\t\ttop: 0;\n\t\t\tright: 8px;\n\t\t\tposition: absolute;\n\t\t\talign-items: center;\n\t\t\tborder-left: 1px solid ", ";\n\t\t\tpadding-left: 8px;\n\t\t\tmargin-left: 8px;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tspan:first-child {\n\t\t\t\ttext-decoration: line-through;\n\t\t\t}\n\t\t}\n\t}\n"])), borderColor || '#fff');
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
var pagination = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tmargin: 10px -3px;\n\tmax-width: 100%;\n\ttext-align: center;\n\n\tbutton {\n\t\tmargin: 0 3px;\n\t}\n"])));
|
|
14
12
|
var toggleButtons = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\tmargin: 0 -3px;\n\tmax-width: 100%;\n\n\tbutton {\n\t\tmargin: 3px 3px;\n\t}\n"])));
|
|
15
13
|
var numberBoxContainer = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\tmargin: 0 -5px;\n\tbutton {\n\t\tmargin: 5px;\n\t}\n\tspan {\n\t\tmargin: 0 5px;\n\t}\n"])));
|
|
16
|
-
|
|
17
14
|
var primary = function primary(_ref2) {
|
|
18
15
|
var theme = _ref2.theme;
|
|
19
16
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.primaryColor, theme.colors.primaryTextColor, darken(0.1, theme.colors.primaryColor));
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
var large = function large() {
|
|
23
19
|
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\tmin-height: 40px;\n\tpadding: 10px 20px;\n"])));
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
var disabled = function disabled(_ref3) {
|
|
27
22
|
var theme = _ref3.theme;
|
|
28
23
|
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: #ccc;\n\tcursor: not-allowed;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor ? lighten(0.1, theme.colors.backgroundColor) : '#fafafa', theme.colors.backgroundColor ? lighten(0.2, theme.colors.backgroundColor) : '#fafafa');
|
|
29
24
|
};
|
|
30
|
-
|
|
31
25
|
var Button = styled('button')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\talign-items: center;\n\tborder-radius: 3px;\n\tborder: 1px solid transparent;\n\tmin-height: 30px;\n\tword-wrap: break-word;\n\tpadding: 5px 12px;\n\tline-height: 1.2rem;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:focus {\n\t\toutline: 0;\n\t\tborder-color: ", ";\n\t\tbox-shadow: ", ";\n\t}\n\n\t", ";\n\t", ";\n\t", ";\n\n\t&.enter-btn {\n\t\tborder-top-left-radius: 0px;\n\t\tborder-bottom-left-radius: 0px;\n\t\theight: 100%;\n\t}\n"])), function (_ref4) {
|
|
32
26
|
var theme = _ref4.theme;
|
|
33
27
|
return theme.colors.backgroundColor || '#eee';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
2
|
import styled, { css } from '@appbaseio/vue-emotion';
|
|
3
3
|
import computeScrollIntoView from 'compute-scroll-into-view';
|
|
4
4
|
|
|
@@ -8,11 +8,9 @@ var InputWrapper = styled('span')(_templateObject || (_templateObject = _taggedT
|
|
|
8
8
|
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
|
9
9
|
var IconGroup = styled('div')(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgrid-gap: 6px;\n\tmargin: 0 10px;\n\theight: 100%;\n\n\t", ";\n\n\t", ";\n"])), function (_ref) {
|
|
10
10
|
var positionType = _ref.positionType;
|
|
11
|
-
|
|
12
11
|
if (positionType === 'absolute') {
|
|
13
12
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 50%;\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t"])));
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
return null;
|
|
17
15
|
}, function (_ref2) {
|
|
18
16
|
var groupPosition = _ref2.groupPosition;
|
|
@@ -34,12 +32,10 @@ var IconWrapper = styled('div')(_templateObject$2 || (_templateObject$2 = _tagge
|
|
|
34
32
|
* @param {HTMLElement} rootNode the root element of the component
|
|
35
33
|
*/
|
|
36
34
|
// eslint-disable-next-line
|
|
37
|
-
|
|
38
35
|
var scrollIntoView = function scrollIntoView(node, rootNode) {
|
|
39
36
|
if (node === null) {
|
|
40
37
|
return;
|
|
41
38
|
}
|
|
42
|
-
|
|
43
39
|
var actions = computeScrollIntoView(node, {
|
|
44
40
|
boundary: rootNode,
|
|
45
41
|
block: 'nearest',
|
|
@@ -47,8 +43,8 @@ var scrollIntoView = function scrollIntoView(node, rootNode) {
|
|
|
47
43
|
});
|
|
48
44
|
actions.forEach(function (_ref) {
|
|
49
45
|
var el = _ref.el,
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
top = _ref.top,
|
|
47
|
+
left = _ref.left;
|
|
52
48
|
el.scrollTop = top;
|
|
53
49
|
el.scrollLeft = left;
|
|
54
50
|
});
|
|
@@ -69,10 +65,8 @@ var Downshift = {
|
|
|
69
65
|
computed: {
|
|
70
66
|
mergedState: function mergedState() {
|
|
71
67
|
var _this = this;
|
|
72
|
-
|
|
73
68
|
return Object.keys(this.$props).reduce(function (state, key) {
|
|
74
69
|
var _extends2;
|
|
75
|
-
|
|
76
70
|
return _extends({}, state, (_extends2 = {}, _extends2[key] = _this.isControlledProp(key) ? _this.$props[key] : _this["internal_" + key], _extends2));
|
|
77
71
|
}, {});
|
|
78
72
|
},
|
|
@@ -94,12 +88,10 @@ var Downshift = {
|
|
|
94
88
|
},
|
|
95
89
|
handleWindowMouseup: function handleWindowMouseup(event) {
|
|
96
90
|
this.isMouseDown = false;
|
|
97
|
-
|
|
98
91
|
if ((event.target === this.$refs.rootNode || !this.$refs.rootNode.contains(event.target)) && this.mergedState.isOpen) {
|
|
99
92
|
// TODO: handle on outer click here
|
|
100
93
|
if (!this.isMouseDown) {
|
|
101
94
|
this.reset();
|
|
102
|
-
|
|
103
95
|
if (this.$props.handleMouseup) {
|
|
104
96
|
this.$props.handleMouseup({
|
|
105
97
|
isOpen: false
|
|
@@ -111,7 +103,6 @@ var Downshift = {
|
|
|
111
103
|
keyDownArrowDown: function keyDownArrowDown(event) {
|
|
112
104
|
event.preventDefault();
|
|
113
105
|
var amount = event.shiftKey ? 5 : 1;
|
|
114
|
-
|
|
115
106
|
if (this.mergedState.isOpen) {
|
|
116
107
|
this.changeHighlightedIndex(amount);
|
|
117
108
|
} else {
|
|
@@ -124,7 +115,6 @@ var Downshift = {
|
|
|
124
115
|
keyDownArrowUp: function keyDownArrowUp(event) {
|
|
125
116
|
event.preventDefault();
|
|
126
117
|
var amount = event.shiftKey ? -5 : -1;
|
|
127
|
-
|
|
128
118
|
if (this.mergedState.isOpen) {
|
|
129
119
|
this.changeHighlightedIndex(amount);
|
|
130
120
|
} else {
|
|
@@ -149,26 +139,21 @@ var Downshift = {
|
|
|
149
139
|
},
|
|
150
140
|
selectItemAtIndex: function selectItemAtIndex(itemIndex) {
|
|
151
141
|
var item = this.items[itemIndex];
|
|
152
|
-
|
|
153
142
|
if (item == null) {
|
|
154
143
|
return;
|
|
155
144
|
}
|
|
156
|
-
|
|
157
145
|
this.selectItem(item);
|
|
158
146
|
},
|
|
159
147
|
selectItem: function selectItem(item) {
|
|
160
148
|
if (this.$props.handleChange) {
|
|
161
149
|
this.$props.handleChange(item);
|
|
162
150
|
}
|
|
163
|
-
|
|
164
151
|
function getInputValue() {
|
|
165
152
|
if (this.isControlledProp('selectedItem')) {
|
|
166
153
|
return '';
|
|
167
154
|
}
|
|
168
|
-
|
|
169
155
|
return typeof item === 'object' ? item.label || '' : item;
|
|
170
156
|
}
|
|
171
|
-
|
|
172
157
|
this.setState({
|
|
173
158
|
isOpen: false,
|
|
174
159
|
highlightedIndex: null,
|
|
@@ -180,34 +165,29 @@ var Downshift = {
|
|
|
180
165
|
if (this.internalItemCount < 0) {
|
|
181
166
|
return;
|
|
182
167
|
}
|
|
183
|
-
|
|
184
168
|
var highlightedIndex = this.mergedState.highlightedIndex;
|
|
185
169
|
var baseIndex = highlightedIndex;
|
|
186
|
-
|
|
187
170
|
if (baseIndex === null) {
|
|
188
171
|
baseIndex = moveAmount > 0 ? -1 : this.internalItemCount + 1;
|
|
189
172
|
}
|
|
190
|
-
|
|
191
173
|
var newIndex = baseIndex + moveAmount;
|
|
192
|
-
|
|
193
174
|
if (newIndex < 0) {
|
|
194
175
|
newIndex = this.internalItemCount;
|
|
195
176
|
} else if (newIndex > this.internalItemCount) {
|
|
196
177
|
newIndex = 0;
|
|
197
178
|
}
|
|
198
|
-
|
|
199
179
|
this.setHighlightedIndex(newIndex);
|
|
200
180
|
},
|
|
201
181
|
setHighlightedIndex: function setHighlightedIndex(highlightedIndex) {
|
|
202
182
|
if (highlightedIndex === void 0) {
|
|
203
183
|
highlightedIndex = null;
|
|
204
184
|
}
|
|
205
|
-
|
|
206
185
|
this.setState({
|
|
207
186
|
highlightedIndex: highlightedIndex
|
|
208
187
|
});
|
|
209
188
|
var element = document.getElementById("Downshift" + highlightedIndex);
|
|
210
|
-
scrollIntoView(element, this.rootNode);
|
|
189
|
+
scrollIntoView(element, this.rootNode);
|
|
190
|
+
// Implement scrollIntroView thingy
|
|
211
191
|
},
|
|
212
192
|
reset: function reset() {
|
|
213
193
|
var selectedItem = this.mergedState.selectedItem;
|
|
@@ -219,34 +199,29 @@ var Downshift = {
|
|
|
219
199
|
},
|
|
220
200
|
getItemProps: function getItemProps(_ref) {
|
|
221
201
|
var index = _ref.index,
|
|
222
|
-
|
|
202
|
+
item = _ref.item;
|
|
223
203
|
var newIndex = index;
|
|
224
|
-
|
|
225
204
|
if (index === undefined) {
|
|
226
205
|
if (this.$props.itemToString) {
|
|
227
206
|
this.items.push(this.$props.itemToString(item));
|
|
228
207
|
} else {
|
|
229
208
|
this.items.push(item);
|
|
230
209
|
}
|
|
231
|
-
|
|
232
210
|
newIndex = this.items.indexOf(item);
|
|
233
211
|
} else {
|
|
234
212
|
this.items[newIndex] = item;
|
|
235
213
|
}
|
|
236
|
-
|
|
237
214
|
return {
|
|
238
215
|
id: "Downshift" + newIndex
|
|
239
216
|
};
|
|
240
217
|
},
|
|
241
218
|
getItemEvents: function getItemEvents(_ref2) {
|
|
242
219
|
var index = _ref2.index,
|
|
243
|
-
|
|
220
|
+
item = _ref2.item;
|
|
244
221
|
var newIndex = index;
|
|
245
|
-
|
|
246
222
|
if (index === undefined) {
|
|
247
223
|
newIndex = this.items.indexOf(item);
|
|
248
224
|
}
|
|
249
|
-
|
|
250
225
|
var vm = this;
|
|
251
226
|
return {
|
|
252
227
|
mouseenter: function mouseenter() {
|
|
@@ -261,31 +236,27 @@ var Downshift = {
|
|
|
261
236
|
getInputProps: function getInputProps(_ref3) {
|
|
262
237
|
var value = _ref3.value;
|
|
263
238
|
var inputValue = this.mergedState.inputValue;
|
|
264
|
-
|
|
265
239
|
if (value !== inputValue) {
|
|
266
240
|
this.setState({
|
|
267
241
|
inputValue: value
|
|
268
242
|
});
|
|
269
243
|
}
|
|
270
|
-
|
|
271
244
|
return {
|
|
272
245
|
value: inputValue
|
|
273
246
|
};
|
|
274
247
|
},
|
|
275
248
|
getButtonProps: function getButtonProps(_ref4) {
|
|
276
249
|
var _this2 = this;
|
|
277
|
-
|
|
278
250
|
var onClick = _ref4.onClick,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
251
|
+
onKeyDown = _ref4.onKeyDown,
|
|
252
|
+
onKeyUp = _ref4.onKeyUp,
|
|
253
|
+
onBlur = _ref4.onBlur;
|
|
282
254
|
return {
|
|
283
255
|
click: function click(event) {
|
|
284
256
|
_this2.setState({
|
|
285
257
|
isOpen: true,
|
|
286
258
|
inputValue: event.target.value
|
|
287
259
|
});
|
|
288
|
-
|
|
289
260
|
if (onClick) {
|
|
290
261
|
onClick(event);
|
|
291
262
|
}
|
|
@@ -294,7 +265,6 @@ var Downshift = {
|
|
|
294
265
|
if (event.key && _this2["keyDown" + event.key]) {
|
|
295
266
|
_this2["keyDown" + event.key].call(_this2, event);
|
|
296
267
|
}
|
|
297
|
-
|
|
298
268
|
if (onKeyDown) {
|
|
299
269
|
onKeyDown(event);
|
|
300
270
|
}
|
|
@@ -313,21 +283,19 @@ var Downshift = {
|
|
|
313
283
|
},
|
|
314
284
|
getInputEvents: function getInputEvents(_ref5) {
|
|
315
285
|
var _this3 = this;
|
|
316
|
-
|
|
317
286
|
var onInput = _ref5.onInput,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
287
|
+
onBlur = _ref5.onBlur,
|
|
288
|
+
onFocus = _ref5.onFocus,
|
|
289
|
+
onKeyPress = _ref5.onKeyPress,
|
|
290
|
+
onKeyDown = _ref5.onKeyDown,
|
|
291
|
+
onKeyUp = _ref5.onKeyUp,
|
|
292
|
+
onClick = _ref5.onClick;
|
|
324
293
|
return {
|
|
325
294
|
input: function input(event) {
|
|
326
295
|
_this3.setState({
|
|
327
296
|
isOpen: true,
|
|
328
297
|
inputValue: event.target.value
|
|
329
298
|
});
|
|
330
|
-
|
|
331
299
|
if (onInput) {
|
|
332
300
|
onInput(event);
|
|
333
301
|
}
|
|
@@ -341,7 +309,6 @@ var Downshift = {
|
|
|
341
309
|
if (event.key && _this3["keyDown" + event.key]) {
|
|
342
310
|
_this3["keyDown" + event.key].call(_this3, event);
|
|
343
311
|
}
|
|
344
|
-
|
|
345
312
|
if (onKeyDown) {
|
|
346
313
|
onKeyDown(event);
|
|
347
314
|
}
|
|
@@ -359,20 +326,21 @@ var Downshift = {
|
|
|
359
326
|
blur: function blur(event) {
|
|
360
327
|
if (onBlur) {
|
|
361
328
|
onBlur(event);
|
|
362
|
-
}
|
|
329
|
+
}
|
|
330
|
+
// TODO: implement isMouseDown
|
|
363
331
|
// this.reset()
|
|
364
|
-
|
|
365
332
|
},
|
|
333
|
+
|
|
366
334
|
click: onClick
|
|
367
335
|
};
|
|
368
336
|
},
|
|
369
337
|
getHelpersAndState: function getHelpersAndState() {
|
|
370
338
|
var getItemProps = this.getItemProps,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
339
|
+
getItemEvents = this.getItemEvents,
|
|
340
|
+
getInputProps = this.getInputProps,
|
|
341
|
+
getInputEvents = this.getInputEvents,
|
|
342
|
+
getButtonProps = this.getButtonProps,
|
|
343
|
+
setHighlightedIndex = this.setHighlightedIndex;
|
|
376
344
|
return _extends({
|
|
377
345
|
getItemProps: getItemProps,
|
|
378
346
|
getItemEvents: getItemEvents,
|
|
@@ -387,13 +355,11 @@ var Downshift = {
|
|
|
387
355
|
},
|
|
388
356
|
setState: function setState(stateToSet) {
|
|
389
357
|
var _this4 = this;
|
|
390
|
-
|
|
391
358
|
// eslint-disable-next-line
|
|
392
359
|
Object.keys(stateToSet).forEach(function (key) {
|
|
393
360
|
// eslint-disable-next-line
|
|
394
361
|
if (_this4.isControlledProp(key)) {
|
|
395
362
|
_this4.$emit(key + "Change", stateToSet[key]);
|
|
396
|
-
|
|
397
363
|
_this4.$emit(key + "-change", stateToSet[key]);
|
|
398
364
|
} else {
|
|
399
365
|
_this4["internal_" + key] = stateToSet[key];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { lighten } from 'polished';
|
|
5
|
-
import './Title-
|
|
5
|
+
import './Title-863dfa42.js';
|
|
6
6
|
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3;
|
|
8
8
|
var container = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n\tflex-wrap: wrap;\n\tmargin: 0 -8px;\n\n\t@media (max-width: 420px) {\n\t\tmargin: 0;\n\t}\n"])));
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
3
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
5
5
|
import { getInternalComponentID } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
6
|
-
import { c as connect, b as getCamelCase, d as getValidPropsKeys } from './index-
|
|
6
|
+
import { c as connect, b as getCamelCase, d as getValidPropsKeys } from './index-0444a498.js';
|
|
7
7
|
|
|
8
8
|
var addComponent = Actions.addComponent,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
removeComponent = Actions.removeComponent,
|
|
10
|
+
watchComponent = Actions.watchComponent,
|
|
11
|
+
setQueryListener = Actions.setQueryListener,
|
|
12
|
+
setComponentProps = Actions.setComponentProps,
|
|
13
|
+
updateComponentProps = Actions.updateComponentProps;
|
|
14
14
|
var pushToAndClause = helper.pushToAndClause,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
checkPropChange = helper.checkPropChange,
|
|
16
|
+
checkSomePropChange = helper.checkSomePropChange;
|
|
17
|
+
|
|
17
18
|
/**
|
|
18
19
|
* ComponentWrapper component is a wrapper component for each ReactiveSearch component
|
|
19
20
|
* which is responsible for following tasks:
|
|
@@ -25,7 +26,6 @@ var pushToAndClause = helper.pushToAndClause,
|
|
|
25
26
|
* 6. Unregister the component on un-mount
|
|
26
27
|
* Note: All components are using that except the DynamicRangeSlider
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
29
|
var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
30
30
|
if (options === void 0) {
|
|
31
31
|
options = {
|
|
@@ -33,7 +33,6 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
33
33
|
internalComponent: false
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
|
|
37
36
|
return {
|
|
38
37
|
name: 'ComponentWrapper',
|
|
39
38
|
props: {
|
|
@@ -41,9 +40,8 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
41
40
|
},
|
|
42
41
|
created: function created() {
|
|
43
42
|
// clone the props for component it is needed because attrs gets changed on time
|
|
44
|
-
var componentProps = _extends({}, this.$attrs);
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
var componentProps = _extends({}, this.$attrs);
|
|
44
|
+
// handle kebab case for props
|
|
47
45
|
var parsedProps = {};
|
|
48
46
|
Object.keys(componentProps).forEach(function (key) {
|
|
49
47
|
parsedProps[getCamelCase(key)] = componentProps[key];
|
|
@@ -54,46 +52,36 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
54
52
|
},
|
|
55
53
|
beforeMount: function beforeMount() {
|
|
56
54
|
var _this = this;
|
|
57
|
-
|
|
58
55
|
var components = [];
|
|
59
|
-
|
|
60
56
|
if (this.$$store) {
|
|
61
57
|
var _this$$$store$getStat = this.$$store.getState();
|
|
62
|
-
|
|
63
58
|
components = _this$$$store$getStat.components;
|
|
64
|
-
}
|
|
59
|
+
}
|
|
60
|
+
// Register a component only when `destroyOnUnmount` is `true`
|
|
65
61
|
// or component is not present in store
|
|
66
|
-
|
|
67
|
-
|
|
68
62
|
if (this.destroyOnUnmount || components.indexOf(this.componentProps.componentId) === -1) {
|
|
69
63
|
// Register component
|
|
70
64
|
this.addComponent(this.componentId);
|
|
71
|
-
|
|
72
65
|
var onQueryChange = function onQueryChange() {
|
|
73
66
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
74
67
|
args[_key] = arguments[_key];
|
|
75
68
|
}
|
|
76
|
-
|
|
77
69
|
_this.$emit.apply(_this, ['queryChange'].concat(args));
|
|
78
|
-
|
|
79
70
|
_this.$emit.apply(_this, ['query-change'].concat(args));
|
|
80
71
|
};
|
|
81
|
-
|
|
82
72
|
var onError = function onError(e) {
|
|
83
73
|
_this.$emit('error', e);
|
|
84
74
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
this.setQueryListener(this.componentId, onQueryChange, onError);
|
|
76
|
+
// Update props in store
|
|
88
77
|
this.setComponentProps(this.componentId, this.componentProps, options.componentType);
|
|
89
|
-
}
|
|
90
|
-
|
|
78
|
+
}
|
|
91
79
|
|
|
80
|
+
// if default query prop is defined and component is reactive component then register the internal component
|
|
92
81
|
if (options.internalComponent || this.componentProps.defaultQuery && options.componentType === componentTypes.reactiveComponent) {
|
|
93
82
|
this.internalComponent = getInternalComponentID(this.componentId);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
}
|
|
84
|
+
// Register internal component
|
|
97
85
|
if (this.internalComponent && (this.destroyOnUnmount || components.indexOf(this.internalComponent) === -1)) {
|
|
98
86
|
this.addComponent(this.internalComponent);
|
|
99
87
|
this.setComponentProps(this.internalComponent, this.componentProps, options.componentType);
|
|
@@ -109,7 +97,6 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
109
97
|
if (this.destroyOnUnmount) {
|
|
110
98
|
// Unregister components
|
|
111
99
|
this.removeComponent(this.componentId);
|
|
112
|
-
|
|
113
100
|
if (this.internalComponent) {
|
|
114
101
|
this.removeComponent(this.internalComponent);
|
|
115
102
|
}
|
|
@@ -120,18 +107,15 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
120
107
|
deep: true,
|
|
121
108
|
handler: function handler(newVal) {
|
|
122
109
|
var _this2 = this;
|
|
123
|
-
|
|
124
110
|
var propsKeys = getValidPropsKeys(newVal);
|
|
125
111
|
checkSomePropChange(newVal, this.savedComponentProps, propsKeys, function () {
|
|
126
112
|
_this2.updateComponentProps(_this2.componentId, newVal, options.componentType);
|
|
127
|
-
|
|
128
113
|
_this2.updateComponentProps(_this2.internalComponent, newVal, options.componentType);
|
|
129
114
|
});
|
|
130
115
|
}
|
|
131
116
|
},
|
|
132
117
|
react: function react(newVal, oldVal) {
|
|
133
118
|
var _this3 = this;
|
|
134
|
-
|
|
135
119
|
checkPropChange(newVal, oldVal, function () {
|
|
136
120
|
return _this3.setReact(_this3.componentProps);
|
|
137
121
|
});
|
|
@@ -140,8 +124,7 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
140
124
|
methods: {
|
|
141
125
|
setReact: function setReact(props) {
|
|
142
126
|
var react = props.react,
|
|
143
|
-
|
|
144
|
-
|
|
127
|
+
executeInitialQuery = props.executeInitialQuery;
|
|
145
128
|
if (this.internalComponent) {
|
|
146
129
|
if (react) {
|
|
147
130
|
var newReact = pushToAndClause(react, this.internalComponent);
|
|
@@ -166,13 +149,11 @@ var ComponentWrapper = function ComponentWrapper(component, options) {
|
|
|
166
149
|
}
|
|
167
150
|
};
|
|
168
151
|
};
|
|
169
|
-
|
|
170
152
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
171
153
|
return {
|
|
172
154
|
savedComponentProps: state.props[props.componentId]
|
|
173
155
|
};
|
|
174
156
|
};
|
|
175
|
-
|
|
176
157
|
var mapDispatchToProps = {
|
|
177
158
|
addComponent: addComponent,
|
|
178
159
|
removeComponent: removeComponent,
|
|
@@ -185,7 +166,6 @@ var ComponentWrapper$1 = (function (component, options) {
|
|
|
185
166
|
if (options === void 0) {
|
|
186
167
|
options = {};
|
|
187
168
|
}
|
|
188
|
-
|
|
189
169
|
return connect(mapStateToProps, mapDispatchToProps)(ComponentWrapper(component, options));
|
|
190
170
|
});
|
|
191
171
|
|