1 | import { VXEComponent } from '../component'
|
2 | import { VxeTableDataRow, VxeTableDefines } from '../table'
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export const VxeTableEditModule: VXEComponent<{ [key: string]: any }>
|
10 |
|
11 |
|
12 |
|
13 | export const Edit: VXEComponent<{ [key: string]: any }>
|
14 |
|
15 | export interface TableEditMethods<D = VxeTableDataRow> {
|
16 | |
17 |
|
18 |
|
19 |
|
20 | insert(records: any): Promise<{ row: D, rows: D[] }>
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | insertAt(records: any, row: any | -1 | null): Promise<{ row: D, rows: D[] }>
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | insertNextAt(records: any, row: any | -1 | null): Promise<{ row: D, rows: D[] }>
|
39 | |
40 |
|
41 |
|
42 |
|
43 | remove(rows?: any | any[]): Promise<{ row: D, rows: D[] }>
|
44 | |
45 |
|
46 |
|
47 | removeCheckboxRow(): Promise<{ row: D, rows: D[] }>
|
48 | |
49 |
|
50 |
|
51 | removeRadioRow(): Promise<{ row: D, rows: D[] }>
|
52 | |
53 |
|
54 |
|
55 | removeCurrentRow(): Promise<{ row: D, rows: D[] }>
|
56 | |
57 |
|
58 |
|
59 |
|
60 | getRecordset(): {
|
61 | insertRecords: D[]
|
62 | removeRecords: D[]
|
63 | updateRecords: D[]
|
64 | pendingRecords: D[]
|
65 | }
|
66 | |
67 |
|
68 |
|
69 | getInsertRecords(): D[]
|
70 | |
71 |
|
72 |
|
73 | getRemoveRecords(): D[]
|
74 | |
75 |
|
76 |
|
77 | getUpdateRecords(): D[]
|
78 | |
79 |
|
80 |
|
81 |
|
82 | getActiveRecord(): {
|
83 | row: D
|
84 | rowIndex: number
|
85 | $rowIndex: number
|
86 | column: VxeTableDefines.ColumnInfo<D>
|
87 | columnIndex: number
|
88 | $columnIndex: number
|
89 | cell: HTMLElement
|
90 | }
|
91 | |
92 |
|
93 |
|
94 | getEditRecord(): {
|
95 | row: D
|
96 | rowIndex: number
|
97 | $rowIndex: number
|
98 | column: VxeTableDefines.ColumnInfo<D>
|
99 | columnIndex: number
|
100 | $columnIndex: number
|
101 | cell: HTMLElement
|
102 | }
|
103 | |
104 |
|
105 |
|
106 | getSelectedCell(): {
|
107 | row: D
|
108 | column: VxeTableDefines.ColumnInfo<D>
|
109 | }
|
110 | |
111 |
|
112 |
|
113 |
|
114 | clearActived(evnt?: Event): Promise<any>
|
115 | |
116 |
|
117 |
|
118 | clearEdit(evnt?: Event): Promise<any>
|
119 | |
120 |
|
121 |
|
122 | clearSelected(): Promise<any>
|
123 | |
124 |
|
125 |
|
126 |
|
127 | isActiveByRow(row: any): boolean
|
128 | |
129 |
|
130 |
|
131 |
|
132 | isEditByRow(row: any): boolean
|
133 | |
134 |
|
135 |
|
136 |
|
137 | setActiveRow(row: any): Promise<void>
|
138 | |
139 |
|
140 |
|
141 |
|
142 | setEditRow(row: any, fieldOrColumn?: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
143 | |
144 |
|
145 |
|
146 |
|
147 | setActiveCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
148 | |
149 |
|
150 |
|
151 |
|
152 |
|
153 | setEditCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
154 | |
155 |
|
156 |
|
157 |
|
158 |
|
159 | setSelectCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
|
160 | }
|
161 |
|
162 | export interface TableEditPrivateMethods<D = VxeTableDataRow> {
|
163 | handleActived(params: any, evnt?: any): Promise<any>
|
164 | handleFocus(params: any, evnt?: any): void
|
165 | handleSelected(params: any, evnt: any): Promise<any>
|
166 | addCellSelectedClass(): void
|
167 | }
|
168 |
|
169 | declare module '../grid' {
|
170 | export interface VxeGridMethods<D = VxeTableDataRow> extends TableEditMethods<D> { }
|
171 | }
|
172 |
|
173 | declare module '../table' {
|
174 | export interface VxeTableMethods<D = VxeTableDataRow> extends TableEditMethods<D> { }
|
175 | export interface VxeTablePrivateMethods<D = VxeTableDataRow> extends TableEditPrivateMethods<D> { }
|
176 | }
|