@odoo/o-spreadsheet 16.4.0-alpha.3 → 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.
- package/dist/o-spreadsheet.cjs.js +10379 -10215
- package/dist/o-spreadsheet.d.ts +426 -395
- package/dist/o-spreadsheet.esm.js +10379 -10215
- package/dist/o-spreadsheet.iife.js +10379 -10215
- package/dist/o-spreadsheet.iife.min.js +345 -314
- package/package.json +1 -1
- package/readme.md +8 -7
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1007,21 +1007,16 @@ declare function positionToZone(position: Position$1): {
|
|
|
1007
1007
|
bottom: HeaderIndex;
|
|
1008
1008
|
};
|
|
1009
1009
|
|
|
1010
|
-
|
|
1010
|
+
declare type SelectionEventOptions = {
|
|
1011
|
+
scrollIntoView?: boolean;
|
|
1012
|
+
unbounded?: boolean;
|
|
1013
|
+
};
|
|
1014
|
+
interface SelectionEvent {
|
|
1011
1015
|
anchor: AnchorZone;
|
|
1012
1016
|
previousAnchor: AnchorZone;
|
|
1013
1017
|
mode: "newAnchor" | "overrideSelection" | "updateAnchor";
|
|
1018
|
+
options: SelectionEventOptions;
|
|
1014
1019
|
}
|
|
1015
|
-
interface ZonesSelected extends SelectionEventPayload {
|
|
1016
|
-
type: "ZonesSelected";
|
|
1017
|
-
}
|
|
1018
|
-
interface HeadersSelected extends SelectionEventPayload {
|
|
1019
|
-
type: "HeadersSelected";
|
|
1020
|
-
}
|
|
1021
|
-
interface AlterZone extends SelectionEventPayload {
|
|
1022
|
-
type: "AlterZone";
|
|
1023
|
-
}
|
|
1024
|
-
declare type SelectionEvent = Readonly<ZonesSelected | HeadersSelected | AlterZone>;
|
|
1025
1020
|
|
|
1026
1021
|
interface StreamCallbacks<Event> {
|
|
1027
1022
|
handleEvent: (event: Event) => void;
|
|
@@ -1043,7 +1038,7 @@ declare type StatefulStream<Event, State> = {
|
|
|
1043
1038
|
* Allows to select cells in the grid and update the selection
|
|
1044
1039
|
*/
|
|
1045
1040
|
interface SelectionProcessor {
|
|
1046
|
-
selectZone(anchor: AnchorZone): DispatchResult;
|
|
1041
|
+
selectZone(anchor: AnchorZone, options?: SelectionEventOptions): DispatchResult;
|
|
1047
1042
|
selectCell(col: number, row: number): DispatchResult;
|
|
1048
1043
|
moveAnchorCell(direction: SelectionDirection, step: SelectionStep): DispatchResult;
|
|
1049
1044
|
setAnchorCorner(col: number, row: number): DispatchResult;
|
|
@@ -1671,10 +1666,10 @@ interface PositionDependentCommand {
|
|
|
1671
1666
|
col: number;
|
|
1672
1667
|
row: number;
|
|
1673
1668
|
}
|
|
1674
|
-
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" | "
|
|
1675
|
-
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" | "
|
|
1676
|
-
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" | "
|
|
1677
|
-
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" | "
|
|
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">;
|
|
1678
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">;
|
|
1679
1674
|
interface UpdateCellCommand extends PositionDependentCommand {
|
|
1680
1675
|
type: "UPDATE_CELL";
|
|
@@ -2203,12 +2198,6 @@ interface InsertCellCommand {
|
|
|
2203
2198
|
shiftDimension: Dimension;
|
|
2204
2199
|
zone: Zone;
|
|
2205
2200
|
}
|
|
2206
|
-
interface PasteCFCommand {
|
|
2207
|
-
type: "PASTE_CONDITIONAL_FORMAT";
|
|
2208
|
-
originPosition: CellPosition;
|
|
2209
|
-
targetPosition: CellPosition;
|
|
2210
|
-
operation: "CUT" | "COPY";
|
|
2211
|
-
}
|
|
2212
2201
|
interface ActivateNextSheetCommand {
|
|
2213
2202
|
type: "ACTIVATE_NEXT_SHEET";
|
|
2214
2203
|
}
|
|
@@ -2253,7 +2242,7 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
|
|
|
2253
2242
|
| CreateImageOverCommand
|
|
2254
2243
|
/** FILTERS */
|
|
2255
2244
|
| CreateFilterTableCommand | RemoveFilterTableCommand;
|
|
2256
|
-
declare type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand |
|
|
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;
|
|
2257
2246
|
declare type Command = CoreCommand | LocalCommand;
|
|
2258
2247
|
/**
|
|
2259
2248
|
* Holds the result of a command dispatch.
|
|
@@ -2400,6 +2389,7 @@ interface CoreCommandDispatcher {
|
|
|
2400
2389
|
}
|
|
2401
2390
|
declare type CommandTypes = Command["type"];
|
|
2402
2391
|
declare type CoreCommandTypes = CoreCommand["type"];
|
|
2392
|
+
declare type CoreViewCommand = CoreCommand | EvaluateCellsCommand | UndoCommand | RedoCommand;
|
|
2403
2393
|
|
|
2404
2394
|
/**
|
|
2405
2395
|
* The following type is meant to be used in union with other aliases to prevent
|
|
@@ -2648,6 +2638,14 @@ interface SortOptions {
|
|
|
2648
2638
|
interface MenuMouseEvent extends MouseEvent {
|
|
2649
2639
|
closedMenuId?: UID;
|
|
2650
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
|
+
};
|
|
2651
2649
|
|
|
2652
2650
|
declare type Format = string & Alias;
|
|
2653
2651
|
declare type FormattedValue = string & Alias;
|
|
@@ -3271,7 +3269,7 @@ interface ConditionalFormatState {
|
|
|
3271
3269
|
};
|
|
3272
3270
|
}
|
|
3273
3271
|
declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState> implements ConditionalFormatState {
|
|
3274
|
-
static getters: readonly ["getConditionalFormats", "getRulesSelection", "getRulesByCell"];
|
|
3272
|
+
static getters: readonly ["getConditionalFormats", "getRulesSelection", "getRulesByCell", "getAdaptedCfRanges"];
|
|
3275
3273
|
readonly cfRules: {
|
|
3276
3274
|
[sheet: string]: ConditionalFormatInternal[];
|
|
3277
3275
|
};
|
|
@@ -3289,6 +3287,10 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
|
|
|
3289
3287
|
getRulesSelection(sheetId: UID, selection: Zone[]): UID[];
|
|
3290
3288
|
getRulesByZone(sheetId: UID, zone: Zone): Set<UID>;
|
|
3291
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;
|
|
3292
3294
|
private mapToConditionalFormat;
|
|
3293
3295
|
private mapToConditionalFormatInternal;
|
|
3294
3296
|
/**
|
|
@@ -3363,7 +3365,7 @@ interface FiltersState {
|
|
|
3363
3365
|
tables: Record<UID, Record<FilterTableId, FilterTable | undefined>>;
|
|
3364
3366
|
}
|
|
3365
3367
|
declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersState {
|
|
3366
|
-
static getters: readonly ["doesZonesContainFilter", "getFilter", "getFilters", "getFilterTable", "getFilterTables", "getFilterTablesInZone", "getFilterId"];
|
|
3368
|
+
static getters: readonly ["doesZonesContainFilter", "getFilter", "getFilters", "getFilterTable", "getFilterTables", "getFilterTablesInZone", "getFilterId", "getFilterHeaders", "isFilterHeader"];
|
|
3367
3369
|
readonly tables: Record<UID, Record<FilterTableId, FilterTable | undefined>>;
|
|
3368
3370
|
allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
|
|
3369
3371
|
handle(cmd: CoreCommand): void;
|
|
@@ -3375,6 +3377,8 @@ declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersS
|
|
|
3375
3377
|
/** Get the filter tables that are fully inside the given zone */
|
|
3376
3378
|
getFilterTablesInZone(sheetId: UID, zone: Zone): FilterTable[];
|
|
3377
3379
|
doesZonesContainFilter(sheetId: UID, zones: Zone[]): boolean;
|
|
3380
|
+
getFilterHeaders(sheetId: UID): Position$1[];
|
|
3381
|
+
isFilterHeader({ sheetId, col, row }: CellPosition): boolean;
|
|
3378
3382
|
private onAddColumnsRows;
|
|
3379
3383
|
private onDeleteColumnsRows;
|
|
3380
3384
|
private createFilterTable;
|
|
@@ -3725,9 +3729,9 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3725
3729
|
private positionsToUpdate;
|
|
3726
3730
|
constructor(config: UIPluginConfig);
|
|
3727
3731
|
beforeHandle(cmd: Command): void;
|
|
3728
|
-
handle(cmd:
|
|
3732
|
+
handle(cmd: CoreViewCommand): void;
|
|
3729
3733
|
finalize(): void;
|
|
3730
|
-
evaluateFormula(
|
|
3734
|
+
evaluateFormula(sheetId: UID, formulaString: string): any;
|
|
3731
3735
|
/**
|
|
3732
3736
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
3733
3737
|
*/
|
|
@@ -3752,16 +3756,20 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3752
3756
|
private getCorrespondingFormulaCell;
|
|
3753
3757
|
}
|
|
3754
3758
|
|
|
3759
|
+
interface CustomColorState {
|
|
3760
|
+
readonly customColors: Immutable<Record<Color, true>>;
|
|
3761
|
+
readonly shouldUpdateColors: boolean;
|
|
3762
|
+
}
|
|
3755
3763
|
/**
|
|
3756
3764
|
* CustomColors plugin
|
|
3757
3765
|
* This plugins aims to compute and keep to custom colors used in the
|
|
3758
3766
|
* current spreadsheet
|
|
3759
3767
|
*/
|
|
3760
|
-
declare class CustomColorsPlugin extends UIPlugin {
|
|
3761
|
-
private customColors;
|
|
3762
|
-
private shouldUpdateColors;
|
|
3768
|
+
declare class CustomColorsPlugin extends UIPlugin<CustomColorState> {
|
|
3769
|
+
private readonly customColors;
|
|
3770
|
+
private readonly shouldUpdateColors;
|
|
3763
3771
|
static getters: readonly ["getCustomColors"];
|
|
3764
|
-
handle(cmd:
|
|
3772
|
+
handle(cmd: CoreViewCommand): void;
|
|
3765
3773
|
finalize(): void;
|
|
3766
3774
|
getCustomColors(): Color[];
|
|
3767
3775
|
private getColorsFromCells;
|
|
@@ -3770,11 +3778,14 @@ declare class CustomColorsPlugin extends UIPlugin {
|
|
|
3770
3778
|
private tryToAddColor;
|
|
3771
3779
|
}
|
|
3772
3780
|
|
|
3773
|
-
|
|
3781
|
+
interface EvaluationChartState {
|
|
3782
|
+
readonly charts: Immutable<Record<UID, ChartRuntime | undefined>>;
|
|
3783
|
+
}
|
|
3784
|
+
declare class EvaluationChartPlugin extends UIPlugin<EvaluationChartState> {
|
|
3774
3785
|
static getters: readonly ["getChartRuntime", "getBackgroundOfSingleCellChart"];
|
|
3775
|
-
readonly charts: Record<UID, ChartRuntime | undefined
|
|
3786
|
+
readonly charts: Immutable<Record<UID, ChartRuntime | undefined>>;
|
|
3776
3787
|
private createRuntimeChart;
|
|
3777
|
-
handle(cmd:
|
|
3788
|
+
handle(cmd: CoreViewCommand): void;
|
|
3778
3789
|
getChartRuntime(figureId: UID): ChartRuntime;
|
|
3779
3790
|
/**
|
|
3780
3791
|
* Get the background color of a chart based on the color of the first cell of the main range
|
|
@@ -3793,10 +3804,10 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
3793
3804
|
private isStale;
|
|
3794
3805
|
private computedStyles;
|
|
3795
3806
|
private computedIcons;
|
|
3796
|
-
handle(cmd:
|
|
3807
|
+
handle(cmd: CoreViewCommand): void;
|
|
3797
3808
|
finalize(): void;
|
|
3798
3809
|
getCellComputedStyle(position: CellPosition): Style;
|
|
3799
|
-
getConditionalIcon({ col, row }:
|
|
3810
|
+
getConditionalIcon({ sheetId, col, row }: CellPosition): string | undefined;
|
|
3800
3811
|
/**
|
|
3801
3812
|
* Compute the styles according to the conditional formatting.
|
|
3802
3813
|
* This computation must happen after the cell values are computed if they change
|
|
@@ -3807,10 +3818,13 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
3807
3818
|
* the resulting style will have the combination of all those values.
|
|
3808
3819
|
* If multiple conditional formatting use the same style value, they will be applied in order so that the last applied wins
|
|
3809
3820
|
*/
|
|
3810
|
-
private
|
|
3821
|
+
private getComputedStyles;
|
|
3822
|
+
private getComputedIcons;
|
|
3811
3823
|
private parsePoint;
|
|
3824
|
+
/** Compute the CF icons for the given range and CF rule, and apply in in the given computedIcons object */
|
|
3812
3825
|
private applyIcon;
|
|
3813
3826
|
private computeIcon;
|
|
3827
|
+
/** Compute the color scale for the given range and CF rule, and apply in in the given computedStyle object */
|
|
3814
3828
|
private applyColorScale;
|
|
3815
3829
|
private computeColorDiffUnits;
|
|
3816
3830
|
private colorCell;
|
|
@@ -3818,370 +3832,104 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
3818
3832
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
3819
3833
|
*/
|
|
3820
3834
|
private rulePredicate;
|
|
3821
|
-
/**
|
|
3822
|
-
* Add or remove cells to a given conditional formatting rule.
|
|
3823
|
-
*/
|
|
3824
|
-
private adaptRules;
|
|
3825
|
-
private pasteCf;
|
|
3826
3835
|
}
|
|
3827
3836
|
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
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;
|
|
3833
3849
|
allowDispatch(cmd: LocalCommand): CommandResult;
|
|
3834
3850
|
handle(cmd: Command): void;
|
|
3835
|
-
|
|
3836
|
-
isRowFiltered(sheetId: UID, row: number): boolean;
|
|
3837
|
-
getCellBorderWithFilterBorder(position: CellPosition): Border$1 | null;
|
|
3838
|
-
getFilterHeaders(sheetId: UID): Position$1[];
|
|
3839
|
-
getFilterValues(position: CellPosition): string[];
|
|
3840
|
-
isFilterHeader({ sheetId, col, row }: CellPosition): boolean;
|
|
3841
|
-
isFilterActive(position: CellPosition): boolean;
|
|
3842
|
-
private intersectZoneWithViewport;
|
|
3843
|
-
private updateFilter;
|
|
3844
|
-
private updateHiddenRows;
|
|
3845
|
-
private getCellValueAsString;
|
|
3846
|
-
exportForExcel(data: ExcelWorkbookData): void;
|
|
3851
|
+
getAutofillTooltip(): Tooltip | undefined;
|
|
3847
3852
|
/**
|
|
3848
|
-
*
|
|
3849
|
-
*
|
|
3850
|
-
|
|
3851
|
-
private getUniqueColNameForExcel;
|
|
3852
|
-
}
|
|
3853
|
-
|
|
3854
|
-
declare class InternalViewport {
|
|
3855
|
-
private getters;
|
|
3856
|
-
private sheetId;
|
|
3857
|
-
private boundaries;
|
|
3858
|
-
top: HeaderIndex;
|
|
3859
|
-
bottom: HeaderIndex;
|
|
3860
|
-
left: HeaderIndex;
|
|
3861
|
-
right: HeaderIndex;
|
|
3862
|
-
offsetX: Pixel;
|
|
3863
|
-
offsetY: Pixel;
|
|
3864
|
-
offsetScrollbarX: Pixel;
|
|
3865
|
-
offsetScrollbarY: Pixel;
|
|
3866
|
-
canScrollVertically: boolean;
|
|
3867
|
-
canScrollHorizontally: boolean;
|
|
3868
|
-
viewportWidth: Pixel;
|
|
3869
|
-
viewportHeight: Pixel;
|
|
3870
|
-
offsetCorrectionX: Pixel;
|
|
3871
|
-
offsetCorrectionY: Pixel;
|
|
3872
|
-
constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
|
|
3873
|
-
width: Pixel;
|
|
3874
|
-
height: Pixel;
|
|
3875
|
-
}, options: {
|
|
3876
|
-
canScrollVertically: boolean;
|
|
3877
|
-
canScrollHorizontally: boolean;
|
|
3878
|
-
}, offsets: {
|
|
3879
|
-
x: Pixel;
|
|
3880
|
-
y: Pixel;
|
|
3881
|
-
});
|
|
3882
|
-
/** Returns the maximum size (in Pixels) of the viewport relative to its allocated client size
|
|
3883
|
-
* When the viewport grid size is smaller than its client width (resp. height), it will return
|
|
3884
|
-
* the client width (resp. height).
|
|
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
|
|
3885
3856
|
*/
|
|
3886
|
-
|
|
3857
|
+
private autofill;
|
|
3887
3858
|
/**
|
|
3888
|
-
*
|
|
3889
|
-
* visible cell.
|
|
3890
|
-
* It returns -1 if no column is found.
|
|
3859
|
+
* Select a cell which becomes the last cell of the autofillZone
|
|
3891
3860
|
*/
|
|
3892
|
-
|
|
3861
|
+
private select;
|
|
3893
3862
|
/**
|
|
3894
|
-
*
|
|
3895
|
-
*
|
|
3896
|
-
* It returns -1 if no row is found.
|
|
3863
|
+
* Computes the autofillZone to autofill when the user double click on the
|
|
3864
|
+
* autofiller
|
|
3897
3865
|
*/
|
|
3898
|
-
|
|
3866
|
+
private autofillAuto;
|
|
3899
3867
|
/**
|
|
3900
|
-
*
|
|
3901
|
-
* the pane that is actually displayed on the client. We therefore adjust the offset of the pane
|
|
3902
|
-
* until it contains the cell completely.
|
|
3868
|
+
* Generate the next cell
|
|
3903
3869
|
*/
|
|
3904
|
-
|
|
3905
|
-
adjustPositionX(targetCol: HeaderIndex): void;
|
|
3906
|
-
adjustPositionY(targetRow: HeaderIndex): void;
|
|
3907
|
-
setViewportOffset(offsetX: Pixel, offsetY: Pixel): void;
|
|
3908
|
-
adjustViewportZone(): void;
|
|
3870
|
+
private computeNewCell;
|
|
3909
3871
|
/**
|
|
3910
|
-
*
|
|
3911
|
-
* @param zone
|
|
3912
|
-
* @returns Computes the absolute coordinate of a given zone inside the viewport
|
|
3872
|
+
* Get the rule associated to the current cell
|
|
3913
3873
|
*/
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
private get zone();
|
|
3918
|
-
private setViewportOffsetX;
|
|
3919
|
-
private setViewportOffsetY;
|
|
3920
|
-
/** Corrects the viewport's horizontal offset based on the current structure
|
|
3921
|
-
* To make sure that at least on column is visible inside the viewport.
|
|
3874
|
+
private getRule;
|
|
3875
|
+
/**
|
|
3876
|
+
* Create the generator to be able to autofill the next cells.
|
|
3922
3877
|
*/
|
|
3923
|
-
private
|
|
3924
|
-
|
|
3925
|
-
|
|
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)
|
|
3926
3883
|
*/
|
|
3927
|
-
private
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
/** Updates the pane zone and snapped offset based on its vertical
|
|
3932
|
-
* offset (will find Top) and its width (will find Bottom) */
|
|
3933
|
-
private adjustViewportZoneY;
|
|
3884
|
+
private getDirection;
|
|
3885
|
+
private autoFillMerge;
|
|
3886
|
+
private autofillCF;
|
|
3887
|
+
drawGrid(renderingContext: GridRenderingContext): void;
|
|
3934
3888
|
}
|
|
3935
3889
|
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
/**
|
|
3943
|
-
* EdgeScrollCases Schema
|
|
3944
|
-
*
|
|
3945
|
-
* The dots/double dots represent a freeze (= a split of viewports)
|
|
3946
|
-
* In this example, we froze vertically between columns D and E
|
|
3947
|
-
* and horizontally between rows 4 and 5.
|
|
3948
|
-
*
|
|
3949
|
-
* One can see that we scrolled horizontally from column E to G and
|
|
3950
|
-
* vertically from row 5 to 7.
|
|
3951
|
-
*
|
|
3952
|
-
* A B C D G H I J K L M N O P Q R S T
|
|
3953
|
-
* _______________________________________________________
|
|
3954
|
-
* 1 | : |
|
|
3955
|
-
* 2 | : |
|
|
3956
|
-
* 3 | : B ↑ 6 |
|
|
3957
|
-
* 4 | : | | | |
|
|
3958
|
-
* ····················+···+·················+············|
|
|
3959
|
-
* 7 | : | | | |
|
|
3960
|
-
* 8 | : ↓ 2 | |
|
|
3961
|
-
* 9 | : | |
|
|
3962
|
-
* 10 | A --+--→ | |
|
|
3963
|
-
* 11 | : | |
|
|
3964
|
-
* 12 | : | |
|
|
3965
|
-
* 13 | ←--+-- 1 | |
|
|
3966
|
-
* 14 | : | 3 --+--→
|
|
3967
|
-
* 15 | : | |
|
|
3968
|
-
* 16 | : | |
|
|
3969
|
-
* 17 | 5 --+-------------------------------------------+--→
|
|
3970
|
-
* 18 | : | |
|
|
3971
|
-
* 19 | : 4 | |
|
|
3972
|
-
* 20 | : | | |
|
|
3973
|
-
* ______________________________+___________| ____________
|
|
3974
|
-
* | |
|
|
3975
|
-
* ↓ ↓
|
|
3976
|
-
*/
|
|
3977
|
-
/**
|
|
3978
|
-
* Viewport plugin.
|
|
3979
|
-
*
|
|
3980
|
-
* This plugin manages all things related to all viewport states.
|
|
3981
|
-
*
|
|
3982
|
-
*/
|
|
3983
|
-
declare class SheetViewPlugin extends UIPlugin {
|
|
3984
|
-
static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
|
|
3985
|
-
readonly viewports: Record<UID, SheetViewports | undefined>;
|
|
3986
|
-
/**
|
|
3987
|
-
* The viewport dimensions are usually set by one of the components
|
|
3988
|
-
* (i.e. when grid component is mounted) to properly reflect its state in the DOM.
|
|
3989
|
-
* In the absence of a component (standalone model), is it mandatory to set reasonable default values
|
|
3990
|
-
* to ensure the correct operation of this plugin.
|
|
3991
|
-
*/
|
|
3992
|
-
private sheetViewWidth;
|
|
3993
|
-
private sheetViewHeight;
|
|
3994
|
-
private gridOffsetX;
|
|
3995
|
-
private gridOffsetY;
|
|
3996
|
-
private sheetsWithDirtyViewports;
|
|
3997
|
-
allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
|
|
3998
|
-
private handleEvent;
|
|
3890
|
+
interface AutomaticSum {
|
|
3891
|
+
position: Position$1;
|
|
3892
|
+
zone: Zone;
|
|
3893
|
+
}
|
|
3894
|
+
declare class AutomaticSumPlugin extends UIPlugin {
|
|
3895
|
+
static getters: readonly ["getAutomaticSums"];
|
|
3999
3896
|
handle(cmd: Command): void;
|
|
4000
|
-
|
|
4001
|
-
private
|
|
3897
|
+
getAutomaticSums(sheetId: UID, zone: Zone, anchor: Position$1): AutomaticSum[];
|
|
3898
|
+
private sumData;
|
|
3899
|
+
private sumAdjacentData;
|
|
4002
3900
|
/**
|
|
4003
|
-
*
|
|
4004
|
-
*
|
|
4005
|
-
*
|
|
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
|
+
* ------- -------
|
|
4006
3931
|
*/
|
|
4007
|
-
|
|
4008
|
-
/**
|
|
4009
|
-
* Return the index of a row given an offset y, based on the viewport top
|
|
4010
|
-
* visible cell.
|
|
4011
|
-
* It returns -1 if no row is found.
|
|
4012
|
-
*/
|
|
4013
|
-
getRowIndex(y: Pixel): HeaderIndex;
|
|
4014
|
-
getSheetViewDimensionWithHeaders(): DOMDimension;
|
|
4015
|
-
getSheetViewDimension(): DOMDimension;
|
|
4016
|
-
/** type as pane, not viewport but basically pane extends viewport */
|
|
4017
|
-
getActiveMainViewport(): Viewport;
|
|
4018
|
-
/**
|
|
4019
|
-
* Return the scroll info of the active sheet, ie. the offset between the viewport left/top side and
|
|
4020
|
-
* the grid left/top side, snapped to the columns/rows.
|
|
4021
|
-
*/
|
|
4022
|
-
getActiveSheetScrollInfo(): SheetScrollInfo;
|
|
4023
|
-
/**
|
|
4024
|
-
* Return the DOM scroll info of the active sheet, ie. the offset between the viewport left/top side and
|
|
4025
|
-
* the grid left/top side, corresponding to the scroll of the scrollbars and not snapped to the grid.
|
|
4026
|
-
*/
|
|
4027
|
-
getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
|
|
4028
|
-
getSheetViewVisibleCols(): HeaderIndex[];
|
|
4029
|
-
getSheetViewVisibleRows(): HeaderIndex[];
|
|
4030
|
-
/**
|
|
4031
|
-
* Return the main viewport maximum size relative to the client size.
|
|
4032
|
-
*/
|
|
4033
|
-
getMainViewportRect(): Rect;
|
|
4034
|
-
private getMaximumSheetOffset;
|
|
4035
|
-
getColRowOffsetInViewport(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex): Pixel;
|
|
4036
|
-
/**
|
|
4037
|
-
* Check if a given position is visible in the viewport.
|
|
4038
|
-
*/
|
|
4039
|
-
isVisibleInViewport({ sheetId, col, row }: CellPosition): boolean;
|
|
4040
|
-
getEdgeScrollCol(x: number, previousX: number, startingX: number): EdgeScrollInfo;
|
|
4041
|
-
getEdgeScrollRow(y: number, previousY: number, tartingY: number): EdgeScrollInfo;
|
|
4042
|
-
/**
|
|
4043
|
-
* Computes the coordinates and size to draw the zone on the canvas
|
|
4044
|
-
*/
|
|
4045
|
-
getVisibleRect(zone: Zone): Rect;
|
|
4046
|
-
/**
|
|
4047
|
-
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
4048
|
-
* It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
|
|
4049
|
-
* situated before the pane divisions.
|
|
4050
|
-
*/
|
|
4051
|
-
getMainViewportCoordinates(): DOMCoordinates;
|
|
4052
|
-
private ensureMainViewportExist;
|
|
4053
|
-
private getSubViewports;
|
|
4054
|
-
private checkPositiveDimension;
|
|
4055
|
-
private checkValuesAreDifferent;
|
|
4056
|
-
private checkScrollingDirection;
|
|
4057
|
-
private getMainViewport;
|
|
4058
|
-
private getMainInternalViewport;
|
|
4059
|
-
/** gets rid of deprecated sheetIds */
|
|
4060
|
-
private cleanViewports;
|
|
4061
|
-
private resetSheetViews;
|
|
4062
|
-
private resizeSheetView;
|
|
4063
|
-
private recomputeViewports;
|
|
4064
|
-
private setSheetViewOffset;
|
|
4065
|
-
/**
|
|
4066
|
-
* Clip the vertical offset within the allowed range.
|
|
4067
|
-
* Not above the sheet, nor below the sheet.
|
|
4068
|
-
*/
|
|
4069
|
-
private clipOffsetY;
|
|
4070
|
-
private getViewportOffset;
|
|
4071
|
-
private resetViewports;
|
|
4072
|
-
/**
|
|
4073
|
-
* Adjust the viewport such that the anchor position is visible
|
|
4074
|
-
*/
|
|
4075
|
-
private refreshViewport;
|
|
4076
|
-
/**
|
|
4077
|
-
* Shift the viewport vertically and move the selection anchor
|
|
4078
|
-
* such that it remains at the same place relative to the
|
|
4079
|
-
* viewport top.
|
|
4080
|
-
*/
|
|
4081
|
-
private shiftVertically;
|
|
4082
|
-
getVisibleFigures(): Figure[];
|
|
4083
|
-
isPositionVisible(position: PixelPosition): boolean;
|
|
4084
|
-
getFrozenSheetViewRatio(sheetId: UID): {
|
|
4085
|
-
xRatio: number;
|
|
4086
|
-
yRatio: number;
|
|
4087
|
-
};
|
|
4088
|
-
}
|
|
4089
|
-
|
|
4090
|
-
/**
|
|
4091
|
-
* Autofill Plugin
|
|
4092
|
-
*
|
|
4093
|
-
*/
|
|
4094
|
-
declare class AutofillPlugin extends UIPlugin {
|
|
4095
|
-
static layers: LAYERS[];
|
|
4096
|
-
static getters: readonly ["getAutofillTooltip"];
|
|
4097
|
-
private autofillZone;
|
|
4098
|
-
private steps;
|
|
4099
|
-
private lastCellSelected;
|
|
4100
|
-
private direction;
|
|
4101
|
-
private tooltip;
|
|
4102
|
-
allowDispatch(cmd: LocalCommand): CommandResult;
|
|
4103
|
-
handle(cmd: Command): void;
|
|
4104
|
-
getAutofillTooltip(): Tooltip | undefined;
|
|
4105
|
-
/**
|
|
4106
|
-
* Autofill the autofillZone from the current selection
|
|
4107
|
-
* @param apply Flag set to true to apply the autofill in the model. It's
|
|
4108
|
-
* useful to set it to false when we need to fill the tooltip
|
|
4109
|
-
*/
|
|
4110
|
-
private autofill;
|
|
4111
|
-
/**
|
|
4112
|
-
* Select a cell which becomes the last cell of the autofillZone
|
|
4113
|
-
*/
|
|
4114
|
-
private select;
|
|
4115
|
-
/**
|
|
4116
|
-
* Computes the autofillZone to autofill when the user double click on the
|
|
4117
|
-
* autofiller
|
|
4118
|
-
*/
|
|
4119
|
-
private autofillAuto;
|
|
4120
|
-
/**
|
|
4121
|
-
* Generate the next cell
|
|
4122
|
-
*/
|
|
4123
|
-
private computeNewCell;
|
|
4124
|
-
/**
|
|
4125
|
-
* Get the rule associated to the current cell
|
|
4126
|
-
*/
|
|
4127
|
-
private getRule;
|
|
4128
|
-
/**
|
|
4129
|
-
* Create the generator to be able to autofill the next cells.
|
|
4130
|
-
*/
|
|
4131
|
-
private createGenerator;
|
|
4132
|
-
private saveZone;
|
|
4133
|
-
/**
|
|
4134
|
-
* Compute the direction of the autofill from the last selected zone and
|
|
4135
|
-
* a given cell (col, row)
|
|
4136
|
-
*/
|
|
4137
|
-
private getDirection;
|
|
4138
|
-
private autoFillMerge;
|
|
4139
|
-
drawGrid(renderingContext: GridRenderingContext): void;
|
|
4140
|
-
}
|
|
4141
|
-
|
|
4142
|
-
interface AutomaticSum {
|
|
4143
|
-
position: Position$1;
|
|
4144
|
-
zone: Zone;
|
|
4145
|
-
}
|
|
4146
|
-
declare class AutomaticSumPlugin extends UIPlugin {
|
|
4147
|
-
static getters: readonly ["getAutomaticSums"];
|
|
4148
|
-
handle(cmd: Command): void;
|
|
4149
|
-
getAutomaticSums(sheetId: UID, zone: Zone, anchor: Position$1): AutomaticSum[];
|
|
4150
|
-
private sumData;
|
|
4151
|
-
private sumAdjacentData;
|
|
4152
|
-
/**
|
|
4153
|
-
* Find a zone to automatically sum a column or row of numbers.
|
|
4154
|
-
*
|
|
4155
|
-
* We first decide which direction will be summed (column or row).
|
|
4156
|
-
* Here is the strategy:
|
|
4157
|
-
* 1. If the left cell is a number and the top cell is not: choose horizontal
|
|
4158
|
-
* 2. Try to find a valid vertical zone. If it's valid: choose vertical
|
|
4159
|
-
* 3. Try to find a valid horizontal zone. If it's valid: choose horizontal
|
|
4160
|
-
* 4. Otherwise, no zone is returned
|
|
4161
|
-
*
|
|
4162
|
-
* Now, how to find a valid zone?
|
|
4163
|
-
* The zone starts directly above or on the left of the starting point
|
|
4164
|
-
* (depending on the direction).
|
|
4165
|
-
* The zone ends where the first continuous sequence of numbers ends.
|
|
4166
|
-
* Empty or text cells can be part of the zone while no number has been found.
|
|
4167
|
-
* Other kind of cells (boolean, dates, etc.) are not valid in the zone and the
|
|
4168
|
-
* search stops immediately if one is found.
|
|
4169
|
-
*
|
|
4170
|
-
* ------- -------
|
|
4171
|
-
* | 1 | | 1 |
|
|
4172
|
-
* ------- -------
|
|
4173
|
-
* | | | |
|
|
4174
|
-
* ------- <= end of the sequence, stop here -------
|
|
4175
|
-
* | 2 | | 2 |
|
|
4176
|
-
* ------- -------
|
|
4177
|
-
* | 3 | <= start of the number sequence | 3 |
|
|
4178
|
-
* ------- -------
|
|
4179
|
-
* | | <= ignored | FALSE | <= invalid, no zone is found
|
|
4180
|
-
* ------- -------
|
|
4181
|
-
* | A | <= ignored | A | <= ignored
|
|
4182
|
-
* ------- -------
|
|
4183
|
-
*/
|
|
4184
|
-
private findAdjacentData;
|
|
3932
|
+
private findAdjacentData;
|
|
4185
3933
|
/**
|
|
4186
3934
|
* Return the zone to sum if a valid one is found.
|
|
4187
3935
|
* @see getAutomaticSumZone
|
|
@@ -4666,6 +4414,30 @@ declare class ClipboardPlugin extends UIPlugin {
|
|
|
4666
4414
|
drawGrid(renderingContext: GridRenderingContext): void;
|
|
4667
4415
|
}
|
|
4668
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" ...)
|
|
4437
|
+
*/
|
|
4438
|
+
private getUniqueColNameForExcel;
|
|
4439
|
+
}
|
|
4440
|
+
|
|
4669
4441
|
/**
|
|
4670
4442
|
* SelectionPlugin
|
|
4671
4443
|
*/
|
|
@@ -4739,6 +4511,242 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4739
4511
|
drawGrid(renderingContext: GridRenderingContext): void;
|
|
4740
4512
|
}
|
|
4741
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
|
+
|
|
4742
4750
|
/**
|
|
4743
4751
|
* Union of all getter names of a plugin.
|
|
4744
4752
|
*
|
|
@@ -4991,7 +4999,7 @@ interface ChartBuilder {
|
|
|
4991
4999
|
sequence: number;
|
|
4992
5000
|
}
|
|
4993
5001
|
|
|
4994
|
-
interface Props$
|
|
5002
|
+
interface Props$E {
|
|
4995
5003
|
ranges: () => string[];
|
|
4996
5004
|
hasSingleRange?: boolean;
|
|
4997
5005
|
required?: boolean;
|
|
@@ -5013,7 +5021,7 @@ interface SelectionRange extends Omit<RangeInputValue, "color"> {
|
|
|
5013
5021
|
* onSelectionChanged is called every time the input value
|
|
5014
5022
|
* changes.
|
|
5015
5023
|
*/
|
|
5016
|
-
declare class SelectionInput extends Component<Props$
|
|
5024
|
+
declare class SelectionInput extends Component<Props$E, SpreadsheetChildEnv> {
|
|
5017
5025
|
static template: string;
|
|
5018
5026
|
private id;
|
|
5019
5027
|
private previousRanges;
|
|
@@ -5042,15 +5050,26 @@ declare class SelectionInput extends Component<Props$D, SpreadsheetChildEnv> {
|
|
|
5042
5050
|
confirm(): void;
|
|
5043
5051
|
}
|
|
5044
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
|
+
|
|
5045
5062
|
interface Props$C {
|
|
5046
5063
|
figureId: UID;
|
|
5047
5064
|
definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
|
|
5065
|
+
canUpdateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
|
|
5048
5066
|
updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
|
|
5049
5067
|
}
|
|
5050
5068
|
declare class LineBarPieConfigPanel extends Component<Props$C, SpreadsheetChildEnv> {
|
|
5051
5069
|
static template: string;
|
|
5052
5070
|
static components: {
|
|
5053
5071
|
SelectionInput: typeof SelectionInput;
|
|
5072
|
+
SidePanelErrors: typeof SidePanelErrors;
|
|
5054
5073
|
};
|
|
5055
5074
|
private state;
|
|
5056
5075
|
private dataSeriesRanges;
|
|
@@ -5155,16 +5174,22 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
|
|
|
5155
5174
|
private state;
|
|
5156
5175
|
get colorPickerStyle(): string;
|
|
5157
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;
|
|
5158
5186
|
onColorClick(color: Color): void;
|
|
5159
|
-
getCheckMarkColor(): Color;
|
|
5160
5187
|
resetColor(): void;
|
|
5161
|
-
setCustomColor(ev: Event): void;
|
|
5162
5188
|
toggleColorPicker(): void;
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
get magnifyingGlassStyle(): string;
|
|
5189
|
+
dragGradientPointer(ev: MouseEvent): void;
|
|
5190
|
+
dragHuePointer(ev: MouseEvent): void;
|
|
5191
|
+
setHexColor(ev: InputEvent): void;
|
|
5192
|
+
addCustomColor(ev: Event): void;
|
|
5168
5193
|
isSameColor(color1: Color, color2: Color): boolean;
|
|
5169
5194
|
}
|
|
5170
5195
|
|
|
@@ -5194,7 +5219,8 @@ declare class ColorPickerWidget extends Component<Props$B, SpreadsheetChildEnv>
|
|
|
5194
5219
|
interface Props$A {
|
|
5195
5220
|
figureId: UID;
|
|
5196
5221
|
definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
|
|
5197
|
-
|
|
5222
|
+
canUpdateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
|
|
5223
|
+
updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
|
|
5198
5224
|
}
|
|
5199
5225
|
declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildEnv> {
|
|
5200
5226
|
static template: string;
|
|
@@ -5213,12 +5239,14 @@ declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildE
|
|
|
5213
5239
|
interface Props$z {
|
|
5214
5240
|
figureId: UID;
|
|
5215
5241
|
definition: GaugeChartDefinition;
|
|
5242
|
+
canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
|
|
5216
5243
|
updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
|
|
5217
5244
|
}
|
|
5218
5245
|
declare class GaugeChartConfigPanel extends Component<Props$z, SpreadsheetChildEnv> {
|
|
5219
5246
|
static template: string;
|
|
5220
5247
|
static components: {
|
|
5221
5248
|
SelectionInput: typeof SelectionInput;
|
|
5249
|
+
SidePanelErrors: typeof SidePanelErrors;
|
|
5222
5250
|
};
|
|
5223
5251
|
private state;
|
|
5224
5252
|
private dataRange;
|
|
@@ -5233,12 +5261,14 @@ declare type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectio
|
|
|
5233
5261
|
interface Props$y {
|
|
5234
5262
|
figureId: UID;
|
|
5235
5263
|
definition: GaugeChartDefinition;
|
|
5264
|
+
canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
|
|
5236
5265
|
updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
|
|
5237
5266
|
}
|
|
5238
5267
|
declare class GaugeChartDesignPanel extends Component<Props$y, SpreadsheetChildEnv> {
|
|
5239
5268
|
static template: string;
|
|
5240
5269
|
static components: {
|
|
5241
5270
|
ColorPickerWidget: typeof ColorPickerWidget;
|
|
5271
|
+
SidePanelErrors: typeof SidePanelErrors;
|
|
5242
5272
|
};
|
|
5243
5273
|
private state;
|
|
5244
5274
|
setup(): void;
|
|
@@ -5249,13 +5279,10 @@ declare class GaugeChartDesignPanel extends Component<Props$y, SpreadsheetChildE
|
|
|
5249
5279
|
isRangeMaxInvalid(): boolean;
|
|
5250
5280
|
get isLowerInflectionPointInvalid(): boolean;
|
|
5251
5281
|
get isUpperInflectionPointInvalid(): boolean;
|
|
5252
|
-
updateInflectionPointValue(attr: string, ev: any): void;
|
|
5253
|
-
updateInflectionPointType(attr: string, ev: any): void;
|
|
5254
5282
|
updateSectionColor(target: string, color: Color): void;
|
|
5255
|
-
updateRangeMin(ev: any): void;
|
|
5256
|
-
updateRangeMax(ev: any): void;
|
|
5257
5283
|
toggleMenu(menu: GaugeMenu): void;
|
|
5258
|
-
|
|
5284
|
+
updateSectionRule(sectionRule: SectionRule): void;
|
|
5285
|
+
canUpdateSectionRule(sectionRule: SectionRule): void;
|
|
5259
5286
|
private closeMenus;
|
|
5260
5287
|
}
|
|
5261
5288
|
|
|
@@ -5270,12 +5297,14 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
|
|
|
5270
5297
|
interface Props$x {
|
|
5271
5298
|
figureId: UID;
|
|
5272
5299
|
definition: ScorecardChartDefinition;
|
|
5300
|
+
canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
|
|
5273
5301
|
updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
|
|
5274
5302
|
}
|
|
5275
5303
|
declare class ScorecardChartConfigPanel extends Component<Props$x, SpreadsheetChildEnv> {
|
|
5276
5304
|
static template: string;
|
|
5277
5305
|
static components: {
|
|
5278
5306
|
SelectionInput: typeof SelectionInput;
|
|
5307
|
+
SidePanelErrors: typeof SidePanelErrors;
|
|
5279
5308
|
};
|
|
5280
5309
|
private state;
|
|
5281
5310
|
private keyValue;
|
|
@@ -5296,6 +5325,7 @@ declare type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" |
|
|
|
5296
5325
|
interface Props$w {
|
|
5297
5326
|
figureId: UID;
|
|
5298
5327
|
definition: ScorecardChartDefinition;
|
|
5328
|
+
canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
|
|
5299
5329
|
updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
|
|
5300
5330
|
}
|
|
5301
5331
|
declare class ScorecardChartDesignPanel extends Component<Props$w, SpreadsheetChildEnv> {
|
|
@@ -7045,6 +7075,7 @@ declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
|
|
|
7045
7075
|
get figureId(): UID;
|
|
7046
7076
|
setup(): void;
|
|
7047
7077
|
updateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
|
|
7078
|
+
canUpdateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
|
|
7048
7079
|
onTypeChange(type: ChartType): void;
|
|
7049
7080
|
get chartPanel(): ChartSidePanel;
|
|
7050
7081
|
private getChartDefinition;
|