@odoo/o-spreadsheet 16.3.17 → 16.3.22
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 +318 -196
- package/dist/o-spreadsheet.d.ts +49 -25
- package/dist/o-spreadsheet.esm.js +318 -196
- package/dist/o-spreadsheet.iife.js +318 -196
- package/dist/o-spreadsheet.iife.min.js +256 -256
- package/dist/o_spreadsheet.xml +6 -7
- package/package.json +1 -1
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -911,6 +911,34 @@ declare function toCartesian(xc: string): Position$1;
|
|
|
911
911
|
*/
|
|
912
912
|
declare function toXC(col: HeaderIndex, row: HeaderIndex, rangePart?: RangePart): string;
|
|
913
913
|
|
|
914
|
+
/**
|
|
915
|
+
* A DateTime object that can be used to manipulate spreadsheet dates.
|
|
916
|
+
* Conceptually, a spreadsheet date is simply a number with a date format,
|
|
917
|
+
* and it is timezone-agnostic.
|
|
918
|
+
* This DateTime object consistently uses UTC time to represent a naive date and time.
|
|
919
|
+
*/
|
|
920
|
+
declare class DateTime {
|
|
921
|
+
private jsDate;
|
|
922
|
+
constructor(year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number);
|
|
923
|
+
static fromTimestamp(timestamp: number): DateTime;
|
|
924
|
+
static now(): DateTime;
|
|
925
|
+
toString(): string;
|
|
926
|
+
toLocaleDateString(): string;
|
|
927
|
+
getTime(): number;
|
|
928
|
+
getFullYear(): number;
|
|
929
|
+
getMonth(): number;
|
|
930
|
+
getDate(): number;
|
|
931
|
+
getDay(): number;
|
|
932
|
+
getHours(): number;
|
|
933
|
+
getMinutes(): number;
|
|
934
|
+
getSeconds(): number;
|
|
935
|
+
setFullYear(year: number): void;
|
|
936
|
+
setDate(date: number): void;
|
|
937
|
+
setHours(hours: number): void;
|
|
938
|
+
setMinutes(minutes: number): void;
|
|
939
|
+
setSeconds(seconds: number): void;
|
|
940
|
+
}
|
|
941
|
+
|
|
914
942
|
/**
|
|
915
943
|
* Formats a cell value with its format.
|
|
916
944
|
*/
|
|
@@ -1282,7 +1310,7 @@ declare class StateObserver {
|
|
|
1282
1310
|
commands: CoreCommand[];
|
|
1283
1311
|
};
|
|
1284
1312
|
addCommand(command: CoreCommand): void;
|
|
1285
|
-
addChange(...args:
|
|
1313
|
+
addChange(...args: [...HistoryChange["path"], any]): void;
|
|
1286
1314
|
}
|
|
1287
1315
|
|
|
1288
1316
|
interface Validator {
|
|
@@ -1709,6 +1737,7 @@ interface MoveColumnsRowsCommand extends GridDependentCommand {
|
|
|
1709
1737
|
type: "MOVE_COLUMNS_ROWS";
|
|
1710
1738
|
base: HeaderIndex;
|
|
1711
1739
|
elements: HeaderIndex[];
|
|
1740
|
+
position: "before" | "after";
|
|
1712
1741
|
}
|
|
1713
1742
|
interface ResizeColumnsRowsCommand extends GridDependentCommand {
|
|
1714
1743
|
type: "RESIZE_COLUMNS_ROWS";
|
|
@@ -2358,7 +2387,8 @@ declare const enum CommandResult {
|
|
|
2358
2387
|
EmptySplitSeparator = 89,
|
|
2359
2388
|
SplitWillOverwriteContent = 90,
|
|
2360
2389
|
NoSplitSeparatorInSelection = 91,
|
|
2361
|
-
NoActiveSheet = 92
|
|
2390
|
+
NoActiveSheet = 92,
|
|
2391
|
+
NoChanges = 93
|
|
2362
2392
|
}
|
|
2363
2393
|
interface CommandHandler<T> {
|
|
2364
2394
|
allowDispatch(command: T): CommandResult | CommandResult[];
|
|
@@ -2960,7 +2990,8 @@ interface BordersPluginState {
|
|
|
2960
2990
|
declare class BordersPlugin extends CorePlugin<BordersPluginState> implements BordersPluginState {
|
|
2961
2991
|
static getters: readonly ["getCellBorder", "getBordersColors"];
|
|
2962
2992
|
readonly borders: BordersPluginState["borders"];
|
|
2963
|
-
|
|
2993
|
+
allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.NoChanges;
|
|
2994
|
+
handle(cmd: CoreCommand): void;
|
|
2964
2995
|
/**
|
|
2965
2996
|
* Move borders according to the inserted columns.
|
|
2966
2997
|
* Ensure borders continuity.
|
|
@@ -3058,6 +3089,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
|
|
|
3058
3089
|
* Compute the borders to add to the given zone merged.
|
|
3059
3090
|
*/
|
|
3060
3091
|
private addBordersToMerge;
|
|
3092
|
+
private checkBordersUnchanged;
|
|
3061
3093
|
import(data: WorkbookData): void;
|
|
3062
3094
|
export(data: WorkbookData): void;
|
|
3063
3095
|
exportForExcel(data: ExcelWorkbookData): void;
|
|
@@ -3082,7 +3114,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
3082
3114
|
};
|
|
3083
3115
|
};
|
|
3084
3116
|
adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
|
|
3085
|
-
allowDispatch(cmd: CoreCommand): CommandResult;
|
|
3117
|
+
allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
|
|
3086
3118
|
handle(cmd: CoreCommand): void;
|
|
3087
3119
|
/**
|
|
3088
3120
|
* Set a format to all the cells in a zone
|
|
@@ -3155,6 +3187,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
3155
3187
|
private createFormulaCellWithDependencies;
|
|
3156
3188
|
private createErrorFormula;
|
|
3157
3189
|
private checkCellOutOfSheet;
|
|
3190
|
+
private checkUselessClearCell;
|
|
3158
3191
|
}
|
|
3159
3192
|
|
|
3160
3193
|
/**
|
|
@@ -3672,15 +3705,6 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
|
|
|
3672
3705
|
*/
|
|
3673
3706
|
private moveCellOnRowsDeletion;
|
|
3674
3707
|
private updateRowsStructureOnDeletion;
|
|
3675
|
-
/**
|
|
3676
|
-
* Update the rows of the sheet after an addition:
|
|
3677
|
-
* - Rename the rows
|
|
3678
|
-
*
|
|
3679
|
-
* @param sheet Sheet on which the deletion occurs
|
|
3680
|
-
* @param addedRow Index of the added row
|
|
3681
|
-
* @param rowsToAdd Number of the rows to add
|
|
3682
|
-
*/
|
|
3683
|
-
private updateRowsStructureOnAddition;
|
|
3684
3708
|
/**
|
|
3685
3709
|
* Add empty rows at the end of the rows
|
|
3686
3710
|
*
|
|
@@ -3728,7 +3752,7 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3728
3752
|
constructor(config: UIPluginConfig);
|
|
3729
3753
|
handle(cmd: Command): void;
|
|
3730
3754
|
finalize(): void;
|
|
3731
|
-
evaluateFormula(formulaString: string, sheetId?: UID):
|
|
3755
|
+
evaluateFormula(formulaString: string, sheetId?: UID): FunctionReturnValue | null;
|
|
3732
3756
|
/**
|
|
3733
3757
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
3734
3758
|
*/
|
|
@@ -4805,8 +4829,7 @@ type Getters = {
|
|
|
4805
4829
|
} & LocalHistoryGetters & CoreGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & CollaborativeGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters & SplitToColumnsGetters;
|
|
4806
4830
|
|
|
4807
4831
|
interface HistoryChange {
|
|
4808
|
-
|
|
4809
|
-
path: (string | number)[];
|
|
4832
|
+
path: [any, ...(number | string)[]];
|
|
4810
4833
|
before: any;
|
|
4811
4834
|
after: any;
|
|
4812
4835
|
}
|
|
@@ -5938,8 +5961,8 @@ interface Props$j {
|
|
|
5938
5961
|
onCellHovered: (position: Partial<Position$1>) => void;
|
|
5939
5962
|
onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
|
|
5940
5963
|
onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
|
|
5941
|
-
|
|
5942
|
-
|
|
5964
|
+
addZone: boolean;
|
|
5965
|
+
expandZone: boolean;
|
|
5943
5966
|
}) => void;
|
|
5944
5967
|
onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
|
|
5945
5968
|
onGridResized: (dimension: DOMDimension) => void;
|
|
@@ -6796,6 +6819,7 @@ interface ResizerState {
|
|
|
6796
6819
|
draggerShadowThickness: number;
|
|
6797
6820
|
delta: number;
|
|
6798
6821
|
base: number;
|
|
6822
|
+
position: "before" | "after";
|
|
6799
6823
|
}
|
|
6800
6824
|
interface ResizerProps {
|
|
6801
6825
|
onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;
|
|
@@ -6818,7 +6842,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
|
|
|
6818
6842
|
abstract _getMaxSize(): Pixel;
|
|
6819
6843
|
abstract _updateSize(): void;
|
|
6820
6844
|
abstract _moveElements(): void;
|
|
6821
|
-
abstract _selectElement(index: HeaderIndex,
|
|
6845
|
+
abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6822
6846
|
abstract _increaseSelection(index: HeaderIndex): void;
|
|
6823
6847
|
abstract _fitElementSize(index: HeaderIndex): void;
|
|
6824
6848
|
abstract _getType(): ContextMenuType;
|
|
@@ -6852,7 +6876,7 @@ declare class ColResizer extends AbstractResizer {
|
|
|
6852
6876
|
_getMaxSize(): Pixel;
|
|
6853
6877
|
_updateSize(): void;
|
|
6854
6878
|
_moveElements(): void;
|
|
6855
|
-
_selectElement(index: HeaderIndex,
|
|
6879
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6856
6880
|
_increaseSelection(index: HeaderIndex): void;
|
|
6857
6881
|
_fitElementSize(index: HeaderIndex): void;
|
|
6858
6882
|
_getType(): ContextMenuType;
|
|
@@ -6877,7 +6901,7 @@ declare class RowResizer extends AbstractResizer {
|
|
|
6877
6901
|
_getMaxSize(): Pixel;
|
|
6878
6902
|
_updateSize(): void;
|
|
6879
6903
|
_moveElements(): void;
|
|
6880
|
-
_selectElement(index: HeaderIndex,
|
|
6904
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6881
6905
|
_increaseSelection(index: HeaderIndex): void;
|
|
6882
6906
|
_fitElementSize(index: HeaderIndex): void;
|
|
6883
6907
|
_getType(): ContextMenuType;
|
|
@@ -7004,9 +7028,9 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
|
|
|
7004
7028
|
getClientPositionKey(client: Client): string;
|
|
7005
7029
|
isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
|
|
7006
7030
|
private getGridRect;
|
|
7007
|
-
onCellClicked(col: HeaderIndex, row: HeaderIndex, {
|
|
7008
|
-
|
|
7009
|
-
|
|
7031
|
+
onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
|
|
7032
|
+
addZone: boolean;
|
|
7033
|
+
expandZone: boolean;
|
|
7010
7034
|
}): void;
|
|
7011
7035
|
onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
|
|
7012
7036
|
closeOpenedPopover(): void;
|
|
@@ -7043,7 +7067,7 @@ declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
|
|
|
7043
7067
|
declare function toNumber(value: string | number | boolean | null | undefined): number;
|
|
7044
7068
|
declare function toString(value: string | number | boolean | null | undefined): string;
|
|
7045
7069
|
declare function toBoolean(value: string | number | boolean | null | undefined): boolean;
|
|
7046
|
-
declare function toJsDate(value: string | number | boolean | null | undefined):
|
|
7070
|
+
declare function toJsDate(value: string | number | boolean | null | undefined): DateTime;
|
|
7047
7071
|
|
|
7048
7072
|
declare function arg(definition: string, description?: string): ArgDefinition;
|
|
7049
7073
|
|