-
Notifications
You must be signed in to change notification settings - Fork 279
Expand file tree
/
Copy pathSearchItemTemplate.tsx
More file actions
67 lines (60 loc) · 2 KB
/
SearchItemTemplate.tsx
File metadata and controls
67 lines (60 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import Icon from "@ui5/webcomponents/dist/Icon.js";
import type SearchItem from "./SearchItem.js";
import Tag from "@ui5/webcomponents/dist/Tag.js";
import Button from "@ui5/webcomponents/dist/Button.js";
import decline from "@ui5/webcomponents-icons/dist/decline.js";
import ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js";
import TagDesign from "@ui5/webcomponents/dist/types/TagDesign.js";
export default function SearchItemTemplate(this: SearchItem) {
return (
<li
part="native-li"
class="ui5-li-root ui5-li--focusable"
aria-selected={this.selected}
role="option"
data-sap-focus-ref
draggable={this.movable}
tabindex={this._effectiveTabIndex}
onFocusIn={this._onfocusin}
onFocusOut={this._onfocusout}
onKeyUp={this._onkeyup}
onKeyDown={this._onkeydown}
onClick={this._onclick}
>
<div part="content" class="ui5-search-item-content">
<div class="ui5-search-item-begin-content">
{this.image.length > 0 && !this.icon &&
<slot name="image"></slot>
}
{this.icon &&
<Icon class="ui5-search-item-icon" name={this.icon}></Icon>
}
{this.scopeName &&
<Tag design={TagDesign.Set2} colorScheme="10">
{this.scopeName}
</Tag>
}
<div class="ui5-search-item-titles-container">
<span part="title" class="ui5-search-item-text" dangerouslySetInnerHTML={{ __html: this._markupText }}></span>
<span part="subtitle" class="ui5-search-item-description">{this.description}</span>
</div>
<div class="ui5-search-item-actions-container">
{this.hasActions &&
<div class="ui5-search-item-actions">
<slot name="actions"></slot>
</div>
}
{this.deletable &&
<Button class="ui5-search-item-selected-delete"
design={ButtonDesign.Transparent}
icon={decline}
onClick={this._onDeleteButtonClick}
tooltip={this._deleteButtonTooltip}
onKeyDown={this._onDeleteButtonKeyDown}></Button>
}
</div>
</div>
</div>
</li >
);
}