@antv/s2
Version:
effective spreadsheet render core lib
44 lines • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PanelScrollGroup = void 0;
const g_1 = require("@antv/g");
const common_1 = require("../common");
const merge_cell_1 = require("../utils/interaction/merge-cell");
const basic_1 = require("./../common/constant/basic");
const grid_group_1 = require("./grid-group");
class PanelScrollGroup extends grid_group_1.GridGroup {
constructor(cfg) {
super(cfg);
this.initMergedCellsGroup();
}
getMergedCellsGroup() {
return this.mergedCellsGroup;
}
initMergedCellsGroup() {
if (this.mergedCellsGroup && this.getElementById(basic_1.KEY_GROUP_MERGED_CELLS)) {
return;
}
this.mergedCellsGroup = this.appendChild(new g_1.Group({
id: basic_1.KEY_GROUP_MERGED_CELLS,
style: {
zIndex: basic_1.PANEL_MERGE_GROUP_Z_INDEX,
},
}));
}
updateMergedCells() {
this.initMergedCellsGroup();
(0, merge_cell_1.updateMergedCells)(this.s2, this.mergedCellsGroup);
}
addMergeCell(mergedCell) {
var _a;
(_a = this.mergedCellsGroup) === null || _a === void 0 ? void 0 : _a.appendChild(mergedCell);
this.s2.emit(common_1.S2Event.MERGED_CELLS_RENDER, mergedCell);
this.s2.emit(common_1.S2Event.LAYOUT_CELL_RENDER, mergedCell);
}
update(gridInfo) {
this.updateGrid(gridInfo);
this.updateMergedCells();
}
}
exports.PanelScrollGroup = PanelScrollGroup;
//# sourceMappingURL=panel-scroll-group.js.map