@odoo/o-spreadsheet 18.0.22 → 18.0.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 +244 -120
- package/dist/o-spreadsheet.d.ts +33 -16
- package/dist/o-spreadsheet.esm.js +244 -120
- package/dist/o-spreadsheet.iife.js +244 -120
- package/dist/o-spreadsheet.iife.min.js +351 -351
- package/dist/o_spreadsheet.xml +4 -4
- 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.0.
|
|
6
|
-
* @date 2025-04-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.24
|
|
6
|
+
* @date 2025-04-18T16:23:09.320Z
|
|
7
|
+
* @hash aa18758
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -3396,6 +3396,7 @@
|
|
|
3396
3396
|
"CLEAR_FORMATTING",
|
|
3397
3397
|
"SET_BORDER",
|
|
3398
3398
|
"SET_ZONE_BORDERS",
|
|
3399
|
+
"SET_BORDERS_ON_TARGET",
|
|
3399
3400
|
/** CHART */
|
|
3400
3401
|
"CREATE_CHART",
|
|
3401
3402
|
"UPDATE_CHART",
|
|
@@ -6559,6 +6560,7 @@
|
|
|
6559
6560
|
}
|
|
6560
6561
|
|
|
6561
6562
|
class BorderClipboardHandler extends AbstractCellClipboardHandler {
|
|
6563
|
+
queuedBordersToAdd = {};
|
|
6562
6564
|
copy(data) {
|
|
6563
6565
|
const sheetId = data.sheetId;
|
|
6564
6566
|
if (data.zones.length === 0) {
|
|
@@ -6589,6 +6591,7 @@
|
|
|
6589
6591
|
const { left, top } = zones[0];
|
|
6590
6592
|
this.pasteZone(sheetId, left, top, content.borders);
|
|
6591
6593
|
}
|
|
6594
|
+
this.executeQueuedChanges(sheetId);
|
|
6592
6595
|
}
|
|
6593
6596
|
pasteZone(sheetId, col, row, borders) {
|
|
6594
6597
|
for (const [r, rowBorders] of borders.entries()) {
|
|
@@ -6607,7 +6610,20 @@
|
|
|
6607
6610
|
...targetBorders,
|
|
6608
6611
|
...originBorders,
|
|
6609
6612
|
};
|
|
6610
|
-
|
|
6613
|
+
const borderKey = JSON.stringify(border);
|
|
6614
|
+
if (!this.queuedBordersToAdd[borderKey]) {
|
|
6615
|
+
this.queuedBordersToAdd[borderKey] = [];
|
|
6616
|
+
}
|
|
6617
|
+
this.queuedBordersToAdd[borderKey].push(positionToZone(target));
|
|
6618
|
+
}
|
|
6619
|
+
executeQueuedChanges(pasteSheetTarget) {
|
|
6620
|
+
for (const borderKey in this.queuedBordersToAdd) {
|
|
6621
|
+
const zones = this.queuedBordersToAdd[borderKey];
|
|
6622
|
+
const border = JSON.parse(borderKey);
|
|
6623
|
+
const target = recomputeZones(zones, []);
|
|
6624
|
+
this.dispatch("SET_BORDERS_ON_TARGET", { sheetId: pasteSheetTarget, target, border });
|
|
6625
|
+
}
|
|
6626
|
+
this.queuedBordersToAdd = {};
|
|
6611
6627
|
}
|
|
6612
6628
|
}
|
|
6613
6629
|
|
|
@@ -6719,6 +6735,12 @@
|
|
|
6719
6735
|
}
|
|
6720
6736
|
return null;
|
|
6721
6737
|
}
|
|
6738
|
+
/**
|
|
6739
|
+
- \p{L} is for any letter (from any language)
|
|
6740
|
+
- \p{N} is for any number
|
|
6741
|
+
- the u flag at the end is for unicode, which enables the `\p{...}` syntax
|
|
6742
|
+
*/
|
|
6743
|
+
const unicodeSymbolCharRegexp = /\p{L}|\p{N}|_|\.|!|\$/u;
|
|
6722
6744
|
const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
|
|
6723
6745
|
/**
|
|
6724
6746
|
* A "Symbol" is just basically any word-like element that can appear in a
|
|
@@ -6759,7 +6781,8 @@
|
|
|
6759
6781
|
};
|
|
6760
6782
|
}
|
|
6761
6783
|
}
|
|
6762
|
-
while (chars.current &&
|
|
6784
|
+
while (chars.current &&
|
|
6785
|
+
(SYMBOL_CHARS.has(chars.current) || chars.current.match(unicodeSymbolCharRegexp))) {
|
|
6763
6786
|
result += chars.shift();
|
|
6764
6787
|
}
|
|
6765
6788
|
if (result.length) {
|
|
@@ -8499,12 +8522,13 @@
|
|
|
8499
8522
|
}
|
|
8500
8523
|
pasteCf(origin, target, isCutOperation) {
|
|
8501
8524
|
if (origin?.rules && origin.rules.length > 0) {
|
|
8525
|
+
const originZone = positionToZone(origin.position);
|
|
8502
8526
|
const zone = positionToZone(target);
|
|
8503
8527
|
for (const rule of origin.rules) {
|
|
8504
8528
|
const toRemoveZones = [];
|
|
8505
8529
|
if (isCutOperation) {
|
|
8506
8530
|
//remove from current rule
|
|
8507
|
-
toRemoveZones.push(
|
|
8531
|
+
toRemoveZones.push(originZone);
|
|
8508
8532
|
}
|
|
8509
8533
|
if (origin.position.sheetId === target.sheetId) {
|
|
8510
8534
|
this.adaptCFRules(origin.position.sheetId, rule, [zone], toRemoveZones);
|
|
@@ -8618,6 +8642,7 @@
|
|
|
8618
8642
|
pasteDataValidation(origin, target, isCutOperation) {
|
|
8619
8643
|
if (origin) {
|
|
8620
8644
|
const zone = positionToZone(target);
|
|
8645
|
+
const originZone = positionToZone(origin.position);
|
|
8621
8646
|
const rule = origin.rule;
|
|
8622
8647
|
if (!rule) {
|
|
8623
8648
|
const targetRule = this.getters.getValidationRuleForCell(target);
|
|
@@ -8629,7 +8654,7 @@
|
|
|
8629
8654
|
}
|
|
8630
8655
|
const toRemoveZone = [];
|
|
8631
8656
|
if (isCutOperation) {
|
|
8632
|
-
toRemoveZone.push(
|
|
8657
|
+
toRemoveZone.push(originZone);
|
|
8633
8658
|
}
|
|
8634
8659
|
if (origin.position.sheetId === target.sheetId) {
|
|
8635
8660
|
const copyToRule = this.getDataValidationRuleToCopyTo(target.sheetId, rule, false);
|
|
@@ -8689,7 +8714,7 @@
|
|
|
8689
8714
|
continue;
|
|
8690
8715
|
}
|
|
8691
8716
|
this.dispatch("ADD_DATA_VALIDATION_RULE", {
|
|
8692
|
-
rule: dv,
|
|
8717
|
+
rule: { id: dv.id, criterion: dv.criterion, isBlocking: dv.isBlocking },
|
|
8693
8718
|
ranges: newDvZones.map((zone) => this.getters.getRangeDataFromZone(sheetId, zone)),
|
|
8694
8719
|
sheetId,
|
|
8695
8720
|
});
|
|
@@ -9020,7 +9045,7 @@
|
|
|
9020
9045
|
if (executed.type === "ADD_COLUMNS_ROWS") {
|
|
9021
9046
|
return expandZoneOnInsertion(zone, executed.dimension === "COL" ? "left" : "top", executed.base, executed.position, executed.quantity);
|
|
9022
9047
|
}
|
|
9023
|
-
return
|
|
9048
|
+
return zone;
|
|
9024
9049
|
}
|
|
9025
9050
|
function transformRangeData(range, executed) {
|
|
9026
9051
|
const deletedSheet = executed.type === "DELETE_SHEET" && executed.sheetId;
|
|
@@ -47991,39 +48016,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47991
48016
|
}
|
|
47992
48017
|
return hoveredPosition;
|
|
47993
48018
|
}
|
|
47994
|
-
function useTouchMove(gridRef, handler, canMoveUp) {
|
|
47995
|
-
let x = null;
|
|
47996
|
-
let y = null;
|
|
47997
|
-
function onTouchStart(ev) {
|
|
47998
|
-
if (ev.touches.length !== 1)
|
|
47999
|
-
return;
|
|
48000
|
-
x = ev.touches[0].clientX;
|
|
48001
|
-
y = ev.touches[0].clientY;
|
|
48002
|
-
}
|
|
48003
|
-
function onTouchEnd() {
|
|
48004
|
-
x = null;
|
|
48005
|
-
y = null;
|
|
48006
|
-
}
|
|
48007
|
-
function onTouchMove(ev) {
|
|
48008
|
-
if (ev.touches.length !== 1)
|
|
48009
|
-
return;
|
|
48010
|
-
// On mobile browsers, swiping down is often associated with "pull to refresh".
|
|
48011
|
-
// We only want this behavior if the grid is already at the top.
|
|
48012
|
-
// Otherwise we only want to move the canvas up, without triggering any refresh.
|
|
48013
|
-
if (canMoveUp()) {
|
|
48014
|
-
ev.preventDefault();
|
|
48015
|
-
ev.stopPropagation();
|
|
48016
|
-
}
|
|
48017
|
-
const currentX = ev.touches[0].clientX;
|
|
48018
|
-
const currentY = ev.touches[0].clientY;
|
|
48019
|
-
handler(x - currentX, y - currentY);
|
|
48020
|
-
x = currentX;
|
|
48021
|
-
y = currentY;
|
|
48022
|
-
}
|
|
48023
|
-
useRefListener(gridRef, "touchstart", onTouchStart);
|
|
48024
|
-
useRefListener(gridRef, "touchend", onTouchEnd);
|
|
48025
|
-
useRefListener(gridRef, "touchmove", onTouchMove);
|
|
48026
|
-
}
|
|
48027
48019
|
class GridOverlay extends owl.Component {
|
|
48028
48020
|
static template = "o-spreadsheet-GridOverlay";
|
|
48029
48021
|
static props = {
|
|
@@ -48071,10 +48063,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48071
48063
|
owl.onWillUnmount(() => {
|
|
48072
48064
|
resizeObserver.disconnect();
|
|
48073
48065
|
});
|
|
48074
|
-
useTouchMove(this.gridOverlay, this.props.onGridMoved, () => {
|
|
48075
|
-
const { scrollY } = this.env.model.getters.getActiveSheetDOMScrollInfo();
|
|
48076
|
-
return scrollY > 0;
|
|
48077
|
-
});
|
|
48078
48066
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
48079
48067
|
this.paintFormatStore = useStore(PaintFormatStore);
|
|
48080
48068
|
}
|
|
@@ -49423,6 +49411,73 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49423
49411
|
}
|
|
49424
49412
|
}
|
|
49425
49413
|
|
|
49414
|
+
const friction = 0.95;
|
|
49415
|
+
const verticalScrollFactor = 1;
|
|
49416
|
+
const horizontalScrollFactor = 1;
|
|
49417
|
+
function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
49418
|
+
let lastX = 0;
|
|
49419
|
+
let lastY = 0;
|
|
49420
|
+
let velocityX = 0;
|
|
49421
|
+
let velocityY = 0;
|
|
49422
|
+
let isMouseDown = false;
|
|
49423
|
+
let lastTime = 0;
|
|
49424
|
+
useRefListener(ref, "touchstart", onTouchStart, { capture: false });
|
|
49425
|
+
useRefListener(ref, "touchmove", onTouchMove, { capture: false });
|
|
49426
|
+
useRefListener(ref, "touchend", onTouchEnd, { capture: false });
|
|
49427
|
+
function onTouchStart(event) {
|
|
49428
|
+
isMouseDown = true;
|
|
49429
|
+
({ clientX: lastX, clientY: lastY } = event.touches[0]);
|
|
49430
|
+
velocityX = 0;
|
|
49431
|
+
velocityY = 0;
|
|
49432
|
+
}
|
|
49433
|
+
function onTouchMove(event) {
|
|
49434
|
+
if (!isMouseDown)
|
|
49435
|
+
return;
|
|
49436
|
+
const currentTime = Date.now();
|
|
49437
|
+
const { clientX, clientY } = event.touches[0];
|
|
49438
|
+
let deltaX = lastX - clientX;
|
|
49439
|
+
let deltaY = lastY - clientY;
|
|
49440
|
+
const elapsedTime = currentTime - lastTime;
|
|
49441
|
+
velocityX = deltaX / elapsedTime;
|
|
49442
|
+
velocityY = deltaY / elapsedTime;
|
|
49443
|
+
lastX = clientX;
|
|
49444
|
+
lastY = clientY;
|
|
49445
|
+
lastTime = currentTime;
|
|
49446
|
+
if (canMoveUp()) {
|
|
49447
|
+
if (event.cancelable) {
|
|
49448
|
+
event.preventDefault();
|
|
49449
|
+
}
|
|
49450
|
+
event.stopPropagation();
|
|
49451
|
+
}
|
|
49452
|
+
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
49453
|
+
}
|
|
49454
|
+
function onTouchEnd(ev) {
|
|
49455
|
+
isMouseDown = false;
|
|
49456
|
+
lastX = lastY = 0;
|
|
49457
|
+
requestAnimationFrame(scroll);
|
|
49458
|
+
}
|
|
49459
|
+
function scroll() {
|
|
49460
|
+
if (Math.abs(velocityX) < 0.05) {
|
|
49461
|
+
velocityX = 0;
|
|
49462
|
+
}
|
|
49463
|
+
if (Math.abs(velocityY) < 0.05) {
|
|
49464
|
+
velocityY = 0;
|
|
49465
|
+
}
|
|
49466
|
+
if (!velocityX && !velocityY) {
|
|
49467
|
+
return;
|
|
49468
|
+
}
|
|
49469
|
+
const currentTime = Date.now();
|
|
49470
|
+
const elapsedTime = Math.abs(currentTime - lastTime);
|
|
49471
|
+
const deltaX = velocityX * elapsedTime;
|
|
49472
|
+
const deltaY = velocityY * elapsedTime;
|
|
49473
|
+
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
49474
|
+
lastTime = currentTime;
|
|
49475
|
+
velocityX *= friction;
|
|
49476
|
+
velocityY *= friction;
|
|
49477
|
+
requestAnimationFrame(scroll);
|
|
49478
|
+
}
|
|
49479
|
+
}
|
|
49480
|
+
|
|
49426
49481
|
function useWheelHandler(handler) {
|
|
49427
49482
|
function normalize(val, deltaMode) {
|
|
49428
49483
|
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
@@ -50043,6 +50098,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50043
50098
|
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
50044
50099
|
}
|
|
50045
50100
|
}, () => [this.sidePanel.isOpen]);
|
|
50101
|
+
useTouchScroll(this.gridRef, this.moveCanvas.bind(this), () => {
|
|
50102
|
+
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
50103
|
+
return scrollY > 0;
|
|
50104
|
+
});
|
|
50046
50105
|
}
|
|
50047
50106
|
onCellHovered({ col, row }) {
|
|
50048
50107
|
this.hoveredCell.hover({ col, row });
|
|
@@ -50790,6 +50849,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50790
50849
|
case "SET_BORDER":
|
|
50791
50850
|
this.setBorder(cmd.sheetId, cmd.col, cmd.row, cmd.border);
|
|
50792
50851
|
break;
|
|
50852
|
+
case "SET_BORDERS_ON_TARGET":
|
|
50853
|
+
for (const zone of cmd.target) {
|
|
50854
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
50855
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
50856
|
+
this.setBorder(cmd.sheetId, col, row, cmd.border);
|
|
50857
|
+
}
|
|
50858
|
+
}
|
|
50859
|
+
}
|
|
50860
|
+
break;
|
|
50793
50861
|
case "SET_ZONE_BORDERS":
|
|
50794
50862
|
if (cmd.border) {
|
|
50795
50863
|
const target = cmd.target.map((zone) => this.getters.expandZone(cmd.sheetId, zone));
|
|
@@ -60608,25 +60676,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60608
60676
|
case "AUTOFILL_AUTO":
|
|
60609
60677
|
this.autofillAuto();
|
|
60610
60678
|
break;
|
|
60611
|
-
case "AUTOFILL_CELL":
|
|
60612
|
-
this.autoFillMerge(cmd.originCol, cmd.originRow, cmd.col, cmd.row);
|
|
60613
|
-
const sheetId = this.getters.getActiveSheetId();
|
|
60614
|
-
this.dispatch("UPDATE_CELL", {
|
|
60615
|
-
sheetId,
|
|
60616
|
-
col: cmd.col,
|
|
60617
|
-
row: cmd.row,
|
|
60618
|
-
style: cmd.style || null,
|
|
60619
|
-
content: cmd.content || "",
|
|
60620
|
-
format: cmd.format || "",
|
|
60621
|
-
});
|
|
60622
|
-
this.dispatch("SET_BORDER", {
|
|
60623
|
-
sheetId,
|
|
60624
|
-
col: cmd.col,
|
|
60625
|
-
row: cmd.row,
|
|
60626
|
-
border: cmd.border,
|
|
60627
|
-
});
|
|
60628
|
-
this.autofillCF(cmd.originCol, cmd.originRow, cmd.col, cmd.row);
|
|
60629
|
-
this.autofillDV(cmd.originCol, cmd.originRow, cmd.col, cmd.row);
|
|
60630
60679
|
}
|
|
60631
60680
|
}
|
|
60632
60681
|
// ---------------------------------------------------------------------------
|
|
@@ -60650,6 +60699,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60650
60699
|
}
|
|
60651
60700
|
const source = this.getters.getSelectedZone();
|
|
60652
60701
|
const target = this.autofillZone;
|
|
60702
|
+
const autofillCellsData = [];
|
|
60653
60703
|
switch (this.direction) {
|
|
60654
60704
|
case "down" /* DIRECTION.DOWN */:
|
|
60655
60705
|
for (let col = source.left; col <= source.right; col++) {
|
|
@@ -60659,7 +60709,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60659
60709
|
}
|
|
60660
60710
|
const generator = this.createGenerator(xcs);
|
|
60661
60711
|
for (let row = target.top; row <= target.bottom; row++) {
|
|
60662
|
-
this.computeNewCell(generator, col, row
|
|
60712
|
+
autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
60663
60713
|
}
|
|
60664
60714
|
}
|
|
60665
60715
|
break;
|
|
@@ -60671,7 +60721,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60671
60721
|
}
|
|
60672
60722
|
const generator = this.createGenerator(xcs);
|
|
60673
60723
|
for (let row = target.bottom; row >= target.top; row--) {
|
|
60674
|
-
this.computeNewCell(generator, col, row
|
|
60724
|
+
autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
60675
60725
|
}
|
|
60676
60726
|
}
|
|
60677
60727
|
break;
|
|
@@ -60683,7 +60733,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60683
60733
|
}
|
|
60684
60734
|
const generator = this.createGenerator(xcs);
|
|
60685
60735
|
for (let col = target.right; col >= target.left; col--) {
|
|
60686
|
-
this.computeNewCell(generator, col, row
|
|
60736
|
+
autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
60687
60737
|
}
|
|
60688
60738
|
}
|
|
60689
60739
|
break;
|
|
@@ -60695,12 +60745,26 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60695
60745
|
}
|
|
60696
60746
|
const generator = this.createGenerator(xcs);
|
|
60697
60747
|
for (let col = target.left; col <= target.right; col++) {
|
|
60698
|
-
this.computeNewCell(generator, col, row
|
|
60748
|
+
autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
60699
60749
|
}
|
|
60700
60750
|
}
|
|
60701
60751
|
break;
|
|
60702
60752
|
}
|
|
60703
60753
|
if (apply) {
|
|
60754
|
+
const bordersZones = {};
|
|
60755
|
+
const cfNewRanges = {};
|
|
60756
|
+
const dvNewZones = {};
|
|
60757
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
60758
|
+
for (const data of autofillCellsData) {
|
|
60759
|
+
this.collectBordersData(data, bordersZones);
|
|
60760
|
+
this.autofillMerge(sheetId, data);
|
|
60761
|
+
this.autofillCell(sheetId, data);
|
|
60762
|
+
this.collectConditionalFormatsData(sheetId, data, cfNewRanges);
|
|
60763
|
+
this.collectDataValidationsData(sheetId, data, dvNewZones);
|
|
60764
|
+
}
|
|
60765
|
+
this.autofillBorders(sheetId, bordersZones);
|
|
60766
|
+
this.autofillConditionalFormats(sheetId, cfNewRanges);
|
|
60767
|
+
this.autofillDataValidations(sheetId, dvNewZones);
|
|
60704
60768
|
this.autofillZone = undefined;
|
|
60705
60769
|
this.selection.resizeAnchorZone(this.direction, this.steps);
|
|
60706
60770
|
this.lastCellSelected = {};
|
|
@@ -60709,6 +60773,95 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60709
60773
|
this.tooltip = undefined;
|
|
60710
60774
|
}
|
|
60711
60775
|
}
|
|
60776
|
+
collectBordersData(data, bordersPositions) {
|
|
60777
|
+
const key = JSON.stringify(data.border);
|
|
60778
|
+
if (!(key in bordersPositions)) {
|
|
60779
|
+
bordersPositions[key] = [];
|
|
60780
|
+
}
|
|
60781
|
+
bordersPositions[key].push(positionToZone({ col: data.col, row: data.row }));
|
|
60782
|
+
}
|
|
60783
|
+
collectConditionalFormatsData(sheetId, data, cfNewRanges) {
|
|
60784
|
+
const { originCol, originRow, col, row } = data;
|
|
60785
|
+
const cfsAtOrigin = this.getters.getRulesByCell(sheetId, originCol, originRow);
|
|
60786
|
+
const xc = toXC(col, row);
|
|
60787
|
+
for (const cf of cfsAtOrigin) {
|
|
60788
|
+
if (!(cf.id in cfNewRanges)) {
|
|
60789
|
+
cfNewRanges[cf.id] = [];
|
|
60790
|
+
}
|
|
60791
|
+
cfNewRanges[cf.id].push(xc);
|
|
60792
|
+
}
|
|
60793
|
+
}
|
|
60794
|
+
collectDataValidationsData(sheetId, data, dvNewZones) {
|
|
60795
|
+
const { originCol, originRow, col, row } = data;
|
|
60796
|
+
const cellPosition = { sheetId, col: originCol, row: originRow };
|
|
60797
|
+
const dvsAtOrigin = this.getters.getValidationRuleForCell(cellPosition);
|
|
60798
|
+
if (!dvsAtOrigin) {
|
|
60799
|
+
return;
|
|
60800
|
+
}
|
|
60801
|
+
if (!(dvsAtOrigin.id in dvNewZones)) {
|
|
60802
|
+
dvNewZones[dvsAtOrigin.id] = [];
|
|
60803
|
+
}
|
|
60804
|
+
dvNewZones[dvsAtOrigin.id].push(positionToZone({ col, row }));
|
|
60805
|
+
}
|
|
60806
|
+
autofillCell(sheetId, data) {
|
|
60807
|
+
this.dispatch("UPDATE_CELL", {
|
|
60808
|
+
sheetId,
|
|
60809
|
+
col: data.col,
|
|
60810
|
+
row: data.row,
|
|
60811
|
+
content: data.content || "",
|
|
60812
|
+
style: data.style || null,
|
|
60813
|
+
format: data.format || "",
|
|
60814
|
+
});
|
|
60815
|
+
// Still usefull in odoo ATM to autofill field sync
|
|
60816
|
+
this.dispatch("AUTOFILL_CELL", data);
|
|
60817
|
+
}
|
|
60818
|
+
autofillBorders(sheetId, bordersPositions) {
|
|
60819
|
+
for (const stringifiedBorder in bordersPositions) {
|
|
60820
|
+
const border = stringifiedBorder === "undefined" ? undefined : JSON.parse(stringifiedBorder);
|
|
60821
|
+
this.dispatch("SET_BORDERS_ON_TARGET", {
|
|
60822
|
+
sheetId,
|
|
60823
|
+
border,
|
|
60824
|
+
target: recomputeZones(bordersPositions[stringifiedBorder]),
|
|
60825
|
+
});
|
|
60826
|
+
}
|
|
60827
|
+
}
|
|
60828
|
+
autofillConditionalFormats(sheetId, cfNewRanges) {
|
|
60829
|
+
for (const cfId in cfNewRanges) {
|
|
60830
|
+
const changes = cfNewRanges[cfId];
|
|
60831
|
+
const cf = this.getters.getConditionalFormats(sheetId).find((cf) => cf.id === cfId);
|
|
60832
|
+
if (!cf) {
|
|
60833
|
+
continue;
|
|
60834
|
+
}
|
|
60835
|
+
const newCfRanges = this.getters.getAdaptedCfRanges(sheetId, cf, changes.map(toZone), []);
|
|
60836
|
+
if (newCfRanges) {
|
|
60837
|
+
this.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
60838
|
+
cf: {
|
|
60839
|
+
id: cf.id,
|
|
60840
|
+
rule: cf.rule,
|
|
60841
|
+
stopIfTrue: cf.stopIfTrue,
|
|
60842
|
+
},
|
|
60843
|
+
ranges: newCfRanges,
|
|
60844
|
+
sheetId,
|
|
60845
|
+
});
|
|
60846
|
+
}
|
|
60847
|
+
}
|
|
60848
|
+
}
|
|
60849
|
+
autofillDataValidations(sheetId, dvNewZones) {
|
|
60850
|
+
for (const dvId in dvNewZones) {
|
|
60851
|
+
const changes = dvNewZones[dvId];
|
|
60852
|
+
const dvOrigin = this.getters.getDataValidationRule(sheetId, dvId);
|
|
60853
|
+
if (!dvOrigin) {
|
|
60854
|
+
continue;
|
|
60855
|
+
}
|
|
60856
|
+
const dvRangesXcs = dvOrigin.ranges.map((range) => range.zone);
|
|
60857
|
+
const newDvRanges = recomputeZones(dvRangesXcs.concat(changes), []);
|
|
60858
|
+
this.dispatch("ADD_DATA_VALIDATION_RULE", {
|
|
60859
|
+
rule: dvOrigin,
|
|
60860
|
+
ranges: newDvRanges.map((zone) => this.getters.getRangeDataFromZone(sheetId, zone)),
|
|
60861
|
+
sheetId,
|
|
60862
|
+
});
|
|
60863
|
+
}
|
|
60864
|
+
}
|
|
60712
60865
|
/**
|
|
60713
60866
|
* Select a cell which becomes the last cell of the autofillZone
|
|
60714
60867
|
*/
|
|
@@ -60787,22 +60940,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60787
60940
|
/**
|
|
60788
60941
|
* Generate the next cell
|
|
60789
60942
|
*/
|
|
60790
|
-
computeNewCell(generator, col, row
|
|
60943
|
+
computeNewCell(generator, col, row) {
|
|
60791
60944
|
const { cellData, tooltip, origin } = generator.next();
|
|
60792
60945
|
const { content, style, border, format } = cellData;
|
|
60793
60946
|
this.tooltip = tooltip;
|
|
60794
|
-
|
|
60795
|
-
|
|
60796
|
-
|
|
60797
|
-
|
|
60798
|
-
|
|
60799
|
-
|
|
60800
|
-
|
|
60801
|
-
|
|
60802
|
-
|
|
60803
|
-
|
|
60804
|
-
});
|
|
60805
|
-
}
|
|
60947
|
+
return {
|
|
60948
|
+
originCol: origin.col,
|
|
60949
|
+
originRow: origin.row,
|
|
60950
|
+
col,
|
|
60951
|
+
row,
|
|
60952
|
+
content,
|
|
60953
|
+
style,
|
|
60954
|
+
border,
|
|
60955
|
+
format,
|
|
60956
|
+
};
|
|
60806
60957
|
}
|
|
60807
60958
|
/**
|
|
60808
60959
|
* Get the rule associated to the current cell
|
|
@@ -60870,8 +61021,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60870
61021
|
? position[first].value
|
|
60871
61022
|
: position[second].value;
|
|
60872
61023
|
}
|
|
60873
|
-
|
|
60874
|
-
const
|
|
61024
|
+
autofillMerge(sheetId, data) {
|
|
61025
|
+
const { originCol, originRow, col, row } = data;
|
|
60875
61026
|
const position = { sheetId, col, row };
|
|
60876
61027
|
const originPosition = { sheetId, col: originCol, row: originRow };
|
|
60877
61028
|
if (this.getters.isInMerge(position) && !this.getters.isInMerge(originPosition)) {
|
|
@@ -60898,35 +61049,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60898
61049
|
});
|
|
60899
61050
|
}
|
|
60900
61051
|
}
|
|
60901
|
-
autofillCF(originCol, originRow, col, row) {
|
|
60902
|
-
const sheetId = this.getters.getActiveSheetId();
|
|
60903
|
-
const cfOrigin = this.getters.getRulesByCell(sheetId, originCol, originRow);
|
|
60904
|
-
for (const cf of cfOrigin) {
|
|
60905
|
-
const newCfRanges = this.getters.getAdaptedCfRanges(sheetId, cf, [positionToZone({ col, row })], []);
|
|
60906
|
-
if (newCfRanges) {
|
|
60907
|
-
this.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
60908
|
-
cf: deepCopy(cf),
|
|
60909
|
-
ranges: newCfRanges,
|
|
60910
|
-
sheetId,
|
|
60911
|
-
});
|
|
60912
|
-
}
|
|
60913
|
-
}
|
|
60914
|
-
}
|
|
60915
|
-
autofillDV(originCol, originRow, col, row) {
|
|
60916
|
-
const sheetId = this.getters.getActiveSheetId();
|
|
60917
|
-
const cellPosition = { sheetId, col: originCol, row: originRow };
|
|
60918
|
-
const dvOrigin = this.getters.getValidationRuleForCell(cellPosition);
|
|
60919
|
-
if (!dvOrigin) {
|
|
60920
|
-
return;
|
|
60921
|
-
}
|
|
60922
|
-
const dvRangesZones = dvOrigin.ranges.map((range) => range.zone);
|
|
60923
|
-
const newDvRanges = recomputeZones(dvRangesZones.concat(positionToZone({ col, row })), []);
|
|
60924
|
-
this.dispatch("ADD_DATA_VALIDATION_RULE", {
|
|
60925
|
-
rule: dvOrigin,
|
|
60926
|
-
ranges: newDvRanges.map((zone) => this.getters.getRangeDataFromZone(sheetId, zone)),
|
|
60927
|
-
sheetId,
|
|
60928
|
-
});
|
|
60929
|
-
}
|
|
60930
61052
|
// ---------------------------------------------------------------------------
|
|
60931
61053
|
// Grid rendering
|
|
60932
61054
|
// ---------------------------------------------------------------------------
|
|
@@ -61306,10 +61428,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61306
61428
|
}
|
|
61307
61429
|
const target = [];
|
|
61308
61430
|
for (const zone1 of toTransform.target) {
|
|
61309
|
-
|
|
61310
|
-
|
|
61311
|
-
target.push({ ...zone1 });
|
|
61312
|
-
}
|
|
61431
|
+
if (executed.target.every((zone2) => !overlap(zone1, zone2))) {
|
|
61432
|
+
target.push(zone1);
|
|
61313
61433
|
}
|
|
61314
61434
|
}
|
|
61315
61435
|
if (target.length) {
|
|
@@ -67537,6 +67657,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
67537
67657
|
this.hoveredCell.clear();
|
|
67538
67658
|
});
|
|
67539
67659
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
67660
|
+
useTouchScroll(gridRef, this.moveCanvas.bind(this), () => {
|
|
67661
|
+
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
67662
|
+
return scrollY > 0;
|
|
67663
|
+
});
|
|
67540
67664
|
}
|
|
67541
67665
|
onCellHovered({ col, row }) {
|
|
67542
67666
|
this.hoveredCell.hover({ col, row });
|
|
@@ -73632,9 +73756,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73632
73756
|
exports.tokenize = tokenize;
|
|
73633
73757
|
|
|
73634
73758
|
|
|
73635
|
-
__info__.version = "18.0.
|
|
73636
|
-
__info__.date = "2025-04-
|
|
73637
|
-
__info__.hash = "
|
|
73759
|
+
__info__.version = "18.0.24";
|
|
73760
|
+
__info__.date = "2025-04-18T16:23:09.320Z";
|
|
73761
|
+
__info__.hash = "aa18758";
|
|
73638
73762
|
|
|
73639
73763
|
|
|
73640
73764
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|