@odoo/o-spreadsheet 16.1.20 → 16.1.23
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 +153 -83
- package/dist/o-spreadsheet.d.ts +7 -4
- package/dist/o-spreadsheet.esm.js +153 -83
- package/dist/o-spreadsheet.iife.js +153 -83
- package/dist/o-spreadsheet.iife.min.js +217 -216
- package/package.json +2 -2
|
@@ -321,7 +321,16 @@ const DATE_JS_1900_OFFSET = INITIAL_JS_DAY - INITIAL_1900_DAY;
|
|
|
321
321
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
322
322
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
323
323
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
324
|
+
const CACHE = {};
|
|
324
325
|
function parseDateTime(str) {
|
|
326
|
+
if (str in CACHE) {
|
|
327
|
+
return CACHE[str];
|
|
328
|
+
}
|
|
329
|
+
const date = _parseDateTime(str);
|
|
330
|
+
CACHE[str] = date;
|
|
331
|
+
return date;
|
|
332
|
+
}
|
|
333
|
+
function _parseDateTime(str) {
|
|
325
334
|
str = str.trim();
|
|
326
335
|
let time;
|
|
327
336
|
const timeMatch = str.match(timeRegexp);
|
|
@@ -1006,13 +1015,17 @@ function getAddHeaderStartIndex(position, base) {
|
|
|
1006
1015
|
return position === "after" ? base + 1 : base;
|
|
1007
1016
|
}
|
|
1008
1017
|
/**
|
|
1009
|
-
*
|
|
1018
|
+
* Compares two objects.
|
|
1010
1019
|
*/
|
|
1011
1020
|
function deepEquals(o1, o2) {
|
|
1012
1021
|
if (o1 === o2)
|
|
1013
1022
|
return true;
|
|
1014
1023
|
if ((o1 && !o2) || (o2 && !o1))
|
|
1015
1024
|
return false;
|
|
1025
|
+
if (typeof o1 !== typeof o2)
|
|
1026
|
+
return false;
|
|
1027
|
+
if (typeof o1 !== "object")
|
|
1028
|
+
return o1 === o2;
|
|
1016
1029
|
// Objects can have different keys if the values are undefined
|
|
1017
1030
|
const keys = new Set();
|
|
1018
1031
|
Object.keys(o1).forEach((key) => keys.add(key));
|
|
@@ -2121,8 +2134,9 @@ class RangeImpl {
|
|
|
2121
2134
|
}
|
|
2122
2135
|
get zone() {
|
|
2123
2136
|
const { left, top, bottom, right } = this._zone;
|
|
2124
|
-
if (right !== undefined && bottom !== undefined)
|
|
2125
|
-
return
|
|
2137
|
+
if (right !== undefined && bottom !== undefined) {
|
|
2138
|
+
return this._zone;
|
|
2139
|
+
}
|
|
2126
2140
|
else if (bottom === undefined && right !== undefined) {
|
|
2127
2141
|
return { right, top, left, bottom: this.getSheetSize(this.sheetId).height - 1 };
|
|
2128
2142
|
}
|
|
@@ -3648,6 +3662,9 @@ exports.CommandResult = void 0;
|
|
|
3648
3662
|
CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
|
|
3649
3663
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
3650
3664
|
|
|
3665
|
+
function isMatrix(x) {
|
|
3666
|
+
return Array.isArray(x) && Array.isArray(x[0]);
|
|
3667
|
+
}
|
|
3651
3668
|
var DIRECTION;
|
|
3652
3669
|
(function (DIRECTION) {
|
|
3653
3670
|
DIRECTION["UP"] = "up";
|
|
@@ -14117,6 +14134,36 @@ const HLOOKUP = {
|
|
|
14117
14134
|
isExported: true,
|
|
14118
14135
|
};
|
|
14119
14136
|
// -----------------------------------------------------------------------------
|
|
14137
|
+
// INDEX
|
|
14138
|
+
// -----------------------------------------------------------------------------
|
|
14139
|
+
const INDEX = {
|
|
14140
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
14141
|
+
args: args(`
|
|
14142
|
+
reference (any, range) ${_lt("The range of cells from which the value is returned.")}
|
|
14143
|
+
row (number) ${_lt("The index of the row to be returned from within the reference range of cells.")}
|
|
14144
|
+
column (number) ${_lt("The index of the column to be returned from within the reference range of cells.")}
|
|
14145
|
+
`),
|
|
14146
|
+
returns: ["ANY"],
|
|
14147
|
+
computeFormat: (reference, row, column) => {
|
|
14148
|
+
var _a;
|
|
14149
|
+
const _row = toNumber(row.value);
|
|
14150
|
+
const _column = toNumber(column.value);
|
|
14151
|
+
return (_a = reference[_column - 1][_row - 1]) === null || _a === void 0 ? void 0 : _a.format;
|
|
14152
|
+
},
|
|
14153
|
+
compute: function (reference, row, column) {
|
|
14154
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
14155
|
+
const _row = toNumber(row);
|
|
14156
|
+
const _column = toNumber(column);
|
|
14157
|
+
assert(() => _column >= 0 &&
|
|
14158
|
+
_column - 1 < _reference.length &&
|
|
14159
|
+
_row >= 0 &&
|
|
14160
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
14161
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
14162
|
+
return _reference[_column - 1][_row - 1];
|
|
14163
|
+
},
|
|
14164
|
+
isExported: true,
|
|
14165
|
+
};
|
|
14166
|
+
// -----------------------------------------------------------------------------
|
|
14120
14167
|
// LOOKUP
|
|
14121
14168
|
// -----------------------------------------------------------------------------
|
|
14122
14169
|
const LOOKUP = {
|
|
@@ -14310,6 +14357,7 @@ var lookup = /*#__PURE__*/Object.freeze({
|
|
|
14310
14357
|
COLUMN: COLUMN,
|
|
14311
14358
|
COLUMNS: COLUMNS,
|
|
14312
14359
|
HLOOKUP: HLOOKUP,
|
|
14360
|
+
INDEX: INDEX,
|
|
14313
14361
|
LOOKUP: LOOKUP,
|
|
14314
14362
|
MATCH: MATCH,
|
|
14315
14363
|
ROW: ROW,
|
|
@@ -18287,6 +18335,7 @@ css /* scss */ `
|
|
|
18287
18335
|
padding: 10px;
|
|
18288
18336
|
width: ${ERROR_TOOLTIP_WIDTH}px;
|
|
18289
18337
|
box-sizing: border-box !important;
|
|
18338
|
+
overflow-wrap: break-word;
|
|
18290
18339
|
}
|
|
18291
18340
|
`;
|
|
18292
18341
|
class ErrorToolTip extends owl.Component {
|
|
@@ -18467,6 +18516,9 @@ class FilterMenu extends owl.Component {
|
|
|
18467
18516
|
});
|
|
18468
18517
|
this.state.values = this.getFilterValues(this.props.filterPosition);
|
|
18469
18518
|
}
|
|
18519
|
+
get isReadonly() {
|
|
18520
|
+
return this.env.model.getters.isReadonly();
|
|
18521
|
+
}
|
|
18470
18522
|
getFilterValues(position) {
|
|
18471
18523
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
18472
18524
|
const filter = this.env.model.getters.getFilter({ sheetId, ...position });
|
|
@@ -21729,9 +21781,9 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
21729
21781
|
}
|
|
21730
21782
|
setup() {
|
|
21731
21783
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
21732
|
-
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
21733
21784
|
owl.onMounted(() => this.focusInput());
|
|
21734
21785
|
owl.onWillUnmount(() => {
|
|
21786
|
+
clearTimeout(this.debounceTimeoutId);
|
|
21735
21787
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
21736
21788
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
21737
21789
|
});
|
|
@@ -21776,6 +21828,13 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
21776
21828
|
searchOptions: this.state.searchOptions,
|
|
21777
21829
|
});
|
|
21778
21830
|
}
|
|
21831
|
+
debouncedUpdateSearch() {
|
|
21832
|
+
clearTimeout(this.debounceTimeoutId);
|
|
21833
|
+
this.debounceTimeoutId = setTimeout(() => {
|
|
21834
|
+
this.updateSearch();
|
|
21835
|
+
this.debounceTimeoutId = undefined;
|
|
21836
|
+
}, 200);
|
|
21837
|
+
}
|
|
21779
21838
|
replace() {
|
|
21780
21839
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
21781
21840
|
replaceWith: this.state.replaceWith,
|
|
@@ -22426,9 +22485,11 @@ function useCellHovered(env, gridRef, callback) {
|
|
|
22426
22485
|
}
|
|
22427
22486
|
}
|
|
22428
22487
|
function updateMousePosition(e) {
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22488
|
+
if (gridRef.el === e.target) {
|
|
22489
|
+
x = e.offsetX;
|
|
22490
|
+
y = e.offsetY;
|
|
22491
|
+
lastMoved = Date.now();
|
|
22492
|
+
}
|
|
22432
22493
|
}
|
|
22433
22494
|
function recompute() {
|
|
22434
22495
|
const { col, row } = getPosition();
|
|
@@ -22711,7 +22772,14 @@ class AbstractResizer extends owl.Component {
|
|
|
22711
22772
|
return;
|
|
22712
22773
|
}
|
|
22713
22774
|
if (this.state.waitingForMove === true) {
|
|
22714
|
-
this.
|
|
22775
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
22776
|
+
this._selectElement(index, false);
|
|
22777
|
+
}
|
|
22778
|
+
else {
|
|
22779
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
22780
|
+
// a way to have the grid selection follow the other selections evolution
|
|
22781
|
+
this.startMovement(ev);
|
|
22782
|
+
}
|
|
22715
22783
|
return;
|
|
22716
22784
|
}
|
|
22717
22785
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -28545,10 +28613,11 @@ class CellPlugin extends CorePlugin {
|
|
|
28545
28613
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
28546
28614
|
*/
|
|
28547
28615
|
buildFormulaContent(sheetId, cell, dependencies) {
|
|
28548
|
-
const ranges = dependencies ||
|
|
28616
|
+
const ranges = dependencies || cell.dependencies;
|
|
28617
|
+
let rangeIndex = 0;
|
|
28549
28618
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
28550
28619
|
if (token.type === "REFERENCE") {
|
|
28551
|
-
const range = ranges
|
|
28620
|
+
const range = ranges[rangeIndex++];
|
|
28552
28621
|
return this.getters.getRangeString(range, sheetId);
|
|
28553
28622
|
}
|
|
28554
28623
|
return token.value;
|
|
@@ -32623,6 +32692,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
32623
32692
|
// stores the computed styles in the format of computedStyles.sheetName[col][row] = Style
|
|
32624
32693
|
this.computedStyles = {};
|
|
32625
32694
|
this.computedIcons = {};
|
|
32695
|
+
this.uuidGenerator = new UuidGenerator();
|
|
32626
32696
|
/**
|
|
32627
32697
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
32628
32698
|
*/
|
|
@@ -32975,13 +33045,20 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
32975
33045
|
this.adaptRules(origin.sheetId, cf, [xc], toRemoveRange);
|
|
32976
33046
|
}
|
|
32977
33047
|
else {
|
|
32978
|
-
this.adaptRules(target.sheetId, cf, [xc], []);
|
|
32979
33048
|
this.adaptRules(origin.sheetId, cf, [], toRemoveRange);
|
|
33049
|
+
const cfToCopyTo = this.getCFToCopyTo(target.sheetId, cf);
|
|
33050
|
+
this.adaptRules(target.sheetId, cfToCopyTo, [xc], []);
|
|
32980
33051
|
}
|
|
32981
33052
|
}
|
|
32982
33053
|
}
|
|
32983
33054
|
}
|
|
32984
33055
|
}
|
|
33056
|
+
getCFToCopyTo(targetSheetId, originCF) {
|
|
33057
|
+
const cfInTarget = this.getters
|
|
33058
|
+
.getConditionalFormats(targetSheetId)
|
|
33059
|
+
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
33060
|
+
return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
|
|
33061
|
+
}
|
|
32985
33062
|
}
|
|
32986
33063
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalIcon", "getCellComputedStyle"];
|
|
32987
33064
|
|
|
@@ -33329,30 +33406,26 @@ class InternalViewport {
|
|
|
33329
33406
|
const { end } = this.getters.getColDimensions(sheetId, targetCol);
|
|
33330
33407
|
const maxCol = this.getters.getNumberCols(sheetId);
|
|
33331
33408
|
if (this.offsetX + this.offsetCorrectionX + this.viewportWidth < end) {
|
|
33332
|
-
|
|
33333
|
-
|
|
33334
|
-
|
|
33335
|
-
}
|
|
33336
|
-
if (this.getters.isColHidden(sheetId, col)) {
|
|
33337
|
-
continue;
|
|
33338
|
-
}
|
|
33339
|
-
this.offsetX = this.getters.getColDimensions(sheetId, col).end - this.offsetCorrectionX;
|
|
33340
|
-
this.offsetScrollbarX = this.offsetX;
|
|
33341
|
-
this.adjustViewportZoneX();
|
|
33409
|
+
let finalTarget = targetCol;
|
|
33410
|
+
while (this.getters.isColHidden(sheetId, finalTarget) && targetCol < maxCol) {
|
|
33411
|
+
finalTarget++;
|
|
33342
33412
|
}
|
|
33413
|
+
const finalTargetEnd = this.getters.getColDimensions(sheetId, finalTarget).end;
|
|
33414
|
+
const startIndex = this.searchHeaderIndex("COL", finalTargetEnd - this.viewportWidth - this.offsetCorrectionX, this.boundaries.left, true);
|
|
33415
|
+
this.offsetX =
|
|
33416
|
+
this.getters.getColDimensions(sheetId, startIndex).end - this.offsetCorrectionX;
|
|
33417
|
+
this.offsetScrollbarX = this.offsetX;
|
|
33418
|
+
this.adjustViewportZoneX();
|
|
33343
33419
|
}
|
|
33344
33420
|
else if (this.left > targetCol) {
|
|
33345
|
-
|
|
33346
|
-
|
|
33347
|
-
|
|
33348
|
-
}
|
|
33349
|
-
if (this.getters.isColHidden(sheetId, col)) {
|
|
33350
|
-
continue;
|
|
33351
|
-
}
|
|
33352
|
-
this.offsetX = this.getters.getColDimensions(sheetId, col).start - this.offsetCorrectionX;
|
|
33353
|
-
this.offsetScrollbarX = this.offsetX;
|
|
33354
|
-
this.adjustViewportZoneX();
|
|
33421
|
+
let finalTarget = targetCol;
|
|
33422
|
+
while (this.getters.isColHidden(sheetId, finalTarget) && targetCol > 0) {
|
|
33423
|
+
finalTarget--;
|
|
33355
33424
|
}
|
|
33425
|
+
this.offsetX =
|
|
33426
|
+
this.getters.getColDimensions(sheetId, finalTarget).start - this.offsetCorrectionX;
|
|
33427
|
+
this.offsetScrollbarX = this.offsetX;
|
|
33428
|
+
this.adjustViewportZoneX();
|
|
33356
33429
|
}
|
|
33357
33430
|
}
|
|
33358
33431
|
adjustPositionY(targetRow) {
|
|
@@ -33360,30 +33433,26 @@ class InternalViewport {
|
|
|
33360
33433
|
const { end } = this.getters.getRowDimensions(sheetId, targetRow);
|
|
33361
33434
|
const maxRow = this.getters.getNumberRows(sheetId);
|
|
33362
33435
|
if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) {
|
|
33363
|
-
|
|
33364
|
-
|
|
33365
|
-
|
|
33366
|
-
}
|
|
33367
|
-
if (this.getters.isRowHidden(sheetId, row)) {
|
|
33368
|
-
continue;
|
|
33369
|
-
}
|
|
33370
|
-
this.offsetY = this.getters.getRowDimensions(sheetId, row).end - this.offsetCorrectionY;
|
|
33371
|
-
this.offsetScrollbarY = this.offsetY;
|
|
33372
|
-
this.adjustViewportZoneY();
|
|
33436
|
+
let finalTarget = targetRow;
|
|
33437
|
+
while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow < maxRow) {
|
|
33438
|
+
finalTarget++;
|
|
33373
33439
|
}
|
|
33440
|
+
const finalTargetEnd = this.getters.getRowDimensions(sheetId, finalTarget).end;
|
|
33441
|
+
const startIndex = this.searchHeaderIndex("ROW", finalTargetEnd - this.viewportHeight - this.offsetCorrectionY, this.boundaries.top, true);
|
|
33442
|
+
this.offsetY =
|
|
33443
|
+
this.getters.getRowDimensions(sheetId, startIndex).end - this.offsetCorrectionY;
|
|
33444
|
+
this.offsetScrollbarY = this.offsetY;
|
|
33445
|
+
this.adjustViewportZoneY();
|
|
33374
33446
|
}
|
|
33375
33447
|
else if (this.top > targetRow) {
|
|
33376
|
-
|
|
33377
|
-
|
|
33378
|
-
|
|
33379
|
-
}
|
|
33380
|
-
if (this.getters.isRowHidden(sheetId, row)) {
|
|
33381
|
-
continue;
|
|
33382
|
-
}
|
|
33383
|
-
this.offsetY = this.getters.getRowDimensions(sheetId, row).start - this.offsetCorrectionY;
|
|
33384
|
-
this.offsetScrollbarY = this.offsetY;
|
|
33385
|
-
this.adjustViewportZoneY();
|
|
33448
|
+
let finalTarget = targetRow;
|
|
33449
|
+
while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow > 0) {
|
|
33450
|
+
finalTarget--;
|
|
33386
33451
|
}
|
|
33452
|
+
this.offsetY =
|
|
33453
|
+
this.getters.getRowDimensions(sheetId, finalTarget).start - this.offsetCorrectionY;
|
|
33454
|
+
this.offsetScrollbarY = this.offsetY;
|
|
33455
|
+
this.adjustViewportZoneY();
|
|
33387
33456
|
}
|
|
33388
33457
|
}
|
|
33389
33458
|
setViewportOffset(offsetX, offsetY) {
|
|
@@ -34957,14 +35026,10 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
34957
35026
|
case "REPLACE_ALL_SEARCH":
|
|
34958
35027
|
this.replaceAll(cmd.replaceWith);
|
|
34959
35028
|
break;
|
|
34960
|
-
case "EVALUATE_CELLS":
|
|
34961
|
-
case "UPDATE_CELL":
|
|
34962
|
-
case "REMOVE_FILTER_TABLE":
|
|
34963
|
-
case "UPDATE_FILTER":
|
|
34964
|
-
this.isSearchDirty = true;
|
|
34965
|
-
break;
|
|
34966
35029
|
case "UNDO":
|
|
34967
35030
|
case "REDO":
|
|
35031
|
+
case "REMOVE_FILTER_TABLE":
|
|
35032
|
+
case "UPDATE_FILTER":
|
|
34968
35033
|
case "REMOVE_COLUMNS_ROWS":
|
|
34969
35034
|
case "HIDE_COLUMNS_ROWS":
|
|
34970
35035
|
case "UNHIDE_COLUMNS_ROWS":
|
|
@@ -37956,7 +38021,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
37956
38021
|
});
|
|
37957
38022
|
for (const filterTable of this.copiedTables) {
|
|
37958
38023
|
this.dispatch("REMOVE_FILTER_TABLE", {
|
|
37959
|
-
sheetId: this.
|
|
38024
|
+
sheetId: this.sheetId,
|
|
37960
38025
|
target: [filterTable.zone],
|
|
37961
38026
|
});
|
|
37962
38027
|
}
|
|
@@ -38434,7 +38499,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
38434
38499
|
allowDispatch(cmd) {
|
|
38435
38500
|
switch (cmd.type) {
|
|
38436
38501
|
case "CUT":
|
|
38437
|
-
const zones =
|
|
38502
|
+
const zones = this.getters.getSelectedZones();
|
|
38438
38503
|
const state = this.getClipboardState(zones, cmd.type);
|
|
38439
38504
|
return state.isCutAllowed(zones);
|
|
38440
38505
|
case "PASTE":
|
|
@@ -38465,7 +38530,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
38465
38530
|
switch (cmd.type) {
|
|
38466
38531
|
case "COPY":
|
|
38467
38532
|
case "CUT":
|
|
38468
|
-
const zones =
|
|
38533
|
+
const zones = this.getters.getSelectedZones();
|
|
38469
38534
|
this.state = this.getClipboardState(zones, cmd.type);
|
|
38470
38535
|
this.status = "visible";
|
|
38471
38536
|
break;
|
|
@@ -38896,6 +38961,9 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
38896
38961
|
// ---------------------------------------------------------------------------
|
|
38897
38962
|
// Getters
|
|
38898
38963
|
// ---------------------------------------------------------------------------
|
|
38964
|
+
isGridSelectionActive() {
|
|
38965
|
+
return this.selection.isListening(this);
|
|
38966
|
+
}
|
|
38899
38967
|
getActiveSheet() {
|
|
38900
38968
|
return this.activeSheet;
|
|
38901
38969
|
}
|
|
@@ -39126,26 +39194,24 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
39126
39194
|
const isBasedBefore = cmd.base < start;
|
|
39127
39195
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
39128
39196
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
39129
|
-
|
|
39130
|
-
|
|
39131
|
-
|
|
39132
|
-
|
|
39133
|
-
|
|
39134
|
-
|
|
39135
|
-
|
|
39136
|
-
|
|
39137
|
-
|
|
39138
|
-
|
|
39139
|
-
|
|
39140
|
-
|
|
39141
|
-
|
|
39142
|
-
|
|
39143
|
-
|
|
39144
|
-
|
|
39145
|
-
|
|
39146
|
-
|
|
39147
|
-
],
|
|
39148
|
-
});
|
|
39197
|
+
const target = [
|
|
39198
|
+
{
|
|
39199
|
+
left: isCol ? start + deltaCol : 0,
|
|
39200
|
+
right: isCol ? end + deltaCol : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39201
|
+
top: !isCol ? start + deltaRow : 0,
|
|
39202
|
+
bottom: !isCol ? end + deltaRow : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39203
|
+
},
|
|
39204
|
+
];
|
|
39205
|
+
const state = new ClipboardCellsState(target, "CUT", this.getters, this.dispatch, this.selection);
|
|
39206
|
+
const pasteTarget = [
|
|
39207
|
+
{
|
|
39208
|
+
left: isCol ? cmd.base : 0,
|
|
39209
|
+
right: isCol ? cmd.base + thickness - 1 : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39210
|
+
top: !isCol ? cmd.base : 0,
|
|
39211
|
+
bottom: !isCol ? cmd.base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39212
|
+
},
|
|
39213
|
+
];
|
|
39214
|
+
state.paste(pasteTarget, { selectTarget: true });
|
|
39149
39215
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
39150
39216
|
let currentIndex = cmd.base;
|
|
39151
39217
|
for (const element of toRemove) {
|
|
@@ -39272,6 +39338,7 @@ GridSelectionPlugin.getters = [
|
|
|
39272
39338
|
"getSheetPosition",
|
|
39273
39339
|
"isSelected",
|
|
39274
39340
|
"getElementsFromSelection",
|
|
39341
|
+
"isGridSelectionActive",
|
|
39275
39342
|
];
|
|
39276
39343
|
|
|
39277
39344
|
const corePluginRegistry = new Registry()
|
|
@@ -42064,6 +42131,9 @@ class SelectionStreamProcessor {
|
|
|
42064
42131
|
anchor: { zone, cell: this.anchor.cell },
|
|
42065
42132
|
});
|
|
42066
42133
|
}
|
|
42134
|
+
isListening(owner) {
|
|
42135
|
+
return this.stream.isListening(owner);
|
|
42136
|
+
}
|
|
42067
42137
|
/**
|
|
42068
42138
|
* Process a new anchor selection event. If the new anchor is inside
|
|
42069
42139
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -44350,6 +44420,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
44350
44420
|
exports.tokenize = tokenize;
|
|
44351
44421
|
|
|
44352
44422
|
|
|
44353
|
-
__info__.version = '16.1.
|
|
44354
|
-
__info__.date = '2023-
|
|
44355
|
-
__info__.hash = '
|
|
44423
|
+
__info__.version = '16.1.23';
|
|
44424
|
+
__info__.date = '2023-10-10T07:27:03.376Z';
|
|
44425
|
+
__info__.hash = '13bfa8f';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -245,7 +245,7 @@ declare class RangeImpl implements Range {
|
|
|
245
245
|
constructor(args: ConstructorArgs, getSheetSize: (sheetId: UID) => ZoneDimension);
|
|
246
246
|
static fromRange(range: Range, getters: CoreGetters): RangeImpl;
|
|
247
247
|
get unboundedZone(): UnboundedZone;
|
|
248
|
-
get zone(): Zone
|
|
248
|
+
get zone(): Readonly<Zone>;
|
|
249
249
|
static getRangeParts(xc: string, zone: UnboundedZone): RangePart[];
|
|
250
250
|
get isFullCol(): boolean;
|
|
251
251
|
get isFullRow(): boolean;
|
|
@@ -340,6 +340,7 @@ interface SelectionProcessor {
|
|
|
340
340
|
selectAll(): DispatchResult;
|
|
341
341
|
loopSelection(): DispatchResult;
|
|
342
342
|
selectTableAroundSelection(): DispatchResult;
|
|
343
|
+
isListening(owner: unknown): boolean;
|
|
343
344
|
}
|
|
344
345
|
/**
|
|
345
346
|
* Processes all selection updates (usually from user inputs) and emits an event
|
|
@@ -412,6 +413,7 @@ declare class SelectionStreamProcessor implements SelectionProcessor, StatefulSt
|
|
|
412
413
|
* Select the entire sheet
|
|
413
414
|
*/
|
|
414
415
|
selectAll(): DispatchResult;
|
|
416
|
+
isListening(owner: unknown): boolean;
|
|
415
417
|
/**
|
|
416
418
|
* Process a new anchor selection event. If the new anchor is inside
|
|
417
419
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -1800,8 +1802,6 @@ interface CopyCommand {
|
|
|
1800
1802
|
}
|
|
1801
1803
|
interface CutCommand {
|
|
1802
1804
|
type: "CUT";
|
|
1803
|
-
/** Zones to cut. If none were given, will copy the zones in the selection*/
|
|
1804
|
-
target?: Zone[];
|
|
1805
1805
|
}
|
|
1806
1806
|
interface PasteCommand {
|
|
1807
1807
|
type: "PASTE";
|
|
@@ -3854,6 +3854,7 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
3854
3854
|
private isStale;
|
|
3855
3855
|
private computedStyles;
|
|
3856
3856
|
private computedIcons;
|
|
3857
|
+
private uuidGenerator;
|
|
3857
3858
|
handle(cmd: Command): void;
|
|
3858
3859
|
finalize(): void;
|
|
3859
3860
|
getCellComputedStyle(position: CellPosition): Style;
|
|
@@ -3884,6 +3885,7 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
3884
3885
|
*/
|
|
3885
3886
|
private adaptRules;
|
|
3886
3887
|
private pasteCf;
|
|
3888
|
+
private getCFToCopyTo;
|
|
3887
3889
|
}
|
|
3888
3890
|
|
|
3889
3891
|
declare class FilterEvaluationPlugin extends UIPlugin {
|
|
@@ -4660,7 +4662,7 @@ declare class ClipboardPlugin extends UIPlugin {
|
|
|
4660
4662
|
*/
|
|
4661
4663
|
declare class GridSelectionPlugin extends UIPlugin {
|
|
4662
4664
|
static layers: LAYERS[];
|
|
4663
|
-
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "getElementsFromSelection"];
|
|
4665
|
+
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "getElementsFromSelection", "isGridSelectionActive"];
|
|
4664
4666
|
private gridSelection;
|
|
4665
4667
|
private selectedFigureId;
|
|
4666
4668
|
private sheetsData;
|
|
@@ -4670,6 +4672,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4670
4672
|
allowDispatch(cmd: Command): CommandResult;
|
|
4671
4673
|
private handleEvent;
|
|
4672
4674
|
handle(cmd: Command): void;
|
|
4675
|
+
isGridSelectionActive(): boolean;
|
|
4673
4676
|
getActiveSheet(): Readonly<Sheet>;
|
|
4674
4677
|
getActiveSheetId(): UID;
|
|
4675
4678
|
getActiveCell(): EvaluatedCell;
|