@appbaseio/reactivesearch-vue 1.33.1 → 1.33.2
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 +1911 -6073
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +2 -4
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-0673191e.js → Button-841fd06d.js} +1 -7
- package/dist/cjs/{CancelSvg-9f258f4f.js → CancelSvg-220a7cc3.js} +24 -58
- package/dist/cjs/{Card-642547a8.js → Card-240f283d.js} +2 -2
- package/dist/cjs/{ComponentWrapper-981ab977.js → ComponentWrapper-9318cece.js} +21 -41
- package/dist/cjs/{Container-daf30918.js → Container-e699ea95.js} +1 -1
- package/dist/cjs/{DataSearch-c42d8681.js → DataSearch-99a6a2e8.js} +121 -293
- package/dist/cjs/DataSearch.js +11 -11
- package/dist/cjs/{DropDown-c479bbb0.js → DropDown-8984b544.js} +27 -48
- package/dist/cjs/DynamicRangeSlider.js +44 -93
- package/dist/cjs/{Flex-aa517a13.js → Flex-ddd7cb6b.js} +1 -3
- package/dist/cjs/{FormControlList-c195a592.js → FormControlList-bbb5cd24.js} +1 -3
- package/dist/cjs/{Input-e6603a7e.js → Input-ead4cd84.js} +14 -16
- package/dist/cjs/{ListItem-8c9e0d68.js → ListItem-5088bd6a.js} +2 -3
- package/dist/cjs/MultiDropdownList.js +41 -102
- package/dist/cjs/MultiList.js +35 -98
- package/dist/cjs/MultiRange.js +20 -52
- package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
- package/dist/cjs/{PreferencesConsumer-4707bd94.js → PreferencesConsumer-5d67b486.js} +8 -18
- package/dist/cjs/RangeInput.js +36 -52
- package/dist/cjs/RangeSlider.js +24 -48
- package/dist/cjs/ReactiveBase.js +34 -79
- package/dist/cjs/{ReactiveComponent-63ef70c2.js → ReactiveComponent-805201c6.js} +118 -301
- package/dist/cjs/ReactiveComponent.js +20 -20
- package/dist/cjs/ReactiveGoogleMap.js +167 -353
- package/dist/cjs/ReactiveList.js +88 -176
- package/dist/cjs/ResultCard.js +10 -18
- package/dist/cjs/ResultList.js +13 -24
- package/dist/cjs/SelectedFilters.js +16 -34
- package/dist/cjs/SingleDropdownList.js +35 -75
- package/dist/cjs/SingleList.js +29 -75
- package/dist/cjs/SingleRange.js +17 -40
- package/dist/cjs/StateProvider.js +6 -26
- package/dist/cjs/{Title-1de7d0f4.js → Title-16042ea0.js} +1 -1
- package/dist/cjs/ToggleButton.js +20 -58
- package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
- package/dist/cjs/{index-08f8dfa3.js → index-30126fd0.js} +39 -75
- package/dist/cjs/index.js +20 -21
- package/dist/cjs/initReactivesearch.js +49 -120
- package/dist/cjs/install.js +20 -20
- package/dist/cjs/{ssr-3027b848.js → ssr-f2fc1bf6.js} +1 -4
- package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-7cfc2f98.js} +6 -11
- package/dist/es/{Button-35aa984e.js → Button-153cd885.js} +1 -7
- package/dist/es/{CancelSvg-4cfae5fd.js → CancelSvg-e40552a5.js} +24 -58
- package/dist/es/{Card-450683f1.js → Card-19ad6d90.js} +2 -2
- package/dist/es/{ComponentWrapper-d5e814a4.js → ComponentWrapper-240450cc.js} +21 -41
- package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +1 -1
- package/dist/es/{DataSearch-d56bf07a.js → DataSearch-20f0d8f1.js} +121 -293
- package/dist/es/DataSearch.js +11 -11
- package/dist/es/{DropDown-05a644a5.js → DropDown-28ddce07.js} +27 -48
- package/dist/es/DynamicRangeSlider.js +44 -93
- package/dist/es/{Flex-1f0795c3.js → Flex-7c177a10.js} +1 -3
- package/dist/es/{FormControlList-c22d64f6.js → FormControlList-99797d0a.js} +1 -3
- package/dist/es/{Input-7a2a9fac.js → Input-c09c0b56.js} +14 -16
- package/dist/es/{ListItem-cad14c5e.js → ListItem-07888a65.js} +2 -3
- package/dist/es/MultiDropdownList.js +41 -102
- package/dist/es/MultiList.js +35 -98
- package/dist/es/MultiRange.js +20 -52
- package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
- package/dist/es/{PreferencesConsumer-4169deb1.js → PreferencesConsumer-bc097ebb.js} +8 -18
- package/dist/es/RangeInput.js +36 -52
- package/dist/es/RangeSlider.js +24 -48
- package/dist/es/ReactiveBase.js +34 -79
- package/dist/es/{ReactiveComponent-9e4721e1.js → ReactiveComponent-dd85aa9c.js} +118 -301
- package/dist/es/ReactiveComponent.js +20 -20
- package/dist/es/ReactiveGoogleMap.js +167 -353
- package/dist/es/ReactiveList.js +88 -176
- package/dist/es/ResultCard.js +10 -18
- package/dist/es/ResultList.js +13 -24
- package/dist/es/SelectedFilters.js +16 -34
- package/dist/es/SingleDropdownList.js +35 -75
- package/dist/es/SingleList.js +29 -75
- package/dist/es/SingleRange.js +17 -40
- package/dist/es/StateProvider.js +6 -26
- package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +1 -1
- package/dist/es/ToggleButton.js +20 -58
- package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
- package/dist/es/{index-99c5f9c9.js → index-0444a498.js} +39 -75
- package/dist/es/index.js +20 -21
- package/dist/es/initReactivesearch.js +49 -120
- package/dist/es/install.js +20 -20
- package/dist/es/{ssr-b2c0b401.js → ssr-03607d84.js} +1 -4
- package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-b8146772.js → vueTypes-8986b709.js} +6 -11
- package/package.json +1 -1
package/dist/es/SingleList.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
3
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
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-8986b709.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, g as getComponent, o as isEvent, h as hasCustomRenderer, c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
14
|
-
import { T as Title } from './Title-
|
|
15
|
-
import { I as Input } from './Input-
|
|
16
|
-
import { C as Container } from './Container-
|
|
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-0444a498.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
|
|
13
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
|
|
14
|
+
import { T as Title } from './Title-863dfa42.js';
|
|
15
|
+
import { I as Input } from './Input-c09c0b56.js';
|
|
16
|
+
import { C as Container } from './Container-d00219f7.js';
|
|
17
17
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
18
|
-
import { U as UL, R as Radio } from './FormControlList-
|
|
19
|
-
import { g as getAggsQuery } from './utils-
|
|
18
|
+
import { U as UL, R as Radio } from './FormControlList-99797d0a.js';
|
|
19
|
+
import { g as getAggsQuery } from './utils-9e5a16a1.js';
|
|
20
20
|
|
|
21
21
|
var updateQuery = Actions.updateQuery,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
setQueryOptions = Actions.setQueryOptions,
|
|
23
|
+
setCustomQuery = Actions.setCustomQuery,
|
|
24
|
+
setDefaultQuery = Actions.setDefaultQuery;
|
|
25
25
|
var getQueryOptions = helper.getQueryOptions,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
checkValueChange = helper.checkValueChange,
|
|
27
|
+
getClassName = helper.getClassName,
|
|
28
|
+
isEqual = helper.isEqual,
|
|
29
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
30
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
31
31
|
var SingleList = {
|
|
32
32
|
name: 'SingleList',
|
|
33
33
|
props: {
|
|
@@ -77,16 +77,14 @@ var SingleList = {
|
|
|
77
77
|
if (!this.enableAppbase && this.$props.index) {
|
|
78
78
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
79
79
|
}
|
|
80
|
-
|
|
81
80
|
var props = this.$props;
|
|
82
|
-
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : [];
|
|
83
|
-
|
|
81
|
+
this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : [];
|
|
82
|
+
// Set custom and default queries in store
|
|
84
83
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
85
84
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
|
|
86
85
|
},
|
|
87
86
|
beforeMount: function beforeMount() {
|
|
88
87
|
this.updateQueryHandlerOptions(this.$props);
|
|
89
|
-
|
|
90
88
|
if (this.selectedValue) {
|
|
91
89
|
this.setValue(this.selectedValue);
|
|
92
90
|
} else if (this.$props.value) {
|
|
@@ -137,19 +135,16 @@ var SingleList = {
|
|
|
137
135
|
},
|
|
138
136
|
render: function render() {
|
|
139
137
|
var _this = this;
|
|
140
|
-
|
|
141
138
|
var h = arguments[0];
|
|
142
139
|
var _this$$props = this.$props,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
selectAllLabel = _this$$props.selectAllLabel,
|
|
141
|
+
renderItem = _this$$props.renderItem,
|
|
142
|
+
renderError = _this$$props.renderError;
|
|
146
143
|
var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
|
|
147
144
|
var renderErrorCalc = this.$scopedSlots.renderError || renderError;
|
|
148
|
-
|
|
149
145
|
if (renderErrorCalc && this.error) {
|
|
150
146
|
return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
|
|
151
147
|
}
|
|
152
|
-
|
|
153
148
|
if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
|
|
154
149
|
if (this.renderNoResult) {
|
|
155
150
|
this.renderNoResult();
|
|
@@ -157,22 +152,17 @@ var SingleList = {
|
|
|
157
152
|
return null;
|
|
158
153
|
}
|
|
159
154
|
}
|
|
160
|
-
|
|
161
155
|
var itemsToRender = this.$data.modifiedOptions;
|
|
162
|
-
|
|
163
156
|
if (this.$props.transformData) {
|
|
164
157
|
itemsToRender = this.$props.transformData(itemsToRender);
|
|
165
158
|
}
|
|
166
|
-
|
|
167
159
|
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
168
160
|
if (String(item.key).length) {
|
|
169
161
|
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
170
162
|
return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
|
|
171
163
|
}
|
|
172
|
-
|
|
173
164
|
return true;
|
|
174
165
|
}
|
|
175
|
-
|
|
176
166
|
return false;
|
|
177
167
|
});
|
|
178
168
|
return h(Container, {
|
|
@@ -244,46 +234,35 @@ var SingleList = {
|
|
|
244
234
|
methods: {
|
|
245
235
|
setValue: function setValue(nextValue, props) {
|
|
246
236
|
var _this2 = this;
|
|
247
|
-
|
|
248
237
|
if (props === void 0) {
|
|
249
238
|
props = this.$props;
|
|
250
239
|
}
|
|
251
|
-
|
|
252
240
|
var value = nextValue;
|
|
253
|
-
|
|
254
241
|
if (nextValue === this.$data.currentValue) {
|
|
255
242
|
value = '';
|
|
256
243
|
}
|
|
257
|
-
|
|
258
244
|
var performUpdate = function performUpdate() {
|
|
259
245
|
_this2.currentValue = value;
|
|
260
|
-
|
|
261
246
|
_this2.updateQueryHandler(value, props);
|
|
262
|
-
|
|
263
247
|
_this2.$emit('valueChange', value);
|
|
264
|
-
|
|
265
248
|
_this2.$emit('value-change', value);
|
|
266
249
|
};
|
|
267
|
-
|
|
268
250
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
269
251
|
},
|
|
270
252
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
271
253
|
var query = SingleList.defaultQuery(value, props);
|
|
272
|
-
|
|
273
254
|
if (this.defaultQuery) {
|
|
274
255
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
275
256
|
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
276
|
-
|
|
277
257
|
if (defaultQueryObj) {
|
|
278
258
|
query = defaultQueryObj;
|
|
279
|
-
}
|
|
280
|
-
|
|
259
|
+
}
|
|
281
260
|
|
|
261
|
+
// Update calculated default query in store
|
|
282
262
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
283
263
|
var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
284
264
|
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
285
265
|
}
|
|
286
|
-
|
|
287
266
|
this.updateQuery({
|
|
288
267
|
componentId: this.internalComponent,
|
|
289
268
|
query: query,
|
|
@@ -294,7 +273,6 @@ var SingleList = {
|
|
|
294
273
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
295
274
|
var customQuery = props.customQuery;
|
|
296
275
|
var query = SingleList.defaultQuery(value, props);
|
|
297
|
-
|
|
298
276
|
if (customQuery) {
|
|
299
277
|
var customQueryCalc = customQuery(value, props);
|
|
300
278
|
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
@@ -302,7 +280,6 @@ var SingleList = {
|
|
|
302
280
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
303
281
|
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
304
282
|
}
|
|
305
|
-
|
|
306
283
|
this.updateQuery({
|
|
307
284
|
componentId: props.componentId,
|
|
308
285
|
query: query,
|
|
@@ -319,7 +296,6 @@ var SingleList = {
|
|
|
319
296
|
},
|
|
320
297
|
updateQueryHandlerOptions: function updateQueryHandlerOptions(props) {
|
|
321
298
|
var queryOptions = SingleList.generateQueryOptions(props);
|
|
322
|
-
|
|
323
299
|
if (props.defaultQuery) {
|
|
324
300
|
var value = this.$data.currentValue;
|
|
325
301
|
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
@@ -334,7 +310,6 @@ var SingleList = {
|
|
|
334
310
|
},
|
|
335
311
|
renderSearch: function renderSearch() {
|
|
336
312
|
var h = this.$createElement;
|
|
337
|
-
|
|
338
313
|
if (this.$props.showSearch) {
|
|
339
314
|
return h(Input, {
|
|
340
315
|
"class": getClassName(this.$props.innerClass, 'input') || '',
|
|
@@ -351,20 +326,17 @@ var SingleList = {
|
|
|
351
326
|
}
|
|
352
327
|
});
|
|
353
328
|
}
|
|
354
|
-
|
|
355
329
|
return null;
|
|
356
330
|
},
|
|
357
331
|
getComponent: function getComponent$1() {
|
|
358
332
|
var _this$$data = this.$data,
|
|
359
|
-
|
|
360
|
-
|
|
333
|
+
currentValue = _this$$data.currentValue,
|
|
334
|
+
modifiedOptions = _this$$data.modifiedOptions;
|
|
361
335
|
var transformData = this.$props.transformData;
|
|
362
336
|
var itemsToRender = modifiedOptions;
|
|
363
|
-
|
|
364
337
|
if (transformData) {
|
|
365
338
|
itemsToRender = transformData(itemsToRender);
|
|
366
339
|
}
|
|
367
|
-
|
|
368
340
|
var data = {
|
|
369
341
|
error: this.error,
|
|
370
342
|
loading: this.isLoading,
|
|
@@ -377,23 +349,18 @@ var SingleList = {
|
|
|
377
349
|
},
|
|
378
350
|
handleClick: function handleClick(e) {
|
|
379
351
|
var currentValue = e;
|
|
380
|
-
|
|
381
352
|
if (isEvent(e)) {
|
|
382
353
|
currentValue = e.target.value;
|
|
383
354
|
}
|
|
384
|
-
|
|
385
355
|
if (this.enableStrictSelection && currentValue === this.currentValue) {
|
|
386
356
|
return false;
|
|
387
357
|
}
|
|
388
|
-
|
|
389
358
|
var value = this.$props.value;
|
|
390
|
-
|
|
391
359
|
if (value === undefined) {
|
|
392
360
|
this.setValue(currentValue);
|
|
393
361
|
} else {
|
|
394
362
|
this.$emit('change', currentValue);
|
|
395
363
|
}
|
|
396
|
-
|
|
397
364
|
return true;
|
|
398
365
|
},
|
|
399
366
|
renderNoResult: function renderNoResult() {
|
|
@@ -410,36 +377,29 @@ var SingleList = {
|
|
|
410
377
|
}
|
|
411
378
|
}
|
|
412
379
|
};
|
|
413
|
-
|
|
414
380
|
SingleList.generateQueryOptions = function (props) {
|
|
415
381
|
var queryOptions = getQueryOptions(props);
|
|
416
382
|
return getAggsQuery(queryOptions, props);
|
|
417
383
|
};
|
|
418
|
-
|
|
419
384
|
SingleList.defaultQuery = function (value, props) {
|
|
420
385
|
var query = null;
|
|
421
|
-
|
|
422
386
|
if (props.selectAllLabel && props.selectAllLabel === value) {
|
|
423
387
|
if (props.showMissing) {
|
|
424
388
|
query = {
|
|
425
389
|
match_all: {}
|
|
426
390
|
};
|
|
427
391
|
}
|
|
428
|
-
|
|
429
392
|
query = {
|
|
430
393
|
exists: {
|
|
431
394
|
field: props.dataField
|
|
432
395
|
}
|
|
433
396
|
};
|
|
434
397
|
}
|
|
435
|
-
|
|
436
398
|
if (value) {
|
|
437
399
|
var _term;
|
|
438
|
-
|
|
439
400
|
query = {
|
|
440
401
|
term: (_term = {}, _term[props.dataField] = value, _term)
|
|
441
402
|
};
|
|
442
|
-
|
|
443
403
|
if (props.showMissing && props.missingLabel === value) {
|
|
444
404
|
query = {
|
|
445
405
|
bool: {
|
|
@@ -452,7 +412,6 @@ SingleList.defaultQuery = function (value, props) {
|
|
|
452
412
|
};
|
|
453
413
|
}
|
|
454
414
|
}
|
|
455
|
-
|
|
456
415
|
if (query && props.nestedField) {
|
|
457
416
|
return {
|
|
458
417
|
query: {
|
|
@@ -463,14 +422,11 @@ SingleList.defaultQuery = function (value, props) {
|
|
|
463
422
|
}
|
|
464
423
|
};
|
|
465
424
|
}
|
|
466
|
-
|
|
467
425
|
return query;
|
|
468
426
|
};
|
|
469
|
-
|
|
470
427
|
SingleList.hasInternalComponent = function () {
|
|
471
428
|
return true;
|
|
472
429
|
};
|
|
473
|
-
|
|
474
430
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
475
431
|
return {
|
|
476
432
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -484,7 +440,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
484
440
|
enableAppbase: state.config.enableAppbase
|
|
485
441
|
};
|
|
486
442
|
};
|
|
487
|
-
|
|
488
443
|
var mapDispatchtoProps = {
|
|
489
444
|
setQueryOptions: setQueryOptions,
|
|
490
445
|
updateQuery: updateQuery,
|
|
@@ -495,12 +450,11 @@ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps
|
|
|
495
450
|
componentType: componentTypes.singleList,
|
|
496
451
|
internalComponent: SingleList.hasInternalComponent()
|
|
497
452
|
}));
|
|
498
|
-
|
|
499
453
|
SingleList.install = function (Vue) {
|
|
500
454
|
Vue.component(SingleList.name, ListConnected);
|
|
501
|
-
};
|
|
502
|
-
|
|
455
|
+
};
|
|
503
456
|
|
|
457
|
+
// Add componentType for SSR
|
|
504
458
|
SingleList.componentType = componentTypes.singleList;
|
|
505
459
|
|
|
506
460
|
export default SingleList;
|
package/dist/es/SingleRange.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import './_rollupPluginBabelHelpers-
|
|
3
|
+
import './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
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-8986b709.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
14
|
-
import { T as Title } from './Title-
|
|
15
|
-
import { C as Container } from './Container-
|
|
16
|
-
import { U as UL, R as Radio } from './FormControlList-
|
|
11
|
+
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-0444a498.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
|
|
13
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
|
|
14
|
+
import { T as Title } from './Title-863dfa42.js';
|
|
15
|
+
import { C as Container } from './Container-d00219f7.js';
|
|
16
|
+
import { U as UL, R as Radio } from './FormControlList-99797d0a.js';
|
|
17
17
|
|
|
18
18
|
var updateQuery = Actions.updateQuery,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
setQueryOptions = Actions.setQueryOptions,
|
|
20
|
+
setCustomQuery = Actions.setCustomQuery;
|
|
21
21
|
var isEqual = helper.isEqual,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
checkValueChange = helper.checkValueChange,
|
|
23
|
+
getClassName = helper.getClassName,
|
|
24
|
+
getOptionsFromQuery = helper.getOptionsFromQuery;
|
|
25
25
|
var SingleRange = {
|
|
26
26
|
name: 'SingleRange',
|
|
27
27
|
data: function data() {
|
|
@@ -54,9 +54,8 @@ var SingleRange = {
|
|
|
54
54
|
created: function created() {
|
|
55
55
|
if (!this.enableAppbase && this.$props.index) {
|
|
56
56
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
}
|
|
58
|
+
// Set custom query in store
|
|
60
59
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
61
60
|
},
|
|
62
61
|
beforeMount: function beforeMount() {
|
|
@@ -93,7 +92,6 @@ var SingleRange = {
|
|
|
93
92
|
},
|
|
94
93
|
render: function render() {
|
|
95
94
|
var _this = this;
|
|
96
|
-
|
|
97
95
|
var h = arguments[0];
|
|
98
96
|
return h(Container, {
|
|
99
97
|
"class": this.$props.className
|
|
@@ -130,38 +128,28 @@ var SingleRange = {
|
|
|
130
128
|
methods: {
|
|
131
129
|
setValue: function setValue(value, props) {
|
|
132
130
|
var _this2 = this;
|
|
133
|
-
|
|
134
131
|
if (props === void 0) {
|
|
135
132
|
props = this.$props;
|
|
136
133
|
}
|
|
137
|
-
|
|
138
134
|
var currentValue = typeof value === 'string' ? SingleRange.parseValue(value, props) : value;
|
|
139
|
-
|
|
140
135
|
var performUpdate = function performUpdate() {
|
|
141
136
|
_this2.currentValue = currentValue;
|
|
142
|
-
|
|
143
137
|
_this2.updateQueryHandler(currentValue, props);
|
|
144
|
-
|
|
145
138
|
_this2.$emit('valueChange', currentValue);
|
|
146
|
-
|
|
147
139
|
_this2.$emit('value-change', currentValue);
|
|
148
140
|
};
|
|
149
|
-
|
|
150
141
|
checkValueChange(props.componentId, currentValue, props.beforeValueChange, performUpdate);
|
|
151
142
|
},
|
|
152
143
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
153
144
|
var customQuery = props.customQuery;
|
|
154
145
|
var query = SingleRange.defaultQuery(value, props);
|
|
155
|
-
|
|
156
146
|
if (customQuery) {
|
|
157
147
|
var _ref = customQuery(value, props) || {};
|
|
158
|
-
|
|
159
148
|
query = _ref.query;
|
|
160
149
|
var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
161
150
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
162
151
|
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
163
152
|
}
|
|
164
|
-
|
|
165
153
|
this.updateQuery({
|
|
166
154
|
componentId: props.componentId,
|
|
167
155
|
query: query,
|
|
@@ -174,7 +162,6 @@ var SingleRange = {
|
|
|
174
162
|
},
|
|
175
163
|
handleChange: function handleChange(e) {
|
|
176
164
|
var value = this.$props.value;
|
|
177
|
-
|
|
178
165
|
if (value === undefined) {
|
|
179
166
|
this.setValue(e.target.value);
|
|
180
167
|
} else {
|
|
@@ -183,19 +170,15 @@ var SingleRange = {
|
|
|
183
170
|
}
|
|
184
171
|
}
|
|
185
172
|
};
|
|
186
|
-
|
|
187
173
|
SingleRange.parseValue = function (value, props) {
|
|
188
174
|
return props.data.find(function (item) {
|
|
189
175
|
return item.label === value;
|
|
190
176
|
}) || null;
|
|
191
177
|
};
|
|
192
|
-
|
|
193
178
|
SingleRange.defaultQuery = function (value, props) {
|
|
194
179
|
var query = null;
|
|
195
|
-
|
|
196
180
|
if (value) {
|
|
197
181
|
var _range;
|
|
198
|
-
|
|
199
182
|
query = {
|
|
200
183
|
range: (_range = {}, _range[props.dataField] = {
|
|
201
184
|
gte: value.start,
|
|
@@ -204,7 +187,6 @@ SingleRange.defaultQuery = function (value, props) {
|
|
|
204
187
|
}, _range)
|
|
205
188
|
};
|
|
206
189
|
}
|
|
207
|
-
|
|
208
190
|
if (query && props.nestedField) {
|
|
209
191
|
return {
|
|
210
192
|
query: {
|
|
@@ -215,10 +197,8 @@ SingleRange.defaultQuery = function (value, props) {
|
|
|
215
197
|
}
|
|
216
198
|
};
|
|
217
199
|
}
|
|
218
|
-
|
|
219
200
|
return query;
|
|
220
201
|
};
|
|
221
|
-
|
|
222
202
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
223
203
|
return {
|
|
224
204
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
@@ -226,7 +206,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
226
206
|
enableAppbase: state.config.enableAppbase
|
|
227
207
|
};
|
|
228
208
|
};
|
|
229
|
-
|
|
230
209
|
var mapDispatchtoProps = {
|
|
231
210
|
updateQuery: updateQuery,
|
|
232
211
|
setQueryOptions: setQueryOptions,
|
|
@@ -235,12 +214,10 @@ var mapDispatchtoProps = {
|
|
|
235
214
|
var RangeConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleRange), {
|
|
236
215
|
componentType: componentTypes.singleRange
|
|
237
216
|
}));
|
|
238
|
-
|
|
239
217
|
SingleRange.install = function (Vue) {
|
|
240
218
|
Vue.component(SingleRange.name, RangeConnected);
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
|
|
219
|
+
};
|
|
220
|
+
// Add componentType for SSR
|
|
244
221
|
SingleRange.componentType = componentTypes.singleRange;
|
|
245
222
|
|
|
246
223
|
export default SingleRange;
|
package/dist/es/StateProvider.js
CHANGED
|
@@ -1,41 +1,34 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
2
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
3
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
4
4
|
import VueTypes from 'vue-types';
|
|
5
5
|
import { isInternalComponent } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
6
6
|
import 'redux';
|
|
7
|
-
import { c as connect } from './index-
|
|
7
|
+
import { c as connect } from './index-0444a498.js';
|
|
8
8
|
import { setValues } from '@appbaseio/reactivecore/lib/actions/value';
|
|
9
9
|
|
|
10
10
|
var getSearchState = helper.getSearchState;
|
|
11
11
|
var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
|
|
12
|
-
|
|
13
12
|
var filterProps = function filterProps(props) {
|
|
14
13
|
if (props === void 0) {
|
|
15
14
|
props = {};
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return _extends({}, props, {
|
|
19
17
|
props: props.componentProps
|
|
20
18
|
});
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
var filterByComponentIds = function filterByComponentIds(state, props) {
|
|
24
21
|
if (props === void 0) {
|
|
25
22
|
props = {};
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
var _props = props,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
componentIds = _props.componentIds,
|
|
26
|
+
excludeComponentIds = _props.excludeComponentIds;
|
|
32
27
|
if (componentIds) {
|
|
33
28
|
if (typeof componentIds === 'string') {
|
|
34
29
|
var _ref;
|
|
35
|
-
|
|
36
30
|
return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
if (Array.isArray(componentIds) && componentIds.length) {
|
|
40
33
|
var _filteredState = {};
|
|
41
34
|
componentIds.forEach(function (componentId) {
|
|
@@ -44,22 +37,18 @@ var filterByComponentIds = function filterByComponentIds(state, props) {
|
|
|
44
37
|
return _filteredState;
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
var filteredState = {};
|
|
49
|
-
|
|
50
41
|
if (!props.includeInternalComponents) {
|
|
51
42
|
Object.keys(state).forEach(function (componentId) {
|
|
52
43
|
if (componentId.endsWith('internal') || componentId.endsWith('active') || componentId.endsWith('timestamp')) {
|
|
53
44
|
return;
|
|
54
45
|
}
|
|
55
|
-
|
|
56
46
|
filteredState[componentId] = state[componentId];
|
|
57
47
|
});
|
|
58
48
|
} else {
|
|
59
49
|
filteredState = state;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
}
|
|
51
|
+
// Apply exclude component ids
|
|
63
52
|
if (excludeComponentIds) {
|
|
64
53
|
if (typeof excludeComponentIds === 'string') {
|
|
65
54
|
Object.keys(state).forEach(function (componentId) {
|
|
@@ -69,7 +58,6 @@ var filterByComponentIds = function filterByComponentIds(state, props) {
|
|
|
69
58
|
}
|
|
70
59
|
});
|
|
71
60
|
}
|
|
72
|
-
|
|
73
61
|
if (Array.isArray(excludeComponentIds) && excludeComponentIds.length) {
|
|
74
62
|
Object.keys(state).forEach(function (componentId) {
|
|
75
63
|
if (excludeComponentIds.includes(componentId)) {
|
|
@@ -79,14 +67,11 @@ var filterByComponentIds = function filterByComponentIds(state, props) {
|
|
|
79
67
|
});
|
|
80
68
|
}
|
|
81
69
|
}
|
|
82
|
-
|
|
83
70
|
return filteredState;
|
|
84
71
|
};
|
|
85
|
-
|
|
86
72
|
var filterByKeys = function filterByKeys(state, allowedKeys) {
|
|
87
73
|
return Object.keys(state).reduce(function (components, componentId) {
|
|
88
74
|
var _extends2;
|
|
89
|
-
|
|
90
75
|
return _extends({}, components, (_extends2 = {}, _extends2[componentId] = Object.keys(state[componentId]).filter(function (key) {
|
|
91
76
|
return allowedKeys.includes(key);
|
|
92
77
|
}).reduce(function (obj, key) {
|
|
@@ -96,7 +81,6 @@ var filterByKeys = function filterByKeys(state, allowedKeys) {
|
|
|
96
81
|
}, {}), _extends2));
|
|
97
82
|
}, {});
|
|
98
83
|
};
|
|
99
|
-
|
|
100
84
|
var StateProvider = {
|
|
101
85
|
name: 'StateProvider',
|
|
102
86
|
props: {
|
|
@@ -197,7 +181,6 @@ var StateProvider = {
|
|
|
197
181
|
if (valuesMap === void 0) {
|
|
198
182
|
valuesMap = {};
|
|
199
183
|
}
|
|
200
|
-
|
|
201
184
|
var components = this.components;
|
|
202
185
|
var computedValuesMap = {};
|
|
203
186
|
components.filter(function (component) {
|
|
@@ -221,7 +204,6 @@ var StateProvider = {
|
|
|
221
204
|
}) : null;
|
|
222
205
|
}
|
|
223
206
|
};
|
|
224
|
-
|
|
225
207
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
226
208
|
return {
|
|
227
209
|
selectedValues: filterByComponentIds(state.selectedValues, props),
|
|
@@ -239,12 +221,10 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
239
221
|
components: state.components
|
|
240
222
|
};
|
|
241
223
|
};
|
|
242
|
-
|
|
243
224
|
var mapDispatchtoProps = {
|
|
244
225
|
setValues: setValues
|
|
245
226
|
};
|
|
246
227
|
var StateProviderConnected = connect(mapStateToProps, mapDispatchtoProps)(StateProvider);
|
|
247
|
-
|
|
248
228
|
StateProvider.install = function (Vue) {
|
|
249
229
|
Vue.component(StateProvider.name, StateProviderConnected);
|
|
250
230
|
};
|