@odoo/o-spreadsheet 16.2.23 → 16.2.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.
- package/dist/o-spreadsheet.cjs.js +112 -83
- package/dist/o-spreadsheet.d.ts +11 -9
- package/dist/o-spreadsheet.esm.js +112 -83
- package/dist/o-spreadsheet.iife.js +112 -83
- package/dist/o-spreadsheet.iife.min.js +243 -243
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -1362,8 +1362,10 @@ function isSameColor(color1, color2) {
|
|
|
1362
1362
|
const cellReference = new RegExp(/\$?([A-Z]{1,3})\$?([0-9]{1,7})/, "i");
|
|
1363
1363
|
// Same as above, but matches the exact string (nothing before or after)
|
|
1364
1364
|
const singleCellReference = new RegExp(/^\$?([A-Z]{1,3})\$?([0-9]{1,7})$/, "i");
|
|
1365
|
-
/** Reference of a column header (eg. A, AB) */
|
|
1366
|
-
const colHeader = new RegExp(
|
|
1365
|
+
/** Reference of a column header (eg. A, AB, $A) */
|
|
1366
|
+
const colHeader = new RegExp(/^\$?([A-Z]{1,3})+$/, "i");
|
|
1367
|
+
/** Reference of a row header (eg. 1, $1) */
|
|
1368
|
+
const rowHeader = new RegExp(/^\$?([0-9]{1,7})+$/, "i");
|
|
1367
1369
|
/** Reference of a column (eg. A, $CA, Sheet1!B) */
|
|
1368
1370
|
const colReference = new RegExp(/^\s*('.+'!|[^']+!)?\$?([A-Z]{1,3})$/, "i");
|
|
1369
1371
|
/** Reference of a row (eg. 1, 59, Sheet1!9) */
|
|
@@ -1393,6 +1395,9 @@ function isRowReference(xc) {
|
|
|
1393
1395
|
function isColHeader(str) {
|
|
1394
1396
|
return colHeader.test(str);
|
|
1395
1397
|
}
|
|
1398
|
+
function isRowHeader(str) {
|
|
1399
|
+
return rowHeader.test(str);
|
|
1400
|
+
}
|
|
1396
1401
|
/**
|
|
1397
1402
|
* Return true if the given xc is the reference of a single cell,
|
|
1398
1403
|
* without any specified sheet (e.g. A1)
|
|
@@ -2182,18 +2187,10 @@ class RangeImpl {
|
|
|
2182
2187
|
if (isFullCol) {
|
|
2183
2188
|
parts[0].rowFixed = parts[0].rowFixed || parts[1].rowFixed;
|
|
2184
2189
|
parts[1].rowFixed = parts[0].rowFixed || parts[1].rowFixed;
|
|
2185
|
-
if (zone.left === zone.right) {
|
|
2186
|
-
parts[0].colFixed = parts[0].colFixed || parts[1].colFixed;
|
|
2187
|
-
parts[1].colFixed = parts[0].colFixed || parts[1].colFixed;
|
|
2188
|
-
}
|
|
2189
2190
|
}
|
|
2190
2191
|
if (isFullRow) {
|
|
2191
2192
|
parts[0].colFixed = parts[0].colFixed || parts[1].colFixed;
|
|
2192
2193
|
parts[1].colFixed = parts[0].colFixed || parts[1].colFixed;
|
|
2193
|
-
if (zone.top === zone.bottom) {
|
|
2194
|
-
parts[0].rowFixed = parts[0].rowFixed || parts[1].rowFixed;
|
|
2195
|
-
parts[1].rowFixed = parts[0].rowFixed || parts[1].rowFixed;
|
|
2196
|
-
}
|
|
2197
2194
|
}
|
|
2198
2195
|
return parts;
|
|
2199
2196
|
}
|
|
@@ -5047,6 +5044,7 @@ const FilterMenuPopoverBuilder = {
|
|
|
5047
5044
|
},
|
|
5048
5045
|
};
|
|
5049
5046
|
|
|
5047
|
+
const macRegex = /Mac/i;
|
|
5050
5048
|
/**
|
|
5051
5049
|
* Return true if the event was triggered from
|
|
5052
5050
|
* a child element.
|
|
@@ -5092,6 +5090,17 @@ function setElementScrollTop(el, scroll) {
|
|
|
5092
5090
|
}
|
|
5093
5091
|
function getOpenedMenus() {
|
|
5094
5092
|
return Array.from(document.querySelectorAll(".o-spreadsheet .o-menu"));
|
|
5093
|
+
}
|
|
5094
|
+
function isMacOS() {
|
|
5095
|
+
return Boolean(macRegex.test(navigator.userAgent));
|
|
5096
|
+
}
|
|
5097
|
+
/**
|
|
5098
|
+
* @param {KeyboardEvent | MouseEvent} ev
|
|
5099
|
+
* @returns Returns true if the event was triggered with the "ctrl" modifier pressed.
|
|
5100
|
+
* On Mac, this is the "meta" or "command" key.
|
|
5101
|
+
*/
|
|
5102
|
+
function isCtrlKey(ev) {
|
|
5103
|
+
return isMacOS() ? ev.metaKey : ev.ctrlKey;
|
|
5095
5104
|
}
|
|
5096
5105
|
|
|
5097
5106
|
/**
|
|
@@ -16709,10 +16718,10 @@ const arrowMap = {
|
|
|
16709
16718
|
function updateSelectionWithArrowKeys(ev, selection) {
|
|
16710
16719
|
const direction = arrowMap[ev.key];
|
|
16711
16720
|
if (ev.shiftKey) {
|
|
16712
|
-
selection.resizeAnchorZone(direction, ev
|
|
16721
|
+
selection.resizeAnchorZone(direction, isCtrlKey(ev) ? "end" : 1);
|
|
16713
16722
|
}
|
|
16714
16723
|
else {
|
|
16715
|
-
selection.moveAnchorCell(direction, ev
|
|
16724
|
+
selection.moveAnchorCell(direction, isCtrlKey(ev) ? "end" : 1);
|
|
16716
16725
|
}
|
|
16717
16726
|
}
|
|
16718
16727
|
|
|
@@ -21047,7 +21056,10 @@ class GridOverlay extends Component {
|
|
|
21047
21056
|
return;
|
|
21048
21057
|
}
|
|
21049
21058
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
21050
|
-
this.props.onCellClicked(col, row, {
|
|
21059
|
+
this.props.onCellClicked(col, row, {
|
|
21060
|
+
expandZone: ev.shiftKey,
|
|
21061
|
+
addZone: isCtrlKey(ev),
|
|
21062
|
+
});
|
|
21051
21063
|
}
|
|
21052
21064
|
onDoubleClick(ev) {
|
|
21053
21065
|
const [col, row] = this.getCartesianCoordinates(ev);
|
|
@@ -21135,6 +21147,7 @@ class AbstractResizer extends Component {
|
|
|
21135
21147
|
draggerShadowThickness: 0,
|
|
21136
21148
|
delta: 0,
|
|
21137
21149
|
base: 0,
|
|
21150
|
+
position: "before",
|
|
21138
21151
|
});
|
|
21139
21152
|
}
|
|
21140
21153
|
_computeHandleDisplay(ev) {
|
|
@@ -21260,11 +21273,13 @@ class AbstractResizer extends Component {
|
|
|
21260
21273
|
this.state.draggerLinePosition = dimensions.start;
|
|
21261
21274
|
this.state.draggerShadowPosition = dimensions.start;
|
|
21262
21275
|
this.state.base = elementIndex;
|
|
21276
|
+
this.state.position = "before";
|
|
21263
21277
|
}
|
|
21264
21278
|
else if (this._getSelectedZoneEnd() < elementIndex) {
|
|
21265
21279
|
this.state.draggerLinePosition = dimensions.end;
|
|
21266
21280
|
this.state.draggerShadowPosition = dimensions.end - this.state.draggerShadowThickness;
|
|
21267
|
-
this.state.base = elementIndex
|
|
21281
|
+
this.state.base = elementIndex;
|
|
21282
|
+
this.state.position = "after";
|
|
21268
21283
|
}
|
|
21269
21284
|
else {
|
|
21270
21285
|
this.state.draggerLinePosition = startDimensions.start;
|
|
@@ -21288,7 +21303,7 @@ class AbstractResizer extends Component {
|
|
|
21288
21303
|
this._increaseSelection(index);
|
|
21289
21304
|
}
|
|
21290
21305
|
else {
|
|
21291
|
-
this._selectElement(index, ev
|
|
21306
|
+
this._selectElement(index, isCtrlKey(ev));
|
|
21292
21307
|
}
|
|
21293
21308
|
this.lastSelectedElementIndex = index;
|
|
21294
21309
|
const mouseMoveSelect = (col, row) => {
|
|
@@ -21301,7 +21316,7 @@ class AbstractResizer extends Component {
|
|
|
21301
21316
|
const mouseUpSelect = () => {
|
|
21302
21317
|
this.state.isSelecting = false;
|
|
21303
21318
|
this.lastSelectedElementIndex = null;
|
|
21304
|
-
this.env.model.dispatch(ev
|
|
21319
|
+
this.env.model.dispatch(isCtrlKey(ev) ? "PREPARE_SELECTION_INPUT_EXPANSION" : "STOP_SELECTION_INPUT");
|
|
21305
21320
|
this._computeGrabDisplay(ev);
|
|
21306
21321
|
};
|
|
21307
21322
|
dragAndDropBeyondTheViewport(this.env, mouseMoveSelect, mouseUpSelect);
|
|
@@ -21445,13 +21460,14 @@ class ColResizer extends AbstractResizer {
|
|
|
21445
21460
|
dimension: "COL",
|
|
21446
21461
|
base: this.state.base,
|
|
21447
21462
|
elements,
|
|
21463
|
+
position: this.state.position,
|
|
21448
21464
|
});
|
|
21449
21465
|
if (!result.isSuccessful && result.reasons.includes(2 /* CommandResult.WillRemoveExistingMerge */)) {
|
|
21450
21466
|
this.env.raiseError(MergeErrorMessage);
|
|
21451
21467
|
}
|
|
21452
21468
|
}
|
|
21453
|
-
_selectElement(index,
|
|
21454
|
-
this.env.model.selection.selectColumn(index,
|
|
21469
|
+
_selectElement(index, addDistinctHeader) {
|
|
21470
|
+
this.env.model.selection.selectColumn(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
21455
21471
|
}
|
|
21456
21472
|
_increaseSelection(index) {
|
|
21457
21473
|
this.env.model.selection.selectColumn(index, "updateAnchor");
|
|
@@ -21617,13 +21633,14 @@ class RowResizer extends AbstractResizer {
|
|
|
21617
21633
|
dimension: "ROW",
|
|
21618
21634
|
base: this.state.base,
|
|
21619
21635
|
elements,
|
|
21636
|
+
position: this.state.position,
|
|
21620
21637
|
});
|
|
21621
21638
|
if (!result.isSuccessful && result.reasons.includes(2 /* CommandResult.WillRemoveExistingMerge */)) {
|
|
21622
21639
|
this.env.raiseError(MergeErrorMessage);
|
|
21623
21640
|
}
|
|
21624
21641
|
}
|
|
21625
|
-
_selectElement(index,
|
|
21626
|
-
this.env.model.selection.selectRow(index,
|
|
21642
|
+
_selectElement(index, addDistinctHeader) {
|
|
21643
|
+
this.env.model.selection.selectRow(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
21627
21644
|
}
|
|
21628
21645
|
_increaseSelection(index) {
|
|
21629
21646
|
this.env.model.selection.selectRow(index, "updateAnchor");
|
|
@@ -21725,8 +21742,8 @@ function useWheelHandler(handler) {
|
|
|
21725
21742
|
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
21726
21743
|
}
|
|
21727
21744
|
const onMouseWheel = (ev) => {
|
|
21728
|
-
const deltaX = normalize(ev.shiftKey ? ev.deltaY : ev.deltaX, ev.deltaMode);
|
|
21729
|
-
const deltaY = normalize(ev.shiftKey ? ev.deltaX : ev.deltaY, ev.deltaMode);
|
|
21745
|
+
const deltaX = normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode);
|
|
21746
|
+
const deltaY = normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode);
|
|
21730
21747
|
handler(deltaX, deltaY);
|
|
21731
21748
|
};
|
|
21732
21749
|
return onMouseWheel;
|
|
@@ -22370,8 +22387,8 @@ class Grid extends Component {
|
|
|
22370
22387
|
// ---------------------------------------------------------------------------
|
|
22371
22388
|
// Zone selection with mouse
|
|
22372
22389
|
// ---------------------------------------------------------------------------
|
|
22373
|
-
onCellClicked(col, row, {
|
|
22374
|
-
if (
|
|
22390
|
+
onCellClicked(col, row, { addZone, expandZone }) {
|
|
22391
|
+
if (addZone) {
|
|
22375
22392
|
this.env.model.dispatch("PREPARE_SELECTION_INPUT_EXPANSION");
|
|
22376
22393
|
}
|
|
22377
22394
|
if (this.env.model.getters.hasOpenedPopover()) {
|
|
@@ -22380,10 +22397,10 @@ class Grid extends Component {
|
|
|
22380
22397
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
22381
22398
|
this.env.model.dispatch("STOP_EDITION");
|
|
22382
22399
|
}
|
|
22383
|
-
if (
|
|
22400
|
+
if (expandZone) {
|
|
22384
22401
|
this.env.model.selection.setAnchorCorner(col, row);
|
|
22385
22402
|
}
|
|
22386
|
-
else if (
|
|
22403
|
+
else if (addZone) {
|
|
22387
22404
|
this.env.model.selection.addCellToSelection(col, row);
|
|
22388
22405
|
}
|
|
22389
22406
|
else {
|
|
@@ -22445,9 +22462,7 @@ class Grid extends Component {
|
|
|
22445
22462
|
return;
|
|
22446
22463
|
}
|
|
22447
22464
|
let keyDownString = "";
|
|
22448
|
-
if (ev
|
|
22449
|
-
keyDownString += "CTRL+";
|
|
22450
|
-
if (ev.metaKey)
|
|
22465
|
+
if (isCtrlKey(ev))
|
|
22451
22466
|
keyDownString += "CTRL+";
|
|
22452
22467
|
if (ev.altKey)
|
|
22453
22468
|
keyDownString += "ALT+";
|
|
@@ -24314,7 +24329,7 @@ const machine = {
|
|
|
24314
24329
|
SPACE: goTo(State.RightRef),
|
|
24315
24330
|
NUMBER: goTo(State.Found),
|
|
24316
24331
|
REFERENCE: goTo(State.Found, (token) => isSingleCellReference(token.value)),
|
|
24317
|
-
SYMBOL: goTo(State.Found, (token) => isColHeader(token.value)),
|
|
24332
|
+
SYMBOL: goTo(State.Found, (token) => isColHeader(token.value) || isRowHeader(token.value)),
|
|
24318
24333
|
},
|
|
24319
24334
|
[State.RightColumnRef]: {
|
|
24320
24335
|
SPACE: goTo(State.RightColumnRef),
|
|
@@ -24325,6 +24340,7 @@ const machine = {
|
|
|
24325
24340
|
SPACE: goTo(State.RightRowRef),
|
|
24326
24341
|
NUMBER: goTo(State.Found),
|
|
24327
24342
|
REFERENCE: goTo(State.Found, (token) => isSingleCellReference(token.value)),
|
|
24343
|
+
SYMBOL: goTo(State.Found, (token) => isRowHeader(token.value)),
|
|
24328
24344
|
},
|
|
24329
24345
|
[State.Found]: {},
|
|
24330
24346
|
};
|
|
@@ -30927,7 +30943,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30927
30943
|
const elements = cmd.dimension === "COL"
|
|
30928
30944
|
? this.getNumberCols(cmd.sheetId)
|
|
30929
30945
|
: this.getNumberRows(cmd.sheetId);
|
|
30930
|
-
if (cmd.base < 0 || cmd.base
|
|
30946
|
+
if (cmd.base < 0 || cmd.base >= elements) {
|
|
30931
30947
|
return 86 /* CommandResult.InvalidHeaderIndex */;
|
|
30932
30948
|
}
|
|
30933
30949
|
else if (cmd.quantity <= 0) {
|
|
@@ -31964,13 +31980,18 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
31964
31980
|
// Getters
|
|
31965
31981
|
// ---------------------------------------------------------------------------
|
|
31966
31982
|
evaluateFormula(formulaString, sheetId = this.getters.getActiveSheetId()) {
|
|
31967
|
-
|
|
31968
|
-
|
|
31969
|
-
|
|
31970
|
-
|
|
31971
|
-
|
|
31983
|
+
try {
|
|
31984
|
+
const compiledFormula = compile(formulaString);
|
|
31985
|
+
const params = this.getCompilationParameters((cell) => this.getEvaluatedCell(this.getters.getCellPosition(cell.id)));
|
|
31986
|
+
const ranges = [];
|
|
31987
|
+
for (let xc of compiledFormula.dependencies) {
|
|
31988
|
+
ranges.push(this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
31989
|
+
}
|
|
31990
|
+
return compiledFormula.execute(ranges, ...params).value;
|
|
31991
|
+
}
|
|
31992
|
+
catch (error) {
|
|
31993
|
+
return error instanceof EvaluationError ? error.errorType : CellErrorType.GenericError;
|
|
31972
31994
|
}
|
|
31973
|
-
return compiledFormula.execute(ranges, ...params).value;
|
|
31974
31995
|
}
|
|
31975
31996
|
/**
|
|
31976
31997
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
@@ -32472,39 +32493,34 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
32472
32493
|
this.computedIcons[sheetId] = {};
|
|
32473
32494
|
const computedStyle = this.computedStyles[sheetId];
|
|
32474
32495
|
for (let cf of this.getters.getConditionalFormats(sheetId).reverse()) {
|
|
32475
|
-
|
|
32476
|
-
|
|
32477
|
-
|
|
32478
|
-
|
|
32479
|
-
|
|
32480
|
-
|
|
32481
|
-
|
|
32482
|
-
|
|
32483
|
-
|
|
32484
|
-
|
|
32485
|
-
|
|
32486
|
-
|
|
32487
|
-
|
|
32488
|
-
|
|
32489
|
-
|
|
32490
|
-
for (let
|
|
32491
|
-
|
|
32492
|
-
|
|
32493
|
-
|
|
32494
|
-
if (
|
|
32495
|
-
|
|
32496
|
-
|
|
32497
|
-
|
|
32498
|
-
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
32499
|
-
}
|
|
32496
|
+
switch (cf.rule.type) {
|
|
32497
|
+
case "ColorScaleRule":
|
|
32498
|
+
for (let range of cf.ranges) {
|
|
32499
|
+
this.applyColorScale(range, cf.rule);
|
|
32500
|
+
}
|
|
32501
|
+
break;
|
|
32502
|
+
case "IconSetRule":
|
|
32503
|
+
for (let range of cf.ranges) {
|
|
32504
|
+
this.applyIcon(range, cf.rule);
|
|
32505
|
+
}
|
|
32506
|
+
break;
|
|
32507
|
+
default:
|
|
32508
|
+
for (let ref of cf.ranges) {
|
|
32509
|
+
const zone = this.getters.getRangeFromSheetXC(sheetId, ref).zone;
|
|
32510
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
32511
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
32512
|
+
const pr = this.rulePredicate[cf.rule.type];
|
|
32513
|
+
let cell = this.getters.getEvaluatedCell({ sheetId, col, row });
|
|
32514
|
+
if (pr && pr(cell, cf.rule)) {
|
|
32515
|
+
if (!computedStyle[col])
|
|
32516
|
+
computedStyle[col] = [];
|
|
32517
|
+
// we must combine all the properties of all the CF rules applied to the given cell
|
|
32518
|
+
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
32500
32519
|
}
|
|
32501
32520
|
}
|
|
32502
32521
|
}
|
|
32503
|
-
|
|
32504
|
-
|
|
32505
|
-
}
|
|
32506
|
-
catch (_) {
|
|
32507
|
-
// we don't care about the errors within the evaluation of a rule
|
|
32522
|
+
}
|
|
32523
|
+
break;
|
|
32508
32524
|
}
|
|
32509
32525
|
}
|
|
32510
32526
|
}
|
|
@@ -32529,7 +32545,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
32529
32545
|
return percentile(rangeValues, Number(threshold.value) / 100, true);
|
|
32530
32546
|
case "formula":
|
|
32531
32547
|
const value = threshold.value && this.getters.evaluateFormula(threshold.value);
|
|
32532
|
-
return
|
|
32548
|
+
return typeof value === "number" ? value : null;
|
|
32533
32549
|
default:
|
|
32534
32550
|
return null;
|
|
32535
32551
|
}
|
|
@@ -34092,24 +34108,27 @@ class AutofillPlugin extends UIPlugin {
|
|
|
34092
34108
|
* autofiller
|
|
34093
34109
|
*/
|
|
34094
34110
|
autofillAuto() {
|
|
34111
|
+
var _a, _b;
|
|
34095
34112
|
const zone = this.getters.getSelectedZone();
|
|
34096
34113
|
const sheetId = this.getters.getActiveSheetId();
|
|
34097
34114
|
let col = zone.left;
|
|
34098
34115
|
let row = zone.bottom;
|
|
34099
34116
|
if (col > 0) {
|
|
34100
|
-
let
|
|
34101
|
-
while (
|
|
34117
|
+
let leftPosition = { sheetId, col: col - 1, row };
|
|
34118
|
+
while (this.getters.getEvaluatedCell(leftPosition).type !== CellValueType.empty ||
|
|
34119
|
+
((_a = this.getters.getCell(leftPosition)) === null || _a === void 0 ? void 0 : _a.content)) {
|
|
34102
34120
|
row += 1;
|
|
34103
|
-
|
|
34121
|
+
leftPosition = { sheetId, col: col - 1, row };
|
|
34104
34122
|
}
|
|
34105
34123
|
}
|
|
34106
34124
|
if (row === zone.bottom) {
|
|
34107
34125
|
col = zone.right;
|
|
34108
34126
|
if (col <= this.getters.getNumberCols(sheetId)) {
|
|
34109
|
-
let
|
|
34110
|
-
while (
|
|
34127
|
+
let rightPosition = { sheetId, col: col + 1, row };
|
|
34128
|
+
while (this.getters.getEvaluatedCell(rightPosition).type !== CellValueType.empty ||
|
|
34129
|
+
((_b = this.getters.getCell(rightPosition)) === null || _b === void 0 ? void 0 : _b.content)) {
|
|
34111
34130
|
row += 1;
|
|
34112
|
-
|
|
34131
|
+
rightPosition = { sheetId, col: col + 1, row };
|
|
34113
34132
|
}
|
|
34114
34133
|
}
|
|
34115
34134
|
}
|
|
@@ -38427,6 +38446,10 @@ function setXcToReferenceType(xc, referenceType) {
|
|
|
38427
38446
|
return xc.slice(0, indexOfNumber) + "$" + xc.slice(indexOfNumber);
|
|
38428
38447
|
case "colrow":
|
|
38429
38448
|
indexOfNumber = xc.search(/[0-9]/);
|
|
38449
|
+
if (indexOfNumber === -1 || indexOfNumber === 0) {
|
|
38450
|
+
// no row number (eg. A) or no column (eg. 1)
|
|
38451
|
+
return "$" + xc;
|
|
38452
|
+
}
|
|
38430
38453
|
xc = xc.slice(0, indexOfNumber) + "$" + xc.slice(indexOfNumber);
|
|
38431
38454
|
return "$" + xc;
|
|
38432
38455
|
case "none":
|
|
@@ -39568,7 +39591,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
39568
39591
|
sheetId: cmd.sheetId,
|
|
39569
39592
|
base: cmd.base,
|
|
39570
39593
|
quantity: thickness,
|
|
39571
|
-
position:
|
|
39594
|
+
position: cmd.position,
|
|
39572
39595
|
});
|
|
39573
39596
|
const isCol = cmd.dimension === "COL";
|
|
39574
39597
|
const start = cmd.elements[0];
|
|
@@ -39585,12 +39608,13 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
39585
39608
|
},
|
|
39586
39609
|
];
|
|
39587
39610
|
const state = new ClipboardCellsState(target, "CUT", this.getters, this.dispatch, this.selection);
|
|
39611
|
+
const base = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
39588
39612
|
const pasteTarget = [
|
|
39589
39613
|
{
|
|
39590
|
-
left: isCol ?
|
|
39591
|
-
right: isCol ?
|
|
39592
|
-
top: !isCol ?
|
|
39593
|
-
bottom: !isCol ?
|
|
39614
|
+
left: isCol ? base : 0,
|
|
39615
|
+
right: isCol ? base + thickness - 1 : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39616
|
+
top: !isCol ? base : 0,
|
|
39617
|
+
bottom: !isCol ? base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39594
39618
|
},
|
|
39595
39619
|
];
|
|
39596
39620
|
state.paste(pasteTarget, { selectTarget: true });
|
|
@@ -39627,6 +39651,11 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
39627
39651
|
doesElementsHaveCommonMerges(id, cmd.base - 1, cmd.base)) {
|
|
39628
39652
|
return 2 /* CommandResult.WillRemoveExistingMerge */;
|
|
39629
39653
|
}
|
|
39654
|
+
const headers = [cmd.base, ...cmd.elements];
|
|
39655
|
+
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
39656
|
+
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
39657
|
+
return 86 /* CommandResult.InvalidHeaderIndex */;
|
|
39658
|
+
}
|
|
39630
39659
|
return 0 /* CommandResult.Success */;
|
|
39631
39660
|
}
|
|
39632
39661
|
//-------------------------------------------
|
|
@@ -41864,7 +41893,7 @@ class Spreadsheet extends Component {
|
|
|
41864
41893
|
}
|
|
41865
41894
|
onKeydown(ev) {
|
|
41866
41895
|
let keyDownString = "";
|
|
41867
|
-
if (ev
|
|
41896
|
+
if (isCtrlKey(ev)) {
|
|
41868
41897
|
keyDownString += "CTRL+";
|
|
41869
41898
|
}
|
|
41870
41899
|
keyDownString += ev.key.toUpperCase();
|
|
@@ -45540,6 +45569,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
45540
45569
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, 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, setTranslationMethod, tokenize };
|
|
45541
45570
|
|
|
45542
45571
|
|
|
45543
|
-
__info__.version = '16.2.
|
|
45544
|
-
__info__.date = '
|
|
45545
|
-
__info__.hash = '
|
|
45572
|
+
__info__.version = '16.2.26';
|
|
45573
|
+
__info__.date = '2024-01-04T16:19:52.806Z';
|
|
45574
|
+
__info__.hash = 'ef51232';
|