-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Table): add accordion row events (#1834)
- Loading branch information
1 parent
dec1ddb
commit c7be834
Showing
8 changed files
with
202 additions
and
26 deletions.
There are no files selected for viewing
12 changes: 7 additions & 5 deletions
12
packages/dnb-design-system-portal/src/docs/uilib/components/table/events.md
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
--- | ||
showTabs: true | ||
--- | ||
|
||
## Events | ||
|
||
No events are supported at the moment. | ||
Events are a part of the accordion feature and needs to be enabled with the `accordion` property on the main Table. | ||
|
||
| Events | Description | | ||
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `onClick` | _(optional)_ will emit when user clicks/expands the table row. Returns a native click. | | ||
| `onOpened` | _(optional)_ Will emit when table row is expanded. Returns an object with the table row as the target: `{ target }`. | | ||
| `onClosed` | _(optional)_ Will emit when table row is closed (after it was open). Returns an object with the table row as the target: `{ target }`. | |
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
20 changes: 20 additions & 0 deletions
20
packages/dnb-eufemia/src/components/height-animation/__tests__/HeightAnimationUtils.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,20 @@ | ||
export function testSetupInit() { | ||
beforeEach(() => { | ||
global.IS_TEST = false | ||
|
||
window.requestAnimationFrame = jest.fn((callback) => { | ||
return setTimeout(callback, 0) | ||
}) | ||
window.cancelAnimationFrame = jest.fn((id) => { | ||
clearTimeout(id) | ||
return id | ||
}) | ||
}) | ||
} | ||
|
||
export function simulateAnimationEnd( | ||
element: Element = document.querySelector('.dnb-height-animation') | ||
) { | ||
const event = new CustomEvent('transitionend') | ||
element.dispatchEvent(event) | ||
} |
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
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