Skip to content

Commit e4c0b51

Browse files
committed
wip
1 parent 1fc9b4d commit e4c0b51

File tree

2 files changed

+34
-23
lines changed

2 files changed

+34
-23
lines changed

packages/grid/src/styles/vaadin-grid-base-styles.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const gridStyles = css`
175175
}
176176
177177
:host([overflow~='bottom']) #table[has-footer] #footer::before,
178-
:host(:not([overflow~='top']):not([overflow~='bottom'])) #table[has-footer] #footer::before {
178+
:host(:not([overflow~='top'])) #table[has-footer] #footer::before {
179179
content: '';
180180
inset-block-start: calc(var(--_row-border-width) * -1);
181181
}
@@ -203,8 +203,9 @@ export const gridStyles = css`
203203
}
204204
205205
#table[has-footer] [part~='last-row-cell'],
206-
#table[has-footer] [part~='last-row-cell'] + [part~='details-cell'],
207-
:host(:not([overflow~='bottom']):not([overflow~='top'])) [part~='last-row-cell'] {
206+
#table[has-footer] [part~='last-row'] [part~='details-cell'],
207+
:host(:not([overflow~='bottom']):not([overflow~='top'])) [part~='last-row-cell'],
208+
:host(:not([overflow~='bottom']):not([overflow~='top'])) [part~='last-row'] [part~='details-cell'] {
208209
border-block-end-style: solid;
209210
}
210211
@@ -249,9 +250,13 @@ export const gridStyles = css`
249250
}
250251
251252
/* Raise highlighted rows above others */
252-
[part~='row']:focus,
253-
[part~='row']:focus-within {
254-
z-index: 3;
253+
[part~='row'],
254+
[part~='frozen-cell'],
255+
[part~='frozen-to-end-cell'] {
256+
&:focus,
257+
&:focus-within {
258+
z-index: 3;
259+
}
255260
}
256261
257262
/* Row hover */
@@ -461,7 +466,7 @@ export const gridStyles = css`
461466
inset-block: calc(var(--_row-border-width) * -1);
462467
}
463468
464-
[part~='body-cell']::after {
469+
[part~='cell']:where(:not([part~='details-cell']))::after {
465470
inset-inline: calc(var(--_column-border-width) * -1);
466471
}
467472
@@ -478,22 +483,26 @@ export const gridStyles = css`
478483
transform: translateX(var(--_grid-horizontal-scroll-position));
479484
}
480485
481-
[part~='first-row']::after,
482-
#header [part~='row']:first-child::after,
483-
#header [part~='row']:first-child [part~='cell']::after,
486+
[part~='first-header-row-cell']::after,
484487
#table:not([has-header]) [part~='first-row-cell']::after {
485488
inset-block-start: 0;
486489
}
487490
491+
[part~='first-footer-row']::after {
492+
inset-block-start: calc(var(--_row-border-width) * -1);
493+
}
494+
488495
[part~='last-row']::after,
489-
#footer [part~='row']:last-child::after,
490-
#footer [part~='row']:last-child [part~='cell']::after,
491-
:host([overflow~='top']) #table:not([has-footer]) [part~='last-row-cell']::after {
496+
[part~='last-footer-row']::after,
497+
[part~='last-footer-row-cell']::after {
492498
inset-block-end: 0;
493499
}
494500
495-
#footer [part~='row']:first-child::after {
496-
inset-block-start: calc(var(--_row-border-width) * -1);
501+
:host([overflow~='top']) #table:not([has-footer]) {
502+
[part~='last-row'] [part~='details-cell']::after,
503+
[part~='last-row']:not([part~='details-opened-row']) [part~='last-row-cell']::after {
504+
inset-block-end: 0;
505+
}
497506
}
498507
499508
:host([navigating]) [part~='row']:focus,

packages/grid/src/vaadin-grid-mixin.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,13 +719,13 @@ export const GridMixin = (superClass) =>
719719

720720
while (this.$.header.children.length < columnTree.length) {
721721
const headerRow = document.createElement('tr');
722-
headerRow.setAttribute('part', 'row');
722+
headerRow.setAttribute('part', 'row header-row');
723723
headerRow.setAttribute('role', 'row');
724724
headerRow.setAttribute('tabindex', '-1');
725725
this.$.header.appendChild(headerRow);
726726

727727
const footerRow = document.createElement('tr');
728-
footerRow.setAttribute('part', 'row');
728+
footerRow.setAttribute('part', 'row footer-row');
729729
footerRow.setAttribute('role', 'row');
730730
footerRow.setAttribute('tabindex', '-1');
731731
this.$.footer.appendChild(footerRow);
@@ -738,17 +738,19 @@ export const GridMixin = (superClass) =>
738738
iterateChildren(this.$.header, (headerRow, index, rows) => {
739739
this.__initRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1);
740740

741-
const cells = getBodyRowCells(headerRow);
742-
updateCellsPart(cells, 'first-header-row-cell', index === 0);
743-
updateCellsPart(cells, 'last-header-row-cell', index === rows.length - 1);
741+
updateBooleanRowStates(headerRow, {
742+
'first-header': index === 0,
743+
'last-header': index === rows.length - 1,
744+
});
744745
});
745746

746747
iterateChildren(this.$.footer, (footerRow, index, rows) => {
747748
this.__initRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0);
748749

749-
const cells = getBodyRowCells(footerRow);
750-
updateCellsPart(cells, 'first-footer-row-cell', index === 0);
751-
updateCellsPart(cells, 'last-footer-row-cell', index === rows.length - 1);
750+
updateBooleanRowStates(footerRow, {
751+
'first-footer': index === 0,
752+
'last-footer': index === rows.length - 1,
753+
});
752754
});
753755

754756
// Sizer rows

0 commit comments

Comments
 (0)