@appbaseio/reactivesearch-vue 2.0.0-alpha.4 → 3.0.0-alpha.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 (108) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +17538 -25422
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -15
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-ad042719.js +59 -0
  6. package/dist/cjs/Card-f5ab024a.js +27 -0
  7. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-75f88599.js} +42 -56
  8. package/dist/cjs/Container-29f049b2.js +12 -0
  9. package/dist/cjs/DropDown-6cf84c47.js +698 -0
  10. package/dist/cjs/DynamicRangeSlider.js +103 -155
  11. package/dist/cjs/Flex-d5675ea6.js +48 -0
  12. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  13. package/dist/cjs/Input-4b434436.js +74 -0
  14. package/dist/cjs/ListItem-d57d648d.js +42 -0
  15. package/dist/cjs/MultiDropdownList.js +124 -240
  16. package/dist/cjs/MultiList.js +123 -261
  17. package/dist/cjs/MultiRange.js +87 -133
  18. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  19. package/dist/cjs/PreferencesConsumer-eb265924.js +75 -0
  20. package/dist/cjs/RangeInput.js +163 -171
  21. package/dist/cjs/RangeSlider.js +81 -109
  22. package/dist/cjs/ReactiveBase.js +139 -157
  23. package/dist/cjs/ReactiveComponent-eb8db4c1.js +2189 -0
  24. package/dist/cjs/ReactiveComponent.js +46 -340
  25. package/dist/cjs/ReactiveGoogleMap.js +445 -655
  26. package/dist/cjs/ReactiveList.js +179 -304
  27. package/dist/cjs/ResultCard.js +36 -36
  28. package/dist/cjs/ResultList.js +48 -56
  29. package/dist/cjs/SelectedFilters.js +62 -69
  30. package/dist/cjs/SingleDropdownList.js +117 -177
  31. package/dist/cjs/SingleList.js +121 -205
  32. package/dist/cjs/SingleRange.js +78 -105
  33. package/dist/cjs/StateProvider.js +35 -38
  34. package/dist/cjs/Title-8802a218.js +12 -0
  35. package/dist/cjs/ToggleButton.js +72 -119
  36. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  37. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  38. package/dist/cjs/index.js +44 -41
  39. package/dist/cjs/initReactivesearch.js +63 -150
  40. package/dist/cjs/install.js +47 -43
  41. package/dist/cjs/ssr-6907ada3.js +66 -0
  42. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  45. package/dist/es/Button-474510e3.js +53 -0
  46. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  47. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-5166c76a.js} +42 -56
  48. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  49. package/dist/es/DropDown-8764360c.js +688 -0
  50. package/dist/es/DynamicRangeSlider.js +103 -155
  51. package/dist/es/Flex-a08e22d7.js +46 -0
  52. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  53. package/dist/es/Input-4a8ef1f3.js +69 -0
  54. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  55. package/dist/es/MultiDropdownList.js +124 -240
  56. package/dist/es/MultiList.js +123 -261
  57. package/dist/es/MultiRange.js +87 -133
  58. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  59. package/dist/es/PreferencesConsumer-c276709c.js +73 -0
  60. package/dist/es/RangeInput.js +163 -170
  61. package/dist/es/RangeSlider.js +81 -109
  62. package/dist/es/ReactiveBase.js +138 -155
  63. package/dist/es/ReactiveComponent-f9fa5780.js +2183 -0
  64. package/dist/es/ReactiveComponent.js +42 -337
  65. package/dist/es/ReactiveGoogleMap.js +440 -649
  66. package/dist/es/ReactiveList.js +177 -301
  67. package/dist/es/ResultCard.js +36 -36
  68. package/dist/es/ResultList.js +48 -56
  69. package/dist/es/SelectedFilters.js +62 -69
  70. package/dist/es/SingleDropdownList.js +117 -177
  71. package/dist/es/SingleList.js +121 -205
  72. package/dist/es/SingleRange.js +78 -105
  73. package/dist/es/StateProvider.js +36 -39
  74. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  75. package/dist/es/ToggleButton.js +72 -119
  76. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  77. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  78. package/dist/es/index.js +30 -32
  79. package/dist/es/initReactivesearch.js +63 -150
  80. package/dist/es/install.js +49 -41
  81. package/dist/es/{ssr-b2c0b401.js → ssr-af398f0c.js} +36 -7
  82. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  85. package/package.json +10 -9
  86. package/dist/cjs/Button-446f819e.js +0 -68
  87. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  88. package/dist/cjs/Card-642547a8.js +0 -30
  89. package/dist/cjs/Container-daf30918.js +0 -15
  90. package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
  91. package/dist/cjs/DataSearch.js +0 -30
  92. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  93. package/dist/cjs/Flex-aa517a13.js +0 -52
  94. package/dist/cjs/FormControlList-c195a592.js +0 -47
  95. package/dist/cjs/Input-e6603a7e.js +0 -79
  96. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  97. package/dist/cjs/Title-1de7d0f4.js +0 -15
  98. package/dist/cjs/install-b97dbac4.js +0 -1409
  99. package/dist/cjs/ssr-3027b848.js +0 -39
  100. package/dist/es/Button-d8bc15ea.js +0 -59
  101. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  102. package/dist/es/DataSearch-b86a6675.js +0 -2337
  103. package/dist/es/DataSearch.js +0 -22
  104. package/dist/es/DropDown-05a644a5.js +0 -322
  105. package/dist/es/Flex-1f0795c3.js +0 -47
  106. package/dist/es/FormControlList-c22d64f6.js +0 -40
  107. package/dist/es/Input-7a2a9fac.js +0 -71
  108. package/dist/es/install-ac8a1edb.js +0 -1402
@@ -1,32 +1,34 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
- import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
- import VueTypes from 'vue-types';
4
2
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
- import 'emotion';
3
+ import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
4
+ import { createVNode, createTextVNode } from 'vue';
5
+ import VueTypes from 'vue-types';
6
6
  import '@appbaseio/vue-emotion';
7
+ import 'emotion';
7
8
  import 'polished';
8
- import { t as types } from './vueTypes-b8146772.js';
9
+ import { t as types } from './vueTypes-f1923c72.js';
9
10
  import '@appbaseio/reactivecore/lib/utils/transform';
10
11
  import 'redux';
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';
12
+ import { j as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, m as isEvent, h as hasCustomRenderer, c as connect } from './index-4520a598.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-5166c76a.js';
14
+ import { P as PreferencesConsumer } from './PreferencesConsumer-c276709c.js';
15
+ import { T as Title } from './Title-863dfa42.js';
16
+ import { I as Input } from './Input-4a8ef1f3.js';
17
+ import { C as Container } from './Container-d00219f7.js';
16
18
  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';
19
+ import { U as UL, R as Radio } from './FormControlList-fe6eaee4.js';
20
+ import { g as getAggsQuery } from './utils-9e5a16a1.js';
19
21
 
20
22
  var updateQuery = Actions.updateQuery,
21
- setQueryOptions = Actions.setQueryOptions,
22
- setCustomQuery = Actions.setCustomQuery,
23
- setDefaultQuery = Actions.setDefaultQuery;
23
+ setQueryOptions = Actions.setQueryOptions,
24
+ setCustomQuery = Actions.setCustomQuery,
25
+ setDefaultQuery = Actions.setDefaultQuery;
24
26
  var getQueryOptions = helper.getQueryOptions,
25
- checkValueChange = helper.checkValueChange,
26
- getClassName = helper.getClassName,
27
- isEqual = helper.isEqual,
28
- extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
29
- getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
27
+ checkValueChange = helper.checkValueChange,
28
+ getClassName = helper.getClassName,
29
+ isEqual = helper.isEqual,
30
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
31
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
30
32
  var SingleList = {
31
33
  name: 'SingleList',
32
34
  props: {
@@ -73,19 +75,14 @@ var SingleList = {
73
75
  return this.__state;
74
76
  },
75
77
  created: function created() {
76
- if (!this.enableAppbase && this.$props.index) {
77
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
78
- }
79
-
80
78
  var props = this.$props;
81
- this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
82
-
79
+ this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : [];
80
+ // Set custom and default queries in store
83
81
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
84
82
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
85
83
  },
86
84
  beforeMount: function beforeMount() {
87
85
  this.updateQueryHandlerOptions(this.$props);
88
-
89
86
  if (this.selectedValue) {
90
87
  this.setValue(this.selectedValue);
91
88
  } else if (this.$props.value) {
@@ -136,19 +133,15 @@ var SingleList = {
136
133
  },
137
134
  render: function render() {
138
135
  var _this = this;
139
-
140
- var h = arguments[0];
141
136
  var _this$$props = this.$props,
142
- selectAllLabel = _this$$props.selectAllLabel,
143
- renderItem = _this$$props.renderItem,
144
- renderError = _this$$props.renderError;
145
- var renderItemCalc = this.$scopedSlots.renderItem || renderItem;
146
- var renderErrorCalc = this.$scopedSlots.renderError || renderError;
147
-
137
+ selectAllLabel = _this$$props.selectAllLabel,
138
+ renderItem = _this$$props.renderItem,
139
+ renderError = _this$$props.renderError;
140
+ var renderItemCalc = this.$slots.renderItem || renderItem;
141
+ var renderErrorCalc = this.$slots.renderError || renderError;
148
142
  if (renderErrorCalc && this.error) {
149
143
  return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
150
144
  }
151
-
152
145
  if (!this.hasCustomRenderer && this.modifiedOptions.length === 0 && !this.isLoading) {
153
146
  if (this.renderNoResult) {
154
147
  this.renderNoResult();
@@ -156,130 +149,113 @@ var SingleList = {
156
149
  return null;
157
150
  }
158
151
  }
159
-
160
152
  var itemsToRender = this.$data.modifiedOptions;
161
-
162
153
  if (this.$props.transformData) {
163
154
  itemsToRender = this.$props.transformData(itemsToRender);
164
155
  }
165
-
166
156
  var filteredItemsToRender = itemsToRender.filter(function (item) {
167
157
  if (String(item.key).length) {
168
158
  if (_this.$props.showSearch && _this.$data.searchTerm) {
169
159
  return replaceDiacritics(String(item.key)).toLowerCase().includes(replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
170
160
  }
171
-
172
161
  return true;
173
162
  }
174
-
175
163
  return false;
176
164
  });
177
- return h(Container, {
165
+ return createVNode(Container, {
178
166
  "class": this.$props.className
179
- }, [this.$props.title && h(Title, {
180
- "class": getClassName(this.$props.innerClass, 'title') || ''
181
- }, [this.$props.title]), this.renderSearch(), this.hasCustomRenderer ? this.getComponent() : h(UL, {
182
- "class": getClassName(this.$props.innerClass, 'list') || ''
183
- }, [selectAllLabel ? h("li", {
184
- "key": selectAllLabel,
185
- "class": "" + (this.$data.currentValue === selectAllLabel ? 'active' : '')
186
- }, [h(Radio, {
187
- "class": getClassName(this.$props.innerClass, 'radio'),
188
- "attrs": {
189
- "id": this.$props.componentId + "-" + selectAllLabel,
190
- "name": this.$props.componentId,
191
- "value": selectAllLabel,
192
- "readOnly": true,
193
- "show": this.$props.showRadio
194
- },
195
- "on": {
196
- "click": this.handleClick
197
- },
198
- "domProps": _extends({}, {
199
- checked: this.$data.currentValue === selectAllLabel
200
- })
201
- }), h("label", {
202
- "class": getClassName(this.$props.innerClass, 'label') || null,
203
- "attrs": {
204
- "for": this.$props.componentId + "-" + selectAllLabel
167
+ }, {
168
+ "default": function _default() {
169
+ return [_this.$props.title && createVNode(Title, {
170
+ "class": getClassName(_this.$props.innerClass, 'title') || ''
171
+ }, {
172
+ "default": function _default() {
173
+ return [_this.$props.title];
174
+ }
175
+ }), _this.renderSearch(), _this.hasCustomRenderer ? _this.getComponent() : createVNode(UL, {
176
+ "class": getClassName(_this.$props.innerClass, 'list') || ''
177
+ }, {
178
+ "default": function _default() {
179
+ return [selectAllLabel ? createVNode("li", {
180
+ "key": selectAllLabel,
181
+ "class": "" + (_this.$data.currentValue === selectAllLabel ? 'active' : '')
182
+ }, [createVNode(Radio, {
183
+ "class": getClassName(_this.$props.innerClass, 'radio'),
184
+ "id": _this.$props.componentId + "-" + selectAllLabel,
185
+ "name": _this.$props.componentId,
186
+ "value": selectAllLabel,
187
+ "onClick": _this.handleClick,
188
+ "readOnly": true,
189
+ "type": "radio",
190
+ "show": _this.$props.showRadio,
191
+ "checked": _this.$data.currentValue === selectAllLabel
192
+ }, null), createVNode("label", {
193
+ "class": getClassName(_this.$props.innerClass, 'label') || null,
194
+ "for": _this.$props.componentId + "-" + selectAllLabel
195
+ }, [createVNode("span", null, [selectAllLabel, _this.$props.showCount && createVNode("span", {
196
+ "class": getClassName(_this.$props.innerClass, 'count') || null
197
+ }, [createTextVNode("\xA0("), _this.totalDocumentCount, createTextVNode(")")])])])]) : null, !_this.hasCustomRenderer && filteredItemsToRender.length === 0 && !_this.isLoading ? _this.renderNoResult() : filteredItemsToRender.map(function (item) {
198
+ return createVNode("li", {
199
+ "key": item.key,
200
+ "class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
201
+ }, [createVNode(Radio, {
202
+ "class": getClassName(_this.$props.innerClass, 'radio'),
203
+ "id": _this.$props.componentId + "-" + item.key,
204
+ "name": _this.$props.componentId,
205
+ "value": item.key,
206
+ "readOnly": true,
207
+ "onClick": _this.handleClick,
208
+ "type": "radio",
209
+ "show": _this.$props.showRadio,
210
+ "checked": _this.currentValue === String(item.key)
211
+ }, null), createVNode("label", {
212
+ "class": getClassName(_this.$props.innerClass, 'label') || null,
213
+ "for": _this.$props.componentId + "-" + item.key
214
+ }, [renderItemCalc ? renderItemCalc({
215
+ label: item.key,
216
+ count: item.doc_count,
217
+ isChecked: _this.currentValue === String(item.key)
218
+ }) : createVNode("span", null, [item.key, _this.$props.showCount && createVNode("span", {
219
+ "class": getClassName(_this.$props.innerClass, 'count') || null
220
+ }, [createTextVNode("\xA0("), item.doc_count, createTextVNode(")")])])])]);
221
+ })];
222
+ }
223
+ })];
205
224
  }
206
- }, [selectAllLabel])]) : null, !this.hasCustomRenderer && filteredItemsToRender.length === 0 && !this.isLoading ? this.renderNoResult() : filteredItemsToRender.map(function (item) {
207
- return h("li", {
208
- "key": item.key,
209
- "class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
210
- }, [h(Radio, {
211
- "class": getClassName(_this.$props.innerClass, 'radio'),
212
- "attrs": {
213
- "id": _this.$props.componentId + "-" + item.key,
214
- "name": _this.$props.componentId,
215
- "value": item.key,
216
- "readOnly": true,
217
- "type": "radio",
218
- "show": _this.$props.showRadio
219
- },
220
- "on": {
221
- "click": _this.handleClick
222
- },
223
- "domProps": _extends({}, {
224
- checked: _this.currentValue === String(item.key)
225
- })
226
- }), h("label", {
227
- "class": getClassName(_this.$props.innerClass, 'label') || null,
228
- "attrs": {
229
- "for": _this.$props.componentId + "-" + item.key
230
- }
231
- }, [renderItemCalc ? renderItemCalc({
232
- label: item.key,
233
- count: item.doc_count,
234
- isChecked: _this.currentValue === String(item.key)
235
- }) : h("span", [item.key, _this.$props.showCount && h("span", {
236
- "class": getClassName(_this.$props.innerClass, 'count') || null
237
- }, ["\xA0(", item.doc_count, ")"])])])]);
238
- })])]);
225
+ });
239
226
  },
240
227
  methods: {
241
228
  setValue: function setValue(nextValue, props) {
242
229
  var _this2 = this;
243
-
244
230
  if (props === void 0) {
245
231
  props = this.$props;
246
232
  }
247
-
248
233
  var value = nextValue;
249
-
250
234
  if (nextValue === this.$data.currentValue) {
251
235
  value = '';
252
236
  }
253
-
254
237
  var performUpdate = function performUpdate() {
255
238
  _this2.currentValue = value;
256
-
257
239
  _this2.updateQueryHandler(value, props);
258
-
259
240
  _this2.$emit('valueChange', value);
260
-
261
241
  _this2.$emit('value-change', value);
262
242
  };
263
-
264
243
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
265
244
  },
266
245
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
267
246
  var query = SingleList.defaultQuery(value, props);
268
-
269
247
  if (this.defaultQuery) {
270
248
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
271
249
  var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
272
-
273
250
  if (defaultQueryObj) {
274
251
  query = defaultQueryObj;
275
- } // Update calculated default query in store
276
-
252
+ }
277
253
 
254
+ // Update calculated default query in store
278
255
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
279
256
  var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
280
257
  this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
281
258
  }
282
-
283
259
  this.updateQuery({
284
260
  componentId: this.internalComponent,
285
261
  query: query,
@@ -290,7 +266,6 @@ var SingleList = {
290
266
  updateQueryHandler: function updateQueryHandler(value, props) {
291
267
  var customQuery = props.customQuery;
292
268
  var query = SingleList.defaultQuery(value, props);
293
-
294
269
  if (customQuery) {
295
270
  var customQueryCalc = customQuery(value, props);
296
271
  query = extractQueryFromCustomQuery(customQueryCalc);
@@ -298,7 +273,6 @@ var SingleList = {
298
273
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
299
274
  this.setQueryOptions(props.componentId, customQueryOptions, false);
300
275
  }
301
-
302
276
  this.updateQuery({
303
277
  componentId: props.componentId,
304
278
  query: query,
@@ -315,7 +289,6 @@ var SingleList = {
315
289
  },
316
290
  updateQueryHandlerOptions: function updateQueryHandlerOptions(props) {
317
291
  var queryOptions = SingleList.generateQueryOptions(props);
318
-
319
292
  if (props.defaultQuery) {
320
293
  var value = this.$data.currentValue;
321
294
  var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
@@ -329,38 +302,29 @@ var SingleList = {
329
302
  this.searchTerm = value;
330
303
  },
331
304
  renderSearch: function renderSearch() {
332
- var h = this.$createElement;
333
-
334
305
  if (this.$props.showSearch) {
335
- return h(Input, {
306
+ return createVNode(Input, {
336
307
  "class": getClassName(this.$props.innerClass, 'input') || '',
337
- "on": {
338
- "input": this.handleInputChange
339
- },
340
- "attrs": {
341
- "value": this.$data.searchTerm,
342
- "placeholder": this.$props.placeholder,
343
- "themePreset": this.$props.themePreset
344
- },
308
+ "onInput": this.handleInputChange,
309
+ "value": this.$data.searchTerm,
310
+ "placeholder": this.$props.placeholder,
345
311
  "style": {
346
312
  margin: '0 0 8px'
347
- }
348
- });
313
+ },
314
+ "themePreset": this.$props.themePreset
315
+ }, null);
349
316
  }
350
-
351
317
  return null;
352
318
  },
353
319
  getComponent: function getComponent$1() {
354
320
  var _this$$data = this.$data,
355
- currentValue = _this$$data.currentValue,
356
- modifiedOptions = _this$$data.modifiedOptions;
321
+ currentValue = _this$$data.currentValue,
322
+ modifiedOptions = _this$$data.modifiedOptions;
357
323
  var transformData = this.$props.transformData;
358
324
  var itemsToRender = modifiedOptions;
359
-
360
325
  if (transformData) {
361
326
  itemsToRender = transformData(itemsToRender);
362
327
  }
363
-
364
328
  var data = {
365
329
  error: this.error,
366
330
  loading: this.isLoading,
@@ -373,29 +337,23 @@ var SingleList = {
373
337
  },
374
338
  handleClick: function handleClick(e) {
375
339
  var currentValue = e;
376
-
377
340
  if (isEvent(e)) {
378
341
  currentValue = e.target.value;
379
342
  }
380
-
381
343
  if (this.enableStrictSelection && currentValue === this.currentValue) {
382
344
  return false;
383
345
  }
384
-
385
346
  var value = this.$props.value;
386
-
387
347
  if (value === undefined) {
388
348
  this.setValue(currentValue);
389
349
  } else {
390
350
  this.$emit('change', currentValue);
391
351
  }
392
-
393
352
  return true;
394
353
  },
395
354
  renderNoResult: function renderNoResult() {
396
- var h = this.$createElement;
397
- var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
398
- return h("p", {
355
+ var renderNoResults = this.$slots.renderNoResults || this.$props.renderNoResults;
356
+ return createVNode("p", {
399
357
  "class": getClassName(this.$props.innerClass, 'noResults') || null
400
358
  }, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
401
359
  }
@@ -406,96 +364,54 @@ var SingleList = {
406
364
  }
407
365
  }
408
366
  };
409
-
410
367
  SingleList.generateQueryOptions = function (props) {
411
368
  var queryOptions = getQueryOptions(props);
412
369
  return getAggsQuery(queryOptions, props);
413
370
  };
414
-
415
371
  SingleList.defaultQuery = function (value, props) {
416
- var query = null;
417
-
418
- if (props.selectAllLabel && props.selectAllLabel === value) {
419
- if (props.showMissing) {
420
- query = {
421
- match_all: {}
422
- };
423
- }
424
-
425
- query = {
426
- exists: {
427
- field: props.dataField
428
- }
429
- };
430
- }
431
-
432
- if (value) {
433
- var _term;
434
-
435
- query = {
436
- term: (_term = {}, _term[props.dataField] = value, _term)
437
- };
438
-
439
- if (props.showMissing && props.missingLabel === value) {
440
- query = {
441
- bool: {
442
- must_not: {
443
- exists: {
444
- field: props.dataField
445
- }
446
- }
447
- }
448
- };
372
+ return {
373
+ query: {
374
+ queryFormat: props.queryFormat,
375
+ dataField: props.dataField,
376
+ value: value,
377
+ nestedField: props.nestedField,
378
+ selectAllLabel: props.selectAllLabel,
379
+ showMissing: props.showMissing
449
380
  }
450
- }
451
-
452
- if (query && props.nestedField) {
453
- return {
454
- query: {
455
- nested: {
456
- path: props.nestedField,
457
- query: query
458
- }
459
- }
460
- };
461
- }
462
-
463
- return query;
381
+ };
464
382
  };
465
-
466
383
  SingleList.hasInternalComponent = function () {
467
384
  return true;
468
385
  };
469
-
470
386
  var mapStateToProps = function mapStateToProps(state, props) {
471
387
  return {
472
388
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
473
389
  rawData: state.rawData[props.componentId],
474
390
  isLoading: state.isLoading[props.componentId],
475
391
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || '',
392
+ totalDocumentCount: state.hits[props.componentId] && state.hits[props.componentId].total,
476
393
  themePreset: state.config.themePreset,
477
394
  error: state.error[props.componentId],
478
- componentProps: state.props[props.componentId],
479
- enableAppbase: state.config.enableAppbase
395
+ componentProps: state.props[props.componentId]
480
396
  };
481
397
  };
482
-
483
398
  var mapDispatchtoProps = {
484
399
  setQueryOptions: setQueryOptions,
485
400
  updateQuery: updateQuery,
486
401
  setCustomQuery: setCustomQuery,
487
402
  setDefaultQuery: setDefaultQuery
488
403
  };
489
- var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleList), {
404
+ var ListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleList), {
490
405
  componentType: componentTypes.singleList,
491
406
  internalComponent: SingleList.hasInternalComponent()
492
- });
493
-
494
- SingleList.install = function (Vue) {
495
- Vue.component(SingleList.name, ListConnected);
496
- }; // Add componentType for SSR
497
-
407
+ }));
408
+ ListConnected.name = SingleList.name;
409
+ ListConnected.install = function (Vue) {
410
+ Vue.component(ListConnected.name, ListConnected);
411
+ };
498
412
 
499
- SingleList.componentType = componentTypes.singleList;
413
+ // Add componentType for SSR
414
+ ListConnected.componentType = componentTypes.singleList;
500
415
 
501
- export default SingleList;
416
+ export default ListConnected;
417
+ export { ListConnected };