Skip to content

Commit

Permalink
[CHUX-241] Make table rows clickable using keyboard (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Lazarev authored Mar 22, 2024
1 parent e16efcd commit d2de214
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 37 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ebury/chameleon-components",
"version": "2.8.0",
"version": "2.8.1",
"main": "src/main.ts",
"sideEffects": false,
"author": "Ebury Team (http://labs.ebury.rocks/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ exports[`EcSmartTable > #slots > should only render custom row if "isCustomRowSh
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
colspan="3"
Expand Down Expand Up @@ -62,8 +63,9 @@ exports[`EcSmartTable > #slots > should only render custom row if "isCustomRowSh

exports[`EcSmartTable > #slots > should pass ec-table slots 1`] = `
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down Expand Up @@ -130,8 +132,9 @@ exports[`EcSmartTable > #slots > should render custom row if window width is low
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
colspan="3"
Expand Down Expand Up @@ -520,8 +523,9 @@ exports[`EcSmartTable > #slots > should render resolved data properly with the h
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down Expand Up @@ -2357,8 +2361,9 @@ exports[`EcSmartTable > should not pass attrs to the ec-table 1`] = `
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down Expand Up @@ -2526,8 +2531,9 @@ exports[`EcSmartTable > should pass props to the ec-table 1`] = `
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down Expand Up @@ -2571,8 +2577,9 @@ exports[`EcSmartTable > should pass props to the ec-table 1`] = `

exports[`EcSmartTable > should pass row-click event to the ec-table 1`] = `
<tr
class="ec-table__row--is-clickable"
class="ec-table__row--is-clickable ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down Expand Up @@ -2792,8 +2799,9 @@ exports[`EcSmartTable > should render its own title instead of using the one ins
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down Expand Up @@ -2960,8 +2968,9 @@ exports[`EcSmartTable > should render resolved data properly 1`] = `
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand Down
69 changes: 46 additions & 23 deletions src/components/ec-table/__snapshots__/ec-table.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ exports[`EcTable > should have a column align to center if its type is icon 1`]
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -79,8 +80,9 @@ exports[`EcTable > should have a column align to center if its type is icon 1`]
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -165,8 +167,9 @@ exports[`EcTable > should have a column align to the right if its type is curren
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -188,8 +191,9 @@ exports[`EcTable > should have a column align to the right if its type is curren
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -238,8 +242,9 @@ exports[`EcTable > should only render custom row if "isCustomRowShown" is true 1
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
colspan="2"
Expand All @@ -252,8 +257,9 @@ exports[`EcTable > should only render custom row if "isCustomRowShown" is true 1
</td>
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
colspan="2"
Expand Down Expand Up @@ -329,8 +335,9 @@ exports[`EcTable > should render as expected if provided with data and columns 1
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -352,8 +359,9 @@ exports[`EcTable > should render as expected if provided with data and columns 1
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -438,8 +446,9 @@ exports[`EcTable > should render as expected if provided with data and columns,
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -461,8 +470,9 @@ exports[`EcTable > should render as expected if provided with data and columns,
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -527,8 +537,9 @@ exports[`EcTable > should render as expected if provided with data but no column
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -550,8 +561,9 @@ exports[`EcTable > should render as expected if provided with data but no column
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -594,8 +606,9 @@ exports[`EcTable > should render as expected if provided with data but no column
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -617,8 +630,9 @@ exports[`EcTable > should render as expected if provided with data but no column
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -683,8 +697,9 @@ exports[`EcTable > should render as expected if provided with empty row and no c
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
Expand Down Expand Up @@ -779,8 +794,9 @@ exports[`EcTable > should render as expected if provided with rows and columns,
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -802,8 +818,9 @@ exports[`EcTable > should render as expected if provided with rows and columns,
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -868,8 +885,9 @@ exports[`EcTable > should render custom row if window width is lower than 768px
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
colspan="2"
Expand All @@ -882,8 +900,9 @@ exports[`EcTable > should render custom row if window width is lower than 768px
</td>
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
colspan="2"
Expand Down Expand Up @@ -959,8 +978,9 @@ exports[`EcTable > should render slots as expected 1`] = `
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -984,8 +1004,9 @@ exports[`EcTable > should render slots as expected 1`] = `
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down Expand Up @@ -1183,8 +1204,9 @@ exports[`EcTable > should render the style with the max-width on each cell of th
<tbody>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--0"
tabindex="0"
>
<td
Expand All @@ -1207,8 +1229,9 @@ exports[`EcTable > should render the style with the max-width on each cell of th
</tr>
<tr
class=""
class="ec-table__row"
data-test="ec-table__row ec-table__row--1"
tabindex="0"
>
<td
Expand Down
Loading

0 comments on commit d2de214

Please sign in to comment.