@aimerthyr/virtual-table 1.4.1 → 1.4.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.
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/virtual-table.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ export declare interface VTableColumn<TData = any> {
|
|
|
149
149
|
columnMinWidth?: number;
|
|
150
150
|
/** 子列(用于表头分组) */
|
|
151
151
|
columnChildren?: VTableColumn<TData>[];
|
|
152
|
+
/** 汇总计算方式 (sum 汇总 agv 平均值 count 统计 max 最大值 min 最小值) */
|
|
153
|
+
columnSummary?: VTableSummaryType<TData>;
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
/** 筛选状态 */
|
|
@@ -181,6 +183,7 @@ export declare const vTableDefaultProps: {
|
|
|
181
183
|
loadMoreConfig?: ((props: VTableProps<any>) => VTableLoadMoreConfig) | undefined;
|
|
182
184
|
paginationConfig?: ((props: VTableProps<any>) => VTablePaginationConfig) | undefined;
|
|
183
185
|
treeConfig?: ((props: VTableProps<any>) => VTableTreeConfig) | undefined;
|
|
186
|
+
summaryConfig?: ((props: VTableProps<any>) => VTableSummaryConfig<any>) | undefined;
|
|
184
187
|
enableExpandRow?: boolean | ((props: VTableProps<any>) => boolean) | undefined;
|
|
185
188
|
enableRowHover?: boolean | ((props: VTableProps<any>) => boolean) | undefined;
|
|
186
189
|
adaptiveColumnWidth?: number | ((props: VTableProps<any>) => number) | undefined;
|
|
@@ -342,6 +345,8 @@ export declare interface VTableProps<TData = any> {
|
|
|
342
345
|
paginationConfig?: VTablePaginationConfig;
|
|
343
346
|
/** 树形结构配置 */
|
|
344
347
|
treeConfig?: VTableTreeConfig;
|
|
348
|
+
/** 汇总行配置 */
|
|
349
|
+
summaryConfig?: VTableSummaryConfig<TData>;
|
|
345
350
|
/** 是否启用展开行功能 */
|
|
346
351
|
enableExpandRow?: boolean;
|
|
347
352
|
/** 是否启用行 hover 高亮 */
|
|
@@ -468,6 +473,12 @@ export declare interface VTableSlots<TData = any> {
|
|
|
468
473
|
customExpandIcon?: (props: VTableExpandIconProps) => VNode_2[];
|
|
469
474
|
/** 自定义排序图标 */
|
|
470
475
|
customSorterIcon?: (props: VTableSorterIconProps) => VNode_2[];
|
|
476
|
+
/** 自定义汇总单元格 */
|
|
477
|
+
summaryCell?: (props: {
|
|
478
|
+
columnKey: string;
|
|
479
|
+
column: VTableColumn;
|
|
480
|
+
summaryValue: any;
|
|
481
|
+
}) => VNode_2[];
|
|
471
482
|
[key: string]: ((...args: any[]) => VNode_2[]) | undefined;
|
|
472
483
|
}
|
|
473
484
|
|
|
@@ -479,6 +490,21 @@ export declare interface VTableSorterIconProps {
|
|
|
479
490
|
/** 排序状态 */
|
|
480
491
|
export declare type VTableSortingState = SortingState;
|
|
481
492
|
|
|
493
|
+
/** 汇总配置 */
|
|
494
|
+
export declare interface VTableSummaryConfig<TData = any> {
|
|
495
|
+
/** 是否显示汇总行 */
|
|
496
|
+
enabled?: boolean;
|
|
497
|
+
/** 汇总行固定(不随表格滚动) */
|
|
498
|
+
fixed?: boolean;
|
|
499
|
+
/** 自定义汇总计算函数(优先级高于列配置) */
|
|
500
|
+
customSummary?: (column: VTableColumn, data: TData[]) => any;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export declare type VTableSummaryFn<TData = any> = (data: TData[], column: VTableColumn) => any;
|
|
504
|
+
|
|
505
|
+
/** 汇总类型 */
|
|
506
|
+
export declare type VTableSummaryType<TData> = 'sum' | 'avg' | 'count' | 'max' | 'min' | VTableSummaryFn<TData>;
|
|
507
|
+
|
|
482
508
|
/** 表格主题配置 */
|
|
483
509
|
export declare interface VTableThemeConfig {
|
|
484
510
|
/** 主色 */
|