@appbaseio/reactivesearch-vue 1.16.0-alpha.6 → 1.16.0-alpha.62

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.
Files changed (105) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +16030 -13113
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-446f819e.js +68 -0
  6. package/dist/cjs/{DownShift-966a58cb.js → CancelSvg-9f258f4f.js} +60 -16
  7. package/dist/cjs/Card-642547a8.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-603848ed.js → ComponentWrapper-ad3dad02.js} +40 -21
  9. package/dist/cjs/{Container-6cdd3864.js → Container-daf30918.js} +3 -11
  10. package/dist/cjs/DataSearch-86914b10.js +2322 -0
  11. package/dist/cjs/DataSearch.js +18 -2151
  12. package/dist/cjs/{DropDown-f6224ac8.js → DropDown-5513ea77.js} +80 -95
  13. package/dist/cjs/DynamicRangeSlider.js +107 -43
  14. package/dist/cjs/Flex-aa517a13.js +52 -0
  15. package/dist/cjs/FormControlList-c195a592.js +47 -0
  16. package/dist/cjs/Input-e6603a7e.js +79 -0
  17. package/dist/cjs/ListItem-8c9e0d68.js +46 -0
  18. package/dist/cjs/MultiDropdownList.js +102 -68
  19. package/dist/cjs/MultiList.js +80 -50
  20. package/dist/cjs/MultiRange.js +21 -16
  21. package/dist/cjs/{Pagination-af399262.js → Pagination-fe5452fc.js} +14 -8
  22. package/dist/cjs/RangeInput.js +29 -45
  23. package/dist/cjs/RangeSlider.js +32 -30
  24. package/dist/cjs/ReactiveBase.js +87 -56
  25. package/dist/cjs/ReactiveComponent.js +75 -62
  26. package/dist/cjs/ReactiveGoogleMap.js +262 -191
  27. package/dist/cjs/ReactiveList.js +189 -241
  28. package/dist/cjs/ResultCard.js +8 -6
  29. package/dist/cjs/ResultList.js +8 -6
  30. package/dist/cjs/SelectedFilters.js +66 -34
  31. package/dist/cjs/SingleDropdownList.js +88 -60
  32. package/dist/cjs/SingleList.js +53 -35
  33. package/dist/cjs/SingleRange.js +19 -14
  34. package/dist/cjs/StateProvider.js +39 -10
  35. package/dist/cjs/{Title-65d39104.js → Title-1de7d0f4.js} +3 -11
  36. package/dist/cjs/ToggleButton.js +36 -16
  37. package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
  38. package/dist/cjs/{index-baca18c4.js → index-6a167fe0.js} +99 -13
  39. package/dist/cjs/index.js +31 -25
  40. package/dist/cjs/initReactivesearch.js +178 -104
  41. package/dist/cjs/install-004c6aa4.js +1408 -0
  42. package/dist/cjs/install.js +42 -44
  43. package/dist/cjs/ssr-3027b848.js +39 -0
  44. package/dist/cjs/{utils-ea846a20.js → utils-d6a52588.js} +2 -2
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
  47. package/dist/es/Button-d8bc15ea.js +59 -0
  48. package/dist/es/{DownShift-92347b5e.js → CancelSvg-4cfae5fd.js} +56 -17
  49. package/dist/es/Card-450683f1.js +23 -0
  50. package/dist/es/{ComponentWrapper-c4c91949.js → ComponentWrapper-424e86fd.js} +40 -21
  51. package/dist/es/Container-ba826e96.js +10 -0
  52. package/dist/es/DataSearch-e71a1014.js +2307 -0
  53. package/dist/es/DataSearch.js +17 -2150
  54. package/dist/es/{DropDown-3d4291f1.js → DropDown-7d9a15c1.js} +79 -94
  55. package/dist/es/DynamicRangeSlider.js +107 -43
  56. package/dist/es/Flex-1f0795c3.js +47 -0
  57. package/dist/es/FormControlList-c22d64f6.js +40 -0
  58. package/dist/es/Input-7a2a9fac.js +71 -0
  59. package/dist/es/ListItem-cad14c5e.js +39 -0
  60. package/dist/es/MultiDropdownList.js +102 -68
  61. package/dist/es/MultiList.js +80 -50
  62. package/dist/es/MultiRange.js +21 -16
  63. package/dist/es/{Pagination-c2a00175.js → Pagination-3f350098.js} +14 -8
  64. package/dist/es/RangeInput.js +29 -45
  65. package/dist/es/RangeSlider.js +32 -30
  66. package/dist/es/ReactiveBase.js +87 -56
  67. package/dist/es/ReactiveComponent.js +75 -62
  68. package/dist/es/ReactiveGoogleMap.js +262 -191
  69. package/dist/es/ReactiveList.js +189 -241
  70. package/dist/es/ResultCard.js +8 -6
  71. package/dist/es/ResultList.js +8 -6
  72. package/dist/es/SelectedFilters.js +66 -34
  73. package/dist/es/SingleDropdownList.js +88 -60
  74. package/dist/es/SingleList.js +53 -35
  75. package/dist/es/SingleRange.js +19 -14
  76. package/dist/es/StateProvider.js +39 -10
  77. package/dist/es/Title-3342664a.js +10 -0
  78. package/dist/es/ToggleButton.js +36 -16
  79. package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
  80. package/dist/es/{index-185b6266.js → index-7788a843.js} +95 -14
  81. package/dist/es/index.js +27 -22
  82. package/dist/es/initReactivesearch.js +179 -105
  83. package/dist/es/install-b7b604cc.js +1401 -0
  84. package/dist/es/install.js +40 -46
  85. package/dist/es/ssr-b2c0b401.js +33 -0
  86. package/dist/es/{utils-57cc8789.js → utils-9e68acee.js} +2 -2
  87. package/dist/es/version.js +1 -1
  88. package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
  89. package/package.json +6 -4
  90. package/dist/cjs/Button-d48d4365.js +0 -146
  91. package/dist/cjs/Card-9748fbb2.js +0 -58
  92. package/dist/cjs/Flex-befd65fc.js +0 -160
  93. package/dist/cjs/FormControlList-f3857d4b.js +0 -105
  94. package/dist/cjs/Input-95cb19f8.js +0 -178
  95. package/dist/cjs/ListItem-84d185cf.js +0 -84
  96. package/dist/cjs/ssr-3ca8a14f.js +0 -47
  97. package/dist/es/Button-27cc8574.js +0 -137
  98. package/dist/es/Card-1f93780d.js +0 -51
  99. package/dist/es/Container-88c805ef.js +0 -18
  100. package/dist/es/Flex-16d1103a.js +0 -155
  101. package/dist/es/FormControlList-96d44e7b.js +0 -98
  102. package/dist/es/Input-1159c4b5.js +0 -170
  103. package/dist/es/ListItem-d22510c9.js +0 -77
  104. package/dist/es/Title-f0217338.js +0 -18
  105. package/dist/es/ssr-a710392b.js +0 -41
@@ -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-ecf6c03c.js';
2
+ import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-76660dab.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-98d938a9.js';
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, l as isEvent, p as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-185b6266.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-c4c91949.js';
13
- import { T as Title } from './Title-f0217338.js';
14
- import { I as Input } from './Input-1159c4b5.js';
15
- import { C as Container } from './Container-88c805ef.js';
16
- import { U as UL, C as Checkbox } from './FormControlList-96d44e7b.js';
17
- import { g as getAggsQuery } from './utils-57cc8789.js';
11
+ import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as isEvent, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-7788a843.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
13
+ import { T as Title } from './Title-3342664a.js';
14
+ import { I as Input } from './Input-7a2a9fac.js';
15
+ import { C as Container } from './Container-ba826e96.js';
16
+ import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
17
+ import { U as UL, C as Checkbox } from './FormControlList-c22d64f6.js';
18
+ import { g as getAggsQuery } from './utils-9e68acee.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
- getOptionsFromQuery = helper.getOptionsFromQuery;
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: types.string.def(''),
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.def(100),
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: props.options && props.options[props.dataField] ? props.options[props.dataField].buckets : [],
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
- // Set custom and default queries in store
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.selectedValue) {
81
- this.setValue(this.selectedValue);
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
- this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
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.setValue(newVal || [], true);
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
- return null;
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;
@@ -320,22 +340,22 @@ var MultiList = {
320
340
  checkValueChange(props.componentId, finalValues, props.beforeValueChange, performUpdate);
321
341
  },
322
342
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
323
- var defaultQueryOptions;
324
343
  var query = MultiList.defaultQuery(value, props);
325
344
 
326
345
  if (this.defaultQuery) {
327
346
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
347
+ var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
328
348
 
329
- if (defaultQueryToBeSet.query) {
330
- query = defaultQueryToBeSet.query;
331
- }
349
+ if (defaultQueryObj) {
350
+ query = defaultQueryObj;
351
+ } // Update calculated default query in store
332
352
 
333
- defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
334
353
 
335
354
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
355
+ var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
356
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
336
357
  }
337
358
 
338
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
339
359
  this.updateQuery({
340
360
  componentId: this.internalComponent,
341
361
  query: query,
@@ -346,17 +366,15 @@ var MultiList = {
346
366
  updateQueryHandler: function updateQueryHandler(value, props) {
347
367
  var customQuery = props.customQuery;
348
368
  var query = MultiList.defaultQuery(value, props);
349
- var customQueryOptions;
350
369
 
351
370
  if (customQuery) {
352
- var _ref = customQuery(value, props) || {};
353
-
354
- query = _ref.query;
355
- customQueryOptions = getOptionsFromQuery(customQuery(value, props));
371
+ var customQueryCalc = customQuery(value, props);
372
+ query = extractQueryFromCustomQuery(customQueryCalc);
356
373
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
374
+ var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
375
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
357
376
  }
358
377
 
359
- this.setQueryOptions(props.componentId, customQueryOptions);
360
378
  this.updateQuery({
361
379
  componentId: props.componentId,
362
380
  query: query,
@@ -376,8 +394,8 @@ var MultiList = {
376
394
 
377
395
  if (props.defaultQuery) {
378
396
  var value = Object.keys(this.$data.currentValue);
379
- var defaultQueryOptions = getOptionsFromQuery(props.defaultQuery(value, props));
380
- this.setQueryOptions(this.internalComponent, _extends(_extends({}, queryOptions), defaultQueryOptions));
397
+ var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
398
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
381
399
  } else {
382
400
  this.setQueryOptions(this.internalComponent, queryOptions);
383
401
  }
@@ -420,7 +438,7 @@ var MultiList = {
420
438
  if (value === undefined) {
421
439
  this.setValue(currentValue);
422
440
  } else {
423
- var values = parseValueArray(value, currentValue);
441
+ var values = parseValueArray(value || [], currentValue);
424
442
  this.$emit('change', values);
425
443
  }
426
444
  },
@@ -462,7 +480,13 @@ var MultiList = {
462
480
 
463
481
  MultiList.defaultQuery = function (value, props) {
464
482
  var query = null;
465
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
483
+ var queryFormat = props.queryFormat;
484
+
485
+ if (queryFormat === undefined) {
486
+ queryFormat = 'or';
487
+ }
488
+
489
+ var type = queryFormat === 'or' ? 'terms' : 'term';
466
490
 
467
491
  if (!Array.isArray(value) || value.length === 0) {
468
492
  return null;
@@ -483,14 +507,14 @@ MultiList.defaultQuery = function (value, props) {
483
507
  } else if (value) {
484
508
  var listQuery;
485
509
 
486
- if (props.queryFormat === 'or') {
510
+ if (queryFormat === 'or') {
487
511
  if (props.showMissing) {
488
- var _type, _ref2;
512
+ var _type, _ref;
489
513
 
490
514
  var hasMissingTerm = value.includes(props.missingLabel);
491
- var should = [(_ref2 = {}, _ref2[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
515
+ var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
492
516
  return item !== props.missingLabel;
493
- }), _type), _ref2)];
517
+ }), _type), _ref)];
494
518
 
495
519
  if (hasMissingTerm) {
496
520
  should = should.concat({
@@ -517,9 +541,9 @@ MultiList.defaultQuery = function (value, props) {
517
541
  } else {
518
542
  // adds a sub-query with must as an array of objects for each term/value
519
543
  var queryArray = value.map(function (item) {
520
- var _type3, _ref3;
544
+ var _type3, _ref2;
521
545
 
522
- return _ref3 = {}, _ref3[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref3;
546
+ return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
523
547
  });
524
548
  listQuery = {
525
549
  bool: {
@@ -558,7 +582,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
558
582
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
559
583
  themePreset: state.config.themePreset,
560
584
  error: state.error[props.componentId],
561
- componentProps: state.props[props.componentId]
585
+ componentProps: state.props[props.componentId],
586
+ enableAppbase: state.config.enableAppbase
562
587
  };
563
588
  };
564
589
 
@@ -568,9 +593,14 @@ var mapDispatchtoProps = {
568
593
  setCustomQuery: setCustomQuery,
569
594
  setDefaultQuery: setDefaultQuery
570
595
  };
596
+
597
+ MultiList.hasInternalComponent = function () {
598
+ return true;
599
+ };
600
+
571
601
  var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(MultiList), {
572
602
  componentType: componentTypes.multiList,
573
- internalComponent: true
603
+ internalComponent: MultiList.hasInternalComponent()
574
604
  });
575
605
 
576
606
  MultiList.install = function (Vue) {
@@ -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-ecf6c03c.js';
2
+ import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-76660dab.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-98d938a9.js';
8
+ import { t as types } from './vueTypes-9326e0be.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
- import { p as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-185b6266.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-c4c91949.js';
13
- import { T as Title } from './Title-f0217338.js';
14
- import { C as Container } from './Container-88c805ef.js';
15
- import { U as UL, C as Checkbox } from './FormControlList-96d44e7b.js';
11
+ import { q as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
13
+ import { T as Title } from './Title-3342664a.js';
14
+ import { C as Container } from './Container-ba826e96.js';
15
+ import { U as UL, C as Checkbox } from './FormControlList-c22d64f6.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(_extends({}, selectedValues), values);
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(_extends({}, selectedValues), {}, (_extends2 = {}, _extends2[item] = true, _extends2));
115
+ selectedValues = _extends({}, selectedValues, (_extends2 = {}, _extends2[typeof item === 'object' ? item.label : item] = true, _extends2));
115
116
  }
116
117
 
117
118
  var performUpdate = function performUpdate() {
@@ -130,17 +131,16 @@ var MultiRange = {
130
131
  updateQueryHandler: function updateQueryHandler(value, props) {
131
132
  var customQuery = props.customQuery;
132
133
  var query = MultiRange.defaultQuery(value, props);
133
- var customQueryOptions;
134
134
 
135
135
  if (customQuery) {
136
136
  var _ref = customQuery(value, props) || {};
137
137
 
138
138
  query = _ref.query;
139
- customQueryOptions = getOptionsFromQuery(customQuery(value, props));
139
+ var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
140
140
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
141
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
141
142
  }
142
143
 
143
- this.setQueryOptions(props.componentId, customQueryOptions);
144
144
  this.updateQuery({
145
145
  componentId: props.componentId,
146
146
  query: query,
@@ -166,7 +166,7 @@ var MultiRange = {
166
166
  },
167
167
  selectedValue: function selectedValue(newVal) {
168
168
  if (!isEqual(this.$data.currentValue, newVal)) {
169
- this.selectItem(newVal);
169
+ this.selectItem(newVal, true, undefined, true);
170
170
  }
171
171
  },
172
172
  customQuery: function customQuery(newVal, oldVal) {
@@ -176,7 +176,11 @@ var MultiRange = {
176
176
  }
177
177
  },
178
178
  created: function created() {
179
- // Set custom query in store
179
+ if (!this.enableAppbase && this.$props.index) {
180
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
181
+ } // Set custom query in store
182
+
183
+
180
184
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
181
185
  },
182
186
  beforeMount: function beforeMount() {
@@ -282,7 +286,8 @@ MultiRange.defaultQuery = function (values, props) {
282
286
  var mapStateToProps = function mapStateToProps(state, props) {
283
287
  return {
284
288
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
285
- componentProps: state.props[props.componentId]
289
+ componentProps: state.props[props.componentId],
290
+ enableAppbase: state.config.enableAppbase
286
291
  };
287
292
  };
288
293
 
@@ -1,6 +1,7 @@
1
1
  import { helper } from '@appbaseio/reactivecore';
2
- import { p as pagination, B as Button } from './Button-27cc8574.js';
3
- import { t as types } from './vueTypes-98d938a9.js';
2
+ import VueTypes from 'vue-types';
3
+ import { p as pagination, B as Button } from './Button-d8bc15ea.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: types.bool,
24
+ showEndPage: VueTypes.bool,
24
25
  prevLabel: types.string,
25
26
  nextLabel: types.string
26
27
  },
@@ -56,6 +57,7 @@ var Pagination = {
56
57
  showEndPage = props.showEndPage;
57
58
  var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
58
59
  var paginationButtons = [];
60
+ var endPage = start;
59
61
 
60
62
  if (start <= totalPages) {
61
63
  var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
@@ -93,6 +95,10 @@ var Pagination = {
93
95
 
94
96
  if (i <= totalPages + 1) {
95
97
  paginationButtons.push(pageBtn);
98
+
99
+ if (i === Math.min(totalPages + 1, totalPagesToShow) - 1) {
100
+ endPage = i;
101
+ }
96
102
  }
97
103
  };
98
104
 
@@ -101,7 +107,7 @@ var Pagination = {
101
107
  }
102
108
  }
103
109
 
104
- return paginationButtons;
110
+ return [paginationButtons, start, endPage];
105
111
  };
106
112
 
107
113
  var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
@@ -109,10 +115,10 @@ var Pagination = {
109
115
  currentPage = props.currentPage,
110
116
  totalPages = props.totalPages,
111
117
  pages = props.pages;
112
- if (!showEndPage) return buildPaginationDOM('start');
118
+ if (!showEndPage) return buildPaginationDOM('start')[0];
113
119
 
114
- if (currentPage <= totalPages - pages + 2 || totalPages <= pages) {
115
- return buildPaginationDOM('start');
120
+ if (currentPage <= totalPages - pages + 2 || totalPages < pages) {
121
+ return buildPaginationDOM('start')[0];
116
122
  }
117
123
 
118
124
  return null;
@@ -148,7 +154,7 @@ var Pagination = {
148
154
  return props.setPage(0);
149
155
  }
150
156
  }
151
- }, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end'), h(Button, {
157
+ }, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) && buildPaginationDOM('start')[1] !== 2 ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) && buildPaginationDOM('start')[2] !== buildPaginationDOM('end')[1] - 1 ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end')[0], h(Button, {
152
158
  "class": getClassName(props.innerClass, 'button') || '',
153
159
  "attrs": {
154
160
  "disabled": props.currentPage >= props.totalPages - 1,
@@ -1,55 +1,35 @@
1
1
  import { helper } from '@appbaseio/reactivecore';
2
- import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-76660dab.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-98d938a9.js';
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-185b6266.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-c4c91949.js';
13
- import './Title-f0217338.js';
14
- import { F as Flex } from './Flex-16d1103a.js';
15
- import { I as Input } from './Input-1159c4b5.js';
16
- import { C as Container } from './Container-88c805ef.js';
11
+ import { c as connect } from './index-7788a843.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
13
+ import './Title-3342664a.js';
14
+ import { F as Flex } from './Flex-1f0795c3.js';
15
+ import { I as Input } from './Input-7a2a9fac.js';
16
+ import { C as Container } from './Container-ba826e96.js';
17
17
  import 'vue-no-ssr';
18
- import './ssr-a710392b.js';
18
+ import './ssr-b2c0b401.js';
19
19
  import { RangeConnected as RangeConnected$1 } from './RangeSlider.js';
20
20
 
21
- function _templateObject2() {
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 checkValueChange = helper.checkValueChange,
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: types.bool,
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
- value = {
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({}, value);
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({}, value);
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
- if (name === 'start' && !this.$data.isStartValid) {
177
- this.$data.isStartValid = true;
178
- } else if (name === 'end' && !this.$data.isEndValid) {
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, props) {
321
+ var mapStateToProps = function mapStateToProps(state) {
338
322
  return {
339
323
  themePreset: state.config.themePreset
340
324
  };