@appbaseio/reactivesearch-vue 1.16.0-alpha.6 → 1.16.0-alpha.62
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 +16030 -13113
- 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-446f819e.js +68 -0
- package/dist/cjs/{DownShift-966a58cb.js → CancelSvg-9f258f4f.js} +60 -16
- package/dist/cjs/Card-642547a8.js +30 -0
- package/dist/cjs/{ComponentWrapper-603848ed.js → ComponentWrapper-ad3dad02.js} +40 -21
- package/dist/cjs/{Container-6cdd3864.js → Container-daf30918.js} +3 -11
- package/dist/cjs/DataSearch-86914b10.js +2322 -0
- package/dist/cjs/DataSearch.js +18 -2151
- package/dist/cjs/{DropDown-f6224ac8.js → DropDown-5513ea77.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +107 -43
- package/dist/cjs/Flex-aa517a13.js +52 -0
- package/dist/cjs/FormControlList-c195a592.js +47 -0
- package/dist/cjs/Input-e6603a7e.js +79 -0
- package/dist/cjs/ListItem-8c9e0d68.js +46 -0
- package/dist/cjs/MultiDropdownList.js +102 -68
- package/dist/cjs/MultiList.js +80 -50
- package/dist/cjs/MultiRange.js +21 -16
- package/dist/cjs/{Pagination-af399262.js → Pagination-fe5452fc.js} +14 -8
- package/dist/cjs/RangeInput.js +29 -45
- package/dist/cjs/RangeSlider.js +32 -30
- package/dist/cjs/ReactiveBase.js +87 -56
- package/dist/cjs/ReactiveComponent.js +75 -62
- package/dist/cjs/ReactiveGoogleMap.js +262 -191
- package/dist/cjs/ReactiveList.js +189 -241
- package/dist/cjs/ResultCard.js +8 -6
- package/dist/cjs/ResultList.js +8 -6
- package/dist/cjs/SelectedFilters.js +66 -34
- package/dist/cjs/SingleDropdownList.js +88 -60
- package/dist/cjs/SingleList.js +53 -35
- package/dist/cjs/SingleRange.js +19 -14
- package/dist/cjs/StateProvider.js +39 -10
- package/dist/cjs/{Title-65d39104.js → Title-1de7d0f4.js} +3 -11
- package/dist/cjs/ToggleButton.js +36 -16
- package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
- package/dist/cjs/{index-baca18c4.js → index-6a167fe0.js} +99 -13
- package/dist/cjs/index.js +31 -25
- package/dist/cjs/initReactivesearch.js +178 -104
- package/dist/cjs/install-004c6aa4.js +1408 -0
- package/dist/cjs/install.js +42 -44
- package/dist/cjs/ssr-3027b848.js +39 -0
- package/dist/cjs/{utils-ea846a20.js → utils-d6a52588.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-d8bc15ea.js +59 -0
- package/dist/es/{DownShift-92347b5e.js → CancelSvg-4cfae5fd.js} +56 -17
- package/dist/es/Card-450683f1.js +23 -0
- package/dist/es/{ComponentWrapper-c4c91949.js → ComponentWrapper-424e86fd.js} +40 -21
- package/dist/es/Container-ba826e96.js +10 -0
- package/dist/es/DataSearch-e71a1014.js +2307 -0
- package/dist/es/DataSearch.js +17 -2150
- package/dist/es/{DropDown-3d4291f1.js → DropDown-7d9a15c1.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +107 -43
- package/dist/es/Flex-1f0795c3.js +47 -0
- package/dist/es/FormControlList-c22d64f6.js +40 -0
- package/dist/es/Input-7a2a9fac.js +71 -0
- package/dist/es/ListItem-cad14c5e.js +39 -0
- package/dist/es/MultiDropdownList.js +102 -68
- package/dist/es/MultiList.js +80 -50
- package/dist/es/MultiRange.js +21 -16
- package/dist/es/{Pagination-c2a00175.js → Pagination-3f350098.js} +14 -8
- package/dist/es/RangeInput.js +29 -45
- package/dist/es/RangeSlider.js +32 -30
- package/dist/es/ReactiveBase.js +87 -56
- package/dist/es/ReactiveComponent.js +75 -62
- package/dist/es/ReactiveGoogleMap.js +262 -191
- package/dist/es/ReactiveList.js +189 -241
- package/dist/es/ResultCard.js +8 -6
- package/dist/es/ResultList.js +8 -6
- package/dist/es/SelectedFilters.js +66 -34
- package/dist/es/SingleDropdownList.js +88 -60
- package/dist/es/SingleList.js +53 -35
- package/dist/es/SingleRange.js +19 -14
- package/dist/es/StateProvider.js +39 -10
- package/dist/es/Title-3342664a.js +10 -0
- package/dist/es/ToggleButton.js +36 -16
- package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
- package/dist/es/{index-185b6266.js → index-7788a843.js} +95 -14
- package/dist/es/index.js +27 -22
- package/dist/es/initReactivesearch.js +179 -105
- package/dist/es/install-b7b604cc.js +1401 -0
- package/dist/es/install.js +40 -46
- package/dist/es/ssr-b2c0b401.js +33 -0
- package/dist/es/{utils-57cc8789.js → utils-9e68acee.js} +2 -2
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
- package/package.json +6 -4
- package/dist/cjs/Button-d48d4365.js +0 -146
- package/dist/cjs/Card-9748fbb2.js +0 -58
- package/dist/cjs/Flex-befd65fc.js +0 -160
- package/dist/cjs/FormControlList-f3857d4b.js +0 -105
- package/dist/cjs/Input-95cb19f8.js +0 -178
- package/dist/cjs/ListItem-84d185cf.js +0 -84
- package/dist/cjs/ssr-3ca8a14f.js +0 -47
- package/dist/es/Button-27cc8574.js +0 -137
- package/dist/es/Card-1f93780d.js +0 -51
- package/dist/es/Container-88c805ef.js +0 -18
- package/dist/es/Flex-16d1103a.js +0 -155
- package/dist/es/FormControlList-96d44e7b.js +0 -98
- package/dist/es/Input-1159c4b5.js +0 -170
- package/dist/es/ListItem-d22510c9.js +0 -77
- package/dist/es/Title-f0217338.js +0 -18
- package/dist/es/ssr-a710392b.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-76660dab.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-7788a843.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-4cfae5fd.js';
|
|
10
|
+
import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-7a2a9fac.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-76660dab.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-7788a843.js';
|
|
9
|
+
import { T as Title } from './Title-3342664a.js';
|
|
10
|
+
import { C as Container } from './Container-ba826e96.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-b2c0b401.js';
|
|
13
13
|
|
|
14
14
|
var addComponent = Actions.addComponent,
|
|
15
15
|
removeComponent = Actions.removeComponent,
|
|
@@ -22,9 +22,10 @@ var addComponent = Actions.addComponent,
|
|
|
22
22
|
updateComponentProps = Actions.updateComponentProps;
|
|
23
23
|
var checkValueChange = helper.checkValueChange,
|
|
24
24
|
getClassName = helper.getClassName,
|
|
25
|
-
getOptionsFromQuery = helper.getOptionsFromQuery,
|
|
26
25
|
isEqual = helper.isEqual,
|
|
27
|
-
checkSomePropChange = helper.checkSomePropChange
|
|
26
|
+
checkSomePropChange = helper.checkSomePropChange,
|
|
27
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
28
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
28
29
|
var DynamicRangeSlider = {
|
|
29
30
|
name: 'DynamicRangeSlider',
|
|
30
31
|
components: getComponents(),
|
|
@@ -41,11 +42,14 @@ var DynamicRangeSlider = {
|
|
|
41
42
|
innerClass: types.style,
|
|
42
43
|
react: types.react,
|
|
43
44
|
showFilter: VueTypes.bool.def(true),
|
|
45
|
+
destroyOnUnmount: VueTypes.bool,
|
|
44
46
|
showCheckbox: VueTypes.bool.def(true),
|
|
45
47
|
title: types.title,
|
|
46
48
|
URLParams: VueTypes.bool.def(false),
|
|
47
49
|
sliderOptions: VueTypes.object.def({}),
|
|
48
|
-
nestedField: types.string
|
|
50
|
+
nestedField: types.string,
|
|
51
|
+
index: VueTypes.string,
|
|
52
|
+
value: types.range
|
|
49
53
|
},
|
|
50
54
|
data: function data() {
|
|
51
55
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -70,7 +74,12 @@ var DynamicRangeSlider = {
|
|
|
70
74
|
this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
|
|
71
75
|
|
|
72
76
|
this.setComponentProps(this.componentId, this.$props, componentTypes.dynamicRangeSlider);
|
|
73
|
-
this.setComponentProps(this.internalRangeComponent, this.$props, componentTypes.dynamicRangeSlider);
|
|
77
|
+
this.setComponentProps(this.internalRangeComponent, this.$props, componentTypes.dynamicRangeSlider);
|
|
78
|
+
|
|
79
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
80
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
81
|
+
} // Set custom query in store
|
|
82
|
+
|
|
74
83
|
|
|
75
84
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
76
85
|
},
|
|
@@ -78,17 +87,31 @@ var DynamicRangeSlider = {
|
|
|
78
87
|
this.setReact();
|
|
79
88
|
},
|
|
80
89
|
beforeMount: function beforeMount() {
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
var components = [];
|
|
91
|
+
|
|
92
|
+
if (this.$$store) {
|
|
93
|
+
var _this$$$store$getStat = this.$$store.getState();
|
|
94
|
+
|
|
95
|
+
components = _this$$$store$getStat.components;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
var value = this.$props.value;
|
|
83
99
|
|
|
84
|
-
if (
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
88
|
-
} // get range before executing other queries
|
|
100
|
+
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
101
|
+
this.addComponent(this.componentId);
|
|
102
|
+
this.addComponent(this.internalRangeComponent);
|
|
89
103
|
|
|
104
|
+
if (Array.isArray(this.selectedValue)) {
|
|
105
|
+
this.handleChange(this.selectedValue);
|
|
106
|
+
} else if (this.selectedValue) {
|
|
107
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
108
|
+
} else if (value) {
|
|
109
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
110
|
+
} // get range before executing other queries
|
|
90
111
|
|
|
91
|
-
|
|
112
|
+
|
|
113
|
+
this.updateRangeQueryOptions();
|
|
114
|
+
}
|
|
92
115
|
},
|
|
93
116
|
beforeUpdate: function beforeUpdate() {
|
|
94
117
|
if (!this.currentValue) {
|
|
@@ -96,10 +119,19 @@ var DynamicRangeSlider = {
|
|
|
96
119
|
}
|
|
97
120
|
},
|
|
98
121
|
beforeDestroy: function beforeDestroy() {
|
|
99
|
-
|
|
100
|
-
|
|
122
|
+
if (this.destroyOnUnmount) {
|
|
123
|
+
this.removeComponent(this.$props.componentId);
|
|
124
|
+
this.removeComponent(this.internalRangeComponent);
|
|
125
|
+
}
|
|
101
126
|
},
|
|
102
127
|
methods: {
|
|
128
|
+
isControlled: function isControlled() {
|
|
129
|
+
if (this.$props.value && this.$listeners) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return false;
|
|
134
|
+
},
|
|
103
135
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
104
136
|
var start = _ref.start,
|
|
105
137
|
end = _ref.end;
|
|
@@ -110,6 +142,8 @@ var DynamicRangeSlider = {
|
|
|
110
142
|
defaultEnd = _this$$props$defaultV.end;
|
|
111
143
|
|
|
112
144
|
this.handleChange([defaultStart, defaultEnd]);
|
|
145
|
+
} else if (this.isControlled()) {
|
|
146
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
113
147
|
} else {
|
|
114
148
|
this.currentValue = [start, end];
|
|
115
149
|
}
|
|
@@ -157,8 +191,18 @@ var DynamicRangeSlider = {
|
|
|
157
191
|
aggs: aggs
|
|
158
192
|
});
|
|
159
193
|
},
|
|
160
|
-
handleSlider: function handleSlider(
|
|
161
|
-
this.
|
|
194
|
+
handleSlider: function handleSlider() {
|
|
195
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
196
|
+
var value = this.$props.value;
|
|
197
|
+
|
|
198
|
+
if (value === undefined) {
|
|
199
|
+
this.handleChange(sliderValues);
|
|
200
|
+
} else {
|
|
201
|
+
this.$emit('change', {
|
|
202
|
+
start: sliderValues[0],
|
|
203
|
+
end: sliderValues[1]
|
|
204
|
+
});
|
|
205
|
+
}
|
|
162
206
|
},
|
|
163
207
|
handleChange: function handleChange(currentValue) {
|
|
164
208
|
var _this2 = this;
|
|
@@ -189,28 +233,31 @@ var DynamicRangeSlider = {
|
|
|
189
233
|
},
|
|
190
234
|
updateQueryHandler: function updateQueryHandler(value) {
|
|
191
235
|
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
192
|
-
var customQueryOptions;
|
|
193
236
|
|
|
194
237
|
if (this.$props.customQuery) {
|
|
195
|
-
var
|
|
238
|
+
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
239
|
+
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
240
|
+
|
|
241
|
+
if (queryTobeSet) {
|
|
242
|
+
query = queryTobeSet;
|
|
243
|
+
}
|
|
196
244
|
|
|
197
|
-
|
|
198
|
-
customQueryOptions = getOptionsFromQuery(this.$props.customQuery(value, this.$props));
|
|
245
|
+
var customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
199
246
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
247
|
+
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
200
248
|
}
|
|
201
249
|
|
|
202
|
-
var
|
|
250
|
+
var _ref2 = this.range || {
|
|
203
251
|
start: value[0],
|
|
204
252
|
end: value[1]
|
|
205
253
|
},
|
|
206
|
-
start =
|
|
207
|
-
end =
|
|
254
|
+
start = _ref2.start,
|
|
255
|
+
end = _ref2.end;
|
|
208
256
|
|
|
209
257
|
var currentStart = value[0],
|
|
210
258
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
211
259
|
|
|
212
260
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
213
|
-
this.setQueryOptions(this.$props.componentId, customQueryOptions);
|
|
214
261
|
this.updateQuery({
|
|
215
262
|
componentId: this.$props.componentId,
|
|
216
263
|
query: query,
|
|
@@ -251,18 +298,19 @@ var DynamicRangeSlider = {
|
|
|
251
298
|
start: this.range.start,
|
|
252
299
|
end: this.range.end
|
|
253
300
|
};
|
|
301
|
+
this.$emit('change', value);
|
|
254
302
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
255
303
|
},
|
|
256
304
|
range: function range(newValue, oldValue) {
|
|
257
305
|
if (isEqual(newValue, oldValue) || !this.currentValue) return;
|
|
258
306
|
|
|
259
|
-
var
|
|
260
|
-
currentStart =
|
|
261
|
-
currentEnd =
|
|
307
|
+
var _ref3 = this.currentValue || [],
|
|
308
|
+
currentStart = _ref3[0],
|
|
309
|
+
currentEnd = _ref3[1];
|
|
262
310
|
|
|
263
|
-
var
|
|
264
|
-
oldStart =
|
|
265
|
-
oldEnd =
|
|
311
|
+
var _ref4 = oldValue || {},
|
|
312
|
+
oldStart = _ref4.start,
|
|
313
|
+
oldEnd = _ref4.end;
|
|
266
314
|
|
|
267
315
|
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
268
316
|
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
@@ -272,12 +320,17 @@ var DynamicRangeSlider = {
|
|
|
272
320
|
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
273
321
|
this.updateQueryHandler(this.$data.currentValue);
|
|
274
322
|
}
|
|
323
|
+
},
|
|
324
|
+
value: function value(newVal, oldVal) {
|
|
325
|
+
if (!isEqual(newVal, oldVal)) {
|
|
326
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
327
|
+
}
|
|
275
328
|
}
|
|
276
329
|
},
|
|
277
330
|
render: function render() {
|
|
278
331
|
var h = arguments[0];
|
|
279
332
|
|
|
280
|
-
if (!this.range) {
|
|
333
|
+
if (!this.range || !this.currentValue) {
|
|
281
334
|
return null;
|
|
282
335
|
}
|
|
283
336
|
|
|
@@ -291,13 +344,15 @@ var DynamicRangeSlider = {
|
|
|
291
344
|
}, [this.$props.title]), h(NoSSR, [h(Slider, {
|
|
292
345
|
"class": getClassName(this.$props.innerClass, 'slider')
|
|
293
346
|
}, [h("vue-slider-component", {
|
|
347
|
+
"ref": "slider",
|
|
294
348
|
"attrs": {
|
|
295
|
-
"value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
|
|
296
|
-
"min": Math.min(start, this.currentValue[0]),
|
|
297
|
-
"max": Math.max(end, this.currentValue[1]),
|
|
349
|
+
"value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
|
|
350
|
+
"min": Math.floor(Math.min(start, this.currentValue[0])),
|
|
351
|
+
"max": Math.ceil(Math.max(end, this.currentValue[1])),
|
|
298
352
|
"dotSize": 20,
|
|
299
353
|
"height": 4,
|
|
300
|
-
"enable-cross": false
|
|
354
|
+
"enable-cross": false,
|
|
355
|
+
"tooltip": "always"
|
|
301
356
|
},
|
|
302
357
|
"on": {
|
|
303
358
|
"drag-end": this.handleSlider
|
|
@@ -343,7 +398,15 @@ DynamicRangeSlider.defaultQuery = function (values, props) {
|
|
|
343
398
|
};
|
|
344
399
|
|
|
345
400
|
DynamicRangeSlider.parseValue = function (value) {
|
|
346
|
-
|
|
401
|
+
if (value) {
|
|
402
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return [];
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
DynamicRangeSlider.hasInternalComponent = function () {
|
|
409
|
+
return true;
|
|
347
410
|
};
|
|
348
411
|
|
|
349
412
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
@@ -370,7 +433,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
370
433
|
options: options,
|
|
371
434
|
range: range,
|
|
372
435
|
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
373
|
-
componentProps: state.props[props.componentId]
|
|
436
|
+
componentProps: state.props[props.componentId],
|
|
437
|
+
enableAppbase: state.config.enableAppbase
|
|
374
438
|
};
|
|
375
439
|
};
|
|
376
440
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-76660dab.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-76660dab.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 };
|