Skip to content

Commit

Permalink
feat: add headerStyle function (#248)
Browse files Browse the repository at this point in the history
Co-authored-by: Michel Binder <[email protected]>
  • Loading branch information
cubmic and Michel Binder authored Dec 2, 2024
1 parent 298ee5d commit 385f3ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ export class LeuTable extends LeuElement {
<tr>
${this._columns.map(
(col) =>
html`<th>
html`<th
style=${col.headerStyle
? styleMap(col.headerStyle())
: nothing}
>
${col.sort
? html`<button @click=${(_) => this.sortClick(col)}>
<span>${col.name}</span>
Expand Down
7 changes: 6 additions & 1 deletion src/components/table/stories/table.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ function Template({ itemsPerPage }) {
{
name: "Name",
value: (row) => row.name,
headerStyle: () => {
return {
color: "#0076bd",
}
},
style: (row) => {
return {
minWidth: "400px",
Expand All @@ -38,7 +43,7 @@ function Template({ itemsPerPage }) {
},
{
name: "Menge",
value: (row) => row.menge,
value: (row) => row.menge + "%",
style: (row) => {
return {
color:
Expand Down
1 change: 1 addition & 0 deletions src/components/table/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ button {
align-items: flex-center;
font-size: inherit;
font-family: inherit;
color: inherit;
}

thead leu-icon {
Expand Down

0 comments on commit 385f3ea

Please sign in to comment.