@appbaseio/reactivesearch-vue 1.24.3 → 1.27.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 (63) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +679 -314
  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/{ComponentWrapper-32481890.js → ComponentWrapper-10bad289.js} +1 -1
  7. package/dist/cjs/DataSearch.js +33 -84
  8. package/dist/cjs/{DropDown-6815b9b6.js → DropDown-7aa3d0d2.js} +65 -23
  9. package/dist/cjs/DynamicRangeSlider.js +48 -12
  10. package/dist/cjs/MultiDropdownList.js +18 -10
  11. package/dist/cjs/MultiList.js +21 -15
  12. package/dist/cjs/MultiRange.js +4 -4
  13. package/dist/cjs/RangeInput.js +9 -5
  14. package/dist/cjs/RangeSlider.js +19 -22
  15. package/dist/cjs/ReactiveBase.js +6 -4
  16. package/dist/cjs/ReactiveComponent.js +3 -3
  17. package/dist/cjs/ReactiveList.js +61 -44
  18. package/dist/cjs/ResultCard.js +1 -1
  19. package/dist/cjs/ResultList.js +1 -1
  20. package/dist/cjs/SelectedFilters.js +8 -6
  21. package/dist/cjs/SingleDropdownList.js +17 -9
  22. package/dist/cjs/SingleList.js +9 -8
  23. package/dist/cjs/SingleRange.js +4 -4
  24. package/dist/cjs/StateProvider.js +7 -3
  25. package/dist/cjs/ToggleButton.js +5 -5
  26. package/dist/cjs/{index-89c39a9e.js → index-4509aa45.js} +10 -4
  27. package/dist/cjs/index.js +9 -6
  28. package/dist/cjs/initReactivesearch.js +19 -0
  29. package/dist/cjs/install.js +7 -6
  30. package/dist/cjs/ssr-0ee35a09.js +39 -0
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/cjs/{vueTypes-4c19b4c8.js → vueTypes-57d01f18.js} +3 -3
  33. package/dist/es/{DownShift-3558d402.js → CancelSvg-c2c03a35.js} +55 -16
  34. package/dist/es/{ComponentWrapper-4f85a67e.js → ComponentWrapper-0f3431d1.js} +1 -1
  35. package/dist/es/DataSearch.js +23 -74
  36. package/dist/es/{DropDown-035c804f.js → DropDown-60a426a2.js} +64 -22
  37. package/dist/es/DynamicRangeSlider.js +48 -12
  38. package/dist/es/MultiDropdownList.js +18 -10
  39. package/dist/es/MultiList.js +21 -15
  40. package/dist/es/MultiRange.js +4 -4
  41. package/dist/es/RangeInput.js +9 -5
  42. package/dist/es/RangeSlider.js +19 -22
  43. package/dist/es/ReactiveBase.js +6 -4
  44. package/dist/es/ReactiveComponent.js +3 -3
  45. package/dist/es/ReactiveList.js +61 -44
  46. package/dist/es/ResultCard.js +1 -1
  47. package/dist/es/ResultList.js +1 -1
  48. package/dist/es/SelectedFilters.js +8 -6
  49. package/dist/es/SingleDropdownList.js +17 -9
  50. package/dist/es/SingleList.js +9 -8
  51. package/dist/es/SingleRange.js +4 -4
  52. package/dist/es/StateProvider.js +7 -3
  53. package/dist/es/ToggleButton.js +5 -5
  54. package/dist/es/{index-cb1950b6.js → index-78920565.js} +10 -4
  55. package/dist/es/index.js +9 -6
  56. package/dist/es/initReactivesearch.js +19 -0
  57. package/dist/es/install.js +7 -6
  58. package/dist/es/ssr-a41dfea9.js +33 -0
  59. package/dist/es/version.js +1 -1
  60. package/dist/es/{vueTypes-fb61bb7b.js → vueTypes-687b2304.js} +3 -3
  61. package/package.json +4 -4
  62. package/dist/cjs/ssr-08e95ede.js +0 -39
  63. package/dist/es/ssr-5d255b08.js +0 -33
@@ -7,11 +7,11 @@ 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
- import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-cb1950b6.js';
14
- import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
13
+ import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-78920565.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
15
15
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
16
16
  import './Title-3522ff56.js';
17
17
  import { c as container } from './ListItem-8e8fb535.js';
@@ -486,9 +486,20 @@ 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
+
497
+ if (this.urlSortOption) {
498
+ this.sortOptionIndex = this.$props.sortOptions.findIndex(function (s) {
499
+ return s.label === _this.urlSortOption;
500
+ }) || 0;
501
+ }
502
+
492
503
  this.updateComponentProps(this.componentId, {
493
504
  from: this.from
494
505
  }, componentTypes.reactiveList);
@@ -498,7 +509,7 @@ var ReactiveList = {
498
509
  },
499
510
  props: {
500
511
  currentPage: VueTypes.number.def(0),
501
- includeFields: types.includeFields.def(['*']),
512
+ includeFields: types.includeFields,
502
513
  // component props
503
514
  className: types.string,
504
515
  componentId: types.stringRequired,
@@ -507,7 +518,7 @@ var ReactiveList = {
507
518
  aggregationSize: VueTypes.number,
508
519
  defaultQuery: types.func,
509
520
  defaultSortOption: types.string,
510
- excludeFields: types.excludeFields.def([]),
521
+ excludeFields: types.excludeFields,
511
522
  innerClass: types.style,
512
523
  listClass: VueTypes.string.def(''),
513
524
  loader: types.title,
@@ -519,7 +530,7 @@ var ReactiveList = {
519
530
  pages: VueTypes.number.def(5),
520
531
  pagination: VueTypes.bool.def(false),
521
532
  infiniteScroll: VueTypes.bool.def(true),
522
- paginationAt: types.paginationAt.def('bottom'),
533
+ paginationAt: VueTypes.oneOf(['top', 'bottom', 'both']).def('bottom'),
523
534
  react: types.react,
524
535
  scrollOnChange: VueTypes.bool.def(true),
525
536
  showResultStats: VueTypes.bool.def(true),
@@ -720,11 +731,11 @@ var ReactiveList = {
720
731
  var options = getQueryOptions(this.$props);
721
732
  options.from = this.$data.from;
722
733
 
723
- if (this.$props.sortOptions) {
734
+ if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
724
735
  var _ref2;
725
736
 
726
- var sortField = this.$props.sortOptions[this.sortOptionIndex].dataField;
727
- var sortBy = this.$props.sortOptions[this.sortOptionIndex].sortBy;
737
+ var sortField = this.sortOptions[this.sortOptionIndex].dataField;
738
+ var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
728
739
  options.sort = [(_ref2 = {}, _ref2[sortField] = {
729
740
  order: sortBy
730
741
  }, _ref2)]; // To handle sort options for RS API
@@ -794,10 +805,10 @@ var ReactiveList = {
794
805
  "class": this.$props.className
795
806
  }, [this.isLoading && this.shouldRenderPagination && this.showInfiniteScroll && (this.$scopedSlots.loader || this.$props.loader), this.renderErrorComponent(), h(Flex, {
796
807
  "attrs": {
797
- "labelPosition": this.$props.sortOptions ? 'right' : 'left'
808
+ "labelPosition": this.sortOptions ? 'right' : 'left'
798
809
  },
799
810
  "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, {
811
+ }, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && hits && hits.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
801
812
  "attrs": {
802
813
  "pages": this.$props.pages,
803
814
  "totalPages": this.totalPages,
@@ -868,15 +879,18 @@ var ReactiveList = {
868
879
  var options = getQueryOptions(props);
869
880
  options.from = this.$data.from;
870
881
 
871
- if (props.sortOptions) {
872
- var _ref5;
873
-
882
+ if (props.sortOptions && Array.isArray(props.sortOptions)) {
874
883
  var sortOptionIndex = props.defaultSortOption ? props.sortOptions.findIndex(function (s) {
875
884
  return s.label === props.defaultSortOption;
876
885
  }) : 0;
877
- options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
878
- order: props.sortOptions[sortOptionIndex].sortBy
879
- }, _ref5)];
886
+
887
+ if (props.sortOptions[sortOptionIndex]) {
888
+ var _ref5;
889
+
890
+ options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
891
+ order: props.sortOptions[sortOptionIndex].sortBy
892
+ }, _ref5)];
893
+ }
880
894
  } else if (props.sortBy) {
881
895
  var _ref6;
882
896
 
@@ -982,26 +996,32 @@ var ReactiveList = {
982
996
  }, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
983
997
  },
984
998
  handleSortChange: function handleSortChange(e) {
985
- var _ref7;
999
+ var index = e.target.value;
986
1000
 
987
- var index = e.target.value; // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
1001
+ if (this.sortOptions && this.sortOptions[index]) {
1002
+ var _ref7;
988
1003
 
989
- var options = getQueryOptions(this.$props);
990
- options.from = 0;
991
- var sortField = this.$props.sortOptions[index].dataField;
992
- var sortBy = this.$props.sortOptions[index].sortBy;
993
- options.sort = [(_ref7 = {}, _ref7[sortField] = {
994
- order: sortBy
995
- }, _ref7)];
996
- this.sortOptionIndex = index; // To handle sort options for RS API
997
-
998
- this.updateComponentProps(this.componentId, {
999
- dataField: sortField,
1000
- sortBy: sortBy
1001
- }, componentTypes.reactiveList);
1002
- this.setQueryOptions(this.$props.componentId, options, true);
1003
- this.currentPageState = 0;
1004
- this.from = 0;
1004
+ // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
1005
+ var options = getQueryOptions(this.$props);
1006
+ options.from = 0;
1007
+ var sortField = this.sortOptions[index].dataField;
1008
+ var sortBy = this.sortOptions[index].sortBy;
1009
+ options.sort = [(_ref7 = {}, _ref7[sortField] = {
1010
+ order: sortBy
1011
+ }, _ref7)];
1012
+ this.sortOptionIndex = index; // To handle sort options for RS API
1013
+
1014
+ this.updateComponentProps(this.componentId, {
1015
+ dataField: sortField,
1016
+ sortBy: sortBy
1017
+ }, componentTypes.reactiveList);
1018
+ this.setQueryOptions(this.$props.componentId, options, true);
1019
+ this.setPage(0);
1020
+ this.currentPageState = 0;
1021
+ this.from = 0;
1022
+ var sortOption = this.$props.sortOptions[this.sortOptionIndex] ? this.$props.sortOptions[this.sortOptionIndex].label : null;
1023
+ this.setPageURL(this.$props.componentId + "sortOption", sortOption, this.$props.componentId + "sortOption", false, this.$props.URLParams);
1024
+ }
1005
1025
  },
1006
1026
  triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1007
1027
  var docId = documentId;
@@ -1035,7 +1055,7 @@ var ReactiveList = {
1035
1055
  "domProps": {
1036
1056
  "value": this.sortOptionIndex
1037
1057
  }
1038
- }, [this.$props.sortOptions.map(function (sort, index) {
1058
+ }, [this.sortOptions.map(function (sort, index) {
1039
1059
  return h("option", {
1040
1060
  "key": sort.label,
1041
1061
  "domProps": {
@@ -1112,6 +1132,7 @@ var ReactiveList = {
1112
1132
  var mapStateToProps = function mapStateToProps(state, props) {
1113
1133
  return {
1114
1134
  defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
1135
+ urlSortOption: state.selectedValues[props.componentId + "sortOption"] && state.selectedValues[props.componentId + "sortOption"].value,
1115
1136
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
1116
1137
  rawData: state.rawData[props.componentId],
1117
1138
  aggregationData: state.compositeAggregations[props.componentId],
@@ -1141,11 +1162,7 @@ var mapDispatchtoProps = {
1141
1162
  }; // Only used for SSR
1142
1163
 
1143
1164
  ReactiveList.generateQueryOptions = function (props) {
1144
- // simulate default (includeFields and excludeFields) props to generate consistent query
1145
- var options = getQueryOptions(_extends({
1146
- includeFields: ['*'],
1147
- excludeFields: []
1148
- }, props));
1165
+ var options = getQueryOptions(props);
1149
1166
  var size = props.size,
1150
1167
  dataField = props.dataField,
1151
1168
  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,9 +6,9 @@ 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
- import { c as connect } from './index-cb1950b6.js';
11
+ import { c as connect } from './index-78920565.js';
12
12
  import { T as Title } from './Title-3522ff56.js';
13
13
  import { C as Container } from './Container-18b03fde.js';
14
14
 
@@ -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,20 @@ 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
- 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
- import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
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-78920565.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
14
+ import '@vue/babel-helper-vue-jsx-merge-props';
14
15
  import { T as Title } from './Title-3522ff56.js';
16
+ import './CancelSvg-c2c03a35.js';
15
17
  import './Input-08bb1bcf.js';
16
18
  import 'compute-scroll-into-view';
17
- import './DownShift-3558d402.js';
18
19
  import { C as Container } from './Container-18b03fde.js';
20
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
19
21
  import { g as getAggsQuery } from './utils-64a2e5f0.js';
20
- import { D as Dropdown } from './DropDown-035c804f.js';
22
+ import { D as Dropdown } from './DropDown-60a426a2.js';
21
23
 
22
24
  var updateQuery = Actions.updateQuery,
23
25
  setQueryOptions = Actions.setQueryOptions,
@@ -73,10 +75,12 @@ var SingleDropdownList = {
73
75
  showMissing: VueTypes.bool.def(false),
74
76
  missingLabel: VueTypes.string.def('N/A'),
75
77
  showSearch: VueTypes.bool.def(false),
78
+ showClear: VueTypes.bool.def(false),
76
79
  showLoadMore: VueTypes.bool.def(false),
77
80
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
78
81
  nestedField: types.string,
79
- index: VueTypes.string
82
+ index: VueTypes.string,
83
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
80
84
  },
81
85
  created: function created() {
82
86
  if (!this.enableAppbase && this.$props.index) {
@@ -190,7 +194,9 @@ var SingleDropdownList = {
190
194
  if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
191
195
  if (renderNoResults && isFunction(renderNoResults)) {
192
196
  return h("div", [renderNoResults()]);
193
- } else if (renderNoResults && !isFunction(renderNoResults)) {
197
+ }
198
+
199
+ if (renderNoResults && !isFunction(renderNoResults)) {
194
200
  return renderNoResults;
195
201
  }
196
202
 
@@ -228,6 +234,8 @@ var SingleDropdownList = {
228
234
  "renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
229
235
  "themePreset": this.themePreset,
230
236
  "showSearch": this.$props.showSearch,
237
+ "showClear": this.$props.showClear,
238
+ "searchPlaceholder": this.$props.searchPlaceholder,
231
239
  "transformData": this.$props.transformData,
232
240
  "footer": showLoadMore && !isLastBucket && h("div", {
233
241
  "attrs": {
@@ -287,7 +295,7 @@ var SingleDropdownList = {
287
295
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
288
296
  }
289
297
 
290
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
298
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
291
299
  this.updateQuery({
292
300
  componentId: this.internalComponent,
293
301
  query: query,
@@ -308,7 +316,7 @@ var SingleDropdownList = {
308
316
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
309
317
  }
310
318
 
311
- this.setQueryOptions(props.componentId, customQueryOptions);
319
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
312
320
  this.updateQuery({
313
321
  componentId: props.componentId,
314
322
  query: query,
@@ -5,14 +5,15 @@ 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
- 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';
12
- import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
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-78920565.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.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,11 +5,11 @@ 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
- import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-cb1950b6.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
11
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-78920565.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
13
13
  import { T as Title } from './Title-3522ff56.js';
14
14
  import { C as Container } from './Container-18b03fde.js';
15
15
  import { U as UL, R as Radio } from './FormControlList-704f8dee.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,
@@ -3,12 +3,16 @@ import { a as _extends } from './_rollupPluginBabelHelpers-0f24d612.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import 'redux';
6
- import { c as connect } from './index-cb1950b6.js';
6
+ import { c as connect } from './index-78920565.js';
7
7
 
8
8
  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,11 +6,11 @@ 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
- import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-cb1950b6.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-4f85a67e.js';
12
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-78920565.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
14
14
  import { T as Title } from './Title-3522ff56.js';
15
15
  import { C as Container } from './Container-18b03fde.js';
16
16
 
@@ -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
 
@@ -155,10 +155,16 @@ var isFunction = function isFunction(element) {
155
155
  }; // parses current array (i.e. this.$props.value) for `onChange` callback for multi-* components
156
156
 
157
157
  function parseValueArray(objectValues, currentValue) {
158
- var keys = Object.keys(objectValues);
159
- var selectedValues = keys.map(function (key) {
160
- return objectValues[key] ? key : null;
161
- });
158
+ var selectedValues;
159
+
160
+ if (Array.isArray(objectValues)) {
161
+ selectedValues = [].concat(objectValues);
162
+ } else {
163
+ var keys = Object.keys(objectValues);
164
+ selectedValues = keys.map(function (key) {
165
+ return objectValues[key] ? key : null;
166
+ });
167
+ }
162
168
 
163
169
  if (selectedValues.includes(currentValue)) {
164
170
  return selectedValues.filter(function (item) {
package/dist/es/index.js CHANGED
@@ -7,12 +7,12 @@ import 'emotion';
7
7
  import '@appbaseio/vue-emotion';
8
8
  import 'polished';
9
9
  import './Button-91561391.js';
10
- import './vueTypes-fb61bb7b.js';
10
+ import './vueTypes-687b2304.js';
11
11
  export { default as ReactiveList } from './ReactiveList.js';
12
12
  import '@appbaseio/reactivecore/lib/utils/transform';
13
13
  import 'redux';
14
- import './index-cb1950b6.js';
15
- import './ComponentWrapper-4f85a67e.js';
14
+ import './index-78920565.js';
15
+ import './ComponentWrapper-0f3431d1.js';
16
16
  import '@vue/babel-helper-vue-jsx-merge-props';
17
17
  import './Title-3522ff56.js';
18
18
  import './ListItem-8e8fb535.js';
@@ -24,16 +24,17 @@ import 'url-search-params-polyfill';
24
24
  export { default as ReactiveBase } from './ReactiveBase.js';
25
25
  import 'hotkeys-js';
26
26
  export { default as DataSearch } from './DataSearch.js';
27
+ import './CancelSvg-c2c03a35.js';
27
28
  import './Input-08bb1bcf.js';
28
29
  import 'compute-scroll-into-view';
29
- import './DownShift-3558d402.js';
30
30
  import './Container-18b03fde.js';
31
31
  import 'vue-highlight-words';
32
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
32
33
  import './FormControlList-704f8dee.js';
33
34
  import './utils-64a2e5f0.js';
34
35
  export { default as SingleList } from './SingleList.js';
35
36
  export { default as MultiList } from './MultiList.js';
36
- import './DropDown-035c804f.js';
37
+ import './DropDown-60a426a2.js';
37
38
  export { default as SingleDropdownList } from './SingleDropdownList.js';
38
39
  export { default as MultiDropdownList } from './MultiDropdownList.js';
39
40
  export { default as ToggleButton } from './ToggleButton.js';
@@ -44,13 +45,15 @@ export { default as MultiRange } from './MultiRange.js';
44
45
  export { default as ResultCard } from './ResultCard.js';
45
46
  export { default as ResultList } from './ResultList.js';
46
47
  import 'vue-no-ssr';
47
- import './ssr-5d255b08.js';
48
+ import './ssr-a41dfea9.js';
48
49
  export { default as RangeSlider } from './RangeSlider.js';
49
50
  export { default as DynamicRangeSlider } from './DynamicRangeSlider.js';
50
51
  export { default as StateProvider } from './StateProvider.js';
51
52
  import '@appbaseio/reactivecore/lib/reducers/valueReducer';
52
53
  import '@appbaseio/reactivecore/lib/reducers/queryReducer';
53
54
  import '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
55
+ import '@appbaseio/reactivecore/lib/reducers/compositeAggsReducer';
56
+ import '@appbaseio/reactivecore/lib/constants';
54
57
  import '@appbaseio/reactivecore/lib/reducers/dependencyTreeReducer';
55
58
  import '@appbaseio/reactivecore/lib/utils/graphQL';
56
59
  import '@appbaseio/reactivecore/lib/actions/utils';
@@ -6,6 +6,8 @@ import Appbase from 'appbase-js';
6
6
  import valueReducer from '@appbaseio/reactivecore/lib/reducers/valueReducer';
7
7
  import queryReducer from '@appbaseio/reactivecore/lib/reducers/queryReducer';
8
8
  import queryOptionsReducer from '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
9
+ import compositeAggsReducer from '@appbaseio/reactivecore/lib/reducers/compositeAggsReducer';
10
+ import { UPDATE_COMPOSITE_AGGS } from '@appbaseio/reactivecore/lib/constants';
9
11
  import dependencyTreeReducer from '@appbaseio/reactivecore/lib/reducers/dependencyTreeReducer';
10
12
  import fetchGraphQL from '@appbaseio/reactivecore/lib/utils/graphQL';
11
13
  import { isPropertyDefined } from '@appbaseio/reactivecore/lib/actions/utils';
@@ -102,6 +104,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
102
104
  var orderOfQueries = [];
103
105
  var hits = {};
104
106
  var aggregations = {};
107
+ var compositeAggregations = {};
105
108
  var state = {};
106
109
  var customQueries = {};
107
110
  var defaultQueries = {};
@@ -336,6 +339,11 @@ function initReactivesearch(componentCollection, searchState, settings) {
336
339
  var _extends4;
337
340
 
338
341
  aggregations = _extends({}, aggregations, (_extends4 = {}, _extends4[component] = response.aggregations, _extends4));
342
+ compositeAggregations = compositeAggsReducer(compositeAggregations, {
343
+ type: UPDATE_COMPOSITE_AGGS,
344
+ aggregations: response.aggregations,
345
+ append: false
346
+ });
339
347
  }
340
348
 
341
349
  hits = _extends({}, hits, (_extends5 = {}, _extends5[component] = {
@@ -362,6 +370,8 @@ function initReactivesearch(componentCollection, searchState, settings) {
362
370
  var promotedResults = {};
363
371
  var rawData = {};
364
372
  var customData = {};
373
+ var settingsResponse = {};
374
+ var timestamp = {};
365
375
  var allPromises = orderOfQueries.map(function (component) {
366
376
  return new Promise(function (responseResolve, responseReject) {
367
377
  handleTransformResponse(res[component], component).then(function (response) {
@@ -380,6 +390,11 @@ function initReactivesearch(componentCollection, searchState, settings) {
380
390
 
381
391
  if (response.customData) {
382
392
  customData[component] = response.customData;
393
+ } // Update settings
394
+
395
+
396
+ if (response.settings) {
397
+ settingsResponse[component] = response.settings;
383
398
  }
384
399
 
385
400
  if (response.aggregations) {
@@ -388,6 +403,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
388
403
  aggregations = _extends({}, aggregations, (_extends6 = {}, _extends6[component] = response.aggregations, _extends6));
389
404
  }
390
405
 
406
+ timestamp[component] = res._timestamp;
391
407
  hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
392
408
  hits: response.hits.hits,
393
409
  total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
@@ -403,8 +419,11 @@ function initReactivesearch(componentCollection, searchState, settings) {
403
419
  Promise.all(allPromises).then(function () {
404
420
  state = _extends({}, state, {
405
421
  hits: hits,
422
+ timestamp: timestamp,
406
423
  aggregations: aggregations,
424
+ compositeAggregations: compositeAggregations,
407
425
  promotedResults: promotedResults,
426
+ settings: settingsResponse,
408
427
  customData: customData,
409
428
  rawData: rawData
410
429
  });