You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/table/interface.js

203 lines
6.7 KiB

7 years ago
import PropTypes from '../_util/vue-types'
import { PaginationProps as getPaginationProps } from '../pagination'
import { SpinProps as getSpinProps } from '../spin'
import { Store } from './createStore'
const PaginationProps = getPaginationProps()
const SpinProps = getSpinProps()
// export type CompareFn<T> = ((a: T, b: T) => number);
export const ColumnFilterItem = PropTypes.shape({
text: PropTypes.string,
value: PropTypes.string,
children: PropTypes.array,
}).loose
export const ColumnProps = {
title: PropTypes.any,
// key?: React.Key;
dataIndex: PropTypes.string,
customRender: PropTypes.func,
7 years ago
customCell: PropTypes.func,
customHeaderCell: PropTypes.func,
7 years ago
align: PropTypes.oneOf(['left', 'right', 'center']),
7 years ago
filters: PropTypes.arrayOf(ColumnFilterItem),
// onFilter: (value: any, record: T) => PropTypes.bool,
filterMultiple: PropTypes.bool,
filterDropdown: PropTypes.any,
filterDropdownVisible: PropTypes.bool,
// onFilterDropdownVisibleChange?: (visible: boolean) => void;
sorter: PropTypes.oneOfType([PropTypes.boolean, PropTypes.func]),
defaultSortOrder: PropTypes.oneOf(['ascend', 'descend']),
colSpan: PropTypes.number,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
7 years ago
className: PropTypes.string,
7 years ago
fixed: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['left', 'right'])]),
filterIcon: PropTypes.any,
filteredValue: PropTypes.array,
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
6 years ago
sortOrder: PropTypes.oneOf(['ascend', 'descend']),
7 years ago
// children?: ColumnProps<T>[];
// onCellClick?: (record: T, event: any) => void;
// onCell?: (record: T) => any;
// onHeaderCell?: (props: ColumnProps<T>) => any;
}
// export interface TableComponents {
// table?: any;
// header?: {
// wrapper?: any;
// row?: any;
// cell?: any;
// };
// body?: {
// wrapper?: any;
// row?: any;
// cell?: any;
// };
// }
export const TableLocale = PropTypes.shape({
filterTitle: PropTypes.string,
filterConfirm: PropTypes.any,
filterReset: PropTypes.any,
emptyText: PropTypes.any,
selectAll: PropTypes.any,
selectInvert: PropTypes.any,
}).loose
export const RowSelectionType = PropTypes.oneOf(['checkbox', 'radio'])
// export type SelectionSelectFn<T> = (record: T, selected: boolean, selectedRows: Object[]) => any;
export const TableRowSelection = {
type: RowSelectionType,
selectedRowKeys: PropTypes.array,
// onChange?: (selectedRowKeys: string[] | number[], selectedRows: Object[]) => any;
getCheckboxProps: PropTypes.func,
// onSelect?: SelectionSelectFn<T>;
// onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => any;
// onSelectInvert?: (selectedRows: Object[]) => any;
selections: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),
hideDefaultSelections: PropTypes.bool,
fixed: PropTypes.bool,
7 years ago
columnWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
6 years ago
selectWay: PropTypes.oneOf(['onSelect', 'onSelectMultiple', 'onSelectAll', 'onSelectInvert']),
columnTitle: PropTypes.any,
7 years ago
}
export const TableProps = {
prefixCls: PropTypes.string,
dropdownPrefixCls: PropTypes.string,
7 years ago
rowSelection: PropTypes.oneOfType([PropTypes.shape(TableRowSelection).loose, null]),
7 years ago
pagination: PropTypes.oneOfType([
PropTypes.shape({
...PaginationProps,
position: PropTypes.oneOf(['top', 'bottom', 'both']),
}).loose,
PropTypes.bool,
]),
7 years ago
size: PropTypes.oneOf(['default', 'middle', 'small', 'large']),
7 years ago
dataSource: PropTypes.array,
components: PropTypes.object,
columns: PropTypes.array,
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
rowClassName: PropTypes.func,
expandedRowRender: PropTypes.any,
defaultExpandAllRows: PropTypes.bool,
defaultExpandedRowKeys: PropTypes.array,
expandedRowKeys: PropTypes.array,
expandIconAsCell: PropTypes.bool,
expandIconColumnIndex: PropTypes.number,
expandRowByClick: PropTypes.bool,
// onExpandedRowsChange?: (expandedRowKeys: string[] | number[]) => void;
// onExpand?: (expanded: boolean, record: T) => void;
// onChange?: (pagination: PaginationProps | boolean, filters: string[], sorter: Object) => any;
loading: PropTypes.oneOfType([PropTypes.shape(SpinProps).loose, PropTypes.bool]),
locale: PropTypes.object,
indentSize: PropTypes.number,
// onRowClick?: (record: T, index: number, event: Event) => any;
7 years ago
customRow: PropTypes.func,
customHeaderRow: PropTypes.func,
7 years ago
useFixedHeader: PropTypes.bool,
bordered: PropTypes.bool,
showHeader: PropTypes.bool,
7 years ago
footer: PropTypes.func,
title: PropTypes.func,
7 years ago
scroll: PropTypes.object,
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
6 years ago
childrenColumnName: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
7 years ago
bodyStyle: PropTypes.any,
// className?: PropTypes.string,
// style?: React.CSSProperties;
// children?: React.ReactNode;
}
// export interface TableStateFilters {
// [key: string]: string[];
// }
// export interface TableState<T> {
// pagination: PaginationProps;
// filters: TableStateFilters;
// sortColumn: ColumnProps<T> | null;
// sortOrder: PropTypes.string,
// }
// export type SelectionItemSelectFn = (key: string[]) => any;
// export interface SelectionItem {
// key: PropTypes.string,
// text: PropTypes.any,
// onSelect: SelectionItemSelectFn;
// }
export const SelectionCheckboxAllProps = {
store: Store,
locale: PropTypes.any,
disabled: PropTypes.bool,
getCheckboxPropsByItem: PropTypes.func,
getRecordKey: PropTypes.func,
data: PropTypes.array,
prefixCls: PropTypes.string,
// onSelect: (key: string, index: number, selectFunc: any) => void;
hideDefaultSelections: PropTypes.bool,
selections: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),
getPopupContainer: PropTypes.func,
}
// export interface SelectionCheckboxAllState {
// checked: PropTypes.bool,
// indeterminate: PropTypes.bool,
// }
export const SelectionBoxProps = {
store: Store,
type: RowSelectionType,
defaultSelection: PropTypes.arrayOf([PropTypes.string, PropTypes.number]),
7 years ago
rowIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
7 years ago
name: PropTypes.string,
disabled: PropTypes.bool,
id: PropTypes.string,
7 years ago
// onChange: React.ChangeEventHandler<HTMLInputElement>;
}
// export interface SelectionBoxState {
// checked?: PropTypes.bool,
// }
export const FilterMenuProps = {
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
6 years ago
_propsSymbol: PropTypes.any,
7 years ago
locale: TableLocale,
selectedKeys: PropTypes.arrayOf([PropTypes.string, PropTypes.number]),
7 years ago
column: PropTypes.object,
7 years ago
confirmFilter: PropTypes.func,
prefixCls: PropTypes.string,
dropdownPrefixCls: PropTypes.string,
getPopupContainer: PropTypes.func,
7 years ago
handleFilter: PropTypes.func,
7 years ago
}
// export interface FilterMenuState {
// selectedKeys: string[];
// keyPathOfSelectedItem: { [key: string]: string };
// visible?: PropTypes.bool,
// }