@fluid-topics/ft-search-result-title 1.2.50 → 1.2.52
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,6 +7,7 @@ export declare class FtSearchResultTitle extends FtSearchResultComponent impleme
|
|
|
7
7
|
static elementDefinitions: ElementDefinitionsMap;
|
|
8
8
|
static styles: import("lit").CSSResult;
|
|
9
9
|
protected render(): typeof nothing | TemplateResult;
|
|
10
|
+
onAuxClick(e: MouseEvent): void;
|
|
10
11
|
private renderTitle;
|
|
11
12
|
private onResultClick;
|
|
12
13
|
private selectTitle;
|
|
@@ -27,12 +27,18 @@ class FtSearchResultTitle extends FtSearchResultComponent {
|
|
|
27
27
|
: html `
|
|
28
28
|
<a href="${getResultUrl(this.result)}"
|
|
29
29
|
@click=${this.onResultClick}
|
|
30
|
+
@auxclick=${(e) => this.onAuxClick(e)}
|
|
30
31
|
target="${getResultTarget(this.result, (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.openExternalDocumentInNewTab)}"
|
|
31
32
|
part="link">
|
|
32
33
|
${this.renderTitle()}
|
|
33
34
|
</a>
|
|
34
35
|
`;
|
|
35
36
|
}
|
|
37
|
+
onAuxClick(e) {
|
|
38
|
+
if (e.button == 1) {
|
|
39
|
+
this.onResultClick();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
36
42
|
renderTitle() {
|
|
37
43
|
return html `
|
|
38
44
|
<ft-typography variant="title" part="text">${unsafeHTML(this.selectTitle(this.result))}</ft-typography>
|
|
@@ -53,8 +59,17 @@ class FtSearchResultTitle extends FtSearchResultComponent {
|
|
|
53
59
|
return "";
|
|
54
60
|
}
|
|
55
61
|
contentAvailableCallback(props) {
|
|
62
|
+
var _a;
|
|
56
63
|
super.contentAvailableCallback(props);
|
|
57
64
|
this.shadowRoot.querySelectorAll(".kwicmatch").forEach(match => match.setAttribute("part", "kwicmatch"));
|
|
65
|
+
if (!this.withoutLink && props.has("rank") && this.rank != undefined) {
|
|
66
|
+
const focusCommand = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.store.commands.consume(`focus-result-${this.rank}`);
|
|
67
|
+
if (focusCommand) {
|
|
68
|
+
this.elementToFocus = {
|
|
69
|
+
selector: `a`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
58
73
|
}
|
|
59
74
|
}
|
|
60
75
|
FtSearchResultTitle.elementDefinitions = {
|