1 | import { RenderFunction, SetupContext, Ref, ComputedRef, ComponentPublicInstance, ComponentInternalInstance, VNode } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, VxeEvent, SizeType, ValueOf, VNodeStyle, SlotVNodeType } from './component'
|
3 | import { VxeTableProEmits, VxeTableProDefines } from './plugins/extend-cell-area'
|
4 | import { VxeColumnPropTypes, VxeColumnProps, VxeColumnSlotTypes } from './column'
|
5 | import { VXETableConfigOptions, VxeGlobalRendererHandles } from './v-x-e-table'
|
6 | import { VxeToolbarConstructor, VxeToolbarInstance } from './toolbar'
|
7 | import { VxeTooltipInstance } from './tooltip'
|
8 | import { VxeGridConstructor } from './grid'
|
9 | import { VxeTableMenuPanelInstance } from './module/menu'
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export const VxeTable: VXEComponent<VxeTableProps<any>, VxeTableEventProps<any>, VxeTableSlots<any>>
|
18 |
|
19 |
|
20 |
|
21 | export const Table: typeof VxeTable
|
22 |
|
23 | export type VxeTableInstance<D = any> = ComponentPublicInstance<VxeTableProps<D>, VxeTableConstructor<D>>
|
24 |
|
25 | export type VxeTableDataRow = Record<string, any>
|
26 |
|
27 | export interface VxeTableConstructor<D = any> extends VxeComponentBase, VxeTableMethods<D> {
|
28 | props: Readonly<VxeTableProps<D>>
|
29 | context: SetupContext<VxeTableEmits>
|
30 | instance: ComponentInternalInstance
|
31 | reactData: TableReactData<D>
|
32 | internalData: TableInternalData<D>
|
33 | getRefMaps(): TablePrivateRef
|
34 | getComputeMaps(): TablePrivateComputed<D>
|
35 | renderVN: RenderFunction
|
36 |
|
37 | xegrid: VxeGridConstructor<D> | null
|
38 | }
|
39 |
|
40 | export interface TablePrivateRef {
|
41 | refElem: Ref<HTMLDivElement>
|
42 | refTooltip: Ref<VxeTooltipInstance>
|
43 | refValidTooltip: Ref<VxeTooltipInstance>
|
44 | refTableFilter: Ref<ComponentPublicInstance>
|
45 | refTableCustom: Ref<ComponentPublicInstance>
|
46 | refTableMenu: Ref<VxeTableMenuPanelInstance>
|
47 | refTableHeader: Ref<ComponentPublicInstance>
|
48 | refTableBody: Ref<ComponentPublicInstance>
|
49 | refTableFooter: Ref<ComponentPublicInstance>
|
50 | refTableLeftHeader: Ref<ComponentPublicInstance>
|
51 | refTableLeftBody: Ref<ComponentPublicInstance>
|
52 | refTableLeftFooter: Ref<ComponentPublicInstance>
|
53 | refTableRightHeader: Ref<ComponentPublicInstance>
|
54 | refTableRightBody: Ref<ComponentPublicInstance>
|
55 | refTableRightFooter: Ref<ComponentPublicInstance>
|
56 | refLeftContainer: Ref<HTMLDivElement>
|
57 | refRightContainer: Ref<HTMLDivElement>
|
58 | refCellResizeBar: Ref<HTMLDivElement>
|
59 | }
|
60 | export interface VxeTablePrivateRef extends TablePrivateRef { }
|
61 |
|
62 | export interface TablePrivateComputed<D = VxeTableDataRow> {
|
63 | computeSize: ComputedRef<VxeTablePropTypes.Size>
|
64 | computeValidOpts: ComputedRef<VxeTablePropTypes.ValidOpts<D>>
|
65 | computeSXOpts: ComputedRef<VxeTablePropTypes.SXOpts>
|
66 | computeSYOpts: ComputedRef<VxeTablePropTypes.SYOpts>
|
67 | computeColumnOpts: ComputedRef<VxeTablePropTypes.ColumnOpts>
|
68 | computeRowOpts: ComputedRef<VxeTablePropTypes.RowOpts>
|
69 | computeResizeleOpts: ComputedRef<VxeTablePropTypes.ResizeOpts>
|
70 | computeResizableOpts: ComputedRef<VxeTablePropTypes.ResizableOpts<D>>
|
71 | computeSeqOpts: ComputedRef<VxeTablePropTypes.SeqOpts<D>>
|
72 | computeRadioOpts: ComputedRef<VxeTablePropTypes.RadioOpts<D>>
|
73 | computeCheckboxOpts: ComputedRef<VxeTablePropTypes.CheckboxOpts<D>>
|
74 | computeTooltipOpts: ComputedRef<VxeTablePropTypes.TooltipOpts<D>>
|
75 | computeEditOpts: ComputedRef<VxeTablePropTypes.EditOpts<D>>
|
76 | computeSortOpts: ComputedRef<VxeTablePropTypes.SortConfig<D>>
|
77 | computeFilterOpts: ComputedRef<VxeTablePropTypes.FilterOpts<D>>
|
78 | computeMouseOpts: ComputedRef<VxeTablePropTypes.MouseOpts>
|
79 | computeAreaOpts: ComputedRef<VxeTablePropTypes.AreaOpts>
|
80 | computeKeyboardOpts: ComputedRef<VxeTablePropTypes.KeyboardOpts>
|
81 | computeClipOpts: ComputedRef<VxeTablePropTypes.ClipOpts<D>>
|
82 | computeFNROpts: ComputedRef<VxeTablePropTypes.FNROpts<D>>
|
83 | computeHeaderMenu: ComputedRef<VxeTableDefines.MenuFirstOption>
|
84 | computeBodyMenu: ComputedRef<VxeTableDefines.MenuFirstOption>
|
85 | computeFooterMenu: ComputedRef<VxeTableDefines.MenuFirstOption>
|
86 | computeIsMenu: ComputedRef<boolean>
|
87 | computeMenuOpts: ComputedRef<VxeTablePropTypes.MenuOpts<D>>
|
88 | computeExportOpts: ComputedRef<VxeTablePropTypes.ExportOpts>
|
89 | computeImportOpts: ComputedRef<VxeTablePropTypes.ImportOpts>
|
90 | computePrintOpts: ComputedRef<VxeTablePropTypes.PrintOpts>
|
91 | computeExpandOpts: ComputedRef<VxeTablePropTypes.ExpandOpts<D>>
|
92 | computeTreeOpts: ComputedRef<VxeTablePropTypes.TreeOpts<D>>
|
93 | computeEmptyOpts: ComputedRef<VxeTablePropTypes.EmptyOpts>
|
94 | computeLoadingOpts: ComputedRef<VxeTablePropTypes.LoadingOpts>
|
95 | computeCustomOpts: ComputedRef<VxeTablePropTypes.CustomOpts<D>>
|
96 | computeFixedColumnSize: ComputedRef<number>
|
97 | computeIsMaxFixedColumn: ComputedRef<boolean>
|
98 | computeIsAllCheckboxDisabled: ComputedRef<boolean>
|
99 | }
|
100 |
|
101 | export type VxeTablePrivateComputed<D = VxeTableDataRow> = TablePrivateComputed<D>
|
102 |
|
103 | export interface TableMethods<D = VxeTableDataRow> extends TablePublicMethods<D> {
|
104 | dispatchEvent(type: ValueOf<VxeTableEmits>, params: any, evnt: Event | null): void
|
105 | }
|
106 |
|
107 | export interface TablePublicMethods<DT = VxeTableDataRow> {
|
108 | |
109 |
|
110 |
|
111 |
|
112 | clearAll(): Promise<void>
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | syncData(): Promise<void>
|
120 | |
121 |
|
122 |
|
123 |
|
124 | updateData(): Promise<void>
|
125 | |
126 |
|
127 |
|
128 |
|
129 | loadData(data: any[]): Promise<any>
|
130 | |
131 |
|
132 |
|
133 |
|
134 | reloadData(data: any[]): Promise<void>
|
135 | |
136 |
|
137 |
|
138 |
|
139 |
|
140 | setRow(rows: any | any[], record?: any): Promise<void>
|
141 | |
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | reloadRow(rows: any | any[], record?: any, field?: string): Promise<void>
|
148 | |
149 |
|
150 |
|
151 |
|
152 |
|
153 | loadTreeChildren(row: any, children: any[]): Promise<any[]>
|
154 | |
155 |
|
156 |
|
157 |
|
158 | loadColumn(columns: (VxeTableDefines.ColumnOptions<any> | VxeTableDefines.ColumnInfo<any>)[]): Promise<any>
|
159 | |
160 |
|
161 |
|
162 |
|
163 | reloadColumn(columns: (VxeTableDefines.ColumnOptions<any> | VxeTableDefines.ColumnInfo<any>)[]): Promise<any>
|
164 | |
165 |
|
166 |
|
167 |
|
168 | getRowNode(trElem: HTMLElement): {
|
169 | rowid: string
|
170 | item: any
|
171 | items: any[]
|
172 | index: number
|
173 | parent?: any
|
174 | } | null
|
175 | |
176 |
|
177 |
|
178 |
|
179 | getColumnNode(cellElem: HTMLElement): {
|
180 | colid: string
|
181 | item: VxeTableDefines.ColumnInfo<DT>
|
182 | items: VxeTableDefines.ColumnInfo<DT>[]
|
183 | index: number
|
184 | parent?: VxeTableDefines.ColumnInfo<DT>
|
185 | } | null
|
186 | |
187 |
|
188 |
|
189 |
|
190 | getRowSeq(row: any): string | number
|
191 | |
192 |
|
193 |
|
194 |
|
195 | getRowIndex(row: any): number
|
196 | |
197 |
|
198 |
|
199 |
|
200 | getVTRowIndex(row: any): number
|
201 | |
202 |
|
203 |
|
204 |
|
205 | getVMRowIndex(row: any): number
|
206 | |
207 |
|
208 |
|
209 |
|
210 | getColumnIndex(column: VxeTableDefines.ColumnInfo<any>): number
|
211 | |
212 |
|
213 |
|
214 |
|
215 | getVTColumnIndex(column: VxeTableDefines.ColumnInfo<any>): number
|
216 | |
217 |
|
218 |
|
219 |
|
220 | getVMColumnIndex(column: VxeTableDefines.ColumnInfo<any>): number
|
221 | |
222 |
|
223 |
|
224 |
|
225 |
|
226 | createData(records: any[]): Promise<any[]>
|
227 | |
228 |
|
229 |
|
230 |
|
231 |
|
232 | createRow(records: any | any[]): Promise<any | any[]>
|
233 | |
234 |
|
235 |
|
236 |
|
237 |
|
238 | revertData(rows?: any | any[], field?: string): Promise<any>
|
239 | |
240 |
|
241 |
|
242 |
|
243 |
|
244 | clearData(rows?: any | any[], field?: string): Promise<any>
|
245 | |
246 |
|
247 |
|
248 |
|
249 | isInsertByRow(row: any | null): boolean
|
250 | |
251 |
|
252 |
|
253 | removeInsertRow(): Promise<{ row: any, rows: any[] }>
|
254 | |
255 |
|
256 |
|
257 |
|
258 |
|
259 | isUpdateByRow(row: any, field?: string | null): boolean
|
260 | |
261 |
|
262 |
|
263 |
|
264 | getColumns(): VxeTableDefines.ColumnInfo<DT>[]
|
265 | getColumns(columnIndex?: number): VxeTableDefines.ColumnInfo<DT>
|
266 | |
267 |
|
268 |
|
269 |
|
270 | getColumnById(colid: string | null): VxeTableDefines.ColumnInfo<DT> | null
|
271 | |
272 |
|
273 |
|
274 |
|
275 | getColumnByField(field: string | null): VxeTableDefines.ColumnInfo<DT> | null
|
276 | |
277 |
|
278 |
|
279 |
|
280 | getTableColumn(): {
|
281 | collectColumn: VxeTableDefines.ColumnInfo<DT>[]
|
282 | fullColumn: VxeTableDefines.ColumnInfo<DT>[]
|
283 | visibleColumn: VxeTableDefines.ColumnInfo<DT>[]
|
284 | tableColumn: VxeTableDefines.ColumnInfo<DT>[]
|
285 | }
|
286 | |
287 |
|
288 |
|
289 | getData(): DT[]
|
290 | getData(rowIndex: number): DT
|
291 | |
292 |
|
293 |
|
294 | getCheckboxRecords(isFull?: boolean): DT[]
|
295 | |
296 |
|
297 |
|
298 | getParentRow(rowOrRowid: any): DT | null
|
299 | |
300 |
|
301 |
|
302 |
|
303 | getRowById(rowid: string | number | null): DT | null
|
304 | |
305 |
|
306 |
|
307 |
|
308 | getRowid(row: any | null): string
|
309 | |
310 |
|
311 |
|
312 |
|
313 | getTableData(): {
|
314 | fullData: DT[]
|
315 | visibleData: DT[]
|
316 | tableData: DT[]
|
317 | footerData: DT[][]
|
318 | }
|
319 | |
320 |
|
321 |
|
322 |
|
323 | setColumnFixed(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>, fixed: VxeColumnPropTypes.Fixed): Promise<void>
|
324 | |
325 |
|
326 |
|
327 |
|
328 | clearColumnFixed(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
329 | |
330 |
|
331 |
|
332 |
|
333 | hideColumn(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
334 | |
335 |
|
336 |
|
337 |
|
338 | showColumn(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
339 | |
340 |
|
341 |
|
342 |
|
343 |
|
344 | setColumnWidth(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>, width: number | string): Promise<void>
|
345 | |
346 |
|
347 |
|
348 |
|
349 | getColumnWidth(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): number;
|
350 | |
351 |
|
352 |
|
353 |
|
354 | resetColumn(options?: boolean | {
|
355 | visible?: boolean
|
356 | resizable?: boolean
|
357 | fixed?: boolean
|
358 | order?: boolean
|
359 | }): Promise<void>
|
360 | |
361 |
|
362 |
|
363 |
|
364 |
|
365 | resetCustom(options?: boolean | {
|
366 | visible?: boolean
|
367 | resizable?: boolean
|
368 | fixed?: boolean
|
369 | order?: boolean
|
370 | }): Promise<void>
|
371 | |
372 |
|
373 |
|
374 |
|
375 |
|
376 | refreshColumn(resiveOrder?: boolean): Promise<void>
|
377 | |
378 |
|
379 |
|
380 |
|
381 | refreshScroll(): Promise<void>
|
382 | |
383 |
|
384 |
|
385 |
|
386 | recalculate(refull?: boolean): Promise<void>
|
387 | |
388 |
|
389 |
|
390 |
|
391 |
|
392 | openTooltip(target: HTMLElement, content: string | number): Promise<any>
|
393 | |
394 |
|
395 |
|
396 | closeTooltip(): Promise<any>
|
397 | |
398 |
|
399 |
|
400 |
|
401 |
|
402 | setCheckboxRow(rows: any | any[], checked: boolean): Promise<any>
|
403 | |
404 |
|
405 |
|
406 | isAllCheckboxChecked(): boolean
|
407 | |
408 |
|
409 |
|
410 | isAllCheckboxIndeterminate(): boolean
|
411 | |
412 |
|
413 |
|
414 |
|
415 | isCheckedByCheckboxRow(row: any): boolean
|
416 | |
417 |
|
418 |
|
419 |
|
420 | isIndeterminateByCheckboxRow(row: any): boolean
|
421 | |
422 |
|
423 |
|
424 |
|
425 | toggleCheckboxRow(row: any): Promise<any>
|
426 | |
427 |
|
428 |
|
429 |
|
430 | setAllCheckboxRow(checked: boolean): Promise<any>
|
431 | |
432 |
|
433 |
|
434 | getRadioReserveRecord(isFull?: boolean): any[]
|
435 | |
436 |
|
437 |
|
438 | clearRadioReserve(): Promise<any>
|
439 | |
440 |
|
441 |
|
442 | getCheckboxReserveRecords(isFull?: boolean): any[]
|
443 | |
444 |
|
445 |
|
446 | getCheckboxIndeterminateRecords(isFull?: boolean): any[]
|
447 | |
448 |
|
449 |
|
450 | clearCheckboxReserve(): Promise<any>
|
451 | |
452 |
|
453 |
|
454 | toggleAllCheckboxRow(): Promise<any>
|
455 | |
456 |
|
457 |
|
458 | clearCheckboxRow(): Promise<any>
|
459 | |
460 |
|
461 |
|
462 |
|
463 | setCurrentRow(row: any): Promise<any>
|
464 | |
465 |
|
466 |
|
467 |
|
468 | isCheckedByRadioRow(row: any | null): boolean
|
469 | |
470 |
|
471 |
|
472 |
|
473 | setRadioRow(row: any): Promise<any>
|
474 | |
475 |
|
476 |
|
477 | setPendingRow(rows: any | any[], status: boolean): Promise<any>
|
478 | |
479 |
|
480 |
|
481 | togglePendingRow(rows: any | any[]): Promise<any>
|
482 | |
483 |
|
484 |
|
485 | getPendingRecords(): DT[]
|
486 | |
487 |
|
488 |
|
489 |
|
490 | hasPendingByRow(row: any): boolean
|
491 | |
492 |
|
493 |
|
494 | clearPendingRow(): Promise<any>
|
495 | |
496 |
|
497 |
|
498 | clearMergeCells(): Promise<any>
|
499 | |
500 |
|
501 |
|
502 | clearMergeFooterItems(): Promise<any>
|
503 | |
504 |
|
505 |
|
506 | clearCurrentRow(): Promise<any>
|
507 | |
508 |
|
509 |
|
510 | clearRadioRow(): Promise<any>
|
511 | |
512 |
|
513 |
|
514 | getMergeCells(): VxeTableDefines.MergeInfo[]
|
515 | |
516 |
|
517 |
|
518 | getMergeFooterItems(): VxeTableDefines.MergeInfo[]
|
519 | |
520 |
|
521 |
|
522 | getCurrentColumn(): VxeTableDefines.ColumnInfo<DT> | null
|
523 | |
524 |
|
525 |
|
526 | getCurrentRecord(): DT | null
|
527 | |
528 |
|
529 |
|
530 | getRadioRecord(isFull?: boolean): DT | null
|
531 | |
532 |
|
533 |
|
534 |
|
535 | setCurrentColumn(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
536 | |
537 |
|
538 |
|
539 | clearCurrentColumn(): Promise<void>
|
540 | |
541 |
|
542 |
|
543 |
|
544 |
|
545 | sort(field: string, order?: VxeTablePropTypes.SortOrder): Promise<void>
|
546 | sort(sortConfs: VxeTableDefines.SortConfs, order?: VxeTablePropTypes.SortOrder): Promise<void>
|
547 | sort(sortConfs: VxeTableDefines.SortConfs[], order?: VxeTablePropTypes.SortOrder): Promise<void>
|
548 | |
549 |
|
550 |
|
551 |
|
552 | clearSort(fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | null): Promise<void>
|
553 | |
554 |
|
555 |
|
556 |
|
557 | isSort(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): boolean
|
558 | |
559 |
|
560 |
|
561 | getSortColumns(): VxeTableDefines.SortCheckedParams[]
|
562 | |
563 |
|
564 |
|
565 | closeFilter(): Promise<any>
|
566 | |
567 |
|
568 |
|
569 |
|
570 | isFilter(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | null): boolean
|
571 | |
572 |
|
573 |
|
574 |
|
575 | isActiveFilterByColumn(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | null): boolean
|
576 | |
577 |
|
578 |
|
579 |
|
580 | isRowExpandLoaded(row: any | null): boolean
|
581 | |
582 |
|
583 |
|
584 | clearRowExpandLoaded(row: any): Promise<void>
|
585 | |
586 |
|
587 |
|
588 |
|
589 | reloadRowExpand(row: any): Promise<void>
|
590 | |
591 |
|
592 |
|
593 | reloadExpandContent(row: any): Promise<void>
|
594 | |
595 |
|
596 |
|
597 |
|
598 | toggleRowExpand(row: any): Promise<void>
|
599 | |
600 |
|
601 |
|
602 |
|
603 |
|
604 | setAllRowExpand(checked: boolean): Promise<void>
|
605 | |
606 |
|
607 |
|
608 |
|
609 |
|
610 | setRowExpand(rows: any | any[], checked: boolean): Promise<void>
|
611 | |
612 |
|
613 |
|
614 |
|
615 | isRowExpandByRow(row: any | null): boolean
|
616 | |
617 |
|
618 |
|
619 | isExpandByRow(row: any | null): boolean
|
620 | |
621 |
|
622 |
|
623 | clearRowExpand(): Promise<void>
|
624 | |
625 |
|
626 |
|
627 | clearRowExpandReserve(): Promise<void>
|
628 | |
629 |
|
630 |
|
631 | getRowExpandRecords(): DT[]
|
632 | |
633 |
|
634 |
|
635 |
|
636 | getTreeExpandRecords(): DT[]
|
637 | |
638 |
|
639 |
|
640 | isTreeExpandLoaded(row: any | null): boolean
|
641 | |
642 |
|
643 |
|
644 | clearTreeExpandLoaded(row: any): Promise<any>
|
645 | |
646 |
|
647 |
|
648 |
|
649 | reloadTreeExpand(row: any): Promise<any>
|
650 | |
651 |
|
652 |
|
653 | reloadTreeChilds(row: any): Promise<any>
|
654 | |
655 |
|
656 |
|
657 |
|
658 | toggleTreeExpand(row: any): Promise<any>
|
659 | |
660 |
|
661 |
|
662 |
|
663 |
|
664 | setAllTreeExpand(checked: boolean): Promise<void>
|
665 | |
666 |
|
667 |
|
668 |
|
669 |
|
670 | setTreeExpand(rows: any | any[], checked: boolean): Promise<void>
|
671 | |
672 |
|
673 |
|
674 |
|
675 | isTreeExpandByRow(row: any | null): boolean
|
676 | |
677 |
|
678 |
|
679 | clearTreeExpand(): Promise<void>
|
680 | |
681 |
|
682 |
|
683 | clearTreeExpandReserve(): Promise<void>
|
684 | |
685 |
|
686 |
|
687 | getScroll(): {
|
688 | virtualX: boolean
|
689 | virtualY: boolean
|
690 | scrollTop: number
|
691 | scrollLeft: number
|
692 | }
|
693 | |
694 |
|
695 |
|
696 |
|
697 |
|
698 | scrollTo(scrollLeft: number | null, scrollTop?: number | null): Promise<void>
|
699 | |
700 |
|
701 |
|
702 |
|
703 |
|
704 | scrollToRow(row: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): Promise<any>
|
705 | |
706 |
|
707 |
|
708 |
|
709 | scrollToColumn(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>): Promise<any>
|
710 | |
711 |
|
712 |
|
713 | clearScroll(): Promise<any>
|
714 | |
715 |
|
716 |
|
717 | updateFooter(): Promise<any>
|
718 | |
719 |
|
720 |
|
721 |
|
722 | updateStatus(
|
723 | params: {
|
724 | row: DT
|
725 | column: VxeTableDefines.ColumnInfo<DT>
|
726 | },
|
727 | cellValue?: any
|
728 | ): Promise<any>
|
729 | |
730 |
|
731 |
|
732 | removeMergeCells(merges: VxeTableDefines.MergeOptions<any> | VxeTableDefines.MergeOptions<any>[]): Promise<VxeTableDefines.MergeInfo[]>
|
733 | |
734 |
|
735 |
|
736 | removeMergeFooterItems(merges: VxeTableDefines.MergeOptions<any> | VxeTableDefines.MergeOptions<any>[]): Promise<VxeTableDefines.MergeInfo[]>
|
737 | |
738 |
|
739 |
|
740 | setMergeCells(merges: VxeTableDefines.MergeOptions<any> | VxeTableDefines.MergeOptions<any>[]): Promise<any>
|
741 | |
742 |
|
743 |
|
744 | setMergeFooterItems(merges: VxeTableDefines.MergeOptions<any> | VxeTableDefines.MergeOptions<any>[]): Promise<any>
|
745 | |
746 |
|
747 |
|
748 | updateCellAreas(): Promise<void>
|
749 | |
750 |
|
751 |
|
752 |
|
753 | connect(toolbar: VxeToolbarConstructor | VxeToolbarInstance): Promise<void>
|
754 | |
755 |
|
756 |
|
757 | focus(): Promise<void>
|
758 | |
759 |
|
760 |
|
761 | blur(): Promise<void>
|
762 | }
|
763 |
|
764 | export interface VxeTableMethods<D = VxeTableDataRow> extends TableMethods<D> { }
|
765 |
|
766 | export interface TablePrivateMethods<D = VxeTableDataRow> {
|
767 | getSetupOptions(): Required<VXETableConfigOptions>
|
768 | updateAfterDataIndex(): void
|
769 | callSlot<T>(slotFunc: ((params: T) => SlotVNodeType | SlotVNodeType[]) | string | null, params: T): SlotVNodeType[]
|
770 | getParentElem(): Element | null
|
771 | getParentHeight(): number
|
772 | getExcludeHeight(): number
|
773 | defineField(records: any[]): any[]
|
774 | handleTableData(force?: boolean): Promise<any>
|
775 | cacheRowMap(isSource?: boolean): void
|
776 | cacheSourceMap(fullData: any[]): void
|
777 | saveCustomResizable(isReset?: boolean): void
|
778 | saveCustomSort(isReset?: boolean): void
|
779 | saveCustomVisible(): void
|
780 | saveCustomFixed(): void
|
781 | analyColumnWidth(): void
|
782 | checkSelectionStatus(): void
|
783 | handleSelectRow(params: any, value: any, isForce?: boolean): void
|
784 | handleCustom(): Promise<void>
|
785 | handleUpdateDataQueue(): void
|
786 | handleRefreshColumnQueue(): void
|
787 | preventEvent(evnt: any, type: any, args?: any, next?: any, end?: any): any
|
788 | triggerHeaderTitleEvent(evnt: MouseEvent, iconParams: VxeColumnPropTypes.TitlePrefix | VxeColumnPropTypes.TitleSuffix, params: VxeTableDefines.CellRenderHeaderParams<any>): void
|
789 | triggerHeaderTooltipEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderHeaderParams<any>): void
|
790 | triggerBodyTooltipEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderBodyParams<any>): void
|
791 | triggerFooterTooltipEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderFooterParams<any>): void
|
792 | handleTargetLeaveEvent(evnt: MouseEvent): void
|
793 | triggerHeaderCellClickEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderHeaderParams<any>): void
|
794 | triggerHeaderCellDblclickEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderHeaderParams<any>): void
|
795 | triggerCellClickEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderBodyParams<any>): void
|
796 | triggerCellDblclickEvent(evnt: MouseEvent, params: VxeTableDefines.CellRenderBodyParams<any>): void
|
797 | handleToggleCheckRowEvent(evnt: Event | null, params: { row: any }): void
|
798 | triggerCheckRowEvent(evnt: Event, params: { row: any }, value: boolean): void
|
799 | triggerCheckAllEvent(evnt: MouseEvent | null, value: boolean): void
|
800 | triggerRadioRowEvent(evnt: Event, params: { row: any }): void
|
801 | triggerCurrentRowEvent(evnt: Event, params: {
|
802 | $table: VxeTableConstructor<any> & VxeTablePrivateMethods<any>
|
803 | row: any
|
804 | rowIndex: number
|
805 | $rowIndex: number
|
806 | }): void
|
807 | triggerRowExpandEvent(evnt: Event, params: VxeTableDefines.CellRenderBodyParams<any>): void
|
808 | triggerTreeExpandEvent(evnt: Event, params: VxeTableDefines.CellRenderBodyParams<any>): void
|
809 | triggerSortEvent(evnt: Event, column: VxeTableDefines.ColumnInfo<any>, order: VxeTablePropTypes.SortOrder): void
|
810 | triggerScrollXEvent(evnt: Event): void
|
811 | triggerScrollYEvent(evnt: Event): void
|
812 | scrollToTreeRow(row: any): Promise<any>
|
813 | updateScrollYStatus(fullData?: any[]): boolean
|
814 | updateScrollXSpace(): void
|
815 | updateScrollYSpace(): void
|
816 | updateScrollXData(): void
|
817 | updateScrollYData(): void
|
818 | checkScrolling(): void
|
819 | updateZindex(): void
|
820 | handleCheckedCheckboxRow(rows: any, value: boolean, isForce?: boolean): Promise<any>
|
821 | triggerHoverEvent(evnt: any, params: any): void
|
822 | setHoverRow(row: any): void
|
823 | clearHoverRow(): void
|
824 | getCell(row: any, column: VxeTableDefines.ColumnInfo<any>): HTMLTableDataCellElement | null
|
825 | getCellLabel(row: any, column: VxeTableDefines.ColumnInfo<any>): any
|
826 | findRowIndexOf(list: any[], row: any): number
|
827 | eqRow(row1: any, row2: any): boolean
|
828 | }
|
829 |
|
830 | export interface VxeTablePrivateMethods<D = VxeTableDataRow> extends TablePrivateMethods<D> { }
|
831 |
|
832 | export interface TableReactData<D = VxeTableDataRow> {
|
833 | // 低性能的静态列
|
834 | staticColumns: any[]
|
835 | // 渲染的列分组
|
836 | tableGroupColumn: any[]
|
837 | // 可视区渲染的列
|
838 | tableColumn: any[]
|
839 | // 渲染中的数据
|
840 | tableData: D[]
|
841 | // 是否启用了横向 X 可视渲染方式加载
|
842 | scrollXLoad: boolean
|
843 | // 是否启用了纵向 Y 可视渲染方式加载
|
844 | scrollYLoad: boolean
|
845 | // 是否存在纵向滚动条
|
846 | overflowY: boolean
|
847 | // 是否存在横向滚动条
|
848 | overflowX: boolean
|
849 | // 纵向滚动条的宽度
|
850 | scrollbarWidth: number
|
851 | // 横向滚动条的高度
|
852 | scrollbarHeight: number
|
853 | // 最后滚动时间戳
|
854 | lastScrollTime: number
|
855 | // 行高
|
856 | rowHeight: number
|
857 | // 表格父容器的高度
|
858 | parentHeight: number
|
859 | // 是否使用分组表头
|
860 | isGroup: boolean
|
861 | isAllOverflow: boolean
|
862 | // 复选框属性,是否全选
|
863 | isAllSelected: boolean
|
864 | // 复选框属性,有选中且非全选状态
|
865 | isIndeterminate: boolean
|
866 | // 复选框属性,已选中的行集合
|
867 | selectCheckboxMaps: Record<string, D>
|
868 | // 当前行
|
869 | currentRow: D | null
|
870 | // 单选框属性,选中列
|
871 | currentColumn: any
|
872 | // 单选框属性,选中行
|
873 | selectRadioRow: D | null
|
874 | // 表尾合计数据
|
875 | footerTableData: any[][]
|
876 | // 展开列信息
|
877 | expandColumn: any
|
878 | hasFixedColumn: boolean
|
879 | // 已展开的行
|
880 | rowExpandedMaps: Record<string, D | null>
|
881 | // 懒加载中的展开行
|
882 | rowExpandLazyLoadedMaps: Record<string, D | null>
|
883 | // 树节点列信息
|
884 | treeNodeColumn: any
|
885 | // 已展开树节点
|
886 | treeExpandedMaps: Record<string, D | null>
|
887 | // 懒加载中的树节点的集合
|
888 | treeExpandLazyLoadedMaps: Record<string, D | null>
|
889 | // 树节点不确定状态的集合
|
890 | treeIndeterminateMaps: Record<string, D | null>
|
891 | // 合并单元格的对象集
|
892 | mergeList: VxeTableDefines.MergeItem<D>[]
|
893 | // 合并表尾数据的对象集
|
894 | mergeFooterList: VxeTableDefines.MergeItem<D>[]
|
895 | // 刷新列标识,当列筛选被改变时,触发表格刷新数据
|
896 | upDataFlag: number
|
897 | // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
898 | reColumnFlag: number
|
899 | // 已标记的对象集
|
900 | pendingRowMaps: Record<string, D | null>
|
901 | // 已标记的行
|
902 | pendingRowList: any[],
|
903 | // 初始化标识
|
904 | initStore: {
|
905 | filter: boolean
|
906 | import: boolean
|
907 | export: boolean
|
908 | custom: boolean
|
909 | },
|
910 | // 自定义列相关的信息
|
911 | customStore: VxeTableCustomStoreObj,
|
912 | customColumnList: VxeTableDefines.ColumnInfo<D>[]
|
913 | // 当前选中的筛选列
|
914 | filterStore: {
|
915 | isAllSelected: boolean
|
916 | isIndeterminate: boolean
|
917 | style: any
|
918 | options: any[]
|
919 | column: any
|
920 | multiple: boolean
|
921 | visible: boolean
|
922 | maxHeight: number | null
|
923 | [key: string]: any
|
924 | },
|
925 | // 存放列相关的信息
|
926 | columnStore: {
|
927 | leftList: VxeTableDefines.ColumnInfo<D>[]
|
928 | centerList: VxeTableDefines.ColumnInfo<D>[]
|
929 | rightList: VxeTableDefines.ColumnInfo<D>[]
|
930 | resizeList: VxeTableDefines.ColumnInfo<D>[]
|
931 | pxList: VxeTableDefines.ColumnInfo<D>[]
|
932 | pxMinList: VxeTableDefines.ColumnInfo<D>[]
|
933 | scaleList: VxeTableDefines.ColumnInfo<D>[]
|
934 | scaleMinList: VxeTableDefines.ColumnInfo<D>[]
|
935 | autoList: VxeTableDefines.ColumnInfo<D>[]
|
936 | },
|
937 | // 存放快捷菜单的信息
|
938 | ctxMenuStore: {
|
939 | selected: any
|
940 | visible: boolean
|
941 | showChild: boolean
|
942 | selectChild: any
|
943 | list: any[][]
|
944 | style: any
|
945 | [key: string]: any
|
946 | },
|
947 | // 存放可编辑相关信息
|
948 | editStore: {
|
949 | indexs: {
|
950 | columns: any[]
|
951 | },
|
952 | titles: {
|
953 | columns: any[]
|
954 | },
|
955 | // 选中源
|
956 | selected: {
|
957 | row: D | null
|
958 | column: any
|
959 | [key: string]: any
|
960 | },
|
961 | // 已复制源
|
962 | copyed: {
|
963 | cut: boolean
|
964 | rows: D[]
|
965 | columns: any[]
|
966 | [key: string]: any
|
967 | },
|
968 | // 激活
|
969 | actived: {
|
970 | row: D | null
|
971 | column: any
|
972 | [key: string]: any
|
973 | },
|
974 | // 当前被强制聚焦单元格,只会在鼠标点击后算聚焦
|
975 | focused: {
|
976 | row: D | null
|
977 | column: any
|
978 | [key: string]: any
|
979 | },
|
980 | insertMaps: {
|
981 | [key: string]: any
|
982 | }
|
983 | removeMaps: {
|
984 | [key: string]: any
|
985 | }
|
986 | },
|
987 | // 存放 tooltip 相关信息
|
988 | tooltipStore: {
|
989 | row: D | null
|
990 | column: any
|
991 | content: any
|
992 | visible: boolean
|
993 | }
|
994 | // 存放数据校验相关信息
|
995 | validStore: {
|
996 | visible: boolean
|
997 | },
|
998 | validErrorMaps: {
|
999 | [key: string]: {
|
1000 | row: D | null
|
1001 | column: any
|
1002 | rule: any
|
1003 | content: any
|
1004 | }
|
1005 | },
|
1006 | // 导入相关信息
|
1007 | importStore: {
|
1008 | inited: boolean
|
1009 | file: any
|
1010 | type: any
|
1011 | modeList: any[]
|
1012 | typeList: any[]
|
1013 | filename: any
|
1014 | visible: boolean
|
1015 | },
|
1016 | importParams: {
|
1017 | mode: any
|
1018 | types: any
|
1019 | message: boolean
|
1020 | },
|
1021 | // 导出相关信息
|
1022 | exportStore: {
|
1023 | inited: boolean
|
1024 | name: any
|
1025 | modeList: any[]
|
1026 | typeList: any[]
|
1027 | columns: any[]
|
1028 | isPrint: boolean
|
1029 | hasFooter: boolean
|
1030 | hasMerge: boolean
|
1031 | hasTree: boolean
|
1032 | hasColgroup: boolean
|
1033 | visible: boolean
|
1034 | },
|
1035 | exportParams: {
|
1036 | filename: any
|
1037 | sheetName: any
|
1038 | mode: any
|
1039 | type: any
|
1040 | isColgroup: boolean
|
1041 | isMerge: boolean
|
1042 | isAllExpand: boolean
|
1043 | useStyle: boolean
|
1044 | original: boolean
|
1045 | message: boolean
|
1046 | isHeader: boolean
|
1047 | isFooter: boolean
|
1048 | },
|
1049 | scrollVMLoading: boolean
|
1050 | _isResize: boolean
|
1051 | }
|
1052 |
|
1053 | export interface VxeTableCustomStoreObj {
|
1054 | btnEl: HTMLDivElement | null
|
1055 | isAll: boolean
|
1056 | isIndeterminate: boolean
|
1057 | activeBtn: boolean
|
1058 | activeWrapper: boolean
|
1059 | visible: boolean
|
1060 | maxHeight: number
|
1061 | }
|
1062 |
|
1063 | export interface VxeTableCustomStorageObj {
|
1064 | visible?: boolean
|
1065 | resizable?: boolean
|
1066 | fixed?: boolean
|
1067 | sort?: boolean
|
1068 | }
|
1069 |
|
1070 | export interface TableInternalData<D = VxeTableDataRow> {
|
1071 | tZindex: number
|
1072 | elemStore: {
|
1073 | [key: string]: Ref<HTMLElement> | null
|
1074 | }
|
1075 | // 存放横向 X 虚拟滚动相关的信息
|
1076 | scrollXStore: {
|
1077 | offsetSize: number
|
1078 | visibleSize: number
|
1079 | startIndex: number
|
1080 | endIndex: number
|
1081 | }
|
1082 | // 存放纵向 Y 虚拟滚动相关信息
|
1083 | scrollYStore: {
|
1084 | adaptive?: boolean
|
1085 | rowHeight: number
|
1086 | offsetSize: number
|
1087 | visibleSize: number
|
1088 | startIndex: number
|
1089 | endIndex: number
|
1090 | }
|
1091 | // 表格宽度
|
1092 | tableWidth: number
|
1093 | // 表格高度
|
1094 | tableHeight: number
|
1095 | // 表头高度
|
1096 | headerHeight: number
|
1097 | // 表尾高度
|
1098 | footerHeight: number
|
1099 | customHeight: number
|
1100 | customMinHeight: number
|
1101 | customMaxHeight: number
|
1102 | // 当前 hover 行
|
1103 | hoverRow: any
|
1104 | // 最后滚动位置
|
1105 | lastScrollLeft: number
|
1106 | lastScrollTop: number
|
1107 | // 单选框属性,已选中保留的行
|
1108 | radioReserveRow: any
|
1109 | // 复选框属性,已选中保留的行
|
1110 | checkboxReserveRowMap: any
|
1111 | // 行数据,已展开保留的行集合
|
1112 | rowExpandedReserveRowMap: Record<string, D>
|
1113 | // 树结构数据,已展开保留的行集合
|
1114 | treeExpandedReserveRowMap: Record<string, D>
|
1115 | // 树结构数据,不确定状态的集合
|
1116 | treeIndeterminateRowMaps: Record<string, D>
|
1117 | // 列表完整数据、条件处理后
|
1118 | tableFullData: D[]
|
1119 | afterFullData: D[]
|
1120 | afterTreeFullData: D[]
|
1121 | // 列表条件处理后数据集合
|
1122 | afterFullRowMaps: Record<string, D>
|
1123 | tableSynchData: D[]
|
1124 | tableSourceData: D[]
|
1125 | // 树的全量数据、条件处理后
|
1126 | tableFullTreeData: D[]
|
1127 | // 收集的列配置(带分组)
|
1128 | collectColumn: VxeTableDefines.ColumnInfo<D>[],
|
1129 | // 完整所有列(不带分组)
|
1130 | tableFullColumn: VxeTableDefines.ColumnInfo<D>[]
|
1131 | // 渲染所有列
|
1132 | visibleColumn: VxeTableDefines.ColumnInfo<D>[]
|
1133 | // 缓存数据集
|
1134 | fullAllDataRowIdData: Record<string, VxeTableDefines.RowCacheItem<D>>
|
1135 | sourceDataRowIdData: Record<string, D>
|
1136 | fullDataRowIdData: Record<string, VxeTableDefines.RowCacheItem<D>>
|
1137 | fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem<D>>
|
1138 | fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem<D>>
|
1139 | // 列选取状态
|
1140 | columnStatusMaps: Record<string, boolean>
|
1141 | // 行选取状态
|
1142 | rowStatusMaps: Record<string, boolean>
|
1143 |
|
1144 | // 特殊标识
|
1145 | inited: boolean
|
1146 | tooltipTimeout: any
|
1147 | initStatus: boolean
|
1148 | isActivated: boolean
|
1149 |
|
1150 | // 内部属性
|
1151 | _lastResizeTime?: any
|
1152 | _keyCtx?: any
|
1153 | _lastCallTime?: any
|
1154 | _importResolve?: ((...args: any[]) => any) | null
|
1155 | _importReject?: ((...args: any[]) => any) | null
|
1156 | _currFilterParams?: any
|
1157 | _currMenuParams?: any
|
1158 | }
|
1159 |
|
1160 | export namespace VxeTablePropTypes {
|
1161 | export type Size = SizeType
|
1162 | export type ID = string
|
1163 | export type Data<T = any> = T[]
|
1164 | export type Height = number | string
|
1165 | export type MinHeight = number | string
|
1166 | export type MaxHeight = number | string
|
1167 | export type Resizable = boolean
|
1168 | export type Stripe = boolean
|
1169 | export type Round = boolean
|
1170 | export type Border = boolean | 'default' | 'full' | 'outer' | 'inner' | 'none' | ''
|
1171 | export type Loading = boolean
|
1172 | export type Align = 'left' | 'center' | 'right' | '' | null
|
1173 | export type HeaderAlign = Align
|
1174 | export type FooterAlign = Align
|
1175 | export type ShowHeader = boolean
|
1176 | export type HighlightCurrentRow = boolean
|
1177 | export type HighlightHoverRow = boolean
|
1178 | export type HighlightCurrentColumn = boolean
|
1179 | export type HighlightHoverColumn = boolean
|
1180 | export type HighlightCell = boolean
|
1181 | export type ShowFooter = boolean
|
1182 | export type FooterData = Record<string, any>[]
|
1183 |
|
1184 | export type FooterMethod<D = VxeTableDataRow> = (params: {
|
1185 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1186 | $grid: VxeGridConstructor<D> | null | undefined
|
1187 | columns: VxeTableDefines.ColumnInfo<D>[]
|
1188 | data: D[]
|
1189 | }) => Array<string | number | null>[] | VxeTableDataRow[]
|
1190 |
|
1191 | export type RowClassName<D = VxeTableDataRow> = string | ((params: {
|
1192 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1193 | row: D
|
1194 | rowIndex: number
|
1195 | $rowIndex: number
|
1196 | _rowIndex: number
|
1197 | }) => void | null | string | { [key: string]: boolean })
|
1198 |
|
1199 | export type CellClassName<D = VxeTableDataRow> = string | ((params: {
|
1200 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1201 | row: D
|
1202 | rowIndex: number
|
1203 | $rowIndex: number
|
1204 | _rowIndex: number
|
1205 | column: VxeTableDefines.ColumnInfo<D>
|
1206 | columnIndex: number
|
1207 | $columnIndex: number
|
1208 | _columnIndex: number
|
1209 | }) => void | null | string | { [key: string]: boolean })
|
1210 |
|
1211 | export type HeaderRowClassName<D = VxeTableDataRow> = string | ((params: {
|
1212 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1213 | $rowIndex: number
|
1214 | fixed: VxeColumnPropTypes.Fixed
|
1215 | type: string
|
1216 | }) => void | null | string | { [key: string]: boolean })
|
1217 |
|
1218 | export type HeaderCellClassName<D = VxeTableDataRow> = string | ((params: {
|
1219 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1220 | $rowIndex: number
|
1221 | column: VxeTableDefines.ColumnInfo<D>
|
1222 | fixed: VxeColumnPropTypes.Fixed
|
1223 | type: string
|
1224 | }) => void | null | string | { [key: string]: boolean })
|
1225 |
|
1226 | export type FooterRowClassName<D = VxeTableDataRow> = string | ((params: {
|
1227 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1228 | row: D
|
1229 | $rowIndex: number
|
1230 | _rowIndex: number
|
1231 | fixed: VxeColumnPropTypes.Fixed
|
1232 | type: string
|
1233 | }) => void | null | string | { [key: string]: boolean })
|
1234 |
|
1235 | export type FooterCellClassName<D = VxeTableDataRow> = string | ((params: {
|
1236 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1237 | row: D
|
1238 | $rowIndex: number
|
1239 | _rowIndex: number
|
1240 | column: VxeTableDefines.ColumnInfo<D>
|
1241 | columnIndex: number
|
1242 | $columnIndex: number
|
1243 | _columnIndex: number
|
1244 | }) => void | null | string | { [key: string]: boolean })
|
1245 |
|
1246 | export type CellStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
|
1247 | row: D
|
1248 | rowIndex: number
|
1249 | $rowIndex: number
|
1250 | _rowIndex: number
|
1251 | column: VxeTableDefines.ColumnInfo<D>
|
1252 | columnIndex: number
|
1253 | $columnIndex: number
|
1254 | _columnIndex: number
|
1255 | }) => void | null | VNodeStyle)
|
1256 |
|
1257 | export type HeaderCellStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
|
1258 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1259 | $rowIndex: number
|
1260 | column: VxeTableDefines.ColumnInfo<D>
|
1261 | columnIndex: number
|
1262 | _columnIndex: number
|
1263 | }) => void | null | VNodeStyle)
|
1264 |
|
1265 | export type FooterCellStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
|
1266 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1267 | row: D
|
1268 | $rowIndex: number
|
1269 | column: VxeTableDefines.ColumnInfo<D>
|
1270 | columnIndex: number
|
1271 | $columnIndex: number
|
1272 | _columnIndex: number
|
1273 | }) => void | null | VNodeStyle)
|
1274 |
|
1275 | export type RowStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
|
1276 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1277 | row: D
|
1278 | rowIndex: number
|
1279 | $rowIndex: number
|
1280 | _rowIndex: number
|
1281 | }) => void | null | VNodeStyle)
|
1282 |
|
1283 | export type HeaderRowStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
|
1284 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1285 | $rowIndex: number
|
1286 | fixed: VxeColumnPropTypes.Fixed
|
1287 | type: string
|
1288 | }) => void | null | VNodeStyle)
|
1289 |
|
1290 | export type FooterRowStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
|
1291 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1292 | row: D
|
1293 | $rowIndex: number
|
1294 | _rowIndex: number
|
1295 | fixed: VxeColumnPropTypes.Fixed
|
1296 | type: string
|
1297 | }) => void | null | VNodeStyle)
|
1298 |
|
1299 | export type MergeCell<D = VxeTableDataRow> = VxeTableDefines.MergeOptions<D>
|
1300 | export type MergeCells<D = VxeTableDataRow> = MergeCell<D>[]
|
1301 | export type MergeFooterItem<D = VxeTableDataRow> = VxeTableDefines.MergeOptions<D>
|
1302 | export type MergeFooterItems<D = VxeTableDataRow> = MergeFooterItem<D>[]
|
1303 |
|
1304 | export type SpanMethod<D = VxeTableDataRow> = (params: {
|
1305 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1306 | column: VxeTableDefines.ColumnInfo<D>
|
1307 | columnIndex: number
|
1308 | $columnIndex: number
|
1309 | row: D
|
1310 | rowIndex: number
|
1311 | $rowIndex: number
|
1312 | _rowIndex: number
|
1313 | isHidden: boolean
|
1314 | fixed: VxeColumnPropTypes.Fixed
|
1315 | type: string
|
1316 | visibleData: D[]
|
1317 | }) => void | { rowspan: number, colspan: number }
|
1318 |
|
1319 | export type FooterSpanMethod<D = VxeTableDataRow> = (params: {
|
1320 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1321 | column: VxeTableDefines.ColumnInfo<D>
|
1322 | columnIndex: number
|
1323 | _columnIndex: number
|
1324 | $columnIndex: number
|
1325 | row: D
|
1326 | $rowIndex: number
|
1327 | _rowIndex: number
|
1328 | items: any[]
|
1329 | data: D[][]
|
1330 | }) => void | { rowspan: number, colspan: number }
|
1331 |
|
1332 | export type ShowOverflow = boolean | 'ellipsis' | 'title' | 'tooltip' | '' | null
|
1333 | export type ShowHeaderOverflow = ShowOverflow
|
1334 | export type ShowFooterOverflow = ShowOverflow
|
1335 | export type ColumnKey = boolean
|
1336 | export type RowKey = boolean
|
1337 | export type RowId = string
|
1338 | export type KeepSource = boolean
|
1339 | export type AutoResize = boolean
|
1340 | export type SyncResize = boolean | string | number
|
1341 |
|
1342 | |
1343 |
|
1344 |
|
1345 | export interface ResizeConfig {
|
1346 | refreshDelay?: number
|
1347 | }
|
1348 | export interface ResizeOpts extends ResizeConfig { }
|
1349 |
|
1350 | |
1351 |
|
1352 |
|
1353 | export interface ColumnConfig {
|
1354 | |
1355 |
|
1356 |
|
1357 | useKey?: boolean
|
1358 | |
1359 |
|
1360 |
|
1361 | isCurrent?: boolean
|
1362 | |
1363 |
|
1364 |
|
1365 | isHover?: boolean
|
1366 | |
1367 |
|
1368 |
|
1369 | resizable?: VxeColumnPropTypes.Resizable
|
1370 | |
1371 |
|
1372 |
|
1373 | width?: VxeColumnPropTypes.Width
|
1374 | |
1375 |
|
1376 |
|
1377 | minWidth?: VxeColumnPropTypes.MinWidth
|
1378 | |
1379 |
|
1380 |
|
1381 | maxWidth?: VxeColumnPropTypes.MaxWidth
|
1382 | |
1383 |
|
1384 |
|
1385 | maxFixedSize?: number
|
1386 | |
1387 |
|
1388 |
|
1389 | headerExportMethod?: VxeColumnPropTypes.HeaderExportMethod<any>
|
1390 | |
1391 |
|
1392 |
|
1393 | exportMethod?: VxeColumnPropTypes.ExportMethod<any>
|
1394 | |
1395 |
|
1396 |
|
1397 | footerExportMethod?: VxeColumnPropTypes.FooterExportMethod<any>
|
1398 | }
|
1399 | export interface ColumnOpts extends ColumnConfig { }
|
1400 |
|
1401 | |
1402 |
|
1403 |
|
1404 | export interface RowConfig {
|
1405 | |
1406 |
|
1407 |
|
1408 | useKey?: boolean
|
1409 | |
1410 |
|
1411 |
|
1412 | keyField?: string
|
1413 | |
1414 |
|
1415 |
|
1416 | isCurrent?: boolean
|
1417 | |
1418 |
|
1419 |
|
1420 | isHover?: boolean
|
1421 | |
1422 |
|
1423 |
|
1424 | resizable?: boolean
|
1425 | |
1426 |
|
1427 |
|
1428 | height?: number
|
1429 | }
|
1430 | export interface RowOpts extends RowConfig { }
|
1431 |
|
1432 | |
1433 |
|
1434 |
|
1435 | export interface CustomConfig<D = VxeTableDataRow> {
|
1436 | |
1437 |
|
1438 |
|
1439 | storage?: boolean | VxeTableCustomStorageObj
|
1440 | mode?: 'simple' | 'popup' | '' | null
|
1441 | trigger?: string,
|
1442 | immediate?: boolean
|
1443 | |
1444 |
|
1445 |
|
1446 | checkMethod?(params: { column: VxeTableDefines.ColumnInfo }): boolean
|
1447 | |
1448 |
|
1449 |
|
1450 | visibleMethod?(params: { column: VxeTableDefines.ColumnInfo }): boolean
|
1451 | allowFixed?: boolean
|
1452 | showFooter?: boolean
|
1453 | icon?: string
|
1454 | resetButtonText?: string
|
1455 | confirmButtonText?: string
|
1456 | }
|
1457 | export interface CustomOpts<D = VxeTableDataRow> extends CustomConfig<D> { }
|
1458 |
|
1459 | |
1460 |
|
1461 |
|
1462 | export interface ResizableConfig<D = VxeTableDataRow> {
|
1463 | |
1464 |
|
1465 |
|
1466 | minWidth?: number | string | ((params: {
|
1467 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1468 | column: VxeTableDefines.ColumnInfo<D>
|
1469 | columnIndex: number
|
1470 | $columnIndex: number
|
1471 | $rowIndex: number
|
1472 | cell: HTMLElement
|
1473 | }) => number | string)
|
1474 | |
1475 |
|
1476 |
|
1477 | maxWidth?: number | string | ((params: {
|
1478 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1479 | column: VxeTableDefines.ColumnInfo<D>
|
1480 | columnIndex: number
|
1481 | $columnIndex: number
|
1482 | $rowIndex: number
|
1483 | cell: HTMLElement
|
1484 | }) => number | string)
|
1485 | }
|
1486 | export interface ResizableOpts<D = VxeTableDataRow> extends ResizableConfig<D> { }
|
1487 |
|
1488 | |
1489 |
|
1490 |
|
1491 | export interface SeqConfig<D = VxeTableDataRow> {
|
1492 | startIndex?: number
|
1493 | seqMethod?(params: {
|
1494 | column: VxeTableDefines.ColumnInfo<D>
|
1495 | columnIndex: number
|
1496 | $columnIndex: number
|
1497 | row: D
|
1498 | rowIndex: number
|
1499 | $rowIndex: number
|
1500 | }): number | string
|
1501 | }
|
1502 | export interface SeqOpts<D = VxeTableDataRow> extends SeqConfig<D> { }
|
1503 |
|
1504 | interface SortConfigDefaultSort {
|
1505 | field: string
|
1506 | order: SortOrder
|
1507 | }
|
1508 |
|
1509 | |
1510 |
|
1511 |
|
1512 | export interface SortConfig<D = VxeTableDataRow> {
|
1513 | defaultSort?: SortConfigDefaultSort | SortConfigDefaultSort[]
|
1514 | orders?: SortOrder[]
|
1515 | sortMethod?(params: {
|
1516 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1517 | data: D[]
|
1518 | sortList: VxeTableDefines.SortCheckedParams[]
|
1519 | }): any[]
|
1520 | remote?: boolean
|
1521 | multiple?: boolean
|
1522 | chronological?: boolean
|
1523 | trigger?: 'default' | 'cell'
|
1524 | showIcon?: boolean
|
1525 | iconLayout?: 'horizontal' | 'vertical'
|
1526 | iconAsc?: string
|
1527 | iconDesc?: string
|
1528 | }
|
1529 | export type SortOrder = 'asc' | 'desc' | '' | null
|
1530 | export interface SortOpts<D = VxeTableDataRow> extends SortConfig<D> {
|
1531 | orders: SortOrder[]
|
1532 | }
|
1533 |
|
1534 | |
1535 |
|
1536 |
|
1537 | export interface FilterConfig<D = VxeTableDataRow> {
|
1538 | filterMethod?:(params: {
|
1539 | options: VxeTableDefines.FilterOption[]
|
1540 | values: any[]
|
1541 | cellValue: any
|
1542 | row: D
|
1543 | column: VxeTableDefines.ColumnInfo<D>
|
1544 | }) => any
|
1545 | remote?: boolean
|
1546 | showIcon?: boolean
|
1547 | iconNone?: string
|
1548 | iconMatch?: string
|
1549 | confirmButtonText?: string
|
1550 | resetButtonText?: string
|
1551 | }
|
1552 | export interface FilterOpts<D = VxeTableDataRow> extends FilterConfig<D> { }
|
1553 |
|
1554 | |
1555 |
|
1556 |
|
1557 | export interface RadioConfig<D = VxeTableDataRow> {
|
1558 | reserve?: boolean
|
1559 | labelField?: string
|
1560 | checkRowKey?: string | number
|
1561 | checkMethod?(params: {
|
1562 | row: D
|
1563 | }): boolean
|
1564 | visibleMethod?(params: {
|
1565 | row: D
|
1566 | }): boolean
|
1567 | trigger?: 'default' | 'cell' | 'row' | '' | null
|
1568 | highlight?: boolean
|
1569 | strict?: boolean
|
1570 | }
|
1571 | export interface RadioOpts<D = VxeTableDataRow> extends RadioConfig<D> { }
|
1572 |
|
1573 | |
1574 |
|
1575 |
|
1576 | export interface CheckboxConfig<D = VxeTableDataRow> {
|
1577 | reserve?: boolean
|
1578 | labelField?: string
|
1579 | checkField?: string
|
1580 | indeterminateField?: string
|
1581 | showHeader?: boolean
|
1582 | checkAll?: boolean
|
1583 | checkRowKeys?: string[] | number[]
|
1584 | checkStrictly?: boolean
|
1585 | strict?: boolean
|
1586 | isShiftKey?: boolean
|
1587 | checkMethod?(params: {
|
1588 | row: D
|
1589 | }): boolean
|
1590 | visibleMethod?(params: {
|
1591 | row: D
|
1592 | }): boolean
|
1593 | trigger?: 'default' | 'cell' | 'row' | '' | 'manual' | null
|
1594 | highlight?: boolean
|
1595 | range?: boolean
|
1596 |
|
1597 | |
1598 |
|
1599 |
|
1600 |
|
1601 | halfField?: string
|
1602 | }
|
1603 | export interface CheckboxOpts<D = VxeTableDataRow> extends CheckboxConfig<D> { }
|
1604 |
|
1605 | |
1606 |
|
1607 |
|
1608 | export interface TooltipConfig<D = VxeTableDataRow> {
|
1609 | showAll?: boolean
|
1610 | theme?: 'dark' | 'light' | '' | null
|
1611 | enterable?: boolean
|
1612 | enterDelay?: number
|
1613 | leaveDelay?: number
|
1614 | contentMethod?(params: {
|
1615 | items: any[]
|
1616 | row: D
|
1617 | rowIndex: number
|
1618 | $rowIndex: number
|
1619 | _rowIndex: number
|
1620 | column: VxeTableDefines.ColumnInfo<D>
|
1621 | columnIndex: number
|
1622 | $columnIndex: number
|
1623 | _columnIndex: number
|
1624 | type: 'header' | 'body' | 'footer' | '' | null
|
1625 | cell: HTMLElement
|
1626 | $event: any
|
1627 | }): string | null | void
|
1628 | }
|
1629 | export interface TooltipOpts<D = VxeTableDataRow> extends TooltipConfig<D> { }
|
1630 |
|
1631 | |
1632 |
|
1633 |
|
1634 | export interface ExpandConfig<D = VxeTableDataRow> {
|
1635 | labelField?: string
|
1636 | expandAll?: boolean
|
1637 | expandRowKeys?: string[] | number[]
|
1638 | accordion?: boolean
|
1639 | trigger?: 'default' | 'cell' | 'row' | '' | null
|
1640 | lazy?: boolean
|
1641 | reserve?: boolean
|
1642 | height?: number
|
1643 | loadMethod?(params: {
|
1644 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1645 | row: D
|
1646 | rowIndex: number
|
1647 | $rowIndex: number
|
1648 | }): Promise<void>
|
1649 | toggleMethod?(params: {
|
1650 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1651 | expanded: boolean
|
1652 | row: D
|
1653 | rowIndex: number
|
1654 | $rowIndex: number
|
1655 | column: VxeTableDefines.ColumnInfo<D>
|
1656 | columnIndex: number
|
1657 | $columnIndex: number
|
1658 | }): boolean
|
1659 | visibleMethod?(params: VxeTableDefines.CellRenderBodyParams<D>): boolean
|
1660 | showIcon?: boolean
|
1661 | iconOpen?: string
|
1662 | iconClose?: string
|
1663 | iconLoaded?: string
|
1664 | }
|
1665 | export interface ExpandOpts<D = VxeTableDataRow> extends ExpandConfig<D> { }
|
1666 |
|
1667 | |
1668 |
|
1669 |
|
1670 | export interface TreeConfig<D = VxeTableDataRow> {
|
1671 | |
1672 |
|
1673 |
|
1674 | transform?: boolean
|
1675 | |
1676 |
|
1677 |
|
1678 | rowField?: string
|
1679 | |
1680 |
|
1681 |
|
1682 | parentField?: string
|
1683 | |
1684 |
|
1685 |
|
1686 | childrenField?: string
|
1687 | |
1688 |
|
1689 |
|
1690 | mapChildrenField?: string
|
1691 | |
1692 |
|
1693 |
|
1694 | indent?: number
|
1695 | |
1696 |
|
1697 |
|
1698 | showLine?: boolean
|
1699 | |
1700 |
|
1701 |
|
1702 | expandAll?: boolean
|
1703 | |
1704 |
|
1705 |
|
1706 | expandRowKeys?: string[] | number[]
|
1707 | |
1708 |
|
1709 |
|
1710 | accordion?: boolean
|
1711 | |
1712 |
|
1713 |
|
1714 | trigger?: 'default' | 'cell' | 'row' | '' | null
|
1715 | |
1716 |
|
1717 |
|
1718 | lazy?: boolean
|
1719 | |
1720 |
|
1721 |
|
1722 | hasChildField?: string
|
1723 | |
1724 |
|
1725 |
|
1726 | reserve?: boolean
|
1727 | |
1728 |
|
1729 |
|
1730 | loadMethod?(params: {
|
1731 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1732 | row: D
|
1733 | }): Promise<any[]>
|
1734 | |
1735 |
|
1736 |
|
1737 | toggleMethod?(params: {
|
1738 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1739 | expanded: boolean
|
1740 | row: D
|
1741 | column: VxeTableDefines.ColumnInfo<D>
|
1742 | columnIndex: number
|
1743 | $columnIndex: number
|
1744 | }): boolean
|
1745 | |
1746 |
|
1747 |
|
1748 | showIcon?: boolean
|
1749 | |
1750 |
|
1751 |
|
1752 | iconOpen?: string
|
1753 | |
1754 |
|
1755 |
|
1756 | iconClose?: string
|
1757 | |
1758 |
|
1759 |
|
1760 | iconLoaded?: string
|
1761 |
|
1762 | |
1763 |
|
1764 |
|
1765 |
|
1766 | line?: boolean
|
1767 | |
1768 |
|
1769 |
|
1770 |
|
1771 | hasChild?: string
|
1772 | |
1773 |
|
1774 |
|
1775 |
|
1776 | children?: string
|
1777 | }
|
1778 | export type TreeOpts<D = VxeTableDataRow> = Required<TreeConfig<D>>
|
1779 |
|
1780 | |
1781 |
|
1782 |
|
1783 | export interface MenuConfig<D = VxeTableDataRow> {
|
1784 | |
1785 |
|
1786 |
|
1787 | enabled?: boolean
|
1788 | |
1789 |
|
1790 |
|
1791 | header?: VxeTableDefines.MenuOptions
|
1792 | |
1793 |
|
1794 |
|
1795 | body?: VxeTableDefines.MenuOptions
|
1796 | |
1797 |
|
1798 |
|
1799 | footer?: VxeTableDefines.MenuOptions
|
1800 | |
1801 |
|
1802 |
|
1803 |
|
1804 | trigger?: 'default' | 'cell' | '' | null
|
1805 | |
1806 |
|
1807 |
|
1808 | className?: string
|
1809 | |
1810 |
|
1811 |
|
1812 | visibleMethod?(params: {
|
1813 | type: string
|
1814 | options: VxeTableDefines.MenuFirstOption[][]
|
1815 | columns: VxeTableDefines.ColumnInfo<D>[]
|
1816 | row?: D
|
1817 | rowIndex?: number
|
1818 | column?: VxeTableDefines.ColumnInfo<D>
|
1819 | columnIndex?: number
|
1820 | }): boolean
|
1821 | }
|
1822 | export type MenuOpts<D = VxeTableDataRow> = Required<MenuConfig<D>>
|
1823 |
|
1824 | |
1825 |
|
1826 |
|
1827 | export interface MouseConfig {
|
1828 | |
1829 |
|
1830 |
|
1831 | selected?: boolean
|
1832 | |
1833 |
|
1834 |
|
1835 | area?: boolean
|
1836 | |
1837 |
|
1838 |
|
1839 | extension?: boolean
|
1840 | }
|
1841 | export interface MouseOpts extends MouseConfig { }
|
1842 |
|
1843 | |
1844 |
|
1845 |
|
1846 | export interface AreaConfig<D = VxeTableDataRow> {
|
1847 | |
1848 |
|
1849 |
|
1850 | multiple?: boolean
|
1851 | |
1852 |
|
1853 |
|
1854 | includeFields?: string[]
|
1855 | |
1856 |
|
1857 |
|
1858 | excludeFields?: string[]
|
1859 | |
1860 |
|
1861 |
|
1862 | selectCellByHeader?: boolean
|
1863 | |
1864 |
|
1865 |
|
1866 | extendByCopy?: boolean
|
1867 | |
1868 |
|
1869 |
|
1870 | extendByCalc?: boolean
|
1871 | |
1872 |
|
1873 |
|
1874 | autoClear?: boolean
|
1875 | |
1876 |
|
1877 |
|
1878 |
|
1879 | extendCalcMethod?(params: VxeTableProDefines.ExtendCellAreaCalcBaseParams<D>): any[][]
|
1880 | |
1881 |
|
1882 |
|
1883 |
|
1884 | extendSetMethod?(params: {
|
1885 | cellValue: any
|
1886 | row: D
|
1887 | column: VxeTableDefines.ColumnInfo<D>
|
1888 | } & VxeTableProDefines.ExtendCellAreaCalcBaseParams<D>): void
|
1889 | |
1890 |
|
1891 |
|
1892 |
|
1893 | beforeExtendSetMethod?(params: VxeTableProDefines.ExtendCellAreaCalcBaseParams<D>): boolean
|
1894 | |
1895 |
|
1896 |
|
1897 |
|
1898 | afterExtendSetMethod?(params: {
|
1899 | extendValues: any[][]
|
1900 | } & VxeTableProDefines.ExtendCellAreaCalcBaseParams<D>): boolean
|
1901 | }
|
1902 | export interface AreaOpts<D = VxeTableDataRow> extends AreaConfig<D> { }
|
1903 |
|
1904 | |
1905 |
|
1906 |
|
1907 | export interface KeyboardConfig<D = VxeTableDataRow> {
|
1908 | |
1909 |
|
1910 |
|
1911 | isArrow?: boolean
|
1912 | |
1913 |
|
1914 |
|
1915 | isEsc?: boolean
|
1916 | |
1917 |
|
1918 |
|
1919 | isDel?: boolean
|
1920 | |
1921 |
|
1922 |
|
1923 | isEnter?: boolean
|
1924 | |
1925 |
|
1926 |
|
1927 | isShift?: boolean
|
1928 | |
1929 |
|
1930 |
|
1931 | isTab?: boolean
|
1932 | |
1933 |
|
1934 |
|
1935 | isEdit?: boolean
|
1936 | |
1937 |
|
1938 |
|
1939 | isMerge?: boolean
|
1940 | |
1941 |
|
1942 |
|
1943 | isClip?: boolean
|
1944 | |
1945 |
|
1946 |
|
1947 | isFNR?: boolean
|
1948 | |
1949 |
|
1950 |
|
1951 | isChecked?: boolean
|
1952 | |
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 | arrowCursorLock?: boolean
|
1958 | |
1959 |
|
1960 |
|
1961 | enterToTab?: boolean
|
1962 | |
1963 |
|
1964 |
|
1965 | delMethod?(params: {
|
1966 | row: D
|
1967 | rowIndex: number
|
1968 | column: VxeTableDefines.ColumnInfo<D>
|
1969 | columnIndex: number
|
1970 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1971 | }): void
|
1972 | |
1973 |
|
1974 |
|
1975 | backMethod?(params: {
|
1976 | row: D
|
1977 | rowIndex: number
|
1978 | column: VxeTableDefines.ColumnInfo<D>
|
1979 | columnIndex: number
|
1980 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1981 | }): void
|
1982 | |
1983 |
|
1984 |
|
1985 | editMethod?(params: {
|
1986 | row: D
|
1987 | rowIndex: number
|
1988 | column: VxeTableDefines.ColumnInfo<D>
|
1989 | columnIndex: number
|
1990 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
1991 | $grid: VxeGridConstructor<D> | null | undefined
|
1992 | }): boolean
|
1993 | }
|
1994 | export interface KeyboardOpts<D = VxeTableDataRow> extends KeyboardConfig<D> { }
|
1995 |
|
1996 | |
1997 |
|
1998 |
|
1999 | export interface ClipConfig<DT = VxeTableDataRow> {
|
2000 | |
2001 |
|
2002 |
|
2003 | isCopy?: boolean
|
2004 | |
2005 |
|
2006 |
|
2007 | isCut?: boolean
|
2008 | |
2009 |
|
2010 |
|
2011 | isPaste?: boolean
|
2012 | |
2013 |
|
2014 |
|
2015 | isFillPaste?: boolean
|
2016 | |
2017 |
|
2018 |
|
2019 | isRowIncrement?: boolean
|
2020 | |
2021 |
|
2022 |
|
2023 | isColumnIncrement?: boolean
|
2024 | |
2025 |
|
2026 |
|
2027 | includeFields?: string[]
|
2028 | |
2029 |
|
2030 |
|
2031 | excludeFields?: string[]
|
2032 | |
2033 |
|
2034 |
|
2035 | copyMethod?(params: {
|
2036 | isCut: boolean
|
2037 | row: DT
|
2038 | column: VxeTableDefines.ColumnInfo<DT>
|
2039 | cellValue: any
|
2040 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2041 | $grid: VxeGridConstructor<DT> | null | undefined
|
2042 | }): string
|
2043 | |
2044 |
|
2045 |
|
2046 | beforeCopyMethod?(params: {
|
2047 | isCut: boolean
|
2048 | activeArea: VxeTableProDefines.MouseActiveCellArea
|
2049 | targetAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2050 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2051 | $grid: VxeGridConstructor<DT> | null | undefined
|
2052 | }): boolean
|
2053 | |
2054 |
|
2055 |
|
2056 | afterCopyMethod?(params: {
|
2057 | isCut: boolean
|
2058 | targetAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2059 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2060 | $grid: VxeGridConstructor<DT> | null | undefined
|
2061 | }): boolean
|
2062 | |
2063 |
|
2064 |
|
2065 | cutMethod?:(params: {
|
2066 | row: DT,
|
2067 | column: VxeTableDefines.ColumnInfo<DT>
|
2068 | cellValue: any
|
2069 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2070 | $grid: VxeGridConstructor<DT> | null | undefined
|
2071 | }) => void
|
2072 | |
2073 |
|
2074 |
|
2075 | beforeCutMethod?:(params: {
|
2076 | activeArea: VxeTableProDefines.MouseActiveCellArea
|
2077 | cutAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2078 | currentAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2079 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2080 | $grid: VxeGridConstructor<DT> | null | undefined
|
2081 | }) => boolean
|
2082 | |
2083 |
|
2084 |
|
2085 | afterCutMethod?:(params: {
|
2086 | cutAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2087 | currentAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2088 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2089 | $grid: VxeGridConstructor<DT> | null | undefined
|
2090 | }) => void
|
2091 | |
2092 |
|
2093 |
|
2094 | pasteMethod?(params: {
|
2095 | isCut: boolean
|
2096 | row: DT,
|
2097 | column: VxeTableDefines.ColumnInfo<DT>
|
2098 | cellValue: any
|
2099 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2100 | $grid: VxeGridConstructor<DT> | null | undefined
|
2101 | }): void
|
2102 | |
2103 |
|
2104 |
|
2105 | beforePasteMethod?(params: {
|
2106 | isCut: boolean
|
2107 | activeArea: VxeTableProDefines.MouseActiveCellArea
|
2108 | cutAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2109 | currentAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2110 | targetAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2111 | cellValues: string[][]
|
2112 | pasteCells: string[][]
|
2113 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2114 | $grid: VxeGridConstructor<DT> | null | undefined
|
2115 | }): boolean
|
2116 | |
2117 |
|
2118 |
|
2119 | afterPasteMethod?(params: {
|
2120 | isCut: boolean
|
2121 | currentAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2122 | cutAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2123 | targetAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2124 | cellValues: any[][]
|
2125 | pasteCells: string[][]
|
2126 | insertRows: DT[]
|
2127 | insertColumns: VxeTableDefines.ColumnInfo<DT>[]
|
2128 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2129 | $grid: VxeGridConstructor<DT> | null | undefined
|
2130 | }): boolean
|
2131 | |
2132 |
|
2133 |
|
2134 | createRowsMethod?(params: {
|
2135 | currentAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2136 | targetAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2137 | cellValues: any[][]
|
2138 | pasteCells: string[][]
|
2139 | insertRows: DT[]
|
2140 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2141 | $grid: VxeGridConstructor<DT> | null | undefined
|
2142 | }): DT[]
|
2143 | |
2144 |
|
2145 |
|
2146 | createColumnsMethod?(params: {
|
2147 | currentAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2148 | targetAreas: VxeTableProDefines.CellAreaParams<DT>[]
|
2149 | cellValues: any[][]
|
2150 | pasteCells: string[][]
|
2151 | insertColumns: VxeTableDefines.ColumnOptions[]
|
2152 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2153 | $grid: VxeGridConstructor<DT> | null | undefined
|
2154 | }): VxeTableDefines.ColumnOptions<DT>[]
|
2155 | }
|
2156 | export interface ClipOpts<D = VxeTableDataRow> extends ClipConfig<D> { }
|
2157 |
|
2158 | |
2159 |
|
2160 |
|
2161 | export interface FNRConfig<DT = VxeTableDataRow> {
|
2162 | |
2163 |
|
2164 |
|
2165 | isFind?: boolean
|
2166 | |
2167 |
|
2168 |
|
2169 | findMethod?(params: {
|
2170 | cellValue: any
|
2171 | isWhole: boolean
|
2172 | isRE: boolean
|
2173 | isSensitive: boolean
|
2174 | findValue: string | null
|
2175 | findRE: RegExp | null
|
2176 | }): boolean
|
2177 | |
2178 |
|
2179 |
|
2180 | beforeFindMethod?(params: {
|
2181 | isAll: boolean
|
2182 | findValue: string | null
|
2183 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2184 | $grid: VxeGridConstructor<DT> | null | undefined
|
2185 | }): boolean
|
2186 | |
2187 |
|
2188 |
|
2189 | afterFindMethod?(params: {
|
2190 | isAll: boolean
|
2191 | findValue: string | null
|
2192 | result: VxeTableProDefines.FindAndReplaceResult[]
|
2193 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2194 | $grid: VxeGridConstructor<DT> | null | undefined
|
2195 | }): void
|
2196 | |
2197 |
|
2198 |
|
2199 | isReplace?: boolean
|
2200 | |
2201 |
|
2202 |
|
2203 | replaceMethod?:(params: {
|
2204 | row: DT
|
2205 | column: VxeTableDefines.ColumnInfo<DT>
|
2206 | cellValue: any
|
2207 | }) => void
|
2208 | |
2209 |
|
2210 |
|
2211 | beforeReplaceMethod?:(params: {
|
2212 | isAll: boolean
|
2213 | findValue: string | null
|
2214 | replaceValue: string
|
2215 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2216 | $grid: VxeGridConstructor<DT> | null | undefined
|
2217 | }) => boolean
|
2218 | |
2219 |
|
2220 |
|
2221 | afterReplaceMethod?:(params: {
|
2222 | isAll: boolean
|
2223 | findValue: string | null
|
2224 | replaceValue: string
|
2225 | result: VxeTableProDefines.FindAndReplaceResult[]
|
2226 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2227 | $grid: VxeGridConstructor<DT> | null | undefined
|
2228 | }) => void
|
2229 | }
|
2230 | export interface FNROpts<D = VxeTableDataRow> extends FNRConfig<D> { }
|
2231 |
|
2232 | |
2233 |
|
2234 |
|
2235 | export interface EditConfig<DT = VxeTableDataRow> {
|
2236 | |
2237 |
|
2238 |
|
2239 |
|
2240 |
|
2241 |
|
2242 | trigger?: 'manual' | 'click' | 'dblclick' | '' | null
|
2243 | |
2244 |
|
2245 |
|
2246 | enabled?: boolean
|
2247 | |
2248 |
|
2249 |
|
2250 |
|
2251 |
|
2252 | mode?: 'cell' | 'row' | '' | null
|
2253 | |
2254 |
|
2255 |
|
2256 | icon?: string
|
2257 | |
2258 |
|
2259 |
|
2260 | showIcon?: boolean
|
2261 | |
2262 |
|
2263 |
|
2264 | showStatus?: boolean
|
2265 | |
2266 |
|
2267 |
|
2268 | showUpdateStatus?: boolean
|
2269 | |
2270 |
|
2271 |
|
2272 | showInsertStatus?: boolean
|
2273 | |
2274 |
|
2275 |
|
2276 | showAsterisk?: boolean
|
2277 | |
2278 |
|
2279 |
|
2280 | autoClear?: boolean
|
2281 | |
2282 |
|
2283 |
|
2284 | beforeEditMethod?(params: {
|
2285 | row: DT
|
2286 | rowIndex: number
|
2287 | column: VxeTableDefines.ColumnInfo<DT>
|
2288 | columnIndex: number
|
2289 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2290 | $grid: VxeGridConstructor<DT> | null | undefined
|
2291 | }): boolean
|
2292 | |
2293 |
|
2294 |
|
2295 | afterEditMethod?(params: {
|
2296 | row: DT
|
2297 | rowIndex: number
|
2298 | column: VxeTableDefines.ColumnInfo<DT>
|
2299 | columnIndex: number
|
2300 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2301 | $grid: VxeGridConstructor<DT> | null | undefined
|
2302 | }): void
|
2303 |
|
2304 | |
2305 |
|
2306 |
|
2307 |
|
2308 | activeMethod?(params: {
|
2309 | row: DT
|
2310 | rowIndex: number
|
2311 | column: VxeTableDefines.ColumnInfo<DT>
|
2312 | columnIndex: number
|
2313 | $table: VxeTableConstructor<DT> & VxeTablePrivateMethods<DT>
|
2314 | $grid: VxeGridConstructor<DT> | null | undefined
|
2315 | }): boolean
|
2316 | }
|
2317 | export interface EditOpts<D = VxeTableDataRow> extends EditConfig<D> { }
|
2318 |
|
2319 | |
2320 |
|
2321 |
|
2322 | export interface ValidConfig<D = VxeTableDataRow> {
|
2323 | |
2324 |
|
2325 |
|
2326 | autoPos?: boolean
|
2327 | |
2328 |
|
2329 |
|
2330 | showMessage?: boolean
|
2331 | |
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 | msgMode?: 'single' | 'full' | null | ''
|
2337 | |
2338 |
|
2339 |
|
2340 | autoClear?: boolean
|
2341 | |
2342 |
|
2343 |
|
2344 | maxWidth?: number
|
2345 | |
2346 |
|
2347 |
|
2348 | className?: string | ((params: VxeColumnSlotTypes.ValidSlotParams<D>) => string)
|
2349 |
|
2350 | /**
|
2351 | * 不建议使用,已废弃
|
2352 | * @deprecated
|
2353 | */
|
2354 | message?: 'inline' | 'default' | 'tooltip' | '' | null
|
2355 | }
|
2356 | export interface ValidOpts<D = VxeTableDataRow> extends ValidConfig<D> { }
|
2357 |
|
2358 | /**
|
2359 | * 校验规则配置项
|
2360 | */
|
2361 | export interface EditRules<D = VxeTableDataRow> {
|
2362 | [field: string]: VxeTableDefines.ValidatorRule<D>[]
|
2363 | }
|
2364 |
|
2365 | export type ZIndex = number
|
2366 | export type EmptyText = string
|
2367 |
|
2368 | export interface LoadingConfig {
|
2369 | /**
|
2370 | * 显示图标
|
2371 | */
|
2372 | icon?: string
|
2373 | /**
|
2374 | * 显示文字
|
2375 | */
|
2376 | text?: string
|
2377 | }
|
2378 | export interface LoadingOpts extends LoadingConfig { }
|
2379 |
|
2380 | export interface EmptyRender extends VxeGlobalRendererHandles.RenderOptions { }
|
2381 | export interface EmptyOpts extends EmptyRender { }
|
2382 |
|
2383 | export type Fit = boolean
|
2384 | export type Animat = boolean
|
2385 | export type DelayHover = number
|
2386 |
|
2387 | export interface ScrollX {
|
2388 | /**
|
2389 | * 指定大于指定列时自动启动横向虚拟滚动,如果为 0 则总是启用;如果需要关闭,可以设置 enabled 为 false
|
2390 | */
|
2391 | gt?: number
|
2392 | /**
|
2393 | * 指定每次渲染的数据偏移量,偏移量越大渲染次数就越少,但每次渲染耗时就越久(对于低性能浏览器可以设置大一点,减低渲染次数)
|
2394 | */
|
2395 | oSize?: number
|
2396 | /**
|
2397 | * 是否启用
|
2398 | */
|
2399 | enabled?: boolean
|
2400 | /**
|
2401 | * 当数据源被更改时,自动将横向滚动条滚动到左侧
|
2402 | */
|
2403 | scrollToLeftOnChange?: boolean
|
2404 | }
|
2405 | export interface SXOpts extends ScrollX {
|
2406 | gt: number
|
2407 | oSize: number
|
2408 | }
|
2409 |
|
2410 | export interface ScrollY {
|
2411 | /**
|
2412 | * 滚动模式
|
2413 | */
|
2414 | mode?: 'default' | 'wheel'
|
2415 | /**
|
2416 | * 指定大于指定行时自动启动纵向虚拟滚动,如果为 0 则总是启用;如果需要关闭,可以设置 enabled 为 false(注:启用纵向虚拟滚动之后将不能支持动态行高)
|
2417 | */
|
2418 | gt?: number
|
2419 | /**
|
2420 | * 指定每次渲染的数据偏移量,偏移量越大渲染次数就越少,但每次渲染耗时就越久(对于低性能浏览器可以设置大一点,减低渲染次数)
|
2421 | */
|
2422 | oSize?: number
|
2423 | /**
|
2424 | * 是否启用
|
2425 | */
|
2426 | enabled?: boolean
|
2427 | /**
|
2428 | * 当数据源被更改时,自动将纵向滚动条滚动到顶部
|
2429 | */
|
2430 | scrollToTopOnChange?: boolean
|
2431 |
|
2432 | /**
|
2433 | * 请使用 row-config.height
|
2434 | * @deprecated
|
2435 | */
|
2436 | rHeight?: number
|
2437 | /**
|
2438 | * 不建议使用
|
2439 | * @deprecated
|
2440 | */
|
2441 | adaptive?: boolean
|
2442 | }
|
2443 | export interface SYOpts extends ScrollY {
|
2444 | gt: number
|
2445 | oSize: number
|
2446 | }
|
2447 |
|
2448 | export type Params = any
|
2449 | }
|
2450 |
|
2451 | export type VxeTableProps<D = VxeTableDataRow> = {
|
2452 | size?: VxeTablePropTypes.Size
|
2453 | /**
|
2454 | * 唯一标识
|
2455 | * 当使用某个特定功能时,需要设置才能生效
|
2456 | */
|
2457 | id?: VxeTablePropTypes.ID
|
2458 | /**
|
2459 | * 表格数据
|
2460 | * 与 loadData 行为一致,更新数据是不会重置状态
|
2461 | */
|
2462 | data?: VxeTablePropTypes.Data<D>
|
2463 | /**
|
2464 | * 表格的高度;支持铺满父容器或者固定高度,如果设置 auto 为铺满父容器(如果设置为 auto,则必须确保存在父节点且不允许存在相邻元素)
|
2465 | */
|
2466 | height?: VxeTablePropTypes.Height
|
2467 | /**
|
2468 | * 表格最小高度
|
2469 | */
|
2470 | minHeight?: VxeTablePropTypes.MinHeight
|
2471 | /**
|
2472 | * max-height
|
2473 | */
|
2474 | maxHeight?: VxeTablePropTypes.MaxHeight
|
2475 | /**
|
2476 | * 是否带有斑马纹(需要注意的是,在可编辑表格场景下,临时插入的数据不会有斑马纹样式)
|
2477 | */
|
2478 | stripe?: VxeTablePropTypes.Stripe
|
2479 | /**
|
2480 | * 是否为圆角边框
|
2481 | */
|
2482 | round?: VxeTablePropTypes.Round
|
2483 | /**
|
2484 | * 是否带有边框
|
2485 | */
|
2486 | border?: VxeTablePropTypes.Border
|
2487 | /**
|
2488 | * 表格是否显示加载中
|
2489 | */
|
2490 | loading?: VxeTablePropTypes.Loading
|
2491 | /**
|
2492 | * 所有的列对齐方式
|
2493 | */
|
2494 | align?: VxeTablePropTypes.Align
|
2495 | /**
|
2496 | * 所有的表头列的对齐方式
|
2497 | */
|
2498 | headerAlign?: VxeTablePropTypes.HeaderAlign
|
2499 | /**
|
2500 | * 所有的表尾列的对齐方式
|
2501 | */
|
2502 | footerAlign?: VxeTablePropTypes.FooterAlign
|
2503 | /**
|
2504 | * 是否显示表头
|
2505 | */
|
2506 | showHeader?: VxeTablePropTypes.ShowHeader
|
2507 | /**
|
2508 | * 是否显示表尾
|
2509 | */
|
2510 | showFooter?: VxeTablePropTypes.ShowFooter
|
2511 | /**
|
2512 | * 表尾数据
|
2513 | */
|
2514 | footerData?: VxeTablePropTypes.FooterData
|
2515 | /**
|
2516 | * 表尾的数据获取方法,返回一个二维数组
|
2517 | */
|
2518 | footerMethod?: VxeTablePropTypes.FooterMethod<D>
|
2519 | /**
|
2520 | * 给行附加 className
|
2521 | */
|
2522 | rowClassName?: VxeTablePropTypes.RowClassName<D>
|
2523 | /**
|
2524 | * 给单元格附加 className
|
2525 | */
|
2526 | cellClassName?: VxeTablePropTypes.CellClassName<D>
|
2527 | /**
|
2528 | * 给表头的行附加 className
|
2529 | */
|
2530 | headerRowClassName?: VxeTablePropTypes.HeaderRowClassName<D>
|
2531 | /**
|
2532 | * 给表头的单元格附加 className
|
2533 | */
|
2534 | headerCellClassName?: VxeTablePropTypes.HeaderCellClassName<D>
|
2535 | /**
|
2536 | * 给表尾的行附加 className
|
2537 | */
|
2538 | footerRowClassName?: VxeTablePropTypes.FooterRowClassName<D>
|
2539 | /**
|
2540 | * 给表尾的单元格附加 className
|
2541 | */
|
2542 | footerCellClassName?: VxeTablePropTypes.FooterCellClassName<D>
|
2543 | /**
|
2544 | * 给单元格附加样式
|
2545 | */
|
2546 | cellStyle?: VxeTablePropTypes.CellStyle<D>
|
2547 | /**
|
2548 | * 给行附加样式,也可以是函数
|
2549 | */
|
2550 | rowStyle?: VxeTablePropTypes.RowStyle<D>
|
2551 | /**
|
2552 | * 给表头单元格附加样式
|
2553 | */
|
2554 | headerCellStyle?: VxeTablePropTypes.HeaderCellStyle<D>
|
2555 | /**
|
2556 | * 给表头行附加样式
|
2557 | */
|
2558 | headerRowStyle?: VxeTablePropTypes.HeaderRowStyle<D>
|
2559 | /**
|
2560 | * 给表尾行附加样式
|
2561 | */
|
2562 | footerRowStyle?: VxeTablePropTypes.FooterRowStyle<D>
|
2563 | /**
|
2564 | * 给表尾单元格附加样式
|
2565 | */
|
2566 | footerCellStyle?: VxeTablePropTypes.FooterCellStyle<D>
|
2567 | /**
|
2568 | * 临时合并指定的单元格 (不能用于展开行,不建议用于固定列、树形结构)
|
2569 | */
|
2570 | mergeCells?: VxeTablePropTypes.MergeCells<D>
|
2571 | /**
|
2572 | * 临时合并表尾 (不能用于展开行,不建议用于固定列、树形结构)
|
2573 | */
|
2574 | mergeFooterItems?: VxeTablePropTypes.MergeFooterItems<D>
|
2575 | /**
|
2576 | * 自定义合并函数,返回计算后的值 (不能用于虚拟滚动、展开行,不建议用于固定列、树形结构)
|
2577 | */
|
2578 | spanMethod?: VxeTablePropTypes.SpanMethod<D>
|
2579 | /**
|
2580 | * 表尾合并行或列,返回计算后的值 (不能用于虚拟滚动、展开行,不建议用于固定列、树形结构)
|
2581 | */
|
2582 | footerSpanMethod?: VxeTablePropTypes.FooterSpanMethod<D>
|
2583 | /**
|
2584 | * 设置所有内容过长时显示为省略号(如果是固定列建议设置该值,提升渲染速度)
|
2585 | */
|
2586 | showOverflow?: VxeTablePropTypes.ShowOverflow
|
2587 | /**
|
2588 | * 设置表头所有内容过长时显示为省略号
|
2589 | */
|
2590 | showHeaderOverflow?: VxeTablePropTypes.ShowHeaderOverflow
|
2591 | /**
|
2592 | * 设置表尾所有内容过长时显示为省略号
|
2593 | */
|
2594 | showFooterOverflow?: VxeTablePropTypes.ShowFooterOverflow
|
2595 | /**
|
2596 | * 保持原始值的状态,被某些功能所依赖,比如编辑状态、还原数据等
|
2597 | */
|
2598 | keepSource?: VxeTablePropTypes.KeepSource
|
2599 | /**
|
2600 | * 自动监听父元素的变化去重新计算表格(对于父元素可能存在动态变化、显示隐藏的容器中、列宽异常等场景中的可能会用到)
|
2601 | */
|
2602 | autoResize?: VxeTablePropTypes.AutoResize
|
2603 | /**
|
2604 | * 自动跟随某个属性的变化去重新计算表格,和手动调用 recalculate 方法是一样的效果(对于通过某个属性来控制显示/隐藏切换时可能会用到)
|
2605 | */
|
2606 | syncResize?: VxeTablePropTypes.SyncResize
|
2607 | /**
|
2608 | * 列配置信息
|
2609 | */
|
2610 | columnConfig?: VxeTablePropTypes.ColumnConfig
|
2611 | /**
|
2612 | * 行配置信息
|
2613 | */
|
2614 | rowConfig?: VxeTablePropTypes.RowConfig
|
2615 | /**
|
2616 | * 个性化信息配置项
|
2617 | */
|
2618 | customConfig?: VxeTablePropTypes.CustomConfig<D>
|
2619 | /**
|
2620 | * 响应式布局配置项
|
2621 | */
|
2622 | resizeConfig?: VxeTablePropTypes.ResizeConfig
|
2623 | /**
|
2624 | * 列宽拖动配置项
|
2625 | */
|
2626 | resizableConfig?: VxeTablePropTypes.ResizableConfig<D>
|
2627 | /**
|
2628 | * 序号配置项
|
2629 | */
|
2630 | seqConfig?: VxeTablePropTypes.SeqConfig<D>
|
2631 | /**
|
2632 | * 排序配置项
|
2633 | */
|
2634 | sortConfig?: VxeTablePropTypes.SortConfig<D>
|
2635 | /**
|
2636 | * 筛选配置项
|
2637 | */
|
2638 | filterConfig?: VxeTablePropTypes.FilterConfig<D>
|
2639 | /**
|
2640 | * 单选框配置项
|
2641 | */
|
2642 | radioConfig?: VxeTablePropTypes.RadioConfig<D>
|
2643 | /**
|
2644 | * 复选框配置项
|
2645 | */
|
2646 | checkboxConfig?: VxeTablePropTypes.CheckboxConfig<D>
|
2647 | /**
|
2648 | * 工具提示配置项
|
2649 | */
|
2650 | tooltipConfig?: VxeTablePropTypes.TooltipConfig<D>
|
2651 | /**
|
2652 | * 导出配置项
|
2653 | */
|
2654 | exportConfig?: VxeTablePropTypes.ExportConfig
|
2655 | /**
|
2656 | * 导入配置项
|
2657 | */
|
2658 | importConfig?: VxeTablePropTypes.ImportConfig
|
2659 | /**
|
2660 | * 打印配置项
|
2661 | */
|
2662 | printConfig?: VxeTablePropTypes.PrintConfig
|
2663 | /**
|
2664 | * 展开行配置项
|
2665 | */
|
2666 | expandConfig?: VxeTablePropTypes.ExpandConfig<D>
|
2667 | /**
|
2668 | * 树形结构配置项
|
2669 | */
|
2670 | treeConfig?: VxeTablePropTypes.TreeConfig<D>
|
2671 | /**
|
2672 | * 右键菜单配置项
|
2673 | */
|
2674 | menuConfig?: VxeTablePropTypes.MenuConfig<D>
|
2675 | /**
|
2676 | * 鼠标配置项
|
2677 | */
|
2678 | mouseConfig?: VxeTablePropTypes.MouseConfig
|
2679 | /**
|
2680 | * 区域选取配置项
|
2681 | */
|
2682 | areaConfig?: VxeTablePropTypes.AreaConfig<D>
|
2683 | /**
|
2684 | * 查找/替换配置项
|
2685 | */
|
2686 | fnrConfig?: VxeTablePropTypes.FNRConfig<D>
|
2687 | /**
|
2688 | * 按键配置项
|
2689 | */
|
2690 | keyboardConfig?: VxeTablePropTypes.KeyboardConfig<D>
|
2691 | /**
|
2692 | * 复制/粘贴配置项
|
2693 | */
|
2694 | clipConfig?: VxeTablePropTypes.ClipConfig<D>
|
2695 | /**
|
2696 | * 可编辑配置项
|
2697 | */
|
2698 | editConfig?: VxeTablePropTypes.EditConfig<D>
|
2699 | /**
|
2700 | * 校验配置项
|
2701 | */
|
2702 | validConfig?: VxeTablePropTypes.ValidConfig<D>
|
2703 | /**
|
2704 | * 校验规则配置项
|
2705 | */
|
2706 | editRules?: VxeTablePropTypes.EditRules<D>
|
2707 | /**
|
2708 | * 空数据时显示的内容
|
2709 | */
|
2710 | emptyText?: VxeTablePropTypes.EmptyText
|
2711 | /**
|
2712 | * 空内容渲染配置项,empty-render 的优先级大于 empty-text
|
2713 | */
|
2714 | emptyRender?: VxeTablePropTypes.EmptyRender
|
2715 | /**
|
2716 | * 加载中配置项
|
2717 | */
|
2718 | loadingConfig?: VxeTablePropTypes.LoadingConfig
|
2719 | /**
|
2720 | * 横向虚拟滚动配置
|
2721 | */
|
2722 | scrollX?: VxeTablePropTypes.ScrollX
|
2723 | /**
|
2724 | * 纵向虚拟滚动配置
|
2725 | */
|
2726 | scrollY?: VxeTablePropTypes.ScrollY
|
2727 | /**
|
2728 | * 自定义参数(可以用来存放一些自定义的数据)
|
2729 | */
|
2730 | params?: VxeTablePropTypes.Params
|
2731 |
|
2732 | /**
|
2733 | * 已废弃,不建议使用,被 column-config.resizable 替换
|
2734 | * @deprecated
|
2735 | */
|
2736 | resizable?: VxeTablePropTypes.Resizable
|
2737 | /**
|
2738 | * 已废弃,不建议使用,被 row-config.isCurrent 替换
|
2739 | * @deprecated
|
2740 | */
|
2741 | highlightCurrentRow?: VxeTablePropTypes.HighlightCurrentRow
|
2742 | /**
|
2743 | * 已废弃,不建议使用,被 row-config.isHover 替换
|
2744 | * @deprecated
|
2745 | */
|
2746 | highlightHoverRow?: VxeTablePropTypes.HighlightHoverRow
|
2747 | /**
|
2748 | * 已废弃,不建议使用,被 column-config.isCurrent 替换
|
2749 | * @deprecated
|
2750 | */
|
2751 | highlightCurrentColumn?: VxeTablePropTypes.HighlightCurrentColumn
|
2752 | /**
|
2753 | * 已废弃,不建议使用,被 column-config.isHover 替换
|
2754 | * @deprecated
|
2755 | */
|
2756 | highlightHoverColumn?: VxeTablePropTypes.HighlightHoverColumn
|
2757 | /**
|
2758 | * 已废弃
|
2759 | * @deprecated
|
2760 | */
|
2761 | highlightCell?: VxeTablePropTypes.HighlightCell
|
2762 | /**
|
2763 | * 已废弃,请使用 column-config.useKey
|
2764 | * @deprecated
|
2765 | */
|
2766 | columnKey?: VxeTablePropTypes.ColumnKey
|
2767 | /**
|
2768 | * 已废弃,请使用 row-config.useKey
|
2769 | * @deprecated
|
2770 | */
|
2771 | rowKey?: VxeTablePropTypes.RowKey
|
2772 | /**
|
2773 | * 已废弃,请使用 row-config.keyField
|
2774 | * @deprecated
|
2775 | */
|
2776 | rowId?: VxeTablePropTypes.RowId
|
2777 | /**
|
2778 | * 已废弃,已废弃
|
2779 | * @deprecated
|
2780 | */
|
2781 | fit?: VxeTablePropTypes.Fit
|
2782 | /**
|
2783 | * 已废弃,已废弃
|
2784 | * @deprecated
|
2785 | */
|
2786 | animat?: VxeTablePropTypes.Animat
|
2787 | /**
|
2788 | * 已废弃,已废弃
|
2789 | * @deprecated
|
2790 | */
|
2791 | delayHover?: VxeTablePropTypes.DelayHover
|
2792 | }
|
2793 |
|
2794 | export type VxeTableEmits = [
|
2795 | 'update:data',
|
2796 | 'keydown-start',
|
2797 | 'keydown',
|
2798 | 'keydown-end',
|
2799 | 'paste',
|
2800 | 'copy',
|
2801 | 'cut',
|
2802 | 'current-change',
|
2803 | 'radio-change',
|
2804 | 'checkbox-change',
|
2805 | 'checkbox-all',
|
2806 | 'checkbox-range-start',
|
2807 | 'checkbox-range-change',
|
2808 | 'checkbox-range-end',
|
2809 | 'checkbox-range-select',
|
2810 | 'cell-click',
|
2811 | 'cell-dblclick',
|
2812 | 'cell-menu',
|
2813 | 'cell-mouseenter',
|
2814 | 'cell-mouseleave',
|
2815 | 'cell-selected',
|
2816 | 'cell-delete-value',
|
2817 | 'header-cell-click',
|
2818 | 'header-cell-dblclick',
|
2819 | 'header-cell-menu',
|
2820 | 'footer-cell-click',
|
2821 | 'footer-cell-dblclick',
|
2822 | 'footer-cell-menu',
|
2823 | 'clear-merge',
|
2824 | 'sort-change',
|
2825 | 'clear-sort',
|
2826 | 'filter-change',
|
2827 | 'filter-visible',
|
2828 | 'clear-filter',
|
2829 | 'resizable-change',
|
2830 | 'toggle-row-expand',
|
2831 | 'toggle-tree-expand',
|
2832 | 'menu-click',
|
2833 | 'edit-closed',
|
2834 |
|
2835 | 'edit-actived', // 已废弃
|
2836 |
|
2837 | 'edit-activated',
|
2838 | 'edit-disabled',
|
2839 | 'valid-error',
|
2840 | 'scroll',
|
2841 | 'custom',
|
2842 |
|
2843 | ...VxeTableProEmits
|
2844 | ]
|
2845 |
|
2846 | export namespace VxeTableDefines {
|
2847 | export interface SortConfs {
|
2848 | field: string
|
2849 | order?: VxeTablePropTypes.SortOrder
|
2850 | }
|
2851 |
|
2852 | export interface MergeOptions<D = VxeTableDataRow> {
|
2853 | row: any | number
|
2854 | col: VxeTableDefines.ColumnInfo<D> | number
|
2855 | rowspan: number
|
2856 | colspan: number
|
2857 | }
|
2858 |
|
2859 | export interface MergeInfo {
|
2860 | row: number
|
2861 | col: number
|
2862 | rowspan: number
|
2863 | colspan: number
|
2864 | }
|
2865 |
|
2866 | export interface MergeItem<D = VxeTableDataRow> extends MergeInfo {
|
2867 | _row: any
|
2868 | _col: VxeTableDefines.ColumnInfo<D>
|
2869 | _rowspan: number
|
2870 | _colspan: number
|
2871 | }
|
2872 |
|
2873 | export interface ColumnOptions<D = VxeTableDataRow> extends VxeColumnProps<D> {
|
2874 | children?: ColumnOptions<D>[]
|
2875 | slots?: VxeColumnPropTypes.Slots<D>
|
2876 | }
|
2877 |
|
2878 | export interface RowCacheItem<D = any> {
|
2879 | row: D
|
2880 | rowid: string
|
2881 | seq: string | number
|
2882 | index: number
|
2883 | $index: number
|
2884 | _index: number
|
2885 | items: any[]
|
2886 | parent: any
|
2887 | level: number
|
2888 | treeLoaded?: boolean
|
2889 | expandLoaded?: boolean
|
2890 | formatData?: {
|
2891 | [key: string]: {
|
2892 | value: any
|
2893 | label: any
|
2894 | }
|
2895 | }
|
2896 | }
|
2897 |
|
2898 | export interface ColumnCacheItem<D = any> {
|
2899 | column: VxeTableDefines.ColumnInfo<D>
|
2900 | colid: string
|
2901 | index: number
|
2902 | $index: number
|
2903 | _index: number
|
2904 | items: VxeTableDefines.ColumnInfo<D>[]
|
2905 | parent: VxeTableDefines.ColumnInfo<D>
|
2906 | }
|
2907 |
|
2908 | /**
|
2909 | * 列对象
|
2910 | */
|
2911 | export class ColumnInfo<D = VxeTableDataRow> {
|
2912 | /**
|
2913 | * 该属性已废弃,该属性被 field 替换
|
2914 | * @deprecated
|
2915 | */
|
2916 | property: VxeColumnPropTypes.Field
|
2917 |
|
2918 | /**
|
2919 | * 公开属性
|
2920 | */
|
2921 | type: VxeColumnPropTypes.Type
|
2922 | field: VxeColumnPropTypes.Field
|
2923 | title: VxeColumnPropTypes.Title
|
2924 | width: VxeColumnPropTypes.Width
|
2925 | minWidth: VxeColumnPropTypes.MinWidth
|
2926 | maxWidth: VxeColumnPropTypes.MaxWidth
|
2927 | resizable: VxeColumnPropTypes.Resizable
|
2928 | fixed: VxeColumnPropTypes.Fixed
|
2929 | align: VxeColumnPropTypes.Align
|
2930 | headerAlign: VxeColumnPropTypes.HeaderAlign
|
2931 | footerAlign: VxeColumnPropTypes.FooterAlign
|
2932 | showOverflow: VxeColumnPropTypes.ShowOverflow
|
2933 | showHeaderOverflow: VxeColumnPropTypes.ShowHeaderOverflow
|
2934 | showFooterOverflow: VxeColumnPropTypes.ShowFooterOverflow
|
2935 | className: VxeColumnPropTypes.ClassName
|
2936 | headerClassName: VxeColumnPropTypes.HeaderClassName
|
2937 | footerClassName: VxeColumnPropTypes.FooterClassName
|
2938 | formatter: VxeColumnPropTypes.Formatter<D>
|
2939 | sortable: VxeColumnPropTypes.Sortable
|
2940 | sortBy: VxeColumnPropTypes.SortBy
|
2941 | sortType: VxeColumnPropTypes.SortType
|
2942 | filters: VxeColumnPropTypes.Filter[]
|
2943 | filterMultiple: VxeColumnPropTypes.FilterMultiple
|
2944 | filterMethod: VxeColumnPropTypes.FilterMethod<D>
|
2945 | filterRender: VxeColumnPropTypes.FilterRender
|
2946 | treeNode: VxeColumnPropTypes.TreeNode
|
2947 | visible: VxeColumnPropTypes.Visible
|
2948 | exportMethod: VxeColumnPropTypes.ExportMethod<D>
|
2949 | footerExportMethod: VxeColumnPropTypes.FooterExportMethod
|
2950 | /**
|
2951 | * 已废弃,请使用 titlePrefix
|
2952 | * @deprecated
|
2953 | */
|
2954 | titleHelp: VxeColumnPropTypes.TitleHelp
|
2955 | titlePrefix: VxeColumnPropTypes.TitlePrefix
|
2956 | titleSuffix: VxeColumnPropTypes.TitleSuffix
|
2957 | cellType: VxeColumnPropTypes.CellType
|
2958 | cellRender: VxeColumnPropTypes.CellRender<D>
|
2959 | editRender: VxeColumnPropTypes.EditRender
|
2960 | contentRender: VxeColumnPropTypes.ContentRender
|
2961 | params: VxeColumnPropTypes.Params
|
2962 | slots: VxeColumnPropTypes.Slots<D>
|
2963 |
|
2964 | /**
|
2965 | * 以下内部属性
|
2966 | * 内部属性随时都会调整,不应该被使用
|
2967 | */
|
2968 | id: string
|
2969 | parentId: string
|
2970 | level: number
|
2971 | rowSpan: number
|
2972 | colSpan: number
|
2973 | halfVisible: boolean
|
2974 | defaultVisible: any
|
2975 | defaultFixed: any
|
2976 | checked: boolean
|
2977 | halfChecked: boolean
|
2978 | disabled: boolean
|
2979 |
|
2980 | // 数据排序
|
2981 | order: VxeTablePropTypes.SortOrder
|
2982 | sortTime: number
|
2983 |
|
2984 | // 列排序
|
2985 | sortNumber: number
|
2986 | renderSortNumber: number
|
2987 |
|
2988 | renderWidth: number
|
2989 | renderHeight: number
|
2990 | resizeWidth: number
|
2991 | model: {
|
2992 | update: boolean
|
2993 | value: any
|
2994 | }
|
2995 |
|
2996 | children: ColumnInfo<D>[]
|
2997 |
|
2998 | renderHeader(params: CellRenderHeaderParams<D>): VNode[]
|
2999 | renderCell(params: CellRenderCellParams<D>): VNode[]
|
3000 | renderData(params: CellRenderDataParams<D>): VNode[]
|
3001 | renderFooter(params: CellRenderFooterParams<D>): VNode[]
|
3002 |
|
3003 | getTitle(): string
|
3004 | getKey(): string
|
3005 | }
|
3006 |
|
3007 | export interface CellRenderHeaderParams<D = VxeTableDataRow> {
|
3008 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
3009 | $grid: VxeGridConstructor<D> | null
|
3010 | $rowIndex: number
|
3011 | column: ColumnInfo<D>
|
3012 | columnIndex: number
|
3013 | $columnIndex: number
|
3014 | _columnIndex: number
|
3015 | fixed: VxeColumnPropTypes.Fixed
|
3016 | type: string
|
3017 | isHidden: boolean
|
3018 | hasFilter: boolean
|
3019 |
|
3020 | checked?: boolean
|
3021 | indeterminate?: boolean
|
3022 | }
|
3023 |
|
3024 | export interface CellRenderBodyParams<D = VxeTableDataRow> {
|
3025 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
3026 | $grid: VxeGridConstructor<D> | null
|
3027 | seq: string | number
|
3028 | rowid: string
|
3029 | row: D
|
3030 | rowIndex: number
|
3031 | $rowIndex: number
|
3032 | _rowIndex: number
|
3033 | column: ColumnInfo<D>
|
3034 | columnIndex: number
|
3035 | $columnIndex: number
|
3036 | _columnIndex: number
|
3037 | fixed: VxeColumnPropTypes.Fixed
|
3038 | type: string
|
3039 | isHidden: boolean
|
3040 | level: number
|
3041 | visibleData: D[]
|
3042 | data: D[]
|
3043 | items: any[]
|
3044 | }
|
3045 |
|
3046 | export interface CellRenderDataParams<D = VxeTableDataRow> extends CellRenderBodyParams<D> { }
|
3047 | export interface CellRenderCellParams<D = VxeTableDataRow> extends CellRenderBodyParams<D> { }
|
3048 |
|
3049 | export interface CellRenderFooterParams<D = VxeTableDataRow> {
|
3050 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
3051 | $grid: VxeGridConstructor<D> | null
|
3052 | row: D
|
3053 | rowIndex: number
|
3054 | _rowIndex: number
|
3055 | $rowIndex: number
|
3056 | column: ColumnInfo<D>
|
3057 | columnIndex: number
|
3058 | $columnIndex: number
|
3059 | _columnIndex: number
|
3060 | fixed: VxeColumnPropTypes.Fixed
|
3061 | type: string
|
3062 | data: any[][]
|
3063 |
|
3064 | // 兼容旧
|
3065 | itemIndex: number
|
3066 | items: any[]
|
3067 | }
|
3068 |
|
3069 | interface TableEventParams<D = VxeTableDataRow> extends VxeEvent {
|
3070 | $table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
3071 | }
|
3072 |
|
3073 | interface TableBaseHeaderCellParams<D = VxeTableDataRow> {
|
3074 | $rowIndex: number
|
3075 | column: ColumnInfo<D>
|
3076 | columnIndex: number
|
3077 | $columnIndex: number
|
3078 | }
|
3079 |
|
3080 | interface TableBaseCellParams<D = VxeTableDataRow> {
|
3081 | row: D
|
3082 | rowIndex: number
|
3083 | $rowIndex: number
|
3084 | column: ColumnInfo<D>
|
3085 | columnIndex: number
|
3086 | $columnIndex: number
|
3087 | }
|
3088 |
|
3089 | interface TableBaseFooterCellParams<D = VxeTableDataRow> {
|
3090 | $rowIndex: number
|
3091 | column: ColumnInfo<D>
|
3092 | columnIndex: number
|
3093 | $columnIndex: number
|
3094 | }
|
3095 |
|
3096 | export interface KeydownStartParams { }
|
3097 | export interface KeydownStartEventParams<D = VxeTableDataRow> extends TableEventParams<D>, KeydownStartParams { }
|
3098 |
|
3099 | export interface KeydownParams { }
|
3100 | export interface KeydownEventParams<D = VxeTableDataRow> extends TableEventParams<D>, KeydownParams { }
|
3101 |
|
3102 | export interface KeydownEndParams { }
|
3103 | export interface KeydownEndEventParams<D = VxeTableDataRow> extends TableEventParams<D>, KeydownEndParams { }
|
3104 |
|
3105 | export interface PasteParams { }
|
3106 | export interface PasteEventParams<D = VxeTableDataRow> extends TableEventParams<D>, PasteParams { }
|
3107 |
|
3108 | export interface CopyParams { }
|
3109 | export interface CopyEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CopyParams { }
|
3110 |
|
3111 | export interface CutParams { }
|
3112 | export interface CutEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CutParams { }
|
3113 |
|
3114 | export interface CurrentChangeParams<D = VxeTableDataRow> extends TableBaseCellParams<D> {
|
3115 | newValue: any
|
3116 | oldValue: any
|
3117 | }
|
3118 | export interface CurrentChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CurrentChangeParams<D> { }
|
3119 |
|
3120 | export interface RadioChangeParams<D = VxeTableDataRow> extends TableBaseCellParams<D> {
|
3121 | newValue: any
|
3122 | oldValue: any
|
3123 | }
|
3124 | export interface RadioChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, RadioChangeParams<D> { }
|
3125 |
|
3126 | export interface CheckboxChangeParams<D = VxeTableDataRow> extends TableBaseCellParams<D> {
|
3127 | checked: boolean
|
3128 | /**
|
3129 | * 请调用方法 getCheckboxRecords() 获取
|
3130 | * @deprecated
|
3131 | */
|
3132 | records: D[]
|
3133 | /**
|
3134 | * 请调用方法 getCheckboxReserveRecords() 获取
|
3135 | * @deprecated
|
3136 | */
|
3137 | reserves: D[]
|
3138 | /**
|
3139 | * 请调用方法 getCheckboxIndeterminateRecords() 获取
|
3140 | * @deprecated
|
3141 | */
|
3142 | indeterminates: D[]
|
3143 | }
|
3144 | export interface CheckboxChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CheckboxChangeParams<D> { }
|
3145 |
|
3146 | export interface CheckboxAllParams<D = VxeTableDataRow> extends CheckboxChangeParams<D> { }
|
3147 | export interface CheckboxAllEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CheckboxAllParams<D> { }
|
3148 |
|
3149 | export interface CheckboxRangeStartParams<D = VxeTableDataRow> {
|
3150 | /**
|
3151 | * 请调用方法 getCheckboxRecords() 获取
|
3152 | * @deprecated
|
3153 | */
|
3154 | records: D[]
|
3155 | /**
|
3156 | * 请调用方法 getCheckboxReserveRecords() 获取
|
3157 | * @deprecated
|
3158 | */
|
3159 | reserves: D[]
|
3160 | }
|
3161 | export interface CheckboxRangeStartEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CheckboxRangeStartParams<D> { }
|
3162 |
|
3163 | export interface CheckboxRangeChangeParams<D = VxeTableDataRow> extends CheckboxRangeStartParams<D> { }
|
3164 | export interface CheckboxRangeChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CheckboxRangeChangeParams<D> { }
|
3165 |
|
3166 | export interface CheckboxRangeEndParams<D = VxeTableDataRow> extends CheckboxRangeStartParams<D> { }
|
3167 |
|
3168 | export interface CheckboxRangeEndEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CheckboxRangeEndParams<D> { }
|
3169 |
|
3170 | export interface CheckboxRangeSelectParams<D = VxeTableDataRow> {
|
3171 | rangeRecords: D[]
|
3172 | }
|
3173 | export interface CheckboxRangeSelectEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CheckboxRangeSelectParams<D> { }
|
3174 |
|
3175 | export interface CellClickParams<D = VxeTableDataRow> extends TableBaseCellParams<D> {
|
3176 | triggerRadio: boolean
|
3177 | triggerCheckbox: boolean
|
3178 | triggerTreeNode: boolean
|
3179 | triggerExpandNode: boolean
|
3180 | }
|
3181 | export interface CellClickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CellClickParams<D> { }
|
3182 |
|
3183 | export interface CellDblclickParams<D = VxeTableDataRow> extends TableEventParams<D>, CellClickParams<D> { }
|
3184 | export interface CellDblclickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CellDblclickParams<D> { }
|
3185 |
|
3186 | export interface CellMenuParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3187 | export interface CellMenuEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CellMenuParams<D> { }
|
3188 |
|
3189 | export interface CellMouseenterParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3190 | export interface CellMouseenterEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CellMouseenterParams<D> { }
|
3191 |
|
3192 | export interface CellMouseleaveParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3193 | export interface CellMouseleaveEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CellMouseleaveParams<D> { }
|
3194 |
|
3195 | export interface CellDeleteValueParams<D = VxeTableDataRow> {
|
3196 | row: D
|
3197 | rowIndex: number
|
3198 | column: VxeTableDefines.ColumnInfo<D>
|
3199 | columnIndex: number
|
3200 | activeArea: VxeTableProDefines.MouseActiveCellArea<D>
|
3201 | cellAreas: VxeTableProDefines.MouseCellArea<D>[]
|
3202 | }
|
3203 | export interface CellDeleteValueEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CellDeleteValueParams<D> { }
|
3204 |
|
3205 | export interface HeaderCellClickParams<D = VxeTableDataRow> extends TableBaseHeaderCellParams<D> {
|
3206 | triggerResizable: boolean
|
3207 | triggerSort: boolean
|
3208 | triggerFilter: boolean
|
3209 | }
|
3210 | export interface HeaderCellClickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, HeaderCellClickParams<D> { }
|
3211 |
|
3212 | export interface HeaderCellDblclickParams<D = VxeTableDataRow> extends TableBaseHeaderCellParams<D> { }
|
3213 | export interface HeaderCellDblclickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, HeaderCellDblclickParams<D> { }
|
3214 |
|
3215 | export interface HeaderCellMenuParams<D = VxeTableDataRow> extends TableBaseHeaderCellParams<D> { }
|
3216 | export interface HeaderCellMenuEventParams<D = VxeTableDataRow> extends TableEventParams<D>, HeaderCellMenuParams<D> { }
|
3217 |
|
3218 | export interface FooterCellClickParams<D = VxeTableDataRow> extends TableBaseFooterCellParams<D> { }
|
3219 | export interface FooterCellClickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, FooterCellClickParams<D> { }
|
3220 |
|
3221 | export interface FooterCellDblclickParams<D = VxeTableDataRow> extends TableBaseFooterCellParams<D> { }
|
3222 | export interface FooterCellDblclickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, FooterCellDblclickParams<D> { }
|
3223 |
|
3224 | export interface FooterCellMenuParams<D = VxeTableDataRow> extends TableBaseFooterCellParams<D> { }
|
3225 | export interface FooterCellMenuEventParams<D = VxeTableDataRow> extends TableEventParams<D>, FooterCellMenuParams<D> { }
|
3226 |
|
3227 | export interface SortCheckedParams<D = VxeTableDataRow> {
|
3228 | column: VxeTableDefines.ColumnInfo<D>
|
3229 | field: VxeColumnPropTypes.Field
|
3230 | property: VxeColumnPropTypes.Field
|
3231 | order: VxeTablePropTypes.SortOrder
|
3232 | sortTime: number
|
3233 | }
|
3234 | export interface SortChangeParams<D = VxeTableDataRow> extends SortCheckedParams<D> {
|
3235 | sortList: SortCheckedParams[]
|
3236 | }
|
3237 | export interface SortChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, SortChangeParams<D> { }
|
3238 |
|
3239 | export interface FilterCheckedParams<D = VxeTableDataRow> {
|
3240 | column: VxeTableDefines.ColumnInfo<D>
|
3241 | field: VxeColumnPropTypes.Field
|
3242 | property: VxeColumnPropTypes.Field
|
3243 | values: any[]
|
3244 | datas: any[]
|
3245 | }
|
3246 | export interface FilterChangeParams<D = VxeTableDataRow> extends FilterCheckedParams<D> {
|
3247 | filterList: FilterCheckedParams<D>[]
|
3248 | }
|
3249 | export interface FilterChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, FilterChangeParams<D> { }
|
3250 |
|
3251 | export interface FilterVisibleParams<D = VxeTableDataRow> {
|
3252 | column: VxeTableDefines.ColumnInfo<D>
|
3253 | field: VxeColumnPropTypes.Field
|
3254 | property: VxeColumnPropTypes.Field
|
3255 | filterList: FilterCheckedParams<D>[]
|
3256 | visible: boolean
|
3257 | }
|
3258 | export interface FilterVisibleEventParams<D = VxeTableDataRow> extends TableEventParams<D>, FilterVisibleParams<D> { }
|
3259 |
|
3260 | export interface ResizableChangeParams<D = VxeTableDataRow> extends TableBaseHeaderCellParams<D> { }
|
3261 | export interface ResizableChangeEventParams<D = VxeTableDataRow> extends TableEventParams<D>, ResizableChangeParams<D> {
|
3262 | resizeWidth: number
|
3263 | }
|
3264 |
|
3265 | export interface ToggleRowExpandParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3266 | export interface ToggleRowExpandEventParams<D = VxeTableDataRow> extends TableEventParams<D>, ToggleRowExpandParams { }
|
3267 |
|
3268 | export interface ToggleTreeExpandParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3269 | export interface ToggleTreeExpandEventParams<D = VxeTableDataRow> extends TableEventParams<D>, ToggleTreeExpandParams<D> { }
|
3270 |
|
3271 | export interface MenuClickParams<D = VxeTableDataRow> extends TableBaseCellParams<D> {
|
3272 | menu: VxeTableDefines.MenuFirstOption | VxeTableDefines.MenuChildOption
|
3273 | type: string
|
3274 | }
|
3275 | export interface MenuClickEventParams<D = VxeTableDataRow> extends TableEventParams<D>, MenuClickParams<D> { }
|
3276 |
|
3277 | export interface EditClosedParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3278 | export interface EditClosedEventParams<D = VxeTableDataRow> extends TableEventParams<D>, EditClosedParams<D> { }
|
3279 |
|
3280 | export interface EditActivedParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3281 | export interface EditActivedEventParams<D = VxeTableDataRow> extends TableEventParams<D>, EditActivedParams<D> { }
|
3282 |
|
3283 | export interface EditDisabledParams<D = VxeTableDataRow> extends TableBaseCellParams<D> { }
|
3284 | export interface EditDisabledEventParams<D = VxeTableDataRow> extends TableEventParams<D>, EditDisabledParams<D> { }
|
3285 |
|
3286 | export interface ValidErrorParams<D = VxeTableDataRow> extends TableBaseCellParams<D> {
|
3287 | rule: any
|
3288 | }
|
3289 | export interface ValidErrorEventParams<D = VxeTableDataRow> extends TableEventParams<D>, ValidErrorParams<D> { }
|
3290 |
|
3291 | export interface ScrollParams {
|
3292 | type: string
|
3293 | scrollTop: number
|
3294 | scrollLeft: number
|
3295 | scrollHeight: number
|
3296 | scrollWidth: number
|
3297 | bodyWidth: number
|
3298 | bodyHeight: number
|
3299 | isX: boolean
|
3300 | isY: boolean
|
3301 | }
|
3302 | export interface ScrollEventParams<D = VxeTableDataRow> extends TableEventParams<D>, ScrollParams {
|
3303 | target: HTMLDivElement
|
3304 | }
|
3305 |
|
3306 | export interface CustomParams {
|
3307 | type: string
|
3308 | }
|
3309 | export interface CustomEventParams<D = VxeTableDataRow> extends TableEventParams<D>, CustomParams { }
|
3310 | }
|
3311 |
|
3312 | export interface VxeTableEventProps<D = VxeTableDataRow> {
|
3313 | onKeydownStart?: VxeTableEvents.KeydownStart<D>
|
3314 | onKeydown?: VxeTableEvents.Keydown<D>
|
3315 | onKeydownEnd?: VxeTableEvents.KeydownEnd<D>
|
3316 | onPaste?: VxeTableEvents.Paste<D>
|
3317 | onCopy?: VxeTableEvents.Copy<D>
|
3318 | onCut?: VxeTableEvents.Cut<D>
|
3319 | onCurrentChange?: VxeTableEvents.CurrentChange<D>
|
3320 | onRadioChange?: VxeTableEvents.RadioChange<D>
|
3321 | onCheckboxChange?: VxeTableEvents.CheckboxChange<D>
|
3322 | onCheckboxAll?: VxeTableEvents.CheckboxAll<D>
|
3323 | onCheckboxRangeStart?: VxeTableEvents.CheckboxRangeStart<D>
|
3324 | onCheckboxRangeChange?: VxeTableEvents.CheckboxRangeChange<D>
|
3325 | onCheckboxRangeEnd?: VxeTableEvents.CheckboxRangeEnd<D>
|
3326 | onCheckboxRangeSelect?: VxeTableEvents.CheckboxRangeSelect<D>
|
3327 | onCellClick?: VxeTableEvents.CellClick<D>
|
3328 | onCellDblclick?: VxeTableEvents.CellDblclick<D>
|
3329 | onCellMenu?: VxeTableEvents.CellMenu<D>
|
3330 | onCellMouseenter?: VxeTableEvents.CellMouseenter<D>
|
3331 | onCellMouseleave?: VxeTableEvents.CellMouseleave<D>
|
3332 | onCellDeleteValue?: VxeTableEvents.CellDeleteValue<D>
|
3333 | onHeaderCellClick?: VxeTableEvents.HeaderCellClick<D>
|
3334 | onHeaderCellDblclick?: VxeTableEvents.HeaderCellDblclick<D>
|
3335 | onHeaderCellMenu?: VxeTableEvents.HeaderCellMenu<D>
|
3336 | onFooterCellClick?: VxeTableEvents.FooterCellClick<D>
|
3337 | onFooterCellDblclick?: VxeTableEvents.FooterCellDblclick<D>
|
3338 | onFooterCellMenu?: VxeTableEvents.FooterCellMenu<D>
|
3339 | onSortChange?: VxeTableEvents.SortChange<D>
|
3340 | onFilterChange?: VxeTableEvents.FilterChange<D>
|
3341 | onFilterVisible?: VxeTableEvents.FilterVisible<D>
|
3342 | onResizableChange?: VxeTableEvents.ResizableChange<D>
|
3343 | onToggleRowExpand?: VxeTableEvents.ToggleRowExpand<D>
|
3344 | onToggleTreeExpand?: VxeTableEvents.ToggleTreeExpand<D>
|
3345 | onMenuClick?: VxeTableEvents.MenuClick<D>
|
3346 | onEditClosed?: VxeTableEvents.EditClosed<D>
|
3347 | onEditActived?: VxeTableEvents.EditActived<D>
|
3348 | onEditDisabled?: VxeTableEvents.EditDisabled<D>
|
3349 | onValidError?: VxeTableEvents.ValidError<D>
|
3350 | onScroll?: VxeTableEvents.Scroll<D>
|
3351 | onCustom?: VxeTableEvents.Custom<D>
|
3352 | }
|
3353 |
|
3354 | export interface VxeTableListeners<D = VxeTableDataRow> {
|
3355 | /**
|
3356 | * 当表格被激活且键盘被按下开始时会触发的事件
|
3357 | */
|
3358 | keydownStart?: VxeTableEvents.KeydownStart<D>
|
3359 | /**
|
3360 | * 当表格被激活且键盘被按下时会触发的事件
|
3361 | */
|
3362 | keydown?: VxeTableEvents.Keydown<D>
|
3363 | /**
|
3364 | * 当表格被激活且键盘被按下结束时会触发的事件
|
3365 | */
|
3366 | keydownEnd?: VxeTableEvents.KeydownEnd<D>
|
3367 | paste?: VxeTableEvents.Paste<D>
|
3368 | copy?: VxeTableEvents.Copy<D>
|
3369 | cut?: VxeTableEvents.Cut<D>
|
3370 | currentChange?: VxeTableEvents.CurrentChange<D>
|
3371 | radioChange?: VxeTableEvents.RadioChange<D>
|
3372 | checkboxChange?: VxeTableEvents.CheckboxChange<D>
|
3373 | checkboxAll?: VxeTableEvents.CheckboxAll<D>
|
3374 | checkboxRangeStart?: VxeTableEvents.CheckboxRangeStart<D>
|
3375 | checkboxRangeChange?: VxeTableEvents.CheckboxRangeChange<D>
|
3376 | checkboxRangeEnd?: VxeTableEvents.CheckboxRangeEnd<D>
|
3377 | checkboxRangeSelect?: VxeTableEvents.CheckboxRangeSelect<D>
|
3378 | cellClick?: VxeTableEvents.CellClick<D>
|
3379 | cellDblclick?: VxeTableEvents.CellDblclick<D>
|
3380 | cellMenu?: VxeTableEvents.CellMenu<D>
|
3381 | cellMouseenter?: VxeTableEvents.CellMouseenter<D>
|
3382 | cellMouseleave?: VxeTableEvents.CellMouseleave<D>
|
3383 | cellDeleteValue?: VxeTableEvents.CellDeleteValue<D>
|
3384 | headerCellClick?: VxeTableEvents.HeaderCellClick<D>
|
3385 | headerCellDblclick?: VxeTableEvents.HeaderCellDblclick<D>
|
3386 | headerCellMenu?: VxeTableEvents.HeaderCellMenu<D>
|
3387 | footerCellClick?: VxeTableEvents.FooterCellClick<D>
|
3388 | footerCellDblclick?: VxeTableEvents.FooterCellDblclick<D>
|
3389 | footerCellMenu?: VxeTableEvents.FooterCellMenu<D>
|
3390 | sortChange?: VxeTableEvents.SortChange<D>
|
3391 | filterChange?: VxeTableEvents.FilterChange<D>
|
3392 | resizableChange?: VxeTableEvents.ResizableChange<D>
|
3393 | toggleRowExpand?: VxeTableEvents.ToggleRowExpand<D>
|
3394 | toggleTreeExpand?: VxeTableEvents.ToggleTreeExpand<D>
|
3395 | menuClick?: VxeTableEvents.MenuClick<D>
|
3396 | editClosed?: VxeTableEvents.EditClosed<D>
|
3397 | editActived?: VxeTableEvents.EditActived<D>
|
3398 | editDisabled?: VxeTableEvents.EditDisabled<D>
|
3399 | /**
|
3400 | * 只对 edit-rules 配置时有效,当数据校验不通过时会触发该事件
|
3401 | */
|
3402 | validError?: VxeTableEvents.ValidError<D>
|
3403 | /**
|
3404 | * 表格滚动时会触发该事件
|
3405 | */
|
3406 | scroll?: VxeTableEvents.Scroll<D>
|
3407 | /**
|
3408 | * 如果与工具栏关联,在自定义列按钮被手动点击后会触发该事件
|
3409 | */
|
3410 | custom?: VxeTableEvents.Custom<D>
|
3411 | }
|
3412 |
|
3413 | export namespace VxeTableEvents {
|
3414 | export type KeydownStart<D = any> = (params: VxeTableDefines.KeydownStartEventParams<D>) => void
|
3415 | export type Keydown<D = any> = (params: VxeTableDefines.KeydownEventParams<D>) => void
|
3416 | export type KeydownEnd<D = any> = (params: VxeTableDefines.KeydownEndEventParams<D>) => void
|
3417 | export type Paste<D = any> = (params: VxeTableDefines.PasteEventParams<D>) => void
|
3418 | export type Copy<D = any> = (params: VxeTableDefines.CopyEventParams<D>) => void
|
3419 | export type Cut<D = any> = (params: VxeTableDefines.CutEventParams<D>) => void
|
3420 | export type CurrentChange<D = any> = (params: VxeTableDefines.CurrentChangeEventParams<D>) => void
|
3421 | export type RadioChange<D = any> = (params: VxeTableDefines.RadioChangeEventParams<D>) => void
|
3422 | export type CheckboxChange<D = any> = (params: VxeTableDefines.CheckboxChangeEventParams<D>) => void
|
3423 | export type CheckboxAll<D = any> = (params: VxeTableDefines.CheckboxAllEventParams<D>) => void
|
3424 | export type CheckboxRangeStart<D = any> = (params: VxeTableDefines.CheckboxRangeStartEventParams<D>) => void
|
3425 | export type CheckboxRangeChange<D = any> = (params: VxeTableDefines.CheckboxRangeChangeEventParams<D>) => void
|
3426 | export type CheckboxRangeEnd<D = any> = (params: VxeTableDefines.CheckboxRangeEndEventParams<D>) => void
|
3427 | export type CheckboxRangeSelect<D = any> = (params: VxeTableDefines.CheckboxRangeSelectEventParams<D>) => void
|
3428 | export type CellClick<D = any> = (params: VxeTableDefines.CellClickEventParams<D>) => void
|
3429 | export type CellDblclick<D = any> = (params: VxeTableDefines.CellDblclickEventParams<D>) => void
|
3430 | export type CellMenu<D = any> = (params: VxeTableDefines.CellMenuEventParams<D>) => void
|
3431 | export type CellMouseenter<D = any> = (params: VxeTableDefines.CellMouseenterEventParams<D>) => void
|
3432 | export type CellMouseleave<D = any> = (params: VxeTableDefines.CellMouseleaveEventParams<D>) => void
|
3433 | export type CellDeleteValue<D = any> = (params: VxeTableDefines.CellDeleteValueEventParams<D>) => void
|
3434 | export type HeaderCellClick<D = any> = (params: VxeTableDefines.HeaderCellClickEventParams<D>) => void
|
3435 | export type HeaderCellDblclick<D = any> = (params: VxeTableDefines.HeaderCellDblclickEventParams<D>) => void
|
3436 | export type HeaderCellMenu<D = any> = (params: VxeTableDefines.HeaderCellMenuEventParams<D>) => void
|
3437 | export type FooterCellClick<D = any> = (params: VxeTableDefines.FooterCellClickEventParams<D>) => void
|
3438 | export type FooterCellDblclick<D = any> = (params: VxeTableDefines.FooterCellDblclickEventParams<D>) => void
|
3439 | export type FooterCellMenu<D = any> = (params: VxeTableDefines.FooterCellMenuEventParams<D>) => void
|
3440 | export type SortChange<D = any> = (params: VxeTableDefines.SortChangeEventParams<D>) => void
|
3441 | export type FilterChange<D = any> = (params: VxeTableDefines.FilterChangeEventParams<D>) => void
|
3442 | export type FilterVisible<D = any> = (params: VxeTableDefines.FilterVisibleEventParams<D>) => void
|
3443 | export type ResizableChange<D = any> = (params: VxeTableDefines.ResizableChangeEventParams<D>) => void
|
3444 | export type ToggleRowExpand<D = any> = (params: VxeTableDefines.ToggleRowExpandEventParams<D>) => void
|
3445 | export type ToggleTreeExpand<D = any> = (params: VxeTableDefines.ToggleTreeExpandEventParams<D>) => void
|
3446 | export type MenuClick<D = any> = (params: VxeTableDefines.MenuClickEventParams<D>) => void
|
3447 | export type EditClosed<D = any> = (params: VxeTableDefines.EditClosedEventParams<D>) => void
|
3448 | export type EditActived<D = any> = (params: VxeTableDefines.EditActivedEventParams<D>) => void
|
3449 | export type EditDisabled<D = any> = (params: VxeTableDefines.EditDisabledEventParams<D>) => void
|
3450 | export type ValidError<D = any> = (params: VxeTableDefines.ValidErrorEventParams<D>) => void
|
3451 | export type Scroll<D = any> = (params: VxeTableDefines.ScrollEventParams<D>) => void
|
3452 | export type Custom<D = any> = (params: VxeTableDefines.CustomEventParams<D>) => void
|
3453 | }
|
3454 |
|
3455 | export interface VxeTableSlots<D = VxeTableDataRow> {
|
3456 | |
3457 |
|
3458 |
|
3459 | empty?(params: {
|
3460 | $table: VxeTableConstructor<D>
|
3461 | $grid: VxeGridConstructor<D> | null | undefined
|
3462 | }): any
|
3463 | |
3464 |
|
3465 |
|
3466 | loading?(params: {
|
3467 | $table: VxeTableConstructor<D>
|
3468 | $grid: VxeGridConstructor<D> | null | undefined
|
3469 | }): any
|
3470 | }
|