@odoo/o-spreadsheet 17.0.66 → 17.0.68
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 +33 -20
- package/dist/o-spreadsheet.esm.js +33 -20
- package/dist/o-spreadsheet.iife.js +33 -20
- package/dist/o-spreadsheet.iife.min.js +3 -3
- 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 2025-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.68
|
|
6
|
+
* @date 2025-06-27T09:09:05.702Z
|
|
7
|
+
* @hash 33404c6
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -37654,7 +37654,7 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
37654
37654
|
else if (newRule.criterion.type === "isValueInList") {
|
|
37655
37655
|
newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
|
|
37656
37656
|
}
|
|
37657
|
-
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
|
|
37657
|
+
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
|
|
37658
37658
|
const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
|
|
37659
37659
|
if (ruleIndex !== -1) {
|
|
37660
37660
|
adaptedRules[ruleIndex] = newRule;
|
|
@@ -37664,10 +37664,13 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
37664
37664
|
this.history.update("rules", sheetId, [...adaptedRules, newRule]);
|
|
37665
37665
|
}
|
|
37666
37666
|
}
|
|
37667
|
-
removeRangesFromRules(sheetId, ranges, rules) {
|
|
37667
|
+
removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
|
|
37668
37668
|
rules = deepCopy(rules);
|
|
37669
37669
|
const rangesXcs = ranges.map((range) => this.getters.getRangeString(range, sheetId));
|
|
37670
37670
|
for (const rule of rules) {
|
|
37671
|
+
if (rule.id === editingRuleId) {
|
|
37672
|
+
continue; // Skip the rule being edited to preserve its place in the list
|
|
37673
|
+
}
|
|
37671
37674
|
const ruleRanges = rule.ranges.map((range) => this.getters.getRangeString(range, sheetId));
|
|
37672
37675
|
rule.ranges = recomputeZones(ruleRanges, rangesXcs).map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
37673
37676
|
}
|
|
@@ -55626,26 +55629,28 @@ class SelectionStreamProcessorImpl {
|
|
|
55626
55629
|
bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
|
|
55627
55630
|
};
|
|
55628
55631
|
};
|
|
55629
|
-
const {
|
|
55632
|
+
const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
|
|
55633
|
+
const { col: refCol, row: refRow } = refCell;
|
|
55630
55634
|
// check if we can shrink selection
|
|
55631
55635
|
let n = 0;
|
|
55632
55636
|
while (result !== null) {
|
|
55633
55637
|
n++;
|
|
55634
55638
|
if (deltaCol < 0) {
|
|
55635
55639
|
const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
|
|
55636
|
-
result =
|
|
55640
|
+
result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
|
|
55637
55641
|
}
|
|
55638
55642
|
if (deltaCol > 0) {
|
|
55639
55643
|
const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
|
|
55640
|
-
result = left + n <=
|
|
55644
|
+
result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
|
|
55641
55645
|
}
|
|
55642
55646
|
if (deltaRow < 0) {
|
|
55643
55647
|
const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
|
|
55644
|
-
result =
|
|
55648
|
+
result =
|
|
55649
|
+
refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
|
|
55645
55650
|
}
|
|
55646
55651
|
if (deltaRow > 0) {
|
|
55647
55652
|
const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
|
|
55648
|
-
result = top + n <=
|
|
55653
|
+
result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
|
|
55649
55654
|
}
|
|
55650
55655
|
result = result ? organizeZone(result) : result;
|
|
55651
55656
|
if (result && !isEqual(result, anchor.zone)) {
|
|
@@ -55874,18 +55879,26 @@ class SelectionStreamProcessorImpl {
|
|
|
55874
55879
|
* If the anchor is hidden, browses from left to right and top to bottom to
|
|
55875
55880
|
* find a visible cell.
|
|
55876
55881
|
*/
|
|
55877
|
-
|
|
55882
|
+
getReferenceAnchor() {
|
|
55878
55883
|
const sheetId = this.getters.getActiveSheetId();
|
|
55879
55884
|
const anchor = this.anchor;
|
|
55880
55885
|
const { left, right, top, bottom } = anchor.zone;
|
|
55881
55886
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
55887
|
+
const col = this.getters.isColHidden(sheetId, anchorCol)
|
|
55888
|
+
? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
|
|
55889
|
+
: anchorCol;
|
|
55890
|
+
const row = this.getters.isRowHidden(sheetId, anchorRow)
|
|
55891
|
+
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
55892
|
+
: anchorRow;
|
|
55893
|
+
const zone = this.getters.expandZone(sheetId, {
|
|
55894
|
+
left: col,
|
|
55895
|
+
right: col,
|
|
55896
|
+
top: row,
|
|
55897
|
+
bottom: row,
|
|
55898
|
+
});
|
|
55882
55899
|
return {
|
|
55883
|
-
|
|
55884
|
-
|
|
55885
|
-
: anchorCol,
|
|
55886
|
-
row: this.getters.isRowHidden(sheetId, anchorRow)
|
|
55887
|
-
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
55888
|
-
: anchorRow,
|
|
55900
|
+
cell: { col, row },
|
|
55901
|
+
zone,
|
|
55889
55902
|
};
|
|
55890
55903
|
}
|
|
55891
55904
|
deltaToTarget(position, direction, step) {
|
|
@@ -58350,6 +58363,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
58350
58363
|
exports.tokenize = tokenize;
|
|
58351
58364
|
|
|
58352
58365
|
|
|
58353
|
-
__info__.version = "17.0.
|
|
58354
|
-
__info__.date = "2025-06-
|
|
58355
|
-
__info__.hash = "
|
|
58366
|
+
__info__.version = "17.0.68";
|
|
58367
|
+
__info__.date = "2025-06-27T09:09:05.702Z";
|
|
58368
|
+
__info__.hash = "33404c6";
|
|
@@ -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 2025-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.68
|
|
6
|
+
* @date 2025-06-27T09:09:05.702Z
|
|
7
|
+
* @hash 33404c6
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
|
|
@@ -37652,7 +37652,7 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
37652
37652
|
else if (newRule.criterion.type === "isValueInList") {
|
|
37653
37653
|
newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
|
|
37654
37654
|
}
|
|
37655
|
-
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
|
|
37655
|
+
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
|
|
37656
37656
|
const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
|
|
37657
37657
|
if (ruleIndex !== -1) {
|
|
37658
37658
|
adaptedRules[ruleIndex] = newRule;
|
|
@@ -37662,10 +37662,13 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
37662
37662
|
this.history.update("rules", sheetId, [...adaptedRules, newRule]);
|
|
37663
37663
|
}
|
|
37664
37664
|
}
|
|
37665
|
-
removeRangesFromRules(sheetId, ranges, rules) {
|
|
37665
|
+
removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
|
|
37666
37666
|
rules = deepCopy(rules);
|
|
37667
37667
|
const rangesXcs = ranges.map((range) => this.getters.getRangeString(range, sheetId));
|
|
37668
37668
|
for (const rule of rules) {
|
|
37669
|
+
if (rule.id === editingRuleId) {
|
|
37670
|
+
continue; // Skip the rule being edited to preserve its place in the list
|
|
37671
|
+
}
|
|
37669
37672
|
const ruleRanges = rule.ranges.map((range) => this.getters.getRangeString(range, sheetId));
|
|
37670
37673
|
rule.ranges = recomputeZones(ruleRanges, rangesXcs).map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
37671
37674
|
}
|
|
@@ -55624,26 +55627,28 @@ class SelectionStreamProcessorImpl {
|
|
|
55624
55627
|
bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
|
|
55625
55628
|
};
|
|
55626
55629
|
};
|
|
55627
|
-
const {
|
|
55630
|
+
const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
|
|
55631
|
+
const { col: refCol, row: refRow } = refCell;
|
|
55628
55632
|
// check if we can shrink selection
|
|
55629
55633
|
let n = 0;
|
|
55630
55634
|
while (result !== null) {
|
|
55631
55635
|
n++;
|
|
55632
55636
|
if (deltaCol < 0) {
|
|
55633
55637
|
const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
|
|
55634
|
-
result =
|
|
55638
|
+
result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
|
|
55635
55639
|
}
|
|
55636
55640
|
if (deltaCol > 0) {
|
|
55637
55641
|
const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
|
|
55638
|
-
result = left + n <=
|
|
55642
|
+
result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
|
|
55639
55643
|
}
|
|
55640
55644
|
if (deltaRow < 0) {
|
|
55641
55645
|
const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
|
|
55642
|
-
result =
|
|
55646
|
+
result =
|
|
55647
|
+
refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
|
|
55643
55648
|
}
|
|
55644
55649
|
if (deltaRow > 0) {
|
|
55645
55650
|
const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
|
|
55646
|
-
result = top + n <=
|
|
55651
|
+
result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
|
|
55647
55652
|
}
|
|
55648
55653
|
result = result ? organizeZone(result) : result;
|
|
55649
55654
|
if (result && !isEqual(result, anchor.zone)) {
|
|
@@ -55872,18 +55877,26 @@ class SelectionStreamProcessorImpl {
|
|
|
55872
55877
|
* If the anchor is hidden, browses from left to right and top to bottom to
|
|
55873
55878
|
* find a visible cell.
|
|
55874
55879
|
*/
|
|
55875
|
-
|
|
55880
|
+
getReferenceAnchor() {
|
|
55876
55881
|
const sheetId = this.getters.getActiveSheetId();
|
|
55877
55882
|
const anchor = this.anchor;
|
|
55878
55883
|
const { left, right, top, bottom } = anchor.zone;
|
|
55879
55884
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
55885
|
+
const col = this.getters.isColHidden(sheetId, anchorCol)
|
|
55886
|
+
? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
|
|
55887
|
+
: anchorCol;
|
|
55888
|
+
const row = this.getters.isRowHidden(sheetId, anchorRow)
|
|
55889
|
+
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
55890
|
+
: anchorRow;
|
|
55891
|
+
const zone = this.getters.expandZone(sheetId, {
|
|
55892
|
+
left: col,
|
|
55893
|
+
right: col,
|
|
55894
|
+
top: row,
|
|
55895
|
+
bottom: row,
|
|
55896
|
+
});
|
|
55880
55897
|
return {
|
|
55881
|
-
|
|
55882
|
-
|
|
55883
|
-
: anchorCol,
|
|
55884
|
-
row: this.getters.isRowHidden(sheetId, anchorRow)
|
|
55885
|
-
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
55886
|
-
: anchorRow,
|
|
55898
|
+
cell: { col, row },
|
|
55899
|
+
zone,
|
|
55887
55900
|
};
|
|
55888
55901
|
}
|
|
55889
55902
|
deltaToTarget(position, direction, step) {
|
|
@@ -58313,6 +58326,6 @@ const constants = {
|
|
|
58313
58326
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
58314
58327
|
|
|
58315
58328
|
|
|
58316
|
-
__info__.version = "17.0.
|
|
58317
|
-
__info__.date = "2025-06-
|
|
58318
|
-
__info__.hash = "
|
|
58329
|
+
__info__.version = "17.0.68";
|
|
58330
|
+
__info__.date = "2025-06-27T09:09:05.702Z";
|
|
58331
|
+
__info__.hash = "33404c6";
|
|
@@ -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 2025-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.68
|
|
6
|
+
* @date 2025-06-27T09:09:05.702Z
|
|
7
|
+
* @hash 33404c6
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -37653,7 +37653,7 @@
|
|
|
37653
37653
|
else if (newRule.criterion.type === "isValueInList") {
|
|
37654
37654
|
newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
|
|
37655
37655
|
}
|
|
37656
|
-
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
|
|
37656
|
+
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
|
|
37657
37657
|
const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
|
|
37658
37658
|
if (ruleIndex !== -1) {
|
|
37659
37659
|
adaptedRules[ruleIndex] = newRule;
|
|
@@ -37663,10 +37663,13 @@
|
|
|
37663
37663
|
this.history.update("rules", sheetId, [...adaptedRules, newRule]);
|
|
37664
37664
|
}
|
|
37665
37665
|
}
|
|
37666
|
-
removeRangesFromRules(sheetId, ranges, rules) {
|
|
37666
|
+
removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
|
|
37667
37667
|
rules = deepCopy(rules);
|
|
37668
37668
|
const rangesXcs = ranges.map((range) => this.getters.getRangeString(range, sheetId));
|
|
37669
37669
|
for (const rule of rules) {
|
|
37670
|
+
if (rule.id === editingRuleId) {
|
|
37671
|
+
continue; // Skip the rule being edited to preserve its place in the list
|
|
37672
|
+
}
|
|
37670
37673
|
const ruleRanges = rule.ranges.map((range) => this.getters.getRangeString(range, sheetId));
|
|
37671
37674
|
rule.ranges = recomputeZones(ruleRanges, rangesXcs).map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
37672
37675
|
}
|
|
@@ -55625,26 +55628,28 @@
|
|
|
55625
55628
|
bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
|
|
55626
55629
|
};
|
|
55627
55630
|
};
|
|
55628
|
-
const {
|
|
55631
|
+
const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
|
|
55632
|
+
const { col: refCol, row: refRow } = refCell;
|
|
55629
55633
|
// check if we can shrink selection
|
|
55630
55634
|
let n = 0;
|
|
55631
55635
|
while (result !== null) {
|
|
55632
55636
|
n++;
|
|
55633
55637
|
if (deltaCol < 0) {
|
|
55634
55638
|
const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
|
|
55635
|
-
result =
|
|
55639
|
+
result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
|
|
55636
55640
|
}
|
|
55637
55641
|
if (deltaCol > 0) {
|
|
55638
55642
|
const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
|
|
55639
|
-
result = left + n <=
|
|
55643
|
+
result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
|
|
55640
55644
|
}
|
|
55641
55645
|
if (deltaRow < 0) {
|
|
55642
55646
|
const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
|
|
55643
|
-
result =
|
|
55647
|
+
result =
|
|
55648
|
+
refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
|
|
55644
55649
|
}
|
|
55645
55650
|
if (deltaRow > 0) {
|
|
55646
55651
|
const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
|
|
55647
|
-
result = top + n <=
|
|
55652
|
+
result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
|
|
55648
55653
|
}
|
|
55649
55654
|
result = result ? organizeZone(result) : result;
|
|
55650
55655
|
if (result && !isEqual(result, anchor.zone)) {
|
|
@@ -55873,18 +55878,26 @@
|
|
|
55873
55878
|
* If the anchor is hidden, browses from left to right and top to bottom to
|
|
55874
55879
|
* find a visible cell.
|
|
55875
55880
|
*/
|
|
55876
|
-
|
|
55881
|
+
getReferenceAnchor() {
|
|
55877
55882
|
const sheetId = this.getters.getActiveSheetId();
|
|
55878
55883
|
const anchor = this.anchor;
|
|
55879
55884
|
const { left, right, top, bottom } = anchor.zone;
|
|
55880
55885
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
55886
|
+
const col = this.getters.isColHidden(sheetId, anchorCol)
|
|
55887
|
+
? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
|
|
55888
|
+
: anchorCol;
|
|
55889
|
+
const row = this.getters.isRowHidden(sheetId, anchorRow)
|
|
55890
|
+
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
55891
|
+
: anchorRow;
|
|
55892
|
+
const zone = this.getters.expandZone(sheetId, {
|
|
55893
|
+
left: col,
|
|
55894
|
+
right: col,
|
|
55895
|
+
top: row,
|
|
55896
|
+
bottom: row,
|
|
55897
|
+
});
|
|
55881
55898
|
return {
|
|
55882
|
-
|
|
55883
|
-
|
|
55884
|
-
: anchorCol,
|
|
55885
|
-
row: this.getters.isRowHidden(sheetId, anchorRow)
|
|
55886
|
-
? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
|
|
55887
|
-
: anchorRow,
|
|
55899
|
+
cell: { col, row },
|
|
55900
|
+
zone,
|
|
55888
55901
|
};
|
|
55889
55902
|
}
|
|
55890
55903
|
deltaToTarget(position, direction, step) {
|
|
@@ -58349,9 +58362,9 @@
|
|
|
58349
58362
|
exports.tokenize = tokenize;
|
|
58350
58363
|
|
|
58351
58364
|
|
|
58352
|
-
__info__.version = "17.0.
|
|
58353
|
-
__info__.date = "2025-06-
|
|
58354
|
-
__info__.hash = "
|
|
58365
|
+
__info__.version = "17.0.68";
|
|
58366
|
+
__info__.date = "2025-06-27T09:09:05.702Z";
|
|
58367
|
+
__info__.hash = "33404c6";
|
|
58355
58368
|
|
|
58356
58369
|
|
|
58357
58370
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|