@appbaseio/reactivesearch-vue 1.16.0-alpha.38 → 1.16.0-alpha.40

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.
@@ -77,7 +77,7 @@ var MultiDropdownList = {
77
77
  selectAllLabel: vueTypes.types.string,
78
78
  showCount: VueTypes.bool.def(true),
79
79
  showFilter: VueTypes.bool.def(true),
80
- size: VueTypes.number.def(100),
80
+ size: VueTypes.number,
81
81
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
82
82
  title: vueTypes.types.title,
83
83
  URLParams: VueTypes.bool.def(false),
@@ -469,7 +469,13 @@ var MultiDropdownList = {
469
469
 
470
470
  MultiDropdownList.defaultQuery = function (value, props) {
471
471
  var query = null;
472
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
472
+ var queryFormat = props.queryFormat;
473
+
474
+ if (queryFormat === undefined) {
475
+ queryFormat = 'or';
476
+ }
477
+
478
+ var type = queryFormat === 'or' ? 'terms' : 'term';
473
479
 
474
480
  if (!Array.isArray(value) || value.length === 0) {
475
481
  return null;
@@ -490,7 +496,7 @@ MultiDropdownList.defaultQuery = function (value, props) {
490
496
  } else if (value) {
491
497
  var listQuery;
492
498
 
493
- if (props.queryFormat === 'or') {
499
+ if (queryFormat === 'or') {
494
500
  if (props.showMissing) {
495
501
  var _type, _ref;
496
502
 
@@ -60,7 +60,7 @@ var MultiList = {
60
60
  showCount: VueTypes.bool.def(true),
61
61
  showFilter: VueTypes.bool.def(true),
62
62
  showSearch: VueTypes.bool.def(true),
63
- size: VueTypes.number.def(100),
63
+ size: VueTypes.number,
64
64
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
65
65
  title: vueTypes.types.title,
66
66
  URLParams: VueTypes.bool.def(false),
@@ -489,7 +489,13 @@ var MultiList = {
489
489
 
490
490
  MultiList.defaultQuery = function (value, props) {
491
491
  var query = null;
492
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
492
+ var queryFormat = props.queryFormat;
493
+
494
+ if (queryFormat === undefined) {
495
+ queryFormat = 'or';
496
+ }
497
+
498
+ var type = queryFormat === 'or' ? 'terms' : 'term';
493
499
 
494
500
  if (!Array.isArray(value) || value.length === 0) {
495
501
  return null;
@@ -510,7 +516,7 @@ MultiList.defaultQuery = function (value, props) {
510
516
  } else if (value) {
511
517
  var listQuery;
512
518
 
513
- if (props.queryFormat === 'or') {
519
+ if (queryFormat === 'or') {
514
520
  if (props.showMissing) {
515
521
  var _type, _ref;
516
522
 
@@ -32,7 +32,7 @@ var ReactiveComponent = {
32
32
  componentId: vueTypes.types.stringRequired,
33
33
  aggregationField: vueTypes.types.string,
34
34
  aggregationSize: VueTypes.number,
35
- size: VueTypes.number.def(20),
35
+ size: VueTypes.number,
36
36
  defaultQuery: vueTypes.types.func,
37
37
  customQuery: vueTypes.types.func,
38
38
  filterLabel: vueTypes.types.string,
@@ -76,7 +76,7 @@ var SingleDropdownList = {
76
76
  selectAllLabel: vueTypes.types.string,
77
77
  showCount: VueTypes.bool.def(true),
78
78
  showFilter: VueTypes.bool.def(true),
79
- size: VueTypes.number.def(100),
79
+ size: VueTypes.number,
80
80
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
81
81
  title: vueTypes.types.title,
82
82
  URLParams: VueTypes.bool.def(false),
@@ -19,7 +19,8 @@ var fetchGraphQL = _interopDefault(require('@appbaseio/reactivecore/lib/utils/gr
19
19
  var utils = require('@appbaseio/reactivecore/lib/actions/utils');
20
20
 
21
21
  var _excluded = ["aggs", "size"],
22
- _excluded2 = ["query"];
22
+ _excluded2 = ["query"],
23
+ _excluded3 = ["aggs", "size"];
23
24
  var X_SEARCH_CLIENT = 'ReactiveSearch Vue';
24
25
  var componentsWithoutFilters = [constants.componentTypes.numberBox, constants.componentTypes.ratingsFilter];
25
26
  var resultComponents = [constants.componentTypes.reactiveList, constants.componentTypes.reactiveMap];
@@ -181,6 +182,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
181
182
  componentQueryOptions = _rollupPluginBabelHelpers._extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
182
183
  }
183
184
 
185
+ console.log('QUERY LOG componentQueryOptions', component.componentId, componentQueryOptions);
184
186
  var highlightQuery = {};
185
187
 
186
188
  if (component.source.highlightQuery) {
@@ -304,9 +306,23 @@ function initReactivesearch(componentCollection, searchState, settings) {
304
306
  queryObj = _buildQuery.queryObj,
305
307
  options = _buildQuery.options;
306
308
 
307
- var validOptions = ['aggs', 'from', 'sort']; // check if query or options are valid - non-empty
309
+ var componentQueryOptions = options;
310
+ var componentType = component.source.componentType;
311
+ console.log('COMPONENT TYPE', componentType);
312
+
313
+ if (componentType !== constants.componentTypes.reactiveComponent) {
314
+ // don't merge aggs, size
315
+ var _ref3 = options || {},
316
+ aggs = _ref3.aggs,
317
+ size = _ref3.size,
318
+ rest = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref3, _excluded3);
319
+
320
+ componentQueryOptions = rest;
321
+ }
322
+
323
+ var validOptions = ['aggs', 'from', 'sort']; // check if query or componentQueryOptions are valid - non-empty
308
324
 
309
- if (queryObj && !!Object.keys(queryObj).length || options && Object.keys(options).some(function (item) {
325
+ if (queryObj && !!Object.keys(queryObj).length || componentQueryOptions && Object.keys(componentQueryOptions).some(function (item) {
310
326
  return validOptions.includes(item);
311
327
  })) {
312
328
  var _extends2;
@@ -321,8 +337,12 @@ function initReactivesearch(componentCollection, searchState, settings) {
321
337
 
322
338
  var currentQuery = _rollupPluginBabelHelpers._extends({
323
339
  query: _rollupPluginBabelHelpers._extends({}, queryObj)
324
- }, options, queryOptions[component.componentId]);
340
+ }, componentQueryOptions, queryOptions[component.componentId]);
325
341
 
342
+ console.log('QUERY LOG build QUERY', component.componentId, queryObj);
343
+ console.log('QUERY LOG build OPTIONS', component.componentId, componentQueryOptions);
344
+ console.log('QUERY LOG OPTIONS (component)', component.componentId, queryOptions[component.componentId]);
345
+ console.log('QUERY LOG', component.componentId, currentQuery);
326
346
  queryLog = _rollupPluginBabelHelpers._extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
327
347
 
328
348
  if (settings.enableAppbase) {
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "1.16.0-alpha.38";
5
+ var version = "1.16.0-alpha.40";
6
6
 
7
7
  exports.default = version;
@@ -70,7 +70,7 @@ var MultiDropdownList = {
70
70
  selectAllLabel: types.string,
71
71
  showCount: VueTypes.bool.def(true),
72
72
  showFilter: VueTypes.bool.def(true),
73
- size: VueTypes.number.def(100),
73
+ size: VueTypes.number,
74
74
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
75
75
  title: types.title,
76
76
  URLParams: VueTypes.bool.def(false),
@@ -462,7 +462,13 @@ var MultiDropdownList = {
462
462
 
463
463
  MultiDropdownList.defaultQuery = function (value, props) {
464
464
  var query = null;
465
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
465
+ var queryFormat = props.queryFormat;
466
+
467
+ if (queryFormat === undefined) {
468
+ queryFormat = 'or';
469
+ }
470
+
471
+ var type = queryFormat === 'or' ? 'terms' : 'term';
466
472
 
467
473
  if (!Array.isArray(value) || value.length === 0) {
468
474
  return null;
@@ -483,7 +489,7 @@ MultiDropdownList.defaultQuery = function (value, props) {
483
489
  } else if (value) {
484
490
  var listQuery;
485
491
 
486
- if (props.queryFormat === 'or') {
492
+ if (queryFormat === 'or') {
487
493
  if (props.showMissing) {
488
494
  var _type, _ref;
489
495
 
@@ -53,7 +53,7 @@ var MultiList = {
53
53
  showCount: VueTypes.bool.def(true),
54
54
  showFilter: VueTypes.bool.def(true),
55
55
  showSearch: VueTypes.bool.def(true),
56
- size: VueTypes.number.def(100),
56
+ size: VueTypes.number,
57
57
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
58
58
  title: types.title,
59
59
  URLParams: VueTypes.bool.def(false),
@@ -482,7 +482,13 @@ var MultiList = {
482
482
 
483
483
  MultiList.defaultQuery = function (value, props) {
484
484
  var query = null;
485
- var type = props.queryFormat === 'or' ? 'terms' : 'term';
485
+ var queryFormat = props.queryFormat;
486
+
487
+ if (queryFormat === undefined) {
488
+ queryFormat = 'or';
489
+ }
490
+
491
+ var type = queryFormat === 'or' ? 'terms' : 'term';
486
492
 
487
493
  if (!Array.isArray(value) || value.length === 0) {
488
494
  return null;
@@ -503,7 +509,7 @@ MultiList.defaultQuery = function (value, props) {
503
509
  } else if (value) {
504
510
  var listQuery;
505
511
 
506
- if (props.queryFormat === 'or') {
512
+ if (queryFormat === 'or') {
507
513
  if (props.showMissing) {
508
514
  var _type, _ref;
509
515
 
@@ -25,7 +25,7 @@ var ReactiveComponent = {
25
25
  componentId: types.stringRequired,
26
26
  aggregationField: types.string,
27
27
  aggregationSize: VueTypes.number,
28
- size: VueTypes.number.def(20),
28
+ size: VueTypes.number,
29
29
  defaultQuery: types.func,
30
30
  customQuery: types.func,
31
31
  filterLabel: types.string,
@@ -69,7 +69,7 @@ var SingleDropdownList = {
69
69
  selectAllLabel: types.string,
70
70
  showCount: VueTypes.bool.def(true),
71
71
  showFilter: VueTypes.bool.def(true),
72
- size: VueTypes.number.def(100),
72
+ size: VueTypes.number,
73
73
  sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
74
74
  title: types.title,
75
75
  URLParams: VueTypes.bool.def(false),
@@ -13,7 +13,8 @@ import fetchGraphQL from '@appbaseio/reactivecore/lib/utils/graphQL';
13
13
  import { isPropertyDefined } from '@appbaseio/reactivecore/lib/actions/utils';
14
14
 
15
15
  var _excluded = ["aggs", "size"],
16
- _excluded2 = ["query"];
16
+ _excluded2 = ["query"],
17
+ _excluded3 = ["aggs", "size"];
17
18
  var X_SEARCH_CLIENT = 'ReactiveSearch Vue';
18
19
  var componentsWithoutFilters = [componentTypes.numberBox, componentTypes.ratingsFilter];
19
20
  var resultComponents = [componentTypes.reactiveList, componentTypes.reactiveMap];
@@ -175,6 +176,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
175
176
  componentQueryOptions = _extends({}, componentQueryOptions, component.source.generateQueryOptions(component));
176
177
  }
177
178
 
179
+ console.log('QUERY LOG componentQueryOptions', component.componentId, componentQueryOptions);
178
180
  var highlightQuery = {};
179
181
 
180
182
  if (component.source.highlightQuery) {
@@ -298,9 +300,23 @@ function initReactivesearch(componentCollection, searchState, settings) {
298
300
  queryObj = _buildQuery.queryObj,
299
301
  options = _buildQuery.options;
300
302
 
301
- var validOptions = ['aggs', 'from', 'sort']; // check if query or options are valid - non-empty
303
+ var componentQueryOptions = options;
304
+ var componentType = component.source.componentType;
305
+ console.log('COMPONENT TYPE', componentType);
306
+
307
+ if (componentType !== componentTypes.reactiveComponent) {
308
+ // don't merge aggs, size
309
+ var _ref3 = options || {},
310
+ aggs = _ref3.aggs,
311
+ size = _ref3.size,
312
+ rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
313
+
314
+ componentQueryOptions = rest;
315
+ }
316
+
317
+ var validOptions = ['aggs', 'from', 'sort']; // check if query or componentQueryOptions are valid - non-empty
302
318
 
303
- if (queryObj && !!Object.keys(queryObj).length || options && Object.keys(options).some(function (item) {
319
+ if (queryObj && !!Object.keys(queryObj).length || componentQueryOptions && Object.keys(componentQueryOptions).some(function (item) {
304
320
  return validOptions.includes(item);
305
321
  })) {
306
322
  var _extends2;
@@ -315,8 +331,12 @@ function initReactivesearch(componentCollection, searchState, settings) {
315
331
 
316
332
  var currentQuery = _extends({
317
333
  query: _extends({}, queryObj)
318
- }, options, queryOptions[component.componentId]);
334
+ }, componentQueryOptions, queryOptions[component.componentId]);
319
335
 
336
+ console.log('QUERY LOG build QUERY', component.componentId, queryObj);
337
+ console.log('QUERY LOG build OPTIONS', component.componentId, componentQueryOptions);
338
+ console.log('QUERY LOG OPTIONS (component)', component.componentId, queryOptions[component.componentId]);
339
+ console.log('QUERY LOG', component.componentId, currentQuery);
320
340
  queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
321
341
 
322
342
  if (settings.enableAppbase) {
@@ -1,3 +1,3 @@
1
- var version = "1.16.0-alpha.38";
1
+ var version = "1.16.0-alpha.40";
2
2
 
3
3
  export default version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appbaseio/reactivesearch-vue",
3
- "version": "1.16.0-alpha.38",
3
+ "version": "1.16.0-alpha.40",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "jsnext:main": "dist/es/index.js",