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

Apply BEM refactor for table #7212

Merged
merged 34 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
04337af
bem refactor table
AlexanderSchmidtCE Dec 17, 2024
44a1d27
update default
AlexanderSchmidtCE Dec 17, 2024
cc7bf85
update default
AlexanderSchmidtCE Dec 18, 2024
74993c5
refactor themes
AlexanderSchmidtCE Dec 18, 2024
60ebb5c
test update
AlexanderSchmidtCE Dec 18, 2024
4e539c9
Merge branch 'develop' into 7036-bem-refactor-table
AlexanderSchmidtCE Dec 18, 2024
de60443
stateful refactor
AlexanderSchmidtCE Dec 18, 2024
a5c11b7
moved font family to kol-pagination
AlexanderSchmidtCE Dec 18, 2024
dd10548
Revert "moved font family to kol-pagination"
AlexanderSchmidtCE Dec 19, 2024
9e627fa
Merge branch 'develop' into 7036-bem-refactor-table
AlexanderSchmidtCE Dec 19, 2024
b161dd9
added font family
AlexanderSchmidtCE Dec 19, 2024
f1b1e56
moved include
AlexanderSchmidtCE Dec 19, 2024
a0565f4
move font family to host in default
AlexanderSchmidtCE Dec 19, 2024
a0f49e7
changes in block class
AlexanderSchmidtCE Dec 19, 2024
4282b75
changes in block class
AlexanderSchmidtCE Dec 19, 2024
c66ca6a
fixed selectors
AlexanderSchmidtCE Dec 19, 2024
889fa04
Update all snapshots$
AlexanderSchmidtCE Dec 19, 2024
bbd7fd1
review changes
AlexanderSchmidtCE Dec 19, 2024
a764ca7
dev merge
AlexanderSchmidtCE Dec 19, 2024
6131245
fixed footer background
AlexanderSchmidtCE Dec 19, 2024
8f803b9
fixed footer background
AlexanderSchmidtCE Dec 19, 2024
e46d449
Merge branch 'develop' into 7036-bem-refactor-table
AlexanderSchmidtCE Dec 19, 2024
4c2f01b
revert changes in form caused by devmerge
AlexanderSchmidtCE Dec 19, 2024
520e1fb
review changes
AlexanderSchmidtCE Dec 20, 2024
bb637c4
review changes
AlexanderSchmidtCE Dec 20, 2024
e6390f8
fixed header align
AlexanderSchmidtCE Dec 20, 2024
4681fa7
Merge branch 'develop' into 7036-bem-refactor-table
AlexanderSchmidtCE Dec 20, 2024
d9ac07f
fixed sort
AlexanderSchmidtCE Dec 20, 2024
c634059
review changes
AlexanderSchmidtCE Dec 20, 2024
3815e21
test update
AlexanderSchmidtCE Dec 20, 2024
321003c
Update all snapshots$
AlexanderSchmidtCE Dec 20, 2024
506297d
added pagination modifier
AlexanderSchmidtCE Dec 20, 2024
b654911
Merge remote-tracking branch 'origin/7036-bem-refactor-table' into 70…
AlexanderSchmidtCE Dec 20, 2024
2903258
removed media for -bottom
AlexanderSchmidtCE Dec 20, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,88 @@

@mixin kol-table-stateless-styles {
@layer kol-component {
:host,
.kol-table-stateless-wc {
.kol-table {
display: block;
font-size: rem(16);
}

.table {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
}

table {
width: 100%;
}

caption {
text-align: start;
}
&__table {
width: 100%;
}

.focus-element {
font-size: 0;
}
&__caption {
text-align: start;
}

.focus-element:focus {
outline: 0 !important;
}
&__focus-element {
font-size: 0;

.table:has(.focus-element:focus) {
/* @see https://remysharp.com/til/css/focus-ring-default-styles */
outline: rem(5) auto Highlight;
outline: rem(5) auto -webkit-focus-ring-color;
outline-offset: rem(2);
}
&:focus {
outline: 0 !important;
/* @see https://remysharp.com/til/css/focus-ring-default-styles */
outline: rem(5) auto Highlight;
outline: rem(5) auto -webkit-focus-ring-color;
outline-offset: rem(2);
}
}

.table-sort-button .kol-button {
color: inherit;
}
&__sort-button {
.kol-button {
color: inherit;
}
}

// headings in table body default to text-align left, unless defined otherwise.
tbody th,
th.align-left {
text-align: left;
// headings in table body default to text-align left, unless defined otherwise.
&__body {
text-align: left;

& .table-sort-button .kol-button__text {
justify-items: start;
.kol-button__text {
justify-items: start;
}
}
}

th.align-center {
text-align: center;
&__cell {
&--align-left {
text-align: left;

& .table-sort-button .kol-button__text {
justify-items: center;
}
}
.kol-button__text {
justify-items: start;
}
}

th.align-right {
text-align: right;
&--align-center {
text-align: center;

& .table-sort-button .kol-button__text {
justify-items: end;
}
}
& .kol-button__text {
justify-items: center;
}
}

tr.foot-spacer,
tr.head-spacer {
display: none;
}
&--align-right {
text-align: right;

.selection-header-cell {
width: 0;
}
.kol-button__text {
justify-items: end;
}
}
}

.selection-cell {
width: var(--a11y-min-size);
height: var(--a11y-min-size);
white-space: nowrap;
}
&__cell {
&--selection {
width: var(--a11y-min-size);
height: var(--a11y-min-size);
white-space: nowrap;
}
}

.input {
label {
&__spacer {
display: none;
}

&__selection-label {
align-items: center;
cursor: pointer;
display: flex;
Expand All @@ -95,63 +95,60 @@
width: var(--a11y-min-size);
}

.icon {
&__selection-icon {
display: block;
inset: auto;
position: absolute;
z-index: 1;
}

input {
&__selection-input {
appearance: none;
border-style: solid;
cursor: pointer;
margin: 0;
}

input:before {
content: '';
}

input[type='checkbox'] {
position: relative;
display: flex;
height: calc(var(--a11y-min-size) / 2);
width: calc(var(--a11y-min-size) / 2);
align-items: center;
justify-content: center;
background-color: rgb(255, 255, 255);
border-width: rem(2);
line-height: 1.5;
transition: all 0.5s ease 0s;
}

input[type='radio'] {
display: flex;
border-width: rem(2);
border-radius: 100%;
height: 1.5em;
min-height: 1.5em;
min-width: 1.5em;
padding: 0;
width: 1.5em;
}

input[type='radio']:before {
border-radius: 100%;
margin: auto;
height: calc(1.5em / 2);
width: calc(1.5em / 2);
}
&:before {
content: '';
}

input[type='radio']:checked:before {
background-color: #000;
}
&--checkbox {
position: relative;
display: flex;
height: calc(var(--a11y-min-size) / 2);
width: calc(var(--a11y-min-size) / 2);
align-items: center;
justify-content: center;
background-color: rgb(255, 255, 255);
border-width: rem(2);
line-height: 1.5;
transition: all 0.5s ease 0s;
}

@media (forced-colors: active) {
input[type='radio']:checked:before {
/* Give it a visible background in forced colors mode */
background-color: selectedItem !important;
&--radio {
display: flex;
border-width: rem(2);
border-radius: 100%;
height: 1.5em;
min-height: 1.5em;
min-width: 1.5em;
padding: 0;
width: 1.5em;

&:before {
border-radius: 100%;
margin: auto;
height: calc(1.5em / 2);
width: calc(1.5em / 2);
}

&:checked:before {
background-color: #000;
@media (forced-colors: active) {
/* Give it a visible background in forced colors mode */
background-color: selectedItem !important;
}
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/components/table-stateful/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export class KolTableStateful implements TableAPI {
*/
private renderPagination(): JSX.Element {
return (
<div class="pagination">
<div class="kol-table-stateful__pagination">
<span>
{translate('kol-table-visible-range', {
placeholders: {
Expand All @@ -435,8 +435,9 @@ export class KolTableStateful implements TableAPI {
},
})}
</span>
<div>
<div class="kol-table-stateful__pagination-wrapper">
<KolPaginationTag
class="test"
_boundaryCount={this.state._pagination._boundaryCount}
_customClass={this.state._pagination._customClass}
_on={this.handlePagination}
Expand Down
41 changes: 18 additions & 23 deletions packages/components/src/components/table-stateful/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,33 @@
@import '../style';
@import '../@shared/kol-table-stateless-mixin';

@include kol-table-stateless-styles;

@layer kol-component {
:root {
:host {
font-size: rem(16);
}

div.pagination .kol-pagination {
display: flex;
flex-wrap: wrap;
}

div.pagination,
div.pagination > div:last-child {
display: grid;
place-items: center;
}

@media (max-width: 1024px) {
div.pagination .kol-pagination {
flex-direction: column;
.kol-table-stateful {
&__pagination,
&__pagination-wrapper {
display: grid;
place-items: center;
@media (min-width: 1024px) {
grid-auto-flow: column;
}
}
}

@media (min-width: 1024px) {
div.pagination,
div.pagination > div:last-child {
grid-auto-flow: column;
.kol-pagination {
display: flex;
flex-wrap: wrap;
@media (min-width: 1024px) {
display: flex;
}

div.pagination .kol-pagination {
display: flex;
@media (max-width: 1024px) {
flex-direction: column;
}
}
}

@include kol-table-stateless-styles;
Loading
Loading