UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

60 lines 2.01 kB
import { CellType } from '../common/constant/interaction'; import { CellBorderPosition, CellClipBox } from '../common/interface/basic'; import { RowCell } from './row-cell'; export class SeriesNumberCell extends RowCell { get cellType() { return CellType.ROW_CELL; } getBorderPositions() { return [CellBorderPosition.LEFT, 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(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(CellClipBox.CONTENT_BOX); return width; } isBolderText() { return false; } findFieldCondition() { return undefined; } mappingValue() { return undefined; } getIconPosition() { return { x: 0, y: 0 }; } } //# sourceMappingURL=series-number-cell.js.map