@odoo/o-spreadsheet 19.3.17 → 19.3.19
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 +67 -25
- package/dist/o_spreadsheet.css +10 -4
- package/dist/o_spreadsheet.esm.js +67 -25
- package/dist/o_spreadsheet.iife.js +67 -25
- package/dist/o_spreadsheet.min.iife.js +8 -8
- package/dist/o_spreadsheet.xml +3 -3
- package/dist/types/collaborative/session.d.ts +3 -1
- package/dist/types/plugins/core/carousel.d.ts +1 -1
- package/dist/types/plugins/core/squisher.d.ts +3 -0
- package/dist/types/types/collaborative/transport_service.d.ts +1 -0
- 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 19.3.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.3.19
|
|
6
|
+
* @date 2026-09-04T07:38:14.356Z
|
|
7
|
+
* @hash c8c526d
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -9594,16 +9594,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9594
9594
|
drawLineOrBarOrRadarChartValues(chart, options, ctx);
|
|
9595
9595
|
break;
|
|
9596
9596
|
case "bar":
|
|
9597
|
-
options.horizontal ? drawHorizontalBarChartValues(chart, options, ctx) : drawLineOrBarOrRadarChartValues(chart, options, ctx);
|
|
9597
|
+
options.horizontal ? drawHorizontalBarChartValues(chart, options, ctx, { offsetFromAxisOrigin: true }) : drawLineOrBarOrRadarChartValues(chart, options, ctx);
|
|
9598
9598
|
break;
|
|
9599
9599
|
case "pyramid":
|
|
9600
|
-
drawHorizontalBarChartValues(chart, options, ctx);
|
|
9600
|
+
drawHorizontalBarChartValues(chart, options, ctx, { offsetFromAxisOrigin: true });
|
|
9601
9601
|
break;
|
|
9602
9602
|
case "calendar":
|
|
9603
9603
|
drawBarChartValues(chart, options, ctx);
|
|
9604
9604
|
break;
|
|
9605
9605
|
case "funnel":
|
|
9606
|
-
drawHorizontalBarChartValues(chart, options, ctx);
|
|
9606
|
+
drawHorizontalBarChartValues(chart, options, ctx, { offsetFromAxisOrigin: false });
|
|
9607
9607
|
break;
|
|
9608
9608
|
}
|
|
9609
9609
|
ctx.restore();
|
|
@@ -9673,7 +9673,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9673
9673
|
}
|
|
9674
9674
|
}
|
|
9675
9675
|
}
|
|
9676
|
-
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
9676
|
+
function drawHorizontalBarChartValues(chart, options, ctx, args) {
|
|
9677
9677
|
const textsPositions = {};
|
|
9678
9678
|
for (const dataset of chart._metasets) {
|
|
9679
9679
|
if (isTrendLineAxis(dataset.xAxisID)) return;
|
|
@@ -9688,7 +9688,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9688
9688
|
const distanceFromAxisOrigin = Math.abs(point.x - xZeroLine);
|
|
9689
9689
|
const PADDING = 3;
|
|
9690
9690
|
let xPosition;
|
|
9691
|
-
if (distanceFromAxisOrigin < textWidth) xPosition = value < 0 ? xZeroLine - textWidth / 2 - PADDING : xZeroLine + textWidth / 2 + PADDING;
|
|
9691
|
+
if (args.offsetFromAxisOrigin && distanceFromAxisOrigin < textWidth) xPosition = value < 0 ? xZeroLine - textWidth / 2 - PADDING : xZeroLine + textWidth / 2 + PADDING;
|
|
9692
9692
|
else xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
9693
9693
|
if (!textsPositions[yPosition]) textsPositions[yPosition] = [];
|
|
9694
9694
|
for (const otherPosition of textsPositions[yPosition]) if (Math.abs(otherPosition - xPosition) < textWidth) xPosition = value < 0 ? otherPosition - textWidth - PADDING : otherPosition + textWidth + PADDING;
|
|
@@ -10487,6 +10487,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10487
10487
|
hidden,
|
|
10488
10488
|
borderColor,
|
|
10489
10489
|
backgroundColor: borderColor,
|
|
10490
|
+
pointBackgroundColor: borderColor,
|
|
10490
10491
|
pointRadius: definition.hideDataMarkers ? 0 : 3
|
|
10491
10492
|
};
|
|
10492
10493
|
if (fill) {
|
|
@@ -25446,9 +25447,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25446
25447
|
compositionActive = false;
|
|
25447
25448
|
spreadsheetRect = useSpreadsheetRect();
|
|
25448
25449
|
lastHoveredTokenIndex = void 0;
|
|
25449
|
-
debouncedHover = debounce((tokenIndex, hoveredRect) => {
|
|
25450
|
+
debouncedHover = debounce((tokenIndex, composerContent, hoveredRect) => {
|
|
25450
25451
|
const selection = this.contentHelper.getCurrentSelection();
|
|
25451
|
-
|
|
25452
|
+
const currentContent = this.props.composerStore.currentContent;
|
|
25453
|
+
if (selection.start !== selection.end || currentContent !== composerContent) return;
|
|
25452
25454
|
const currentHoveredContext = this.props.composerStore.hoveredTokens;
|
|
25453
25455
|
this.props.composerStore.hoverToken(tokenIndex);
|
|
25454
25456
|
if (!deepEquals(currentHoveredContext, this.props.composerStore.hoveredTokens)) this.composerState.hoveredRect = hoveredRect;
|
|
@@ -25766,7 +25768,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25766
25768
|
onTokenHover(tokenIndex, hoveredRect) {
|
|
25767
25769
|
if (this.lastHoveredTokenIndex !== tokenIndex) {
|
|
25768
25770
|
this.lastHoveredTokenIndex = tokenIndex;
|
|
25769
|
-
this.
|
|
25771
|
+
const composerContent = this.props.composerStore.currentContent;
|
|
25772
|
+
this.debouncedHover(tokenIndex, composerContent, hoveredRect);
|
|
25770
25773
|
}
|
|
25771
25774
|
}
|
|
25772
25775
|
/**
|
|
@@ -40077,7 +40080,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40077
40080
|
}
|
|
40078
40081
|
onSelectionChanged(ranges) {
|
|
40079
40082
|
this.state.rangeHasChanged = true;
|
|
40080
|
-
|
|
40083
|
+
if (ranges.length === 0) {
|
|
40084
|
+
this.state.range = void 0;
|
|
40085
|
+
return;
|
|
40086
|
+
}
|
|
40087
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
40088
|
+
const range = this.env.model.getters.getRangeFromSheetXC(sheetId, ranges[0]);
|
|
40089
|
+
this.state.range = this.env.model.getters.getRangeString(range, "forceSheetReference", { useBoundedReference: true });
|
|
40081
40090
|
}
|
|
40082
40091
|
onSelectionConfirmed() {
|
|
40083
40092
|
if (this.state.range) {
|
|
@@ -49736,6 +49745,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49736
49745
|
return "Success";
|
|
49737
49746
|
case "UPDATE_CAROUSEL":
|
|
49738
49747
|
if (!this.carousels[cmd.sheetId]?.[cmd.figureId]) return "InvalidFigureId";
|
|
49748
|
+
for (const item of cmd.definition.items) if (item.type === "chart" && !this.getters.getChart(item.chartId)) return "ChartDoesNotExist";
|
|
49739
49749
|
return "Success";
|
|
49740
49750
|
}
|
|
49741
49751
|
return "Success";
|
|
@@ -49840,6 +49850,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49840
49850
|
baseFormulaWasTransformed = false;
|
|
49841
49851
|
rangeToStringOptions = { doNotSimplifyRange: true };
|
|
49842
49852
|
baseNumber = void 0;
|
|
49853
|
+
baseNumberFormat = void 0;
|
|
49843
49854
|
constructor(getters) {
|
|
49844
49855
|
this.getters = getters;
|
|
49845
49856
|
}
|
|
@@ -49874,6 +49885,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49874
49885
|
this.baseFormulaWasTransformed = false;
|
|
49875
49886
|
}
|
|
49876
49887
|
}
|
|
49888
|
+
/** Reset the base number literal chain, so the next literal number cannot be squished as an offset of it */
|
|
49889
|
+
resetBaseNumber() {
|
|
49890
|
+
this.baseNumber = void 0;
|
|
49891
|
+
this.baseNumberFormat = void 0;
|
|
49892
|
+
}
|
|
49877
49893
|
/**
|
|
49878
49894
|
* Takes a cell and squish their formulas against the previous one (in the previous call).
|
|
49879
49895
|
* We should call this method for each cell in the sheet, in order from top to bottom, then from left to right (all cells of a columns, for each columns left to right).
|
|
@@ -49912,8 +49928,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49912
49928
|
if (typeof cell.parsedValue === "number" && cell.parsedValue % 1 === 0) {
|
|
49913
49929
|
this.resetBaseFormula();
|
|
49914
49930
|
const numberValue = cell.parsedValue;
|
|
49915
|
-
if (this.baseNumber === void 0) {
|
|
49931
|
+
if (this.baseNumber === void 0 || cell.format !== this.baseNumberFormat) {
|
|
49916
49932
|
this.baseNumber = numberValue;
|
|
49933
|
+
this.baseNumberFormat = cell.format;
|
|
49917
49934
|
return cell.content;
|
|
49918
49935
|
}
|
|
49919
49936
|
const numberOffset = numberValue - this.baseNumber;
|
|
@@ -49924,7 +49941,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49924
49941
|
}
|
|
49925
49942
|
}
|
|
49926
49943
|
this.resetBaseFormula();
|
|
49927
|
-
this.
|
|
49944
|
+
this.resetBaseNumber();
|
|
49928
49945
|
return cell.content;
|
|
49929
49946
|
}
|
|
49930
49947
|
squishCommand(command) {
|
|
@@ -49933,6 +49950,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49933
49950
|
const squished = this.squish(cell, command.sheetId);
|
|
49934
49951
|
return typeof squished === "string" ? command.content : squished;
|
|
49935
49952
|
}
|
|
49953
|
+
this.resetBaseFormula();
|
|
49954
|
+
this.resetBaseNumber();
|
|
49936
49955
|
return command.content;
|
|
49937
49956
|
}
|
|
49938
49957
|
/**
|
|
@@ -50086,8 +50105,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50086
50105
|
continue;
|
|
50087
50106
|
}
|
|
50088
50107
|
const current = command.content;
|
|
50089
|
-
if (current === void 0 || current === null || current === "")
|
|
50090
|
-
|
|
50108
|
+
if (current === void 0 || current === null || current === "") {
|
|
50109
|
+
this.rebase();
|
|
50110
|
+
strategy = "NOT_A_FORMULA";
|
|
50111
|
+
} else strategy = this.chooseStrategy(current, strategy, command.sheetId, getters);
|
|
50091
50112
|
let targetPositions;
|
|
50092
50113
|
if (command.type === "SQUISHED_UPDATE_CELL" && "targetRange" in command) {
|
|
50093
50114
|
const [start, end] = command.targetRange.split(":");
|
|
@@ -50132,8 +50153,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50132
50153
|
let strategy;
|
|
50133
50154
|
for (const { key } of keys) {
|
|
50134
50155
|
const current = squished[key];
|
|
50135
|
-
if (current === void 0 || current === null || current === "")
|
|
50136
|
-
|
|
50156
|
+
if (current === void 0 || current === null || current === "") {
|
|
50157
|
+
this.rebase();
|
|
50158
|
+
strategy = void 0;
|
|
50159
|
+
continue;
|
|
50160
|
+
} else strategy = this.chooseStrategy(current, strategy, sheetId, getters);
|
|
50137
50161
|
const parts = key.split(":");
|
|
50138
50162
|
const targetPositions = parts.length === 1 ? expandXc(key) : expandRange(parts[0], parts[1]);
|
|
50139
50163
|
yield* this.applyStrategy(strategy, targetPositions, current, sheetId, getters);
|
|
@@ -50179,6 +50203,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50179
50203
|
case "FIRST_OFFSET":
|
|
50180
50204
|
strategy = "COMBINE_OFFSET";
|
|
50181
50205
|
break;
|
|
50206
|
+
case "COMBINE_OFFSET":
|
|
50207
|
+
case "OFFSET_NUMBER": break;
|
|
50208
|
+
default: throw new Error(`Cannot unsquish an offset without a preceding base cell: ${strategy}`);
|
|
50182
50209
|
}
|
|
50183
50210
|
}
|
|
50184
50211
|
return strategy;
|
|
@@ -54897,6 +54924,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54897
54924
|
}
|
|
54898
54925
|
getCellsDependingOn(ranges, visited = new RangeSet()) {
|
|
54899
54926
|
visited = visited.copy();
|
|
54927
|
+
let initialRangesToRemove = visited.copy();
|
|
54900
54928
|
const queue = Array.from(ranges).reverse();
|
|
54901
54929
|
while (queue.length > 0) {
|
|
54902
54930
|
const range = queue.pop();
|
|
@@ -54912,8 +54940,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54912
54940
|
for (const interval of overlappingIntervals) impactedRanges.add(interval.dependents);
|
|
54913
54941
|
}
|
|
54914
54942
|
queue.push(...impactedRanges.difference(visited));
|
|
54943
|
+
initialRangesToRemove = initialRangesToRemove.difference(impactedRanges);
|
|
54915
54944
|
}
|
|
54916
|
-
for (const range of
|
|
54945
|
+
for (const range of initialRangesToRemove) visited.delete(range);
|
|
54917
54946
|
return visited;
|
|
54918
54947
|
}
|
|
54919
54948
|
getOrCreateIntervalTree(sheetId, col) {
|
|
@@ -60777,6 +60806,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60777
60806
|
transportService;
|
|
60778
60807
|
serverRevisionId;
|
|
60779
60808
|
commandSquisher;
|
|
60809
|
+
shouldVerifySquish;
|
|
60780
60810
|
/**
|
|
60781
60811
|
* Positions of the others client.
|
|
60782
60812
|
*/
|
|
@@ -60811,13 +60841,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60811
60841
|
* between all connected clients
|
|
60812
60842
|
* @param serverRevisionId
|
|
60813
60843
|
* @param commandSquisher used to squish and unsquish commands to reduce the size of messages sent to the server
|
|
60844
|
+
* @param shouldVerifySquish either the commands should be unsquished and verified before being sent to the server
|
|
60814
60845
|
*/
|
|
60815
|
-
constructor(revisions, transportService, serverRevisionId = DEFAULT_REVISION_ID, commandSquisher) {
|
|
60846
|
+
constructor(revisions, transportService, serverRevisionId = DEFAULT_REVISION_ID, commandSquisher, shouldVerifySquish = true) {
|
|
60816
60847
|
super();
|
|
60817
60848
|
this.revisions = revisions;
|
|
60818
60849
|
this.transportService = transportService;
|
|
60819
60850
|
this.serverRevisionId = serverRevisionId;
|
|
60820
60851
|
this.commandSquisher = commandSquisher;
|
|
60852
|
+
this.shouldVerifySquish = shouldVerifySquish;
|
|
60821
60853
|
}
|
|
60822
60854
|
canApplyOptimisticUpdate() {
|
|
60823
60855
|
return !this.waitingUndoRedoAck;
|
|
@@ -61073,10 +61105,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61073
61105
|
this.revisions.rebase(revision.id);
|
|
61074
61106
|
revision = this.revisions.get(message.nextRevisionId);
|
|
61075
61107
|
}
|
|
61076
|
-
|
|
61108
|
+
const squishedCommands = this.commandSquisher.squish(revision.commands);
|
|
61109
|
+
if (!squishedCommands.some((x) => x.type === "SQUISHED_UPDATE_CELL")) message = {
|
|
61077
61110
|
...message,
|
|
61078
61111
|
commands: revision.commands
|
|
61079
61112
|
};
|
|
61113
|
+
else if (this.shouldVerifySquish && !deepEquals(revision.commands, this.commandSquisher.unsquish(squishedCommands))) message = {
|
|
61114
|
+
...message,
|
|
61115
|
+
commands: revision.commands,
|
|
61116
|
+
squishedFailed: true
|
|
61117
|
+
};
|
|
61118
|
+
else message = {
|
|
61119
|
+
...message,
|
|
61120
|
+
commands: squishedCommands
|
|
61121
|
+
};
|
|
61080
61122
|
}
|
|
61081
61123
|
if (this.isReplayingInitialRevisions) throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
|
|
61082
61124
|
${JSON.stringify(message)}`);
|
|
@@ -68773,7 +68815,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68773
68815
|
if (!this.getters.isDashboard()) {
|
|
68774
68816
|
ctx.strokeStyle = GRAY_400;
|
|
68775
68817
|
ctx.lineWidth = 1;
|
|
68776
|
-
ctx.strokeRect(x, y, figure.width, figure.height);
|
|
68818
|
+
ctx.strokeRect(x + .5, y + .5, figure.width - 1, figure.height - 1);
|
|
68777
68819
|
}
|
|
68778
68820
|
}
|
|
68779
68821
|
}
|
|
@@ -84788,8 +84830,8 @@ exports.stores = stores;
|
|
|
84788
84830
|
exports.tokenColors = tokenColors;
|
|
84789
84831
|
exports.tokenize = tokenize;
|
|
84790
84832
|
|
|
84791
|
-
__info__.version = "19.3.
|
|
84792
|
-
__info__.date = "2026-
|
|
84793
|
-
__info__.hash = "
|
|
84833
|
+
__info__.version = "19.3.19";
|
|
84834
|
+
__info__.date = "2026-09-04T07:38:14.356Z";
|
|
84835
|
+
__info__.hash = "c8c526d";
|
|
84794
84836
|
|
|
84795
84837
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|