Skip to content

Commit

Permalink
fix(ui5-table): add the missing headerRow dependency
Browse files Browse the repository at this point in the history
- Busy indicator dim background is added
- Explicit header row height is removed
- Multiple selection mode sample is fixed
- Navigated outline is aligned with spec
  • Loading branch information
aborjinik committed Jul 22, 2024
1 parent ca153d0 commit af337ef
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 11 deletions.
3 changes: 2 additions & 1 deletion packages/main/src/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
import TableTemplate from "./generated/templates/TableTemplate.lit.js";
import TableStyles from "./generated/themes/Table.css.js";
import TableRow from "./TableRow.js";
import type TableHeaderRow from "./TableHeaderRow.js";
import TableHeaderRow from "./TableHeaderRow.js";
import type TableHeaderCell from "./TableHeaderCell.js";
import TableExtension from "./TableExtension.js";
import type TableSelection from "./TableSelection.js";
Expand Down Expand Up @@ -160,6 +160,7 @@ type TableRowClickEventDetail = {
fastNavigation: true,
dependencies: [
BusyIndicator,
TableHeaderRow,
TableCell,
TableRow,
],
Expand Down
4 changes: 3 additions & 1 deletion packages/main/src/TableRow.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{{/each}}

{{#if _renderNavigated}}
<ui5-table-cell id="navigated-cell" excluded-from-navigation></ui5-table-cell>
<ui5-table-cell id="navigated-cell" excluded-from-navigation>
<div id="navigated"></div>
</ui5-table-cell>
{{/if}}

{{#if _popinCells.length}}
Expand Down
4 changes: 4 additions & 0 deletions packages/main/src/themes/Table.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@
inset: 0;
height: 100%;
z-index: 2;
}

#loading[_is-busy] {
background-color: var(--_ui5_busy_indicator_block_layer);
}
1 change: 0 additions & 1 deletion packages/main/src/themes/TableHeaderRow.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
:host {
background: var(--sapList_HeaderBackground);
grid-template-rows: var(--_ui5_list_item_base_height);
border-bottom: var(--sapList_BorderWidth) solid var(--sapList_HeaderBorderColor);
}

Expand Down
16 changes: 15 additions & 1 deletion packages/main/src/themes/TableRow.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,29 @@
}

#navigated-cell {
position: relative;
overflow: visible;
grid-row: span 2;
min-width: 0;
padding: 0;
}

:host([navigated]) #navigated-cell {
:host([navigated]) #navigated {
position: absolute;
inset: 0;
background-color: var(--sapList_SelectionBorderColor);
}

:host([tabindex]:focus) #navigated {
transform: translateX(calc(var(--_ui5_table_navigated_cell_width) * -1));
bottom: 2px;
top: 3px;
}

:host([tabindex]:focus) #navigated:dir(rtl) {
transform: translateX(var(--_ui5_table_navigated_cell_width));
}

:host([navigated]) #popin-cell {
grid-column: 1 / -2;
}
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,5 +1,5 @@
:root {
--_ui5_table_cell_valign: center;
--_ui5_table_cell_min_width: 2.75rem;
--_ui5_table_navigated_cell_width: 0.25rem;
--_ui5_table_navigated_cell_width: 0.1875rem;
}
10 changes: 5 additions & 5 deletions packages/main/test/specs/Table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ describe("Table - Navigated Rows", async () => {
assert.strictEqual(await navigatedCell1.getAttribute("excluded-from-navigation"), "", "The navigated cell is excluded from item navigation");
assert.strictEqual(await navigatedCell2.getAttribute("excluded-from-navigation"), "", "The navigated cell is excluded from item navigation");

const navigatedCell1BG = await browser.executeAsync(done => {
done(getComputedStyle(document.getElementById("row1").shadowRoot.querySelector("#navigated-cell")).backgroundColor);
const navigated1BG = await browser.executeAsync(done => {
done(getComputedStyle(document.getElementById("row1").shadowRoot.querySelector("#navigated")).backgroundColor);
});
const navigatedCell2BG = await browser.executeAsync(done => {
done(getComputedStyle(document.getElementById("row2").shadowRoot.querySelector("#navigated-cell")).backgroundColor);
const navigated2BG = await browser.executeAsync(done => {
done(getComputedStyle(document.getElementById("row2").shadowRoot.querySelector("#navigated")).backgroundColor);
});
assert.notEqual(navigatedCell1BG, navigatedCell2BG, "Background color of navigated cell is different from the one of non-navigated cell");
assert.notEqual(navigated1BG, navigated2BG, "Background color of navigated cell is different from the one of non-navigated cell");

const gridTemplateColumns = await browser.executeAsync(done => {
done(document.getElementById("table1").shadowRoot.querySelector("#table").style.gridTemplateColumns);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "@ui5/webcomponents/dist/Table.js";
import "@ui5/webcomponents/dist/TableHeaderRow.js";
import "@ui5/webcomponents/dist/TableHeaderCell.js";
import "@ui5/webcomponents/dist/TableSelection.js";
import "@ui5/webcomponents/dist/Label.js";
import "@ui5/webcomponents/dist/Input.js";
import "@ui5/webcomponents/dist/ComboBox.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="section">
<!-- playground-fold-end -->
<div id="selectionGroup" role="radiogroup">
<ui5-radio-button name="selection" text="Multi" checked></ui5-radio-button>
<ui5-radio-button name="selection" text="Multiple" checked></ui5-radio-button>
<ui5-radio-button name="selection" text="Single"></ui5-radio-button>
<ui5-radio-button name="selection" text="None"></ui5-radio-button>
</div>
Expand Down

0 comments on commit af337ef

Please sign in to comment.