mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
change and undocument onSelectMultiple cause it need more disscuss
This commit is contained in:
parent
3fbcb73a2a
commit
bead75021b
@ -251,11 +251,11 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
||||
}
|
||||
if (selectWay === 'onSelect' && rowSelection.onSelect) {
|
||||
rowSelection.onSelect(record!, checked!, selectedRows, nativeEvent!);
|
||||
} else if (selectWay === 'onSelectMulti' && rowSelection.onSelectMulti) {
|
||||
} else if (selectWay === 'onSelectMultiple' && rowSelection.onSelectMultiple) {
|
||||
const changeRows = data.filter(
|
||||
(row, i) => changeRowKeys!.indexOf(this.getRecordKey(row, i)) >= 0,
|
||||
);
|
||||
rowSelection.onSelectMulti(checked!, selectedRows, changeRows);
|
||||
rowSelection.onSelectMultiple(checked!, selectedRows, changeRows);
|
||||
} else if (selectWay === 'onSelectAll' && rowSelection.onSelectAll) {
|
||||
const changeRows = data.filter(
|
||||
(row, i) => changeRowKeys!.indexOf(this.getRecordKey(row, i)) >= 0,
|
||||
@ -498,7 +498,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
||||
selectionDirty: true,
|
||||
});
|
||||
this.setSelectedRowKeys(selectedRowKeys, {
|
||||
selectWay: 'onSelectMulti',
|
||||
selectWay: 'onSelectMultiple',
|
||||
record,
|
||||
checked,
|
||||
changeRowKeys,
|
||||
|
@ -167,7 +167,7 @@ describe('Table.rowSelection', () => {
|
||||
const handleSelect = jest.fn();
|
||||
const rowSelection = {
|
||||
onSelect: handleSelect,
|
||||
onSelectMulti: handleSelectMulti,
|
||||
onSelectMultiple: handleSelectMulti,
|
||||
};
|
||||
const wrapper = mount(createTable({ rowSelection }));
|
||||
|
||||
|
@ -163,7 +163,6 @@ Properties for row selection.
|
||||
| type | `checkbox` or `radio` | `checkbox` \| `radio` | `checkbox` |
|
||||
| onChange | Callback executed when selected rows change | Function(selectedRowKeys, selectedRows) | - |
|
||||
| onSelect | Callback executed when select/deselect one row | Function(record, selected, selectedRows, nativeEvent) | - |
|
||||
| onSelectMulti | Callback executed when multiple rows are selected/unselected | Function(selected, selectedRows, changeRows) | - |
|
||||
| onSelectAll | Callback executed when select/deselect all rows | Function(selected, selectedRows, changeRows) | - |
|
||||
| onSelectInvert | Callback executed when row selection is inverted | Function(selectedRows) | - |
|
||||
|
||||
|
@ -62,7 +62,7 @@ export interface TableLocale {
|
||||
export type RowSelectionType = 'checkbox' | 'radio';
|
||||
export type SelectionSelectFn<T> = (record: T, selected: boolean, selectedRows: Object[], nativeEvent: Event) => any;
|
||||
|
||||
export type TableSelectWay = 'onSelect' | 'onSelectMulti' | 'onSelectAll' | 'onSelectInvert';
|
||||
export type TableSelectWay = 'onSelect' | 'onSelectMultiple' | 'onSelectAll' | 'onSelectInvert';
|
||||
|
||||
export interface TableRowSelection<T> {
|
||||
type?: RowSelectionType;
|
||||
@ -70,7 +70,7 @@ export interface TableRowSelection<T> {
|
||||
onChange?: (selectedRowKeys: string[] | number[], selectedRows: Object[]) => void;
|
||||
getCheckboxProps?: (record: T) => Object;
|
||||
onSelect?: SelectionSelectFn<T>;
|
||||
onSelectMulti?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => void;
|
||||
onSelectMultiple?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => void;
|
||||
onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => void;
|
||||
onSelectInvert?: (selectedRows: Object[]) => void;
|
||||
selections?: SelectionItem[] | boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user