@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
|
@@ -3887,6 +3887,7 @@ function getMenuDescription(node) {
|
|
|
3887
3887
|
return node.description ? node.description : "";
|
|
3888
3888
|
}
|
|
3889
3889
|
|
|
3890
|
+
const macRegex = /Mac/i;
|
|
3890
3891
|
/**
|
|
3891
3892
|
* Return true if the event was triggered from
|
|
3892
3893
|
* a child element.
|
|
@@ -3906,7 +3907,15 @@ function getOpenedMenus() {
|
|
|
3906
3907
|
return Array.from(document.querySelectorAll(".o-spreadsheet .o-menu"));
|
|
3907
3908
|
}
|
|
3908
3909
|
function isMacOS() {
|
|
3909
|
-
return navigator.userAgent
|
|
3910
|
+
return Boolean(macRegex.test(navigator.userAgent));
|
|
3911
|
+
}
|
|
3912
|
+
/**
|
|
3913
|
+
* @param {KeyboardEvent | MouseEvent} ev
|
|
3914
|
+
* @returns Returns true if the event was triggered with the "ctrl" modifier pressed.
|
|
3915
|
+
* On Mac, this is the "meta" or "command" key.
|
|
3916
|
+
*/
|
|
3917
|
+
function isCtrlKey(ev) {
|
|
3918
|
+
return isMacOS() ? ev.metaKey : ev.ctrlKey;
|
|
3910
3919
|
}
|
|
3911
3920
|
|
|
3912
3921
|
/**
|
|
@@ -21476,7 +21485,10 @@ class GridOverlay extends owl.Component {
|
|
|
21476
21485
|
return;
|
|
21477
21486
|
}
|
|
21478
21487
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
21479
|
-
this.props.onCellClicked(col, row, {
|
|
21488
|
+
this.props.onCellClicked(col, row, {
|
|
21489
|
+
expandZone: ev.shiftKey,
|
|
21490
|
+
addZone: isCtrlKey(ev),
|
|
21491
|
+
});
|
|
21480
21492
|
}
|
|
21481
21493
|
onDoubleClick(ev) {
|
|
21482
21494
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
@@ -21704,7 +21716,7 @@ class AbstractResizer extends owl.Component {
|
|
|
21704
21716
|
this._increaseSelection(index);
|
|
21705
21717
|
}
|
|
21706
21718
|
else {
|
|
21707
|
-
this._selectElement(index, ev
|
|
21719
|
+
this._selectElement(index, isCtrlKey(ev));
|
|
21708
21720
|
}
|
|
21709
21721
|
this.lastSelectedElementIndex = index;
|
|
21710
21722
|
const mouseMoveSelect = (col, row) => {
|
|
@@ -21717,7 +21729,7 @@ class AbstractResizer extends owl.Component {
|
|
|
21717
21729
|
const mouseUpSelect = () => {
|
|
21718
21730
|
this.state.isSelecting = false;
|
|
21719
21731
|
this.lastSelectedElementIndex = null;
|
|
21720
|
-
this.env.model.dispatch(ev
|
|
21732
|
+
this.env.model.dispatch(isCtrlKey(ev) ? "PREPARE_SELECTION_INPUT_EXPANSION" : "STOP_SELECTION_INPUT");
|
|
21721
21733
|
this._computeGrabDisplay(ev);
|
|
21722
21734
|
};
|
|
21723
21735
|
dragAndDropBeyondTheViewport(this.env, mouseMoveSelect, mouseUpSelect);
|
|
@@ -21864,8 +21876,8 @@ class ColResizer extends AbstractResizer {
|
|
|
21864
21876
|
this.env.raiseError(MergeErrorMessage);
|
|
21865
21877
|
}
|
|
21866
21878
|
}
|
|
21867
|
-
_selectElement(index,
|
|
21868
|
-
this.env.model.selection.selectColumn(index,
|
|
21879
|
+
_selectElement(index, addDistinctHeader) {
|
|
21880
|
+
this.env.model.selection.selectColumn(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
21869
21881
|
}
|
|
21870
21882
|
_increaseSelection(index) {
|
|
21871
21883
|
this.env.model.selection.selectColumn(index, "updateAnchor");
|
|
@@ -22034,8 +22046,8 @@ class RowResizer extends AbstractResizer {
|
|
|
22034
22046
|
this.env.raiseError(MergeErrorMessage);
|
|
22035
22047
|
}
|
|
22036
22048
|
}
|
|
22037
|
-
_selectElement(index,
|
|
22038
|
-
this.env.model.selection.selectRow(index,
|
|
22049
|
+
_selectElement(index, addDistinctHeader) {
|
|
22050
|
+
this.env.model.selection.selectRow(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
22039
22051
|
}
|
|
22040
22052
|
_increaseSelection(index) {
|
|
22041
22053
|
this.env.model.selection.selectRow(index, "updateAnchor");
|
|
@@ -22726,18 +22738,18 @@ class Grid extends owl.Component {
|
|
|
22726
22738
|
// ---------------------------------------------------------------------------
|
|
22727
22739
|
// Zone selection with mouse
|
|
22728
22740
|
// ---------------------------------------------------------------------------
|
|
22729
|
-
onCellClicked(col, row, {
|
|
22730
|
-
if (
|
|
22741
|
+
onCellClicked(col, row, { addZone, expandZone }) {
|
|
22742
|
+
if (addZone) {
|
|
22731
22743
|
this.env.model.dispatch("PREPARE_SELECTION_INPUT_EXPANSION");
|
|
22732
22744
|
}
|
|
22733
22745
|
this.closeOpenedPopover();
|
|
22734
22746
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
22735
22747
|
this.env.model.dispatch("STOP_EDITION");
|
|
22736
22748
|
}
|
|
22737
|
-
if (
|
|
22749
|
+
if (expandZone) {
|
|
22738
22750
|
this.env.model.selection.setAnchorCorner(col, row);
|
|
22739
22751
|
}
|
|
22740
|
-
else if (
|
|
22752
|
+
else if (addZone) {
|
|
22741
22753
|
this.env.model.selection.addCellToSelection(col, row);
|
|
22742
22754
|
}
|
|
22743
22755
|
else {
|
|
@@ -22791,10 +22803,10 @@ class Grid extends owl.Component {
|
|
|
22791
22803
|
};
|
|
22792
22804
|
const direction = arrowMap[ev.key];
|
|
22793
22805
|
if (ev.shiftKey) {
|
|
22794
|
-
this.env.model.selection.resizeAnchorZone(direction, ev
|
|
22806
|
+
this.env.model.selection.resizeAnchorZone(direction, isCtrlKey(ev) ? "end" : 1);
|
|
22795
22807
|
}
|
|
22796
22808
|
else {
|
|
22797
|
-
this.env.model.selection.moveAnchorCell(direction, ev
|
|
22809
|
+
this.env.model.selection.moveAnchorCell(direction, isCtrlKey(ev) ? "end" : 1);
|
|
22798
22810
|
}
|
|
22799
22811
|
if (this.env.model.getters.isPaintingFormat()) {
|
|
22800
22812
|
this.env.model.dispatch("PASTE", {
|
|
@@ -22808,9 +22820,7 @@ class Grid extends owl.Component {
|
|
|
22808
22820
|
return;
|
|
22809
22821
|
}
|
|
22810
22822
|
let keyDownString = "";
|
|
22811
|
-
if (ev
|
|
22812
|
-
keyDownString += "CTRL+";
|
|
22813
|
-
if (ev.metaKey)
|
|
22823
|
+
if (isCtrlKey(ev))
|
|
22814
22824
|
keyDownString += "CTRL+";
|
|
22815
22825
|
if (ev.altKey)
|
|
22816
22826
|
keyDownString += "ALT+";
|
|
@@ -32571,13 +32581,18 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
32571
32581
|
// Getters
|
|
32572
32582
|
// ---------------------------------------------------------------------------
|
|
32573
32583
|
evaluateFormula(formulaString, sheetId = this.getters.getActiveSheetId()) {
|
|
32574
|
-
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
|
|
32584
|
+
try {
|
|
32585
|
+
const compiledFormula = compile(formulaString);
|
|
32586
|
+
const params = this.getCompilationParameters(() => { });
|
|
32587
|
+
const ranges = [];
|
|
32588
|
+
for (let xc of compiledFormula.dependencies) {
|
|
32589
|
+
ranges.push(this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
32590
|
+
}
|
|
32591
|
+
return compiledFormula.execute(ranges, ...params).value;
|
|
32592
|
+
}
|
|
32593
|
+
catch (error) {
|
|
32594
|
+
return error instanceof EvaluationError ? error.errorType : CellErrorType.GenericError;
|
|
32579
32595
|
}
|
|
32580
|
-
return compiledFormula.execute(ranges, ...params).value;
|
|
32581
32596
|
}
|
|
32582
32597
|
/**
|
|
32583
32598
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
@@ -32979,39 +32994,34 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
32979
32994
|
this.computedIcons[activeSheetId] = {};
|
|
32980
32995
|
const computedStyle = this.computedStyles[activeSheetId];
|
|
32981
32996
|
for (let cf of this.getters.getConditionalFormats(activeSheetId).reverse()) {
|
|
32982
|
-
|
|
32983
|
-
|
|
32984
|
-
|
|
32985
|
-
|
|
32986
|
-
|
|
32987
|
-
|
|
32988
|
-
|
|
32989
|
-
|
|
32990
|
-
|
|
32991
|
-
|
|
32992
|
-
|
|
32993
|
-
|
|
32994
|
-
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
for (let
|
|
32998
|
-
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
if (
|
|
33002
|
-
|
|
33003
|
-
|
|
33004
|
-
|
|
33005
|
-
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
33006
|
-
}
|
|
32997
|
+
switch (cf.rule.type) {
|
|
32998
|
+
case "ColorScaleRule":
|
|
32999
|
+
for (let range of cf.ranges) {
|
|
33000
|
+
this.applyColorScale(range, cf.rule);
|
|
33001
|
+
}
|
|
33002
|
+
break;
|
|
33003
|
+
case "IconSetRule":
|
|
33004
|
+
for (let range of cf.ranges) {
|
|
33005
|
+
this.applyIcon(range, cf.rule);
|
|
33006
|
+
}
|
|
33007
|
+
break;
|
|
33008
|
+
default:
|
|
33009
|
+
for (let ref of cf.ranges) {
|
|
33010
|
+
const zone = this.getters.getRangeFromSheetXC(activeSheetId, ref).zone;
|
|
33011
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
33012
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
33013
|
+
const pr = this.rulePredicate[cf.rule.type];
|
|
33014
|
+
let cell = this.getters.getCell(activeSheetId, col, row);
|
|
33015
|
+
if (pr && pr(cell, cf.rule)) {
|
|
33016
|
+
if (!computedStyle[col])
|
|
33017
|
+
computedStyle[col] = [];
|
|
33018
|
+
// we must combine all the properties of all the CF rules applied to the given cell
|
|
33019
|
+
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
33007
33020
|
}
|
|
33008
33021
|
}
|
|
33009
33022
|
}
|
|
33010
|
-
|
|
33011
|
-
|
|
33012
|
-
}
|
|
33013
|
-
catch (_) {
|
|
33014
|
-
// we don't care about the errors within the evaluation of a rule
|
|
33023
|
+
}
|
|
33024
|
+
break;
|
|
33015
33025
|
}
|
|
33016
33026
|
}
|
|
33017
33027
|
}
|
|
@@ -33035,7 +33045,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
33035
33045
|
return percentile(rangeValues, Number(threshold.value) / 100, true);
|
|
33036
33046
|
case "formula":
|
|
33037
33047
|
const value = threshold.value && this.getters.evaluateFormula(threshold.value);
|
|
33038
|
-
return
|
|
33048
|
+
return typeof value === "number" ? value : null;
|
|
33039
33049
|
default:
|
|
33040
33050
|
return null;
|
|
33041
33051
|
}
|
|
@@ -39114,7 +39124,7 @@ class Spreadsheet extends owl.Component {
|
|
|
39114
39124
|
}
|
|
39115
39125
|
onKeydown(ev) {
|
|
39116
39126
|
let keyDownString = "";
|
|
39117
|
-
if (ev
|
|
39127
|
+
if (isCtrlKey(ev)) {
|
|
39118
39128
|
keyDownString += "CTRL+";
|
|
39119
39129
|
}
|
|
39120
39130
|
keyDownString += ev.key.toUpperCase();
|
|
@@ -43061,6 +43071,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
43061
43071
|
exports.tokenize = tokenize;
|
|
43062
43072
|
|
|
43063
43073
|
|
|
43064
|
-
__info__.version = '16.0.
|
|
43065
|
-
__info__.date = '
|
|
43066
|
-
__info__.hash = '
|
|
43074
|
+
__info__.version = '16.0.27';
|
|
43075
|
+
__info__.date = '2024-01-04T12:19:11.487Z';
|
|
43076
|
+
__info__.hash = '54006f6';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -3872,7 +3872,7 @@ declare class EvaluationPlugin extends UIPlugin {
|
|
|
3872
3872
|
constructor(getters: Getters, state: StateObserver, dispatch: CommandDispatcher["dispatch"], config: ModelConfig, selection: SelectionStreamProcessor);
|
|
3873
3873
|
handle(cmd: Command): void;
|
|
3874
3874
|
finalize(): void;
|
|
3875
|
-
evaluateFormula(formulaString: string, sheetId?: UID):
|
|
3875
|
+
evaluateFormula(formulaString: string, sheetId?: UID): FunctionReturnValue | null;
|
|
3876
3876
|
/**
|
|
3877
3877
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
3878
3878
|
*/
|
|
@@ -5759,8 +5759,8 @@ interface Props$d {
|
|
|
5759
5759
|
onCellHovered: (position: Partial<Position$1>) => void;
|
|
5760
5760
|
onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
|
|
5761
5761
|
onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
|
|
5762
|
-
|
|
5763
|
-
|
|
5762
|
+
addZone: boolean;
|
|
5763
|
+
expandZone: boolean;
|
|
5764
5764
|
}) => void;
|
|
5765
5765
|
onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
|
|
5766
5766
|
onGridResized: (dimension: DOMDimension) => void;
|
|
@@ -5842,7 +5842,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
|
|
|
5842
5842
|
abstract _getMaxSize(): Pixel;
|
|
5843
5843
|
abstract _updateSize(): void;
|
|
5844
5844
|
abstract _moveElements(): void;
|
|
5845
|
-
abstract _selectElement(index: HeaderIndex,
|
|
5845
|
+
abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
5846
5846
|
abstract _increaseSelection(index: HeaderIndex): void;
|
|
5847
5847
|
abstract _fitElementSize(index: HeaderIndex): void;
|
|
5848
5848
|
abstract _getType(): ContextMenuType;
|
|
@@ -5876,7 +5876,7 @@ declare class ColResizer extends AbstractResizer {
|
|
|
5876
5876
|
_getMaxSize(): Pixel;
|
|
5877
5877
|
_updateSize(): void;
|
|
5878
5878
|
_moveElements(): void;
|
|
5879
|
-
_selectElement(index: HeaderIndex,
|
|
5879
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
5880
5880
|
_increaseSelection(index: HeaderIndex): void;
|
|
5881
5881
|
_fitElementSize(index: HeaderIndex): void;
|
|
5882
5882
|
_getType(): ContextMenuType;
|
|
@@ -5901,7 +5901,7 @@ declare class RowResizer extends AbstractResizer {
|
|
|
5901
5901
|
_getMaxSize(): Pixel;
|
|
5902
5902
|
_updateSize(): void;
|
|
5903
5903
|
_moveElements(): void;
|
|
5904
|
-
_selectElement(index: HeaderIndex,
|
|
5904
|
+
_selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
|
|
5905
5905
|
_increaseSelection(index: HeaderIndex): void;
|
|
5906
5906
|
_fitElementSize(index: HeaderIndex): void;
|
|
5907
5907
|
_getType(): ContextMenuType;
|
|
@@ -6105,9 +6105,9 @@ declare class Grid extends Component<Props$5, SpreadsheetChildEnv> {
|
|
|
6105
6105
|
private moveCanvas;
|
|
6106
6106
|
getClientPositionKey(client: Client): string;
|
|
6107
6107
|
isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
|
|
6108
|
-
onCellClicked(col: HeaderIndex, row: HeaderIndex, {
|
|
6109
|
-
|
|
6110
|
-
|
|
6108
|
+
onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
|
|
6109
|
+
addZone: boolean;
|
|
6110
|
+
expandZone: boolean;
|
|
6111
6111
|
}): void;
|
|
6112
6112
|
onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
|
|
6113
6113
|
closeOpenedPopover(): void;
|
|
@@ -3883,6 +3883,7 @@ function getMenuDescription(node) {
|
|
|
3883
3883
|
return node.description ? node.description : "";
|
|
3884
3884
|
}
|
|
3885
3885
|
|
|
3886
|
+
const macRegex = /Mac/i;
|
|
3886
3887
|
/**
|
|
3887
3888
|
* Return true if the event was triggered from
|
|
3888
3889
|
* a child element.
|
|
@@ -3902,7 +3903,15 @@ function getOpenedMenus() {
|
|
|
3902
3903
|
return Array.from(document.querySelectorAll(".o-spreadsheet .o-menu"));
|
|
3903
3904
|
}
|
|
3904
3905
|
function isMacOS() {
|
|
3905
|
-
return navigator.userAgent
|
|
3906
|
+
return Boolean(macRegex.test(navigator.userAgent));
|
|
3907
|
+
}
|
|
3908
|
+
/**
|
|
3909
|
+
* @param {KeyboardEvent | MouseEvent} ev
|
|
3910
|
+
* @returns Returns true if the event was triggered with the "ctrl" modifier pressed.
|
|
3911
|
+
* On Mac, this is the "meta" or "command" key.
|
|
3912
|
+
*/
|
|
3913
|
+
function isCtrlKey(ev) {
|
|
3914
|
+
return isMacOS() ? ev.metaKey : ev.ctrlKey;
|
|
3906
3915
|
}
|
|
3907
3916
|
|
|
3908
3917
|
/**
|
|
@@ -21472,7 +21481,10 @@ class GridOverlay extends Component {
|
|
|
21472
21481
|
return;
|
|
21473
21482
|
}
|
|
21474
21483
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
21475
|
-
this.props.onCellClicked(col, row, {
|
|
21484
|
+
this.props.onCellClicked(col, row, {
|
|
21485
|
+
expandZone: ev.shiftKey,
|
|
21486
|
+
addZone: isCtrlKey(ev),
|
|
21487
|
+
});
|
|
21476
21488
|
}
|
|
21477
21489
|
onDoubleClick(ev) {
|
|
21478
21490
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
@@ -21700,7 +21712,7 @@ class AbstractResizer extends Component {
|
|
|
21700
21712
|
this._increaseSelection(index);
|
|
21701
21713
|
}
|
|
21702
21714
|
else {
|
|
21703
|
-
this._selectElement(index, ev
|
|
21715
|
+
this._selectElement(index, isCtrlKey(ev));
|
|
21704
21716
|
}
|
|
21705
21717
|
this.lastSelectedElementIndex = index;
|
|
21706
21718
|
const mouseMoveSelect = (col, row) => {
|
|
@@ -21713,7 +21725,7 @@ class AbstractResizer extends Component {
|
|
|
21713
21725
|
const mouseUpSelect = () => {
|
|
21714
21726
|
this.state.isSelecting = false;
|
|
21715
21727
|
this.lastSelectedElementIndex = null;
|
|
21716
|
-
this.env.model.dispatch(ev
|
|
21728
|
+
this.env.model.dispatch(isCtrlKey(ev) ? "PREPARE_SELECTION_INPUT_EXPANSION" : "STOP_SELECTION_INPUT");
|
|
21717
21729
|
this._computeGrabDisplay(ev);
|
|
21718
21730
|
};
|
|
21719
21731
|
dragAndDropBeyondTheViewport(this.env, mouseMoveSelect, mouseUpSelect);
|
|
@@ -21860,8 +21872,8 @@ class ColResizer extends AbstractResizer {
|
|
|
21860
21872
|
this.env.raiseError(MergeErrorMessage);
|
|
21861
21873
|
}
|
|
21862
21874
|
}
|
|
21863
|
-
_selectElement(index,
|
|
21864
|
-
this.env.model.selection.selectColumn(index,
|
|
21875
|
+
_selectElement(index, addDistinctHeader) {
|
|
21876
|
+
this.env.model.selection.selectColumn(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
21865
21877
|
}
|
|
21866
21878
|
_increaseSelection(index) {
|
|
21867
21879
|
this.env.model.selection.selectColumn(index, "updateAnchor");
|
|
@@ -22030,8 +22042,8 @@ class RowResizer extends AbstractResizer {
|
|
|
22030
22042
|
this.env.raiseError(MergeErrorMessage);
|
|
22031
22043
|
}
|
|
22032
22044
|
}
|
|
22033
|
-
_selectElement(index,
|
|
22034
|
-
this.env.model.selection.selectRow(index,
|
|
22045
|
+
_selectElement(index, addDistinctHeader) {
|
|
22046
|
+
this.env.model.selection.selectRow(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
22035
22047
|
}
|
|
22036
22048
|
_increaseSelection(index) {
|
|
22037
22049
|
this.env.model.selection.selectRow(index, "updateAnchor");
|
|
@@ -22722,18 +22734,18 @@ class Grid extends Component {
|
|
|
22722
22734
|
// ---------------------------------------------------------------------------
|
|
22723
22735
|
// Zone selection with mouse
|
|
22724
22736
|
// ---------------------------------------------------------------------------
|
|
22725
|
-
onCellClicked(col, row, {
|
|
22726
|
-
if (
|
|
22737
|
+
onCellClicked(col, row, { addZone, expandZone }) {
|
|
22738
|
+
if (addZone) {
|
|
22727
22739
|
this.env.model.dispatch("PREPARE_SELECTION_INPUT_EXPANSION");
|
|
22728
22740
|
}
|
|
22729
22741
|
this.closeOpenedPopover();
|
|
22730
22742
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
22731
22743
|
this.env.model.dispatch("STOP_EDITION");
|
|
22732
22744
|
}
|
|
22733
|
-
if (
|
|
22745
|
+
if (expandZone) {
|
|
22734
22746
|
this.env.model.selection.setAnchorCorner(col, row);
|
|
22735
22747
|
}
|
|
22736
|
-
else if (
|
|
22748
|
+
else if (addZone) {
|
|
22737
22749
|
this.env.model.selection.addCellToSelection(col, row);
|
|
22738
22750
|
}
|
|
22739
22751
|
else {
|
|
@@ -22787,10 +22799,10 @@ class Grid extends Component {
|
|
|
22787
22799
|
};
|
|
22788
22800
|
const direction = arrowMap[ev.key];
|
|
22789
22801
|
if (ev.shiftKey) {
|
|
22790
|
-
this.env.model.selection.resizeAnchorZone(direction, ev
|
|
22802
|
+
this.env.model.selection.resizeAnchorZone(direction, isCtrlKey(ev) ? "end" : 1);
|
|
22791
22803
|
}
|
|
22792
22804
|
else {
|
|
22793
|
-
this.env.model.selection.moveAnchorCell(direction, ev
|
|
22805
|
+
this.env.model.selection.moveAnchorCell(direction, isCtrlKey(ev) ? "end" : 1);
|
|
22794
22806
|
}
|
|
22795
22807
|
if (this.env.model.getters.isPaintingFormat()) {
|
|
22796
22808
|
this.env.model.dispatch("PASTE", {
|
|
@@ -22804,9 +22816,7 @@ class Grid extends Component {
|
|
|
22804
22816
|
return;
|
|
22805
22817
|
}
|
|
22806
22818
|
let keyDownString = "";
|
|
22807
|
-
if (ev
|
|
22808
|
-
keyDownString += "CTRL+";
|
|
22809
|
-
if (ev.metaKey)
|
|
22819
|
+
if (isCtrlKey(ev))
|
|
22810
22820
|
keyDownString += "CTRL+";
|
|
22811
22821
|
if (ev.altKey)
|
|
22812
22822
|
keyDownString += "ALT+";
|
|
@@ -32567,13 +32577,18 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
32567
32577
|
// Getters
|
|
32568
32578
|
// ---------------------------------------------------------------------------
|
|
32569
32579
|
evaluateFormula(formulaString, sheetId = this.getters.getActiveSheetId()) {
|
|
32570
|
-
|
|
32571
|
-
|
|
32572
|
-
|
|
32573
|
-
|
|
32574
|
-
|
|
32580
|
+
try {
|
|
32581
|
+
const compiledFormula = compile(formulaString);
|
|
32582
|
+
const params = this.getCompilationParameters(() => { });
|
|
32583
|
+
const ranges = [];
|
|
32584
|
+
for (let xc of compiledFormula.dependencies) {
|
|
32585
|
+
ranges.push(this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
32586
|
+
}
|
|
32587
|
+
return compiledFormula.execute(ranges, ...params).value;
|
|
32588
|
+
}
|
|
32589
|
+
catch (error) {
|
|
32590
|
+
return error instanceof EvaluationError ? error.errorType : CellErrorType.GenericError;
|
|
32575
32591
|
}
|
|
32576
|
-
return compiledFormula.execute(ranges, ...params).value;
|
|
32577
32592
|
}
|
|
32578
32593
|
/**
|
|
32579
32594
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
@@ -32975,39 +32990,34 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
32975
32990
|
this.computedIcons[activeSheetId] = {};
|
|
32976
32991
|
const computedStyle = this.computedStyles[activeSheetId];
|
|
32977
32992
|
for (let cf of this.getters.getConditionalFormats(activeSheetId).reverse()) {
|
|
32978
|
-
|
|
32979
|
-
|
|
32980
|
-
|
|
32981
|
-
|
|
32982
|
-
|
|
32983
|
-
|
|
32984
|
-
|
|
32985
|
-
|
|
32986
|
-
|
|
32987
|
-
|
|
32988
|
-
|
|
32989
|
-
|
|
32990
|
-
|
|
32991
|
-
|
|
32992
|
-
|
|
32993
|
-
for (let
|
|
32994
|
-
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
if (
|
|
32998
|
-
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
33002
|
-
}
|
|
32993
|
+
switch (cf.rule.type) {
|
|
32994
|
+
case "ColorScaleRule":
|
|
32995
|
+
for (let range of cf.ranges) {
|
|
32996
|
+
this.applyColorScale(range, cf.rule);
|
|
32997
|
+
}
|
|
32998
|
+
break;
|
|
32999
|
+
case "IconSetRule":
|
|
33000
|
+
for (let range of cf.ranges) {
|
|
33001
|
+
this.applyIcon(range, cf.rule);
|
|
33002
|
+
}
|
|
33003
|
+
break;
|
|
33004
|
+
default:
|
|
33005
|
+
for (let ref of cf.ranges) {
|
|
33006
|
+
const zone = this.getters.getRangeFromSheetXC(activeSheetId, ref).zone;
|
|
33007
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
33008
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
33009
|
+
const pr = this.rulePredicate[cf.rule.type];
|
|
33010
|
+
let cell = this.getters.getCell(activeSheetId, col, row);
|
|
33011
|
+
if (pr && pr(cell, cf.rule)) {
|
|
33012
|
+
if (!computedStyle[col])
|
|
33013
|
+
computedStyle[col] = [];
|
|
33014
|
+
// we must combine all the properties of all the CF rules applied to the given cell
|
|
33015
|
+
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
33003
33016
|
}
|
|
33004
33017
|
}
|
|
33005
33018
|
}
|
|
33006
|
-
|
|
33007
|
-
|
|
33008
|
-
}
|
|
33009
|
-
catch (_) {
|
|
33010
|
-
// we don't care about the errors within the evaluation of a rule
|
|
33019
|
+
}
|
|
33020
|
+
break;
|
|
33011
33021
|
}
|
|
33012
33022
|
}
|
|
33013
33023
|
}
|
|
@@ -33031,7 +33041,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
33031
33041
|
return percentile(rangeValues, Number(threshold.value) / 100, true);
|
|
33032
33042
|
case "formula":
|
|
33033
33043
|
const value = threshold.value && this.getters.evaluateFormula(threshold.value);
|
|
33034
|
-
return
|
|
33044
|
+
return typeof value === "number" ? value : null;
|
|
33035
33045
|
default:
|
|
33036
33046
|
return null;
|
|
33037
33047
|
}
|
|
@@ -39110,7 +39120,7 @@ class Spreadsheet extends Component {
|
|
|
39110
39120
|
}
|
|
39111
39121
|
onKeydown(ev) {
|
|
39112
39122
|
let keyDownString = "";
|
|
39113
|
-
if (ev
|
|
39123
|
+
if (isCtrlKey(ev)) {
|
|
39114
39124
|
keyDownString += "CTRL+";
|
|
39115
39125
|
}
|
|
39116
39126
|
keyDownString += ev.key.toUpperCase();
|
|
@@ -43029,6 +43039,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
43029
43039
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
43030
43040
|
|
|
43031
43041
|
|
|
43032
|
-
__info__.version = '16.0.
|
|
43033
|
-
__info__.date = '
|
|
43034
|
-
__info__.hash = '
|
|
43042
|
+
__info__.version = '16.0.27';
|
|
43043
|
+
__info__.date = '2024-01-04T12:19:11.487Z';
|
|
43044
|
+
__info__.hash = '54006f6';
|