Merge pull request #23319 from thevtm/react-virtualized-update-column-props

Add missing properties to React Virtualized > ColumnProps
This commit is contained in:
Ron Buckton 2018-02-07 17:11:52 -08:00 committed by GitHub
commit aa36a6378f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -74,6 +74,8 @@ export type ColumnProps = {
columnData?: any;
/** Uniquely identifies the row-data attribute correspnding to this cell */
dataKey: any;
/** Default sort order when clicked for the first time. Valid options include "ASC" and "DESC". Defaults to "ASC" */
defaultSortDirection?: SortDirectionType;
/** If sort is enabled for the table at large, disable it for this column */
disableSort?: boolean;
/** Flex grow style; defaults to 0 */
@ -87,6 +89,10 @@ export type ColumnProps = {
* ({ columnData: object, dataKey: string, disableSort: boolean, label: string, sortBy: string, sortDirection: string }): PropTypes.node
*/
headerRenderer?: TableHeaderRenderer;
/** Optional inline style to apply to this column's header */
headerStyle?: React.CSSProperties;
/** Optional id to set on the column header; used for aria-describedby */
id?: string;
/** Header label for this column */
label?: string;
/** Maximum width of column; this property will only be used if :flexGrow is > 0. */
@ -97,8 +103,6 @@ export type ColumnProps = {
style?: React.CSSProperties;
/** Flex basis (width) for this column; This value can grow or shrink based on :flexGrow and :flexShrink properties. */
width: number;
/** Optional id to set on the column header; used for aria-describedby */
id?: string;
}
export class Column extends Component<ColumnProps> {
static propTypes: {

View File

@ -1546,12 +1546,14 @@ export class TableExample extends PureComponent<{}, any> {
}
dataKey='index'
disableSort={!this._isSortEnabled()}
defaultSortDirection={SortDirection.DESC}
width={60}
/>
}
<Column
dataKey='name'
disableSort={!this._isSortEnabled()}
defaultSortDirection={SortDirection.ASC}
headerRenderer={this._headerRenderer}
width={90}
/>