@fluid-topics/ft-search-result-metadata 1.1.26 → 1.1.27

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.
@@ -35,6 +35,7 @@ export declare class FtSearchResultMetadata extends FtSearchResultMetadata_base
35
35
  private renderChip;
36
36
  private renderContent;
37
37
  private get displayCluster();
38
+ private get clusterHasMultipleValues();
38
39
  private getEllipsis;
39
40
  protected update(props: PropertyValues): void;
40
41
  private get resultData();
@@ -15,7 +15,7 @@ import { searchResultMetadataContext } from "./SearchResultMetadataMessages";
15
15
  import { FtTooltip } from "@fluid-topics/ft-tooltip";
16
16
  import { FtChip } from "@fluid-topics/ft-chip";
17
17
  import { FtFloatingMenu, FtFloatingMenuItem, FtFloatingMenuLabel } from "@fluid-topics/ft-floating-menu";
18
- import { getResultUrl, SearchResultClickEvent } from "@fluid-topics/ft-search-result-context/build/utils";
18
+ import { extractResultMetadata, getResultUrl, SearchResultClickEvent } from "@fluid-topics/ft-search-result-context/build/utils";
19
19
  import { ClusteringHelper } from "@fluid-topics/ft-search-result-context/build/ClusteringHelper";
20
20
  import { repeat } from "lit/directives/repeat.js";
21
21
  class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
@@ -141,7 +141,13 @@ class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
141
141
  get displayCluster() {
142
142
  var _a, _b;
143
143
  return this.useAsClusterSwitch
144
- && ((_b = (_a = this.cluster) === null || _a === void 0 ? void 0 : _a.entries.length) !== null && _b !== void 0 ? _b : 0) > 1;
144
+ && ((_b = (_a = this.cluster) === null || _a === void 0 ? void 0 : _a.entries.length) !== null && _b !== void 0 ? _b : 0) > 1
145
+ && this.clusterHasMultipleValues;
146
+ }
147
+ get clusterHasMultipleValues() {
148
+ var _a, _b, _c;
149
+ let values = (_c = (_b = (_a = this.cluster) === null || _a === void 0 ? void 0 : _a.entries) === null || _b === void 0 ? void 0 : _b.map(e => extractResultMetadata(e))) === null || _c === void 0 ? void 0 : _c.map(e => { var _a; return (_a = e.find(m => m.key == this.key)) === null || _a === void 0 ? void 0 : _a.value; });
150
+ return new Set(values).size > 1;
145
151
  }
146
152
  getEllipsis(text) {
147
153
  let cutText = this.maxLength ? text.substring(0, this.maxLength) : text;
@@ -225,7 +231,7 @@ __decorate([
225
231
  redux({ store: ftAppInfoStore.name })
226
232
  ], FtSearchResultMetadata.prototype, "editorMode", void 0);
227
233
  __decorate([
228
- redux({ store: ftAppInfoStore.name })
234
+ redux({ store: ftAppInfoStore.name, selector: (s) => { var _a, _b; return (_b = (_a = s.metadataConfiguration) === null || _a === void 0 ? void 0 : _a.descriptors) !== null && _b !== void 0 ? _b : []; } })
229
235
  ], FtSearchResultMetadata.prototype, "metadataDescriptors", void 0);
230
236
  __decorate([
231
237
  redux({ store: "search" })