diff --git a/src/plugins/core/merge.ts b/src/plugins/core/merge.ts index fbdd76ef2..0b95583b7 100644 --- a/src/plugins/core/merge.ts +++ b/src/plugins/core/merge.ts @@ -47,7 +47,6 @@ export class MergePlugin extends CorePlugin implements MergeState { "isInSameMerge", "isMergeHidden", "getMainCellPosition", - "getBottomLeftCell", "expandZone", "doesIntersectMerge", "doesColumnsHaveCommonMerges", @@ -262,14 +261,6 @@ export class MergePlugin extends CorePlugin implements MergeState { return { sheetId: position.sheetId, col: mergeTopLeftPos.col, row: mergeTopLeftPos.row }; } - getBottomLeftCell(position: CellPosition): CellPosition { - if (!this.isInMerge(position)) { - return position; - } - const { bottom, left } = this.getMerge(position)!; - return { sheetId: position.sheetId, col: left, row: bottom }; - } - isMergeHidden(sheetId: UID, merge: Merge): boolean { const hiddenColsGroups = this.getters.getHiddenColsGroups(sheetId); const hiddenRowsGroups = this.getters.getHiddenRowsGroups(sheetId); diff --git a/src/plugins/core/sheet.ts b/src/plugins/core/sheet.ts index 401af9032..82feed48f 100644 --- a/src/plugins/core/sheet.ts +++ b/src/plugins/core/sheet.ts @@ -55,7 +55,6 @@ export class SheetPlugin extends CorePlugin implements SheetState { "getSheetIds", "getVisibleSheetIds", "isSheetVisible", - "getEvaluationSheets", "doesHeaderExist", "doesHeadersExist", "getCell", @@ -352,10 +351,6 @@ export class SheetPlugin extends CorePlugin implements SheetState { return this.orderedSheetIds.filter(this.isSheetVisible.bind(this)); } - getEvaluationSheets(): Record { - return this.sheets; - } - doesHeaderExist(sheetId: UID, dimension: Dimension, index: number) { return dimension === "COL" ? index >= 0 && index < this.getNumberCols(sheetId) @@ -366,14 +361,6 @@ export class SheetPlugin extends CorePlugin implements SheetState { return headerIndexes.every((index) => this.doesHeaderExist(sheetId, dimension, index)); } - getRow(sheetId: UID, index: HeaderIndex): Row { - const row = this.getSheet(sheetId).rows[index]; - if (!row) { - throw new Error(`Row ${row} not found.`); - } - return row; - } - getCell({ sheetId, col, row }: CellPosition): Cell | undefined { const sheet = this.tryGetSheet(sheetId); const cellId = sheet?.rows[row]?.cells[col]; diff --git a/src/plugins/ui_stateful/selection.ts b/src/plugins/ui_stateful/selection.ts index e653c3ec0..feed36c15 100644 --- a/src/plugins/ui_stateful/selection.ts +++ b/src/plugins/ui_stateful/selection.ts @@ -6,7 +6,6 @@ import { getClipboardDataPositions } from "../../helpers/clipboard/clipboard_hel import { clip, deepCopy, - formatValue, isEqual, positionToZone, positions, @@ -99,7 +98,6 @@ export class GridSelectionPlugin extends UIPlugin { "getSelectedZone", "getSelectedCells", "getStatisticFnResults", - "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", @@ -458,22 +456,6 @@ export class GridSelectionPlugin extends UIPlugin { return statisticFnResults; } - getAggregate(): string | null { - let aggregate = 0; - let n = 0; - const sheetId = this.getters.getActiveSheetId(); - const cellPositions = this.gridSelection.zones.map(positions).flat(); - for (const { col, row } of cellPositions) { - const cell = this.getters.getEvaluatedCell({ sheetId, col, row }); - if (cell.type === CellValueType.number) { - n++; - aggregate += cell.value; - } - } - const locale = this.getters.getLocale(); - return n < 2 ? null : formatValue(aggregate, { locale }); - } - isSelected(zone: Zone): boolean { return !!this.getters.getSelectedZones().find((z) => isEqual(z, zone)); } diff --git a/src/types/commands.ts b/src/types/commands.ts index 985947f25..ba045f6a9 100644 --- a/src/types/commands.ts +++ b/src/types/commands.ts @@ -12,7 +12,6 @@ import { Border, BorderData, CellPosition, - Color, Dimension, HeaderIndex, Pixel, @@ -689,15 +688,6 @@ export interface ActivateSheetCommand { sheetIdTo: UID; } -/** - * Set a color to be used for the next selection to highlight. - * The color is only used when selection highlight is enabled. - */ -export interface SetColorCommand { - type: "SET_HIGHLIGHT_COLOR"; - color: Color; -} - export interface EvaluateCellsCommand { type: "EVALUATE_CELLS"; } @@ -965,7 +955,6 @@ export type LocalCommand = | ActivateSheetCommand | EvaluateCellsCommand | StartChangeHighlightCommand - | SetColorCommand | StartCommand | AutofillCommand | AutofillSelectCommand