-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table): allow more complex data in table
- Loading branch information
1 parent
54c0a5b
commit b5526d3
Showing
13 changed files
with
572 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/pharos/src/components/table-body/pharos-table-body.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
display: table-row-group; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/pharos/src/components/table-body/pharos-table-body.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableBodyStyles } from './pharos-table-body.css'; | ||
|
||
/** | ||
* Pharos table body component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableBody extends ScopedRegistryMixin(PharosElement) { | ||
public static override get styles(): CSSResultArray { | ||
return [tableBodyStyles]; | ||
} | ||
|
||
protected override firstUpdated(): void { | ||
this.setAttribute('role', 'rowgroup'); | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/pharos/src/components/table-cell/pharos-table-cell.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
:host { | ||
border: 1px solid var(--pharos-table-body-color-border, var(--pharos-color-ui-30)); | ||
padding: var(--pharos-spacing-1-x); | ||
border-collapse: collapse; | ||
display: table-cell; | ||
vertical-align: top; | ||
z-index: 100; | ||
position: relative; | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/pharos/src/components/table-cell/pharos-table-cell.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableCellStyles } from './pharos-table-cell.css'; | ||
|
||
/** | ||
* Pharos table cell component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
|
||
export class PharosTableCell extends ScopedRegistryMixin(PharosElement) { | ||
public static override get styles(): CSSResultArray { | ||
return [tableCellStyles]; | ||
} | ||
|
||
protected override firstUpdated(): void { | ||
this.setAttribute('role', 'cell'); | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/pharos/src/components/table-row/pharos-table-row.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
display: table-row; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/pharos/src/components/table-row/pharos-table-row.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { html, type CSSResultArray, type TemplateResult } from 'lit'; | ||
import ScopedRegistryMixin from '../../utils/mixins/scoped-registry'; | ||
import { PharosElement } from '../base/pharos-element'; | ||
import { tableRowStyles } from './pharos-table-row.css'; | ||
|
||
/** | ||
* Pharos table row component. | ||
* | ||
* @tag pharos-table | ||
* | ||
* | ||
*/ | ||
export class PharosTableRow extends ScopedRegistryMixin(PharosElement) { | ||
public static override get styles(): CSSResultArray { | ||
return [tableRowStyles]; | ||
} | ||
|
||
protected override firstUpdated(): void { | ||
this.setAttribute('role', 'row'); | ||
} | ||
|
||
protected override render(): TemplateResult { | ||
return html`<slot></slot>`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.