@odoo/o-spreadsheet 16.1.28 → 16.1.33

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.
@@ -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
  */
@@ -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";
@@ -2203,64 +2231,65 @@ declare const enum CommandResult {
2203
2231
  InvalidFigureId = 28,
2204
2232
  InputAlreadyFocused = 29,
2205
2233
  MaximumRangesReached = 30,
2206
- InvalidChartDefinition = 31,
2207
- InvalidDataSet = 32,
2208
- InvalidLabelRange = 33,
2209
- InvalidScorecardKeyValue = 34,
2210
- InvalidScorecardBaseline = 35,
2211
- InvalidGaugeDataRange = 36,
2212
- EmptyGaugeRangeMin = 37,
2213
- GaugeRangeMinNaN = 38,
2214
- EmptyGaugeRangeMax = 39,
2215
- GaugeRangeMaxNaN = 40,
2216
- GaugeRangeMinBiggerThanRangeMax = 41,
2217
- GaugeLowerInflectionPointNaN = 42,
2218
- GaugeUpperInflectionPointNaN = 43,
2219
- GaugeLowerBiggerThanUpper = 44,
2220
- InvalidAutofillSelection = 45,
2221
- WrongComposerSelection = 46,
2222
- MinBiggerThanMax = 47,
2223
- LowerBiggerThanUpper = 48,
2224
- MidBiggerThanMax = 49,
2225
- MinBiggerThanMid = 50,
2226
- FirstArgMissing = 51,
2227
- SecondArgMissing = 52,
2228
- MinNaN = 53,
2229
- MidNaN = 54,
2230
- MaxNaN = 55,
2231
- ValueUpperInflectionNaN = 56,
2232
- ValueLowerInflectionNaN = 57,
2233
- MinInvalidFormula = 58,
2234
- MidInvalidFormula = 59,
2235
- MaxInvalidFormula = 60,
2236
- ValueUpperInvalidFormula = 61,
2237
- ValueLowerInvalidFormula = 62,
2238
- InvalidSortZone = 63,
2239
- WaitingSessionConfirmation = 64,
2240
- MergeOverlap = 65,
2241
- TooManyHiddenElements = 66,
2242
- Readonly = 67,
2243
- InvalidViewportSize = 68,
2244
- InvalidScrollingDirection = 69,
2245
- FigureDoesNotExist = 70,
2246
- InvalidConditionalFormatId = 71,
2247
- InvalidCellPopover = 72,
2248
- EmptyTarget = 73,
2249
- InvalidFreezeQuantity = 74,
2250
- FrozenPaneOverlap = 75,
2251
- ValuesNotChanged = 76,
2252
- InvalidFilterZone = 77,
2253
- FilterOverlap = 78,
2254
- FilterNotFound = 79,
2255
- MergeInFilter = 80,
2256
- NonContinuousTargets = 81,
2257
- DuplicatedFigureId = 82,
2258
- InvalidSelectionStep = 83,
2259
- DuplicatedChartId = 84,
2260
- ChartDoesNotExist = 85,
2261
- InvalidHeaderIndex = 86,
2262
- InvalidQuantity = 87,
2263
- NoChanges = 88
2234
+ InvalidInputId = 31,
2235
+ InvalidChartDefinition = 32,
2236
+ InvalidDataSet = 33,
2237
+ InvalidLabelRange = 34,
2238
+ InvalidScorecardKeyValue = 35,
2239
+ InvalidScorecardBaseline = 36,
2240
+ InvalidGaugeDataRange = 37,
2241
+ EmptyGaugeRangeMin = 38,
2242
+ GaugeRangeMinNaN = 39,
2243
+ EmptyGaugeRangeMax = 40,
2244
+ GaugeRangeMaxNaN = 41,
2245
+ GaugeRangeMinBiggerThanRangeMax = 42,
2246
+ GaugeLowerInflectionPointNaN = 43,
2247
+ GaugeUpperInflectionPointNaN = 44,
2248
+ GaugeLowerBiggerThanUpper = 45,
2249
+ InvalidAutofillSelection = 46,
2250
+ WrongComposerSelection = 47,
2251
+ MinBiggerThanMax = 48,
2252
+ LowerBiggerThanUpper = 49,
2253
+ MidBiggerThanMax = 50,
2254
+ MinBiggerThanMid = 51,
2255
+ FirstArgMissing = 52,
2256
+ SecondArgMissing = 53,
2257
+ MinNaN = 54,
2258
+ MidNaN = 55,
2259
+ MaxNaN = 56,
2260
+ ValueUpperInflectionNaN = 57,
2261
+ ValueLowerInflectionNaN = 58,
2262
+ MinInvalidFormula = 59,
2263
+ MidInvalidFormula = 60,
2264
+ MaxInvalidFormula = 61,
2265
+ ValueUpperInvalidFormula = 62,
2266
+ ValueLowerInvalidFormula = 63,
2267
+ InvalidSortZone = 64,
2268
+ WaitingSessionConfirmation = 65,
2269
+ MergeOverlap = 66,
2270
+ TooManyHiddenElements = 67,
2271
+ Readonly = 68,
2272
+ InvalidViewportSize = 69,
2273
+ InvalidScrollingDirection = 70,
2274
+ FigureDoesNotExist = 71,
2275
+ InvalidConditionalFormatId = 72,
2276
+ InvalidCellPopover = 73,
2277
+ EmptyTarget = 74,
2278
+ InvalidFreezeQuantity = 75,
2279
+ FrozenPaneOverlap = 76,
2280
+ ValuesNotChanged = 77,
2281
+ InvalidFilterZone = 78,
2282
+ FilterOverlap = 79,
2283
+ FilterNotFound = 80,
2284
+ MergeInFilter = 81,
2285
+ NonContinuousTargets = 82,
2286
+ DuplicatedFigureId = 83,
2287
+ InvalidSelectionStep = 84,
2288
+ DuplicatedChartId = 85,
2289
+ ChartDoesNotExist = 86,
2290
+ InvalidHeaderIndex = 87,
2291
+ InvalidQuantity = 88,
2292
+ NoChanges = 89
2264
2293
  }
2265
2294
  interface CommandHandler<T> {
2266
2295
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -3796,7 +3825,7 @@ declare class EvaluationPlugin extends UIPlugin {
3796
3825
  constructor(config: UIPluginConfig);
3797
3826
  handle(cmd: Command): void;
3798
3827
  finalize(): void;
3799
- evaluateFormula(formulaString: string, sheetId?: UID): any;
3828
+ evaluateFormula(formulaString: string, sheetId?: UID): FunctionReturnValue | null;
3800
3829
  /**
3801
3830
  * Return the value of each cell in the range as they are displayed in the grid.
3802
3831
  */
@@ -4396,7 +4425,7 @@ interface RangeInputValue {
4396
4425
  * This plugin handles this internal state.
4397
4426
  */
4398
4427
  declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<SelectionEvent> {
4399
- private readonly inputHasSingleRange;
4428
+ readonly inputHasSingleRange: boolean;
4400
4429
  static layers: LAYERS[];
4401
4430
  static getters: never[];
4402
4431
  ranges: RangeInputValue[];
@@ -4404,7 +4433,6 @@ declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<S
4404
4433
  private activeSheet;
4405
4434
  private willAddNewRange;
4406
4435
  constructor(config: UIPluginConfig, initialRanges: string[], inputHasSingleRange: boolean);
4407
- allowDispatch(cmd: Command): CommandResult;
4408
4436
  handleEvent(event: SelectionEvent): void;
4409
4437
  handle(cmd: Command): void;
4410
4438
  unsubscribe(): void;
@@ -5879,8 +5907,8 @@ interface Props$d {
5879
5907
  onCellHovered: (position: Partial<Position$1>) => void;
5880
5908
  onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
5881
5909
  onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
5882
- ctrlKey: boolean;
5883
- shiftKey: boolean;
5910
+ addZone: boolean;
5911
+ expandZone: boolean;
5884
5912
  }) => void;
5885
5913
  onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
5886
5914
  onGridResized: (dimension: DOMDimension) => void;
@@ -5937,6 +5965,7 @@ interface ResizerState {
5937
5965
  draggerShadowThickness: number;
5938
5966
  delta: number;
5939
5967
  base: number;
5968
+ position: "before" | "after";
5940
5969
  }
5941
5970
  interface ResizerProps {
5942
5971
  onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;
@@ -5959,7 +5988,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
5959
5988
  abstract _getMaxSize(): Pixel;
5960
5989
  abstract _updateSize(): void;
5961
5990
  abstract _moveElements(): void;
5962
- abstract _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
5991
+ abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
5963
5992
  abstract _increaseSelection(index: HeaderIndex): void;
5964
5993
  abstract _fitElementSize(index: HeaderIndex): void;
5965
5994
  abstract _getType(): ContextMenuType;
@@ -5993,7 +6022,7 @@ declare class ColResizer extends AbstractResizer {
5993
6022
  _getMaxSize(): Pixel;
5994
6023
  _updateSize(): void;
5995
6024
  _moveElements(): void;
5996
- _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
6025
+ _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
5997
6026
  _increaseSelection(index: HeaderIndex): void;
5998
6027
  _fitElementSize(index: HeaderIndex): void;
5999
6028
  _getType(): ContextMenuType;
@@ -6018,7 +6047,7 @@ declare class RowResizer extends AbstractResizer {
6018
6047
  _getMaxSize(): Pixel;
6019
6048
  _updateSize(): void;
6020
6049
  _moveElements(): void;
6021
- _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
6050
+ _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
6022
6051
  _increaseSelection(index: HeaderIndex): void;
6023
6052
  _fitElementSize(index: HeaderIndex): void;
6024
6053
  _getType(): ContextMenuType;
@@ -6443,9 +6472,9 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
6443
6472
  getClientPositionKey(client: Client): string;
6444
6473
  isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
6445
6474
  private getGridRect;
6446
- onCellClicked(col: HeaderIndex, row: HeaderIndex, { ctrlKey, shiftKey }: {
6447
- ctrlKey: boolean;
6448
- shiftKey: boolean;
6475
+ onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
6476
+ addZone: boolean;
6477
+ expandZone: boolean;
6449
6478
  }): void;
6450
6479
  onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
6451
6480
  closeOpenedPopover(): void;
@@ -6480,7 +6509,7 @@ declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
6480
6509
  declare function toNumber(value: string | number | boolean | null | undefined): number;
6481
6510
  declare function toString(value: string | number | boolean | null | undefined): string;
6482
6511
  declare function toBoolean(value: string | number | boolean | null | undefined): boolean;
6483
- declare function toJsDate(value: string | number | boolean | null | undefined): Date;
6512
+ declare function toJsDate(value: string | number | boolean | null | undefined): DateTime;
6484
6513
 
6485
6514
  /**
6486
6515
  * This function is meant to be used as a tag for a template strings.