@appbaseio/reactivesearch-vue 1.34.0-alpha.2 → 1.34.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/dist/@appbaseio/reactivesearch-vue.umd.js +11024 -8760
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +12 -11
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/Button-841fd06d.js +62 -0
- package/dist/cjs/{CancelSvg-062a42f0.js → CancelSvg-220a7cc3.js} +40 -32
- package/dist/cjs/Card-240f283d.js +30 -0
- package/dist/cjs/{ComponentWrapper-db45cc6d.js → ComponentWrapper-94c50228.js} +7 -7
- package/dist/cjs/Container-e699ea95.js +15 -0
- package/dist/cjs/DataSearch.js +1312 -20
- package/dist/cjs/{DropDown-3b899b20.js → DropDown-7a52c661.js} +79 -78
- package/dist/cjs/DynamicRangeSlider.js +46 -56
- package/dist/cjs/Flex-ddd7cb6b.js +50 -0
- package/dist/cjs/FormControlList-bbb5cd24.js +45 -0
- package/dist/cjs/Input-ead4cd84.js +77 -0
- package/dist/cjs/ListItem-5088bd6a.js +45 -0
- package/dist/cjs/MultiDropdownList.js +68 -74
- package/dist/cjs/MultiList.js +94 -89
- package/dist/cjs/MultiRange.js +44 -54
- package/dist/cjs/{Pagination-a468f960.js → Pagination-e56a5b79.js} +53 -56
- package/dist/cjs/{PreferencesConsumer-034c55e3.js → PreferencesConsumer-5e6e84a2.js} +5 -6
- package/dist/cjs/RangeInput.js +107 -115
- package/dist/cjs/RangeSlider.js +39 -50
- package/dist/cjs/ReactiveBase.js +55 -69
- package/dist/cjs/ReactiveComponent.js +316 -46
- package/dist/cjs/{ReactiveComponent-f0f486ca.js → ReactiveComponentPrivate-244c6055.js} +321 -618
- package/dist/cjs/ReactiveComponentPrivate.js +55 -0
- package/dist/cjs/ReactiveGoogleMap.js +439 -384
- package/dist/cjs/ReactiveList.js +128 -100
- package/dist/cjs/ResultCard.js +19 -26
- package/dist/cjs/ResultList.js +27 -31
- package/dist/cjs/SelectedFilters.js +34 -49
- package/dist/cjs/SingleDropdownList.js +66 -73
- package/dist/cjs/SingleList.js +96 -90
- package/dist/cjs/SingleRange.js +42 -48
- package/dist/cjs/StateProvider.js +2 -2
- package/dist/cjs/Tags-4ec43831.js +883 -0
- package/dist/cjs/Title-16042ea0.js +15 -0
- package/dist/cjs/ToggleButton.js +34 -39
- package/dist/cjs/{index-dc25b706.js → index-de136c17.js} +8 -6
- package/dist/cjs/index.js +27 -25
- package/dist/cjs/initReactivesearch.js +0 -3
- package/dist/cjs/install.js +23 -22
- package/dist/cjs/ssr-f2fc1bf6.js +36 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-621a8143.js → vueTypes-b7007f5f.js} +3 -2
- package/dist/es/Button-153cd885.js +53 -0
- package/dist/es/{CancelSvg-14ebc9a1.js → CancelSvg-e40552a5.js} +37 -30
- package/dist/es/{Card-1951569e.js → Card-19ad6d90.js} +6 -5
- package/dist/es/{ComponentWrapper-bf443c0b.js → ComponentWrapper-edaeaceb.js} +6 -6
- package/dist/es/Container-d00219f7.js +1 -1
- package/dist/es/DataSearch.js +1312 -18
- package/dist/es/{DropDown-35e232b7.js → DropDown-2c0dd714.js} +78 -78
- package/dist/es/DynamicRangeSlider.js +43 -53
- package/dist/es/Flex-7c177a10.js +45 -0
- package/dist/es/FormControlList-99797d0a.js +38 -0
- package/dist/es/Input-c09c0b56.js +69 -0
- package/dist/es/{ListItem-47a6345a.js → ListItem-07888a65.js} +7 -6
- package/dist/es/MultiDropdownList.js +66 -72
- package/dist/es/MultiList.js +93 -88
- package/dist/es/MultiRange.js +42 -52
- package/dist/es/{Pagination-145b4ff2.js → Pagination-edeb7dbe.js} +53 -56
- package/dist/es/{PreferencesConsumer-7ea7313a.js → PreferencesConsumer-86a676c8.js} +4 -5
- package/dist/es/RangeInput.js +103 -112
- package/dist/es/RangeSlider.js +36 -47
- package/dist/es/ReactiveBase.js +53 -68
- package/dist/es/ReactiveComponent.js +316 -45
- package/dist/es/{ReactiveComponent-e2fb9eb4.js → ReactiveComponentPrivate-6f16e1b7.js} +316 -614
- package/dist/es/ReactiveComponentPrivate.js +47 -0
- package/dist/es/ReactiveGoogleMap.js +434 -380
- package/dist/es/ReactiveList.js +125 -98
- package/dist/es/ResultCard.js +18 -25
- package/dist/es/ResultList.js +26 -30
- package/dist/es/SelectedFilters.js +32 -47
- package/dist/es/SingleDropdownList.js +64 -71
- package/dist/es/SingleList.js +94 -88
- package/dist/es/SingleRange.js +40 -46
- package/dist/es/StateProvider.js +2 -2
- package/dist/es/Tags-1c2d6c4d.js +869 -0
- package/dist/es/Title-863dfa42.js +1 -1
- package/dist/es/ToggleButton.js +32 -37
- package/dist/es/{index-285a43a6.js → index-5509c0bc.js} +8 -6
- package/dist/es/index.js +20 -19
- package/dist/es/initReactivesearch.js +0 -3
- package/dist/es/install.js +20 -19
- package/dist/es/ssr-03607d84.js +1 -1
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-e4af6fe2.js → vueTypes-66ebc93e.js} +3 -2
- package/package.json +87 -87
- package/dist/cjs/Button-626c5e8e.js +0 -58
- package/dist/cjs/Card-c381ded3.js +0 -26
- package/dist/cjs/Container-29f049b2.js +0 -12
- package/dist/cjs/DataSearch-7c71ec9f.js +0 -2043
- package/dist/cjs/Flex-d5675ea6.js +0 -48
- package/dist/cjs/FormControlList-cf1ff2ca.js +0 -42
- package/dist/cjs/Input-4d278ca0.js +0 -74
- package/dist/cjs/ListItem-c067bc07.js +0 -41
- package/dist/cjs/Title-8802a218.js +0 -12
- package/dist/cjs/ssr-eb901d09.js +0 -35
- package/dist/es/Button-ebafa3d6.js +0 -52
- package/dist/es/DataSearch-4f9a4e46.js +0 -2028
- package/dist/es/Flex-a08e22d7.js +0 -46
- package/dist/es/FormControlList-fa5cf78b.js +0 -38
- package/dist/es/Input-3b8408a6.js +0 -69
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
-
import { createVNode, mergeProps, createTextVNode } from 'vue';
|
|
3
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
5
4
|
import VueTypes from 'vue-types';
|
|
6
|
-
import '@appbaseio/vue-emotion';
|
|
7
5
|
import 'emotion';
|
|
6
|
+
import '@appbaseio/vue-emotion';
|
|
8
7
|
import 'polished';
|
|
9
|
-
import { f as filters, B as Button } from './Button-
|
|
10
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { f as filters, B as Button } from './Button-153cd885.js';
|
|
9
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
11
10
|
import 'redux';
|
|
12
|
-
import { n as decodeHtml, c as connect } from './index-
|
|
11
|
+
import { n as decodeHtml, c as connect } from './index-5509c0bc.js';
|
|
13
12
|
import { T as Title } from './Title-863dfa42.js';
|
|
14
13
|
import { C as Container } from './Container-d00219f7.js';
|
|
15
14
|
|
|
@@ -37,8 +36,9 @@ var SelectedFilters = {
|
|
|
37
36
|
},
|
|
38
37
|
render: function render() {
|
|
39
38
|
var _this = this;
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
var h = arguments[0];
|
|
40
|
+
if (this.$scopedSlots["default"]) {
|
|
41
|
+
return this.$scopedSlots["default"]({
|
|
42
42
|
components: this.components,
|
|
43
43
|
selectedValues: this.selectedValues,
|
|
44
44
|
clearValues: this.clearValues,
|
|
@@ -49,36 +49,24 @@ var SelectedFilters = {
|
|
|
49
49
|
}
|
|
50
50
|
var filtersToRender = this.renderFilters();
|
|
51
51
|
var hasValues = !!filtersToRender.length;
|
|
52
|
-
return
|
|
52
|
+
return h(Container, {
|
|
53
53
|
"class": filters(this.theme) + " " + (this.$props.className || '')
|
|
54
|
-
}, {
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return handleA11yAction(event, function () {
|
|
69
|
-
return _this.clearValues();
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
"tabIndex": "0"
|
|
75
|
-
}), {
|
|
76
|
-
"default": function _default() {
|
|
77
|
-
return [_this.$props.clearAllLabel];
|
|
78
|
-
}
|
|
79
|
-
}) : null];
|
|
54
|
+
}, [this.$props.title && hasValues && h(Title, {
|
|
55
|
+
"class": getClassName(this.$props.innerClass, 'title') || ''
|
|
56
|
+
}, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? h(Button, {
|
|
57
|
+
"class": getClassName(this.$props.innerClass, 'button') || '',
|
|
58
|
+
"on": _extends({}, {
|
|
59
|
+
click: this.clearValues,
|
|
60
|
+
keypress: function keypress(event) {
|
|
61
|
+
return handleA11yAction(event, function () {
|
|
62
|
+
return _this.clearValues();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
"attrs": {
|
|
67
|
+
"tabIndex": "0"
|
|
80
68
|
}
|
|
81
|
-
});
|
|
69
|
+
}, [this.$props.clearAllLabel]) : null]);
|
|
82
70
|
},
|
|
83
71
|
methods: {
|
|
84
72
|
remove: function remove(component, value) {
|
|
@@ -130,23 +118,20 @@ var SelectedFilters = {
|
|
|
130
118
|
return value;
|
|
131
119
|
},
|
|
132
120
|
renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
|
|
133
|
-
|
|
121
|
+
var h = this.$createElement;
|
|
122
|
+
return h(Button, {
|
|
134
123
|
"class": getClassName(this.$props.innerClass, 'button') || '',
|
|
135
|
-
"key": keyProp
|
|
136
|
-
|
|
137
|
-
on: {
|
|
124
|
+
"key": keyProp,
|
|
125
|
+
"on": _extends({}, {
|
|
138
126
|
click: handleRemove,
|
|
139
127
|
keypress: function keypress(event) {
|
|
140
128
|
return handleA11yAction(event, handleRemove);
|
|
141
129
|
}
|
|
130
|
+
}),
|
|
131
|
+
"attrs": {
|
|
132
|
+
"tabIndex": "0"
|
|
142
133
|
}
|
|
143
|
-
},
|
|
144
|
-
"tabIndex": "0"
|
|
145
|
-
}), {
|
|
146
|
-
"default": function _default() {
|
|
147
|
-
return [createVNode("span", null, [label]), createVNode("span", null, [createTextVNode("\u2715")])];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
134
|
+
}, [h("span", [label]), h("span", ["\u2715"])]);
|
|
150
135
|
},
|
|
151
136
|
renderFilters: function renderFilters() {
|
|
152
137
|
var _this3 = this;
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
3
|
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
-
import { createVNode, isVNode } from 'vue';
|
|
5
4
|
import VueTypes from 'vue-types';
|
|
6
|
-
import '@appbaseio/vue-emotion';
|
|
7
5
|
import 'emotion';
|
|
6
|
+
import '@appbaseio/vue-emotion';
|
|
8
7
|
import 'polished';
|
|
9
|
-
import { l as loadMoreContainer, B as Button } from './Button-
|
|
10
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { l as loadMoreContainer, B as Button } from './Button-153cd885.js';
|
|
9
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
11
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
12
11
|
import 'redux';
|
|
13
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
14
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
15
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5509c0bc.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
14
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
15
|
+
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
16
16
|
import { T as Title } from './Title-863dfa42.js';
|
|
17
|
-
import './CancelSvg-
|
|
18
|
-
import './Input-
|
|
17
|
+
import './CancelSvg-e40552a5.js';
|
|
18
|
+
import './Input-c09c0b56.js';
|
|
19
19
|
import 'compute-scroll-into-view';
|
|
20
20
|
import { C as Container } from './Container-d00219f7.js';
|
|
21
21
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
22
22
|
import { g as getAggsQuery } from './utils-9e5a16a1.js';
|
|
23
|
-
import { D as Dropdown } from './DropDown-
|
|
23
|
+
import { D as Dropdown } from './DropDown-2c0dd714.js';
|
|
24
24
|
|
|
25
|
-
function _isSlot(s) {
|
|
26
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
27
|
-
}
|
|
28
25
|
var updateQuery = Actions.updateQuery,
|
|
29
26
|
setQueryOptions = Actions.setQueryOptions,
|
|
30
27
|
setCustomQuery = Actions.setCustomQuery,
|
|
@@ -82,7 +79,7 @@ var SingleDropdownList = {
|
|
|
82
79
|
showSearch: VueTypes.bool.def(false),
|
|
83
80
|
showClear: VueTypes.bool.def(false),
|
|
84
81
|
showLoadMore: VueTypes.bool.def(false),
|
|
85
|
-
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.
|
|
82
|
+
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
86
83
|
nestedField: types.string,
|
|
87
84
|
index: VueTypes.string,
|
|
88
85
|
searchPlaceholder: VueTypes.string.def('Type here to search...'),
|
|
@@ -174,7 +171,7 @@ var SingleDropdownList = {
|
|
|
174
171
|
}
|
|
175
172
|
},
|
|
176
173
|
render: function render() {
|
|
177
|
-
var
|
|
174
|
+
var h = arguments[0];
|
|
178
175
|
var _this$$props2 = this.$props,
|
|
179
176
|
showLoadMore = _this$$props2.showLoadMore,
|
|
180
177
|
loadMoreLabel = _this$$props2.loadMoreLabel,
|
|
@@ -183,16 +180,16 @@ var SingleDropdownList = {
|
|
|
183
180
|
renderLabel = _this$$props2.renderLabel;
|
|
184
181
|
var isLastBucket = this.$data.isLastBucket;
|
|
185
182
|
var selectAll = [];
|
|
186
|
-
var renderItemCalc = this.$
|
|
187
|
-
var renderErrorCalc = this.$
|
|
188
|
-
var renderLabelCalc = this.$
|
|
189
|
-
var renderNoResults = this.$
|
|
183
|
+
var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
|
|
184
|
+
var renderErrorCalc = this.$scopedSlots.renderError || renderError;
|
|
185
|
+
var renderLabelCalc = this.$scopedSlots.renderLabel || renderLabel;
|
|
186
|
+
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
190
187
|
if (renderErrorCalc && this.error) {
|
|
191
188
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
192
189
|
}
|
|
193
190
|
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
194
191
|
if (renderNoResults && isFunction(renderNoResults)) {
|
|
195
|
-
return
|
|
192
|
+
return h("div", [renderNoResults()]);
|
|
196
193
|
}
|
|
197
194
|
if (renderNoResults && !isFunction(renderNoResults)) {
|
|
198
195
|
return renderNoResults;
|
|
@@ -205,64 +202,58 @@ var SingleDropdownList = {
|
|
|
205
202
|
doc_count: this.totalDocumentCount
|
|
206
203
|
}];
|
|
207
204
|
}
|
|
208
|
-
return
|
|
205
|
+
return h(Container, {
|
|
209
206
|
"class": this.$props.className
|
|
210
|
-
}, {
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
"
|
|
238
|
-
"showClear": _this2.$props.showClear,
|
|
239
|
-
"searchPlaceholder": _this2.$props.searchPlaceholder,
|
|
240
|
-
"transformData": _this2.$props.transformData,
|
|
241
|
-
"footer": showLoadMore && !isLastBucket && createVNode("div", {
|
|
207
|
+
}, [this.$props.title && h(Title, {
|
|
208
|
+
"class": getClassName(this.$props.innerClass, 'title') || ''
|
|
209
|
+
}, [this.$props.title]), h(Dropdown, {
|
|
210
|
+
"attrs": {
|
|
211
|
+
"innerClass": this.$props.innerClass,
|
|
212
|
+
"items": [].concat(selectAll, this.$data.modifiedOptions.filter(function (item) {
|
|
213
|
+
return String(item.key).trim().length;
|
|
214
|
+
}).map(function (item) {
|
|
215
|
+
return _extends({}, item, {
|
|
216
|
+
key: String(item.key)
|
|
217
|
+
});
|
|
218
|
+
})),
|
|
219
|
+
"handleChange": this.handleChange,
|
|
220
|
+
"selectedItem": this.$data.currentValue,
|
|
221
|
+
"placeholder": this.$props.placeholder,
|
|
222
|
+
"labelField": "key",
|
|
223
|
+
"showCount": this.$props.showCount,
|
|
224
|
+
"hasCustomRenderer": this.hasCustomRenderer,
|
|
225
|
+
"customRenderer": this.getComponent,
|
|
226
|
+
"renderItem": renderItemCalc,
|
|
227
|
+
"renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
|
|
228
|
+
"themePreset": this.themePreset,
|
|
229
|
+
"showSearch": this.$props.showSearch,
|
|
230
|
+
"showClear": this.$props.showClear,
|
|
231
|
+
"searchPlaceholder": this.$props.searchPlaceholder,
|
|
232
|
+
"transformData": this.$props.transformData,
|
|
233
|
+
"footer": showLoadMore && !isLastBucket && h("div", {
|
|
234
|
+
"attrs": {
|
|
242
235
|
"css": loadMoreContainer
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
"customLabelRenderer": renderLabelCalc
|
|
251
|
-
}, null)];
|
|
236
|
+
}
|
|
237
|
+
}, [h(Button, {
|
|
238
|
+
"on": {
|
|
239
|
+
"click": this.handleLoadMore
|
|
240
|
+
}
|
|
241
|
+
}, [loadMoreLabel])]),
|
|
242
|
+
"customLabelRenderer": renderLabelCalc
|
|
252
243
|
}
|
|
253
|
-
});
|
|
244
|
+
})]);
|
|
254
245
|
},
|
|
255
246
|
methods: {
|
|
256
247
|
setValue: function setValue(value, props) {
|
|
257
|
-
var
|
|
248
|
+
var _this2 = this;
|
|
258
249
|
if (props === void 0) {
|
|
259
250
|
props = this.$props;
|
|
260
251
|
}
|
|
261
252
|
var performUpdate = function performUpdate() {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
253
|
+
_this2.currentValue = value;
|
|
254
|
+
_this2.updateQueryHandler(value, props);
|
|
255
|
+
_this2.$emit('valueChange', value);
|
|
256
|
+
_this2.$emit('value-change', value);
|
|
266
257
|
};
|
|
267
258
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
268
259
|
},
|
|
@@ -442,13 +433,15 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
|
|
|
442
433
|
componentType: componentTypes.singleDropdownList,
|
|
443
434
|
internalComponent: SingleDropdownList.hasInternalComponent()
|
|
444
435
|
}));
|
|
436
|
+
ListConnected.defaultQuery = SingleDropdownList.defaultQuery;
|
|
437
|
+
ListConnected.generateQueryOptions = SingleDropdownList.generateQueryOptions;
|
|
438
|
+
ListConnected.hasInternalComponent = SingleDropdownList.hasInternalComponent;
|
|
445
439
|
ListConnected.name = SingleDropdownList.name;
|
|
440
|
+
// Add componentType for SSR
|
|
441
|
+
ListConnected.componentType = componentTypes.singleDropdownList;
|
|
446
442
|
ListConnected.install = function (Vue) {
|
|
447
443
|
Vue.component(ListConnected.name, ListConnected);
|
|
448
444
|
};
|
|
449
445
|
|
|
450
|
-
// Add componentType for SSR
|
|
451
|
-
ListConnected.componentType = componentTypes.singleDropdownList;
|
|
452
|
-
|
|
453
446
|
export default ListConnected;
|
|
454
447
|
export { ListConnected };
|
package/dist/es/SingleList.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
3
|
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
|
-
import { createVNode, mergeProps, createTextVNode } from 'vue';
|
|
5
4
|
import VueTypes from 'vue-types';
|
|
6
|
-
import '@appbaseio/vue-emotion';
|
|
7
5
|
import 'emotion';
|
|
6
|
+
import '@appbaseio/vue-emotion';
|
|
8
7
|
import 'polished';
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-66ebc93e.js';
|
|
10
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
11
10
|
import 'redux';
|
|
12
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, o as isEvent, h as hasCustomRenderer, c as connect } from './index-
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
11
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, o as isEvent, h as hasCustomRenderer, c as connect } from './index-5509c0bc.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
|
|
13
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
|
|
15
14
|
import { T as Title } from './Title-863dfa42.js';
|
|
16
|
-
import { I as Input } from './Input-
|
|
15
|
+
import { I as Input } from './Input-c09c0b56.js';
|
|
17
16
|
import { C as Container } from './Container-d00219f7.js';
|
|
18
17
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
19
|
-
import { U as UL, R as Radio } from './FormControlList-
|
|
18
|
+
import { U as UL, R as Radio } from './FormControlList-99797d0a.js';
|
|
20
19
|
import { g as getAggsQuery } from './utils-9e5a16a1.js';
|
|
21
20
|
|
|
22
21
|
var updateQuery = Actions.updateQuery,
|
|
@@ -136,17 +135,18 @@ var SingleList = {
|
|
|
136
135
|
},
|
|
137
136
|
render: function render() {
|
|
138
137
|
var _this = this;
|
|
138
|
+
var h = arguments[0];
|
|
139
139
|
var _this$$props = this.$props,
|
|
140
140
|
selectAllLabel = _this$$props.selectAllLabel,
|
|
141
141
|
renderItem = _this$$props.renderItem,
|
|
142
142
|
renderError = _this$$props.renderError;
|
|
143
|
-
var renderItemCalc = this.$
|
|
144
|
-
var renderErrorCalc = this.$
|
|
143
|
+
var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
|
|
144
|
+
var renderErrorCalc = this.$scopedSlots.renderError || renderError;
|
|
145
145
|
if (renderErrorCalc && this.error) {
|
|
146
146
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
147
147
|
}
|
|
148
148
|
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
149
|
-
if (this.
|
|
149
|
+
if (this.renderNoResults) {
|
|
150
150
|
this.renderNoResult();
|
|
151
151
|
} else {
|
|
152
152
|
return null;
|
|
@@ -165,73 +165,71 @@ var SingleList = {
|
|
|
165
165
|
}
|
|
166
166
|
return false;
|
|
167
167
|
});
|
|
168
|
-
return
|
|
168
|
+
return h(Container, {
|
|
169
169
|
"class": this.$props.className
|
|
170
|
-
}, {
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
}), null), createVNode("label", {
|
|
199
|
-
"class": getClassName(_this.$props.innerClass, 'label') || null,
|
|
200
|
-
"for": _this.$props.componentId + "-" + selectAllLabel
|
|
201
|
-
}, [createVNode("span", null, [selectAllLabel, _this.$props.showCount && createVNode("span", {
|
|
202
|
-
"class": getClassName(_this.$props.innerClass, 'count') || null
|
|
203
|
-
}, [createTextVNode("\xA0("), _this.totalDocumentCount, createTextVNode(")")])])])]) : null, !_this.hasCustomRenderer && filteredItemsToRender.length === 0 && !_this.isLoading ? _this.renderNoResult() : filteredItemsToRender.map(function (item) {
|
|
204
|
-
return createVNode("li", {
|
|
205
|
-
"key": item.key,
|
|
206
|
-
"class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
|
|
207
|
-
}, [createVNode(Radio, mergeProps({
|
|
208
|
-
"class": getClassName(_this.$props.innerClass, 'radio'),
|
|
209
|
-
"id": _this.$props.componentId + "-" + item.key,
|
|
210
|
-
"name": _this.$props.componentId,
|
|
211
|
-
"value": item.key,
|
|
212
|
-
"readOnly": true,
|
|
213
|
-
"onClick": _this.handleClick,
|
|
214
|
-
"type": "radio",
|
|
215
|
-
"show": _this.$props.showRadio
|
|
216
|
-
}, {
|
|
217
|
-
domProps: {
|
|
218
|
-
checked: _this.currentValue === String(item.key)
|
|
219
|
-
}
|
|
220
|
-
}), null), createVNode("label", {
|
|
221
|
-
"class": getClassName(_this.$props.innerClass, 'label') || null,
|
|
222
|
-
"for": _this.$props.componentId + "-" + item.key
|
|
223
|
-
}, [renderItemCalc ? renderItemCalc({
|
|
224
|
-
label: item.key,
|
|
225
|
-
count: item.doc_count,
|
|
226
|
-
isChecked: _this.currentValue === String(item.key)
|
|
227
|
-
}) : createVNode("span", null, [item.key, _this.$props.showCount && createVNode("span", {
|
|
228
|
-
"class": getClassName(_this.$props.innerClass, 'count') || null
|
|
229
|
-
}, [createTextVNode("\xA0("), item.doc_count, createTextVNode(")")])])])]);
|
|
230
|
-
})];
|
|
231
|
-
}
|
|
232
|
-
})];
|
|
170
|
+
}, [this.$props.title && h(Title, {
|
|
171
|
+
"class": getClassName(this.$props.innerClass, 'title') || ''
|
|
172
|
+
}, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
|
|
173
|
+
"class": getClassName(this.$props.innerClass, 'list') || ''
|
|
174
|
+
}, [selectAllLabel ? h("li", {
|
|
175
|
+
"key": selectAllLabel,
|
|
176
|
+
"class": "" + (this.$data.currentValue === selectAllLabel ? 'active' : '')
|
|
177
|
+
}, [h(Radio, {
|
|
178
|
+
"class": getClassName(this.$props.innerClass, 'radio'),
|
|
179
|
+
"attrs": {
|
|
180
|
+
"id": this.$props.componentId + "-" + selectAllLabel,
|
|
181
|
+
"name": this.$props.componentId,
|
|
182
|
+
"value": selectAllLabel,
|
|
183
|
+
"readOnly": true,
|
|
184
|
+
"type": "radio",
|
|
185
|
+
"show": this.$props.showRadio
|
|
186
|
+
},
|
|
187
|
+
"on": {
|
|
188
|
+
"click": this.handleClick
|
|
189
|
+
},
|
|
190
|
+
"domProps": _extends({}, {
|
|
191
|
+
checked: this.$data.currentValue === selectAllLabel
|
|
192
|
+
})
|
|
193
|
+
}), h("label", {
|
|
194
|
+
"class": getClassName(this.$props.innerClass, 'label') || null,
|
|
195
|
+
"attrs": {
|
|
196
|
+
"for": this.$props.componentId + "-" + selectAllLabel
|
|
233
197
|
}
|
|
234
|
-
}
|
|
198
|
+
}, [h("span", [selectAllLabel, this.$props.showCount && h("span", {
|
|
199
|
+
"class": getClassName(this.$props.innerClass, 'count') || null
|
|
200
|
+
}, ["\xA0(", this.totalDocumentCount, ")"])])])]) : null, !this.hasCustomRenderer && filteredItemsToRender.length === 0 && !this.isLoading ? this.renderNoResult() : filteredItemsToRender.map(function (item) {
|
|
201
|
+
return h("li", {
|
|
202
|
+
"key": item.key,
|
|
203
|
+
"class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
|
|
204
|
+
}, [h(Radio, {
|
|
205
|
+
"class": getClassName(_this.$props.innerClass, 'radio'),
|
|
206
|
+
"attrs": {
|
|
207
|
+
"id": _this.$props.componentId + "-" + item.key,
|
|
208
|
+
"name": _this.$props.componentId,
|
|
209
|
+
"value": item.key,
|
|
210
|
+
"readOnly": true,
|
|
211
|
+
"type": "radio",
|
|
212
|
+
"show": _this.$props.showRadio
|
|
213
|
+
},
|
|
214
|
+
"on": {
|
|
215
|
+
"click": _this.handleClick
|
|
216
|
+
},
|
|
217
|
+
"domProps": _extends({}, {
|
|
218
|
+
checked: _this.currentValue === String(item.key)
|
|
219
|
+
})
|
|
220
|
+
}), h("label", {
|
|
221
|
+
"class": getClassName(_this.$props.innerClass, 'label') || null,
|
|
222
|
+
"attrs": {
|
|
223
|
+
"for": _this.$props.componentId + "-" + item.key
|
|
224
|
+
}
|
|
225
|
+
}, [renderItemCalc ? renderItemCalc({
|
|
226
|
+
label: item.key,
|
|
227
|
+
count: item.doc_count,
|
|
228
|
+
isChecked: _this.currentValue === String(item.key)
|
|
229
|
+
}) : h("span", [item.key, _this.$props.showCount && h("span", {
|
|
230
|
+
"class": getClassName(_this.$props.innerClass, 'count') || null
|
|
231
|
+
}, ["\xA0(", item.doc_count, ")"])])])]);
|
|
232
|
+
})])]);
|
|
235
233
|
},
|
|
236
234
|
methods: {
|
|
237
235
|
setValue: function setValue(nextValue, props) {
|
|
@@ -311,17 +309,22 @@ var SingleList = {
|
|
|
311
309
|
this.searchTerm = value;
|
|
312
310
|
},
|
|
313
311
|
renderSearch: function renderSearch() {
|
|
312
|
+
var h = this.$createElement;
|
|
314
313
|
if (this.$props.showSearch) {
|
|
315
|
-
return
|
|
314
|
+
return h(Input, {
|
|
316
315
|
"class": getClassName(this.$props.innerClass, 'input') || '',
|
|
317
|
-
"
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
"on": {
|
|
317
|
+
"input": this.handleInputChange
|
|
318
|
+
},
|
|
319
|
+
"attrs": {
|
|
320
|
+
"value": this.$data.searchTerm,
|
|
321
|
+
"placeholder": this.$props.placeholder,
|
|
322
|
+
"themePreset": this.$props.themePreset
|
|
323
|
+
},
|
|
320
324
|
"style": {
|
|
321
325
|
margin: '0 0 8px'
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
}, null);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
325
328
|
}
|
|
326
329
|
return null;
|
|
327
330
|
},
|
|
@@ -361,8 +364,9 @@ var SingleList = {
|
|
|
361
364
|
return true;
|
|
362
365
|
},
|
|
363
366
|
renderNoResult: function renderNoResult() {
|
|
364
|
-
var
|
|
365
|
-
|
|
367
|
+
var h = this.$createElement;
|
|
368
|
+
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
369
|
+
return h("p", {
|
|
366
370
|
"class": getClassName(this.$props.innerClass, 'noResults') || null
|
|
367
371
|
}, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
368
372
|
}
|
|
@@ -447,12 +451,14 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
|
|
|
447
451
|
internalComponent: SingleList.hasInternalComponent()
|
|
448
452
|
}));
|
|
449
453
|
ListConnected.name = SingleList.name;
|
|
454
|
+
ListConnected.defaultQuery = SingleList.defaultQuery;
|
|
455
|
+
ListConnected.generateQueryOptions = SingleList.generateQueryOptions;
|
|
456
|
+
ListConnected.hasInternalComponent = SingleList.hasInternalComponent;
|
|
457
|
+
// Add componentType for SSR
|
|
458
|
+
ListConnected.componentType = componentTypes.singleList;
|
|
450
459
|
ListConnected.install = function (Vue) {
|
|
451
460
|
Vue.component(ListConnected.name, ListConnected);
|
|
452
461
|
};
|
|
453
462
|
|
|
454
|
-
// Add componentType for SSR
|
|
455
|
-
ListConnected.componentType = componentTypes.singleList;
|
|
456
|
-
|
|
457
463
|
export default ListConnected;
|
|
458
464
|
export { ListConnected };
|