@appbaseio/reactivesearch-vue 1.30.0 → 1.31.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 (61) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +553 -195
  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/{ComponentWrapper-5cb08414.js → ComponentWrapper-6909bc2a.js} +1 -1
  6. package/dist/cjs/{DataSearch-e550096e.js → DataSearch-a8fabd77.js} +5 -4
  7. package/dist/cjs/DataSearch.js +4 -4
  8. package/dist/cjs/{DropDown-fc59f1ee.js → DropDown-aa358fff.js} +2 -2
  9. package/dist/cjs/DynamicRangeSlider.js +4 -3
  10. package/dist/cjs/MultiDropdownList.js +6 -5
  11. package/dist/cjs/MultiList.js +5 -4
  12. package/dist/cjs/MultiRange.js +5 -4
  13. package/dist/cjs/RangeInput.js +5 -4
  14. package/dist/cjs/RangeSlider.js +5 -4
  15. package/dist/cjs/ReactiveBase.js +36 -12
  16. package/dist/cjs/ReactiveComponent.js +5 -4
  17. package/dist/cjs/ReactiveList.js +15 -9
  18. package/dist/cjs/ResultCard.js +1 -1
  19. package/dist/cjs/ResultList.js +1 -1
  20. package/dist/cjs/SelectedFilters.js +5 -5
  21. package/dist/cjs/SingleDropdownList.js +6 -5
  22. package/dist/cjs/SingleList.js +5 -4
  23. package/dist/cjs/SingleRange.js +5 -4
  24. package/dist/cjs/StateProvider.js +1 -1
  25. package/dist/cjs/ToggleButton.js +5 -4
  26. package/dist/cjs/{index-2cd3650b.js → index-2e0ea8d8.js} +12 -0
  27. package/dist/cjs/index.js +6 -6
  28. package/dist/cjs/initReactivesearch.js +38 -6
  29. package/dist/cjs/{install-250a14f1.js → install-27314778.js} +12 -10
  30. package/dist/cjs/install.js +6 -6
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-3970ff42.js} +6 -0
  33. package/dist/es/{ComponentWrapper-dc92772a.js → ComponentWrapper-ca0354ea.js} +1 -1
  34. package/dist/es/{DataSearch-8e5d0972.js → DataSearch-da9347f7.js} +5 -4
  35. package/dist/es/DataSearch.js +4 -4
  36. package/dist/es/{DropDown-565fad6f.js → DropDown-604374d2.js} +2 -2
  37. package/dist/es/DynamicRangeSlider.js +4 -3
  38. package/dist/es/MultiDropdownList.js +6 -5
  39. package/dist/es/MultiList.js +5 -4
  40. package/dist/es/MultiRange.js +5 -4
  41. package/dist/es/RangeInput.js +5 -4
  42. package/dist/es/RangeSlider.js +5 -4
  43. package/dist/es/ReactiveBase.js +37 -13
  44. package/dist/es/ReactiveComponent.js +5 -4
  45. package/dist/es/ReactiveList.js +15 -9
  46. package/dist/es/ResultCard.js +1 -1
  47. package/dist/es/ResultList.js +1 -1
  48. package/dist/es/SelectedFilters.js +3 -3
  49. package/dist/es/SingleDropdownList.js +6 -5
  50. package/dist/es/SingleList.js +5 -4
  51. package/dist/es/SingleRange.js +5 -4
  52. package/dist/es/StateProvider.js +1 -1
  53. package/dist/es/ToggleButton.js +5 -4
  54. package/dist/es/{index-5371a13f.js → index-4715798c.js} +12 -1
  55. package/dist/es/index.js +7 -7
  56. package/dist/es/initReactivesearch.js +39 -7
  57. package/dist/es/{install-9faa87f1.js → install-5d9cb7ed.js} +10 -8
  58. package/dist/es/install.js +6 -6
  59. package/dist/es/version.js +1 -1
  60. package/dist/es/{vueTypes-687b2304.js → vueTypes-c0d8b875.js} +6 -0
  61. package/package.json +3 -3
@@ -7,11 +7,11 @@ import { css } from 'emotion';
7
7
  import styled from '@appbaseio/vue-emotion';
8
8
  import 'polished';
9
9
  import { p as pagination, B as Button } from './Button-e18ad90f.js';
10
- import { t as types } from './vueTypes-687b2304.js';
10
+ import { t as types } from './vueTypes-c0d8b875.js';
11
11
  import '@appbaseio/reactivecore/lib/utils/transform';
12
12
  import 'redux';
13
- import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-5371a13f.js';
14
- import { C as ComponentWrapper } from './ComponentWrapper-dc92772a.js';
13
+ import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-4715798c.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-ca0354ea.js';
15
15
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
16
16
  import './Title-35edd732.js';
17
17
  import { c as container } from './ListItem-41d6ddd7.js';
@@ -72,6 +72,7 @@ var Pagination = {
72
72
  showEndPage = props.showEndPage;
73
73
  var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
74
74
  var paginationButtons = [];
75
+ var endPage = start;
75
76
 
76
77
  if (start <= totalPages) {
77
78
  var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
@@ -109,6 +110,10 @@ var Pagination = {
109
110
 
110
111
  if (i <= totalPages + 1) {
111
112
  paginationButtons.push(pageBtn);
113
+
114
+ if (i === Math.min(totalPages + 1, totalPagesToShow) - 1) {
115
+ endPage = i;
116
+ }
112
117
  }
113
118
  };
114
119
 
@@ -117,7 +122,7 @@ var Pagination = {
117
122
  }
118
123
  }
119
124
 
120
- return paginationButtons;
125
+ return [paginationButtons, start, endPage];
121
126
  };
122
127
 
123
128
  var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
@@ -125,10 +130,10 @@ var Pagination = {
125
130
  currentPage = props.currentPage,
126
131
  totalPages = props.totalPages,
127
132
  pages = props.pages;
128
- if (!showEndPage) return buildPaginationDOM('start');
133
+ if (!showEndPage) return buildPaginationDOM('start')[0];
129
134
 
130
- if (currentPage <= totalPages - pages + 2 || totalPages <= pages) {
131
- return buildPaginationDOM('start');
135
+ if (currentPage <= totalPages - pages + 2 || totalPages < pages) {
136
+ return buildPaginationDOM('start')[0];
132
137
  }
133
138
 
134
139
  return null;
@@ -164,7 +169,7 @@ var Pagination = {
164
169
  return props.setPage(0);
165
170
  }
166
171
  }
167
- }, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end'), h(Button, {
172
+ }, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) && buildPaginationDOM('start')[1] !== 2 ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) && buildPaginationDOM('start')[2] !== buildPaginationDOM('end')[1] - 1 ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end')[0], h(Button, {
168
173
  "class": getClassName(props.innerClass, 'button') || '',
169
174
  "attrs": {
170
175
  "disabled": props.currentPage >= props.totalPages - 1,
@@ -544,7 +549,8 @@ var ReactiveList = {
544
549
  nextLabel: types.string,
545
550
  distinctField: types.string,
546
551
  distinctFieldConfig: types.props,
547
- index: VueTypes.string
552
+ index: VueTypes.string,
553
+ endpoint: types.endpointConfig
548
554
  },
549
555
  computed: {
550
556
  shouldRenderPagination: function shouldRenderPagination() {
@@ -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-687b2304.js';
6
+ import { t as types } from './vueTypes-c0d8b875.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
8
  import { T as Title } from './Title-35edd732.js';
9
9
  import { I as Image, C as Card } from './Card-ad6ba09f.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-687b2304.js';
6
+ import { t as types } from './vueTypes-c0d8b875.js';
7
7
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
8
  import { T as Title } from './Title-35edd732.js';
9
9
  import { I as Image, L as ListItem } from './ListItem-41d6ddd7.js';
@@ -6,9 +6,9 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { f as filters, B as Button } from './Button-e18ad90f.js';
9
- import { t as types } from './vueTypes-687b2304.js';
9
+ import { t as types } from './vueTypes-c0d8b875.js';
10
10
  import 'redux';
11
- import { c as connect } from './index-5371a13f.js';
11
+ import { n as decodeHtml, c as connect } from './index-4715798c.js';
12
12
  import { T as Title } from './Title-35edd732.js';
13
13
  import { C as Container } from './Container-421450dc.js';
14
14
 
@@ -164,7 +164,7 @@ var SelectedFilters = {
164
164
 
165
165
  return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
166
166
  return _this3.remove(component, value);
167
- }, selectedValues[component].label + ": " + valueToRender);
167
+ }, selectedValues[component].label + ": " + decodeHtml(valueToRender));
168
168
  }
169
169
 
170
170
  return null;
@@ -6,11 +6,11 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { l as loadMoreContainer, B as Button } from './Button-e18ad90f.js';
9
- import { t as types } from './vueTypes-687b2304.js';
9
+ import { t as types } from './vueTypes-c0d8b875.js';
10
10
  import '@appbaseio/reactivecore/lib/utils/transform';
11
11
  import 'redux';
12
- import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5371a13f.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-dc92772a.js';
12
+ import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-4715798c.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-ca0354ea.js';
14
14
  import '@vue/babel-helper-vue-jsx-merge-props';
15
15
  import { T as Title } from './Title-35edd732.js';
16
16
  import './CancelSvg-e3b33cdd.js';
@@ -19,7 +19,7 @@ import 'compute-scroll-into-view';
19
19
  import { C as Container } from './Container-421450dc.js';
20
20
  import '@appbaseio/reactivecore/lib/utils/suggestions';
21
21
  import { g as getAggsQuery } from './utils-9b45e0ab.js';
22
- import { D as Dropdown } from './DropDown-565fad6f.js';
22
+ import { D as Dropdown } from './DropDown-604374d2.js';
23
23
 
24
24
  var updateQuery = Actions.updateQuery,
25
25
  setQueryOptions = Actions.setQueryOptions,
@@ -81,7 +81,8 @@ var SingleDropdownList = {
81
81
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
82
82
  nestedField: types.string,
83
83
  index: VueTypes.string,
84
- searchPlaceholder: VueTypes.string.def('Type here to search...')
84
+ searchPlaceholder: VueTypes.string.def('Type here to search...'),
85
+ endpoint: types.endpointConfig
85
86
  },
86
87
  created: function created() {
87
88
  if (!this.enableAppbase && this.$props.index) {
@@ -5,11 +5,11 @@ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
- import { t as types } from './vueTypes-687b2304.js';
8
+ import { t as types } from './vueTypes-c0d8b875.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
- import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, n as isEvent, h as hasCustomRenderer, c as connect } from './index-5371a13f.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-dc92772a.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-4715798c.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-ca0354ea.js';
13
13
  import { T as Title } from './Title-35edd732.js';
14
14
  import { I as Input } from './Input-c9d757bc.js';
15
15
  import { C as Container } from './Container-421450dc.js';
@@ -59,7 +59,8 @@ var SingleList = {
59
59
  missingLabel: VueTypes.string.def('N/A'),
60
60
  nestedField: types.string,
61
61
  index: VueTypes.string,
62
- enableStrictSelection: VueTypes.bool.def(false)
62
+ enableStrictSelection: VueTypes.bool.def(false),
63
+ endpoint: types.endpointConfig
63
64
  },
64
65
  data: function data() {
65
66
  var props = this.$props;
@@ -5,11 +5,11 @@ import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
- import { t as types } from './vueTypes-687b2304.js';
8
+ import { t as types } from './vueTypes-c0d8b875.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-5371a13f.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-dc92772a.js';
11
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4715798c.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-ca0354ea.js';
13
13
  import { T as Title } from './Title-35edd732.js';
14
14
  import { C as Container } from './Container-421450dc.js';
15
15
  import { U as UL, R as Radio } from './FormControlList-38ffe3d3.js';
@@ -47,7 +47,8 @@ var SingleRange = {
47
47
  title: types.title,
48
48
  URLParams: VueTypes.bool.def(false),
49
49
  nestedField: types.string,
50
- index: VueTypes.string
50
+ index: VueTypes.string,
51
+ endpoint: types.endpointConfig
51
52
  },
52
53
  created: function created() {
53
54
  if (!this.enableAppbase && this.$props.index) {
@@ -4,7 +4,7 @@ import VueTypes from 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import { isInternalComponent } from '@appbaseio/reactivecore/lib/utils/transform';
6
6
  import 'redux';
7
- import { c as connect } from './index-5371a13f.js';
7
+ import { c as connect } from './index-4715798c.js';
8
8
  import { setValues } from '@appbaseio/reactivecore/lib/actions/value';
9
9
 
10
10
  var getSearchState = helper.getSearchState;
@@ -6,11 +6,11 @@ import 'emotion';
6
6
  import '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
8
  import { B as Button, t as toggleButtons } from './Button-e18ad90f.js';
9
- import { t as types } from './vueTypes-687b2304.js';
9
+ import { t as types } from './vueTypes-c0d8b875.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-5371a13f.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-dc92772a.js';
12
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4715798c.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-ca0354ea.js';
14
14
  import { T as Title } from './Title-35edd732.js';
15
15
  import { C as Container } from './Container-421450dc.js';
16
16
 
@@ -41,7 +41,8 @@ var ToggleButton = {
41
41
  URLParams: VueTypes.bool,
42
42
  renderItem: types.func,
43
43
  index: VueTypes.string,
44
- enableStrictSelection: VueTypes.bool
44
+ enableStrictSelection: VueTypes.bool,
45
+ endpoint: types.endpointConfig
45
46
  },
46
47
  data: function data() {
47
48
  this.__state = {
@@ -364,5 +364,16 @@ function extractModifierKeysFromFocusShortcuts(focusShortcutsArray) {
364
364
  return MODIFIER_KEYS.includes(shortcutKey);
365
365
  });
366
366
  }
367
+ function decodeHtml(str) {
368
+ if (typeof str !== 'string') {
369
+ return str;
370
+ }
371
+
372
+ return str.replace(/&#([0-9]{1,3});/gi, function (match, numStr) {
373
+ var num = parseInt(numStr, 10); // read num as normal number
374
+
375
+ return String.fromCharCode(num);
376
+ });
377
+ }
367
378
 
368
- export { X_SEARCH_CLIENT as X, isFunction as a, getCamelCase as b, connect as c, getValidPropsKeys as d, composeThemeObject as e, updateCustomQuery as f, getComponent as g, hasCustomRenderer as h, isQueryIdentical as i, getQuerySuggestionsComponent as j, isEmpty as k, extractModifierKeysFromFocusShortcuts as l, hasQuerySuggestionsRenderer as m, isEvent as n, parseValueArray as o, parseFocusShortcuts as p, updateDefaultQuery as u };
379
+ export { X_SEARCH_CLIENT as X, isFunction as a, getCamelCase as b, connect as c, getValidPropsKeys as d, composeThemeObject as e, updateCustomQuery as f, getComponent as g, hasCustomRenderer as h, isQueryIdentical as i, getQuerySuggestionsComponent as j, isEmpty as k, extractModifierKeysFromFocusShortcuts as l, hasQuerySuggestionsRenderer as m, decodeHtml as n, isEvent as o, parseFocusShortcuts as p, parseValueArray as q, updateDefaultQuery as u };
package/dist/es/index.js CHANGED
@@ -7,12 +7,12 @@ import 'emotion';
7
7
  import '@appbaseio/vue-emotion';
8
8
  import 'polished';
9
9
  import './Button-e18ad90f.js';
10
- import './vueTypes-687b2304.js';
10
+ import './vueTypes-c0d8b875.js';
11
11
  export { default as ReactiveList } from './ReactiveList.js';
12
12
  import '@appbaseio/reactivecore/lib/utils/transform';
13
13
  import 'redux';
14
- import './index-5371a13f.js';
15
- import './ComponentWrapper-dc92772a.js';
14
+ import './index-4715798c.js';
15
+ import './ComponentWrapper-ca0354ea.js';
16
16
  import '@vue/babel-helper-vue-jsx-merge-props';
17
17
  import './Title-35edd732.js';
18
18
  import './ListItem-41d6ddd7.js';
@@ -23,20 +23,20 @@ import 'appbase-js';
23
23
  import 'url-search-params-polyfill';
24
24
  export { default as ReactiveBase } from './ReactiveBase.js';
25
25
  import 'hotkeys-js';
26
- export { D as DataSearch } from './DataSearch-8e5d0972.js';
26
+ export { D as DataSearch } from './DataSearch-da9347f7.js';
27
27
  import './CancelSvg-e3b33cdd.js';
28
28
  import './Input-c9d757bc.js';
29
29
  import 'compute-scroll-into-view';
30
30
  import './Container-421450dc.js';
31
31
  import 'vue-highlight-words';
32
- import { i as install } from './install-9faa87f1.js';
33
- export { S as SearchBox, i as install } from './install-9faa87f1.js';
32
+ import { i as install } from './install-5d9cb7ed.js';
33
+ export { S as SearchBox, i as install } from './install-5d9cb7ed.js';
34
34
  import '@appbaseio/reactivecore/lib/utils/suggestions';
35
35
  import './FormControlList-38ffe3d3.js';
36
36
  import './utils-9b45e0ab.js';
37
37
  export { default as SingleList } from './SingleList.js';
38
38
  export { default as MultiList } from './MultiList.js';
39
- import './DropDown-565fad6f.js';
39
+ import './DropDown-604374d2.js';
40
40
  export { default as SingleDropdownList } from './SingleDropdownList.js';
41
41
  export { default as MultiDropdownList } from './MultiDropdownList.js';
42
42
  export { default as ToggleButton } from './ToggleButton.js';
@@ -1,6 +1,6 @@
1
1
  import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-51ce1182.js';
2
2
  import { validProps, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
- import { pushToAndClause, buildQuery, extractQueryFromCustomQuery, getOptionsForCustomQuery } from '@appbaseio/reactivecore/lib/utils/helper';
3
+ import { transformRequestUsingEndpoint, pushToAndClause, buildQuery, extractQueryFromCustomQuery, getOptionsForCustomQuery } from '@appbaseio/reactivecore/lib/utils/helper';
4
4
  import { isSearchComponent, 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';
@@ -94,20 +94,51 @@ function initReactivesearch(componentCollection, searchState, settings) {
94
94
  'X-Search-Client': X_SEARCH_CLIENT
95
95
  }, enableTelemetry === false && {
96
96
  'X-Enable-Telemetry': false
97
- }), settings.headers);
97
+ }), settings.headers, settings.enableAppbase && settings.endpoint && settings.endpoint.headers ? settings.endpoint.headers : {});
98
+
99
+ var url = settings.url && settings.url.trim() !== '' ? settings.url : 'https://scalr.api.appbase.io';
100
+ var transformRequest = settings.transformRequest || null;
101
+
102
+ if (settings.enableAppbase && settings.endpoint) {
103
+ if (settings.endpoint.url) {
104
+ // eslint-disable-next-line prefer-destructuring
105
+ url = settings.endpoint.url;
106
+ }
107
+
108
+ transformRequest = function transformRequest(request) {
109
+ var modifiedRequest = transformRequestUsingEndpoint(request, settings.endpoint);
110
+
111
+ if (settings.transformRequest) {
112
+ return settings.transformRequest(modifiedRequest);
113
+ }
114
+
115
+ return modifiedRequest;
116
+ };
117
+ }
98
118
 
99
119
  var config = {
100
- url: settings.url && settings.url.trim() !== '' ? settings.url : 'https://scalr.api.appbase.io',
120
+ url: url,
101
121
  app: settings.app,
102
122
  credentials: credentials,
103
- transformRequest: settings.transformRequest || null,
123
+ transformRequest: transformRequest,
104
124
  type: settings.type ? settings.type : '*',
105
125
  transformResponse: settings.transformResponse || null,
106
126
  graphQLUrl: settings.graphQLUrl || '',
107
127
  headers: headers,
108
- analyticsConfig: settings.appbaseConfig || null
128
+ analyticsConfig: settings.appbaseConfig || null,
129
+ enableAppbase: settings.enableAppbase,
130
+ endpoint: settings.endpoint
109
131
  };
110
132
  var appbaseRef = Appbase(config);
133
+
134
+ if (config.transformRequest) {
135
+ appbaseRef.transformRequest = config.transformRequest;
136
+ }
137
+
138
+ if (config.transformResponse) {
139
+ appbaseRef.transformResponse = config.transformResponse;
140
+ }
141
+
111
142
  var components = [];
112
143
  var selectedValues = {};
113
144
  var internalValues = {};
@@ -436,9 +467,10 @@ function initReactivesearch(componentCollection, searchState, settings) {
436
467
  }
437
468
 
438
469
  timestamp[component] = res._timestamp;
470
+ var hitsObj = response.hits ? response.hits : response[component].hits;
439
471
  hits = _extends({}, hits, (_extends7 = {}, _extends7[component] = {
440
- hits: response.hits.hits,
441
- total: typeof response.hits.total === 'object' ? response.hits.total.value : response.hits.total,
472
+ hits: hitsObj.hits,
473
+ total: typeof hitsObj.total === 'object' ? hitsObj.total.value : hitsObj.total,
442
474
  time: response.took
443
475
  }, _extends7));
444
476
  responseResolve();
@@ -5,14 +5,14 @@ import { SEARCH_COMPONENTS_MODES, componentTypes } from '@appbaseio/reactivecore
5
5
  import { getQueryOptions, suggestionTypes } from '@appbaseio/reactivecore/lib/utils/helper';
6
6
  import styled from '@appbaseio/vue-emotion';
7
7
  import { B as Button } from './Button-e18ad90f.js';
8
- import { t as types } from './vueTypes-687b2304.js';
8
+ import { t as types } from './vueTypes-c0d8b875.js';
9
9
  import ReactiveList from './ReactiveList.js';
10
- import { h as hasCustomRenderer, i as isQueryIdentical, g as getComponent, u as updateDefaultQuery, f as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-5371a13f.js';
11
- import { C as ComponentWrapper } from './ComponentWrapper-dc92772a.js';
10
+ import { n as decodeHtml, h as hasCustomRenderer, i as isQueryIdentical, g as getComponent, u as updateDefaultQuery, f as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-4715798c.js';
11
+ import { C as ComponentWrapper } from './ComponentWrapper-ca0354ea.js';
12
12
  import { T as Title } from './Title-35edd732.js';
13
13
  import ReactiveBase from './ReactiveBase.js';
14
14
  import hotkeys from 'hotkeys-js';
15
- import { S as SearchSvg, a as SuggestionWrapper, I as InputAddon, M as Mic, T as TagItem, b as TagsContainer, c as InputGroup, C as CustomSvg, d as SuggestionItem, D as DataSearch } from './DataSearch-8e5d0972.js';
15
+ import { S as SearchSvg, a as SuggestionWrapper, I as InputAddon, M as Mic, T as TagItem, b as TagsContainer, c as InputGroup, C as CustomSvg, d as SuggestionItem, D as DataSearch } from './DataSearch-da9347f7.js';
16
16
  import { C as CancelSvg, a as IconGroup, I as IconWrapper, D as Downshift, b as InputWrapper } from './CancelSvg-e3b33cdd.js';
17
17
  import { s as suggestionsContainer, I as Input, a as suggestions } from './Input-c9d757bc.js';
18
18
  import { C as Container } from './Container-421450dc.js';
@@ -118,7 +118,7 @@ var SearchBox = {
118
118
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
119
119
  }
120
120
 
121
- this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
121
+ this.currentValue = decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
122
122
 
123
123
  if (this.$options.isTagsMode) {
124
124
  this.currentValue = '';
@@ -215,7 +215,9 @@ var SearchBox = {
215
215
  enterButton: VueTypes.bool.def(false),
216
216
  renderEnterButton: VueTypes.any,
217
217
  mode: VueTypes.oneOf(['select', 'tag']).def('select'),
218
- renderSelectedTags: VueTypes.any
218
+ renderSelectedTags: VueTypes.any,
219
+ searchboxId: VueTypes.string,
220
+ endpoint: types.endpointConfig
219
221
  },
220
222
  beforeMount: function beforeMount() {
221
223
  if (this.selectedValue) {
@@ -459,7 +461,7 @@ var SearchBox = {
459
461
 
460
462
  _this.currentValue = '';
461
463
  } else {
462
- _this.currentValue = value;
464
+ _this.currentValue = decodeHtml(value);
463
465
  }
464
466
 
465
467
  var queryHandlerValue = value;
@@ -965,7 +967,7 @@ var SearchBox = {
965
967
  onAutofillClick: function onAutofillClick(suggestion) {
966
968
  var value = suggestion.value;
967
969
  this.isOpen = true;
968
- this.currentValue = value;
970
+ this.currentValue = decodeHtml(value);
969
971
  this.triggerDefaultQuery(value);
970
972
  },
971
973
  renderAutoFill: function renderAutoFill(suggestion) {
@@ -7,12 +7,12 @@ import 'emotion';
7
7
  import '@appbaseio/vue-emotion';
8
8
  import 'polished';
9
9
  import './Button-e18ad90f.js';
10
- import './vueTypes-687b2304.js';
10
+ import './vueTypes-c0d8b875.js';
11
11
  import './ReactiveList.js';
12
12
  import '@appbaseio/reactivecore/lib/utils/transform';
13
13
  import 'redux';
14
- import './index-5371a13f.js';
15
- import './ComponentWrapper-dc92772a.js';
14
+ import './index-4715798c.js';
15
+ import './ComponentWrapper-ca0354ea.js';
16
16
  import '@vue/babel-helper-vue-jsx-merge-props';
17
17
  import './Title-35edd732.js';
18
18
  import './ListItem-41d6ddd7.js';
@@ -23,19 +23,19 @@ import 'appbase-js';
23
23
  import 'url-search-params-polyfill';
24
24
  import './ReactiveBase.js';
25
25
  import 'hotkeys-js';
26
- import './DataSearch-8e5d0972.js';
26
+ import './DataSearch-da9347f7.js';
27
27
  import './CancelSvg-e3b33cdd.js';
28
28
  import './Input-c9d757bc.js';
29
29
  import 'compute-scroll-into-view';
30
30
  import './Container-421450dc.js';
31
31
  import 'vue-highlight-words';
32
- export { i as default } from './install-9faa87f1.js';
32
+ export { i as default } from './install-5d9cb7ed.js';
33
33
  import '@appbaseio/reactivecore/lib/utils/suggestions';
34
34
  import './FormControlList-38ffe3d3.js';
35
35
  import './utils-9b45e0ab.js';
36
36
  import './SingleList.js';
37
37
  import './MultiList.js';
38
- import './DropDown-565fad6f.js';
38
+ import './DropDown-604374d2.js';
39
39
  import './SingleDropdownList.js';
40
40
  import './MultiDropdownList.js';
41
41
  import './ToggleButton.js';
@@ -1,3 +1,3 @@
1
- var version = "1.30.0";
1
+ var version = "1.31.0";
2
2
 
3
3
  export default version;
@@ -114,6 +114,12 @@ var types = {
114
114
  mongodb: VueTypes.shape({
115
115
  db: VueTypes.string,
116
116
  collection: VueTypes.string
117
+ }),
118
+ endpointConfig: VueTypes.shape({
119
+ url: VueTypes.string.isRequired,
120
+ method: VueTypes.string,
121
+ headers: VueTypes.object,
122
+ body: VueTypes.object
117
123
  })
118
124
  };
119
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appbaseio/reactivesearch-vue",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
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.14.17",
37
+ "@appbaseio/reactivecore": "9.14.22",
38
38
  "@appbaseio/vue-emotion": "0.4.4",
39
39
  "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
40
- "appbase-js": "^5.0.0",
40
+ "appbase-js": "^5.1.0",
41
41
  "compute-scroll-into-view": "^1.0.11",
42
42
  "emotion": "9.2.12",
43
43
  "hotkeys-js": "^3.8.7",