@fluid-topics/ft-reader-metadata 2.2.18 → 2.2.19

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.
@@ -43,7 +43,8 @@ export class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)
43
43
  }
44
44
  }
45
45
  updateRelatives() {
46
- var _a, _b, _c, _d;
46
+ var _a, _b, _c;
47
+ var _d;
47
48
  if (this.useForSwitchingToRelatives && this.key) {
48
49
  this.relatives = (_d = (_b = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.computeClustersItemsForMetadata(this.key, ((_c = this.map) === null || _c === void 0 ? void 0 : _c.lang) || "en", this.noValueMessage, this.hierarchicalValueTruncatingLevel, this.getDateFormatter(this.key))) !== null && _d !== void 0 ? _d : [];
49
50
  }
@@ -69,9 +70,10 @@ export class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)
69
70
  `;
70
71
  }
71
72
  renderChip(inFloatingMenu = false) {
72
- var _a, _b, _c, _d, _e, _f;
73
+ var _a, _b, _c, _d;
74
+ var _e, _f;
73
75
  const noTooltip = !this.forceTooltip && this.displayLabel && ((_a = this.flatMetadata) === null || _a === void 0 ? void 0 : _a.displayTooltipValue) == ((_b = this.flatMetadata) === null || _b === void 0 ? void 0 : _b.displayValue);
74
- const tooltipLabel = `${this.metadataLabel}: ${(_d = (_c = this.flatMetadata) === null || _c === void 0 ? void 0 : _c.displayTooltipValue) !== null && _d !== void 0 ? _d : this.noValueMessage}`;
76
+ const tooltipLabel = `${this.metadataLabel}: ${(_e = (_c = this.flatMetadata) === null || _c === void 0 ? void 0 : _c.displayTooltipValue) !== null && _e !== void 0 ? _e : this.noValueMessage}`;
75
77
  const chip = html `
76
78
  <ft-chip part="chip"
77
79
  exportpartsPrefix="chip"
@@ -81,7 +83,7 @@ export class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)
81
83
  ?clickable=${inFloatingMenu}
82
84
  ?multiLine=${this.multiLine}>
83
85
  ${this.displayLabel ? html `
84
- <span part="label">${(_f = (_e = this.metadata) === null || _e === void 0 ? void 0 : _e.label) !== null && _f !== void 0 ? _f : this.key}: </span>
86
+ <span part="label">${(_f = (_d = this.metadata) === null || _d === void 0 ? void 0 : _d.label) !== null && _f !== void 0 ? _f : this.key}: </span>
85
87
  ` : nothing}
86
88
  ${this.metadataValue.length === 0 ? nothing : html `
87
89
  <span part="values">${this.metadataValue}</span>
@@ -113,8 +115,7 @@ export class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)
113
115
  renderRelativeItem(result, metadata) {
114
116
  var _a, _b;
115
117
  const translatedMetadata = this.translateValues
116
- ? (_b = new MetadataValueLocalizer((_a = this.availableContentLocales) !== null && _a !== void 0 ? _a : []).localize(metadata)) !== null && _b !== void 0 ? _b : metadata
117
- : metadata;
118
+ ? (_b = new MetadataValueLocalizer((_a = this.availableContentLocales) !== null && _a !== void 0 ? _a : []).localize(metadata)) !== null && _b !== void 0 ? _b : metadata : metadata;
118
119
  return html `
119
120
  <a part="relative-item-link"
120
121
  href="${getResultUrl(result, this.metadataFilters)}"
@@ -162,7 +163,8 @@ export class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)
162
163
  }
163
164
  }
164
165
  willUpdate(props) {
165
- var _a, _b, _c, _d, _e;
166
+ var _a, _b, _c, _d;
167
+ var _e;
166
168
  super.willUpdate(props);
167
169
  if (props.has("key") && this.useForSwitchingToRelatives) {
168
170
  if (props.get("key")) {
@@ -190,11 +192,12 @@ export class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)
190
192
  }
191
193
  }
192
194
  get metadataLabel() {
193
- var _a, _b, _c, _d, _e, _f;
195
+ var _a, _b, _c, _d;
196
+ var _e, _f;
194
197
  if (this.metadata) {
195
198
  return this.metadata.label;
196
199
  }
197
- return (_f = (_d = (_c = (_b = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.getMetadataDescriptor(this.key)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : (_e = this.relatives.find((item) => item.metadata.value)) === null || _e === void 0 ? void 0 : _e.metadata.label) !== null && _f !== void 0 ? _f : this.key;
200
+ return (_f = (_e = (_c = (_b = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.getMetadataDescriptor(this.key)) === null || _c === void 0 ? void 0 : _c.label) !== null && _e !== void 0 ? _e : (_d = this.relatives.find((item) => item.metadata.value)) === null || _d === void 0 ? void 0 : _d.metadata.label) !== null && _f !== void 0 ? _f : this.key;
198
201
  }
199
202
  }
200
203
  FtReaderMetadata.elementDefinitions = {