File tree Expand file tree Collapse file tree
examples/react-example/src
packages/perspective-react/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ const App: React.FC = () => {
124124 < >
125125 < PerspectiveViewer table = { state . table } />
126126 < PerspectiveViewer
127+ className = "my-perspective-viewer"
127128 table = { state . table }
128129 config = { state . config }
129130 onClick = { onClick }
Original file line number Diff line number Diff line change @@ -34,6 +34,16 @@ export interface PerspectiveViewerProps {
3434 onConfigUpdate ?: ( config : pspViewer . ViewerConfigUpdate ) => void ;
3535 onClick ?: ( data : pspViewer . PerspectiveClickEventDetail ) => void ;
3636 onSelect ?: ( data : pspViewer . PerspectiveSelectEventDetail ) => void ;
37+
38+ // Applicable props from `React.HTMLAttributes`, which we cannot extend
39+ // directly because Perspective changes the signature of `onClick`.
40+ className ?: string | undefined ;
41+ hidden ?: boolean | undefined ;
42+ id ?: string | undefined ;
43+ slot ?: string | undefined ;
44+ style ?: React . CSSProperties | undefined ;
45+ tabIndex ?: number | undefined ;
46+ title ?: string | undefined ;
3747}
3848
3949function PerspectiveViewerImpl ( props : PerspectiveViewerProps ) {
@@ -64,7 +74,18 @@ function PerspectiveViewerImpl(props: PerspectiveViewerProps) {
6474 usePspListener ( viewer , "perspective-select" , props . onSelect ) ;
6575 usePspListener ( viewer , "perspective-config-update" , props . onConfigUpdate ) ;
6676
67- return < perspective-viewer ref = { setViewer } /> ;
77+ return (
78+ < perspective-viewer
79+ ref = { setViewer }
80+ id = { props . id }
81+ className = { props . className }
82+ hidden = { props . hidden }
83+ slot = { props . slot }
84+ style = { props . style }
85+ tabIndex = { props . tabIndex }
86+ title = { props . title }
87+ />
88+ ) ;
6889}
6990
7091/**
You can’t perform that action at this time.
0 commit comments