@fluid-topics/ft-search-result-metadata 1.1.80 → 1.1.82

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.
@@ -3,7 +3,7 @@ import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtSearchResultMetadataProperties } from "./ft-search-result-metadata.properties";
4
4
  import type { FtSearchResultStateManager } from "@fluid-topics/ft-search-result-context/build/registration";
5
5
  import { FtSearchResultComponent } from "@fluid-topics/ft-search-result-context/build/registration";
6
- declare const FtSearchResultMetadata_base: typeof FtSearchResultComponent & import("@fluid-topics/ft-wc-utils").Constructor<import("@fluid-topics/ft-i18n").FtLitElementWithI18nInterface>;
6
+ declare const FtSearchResultMetadata_base: typeof FtSearchResultComponent & import("@fluid-topics/ft-wc-utils").Constructor<import("@fluid-topics/ft-i18n").FtLitElementWithI18nInterface> & import("@fluid-topics/ft-wc-utils").Constructor<import("@fluid-topics/ft-app-context").FtLitElementWithDateFormatInterface>;
7
7
  export declare class FtSearchResultMetadata extends FtSearchResultMetadata_base implements FtSearchResultMetadataProperties {
8
8
  static elementDefinitions: ElementDefinitionsMap;
9
9
  static styles: import("lit").CSSResult;
@@ -18,7 +18,8 @@ import { FtFloatingMenu, FtFloatingMenuItem, FtFloatingMenuLabel } from "@fluid-
18
18
  import { getResultUrl, SearchResultClickEvent } from "@fluid-topics/ft-search-result-context/build/utils";
19
19
  import { repeat } from "lit/directives/repeat.js";
20
20
  import { context, defaultMessages } from "./SearchResultMetadataMessages";
21
- class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
21
+ import { withDateFormat } from "@fluid-topics/ft-app-context/build/mixins/withDateFormat";
22
+ class FtSearchResultMetadata extends withDateFormat(withI18n(FtSearchResultComponent)) {
22
23
  constructor() {
23
24
  super();
24
25
  this.useChip = false;
@@ -163,8 +164,8 @@ class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
163
164
  update(props) {
164
165
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
165
166
  super.update(props);
166
- if ((props.has("result") || props.has("key")) && this.result) {
167
- this.metadata = (_a = this.resultData()) === null || _a === void 0 ? void 0 : _a.metadata.find(m => m.key == this.key && m.values.length > 0);
167
+ if ((props.has("result") || (props.has("key")) && this.result) || this.dateFormatOptionsChanged(props)) {
168
+ this.metadata = this.formatDateValues((_a = this.resultData()) === null || _a === void 0 ? void 0 : _a.metadata.find(m => m.key == this.key && m.values.length > 0));
168
169
  this.metadataLabel = (_c = (_b = this.metadata) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : this.findClusterMetadataLabel();
169
170
  this.flatMetadata = ClusteringHelper.flattenMetadata(this.metadata);
170
171
  }