Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-table-row): add left and right borders #10285

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/main/src/Table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
{{#unless rows.length}}
<ui5-table-row id="nodata-row">
<ui5-table-cell id="nodata-cell" excluded-from-navigation>
<ui5-table-cell id="nodata-cell" excluded-from-navigation horizontal-align="center">
{{#if nodata.length}}
<slot name="nodata"></slot>
{{else}}
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/themes/Table.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#table {
display: grid;
grid-auto-rows: minmax(min-content, max-content);
background: var(--sapList_Background);
}

:host([overflow-mode="Scroll"]) #table {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/themes/TableHeaderRow.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:host {
background: var(--sapList_HeaderBackground);
border-top: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
border-bottom: var(--sapList_BorderWidth) solid var(--sapList_HeaderBorderColor);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/themes/TableRowBase.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
min-height: var(--_ui5_list_item_base_height);
box-sizing: border-box;
border-bottom: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
border-right: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
border-left: var(--sapList_BorderWidth) solid var(--sapList_BorderColor);
}

:host([tabindex]:focus) {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/base/Table-parameters.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:root {
--_ui5_table_cell_valign: center;
--_ui5_table_cell_min_width: 2.75rem;
--_ui5_table_navigated_cell_width: 0.1875rem;
--_ui5_table_navigated_cell_width: 0.25rem;
--_ui5_table_shadow_border_left: inset var(--sapContent_FocusWidth) 0 var(--sapContent_FocusColor);
--_ui5_table_shadow_border_right: inset calc(-1 * var(--sapContent_FocusWidth)) 0 var(--sapContent_FocusColor);
--_ui5_table_shadow_border_top: inset 0 var(--sapContent_FocusWidth) var(--sapContent_FocusColor);
Expand Down
29 changes: 15 additions & 14 deletions packages/main/test/specs/Table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ describe("Table - Popin Mode", async () => {
const headerCells = await headerRow.$$("ui5-table-header-cell");

const testWidths = [
{width: 850, poppedIn: []},
{width: 700, poppedIn: ["colD"]},
{width: 500, poppedIn: ["colD", "colC"]},
{width: 300, poppedIn: ["colD", "colC", "colB"]},
{width: 150, poppedIn: ["colD", "colC", "colB"]}
{width: 1000, poppedIn: []},
{width: 849, poppedIn: ["colD"]},
{width: 699, poppedIn: ["colD", "colC"]},
{width: 499, poppedIn: ["colD", "colC", "colB"]},
{width: 299, poppedIn: ["colD", "colC", "colB"]}
];

for (const testWidth of testWidths) {
Expand Down Expand Up @@ -87,13 +87,14 @@ describe("Table - Popin Mode", async () => {

const headerRow = await table.$("ui5-table-header-row");
const headerCells = await headerRow.$$("ui5-table-header-cell");
const borderWidth = 1;

const testWidths = [
{width: 150, poppedIn: ["colD", "colC", "colB"]},
{width: 300, poppedIn: ["colD", "colC", "colB"]},
{width: 500, poppedIn: ["colD", "colC"]},
{width: 700, poppedIn: ["colD"]},
{width: 850, poppedIn: []},
{width: 300 + borderWidth, poppedIn: ["colD", "colC", "colB"]},
{width: 500 + borderWidth, poppedIn: ["colD", "colC"]},
{width: 700 + borderWidth, poppedIn: ["colD"]},
{width: 850 + borderWidth, poppedIn: []},
];

for (const testWidth of testWidths) {
Expand Down Expand Up @@ -406,10 +407,10 @@ describe("Table - Horizontal alignment of cells", async () => {

const testWidths = [
{width: 1120, poppedIn: []},
{width: 900, poppedIn: ["priceCol"]},
{width: 800, poppedIn: ["priceCol", "weightCol"]},
{width: 500, poppedIn: ["priceCol", "weightCol", "dimensionsCol"]},
{width: 300, poppedIn: ["priceCol", "weightCol", "dimensionsCol", "supplierCol"]}
{width: 1119, poppedIn: ["priceCol"]},
{width: 899, poppedIn: ["priceCol", "weightCol"]},
{width: 799, poppedIn: ["priceCol", "weightCol", "dimensionsCol"]},
{width: 499, poppedIn: ["priceCol", "weightCol", "dimensionsCol", "supplierCol"]}
];

for (const testWidth of testWidths) {
Expand Down Expand Up @@ -567,7 +568,7 @@ describe("Table - Horizontal Scrolling", async () => {
});

assert.equal(leftOffset, 0, "Table is not scrolled horizontally");
assert.equal(fixedX, 0, "Selection column is fixed to the left");
assert.equal(fixedX, 1, "Selection column is fixed to the left");

await lastColumn.scrollIntoView();

Expand Down
Loading