@appbaseio/reactivesearch-vue 2.0.0-alpha.4 → 3.0.0-alpha.1

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 (109) hide show
  1. package/README.md +9 -9
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js +21316 -29369
  3. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -19
  5. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  6. package/dist/cjs/Button-ad042719.js +59 -0
  7. package/dist/cjs/Card-f5ab024a.js +27 -0
  8. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-611cf7f9.js} +44 -58
  9. package/dist/cjs/Container-29f049b2.js +12 -0
  10. package/dist/cjs/DropDown-dc184468.js +700 -0
  11. package/dist/cjs/DynamicRangeSlider.js +106 -157
  12. package/dist/cjs/Flex-d5675ea6.js +48 -0
  13. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  14. package/dist/cjs/Input-088dfcb4.js +74 -0
  15. package/dist/cjs/ListItem-d57d648d.js +42 -0
  16. package/dist/cjs/MultiDropdownList.js +124 -240
  17. package/dist/cjs/MultiList.js +124 -262
  18. package/dist/cjs/MultiRange.js +87 -133
  19. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  20. package/dist/cjs/PreferencesConsumer-22d1b49f.js +73 -0
  21. package/dist/cjs/RangeInput.js +163 -171
  22. package/dist/cjs/RangeSlider.js +81 -109
  23. package/dist/cjs/ReactiveBase.js +139 -156
  24. package/dist/cjs/ReactiveComponent-a6108189.js +2184 -0
  25. package/dist/cjs/ReactiveComponent.js +46 -340
  26. package/dist/cjs/ReactiveGoogleMap.js +451 -660
  27. package/dist/cjs/ReactiveList.js +180 -305
  28. package/dist/cjs/ResultCard.js +36 -36
  29. package/dist/cjs/ResultList.js +48 -56
  30. package/dist/cjs/SelectedFilters.js +62 -69
  31. package/dist/cjs/SingleDropdownList.js +117 -177
  32. package/dist/cjs/SingleList.js +122 -206
  33. package/dist/cjs/SingleRange.js +78 -105
  34. package/dist/cjs/StateProvider.js +35 -38
  35. package/dist/cjs/Title-8802a218.js +12 -0
  36. package/dist/cjs/ToggleButton.js +72 -119
  37. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  38. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  39. package/dist/cjs/index.js +44 -41
  40. package/dist/cjs/initReactivesearch.js +63 -150
  41. package/dist/cjs/install.js +47 -43
  42. package/dist/cjs/ssr-6c8a72e1.js +66 -0
  43. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  44. package/dist/cjs/version.js +1 -1
  45. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  46. package/dist/es/Button-474510e3.js +53 -0
  47. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  48. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-3dfe6931.js} +44 -58
  49. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  50. package/dist/es/DropDown-029ffd42.js +690 -0
  51. package/dist/es/DynamicRangeSlider.js +106 -157
  52. package/dist/es/Flex-a08e22d7.js +46 -0
  53. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  54. package/dist/es/Input-ad474a55.js +69 -0
  55. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  56. package/dist/es/MultiDropdownList.js +124 -240
  57. package/dist/es/MultiList.js +124 -262
  58. package/dist/es/MultiRange.js +87 -133
  59. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  60. package/dist/es/PreferencesConsumer-24e88f3b.js +71 -0
  61. package/dist/es/RangeInput.js +163 -170
  62. package/dist/es/RangeSlider.js +81 -109
  63. package/dist/es/ReactiveBase.js +138 -154
  64. package/dist/es/ReactiveComponent-0a97eb1e.js +2178 -0
  65. package/dist/es/ReactiveComponent.js +42 -337
  66. package/dist/es/ReactiveGoogleMap.js +446 -654
  67. package/dist/es/ReactiveList.js +178 -302
  68. package/dist/es/ResultCard.js +36 -36
  69. package/dist/es/ResultList.js +48 -56
  70. package/dist/es/SelectedFilters.js +62 -69
  71. package/dist/es/SingleDropdownList.js +117 -177
  72. package/dist/es/SingleList.js +122 -206
  73. package/dist/es/SingleRange.js +78 -105
  74. package/dist/es/StateProvider.js +36 -39
  75. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  76. package/dist/es/ToggleButton.js +72 -119
  77. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  78. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  79. package/dist/es/index.js +30 -32
  80. package/dist/es/initReactivesearch.js +63 -150
  81. package/dist/es/install.js +49 -41
  82. package/dist/es/{ssr-b2c0b401.js → ssr-584c278d.js} +37 -8
  83. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  84. package/dist/es/version.js +1 -1
  85. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  86. package/package.json +10 -9
  87. package/dist/cjs/Button-446f819e.js +0 -68
  88. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  89. package/dist/cjs/Card-642547a8.js +0 -30
  90. package/dist/cjs/Container-daf30918.js +0 -15
  91. package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
  92. package/dist/cjs/DataSearch.js +0 -30
  93. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  94. package/dist/cjs/Flex-aa517a13.js +0 -52
  95. package/dist/cjs/FormControlList-c195a592.js +0 -47
  96. package/dist/cjs/Input-e6603a7e.js +0 -79
  97. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  98. package/dist/cjs/Title-1de7d0f4.js +0 -15
  99. package/dist/cjs/install-b97dbac4.js +0 -1409
  100. package/dist/cjs/ssr-3027b848.js +0 -39
  101. package/dist/es/Button-d8bc15ea.js +0 -59
  102. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  103. package/dist/es/DataSearch-b86a6675.js +0 -2337
  104. package/dist/es/DataSearch.js +0 -22
  105. package/dist/es/DropDown-05a644a5.js +0 -322
  106. package/dist/es/Flex-1f0795c3.js +0 -47
  107. package/dist/es/FormControlList-c22d64f6.js +0 -40
  108. package/dist/es/Input-7a2a9fac.js +0 -71
  109. package/dist/es/install-ac8a1edb.js +0 -1402
@@ -1,22 +1,28 @@
1
- import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
1
+ import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
2
+ import { createVNode, isVNode, mergeProps } from 'vue';
2
3
  import VueTypes from 'vue-types';
3
- import 'emotion';
4
4
  import '@appbaseio/vue-emotion';
5
+ import 'emotion';
5
6
  import 'polished';
6
- import { t as types } from './vueTypes-b8146772.js';
7
- import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
- import { T as Title } from './Title-3342664a.js';
9
- import { I as Image, C as Card } from './Card-450683f1.js';
7
+ import { t as types } from './vueTypes-f1923c72.js';
8
+ import { T as Title } from './Title-863dfa42.js';
9
+ import { I as Image, C as Card } from './Card-38cbe652.js';
10
10
 
11
+ function _isSlot(s) {
12
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
13
+ }
11
14
  var ResultCardTitle = {
12
15
  name: 'ResultCardTitle',
13
16
  render: function render() {
14
- var h = arguments[0];
17
+ var _slot;
15
18
  var children = this.$slots["default"];
16
- return h(Title, _mergeJSXProps([{}, this.$props]), [children]);
19
+ return createVNode(Title, this.$props, _isSlot(_slot = children()) ? _slot : {
20
+ "default": function _default() {
21
+ return [_slot];
22
+ }
23
+ });
17
24
  }
18
25
  };
19
-
20
26
  ResultCardTitle.install = function (Vue) {
21
27
  Vue.component(ResultCardTitle.name, ResultCardTitle);
22
28
  };
@@ -28,20 +34,16 @@ var ResultCardImage = {
28
34
  src: VueTypes.string.isRequired
29
35
  },
30
36
  render: function render() {
31
- var h = arguments[0];
32
-
33
37
  var _this$$props = this.$props,
34
- src = _this$$props.src,
35
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
36
-
37
- return h(Image, _mergeJSXProps([{
38
+ src = _this$$props.src,
39
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
40
+ return createVNode(Image, mergeProps({
38
41
  "style": {
39
42
  backgroundImage: "url(" + src + ")"
40
43
  }
41
- }, props]));
44
+ }, props), null);
42
45
  }
43
46
  };
44
-
45
47
  ResultCardImage.install = function (Vue) {
46
48
  Vue.component(ResultCardImage.name, ResultCardImage);
47
49
  };
@@ -49,19 +51,18 @@ ResultCardImage.install = function (Vue) {
49
51
  var ResultCardDescription = {
50
52
  name: 'ResultCardDescription',
51
53
  functional: true,
52
- render: function render(_, _ref) {
53
- var props = _ref.props,
54
- children = _ref.children;
55
- var h = arguments[0];
56
- return h("article", _mergeJSXProps([{}, props]), [children]);
54
+ render: function render(context) {
55
+ return createVNode("article", context.$props, [context.$slots["default"]()]);
57
56
  }
58
57
  };
59
-
60
58
  ResultCardDescription.install = function (Vue) {
61
59
  Vue.component(ResultCardDescription.name, ResultCardDescription);
62
60
  };
63
61
 
64
62
  var _excluded$1 = ["href", "target"];
63
+ function _isSlot$1(s) {
64
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
65
+ }
65
66
  var ResultCard = {
66
67
  name: 'ResultCard',
67
68
  components: {
@@ -74,24 +75,23 @@ var ResultCard = {
74
75
  href: types.string
75
76
  },
76
77
  render: function render() {
77
- var h = arguments[0];
78
+ var _slot;
78
79
  var children = this.$slots["default"];
79
-
80
80
  var _this$$props = this.$props,
81
- href = _this$$props.href,
82
- target = _this$$props.target,
83
- rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
84
-
85
- return h(Card, _mergeJSXProps([{
86
- "attrs": {
87
- "href": href,
88
- "target": target,
89
- "rel": target === '_blank' ? 'noopener noreferrer' : null
81
+ href = _this$$props.href,
82
+ target = _this$$props.target,
83
+ rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
84
+ return createVNode(Card, mergeProps({
85
+ "href": href,
86
+ "target": target,
87
+ "rel": target === '_blank' ? 'noopener noreferrer' : null
88
+ }, rest), _isSlot$1(_slot = children()) ? _slot : {
89
+ "default": function _default() {
90
+ return [_slot];
90
91
  }
91
- }, rest]), [children]);
92
+ });
92
93
  }
93
94
  };
94
-
95
95
  ResultCard.install = function (Vue) {
96
96
  Vue.component(ResultCard.name, ResultCard);
97
97
  Vue.component(ResultCardTitle.name, ResultCardTitle);
@@ -1,24 +1,20 @@
1
- import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
1
+ import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
2
+ import { createVNode, mergeProps, isVNode } from 'vue';
2
3
  import VueTypes from 'vue-types';
3
- import 'emotion';
4
4
  import '@appbaseio/vue-emotion';
5
+ import 'emotion';
5
6
  import 'polished';
6
- import { t as types } from './vueTypes-b8146772.js';
7
- import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
8
- import { T as Title } from './Title-3342664a.js';
9
- import { I as Image, L as ListItem } from './ListItem-cad14c5e.js';
7
+ import { t as types } from './vueTypes-f1923c72.js';
8
+ import { T as Title } from './Title-863dfa42.js';
9
+ import { I as Image, L as ListItem } from './ListItem-16756c02.js';
10
10
 
11
11
  var ResultListContent = {
12
12
  name: 'ResultListContent',
13
13
  functional: true,
14
- render: function render(_, _ref) {
15
- var props = _ref.props,
16
- children = _ref.children;
17
- var h = arguments[0];
18
- return h("article", _mergeJSXProps([{}, props]), [children]);
14
+ render: function render(context) {
15
+ return createVNode("article", context.$props, [context.$slots["default"]()]);
19
16
  }
20
17
  };
21
-
22
18
  ResultListContent.install = function (Vue) {
23
19
  Vue.component(ResultListContent.name, ResultListContent);
24
20
  };
@@ -26,14 +22,10 @@ ResultListContent.install = function (Vue) {
26
22
  var ResultListDescription = {
27
23
  name: 'ResultListDescription',
28
24
  functional: true,
29
- render: function render(_, _ref) {
30
- var props = _ref.props,
31
- children = _ref.children;
32
- var h = arguments[0];
33
- return h("div", _mergeJSXProps([{}, props]), [children]);
25
+ render: function render(context) {
26
+ return createVNode("div", context.$props, [context.$slots["default"]()]);
34
27
  }
35
28
  };
36
-
37
29
  ResultListDescription.install = function (Vue) {
38
30
  Vue.component(ResultListDescription.name, ResultListDescription);
39
31
  };
@@ -46,40 +38,43 @@ var ResultListImage = {
46
38
  small: VueTypes.bool.def(false)
47
39
  },
48
40
  render: function render() {
49
- var h = arguments[0];
50
-
51
41
  var _this$$props = this.$props,
52
- src = _this$$props.src,
53
- small = _this$$props.small,
54
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
55
-
56
- return h(Image, _mergeJSXProps([{
57
- "attrs": {
58
- "src": src,
59
- "small": small
60
- }
61
- }, props]));
42
+ src = _this$$props.src,
43
+ small = _this$$props.small,
44
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
45
+ return createVNode(Image, mergeProps({
46
+ "src": src,
47
+ "small": small
48
+ }, props), null);
62
49
  }
63
50
  };
64
-
65
51
  ResultListImage.install = function (Vue) {
66
52
  Vue.component(ResultListImage.name, ResultListImage);
67
53
  };
68
54
 
55
+ function _isSlot(s) {
56
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
57
+ }
69
58
  var ResultListTitle = {
70
59
  name: 'ResultListTitle',
71
60
  render: function render() {
72
- var h = arguments[0];
61
+ var _slot;
73
62
  var children = this.$slots["default"];
74
- return h(Title, _mergeJSXProps([{}, this.$props]), [children]);
63
+ return createVNode(Title, this.$props, _isSlot(_slot = children()) ? _slot : {
64
+ "default": function _default() {
65
+ return [_slot];
66
+ }
67
+ });
75
68
  }
76
69
  };
77
-
78
70
  ResultListTitle.install = function (Vue) {
79
71
  Vue.component(ResultListTitle.name, ResultListTitle);
80
72
  };
81
73
 
82
74
  var _excluded$1 = ["href", "target"];
75
+ function _isSlot$1(s) {
76
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
77
+ }
83
78
  var ResultList = {
84
79
  name: 'ResultList',
85
80
  props: {
@@ -100,42 +95,39 @@ var ResultList = {
100
95
  return this.__state;
101
96
  },
102
97
  mounted: function mounted() {
103
- var children = this.$slots["default"];
98
+ var children = this.$slots["default"]();
104
99
  var ImageChild = children.find(function (o) {
105
- return o.componentOptions && o.componentOptions.tag === ResultListImage.name;
100
+ return o.type && o.type.name === ResultListImage.name;
106
101
  });
107
-
108
- if (ImageChild && ImageChild.componentOptions && ImageChild.componentOptions.propsData) {
102
+ if (ImageChild && ImageChild.props) {
109
103
  this.hasImage = true;
110
-
111
- if (ImageChild.componentOptions.propsData.small) {
104
+ if (ImageChild.props.small) {
112
105
  this.isSmall = true;
113
106
  }
114
107
  }
115
108
  },
116
109
  render: function render() {
117
- var h = arguments[0];
118
-
110
+ var _slot;
119
111
  var _this$$props = this.$props,
120
- href = _this$$props.href,
121
- target = _this$$props.target,
122
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
123
-
112
+ href = _this$$props.href,
113
+ target = _this$$props.target,
114
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
124
115
  var hasImage = this.hasImage,
125
- isSmall = this.isSmall;
116
+ isSmall = this.isSmall;
126
117
  var children = this.$slots["default"];
127
- return h(ListItem, _mergeJSXProps([{
128
- "attrs": {
129
- "href": href,
130
- "image": hasImage,
131
- "small": isSmall,
132
- "target": target,
133
- "rel": target === '_blank' ? 'noopener noreferrer' : null
118
+ return createVNode(ListItem, mergeProps({
119
+ "href": href,
120
+ "image": hasImage,
121
+ "small": isSmall,
122
+ "target": target,
123
+ "rel": target === '_blank' ? 'noopener noreferrer' : null
124
+ }, props), _isSlot$1(_slot = children()) ? _slot : {
125
+ "default": function _default() {
126
+ return [_slot];
134
127
  }
135
- }, props]), [children]);
128
+ });
136
129
  }
137
130
  };
138
-
139
131
  ResultList.install = function (Vue) {
140
132
  Vue.component(ResultList.name, ResultList);
141
133
  Vue.component(ResultListContent.name, ResultListContent);
@@ -1,22 +1,24 @@
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 '@appbaseio/reactivecore/lib/utils/constants';
5
- import 'emotion';
3
+ import _transformOn from '@vue/babel-helper-vue-transform-on';
4
+ import './_rollupPluginBabelHelpers-ded08042.js';
5
+ import { createVNode, mergeProps, createTextVNode } from 'vue';
6
+ import VueTypes from 'vue-types';
6
7
  import '@appbaseio/vue-emotion';
8
+ import 'emotion';
7
9
  import 'polished';
8
- import { f as filters, B as Button } from './Button-d8bc15ea.js';
9
- import { t as types } from './vueTypes-b8146772.js';
10
+ import { f as filters, B as Button } from './Button-474510e3.js';
11
+ import { t as types } from './vueTypes-f1923c72.js';
10
12
  import 'redux';
11
- import { n as decodeHtml, c as connect } from './index-7788a843.js';
12
- import { T as Title } from './Title-3342664a.js';
13
- import { C as Container } from './Container-ba826e96.js';
13
+ import { f as decodeHtml, c as connect } from './index-4520a598.js';
14
+ import { T as Title } from './Title-863dfa42.js';
15
+ import { C as Container } from './Container-d00219f7.js';
14
16
 
15
17
  var setValue = Actions.setValue,
16
- clearValues = Actions.clearValues,
17
- resetValuesToDefault = Actions.resetValuesToDefault;
18
+ clearValues = Actions.clearValues,
19
+ resetValuesToDefault = Actions.resetValuesToDefault;
18
20
  var getClassName = helper.getClassName,
19
- handleA11yAction = helper.handleA11yAction;
21
+ handleA11yAction = helper.handleA11yAction;
20
22
  var SelectedFilters = {
21
23
  name: 'SelectedFilters',
22
24
  props: {
@@ -36,11 +38,8 @@ var SelectedFilters = {
36
38
  },
37
39
  render: function render() {
38
40
  var _this = this;
39
-
40
- var h = arguments[0];
41
-
42
- if (this.$scopedSlots["default"]) {
43
- return this.$scopedSlots["default"]({
41
+ if (this.$slots["default"]) {
42
+ return this.$slots["default"]({
44
43
  components: this.components,
45
44
  selectedValues: this.selectedValues,
46
45
  clearValues: this.clearValues,
@@ -49,54 +48,58 @@ var SelectedFilters = {
49
48
  resetValuesToDefault: this.resetValuesToDefault
50
49
  });
51
50
  }
52
-
53
51
  var filtersToRender = this.renderFilters();
54
52
  var hasValues = !!filtersToRender.length;
55
- return h(Container, {
53
+ return createVNode(Container, {
56
54
  "class": filters(this.theme) + " " + (this.$props.className || '')
57
- }, [this.$props.title && hasValues && h(Title, {
58
- "class": getClassName(this.$props.innerClass, 'title') || ''
59
- }, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? h(Button, {
60
- "class": getClassName(this.$props.innerClass, 'button') || '',
61
- "on": _extends({}, {
62
- click: this.clearValues,
63
- keypress: function keypress(event) {
64
- return handleA11yAction(event, function () {
65
- return _this.clearValues();
66
- });
67
- }
68
- }),
69
- "attrs": {
70
- "tabIndex": "0"
55
+ }, {
56
+ "default": function _default() {
57
+ return [_this.$props.title && hasValues && createVNode(Title, {
58
+ "class": getClassName(_this.$props.innerClass, 'title') || ''
59
+ }, {
60
+ "default": function _default() {
61
+ return [_this.$props.title];
62
+ }
63
+ }), filtersToRender, _this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? createVNode(Button, mergeProps(_transformOn({
64
+ click: _this.clearValues,
65
+ keypress: function keypress(event) {
66
+ return handleA11yAction(event, function () {
67
+ return _this.clearValues();
68
+ });
69
+ }
70
+ }), {
71
+ "class": getClassName(_this.$props.innerClass, 'button') || '',
72
+ "tabIndex": "0"
73
+ }), {
74
+ "default": function _default() {
75
+ return [_this.$props.clearAllLabel];
76
+ }
77
+ }) : null];
71
78
  }
72
- }, [this.$props.clearAllLabel]) : null]);
79
+ });
73
80
  },
74
81
  methods: {
75
82
  remove: function remove(component, value) {
76
83
  if (value === void 0) {
77
84
  value = null;
78
85
  }
79
-
80
86
  this.setValue(component, null);
81
87
  this.$emit('clear', component, value);
82
88
  },
83
89
  clearValues: function clearValues() {
84
90
  var resetToDefault = this.resetToDefault,
85
- resetToValues = this.resetToValues,
86
- clearAllBlacklistComponents = this.clearAllBlacklistComponents;
87
-
91
+ resetToValues = this.resetToValues,
92
+ clearAllBlacklistComponents = this.clearAllBlacklistComponents;
88
93
  if (resetToDefault) {
89
94
  this.resetValuesToDefault(clearAllBlacklistComponents);
90
95
  } else {
91
96
  this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
92
97
  }
93
-
94
98
  this.$emit('clear', resetToValues);
95
99
  },
96
100
  clearValue: function clearValue(componentId) {
97
101
  var resetToDefault = this.resetToDefault,
98
- resetToValues = this.resetToValues;
99
-
102
+ resetToValues = this.resetToValues;
100
103
  if (resetToDefault) {
101
104
  this.resetValuesToDefault(this.components.filter(function (component) {
102
105
  return component !== componentId;
@@ -104,69 +107,61 @@ var SelectedFilters = {
104
107
  } else {
105
108
  this.setValue(componentId, (resetToValues == null ? void 0 : resetToValues[componentId]) || null);
106
109
  }
107
-
108
110
  this.$emit('clear', resetToValues == null ? void 0 : resetToValues[componentId]);
109
111
  },
110
112
  renderValue: function renderValue(value, isArray) {
111
113
  var _this2 = this;
112
-
113
114
  if (isArray && value.length) {
114
115
  var arrayToRender = value.map(function (item) {
115
116
  return _this2.renderValue(item);
116
117
  });
117
118
  return arrayToRender.join(', ');
118
119
  }
119
-
120
120
  if (value && typeof value === 'object') {
121
121
  // TODO: support for NestedList
122
122
  var label = (typeof value.label === 'string' ? value.label : value.value) || value.key || value.distance || null;
123
-
124
123
  if (value.location) {
125
124
  label = value.location + " - " + label;
126
125
  }
127
-
128
126
  return label;
129
127
  }
130
-
131
128
  return value;
132
129
  },
133
130
  renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
134
- var h = this.$createElement;
135
- return h(Button, {
131
+ return createVNode(Button, mergeProps(_transformOn({
132
+ click: handleRemove,
133
+ keypress: function keypress(event) {
134
+ return handleA11yAction(event, handleRemove);
135
+ }
136
+ }), {
136
137
  "class": getClassName(this.$props.innerClass, 'button') || '',
137
138
  "key": keyProp,
138
- "on": _extends({}, {
139
- click: handleRemove,
140
- keypress: function keypress(event) {
141
- return handleA11yAction(event, handleRemove);
142
- }
143
- }),
144
- "attrs": {
145
- "tabIndex": "0"
139
+ "tabIndex": "0"
140
+ }), {
141
+ "default": function _default() {
142
+ return [createVNode("span", null, [label]), createVNode("span", null, [createTextVNode("\u2715")])];
146
143
  }
147
- }, [h("span", [label]), h("span", ["\u2715"])]);
144
+ });
148
145
  },
149
146
  renderFilters: function renderFilters() {
150
147
  var _this3 = this;
151
-
152
148
  var selectedValues = this.selectedValues;
153
149
  var filterComponents = Object.keys(selectedValues).filter(function (id) {
154
150
  return _this3.components.includes(id) && selectedValues[id].showFilter;
155
151
  });
156
152
  return filterComponents.map(function (component, index) {
157
153
  var _selectedValues$compo = selectedValues[component],
158
- label = _selectedValues$compo.label,
159
- value = _selectedValues$compo.value;
160
- var isArray = Array.isArray(value); // default behaviour
154
+ label = _selectedValues$compo.label,
155
+ value = _selectedValues$compo.value;
156
+ var isArray = Array.isArray(value);
161
157
 
158
+ // default behaviour
162
159
  if (label && (isArray && value.length || !isArray && value)) {
163
160
  var valueToRender = _this3.renderValue(value, isArray);
164
-
165
161
  return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
166
162
  return _this3.remove(component, value);
167
163
  }, selectedValues[component].label + ": " + decodeHtml(valueToRender));
168
164
  }
169
-
170
165
  return null;
171
166
  }).filter(Boolean);
172
167
  }
@@ -177,23 +172,21 @@ var SelectedFilters = {
177
172
  }
178
173
  }
179
174
  };
180
-
181
175
  var mapStateToProps = function mapStateToProps(state) {
182
176
  return {
183
177
  components: state.components,
184
178
  selectedValues: state.selectedValues
185
179
  };
186
180
  };
187
-
188
181
  var mapDispatchtoProps = {
189
182
  clearValuesAction: clearValues,
190
183
  setValue: setValue,
191
184
  resetValuesToDefault: resetValuesToDefault
192
185
  };
193
186
  var RcConnected = connect(mapStateToProps, mapDispatchtoProps)(SelectedFilters);
194
-
195
- SelectedFilters.install = function (Vue) {
196
- Vue.component(SelectedFilters.name, RcConnected);
187
+ RcConnected.name = SelectedFilters.name;
188
+ RcConnected.install = function (Vue) {
189
+ Vue.component(RcConnected.name, RcConnected);
197
190
  };
198
191
 
199
- export default SelectedFilters;
192
+ export default RcConnected;