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

feat(table): agent - add the table component with its pagination #153

Merged
merged 1 commit into from
Jul 16, 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/css/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addons } from '@storybook/addons';
import logo from './css3.svg'
import logo from './css3.svg';

addons.setConfig({
theme: {
Expand Down
1 change: 1 addition & 0 deletions packages/css/src/Form/Select/Agent/Select.agent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
position: absolute;
top: 50%;
right: 1em;
height: 0.7em; /* when using pure svgs */
font-size: 0.7em;
transform: translateY(-50%);
}
Expand Down
78 changes: 78 additions & 0 deletions packages/css/src/Table/Pager.agent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@use "../common/common.agent.scss" as common;

/* stylelint-disable no-descending-specificity */
.af-pager {
&__pagination {
display: flex;
margin: 0;
padding: 0;
flex-wrap: wrap;
align-items: center;
justify-content: center;
list-style: none;
}

&__item {
border-radius: common.px-to-rem(25);
font-size: 0.9375rem;

&--active {
min-width: 1.9rem;
height: 1.9rem;
text-align: center;
color: common.$white;
background: common.$color-axa;

&:hover {
background: common.$color-azur;
}

.af-pager__item-link {
color: common.$white;
}
}

&-link,
&-nolink {
display: inline-flex;
padding: 0.3em 0.5rem;
color: common.$color-pager-link;
}

&-text {
text-decoration: underline;
}

&-icon {
margin: 0 0.5rem;

&:hover {
text-decoration: none;
}
}
}
}

@include common.media-breakpoint-down(xs) {
.af-paging__pager {
margin-top: 2rem;
}

.af-paging__limit {
width: 100%;
margin: 1rem auto;
text-align: center;

[class^="col"] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[class^="col"] a quoi de plus par rapport à un simple .col ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca permet de target tout ce qui commence par col, donc col-sm-2 par exemple. Je n'en sais pas plus, mais ca a permis de fixer une erreur :

width: inherit;
padding: inherit;
flex-basis: inherit;
flex-grow: inherit;
}

.af-form__group {
justify-content: space-evenly;
}
}
}
/* stylelint-enable no-descending-specificity */
61 changes: 61 additions & 0 deletions packages/css/src/Table/Paging.agent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@use "../common/common.agent.scss" as common;
@use "../Form/Select/Agent/Select.agent.scss";

.af-paging {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-start;

&__limit {
margin-top: 2rem;
order: 2;
color: common.$color-pager-link;

.af-form__group {
margin: 0;
font-size: 0.9375rem;

&-label {
font-weight: normal;
}

.af-form__input-select {
padding: 2px 29px 2px 14px;
}
}
}

&__pager {
flex-basis: 100%;
order: 1;
}
}

@include common.media-breakpoint-up(md) {
.af-paging {
&__limit {
margin: 0;
flex-basis: 40%;
order: 1;
}

&__pager {
flex-basis: 60%;
order: 2;
}
}
}
@include common.media-breakpoint-up(xl) {
.af-paging {
&__limit {
flex-basis: 30%;
order: 1;
}

&__pager {
flex-basis: 70%;
order: 2;
}
}
}
72 changes: 72 additions & 0 deletions packages/css/src/Table/Table.agent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@use "../common/common.agent.scss" as common;

/* stylelint-disable no-descending-specificity */

.af-table {
width: 100%;
margin-bottom: 2rem;
border-spacing: 0;
border-collapse: collapse;
background: common.$white;
box-shadow: 0 0 20px rgba(0, 0, 0, 20%);

&-th {
font-weight: common.$table-head-font-weight;
}

&__th {
position: relative;
height: 100%;
padding: 1rem;
font-size: 1rem;
font-weight: common.$table-head-font-weight;
text-align: left;
color: common.$white;
background: common.$color-azur;
box-shadow: 0 0 1px 1px common.$white;

&--sortable {
padding: 0;
}

.af-link {
color: common.$white;

&:hover {
color: common.$white;
}
}

.glyphicon {
position: relative;
inset: 0;
font-size: 0.7rem;
transform: none;
}
}

&__tr {
height: 100%;

&:nth-child(2n + 1) {
.af-table {
&__cell {
background-color: common.$color-wild-sand;
}
}
}
}

&__cell {
padding: 0.5rem 1rem;
border: 1px solid transparent;
border-right-color: common.$color-silver;
font-size: 0.9375rem;
text-align: left;

&:nth-last-child(1) {
border-right: 0;
}
}
}
/* stylelint-enable no-descending-specificity */
Loading