@odoo/o-spreadsheet 16.3.18 → 16.3.24
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 +529 -430
- package/dist/o-spreadsheet.d.ts +108 -77
- package/dist/o-spreadsheet.esm.js +529 -430
- package/dist/o-spreadsheet.iife.js +529 -430
- package/dist/o-spreadsheet.iife.min.js +255 -262
- package/dist/o_spreadsheet.xml +5 -5
- 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
|
*/
|
|
@@ -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";
|
|
@@ -2297,69 +2326,70 @@ declare const enum CommandResult {
|
|
|
2297
2326
|
InvalidFigureId = 28,
|
|
2298
2327
|
InputAlreadyFocused = 29,
|
|
2299
2328
|
MaximumRangesReached = 30,
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2329
|
+
InvalidInputId = 31,
|
|
2330
|
+
InvalidChartDefinition = 32,
|
|
2331
|
+
InvalidDataSet = 33,
|
|
2332
|
+
InvalidLabelRange = 34,
|
|
2333
|
+
InvalidScorecardKeyValue = 35,
|
|
2334
|
+
InvalidScorecardBaseline = 36,
|
|
2335
|
+
InvalidGaugeDataRange = 37,
|
|
2336
|
+
EmptyGaugeRangeMin = 38,
|
|
2337
|
+
GaugeRangeMinNaN = 39,
|
|
2338
|
+
EmptyGaugeRangeMax = 40,
|
|
2339
|
+
GaugeRangeMaxNaN = 41,
|
|
2340
|
+
GaugeRangeMinBiggerThanRangeMax = 42,
|
|
2341
|
+
GaugeLowerInflectionPointNaN = 43,
|
|
2342
|
+
GaugeUpperInflectionPointNaN = 44,
|
|
2343
|
+
GaugeLowerBiggerThanUpper = 45,
|
|
2344
|
+
InvalidAutofillSelection = 46,
|
|
2345
|
+
WrongComposerSelection = 47,
|
|
2346
|
+
MinBiggerThanMax = 48,
|
|
2347
|
+
LowerBiggerThanUpper = 49,
|
|
2348
|
+
MidBiggerThanMax = 50,
|
|
2349
|
+
MinBiggerThanMid = 51,
|
|
2350
|
+
FirstArgMissing = 52,
|
|
2351
|
+
SecondArgMissing = 53,
|
|
2352
|
+
MinNaN = 54,
|
|
2353
|
+
MidNaN = 55,
|
|
2354
|
+
MaxNaN = 56,
|
|
2355
|
+
ValueUpperInflectionNaN = 57,
|
|
2356
|
+
ValueLowerInflectionNaN = 58,
|
|
2357
|
+
MinInvalidFormula = 59,
|
|
2358
|
+
MidInvalidFormula = 60,
|
|
2359
|
+
MaxInvalidFormula = 61,
|
|
2360
|
+
ValueUpperInvalidFormula = 62,
|
|
2361
|
+
ValueLowerInvalidFormula = 63,
|
|
2362
|
+
InvalidSortZone = 64,
|
|
2363
|
+
WaitingSessionConfirmation = 65,
|
|
2364
|
+
MergeOverlap = 66,
|
|
2365
|
+
TooManyHiddenElements = 67,
|
|
2366
|
+
Readonly = 68,
|
|
2367
|
+
InvalidViewportSize = 69,
|
|
2368
|
+
InvalidScrollingDirection = 70,
|
|
2369
|
+
FigureDoesNotExist = 71,
|
|
2370
|
+
InvalidConditionalFormatId = 72,
|
|
2371
|
+
InvalidCellPopover = 73,
|
|
2372
|
+
EmptyTarget = 74,
|
|
2373
|
+
InvalidFreezeQuantity = 75,
|
|
2374
|
+
FrozenPaneOverlap = 76,
|
|
2375
|
+
ValuesNotChanged = 77,
|
|
2376
|
+
InvalidFilterZone = 78,
|
|
2377
|
+
FilterOverlap = 79,
|
|
2378
|
+
FilterNotFound = 80,
|
|
2379
|
+
MergeInFilter = 81,
|
|
2380
|
+
NonContinuousTargets = 82,
|
|
2381
|
+
DuplicatedFigureId = 83,
|
|
2382
|
+
InvalidSelectionStep = 84,
|
|
2383
|
+
DuplicatedChartId = 85,
|
|
2384
|
+
ChartDoesNotExist = 86,
|
|
2385
|
+
InvalidHeaderIndex = 87,
|
|
2386
|
+
InvalidQuantity = 88,
|
|
2387
|
+
MoreThanOneColumnSelected = 89,
|
|
2388
|
+
EmptySplitSeparator = 90,
|
|
2389
|
+
SplitWillOverwriteContent = 91,
|
|
2390
|
+
NoSplitSeparatorInSelection = 92,
|
|
2391
|
+
NoActiveSheet = 93,
|
|
2392
|
+
NoChanges = 94
|
|
2363
2393
|
}
|
|
2364
2394
|
interface CommandHandler<T> {
|
|
2365
2395
|
allowDispatch(command: T): CommandResult | CommandResult[];
|
|
@@ -2893,8 +2923,9 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
|
|
|
2893
2923
|
*
|
|
2894
2924
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
2895
2925
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
2926
|
+
* @param [useFixedZone=false] if true, the range will be returned with fixed row and column
|
|
2896
2927
|
*/
|
|
2897
|
-
getRangeString(range: Range, forSheetId: UID): string;
|
|
2928
|
+
getRangeString(range: Range, forSheetId: UID, useFixedZone?: boolean): string;
|
|
2898
2929
|
getRangeDataFromXc(sheetId: UID, xc: string): RangeData;
|
|
2899
2930
|
getRangeDataFromZone(sheetId: UID, zone: Zone): RangeData;
|
|
2900
2931
|
getRangeFromRangeData(data: RangeData): Range;
|
|
@@ -3113,7 +3144,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
3113
3144
|
* starting an async evaluation even if it has been moved or re-allocated
|
|
3114
3145
|
*/
|
|
3115
3146
|
getCellById(cellId: UID): Cell | undefined;
|
|
3116
|
-
buildFormulaContent(sheetId: UID, cell: Pick<FormulaCell, "dependencies" | "compiledFormula">, dependencies?: Range[]): string;
|
|
3147
|
+
buildFormulaContent(sheetId: UID, cell: Pick<FormulaCell, "dependencies" | "compiledFormula">, dependencies?: Range[], useFixedZone?: boolean): string;
|
|
3117
3148
|
getFormulaCellContent(sheetId: UID, cell: FormulaCell): string;
|
|
3118
3149
|
getCellStyle(position: CellPosition): Style;
|
|
3119
3150
|
/**
|
|
@@ -3723,7 +3754,7 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3723
3754
|
constructor(config: UIPluginConfig);
|
|
3724
3755
|
handle(cmd: Command): void;
|
|
3725
3756
|
finalize(): void;
|
|
3726
|
-
evaluateFormula(formulaString: string, sheetId?: UID):
|
|
3757
|
+
evaluateFormula(formulaString: string, sheetId?: UID): FunctionReturnValue | null;
|
|
3727
3758
|
/**
|
|
3728
3759
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
3729
3760
|
*/
|
|
@@ -4384,7 +4415,7 @@ interface RangeInputValue {
|
|
|
4384
4415
|
* This plugin handles this internal state.
|
|
4385
4416
|
*/
|
|
4386
4417
|
declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<SelectionEvent> {
|
|
4387
|
-
|
|
4418
|
+
readonly inputHasSingleRange: boolean;
|
|
4388
4419
|
static layers: LAYERS[];
|
|
4389
4420
|
static getters: never[];
|
|
4390
4421
|
ranges: RangeInputValue[];
|
|
@@ -4392,7 +4423,6 @@ declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<S
|
|
|
4392
4423
|
private activeSheet;
|
|
4393
4424
|
private willAddNewRange;
|
|
4394
4425
|
constructor(config: UIPluginConfig, initialRanges: string[], inputHasSingleRange: boolean);
|
|
4395
|
-
allowDispatch(cmd: LocalCommand): CommandResult;
|
|
4396
4426
|
handleEvent(event: SelectionEvent): void;
|
|
4397
4427
|
handle(cmd: Command): void;
|
|
4398
4428
|
getSelectionInputValue(): string[];
|
|
@@ -5932,8 +5962,8 @@ interface Props$j {
|
|
|
5932
5962
|
onCellHovered: (position: Partial<Position$1>) => void;
|
|
5933
5963
|
onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
|
|
5934
5964
|
onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
|
|
5935
|
-
|
|
5936
|
-
|
|
5965
|
+
addZone: boolean;
|
|
5966
|
+
expandZone: boolean;
|
|
5937
5967
|
}) => void;
|
|
5938
5968
|
onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
|
|
5939
5969
|
onGridResized: (dimension: DOMDimension) => void;
|
|
@@ -6790,6 +6820,7 @@ interface ResizerState {
|
|
|
6790
6820
|
draggerShadowThickness: number;
|
|
6791
6821
|
delta: number;
|
|
6792
6822
|
base: number;
|
|
6823
|
+
position: "before" | "after";
|
|
6793
6824
|
}
|
|
6794
6825
|
interface ResizerProps {
|
|
6795
6826
|
onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;
|
|
@@ -6812,7 +6843,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
|
|
|
6812
6843
|
abstract _getMaxSize(): Pixel;
|
|
6813
6844
|
abstract _updateSize(): void;
|
|
6814
6845
|
abstract _moveElements(): void;
|
|
6815
|
-
abstract _selectElement(index: HeaderIndex,
|
|
6846
|
+
abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6816
6847
|
abstract _increaseSelection(index: HeaderIndex): void;
|
|
6817
6848
|
abstract _fitElementSize(index: HeaderIndex): void;
|
|
6818
6849
|
abstract _getType(): ContextMenuType;
|
|
@@ -6846,7 +6877,7 @@ declare class ColResizer extends AbstractResizer {
|
|
|
6846
6877
|
_getMaxSize(): Pixel;
|
|
6847
6878
|
_updateSize(): void;
|
|
6848
6879
|
_moveElements(): void;
|
|
6849
|
-
_selectElement(index: HeaderIndex,
|
|
6880
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6850
6881
|
_increaseSelection(index: HeaderIndex): void;
|
|
6851
6882
|
_fitElementSize(index: HeaderIndex): void;
|
|
6852
6883
|
_getType(): ContextMenuType;
|
|
@@ -6871,7 +6902,7 @@ declare class RowResizer extends AbstractResizer {
|
|
|
6871
6902
|
_getMaxSize(): Pixel;
|
|
6872
6903
|
_updateSize(): void;
|
|
6873
6904
|
_moveElements(): void;
|
|
6874
|
-
_selectElement(index: HeaderIndex,
|
|
6905
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
6875
6906
|
_increaseSelection(index: HeaderIndex): void;
|
|
6876
6907
|
_fitElementSize(index: HeaderIndex): void;
|
|
6877
6908
|
_getType(): ContextMenuType;
|
|
@@ -6998,9 +7029,9 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
|
|
|
6998
7029
|
getClientPositionKey(client: Client): string;
|
|
6999
7030
|
isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
|
|
7000
7031
|
private getGridRect;
|
|
7001
|
-
onCellClicked(col: HeaderIndex, row: HeaderIndex, {
|
|
7002
|
-
|
|
7003
|
-
|
|
7032
|
+
onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
|
|
7033
|
+
addZone: boolean;
|
|
7034
|
+
expandZone: boolean;
|
|
7004
7035
|
}): void;
|
|
7005
7036
|
onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
|
|
7006
7037
|
closeOpenedPopover(): void;
|
|
@@ -7037,7 +7068,7 @@ declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
|
|
|
7037
7068
|
declare function toNumber(value: string | number | boolean | null | undefined): number;
|
|
7038
7069
|
declare function toString(value: string | number | boolean | null | undefined): string;
|
|
7039
7070
|
declare function toBoolean(value: string | number | boolean | null | undefined): boolean;
|
|
7040
|
-
declare function toJsDate(value: string | number | boolean | null | undefined):
|
|
7071
|
+
declare function toJsDate(value: string | number | boolean | null | undefined): DateTime;
|
|
7041
7072
|
|
|
7042
7073
|
declare function arg(definition: string, description?: string): ArgDefinition;
|
|
7043
7074
|
|