@odoo/o-spreadsheet 16.0.26 → 16.0.27
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 +68 -58
- package/dist/o-spreadsheet.d.ts +9 -9
- package/dist/o-spreadsheet.esm.js +68 -58
- package/dist/o-spreadsheet.iife.js +68 -58
- package/dist/o-spreadsheet.iife.min.js +225 -225
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -3884,6 +3884,7 @@
|
|
|
3884
3884
|
return node.description ? node.description : "";
|
|
3885
3885
|
}
|
|
3886
3886
|
|
|
3887
|
+
const macRegex = /Mac/i;
|
|
3887
3888
|
/**
|
|
3888
3889
|
* Return true if the event was triggered from
|
|
3889
3890
|
* a child element.
|
|
@@ -3903,7 +3904,15 @@
|
|
|
3903
3904
|
return Array.from(document.querySelectorAll(".o-spreadsheet .o-menu"));
|
|
3904
3905
|
}
|
|
3905
3906
|
function isMacOS() {
|
|
3906
|
-
return navigator.userAgent
|
|
3907
|
+
return Boolean(macRegex.test(navigator.userAgent));
|
|
3908
|
+
}
|
|
3909
|
+
/**
|
|
3910
|
+
* @param {KeyboardEvent | MouseEvent} ev
|
|
3911
|
+
* @returns Returns true if the event was triggered with the "ctrl" modifier pressed.
|
|
3912
|
+
* On Mac, this is the "meta" or "command" key.
|
|
3913
|
+
*/
|
|
3914
|
+
function isCtrlKey(ev) {
|
|
3915
|
+
return isMacOS() ? ev.metaKey : ev.ctrlKey;
|
|
3907
3916
|
}
|
|
3908
3917
|
|
|
3909
3918
|
/**
|
|
@@ -21473,7 +21482,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21473
21482
|
return;
|
|
21474
21483
|
}
|
|
21475
21484
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
21476
|
-
this.props.onCellClicked(col, row, {
|
|
21485
|
+
this.props.onCellClicked(col, row, {
|
|
21486
|
+
expandZone: ev.shiftKey,
|
|
21487
|
+
addZone: isCtrlKey(ev),
|
|
21488
|
+
});
|
|
21477
21489
|
}
|
|
21478
21490
|
onDoubleClick(ev) {
|
|
21479
21491
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
@@ -21701,7 +21713,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21701
21713
|
this._increaseSelection(index);
|
|
21702
21714
|
}
|
|
21703
21715
|
else {
|
|
21704
|
-
this._selectElement(index, ev
|
|
21716
|
+
this._selectElement(index, isCtrlKey(ev));
|
|
21705
21717
|
}
|
|
21706
21718
|
this.lastSelectedElementIndex = index;
|
|
21707
21719
|
const mouseMoveSelect = (col, row) => {
|
|
@@ -21714,7 +21726,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21714
21726
|
const mouseUpSelect = () => {
|
|
21715
21727
|
this.state.isSelecting = false;
|
|
21716
21728
|
this.lastSelectedElementIndex = null;
|
|
21717
|
-
this.env.model.dispatch(ev
|
|
21729
|
+
this.env.model.dispatch(isCtrlKey(ev) ? "PREPARE_SELECTION_INPUT_EXPANSION" : "STOP_SELECTION_INPUT");
|
|
21718
21730
|
this._computeGrabDisplay(ev);
|
|
21719
21731
|
};
|
|
21720
21732
|
dragAndDropBeyondTheViewport(this.env, mouseMoveSelect, mouseUpSelect);
|
|
@@ -21861,8 +21873,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21861
21873
|
this.env.raiseError(MergeErrorMessage);
|
|
21862
21874
|
}
|
|
21863
21875
|
}
|
|
21864
|
-
_selectElement(index,
|
|
21865
|
-
this.env.model.selection.selectColumn(index,
|
|
21876
|
+
_selectElement(index, addDistinctHeader) {
|
|
21877
|
+
this.env.model.selection.selectColumn(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
21866
21878
|
}
|
|
21867
21879
|
_increaseSelection(index) {
|
|
21868
21880
|
this.env.model.selection.selectColumn(index, "updateAnchor");
|
|
@@ -22031,8 +22043,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
22031
22043
|
this.env.raiseError(MergeErrorMessage);
|
|
22032
22044
|
}
|
|
22033
22045
|
}
|
|
22034
|
-
_selectElement(index,
|
|
22035
|
-
this.env.model.selection.selectRow(index,
|
|
22046
|
+
_selectElement(index, addDistinctHeader) {
|
|
22047
|
+
this.env.model.selection.selectRow(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
22036
22048
|
}
|
|
22037
22049
|
_increaseSelection(index) {
|
|
22038
22050
|
this.env.model.selection.selectRow(index, "updateAnchor");
|
|
@@ -22723,18 +22735,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
22723
22735
|
// ---------------------------------------------------------------------------
|
|
22724
22736
|
// Zone selection with mouse
|
|
22725
22737
|
// ---------------------------------------------------------------------------
|
|
22726
|
-
onCellClicked(col, row, {
|
|
22727
|
-
if (
|
|
22738
|
+
onCellClicked(col, row, { addZone, expandZone }) {
|
|
22739
|
+
if (addZone) {
|
|
22728
22740
|
this.env.model.dispatch("PREPARE_SELECTION_INPUT_EXPANSION");
|
|
22729
22741
|
}
|
|
22730
22742
|
this.closeOpenedPopover();
|
|
22731
22743
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
22732
22744
|
this.env.model.dispatch("STOP_EDITION");
|
|
22733
22745
|
}
|
|
22734
|
-
if (
|
|
22746
|
+
if (expandZone) {
|
|
22735
22747
|
this.env.model.selection.setAnchorCorner(col, row);
|
|
22736
22748
|
}
|
|
22737
|
-
else if (
|
|
22749
|
+
else if (addZone) {
|
|
22738
22750
|
this.env.model.selection.addCellToSelection(col, row);
|
|
22739
22751
|
}
|
|
22740
22752
|
else {
|
|
@@ -22788,10 +22800,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
22788
22800
|
};
|
|
22789
22801
|
const direction = arrowMap[ev.key];
|
|
22790
22802
|
if (ev.shiftKey) {
|
|
22791
|
-
this.env.model.selection.resizeAnchorZone(direction, ev
|
|
22803
|
+
this.env.model.selection.resizeAnchorZone(direction, isCtrlKey(ev) ? "end" : 1);
|
|
22792
22804
|
}
|
|
22793
22805
|
else {
|
|
22794
|
-
this.env.model.selection.moveAnchorCell(direction, ev
|
|
22806
|
+
this.env.model.selection.moveAnchorCell(direction, isCtrlKey(ev) ? "end" : 1);
|
|
22795
22807
|
}
|
|
22796
22808
|
if (this.env.model.getters.isPaintingFormat()) {
|
|
22797
22809
|
this.env.model.dispatch("PASTE", {
|
|
@@ -22805,9 +22817,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
22805
22817
|
return;
|
|
22806
22818
|
}
|
|
22807
22819
|
let keyDownString = "";
|
|
22808
|
-
if (ev
|
|
22809
|
-
keyDownString += "CTRL+";
|
|
22810
|
-
if (ev.metaKey)
|
|
22820
|
+
if (isCtrlKey(ev))
|
|
22811
22821
|
keyDownString += "CTRL+";
|
|
22812
22822
|
if (ev.altKey)
|
|
22813
22823
|
keyDownString += "ALT+";
|
|
@@ -32568,13 +32578,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32568
32578
|
// Getters
|
|
32569
32579
|
// ---------------------------------------------------------------------------
|
|
32570
32580
|
evaluateFormula(formulaString, sheetId = this.getters.getActiveSheetId()) {
|
|
32571
|
-
|
|
32572
|
-
|
|
32573
|
-
|
|
32574
|
-
|
|
32575
|
-
|
|
32581
|
+
try {
|
|
32582
|
+
const compiledFormula = compile(formulaString);
|
|
32583
|
+
const params = this.getCompilationParameters(() => { });
|
|
32584
|
+
const ranges = [];
|
|
32585
|
+
for (let xc of compiledFormula.dependencies) {
|
|
32586
|
+
ranges.push(this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
32587
|
+
}
|
|
32588
|
+
return compiledFormula.execute(ranges, ...params).value;
|
|
32589
|
+
}
|
|
32590
|
+
catch (error) {
|
|
32591
|
+
return error instanceof EvaluationError ? error.errorType : CellErrorType.GenericError;
|
|
32576
32592
|
}
|
|
32577
|
-
return compiledFormula.execute(ranges, ...params).value;
|
|
32578
32593
|
}
|
|
32579
32594
|
/**
|
|
32580
32595
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
@@ -32976,39 +32991,34 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32976
32991
|
this.computedIcons[activeSheetId] = {};
|
|
32977
32992
|
const computedStyle = this.computedStyles[activeSheetId];
|
|
32978
32993
|
for (let cf of this.getters.getConditionalFormats(activeSheetId).reverse()) {
|
|
32979
|
-
|
|
32980
|
-
|
|
32981
|
-
|
|
32982
|
-
|
|
32983
|
-
|
|
32984
|
-
|
|
32985
|
-
|
|
32986
|
-
|
|
32987
|
-
|
|
32988
|
-
|
|
32989
|
-
|
|
32990
|
-
|
|
32991
|
-
|
|
32992
|
-
|
|
32993
|
-
|
|
32994
|
-
for (let
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
|
|
32998
|
-
if (
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
33003
|
-
}
|
|
32994
|
+
switch (cf.rule.type) {
|
|
32995
|
+
case "ColorScaleRule":
|
|
32996
|
+
for (let range of cf.ranges) {
|
|
32997
|
+
this.applyColorScale(range, cf.rule);
|
|
32998
|
+
}
|
|
32999
|
+
break;
|
|
33000
|
+
case "IconSetRule":
|
|
33001
|
+
for (let range of cf.ranges) {
|
|
33002
|
+
this.applyIcon(range, cf.rule);
|
|
33003
|
+
}
|
|
33004
|
+
break;
|
|
33005
|
+
default:
|
|
33006
|
+
for (let ref of cf.ranges) {
|
|
33007
|
+
const zone = this.getters.getRangeFromSheetXC(activeSheetId, ref).zone;
|
|
33008
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
33009
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
33010
|
+
const pr = this.rulePredicate[cf.rule.type];
|
|
33011
|
+
let cell = this.getters.getCell(activeSheetId, col, row);
|
|
33012
|
+
if (pr && pr(cell, cf.rule)) {
|
|
33013
|
+
if (!computedStyle[col])
|
|
33014
|
+
computedStyle[col] = [];
|
|
33015
|
+
// we must combine all the properties of all the CF rules applied to the given cell
|
|
33016
|
+
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
33004
33017
|
}
|
|
33005
33018
|
}
|
|
33006
33019
|
}
|
|
33007
|
-
|
|
33008
|
-
|
|
33009
|
-
}
|
|
33010
|
-
catch (_) {
|
|
33011
|
-
// we don't care about the errors within the evaluation of a rule
|
|
33020
|
+
}
|
|
33021
|
+
break;
|
|
33012
33022
|
}
|
|
33013
33023
|
}
|
|
33014
33024
|
}
|
|
@@ -33032,7 +33042,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
33032
33042
|
return percentile(rangeValues, Number(threshold.value) / 100, true);
|
|
33033
33043
|
case "formula":
|
|
33034
33044
|
const value = threshold.value && this.getters.evaluateFormula(threshold.value);
|
|
33035
|
-
return
|
|
33045
|
+
return typeof value === "number" ? value : null;
|
|
33036
33046
|
default:
|
|
33037
33047
|
return null;
|
|
33038
33048
|
}
|
|
@@ -39111,7 +39121,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
39111
39121
|
}
|
|
39112
39122
|
onKeydown(ev) {
|
|
39113
39123
|
let keyDownString = "";
|
|
39114
|
-
if (ev
|
|
39124
|
+
if (isCtrlKey(ev)) {
|
|
39115
39125
|
keyDownString += "CTRL+";
|
|
39116
39126
|
}
|
|
39117
39127
|
keyDownString += ev.key.toUpperCase();
|
|
@@ -43060,9 +43070,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
43060
43070
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
43061
43071
|
|
|
43062
43072
|
|
|
43063
|
-
__info__.version = '16.0.
|
|
43064
|
-
__info__.date = '
|
|
43065
|
-
__info__.hash = '
|
|
43073
|
+
__info__.version = '16.0.27';
|
|
43074
|
+
__info__.date = '2024-01-04T12:19:11.487Z';
|
|
43075
|
+
__info__.hash = '54006f6';
|
|
43066
43076
|
|
|
43067
43077
|
|
|
43068
43078
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|