@appbaseio/reactivesearch-vue 1.16.0-alpha.4 → 1.16.0-alpha.42
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 +8110 -7499
- 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 +354 -398
- package/dist/cjs/{DropDown-c66be1a8.js → DropDown-c46d8b0c.js} +80 -95
- package/dist/cjs/DynamicRangeSlider.js +107 -42
- 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 +101 -65
- package/dist/cjs/MultiList.js +79 -47
- 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 +69 -62
- package/dist/cjs/ReactiveGoogleMap.js +326 -235
- package/dist/cjs/ReactiveList.js +188 -241
- 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 +87 -57
- package/dist/cjs/SingleList.js +60 -37
- 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 +190 -103
- 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 +352 -396
- package/dist/es/{DropDown-5dbd69c2.js → DropDown-4edaa621.js} +79 -94
- package/dist/es/DynamicRangeSlider.js +107 -42
- 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 +101 -65
- package/dist/es/MultiList.js +79 -47
- 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 +69 -62
- package/dist/es/ReactiveGoogleMap.js +326 -235
- package/dist/es/ReactiveList.js +188 -241
- 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 +87 -57
- package/dist/es/SingleList.js +60 -37
- 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 +191 -104
- 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 +7 -5
- 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
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,
|
|
@@ -24,7 +25,8 @@ var isEqual = helper.isEqual,
|
|
|
24
25
|
getQueryOptions = helper.getQueryOptions,
|
|
25
26
|
checkValueChange = helper.checkValueChange,
|
|
26
27
|
getClassName = helper.getClassName,
|
|
27
|
-
|
|
28
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
29
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
28
30
|
var MultiList = {
|
|
29
31
|
name: 'MultiList',
|
|
30
32
|
props: {
|
|
@@ -33,7 +35,7 @@ var MultiList = {
|
|
|
33
35
|
queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
|
|
34
36
|
showCheckbox: VueTypes.bool.def(true),
|
|
35
37
|
beforeValueChange: types.func,
|
|
36
|
-
className:
|
|
38
|
+
className: VueTypes.string.def(''),
|
|
37
39
|
componentId: types.stringRequired,
|
|
38
40
|
customQuery: types.func,
|
|
39
41
|
dataField: types.stringRequired,
|
|
@@ -51,43 +53,53 @@ var MultiList = {
|
|
|
51
53
|
showCount: VueTypes.bool.def(true),
|
|
52
54
|
showFilter: VueTypes.bool.def(true),
|
|
53
55
|
showSearch: VueTypes.bool.def(true),
|
|
54
|
-
size: VueTypes.number
|
|
56
|
+
size: VueTypes.number,
|
|
55
57
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
56
58
|
title: types.title,
|
|
57
59
|
URLParams: VueTypes.bool.def(false),
|
|
58
60
|
showMissing: VueTypes.bool.def(false),
|
|
59
61
|
missingLabel: VueTypes.string.def('N/A'),
|
|
60
|
-
nestedField: types.string
|
|
62
|
+
nestedField: types.string,
|
|
63
|
+
index: VueTypes.string
|
|
61
64
|
},
|
|
62
65
|
data: function data() {
|
|
63
66
|
var props = this.$props;
|
|
64
67
|
this.__state = {
|
|
65
68
|
currentValue: {},
|
|
66
|
-
modifiedOptions:
|
|
69
|
+
modifiedOptions: [],
|
|
67
70
|
searchTerm: ''
|
|
68
71
|
};
|
|
69
72
|
this.internalComponent = props.componentId + "__internal";
|
|
70
73
|
return this.__state;
|
|
71
74
|
},
|
|
72
75
|
created: function created() {
|
|
73
|
-
|
|
76
|
+
if (!this.enableAppbase && this.$props.index) {
|
|
77
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var props = this.$props;
|
|
81
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
|
|
82
|
+
|
|
74
83
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
75
84
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
76
85
|
},
|
|
77
86
|
beforeMount: function beforeMount() {
|
|
78
87
|
this.updateQueryHandlerOptions(this.$props);
|
|
88
|
+
var value = this.selectedValue || this.$props.value || this.$props.defaultValue;
|
|
89
|
+
this.setValue(value, !this.selectedValue);
|
|
90
|
+
},
|
|
91
|
+
mounted: function mounted() {
|
|
92
|
+
var currentValue = Object.keys(this.$data.currentValue);
|
|
79
93
|
|
|
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);
|
|
94
|
+
if (this.$props.value !== undefined && !isEqual(this.$props.value, currentValue)) {
|
|
95
|
+
this.$emit('change', currentValue);
|
|
86
96
|
}
|
|
87
97
|
},
|
|
88
98
|
watch: {
|
|
89
99
|
options: function options(newVal) {
|
|
90
|
-
|
|
100
|
+
if (newVal) {
|
|
101
|
+
this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
|
|
102
|
+
}
|
|
91
103
|
},
|
|
92
104
|
size: function size() {
|
|
93
105
|
this.updateQueryHandlerOptions(this.$props);
|
|
@@ -125,7 +137,11 @@ var MultiList = {
|
|
|
125
137
|
}
|
|
126
138
|
|
|
127
139
|
if (!isEqual(selectedValue, newVal)) {
|
|
128
|
-
this.
|
|
140
|
+
if (this.value === undefined) {
|
|
141
|
+
this.setValue(newVal, true);
|
|
142
|
+
} else {
|
|
143
|
+
this.$emit('change', newVal);
|
|
144
|
+
}
|
|
129
145
|
}
|
|
130
146
|
},
|
|
131
147
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -154,8 +170,12 @@ var MultiList = {
|
|
|
154
170
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
155
171
|
}
|
|
156
172
|
|
|
157
|
-
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0) {
|
|
158
|
-
|
|
173
|
+
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
174
|
+
if (this.renderNoResult) {
|
|
175
|
+
this.renderNoResult();
|
|
176
|
+
} else {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
159
179
|
}
|
|
160
180
|
|
|
161
181
|
var itemsToRender = this.$data.modifiedOptions;
|
|
@@ -167,7 +187,7 @@ var MultiList = {
|
|
|
167
187
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
168
188
|
if (String(item.key).length) {
|
|
169
189
|
if (_this2.$props.showSearch && _this2.$data.searchTerm) {
|
|
170
|
-
return String(item.key).toLowerCase().includes(_this2.$data.searchTerm.toLowerCase());
|
|
190
|
+
return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this2.$data.searchTerm).toLowerCase());
|
|
171
191
|
}
|
|
172
192
|
|
|
173
193
|
return true;
|
|
@@ -325,17 +345,18 @@ var MultiList = {
|
|
|
325
345
|
|
|
326
346
|
if (this.defaultQuery) {
|
|
327
347
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
348
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
328
349
|
|
|
329
|
-
if (
|
|
330
|
-
query =
|
|
350
|
+
if (defaultQueryObj) {
|
|
351
|
+
query = defaultQueryObj;
|
|
331
352
|
}
|
|
332
353
|
|
|
333
|
-
defaultQueryOptions =
|
|
354
|
+
defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
334
355
|
|
|
335
356
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
336
357
|
}
|
|
337
358
|
|
|
338
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions);
|
|
359
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
339
360
|
this.updateQuery({
|
|
340
361
|
componentId: this.internalComponent,
|
|
341
362
|
query: query,
|
|
@@ -349,14 +370,13 @@ var MultiList = {
|
|
|
349
370
|
var customQueryOptions;
|
|
350
371
|
|
|
351
372
|
if (customQuery) {
|
|
352
|
-
var
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
373
|
+
var customQueryCalc = customQuery(value, props);
|
|
374
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
375
|
+
customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
356
376
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
357
377
|
}
|
|
358
378
|
|
|
359
|
-
this.setQueryOptions(props.componentId, customQueryOptions);
|
|
379
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
360
380
|
this.updateQuery({
|
|
361
381
|
componentId: props.componentId,
|
|
362
382
|
query: query,
|
|
@@ -376,8 +396,8 @@ var MultiList = {
|
|
|
376
396
|
|
|
377
397
|
if (props.defaultQuery) {
|
|
378
398
|
var value = Object.keys(this.$data.currentValue);
|
|
379
|
-
var defaultQueryOptions =
|
|
380
|
-
this.setQueryOptions(this.internalComponent, _extends(
|
|
399
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
400
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
381
401
|
} else {
|
|
382
402
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
383
403
|
}
|
|
@@ -420,7 +440,7 @@ var MultiList = {
|
|
|
420
440
|
if (value === undefined) {
|
|
421
441
|
this.setValue(currentValue);
|
|
422
442
|
} else {
|
|
423
|
-
var values = parseValueArray(value, currentValue);
|
|
443
|
+
var values = parseValueArray(value || [], currentValue);
|
|
424
444
|
this.$emit('change', values);
|
|
425
445
|
}
|
|
426
446
|
},
|
|
@@ -462,7 +482,13 @@ var MultiList = {
|
|
|
462
482
|
|
|
463
483
|
MultiList.defaultQuery = function (value, props) {
|
|
464
484
|
var query = null;
|
|
465
|
-
var
|
|
485
|
+
var queryFormat = props.queryFormat;
|
|
486
|
+
|
|
487
|
+
if (queryFormat === undefined) {
|
|
488
|
+
queryFormat = 'or';
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
var type = queryFormat === 'or' ? 'terms' : 'term';
|
|
466
492
|
|
|
467
493
|
if (!Array.isArray(value) || value.length === 0) {
|
|
468
494
|
return null;
|
|
@@ -483,14 +509,14 @@ MultiList.defaultQuery = function (value, props) {
|
|
|
483
509
|
} else if (value) {
|
|
484
510
|
var listQuery;
|
|
485
511
|
|
|
486
|
-
if (
|
|
512
|
+
if (queryFormat === 'or') {
|
|
487
513
|
if (props.showMissing) {
|
|
488
|
-
var _type,
|
|
514
|
+
var _type, _ref;
|
|
489
515
|
|
|
490
516
|
var hasMissingTerm = value.includes(props.missingLabel);
|
|
491
|
-
var should = [(
|
|
517
|
+
var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
|
|
492
518
|
return item !== props.missingLabel;
|
|
493
|
-
}), _type),
|
|
519
|
+
}), _type), _ref)];
|
|
494
520
|
|
|
495
521
|
if (hasMissingTerm) {
|
|
496
522
|
should = should.concat({
|
|
@@ -517,9 +543,9 @@ MultiList.defaultQuery = function (value, props) {
|
|
|
517
543
|
} else {
|
|
518
544
|
// adds a sub-query with must as an array of objects for each term/value
|
|
519
545
|
var queryArray = value.map(function (item) {
|
|
520
|
-
var _type3,
|
|
546
|
+
var _type3, _ref2;
|
|
521
547
|
|
|
522
|
-
return
|
|
548
|
+
return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
|
|
523
549
|
});
|
|
524
550
|
listQuery = {
|
|
525
551
|
bool: {
|
|
@@ -558,7 +584,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
558
584
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
559
585
|
themePreset: state.config.themePreset,
|
|
560
586
|
error: state.error[props.componentId],
|
|
561
|
-
componentProps: state.props[props.componentId]
|
|
587
|
+
componentProps: state.props[props.componentId],
|
|
588
|
+
enableAppbase: state.config.enableAppbase
|
|
562
589
|
};
|
|
563
590
|
};
|
|
564
591
|
|
|
@@ -568,9 +595,14 @@ var mapDispatchtoProps = {
|
|
|
568
595
|
setCustomQuery: setCustomQuery,
|
|
569
596
|
setDefaultQuery: setDefaultQuery
|
|
570
597
|
};
|
|
598
|
+
|
|
599
|
+
MultiList.hasInternalComponent = function () {
|
|
600
|
+
return true;
|
|
601
|
+
};
|
|
602
|
+
|
|
571
603
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(MultiList), {
|
|
572
604
|
componentType: componentTypes.multiList,
|
|
573
|
-
internalComponent:
|
|
605
|
+
internalComponent: MultiList.hasInternalComponent()
|
|
574
606
|
});
|
|
575
607
|
|
|
576
608
|
MultiList.install = function (Vue) {
|
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
|
},
|
package/dist/es/RangeInput.js
CHANGED
|
@@ -1,55 +1,35 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import { css } from 'emotion';
|
|
6
6
|
import styled from '@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 { c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import './Title-
|
|
14
|
-
import { F as Flex } from './Flex-
|
|
15
|
-
import { I as Input } from './Input-
|
|
16
|
-
import { C as Container } from './Container-
|
|
11
|
+
import { c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import './Title-579f8d6c.js';
|
|
14
|
+
import { F as Flex } from './Flex-aac91505.js';
|
|
15
|
+
import { I as Input } from './Input-d8519224.js';
|
|
16
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
17
17
|
import 'vue-no-ssr';
|
|
18
|
-
import './ssr-
|
|
18
|
+
import './ssr-e3196de1.js';
|
|
19
19
|
import { RangeConnected as RangeConnected$1 } from './RangeSlider.js';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
var data = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"]);
|
|
23
|
-
|
|
24
|
-
_templateObject2 = function _templateObject2() {
|
|
25
|
-
return data;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return data;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _templateObject() {
|
|
32
|
-
var data = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"]);
|
|
33
|
-
|
|
34
|
-
_templateObject = function _templateObject() {
|
|
35
|
-
return data;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return data;
|
|
39
|
-
}
|
|
21
|
+
var _templateObject, _templateObject2;
|
|
40
22
|
|
|
41
23
|
var alert = function alert(_ref) {
|
|
42
24
|
var theme = _ref.theme;
|
|
43
|
-
return css(_templateObject(), theme.colors.alertColor);
|
|
25
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
|
|
44
26
|
};
|
|
45
27
|
|
|
46
|
-
var Content = styled('div')(_templateObject2(), function (props) {
|
|
28
|
+
var Content = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
47
29
|
return props.alert && alert;
|
|
48
30
|
});
|
|
49
31
|
|
|
50
|
-
var
|
|
51
|
-
getClassName = helper.getClassName,
|
|
52
|
-
getOptionsFromQuery = helper.getOptionsFromQuery,
|
|
32
|
+
var getClassName = helper.getClassName,
|
|
53
33
|
isEqual = helper.isEqual;
|
|
54
34
|
var RangeInput = {
|
|
55
35
|
name: 'RangeInput',
|
|
@@ -95,7 +75,7 @@ var RangeInput = {
|
|
|
95
75
|
stepValue: types.number,
|
|
96
76
|
componentStyle: types.style,
|
|
97
77
|
componentId: types.stringRequired,
|
|
98
|
-
includeNullValues:
|
|
78
|
+
includeNullValues: VueTypes.bool,
|
|
99
79
|
beforeValueChange: types.func,
|
|
100
80
|
customQuery: types.func,
|
|
101
81
|
data: types.data,
|
|
@@ -130,17 +110,19 @@ var RangeInput = {
|
|
|
130
110
|
return false;
|
|
131
111
|
},
|
|
132
112
|
handleChange: function handleChange(value, event) {
|
|
113
|
+
var currentValue = value;
|
|
114
|
+
|
|
133
115
|
if (this.shouldUpdate(value) && !isEqual(value, this.currentValue)) {
|
|
134
116
|
switch (event) {
|
|
135
117
|
case 'change':
|
|
136
118
|
if (!value) {
|
|
137
|
-
|
|
119
|
+
currentValue = {
|
|
138
120
|
start: this.$props.range ? this.$props.range.start : 0,
|
|
139
121
|
end: this.$props.range ? this.$props.range.end : 10
|
|
140
122
|
};
|
|
141
123
|
}
|
|
142
124
|
|
|
143
|
-
this.$data.currentValue = _extends({},
|
|
125
|
+
this.$data.currentValue = _extends({}, currentValue);
|
|
144
126
|
this.$emit('change', this.$data.currentValue);
|
|
145
127
|
break;
|
|
146
128
|
|
|
@@ -150,13 +132,13 @@ var RangeInput = {
|
|
|
150
132
|
break;
|
|
151
133
|
|
|
152
134
|
default:
|
|
153
|
-
this.$data.currentValue = _extends({},
|
|
135
|
+
this.$data.currentValue = _extends({}, currentValue);
|
|
154
136
|
break;
|
|
155
137
|
}
|
|
156
138
|
}
|
|
157
139
|
},
|
|
158
140
|
handleOnChange: function handleOnChange(value) {
|
|
159
|
-
this.handleChange(value, 'change');
|
|
141
|
+
this.handleChange(value || this.$props.range, 'change');
|
|
160
142
|
},
|
|
161
143
|
handleValueChange: function handleValueChange(value) {
|
|
162
144
|
this.handleChange(value, 'value-change');
|
|
@@ -172,12 +154,10 @@ var RangeInput = {
|
|
|
172
154
|
} else {
|
|
173
155
|
this.$data.isEndValid = false;
|
|
174
156
|
}
|
|
175
|
-
} else {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.$data.isEndValid = true;
|
|
180
|
-
}
|
|
157
|
+
} else if (name === 'start' && !this.$data.isStartValid) {
|
|
158
|
+
this.$data.isStartValid = true;
|
|
159
|
+
} else if (name === 'end' && !this.$data.isEndValid) {
|
|
160
|
+
this.$data.isEndValid = true;
|
|
181
161
|
}
|
|
182
162
|
|
|
183
163
|
if (this.$data.isStartValid && this.$data.isEndValid) {
|
|
@@ -213,6 +193,10 @@ var RangeInput = {
|
|
|
213
193
|
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
214
194
|
this.handleChange(this.$props.defaultValue);
|
|
215
195
|
}
|
|
196
|
+
|
|
197
|
+
if (this.isControlled()) {
|
|
198
|
+
this.handleChange(this.$props.value, 'change');
|
|
199
|
+
}
|
|
216
200
|
},
|
|
217
201
|
render: function render() {
|
|
218
202
|
var h = arguments[0];
|
|
@@ -334,7 +318,7 @@ var RangeInput = {
|
|
|
334
318
|
}
|
|
335
319
|
};
|
|
336
320
|
|
|
337
|
-
var mapStateToProps = function mapStateToProps(state
|
|
321
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
338
322
|
return {
|
|
339
323
|
themePreset: state.config.themePreset
|
|
340
324
|
};
|