@antv/s2
Version:
effective spreadsheet render core lib
39 lines • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AxisHover = void 0;
const s2_1 = require("@antv/s2");
const lodash_1 = require("lodash");
const cell_type_1 = require("../cell/cell-type");
const handle_interaction_1 = require("../utils/handle-interaction");
class AxisHover extends s2_1.HoverEvent {
shouldSkipDataCellHoverEvent(event) {
const cell = this.spreadsheet.getCell(event.target);
if ((0, lodash_1.isEmpty)(cell)) {
return true;
}
}
bindDataCellHover() {
this.spreadsheet.on(s2_1.S2Event.DATA_CELL_HOVER_TRIGGERED_PRIVATE, (cell) => {
const { options } = this.spreadsheet;
const { interaction: interactionOptions } = options;
const meta = cell === null || cell === void 0 ? void 0 : cell.getMeta();
if (interactionOptions === null || interactionOptions === void 0 ? void 0 : interactionOptions.hoverHighlight) {
(0, handle_interaction_1.updateDataCellRelevantHeaderCells)(s2_1.InteractionStateName.HOVER, meta, this.spreadsheet);
}
});
}
bindHeaderCellHover() {
this.spreadsheet.on(s2_1.S2Event.GLOBAL_HOVER, (event) => {
const cell = this.spreadsheet.getCell(event.target);
if (!cell) {
return;
}
if (cell.cellType === cell_type_1.AxisCellType.AXIS_ROW_CELL ||
cell.cellType === cell_type_1.AxisCellType.AXIS_COL_CELL) {
this.handleHeaderHover(event);
}
});
}
}
exports.AxisHover = AxisHover;
//# sourceMappingURL=axis-hover.js.map