Skip to content

Commit dbe700f

Browse files
committed
Merge branch 'next' into refactor-strict
2 parents 76057d7 + db07aca commit dbe700f

File tree

137 files changed

+2869
-1422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+2869
-1422
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = {
2323
'vue/setup-compiler-macros': true,
2424
},
2525
parser: '@typescript-eslint/parser',
26+
parserOptions: { tsconfigRootDir: __dirname },
2627
plugins: ['prettier', '@typescript-eslint', 'import', 'vue'],
2728
settings: {
2829
jest: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@rollup/plugin-node-resolve": "^13.2.1",
103103
"@rollup/plugin-replace": "^3.0.0",
104104
"@rollup/plugin-typescript": "^8.2.5",
105-
"@rushstack/eslint-patch": "^1.1.3",
105+
"@rushstack/eslint-patch": "^1.2.0",
106106
"@semantic-release/changelog": "^6.0.1",
107107
"@semantic-release/git": "^10.0.1",
108108
"@swc/core": "^1.3.10",

packages/s2-core/__tests__/bugs/issue-1539-spec.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*
66
*/
77
import { getContainer } from 'tests/util/helpers';
8-
import type { IGroup } from '@antv/g-canvas';
98
import dataCfg from '../data/simple-table-data.json';
109
import { TableSheet } from '@/sheet-type';
1110
import type { S2Options } from '@/common/interface';
@@ -20,12 +19,11 @@ describe('Table Left Border Tests', () => {
2019
const s2 = new TableSheet(getContainer(), dataCfg, s2Options);
2120
s2.render();
2221

23-
const panelScrollGroup = s2.facet.panelGroup.getChildren()[0];
24-
const gridGroup = (panelScrollGroup as any).gridGroup as IGroup;
25-
const leftBorder = gridGroup.getChildren()[0].getBBox();
22+
// 左侧边框由 centerFrame进行绘制
23+
const leftBorderLine = s2.facet.centerFrame.getChildren()[1];
2624

27-
expect(leftBorder.x).toBeLessThanOrEqual(1);
28-
expect(leftBorder.y).toBeLessThanOrEqual(1);
25+
expect(leftBorderLine.attr('x1')).toBeLessThanOrEqual(1);
26+
expect(leftBorderLine.attr('x2')).toBeLessThanOrEqual(1);
2927
});
3028

3129
test('should draw left border with series number', () => {
@@ -35,10 +33,9 @@ describe('Table Left Border Tests', () => {
3533
});
3634
s2.render();
3735

38-
const panelScrollGroup = s2.facet.panelGroup.getChildren()[0];
39-
const gridGroup = (panelScrollGroup as any).gridGroup as IGroup;
40-
const leftBorder = gridGroup.getChildren()[0].getBBox();
41-
expect(leftBorder.x).toBeLessThanOrEqual(1);
42-
expect(leftBorder.y).toBeLessThanOrEqual(1);
36+
const leftBorderLine = s2.facet.centerFrame.getChildren()[1];
37+
38+
expect(leftBorderLine.attr('x1')).toBeLessThanOrEqual(1);
39+
expect(leftBorderLine.attr('x2')).toBeLessThanOrEqual(1);
4340
});
4441
});

packages/s2-core/__tests__/bugs/issue-1624-spec.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

packages/s2-core/__tests__/bugs/issue-1668-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Totals Cell Resize Tests', () => {
3535
s2.render();
3636

3737
test('should render extra resize id for resize area handler', () => {
38-
const resizeArea = s2.foregroundGroup.findById(
38+
const resizeArea = s2.facet.foregroundGroup.findById(
3939
KEY_GROUP_COL_RESIZE_AREA,
4040
) as IGroup;
4141
const resizeAreaList = resizeArea.getChildren();

packages/s2-core/__tests__/spreadsheet/custom-grid-spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,37 +86,37 @@ describe('SpreadSheet Custom Grid Tests', () => {
8686
description: 'a-1 描述',
8787
height: 90,
8888
label: '自定义节点 a-1',
89-
width: 120,
89+
width: 119,
9090
},
9191
{
9292
description: 'a-1-1 描述',
9393
height: 60,
9494
label: '自定义节点 a-1-1',
95-
width: 120,
95+
width: 119,
9696
},
9797
{
9898
description: '指标1描述',
9999
height: 30,
100100
label: '指标1',
101-
width: 120,
101+
width: 119,
102102
},
103103
{
104104
description: '指标2描述',
105105
height: 30,
106106
label: '指标2',
107-
width: 120,
107+
width: 119,
108108
},
109109
{
110110
description: 'a-1-2 描述',
111111
height: 30,
112112
label: '自定义节点 a-1-2',
113-
width: 240,
113+
width: 238,
114114
},
115115
{
116116
description: 'a-2 描述',
117117
height: 30,
118118
label: '自定义节点 a-2',
119-
width: 360,
119+
width: 357,
120120
},
121121
]);
122122
});
@@ -171,19 +171,19 @@ describe('SpreadSheet Custom Grid Tests', () => {
171171
expect(rowLeafNodes).toEqual([
172172
{
173173
field: 'measure-1',
174-
width: 120,
174+
width: 119,
175175
},
176176
{
177177
field: 'measure-2',
178-
width: 120,
178+
width: 119,
179179
},
180180
{
181181
field: 'a-1-2',
182-
width: 160,
182+
width: 159,
183183
},
184184
{
185185
field: 'a-2',
186-
width: 280,
186+
width: 278,
187187
},
188188
]);
189189

packages/s2-core/__tests__/spreadsheet/interaction-brush-selection-scroll-spec.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { getContainer, getMockData, sleep } from 'tests/util/helpers';
22
import {
3-
TableSheet,
4-
type S2Options,
5-
type S2DataConfig,
6-
S2Event,
3+
BaseBrushSelection,
74
DataCell,
5+
DeviceType,
86
InteractionName,
9-
BaseBrushSelection,
7+
type S2DataConfig,
8+
S2Event,
9+
type S2Options,
10+
TableSheet,
1011
} from '@/index';
1112

1213
const data = getMockData(
@@ -50,7 +51,7 @@ const options: S2Options = {
5051
cellCfg: {
5152
height: 32,
5253
},
53-
device: 'pc',
54+
device: DeviceType.PC,
5455
},
5556
pagination: {
5657
current: 1,
@@ -73,7 +74,7 @@ describe('Brush selection scroll spec', () => {
7374
test('Should scroll when mouse outside canvas', async () => {
7475
const s2 = new TableSheet(getContainer(), dataCfg, options);
7576
s2.render();
76-
const dataCells = s2.panelScrollGroup.getChildren();
77+
const dataCells = s2.facet.panelScrollGroup.getChildren();
7778
const target = dataCells.find((item) => item instanceof DataCell);
7879
const offsetY = s2.container.get('el').getBoundingClientRect().top;
7980
s2.emit(S2Event.DATA_CELL_MOUSE_DOWN, {

packages/s2-core/__tests__/spreadsheet/scroll-spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,12 @@ describe('Scroll Tests', () => {
415415
s2.changeSheetSize(100, 1000); // 横向滚动条
416416
s2.render(false);
417417

418-
expect(s2.facet.hScrollBar.getCanvasBBox().y).toBe(220);
419-
expect(s2.facet.hRowScrollBar.getCanvasBBox().y).toBe(220);
418+
expect(s2.facet.hScrollBar.getCanvasBBox().y).toBe(222);
419+
expect(s2.facet.hRowScrollBar.getCanvasBBox().y).toBe(222);
420420

421421
s2.changeSheetSize(1000, 150); // 纵向滚动条
422422
s2.render(false);
423-
expect(s2.facet.vScrollBar.getCanvasBBox().x).toBe(190);
423+
expect(s2.facet.vScrollBar.getCanvasBBox().x).toBe(193);
424424

425425
s2.setOptions({
426426
interaction: {
@@ -476,9 +476,9 @@ describe('Scroll Tests', () => {
476476
},
477477
});
478478

479-
const { hScrollBar, vScrollBar, cornerBBox, panelBBox } = s2.facet;
479+
const { hScrollBar, vScrollBar, panelBBox } = s2.facet;
480480
expect(
481-
hScrollBar.thumbLen + hScrollBar.thumbOffset + cornerBBox.maxX,
481+
hScrollBar.thumbLen + hScrollBar.thumbOffset + panelBBox.minX,
482482
).toStrictEqual(panelBBox.maxX);
483483
expect(
484484
vScrollBar.thumbLen + vScrollBar.thumbOffset + panelBBox.minY,

0 commit comments

Comments
 (0)