@odoo/o-spreadsheet 15.0.18 → 15.0.20
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 +60 -27
- package/dist/o-spreadsheet.d.ts +2 -0
- package/dist/o-spreadsheet.esm.js +60 -27
- package/dist/o-spreadsheet.iife.js +60 -27
- package/dist/o-spreadsheet.iife.min.js +366 -366
- package/package.json +1 -1
|
@@ -2993,6 +2993,34 @@ function deepEquals(o1, o2) {
|
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
2995
|
return true;
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Alternative to Math.max that works with large arrays.
|
|
2999
|
+
* Typically useful for arrays bigger than 100k elements.
|
|
3000
|
+
*/
|
|
3001
|
+
function largeMax(array) {
|
|
3002
|
+
let len = array.length;
|
|
3003
|
+
if (len < 100000)
|
|
3004
|
+
return Math.max(...array);
|
|
3005
|
+
let max = -Infinity;
|
|
3006
|
+
while (len--) {
|
|
3007
|
+
max = array[len] > max ? array[len] : max;
|
|
3008
|
+
}
|
|
3009
|
+
return max;
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* Alternative to Math.min that works with large arrays.
|
|
3013
|
+
* Typically useful for arrays bigger than 100k elements.
|
|
3014
|
+
*/
|
|
3015
|
+
function largeMin(array) {
|
|
3016
|
+
let len = array.length;
|
|
3017
|
+
if (len < 100000)
|
|
3018
|
+
return Math.min(...array);
|
|
3019
|
+
let min = +Infinity;
|
|
3020
|
+
while (len--) {
|
|
3021
|
+
min = array[len] < min ? array[len] : min;
|
|
3022
|
+
}
|
|
3023
|
+
return min;
|
|
2996
3024
|
}
|
|
2997
3025
|
|
|
2998
3026
|
/**
|
|
@@ -3610,9 +3638,10 @@ function exportRows(rows, exportDefaults = false) {
|
|
|
3610
3638
|
* https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
|
|
3611
3639
|
* */
|
|
3612
3640
|
class UuidGenerator {
|
|
3613
|
-
constructor() {
|
|
3641
|
+
constructor(isFast = false) {
|
|
3614
3642
|
this.isFastIdStrategy = false;
|
|
3615
3643
|
this.fastIdStart = 0;
|
|
3644
|
+
this.setIsFastStrategy(isFast);
|
|
3616
3645
|
}
|
|
3617
3646
|
setIsFastStrategy(isFast) {
|
|
3618
3647
|
this.isFastIdStrategy = isFast;
|
|
@@ -9523,6 +9552,7 @@ class CellPlugin extends CorePlugin {
|
|
|
9523
9552
|
constructor() {
|
|
9524
9553
|
super(...arguments);
|
|
9525
9554
|
this.cells = {};
|
|
9555
|
+
this.cellUuidGenerator = new UuidGenerator(true);
|
|
9526
9556
|
this.createCell = cellFactory(this.getters);
|
|
9527
9557
|
}
|
|
9528
9558
|
adaptRanges(applyChange, sheetId) {
|
|
@@ -9702,7 +9732,7 @@ class CellPlugin extends CorePlugin {
|
|
|
9702
9732
|
}
|
|
9703
9733
|
importCell(sheet, cellData, normalizedStyles) {
|
|
9704
9734
|
const style = (cellData.style && normalizedStyles[cellData.style]) || undefined;
|
|
9705
|
-
const cellId = this.
|
|
9735
|
+
const cellId = this.cellUuidGenerator.uuidv4();
|
|
9706
9736
|
const properties = { format: cellData === null || cellData === void 0 ? void 0 : cellData.format, style };
|
|
9707
9737
|
return this.createCell(cellId, (cellData === null || cellData === void 0 ? void 0 : cellData.content) || "", properties, sheet.id);
|
|
9708
9738
|
}
|
|
@@ -9885,7 +9915,7 @@ class CellPlugin extends CorePlugin {
|
|
|
9885
9915
|
}
|
|
9886
9916
|
return;
|
|
9887
9917
|
}
|
|
9888
|
-
const cellId = (before === null || before === void 0 ? void 0 : before.id) || this.
|
|
9918
|
+
const cellId = (before === null || before === void 0 ? void 0 : before.id) || this.cellUuidGenerator.uuidv4();
|
|
9889
9919
|
const didContentChange = hasContent;
|
|
9890
9920
|
const properties = { format, style };
|
|
9891
9921
|
const cell = this.createCell(cellId, afterContent, properties, sheet.id);
|
|
@@ -10719,6 +10749,9 @@ class FigurePlugin extends CorePlugin {
|
|
|
10719
10749
|
this.figures[cmd.sheetId] = {};
|
|
10720
10750
|
break;
|
|
10721
10751
|
case "DELETE_SHEET":
|
|
10752
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
10753
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
10754
|
+
});
|
|
10722
10755
|
this.deleteSheet(cmd.sheetId);
|
|
10723
10756
|
break;
|
|
10724
10757
|
case "CREATE_FIGURE":
|
|
@@ -12029,8 +12062,8 @@ class SheetPlugin extends CorePlugin {
|
|
|
12029
12062
|
getImportedSheetSize(data) {
|
|
12030
12063
|
const positions = Object.keys(data.cells).map(toCartesian);
|
|
12031
12064
|
return {
|
|
12032
|
-
rowNumber: Math.max(data.rowNumber,
|
|
12033
|
-
colNumber: Math.max(data.colNumber,
|
|
12065
|
+
rowNumber: Math.max(data.rowNumber, largeMax(positions.map(([col, row]) => row + 1))),
|
|
12066
|
+
colNumber: Math.max(data.colNumber, largeMax(positions.map(([col, row]) => col + 1))),
|
|
12034
12067
|
};
|
|
12035
12068
|
}
|
|
12036
12069
|
// ----------------------------------------------------
|
|
@@ -12567,8 +12600,8 @@ const DELETE_CONTENT_ROWS_NAME = (env) => {
|
|
|
12567
12600
|
let last;
|
|
12568
12601
|
const activesRows = env.getters.getActiveRows();
|
|
12569
12602
|
if (activesRows.size !== 0) {
|
|
12570
|
-
first =
|
|
12571
|
-
last =
|
|
12603
|
+
first = largeMin([...activesRows]);
|
|
12604
|
+
last = largeMax([...activesRows]);
|
|
12572
12605
|
}
|
|
12573
12606
|
else {
|
|
12574
12607
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12593,8 +12626,8 @@ const DELETE_CONTENT_COLUMNS_NAME = (env) => {
|
|
|
12593
12626
|
let last;
|
|
12594
12627
|
const activeCols = env.getters.getActiveCols();
|
|
12595
12628
|
if (activeCols.size !== 0) {
|
|
12596
|
-
first =
|
|
12597
|
-
last =
|
|
12629
|
+
first = largeMin([...activeCols]);
|
|
12630
|
+
last = largeMax([...activeCols]);
|
|
12598
12631
|
}
|
|
12599
12632
|
else {
|
|
12600
12633
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12619,8 +12652,8 @@ const REMOVE_ROWS_NAME = (env) => {
|
|
|
12619
12652
|
let last;
|
|
12620
12653
|
const activesRows = env.getters.getActiveRows();
|
|
12621
12654
|
if (activesRows.size !== 0) {
|
|
12622
|
-
first =
|
|
12623
|
-
last =
|
|
12655
|
+
first = largeMin([...activesRows]);
|
|
12656
|
+
last = largeMax([...activesRows]);
|
|
12624
12657
|
}
|
|
12625
12658
|
else {
|
|
12626
12659
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12651,8 +12684,8 @@ const REMOVE_COLUMNS_NAME = (env) => {
|
|
|
12651
12684
|
let last;
|
|
12652
12685
|
const activeCols = env.getters.getActiveCols();
|
|
12653
12686
|
if (activeCols.size !== 0) {
|
|
12654
|
-
first =
|
|
12655
|
-
last =
|
|
12687
|
+
first = largeMin([...activeCols]);
|
|
12688
|
+
last = largeMax([...activeCols]);
|
|
12656
12689
|
}
|
|
12657
12690
|
else {
|
|
12658
12691
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12717,7 +12750,7 @@ const INSERT_ROWS_BEFORE_ACTION = (env) => {
|
|
|
12717
12750
|
let row;
|
|
12718
12751
|
let quantity;
|
|
12719
12752
|
if (activeRows.size) {
|
|
12720
|
-
row =
|
|
12753
|
+
row = largeMin([...activeRows]);
|
|
12721
12754
|
quantity = activeRows.size;
|
|
12722
12755
|
}
|
|
12723
12756
|
else {
|
|
@@ -12749,7 +12782,7 @@ const INSERT_ROWS_AFTER_ACTION = (env) => {
|
|
|
12749
12782
|
let row;
|
|
12750
12783
|
let quantity;
|
|
12751
12784
|
if (activeRows.size) {
|
|
12752
|
-
row =
|
|
12785
|
+
row = largeMax([...activeRows]);
|
|
12753
12786
|
quantity = activeRows.size;
|
|
12754
12787
|
}
|
|
12755
12788
|
else {
|
|
@@ -12790,7 +12823,7 @@ const INSERT_COLUMNS_BEFORE_ACTION = (env) => {
|
|
|
12790
12823
|
let column;
|
|
12791
12824
|
let quantity;
|
|
12792
12825
|
if (activeCols.size) {
|
|
12793
|
-
column =
|
|
12826
|
+
column = largeMin([...activeCols]);
|
|
12794
12827
|
quantity = activeCols.size;
|
|
12795
12828
|
}
|
|
12796
12829
|
else {
|
|
@@ -12824,7 +12857,7 @@ const INSERT_COLUMNS_AFTER_ACTION = (env) => {
|
|
|
12824
12857
|
let column;
|
|
12825
12858
|
let quantity;
|
|
12826
12859
|
if (activeCols.size) {
|
|
12827
|
-
column =
|
|
12860
|
+
column = largeMax([...activeCols]);
|
|
12828
12861
|
quantity = activeCols.size;
|
|
12829
12862
|
}
|
|
12830
12863
|
else {
|
|
@@ -16566,13 +16599,13 @@ class AutomaticSumPlugin extends UIPlugin {
|
|
|
16566
16599
|
const cells = mapCellsInZone(zone, sheet, (cell) => cell, undefined).flat();
|
|
16567
16600
|
const cellPositions = range(end, -1, -1);
|
|
16568
16601
|
const invalidCells = cellPositions.filter((position) => { var _a; return cells[position] && !((_a = cells[position]) === null || _a === void 0 ? void 0 : _a.isAutoSummable); });
|
|
16569
|
-
const maxValidPosition =
|
|
16602
|
+
const maxValidPosition = largeMax(invalidCells);
|
|
16570
16603
|
const numberSequences = groupConsecutive(cellPositions.filter((position) => this.isNumber(cells[position])));
|
|
16571
16604
|
const firstSequence = numberSequences[0] || [];
|
|
16572
|
-
if (
|
|
16605
|
+
if (largeMax(firstSequence) < maxValidPosition) {
|
|
16573
16606
|
return Infinity;
|
|
16574
16607
|
}
|
|
16575
|
-
return
|
|
16608
|
+
return largeMin(firstSequence);
|
|
16576
16609
|
}
|
|
16577
16610
|
shouldFindData(sheetId, zone) {
|
|
16578
16611
|
return this.getters.isEmpty(sheetId, zone) || this.getters.isSingleCellOrMerge(sheetId, zone);
|
|
@@ -22263,13 +22296,13 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
22263
22296
|
getColMaxWidth(sheetId, index) {
|
|
22264
22297
|
const cells = this.getters.getColCells(sheetId, index);
|
|
22265
22298
|
const sizes = cells.map((cell) => this.getCellWidth(cell));
|
|
22266
|
-
return Math.max(0,
|
|
22299
|
+
return Math.max(0, largeMax(sizes));
|
|
22267
22300
|
}
|
|
22268
22301
|
getRowMaxHeight(sheetId, index) {
|
|
22269
22302
|
const sheet = this.getters.getSheet(sheetId);
|
|
22270
22303
|
const cells = Object.values(sheet.rows[index].cells);
|
|
22271
22304
|
const sizes = cells.map((cell) => this.getCellHeight(cell));
|
|
22272
|
-
return Math.max(0,
|
|
22305
|
+
return Math.max(0, largeMax(sizes));
|
|
22273
22306
|
}
|
|
22274
22307
|
interactiveRenameSheet(sheetId, title) {
|
|
22275
22308
|
const placeholder = this.getters.getSheetName(sheetId);
|
|
@@ -23688,8 +23721,8 @@ class RangeAdapter {
|
|
|
23688
23721
|
let newRange = range;
|
|
23689
23722
|
let changeType = "NONE";
|
|
23690
23723
|
for (let group of groups) {
|
|
23691
|
-
const min =
|
|
23692
|
-
const max =
|
|
23724
|
+
const min = largeMin(group);
|
|
23725
|
+
const max = largeMax(group);
|
|
23693
23726
|
if (range.zone[start] <= min && min <= range.zone[end]) {
|
|
23694
23727
|
const toRemove = Math.min(range.zone[end], max) - min + 1;
|
|
23695
23728
|
changeType = "RESIZE";
|
|
@@ -31505,6 +31538,6 @@ exports.registries = registries;
|
|
|
31505
31538
|
exports.setTranslationMethod = setTranslationMethod;
|
|
31506
31539
|
|
|
31507
31540
|
|
|
31508
|
-
__info__.version = '15.0.
|
|
31509
|
-
__info__.date = '2024-
|
|
31510
|
-
__info__.hash = '
|
|
31541
|
+
__info__.version = '15.0.20';
|
|
31542
|
+
__info__.date = '2024-04-05T13:56:04.792Z';
|
|
31543
|
+
__info__.hash = '09e95ef';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ declare function formatDecimal(n: number, decimals: number, sep?: string): strin
|
|
|
92
92
|
declare class UuidGenerator {
|
|
93
93
|
private isFastIdStrategy;
|
|
94
94
|
private fastIdStart;
|
|
95
|
+
constructor(isFast?: boolean);
|
|
95
96
|
setIsFastStrategy(isFast: boolean): void;
|
|
96
97
|
uuidv4(): string;
|
|
97
98
|
}
|
|
@@ -2344,6 +2345,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
|
|
|
2344
2345
|
[id: string]: Cell;
|
|
2345
2346
|
};
|
|
2346
2347
|
};
|
|
2348
|
+
private cellUuidGenerator;
|
|
2347
2349
|
private createCell;
|
|
2348
2350
|
adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
|
|
2349
2351
|
allowDispatch(cmd: CoreCommand): CommandResult;
|
|
@@ -2970,6 +2970,34 @@ function deepEquals(o1, o2) {
|
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
2972
|
return true;
|
|
2973
|
+
}
|
|
2974
|
+
/**
|
|
2975
|
+
* Alternative to Math.max that works with large arrays.
|
|
2976
|
+
* Typically useful for arrays bigger than 100k elements.
|
|
2977
|
+
*/
|
|
2978
|
+
function largeMax(array) {
|
|
2979
|
+
let len = array.length;
|
|
2980
|
+
if (len < 100000)
|
|
2981
|
+
return Math.max(...array);
|
|
2982
|
+
let max = -Infinity;
|
|
2983
|
+
while (len--) {
|
|
2984
|
+
max = array[len] > max ? array[len] : max;
|
|
2985
|
+
}
|
|
2986
|
+
return max;
|
|
2987
|
+
}
|
|
2988
|
+
/**
|
|
2989
|
+
* Alternative to Math.min that works with large arrays.
|
|
2990
|
+
* Typically useful for arrays bigger than 100k elements.
|
|
2991
|
+
*/
|
|
2992
|
+
function largeMin(array) {
|
|
2993
|
+
let len = array.length;
|
|
2994
|
+
if (len < 100000)
|
|
2995
|
+
return Math.min(...array);
|
|
2996
|
+
let min = +Infinity;
|
|
2997
|
+
while (len--) {
|
|
2998
|
+
min = array[len] < min ? array[len] : min;
|
|
2999
|
+
}
|
|
3000
|
+
return min;
|
|
2973
3001
|
}
|
|
2974
3002
|
|
|
2975
3003
|
/**
|
|
@@ -3587,9 +3615,10 @@ function exportRows(rows, exportDefaults = false) {
|
|
|
3587
3615
|
* https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
|
|
3588
3616
|
* */
|
|
3589
3617
|
class UuidGenerator {
|
|
3590
|
-
constructor() {
|
|
3618
|
+
constructor(isFast = false) {
|
|
3591
3619
|
this.isFastIdStrategy = false;
|
|
3592
3620
|
this.fastIdStart = 0;
|
|
3621
|
+
this.setIsFastStrategy(isFast);
|
|
3593
3622
|
}
|
|
3594
3623
|
setIsFastStrategy(isFast) {
|
|
3595
3624
|
this.isFastIdStrategy = isFast;
|
|
@@ -9500,6 +9529,7 @@ class CellPlugin extends CorePlugin {
|
|
|
9500
9529
|
constructor() {
|
|
9501
9530
|
super(...arguments);
|
|
9502
9531
|
this.cells = {};
|
|
9532
|
+
this.cellUuidGenerator = new UuidGenerator(true);
|
|
9503
9533
|
this.createCell = cellFactory(this.getters);
|
|
9504
9534
|
}
|
|
9505
9535
|
adaptRanges(applyChange, sheetId) {
|
|
@@ -9679,7 +9709,7 @@ class CellPlugin extends CorePlugin {
|
|
|
9679
9709
|
}
|
|
9680
9710
|
importCell(sheet, cellData, normalizedStyles) {
|
|
9681
9711
|
const style = (cellData.style && normalizedStyles[cellData.style]) || undefined;
|
|
9682
|
-
const cellId = this.
|
|
9712
|
+
const cellId = this.cellUuidGenerator.uuidv4();
|
|
9683
9713
|
const properties = { format: cellData === null || cellData === void 0 ? void 0 : cellData.format, style };
|
|
9684
9714
|
return this.createCell(cellId, (cellData === null || cellData === void 0 ? void 0 : cellData.content) || "", properties, sheet.id);
|
|
9685
9715
|
}
|
|
@@ -9862,7 +9892,7 @@ class CellPlugin extends CorePlugin {
|
|
|
9862
9892
|
}
|
|
9863
9893
|
return;
|
|
9864
9894
|
}
|
|
9865
|
-
const cellId = (before === null || before === void 0 ? void 0 : before.id) || this.
|
|
9895
|
+
const cellId = (before === null || before === void 0 ? void 0 : before.id) || this.cellUuidGenerator.uuidv4();
|
|
9866
9896
|
const didContentChange = hasContent;
|
|
9867
9897
|
const properties = { format, style };
|
|
9868
9898
|
const cell = this.createCell(cellId, afterContent, properties, sheet.id);
|
|
@@ -10696,6 +10726,9 @@ class FigurePlugin extends CorePlugin {
|
|
|
10696
10726
|
this.figures[cmd.sheetId] = {};
|
|
10697
10727
|
break;
|
|
10698
10728
|
case "DELETE_SHEET":
|
|
10729
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
10730
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
10731
|
+
});
|
|
10699
10732
|
this.deleteSheet(cmd.sheetId);
|
|
10700
10733
|
break;
|
|
10701
10734
|
case "CREATE_FIGURE":
|
|
@@ -12006,8 +12039,8 @@ class SheetPlugin extends CorePlugin {
|
|
|
12006
12039
|
getImportedSheetSize(data) {
|
|
12007
12040
|
const positions = Object.keys(data.cells).map(toCartesian);
|
|
12008
12041
|
return {
|
|
12009
|
-
rowNumber: Math.max(data.rowNumber,
|
|
12010
|
-
colNumber: Math.max(data.colNumber,
|
|
12042
|
+
rowNumber: Math.max(data.rowNumber, largeMax(positions.map(([col, row]) => row + 1))),
|
|
12043
|
+
colNumber: Math.max(data.colNumber, largeMax(positions.map(([col, row]) => col + 1))),
|
|
12011
12044
|
};
|
|
12012
12045
|
}
|
|
12013
12046
|
// ----------------------------------------------------
|
|
@@ -12544,8 +12577,8 @@ const DELETE_CONTENT_ROWS_NAME = (env) => {
|
|
|
12544
12577
|
let last;
|
|
12545
12578
|
const activesRows = env.getters.getActiveRows();
|
|
12546
12579
|
if (activesRows.size !== 0) {
|
|
12547
|
-
first =
|
|
12548
|
-
last =
|
|
12580
|
+
first = largeMin([...activesRows]);
|
|
12581
|
+
last = largeMax([...activesRows]);
|
|
12549
12582
|
}
|
|
12550
12583
|
else {
|
|
12551
12584
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12570,8 +12603,8 @@ const DELETE_CONTENT_COLUMNS_NAME = (env) => {
|
|
|
12570
12603
|
let last;
|
|
12571
12604
|
const activeCols = env.getters.getActiveCols();
|
|
12572
12605
|
if (activeCols.size !== 0) {
|
|
12573
|
-
first =
|
|
12574
|
-
last =
|
|
12606
|
+
first = largeMin([...activeCols]);
|
|
12607
|
+
last = largeMax([...activeCols]);
|
|
12575
12608
|
}
|
|
12576
12609
|
else {
|
|
12577
12610
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12596,8 +12629,8 @@ const REMOVE_ROWS_NAME = (env) => {
|
|
|
12596
12629
|
let last;
|
|
12597
12630
|
const activesRows = env.getters.getActiveRows();
|
|
12598
12631
|
if (activesRows.size !== 0) {
|
|
12599
|
-
first =
|
|
12600
|
-
last =
|
|
12632
|
+
first = largeMin([...activesRows]);
|
|
12633
|
+
last = largeMax([...activesRows]);
|
|
12601
12634
|
}
|
|
12602
12635
|
else {
|
|
12603
12636
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12628,8 +12661,8 @@ const REMOVE_COLUMNS_NAME = (env) => {
|
|
|
12628
12661
|
let last;
|
|
12629
12662
|
const activeCols = env.getters.getActiveCols();
|
|
12630
12663
|
if (activeCols.size !== 0) {
|
|
12631
|
-
first =
|
|
12632
|
-
last =
|
|
12664
|
+
first = largeMin([...activeCols]);
|
|
12665
|
+
last = largeMax([...activeCols]);
|
|
12633
12666
|
}
|
|
12634
12667
|
else {
|
|
12635
12668
|
const zone = env.getters.getSelectedZones()[0];
|
|
@@ -12694,7 +12727,7 @@ const INSERT_ROWS_BEFORE_ACTION = (env) => {
|
|
|
12694
12727
|
let row;
|
|
12695
12728
|
let quantity;
|
|
12696
12729
|
if (activeRows.size) {
|
|
12697
|
-
row =
|
|
12730
|
+
row = largeMin([...activeRows]);
|
|
12698
12731
|
quantity = activeRows.size;
|
|
12699
12732
|
}
|
|
12700
12733
|
else {
|
|
@@ -12726,7 +12759,7 @@ const INSERT_ROWS_AFTER_ACTION = (env) => {
|
|
|
12726
12759
|
let row;
|
|
12727
12760
|
let quantity;
|
|
12728
12761
|
if (activeRows.size) {
|
|
12729
|
-
row =
|
|
12762
|
+
row = largeMax([...activeRows]);
|
|
12730
12763
|
quantity = activeRows.size;
|
|
12731
12764
|
}
|
|
12732
12765
|
else {
|
|
@@ -12767,7 +12800,7 @@ const INSERT_COLUMNS_BEFORE_ACTION = (env) => {
|
|
|
12767
12800
|
let column;
|
|
12768
12801
|
let quantity;
|
|
12769
12802
|
if (activeCols.size) {
|
|
12770
|
-
column =
|
|
12803
|
+
column = largeMin([...activeCols]);
|
|
12771
12804
|
quantity = activeCols.size;
|
|
12772
12805
|
}
|
|
12773
12806
|
else {
|
|
@@ -12801,7 +12834,7 @@ const INSERT_COLUMNS_AFTER_ACTION = (env) => {
|
|
|
12801
12834
|
let column;
|
|
12802
12835
|
let quantity;
|
|
12803
12836
|
if (activeCols.size) {
|
|
12804
|
-
column =
|
|
12837
|
+
column = largeMax([...activeCols]);
|
|
12805
12838
|
quantity = activeCols.size;
|
|
12806
12839
|
}
|
|
12807
12840
|
else {
|
|
@@ -16543,13 +16576,13 @@ class AutomaticSumPlugin extends UIPlugin {
|
|
|
16543
16576
|
const cells = mapCellsInZone(zone, sheet, (cell) => cell, undefined).flat();
|
|
16544
16577
|
const cellPositions = range(end, -1, -1);
|
|
16545
16578
|
const invalidCells = cellPositions.filter((position) => { var _a; return cells[position] && !((_a = cells[position]) === null || _a === void 0 ? void 0 : _a.isAutoSummable); });
|
|
16546
|
-
const maxValidPosition =
|
|
16579
|
+
const maxValidPosition = largeMax(invalidCells);
|
|
16547
16580
|
const numberSequences = groupConsecutive(cellPositions.filter((position) => this.isNumber(cells[position])));
|
|
16548
16581
|
const firstSequence = numberSequences[0] || [];
|
|
16549
|
-
if (
|
|
16582
|
+
if (largeMax(firstSequence) < maxValidPosition) {
|
|
16550
16583
|
return Infinity;
|
|
16551
16584
|
}
|
|
16552
|
-
return
|
|
16585
|
+
return largeMin(firstSequence);
|
|
16553
16586
|
}
|
|
16554
16587
|
shouldFindData(sheetId, zone) {
|
|
16555
16588
|
return this.getters.isEmpty(sheetId, zone) || this.getters.isSingleCellOrMerge(sheetId, zone);
|
|
@@ -22240,13 +22273,13 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
22240
22273
|
getColMaxWidth(sheetId, index) {
|
|
22241
22274
|
const cells = this.getters.getColCells(sheetId, index);
|
|
22242
22275
|
const sizes = cells.map((cell) => this.getCellWidth(cell));
|
|
22243
|
-
return Math.max(0,
|
|
22276
|
+
return Math.max(0, largeMax(sizes));
|
|
22244
22277
|
}
|
|
22245
22278
|
getRowMaxHeight(sheetId, index) {
|
|
22246
22279
|
const sheet = this.getters.getSheet(sheetId);
|
|
22247
22280
|
const cells = Object.values(sheet.rows[index].cells);
|
|
22248
22281
|
const sizes = cells.map((cell) => this.getCellHeight(cell));
|
|
22249
|
-
return Math.max(0,
|
|
22282
|
+
return Math.max(0, largeMax(sizes));
|
|
22250
22283
|
}
|
|
22251
22284
|
interactiveRenameSheet(sheetId, title) {
|
|
22252
22285
|
const placeholder = this.getters.getSheetName(sheetId);
|
|
@@ -23665,8 +23698,8 @@ class RangeAdapter {
|
|
|
23665
23698
|
let newRange = range;
|
|
23666
23699
|
let changeType = "NONE";
|
|
23667
23700
|
for (let group of groups) {
|
|
23668
|
-
const min =
|
|
23669
|
-
const max =
|
|
23701
|
+
const min = largeMin(group);
|
|
23702
|
+
const max = largeMax(group);
|
|
23670
23703
|
if (range.zone[start] <= min && min <= range.zone[end]) {
|
|
23671
23704
|
const toRemove = Math.min(range.zone[end], max) - min + 1;
|
|
23672
23705
|
changeType = "RESIZE";
|
|
@@ -31460,6 +31493,6 @@ const helpers = {
|
|
|
31460
31493
|
export { CommandResult, CorePlugin, DATETIME_FORMAT, DataSource, DispatchResult, Model, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, DEBUG as __DEBUG__, __info__, astToFormula, cellTypes, convertAstNodes, coreTypes, functionCache, helpers, invalidateEvaluationCommands, normalize, parse, readonlyAllowedCommands, registries, setTranslationMethod };
|
|
31461
31494
|
|
|
31462
31495
|
|
|
31463
|
-
__info__.version = '15.0.
|
|
31464
|
-
__info__.date = '2024-
|
|
31465
|
-
__info__.hash = '
|
|
31496
|
+
__info__.version = '15.0.20';
|
|
31497
|
+
__info__.date = '2024-04-05T13:56:04.792Z';
|
|
31498
|
+
__info__.hash = '09e95ef';
|