UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

64 lines 2.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SeriesNumberCell = void 0; const interaction_1 = require("../common/constant/interaction"); const basic_1 = require("../common/interface/basic"); const row_cell_1 = require("./row-cell"); class SeriesNumberCell extends row_cell_1.RowCell { get cellType() { return interaction_1.CellType.ROW_CELL; } getBorderPositions() { return [basic_1.CellBorderPosition.LEFT, basic_1.CellBorderPosition.BOTTOM]; } initCell() { this.drawBackgroundShape(); this.drawInteractiveBgShape(); this.drawInteractiveBorderShape(); this.drawBorders(); this.drawTextShape(); this.update(); } getBackgroundColor() { const { backgroundColor, backgroundColorOpacity } = this.getCrossBackgroundColor(this.meta.rowIndex); return { backgroundColor, backgroundColorOpacity, intelligentReverseTextColor: false, }; } getTextStyle() { var _a; const textOverflowStyle = this.getCellTextWordWrapStyle(interaction_1.CellType.SERIES_NUMBER_CELL); const style = (_a = this.getStyle()) === null || _a === void 0 ? void 0 : _a.seriesText; return Object.assign(Object.assign({}, textOverflowStyle), style); } getFormattedFieldValue() { var _a; const { value, field } = this.meta; const formatter = this.spreadsheet.dataSet.getFieldFormatter(field); const formattedValue = (_a = formatter === null || formatter === void 0 ? void 0 : formatter(value, undefined, this.meta)) !== null && _a !== void 0 ? _a : value; return { value, formattedValue, }; } getMaxTextWidth() { const { width } = this.getBBoxByType(basic_1.CellClipBox.CONTENT_BOX); return width; } isBolderText() { return false; } findFieldCondition() { return undefined; } mappingValue() { return undefined; } getIconPosition() { return { x: 0, y: 0 }; } } exports.SeriesNumberCell = SeriesNumberCell; //# sourceMappingURL=series-number-cell.js.map