Skip to content

Commit

Permalink
feat(ui5-input): provide "Information" value state (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhan007 committed Mar 2, 2020
1 parent 6a72021 commit 77f7293
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/base/src/types/ValueState.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const ValueStates = {
Success: "Success",
Warning: "Warning",
Error: "Error",
Information: "Information",
};

class ValueState extends DataType {
Expand Down
6 changes: 6 additions & 0 deletions packages/main/src/themes/Input.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@
:host([value-state="Success"]:not([readonly])) {
background-color: var(--sapField_SuccessBackground);
border-color: var(--sapField_SuccessColor);
border-width: 1px;
}

:host([value-state="Information"]:not([readonly])) {
background-color: var(--sapField_InformationBackground);
border-color: var(--sapField_InformationColor);
}

/* Remove IE's defaut clear button */
Expand Down
8 changes: 8 additions & 0 deletions packages/main/src/themes/TextArea.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@
border-width: 1px;
}

:host([value-state="Information"]:not([readonly])) {
border-color: var(--sapField_InformationColor);
}

:host([value-state="Information"]:not([readonly])) .ui5-textarea-inner {
background-color: var(--sapField_InformationBackground);
}

.ui5-textarea-exceeded-text {
overflow: hidden;
align-self: flex-end;
Expand Down
20 changes: 20 additions & 0 deletions packages/main/test/pages/Input.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ <h3> Input valueState Success</h3>
<ui5-icon slot="icon" name="message-success"></ui5-icon>
</ui5-input>

<h3> Input valueState Information</h3>
<ui5-input value-state="Information" placeholder="Info state ...">
<ui5-icon slot="icon" name="message-information"></ui5-icon>
</ui5-input>

<h3> Test 'change' event</h3>
<ui5-input id="input1" value-state="Warning" placeholder="Warning state ...">
<ui5-icon slot="icon" name="message-warning"></ui5-icon>
Expand Down Expand Up @@ -119,6 +124,12 @@ <h3> Inputs alignment</h3>
title='Delivery Date!'>
</ui5-datepicker>

<ui5-datepicker
placeholder='Delivery Date...'
value-state="Information"
title='Delivery Date!'>
</ui5-datepicker>

<ui5-select id="mySelect2">
<ui5-option>Cozy</ui5-option>
<ui5-option selected>Compact</ui5-option>
Expand All @@ -128,12 +139,21 @@ <h3> Inputs alignment</h3>
<ui5-input value="input" value-state="Error">
<ui5-icon slot="icon" name="message-warning"></ui5-icon>
</ui5-input>

<ui5-select id="mySelect2" value-state="Error">
<ui5-option>Cozy</ui5-option>
<ui5-option selected>Compact</ui5-option>
<ui5-option>Condensed</ui5-option>
</ui5-select>

<ui5-select value-state="Information">
<ui5-option>Cozy</ui5-option>
<ui5-option selected>Compact</ui5-option>
<ui5-option>Condensed</ui5-option>
</ui5-select>

<ui5-multi-combobox value-state="Error"></ui5-multi-combobox>
<ui5-multi-combobox value-state="Information"></ui5-multi-combobox>

<h3> Input with multiple icons</h3>
<ui5-input id="input3" placeholder="Search ...">
Expand Down
4 changes: 4 additions & 0 deletions packages/main/test/pages/TextArea.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
<ui5-textarea id="basic-textarea-success" value="Test" value-state="Success"></ui5-textarea>
<br>
<br>

<br>
<br>
<ui5-textarea id="basic-textarea-error" value="Test" value-state="Information"></ui5-textarea>
</section>

<section class="group">
Expand Down
2 changes: 2 additions & 0 deletions packages/main/test/samples/Input.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ <h3>Input with Value State</h3>
<ui5-input class="samples-margin samples-responsive-margin-bottom" value="Success" value-state="Success"></ui5-input>
<ui5-input class="samples-margin samples-responsive-margin-bottom" value="Warning" value-state="Warning"></ui5-input>
<ui5-input class="samples-margin samples-responsive-margin-bottom" value="Error" value-state="Error"></ui5-input>
<ui5-input class="samples-margin samples-responsive-margin-bottom" value="Information" value-state="Information"></ui5-input>
</div>
<pre class="prettyprint lang-html"><xmp>
<ui5-input value="Success" value-state="Success"></ui5-input>
<ui5-input value="Warning" value-state="Warning"></ui5-input>
<ui5-input value="Error" value-state="Error"></ui5-input>
<ui5-input class="samples-margin samples-responsive-margin-bottom" value="Information" value-state="Information"></ui5-input>
</xmp></pre>
</section>

Expand Down
10 changes: 10 additions & 0 deletions packages/main/test/samples/Select.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ <h3>Select with Value State</h3>
<ui5-option icon="meal">Tomato</ui5-option>
<ui5-option icon="meal" selected>Red Chili Pepper</ui5-option>
</ui5-select>
<ui5-select value-state="Information" class="select">
<ui5-option icon="meal">Blueberry</ui5-option>
<ui5-option icon="meal">Grape</ui5-option>
<ui5-option icon="meal" selected>Plum</ui5-option>
</ui5-select>
</div>
<pre class="prettyprint lang-html"><xmp>
<ui5-select value-state="Success" class="select">
Expand All @@ -85,6 +90,11 @@ <h3>Select with Value State</h3>
<ui5-option icon="meal">Strawberry</ui5-option>
<ui5-option icon="meal">Tomato</ui5-option>
<ui5-option icon="meal" selected>Red Chili Pepper</ui5-option>
</ui5-select>
<ui5-select value-state="Information" class="select">
<ui5-option icon="meal">Blueberry</ui5-option>
<ui5-option icon="meal">Grape</ui5-option>
<ui5-option icon="meal" selected>Plum</ui5-option>
</ui5-select>
</xmp></pre>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
--sapField_SuccessColor: @sapField_SuccessColor;
--sapField_SuccessBackground: @sapField_SuccessBackground;
--sapField_PlaceholderTextColor: @sapField_PlaceholderTextColor;
--sapField_InformationColor: @sapField_InformationColor;
--sapField_InformationBackground: @sapField_InformationBackground;

--sapGroup_TitleBackground: @sapGroup_TitleBackground;
--sapGroup_BorderWidth: @sapGroup_BorderWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
@sapField_SuccessBackground: @sapField_Background;
@sapField_ReadOnly_Background: fade(darken(@sapField_Background, 5), 50);
@sapField_PlaceholderTextColor: lighten(@sapField_TextColor, 46);
@sapField_InformationColor: @sapInformationBorderColor;
@sapField_InformationBackground: @sapField_Background;

@sapGroup_TitleBackground: transparent;
@sapGroup_BorderWidth: @sapElement_BorderWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@
--sapField_SuccessColor: @sapField_SuccessColor;
--sapField_SuccessBackground: @sapField_SuccessBackground;
--sapField_PlaceholderTextColor: @sapField_PlaceholderTextColor;
--sapField_InformationColor: @sapField_InformationColor;
--sapField_InformationBackground: @sapField_InformationBackground;

--sapGroup_TitleBackground: @sapGroup_TitleBackground;
--sapGroup_TitleBorderColor: @sapGroup_TitleBorderColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
@sapField_SuccessColor: @sapField_BorderColor;
@sapField_SuccessBackground: @sapField_Background;
@sapField_PlaceholderTextColor: @sapField_TextColor;
@sapField_InformationColor: @sapInformationBorderColor;
@sapField_InformationBackground: @sapField_Background;

@sapGroup_TitleBackground: @sapBackgroundColor;
@sapGroup_TitleBorderColor: @sapHC_StandardForeground;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@
--sapField_SuccessColor: @sapField_SuccessColor;
--sapField_SuccessBackground: @sapField_SuccessBackground;
--sapField_PlaceholderTextColor: @sapField_PlaceholderTextColor;
--sapField_InformationColor: @sapField_InformationColor;
--sapField_InformationBackground: @sapField_InformationBackground;

--sapGroup_TitleBackground: @sapGroup_TitleBackground;
--sapGroup_TitleBorderColor: @sapGroup_TitleBorderColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@
@sapField_SuccessColor: @sapField_BorderColor;
@sapField_SuccessBackground: @sapField_Background;
@sapField_PlaceholderTextColor: @sapField_TextColor;
@sapField_InformationColor: @sapInformationBorderColor;
@sapField_InformationBackground: @sapField_Background;

@sapGroup_TitleBackground: @sapBackgroundColor;
@sapGroup_TitleBorderColor: @sapHC_StandardForeground;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
--sapField_WarningBackground: @sapField_WarningBackground;
--sapField_SuccessColor: @sapField_SuccessColor;
--sapField_SuccessBackground: @sapField_SuccessBackground;
--sapField_InformationColor: @sapField_InformationColor;
--sapField_InformationBackground: @sapField_InformationBackground;

--sapGroup_TitleBackground: @sapGroup_TitleBackground;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
@sapField_WarningBackground: @sapField_Background;
@sapField_SuccessColor: @sapSuccessBorderColor;
@sapField_SuccessBackground: @sapField_Background;
@sapField_InformationColor: @sapInformationBorderColor;
@sapField_InformationBackground: @sapField_Background;

@sapGroup_TitleBackground: transparent;
@sapGroup_ContentBackground: @sapBaseColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@
--sapField_WarningBackground: @sapField_WarningBackground;
--sapField_SuccessColor: @sapField_SuccessColor;
--sapField_SuccessBackground: @sapField_SuccessBackground;


--sapField_InformationColor: @sapField_InformationColor;
--sapField_InformationBackground: @sapField_InformationBackground;

--sapGroup_TitleBackground: @sapGroup_TitleBackground;
--sapGroup_ContentBackground: @sapGroup_ContentBackground;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
@sapField_WarningBackground: @sapField_Background;
@sapField_SuccessColor: @sapSuccessBorderColor;
@sapField_SuccessBackground: @sapField_Background;

@sapField_InformationColor: @sapInformationBorderColor;
@sapField_InformationBackground: @sapField_Background;

@sapGroup_TitleBackground: transparent;
@sapGroup_ContentBackground: @sapBaseColor;
Expand Down

0 comments on commit 77f7293

Please sign in to comment.