mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(data-table): dispatch row mouseenter, mouseleave events
Add a row id for easier querying. Add missing selected row class.
This commit is contained in:
parent
f17e4af481
commit
73036aea4a
1 changed files with 8 additions and 1 deletions
|
@ -268,11 +268,18 @@
|
|||
<TableBody>
|
||||
{#each sorting ? sortedRows : rows as row, i (row.id)}
|
||||
<TableRow
|
||||
class="{expandedRows[row.id] ? 'bx--expandable-row' : ''} {expandable ? 'bx--parent-row' : ''} {expandable && parentRowId === row.id ? 'bx--expandable-row--hover' : ''}"
|
||||
id="row-{row.id}"
|
||||
class="{selectedRowIds.includes(row.id) ? 'bx--data-table--selected' : ''} {expandedRows[row.id] ? 'bx--expandable-row' : ''} {expandable ? 'bx--parent-row' : ''} {expandable && parentRowId === row.id ? 'bx--expandable-row--hover' : ''}"
|
||||
on:click="{() => {
|
||||
dispatch('click', { row });
|
||||
dispatch('click:row', row);
|
||||
}}"
|
||||
on:mouseenter="{() => {
|
||||
dispatch('mouseenter:row', row);
|
||||
}}"
|
||||
on:mouseleave="{() => {
|
||||
dispatch('mouseleave:row', row);
|
||||
}}"
|
||||
>
|
||||
{#if expandable}
|
||||
<TableCell
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue