@odoo/o-spreadsheet 16.3.25 → 16.3.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.
|
@@ -9436,6 +9436,12 @@ const INSERT_LINK = (env) => {
|
|
|
9436
9436
|
let { col, row } = env.model.getters.getActivePosition();
|
|
9437
9437
|
env.model.dispatch("OPEN_CELL_POPOVER", { col, row, popoverType: "LinkEditor" });
|
|
9438
9438
|
};
|
|
9439
|
+
const INSERT_LINK_NAME = (env) => {
|
|
9440
|
+
const sheetId = env.model.getters.getActiveSheetId();
|
|
9441
|
+
const { col, row } = env.model.getters.getActivePosition();
|
|
9442
|
+
const cell = env.model.getters.getEvaluatedCell({ sheetId, col, row });
|
|
9443
|
+
return cell && cell.link ? _lt("Edit link") : _lt("Insert link");
|
|
9444
|
+
};
|
|
9439
9445
|
//------------------------------------------------------------------------------
|
|
9440
9446
|
// Filters action
|
|
9441
9447
|
//------------------------------------------------------------------------------
|
|
@@ -16660,7 +16666,7 @@ cellMenuRegistry
|
|
|
16660
16666
|
})
|
|
16661
16667
|
.add("insert_link", {
|
|
16662
16668
|
...insertLink,
|
|
16663
|
-
name:
|
|
16669
|
+
name: INSERT_LINK_NAME,
|
|
16664
16670
|
sequence: 150,
|
|
16665
16671
|
separator: true,
|
|
16666
16672
|
});
|
|
@@ -29688,9 +29694,9 @@ class CellPlugin extends CorePlugin {
|
|
|
29688
29694
|
allowDispatch(cmd) {
|
|
29689
29695
|
switch (cmd.type) {
|
|
29690
29696
|
case "UPDATE_CELL":
|
|
29691
|
-
return this.
|
|
29697
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
|
|
29692
29698
|
case "CLEAR_CELL":
|
|
29693
|
-
return this.checkValidations(cmd, this.
|
|
29699
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
|
|
29694
29700
|
default:
|
|
29695
29701
|
return 0 /* CommandResult.Success */;
|
|
29696
29702
|
}
|
|
@@ -29984,7 +29990,7 @@ class CellPlugin extends CorePlugin {
|
|
|
29984
29990
|
else {
|
|
29985
29991
|
style = before ? before.style : undefined;
|
|
29986
29992
|
}
|
|
29987
|
-
|
|
29993
|
+
const format = "format" in after ? after.format : before && before.format;
|
|
29988
29994
|
/* Read the following IF as:
|
|
29989
29995
|
* we need to remove the cell if it is completely empty, but we can know if it completely empty if:
|
|
29990
29996
|
* - the command says the new content is empty and has no border/format/style
|
|
@@ -30028,7 +30034,7 @@ class CellPlugin extends CorePlugin {
|
|
|
30028
30034
|
id,
|
|
30029
30035
|
content,
|
|
30030
30036
|
style,
|
|
30031
|
-
format,
|
|
30037
|
+
format: format || detectFormat(content),
|
|
30032
30038
|
isFormula: false,
|
|
30033
30039
|
};
|
|
30034
30040
|
}
|
|
@@ -30105,6 +30111,18 @@ class CellPlugin extends CorePlugin {
|
|
|
30105
30111
|
}
|
|
30106
30112
|
return 0 /* CommandResult.Success */;
|
|
30107
30113
|
}
|
|
30114
|
+
checkUselessUpdateCell(cmd) {
|
|
30115
|
+
const cell = this.getters.getCell(cmd);
|
|
30116
|
+
const hasContent = "content" in cmd || "formula" in cmd;
|
|
30117
|
+
const hasStyle = "style" in cmd;
|
|
30118
|
+
const hasFormat = "format" in cmd;
|
|
30119
|
+
if ((!hasContent || cell?.content === cmd.content) &&
|
|
30120
|
+
(!hasStyle || deepEquals(cell?.style, cmd.style)) &&
|
|
30121
|
+
(!hasFormat || cell?.format === cmd.format)) {
|
|
30122
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30123
|
+
}
|
|
30124
|
+
return 0 /* CommandResult.Success */;
|
|
30125
|
+
}
|
|
30108
30126
|
}
|
|
30109
30127
|
|
|
30110
30128
|
class ChartPlugin extends CorePlugin {
|
|
@@ -35768,8 +35786,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
35768
35786
|
let row = zone.bottom;
|
|
35769
35787
|
if (col > 0) {
|
|
35770
35788
|
let leftPosition = { sheetId, col: col - 1, row };
|
|
35771
|
-
while (this.getters.
|
|
35772
|
-
this.getters.getCell(leftPosition)?.content) {
|
|
35789
|
+
while (this.getters.getCell(leftPosition)?.content) {
|
|
35773
35790
|
row += 1;
|
|
35774
35791
|
leftPosition = { sheetId, col: col - 1, row };
|
|
35775
35792
|
}
|
|
@@ -35778,8 +35795,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
35778
35795
|
col = zone.right;
|
|
35779
35796
|
if (col <= this.getters.getNumberCols(sheetId)) {
|
|
35780
35797
|
let rightPosition = { sheetId, col: col + 1, row };
|
|
35781
|
-
while (this.getters.
|
|
35782
|
-
this.getters.getCell(rightPosition)?.content) {
|
|
35798
|
+
while (this.getters.getCell(rightPosition)?.content) {
|
|
35783
35799
|
row += 1;
|
|
35784
35800
|
rightPosition = { sheetId, col: col + 1, row };
|
|
35785
35801
|
}
|
|
@@ -45704,11 +45720,10 @@ class SelectionStreamProcessorImpl {
|
|
|
45704
45720
|
* next cluster if the given cell is outside a cluster or at the border of a cluster in the given direction.
|
|
45705
45721
|
*/
|
|
45706
45722
|
getEndOfCluster(startPosition, dim, dir) {
|
|
45707
|
-
const sheet = this.getters.getActiveSheet();
|
|
45708
45723
|
let currentPosition = startPosition;
|
|
45709
45724
|
// If both the current cell and the next cell are not empty, we want to go to the end of the cluster
|
|
45710
45725
|
const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
|
|
45711
|
-
let mode = !this.
|
|
45726
|
+
let mode = !this.isEvaluatedCellEmpty(currentPosition) && !this.isEvaluatedCellEmpty(nextCellPosition)
|
|
45712
45727
|
? "endOfCluster"
|
|
45713
45728
|
: "nextCluster";
|
|
45714
45729
|
while (true) {
|
|
@@ -45718,7 +45733,7 @@ class SelectionStreamProcessorImpl {
|
|
|
45718
45733
|
currentPosition.row === nextCellPosition.row) {
|
|
45719
45734
|
break;
|
|
45720
45735
|
}
|
|
45721
|
-
const isNextCellEmpty = this.
|
|
45736
|
+
const isNextCellEmpty = this.isEvaluatedCellEmpty(nextCellPosition);
|
|
45722
45737
|
if (mode === "endOfCluster" && isNextCellEmpty) {
|
|
45723
45738
|
break;
|
|
45724
45739
|
}
|
|
@@ -45732,14 +45747,24 @@ class SelectionStreamProcessorImpl {
|
|
|
45732
45747
|
return dim === "cols" ? currentPosition.col : currentPosition.row;
|
|
45733
45748
|
}
|
|
45734
45749
|
/**
|
|
45735
|
-
* Check if a cell is empty
|
|
45736
|
-
* check
|
|
45750
|
+
* Check if a cell evaluated value is empty. If the cell is part of a merge,
|
|
45751
|
+
* the check applies to the main cell of the merge.
|
|
45737
45752
|
*/
|
|
45738
|
-
|
|
45753
|
+
isEvaluatedCellEmpty({ col, row }) {
|
|
45754
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
45739
45755
|
const position = this.getters.getMainCellPosition({ sheetId, col, row });
|
|
45740
45756
|
const cell = this.getters.getEvaluatedCell(position);
|
|
45741
45757
|
return cell.type === CellValueType.empty;
|
|
45742
45758
|
}
|
|
45759
|
+
/**
|
|
45760
|
+
* Checks if a cell is empty (i.e. does not have a content). If the cell is part of a merge,
|
|
45761
|
+
* the check applies to the main cell of the merge.
|
|
45762
|
+
*/
|
|
45763
|
+
isCellEmpty({ col, row }) {
|
|
45764
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
45765
|
+
const position = this.getters.getMainCellPosition({ sheetId, col, row });
|
|
45766
|
+
return !this.getters.getCell(position)?.content;
|
|
45767
|
+
}
|
|
45743
45768
|
/** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
|
|
45744
45769
|
*
|
|
45745
45770
|
* This has the same behaviour as getNextAvailablePosition() for certain arguments, but use this method instead
|
|
@@ -48008,6 +48033,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
48008
48033
|
exports.tokenize = tokenize;
|
|
48009
48034
|
|
|
48010
48035
|
|
|
48011
|
-
__info__.version = '16.3.
|
|
48012
|
-
__info__.date = '2024-02-
|
|
48013
|
-
__info__.hash = '
|
|
48036
|
+
__info__.version = '16.3.26';
|
|
48037
|
+
__info__.date = '2024-02-16T14:22:11.270Z';
|
|
48038
|
+
__info__.hash = 'ab9abb6';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -9432,6 +9432,12 @@ const INSERT_LINK = (env) => {
|
|
|
9432
9432
|
let { col, row } = env.model.getters.getActivePosition();
|
|
9433
9433
|
env.model.dispatch("OPEN_CELL_POPOVER", { col, row, popoverType: "LinkEditor" });
|
|
9434
9434
|
};
|
|
9435
|
+
const INSERT_LINK_NAME = (env) => {
|
|
9436
|
+
const sheetId = env.model.getters.getActiveSheetId();
|
|
9437
|
+
const { col, row } = env.model.getters.getActivePosition();
|
|
9438
|
+
const cell = env.model.getters.getEvaluatedCell({ sheetId, col, row });
|
|
9439
|
+
return cell && cell.link ? _lt("Edit link") : _lt("Insert link");
|
|
9440
|
+
};
|
|
9435
9441
|
//------------------------------------------------------------------------------
|
|
9436
9442
|
// Filters action
|
|
9437
9443
|
//------------------------------------------------------------------------------
|
|
@@ -16656,7 +16662,7 @@ cellMenuRegistry
|
|
|
16656
16662
|
})
|
|
16657
16663
|
.add("insert_link", {
|
|
16658
16664
|
...insertLink,
|
|
16659
|
-
name:
|
|
16665
|
+
name: INSERT_LINK_NAME,
|
|
16660
16666
|
sequence: 150,
|
|
16661
16667
|
separator: true,
|
|
16662
16668
|
});
|
|
@@ -29684,9 +29690,9 @@ class CellPlugin extends CorePlugin {
|
|
|
29684
29690
|
allowDispatch(cmd) {
|
|
29685
29691
|
switch (cmd.type) {
|
|
29686
29692
|
case "UPDATE_CELL":
|
|
29687
|
-
return this.
|
|
29693
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
|
|
29688
29694
|
case "CLEAR_CELL":
|
|
29689
|
-
return this.checkValidations(cmd, this.
|
|
29695
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
|
|
29690
29696
|
default:
|
|
29691
29697
|
return 0 /* CommandResult.Success */;
|
|
29692
29698
|
}
|
|
@@ -29980,7 +29986,7 @@ class CellPlugin extends CorePlugin {
|
|
|
29980
29986
|
else {
|
|
29981
29987
|
style = before ? before.style : undefined;
|
|
29982
29988
|
}
|
|
29983
|
-
|
|
29989
|
+
const format = "format" in after ? after.format : before && before.format;
|
|
29984
29990
|
/* Read the following IF as:
|
|
29985
29991
|
* we need to remove the cell if it is completely empty, but we can know if it completely empty if:
|
|
29986
29992
|
* - the command says the new content is empty and has no border/format/style
|
|
@@ -30024,7 +30030,7 @@ class CellPlugin extends CorePlugin {
|
|
|
30024
30030
|
id,
|
|
30025
30031
|
content,
|
|
30026
30032
|
style,
|
|
30027
|
-
format,
|
|
30033
|
+
format: format || detectFormat(content),
|
|
30028
30034
|
isFormula: false,
|
|
30029
30035
|
};
|
|
30030
30036
|
}
|
|
@@ -30101,6 +30107,18 @@ class CellPlugin extends CorePlugin {
|
|
|
30101
30107
|
}
|
|
30102
30108
|
return 0 /* CommandResult.Success */;
|
|
30103
30109
|
}
|
|
30110
|
+
checkUselessUpdateCell(cmd) {
|
|
30111
|
+
const cell = this.getters.getCell(cmd);
|
|
30112
|
+
const hasContent = "content" in cmd || "formula" in cmd;
|
|
30113
|
+
const hasStyle = "style" in cmd;
|
|
30114
|
+
const hasFormat = "format" in cmd;
|
|
30115
|
+
if ((!hasContent || cell?.content === cmd.content) &&
|
|
30116
|
+
(!hasStyle || deepEquals(cell?.style, cmd.style)) &&
|
|
30117
|
+
(!hasFormat || cell?.format === cmd.format)) {
|
|
30118
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30119
|
+
}
|
|
30120
|
+
return 0 /* CommandResult.Success */;
|
|
30121
|
+
}
|
|
30104
30122
|
}
|
|
30105
30123
|
|
|
30106
30124
|
class ChartPlugin extends CorePlugin {
|
|
@@ -35764,8 +35782,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
35764
35782
|
let row = zone.bottom;
|
|
35765
35783
|
if (col > 0) {
|
|
35766
35784
|
let leftPosition = { sheetId, col: col - 1, row };
|
|
35767
|
-
while (this.getters.
|
|
35768
|
-
this.getters.getCell(leftPosition)?.content) {
|
|
35785
|
+
while (this.getters.getCell(leftPosition)?.content) {
|
|
35769
35786
|
row += 1;
|
|
35770
35787
|
leftPosition = { sheetId, col: col - 1, row };
|
|
35771
35788
|
}
|
|
@@ -35774,8 +35791,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
35774
35791
|
col = zone.right;
|
|
35775
35792
|
if (col <= this.getters.getNumberCols(sheetId)) {
|
|
35776
35793
|
let rightPosition = { sheetId, col: col + 1, row };
|
|
35777
|
-
while (this.getters.
|
|
35778
|
-
this.getters.getCell(rightPosition)?.content) {
|
|
35794
|
+
while (this.getters.getCell(rightPosition)?.content) {
|
|
35779
35795
|
row += 1;
|
|
35780
35796
|
rightPosition = { sheetId, col: col + 1, row };
|
|
35781
35797
|
}
|
|
@@ -45700,11 +45716,10 @@ class SelectionStreamProcessorImpl {
|
|
|
45700
45716
|
* next cluster if the given cell is outside a cluster or at the border of a cluster in the given direction.
|
|
45701
45717
|
*/
|
|
45702
45718
|
getEndOfCluster(startPosition, dim, dir) {
|
|
45703
|
-
const sheet = this.getters.getActiveSheet();
|
|
45704
45719
|
let currentPosition = startPosition;
|
|
45705
45720
|
// If both the current cell and the next cell are not empty, we want to go to the end of the cluster
|
|
45706
45721
|
const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
|
|
45707
|
-
let mode = !this.
|
|
45722
|
+
let mode = !this.isEvaluatedCellEmpty(currentPosition) && !this.isEvaluatedCellEmpty(nextCellPosition)
|
|
45708
45723
|
? "endOfCluster"
|
|
45709
45724
|
: "nextCluster";
|
|
45710
45725
|
while (true) {
|
|
@@ -45714,7 +45729,7 @@ class SelectionStreamProcessorImpl {
|
|
|
45714
45729
|
currentPosition.row === nextCellPosition.row) {
|
|
45715
45730
|
break;
|
|
45716
45731
|
}
|
|
45717
|
-
const isNextCellEmpty = this.
|
|
45732
|
+
const isNextCellEmpty = this.isEvaluatedCellEmpty(nextCellPosition);
|
|
45718
45733
|
if (mode === "endOfCluster" && isNextCellEmpty) {
|
|
45719
45734
|
break;
|
|
45720
45735
|
}
|
|
@@ -45728,14 +45743,24 @@ class SelectionStreamProcessorImpl {
|
|
|
45728
45743
|
return dim === "cols" ? currentPosition.col : currentPosition.row;
|
|
45729
45744
|
}
|
|
45730
45745
|
/**
|
|
45731
|
-
* Check if a cell is empty
|
|
45732
|
-
* check
|
|
45746
|
+
* Check if a cell evaluated value is empty. If the cell is part of a merge,
|
|
45747
|
+
* the check applies to the main cell of the merge.
|
|
45733
45748
|
*/
|
|
45734
|
-
|
|
45749
|
+
isEvaluatedCellEmpty({ col, row }) {
|
|
45750
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
45735
45751
|
const position = this.getters.getMainCellPosition({ sheetId, col, row });
|
|
45736
45752
|
const cell = this.getters.getEvaluatedCell(position);
|
|
45737
45753
|
return cell.type === CellValueType.empty;
|
|
45738
45754
|
}
|
|
45755
|
+
/**
|
|
45756
|
+
* Checks if a cell is empty (i.e. does not have a content). If the cell is part of a merge,
|
|
45757
|
+
* the check applies to the main cell of the merge.
|
|
45758
|
+
*/
|
|
45759
|
+
isCellEmpty({ col, row }) {
|
|
45760
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
45761
|
+
const position = this.getters.getMainCellPosition({ sheetId, col, row });
|
|
45762
|
+
return !this.getters.getCell(position)?.content;
|
|
45763
|
+
}
|
|
45739
45764
|
/** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
|
|
45740
45765
|
*
|
|
45741
45766
|
* This has the same behaviour as getNextAvailablePosition() for certain arguments, but use this method instead
|
|
@@ -47976,6 +48001,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
47976
48001
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
47977
48002
|
|
|
47978
48003
|
|
|
47979
|
-
__info__.version = '16.3.
|
|
47980
|
-
__info__.date = '2024-02-
|
|
47981
|
-
__info__.hash = '
|
|
48004
|
+
__info__.version = '16.3.26';
|
|
48005
|
+
__info__.date = '2024-02-16T14:22:11.270Z';
|
|
48006
|
+
__info__.hash = 'ab9abb6';
|
|
@@ -9433,6 +9433,12 @@
|
|
|
9433
9433
|
let { col, row } = env.model.getters.getActivePosition();
|
|
9434
9434
|
env.model.dispatch("OPEN_CELL_POPOVER", { col, row, popoverType: "LinkEditor" });
|
|
9435
9435
|
};
|
|
9436
|
+
const INSERT_LINK_NAME = (env) => {
|
|
9437
|
+
const sheetId = env.model.getters.getActiveSheetId();
|
|
9438
|
+
const { col, row } = env.model.getters.getActivePosition();
|
|
9439
|
+
const cell = env.model.getters.getEvaluatedCell({ sheetId, col, row });
|
|
9440
|
+
return cell && cell.link ? _lt("Edit link") : _lt("Insert link");
|
|
9441
|
+
};
|
|
9436
9442
|
//------------------------------------------------------------------------------
|
|
9437
9443
|
// Filters action
|
|
9438
9444
|
//------------------------------------------------------------------------------
|
|
@@ -16657,7 +16663,7 @@
|
|
|
16657
16663
|
})
|
|
16658
16664
|
.add("insert_link", {
|
|
16659
16665
|
...insertLink,
|
|
16660
|
-
name:
|
|
16666
|
+
name: INSERT_LINK_NAME,
|
|
16661
16667
|
sequence: 150,
|
|
16662
16668
|
separator: true,
|
|
16663
16669
|
});
|
|
@@ -29685,9 +29691,9 @@
|
|
|
29685
29691
|
allowDispatch(cmd) {
|
|
29686
29692
|
switch (cmd.type) {
|
|
29687
29693
|
case "UPDATE_CELL":
|
|
29688
|
-
return this.
|
|
29694
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
|
|
29689
29695
|
case "CLEAR_CELL":
|
|
29690
|
-
return this.checkValidations(cmd, this.
|
|
29696
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
|
|
29691
29697
|
default:
|
|
29692
29698
|
return 0 /* CommandResult.Success */;
|
|
29693
29699
|
}
|
|
@@ -29981,7 +29987,7 @@
|
|
|
29981
29987
|
else {
|
|
29982
29988
|
style = before ? before.style : undefined;
|
|
29983
29989
|
}
|
|
29984
|
-
|
|
29990
|
+
const format = "format" in after ? after.format : before && before.format;
|
|
29985
29991
|
/* Read the following IF as:
|
|
29986
29992
|
* we need to remove the cell if it is completely empty, but we can know if it completely empty if:
|
|
29987
29993
|
* - the command says the new content is empty and has no border/format/style
|
|
@@ -30025,7 +30031,7 @@
|
|
|
30025
30031
|
id,
|
|
30026
30032
|
content,
|
|
30027
30033
|
style,
|
|
30028
|
-
format,
|
|
30034
|
+
format: format || detectFormat(content),
|
|
30029
30035
|
isFormula: false,
|
|
30030
30036
|
};
|
|
30031
30037
|
}
|
|
@@ -30102,6 +30108,18 @@
|
|
|
30102
30108
|
}
|
|
30103
30109
|
return 0 /* CommandResult.Success */;
|
|
30104
30110
|
}
|
|
30111
|
+
checkUselessUpdateCell(cmd) {
|
|
30112
|
+
const cell = this.getters.getCell(cmd);
|
|
30113
|
+
const hasContent = "content" in cmd || "formula" in cmd;
|
|
30114
|
+
const hasStyle = "style" in cmd;
|
|
30115
|
+
const hasFormat = "format" in cmd;
|
|
30116
|
+
if ((!hasContent || cell?.content === cmd.content) &&
|
|
30117
|
+
(!hasStyle || deepEquals(cell?.style, cmd.style)) &&
|
|
30118
|
+
(!hasFormat || cell?.format === cmd.format)) {
|
|
30119
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30120
|
+
}
|
|
30121
|
+
return 0 /* CommandResult.Success */;
|
|
30122
|
+
}
|
|
30105
30123
|
}
|
|
30106
30124
|
|
|
30107
30125
|
class ChartPlugin extends CorePlugin {
|
|
@@ -35765,8 +35783,7 @@
|
|
|
35765
35783
|
let row = zone.bottom;
|
|
35766
35784
|
if (col > 0) {
|
|
35767
35785
|
let leftPosition = { sheetId, col: col - 1, row };
|
|
35768
|
-
while (this.getters.
|
|
35769
|
-
this.getters.getCell(leftPosition)?.content) {
|
|
35786
|
+
while (this.getters.getCell(leftPosition)?.content) {
|
|
35770
35787
|
row += 1;
|
|
35771
35788
|
leftPosition = { sheetId, col: col - 1, row };
|
|
35772
35789
|
}
|
|
@@ -35775,8 +35792,7 @@
|
|
|
35775
35792
|
col = zone.right;
|
|
35776
35793
|
if (col <= this.getters.getNumberCols(sheetId)) {
|
|
35777
35794
|
let rightPosition = { sheetId, col: col + 1, row };
|
|
35778
|
-
while (this.getters.
|
|
35779
|
-
this.getters.getCell(rightPosition)?.content) {
|
|
35795
|
+
while (this.getters.getCell(rightPosition)?.content) {
|
|
35780
35796
|
row += 1;
|
|
35781
35797
|
rightPosition = { sheetId, col: col + 1, row };
|
|
35782
35798
|
}
|
|
@@ -45701,11 +45717,10 @@
|
|
|
45701
45717
|
* next cluster if the given cell is outside a cluster or at the border of a cluster in the given direction.
|
|
45702
45718
|
*/
|
|
45703
45719
|
getEndOfCluster(startPosition, dim, dir) {
|
|
45704
|
-
const sheet = this.getters.getActiveSheet();
|
|
45705
45720
|
let currentPosition = startPosition;
|
|
45706
45721
|
// If both the current cell and the next cell are not empty, we want to go to the end of the cluster
|
|
45707
45722
|
const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
|
|
45708
|
-
let mode = !this.
|
|
45723
|
+
let mode = !this.isEvaluatedCellEmpty(currentPosition) && !this.isEvaluatedCellEmpty(nextCellPosition)
|
|
45709
45724
|
? "endOfCluster"
|
|
45710
45725
|
: "nextCluster";
|
|
45711
45726
|
while (true) {
|
|
@@ -45715,7 +45730,7 @@
|
|
|
45715
45730
|
currentPosition.row === nextCellPosition.row) {
|
|
45716
45731
|
break;
|
|
45717
45732
|
}
|
|
45718
|
-
const isNextCellEmpty = this.
|
|
45733
|
+
const isNextCellEmpty = this.isEvaluatedCellEmpty(nextCellPosition);
|
|
45719
45734
|
if (mode === "endOfCluster" && isNextCellEmpty) {
|
|
45720
45735
|
break;
|
|
45721
45736
|
}
|
|
@@ -45729,14 +45744,24 @@
|
|
|
45729
45744
|
return dim === "cols" ? currentPosition.col : currentPosition.row;
|
|
45730
45745
|
}
|
|
45731
45746
|
/**
|
|
45732
|
-
* Check if a cell is empty
|
|
45733
|
-
* check
|
|
45747
|
+
* Check if a cell evaluated value is empty. If the cell is part of a merge,
|
|
45748
|
+
* the check applies to the main cell of the merge.
|
|
45734
45749
|
*/
|
|
45735
|
-
|
|
45750
|
+
isEvaluatedCellEmpty({ col, row }) {
|
|
45751
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
45736
45752
|
const position = this.getters.getMainCellPosition({ sheetId, col, row });
|
|
45737
45753
|
const cell = this.getters.getEvaluatedCell(position);
|
|
45738
45754
|
return cell.type === CellValueType.empty;
|
|
45739
45755
|
}
|
|
45756
|
+
/**
|
|
45757
|
+
* Checks if a cell is empty (i.e. does not have a content). If the cell is part of a merge,
|
|
45758
|
+
* the check applies to the main cell of the merge.
|
|
45759
|
+
*/
|
|
45760
|
+
isCellEmpty({ col, row }) {
|
|
45761
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
45762
|
+
const position = this.getters.getMainCellPosition({ sheetId, col, row });
|
|
45763
|
+
return !this.getters.getCell(position)?.content;
|
|
45764
|
+
}
|
|
45740
45765
|
/** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
|
|
45741
45766
|
*
|
|
45742
45767
|
* This has the same behaviour as getNextAvailablePosition() for certain arguments, but use this method instead
|
|
@@ -48007,9 +48032,9 @@
|
|
|
48007
48032
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
48008
48033
|
|
|
48009
48034
|
|
|
48010
|
-
__info__.version = '16.3.
|
|
48011
|
-
__info__.date = '2024-02-
|
|
48012
|
-
__info__.hash = '
|
|
48035
|
+
__info__.version = '16.3.26';
|
|
48036
|
+
__info__.date = '2024-02-16T14:22:11.270Z';
|
|
48037
|
+
__info__.hash = 'ab9abb6';
|
|
48013
48038
|
|
|
48014
48039
|
|
|
48015
48040
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|