Skip to content

Commit

Permalink
fix: use headerStyle in transpose listable
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Feb 23, 2024
1 parent 5934140 commit 43450d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 16 additions & 5 deletions packages/vtable/src/core/BaseTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2986,6 +2986,16 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI {
this.options.autoWrapText
);
} else {
let defaultStyle;
if (layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)) {
defaultStyle = this.theme.headerStyle;
} else if (this.internalProps.transpose && layoutMap.isRowHeader(col, row)) {
defaultStyle = this.theme.headerStyle;
} else if (layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)) {
defaultStyle = this.theme.rowHeaderStyle;
} else {
defaultStyle = this.theme.cornerHeaderStyle;
}
// const styleClass = hd.headerType.StyleClass; //BaseHeader文件
// const { style } = hd;
const style = hd?.style || {};
Expand All @@ -2994,11 +3004,12 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI {
}
cacheStyle = <FullExtendStyle>headerStyleContents.of(
style,
layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)
? this.theme.headerStyle
: layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)
? this.theme.rowHeaderStyle
: this.theme.cornerHeaderStyle,
defaultStyle,
// layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)
// ? this.theme.headerStyle
// : layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)
// ? this.theme.rowHeaderStyle
// : this.theme.cornerHeaderStyle,
{
col,
row,
Expand Down
6 changes: 5 additions & 1 deletion packages/vtable/src/scenegraph/scenegraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,11 @@ export class Scenegraph {
);
createFrameBorder(
this.rowHeaderGroup,
this.isPivot ? this.table.theme.rowHeaderStyle.frameStyle : this.table.theme.bodyStyle.frameStyle,
this.isPivot
? this.table.theme.rowHeaderStyle.frameStyle
: this.table.internalProps.transpose
? this.table.theme.headerStyle.frameStyle
: this.table.theme.bodyStyle.frameStyle,
this.rowHeaderGroup.role,
isListTableWithFrozen ? [true, false, true, true] : undefined
);
Expand Down

0 comments on commit 43450d3

Please sign in to comment.