@appbaseio/reactivesearch-vue 1.33.1 → 1.33.2

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 (91) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1911 -6073
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +2 -4
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-0673191e.js → Button-841fd06d.js} +1 -7
  6. package/dist/cjs/{CancelSvg-9f258f4f.js → CancelSvg-220a7cc3.js} +24 -58
  7. package/dist/cjs/{Card-642547a8.js → Card-240f283d.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-981ab977.js → ComponentWrapper-9318cece.js} +21 -41
  9. package/dist/cjs/{Container-daf30918.js → Container-e699ea95.js} +1 -1
  10. package/dist/cjs/{DataSearch-c42d8681.js → DataSearch-99a6a2e8.js} +121 -293
  11. package/dist/cjs/DataSearch.js +11 -11
  12. package/dist/cjs/{DropDown-c479bbb0.js → DropDown-8984b544.js} +27 -48
  13. package/dist/cjs/DynamicRangeSlider.js +44 -93
  14. package/dist/cjs/{Flex-aa517a13.js → Flex-ddd7cb6b.js} +1 -3
  15. package/dist/cjs/{FormControlList-c195a592.js → FormControlList-bbb5cd24.js} +1 -3
  16. package/dist/cjs/{Input-e6603a7e.js → Input-ead4cd84.js} +14 -16
  17. package/dist/cjs/{ListItem-8c9e0d68.js → ListItem-5088bd6a.js} +2 -3
  18. package/dist/cjs/MultiDropdownList.js +41 -102
  19. package/dist/cjs/MultiList.js +35 -98
  20. package/dist/cjs/MultiRange.js +20 -52
  21. package/dist/cjs/{Pagination-3d73e1b3.js → Pagination-07f4dbad.js} +10 -30
  22. package/dist/cjs/{PreferencesConsumer-4707bd94.js → PreferencesConsumer-5d67b486.js} +8 -18
  23. package/dist/cjs/RangeInput.js +36 -52
  24. package/dist/cjs/RangeSlider.js +24 -48
  25. package/dist/cjs/ReactiveBase.js +34 -79
  26. package/dist/cjs/{ReactiveComponent-63ef70c2.js → ReactiveComponent-805201c6.js} +118 -301
  27. package/dist/cjs/ReactiveComponent.js +20 -20
  28. package/dist/cjs/ReactiveGoogleMap.js +167 -353
  29. package/dist/cjs/ReactiveList.js +88 -176
  30. package/dist/cjs/ResultCard.js +10 -18
  31. package/dist/cjs/ResultList.js +13 -24
  32. package/dist/cjs/SelectedFilters.js +16 -34
  33. package/dist/cjs/SingleDropdownList.js +35 -75
  34. package/dist/cjs/SingleList.js +29 -75
  35. package/dist/cjs/SingleRange.js +17 -40
  36. package/dist/cjs/StateProvider.js +6 -26
  37. package/dist/cjs/{Title-1de7d0f4.js → Title-16042ea0.js} +1 -1
  38. package/dist/cjs/ToggleButton.js +20 -58
  39. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  40. package/dist/cjs/{index-08f8dfa3.js → index-30126fd0.js} +39 -75
  41. package/dist/cjs/index.js +20 -21
  42. package/dist/cjs/initReactivesearch.js +49 -120
  43. package/dist/cjs/install.js +20 -20
  44. package/dist/cjs/{ssr-3027b848.js → ssr-f2fc1bf6.js} +1 -4
  45. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  46. package/dist/cjs/version.js +1 -1
  47. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-7cfc2f98.js} +6 -11
  48. package/dist/es/{Button-35aa984e.js → Button-153cd885.js} +1 -7
  49. package/dist/es/{CancelSvg-4cfae5fd.js → CancelSvg-e40552a5.js} +24 -58
  50. package/dist/es/{Card-450683f1.js → Card-19ad6d90.js} +2 -2
  51. package/dist/es/{ComponentWrapper-d5e814a4.js → ComponentWrapper-240450cc.js} +21 -41
  52. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +1 -1
  53. package/dist/es/{DataSearch-d56bf07a.js → DataSearch-20f0d8f1.js} +121 -293
  54. package/dist/es/DataSearch.js +11 -11
  55. package/dist/es/{DropDown-05a644a5.js → DropDown-28ddce07.js} +27 -48
  56. package/dist/es/DynamicRangeSlider.js +44 -93
  57. package/dist/es/{Flex-1f0795c3.js → Flex-7c177a10.js} +1 -3
  58. package/dist/es/{FormControlList-c22d64f6.js → FormControlList-99797d0a.js} +1 -3
  59. package/dist/es/{Input-7a2a9fac.js → Input-c09c0b56.js} +14 -16
  60. package/dist/es/{ListItem-cad14c5e.js → ListItem-07888a65.js} +2 -3
  61. package/dist/es/MultiDropdownList.js +41 -102
  62. package/dist/es/MultiList.js +35 -98
  63. package/dist/es/MultiRange.js +20 -52
  64. package/dist/es/{Pagination-af9de08f.js → Pagination-28e56c5c.js} +10 -30
  65. package/dist/es/{PreferencesConsumer-4169deb1.js → PreferencesConsumer-bc097ebb.js} +8 -18
  66. package/dist/es/RangeInput.js +36 -52
  67. package/dist/es/RangeSlider.js +24 -48
  68. package/dist/es/ReactiveBase.js +34 -79
  69. package/dist/es/{ReactiveComponent-9e4721e1.js → ReactiveComponent-dd85aa9c.js} +118 -301
  70. package/dist/es/ReactiveComponent.js +20 -20
  71. package/dist/es/ReactiveGoogleMap.js +167 -353
  72. package/dist/es/ReactiveList.js +88 -176
  73. package/dist/es/ResultCard.js +10 -18
  74. package/dist/es/ResultList.js +13 -24
  75. package/dist/es/SelectedFilters.js +16 -34
  76. package/dist/es/SingleDropdownList.js +35 -75
  77. package/dist/es/SingleList.js +29 -75
  78. package/dist/es/SingleRange.js +17 -40
  79. package/dist/es/StateProvider.js +6 -26
  80. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +1 -1
  81. package/dist/es/ToggleButton.js +20 -58
  82. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  83. package/dist/es/{index-99c5f9c9.js → index-0444a498.js} +39 -75
  84. package/dist/es/index.js +20 -21
  85. package/dist/es/initReactivesearch.js +49 -120
  86. package/dist/es/install.js +20 -20
  87. package/dist/es/{ssr-b2c0b401.js → ssr-03607d84.js} +1 -4
  88. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  89. package/dist/es/version.js +1 -1
  90. package/dist/es/{vueTypes-b8146772.js → vueTypes-8986b709.js} +6 -11
  91. package/package.json +1 -1
@@ -1,17 +1,15 @@
1
1
  import { helper } from '@appbaseio/reactivecore';
2
2
  import VueTypes from 'vue-types';
3
- import { p as pagination, B as Button } from './Button-35aa984e.js';
4
- import { t as types } from './vueTypes-b8146772.js';
3
+ import { p as pagination, B as Button } from './Button-153cd885.js';
4
+ import { t as types } from './vueTypes-8986b709.js';
5
5
 
6
6
  var getClassName = helper.getClassName,
7
- handleA11yAction = helper.handleA11yAction;
8
-
7
+ handleA11yAction = helper.handleA11yAction;
9
8
  function getStartPage(totalPages, currentPage, showEndPage) {
10
9
  var midValue = parseInt(totalPages / 2, 10);
11
10
  var start = currentPage - (showEndPage ? Math.ceil(midValue / 2) - 1 : midValue);
12
11
  return start > 1 ? start : 2;
13
12
  }
14
-
15
13
  var Pagination = {
16
14
  name: 'Pagination',
17
15
  functional: true,
@@ -28,49 +26,40 @@ var Pagination = {
28
26
  render: function render(createElement, context) {
29
27
  var h = arguments[0];
30
28
  var props = context.props;
31
-
32
29
  var onPrevPage = function onPrevPage() {
33
30
  if (props.currentPage) {
34
31
  props.setPage(props.currentPage - 1);
35
32
  }
36
33
  };
37
-
38
34
  var onNextPage = function onNextPage() {
39
35
  if (props.currentPage < props.totalPages - 1) {
40
36
  props.setPage(props.currentPage + 1);
41
37
  }
42
38
  };
43
-
44
39
  if (!props.totalPages) {
45
40
  return null;
46
41
  }
47
-
48
42
  var innerClassName = getClassName(props.innerClass, 'button');
49
43
  var primary = props.currentPage === 0;
50
44
  var className = innerClassName || primary ? innerClassName + " " + (primary ? 'active' : '') : '';
51
-
52
45
  var buildPaginationDOM = function buildPaginationDOM(position) {
53
46
  var pages = props.pages,
54
- currentPage = props.currentPage,
55
- totalPages = props.totalPages,
56
- setPage = props.setPage,
57
- showEndPage = props.showEndPage;
47
+ currentPage = props.currentPage,
48
+ totalPages = props.totalPages,
49
+ setPage = props.setPage,
50
+ showEndPage = props.showEndPage;
58
51
  var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
59
52
  var paginationButtons = [];
60
53
  var endPage = start;
61
-
62
54
  if (start <= totalPages) {
63
55
  var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
64
-
65
56
  if (showEndPage) {
66
57
  totalPagesToShow = position === 'start' ? start + (Math.ceil(pages / 2) - pages % 2) : totalPages + 1;
67
58
  }
68
-
69
59
  if (currentPage > totalPages - pages + 2) {
70
60
  start = Math.max(2, totalPages - pages + 2);
71
61
  totalPagesToShow = start + pages;
72
62
  }
73
-
74
63
  var _loop = function _loop(i) {
75
64
  var activeButton = currentPage === i - 1;
76
65
  var classNameBtn = innerClassName || activeButton ? innerClassName + " " + (activeButton ? 'active' : '') : '';
@@ -92,38 +81,30 @@ var Pagination = {
92
81
  }
93
82
  }
94
83
  }, [i]);
95
-
96
84
  if (i <= totalPages + 1) {
97
85
  paginationButtons.push(pageBtn);
98
-
99
86
  if (i === Math.min(totalPages + 1, totalPagesToShow) - 1) {
100
87
  endPage = i;
101
88
  }
102
89
  }
103
90
  };
104
-
105
91
  for (var i = start; i < Math.min(totalPages + 1, totalPagesToShow); i += 1) {
106
92
  _loop(i);
107
93
  }
108
94
  }
109
-
110
95
  return [paginationButtons, start, endPage];
111
96
  };
112
-
113
97
  var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
114
98
  var showEndPage = props.showEndPage,
115
- currentPage = props.currentPage,
116
- totalPages = props.totalPages,
117
- pages = props.pages;
99
+ currentPage = props.currentPage,
100
+ totalPages = props.totalPages,
101
+ pages = props.pages;
118
102
  if (!showEndPage) return buildPaginationDOM('start')[0];
119
-
120
103
  if (currentPage <= totalPages - pages + 2 || totalPages < pages) {
121
104
  return buildPaginationDOM('start')[0];
122
105
  }
123
-
124
106
  return null;
125
107
  };
126
-
127
108
  return h("div", {
128
109
  "class": pagination + " " + getClassName(props.innerClass, 'pagination')
129
110
  }, [h(Button, {
@@ -169,7 +150,6 @@ var Pagination = {
169
150
  }, [props.nextLabel || 'Next'])]);
170
151
  }
171
152
  };
172
-
173
153
  Pagination.install = function (Vue) {
174
154
  Vue.component(Pagination.name, Pagination);
175
155
  };
@@ -1,5 +1,5 @@
1
- import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
2
- import { b as getCamelCase } from './index-99c5f9c9.js';
1
+ import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
2
+ import { b as getCamelCase } from './index-0444a498.js';
3
3
 
4
4
  var deepValue = function deepValue(o, p) {
5
5
  return p.split('.').reduce(function (a, v) {
@@ -11,8 +11,6 @@ var deepValue = function deepValue(o, p) {
11
11
  * and set the props from preferences to the component
12
12
  *
13
13
  */
14
-
15
-
16
14
  var PreferencesConsumer = function PreferencesConsumer(component) {
17
15
  return {
18
16
  name: 'PreferencesConsumer',
@@ -23,47 +21,39 @@ var PreferencesConsumer = function PreferencesConsumer(component) {
23
21
  },
24
22
  render: function render(h) {
25
23
  var _this = this;
26
-
27
24
  var userProps = Object.keys(this.$attrs).reduce(function (result, key) {
28
25
  var _extends2;
29
-
30
26
  return _extends({}, result, (_extends2 = {}, _extends2[getCamelCase(key)] = _this.$attrs[key], _extends2));
31
27
  }, {});
32
28
  var context = this.$searchPreferences;
33
-
34
29
  if (!userProps || !userProps.componentId) {
35
30
  throw Error('ReactiveSearch: componentId is required');
36
31
  }
37
-
38
32
  var componentId = userProps.componentId;
39
33
  var preferencesPath = userProps.preferencesPath;
40
34
  var preferences;
41
-
42
35
  if (context) {
43
36
  if (preferencesPath) {
44
37
  // read preferences from path
45
38
  preferences = deepValue(context, preferencesPath);
46
39
  } else {
47
- preferences = deepValue(context, ['componentSettings', componentId].join('.')); // read preferences from componentSettings
40
+ preferences = deepValue(context, ['componentSettings', componentId].join('.'));
41
+ // read preferences from componentSettings
48
42
  }
49
- } // Retrieve component specific preferences
50
-
51
-
43
+ }
44
+ // Retrieve component specific preferences
52
45
  var componentProps = userProps;
53
-
54
46
  if (preferences) {
55
47
  if (preferences.rsConfig) {
56
48
  componentProps = _extends({}, preferences.rsConfig, componentProps);
57
49
  } else {
58
50
  componentProps = _extends({}, preferences, componentProps);
59
51
  }
60
-
61
52
  if (preferences.enabled !== undefined && !preferences.enabled) {
62
53
  return null;
63
54
  }
64
- } // Parse component props
65
-
66
-
55
+ }
56
+ // Parse component props
67
57
  Object.keys(componentProps).forEach(function (p) {
68
58
  if (typeof componentProps[p] === 'string') {
69
59
  if (['defaultQuery', 'customQuery', 'setOption'].includes(p)) {
@@ -1,37 +1,35 @@
1
1
  import { helper } from '@appbaseio/reactivecore';
2
2
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
- import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
+ import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
4
4
  import VueTypes from 'vue-types';
5
5
  import { css } from 'emotion';
6
6
  import styled from '@appbaseio/vue-emotion';
7
7
  import 'polished';
8
- import { t as types } from './vueTypes-b8146772.js';
8
+ import { t as types } from './vueTypes-8986b709.js';
9
9
  import '@appbaseio/reactivecore/lib/utils/transform';
10
10
  import 'redux';
11
- import { c as connect } from './index-99c5f9c9.js';
12
- import { C as ComponentWrapper } from './ComponentWrapper-d5e814a4.js';
13
- import { P as PreferencesConsumer } from './PreferencesConsumer-4169deb1.js';
14
- import './Title-3342664a.js';
15
- import { F as Flex } from './Flex-1f0795c3.js';
16
- import { I as Input } from './Input-7a2a9fac.js';
17
- import { C as Container } from './Container-ba826e96.js';
11
+ import { c as connect } from './index-0444a498.js';
12
+ import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
13
+ import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
14
+ import './Title-863dfa42.js';
15
+ import { F as Flex } from './Flex-7c177a10.js';
16
+ import { I as Input } from './Input-c09c0b56.js';
17
+ import { C as Container } from './Container-d00219f7.js';
18
18
  import 'vue-no-ssr';
19
- import './ssr-b2c0b401.js';
19
+ import './ssr-03607d84.js';
20
20
  import { RangeConnected as RangeConnected$1 } from './RangeSlider.js';
21
21
 
22
22
  var _templateObject, _templateObject2;
23
-
24
23
  var alert = function alert(_ref) {
25
24
  var theme = _ref.theme;
26
25
  return css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
27
26
  };
28
-
29
27
  var Content = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
30
28
  return props.alert && alert;
31
29
  });
32
30
 
33
31
  var getClassName = helper.getClassName,
34
- isEqual = helper.isEqual;
32
+ isEqual = helper.isEqual;
35
33
  var RangeInput = {
36
34
  name: 'RangeInput',
37
35
  components: {
@@ -93,27 +91,22 @@ var RangeInput = {
93
91
  methods: {
94
92
  shouldUpdate: function shouldUpdate(value) {
95
93
  var validateRange = this.$props.validateRange;
96
-
97
94
  if (validateRange && value) {
98
95
  return validateRange([value.start, value.end]);
99
96
  }
100
-
101
97
  if (value) {
102
98
  return value.start <= value.end;
103
99
  }
104
-
105
100
  return false;
106
101
  },
107
102
  isControlled: function isControlled() {
108
103
  if (this.$props.value && this.$listeners) {
109
104
  return true;
110
105
  }
111
-
112
106
  return false;
113
107
  },
114
108
  handleChange: function handleChange(value, event) {
115
109
  var currentValue = value;
116
-
117
110
  if (this.shouldUpdate(value) && !isEqual(value, this.currentValue)) {
118
111
  switch (event) {
119
112
  case 'change':
@@ -123,16 +116,13 @@ var RangeInput = {
123
116
  end: this.$props.range ? this.$props.range.end : 10
124
117
  };
125
118
  }
126
-
127
119
  this.$data.currentValue = _extends({}, currentValue);
128
120
  this.$emit('change', this.$data.currentValue);
129
121
  break;
130
-
131
122
  case 'value-change':
132
123
  this.$emit('valueChange', this.$data.currentValue);
133
124
  this.$emit('value-change', this.$data.currentValue);
134
125
  break;
135
-
136
126
  default:
137
127
  this.$data.currentValue = _extends({}, currentValue);
138
128
  break;
@@ -147,9 +137,8 @@ var RangeInput = {
147
137
  },
148
138
  handleInputChange: function handleInputChange(e) {
149
139
  var _e$target = e.target,
150
- name = _e$target.name,
151
- value = _e$target.value;
152
-
140
+ name = _e$target.name,
141
+ value = _e$target.value;
153
142
  if (Number.isNaN(value)) {
154
143
  if (name === 'start') {
155
144
  this.$data.isStartValid = false;
@@ -161,7 +150,6 @@ var RangeInput = {
161
150
  } else if (name === 'end' && !this.$data.isEndValid) {
162
151
  this.$data.isEndValid = true;
163
152
  }
164
-
165
153
  if (this.$data.isStartValid && this.$data.isEndValid) {
166
154
  if (name === 'start') {
167
155
  this.handleChange({
@@ -195,7 +183,6 @@ var RangeInput = {
195
183
  if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
196
184
  this.handleChange(this.$props.defaultValue);
197
185
  }
198
-
199
186
  if (this.isControlled()) {
200
187
  this.handleChange(this.$props.value, 'change');
201
188
  }
@@ -203,27 +190,27 @@ var RangeInput = {
203
190
  render: function render() {
204
191
  var h = arguments[0];
205
192
  var _this$$props = this.$props,
206
- className = _this$$props.className,
207
- dataField = _this$$props.dataField,
208
- range = _this$$props.range,
209
- rangeLabels = _this$$props.rangeLabels,
210
- componentId = _this$$props.componentId,
211
- innerClass = _this$$props.innerClass,
212
- stepValue = _this$$props.stepValue,
213
- componentStyle = _this$$props.componentStyle,
214
- themePreset = _this$$props.themePreset,
215
- includeNullValues = _this$$props.includeNullValues,
216
- beforeValueChange = _this$$props.beforeValueChange,
217
- customQuery = _this$$props.customQuery,
218
- data = _this$$props.data,
219
- filterLabel = _this$$props.filterLabel,
220
- react = _this$$props.react,
221
- showFilter = _this$$props.showFilter,
222
- showCheckbox = _this$$props.showCheckbox,
223
- title = _this$$props.title,
224
- URLParams = _this$$props.URLParams,
225
- sliderOptions = _this$$props.sliderOptions,
226
- nestedField = _this$$props.nestedField;
193
+ className = _this$$props.className,
194
+ dataField = _this$$props.dataField,
195
+ range = _this$$props.range,
196
+ rangeLabels = _this$$props.rangeLabels,
197
+ componentId = _this$$props.componentId,
198
+ innerClass = _this$$props.innerClass,
199
+ stepValue = _this$$props.stepValue,
200
+ componentStyle = _this$$props.componentStyle,
201
+ themePreset = _this$$props.themePreset,
202
+ includeNullValues = _this$$props.includeNullValues,
203
+ beforeValueChange = _this$$props.beforeValueChange,
204
+ customQuery = _this$$props.customQuery,
205
+ data = _this$$props.data,
206
+ filterLabel = _this$$props.filterLabel,
207
+ react = _this$$props.react,
208
+ showFilter = _this$$props.showFilter,
209
+ showCheckbox = _this$$props.showCheckbox,
210
+ title = _this$$props.title,
211
+ URLParams = _this$$props.URLParams,
212
+ sliderOptions = _this$$props.sliderOptions,
213
+ nestedField = _this$$props.nestedField;
227
214
  return h(Container, {
228
215
  "style": componentStyle,
229
216
  "class": className
@@ -319,22 +306,19 @@ var RangeInput = {
319
306
  }, ["Input range is invalid"])])])]);
320
307
  }
321
308
  };
322
-
323
309
  var mapStateToProps = function mapStateToProps(state) {
324
310
  return {
325
311
  themePreset: state.config.themePreset
326
312
  };
327
313
  };
328
-
329
314
  var RangeConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, {})(RangeInput), {
330
315
  componentType: componentTypes.rangeInput
331
316
  }));
332
-
333
317
  RangeInput.install = function (Vue) {
334
318
  Vue.component(RangeInput.name, RangeConnected);
335
- }; // Add componentType for SSR
336
-
319
+ };
337
320
 
321
+ // Add componentType for SSR
338
322
  RangeInput.componentType = componentTypes.rangeInput;
339
323
 
340
324
  export default RangeInput;
@@ -1,26 +1,26 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
2
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
- import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
+ import { a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
4
4
  import VueTypes from 'vue-types';
5
5
  import '@appbaseio/vue-emotion';
6
- import { t as types } from './vueTypes-b8146772.js';
6
+ import { t as types } from './vueTypes-8986b709.js';
7
7
  import '@appbaseio/reactivecore/lib/utils/transform';
8
8
  import 'redux';
9
- import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-99c5f9c9.js';
10
- import { C as ComponentWrapper } from './ComponentWrapper-d5e814a4.js';
11
- import { P as PreferencesConsumer } from './PreferencesConsumer-4169deb1.js';
12
- import { T as Title } from './Title-3342664a.js';
13
- import { C as Container } from './Container-ba826e96.js';
9
+ import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-0444a498.js';
10
+ import { C as ComponentWrapper } from './ComponentWrapper-240450cc.js';
11
+ import { P as PreferencesConsumer } from './PreferencesConsumer-bc097ebb.js';
12
+ import { T as Title } from './Title-863dfa42.js';
13
+ import { C as Container } from './Container-d00219f7.js';
14
14
  import NoSSR from 'vue-no-ssr';
15
- import { g as getComponents, S as Slider } from './ssr-b2c0b401.js';
15
+ import { g as getComponents, S as Slider } from './ssr-03607d84.js';
16
16
 
17
17
  var updateQuery = Actions.updateQuery,
18
- setQueryOptions = Actions.setQueryOptions,
19
- setCustomQuery = Actions.setCustomQuery;
18
+ setQueryOptions = Actions.setQueryOptions,
19
+ setCustomQuery = Actions.setCustomQuery;
20
20
  var checkValueChange = helper.checkValueChange,
21
- getClassName = helper.getClassName,
22
- getOptionsFromQuery = helper.getOptionsFromQuery,
23
- isEqual = helper.isEqual;
21
+ getClassName = helper.getClassName,
22
+ getOptionsFromQuery = helper.getOptionsFromQuery,
23
+ isEqual = helper.isEqual;
24
24
  var RangeSlider = {
25
25
  name: 'RangeSlider',
26
26
  components: getComponents(),
@@ -65,7 +65,6 @@ var RangeSlider = {
65
65
  methods: {
66
66
  handleSliderChange: function handleSliderChange(values) {
67
67
  var value = this.$props.value;
68
-
69
68
  if (value === undefined) {
70
69
  this.handleChange(values);
71
70
  } else {
@@ -81,27 +80,21 @@ var RangeSlider = {
81
80
  },
82
81
  handleChange: function handleChange(currentValue, props) {
83
82
  var _this = this;
84
-
85
83
  if (props === void 0) {
86
84
  props = this.$props;
87
85
  }
88
-
89
86
  var performUpdate = function performUpdate() {
90
87
  _this.currentValue = currentValue;
91
-
92
88
  _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
93
-
94
89
  _this.$emit('valueChange', {
95
90
  start: currentValue[0],
96
91
  end: currentValue[1]
97
92
  });
98
-
99
93
  _this.$emit('value-change', {
100
94
  start: currentValue[0],
101
95
  end: currentValue[1]
102
96
  });
103
97
  };
104
-
105
98
  checkValueChange(props.componentId, {
106
99
  start: currentValue[0],
107
100
  end: currentValue[1]
@@ -110,23 +103,20 @@ var RangeSlider = {
110
103
  updateQueryHandler: function updateQueryHandler(value, props) {
111
104
  var customQuery = props.customQuery;
112
105
  var query = RangeSlider.defaultQuery(value, props);
113
-
114
106
  if (customQuery) {
115
107
  var _ref = customQuery(value, props) || {};
116
-
117
108
  query = _ref.query;
118
109
  var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
119
110
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
120
111
  this.setQueryOptions(props.componentId, customQueryOptions, false);
121
112
  }
122
-
123
113
  var showFilter = props.showFilter,
124
- _props$range = props.range,
125
- start = _props$range.start,
126
- end = _props$range.end;
114
+ _props$range = props.range,
115
+ start = _props$range.start,
116
+ end = _props$range.end;
127
117
  var currentStart = value[0],
128
- currentEnd = value[1]; // check if the slider is at its initial position
129
-
118
+ currentEnd = value[1];
119
+ // check if the slider is at its initial position
130
120
  var isInitialValue = currentStart === start && currentEnd === end;
131
121
  this.updateQuery({
132
122
  componentId: props.componentId,
@@ -164,20 +154,17 @@ var RangeSlider = {
164
154
  if (!this.$props.range) {
165
155
  console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
166
156
  }
167
-
168
157
  if (!this.enableAppbase && this.$props.index) {
169
158
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
170
- } // Set custom query in store
171
-
172
-
159
+ }
160
+ // Set custom query in store
173
161
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
174
162
  },
175
163
  beforeMount: function beforeMount() {
176
164
  var _this$$props = this.$props,
177
- value = _this$$props.value,
178
- defaultValue = _this$$props.defaultValue;
165
+ value = _this$$props.value,
166
+ defaultValue = _this$$props.defaultValue;
179
167
  var selectedValue = this.selectedValue;
180
-
181
168
  if (this.$props.range) {
182
169
  if (Array.isArray(selectedValue)) {
183
170
  this.handleChange(selectedValue);
@@ -222,13 +209,10 @@ var RangeSlider = {
222
209
  }, [this.$props.rangeLabels.end])])])]) : null]);
223
210
  }
224
211
  };
225
-
226
212
  RangeSlider.defaultQuery = function (values, props) {
227
213
  var query = null;
228
-
229
214
  if (Array.isArray(values) && values.length) {
230
215
  var _range;
231
-
232
216
  query = {
233
217
  range: (_range = {}, _range[props.dataField] = {
234
218
  gte: values[0],
@@ -237,7 +221,6 @@ RangeSlider.defaultQuery = function (values, props) {
237
221
  }, _range)
238
222
  };
239
223
  }
240
-
241
224
  if (query && props.nestedField) {
242
225
  return {
243
226
  query: {
@@ -248,22 +231,17 @@ RangeSlider.defaultQuery = function (values, props) {
248
231
  }
249
232
  };
250
233
  }
251
-
252
234
  return query;
253
235
  };
254
-
255
236
  RangeSlider.parseValue = function (value, props) {
256
237
  if (value) {
257
238
  return Array.isArray(value) ? value : [value.start, value.end];
258
239
  }
259
-
260
240
  if (props.range) {
261
241
  return [props.range.start, props.range.end];
262
242
  }
263
-
264
243
  return [];
265
244
  };
266
-
267
245
  var mapStateToProps = function mapStateToProps(state, props) {
268
246
  return {
269
247
  options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
@@ -273,7 +251,6 @@ var mapStateToProps = function mapStateToProps(state, props) {
273
251
  enableAppbase: state.config.enableAppbase
274
252
  };
275
253
  };
276
-
277
254
  var mapDispatchtoProps = {
278
255
  updateQuery: updateQuery,
279
256
  setQueryOptions: setQueryOptions,
@@ -282,12 +259,11 @@ var mapDispatchtoProps = {
282
259
  var RangeConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(RangeSlider), {
283
260
  componentType: componentTypes.rangeSlider
284
261
  }));
285
-
286
262
  RangeSlider.install = function (Vue) {
287
263
  Vue.component(RangeSlider.name, RangeConnected);
288
- }; // Add componentType for SSR
289
-
264
+ };
290
265
 
266
+ // Add componentType for SSR
291
267
  RangeSlider.componentType = componentTypes.rangeSlider;
292
268
 
293
269
  export default RangeSlider;