@appbaseio/reactivesearch-vue 1.34.0-alpha.1 → 1.34.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 (71) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1175 -1297
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -11
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{ComponentWrapper-9318cece.js → ComponentWrapper-94c50228.js} +16 -7
  6. package/dist/cjs/DataSearch.js +1310 -17
  7. package/dist/cjs/{DropDown-8984b544.js → DropDown-7a52c661.js} +2 -2
  8. package/dist/cjs/DynamicRangeSlider.js +12 -8
  9. package/dist/cjs/MultiDropdownList.js +11 -8
  10. package/dist/cjs/MultiList.js +10 -8
  11. package/dist/cjs/MultiRange.js +7 -4
  12. package/dist/cjs/{Pagination-07f4dbad.js → Pagination-e56a5b79.js} +1 -1
  13. package/dist/cjs/{PreferencesConsumer-5d67b486.js → PreferencesConsumer-5e6e84a2.js} +1 -1
  14. package/dist/cjs/RangeInput.js +4 -4
  15. package/dist/cjs/RangeSlider.js +7 -4
  16. package/dist/cjs/ReactiveBase.js +10 -6
  17. package/dist/cjs/ReactiveComponent.js +316 -45
  18. package/dist/cjs/{ReactiveComponent-0a354ed7.js → ReactiveComponentPrivate-244c6055.js} +32 -318
  19. package/dist/cjs/ReactiveComponentPrivate.js +55 -0
  20. package/dist/cjs/ReactiveGoogleMap.js +139 -108
  21. package/dist/cjs/ReactiveList.js +17 -6
  22. package/dist/cjs/ResultCard.js +1 -1
  23. package/dist/cjs/ResultList.js +1 -1
  24. package/dist/cjs/SelectedFilters.js +2 -2
  25. package/dist/cjs/SingleDropdownList.js +10 -8
  26. package/dist/cjs/SingleList.js +10 -8
  27. package/dist/cjs/SingleRange.js +7 -4
  28. package/dist/cjs/StateProvider.js +1 -1
  29. package/dist/cjs/Tags-4ec43831.js +883 -0
  30. package/dist/cjs/ToggleButton.js +6 -4
  31. package/dist/cjs/{index-30126fd0.js → index-de136c17.js} +2 -0
  32. package/dist/cjs/index.js +14 -11
  33. package/dist/cjs/initReactivesearch.js +0 -3
  34. package/dist/cjs/install.js +11 -9
  35. package/dist/cjs/version.js +1 -1
  36. package/dist/cjs/{vueTypes-7cfc2f98.js → vueTypes-b7007f5f.js} +2 -1
  37. package/dist/es/{ComponentWrapper-240450cc.js → ComponentWrapper-edaeaceb.js} +16 -7
  38. package/dist/es/DataSearch.js +1310 -15
  39. package/dist/es/{DropDown-28ddce07.js → DropDown-2c0dd714.js} +2 -2
  40. package/dist/es/DynamicRangeSlider.js +12 -8
  41. package/dist/es/MultiDropdownList.js +11 -8
  42. package/dist/es/MultiList.js +10 -8
  43. package/dist/es/MultiRange.js +7 -4
  44. package/dist/es/{Pagination-28e56c5c.js → Pagination-edeb7dbe.js} +1 -1
  45. package/dist/es/{PreferencesConsumer-bc097ebb.js → PreferencesConsumer-86a676c8.js} +1 -1
  46. package/dist/es/RangeInput.js +4 -4
  47. package/dist/es/RangeSlider.js +7 -4
  48. package/dist/es/ReactiveBase.js +10 -6
  49. package/dist/es/ReactiveComponent.js +316 -44
  50. package/dist/es/{ReactiveComponent-9352370c.js → ReactiveComponentPrivate-6f16e1b7.js} +19 -305
  51. package/dist/es/ReactiveComponentPrivate.js +47 -0
  52. package/dist/es/ReactiveGoogleMap.js +139 -108
  53. package/dist/es/ReactiveList.js +17 -6
  54. package/dist/es/ResultCard.js +1 -1
  55. package/dist/es/ResultList.js +1 -1
  56. package/dist/es/SelectedFilters.js +2 -2
  57. package/dist/es/SingleDropdownList.js +10 -8
  58. package/dist/es/SingleList.js +10 -8
  59. package/dist/es/SingleRange.js +7 -4
  60. package/dist/es/StateProvider.js +1 -1
  61. package/dist/es/Tags-1c2d6c4d.js +869 -0
  62. package/dist/es/ToggleButton.js +6 -4
  63. package/dist/es/{index-0444a498.js → index-5509c0bc.js} +2 -0
  64. package/dist/es/index.js +10 -8
  65. package/dist/es/initReactivesearch.js +0 -3
  66. package/dist/es/install.js +11 -9
  67. package/dist/es/version.js +1 -1
  68. package/dist/es/{vueTypes-8986b709.js → vueTypes-66ebc93e.js} +2 -1
  69. package/package.json +87 -87
  70. package/dist/cjs/DataSearch-8ea2651a.js +0 -2175
  71. package/dist/es/DataSearch-dcaa106b.js +0 -2159
@@ -11,14 +11,14 @@ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
11
11
  var styled = require('@appbaseio/vue-emotion');
12
12
  var styled__default = _interopDefault(styled);
13
13
  var Button = require('./Button-841fd06d.js');
14
- var vueTypes = require('./vueTypes-7cfc2f98.js');
14
+ var vueTypes = require('./vueTypes-b7007f5f.js');
15
15
  var ReactiveList = require('./ReactiveList.js');
16
- var index = require('./index-30126fd0.js');
17
- var ComponentWrapper = require('./ComponentWrapper-9318cece.js');
18
- var PreferencesConsumer = require('./PreferencesConsumer-5d67b486.js');
16
+ var index = require('./index-de136c17.js');
17
+ var ComponentWrapper = require('./ComponentWrapper-94c50228.js');
18
+ var PreferencesConsumer = require('./PreferencesConsumer-5e6e84a2.js');
19
19
  var Title = require('./Title-16042ea0.js');
20
20
  var hotkeys = _interopDefault(require('hotkeys-js'));
21
- var DataSearch = require('./DataSearch-8ea2651a.js');
21
+ var Tags = require('./Tags-4ec43831.js');
22
22
  var CancelSvg = require('./CancelSvg-220a7cc3.js');
23
23
  var Input = require('./Input-ead4cd84.js');
24
24
  var Container = require('./Container-e699ea95.js');
@@ -27,6 +27,7 @@ var MultiList = require('./MultiList.js');
27
27
  var SingleDropdownList = require('./SingleDropdownList.js');
28
28
  var MultiDropdownList = require('./MultiDropdownList.js');
29
29
  var ToggleButton = require('./ToggleButton.js');
30
+ var ReactiveComponent = require('./ReactiveComponent.js');
30
31
  var DynamicRangeSlider = require('./DynamicRangeSlider.js');
31
32
  var SingleRange = require('./SingleRange.js');
32
33
  var MultiRange = require('./MultiRange.js');
@@ -273,7 +274,6 @@ var SearchBox = {
273
274
  // selected value is cleared, call onValueSelected
274
275
  this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
275
276
  }
276
- // if (this.$props.value === undefined) {
277
277
  if (this.$options.isTagsMode) {
278
278
  // handling reset of tags through SelectedFilters or URL
279
279
  this.selectedTags = [];
@@ -283,7 +283,6 @@ var SearchBox = {
283
283
  cause = configureStore.causes.SUGGESTION_SELECT;
284
284
  }
285
285
  this.setValue(newVal || '', true, this.$props, cause);
286
- // }
287
286
  }
288
287
  },
289
288
  focusShortcuts: function focusShortcuts() {
@@ -426,8 +425,7 @@ var SearchBox = {
426
425
  if (typeof value === 'string' && !!value) {
427
426
  _this.selectedTags.push(value);
428
427
  } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
429
- var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
430
- _this.selectedTags = mergedArray;
428
+ _this.selectedTags = value;
431
429
  }
432
430
  } else if (value) {
433
431
  _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
@@ -669,7 +667,7 @@ var SearchBox = {
669
667
  renderIcon: function renderIcon() {
670
668
  var h = this.$createElement;
671
669
  if (this.$props.showIcon) {
672
- return this.$props.icon || h(DataSearch.SearchSvg);
670
+ return this.$props.icon || h(Tags.SearchSvg);
673
671
  }
674
672
  return null;
675
673
  },
@@ -677,7 +675,7 @@ var SearchBox = {
677
675
  var h = this.$createElement;
678
676
  var renderError = this.$scopedSlots.renderError || this.$props.renderError;
679
677
  if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
680
- return h(DataSearch.SuggestionWrapper, {
678
+ return h(Tags.SuggestionWrapper, {
681
679
  "attrs": {
682
680
  "innerClass": this.$props.innerClass,
683
681
  "innerClassName": "error",
@@ -709,7 +707,7 @@ var SearchBox = {
709
707
  isOpen = _this$$data.isOpen,
710
708
  currentValue = _this$$data.currentValue;
711
709
  if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
712
- return h(DataSearch.SuggestionWrapper, {
710
+ return h(Tags.SuggestionWrapper, {
713
711
  "attrs": {
714
712
  "innerClass": innerClass,
715
713
  "themePreset": this.themePreset,
@@ -729,7 +727,7 @@ var SearchBox = {
729
727
  var h = this.$createElement;
730
728
  var addonBefore = this.$scopedSlots.addonBefore;
731
729
  if (addonBefore) {
732
- return h(DataSearch.InputAddon, {
730
+ return h(Tags.InputAddon, {
733
731
  "class": "addon-before"
734
732
  }, [addonBefore()]);
735
733
  }
@@ -739,7 +737,7 @@ var SearchBox = {
739
737
  var h = this.$createElement;
740
738
  var addonAfter = this.$scopedSlots.addonAfter;
741
739
  if (addonAfter) {
742
- return h(DataSearch.InputAddon, {
740
+ return h(Tags.InputAddon, {
743
741
  "class": "addon-after"
744
742
  }, [addonAfter()]);
745
743
  }
@@ -804,7 +802,7 @@ var SearchBox = {
804
802
  "showIcon": showIcon,
805
803
  "isClearIcon": true
806
804
  }
807
- }, [this.renderCancelIcon()]), showVoiceSearch && h(DataSearch.Mic, {
805
+ }, [this.renderCancelIcon()]), showVoiceSearch && h(Tags.Mic, {
808
806
  "attrs": {
809
807
  "getInstance": getMicInstance,
810
808
  "render": renderMic,
@@ -892,7 +890,7 @@ var SearchBox = {
892
890
  var _this7 = this;
893
891
  var h = this.$createElement;
894
892
  var innerClass = this.$props.innerClass;
895
- return h(DataSearch.TagItem, {
893
+ return h(Tags.TagItem, {
896
894
  "class": getClassName(innerClass, 'selected-tag') || ''
897
895
  }, [h("span", [item]), h("span", {
898
896
  "attrs": {
@@ -936,9 +934,9 @@ var SearchBox = {
936
934
  values: this.selectedTags,
937
935
  handleClear: this.clearTag,
938
936
  handleClearAll: this.clearAllTags
939
- }) : h(DataSearch.TagsContainer, [tagsList.map(function (item) {
937
+ }) : h(Tags.TagsContainer, [tagsList.map(function (item) {
940
938
  return _this8.renderTag(item);
941
- }), shouldRenderClearAllTag && h(DataSearch.TagItem, {
939
+ }), shouldRenderClearAllTag && h(Tags.TagItem, {
942
940
  "class": getClassName(this.$props.innerClass, 'selected-tag') || ''
943
941
  }, [h("span", ["Clear All"]), h("span", {
944
942
  "attrs": {
@@ -1033,13 +1031,13 @@ var SearchBox = {
1033
1031
  padding: '0 10px 0 0',
1034
1032
  display: 'flex'
1035
1033
  }
1036
- }, [h(DataSearch.CustomSvg, {
1034
+ }, [h(Tags.CustomSvg, {
1037
1035
  "attrs": {
1038
1036
  "className": getClassName(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1039
1037
  "icon": getIcon(item._suggestion_type),
1040
1038
  "type": item._suggestion_type + "-search-icon"
1041
1039
  }
1042
- })]), h(DataSearch.SuggestionItem, {
1040
+ })]), h(Tags.SuggestionItem, {
1043
1041
  "attrs": {
1044
1042
  "currentValue": _this9.currentValue,
1045
1043
  "suggestion": item
@@ -1049,7 +1047,7 @@ var SearchBox = {
1049
1047
  };
1050
1048
  return h("div", {
1051
1049
  "class": Input.suggestionsContainer
1052
- }, [h(DataSearch.InputGroup, [_this9.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1050
+ }, [h(Tags.InputGroup, [_this9.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1053
1051
  "attrs": {
1054
1052
  "id": _this9.$props.componentId + "-input",
1055
1053
  "showIcon": _this9.$props.showIcon,
@@ -1091,7 +1089,7 @@ var SearchBox = {
1091
1089
  }
1092
1090
  }) : h("div", {
1093
1091
  "class": Input.suggestionsContainer
1094
- }, [h(DataSearch.InputGroup, [this.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1092
+ }, [h(Tags.InputGroup, [this.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1095
1093
  "class": getClassName(this.$props.innerClass, 'input') || '',
1096
1094
  "attrs": {
1097
1095
  "placeholder": this.$props.placeholder,
@@ -1129,6 +1127,9 @@ var SearchBox = {
1129
1127
  document.removeEventListener('keydown', this.onKeyDown);
1130
1128
  }
1131
1129
  };
1130
+ SearchBox.hasInternalComponent = function () {
1131
+ return true;
1132
+ };
1132
1133
  SearchBox.defaultQuery = function (value, props) {
1133
1134
  var finalQuery = null;
1134
1135
  var fields = normalizeDataField(props.dataField, props.fieldWeights);
@@ -1252,310 +1253,23 @@ var SBConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.Compo
1252
1253
  internalComponent: true
1253
1254
  }));
1254
1255
  SBConnected.name = SearchBox.name;
1256
+ SBConnected.defaultQuery = SearchBox.defaultQuery;
1257
+ SBConnected.shouldQuery = SearchBox.shouldQuery;
1258
+ SBConnected.hasInternalComponent = SearchBox.hasInternalComponent;
1255
1259
  SBConnected.install = function (Vue) {
1256
1260
  Vue.component(SBConnected.name, SBConnected);
1257
1261
  };
1258
1262
  // Add componentType for SSR
1259
1263
  SBConnected.componentType = constants.componentTypes.searchBox;
1260
1264
 
1261
- var _excluded = ["options"];
1262
- var updateQuery$1 = configureStore.Actions.updateQuery,
1263
- setQueryOptions = configureStore.Actions.setQueryOptions,
1264
- setCustomQuery$1 = configureStore.Actions.setCustomQuery,
1265
- setDefaultQuery$1 = configureStore.Actions.setDefaultQuery;
1266
- var parseHits = configureStore.helper.parseHits,
1267
- isEqual$1 = configureStore.helper.isEqual,
1268
- getCompositeAggsQuery$1 = configureStore.helper.getCompositeAggsQuery,
1269
- getResultStats$1 = configureStore.helper.getResultStats,
1270
- extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
1271
- getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
1272
- var ReactiveComponent = {
1273
- name: 'ReactiveComponent',
1274
- props: {
1275
- componentId: vueTypes.types.stringRequired,
1276
- aggregationField: vueTypes.types.string,
1277
- aggregationSize: VueTypes.number,
1278
- size: VueTypes.number,
1279
- defaultQuery: vueTypes.types.func,
1280
- customQuery: vueTypes.types.func,
1281
- filterLabel: vueTypes.types.string,
1282
- react: vueTypes.types.react,
1283
- showFilter: VueTypes.bool.def(true),
1284
- URLParams: VueTypes.bool.def(false),
1285
- distinctField: vueTypes.types.string,
1286
- distinctFieldConfig: vueTypes.types.props,
1287
- index: VueTypes.string,
1288
- endpoint: vueTypes.types.endpointConfig
1289
- },
1290
- created: function created() {
1291
- var _this = this;
1292
- var props = this.$props;
1293
- this.internalComponent = null;
1294
- this.$defaultQuery = null;
1295
- // Set custom query in store
1296
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
1297
- var customQuery = props.customQuery,
1298
- componentId = props.componentId,
1299
- filterLabel = props.filterLabel,
1300
- showFilter = props.showFilter,
1301
- URLParams = props.URLParams,
1302
- distinctField = props.distinctField,
1303
- distinctFieldConfig = props.distinctFieldConfig,
1304
- index$1 = props.index;
1305
- if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
1306
- console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
1307
- }
1308
- if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
1309
- console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
1310
- }
1311
- if (!this.enableAppbase && index$1) {
1312
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
1313
- }
1314
- if (customQuery) {
1315
- var calcCustomQuery = customQuery(this.selectedValue, props);
1316
- var query = extractQueryFromCustomQuery(calcCustomQuery);
1317
- var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
1318
- if (customQueryOptions) {
1319
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
1320
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
1321
- this.updateQuery({
1322
- componentId: componentId,
1323
- query: query,
1324
- value: this.selectedValue || null,
1325
- label: filterLabel,
1326
- showFilter: showFilter,
1327
- URLParams: URLParams
1328
- });
1329
- }
1330
- this.setQuery = function (_ref) {
1331
- var options = _ref.options,
1332
- obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
1333
- var queryToBeSet = obj.query;
1334
-
1335
- // when enableAppbase is true, Backend throws error because of repeated query in request body
1336
- if (queryToBeSet && queryToBeSet.query) {
1337
- queryToBeSet = queryToBeSet.query;
1338
- }
1339
- var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
1340
- query: queryToBeSet
1341
- });
1342
- var rsAPIQuery = customQueryCalc;
1343
- // handle stored queries
1344
- if (queryToBeSet && queryToBeSet.id) {
1345
- rsAPIQuery = queryToBeSet;
1346
- }
1347
- // Update customQuery field for RS API
1348
- _this.setCustomQuery(props.componentId, rsAPIQuery);
1349
- if (options) {
1350
- _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
1351
- }
1352
- _this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
1353
- query: customQueryCalc.query,
1354
- componentId: props.componentId,
1355
- label: props.filterLabel,
1356
- showFilter: props.showFilter,
1357
- URLParams: props.URLParams
1358
- }));
1359
- };
1360
- if (props.defaultQuery) {
1361
- this.internalComponent = props.componentId + "__internal";
1362
- }
1363
- if (this.internalComponent && this.$props.defaultQuery) {
1364
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
1365
- this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
1366
- var _query = extractQueryFromCustomQuery(this.$defaultQuery);
1367
- var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1368
- if (queryOptions) {
1369
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
1370
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
1371
- this.updateQuery({
1372
- componentId: this.internalComponent,
1373
- query: _query
1374
- });
1375
- }
1376
- },
1377
- watch: {
1378
- hits: function hits(newVal, oldVal) {
1379
- if (!isEqual$1(newVal, oldVal)) {
1380
- this.$emit('data', this.getData());
1381
- }
1382
- },
1383
- rawData: function rawData(newVal, oldVal) {
1384
- if (!isEqual$1(newVal, oldVal)) {
1385
- this.$emit('data', this.getData());
1386
- }
1387
- },
1388
- aggregations: function aggregations(newVal, oldVal) {
1389
- if (!isEqual$1(newVal, oldVal)) {
1390
- this.$emit('data', this.getData());
1391
- }
1392
- },
1393
- aggregationData: function aggregationData(newVal, oldVal) {
1394
- if (!isEqual$1(newVal, oldVal)) {
1395
- this.$emit('data', this.getData());
1396
- }
1397
- },
1398
- promotedResults: function promotedResults(newVal, oldVal) {
1399
- if (!isEqual$1(newVal, oldVal)) {
1400
- this.$emit('data', this.getData());
1401
- }
1402
- },
1403
- hidden: function hidden(newVal, oldVal) {
1404
- if (!isEqual$1(newVal, oldVal)) {
1405
- this.$emit('data', this.getData());
1406
- }
1407
- },
1408
- total: function total(newVal, oldVal) {
1409
- if (!isEqual$1(newVal, oldVal)) {
1410
- this.$emit('data', this.getData());
1411
- }
1412
- },
1413
- time: function time(newVal, oldVal) {
1414
- if (!isEqual$1(newVal, oldVal)) {
1415
- this.$emit('data', this.getData());
1416
- }
1417
- },
1418
- defaultQuery: function defaultQuery(newVal, oldVal) {
1419
- if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
1420
- this.$defaultQuery = newVal(this.selectedValue, this.$props);
1421
- var query = extractQueryFromCustomQuery(this.$defaultQuery);
1422
- var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1423
- if (queryOptions) {
1424
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
1425
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
1426
- // Update default query for RS API
1427
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
1428
- this.updateQuery({
1429
- componentId: this.internalComponent,
1430
- query: query
1431
- });
1432
- }
1433
- },
1434
- customQuery: function customQuery(newVal, oldVal) {
1435
- if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
1436
- var componentId = this.$props.componentId;
1437
- this.$customQuery = newVal(this.selectedValue, this.$props);
1438
- var query = extractQueryFromCustomQuery(this.$customQuery);
1439
- var queryOptions = getOptionsForCustomQuery(this.$customQuery);
1440
- if (queryOptions) {
1441
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
1442
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
1443
-
1444
- // Update custom query for RS API
1445
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
1446
- this.updateQuery({
1447
- componentId: componentId,
1448
- query: query
1449
- });
1450
- }
1451
- }
1452
- },
1453
- render: function render() {
1454
- var h = arguments[0];
1455
- try {
1456
- var dom = this.$scopedSlots["default"];
1457
- var error = this.error,
1458
- isLoading = this.isLoading,
1459
- selectedValue = this.selectedValue;
1460
- var propsToBePassed = _rollupPluginBabelHelpers._extends({
1461
- error: error,
1462
- loading: isLoading
1463
- }, this.getData(), {
1464
- value: selectedValue,
1465
- setQuery: this.setQuery
1466
- });
1467
- return h("div", [dom(propsToBePassed)]);
1468
- } catch (e) {
1469
- return null;
1470
- }
1471
- },
1472
- methods: {
1473
- getAggsQuery: function getAggsQuery() {
1474
- if (this.aggregationField) {
1475
- return {
1476
- aggs: getCompositeAggsQuery$1({
1477
- props: this.$props,
1478
- showTopHits: true,
1479
- value: this.selectedValue
1480
- }).aggs
1481
- };
1482
- }
1483
- return {};
1484
- },
1485
- getData: function getData() {
1486
- var hits = this.hits,
1487
- aggregations = this.aggregations,
1488
- aggregationData = this.aggregationData,
1489
- promotedResults = this.promotedResults,
1490
- rawData = this.rawData;
1491
- var filteredResults = parseHits(hits);
1492
- if (promotedResults.length) {
1493
- var ids = promotedResults.map(function (item) {
1494
- return item._id;
1495
- }).filter(Boolean);
1496
- if (ids) {
1497
- filteredResults = filteredResults.filter(function (item) {
1498
- return !ids.includes(item._id);
1499
- });
1500
- }
1501
- filteredResults = [].concat(promotedResults, filteredResults);
1502
- }
1503
- return {
1504
- data: filteredResults,
1505
- aggregationData: aggregationData,
1506
- rawData: rawData,
1507
- aggregations: aggregations,
1508
- promotedData: promotedResults,
1509
- resultStats: this.stats
1510
- };
1511
- }
1512
- },
1513
- computed: {
1514
- stats: function stats() {
1515
- return getResultStats$1(this);
1516
- }
1517
- }
1518
- };
1519
- ReactiveComponent.hasInternalComponent = function (props) {
1520
- return !!props.defaultQuery;
1521
- };
1522
- var mapStateToProps$1 = function mapStateToProps(state, props) {
1523
- return {
1524
- aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
1525
- aggregationData: state.compositeAggregations[props.componentId] || [],
1526
- hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
1527
- rawData: state.rawData[props.componentId],
1528
- error: state.error[props.componentId],
1529
- isLoading: state.isLoading[props.componentId],
1530
- selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
1531
- promotedResults: state.promotedResults[props.componentId] || [],
1532
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1533
- total: state.hits[props.componentId] && state.hits[props.componentId].total,
1534
- hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
1535
- componentProps: state.props[props.componentId],
1536
- enableAppbase: state.config.enableAppbase
1537
- };
1538
- };
1539
- var mapDispatchtoProps = {
1540
- setQueryOptions: setQueryOptions,
1541
- updateQuery: updateQuery$1,
1542
- setCustomQuery: setCustomQuery$1,
1543
- setDefaultQuery: setDefaultQuery$1
1544
- };
1545
- var ConnectedComponent = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveComponent), {
1546
- componentType: constants.componentTypes.reactiveComponent
1547
- });
1548
1265
  var RcConnected = PreferencesConsumer.PreferencesConsumer({
1549
1266
  name: 'RcConnected',
1550
1267
  render: function render(h) {
1551
- var component = ConnectedComponent;
1268
+ var component = ReactiveComponent.default;
1552
1269
  switch (this.$attrs.componentType) {
1553
1270
  case constants.componentTypes.reactiveList:
1554
1271
  component = ReactiveList.RLConnected;
1555
1272
  break;
1556
- case constants.componentTypes.dataSearch:
1557
- component = DataSearch.DSConnected;
1558
- break;
1559
1273
  case constants.componentTypes.searchBox:
1560
1274
  component = SBConnected;
1561
1275
  break;
@@ -1601,13 +1315,13 @@ var RcConnected = PreferencesConsumer.PreferencesConsumer({
1601
1315
  });
1602
1316
  }
1603
1317
  });
1604
- RcConnected.name = ReactiveComponent.name;
1318
+ RcConnected.name = 'ReactiveComponentPrivate';
1319
+ RcConnected.hasInternalComponent = ReactiveComponent.default.hasInternalComponent;
1320
+ // Add componentType for SSR
1321
+ RcConnected.componentType = constants.componentTypes.reactiveComponent;
1605
1322
  RcConnected.install = function (Vue) {
1606
1323
  Vue.component(RcConnected.name, RcConnected);
1607
1324
  };
1608
1325
 
1609
- // Add componentType for SSR
1610
- RcConnected.componentType = constants.componentTypes.reactiveComponent;
1611
-
1612
- exports.ReactiveComponent = RcConnected;
1326
+ exports.ReactiveComponentPrivate = RcConnected;
1613
1327
  exports.SearchBox = SBConnected;
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('@appbaseio/reactivecore');
6
+ require('@appbaseio/reactivecore/lib/utils/constants');
7
+ require('./_rollupPluginBabelHelpers-f8b843f8.js');
8
+ require('vue-types');
9
+ require('@appbaseio/reactivecore/lib/utils/helper');
10
+ require('emotion');
11
+ require('@appbaseio/vue-emotion');
12
+ require('polished');
13
+ require('./Button-841fd06d.js');
14
+ require('./vueTypes-b7007f5f.js');
15
+ require('./Pagination-e56a5b79.js');
16
+ require('./ReactiveList.js');
17
+ require('@appbaseio/reactivecore/lib/utils/transform');
18
+ require('redux');
19
+ require('./index-de136c17.js');
20
+ require('./ComponentWrapper-94c50228.js');
21
+ require('./PreferencesConsumer-5e6e84a2.js');
22
+ require('@vue/babel-helper-vue-jsx-merge-props');
23
+ require('./Title-16042ea0.js');
24
+ require('./ListItem-5088bd6a.js');
25
+ require('./Card-240f283d.js');
26
+ require('./Flex-ddd7cb6b.js');
27
+ require('hotkeys-js');
28
+ require('./Tags-4ec43831.js');
29
+ require('./CancelSvg-220a7cc3.js');
30
+ require('./Input-ead4cd84.js');
31
+ require('compute-scroll-into-view');
32
+ require('./Container-e699ea95.js');
33
+ require('vue-highlight-words');
34
+ var ReactiveComponentPrivate = require('./ReactiveComponentPrivate-244c6055.js');
35
+ require('@appbaseio/reactivecore/lib/utils/suggestions');
36
+ require('./FormControlList-bbb5cd24.js');
37
+ require('./utils-83fd01e9.js');
38
+ require('./SingleList.js');
39
+ require('./MultiList.js');
40
+ require('./DropDown-7a52c661.js');
41
+ require('./SingleDropdownList.js');
42
+ require('./MultiDropdownList.js');
43
+ require('./ToggleButton.js');
44
+ require('./ReactiveComponent.js');
45
+ require('vue-no-ssr');
46
+ require('./ssr-f2fc1bf6.js');
47
+ require('./DynamicRangeSlider.js');
48
+ require('./SingleRange.js');
49
+ require('./MultiRange.js');
50
+ require('./RangeSlider.js');
51
+ require('./RangeInput.js');
52
+
53
+
54
+
55
+ exports.default = ReactiveComponentPrivate.ReactiveComponentPrivate;