File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ function getGroupAttribute(props: AvatarProps) {
100100 height : size ,
101101 clip : true ,
102102 cornerRadius : shape === 'circle' ? size / 2 : panelStyle . cornerRadius ?? 2 ,
103- cornerType : 'round' , // 添加必需的 cornerType 属性
104103 display : 'flex' ,
105104 alignItems : 'center' ,
106105 justifyContent : 'center' ,
Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ import { ListTableSimple as ListTableConstrouctor } from '@visactor/vtable';
44import type { BaseTableProps } from './base-table' ;
55import { createTable } from './base-table' ;
66
7- export interface ListTableProps
8- extends Omit < BaseTableProps , 'records' | 'columnWidthConfig' | 'columns' | 'dragOrder' | 'resize' > ,
9- Omit < ListTableConstructorOptions , 'container' > { }
7+ // 类型覆盖工具:让 ListTableConstructorOptions 中的属性覆盖 BaseTableProps 中的同名属性
8+ type Override < T , U > = Omit < T , keyof U > & U ;
9+
10+ export type ListTableProps = Override <
11+ Omit < BaseTableProps , 'records' | 'container' > ,
12+ Omit < ListTableConstructorOptions , 'container' >
13+ > ;
1014
1115export const ListTableSimple = createTable < React . PropsWithChildren < ListTableProps > > ( 'ListTable' , {
1216 type : 'list-table' ,
Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ import { ListTable as ListTableConstrouctor } from '@visactor/vtable';
44import type { BaseTableProps } from './base-table' ;
55import { createTable } from './base-table' ;
66
7- export interface ListTableProps
8- extends Omit < BaseTableProps , 'records' | 'columnWidthConfig' | 'columns' | 'dragOrder' | 'resize' > ,
9- Omit < ListTableConstructorOptions , 'container' > { }
7+ // 类型覆盖工具:让 ListTableConstructorOptions 中的属性覆盖 BaseTableProps 中的同名属性
8+ type Override < T , U > = Omit < T , keyof U > & U ;
9+
10+ export type ListTableProps = Override <
11+ Omit < BaseTableProps , 'records' | 'container' > ,
12+ Omit < ListTableConstructorOptions , 'container' >
13+ > ;
1014
1115export const ListTable = createTable < React . PropsWithChildren < ListTableProps > > ( 'ListTable' , {
1216 type : 'list-table' ,
Original file line number Diff line number Diff line change 11import type React from 'react' ;
2- import { register } from '@visactor/vtable' ;
3- import type { PivotChartConstructorOptions } from '@visactor/vtable' ;
4- import { PivotChart as PivotChartConstrouctor } from '@visactor/vtable' ;
2+ import { register , PivotChart as PivotChartConstrouctor , type PivotChartConstructorOptions } from '@visactor/vtable' ;
53import type { BaseTableProps } from './base-table' ;
64import { createTable } from './base-table' ;
75
6+ // 类型覆盖工具:让 PivotChartConstructorOptions 中的属性覆盖 BaseTableProps 中的同名属性
7+ type Override < T , U > = Omit < T , keyof U > & U ;
8+
89interface AnyRecords {
910 records : Record < string , unknown > [ ] ;
1011}
11- export interface PivotChartProps
12- extends Omit < BaseTableProps , 'records' | 'columnWidthConfig' | 'columns' | 'dragOrder' | 'resize' > ,
13- Omit < PivotChartConstructorOptions , 'container' | 'records' > ,
14- AnyRecords { }
12+
13+ export type PivotChartProps = Override <
14+ Omit < BaseTableProps , 'records' | 'container' > ,
15+ Omit < PivotChartConstructorOptions , 'container' | 'records' >
16+ > &
17+ AnyRecords ;
1518
1619export const PivotChart = createTable < React . PropsWithChildren < PivotChartProps > > ( 'PivotChart' , {
1720 type : 'pivot-chart' ,
Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ import { PivotTableSimple as PivotTableConstrouctor } from '@visactor/vtable';
44import type { BaseTableProps } from './base-table' ;
55import { createTable } from './base-table' ;
66
7- export interface PivotTableProps
8- extends Omit < BaseTableProps , 'records' | 'columnWidthConfig' | 'columns' | 'dragOrder' | 'resize' > ,
9- Omit < PivotTableConstructorOptions , 'container' > { }
7+ // 类型覆盖工具:让 PivotTableConstructorOptions 中的属性覆盖 BaseTableProps 中的同名属性
8+ type Override < T , U > = Omit < T , keyof U > & U ;
9+
10+ export type PivotTableProps = Override <
11+ Omit < BaseTableProps , 'records' | 'container' > ,
12+ Omit < PivotTableConstructorOptions , 'container' >
13+ > ;
1014
1115export const PivotTableSimple = createTable < React . PropsWithChildren < PivotTableProps > > ( 'PivotTable' , {
1216 type : 'pivot-table' ,
Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ import { PivotTable as PivotTableConstrouctor } from '@visactor/vtable';
44import type { BaseTableProps } from './base-table' ;
55import { createTable } from './base-table' ;
66
7- export interface PivotTableProps
8- extends Omit < BaseTableProps , 'records' | 'columnWidthConfig' | 'columns' | 'dragOrder' | 'resize' > ,
9- Omit < PivotTableConstructorOptions , 'container' > { }
7+ // 类型覆盖工具:让 PivotTableConstructorOptions 中的属性覆盖 BaseTableProps 中的同名属性
8+ type Override < T , U > = Omit < T , keyof U > & U ;
9+
10+ export type PivotTableProps = Override <
11+ Omit < BaseTableProps , 'records' | 'container' > ,
12+ Omit < PivotTableConstructorOptions , 'container' >
13+ > ;
1014
1115export const PivotTable = createTable < React . PropsWithChildren < PivotTableProps > > ( 'PivotTable' , {
1216 type : 'pivot-table' ,
Original file line number Diff line number Diff line change @@ -631,7 +631,6 @@ export class Gantt extends EventTarget {
631631 if ( record ) {
632632 return ( record . children ?. length || 1 ) * this . parsedOptions . rowHeight ;
633633 }
634- return this . parsedOptions . rowHeight ;
635634 } ;
636635 listTable_options . defaultRowHeight = 'auto' ;
637636 listTable_options . customConfig = { forceComputeAllRowHeight : true } ;
@@ -642,7 +641,6 @@ export class Gantt extends EventTarget {
642641 if ( record ) {
643642 return computeRowsCountByRecordDateForCompact ( this , record ) * this . parsedOptions . rowHeight ;
644643 }
645- return this . parsedOptions . rowHeight ;
646644 } ;
647645 listTable_options . defaultRowHeight = 'auto' ;
648646 listTable_options . customConfig = { forceComputeAllRowHeight : true } ;
@@ -653,7 +651,6 @@ export class Gantt extends EventTarget {
653651 if ( record ) {
654652 return computeRowsCountByRecordDate ( this , record ) * this . parsedOptions . rowHeight ;
655653 }
656- return this . parsedOptions . rowHeight ;
657654 } ;
658655 listTable_options . defaultRowHeight = 'auto' ;
659656 listTable_options . customConfig = { forceComputeAllRowHeight : true } ;
You can’t perform that action at this time.
0 commit comments