@odoo/o-spreadsheet 17.0.44 → 17.0.46
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 +149 -52
- package/dist/o-spreadsheet.d.ts +25 -2
- package/dist/o-spreadsheet.esm.js +149 -52
- package/dist/o-spreadsheet.iife.js +149 -52
- package/dist/o-spreadsheet.iife.min.js +7 -7
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +2 -2
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.0.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.46
|
|
6
|
+
* @date 2025-01-27T10:00:20.499Z
|
|
7
|
+
* @hash 1df062c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -2697,15 +2697,18 @@ function dichotomicSearch(data, target, mode, sortOrder, rangeLength, getValueIn
|
|
|
2697
2697
|
let currentIndex;
|
|
2698
2698
|
let currentVal;
|
|
2699
2699
|
let currentType;
|
|
2700
|
+
const getValue = sortOrder === "desc"
|
|
2701
|
+
? (i) => normalizeValue(getValueInData(data, rangeLength - i - 1))
|
|
2702
|
+
: (i) => normalizeValue(getValueInData(data, i));
|
|
2700
2703
|
while (indexRight - indexLeft >= 0) {
|
|
2701
2704
|
indexMedian = Math.floor((indexLeft + indexRight) / 2);
|
|
2702
2705
|
currentIndex = indexMedian;
|
|
2703
|
-
currentVal =
|
|
2706
|
+
currentVal = getValue(currentIndex);
|
|
2704
2707
|
currentType = typeof currentVal;
|
|
2705
2708
|
// 1 - linear search to find value with the same type
|
|
2706
2709
|
while (indexLeft < currentIndex && targetType !== currentType) {
|
|
2707
2710
|
currentIndex--;
|
|
2708
|
-
currentVal =
|
|
2711
|
+
currentVal = getValue(currentIndex);
|
|
2709
2712
|
currentType = typeof currentVal;
|
|
2710
2713
|
}
|
|
2711
2714
|
if (currentType !== targetType || currentVal === undefined || currentVal === null) {
|
|
@@ -2721,8 +2724,7 @@ function dichotomicSearch(data, target, mode, sortOrder, rangeLength, getValueIn
|
|
|
2721
2724
|
if (matchVal === undefined ||
|
|
2722
2725
|
matchVal === null ||
|
|
2723
2726
|
matchVal < currentVal ||
|
|
2724
|
-
(matchVal === currentVal &&
|
|
2725
|
-
(matchVal === currentVal && sortOrder === "desc" && matchValIndex > currentIndex)) {
|
|
2727
|
+
(matchVal === currentVal && matchValIndex < currentIndex)) {
|
|
2726
2728
|
matchVal = currentVal;
|
|
2727
2729
|
matchValIndex = currentIndex;
|
|
2728
2730
|
}
|
|
@@ -2730,15 +2732,13 @@ function dichotomicSearch(data, target, mode, sortOrder, rangeLength, getValueIn
|
|
|
2730
2732
|
else if (mode === "nextGreater" && currentVal >= _target) {
|
|
2731
2733
|
if (matchVal === undefined ||
|
|
2732
2734
|
matchVal > currentVal ||
|
|
2733
|
-
(matchVal === currentVal &&
|
|
2734
|
-
(matchVal === currentVal && sortOrder === "desc" && matchValIndex > currentIndex)) {
|
|
2735
|
+
(matchVal === currentVal && matchValIndex < currentIndex)) {
|
|
2735
2736
|
matchVal = currentVal;
|
|
2736
2737
|
matchValIndex = currentIndex;
|
|
2737
2738
|
}
|
|
2738
2739
|
}
|
|
2739
2740
|
// 3 - give new indexes for the Binary search
|
|
2740
|
-
if ((
|
|
2741
|
-
(sortOrder === "desc" && currentVal <= _target)) {
|
|
2741
|
+
if (currentVal > _target || (mode === "strict" && currentVal === _target)) {
|
|
2742
2742
|
indexRight = currentIndex - 1;
|
|
2743
2743
|
}
|
|
2744
2744
|
else {
|
|
@@ -2746,7 +2746,10 @@ function dichotomicSearch(data, target, mode, sortOrder, rangeLength, getValueIn
|
|
|
2746
2746
|
}
|
|
2747
2747
|
}
|
|
2748
2748
|
// note that valMinIndex could be 0
|
|
2749
|
-
|
|
2749
|
+
if (matchValIndex === undefined) {
|
|
2750
|
+
return -1;
|
|
2751
|
+
}
|
|
2752
|
+
return sortOrder === "desc" ? rangeLength - matchValIndex - 1 : matchValIndex;
|
|
2750
2753
|
}
|
|
2751
2754
|
/**
|
|
2752
2755
|
* Perform a linear search and return the index of the match.
|
|
@@ -6940,6 +6943,10 @@ class Popover extends owl.Component {
|
|
|
6940
6943
|
this.currentDisplayValue = newDisplay;
|
|
6941
6944
|
if (!anchor)
|
|
6942
6945
|
return;
|
|
6946
|
+
el.style.top = "";
|
|
6947
|
+
el.style.left = "";
|
|
6948
|
+
el.style["max-height"] = "";
|
|
6949
|
+
el.style["max-width"] = "";
|
|
6943
6950
|
const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
|
|
6944
6951
|
let elDims = {
|
|
6945
6952
|
width: el.getBoundingClientRect().width,
|
|
@@ -27454,7 +27461,7 @@ class GridComposer extends owl.Component {
|
|
|
27454
27461
|
return;
|
|
27455
27462
|
}
|
|
27456
27463
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
27457
|
-
const zone = this.env.model.getters.
|
|
27464
|
+
const zone = positionToZone(this.env.model.getters.getSelection().anchor.cell);
|
|
27458
27465
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
27459
27466
|
if (!deepEquals(rect, this.rect) ||
|
|
27460
27467
|
sheetId !== this.env.model.getters.getCurrentEditedCell().sheetId) {
|
|
@@ -31735,7 +31742,7 @@ function convertFigure(figure, id, sheetData) {
|
|
|
31735
31742
|
return undefined;
|
|
31736
31743
|
}
|
|
31737
31744
|
function isChartData(data) {
|
|
31738
|
-
return "dataSets" in data;
|
|
31745
|
+
return "dataSets" in data && data.dataSets.length > 0;
|
|
31739
31746
|
}
|
|
31740
31747
|
function isImageData(data) {
|
|
31741
31748
|
return "imageSrc" in data;
|
|
@@ -34549,10 +34556,34 @@ class BordersPlugin extends CorePlugin {
|
|
|
34549
34556
|
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
34550
34557
|
for (const group of groupConsecutive(elements)) {
|
|
34551
34558
|
if (cmd.dimension === "COL") {
|
|
34552
|
-
|
|
34559
|
+
if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
|
|
34560
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
34561
|
+
this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
|
|
34562
|
+
}
|
|
34563
|
+
}
|
|
34564
|
+
if (group[group.length - 1] === 0) {
|
|
34565
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
34566
|
+
this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
|
|
34567
|
+
}
|
|
34568
|
+
}
|
|
34569
|
+
const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
34570
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
34571
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
|
|
34553
34572
|
}
|
|
34554
34573
|
else {
|
|
34555
|
-
|
|
34574
|
+
if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
|
|
34575
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
34576
|
+
this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
|
|
34577
|
+
}
|
|
34578
|
+
}
|
|
34579
|
+
if (group[group.length - 1] === 0) {
|
|
34580
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
34581
|
+
this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
|
|
34582
|
+
}
|
|
34583
|
+
}
|
|
34584
|
+
const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
34585
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
34586
|
+
this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
|
|
34556
34587
|
}
|
|
34557
34588
|
}
|
|
34558
34589
|
break;
|
|
@@ -34859,6 +34890,18 @@ class BordersPlugin extends CorePlugin {
|
|
|
34859
34890
|
}
|
|
34860
34891
|
}
|
|
34861
34892
|
}
|
|
34893
|
+
/**
|
|
34894
|
+
* Remove the borders inside of a zone
|
|
34895
|
+
*/
|
|
34896
|
+
clearInsideBorders(sheetId, zones) {
|
|
34897
|
+
for (let zone of zones) {
|
|
34898
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
34899
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
34900
|
+
this.history.update("borders", sheetId, col, row, undefined);
|
|
34901
|
+
}
|
|
34902
|
+
}
|
|
34903
|
+
}
|
|
34904
|
+
}
|
|
34862
34905
|
/**
|
|
34863
34906
|
* Add a border to the existing one to a cell
|
|
34864
34907
|
*/
|
|
@@ -46225,13 +46268,23 @@ class RendererPlugin extends UIPlugin {
|
|
|
46225
46268
|
drawGrid(renderingContext, layer) {
|
|
46226
46269
|
switch (layer) {
|
|
46227
46270
|
case 0 /* LAYERS.Background */:
|
|
46228
|
-
this.
|
|
46229
|
-
this.
|
|
46230
|
-
|
|
46231
|
-
|
|
46232
|
-
|
|
46233
|
-
|
|
46234
|
-
|
|
46271
|
+
this.drawGlobalBackground(renderingContext);
|
|
46272
|
+
for (const zone of this.getters.getAllActiveViewportsZones()) {
|
|
46273
|
+
const { ctx } = renderingContext;
|
|
46274
|
+
ctx.save();
|
|
46275
|
+
ctx.beginPath();
|
|
46276
|
+
const rect = this.getters.getVisibleRect(zone);
|
|
46277
|
+
ctx.rect(rect.x, rect.y, rect.width, rect.height);
|
|
46278
|
+
ctx.clip();
|
|
46279
|
+
this.boxes = this.getGridBoxes(zone);
|
|
46280
|
+
this.drawBackground(renderingContext);
|
|
46281
|
+
this.drawOverflowingCellBackground(renderingContext);
|
|
46282
|
+
this.drawCellBackground(renderingContext);
|
|
46283
|
+
this.drawBorders(renderingContext);
|
|
46284
|
+
this.drawTexts(renderingContext);
|
|
46285
|
+
this.drawIcon(renderingContext);
|
|
46286
|
+
ctx.restore();
|
|
46287
|
+
}
|
|
46235
46288
|
this.drawFrozenPanes(renderingContext);
|
|
46236
46289
|
break;
|
|
46237
46290
|
case 7 /* LAYERS.Headers */:
|
|
@@ -46242,12 +46295,15 @@ class RendererPlugin extends UIPlugin {
|
|
|
46242
46295
|
break;
|
|
46243
46296
|
}
|
|
46244
46297
|
}
|
|
46245
|
-
|
|
46246
|
-
const { ctx
|
|
46298
|
+
drawGlobalBackground(renderingContext) {
|
|
46299
|
+
const { ctx } = renderingContext;
|
|
46247
46300
|
const { width, height } = this.getters.getSheetViewDimensionWithHeaders();
|
|
46248
46301
|
// white background
|
|
46249
46302
|
ctx.fillStyle = "#ffffff";
|
|
46250
46303
|
ctx.fillRect(0, 0, width + CANVAS_SHIFT, height + CANVAS_SHIFT);
|
|
46304
|
+
}
|
|
46305
|
+
drawBackground(renderingContext) {
|
|
46306
|
+
const { ctx, thinLineWidth } = renderingContext;
|
|
46251
46307
|
const areGridLinesVisible = !this.getters.isDashboard() &&
|
|
46252
46308
|
this.getters.getGridLinesVisibility(this.getters.getActiveSheetId());
|
|
46253
46309
|
const inset = areGridLinesVisible ? 0.1 * thinLineWidth : 0;
|
|
@@ -46678,7 +46734,7 @@ class RendererPlugin extends UIPlugin {
|
|
|
46678
46734
|
const position = { sheetId, col, row };
|
|
46679
46735
|
const cell = this.getters.getEvaluatedCell(position);
|
|
46680
46736
|
const showFormula = this.getters.shouldShowFormulas();
|
|
46681
|
-
const { x, y, width, height } = this.getters.
|
|
46737
|
+
const { x, y, width, height } = this.getters.getRect(zone);
|
|
46682
46738
|
const { verticalAlign } = this.getters.getCellStyle(position);
|
|
46683
46739
|
const box = {
|
|
46684
46740
|
x,
|
|
@@ -46793,12 +46849,16 @@ class RendererPlugin extends UIPlugin {
|
|
|
46793
46849
|
}
|
|
46794
46850
|
return box;
|
|
46795
46851
|
}
|
|
46796
|
-
getGridBoxes() {
|
|
46852
|
+
getGridBoxes(zone) {
|
|
46797
46853
|
const boxes = [];
|
|
46798
|
-
const visibleCols = this.getters
|
|
46854
|
+
const visibleCols = this.getters
|
|
46855
|
+
.getSheetViewVisibleCols()
|
|
46856
|
+
.filter((col) => col >= zone.left && col <= zone.right);
|
|
46799
46857
|
const left = visibleCols[0];
|
|
46800
46858
|
const right = visibleCols[visibleCols.length - 1];
|
|
46801
|
-
const visibleRows = this.getters
|
|
46859
|
+
const visibleRows = this.getters
|
|
46860
|
+
.getSheetViewVisibleRows()
|
|
46861
|
+
.filter((row) => row >= zone.top && row <= zone.bottom);
|
|
46802
46862
|
const top = visibleRows[0];
|
|
46803
46863
|
const bottom = visibleRows[visibleRows.length - 1];
|
|
46804
46864
|
const viewport = { left, right, top, bottom };
|
|
@@ -50325,7 +50385,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
50325
50385
|
];
|
|
50326
50386
|
state.paste(pasteTarget, { selectTarget: true });
|
|
50327
50387
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
50328
|
-
let currentIndex = cmd.base;
|
|
50388
|
+
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
50329
50389
|
for (const element of toRemove) {
|
|
50330
50390
|
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
50331
50391
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
@@ -50616,7 +50676,7 @@ class InternalViewport {
|
|
|
50616
50676
|
* @param zone
|
|
50617
50677
|
* @returns Computes the absolute coordinate of a given zone inside the viewport
|
|
50618
50678
|
*/
|
|
50619
|
-
|
|
50679
|
+
getVisibleRect(zone) {
|
|
50620
50680
|
const targetZone = intersection(zone, this.zone);
|
|
50621
50681
|
if (targetZone) {
|
|
50622
50682
|
const x = this.getters.getColRowOffset("COL", this.zone.left, targetZone.left) +
|
|
@@ -50624,12 +50684,20 @@ class InternalViewport {
|
|
|
50624
50684
|
const y = this.getters.getColRowOffset("ROW", this.zone.top, targetZone.top) + this.offsetCorrectionY;
|
|
50625
50685
|
const width = Math.min(this.getters.getColRowOffset("COL", targetZone.left, targetZone.right + 1), this.viewportWidth);
|
|
50626
50686
|
const height = Math.min(this.getters.getColRowOffset("ROW", targetZone.top, targetZone.bottom + 1), this.viewportHeight);
|
|
50627
|
-
return {
|
|
50628
|
-
|
|
50629
|
-
|
|
50630
|
-
|
|
50631
|
-
|
|
50632
|
-
|
|
50687
|
+
return { x, y, width, height };
|
|
50688
|
+
}
|
|
50689
|
+
else {
|
|
50690
|
+
return undefined;
|
|
50691
|
+
}
|
|
50692
|
+
}
|
|
50693
|
+
getFullRect(zone) {
|
|
50694
|
+
const targetZone = intersection(zone, this.zone);
|
|
50695
|
+
if (targetZone) {
|
|
50696
|
+
const x = this.getters.getColRowOffset("COL", this.zone.left, zone.left) + this.offsetCorrectionX;
|
|
50697
|
+
const y = this.getters.getColRowOffset("ROW", this.zone.top, zone.top) + this.offsetCorrectionY;
|
|
50698
|
+
const width = this.getters.getColRowOffset("COL", zone.left, zone.right + 1);
|
|
50699
|
+
const height = this.getters.getColRowOffset("ROW", zone.top, zone.bottom + 1);
|
|
50700
|
+
return { x, y, width, height };
|
|
50633
50701
|
}
|
|
50634
50702
|
else {
|
|
50635
50703
|
return undefined;
|
|
@@ -50813,6 +50881,8 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
50813
50881
|
"getSheetViewVisibleRows",
|
|
50814
50882
|
"getFrozenSheetViewRatio",
|
|
50815
50883
|
"isPositionVisible",
|
|
50884
|
+
"getAllActiveViewportsZones",
|
|
50885
|
+
"getRect",
|
|
50816
50886
|
];
|
|
50817
50887
|
viewports = {};
|
|
50818
50888
|
/**
|
|
@@ -51200,16 +51270,27 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
51200
51270
|
getVisibleRectWithoutHeaders(zone) {
|
|
51201
51271
|
const sheetId = this.getters.getActiveSheetId();
|
|
51202
51272
|
const viewportRects = this.getSubViewports(sheetId)
|
|
51203
|
-
.map((viewport) => viewport.
|
|
51273
|
+
.map((viewport) => viewport.getVisibleRect(zone))
|
|
51204
51274
|
.filter(isDefined$1);
|
|
51205
51275
|
if (viewportRects.length === 0) {
|
|
51206
51276
|
return { x: 0, y: 0, width: 0, height: 0 };
|
|
51207
51277
|
}
|
|
51208
|
-
|
|
51209
|
-
|
|
51210
|
-
|
|
51211
|
-
|
|
51212
|
-
|
|
51278
|
+
return this.recomposeRect(viewportRects);
|
|
51279
|
+
}
|
|
51280
|
+
/**
|
|
51281
|
+
* Computes the actual size and position (:Rect) of the zone on the canvas
|
|
51282
|
+
* regardless of the viewport dimensions.
|
|
51283
|
+
*/
|
|
51284
|
+
getRect(zone) {
|
|
51285
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
51286
|
+
const viewportRects = this.getSubViewports(sheetId)
|
|
51287
|
+
.map((viewport) => viewport.getFullRect(zone))
|
|
51288
|
+
.filter(isDefined$1);
|
|
51289
|
+
if (viewportRects.length === 0) {
|
|
51290
|
+
return { x: 0, y: 0, width: 0, height: 0 };
|
|
51291
|
+
}
|
|
51292
|
+
const rect = this.recomposeRect(viewportRects);
|
|
51293
|
+
return { ...rect, x: rect.x + this.gridOffsetX, y: rect.y + this.gridOffsetY };
|
|
51213
51294
|
}
|
|
51214
51295
|
/**
|
|
51215
51296
|
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
@@ -51223,6 +51304,10 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
51223
51304
|
const y = this.getters.getRowDimensions(sheetId, ySplit).start;
|
|
51224
51305
|
return { x, y };
|
|
51225
51306
|
}
|
|
51307
|
+
getAllActiveViewportsZones() {
|
|
51308
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
51309
|
+
return this.getSubViewports(sheetId);
|
|
51310
|
+
}
|
|
51226
51311
|
// ---------------------------------------------------------------------------
|
|
51227
51312
|
// Private
|
|
51228
51313
|
// ---------------------------------------------------------------------------
|
|
@@ -51407,6 +51492,13 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
51407
51492
|
const height = this.sheetViewHeight + this.gridOffsetY;
|
|
51408
51493
|
return { xRatio: offsetCorrectionX / width, yRatio: offsetCorrectionY / height };
|
|
51409
51494
|
}
|
|
51495
|
+
recomposeRect(viewportRects) {
|
|
51496
|
+
const x = Math.min(...viewportRects.map((rect) => rect.x));
|
|
51497
|
+
const y = Math.min(...viewportRects.map((rect) => rect.y));
|
|
51498
|
+
const width = Math.max(...viewportRects.map((rect) => rect.x + rect.width)) - x;
|
|
51499
|
+
const height = Math.max(...viewportRects.map((rect) => rect.y + rect.height)) - y;
|
|
51500
|
+
return { x, y, width, height };
|
|
51501
|
+
}
|
|
51410
51502
|
}
|
|
51411
51503
|
|
|
51412
51504
|
class HeaderPositionsUIPlugin extends UIPlugin {
|
|
@@ -51858,17 +51950,17 @@ class BottomBarSheet extends owl.Component {
|
|
|
51858
51950
|
sheetNameRef = owl.useRef("sheetNameSpan");
|
|
51859
51951
|
editionState = "initializing";
|
|
51860
51952
|
setup() {
|
|
51861
|
-
owl.onMounted(() => {
|
|
51862
|
-
if (this.isSheetActive) {
|
|
51863
|
-
this.scrollToSheet();
|
|
51864
|
-
}
|
|
51865
|
-
});
|
|
51866
51953
|
owl.onPatched(() => {
|
|
51867
51954
|
if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
|
|
51868
51955
|
this.editionState = "editing";
|
|
51869
51956
|
this.focusInputAndSelectContent();
|
|
51870
51957
|
}
|
|
51871
51958
|
});
|
|
51959
|
+
owl.useEffect((sheetId) => {
|
|
51960
|
+
if (this.props.sheetId === sheetId) {
|
|
51961
|
+
this.scrollToSheet();
|
|
51962
|
+
}
|
|
51963
|
+
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
51872
51964
|
}
|
|
51873
51965
|
focusInputAndSelectContent() {
|
|
51874
51966
|
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
@@ -51880,7 +51972,10 @@ class BottomBarSheet extends owl.Component {
|
|
|
51880
51972
|
}
|
|
51881
51973
|
}
|
|
51882
51974
|
scrollToSheet() {
|
|
51883
|
-
this.sheetDivRef.el?.scrollIntoView?.(
|
|
51975
|
+
this.sheetDivRef.el?.scrollIntoView?.({
|
|
51976
|
+
behavior: "smooth",
|
|
51977
|
+
inline: "nearest",
|
|
51978
|
+
});
|
|
51884
51979
|
}
|
|
51885
51980
|
onFocusOut() {
|
|
51886
51981
|
if (this.state.isEditing && this.editionState !== "initializing") {
|
|
@@ -57631,6 +57726,8 @@ const helpers = {
|
|
|
57631
57726
|
createActions,
|
|
57632
57727
|
transformRangeData,
|
|
57633
57728
|
deepEquals,
|
|
57729
|
+
isNumber,
|
|
57730
|
+
isDateTime,
|
|
57634
57731
|
};
|
|
57635
57732
|
const links = {
|
|
57636
57733
|
isMarkdownLink,
|
|
@@ -57709,6 +57806,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
57709
57806
|
exports.tokenize = tokenize;
|
|
57710
57807
|
|
|
57711
57808
|
|
|
57712
|
-
__info__.version = "17.0.
|
|
57713
|
-
__info__.date = "
|
|
57714
|
-
__info__.hash = "
|
|
57809
|
+
__info__.version = "17.0.46";
|
|
57810
|
+
__info__.date = "2025-01-27T10:00:20.499Z";
|
|
57811
|
+
__info__.hash = "1df062c";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -968,6 +968,7 @@ declare class DateTime {
|
|
|
968
968
|
setMinutes(minutes: number): number;
|
|
969
969
|
setSeconds(seconds: number): number;
|
|
970
970
|
}
|
|
971
|
+
declare function isDateTime(str: string, locale: Locale): boolean;
|
|
971
972
|
|
|
972
973
|
/**
|
|
973
974
|
* Formats a cell value with its format.
|
|
@@ -998,6 +999,13 @@ declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
|
|
|
998
999
|
*/
|
|
999
1000
|
declare function deepEquals(o1: any, o2: any): boolean;
|
|
1000
1001
|
|
|
1002
|
+
/**
|
|
1003
|
+
* Return true if the argument is a "number string".
|
|
1004
|
+
*
|
|
1005
|
+
* Note that "" (empty string) does not count as a number string
|
|
1006
|
+
*/
|
|
1007
|
+
declare function isNumber(value: string | undefined, locale: Locale): boolean;
|
|
1008
|
+
|
|
1001
1009
|
interface ConstructorArgs {
|
|
1002
1010
|
readonly zone: Readonly<Zone | UnboundedZone>;
|
|
1003
1011
|
readonly parts: readonly RangePart[];
|
|
@@ -3375,6 +3383,10 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
|
|
|
3375
3383
|
* Remove the borders of a zone
|
|
3376
3384
|
*/
|
|
3377
3385
|
private clearBorders;
|
|
3386
|
+
/**
|
|
3387
|
+
* Remove the borders inside of a zone
|
|
3388
|
+
*/
|
|
3389
|
+
private clearInsideBorders;
|
|
3378
3390
|
/**
|
|
3379
3391
|
* Add a border to the existing one to a cell
|
|
3380
3392
|
*/
|
|
@@ -4598,6 +4610,7 @@ declare class RendererPlugin extends UIPlugin {
|
|
|
4598
4610
|
*/
|
|
4599
4611
|
private getHeaderOffset;
|
|
4600
4612
|
drawGrid(renderingContext: GridRenderingContext, layer: LAYERS): void;
|
|
4613
|
+
private drawGlobalBackground;
|
|
4601
4614
|
private drawBackground;
|
|
4602
4615
|
private drawCellBackground;
|
|
4603
4616
|
private drawOverflowingCellBackground;
|
|
@@ -5070,7 +5083,8 @@ declare class InternalViewport {
|
|
|
5070
5083
|
* @param zone
|
|
5071
5084
|
* @returns Computes the absolute coordinate of a given zone inside the viewport
|
|
5072
5085
|
*/
|
|
5073
|
-
|
|
5086
|
+
getVisibleRect(zone: Zone): Rect | undefined;
|
|
5087
|
+
getFullRect(zone: Zone): Rect | undefined;
|
|
5074
5088
|
isVisible(col: HeaderIndex, row: HeaderIndex): boolean;
|
|
5075
5089
|
private searchHeaderIndex;
|
|
5076
5090
|
private get zone();
|
|
@@ -5140,7 +5154,7 @@ type SheetViewports = {
|
|
|
5140
5154
|
*
|
|
5141
5155
|
*/
|
|
5142
5156
|
declare class SheetViewPlugin extends UIPlugin {
|
|
5143
|
-
static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
|
|
5157
|
+
static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible", "getAllActiveViewportsZones", "getRect"];
|
|
5144
5158
|
readonly viewports: Record<UID, SheetViewports | undefined>;
|
|
5145
5159
|
/**
|
|
5146
5160
|
* The viewport dimensions are usually set by one of the components
|
|
@@ -5211,12 +5225,18 @@ declare class SheetViewPlugin extends UIPlugin {
|
|
|
5211
5225
|
* Computes the coordinates and size to draw the zone without taking the grid offset into account
|
|
5212
5226
|
*/
|
|
5213
5227
|
getVisibleRectWithoutHeaders(zone: Zone): Rect;
|
|
5228
|
+
/**
|
|
5229
|
+
* Computes the actual size and position (:Rect) of the zone on the canvas
|
|
5230
|
+
* regardless of the viewport dimensions.
|
|
5231
|
+
*/
|
|
5232
|
+
getRect(zone: Zone): Rect;
|
|
5214
5233
|
/**
|
|
5215
5234
|
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
5216
5235
|
* It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
|
|
5217
5236
|
* situated before the pane divisions.
|
|
5218
5237
|
*/
|
|
5219
5238
|
getMainViewportCoordinates(): DOMCoordinates;
|
|
5239
|
+
getAllActiveViewportsZones(): Zone[];
|
|
5220
5240
|
private ensureMainViewportExist;
|
|
5221
5241
|
private getSubViewports;
|
|
5222
5242
|
private checkPositiveDimension;
|
|
@@ -5247,6 +5267,7 @@ declare class SheetViewPlugin extends UIPlugin {
|
|
|
5247
5267
|
xRatio: number;
|
|
5248
5268
|
yRatio: number;
|
|
5249
5269
|
};
|
|
5270
|
+
private recomposeRect;
|
|
5250
5271
|
}
|
|
5251
5272
|
|
|
5252
5273
|
/**
|
|
@@ -7956,6 +7977,8 @@ declare const helpers: {
|
|
|
7956
7977
|
createActions: typeof createActions;
|
|
7957
7978
|
transformRangeData: typeof transformRangeData;
|
|
7958
7979
|
deepEquals: typeof deepEquals;
|
|
7980
|
+
isNumber: typeof isNumber;
|
|
7981
|
+
isDateTime: typeof isDateTime;
|
|
7959
7982
|
};
|
|
7960
7983
|
declare const links: {
|
|
7961
7984
|
isMarkdownLink: typeof isMarkdownLink;
|