@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
@@ -2,345 +2,51 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
-
7
- var configureStore = require('@appbaseio/reactivecore');
8
- var configureStore__default = _interopDefault(configureStore);
9
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
10
- var VueTypes = _interopDefault(require('vue-types'));
11
- var constants = require('@appbaseio/reactivecore/lib/utils/constants');
12
- var vueTypes = require('./vueTypes-727b7c63.js');
5
+ require('@appbaseio/reactivecore');
6
+ require('@appbaseio/reactivecore/lib/utils/constants');
7
+ require('@vue/babel-helper-vue-transform-on');
8
+ require('./_rollupPluginBabelHelpers-f8b843f8.js');
9
+ require('vue');
10
+ require('vue-types');
11
+ require('@appbaseio/reactivecore/lib/utils/helper');
12
+ require('@appbaseio/vue-emotion');
13
+ require('emotion');
14
+ require('polished');
15
+ require('./Button-ad042719.js');
16
+ require('./vueTypes-1bf00978.js');
17
+ require('./Pagination-b5ddc906.js');
18
+ require('./ReactiveList.js');
13
19
  require('@appbaseio/reactivecore/lib/utils/transform');
14
20
  require('redux');
15
- var index = require('./index-6a167fe0.js');
16
- var ComponentWrapper = require('./ComponentWrapper-ad3dad02.js');
17
-
18
- var _excluded = ["options"];
19
- var updateQuery = configureStore.Actions.updateQuery,
20
- setQueryOptions = configureStore.Actions.setQueryOptions,
21
- setCustomQuery = configureStore.Actions.setCustomQuery,
22
- setDefaultQuery = configureStore.Actions.setDefaultQuery;
23
- var parseHits = configureStore.helper.parseHits,
24
- isEqual = configureStore.helper.isEqual,
25
- getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
26
- getResultStats = configureStore.helper.getResultStats,
27
- extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
28
- getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
29
- var ReactiveComponent = {
30
- name: 'ReactiveComponent',
31
- props: {
32
- componentId: vueTypes.types.stringRequired,
33
- aggregationField: vueTypes.types.string,
34
- aggregationSize: VueTypes.number,
35
- size: VueTypes.number,
36
- defaultQuery: vueTypes.types.func,
37
- customQuery: vueTypes.types.func,
38
- filterLabel: vueTypes.types.string,
39
- react: vueTypes.types.react,
40
- showFilter: VueTypes.bool.def(true),
41
- URLParams: VueTypes.bool.def(false),
42
- distinctField: vueTypes.types.string,
43
- distinctFieldConfig: vueTypes.types.props,
44
- index: VueTypes.string,
45
- endpoint: vueTypes.types.endpointConfig
46
- },
47
- created: function created() {
48
- var _this = this;
49
-
50
- var props = this.$props;
51
- this.internalComponent = null;
52
- this.$defaultQuery = null; // Set custom query in store
53
-
54
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
55
- var customQuery = props.customQuery,
56
- componentId = props.componentId,
57
- filterLabel = props.filterLabel,
58
- showFilter = props.showFilter,
59
- URLParams = props.URLParams,
60
- distinctField = props.distinctField,
61
- distinctFieldConfig = props.distinctFieldConfig,
62
- index$1 = props.index;
63
-
64
- if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
65
- console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
66
- }
67
-
68
- if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
69
- console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
70
- }
71
-
72
- if (!this.enableAppbase && index$1) {
73
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
74
- }
75
-
76
- if (customQuery) {
77
- var calcCustomQuery = customQuery(this.selectedValue, props);
78
- var query = extractQueryFromCustomQuery(calcCustomQuery);
79
- var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
80
-
81
- if (customQueryOptions) {
82
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
83
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
84
-
85
- this.updateQuery({
86
- componentId: componentId,
87
- query: query,
88
- value: this.selectedValue || null,
89
- label: filterLabel,
90
- showFilter: showFilter,
91
- URLParams: URLParams
92
- });
93
- }
94
-
95
- this.setQuery = function (_ref) {
96
- var options = _ref.options,
97
- obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
98
-
99
- var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
100
-
101
- if (queryToBeSet && queryToBeSet.query) {
102
- queryToBeSet = queryToBeSet.query;
103
- }
104
-
105
- var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
106
- query: queryToBeSet
107
- });
108
-
109
- var rsAPIQuery = customQueryCalc; // handle stored queries
110
-
111
- if (queryToBeSet && queryToBeSet.id) {
112
- rsAPIQuery = queryToBeSet;
113
- } // Update customQuery field for RS API
114
-
115
-
116
- _this.setCustomQuery(props.componentId, rsAPIQuery);
117
-
118
- if (options) {
119
- _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
120
- }
121
-
122
- _this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
123
- query: customQueryCalc.query,
124
- componentId: props.componentId,
125
- label: props.filterLabel,
126
- showFilter: props.showFilter,
127
- URLParams: props.URLParams
128
- }));
129
- };
130
-
131
- if (props.defaultQuery) {
132
- this.internalComponent = props.componentId + "__internal";
133
- }
134
-
135
- if (this.internalComponent && this.$props.defaultQuery) {
136
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
137
- this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
138
-
139
- var _query = extractQueryFromCustomQuery(this.$defaultQuery);
140
-
141
- var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
142
-
143
- if (queryOptions) {
144
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
145
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
146
-
147
- this.updateQuery({
148
- componentId: this.internalComponent,
149
- query: _query
150
- });
151
- }
152
- },
153
- watch: {
154
- hits: function hits(newVal, oldVal) {
155
- if (!isEqual(newVal, oldVal)) {
156
- this.$emit('data', this.getData());
157
- }
158
- },
159
- rawData: function rawData(newVal, oldVal) {
160
- if (!isEqual(newVal, oldVal)) {
161
- this.$emit('data', this.getData());
162
- }
163
- },
164
- aggregations: function aggregations(newVal, oldVal) {
165
- if (!isEqual(newVal, oldVal)) {
166
- this.$emit('data', this.getData());
167
- }
168
- },
169
- aggregationData: function aggregationData(newVal, oldVal) {
170
- if (!isEqual(newVal, oldVal)) {
171
- this.$emit('data', this.getData());
172
- }
173
- },
174
- promotedResults: function promotedResults(newVal, oldVal) {
175
- if (!isEqual(newVal, oldVal)) {
176
- this.$emit('data', this.getData());
177
- }
178
- },
179
- hidden: function hidden(newVal, oldVal) {
180
- if (!isEqual(newVal, oldVal)) {
181
- this.$emit('data', this.getData());
182
- }
183
- },
184
- total: function total(newVal, oldVal) {
185
- if (!isEqual(newVal, oldVal)) {
186
- this.$emit('data', this.getData());
187
- }
188
- },
189
- time: function time(newVal, oldVal) {
190
- if (!isEqual(newVal, oldVal)) {
191
- this.$emit('data', this.getData());
192
- }
193
- },
194
- defaultQuery: function defaultQuery(newVal, oldVal) {
195
- if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
196
- this.$defaultQuery = newVal(this.selectedValue, this.$props);
197
- var query = extractQueryFromCustomQuery(this.$defaultQuery);
198
- var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
199
-
200
- if (queryOptions) {
201
- this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
202
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
203
-
204
-
205
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
206
- this.updateQuery({
207
- componentId: this.internalComponent,
208
- query: query
209
- });
210
- }
211
- },
212
- customQuery: function customQuery(newVal, oldVal) {
213
- if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
214
- var componentId = this.$props.componentId;
215
- this.$customQuery = newVal(this.selectedValue, this.$props);
216
- var query = extractQueryFromCustomQuery(this.$customQuery);
217
- var queryOptions = getOptionsForCustomQuery(this.$customQuery);
218
-
219
- if (queryOptions) {
220
- this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
221
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
222
-
223
-
224
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
225
- this.updateQuery({
226
- componentId: componentId,
227
- query: query
228
- });
229
- }
230
- }
231
- },
232
- render: function render() {
233
- var h = arguments[0];
234
-
235
- try {
236
- var dom = this.$scopedSlots["default"];
237
- var error = this.error,
238
- isLoading = this.isLoading,
239
- selectedValue = this.selectedValue;
240
-
241
- var propsToBePassed = _rollupPluginBabelHelpers._extends({
242
- error: error,
243
- loading: isLoading
244
- }, this.getData(), {
245
- value: selectedValue,
246
- setQuery: this.setQuery
247
- });
248
-
249
- return h("div", [dom(propsToBePassed)]);
250
- } catch (e) {
251
- return null;
252
- }
253
- },
254
- methods: {
255
- getAggsQuery: function getAggsQuery() {
256
- if (this.aggregationField) {
257
- return {
258
- aggs: getCompositeAggsQuery({
259
- props: this.$props,
260
- showTopHits: true,
261
- value: this.selectedValue
262
- }).aggs
263
- };
264
- }
265
-
266
- return {};
267
- },
268
- getData: function getData() {
269
- var hits = this.hits,
270
- aggregations = this.aggregations,
271
- aggregationData = this.aggregationData,
272
- promotedResults = this.promotedResults,
273
- rawData = this.rawData;
274
- var filteredResults = parseHits(hits);
275
-
276
- if (promotedResults.length) {
277
- var ids = promotedResults.map(function (item) {
278
- return item._id;
279
- }).filter(Boolean);
280
-
281
- if (ids) {
282
- filteredResults = filteredResults.filter(function (item) {
283
- return !ids.includes(item._id);
284
- });
285
- }
286
-
287
- filteredResults = [].concat(promotedResults, filteredResults);
288
- }
289
-
290
- return {
291
- data: filteredResults,
292
- aggregationData: aggregationData,
293
- rawData: rawData,
294
- aggregations: aggregations,
295
- promotedData: promotedResults,
296
- resultStats: this.stats
297
- };
298
- }
299
- },
300
- computed: {
301
- stats: function stats() {
302
- return getResultStats(this);
303
- }
304
- }
305
- };
306
-
307
- ReactiveComponent.hasInternalComponent = function (props) {
308
- return !!props.defaultQuery;
309
- };
310
-
311
- var mapStateToProps = function mapStateToProps(state, props) {
312
- return {
313
- aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
314
- aggregationData: state.compositeAggregations[props.componentId] || [],
315
- hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
316
- rawData: state.rawData[props.componentId],
317
- error: state.error[props.componentId],
318
- isLoading: state.isLoading[props.componentId],
319
- selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
320
- promotedResults: state.promotedResults[props.componentId] || [],
321
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
322
- total: state.hits[props.componentId] && state.hits[props.componentId].total,
323
- hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
324
- componentProps: state.props[props.componentId],
325
- enableAppbase: state.config.enableAppbase
326
- };
327
- };
328
-
329
- var mapDispatchtoProps = {
330
- setQueryOptions: setQueryOptions,
331
- updateQuery: updateQuery,
332
- setCustomQuery: setCustomQuery,
333
- setDefaultQuery: setDefaultQuery
334
- };
335
- var RcConnected = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchtoProps)(ReactiveComponent), {
336
- componentType: constants.componentTypes.reactiveComponent
337
- });
338
-
339
- ReactiveComponent.install = function (Vue) {
340
- Vue.component(ReactiveComponent.name, RcConnected);
341
- }; // Add componentType for SSR
342
-
343
-
344
- ReactiveComponent.componentType = constants.componentTypes.reactiveComponent;
345
-
346
- exports.default = ReactiveComponent;
21
+ require('./index-d8d8f291.js');
22
+ require('./ComponentWrapper-611cf7f9.js');
23
+ require('./PreferencesConsumer-22d1b49f.js');
24
+ require('./Title-8802a218.js');
25
+ require('./ListItem-d57d648d.js');
26
+ require('./Card-f5ab024a.js');
27
+ require('./Flex-d5675ea6.js');
28
+ require('hotkeys-js');
29
+ var ReactiveComponent = require('./ReactiveComponent-a6108189.js');
30
+ require('./DropDown-dc184468.js');
31
+ require('./Input-088dfcb4.js');
32
+ require('compute-scroll-into-view');
33
+ require('./Container-29f049b2.js');
34
+ require('vue-highlight-words');
35
+ require('@appbaseio/reactivecore/lib/utils/suggestions');
36
+ require('./FormControlList-fadd792f.js');
37
+ require('./utils-83fd01e9.js');
38
+ require('./SingleList.js');
39
+ require('./MultiList.js');
40
+ require('./SingleDropdownList.js');
41
+ require('./MultiDropdownList.js');
42
+ require('./ToggleButton.js');
43
+ require('./ssr-6c8a72e1.js');
44
+ require('./DynamicRangeSlider.js');
45
+ require('./SingleRange.js');
46
+ require('./MultiRange.js');
47
+ require('./RangeSlider.js');
48
+ require('./RangeInput.js');
49
+
50
+
51
+
52
+ exports.default = ReactiveComponent.ReactiveComponent;