-
Notifications
You must be signed in to change notification settings - Fork 199
/
panel-scroll-group.ts
40 lines (33 loc) · 1.04 KB
/
panel-scroll-group.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { IGroup } from '@antv/g-canvas';
import { updateMergedCells } from '../utils/interaction/merge-cell';
import type { GridInfo } from '../common/interface';
import type { MergedCell } from './../cell/merged-cell';
import { KEY_GROUP_MERGED_CELLS } from './../common/constant/basic';
import { GridGroup } from './grid-group';
export class PanelScrollGroup extends GridGroup {
protected mergedCellsGroup: IGroup;
constructor(cfg) {
super(cfg);
this.initMergedCellsGroup();
}
protected initMergedCellsGroup() {
if (this.mergedCellsGroup && this.findById(KEY_GROUP_MERGED_CELLS)) {
return;
}
this.mergedCellsGroup = this.addGroup({
id: KEY_GROUP_MERGED_CELLS,
});
}
updateMergedCells() {
this.initMergedCellsGroup();
updateMergedCells(this.s2, this.mergedCellsGroup);
this.mergedCellsGroup.toFront();
}
addMergeCell(mergeCell: MergedCell) {
this.mergedCellsGroup?.add(mergeCell);
}
update(gridInfo: GridInfo) {
this.updateGrid(gridInfo);
this.updateMergedCells();
}
}