@appbaseio/reactivesearch-vue 1.33.10 → 1.33.11
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.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +1124 -1107
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +3 -3
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/DataSearch.js +1310 -17
- package/dist/cjs/ReactiveComponent.js +316 -45
- package/dist/cjs/{ReactiveComponent-f51e4519.js → ReactiveComponentPrivate-e84b6f9e.js} +19 -308
- package/dist/cjs/ReactiveComponentPrivate.js +55 -0
- package/dist/cjs/Tags-0559dec7.js +883 -0
- package/dist/cjs/index.js +8 -5
- package/dist/cjs/install.js +5 -3
- package/dist/cjs/version.js +1 -1
- package/dist/es/DataSearch.js +1310 -15
- package/dist/es/ReactiveComponent.js +316 -44
- package/dist/es/{ReactiveComponent-9ae8b96c.js → ReactiveComponentPrivate-4473d9d7.js} +5 -294
- package/dist/es/ReactiveComponentPrivate.js +47 -0
- package/dist/es/Tags-cdeb05d9.js +869 -0
- package/dist/es/index.js +4 -2
- package/dist/es/install.js +5 -3
- package/dist/es/version.js +1 -1
- package/package.json +88 -88
- package/dist/cjs/DataSearch-57d44eca.js +0 -2184
- package/dist/es/DataSearch-8a195d63.js +0 -2168
|
@@ -18,7 +18,7 @@ var ComponentWrapper = require('./ComponentWrapper-f89a5972.js');
|
|
|
18
18
|
var PreferencesConsumer = require('./PreferencesConsumer-5d67b486.js');
|
|
19
19
|
var Title = require('./Title-16042ea0.js');
|
|
20
20
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
21
|
-
var
|
|
21
|
+
var Tags = require('./Tags-0559dec7.js');
|
|
22
22
|
var CancelSvg = require('./CancelSvg-220a7cc3.js');
|
|
23
23
|
var Input = require('./Input-ead4cd84.js');
|
|
24
24
|
var Container = require('./Container-e699ea95.js');
|
|
@@ -27,6 +27,7 @@ var MultiList = require('./MultiList.js');
|
|
|
27
27
|
var SingleDropdownList = require('./SingleDropdownList.js');
|
|
28
28
|
var MultiDropdownList = require('./MultiDropdownList.js');
|
|
29
29
|
var ToggleButton = require('./ToggleButton.js');
|
|
30
|
+
var ReactiveComponent = require('./ReactiveComponent.js');
|
|
30
31
|
var DynamicRangeSlider = require('./DynamicRangeSlider.js');
|
|
31
32
|
var SingleRange = require('./SingleRange.js');
|
|
32
33
|
var MultiRange = require('./MultiRange.js');
|
|
@@ -666,7 +667,7 @@ var SearchBox = {
|
|
|
666
667
|
renderIcon: function renderIcon() {
|
|
667
668
|
var h = this.$createElement;
|
|
668
669
|
if (this.$props.showIcon) {
|
|
669
|
-
return this.$props.icon || h(
|
|
670
|
+
return this.$props.icon || h(Tags.SearchSvg);
|
|
670
671
|
}
|
|
671
672
|
return null;
|
|
672
673
|
},
|
|
@@ -674,7 +675,7 @@ var SearchBox = {
|
|
|
674
675
|
var h = this.$createElement;
|
|
675
676
|
var renderError = this.$scopedSlots.renderError || this.$props.renderError;
|
|
676
677
|
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
677
|
-
return h(
|
|
678
|
+
return h(Tags.SuggestionWrapper, {
|
|
678
679
|
"attrs": {
|
|
679
680
|
"innerClass": this.$props.innerClass,
|
|
680
681
|
"innerClassName": "error",
|
|
@@ -706,7 +707,7 @@ var SearchBox = {
|
|
|
706
707
|
isOpen = _this$$data.isOpen,
|
|
707
708
|
currentValue = _this$$data.currentValue;
|
|
708
709
|
if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
|
|
709
|
-
return h(
|
|
710
|
+
return h(Tags.SuggestionWrapper, {
|
|
710
711
|
"attrs": {
|
|
711
712
|
"innerClass": innerClass,
|
|
712
713
|
"themePreset": this.themePreset,
|
|
@@ -726,7 +727,7 @@ var SearchBox = {
|
|
|
726
727
|
var h = this.$createElement;
|
|
727
728
|
var addonBefore = this.$scopedSlots.addonBefore;
|
|
728
729
|
if (addonBefore) {
|
|
729
|
-
return h(
|
|
730
|
+
return h(Tags.InputAddon, {
|
|
730
731
|
"class": "addon-before"
|
|
731
732
|
}, [addonBefore()]);
|
|
732
733
|
}
|
|
@@ -736,7 +737,7 @@ var SearchBox = {
|
|
|
736
737
|
var h = this.$createElement;
|
|
737
738
|
var addonAfter = this.$scopedSlots.addonAfter;
|
|
738
739
|
if (addonAfter) {
|
|
739
|
-
return h(
|
|
740
|
+
return h(Tags.InputAddon, {
|
|
740
741
|
"class": "addon-after"
|
|
741
742
|
}, [addonAfter()]);
|
|
742
743
|
}
|
|
@@ -801,7 +802,7 @@ var SearchBox = {
|
|
|
801
802
|
"showIcon": showIcon,
|
|
802
803
|
"isClearIcon": true
|
|
803
804
|
}
|
|
804
|
-
}, [this.renderCancelIcon()]), showVoiceSearch && h(
|
|
805
|
+
}, [this.renderCancelIcon()]), showVoiceSearch && h(Tags.Mic, {
|
|
805
806
|
"attrs": {
|
|
806
807
|
"getInstance": getMicInstance,
|
|
807
808
|
"render": renderMic,
|
|
@@ -889,7 +890,7 @@ var SearchBox = {
|
|
|
889
890
|
var _this7 = this;
|
|
890
891
|
var h = this.$createElement;
|
|
891
892
|
var innerClass = this.$props.innerClass;
|
|
892
|
-
return h(
|
|
893
|
+
return h(Tags.TagItem, {
|
|
893
894
|
"class": getClassName(innerClass, 'selected-tag') || ''
|
|
894
895
|
}, [h("span", [item]), h("span", {
|
|
895
896
|
"attrs": {
|
|
@@ -933,9 +934,9 @@ var SearchBox = {
|
|
|
933
934
|
values: this.selectedTags,
|
|
934
935
|
handleClear: this.clearTag,
|
|
935
936
|
handleClearAll: this.clearAllTags
|
|
936
|
-
}) : h(
|
|
937
|
+
}) : h(Tags.TagsContainer, [tagsList.map(function (item) {
|
|
937
938
|
return _this8.renderTag(item);
|
|
938
|
-
}), shouldRenderClearAllTag && h(
|
|
939
|
+
}), shouldRenderClearAllTag && h(Tags.TagItem, {
|
|
939
940
|
"class": getClassName(this.$props.innerClass, 'selected-tag') || ''
|
|
940
941
|
}, [h("span", ["Clear All"]), h("span", {
|
|
941
942
|
"attrs": {
|
|
@@ -1030,13 +1031,13 @@ var SearchBox = {
|
|
|
1030
1031
|
padding: '0 10px 0 0',
|
|
1031
1032
|
display: 'flex'
|
|
1032
1033
|
}
|
|
1033
|
-
}, [h(
|
|
1034
|
+
}, [h(Tags.CustomSvg, {
|
|
1034
1035
|
"attrs": {
|
|
1035
1036
|
"className": getClassName(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
1036
1037
|
"icon": getIcon(item._suggestion_type),
|
|
1037
1038
|
"type": item._suggestion_type + "-search-icon"
|
|
1038
1039
|
}
|
|
1039
|
-
})]), h(
|
|
1040
|
+
})]), h(Tags.SuggestionItem, {
|
|
1040
1041
|
"attrs": {
|
|
1041
1042
|
"currentValue": _this9.currentValue,
|
|
1042
1043
|
"suggestion": item
|
|
@@ -1046,7 +1047,7 @@ var SearchBox = {
|
|
|
1046
1047
|
};
|
|
1047
1048
|
return h("div", {
|
|
1048
1049
|
"class": Input.suggestionsContainer
|
|
1049
|
-
}, [h(
|
|
1050
|
+
}, [h(Tags.InputGroup, [_this9.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1050
1051
|
"attrs": {
|
|
1051
1052
|
"id": _this9.$props.componentId + "-input",
|
|
1052
1053
|
"showIcon": _this9.$props.showIcon,
|
|
@@ -1088,7 +1089,7 @@ var SearchBox = {
|
|
|
1088
1089
|
}
|
|
1089
1090
|
}) : h("div", {
|
|
1090
1091
|
"class": Input.suggestionsContainer
|
|
1091
|
-
}, [h(
|
|
1092
|
+
}, [h(Tags.InputGroup, [this.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1092
1093
|
"class": getClassName(this.$props.innerClass, 'input') || '',
|
|
1093
1094
|
"attrs": {
|
|
1094
1095
|
"placeholder": this.$props.placeholder,
|
|
@@ -1261,304 +1262,14 @@ SBConnected.install = function (Vue) {
|
|
|
1261
1262
|
// Add componentType for SSR
|
|
1262
1263
|
SBConnected.componentType = constants.componentTypes.searchBox;
|
|
1263
1264
|
|
|
1264
|
-
var _excluded = ["options"];
|
|
1265
|
-
var updateQuery$1 = configureStore.Actions.updateQuery,
|
|
1266
|
-
setQueryOptions = configureStore.Actions.setQueryOptions,
|
|
1267
|
-
setCustomQuery$1 = configureStore.Actions.setCustomQuery,
|
|
1268
|
-
setDefaultQuery$1 = configureStore.Actions.setDefaultQuery;
|
|
1269
|
-
var parseHits = configureStore.helper.parseHits,
|
|
1270
|
-
isEqual$1 = configureStore.helper.isEqual,
|
|
1271
|
-
getCompositeAggsQuery$1 = configureStore.helper.getCompositeAggsQuery,
|
|
1272
|
-
getResultStats$1 = configureStore.helper.getResultStats,
|
|
1273
|
-
extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
|
|
1274
|
-
getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
|
|
1275
|
-
var ReactiveComponent = {
|
|
1276
|
-
name: 'ReactiveComponent',
|
|
1277
|
-
props: {
|
|
1278
|
-
componentId: vueTypes.types.stringRequired,
|
|
1279
|
-
aggregationField: vueTypes.types.string,
|
|
1280
|
-
aggregationSize: VueTypes.number,
|
|
1281
|
-
size: VueTypes.number,
|
|
1282
|
-
defaultQuery: vueTypes.types.func,
|
|
1283
|
-
customQuery: vueTypes.types.func,
|
|
1284
|
-
filterLabel: vueTypes.types.string,
|
|
1285
|
-
react: vueTypes.types.react,
|
|
1286
|
-
showFilter: VueTypes.bool.def(true),
|
|
1287
|
-
URLParams: VueTypes.bool.def(false),
|
|
1288
|
-
distinctField: vueTypes.types.string,
|
|
1289
|
-
distinctFieldConfig: vueTypes.types.props,
|
|
1290
|
-
index: VueTypes.string,
|
|
1291
|
-
endpoint: vueTypes.types.endpointConfig
|
|
1292
|
-
},
|
|
1293
|
-
created: function created() {
|
|
1294
|
-
var _this = this;
|
|
1295
|
-
var props = this.$props;
|
|
1296
|
-
this.internalComponent = null;
|
|
1297
|
-
this.$defaultQuery = null;
|
|
1298
|
-
// Set custom query in store
|
|
1299
|
-
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
1300
|
-
var customQuery = props.customQuery,
|
|
1301
|
-
componentId = props.componentId,
|
|
1302
|
-
filterLabel = props.filterLabel,
|
|
1303
|
-
showFilter = props.showFilter,
|
|
1304
|
-
URLParams = props.URLParams,
|
|
1305
|
-
distinctField = props.distinctField,
|
|
1306
|
-
distinctFieldConfig = props.distinctFieldConfig,
|
|
1307
|
-
index$1 = props.index;
|
|
1308
|
-
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
1309
|
-
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
1310
|
-
}
|
|
1311
|
-
if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
|
|
1312
|
-
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
1313
|
-
}
|
|
1314
|
-
if (!this.enableAppbase && index$1) {
|
|
1315
|
-
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
1316
|
-
}
|
|
1317
|
-
if (customQuery) {
|
|
1318
|
-
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
1319
|
-
var query = extractQueryFromCustomQuery(calcCustomQuery);
|
|
1320
|
-
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
|
|
1321
|
-
if (customQueryOptions) {
|
|
1322
|
-
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
1323
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
1324
|
-
this.updateQuery({
|
|
1325
|
-
componentId: componentId,
|
|
1326
|
-
query: query,
|
|
1327
|
-
value: this.selectedValue || null,
|
|
1328
|
-
label: filterLabel,
|
|
1329
|
-
showFilter: showFilter,
|
|
1330
|
-
URLParams: URLParams
|
|
1331
|
-
});
|
|
1332
|
-
}
|
|
1333
|
-
this.setQuery = function (_ref) {
|
|
1334
|
-
var options = _ref.options,
|
|
1335
|
-
obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1336
|
-
var queryToBeSet = obj.query;
|
|
1337
|
-
|
|
1338
|
-
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
1339
|
-
if (queryToBeSet && queryToBeSet.query) {
|
|
1340
|
-
queryToBeSet = queryToBeSet.query;
|
|
1341
|
-
}
|
|
1342
|
-
var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
|
|
1343
|
-
query: queryToBeSet
|
|
1344
|
-
});
|
|
1345
|
-
var rsAPIQuery = customQueryCalc;
|
|
1346
|
-
// handle stored queries
|
|
1347
|
-
if (queryToBeSet && queryToBeSet.id) {
|
|
1348
|
-
rsAPIQuery = queryToBeSet;
|
|
1349
|
-
}
|
|
1350
|
-
// Update customQuery field for RS API
|
|
1351
|
-
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
1352
|
-
if (options) {
|
|
1353
|
-
_this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
|
|
1354
|
-
}
|
|
1355
|
-
_this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
|
|
1356
|
-
query: customQueryCalc.query,
|
|
1357
|
-
componentId: props.componentId,
|
|
1358
|
-
label: props.filterLabel,
|
|
1359
|
-
showFilter: props.showFilter,
|
|
1360
|
-
URLParams: props.URLParams
|
|
1361
|
-
}));
|
|
1362
|
-
};
|
|
1363
|
-
if (props.defaultQuery) {
|
|
1364
|
-
this.internalComponent = props.componentId + "__internal";
|
|
1365
|
-
}
|
|
1366
|
-
if (this.internalComponent && this.$props.defaultQuery) {
|
|
1367
|
-
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
1368
|
-
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
1369
|
-
var _query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
1370
|
-
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
1371
|
-
if (queryOptions) {
|
|
1372
|
-
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
1373
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
1374
|
-
this.updateQuery({
|
|
1375
|
-
componentId: this.internalComponent,
|
|
1376
|
-
query: _query
|
|
1377
|
-
});
|
|
1378
|
-
}
|
|
1379
|
-
},
|
|
1380
|
-
watch: {
|
|
1381
|
-
hits: function hits(newVal, oldVal) {
|
|
1382
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1383
|
-
this.$emit('data', this.getData());
|
|
1384
|
-
}
|
|
1385
|
-
},
|
|
1386
|
-
rawData: function rawData(newVal, oldVal) {
|
|
1387
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1388
|
-
this.$emit('data', this.getData());
|
|
1389
|
-
}
|
|
1390
|
-
},
|
|
1391
|
-
aggregations: function aggregations(newVal, oldVal) {
|
|
1392
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1393
|
-
this.$emit('data', this.getData());
|
|
1394
|
-
}
|
|
1395
|
-
},
|
|
1396
|
-
aggregationData: function aggregationData(newVal, oldVal) {
|
|
1397
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1398
|
-
this.$emit('data', this.getData());
|
|
1399
|
-
}
|
|
1400
|
-
},
|
|
1401
|
-
promotedResults: function promotedResults(newVal, oldVal) {
|
|
1402
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1403
|
-
this.$emit('data', this.getData());
|
|
1404
|
-
}
|
|
1405
|
-
},
|
|
1406
|
-
hidden: function hidden(newVal, oldVal) {
|
|
1407
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1408
|
-
this.$emit('data', this.getData());
|
|
1409
|
-
}
|
|
1410
|
-
},
|
|
1411
|
-
total: function total(newVal, oldVal) {
|
|
1412
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1413
|
-
this.$emit('data', this.getData());
|
|
1414
|
-
}
|
|
1415
|
-
},
|
|
1416
|
-
time: function time(newVal, oldVal) {
|
|
1417
|
-
if (!isEqual$1(newVal, oldVal)) {
|
|
1418
|
-
this.$emit('data', this.getData());
|
|
1419
|
-
}
|
|
1420
|
-
},
|
|
1421
|
-
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
1422
|
-
if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
1423
|
-
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
1424
|
-
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
1425
|
-
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
1426
|
-
if (queryOptions) {
|
|
1427
|
-
this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
1428
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
1429
|
-
// Update default query for RS API
|
|
1430
|
-
index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
1431
|
-
this.updateQuery({
|
|
1432
|
-
componentId: this.internalComponent,
|
|
1433
|
-
query: query
|
|
1434
|
-
});
|
|
1435
|
-
}
|
|
1436
|
-
},
|
|
1437
|
-
customQuery: function customQuery(newVal, oldVal) {
|
|
1438
|
-
if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
1439
|
-
var componentId = this.$props.componentId;
|
|
1440
|
-
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
1441
|
-
var query = extractQueryFromCustomQuery(this.$customQuery);
|
|
1442
|
-
var queryOptions = getOptionsForCustomQuery(this.$customQuery);
|
|
1443
|
-
if (queryOptions) {
|
|
1444
|
-
this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
|
|
1445
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
1446
|
-
|
|
1447
|
-
// Update custom query for RS API
|
|
1448
|
-
index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
1449
|
-
this.updateQuery({
|
|
1450
|
-
componentId: componentId,
|
|
1451
|
-
query: query
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
},
|
|
1456
|
-
render: function render() {
|
|
1457
|
-
var h = arguments[0];
|
|
1458
|
-
try {
|
|
1459
|
-
var dom = this.$scopedSlots["default"];
|
|
1460
|
-
var error = this.error,
|
|
1461
|
-
isLoading = this.isLoading,
|
|
1462
|
-
selectedValue = this.selectedValue;
|
|
1463
|
-
var propsToBePassed = _rollupPluginBabelHelpers._extends({
|
|
1464
|
-
error: error,
|
|
1465
|
-
loading: isLoading
|
|
1466
|
-
}, this.getData(), {
|
|
1467
|
-
value: selectedValue,
|
|
1468
|
-
setQuery: this.setQuery
|
|
1469
|
-
});
|
|
1470
|
-
return h("div", [dom(propsToBePassed)]);
|
|
1471
|
-
} catch (e) {
|
|
1472
|
-
return null;
|
|
1473
|
-
}
|
|
1474
|
-
},
|
|
1475
|
-
methods: {
|
|
1476
|
-
getAggsQuery: function getAggsQuery() {
|
|
1477
|
-
if (this.aggregationField) {
|
|
1478
|
-
return {
|
|
1479
|
-
aggs: getCompositeAggsQuery$1({
|
|
1480
|
-
props: this.$props,
|
|
1481
|
-
showTopHits: true,
|
|
1482
|
-
value: this.selectedValue
|
|
1483
|
-
}).aggs
|
|
1484
|
-
};
|
|
1485
|
-
}
|
|
1486
|
-
return {};
|
|
1487
|
-
},
|
|
1488
|
-
getData: function getData() {
|
|
1489
|
-
var hits = this.hits,
|
|
1490
|
-
aggregations = this.aggregations,
|
|
1491
|
-
aggregationData = this.aggregationData,
|
|
1492
|
-
promotedResults = this.promotedResults,
|
|
1493
|
-
rawData = this.rawData;
|
|
1494
|
-
var filteredResults = parseHits(hits);
|
|
1495
|
-
if (promotedResults.length) {
|
|
1496
|
-
var ids = promotedResults.map(function (item) {
|
|
1497
|
-
return item._id;
|
|
1498
|
-
}).filter(Boolean);
|
|
1499
|
-
if (ids) {
|
|
1500
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
1501
|
-
return !ids.includes(item._id);
|
|
1502
|
-
});
|
|
1503
|
-
}
|
|
1504
|
-
filteredResults = [].concat(promotedResults, filteredResults);
|
|
1505
|
-
}
|
|
1506
|
-
return {
|
|
1507
|
-
data: filteredResults,
|
|
1508
|
-
aggregationData: aggregationData,
|
|
1509
|
-
rawData: rawData,
|
|
1510
|
-
aggregations: aggregations,
|
|
1511
|
-
promotedData: promotedResults,
|
|
1512
|
-
resultStats: this.stats
|
|
1513
|
-
};
|
|
1514
|
-
}
|
|
1515
|
-
},
|
|
1516
|
-
computed: {
|
|
1517
|
-
stats: function stats() {
|
|
1518
|
-
return getResultStats$1(this);
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
};
|
|
1522
|
-
ReactiveComponent.hasInternalComponent = function (props) {
|
|
1523
|
-
return !!props.defaultQuery;
|
|
1524
|
-
};
|
|
1525
|
-
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
1526
|
-
return {
|
|
1527
|
-
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
1528
|
-
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
1529
|
-
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
1530
|
-
rawData: state.rawData[props.componentId],
|
|
1531
|
-
error: state.error[props.componentId],
|
|
1532
|
-
isLoading: state.isLoading[props.componentId],
|
|
1533
|
-
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
1534
|
-
promotedResults: state.promotedResults[props.componentId] || [],
|
|
1535
|
-
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
1536
|
-
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
1537
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
1538
|
-
componentProps: state.props[props.componentId],
|
|
1539
|
-
enableAppbase: state.config.enableAppbase
|
|
1540
|
-
};
|
|
1541
|
-
};
|
|
1542
|
-
var mapDispatchtoProps = {
|
|
1543
|
-
setQueryOptions: setQueryOptions,
|
|
1544
|
-
updateQuery: updateQuery$1,
|
|
1545
|
-
setCustomQuery: setCustomQuery$1,
|
|
1546
|
-
setDefaultQuery: setDefaultQuery$1
|
|
1547
|
-
};
|
|
1548
|
-
var ConnectedComponent = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveComponent), {
|
|
1549
|
-
componentType: constants.componentTypes.reactiveComponent
|
|
1550
|
-
});
|
|
1551
1265
|
var RcConnected = PreferencesConsumer.PreferencesConsumer({
|
|
1552
1266
|
name: 'RcConnected',
|
|
1553
1267
|
render: function render(h) {
|
|
1554
|
-
var component =
|
|
1268
|
+
var component = ReactiveComponent.default;
|
|
1555
1269
|
switch (this.$attrs.componentType) {
|
|
1556
1270
|
case constants.componentTypes.reactiveList:
|
|
1557
1271
|
component = ReactiveList.RLConnected;
|
|
1558
1272
|
break;
|
|
1559
|
-
case constants.componentTypes.dataSearch:
|
|
1560
|
-
component = DataSearch.DSConnected;
|
|
1561
|
-
break;
|
|
1562
1273
|
case constants.componentTypes.searchBox:
|
|
1563
1274
|
component = SBConnected;
|
|
1564
1275
|
break;
|
|
@@ -1604,13 +1315,13 @@ var RcConnected = PreferencesConsumer.PreferencesConsumer({
|
|
|
1604
1315
|
});
|
|
1605
1316
|
}
|
|
1606
1317
|
});
|
|
1607
|
-
RcConnected.name =
|
|
1608
|
-
RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
|
|
1318
|
+
RcConnected.name = 'ReactiveComponentPrivate';
|
|
1319
|
+
RcConnected.hasInternalComponent = ReactiveComponent.default.hasInternalComponent;
|
|
1609
1320
|
// Add componentType for SSR
|
|
1610
1321
|
RcConnected.componentType = constants.componentTypes.reactiveComponent;
|
|
1611
1322
|
RcConnected.install = function (Vue) {
|
|
1612
1323
|
Vue.component(RcConnected.name, RcConnected);
|
|
1613
1324
|
};
|
|
1614
1325
|
|
|
1615
|
-
exports.
|
|
1326
|
+
exports.ReactiveComponentPrivate = RcConnected;
|
|
1616
1327
|
exports.SearchBox = SBConnected;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('@appbaseio/reactivecore');
|
|
6
|
+
require('@appbaseio/reactivecore/lib/utils/constants');
|
|
7
|
+
require('./_rollupPluginBabelHelpers-f8b843f8.js');
|
|
8
|
+
require('vue-types');
|
|
9
|
+
require('@appbaseio/reactivecore/lib/utils/helper');
|
|
10
|
+
require('emotion');
|
|
11
|
+
require('@appbaseio/vue-emotion');
|
|
12
|
+
require('polished');
|
|
13
|
+
require('./Button-841fd06d.js');
|
|
14
|
+
require('./vueTypes-7cfc2f98.js');
|
|
15
|
+
require('./Pagination-07f4dbad.js');
|
|
16
|
+
require('./ReactiveList.js');
|
|
17
|
+
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
18
|
+
require('redux');
|
|
19
|
+
require('./index-30126fd0.js');
|
|
20
|
+
require('./ComponentWrapper-f89a5972.js');
|
|
21
|
+
require('./PreferencesConsumer-5d67b486.js');
|
|
22
|
+
require('@vue/babel-helper-vue-jsx-merge-props');
|
|
23
|
+
require('./Title-16042ea0.js');
|
|
24
|
+
require('./ListItem-5088bd6a.js');
|
|
25
|
+
require('./Card-240f283d.js');
|
|
26
|
+
require('./Flex-ddd7cb6b.js');
|
|
27
|
+
require('hotkeys-js');
|
|
28
|
+
require('./Tags-0559dec7.js');
|
|
29
|
+
require('./CancelSvg-220a7cc3.js');
|
|
30
|
+
require('./Input-ead4cd84.js');
|
|
31
|
+
require('compute-scroll-into-view');
|
|
32
|
+
require('./Container-e699ea95.js');
|
|
33
|
+
require('vue-highlight-words');
|
|
34
|
+
var ReactiveComponentPrivate = require('./ReactiveComponentPrivate-e84b6f9e.js');
|
|
35
|
+
require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
36
|
+
require('./FormControlList-bbb5cd24.js');
|
|
37
|
+
require('./utils-83fd01e9.js');
|
|
38
|
+
require('./SingleList.js');
|
|
39
|
+
require('./MultiList.js');
|
|
40
|
+
require('./DropDown-8984b544.js');
|
|
41
|
+
require('./SingleDropdownList.js');
|
|
42
|
+
require('./MultiDropdownList.js');
|
|
43
|
+
require('./ToggleButton.js');
|
|
44
|
+
require('./ReactiveComponent.js');
|
|
45
|
+
require('vue-no-ssr');
|
|
46
|
+
require('./ssr-f2fc1bf6.js');
|
|
47
|
+
require('./DynamicRangeSlider.js');
|
|
48
|
+
require('./SingleRange.js');
|
|
49
|
+
require('./MultiRange.js');
|
|
50
|
+
require('./RangeSlider.js');
|
|
51
|
+
require('./RangeInput.js');
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
exports.default = ReactiveComponentPrivate.ReactiveComponentPrivate;
|