@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
|
@@ -4,94 +4,40 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
4
4
|
|
|
5
5
|
var configureStore = require('@appbaseio/reactivecore');
|
|
6
6
|
var configureStore__default = _interopDefault(configureStore);
|
|
7
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
7
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
|
|
8
8
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
9
9
|
var emotion = require('emotion');
|
|
10
10
|
var styled = require('@appbaseio/vue-emotion');
|
|
11
11
|
var styled__default = _interopDefault(styled);
|
|
12
|
-
var vueTypes = require('./vueTypes-
|
|
13
|
-
var index = require('./index-
|
|
14
|
-
var
|
|
15
|
-
var
|
|
12
|
+
var vueTypes = require('./vueTypes-6de9d2a9.js');
|
|
13
|
+
var index = require('./index-6a167fe0.js');
|
|
14
|
+
var _mergeJSXProps = _interopDefault(require('@vue/babel-helper-vue-jsx-merge-props'));
|
|
15
|
+
var CancelSvg = require('./CancelSvg-9f258f4f.js');
|
|
16
|
+
var Input = require('./Input-e6603a7e.js');
|
|
17
|
+
var suggestions = require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_templateObject4 = function _templateObject4() {
|
|
21
|
-
return data;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return data;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function _templateObject3() {
|
|
28
|
-
var data = _rollupPluginBabelHelpers._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"]);
|
|
29
|
-
|
|
30
|
-
_templateObject3 = function _templateObject3() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return data;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _templateObject2() {
|
|
38
|
-
var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"]);
|
|
39
|
-
|
|
40
|
-
_templateObject2 = function _templateObject2() {
|
|
41
|
-
return data;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
return data;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function _templateObject() {
|
|
48
|
-
var data = _rollupPluginBabelHelpers._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"]);
|
|
49
|
-
|
|
50
|
-
_templateObject = function _templateObject() {
|
|
51
|
-
return data;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
|
-
var small = emotion.css(_templateObject());
|
|
19
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
20
|
+
var small = emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._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"])));
|
|
57
21
|
|
|
58
22
|
var dark = function dark(_ref) {
|
|
59
23
|
var theme = _ref.theme;
|
|
60
|
-
return emotion.css(_templateObject2(), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
|
|
24
|
+
return emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._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);
|
|
61
25
|
};
|
|
62
26
|
|
|
63
|
-
var Select = styled__default('button')(_templateObject3(), function (props) {
|
|
27
|
+
var Select = styled__default('button')(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._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) {
|
|
64
28
|
return props.small ? small : null;
|
|
65
29
|
}, function (_ref2) {
|
|
66
30
|
var themePreset = _ref2.themePreset;
|
|
67
31
|
return themePreset === 'dark' && dark;
|
|
68
32
|
});
|
|
69
|
-
var Tick = styled__default('span')(_templateObject4(), function (_ref3) {
|
|
33
|
+
var Tick = styled__default('span')(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._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) {
|
|
70
34
|
var theme = _ref3.theme;
|
|
71
35
|
return theme.colors.primaryColor;
|
|
72
36
|
});
|
|
73
37
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
_templateObject2$1 = function _templateObject2() {
|
|
78
|
-
return data;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return data;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _templateObject$1() {
|
|
85
|
-
var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"]);
|
|
86
|
-
|
|
87
|
-
_templateObject$1 = function _templateObject() {
|
|
88
|
-
return data;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
var open = emotion.css(_templateObject$1());
|
|
94
|
-
var Chevron = styled__default('span')(_templateObject2$1(), function (props) {
|
|
38
|
+
var _templateObject$1, _templateObject2$1;
|
|
39
|
+
var open = emotion.css(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
|
|
40
|
+
var Chevron = styled__default('span')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._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) {
|
|
95
41
|
return props.open ? open : null;
|
|
96
42
|
});
|
|
97
43
|
|
|
@@ -114,23 +60,25 @@ var Dropdown = {
|
|
|
114
60
|
items: vueTypes.types.data,
|
|
115
61
|
keyField: VueTypes.string.def('key'),
|
|
116
62
|
labelField: VueTypes.string.def('label'),
|
|
117
|
-
multi:
|
|
63
|
+
multi: VueTypes.bool,
|
|
118
64
|
// change event
|
|
119
65
|
placeholder: vueTypes.types.string,
|
|
120
|
-
returnsObject:
|
|
66
|
+
returnsObject: VueTypes.bool,
|
|
121
67
|
customLabelRenderer: vueTypes.types.func,
|
|
122
|
-
hasCustomRenderer:
|
|
68
|
+
hasCustomRenderer: VueTypes.bool,
|
|
123
69
|
customRenderer: vueTypes.types.func,
|
|
124
70
|
renderItem: vueTypes.types.func,
|
|
125
71
|
renderNoResults: VueTypes.any,
|
|
126
72
|
handleChange: vueTypes.types.func,
|
|
127
73
|
transformData: vueTypes.types.func,
|
|
128
74
|
selectedItem: vueTypes.types.selectedValue,
|
|
129
|
-
showCount:
|
|
130
|
-
single:
|
|
75
|
+
showCount: VueTypes.bool,
|
|
76
|
+
single: VueTypes.bool,
|
|
131
77
|
small: VueTypes.bool.def(false),
|
|
132
78
|
themePreset: vueTypes.types.themePreset,
|
|
133
|
-
showSearch:
|
|
79
|
+
showSearch: VueTypes.bool,
|
|
80
|
+
showClear: VueTypes.bool,
|
|
81
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
134
82
|
},
|
|
135
83
|
render: function render() {
|
|
136
84
|
var _this = this;
|
|
@@ -158,7 +106,7 @@ var Dropdown = {
|
|
|
158
106
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
159
107
|
if (String(item[labelField]).length) {
|
|
160
108
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
161
|
-
return String(item[labelField]).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
|
|
109
|
+
return suggestions.replaceDiacritics(String(item[labelField])).toLowerCase().includes(suggestions.replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
|
|
162
110
|
}
|
|
163
111
|
|
|
164
112
|
return true;
|
|
@@ -166,7 +114,7 @@ var Dropdown = {
|
|
|
166
114
|
|
|
167
115
|
return false;
|
|
168
116
|
});
|
|
169
|
-
return h(
|
|
117
|
+
return h(CancelSvg.Downshift, {
|
|
170
118
|
"attrs": {
|
|
171
119
|
"isOpen": this.$data.isOpen,
|
|
172
120
|
"selectedItem": selectedItem,
|
|
@@ -179,7 +127,8 @@ var Dropdown = {
|
|
|
179
127
|
isOpen = _ref.isOpen,
|
|
180
128
|
highlightedIndex = _ref.highlightedIndex,
|
|
181
129
|
getButtonProps = _ref.getButtonProps,
|
|
182
|
-
getItemEvents = _ref.getItemEvents
|
|
130
|
+
getItemEvents = _ref.getItemEvents,
|
|
131
|
+
getInputEvents = _ref.getInputEvents;
|
|
183
132
|
return h("div", {
|
|
184
133
|
"class": Input.suggestionsContainer
|
|
185
134
|
}, [h(Select, {
|
|
@@ -204,26 +153,16 @@ var Dropdown = {
|
|
|
204
153
|
getItemEvents: getItemEvents
|
|
205
154
|
}) : isOpen && itemsToRender.length ? h("ul", {
|
|
206
155
|
"class": Input.suggestions(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName(_this.$props.innerClass, 'list')
|
|
207
|
-
}, [_this.$props.showSearch ?
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
"value": _this.$data.searchTerm,
|
|
213
|
-
"themePreset": themePreset
|
|
214
|
-
},
|
|
215
|
-
"style": {
|
|
216
|
-
border: 0,
|
|
217
|
-
borderBottom: '1px solid #ddd'
|
|
218
|
-
},
|
|
219
|
-
"class": getClassName(_this.$props.innerClass, 'input'),
|
|
220
|
-
"on": {
|
|
221
|
-
"change": _this.handleInputChange
|
|
156
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
157
|
+
on: {
|
|
158
|
+
input: getInputEvents({
|
|
159
|
+
onInput: _this.handleInputChange
|
|
160
|
+
}).input
|
|
222
161
|
}
|
|
223
162
|
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
224
163
|
var selected = _this.$props.multi // MultiDropdownList
|
|
225
|
-
&& (selectedItem && !!selectedItem[item[keyField]]
|
|
226
|
-
Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
164
|
+
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
165
|
+
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
227
166
|
return value[labelField] === item[labelField];
|
|
228
167
|
}));
|
|
229
168
|
if (!_this.$props.multi) selected = item.key === selectedItem;
|
|
@@ -273,6 +212,7 @@ var Dropdown = {
|
|
|
273
212
|
|
|
274
213
|
if (!this.$props.multi) {
|
|
275
214
|
this.isOpen = false;
|
|
215
|
+
this.searchTerm = '';
|
|
276
216
|
}
|
|
277
217
|
},
|
|
278
218
|
handleStateChange: function handleStateChange(_ref2) {
|
|
@@ -296,6 +236,9 @@ var Dropdown = {
|
|
|
296
236
|
var value = e.target.value;
|
|
297
237
|
this.searchTerm = value;
|
|
298
238
|
},
|
|
239
|
+
clearSearchTerm: function clearSearchTerm() {
|
|
240
|
+
this.searchTerm = '';
|
|
241
|
+
},
|
|
299
242
|
renderToString: function renderToString(value) {
|
|
300
243
|
var _this2 = this;
|
|
301
244
|
|
|
@@ -336,6 +279,48 @@ var Dropdown = {
|
|
|
336
279
|
return h("p", {
|
|
337
280
|
"class": getClassName(this.$props.innerClass, 'noResults') || null
|
|
338
281
|
}, [index.isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
282
|
+
},
|
|
283
|
+
renderSearchbox: function renderSearchbox(eventObject) {
|
|
284
|
+
var h = this.$createElement;
|
|
285
|
+
var _this$$props2 = this.$props,
|
|
286
|
+
componentId = _this$$props2.componentId,
|
|
287
|
+
searchPlaceholder = _this$$props2.searchPlaceholder,
|
|
288
|
+
showClear = _this$$props2.showClear,
|
|
289
|
+
themePreset = _this$$props2.themePreset,
|
|
290
|
+
innerClass = _this$$props2.innerClass;
|
|
291
|
+
var InputComponent = h(Input.Input, _mergeJSXProps([{
|
|
292
|
+
"attrs": {
|
|
293
|
+
"id": componentId + "-input",
|
|
294
|
+
"showIcon": false,
|
|
295
|
+
"showClear": showClear,
|
|
296
|
+
"placeholder": searchPlaceholder,
|
|
297
|
+
"value": this.$data.searchTerm,
|
|
298
|
+
"themePreset": themePreset
|
|
299
|
+
},
|
|
300
|
+
"style": {
|
|
301
|
+
border: 0,
|
|
302
|
+
borderBottom: '1px solid #ddd'
|
|
303
|
+
},
|
|
304
|
+
"class": getClassName(innerClass, 'input')
|
|
305
|
+
}, eventObject]));
|
|
306
|
+
|
|
307
|
+
if (showClear) {
|
|
308
|
+
return h(CancelSvg.InputWrapper, [InputComponent, this.searchTerm && h(CancelSvg.IconGroup, {
|
|
309
|
+
"attrs": {
|
|
310
|
+
"groupPosition": "right",
|
|
311
|
+
"positionType": "absolute"
|
|
312
|
+
}
|
|
313
|
+
}, [h(CancelSvg.IconWrapper, {
|
|
314
|
+
"on": {
|
|
315
|
+
"click": this.clearSearchTerm
|
|
316
|
+
},
|
|
317
|
+
"attrs": {
|
|
318
|
+
"isClearIcon": true
|
|
319
|
+
}
|
|
320
|
+
}, [h(CancelSvg.CancelSvg)])])]);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return InputComponent;
|
|
339
324
|
}
|
|
340
325
|
}
|
|
341
326
|
};
|
|
@@ -6,17 +6,17 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
6
6
|
|
|
7
7
|
var configureStore = require('@appbaseio/reactivecore');
|
|
8
8
|
var configureStore__default = _interopDefault(configureStore);
|
|
9
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
9
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
|
|
10
10
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
11
11
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
12
12
|
require('@appbaseio/vue-emotion');
|
|
13
|
-
var vueTypes = require('./vueTypes-
|
|
13
|
+
var vueTypes = require('./vueTypes-6de9d2a9.js');
|
|
14
14
|
require('redux');
|
|
15
|
-
var index = require('./index-
|
|
16
|
-
var Title = require('./Title-
|
|
17
|
-
var Container = require('./Container-
|
|
15
|
+
var index = require('./index-6a167fe0.js');
|
|
16
|
+
var Title = require('./Title-1de7d0f4.js');
|
|
17
|
+
var Container = require('./Container-daf30918.js');
|
|
18
18
|
var NoSSR = _interopDefault(require('vue-no-ssr'));
|
|
19
|
-
var ssr = require('./ssr-
|
|
19
|
+
var ssr = require('./ssr-3027b848.js');
|
|
20
20
|
|
|
21
21
|
var addComponent = configureStore.Actions.addComponent,
|
|
22
22
|
removeComponent = configureStore.Actions.removeComponent,
|
|
@@ -29,9 +29,10 @@ var addComponent = configureStore.Actions.addComponent,
|
|
|
29
29
|
updateComponentProps = configureStore.Actions.updateComponentProps;
|
|
30
30
|
var checkValueChange = configureStore.helper.checkValueChange,
|
|
31
31
|
getClassName = configureStore.helper.getClassName,
|
|
32
|
-
getOptionsFromQuery = configureStore.helper.getOptionsFromQuery,
|
|
33
32
|
isEqual = configureStore.helper.isEqual,
|
|
34
|
-
checkSomePropChange = configureStore.helper.checkSomePropChange
|
|
33
|
+
checkSomePropChange = configureStore.helper.checkSomePropChange,
|
|
34
|
+
extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
|
|
35
|
+
getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
|
|
35
36
|
var DynamicRangeSlider = {
|
|
36
37
|
name: 'DynamicRangeSlider',
|
|
37
38
|
components: ssr.getComponents(),
|
|
@@ -48,11 +49,14 @@ var DynamicRangeSlider = {
|
|
|
48
49
|
innerClass: vueTypes.types.style,
|
|
49
50
|
react: vueTypes.types.react,
|
|
50
51
|
showFilter: VueTypes.bool.def(true),
|
|
52
|
+
destroyOnUnmount: VueTypes.bool,
|
|
51
53
|
showCheckbox: VueTypes.bool.def(true),
|
|
52
54
|
title: vueTypes.types.title,
|
|
53
55
|
URLParams: VueTypes.bool.def(false),
|
|
54
56
|
sliderOptions: VueTypes.object.def({}),
|
|
55
|
-
nestedField: vueTypes.types.string
|
|
57
|
+
nestedField: vueTypes.types.string,
|
|
58
|
+
index: VueTypes.string,
|
|
59
|
+
value: vueTypes.types.range
|
|
56
60
|
},
|
|
57
61
|
data: function data() {
|
|
58
62
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -77,7 +81,12 @@ var DynamicRangeSlider = {
|
|
|
77
81
|
this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
|
|
78
82
|
|
|
79
83
|
this.setComponentProps(this.componentId, this.$props, constants.componentTypes.dynamicRangeSlider);
|
|
80
|
-
this.setComponentProps(this.internalRangeComponent, this.$props, constants.componentTypes.dynamicRangeSlider);
|
|
84
|
+
this.setComponentProps(this.internalRangeComponent, this.$props, constants.componentTypes.dynamicRangeSlider);
|
|
85
|
+
|
|
86
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
87
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
88
|
+
} // Set custom query in store
|
|
89
|
+
|
|
81
90
|
|
|
82
91
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
83
92
|
},
|
|
@@ -85,17 +94,31 @@ var DynamicRangeSlider = {
|
|
|
85
94
|
this.setReact();
|
|
86
95
|
},
|
|
87
96
|
beforeMount: function beforeMount() {
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
var components = [];
|
|
98
|
+
|
|
99
|
+
if (this.$$store) {
|
|
100
|
+
var _this$$$store$getStat = this.$$store.getState();
|
|
101
|
+
|
|
102
|
+
components = _this$$$store$getStat.components;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
var value = this.$props.value;
|
|
90
106
|
|
|
91
|
-
if (
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
95
|
-
} // get range before executing other queries
|
|
107
|
+
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
108
|
+
this.addComponent(this.componentId);
|
|
109
|
+
this.addComponent(this.internalRangeComponent);
|
|
96
110
|
|
|
111
|
+
if (Array.isArray(this.selectedValue)) {
|
|
112
|
+
this.handleChange(this.selectedValue);
|
|
113
|
+
} else if (this.selectedValue) {
|
|
114
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
115
|
+
} else if (value) {
|
|
116
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
117
|
+
} // get range before executing other queries
|
|
97
118
|
|
|
98
|
-
|
|
119
|
+
|
|
120
|
+
this.updateRangeQueryOptions();
|
|
121
|
+
}
|
|
99
122
|
},
|
|
100
123
|
beforeUpdate: function beforeUpdate() {
|
|
101
124
|
if (!this.currentValue) {
|
|
@@ -103,10 +126,19 @@ var DynamicRangeSlider = {
|
|
|
103
126
|
}
|
|
104
127
|
},
|
|
105
128
|
beforeDestroy: function beforeDestroy() {
|
|
106
|
-
|
|
107
|
-
|
|
129
|
+
if (this.destroyOnUnmount) {
|
|
130
|
+
this.removeComponent(this.$props.componentId);
|
|
131
|
+
this.removeComponent(this.internalRangeComponent);
|
|
132
|
+
}
|
|
108
133
|
},
|
|
109
134
|
methods: {
|
|
135
|
+
isControlled: function isControlled() {
|
|
136
|
+
if (this.$props.value && this.$listeners) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return false;
|
|
141
|
+
},
|
|
110
142
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
111
143
|
var start = _ref.start,
|
|
112
144
|
end = _ref.end;
|
|
@@ -117,6 +149,8 @@ var DynamicRangeSlider = {
|
|
|
117
149
|
defaultEnd = _this$$props$defaultV.end;
|
|
118
150
|
|
|
119
151
|
this.handleChange([defaultStart, defaultEnd]);
|
|
152
|
+
} else if (this.isControlled()) {
|
|
153
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
120
154
|
} else {
|
|
121
155
|
this.currentValue = [start, end];
|
|
122
156
|
}
|
|
@@ -164,8 +198,18 @@ var DynamicRangeSlider = {
|
|
|
164
198
|
aggs: aggs
|
|
165
199
|
});
|
|
166
200
|
},
|
|
167
|
-
handleSlider: function handleSlider(
|
|
168
|
-
this.
|
|
201
|
+
handleSlider: function handleSlider() {
|
|
202
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
203
|
+
var value = this.$props.value;
|
|
204
|
+
|
|
205
|
+
if (value === undefined) {
|
|
206
|
+
this.handleChange(sliderValues);
|
|
207
|
+
} else {
|
|
208
|
+
this.$emit('change', {
|
|
209
|
+
start: sliderValues[0],
|
|
210
|
+
end: sliderValues[1]
|
|
211
|
+
});
|
|
212
|
+
}
|
|
169
213
|
},
|
|
170
214
|
handleChange: function handleChange(currentValue) {
|
|
171
215
|
var _this2 = this;
|
|
@@ -196,28 +240,31 @@ var DynamicRangeSlider = {
|
|
|
196
240
|
},
|
|
197
241
|
updateQueryHandler: function updateQueryHandler(value) {
|
|
198
242
|
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
199
|
-
var customQueryOptions;
|
|
200
243
|
|
|
201
244
|
if (this.$props.customQuery) {
|
|
202
|
-
var
|
|
245
|
+
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
246
|
+
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
247
|
+
|
|
248
|
+
if (queryTobeSet) {
|
|
249
|
+
query = queryTobeSet;
|
|
250
|
+
}
|
|
203
251
|
|
|
204
|
-
|
|
205
|
-
customQueryOptions = getOptionsFromQuery(this.$props.customQuery(value, this.$props));
|
|
252
|
+
var customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
206
253
|
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
254
|
+
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
207
255
|
}
|
|
208
256
|
|
|
209
|
-
var
|
|
257
|
+
var _ref2 = this.range || {
|
|
210
258
|
start: value[0],
|
|
211
259
|
end: value[1]
|
|
212
260
|
},
|
|
213
|
-
start =
|
|
214
|
-
end =
|
|
261
|
+
start = _ref2.start,
|
|
262
|
+
end = _ref2.end;
|
|
215
263
|
|
|
216
264
|
var currentStart = value[0],
|
|
217
265
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
218
266
|
|
|
219
267
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
220
|
-
this.setQueryOptions(this.$props.componentId, customQueryOptions);
|
|
221
268
|
this.updateQuery({
|
|
222
269
|
componentId: this.$props.componentId,
|
|
223
270
|
query: query,
|
|
@@ -258,18 +305,19 @@ var DynamicRangeSlider = {
|
|
|
258
305
|
start: this.range.start,
|
|
259
306
|
end: this.range.end
|
|
260
307
|
};
|
|
308
|
+
this.$emit('change', value);
|
|
261
309
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
262
310
|
},
|
|
263
311
|
range: function range(newValue, oldValue) {
|
|
264
312
|
if (isEqual(newValue, oldValue) || !this.currentValue) return;
|
|
265
313
|
|
|
266
|
-
var
|
|
267
|
-
currentStart =
|
|
268
|
-
currentEnd =
|
|
314
|
+
var _ref3 = this.currentValue || [],
|
|
315
|
+
currentStart = _ref3[0],
|
|
316
|
+
currentEnd = _ref3[1];
|
|
269
317
|
|
|
270
|
-
var
|
|
271
|
-
oldStart =
|
|
272
|
-
oldEnd =
|
|
318
|
+
var _ref4 = oldValue || {},
|
|
319
|
+
oldStart = _ref4.start,
|
|
320
|
+
oldEnd = _ref4.end;
|
|
273
321
|
|
|
274
322
|
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
275
323
|
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
@@ -279,12 +327,17 @@ var DynamicRangeSlider = {
|
|
|
279
327
|
if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
280
328
|
this.updateQueryHandler(this.$data.currentValue);
|
|
281
329
|
}
|
|
330
|
+
},
|
|
331
|
+
value: function value(newVal, oldVal) {
|
|
332
|
+
if (!isEqual(newVal, oldVal)) {
|
|
333
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
334
|
+
}
|
|
282
335
|
}
|
|
283
336
|
},
|
|
284
337
|
render: function render() {
|
|
285
338
|
var h = arguments[0];
|
|
286
339
|
|
|
287
|
-
if (!this.range) {
|
|
340
|
+
if (!this.range || !this.currentValue) {
|
|
288
341
|
return null;
|
|
289
342
|
}
|
|
290
343
|
|
|
@@ -298,13 +351,15 @@ var DynamicRangeSlider = {
|
|
|
298
351
|
}, [this.$props.title]), h(NoSSR, [h(ssr.Slider, {
|
|
299
352
|
"class": getClassName(this.$props.innerClass, 'slider')
|
|
300
353
|
}, [h("vue-slider-component", {
|
|
354
|
+
"ref": "slider",
|
|
301
355
|
"attrs": {
|
|
302
|
-
"value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
|
|
303
|
-
"min": Math.min(start, this.currentValue[0]),
|
|
304
|
-
"max": Math.max(end, this.currentValue[1]),
|
|
356
|
+
"value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
|
|
357
|
+
"min": Math.floor(Math.min(start, this.currentValue[0])),
|
|
358
|
+
"max": Math.ceil(Math.max(end, this.currentValue[1])),
|
|
305
359
|
"dotSize": 20,
|
|
306
360
|
"height": 4,
|
|
307
|
-
"enable-cross": false
|
|
361
|
+
"enable-cross": false,
|
|
362
|
+
"tooltip": "always"
|
|
308
363
|
},
|
|
309
364
|
"on": {
|
|
310
365
|
"drag-end": this.handleSlider
|
|
@@ -350,7 +405,15 @@ DynamicRangeSlider.defaultQuery = function (values, props) {
|
|
|
350
405
|
};
|
|
351
406
|
|
|
352
407
|
DynamicRangeSlider.parseValue = function (value) {
|
|
353
|
-
|
|
408
|
+
if (value) {
|
|
409
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return [];
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
DynamicRangeSlider.hasInternalComponent = function () {
|
|
416
|
+
return true;
|
|
354
417
|
};
|
|
355
418
|
|
|
356
419
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
@@ -377,7 +440,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
377
440
|
options: options,
|
|
378
441
|
range: range,
|
|
379
442
|
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
380
|
-
componentProps: state.props[props.componentId]
|
|
443
|
+
componentProps: state.props[props.componentId],
|
|
444
|
+
enableAppbase: state.config.enableAppbase
|
|
381
445
|
};
|
|
382
446
|
};
|
|
383
447
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
|
|
6
|
+
var emotion = require('emotion');
|
|
7
|
+
var styled = require('@appbaseio/vue-emotion');
|
|
8
|
+
var styled__default = _interopDefault(styled);
|
|
9
|
+
var polished = require('polished');
|
|
10
|
+
|
|
11
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
12
|
+
var leftLabel = emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: row;\n\talign-items: center;\n"])));
|
|
13
|
+
var rightLabel = emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: row-reverse;\n\talign-items: center;\n"])));
|
|
14
|
+
var topLabel = emotion.css(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: column;\n"])));
|
|
15
|
+
var bottomLabel = emotion.css(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: column-reverse;\n"])));
|
|
16
|
+
|
|
17
|
+
var border = function border(_ref) {
|
|
18
|
+
var colors = _ref.theme.colors;
|
|
19
|
+
return emotion.css(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tborder: 1px solid ", ";\n"])), colors.borderColor || '#ccc');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var Flex = styled__default('div')(_templateObject6 || (_templateObject6 = _rollupPluginBabelHelpers._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) {
|
|
23
|
+
return props.inline ? 'inline-flex' : 'flex';
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
|
|
26
|
+
}, function (props) {
|
|
27
|
+
return (props.labelPosition === 'right' || props.iconPosition === 'left') && rightLabel;
|
|
28
|
+
}, function (props) {
|
|
29
|
+
return props.labelPosition === 'top' && topLabel;
|
|
30
|
+
}, function (props) {
|
|
31
|
+
return props.labelPosition === 'bottom' && bottomLabel;
|
|
32
|
+
}, function (props) {
|
|
33
|
+
return props.showBorder && border;
|
|
34
|
+
}, function (props) {
|
|
35
|
+
return props.justifyContent && emotion.css(_templateObject7 || (_templateObject7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tjustify-content: ", ";\n\t\t"])), props.justifyContent);
|
|
36
|
+
}, function (props) {
|
|
37
|
+
return props.alignItems && emotion.css(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\talign-items: ", ";\n\t\t"])), props.alignItems);
|
|
38
|
+
}, function (props) {
|
|
39
|
+
return props.flex && emotion.css(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tflex: ", ";\n\t\t"])), props.flex);
|
|
40
|
+
}, function (props) {
|
|
41
|
+
return props.direction && emotion.css(_templateObject10 || (_templateObject10 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tflex-direction: ", ";\n\t\t"])), props.direction);
|
|
42
|
+
}, function (props) {
|
|
43
|
+
return props.basis && emotion.css(_templateObject11 || (_templateObject11 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tflex-basis: ", ";\n\t\t"])), props.basis);
|
|
44
|
+
}, function (_ref2) {
|
|
45
|
+
var colors = _ref2.theme.colors;
|
|
46
|
+
return colors.borderColor || polished.lighten(0.3, colors.textColor);
|
|
47
|
+
}, function (_ref3) {
|
|
48
|
+
var theme = _ref3.theme;
|
|
49
|
+
return theme.colors.textColor;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
exports.Flex = Flex;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
|
|
6
|
+
var emotion = require('emotion');
|
|
7
|
+
var styled = require('@appbaseio/vue-emotion');
|
|
8
|
+
var styled__default = _interopDefault(styled);
|
|
9
|
+
var polished = require('polished');
|
|
10
|
+
|
|
11
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
12
|
+
var item = {
|
|
13
|
+
width: '15px',
|
|
14
|
+
height: '15px',
|
|
15
|
+
scale: '4px'
|
|
16
|
+
};
|
|
17
|
+
var vh = emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._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"])));
|
|
18
|
+
var hideInputControl = emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._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"])));
|
|
19
|
+
|
|
20
|
+
var formItem = function formItem(_ref) {
|
|
21
|
+
var theme = _ref.theme;
|
|
22
|
+
return emotion.css(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._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, polished.lighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || polished.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);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var Radio = styled__default('input')(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._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) {
|
|
26
|
+
return props.show ? null : hideInputControl;
|
|
27
|
+
}, function (_ref2) {
|
|
28
|
+
var theme = _ref2.theme;
|
|
29
|
+
return theme.colors.primaryColor;
|
|
30
|
+
}, function (_ref3) {
|
|
31
|
+
var theme = _ref3.theme;
|
|
32
|
+
return theme.colors.primaryColor;
|
|
33
|
+
});
|
|
34
|
+
var Checkbox = styled__default('input')(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers._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) {
|
|
35
|
+
return props.show ? null : hideInputControl;
|
|
36
|
+
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
37
|
+
var theme = _ref4.theme;
|
|
38
|
+
return theme.colors.primaryColor;
|
|
39
|
+
}, function (_ref5) {
|
|
40
|
+
var theme = _ref5.theme;
|
|
41
|
+
return theme.colors.primaryColor;
|
|
42
|
+
});
|
|
43
|
+
var UL = styled__default('ul')(_templateObject6 || (_templateObject6 = _rollupPluginBabelHelpers._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"])));
|
|
44
|
+
|
|
45
|
+
exports.Checkbox = Checkbox;
|
|
46
|
+
exports.Radio = Radio;
|
|
47
|
+
exports.UL = UL;
|