-
Notifications
You must be signed in to change notification settings - Fork 274
/
Copy pathCustomListItem.js
81 lines (68 loc) · 1.53 KB
/
CustomListItem.js
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import ListItem from "./ListItem.js";
import CustomListItemTemplate from "./generated/templates/CustomListItemTemplate.lit.js";
// Styles
import customListItemCss from "./generated/themes/CustomListItem.css.js";
/**
* @public
*/
const metadata = {
tag: "ui5-li-custom",
slots: /** @lends sap.ui.webcomponents.main.CustomListItem.prototype */ {
/**
* Defines the content of the <code>ui5-li-custom</code>.
* @type {Node[]}
* @slot
* @public
*/
"default": {
type: Node,
},
},
properties: /** @lends sap.ui.webcomponents.main.CustomListItem.prototype */ {
},
};
/**
* @class
*
* A component to be used as custom list item within the <code>ui5-list</code>
* the same way as the standard <code>ui5-li</code>.
*
* The <code>ui5-li-custom</code> accepts arbitrary HTML content to allow full customization.
*
* @constructor
* @author SAP SE
* @alias sap.ui.webcomponents.main.CustomListItem
* @extends ListItem
* @tagname ui5-li-custom
* @public
*/
class CustomListItem extends ListItem {
static get metadata() {
return metadata;
}
static get template() {
return CustomListItemTemplate;
}
static get styles() {
return [ListItem.styles, customListItemCss];
}
_onkeydown(event) {
if (!this.focused) {
return;
}
super._onkeydown(event);
}
_onkeyup(event) {
if (!this.focused) {
return;
}
super._onkeyup(event);
}
get classes() {
const result = super.classes;
result.main["ui5-custom-li-root"] = true;
return result;
}
}
CustomListItem.define();
export default CustomListItem;