Skip to content

Commit 84cdca4

Browse files
lewandomandreancardonakodiakhq[bot]
authored
fix(DataTableSkeleton): adjust TypeScript types to match behavior (#14114)
Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 330b4bf commit 84cdca4

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

packages/react/src/components/DataTableSkeleton/DataTableSkeleton.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,59 @@
66
*/
77

88
import PropTypes from 'prop-types';
9-
import React from 'react';
9+
import React, { TableHTMLAttributes } from 'react';
1010
import cx from 'classnames';
1111
import { 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

5664
const DataTableSkeleton = ({

0 commit comments

Comments
 (0)