@appbaseio/reactivesearch-vue 1.16.0-alpha.23 → 1.16.0-alpha.27

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 (55) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +560 -259
  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/DataSearch.js +2 -2
  6. package/dist/cjs/{DropDown-d3c78c41.js → DropDown-3c343026.js} +5 -3
  7. package/dist/cjs/DynamicRangeSlider.js +1 -1
  8. package/dist/cjs/MultiDropdownList.js +3 -2
  9. package/dist/cjs/MultiList.js +3 -2
  10. package/dist/cjs/MultiRange.js +1 -1
  11. package/dist/cjs/{Pagination-d4dbfd5a.js → Pagination-0b9ec0fc.js} +1 -1
  12. package/dist/cjs/RangeInput.js +1 -1
  13. package/dist/cjs/RangeSlider.js +1 -1
  14. package/dist/cjs/ReactiveBase.js +14 -8
  15. package/dist/cjs/ReactiveComponent.js +12 -12
  16. package/dist/cjs/ReactiveGoogleMap.js +2 -2
  17. package/dist/cjs/ReactiveList.js +102 -87
  18. package/dist/cjs/ResultCard.js +1 -1
  19. package/dist/cjs/ResultList.js +1 -1
  20. package/dist/cjs/SelectedFilters.js +1 -1
  21. package/dist/cjs/SingleDropdownList.js +3 -2
  22. package/dist/cjs/SingleList.js +3 -2
  23. package/dist/cjs/SingleRange.js +1 -1
  24. package/dist/cjs/ToggleButton.js +2 -2
  25. package/dist/cjs/index.js +5 -4
  26. package/dist/cjs/initReactivesearch.js +15 -14
  27. package/dist/cjs/install.js +5 -4
  28. package/dist/cjs/version.js +1 -1
  29. package/dist/cjs/{vueTypes-409348b0.js → vueTypes-829a5f2c.js} +5 -1
  30. package/dist/es/DataSearch.js +2 -2
  31. package/dist/es/{DropDown-8894cc22.js → DropDown-c5ab660f.js} +5 -3
  32. package/dist/es/DynamicRangeSlider.js +1 -1
  33. package/dist/es/MultiDropdownList.js +3 -2
  34. package/dist/es/MultiList.js +3 -2
  35. package/dist/es/MultiRange.js +1 -1
  36. package/dist/es/{Pagination-a2ab7fcb.js → Pagination-e8216949.js} +1 -1
  37. package/dist/es/RangeInput.js +1 -1
  38. package/dist/es/RangeSlider.js +1 -1
  39. package/dist/es/ReactiveBase.js +14 -8
  40. package/dist/es/ReactiveComponent.js +12 -12
  41. package/dist/es/ReactiveGoogleMap.js +2 -2
  42. package/dist/es/ReactiveList.js +102 -87
  43. package/dist/es/ResultCard.js +1 -1
  44. package/dist/es/ResultList.js +1 -1
  45. package/dist/es/SelectedFilters.js +1 -1
  46. package/dist/es/SingleDropdownList.js +3 -2
  47. package/dist/es/SingleList.js +3 -2
  48. package/dist/es/SingleRange.js +1 -1
  49. package/dist/es/ToggleButton.js +2 -2
  50. package/dist/es/index.js +5 -4
  51. package/dist/es/initReactivesearch.js +15 -14
  52. package/dist/es/install.js +5 -4
  53. package/dist/es/version.js +1 -1
  54. package/dist/es/{vueTypes-a9b9d5c9.js → vueTypes-98819a12.js} +5 -1
  55. package/package.json +3 -3
@@ -2,12 +2,13 @@ import { Actions, helper } from '@appbaseio/reactivecore';
2
2
  import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
+ import { withClickIds } from '@appbaseio/reactivecore/lib/utils/helper';
5
6
  import { css } from 'emotion';
6
7
  import styled from '@appbaseio/vue-emotion';
7
8
  import 'polished';
8
9
  import './Button-799185e2.js';
9
- import { t as types } from './vueTypes-a9b9d5c9.js';
10
- import { P as Pagination } from './Pagination-a2ab7fcb.js';
10
+ import { t as types } from './vueTypes-98819a12.js';
11
+ import { P as Pagination } from './Pagination-e8216949.js';
11
12
  import '@appbaseio/reactivecore/lib/utils/transform';
12
13
  import 'redux';
13
14
  import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-4755c9a0.js';
@@ -273,18 +274,17 @@ var ReactiveList = {
273
274
  ResultCardsWrapper: ResultCardsWrapper
274
275
  },
275
276
  data: function data() {
276
- var props = this.$props;
277
277
  var currentPageState = 0;
278
+ var defaultPage = this.defaultPage || -1;
278
279
 
279
- if (props.defaultPage >= 0) {
280
- currentPageState = props.defaultPage;
281
- } else if (props.currentPage) {
282
- currentPageState = Math.max(props.currentPage - 1, 0);
280
+ if (defaultPage >= 0) {
281
+ currentPageState = defaultPage;
282
+ } else if (this.currentPage) {
283
+ currentPageState = Math.max(this.currentPage - 1, 0);
283
284
  }
284
285
 
285
286
  this.__state = {
286
- from: currentPageState * props.size,
287
- isLoading: true,
287
+ from: currentPageState * this.size,
288
288
  currentPageState: currentPageState
289
289
  };
290
290
  return this.__state;
@@ -313,15 +313,22 @@ var ReactiveList = {
313
313
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
314
314
  }
315
315
 
316
- if (this.defaultPage >= 0) {
317
- this.currentPageState = this.defaultPage;
316
+ var defaultPage = this.defaultPage || -1;
317
+
318
+ if (defaultPage >= 0) {
319
+ this.currentPageState = defaultPage;
318
320
  this.from = this.currentPageState * this.$props.size;
319
321
  }
320
322
 
321
323
  this.internalComponent = this.$props.componentId + "__internal";
322
- this.sortOptionIndex = this.defaultSortOption ? this.sortOptions.findIndex(function (s) {
323
- return s.label === _this.defaultSortOption;
324
- }) : 0;
324
+ this.sortOptionIndex = 0;
325
+
326
+ if (this.defaultSortOption && this.sortOptions && Array.isArray(this.sortOptions)) {
327
+ this.sortOptionIndex = this.sortOptions.findIndex(function (s) {
328
+ return s.label === _this.defaultSortOption;
329
+ });
330
+ }
331
+
325
332
  this.updateComponentProps(this.componentId, {
326
333
  from: this.from
327
334
  }, componentTypes.reactiveList);
@@ -381,12 +388,9 @@ var ReactiveList = {
381
388
  return this.$listeners && this.$listeners.resultStats;
382
389
  },
383
390
  stats: function stats() {
384
- var _this$getAllData = this.getAllData(),
385
- filteredResults = _this$getAllData.filteredResults;
386
-
387
391
  return _extends({}, getResultStats(this), {
388
392
  currentPage: this.currentPageState,
389
- displayedResults: filteredResults.length
393
+ displayedResults: this.data.length
390
394
  });
391
395
  },
392
396
  hasCustomRender: function hasCustomRender() {
@@ -395,6 +399,27 @@ var ReactiveList = {
395
399
  showInfiniteScroll: function showInfiniteScroll() {
396
400
  // Pagination has higher priority then infinite scroll
397
401
  return this.infiniteScroll && !this.shouldRenderPagination;
402
+ },
403
+ data: function data() {
404
+ var results = parseHits(this.hits) || [];
405
+ var parsedPromotedResults = parseHits(this.promotedResults) || [];
406
+ var filteredResults = results;
407
+
408
+ if (parsedPromotedResults.length) {
409
+ var ids = parsedPromotedResults.map(function (item) {
410
+ return item._id;
411
+ }).filter(Boolean);
412
+
413
+ if (ids) {
414
+ filteredResults = filteredResults.filter(function (item) {
415
+ return !ids.includes(item._id);
416
+ });
417
+ }
418
+
419
+ filteredResults = [].concat(parsedPromotedResults, filteredResults);
420
+ }
421
+
422
+ return withClickIds(filteredResults);
398
423
  }
399
424
  },
400
425
  watch: {
@@ -476,7 +501,7 @@ var ReactiveList = {
476
501
  }
477
502
  },
478
503
  hits: function hits(newVal, oldVal) {
479
- this.$emit('data', this.getAllData());
504
+ this.$emit('data', this.getData());
480
505
 
481
506
  if (this.shouldRenderPagination) {
482
507
  // called when page is changed
@@ -535,11 +560,11 @@ var ReactiveList = {
535
560
  var options = getQueryOptions(this.$props);
536
561
  options.from = this.$data.from;
537
562
 
538
- if (this.$props.sortOptions) {
563
+ if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
539
564
  var _ref2;
540
565
 
541
- var sortField = this.$props.sortOptions[this.sortOptionIndex].dataField;
542
- var sortBy = this.$props.sortOptions[this.sortOptionIndex].sortBy;
566
+ var sortField = this.sortOptions[this.sortOptionIndex].dataField;
567
+ var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
543
568
  options.sort = [(_ref2 = {}, _ref2[sortField] = {
544
569
  order: sortBy
545
570
  }, _ref2)]; // To handle sort options for RS API
@@ -609,10 +634,10 @@ var ReactiveList = {
609
634
  "class": this.$props.className
610
635
  }, [this.isLoading && this.shouldRenderPagination && this.showInfiniteScroll && (this.$scopedSlots.loader || this.$props.loader), this.renderErrorComponent(), h(Flex, {
611
636
  "attrs": {
612
- "labelPosition": this.$props.sortOptions ? 'right' : 'left'
637
+ "labelPosition": this.sortOptions ? 'right' : 'left'
613
638
  },
614
639
  "class": getClassName(this.$props.innerClass, 'resultsInfo')
615
- }, [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, {
640
+ }, [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, {
616
641
  "attrs": {
617
642
  "pages": this.$props.pages,
618
643
  "totalPages": this.totalPages,
@@ -661,13 +686,10 @@ var ReactiveList = {
661
686
 
662
687
  var h = this.$createElement;
663
688
  var size = this.$props.size;
664
- var hits = this.$data.hits;
665
- var results = parseHits(hits) || [];
666
- var filteredResults = results;
667
689
  var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
668
690
  var element = this.hasCustomRender ? this.getComponent() : h("div", {
669
691
  "class": this.$props.listClass + " " + getClassName(this.$props.innerClass, 'list')
670
- }, [[].concat(filteredResults).map(function (item, index) {
692
+ }, [this.data.map(function (item, index) {
671
693
  return renderItem({
672
694
  item: item,
673
695
  triggerClickAnalytics: function triggerClickAnalytics() {
@@ -678,7 +700,7 @@ var ReactiveList = {
678
700
 
679
701
  return this.analytics ? h(ImpressionTracker$1, {
680
702
  "attrs": {
681
- "hits": filteredResults
703
+ "hits": this.data
682
704
  }
683
705
  }, [element]) : element;
684
706
  },
@@ -686,15 +708,18 @@ var ReactiveList = {
686
708
  var options = getQueryOptions(props);
687
709
  options.from = this.$data.from;
688
710
 
689
- if (props.sortOptions) {
690
- var _ref5;
691
-
711
+ if (props.sortOptions && Array.isArray(props.sortOptions)) {
692
712
  var sortOptionIndex = props.defaultSortOption ? props.sortOptions.findIndex(function (s) {
693
713
  return s.label === props.defaultSortOption;
694
714
  }) : 0;
695
- options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
696
- order: props.sortOptions[sortOptionIndex].sortBy
697
- }, _ref5)];
715
+
716
+ if (props.sortOptions[sortOptionIndex]) {
717
+ var _ref5;
718
+
719
+ options.sort = [(_ref5 = {}, _ref5[props.sortOptions[sortOptionIndex].dataField] = {
720
+ order: props.sortOptions[sortOptionIndex].sortBy
721
+ }, _ref5)];
722
+ }
698
723
  } else if (props.sortBy) {
699
724
  var _ref6;
700
725
 
@@ -782,7 +807,7 @@ var ReactiveList = {
782
807
  if (this.stats.numberOfResults) {
783
808
  return h("p", {
784
809
  "class": resultStats + " " + getClassName(this.$props.innerClass, 'resultStats')
785
- }, [this.stats.numberOfResults, " results found in ", this.stats.time, "ms"]);
810
+ }, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
786
811
  }
787
812
 
788
813
  return null;
@@ -790,31 +815,39 @@ var ReactiveList = {
790
815
  renderNoResult: function renderNoResult() {
791
816
  var h = this.$createElement;
792
817
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
818
+
819
+ if (this.$scopedSlots.renderNoResults) {
820
+ return isFunction(renderNoResults) ? renderNoResults() : renderNoResults;
821
+ }
822
+
793
823
  return h("p", {
794
824
  "class": getClassName(this.$props.innerClass, 'noResults') || null
795
825
  }, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
796
826
  },
797
827
  handleSortChange: function handleSortChange(e) {
798
- var _ref7;
799
-
800
- var index = e.target.value; // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
828
+ var index = e.target.value;
801
829
 
802
- var options = getQueryOptions(this.$props);
803
- options.from = 0;
804
- var sortField = this.$props.sortOptions[index].dataField;
805
- var sortBy = this.$props.sortOptions[index].sortBy;
806
- options.sort = [(_ref7 = {}, _ref7[sortField] = {
807
- order: sortBy
808
- }, _ref7)];
809
- this.sortOptionIndex = index; // To handle sort options for RS API
830
+ if (this.sortOptions && this.sortOptions[index]) {
831
+ var _ref7;
810
832
 
811
- this.updateComponentProps(this.componentId, {
812
- dataField: sortField,
813
- sortBy: sortBy
814
- }, componentTypes.reactiveList);
815
- this.setQueryOptions(this.$props.componentId, options, true);
816
- this.currentPageState = 0;
817
- this.from = 0;
833
+ // This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
834
+ var options = getQueryOptions(this.$props);
835
+ options.from = 0;
836
+ var sortField = this.sortOptions[index].dataField;
837
+ var sortBy = this.sortOptions[index].sortBy;
838
+ options.sort = [(_ref7 = {}, _ref7[sortField] = {
839
+ order: sortBy
840
+ }, _ref7)];
841
+ this.sortOptionIndex = index; // To handle sort options for RS API
842
+
843
+ this.updateComponentProps(this.componentId, {
844
+ dataField: sortField,
845
+ sortBy: sortBy
846
+ }, componentTypes.reactiveList);
847
+ this.setQueryOptions(this.$props.componentId, options, true);
848
+ this.currentPageState = 0;
849
+ this.from = 0;
850
+ }
818
851
  },
819
852
  triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
820
853
  var docId = documentId;
@@ -848,7 +881,7 @@ var ReactiveList = {
848
881
  "domProps": {
849
882
  "value": this.sortOptionIndex
850
883
  }
851
- }, [this.$props.sortOptions.map(function (sort, index) {
884
+ }, [this.sortOptions.map(function (sort, index) {
852
885
  return h("option", {
853
886
  "key": sort.label,
854
887
  "domProps": {
@@ -858,8 +891,8 @@ var ReactiveList = {
858
891
  })]);
859
892
  },
860
893
  withClickIds: function withClickIds(results) {
861
- var _this$getAllData2 = this.getAllData(),
862
- base = _this$getAllData2.base;
894
+ var _this$getAllData = this.getAllData(),
895
+ base = _this$getAllData.base;
863
896
 
864
897
  return results.map(function (result, index) {
865
898
  return _extends({}, result, {
@@ -877,26 +910,9 @@ var ReactiveList = {
877
910
  hits = this.hits;
878
911
  var results = parseHits(hits) || [];
879
912
  var parsedPromotedResults = parseHits(promotedResults) || [];
880
- var filteredResults = results;
881
913
  var base = currentPage * size;
882
-
883
- if (parsedPromotedResults.length) {
884
- var ids = parsedPromotedResults.map(function (item) {
885
- return item._id;
886
- }).filter(Boolean);
887
-
888
- if (ids) {
889
- filteredResults = filteredResults.filter(function (item) {
890
- return !ids.includes(item._id);
891
- });
892
- }
893
-
894
- filteredResults = [].concat(parsedPromotedResults, filteredResults);
895
- }
896
-
897
914
  return {
898
915
  results: results,
899
- filteredResults: filteredResults,
900
916
  customData: customData || {},
901
917
  promotedResults: parsedPromotedResults,
902
918
  aggregationData: aggregationData,
@@ -906,16 +922,15 @@ var ReactiveList = {
906
922
  };
907
923
  },
908
924
  getData: function getData() {
909
- var _this$getAllData3 = this.getAllData(),
910
- filteredResults = _this$getAllData3.filteredResults,
911
- promotedResults = _this$getAllData3.promotedResults,
912
- aggregationData = _this$getAllData3.aggregationData,
913
- customData = _this$getAllData3.customData;
925
+ var _this$getAllData2 = this.getAllData(),
926
+ promotedResults = _this$getAllData2.promotedResults,
927
+ aggregationData = _this$getAllData2.aggregationData,
928
+ customData = _this$getAllData2.customData;
914
929
 
915
930
  return {
916
- data: this.withClickIds(filteredResults),
931
+ data: this.data,
917
932
  aggregationData: this.withClickIds(aggregationData || []),
918
- promotedData: this.withClickIds(promotedResults),
933
+ promotedData: this.withClickIds(promotedResults || []),
919
934
  rawData: this.rawData,
920
935
  resultStats: this.stats,
921
936
  customData: customData
@@ -927,7 +942,7 @@ var ReactiveList = {
927
942
 
928
943
  var data = _extends({
929
944
  error: error,
930
- loading: isLoading,
945
+ loading: isLoading || false,
931
946
  loadMore: this.loadMore,
932
947
  // TODO: Remove in v2
933
948
  triggerAnalytics: this.triggerClickAnalytics,
@@ -942,13 +957,13 @@ var ReactiveList = {
942
957
 
943
958
  var mapStateToProps = function mapStateToProps(state, props) {
944
959
  return {
945
- defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
960
+ defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1,
946
961
  hits: state.hits[props.componentId] && state.hits[props.componentId].hits,
947
962
  rawData: state.rawData[props.componentId],
948
- aggregationData: state.compositeAggregations[props.componentId] || [],
949
- promotedResults: state.promotedResults[props.componentId] || [],
963
+ aggregationData: state.compositeAggregations[props.componentId],
964
+ promotedResults: state.promotedResults[props.componentId],
950
965
  customData: state.customData[props.componentId],
951
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
966
+ time: state.hits[props.componentId] && state.hits[props.componentId].time,
952
967
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
953
968
  hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
954
969
  analytics: state.config && state.config.analytics,
@@ -957,7 +972,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
957
972
  error: state.error[props.componentId],
958
973
  afterKey: state.aggregations[props.componentId] && state.aggregations[props.componentId][props.aggregationField] && state.aggregations[props.componentId][props.aggregationField].after_key,
959
974
  componentProps: state.props[props.componentId],
960
- isLoading: state.isLoading[props.componentId] || false
975
+ isLoading: state.isLoading[props.componentId]
961
976
  };
962
977
  };
963
978
 
@@ -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-a9b9d5c9.js';
6
+ import { t as types } from './vueTypes-98819a12.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
8
  import { T as Title } from './Title-579f8d6c.js';
9
9
  import { I as Image, C as Card } from './Card-04b3c33e.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-a9b9d5c9.js';
6
+ import { t as types } from './vueTypes-98819a12.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
8
  import { T as Title } from './Title-579f8d6c.js';
9
9
  import { I as Image, L as ListItem } from './ListItem-bdb6d53d.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-799185e2.js';
9
- import { t as types } from './vueTypes-a9b9d5c9.js';
9
+ import { t as types } from './vueTypes-98819a12.js';
10
10
  import 'redux';
11
11
  import { c as connect } from './index-4755c9a0.js';
12
12
  import { T as Title } from './Title-579f8d6c.js';
@@ -6,7 +6,7 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { l as loadMoreContainer, B as Button } from './Button-799185e2.js';
9
- import { t as types } from './vueTypes-a9b9d5c9.js';
9
+ import { t as types } from './vueTypes-98819a12.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-4755c9a0.js';
@@ -16,8 +16,9 @@ import './Input-d8519224.js';
16
16
  import 'compute-scroll-into-view';
17
17
  import './DownShift-e7ccf2a7.js';
18
18
  import { C as Container } from './Container-4383c6f0.js';
19
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
19
20
  import { g as getAggsQuery } from './utils-3a32e13f.js';
20
- import { D as Dropdown } from './DropDown-8894cc22.js';
21
+ import { D as Dropdown } from './DropDown-c5ab660f.js';
21
22
 
22
23
  var updateQuery = Actions.updateQuery,
23
24
  setQueryOptions = Actions.setQueryOptions,
@@ -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-a9b9d5c9.js';
8
+ import { t as types } from './vueTypes-98819a12.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-4755c9a0.js';
@@ -13,6 +13,7 @@ import { C as ComponentWrapper } from './ComponentWrapper-459505fd.js';
13
13
  import { T as Title } from './Title-579f8d6c.js';
14
14
  import { I as Input } from './Input-d8519224.js';
15
15
  import { C as Container } from './Container-4383c6f0.js';
16
+ import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
16
17
  import { U as UL, R as Radio } from './FormControlList-fe389a2e.js';
17
18
  import { g as getAggsQuery } from './utils-3a32e13f.js';
18
19
 
@@ -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;
@@ -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-a9b9d5c9.js';
8
+ import { t as types } from './vueTypes-98819a12.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-4755c9a0.js';
@@ -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-799185e2.js';
9
- import { t as types } from './vueTypes-a9b9d5c9.js';
9
+ import { t as types } from './vueTypes-98819a12.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-4755c9a0.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,
package/dist/es/index.js CHANGED
@@ -2,12 +2,13 @@ import '@appbaseio/reactivecore';
2
2
  import './_rollupPluginBabelHelpers-ecf6c03c.js';
3
3
  import 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
+ import '@appbaseio/reactivecore/lib/utils/helper';
5
6
  import 'emotion';
6
7
  import '@appbaseio/vue-emotion';
7
8
  import 'polished';
8
9
  import './Button-799185e2.js';
9
- import './vueTypes-a9b9d5c9.js';
10
- import './Pagination-a2ab7fcb.js';
10
+ import './vueTypes-98819a12.js';
11
+ import './Pagination-e8216949.js';
11
12
  export { default as ReactiveList } from './ReactiveList.js';
12
13
  import '@appbaseio/reactivecore/lib/utils/transform';
13
14
  import 'redux';
@@ -18,7 +19,6 @@ import './Title-579f8d6c.js';
18
19
  import './ListItem-bdb6d53d.js';
19
20
  import './Card-04b3c33e.js';
20
21
  import './Flex-aac91505.js';
21
- import '@appbaseio/reactivecore/lib/utils/helper';
22
22
  import '@appbaseio/reactivecore/lib/actions/analytics';
23
23
  import 'appbase-js';
24
24
  import 'url-search-params-polyfill';
@@ -30,11 +30,12 @@ import 'compute-scroll-into-view';
30
30
  import './DownShift-e7ccf2a7.js';
31
31
  import './Container-4383c6f0.js';
32
32
  import 'vue-highlight-words';
33
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
33
34
  import './FormControlList-fe389a2e.js';
34
35
  import './utils-3a32e13f.js';
35
36
  export { default as SingleList } from './SingleList.js';
36
37
  export { default as MultiList } from './MultiList.js';
37
- import './DropDown-8894cc22.js';
38
+ import './DropDown-c5ab660f.js';
38
39
  export { default as SingleDropdownList } from './SingleDropdownList.js';
39
40
  export { default as MultiDropdownList } from './MultiDropdownList.js';
40
41
  export { default as ToggleButton } from './ToggleButton.js';
@@ -1,7 +1,7 @@
1
1
  import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
2
  import { validProps, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
- import { getRSQuery, extractPropsFromState, getDependentQueries } from '@appbaseio/reactivecore/lib/utils/transform';
4
3
  import { pushToAndClause, buildQuery } from '@appbaseio/reactivecore/lib/utils/helper';
4
+ import { getRSQuery, extractPropsFromState, getDependentQueries } from '@appbaseio/reactivecore/lib/utils/transform';
5
5
  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';
@@ -116,16 +116,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
116
116
  compProps[key] = component[key];
117
117
  }
118
118
  });
119
- var isInternalComponentPresent = false; // Set custom and default queries
120
-
121
- if (component.customQuery && typeof component.customQuery === 'function') {
122
- customQueries[component.componentId] = component.customQuery(component.value, compProps);
123
- }
124
-
125
- if (component.defaultQuery && typeof component.defaultQuery === 'function') {
126
- defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
127
- }
128
-
119
+ var isInternalComponentPresent = false;
129
120
  var isResultComponent = resultComponents.includes(componentType);
130
121
  var internalComponent = component.componentId + "__internal";
131
122
  var label = component.filterLabel || component.componentId;
@@ -149,7 +140,16 @@ function initReactivesearch(componentCollection, searchState, settings) {
149
140
  reference: reference,
150
141
  showFilter: showFilter,
151
142
  URLParams: component.URLParams || false
152
- }); // [2] set query options - main component query (valid for result components)
143
+ }); // Set custom and default queries
144
+
145
+ if (component.customQuery && typeof component.customQuery === 'function') {
146
+ customQueries[component.componentId] = component.customQuery(value, compProps);
147
+ }
148
+
149
+ if (component.defaultQuery && typeof component.defaultQuery === 'function') {
150
+ defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
151
+ } // [2] set query options - main component query (valid for result components)
152
+
153
153
 
154
154
  if (componentsWithOptions.includes(componentType)) {
155
155
  var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
@@ -236,7 +236,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
236
236
 
237
237
 
238
238
  if (isResultComponent) {
239
- var _getQuery = getQuery(component, null, componentType),
239
+ var _getQuery = getQuery(component, value, componentType),
240
240
  query = _getQuery.query;
241
241
 
242
242
  queryList = queryReducer(queryList, {
@@ -307,8 +307,9 @@ function initReactivesearch(componentCollection, searchState, settings) {
307
307
  appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), getDependentQueries(state, component.componentId, orderOfQueries));
308
308
  }
309
309
  } else {
310
+ var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
310
311
  finalQuery = [].concat(finalQuery, [{
311
- preference: component.componentId
312
+ preference: preference
312
313
  }, currentQuery]);
313
314
  }
314
315
  }
@@ -2,12 +2,13 @@ import '@appbaseio/reactivecore';
2
2
  import './_rollupPluginBabelHelpers-ecf6c03c.js';
3
3
  import 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
+ import '@appbaseio/reactivecore/lib/utils/helper';
5
6
  import 'emotion';
6
7
  import '@appbaseio/vue-emotion';
7
8
  import 'polished';
8
9
  import './Button-799185e2.js';
9
- import './vueTypes-a9b9d5c9.js';
10
- import './Pagination-a2ab7fcb.js';
10
+ import './vueTypes-98819a12.js';
11
+ import './Pagination-e8216949.js';
11
12
  import ReactiveList from './ReactiveList.js';
12
13
  import '@appbaseio/reactivecore/lib/utils/transform';
13
14
  import 'redux';
@@ -18,7 +19,6 @@ import './Title-579f8d6c.js';
18
19
  import './ListItem-bdb6d53d.js';
19
20
  import './Card-04b3c33e.js';
20
21
  import './Flex-aac91505.js';
21
- import '@appbaseio/reactivecore/lib/utils/helper';
22
22
  import '@appbaseio/reactivecore/lib/actions/analytics';
23
23
  import 'appbase-js';
24
24
  import 'url-search-params-polyfill';
@@ -30,11 +30,12 @@ import 'compute-scroll-into-view';
30
30
  import './DownShift-e7ccf2a7.js';
31
31
  import './Container-4383c6f0.js';
32
32
  import 'vue-highlight-words';
33
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
33
34
  import './FormControlList-fe389a2e.js';
34
35
  import './utils-3a32e13f.js';
35
36
  import SingleList from './SingleList.js';
36
37
  import MultiList from './MultiList.js';
37
- import './DropDown-8894cc22.js';
38
+ import './DropDown-c5ab660f.js';
38
39
  import SingleDropdownList from './SingleDropdownList.js';
39
40
  import MultiDropdownList from './MultiDropdownList.js';
40
41
  import ToggleButton from './ToggleButton.js';
@@ -1,3 +1,3 @@
1
- var version = "1.16.0-alpha.23";
1
+ var version = "1.16.0-alpha.27";
2
2
 
3
3
  export default version;
@@ -121,7 +121,11 @@ var types = {
121
121
  userId: VueTypes.string,
122
122
  customEvents: VueTypes.object,
123
123
  enableTelemetry: VueTypes.bool.def(true)
124
- }).def({})
124
+ }).def({}),
125
+ mongodb: VueTypes.shape({
126
+ db: VueTypes.string,
127
+ collection: VueTypes.string
128
+ })
125
129
  };
126
130
 
127
131
  export { types as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appbaseio/reactivesearch-vue",
3
- "version": "1.16.0-alpha.23",
3
+ "version": "1.16.0-alpha.27",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "jsnext:main": "dist/es/index.js",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "sideEffects": false,
36
36
  "dependencies": {
37
- "@appbaseio/reactivecore": "9.12.7",
37
+ "@appbaseio/reactivecore": "9.13.1",
38
38
  "@appbaseio/vue-emotion": "0.4.4",
39
39
  "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
40
- "appbase-js": "^4.4.1",
40
+ "appbase-js": "^4.5.1",
41
41
  "compute-scroll-into-view": "^1.0.11",
42
42
  "emotion": "9.2.12",
43
43
  "gmap-vue": "^1.5.0",