Skip to content

Commit

Permalink
refactor: rename ValueState values (#8864)
Browse files Browse the repository at this point in the history
The base ValueState enum values have been changed from ValueState.Warning, ValueState.Error and ValueState.Success to ValueState.Critical, ValueState.Negative and ValueState.Positive, causing changes in multiple components supporting valueState property (+ properties of similar type as Dialog.state, StandardListItem.highlight and MessageStrip.design).

BREAKING CHANGE: If you previously used ValueState.Warning, ValueState.Error or ValueState.Success, start using ValueState.Critical, ValueState.Negative and ValueState.Positive respectively. 
All components with valueState property are also affected. For example:
```html
<ui5-input value-state="Success"></ui5-input>
<ui5-input value-state="Warning"></ui5-input>
<ui5-input value-state="Error"></ui5-input>
```
```html
<ui5-input value-state="Positive"></ui5-input>
<ui5-input value-state="Critical"></ui5-input>
<ui5-input value-state="Negative"></ui5-input>
```

Related to: #8461
  • Loading branch information
ilhan007 committed Apr 27, 2024
1 parent 372d27d commit ef9304d
Show file tree
Hide file tree
Showing 125 changed files with 1,168 additions and 758 deletions.
6 changes: 3 additions & 3 deletions docs/1-getting-started/03-understanding-components-APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ names are "kebab-case" (e.g. `value-state`) while property names are "camelCase"
Attributes can be set directly on the web component in HTML.

```html
<ui5-checkbox id="cb" value-state="Error"></ui5-checkbox>
<ui5-checkbox id="cb" value-state="Negative"></ui5-checkbox>
```

Properties can only be set programmatically.
Expand All @@ -53,14 +53,14 @@ To set a property:

```js
const myCb = document.getElementById("cb");
myCb.valueState = "Error";
myCb.valueState = "Negative";
```

To set an attribute:

```js
const myCb = document.getElementById("cb");
myCb.setAttribute("value-state", "Error");
myCb.setAttribute("value-state", "Negative");
```

A note on Boolean attributes: in HTML Boolean attributes may have no value
Expand Down

0 comments on commit ef9304d

Please sign in to comment.