@odoo/o-spreadsheet 17.1.4 → 17.1.5
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 +107 -68
- package/dist/o-spreadsheet.d.ts +12 -4
- package/dist/o-spreadsheet.esm.js +107 -68
- package/dist/o-spreadsheet.iife.js +107 -68
- package/dist/o-spreadsheet.iife.min.js +290 -289
- package/dist/o_spreadsheet.xml +7 -6
- 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.1.
|
|
6
|
-
* @date 2024-02-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.1.5
|
|
6
|
+
* @date 2024-02-16T14:23:54.651Z
|
|
7
|
+
* @hash 29d8ad6
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -453,8 +453,8 @@ function isObjectEmptyRecursive(argument) {
|
|
|
453
453
|
* If the given item does not exist in the dictionary, it creates one with a new id.
|
|
454
454
|
*/
|
|
455
455
|
function getItemId(item, itemsDic) {
|
|
456
|
-
for (
|
|
457
|
-
if (deepEquals(
|
|
456
|
+
for (const key in itemsDic) {
|
|
457
|
+
if (deepEquals(itemsDic[key], item)) {
|
|
458
458
|
return parseInt(key, 10);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
@@ -553,11 +553,13 @@ function deepEquals(o1, o2) {
|
|
|
553
553
|
if (typeof o1 !== "object")
|
|
554
554
|
return o1 === o2;
|
|
555
555
|
// Objects can have different keys if the values are undefined
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
556
|
+
for (const key in o2) {
|
|
557
|
+
if (!(key in o1) && o2[key] !== undefined) {
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
for (const key in o1) {
|
|
562
|
+
if (typeof o1[key] !== typeof o2[key])
|
|
561
563
|
return false;
|
|
562
564
|
if (typeof o1[key] === "object") {
|
|
563
565
|
if (!deepEquals(o1[key], o2[key]))
|
|
@@ -627,18 +629,18 @@ function isConsecutive(iterable) {
|
|
|
627
629
|
return true;
|
|
628
630
|
}
|
|
629
631
|
class JetSet extends Set {
|
|
630
|
-
|
|
632
|
+
addMany(iterable) {
|
|
631
633
|
for (const element of iterable) {
|
|
632
634
|
super.add(element);
|
|
633
635
|
}
|
|
634
636
|
return this;
|
|
635
637
|
}
|
|
636
|
-
|
|
637
|
-
let
|
|
638
|
+
deleteMany(iterable) {
|
|
639
|
+
let wasDeleted = false;
|
|
638
640
|
for (const element of iterable) {
|
|
639
|
-
|
|
641
|
+
wasDeleted ||= super.delete(element);
|
|
640
642
|
}
|
|
641
|
-
return
|
|
643
|
+
return wasDeleted;
|
|
642
644
|
}
|
|
643
645
|
}
|
|
644
646
|
/**
|
|
@@ -1936,7 +1938,7 @@ class DispatchResult {
|
|
|
1936
1938
|
* Static helper which returns a successful DispatchResult
|
|
1937
1939
|
*/
|
|
1938
1940
|
static get Success() {
|
|
1939
|
-
return
|
|
1941
|
+
return SUCCESS;
|
|
1940
1942
|
}
|
|
1941
1943
|
get isSuccessful() {
|
|
1942
1944
|
return this.reasons.length === 0;
|
|
@@ -1949,6 +1951,7 @@ class DispatchResult {
|
|
|
1949
1951
|
return this.reasons.includes(reason);
|
|
1950
1952
|
}
|
|
1951
1953
|
}
|
|
1954
|
+
const SUCCESS = new DispatchResult();
|
|
1952
1955
|
exports.CommandResult = void 0;
|
|
1953
1956
|
(function (CommandResult) {
|
|
1954
1957
|
CommandResult["Success"] = "Success";
|
|
@@ -7655,6 +7658,9 @@ function isValidLocale(locale) {
|
|
|
7655
7658
|
if (locale.formulaArgSeparator === locale.decimalSeparator) {
|
|
7656
7659
|
return false;
|
|
7657
7660
|
}
|
|
7661
|
+
if (locale.thousandsSeparator === locale.decimalSeparator) {
|
|
7662
|
+
return false;
|
|
7663
|
+
}
|
|
7658
7664
|
try {
|
|
7659
7665
|
formatValue(1, { locale, format: "#,##0.00" });
|
|
7660
7666
|
formatValue(1, { locale, format: locale.dateFormat });
|
|
@@ -7745,7 +7751,7 @@ function canonicalizeNumberLiteral(content, locale) {
|
|
|
7745
7751
|
if (locale.decimalSeparator === "." || !isNumber(content, locale)) {
|
|
7746
7752
|
return content;
|
|
7747
7753
|
}
|
|
7748
|
-
return content.replace(locale.decimalSeparator, ".");
|
|
7754
|
+
return content.replace(locale.thousandsSeparator, "").replace(locale.decimalSeparator, ".");
|
|
7749
7755
|
}
|
|
7750
7756
|
/**
|
|
7751
7757
|
* Change a content string from the given locale to its canonical form (en_US locale). Also convert date string.
|
|
@@ -10840,6 +10846,12 @@ const INSERT_LINK = (env) => {
|
|
|
10840
10846
|
let { col, row } = env.model.getters.getActivePosition();
|
|
10841
10847
|
env.model.dispatch("OPEN_CELL_POPOVER", { col, row, popoverType: "LinkEditor" });
|
|
10842
10848
|
};
|
|
10849
|
+
const INSERT_LINK_NAME = (env) => {
|
|
10850
|
+
const sheetId = env.model.getters.getActiveSheetId();
|
|
10851
|
+
const { col, row } = env.model.getters.getActivePosition();
|
|
10852
|
+
const cell = env.model.getters.getEvaluatedCell({ sheetId, col, row });
|
|
10853
|
+
return cell && cell.link ? _t("Edit link") : _t("Insert link");
|
|
10854
|
+
};
|
|
10843
10855
|
//------------------------------------------------------------------------------
|
|
10844
10856
|
// Filters action
|
|
10845
10857
|
//------------------------------------------------------------------------------
|
|
@@ -20084,7 +20096,7 @@ cellMenuRegistry
|
|
|
20084
20096
|
})
|
|
20085
20097
|
.add("insert_link", {
|
|
20086
20098
|
...insertLink,
|
|
20087
|
-
name:
|
|
20099
|
+
name: INSERT_LINK_NAME,
|
|
20088
20100
|
sequence: 150,
|
|
20089
20101
|
separator: true,
|
|
20090
20102
|
});
|
|
@@ -26527,6 +26539,17 @@ class TextValueProvider extends owl.Component {
|
|
|
26527
26539
|
onValueSelected: Function,
|
|
26528
26540
|
onValueHovered: Function,
|
|
26529
26541
|
};
|
|
26542
|
+
autoCompleteListRef = owl.useRef("autoCompleteList");
|
|
26543
|
+
setup() {
|
|
26544
|
+
owl.useEffect(() => {
|
|
26545
|
+
const selectedIndex = this.props.selectedIndex;
|
|
26546
|
+
if (selectedIndex === undefined) {
|
|
26547
|
+
return;
|
|
26548
|
+
}
|
|
26549
|
+
const selectedElement = this.autoCompleteListRef.el?.children[selectedIndex];
|
|
26550
|
+
selectedElement?.scrollIntoView?.({ block: "nearest" });
|
|
26551
|
+
}, () => [this.props.selectedIndex, this.autoCompleteListRef.el]);
|
|
26552
|
+
}
|
|
26530
26553
|
}
|
|
26531
26554
|
|
|
26532
26555
|
class ContentEditableHelper {
|
|
@@ -26971,6 +26994,7 @@ css /* scss */ `
|
|
|
26971
26994
|
position: absolute;
|
|
26972
26995
|
margin: 1px 4px;
|
|
26973
26996
|
pointer-events: none;
|
|
26997
|
+
overflow: auto;
|
|
26974
26998
|
|
|
26975
26999
|
.o-semi-bold {
|
|
26976
27000
|
/** FIXME: to remove in favor of Bootstrap
|
|
@@ -27028,7 +27052,10 @@ class Composer extends owl.Component {
|
|
|
27028
27052
|
if (this.props.delimitation && this.props.rect) {
|
|
27029
27053
|
const { x: cellX, y: cellY, height: cellHeight } = this.props.rect;
|
|
27030
27054
|
const remainingHeight = this.props.delimitation.height - (cellY + cellHeight);
|
|
27055
|
+
assistantStyle["max-height"] = `${remainingHeight}px`;
|
|
27031
27056
|
if (cellY > remainingHeight) {
|
|
27057
|
+
const availableSpaceAbove = cellY;
|
|
27058
|
+
assistantStyle["max-height"] = `${availableSpaceAbove}px`;
|
|
27032
27059
|
// render top
|
|
27033
27060
|
// We compensate 2 px of margin on the assistant style + 1px for design reasons
|
|
27034
27061
|
assistantStyle.top = `-3px`;
|
|
@@ -35147,22 +35174,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
35147
35174
|
}
|
|
35148
35175
|
}
|
|
35149
35176
|
export(data) {
|
|
35150
|
-
// Borders
|
|
35151
|
-
let borderId = 0;
|
|
35152
35177
|
const borders = {};
|
|
35153
|
-
/**
|
|
35154
|
-
* Get the id of the given border. If the border does not exist, it creates
|
|
35155
|
-
* one.
|
|
35156
|
-
*/
|
|
35157
|
-
function getBorderId(border) {
|
|
35158
|
-
for (let [key, value] of Object.entries(borders)) {
|
|
35159
|
-
if (deepEquals(value, border)) {
|
|
35160
|
-
return parseInt(key, 10);
|
|
35161
|
-
}
|
|
35162
|
-
}
|
|
35163
|
-
borders[++borderId] = border;
|
|
35164
|
-
return borderId;
|
|
35165
|
-
}
|
|
35166
35178
|
for (let sheet of data.sheets) {
|
|
35167
35179
|
for (let col = 0; col < sheet.colNumber; col++) {
|
|
35168
35180
|
for (let row = 0; row < sheet.rowNumber; row++) {
|
|
@@ -35170,7 +35182,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
35170
35182
|
if (border) {
|
|
35171
35183
|
const xc = toXC(col, row);
|
|
35172
35184
|
const cell = sheet.cells[xc];
|
|
35173
|
-
const borderId =
|
|
35185
|
+
const borderId = getItemId(border, borders);
|
|
35174
35186
|
if (cell) {
|
|
35175
35187
|
cell.border = borderId;
|
|
35176
35188
|
}
|
|
@@ -35959,9 +35971,9 @@ class CellPlugin extends CorePlugin {
|
|
|
35959
35971
|
allowDispatch(cmd) {
|
|
35960
35972
|
switch (cmd.type) {
|
|
35961
35973
|
case "UPDATE_CELL":
|
|
35962
|
-
return this.
|
|
35974
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
|
|
35963
35975
|
case "CLEAR_CELL":
|
|
35964
|
-
return this.checkValidations(cmd, this.
|
|
35976
|
+
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
|
|
35965
35977
|
default:
|
|
35966
35978
|
return "Success" /* CommandResult.Success */;
|
|
35967
35979
|
}
|
|
@@ -36111,8 +36123,8 @@ class CellPlugin extends CorePlugin {
|
|
|
36111
36123
|
}
|
|
36112
36124
|
removeDefaultStyleValues(style) {
|
|
36113
36125
|
const cleanedStyle = { ...style };
|
|
36114
|
-
for (const
|
|
36115
|
-
if (cleanedStyle[property] ===
|
|
36126
|
+
for (const property in DEFAULT_STYLE) {
|
|
36127
|
+
if (cleanedStyle[property] === DEFAULT_STYLE[property]) {
|
|
36116
36128
|
delete cleanedStyle[property];
|
|
36117
36129
|
}
|
|
36118
36130
|
}
|
|
@@ -36268,10 +36280,7 @@ class CellPlugin extends CorePlugin {
|
|
|
36268
36280
|
else {
|
|
36269
36281
|
style = before ? before.style : undefined;
|
|
36270
36282
|
}
|
|
36271
|
-
const
|
|
36272
|
-
let format = ("format" in after ? after.format : before && before.format) ||
|
|
36273
|
-
detectDateFormat(afterContent, locale) ||
|
|
36274
|
-
detectNumberFormat(afterContent);
|
|
36283
|
+
const format = "format" in after ? after.format : before && before.format;
|
|
36275
36284
|
/* Read the following IF as:
|
|
36276
36285
|
* we need to remove the cell if it is completely empty, but we can know if it completely empty if:
|
|
36277
36286
|
* - the command says the new content is empty and has no border/format/style
|
|
@@ -36312,6 +36321,7 @@ class CellPlugin extends CorePlugin {
|
|
|
36312
36321
|
}
|
|
36313
36322
|
createLiteralCell(id, content, format, style) {
|
|
36314
36323
|
const locale = this.getters.getLocale();
|
|
36324
|
+
format = format || detectDateFormat(content, locale) || detectNumberFormat(content);
|
|
36315
36325
|
if (format !== PLAIN_TEXT_FORMAT && !isEvaluationError(content)) {
|
|
36316
36326
|
content = toString(parseLiteral(content, locale));
|
|
36317
36327
|
}
|
|
@@ -36384,6 +36394,18 @@ class CellPlugin extends CorePlugin {
|
|
|
36384
36394
|
}
|
|
36385
36395
|
return "Success" /* CommandResult.Success */;
|
|
36386
36396
|
}
|
|
36397
|
+
checkUselessUpdateCell(cmd) {
|
|
36398
|
+
const cell = this.getters.getCell(cmd);
|
|
36399
|
+
const hasContent = "content" in cmd || "formula" in cmd;
|
|
36400
|
+
const hasStyle = "style" in cmd;
|
|
36401
|
+
const hasFormat = "format" in cmd;
|
|
36402
|
+
if ((!hasContent || cell?.content === cmd.content) &&
|
|
36403
|
+
(!hasStyle || deepEquals(cell?.style, cmd.style)) &&
|
|
36404
|
+
(!hasFormat || cell?.format === cmd.format)) {
|
|
36405
|
+
return "NoChanges" /* CommandResult.NoChanges */;
|
|
36406
|
+
}
|
|
36407
|
+
return "Success" /* CommandResult.Success */;
|
|
36408
|
+
}
|
|
36387
36409
|
}
|
|
36388
36410
|
class FormulaCellWithDependencies {
|
|
36389
36411
|
id;
|
|
@@ -41168,7 +41190,15 @@ class SpreadsheetRTree {
|
|
|
41168
41190
|
if (!this.rTrees[sheetId]) {
|
|
41169
41191
|
return;
|
|
41170
41192
|
}
|
|
41171
|
-
this.rTrees[sheetId].remove(item,
|
|
41193
|
+
this.rTrees[sheetId].remove(item, this.rtreeItemComparer);
|
|
41194
|
+
}
|
|
41195
|
+
rtreeItemComparer(left, right) {
|
|
41196
|
+
return (left.data == right.data &&
|
|
41197
|
+
left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
41198
|
+
left.boundingBox?.zone.left === right.boundingBox.zone.left &&
|
|
41199
|
+
left.boundingBox?.zone.top === right.boundingBox.zone.top &&
|
|
41200
|
+
left.boundingBox?.zone.right === right.boundingBox.zone.right &&
|
|
41201
|
+
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom);
|
|
41172
41202
|
}
|
|
41173
41203
|
}
|
|
41174
41204
|
/**
|
|
@@ -41246,7 +41276,7 @@ class FormulaDependencyGraph {
|
|
|
41246
41276
|
const queue = Array.from(ranges).reverse();
|
|
41247
41277
|
while (queue.length > 0) {
|
|
41248
41278
|
const range = queue.pop();
|
|
41249
|
-
visited.
|
|
41279
|
+
visited.addMany(this.encoder.encodeBoundingBox(range));
|
|
41250
41280
|
const impactedPositionIds = this.rTree.search(range).map((dep) => dep.data);
|
|
41251
41281
|
for (const positionId of impactedPositionIds) {
|
|
41252
41282
|
if (!visited.has(positionId)) {
|
|
@@ -41254,7 +41284,7 @@ class FormulaDependencyGraph {
|
|
|
41254
41284
|
}
|
|
41255
41285
|
}
|
|
41256
41286
|
}
|
|
41257
|
-
visited.
|
|
41287
|
+
visited.deleteMany(ranges.flatMap((r) => this.encoder.encodeBoundingBox(r)));
|
|
41258
41288
|
return visited;
|
|
41259
41289
|
}
|
|
41260
41290
|
}
|
|
@@ -41394,9 +41424,9 @@ class Evaluator {
|
|
|
41394
41424
|
const cells = positions.map((p) => this.encoder.encode(p));
|
|
41395
41425
|
const cellsToCompute = new JetSet(cells);
|
|
41396
41426
|
const arrayFormulasPositionIds = this.getArrayFormulasImpactedByChangesOf(cells);
|
|
41397
|
-
cellsToCompute.
|
|
41398
|
-
cellsToCompute.
|
|
41399
|
-
cellsToCompute.
|
|
41427
|
+
cellsToCompute.addMany(this.getCellsDependingOn(cells));
|
|
41428
|
+
cellsToCompute.addMany(arrayFormulasPositionIds);
|
|
41429
|
+
cellsToCompute.addMany(this.getCellsDependingOn(arrayFormulasPositionIds));
|
|
41400
41430
|
this.evaluate(cellsToCompute);
|
|
41401
41431
|
}
|
|
41402
41432
|
getArrayFormulasImpactedByChangesOf(positionIds) {
|
|
@@ -41410,7 +41440,7 @@ class Evaluator {
|
|
|
41410
41440
|
}
|
|
41411
41441
|
if (!content) {
|
|
41412
41442
|
// The previous content could have blocked some array formulas
|
|
41413
|
-
impactedPositionIds.
|
|
41443
|
+
impactedPositionIds.addMany(this.getArrayFormulasBlockedByOrSpreadingOn(positionId));
|
|
41414
41444
|
}
|
|
41415
41445
|
}
|
|
41416
41446
|
return impactedPositionIds;
|
|
@@ -41462,7 +41492,7 @@ class Evaluator {
|
|
|
41462
41492
|
}
|
|
41463
41493
|
const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(positionId);
|
|
41464
41494
|
const cells = new JetSet(arrayFormulas);
|
|
41465
|
-
cells.
|
|
41495
|
+
cells.addMany(this.getCellsDependingOn(arrayFormulas));
|
|
41466
41496
|
return cells;
|
|
41467
41497
|
}
|
|
41468
41498
|
nextPositionsToUpdate = new JetSet();
|
|
@@ -41600,7 +41630,7 @@ class Evaluator {
|
|
|
41600
41630
|
this.setEvaluatedCell(positionId, evaluatedCell);
|
|
41601
41631
|
// check if formula dependencies present in the spread zone
|
|
41602
41632
|
// if so, they need to be recomputed
|
|
41603
|
-
this.nextPositionsToUpdate.
|
|
41633
|
+
this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([positionId]));
|
|
41604
41634
|
};
|
|
41605
41635
|
}
|
|
41606
41636
|
invalidateSpreading(positionId) {
|
|
@@ -41615,8 +41645,8 @@ class Evaluator {
|
|
|
41615
41645
|
continue;
|
|
41616
41646
|
}
|
|
41617
41647
|
this.evaluatedCells.delete(child);
|
|
41618
|
-
this.nextPositionsToUpdate.
|
|
41619
|
-
this.nextPositionsToUpdate.
|
|
41648
|
+
this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([child]));
|
|
41649
|
+
this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedByOrSpreadingOn(child));
|
|
41620
41650
|
}
|
|
41621
41651
|
this.spreadingRelations.removeNode(positionId);
|
|
41622
41652
|
}
|
|
@@ -45485,7 +45515,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
45485
45515
|
}
|
|
45486
45516
|
finalize() {
|
|
45487
45517
|
if (this.isSearchDirty) {
|
|
45488
|
-
this.refreshSearch();
|
|
45518
|
+
this.refreshSearch(false);
|
|
45489
45519
|
this.isSearchDirty = false;
|
|
45490
45520
|
}
|
|
45491
45521
|
}
|
|
@@ -45529,10 +45559,10 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
45529
45559
|
/**
|
|
45530
45560
|
* refresh the matches according to the current search options
|
|
45531
45561
|
*/
|
|
45532
|
-
refreshSearch() {
|
|
45562
|
+
refreshSearch(jumpToMatchSheet = true) {
|
|
45533
45563
|
this.selectedMatchIndex = null;
|
|
45534
45564
|
this.findMatches();
|
|
45535
|
-
this.selectNextCell(Direction.current);
|
|
45565
|
+
this.selectNextCell(Direction.current, jumpToMatchSheet);
|
|
45536
45566
|
}
|
|
45537
45567
|
/**
|
|
45538
45568
|
* Updates the regex based on the current searchOptions and
|
|
@@ -45614,7 +45644,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
45614
45644
|
* It is also used to keep coherence between the selected searchMatch
|
|
45615
45645
|
* and selectedMatchIndex.
|
|
45616
45646
|
*/
|
|
45617
|
-
selectNextCell(indexChange) {
|
|
45647
|
+
selectNextCell(indexChange, jumpToMatchSheet = true) {
|
|
45618
45648
|
const matches = this.searchMatches;
|
|
45619
45649
|
if (!matches.length) {
|
|
45620
45650
|
this.selectedMatchIndex = null;
|
|
@@ -45640,7 +45670,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
45640
45670
|
this.selectedMatchIndex = nextIndex;
|
|
45641
45671
|
const selectedMatch = matches[nextIndex];
|
|
45642
45672
|
// Switch to the sheet where the match is located
|
|
45643
|
-
if (this.getters.getActiveSheetId() !== selectedMatch.sheetId) {
|
|
45673
|
+
if (jumpToMatchSheet && this.getters.getActiveSheetId() !== selectedMatch.sheetId) {
|
|
45644
45674
|
this.dispatch("ACTIVATE_SHEET", {
|
|
45645
45675
|
sheetIdFrom: this.getters.getActiveSheetId(),
|
|
45646
45676
|
sheetIdTo: selectedMatch.sheetId,
|
|
@@ -47212,7 +47242,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
47212
47242
|
"getCellText",
|
|
47213
47243
|
"getCellMultiLineText",
|
|
47214
47244
|
"getContiguousZone",
|
|
47215
|
-
"
|
|
47245
|
+
"isEvaluatedCellEmpty",
|
|
47216
47246
|
];
|
|
47217
47247
|
ctx = document.createElement("canvas").getContext("2d");
|
|
47218
47248
|
// ---------------------------------------------------------------------------
|
|
@@ -47340,14 +47370,23 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
47340
47370
|
return zone;
|
|
47341
47371
|
}
|
|
47342
47372
|
/**
|
|
47343
|
-
*
|
|
47344
|
-
* check
|
|
47373
|
+
* Checks if a cell evaluated value is empty. If the cell is part of a merge,
|
|
47374
|
+
* the check applies to the main cell of the merge.
|
|
47345
47375
|
*/
|
|
47346
|
-
|
|
47376
|
+
isEvaluatedCellEmpty(position) {
|
|
47347
47377
|
const mainPosition = this.getters.getMainCellPosition(position);
|
|
47348
47378
|
const cell = this.getters.getEvaluatedCell(mainPosition);
|
|
47349
47379
|
return cell.type === CellValueType.empty;
|
|
47350
47380
|
}
|
|
47381
|
+
/**
|
|
47382
|
+
* Checks if a cell is empty (i.e. does not have a content or a formula does not spread over it).
|
|
47383
|
+
* If the cell is part of a merge, the check applies to the main cell of the merge.
|
|
47384
|
+
*/
|
|
47385
|
+
isCellEmpty(position) {
|
|
47386
|
+
const mainPosition = this.getters.getMainCellPosition(position);
|
|
47387
|
+
return !(this.getters.getCorrespondingFormulaCell(mainPosition) ||
|
|
47388
|
+
this.getters.getCell(mainPosition)?.content);
|
|
47389
|
+
}
|
|
47351
47390
|
getColMaxWidth(sheetId, index) {
|
|
47352
47391
|
const cellsPositions = positions(this.getters.getColsZone(sheetId, index, index));
|
|
47353
47392
|
const sizes = cellsPositions.map((position) => this.getCellWidth({ sheetId, ...position }));
|
|
@@ -54889,8 +54928,8 @@ class SelectionStreamProcessorImpl {
|
|
|
54889
54928
|
let currentPosition = startPosition;
|
|
54890
54929
|
// If both the current cell and the next cell are not empty, we want to go to the end of the cluster
|
|
54891
54930
|
const nextCellPosition = this.getNextCellPosition(startPosition, dim, dir);
|
|
54892
|
-
let mode = !this.getters.
|
|
54893
|
-
!this.getters.
|
|
54931
|
+
let mode = !this.getters.isEvaluatedCellEmpty({ ...currentPosition, sheetId }) &&
|
|
54932
|
+
!this.getters.isEvaluatedCellEmpty({ ...nextCellPosition, sheetId })
|
|
54894
54933
|
? "endOfCluster"
|
|
54895
54934
|
: "nextCluster";
|
|
54896
54935
|
while (true) {
|
|
@@ -54900,7 +54939,7 @@ class SelectionStreamProcessorImpl {
|
|
|
54900
54939
|
currentPosition.row === nextCellPosition.row) {
|
|
54901
54940
|
break;
|
|
54902
54941
|
}
|
|
54903
|
-
const isNextCellEmpty = this.getters.
|
|
54942
|
+
const isNextCellEmpty = this.getters.isEvaluatedCellEmpty({ ...nextCellPosition, sheetId });
|
|
54904
54943
|
if (mode === "endOfCluster" && isNextCellEmpty) {
|
|
54905
54944
|
break;
|
|
54906
54945
|
}
|
|
@@ -57185,6 +57224,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
57185
57224
|
exports.tokenize = tokenize;
|
|
57186
57225
|
|
|
57187
57226
|
|
|
57188
|
-
__info__.version = "17.1.
|
|
57189
|
-
__info__.date = "2024-02-
|
|
57190
|
-
__info__.hash = "
|
|
57227
|
+
__info__.version = "17.1.5";
|
|
57228
|
+
__info__.date = "2024-02-16T14:23:54.651Z";
|
|
57229
|
+
__info__.hash = "29d8ad6";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -3349,6 +3349,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
3349
3349
|
private createErrorFormula;
|
|
3350
3350
|
private checkCellOutOfSheet;
|
|
3351
3351
|
private checkUselessClearCell;
|
|
3352
|
+
private checkUselessUpdateCell;
|
|
3352
3353
|
}
|
|
3353
3354
|
|
|
3354
3355
|
/**
|
|
@@ -4699,7 +4700,7 @@ declare class UIOptionsPlugin extends UIPlugin {
|
|
|
4699
4700
|
}
|
|
4700
4701
|
|
|
4701
4702
|
declare class SheetUIPlugin extends UIPlugin {
|
|
4702
|
-
static getters: readonly ["doesCellHaveGridIcon", "getCellWidth", "getTextWidth", "getCellText", "getCellMultiLineText", "getContiguousZone", "
|
|
4703
|
+
static getters: readonly ["doesCellHaveGridIcon", "getCellWidth", "getTextWidth", "getCellText", "getCellMultiLineText", "getContiguousZone", "isEvaluatedCellEmpty"];
|
|
4703
4704
|
private ctx;
|
|
4704
4705
|
allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
|
|
4705
4706
|
handle(cmd: Command): void;
|
|
@@ -4717,10 +4718,15 @@ declare class SheetUIPlugin extends UIPlugin {
|
|
|
4717
4718
|
*/
|
|
4718
4719
|
getContiguousZone(sheetId: UID, zoneToExpand: Zone): Zone;
|
|
4719
4720
|
/**
|
|
4720
|
-
*
|
|
4721
|
-
* check
|
|
4721
|
+
* Checks if a cell evaluated value is empty. If the cell is part of a merge,
|
|
4722
|
+
* the check applies to the main cell of the merge.
|
|
4722
4723
|
*/
|
|
4723
|
-
|
|
4724
|
+
isEvaluatedCellEmpty(position: CellPosition): boolean;
|
|
4725
|
+
/**
|
|
4726
|
+
* Checks if a cell is empty (i.e. does not have a content or a formula does not spread over it).
|
|
4727
|
+
* If the cell is part of a merge, the check applies to the main cell of the merge.
|
|
4728
|
+
*/
|
|
4729
|
+
private isCellEmpty;
|
|
4724
4730
|
private getColMaxWidth;
|
|
4725
4731
|
/**
|
|
4726
4732
|
* Check that any "sheetId" in the command matches an existing
|
|
@@ -7721,6 +7727,8 @@ declare class TextValueProvider extends Component<Props$b> {
|
|
|
7721
7727
|
onValueSelected: FunctionConstructor;
|
|
7722
7728
|
onValueHovered: FunctionConstructor;
|
|
7723
7729
|
};
|
|
7730
|
+
private autoCompleteListRef;
|
|
7731
|
+
setup(): void;
|
|
7724
7732
|
}
|
|
7725
7733
|
|
|
7726
7734
|
declare class ContentEditableHelper {
|