@fluid-topics/ft-search-results 1.1.112 → 1.1.113
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import { ClusterPolicy, FtSearchResultsProperties } from "./ft-search-results.properties";
|
|
3
3
|
import { FtSearchComponent } from "@fluid-topics/ft-search-context/build/registration";
|
|
4
|
-
import type { FtPublicClusterSortCriterion, FtSearchResultClusterEntry } from "@fluid-topics/public-api";
|
|
4
|
+
import type { FtPublicClusterSortCriterion, FtSearchRequest, FtSearchResultCluster, FtSearchResultClusterEntry, FtPageRequest } from "@fluid-topics/public-api";
|
|
5
5
|
import "@fluid-topics/ft-search-result-context";
|
|
6
6
|
import "@fluid-topics/ft-search-result-title";
|
|
7
7
|
import "@fluid-topics/ft-search-result-abstract";
|
|
@@ -12,13 +12,14 @@ export declare class FtSearchResults extends FtSearchResults_base implements FtS
|
|
|
12
12
|
displayNoResultsMessage: boolean;
|
|
13
13
|
renderResult: (resultOrCluster: FtSearchResultClusterEntry, index: number) => TemplateResult | string;
|
|
14
14
|
clusterSortCriterion: FtPublicClusterSortCriterion[];
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
requestWithoutPaging?: FtSearchRequest;
|
|
16
|
+
paging?: FtPageRequest;
|
|
17
|
+
results?: Array<FtSearchResultCluster>;
|
|
17
18
|
private selectedResultByCluster;
|
|
18
19
|
constructor();
|
|
19
20
|
protected render(): unknown;
|
|
20
21
|
protected update(props: PropertyValues): void;
|
|
21
|
-
protected contentAvailableCallback(props: PropertyValues): void;
|
|
22
|
+
protected contentAvailableCallback(props: PropertyValues<FtSearchResults>): void;
|
|
22
23
|
private onClusterChange;
|
|
23
24
|
private buildClusters;
|
|
24
25
|
private buildFullClusters;
|
|
@@ -55,7 +55,7 @@ class FtSearchResults extends withI18n(FtSearchComponent) {
|
|
|
55
55
|
contentAvailableCallback(props) {
|
|
56
56
|
var _a;
|
|
57
57
|
super.contentAvailableCallback(props);
|
|
58
|
-
if (props.has("
|
|
58
|
+
if (props.has("requestWithoutPaging")) {
|
|
59
59
|
const target = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`ft-search-result-context`);
|
|
60
60
|
if (target) {
|
|
61
61
|
scrollHelper.scrollIntoViewIfPossible(target, { position: 1, behavior: "smooth" });
|
|
@@ -86,7 +86,7 @@ class FtSearchResults extends withI18n(FtSearchComponent) {
|
|
|
86
86
|
id: this.clusterId(entry),
|
|
87
87
|
entries: [entry]
|
|
88
88
|
})))) !== null && _b !== void 0 ? _b : [];
|
|
89
|
-
return this.
|
|
89
|
+
return this.paging && this.paging.page === 1 ? results.slice(0, this.paging.perPage) : results;
|
|
90
90
|
}
|
|
91
91
|
clusterId(result) {
|
|
92
92
|
var _a, _b, _c, _d, _e;
|
|
@@ -107,8 +107,11 @@ __decorate([
|
|
|
107
107
|
jsonProperty([])
|
|
108
108
|
], FtSearchResults.prototype, "clusterSortCriterion", void 0);
|
|
109
109
|
__decorate([
|
|
110
|
-
redux()
|
|
111
|
-
], FtSearchResults.prototype, "
|
|
110
|
+
redux({ selector: (s) => ({ ...s.request, paging: undefined }) })
|
|
111
|
+
], FtSearchResults.prototype, "requestWithoutPaging", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
redux({ selector: (s) => s.request.paging })
|
|
114
|
+
], FtSearchResults.prototype, "paging", void 0);
|
|
112
115
|
__decorate([
|
|
113
116
|
redux()
|
|
114
117
|
], FtSearchResults.prototype, "results", void 0);
|