@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
@@ -0,0 +1,71 @@
1
+ import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-76660dab.js';
2
+ import { css } from 'emotion';
3
+ import styled from '@appbaseio/vue-emotion';
4
+
5
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
6
+
7
+ var alertBorder = function alertBorder(_ref) {
8
+ var theme = _ref.theme;
9
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tborder: 1px solid ", ";\n"])), theme.colors.alertColor);
10
+ };
11
+
12
+ var input = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tline-height: 1.5;\n\tmin-height: 42px;\n\tpadding: 8px 12px;\n\tborder: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 0.9rem;\n\toutline: none;\n\theight: 100%;\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n"])));
13
+
14
+ var dark = function dark(theme) {
15
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\tborder-color: ", ";\n"])), theme.colors.borderColor);
16
+ };
17
+
18
+ var darkInput = function darkInput(_ref2) {
19
+ var theme = _ref2.theme;
20
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.textColor, dark(theme), theme.colors.backgroundColor);
21
+ };
22
+
23
+ var Input = styled('input')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n"])), input, function (_ref3) {
24
+ var themePreset = _ref3.themePreset,
25
+ theme = _ref3.theme;
26
+ return themePreset === 'dark' && darkInput({
27
+ theme: theme
28
+ });
29
+ }, function (props) {
30
+ return props.showIcon && props.iconPosition === 'left' && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-left: 36px;\n\t\t"])));
31
+ }, function (props) {
32
+ return props.showIcon && props.iconPosition === 'right' && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])));
33
+ }, function (props) {
34
+ return (// for clear icon
35
+ props.showClear && css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])))
36
+ );
37
+ }, function (props) {
38
+ return (// for voice search icon
39
+ props.showVoiceSearch && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 36px;\n\t\t"])))
40
+ );
41
+ }, function (props) {
42
+ return (// for clear icon with search icon
43
+ props.showClear && props.showIcon && props.iconPosition === 'right' && css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
44
+ );
45
+ }, function (props) {
46
+ return (// for voice search icon with search icon
47
+ props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
48
+ );
49
+ }, function (props) {
50
+ return (// for voice search icon with clear icon
51
+ props.showVoiceSearch && props.showIcon && css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 66px;\n\t\t"])))
52
+ );
53
+ }, function (props) {
54
+ return (// for clear icon with search icon and voice search
55
+ props.showClear && props.showIcon && props.showVoiceSearch && props.iconPosition === 'right' && css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteralLoose(["\n\t\t\tpadding-right: 90px;\n\t\t"])))
56
+ );
57
+ }, function (props) {
58
+ return props.alert && alertBorder;
59
+ });
60
+
61
+ var suggestions = function suggestions(themePreset, theme) {
62
+ return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 402px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark(theme));
63
+ };
64
+
65
+ var suggestionsContainer = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
66
+
67
+ var noSuggestions = function noSuggestions(themePreset, theme) {
68
+ return css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t", "\n"])), themePreset === 'dark' && theme && dark(theme));
69
+ };
70
+
71
+ export { Input as I, suggestions as a, noSuggestions as n, suggestionsContainer as s };
@@ -0,0 +1,39 @@
1
+ import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-76660dab.js';
2
+ import { css } from 'emotion';
3
+ import styled from '@appbaseio/vue-emotion';
4
+ import { lighten } from 'polished';
5
+ import './Title-3342664a.js';
6
+
7
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
8
+ var container = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tborder-radius: 0.25rem;\n\toverflow: hidden;\n"])));
9
+ var smallImage = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\twidth: 100px;\n\theight: 100px;\n"])));
10
+ var Image = styled('div')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\twidth: 160px;\n\theight: 160px;\n\t", ";\n\tmargin: 0;\n\tbackground-size: contain;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\tbackground-image: ", ";\n"])), function (props) {
11
+ return props.small ? smallImage : null;
12
+ }, function (props) {
13
+ return "url(" + props.src + ")";
14
+ });
15
+ var ListItem = styled('a')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n"])), function (_ref) {
16
+ var theme = _ref.theme;
17
+ return theme.colors.backgroundColor ? lighten(0.1, theme.colors.backgroundColor) : '#fff';
18
+ }, function (_ref2) {
19
+ var theme = _ref2.theme;
20
+ return theme.colors.backgroundColor ? lighten(0.3, theme.colors.backgroundColor) : lighten(0.68, theme.colors.textColor);
21
+ }, function (_ref3) {
22
+ var theme = _ref3.theme;
23
+ return theme.colors.textColor;
24
+ }, function (props) {
25
+ return props.href ? 'cursor: pointer' : null;
26
+ }, function (_ref4) {
27
+ var theme = _ref4.theme;
28
+ return theme.colors.backgroundColor ? lighten(0.2, theme.colors.backgroundColor) : '#fdfefd';
29
+ }, function (props) {
30
+ if (props.image) {
31
+ return props.small ? 'calc(100% - 100px)' : 'calc(100% - 160px)';
32
+ }
33
+
34
+ return '100%';
35
+ }, function (props) {
36
+ return props.image ? '10px' : 0;
37
+ });
38
+
39
+ export { Image as I, ListItem as L, container as c };
@@ -1,23 +1,25 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
- import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } 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 { l as loadMoreContainer, B as Button } from './Button-27cc8574.js';
9
- import { t as types } from './vueTypes-98d938a9.js';
8
+ import { l as loadMoreContainer, B as Button } 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, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, p as parseValueArray, g as getComponent, h as hasCustomRenderer, 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 './Input-1159c4b5.js';
12
+ import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, q as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-7788a843.js';
13
+ import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
14
+ import '@vue/babel-helper-vue-jsx-merge-props';
15
+ import { T as Title } from './Title-3342664a.js';
16
+ import './CancelSvg-4cfae5fd.js';
17
+ import './Input-7a2a9fac.js';
16
18
  import 'compute-scroll-into-view';
17
- import './DownShift-92347b5e.js';
18
- import { C as Container } from './Container-88c805ef.js';
19
- import { g as getAggsQuery } from './utils-57cc8789.js';
20
- import { D as Dropdown } from './DropDown-3d4291f1.js';
19
+ import { C as Container } from './Container-ba826e96.js';
20
+ import '@appbaseio/reactivecore/lib/utils/suggestions';
21
+ import { g as getAggsQuery } from './utils-9e68acee.js';
22
+ import { D as Dropdown } from './DropDown-7d9a15c1.js';
21
23
 
22
24
  var updateQuery = Actions.updateQuery,
23
25
  setQueryOptions = Actions.setQueryOptions,
@@ -28,8 +30,9 @@ var isEqual = helper.isEqual,
28
30
  checkValueChange = helper.checkValueChange,
29
31
  checkPropChange = helper.checkPropChange,
30
32
  getClassName = helper.getClassName,
31
- getOptionsFromQuery = helper.getOptionsFromQuery,
32
- getCompositeAggsQuery = helper.getCompositeAggsQuery;
33
+ getCompositeAggsQuery = helper.getCompositeAggsQuery,
34
+ extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
35
+ getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
33
36
  var MultiDropdownList = {
34
37
  name: 'MultiDropdownList',
35
38
  data: function data() {
@@ -67,19 +70,28 @@ var MultiDropdownList = {
67
70
  selectAllLabel: types.string,
68
71
  showCount: VueTypes.bool.def(true),
69
72
  showFilter: VueTypes.bool.def(true),
70
- size: VueTypes.number.def(100),
73
+ size: VueTypes.number,
71
74
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
72
75
  title: types.title,
73
76
  URLParams: VueTypes.bool.def(false),
74
77
  showMissing: VueTypes.bool.def(false),
75
78
  missingLabel: VueTypes.string.def('N/A'),
76
79
  showSearch: VueTypes.bool.def(false),
80
+ showClear: VueTypes.bool.def(false),
77
81
  showLoadMore: VueTypes.bool.def(false),
78
82
  loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
79
- nestedField: types.string
83
+ nestedField: types.string,
84
+ index: VueTypes.string,
85
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
80
86
  },
81
87
  created: function created() {
82
- // Set custom and default queries in store
88
+ if (!this.enableAppbase && this.$props.index) {
89
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
90
+ }
91
+
92
+ var props = this.$props;
93
+ this.modifiedOptions = this.options && this.options[props.dataField] ? this.options[props.dataField].buckets : []; // Set custom and default queries in store
94
+
83
95
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
84
96
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
85
97
  },
@@ -117,33 +129,35 @@ var MultiDropdownList = {
117
129
  options: function options(newVal, oldVal) {
118
130
  var _this2 = this;
119
131
 
120
- checkPropChange(oldVal, newVal, function () {
121
- var _this2$$props = _this2.$props,
122
- showLoadMore = _this2$$props.showLoadMore,
123
- dataField = _this2$$props.dataField;
124
- var modifiedOptions = _this2.$data.modifiedOptions;
125
-
126
- if (showLoadMore) {
127
- // append options with showLoadMore
128
- var buckets = newVal[dataField].buckets;
129
- var nextOptions = [].concat(modifiedOptions, buckets.map(function (bucket) {
130
- return {
131
- key: bucket.key[dataField],
132
- doc_count: bucket.doc_count
132
+ if (newVal) {
133
+ checkPropChange(oldVal, newVal, function () {
134
+ var _this2$$props = _this2.$props,
135
+ showLoadMore = _this2$$props.showLoadMore,
136
+ dataField = _this2$$props.dataField;
137
+ var modifiedOptions = _this2.$data.modifiedOptions;
138
+
139
+ if (showLoadMore) {
140
+ // append options with showLoadMore
141
+ var buckets = newVal[dataField].buckets;
142
+ var nextOptions = [].concat(modifiedOptions, buckets.map(function (bucket) {
143
+ return {
144
+ key: bucket.key[dataField],
145
+ doc_count: bucket.doc_count
146
+ };
147
+ }));
148
+ var after = newVal[dataField].after_key; // detect the last bucket by checking if the next set of buckets were empty
149
+
150
+ var isLastBucket = !buckets.length;
151
+ _this2.after = {
152
+ after: after
133
153
  };
134
- }));
135
- var after = newVal[dataField].after_key; // detect the last bucket by checking if the next set of buckets were empty
136
-
137
- var isLastBucket = !buckets.length;
138
- _this2.after = {
139
- after: after
140
- };
141
- _this2.isLastBucket = isLastBucket;
142
- _this2.modifiedOptions = nextOptions;
143
- } else {
144
- _this2.modifiedOptions = newVal[_this2.$props.dataField] ? newVal[_this2.$props.dataField].buckets : [];
145
- }
146
- });
154
+ _this2.isLastBucket = isLastBucket;
155
+ _this2.modifiedOptions = nextOptions;
156
+ } else {
157
+ _this2.modifiedOptions = newVal[_this2.$props.dataField] ? newVal[_this2.$props.dataField].buckets : [];
158
+ }
159
+ });
160
+ }
147
161
  },
148
162
  size: function size() {
149
163
  this.updateQueryOptions(this.$props);
@@ -186,13 +200,22 @@ var MultiDropdownList = {
186
200
  var renderErrorCalc = this.$scopedSlots.renderError || renderError;
187
201
  var renderLabelCalc = this.$scopedSlots.renderLabel || renderLabel;
188
202
  var isLastBucket = this.$data.isLastBucket;
203
+ var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
189
204
  var selectAll = [];
190
205
 
191
206
  if (renderErrorCalc && this.error) {
192
207
  return isFunction(renderErrorCalc) ? renderErrorCalc(this.error) : renderErrorCalc;
193
208
  }
194
209
 
195
- if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0) {
210
+ if (!this.hasCustomRenderer && this.$data.modifiedOptions.length === 0 && !this.isLoading) {
211
+ if (renderNoResults && isFunction(renderNoResults)) {
212
+ return h("div", [renderNoResults()]);
213
+ }
214
+
215
+ if (renderNoResults && !isFunction(renderNoResults)) {
216
+ return renderNoResults;
217
+ }
218
+
196
219
  return null;
197
220
  }
198
221
 
@@ -212,7 +235,7 @@ var MultiDropdownList = {
212
235
  "items": [].concat(selectAll, this.$data.modifiedOptions.filter(function (item) {
213
236
  return String(item.key).trim().length;
214
237
  }).map(function (item) {
215
- return _extends(_extends({}, item), {}, {
238
+ return _extends({}, item, {
216
239
  key: String(item.key)
217
240
  });
218
241
  })),
@@ -228,6 +251,8 @@ var MultiDropdownList = {
228
251
  "renderItem": renderItemCalc,
229
252
  "renderNoResults": this.$scopedSlots.renderNoResults || this.$props.renderNoResults,
230
253
  "showSearch": this.$props.showSearch,
254
+ "showClear": this.$props.showClear,
255
+ "searchPlaceholder": this.$props.searchPlaceholder,
231
256
  "transformData": this.$props.transformData,
232
257
  "footer": showLoadMore && !isLastBucket && h("div", {
233
258
  "attrs": {
@@ -319,7 +344,7 @@ var MultiDropdownList = {
319
344
  }
320
345
 
321
346
  var performUpdate = function performUpdate() {
322
- _this3.currentValue = currentValue;
347
+ _this3.currentValue = _extends({}, currentValue);
323
348
 
324
349
  _this3.updateQueryHandler(finalValues, props);
325
350
 
@@ -331,22 +356,22 @@ var MultiDropdownList = {
331
356
  checkValueChange(props.componentId, finalValues, props.beforeValueChange, performUpdate);
332
357
  },
333
358
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
334
- var defaultQueryOptions;
335
359
  var query = MultiDropdownList.defaultQuery(value, props);
336
360
 
337
361
  if (this.defaultQuery) {
338
362
  var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
363
+ var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
339
364
 
340
- if (defaultQueryToBeSet.query) {
341
- query = defaultQueryToBeSet.query;
342
- }
365
+ if (defaultQueryObj) {
366
+ query = defaultQueryObj;
367
+ } // Update calculated default query in store
343
368
 
344
- defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
345
369
 
346
370
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
371
+ var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
372
+ this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
347
373
  }
348
374
 
349
- this.setQueryOptions(this.internalComponent, defaultQueryOptions);
350
375
  this.updateQuery({
351
376
  componentId: this.internalComponent,
352
377
  query: query,
@@ -357,17 +382,15 @@ var MultiDropdownList = {
357
382
  updateQueryHandler: function updateQueryHandler(value, props) {
358
383
  var customQuery = props.customQuery;
359
384
  var query = MultiDropdownList.defaultQuery(value, props);
360
- var customQueryOptions;
361
385
 
362
386
  if (customQuery) {
363
- var _ref = customQuery(value, props) || {};
364
-
365
- query = _ref.query;
366
- customQueryOptions = getOptionsFromQuery(customQuery(value, props));
387
+ var customQueryCalc = customQuery(value, props);
388
+ query = extractQueryFromCustomQuery(customQueryCalc);
367
389
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
390
+ var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
391
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
368
392
  }
369
393
 
370
- this.setQueryOptions(props.componentId, customQueryOptions);
371
394
  this.updateQuery({
372
395
  componentId: props.componentId,
373
396
  query: query,
@@ -401,8 +424,8 @@ var MultiDropdownList = {
401
424
 
402
425
  if (props.defaultQuery) {
403
426
  var value = Object.keys(this.$data.currentValue);
404
- var defaultQueryOptions = getOptionsFromQuery(props.defaultQuery(value, props));
405
- this.setQueryOptions(this.internalComponent, _extends(_extends({}, queryOptions), defaultQueryOptions));
427
+ var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
428
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
406
429
  } else {
407
430
  this.setQueryOptions(this.internalComponent, queryOptions);
408
431
  }
@@ -437,7 +460,13 @@ var MultiDropdownList = {
437
460
 
438
461
  MultiDropdownList.defaultQuery = function (value, props) {
439
462
  var query = null;
440
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
463
+ var queryFormat = props.queryFormat;
464
+
465
+ if (queryFormat === undefined) {
466
+ queryFormat = 'or';
467
+ }
468
+
469
+ var type = queryFormat === 'or' ? 'terms' : 'term';
441
470
 
442
471
  if (!Array.isArray(value) || value.length === 0) {
443
472
  return null;
@@ -458,14 +487,14 @@ MultiDropdownList.defaultQuery = function (value, props) {
458
487
  } else if (value) {
459
488
  var listQuery;
460
489
 
461
- if (props.queryFormat === 'or') {
490
+ if (queryFormat === 'or') {
462
491
  if (props.showMissing) {
463
- var _type, _ref2;
492
+ var _type, _ref;
464
493
 
465
494
  var hasMissingTerm = value.includes(props.missingLabel);
466
- var should = [(_ref2 = {}, _ref2[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
495
+ var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
467
496
  return item !== props.missingLabel;
468
- }), _type), _ref2)];
497
+ }), _type), _ref)];
469
498
 
470
499
  if (hasMissingTerm) {
471
500
  should = should.concat({
@@ -492,9 +521,9 @@ MultiDropdownList.defaultQuery = function (value, props) {
492
521
  } else {
493
522
  // adds a sub-query with must as an array of objects for each term/value
494
523
  var queryArray = value.map(function (item) {
495
- var _type3, _ref3;
524
+ var _type3, _ref2;
496
525
 
497
- return _ref3 = {}, _ref3[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref3;
526
+ return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
498
527
  });
499
528
  listQuery = {
500
529
  bool: {
@@ -529,6 +558,10 @@ MultiDropdownList.generateQueryOptions = function (props, after) {
529
558
  }) : getAggsQuery(queryOptions, props);
530
559
  };
531
560
 
561
+ MultiDropdownList.hasInternalComponent = function () {
562
+ return true;
563
+ };
564
+
532
565
  var mapStateToProps = function mapStateToProps(state, props) {
533
566
  return {
534
567
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
@@ -537,7 +570,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
537
570
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
538
571
  themePreset: state.config.themePreset,
539
572
  error: state.error[props.componentId],
540
- componentProps: state.props[props.componentId]
573
+ componentProps: state.props[props.componentId],
574
+ enableAppbase: state.config.enableAppbase
541
575
  };
542
576
  };
543
577
 
@@ -549,7 +583,7 @@ var mapDispatchtoProps = {
549
583
  };
550
584
  var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(MultiDropdownList), {
551
585
  componentType: componentTypes.multiDropdownList,
552
- internalComponent: true
586
+ internalComponent: MultiDropdownList.hasInternalComponent()
553
587
  });
554
588
 
555
589
  MultiDropdownList.install = function (Vue) {