@odoo/o-spreadsheet 18.1.15 → 18.1.17
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 +110 -55
- package/dist/o-spreadsheet.d.ts +2 -1
- package/dist/o-spreadsheet.esm.js +110 -55
- package/dist/o-spreadsheet.iife.js +110 -55
- package/dist/o-spreadsheet.iife.min.js +366 -366
- package/dist/o_spreadsheet.xml +39 -38
- package/package.json +1 -1
|
@@ -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 18.1.
|
|
6
|
-
* @date 2025-04-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.17
|
|
6
|
+
* @date 2025-04-25T08:08:46.599Z
|
|
7
|
+
* @hash a63687f
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -3834,11 +3834,13 @@ const CellErrorType = {
|
|
|
3834
3834
|
NullError: "#NULL!",
|
|
3835
3835
|
};
|
|
3836
3836
|
const errorTypes = new Set(Object.values(CellErrorType));
|
|
3837
|
-
class EvaluationError
|
|
3837
|
+
class EvaluationError {
|
|
3838
|
+
message;
|
|
3838
3839
|
value;
|
|
3839
3840
|
constructor(message = _t("Error"), value = CellErrorType.GenericError) {
|
|
3840
|
-
|
|
3841
|
+
this.message = message;
|
|
3841
3842
|
this.value = value;
|
|
3843
|
+
this.message = message.toString();
|
|
3842
3844
|
}
|
|
3843
3845
|
}
|
|
3844
3846
|
class BadExpressionError extends EvaluationError {
|
|
@@ -6891,6 +6893,12 @@ function tokenizeString(chars) {
|
|
|
6891
6893
|
}
|
|
6892
6894
|
return null;
|
|
6893
6895
|
}
|
|
6896
|
+
/**
|
|
6897
|
+
- \p{L} is for any letter (from any language)
|
|
6898
|
+
- \p{N} is for any number
|
|
6899
|
+
- the u flag at the end is for unicode, which enables the `\p{...}` syntax
|
|
6900
|
+
*/
|
|
6901
|
+
const unicodeSymbolCharRegexp = /\p{L}|\p{N}|_|\.|!|\$/u;
|
|
6894
6902
|
const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
|
|
6895
6903
|
/**
|
|
6896
6904
|
* A "Symbol" is just basically any word-like element that can appear in a
|
|
@@ -6931,7 +6939,8 @@ function tokenizeSymbol(chars) {
|
|
|
6931
6939
|
};
|
|
6932
6940
|
}
|
|
6933
6941
|
}
|
|
6934
|
-
while (chars.current &&
|
|
6942
|
+
while (chars.current &&
|
|
6943
|
+
(SYMBOL_CHARS.has(chars.current) || chars.current.match(unicodeSymbolCharRegexp))) {
|
|
6935
6944
|
result += chars.shift();
|
|
6936
6945
|
}
|
|
6937
6946
|
if (result.length) {
|
|
@@ -9237,7 +9246,7 @@ function transformZone(zone, executed) {
|
|
|
9237
9246
|
if (executed.type === "ADD_COLUMNS_ROWS") {
|
|
9238
9247
|
return expandZoneOnInsertion(zone, executed.dimension === "COL" ? "left" : "top", executed.base, executed.position, executed.quantity);
|
|
9239
9248
|
}
|
|
9240
|
-
return
|
|
9249
|
+
return zone;
|
|
9241
9250
|
}
|
|
9242
9251
|
function transformRangeData(range, executed) {
|
|
9243
9252
|
const deletedSheet = executed.type === "DELETE_SHEET" && executed.sheetId;
|
|
@@ -13572,7 +13581,7 @@ const RANK = {
|
|
|
13572
13581
|
}
|
|
13573
13582
|
}
|
|
13574
13583
|
if (!found) {
|
|
13575
|
-
|
|
13584
|
+
return new NotAvailableError(_t("Value not found in the given data."));
|
|
13576
13585
|
}
|
|
13577
13586
|
return rank;
|
|
13578
13587
|
},
|
|
@@ -15312,7 +15321,7 @@ const UNIQUE = {
|
|
|
15312
15321
|
result.push(row.data);
|
|
15313
15322
|
}
|
|
15314
15323
|
if (!result.length)
|
|
15315
|
-
|
|
15324
|
+
return new EvaluationError(_t("No unique values found"));
|
|
15316
15325
|
return _byColumn ? result : transposeMatrix(result);
|
|
15317
15326
|
},
|
|
15318
15327
|
isExported: true,
|
|
@@ -19091,7 +19100,7 @@ const OFFSET = {
|
|
|
19091
19100
|
}
|
|
19092
19101
|
const _cellReference = cellReference?.value;
|
|
19093
19102
|
if (!_cellReference) {
|
|
19094
|
-
|
|
19103
|
+
return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
|
|
19095
19104
|
}
|
|
19096
19105
|
const zone = toZone(_cellReference);
|
|
19097
19106
|
let offsetHeight = zone.bottom - zone.top + 1;
|
|
@@ -38554,7 +38563,7 @@ class ColorPicker extends owl.Component {
|
|
|
38554
38563
|
}
|
|
38555
38564
|
setHexColor(ev) {
|
|
38556
38565
|
// only support HEX code input
|
|
38557
|
-
const val = ev.target.value.slice(0, 7);
|
|
38566
|
+
const val = ev.target.value.replace("##", "#").slice(0, 7);
|
|
38558
38567
|
this.state.customHexColor = val;
|
|
38559
38568
|
if (!isColorValid(val)) ;
|
|
38560
38569
|
else {
|
|
@@ -50107,39 +50116,6 @@ function useCellHovered(env, gridRef, callback) {
|
|
|
50107
50116
|
}
|
|
50108
50117
|
return hoveredPosition;
|
|
50109
50118
|
}
|
|
50110
|
-
function useTouchMove(gridRef, handler, canMoveUp) {
|
|
50111
|
-
let x = null;
|
|
50112
|
-
let y = null;
|
|
50113
|
-
function onTouchStart(ev) {
|
|
50114
|
-
if (ev.touches.length !== 1)
|
|
50115
|
-
return;
|
|
50116
|
-
x = ev.touches[0].clientX;
|
|
50117
|
-
y = ev.touches[0].clientY;
|
|
50118
|
-
}
|
|
50119
|
-
function onTouchEnd() {
|
|
50120
|
-
x = null;
|
|
50121
|
-
y = null;
|
|
50122
|
-
}
|
|
50123
|
-
function onTouchMove(ev) {
|
|
50124
|
-
if (ev.touches.length !== 1)
|
|
50125
|
-
return;
|
|
50126
|
-
// On mobile browsers, swiping down is often associated with "pull to refresh".
|
|
50127
|
-
// We only want this behavior if the grid is already at the top.
|
|
50128
|
-
// Otherwise we only want to move the canvas up, without triggering any refresh.
|
|
50129
|
-
if (canMoveUp()) {
|
|
50130
|
-
ev.preventDefault();
|
|
50131
|
-
ev.stopPropagation();
|
|
50132
|
-
}
|
|
50133
|
-
const currentX = ev.touches[0].clientX;
|
|
50134
|
-
const currentY = ev.touches[0].clientY;
|
|
50135
|
-
handler(x - currentX, y - currentY);
|
|
50136
|
-
x = currentX;
|
|
50137
|
-
y = currentY;
|
|
50138
|
-
}
|
|
50139
|
-
useRefListener(gridRef, "touchstart", onTouchStart);
|
|
50140
|
-
useRefListener(gridRef, "touchend", onTouchEnd);
|
|
50141
|
-
useRefListener(gridRef, "touchmove", onTouchMove);
|
|
50142
|
-
}
|
|
50143
50119
|
class GridOverlay extends owl.Component {
|
|
50144
50120
|
static template = "o-spreadsheet-GridOverlay";
|
|
50145
50121
|
static props = {
|
|
@@ -50187,10 +50163,6 @@ class GridOverlay extends owl.Component {
|
|
|
50187
50163
|
owl.onWillUnmount(() => {
|
|
50188
50164
|
resizeObserver.disconnect();
|
|
50189
50165
|
});
|
|
50190
|
-
useTouchMove(this.gridOverlay, this.props.onGridMoved, () => {
|
|
50191
|
-
const { scrollY } = this.env.model.getters.getActiveSheetDOMScrollInfo();
|
|
50192
|
-
return scrollY > 0;
|
|
50193
|
-
});
|
|
50194
50166
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
50195
50167
|
this.paintFormatStore = useStore(PaintFormatStore);
|
|
50196
50168
|
}
|
|
@@ -51548,6 +51520,73 @@ function useGridDrawing(refName, model, canvasSize) {
|
|
|
51548
51520
|
}
|
|
51549
51521
|
}
|
|
51550
51522
|
|
|
51523
|
+
const friction = 0.95;
|
|
51524
|
+
const verticalScrollFactor = 1;
|
|
51525
|
+
const horizontalScrollFactor = 1;
|
|
51526
|
+
function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
51527
|
+
let lastX = 0;
|
|
51528
|
+
let lastY = 0;
|
|
51529
|
+
let velocityX = 0;
|
|
51530
|
+
let velocityY = 0;
|
|
51531
|
+
let isMouseDown = false;
|
|
51532
|
+
let lastTime = 0;
|
|
51533
|
+
useRefListener(ref, "touchstart", onTouchStart, { capture: false });
|
|
51534
|
+
useRefListener(ref, "touchmove", onTouchMove, { capture: false });
|
|
51535
|
+
useRefListener(ref, "touchend", onTouchEnd, { capture: false });
|
|
51536
|
+
function onTouchStart(event) {
|
|
51537
|
+
isMouseDown = true;
|
|
51538
|
+
({ clientX: lastX, clientY: lastY } = event.touches[0]);
|
|
51539
|
+
velocityX = 0;
|
|
51540
|
+
velocityY = 0;
|
|
51541
|
+
}
|
|
51542
|
+
function onTouchMove(event) {
|
|
51543
|
+
if (!isMouseDown)
|
|
51544
|
+
return;
|
|
51545
|
+
const currentTime = Date.now();
|
|
51546
|
+
const { clientX, clientY } = event.touches[0];
|
|
51547
|
+
let deltaX = lastX - clientX;
|
|
51548
|
+
let deltaY = lastY - clientY;
|
|
51549
|
+
const elapsedTime = currentTime - lastTime;
|
|
51550
|
+
velocityX = deltaX / elapsedTime;
|
|
51551
|
+
velocityY = deltaY / elapsedTime;
|
|
51552
|
+
lastX = clientX;
|
|
51553
|
+
lastY = clientY;
|
|
51554
|
+
lastTime = currentTime;
|
|
51555
|
+
if (canMoveUp()) {
|
|
51556
|
+
if (event.cancelable) {
|
|
51557
|
+
event.preventDefault();
|
|
51558
|
+
}
|
|
51559
|
+
event.stopPropagation();
|
|
51560
|
+
}
|
|
51561
|
+
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
51562
|
+
}
|
|
51563
|
+
function onTouchEnd(ev) {
|
|
51564
|
+
isMouseDown = false;
|
|
51565
|
+
lastX = lastY = 0;
|
|
51566
|
+
requestAnimationFrame(scroll);
|
|
51567
|
+
}
|
|
51568
|
+
function scroll() {
|
|
51569
|
+
if (Math.abs(velocityX) < 0.05) {
|
|
51570
|
+
velocityX = 0;
|
|
51571
|
+
}
|
|
51572
|
+
if (Math.abs(velocityY) < 0.05) {
|
|
51573
|
+
velocityY = 0;
|
|
51574
|
+
}
|
|
51575
|
+
if (!velocityX && !velocityY) {
|
|
51576
|
+
return;
|
|
51577
|
+
}
|
|
51578
|
+
const currentTime = Date.now();
|
|
51579
|
+
const elapsedTime = Math.abs(currentTime - lastTime);
|
|
51580
|
+
const deltaX = velocityX * elapsedTime;
|
|
51581
|
+
const deltaY = velocityY * elapsedTime;
|
|
51582
|
+
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
51583
|
+
lastTime = currentTime;
|
|
51584
|
+
velocityX *= friction;
|
|
51585
|
+
velocityY *= friction;
|
|
51586
|
+
requestAnimationFrame(scroll);
|
|
51587
|
+
}
|
|
51588
|
+
}
|
|
51589
|
+
|
|
51551
51590
|
function useWheelHandler(handler) {
|
|
51552
51591
|
function normalize(val, deltaMode) {
|
|
51553
51592
|
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
@@ -52168,6 +52207,10 @@ class Grid extends owl.Component {
|
|
|
52168
52207
|
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
52169
52208
|
}
|
|
52170
52209
|
}, () => [this.sidePanel.isOpen]);
|
|
52210
|
+
useTouchScroll(this.gridRef, this.moveCanvas.bind(this), () => {
|
|
52211
|
+
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
52212
|
+
return scrollY > 0;
|
|
52213
|
+
});
|
|
52171
52214
|
}
|
|
52172
52215
|
onCellHovered({ col, row }) {
|
|
52173
52216
|
this.hoveredCell.hover({ col, row });
|
|
@@ -61832,6 +61875,16 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
61832
61875
|
}
|
|
61833
61876
|
return values;
|
|
61834
61877
|
}
|
|
61878
|
+
else if (rowDomain.length === this.definition.rows.length &&
|
|
61879
|
+
colDomain.length &&
|
|
61880
|
+
colDomain.length < this.definition.columns.length) {
|
|
61881
|
+
const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
|
|
61882
|
+
const domains = this.treeToLeafDomains(colSubTree, colDomain);
|
|
61883
|
+
for (const domain of domains) {
|
|
61884
|
+
values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
|
|
61885
|
+
}
|
|
61886
|
+
return values;
|
|
61887
|
+
}
|
|
61835
61888
|
else {
|
|
61836
61889
|
const tree = table.getRowTree();
|
|
61837
61890
|
const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
|
|
@@ -63377,10 +63430,8 @@ function mergeTransformation(toTransform, executed) {
|
|
|
63377
63430
|
}
|
|
63378
63431
|
const target = [];
|
|
63379
63432
|
for (const zone1 of toTransform.target) {
|
|
63380
|
-
|
|
63381
|
-
|
|
63382
|
-
target.push({ ...zone1 });
|
|
63383
|
-
}
|
|
63433
|
+
if (executed.target.every((zone2) => !overlap(zone1, zone2))) {
|
|
63434
|
+
target.push(zone1);
|
|
63384
63435
|
}
|
|
63385
63436
|
}
|
|
63386
63437
|
if (target.length) {
|
|
@@ -69652,6 +69703,10 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
69652
69703
|
this.hoveredCell.clear();
|
|
69653
69704
|
});
|
|
69654
69705
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
69706
|
+
useTouchScroll(gridRef, this.moveCanvas.bind(this), () => {
|
|
69707
|
+
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
69708
|
+
return scrollY > 0;
|
|
69709
|
+
});
|
|
69655
69710
|
}
|
|
69656
69711
|
onCellHovered({ col, row }) {
|
|
69657
69712
|
this.hoveredCell.hover({ col, row });
|
|
@@ -75726,6 +75781,6 @@ exports.tokenColors = tokenColors;
|
|
|
75726
75781
|
exports.tokenize = tokenize;
|
|
75727
75782
|
|
|
75728
75783
|
|
|
75729
|
-
__info__.version = "18.1.
|
|
75730
|
-
__info__.date = "2025-04-
|
|
75731
|
-
__info__.hash = "
|
|
75784
|
+
__info__.version = "18.1.17";
|
|
75785
|
+
__info__.date = "2025-04-25T08:08:46.599Z";
|
|
75786
|
+
__info__.hash = "a63687f";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -11522,7 +11522,8 @@ declare const CellErrorType: {
|
|
|
11522
11522
|
readonly GenericError: "#ERROR";
|
|
11523
11523
|
readonly NullError: "#NULL!";
|
|
11524
11524
|
};
|
|
11525
|
-
declare class EvaluationError
|
|
11525
|
+
declare class EvaluationError {
|
|
11526
|
+
readonly message: string;
|
|
11526
11527
|
readonly value: string;
|
|
11527
11528
|
constructor(message?: string, value?: string);
|
|
11528
11529
|
}
|
|
@@ -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 18.1.
|
|
6
|
-
* @date 2025-04-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.17
|
|
6
|
+
* @date 2025-04-25T08:08:46.599Z
|
|
7
|
+
* @hash a63687f
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -3832,11 +3832,13 @@ const CellErrorType = {
|
|
|
3832
3832
|
NullError: "#NULL!",
|
|
3833
3833
|
};
|
|
3834
3834
|
const errorTypes = new Set(Object.values(CellErrorType));
|
|
3835
|
-
class EvaluationError
|
|
3835
|
+
class EvaluationError {
|
|
3836
|
+
message;
|
|
3836
3837
|
value;
|
|
3837
3838
|
constructor(message = _t("Error"), value = CellErrorType.GenericError) {
|
|
3838
|
-
|
|
3839
|
+
this.message = message;
|
|
3839
3840
|
this.value = value;
|
|
3841
|
+
this.message = message.toString();
|
|
3840
3842
|
}
|
|
3841
3843
|
}
|
|
3842
3844
|
class BadExpressionError extends EvaluationError {
|
|
@@ -6889,6 +6891,12 @@ function tokenizeString(chars) {
|
|
|
6889
6891
|
}
|
|
6890
6892
|
return null;
|
|
6891
6893
|
}
|
|
6894
|
+
/**
|
|
6895
|
+
- \p{L} is for any letter (from any language)
|
|
6896
|
+
- \p{N} is for any number
|
|
6897
|
+
- the u flag at the end is for unicode, which enables the `\p{...}` syntax
|
|
6898
|
+
*/
|
|
6899
|
+
const unicodeSymbolCharRegexp = /\p{L}|\p{N}|_|\.|!|\$/u;
|
|
6892
6900
|
const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
|
|
6893
6901
|
/**
|
|
6894
6902
|
* A "Symbol" is just basically any word-like element that can appear in a
|
|
@@ -6929,7 +6937,8 @@ function tokenizeSymbol(chars) {
|
|
|
6929
6937
|
};
|
|
6930
6938
|
}
|
|
6931
6939
|
}
|
|
6932
|
-
while (chars.current &&
|
|
6940
|
+
while (chars.current &&
|
|
6941
|
+
(SYMBOL_CHARS.has(chars.current) || chars.current.match(unicodeSymbolCharRegexp))) {
|
|
6933
6942
|
result += chars.shift();
|
|
6934
6943
|
}
|
|
6935
6944
|
if (result.length) {
|
|
@@ -9235,7 +9244,7 @@ function transformZone(zone, executed) {
|
|
|
9235
9244
|
if (executed.type === "ADD_COLUMNS_ROWS") {
|
|
9236
9245
|
return expandZoneOnInsertion(zone, executed.dimension === "COL" ? "left" : "top", executed.base, executed.position, executed.quantity);
|
|
9237
9246
|
}
|
|
9238
|
-
return
|
|
9247
|
+
return zone;
|
|
9239
9248
|
}
|
|
9240
9249
|
function transformRangeData(range, executed) {
|
|
9241
9250
|
const deletedSheet = executed.type === "DELETE_SHEET" && executed.sheetId;
|
|
@@ -13570,7 +13579,7 @@ const RANK = {
|
|
|
13570
13579
|
}
|
|
13571
13580
|
}
|
|
13572
13581
|
if (!found) {
|
|
13573
|
-
|
|
13582
|
+
return new NotAvailableError(_t("Value not found in the given data."));
|
|
13574
13583
|
}
|
|
13575
13584
|
return rank;
|
|
13576
13585
|
},
|
|
@@ -15310,7 +15319,7 @@ const UNIQUE = {
|
|
|
15310
15319
|
result.push(row.data);
|
|
15311
15320
|
}
|
|
15312
15321
|
if (!result.length)
|
|
15313
|
-
|
|
15322
|
+
return new EvaluationError(_t("No unique values found"));
|
|
15314
15323
|
return _byColumn ? result : transposeMatrix(result);
|
|
15315
15324
|
},
|
|
15316
15325
|
isExported: true,
|
|
@@ -19089,7 +19098,7 @@ const OFFSET = {
|
|
|
19089
19098
|
}
|
|
19090
19099
|
const _cellReference = cellReference?.value;
|
|
19091
19100
|
if (!_cellReference) {
|
|
19092
|
-
|
|
19101
|
+
return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
|
|
19093
19102
|
}
|
|
19094
19103
|
const zone = toZone(_cellReference);
|
|
19095
19104
|
let offsetHeight = zone.bottom - zone.top + 1;
|
|
@@ -38552,7 +38561,7 @@ class ColorPicker extends Component {
|
|
|
38552
38561
|
}
|
|
38553
38562
|
setHexColor(ev) {
|
|
38554
38563
|
// only support HEX code input
|
|
38555
|
-
const val = ev.target.value.slice(0, 7);
|
|
38564
|
+
const val = ev.target.value.replace("##", "#").slice(0, 7);
|
|
38556
38565
|
this.state.customHexColor = val;
|
|
38557
38566
|
if (!isColorValid(val)) ;
|
|
38558
38567
|
else {
|
|
@@ -50105,39 +50114,6 @@ function useCellHovered(env, gridRef, callback) {
|
|
|
50105
50114
|
}
|
|
50106
50115
|
return hoveredPosition;
|
|
50107
50116
|
}
|
|
50108
|
-
function useTouchMove(gridRef, handler, canMoveUp) {
|
|
50109
|
-
let x = null;
|
|
50110
|
-
let y = null;
|
|
50111
|
-
function onTouchStart(ev) {
|
|
50112
|
-
if (ev.touches.length !== 1)
|
|
50113
|
-
return;
|
|
50114
|
-
x = ev.touches[0].clientX;
|
|
50115
|
-
y = ev.touches[0].clientY;
|
|
50116
|
-
}
|
|
50117
|
-
function onTouchEnd() {
|
|
50118
|
-
x = null;
|
|
50119
|
-
y = null;
|
|
50120
|
-
}
|
|
50121
|
-
function onTouchMove(ev) {
|
|
50122
|
-
if (ev.touches.length !== 1)
|
|
50123
|
-
return;
|
|
50124
|
-
// On mobile browsers, swiping down is often associated with "pull to refresh".
|
|
50125
|
-
// We only want this behavior if the grid is already at the top.
|
|
50126
|
-
// Otherwise we only want to move the canvas up, without triggering any refresh.
|
|
50127
|
-
if (canMoveUp()) {
|
|
50128
|
-
ev.preventDefault();
|
|
50129
|
-
ev.stopPropagation();
|
|
50130
|
-
}
|
|
50131
|
-
const currentX = ev.touches[0].clientX;
|
|
50132
|
-
const currentY = ev.touches[0].clientY;
|
|
50133
|
-
handler(x - currentX, y - currentY);
|
|
50134
|
-
x = currentX;
|
|
50135
|
-
y = currentY;
|
|
50136
|
-
}
|
|
50137
|
-
useRefListener(gridRef, "touchstart", onTouchStart);
|
|
50138
|
-
useRefListener(gridRef, "touchend", onTouchEnd);
|
|
50139
|
-
useRefListener(gridRef, "touchmove", onTouchMove);
|
|
50140
|
-
}
|
|
50141
50117
|
class GridOverlay extends Component {
|
|
50142
50118
|
static template = "o-spreadsheet-GridOverlay";
|
|
50143
50119
|
static props = {
|
|
@@ -50185,10 +50161,6 @@ class GridOverlay extends Component {
|
|
|
50185
50161
|
onWillUnmount(() => {
|
|
50186
50162
|
resizeObserver.disconnect();
|
|
50187
50163
|
});
|
|
50188
|
-
useTouchMove(this.gridOverlay, this.props.onGridMoved, () => {
|
|
50189
|
-
const { scrollY } = this.env.model.getters.getActiveSheetDOMScrollInfo();
|
|
50190
|
-
return scrollY > 0;
|
|
50191
|
-
});
|
|
50192
50164
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
50193
50165
|
this.paintFormatStore = useStore(PaintFormatStore);
|
|
50194
50166
|
}
|
|
@@ -51546,6 +51518,73 @@ function useGridDrawing(refName, model, canvasSize) {
|
|
|
51546
51518
|
}
|
|
51547
51519
|
}
|
|
51548
51520
|
|
|
51521
|
+
const friction = 0.95;
|
|
51522
|
+
const verticalScrollFactor = 1;
|
|
51523
|
+
const horizontalScrollFactor = 1;
|
|
51524
|
+
function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
51525
|
+
let lastX = 0;
|
|
51526
|
+
let lastY = 0;
|
|
51527
|
+
let velocityX = 0;
|
|
51528
|
+
let velocityY = 0;
|
|
51529
|
+
let isMouseDown = false;
|
|
51530
|
+
let lastTime = 0;
|
|
51531
|
+
useRefListener(ref, "touchstart", onTouchStart, { capture: false });
|
|
51532
|
+
useRefListener(ref, "touchmove", onTouchMove, { capture: false });
|
|
51533
|
+
useRefListener(ref, "touchend", onTouchEnd, { capture: false });
|
|
51534
|
+
function onTouchStart(event) {
|
|
51535
|
+
isMouseDown = true;
|
|
51536
|
+
({ clientX: lastX, clientY: lastY } = event.touches[0]);
|
|
51537
|
+
velocityX = 0;
|
|
51538
|
+
velocityY = 0;
|
|
51539
|
+
}
|
|
51540
|
+
function onTouchMove(event) {
|
|
51541
|
+
if (!isMouseDown)
|
|
51542
|
+
return;
|
|
51543
|
+
const currentTime = Date.now();
|
|
51544
|
+
const { clientX, clientY } = event.touches[0];
|
|
51545
|
+
let deltaX = lastX - clientX;
|
|
51546
|
+
let deltaY = lastY - clientY;
|
|
51547
|
+
const elapsedTime = currentTime - lastTime;
|
|
51548
|
+
velocityX = deltaX / elapsedTime;
|
|
51549
|
+
velocityY = deltaY / elapsedTime;
|
|
51550
|
+
lastX = clientX;
|
|
51551
|
+
lastY = clientY;
|
|
51552
|
+
lastTime = currentTime;
|
|
51553
|
+
if (canMoveUp()) {
|
|
51554
|
+
if (event.cancelable) {
|
|
51555
|
+
event.preventDefault();
|
|
51556
|
+
}
|
|
51557
|
+
event.stopPropagation();
|
|
51558
|
+
}
|
|
51559
|
+
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
51560
|
+
}
|
|
51561
|
+
function onTouchEnd(ev) {
|
|
51562
|
+
isMouseDown = false;
|
|
51563
|
+
lastX = lastY = 0;
|
|
51564
|
+
requestAnimationFrame(scroll);
|
|
51565
|
+
}
|
|
51566
|
+
function scroll() {
|
|
51567
|
+
if (Math.abs(velocityX) < 0.05) {
|
|
51568
|
+
velocityX = 0;
|
|
51569
|
+
}
|
|
51570
|
+
if (Math.abs(velocityY) < 0.05) {
|
|
51571
|
+
velocityY = 0;
|
|
51572
|
+
}
|
|
51573
|
+
if (!velocityX && !velocityY) {
|
|
51574
|
+
return;
|
|
51575
|
+
}
|
|
51576
|
+
const currentTime = Date.now();
|
|
51577
|
+
const elapsedTime = Math.abs(currentTime - lastTime);
|
|
51578
|
+
const deltaX = velocityX * elapsedTime;
|
|
51579
|
+
const deltaY = velocityY * elapsedTime;
|
|
51580
|
+
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
51581
|
+
lastTime = currentTime;
|
|
51582
|
+
velocityX *= friction;
|
|
51583
|
+
velocityY *= friction;
|
|
51584
|
+
requestAnimationFrame(scroll);
|
|
51585
|
+
}
|
|
51586
|
+
}
|
|
51587
|
+
|
|
51549
51588
|
function useWheelHandler(handler) {
|
|
51550
51589
|
function normalize(val, deltaMode) {
|
|
51551
51590
|
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
@@ -52166,6 +52205,10 @@ class Grid extends Component {
|
|
|
52166
52205
|
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
52167
52206
|
}
|
|
52168
52207
|
}, () => [this.sidePanel.isOpen]);
|
|
52208
|
+
useTouchScroll(this.gridRef, this.moveCanvas.bind(this), () => {
|
|
52209
|
+
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
52210
|
+
return scrollY > 0;
|
|
52211
|
+
});
|
|
52169
52212
|
}
|
|
52170
52213
|
onCellHovered({ col, row }) {
|
|
52171
52214
|
this.hoveredCell.hover({ col, row });
|
|
@@ -61830,6 +61873,16 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
61830
61873
|
}
|
|
61831
61874
|
return values;
|
|
61832
61875
|
}
|
|
61876
|
+
else if (rowDomain.length === this.definition.rows.length &&
|
|
61877
|
+
colDomain.length &&
|
|
61878
|
+
colDomain.length < this.definition.columns.length) {
|
|
61879
|
+
const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
|
|
61880
|
+
const domains = this.treeToLeafDomains(colSubTree, colDomain);
|
|
61881
|
+
for (const domain of domains) {
|
|
61882
|
+
values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
|
|
61883
|
+
}
|
|
61884
|
+
return values;
|
|
61885
|
+
}
|
|
61833
61886
|
else {
|
|
61834
61887
|
const tree = table.getRowTree();
|
|
61835
61888
|
const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
|
|
@@ -63375,10 +63428,8 @@ function mergeTransformation(toTransform, executed) {
|
|
|
63375
63428
|
}
|
|
63376
63429
|
const target = [];
|
|
63377
63430
|
for (const zone1 of toTransform.target) {
|
|
63378
|
-
|
|
63379
|
-
|
|
63380
|
-
target.push({ ...zone1 });
|
|
63381
|
-
}
|
|
63431
|
+
if (executed.target.every((zone2) => !overlap(zone1, zone2))) {
|
|
63432
|
+
target.push(zone1);
|
|
63382
63433
|
}
|
|
63383
63434
|
}
|
|
63384
63435
|
if (target.length) {
|
|
@@ -69650,6 +69701,10 @@ class SpreadsheetDashboard extends Component {
|
|
|
69650
69701
|
this.hoveredCell.clear();
|
|
69651
69702
|
});
|
|
69652
69703
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
69704
|
+
useTouchScroll(gridRef, this.moveCanvas.bind(this), () => {
|
|
69705
|
+
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
69706
|
+
return scrollY > 0;
|
|
69707
|
+
});
|
|
69653
69708
|
}
|
|
69654
69709
|
onCellHovered({ col, row }) {
|
|
69655
69710
|
this.hoveredCell.hover({ col, row });
|
|
@@ -75680,6 +75735,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
75680
75735
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
75681
75736
|
|
|
75682
75737
|
|
|
75683
|
-
__info__.version = "18.1.
|
|
75684
|
-
__info__.date = "2025-04-
|
|
75685
|
-
__info__.hash = "
|
|
75738
|
+
__info__.version = "18.1.17";
|
|
75739
|
+
__info__.date = "2025-04-25T08:08:46.599Z";
|
|
75740
|
+
__info__.hash = "a63687f";
|