This repository has been archived by the owner on Nov 10, 2020. It is now read-only.
forked from Jbcampbe/genesys-webcomponents
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table component): table component implementation
new table component add with appropriate styles, scrolling feature and responsive behavior re #5
- Loading branch information
1 parent
40adea5
commit 34027cd
Showing
10 changed files
with
927 additions
and
56 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,133 @@ | ||
<h1>Data table</h1> | ||
<gux-table-beta> | ||
<table slot="data"> | ||
<thead> | ||
<tr> | ||
<th>First name</th> | ||
<th>Last name</th> | ||
<th data-cell-numeric>Age</th> | ||
<th data-cell-action>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>John</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>25</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>23</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>21</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>23</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</gux-table-beta> | ||
|
||
<h1>Data table compact</h1> | ||
<gux-table-beta compact> | ||
<table slot="data"> | ||
<thead> | ||
<tr> | ||
<th>First name</th> | ||
<th>Last name</th> | ||
<th data-cell-numeric>Age</th> | ||
<th data-cell-action>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>John</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>25</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>23</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>21</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>23</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</gux-table-beta> | ||
|
||
<h1>Object table</h1> | ||
<gux-table-beta object-table> | ||
<table slot="data"> | ||
<thead> | ||
<tr> | ||
<th>First name</th> | ||
<th>Last name</th> | ||
<th data-cell-numeric>Age</th> | ||
<th data-cell-action>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>John</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>25</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>23</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>21</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
<tr> | ||
<td>Jane</td> | ||
<td>Doe</td> | ||
<td data-cell-numeric>23</td> | ||
<td data-cell-action>Delete</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</gux-table-beta> | ||
|
||
<h1>Empty table</h1> | ||
<gux-table-beta object-table> | ||
<table slot="data"> | ||
<thead> | ||
<tr> | ||
<th>First name</th> | ||
<th>Last name</th> | ||
<th data-cell-numeric>Age</th> | ||
<th data-cell-action>Action</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
</gux-table-beta> |
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,159 @@ | ||
// Variables part | ||
@gux-scroll-btn-border: #d5dce0; | ||
@gux-scroll-btn-disabled-text:#c3cad4; | ||
@gux-scroll-btn-shadow-left: 1px -1px 1px rgba(34, 37, 41, 0.08); | ||
@gux-scroll-btn-shadow-right: -1px -1px 1px rgba(34, 37, 41, 0.08); | ||
@gux-table-row-hover: #deeafc; | ||
@gux-table-scroll-divider: rgba(34, 37, 41, 0.1); | ||
|
||
gux-table-beta { | ||
display: block; | ||
position: relative; | ||
|
||
.empty-table { | ||
align-items: center; | ||
background: @gux-off-white; | ||
color: @gux-grey-bg-3; | ||
display: flex; | ||
height: 150px; | ||
justify-content: center; | ||
|
||
h2 { | ||
margin: 0px; | ||
} | ||
} | ||
|
||
.gux-scroll-left, | ||
.gux-scroll-right { | ||
align-items: center; | ||
background: @gux-border; | ||
border: 1px solid @gux-scroll-btn-border; | ||
color: @gux-grey-2; | ||
cursor: pointer; | ||
display: flex; | ||
font-size: 18px; | ||
height: 38px; | ||
justify-content: center; | ||
position: absolute; | ||
width: 24px; | ||
z-index: 1; | ||
|
||
&.disabled { | ||
background: @gux-off-white-bg-2; | ||
color: @gux-scroll-btn-disabled-text; | ||
} | ||
} | ||
|
||
.gux-scroll-left { | ||
border-bottom-right-radius: 2px; | ||
border-top-right-radius: 2px; | ||
box-shadow: @gux-scroll-btn-shadow-left; | ||
} | ||
|
||
.gux-scroll-right { | ||
border-bottom-left-radius: 2px; | ||
border-top-left-radius: 2px; | ||
box-shadow: @gux-scroll-btn-shadow-right; | ||
right: 0; | ||
} | ||
|
||
.gux-table-container { | ||
overflow-x: scroll; | ||
position: relative; | ||
|
||
&.vertical-scroll { | ||
.gux-table-header { | ||
border-bottom: 1px solid @gux-table-scroll-divider | ||
} | ||
} | ||
|
||
.gux-table-header-column, | ||
.gux-table-body-row-cell { | ||
border-color:@gux-border; | ||
border-style: solid; | ||
border-width: 0px 1px 1px 0px; | ||
padding: 11.5px 24px 11.5px 12px; | ||
white-space: nowrap; | ||
|
||
p { | ||
margin: 0px; | ||
} | ||
} | ||
|
||
.gux-table-header-column:last-child, | ||
.gux-table-body-row-cell:last-child { | ||
border-right-width: 0px; | ||
} | ||
|
||
.gux-table-header { | ||
background: @gux-off-white; | ||
display: flex; | ||
width: fit-content; | ||
} | ||
|
||
.gux-table-body { | ||
max-height: calc(100% - 40px); | ||
overflow-y: scroll; | ||
width: fit-content; | ||
|
||
.gux-table-body-row { | ||
background: @gux-off-white-bg-2; | ||
display: flex; | ||
} | ||
|
||
.gux-table-body-row:nth-child(2n) { | ||
background: @gux-off-white; | ||
} | ||
} | ||
|
||
.gux-table-header-column, | ||
.gux-table-body-row-cell { | ||
&.cell-number, | ||
&.cell-action { | ||
padding: 11.5px 12px 11.5px 24px; | ||
text-align: right; | ||
} | ||
} | ||
|
||
&.horizontal-scroll { | ||
.gux-table-header-column:first-child { | ||
b, p { | ||
margin-left: 26px; | ||
} | ||
} | ||
} | ||
|
||
&.compact { | ||
.gux-table-body-row-cell { | ||
padding-top: 3.5px; | ||
padding-bottom: 3.5px; | ||
} | ||
} | ||
|
||
&.object-table { | ||
.gux-table-body-row { | ||
.gux-table-body-row-cell { | ||
border-color:@gux-off-white-bg-2; | ||
} | ||
} | ||
|
||
.gux-table-body-row:nth-child(2n) { | ||
.gux-table-body-row-cell { | ||
border-color: @gux-off-white; | ||
} | ||
} | ||
|
||
.gux-table-body-row:hover { | ||
background: @gux-table-row-hover; | ||
|
||
.gux-table-body-row-cell { | ||
border-color:@gux-table-row-hover; | ||
} | ||
} | ||
} | ||
|
||
table { | ||
display: none; | ||
} | ||
} | ||
} |
Oops, something went wrong.