@odoo/o-spreadsheet 16.4.24 → 16.4.26
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.
|
@@ -5232,8 +5232,10 @@ function getGroup(cell, cells, filter) {
|
|
|
5232
5232
|
if (x === cell) {
|
|
5233
5233
|
found = true;
|
|
5234
5234
|
}
|
|
5235
|
-
const cellValue =
|
|
5236
|
-
|
|
5235
|
+
const cellValue = x?.isFormula
|
|
5236
|
+
? undefined
|
|
5237
|
+
: evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
|
|
5238
|
+
if (cellValue && filter(cellValue)) {
|
|
5237
5239
|
group.push(cellValue);
|
|
5238
5240
|
}
|
|
5239
5241
|
else {
|
|
@@ -24784,7 +24786,11 @@ class GridComposer extends owl.Component {
|
|
|
24784
24786
|
}
|
|
24785
24787
|
}
|
|
24786
24788
|
updateCellReferenceVisibility() {
|
|
24787
|
-
if (this.
|
|
24789
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
24790
|
+
this.isCellReferenceVisible = false;
|
|
24791
|
+
return;
|
|
24792
|
+
}
|
|
24793
|
+
if (this.isCellReferenceVisible) {
|
|
24788
24794
|
return;
|
|
24789
24795
|
}
|
|
24790
24796
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -24945,7 +24951,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
24945
24951
|
function clamp(value, min, max) {
|
|
24946
24952
|
return Math.min(Math.max(value, min), max);
|
|
24947
24953
|
}
|
|
24948
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
24954
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
24949
24955
|
let { x, y, width, height } = initialFigure;
|
|
24950
24956
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
24951
24957
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -24972,14 +24978,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
24972
24978
|
y = initialFigure.y - deltaY;
|
|
24973
24979
|
}
|
|
24974
24980
|
}
|
|
24975
|
-
//
|
|
24976
|
-
if (x
|
|
24977
|
-
width
|
|
24978
|
-
x =
|
|
24981
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
24982
|
+
if (x + scrollX <= 0) {
|
|
24983
|
+
width = width + x + scrollX;
|
|
24984
|
+
x = -scrollX;
|
|
24979
24985
|
}
|
|
24980
|
-
if (y
|
|
24981
|
-
height
|
|
24982
|
-
y =
|
|
24986
|
+
if (y + scrollY <= 0) {
|
|
24987
|
+
height = height + y + scrollY;
|
|
24988
|
+
y = -scrollY;
|
|
24983
24989
|
}
|
|
24984
24990
|
return { ...initialFigure, x, y, width, height };
|
|
24985
24991
|
}
|
|
@@ -25396,7 +25402,7 @@ class FiguresContainer extends owl.Component {
|
|
|
25396
25402
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
25397
25403
|
const onMouseMove = (ev) => {
|
|
25398
25404
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
25399
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
25405
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
25400
25406
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
25401
25407
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
25402
25408
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -32903,6 +32909,15 @@ class FigurePlugin extends CorePlugin {
|
|
|
32903
32909
|
return 0 /* CommandResult.Success */;
|
|
32904
32910
|
}
|
|
32905
32911
|
}
|
|
32912
|
+
beforeHandle(cmd) {
|
|
32913
|
+
switch (cmd.type) {
|
|
32914
|
+
case "DELETE_SHEET":
|
|
32915
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
32916
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
32917
|
+
});
|
|
32918
|
+
break;
|
|
32919
|
+
}
|
|
32920
|
+
}
|
|
32906
32921
|
handle(cmd) {
|
|
32907
32922
|
switch (cmd.type) {
|
|
32908
32923
|
case "CREATE_SHEET":
|
|
@@ -34665,7 +34680,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
34665
34680
|
"getNumberHeaders",
|
|
34666
34681
|
"getGridLinesVisibility",
|
|
34667
34682
|
"getNextSheetName",
|
|
34668
|
-
"isEmpty",
|
|
34669
34683
|
"getSheetSize",
|
|
34670
34684
|
"getSheetZone",
|
|
34671
34685
|
"getPaneDivisions",
|
|
@@ -35041,14 +35055,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
35041
35055
|
// ---------------------------------------------------------------------------
|
|
35042
35056
|
// Row/Col manipulation
|
|
35043
35057
|
// ---------------------------------------------------------------------------
|
|
35044
|
-
/**
|
|
35045
|
-
* Check if a zone only contains empty cells
|
|
35046
|
-
*/
|
|
35047
|
-
isEmpty(sheetId, zone) {
|
|
35048
|
-
return positions(zone)
|
|
35049
|
-
.map(({ col, row }) => this.getCell({ sheetId, col, row }))
|
|
35050
|
-
.every((cell) => !cell || cell.content === "");
|
|
35051
|
-
}
|
|
35052
35058
|
getCommandZones(cmd) {
|
|
35053
35059
|
const zones = [];
|
|
35054
35060
|
if ("zone" in cmd) {
|
|
@@ -37108,6 +37114,7 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
37108
37114
|
"getEvaluatedCell",
|
|
37109
37115
|
"getEvaluatedCells",
|
|
37110
37116
|
"getEvaluatedCellsInZone",
|
|
37117
|
+
"isEmpty",
|
|
37111
37118
|
];
|
|
37112
37119
|
shouldRebuildDependenciesGraph = true;
|
|
37113
37120
|
evaluator;
|
|
@@ -37206,6 +37213,14 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
37206
37213
|
getEvaluatedCellsInZone(sheetId, zone) {
|
|
37207
37214
|
return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
|
|
37208
37215
|
}
|
|
37216
|
+
/**
|
|
37217
|
+
* Check if a zone only contains empty cells
|
|
37218
|
+
*/
|
|
37219
|
+
isEmpty(sheetId, zone) {
|
|
37220
|
+
return positions(zone)
|
|
37221
|
+
.map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
|
|
37222
|
+
.every((cell) => cell.type === CellValueType.empty);
|
|
37223
|
+
}
|
|
37209
37224
|
// ---------------------------------------------------------------------------
|
|
37210
37225
|
// Export
|
|
37211
37226
|
// ---------------------------------------------------------------------------
|
|
@@ -46094,6 +46109,9 @@ class BottomBarSheet extends owl.Component {
|
|
|
46094
46109
|
this.scrollToSheet();
|
|
46095
46110
|
}
|
|
46096
46111
|
onDblClick() {
|
|
46112
|
+
if (this.env.model.getters.isReadonly()) {
|
|
46113
|
+
return;
|
|
46114
|
+
}
|
|
46097
46115
|
this.startEdition();
|
|
46098
46116
|
}
|
|
46099
46117
|
onKeyDown(ev) {
|
|
@@ -51716,6 +51734,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
51716
51734
|
exports.tokenize = tokenize;
|
|
51717
51735
|
|
|
51718
51736
|
|
|
51719
|
-
__info__.version = '16.4.
|
|
51720
|
-
__info__.date = '2024-
|
|
51721
|
-
__info__.hash = '
|
|
51737
|
+
__info__.version = '16.4.26';
|
|
51738
|
+
__info__.date = '2024-03-15T10:58:33.088Z';
|
|
51739
|
+
__info__.hash = 'b8caa0f';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -3409,6 +3409,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
|
|
|
3409
3409
|
[sheet: string]: Record<UID, Figure | undefined> | undefined;
|
|
3410
3410
|
};
|
|
3411
3411
|
allowDispatch(cmd: CoreCommand): CommandResult;
|
|
3412
|
+
beforeHandle(cmd: CoreCommand): void;
|
|
3412
3413
|
handle(cmd: CoreCommand): void;
|
|
3413
3414
|
private onRowColDelete;
|
|
3414
3415
|
private onRowDeletion;
|
|
@@ -3648,7 +3649,7 @@ interface SheetState$1 {
|
|
|
3648
3649
|
readonly cellPosition: Record<UID, CellPosition | undefined>;
|
|
3649
3650
|
}
|
|
3650
3651
|
declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState$1 {
|
|
3651
|
-
static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "
|
|
3652
|
+
static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
|
|
3652
3653
|
readonly sheetIdsMapName: Record<string, UID | undefined>;
|
|
3653
3654
|
readonly orderedSheetIds: UID[];
|
|
3654
3655
|
readonly sheets: Record<UID, Sheet | undefined>;
|
|
@@ -3696,10 +3697,6 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
|
|
|
3696
3697
|
* This validation ensures that all rows or columns cannot be deleted when frozen panes exist.
|
|
3697
3698
|
*/
|
|
3698
3699
|
checkElementsIncludeAllNonFrozenHeaders(sheetId: UID, dimension: Dimension, elements: HeaderIndex[]): boolean;
|
|
3699
|
-
/**
|
|
3700
|
-
* Check if a zone only contains empty cells
|
|
3701
|
-
*/
|
|
3702
|
-
isEmpty(sheetId: UID, zone: Zone): boolean;
|
|
3703
3700
|
getCommandZones(cmd: Command): Zone[];
|
|
3704
3701
|
/**
|
|
3705
3702
|
* Check if zones in the command are well formed and
|
|
@@ -3794,7 +3791,7 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
|
|
|
3794
3791
|
}
|
|
3795
3792
|
|
|
3796
3793
|
declare class EvaluationPlugin extends UIPlugin {
|
|
3797
|
-
static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone"];
|
|
3794
|
+
static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "isEmpty"];
|
|
3798
3795
|
private shouldRebuildDependenciesGraph;
|
|
3799
3796
|
private evaluator;
|
|
3800
3797
|
private positionsToUpdate;
|
|
@@ -3818,6 +3815,10 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3818
3815
|
getEvaluatedCell(position: CellPosition): EvaluatedCell;
|
|
3819
3816
|
getEvaluatedCells(sheetId: UID): Record<UID, EvaluatedCell>;
|
|
3820
3817
|
getEvaluatedCellsInZone(sheetId: UID, zone: Zone): EvaluatedCell[];
|
|
3818
|
+
/**
|
|
3819
|
+
* Check if a zone only contains empty cells
|
|
3820
|
+
*/
|
|
3821
|
+
isEmpty(sheetId: UID, zone: Zone): boolean;
|
|
3821
3822
|
exportForExcel(data: ExcelWorkbookData): void;
|
|
3822
3823
|
/**
|
|
3823
3824
|
* Returns the corresponding formula cell of a given cell
|
|
@@ -5228,8 +5228,10 @@ function getGroup(cell, cells, filter) {
|
|
|
5228
5228
|
if (x === cell) {
|
|
5229
5229
|
found = true;
|
|
5230
5230
|
}
|
|
5231
|
-
const cellValue =
|
|
5232
|
-
|
|
5231
|
+
const cellValue = x?.isFormula
|
|
5232
|
+
? undefined
|
|
5233
|
+
: evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
|
|
5234
|
+
if (cellValue && filter(cellValue)) {
|
|
5233
5235
|
group.push(cellValue);
|
|
5234
5236
|
}
|
|
5235
5237
|
else {
|
|
@@ -24780,7 +24782,11 @@ class GridComposer extends Component {
|
|
|
24780
24782
|
}
|
|
24781
24783
|
}
|
|
24782
24784
|
updateCellReferenceVisibility() {
|
|
24783
|
-
if (this.
|
|
24785
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
24786
|
+
this.isCellReferenceVisible = false;
|
|
24787
|
+
return;
|
|
24788
|
+
}
|
|
24789
|
+
if (this.isCellReferenceVisible) {
|
|
24784
24790
|
return;
|
|
24785
24791
|
}
|
|
24786
24792
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -24941,7 +24947,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
24941
24947
|
function clamp(value, min, max) {
|
|
24942
24948
|
return Math.min(Math.max(value, min), max);
|
|
24943
24949
|
}
|
|
24944
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
24950
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
24945
24951
|
let { x, y, width, height } = initialFigure;
|
|
24946
24952
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
24947
24953
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -24968,14 +24974,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
24968
24974
|
y = initialFigure.y - deltaY;
|
|
24969
24975
|
}
|
|
24970
24976
|
}
|
|
24971
|
-
//
|
|
24972
|
-
if (x
|
|
24973
|
-
width
|
|
24974
|
-
x =
|
|
24977
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
24978
|
+
if (x + scrollX <= 0) {
|
|
24979
|
+
width = width + x + scrollX;
|
|
24980
|
+
x = -scrollX;
|
|
24975
24981
|
}
|
|
24976
|
-
if (y
|
|
24977
|
-
height
|
|
24978
|
-
y =
|
|
24982
|
+
if (y + scrollY <= 0) {
|
|
24983
|
+
height = height + y + scrollY;
|
|
24984
|
+
y = -scrollY;
|
|
24979
24985
|
}
|
|
24980
24986
|
return { ...initialFigure, x, y, width, height };
|
|
24981
24987
|
}
|
|
@@ -25392,7 +25398,7 @@ class FiguresContainer extends Component {
|
|
|
25392
25398
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
25393
25399
|
const onMouseMove = (ev) => {
|
|
25394
25400
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
25395
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
25401
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
25396
25402
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
25397
25403
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
25398
25404
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -32899,6 +32905,15 @@ class FigurePlugin extends CorePlugin {
|
|
|
32899
32905
|
return 0 /* CommandResult.Success */;
|
|
32900
32906
|
}
|
|
32901
32907
|
}
|
|
32908
|
+
beforeHandle(cmd) {
|
|
32909
|
+
switch (cmd.type) {
|
|
32910
|
+
case "DELETE_SHEET":
|
|
32911
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
32912
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
32913
|
+
});
|
|
32914
|
+
break;
|
|
32915
|
+
}
|
|
32916
|
+
}
|
|
32902
32917
|
handle(cmd) {
|
|
32903
32918
|
switch (cmd.type) {
|
|
32904
32919
|
case "CREATE_SHEET":
|
|
@@ -34661,7 +34676,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
34661
34676
|
"getNumberHeaders",
|
|
34662
34677
|
"getGridLinesVisibility",
|
|
34663
34678
|
"getNextSheetName",
|
|
34664
|
-
"isEmpty",
|
|
34665
34679
|
"getSheetSize",
|
|
34666
34680
|
"getSheetZone",
|
|
34667
34681
|
"getPaneDivisions",
|
|
@@ -35037,14 +35051,6 @@ class SheetPlugin extends CorePlugin {
|
|
|
35037
35051
|
// ---------------------------------------------------------------------------
|
|
35038
35052
|
// Row/Col manipulation
|
|
35039
35053
|
// ---------------------------------------------------------------------------
|
|
35040
|
-
/**
|
|
35041
|
-
* Check if a zone only contains empty cells
|
|
35042
|
-
*/
|
|
35043
|
-
isEmpty(sheetId, zone) {
|
|
35044
|
-
return positions(zone)
|
|
35045
|
-
.map(({ col, row }) => this.getCell({ sheetId, col, row }))
|
|
35046
|
-
.every((cell) => !cell || cell.content === "");
|
|
35047
|
-
}
|
|
35048
35054
|
getCommandZones(cmd) {
|
|
35049
35055
|
const zones = [];
|
|
35050
35056
|
if ("zone" in cmd) {
|
|
@@ -37104,6 +37110,7 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
37104
37110
|
"getEvaluatedCell",
|
|
37105
37111
|
"getEvaluatedCells",
|
|
37106
37112
|
"getEvaluatedCellsInZone",
|
|
37113
|
+
"isEmpty",
|
|
37107
37114
|
];
|
|
37108
37115
|
shouldRebuildDependenciesGraph = true;
|
|
37109
37116
|
evaluator;
|
|
@@ -37202,6 +37209,14 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
37202
37209
|
getEvaluatedCellsInZone(sheetId, zone) {
|
|
37203
37210
|
return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
|
|
37204
37211
|
}
|
|
37212
|
+
/**
|
|
37213
|
+
* Check if a zone only contains empty cells
|
|
37214
|
+
*/
|
|
37215
|
+
isEmpty(sheetId, zone) {
|
|
37216
|
+
return positions(zone)
|
|
37217
|
+
.map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
|
|
37218
|
+
.every((cell) => cell.type === CellValueType.empty);
|
|
37219
|
+
}
|
|
37205
37220
|
// ---------------------------------------------------------------------------
|
|
37206
37221
|
// Export
|
|
37207
37222
|
// ---------------------------------------------------------------------------
|
|
@@ -46090,6 +46105,9 @@ class BottomBarSheet extends Component {
|
|
|
46090
46105
|
this.scrollToSheet();
|
|
46091
46106
|
}
|
|
46092
46107
|
onDblClick() {
|
|
46108
|
+
if (this.env.model.getters.isReadonly()) {
|
|
46109
|
+
return;
|
|
46110
|
+
}
|
|
46093
46111
|
this.startEdition();
|
|
46094
46112
|
}
|
|
46095
46113
|
onKeyDown(ev) {
|
|
@@ -51680,6 +51698,6 @@ const constants = {
|
|
|
51680
51698
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
51681
51699
|
|
|
51682
51700
|
|
|
51683
|
-
__info__.version = '16.4.
|
|
51684
|
-
__info__.date = '2024-
|
|
51685
|
-
__info__.hash = '
|
|
51701
|
+
__info__.version = '16.4.26';
|
|
51702
|
+
__info__.date = '2024-03-15T10:58:33.088Z';
|
|
51703
|
+
__info__.hash = 'b8caa0f';
|
|
@@ -5229,8 +5229,10 @@
|
|
|
5229
5229
|
if (x === cell) {
|
|
5230
5230
|
found = true;
|
|
5231
5231
|
}
|
|
5232
|
-
const cellValue =
|
|
5233
|
-
|
|
5232
|
+
const cellValue = x?.isFormula
|
|
5233
|
+
? undefined
|
|
5234
|
+
: evaluateLiteral(x?.content, { locale: DEFAULT_LOCALE });
|
|
5235
|
+
if (cellValue && filter(cellValue)) {
|
|
5234
5236
|
group.push(cellValue);
|
|
5235
5237
|
}
|
|
5236
5238
|
else {
|
|
@@ -24781,7 +24783,11 @@
|
|
|
24781
24783
|
}
|
|
24782
24784
|
}
|
|
24783
24785
|
updateCellReferenceVisibility() {
|
|
24784
|
-
if (this.
|
|
24786
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
24787
|
+
this.isCellReferenceVisible = false;
|
|
24788
|
+
return;
|
|
24789
|
+
}
|
|
24790
|
+
if (this.isCellReferenceVisible) {
|
|
24785
24791
|
return;
|
|
24786
24792
|
}
|
|
24787
24793
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -24942,7 +24948,7 @@
|
|
|
24942
24948
|
function clamp(value, min, max) {
|
|
24943
24949
|
return Math.min(Math.max(value, min), max);
|
|
24944
24950
|
}
|
|
24945
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
24951
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
24946
24952
|
let { x, y, width, height } = initialFigure;
|
|
24947
24953
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
24948
24954
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -24969,14 +24975,14 @@
|
|
|
24969
24975
|
y = initialFigure.y - deltaY;
|
|
24970
24976
|
}
|
|
24971
24977
|
}
|
|
24972
|
-
//
|
|
24973
|
-
if (x
|
|
24974
|
-
width
|
|
24975
|
-
x =
|
|
24978
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
24979
|
+
if (x + scrollX <= 0) {
|
|
24980
|
+
width = width + x + scrollX;
|
|
24981
|
+
x = -scrollX;
|
|
24976
24982
|
}
|
|
24977
|
-
if (y
|
|
24978
|
-
height
|
|
24979
|
-
y =
|
|
24983
|
+
if (y + scrollY <= 0) {
|
|
24984
|
+
height = height + y + scrollY;
|
|
24985
|
+
y = -scrollY;
|
|
24980
24986
|
}
|
|
24981
24987
|
return { ...initialFigure, x, y, width, height };
|
|
24982
24988
|
}
|
|
@@ -25393,7 +25399,7 @@
|
|
|
25393
25399
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
25394
25400
|
const onMouseMove = (ev) => {
|
|
25395
25401
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
25396
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
25402
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
25397
25403
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
25398
25404
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
25399
25405
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -32900,6 +32906,15 @@
|
|
|
32900
32906
|
return 0 /* CommandResult.Success */;
|
|
32901
32907
|
}
|
|
32902
32908
|
}
|
|
32909
|
+
beforeHandle(cmd) {
|
|
32910
|
+
switch (cmd.type) {
|
|
32911
|
+
case "DELETE_SHEET":
|
|
32912
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
32913
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
32914
|
+
});
|
|
32915
|
+
break;
|
|
32916
|
+
}
|
|
32917
|
+
}
|
|
32903
32918
|
handle(cmd) {
|
|
32904
32919
|
switch (cmd.type) {
|
|
32905
32920
|
case "CREATE_SHEET":
|
|
@@ -34662,7 +34677,6 @@
|
|
|
34662
34677
|
"getNumberHeaders",
|
|
34663
34678
|
"getGridLinesVisibility",
|
|
34664
34679
|
"getNextSheetName",
|
|
34665
|
-
"isEmpty",
|
|
34666
34680
|
"getSheetSize",
|
|
34667
34681
|
"getSheetZone",
|
|
34668
34682
|
"getPaneDivisions",
|
|
@@ -35038,14 +35052,6 @@
|
|
|
35038
35052
|
// ---------------------------------------------------------------------------
|
|
35039
35053
|
// Row/Col manipulation
|
|
35040
35054
|
// ---------------------------------------------------------------------------
|
|
35041
|
-
/**
|
|
35042
|
-
* Check if a zone only contains empty cells
|
|
35043
|
-
*/
|
|
35044
|
-
isEmpty(sheetId, zone) {
|
|
35045
|
-
return positions(zone)
|
|
35046
|
-
.map(({ col, row }) => this.getCell({ sheetId, col, row }))
|
|
35047
|
-
.every((cell) => !cell || cell.content === "");
|
|
35048
|
-
}
|
|
35049
35055
|
getCommandZones(cmd) {
|
|
35050
35056
|
const zones = [];
|
|
35051
35057
|
if ("zone" in cmd) {
|
|
@@ -37105,6 +37111,7 @@
|
|
|
37105
37111
|
"getEvaluatedCell",
|
|
37106
37112
|
"getEvaluatedCells",
|
|
37107
37113
|
"getEvaluatedCellsInZone",
|
|
37114
|
+
"isEmpty",
|
|
37108
37115
|
];
|
|
37109
37116
|
shouldRebuildDependenciesGraph = true;
|
|
37110
37117
|
evaluator;
|
|
@@ -37203,6 +37210,14 @@
|
|
|
37203
37210
|
getEvaluatedCellsInZone(sheetId, zone) {
|
|
37204
37211
|
return positions(zone).map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId, col, row }));
|
|
37205
37212
|
}
|
|
37213
|
+
/**
|
|
37214
|
+
* Check if a zone only contains empty cells
|
|
37215
|
+
*/
|
|
37216
|
+
isEmpty(sheetId, zone) {
|
|
37217
|
+
return positions(zone)
|
|
37218
|
+
.map(({ col, row }) => this.getEvaluatedCell({ sheetId, col, row }))
|
|
37219
|
+
.every((cell) => cell.type === CellValueType.empty);
|
|
37220
|
+
}
|
|
37206
37221
|
// ---------------------------------------------------------------------------
|
|
37207
37222
|
// Export
|
|
37208
37223
|
// ---------------------------------------------------------------------------
|
|
@@ -46091,6 +46106,9 @@
|
|
|
46091
46106
|
this.scrollToSheet();
|
|
46092
46107
|
}
|
|
46093
46108
|
onDblClick() {
|
|
46109
|
+
if (this.env.model.getters.isReadonly()) {
|
|
46110
|
+
return;
|
|
46111
|
+
}
|
|
46094
46112
|
this.startEdition();
|
|
46095
46113
|
}
|
|
46096
46114
|
onKeyDown(ev) {
|
|
@@ -51715,9 +51733,9 @@
|
|
|
51715
51733
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
51716
51734
|
|
|
51717
51735
|
|
|
51718
|
-
__info__.version = '16.4.
|
|
51719
|
-
__info__.date = '2024-
|
|
51720
|
-
__info__.hash = '
|
|
51736
|
+
__info__.version = '16.4.26';
|
|
51737
|
+
__info__.date = '2024-03-15T10:58:33.088Z';
|
|
51738
|
+
__info__.hash = 'b8caa0f';
|
|
51721
51739
|
|
|
51722
51740
|
|
|
51723
51741
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|