@appbaseio/reactivesearch-vue 1.16.0-alpha.3 → 1.16.0-alpha.32
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 +6388 -5403
- 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-d2f1aeda.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.js +341 -391
- package/dist/cjs/{DropDown-c66be1a8.js → DropDown-c46d8b0c.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +81 -25
- package/dist/cjs/Flex-699639d2.js +52 -0
- package/dist/cjs/FormControlList-73497794.js +47 -0
- package/dist/cjs/Input-c6f181d5.js +79 -0
- package/dist/cjs/ListItem-933c27e4.js +46 -0
- package/dist/cjs/MultiDropdownList.js +71 -46
- package/dist/cjs/MultiList.js +49 -29
- package/dist/cjs/MultiRange.js +20 -14
- package/dist/cjs/{Pagination-91df3b77.js → Pagination-1b2320a7.js} +4 -3
- package/dist/cjs/RangeInput.js +29 -45
- package/dist/cjs/RangeSlider.js +31 -28
- package/dist/cjs/ReactiveBase.js +55 -34
- package/dist/cjs/ReactiveComponent.js +80 -36
- package/dist/cjs/ReactiveGoogleMap.js +326 -235
- package/dist/cjs/ReactiveList.js +149 -202
- package/dist/cjs/ResultCard.js +8 -6
- package/dist/cjs/ResultList.js +8 -6
- package/dist/cjs/SelectedFilters.js +25 -12
- package/dist/cjs/SingleDropdownList.js +70 -45
- package/dist/cjs/SingleList.js +44 -26
- package/dist/cjs/SingleRange.js +17 -11
- 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 +23 -19
- package/dist/cjs/initReactivesearch.js +80 -38
- package/dist/cjs/install.js +20 -18
- 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-799185e2.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.js +339 -389
- package/dist/es/{DropDown-5dbd69c2.js → DropDown-4edaa621.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +81 -25
- package/dist/es/Flex-aac91505.js +47 -0
- package/dist/es/FormControlList-fe389a2e.js +40 -0
- package/dist/es/Input-d8519224.js +71 -0
- package/dist/es/ListItem-bdb6d53d.js +39 -0
- package/dist/es/MultiDropdownList.js +71 -46
- package/dist/es/MultiList.js +49 -29
- package/dist/es/MultiRange.js +20 -14
- package/dist/es/{Pagination-800af44f.js → Pagination-b3e4054a.js} +4 -3
- package/dist/es/RangeInput.js +29 -45
- package/dist/es/RangeSlider.js +31 -28
- package/dist/es/ReactiveBase.js +55 -34
- package/dist/es/ReactiveComponent.js +80 -36
- package/dist/es/ReactiveGoogleMap.js +326 -235
- package/dist/es/ReactiveList.js +149 -202
- package/dist/es/ResultCard.js +8 -6
- package/dist/es/ResultList.js +8 -6
- package/dist/es/SelectedFilters.js +25 -12
- package/dist/es/SingleDropdownList.js +70 -45
- package/dist/es/SingleList.js +44 -26
- package/dist/es/SingleRange.js +17 -11
- 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 +23 -19
- package/dist/es/initReactivesearch.js +80 -38
- package/dist/es/install.js +20 -18
- 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 +86 -78
- 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
|
@@ -1,91 +1,37 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { css } from 'emotion';
|
|
5
5
|
import styled from '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
7
|
-
import { a as isFunction } from './index-
|
|
8
|
-
import
|
|
9
|
-
import { D as Downshift } from './
|
|
6
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
7
|
+
import { a as isFunction } from './index-5daa8276.js';
|
|
8
|
+
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
9
|
+
import { D as Downshift, b as InputWrapper, a as IconGroup, I as IconWrapper, C as CancelSvg } from './CancelSvg-4d9e0857.js';
|
|
10
|
+
import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-d8519224.js';
|
|
11
|
+
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_templateObject4 = function _templateObject4() {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function _templateObject3() {
|
|
22
|
-
var data = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"]);
|
|
23
|
-
|
|
24
|
-
_templateObject3 = function _templateObject3() {
|
|
25
|
-
return data;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return data;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _templateObject2() {
|
|
32
|
-
var data = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"]);
|
|
33
|
-
|
|
34
|
-
_templateObject2 = function _templateObject2() {
|
|
35
|
-
return data;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _templateObject() {
|
|
42
|
-
var data = _taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"]);
|
|
43
|
-
|
|
44
|
-
_templateObject = function _templateObject() {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
var small = css(_templateObject());
|
|
13
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
14
|
+
var small = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"])));
|
|
51
15
|
|
|
52
16
|
var dark = function dark(_ref) {
|
|
53
17
|
var theme = _ref.theme;
|
|
54
|
-
return css(_templateObject2(), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
|
|
18
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
|
|
55
19
|
};
|
|
56
20
|
|
|
57
|
-
var Select = styled('button')(_templateObject3(), function (props) {
|
|
21
|
+
var Select = styled('button')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
|
|
58
22
|
return props.small ? small : null;
|
|
59
23
|
}, function (_ref2) {
|
|
60
24
|
var themePreset = _ref2.themePreset;
|
|
61
25
|
return themePreset === 'dark' && dark;
|
|
62
26
|
});
|
|
63
|
-
var Tick = styled('span')(_templateObject4(), function (_ref3) {
|
|
27
|
+
var Tick = styled('span')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"])), function (_ref3) {
|
|
64
28
|
var theme = _ref3.theme;
|
|
65
29
|
return theme.colors.primaryColor;
|
|
66
30
|
});
|
|
67
31
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_templateObject2$1 = function _templateObject2() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject$1() {
|
|
79
|
-
var data = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject$1 = function _templateObject() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
var open = css(_templateObject$1());
|
|
88
|
-
var Chevron = styled('span')(_templateObject2$1(), function (props) {
|
|
32
|
+
var _templateObject$1, _templateObject2$1;
|
|
33
|
+
var open = css(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
|
|
34
|
+
var Chevron = styled('span')(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
|
|
89
35
|
return props.open ? open : null;
|
|
90
36
|
});
|
|
91
37
|
|
|
@@ -108,23 +54,25 @@ var Dropdown = {
|
|
|
108
54
|
items: types.data,
|
|
109
55
|
keyField: VueTypes.string.def('key'),
|
|
110
56
|
labelField: VueTypes.string.def('label'),
|
|
111
|
-
multi:
|
|
57
|
+
multi: VueTypes.bool,
|
|
112
58
|
// change event
|
|
113
59
|
placeholder: types.string,
|
|
114
|
-
returnsObject:
|
|
60
|
+
returnsObject: VueTypes.bool,
|
|
115
61
|
customLabelRenderer: types.func,
|
|
116
|
-
hasCustomRenderer:
|
|
62
|
+
hasCustomRenderer: VueTypes.bool,
|
|
117
63
|
customRenderer: types.func,
|
|
118
64
|
renderItem: types.func,
|
|
119
65
|
renderNoResults: VueTypes.any,
|
|
120
66
|
handleChange: types.func,
|
|
121
67
|
transformData: types.func,
|
|
122
68
|
selectedItem: types.selectedValue,
|
|
123
|
-
showCount:
|
|
124
|
-
single:
|
|
69
|
+
showCount: VueTypes.bool,
|
|
70
|
+
single: VueTypes.bool,
|
|
125
71
|
small: VueTypes.bool.def(false),
|
|
126
72
|
themePreset: types.themePreset,
|
|
127
|
-
showSearch:
|
|
73
|
+
showSearch: VueTypes.bool,
|
|
74
|
+
showClear: VueTypes.bool,
|
|
75
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
128
76
|
},
|
|
129
77
|
render: function render() {
|
|
130
78
|
var _this = this;
|
|
@@ -152,7 +100,7 @@ var Dropdown = {
|
|
|
152
100
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
153
101
|
if (String(item[labelField]).length) {
|
|
154
102
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
155
|
-
return String(item[labelField]).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
103
|
+
return replaceDiacritics(String(item[labelField])).toLowerCase().includes(replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
|
|
156
104
|
}
|
|
157
105
|
|
|
158
106
|
return true;
|
|
@@ -173,7 +121,8 @@ var Dropdown = {
|
|
|
173
121
|
isOpen = _ref.isOpen,
|
|
174
122
|
highlightedIndex = _ref.highlightedIndex,
|
|
175
123
|
getButtonProps = _ref.getButtonProps,
|
|
176
|
-
getItemEvents = _ref.getItemEvents
|
|
124
|
+
getItemEvents = _ref.getItemEvents,
|
|
125
|
+
getInputEvents = _ref.getInputEvents;
|
|
177
126
|
return h("div", {
|
|
178
127
|
"class": suggestionsContainer
|
|
179
128
|
}, [h(Select, {
|
|
@@ -198,26 +147,16 @@ var Dropdown = {
|
|
|
198
147
|
getItemEvents: getItemEvents
|
|
199
148
|
}) : isOpen && itemsToRender.length ? h("ul", {
|
|
200
149
|
"class": suggestions(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName(_this.$props.innerClass, 'list')
|
|
201
|
-
}, [_this.$props.showSearch ?
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
"value": _this.$data.searchTerm,
|
|
207
|
-
"themePreset": themePreset
|
|
208
|
-
},
|
|
209
|
-
"style": {
|
|
210
|
-
border: 0,
|
|
211
|
-
borderBottom: '1px solid #ddd'
|
|
212
|
-
},
|
|
213
|
-
"class": getClassName(_this.$props.innerClass, 'input'),
|
|
214
|
-
"on": {
|
|
215
|
-
"change": _this.handleInputChange
|
|
150
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
151
|
+
on: {
|
|
152
|
+
input: getInputEvents({
|
|
153
|
+
onInput: _this.handleInputChange
|
|
154
|
+
}).input
|
|
216
155
|
}
|
|
217
156
|
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
218
157
|
var selected = _this.$props.multi // MultiDropdownList
|
|
219
|
-
&& (selectedItem && !!selectedItem[item[keyField]]
|
|
220
|
-
Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
158
|
+
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
159
|
+
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
221
160
|
return value[labelField] === item[labelField];
|
|
222
161
|
}));
|
|
223
162
|
if (!_this.$props.multi) selected = item.key === selectedItem;
|
|
@@ -267,6 +206,7 @@ var Dropdown = {
|
|
|
267
206
|
|
|
268
207
|
if (!this.$props.multi) {
|
|
269
208
|
this.isOpen = false;
|
|
209
|
+
this.searchTerm = '';
|
|
270
210
|
}
|
|
271
211
|
},
|
|
272
212
|
handleStateChange: function handleStateChange(_ref2) {
|
|
@@ -290,6 +230,9 @@ var Dropdown = {
|
|
|
290
230
|
var value = e.target.value;
|
|
291
231
|
this.searchTerm = value;
|
|
292
232
|
},
|
|
233
|
+
clearSearchTerm: function clearSearchTerm() {
|
|
234
|
+
this.searchTerm = '';
|
|
235
|
+
},
|
|
293
236
|
renderToString: function renderToString(value) {
|
|
294
237
|
var _this2 = this;
|
|
295
238
|
|
|
@@ -330,6 +273,48 @@ var Dropdown = {
|
|
|
330
273
|
return h("p", {
|
|
331
274
|
"class": getClassName(this.$props.innerClass, 'noResults') || null
|
|
332
275
|
}, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
276
|
+
},
|
|
277
|
+
renderSearchbox: function renderSearchbox(eventObject) {
|
|
278
|
+
var h = this.$createElement;
|
|
279
|
+
var _this$$props2 = this.$props,
|
|
280
|
+
componentId = _this$$props2.componentId,
|
|
281
|
+
searchPlaceholder = _this$$props2.searchPlaceholder,
|
|
282
|
+
showClear = _this$$props2.showClear,
|
|
283
|
+
themePreset = _this$$props2.themePreset,
|
|
284
|
+
innerClass = _this$$props2.innerClass;
|
|
285
|
+
var InputComponent = h(Input, _mergeJSXProps([{
|
|
286
|
+
"attrs": {
|
|
287
|
+
"id": componentId + "-input",
|
|
288
|
+
"showIcon": false,
|
|
289
|
+
"showClear": showClear,
|
|
290
|
+
"placeholder": searchPlaceholder,
|
|
291
|
+
"value": this.$data.searchTerm,
|
|
292
|
+
"themePreset": themePreset
|
|
293
|
+
},
|
|
294
|
+
"style": {
|
|
295
|
+
border: 0,
|
|
296
|
+
borderBottom: '1px solid #ddd'
|
|
297
|
+
},
|
|
298
|
+
"class": getClassName(innerClass, 'input')
|
|
299
|
+
}, eventObject]));
|
|
300
|
+
|
|
301
|
+
if (showClear) {
|
|
302
|
+
return h(InputWrapper, [InputComponent, this.searchTerm && h(IconGroup, {
|
|
303
|
+
"attrs": {
|
|
304
|
+
"groupPosition": "right",
|
|
305
|
+
"positionType": "absolute"
|
|
306
|
+
}
|
|
307
|
+
}, [h(IconWrapper, {
|
|
308
|
+
"on": {
|
|
309
|
+
"click": this.clearSearchTerm
|
|
310
|
+
},
|
|
311
|
+
"attrs": {
|
|
312
|
+
"isClearIcon": true
|
|
313
|
+
}
|
|
314
|
+
}, [h(CancelSvg)])])]);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return InputComponent;
|
|
333
318
|
}
|
|
334
319
|
}
|
|
335
320
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
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 '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
7
7
|
import 'redux';
|
|
8
|
-
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-
|
|
9
|
-
import { T as Title } from './Title-
|
|
10
|
-
import { C as Container } from './Container-
|
|
8
|
+
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-5daa8276.js';
|
|
9
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
10
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
11
11
|
import NoSSR from 'vue-no-ssr';
|
|
12
|
-
import { g as getComponents, S as Slider } from './ssr-
|
|
12
|
+
import { g as getComponents, S as Slider } from './ssr-e3196de1.js';
|
|
13
13
|
|
|
14
14
|
var addComponent = Actions.addComponent,
|
|
15
15
|
removeComponent = Actions.removeComponent,
|
|
@@ -41,11 +41,14 @@ var DynamicRangeSlider = {
|
|
|
41
41
|
innerClass: types.style,
|
|
42
42
|
react: types.react,
|
|
43
43
|
showFilter: VueTypes.bool.def(true),
|
|
44
|
+
destroyOnUnmount: VueTypes.bool,
|
|
44
45
|
showCheckbox: VueTypes.bool.def(true),
|
|
45
46
|
title: types.title,
|
|
46
47
|
URLParams: VueTypes.bool.def(false),
|
|
47
48
|
sliderOptions: VueTypes.object.def({}),
|
|
48
|
-
nestedField: types.string
|
|
49
|
+
nestedField: types.string,
|
|
50
|
+
index: VueTypes.string,
|
|
51
|
+
value: types.range
|
|
49
52
|
},
|
|
50
53
|
data: function data() {
|
|
51
54
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -70,7 +73,12 @@ var DynamicRangeSlider = {
|
|
|
70
73
|
this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
|
|
71
74
|
|
|
72
75
|
this.setComponentProps(this.componentId, this.$props, componentTypes.dynamicRangeSlider);
|
|
73
|
-
this.setComponentProps(this.internalRangeComponent, this.$props, componentTypes.dynamicRangeSlider);
|
|
76
|
+
this.setComponentProps(this.internalRangeComponent, this.$props, componentTypes.dynamicRangeSlider);
|
|
77
|
+
|
|
78
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
79
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
80
|
+
} // Set custom query in store
|
|
81
|
+
|
|
74
82
|
|
|
75
83
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
76
84
|
},
|
|
@@ -78,17 +86,31 @@ var DynamicRangeSlider = {
|
|
|
78
86
|
this.setReact();
|
|
79
87
|
},
|
|
80
88
|
beforeMount: function beforeMount() {
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
var components = [];
|
|
90
|
+
|
|
91
|
+
if (this.$$store) {
|
|
92
|
+
var _this$$$store$getStat = this.$$store.getState();
|
|
93
|
+
|
|
94
|
+
components = _this$$$store$getStat.components;
|
|
95
|
+
}
|
|
83
96
|
|
|
84
|
-
|
|
85
|
-
this.handleChange(this.selectedValue);
|
|
86
|
-
} else if (this.selectedValue) {
|
|
87
|
-
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
88
|
-
} // get range before executing other queries
|
|
97
|
+
var value = this.$props.value;
|
|
89
98
|
|
|
99
|
+
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
100
|
+
this.addComponent(this.componentId);
|
|
101
|
+
this.addComponent(this.internalRangeComponent);
|
|
90
102
|
|
|
91
|
-
|
|
103
|
+
if (Array.isArray(this.selectedValue)) {
|
|
104
|
+
this.handleChange(this.selectedValue);
|
|
105
|
+
} else if (this.selectedValue) {
|
|
106
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
107
|
+
} else if (value) {
|
|
108
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
109
|
+
} // get range before executing other queries
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
this.updateRangeQueryOptions();
|
|
113
|
+
}
|
|
92
114
|
},
|
|
93
115
|
beforeUpdate: function beforeUpdate() {
|
|
94
116
|
if (!this.currentValue) {
|
|
@@ -96,10 +118,19 @@ var DynamicRangeSlider = {
|
|
|
96
118
|
}
|
|
97
119
|
},
|
|
98
120
|
beforeDestroy: function beforeDestroy() {
|
|
99
|
-
|
|
100
|
-
|
|
121
|
+
if (this.destroyOnUnmount) {
|
|
122
|
+
this.removeComponent(this.$props.componentId);
|
|
123
|
+
this.removeComponent(this.internalRangeComponent);
|
|
124
|
+
}
|
|
101
125
|
},
|
|
102
126
|
methods: {
|
|
127
|
+
isControlled: function isControlled() {
|
|
128
|
+
if (this.$props.value && this.$listeners) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return false;
|
|
133
|
+
},
|
|
103
134
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
104
135
|
var start = _ref.start,
|
|
105
136
|
end = _ref.end;
|
|
@@ -110,6 +141,8 @@ var DynamicRangeSlider = {
|
|
|
110
141
|
defaultEnd = _this$$props$defaultV.end;
|
|
111
142
|
|
|
112
143
|
this.handleChange([defaultStart, defaultEnd]);
|
|
144
|
+
} else if (this.isControlled()) {
|
|
145
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
113
146
|
} else {
|
|
114
147
|
this.currentValue = [start, end];
|
|
115
148
|
}
|
|
@@ -157,8 +190,18 @@ var DynamicRangeSlider = {
|
|
|
157
190
|
aggs: aggs
|
|
158
191
|
});
|
|
159
192
|
},
|
|
160
|
-
handleSlider: function handleSlider(
|
|
161
|
-
this.
|
|
193
|
+
handleSlider: function handleSlider() {
|
|
194
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
195
|
+
var value = this.$props.value;
|
|
196
|
+
|
|
197
|
+
if (value === undefined) {
|
|
198
|
+
this.handleChange(sliderValues);
|
|
199
|
+
} else {
|
|
200
|
+
this.$emit('change', {
|
|
201
|
+
start: sliderValues[0],
|
|
202
|
+
end: sliderValues[1]
|
|
203
|
+
});
|
|
204
|
+
}
|
|
162
205
|
},
|
|
163
206
|
handleChange: function handleChange(currentValue) {
|
|
164
207
|
var _this2 = this;
|
|
@@ -210,7 +253,7 @@ var DynamicRangeSlider = {
|
|
|
210
253
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
211
254
|
|
|
212
255
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
213
|
-
this.setQueryOptions(this.$props.componentId, customQueryOptions);
|
|
256
|
+
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
214
257
|
this.updateQuery({
|
|
215
258
|
componentId: this.$props.componentId,
|
|
216
259
|
query: query,
|
|
@@ -251,6 +294,7 @@ var DynamicRangeSlider = {
|
|
|
251
294
|
start: this.range.start,
|
|
252
295
|
end: this.range.end
|
|
253
296
|
};
|
|
297
|
+
this.$emit('change', value);
|
|
254
298
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
255
299
|
},
|
|
256
300
|
range: function range(newValue, oldValue) {
|
|
@@ -272,12 +316,17 @@ var DynamicRangeSlider = {
|
|
|
272
316
|
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
273
317
|
this.updateQueryHandler(this.$data.currentValue);
|
|
274
318
|
}
|
|
319
|
+
},
|
|
320
|
+
value: function value(newVal, oldVal) {
|
|
321
|
+
if (!isEqual(newVal, oldVal)) {
|
|
322
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
323
|
+
}
|
|
275
324
|
}
|
|
276
325
|
},
|
|
277
326
|
render: function render() {
|
|
278
327
|
var h = arguments[0];
|
|
279
328
|
|
|
280
|
-
if (!this.range) {
|
|
329
|
+
if (!this.range || !this.currentValue) {
|
|
281
330
|
return null;
|
|
282
331
|
}
|
|
283
332
|
|
|
@@ -291,13 +340,15 @@ var DynamicRangeSlider = {
|
|
|
291
340
|
}, [this.$props.title]), h(NoSSR, [h(Slider, {
|
|
292
341
|
"class": getClassName(this.$props.innerClass, 'slider')
|
|
293
342
|
}, [h("vue-slider-component", {
|
|
343
|
+
"ref": "slider",
|
|
294
344
|
"attrs": {
|
|
295
345
|
"value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
|
|
296
346
|
"min": Math.min(start, this.currentValue[0]),
|
|
297
347
|
"max": Math.max(end, this.currentValue[1]),
|
|
298
348
|
"dotSize": 20,
|
|
299
349
|
"height": 4,
|
|
300
|
-
"enable-cross": false
|
|
350
|
+
"enable-cross": false,
|
|
351
|
+
"tooltip": "always"
|
|
301
352
|
},
|
|
302
353
|
"on": {
|
|
303
354
|
"drag-end": this.handleSlider
|
|
@@ -343,7 +394,11 @@ DynamicRangeSlider.defaultQuery = function (values, props) {
|
|
|
343
394
|
};
|
|
344
395
|
|
|
345
396
|
DynamicRangeSlider.parseValue = function (value) {
|
|
346
|
-
|
|
397
|
+
if (value) {
|
|
398
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return [];
|
|
347
402
|
};
|
|
348
403
|
|
|
349
404
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
@@ -370,7 +425,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
370
425
|
options: options,
|
|
371
426
|
range: range,
|
|
372
427
|
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
373
|
-
componentProps: state.props[props.componentId]
|
|
428
|
+
componentProps: state.props[props.componentId],
|
|
429
|
+
enableAppbase: state.config.enableAppbase
|
|
374
430
|
};
|
|
375
431
|
};
|
|
376
432
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
|
+
import { css } from 'emotion';
|
|
3
|
+
import styled from '@appbaseio/vue-emotion';
|
|
4
|
+
import { lighten } from 'polished';
|
|
5
|
+
|
|
6
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
7
|
+
var leftLabel = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tflex-direction: row;\n\talign-items: center;\n"])));
|
|
8
|
+
var rightLabel = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tflex-direction: row-reverse;\n\talign-items: center;\n"])));
|
|
9
|
+
var topLabel = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\tflex-direction: column;\n"])));
|
|
10
|
+
var bottomLabel = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\tflex-direction: column-reverse;\n"])));
|
|
11
|
+
|
|
12
|
+
var border = function border(_ref) {
|
|
13
|
+
var colors = _ref.theme.colors;
|
|
14
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\tborder: 1px solid ", ";\n"])), colors.borderColor || '#ccc');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var Flex = styled('div')(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
|
|
18
|
+
return props.inline ? 'inline-flex' : 'flex';
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
|
|
21
|
+
}, function (props) {
|
|
22
|
+
return (props.labelPosition === 'right' || props.iconPosition === 'left') && rightLabel;
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return props.labelPosition === 'top' && topLabel;
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.labelPosition === 'bottom' && bottomLabel;
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return props.showBorder && border;
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.justifyContent && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\t\t\tjustify-content: ", ";\n\t\t"])), props.justifyContent);
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.alignItems && css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\t\t\talign-items: ", ";\n\t\t"])), props.alignItems);
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return props.flex && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\t\t\tflex: ", ";\n\t\t"])), props.flex);
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.direction && css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n\t\t\tflex-direction: ", ";\n\t\t"])), props.direction);
|
|
37
|
+
}, function (props) {
|
|
38
|
+
return props.basis && css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n\t\t\tflex-basis: ", ";\n\t\t"])), props.basis);
|
|
39
|
+
}, function (_ref2) {
|
|
40
|
+
var colors = _ref2.theme.colors;
|
|
41
|
+
return colors.borderColor || lighten(0.3, colors.textColor);
|
|
42
|
+
}, function (_ref3) {
|
|
43
|
+
var theme = _ref3.theme;
|
|
44
|
+
return theme.colors.textColor;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { Flex as F };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
|
+
import { css } from 'emotion';
|
|
3
|
+
import styled from '@appbaseio/vue-emotion';
|
|
4
|
+
import { lighten } from 'polished';
|
|
5
|
+
|
|
6
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
7
|
+
var item = {
|
|
8
|
+
width: '15px',
|
|
9
|
+
height: '15px',
|
|
10
|
+
scale: '4px'
|
|
11
|
+
};
|
|
12
|
+
var vh = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n"])));
|
|
13
|
+
var hideInputControl = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n"])));
|
|
14
|
+
|
|
15
|
+
var formItem = function formItem(_ref) {
|
|
16
|
+
var theme = _ref.theme;
|
|
17
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, lighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || lighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var Radio = styled('input')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
21
|
+
return props.show ? null : hideInputControl;
|
|
22
|
+
}, function (_ref2) {
|
|
23
|
+
var theme = _ref2.theme;
|
|
24
|
+
return theme.colors.primaryColor;
|
|
25
|
+
}, function (_ref3) {
|
|
26
|
+
var theme = _ref3.theme;
|
|
27
|
+
return theme.colors.primaryColor;
|
|
28
|
+
});
|
|
29
|
+
var Checkbox = styled('input')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
30
|
+
return props.show ? null : hideInputControl;
|
|
31
|
+
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
32
|
+
var theme = _ref4.theme;
|
|
33
|
+
return theme.colors.primaryColor;
|
|
34
|
+
}, function (_ref5) {
|
|
35
|
+
var theme = _ref5.theme;
|
|
36
|
+
return theme.colors.primaryColor;
|
|
37
|
+
});
|
|
38
|
+
var UL = styled('ul')(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
|
|
39
|
+
|
|
40
|
+
export { Checkbox as C, Radio as R, UL as U };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
|
+
import { css } from 'emotion';
|
|
3
|
+
import styled from '@appbaseio/vue-emotion';
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
|
6
|
+
|
|
7
|
+
var alertBorder = function alertBorder(_ref) {
|
|
8
|
+
var theme = _ref.theme;
|
|
9
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tborder: 1px solid ", ";\n"])), theme.colors.alertColor);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var input = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tline-height: 1.5;\n\tmin-height: 42px;\n\tpadding: 8px 12px;\n\tborder: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 0.9rem;\n\toutline: none;\n\theight: 100%;\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n"])));
|
|
13
|
+
|
|
14
|
+
var dark = function dark(theme) {
|
|
15
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\tborder-color: ", ";\n"])), theme.colors.borderColor);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var darkInput = function darkInput(_ref2) {
|
|
19
|
+
var theme = _ref2.theme;
|
|
20
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.textColor, dark(theme), theme.colors.backgroundColor);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var Input = styled('input')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n"])), input, function (_ref3) {
|
|
24
|
+
var themePreset = _ref3.themePreset,
|
|
25
|
+
theme = _ref3.theme;
|
|
26
|
+
return themePreset === 'dark' && darkInput({
|
|
27
|
+
theme: theme
|
|
28
|
+
});
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.showIcon && props.iconPosition === 'left' && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-left: 36px;\n\t\t"])));
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.showIcon && props.iconPosition === 'right' && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])));
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return (// for clear icon
|
|
35
|
+
props.showClear && css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])))
|
|
36
|
+
);
|
|
37
|
+
}, function (props) {
|
|
38
|
+
return (// for voice search icon
|
|
39
|
+
props.showVoiceSearch && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])))
|
|
40
|
+
);
|
|
41
|
+
}, function (props) {
|
|
42
|
+
return (// for clear icon with search icon
|
|
43
|
+
props.showClear && props.showIcon && props.iconPosition === 'right' && css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
|
|
44
|
+
);
|
|
45
|
+
}, function (props) {
|
|
46
|
+
return (// for voice search icon with search icon
|
|
47
|
+
props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
|
|
48
|
+
);
|
|
49
|
+
}, function (props) {
|
|
50
|
+
return (// for voice search icon with clear icon
|
|
51
|
+
props.showVoiceSearch && props.showIcon && css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
|
|
52
|
+
);
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return (// for clear icon with search icon and voice search
|
|
55
|
+
props.showClear && props.showIcon && props.showVoiceSearch && props.iconPosition === 'right' && css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 90px;\n\t\t"])))
|
|
56
|
+
);
|
|
57
|
+
}, function (props) {
|
|
58
|
+
return props.alert && alertBorder;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
var suggestions = function suggestions(themePreset, theme) {
|
|
62
|
+
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 395px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark(theme));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var suggestionsContainer = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
66
|
+
|
|
67
|
+
var noSuggestions = function noSuggestions(themePreset, theme) {
|
|
68
|
+
return css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t", "\n"])), themePreset === 'dark' && theme && dark(theme));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { Input as I, suggestions as a, noSuggestions as n, suggestionsContainer as s };
|