@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
|
@@ -318,7 +318,16 @@
|
|
|
318
318
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
319
319
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
320
320
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
321
|
+
const CACHE = {};
|
|
321
322
|
function parseDateTime(str) {
|
|
323
|
+
if (str in CACHE) {
|
|
324
|
+
return CACHE[str];
|
|
325
|
+
}
|
|
326
|
+
const date = _parseDateTime(str);
|
|
327
|
+
CACHE[str] = date;
|
|
328
|
+
return date;
|
|
329
|
+
}
|
|
330
|
+
function _parseDateTime(str) {
|
|
322
331
|
str = str.trim();
|
|
323
332
|
let time;
|
|
324
333
|
const timeMatch = str.match(timeRegexp);
|
|
@@ -1003,13 +1012,17 @@
|
|
|
1003
1012
|
return position === "after" ? base + 1 : base;
|
|
1004
1013
|
}
|
|
1005
1014
|
/**
|
|
1006
|
-
*
|
|
1015
|
+
* Compares two objects.
|
|
1007
1016
|
*/
|
|
1008
1017
|
function deepEquals(o1, o2) {
|
|
1009
1018
|
if (o1 === o2)
|
|
1010
1019
|
return true;
|
|
1011
1020
|
if ((o1 && !o2) || (o2 && !o1))
|
|
1012
1021
|
return false;
|
|
1022
|
+
if (typeof o1 !== typeof o2)
|
|
1023
|
+
return false;
|
|
1024
|
+
if (typeof o1 !== "object")
|
|
1025
|
+
return o1 === o2;
|
|
1013
1026
|
// Objects can have different keys if the values are undefined
|
|
1014
1027
|
const keys = new Set();
|
|
1015
1028
|
Object.keys(o1).forEach((key) => keys.add(key));
|
|
@@ -2118,8 +2131,9 @@
|
|
|
2118
2131
|
}
|
|
2119
2132
|
get zone() {
|
|
2120
2133
|
const { left, top, bottom, right } = this._zone;
|
|
2121
|
-
if (right !== undefined && bottom !== undefined)
|
|
2122
|
-
return
|
|
2134
|
+
if (right !== undefined && bottom !== undefined) {
|
|
2135
|
+
return this._zone;
|
|
2136
|
+
}
|
|
2123
2137
|
else if (bottom === undefined && right !== undefined) {
|
|
2124
2138
|
return { right, top, left, bottom: this.getSheetSize(this.sheetId).height - 1 };
|
|
2125
2139
|
}
|
|
@@ -3645,6 +3659,9 @@
|
|
|
3645
3659
|
CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
|
|
3646
3660
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
3647
3661
|
|
|
3662
|
+
function isMatrix(x) {
|
|
3663
|
+
return Array.isArray(x) && Array.isArray(x[0]);
|
|
3664
|
+
}
|
|
3648
3665
|
var DIRECTION;
|
|
3649
3666
|
(function (DIRECTION) {
|
|
3650
3667
|
DIRECTION["UP"] = "up";
|
|
@@ -14114,6 +14131,36 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
14114
14131
|
isExported: true,
|
|
14115
14132
|
};
|
|
14116
14133
|
// -----------------------------------------------------------------------------
|
|
14134
|
+
// INDEX
|
|
14135
|
+
// -----------------------------------------------------------------------------
|
|
14136
|
+
const INDEX = {
|
|
14137
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
14138
|
+
args: args(`
|
|
14139
|
+
reference (any, range) ${_lt("The range of cells from which the value is returned.")}
|
|
14140
|
+
row (number) ${_lt("The index of the row to be returned from within the reference range of cells.")}
|
|
14141
|
+
column (number) ${_lt("The index of the column to be returned from within the reference range of cells.")}
|
|
14142
|
+
`),
|
|
14143
|
+
returns: ["ANY"],
|
|
14144
|
+
computeFormat: (reference, row, column) => {
|
|
14145
|
+
var _a;
|
|
14146
|
+
const _row = toNumber(row.value);
|
|
14147
|
+
const _column = toNumber(column.value);
|
|
14148
|
+
return (_a = reference[_column - 1][_row - 1]) === null || _a === void 0 ? void 0 : _a.format;
|
|
14149
|
+
},
|
|
14150
|
+
compute: function (reference, row, column) {
|
|
14151
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
14152
|
+
const _row = toNumber(row);
|
|
14153
|
+
const _column = toNumber(column);
|
|
14154
|
+
assert(() => _column >= 0 &&
|
|
14155
|
+
_column - 1 < _reference.length &&
|
|
14156
|
+
_row >= 0 &&
|
|
14157
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
14158
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
14159
|
+
return _reference[_column - 1][_row - 1];
|
|
14160
|
+
},
|
|
14161
|
+
isExported: true,
|
|
14162
|
+
};
|
|
14163
|
+
// -----------------------------------------------------------------------------
|
|
14117
14164
|
// LOOKUP
|
|
14118
14165
|
// -----------------------------------------------------------------------------
|
|
14119
14166
|
const LOOKUP = {
|
|
@@ -14307,6 +14354,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
14307
14354
|
COLUMN: COLUMN,
|
|
14308
14355
|
COLUMNS: COLUMNS,
|
|
14309
14356
|
HLOOKUP: HLOOKUP,
|
|
14357
|
+
INDEX: INDEX,
|
|
14310
14358
|
LOOKUP: LOOKUP,
|
|
14311
14359
|
MATCH: MATCH,
|
|
14312
14360
|
ROW: ROW,
|
|
@@ -18284,6 +18332,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
18284
18332
|
padding: 10px;
|
|
18285
18333
|
width: ${ERROR_TOOLTIP_WIDTH}px;
|
|
18286
18334
|
box-sizing: border-box !important;
|
|
18335
|
+
overflow-wrap: break-word;
|
|
18287
18336
|
}
|
|
18288
18337
|
`;
|
|
18289
18338
|
class ErrorToolTip extends owl.Component {
|
|
@@ -18464,6 +18513,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
18464
18513
|
});
|
|
18465
18514
|
this.state.values = this.getFilterValues(this.props.filterPosition);
|
|
18466
18515
|
}
|
|
18516
|
+
get isReadonly() {
|
|
18517
|
+
return this.env.model.getters.isReadonly();
|
|
18518
|
+
}
|
|
18467
18519
|
getFilterValues(position) {
|
|
18468
18520
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
18469
18521
|
const filter = this.env.model.getters.getFilter({ sheetId, ...position });
|
|
@@ -21726,9 +21778,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21726
21778
|
}
|
|
21727
21779
|
setup() {
|
|
21728
21780
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
21729
|
-
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
21730
21781
|
owl.onMounted(() => this.focusInput());
|
|
21731
21782
|
owl.onWillUnmount(() => {
|
|
21783
|
+
clearTimeout(this.debounceTimeoutId);
|
|
21732
21784
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
21733
21785
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
21734
21786
|
});
|
|
@@ -21773,6 +21825,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21773
21825
|
searchOptions: this.state.searchOptions,
|
|
21774
21826
|
});
|
|
21775
21827
|
}
|
|
21828
|
+
debouncedUpdateSearch() {
|
|
21829
|
+
clearTimeout(this.debounceTimeoutId);
|
|
21830
|
+
this.debounceTimeoutId = setTimeout(() => {
|
|
21831
|
+
this.updateSearch();
|
|
21832
|
+
this.debounceTimeoutId = undefined;
|
|
21833
|
+
}, 200);
|
|
21834
|
+
}
|
|
21776
21835
|
replace() {
|
|
21777
21836
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
21778
21837
|
replaceWith: this.state.replaceWith,
|
|
@@ -22423,9 +22482,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
22423
22482
|
}
|
|
22424
22483
|
}
|
|
22425
22484
|
function updateMousePosition(e) {
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22485
|
+
if (gridRef.el === e.target) {
|
|
22486
|
+
x = e.offsetX;
|
|
22487
|
+
y = e.offsetY;
|
|
22488
|
+
lastMoved = Date.now();
|
|
22489
|
+
}
|
|
22429
22490
|
}
|
|
22430
22491
|
function recompute() {
|
|
22431
22492
|
const { col, row } = getPosition();
|
|
@@ -22708,7 +22769,14 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
22708
22769
|
return;
|
|
22709
22770
|
}
|
|
22710
22771
|
if (this.state.waitingForMove === true) {
|
|
22711
|
-
this.
|
|
22772
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
22773
|
+
this._selectElement(index, false);
|
|
22774
|
+
}
|
|
22775
|
+
else {
|
|
22776
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
22777
|
+
// a way to have the grid selection follow the other selections evolution
|
|
22778
|
+
this.startMovement(ev);
|
|
22779
|
+
}
|
|
22712
22780
|
return;
|
|
22713
22781
|
}
|
|
22714
22782
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -28542,10 +28610,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
28542
28610
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
28543
28611
|
*/
|
|
28544
28612
|
buildFormulaContent(sheetId, cell, dependencies) {
|
|
28545
|
-
const ranges = dependencies ||
|
|
28613
|
+
const ranges = dependencies || cell.dependencies;
|
|
28614
|
+
let rangeIndex = 0;
|
|
28546
28615
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
28547
28616
|
if (token.type === "REFERENCE") {
|
|
28548
|
-
const range = ranges
|
|
28617
|
+
const range = ranges[rangeIndex++];
|
|
28549
28618
|
return this.getters.getRangeString(range, sheetId);
|
|
28550
28619
|
}
|
|
28551
28620
|
return token.value;
|
|
@@ -32620,6 +32689,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32620
32689
|
// stores the computed styles in the format of computedStyles.sheetName[col][row] = Style
|
|
32621
32690
|
this.computedStyles = {};
|
|
32622
32691
|
this.computedIcons = {};
|
|
32692
|
+
this.uuidGenerator = new UuidGenerator();
|
|
32623
32693
|
/**
|
|
32624
32694
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
32625
32695
|
*/
|
|
@@ -32972,13 +33042,20 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32972
33042
|
this.adaptRules(origin.sheetId, cf, [xc], toRemoveRange);
|
|
32973
33043
|
}
|
|
32974
33044
|
else {
|
|
32975
|
-
this.adaptRules(target.sheetId, cf, [xc], []);
|
|
32976
33045
|
this.adaptRules(origin.sheetId, cf, [], toRemoveRange);
|
|
33046
|
+
const cfToCopyTo = this.getCFToCopyTo(target.sheetId, cf);
|
|
33047
|
+
this.adaptRules(target.sheetId, cfToCopyTo, [xc], []);
|
|
32977
33048
|
}
|
|
32978
33049
|
}
|
|
32979
33050
|
}
|
|
32980
33051
|
}
|
|
32981
33052
|
}
|
|
33053
|
+
getCFToCopyTo(targetSheetId, originCF) {
|
|
33054
|
+
const cfInTarget = this.getters
|
|
33055
|
+
.getConditionalFormats(targetSheetId)
|
|
33056
|
+
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
33057
|
+
return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
|
|
33058
|
+
}
|
|
32982
33059
|
}
|
|
32983
33060
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalIcon", "getCellComputedStyle"];
|
|
32984
33061
|
|
|
@@ -33326,30 +33403,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
33326
33403
|
const { end } = this.getters.getColDimensions(sheetId, targetCol);
|
|
33327
33404
|
const maxCol = this.getters.getNumberCols(sheetId);
|
|
33328
33405
|
if (this.offsetX + this.offsetCorrectionX + this.viewportWidth < end) {
|
|
33329
|
-
|
|
33330
|
-
|
|
33331
|
-
|
|
33332
|
-
}
|
|
33333
|
-
if (this.getters.isColHidden(sheetId, col)) {
|
|
33334
|
-
continue;
|
|
33335
|
-
}
|
|
33336
|
-
this.offsetX = this.getters.getColDimensions(sheetId, col).end - this.offsetCorrectionX;
|
|
33337
|
-
this.offsetScrollbarX = this.offsetX;
|
|
33338
|
-
this.adjustViewportZoneX();
|
|
33406
|
+
let finalTarget = targetCol;
|
|
33407
|
+
while (this.getters.isColHidden(sheetId, finalTarget) && targetCol < maxCol) {
|
|
33408
|
+
finalTarget++;
|
|
33339
33409
|
}
|
|
33410
|
+
const finalTargetEnd = this.getters.getColDimensions(sheetId, finalTarget).end;
|
|
33411
|
+
const startIndex = this.searchHeaderIndex("COL", finalTargetEnd - this.viewportWidth - this.offsetCorrectionX, this.boundaries.left, true);
|
|
33412
|
+
this.offsetX =
|
|
33413
|
+
this.getters.getColDimensions(sheetId, startIndex).end - this.offsetCorrectionX;
|
|
33414
|
+
this.offsetScrollbarX = this.offsetX;
|
|
33415
|
+
this.adjustViewportZoneX();
|
|
33340
33416
|
}
|
|
33341
33417
|
else if (this.left > targetCol) {
|
|
33342
|
-
|
|
33343
|
-
|
|
33344
|
-
|
|
33345
|
-
}
|
|
33346
|
-
if (this.getters.isColHidden(sheetId, col)) {
|
|
33347
|
-
continue;
|
|
33348
|
-
}
|
|
33349
|
-
this.offsetX = this.getters.getColDimensions(sheetId, col).start - this.offsetCorrectionX;
|
|
33350
|
-
this.offsetScrollbarX = this.offsetX;
|
|
33351
|
-
this.adjustViewportZoneX();
|
|
33418
|
+
let finalTarget = targetCol;
|
|
33419
|
+
while (this.getters.isColHidden(sheetId, finalTarget) && targetCol > 0) {
|
|
33420
|
+
finalTarget--;
|
|
33352
33421
|
}
|
|
33422
|
+
this.offsetX =
|
|
33423
|
+
this.getters.getColDimensions(sheetId, finalTarget).start - this.offsetCorrectionX;
|
|
33424
|
+
this.offsetScrollbarX = this.offsetX;
|
|
33425
|
+
this.adjustViewportZoneX();
|
|
33353
33426
|
}
|
|
33354
33427
|
}
|
|
33355
33428
|
adjustPositionY(targetRow) {
|
|
@@ -33357,30 +33430,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
33357
33430
|
const { end } = this.getters.getRowDimensions(sheetId, targetRow);
|
|
33358
33431
|
const maxRow = this.getters.getNumberRows(sheetId);
|
|
33359
33432
|
if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) {
|
|
33360
|
-
|
|
33361
|
-
|
|
33362
|
-
|
|
33363
|
-
}
|
|
33364
|
-
if (this.getters.isRowHidden(sheetId, row)) {
|
|
33365
|
-
continue;
|
|
33366
|
-
}
|
|
33367
|
-
this.offsetY = this.getters.getRowDimensions(sheetId, row).end - this.offsetCorrectionY;
|
|
33368
|
-
this.offsetScrollbarY = this.offsetY;
|
|
33369
|
-
this.adjustViewportZoneY();
|
|
33433
|
+
let finalTarget = targetRow;
|
|
33434
|
+
while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow < maxRow) {
|
|
33435
|
+
finalTarget++;
|
|
33370
33436
|
}
|
|
33437
|
+
const finalTargetEnd = this.getters.getRowDimensions(sheetId, finalTarget).end;
|
|
33438
|
+
const startIndex = this.searchHeaderIndex("ROW", finalTargetEnd - this.viewportHeight - this.offsetCorrectionY, this.boundaries.top, true);
|
|
33439
|
+
this.offsetY =
|
|
33440
|
+
this.getters.getRowDimensions(sheetId, startIndex).end - this.offsetCorrectionY;
|
|
33441
|
+
this.offsetScrollbarY = this.offsetY;
|
|
33442
|
+
this.adjustViewportZoneY();
|
|
33371
33443
|
}
|
|
33372
33444
|
else if (this.top > targetRow) {
|
|
33373
|
-
|
|
33374
|
-
|
|
33375
|
-
|
|
33376
|
-
}
|
|
33377
|
-
if (this.getters.isRowHidden(sheetId, row)) {
|
|
33378
|
-
continue;
|
|
33379
|
-
}
|
|
33380
|
-
this.offsetY = this.getters.getRowDimensions(sheetId, row).start - this.offsetCorrectionY;
|
|
33381
|
-
this.offsetScrollbarY = this.offsetY;
|
|
33382
|
-
this.adjustViewportZoneY();
|
|
33445
|
+
let finalTarget = targetRow;
|
|
33446
|
+
while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow > 0) {
|
|
33447
|
+
finalTarget--;
|
|
33383
33448
|
}
|
|
33449
|
+
this.offsetY =
|
|
33450
|
+
this.getters.getRowDimensions(sheetId, finalTarget).start - this.offsetCorrectionY;
|
|
33451
|
+
this.offsetScrollbarY = this.offsetY;
|
|
33452
|
+
this.adjustViewportZoneY();
|
|
33384
33453
|
}
|
|
33385
33454
|
}
|
|
33386
33455
|
setViewportOffset(offsetX, offsetY) {
|
|
@@ -34954,14 +35023,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
34954
35023
|
case "REPLACE_ALL_SEARCH":
|
|
34955
35024
|
this.replaceAll(cmd.replaceWith);
|
|
34956
35025
|
break;
|
|
34957
|
-
case "EVALUATE_CELLS":
|
|
34958
|
-
case "UPDATE_CELL":
|
|
34959
|
-
case "REMOVE_FILTER_TABLE":
|
|
34960
|
-
case "UPDATE_FILTER":
|
|
34961
|
-
this.isSearchDirty = true;
|
|
34962
|
-
break;
|
|
34963
35026
|
case "UNDO":
|
|
34964
35027
|
case "REDO":
|
|
35028
|
+
case "REMOVE_FILTER_TABLE":
|
|
35029
|
+
case "UPDATE_FILTER":
|
|
34965
35030
|
case "REMOVE_COLUMNS_ROWS":
|
|
34966
35031
|
case "HIDE_COLUMNS_ROWS":
|
|
34967
35032
|
case "UNHIDE_COLUMNS_ROWS":
|
|
@@ -37953,7 +38018,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
37953
38018
|
});
|
|
37954
38019
|
for (const filterTable of this.copiedTables) {
|
|
37955
38020
|
this.dispatch("REMOVE_FILTER_TABLE", {
|
|
37956
|
-
sheetId: this.
|
|
38021
|
+
sheetId: this.sheetId,
|
|
37957
38022
|
target: [filterTable.zone],
|
|
37958
38023
|
});
|
|
37959
38024
|
}
|
|
@@ -38431,7 +38496,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
38431
38496
|
allowDispatch(cmd) {
|
|
38432
38497
|
switch (cmd.type) {
|
|
38433
38498
|
case "CUT":
|
|
38434
|
-
const zones =
|
|
38499
|
+
const zones = this.getters.getSelectedZones();
|
|
38435
38500
|
const state = this.getClipboardState(zones, cmd.type);
|
|
38436
38501
|
return state.isCutAllowed(zones);
|
|
38437
38502
|
case "PASTE":
|
|
@@ -38462,7 +38527,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
38462
38527
|
switch (cmd.type) {
|
|
38463
38528
|
case "COPY":
|
|
38464
38529
|
case "CUT":
|
|
38465
|
-
const zones =
|
|
38530
|
+
const zones = this.getters.getSelectedZones();
|
|
38466
38531
|
this.state = this.getClipboardState(zones, cmd.type);
|
|
38467
38532
|
this.status = "visible";
|
|
38468
38533
|
break;
|
|
@@ -38893,6 +38958,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
38893
38958
|
// ---------------------------------------------------------------------------
|
|
38894
38959
|
// Getters
|
|
38895
38960
|
// ---------------------------------------------------------------------------
|
|
38961
|
+
isGridSelectionActive() {
|
|
38962
|
+
return this.selection.isListening(this);
|
|
38963
|
+
}
|
|
38896
38964
|
getActiveSheet() {
|
|
38897
38965
|
return this.activeSheet;
|
|
38898
38966
|
}
|
|
@@ -39123,26 +39191,24 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
39123
39191
|
const isBasedBefore = cmd.base < start;
|
|
39124
39192
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
39125
39193
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
39126
|
-
|
|
39127
|
-
|
|
39128
|
-
|
|
39129
|
-
|
|
39130
|
-
|
|
39131
|
-
|
|
39132
|
-
|
|
39133
|
-
|
|
39134
|
-
|
|
39135
|
-
|
|
39136
|
-
|
|
39137
|
-
|
|
39138
|
-
|
|
39139
|
-
|
|
39140
|
-
|
|
39141
|
-
|
|
39142
|
-
|
|
39143
|
-
|
|
39144
|
-
],
|
|
39145
|
-
});
|
|
39194
|
+
const target = [
|
|
39195
|
+
{
|
|
39196
|
+
left: isCol ? start + deltaCol : 0,
|
|
39197
|
+
right: isCol ? end + deltaCol : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39198
|
+
top: !isCol ? start + deltaRow : 0,
|
|
39199
|
+
bottom: !isCol ? end + deltaRow : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39200
|
+
},
|
|
39201
|
+
];
|
|
39202
|
+
const state = new ClipboardCellsState(target, "CUT", this.getters, this.dispatch, this.selection);
|
|
39203
|
+
const pasteTarget = [
|
|
39204
|
+
{
|
|
39205
|
+
left: isCol ? cmd.base : 0,
|
|
39206
|
+
right: isCol ? cmd.base + thickness - 1 : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39207
|
+
top: !isCol ? cmd.base : 0,
|
|
39208
|
+
bottom: !isCol ? cmd.base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39209
|
+
},
|
|
39210
|
+
];
|
|
39211
|
+
state.paste(pasteTarget, { selectTarget: true });
|
|
39146
39212
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
39147
39213
|
let currentIndex = cmd.base;
|
|
39148
39214
|
for (const element of toRemove) {
|
|
@@ -39269,6 +39335,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
39269
39335
|
"getSheetPosition",
|
|
39270
39336
|
"isSelected",
|
|
39271
39337
|
"getElementsFromSelection",
|
|
39338
|
+
"isGridSelectionActive",
|
|
39272
39339
|
];
|
|
39273
39340
|
|
|
39274
39341
|
const corePluginRegistry = new Registry()
|
|
@@ -42061,6 +42128,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
42061
42128
|
anchor: { zone, cell: this.anchor.cell },
|
|
42062
42129
|
});
|
|
42063
42130
|
}
|
|
42131
|
+
isListening(owner) {
|
|
42132
|
+
return this.stream.isListening(owner);
|
|
42133
|
+
}
|
|
42064
42134
|
/**
|
|
42065
42135
|
* Process a new anchor selection event. If the new anchor is inside
|
|
42066
42136
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -44349,9 +44419,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
44349
44419
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
44350
44420
|
|
|
44351
44421
|
|
|
44352
|
-
__info__.version = '16.1.
|
|
44353
|
-
__info__.date = '2023-
|
|
44354
|
-
__info__.hash = '
|
|
44422
|
+
__info__.version = '16.1.23';
|
|
44423
|
+
__info__.date = '2023-10-10T07:27:03.376Z';
|
|
44424
|
+
__info__.hash = '13bfa8f';
|
|
44355
44425
|
|
|
44356
44426
|
|
|
44357
44427
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|