@odoo/o-spreadsheet 16.4.0-alpha.2 → 16.4.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -297,7 +297,7 @@ interface XLSXExportXMLFile {
297
297
  }
298
298
  interface XLSXExportImageFile {
299
299
  path: string;
300
- imagePath: string;
300
+ imageSrc: string;
301
301
  }
302
302
  interface XLSXExport {
303
303
  name: string;
@@ -493,6 +493,7 @@ interface Range extends Cloneable<Range> {
493
493
  readonly invalidSheetName?: string;
494
494
  /** the sheet on which the range is defined */
495
495
  readonly sheetId: UID;
496
+ readonly rangeData: RangeData;
496
497
  }
497
498
  interface RangeData {
498
499
  _zone: Zone | UnboundedZone;
@@ -574,6 +575,7 @@ declare type ResizeDirection = -1 | 0 | 1;
574
575
  interface Image {
575
576
  path: string;
576
577
  size: FigureSize;
578
+ mimetype?: string;
577
579
  }
578
580
 
579
581
  interface CellData {
@@ -1005,21 +1007,16 @@ declare function positionToZone(position: Position$1): {
1005
1007
  bottom: HeaderIndex;
1006
1008
  };
1007
1009
 
1008
- interface SelectionEventPayload {
1010
+ declare type SelectionEventOptions = {
1011
+ scrollIntoView?: boolean;
1012
+ unbounded?: boolean;
1013
+ };
1014
+ interface SelectionEvent {
1009
1015
  anchor: AnchorZone;
1010
1016
  previousAnchor: AnchorZone;
1011
1017
  mode: "newAnchor" | "overrideSelection" | "updateAnchor";
1018
+ options: SelectionEventOptions;
1012
1019
  }
1013
- interface ZonesSelected extends SelectionEventPayload {
1014
- type: "ZonesSelected";
1015
- }
1016
- interface HeadersSelected extends SelectionEventPayload {
1017
- type: "HeadersSelected";
1018
- }
1019
- interface AlterZone extends SelectionEventPayload {
1020
- type: "AlterZone";
1021
- }
1022
- declare type SelectionEvent = Readonly<ZonesSelected | HeadersSelected | AlterZone>;
1023
1020
 
1024
1021
  interface StreamCallbacks<Event> {
1025
1022
  handleEvent: (event: Event) => void;
@@ -1041,7 +1038,7 @@ declare type StatefulStream<Event, State> = {
1041
1038
  * Allows to select cells in the grid and update the selection
1042
1039
  */
1043
1040
  interface SelectionProcessor {
1044
- selectZone(anchor: AnchorZone): DispatchResult;
1041
+ selectZone(anchor: AnchorZone, options?: SelectionEventOptions): DispatchResult;
1045
1042
  selectCell(col: number, row: number): DispatchResult;
1046
1043
  moveAnchorCell(direction: SelectionDirection, step: SelectionStep): DispatchResult;
1047
1044
  setAnchorCorner(col: number, row: number): DispatchResult;
@@ -1669,10 +1666,10 @@ interface PositionDependentCommand {
1669
1666
  col: number;
1670
1667
  row: number;
1671
1668
  }
1672
- declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1673
- declare const invalidateDependenciesCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1674
- declare const invalidateCFEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1675
- declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1669
+ declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1670
+ declare const invalidateDependenciesCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1671
+ declare const invalidateCFEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1672
+ declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
1676
1673
  declare const coreTypes: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
1677
1674
  interface UpdateCellCommand extends PositionDependentCommand {
1678
1675
  type: "UPDATE_CELL";
@@ -2201,12 +2198,6 @@ interface InsertCellCommand {
2201
2198
  shiftDimension: Dimension;
2202
2199
  zone: Zone;
2203
2200
  }
2204
- interface PasteCFCommand {
2205
- type: "PASTE_CONDITIONAL_FORMAT";
2206
- originPosition: CellPosition;
2207
- targetPosition: CellPosition;
2208
- operation: "CUT" | "COPY";
2209
- }
2210
2201
  interface ActivateNextSheetCommand {
2211
2202
  type: "ACTIVATE_NEXT_SHEET";
2212
2203
  }
@@ -2251,7 +2242,7 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
2251
2242
  | CreateImageOverCommand
2252
2243
  /** FILTERS */
2253
2244
  | CreateFilterTableCommand | RemoveFilterTableCommand;
2254
- declare type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | PasteCFCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | PrepareExpansionCommand | StopSelectionCommand | EvaluateCellsCommand | ChangeHighlightCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | RefreshSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand;
2245
+ declare type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | PrepareExpansionCommand | StopSelectionCommand | EvaluateCellsCommand | ChangeHighlightCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | RefreshSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand;
2255
2246
  declare type Command = CoreCommand | LocalCommand;
2256
2247
  /**
2257
2248
  * Holds the result of a command dispatch.
@@ -2398,6 +2389,7 @@ interface CoreCommandDispatcher {
2398
2389
  }
2399
2390
  declare type CommandTypes = Command["type"];
2400
2391
  declare type CoreCommandTypes = CoreCommand["type"];
2392
+ declare type CoreViewCommand = CoreCommand | EvaluateCellsCommand | UndoCommand | RedoCommand;
2401
2393
 
2402
2394
  /**
2403
2395
  * The following type is meant to be used in union with other aliases to prevent
@@ -2646,6 +2638,14 @@ interface SortOptions {
2646
2638
  interface MenuMouseEvent extends MouseEvent {
2647
2639
  closedMenuId?: UID;
2648
2640
  }
2641
+ declare type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
2642
+ declare type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
2643
+ declare type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
2644
+ declare type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
2645
+ declare type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
2646
+ declare type ImmutableObject<T> = {
2647
+ readonly [K in keyof T]: Immutable<T[K]>;
2648
+ };
2649
2649
 
2650
2650
  declare type Format = string & Alias;
2651
2651
  declare type FormattedValue = string & Alias;
@@ -2869,7 +2869,7 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2869
2869
  private getters;
2870
2870
  private providers;
2871
2871
  constructor(getters: CoreGetters);
2872
- static getters: readonly ["getRangeString", "getSelectionRangeString", "getRangeFromSheetXC", "createAdaptedRanges", "getRangeDataFromXc", "getRangeDataFromZone", "getRangeFromRangeData"];
2872
+ static getters: readonly ["getRangeString", "getRangeFromSheetXC", "createAdaptedRanges", "getRangeDataFromXc", "getRangeDataFromZone", "getRangeFromRangeData", "getRangeFromZone"];
2873
2873
  allowDispatch(cmd: Command): CommandResult;
2874
2874
  beforeHandle(command: Command): void;
2875
2875
  handle(cmd: Command): void;
@@ -2899,10 +2899,6 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2899
2899
  * @param sheetXC the string description of a range, in the form SheetName!XC:XC
2900
2900
  */
2901
2901
  getRangeFromSheetXC(defaultSheetId: UID, sheetXC: string): RangeImpl;
2902
- /**
2903
- * Same as `getRangeString` but add all necessary merge to the range to make it a valid selection
2904
- */
2905
- getSelectionRangeString(range: Range, forSheetId: UID): string;
2906
2902
  /**
2907
2903
  * Gets the string that represents the range as it is at the moment of the call.
2908
2904
  * The string will be prefixed with the sheet name if the call specified a sheet id in `forSheetId`
@@ -2913,7 +2909,8 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2913
2909
  */
2914
2910
  getRangeString(range: Range, forSheetId: UID): string;
2915
2911
  getRangeDataFromXc(sheetId: UID, xc: string): RangeData;
2916
- getRangeDataFromZone(sheetId: UID, zone: Zone): RangeData;
2912
+ getRangeDataFromZone(sheetId: UID, zone: Zone | UnboundedZone): RangeData;
2913
+ getRangeFromZone(sheetId: UID, zone: Zone | UnboundedZone): Range;
2917
2914
  getRangeFromRangeData(data: RangeData): Range;
2918
2915
  /**
2919
2916
  * Get a Xc string that represent a part of a range
@@ -3272,7 +3269,7 @@ interface ConditionalFormatState {
3272
3269
  };
3273
3270
  }
3274
3271
  declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState> implements ConditionalFormatState {
3275
- static getters: readonly ["getConditionalFormats", "getRulesSelection", "getRulesByCell"];
3272
+ static getters: readonly ["getConditionalFormats", "getRulesSelection", "getRulesByCell", "getAdaptedCfRanges"];
3276
3273
  readonly cfRules: {
3277
3274
  [sheet: string]: ConditionalFormatInternal[];
3278
3275
  };
@@ -3290,6 +3287,10 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
3290
3287
  getRulesSelection(sheetId: UID, selection: Zone[]): UID[];
3291
3288
  getRulesByZone(sheetId: UID, zone: Zone): Set<UID>;
3292
3289
  getRulesByCell(sheetId: UID, cellCol: number, cellRow: number): Set<ConditionalFormat>;
3290
+ /**
3291
+ * Add or remove cells to a given conditional formatting rule and return the adapted CF's XCs.
3292
+ */
3293
+ getAdaptedCfRanges(sheetId: UID, cf: ConditionalFormat, toAdd: string[], toRemove: string[]): string[] | undefined;
3293
3294
  private mapToConditionalFormat;
3294
3295
  private mapToConditionalFormatInternal;
3295
3296
  /**
@@ -3364,7 +3365,7 @@ interface FiltersState {
3364
3365
  tables: Record<UID, Record<FilterTableId, FilterTable | undefined>>;
3365
3366
  }
3366
3367
  declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersState {
3367
- static getters: readonly ["doesZonesContainFilter", "getFilter", "getFilters", "getFilterTable", "getFilterTables", "getFilterTablesInZone", "getFilterId"];
3368
+ static getters: readonly ["doesZonesContainFilter", "getFilter", "getFilters", "getFilterTable", "getFilterTables", "getFilterTablesInZone", "getFilterId", "getFilterHeaders", "isFilterHeader"];
3368
3369
  readonly tables: Record<UID, Record<FilterTableId, FilterTable | undefined>>;
3369
3370
  allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
3370
3371
  handle(cmd: CoreCommand): void;
@@ -3376,6 +3377,8 @@ declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersS
3376
3377
  /** Get the filter tables that are fully inside the given zone */
3377
3378
  getFilterTablesInZone(sheetId: UID, zone: Zone): FilterTable[];
3378
3379
  doesZonesContainFilter(sheetId: UID, zones: Zone[]): boolean;
3380
+ getFilterHeaders(sheetId: UID): Position$1[];
3381
+ isFilterHeader({ sheetId, col, row }: CellPosition): boolean;
3379
3382
  private onAddColumnsRows;
3380
3383
  private onDeleteColumnsRows;
3381
3384
  private createFilterTable;
@@ -3488,7 +3491,7 @@ interface MergeState {
3488
3491
  readonly mergeCellMap: Record<UID, SheetMergeCellMap | undefined>;
3489
3492
  }
3490
3493
  declare class MergePlugin extends CorePlugin<MergeState> implements MergeState {
3491
- static getters: readonly ["isInMerge", "isInSameMerge", "isMergeHidden", "getMainCellPosition", "getBottomLeftCell", "expandZone", "doesIntersectMerge", "doesColumnsHaveCommonMerges", "doesRowsHaveCommonMerges", "getMerges", "getMerge", "getMergesInZone", "isSingleCellOrMerge"];
3494
+ static getters: readonly ["isInMerge", "isInSameMerge", "isMergeHidden", "getMainCellPosition", "getBottomLeftCell", "expandZone", "doesIntersectMerge", "doesColumnsHaveCommonMerges", "doesRowsHaveCommonMerges", "getMerges", "getMerge", "getMergesInZone", "isSingleCellOrMerge", "getSelectionRangeString"];
3492
3495
  private nextId;
3493
3496
  readonly merges: Record<UID, Record<number, Range | undefined> | undefined>;
3494
3497
  readonly mergeCellMap: Record<UID, SheetMergeCellMap | undefined>;
@@ -3498,6 +3501,10 @@ declare class MergePlugin extends CorePlugin<MergeState> implements MergeState {
3498
3501
  getMerges(sheetId: UID): Merge[];
3499
3502
  getMerge({ sheetId, col, row }: CellPosition): Merge | undefined;
3500
3503
  getMergesInZone(sheetId: UID, zone: Zone): Merge[];
3504
+ /**
3505
+ * Same as `getRangeString` but add all necessary merge to the range to make it a valid selection
3506
+ */
3507
+ getSelectionRangeString(range: Range, forSheetId: UID): string;
3501
3508
  /**
3502
3509
  * Return true if the zone intersects an existing merge:
3503
3510
  * if they have at least a common cell
@@ -3565,7 +3572,7 @@ interface SheetState$1 {
3565
3572
  readonly cellPosition: Record<UID, CellPosition | undefined>;
3566
3573
  }
3567
3574
  declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState$1 {
3568
- static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones"];
3575
+ static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone"];
3569
3576
  readonly sheetIdsMapName: Record<string, UID | undefined>;
3570
3577
  readonly orderedSheetIds: UID[];
3571
3578
  readonly sheets: Record<UID, Sheet | undefined>;
@@ -3605,6 +3612,7 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3605
3612
  getNextSheetName(baseName?: string): string;
3606
3613
  getSheetSize(sheetId: UID): ZoneDimension;
3607
3614
  getSheetZone(sheetId: UID): Zone;
3615
+ getUnboundedZone(sheetId: UID, zone: Zone): UnboundedZone;
3608
3616
  getPaneDivisions(sheetId: UID): Readonly<PaneDivision>;
3609
3617
  private setPaneDivisions;
3610
3618
  /**
@@ -3721,9 +3729,9 @@ declare class EvaluationPlugin extends UIPlugin {
3721
3729
  private positionsToUpdate;
3722
3730
  constructor(config: UIPluginConfig);
3723
3731
  beforeHandle(cmd: Command): void;
3724
- handle(cmd: Command): void;
3732
+ handle(cmd: CoreViewCommand): void;
3725
3733
  finalize(): void;
3726
- evaluateFormula(formulaString: string, sheetId?: UID): any;
3734
+ evaluateFormula(sheetId: UID, formulaString: string): any;
3727
3735
  /**
3728
3736
  * Return the value of each cell in the range as they are displayed in the grid.
3729
3737
  */
@@ -3748,16 +3756,20 @@ declare class EvaluationPlugin extends UIPlugin {
3748
3756
  private getCorrespondingFormulaCell;
3749
3757
  }
3750
3758
 
3759
+ interface CustomColorState {
3760
+ readonly customColors: Immutable<Record<Color, true>>;
3761
+ readonly shouldUpdateColors: boolean;
3762
+ }
3751
3763
  /**
3752
3764
  * CustomColors plugin
3753
3765
  * This plugins aims to compute and keep to custom colors used in the
3754
3766
  * current spreadsheet
3755
3767
  */
3756
- declare class CustomColorsPlugin extends UIPlugin {
3757
- private customColors;
3758
- private shouldUpdateColors;
3768
+ declare class CustomColorsPlugin extends UIPlugin<CustomColorState> {
3769
+ private readonly customColors;
3770
+ private readonly shouldUpdateColors;
3759
3771
  static getters: readonly ["getCustomColors"];
3760
- handle(cmd: Command): void;
3772
+ handle(cmd: CoreViewCommand): void;
3761
3773
  finalize(): void;
3762
3774
  getCustomColors(): Color[];
3763
3775
  private getColorsFromCells;
@@ -3766,11 +3778,14 @@ declare class CustomColorsPlugin extends UIPlugin {
3766
3778
  private tryToAddColor;
3767
3779
  }
3768
3780
 
3769
- declare class EvaluationChartPlugin extends UIPlugin {
3781
+ interface EvaluationChartState {
3782
+ readonly charts: Immutable<Record<UID, ChartRuntime | undefined>>;
3783
+ }
3784
+ declare class EvaluationChartPlugin extends UIPlugin<EvaluationChartState> {
3770
3785
  static getters: readonly ["getChartRuntime", "getBackgroundOfSingleCellChart"];
3771
- readonly charts: Record<UID, ChartRuntime | undefined>;
3786
+ readonly charts: Immutable<Record<UID, ChartRuntime | undefined>>;
3772
3787
  private createRuntimeChart;
3773
- handle(cmd: Command): void;
3788
+ handle(cmd: CoreViewCommand): void;
3774
3789
  getChartRuntime(figureId: UID): ChartRuntime;
3775
3790
  /**
3776
3791
  * Get the background color of a chart based on the color of the first cell of the main range
@@ -3789,10 +3804,10 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3789
3804
  private isStale;
3790
3805
  private computedStyles;
3791
3806
  private computedIcons;
3792
- handle(cmd: Command): void;
3807
+ handle(cmd: CoreViewCommand): void;
3793
3808
  finalize(): void;
3794
3809
  getCellComputedStyle(position: CellPosition): Style;
3795
- getConditionalIcon({ col, row }: Position$1): string | undefined;
3810
+ getConditionalIcon({ sheetId, col, row }: CellPosition): string | undefined;
3796
3811
  /**
3797
3812
  * Compute the styles according to the conditional formatting.
3798
3813
  * This computation must happen after the cell values are computed if they change
@@ -3803,10 +3818,13 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3803
3818
  * the resulting style will have the combination of all those values.
3804
3819
  * If multiple conditional formatting use the same style value, they will be applied in order so that the last applied wins
3805
3820
  */
3806
- private computeStyles;
3821
+ private getComputedStyles;
3822
+ private getComputedIcons;
3807
3823
  private parsePoint;
3824
+ /** Compute the CF icons for the given range and CF rule, and apply in in the given computedIcons object */
3808
3825
  private applyIcon;
3809
3826
  private computeIcon;
3827
+ /** Compute the color scale for the given range and CF rule, and apply in in the given computedStyle object */
3810
3828
  private applyColorScale;
3811
3829
  private computeColorDiffUnits;
3812
3830
  private colorCell;
@@ -3814,424 +3832,158 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3814
3832
  * Execute the predicate to know if a conditional formatting rule should be applied to a cell
3815
3833
  */
3816
3834
  private rulePredicate;
3817
- /**
3818
- * Add or remove cells to a given conditional formatting rule.
3819
- */
3820
- private adaptRules;
3821
- private pasteCf;
3822
3835
  }
3823
3836
 
3824
- declare class FilterEvaluationPlugin extends UIPlugin {
3825
- static getters: readonly ["getCellBorderWithFilterBorder", "getFilterHeaders", "getFilterValues", "isFilterHeader", "isRowFiltered", "isFilterActive"];
3826
- private filterValues;
3827
- hiddenRows: Set<number>;
3828
- isEvaluationDirty: boolean;
3837
+ /**
3838
+ * Autofill Plugin
3839
+ *
3840
+ */
3841
+ declare class AutofillPlugin extends UIPlugin {
3842
+ static layers: LAYERS[];
3843
+ static getters: readonly ["getAutofillTooltip"];
3844
+ private autofillZone;
3845
+ private steps;
3846
+ private lastCellSelected;
3847
+ private direction;
3848
+ private tooltip;
3829
3849
  allowDispatch(cmd: LocalCommand): CommandResult;
3830
3850
  handle(cmd: Command): void;
3831
- finalize(): void;
3832
- isRowFiltered(sheetId: UID, row: number): boolean;
3833
- getCellBorderWithFilterBorder(position: CellPosition): Border$1 | null;
3834
- getFilterHeaders(sheetId: UID): Position$1[];
3835
- getFilterValues(position: CellPosition): string[];
3836
- isFilterHeader({ sheetId, col, row }: CellPosition): boolean;
3837
- isFilterActive(position: CellPosition): boolean;
3838
- private intersectZoneWithViewport;
3839
- private updateFilter;
3840
- private updateHiddenRows;
3841
- private getCellValueAsString;
3842
- exportForExcel(data: ExcelWorkbookData): void;
3851
+ getAutofillTooltip(): Tooltip | undefined;
3843
3852
  /**
3844
- * Get an unique column name for the column at colIndex. If the column name is already in the array of used column names,
3845
- * concatenate a number to the name until we find a new unique name (eg. "ColName" => "ColName1" => "ColName2" ...)
3853
+ * Autofill the autofillZone from the current selection
3854
+ * @param apply Flag set to true to apply the autofill in the model. It's
3855
+ * useful to set it to false when we need to fill the tooltip
3846
3856
  */
3847
- private getUniqueColNameForExcel;
3857
+ private autofill;
3858
+ /**
3859
+ * Select a cell which becomes the last cell of the autofillZone
3860
+ */
3861
+ private select;
3862
+ /**
3863
+ * Computes the autofillZone to autofill when the user double click on the
3864
+ * autofiller
3865
+ */
3866
+ private autofillAuto;
3867
+ /**
3868
+ * Generate the next cell
3869
+ */
3870
+ private computeNewCell;
3871
+ /**
3872
+ * Get the rule associated to the current cell
3873
+ */
3874
+ private getRule;
3875
+ /**
3876
+ * Create the generator to be able to autofill the next cells.
3877
+ */
3878
+ private createGenerator;
3879
+ private saveZone;
3880
+ /**
3881
+ * Compute the direction of the autofill from the last selected zone and
3882
+ * a given cell (col, row)
3883
+ */
3884
+ private getDirection;
3885
+ private autoFillMerge;
3886
+ private autofillCF;
3887
+ drawGrid(renderingContext: GridRenderingContext): void;
3848
3888
  }
3849
3889
 
3850
- declare class InternalViewport {
3851
- private getters;
3852
- private sheetId;
3853
- private boundaries;
3854
- top: HeaderIndex;
3855
- bottom: HeaderIndex;
3856
- left: HeaderIndex;
3857
- right: HeaderIndex;
3858
- offsetX: Pixel;
3859
- offsetY: Pixel;
3860
- offsetScrollbarX: Pixel;
3861
- offsetScrollbarY: Pixel;
3862
- canScrollVertically: boolean;
3863
- canScrollHorizontally: boolean;
3864
- viewportWidth: Pixel;
3865
- viewportHeight: Pixel;
3866
- offsetCorrectionX: Pixel;
3867
- offsetCorrectionY: Pixel;
3868
- constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
3869
- width: Pixel;
3870
- height: Pixel;
3871
- }, options: {
3872
- canScrollVertically: boolean;
3873
- canScrollHorizontally: boolean;
3874
- }, offsets: {
3875
- x: Pixel;
3876
- y: Pixel;
3877
- });
3878
- /** Returns the maximum size (in Pixels) of the viewport relative to its allocated client size
3879
- * When the viewport grid size is smaller than its client width (resp. height), it will return
3880
- * the client width (resp. height).
3890
+ interface AutomaticSum {
3891
+ position: Position$1;
3892
+ zone: Zone;
3893
+ }
3894
+ declare class AutomaticSumPlugin extends UIPlugin {
3895
+ static getters: readonly ["getAutomaticSums"];
3896
+ handle(cmd: Command): void;
3897
+ getAutomaticSums(sheetId: UID, zone: Zone, anchor: Position$1): AutomaticSum[];
3898
+ private sumData;
3899
+ private sumAdjacentData;
3900
+ /**
3901
+ * Find a zone to automatically sum a column or row of numbers.
3902
+ *
3903
+ * We first decide which direction will be summed (column or row).
3904
+ * Here is the strategy:
3905
+ * 1. If the left cell is a number and the top cell is not: choose horizontal
3906
+ * 2. Try to find a valid vertical zone. If it's valid: choose vertical
3907
+ * 3. Try to find a valid horizontal zone. If it's valid: choose horizontal
3908
+ * 4. Otherwise, no zone is returned
3909
+ *
3910
+ * Now, how to find a valid zone?
3911
+ * The zone starts directly above or on the left of the starting point
3912
+ * (depending on the direction).
3913
+ * The zone ends where the first continuous sequence of numbers ends.
3914
+ * Empty or text cells can be part of the zone while no number has been found.
3915
+ * Other kind of cells (boolean, dates, etc.) are not valid in the zone and the
3916
+ * search stops immediately if one is found.
3917
+ *
3918
+ * ------- -------
3919
+ * | 1 | | 1 |
3920
+ * ------- -------
3921
+ * | | | |
3922
+ * ------- <= end of the sequence, stop here -------
3923
+ * | 2 | | 2 |
3924
+ * ------- -------
3925
+ * | 3 | <= start of the number sequence | 3 |
3926
+ * ------- -------
3927
+ * | | <= ignored | FALSE | <= invalid, no zone is found
3928
+ * ------- -------
3929
+ * | A | <= ignored | A | <= ignored
3930
+ * ------- -------
3881
3931
  */
3882
- getMaxSize(): DOMDimension;
3932
+ private findAdjacentData;
3883
3933
  /**
3884
- * Return the index of a column given an offset x, based on the pane left
3885
- * visible cell.
3886
- * It returns -1 if no column is found.
3934
+ * Return the zone to sum if a valid one is found.
3935
+ * @see getAutomaticSumZone
3887
3936
  */
3888
- getColIndex(x: Pixel, absolute?: boolean): HeaderIndex;
3937
+ private findSuitableZoneToSum;
3938
+ private findVerticalZone;
3939
+ private findHorizontalZone;
3889
3940
  /**
3890
- * Return the index of a row given an offset y, based on the pane top
3891
- * visible cell.
3892
- * It returns -1 if no row is found.
3941
+ * Reduces a column or row zone to a valid zone for the automatic sum.
3942
+ * @see getAutomaticSumZone
3943
+ * @param sheet
3944
+ * @param zone one dimensional zone (a single row or a single column). The zone is
3945
+ * assumed to start at the beginning of the column (top=0) or the row (left=0)
3946
+ * @param end end index of the zone (`bottom` or `right` depending on the dimension)
3947
+ * @returns the starting position of the valid zone or Infinity if the zone is not valid.
3893
3948
  */
3894
- getRowIndex(y: Pixel, absolute?: boolean): HeaderIndex;
3949
+ private reduceZoneStart;
3950
+ private shouldFindData;
3951
+ private isNumber;
3952
+ private isZoneValid;
3953
+ private lastColIsEmpty;
3954
+ private lastRowIsEmpty;
3895
3955
  /**
3896
- * This function will make sure that the provided cell position (or current selected position) is part of
3897
- * the pane that is actually displayed on the client. We therefore adjust the offset of the pane
3898
- * until it contains the cell completely.
3956
+ * Decides which dimensions (columns or rows) should be summed
3957
+ * based on its shape and what's inside the zone.
3899
3958
  */
3900
- adjustPosition(position?: Position$1): void;
3901
- adjustPositionX(targetCol: HeaderIndex): void;
3902
- adjustPositionY(targetRow: HeaderIndex): void;
3903
- setViewportOffset(offsetX: Pixel, offsetY: Pixel): void;
3904
- adjustViewportZone(): void;
3959
+ private dimensionsToSum;
3905
3960
  /**
3906
- *
3907
- * @param zone
3908
- * @returns Computes the absolute coordinate of a given zone inside the viewport
3961
+ * Sum each column and/or row in the zone in the appropriate cells,
3962
+ * depending on the available space.
3909
3963
  */
3910
- getRect(zone: Zone): Rect | undefined;
3911
- isVisible(col: HeaderIndex, row: HeaderIndex): boolean;
3912
- private searchHeaderIndex;
3913
- private get zone();
3914
- private setViewportOffsetX;
3915
- private setViewportOffsetY;
3916
- /** Corrects the viewport's horizontal offset based on the current structure
3917
- * To make sure that at least on column is visible inside the viewport.
3964
+ private sumDimensions;
3965
+ /**
3966
+ * Sum the total of the zone in the bottom right cell, assuming
3967
+ * the last row contains summed columns.
3918
3968
  */
3919
- private adjustViewportOffsetX;
3920
- /** Corrects the viewport's vertical offset based on the current structure
3921
- * To make sure that at least on row is visible inside the viewport.
3969
+ private sumTotal;
3970
+ private sumColumns;
3971
+ private sumRows;
3972
+ private dispatchCellUpdates;
3973
+ /**
3974
+ * Find the first row where all cells below the zone are empty.
3922
3975
  */
3923
- private adjustViewportOffsetY;
3924
- /** Updates the pane zone and snapped offset based on its horizontal
3925
- * offset (will find Left) and its width (will find Right) */
3926
- private adjustViewportZoneX;
3927
- /** Updates the pane zone and snapped offset based on its vertical
3928
- * offset (will find Top) and its width (will find Bottom) */
3929
- private adjustViewportZoneY;
3930
- }
3931
-
3932
- declare type SheetViewports = {
3933
- topLeft: InternalViewport | undefined;
3934
- bottomLeft: InternalViewport | undefined;
3935
- topRight: InternalViewport | undefined;
3936
- bottomRight: InternalViewport;
3937
- };
3938
- /**
3939
- * EdgeScrollCases Schema
3940
- *
3941
- * The dots/double dots represent a freeze (= a split of viewports)
3942
- * In this example, we froze vertically between columns D and E
3943
- * and horizontally between rows 4 and 5.
3944
- *
3945
- * One can see that we scrolled horizontally from column E to G and
3946
- * vertically from row 5 to 7.
3947
- *
3948
- * A B C D G H I J K L M N O P Q R S T
3949
- * _______________________________________________________
3950
- * 1 | : |
3951
- * 2 | : |
3952
- * 3 | : B ↑ 6 |
3953
- * 4 | : | | | |
3954
- * ····················+···+·················+············|
3955
- * 7 | : | | | |
3956
- * 8 | : ↓ 2 | |
3957
- * 9 | : | |
3958
- * 10 | A --+--→ | |
3959
- * 11 | : | |
3960
- * 12 | : | |
3961
- * 13 | ←--+-- 1 | |
3962
- * 14 | : | 3 --+--→
3963
- * 15 | : | |
3964
- * 16 | : | |
3965
- * 17 | 5 --+-------------------------------------------+--→
3966
- * 18 | : | |
3967
- * 19 | : 4 | |
3968
- * 20 | : | | |
3969
- * ______________________________+___________| ____________
3970
- * | |
3971
- * ↓ ↓
3972
- */
3973
- /**
3974
- * Viewport plugin.
3975
- *
3976
- * This plugin manages all things related to all viewport states.
3977
- *
3978
- */
3979
- declare class SheetViewPlugin extends UIPlugin {
3980
- static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
3981
- readonly viewports: Record<UID, SheetViewports | undefined>;
3982
- /**
3983
- * The viewport dimensions are usually set by one of the components
3984
- * (i.e. when grid component is mounted) to properly reflect its state in the DOM.
3985
- * In the absence of a component (standalone model), is it mandatory to set reasonable default values
3986
- * to ensure the correct operation of this plugin.
3987
- */
3988
- private sheetViewWidth;
3989
- private sheetViewHeight;
3990
- private gridOffsetX;
3991
- private gridOffsetY;
3992
- private sheetsWithDirtyViewports;
3993
- allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
3994
- private handleEvent;
3995
- handle(cmd: Command): void;
3996
- finalize(): void;
3997
- private setViewports;
3998
- /**
3999
- * Return the index of a column given an offset x, based on the viewport left
4000
- * visible cell.
4001
- * It returns -1 if no column is found.
4002
- */
4003
- getColIndex(x: Pixel): HeaderIndex;
4004
- /**
4005
- * Return the index of a row given an offset y, based on the viewport top
4006
- * visible cell.
4007
- * It returns -1 if no row is found.
4008
- */
4009
- getRowIndex(y: Pixel): HeaderIndex;
4010
- getSheetViewDimensionWithHeaders(): DOMDimension;
4011
- getSheetViewDimension(): DOMDimension;
4012
- /** type as pane, not viewport but basically pane extends viewport */
4013
- getActiveMainViewport(): Viewport;
4014
- /**
4015
- * Return the scroll info of the active sheet, ie. the offset between the viewport left/top side and
4016
- * the grid left/top side, snapped to the columns/rows.
4017
- */
4018
- getActiveSheetScrollInfo(): SheetScrollInfo;
4019
- /**
4020
- * Return the DOM scroll info of the active sheet, ie. the offset between the viewport left/top side and
4021
- * the grid left/top side, corresponding to the scroll of the scrollbars and not snapped to the grid.
4022
- */
4023
- getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
4024
- getSheetViewVisibleCols(): HeaderIndex[];
4025
- getSheetViewVisibleRows(): HeaderIndex[];
4026
- /**
4027
- * Return the main viewport maximum size relative to the client size.
4028
- */
4029
- getMainViewportRect(): Rect;
4030
- private getMaximumSheetOffset;
4031
- getColRowOffsetInViewport(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex): Pixel;
4032
- /**
4033
- * Check if a given position is visible in the viewport.
4034
- */
4035
- isVisibleInViewport({ sheetId, col, row }: CellPosition): boolean;
4036
- getEdgeScrollCol(x: number, previousX: number, startingX: number): EdgeScrollInfo;
4037
- getEdgeScrollRow(y: number, previousY: number, tartingY: number): EdgeScrollInfo;
4038
- /**
4039
- * Computes the coordinates and size to draw the zone on the canvas
4040
- */
4041
- getVisibleRect(zone: Zone): Rect;
4042
- /**
4043
- * Returns the position of the MainViewport relatively to the start of the grid (without headers)
4044
- * It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
4045
- * situated before the pane divisions.
4046
- */
4047
- getMainViewportCoordinates(): DOMCoordinates;
4048
- private ensureMainViewportExist;
4049
- private getSubViewports;
4050
- private checkPositiveDimension;
4051
- private checkValuesAreDifferent;
4052
- private checkScrollingDirection;
4053
- private getMainViewport;
4054
- private getMainInternalViewport;
4055
- /** gets rid of deprecated sheetIds */
4056
- private cleanViewports;
4057
- private resetSheetViews;
4058
- private resizeSheetView;
4059
- private recomputeViewports;
4060
- private setSheetViewOffset;
4061
- /**
4062
- * Clip the vertical offset within the allowed range.
4063
- * Not above the sheet, nor below the sheet.
4064
- */
4065
- private clipOffsetY;
4066
- private getViewportOffset;
4067
- private resetViewports;
4068
- /**
4069
- * Adjust the viewport such that the anchor position is visible
4070
- */
4071
- private refreshViewport;
4072
- /**
4073
- * Shift the viewport vertically and move the selection anchor
4074
- * such that it remains at the same place relative to the
4075
- * viewport top.
4076
- */
4077
- private shiftVertically;
4078
- getVisibleFigures(): Figure[];
4079
- isPositionVisible(position: PixelPosition): boolean;
4080
- getFrozenSheetViewRatio(sheetId: UID): {
4081
- xRatio: number;
4082
- yRatio: number;
4083
- };
4084
- }
4085
-
4086
- /**
4087
- * Autofill Plugin
4088
- *
4089
- */
4090
- declare class AutofillPlugin extends UIPlugin {
4091
- static layers: LAYERS[];
4092
- static getters: readonly ["getAutofillTooltip"];
4093
- private autofillZone;
4094
- private steps;
4095
- private lastCellSelected;
4096
- private direction;
4097
- private tooltip;
4098
- allowDispatch(cmd: LocalCommand): CommandResult;
4099
- handle(cmd: Command): void;
4100
- getAutofillTooltip(): Tooltip | undefined;
4101
- /**
4102
- * Autofill the autofillZone from the current selection
4103
- * @param apply Flag set to true to apply the autofill in the model. It's
4104
- * useful to set it to false when we need to fill the tooltip
4105
- */
4106
- private autofill;
4107
- /**
4108
- * Select a cell which becomes the last cell of the autofillZone
4109
- */
4110
- private select;
4111
- /**
4112
- * Computes the autofillZone to autofill when the user double click on the
4113
- * autofiller
4114
- */
4115
- private autofillAuto;
4116
- /**
4117
- * Generate the next cell
4118
- */
4119
- private computeNewCell;
4120
- /**
4121
- * Get the rule associated to the current cell
4122
- */
4123
- private getRule;
4124
- /**
4125
- * Create the generator to be able to autofill the next cells.
4126
- */
4127
- private createGenerator;
4128
- private saveZone;
4129
- /**
4130
- * Compute the direction of the autofill from the last selected zone and
4131
- * a given cell (col, row)
4132
- */
4133
- private getDirection;
4134
- private autoFillMerge;
4135
- drawGrid(renderingContext: GridRenderingContext): void;
4136
- }
4137
-
4138
- interface AutomaticSum {
4139
- position: Position$1;
4140
- zone: Zone;
4141
- }
4142
- declare class AutomaticSumPlugin extends UIPlugin {
4143
- static getters: readonly ["getAutomaticSums"];
4144
- handle(cmd: Command): void;
4145
- getAutomaticSums(sheetId: UID, zone: Zone, anchor: Position$1): AutomaticSum[];
4146
- private sumData;
4147
- private sumAdjacentData;
4148
- /**
4149
- * Find a zone to automatically sum a column or row of numbers.
4150
- *
4151
- * We first decide which direction will be summed (column or row).
4152
- * Here is the strategy:
4153
- * 1. If the left cell is a number and the top cell is not: choose horizontal
4154
- * 2. Try to find a valid vertical zone. If it's valid: choose vertical
4155
- * 3. Try to find a valid horizontal zone. If it's valid: choose horizontal
4156
- * 4. Otherwise, no zone is returned
4157
- *
4158
- * Now, how to find a valid zone?
4159
- * The zone starts directly above or on the left of the starting point
4160
- * (depending on the direction).
4161
- * The zone ends where the first continuous sequence of numbers ends.
4162
- * Empty or text cells can be part of the zone while no number has been found.
4163
- * Other kind of cells (boolean, dates, etc.) are not valid in the zone and the
4164
- * search stops immediately if one is found.
4165
- *
4166
- * ------- -------
4167
- * | 1 | | 1 |
4168
- * ------- -------
4169
- * | | | |
4170
- * ------- <= end of the sequence, stop here -------
4171
- * | 2 | | 2 |
4172
- * ------- -------
4173
- * | 3 | <= start of the number sequence | 3 |
4174
- * ------- -------
4175
- * | | <= ignored | FALSE | <= invalid, no zone is found
4176
- * ------- -------
4177
- * | A | <= ignored | A | <= ignored
4178
- * ------- -------
4179
- */
4180
- private findAdjacentData;
4181
- /**
4182
- * Return the zone to sum if a valid one is found.
4183
- * @see getAutomaticSumZone
4184
- */
4185
- private findSuitableZoneToSum;
4186
- private findVerticalZone;
4187
- private findHorizontalZone;
4188
- /**
4189
- * Reduces a column or row zone to a valid zone for the automatic sum.
4190
- * @see getAutomaticSumZone
4191
- * @param sheet
4192
- * @param zone one dimensional zone (a single row or a single column). The zone is
4193
- * assumed to start at the beginning of the column (top=0) or the row (left=0)
4194
- * @param end end index of the zone (`bottom` or `right` depending on the dimension)
4195
- * @returns the starting position of the valid zone or Infinity if the zone is not valid.
4196
- */
4197
- private reduceZoneStart;
4198
- private shouldFindData;
4199
- private isNumber;
4200
- private isZoneValid;
4201
- private lastColIsEmpty;
4202
- private lastRowIsEmpty;
4203
- /**
4204
- * Decides which dimensions (columns or rows) should be summed
4205
- * based on its shape and what's inside the zone.
4206
- */
4207
- private dimensionsToSum;
4208
- /**
4209
- * Sum each column and/or row in the zone in the appropriate cells,
4210
- * depending on the available space.
4211
- */
4212
- private sumDimensions;
4213
- /**
4214
- * Sum the total of the zone in the bottom right cell, assuming
4215
- * the last row contains summed columns.
4216
- */
4217
- private sumTotal;
4218
- private sumColumns;
4219
- private sumRows;
4220
- private dispatchCellUpdates;
4221
- /**
4222
- * Find the first row where all cells below the zone are empty.
4223
- */
4224
- private nextEmptyRow;
4225
- /**
4226
- * Find the first column where all cells right of the zone are empty.
4227
- */
4228
- private nextEmptyCol;
4229
- /**
4230
- * Transpose the given dimensions.
4231
- * COL becomes ROW
4232
- * ROW becomes COL
4233
- */
4234
- private transpose;
3976
+ private nextEmptyRow;
3977
+ /**
3978
+ * Find the first column where all cells right of the zone are empty.
3979
+ */
3980
+ private nextEmptyCol;
3981
+ /**
3982
+ * Transpose the given dimensions.
3983
+ * COL becomes ROW
3984
+ * ROW becomes COL
3985
+ */
3986
+ private transpose;
4235
3987
  }
4236
3988
 
4237
3989
  /**
@@ -4656,10 +4408,34 @@ declare class ClipboardPlugin extends UIPlugin {
4656
4408
  private getInsertCellsTargets;
4657
4409
  private getClipboardStateForCopyCells;
4658
4410
  /**
4659
- * Get the clipboard state from the given zones.
4411
+ * Get the clipboard state from the given zones.
4412
+ */
4413
+ private getClipboardState;
4414
+ drawGrid(renderingContext: GridRenderingContext): void;
4415
+ }
4416
+
4417
+ declare class FilterEvaluationPlugin extends UIPlugin {
4418
+ static getters: readonly ["getCellBorderWithFilterBorder", "getFilterValues", "isRowFiltered", "isFilterActive"];
4419
+ private filterValues;
4420
+ hiddenRows: Set<number>;
4421
+ isEvaluationDirty: boolean;
4422
+ allowDispatch(cmd: LocalCommand): CommandResult;
4423
+ handle(cmd: Command): void;
4424
+ finalize(): void;
4425
+ isRowFiltered(sheetId: UID, row: number): boolean;
4426
+ getCellBorderWithFilterBorder(position: CellPosition): Border$1 | null;
4427
+ getFilterValues(position: CellPosition): string[];
4428
+ isFilterActive(position: CellPosition): boolean;
4429
+ private intersectZoneWithViewport;
4430
+ private updateFilter;
4431
+ private updateHiddenRows;
4432
+ private getCellValueAsString;
4433
+ exportForExcel(data: ExcelWorkbookData): void;
4434
+ /**
4435
+ * Get an unique column name for the column at colIndex. If the column name is already in the array of used column names,
4436
+ * concatenate a number to the name until we find a new unique name (eg. "ColName" => "ColName1" => "ColName2" ...)
4660
4437
  */
4661
- private getClipboardState;
4662
- drawGrid(renderingContext: GridRenderingContext): void;
4438
+ private getUniqueColNameForExcel;
4663
4439
  }
4664
4440
 
4665
4441
  /**
@@ -4735,6 +4511,242 @@ declare class GridSelectionPlugin extends UIPlugin {
4735
4511
  drawGrid(renderingContext: GridRenderingContext): void;
4736
4512
  }
4737
4513
 
4514
+ declare class InternalViewport {
4515
+ private getters;
4516
+ private sheetId;
4517
+ private boundaries;
4518
+ top: HeaderIndex;
4519
+ bottom: HeaderIndex;
4520
+ left: HeaderIndex;
4521
+ right: HeaderIndex;
4522
+ offsetX: Pixel;
4523
+ offsetY: Pixel;
4524
+ offsetScrollbarX: Pixel;
4525
+ offsetScrollbarY: Pixel;
4526
+ canScrollVertically: boolean;
4527
+ canScrollHorizontally: boolean;
4528
+ viewportWidth: Pixel;
4529
+ viewportHeight: Pixel;
4530
+ offsetCorrectionX: Pixel;
4531
+ offsetCorrectionY: Pixel;
4532
+ constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
4533
+ width: Pixel;
4534
+ height: Pixel;
4535
+ }, options: {
4536
+ canScrollVertically: boolean;
4537
+ canScrollHorizontally: boolean;
4538
+ }, offsets: {
4539
+ x: Pixel;
4540
+ y: Pixel;
4541
+ });
4542
+ /** Returns the maximum size (in Pixels) of the viewport relative to its allocated client size
4543
+ * When the viewport grid size is smaller than its client width (resp. height), it will return
4544
+ * the client width (resp. height).
4545
+ */
4546
+ getMaxSize(): DOMDimension;
4547
+ /**
4548
+ * Return the index of a column given an offset x, based on the pane left
4549
+ * visible cell.
4550
+ * It returns -1 if no column is found.
4551
+ */
4552
+ getColIndex(x: Pixel, absolute?: boolean): HeaderIndex;
4553
+ /**
4554
+ * Return the index of a row given an offset y, based on the pane top
4555
+ * visible cell.
4556
+ * It returns -1 if no row is found.
4557
+ */
4558
+ getRowIndex(y: Pixel, absolute?: boolean): HeaderIndex;
4559
+ /**
4560
+ * This function will make sure that the provided cell position (or current selected position) is part of
4561
+ * the pane that is actually displayed on the client. We therefore adjust the offset of the pane
4562
+ * until it contains the cell completely.
4563
+ */
4564
+ adjustPosition(position?: Position$1): void;
4565
+ adjustPositionX(targetCol: HeaderIndex): void;
4566
+ adjustPositionY(targetRow: HeaderIndex): void;
4567
+ setViewportOffset(offsetX: Pixel, offsetY: Pixel): void;
4568
+ adjustViewportZone(): void;
4569
+ /**
4570
+ *
4571
+ * @param zone
4572
+ * @returns Computes the absolute coordinate of a given zone inside the viewport
4573
+ */
4574
+ getRect(zone: Zone): Rect | undefined;
4575
+ isVisible(col: HeaderIndex, row: HeaderIndex): boolean;
4576
+ private searchHeaderIndex;
4577
+ private get zone();
4578
+ private setViewportOffsetX;
4579
+ private setViewportOffsetY;
4580
+ /** Corrects the viewport's horizontal offset based on the current structure
4581
+ * To make sure that at least on column is visible inside the viewport.
4582
+ */
4583
+ private adjustViewportOffsetX;
4584
+ /** Corrects the viewport's vertical offset based on the current structure
4585
+ * To make sure that at least on row is visible inside the viewport.
4586
+ */
4587
+ private adjustViewportOffsetY;
4588
+ /** Updates the pane zone and snapped offset based on its horizontal
4589
+ * offset (will find Left) and its width (will find Right) */
4590
+ private adjustViewportZoneX;
4591
+ /** Updates the pane zone and snapped offset based on its vertical
4592
+ * offset (will find Top) and its width (will find Bottom) */
4593
+ private adjustViewportZoneY;
4594
+ }
4595
+
4596
+ declare type SheetViewports = {
4597
+ topLeft: InternalViewport | undefined;
4598
+ bottomLeft: InternalViewport | undefined;
4599
+ topRight: InternalViewport | undefined;
4600
+ bottomRight: InternalViewport;
4601
+ };
4602
+ /**
4603
+ * EdgeScrollCases Schema
4604
+ *
4605
+ * The dots/double dots represent a freeze (= a split of viewports)
4606
+ * In this example, we froze vertically between columns D and E
4607
+ * and horizontally between rows 4 and 5.
4608
+ *
4609
+ * One can see that we scrolled horizontally from column E to G and
4610
+ * vertically from row 5 to 7.
4611
+ *
4612
+ * A B C D G H I J K L M N O P Q R S T
4613
+ * _______________________________________________________
4614
+ * 1 | : |
4615
+ * 2 | : |
4616
+ * 3 | : B ↑ 6 |
4617
+ * 4 | : | | | |
4618
+ * ····················+···+·················+············|
4619
+ * 7 | : | | | |
4620
+ * 8 | : ↓ 2 | |
4621
+ * 9 | : | |
4622
+ * 10 | A --+--→ | |
4623
+ * 11 | : | |
4624
+ * 12 | : | |
4625
+ * 13 | ←--+-- 1 | |
4626
+ * 14 | : | 3 --+--→
4627
+ * 15 | : | |
4628
+ * 16 | : | |
4629
+ * 17 | 5 --+-------------------------------------------+--→
4630
+ * 18 | : | |
4631
+ * 19 | : 4 | |
4632
+ * 20 | : | | |
4633
+ * ______________________________+___________| ____________
4634
+ * | |
4635
+ * ↓ ↓
4636
+ */
4637
+ /**
4638
+ * Viewport plugin.
4639
+ *
4640
+ * This plugin manages all things related to all viewport states.
4641
+ *
4642
+ */
4643
+ declare class SheetViewPlugin extends UIPlugin {
4644
+ static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
4645
+ readonly viewports: Record<UID, SheetViewports | undefined>;
4646
+ /**
4647
+ * The viewport dimensions are usually set by one of the components
4648
+ * (i.e. when grid component is mounted) to properly reflect its state in the DOM.
4649
+ * In the absence of a component (standalone model), is it mandatory to set reasonable default values
4650
+ * to ensure the correct operation of this plugin.
4651
+ */
4652
+ private sheetViewWidth;
4653
+ private sheetViewHeight;
4654
+ private gridOffsetX;
4655
+ private gridOffsetY;
4656
+ private sheetsWithDirtyViewports;
4657
+ allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
4658
+ private handleEvent;
4659
+ handle(cmd: Command): void;
4660
+ finalize(): void;
4661
+ private setViewports;
4662
+ /**
4663
+ * Return the index of a column given an offset x, based on the viewport left
4664
+ * visible cell.
4665
+ * It returns -1 if no column is found.
4666
+ */
4667
+ getColIndex(x: Pixel): HeaderIndex;
4668
+ /**
4669
+ * Return the index of a row given an offset y, based on the viewport top
4670
+ * visible cell.
4671
+ * It returns -1 if no row is found.
4672
+ */
4673
+ getRowIndex(y: Pixel): HeaderIndex;
4674
+ getSheetViewDimensionWithHeaders(): DOMDimension;
4675
+ getSheetViewDimension(): DOMDimension;
4676
+ /** type as pane, not viewport but basically pane extends viewport */
4677
+ getActiveMainViewport(): Viewport;
4678
+ /**
4679
+ * Return the scroll info of the active sheet, ie. the offset between the viewport left/top side and
4680
+ * the grid left/top side, snapped to the columns/rows.
4681
+ */
4682
+ getActiveSheetScrollInfo(): SheetScrollInfo;
4683
+ /**
4684
+ * Return the DOM scroll info of the active sheet, ie. the offset between the viewport left/top side and
4685
+ * the grid left/top side, corresponding to the scroll of the scrollbars and not snapped to the grid.
4686
+ */
4687
+ getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
4688
+ getSheetViewVisibleCols(): HeaderIndex[];
4689
+ getSheetViewVisibleRows(): HeaderIndex[];
4690
+ /**
4691
+ * Return the main viewport maximum size relative to the client size.
4692
+ */
4693
+ getMainViewportRect(): Rect;
4694
+ private getMaximumSheetOffset;
4695
+ getColRowOffsetInViewport(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex): Pixel;
4696
+ /**
4697
+ * Check if a given position is visible in the viewport.
4698
+ */
4699
+ isVisibleInViewport({ sheetId, col, row }: CellPosition): boolean;
4700
+ getEdgeScrollCol(x: number, previousX: number, startingX: number): EdgeScrollInfo;
4701
+ getEdgeScrollRow(y: number, previousY: number, tartingY: number): EdgeScrollInfo;
4702
+ /**
4703
+ * Computes the coordinates and size to draw the zone on the canvas
4704
+ */
4705
+ getVisibleRect(zone: Zone): Rect;
4706
+ /**
4707
+ * Returns the position of the MainViewport relatively to the start of the grid (without headers)
4708
+ * It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
4709
+ * situated before the pane divisions.
4710
+ */
4711
+ getMainViewportCoordinates(): DOMCoordinates;
4712
+ private ensureMainViewportExist;
4713
+ private getSubViewports;
4714
+ private checkPositiveDimension;
4715
+ private checkValuesAreDifferent;
4716
+ private checkScrollingDirection;
4717
+ private getMainViewport;
4718
+ private getMainInternalViewport;
4719
+ /** gets rid of deprecated sheetIds */
4720
+ private cleanViewports;
4721
+ private resetSheetViews;
4722
+ private resizeSheetView;
4723
+ private recomputeViewports;
4724
+ private setSheetViewOffset;
4725
+ /**
4726
+ * Clip the vertical offset within the allowed range.
4727
+ * Not above the sheet, nor below the sheet.
4728
+ */
4729
+ private clipOffsetY;
4730
+ private getViewportOffset;
4731
+ private resetViewports;
4732
+ /**
4733
+ * Adjust the viewport such that the anchor position is visible
4734
+ */
4735
+ private refreshViewport;
4736
+ /**
4737
+ * Shift the viewport vertically and move the selection anchor
4738
+ * such that it remains at the same place relative to the
4739
+ * viewport top.
4740
+ */
4741
+ private shiftVertically;
4742
+ getVisibleFigures(): Figure[];
4743
+ isPositionVisible(position: PixelPosition): boolean;
4744
+ getFrozenSheetViewRatio(sheetId: UID): {
4745
+ xRatio: number;
4746
+ yRatio: number;
4747
+ };
4748
+ }
4749
+
4738
4750
  /**
4739
4751
  * Union of all getter names of a plugin.
4740
4752
  *
@@ -4987,7 +4999,7 @@ interface ChartBuilder {
4987
4999
  sequence: number;
4988
5000
  }
4989
5001
 
4990
- interface Props$D {
5002
+ interface Props$E {
4991
5003
  ranges: () => string[];
4992
5004
  hasSingleRange?: boolean;
4993
5005
  required?: boolean;
@@ -5009,7 +5021,7 @@ interface SelectionRange extends Omit<RangeInputValue, "color"> {
5009
5021
  * onSelectionChanged is called every time the input value
5010
5022
  * changes.
5011
5023
  */
5012
- declare class SelectionInput extends Component<Props$D, SpreadsheetChildEnv> {
5024
+ declare class SelectionInput extends Component<Props$E, SpreadsheetChildEnv> {
5013
5025
  static template: string;
5014
5026
  private id;
5015
5027
  private previousRanges;
@@ -5038,15 +5050,26 @@ declare class SelectionInput extends Component<Props$D, SpreadsheetChildEnv> {
5038
5050
  confirm(): void;
5039
5051
  }
5040
5052
 
5053
+ interface Props$D {
5054
+ messages: string[];
5055
+ msgType: "warning" | "error";
5056
+ }
5057
+ declare class SidePanelErrors extends Component<Props$D, SpreadsheetChildEnv> {
5058
+ static template: string;
5059
+ get divClasses(): "o-sidepanel-warning text-warning" | "o-sidepanel-error text-danger";
5060
+ }
5061
+
5041
5062
  interface Props$C {
5042
5063
  figureId: UID;
5043
5064
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5044
- updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5065
+ canUpdateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5066
+ updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5045
5067
  }
5046
5068
  declare class LineBarPieConfigPanel extends Component<Props$C, SpreadsheetChildEnv> {
5047
5069
  static template: string;
5048
5070
  static components: {
5049
5071
  SelectionInput: typeof SelectionInput;
5072
+ SidePanelErrors: typeof SidePanelErrors;
5050
5073
  };
5051
5074
  private state;
5052
5075
  private dataSeriesRanges;
@@ -5151,16 +5174,22 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5151
5174
  private state;
5152
5175
  get colorPickerStyle(): string;
5153
5176
  get popoverProps(): PopoverProps;
5177
+ get gradientHueStyle(): string;
5178
+ get sliderStyle(): string;
5179
+ get pointerStyle(): string;
5180
+ get colorPreviewStyle(): string;
5181
+ get checkmarkColor(): Color;
5182
+ get isHexColorInputValid(): boolean;
5183
+ private setCustomGradient;
5184
+ private setCustomHue;
5185
+ private updateColor;
5154
5186
  onColorClick(color: Color): void;
5155
- getCheckMarkColor(): Color;
5156
5187
  resetColor(): void;
5157
- setCustomColor(ev: Event): void;
5158
5188
  toggleColorPicker(): void;
5159
- computeCustomColor(ev: MouseEvent): void;
5160
- hideMagnifier(_ev: MouseEvent): void;
5161
- showMagnifier(_ev: MouseEvent): void;
5162
- moveMagnifier(ev: MouseEvent): void;
5163
- get magnifyingGlassStyle(): string;
5189
+ dragGradientPointer(ev: MouseEvent): void;
5190
+ dragHuePointer(ev: MouseEvent): void;
5191
+ setHexColor(ev: InputEvent): void;
5192
+ addCustomColor(ev: Event): void;
5164
5193
  isSameColor(color1: Color, color2: Color): boolean;
5165
5194
  }
5166
5195
 
@@ -5190,7 +5219,8 @@ declare class ColorPickerWidget extends Component<Props$B, SpreadsheetChildEnv>
5190
5219
  interface Props$A {
5191
5220
  figureId: UID;
5192
5221
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5193
- updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => CommandResult | CommandResult[];
5222
+ canUpdateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5223
+ updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5194
5224
  }
5195
5225
  declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildEnv> {
5196
5226
  static template: string;
@@ -5209,12 +5239,14 @@ declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildE
5209
5239
  interface Props$z {
5210
5240
  figureId: UID;
5211
5241
  definition: GaugeChartDefinition;
5212
- updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
5242
+ canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5243
+ updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5213
5244
  }
5214
5245
  declare class GaugeChartConfigPanel extends Component<Props$z, SpreadsheetChildEnv> {
5215
5246
  static template: string;
5216
5247
  static components: {
5217
5248
  SelectionInput: typeof SelectionInput;
5249
+ SidePanelErrors: typeof SidePanelErrors;
5218
5250
  };
5219
5251
  private state;
5220
5252
  private dataRange;
@@ -5229,12 +5261,14 @@ declare type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectio
5229
5261
  interface Props$y {
5230
5262
  figureId: UID;
5231
5263
  definition: GaugeChartDefinition;
5232
- updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
5264
+ canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5265
+ updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5233
5266
  }
5234
5267
  declare class GaugeChartDesignPanel extends Component<Props$y, SpreadsheetChildEnv> {
5235
5268
  static template: string;
5236
5269
  static components: {
5237
5270
  ColorPickerWidget: typeof ColorPickerWidget;
5271
+ SidePanelErrors: typeof SidePanelErrors;
5238
5272
  };
5239
5273
  private state;
5240
5274
  setup(): void;
@@ -5245,13 +5279,10 @@ declare class GaugeChartDesignPanel extends Component<Props$y, SpreadsheetChildE
5245
5279
  isRangeMaxInvalid(): boolean;
5246
5280
  get isLowerInflectionPointInvalid(): boolean;
5247
5281
  get isUpperInflectionPointInvalid(): boolean;
5248
- updateInflectionPointValue(attr: string, ev: any): void;
5249
- updateInflectionPointType(attr: string, ev: any): void;
5250
5282
  updateSectionColor(target: string, color: Color): void;
5251
- updateRangeMin(ev: any): void;
5252
- updateRangeMax(ev: any): void;
5253
5283
  toggleMenu(menu: GaugeMenu): void;
5254
- private updateSectionRule;
5284
+ updateSectionRule(sectionRule: SectionRule): void;
5285
+ canUpdateSectionRule(sectionRule: SectionRule): void;
5255
5286
  private closeMenus;
5256
5287
  }
5257
5288
 
@@ -5266,12 +5297,14 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
5266
5297
  interface Props$x {
5267
5298
  figureId: UID;
5268
5299
  definition: ScorecardChartDefinition;
5269
- updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5300
+ canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5301
+ updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5270
5302
  }
5271
5303
  declare class ScorecardChartConfigPanel extends Component<Props$x, SpreadsheetChildEnv> {
5272
5304
  static template: string;
5273
5305
  static components: {
5274
5306
  SelectionInput: typeof SelectionInput;
5307
+ SidePanelErrors: typeof SidePanelErrors;
5275
5308
  };
5276
5309
  private state;
5277
5310
  private keyValue;
@@ -5292,7 +5325,8 @@ declare type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" |
5292
5325
  interface Props$w {
5293
5326
  figureId: UID;
5294
5327
  definition: ScorecardChartDefinition;
5295
- updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5328
+ canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5329
+ updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5296
5330
  }
5297
5331
  declare class ScorecardChartDesignPanel extends Component<Props$w, SpreadsheetChildEnv> {
5298
5332
  static template: string;
@@ -6473,18 +6507,20 @@ declare class ContentEditableHelper {
6473
6507
  */
6474
6508
  private findChildAtCharacterIndex;
6475
6509
  /**
6476
- * Sets (or Replaces all) the text inside the root element in the form of distinctive
6510
+ * Sets (or Replaces all) the text inside the root element in the form of distinctive paragraphs and
6477
6511
  * span for each element provided in `contents`.
6478
6512
  *
6513
+ * The function will apply the diff between the current content and the new content to avoid the systematic
6514
+ * destruction of DOM elements which interferes with IME[1]
6515
+ *
6516
+ * Each line of text will be encapsulated in a paragraph element.
6479
6517
  * Each span will have its own fontcolor and specific class if provided in the HtmlContent object.
6518
+ *
6519
+ * [1] https://developer.mozilla.org/en-US/docs/Glossary/Input_method_editor
6480
6520
  */
6481
6521
  setText(contents: HtmlContent[][]): void;
6482
6522
  scrollSelectionIntoView(): void;
6483
- /**
6484
- * remove the current selection of the user
6485
- * */
6486
- removeSelection(): void;
6487
- removeAll(): void;
6523
+ private removeAll;
6488
6524
  /**
6489
6525
  * finds the indexes of the current selection.
6490
6526
  * */
@@ -6579,7 +6615,6 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6579
6615
  composerState: ComposerState$1;
6580
6616
  autoCompleteState: AutoCompleteState;
6581
6617
  functionDescriptionState: FunctionDescriptionState;
6582
- private isKeyStillDown;
6583
6618
  private compositionActive;
6584
6619
  get assistantStyle(): string;
6585
6620
  shouldProcessInputEvents: boolean;
@@ -6591,18 +6626,17 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6591
6626
  private processArrowKeys;
6592
6627
  private handleArrowKeysForAutocomplete;
6593
6628
  private processTabKey;
6629
+ processSpaceKey(ev: KeyboardEvent): void;
6594
6630
  private processEnterKey;
6595
6631
  private processEscapeKey;
6596
6632
  private processF4Key;
6597
6633
  onCompositionStart(): void;
6598
6634
  onCompositionEnd(): void;
6599
6635
  onKeydown(ev: KeyboardEvent): void;
6600
- onInput(): void;
6601
- onKeyup(ev: KeyboardEvent): void;
6636
+ onInput(ev: InputEvent): void;
6637
+ onKeyup(): void;
6602
6638
  showAutocomplete(searchTerm: string): void;
6603
- onMousedown(ev: MouseEvent): void;
6604
6639
  onClick(): void;
6605
- onBlur(): void;
6606
6640
  private processContent;
6607
6641
  /**
6608
6642
  * Get the HTML content corresponding to the current composer token, divided by lines.
@@ -7038,11 +7072,10 @@ interface Props {
7038
7072
  declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
7039
7073
  static template: string;
7040
7074
  private state;
7041
- private shouldUpdateChart;
7042
7075
  get figureId(): UID;
7043
- get sheetId(): UID;
7044
7076
  setup(): void;
7045
- updateChart<T extends ChartDefinition>(updateDefinition: Partial<T>): DispatchResult | undefined;
7077
+ updateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
7078
+ canUpdateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
7046
7079
  onTypeChange(type: ChartType): void;
7047
7080
  get chartPanel(): ChartSidePanel;
7048
7081
  private getChartDefinition;