@odoo/o-spreadsheet 17.0.13 → 17.0.15
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 +106 -79
- package/dist/o-spreadsheet.d.ts +17 -10
- package/dist/o-spreadsheet.esm.js +106 -79
- package/dist/o-spreadsheet.iife.js +106 -79
- package/dist/o-spreadsheet.iife.min.js +12 -10
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.0.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.15
|
|
6
|
+
* @date 2024-03-15T11:00:59.958Z
|
|
7
|
+
* @hash e02add9
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -6059,8 +6059,10 @@ function getGroup(cell, cells, filter) {
|
|
|
6059
6059
|
if (x === cell) {
|
|
6060
6060
|
found = true;
|
|
6061
6061
|
}
|
|
6062
|
-
const cellValue =
|
|
6063
|
-
|
|
6062
|
+
const cellValue = x?.isFormula
|
|
6063
|
+
? undefined
|
|
6064
|
+
: evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
|
|
6065
|
+
if (cellValue && filter(cellValue)) {
|
|
6064
6066
|
group.push(cellValue);
|
|
6065
6067
|
}
|
|
6066
6068
|
else {
|
|
@@ -19443,10 +19445,8 @@ function createComputeFunctionFromDescription(descr) {
|
|
|
19443
19445
|
}
|
|
19444
19446
|
function buildComputeFunctionFromDescription(descr) {
|
|
19445
19447
|
return function (...args) {
|
|
19446
|
-
const
|
|
19447
|
-
const
|
|
19448
|
-
const value = computeValue(...extractArgValuesFromArgs(args));
|
|
19449
|
-
const format = computeFormat(...args);
|
|
19448
|
+
const value = descr.compute.apply(this, extractArgValuesFromArgs(args));
|
|
19449
|
+
const format = descr.computeFormat?.apply(this, args);
|
|
19450
19450
|
if (isMatrix(value)) {
|
|
19451
19451
|
if (format === undefined || isMatrix(format)) {
|
|
19452
19452
|
return value.map((col, i) => col.map((row, j) => ({ value: row, format: format?.[i]?.[j] })));
|
|
@@ -27271,7 +27271,11 @@ class GridComposer extends owl.Component {
|
|
|
27271
27271
|
}
|
|
27272
27272
|
}
|
|
27273
27273
|
updateCellReferenceVisibility() {
|
|
27274
|
-
if (this.
|
|
27274
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
27275
|
+
this.isCellReferenceVisible = false;
|
|
27276
|
+
return;
|
|
27277
|
+
}
|
|
27278
|
+
if (this.isCellReferenceVisible) {
|
|
27275
27279
|
return;
|
|
27276
27280
|
}
|
|
27277
27281
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -27300,19 +27304,21 @@ class GridCellIcon extends owl.Component {
|
|
|
27300
27304
|
static style = CSS$1;
|
|
27301
27305
|
static template = "o-spreadsheet-GridCellIcon";
|
|
27302
27306
|
get iconStyle() {
|
|
27303
|
-
const
|
|
27304
|
-
const
|
|
27307
|
+
const cellPosition = this.props.cellPosition;
|
|
27308
|
+
const merge = this.env.model.getters.getMerge(cellPosition);
|
|
27309
|
+
const zone = merge || positionToZone(cellPosition);
|
|
27310
|
+
const rect = this.env.model.getters.getVisibleRectWithoutHeaders(zone);
|
|
27311
|
+
const x = this.getIconHorizontalPosition(rect, cellPosition);
|
|
27312
|
+
const y = this.getIconVerticalPosition(rect, cellPosition);
|
|
27305
27313
|
return cssPropertiesToCss({
|
|
27306
27314
|
top: `${y + (this.props.offset?.y || 0)}px`,
|
|
27307
27315
|
left: `${x + (this.props.offset?.x || 0)}px`,
|
|
27308
27316
|
});
|
|
27309
27317
|
}
|
|
27310
|
-
getIconVerticalPosition() {
|
|
27311
|
-
const
|
|
27312
|
-
const
|
|
27313
|
-
const
|
|
27314
|
-
const end = this.env.model.getters.getRowDimensionsInViewport(sheetId, merge ? merge.bottom : row).end;
|
|
27315
|
-
const cell = this.env.model.getters.getCell(this.props.cellPosition);
|
|
27318
|
+
getIconVerticalPosition(rect, cellPosition) {
|
|
27319
|
+
const start = rect.y;
|
|
27320
|
+
const end = rect.y + rect.height;
|
|
27321
|
+
const cell = this.env.model.getters.getCell(cellPosition);
|
|
27316
27322
|
const align = this.props.verticalAlign || cell?.style?.verticalAlign || DEFAULT_VERTICAL_ALIGN;
|
|
27317
27323
|
switch (align) {
|
|
27318
27324
|
case "bottom":
|
|
@@ -27324,13 +27330,11 @@ class GridCellIcon extends owl.Component {
|
|
|
27324
27330
|
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
27325
27331
|
}
|
|
27326
27332
|
}
|
|
27327
|
-
getIconHorizontalPosition() {
|
|
27328
|
-
const
|
|
27329
|
-
const
|
|
27330
|
-
const
|
|
27331
|
-
const
|
|
27332
|
-
const cell = this.env.model.getters.getCell(this.props.cellPosition);
|
|
27333
|
-
const evaluatedCell = this.env.model.getters.getEvaluatedCell(this.props.cellPosition);
|
|
27333
|
+
getIconHorizontalPosition(rect, cellPosition) {
|
|
27334
|
+
const start = rect.x;
|
|
27335
|
+
const end = rect.x + rect.width;
|
|
27336
|
+
const cell = this.env.model.getters.getCell(cellPosition);
|
|
27337
|
+
const evaluatedCell = this.env.model.getters.getEvaluatedCell(cellPosition);
|
|
27334
27338
|
const align = this.props.horizontalAlign || cell?.style?.align || evaluatedCell.defaultAlign;
|
|
27335
27339
|
switch (align) {
|
|
27336
27340
|
case "right":
|
|
@@ -27422,6 +27426,8 @@ css /* scss */ `
|
|
|
27422
27426
|
height: ${CHECKBOX_WIDTH}px;
|
|
27423
27427
|
accent-color: #808080;
|
|
27424
27428
|
margin: ${MARGIN}px;
|
|
27429
|
+
/** required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
|
|
27430
|
+
position: absolute;
|
|
27425
27431
|
}
|
|
27426
27432
|
`;
|
|
27427
27433
|
class DataValidationCheckbox extends owl.Component {
|
|
@@ -27437,7 +27443,7 @@ class DataValidationCheckbox extends owl.Component {
|
|
|
27437
27443
|
}
|
|
27438
27444
|
get isDisabled() {
|
|
27439
27445
|
const cell = this.env.model.getters.getCell(this.props.cellPosition);
|
|
27440
|
-
return !!cell?.isFormula;
|
|
27446
|
+
return this.env.model.getters.isReadonly() || !!cell?.isFormula;
|
|
27441
27447
|
}
|
|
27442
27448
|
}
|
|
27443
27449
|
DataValidationCheckbox.props = {
|
|
@@ -27479,12 +27485,17 @@ class DataValidationOverlay extends owl.Component {
|
|
|
27479
27485
|
static template = "o-spreadsheet-DataValidationOverlay";
|
|
27480
27486
|
static components = { GridCellIcon, DataValidationCheckbox, DataValidationListIcon };
|
|
27481
27487
|
get checkBoxCellPositions() {
|
|
27482
|
-
return this.env.model.getters
|
|
27488
|
+
return this.env.model.getters
|
|
27489
|
+
.getVisibleCellPositions()
|
|
27490
|
+
.filter(this.env.model.getters.isCellValidCheckbox);
|
|
27483
27491
|
}
|
|
27484
27492
|
get listIconsCellPositions() {
|
|
27485
|
-
|
|
27486
|
-
|
|
27487
|
-
|
|
27493
|
+
if (this.env.model.getters.isReadonly()) {
|
|
27494
|
+
return [];
|
|
27495
|
+
}
|
|
27496
|
+
return this.env.model.getters
|
|
27497
|
+
.getVisibleCellPositions()
|
|
27498
|
+
.filter(this.env.model.getters.cellHasListDataValidationIcon);
|
|
27488
27499
|
}
|
|
27489
27500
|
}
|
|
27490
27501
|
DataValidationOverlay.props = {};
|
|
@@ -27533,7 +27544,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
27533
27544
|
function clamp(value, min, max) {
|
|
27534
27545
|
return Math.min(Math.max(value, min), max);
|
|
27535
27546
|
}
|
|
27536
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
27547
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
27537
27548
|
let { x, y, width, height } = initialFigure;
|
|
27538
27549
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
27539
27550
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -27560,14 +27571,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
27560
27571
|
y = initialFigure.y - deltaY;
|
|
27561
27572
|
}
|
|
27562
27573
|
}
|
|
27563
|
-
//
|
|
27564
|
-
if (x
|
|
27565
|
-
width
|
|
27566
|
-
x =
|
|
27574
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
27575
|
+
if (x + scrollX <= 0) {
|
|
27576
|
+
width = width + x + scrollX;
|
|
27577
|
+
x = -scrollX;
|
|
27567
27578
|
}
|
|
27568
|
-
if (y
|
|
27569
|
-
height
|
|
27570
|
-
y =
|
|
27579
|
+
if (y + scrollY <= 0) {
|
|
27580
|
+
height = height + y + scrollY;
|
|
27581
|
+
y = -scrollY;
|
|
27571
27582
|
}
|
|
27572
27583
|
return { ...initialFigure, x, y, width, height };
|
|
27573
27584
|
}
|
|
@@ -27984,7 +27995,7 @@ class FiguresContainer extends owl.Component {
|
|
|
27984
27995
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
27985
27996
|
const onMouseMove = (ev) => {
|
|
27986
27997
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
27987
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
27998
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
27988
27999
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
27989
28000
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
27990
28001
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -36814,6 +36825,15 @@ class FigurePlugin extends CorePlugin {
|
|
|
36814
36825
|
return "Success" /* CommandResult.Success */;
|
|
36815
36826
|
}
|
|
36816
36827
|
}
|
|
36828
|
+
beforeHandle(cmd) {
|
|
36829
|
+
switch (cmd.type) {
|
|
36830
|
+
case "DELETE_SHEET":
|
|
36831
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
36832
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
36833
|
+
});
|
|
36834
|
+
break;
|
|
36835
|
+
}
|
|
36836
|
+
}
|
|
36817
36837
|
handle(cmd) {
|
|
36818
36838
|
switch (cmd.type) {
|
|
36819
36839
|
case "CREATE_SHEET":
|
|
@@ -38600,7 +38620,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
38600
38620
|
"getNumberHeaders",
|
|
38601
38621
|
"getGridLinesVisibility",
|
|
38602
38622
|
"getNextSheetName",
|
|
38603
|
-
"isEmpty",
|
|
38604
38623
|
"getSheetSize",
|
|
38605
38624
|
"getSheetZone",
|
|
38606
38625
|
"getPaneDivisions",
|
|
@@ -38975,14 +38994,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
38975
38994
|
// ---------------------------------------------------------------------------
|
|
38976
38995
|
// Row/Col manipulation
|
|
38977
38996
|
// ---------------------------------------------------------------------------
|
|
38978
|
-
/**
|
|
38979
|
-
* Check if a zone only contains empty cells
|
|
38980
|
-
*/
|
|
38981
|
-
isEmpty(sheetId, zone) {
|
|
38982
|
-
return positions(zone)
|
|
38983
|
-
.map(({ col, row }) => this.getCell({ sheetId, col, row }))
|
|
38984
|
-
.every((cell) => !cell || cell.content === "");
|
|
38985
|
-
}
|
|
38986
38997
|
getCommandZones(cmd) {
|
|
38987
38998
|
const zones = [];
|
|
38988
38999
|
if ("zone" in cmd) {
|
|
@@ -41436,6 +41447,7 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
41436
41447
|
"getEvaluatedCellsInZone",
|
|
41437
41448
|
"getSpreadPositionsOf",
|
|
41438
41449
|
"getArrayFormulaSpreadingOn",
|
|
41450
|
+
"isEmpty",
|
|
41439
41451
|
];
|
|
41440
41452
|
shouldRebuildDependenciesGraph = true;
|
|
41441
41453
|
evaluator;
|
|
@@ -41540,6 +41552,14 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
41540
41552
|
getArrayFormulaSpreadingOn(position) {
|
|
41541
41553
|
return this.evaluator.getArrayFormulaSpreadingOn(position);
|
|
41542
41554
|
}
|
|
41555
|
+
/**
|
|
41556
|
+
* Check if a zone only contains empty cells
|
|
41557
|
+
*/
|
|
41558
|
+
isEmpty(sheetId, zone) {
|
|
41559
|
+
return positions(zone)
|
|
41560
|
+
.map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
|
|
41561
|
+
.every((cell) => cell.type === CellValueType.empty);
|
|
41562
|
+
}
|
|
41543
41563
|
// ---------------------------------------------------------------------------
|
|
41544
41564
|
// Export
|
|
41545
41565
|
// ---------------------------------------------------------------------------
|
|
@@ -42186,8 +42206,6 @@ const VALID_RESULT = { isValid: true };
|
|
|
42186
42206
|
class EvaluationDataValidationPlugin extends UIPlugin {
|
|
42187
42207
|
static getters = [
|
|
42188
42208
|
"getDataValidationInvalidCriterionValueMessage",
|
|
42189
|
-
"getDataValidationCheckBoxCellPositions",
|
|
42190
|
-
"getDataValidationListCellsPositions",
|
|
42191
42209
|
"getInvalidDataValidationMessage",
|
|
42192
42210
|
"getValidationResultForCellValue",
|
|
42193
42211
|
"isCellValidCheckbox",
|
|
@@ -42251,19 +42269,6 @@ class EvaluationDataValidationPlugin extends UIPlugin {
|
|
|
42251
42269
|
const error = this.getRuleErrorForCellValue(cellValue, cellPosition, rule);
|
|
42252
42270
|
return error ? { error, rule, isValid: false } : VALID_RESULT;
|
|
42253
42271
|
}
|
|
42254
|
-
getDataValidationCheckBoxCellPositions() {
|
|
42255
|
-
const rules = this.getters
|
|
42256
|
-
.getDataValidationRules(this.getters.getActiveSheetId())
|
|
42257
|
-
.filter((rule) => rule.criterion.type === "isBoolean");
|
|
42258
|
-
return getCellPositionsInRanges(rules.map((rule) => rule.ranges).flat()).filter((position) => this.isCellValidCheckbox(position));
|
|
42259
|
-
}
|
|
42260
|
-
getDataValidationListCellsPositions() {
|
|
42261
|
-
const rules = this.getters
|
|
42262
|
-
.getDataValidationRules(this.getters.getActiveSheetId())
|
|
42263
|
-
.filter((rule) => (rule.criterion.type === "isValueInList" || rule.criterion.type === "isValueInRange") &&
|
|
42264
|
-
rule.criterion.displayStyle === "arrow");
|
|
42265
|
-
return getCellPositionsInRanges(rules.map((rule) => rule.ranges).flat());
|
|
42266
|
-
}
|
|
42267
42272
|
getValidationResultForCell(cellPosition) {
|
|
42268
42273
|
const { col, row, sheetId } = cellPosition;
|
|
42269
42274
|
if (!this.validationResults[sheetId]) {
|
|
@@ -50086,6 +50091,8 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
50086
50091
|
"getEdgeScrollRow",
|
|
50087
50092
|
"getVisibleFigures",
|
|
50088
50093
|
"getVisibleRect",
|
|
50094
|
+
"getVisibleRectWithoutHeaders",
|
|
50095
|
+
"getVisibleCellPositions",
|
|
50089
50096
|
"getColRowOffsetInViewport",
|
|
50090
50097
|
"getMainViewportCoordinates",
|
|
50091
50098
|
"getActiveSheetScrollInfo",
|
|
@@ -50329,6 +50336,26 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
50329
50336
|
const viewports = this.getSubViewports(sheetId);
|
|
50330
50337
|
return [...new Set(viewports.map((v) => range(v.top, v.bottom + 1)).flat())].filter((row) => !this.getters.isHeaderHidden(sheetId, "ROW", row));
|
|
50331
50338
|
}
|
|
50339
|
+
/**
|
|
50340
|
+
* Get the positions of all the cells that are visible in the viewport, taking merges into account.
|
|
50341
|
+
*/
|
|
50342
|
+
getVisibleCellPositions() {
|
|
50343
|
+
const visibleCols = this.getSheetViewVisibleCols();
|
|
50344
|
+
const visibleRows = this.getSheetViewVisibleRows();
|
|
50345
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
50346
|
+
const positions = [];
|
|
50347
|
+
for (const col of visibleCols) {
|
|
50348
|
+
for (const row of visibleRows) {
|
|
50349
|
+
const position = { sheetId, col, row };
|
|
50350
|
+
const mainPosition = this.getters.getMainCellPosition(position);
|
|
50351
|
+
if (mainPosition.row !== row || mainPosition.col !== col) {
|
|
50352
|
+
continue;
|
|
50353
|
+
}
|
|
50354
|
+
positions.push(position);
|
|
50355
|
+
}
|
|
50356
|
+
}
|
|
50357
|
+
return positions;
|
|
50358
|
+
}
|
|
50332
50359
|
/**
|
|
50333
50360
|
* Return the main viewport maximum size relative to the client size.
|
|
50334
50361
|
*/
|
|
@@ -50448,6 +50475,13 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
50448
50475
|
* Computes the coordinates and size to draw the zone on the canvas
|
|
50449
50476
|
*/
|
|
50450
50477
|
getVisibleRect(zone) {
|
|
50478
|
+
const rect = this.getVisibleRectWithoutHeaders(zone);
|
|
50479
|
+
return { ...rect, x: rect.x + this.gridOffsetX, y: rect.y + this.gridOffsetY };
|
|
50480
|
+
}
|
|
50481
|
+
/**
|
|
50482
|
+
* Computes the coordinates and size to draw the zone without taking the grid offset into account
|
|
50483
|
+
*/
|
|
50484
|
+
getVisibleRectWithoutHeaders(zone) {
|
|
50451
50485
|
const sheetId = this.getters.getActiveSheetId();
|
|
50452
50486
|
const viewportRects = this.getSubViewports(sheetId)
|
|
50453
50487
|
.map((viewport) => viewport.getRect(zone))
|
|
@@ -50459,12 +50493,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
50459
50493
|
const y = Math.min(...viewportRects.map((rect) => rect.y));
|
|
50460
50494
|
const width = Math.max(...viewportRects.map((rect) => rect.x + rect.width)) - x;
|
|
50461
50495
|
const height = Math.max(...viewportRects.map((rect) => rect.y + rect.height)) - y;
|
|
50462
|
-
return {
|
|
50463
|
-
x: x + this.gridOffsetX,
|
|
50464
|
-
y: y + this.gridOffsetY,
|
|
50465
|
-
width,
|
|
50466
|
-
height,
|
|
50467
|
-
};
|
|
50496
|
+
return { x, y, width, height };
|
|
50468
50497
|
}
|
|
50469
50498
|
/**
|
|
50470
50499
|
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
@@ -50688,13 +50717,8 @@ class HeaderPositionsUIPlugin extends UIPlugin {
|
|
|
50688
50717
|
}
|
|
50689
50718
|
break;
|
|
50690
50719
|
case "UPDATE_CELL":
|
|
50691
|
-
|
|
50692
|
-
|
|
50693
|
-
this.isDirty = true;
|
|
50694
|
-
}
|
|
50695
|
-
else {
|
|
50696
|
-
this.headerPositions[cmd.sheetId] = this.computeHeaderPositionsOfSheet(cmd.sheetId);
|
|
50697
|
-
}
|
|
50720
|
+
this.headerPositions = {};
|
|
50721
|
+
this.isDirty = true;
|
|
50698
50722
|
break;
|
|
50699
50723
|
case "UPDATE_FILTER":
|
|
50700
50724
|
case "REMOVE_FILTER_TABLE":
|
|
@@ -51167,6 +51191,9 @@ class BottomBarSheet extends owl.Component {
|
|
|
51167
51191
|
this.scrollToSheet();
|
|
51168
51192
|
}
|
|
51169
51193
|
onDblClick() {
|
|
51194
|
+
if (this.env.model.getters.isReadonly()) {
|
|
51195
|
+
return;
|
|
51196
|
+
}
|
|
51170
51197
|
this.startEdition();
|
|
51171
51198
|
}
|
|
51172
51199
|
onKeyDown(ev) {
|
|
@@ -56941,6 +56968,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
56941
56968
|
exports.tokenize = tokenize;
|
|
56942
56969
|
|
|
56943
56970
|
|
|
56944
|
-
__info__.version = "17.0.
|
|
56945
|
-
__info__.date = "2024-
|
|
56946
|
-
__info__.hash = "
|
|
56971
|
+
__info__.version = "17.0.15";
|
|
56972
|
+
__info__.date = "2024-03-15T11:00:59.958Z";
|
|
56973
|
+
__info__.hash = "e02add9";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -3660,6 +3660,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
|
|
|
3660
3660
|
[sheet: string]: Record<UID, Figure | undefined> | undefined;
|
|
3661
3661
|
};
|
|
3662
3662
|
allowDispatch(cmd: CoreCommand): CommandResult;
|
|
3663
|
+
beforeHandle(cmd: CoreCommand): void;
|
|
3663
3664
|
handle(cmd: CoreCommand): void;
|
|
3664
3665
|
private onRowColDelete;
|
|
3665
3666
|
private onRowDeletion;
|
|
@@ -3981,7 +3982,7 @@ interface SheetState {
|
|
|
3981
3982
|
readonly cellPosition: Record<UID, CellPosition | undefined>;
|
|
3982
3983
|
}
|
|
3983
3984
|
declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
|
|
3984
|
-
static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "doesHeadersExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "
|
|
3985
|
+
static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "doesHeadersExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
|
|
3985
3986
|
readonly sheetIdsMapName: Record<string, UID | undefined>;
|
|
3986
3987
|
readonly orderedSheetIds: UID[];
|
|
3987
3988
|
readonly sheets: Record<UID, Sheet | undefined>;
|
|
@@ -4030,10 +4031,6 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
|
|
|
4030
4031
|
* This validation ensures that all rows or columns cannot be deleted when frozen panes exist.
|
|
4031
4032
|
*/
|
|
4032
4033
|
checkElementsIncludeAllNonFrozenHeaders(sheetId: UID, dimension: Dimension, elements: HeaderIndex[]): boolean;
|
|
4033
|
-
/**
|
|
4034
|
-
* Check if a zone only contains empty cells
|
|
4035
|
-
*/
|
|
4036
|
-
isEmpty(sheetId: UID, zone: Zone): boolean;
|
|
4037
4034
|
getCommandZones(cmd: Command): Zone[];
|
|
4038
4035
|
/**
|
|
4039
4036
|
* Check if zones in the command are well formed and
|
|
@@ -4128,7 +4125,7 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
|
|
|
4128
4125
|
}
|
|
4129
4126
|
|
|
4130
4127
|
declare class EvaluationPlugin extends UIPlugin {
|
|
4131
|
-
static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getSpreadPositionsOf", "getArrayFormulaSpreadingOn"];
|
|
4128
|
+
static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getSpreadPositionsOf", "getArrayFormulaSpreadingOn", "isEmpty"];
|
|
4132
4129
|
private shouldRebuildDependenciesGraph;
|
|
4133
4130
|
private evaluator;
|
|
4134
4131
|
private positionsToUpdate;
|
|
@@ -4154,6 +4151,10 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
4154
4151
|
getEvaluatedCellsInZone(sheetId: UID, zone: Zone): EvaluatedCell[];
|
|
4155
4152
|
getSpreadPositionsOf(position: CellPosition): CellPosition[];
|
|
4156
4153
|
getArrayFormulaSpreadingOn(position: CellPosition): CellPosition | undefined;
|
|
4154
|
+
/**
|
|
4155
|
+
* Check if a zone only contains empty cells
|
|
4156
|
+
*/
|
|
4157
|
+
isEmpty(sheetId: UID, zone: Zone): boolean;
|
|
4157
4158
|
exportForExcel(data: ExcelWorkbookData): void;
|
|
4158
4159
|
/**
|
|
4159
4160
|
* Returns the corresponding formula cell of a given cell
|
|
@@ -4253,7 +4254,7 @@ type SheetValidationResult = {
|
|
|
4253
4254
|
[col: HeaderIndex]: Array<Lazy<ValidationResult>>;
|
|
4254
4255
|
};
|
|
4255
4256
|
declare class EvaluationDataValidationPlugin extends UIPlugin {
|
|
4256
|
-
static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "
|
|
4257
|
+
static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
|
|
4257
4258
|
validationResults: Record<UID, SheetValidationResult>;
|
|
4258
4259
|
handle(cmd: CoreViewCommand): void;
|
|
4259
4260
|
isDataValidationInvalid(cellPosition: CellPosition): boolean;
|
|
@@ -4267,8 +4268,6 @@ declare class EvaluationDataValidationPlugin extends UIPlugin {
|
|
|
4267
4268
|
isCellValidCheckbox(cellPosition: CellPosition): boolean;
|
|
4268
4269
|
/** Get the validation result if the cell on the given position had the given value */
|
|
4269
4270
|
getValidationResultForCellValue(cellValue: CellValue, cellPosition: CellPosition): ValidationResult;
|
|
4270
|
-
getDataValidationCheckBoxCellPositions(): CellPosition[];
|
|
4271
|
-
getDataValidationListCellsPositions(): CellPosition[];
|
|
4272
4271
|
private getValidationResultForCell;
|
|
4273
4272
|
private computeSheetValidationResults;
|
|
4274
4273
|
private getRuleErrorForCellValue;
|
|
@@ -5123,7 +5122,7 @@ type SheetViewports = {
|
|
|
5123
5122
|
*
|
|
5124
5123
|
*/
|
|
5125
5124
|
declare class SheetViewPlugin extends UIPlugin {
|
|
5126
|
-
static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
|
|
5125
|
+
static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
|
|
5127
5126
|
readonly viewports: Record<UID, SheetViewports | undefined>;
|
|
5128
5127
|
/**
|
|
5129
5128
|
* The viewport dimensions are usually set by one of the components
|
|
@@ -5170,6 +5169,10 @@ declare class SheetViewPlugin extends UIPlugin {
|
|
|
5170
5169
|
getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
|
|
5171
5170
|
getSheetViewVisibleCols(): HeaderIndex[];
|
|
5172
5171
|
getSheetViewVisibleRows(): HeaderIndex[];
|
|
5172
|
+
/**
|
|
5173
|
+
* Get the positions of all the cells that are visible in the viewport, taking merges into account.
|
|
5174
|
+
*/
|
|
5175
|
+
getVisibleCellPositions(): CellPosition[];
|
|
5173
5176
|
/**
|
|
5174
5177
|
* Return the main viewport maximum size relative to the client size.
|
|
5175
5178
|
*/
|
|
@@ -5186,6 +5189,10 @@ declare class SheetViewPlugin extends UIPlugin {
|
|
|
5186
5189
|
* Computes the coordinates and size to draw the zone on the canvas
|
|
5187
5190
|
*/
|
|
5188
5191
|
getVisibleRect(zone: Zone): Rect;
|
|
5192
|
+
/**
|
|
5193
|
+
* Computes the coordinates and size to draw the zone without taking the grid offset into account
|
|
5194
|
+
*/
|
|
5195
|
+
getVisibleRectWithoutHeaders(zone: Zone): Rect;
|
|
5189
5196
|
/**
|
|
5190
5197
|
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
5191
5198
|
* It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
|