@fluid-topics/ft-reader-metadata 1.2.23 → 1.2.24
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.
|
@@ -10,6 +10,7 @@ export declare class FtReaderMetadata extends FtReaderMetadata_base implements F
|
|
|
10
10
|
multiLine: boolean;
|
|
11
11
|
useForSwitchingToRelatives: boolean;
|
|
12
12
|
displayLabel: boolean;
|
|
13
|
+
hierarchicalValueTruncatingLevel?: number;
|
|
13
14
|
editorMode: boolean;
|
|
14
15
|
private metadata?;
|
|
15
16
|
private flatMetadata?;
|
|
@@ -25,6 +25,7 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
25
25
|
this.multiLine = false;
|
|
26
26
|
this.useForSwitchingToRelatives = false;
|
|
27
27
|
this.displayLabel = false;
|
|
28
|
+
this.hierarchicalValueTruncatingLevel = 3;
|
|
28
29
|
this.editorMode = false;
|
|
29
30
|
this.relatives = [];
|
|
30
31
|
this.noValueMessage = "No value";
|
|
@@ -39,7 +40,7 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
39
40
|
updateRelatives() {
|
|
40
41
|
var _a, _b, _c, _d;
|
|
41
42
|
if (this.useForSwitchingToRelatives && this.key) {
|
|
42
|
-
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.getDateFormatter(this.key))) !== null && _d !== void 0 ? _d : [];
|
|
43
|
+
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 : [];
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
46
|
this.relatives = [];
|
|
@@ -83,7 +84,7 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
83
84
|
<ft-tooltip part="tooltip"
|
|
84
85
|
slot="${inFloatingMenu ? "toggle" : ""}"
|
|
85
86
|
class="${this.multiLine ? "ft-reader-metadata-multi-line" : ""}"
|
|
86
|
-
text="${`${this.metadataLabel}: ${(_f = (_e = this.flatMetadata) === null || _e === void 0 ? void 0 : _e.
|
|
87
|
+
text="${`${this.metadataLabel}: ${(_f = (_e = this.flatMetadata) === null || _e === void 0 ? void 0 : _e.displayTooltipValue) !== null && _f !== void 0 ? _f : this.noValueMessage}`}">
|
|
87
88
|
${chip}
|
|
88
89
|
</ft-tooltip>
|
|
89
90
|
`;
|
|
@@ -171,8 +172,8 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
171
172
|
(_d = this.stateManager) === null || _d === void 0 ? void 0 : _d.unregisterMetadataForSwitchToRelatives(this.key);
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
|
-
if ((props.has("metadata") || this.dateFormatOptionsChanged(props)) && this.metadata) {
|
|
175
|
-
this.flatMetadata = ClusteringHelper.flattenMetadata(this.metadata, this.getDateFormatter(this.metadata.key));
|
|
175
|
+
if ((props.has("metadata") || props.has("hierarchicalValueTruncatingLevel") || this.dateFormatOptionsChanged(props)) && this.metadata) {
|
|
176
|
+
this.flatMetadata = ClusteringHelper.flattenMetadata(this.metadata, this.hierarchicalValueTruncatingLevel, this.getDateFormatter(this.metadata.key));
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
get metadataLabel() {
|
|
@@ -205,6 +206,9 @@ __decorate([
|
|
|
205
206
|
__decorate([
|
|
206
207
|
property({ type: Boolean })
|
|
207
208
|
], FtReaderMetadata.prototype, "displayLabel", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property({ type: Number })
|
|
211
|
+
], FtReaderMetadata.prototype, "hierarchicalValueTruncatingLevel", void 0);
|
|
208
212
|
__decorate([
|
|
209
213
|
property({ attribute: false })
|
|
210
214
|
], FtReaderMetadata.prototype, "editorMode", void 0);
|