Skip to content

Commit

Permalink
feat: 增强行列冻结能力 (#2706)
Browse files Browse the repository at this point in the history
* refactor: 将 frozen groups 收敛到 frozen facet 中

* refactor: 移除 frozen cell 相关的特殊坐标计算,统一采用 translate 做偏移处理

* refactor: 简化 table-col 冻结处理

* feat: 增加透视表对 trailingRow 冻结的支持

* feat: 完善 splitLine 逻辑

* feat: 处理行头列头滚动布局和 resize 布局

* feat: 处理明细表 data cell resize 绘制

* feat: 更新 playground

* test: 单测修复

* fix:  修复列头 resize 布局偏移问题

* test: 单测修复

* fix: 修复方向键移动选中逻辑

* test: 单测修复

* test: data brush selection 单测修复

* fix: 调整明细表 rowOffsets 计算时机

* style: 修复 lint 问题

* docs: 文档更新

* feat: 更新 playground

* test: 单测 snapshot 更新

* Update s2-site/examples/layout/frozen/demo/frozen-pivot-tree.ts

Co-authored-by: Jinke Li <[email protected]>

* refactor: 重命名 frozen 变量名

* refactor: 将 calculateRowOffsets 替换为抽象方法

* refactor: 添加方法注释

* chore: 合并 next 代码

* refactor: row-cell 抽取工具函数

* test: 增加透视表行冻结单测

* fix: 在 resize 时加上 preventDefault 事件,兼容 chrome 125 事件更新的处理 (#2739)

* refactor: 移除对 frozen options 从 top 到 leaf 的转换

* feat: 增加透视表列头冻结能力

* feat: 增加透视表序号列冻结的能力

* fix: 修复 centerFrame line shadow 显示问题

* fix: 修复类型问题

* refactor: series number cell 继承自 row cell

* fix: 修复 lint 问题

* test: 单测修复

* test: 增加透视表列头冻结单测

* docs: 冻结文档更新

* test: snapshot 更新

* fix: s2Options 冻结类型更新

* refactor: rename S2TableSheetFrozenOptions to S2BaseFrozenOptions

---------

Co-authored-by: Jinke Li <[email protected]>
  • Loading branch information
wjgogogo and lijinke666 authored Jun 3, 2024
1 parent c54ca82 commit e72d053
Show file tree
Hide file tree
Showing 71 changed files with 3,180 additions and 1,677 deletions.
4 changes: 2 additions & 2 deletions packages/s2-core/__tests__/bugs/issue-2684-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { InteractionStateName } from '../../src';
import { getSelectedData } from '../../src/utils/export/copy';
import * as mockDataConfig from '../data/data-issue-2684.json';
import { createPivotSheet } from '../util/helpers';
import type { S2Options, SpreadSheet } from '@/index';
import type { CellMeta, S2Options, SpreadSheet } from '@/index';

const s2Options: S2Options = {
width: 600,
Expand Down Expand Up @@ -48,7 +48,7 @@ describe('PivotSheet Special Dimension Values Copy Tests', () => {
: String(rowLeafNodes[meta.rowIndex].id);

return { ...meta, colId, rowId };
});
}) as unknown as CellMeta[];

s2.interaction.changeState({
cells,
Expand Down
4 changes: 4 additions & 0 deletions packages/s2-core/__tests__/bugs/issue-2707-spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/**
* 明细表数据含有空值导致排序失效
* @description spec for issue 2707
Expand Down Expand Up @@ -29,6 +30,7 @@ describe('PivotSheet Special Dimension Values Copy Tests', () => {
});
await s2.render();

// @ts-ignore
expect(s2.dataSet.displayData).toMatchSnapshot();
});

Expand All @@ -38,6 +40,7 @@ describe('PivotSheet Special Dimension Values Copy Tests', () => {
});
await s2.render();

// @ts-ignore
expect(s2.dataSet.displayData).toMatchSnapshot();
});

Expand All @@ -59,6 +62,7 @@ describe('PivotSheet Special Dimension Values Copy Tests', () => {
});
await s2.render();

// @ts-ignore
expect(s2.dataSet.displayData).toMatchSnapshot();
});
});
Loading

0 comments on commit e72d053

Please sign in to comment.