@appbaseio/reactivesearch-vue 2.0.0-alpha.3 → 3.0.0-alpha.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 (108) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +17405 -25231
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -15
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-ad042719.js +59 -0
  6. package/dist/cjs/Card-f5ab024a.js +27 -0
  7. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-75f88599.js} +42 -56
  8. package/dist/cjs/Container-29f049b2.js +12 -0
  9. package/dist/cjs/DropDown-6cf84c47.js +698 -0
  10. package/dist/cjs/DynamicRangeSlider.js +103 -155
  11. package/dist/cjs/Flex-d5675ea6.js +48 -0
  12. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  13. package/dist/cjs/Input-4b434436.js +74 -0
  14. package/dist/cjs/ListItem-d57d648d.js +42 -0
  15. package/dist/cjs/MultiDropdownList.js +124 -240
  16. package/dist/cjs/MultiList.js +123 -261
  17. package/dist/cjs/MultiRange.js +87 -133
  18. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  19. package/dist/cjs/PreferencesConsumer-eb265924.js +75 -0
  20. package/dist/cjs/RangeInput.js +163 -171
  21. package/dist/cjs/RangeSlider.js +81 -109
  22. package/dist/cjs/ReactiveBase.js +139 -157
  23. package/dist/cjs/ReactiveComponent-eb8db4c1.js +2189 -0
  24. package/dist/cjs/ReactiveComponent.js +46 -340
  25. package/dist/cjs/ReactiveGoogleMap.js +445 -655
  26. package/dist/cjs/ReactiveList.js +179 -304
  27. package/dist/cjs/ResultCard.js +36 -36
  28. package/dist/cjs/ResultList.js +48 -56
  29. package/dist/cjs/SelectedFilters.js +62 -69
  30. package/dist/cjs/SingleDropdownList.js +117 -177
  31. package/dist/cjs/SingleList.js +121 -205
  32. package/dist/cjs/SingleRange.js +78 -105
  33. package/dist/cjs/StateProvider.js +74 -47
  34. package/dist/cjs/Title-8802a218.js +12 -0
  35. package/dist/cjs/ToggleButton.js +72 -119
  36. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  37. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  38. package/dist/cjs/index.js +44 -41
  39. package/dist/cjs/initReactivesearch.js +69 -152
  40. package/dist/cjs/install.js +47 -43
  41. package/dist/cjs/ssr-6907ada3.js +66 -0
  42. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  45. package/dist/es/Button-474510e3.js +53 -0
  46. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  47. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-5166c76a.js} +42 -56
  48. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  49. package/dist/es/DropDown-8764360c.js +688 -0
  50. package/dist/es/DynamicRangeSlider.js +103 -155
  51. package/dist/es/Flex-a08e22d7.js +46 -0
  52. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  53. package/dist/es/Input-4a8ef1f3.js +69 -0
  54. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  55. package/dist/es/MultiDropdownList.js +124 -240
  56. package/dist/es/MultiList.js +123 -261
  57. package/dist/es/MultiRange.js +87 -133
  58. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  59. package/dist/es/PreferencesConsumer-c276709c.js +73 -0
  60. package/dist/es/RangeInput.js +163 -170
  61. package/dist/es/RangeSlider.js +81 -109
  62. package/dist/es/ReactiveBase.js +138 -155
  63. package/dist/es/ReactiveComponent-f9fa5780.js +2183 -0
  64. package/dist/es/ReactiveComponent.js +42 -337
  65. package/dist/es/ReactiveGoogleMap.js +440 -649
  66. package/dist/es/ReactiveList.js +177 -301
  67. package/dist/es/ResultCard.js +36 -36
  68. package/dist/es/ResultList.js +48 -56
  69. package/dist/es/SelectedFilters.js +62 -69
  70. package/dist/es/SingleDropdownList.js +117 -177
  71. package/dist/es/SingleList.js +121 -205
  72. package/dist/es/SingleRange.js +78 -105
  73. package/dist/es/StateProvider.js +75 -48
  74. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  75. package/dist/es/ToggleButton.js +72 -119
  76. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  77. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  78. package/dist/es/index.js +30 -32
  79. package/dist/es/initReactivesearch.js +69 -152
  80. package/dist/es/install.js +49 -41
  81. package/dist/es/{ssr-b2c0b401.js → ssr-af398f0c.js} +36 -7
  82. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  85. package/package.json +10 -9
  86. package/dist/cjs/Button-446f819e.js +0 -68
  87. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  88. package/dist/cjs/Card-642547a8.js +0 -30
  89. package/dist/cjs/Container-daf30918.js +0 -15
  90. package/dist/cjs/DataSearch-6cf29cf0.js +0 -2323
  91. package/dist/cjs/DataSearch.js +0 -30
  92. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  93. package/dist/cjs/Flex-aa517a13.js +0 -52
  94. package/dist/cjs/FormControlList-c195a592.js +0 -47
  95. package/dist/cjs/Input-e6603a7e.js +0 -79
  96. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  97. package/dist/cjs/Title-1de7d0f4.js +0 -15
  98. package/dist/cjs/install-42ba1d44.js +0 -1409
  99. package/dist/cjs/ssr-3027b848.js +0 -39
  100. package/dist/es/Button-d8bc15ea.js +0 -59
  101. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  102. package/dist/es/DataSearch-4888aa43.js +0 -2308
  103. package/dist/es/DataSearch.js +0 -22
  104. package/dist/es/DropDown-05a644a5.js +0 -322
  105. package/dist/es/Flex-1f0795c3.js +0 -47
  106. package/dist/es/FormControlList-c22d64f6.js +0 -40
  107. package/dist/es/Input-7a2a9fac.js +0 -71
  108. package/dist/es/install-80bc2764.js +0 -1402
@@ -1,25 +1,26 @@
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 { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
+ import './_rollupPluginBabelHelpers-ded08042.js';
4
+ import { createVNode, resolveComponent, mergeProps } from 'vue';
5
+ import VueTypes from 'vue-types';
5
6
  import '@appbaseio/vue-emotion';
6
- import { t as types } from './vueTypes-b8146772.js';
7
+ import { t as types } from './vueTypes-f1923c72.js';
7
8
  import '@appbaseio/reactivecore/lib/utils/transform';
8
9
  import 'redux';
9
- import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
10
- import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
11
- import { T as Title } from './Title-3342664a.js';
12
- import { C as Container } from './Container-ba826e96.js';
13
- import NoSSR from 'vue-no-ssr';
14
- import { g as getComponents, S as Slider } from './ssr-b2c0b401.js';
10
+ import { j as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4520a598.js';
11
+ import { C as ComponentWrapper } from './ComponentWrapper-5166c76a.js';
12
+ import { P as PreferencesConsumer } from './PreferencesConsumer-c276709c.js';
13
+ import { T as Title } from './Title-863dfa42.js';
14
+ import { C as Container } from './Container-d00219f7.js';
15
+ import { g as getComponents, N as NoSSR, S as Slider } from './ssr-af398f0c.js';
15
16
 
16
17
  var updateQuery = Actions.updateQuery,
17
- setQueryOptions = Actions.setQueryOptions,
18
- setCustomQuery = Actions.setCustomQuery;
18
+ setQueryOptions = Actions.setQueryOptions,
19
+ setCustomQuery = Actions.setCustomQuery;
19
20
  var checkValueChange = helper.checkValueChange,
20
- getClassName = helper.getClassName,
21
- getOptionsFromQuery = helper.getOptionsFromQuery,
22
- isEqual = helper.isEqual;
21
+ getClassName = helper.getClassName,
22
+ getOptionsFromQuery = helper.getOptionsFromQuery,
23
+ isEqual = helper.isEqual;
23
24
  var RangeSlider = {
24
25
  name: 'RangeSlider',
25
26
  components: getComponents(),
@@ -64,7 +65,6 @@ var RangeSlider = {
64
65
  methods: {
65
66
  handleSliderChange: function handleSliderChange(values) {
66
67
  var value = this.$props.value;
67
-
68
68
  if (value === undefined) {
69
69
  this.handleChange(values);
70
70
  } else {
@@ -80,27 +80,21 @@ var RangeSlider = {
80
80
  },
81
81
  handleChange: function handleChange(currentValue, props) {
82
82
  var _this = this;
83
-
84
83
  if (props === void 0) {
85
84
  props = this.$props;
86
85
  }
87
-
88
86
  var performUpdate = function performUpdate() {
89
87
  _this.currentValue = currentValue;
90
-
91
88
  _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
92
-
93
89
  _this.$emit('valueChange', {
94
90
  start: currentValue[0],
95
91
  end: currentValue[1]
96
92
  });
97
-
98
93
  _this.$emit('value-change', {
99
94
  start: currentValue[0],
100
95
  end: currentValue[1]
101
96
  });
102
97
  };
103
-
104
98
  checkValueChange(props.componentId, {
105
99
  start: currentValue[0],
106
100
  end: currentValue[1]
@@ -109,23 +103,20 @@ var RangeSlider = {
109
103
  updateQueryHandler: function updateQueryHandler(value, props) {
110
104
  var customQuery = props.customQuery;
111
105
  var query = RangeSlider.defaultQuery(value, props);
112
-
113
106
  if (customQuery) {
114
107
  var _ref = customQuery(value, props) || {};
115
-
116
108
  query = _ref.query;
117
109
  var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
118
110
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
119
111
  this.setQueryOptions(props.componentId, customQueryOptions, false);
120
112
  }
121
-
122
113
  var showFilter = props.showFilter,
123
- _props$range = props.range,
124
- start = _props$range.start,
125
- end = _props$range.end;
114
+ _props$range = props.range,
115
+ start = _props$range.start,
116
+ end = _props$range.end;
126
117
  var currentStart = value[0],
127
- currentEnd = value[1]; // check if the slider is at its initial position
128
-
118
+ currentEnd = value[1];
119
+ // check if the slider is at its initial position
129
120
  var isInitialValue = currentStart === start && currentEnd === end;
130
121
  this.updateQuery({
131
122
  componentId: props.componentId,
@@ -164,19 +155,14 @@ var RangeSlider = {
164
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;');
165
156
  }
166
157
 
167
- if (!this.enableAppbase && this.$props.index) {
168
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
169
- } // Set custom query in store
170
-
171
-
158
+ // Set custom query in store
172
159
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
173
160
  },
174
161
  beforeMount: function beforeMount() {
175
162
  var _this$$props = this.$props,
176
- value = _this$$props.value,
177
- defaultValue = _this$$props.defaultValue;
163
+ value = _this$$props.value,
164
+ defaultValue = _this$$props.defaultValue;
178
165
  var selectedValue = this.selectedValue;
179
-
180
166
  if (this.$props.range) {
181
167
  if (Array.isArray(selectedValue)) {
182
168
  this.handleChange(selectedValue);
@@ -190,104 +176,90 @@ var RangeSlider = {
190
176
  }
191
177
  },
192
178
  render: function render() {
193
- var h = arguments[0];
194
- return h(Container, {
179
+ var _this2 = this;
180
+ return createVNode(Container, {
195
181
  "class": this.$props.className
196
- }, [this.$props.title && h(Title, {
197
- "class": getClassName(this.$props.innerClass, 'title')
198
- }, [this.$props.title]), this.$props.range ? h(NoSSR, [h(Slider, {
199
- "class": getClassName(this.$props.innerClass, 'slider')
200
- }, [h("vue-slider-component", {
201
- "ref": "slider",
202
- "attrs": {
203
- "value": this.currentValue,
204
- "min": this.$props.range.start,
205
- "max": this.$props.range.end,
206
- "dotSize": 20,
207
- "height": 4,
208
- "enable-cross": false,
209
- "tooltip": "always"
210
- },
211
- "on": {
212
- "drag-end": this.handleSlider
213
- },
214
- "props": _extends({}, this.$props.sliderOptions)
215
- }), this.$props.rangeLabels && h("div", {
216
- "class": "label-container"
217
- }, [h("label", {
218
- "class": getClassName(this.$props.innerClass, 'label') || 'range-label-left'
219
- }, [this.$props.rangeLabels.start]), h("label", {
220
- "class": getClassName(this.$props.innerClass, 'label') || 'range-label-right'
221
- }, [this.$props.rangeLabels.end])])])]) : null]);
222
- }
223
- };
224
-
225
- RangeSlider.defaultQuery = function (values, props) {
226
- var query = null;
227
-
228
- if (Array.isArray(values) && values.length) {
229
- var _range;
230
-
231
- query = {
232
- range: (_range = {}, _range[props.dataField] = {
233
- gte: values[0],
234
- lte: values[1],
235
- boost: 2.0
236
- }, _range)
237
- };
238
- }
239
-
240
- if (query && props.nestedField) {
241
- return {
242
- query: {
243
- nested: {
244
- path: props.nestedField,
245
- query: query
246
- }
182
+ }, {
183
+ "default": function _default() {
184
+ return [_this2.$props.title && createVNode(Title, {
185
+ "class": getClassName(_this2.$props.innerClass, 'title')
186
+ }, {
187
+ "default": function _default() {
188
+ return [_this2.$props.title];
189
+ }
190
+ }), _this2.$props.range ? createVNode(NoSSR, null, {
191
+ "default": function _default() {
192
+ return [createVNode(Slider, {
193
+ "class": getClassName(_this2.$props.innerClass, 'slider')
194
+ }, {
195
+ "default": function _default() {
196
+ return [createVNode(resolveComponent("vue-slider-component"), mergeProps({
197
+ "ref": "slider",
198
+ "modelValue": _this2.currentValue,
199
+ "min": _this2.$props.range.start,
200
+ "max": _this2.$props.range.end,
201
+ "dotSize": 20,
202
+ "height": 4,
203
+ "enable-cross": false,
204
+ "onDrag-end": _this2.handleSlider,
205
+ "tooltip": "always"
206
+ }, _this2.$props.sliderOptions), null), _this2.$props.rangeLabels && createVNode("div", {
207
+ "class": "label-container"
208
+ }, [createVNode("label", {
209
+ "class": getClassName(_this2.$props.innerClass, 'label') || 'range-label-left'
210
+ }, [_this2.$props.rangeLabels.start]), createVNode("label", {
211
+ "class": getClassName(_this2.$props.innerClass, 'label') || 'range-label-right'
212
+ }, [_this2.$props.rangeLabels.end])])];
213
+ }
214
+ })];
215
+ }
216
+ }) : null];
247
217
  }
248
- };
218
+ });
249
219
  }
250
-
251
- return query;
252
220
  };
253
-
221
+ RangeSlider.defaultQuery = function (value, props) {
222
+ return {
223
+ query: {
224
+ queryFormat: props.queryFormat,
225
+ dataField: props.dataField,
226
+ value: value,
227
+ showMissing: props.showMissing
228
+ }
229
+ };
230
+ };
254
231
  RangeSlider.parseValue = function (value, props) {
255
232
  if (value) {
256
233
  return Array.isArray(value) ? value : [value.start, value.end];
257
234
  }
258
-
259
235
  if (props.range) {
260
236
  return [props.range.start, props.range.end];
261
237
  }
262
-
263
238
  return [];
264
239
  };
265
-
266
240
  var mapStateToProps = function mapStateToProps(state, props) {
267
241
  return {
268
242
  options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
269
243
  : [],
270
244
  selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
271
- componentProps: state.props[props.componentId],
272
- enableAppbase: state.config.enableAppbase
245
+ componentProps: state.props[props.componentId]
273
246
  };
274
247
  };
275
-
276
248
  var mapDispatchtoProps = {
277
249
  updateQuery: updateQuery,
278
250
  setQueryOptions: setQueryOptions,
279
251
  setCustomQuery: setCustomQuery
280
252
  };
281
- var RangeConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(RangeSlider), {
253
+ var RangeConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(RangeSlider), {
282
254
  componentType: componentTypes.rangeSlider
283
- });
284
-
285
- RangeSlider.install = function (Vue) {
286
- Vue.component(RangeSlider.name, RangeConnected);
287
- }; // Add componentType for SSR
288
-
255
+ }));
256
+ RangeConnected.name = RangeSlider.name;
257
+ RangeConnected.install = function (Vue) {
258
+ Vue.component(RangeConnected.name, RangeConnected);
259
+ };
289
260
 
290
- RangeSlider.componentType = componentTypes.rangeSlider;
261
+ // Add componentType for SSR
262
+ RangeConnected.componentType = componentTypes.rangeSlider;
291
263
 
292
- export default RangeSlider;
264
+ export default RangeConnected;
293
265
  export { RangeConnected };