-
Notifications
You must be signed in to change notification settings - Fork 274
/
Copy pathOptionCustom.ts
145 lines (130 loc) · 3.9 KB
/
OptionCustom.ts
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
import event from "@ui5/webcomponents-base/dist/decorators/event.js";
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
import CustomListItem from "./CustomListItem.js";
import { IButton } from "./Button.js";
import ListItemType from "./types/ListItemType.js";
import type { ListItemAccessibilityAttributes as CustomOptionAccessibilityAttributes } from "./ListItem.js";
import HighlightTypes from "./types/HighlightTypes.js";
import { IOption } from "./Select.js";
/**
* @class
*
* ### Overview
*
* The `ui5-option-custom` component defines a custom content of an option in the `ui5-select`.
* A component to be the same way as the standard `ui5-option`.
* The component accepts arbitrary HTML content to allow full customization.
*
* ### ES6 Module Import
*
* `import "@ui5/webcomponents/dist/OptionCustom.js";`
* @constructor
* @since 2.0.0
* @extends CustomListItem
* @public
*/
@customElement({
tag: "ui5-option-custom",
})
/**
* **Note:** The event is inherited and not supported. If used, it won't take any effect.
* @public
* @deprecated
*/
@event("detail-click")
class OptionCustom extends CustomListItem implements IOption {
/**
* Defines the text, displayed inside the `ui5-select` input filed
* when the option gets selected.
* @default ""
* @public
*/
@property()
displayText!: string;
/**
* Defines the value of the `ui5-select` inside an HTML Form element when this component is selected.
* For more information on HTML Form support, see the `name` property of `ui5-select`.
* @default ""
* @public
*/
@property()
value!: string;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default false
* @public
* @deprecated
*/
@property({ type: Boolean })
declare iconEnd: boolean;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default "Active"
* @public
* @deprecated
*/
@property({ type: ListItemType, defaultValue: ListItemType.Active })
declare type: `${ListItemType}`;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default {}
* @public
* @deprecated
*/
@property({ type: Object })
declare accessibilityAttributes: CustomOptionAccessibilityAttributes;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default false
* @public
* @deprecated
*/
@property({ type: Boolean })
declare navigated: boolean;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default "None"
* @public
* @deprecated
*/
@property({ type: HighlightTypes, defaultValue: HighlightTypes.None })
declare highlight: `${HighlightTypes}`;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default false
* @public
* @deprecated
*/
@property({ type: Boolean })
declare movable: boolean;
/**
* **Note:** The property is inherited and not supported. If set, it won't take any effect.
* @default ""
* @public
* @deprecated
*/
@property()
declare accessibleName: string;
/**
* **Note:** The slot is inherited and not supported. If set, it won't take any effect.
* @public
* @deprecated
*/
@slot()
declare deleteButton: Array<IButton>;
/**
* Defines the text of the component.
*
* **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
* @public
*/
@slot({ type: Node, "default": true, invalidateOnChildChange: true })
content!: Array<Node>;
get effectiveDisplayText() {
return this.displayText || this.textContent || "";
}
}
OptionCustom.define();
export default OptionCustom;