@fluid-topics/ft-search-input 1.2.7 → 1.2.8
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.
|
@@ -12,7 +12,6 @@ export declare class FtSearchInputSuggestion extends FtSearchComponent implement
|
|
|
12
12
|
launchSearchPath?: string;
|
|
13
13
|
render(): import("lit").TemplateResult<1>;
|
|
14
14
|
private renderSuggestion;
|
|
15
|
-
private onSuggestLinkClick;
|
|
16
15
|
private onSuggestKeyDown;
|
|
17
16
|
private onSuggestKeyUp;
|
|
18
17
|
private onSuggestSelected;
|
|
@@ -33,6 +33,11 @@ let FtSearchInputSuggestion = class FtSearchInputSuggestion extends FtSearchComp
|
|
|
33
33
|
`;
|
|
34
34
|
}
|
|
35
35
|
renderSuggestion(suggest, searchPlaceConverter) {
|
|
36
|
+
const content = html `
|
|
37
|
+
<ft-ripple></ft-ripple>
|
|
38
|
+
${this.getIcon(suggest)}
|
|
39
|
+
<ft-typography variant="body1">${suggest.value}</ft-typography>
|
|
40
|
+
`;
|
|
36
41
|
if (this.launchSearchPath) {
|
|
37
42
|
const suggestRequest = { ...this.request, query: suggest.value };
|
|
38
43
|
const launchSuggestUrl = searchPlaceConverter.serializeToCurrentPageIfPossible(suggestRequest, this.launchSearchPath);
|
|
@@ -41,10 +46,8 @@ let FtSearchInputSuggestion = class FtSearchInputSuggestion extends FtSearchComp
|
|
|
41
46
|
part="suggestion"
|
|
42
47
|
class="ft-search-input-suggestion--suggestion"
|
|
43
48
|
@keyup=${(e) => this.onSuggestKeyUp(e)}
|
|
44
|
-
@click=${(
|
|
45
|
-
|
|
46
|
-
${this.getIcon(suggest)}
|
|
47
|
-
<ft-typography variant="body1">${suggest.value}</ft-typography>
|
|
49
|
+
@click=${() => this.onSuggestSelected(suggest.value)}>
|
|
50
|
+
${content}
|
|
48
51
|
</a>
|
|
49
52
|
`;
|
|
50
53
|
}
|
|
@@ -53,20 +56,11 @@ let FtSearchInputSuggestion = class FtSearchInputSuggestion extends FtSearchComp
|
|
|
53
56
|
part="suggestion"
|
|
54
57
|
class="ft-search-input-suggestion--suggestion"
|
|
55
58
|
@keyup=${(e) => this.onSuggestKeyUp(e)}
|
|
56
|
-
@click=${(
|
|
57
|
-
|
|
58
|
-
${this.getIcon(suggest)}
|
|
59
|
-
<ft-typography variant="body1">${suggest.value}</ft-typography>
|
|
59
|
+
@click=${() => this.onSuggestSelected(suggest.value)}>
|
|
60
|
+
${content}
|
|
60
61
|
</div>
|
|
61
62
|
`;
|
|
62
63
|
}
|
|
63
|
-
onSuggestLinkClick(e, suggest) {
|
|
64
|
-
if (!e.metaKey && !e.ctrlKey) {
|
|
65
|
-
e.preventDefault();
|
|
66
|
-
e.stopPropagation();
|
|
67
|
-
}
|
|
68
|
-
this.onSuggestSelected(suggest.value);
|
|
69
|
-
}
|
|
70
64
|
onSuggestKeyDown(e) {
|
|
71
65
|
var _a, _b, _c, _d, _e, _f;
|
|
72
66
|
switch (e.key) {
|