@aimerthyr/virtual-table 1.1.1 → 1.3.0

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/dist/index.d.ts CHANGED
@@ -187,6 +187,20 @@ export declare const vTableDefaultProps: {
187
187
  customRowAttributes?: ((row: any, rowIndex: number) => HTMLAttributes) | ((props: VTableProps<any>) => (row: any, rowIndex: number) => HTMLAttributes) | undefined;
188
188
  customHeaderCellAttributes?: ((column: VTableColumn, colIndex: number) => ThHTMLAttributes) | ((props: VTableProps<any>) => (column: VTableColumn, colIndex: number) => ThHTMLAttributes) | undefined;
189
189
  customCellAttributes?: ((row: any, column: VTableColumn, rowIndex: number, colIndex: number) => TdHTMLAttributes | null) | ((props: VTableProps<any>) => (row: any, column: VTableColumn, rowIndex: number, colIndex: number) => TdHTMLAttributes | null) | undefined;
190
+ defaultFilter?: ((props: VTableProps<any>) => ColumnFiltersState) | undefined;
191
+ defaultSort?: ((props: VTableProps<any>) => SortingState) | undefined;
192
+ defaultPagination?: ((props: VTableProps<any>) => PaginationState) | undefined;
193
+ defaultExpanded?: true | ((props: VTableProps<any>) => true | Record<string, boolean>) | undefined;
194
+ defaultSelection?: ((props: VTableProps<any>) => RowSelectionState) | undefined;
195
+ defaultColumnPinning?: ((props: VTableProps<any>) => ColumnPinningState) | undefined;
196
+ defaultColumnSizing?: ((props: VTableProps<any>) => ColumnSizingState) | undefined;
197
+ 'onUpdate:defaultFilter'?: ((filter: VTableColumnFiltersState) => void) | ((props: VTableProps<any>) => (filter: VTableColumnFiltersState) => void) | undefined;
198
+ 'onUpdate:defaultSort'?: ((sort: VTableSortingState) => void) | ((props: VTableProps<any>) => (sort: VTableSortingState) => void) | undefined;
199
+ 'onUpdate:defaultPagination'?: ((pagination: VTablePaginationState) => void) | ((props: VTableProps<any>) => (pagination: VTablePaginationState) => void) | undefined;
200
+ 'onUpdate:defaultExpanded'?: ((expanded: VTableExpandedState) => void) | ((props: VTableProps<any>) => (expanded: VTableExpandedState) => void) | undefined;
201
+ 'onUpdate:defaultSelection'?: ((selection: VTableSelectionState) => void) | ((props: VTableProps<any>) => (selection: VTableSelectionState) => void) | undefined;
202
+ 'onUpdate:defaultColumnPinning'?: ((columnPinning: VTableColumnPinningState) => void) | ((props: VTableProps<any>) => (columnPinning: VTableColumnPinningState) => void) | undefined;
203
+ 'onUpdate:defaultColumnSizing'?: ((columnSizing: VTableColumnSizingState) => void) | ((props: VTableProps<any>) => (columnSizing: VTableColumnSizingState) => void) | undefined;
190
204
  onTableChange?: ((data: VTableChangeState) => void) | ((props: VTableProps<any>) => (data: VTableChangeState) => void) | undefined;
191
205
  onScrollToBottom?: (() => void) | ((props: VTableProps<any>) => () => void) | undefined;
192
206
  onExpandedRowsChange?: ((expandState: VTableExpandedState) => void) | ((props: VTableProps<any>) => (expandState: VTableExpandedState) => void) | undefined;
@@ -243,7 +257,10 @@ export declare interface VTablePaginationConfig {
243
257
  /** 服务端分页还是前端分页 */
244
258
  mode?: 'client' | 'server';
245
259
  /** 分页器额外属性(如果你自己定义了分页器组件,则用于回传给你自己定义的组件) */
246
- paginationExtraProps?: Record<string, any>;
260
+ paginationExtraProps?: VTablePaginationExtraProps;
261
+ }
262
+
263
+ export declare interface VTablePaginationExtraProps {
247
264
  }
248
265
 
249
266
  /**
@@ -272,9 +289,9 @@ export declare interface VTablePopoverProps {
272
289
  /** 显示状态变化回调 */
273
290
  onOpenChange: (value: boolean) => void;
274
291
  /** 触发区域 */
275
- trigger: () => VNode_2;
292
+ trigger: () => VNode_2[];
276
293
  /** 下拉内容 */
277
- content: () => VNode_2;
294
+ content: () => VNode_2[];
278
295
  }
279
296
 
280
297
  /** props 类型定义 */
@@ -330,6 +347,27 @@ export declare interface VTableProps<TData = any> {
330
347
  * 当返回的属性中 colspan 或 rowspan 为 0 时,该单元格不会被渲染
331
348
  */
332
349
  customCellAttributes?: (row: TData, column: VTableColumn, rowIndex: number, colIndex: number) => TdHTMLAttributes | null;
350
+ /** 默认筛选状态 */
351
+ defaultFilter?: VTableColumnFiltersState;
352
+ /** 默认排序状态 */
353
+ defaultSort?: VTableSortingState;
354
+ /** 默认分页状态 */
355
+ defaultPagination?: VTablePaginationState;
356
+ /** 默认展开状态 */
357
+ defaultExpanded?: VTableExpandedState;
358
+ /** 默认选择状态 */
359
+ defaultSelection?: VTableSelectionState;
360
+ /** 默认列固定状态 */
361
+ defaultColumnPinning?: VTableColumnPinningState;
362
+ /** 默认列宽调整状态 */
363
+ defaultColumnSizing?: VTableColumnSizingState;
364
+ 'onUpdate:defaultFilter'?: (filter: VTableColumnFiltersState) => void;
365
+ 'onUpdate:defaultSort'?: (sort: VTableSortingState) => void;
366
+ 'onUpdate:defaultPagination'?: (pagination: VTablePaginationState) => void;
367
+ 'onUpdate:defaultExpanded'?: (expanded: VTableExpandedState) => void;
368
+ 'onUpdate:defaultSelection'?: (selection: VTableSelectionState) => void;
369
+ 'onUpdate:defaultColumnPinning'?: (columnPinning: VTableColumnPinningState) => void;
370
+ 'onUpdate:defaultColumnSizing'?: (columnSizing: VTableColumnSizingState) => void;
333
371
  /** 表格状态变化(筛选,排序,分页) */
334
372
  onTableChange?: (data: VTableChangeState) => void;
335
373
  /** 滚动到表格底部 */
@@ -360,20 +398,20 @@ export declare interface VTableSlots<TData = any> {
360
398
  customHeader?: (props: {
361
399
  columns: VTableColumn[];
362
400
  table: Table<TData>;
363
- }) => VNode_2;
401
+ }) => VNode_2[];
364
402
  /** 自定义单元格 */
365
- bodyCell?: (props: VTableBodyCellProps<TData>) => VNode_2;
403
+ bodyCell?: (props: VTableBodyCellProps<TData>) => VNode_2[];
366
404
  /** 自定义列头 */
367
405
  headerCell?: (props: {
368
406
  columnKey: string;
369
407
  column: VTableColumn;
370
- }) => VNode_2;
408
+ }) => VNode_2[];
371
409
  /** 自定义筛选图标 */
372
410
  customFilterIcon?: (props: {
373
411
  columnKey: string;
374
412
  filtered: boolean;
375
413
  column: VTableColumn;
376
- }) => VNode_2;
414
+ }) => VNode_2[];
377
415
  /** 自定义筛选下拉 */
378
416
  customFilterDropdown?: (props: {
379
417
  confirm: () => void;
@@ -381,30 +419,30 @@ export declare interface VTableSlots<TData = any> {
381
419
  setFilterValue: (value: any) => void;
382
420
  column: VTableColumn;
383
421
  filterModelValue: any;
384
- }) => VNode_2;
422
+ }) => VNode_2[];
385
423
  /** 自定义展开行 */
386
424
  expandedRowRender?: (props: {
387
425
  row: TData;
388
- }) => VNode_2;
426
+ }) => VNode_2[];
389
427
  /** 自定义 Popover */
390
- customPopover?: (props: VTablePopoverProps) => VNode_2;
428
+ customPopover?: (props: VTablePopoverProps) => VNode_2[];
391
429
  /** 自定义分页器 */
392
- customPagination?: (props: VTablePaginationProps) => VNode_2;
430
+ customPagination?: (props: VTablePaginationProps) => VNode_2[];
393
431
  /** 自定义 checkbox */
394
- customCheckbox?: (props: VTableCheckboxProps) => VNode_2;
432
+ customCheckbox?: (props: VTableCheckboxProps) => VNode_2[];
395
433
  /** 自定义空状态 */
396
- customEmpty?: () => VNode_2;
434
+ customEmpty?: () => VNode_2[];
397
435
  /** 自定义 loading 图标 */
398
- customLoadingIcon?: () => VNode_2;
436
+ customLoadingIcon?: () => VNode_2[];
399
437
  /** 自定义加载没有更多区域 */
400
- customLoadNoMore?: () => VNode_2;
438
+ customLoadNoMore?: () => VNode_2[];
401
439
  /** 自定义表尾 */
402
- customFooter?: () => VNode_2;
440
+ customFooter?: () => VNode_2[];
403
441
  /** 自定义展开图标 */
404
- customExpandIcon?: (props: VTableExpandIconProps) => VNode_2;
442
+ customExpandIcon?: (props: VTableExpandIconProps) => VNode_2[];
405
443
  /** 自定义组件图标 */
406
- customSorterIcon?: (props: VTableSorterIconProps) => VNode_2;
407
- [key: string]: ((...args: any[]) => VNode_2) | undefined;
444
+ customSorterIcon?: (props: VTableSorterIconProps) => VNode_2[];
445
+ [key: string]: ((...args: any[]) => VNode_2[]) | undefined;
408
446
  }
409
447
 
410
448
  /** 排序图标自定义组件接口定义 */