Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: seriesNumberHeader 不应该使用 custom row cell #2459

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/s2-core/src/facet/header/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// row'cell only show when visible
protected rowCellInRect(item: Node): boolean {
const { width, viewportHeight, seriesNumberWidth, scrollY, scrollX } =
this.headerConfig;

Check warning on line 40 in packages/s2-core/src/facet/header/row.ts

View check run for this annotation

Codecov / codecov/patch

packages/s2-core/src/facet/header/row.ts#L40

Added line #L40 was not covered by tests
return (
viewportHeight + scrollY > item.y && // bottom
scrollY < item.y + item.height && // top
Expand All @@ -52,11 +52,16 @@

protected getCellGroup(node: Node): IGroup {
return this;
}

Check warning on line 55 in packages/s2-core/src/facet/header/row.ts

View check run for this annotation

Codecov / codecov/patch

packages/s2-core/src/facet/header/row.ts#L55

Added line #L55 was not covered by tests

protected getCustomRowCell() {

Check warning on line 57 in packages/s2-core/src/facet/header/row.ts

View check run for this annotation

Codecov / codecov/patch

packages/s2-core/src/facet/header/row.ts#L57

Added line #L57 was not covered by tests
const { spreadsheet } = this.headerConfig;
return spreadsheet?.facet?.cfg?.rowCell;
}

Check warning on line 61 in packages/s2-core/src/facet/header/row.ts

View check run for this annotation

Codecov / codecov/patch

packages/s2-core/src/facet/header/row.ts#L60-L61

Added lines #L60 - L61 were not covered by tests
protected layout() {
const { data, spreadsheet } = this.headerConfig;
const rowCell = spreadsheet?.facet?.cfg?.rowCell;
const rowCell = this.getCustomRowCell();
each(data, (item: Node) => {
if (this.rowCellInRect(item) && item.height !== 0) {
let cell: S2CellType;
Expand Down
5 changes: 5 additions & 0 deletions packages/s2-core/src/facet/header/series-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class SeriesNumberHeader extends BaseFrozenRowHeader {
: node.height;
sNode.width = seriesNumberWidth;
sNode.rowIndex = node.rowIndex;
sNode.spreadsheet = spreadsheet;
sNode.isLeaf = true;
seriesNodes.push(sNode);
});
Expand Down Expand Up @@ -84,4 +85,8 @@ export class SeriesNumberHeader extends BaseFrozenRowHeader {
frozenRow,
);
}

protected override getCustomRowCell() {
return null;
}
}
Loading