File tree Expand file tree Collapse file tree
packages/react/src/components/DataTableSkeleton Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 */
77
88import PropTypes from 'prop-types' ;
9- import React from 'react' ;
9+ import React , { TableHTMLAttributes } from 'react' ;
1010import cx from 'classnames' ;
1111import { usePrefix } from '../../internal/usePrefix' ;
1212
13- export interface DataTableSkeletonProps {
13+ export interface DataTableSkeletonHeader {
1414 /**
15- * Specify an optional className to add.
15+ * Optionally specify header label
1616 */
17- className ?: string ;
17+ header ?: string ;
18+
19+ /**
20+ * Optionally specify header key
21+ */
22+ key ?: string ;
23+ }
1824
25+ export interface DataTableSkeletonProps
26+ extends TableHTMLAttributes < HTMLTableElement > {
1927 /**
2028 * Specify the number of columns that you want to render in the skeleton state
2129 */
22- columnCount : number ;
30+ columnCount ? : number ;
2331
2432 /**
2533 * Optionally specify whether you want the Skeleton to be rendered as a
2634 * compact DataTable
2735 */
28- compact : boolean ;
36+ compact ? : boolean ;
2937
3038 /**
3139 * Optionally specify the displayed headers
3240 */
33- headers ?: [ { header : string ; key : string } ] | { header : string ; key : string } ;
41+ headers ?: DataTableSkeletonHeader [ ] ;
3442
3543 /**
3644 * Specify the number of rows that you want to render in the skeleton state
3745 */
38- rowCount : number ;
46+ rowCount ? : number ;
3947
4048 /**
4149 * Specify if the table header should be rendered as part of the skeleton.
4250 */
43- showHeader : boolean ;
51+ showHeader ? : boolean ;
4452
4553 /**
4654 * Specify if the table toolbar should be rendered as part of the skeleton.
4755 */
48- showToolbar : boolean ;
56+ showToolbar ? : boolean ;
4957
5058 /**
5159 * Optionally specify whether you want the DataTable to be zebra striped
5260 */
53- zebra : boolean ;
61+ zebra ? : boolean ;
5462}
5563
5664const DataTableSkeleton = ( {
You can’t perform that action at this time.
0 commit comments