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