@appbaseio/reactivesearch-vue 1.24.2 → 1.26.0

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 (59) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +481 -279
  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/{DownShift-62e82255.js → CancelSvg-4aa35935.js} +58 -14
  6. package/dist/cjs/DataSearch.js +31 -82
  7. package/dist/cjs/{DropDown-6815b9b6.js → DropDown-cf9bfffc.js} +60 -23
  8. package/dist/cjs/DynamicRangeSlider.js +9 -6
  9. package/dist/cjs/MultiDropdownList.js +14 -7
  10. package/dist/cjs/MultiList.js +6 -5
  11. package/dist/cjs/MultiRange.js +2 -2
  12. package/dist/cjs/RangeInput.js +3 -3
  13. package/dist/cjs/RangeSlider.js +17 -20
  14. package/dist/cjs/ReactiveBase.js +5 -3
  15. package/dist/cjs/ReactiveComponent.js +12 -12
  16. package/dist/cjs/ReactiveList.js +54 -42
  17. package/dist/cjs/ResultCard.js +1 -1
  18. package/dist/cjs/ResultList.js +1 -1
  19. package/dist/cjs/SelectedFilters.js +7 -5
  20. package/dist/cjs/SingleDropdownList.js +14 -7
  21. package/dist/cjs/SingleList.js +7 -6
  22. package/dist/cjs/SingleRange.js +2 -2
  23. package/dist/cjs/StateProvider.js +6 -2
  24. package/dist/cjs/ToggleButton.js +3 -3
  25. package/dist/cjs/index.js +7 -4
  26. package/dist/cjs/initReactivesearch.js +31 -12
  27. package/dist/cjs/install.js +5 -4
  28. package/dist/cjs/ssr-0ee35a09.js +39 -0
  29. package/dist/cjs/version.js +1 -1
  30. package/dist/cjs/{vueTypes-4c19b4c8.js → vueTypes-57d01f18.js} +3 -3
  31. package/dist/es/{DownShift-3558d402.js → CancelSvg-c2c03a35.js} +55 -16
  32. package/dist/es/DataSearch.js +21 -72
  33. package/dist/es/{DropDown-035c804f.js → DropDown-c8da0a2c.js} +59 -22
  34. package/dist/es/DynamicRangeSlider.js +9 -6
  35. package/dist/es/MultiDropdownList.js +14 -7
  36. package/dist/es/MultiList.js +6 -5
  37. package/dist/es/MultiRange.js +2 -2
  38. package/dist/es/RangeInput.js +3 -3
  39. package/dist/es/RangeSlider.js +17 -20
  40. package/dist/es/ReactiveBase.js +5 -3
  41. package/dist/es/ReactiveComponent.js +12 -12
  42. package/dist/es/ReactiveList.js +54 -42
  43. package/dist/es/ResultCard.js +1 -1
  44. package/dist/es/ResultList.js +1 -1
  45. package/dist/es/SelectedFilters.js +7 -5
  46. package/dist/es/SingleDropdownList.js +14 -7
  47. package/dist/es/SingleList.js +7 -6
  48. package/dist/es/SingleRange.js +2 -2
  49. package/dist/es/StateProvider.js +6 -2
  50. package/dist/es/ToggleButton.js +3 -3
  51. package/dist/es/index.js +7 -4
  52. package/dist/es/initReactivesearch.js +31 -12
  53. package/dist/es/install.js +5 -4
  54. package/dist/es/ssr-a41dfea9.js +33 -0
  55. package/dist/es/version.js +1 -1
  56. package/dist/es/{vueTypes-fb61bb7b.js → vueTypes-687b2304.js} +3 -3
  57. package/package.json +3 -3
  58. package/dist/cjs/ssr-08e95ede.js +0 -39
  59. package/dist/es/ssr-5d255b08.js +0 -33
@@ -3,7 +3,7 @@ import { a as _extends } from './_rollupPluginBabelHelpers-0f24d612.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import '@appbaseio/vue-emotion';
6
- import { t as types } from './vueTypes-fb61bb7b.js';
6
+ import { t as types } from './vueTypes-687b2304.js';
7
7
  import '@appbaseio/reactivecore/lib/utils/transform';
8
8
  import 'redux';
9
9
  import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-cb1950b6.js';
@@ -11,7 +11,7 @@ import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
11
11
  import { T as Title } from './Title-3522ff56.js';
12
12
  import { C as Container } from './Container-18b03fde.js';
13
13
  import NoSSR from 'vue-no-ssr';
14
- import { g as getComponents, S as Slider } from './ssr-5d255b08.js';
14
+ import { g as getComponents, S as Slider } from './ssr-a41dfea9.js';
15
15
 
16
16
  var updateQuery = Actions.updateQuery,
17
17
  setQueryOptions = Actions.setQueryOptions,
@@ -73,32 +73,28 @@ var RangeSlider = {
73
73
  });
74
74
  }
75
75
  },
76
- handleSlider: function handleSlider(values) {
77
- var _this = this;
78
-
79
- clearTimeout(this.handleSliderChange._tId);
80
- this.handleSliderChange._tId = setTimeout(function () {
81
- _this.handleSliderChange(values);
82
- }, 100);
76
+ handleSlider: function handleSlider() {
77
+ var sliderValues = this.$refs.slider.getValue();
78
+ this.handleSliderChange(sliderValues);
83
79
  },
84
80
  handleChange: function handleChange(currentValue, props) {
85
- var _this2 = this;
81
+ var _this = this;
86
82
 
87
83
  if (props === void 0) {
88
84
  props = this.$props;
89
85
  }
90
86
 
91
87
  var performUpdate = function performUpdate() {
92
- _this2.currentValue = currentValue;
88
+ _this.currentValue = currentValue;
93
89
 
94
- _this2.updateQueryHandler([currentValue[0], currentValue[1]], props);
90
+ _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
95
91
 
96
- _this2.$emit('valueChange', {
92
+ _this.$emit('valueChange', {
97
93
  start: currentValue[0],
98
94
  end: currentValue[1]
99
95
  });
100
96
 
101
- _this2.$emit('value-change', {
97
+ _this.$emit('value-change', {
102
98
  start: currentValue[0],
103
99
  end: currentValue[1]
104
100
  });
@@ -130,7 +126,7 @@ var RangeSlider = {
130
126
  currentEnd = value[1]; // check if the slider is at its initial position
131
127
 
132
128
  var isInitialValue = currentStart === start && currentEnd === end;
133
- this.setQueryOptions(props.componentId, customQueryOptions);
129
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
134
130
  this.updateQuery({
135
131
  componentId: props.componentId,
136
132
  query: query,
@@ -209,12 +205,13 @@ var RangeSlider = {
209
205
  "max": this.$props.range.end,
210
206
  "dotSize": 20,
211
207
  "height": 4,
212
- "enable-cross": false
208
+ "enable-cross": false,
209
+ "tooltip": "always"
210
+ },
211
+ "on": {
212
+ "drag-end": this.handleSlider
213
213
  },
214
- "props": _extends({}, this.$props.sliderOptions),
215
- "on": _extends({}, {
216
- input: this.handleSlider
217
- })
214
+ "props": _extends({}, this.$props.sliderOptions)
218
215
  }), this.$props.rangeLabels && h("div", {
219
216
  "class": "label-container"
220
217
  }, [h("label", {
@@ -4,7 +4,7 @@ import VueTypes from 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import { isEqual as isEqual$1 } from '@appbaseio/reactivecore/lib/utils/helper';
6
6
  import styled from '@appbaseio/vue-emotion';
7
- import { t as types } from './vueTypes-fb61bb7b.js';
7
+ import { t as types } from './vueTypes-687b2304.js';
8
8
  import 'redux';
9
9
  import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-cb1950b6.js';
10
10
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
@@ -77,7 +77,7 @@ var URLParamsProvider = {
77
77
  headers: types.headers,
78
78
  getSearchParams: types.func,
79
79
  setSearchParams: types.func,
80
- as: types.string.def('div')
80
+ as: VueTypes.string.def('div')
81
81
  },
82
82
  mounted: function mounted() {
83
83
  var _this = this;
@@ -225,7 +225,9 @@ var URLParamsProvider = {
225
225
  return value.map(function (item) {
226
226
  return _this3.getValue(item);
227
227
  });
228
- } else if (value && typeof value === 'object') {
228
+ }
229
+
230
+ if (value && typeof value === 'object') {
229
231
  // TODO: support for NestedList
230
232
  if (value.location) return value;
231
233
  if (value.category) return value;
@@ -2,7 +2,7 @@ import { Actions, helper } from '@appbaseio/reactivecore';
2
2
  import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-0f24d612.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
- import { t as types } from './vueTypes-fb61bb7b.js';
5
+ import { t as types } from './vueTypes-687b2304.js';
6
6
  import '@appbaseio/reactivecore/lib/utils/transform';
7
7
  import 'redux';
8
8
  import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-cb1950b6.js';
@@ -45,7 +45,7 @@ var ReactiveComponent = {
45
45
  this.internalComponent = null;
46
46
  this.$defaultQuery = null; // Set custom query in store
47
47
 
48
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
48
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
49
49
  var customQuery = props.customQuery,
50
50
  componentId = props.componentId,
51
51
  filterLabel = props.filterLabel,
@@ -68,7 +68,7 @@ var ReactiveComponent = {
68
68
  }
69
69
 
70
70
  if (customQuery) {
71
- var calcCustomQuery = customQuery(props);
71
+ var calcCustomQuery = customQuery(this.selectedValue, props);
72
72
 
73
73
  var _ref = calcCustomQuery || {},
74
74
  query = _ref.query;
@@ -87,7 +87,7 @@ var ReactiveComponent = {
87
87
 
88
88
  this.updateQuery({
89
89
  componentId: componentId,
90
- queryToSet: queryToSet,
90
+ query: queryToSet,
91
91
  value: this.selectedValue || null,
92
92
  label: filterLabel,
93
93
  showFilter: showFilter,
@@ -138,8 +138,8 @@ var ReactiveComponent = {
138
138
  },
139
139
  beforeMount: function beforeMount() {
140
140
  if (this.internalComponent && this.$props.defaultQuery) {
141
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
142
- this.$defaultQuery = this.$props.defaultQuery();
141
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
142
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
143
143
 
144
144
  var _ref3 = this.$defaultQuery || {},
145
145
  query = _ref3.query,
@@ -203,8 +203,8 @@ var ReactiveComponent = {
203
203
  }
204
204
  },
205
205
  defaultQuery: function defaultQuery(newVal, oldVal) {
206
- if (newVal && !isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
207
- this.$defaultQuery = newVal();
206
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
207
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
208
208
 
209
209
  var _ref4 = this.$defaultQuery || {},
210
210
  query = _ref4.query,
@@ -215,7 +215,7 @@ var ReactiveComponent = {
215
215
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
216
216
 
217
217
 
218
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
218
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
219
219
  var queryToSet = query || null;
220
220
 
221
221
  if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
@@ -229,9 +229,9 @@ var ReactiveComponent = {
229
229
  }
230
230
  },
231
231
  customQuery: function customQuery(newVal, oldVal) {
232
- if (newVal && !isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
232
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
233
233
  var componentId = this.$props.componentId;
234
- this.$customQuery = newVal(this.$props);
234
+ this.$customQuery = newVal(this.selectedValue, this.$props);
235
235
 
236
236
  var _ref5 = this.$customQuery || {},
237
237
  query = _ref5.query,
@@ -242,7 +242,7 @@ var ReactiveComponent = {
242
242
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
243
243
 
244
244
 
245
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
245
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
246
246
  var queryToSet = query || null;
247
247
 
248
248
  if (this.$customQuery && this.$customQuery.id) {
@@ -7,7 +7,7 @@ import { css } from 'emotion';
7
7
  import styled from '@appbaseio/vue-emotion';
8
8
  import 'polished';
9
9
  import { p as pagination, B as Button } from './Button-91561391.js';
10
- import { t as types } from './vueTypes-fb61bb7b.js';
10
+ import { t as types } from './vueTypes-687b2304.js';
11
11
  import '@appbaseio/reactivecore/lib/utils/transform';
12
12
  import 'redux';
13
13
  import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-cb1950b6.js';
@@ -486,9 +486,14 @@ var ReactiveList = {
486
486
  }
487
487
 
488
488
  this.internalComponent = this.$props.componentId + "__internal";
489
- this.sortOptionIndex = this.defaultSortOption ? this.sortOptions.findIndex(function (s) {
490
- return s.label === _this.defaultSortOption;
491
- }) : 0;
489
+ this.sortOptionIndex = 0;
490
+
491
+ if (this.defaultSortOption && this.sortOptions && Array.isArray(this.sortOptions)) {
492
+ this.sortOptionIndex = this.sortOptions.findIndex(function (s) {
493
+ return s.label === _this.defaultSortOption;
494
+ });
495
+ }
496
+
492
497
  this.updateComponentProps(this.componentId, {
493
498
  from: this.from
494
499
  }, componentTypes.reactiveList);
@@ -498,7 +503,7 @@ var ReactiveList = {
498
503
  },
499
504
  props: {
500
505
  currentPage: VueTypes.number.def(0),
501
- includeFields: types.includeFields.def(['*']),
506
+ includeFields: types.includeFields,
502
507
  // component props
503
508
  className: types.string,
504
509
  componentId: types.stringRequired,
@@ -507,7 +512,7 @@ var ReactiveList = {
507
512
  aggregationSize: VueTypes.number,
508
513
  defaultQuery: types.func,
509
514
  defaultSortOption: types.string,
510
- excludeFields: types.excludeFields.def([]),
515
+ excludeFields: types.excludeFields,
511
516
  innerClass: types.style,
512
517
  listClass: VueTypes.string.def(''),
513
518
  loader: types.title,
@@ -519,7 +524,7 @@ var ReactiveList = {
519
524
  pages: VueTypes.number.def(5),
520
525
  pagination: VueTypes.bool.def(false),
521
526
  infiniteScroll: VueTypes.bool.def(true),
522
- paginationAt: types.paginationAt.def('bottom'),
527
+ paginationAt: VueTypes.oneOf(['top', 'bottom', 'both']).def('bottom'),
523
528
  react: types.react,
524
529
  scrollOnChange: VueTypes.bool.def(true),
525
530
  showResultStats: VueTypes.bool.def(true),
@@ -720,11 +725,11 @@ var ReactiveList = {
720
725
  var options = getQueryOptions(this.$props);
721
726
  options.from = this.$data.from;
722
727
 
723
- if (this.$props.sortOptions) {
728
+ if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
724
729
  var _ref2;
725
730
 
726
- var sortField = this.$props.sortOptions[this.sortOptionIndex].dataField;
727
- var sortBy = this.$props.sortOptions[this.sortOptionIndex].sortBy;
731
+ var sortField = this.sortOptions[this.sortOptionIndex].dataField;
732
+ var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
728
733
  options.sort = [(_ref2 = {}, _ref2[sortField] = {
729
734
  order: sortBy
730
735
  }, _ref2)]; // To handle sort options for RS API
@@ -794,10 +799,10 @@ var ReactiveList = {
794
799
  "class": this.$props.className
795
800
  }, [this.isLoading && this.shouldRenderPagination && this.showInfiniteScroll && (this.$scopedSlots.loader || this.$props.loader), this.renderErrorComponent(), h(Flex, {
796
801
  "attrs": {
797
- "labelPosition": this.$props.sortOptions ? 'right' : 'left'
802
+ "labelPosition": this.sortOptions ? 'right' : 'left'
798
803
  },
799
804
  "class": getClassName$1(this.$props.innerClass, 'resultsInfo')
800
- }, [this.$props.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && results.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
805
+ }, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && results.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
801
806
  "attrs": {
802
807
  "pages": this.$props.pages,
803
808
  "totalPages": this.totalPages,
@@ -868,15 +873,18 @@ var ReactiveList = {
868
873
  var options = getQueryOptions(props);
869
874
  options.from = this.$data.from;
870
875
 
871
- if (props.sortOptions) {
872
- var _ref5;
873
-
876
+ if (props.sortOptions && Array.isArray(props.sortOptions)) {
874
877
  var sortOptionIndex = props.defaultSortOption ? props.sortOptions.findIndex(function (s) {
875
878
  return s.label === props.defaultSortOption;
876
879
  }) : 0;
877
- options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
878
- order: props.sortOptions[sortOptionIndex].sortBy
879
- }, _ref5)];
880
+
881
+ if (props.sortOptions[sortOptionIndex]) {
882
+ var _ref5;
883
+
884
+ options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
885
+ order: props.sortOptions[sortOptionIndex].sortBy
886
+ }, _ref5)];
887
+ }
880
888
  } else if (props.sortBy) {
881
889
  var _ref6;
882
890
 
@@ -972,31 +980,39 @@ var ReactiveList = {
972
980
  renderNoResult: function renderNoResult() {
973
981
  var h = this.$createElement;
974
982
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
983
+
984
+ if (this.$scopedSlots.renderNoResults) {
985
+ return isFunction(renderNoResults) ? renderNoResults() : renderNoResults;
986
+ }
987
+
975
988
  return h("p", {
976
989
  "class": getClassName$1(this.$props.innerClass, 'noResults') || null
977
990
  }, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
978
991
  },
979
992
  handleSortChange: function handleSortChange(e) {
980
- var _ref7;
993
+ var index = e.target.value;
981
994
 
982
- var index = e.target.value; // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
995
+ if (this.sortOptions && this.sortOptions[index]) {
996
+ var _ref7;
983
997
 
984
- var options = getQueryOptions(this.$props);
985
- options.from = 0;
986
- var sortField = this.$props.sortOptions[index].dataField;
987
- var sortBy = this.$props.sortOptions[index].sortBy;
988
- options.sort = [(_ref7 = {}, _ref7[sortField] = {
989
- order: sortBy
990
- }, _ref7)];
991
- this.sortOptionIndex = index; // To handle sort options for RS API
992
-
993
- this.updateComponentProps(this.componentId, {
994
- dataField: sortField,
995
- sortBy: sortBy
996
- }, componentTypes.reactiveList);
997
- this.setQueryOptions(this.$props.componentId, options, true);
998
- this.currentPageState = 0;
999
- this.from = 0;
998
+ // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
999
+ var options = getQueryOptions(this.$props);
1000
+ options.from = 0;
1001
+ var sortField = this.sortOptions[index].dataField;
1002
+ var sortBy = this.sortOptions[index].sortBy;
1003
+ options.sort = [(_ref7 = {}, _ref7[sortField] = {
1004
+ order: sortBy
1005
+ }, _ref7)];
1006
+ this.sortOptionIndex = index; // To handle sort options for RS API
1007
+
1008
+ this.updateComponentProps(this.componentId, {
1009
+ dataField: sortField,
1010
+ sortBy: sortBy
1011
+ }, componentTypes.reactiveList);
1012
+ this.setQueryOptions(this.$props.componentId, options, true);
1013
+ this.currentPageState = 0;
1014
+ this.from = 0;
1015
+ }
1000
1016
  },
1001
1017
  triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1002
1018
  var docId = documentId;
@@ -1030,7 +1046,7 @@ var ReactiveList = {
1030
1046
  "domProps": {
1031
1047
  "value": this.sortOptionIndex
1032
1048
  }
1033
- }, [this.$props.sortOptions.map(function (sort, index) {
1049
+ }, [this.sortOptions.map(function (sort, index) {
1034
1050
  return h("option", {
1035
1051
  "key": sort.label,
1036
1052
  "domProps": {
@@ -1136,11 +1152,7 @@ var mapDispatchtoProps = {
1136
1152
  }; // Only used for SSR
1137
1153
 
1138
1154
  ReactiveList.generateQueryOptions = function (props) {
1139
- // simulate default (includeFields and excludeFields) props to generate consistent query
1140
- var options = getQueryOptions(_extends({
1141
- includeFields: ['*'],
1142
- excludeFields: []
1143
- }, props));
1155
+ var options = getQueryOptions(props);
1144
1156
  var size = props.size,
1145
1157
  dataField = props.dataField,
1146
1158
  defaultSortOption = props.defaultSortOption,
@@ -3,7 +3,7 @@ import VueTypes from 'vue-types';
3
3
  import 'emotion';
4
4
  import '@appbaseio/vue-emotion';
5
5
  import 'polished';
6
- import { t as types } from './vueTypes-fb61bb7b.js';
6
+ import { t as types } from './vueTypes-687b2304.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
8
  import { T as Title } from './Title-3522ff56.js';
9
9
  import { I as Image, C as Card } from './Card-6446f1b7.js';
@@ -3,7 +3,7 @@ import VueTypes from 'vue-types';
3
3
  import 'emotion';
4
4
  import '@appbaseio/vue-emotion';
5
5
  import 'polished';
6
- import { t as types } from './vueTypes-fb61bb7b.js';
6
+ import { t as types } from './vueTypes-687b2304.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
8
  import { T as Title } from './Title-3522ff56.js';
9
9
  import { I as Image, L as ListItem } from './ListItem-8e8fb535.js';
@@ -6,7 +6,7 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { f as filters, B as Button } from './Button-91561391.js';
9
- import { t as types } from './vueTypes-fb61bb7b.js';
9
+ import { t as types } from './vueTypes-687b2304.js';
10
10
  import 'redux';
11
11
  import { c as connect } from './index-cb1950b6.js';
12
12
  import { T as Title } from './Title-3522ff56.js';
@@ -25,7 +25,8 @@ var SelectedFilters = {
25
25
  innerClass: types.style,
26
26
  showClearAll: VueTypes.bool.def(true),
27
27
  title: types.title,
28
- resetToDefault: VueTypes.bool.def(false)
28
+ resetToDefault: VueTypes.bool.def(false),
29
+ resetToValues: VueTypes.object
29
30
  },
30
31
  inject: {
31
32
  theme: {
@@ -78,15 +79,16 @@ var SelectedFilters = {
78
79
  this.$emit('clear', component, value);
79
80
  },
80
81
  clearValues: function clearValues() {
81
- var resetToDefault = this.resetToDefault;
82
+ var resetToDefault = this.resetToDefault,
83
+ resetToValues = this.resetToValues;
82
84
 
83
85
  if (resetToDefault) {
84
86
  this.resetValuesToDefault();
85
87
  } else {
86
- this.clearValuesAction();
88
+ this.clearValuesAction(resetToValues);
87
89
  }
88
90
 
89
- this.$emit('clear', null);
91
+ this.$emit('clear', resetToValues);
90
92
  },
91
93
  renderValue: function renderValue(value, isArray) {
92
94
  var _this2 = this;
@@ -6,18 +6,19 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { l as loadMoreContainer, B as Button } from './Button-91561391.js';
9
- import { t as types } from './vueTypes-fb61bb7b.js';
9
+ import { t as types } from './vueTypes-687b2304.js';
10
10
  import '@appbaseio/reactivecore/lib/utils/transform';
11
11
  import 'redux';
12
12
  import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-cb1950b6.js';
13
13
  import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
14
14
  import { T as Title } from './Title-3522ff56.js';
15
+ import './CancelSvg-c2c03a35.js';
15
16
  import './Input-08bb1bcf.js';
16
17
  import 'compute-scroll-into-view';
17
- import './DownShift-3558d402.js';
18
18
  import { C as Container } from './Container-18b03fde.js';
19
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
19
20
  import { g as getAggsQuery } from './utils-64a2e5f0.js';
20
- import { D as Dropdown } from './DropDown-035c804f.js';
21
+ import { D as Dropdown } from './DropDown-c8da0a2c.js';
21
22
 
22
23
  var updateQuery = Actions.updateQuery,
23
24
  setQueryOptions = Actions.setQueryOptions,
@@ -73,10 +74,12 @@ var SingleDropdownList = {
73
74
  showMissing: VueTypes.bool.def(false),
74
75
  missingLabel: VueTypes.string.def('N/A'),
75
76
  showSearch: VueTypes.bool.def(false),
77
+ showClear: VueTypes.bool.def(false),
76
78
  showLoadMore: VueTypes.bool.def(false),
77
79
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
78
80
  nestedField: types.string,
79
- index: VueTypes.string
81
+ index: VueTypes.string,
82
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
80
83
  },
81
84
  created: function created() {
82
85
  if (!this.enableAppbase && this.$props.index) {
@@ -190,7 +193,9 @@ var SingleDropdownList = {
190
193
  if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
191
194
  if (renderNoResults && isFunction(renderNoResults)) {
192
195
  return h("div", [renderNoResults()]);
193
- } else if (renderNoResults && !isFunction(renderNoResults)) {
196
+ }
197
+
198
+ if (renderNoResults && !isFunction(renderNoResults)) {
194
199
  return renderNoResults;
195
200
  }
196
201
 
@@ -228,6 +233,8 @@ var SingleDropdownList = {
228
233
  "renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
229
234
  "themePreset": this.themePreset,
230
235
  "showSearch": this.$props.showSearch,
236
+ "showClear": this.$props.showClear,
237
+ "searchPlaceholder": this.$props.searchPlaceholder,
231
238
  "transformData": this.$props.transformData,
232
239
  "footer": showLoadMore && !isLastBucket && h("div", {
233
240
  "attrs": {
@@ -287,7 +294,7 @@ var SingleDropdownList = {
287
294
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
288
295
  }
289
296
 
290
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
297
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
291
298
  this.updateQuery({
292
299
  componentId: this.internalComponent,
293
300
  query: query,
@@ -308,7 +315,7 @@ var SingleDropdownList = {
308
315
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
309
316
  }
310
317
 
311
- this.setQueryOptions(props.componentId, customQueryOptions);
318
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
312
319
  this.updateQuery({
313
320
  componentId: props.componentId,
314
321
  query: query,
@@ -5,7 +5,7 @@ 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-fb61bb7b.js';
8
+ import { t as types } from './vueTypes-687b2304.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
11
  import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, n as isEvent, h as hasCustomRenderer, c as connect } from './index-cb1950b6.js';
@@ -13,6 +13,7 @@ import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
13
13
  import { T as Title } from './Title-3522ff56.js';
14
14
  import { I as Input } from './Input-08bb1bcf.js';
15
15
  import { C as Container } from './Container-18b03fde.js';
16
+ import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
16
17
  import { U as UL, R as Radio } from './FormControlList-704f8dee.js';
17
18
  import { g as getAggsQuery } from './utils-64a2e5f0.js';
18
19
 
@@ -29,7 +30,7 @@ var SingleList = {
29
30
  name: 'SingleList',
30
31
  props: {
31
32
  beforeValueChange: types.func,
32
- className: types.string.def(''),
33
+ className: VueTypes.string.def(''),
33
34
  componentId: types.stringRequired,
34
35
  customQuery: types.func,
35
36
  dataField: types.stringRequired,
@@ -49,7 +50,7 @@ var SingleList = {
49
50
  showFilter: VueTypes.bool.def(true),
50
51
  showRadio: VueTypes.bool.def(true),
51
52
  showSearch: VueTypes.bool.def(true),
52
- size: VueTypes.number.def(100),
53
+ size: VueTypes.number,
53
54
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
54
55
  title: types.title,
55
56
  URLParams: VueTypes.bool.def(false),
@@ -163,7 +164,7 @@ var SingleList = {
163
164
  var filteredItemsToRender = itemsToRender.filter(function (item) {
164
165
  if (String(item.key).length) {
165
166
  if (_this.$props.showSearch && _this.$data.searchTerm) {
166
- return String(item.key).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
167
+ return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
167
168
  }
168
169
 
169
170
  return true;
@@ -276,7 +277,7 @@ var SingleList = {
276
277
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
277
278
  }
278
279
 
279
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
280
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
280
281
  this.updateQuery({
281
282
  componentId: this.internalComponent,
282
283
  query: query,
@@ -297,7 +298,7 @@ var SingleList = {
297
298
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
298
299
  }
299
300
 
300
- this.setQueryOptions(props.componentId, customQueryOptions);
301
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
301
302
  this.updateQuery({
302
303
  componentId: props.componentId,
303
304
  query: query,
@@ -5,7 +5,7 @@ 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-fb61bb7b.js';
8
+ import { t as types } from './vueTypes-687b2304.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
11
  import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-cb1950b6.js';
@@ -160,7 +160,7 @@ var SingleRange = {
160
160
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
161
161
  }
162
162
 
163
- this.setQueryOptions(props.componentId, customQueryOptions);
163
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
164
164
  this.updateQuery({
165
165
  componentId: props.componentId,
166
166
  query: query,
@@ -9,6 +9,10 @@ var getSearchState = helper.getSearchState;
9
9
  var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
10
10
 
11
11
  var filterProps = function filterProps(props) {
12
+ if (props === void 0) {
13
+ props = {};
14
+ }
15
+
12
16
  return _extends({}, props, {
13
17
  props: props.componentProps
14
18
  });
@@ -28,7 +32,7 @@ var filterByComponentIds = function filterByComponentIds(state, props) {
28
32
  return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
29
33
  }
30
34
 
31
- if (componentIds instanceof Array) {
35
+ if (Array.isArray(componentIds)) {
32
36
  var filteredState = {};
33
37
  componentIds.forEach(function (componentId) {
34
38
  filteredState[componentId] = state[componentId];
@@ -67,7 +71,7 @@ var StateProvider = {
67
71
  };
68
72
  return this.__state;
69
73
  },
70
- mounted: function mounted() {
74
+ created: function created() {
71
75
  this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
72
76
  },
73
77
  computed: {
@@ -6,7 +6,7 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { B as Button, t as toggleButtons } from './Button-91561391.js';
9
- import { t as types } from './vueTypes-fb61bb7b.js';
9
+ import { t as types } from './vueTypes-687b2304.js';
10
10
  import '@appbaseio/reactivecore/lib/utils/transform';
11
11
  import 'redux';
12
12
  import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-cb1950b6.js';
@@ -28,7 +28,7 @@ var ToggleButton = {
28
28
  componentId: types.stringRequired,
29
29
  data: types.data,
30
30
  dataField: types.stringRequired,
31
- defaultValue: types.stringOrArray,
31
+ defaultValue: types.any,
32
32
  value: types.stringOrArray,
33
33
  filterLabel: types.string,
34
34
  nestedField: types.string,
@@ -186,7 +186,7 @@ var ToggleButton = {
186
186
  var _ref = customQuery(value, props) || {};
187
187
 
188
188
  query = _ref.query;
189
- this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)));
189
+ this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)), false);
190
190
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
191
191
  }
192
192