Skip to content

Commit

Permalink
refactor(ui5-list): refactored HighlightTypes (#9061)
Browse files Browse the repository at this point in the history
The HighlightTypes file and all its usages are now referred as Highlight.

BREAKING CHANGE: `Highlight` enum should be imported differently.
Before: 
```js
import HighlightTypes from "@ui5/webcomponents-base/dist/types/HighlightTypes.js";
```

Now:
```js
import Highlight from "@ui5/webcomponents-base/dist/types/Highlight.js";
```


Related to: #8461
  • Loading branch information
plamenivanov91 committed May 27, 2024
1 parent b6407fd commit 2510224
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/main/src/ListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
import type AriaHasPopup from "@ui5/webcomponents-base/dist/types/AriaHasPopup.js";
import "@ui5/webcomponents-icons/dist/decline.js";
import "@ui5/webcomponents-icons/dist/edit.js";
import HighlightTypes from "./types/HighlightTypes.js";
import Highlight from "./types/Highlight.js";
import ListItemType from "./types/ListItemType.js";
import ListSelectionMode from "./types/ListSelectionMode.js";
import ListItemBase from "./ListItemBase.js";
Expand Down Expand Up @@ -160,8 +160,8 @@ abstract class ListItem extends ListItemBase {
* @public
* @since 1.24
*/
@property({ type: HighlightTypes, defaultValue: HighlightTypes.None })
highlight!: `${HighlightTypes}`;
@property({ type: Highlight, defaultValue: Highlight.None })
highlight!: `${Highlight}`;

/**
* Used to define the role of the list item.
Expand Down Expand Up @@ -462,7 +462,7 @@ abstract class ListItem extends ListItemBase {
}

get _hasHighlightColor() {
return this.highlight !== HighlightTypes.None;
return this.highlight !== Highlight.None;
}

get hasConfigurableMode() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Different types of HighlightTypes .
* Different types of Highlight .
*
* @public
*/
enum HighlightTypes {
enum Highlight {
/**
* @public
*/
Expand All @@ -30,4 +30,4 @@ enum HighlightTypes {
Information = "Information",
}

export default HighlightTypes;
export default Highlight;

0 comments on commit 2510224

Please sign in to comment.