@antv/s2
Version:
effective spreadsheet render core lib
38 lines • 1.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AxisRowColumnClick = void 0;
const s2_1 = require("@antv/s2");
const cell_type_1 = require("../cell/cell-type");
const handle_interaction_1 = require("../utils/handle-interaction");
class AxisRowColumnClick extends s2_1.RowColumnClick {
bindEvents() {
this.bindKeyboardDown();
this.bindKeyboardUp();
this.bindAxisCellClick();
this.bindDataCellClick();
this.bindMouseMove();
}
bindAxisCellClick() {
this.spreadsheet.on(s2_1.S2Event.GLOBAL_CLICK, (event) => {
const cell = this.spreadsheet.getCell(event.target);
if (!cell) {
return;
}
// axis col cell 在底部,点击后再往上选择 data cell 有点奇怪,暂时不处理
if (cell.cellType === cell_type_1.AxisCellType.AXIS_ROW_CELL) {
this.handleRowColClick(event);
}
});
}
bindDataCellClick() {
this.spreadsheet.on(s2_1.S2Event.DATA_CELL_CLICK_TRIGGERED_PRIVATE, (cell) => {
var _a;
const meta = cell.getMeta();
if ((_a = this.spreadsheet.options.interaction) === null || _a === void 0 ? void 0 : _a.selectedCellHighlight) {
(0, handle_interaction_1.updateDataCellRelevantHeaderCells)(s2_1.InteractionStateName.SELECTED, meta, this.spreadsheet);
}
});
}
}
exports.AxisRowColumnClick = AxisRowColumnClick;
//# sourceMappingURL=axis-click.js.map