Skip to content

Commit

Permalink
fix: table ColumnProps interface #4288
Browse files Browse the repository at this point in the history
close #4288
  • Loading branch information
tangjinzhou committed Jun 29, 2021
1 parent 0c3d9d5 commit c563097
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions components/table/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ export const columnProps = {
align: PropTypes.oneOf(tuple('left', 'right', 'center')),
ellipsis: PropTypes.looseBool,
filters: PropTypes.arrayOf(ColumnFilterItem),
// onFilter: (value: any, record: T) => PropTypes.looseBool,
onFilter: {
type: Function as PropType<(value: any, record: any) => boolean>,
},
filterMultiple: PropTypes.looseBool,
filterDropdown: PropTypes.any,
filterDropdownVisible: PropTypes.looseBool,
// onFilterDropdownVisibleChange?: (visible: boolean) => void;
onFilterDropdownVisibleChange: {
type: Function as PropType<(visible: boolean) => void>,
},
sorter: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]),
defaultSortOrder: PropTypes.oneOf(tuple('ascend', 'descend')),
colSpan: PropTypes.number,
Expand All @@ -51,7 +55,13 @@ export const columnProps = {
};

export type ColumnProps = Partial<ExtractPropTypes<typeof columnProps>> & {
slots?: Record<string, string>;
slots?: {
title?: string;
filterIcon?: string;
filterDropdown?: string;
customRender?: string;
[key: string]: string;
};
};

export interface TableComponents {
Expand Down
2 changes: 1 addition & 1 deletion v2-doc

0 comments on commit c563097

Please sign in to comment.