-
Notifications
You must be signed in to change notification settings - Fork 33
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 Table.ScrolView to support horizontal scroll (#1735)
* Update snapshots * feat(Table): add Table.ScrolView to support horizontal scroll
- Loading branch information
1 parent
c2b043d
commit 85a4d86
Showing
12 changed files
with
201 additions
and
40 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
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
29 changes: 29 additions & 0 deletions
29
packages/dnb-eufemia/src/components/table/TableScrollView.tsx
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,29 @@ | ||
import React from 'react' | ||
import classnames from 'classnames' | ||
import ScrollView from '../../fragments/scroll-view/ScrollView' | ||
|
||
import type { SpacingProps } from '../../shared/types' | ||
|
||
export type TableScrollViewProps = { | ||
/** | ||
* The content of the component. | ||
*/ | ||
children: React.ReactElement<HTMLTableElement> | ||
} | ||
|
||
export type TableScrollViewAllProps = TableScrollViewProps & | ||
Omit<React.TableHTMLAttributes<HTMLDivElement>, 'children'> & | ||
SpacingProps | ||
|
||
export default function TableScrollView(props: TableScrollViewAllProps) { | ||
const { className, children, ...rest } = props | ||
|
||
return ( | ||
<ScrollView | ||
className={classnames('dnb-table__scroll-view', className)} | ||
{...rest} | ||
> | ||
{children} | ||
</ScrollView> | ||
) | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/dnb-eufemia/src/components/table/TableStickyHeader.tsx
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
Binary file modified
BIN
-4.95 KB
(84%)
...test-tsx-table-screenshot-have-to-match-a-complex-table-layout-1-c8007.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.2 KB
...t-test-tsx-table-screenshot-have-to-match-a-fixed-table-layout-1-3ee82.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
|
||
&--fixed { | ||
table-layout: fixed; | ||
width: auto; | ||
} | ||
|
||
&__sticky-helper > td { | ||
|