2019-01-01 12:13:51 +08:00
|
|
|
// Project: https://github.com/vueComponent/ant-design-vue
|
|
|
|
// Definitions by: akki-jat <https://github.com/akki-jat>
|
|
|
|
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
import { AntdComponent } from '../component';
|
|
|
|
import { VNode } from 'vue';
|
|
|
|
import { ScopedSlot } from 'vue/types/vnode';
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
export interface ColumnFilterItem {
|
|
|
|
text?: string;
|
|
|
|
value?: string;
|
|
|
|
children?: any;
|
|
|
|
}
|
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
export declare type SortOrder = 'ascend' | 'descend';
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
export declare class Column extends AntdComponent {
|
|
|
|
/**
|
|
|
|
* specify how content is aligned
|
|
|
|
* @default 'left'
|
|
|
|
* @type string
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
align?: 'left' | 'right' | 'center';
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Span of this column's title
|
|
|
|
* @type number
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
colSpan?: number;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Display field of the data record, could be set like a.b.c
|
|
|
|
* @type string
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
dataIndex?: string;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default order of sorted values: 'ascend' 'descend' null
|
|
|
|
* @type string
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
defaultSortOrder?: SortOrder;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Customized filter overlay
|
|
|
|
* @type any (slot)
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filterDropdown?: any;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether filterDropdown is visible
|
|
|
|
* @type boolean
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filterDropdownVisible?: boolean;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the dataSource is filtered
|
|
|
|
* @default false
|
|
|
|
* @type boolean
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filtered?: boolean;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Controlled filtered value, filter icon will highlight
|
|
|
|
* @type string[]
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filteredValue?: string[];
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Customized filter icon
|
|
|
|
* @default false
|
|
|
|
* @type any
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filterIcon?: any;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether multiple filters can be selected
|
|
|
|
* @default true
|
|
|
|
* @type boolean
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filterMultiple?: boolean;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Filter menu config
|
|
|
|
* @type object[]
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
filters?: ColumnFilterItem[];
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set column to be fixed: true(same as left) 'left' 'right'
|
|
|
|
* @default false
|
|
|
|
* @type boolean | string
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
fixed?: boolean | 'left' | 'right';
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unique key of this column, you can ignore this prop if you've set a unique dataIndex
|
|
|
|
* @type string
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
key?: string;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config
|
|
|
|
* @type Function | ScopedSlot
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
customRender?: Function | ScopedSlot;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sort function for local sort, see Array.sort's compareFunction. If you need sort buttons only, set to true
|
|
|
|
* @type boolean | Function
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
sorter?: boolean | Function;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Order of sorted values: 'ascend' 'descend' false
|
|
|
|
* @type boolean | string
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
sortOrder?: boolean | SortOrder;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Title of this column
|
|
|
|
* @type any (string | slot)
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
title?: any;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Width of this column
|
|
|
|
* @type string | number
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
width?: string | number;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set props on per cell
|
|
|
|
* @type Function
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
customCell?: (
|
2019-01-05 18:09:27 +08:00
|
|
|
record: any,
|
|
|
|
rowIndex: number,
|
2019-01-01 12:13:51 +08:00
|
|
|
) => {
|
|
|
|
props: object;
|
|
|
|
attrs: object;
|
|
|
|
on: object;
|
|
|
|
class: object;
|
|
|
|
style: object;
|
|
|
|
nativeOn: object;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set props on per header cell
|
|
|
|
* @type
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
customHeaderCell?: (
|
2019-01-12 11:33:27 +08:00
|
|
|
column: any,
|
2019-01-01 12:13:51 +08:00
|
|
|
) => {
|
|
|
|
props: object;
|
|
|
|
attrs: object;
|
|
|
|
on: object;
|
|
|
|
class: object;
|
|
|
|
style: object;
|
|
|
|
nativeOn: object;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback executed when the confirm filter button is clicked, Use as a filter event when using template or jsx
|
|
|
|
* @type Function
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
onFilter?: Function;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback executed when filterDropdownVisible is changed, Use as a filterDropdownVisible event when using template or jsx
|
|
|
|
* @type Function
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
onFilterDropdownVisibleChange?: (visible: boolean) => void;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When using columns, you can use this property to configure the properties that support the slot,
|
|
|
|
* such as slots: { filterIcon: 'XXX'}
|
|
|
|
* @type object
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
slots?: object;
|
2019-01-01 12:13:51 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When using columns, you can use this property to configure the properties that support the slot-scope,
|
|
|
|
* such as scopedSlots: { customRender: 'XXX'}
|
|
|
|
* @type object
|
|
|
|
*/
|
2019-07-10 11:15:51 +08:00
|
|
|
scopedSlots?: object;
|
2019-01-01 12:13:51 +08:00
|
|
|
}
|