@odoo/o-spreadsheet 16.1.20 → 16.1.24
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 +162 -85
- package/dist/o-spreadsheet.d.ts +7 -4
- package/dist/o-spreadsheet.esm.js +162 -85
- package/dist/o-spreadsheet.iife.js +162 -85
- 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") {
|
|
@@ -26008,12 +26076,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
26008
26076
|
};
|
|
26009
26077
|
}
|
|
26010
26078
|
function xmlEscape(str) {
|
|
26011
|
-
return String(str)
|
|
26079
|
+
return (String(str)
|
|
26012
26080
|
.replace(/\&/g, "&")
|
|
26013
26081
|
.replace(/\</g, "<")
|
|
26014
26082
|
.replace(/\>/g, ">")
|
|
26015
26083
|
.replace(/\"/g, """)
|
|
26016
|
-
.replace(/\'/g, "'")
|
|
26084
|
+
.replace(/\'/g, "'")
|
|
26085
|
+
// Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
|
|
26086
|
+
// They are not valid at all in XML 1.0 (even escaped)
|
|
26087
|
+
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
|
|
26017
26088
|
}
|
|
26018
26089
|
function formatAttributes(attrs) {
|
|
26019
26090
|
return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
|
|
@@ -28542,10 +28613,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
28542
28613
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
28543
28614
|
*/
|
|
28544
28615
|
buildFormulaContent(sheetId, cell, dependencies) {
|
|
28545
|
-
const ranges = dependencies ||
|
|
28616
|
+
const ranges = dependencies || cell.dependencies;
|
|
28617
|
+
let rangeIndex = 0;
|
|
28546
28618
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
28547
28619
|
if (token.type === "REFERENCE") {
|
|
28548
|
-
const range = ranges
|
|
28620
|
+
const range = ranges[rangeIndex++];
|
|
28549
28621
|
return this.getters.getRangeString(range, sheetId);
|
|
28550
28622
|
}
|
|
28551
28623
|
return token.value;
|
|
@@ -32620,6 +32692,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32620
32692
|
// stores the computed styles in the format of computedStyles.sheetName[col][row] = Style
|
|
32621
32693
|
this.computedStyles = {};
|
|
32622
32694
|
this.computedIcons = {};
|
|
32695
|
+
this.uuidGenerator = new UuidGenerator();
|
|
32623
32696
|
/**
|
|
32624
32697
|
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
32625
32698
|
*/
|
|
@@ -32947,6 +33020,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32947
33020
|
}
|
|
32948
33021
|
currentRanges = currentRanges.concat(toAdd);
|
|
32949
33022
|
const newRangesXC = recomputeZones(currentRanges, toRemove);
|
|
33023
|
+
if (newRangesXC.length === 0) {
|
|
33024
|
+
this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
|
|
33025
|
+
return;
|
|
33026
|
+
}
|
|
32950
33027
|
this.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
32951
33028
|
cf: {
|
|
32952
33029
|
id: cf.id,
|
|
@@ -32972,13 +33049,20 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
32972
33049
|
this.adaptRules(origin.sheetId, cf, [xc], toRemoveRange);
|
|
32973
33050
|
}
|
|
32974
33051
|
else {
|
|
32975
|
-
this.adaptRules(target.sheetId, cf, [xc], []);
|
|
32976
33052
|
this.adaptRules(origin.sheetId, cf, [], toRemoveRange);
|
|
33053
|
+
const cfToCopyTo = this.getCFToCopyTo(target.sheetId, cf);
|
|
33054
|
+
this.adaptRules(target.sheetId, cfToCopyTo, [xc], []);
|
|
32977
33055
|
}
|
|
32978
33056
|
}
|
|
32979
33057
|
}
|
|
32980
33058
|
}
|
|
32981
33059
|
}
|
|
33060
|
+
getCFToCopyTo(targetSheetId, originCF) {
|
|
33061
|
+
const cfInTarget = this.getters
|
|
33062
|
+
.getConditionalFormats(targetSheetId)
|
|
33063
|
+
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
33064
|
+
return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
|
|
33065
|
+
}
|
|
32982
33066
|
}
|
|
32983
33067
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalIcon", "getCellComputedStyle"];
|
|
32984
33068
|
|
|
@@ -33326,30 +33410,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
33326
33410
|
const { end } = this.getters.getColDimensions(sheetId, targetCol);
|
|
33327
33411
|
const maxCol = this.getters.getNumberCols(sheetId);
|
|
33328
33412
|
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();
|
|
33413
|
+
let finalTarget = targetCol;
|
|
33414
|
+
while (this.getters.isColHidden(sheetId, finalTarget) && targetCol < maxCol) {
|
|
33415
|
+
finalTarget++;
|
|
33339
33416
|
}
|
|
33417
|
+
const finalTargetEnd = this.getters.getColDimensions(sheetId, finalTarget).end;
|
|
33418
|
+
const startIndex = this.searchHeaderIndex("COL", finalTargetEnd - this.viewportWidth - this.offsetCorrectionX, this.boundaries.left, true);
|
|
33419
|
+
this.offsetX =
|
|
33420
|
+
this.getters.getColDimensions(sheetId, startIndex).end - this.offsetCorrectionX;
|
|
33421
|
+
this.offsetScrollbarX = this.offsetX;
|
|
33422
|
+
this.adjustViewportZoneX();
|
|
33340
33423
|
}
|
|
33341
33424
|
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();
|
|
33425
|
+
let finalTarget = targetCol;
|
|
33426
|
+
while (this.getters.isColHidden(sheetId, finalTarget) && targetCol > 0) {
|
|
33427
|
+
finalTarget--;
|
|
33352
33428
|
}
|
|
33429
|
+
this.offsetX =
|
|
33430
|
+
this.getters.getColDimensions(sheetId, finalTarget).start - this.offsetCorrectionX;
|
|
33431
|
+
this.offsetScrollbarX = this.offsetX;
|
|
33432
|
+
this.adjustViewportZoneX();
|
|
33353
33433
|
}
|
|
33354
33434
|
}
|
|
33355
33435
|
adjustPositionY(targetRow) {
|
|
@@ -33357,30 +33437,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
33357
33437
|
const { end } = this.getters.getRowDimensions(sheetId, targetRow);
|
|
33358
33438
|
const maxRow = this.getters.getNumberRows(sheetId);
|
|
33359
33439
|
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();
|
|
33440
|
+
let finalTarget = targetRow;
|
|
33441
|
+
while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow < maxRow) {
|
|
33442
|
+
finalTarget++;
|
|
33370
33443
|
}
|
|
33444
|
+
const finalTargetEnd = this.getters.getRowDimensions(sheetId, finalTarget).end;
|
|
33445
|
+
const startIndex = this.searchHeaderIndex("ROW", finalTargetEnd - this.viewportHeight - this.offsetCorrectionY, this.boundaries.top, true);
|
|
33446
|
+
this.offsetY =
|
|
33447
|
+
this.getters.getRowDimensions(sheetId, startIndex).end - this.offsetCorrectionY;
|
|
33448
|
+
this.offsetScrollbarY = this.offsetY;
|
|
33449
|
+
this.adjustViewportZoneY();
|
|
33371
33450
|
}
|
|
33372
33451
|
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();
|
|
33452
|
+
let finalTarget = targetRow;
|
|
33453
|
+
while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow > 0) {
|
|
33454
|
+
finalTarget--;
|
|
33383
33455
|
}
|
|
33456
|
+
this.offsetY =
|
|
33457
|
+
this.getters.getRowDimensions(sheetId, finalTarget).start - this.offsetCorrectionY;
|
|
33458
|
+
this.offsetScrollbarY = this.offsetY;
|
|
33459
|
+
this.adjustViewportZoneY();
|
|
33384
33460
|
}
|
|
33385
33461
|
}
|
|
33386
33462
|
setViewportOffset(offsetX, offsetY) {
|
|
@@ -34954,14 +35030,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
34954
35030
|
case "REPLACE_ALL_SEARCH":
|
|
34955
35031
|
this.replaceAll(cmd.replaceWith);
|
|
34956
35032
|
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
35033
|
case "UNDO":
|
|
34964
35034
|
case "REDO":
|
|
35035
|
+
case "REMOVE_FILTER_TABLE":
|
|
35036
|
+
case "UPDATE_FILTER":
|
|
34965
35037
|
case "REMOVE_COLUMNS_ROWS":
|
|
34966
35038
|
case "HIDE_COLUMNS_ROWS":
|
|
34967
35039
|
case "UNHIDE_COLUMNS_ROWS":
|
|
@@ -37953,7 +38025,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
37953
38025
|
});
|
|
37954
38026
|
for (const filterTable of this.copiedTables) {
|
|
37955
38027
|
this.dispatch("REMOVE_FILTER_TABLE", {
|
|
37956
|
-
sheetId: this.
|
|
38028
|
+
sheetId: this.sheetId,
|
|
37957
38029
|
target: [filterTable.zone],
|
|
37958
38030
|
});
|
|
37959
38031
|
}
|
|
@@ -38431,7 +38503,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
38431
38503
|
allowDispatch(cmd) {
|
|
38432
38504
|
switch (cmd.type) {
|
|
38433
38505
|
case "CUT":
|
|
38434
|
-
const zones =
|
|
38506
|
+
const zones = this.getters.getSelectedZones();
|
|
38435
38507
|
const state = this.getClipboardState(zones, cmd.type);
|
|
38436
38508
|
return state.isCutAllowed(zones);
|
|
38437
38509
|
case "PASTE":
|
|
@@ -38462,7 +38534,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
38462
38534
|
switch (cmd.type) {
|
|
38463
38535
|
case "COPY":
|
|
38464
38536
|
case "CUT":
|
|
38465
|
-
const zones =
|
|
38537
|
+
const zones = this.getters.getSelectedZones();
|
|
38466
38538
|
this.state = this.getClipboardState(zones, cmd.type);
|
|
38467
38539
|
this.status = "visible";
|
|
38468
38540
|
break;
|
|
@@ -38893,6 +38965,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
38893
38965
|
// ---------------------------------------------------------------------------
|
|
38894
38966
|
// Getters
|
|
38895
38967
|
// ---------------------------------------------------------------------------
|
|
38968
|
+
isGridSelectionActive() {
|
|
38969
|
+
return this.selection.isListening(this);
|
|
38970
|
+
}
|
|
38896
38971
|
getActiveSheet() {
|
|
38897
38972
|
return this.activeSheet;
|
|
38898
38973
|
}
|
|
@@ -39123,26 +39198,24 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
39123
39198
|
const isBasedBefore = cmd.base < start;
|
|
39124
39199
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
39125
39200
|
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
|
-
});
|
|
39201
|
+
const target = [
|
|
39202
|
+
{
|
|
39203
|
+
left: isCol ? start + deltaCol : 0,
|
|
39204
|
+
right: isCol ? end + deltaCol : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39205
|
+
top: !isCol ? start + deltaRow : 0,
|
|
39206
|
+
bottom: !isCol ? end + deltaRow : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39207
|
+
},
|
|
39208
|
+
];
|
|
39209
|
+
const state = new ClipboardCellsState(target, "CUT", this.getters, this.dispatch, this.selection);
|
|
39210
|
+
const pasteTarget = [
|
|
39211
|
+
{
|
|
39212
|
+
left: isCol ? cmd.base : 0,
|
|
39213
|
+
right: isCol ? cmd.base + thickness - 1 : this.getters.getNumberCols(cmd.sheetId) - 1,
|
|
39214
|
+
top: !isCol ? cmd.base : 0,
|
|
39215
|
+
bottom: !isCol ? cmd.base + thickness - 1 : this.getters.getNumberRows(cmd.sheetId) - 1,
|
|
39216
|
+
},
|
|
39217
|
+
];
|
|
39218
|
+
state.paste(pasteTarget, { selectTarget: true });
|
|
39146
39219
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
39147
39220
|
let currentIndex = cmd.base;
|
|
39148
39221
|
for (const element of toRemove) {
|
|
@@ -39269,6 +39342,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
39269
39342
|
"getSheetPosition",
|
|
39270
39343
|
"isSelected",
|
|
39271
39344
|
"getElementsFromSelection",
|
|
39345
|
+
"isGridSelectionActive",
|
|
39272
39346
|
];
|
|
39273
39347
|
|
|
39274
39348
|
const corePluginRegistry = new Registry()
|
|
@@ -42061,6 +42135,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
42061
42135
|
anchor: { zone, cell: this.anchor.cell },
|
|
42062
42136
|
});
|
|
42063
42137
|
}
|
|
42138
|
+
isListening(owner) {
|
|
42139
|
+
return this.stream.isListening(owner);
|
|
42140
|
+
}
|
|
42064
42141
|
/**
|
|
42065
42142
|
* Process a new anchor selection event. If the new anchor is inside
|
|
42066
42143
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -44349,9 +44426,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
44349
44426
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
44350
44427
|
|
|
44351
44428
|
|
|
44352
|
-
__info__.version = '16.1.
|
|
44353
|
-
__info__.date = '2023-
|
|
44354
|
-
__info__.hash = '
|
|
44429
|
+
__info__.version = '16.1.24';
|
|
44430
|
+
__info__.date = '2023-10-19T14:21:55.097Z';
|
|
44431
|
+
__info__.hash = '1b9e9d0';
|
|
44355
44432
|
|
|
44356
44433
|
|
|
44357
44434
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|