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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +16030 -13113
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-446f819e.js +68 -0
  6. package/dist/cjs/{DownShift-966a58cb.js → CancelSvg-9f258f4f.js} +60 -16
  7. package/dist/cjs/Card-642547a8.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-603848ed.js → ComponentWrapper-ad3dad02.js} +40 -21
  9. package/dist/cjs/{Container-6cdd3864.js → Container-daf30918.js} +3 -11
  10. package/dist/cjs/DataSearch-86914b10.js +2322 -0
  11. package/dist/cjs/DataSearch.js +18 -2151
  12. package/dist/cjs/{DropDown-f6224ac8.js → DropDown-5513ea77.js} +80 -95
  13. package/dist/cjs/DynamicRangeSlider.js +107 -43
  14. package/dist/cjs/Flex-aa517a13.js +52 -0
  15. package/dist/cjs/FormControlList-c195a592.js +47 -0
  16. package/dist/cjs/Input-e6603a7e.js +79 -0
  17. package/dist/cjs/ListItem-8c9e0d68.js +46 -0
  18. package/dist/cjs/MultiDropdownList.js +102 -68
  19. package/dist/cjs/MultiList.js +80 -50
  20. package/dist/cjs/MultiRange.js +21 -16
  21. package/dist/cjs/{Pagination-af399262.js → Pagination-fe5452fc.js} +14 -8
  22. package/dist/cjs/RangeInput.js +29 -45
  23. package/dist/cjs/RangeSlider.js +32 -30
  24. package/dist/cjs/ReactiveBase.js +87 -56
  25. package/dist/cjs/ReactiveComponent.js +75 -62
  26. package/dist/cjs/ReactiveGoogleMap.js +262 -191
  27. package/dist/cjs/ReactiveList.js +189 -241
  28. package/dist/cjs/ResultCard.js +8 -6
  29. package/dist/cjs/ResultList.js +8 -6
  30. package/dist/cjs/SelectedFilters.js +66 -34
  31. package/dist/cjs/SingleDropdownList.js +88 -60
  32. package/dist/cjs/SingleList.js +53 -35
  33. package/dist/cjs/SingleRange.js +19 -14
  34. package/dist/cjs/StateProvider.js +39 -10
  35. package/dist/cjs/{Title-65d39104.js → Title-1de7d0f4.js} +3 -11
  36. package/dist/cjs/ToggleButton.js +36 -16
  37. package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
  38. package/dist/cjs/{index-baca18c4.js → index-6a167fe0.js} +99 -13
  39. package/dist/cjs/index.js +31 -25
  40. package/dist/cjs/initReactivesearch.js +178 -104
  41. package/dist/cjs/install-004c6aa4.js +1408 -0
  42. package/dist/cjs/install.js +42 -44
  43. package/dist/cjs/ssr-3027b848.js +39 -0
  44. package/dist/cjs/{utils-ea846a20.js → utils-d6a52588.js} +2 -2
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
  47. package/dist/es/Button-d8bc15ea.js +59 -0
  48. package/dist/es/{DownShift-92347b5e.js → CancelSvg-4cfae5fd.js} +56 -17
  49. package/dist/es/Card-450683f1.js +23 -0
  50. package/dist/es/{ComponentWrapper-c4c91949.js → ComponentWrapper-424e86fd.js} +40 -21
  51. package/dist/es/Container-ba826e96.js +10 -0
  52. package/dist/es/DataSearch-e71a1014.js +2307 -0
  53. package/dist/es/DataSearch.js +17 -2150
  54. package/dist/es/{DropDown-3d4291f1.js → DropDown-7d9a15c1.js} +79 -94
  55. package/dist/es/DynamicRangeSlider.js +107 -43
  56. package/dist/es/Flex-1f0795c3.js +47 -0
  57. package/dist/es/FormControlList-c22d64f6.js +40 -0
  58. package/dist/es/Input-7a2a9fac.js +71 -0
  59. package/dist/es/ListItem-cad14c5e.js +39 -0
  60. package/dist/es/MultiDropdownList.js +102 -68
  61. package/dist/es/MultiList.js +80 -50
  62. package/dist/es/MultiRange.js +21 -16
  63. package/dist/es/{Pagination-c2a00175.js → Pagination-3f350098.js} +14 -8
  64. package/dist/es/RangeInput.js +29 -45
  65. package/dist/es/RangeSlider.js +32 -30
  66. package/dist/es/ReactiveBase.js +87 -56
  67. package/dist/es/ReactiveComponent.js +75 -62
  68. package/dist/es/ReactiveGoogleMap.js +262 -191
  69. package/dist/es/ReactiveList.js +189 -241
  70. package/dist/es/ResultCard.js +8 -6
  71. package/dist/es/ResultList.js +8 -6
  72. package/dist/es/SelectedFilters.js +66 -34
  73. package/dist/es/SingleDropdownList.js +88 -60
  74. package/dist/es/SingleList.js +53 -35
  75. package/dist/es/SingleRange.js +19 -14
  76. package/dist/es/StateProvider.js +39 -10
  77. package/dist/es/Title-3342664a.js +10 -0
  78. package/dist/es/ToggleButton.js +36 -16
  79. package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
  80. package/dist/es/{index-185b6266.js → index-7788a843.js} +95 -14
  81. package/dist/es/index.js +27 -22
  82. package/dist/es/initReactivesearch.js +179 -105
  83. package/dist/es/install-b7b604cc.js +1401 -0
  84. package/dist/es/install.js +40 -46
  85. package/dist/es/ssr-b2c0b401.js +33 -0
  86. package/dist/es/{utils-57cc8789.js → utils-9e68acee.js} +2 -2
  87. package/dist/es/version.js +1 -1
  88. package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
  89. package/package.json +6 -4
  90. package/dist/cjs/Button-d48d4365.js +0 -146
  91. package/dist/cjs/Card-9748fbb2.js +0 -58
  92. package/dist/cjs/Flex-befd65fc.js +0 -160
  93. package/dist/cjs/FormControlList-f3857d4b.js +0 -105
  94. package/dist/cjs/Input-95cb19f8.js +0 -178
  95. package/dist/cjs/ListItem-84d185cf.js +0 -84
  96. package/dist/cjs/ssr-3ca8a14f.js +0 -47
  97. package/dist/es/Button-27cc8574.js +0 -137
  98. package/dist/es/Card-1f93780d.js +0 -51
  99. package/dist/es/Container-88c805ef.js +0 -18
  100. package/dist/es/Flex-16d1103a.js +0 -155
  101. package/dist/es/FormControlList-96d44e7b.js +0 -98
  102. package/dist/es/Input-1159c4b5.js +0 -170
  103. package/dist/es/ListItem-d22510c9.js +0 -77
  104. package/dist/es/Title-f0217338.js +0 -18
  105. package/dist/es/ssr-a710392b.js +0 -41
@@ -1,20 +1,21 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
- import { a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
- import { t as types } from './vueTypes-98d938a9.js';
8
+ import { t as types } from './vueTypes-9326e0be.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
- import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, l as isEvent, h as hasCustomRenderer, c as connect } from './index-185b6266.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-c4c91949.js';
13
- import { T as Title } from './Title-f0217338.js';
14
- import { I as Input } from './Input-1159c4b5.js';
15
- import { C as Container } from './Container-88c805ef.js';
16
- import { U as UL, R as Radio } from './FormControlList-96d44e7b.js';
17
- import { g as getAggsQuery } from './utils-57cc8789.js';
11
+ import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, o as isEvent, h as hasCustomRenderer, c as connect } from './index-7788a843.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
13
+ import { T as Title } from './Title-3342664a.js';
14
+ import { I as Input } from './Input-7a2a9fac.js';
15
+ import { C as Container } from './Container-ba826e96.js';
16
+ import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
17
+ import { U as UL, R as Radio } from './FormControlList-c22d64f6.js';
18
+ import { g as getAggsQuery } from './utils-9e68acee.js';
18
19
 
19
20
  var updateQuery = Actions.updateQuery,
20
21
  setQueryOptions = Actions.setQueryOptions,
@@ -23,13 +24,14 @@ var updateQuery = Actions.updateQuery,
23
24
  var getQueryOptions = helper.getQueryOptions,
24
25
  checkValueChange = helper.checkValueChange,
25
26
  getClassName = helper.getClassName,
26
- getOptionsFromQuery = helper.getOptionsFromQuery,
27
- isEqual = helper.isEqual;
27
+ isEqual = helper.isEqual,
28
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
29
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
28
30
  var SingleList = {
29
31
  name: 'SingleList',
30
32
  props: {
31
33
  beforeValueChange: types.func,
32
- className: types.string.def(''),
34
+ className: VueTypes.string.def(''),
33
35
  componentId: types.stringRequired,
34
36
  customQuery: types.func,
35
37
  dataField: types.stringRequired,
@@ -49,27 +51,34 @@ var SingleList = {
49
51
  showFilter: VueTypes.bool.def(true),
50
52
  showRadio: VueTypes.bool.def(true),
51
53
  showSearch: VueTypes.bool.def(true),
52
- size: VueTypes.number.def(100),
54
+ size: VueTypes.number,
53
55
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
54
56
  title: types.title,
55
57
  URLParams: VueTypes.bool.def(false),
56
58
  showMissing: VueTypes.bool.def(false),
57
59
  missingLabel: VueTypes.string.def('N/A'),
58
60
  nestedField: types.string,
61
+ index: VueTypes.string,
59
62
  enableStrictSelection: VueTypes.bool.def(false)
60
63
  },
61
64
  data: function data() {
62
65
  var props = this.$props;
63
66
  this.__state = {
64
67
  currentValue: '',
65
- modifiedOptions: props.options && props.options[props.dataField] ? props.options[props.dataField].buckets : [],
68
+ modifiedOptions: [],
66
69
  searchTerm: ''
67
70
  };
68
71
  this.internalComponent = props.componentId + "__internal";
69
72
  return this.__state;
70
73
  },
71
74
  created: function created() {
72
- // Set custom and default queries in store
75
+ if (!this.enableAppbase && this.$props.index) {
76
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
77
+ }
78
+
79
+ var props = this.$props;
80
+ this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
81
+
73
82
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
74
83
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
75
84
  },
@@ -86,7 +95,9 @@ var SingleList = {
86
95
  },
87
96
  watch: {
88
97
  options: function options(newVal) {
89
- this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
98
+ if (newVal) {
99
+ this.modifiedOptions = newVal[this.$props.dataField] ? newVal[this.$props.dataField].buckets : [];
100
+ }
90
101
  },
91
102
  size: function size() {
92
103
  this.updateQueryHandlerOptions(this.$props);
@@ -137,8 +148,12 @@ var SingleList = {
137
148
  return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
138
149
  }
139
150
 
140
- if (!this.hasCustomRenderer && this.modifiedOptions.length === 0) {
141
- return null;
151
+ if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
152
+ if (this.renderNoResult) {
153
+ this.renderNoResult();
154
+ } else {
155
+ return null;
156
+ }
142
157
  }
143
158
 
144
159
  var itemsToRender = this.$data.modifiedOptions;
@@ -150,7 +165,7 @@ var SingleList = {
150
165
  var filteredItemsToRender = itemsToRender.filter(function (item) {
151
166
  if (String(item.key).length) {
152
167
  if (_this.$props.showSearch && _this.$data.searchTerm) {
153
- return String(item.key).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
168
+ return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
154
169
  }
155
170
 
156
171
  return true;
@@ -248,22 +263,22 @@ var SingleList = {
248
263
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
249
264
  },
250
265
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
251
- var defaultQueryOptions;
252
266
  var query = SingleList.defaultQuery(value, props);
253
267
 
254
268
  if (this.defaultQuery) {
255
269
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
270
+ var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
256
271
 
257
- if (defaultQueryToBeSet.query) {
258
- query = defaultQueryToBeSet.query;
259
- }
272
+ if (defaultQueryObj) {
273
+ query = defaultQueryObj;
274
+ } // Update calculated default query in store
260
275
 
261
- defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
262
276
 
263
277
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
278
+ var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
279
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
264
280
  }
265
281
 
266
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
267
282
  this.updateQuery({
268
283
  componentId: this.internalComponent,
269
284
  query: query,
@@ -274,17 +289,15 @@ var SingleList = {
274
289
  updateQueryHandler: function updateQueryHandler(value, props) {
275
290
  var customQuery = props.customQuery;
276
291
  var query = SingleList.defaultQuery(value, props);
277
- var customQueryOptions;
278
292
 
279
293
  if (customQuery) {
280
- var _ref = customQuery(value, props) || {};
281
-
282
- query = _ref.query;
283
- customQueryOptions = getOptionsFromQuery(customQuery(value, props));
294
+ var customQueryCalc = customQuery(value, props);
295
+ query = extractQueryFromCustomQuery(customQueryCalc);
296
+ var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
284
297
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
298
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
285
299
  }
286
300
 
287
- this.setQueryOptions(props.componentId, customQueryOptions);
288
301
  this.updateQuery({
289
302
  componentId: props.componentId,
290
303
  query: query,
@@ -304,8 +317,8 @@ var SingleList = {
304
317
 
305
318
  if (props.defaultQuery) {
306
319
  var value = this.$data.currentValue;
307
- var defaultQueryOptions = getOptionsFromQuery(props.defaultQuery(value, props));
308
- this.setQueryOptions(this.internalComponent, _extends(_extends({}, queryOptions), defaultQueryOptions));
320
+ var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
321
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
309
322
  } else {
310
323
  this.setQueryOptions(this.internalComponent, queryOptions);
311
324
  }
@@ -449,6 +462,10 @@ SingleList.defaultQuery = function (value, props) {
449
462
  return query;
450
463
  };
451
464
 
465
+ SingleList.hasInternalComponent = function () {
466
+ return true;
467
+ };
468
+
452
469
  var mapStateToProps = function mapStateToProps(state, props) {
453
470
  return {
454
471
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
@@ -457,7 +474,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
457
474
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || '',
458
475
  themePreset: state.config.themePreset,
459
476
  error: state.error[props.componentId],
460
- componentProps: state.props[props.componentId]
477
+ componentProps: state.props[props.componentId],
478
+ enableAppbase: state.config.enableAppbase
461
479
  };
462
480
  };
463
481
 
@@ -469,7 +487,7 @@ var mapDispatchtoProps = {
469
487
  };
470
488
  var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleList), {
471
489
  componentType: componentTypes.singleList,
472
- internalComponent: true
490
+ internalComponent: SingleList.hasInternalComponent()
473
491
  });
474
492
 
475
493
  SingleList.install = function (Vue) {
@@ -1,18 +1,18 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
- import './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import './_rollupPluginBabelHelpers-76660dab.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
- import { t as types } from './vueTypes-98d938a9.js';
8
+ import { t as types } from './vueTypes-9326e0be.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
- import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-185b6266.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-c4c91949.js';
13
- import { T as Title } from './Title-f0217338.js';
14
- import { C as Container } from './Container-88c805ef.js';
15
- import { U as UL, R as Radio } from './FormControlList-96d44e7b.js';
11
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
13
+ import { T as Title } from './Title-3342664a.js';
14
+ import { C as Container } from './Container-ba826e96.js';
15
+ import { U as UL, R as Radio } from './FormControlList-c22d64f6.js';
16
16
 
17
17
  var updateQuery = Actions.updateQuery,
18
18
  setQueryOptions = Actions.setQueryOptions,
@@ -46,10 +46,15 @@ var SingleRange = {
46
46
  showRadio: VueTypes.bool.def(true),
47
47
  title: types.title,
48
48
  URLParams: VueTypes.bool.def(false),
49
- nestedField: types.string
49
+ nestedField: types.string,
50
+ index: VueTypes.string
50
51
  },
51
52
  created: function created() {
52
- // Set custom query in store
53
+ if (!this.enableAppbase && this.$props.index) {
54
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
55
+ } // Set custom query in store
56
+
57
+
53
58
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
54
59
  },
55
60
  beforeMount: function beforeMount() {
@@ -128,7 +133,7 @@ var SingleRange = {
128
133
  props = this.$props;
129
134
  }
130
135
 
131
- var currentValue = SingleRange.parseValue(value, props);
136
+ var currentValue = typeof value === 'string' ? SingleRange.parseValue(value, props) : value;
132
137
 
133
138
  var performUpdate = function performUpdate() {
134
139
  _this2.currentValue = currentValue;
@@ -145,17 +150,16 @@ var SingleRange = {
145
150
  updateQueryHandler: function updateQueryHandler(value, props) {
146
151
  var customQuery = props.customQuery;
147
152
  var query = SingleRange.defaultQuery(value, props);
148
- var customQueryOptions;
149
153
 
150
154
  if (customQuery) {
151
155
  var _ref = customQuery(value, props) || {};
152
156
 
153
157
  query = _ref.query;
154
- customQueryOptions = getOptionsFromQuery(customQuery(value, props));
158
+ var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
155
159
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
160
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
156
161
  }
157
162
 
158
- this.setQueryOptions(props.componentId, customQueryOptions);
159
163
  this.updateQuery({
160
164
  componentId: props.componentId,
161
165
  query: query,
@@ -216,7 +220,8 @@ SingleRange.defaultQuery = function (value, props) {
216
220
  var mapStateToProps = function mapStateToProps(state, props) {
217
221
  return {
218
222
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
219
- componentProps: state.props[props.componentId]
223
+ componentProps: state.props[props.componentId],
224
+ enableAppbase: state.config.enableAppbase
220
225
  };
221
226
  };
222
227
 
@@ -1,15 +1,21 @@
1
1
  import { helper } from '@appbaseio/reactivecore';
2
- import { a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
+ import { isInternalComponent } from '@appbaseio/reactivecore/lib/utils/transform';
5
6
  import 'redux';
6
- import { c as connect } from './index-185b6266.js';
7
+ import { c as connect } from './index-7788a843.js';
8
+ import { setValues } from '@appbaseio/reactivecore/lib/actions/value';
7
9
 
8
10
  var getSearchState = helper.getSearchState;
9
11
  var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
10
12
 
11
13
  var filterProps = function filterProps(props) {
12
- return _extends(_extends({}, props), {}, {
14
+ if (props === void 0) {
15
+ props = {};
16
+ }
17
+
18
+ return _extends({}, props, {
13
19
  props: props.componentProps
14
20
  });
15
21
  };
@@ -28,7 +34,7 @@ var filterByComponentIds = function filterByComponentIds(state, props) {
28
34
  return _ref = {}, _ref[componentIds] = state[componentIds], _ref;
29
35
  }
30
36
 
31
- if (componentIds instanceof Array) {
37
+ if (Array.isArray(componentIds)) {
32
38
  var filteredState = {};
33
39
  componentIds.forEach(function (componentId) {
34
40
  filteredState[componentId] = state[componentId];
@@ -43,7 +49,7 @@ var filterByKeys = function filterByKeys(state, allowedKeys) {
43
49
  return Object.keys(state).reduce(function (components, componentId) {
44
50
  var _extends2;
45
51
 
46
- return _extends(_extends({}, components), {}, (_extends2 = {}, _extends2[componentId] = Object.keys(state[componentId]).filter(function (key) {
52
+ return _extends({}, components, (_extends2 = {}, _extends2[componentId] = Object.keys(state[componentId]).filter(function (key) {
47
53
  return allowedKeys.includes(key);
48
54
  }).reduce(function (obj, key) {
49
55
  // eslint-disable-next-line
@@ -67,7 +73,7 @@ var StateProvider = {
67
73
  };
68
74
  return this.__state;
69
75
  },
70
- mounted: function mounted() {
76
+ created: function created() {
71
77
  this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
72
78
  },
73
79
  computed: {
@@ -89,7 +95,7 @@ var StateProvider = {
89
95
  watch: {
90
96
  searchState: function searchState(newVal, oldVal) {
91
97
  if (this.isStateChanged(newVal, oldVal)) {
92
- this.$emit('change', newVal, oldVal);
98
+ this.$emit('change', oldVal, newVal);
93
99
  }
94
100
  },
95
101
  selectedValues: function selectedValues(newVal, oldVal) {
@@ -143,13 +149,32 @@ var StateProvider = {
143
149
  if (this.isStateChanged(newVal, oldVal)) {
144
150
  this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
145
151
  }
152
+ },
153
+ setSearchState: function setSearchState(valuesMap) {
154
+ if (valuesMap === void 0) {
155
+ valuesMap = {};
156
+ }
157
+
158
+ var components = this.components;
159
+ var computedValuesMap = {};
160
+ components.filter(function (component) {
161
+ return !isInternalComponent(component);
162
+ }).forEach(function (component) {
163
+ if (component in valuesMap) {
164
+ computedValuesMap[component] = valuesMap[component];
165
+ } else {
166
+ computedValuesMap[component] = null;
167
+ }
168
+ });
169
+ this.setValues(computedValuesMap);
146
170
  }
147
171
  },
148
172
  render: function render() {
149
173
  var searchState = this.searchState;
150
174
  var dom = this.$scopedSlots["default"];
151
175
  return dom ? dom({
152
- searchState: searchState
176
+ searchState: searchState,
177
+ setSearchState: this.setSearchState
153
178
  }) : null;
154
179
  }
155
180
  };
@@ -167,11 +192,15 @@ var mapStateToProps = function mapStateToProps(state, props) {
167
192
  promotedResults: filterByComponentIds(state.promotedResults, props),
168
193
  customData: filterByComponentIds(state.customData, props),
169
194
  settings: filterByComponentIds(state.settings, props),
170
- rawData: filterByComponentIds(state.rawData, props)
195
+ rawData: filterByComponentIds(state.rawData, props),
196
+ components: filterByComponentIds(state.components, props)
171
197
  };
172
198
  };
173
199
 
174
- var StateProviderConnected = connect(mapStateToProps, {})(StateProvider);
200
+ var mapDispatchtoProps = {
201
+ setValues: setValues
202
+ };
203
+ var StateProviderConnected = connect(mapStateToProps, mapDispatchtoProps)(StateProvider);
175
204
 
176
205
  StateProvider.install = function (Vue) {
177
206
  Vue.component(StateProvider.name, StateProviderConnected);
@@ -0,0 +1,10 @@
1
+ import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-76660dab.js';
2
+ import styled from '@appbaseio/vue-emotion';
3
+
4
+ var _templateObject;
5
+ var Title = styled('h2')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tmargin: 0 0 8px;\n\tfont-size: 1rem;\n\tcolor: ", ";\n"])), function (_ref) {
6
+ var theme = _ref.theme;
7
+ return theme.colors.titleColor;
8
+ });
9
+
10
+ export { Title as T };
@@ -1,18 +1,18 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
- import './_rollupPluginBabelHelpers-ecf6c03c.js';
3
- import 'vue-types';
2
+ import './_rollupPluginBabelHelpers-76660dab.js';
3
+ import VueTypes from 'vue-types';
4
4
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
- import { B as Button, t as toggleButtons } from './Button-27cc8574.js';
9
- import { t as types } from './vueTypes-98d938a9.js';
8
+ import { B as Button, t as toggleButtons } from './Button-d8bc15ea.js';
9
+ import { t as types } from './vueTypes-9326e0be.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-185b6266.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-c4c91949.js';
14
- import { T as Title } from './Title-f0217338.js';
15
- import { C as Container } from './Container-88c805ef.js';
12
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
14
+ import { T as Title } from './Title-3342664a.js';
15
+ import { C as Container } from './Container-ba826e96.js';
16
16
 
17
17
  var updateQuery = Actions.updateQuery,
18
18
  setQueryOptions = Actions.setQueryOptions,
@@ -26,19 +26,22 @@ var ToggleButton = {
26
26
  name: 'ToggleButton',
27
27
  props: {
28
28
  componentId: types.stringRequired,
29
+ customQuery: types.func,
29
30
  data: types.data,
30
31
  dataField: types.stringRequired,
31
- defaultValue: types.stringOrArray,
32
+ defaultValue: types.any,
32
33
  value: types.stringOrArray,
33
34
  filterLabel: types.string,
34
35
  nestedField: types.string,
35
36
  innerClass: types.style,
36
- multiSelect: types.bool,
37
+ multiSelect: VueTypes.bool,
37
38
  react: types.react,
38
- showFilter: types.bool,
39
+ showFilter: VueTypes.bool,
39
40
  title: types.title,
40
- URLParams: types.bool,
41
- renderItem: types.func
41
+ URLParams: VueTypes.bool,
42
+ renderItem: types.func,
43
+ index: VueTypes.string,
44
+ enableStrictSelection: VueTypes.bool
42
45
  },
43
46
  data: function data() {
44
47
  this.__state = {
@@ -58,7 +61,11 @@ var ToggleButton = {
58
61
  }
59
62
  },
60
63
  created: function created() {
61
- // Set custom query in store
64
+ if (!this.enableAppbase && this.$props.index) {
65
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
66
+ } // Set custom query in store
67
+
68
+
62
69
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
63
70
  },
64
71
  watch: {
@@ -180,7 +187,7 @@ var ToggleButton = {
180
187
  var _ref = customQuery(value, props) || {};
181
188
 
182
189
  query = _ref.query;
183
- this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)));
190
+ this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)), false);
184
191
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
185
192
  }
186
193
 
@@ -196,6 +203,16 @@ var ToggleButton = {
196
203
  });
197
204
  },
198
205
  handleClick: function handleClick(item) {
206
+ var _this$$props = this.$props,
207
+ enableStrictSelection = _this$$props.enableStrictSelection,
208
+ multiSelect = _this$$props.multiSelect;
209
+
210
+ if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
211
+ return isEqual(item, stateItem);
212
+ })) {
213
+ return false;
214
+ }
215
+
199
216
  var value = this.$props.value;
200
217
 
201
218
  if (value === undefined) {
@@ -203,6 +220,8 @@ var ToggleButton = {
203
220
  } else {
204
221
  this.$emit('change', item.value);
205
222
  }
223
+
224
+ return true;
206
225
  },
207
226
  renderButton: function renderButton(item) {
208
227
  var _this2 = this;
@@ -305,7 +324,8 @@ ToggleButton.defaultQuery = function (value, props) {
305
324
  var mapStateToProps = function mapStateToProps(state, props) {
306
325
  return {
307
326
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
308
- componentProps: state.props[props.componentId]
327
+ componentProps: state.props[props.componentId],
328
+ enableAppbase: state.config.enableAppbase
309
329
  };
310
330
  };
311
331
 
@@ -1,5 +1,5 @@
1
1
  function _extends() {
2
- _extends = Object.assign || function (target) {
2
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
3
3
  for (var i = 1; i < arguments.length; i++) {
4
4
  var source = arguments[i];
5
5
 
@@ -12,7 +12,6 @@ function _extends() {
12
12
 
13
13
  return target;
14
14
  };
15
-
16
15
  return _extends.apply(this, arguments);
17
16
  }
18
17
 
@@ -24,11 +23,10 @@ function _inheritsLoose(subClass, superClass) {
24
23
  }
25
24
 
26
25
  function _setPrototypeOf(o, p) {
27
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
26
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
28
27
  o.__proto__ = p;
29
28
  return o;
30
29
  };
31
-
32
30
  return _setPrototypeOf(o, p);
33
31
  }
34
32