Skip to content

Commit

Permalink
[INTERNAL] Tables: Support Indication09 and Indication10 for row high…
Browse files Browse the repository at this point in the history
…lighting

Jira: CPOUIFTEAMB-2427
Fixes: #4119
Change-Id: Iea16b501d4cd0a6915c49899dd76099577caf7e7
  • Loading branch information
simlin committed Nov 8, 2024
1 parent 9358699 commit 7e512f2
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/sap.m/src/sap/m/ListItemBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ function(
* Defines the highlight state of the list items.
*
* Valid values for the <code>highlight</code> property are values of the enumerations {@link sap.ui.core.MessageType} or
* {@link sap.ui.core.IndicationColor}.
* {@link sap.ui.core.IndicationColor} (only values of <code>Indication01</code> to <code>Indication10</code> are supported
* for accessibility contrast reasons).
*
* Accessibility support is provided through the associated {@link sap.m.ListItemBase#setHighlightText highlightText} property.
* If the <code>highlight</code> property is set to a value of {@link sap.ui.core.MessageType}, the <code>highlightText</code>
Expand Down
8 changes: 8 additions & 0 deletions src/sap.m/src/sap/m/themes/base/ListItemBase.less
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@
background: var(--sapIndicationColor_8);
}

.sapMLIBHighlightIndication09 {
background: var(--sapIndicationColor_9);
}

.sapMLIBHighlightIndication10 {
background: var(--sapIndicationColor_10);
}

:not(.sapMListModeDelete) > .sapMLIB.sapMLIBTypeNavigation {
padding-right: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sap.m/test/sap/m/qunit/ListBase.qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,7 @@ sap.ui.define([
assert.ok(oLI.getDomRef().firstChild.classList.contains("sapMLIBHighlight" + sHighlight), sHighlight + " Highlight is rendered");
};

const aHighlightColors = ["Error", "Warning", "Success", "Information", "Indication01", "Indication02", "Indication03", "Indication04", "Indication05"];
const aHighlightColors = ["Error", "Warning", "Success", "Information", "Indication01", "Indication02", "Indication03", "Indication04", "Indication05", "Indication06", "Indication07", "Indication08", "Indication09", "Indication10"];
for (let i = 0; i < aHighlightColors.length; i++) {
await fnTestHighlight(aHighlightColors[i]);
}
Expand Down
3 changes: 2 additions & 1 deletion src/sap.ui.mdc/src/sap/ui/mdc/table/RowSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ sap.ui.define([
*
* If the highlight is set to {@link sap.ui.core.MessageType sap.ui.core.MessageType.None} (default), no highlights are visible.
* Valid values for the <code>highlight</code> property are values of the enumerations {@link sap.ui.core.MessageType} or
* {@link sap.ui.core.IndicationColor}.
* {@link sap.ui.core.IndicationColor} (only values of <code>Indication01</code> to <code>Indication10</code> are supported
* for accessibility contrast reasons).
*
* Accessibility support is provided with the {@link sap.ui.mdc.table.RowSettings#setHighlightText highlightText} property.
* If the <code>highlight</code> property is set to a value of {@link sap.ui.core.MessageType}, the <code>highlightText</code>
Expand Down
3 changes: 2 additions & 1 deletion src/sap.ui.table/src/sap/ui/table/RowSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ sap.ui.define([
*
* If the highlight is set to {@link sap.ui.core.MessageType sap.ui.core.MessageType.None} (default), no highlights are visible.
* Valid values for the <code>highlight</code> property are values of the enumerations {@link sap.ui.core.MessageType} or
* {@link sap.ui.core.IndicationColor}.
* {@link sap.ui.core.IndicationColor} (only values of <code>Indication01</code> to <code>Indication10</code> are supported
* for accessibility contrast reasons).
*
* Accessibility support is provided through the associated {@link sap.ui.table.RowSettings#setHighlightText highlightText} property.
* If the <code>highlight</code> property is set to a value of {@link sap.ui.core.MessageType}, the <code>highlightText</code>
Expand Down
10 changes: 10 additions & 0 deletions src/sap.ui.table/src/sap/ui/table/themes/base/RowHighlight.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
@_sap_ui_table_RowHighlight_Indication06Color: @sapUiIndication6;
@_sap_ui_table_RowHighlight_Indication07Color: @sapUiIndication7;
@_sap_ui_table_RowHighlight_Indication08Color: @sapUiIndication8;
@_sap_ui_table_RowHighlight_Indication09Color: @sapUiIndication9;
@_sap_ui_table_RowHighlight_Indication10Color: @sapUiIndication10;

.sapUiTableRowHighlight {
height: 100%;
Expand Down Expand Up @@ -77,4 +79,12 @@
&.sapUiTableRowHighlightIndication08 {
background-color: @_sap_ui_table_RowHighlight_Indication08Color;
}

&.sapUiTableRowHighlightIndication09 {
background-color: @_sap_ui_table_RowHighlight_Indication09Color;
}

&.sapUiTableRowHighlightIndication10 {
background-color: @_sap_ui_table_RowHighlight_Indication10Color;
}
}
14 changes: 13 additions & 1 deletion src/sap.ui.table/test/sap/ui/table/qunit/RowSettings.qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ sap.ui.define([
{highlight: IndicationColor.Indication05},
{highlight: IndicationColor.Indication06},
{highlight: IndicationColor.Indication07},
{highlight: IndicationColor.Indication08}
{highlight: IndicationColor.Indication08},
{highlight: IndicationColor.Indication09},
{highlight: IndicationColor.Indication10}
]),
columns: TableQUnitUtils.createTextColumn(),
rowMode: new FixedRowMode({
Expand Down Expand Up @@ -161,6 +163,12 @@ sap.ui.define([
case IndicationColor.Indication08:
sRGBBackgroundColor = this.getColorRgb("sapUiIndication8");
break;
case IndicationColor.Indication09:
sRGBBackgroundColor = this.getColorRgb("sapUiIndication9");
break;
case IndicationColor.Indication10:
sRGBBackgroundColor = this.getColorRgb("sapUiIndication10");
break;
default:
sRGBBackgroundColor = "transparent"; // transparent
}
Expand Down Expand Up @@ -316,6 +324,10 @@ sap.ui.define([
sCSSClassName += "Indication07";
} else if (iRowIndex === 12) {
sCSSClassName += "Indication08";
} else if (iRowIndex === 13) {
sCSSClassName += "Indication09";
} else if (iRowIndex === 14) {
sCSSClassName += "Indication10";
}

assert.strictEqual(oRowSettings._getHighlightCSSClassName(), sCSSClassName,
Expand Down

0 comments on commit 7e512f2

Please sign in to comment.