stk-table-vue 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,373 +1,384 @@
1
- import { Order, SortOption, SortState, StkTableColumn, UniqKey } from './types/index';
2
- /** Generic stands for DataType */
3
- type DT = any;
4
- /**
5
- * 选中一行,
6
- * @param {string} rowKey
7
- * @param {boolean} option.silent 是否触发回调
8
- */
9
- declare function setCurrentRow(rowKey: string, option?: {
10
- silent: boolean;
11
- }): void;
12
- /**
13
- * 设置表头排序状态
14
- * @param {string} dataIndex 列字段
15
- * @param {'asc'|'desc'|null} order
16
- * @param {object} option.sortOption 指定排序参数
17
- * @param {boolean} option.sort 是否触发排序
18
- * @param {boolean} option.silent 是否触发回调
19
- */
20
- declare function setSorter(dataIndex: string, order: null | 'asc' | 'desc', option?: {
21
- sortOption?: SortOption;
22
- silent?: boolean;
23
- sort?: boolean;
24
- }): any[];
25
- /** 重置排序 */
26
- declare function resetSorter(): void;
27
- /**
28
- * 设置滚动条位置
29
- * @param top 传null 则不变动位置
30
- * @param left 传null 则不变动位置
31
- */
32
- declare function scrollTo(top?: number | null, left?: number | null): void;
33
- /** 获取当前状态的表格数据 */
34
- declare function getTableData(): any[];
35
- /** 获取当前排序列的信息 */
36
- declare function getSortColumns(): SortState<DT>[];
37
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
38
- width?: string | undefined;
39
- /** 最小表格宽度 */
40
- minWidth?: string | undefined;
41
- /** 表格最大宽度*/
42
- maxWidth?: string | undefined;
43
- /** 斑马线条纹 */
44
- stripe?: boolean | undefined;
45
- /** 是否使用 table-layout:fixed */
46
- fixedMode?: boolean | undefined;
47
- /** 是否隐藏表头 */
48
- headless?: boolean | undefined;
49
- /** 主题,亮、暗 */
50
- theme?: "light" | "dark" | undefined;
51
- /** 行高 */
52
- rowHeight?: number | undefined;
53
- /** 表头行高。default = rowHeight */
54
- headerRowHeight?: number | null | undefined;
55
- /** 虚拟滚动 */
56
- virtual?: boolean | undefined;
57
- /** x轴虚拟滚动 */
58
- virtualX?: boolean | undefined;
59
- /** 表格列配置 */
60
- columns?: StkTableColumn<any>[] | undefined;
61
- /** 表格数据源 */
62
- dataSource?: any[] | undefined;
63
- /** 行唯一键 */
64
- rowKey?: UniqKey | undefined;
65
- /** 列唯一键 */
66
- colKey?: UniqKey | undefined;
67
- /** 空值展示文字 */
68
- emptyCellText?: string | undefined;
69
- /** 暂无数据兜底高度是否撑满 */
70
- noDataFull?: boolean | undefined;
71
- /** 是否展示暂无数据 */
72
- showNoData?: boolean | undefined;
73
- /** 是否服务端排序,true则不排序数据 */
74
- sortRemote?: boolean | undefined;
75
- /** 表头是否溢出展示... */
76
- showHeaderOverflow?: boolean | undefined;
77
- /** 表体溢出是否展示... */
78
- showOverflow?: boolean | undefined;
79
- /** 是否增加行hover class */
80
- showTrHoverClass?: boolean | undefined;
81
- /** 表头是否可拖动。支持回调函数。 */
82
- headerDrag?: boolean | ((col: StkTableColumn<any>) => boolean) | undefined;
83
- /**
84
- * 给行附加className<br>
85
- * FIXME: 是否需要优化,因为不传此prop会使表格行一直执行空函数,是否有影响
86
- */
87
- rowClassName?: ((row: any, i: number) => string) | undefined;
88
- /**
89
- * 列宽是否可拖动<br>
90
- * **不要设置**列minWidth,**必须**设置width<br>
91
- * 列宽拖动时,每一列都必须要有width,且minWidth/maxWidth不生效。table width会变为"fit-content"。
92
- */
93
- colResizable?: boolean | undefined;
94
- /** 可拖动至最小的列宽 */
95
- colMinWidth?: number | undefined;
96
- /**
97
- * 单元格分割线。
98
- * 默认横竖都有
99
- * "h" - 仅展示横线
100
- * "v" - 仅展示竖线
101
- * "body-v" - 仅表体展示竖线
102
- */
103
- bordered?: boolean | "h" | "v" | "body-v" | undefined;
104
- /**
105
- * 自动重新计算虚拟滚动高度宽度。默认true
106
- * [非响应式]
107
- * 传入方法表示resize后的回调
108
- */
109
- autoResize?: boolean | (() => void) | undefined;
110
- /** 是否展示固定列阴影。默认不展示。 */
111
- fixedColShadow?: boolean | undefined;
112
- /** 优化vue2 滚动 */
113
- optimizeVue2Scroll?: boolean | undefined;
114
- }>, {
115
- width: string;
116
- fixedMode: boolean;
117
- stripe: boolean;
118
- minWidth: string;
119
- maxWidth: string;
120
- headless: boolean;
121
- theme: string;
122
- rowHeight: number;
123
- headerRowHeight: null;
124
- virtual: boolean;
125
- virtualX: boolean;
126
- columns: () => never[];
127
- dataSource: () => never[];
128
- rowKey: string;
129
- colKey: string;
130
- emptyCellText: string;
131
- noDataFull: boolean;
132
- showNoData: boolean;
133
- sortRemote: boolean;
134
- showHeaderOverflow: boolean;
135
- showOverflow: boolean;
136
- showTrHoverClass: boolean;
137
- headerDrag: boolean;
138
- rowClassName: () => "";
139
- colResizable: boolean;
140
- colMinWidth: number;
141
- bordered: boolean;
142
- autoResize: boolean;
143
- fixedColShadow: boolean;
144
- optimizeVue2Scroll: boolean;
145
- }>, {
146
- /** 初始化横向纵向虚拟滚动 */
147
- initVirtualScroll: (height?: number | undefined) => void;
148
- /** 初始化横向虚拟滚动 */
149
- initVirtualScrollX: () => void;
150
- /** 初始化纵向虚拟滚动 */
151
- initVirtualScrollY: (height?: number | undefined) => void;
152
- /** 设置当前选中行 */
153
- setCurrentRow: typeof setCurrentRow;
154
- /** 设置高亮渐暗单元格 */
155
- setHighlightDimCell: (rowKeyValue: string, dataIndex: string) => void;
156
- /** 设置高亮渐暗行 */
157
- setHighlightDimRow: (rowKeyValues: (string | number)[]) => void;
158
- /** 表格排序列dataIndex */
159
- sortCol: import("vue").Ref<string | null | undefined>;
160
- /** 获取当前排序状态 */
161
- getSortColumns: typeof getSortColumns;
162
- /** 设置排序 */
163
- setSorter: typeof setSorter;
164
- /** 重置排序 */
165
- resetSorter: typeof resetSorter;
166
- /** 滚动至 */
167
- scrollTo: typeof scrollTo;
168
- /** 获取表格数据 */
169
- getTableData: typeof getTableData;
170
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
171
- "sort-change": (col: StkTableColumn<any>, order: Order, data: any[]) => void;
172
- "row-click": (ev: MouseEvent, row: any) => void;
173
- "current-change": (ev: MouseEvent | null, row: any) => void;
174
- "row-dblclick": (ev: MouseEvent, row: any) => void;
175
- "header-row-menu": (ev: MouseEvent) => void;
176
- "row-menu": (ev: MouseEvent, row: any) => void;
177
- "cell-click": (ev: MouseEvent, row: any, col: StkTableColumn<any>) => void;
178
- "header-cell-click": (ev: MouseEvent, col: StkTableColumn<any>) => void;
179
- scroll: (ev: Event, data: {
180
- startIndex: number;
181
- endIndex: number;
182
- }) => void;
183
- "scroll-x": (ev: Event) => void;
184
- "col-order-change": (dragStartKey: string, targetColKey: string) => void;
185
- "th-drag-start": (dragStartKey: string) => void;
186
- "th-drop": (targetColKey: string) => void;
187
- "update:columns": (cols: StkTableColumn<any>[]) => void;
188
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
189
- width?: string | undefined;
190
- /** 最小表格宽度 */
191
- minWidth?: string | undefined;
192
- /** 表格最大宽度*/
193
- maxWidth?: string | undefined;
194
- /** 斑马线条纹 */
195
- stripe?: boolean | undefined;
196
- /** 是否使用 table-layout:fixed */
197
- fixedMode?: boolean | undefined;
198
- /** 是否隐藏表头 */
199
- headless?: boolean | undefined;
200
- /** 主题,亮、暗 */
201
- theme?: "light" | "dark" | undefined;
202
- /** 行高 */
203
- rowHeight?: number | undefined;
204
- /** 表头行高。default = rowHeight */
205
- headerRowHeight?: number | null | undefined;
206
- /** 虚拟滚动 */
207
- virtual?: boolean | undefined;
208
- /** x轴虚拟滚动 */
209
- virtualX?: boolean | undefined;
210
- /** 表格列配置 */
211
- columns?: StkTableColumn<any>[] | undefined;
212
- /** 表格数据源 */
213
- dataSource?: any[] | undefined;
214
- /** 行唯一键 */
215
- rowKey?: UniqKey | undefined;
216
- /** 列唯一键 */
217
- colKey?: UniqKey | undefined;
218
- /** 空值展示文字 */
219
- emptyCellText?: string | undefined;
220
- /** 暂无数据兜底高度是否撑满 */
221
- noDataFull?: boolean | undefined;
222
- /** 是否展示暂无数据 */
223
- showNoData?: boolean | undefined;
224
- /** 是否服务端排序,true则不排序数据 */
225
- sortRemote?: boolean | undefined;
226
- /** 表头是否溢出展示... */
227
- showHeaderOverflow?: boolean | undefined;
228
- /** 表体溢出是否展示... */
229
- showOverflow?: boolean | undefined;
230
- /** 是否增加行hover class */
231
- showTrHoverClass?: boolean | undefined;
232
- /** 表头是否可拖动。支持回调函数。 */
233
- headerDrag?: boolean | ((col: StkTableColumn<any>) => boolean) | undefined;
234
- /**
235
- * 给行附加className<br>
236
- * FIXME: 是否需要优化,因为不传此prop会使表格行一直执行空函数,是否有影响
237
- */
238
- rowClassName?: ((row: any, i: number) => string) | undefined;
239
- /**
240
- * 列宽是否可拖动<br>
241
- * **不要设置**列minWidth,**必须**设置width<br>
242
- * 列宽拖动时,每一列都必须要有width,且minWidth/maxWidth不生效。table width会变为"fit-content"。
243
- */
244
- colResizable?: boolean | undefined;
245
- /** 可拖动至最小的列宽 */
246
- colMinWidth?: number | undefined;
247
- /**
248
- * 单元格分割线。
249
- * 默认横竖都有
250
- * "h" - 仅展示横线
251
- * "v" - 仅展示竖线
252
- * "body-v" - 仅表体展示竖线
253
- */
254
- bordered?: boolean | "h" | "v" | "body-v" | undefined;
255
- /**
256
- * 自动重新计算虚拟滚动高度宽度。默认true
257
- * [非响应式]
258
- * 传入方法表示resize后的回调
259
- */
260
- autoResize?: boolean | (() => void) | undefined;
261
- /** 是否展示固定列阴影。默认不展示。 */
262
- fixedColShadow?: boolean | undefined;
263
- /** 优化vue2 滚动 */
264
- optimizeVue2Scroll?: boolean | undefined;
265
- }>, {
266
- width: string;
267
- fixedMode: boolean;
268
- stripe: boolean;
269
- minWidth: string;
270
- maxWidth: string;
271
- headless: boolean;
272
- theme: string;
273
- rowHeight: number;
274
- headerRowHeight: null;
275
- virtual: boolean;
276
- virtualX: boolean;
277
- columns: () => never[];
278
- dataSource: () => never[];
279
- rowKey: string;
280
- colKey: string;
281
- emptyCellText: string;
282
- noDataFull: boolean;
283
- showNoData: boolean;
284
- sortRemote: boolean;
285
- showHeaderOverflow: boolean;
286
- showOverflow: boolean;
287
- showTrHoverClass: boolean;
288
- headerDrag: boolean;
289
- rowClassName: () => "";
290
- colResizable: boolean;
291
- colMinWidth: number;
292
- bordered: boolean;
293
- autoResize: boolean;
294
- fixedColShadow: boolean;
295
- optimizeVue2Scroll: boolean;
296
- }>>> & {
297
- onScroll?: ((ev: Event, data: {
298
- startIndex: number;
299
- endIndex: number;
300
- }) => any) | undefined;
301
- "onUpdate:columns"?: ((cols: StkTableColumn<any>[]) => any) | undefined;
302
- "onTh-drag-start"?: ((dragStartKey: string) => any) | undefined;
303
- "onCol-order-change"?: ((dragStartKey: string, targetColKey: string) => any) | undefined;
304
- "onTh-drop"?: ((targetColKey: string) => any) | undefined;
305
- "onSort-change"?: ((col: StkTableColumn<any>, order: Order, data: any[]) => any) | undefined;
306
- "onRow-click"?: ((ev: MouseEvent, row: any) => any) | undefined;
307
- "onCurrent-change"?: ((ev: MouseEvent | null, row: any) => any) | undefined;
308
- "onRow-dblclick"?: ((ev: MouseEvent, row: any) => any) | undefined;
309
- "onHeader-row-menu"?: ((ev: MouseEvent) => any) | undefined;
310
- "onRow-menu"?: ((ev: MouseEvent, row: any) => any) | undefined;
311
- "onCell-click"?: ((ev: MouseEvent, row: any, col: StkTableColumn<any>) => any) | undefined;
312
- "onHeader-cell-click"?: ((ev: MouseEvent, col: StkTableColumn<any>) => any) | undefined;
313
- "onScroll-x"?: ((ev: Event) => any) | undefined;
314
- }, {
315
- width: string;
316
- minWidth: string;
317
- maxWidth: string;
318
- rowHeight: number;
319
- headless: boolean;
320
- headerRowHeight: number | null;
321
- stripe: boolean;
322
- fixedMode: boolean;
323
- theme: "light" | "dark";
324
- virtual: boolean;
325
- virtualX: boolean;
326
- columns: StkTableColumn<any>[];
327
- dataSource: any[];
328
- rowKey: UniqKey;
329
- colKey: UniqKey;
330
- emptyCellText: string;
331
- noDataFull: boolean;
332
- showNoData: boolean;
333
- sortRemote: boolean;
334
- showHeaderOverflow: boolean;
335
- showOverflow: boolean;
336
- showTrHoverClass: boolean;
337
- headerDrag: boolean | ((col: StkTableColumn<any>) => boolean);
338
- rowClassName: (row: any, i: number) => string;
339
- colResizable: boolean;
340
- colMinWidth: number;
341
- bordered: boolean | "h" | "v" | "body-v";
342
- autoResize: boolean | (() => void);
343
- fixedColShadow: boolean;
344
- optimizeVue2Scroll: boolean;
345
- }, {}>, {
346
- tableHeader?(_: {
347
- col: StkTableColumn<any>;
348
- }): any;
349
- empty?(_: {}): any;
350
- }>;
351
- export default _default;
352
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
353
- type __VLS_TypePropsToRuntimeProps<T> = {
354
- [K in keyof T]-?: {} extends Pick<T, K> ? {
355
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
356
- } : {
357
- type: import('vue').PropType<T[K]>;
358
- required: true;
359
- };
360
- };
361
- type __VLS_WithDefaults<P, D> = {
362
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
363
- default: D[K];
364
- }> : P[K];
365
- };
366
- type __VLS_Prettify<T> = {
367
- [K in keyof T]: T[K];
368
- } & {};
369
- type __VLS_WithTemplateSlots<T, S> = T & {
370
- new (): {
371
- $slots: S;
372
- };
373
- };
1
+ import { Order, SortConfig, SortOption, SortState, StkTableColumn, UniqKey } from './types/index';
2
+ /** Generic stands for DataType */
3
+ type DT = any;
4
+ /**
5
+ * 选中一行,
6
+ * @param {string} rowKey
7
+ * @param {boolean} option.silent 是否触发回调
8
+ */
9
+ declare function setCurrentRow(rowKey: string, option?: {
10
+ silent: boolean;
11
+ }): void;
12
+ /**
13
+ * 设置表头排序状态
14
+ * @param {string} dataIndex 列字段
15
+ * @param {'asc'|'desc'|null} order
16
+ * @param {object} option.sortOption 指定排序参数
17
+ * @param {boolean} option.sort 是否触发排序
18
+ * @param {boolean} option.silent 是否触发回调
19
+ */
20
+ declare function setSorter(dataIndex: string, order: null | 'asc' | 'desc', option?: {
21
+ sortOption?: SortOption;
22
+ silent?: boolean;
23
+ sort?: boolean;
24
+ }): any[];
25
+ /** 重置排序 */
26
+ declare function resetSorter(): void;
27
+ /**
28
+ * 设置滚动条位置
29
+ * @param top 传null 则不变动位置
30
+ * @param left 传null 则不变动位置
31
+ */
32
+ declare function scrollTo(top?: number | null, left?: number | null): void;
33
+ /** 获取当前状态的表格数据 */
34
+ declare function getTableData(): any[];
35
+ /** 获取当前排序列的信息 */
36
+ declare function getSortColumns(): SortState<DT>[];
37
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
38
+ width?: string | undefined;
39
+ /** 最小表格宽度 */
40
+ minWidth?: string | undefined;
41
+ /** 表格最大宽度*/
42
+ maxWidth?: string | undefined;
43
+ /** 斑马线条纹 */
44
+ stripe?: boolean | undefined;
45
+ /** 是否使用 table-layout:fixed */
46
+ fixedMode?: boolean | undefined;
47
+ /** 是否隐藏表头 */
48
+ headless?: boolean | undefined;
49
+ /** 主题,亮、暗 */
50
+ theme?: "light" | "dark" | undefined;
51
+ /** 行高 */
52
+ rowHeight?: number | undefined;
53
+ /** 表头行高。default = rowHeight */
54
+ headerRowHeight?: number | null | undefined;
55
+ /** 虚拟滚动 */
56
+ virtual?: boolean | undefined;
57
+ /** x轴虚拟滚动 */
58
+ virtualX?: boolean | undefined;
59
+ /** 表格列配置 */
60
+ columns?: StkTableColumn<any>[] | undefined;
61
+ /** 表格数据源 */
62
+ dataSource?: any[] | undefined;
63
+ /** 行唯一键 */
64
+ rowKey?: UniqKey | undefined;
65
+ /** 列唯一键 */
66
+ colKey?: UniqKey | undefined;
67
+ /** 空值展示文字 */
68
+ emptyCellText?: string | undefined;
69
+ /** 暂无数据兜底高度是否撑满 */
70
+ noDataFull?: boolean | undefined;
71
+ /** 是否展示暂无数据 */
72
+ showNoData?: boolean | undefined;
73
+ /** 是否服务端排序,true则不排序数据 */
74
+ sortRemote?: boolean | undefined;
75
+ /** 表头是否溢出展示... */
76
+ showHeaderOverflow?: boolean | undefined;
77
+ /** 表体溢出是否展示... */
78
+ showOverflow?: boolean | undefined;
79
+ /** 是否增加行hover class */
80
+ showTrHoverClass?: boolean | undefined;
81
+ /** 表头是否可拖动。支持回调函数。 */
82
+ headerDrag?: boolean | ((col: StkTableColumn<any>) => boolean) | undefined;
83
+ /**
84
+ * 给行附加className<br>
85
+ * FIXME: 是否需要优化,因为不传此prop会使表格行一直执行空函数,是否有影响
86
+ */
87
+ rowClassName?: ((row: any, i: number) => string) | undefined;
88
+ /**
89
+ * 列宽是否可拖动<br>
90
+ * **不要设置**列minWidth,**必须**设置width<br>
91
+ * 列宽拖动时,每一列都必须要有width,且minWidth/maxWidth不生效。table width会变为"fit-content"。
92
+ */
93
+ colResizable?: boolean | undefined;
94
+ /** 可拖动至最小的列宽 */
95
+ colMinWidth?: number | undefined;
96
+ /**
97
+ * 单元格分割线。
98
+ * 默认横竖都有
99
+ * "h" - 仅展示横线
100
+ * "v" - 仅展示竖线
101
+ * "body-v" - 仅表体展示竖线
102
+ */
103
+ bordered?: boolean | "h" | "v" | "body-v" | undefined;
104
+ /**
105
+ * 自动重新计算虚拟滚动高度宽度。默认true
106
+ * [非响应式]
107
+ * 传入方法表示resize后的回调
108
+ */
109
+ autoResize?: boolean | (() => void) | undefined;
110
+ /** 是否展示固定列阴影。默认不展示。 */
111
+ fixedColShadow?: boolean | undefined;
112
+ /** 优化vue2 滚动 */
113
+ optimizeVue2Scroll?: boolean | undefined;
114
+ /** 排序配置 */
115
+ sortConfig?: SortConfig | undefined;
116
+ }>, {
117
+ width: string;
118
+ fixedMode: boolean;
119
+ stripe: boolean;
120
+ minWidth: string;
121
+ maxWidth: string;
122
+ headless: boolean;
123
+ theme: string;
124
+ rowHeight: number;
125
+ headerRowHeight: null;
126
+ virtual: boolean;
127
+ virtualX: boolean;
128
+ columns: () => never[];
129
+ dataSource: () => never[];
130
+ rowKey: string;
131
+ colKey: string;
132
+ emptyCellText: string;
133
+ noDataFull: boolean;
134
+ showNoData: boolean;
135
+ sortRemote: boolean;
136
+ showHeaderOverflow: boolean;
137
+ showOverflow: boolean;
138
+ showTrHoverClass: boolean;
139
+ headerDrag: boolean;
140
+ rowClassName: () => "";
141
+ colResizable: boolean;
142
+ colMinWidth: number;
143
+ bordered: boolean;
144
+ autoResize: boolean;
145
+ fixedColShadow: boolean;
146
+ optimizeVue2Scroll: boolean;
147
+ sortConfig: () => {
148
+ emptyToBottom: boolean;
149
+ };
150
+ }>, {
151
+ /** 初始化横向纵向虚拟滚动 */
152
+ initVirtualScroll: (height?: number | undefined) => void;
153
+ /** 初始化横向虚拟滚动 */
154
+ initVirtualScrollX: () => void;
155
+ /** 初始化纵向虚拟滚动 */
156
+ initVirtualScrollY: (height?: number | undefined) => void;
157
+ /** 设置当前选中行 */
158
+ setCurrentRow: typeof setCurrentRow;
159
+ /** 设置高亮渐暗单元格 */
160
+ setHighlightDimCell: (rowKeyValue: string, dataIndex: string) => void;
161
+ /** 设置高亮渐暗行 */
162
+ setHighlightDimRow: (rowKeyValues: (string | number)[]) => void;
163
+ /** 表格排序列dataIndex */
164
+ sortCol: import("vue").Ref<string | null | undefined>;
165
+ /** 获取当前排序状态 */
166
+ getSortColumns: typeof getSortColumns;
167
+ /** 设置排序 */
168
+ setSorter: typeof setSorter;
169
+ /** 重置排序 */
170
+ resetSorter: typeof resetSorter;
171
+ /** 滚动至 */
172
+ scrollTo: typeof scrollTo;
173
+ /** 获取表格数据 */
174
+ getTableData: typeof getTableData;
175
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
176
+ "sort-change": (col: StkTableColumn<any>, order: Order, data: any[], sortConfig: SortConfig) => void;
177
+ "row-click": (ev: MouseEvent, row: any) => void;
178
+ "current-change": (ev: MouseEvent | null, row: any) => void;
179
+ "row-dblclick": (ev: MouseEvent, row: any) => void;
180
+ "header-row-menu": (ev: MouseEvent) => void;
181
+ "row-menu": (ev: MouseEvent, row: any) => void;
182
+ "cell-click": (ev: MouseEvent, row: any, col: StkTableColumn<any>) => void;
183
+ "header-cell-click": (ev: MouseEvent, col: StkTableColumn<any>) => void;
184
+ scroll: (ev: Event, data: {
185
+ startIndex: number;
186
+ endIndex: number;
187
+ }) => void;
188
+ "scroll-x": (ev: Event) => void;
189
+ "col-order-change": (dragStartKey: string, targetColKey: string) => void;
190
+ "th-drag-start": (dragStartKey: string) => void;
191
+ "th-drop": (targetColKey: string) => void;
192
+ "update:columns": (cols: StkTableColumn<any>[]) => void;
193
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
194
+ width?: string | undefined;
195
+ /** 最小表格宽度 */
196
+ minWidth?: string | undefined;
197
+ /** 表格最大宽度*/
198
+ maxWidth?: string | undefined;
199
+ /** 斑马线条纹 */
200
+ stripe?: boolean | undefined;
201
+ /** 是否使用 table-layout:fixed */
202
+ fixedMode?: boolean | undefined;
203
+ /** 是否隐藏表头 */
204
+ headless?: boolean | undefined;
205
+ /** 主题,亮、暗 */
206
+ theme?: "light" | "dark" | undefined;
207
+ /** 行高 */
208
+ rowHeight?: number | undefined;
209
+ /** 表头行高。default = rowHeight */
210
+ headerRowHeight?: number | null | undefined;
211
+ /** 虚拟滚动 */
212
+ virtual?: boolean | undefined;
213
+ /** x轴虚拟滚动 */
214
+ virtualX?: boolean | undefined;
215
+ /** 表格列配置 */
216
+ columns?: StkTableColumn<any>[] | undefined;
217
+ /** 表格数据源 */
218
+ dataSource?: any[] | undefined;
219
+ /** 行唯一键 */
220
+ rowKey?: UniqKey | undefined;
221
+ /** 列唯一键 */
222
+ colKey?: UniqKey | undefined;
223
+ /** 空值展示文字 */
224
+ emptyCellText?: string | undefined;
225
+ /** 暂无数据兜底高度是否撑满 */
226
+ noDataFull?: boolean | undefined;
227
+ /** 是否展示暂无数据 */
228
+ showNoData?: boolean | undefined;
229
+ /** 是否服务端排序,true则不排序数据 */
230
+ sortRemote?: boolean | undefined;
231
+ /** 表头是否溢出展示... */
232
+ showHeaderOverflow?: boolean | undefined;
233
+ /** 表体溢出是否展示... */
234
+ showOverflow?: boolean | undefined;
235
+ /** 是否增加行hover class */
236
+ showTrHoverClass?: boolean | undefined;
237
+ /** 表头是否可拖动。支持回调函数。 */
238
+ headerDrag?: boolean | ((col: StkTableColumn<any>) => boolean) | undefined;
239
+ /**
240
+ * 给行附加className<br>
241
+ * FIXME: 是否需要优化,因为不传此prop会使表格行一直执行空函数,是否有影响
242
+ */
243
+ rowClassName?: ((row: any, i: number) => string) | undefined;
244
+ /**
245
+ * 列宽是否可拖动<br>
246
+ * **不要设置**列minWidth,**必须**设置width<br>
247
+ * 列宽拖动时,每一列都必须要有width,且minWidth/maxWidth不生效。table width会变为"fit-content"。
248
+ */
249
+ colResizable?: boolean | undefined;
250
+ /** 可拖动至最小的列宽 */
251
+ colMinWidth?: number | undefined;
252
+ /**
253
+ * 单元格分割线。
254
+ * 默认横竖都有
255
+ * "h" - 仅展示横线
256
+ * "v" - 仅展示竖线
257
+ * "body-v" - 仅表体展示竖线
258
+ */
259
+ bordered?: boolean | "h" | "v" | "body-v" | undefined;
260
+ /**
261
+ * 自动重新计算虚拟滚动高度宽度。默认true
262
+ * [非响应式]
263
+ * 传入方法表示resize后的回调
264
+ */
265
+ autoResize?: boolean | (() => void) | undefined;
266
+ /** 是否展示固定列阴影。默认不展示。 */
267
+ fixedColShadow?: boolean | undefined;
268
+ /** 优化vue2 滚动 */
269
+ optimizeVue2Scroll?: boolean | undefined;
270
+ /** 排序配置 */
271
+ sortConfig?: SortConfig | undefined;
272
+ }>, {
273
+ width: string;
274
+ fixedMode: boolean;
275
+ stripe: boolean;
276
+ minWidth: string;
277
+ maxWidth: string;
278
+ headless: boolean;
279
+ theme: string;
280
+ rowHeight: number;
281
+ headerRowHeight: null;
282
+ virtual: boolean;
283
+ virtualX: boolean;
284
+ columns: () => never[];
285
+ dataSource: () => never[];
286
+ rowKey: string;
287
+ colKey: string;
288
+ emptyCellText: string;
289
+ noDataFull: boolean;
290
+ showNoData: boolean;
291
+ sortRemote: boolean;
292
+ showHeaderOverflow: boolean;
293
+ showOverflow: boolean;
294
+ showTrHoverClass: boolean;
295
+ headerDrag: boolean;
296
+ rowClassName: () => "";
297
+ colResizable: boolean;
298
+ colMinWidth: number;
299
+ bordered: boolean;
300
+ autoResize: boolean;
301
+ fixedColShadow: boolean;
302
+ optimizeVue2Scroll: boolean;
303
+ sortConfig: () => {
304
+ emptyToBottom: boolean;
305
+ };
306
+ }>>> & {
307
+ onScroll?: ((ev: Event, data: {
308
+ startIndex: number;
309
+ endIndex: number;
310
+ }) => any) | undefined;
311
+ "onUpdate:columns"?: ((cols: StkTableColumn<any>[]) => any) | undefined;
312
+ "onTh-drag-start"?: ((dragStartKey: string) => any) | undefined;
313
+ "onCol-order-change"?: ((dragStartKey: string, targetColKey: string) => any) | undefined;
314
+ "onTh-drop"?: ((targetColKey: string) => any) | undefined;
315
+ "onSort-change"?: ((col: StkTableColumn<any>, order: Order, data: any[], sortConfig: SortConfig) => any) | undefined;
316
+ "onRow-click"?: ((ev: MouseEvent, row: any) => any) | undefined;
317
+ "onCurrent-change"?: ((ev: MouseEvent | null, row: any) => any) | undefined;
318
+ "onRow-dblclick"?: ((ev: MouseEvent, row: any) => any) | undefined;
319
+ "onHeader-row-menu"?: ((ev: MouseEvent) => any) | undefined;
320
+ "onRow-menu"?: ((ev: MouseEvent, row: any) => any) | undefined;
321
+ "onCell-click"?: ((ev: MouseEvent, row: any, col: StkTableColumn<any>) => any) | undefined;
322
+ "onHeader-cell-click"?: ((ev: MouseEvent, col: StkTableColumn<any>) => any) | undefined;
323
+ "onScroll-x"?: ((ev: Event) => any) | undefined;
324
+ }, {
325
+ width: string;
326
+ minWidth: string;
327
+ maxWidth: string;
328
+ rowHeight: number;
329
+ headless: boolean;
330
+ headerRowHeight: number | null;
331
+ stripe: boolean;
332
+ fixedMode: boolean;
333
+ theme: "light" | "dark";
334
+ virtual: boolean;
335
+ virtualX: boolean;
336
+ columns: StkTableColumn<any>[];
337
+ dataSource: any[];
338
+ rowKey: UniqKey;
339
+ colKey: UniqKey;
340
+ emptyCellText: string;
341
+ noDataFull: boolean;
342
+ showNoData: boolean;
343
+ sortRemote: boolean;
344
+ showHeaderOverflow: boolean;
345
+ showOverflow: boolean;
346
+ showTrHoverClass: boolean;
347
+ headerDrag: boolean | ((col: StkTableColumn<any>) => boolean);
348
+ rowClassName: (row: any, i: number) => string;
349
+ colResizable: boolean;
350
+ colMinWidth: number;
351
+ bordered: boolean | "h" | "v" | "body-v";
352
+ autoResize: boolean | (() => void);
353
+ fixedColShadow: boolean;
354
+ optimizeVue2Scroll: boolean;
355
+ sortConfig: SortConfig;
356
+ }, {}>, {
357
+ tableHeader?(_: {
358
+ col: StkTableColumn<any>;
359
+ }): any;
360
+ empty?(_: {}): any;
361
+ }>;
362
+ export default _default;
363
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
364
+ type __VLS_TypePropsToRuntimeProps<T> = {
365
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
366
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
367
+ } : {
368
+ type: import('vue').PropType<T[K]>;
369
+ required: true;
370
+ };
371
+ };
372
+ type __VLS_WithDefaults<P, D> = {
373
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
374
+ default: D[K];
375
+ }> : P[K];
376
+ };
377
+ type __VLS_Prettify<T> = {
378
+ [K in keyof T]: T[K];
379
+ } & {};
380
+ type __VLS_WithTemplateSlots<T, S> = T & {
381
+ new (): {
382
+ $slots: S;
383
+ };
384
+ };