@appbaseio/reactivesearch-vue 2.0.0-alpha.4 → 3.0.0-alpha.1
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/README.md +9 -9
- package/dist/@appbaseio/reactivesearch-vue.umd.js +21316 -29369
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -19
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/Button-ad042719.js +59 -0
- package/dist/cjs/Card-f5ab024a.js +27 -0
- package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-611cf7f9.js} +44 -58
- package/dist/cjs/Container-29f049b2.js +12 -0
- package/dist/cjs/DropDown-dc184468.js +700 -0
- package/dist/cjs/DynamicRangeSlider.js +106 -157
- package/dist/cjs/Flex-d5675ea6.js +48 -0
- package/dist/cjs/FormControlList-fadd792f.js +42 -0
- package/dist/cjs/Input-088dfcb4.js +74 -0
- package/dist/cjs/ListItem-d57d648d.js +42 -0
- package/dist/cjs/MultiDropdownList.js +124 -240
- package/dist/cjs/MultiList.js +124 -262
- package/dist/cjs/MultiRange.js +87 -133
- package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
- package/dist/cjs/PreferencesConsumer-22d1b49f.js +73 -0
- package/dist/cjs/RangeInput.js +163 -171
- package/dist/cjs/RangeSlider.js +81 -109
- package/dist/cjs/ReactiveBase.js +139 -156
- package/dist/cjs/ReactiveComponent-a6108189.js +2184 -0
- package/dist/cjs/ReactiveComponent.js +46 -340
- package/dist/cjs/ReactiveGoogleMap.js +451 -660
- package/dist/cjs/ReactiveList.js +180 -305
- package/dist/cjs/ResultCard.js +36 -36
- package/dist/cjs/ResultList.js +48 -56
- package/dist/cjs/SelectedFilters.js +62 -69
- package/dist/cjs/SingleDropdownList.js +117 -177
- package/dist/cjs/SingleList.js +122 -206
- package/dist/cjs/SingleRange.js +78 -105
- package/dist/cjs/StateProvider.js +35 -38
- package/dist/cjs/Title-8802a218.js +12 -0
- package/dist/cjs/ToggleButton.js +72 -119
- package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
- package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
- package/dist/cjs/index.js +44 -41
- package/dist/cjs/initReactivesearch.js +63 -150
- package/dist/cjs/install.js +47 -43
- package/dist/cjs/ssr-6c8a72e1.js +66 -0
- package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
- package/dist/es/Button-474510e3.js +53 -0
- package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
- package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-3dfe6931.js} +44 -58
- package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
- package/dist/es/DropDown-029ffd42.js +690 -0
- package/dist/es/DynamicRangeSlider.js +106 -157
- package/dist/es/Flex-a08e22d7.js +46 -0
- package/dist/es/FormControlList-fe6eaee4.js +38 -0
- package/dist/es/Input-ad474a55.js +69 -0
- package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
- package/dist/es/MultiDropdownList.js +124 -240
- package/dist/es/MultiList.js +124 -262
- package/dist/es/MultiRange.js +87 -133
- package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
- package/dist/es/PreferencesConsumer-24e88f3b.js +71 -0
- package/dist/es/RangeInput.js +163 -170
- package/dist/es/RangeSlider.js +81 -109
- package/dist/es/ReactiveBase.js +138 -154
- package/dist/es/ReactiveComponent-0a97eb1e.js +2178 -0
- package/dist/es/ReactiveComponent.js +42 -337
- package/dist/es/ReactiveGoogleMap.js +446 -654
- package/dist/es/ReactiveList.js +178 -302
- package/dist/es/ResultCard.js +36 -36
- package/dist/es/ResultList.js +48 -56
- package/dist/es/SelectedFilters.js +62 -69
- package/dist/es/SingleDropdownList.js +117 -177
- package/dist/es/SingleList.js +122 -206
- package/dist/es/SingleRange.js +78 -105
- package/dist/es/StateProvider.js +36 -39
- package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
- package/dist/es/ToggleButton.js +72 -119
- package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
- package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
- package/dist/es/index.js +30 -32
- package/dist/es/initReactivesearch.js +63 -150
- package/dist/es/install.js +49 -41
- package/dist/es/{ssr-b2c0b401.js → ssr-584c278d.js} +37 -8
- package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
- package/package.json +10 -9
- package/dist/cjs/Button-446f819e.js +0 -68
- package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
- package/dist/cjs/Card-642547a8.js +0 -30
- package/dist/cjs/Container-daf30918.js +0 -15
- package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
- package/dist/cjs/DataSearch.js +0 -30
- package/dist/cjs/DropDown-c479bbb0.js +0 -328
- package/dist/cjs/Flex-aa517a13.js +0 -52
- package/dist/cjs/FormControlList-c195a592.js +0 -47
- package/dist/cjs/Input-e6603a7e.js +0 -79
- package/dist/cjs/ListItem-8c9e0d68.js +0 -46
- package/dist/cjs/Title-1de7d0f4.js +0 -15
- package/dist/cjs/install-b97dbac4.js +0 -1409
- package/dist/cjs/ssr-3027b848.js +0 -39
- package/dist/es/Button-d8bc15ea.js +0 -59
- package/dist/es/CancelSvg-4cfae5fd.js +0 -440
- package/dist/es/DataSearch-b86a6675.js +0 -2337
- package/dist/es/DataSearch.js +0 -22
- package/dist/es/DropDown-05a644a5.js +0 -322
- package/dist/es/Flex-1f0795c3.js +0 -47
- package/dist/es/FormControlList-c22d64f6.js +0 -40
- package/dist/es/Input-7a2a9fac.js +0 -71
- package/dist/es/install-ac8a1edb.js +0 -1402
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
|
-
import VueTypes from 'vue-types';
|
|
4
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
+
import './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
+
import { createVNode, resolveComponent, mergeProps } from 'vue';
|
|
5
|
+
import VueTypes from 'vue-types';
|
|
5
6
|
import '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
7
|
+
import { t as types } from './vueTypes-f1923c72.js';
|
|
7
8
|
import 'redux';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { g as getComponents, S as Slider } from './ssr-
|
|
9
|
+
import { j as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-4520a598.js';
|
|
10
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
|
|
11
|
+
import { T as Title } from './Title-863dfa42.js';
|
|
12
|
+
import { C as Container } from './Container-d00219f7.js';
|
|
13
|
+
import { g as getComponents, N as NoSSR, S as Slider } from './ssr-584c278d.js';
|
|
13
14
|
|
|
14
15
|
var addComponent = Actions.addComponent,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
removeComponent = Actions.removeComponent,
|
|
17
|
+
watchComponent = Actions.watchComponent,
|
|
18
|
+
updateQuery = Actions.updateQuery,
|
|
19
|
+
setQueryListener = Actions.setQueryListener,
|
|
20
|
+
setQueryOptions = Actions.setQueryOptions,
|
|
21
|
+
setComponentProps = Actions.setComponentProps,
|
|
22
|
+
setCustomQuery = Actions.setCustomQuery,
|
|
23
|
+
updateComponentProps = Actions.updateComponentProps;
|
|
23
24
|
var checkValueChange = helper.checkValueChange,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
getClassName = helper.getClassName,
|
|
26
|
+
isEqual = helper.isEqual,
|
|
27
|
+
checkSomePropChange = helper.checkSomePropChange,
|
|
28
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
29
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
29
30
|
var DynamicRangeSlider = {
|
|
30
31
|
name: 'DynamicRangeSlider',
|
|
31
32
|
components: getComponents(),
|
|
@@ -61,27 +62,20 @@ var DynamicRangeSlider = {
|
|
|
61
62
|
},
|
|
62
63
|
created: function created() {
|
|
63
64
|
var _this = this;
|
|
64
|
-
|
|
65
|
+
this.$timestamp = new Date().getTime();
|
|
65
66
|
var onQueryChange = function onQueryChange() {
|
|
66
67
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
67
68
|
args[_key] = arguments[_key];
|
|
68
69
|
}
|
|
69
|
-
|
|
70
70
|
_this.$emit.apply(_this, ['queryChange'].concat(args));
|
|
71
|
-
|
|
72
71
|
_this.$emit.apply(_this, ['query-change'].concat(args));
|
|
73
72
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
this.setQueryListener(this.$props.componentId, onQueryChange, null);
|
|
74
|
+
// Update props in store
|
|
77
75
|
this.setComponentProps(this.componentId, this.$props, componentTypes.dynamicRangeSlider);
|
|
78
76
|
this.setComponentProps(this.internalRangeComponent, this.$props, componentTypes.dynamicRangeSlider);
|
|
79
77
|
|
|
80
|
-
|
|
81
|
-
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
82
|
-
} // Set custom query in store
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
// Set custom query in store
|
|
85
79
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
86
80
|
},
|
|
87
81
|
mounted: function mounted() {
|
|
@@ -89,28 +83,23 @@ var DynamicRangeSlider = {
|
|
|
89
83
|
},
|
|
90
84
|
beforeMount: function beforeMount() {
|
|
91
85
|
var components = [];
|
|
92
|
-
|
|
93
86
|
if (this.$$store) {
|
|
94
87
|
var _this$$$store$getStat = this.$$store.getState();
|
|
95
|
-
|
|
96
88
|
components = _this$$$store$getStat.components;
|
|
97
89
|
}
|
|
98
|
-
|
|
99
90
|
var value = this.$props.value;
|
|
100
|
-
|
|
101
91
|
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
102
|
-
this.addComponent(this.componentId);
|
|
103
|
-
this.addComponent(this.internalRangeComponent);
|
|
104
|
-
|
|
92
|
+
this.addComponent(this.componentId, this.$timestamp);
|
|
93
|
+
this.addComponent(this.internalRangeComponent, this.$timestamp);
|
|
105
94
|
if (Array.isArray(this.selectedValue)) {
|
|
106
95
|
this.handleChange(this.selectedValue);
|
|
107
96
|
} else if (this.selectedValue) {
|
|
108
97
|
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
109
98
|
} else if (value) {
|
|
110
99
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
111
|
-
}
|
|
112
|
-
|
|
100
|
+
}
|
|
113
101
|
|
|
102
|
+
// get range before executing other queries
|
|
114
103
|
this.updateRangeQueryOptions();
|
|
115
104
|
}
|
|
116
105
|
},
|
|
@@ -119,7 +108,7 @@ var DynamicRangeSlider = {
|
|
|
119
108
|
this.setDefaultValue(this.range);
|
|
120
109
|
}
|
|
121
110
|
},
|
|
122
|
-
|
|
111
|
+
beforeUnmount: function beforeUnmount() {
|
|
123
112
|
if (this.destroyOnUnmount) {
|
|
124
113
|
this.removeComponent(this.$props.componentId);
|
|
125
114
|
this.removeComponent(this.internalRangeComponent);
|
|
@@ -127,21 +116,18 @@ var DynamicRangeSlider = {
|
|
|
127
116
|
},
|
|
128
117
|
methods: {
|
|
129
118
|
isControlled: function isControlled() {
|
|
130
|
-
if (this.$props.value && this.$
|
|
119
|
+
if (this.$props.value && this.$attrs) {
|
|
131
120
|
return true;
|
|
132
121
|
}
|
|
133
|
-
|
|
134
122
|
return false;
|
|
135
123
|
},
|
|
136
124
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
137
125
|
var start = _ref.start,
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
end = _ref.end;
|
|
140
127
|
if (this.$props.defaultValue) {
|
|
141
128
|
var _this$$props$defaultV = this.$props.defaultValue(start, end),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
defaultStart = _this$$props$defaultV.start,
|
|
130
|
+
defaultEnd = _this$$props$defaultV.end;
|
|
145
131
|
this.handleChange([defaultStart, defaultEnd]);
|
|
146
132
|
} else if (this.isControlled()) {
|
|
147
133
|
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
@@ -174,10 +160,8 @@ var DynamicRangeSlider = {
|
|
|
174
160
|
},
|
|
175
161
|
updateRangeQueryOptions: function updateRangeQueryOptions() {
|
|
176
162
|
var aggs = {};
|
|
177
|
-
|
|
178
163
|
if (this.$props.nestedField) {
|
|
179
164
|
var _aggs;
|
|
180
|
-
|
|
181
165
|
aggs = (_aggs = {}, _aggs[this.$props.nestedField] = {
|
|
182
166
|
nested: {
|
|
183
167
|
path: this.$props.nestedField
|
|
@@ -187,7 +171,6 @@ var DynamicRangeSlider = {
|
|
|
187
171
|
} else {
|
|
188
172
|
aggs = this.rangeQuery();
|
|
189
173
|
}
|
|
190
|
-
|
|
191
174
|
this.setQueryOptions(this.internalRangeComponent, {
|
|
192
175
|
aggs: aggs
|
|
193
176
|
});
|
|
@@ -195,7 +178,6 @@ var DynamicRangeSlider = {
|
|
|
195
178
|
handleSlider: function handleSlider() {
|
|
196
179
|
var sliderValues = this.$refs.slider.getValue();
|
|
197
180
|
var value = this.$props.value;
|
|
198
|
-
|
|
199
181
|
if (value === undefined) {
|
|
200
182
|
this.handleChange(sliderValues);
|
|
201
183
|
} else {
|
|
@@ -207,26 +189,20 @@ var DynamicRangeSlider = {
|
|
|
207
189
|
},
|
|
208
190
|
handleChange: function handleChange(currentValue) {
|
|
209
191
|
var _this2 = this;
|
|
210
|
-
|
|
211
192
|
// Always keep the values within range
|
|
212
193
|
var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
|
|
213
|
-
|
|
214
194
|
var performUpdate = function performUpdate() {
|
|
215
195
|
_this2.currentValue = normalizedValue;
|
|
216
|
-
|
|
217
196
|
_this2.updateQueryHandler(normalizedValue, _this2.$props);
|
|
218
|
-
|
|
219
197
|
_this2.$emit('valueChange', {
|
|
220
198
|
start: normalizedValue[0],
|
|
221
199
|
end: normalizedValue[1]
|
|
222
200
|
});
|
|
223
|
-
|
|
224
201
|
_this2.$emit('value-change', {
|
|
225
202
|
start: normalizedValue[0],
|
|
226
203
|
end: normalizedValue[1]
|
|
227
204
|
});
|
|
228
205
|
};
|
|
229
|
-
|
|
230
206
|
checkValueChange(this.$props.componentId, {
|
|
231
207
|
start: normalizedValue[0],
|
|
232
208
|
end: normalizedValue[1]
|
|
@@ -234,30 +210,25 @@ var DynamicRangeSlider = {
|
|
|
234
210
|
},
|
|
235
211
|
updateQueryHandler: function updateQueryHandler(value) {
|
|
236
212
|
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
237
|
-
|
|
238
213
|
if (this.$props.customQuery) {
|
|
239
214
|
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
240
215
|
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
241
|
-
|
|
242
216
|
if (queryTobeSet) {
|
|
243
217
|
query = queryTobeSet;
|
|
244
218
|
}
|
|
245
|
-
|
|
246
219
|
var customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
247
220
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
248
221
|
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
249
222
|
}
|
|
250
|
-
|
|
251
223
|
var _ref2 = this.range || {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
224
|
+
start: value[0],
|
|
225
|
+
end: value[1]
|
|
226
|
+
},
|
|
227
|
+
start = _ref2.start,
|
|
228
|
+
end = _ref2.end;
|
|
258
229
|
var currentStart = value[0],
|
|
259
|
-
|
|
260
|
-
|
|
230
|
+
currentEnd = value[1];
|
|
231
|
+
// check if the slider is at its initial position
|
|
261
232
|
var isInitialValue = currentStart === start && currentEnd === end;
|
|
262
233
|
this.updateQuery({
|
|
263
234
|
componentId: this.$props.componentId,
|
|
@@ -281,11 +252,9 @@ var DynamicRangeSlider = {
|
|
|
281
252
|
deep: true,
|
|
282
253
|
handler: function handler(newVal) {
|
|
283
254
|
var _this3 = this;
|
|
284
|
-
|
|
285
255
|
var propsKeys = getValidPropsKeys(newVal);
|
|
286
256
|
checkSomePropChange(newVal, this.componentProps, propsKeys, function () {
|
|
287
257
|
_this3.updateComponentProps(_this3.componentId, newVal, componentTypes.dynamicRangeSlider);
|
|
288
|
-
|
|
289
258
|
_this3.updateComponentProps(_this3.internalRangeComponent, newVal, componentTypes.dynamicRangeSlider);
|
|
290
259
|
});
|
|
291
260
|
}
|
|
@@ -304,15 +273,12 @@ var DynamicRangeSlider = {
|
|
|
304
273
|
},
|
|
305
274
|
range: function range(newValue, oldValue) {
|
|
306
275
|
if (isEqual(newValue, oldValue) || !this.currentValue) return;
|
|
307
|
-
|
|
308
276
|
var _ref3 = this.currentValue || [],
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
277
|
+
currentStart = _ref3[0],
|
|
278
|
+
currentEnd = _ref3[1];
|
|
312
279
|
var _ref4 = oldValue || {},
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
280
|
+
oldStart = _ref4.start,
|
|
281
|
+
oldEnd = _ref4.end;
|
|
316
282
|
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
317
283
|
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
318
284
|
this.handleChange([newStart, newEnd]);
|
|
@@ -329,93 +295,78 @@ var DynamicRangeSlider = {
|
|
|
329
295
|
}
|
|
330
296
|
},
|
|
331
297
|
render: function render() {
|
|
332
|
-
var
|
|
333
|
-
|
|
298
|
+
var _this4 = this;
|
|
334
299
|
if (!this.range || !this.currentValue) {
|
|
335
300
|
return null;
|
|
336
301
|
}
|
|
337
|
-
|
|
338
302
|
var _this$range = this.range,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return
|
|
303
|
+
start = _this$range.start,
|
|
304
|
+
end = _this$range.end;
|
|
305
|
+
return createVNode(Container, {
|
|
342
306
|
"class": this.$props.className
|
|
343
|
-
},
|
|
344
|
-
"
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
query = {
|
|
379
|
-
range: (_range = {}, _range[props.dataField] = {
|
|
380
|
-
gte: values[0],
|
|
381
|
-
lte: values[1],
|
|
382
|
-
boost: 2.0
|
|
383
|
-
}, _range)
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
if (query && props.nestedField) {
|
|
388
|
-
return {
|
|
389
|
-
query: {
|
|
390
|
-
nested: {
|
|
391
|
-
path: props.nestedField,
|
|
392
|
-
query: query
|
|
393
|
-
}
|
|
307
|
+
}, {
|
|
308
|
+
"default": function _default() {
|
|
309
|
+
return [_this4.$props.title && createVNode(Title, {
|
|
310
|
+
"class": getClassName(_this4.$props.innerClass, 'title')
|
|
311
|
+
}, {
|
|
312
|
+
"default": function _default() {
|
|
313
|
+
return [_this4.$props.title];
|
|
314
|
+
}
|
|
315
|
+
}), createVNode(NoSSR, null, {
|
|
316
|
+
"default": function _default() {
|
|
317
|
+
return [createVNode(Slider, {
|
|
318
|
+
"class": getClassName(_this4.$props.innerClass, 'slider')
|
|
319
|
+
}, {
|
|
320
|
+
"default": function _default() {
|
|
321
|
+
return [createVNode(resolveComponent("vue-slider-component"), mergeProps({
|
|
322
|
+
"ref": "slider",
|
|
323
|
+
"modelValue": [Math.floor(Math.max(start, _this4.currentValue[0])), Math.ceil(Math.min(end, _this4.currentValue[1]))],
|
|
324
|
+
"min": Math.floor(Math.min(start, _this4.currentValue[0])),
|
|
325
|
+
"max": Math.ceil(Math.max(end, _this4.currentValue[1])),
|
|
326
|
+
"onDrag-end": _this4.handleSlider,
|
|
327
|
+
"dotSize": 20,
|
|
328
|
+
"height": 4,
|
|
329
|
+
"enable-cross": false,
|
|
330
|
+
"tooltip": "always"
|
|
331
|
+
}, _this4.$props.sliderOptions), null), _this4.labels ? createVNode("div", {
|
|
332
|
+
"class": "label-container"
|
|
333
|
+
}, [createVNode("label", {
|
|
334
|
+
"class": getClassName(_this4.$props.innerClass, 'label') || 'range-label-left'
|
|
335
|
+
}, [_this4.labels.start]), createVNode("label", {
|
|
336
|
+
"class": getClassName(_this4.$props.innerClass, 'label') || 'range-label-right'
|
|
337
|
+
}, [_this4.labels.end])]) : null];
|
|
338
|
+
}
|
|
339
|
+
})];
|
|
340
|
+
}
|
|
341
|
+
})];
|
|
394
342
|
}
|
|
395
|
-
};
|
|
343
|
+
});
|
|
396
344
|
}
|
|
397
|
-
|
|
398
|
-
return query;
|
|
399
345
|
};
|
|
400
|
-
|
|
346
|
+
DynamicRangeSlider.defaultQuery = function (value, props) {
|
|
347
|
+
return {
|
|
348
|
+
query: {
|
|
349
|
+
queryFormat: props.queryFormat,
|
|
350
|
+
dataField: props.dataField,
|
|
351
|
+
value: value,
|
|
352
|
+
showMissing: props.showMissing
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
};
|
|
401
356
|
DynamicRangeSlider.parseValue = function (value) {
|
|
402
357
|
if (value) {
|
|
403
358
|
return Array.isArray(value) ? value : [value.start, value.end];
|
|
404
359
|
}
|
|
405
|
-
|
|
406
360
|
return [];
|
|
407
361
|
};
|
|
408
|
-
|
|
409
362
|
DynamicRangeSlider.hasInternalComponent = function () {
|
|
410
363
|
return true;
|
|
411
364
|
};
|
|
412
|
-
|
|
413
365
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
414
366
|
var componentId = state.aggregations[props.componentId];
|
|
415
367
|
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
416
368
|
var options = componentId && componentId[props.dataField];
|
|
417
369
|
var range = state.aggregations[props.componentId + "__range__internal"];
|
|
418
|
-
|
|
419
370
|
if (props.nestedField) {
|
|
420
371
|
options = options && componentId[props.dataField][props.nestedField] && componentId[props.dataField][props.nestedField].buckets ? componentId[props.dataField][props.nestedField].buckets : [];
|
|
421
372
|
range = range && internalRange[props.nestedField].min ? {
|
|
@@ -429,16 +380,13 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
429
380
|
end: internalRange.max.value
|
|
430
381
|
} : null;
|
|
431
382
|
}
|
|
432
|
-
|
|
433
383
|
return {
|
|
434
384
|
options: options,
|
|
435
385
|
range: range,
|
|
436
386
|
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
437
|
-
componentProps: state.props[props.componentId]
|
|
438
|
-
enableAppbase: state.config.enableAppbase
|
|
387
|
+
componentProps: state.props[props.componentId]
|
|
439
388
|
};
|
|
440
389
|
};
|
|
441
|
-
|
|
442
390
|
var mapDispatchtoProps = {
|
|
443
391
|
addComponent: addComponent,
|
|
444
392
|
removeComponent: removeComponent,
|
|
@@ -450,13 +398,14 @@ var mapDispatchtoProps = {
|
|
|
450
398
|
setCustomQuery: setCustomQuery,
|
|
451
399
|
updateComponentProps: updateComponentProps
|
|
452
400
|
};
|
|
453
|
-
var RangeConnected = connect(mapStateToProps, mapDispatchtoProps)(DynamicRangeSlider);
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
Vue.component(
|
|
457
|
-
};
|
|
458
|
-
|
|
401
|
+
var RangeConnected = PreferencesConsumer(connect(mapStateToProps, mapDispatchtoProps)(DynamicRangeSlider));
|
|
402
|
+
RangeConnected.name = DynamicRangeSlider.name;
|
|
403
|
+
RangeConnected.install = function (Vue) {
|
|
404
|
+
Vue.component(RangeConnected.name, RangeConnected);
|
|
405
|
+
};
|
|
459
406
|
|
|
460
|
-
|
|
407
|
+
// Add componentType for SSR
|
|
408
|
+
RangeConnected.componentType = componentTypes.dynamicRangeSlider;
|
|
461
409
|
|
|
462
|
-
export default
|
|
410
|
+
export default RangeConnected;
|
|
411
|
+
export { RangeConnected };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
|
+
import { styled } from '@appbaseio/vue-emotion';
|
|
3
|
+
import { lighten } from 'polished';
|
|
4
|
+
|
|
5
|
+
var _templateObject;
|
|
6
|
+
var leftLabel = "\n\tflex-direction: row;\n\talign-items: center;\n";
|
|
7
|
+
var rightLabel = "\n\tflex-direction: row-reverse;\n\talign-items: center;\n";
|
|
8
|
+
var topLabel = "\n\tflex-direction: column;\n";
|
|
9
|
+
var bottomLabel = "\n\tflex-direction: column-reverse;\n";
|
|
10
|
+
var border = function border(_ref) {
|
|
11
|
+
var _ref$theme$colors = _ref.theme.colors,
|
|
12
|
+
colors = _ref$theme$colors === void 0 ? {} : _ref$theme$colors;
|
|
13
|
+
return "\n\tborder: 1px solid " + (colors.borderColor || '#ccc') + ";\n";
|
|
14
|
+
};
|
|
15
|
+
var Flex = styled('div')(_templateObject || (_templateObject = _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) {
|
|
16
|
+
return props.inline ? 'inline-flex' : 'flex';
|
|
17
|
+
}, function (props) {
|
|
18
|
+
return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return (props.labelPosition === 'right' || props.iconPosition === 'left') && rightLabel;
|
|
21
|
+
}, function (props) {
|
|
22
|
+
return props.labelPosition === 'top' && topLabel;
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return props.labelPosition === 'bottom' && bottomLabel;
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.showBorder && border;
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return props.justifyContent && "\n\t\t\tjustify-content: " + props.justifyContent + ";\n\t\t";
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.alignItems && "\n\t\t\talign-items: " + props.alignItems + ";\n\t\t";
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.flex && "\n\t\t\tflex: " + props.flex + ";\n\t\t";
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return props.direction && "\n\t\t\tflex-direction: " + props.direction + ";\n\t\t";
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.basis && "\n\t\t\tflex-basis: " + props.basis + ";\n\t\t";
|
|
37
|
+
}, function (_ref2) {
|
|
38
|
+
var _ref2$theme$colors = _ref2.theme.colors,
|
|
39
|
+
colors = _ref2$theme$colors === void 0 ? {} : _ref2$theme$colors;
|
|
40
|
+
return colors.borderColor || lighten(0.3, colors.textColor || '#fff');
|
|
41
|
+
}, function (_ref3) {
|
|
42
|
+
var theme = _ref3.theme;
|
|
43
|
+
return theme.colors ? theme.colors.textColor : '';
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { Flex as F };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
|
+
import { styled } from '@appbaseio/vue-emotion';
|
|
3
|
+
import { lighten } from 'polished';
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
6
|
+
var item = {
|
|
7
|
+
width: '15px',
|
|
8
|
+
height: '15px',
|
|
9
|
+
scale: '4px'
|
|
10
|
+
};
|
|
11
|
+
var vh = "\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";
|
|
12
|
+
var hideInputControl = "\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";
|
|
13
|
+
var formItem = function formItem(_ref) {
|
|
14
|
+
var _ref$theme = _ref.theme,
|
|
15
|
+
theme = _ref$theme === void 0 ? {} : _ref$theme;
|
|
16
|
+
return "\n\t" + vh + ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px " + lighten(0.4, theme.colors.primaryColor) + ";\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: " + theme.colors.primaryColor + ";\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 " + (theme.colors.borderColor || lighten(0.1, theme.colors.textColor)) + ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: " + theme.colors.primaryColor + ";\n\t\t\tmargin-right: calc(" + item.width + " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: " + item.width + ";\n\t\t\theight: " + item.height + ";\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: " + theme.colors.primaryColor + ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + " + item.scale + " / 2);\n\t\t\twidth: calc(" + item.width + " - " + item.scale + ");\n\t\t\theight: calc(" + item.height + " - " + item.scale + ");\n\t\t\tmargin-top: calc(" + item.height + " / -2 - " + item.scale + " / -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";
|
|
17
|
+
};
|
|
18
|
+
var Radio = styled('input')(_templateObject || (_templateObject = _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) {
|
|
19
|
+
return props.show ? null : hideInputControl;
|
|
20
|
+
}, function (_ref2) {
|
|
21
|
+
var theme = _ref2.theme;
|
|
22
|
+
return theme.colors.primaryColor;
|
|
23
|
+
}, function (_ref3) {
|
|
24
|
+
var theme = _ref3.theme;
|
|
25
|
+
return theme.colors.primaryColor;
|
|
26
|
+
});
|
|
27
|
+
var Checkbox = styled('input')(_templateObject2 || (_templateObject2 = _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) {
|
|
28
|
+
return props.show ? null : hideInputControl;
|
|
29
|
+
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
30
|
+
var theme = _ref4.theme;
|
|
31
|
+
return theme.colors.primaryColor;
|
|
32
|
+
}, function (_ref5) {
|
|
33
|
+
var theme = _ref5.theme;
|
|
34
|
+
return theme.colors.primaryColor;
|
|
35
|
+
});
|
|
36
|
+
var UL = styled('ul')(_templateObject3 || (_templateObject3 = _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"])));
|
|
37
|
+
|
|
38
|
+
export { Checkbox as C, Radio as R, UL as U };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
|
+
import { styled } from '@appbaseio/vue-emotion';
|
|
3
|
+
import { css } from 'emotion';
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
6
|
+
var alertBorder = function alertBorder(_ref) {
|
|
7
|
+
var theme = _ref.theme;
|
|
8
|
+
return "\n\tborder: 1px solid " + theme.colors.alertColor + ";\n";
|
|
9
|
+
};
|
|
10
|
+
var input = "\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";
|
|
11
|
+
var dark = function dark(theme) {
|
|
12
|
+
return "\n\tborder-color: " + theme.colors.borderColor + ";\n";
|
|
13
|
+
};
|
|
14
|
+
var darkInput = function darkInput(_ref2) {
|
|
15
|
+
var theme = _ref2.theme;
|
|
16
|
+
return "\n\tbackground-color: " + theme.colors.backgroundColor + ";\n\tcolor: " + theme.colors.textColor + ";\n\t" + dark(theme) + ";\n\n\t&:focus {\n\t\tbackground-color: " + theme.colors.backgroundColor + ";\n\t}\n";
|
|
17
|
+
};
|
|
18
|
+
var Input = styled('input')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: #fff;\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) {
|
|
19
|
+
var themePreset = _ref3.themePreset,
|
|
20
|
+
theme = _ref3.theme;
|
|
21
|
+
return themePreset === 'dark' && darkInput({
|
|
22
|
+
theme: theme
|
|
23
|
+
});
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.showIcon && props.iconPosition === 'left' && "\n\t\t\tpadding-left: 36px;\n\t\t";
|
|
26
|
+
}, function (props) {
|
|
27
|
+
return props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 36px;\n\t\t";
|
|
28
|
+
}, function (props) {
|
|
29
|
+
return (
|
|
30
|
+
// for clear icon
|
|
31
|
+
props.showClear && "\n\t\t\tpadding-right: 36px;\n\t\t"
|
|
32
|
+
);
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return (
|
|
35
|
+
// for voice search icon
|
|
36
|
+
props.showVoiceSearch && "\n\t\t\tpadding-right: 36px;\n\t\t"
|
|
37
|
+
);
|
|
38
|
+
}, function (props) {
|
|
39
|
+
return (
|
|
40
|
+
// for clear icon with search icon
|
|
41
|
+
props.showClear && props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
42
|
+
);
|
|
43
|
+
}, function (props) {
|
|
44
|
+
return (
|
|
45
|
+
// for voice search icon with search icon
|
|
46
|
+
props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
47
|
+
);
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return (
|
|
50
|
+
// for voice search icon with clear icon
|
|
51
|
+
props.showVoiceSearch && props.showIcon && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
52
|
+
);
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return (
|
|
55
|
+
// for clear icon with search icon and voice search
|
|
56
|
+
props.showClear && props.showIcon && props.showVoiceSearch && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 90px;\n\t\t"
|
|
57
|
+
);
|
|
58
|
+
}, function (props) {
|
|
59
|
+
return props.alert && alertBorder;
|
|
60
|
+
});
|
|
61
|
+
var suggestions = function suggestions(themePreset, theme) {
|
|
62
|
+
return css(_templateObject2 || (_templateObject2 = _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: min(100vh, 402px);\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: flex;\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
|
+
var suggestionsContainer = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
65
|
+
var noSuggestions = function noSuggestions(themePreset, theme) {
|
|
66
|
+
return css(_templateObject4 || (_templateObject4 = _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));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { Input as I, suggestions as a, noSuggestions as n, suggestionsContainer as s };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
2
|
+
import { styled } from '@appbaseio/vue-emotion';
|
|
2
3
|
import { css } from 'emotion';
|
|
3
|
-
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { lighten } from 'polished';
|
|
5
|
-
import './Title-
|
|
5
|
+
import './Title-863dfa42.js';
|
|
6
6
|
|
|
7
|
-
var _templateObject, _templateObject2, _templateObject3
|
|
7
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
8
8
|
var container = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tborder-radius: 0.25rem;\n\toverflow: hidden;\n"])));
|
|
9
|
-
var smallImage =
|
|
10
|
-
var Image = styled('div')(
|
|
9
|
+
var smallImage = "\n\twidth: 100px;\n\theight: 100px;\n";
|
|
10
|
+
var Image = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\twidth: 160px;\n\theight: 160px;\n\t", ";\n\tmargin: 0;\n\tbackground-size: contain;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\tbackground-image: ", ";\n"])), function (props) {
|
|
11
11
|
return props.small ? smallImage : null;
|
|
12
12
|
}, function (props) {
|
|
13
13
|
return "url(" + props.src + ")";
|
|
14
14
|
});
|
|
15
|
-
var ListItem = styled('a')(
|
|
15
|
+
var ListItem = styled('a')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n"])), function (_ref) {
|
|
16
16
|
var theme = _ref.theme;
|
|
17
17
|
return theme.colors.backgroundColor ? lighten(0.1, theme.colors.backgroundColor) : '#fff';
|
|
18
18
|
}, function (_ref2) {
|
|
@@ -30,7 +30,6 @@ var ListItem = styled('a')(_templateObject4 || (_templateObject4 = _taggedTempla
|
|
|
30
30
|
if (props.image) {
|
|
31
31
|
return props.small ? 'calc(100% - 100px)' : 'calc(100% - 160px)';
|
|
32
32
|
}
|
|
33
|
-
|
|
34
33
|
return '100%';
|
|
35
34
|
}, function (props) {
|
|
36
35
|
return props.image ? '10px' : 0;
|