@appbaseio/reactivesearch-vue 2.0.0-alpha.4 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +17538 -25422
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -15
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-ad042719.js +59 -0
  6. package/dist/cjs/Card-f5ab024a.js +27 -0
  7. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-75f88599.js} +42 -56
  8. package/dist/cjs/Container-29f049b2.js +12 -0
  9. package/dist/cjs/DropDown-6cf84c47.js +698 -0
  10. package/dist/cjs/DynamicRangeSlider.js +103 -155
  11. package/dist/cjs/Flex-d5675ea6.js +48 -0
  12. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  13. package/dist/cjs/Input-4b434436.js +74 -0
  14. package/dist/cjs/ListItem-d57d648d.js +42 -0
  15. package/dist/cjs/MultiDropdownList.js +124 -240
  16. package/dist/cjs/MultiList.js +123 -261
  17. package/dist/cjs/MultiRange.js +87 -133
  18. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  19. package/dist/cjs/PreferencesConsumer-eb265924.js +75 -0
  20. package/dist/cjs/RangeInput.js +163 -171
  21. package/dist/cjs/RangeSlider.js +81 -109
  22. package/dist/cjs/ReactiveBase.js +139 -157
  23. package/dist/cjs/ReactiveComponent-eb8db4c1.js +2189 -0
  24. package/dist/cjs/ReactiveComponent.js +46 -340
  25. package/dist/cjs/ReactiveGoogleMap.js +445 -655
  26. package/dist/cjs/ReactiveList.js +179 -304
  27. package/dist/cjs/ResultCard.js +36 -36
  28. package/dist/cjs/ResultList.js +48 -56
  29. package/dist/cjs/SelectedFilters.js +62 -69
  30. package/dist/cjs/SingleDropdownList.js +117 -177
  31. package/dist/cjs/SingleList.js +121 -205
  32. package/dist/cjs/SingleRange.js +78 -105
  33. package/dist/cjs/StateProvider.js +35 -38
  34. package/dist/cjs/Title-8802a218.js +12 -0
  35. package/dist/cjs/ToggleButton.js +72 -119
  36. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  37. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  38. package/dist/cjs/index.js +44 -41
  39. package/dist/cjs/initReactivesearch.js +63 -150
  40. package/dist/cjs/install.js +47 -43
  41. package/dist/cjs/ssr-6907ada3.js +66 -0
  42. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  45. package/dist/es/Button-474510e3.js +53 -0
  46. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  47. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-5166c76a.js} +42 -56
  48. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  49. package/dist/es/DropDown-8764360c.js +688 -0
  50. package/dist/es/DynamicRangeSlider.js +103 -155
  51. package/dist/es/Flex-a08e22d7.js +46 -0
  52. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  53. package/dist/es/Input-4a8ef1f3.js +69 -0
  54. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  55. package/dist/es/MultiDropdownList.js +124 -240
  56. package/dist/es/MultiList.js +123 -261
  57. package/dist/es/MultiRange.js +87 -133
  58. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  59. package/dist/es/PreferencesConsumer-c276709c.js +73 -0
  60. package/dist/es/RangeInput.js +163 -170
  61. package/dist/es/RangeSlider.js +81 -109
  62. package/dist/es/ReactiveBase.js +138 -155
  63. package/dist/es/ReactiveComponent-f9fa5780.js +2183 -0
  64. package/dist/es/ReactiveComponent.js +42 -337
  65. package/dist/es/ReactiveGoogleMap.js +440 -649
  66. package/dist/es/ReactiveList.js +177 -301
  67. package/dist/es/ResultCard.js +36 -36
  68. package/dist/es/ResultList.js +48 -56
  69. package/dist/es/SelectedFilters.js +62 -69
  70. package/dist/es/SingleDropdownList.js +117 -177
  71. package/dist/es/SingleList.js +121 -205
  72. package/dist/es/SingleRange.js +78 -105
  73. package/dist/es/StateProvider.js +36 -39
  74. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  75. package/dist/es/ToggleButton.js +72 -119
  76. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  77. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  78. package/dist/es/index.js +30 -32
  79. package/dist/es/initReactivesearch.js +63 -150
  80. package/dist/es/install.js +49 -41
  81. package/dist/es/{ssr-b2c0b401.js → ssr-af398f0c.js} +36 -7
  82. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  85. package/package.json +10 -9
  86. package/dist/cjs/Button-446f819e.js +0 -68
  87. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  88. package/dist/cjs/Card-642547a8.js +0 -30
  89. package/dist/cjs/Container-daf30918.js +0 -15
  90. package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
  91. package/dist/cjs/DataSearch.js +0 -30
  92. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  93. package/dist/cjs/Flex-aa517a13.js +0 -52
  94. package/dist/cjs/FormControlList-c195a592.js +0 -47
  95. package/dist/cjs/Input-e6603a7e.js +0 -79
  96. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  97. package/dist/cjs/Title-1de7d0f4.js +0 -15
  98. package/dist/cjs/install-b97dbac4.js +0 -1409
  99. package/dist/cjs/ssr-3027b848.js +0 -39
  100. package/dist/es/Button-d8bc15ea.js +0 -59
  101. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  102. package/dist/es/DataSearch-b86a6675.js +0 -2337
  103. package/dist/es/DataSearch.js +0 -22
  104. package/dist/es/DropDown-05a644a5.js +0 -322
  105. package/dist/es/Flex-1f0795c3.js +0 -47
  106. package/dist/es/FormControlList-c22d64f6.js +0 -40
  107. package/dist/es/Input-7a2a9fac.js +0 -71
  108. package/dist/es/install-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-5166c76a.js';
19
+ import './PreferencesConsumer-c276709c.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-f9fa5780.js';
26
+ import './DropDown-8764360c.js';
27
+ import './Input-4a8ef1f3.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-af398f0c.js';
40
+ import './DynamicRangeSlider.js';
41
+ import './SingleRange.js';
42
+ import './MultiRange.js';
43
+ import './RangeSlider.js';
44
+ import './RangeInput.js';