Skip to content

Commit e53301d

Browse files
yanaminkovapskelindobrinyonkov
authored
refactor(ui5-li): selected property changed to private (#9246)
The selected property of the ui5-li has been redefined within the class where it is actively utilized. Despite this change, it remains accessible to all components that rely on it. Related to #8461, #7887 --------- Co-authored-by: Peter Skelin <[email protected]> Co-authored-by: Dobrin Dimchev <[email protected]>
1 parent e84c2e5 commit e53301d

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

packages/main/src/ListItem.ts

+8
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ abstract class ListItem extends ListItemBase {
164164
@property()
165165
highlight: `${Highlight}` = "None";
166166

167+
/**
168+
* Defines the selected state of the component.
169+
* @default false
170+
* @public
171+
*/
172+
@property({ type: Boolean })
173+
declare selected: boolean;
174+
167175
/**
168176
* Used to define the role of the list item.
169177
* @private

packages/main/src/ListItemBase.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ListItemBase extends UI5Element implements ITabbable {
4848
/**
4949
* Defines the selected state of the component.
5050
* @default false
51-
* @public
51+
* @private
5252
*/
5353
@property({ type: Boolean })
5454
selected = false;

packages/main/src/MenuSeparator.ts

-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
2-
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
32
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
43
import type { ClassMap } from "@ui5/webcomponents-base/dist/types.js";
54
import menuSeparatorTemplate from "./generated/templates/MenuSeparatorTemplate.lit.js";
@@ -27,14 +26,6 @@ import type { IMenuItem } from "./Menu.js";
2726
})
2827

2928
class MenuSeparator extends ListItemBase implements IMenuItem {
30-
/**
31-
* **Note:** This property is inherited and not supported. If set, it won't take any effect.
32-
* @default false
33-
* @public
34-
*/
35-
@property({ type: Boolean })
36-
declare selected: boolean;
37-
3829
get isSeparator() {
3930
return true;
4031
}

packages/main/src/Option.ts

+8
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ class Option extends ListItemBase implements IOption {
9090
@property()
9191
tooltip?: string;
9292

93+
/**
94+
* Defines the selected state of the component.
95+
* @default false
96+
* @public
97+
*/
98+
@property({ type: Boolean })
99+
declare selected: boolean;
100+
93101
get displayIconBegin(): boolean {
94102
return !!this.icon;
95103
}

packages/main/src/OptionCustom.ts

+8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ class OptionCustom extends ListItemBase implements IOption {
7272
@property()
7373
tooltip?: string;
7474

75+
/**
76+
* Defines the selected state of the component.
77+
* @default false
78+
* @public
79+
*/
80+
@property({ type: Boolean })
81+
declare selected: boolean;
82+
7583
get effectiveDisplayText() {
7684
return this.displayText || this.textContent || "";
7785
}

0 commit comments

Comments
 (0)