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

chore: 合并 master 到 next 分支 #2034

Merged
merged 30 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4fcd8bf
docs: 修复错误 API 文档格式 (#1976)
lijinke666 Dec 8, 2022
528d2b6
fix: 修复 enableCopy 和 hideMeasureColumn 都开启为 true 时,复制报错问题 (#1984)
stone-lyl Dec 9, 2022
66c5ab9
feat: 暴露afterRealCellRender,这样能够更灵活的使用datacell (#1970)
wind108369 Dec 9, 2022
96ccb1e
feat: 实现树状模式下可复制 (#1986)
stone-lyl Dec 9, 2022
2a26259
feat: 适配链接跳转的判断方式 (#1983)
GaoFuhong Dec 9, 2022
37506f8
chore: 🤖 更新 changelog 文件 (#1989)
lijinke666 Dec 12, 2022
66bce2a
feat: 增加 linkFields 参数传入类型 (#1992)
GaoFuhong Dec 13, 2022
a8494a0
refactor: 优化智能反色功能 (#1974)
stone-lyl Dec 14, 2022
c1981f4
docs: 官网自定义目录树链接跳转 demo (#2001)
GaoFuhong Dec 16, 2022
6f13aa4
fix: gui icon 加载完成后,增加检测步骤,避免无意义的渲染 warning (#1997)
wjgogogo Dec 16, 2022
b1f1772
docs: 更新列分组demo配图 (#1998)
xingwanying Dec 16, 2022
8cf663b
docs: 修复自定义 schema 示例demo (#2000)
xingwanying Dec 16, 2022
457e5e7
feat: 添加字段标记中,定制柱状图的长度的功能 (filedValue) (#2002)
stone-lyl Dec 19, 2022
89f5c9e
fix: 明细表紧凑模式宽度计算错误 (#2006)
lcx-seima Dec 20, 2022
e42cb30
chore: 🤖 更新 changelog 文件 (#2005)
lijinke666 Dec 20, 2022
122552b
fix: 明细表linkField失效 (#2007)
lcx-seima Dec 20, 2022
57cd4c9
chore: 🤖 更新 changelog 文件 (#2008)
lijinke666 Dec 22, 2022
8d28254
feat: 子弹图为空时使用placeholder占位 (#2010)
lcx-seima Dec 22, 2022
ec62409
fix: 列头label存在数组,复制导出列头层级补齐错误 (#1990)
mmmml-zhao Dec 22, 2022
3e11a37
feat: selected cell highlight (#1878)
LHC8888 Dec 23, 2022
c95c446
fix: bullet占位符绘制错误 (#2022)
lcx-seima Dec 26, 2022
9f952fd
fix: 修复单元格宽高为0时的无意义渲染 (#2024)
wjgogogo Jan 3, 2023
84558ca
fix : 修复点击行列头无法整行高亮的问题 (#2025)
stone-lyl Jan 3, 2023
7c80f8e
docs: 替换antgroup主站 (#2029)
lcx-seima Jan 3, 2023
1089288
chore: 🤖 更新 changelog 文件 (#2028)
lijinke666 Jan 3, 2023
c073578
fix(layout): 修复无列头时行头对应的角头不显示 close #1929 (#2026)
lijinke666 Jan 4, 2023
179fa5c
refactor: rowCells 重命名为 currentRow,避免与行头 rowCell 定义冲突 (#2032)
stone-lyl Jan 6, 2023
d5d466f
chore: merge master into next
stone-lyl Jan 9, 2023
71d1659
chore: 修复严格模式下 eslint 错误的问题
stone-lyl Jan 9, 2023
09364da
Merge branch 'next' into chore-merge-master
stone-lyl Jan 9, 2023
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
59 changes: 59 additions & 0 deletions packages/s2-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
# [@antv/s2-v2.0.0-next.3](https://github.com/antvis/S2/compare/@antv/s2-v2.0.0-next.2...@antv/s2-v2.0.0-next.3) (2022-12-16)

### Bug Fixes
# [@antv/s2-v1.40.0](https://github.com/antvis/S2/compare/@antv/s2-v1.39.1...@antv/s2-v1.40.0) (2023-01-03)


### Bug Fixes

* bullet占位符绘制错误 ([#2022](https://github.com/antvis/S2/issues/2022)) ([c95c446](https://github.com/antvis/S2/commit/c95c446219216b190bf6af632104edd125a82ff3))
* 修复单元格宽高为0时的无意义渲染 ([#2024](https://github.com/antvis/S2/issues/2024)) ([9f952fd](https://github.com/antvis/S2/commit/9f952fd4bfd280b657b589e5912399f89bb1f0ea))
* 列头label存在数组,复制导出列头层级补齐错误 ([#1990](https://github.com/antvis/S2/issues/1990)) ([ec62409](https://github.com/antvis/S2/commit/ec62409b688c5dd5e39a93f5b292d909496ed830))


### Features

* selected cell highlight ([#1878](https://github.com/antvis/S2/issues/1878)) ([3e11a37](https://github.com/antvis/S2/commit/3e11a37bf94f758379ba2819ec5d8b3251708814))
* 子弹图为空时使用placeholder占位 ([#2010](https://github.com/antvis/S2/issues/2010)) ([8d28254](https://github.com/antvis/S2/commit/8d28254aa9aa29d9b2a9e24efb21f185cb5ffe4c))

# [@antv/s2-v1.39.1](https://github.com/antvis/S2/compare/@antv/s2-v1.39.0...@antv/s2-v1.39.1) (2022-12-20)


### Bug Fixes

* 明细表linkField失效 ([#2007](https://github.com/antvis/S2/issues/2007)) ([122552b](https://github.com/antvis/S2/commit/122552bdd25aa538cfd38a6210e9979698c13188))
* 明细表紧凑模式宽度计算错误 ([#2006](https://github.com/antvis/S2/issues/2006)) ([89f5c9e](https://github.com/antvis/S2/commit/89f5c9eb7719834ce9a55d340bf04415639cc277))

# [@antv/s2-v1.39.0](https://github.com/antvis/S2/compare/@antv/s2-v1.38.0...@antv/s2-v1.39.0) (2022-12-19)


### Bug Fixes

* gui icon 加载完成后,增加检测步骤,避免无意义的渲染 warning ([#1997](https://github.com/antvis/S2/issues/1997)) ([6f13aa4](https://github.com/antvis/S2/commit/6f13aa43d8910f9ed83d59a9c958b26a0eb163d6))


### Features

* 添加字段标记中,定制柱状图的长度的功能 (filedValue) ([#2002](https://github.com/antvis/S2/issues/2002)) ([457e5e7](https://github.com/antvis/S2/commit/457e5e7989ce460e445f46925eaee79b49f56615))

# [@antv/s2-v1.38.0](https://github.com/antvis/S2/compare/@antv/s2-v1.37.0...@antv/s2-v1.38.0) (2022-12-16)


### Features

* 增加 linkFields 参数传入类型 ([#1992](https://github.com/antvis/S2/issues/1992)) ([66bce2a](https://github.com/antvis/S2/commit/66bce2ae77635b530058f56b0545bd5558c119e1))
* 新增链接跳转配置 ([5e08055](https://github.com/antvis/S2/commit/5e08055b52a125e75cbc41bb748d247ef25ba016))

# [@antv/s2-v1.37.0](https://github.com/antvis/S2/compare/@antv/s2-v1.36.0...@antv/s2-v1.37.0) (2022-12-09)


### Bug Fixes

* **tooltip:** 修复自定义操作菜单传入自定义 ReactNode 不显示 ([#1969](https://github.com/antvis/S2/issues/1969)) ([3eff993](https://github.com/antvis/S2/commit/3eff9932438cc95093686c03510b57648ff44391))
* 修复 enableCopy 和 hideMeasureColumn 都开启为 true 时,复制报错问题 ([#1984](https://github.com/antvis/S2/issues/1984)) ([528d2b6](https://github.com/antvis/S2/commit/528d2b6b6b912f790449aaef015fc27d2e0e33c9))


### Features

* 实现树状模式下可复制 ([#1986](https://github.com/antvis/S2/issues/1986)) ([96ccb1e](https://github.com/antvis/S2/commit/96ccb1ee14908fc1daf82d1eccb3bd852e642f7d))
* 暴露afterRealCellRender,这样能够更灵活的使用datacell ([#1970](https://github.com/antvis/S2/issues/1970)) ([66c5ab9](https://github.com/antvis/S2/commit/66c5ab9992c51b475be8acaf9a198d49f3114a49))
* 适配链接跳转的判断方式 ([#1983](https://github.com/antvis/S2/issues/1983)) ([2a26259](https://github.com/antvis/S2/commit/2a2625971bcefd119d2e2a280608d1acf56b5d32))

# [@antv/s2-v1.36.0](https://github.com/antvis/S2/compare/@antv/s2-v1.35.1...@antv/s2-v1.36.0) (2022-12-02)

* 暂时修复g版本冲突问题 ([#2003](https://github.com/antvis/S2/issues/2003)) ([1de7ec2](https://github.com/antvis/S2/commit/1de7ec215bc96c28e7493c8a32fe1764fd08cb2d))

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PivotSheet Corner Tests should render row corner when columns and values is empty 1`] = `
Array [
Object {
"belongsCell": undefined,
"children": Array [],
"colIndex": -1,
"cornerType": "row",
"extra": undefined,
"field": "province",
"height": 30,
"id": "",
"inCollapseNode": undefined,
"isCollapsed": undefined,
"isGrandTotals": undefined,
"isLeaf": undefined,
"isPivotMode": true,
"isSubTotals": undefined,
"isTotalMeasure": undefined,
"isTotals": undefined,
"key": "province",
"label": "province",
"level": undefined,
"padding": 0,
"query": undefined,
"rowIndex": undefined,
"seriesNumberWidth": undefined,
"value": "province",
"width": 100,
"x": 0,
"y": 0,
},
Object {
"belongsCell": undefined,
"children": Array [],
"colIndex": -1,
"cornerType": "row",
"extra": undefined,
"field": "city",
"height": 30,
"id": "",
"inCollapseNode": undefined,
"isCollapsed": undefined,
"isGrandTotals": undefined,
"isLeaf": undefined,
"isPivotMode": true,
"isSubTotals": undefined,
"isTotalMeasure": undefined,
"isTotals": undefined,
"key": "city",
"label": "city",
"level": undefined,
"padding": 0,
"query": undefined,
"rowIndex": undefined,
"seriesNumberWidth": undefined,
"value": "city",
"width": 100,
"x": 100,
"y": 0,
},
]
`;

exports[`PivotSheet Corner Tests should render row corner when columns is empty and measure hidden 1`] = `
Array [
Object {
"belongsCell": undefined,
"children": Array [],
"colIndex": -1,
"cornerType": "row",
"extra": undefined,
"field": "province",
"height": 30,
"id": "",
"inCollapseNode": undefined,
"isCollapsed": undefined,
"isGrandTotals": undefined,
"isLeaf": undefined,
"isPivotMode": true,
"isSubTotals": undefined,
"isTotalMeasure": undefined,
"isTotals": undefined,
"key": "province",
"label": "province",
"level": undefined,
"padding": 0,
"query": undefined,
"rowIndex": undefined,
"seriesNumberWidth": undefined,
"value": "province",
"width": 150,
"x": 0,
"y": 0,
},
Object {
"belongsCell": undefined,
"children": Array [],
"colIndex": -1,
"cornerType": "row",
"extra": undefined,
"field": "city",
"height": 30,
"id": "",
"inCollapseNode": undefined,
"isCollapsed": undefined,
"isGrandTotals": undefined,
"isLeaf": undefined,
"isPivotMode": true,
"isSubTotals": undefined,
"isTotalMeasure": undefined,
"isTotals": undefined,
"key": "city",
"label": "city",
"level": undefined,
"padding": 0,
"query": undefined,
"rowIndex": undefined,
"seriesNumberWidth": undefined,
"value": "city",
"width": 150,
"x": 150,
"y": 0,
},
]
`;

exports[`PivotSheet Corner Tests should render row corner when measure hidden 1`] = `
Array [
Object {
"belongsCell": undefined,
"children": Array [],
"colIndex": -1,
"cornerType": "row",
"extra": undefined,
"field": "province",
"height": 30,
"id": "",
"inCollapseNode": undefined,
"isCollapsed": undefined,
"isGrandTotals": undefined,
"isLeaf": undefined,
"isPivotMode": true,
"isSubTotals": undefined,
"isTotalMeasure": undefined,
"isTotals": undefined,
"key": "province",
"label": "province",
"level": undefined,
"padding": 0,
"query": undefined,
"rowIndex": undefined,
"seriesNumberWidth": undefined,
"value": "province",
"width": 100,
"x": 0,
"y": 0,
},
Object {
"belongsCell": undefined,
"children": Array [],
"colIndex": -1,
"cornerType": "row",
"extra": undefined,
"field": "city",
"height": 30,
"id": "",
"inCollapseNode": undefined,
"isCollapsed": undefined,
"isGrandTotals": undefined,
"isLeaf": undefined,
"isPivotMode": true,
"isSubTotals": undefined,
"isTotalMeasure": undefined,
"isTotals": undefined,
"key": "city",
"label": "city",
"level": undefined,
"padding": 0,
"query": undefined,
"rowIndex": undefined,
"seriesNumberWidth": undefined,
"value": "city",
"width": 100,
"x": 100,
"y": 0,
},
]
`;
114 changes: 114 additions & 0 deletions packages/s2-core/__tests__/spreadsheet/corner-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import * as simpleDataConfig from 'tests/data/simple-data.json';
import { DEFAULT_STYLE, type SpreadSheet } from '../../src';
import { createPivotSheet } from '../util/helpers';

describe('PivotSheet Corner Tests', () => {
let s2: SpreadSheet;

beforeEach(() => {
s2 = createPivotSheet({
width: 300,
height: 300,
});
s2.render();
});

afterEach(() => {
s2.destroy();
});

// https://github.com/antvis/S2/issues/1929
test('should render row corner when columns is empty and measure hidden', () => {
s2.setDataCfg({
...simpleDataConfig,
fields: {
...simpleDataConfig.fields,
columns: [],
},
});
s2.setOptions({
style: {
colCell: {
hideValue: true,
},
},
});
s2.render();

const cornerNodes = s2.facet.getCornerNodes();
const { colsHierarchy } = s2.facet.layoutResult;

expect(colsHierarchy.width).toEqual(0);
expect(colsHierarchy.height).toEqual(DEFAULT_STYLE.colCell!.height);
expect(colsHierarchy.sampleNodeForLastLevel!.y).toEqual(0);
expect(colsHierarchy.sampleNodeForLastLevel!.height).toEqual(
DEFAULT_STYLE.colCell!.height,
);
expect(cornerNodes).toHaveLength(2);
expect(s2.facet.getCornerNodes()).toMatchSnapshot();
});

test('should render row corner when measure hidden', () => {
s2.setOptions({
style: {
colCell: {
hideValue: true,
},
},
});
s2.render();

const cornerNodes = s2.facet.getCornerNodes();
const { colsHierarchy } = s2.facet.layoutResult;

expect(colsHierarchy.width).toEqual(100);
expect(colsHierarchy.height).toEqual(DEFAULT_STYLE.colCell!.height);
expect(colsHierarchy.sampleNodeForLastLevel!.y).toEqual(0);
expect(colsHierarchy.sampleNodeForLastLevel!.height).toEqual(
DEFAULT_STYLE.colCell!.height,
);
expect(cornerNodes).toHaveLength(2);
expect(s2.facet.getCornerNodes()).toMatchSnapshot();
});

test('should render row corner when columns and values is empty', () => {
s2.setDataCfg({
...simpleDataConfig,
fields: {
...simpleDataConfig.fields,
columns: [],
values: [],
},
});
s2.render();

const cornerNodes = s2.facet.getCornerNodes();
const { colsHierarchy } = s2.facet.layoutResult;

expect(colsHierarchy.width).toEqual(0);
expect(colsHierarchy.height).toEqual(0);
expect(colsHierarchy.sampleNodeForLastLevel).toBeNull();
expect(cornerNodes).toHaveLength(2);
expect(cornerNodes).toMatchSnapshot();
});

test('should not render row corner when fields is empty', () => {
s2.setDataCfg({
...simpleDataConfig,
fields: {
rows: [],
columns: [],
values: [],
},
});
s2.render();

const cornerNodes = s2.facet.getCornerNodes();
const { colsHierarchy } = s2.facet.layoutResult;

expect(colsHierarchy.width).toEqual(0);
expect(colsHierarchy.height).toEqual(0);
expect(colsHierarchy.sampleNodeForLastLevel).toBeNull();
expect(cornerNodes).toHaveLength(0);
});
});
Loading