@appbaseio/reactivesearch-vue 1.23.4-alpha → 1.24.3-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.
@@ -183,14 +183,14 @@ var DynamicRangeSlider = {
183
183
  aggs: aggs
184
184
  });
185
185
  },
186
- handleSlider: function handleSlider(values) {
187
- this.handleChange(values.currentValue);
186
+ handleSlider: function handleSlider(value) {
187
+ this.handleChange(value);
188
188
  },
189
189
  handleChange: function handleChange(currentValue) {
190
190
  var _this2 = this;
191
191
 
192
192
  // Always keep the values within range
193
- var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
193
+ var normalizedValue = [this.range ? Math.max(this.range.start, currentValue == null ? void 0 : currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue == null ? void 0 : currentValue[1]) : currentValue[1]];
194
194
 
195
195
  var performUpdate = function performUpdate() {
196
196
  _this2.currentValue = normalizedValue;
@@ -326,7 +326,7 @@ var DynamicRangeSlider = {
326
326
  "enable-cross": false
327
327
  },
328
328
  "on": {
329
- "drag-end": this.handleSlider
329
+ "change": this.handleSlider
330
330
  },
331
331
  "props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
332
332
  }), this.labels ? h("div", {
@@ -218,10 +218,10 @@ var RangeSlider = {
218
218
  "height": 4,
219
219
  "enable-cross": false
220
220
  },
221
- "props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions),
222
- "on": _rollupPluginBabelHelpers._extends({}, {
223
- input: this.handleSlider
224
- })
221
+ "on": {
222
+ "change": this.handleSlider
223
+ },
224
+ "props": _rollupPluginBabelHelpers._extends({}, this.$props.sliderOptions)
225
225
  }), this.$props.rangeLabels && h("div", {
226
226
  "class": "label-container"
227
227
  }, [h("label", {
@@ -52,7 +52,7 @@ var ReactiveComponent = {
52
52
  this.internalComponent = null;
53
53
  this.$defaultQuery = null; // Set custom query in store
54
54
 
55
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
55
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
56
56
  var customQuery = props.customQuery,
57
57
  componentId = props.componentId,
58
58
  filterLabel = props.filterLabel,
@@ -75,7 +75,7 @@ var ReactiveComponent = {
75
75
  }
76
76
 
77
77
  if (customQuery) {
78
- var calcCustomQuery = customQuery(props);
78
+ var calcCustomQuery = customQuery(this.selectedValue, props);
79
79
 
80
80
  var _ref = calcCustomQuery || {},
81
81
  query = _ref.query;
@@ -94,7 +94,7 @@ var ReactiveComponent = {
94
94
 
95
95
  this.updateQuery({
96
96
  componentId: componentId,
97
- queryToSet: queryToSet,
97
+ query: queryToSet,
98
98
  value: this.selectedValue || null,
99
99
  label: filterLabel,
100
100
  showFilter: showFilter,
@@ -145,8 +145,8 @@ var ReactiveComponent = {
145
145
  },
146
146
  beforeMount: function beforeMount() {
147
147
  if (this.internalComponent && this.$props.defaultQuery) {
148
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
149
- this.$defaultQuery = this.$props.defaultQuery();
148
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
149
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
150
150
 
151
151
  var _ref3 = this.$defaultQuery || {},
152
152
  query = _ref3.query,
@@ -210,8 +210,8 @@ var ReactiveComponent = {
210
210
  }
211
211
  },
212
212
  defaultQuery: function defaultQuery(newVal, oldVal) {
213
- if (newVal && !index.isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
214
- this.$defaultQuery = newVal();
213
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
214
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
215
215
 
216
216
  var _ref4 = this.$defaultQuery || {},
217
217
  query = _ref4.query,
@@ -222,7 +222,7 @@ var ReactiveComponent = {
222
222
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
223
223
 
224
224
 
225
- index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
225
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
226
226
  var queryToSet = query || null;
227
227
 
228
228
  if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
@@ -236,9 +236,9 @@ var ReactiveComponent = {
236
236
  }
237
237
  },
238
238
  customQuery: function customQuery(newVal, oldVal) {
239
- if (newVal && !index.isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
239
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
240
240
  var componentId = this.$props.componentId;
241
- this.$customQuery = newVal(this.$props);
241
+ this.$customQuery = newVal(this.selectedValue, this.$props);
242
242
 
243
243
  var _ref5 = this.$customQuery || {},
244
244
  query = _ref5.query,
@@ -249,7 +249,7 @@ var ReactiveComponent = {
249
249
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
250
250
 
251
251
 
252
- index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
252
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
253
253
  var queryToSet = query || null;
254
254
 
255
255
  if (this.$customQuery && this.$customQuery.id) {
@@ -980,6 +980,11 @@ var ReactiveList = {
980
980
  renderNoResult: function renderNoResult() {
981
981
  var h = this.$createElement;
982
982
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
983
+
984
+ if (this.$scopedSlots.renderNoResults) {
985
+ return index.isFunction(renderNoResults) ? renderNoResults() : renderNoResults;
986
+ }
987
+
983
988
  return h("p", {
984
989
  "class": getClassName$1(this.$props.innerClass, 'noResults') || null
985
990
  }, [index.isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
@@ -122,16 +122,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
122
122
  compProps[key] = component[key];
123
123
  }
124
124
  });
125
- var isInternalComponentPresent = false; // Set custom and default queries
126
-
127
- if (component.customQuery && typeof component.customQuery === 'function') {
128
- customQueries[component.componentId] = component.customQuery(component.value, compProps);
129
- }
130
-
131
- if (component.defaultQuery && typeof component.defaultQuery === 'function') {
132
- defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
133
- }
134
-
125
+ var isInternalComponentPresent = false;
135
126
  var isResultComponent = resultComponents.includes(componentType);
136
127
  var internalComponent = component.componentId + "__internal";
137
128
  var label = component.filterLabel || component.componentId;
@@ -155,7 +146,25 @@ function initReactivesearch(componentCollection, searchState, settings) {
155
146
  reference: reference,
156
147
  showFilter: showFilter,
157
148
  URLParams: component.URLParams || false
158
- }); // [2] set query options - main component query (valid for result components)
149
+ }); // Set custom and default queries
150
+
151
+ if (component.customQuery && typeof component.customQuery === 'function') {
152
+ customQueries[component.componentId] = component.customQuery(component.value || selectedValues[component.componentId].value, compProps);
153
+ }
154
+
155
+ if (component.defaultQuery && typeof component.defaultQuery === 'function') {
156
+ defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
157
+ } // Set custom and default queries
158
+
159
+
160
+ if (component.customQuery && typeof component.customQuery === 'function') {
161
+ customQueries[component.componentId] = component.customQuery(value, compProps);
162
+ }
163
+
164
+ if (component.defaultQuery && typeof component.defaultQuery === 'function') {
165
+ defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
166
+ } // [2] set query options - main component query (valid for result components)
167
+
159
168
 
160
169
  if (componentsWithOptions.includes(componentType)) {
161
170
  var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
@@ -242,7 +251,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
242
251
 
243
252
 
244
253
  if (isResultComponent) {
245
- var _getQuery = getQuery(component, null, componentType),
254
+ var _getQuery = getQuery(component, value, componentType),
246
255
  query = _getQuery.query;
247
256
 
248
257
  queryList = queryReducer(queryList, {
@@ -451,6 +460,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
451
460
  rsAPISettings.customEvents = utils.isPropertyDefined(config.analyticsConfig.customEvents) ? config.analyticsConfig.customEvents : undefined;
452
461
  }
453
462
 
463
+ console.log('finalQuery', finalQuery);
454
464
  appbaseRef.reactiveSearchv3(finalQuery, rsAPISettings).then(function (res) {
455
465
  handleRSResponse(res);
456
466
  })["catch"](function (err) {
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "1.23.4-alpha";
5
+ var version = "1.24.3-alpha.1";
6
6
 
7
7
  exports.default = version;
@@ -176,14 +176,14 @@ var DynamicRangeSlider = {
176
176
  aggs: aggs
177
177
  });
178
178
  },
179
- handleSlider: function handleSlider(values) {
180
- this.handleChange(values.currentValue);
179
+ handleSlider: function handleSlider(value) {
180
+ this.handleChange(value);
181
181
  },
182
182
  handleChange: function handleChange(currentValue) {
183
183
  var _this2 = this;
184
184
 
185
185
  // Always keep the values within range
186
- var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
186
+ var normalizedValue = [this.range ? Math.max(this.range.start, currentValue == null ? void 0 : currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue == null ? void 0 : currentValue[1]) : currentValue[1]];
187
187
 
188
188
  var performUpdate = function performUpdate() {
189
189
  _this2.currentValue = normalizedValue;
@@ -319,7 +319,7 @@ var DynamicRangeSlider = {
319
319
  "enable-cross": false
320
320
  },
321
321
  "on": {
322
- "drag-end": this.handleSlider
322
+ "change": this.handleSlider
323
323
  },
324
324
  "props": _extends({}, this.$props.sliderOptions)
325
325
  }), this.labels ? h("div", {
@@ -211,10 +211,10 @@ var RangeSlider = {
211
211
  "height": 4,
212
212
  "enable-cross": false
213
213
  },
214
- "props": _extends({}, this.$props.sliderOptions),
215
- "on": _extends({}, {
216
- input: this.handleSlider
217
- })
214
+ "on": {
215
+ "change": this.handleSlider
216
+ },
217
+ "props": _extends({}, this.$props.sliderOptions)
218
218
  }), this.$props.rangeLabels && h("div", {
219
219
  "class": "label-container"
220
220
  }, [h("label", {
@@ -45,7 +45,7 @@ var ReactiveComponent = {
45
45
  this.internalComponent = null;
46
46
  this.$defaultQuery = null; // Set custom query in store
47
47
 
48
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
48
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
49
49
  var customQuery = props.customQuery,
50
50
  componentId = props.componentId,
51
51
  filterLabel = props.filterLabel,
@@ -68,7 +68,7 @@ var ReactiveComponent = {
68
68
  }
69
69
 
70
70
  if (customQuery) {
71
- var calcCustomQuery = customQuery(props);
71
+ var calcCustomQuery = customQuery(this.selectedValue, props);
72
72
 
73
73
  var _ref = calcCustomQuery || {},
74
74
  query = _ref.query;
@@ -87,7 +87,7 @@ var ReactiveComponent = {
87
87
 
88
88
  this.updateQuery({
89
89
  componentId: componentId,
90
- queryToSet: queryToSet,
90
+ query: queryToSet,
91
91
  value: this.selectedValue || null,
92
92
  label: filterLabel,
93
93
  showFilter: showFilter,
@@ -138,8 +138,8 @@ var ReactiveComponent = {
138
138
  },
139
139
  beforeMount: function beforeMount() {
140
140
  if (this.internalComponent && this.$props.defaultQuery) {
141
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
142
- this.$defaultQuery = this.$props.defaultQuery();
141
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
142
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
143
143
 
144
144
  var _ref3 = this.$defaultQuery || {},
145
145
  query = _ref3.query,
@@ -203,8 +203,8 @@ var ReactiveComponent = {
203
203
  }
204
204
  },
205
205
  defaultQuery: function defaultQuery(newVal, oldVal) {
206
- if (newVal && !isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
207
- this.$defaultQuery = newVal();
206
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
207
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
208
208
 
209
209
  var _ref4 = this.$defaultQuery || {},
210
210
  query = _ref4.query,
@@ -215,7 +215,7 @@ var ReactiveComponent = {
215
215
  } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
216
216
 
217
217
 
218
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, undefined);
218
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
219
219
  var queryToSet = query || null;
220
220
 
221
221
  if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
@@ -229,9 +229,9 @@ var ReactiveComponent = {
229
229
  }
230
230
  },
231
231
  customQuery: function customQuery(newVal, oldVal) {
232
- if (newVal && !isQueryIdentical(newVal, oldVal, undefined, this.$props)) {
232
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
233
233
  var componentId = this.$props.componentId;
234
- this.$customQuery = newVal(this.$props);
234
+ this.$customQuery = newVal(this.selectedValue, this.$props);
235
235
 
236
236
  var _ref5 = this.$customQuery || {},
237
237
  query = _ref5.query,
@@ -242,7 +242,7 @@ var ReactiveComponent = {
242
242
  } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
243
243
 
244
244
 
245
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, undefined);
245
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
246
246
  var queryToSet = query || null;
247
247
 
248
248
  if (this.$customQuery && this.$customQuery.id) {
@@ -972,6 +972,11 @@ var ReactiveList = {
972
972
  renderNoResult: function renderNoResult() {
973
973
  var h = this.$createElement;
974
974
  var renderNoResults = this.$scopedSlots.renderNoResults || this.$props.renderNoResults;
975
+
976
+ if (this.$scopedSlots.renderNoResults) {
977
+ return isFunction(renderNoResults) ? renderNoResults() : renderNoResults;
978
+ }
979
+
975
980
  return h("p", {
976
981
  "class": getClassName$1(this.$props.innerClass, 'noResults') || null
977
982
  }, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
@@ -116,16 +116,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
116
116
  compProps[key] = component[key];
117
117
  }
118
118
  });
119
- var isInternalComponentPresent = false; // Set custom and default queries
120
-
121
- if (component.customQuery && typeof component.customQuery === 'function') {
122
- customQueries[component.componentId] = component.customQuery(component.value, compProps);
123
- }
124
-
125
- if (component.defaultQuery && typeof component.defaultQuery === 'function') {
126
- defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
127
- }
128
-
119
+ var isInternalComponentPresent = false;
129
120
  var isResultComponent = resultComponents.includes(componentType);
130
121
  var internalComponent = component.componentId + "__internal";
131
122
  var label = component.filterLabel || component.componentId;
@@ -149,7 +140,25 @@ function initReactivesearch(componentCollection, searchState, settings) {
149
140
  reference: reference,
150
141
  showFilter: showFilter,
151
142
  URLParams: component.URLParams || false
152
- }); // [2] set query options - main component query (valid for result components)
143
+ }); // Set custom and default queries
144
+
145
+ if (component.customQuery && typeof component.customQuery === 'function') {
146
+ customQueries[component.componentId] = component.customQuery(component.value || selectedValues[component.componentId].value, compProps);
147
+ }
148
+
149
+ if (component.defaultQuery && typeof component.defaultQuery === 'function') {
150
+ defaultQueries[component.componentId] = component.defaultQuery(component.value, compProps);
151
+ } // Set custom and default queries
152
+
153
+
154
+ if (component.customQuery && typeof component.customQuery === 'function') {
155
+ customQueries[component.componentId] = component.customQuery(value, compProps);
156
+ }
157
+
158
+ if (component.defaultQuery && typeof component.defaultQuery === 'function') {
159
+ defaultQueries[component.componentId] = component.defaultQuery(value, compProps);
160
+ } // [2] set query options - main component query (valid for result components)
161
+
153
162
 
154
163
  if (componentsWithOptions.includes(componentType)) {
155
164
  var options = component.source.generateQueryOptions ? component.source.generateQueryOptions(component) : null;
@@ -236,7 +245,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
236
245
 
237
246
 
238
247
  if (isResultComponent) {
239
- var _getQuery = getQuery(component, null, componentType),
248
+ var _getQuery = getQuery(component, value, componentType),
240
249
  query = _getQuery.query;
241
250
 
242
251
  queryList = queryReducer(queryList, {
@@ -445,6 +454,7 @@ function initReactivesearch(componentCollection, searchState, settings) {
445
454
  rsAPISettings.customEvents = isPropertyDefined(config.analyticsConfig.customEvents) ? config.analyticsConfig.customEvents : undefined;
446
455
  }
447
456
 
457
+ console.log('finalQuery', finalQuery);
448
458
  appbaseRef.reactiveSearchv3(finalQuery, rsAPISettings).then(function (res) {
449
459
  handleRSResponse(res);
450
460
  })["catch"](function (err) {
@@ -1,3 +1,3 @@
1
- var version = "1.23.4-alpha";
1
+ var version = "1.24.3-alpha.1";
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.23.4-alpha",
3
+ "version": "1.24.3-alpha.1",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "jsnext:main": "dist/es/index.js",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "sideEffects": false,
36
36
  "dependencies": {
37
- "@appbaseio/reactivecore": "9.12.8-alpha",
37
+ "@appbaseio/reactivecore": "9.13.0",
38
38
  "@appbaseio/vue-emotion": "0.4.4",
39
39
  "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
40
- "appbase-js": "^4.4.22-alpha",
40
+ "appbase-js": "^4.5.1",
41
41
  "compute-scroll-into-view": "^1.0.11",
42
42
  "emotion": "9.2.12",
43
43
  "hotkeys-js": "^3.8.7",
@@ -46,7 +46,7 @@
46
46
  "url-search-params-polyfill": "^7.0.0",
47
47
  "vue-highlight-words": "^1.2.0",
48
48
  "vue-no-ssr": "^1.1.0",
49
- "vue-slider-component": "^2.8.16",
49
+ "vue-slider-component": "^3.2.15",
50
50
  "vue-types": "^1.3.3"
51
51
  },
52
52
  "peerDependencies": {
@@ -62,10 +62,10 @@
62
62
  "@babel/preset-env": "^7.5.5",
63
63
  "@babel/preset-stage-2": "^7.0.0",
64
64
  "@vue/babel-preset-jsx": "^1.1.0",
65
+ "eslint": "^4.12.0",
65
66
  "eslint-config-airbnb-base": "^13.1.0",
66
67
  "eslint-config-prettier": "^3.1.0",
67
68
  "eslint-plugin-vue": "^4.7.1",
68
- "eslint": "^4.12.0",
69
69
  "nps": "^5.9.3",
70
70
  "nps-utils": "^1.7.0",
71
71
  "rollup": "^1.20.3",