Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(14831): update component and getter function types to match #17135

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,15 @@
"contributions": [
"code"
]
},
{
"login": "nevantan",
"name": "Nevan Tan",
"avatar_url": "https://avatars.githubusercontent.com/u/25013998?v=4",
"profile": "https://gitlab.com/nevantan",
"contributions": [
"code"
]
}
],
"commitConvention": "none"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
<td align="center"><a href="https://github.com/lluisrojass"><img src="https://avatars.githubusercontent.com/u/15043356?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luis</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=lluisrojass" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/lharrison13"><img src="https://avatars.githubusercontent.com/u/172074450?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luke Harrison</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=lharrison13" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/tekno0ryder"><img src="https://avatars.githubusercontent.com/u/8721803?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ahmed Alsinan</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=tekno0ryder" title="Code">💻</a></td>
<td align="center"><a href="https://gitlab.com/nevantan"><img src="https://avatars.githubusercontent.com/u/25013998?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nevan Tan</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=nevantan" title="Code">💻</a></td>
</tr>
</table>

Expand Down
9 changes: 5 additions & 4 deletions packages/react/src/components/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import PropTypes from 'prop-types';
import React from 'react';
import type { MouseEvent } from 'react';
import isEqual from 'react-fast-compare';
import getDerivedStateFromProps from './state/getDerivedStateFromProps';
import { getNextSortState } from './state/sorting';
Expand Down Expand Up @@ -154,20 +155,20 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
['id']: string;
[key: string]: unknown;
};
getSelectionProps: (getSelectionPropsArgs: {
getSelectionProps: (getSelectionPropsArgs?: {
onClick?: (e: MouseEvent) => void;
row: DataTableRow<ColTypes>;
[key: string]: unknown;
}) => {
ariaLabel: string;
'aria-label': string;
checked: boolean | undefined;
checked?: boolean | undefined;
disabled?: boolean | undefined;
id: string;
indeterminate?: boolean;
name: string;
onSelect: (e: MouseEvent) => void;
radio?: boolean | null;
radio?: boolean | undefined;
[key: string]: unknown;
};
getToolbarProps: (getToolbarPropsArgs?: { [key: string]: unknown }) => {
Expand Down Expand Up @@ -640,7 +641,7 @@ class DataTable<RowType, ColTypes extends any[]> extends React.Component<
ariaLabel: t(translationKey), // TODO remove in v12
'aria-label': t(translationKey),
disabled: row.disabled,
radio: this.props.radio || null,
radio: this.props.radio,
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/DataTable/TableExpandRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface TableExpandRowProps extends PropsWithChildren<TableRowProps> {
* Specify whether this row is expanded or not. This helps coordinate data
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
*/
isExpanded: boolean;
isExpanded?: boolean;

/**
* Hook for when a listener initiates a request to expand the given row
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/DataTable/TableSelectAll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface TableSelectAllProps {
/**
* Specify whether all items are selected, or not
*/
checked: boolean;
checked?: boolean;

/**
* The CSS class names of the cell that wraps the underlying input control
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/DataTable/TableSelectRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface TableSelectRowProps {
/**
* Specify whether this row is selected, or not
*/
checked: boolean;
checked?: boolean;

/**
* The CSS class names of the cell that wraps the underlying input control
Expand Down
Loading