@fluid-topics/ft-search-results 1.3.15 → 1.3.16

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.
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html } from "lit";
8
8
  import { repeat } from "lit/directives/repeat.js";
9
9
  import { property } from "lit/decorators.js";
10
- import { jsonProperty, redux, scrollHelper, } from "@fluid-topics/ft-wc-utils";
10
+ import { jsonProperty, redux, scrollHelper } from "@fluid-topics/ft-wc-utils";
11
11
  import { styles } from "./ft-search-results.styles";
12
12
  import { FtSearchComponent } from "@fluid-topics/ft-search-context/build/registration";
13
13
  import "@fluid-topics/ft-search-result-context";
@@ -35,11 +35,11 @@ class FtSearchResults extends withI18n(FtSearchComponent) {
35
35
  `;
36
36
  }
37
37
  const clusters = this.buildClusters();
38
- return repeat(clusters, cluster => cluster.id, (cluster, index) => {
38
+ return repeat(clusters, (cluster) => cluster.id, (cluster, index) => {
39
39
  var _a;
40
40
  return html `
41
41
  <ft-search-result-context .cluster=${cluster} index="${index}"
42
- @ft-search-result-cluster-change="${(e) => this.onClusterChange(cluster.id, e.detail)}">
42
+ @ft-search-result-cluster-change=${(e) => this.onClusterChange(cluster.id, e.detail)}>
43
43
  ${this.renderResult((_a = this.selectedResultByCluster[cluster.id]) !== null && _a !== void 0 ? _a : cluster.entries[0], index)}
44
44
  </ft-search-result-context>
45
45
  `;
@@ -48,7 +48,7 @@ class FtSearchResults extends withI18n(FtSearchComponent) {
48
48
  update(props) {
49
49
  var _a;
50
50
  super.update(props);
51
- if (props.has("clusterSortCriterion") || props.has("stateManager") && this.clusterSortCriterion) {
51
+ if ((props.has("clusterSortCriterion") || props.has("stateManager")) && this.clusterSortCriterion) {
52
52
  (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.setClusterSortCriterion(this.clusterSortCriterion);
53
53
  }
54
54
  }
@@ -75,16 +75,16 @@ class FtSearchResults extends withI18n(FtSearchComponent) {
75
75
  }
76
76
  buildFullClusters() {
77
77
  var _a, _b;
78
- return (_b = (_a = this.results) === null || _a === void 0 ? void 0 : _a.map(cluster => ({
78
+ return (_b = (_a = this.results) === null || _a === void 0 ? void 0 : _a.map((cluster) => ({
79
79
  id: this.clusterId(cluster.entries[0]),
80
- entries: cluster.entries
80
+ entries: cluster.entries,
81
81
  }))) !== null && _b !== void 0 ? _b : [];
82
82
  }
83
83
  buildAllResultsClusters() {
84
84
  var _a, _b, _c;
85
- let results = (_b = (_a = this.results) === null || _a === void 0 ? void 0 : _a.flatMap(cluster => cluster.entries.map(entry => ({
85
+ const results = (_b = (_a = this.results) === null || _a === void 0 ? void 0 : _a.flatMap((cluster) => cluster.entries.map((entry) => ({
86
86
  id: this.clusterId(entry),
87
- entries: [entry]
87
+ entries: [entry],
88
88
  })))) !== null && _b !== void 0 ? _b : [];
89
89
  return this.paging && this.paging.page === 1 ? results.slice(0, ((_c = this.paging.perPage) !== null && _c !== void 0 ? _c : 20)) : results;
90
90
  }