@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,27 +1,29 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
- import './_rollupPluginBabelHelpers-76660dab.js';
3
- import VueTypes from 'vue-types';
4
2
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
- import 'emotion';
3
+ import './_rollupPluginBabelHelpers-ded08042.js';
4
+ import { createVNode } from 'vue';
5
+ import VueTypes from 'vue-types';
6
6
  import '@appbaseio/vue-emotion';
7
+ import 'emotion';
7
8
  import 'polished';
8
- import { B as Button, t as toggleButtons } from './Button-d8bc15ea.js';
9
- import { t as types } from './vueTypes-b8146772.js';
9
+ import { B as Button, t as toggleButtons } from './Button-474510e3.js';
10
+ import { t as types } from './vueTypes-f1923c72.js';
10
11
  import '@appbaseio/reactivecore/lib/utils/transform';
11
12
  import 'redux';
12
- import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
13
- import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
14
- import { T as Title } from './Title-3342664a.js';
15
- import { C as Container } from './Container-ba826e96.js';
13
+ import { j as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-4520a598.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-3dfe6931.js';
15
+ import { P as PreferencesConsumer } from './PreferencesConsumer-24e88f3b.js';
16
+ import { T as Title } from './Title-863dfa42.js';
17
+ import { C as Container } from './Container-d00219f7.js';
16
18
 
17
19
  var updateQuery = Actions.updateQuery,
18
- setQueryOptions = Actions.setQueryOptions,
19
- setCustomQuery = Actions.setCustomQuery;
20
+ setQueryOptions = Actions.setQueryOptions,
21
+ setCustomQuery = Actions.setCustomQuery;
20
22
  var isEqual = helper.isEqual,
21
- checkValueChange = helper.checkValueChange,
22
- getClassName = helper.getClassName,
23
- getOptionsFromQuery = helper.getOptionsFromQuery,
24
- handleA11yAction = helper.handleA11yAction;
23
+ checkValueChange = helper.checkValueChange,
24
+ getClassName = helper.getClassName,
25
+ getOptionsFromQuery = helper.getOptionsFromQuery,
26
+ handleA11yAction = helper.handleA11yAction;
25
27
  var ToggleButton = {
26
28
  name: 'ToggleButton',
27
29
  props: {
@@ -56,17 +58,12 @@ var ToggleButton = {
56
58
  var value = this.selectedValue || props.value || props.defaultValue || [];
57
59
  var currentValue = ToggleButton.parseValue(value, props);
58
60
  this.setValue(currentValue);
59
-
60
61
  if (this.$data.currentValue.length) {
61
62
  this.handleToggle(this.$data.currentValue, true, props, hasMounted);
62
63
  }
63
64
  },
64
65
  created: function created() {
65
- if (!this.enableAppbase && this.$props.index) {
66
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
67
- } // Set custom query in store
68
-
69
-
66
+ // Set custom query in store
70
67
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
71
68
  },
72
69
  watch: {
@@ -93,7 +90,6 @@ var ToggleButton = {
93
90
  } else {
94
91
  // else selectedValue will be a string
95
92
  var currentValue = this.$data.currentValue[0] ? this.$data.currentValue[0].value : null;
96
-
97
93
  if (!isEqual(currentValue, this.selectedValue) && !isEqual(oldVal, this.selectedValue)) {
98
94
  this.handleToggle(this.selectedValue || [], true, this.$props);
99
95
  }
@@ -110,19 +106,15 @@ var ToggleButton = {
110
106
  if (isDefaultValue === void 0) {
111
107
  isDefaultValue = false;
112
108
  }
113
-
114
109
  if (props === void 0) {
115
110
  props = this.$props;
116
111
  }
117
-
118
112
  if (hasMounted === void 0) {
119
113
  hasMounted = true;
120
114
  }
121
-
122
115
  var currentValue = this.$data.currentValue;
123
116
  var toggleValue = value;
124
117
  var finalValue = [];
125
-
126
118
  if (isDefaultValue) {
127
119
  finalValue = ToggleButton.parseValue(toggleValue, props);
128
120
  } else if (this.$props.multiSelect) {
@@ -136,7 +128,6 @@ var ToggleButton = {
136
128
  return item.value === toggleValue.value;
137
129
  }) ? [] : [toggleValue];
138
130
  }
139
-
140
131
  this.setValue(finalValue, props, hasMounted);
141
132
  },
142
133
  setReact: function setReact(props) {
@@ -146,24 +137,18 @@ var ToggleButton = {
146
137
  },
147
138
  setValue: function setValue(value, props, hasMounted) {
148
139
  var _this = this;
149
-
150
140
  if (props === void 0) {
151
141
  props = this.$props;
152
142
  }
153
-
154
143
  if (hasMounted === void 0) {
155
144
  hasMounted = true;
156
145
  }
157
-
158
146
  var performUpdate = function performUpdate() {
159
147
  var handleUpdates = function handleUpdates() {
160
148
  _this.updateQuery(value, props);
161
-
162
149
  _this.$emit('valueChange', value);
163
-
164
150
  _this.$emit('value-change', value);
165
151
  };
166
-
167
152
  if (hasMounted) {
168
153
  _this.currentValue = value;
169
154
  handleUpdates();
@@ -171,27 +156,21 @@ var ToggleButton = {
171
156
  handleUpdates();
172
157
  }
173
158
  };
174
-
175
159
  checkValueChange(props.componentId, props.multiSelect ? value : value[0], props.beforeValueChange, performUpdate);
176
160
  },
177
161
  updateQuery: function updateQuery(value, props) {
178
162
  var filterValue = value;
179
-
180
163
  if (!props.multiSelect) {
181
164
  filterValue = value[0] ? value[0].value : null;
182
165
  }
183
-
184
166
  var customQuery = props.customQuery;
185
167
  var query = ToggleButton.defaultQuery(value, props);
186
-
187
168
  if (customQuery) {
188
169
  var _ref = customQuery(value, props) || {};
189
-
190
170
  query = _ref.query;
191
171
  this.setQueryOptions(props.componentId, getOptionsFromQuery(customQuery(value, props)), false);
192
172
  updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
193
173
  }
194
-
195
174
  this.updateQueryHandler({
196
175
  componentId: props.componentId,
197
176
  query: query,
@@ -205,30 +184,24 @@ var ToggleButton = {
205
184
  },
206
185
  handleClick: function handleClick(item) {
207
186
  var _this$$props = this.$props,
208
- enableStrictSelection = _this$$props.enableStrictSelection,
209
- multiSelect = _this$$props.multiSelect;
210
-
187
+ enableStrictSelection = _this$$props.enableStrictSelection,
188
+ multiSelect = _this$$props.multiSelect;
211
189
  if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
212
190
  return isEqual(item, stateItem);
213
191
  })) {
214
192
  return false;
215
193
  }
216
-
217
194
  var value = this.$props.value;
218
-
219
195
  if (value === undefined) {
220
196
  this.handleToggle(item);
221
197
  } else {
222
198
  this.$emit('change', item.value);
223
199
  }
224
-
225
200
  return true;
226
201
  },
227
202
  renderButton: function renderButton(item) {
228
203
  var _this2 = this;
229
-
230
- var h = this.$createElement;
231
- var renderItem = this.$scopedSlots.renderItem || this.renderItem;
204
+ var renderItem = this.$slots.renderItem || this.renderItem;
232
205
  var isSelected = this.$data.currentValue.some(function (value) {
233
206
  return value.value === item.value;
234
207
  });
@@ -238,41 +211,46 @@ var ToggleButton = {
238
211
  handleClick: function handleClick() {
239
212
  return _this2.handleClick(item);
240
213
  }
241
- }) : h(Button, {
214
+ }) : createVNode(Button, {
242
215
  "class": getClassName(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
243
- "on": {
244
- "click": function click() {
245
- return _this2.handleClick(item);
246
- },
247
- "keypress": function keypress(e) {
248
- return handleA11yAction(e, function () {
249
- return _this2.handleClick(item);
250
- });
251
- }
216
+ "onClick": function onClick() {
217
+ return _this2.handleClick(item);
252
218
  },
253
219
  "key": item.value,
254
- "attrs": {
255
- "primary": isSelected,
256
- "large": true,
257
- "tabIndex": isSelected ? '-1' : '0'
220
+ "primary": isSelected,
221
+ "large": true,
222
+ "tabIndex": isSelected ? '-1' : '0',
223
+ "onKeypress": function onKeypress(e) {
224
+ return handleA11yAction(e, function () {
225
+ return _this2.handleClick(item);
226
+ });
258
227
  }
259
- }, [item.label]);
228
+ }, {
229
+ "default": function _default() {
230
+ return [item.label];
231
+ }
232
+ });
260
233
  }
261
234
  },
262
235
  render: function render() {
263
236
  var _this3 = this;
264
-
265
- var h = arguments[0];
266
- return h(Container, {
237
+ return createVNode(Container, {
267
238
  "class": toggleButtons
268
- }, [this.$props.title && h(Title, {
269
- "class": getClassName(this.$props.innerClass, 'title')
270
- }, [this.$props.title]), this.$props.data.map(function (item) {
271
- return _this3.renderButton(item);
272
- })]);
239
+ }, {
240
+ "default": function _default() {
241
+ return [_this3.$props.title && createVNode(Title, {
242
+ "class": getClassName(_this3.$props.innerClass, 'title')
243
+ }, {
244
+ "default": function _default() {
245
+ return [_this3.$props.title];
246
+ }
247
+ }), _this3.$props.data.map(function (item) {
248
+ return _this3.renderButton(item);
249
+ })];
250
+ }
251
+ });
273
252
  }
274
253
  };
275
-
276
254
  ToggleButton.parseValue = function (value, props) {
277
255
  if (Array.isArray(value)) {
278
256
  if (typeof value[0] === 'string') {
@@ -280,70 +258,45 @@ ToggleButton.parseValue = function (value, props) {
280
258
  return value.includes(item.value);
281
259
  });
282
260
  }
283
-
284
261
  return value;
285
262
  }
286
-
287
263
  return props.data.filter(function (item) {
288
264
  return item.value === value;
289
265
  });
290
266
  };
291
-
292
267
  ToggleButton.defaultQuery = function (value, props) {
293
- var query = null;
294
-
295
- if (value && value.length) {
296
- query = {
297
- bool: {
298
- boost: 1.0,
299
- minimum_should_match: 1,
300
- should: value.map(function (item) {
301
- var _term;
302
-
303
- return {
304
- term: (_term = {}, _term[props.dataField] = item.value, _term)
305
- };
306
- })
307
- }
308
- };
309
- }
310
-
311
- if (query && props.nestedField) {
312
- return {
313
- query: {
314
- nested: {
315
- path: props.nestedField,
316
- query: query
317
- }
318
- }
319
- };
320
- }
321
-
322
- return query;
268
+ return {
269
+ query: {
270
+ queryFormat: props.queryFormat,
271
+ dataField: props.dataField,
272
+ value: value,
273
+ nestedField: props.nestedField,
274
+ selectAllLabel: props.selectAllLabel,
275
+ showMissing: props.showMissing,
276
+ multiSelect: props.multiSelect
277
+ }
278
+ };
323
279
  };
324
-
325
280
  var mapStateToProps = function mapStateToProps(state, props) {
326
281
  return {
327
282
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
328
- componentProps: state.props[props.componentId],
329
- enableAppbase: state.config.enableAppbase
283
+ componentProps: state.props[props.componentId]
330
284
  };
331
285
  };
332
-
333
286
  var mapDispatchtoProps = {
334
287
  updateQueryHandler: updateQuery,
335
288
  setQueryOptions: setQueryOptions,
336
289
  setCustomQuery: setCustomQuery
337
290
  };
338
- var RcConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(ToggleButton), {
291
+ var TBConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(ToggleButton), {
339
292
  componentType: componentTypes.toggleButton
340
- });
341
-
342
- ToggleButton.install = function (Vue) {
343
- Vue.component(ToggleButton.name, RcConnected);
344
- }; // Add componentType for SSR
345
-
346
-
347
- ToggleButton.componentType = componentTypes.toggleButton;
293
+ }));
294
+ TBConnected.name = ToggleButton.name;
295
+ TBConnected.install = function (Vue) {
296
+ Vue.component(TBConnected.name, TBConnected);
297
+ };
298
+ // Add componentType for SSR
299
+ TBConnected.componentType = componentTypes.toggleButton;
348
300
 
349
- export default ToggleButton;
301
+ export default TBConnected;
302
+ export { TBConnected };
@@ -2,26 +2,21 @@ function _extends() {
2
2
  _extends = Object.assign ? Object.assign.bind() : function (target) {
3
3
  for (var i = 1; i < arguments.length; i++) {
4
4
  var source = arguments[i];
5
-
6
5
  for (var key in source) {
7
6
  if (Object.prototype.hasOwnProperty.call(source, key)) {
8
7
  target[key] = source[key];
9
8
  }
10
9
  }
11
10
  }
12
-
13
11
  return target;
14
12
  };
15
13
  return _extends.apply(this, arguments);
16
14
  }
17
-
18
15
  function _inheritsLoose(subClass, superClass) {
19
16
  subClass.prototype = Object.create(superClass.prototype);
20
17
  subClass.prototype.constructor = subClass;
21
-
22
18
  _setPrototypeOf(subClass, superClass);
23
19
  }
24
-
25
20
  function _setPrototypeOf(o, p) {
26
21
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
27
22
  o.__proto__ = p;
@@ -29,47 +24,37 @@ function _setPrototypeOf(o, p) {
29
24
  };
30
25
  return _setPrototypeOf(o, p);
31
26
  }
32
-
33
27
  function _objectWithoutPropertiesLoose(source, excluded) {
34
28
  if (source == null) return {};
35
29
  var target = {};
36
30
  var sourceKeys = Object.keys(source);
37
31
  var key, i;
38
-
39
32
  for (i = 0; i < sourceKeys.length; i++) {
40
33
  key = sourceKeys[i];
41
34
  if (excluded.indexOf(key) >= 0) continue;
42
35
  target[key] = source[key];
43
36
  }
44
-
45
37
  return target;
46
38
  }
47
-
48
39
  function _taggedTemplateLiteralLoose(strings, raw) {
49
40
  if (!raw) {
50
41
  raw = strings.slice(0);
51
42
  }
52
-
53
43
  strings.raw = raw;
54
44
  return strings;
55
45
  }
56
-
57
46
  function _toPrimitive(input, hint) {
58
47
  if (typeof input !== "object" || input === null) return input;
59
48
  var prim = input[Symbol.toPrimitive];
60
-
61
49
  if (prim !== undefined) {
62
50
  var res = prim.call(input, hint || "default");
63
51
  if (typeof res !== "object") return res;
64
52
  throw new TypeError("@@toPrimitive must return a primitive value.");
65
53
  }
66
-
67
54
  return (hint === "string" ? String : Number)(input);
68
55
  }
69
-
70
56
  function _toPropertyKey(arg) {
71
57
  var key = _toPrimitive(arg, "string");
72
-
73
58
  return typeof key === "symbol" ? key : String(key);
74
59
  }
75
60