@appbaseio/reactivesearch-vue 1.16.0-alpha.3 → 1.16.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +6388 -5403
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/Button-d2f1aeda.js +68 -0
- package/dist/cjs/{DownShift-b09da079.js → CancelSvg-82021d23.js} +60 -16
- package/dist/cjs/Card-4b915733.js +30 -0
- package/dist/cjs/{ComponentWrapper-5a0a8849.js → ComponentWrapper-7302fe1a.js} +40 -21
- package/dist/cjs/{Container-f84e72fc.js → Container-8a08d663.js} +3 -11
- package/dist/cjs/DataSearch.js +341 -391
- package/dist/cjs/{DropDown-c66be1a8.js → DropDown-c46d8b0c.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +81 -25
- package/dist/cjs/Flex-699639d2.js +52 -0
- package/dist/cjs/FormControlList-73497794.js +47 -0
- package/dist/cjs/Input-c6f181d5.js +79 -0
- package/dist/cjs/ListItem-933c27e4.js +46 -0
- package/dist/cjs/MultiDropdownList.js +71 -46
- package/dist/cjs/MultiList.js +49 -29
- package/dist/cjs/MultiRange.js +20 -14
- package/dist/cjs/{Pagination-91df3b77.js → Pagination-1b2320a7.js} +4 -3
- package/dist/cjs/RangeInput.js +29 -45
- package/dist/cjs/RangeSlider.js +31 -28
- package/dist/cjs/ReactiveBase.js +55 -34
- package/dist/cjs/ReactiveComponent.js +80 -36
- package/dist/cjs/ReactiveGoogleMap.js +326 -235
- package/dist/cjs/ReactiveList.js +149 -202
- package/dist/cjs/ResultCard.js +8 -6
- package/dist/cjs/ResultList.js +8 -6
- package/dist/cjs/SelectedFilters.js +25 -12
- package/dist/cjs/SingleDropdownList.js +70 -45
- package/dist/cjs/SingleList.js +44 -26
- package/dist/cjs/SingleRange.js +17 -11
- package/dist/cjs/StateProvider.js +11 -7
- package/dist/cjs/{Title-e9beb554.js → Title-39765ee6.js} +3 -11
- package/dist/cjs/ToggleButton.js +35 -16
- package/dist/cjs/{_rollupPluginBabelHelpers-280a574c.js → _rollupPluginBabelHelpers-4abdbfff.js} +11 -1
- package/dist/cjs/{index-e0583d76.js → index-d44a0a21.js} +87 -13
- package/dist/cjs/index.js +23 -19
- package/dist/cjs/initReactivesearch.js +80 -38
- package/dist/cjs/install.js +20 -18
- package/dist/cjs/ssr-c333c82c.js +39 -0
- package/dist/cjs/{utils-d1ea9f95.js → utils-23afb20b.js} +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
- package/dist/es/Button-799185e2.js +59 -0
- package/dist/es/{DownShift-d8f2500f.js → CancelSvg-4d9e0857.js} +56 -17
- package/dist/es/Card-04b3c33e.js +23 -0
- package/dist/es/{ComponentWrapper-d0b21b95.js → ComponentWrapper-bbb717bc.js} +40 -21
- package/dist/es/Container-4383c6f0.js +10 -0
- package/dist/es/DataSearch.js +339 -389
- package/dist/es/{DropDown-5dbd69c2.js → DropDown-4edaa621.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +81 -25
- package/dist/es/Flex-aac91505.js +47 -0
- package/dist/es/FormControlList-fe389a2e.js +40 -0
- package/dist/es/Input-d8519224.js +71 -0
- package/dist/es/ListItem-bdb6d53d.js +39 -0
- package/dist/es/MultiDropdownList.js +71 -46
- package/dist/es/MultiList.js +49 -29
- package/dist/es/MultiRange.js +20 -14
- package/dist/es/{Pagination-800af44f.js → Pagination-b3e4054a.js} +4 -3
- package/dist/es/RangeInput.js +29 -45
- package/dist/es/RangeSlider.js +31 -28
- package/dist/es/ReactiveBase.js +55 -34
- package/dist/es/ReactiveComponent.js +80 -36
- package/dist/es/ReactiveGoogleMap.js +326 -235
- package/dist/es/ReactiveList.js +149 -202
- package/dist/es/ResultCard.js +8 -6
- package/dist/es/ResultList.js +8 -6
- package/dist/es/SelectedFilters.js +25 -12
- package/dist/es/SingleDropdownList.js +70 -45
- package/dist/es/SingleList.js +44 -26
- package/dist/es/SingleRange.js +17 -11
- package/dist/es/StateProvider.js +11 -7
- package/dist/es/Title-579f8d6c.js +10 -0
- package/dist/es/ToggleButton.js +35 -16
- package/dist/es/{_rollupPluginBabelHelpers-c9fbe19f.js → _rollupPluginBabelHelpers-ecf6c03c.js} +11 -1
- package/dist/es/{index-1fe91a0a.js → index-5daa8276.js} +84 -14
- package/dist/es/index.js +23 -19
- package/dist/es/initReactivesearch.js +80 -38
- package/dist/es/install.js +20 -18
- package/dist/es/ssr-e3196de1.js +33 -0
- package/dist/es/{utils-ce3d86fd.js → utils-3a32e13f.js} +2 -2
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
- package/package.json +86 -78
- package/dist/cjs/Button-78d8bc26.js +0 -146
- package/dist/cjs/Card-b4af314f.js +0 -58
- package/dist/cjs/Flex-737c55be.js +0 -160
- package/dist/cjs/FormControlList-08dfb28e.js +0 -105
- package/dist/cjs/Input-643d02a7.js +0 -178
- package/dist/cjs/ListItem-0c58c5d2.js +0 -84
- package/dist/cjs/ssr-b7a729f9.js +0 -47
- package/dist/es/Button-6c71c66e.js +0 -137
- package/dist/es/Card-ecf70ba1.js +0 -51
- package/dist/es/Container-f5efec9e.js +0 -18
- package/dist/es/Flex-40a74d8a.js +0 -155
- package/dist/es/FormControlList-b96aebef.js +0 -98
- package/dist/es/Input-dfd9dd40.js +0 -170
- package/dist/es/ListItem-da73bc7d.js +0 -77
- package/dist/es/Title-22c2f3bf.js +0 -18
- package/dist/es/ssr-2f57791d.js +0 -41
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
|
+
import { css } from 'emotion';
|
|
3
|
+
import styled from '@appbaseio/vue-emotion';
|
|
4
|
+
import { lighten } from 'polished';
|
|
5
|
+
import './Title-579f8d6c.js';
|
|
6
|
+
|
|
7
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
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 = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\twidth: 100px;\n\theight: 100px;\n"])));
|
|
10
|
+
var Image = styled('div')(_templateObject3 || (_templateObject3 = _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
|
+
return props.small ? smallImage : null;
|
|
12
|
+
}, function (props) {
|
|
13
|
+
return "url(" + props.src + ")";
|
|
14
|
+
});
|
|
15
|
+
var ListItem = styled('a')(_templateObject4 || (_templateObject4 = _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
|
+
var theme = _ref.theme;
|
|
17
|
+
return theme.colors.backgroundColor ? lighten(0.1, theme.colors.backgroundColor) : '#fff';
|
|
18
|
+
}, function (_ref2) {
|
|
19
|
+
var theme = _ref2.theme;
|
|
20
|
+
return theme.colors.backgroundColor ? lighten(0.3, theme.colors.backgroundColor) : lighten(0.68, theme.colors.textColor);
|
|
21
|
+
}, function (_ref3) {
|
|
22
|
+
var theme = _ref3.theme;
|
|
23
|
+
return theme.colors.textColor;
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.href ? 'cursor: pointer' : null;
|
|
26
|
+
}, function (_ref4) {
|
|
27
|
+
var theme = _ref4.theme;
|
|
28
|
+
return theme.colors.backgroundColor ? lighten(0.2, theme.colors.backgroundColor) : '#fdfefd';
|
|
29
|
+
}, function (props) {
|
|
30
|
+
if (props.image) {
|
|
31
|
+
return props.small ? 'calc(100% - 100px)' : 'calc(100% - 160px)';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return '100%';
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.image ? '10px' : 0;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { Image as I, ListItem as L, container as c };
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { l as loadMoreContainer, B as Button } from './Button-
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { l as loadMoreContainer, B as Button } from './Button-799185e2.js';
|
|
9
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
10
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
11
11
|
import 'redux';
|
|
12
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction,
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
-
import
|
|
15
|
-
import './
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5daa8276.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
14
|
+
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
15
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
16
|
+
import './CancelSvg-4d9e0857.js';
|
|
17
|
+
import './Input-d8519224.js';
|
|
16
18
|
import 'compute-scroll-into-view';
|
|
17
|
-
import './
|
|
18
|
-
import
|
|
19
|
-
import { g as getAggsQuery } from './utils-
|
|
20
|
-
import { D as Dropdown } from './DropDown-
|
|
19
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
20
|
+
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
21
|
+
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
22
|
+
import { D as Dropdown } from './DropDown-4edaa621.js';
|
|
21
23
|
|
|
22
24
|
var updateQuery = Actions.updateQuery,
|
|
23
25
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -74,12 +76,21 @@ var MultiDropdownList = {
|
|
|
74
76
|
showMissing: VueTypes.bool.def(false),
|
|
75
77
|
missingLabel: VueTypes.string.def('N/A'),
|
|
76
78
|
showSearch: VueTypes.bool.def(false),
|
|
79
|
+
showClear: VueTypes.bool.def(false),
|
|
77
80
|
showLoadMore: VueTypes.bool.def(false),
|
|
78
81
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
79
|
-
nestedField: types.string
|
|
82
|
+
nestedField: types.string,
|
|
83
|
+
index: VueTypes.string,
|
|
84
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
80
85
|
},
|
|
81
86
|
created: function created() {
|
|
82
|
-
|
|
87
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
88
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var props = this.$props;
|
|
92
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
93
|
+
|
|
83
94
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
84
95
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
85
96
|
},
|
|
@@ -117,33 +128,35 @@ var MultiDropdownList = {
|
|
|
117
128
|
options: function options(newVal, oldVal) {
|
|
118
129
|
var _this2 = this;
|
|
119
130
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
if (newVal) {
|
|
132
|
+
checkPropChange(oldVal, newVal, function () {
|
|
133
|
+
var _this2$$props = _this2.$props,
|
|
134
|
+
showLoadMore = _this2$$props.showLoadMore,
|
|
135
|
+
dataField = _this2$$props.dataField;
|
|
136
|
+
var modifiedOptions = _this2.$data.modifiedOptions;
|
|
137
|
+
|
|
138
|
+
if (showLoadMore) {
|
|
139
|
+
// append options with showLoadMore
|
|
140
|
+
var buckets = newVal[dataField].buckets;
|
|
141
|
+
var nextOptions = [].concat(modifiedOptions, buckets.map(function (bucket) {
|
|
142
|
+
return {
|
|
143
|
+
key: bucket.key[dataField],
|
|
144
|
+
doc_count: bucket.doc_count
|
|
145
|
+
};
|
|
146
|
+
}));
|
|
147
|
+
var after = newVal[dataField].after_key; // detect the last bucket by checking if the next set of buckets were empty
|
|
148
|
+
|
|
149
|
+
var isLastBucket = !buckets.length;
|
|
150
|
+
_this2.after = {
|
|
151
|
+
after: after
|
|
133
152
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
_this2.isLastBucket = isLastBucket;
|
|
142
|
-
_this2.modifiedOptions = nextOptions;
|
|
143
|
-
} else {
|
|
144
|
-
_this2.modifiedOptions = newVal[_this2.$props.dataField] ? newVal[_this2.$props.dataField].buckets : [];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
153
|
+
_this2.isLastBucket = isLastBucket;
|
|
154
|
+
_this2.modifiedOptions = nextOptions;
|
|
155
|
+
} else {
|
|
156
|
+
_this2.modifiedOptions = newVal[_this2.$props.dataField] ? newVal[_this2.$props.dataField].buckets : [];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
147
160
|
},
|
|
148
161
|
size: function size() {
|
|
149
162
|
this.updateQueryOptions(this.$props);
|
|
@@ -186,13 +199,22 @@ var MultiDropdownList = {
|
|
|
186
199
|
var renderErrorCalc = this.$scopedSlots.renderError || renderError;
|
|
187
200
|
var renderLabelCalc = this.$scopedSlots.renderLabel || renderLabel;
|
|
188
201
|
var isLastBucket = this.$data.isLastBucket;
|
|
202
|
+
var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
|
|
189
203
|
var selectAll = [];
|
|
190
204
|
|
|
191
205
|
if (renderErrorCalc && this.error) {
|
|
192
206
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
193
207
|
}
|
|
194
208
|
|
|
195
|
-
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0) {
|
|
209
|
+
if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
|
|
210
|
+
if (renderNoResults && isFunction(renderNoResults)) {
|
|
211
|
+
return h("div", [renderNoResults()]);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (renderNoResults && !isFunction(renderNoResults)) {
|
|
215
|
+
return renderNoResults;
|
|
216
|
+
}
|
|
217
|
+
|
|
196
218
|
return null;
|
|
197
219
|
}
|
|
198
220
|
|
|
@@ -212,7 +234,7 @@ var MultiDropdownList = {
|
|
|
212
234
|
"items": [].concat(selectAll, this.$data.modifiedOptions.filter(function (item) {
|
|
213
235
|
return String(item.key).trim().length;
|
|
214
236
|
}).map(function (item) {
|
|
215
|
-
return _extends(
|
|
237
|
+
return _extends({}, item, {
|
|
216
238
|
key: String(item.key)
|
|
217
239
|
});
|
|
218
240
|
})),
|
|
@@ -228,6 +250,8 @@ var MultiDropdownList = {
|
|
|
228
250
|
"renderItem": renderItemCalc,
|
|
229
251
|
"renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
|
|
230
252
|
"showSearch": this.$props.showSearch,
|
|
253
|
+
"showClear": this.$props.showClear,
|
|
254
|
+
"searchPlaceholder": this.$props.searchPlaceholder,
|
|
231
255
|
"transformData": this.$props.transformData,
|
|
232
256
|
"footer": showLoadMore && !isLastBucket && h("div", {
|
|
233
257
|
"attrs": {
|
|
@@ -319,7 +343,7 @@ var MultiDropdownList = {
|
|
|
319
343
|
}
|
|
320
344
|
|
|
321
345
|
var performUpdate = function performUpdate() {
|
|
322
|
-
_this3.currentValue = currentValue;
|
|
346
|
+
_this3.currentValue = _extends({}, currentValue);
|
|
323
347
|
|
|
324
348
|
_this3.updateQueryHandler(finalValues, props);
|
|
325
349
|
|
|
@@ -346,7 +370,7 @@ var MultiDropdownList = {
|
|
|
346
370
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
347
371
|
}
|
|
348
372
|
|
|
349
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
373
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
350
374
|
this.updateQuery({
|
|
351
375
|
componentId: this.internalComponent,
|
|
352
376
|
query: query,
|
|
@@ -367,7 +391,7 @@ var MultiDropdownList = {
|
|
|
367
391
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
368
392
|
}
|
|
369
393
|
|
|
370
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
394
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
371
395
|
this.updateQuery({
|
|
372
396
|
componentId: props.componentId,
|
|
373
397
|
query: query,
|
|
@@ -402,7 +426,7 @@ var MultiDropdownList = {
|
|
|
402
426
|
if (props.defaultQuery) {
|
|
403
427
|
var value = Object.keys(this.$data.currentValue);
|
|
404
428
|
var defaultQueryOptions = getOptionsFromQuery(props.defaultQuery(value, props));
|
|
405
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
429
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
406
430
|
} else {
|
|
407
431
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
408
432
|
}
|
|
@@ -537,7 +561,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
537
561
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
538
562
|
themePreset: state.config.themePreset,
|
|
539
563
|
error: state.error[props.componentId],
|
|
540
|
-
componentProps: state.props[props.componentId]
|
|
564
|
+
componentProps: state.props[props.componentId],
|
|
565
|
+
enableAppbase: state.config.enableAppbase
|
|
541
566
|
};
|
|
542
567
|
};
|
|
543
568
|
|
package/dist/es/MultiList.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction,
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { T as Title } from './Title-
|
|
14
|
-
import { I as Input } from './Input-
|
|
15
|
-
import { C as Container } from './Container-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
11
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, n as isEvent, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
14
|
+
import { I as Input } from './Input-d8519224.js';
|
|
15
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
16
|
+
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
17
|
+
import { U as UL, C as Checkbox } from './FormControlList-fe389a2e.js';
|
|
18
|
+
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
18
19
|
|
|
19
20
|
var updateQuery = Actions.updateQuery,
|
|
20
21
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -33,7 +34,7 @@ var MultiList = {
|
|
|
33
34
|
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
34
35
|
showCheckbox: VueTypes.bool.def(true),
|
|
35
36
|
beforeValueChange: types.func,
|
|
36
|
-
className:
|
|
37
|
+
className: VueTypes.string.def(''),
|
|
37
38
|
componentId: types.stringRequired,
|
|
38
39
|
customQuery: types.func,
|
|
39
40
|
dataField: types.stringRequired,
|
|
@@ -57,37 +58,47 @@ var MultiList = {
|
|
|
57
58
|
URLParams: VueTypes.bool.def(false),
|
|
58
59
|
showMissing: VueTypes.bool.def(false),
|
|
59
60
|
missingLabel: VueTypes.string.def('N/A'),
|
|
60
|
-
nestedField: types.string
|
|
61
|
+
nestedField: types.string,
|
|
62
|
+
index: VueTypes.string
|
|
61
63
|
},
|
|
62
64
|
data: function data() {
|
|
63
65
|
var props = this.$props;
|
|
64
66
|
this.__state = {
|
|
65
67
|
currentValue: {},
|
|
66
|
-
modifiedOptions:
|
|
68
|
+
modifiedOptions: [],
|
|
67
69
|
searchTerm: ''
|
|
68
70
|
};
|
|
69
71
|
this.internalComponent = props.componentId + "__internal";
|
|
70
72
|
return this.__state;
|
|
71
73
|
},
|
|
72
74
|
created: function created() {
|
|
73
|
-
|
|
75
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
76
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var props = this.$props;
|
|
80
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
81
|
+
|
|
74
82
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
75
83
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
76
84
|
},
|
|
77
85
|
beforeMount: function beforeMount() {
|
|
78
86
|
this.updateQueryHandlerOptions(this.$props);
|
|
87
|
+
var value = this.selectedValue || this.$props.value || this.$props.defaultValue;
|
|
88
|
+
this.setValue(value, !this.selectedValue);
|
|
89
|
+
},
|
|
90
|
+
mounted: function mounted() {
|
|
91
|
+
var currentValue = Object.keys(this.$data.currentValue);
|
|
79
92
|
|
|
80
|
-
if (this.
|
|
81
|
-
this
|
|
82
|
-
} else if (this.$props.value) {
|
|
83
|
-
this.setValue(this.$props.value, true);
|
|
84
|
-
} else if (this.$props.defaultValue) {
|
|
85
|
-
this.setValue(this.$props.defaultValue, true);
|
|
93
|
+
if (this.$props.value !== undefined && !isEqual(this.$props.value, currentValue)) {
|
|
94
|
+
this.$emit('change', currentValue);
|
|
86
95
|
}
|
|
87
96
|
},
|
|
88
97
|
watch: {
|
|
89
98
|
options: function options(newVal) {
|
|
90
|
-
|
|
99
|
+
if (newVal) {
|
|
100
|
+
this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
|
|
101
|
+
}
|
|
91
102
|
},
|
|
92
103
|
size: function size() {
|
|
93
104
|
this.updateQueryHandlerOptions(this.$props);
|
|
@@ -125,7 +136,11 @@ var MultiList = {
|
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
if (!isEqual(selectedValue, newVal)) {
|
|
128
|
-
this.
|
|
139
|
+
if (this.value === undefined) {
|
|
140
|
+
this.setValue(newVal, true);
|
|
141
|
+
} else {
|
|
142
|
+
this.$emit('change', newVal);
|
|
143
|
+
}
|
|
129
144
|
}
|
|
130
145
|
},
|
|
131
146
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -154,8 +169,12 @@ var MultiList = {
|
|
|
154
169
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
155
170
|
}
|
|
156
171
|
|
|
157
|
-
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0) {
|
|
158
|
-
|
|
172
|
+
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
173
|
+
if (this.renderNoResult) {
|
|
174
|
+
this.renderNoResult();
|
|
175
|
+
} else {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
159
178
|
}
|
|
160
179
|
|
|
161
180
|
var itemsToRender = this.$data.modifiedOptions;
|
|
@@ -167,7 +186,7 @@ var MultiList = {
|
|
|
167
186
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
168
187
|
if (String(item.key).length) {
|
|
169
188
|
if (_this2.$props.showSearch && _this2.$data.searchTerm) {
|
|
170
|
-
return String(item.key).toLowerCase().includes(_this2.$data.searchTerm.toLowerCase());
|
|
189
|
+
return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this2.$data.searchTerm).toLowerCase());
|
|
171
190
|
}
|
|
172
191
|
|
|
173
192
|
return true;
|
|
@@ -335,7 +354,7 @@ var MultiList = {
|
|
|
335
354
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
336
355
|
}
|
|
337
356
|
|
|
338
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
357
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
339
358
|
this.updateQuery({
|
|
340
359
|
componentId: this.internalComponent,
|
|
341
360
|
query: query,
|
|
@@ -356,7 +375,7 @@ var MultiList = {
|
|
|
356
375
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
357
376
|
}
|
|
358
377
|
|
|
359
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
378
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
360
379
|
this.updateQuery({
|
|
361
380
|
componentId: props.componentId,
|
|
362
381
|
query: query,
|
|
@@ -377,7 +396,7 @@ var MultiList = {
|
|
|
377
396
|
if (props.defaultQuery) {
|
|
378
397
|
var value = Object.keys(this.$data.currentValue);
|
|
379
398
|
var defaultQueryOptions = getOptionsFromQuery(props.defaultQuery(value, props));
|
|
380
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
399
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
381
400
|
} else {
|
|
382
401
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
383
402
|
}
|
|
@@ -420,7 +439,7 @@ var MultiList = {
|
|
|
420
439
|
if (value === undefined) {
|
|
421
440
|
this.setValue(currentValue);
|
|
422
441
|
} else {
|
|
423
|
-
var values = parseValueArray(value, currentValue);
|
|
442
|
+
var values = parseValueArray(value || [], currentValue);
|
|
424
443
|
this.$emit('change', values);
|
|
425
444
|
}
|
|
426
445
|
},
|
|
@@ -558,7 +577,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
558
577
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
559
578
|
themePreset: state.config.themePreset,
|
|
560
579
|
error: state.error[props.componentId],
|
|
561
|
-
componentProps: state.props[props.componentId]
|
|
580
|
+
componentProps: state.props[props.componentId],
|
|
581
|
+
enableAppbase: state.config.enableAppbase
|
|
562
582
|
};
|
|
563
583
|
};
|
|
564
584
|
|
package/dist/es/MultiRange.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import {
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { T as Title } from './Title-
|
|
14
|
-
import { C as Container } from './Container-
|
|
15
|
-
import { U as UL, C as Checkbox } from './FormControlList-
|
|
11
|
+
import { o as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
14
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
15
|
+
import { U as UL, C as Checkbox } from './FormControlList-fe389a2e.js';
|
|
16
16
|
|
|
17
17
|
var updateQuery = Actions.updateQuery,
|
|
18
18
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -48,7 +48,8 @@ var MultiRange = {
|
|
|
48
48
|
showCheckbox: VueTypes.bool.def(true),
|
|
49
49
|
title: types.title,
|
|
50
50
|
URLParams: VueTypes.bool.def(false),
|
|
51
|
-
nestedField: types.string
|
|
51
|
+
nestedField: types.string,
|
|
52
|
+
index: VueTypes.string
|
|
52
53
|
},
|
|
53
54
|
methods: {
|
|
54
55
|
handleClick: function handleClick(e) {
|
|
@@ -92,7 +93,7 @@ var MultiRange = {
|
|
|
92
93
|
if (reset) {
|
|
93
94
|
selectedValues = values;
|
|
94
95
|
} else {
|
|
95
|
-
selectedValues = _extends(
|
|
96
|
+
selectedValues = _extends({}, selectedValues, values);
|
|
96
97
|
}
|
|
97
98
|
} else if (selectedValues[item]) {
|
|
98
99
|
currentValue = currentValue.filter(function (value) {
|
|
@@ -111,7 +112,7 @@ var MultiRange = {
|
|
|
111
112
|
return item.indexOf(value.label) !== -1;
|
|
112
113
|
});
|
|
113
114
|
currentValue = [].concat(currentValue, currentItems);
|
|
114
|
-
selectedValues = _extends(
|
|
115
|
+
selectedValues = _extends({}, selectedValues, (_extends2 = {}, _extends2[typeof item === 'object' ? item.label : item] = true, _extends2));
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
var performUpdate = function performUpdate() {
|
|
@@ -140,7 +141,7 @@ var MultiRange = {
|
|
|
140
141
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
144
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
144
145
|
this.updateQuery({
|
|
145
146
|
componentId: props.componentId,
|
|
146
147
|
query: query,
|
|
@@ -166,7 +167,7 @@ var MultiRange = {
|
|
|
166
167
|
},
|
|
167
168
|
selectedValue: function selectedValue(newVal) {
|
|
168
169
|
if (!isEqual(this.$data.currentValue, newVal)) {
|
|
169
|
-
this.selectItem(newVal);
|
|
170
|
+
this.selectItem(newVal, true, undefined, true);
|
|
170
171
|
}
|
|
171
172
|
},
|
|
172
173
|
customQuery: function customQuery(newVal, oldVal) {
|
|
@@ -176,7 +177,11 @@ var MultiRange = {
|
|
|
176
177
|
}
|
|
177
178
|
},
|
|
178
179
|
created: function created() {
|
|
179
|
-
|
|
180
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
181
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
182
|
+
} // Set custom query in store
|
|
183
|
+
|
|
184
|
+
|
|
180
185
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
181
186
|
},
|
|
182
187
|
beforeMount: function beforeMount() {
|
|
@@ -282,7 +287,8 @@ MultiRange.defaultQuery = function (values, props) {
|
|
|
282
287
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
283
288
|
return {
|
|
284
289
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
285
|
-
componentProps: state.props[props.componentId]
|
|
290
|
+
componentProps: state.props[props.componentId],
|
|
291
|
+
enableAppbase: state.config.enableAppbase
|
|
286
292
|
};
|
|
287
293
|
};
|
|
288
294
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import VueTypes from 'vue-types';
|
|
3
|
+
import { p as pagination, B as Button } from './Button-799185e2.js';
|
|
4
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
4
5
|
|
|
5
6
|
var getClassName = helper.getClassName,
|
|
6
7
|
handleA11yAction = helper.handleA11yAction;
|
|
@@ -20,7 +21,7 @@ var Pagination = {
|
|
|
20
21
|
pages: types.number,
|
|
21
22
|
setPage: types.func,
|
|
22
23
|
totalPages: types.number,
|
|
23
|
-
showEndPage:
|
|
24
|
+
showEndPage: VueTypes.bool,
|
|
24
25
|
prevLabel: types.string,
|
|
25
26
|
nextLabel: types.string
|
|
26
27
|
},
|