@odoo/o-spreadsheet 16.1.27 → 16.1.31
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 +301 -184
- package/dist/o-spreadsheet.d.ts +48 -25
- package/dist/o-spreadsheet.esm.js +301 -184
- package/dist/o-spreadsheet.iife.js +301 -184
- package/dist/o-spreadsheet.iife.min.js +230 -230
- package/dist/o_spreadsheet.xml +6 -7
- package/package.json +1 -1
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -202,6 +202,33 @@ declare function toCartesian(xc: string): Position$1;
|
|
|
202
202
|
*/
|
|
203
203
|
declare function toXC(col: HeaderIndex, row: HeaderIndex, rangePart?: RangePart): string;
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* A DateTime object that can be used to manipulate spreadsheet dates.
|
|
207
|
+
* Conceptually, a spreadsheet date is simply a number with a date format,
|
|
208
|
+
* and it is timezone-agnostic.
|
|
209
|
+
* This DateTime object consistently uses UTC time to represent a naive date and time.
|
|
210
|
+
*/
|
|
211
|
+
declare class DateTime {
|
|
212
|
+
private jsDate;
|
|
213
|
+
constructor(year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number);
|
|
214
|
+
static fromTimestamp(timestamp: number): DateTime;
|
|
215
|
+
static now(): DateTime;
|
|
216
|
+
toString(): string;
|
|
217
|
+
getTime(): number;
|
|
218
|
+
getFullYear(): number;
|
|
219
|
+
getMonth(): number;
|
|
220
|
+
getDate(): number;
|
|
221
|
+
getDay(): number;
|
|
222
|
+
getHours(): number;
|
|
223
|
+
getMinutes(): number;
|
|
224
|
+
getSeconds(): number;
|
|
225
|
+
setFullYear(year: number): void;
|
|
226
|
+
setDate(date: number): void;
|
|
227
|
+
setHours(hours: number): void;
|
|
228
|
+
setMinutes(minutes: number): void;
|
|
229
|
+
setSeconds(seconds: number): void;
|
|
230
|
+
}
|
|
231
|
+
|
|
205
232
|
/**
|
|
206
233
|
* Formats a cell value with its format.
|
|
207
234
|
*/
|
|
@@ -1194,7 +1221,7 @@ declare class StateObserver {
|
|
|
1194
1221
|
commands: CoreCommand[];
|
|
1195
1222
|
};
|
|
1196
1223
|
addCommand(command: CoreCommand): void;
|
|
1197
|
-
addChange(...args:
|
|
1224
|
+
addChange(...args: [...HistoryChange["path"], any]): void;
|
|
1198
1225
|
}
|
|
1199
1226
|
|
|
1200
1227
|
interface Validator {
|
|
@@ -1626,6 +1653,7 @@ interface MoveColumnsRowsCommand extends GridDependentCommand {
|
|
|
1626
1653
|
type: "MOVE_COLUMNS_ROWS";
|
|
1627
1654
|
base: HeaderIndex;
|
|
1628
1655
|
elements: HeaderIndex[];
|
|
1656
|
+
position: "before" | "after";
|
|
1629
1657
|
}
|
|
1630
1658
|
interface ResizeColumnsRowsCommand extends GridDependentCommand {
|
|
1631
1659
|
type: "RESIZE_COLUMNS_ROWS";
|
|
@@ -2259,7 +2287,8 @@ declare const enum CommandResult {
|
|
|
2259
2287
|
DuplicatedChartId = 84,
|
|
2260
2288
|
ChartDoesNotExist = 85,
|
|
2261
2289
|
InvalidHeaderIndex = 86,
|
|
2262
|
-
InvalidQuantity = 87
|
|
2290
|
+
InvalidQuantity = 87,
|
|
2291
|
+
NoChanges = 88
|
|
2263
2292
|
}
|
|
2264
2293
|
interface CommandHandler<T> {
|
|
2265
2294
|
allowDispatch(command: T): CommandResult | CommandResult[];
|
|
@@ -3043,7 +3072,8 @@ interface BordersPluginState {
|
|
|
3043
3072
|
declare class BordersPlugin extends CorePlugin<BordersPluginState> implements BordersPluginState {
|
|
3044
3073
|
static getters: readonly ["getCellBorder"];
|
|
3045
3074
|
readonly borders: BordersPluginState["borders"];
|
|
3046
|
-
|
|
3075
|
+
allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.NoChanges;
|
|
3076
|
+
handle(cmd: CoreCommand): void;
|
|
3047
3077
|
/**
|
|
3048
3078
|
* Move borders according to the inserted columns.
|
|
3049
3079
|
* Ensure borders continuity.
|
|
@@ -3140,6 +3170,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
|
|
|
3140
3170
|
* Compute the borders to add to the given zone merged.
|
|
3141
3171
|
*/
|
|
3142
3172
|
private addBordersToMerge;
|
|
3173
|
+
private checkBordersUnchanged;
|
|
3143
3174
|
import(data: WorkbookData): void;
|
|
3144
3175
|
export(data: WorkbookData): void;
|
|
3145
3176
|
exportForExcel(data: ExcelWorkbookData): void;
|
|
@@ -3164,7 +3195,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
3164
3195
|
};
|
|
3165
3196
|
};
|
|
3166
3197
|
adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
|
|
3167
|
-
allowDispatch(cmd: CoreCommand): CommandResult;
|
|
3198
|
+
allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
|
|
3168
3199
|
handle(cmd: CoreCommand): void;
|
|
3169
3200
|
/**
|
|
3170
3201
|
* Set a format to all the cells in a zone
|
|
@@ -3237,6 +3268,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
3237
3268
|
private createFormulaCellWithDependencies;
|
|
3238
3269
|
private createErrorFormula;
|
|
3239
3270
|
private checkCellOutOfSheet;
|
|
3271
|
+
private checkUselessClearCell;
|
|
3240
3272
|
}
|
|
3241
3273
|
|
|
3242
3274
|
/**
|
|
@@ -3745,15 +3777,6 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
|
|
|
3745
3777
|
*/
|
|
3746
3778
|
private moveCellOnRowsDeletion;
|
|
3747
3779
|
private updateRowsStructureOnDeletion;
|
|
3748
|
-
/**
|
|
3749
|
-
* Update the rows of the sheet after an addition:
|
|
3750
|
-
* - Rename the rows
|
|
3751
|
-
*
|
|
3752
|
-
* @param sheet Sheet on which the deletion occurs
|
|
3753
|
-
* @param addedRow Index of the added row
|
|
3754
|
-
* @param rowsToAdd Number of the rows to add
|
|
3755
|
-
*/
|
|
3756
|
-
private updateRowsStructureOnAddition;
|
|
3757
3780
|
/**
|
|
3758
3781
|
* Add empty rows at the end of the rows
|
|
3759
3782
|
*
|
|
@@ -3801,7 +3824,7 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3801
3824
|
constructor(config: UIPluginConfig);
|
|
3802
3825
|
handle(cmd: Command): void;
|
|
3803
3826
|
finalize(): void;
|
|
3804
|
-
evaluateFormula(formulaString: string, sheetId?: UID):
|
|
3827
|
+
evaluateFormula(formulaString: string, sheetId?: UID): FunctionReturnValue | null;
|
|
3805
3828
|
/**
|
|
3806
3829
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
3807
3830
|
*/
|
|
@@ -4806,8 +4829,7 @@ type Getters = {
|
|
|
4806
4829
|
} & LocalHistoryGetters & CoreGetters & SessionGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & SelectionMultiUserGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters;
|
|
4807
4830
|
|
|
4808
4831
|
interface HistoryChange {
|
|
4809
|
-
|
|
4810
|
-
path: (string | number)[];
|
|
4832
|
+
path: [any, ...(number | string)[]];
|
|
4811
4833
|
before: any;
|
|
4812
4834
|
after: any;
|
|
4813
4835
|
}
|
|
@@ -5885,8 +5907,8 @@ interface Props$d {
|
|
|
5885
5907
|
onCellHovered: (position: Partial<Position$1>) => void;
|
|
5886
5908
|
onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
|
|
5887
5909
|
onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
|
|
5888
|
-
|
|
5889
|
-
|
|
5910
|
+
addZone: boolean;
|
|
5911
|
+
expandZone: boolean;
|
|
5890
5912
|
}) => void;
|
|
5891
5913
|
onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
|
|
5892
5914
|
onGridResized: (dimension: DOMDimension) => void;
|
|
@@ -5943,6 +5965,7 @@ interface ResizerState {
|
|
|
5943
5965
|
draggerShadowThickness: number;
|
|
5944
5966
|
delta: number;
|
|
5945
5967
|
base: number;
|
|
5968
|
+
position: "before" | "after";
|
|
5946
5969
|
}
|
|
5947
5970
|
interface ResizerProps {
|
|
5948
5971
|
onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;
|
|
@@ -5965,7 +5988,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
|
|
|
5965
5988
|
abstract _getMaxSize(): Pixel;
|
|
5966
5989
|
abstract _updateSize(): void;
|
|
5967
5990
|
abstract _moveElements(): void;
|
|
5968
|
-
abstract _selectElement(index: HeaderIndex,
|
|
5991
|
+
abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
5969
5992
|
abstract _increaseSelection(index: HeaderIndex): void;
|
|
5970
5993
|
abstract _fitElementSize(index: HeaderIndex): void;
|
|
5971
5994
|
abstract _getType(): ContextMenuType;
|
|
@@ -5999,7 +6022,7 @@ declare class ColResizer extends AbstractResizer {
|
|
|
5999
6022
|
_getMaxSize(): Pixel;
|
|
6000
6023
|
_updateSize(): void;
|
|
6001
6024
|
_moveElements(): void;
|
|
6002
|
-
_selectElement(index: HeaderIndex,
|
|
6025
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6003
6026
|
_increaseSelection(index: HeaderIndex): void;
|
|
6004
6027
|
_fitElementSize(index: HeaderIndex): void;
|
|
6005
6028
|
_getType(): ContextMenuType;
|
|
@@ -6024,7 +6047,7 @@ declare class RowResizer extends AbstractResizer {
|
|
|
6024
6047
|
_getMaxSize(): Pixel;
|
|
6025
6048
|
_updateSize(): void;
|
|
6026
6049
|
_moveElements(): void;
|
|
6027
|
-
_selectElement(index: HeaderIndex,
|
|
6050
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6028
6051
|
_increaseSelection(index: HeaderIndex): void;
|
|
6029
6052
|
_fitElementSize(index: HeaderIndex): void;
|
|
6030
6053
|
_getType(): ContextMenuType;
|
|
@@ -6449,9 +6472,9 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
|
|
|
6449
6472
|
getClientPositionKey(client: Client): string;
|
|
6450
6473
|
isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
|
|
6451
6474
|
private getGridRect;
|
|
6452
|
-
onCellClicked(col: HeaderIndex, row: HeaderIndex, {
|
|
6453
|
-
|
|
6454
|
-
|
|
6475
|
+
onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
|
|
6476
|
+
addZone: boolean;
|
|
6477
|
+
expandZone: boolean;
|
|
6455
6478
|
}): void;
|
|
6456
6479
|
onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
|
|
6457
6480
|
closeOpenedPopover(): void;
|
|
@@ -6486,7 +6509,7 @@ declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
|
|
|
6486
6509
|
declare function toNumber(value: string | number | boolean | null | undefined): number;
|
|
6487
6510
|
declare function toString(value: string | number | boolean | null | undefined): string;
|
|
6488
6511
|
declare function toBoolean(value: string | number | boolean | null | undefined): boolean;
|
|
6489
|
-
declare function toJsDate(value: string | number | boolean | null | undefined):
|
|
6512
|
+
declare function toJsDate(value: string | number | boolean | null | undefined): DateTime;
|
|
6490
6513
|
|
|
6491
6514
|
/**
|
|
6492
6515
|
* This function is meant to be used as a tag for a template strings.
|