@odoo/o-spreadsheet 16.5.0-alpha.7 → 16.5.0-alpha.9

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.
@@ -10,6 +10,7 @@ declare class EvaluationError extends Error {
10
10
  readonly errorType: string;
11
11
  readonly logLevel: number;
12
12
  constructor(errorType: string, message: string, logLevel?: number);
13
+ get isVerbose(): boolean;
13
14
  }
14
15
 
15
16
  declare const functionCache: {
@@ -585,7 +586,6 @@ interface IconSetRule {
585
586
  lowerInflectionPoint: IconThreshold;
586
587
  }
587
588
  type ConditionalFormattingOperatorValues = "BeginsWith" | "Between" | "ContainsText" | "IsEmpty" | "IsNotEmpty" | "EndsWith" | "Equal" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "NotBetween" | "NotContains" | "NotEqual";
588
- type UpDown = "up" | "down";
589
589
 
590
590
  interface CellData {
591
591
  content?: string;
@@ -623,6 +623,7 @@ interface SheetData {
623
623
  [key: number]: HeaderData;
624
624
  };
625
625
  conditionalFormats: ConditionalFormat[];
626
+ dataValidationRules?: DataValidationRuleData[];
626
627
  filterTables: FilterTableData[];
627
628
  areGridLinesVisible?: boolean;
628
629
  isVisible: boolean;
@@ -672,6 +673,9 @@ interface ExcelSheetData extends Omit<SheetData, "figureTables"> {
672
673
  interface FilterTableData {
673
674
  range: string;
674
675
  }
676
+ interface DataValidationRuleData extends Omit<DataValidationRule, "ranges"> {
677
+ ranges: string[];
678
+ }
675
679
  interface ExcelFilterTableData {
676
680
  range: string;
677
681
  filters: ExcelFilterData[];
@@ -1057,10 +1061,10 @@ type StatefulStream<Event, State> = {
1057
1061
  interface SelectionProcessor {
1058
1062
  selectZone(anchor: AnchorZone, options?: SelectionEventOptions): DispatchResult;
1059
1063
  selectCell(col: number, row: number): DispatchResult;
1060
- moveAnchorCell(direction: Direction, step: SelectionStep): DispatchResult;
1064
+ moveAnchorCell(direction: Direction$1, step: SelectionStep): DispatchResult;
1061
1065
  setAnchorCorner(col: number, row: number): DispatchResult;
1062
1066
  addCellToSelection(col: number, row: number): DispatchResult;
1063
- resizeAnchorZone(direction: Direction, step: SelectionStep): DispatchResult;
1067
+ resizeAnchorZone(direction: Direction$1, step: SelectionStep): DispatchResult;
1064
1068
  selectColumn(index: number, mode: SelectionEvent["mode"]): DispatchResult;
1065
1069
  selectRow(index: number, mode: SelectionEvent["mode"]): DispatchResult;
1066
1070
  selectAll(): DispatchResult;
@@ -1479,7 +1483,7 @@ interface ComposerSelection {
1479
1483
  end: number;
1480
1484
  }
1481
1485
  declare class EditionPlugin extends UIPlugin {
1482
- static getters: readonly ["getEditionMode", "isSelectingForComposer", "showSelectionIndicator", "getCurrentContent", "getComposerSelection", "getCurrentTokens", "getTokenAtCursor", "getComposerHighlights", "getCurrentEditedCell", "getCycledReference"];
1486
+ static getters: readonly ["getEditionMode", "isSelectingForComposer", "showSelectionIndicator", "getCurrentContent", "getComposerSelection", "getCurrentTokens", "getTokenAtCursor", "getComposerHighlights", "getCurrentEditedCell", "getCycledReference", "getAutoCompleteDataValidationValues"];
1483
1487
  private col;
1484
1488
  private row;
1485
1489
  private mode;
@@ -1517,6 +1521,7 @@ declare class EditionPlugin extends UIPlugin {
1517
1521
  end: number;
1518
1522
  };
1519
1523
  } | undefined;
1524
+ getInitialComposerContent(): string | undefined;
1520
1525
  private cycleReferences;
1521
1526
  private validateSelection;
1522
1527
  private onColumnsRemoved;
@@ -1534,6 +1539,7 @@ declare class EditionPlugin extends UIPlugin {
1534
1539
  */
1535
1540
  private startEdition;
1536
1541
  private stopEdition;
1542
+ private getCurrentCanonicalContent;
1537
1543
  private cancelEditionAndActivateSheet;
1538
1544
  private getComposerContent;
1539
1545
  private numberComposerContent;
@@ -1574,6 +1580,7 @@ declare class EditionPlugin extends UIPlugin {
1574
1580
  * Return ranges currently referenced in the composer
1575
1581
  */
1576
1582
  getReferencedRanges(): Range[];
1583
+ getAutoCompleteDataValidationValues(): string[];
1577
1584
  /**
1578
1585
  * Function used to determine when composer selection can start.
1579
1586
  * Three conditions are necessary:
@@ -1582,6 +1589,7 @@ declare class EditionPlugin extends UIPlugin {
1582
1589
  * - Previous and next tokens can be separated by spaces
1583
1590
  */
1584
1591
  private canStartComposerRangeSelection;
1592
+ private checkDataValidation;
1585
1593
  }
1586
1594
 
1587
1595
  /**
@@ -1701,11 +1709,11 @@ interface ZoneDependentCommand {
1701
1709
  sheetId: UID;
1702
1710
  zone: Zone;
1703
1711
  }
1704
- 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" | "UPDATE_LOCALE" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1705
- 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" | "UPDATE_LOCALE" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ACTIVATE_SHEET" | "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" | "CANCEL_PAINT_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "EVALUATE_CELLS" | "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" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "SORT_CELLS" | "SET_DECIMAL" | "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" | "REMOVE_DUPLICATES">;
1706
- 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" | "UPDATE_LOCALE" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1707
- 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" | "UPDATE_LOCALE" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ACTIVATE_SHEET" | "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" | "CANCEL_PAINT_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "EVALUATE_CELLS" | "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" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "SORT_CELLS" | "SET_DECIMAL" | "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" | "REMOVE_DUPLICATES">;
1708
- 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" | "UPDATE_LOCALE" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE">;
1712
+ 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" | "CHANGE_CONDITIONAL_FORMAT_PRIORITY" | "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" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ADD_DATA_VALIDATION_RULE" | "REMOVE_DATA_VALIDATION_RULE" | "UPDATE_LOCALE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1713
+ 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" | "CHANGE_CONDITIONAL_FORMAT_PRIORITY" | "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" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ADD_DATA_VALIDATION_RULE" | "REMOVE_DATA_VALIDATION_RULE" | "UPDATE_LOCALE" | "ACTIVATE_SHEET" | "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" | "CANCEL_PAINT_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "EVALUATE_CELLS" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "CANCEL_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" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "SORT_CELLS" | "SET_DECIMAL" | "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" | "REMOVE_DUPLICATES" | "TRIM_WHITESPACE">;
1714
+ 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" | "CHANGE_CONDITIONAL_FORMAT_PRIORITY" | "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" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ADD_DATA_VALIDATION_RULE" | "REMOVE_DATA_VALIDATION_RULE" | "UPDATE_LOCALE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1715
+ 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" | "CHANGE_CONDITIONAL_FORMAT_PRIORITY" | "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" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ADD_DATA_VALIDATION_RULE" | "REMOVE_DATA_VALIDATION_RULE" | "UPDATE_LOCALE" | "ACTIVATE_SHEET" | "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" | "CANCEL_PAINT_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "EVALUATE_CELLS" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "CANCEL_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" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "SORT_CELLS" | "SET_DECIMAL" | "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" | "REMOVE_DUPLICATES" | "TRIM_WHITESPACE">;
1716
+ 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" | "CHANGE_CONDITIONAL_FORMAT_PRIORITY" | "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" | "GROUP_HEADERS" | "UNGROUP_HEADERS" | "UNFOLD_HEADER_GROUP" | "FOLD_HEADER_GROUP" | "FOLD_ALL_HEADER_GROUPS" | "UNFOLD_ALL_HEADER_GROUPS" | "UNFOLD_HEADER_GROUPS_IN_ZONE" | "FOLD_HEADER_GROUPS_IN_ZONE" | "ADD_DATA_VALIDATION_RULE" | "REMOVE_DATA_VALIDATION_RULE" | "UPDATE_LOCALE">;
1709
1717
  interface UpdateCellCommand extends PositionDependentCommand {
1710
1718
  type: "UPDATE_CELL";
1711
1719
  content?: string;
@@ -1837,9 +1845,9 @@ interface RemoveConditionalFormatCommand extends SheetDependentCommand {
1837
1845
  id: string;
1838
1846
  }
1839
1847
  interface MoveConditionalFormatCommand extends SheetDependentCommand {
1840
- type: "MOVE_CONDITIONAL_FORMAT";
1848
+ type: "CHANGE_CONDITIONAL_FORMAT_PRIORITY";
1841
1849
  cfId: UID;
1842
- direction: UpDown;
1850
+ delta: number;
1843
1851
  }
1844
1852
  interface CreateFigureCommand extends SheetDependentCommand {
1845
1853
  type: "CREATE_FIGURE";
@@ -1917,6 +1925,9 @@ interface RemoveDuplicatesCommand {
1917
1925
  columns: HeaderIndex[];
1918
1926
  hasHeader: boolean;
1919
1927
  }
1928
+ interface TrimWhitespaceCommand {
1929
+ type: "TRIM_WHITESPACE";
1930
+ }
1920
1931
  interface GroupHeadersCommand extends SheetDependentCommand {
1921
1932
  type: "GROUP_HEADERS";
1922
1933
  dimension: Dimension;
@@ -1957,13 +1968,19 @@ interface FoldHeaderGroupsInZoneCommand extends ZoneDependentCommand {
1957
1968
  type: "FOLD_HEADER_GROUPS_IN_ZONE";
1958
1969
  dimension: Dimension;
1959
1970
  }
1971
+ interface AddDataValidationCommand extends SheetDependentCommand, RangesDependentCommand {
1972
+ type: "ADD_DATA_VALIDATION_RULE";
1973
+ rule: Omit<DataValidationRule, "ranges">;
1974
+ }
1975
+ interface RemoveDataValidationCommand extends SheetDependentCommand {
1976
+ type: "REMOVE_DATA_VALIDATION_RULE";
1977
+ id: string;
1978
+ }
1960
1979
  interface CopyCommand {
1961
1980
  type: "COPY";
1962
1981
  }
1963
1982
  interface CutCommand {
1964
1983
  type: "CUT";
1965
- /** Zones to cut. If none were given, will copy the zones in the selection*/
1966
- cutTarget?: Zone[];
1967
1984
  }
1968
1985
  interface PasteCommand {
1969
1986
  type: "PASTE";
@@ -2042,7 +2059,9 @@ interface StartEditionCommand {
2042
2059
  }
2043
2060
  interface StopEditionCommand {
2044
2061
  type: "STOP_EDITION";
2045
- cancel?: boolean;
2062
+ }
2063
+ interface CancelEditionCommand {
2064
+ type: "CANCEL_EDITION";
2046
2065
  }
2047
2066
  interface SetCurrentContentCommand {
2048
2067
  type: "SET_CURRENT_CONTENT";
@@ -2305,13 +2324,17 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
2305
2324
  | SetFormattingCommand | ClearFormattingCommand | SetZoneBordersCommand | SetBorderCommand
2306
2325
  /** CHART */
2307
2326
  | CreateChartCommand | UpdateChartCommand
2308
- /** Image */
2327
+ /** IMAGE */
2309
2328
  | CreateImageOverCommand
2310
2329
  /** FILTERS */
2311
- | CreateFilterTableCommand | RemoveFilterTableCommand | UpdateLocaleCommand
2312
- /** Grouping */
2313
- | GroupHeadersCommand | UnGroupHeadersCommand | UnfoldHeaderGroupCommand | FoldHeaderGroupCommand | FoldAllHeaderGroupsCommand | UnfoldAllHeaderGroupsCommand | UnfoldHeaderGroupsInZoneCommand | FoldHeaderGroupsInZoneCommand;
2314
- type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | CancelPaintFormatCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | EvaluateCellsCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand | RemoveDuplicatesCommand;
2330
+ | CreateFilterTableCommand | RemoveFilterTableCommand
2331
+ /** HEADER GROUP */
2332
+ | GroupHeadersCommand | UnGroupHeadersCommand | UnfoldHeaderGroupCommand | FoldHeaderGroupCommand | FoldAllHeaderGroupsCommand | UnfoldAllHeaderGroupsCommand | UnfoldHeaderGroupsInZoneCommand | FoldHeaderGroupsInZoneCommand
2333
+ /** DATA VALIDATION */
2334
+ | AddDataValidationCommand | RemoveDataValidationCommand
2335
+ /** MISC */
2336
+ | UpdateLocaleCommand;
2337
+ type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | CancelPaintFormatCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | EvaluateCellsCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | CancelEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand | RemoveDuplicatesCommand | TrimWhitespaceCommand;
2315
2338
  type Command = CoreCommand | LocalCommand;
2316
2339
  /**
2317
2340
  * Holds the result of a command dispatch.
@@ -2436,7 +2459,12 @@ declare const enum CommandResult {
2436
2459
  DuplicatesColumnsSelected = "DuplicatesColumnsSelected",
2437
2460
  InvalidHeaderGroupStartEnd = "InvalidHeaderGroupStartEnd",
2438
2461
  HeaderGroupAlreadyExists = "HeaderGroupAlreadyExists",
2439
- UnknownHeaderGroup = "UnknownHeaderGroup"
2462
+ UnknownHeaderGroup = "UnknownHeaderGroup",
2463
+ UnknownDataValidationRule = "UnknownDataValidationRule",
2464
+ UnknownDataValidationCriterionType = "UnknownDataValidationCriterionType",
2465
+ InvalidDataValidationCriterionValue = "InvalidDataValidationCriterionValue",
2466
+ InvalidNumberOfCriterionValues = "InvalidNumberOfCriterionValues",
2467
+ BlockingValidationRule = "BlockingValidationRule"
2440
2468
  }
2441
2469
  interface CommandHandler<T> {
2442
2470
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -2707,7 +2735,7 @@ interface HeaderGroup {
2707
2735
  end: HeaderIndex;
2708
2736
  isFolded?: boolean;
2709
2737
  }
2710
- type Direction = "up" | "down" | "left" | "right";
2738
+ type Direction$1 = "up" | "down" | "left" | "right";
2711
2739
  type SelectionStep = number | "end";
2712
2740
 
2713
2741
  type LocaleCode = string & Alias;
@@ -2861,6 +2889,123 @@ interface Currency {
2861
2889
  position: "before" | "after";
2862
2890
  }
2863
2891
 
2892
+ interface DataValidationRule {
2893
+ id: UID;
2894
+ criterion: DataValidationCriterion;
2895
+ ranges: Range[];
2896
+ isBlocking?: boolean;
2897
+ }
2898
+ type TextContainsCriterion = {
2899
+ type: "textContains";
2900
+ values: string[];
2901
+ };
2902
+ type TextNotContainsCriterion = {
2903
+ type: "textNotContains";
2904
+ values: string[];
2905
+ };
2906
+ type TextIsCriterion = {
2907
+ type: "textIs";
2908
+ values: string[];
2909
+ };
2910
+ type TextIsEmailCriterion = {
2911
+ type: "textIsEmail";
2912
+ values: string[];
2913
+ };
2914
+ type TextIsLinkCriterion = {
2915
+ type: "textIsLink";
2916
+ values: string[];
2917
+ };
2918
+ type DateIsCriterion = {
2919
+ type: "dateIs";
2920
+ dateValue: DateCriterionValue;
2921
+ values: string[];
2922
+ };
2923
+ type DateIsBeforeCriterion = {
2924
+ type: "dateIsBefore";
2925
+ dateValue: DateCriterionValue;
2926
+ values: string[];
2927
+ };
2928
+ type DateIsOnOrBeforeCriterion = {
2929
+ type: "dateIsOnOrBefore";
2930
+ dateValue: DateCriterionValue;
2931
+ values: string[];
2932
+ };
2933
+ type DateIsAfterCriterion = {
2934
+ type: "dateIsAfter";
2935
+ dateValue: DateCriterionValue;
2936
+ values: string[];
2937
+ };
2938
+ type DateIsOnOrAfterCriterion = {
2939
+ type: "dateIsOnOrAfter";
2940
+ dateValue: DateCriterionValue;
2941
+ values: string[];
2942
+ };
2943
+ type DateIsBetweenCriterion = {
2944
+ type: "dateIsBetween";
2945
+ values: string[];
2946
+ };
2947
+ type DateIsNotBetweenCriterion = {
2948
+ type: "dateIsNotBetween";
2949
+ values: string[];
2950
+ };
2951
+ type DateIsValidCriterion = {
2952
+ type: "dateIsValid";
2953
+ values: string[];
2954
+ };
2955
+ type IsEqualCriterion = {
2956
+ type: "isEqual";
2957
+ values: string[];
2958
+ };
2959
+ type IsNotEqualCriterion = {
2960
+ type: "isNotEqual";
2961
+ values: string[];
2962
+ };
2963
+ type IsGreaterThanCriterion = {
2964
+ type: "isGreaterThan";
2965
+ values: string[];
2966
+ };
2967
+ type IsGreaterOrEqualToCriterion = {
2968
+ type: "isGreaterOrEqualTo";
2969
+ values: string[];
2970
+ };
2971
+ type IsLessThanCriterion = {
2972
+ type: "isLessThan";
2973
+ values: string[];
2974
+ };
2975
+ type IsLessOrEqualToCriterion = {
2976
+ type: "isLessOrEqualTo";
2977
+ values: string[];
2978
+ };
2979
+ type IsBetweenCriterion = {
2980
+ type: "isBetween";
2981
+ values: string[];
2982
+ };
2983
+ type IsNotBetweenCriterion = {
2984
+ type: "isNotBetween";
2985
+ values: string[];
2986
+ };
2987
+ type IsCheckboxCriterion = {
2988
+ type: "isBoolean";
2989
+ values: string[];
2990
+ };
2991
+ type IsValueInListCriterion = {
2992
+ type: "isValueInList";
2993
+ values: string[];
2994
+ displayStyle: "arrow" | "plainText";
2995
+ };
2996
+ type IsValueInRangeCriterion = {
2997
+ type: "isValueInRange";
2998
+ values: string[];
2999
+ displayStyle: "arrow" | "plainText";
3000
+ };
3001
+ type CustomFormulaCriterion = {
3002
+ type: "customFormula";
3003
+ values: string[];
3004
+ };
3005
+ type DataValidationCriterion = TextContainsCriterion | TextNotContainsCriterion | TextIsCriterion | TextIsEmailCriterion | TextIsLinkCriterion | IsBetweenCriterion | DateIsCriterion | DateIsBeforeCriterion | DateIsOnOrBeforeCriterion | DateIsAfterCriterion | DateIsOnOrAfterCriterion | DateIsBetweenCriterion | DateIsNotBetweenCriterion | DateIsValidCriterion | IsEqualCriterion | IsNotEqualCriterion | IsGreaterThanCriterion | IsGreaterOrEqualToCriterion | IsLessThanCriterion | IsLessOrEqualToCriterion | IsNotBetweenCriterion | IsCheckboxCriterion | IsValueInListCriterion | IsValueInRangeCriterion | CustomFormulaCriterion;
3006
+ type DateCriterionValue = "today" | "tomorrow" | "yesterday" | "lastWeek" | "lastMonth" | "lastYear" | "exactDate";
3007
+ type DataValidationCriterionType = DataValidationCriterion["type"];
3008
+
2864
3009
  type ClipboardReadResult = {
2865
3010
  status: "ok";
2866
3011
  content: string;
@@ -2873,10 +3018,6 @@ interface ClipboardInterface {
2873
3018
  readText(): Promise<ClipboardReadResult>;
2874
3019
  }
2875
3020
 
2876
- interface EditTextOptions {
2877
- error?: string;
2878
- placeholder?: string;
2879
- }
2880
3021
  type NotificationType = "danger" | "info" | "success" | "warning";
2881
3022
  interface InformationNotification {
2882
3023
  text: string;
@@ -2887,7 +3028,6 @@ interface SpreadsheetEnv {
2887
3028
  notifyUser: (notification: InformationNotification) => any;
2888
3029
  raiseError: (text: string, callback?: () => void) => any;
2889
3030
  askConfirmation: (content: string, confirm: () => any, cancel?: () => any) => any;
2890
- editText: (title: string, callback: (text: string | null) => any, options?: EditTextOptions) => any;
2891
3031
  }
2892
3032
  interface SpreadsheetChildEnv extends SpreadsheetEnv {
2893
3033
  model: Model;
@@ -2896,7 +3036,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
2896
3036
  openSidePanel: (panel: string, panelProps?: any) => void;
2897
3037
  toggleSidePanel: (panel: string, panelProps?: any) => void;
2898
3038
  clipboard: ClipboardInterface;
2899
- startCellEdition: (content: string) => void;
3039
+ startCellEdition: (content?: string) => void;
2900
3040
  loadCurrencies?: () => Promise<Currency[]>;
2901
3041
  loadLocales: () => Promise<Locale[]>;
2902
3042
  }
@@ -3198,6 +3338,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3198
3338
  [key: number]: Format;
3199
3339
  }): Cell;
3200
3340
  exportForExcel(data: ExcelWorkbookData): void;
3341
+ private removeDefaultStyleValues;
3201
3342
  getCells(sheetId: UID): Record<UID, Cell>;
3202
3343
  /**
3203
3344
  * get a cell by ID. Used in evaluation when evaluating an async cell, we need to be able to find it back after
@@ -3377,7 +3518,7 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
3377
3518
  * Add or replace a conditional format rule
3378
3519
  */
3379
3520
  private addConditionalFormatting;
3380
- private checkValidReordering;
3521
+ private checkValidPriorityChange;
3381
3522
  private checkEmptyRange;
3382
3523
  private checkCFRule;
3383
3524
  private checkOperatorArgsNumber;
@@ -3390,7 +3531,36 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
3390
3531
  private checkMidBiggerThanMax;
3391
3532
  private checkMinBiggerThanMid;
3392
3533
  private removeConditionalFormatting;
3393
- private reorderConditionalFormatting;
3534
+ private changeCFPriority;
3535
+ }
3536
+
3537
+ interface DataValidationState {
3538
+ readonly rules: {
3539
+ [sheet: string]: DataValidationRule[];
3540
+ };
3541
+ }
3542
+ declare class DataValidationPlugin extends CorePlugin<DataValidationState> implements DataValidationState {
3543
+ static getters: readonly ["cellHasListDataValidationIcon", "getDataValidationRule", "getDataValidationRules", "getValidationRuleForCell"];
3544
+ readonly rules: {
3545
+ [sheet: string]: DataValidationRule[];
3546
+ };
3547
+ adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
3548
+ private loopThroughRangesOfSheet;
3549
+ allowDispatch(cmd: Command): CommandResult | CommandResult[];
3550
+ handle(cmd: CoreCommand): void;
3551
+ getDataValidationRules(sheetId: UID): DataValidationRule[];
3552
+ getDataValidationRule(sheetId: UID, id: UID): DataValidationRule | undefined;
3553
+ getValidationRuleForCell({ sheetId, col, row }: CellPosition): DataValidationRule | undefined;
3554
+ cellHasListDataValidationIcon(cellPosition: CellPosition): boolean;
3555
+ private addDataValidationRule;
3556
+ private removeRangesFromRules;
3557
+ private removeDataValidationRule;
3558
+ private setCenterStyleToBooleanCells;
3559
+ import(data: WorkbookData): void;
3560
+ export(data: Partial<WorkbookData>): void;
3561
+ private checkCriterionTypeIsValid;
3562
+ private checkCriterionHasValidNumberOfValues;
3563
+ private checkCriterionValuesAreValid;
3394
3564
  }
3395
3565
 
3396
3566
  interface FigureState {
@@ -3481,10 +3651,10 @@ declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersS
3481
3651
  exportForExcel(data: ExcelWorkbookData): void;
3482
3652
  }
3483
3653
 
3484
- interface State$6 {
3654
+ interface State$7 {
3485
3655
  groups: Record<UID, Record<Dimension, HeaderGroup[]>>;
3486
3656
  }
3487
- declare class HeaderGroupingPlugin extends CorePlugin<State$6> {
3657
+ declare class HeaderGroupingPlugin extends CorePlugin<State$7> {
3488
3658
  static getters: readonly ["getHeaderGroups", "getGroupsLayers", "getVisibleGroupLayers", "getHeaderGroup", "getHeaderGroupsInZone", "isGroupFolded", "isRowFolded", "isColFolded"];
3489
3659
  private readonly groups;
3490
3660
  allowDispatch(cmd: CoreCommand): CommandResult;
@@ -3632,7 +3802,7 @@ interface MergeState {
3632
3802
  readonly mergeCellMap: Record<UID, SheetMergeCellMap | undefined>;
3633
3803
  }
3634
3804
  declare class MergePlugin extends CorePlugin<MergeState> implements MergeState {
3635
- static getters: readonly ["isInMerge", "isInSameMerge", "isMergeHidden", "getMainCellPosition", "getBottomLeftCell", "expandZone", "doesIntersectMerge", "doesColumnsHaveCommonMerges", "doesRowsHaveCommonMerges", "getMerges", "getMerge", "getMergesInZone", "isSingleCellOrMerge", "getSelectionRangeString"];
3805
+ static getters: readonly ["isInMerge", "isInSameMerge", "isMergeHidden", "getMainCellPosition", "getBottomLeftCell", "expandZone", "doesIntersectMerge", "doesColumnsHaveCommonMerges", "doesRowsHaveCommonMerges", "getMerges", "getMerge", "getMergesInZone", "isSingleCellOrMerge", "getSelectionRangeString", "isMainCellPosition"];
3636
3806
  private nextId;
3637
3807
  readonly merges: Record<UID, Record<number, Range | undefined> | undefined>;
3638
3808
  readonly mergeCellMap: Record<UID, SheetMergeCellMap | undefined>;
@@ -3672,6 +3842,7 @@ declare class MergePlugin extends CorePlugin<MergeState> implements MergeState {
3672
3842
  * Check if the zone represents a single cell or a single merge.
3673
3843
  */
3674
3844
  isSingleCellOrMerge(sheetId: UID, zone: Zone): boolean;
3845
+ isMainCellPosition(position: CellPosition): boolean;
3675
3846
  /**
3676
3847
  * Return true if the current selection requires losing state if it is merged.
3677
3848
  * This happens when there is some textual content in other cells than the
@@ -3716,13 +3887,13 @@ declare class SettingsPlugin extends CorePlugin {
3716
3887
  export(data: WorkbookData): void;
3717
3888
  }
3718
3889
 
3719
- interface SheetState$1 {
3890
+ interface SheetState {
3720
3891
  readonly sheets: Record<UID, Sheet | undefined>;
3721
3892
  readonly orderedSheetIds: UID[];
3722
3893
  readonly sheetIdsMapName: Record<string, UID | undefined>;
3723
3894
  readonly cellPosition: Record<UID, CellPosition | undefined>;
3724
3895
  }
3725
- declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState$1 {
3896
+ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
3726
3897
  static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "doesHeadersExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
3727
3898
  readonly sheetIdsMapName: Record<string, UID | undefined>;
3728
3899
  readonly orderedSheetIds: UID[];
@@ -3993,6 +4164,43 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3993
4164
  private rulePredicate;
3994
4165
  }
3995
4166
 
4167
+ interface InvalidValidationResult {
4168
+ readonly isValid: false;
4169
+ readonly rule: DataValidationRule;
4170
+ readonly error: string;
4171
+ }
4172
+ interface ValidValidationResult {
4173
+ readonly isValid: true;
4174
+ }
4175
+ type ValidationResult = ValidValidationResult | InvalidValidationResult;
4176
+ type SheetValidationResult = {
4177
+ [col: HeaderIndex]: Array<Lazy<ValidationResult>>;
4178
+ };
4179
+ declare class EvaluationDataValidationPlugin extends UIPlugin {
4180
+ static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getDataValidationCheckBoxCellPositions", "getDataValidationListCellsPositions", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
4181
+ validationResults: Record<UID, SheetValidationResult>;
4182
+ handle(cmd: CoreViewCommand): void;
4183
+ isDataValidationInvalid(cellPosition: CellPosition): boolean;
4184
+ getInvalidDataValidationMessage(cellPosition: CellPosition): string | undefined;
4185
+ /**
4186
+ * Check if the value is valid for the given criterion, and return an error message if not.
4187
+ *
4188
+ * The value must be canonicalized.
4189
+ */
4190
+ getDataValidationInvalidCriterionValueMessage(criterionType: DataValidationCriterionType, value: string): string | undefined;
4191
+ isCellValidCheckbox(cellPosition: CellPosition): boolean;
4192
+ /** Get the validation result if the cell on the given position had the given value */
4193
+ getValidationResultForCellValue(cellValue: CellValue, cellPosition: CellPosition): ValidationResult;
4194
+ getDataValidationCheckBoxCellPositions(): CellPosition[];
4195
+ getDataValidationListCellsPositions(): CellPosition[];
4196
+ private getValidationResultForCell;
4197
+ private computeSheetValidationResults;
4198
+ private getRuleErrorForCellValue;
4199
+ /** Get the offset of the cell inside the ranges of the rule. Throws an error if the cell isn't inside the rule. */
4200
+ private getCellOffsetInRule;
4201
+ private getEvaluatedCriterionValues;
4202
+ }
4203
+
3996
4204
  interface HeaderSizeState {
3997
4205
  tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
3998
4206
  }
@@ -4070,6 +4278,7 @@ declare class AutofillPlugin extends UIPlugin {
4070
4278
  private getDirection;
4071
4279
  private autoFillMerge;
4072
4280
  private autofillCF;
4281
+ private autofillDV;
4073
4282
  drawGrid(renderingContext: GridRenderingContext): void;
4074
4283
  }
4075
4284
 
@@ -4516,7 +4725,7 @@ declare class UIOptionsPlugin extends UIPlugin {
4516
4725
  }
4517
4726
 
4518
4727
  declare class SheetUIPlugin extends UIPlugin {
4519
- static getters: readonly ["getCellWidth", "getTextWidth", "getCellText", "getCellMultiLineText", "getColDimensions", "getRowDimensions", "getColRowOffset"];
4728
+ static getters: readonly ["doesCellHaveGridIcon", "getCellWidth", "getTextWidth", "getCellText", "getCellMultiLineText", "getColDimensions", "getRowDimensions", "getColRowOffset"];
4520
4729
  private ctx;
4521
4730
  allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
4522
4731
  handle(cmd: Command): void;
@@ -4544,6 +4753,7 @@ declare class SheetUIPlugin extends UIPlugin {
4544
4753
  * i.e. The size from A to B is the distance between A.start and B.end
4545
4754
  */
4546
4755
  getColRowOffset(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex, sheetId?: UID): Pixel;
4756
+ doesCellHaveGridIcon(position: CellPosition): boolean;
4547
4757
  private getColMaxWidth;
4548
4758
  /**
4549
4759
  * Check that any "sheetId" in the command matches an existing
@@ -4977,7 +5187,8 @@ type LocalHistoryGetters = Pick<HistoryPlugin, GetterNames<typeof HistoryPlugin>
4977
5187
  type FiltersGetters = Pick<FiltersPlugin, GetterNames<typeof FiltersPlugin>>;
4978
5188
  type SettingsGetters = Pick<SettingsPlugin, GetterNames<typeof SettingsPlugin>>;
4979
5189
  type HeaderGroupingGetters = Pick<HeaderGroupingPlugin, GetterNames<typeof HeaderGroupingPlugin>>;
4980
- type CoreGetters = SheetGetters & HeaderSizeGetters & HeaderVisibilityGetters & CellGetters & MergeGetters & BordersGetters & ChartGetters & ImageGetters & ConditionalFormatGetters & FigureGetters & RangeAdapterGetters & FiltersGetters & SettingsGetters & HeaderGroupingGetters;
5190
+ type DataValidationGetters = Pick<DataValidationPlugin, GetterNames<typeof DataValidationPlugin>>;
5191
+ type CoreGetters = SheetGetters & HeaderSizeGetters & HeaderVisibilityGetters & CellGetters & MergeGetters & BordersGetters & ChartGetters & ImageGetters & ConditionalFormatGetters & FigureGetters & RangeAdapterGetters & FiltersGetters & SettingsGetters & HeaderGroupingGetters & DataValidationGetters;
4981
5192
  type AutofillGetters = Pick<AutofillPlugin, GetterNames<typeof AutofillPlugin>>;
4982
5193
  type AutomaticSumGetters = Pick<AutomaticSumPlugin, GetterNames<typeof AutomaticSumPlugin>>;
4983
5194
  type ClipboardGetters = Pick<ClipboardPlugin, GetterNames<typeof ClipboardPlugin>>;
@@ -5001,10 +5212,11 @@ type CellPopoverPluginGetters = Pick<CellPopoverPlugin, GetterNames<typeof CellP
5001
5212
  type FilterEvaluationGetters = Pick<FilterEvaluationPlugin, GetterNames<typeof FilterEvaluationPlugin>>;
5002
5213
  type SplitToColumnsGetters = Pick<SplitToColumnsPlugin, GetterNames<typeof SplitToColumnsPlugin>>;
5003
5214
  type UIRowSizeGetters = Pick<UIRowSizePlugin, GetterNames<typeof UIRowSizePlugin>>;
5215
+ type EvaluationDataValidationPluginGetters = Pick<EvaluationDataValidationPlugin, GetterNames<typeof EvaluationDataValidationPlugin>>;
5004
5216
  type Getters = {
5005
5217
  isReadonly: () => boolean;
5006
5218
  isDashboard: () => boolean;
5007
- } & LocalHistoryGetters & CoreGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & CollaborativeGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters & SplitToColumnsGetters & UIRowSizeGetters;
5219
+ } & LocalHistoryGetters & CoreGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & CollaborativeGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters & SplitToColumnsGetters & UIRowSizeGetters & EvaluationDataValidationPluginGetters;
5008
5220
 
5009
5221
  interface HistoryChange {
5010
5222
  root: any;
@@ -5183,7 +5395,7 @@ interface ChartBuilder {
5183
5395
  sequence: number;
5184
5396
  }
5185
5397
 
5186
- interface Props$H {
5398
+ interface Props$K {
5187
5399
  ranges: () => string[];
5188
5400
  hasSingleRange?: boolean;
5189
5401
  required?: boolean;
@@ -5205,7 +5417,7 @@ interface SelectionRange extends Omit<RangeInputValue, "color"> {
5205
5417
  * onSelectionChanged is called every time the input value
5206
5418
  * changes.
5207
5419
  */
5208
- declare class SelectionInput extends Component<Props$H, SpreadsheetChildEnv> {
5420
+ declare class SelectionInput extends Component<Props$K, SpreadsheetChildEnv> {
5209
5421
  static template: string;
5210
5422
  private id;
5211
5423
  private previousRanges;
@@ -5234,26 +5446,26 @@ declare class SelectionInput extends Component<Props$H, SpreadsheetChildEnv> {
5234
5446
  confirm(): void;
5235
5447
  }
5236
5448
 
5237
- interface Props$G {
5449
+ interface Props$J {
5238
5450
  messages: string[];
5239
5451
  msgType: "warning" | "error";
5240
5452
  }
5241
- declare class SidePanelErrors extends Component<Props$G, SpreadsheetChildEnv> {
5453
+ declare class ValidationMessages extends Component<Props$J, SpreadsheetChildEnv> {
5242
5454
  static template: string;
5243
- get divClasses(): "o-sidepanel-warning text-warning" | "o-sidepanel-error text-danger";
5455
+ get divClasses(): "o-validation-warning text-warning" | "o-validation-error text-danger";
5244
5456
  }
5245
5457
 
5246
- interface Props$F {
5458
+ interface Props$I {
5247
5459
  figureId: UID;
5248
5460
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5249
5461
  canUpdateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5250
5462
  updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5251
5463
  }
5252
- declare class LineBarPieConfigPanel extends Component<Props$F, SpreadsheetChildEnv> {
5464
+ declare class LineBarPieConfigPanel extends Component<Props$I, SpreadsheetChildEnv> {
5253
5465
  static template: string;
5254
5466
  static components: {
5255
5467
  SelectionInput: typeof SelectionInput;
5256
- SidePanelErrors: typeof SidePanelErrors;
5468
+ ValidationMessages: typeof ValidationMessages;
5257
5469
  };
5258
5470
  private state;
5259
5471
  private dataSeriesRanges;
@@ -5378,7 +5590,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5378
5590
  isSameColor(color1: Color, color2: Color): boolean;
5379
5591
  }
5380
5592
 
5381
- interface Props$E {
5593
+ interface Props$H {
5382
5594
  currentColor: string | undefined;
5383
5595
  toggleColorPicker: () => void;
5384
5596
  showColorPicker: boolean;
@@ -5389,7 +5601,7 @@ interface Props$E {
5389
5601
  dropdownMaxHeight?: Pixel;
5390
5602
  class?: string;
5391
5603
  }
5392
- declare class ColorPickerWidget extends Component<Props$E, SpreadsheetChildEnv> {
5604
+ declare class ColorPickerWidget extends Component<Props$H, SpreadsheetChildEnv> {
5393
5605
  static template: string;
5394
5606
  static components: {
5395
5607
  ColorPicker: typeof ColorPicker;
@@ -5401,13 +5613,13 @@ declare class ColorPickerWidget extends Component<Props$E, SpreadsheetChildEnv>
5401
5613
  get colorPickerAnchorRect(): Rect;
5402
5614
  }
5403
5615
 
5404
- interface Props$D {
5616
+ interface Props$G {
5405
5617
  figureId: UID;
5406
5618
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5407
5619
  canUpdateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5408
5620
  updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5409
5621
  }
5410
- declare class LineBarPieDesignPanel extends Component<Props$D, SpreadsheetChildEnv> {
5622
+ declare class LineBarPieDesignPanel extends Component<Props$G, SpreadsheetChildEnv> {
5411
5623
  static template: string;
5412
5624
  static components: {
5413
5625
  ColorPickerWidget: typeof ColorPickerWidget;
@@ -5421,17 +5633,17 @@ declare class LineBarPieDesignPanel extends Component<Props$D, SpreadsheetChildE
5421
5633
  updateSelect(attr: string, ev: any): void;
5422
5634
  }
5423
5635
 
5424
- interface Props$C {
5636
+ interface Props$F {
5425
5637
  figureId: UID;
5426
5638
  definition: GaugeChartDefinition;
5427
5639
  canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5428
5640
  updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5429
5641
  }
5430
- declare class GaugeChartConfigPanel extends Component<Props$C, SpreadsheetChildEnv> {
5642
+ declare class GaugeChartConfigPanel extends Component<Props$F, SpreadsheetChildEnv> {
5431
5643
  static template: string;
5432
5644
  static components: {
5433
5645
  SelectionInput: typeof SelectionInput;
5434
- SidePanelErrors: typeof SidePanelErrors;
5646
+ ValidationMessages: typeof ValidationMessages;
5435
5647
  };
5436
5648
  private state;
5437
5649
  private dataRange;
@@ -5443,17 +5655,17 @@ declare class GaugeChartConfigPanel extends Component<Props$C, SpreadsheetChildE
5443
5655
  }
5444
5656
 
5445
5657
  type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectionColor-middleColor" | "sectionColor-upperColor";
5446
- interface Props$B {
5658
+ interface Props$E {
5447
5659
  figureId: UID;
5448
5660
  definition: GaugeChartDefinition;
5449
5661
  canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5450
5662
  updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5451
5663
  }
5452
- declare class GaugeChartDesignPanel extends Component<Props$B, SpreadsheetChildEnv> {
5664
+ declare class GaugeChartDesignPanel extends Component<Props$E, SpreadsheetChildEnv> {
5453
5665
  static template: string;
5454
5666
  static components: {
5455
5667
  ColorPickerWidget: typeof ColorPickerWidget;
5456
- SidePanelErrors: typeof SidePanelErrors;
5668
+ ValidationMessages: typeof ValidationMessages;
5457
5669
  };
5458
5670
  private state;
5459
5671
  setup(): void;
@@ -5480,17 +5692,17 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
5480
5692
  onUpdateCumulative(ev: any): void;
5481
5693
  }
5482
5694
 
5483
- interface Props$A {
5695
+ interface Props$D {
5484
5696
  figureId: UID;
5485
5697
  definition: ScorecardChartDefinition;
5486
5698
  canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5487
5699
  updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5488
5700
  }
5489
- declare class ScorecardChartConfigPanel extends Component<Props$A, SpreadsheetChildEnv> {
5701
+ declare class ScorecardChartConfigPanel extends Component<Props$D, SpreadsheetChildEnv> {
5490
5702
  static template: string;
5491
5703
  static components: {
5492
5704
  SelectionInput: typeof SelectionInput;
5493
- SidePanelErrors: typeof SidePanelErrors;
5705
+ ValidationMessages: typeof ValidationMessages;
5494
5706
  };
5495
5707
  private state;
5496
5708
  private keyValue;
@@ -5508,13 +5720,13 @@ declare class ScorecardChartConfigPanel extends Component<Props$A, SpreadsheetCh
5508
5720
  }
5509
5721
 
5510
5722
  type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" | "baselineColorDown";
5511
- interface Props$z {
5723
+ interface Props$C {
5512
5724
  figureId: UID;
5513
5725
  definition: ScorecardChartDefinition;
5514
5726
  canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5515
5727
  updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5516
5728
  }
5517
- declare class ScorecardChartDesignPanel extends Component<Props$z, SpreadsheetChildEnv> {
5729
+ declare class ScorecardChartDesignPanel extends Component<Props$C, SpreadsheetChildEnv> {
5518
5730
  static template: string;
5519
5731
  static components: {
5520
5732
  ColorPickerWidget: typeof ColorPickerWidget;
@@ -5658,10 +5870,10 @@ interface AutofillRule {
5658
5870
  sequence: number;
5659
5871
  }
5660
5872
 
5661
- interface Props$y {
5873
+ interface Props$B {
5662
5874
  figure: Figure;
5663
5875
  }
5664
- declare class ChartJsComponent extends Component<Props$y, SpreadsheetChildEnv> {
5876
+ declare class ChartJsComponent extends Component<Props$B, SpreadsheetChildEnv> {
5665
5877
  static template: string;
5666
5878
  private canvas;
5667
5879
  private chart?;
@@ -5673,10 +5885,10 @@ declare class ChartJsComponent extends Component<Props$y, SpreadsheetChildEnv> {
5673
5885
  private updateChartJs;
5674
5886
  }
5675
5887
 
5676
- interface Props$x {
5888
+ interface Props$A {
5677
5889
  figure: Figure;
5678
5890
  }
5679
- declare class ScorecardChart extends Component<Props$x, SpreadsheetChildEnv> {
5891
+ declare class ScorecardChart extends Component<Props$A, SpreadsheetChildEnv> {
5680
5892
  static template: string;
5681
5893
  private ctx;
5682
5894
  get runtime(): ScorecardChartRuntime;
@@ -5709,7 +5921,7 @@ declare class ScorecardChart extends Component<Props$x, SpreadsheetChildEnv> {
5709
5921
  }
5710
5922
 
5711
5923
  type MenuItemOrSeparator = Action | "separator";
5712
- interface Props$w {
5924
+ interface Props$z {
5713
5925
  position: DOMCoordinates;
5714
5926
  menuItems: Action[];
5715
5927
  depth: number;
@@ -5725,7 +5937,7 @@ interface MenuState {
5725
5937
  scrollOffset?: Pixel;
5726
5938
  menuItems: Action[];
5727
5939
  }
5728
- declare class Menu extends Component<Props$w, SpreadsheetChildEnv> {
5940
+ declare class Menu extends Component<Props$z, SpreadsheetChildEnv> {
5729
5941
  static template: string;
5730
5942
  static components: {
5731
5943
  Menu: typeof Menu;
@@ -5763,14 +5975,14 @@ declare class Menu extends Component<Props$w, SpreadsheetChildEnv> {
5763
5975
  }
5764
5976
 
5765
5977
  type ResizeAnchor = "top left" | "top" | "top right" | "right" | "bottom right" | "bottom" | "bottom left" | "left";
5766
- interface Props$v {
5978
+ interface Props$y {
5767
5979
  figure: Figure;
5768
5980
  style: string;
5769
5981
  onFigureDeleted: () => void;
5770
5982
  onMouseDown: (ev: MouseEvent) => void;
5771
5983
  onClickAnchor(dirX: ResizeDirection, dirY: ResizeDirection, ev: MouseEvent): void;
5772
5984
  }
5773
- declare class FigureComponent extends Component<Props$v, SpreadsheetChildEnv> {
5985
+ declare class FigureComponent extends Component<Props$y, SpreadsheetChildEnv> {
5774
5986
  static template: string;
5775
5987
  static components: {
5776
5988
  Menu: typeof Menu;
@@ -5800,11 +6012,11 @@ declare class FigureComponent extends Component<Props$v, SpreadsheetChildEnv> {
5800
6012
  private openContextMenu;
5801
6013
  }
5802
6014
 
5803
- interface Props$u {
6015
+ interface Props$x {
5804
6016
  figure: Figure;
5805
6017
  onFigureDeleted: () => void;
5806
6018
  }
5807
- declare class ChartFigure extends Component<Props$u, SpreadsheetChildEnv> {
6019
+ declare class ChartFigure extends Component<Props$x, SpreadsheetChildEnv> {
5808
6020
  static template: string;
5809
6021
  static components: {};
5810
6022
  onDoubleClick(): void;
@@ -5812,7 +6024,7 @@ declare class ChartFigure extends Component<Props$u, SpreadsheetChildEnv> {
5812
6024
  get chartComponent(): new (...args: any) => Component;
5813
6025
  }
5814
6026
 
5815
- interface Props$t {
6027
+ interface Props$w {
5816
6028
  isVisible: boolean;
5817
6029
  position: Position;
5818
6030
  }
@@ -5820,13 +6032,13 @@ interface Position {
5820
6032
  top: HeaderIndex;
5821
6033
  left: HeaderIndex;
5822
6034
  }
5823
- interface State$5 {
6035
+ interface State$6 {
5824
6036
  position: Position;
5825
6037
  handler: boolean;
5826
6038
  }
5827
- declare class Autofill extends Component<Props$t, SpreadsheetChildEnv> {
6039
+ declare class Autofill extends Component<Props$w, SpreadsheetChildEnv> {
5828
6040
  static template: string;
5829
- state: State$5;
6041
+ state: State$6;
5830
6042
  get style(): string;
5831
6043
  get handlerStyle(): string;
5832
6044
  get styleNextValue(): string;
@@ -5898,13 +6110,13 @@ declare class Ripple extends Component<RippleProps, SpreadsheetChildEnv> {
5898
6110
  getRippleEffectProps(id: number): RippleEffectProps;
5899
6111
  }
5900
6112
 
5901
- interface Props$s {
6113
+ interface Props$v {
5902
6114
  sheetId: string;
5903
6115
  openContextMenu: (registry: MenuItemRegistry, ev: MouseEvent) => void;
5904
6116
  style?: string;
5905
6117
  onMouseDown: (ev: MouseEvent) => void;
5906
6118
  }
5907
- declare class BottomBarSheet extends Component<Props$s, SpreadsheetChildEnv> {
6119
+ declare class BottomBarSheet extends Component<Props$v, SpreadsheetChildEnv> {
5908
6120
  static template: string;
5909
6121
  static components: {
5910
6122
  Ripple: typeof Ripple;
@@ -5938,11 +6150,11 @@ declare class BottomBarSheet extends Component<Props$s, SpreadsheetChildEnv> {
5938
6150
  get sheetName(): string;
5939
6151
  }
5940
6152
 
5941
- interface Props$r {
6153
+ interface Props$u {
5942
6154
  openContextMenu: (x: number, y: number, registry: MenuItemRegistry) => void;
5943
6155
  closeContextMenu: () => void;
5944
6156
  }
5945
- declare class BottomBarStatistic extends Component<Props$r, SpreadsheetChildEnv> {
6157
+ declare class BottomBarStatistic extends Component<Props$u, SpreadsheetChildEnv> {
5946
6158
  static template: string;
5947
6159
  static components: {
5948
6160
  Ripple: typeof Ripple;
@@ -5959,18 +6171,13 @@ interface BottomBarSheetItem {
5959
6171
  id: UID;
5960
6172
  name: string;
5961
6173
  }
5962
- interface SheetState {
5963
- sheetList: BottomBarSheetItem[];
5964
- isDnd: boolean;
5965
- sheetDndPositions: Record<UID, number> | undefined;
5966
- }
5967
- interface Props$q {
6174
+ interface Props$t {
5968
6175
  onClick: () => void;
5969
6176
  }
5970
6177
  interface BottomBarMenuState extends MenuState {
5971
6178
  menuId: UID | undefined;
5972
6179
  }
5973
- declare class BottomBar extends Component<Props$q, SpreadsheetChildEnv> {
6180
+ declare class BottomBar extends Component<Props$t, SpreadsheetChildEnv> {
5974
6181
  static template: string;
5975
6182
  static components: {
5976
6183
  Menu: typeof Menu;
@@ -5980,17 +6187,15 @@ declare class BottomBar extends Component<Props$q, SpreadsheetChildEnv> {
5980
6187
  };
5981
6188
  private bottomBarRef;
5982
6189
  private sheetListRef;
5983
- private dndHelper;
6190
+ private dragAndDrop;
5984
6191
  private targetScroll;
5985
6192
  private state;
5986
6193
  menuMaxHeight: number;
5987
6194
  menuState: BottomBarMenuState;
5988
- sheetState: SheetState;
6195
+ sheetList: BottomBarSheetItem[];
5989
6196
  setup(): void;
5990
- isDragged(sheetId: UID): boolean;
5991
6197
  clickAddSheet(ev: MouseEvent): void;
5992
- private getVisibleSheets;
5993
- getSheets(): BottomBarSheetItem[];
6198
+ getVisibleSheets(): BottomBarSheetItem[];
5994
6199
  clickListSheets(ev: MouseEvent): void;
5995
6200
  openContextMenu(x: Pixel, y: Pixel, menuId: UID, registry: MenuItemRegistry): void;
5996
6201
  onSheetContextMenu(sheetId: UID, registry: MenuItemRegistry, ev: MenuMouseEvent): void;
@@ -6005,32 +6210,44 @@ declare class BottomBar extends Component<Props$q, SpreadsheetChildEnv> {
6005
6210
  onSheetMouseDown(sheetId: UID, event: MouseEvent): void;
6006
6211
  private onDragEnd;
6007
6212
  getSheetStyle(sheetId: UID): string;
6008
- private stopDragging;
6009
6213
  private getSheetItemRects;
6010
- getSheetClasses(sheetId: UID): string;
6011
6214
  get sheetListCurrentScroll(): number;
6012
6215
  get sheetListWidth(): number;
6013
6216
  get sheetListMaxScroll(): number;
6014
6217
  }
6015
6218
 
6016
- interface Props$p {
6017
- position: DOMCoordinates;
6018
- isActive: boolean;
6019
- onClick: () => void;
6219
+ interface GridCellIconProps {
6220
+ cellPosition: CellPosition;
6221
+ horizontalAlign?: Align;
6222
+ verticalAlign?: VerticalAlign;
6223
+ offset?: DOMCoordinates;
6020
6224
  }
6021
- declare class FilterIcon extends Component<Props$p, SpreadsheetEnv> {
6225
+ declare class GridCellIcon extends Component<GridCellIconProps, SpreadsheetChildEnv> {
6022
6226
  static style: string;
6023
6227
  static template: string;
6024
- get style(): string;
6228
+ get iconStyle(): string;
6229
+ private getIconVerticalPosition;
6230
+ private getIconHorizontalPosition;
6231
+ isPositionVisible(position: CellPosition): boolean;
6025
6232
  }
6026
6233
 
6027
- interface Props$o {
6028
- gridPosition: DOMCoordinates;
6234
+ interface Props$s {
6235
+ cellPosition: CellPosition;
6029
6236
  }
6030
- declare class FilterIconsOverlay extends Component<Props$o, SpreadsheetChildEnv> {
6237
+ declare class FilterIcon extends Component<Props$s, SpreadsheetChildEnv> {
6031
6238
  static style: string;
6239
+ static template: string;
6240
+ onClick(): void;
6241
+ get isFilterActive(): boolean;
6242
+ }
6243
+
6244
+ interface Props$r {
6245
+ gridPosition: DOMCoordinates;
6246
+ }
6247
+ declare class FilterIconsOverlay extends Component<Props$r, SpreadsheetChildEnv> {
6032
6248
  static template: string;
6033
6249
  static components: {
6250
+ GridCellIcon: typeof GridCellIcon;
6034
6251
  FilterIcon: typeof FilterIcon;
6035
6252
  };
6036
6253
  static defaultProps: {
@@ -6039,12 +6256,36 @@ declare class FilterIconsOverlay extends Component<Props$o, SpreadsheetChildEnv>
6039
6256
  y: number;
6040
6257
  };
6041
6258
  };
6042
- getVisibleFilterHeaders(): Position$1[];
6043
- getFilterHeaderPosition(position: Position$1): DOMCoordinates;
6044
- private getIconVerticalPosition;
6045
- isFilterActive(position: Position$1): boolean;
6046
- toggleFilterMenu(position: Position$1): void;
6047
- private isPositionVisible;
6259
+ getFilterHeadersPositions(): CellPosition[];
6260
+ }
6261
+
6262
+ interface Props$q {
6263
+ cellPosition: CellPosition;
6264
+ }
6265
+ declare class DataValidationCheckbox extends Component<Props$q, SpreadsheetChildEnv> {
6266
+ static template: string;
6267
+ onCheckboxChange(ev: Event): void;
6268
+ get checkBoxValue(): boolean;
6269
+ get isDisabled(): boolean;
6270
+ }
6271
+
6272
+ interface Props$p {
6273
+ cellPosition: CellPosition;
6274
+ }
6275
+ declare class DataValidationListIcon extends Component<Props$p, SpreadsheetChildEnv> {
6276
+ static template: string;
6277
+ onClick(): void;
6278
+ }
6279
+
6280
+ declare class DataValidationOverlay extends Component<{}, SpreadsheetChildEnv> {
6281
+ static template: string;
6282
+ static components: {
6283
+ GridCellIcon: typeof GridCellIcon;
6284
+ DataValidationCheckbox: typeof DataValidationCheckbox;
6285
+ DataValidationListIcon: typeof DataValidationListIcon;
6286
+ };
6287
+ get checkBoxCellPositions(): CellPosition[];
6288
+ get listIconsCellPositions(): CellPosition[];
6048
6289
  }
6049
6290
 
6050
6291
  type HFigureAxisType = "top" | "bottom" | "vCenter";
@@ -6057,7 +6298,7 @@ interface SnapLine<T extends HFigureAxisType | VFigureAxisType> {
6057
6298
  }
6058
6299
 
6059
6300
  type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
6060
- interface Props$n {
6301
+ interface Props$o {
6061
6302
  onFigureDeleted: () => void;
6062
6303
  }
6063
6304
  interface Container {
@@ -6136,7 +6377,7 @@ interface DndState {
6136
6377
  * that occurred during the drag & drop, and to position the figure on the correct pane.
6137
6378
  *
6138
6379
  */
6139
- declare class FiguresContainer extends Component<Props$n, SpreadsheetChildEnv> {
6380
+ declare class FiguresContainer extends Component<Props$o, SpreadsheetChildEnv> {
6140
6381
  static template: string;
6141
6382
  static components: {
6142
6383
  FigureComponent: typeof FigureComponent;
@@ -6168,6 +6409,30 @@ declare class FiguresContainer extends Component<Props$n, SpreadsheetChildEnv> {
6168
6409
  private getSnapLineStyle;
6169
6410
  }
6170
6411
 
6412
+ interface Props$n {
6413
+ focusGrid: () => void;
6414
+ }
6415
+ declare class GridAddRowsFooter extends Component<Props$n, SpreadsheetChildEnv> {
6416
+ static template: string;
6417
+ static components: {
6418
+ ValidationMessages: typeof ValidationMessages;
6419
+ };
6420
+ inputRef: {
6421
+ el: HTMLInputElement | null;
6422
+ };
6423
+ state: {
6424
+ inputValue: string;
6425
+ errorFlag: boolean;
6426
+ };
6427
+ setup(): void;
6428
+ get addRowsPosition(): string;
6429
+ get errorMessages(): string[];
6430
+ onKeydown(ev: KeyboardEvent): void;
6431
+ onInput(ev: InputEvent): void;
6432
+ onConfirm(): void;
6433
+ private onExternalClick;
6434
+ }
6435
+
6171
6436
  interface Props$m {
6172
6437
  onCellHovered: (position: Partial<Position$1>) => void;
6173
6438
  onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
@@ -6185,6 +6450,8 @@ declare class GridOverlay extends Component<Props$m, SpreadsheetChildEnv> {
6185
6450
  static template: string;
6186
6451
  static components: {
6187
6452
  FiguresContainer: typeof FiguresContainer;
6453
+ DataValidationOverlay: typeof DataValidationOverlay;
6454
+ GridAddRowsFooter: typeof GridAddRowsFooter;
6188
6455
  };
6189
6456
  static defaultProps: {
6190
6457
  onCellHovered: () => void;
@@ -6195,6 +6462,7 @@ declare class GridOverlay extends Component<Props$m, SpreadsheetChildEnv> {
6195
6462
  onFigureDeleted: () => void;
6196
6463
  };
6197
6464
  private gridOverlay;
6465
+ private gridOverlayRect;
6198
6466
  setup(): void;
6199
6467
  get gridOverlayEl(): HTMLElement;
6200
6468
  get style(): string;
@@ -6399,12 +6667,12 @@ interface Props$e {
6399
6667
  panelProps: any;
6400
6668
  onCloseSidePanel: () => void;
6401
6669
  }
6402
- interface State$4 {
6670
+ interface State$5 {
6403
6671
  panel: SidePanelContent;
6404
6672
  }
6405
6673
  declare class SidePanel extends Component<Props$e, SpreadsheetChildEnv> {
6406
6674
  static template: string;
6407
- state: State$4;
6675
+ state: State$5;
6408
6676
  setup(): void;
6409
6677
  getTitle(): string;
6410
6678
  }
@@ -6688,7 +6956,7 @@ declare class ActionButton extends Component<Props$d, SpreadsheetChildEnv> {
6688
6956
  }
6689
6957
 
6690
6958
  type Tool = "borderColorTool" | "borderTypeTool";
6691
- interface State$3 {
6959
+ interface State$4 {
6692
6960
  activeTool: Tool | undefined;
6693
6961
  }
6694
6962
  interface BorderEditorProps {
@@ -6713,7 +6981,7 @@ declare class BorderEditor extends Component<BorderEditorProps, SpreadsheetChild
6713
6981
  el: HTMLElement | null;
6714
6982
  };
6715
6983
  borderStyles: readonly ["thin", "medium", "thick", "dashed", "dotted"];
6716
- state: State$3;
6984
+ state: State$4;
6717
6985
  toggleDropdownTool(tool: Tool): void;
6718
6986
  closeDropdown(): void;
6719
6987
  setBorderPosition(position: BorderPosition): void;
@@ -6731,7 +6999,7 @@ interface Props$c {
6731
6999
  dropdownMaxHeight?: Pixel;
6732
7000
  class?: string;
6733
7001
  }
6734
- interface State$2 {
7002
+ interface State$3 {
6735
7003
  currentColor: Color;
6736
7004
  currentStyle: BorderStyle;
6737
7005
  currentPosition: BorderPosition | undefined;
@@ -6744,7 +7012,7 @@ declare class BorderEditorWidget extends Component<Props$c, SpreadsheetChildEnv>
6744
7012
  borderEditorButtonRef: {
6745
7013
  el: HTMLElement | null;
6746
7014
  };
6747
- state: State$2;
7015
+ state: State$3;
6748
7016
  get borderEditorAnchorRect(): Rect;
6749
7017
  onBorderPositionPicked(position: BorderPosition): void;
6750
7018
  onBorderColorPicked(color: Color): void;
@@ -6754,7 +7022,7 @@ declare class BorderEditorWidget extends Component<Props$c, SpreadsheetChildEnv>
6754
7022
 
6755
7023
  interface Props$b {
6756
7024
  values: AutocompleteValue[];
6757
- selectedIndex: number;
7025
+ selectedIndex: number | undefined;
6758
7026
  onValueSelected: (value: string) => void;
6759
7027
  }
6760
7028
  declare class TextValueProvider extends Component<Props$b> {
@@ -6861,8 +7129,9 @@ interface ComposerState$1 {
6861
7129
  }
6862
7130
  interface AutoCompleteState {
6863
7131
  showProvider: boolean;
6864
- selectedIndex: number;
7132
+ selectedIndex: number | undefined;
6865
7133
  values: AutocompleteValue[];
7134
+ type: "function" | "dataValidation";
6866
7135
  }
6867
7136
  interface FunctionDescriptionState {
6868
7137
  showDescription: boolean;
@@ -6910,7 +7179,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6910
7179
  onKeydown(ev: KeyboardEvent): void;
6911
7180
  onInput(ev: InputEvent): void;
6912
7181
  onKeyup(ev: KeyboardEvent): void;
6913
- showAutocomplete(searchTerm: string): void;
7182
+ showFunctionAutocomplete(searchTerm: string): void;
6914
7183
  /**
6915
7184
  * This is required to ensure the content helper selection is
6916
7185
  * properly updated on "onclick" events. Depending on the browser,
@@ -6942,6 +7211,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6942
7211
  */
6943
7212
  private processTokenAtCursor;
6944
7213
  private autoComplete;
7214
+ private showDataValidationAutocomplete;
6945
7215
  }
6946
7216
 
6947
7217
  interface Props$9 {
@@ -6957,7 +7227,7 @@ declare class TopBarComposer extends Component<Props$9, SpreadsheetChildEnv> {
6957
7227
  get containerStyle(): string;
6958
7228
  }
6959
7229
 
6960
- interface State$1 {
7230
+ interface State$2 {
6961
7231
  isOpen: boolean;
6962
7232
  }
6963
7233
  interface Props$8 {
@@ -6969,7 +7239,7 @@ declare class FontSizeEditor extends Component<Props$8, SpreadsheetChildEnv> {
6969
7239
  static template: string;
6970
7240
  static components: {};
6971
7241
  fontSizes: number[];
6972
- dropdown: State$1;
7242
+ dropdown: State$2;
6973
7243
  private inputRef;
6974
7244
  private rootEditorRef;
6975
7245
  setup(): void;
@@ -6994,7 +7264,7 @@ declare class PaintFormatButton extends Component<Props$7, SpreadsheetChildEnv>
6994
7264
  togglePaintFormat(): void;
6995
7265
  }
6996
7266
 
6997
- interface State {
7267
+ interface State$1 {
6998
7268
  menuState: MenuState;
6999
7269
  activeTool: string;
7000
7270
  fillColor: string;
@@ -7019,7 +7289,7 @@ declare class TopBar extends Component<Props$6, SpreadsheetChildEnv> {
7019
7289
  PaintFormatButton: typeof PaintFormatButton;
7020
7290
  BorderEditorWidget: typeof BorderEditorWidget;
7021
7291
  };
7022
- state: State;
7292
+ state: State$1;
7023
7293
  isSelectingMenu: boolean;
7024
7294
  openedEl: HTMLElement | null;
7025
7295
  menus: Action[];
@@ -7369,6 +7639,29 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7369
7639
  private processHeaderGroupingEventOnGrid;
7370
7640
  }
7371
7641
 
7642
+ type Direction = "horizontal" | "vertical";
7643
+ interface DragAndDropItemsPartial {
7644
+ id: UID;
7645
+ size: Pixel;
7646
+ position: Pixel;
7647
+ }
7648
+ interface DndPartialArgs {
7649
+ draggedItemId: UID;
7650
+ initialMousePosition: Pixel;
7651
+ items: DragAndDropItemsPartial[];
7652
+ containerEl: HTMLElement;
7653
+ onChange?: () => void;
7654
+ onCancel?: () => void;
7655
+ onDragEnd?: (itemId: UID, indexAtEnd: Pixel) => void;
7656
+ }
7657
+ interface State {
7658
+ itemsStyle: Record<UID, string>;
7659
+ draggedItemId: UID | undefined;
7660
+ start: (direction: Direction, args: DndPartialArgs) => void;
7661
+ cancel: () => void;
7662
+ }
7663
+ declare function useDragAndDropListItems(): State;
7664
+
7372
7665
  interface Props {
7373
7666
  onCloseSidePanel: () => void;
7374
7667
  }
@@ -7566,6 +7859,9 @@ declare const components: {
7566
7859
  FigureComponent: typeof FigureComponent;
7567
7860
  Menu: typeof Menu;
7568
7861
  };
7862
+ declare const hooks: {
7863
+ useDragAndDropListItems: typeof useDragAndDropListItems;
7864
+ };
7569
7865
  declare function addFunction(functionName: string, functionDescription: AddFunctionDescription): {
7570
7866
  addFunction: (fName: string, fDescription: AddFunctionDescription) => any;
7571
7867
  };
@@ -7573,4 +7869,4 @@ declare const constants: {
7573
7869
  DEFAULT_LOCALE: Locale;
7574
7870
  };
7575
7871
 
7576
- export { AbstractChart, CancelledReason, Client, ClientJoinedMessage, ClientLeftMessage, ClientMovedMessage, CollaborationMessage, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, RemoteRevisionMessage, Revision, RevisionRedoneMessage, RevisionUndoneMessage, SPREADSHEET_DIMENSIONS, Spreadsheet, TransportService, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
7872
+ export { AbstractChart, CancelledReason, Client, ClientJoinedMessage, ClientLeftMessage, ClientMovedMessage, CollaborationMessage, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, RemoteRevisionMessage, Revision, RevisionRedoneMessage, RevisionUndoneMessage, SPREADSHEET_DIMENSIONS, Spreadsheet, TransportService, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };