@aimerthyr/virtual-table 1.3.4 → 1.4.1
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.
- package/CHANGELOG.md +15 -0
- package/README.en.md +14 -0
- package/README.md +19 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -0
- package/dist/virtual-table.css +1 -1
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,12 @@ export declare interface VTableBodyCellProps<TData = any> {
|
|
|
69
69
|
column: VTableColumn;
|
|
70
70
|
row: TData;
|
|
71
71
|
rowIndex: number;
|
|
72
|
+
/** 编辑模式
|
|
73
|
+
* row => 整行编辑
|
|
74
|
+
* cell => 单元格编辑
|
|
75
|
+
* null => 未处于编辑态
|
|
76
|
+
* */
|
|
77
|
+
isEditingMode: 'row' | 'cell' | null;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
/** 表体样式配置 */
|
|
@@ -206,6 +212,7 @@ export declare const vTableDefaultProps: {
|
|
|
206
212
|
onScrollToBottom?: (() => void) | ((props: VTableProps<any>) => () => void) | undefined;
|
|
207
213
|
onExpandedRowsChange?: ((expandState: VTableExpandedState) => void) | ((props: VTableProps<any>) => (expandState: VTableExpandedState) => void) | undefined;
|
|
208
214
|
onColumnSizingChange?: ((columnSizing: VTableColumnSizingState) => void) | ((props: VTableProps<any>) => (columnSizing: VTableColumnSizingState) => void) | undefined;
|
|
215
|
+
onExpand?: ((expanded: boolean, row: any) => void) | ((props: VTableProps<any>) => (expanded: boolean, row: any) => void) | undefined;
|
|
209
216
|
};
|
|
210
217
|
|
|
211
218
|
/** 展开状态 */
|
|
@@ -239,6 +246,12 @@ export declare interface VTableInstance<TData = any> {
|
|
|
239
246
|
tanstackTable: Table<TData>;
|
|
240
247
|
/** 滚动到指定下标(从 0 开始,默认是平滑滚动) */
|
|
241
248
|
scrollToIndex: (index: number, behavior?: 'auto' | 'smooth') => void;
|
|
249
|
+
/** 设置编辑状态
|
|
250
|
+
* 1. columnKey 为空,则为行编辑
|
|
251
|
+
* 2. columnKey 不为空,则为单元格编辑
|
|
252
|
+
* 3. rowId 传 null,清除编辑状态
|
|
253
|
+
*/
|
|
254
|
+
setEditingState: (rowId: string | number | null, columnKey?: string | null) => void;
|
|
242
255
|
}
|
|
243
256
|
|
|
244
257
|
export declare interface VTableLoadMoreConfig {
|
|
@@ -262,6 +275,14 @@ export declare interface VTablePaginationConfig {
|
|
|
262
275
|
}
|
|
263
276
|
|
|
264
277
|
export declare interface VTablePaginationExtraProps {
|
|
278
|
+
/** 是否显示总计 */
|
|
279
|
+
showTotal?: boolean;
|
|
280
|
+
/** 是否显示每页条数选择器 */
|
|
281
|
+
showSizeChanger?: boolean;
|
|
282
|
+
/** 总计文本 */
|
|
283
|
+
totalText?: string;
|
|
284
|
+
/** 每页条数选择器文本 */
|
|
285
|
+
pageSizeText?: string;
|
|
265
286
|
}
|
|
266
287
|
|
|
267
288
|
/**
|
|
@@ -379,6 +400,8 @@ export declare interface VTableProps<TData = any> {
|
|
|
379
400
|
onExpandedRowsChange?: (expandState: VTableExpandedState) => void;
|
|
380
401
|
/** 列宽调整回调 */
|
|
381
402
|
onColumnSizingChange?: (columnSizing: VTableColumnSizingState) => void;
|
|
403
|
+
/** 点击展开图标回调 */
|
|
404
|
+
onExpand?: (expanded: boolean, row: TData) => void;
|
|
382
405
|
}
|
|
383
406
|
|
|
384
407
|
export declare type VTableRowKey<TData> = string | number | ((row: TData) => string | number);
|