@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
@@ -6,33 +6,34 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
6
6
 
7
7
  var configureStore = require('@appbaseio/reactivecore');
8
8
  var configureStore__default = _interopDefault(configureStore);
9
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
10
- var VueTypes = _interopDefault(require('vue-types'));
11
9
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
10
+ require('./_rollupPluginBabelHelpers-f8b843f8.js');
11
+ var vue = require('vue');
12
+ var VueTypes = _interopDefault(require('vue-types'));
12
13
  require('@appbaseio/vue-emotion');
13
- var vueTypes = require('./vueTypes-727b7c63.js');
14
+ var vueTypes = require('./vueTypes-1bf00978.js');
14
15
  require('redux');
15
- var index = require('./index-6a167fe0.js');
16
- var Title = require('./Title-1de7d0f4.js');
17
- var Container = require('./Container-daf30918.js');
18
- var NoSSR = _interopDefault(require('vue-no-ssr'));
19
- var ssr = require('./ssr-3027b848.js');
16
+ var index = require('./index-d8d8f291.js');
17
+ var PreferencesConsumer = require('./PreferencesConsumer-22d1b49f.js');
18
+ var Title = require('./Title-8802a218.js');
19
+ var Container = require('./Container-29f049b2.js');
20
+ var ssr = require('./ssr-6c8a72e1.js');
20
21
 
21
22
  var addComponent = configureStore.Actions.addComponent,
22
- removeComponent = configureStore.Actions.removeComponent,
23
- watchComponent = configureStore.Actions.watchComponent,
24
- updateQuery = configureStore.Actions.updateQuery,
25
- setQueryListener = configureStore.Actions.setQueryListener,
26
- setQueryOptions = configureStore.Actions.setQueryOptions,
27
- setComponentProps = configureStore.Actions.setComponentProps,
28
- setCustomQuery = configureStore.Actions.setCustomQuery,
29
- updateComponentProps = configureStore.Actions.updateComponentProps;
23
+ removeComponent = configureStore.Actions.removeComponent,
24
+ watchComponent = configureStore.Actions.watchComponent,
25
+ updateQuery = configureStore.Actions.updateQuery,
26
+ setQueryListener = configureStore.Actions.setQueryListener,
27
+ setQueryOptions = configureStore.Actions.setQueryOptions,
28
+ setComponentProps = configureStore.Actions.setComponentProps,
29
+ setCustomQuery = configureStore.Actions.setCustomQuery,
30
+ updateComponentProps = configureStore.Actions.updateComponentProps;
30
31
  var checkValueChange = configureStore.helper.checkValueChange,
31
- getClassName = configureStore.helper.getClassName,
32
- isEqual = configureStore.helper.isEqual,
33
- checkSomePropChange = configureStore.helper.checkSomePropChange,
34
- extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
35
- getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
32
+ getClassName = configureStore.helper.getClassName,
33
+ isEqual = configureStore.helper.isEqual,
34
+ checkSomePropChange = configureStore.helper.checkSomePropChange,
35
+ extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
36
+ getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
36
37
  var DynamicRangeSlider = {
37
38
  name: 'DynamicRangeSlider',
38
39
  components: ssr.getComponents(),
@@ -68,27 +69,20 @@ var DynamicRangeSlider = {
68
69
  },
69
70
  created: function created() {
70
71
  var _this = this;
71
-
72
+ this.$timestamp = new Date().getTime();
72
73
  var onQueryChange = function onQueryChange() {
73
74
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
74
75
  args[_key] = arguments[_key];
75
76
  }
76
-
77
77
  _this.$emit.apply(_this, ['queryChange'].concat(args));
78
-
79
78
  _this.$emit.apply(_this, ['query-change'].concat(args));
80
79
  };
81
-
82
- this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
83
-
80
+ this.setQueryListener(this.$props.componentId, onQueryChange, null);
81
+ // Update props in store
84
82
  this.setComponentProps(this.componentId, this.$props, constants.componentTypes.dynamicRangeSlider);
85
83
  this.setComponentProps(this.internalRangeComponent, this.$props, constants.componentTypes.dynamicRangeSlider);
86
84
 
87
- if (!this.enableAppbase && this.$props.index) {
88
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
89
- } // Set custom query in store
90
-
91
-
85
+ // Set custom query in store
92
86
  index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
93
87
  },
94
88
  mounted: function mounted() {
@@ -96,28 +90,23 @@ var DynamicRangeSlider = {
96
90
  },
97
91
  beforeMount: function beforeMount() {
98
92
  var components = [];
99
-
100
93
  if (this.$$store) {
101
94
  var _this$$$store$getStat = this.$$store.getState();
102
-
103
95
  components = _this$$$store$getStat.components;
104
96
  }
105
-
106
97
  var value = this.$props.value;
107
-
108
98
  if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
109
- this.addComponent(this.componentId);
110
- this.addComponent(this.internalRangeComponent);
111
-
99
+ this.addComponent(this.componentId, this.$timestamp);
100
+ this.addComponent(this.internalRangeComponent, this.$timestamp);
112
101
  if (Array.isArray(this.selectedValue)) {
113
102
  this.handleChange(this.selectedValue);
114
103
  } else if (this.selectedValue) {
115
104
  this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
116
105
  } else if (value) {
117
106
  this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
118
- } // get range before executing other queries
119
-
107
+ }
120
108
 
109
+ // get range before executing other queries
121
110
  this.updateRangeQueryOptions();
122
111
  }
123
112
  },
@@ -126,7 +115,7 @@ var DynamicRangeSlider = {
126
115
  this.setDefaultValue(this.range);
127
116
  }
128
117
  },
129
- beforeDestroy: function beforeDestroy() {
118
+ beforeUnmount: function beforeUnmount() {
130
119
  if (this.destroyOnUnmount) {
131
120
  this.removeComponent(this.$props.componentId);
132
121
  this.removeComponent(this.internalRangeComponent);
@@ -134,21 +123,18 @@ var DynamicRangeSlider = {
134
123
  },
135
124
  methods: {
136
125
  isControlled: function isControlled() {
137
- if (this.$props.value && this.$listeners) {
126
+ if (this.$props.value && this.$attrs) {
138
127
  return true;
139
128
  }
140
-
141
129
  return false;
142
130
  },
143
131
  setDefaultValue: function setDefaultValue(_ref) {
144
132
  var start = _ref.start,
145
- end = _ref.end;
146
-
133
+ end = _ref.end;
147
134
  if (this.$props.defaultValue) {
148
135
  var _this$$props$defaultV = this.$props.defaultValue(start, end),
149
- defaultStart = _this$$props$defaultV.start,
150
- defaultEnd = _this$$props$defaultV.end;
151
-
136
+ defaultStart = _this$$props$defaultV.start,
137
+ defaultEnd = _this$$props$defaultV.end;
152
138
  this.handleChange([defaultStart, defaultEnd]);
153
139
  } else if (this.isControlled()) {
154
140
  this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
@@ -181,10 +167,8 @@ var DynamicRangeSlider = {
181
167
  },
182
168
  updateRangeQueryOptions: function updateRangeQueryOptions() {
183
169
  var aggs = {};
184
-
185
170
  if (this.$props.nestedField) {
186
171
  var _aggs;
187
-
188
172
  aggs = (_aggs = {}, _aggs[this.$props.nestedField] = {
189
173
  nested: {
190
174
  path: this.$props.nestedField
@@ -194,7 +178,6 @@ var DynamicRangeSlider = {
194
178
  } else {
195
179
  aggs = this.rangeQuery();
196
180
  }
197
-
198
181
  this.setQueryOptions(this.internalRangeComponent, {
199
182
  aggs: aggs
200
183
  });
@@ -202,7 +185,6 @@ var DynamicRangeSlider = {
202
185
  handleSlider: function handleSlider() {
203
186
  var sliderValues = this.$refs.slider.getValue();
204
187
  var value = this.$props.value;
205
-
206
188
  if (value === undefined) {
207
189
  this.handleChange(sliderValues);
208
190
  } else {
@@ -214,26 +196,20 @@ var DynamicRangeSlider = {
214
196
  },
215
197
  handleChange: function handleChange(currentValue) {
216
198
  var _this2 = this;
217
-
218
199
  // Always keep the values within range
219
200
  var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
220
-
221
201
  var performUpdate = function performUpdate() {
222
202
  _this2.currentValue = normalizedValue;
223
-
224
203
  _this2.updateQueryHandler(normalizedValue, _this2.$props);
225
-
226
204
  _this2.$emit('valueChange', {
227
205
  start: normalizedValue[0],
228
206
  end: normalizedValue[1]
229
207
  });
230
-
231
208
  _this2.$emit('value-change', {
232
209
  start: normalizedValue[0],
233
210
  end: normalizedValue[1]
234
211
  });
235
212
  };
236
-
237
213
  checkValueChange(this.$props.componentId, {
238
214
  start: normalizedValue[0],
239
215
  end: normalizedValue[1]
@@ -241,30 +217,25 @@ var DynamicRangeSlider = {
241
217
  },
242
218
  updateQueryHandler: function updateQueryHandler(value) {
243
219
  var query = DynamicRangeSlider.defaultQuery(value, this.$props);
244
-
245
220
  if (this.$props.customQuery) {
246
221
  var customQueryTobeSet = this.$props.customQuery(value, this.$props);
247
222
  var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
248
-
249
223
  if (queryTobeSet) {
250
224
  query = queryTobeSet;
251
225
  }
252
-
253
226
  var customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
254
227
  index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
255
228
  this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
256
229
  }
257
-
258
230
  var _ref2 = this.range || {
259
- start: value[0],
260
- end: value[1]
261
- },
262
- start = _ref2.start,
263
- end = _ref2.end;
264
-
231
+ start: value[0],
232
+ end: value[1]
233
+ },
234
+ start = _ref2.start,
235
+ end = _ref2.end;
265
236
  var currentStart = value[0],
266
- currentEnd = value[1]; // check if the slider is at its initial position
267
-
237
+ currentEnd = value[1];
238
+ // check if the slider is at its initial position
268
239
  var isInitialValue = currentStart === start && currentEnd === end;
269
240
  this.updateQuery({
270
241
  componentId: this.$props.componentId,
@@ -288,11 +259,9 @@ var DynamicRangeSlider = {
288
259
  deep: true,
289
260
  handler: function handler(newVal) {
290
261
  var _this3 = this;
291
-
292
262
  var propsKeys = index.getValidPropsKeys(newVal);
293
263
  checkSomePropChange(newVal, this.componentProps, propsKeys, function () {
294
264
  _this3.updateComponentProps(_this3.componentId, newVal, constants.componentTypes.dynamicRangeSlider);
295
-
296
265
  _this3.updateComponentProps(_this3.internalRangeComponent, newVal, constants.componentTypes.dynamicRangeSlider);
297
266
  });
298
267
  }
@@ -311,15 +280,12 @@ var DynamicRangeSlider = {
311
280
  },
312
281
  range: function range(newValue, oldValue) {
313
282
  if (isEqual(newValue, oldValue) || !this.currentValue) return;
314
-
315
283
  var _ref3 = this.currentValue || [],
316
- currentStart = _ref3[0],
317
- currentEnd = _ref3[1];
318
-
284
+ currentStart = _ref3[0],
285
+ currentEnd = _ref3[1];
319
286
  var _ref4 = oldValue || {},
320
- oldStart = _ref4.start,
321
- oldEnd = _ref4.end;
322
-
287
+ oldStart = _ref4.start,
288
+ oldEnd = _ref4.end;
323
289
  var newStart = currentStart === oldStart ? newValue.start : currentStart;
324
290
  var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
325
291
  this.handleChange([newStart, newEnd]);
@@ -336,93 +302,78 @@ var DynamicRangeSlider = {
336
302
  }
337
303
  },
338
304
  render: function render() {
339
- var h = arguments[0];
340
-
305
+ var _this4 = this;
341
306
  if (!this.range || !this.currentValue) {
342
307
  return null;
343
308
  }
344
-
345
309
  var _this$range = this.range,
346
- start = _this$range.start,
347
- end = _this$range.end;
348
- return h(Container.Container, {
310
+ start = _this$range.start,
311
+ end = _this$range.end;
312
+ return vue.createVNode(Container.Container, {
349
313
  "class": this.$props.className
350
- }, [this.$props.title && h(Title.Title, {
351
- "class": getClassName(this.$props.innerClass, 'title')
352
- }, [this.$props.title]), h(NoSSR, [h(ssr.Slider, {
353
- "class": getClassName(this.$props.innerClass, 'slider')
354
- }, [h("vue-slider-component", {
355
- "ref": "slider",
356
- "attrs": {
357
- "value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
358
- "min": Math.floor(Math.min(start, this.currentValue[0])),
359
- "max": Math.ceil(Math.max(end, this.currentValue[1])),
360
- "dotSize": 20,
361
- "height": 4,
362
- "enable-cross": false,
363
- "tooltip": "always"
364
- },
365
- "on": {
366
- "drag-end": this.handleSlider
367
- },
368
- "props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
369
- }), this.labels ? h("div", {
370
- "class": "label-container"
371
- }, [h("label", {
372
- "class": getClassName(this.$props.innerClass, 'label') || 'range-label-left'
373
- }, [this.labels.start]), h("label", {
374
- "class": getClassName(this.$props.innerClass, 'label') || 'range-label-right'
375
- }, [this.labels.end])]) : null])])]);
376
- }
377
- };
378
-
379
- DynamicRangeSlider.defaultQuery = function (values, props) {
380
- var query = null;
381
-
382
- if (Array.isArray(values) && values.length) {
383
- var _range;
384
-
385
- query = {
386
- range: (_range = {}, _range[props.dataField] = {
387
- gte: values[0],
388
- lte: values[1],
389
- boost: 2.0
390
- }, _range)
391
- };
392
- }
393
-
394
- if (query && props.nestedField) {
395
- return {
396
- query: {
397
- nested: {
398
- path: props.nestedField,
399
- query: query
400
- }
314
+ }, {
315
+ "default": function _default() {
316
+ return [_this4.$props.title && vue.createVNode(Title.Title, {
317
+ "class": getClassName(_this4.$props.innerClass, 'title')
318
+ }, {
319
+ "default": function _default() {
320
+ return [_this4.$props.title];
321
+ }
322
+ }), vue.createVNode(ssr.NoSSR, null, {
323
+ "default": function _default() {
324
+ return [vue.createVNode(ssr.Slider, {
325
+ "class": getClassName(_this4.$props.innerClass, 'slider')
326
+ }, {
327
+ "default": function _default() {
328
+ return [vue.createVNode(vue.resolveComponent("vue-slider-component"), vue.mergeProps({
329
+ "ref": "slider",
330
+ "modelValue": [Math.floor(Math.max(start, _this4.currentValue[0])), Math.ceil(Math.min(end, _this4.currentValue[1]))],
331
+ "min": Math.floor(Math.min(start, _this4.currentValue[0])),
332
+ "max": Math.ceil(Math.max(end, _this4.currentValue[1])),
333
+ "onDrag-end": _this4.handleSlider,
334
+ "dotSize": 20,
335
+ "height": 4,
336
+ "enable-cross": false,
337
+ "tooltip": "always"
338
+ }, _this4.$props.sliderOptions), null), _this4.labels ? vue.createVNode("div", {
339
+ "class": "label-container"
340
+ }, [vue.createVNode("label", {
341
+ "class": getClassName(_this4.$props.innerClass, 'label') || 'range-label-left'
342
+ }, [_this4.labels.start]), vue.createVNode("label", {
343
+ "class": getClassName(_this4.$props.innerClass, 'label') || 'range-label-right'
344
+ }, [_this4.labels.end])]) : null];
345
+ }
346
+ })];
347
+ }
348
+ })];
401
349
  }
402
- };
350
+ });
403
351
  }
404
-
405
- return query;
406
352
  };
407
-
353
+ DynamicRangeSlider.defaultQuery = function (value, props) {
354
+ return {
355
+ query: {
356
+ queryFormat: props.queryFormat,
357
+ dataField: props.dataField,
358
+ value: value,
359
+ showMissing: props.showMissing
360
+ }
361
+ };
362
+ };
408
363
  DynamicRangeSlider.parseValue = function (value) {
409
364
  if (value) {
410
365
  return Array.isArray(value) ? value : [value.start, value.end];
411
366
  }
412
-
413
367
  return [];
414
368
  };
415
-
416
369
  DynamicRangeSlider.hasInternalComponent = function () {
417
370
  return true;
418
371
  };
419
-
420
372
  var mapStateToProps = function mapStateToProps(state, props) {
421
373
  var componentId = state.aggregations[props.componentId];
422
374
  var internalRange = state.aggregations[props.componentId + "__range__internal"];
423
375
  var options = componentId && componentId[props.dataField];
424
376
  var range = state.aggregations[props.componentId + "__range__internal"];
425
-
426
377
  if (props.nestedField) {
427
378
  options = options && componentId[props.dataField][props.nestedField] && componentId[props.dataField][props.nestedField].buckets ? componentId[props.dataField][props.nestedField].buckets : [];
428
379
  range = range && internalRange[props.nestedField].min ? {
@@ -436,16 +387,13 @@ var mapStateToProps = function mapStateToProps(state, props) {
436
387
  end: internalRange.max.value
437
388
  } : null;
438
389
  }
439
-
440
390
  return {
441
391
  options: options,
442
392
  range: range,
443
393
  selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
444
- componentProps: state.props[props.componentId],
445
- enableAppbase: state.config.enableAppbase
394
+ componentProps: state.props[props.componentId]
446
395
  };
447
396
  };
448
-
449
397
  var mapDispatchtoProps = {
450
398
  addComponent: addComponent,
451
399
  removeComponent: removeComponent,
@@ -457,13 +405,14 @@ var mapDispatchtoProps = {
457
405
  setCustomQuery: setCustomQuery,
458
406
  updateComponentProps: updateComponentProps
459
407
  };
460
- var RangeConnected = index.connect(mapStateToProps, mapDispatchtoProps)(DynamicRangeSlider);
461
-
462
- DynamicRangeSlider.install = function (Vue) {
463
- Vue.component(DynamicRangeSlider.name, RangeConnected);
464
- }; // Add componentType for SSR
465
-
408
+ var RangeConnected = PreferencesConsumer.PreferencesConsumer(index.connect(mapStateToProps, mapDispatchtoProps)(DynamicRangeSlider));
409
+ RangeConnected.name = DynamicRangeSlider.name;
410
+ RangeConnected.install = function (Vue) {
411
+ Vue.component(RangeConnected.name, RangeConnected);
412
+ };
466
413
 
467
- DynamicRangeSlider.componentType = constants.componentTypes.dynamicRangeSlider;
414
+ // Add componentType for SSR
415
+ RangeConnected.componentType = constants.componentTypes.dynamicRangeSlider;
468
416
 
469
- exports.default = DynamicRangeSlider;
417
+ exports.RangeConnected = RangeConnected;
418
+ exports.default = RangeConnected;
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
4
+ var vueEmotion = require('@appbaseio/vue-emotion');
5
+ var polished = require('polished');
6
+
7
+ var _templateObject;
8
+ var leftLabel = "\n\tflex-direction: row;\n\talign-items: center;\n";
9
+ var rightLabel = "\n\tflex-direction: row-reverse;\n\talign-items: center;\n";
10
+ var topLabel = "\n\tflex-direction: column;\n";
11
+ var bottomLabel = "\n\tflex-direction: column-reverse;\n";
12
+ var border = function border(_ref) {
13
+ var _ref$theme$colors = _ref.theme.colors,
14
+ colors = _ref$theme$colors === void 0 ? {} : _ref$theme$colors;
15
+ return "\n\tborder: 1px solid " + (colors.borderColor || '#ccc') + ";\n";
16
+ };
17
+ var Flex = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
18
+ return props.inline ? 'inline-flex' : 'flex';
19
+ }, function (props) {
20
+ return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
21
+ }, function (props) {
22
+ return (props.labelPosition === 'right' || props.iconPosition === 'left') && rightLabel;
23
+ }, function (props) {
24
+ return props.labelPosition === 'top' && topLabel;
25
+ }, function (props) {
26
+ return props.labelPosition === 'bottom' && bottomLabel;
27
+ }, function (props) {
28
+ return props.showBorder && border;
29
+ }, function (props) {
30
+ return props.justifyContent && "\n\t\t\tjustify-content: " + props.justifyContent + ";\n\t\t";
31
+ }, function (props) {
32
+ return props.alignItems && "\n\t\t\talign-items: " + props.alignItems + ";\n\t\t";
33
+ }, function (props) {
34
+ return props.flex && "\n\t\t\tflex: " + props.flex + ";\n\t\t";
35
+ }, function (props) {
36
+ return props.direction && "\n\t\t\tflex-direction: " + props.direction + ";\n\t\t";
37
+ }, function (props) {
38
+ return props.basis && "\n\t\t\tflex-basis: " + props.basis + ";\n\t\t";
39
+ }, function (_ref2) {
40
+ var _ref2$theme$colors = _ref2.theme.colors,
41
+ colors = _ref2$theme$colors === void 0 ? {} : _ref2$theme$colors;
42
+ return colors.borderColor || polished.lighten(0.3, colors.textColor || '#fff');
43
+ }, function (_ref3) {
44
+ var theme = _ref3.theme;
45
+ return theme.colors ? theme.colors.textColor : '';
46
+ });
47
+
48
+ exports.Flex = Flex;
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
4
+ var vueEmotion = require('@appbaseio/vue-emotion');
5
+ var polished = require('polished');
6
+
7
+ var _templateObject, _templateObject2, _templateObject3;
8
+ var item = {
9
+ width: '15px',
10
+ height: '15px',
11
+ scale: '4px'
12
+ };
13
+ var vh = "\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n";
14
+ var hideInputControl = "\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n";
15
+ var formItem = function formItem(_ref) {
16
+ var _ref$theme = _ref.theme,
17
+ theme = _ref$theme === void 0 ? {} : _ref$theme;
18
+ return "\n\t" + vh + ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px " + polished.lighten(0.4, theme.colors.primaryColor) + ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: " + theme.colors.primaryColor + ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid " + (theme.colors.borderColor || polished.lighten(0.1, theme.colors.textColor)) + ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: " + theme.colors.primaryColor + ";\n\t\t\tmargin-right: calc(" + item.width + " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: " + item.width + ";\n\t\t\theight: " + item.height + ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: " + theme.colors.primaryColor + ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + " + item.scale + " / 2);\n\t\t\twidth: calc(" + item.width + " - " + item.scale + ");\n\t\t\theight: calc(" + item.height + " - " + item.scale + ");\n\t\t\tmargin-top: calc(" + item.height + " / -2 - " + item.scale + " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n";
19
+ };
20
+ var Radio = vueEmotion.styled('input')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
21
+ return props.show ? null : hideInputControl;
22
+ }, function (_ref2) {
23
+ var theme = _ref2.theme;
24
+ return theme.colors.primaryColor;
25
+ }, function (_ref3) {
26
+ var theme = _ref3.theme;
27
+ return theme.colors.primaryColor;
28
+ });
29
+ var Checkbox = vueEmotion.styled('input')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
30
+ return props.show ? null : hideInputControl;
31
+ }, item.width, item.width, item.width, item.height, function (_ref4) {
32
+ var theme = _ref4.theme;
33
+ return theme.colors.primaryColor;
34
+ }, function (_ref5) {
35
+ var theme = _ref5.theme;
36
+ return theme.colors.primaryColor;
37
+ });
38
+ var UL = vueEmotion.styled('ul')(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight: 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
39
+
40
+ exports.Checkbox = Checkbox;
41
+ exports.Radio = Radio;
42
+ exports.UL = UL;
@@ -0,0 +1,74 @@
1
+ 'use strict';
2
+
3
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
4
+ var vueEmotion = require('@appbaseio/vue-emotion');
5
+ var emotion = require('emotion');
6
+
7
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
8
+ var alertBorder = function alertBorder(_ref) {
9
+ var theme = _ref.theme;
10
+ return "\n\tborder: 1px solid " + theme.colors.alertColor + ";\n";
11
+ };
12
+ var input = "\n\twidth: 100%;\n\tline-height: 1.5;\n\tmin-height: 42px;\n\tpadding: 8px 12px;\n\tborder: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 0.9rem;\n\toutline: none;\n\theight: 100%;\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n";
13
+ var dark = function dark(theme) {
14
+ return "\n\tborder-color: " + theme.colors.borderColor + ";\n";
15
+ };
16
+ var darkInput = function darkInput(_ref2) {
17
+ var theme = _ref2.theme;
18
+ return "\n\tbackground-color: " + theme.colors.backgroundColor + ";\n\tcolor: " + theme.colors.textColor + ";\n\t" + dark(theme) + ";\n\n\t&:focus {\n\t\tbackground-color: " + theme.colors.backgroundColor + ";\n\t}\n";
19
+ };
20
+ var Input = vueEmotion.styled('input')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n"])), input, function (_ref3) {
21
+ var themePreset = _ref3.themePreset,
22
+ theme = _ref3.theme;
23
+ return themePreset === 'dark' && darkInput({
24
+ theme: theme
25
+ });
26
+ }, function (props) {
27
+ return props.showIcon && props.iconPosition === 'left' && "\n\t\t\tpadding-left: 36px;\n\t\t";
28
+ }, function (props) {
29
+ return props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 36px;\n\t\t";
30
+ }, function (props) {
31
+ return (
32
+ // for clear icon
33
+ props.showClear && "\n\t\t\tpadding-right: 36px;\n\t\t"
34
+ );
35
+ }, function (props) {
36
+ return (
37
+ // for voice search icon
38
+ props.showVoiceSearch && "\n\t\t\tpadding-right: 36px;\n\t\t"
39
+ );
40
+ }, function (props) {
41
+ return (
42
+ // for clear icon with search icon
43
+ props.showClear && props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 66px;\n\t\t"
44
+ );
45
+ }, function (props) {
46
+ return (
47
+ // for voice search icon with search icon
48
+ props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 66px;\n\t\t"
49
+ );
50
+ }, function (props) {
51
+ return (
52
+ // for voice search icon with clear icon
53
+ props.showVoiceSearch && props.showIcon && "\n\t\t\tpadding-right: 66px;\n\t\t"
54
+ );
55
+ }, function (props) {
56
+ return (
57
+ // for clear icon with search icon and voice search
58
+ props.showClear && props.showIcon && props.showVoiceSearch && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 90px;\n\t\t"
59
+ );
60
+ }, function (props) {
61
+ return props.alert && alertBorder;
62
+ });
63
+ var suggestions = function suggestions(themePreset, theme) {
64
+ return emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 402px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: flex;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark(theme));
65
+ };
66
+ var suggestionsContainer = emotion.css(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
67
+ var noSuggestions = function noSuggestions(themePreset, theme) {
68
+ return emotion.css(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t", "\n"])), themePreset === 'dark' && theme && dark(theme));
69
+ };
70
+
71
+ exports.Input = Input;
72
+ exports.noSuggestions = noSuggestions;
73
+ exports.suggestions = suggestions;
74
+ exports.suggestionsContainer = suggestionsContainer;