forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.d.ts
303 lines (260 loc) · 6.18 KB
/
table.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
// 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
import { AntdComponent } from '../component';
import { Spin } from '../spin';
import { ScopedSlot, VNode } from 'vue/types/vnode';
import { Pagination } from '../pagination';
import { Column } from './column';
import { ColumnGroup } from './column-group';
export declare class PaginationConfig extends Pagination {
position: 'top' | 'bottom' | 'both';
}
export interface customSelection {
/**
* Key
* @description Unique key of this selection
* @default undefined
* @type string
*/
key?: string;
/**
* Text
* @description Display text of this selection
* @default undefined
* @type string | VNode
*/
text?: string | VNode;
/**
* On Select
* @description Callback executed when this selection is clicked
* @default undefined
* @type Function
*/
onSelect?: (changeableRowKeys?: any) => any;
}
export interface TableRowSelection {
/**
* checkbox or radio
* @default 'checkbox'
* @type string
*/
type?: 'checkbox' | 'radio';
/**
* Controlled selected row keys
* @type string[]
*/
selectedRowKeys?: string[];
/**
* Get Checkbox or Radio props
* @type Function
*/
getCheckboxProps?: (record: any) => any;
/**
* Custom selection config, only displays default selections when set to true
* @type boolean | object[]
*/
selections?: boolean | customSelection[];
/**
* Remove the default Select All and Select Invert selections
* @default false
* @type boolean
*/
hideDefaultSelections?: boolean;
/**
* Fixed selection column on the left
* @type boolean
*/
fixed?: boolean;
/**
* Set the width of the selection column
* @type string | number
*/
columnWidth?: string | number;
/**
* Set the title of the selection column
* @type string | VNode
*/
columnTitle?: string | VNode;
/**
* Callback executed when selected rows change
* @type Function
*/
onChange?: (selectedRowKeys: Array<string | number>, selectedRows: object[]) => any;
/**
* Callback executed when select/deselect one row
* @type Function
*/
onSelect?: (record: any, selected: boolean, selectedRows: object[], nativeEvent: Event) => any;
/**
* Callback executed when select/deselect all rows
* @type Function
*/
onSelectAll?: (selected: boolean, selectedRows: object[], changeRows: object[]) => any;
/**
* Callback executed when row selection is inverted
* @type Function
*/
onSelectInvert?: (selectedRows: Object[]) => any;
}
export declare class Table extends AntdComponent {
static Column: typeof Column;
static ColumnGroup: typeof ColumnGroup;
/**
* Whether to show all table borders
* @default false
* @type boolean
*/
bordered: boolean;
/**
* The column contains children to display
* @default 'children'
* @type string | string[]
*/
childrenColumnName: string | string[];
/**
* Columns of table
* @type any
*/
columns: any;
/**
* Override default table elements
* @type object
*/
components: object;
/**
* Data record array to be displayed
* @type any
*/
dataSource: any;
/**
* Expand all rows initially
* @default false
* @type boolean
*/
defaultExpandAllRows: boolean;
/**
* Initial expanded row keys
* @type string[]
*/
defaultExpandedRowKeys: string[];
/**
* Current expanded row keys
* @type string[]
*/
expandedRowKeys: string[];
/**
* Expanded container render for each row
* @type Function
*/
expandedRowRender: (record: any, index: number, indent: number, expanded: boolean) => any;
/**
* Customize row expand Icon.
* @type Function | ScopedSlot
*/
expandIcon: Function | ScopedSlot;
/**
* Whether to expand row by clicking anywhere in the whole row
* @default false
* @type boolean
*/
expandRowByClick: boolean;
/**
* Table footer renderer
* @type Function | ScopedSlot
*/
footer: Function | ScopedSlot;
/**
* Indent size in pixels of tree data
* @default 15
* @type number
*/
indentSize: number;
/**
* Loading status of table
* @default false
* @type boolean | object
*/
loading: boolean | Spin;
/**
* i18n text including filter, sort, empty text, etc
* @default { filterConfirm: 'Ok', filterReset: 'Reset', emptyText: 'No Data' }
* @type object
*/
locale: object;
/**
* Pagination config or [Pagination] (/ant-design-vue/components/pagination/), hide it by setting it to false
* @type boolean | PaginationConfig
*/
pagination: boolean | PaginationConfig;
/**
* Row's className
* @type Function
*/
rowClassName: (record: any, index: number) => string;
/**
* Row's unique key, could be a string or function that returns a string
* @default 'key'
* @type string | Function
*/
rowKey: string | Function;
/**
* Row selection config
* @type object
*/
rowSelection: TableRowSelection;
/**
* Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area.
* It is recommended to set a number for x, if you want to set it to true,
* you need to add style .ant-table td { white-space: nowrap; }.
* @type object
*/
scroll: { x: number | true; y: number };
/**
* Whether to show table header
* @default true
* @type boolean
*/
showHeader: boolean;
/**
* Size of table
* @default 'default'
* @type string
*/
size: 'default' | 'middle' | 'small' | 'large';
/**
* Table title renderer
* @type Function | ScopedSlot
*/
title: Function | ScopedSlot;
/**
* Set props on per header row
* @type Function
*/
customHeaderRow: (
column: any,
index: number,
) => {
props: object;
attrs: object;
on: object;
class: object;
style: object;
nativeOn: object;
};
/**
* Set props on per row
* @type Function
*/
customRow: (
record: any,
index: number,
) => {
props: object;
attrs: object;
on: object;
class: object;
style: object;
nativeOn: object;
};
}