@odoo/o-spreadsheet 19.0.15 → 19.0.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 +142 -83
- package/dist/o-spreadsheet.d.ts +16 -12
- package/dist/o-spreadsheet.esm.js +142 -83
- package/dist/o-spreadsheet.iife.js +142 -83
- package/dist/o-spreadsheet.iife.min.js +10 -10
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.xml +7 -7
- 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.0.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.0.17
|
|
6
|
+
* @date 2026-01-14T10:01:24.044Z
|
|
7
|
+
* @hash 2165bad
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -20100,9 +20100,10 @@ function assertDomainLength(domain) {
|
|
|
20100
20100
|
throw new EvaluationError(_t("Function PIVOT takes an even number of arguments."));
|
|
20101
20101
|
}
|
|
20102
20102
|
}
|
|
20103
|
-
function addPivotDependencies(evalContext,
|
|
20103
|
+
function addPivotDependencies(evalContext, pivotId, forMeasures) {
|
|
20104
20104
|
//TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
|
|
20105
20105
|
const dependencies = [];
|
|
20106
|
+
const coreDefinition = evalContext.getters.getPivotCoreDefinition(pivotId);
|
|
20106
20107
|
if (coreDefinition.type === "SPREADSHEET" && coreDefinition.dataSet) {
|
|
20107
20108
|
const { sheetId, zone } = coreDefinition.dataSet;
|
|
20108
20109
|
const xc = zoneToXc(zone);
|
|
@@ -20119,8 +20120,7 @@ function addPivotDependencies(evalContext, coreDefinition, forMeasures) {
|
|
|
20119
20120
|
}
|
|
20120
20121
|
for (const measure of forMeasures) {
|
|
20121
20122
|
if (measure.computedBy) {
|
|
20122
|
-
|
|
20123
|
-
dependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
20123
|
+
dependencies.push(...evalContext.getters.getMeasureFullDependencies(pivotId, measure));
|
|
20124
20124
|
}
|
|
20125
20125
|
}
|
|
20126
20126
|
const originPosition = evalContext.__originCellPosition;
|
|
@@ -20617,7 +20617,7 @@ const PIVOT_VALUE = {
|
|
|
20617
20617
|
assertDomainLength(domainArgs);
|
|
20618
20618
|
const pivot = this.getters.getPivot(pivotId);
|
|
20619
20619
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
20620
|
-
addPivotDependencies(this,
|
|
20620
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures.filter((m) => m.id === _measure));
|
|
20621
20621
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
20622
20622
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
20623
20623
|
if (error) {
|
|
@@ -20650,8 +20650,7 @@ const PIVOT_HEADER = {
|
|
|
20650
20650
|
const _pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
20651
20651
|
assertDomainLength(domainArgs);
|
|
20652
20652
|
const pivot = this.getters.getPivot(_pivotId);
|
|
20653
|
-
|
|
20654
|
-
addPivotDependencies(this, coreDefinition, []);
|
|
20653
|
+
addPivotDependencies(this, _pivotId, []);
|
|
20655
20654
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
20656
20655
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
20657
20656
|
if (error) {
|
|
@@ -20709,7 +20708,7 @@ const PIVOT = {
|
|
|
20709
20708
|
const pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
20710
20709
|
const pivot = this.getters.getPivot(pivotId);
|
|
20711
20710
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
20712
|
-
addPivotDependencies(this,
|
|
20711
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures);
|
|
20713
20712
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
20714
20713
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
20715
20714
|
if (error) {
|
|
@@ -35484,7 +35483,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
35484
35483
|
}
|
|
35485
35484
|
captureSelection(zone, col, row) {
|
|
35486
35485
|
this.model.selection.capture(this, {
|
|
35487
|
-
cell: { col: col ?? zone.left, row: row ?? zone.
|
|
35486
|
+
cell: { col: col ?? zone.left, row: row ?? zone.top },
|
|
35488
35487
|
zone,
|
|
35489
35488
|
}, {
|
|
35490
35489
|
handleEvent: this.handleEvent.bind(this),
|
|
@@ -51371,7 +51370,6 @@ class GridOverlay extends owl.Component {
|
|
|
51371
51370
|
onGridMoved: Function,
|
|
51372
51371
|
gridOverlayDimensions: String,
|
|
51373
51372
|
slots: { type: Object, optional: true },
|
|
51374
|
-
getGridSize: Function,
|
|
51375
51373
|
};
|
|
51376
51374
|
static components = {
|
|
51377
51375
|
FiguresContainer,
|
|
@@ -51390,14 +51388,7 @@ class GridOverlay extends owl.Component {
|
|
|
51390
51388
|
setup() {
|
|
51391
51389
|
useCellHovered(this.env, this.gridOverlay);
|
|
51392
51390
|
const resizeObserver = new ResizeObserver(() => {
|
|
51393
|
-
|
|
51394
|
-
const { width, height } = this.props.getGridSize();
|
|
51395
|
-
this.props.onGridResized({
|
|
51396
|
-
x: boundingRect.left,
|
|
51397
|
-
y: boundingRect.top,
|
|
51398
|
-
height: height,
|
|
51399
|
-
width: width,
|
|
51400
|
-
});
|
|
51391
|
+
this.props.onGridResized();
|
|
51401
51392
|
});
|
|
51402
51393
|
owl.onMounted(() => {
|
|
51403
51394
|
resizeObserver.observe(this.gridOverlayEl);
|
|
@@ -57885,6 +57876,12 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
57885
57876
|
case "ACTIVATE_SHEET":
|
|
57886
57877
|
this.isSearchDirty = true;
|
|
57887
57878
|
this.shouldFinalizeUpdateSelection = true;
|
|
57879
|
+
if (this.searchOptions.specificRange) {
|
|
57880
|
+
this.searchOptions.specificRange = {
|
|
57881
|
+
...this.searchOptions.specificRange,
|
|
57882
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
57883
|
+
};
|
|
57884
|
+
}
|
|
57888
57885
|
break;
|
|
57889
57886
|
case "REPLACE_SEARCH":
|
|
57890
57887
|
for (const match of cmd.matches) {
|
|
@@ -58304,9 +58301,20 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
58304
58301
|
const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
|
|
58305
58302
|
this.store.updateSearchOptions({ specificRange });
|
|
58306
58303
|
}
|
|
58304
|
+
get specificRange() {
|
|
58305
|
+
const range = this.store.searchOptions.specificRange;
|
|
58306
|
+
return range ? this.env.model.getters.getRangeString(range, "forceSheetReference") : "";
|
|
58307
|
+
}
|
|
58307
58308
|
get pendingSearch() {
|
|
58308
58309
|
return this.updateSearchContent.isDebouncePending();
|
|
58309
58310
|
}
|
|
58311
|
+
get selectionInputKey() {
|
|
58312
|
+
// Selections input are made to work with objects linked to a sheet id. They store the active sheet id at their creation,
|
|
58313
|
+
// and have specific behaviour linked to it (eg. go back to the initial sheet after confirmation).
|
|
58314
|
+
// We don't want all those behaviors here, so we force the recreation of the component when the active sheet changes.
|
|
58315
|
+
// The only drawback is that the input loses focus when changing sheet.
|
|
58316
|
+
return this.env.model.getters.getActiveSheetId();
|
|
58317
|
+
}
|
|
58310
58318
|
}
|
|
58311
58319
|
|
|
58312
58320
|
css /* scss */ `
|
|
@@ -61421,7 +61429,8 @@ class Grid extends owl.Component {
|
|
|
61421
61429
|
});
|
|
61422
61430
|
return !(rect.width === 0 || rect.height === 0);
|
|
61423
61431
|
}
|
|
61424
|
-
onGridResized(
|
|
61432
|
+
onGridResized() {
|
|
61433
|
+
const { height, width } = this.props.getGridSize();
|
|
61425
61434
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
61426
61435
|
width: width - HEADER_WIDTH,
|
|
61427
61436
|
height: height - HEADER_HEIGHT,
|
|
@@ -67615,6 +67624,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67615
67624
|
"getMeasureCompiledFormula",
|
|
67616
67625
|
"getPivotName",
|
|
67617
67626
|
"isExistingPivot",
|
|
67627
|
+
"getMeasureFullDependencies",
|
|
67618
67628
|
];
|
|
67619
67629
|
nextFormulaId = 1;
|
|
67620
67630
|
pivots = {};
|
|
@@ -67697,7 +67707,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67697
67707
|
}
|
|
67698
67708
|
case "UPDATE_PIVOT": {
|
|
67699
67709
|
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
67700
|
-
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
67710
|
+
this.compileCalculatedMeasures(cmd.pivotId, cmd.pivot.measures);
|
|
67701
67711
|
break;
|
|
67702
67712
|
}
|
|
67703
67713
|
}
|
|
@@ -67715,9 +67725,14 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67715
67725
|
this.history.update("pivots", pivotId, "definition", newDefinition);
|
|
67716
67726
|
}
|
|
67717
67727
|
}
|
|
67718
|
-
for (const
|
|
67719
|
-
for (const
|
|
67720
|
-
const
|
|
67728
|
+
for (const pivotId in this.compiledMeasureFormulas) {
|
|
67729
|
+
for (const measureId in this.compiledMeasureFormulas[pivotId]) {
|
|
67730
|
+
const measure = this.pivots[pivotId]?.definition.measures.find((m) => m.id === measureId);
|
|
67731
|
+
if (!measure || !measure.computedBy) {
|
|
67732
|
+
continue;
|
|
67733
|
+
}
|
|
67734
|
+
const sheetId = measure.computedBy.sheetId;
|
|
67735
|
+
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId].formula;
|
|
67721
67736
|
const newDependencies = [];
|
|
67722
67737
|
for (const range of compiledFormula.dependencies) {
|
|
67723
67738
|
const change = applyChange(range);
|
|
@@ -67729,8 +67744,9 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67729
67744
|
}
|
|
67730
67745
|
}
|
|
67731
67746
|
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
67732
|
-
|
|
67733
|
-
|
|
67747
|
+
const oldFormulaString = measure.computedBy.formula;
|
|
67748
|
+
if (newFormulaString !== oldFormulaString) {
|
|
67749
|
+
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
67734
67750
|
}
|
|
67735
67751
|
}
|
|
67736
67752
|
}
|
|
@@ -67768,31 +67784,60 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67768
67784
|
isExistingPivot(pivotId) {
|
|
67769
67785
|
return pivotId in this.pivots;
|
|
67770
67786
|
}
|
|
67771
|
-
getMeasureCompiledFormula(measure) {
|
|
67787
|
+
getMeasureCompiledFormula(pivotId, measure) {
|
|
67772
67788
|
if (!measure.computedBy) {
|
|
67773
67789
|
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
67774
67790
|
}
|
|
67775
|
-
|
|
67776
|
-
|
|
67791
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].formula;
|
|
67792
|
+
}
|
|
67793
|
+
getMeasureFullDependencies(pivotId, measure) {
|
|
67794
|
+
if (!measure.computedBy) {
|
|
67795
|
+
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
67796
|
+
}
|
|
67797
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].dependencies;
|
|
67777
67798
|
}
|
|
67778
67799
|
// -------------------------------------------------------------------------
|
|
67779
67800
|
// Private
|
|
67780
67801
|
// -------------------------------------------------------------------------
|
|
67781
67802
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
67782
67803
|
this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
|
|
67783
|
-
this.compileCalculatedMeasures(pivot.measures);
|
|
67804
|
+
this.compileCalculatedMeasures(pivotId, pivot.measures);
|
|
67784
67805
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
67785
67806
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
67786
67807
|
}
|
|
67787
|
-
compileCalculatedMeasures(measures) {
|
|
67808
|
+
compileCalculatedMeasures(pivotId, measures) {
|
|
67788
67809
|
for (const measure of measures) {
|
|
67789
67810
|
if (measure.computedBy) {
|
|
67790
|
-
const sheetId = measure.computedBy.sheetId;
|
|
67791
67811
|
const compiledFormula = this.compileMeasureFormula(measure.computedBy.sheetId, measure.computedBy.formula);
|
|
67792
|
-
this.history.update("compiledMeasureFormulas",
|
|
67812
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "formula", compiledFormula);
|
|
67813
|
+
}
|
|
67814
|
+
}
|
|
67815
|
+
for (const measure of measures) {
|
|
67816
|
+
if (measure.computedBy) {
|
|
67817
|
+
const dependencies = this.computeMeasureFullDependencies(pivotId, measure);
|
|
67818
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", dependencies);
|
|
67793
67819
|
}
|
|
67794
67820
|
}
|
|
67795
67821
|
}
|
|
67822
|
+
computeMeasureFullDependencies(pivotId, measure, exploredMeasures = new Set()) {
|
|
67823
|
+
const rangeDependencies = [];
|
|
67824
|
+
const definition = this.getPivotCoreDefinition(pivotId);
|
|
67825
|
+
const formula = this.getMeasureCompiledFormula(pivotId, measure);
|
|
67826
|
+
exploredMeasures.add(measure.id);
|
|
67827
|
+
for (const token of formula.tokens) {
|
|
67828
|
+
if (token.type !== "SYMBOL") {
|
|
67829
|
+
continue;
|
|
67830
|
+
}
|
|
67831
|
+
const otherMeasure = definition.measures.find((measureCandidate) => getCanonicalSymbolName(measureCandidate.id) === token.value &&
|
|
67832
|
+
measure.id !== measureCandidate.id);
|
|
67833
|
+
if (!otherMeasure || exploredMeasures.has(otherMeasure.id) || !otherMeasure.computedBy) {
|
|
67834
|
+
continue;
|
|
67835
|
+
}
|
|
67836
|
+
rangeDependencies.push(...this.computeMeasureFullDependencies(pivotId, otherMeasure, exploredMeasures));
|
|
67837
|
+
}
|
|
67838
|
+
rangeDependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
67839
|
+
return rangeDependencies;
|
|
67840
|
+
}
|
|
67796
67841
|
insertPivot(position, formulaId, table) {
|
|
67797
67842
|
this.resizeSheet(position.sheetId, position, table);
|
|
67798
67843
|
const pivotCells = table.getPivotCells();
|
|
@@ -67851,21 +67896,17 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
67851
67896
|
dependencies: rangeDependencies,
|
|
67852
67897
|
};
|
|
67853
67898
|
}
|
|
67854
|
-
replaceMeasureFormula(
|
|
67855
|
-
|
|
67856
|
-
|
|
67857
|
-
|
|
67858
|
-
const pivot = this.pivots[pivotId];
|
|
67859
|
-
if (!pivot) {
|
|
67860
|
-
continue;
|
|
67861
|
-
}
|
|
67862
|
-
for (const measure of pivot.definition.measures) {
|
|
67863
|
-
if (measure.computedBy?.formula === formulaString) {
|
|
67864
|
-
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
67865
|
-
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
|
|
67866
|
-
}
|
|
67867
|
-
}
|
|
67899
|
+
replaceMeasureFormula(pivotId, measure, newFormulaString) {
|
|
67900
|
+
const pivot = this.pivots[pivotId];
|
|
67901
|
+
if (!pivot) {
|
|
67902
|
+
return;
|
|
67868
67903
|
}
|
|
67904
|
+
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
67905
|
+
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", {
|
|
67906
|
+
formula: newFormulaString,
|
|
67907
|
+
sheetId: measure.computedBy.sheetId,
|
|
67908
|
+
});
|
|
67909
|
+
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
67869
67910
|
}
|
|
67870
67911
|
checkSortedColumnInMeasures(definition) {
|
|
67871
67912
|
const measures = definition.measures.map((measure) => measure.id);
|
|
@@ -71715,14 +71756,16 @@ const PERCENT_FORMAT = "0.00%";
|
|
|
71715
71756
|
function withPivotPresentationLayer (PivotClass) {
|
|
71716
71757
|
class PivotPresentationLayer extends PivotClass {
|
|
71717
71758
|
getters;
|
|
71759
|
+
pivotId;
|
|
71718
71760
|
cache = {};
|
|
71719
71761
|
rankAsc = {};
|
|
71720
71762
|
rankDesc = {};
|
|
71721
71763
|
runningTotal = {};
|
|
71722
71764
|
runningTotalInPercent = {};
|
|
71723
|
-
constructor(custom, params) {
|
|
71765
|
+
constructor(pivotId, custom, params) {
|
|
71724
71766
|
super(custom, params);
|
|
71725
71767
|
this.getters = params.getters;
|
|
71768
|
+
this.pivotId = pivotId;
|
|
71726
71769
|
}
|
|
71727
71770
|
markAsDirtyForEvaluation() {
|
|
71728
71771
|
this.cache = {};
|
|
@@ -71772,7 +71815,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
71772
71815
|
return handleError(error, measure.aggregator.toUpperCase());
|
|
71773
71816
|
}
|
|
71774
71817
|
}
|
|
71775
|
-
const formula = this.getters.getMeasureCompiledFormula(measure);
|
|
71818
|
+
const formula = this.getters.getMeasureCompiledFormula(this.pivotId, measure);
|
|
71776
71819
|
const getSymbolValue = (symbolName) => {
|
|
71777
71820
|
const { columns, rows } = this.definition;
|
|
71778
71821
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
@@ -72527,7 +72570,7 @@ class PivotUIPlugin extends CoreViewPlugin {
|
|
|
72527
72570
|
const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
|
|
72528
72571
|
if (!(pivotId in this.pivots)) {
|
|
72529
72572
|
const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
|
|
72530
|
-
this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
|
|
72573
|
+
this.pivots[pivotId] = new Pivot(pivotId, this.custom, { definition, getters: this.getters });
|
|
72531
72574
|
}
|
|
72532
72575
|
else if (recreate) {
|
|
72533
72576
|
this.pivots[pivotId].onDefinitionChange(definition);
|
|
@@ -74419,7 +74462,7 @@ class Session extends EventBus {
|
|
|
74419
74462
|
}
|
|
74420
74463
|
delete this.clients[this.clientId];
|
|
74421
74464
|
this.transportService.leave(this.clientId);
|
|
74422
|
-
this.
|
|
74465
|
+
this.sendToTransport({
|
|
74423
74466
|
type: "CLIENT_LEFT",
|
|
74424
74467
|
clientId: this.clientId,
|
|
74425
74468
|
version: MESSAGE_VERSION,
|
|
@@ -74433,7 +74476,7 @@ class Session extends EventBus {
|
|
|
74433
74476
|
return;
|
|
74434
74477
|
}
|
|
74435
74478
|
const snapshotId = this.uuidGenerator.uuidv4();
|
|
74436
|
-
await this.
|
|
74479
|
+
await this.sendToTransport({
|
|
74437
74480
|
type: "SNAPSHOT",
|
|
74438
74481
|
nextRevisionId: snapshotId,
|
|
74439
74482
|
serverRevisionId: this.serverRevisionId,
|
|
@@ -74481,10 +74524,14 @@ class Session extends EventBus {
|
|
|
74481
74524
|
const type = currentPosition ? "CLIENT_MOVED" : "CLIENT_JOINED";
|
|
74482
74525
|
const client = this.getCurrentClient();
|
|
74483
74526
|
this.clients[this.clientId] = { ...client, position };
|
|
74484
|
-
this.
|
|
74527
|
+
this.sendToTransport({
|
|
74485
74528
|
type,
|
|
74486
74529
|
version: MESSAGE_VERSION,
|
|
74487
74530
|
client: { ...client, position },
|
|
74531
|
+
}).then(() => {
|
|
74532
|
+
if (this.pendingMessages.length > 0 && !this.waitingAck) {
|
|
74533
|
+
this.sendPendingMessage();
|
|
74534
|
+
}
|
|
74488
74535
|
});
|
|
74489
74536
|
}
|
|
74490
74537
|
/**
|
|
@@ -74565,7 +74612,7 @@ class Session extends EventBus {
|
|
|
74565
74612
|
if (client) {
|
|
74566
74613
|
const { position } = client;
|
|
74567
74614
|
if (position) {
|
|
74568
|
-
this.
|
|
74615
|
+
this.sendToTransport({
|
|
74569
74616
|
type: "CLIENT_MOVED",
|
|
74570
74617
|
version: MESSAGE_VERSION,
|
|
74571
74618
|
client: { ...client, position },
|
|
@@ -74586,6 +74633,10 @@ class Session extends EventBus {
|
|
|
74586
74633
|
}
|
|
74587
74634
|
this.sendPendingMessage();
|
|
74588
74635
|
}
|
|
74636
|
+
async sendToTransport(message) {
|
|
74637
|
+
// wrap in an async function to ensure it returns a promise
|
|
74638
|
+
return this.transportService.sendMessage(message);
|
|
74639
|
+
}
|
|
74589
74640
|
/**
|
|
74590
74641
|
* Send the next pending message
|
|
74591
74642
|
*/
|
|
@@ -74614,9 +74665,14 @@ class Session extends EventBus {
|
|
|
74614
74665
|
${JSON.stringify(message)}`);
|
|
74615
74666
|
}
|
|
74616
74667
|
this.waitingAck = true;
|
|
74617
|
-
this.
|
|
74668
|
+
this.sendToTransport({
|
|
74618
74669
|
...message,
|
|
74619
74670
|
serverRevisionId: this.serverRevisionId,
|
|
74671
|
+
}).catch((e) => {
|
|
74672
|
+
if (!(e instanceof ClientDisconnectedError)) {
|
|
74673
|
+
throw e.cause || e;
|
|
74674
|
+
}
|
|
74675
|
+
this.waitingAck = false;
|
|
74620
74676
|
});
|
|
74621
74677
|
}
|
|
74622
74678
|
acknowledge(message) {
|
|
@@ -82122,10 +82178,8 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
82122
82178
|
});
|
|
82123
82179
|
}
|
|
82124
82180
|
get gridContainer() {
|
|
82125
|
-
const
|
|
82126
|
-
|
|
82127
|
-
const { end } = this.env.model.getters.getColDimensions(sheetId, right);
|
|
82128
|
-
return cssPropertiesToCss({ "max-width": `${end}px` });
|
|
82181
|
+
const maxWidth = this.getMaxSheetWidth();
|
|
82182
|
+
return cssPropertiesToCss({ "max-width": `${maxWidth}px` });
|
|
82129
82183
|
}
|
|
82130
82184
|
get gridOverlayDimensions() {
|
|
82131
82185
|
return cssPropertiesToCss({
|
|
@@ -82157,10 +82211,12 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
82157
82211
|
onClosePopover() {
|
|
82158
82212
|
this.cellPopovers.close();
|
|
82159
82213
|
}
|
|
82160
|
-
onGridResized(
|
|
82214
|
+
onGridResized() {
|
|
82215
|
+
const { height, width } = this.props.getGridSize();
|
|
82216
|
+
const maxWidth = this.getMaxSheetWidth();
|
|
82161
82217
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
82162
|
-
width: width,
|
|
82163
|
-
height
|
|
82218
|
+
width: Math.min(maxWidth, width),
|
|
82219
|
+
height,
|
|
82164
82220
|
gridOffsetX: 0,
|
|
82165
82221
|
gridOffsetY: 0,
|
|
82166
82222
|
});
|
|
@@ -82178,6 +82234,11 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
82178
82234
|
...this.env.model.getters.getSheetViewDimensionWithHeaders(),
|
|
82179
82235
|
};
|
|
82180
82236
|
}
|
|
82237
|
+
getMaxSheetWidth() {
|
|
82238
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
82239
|
+
const { right } = this.env.model.getters.getSheetZone(sheetId);
|
|
82240
|
+
return this.env.model.getters.getColDimensions(sheetId, right).end;
|
|
82241
|
+
}
|
|
82181
82242
|
}
|
|
82182
82243
|
|
|
82183
82244
|
css /* scss */ `
|
|
@@ -84419,22 +84480,20 @@ class Spreadsheet extends owl.Component {
|
|
|
84419
84480
|
return this.env.model.getters.getVisibleGroupLayers(sheetId, "COL");
|
|
84420
84481
|
}
|
|
84421
84482
|
getGridSize() {
|
|
84422
|
-
const
|
|
84423
|
-
|
|
84424
|
-
|
|
84425
|
-
|
|
84426
|
-
|
|
84427
|
-
|
|
84428
|
-
const
|
|
84429
|
-
const
|
|
84430
|
-
|
|
84431
|
-
|
|
84432
|
-
|
|
84433
|
-
|
|
84434
|
-
|
|
84435
|
-
|
|
84436
|
-
height: Math.max(gridHeight - SCROLLBAR_WIDTH, 0),
|
|
84437
|
-
};
|
|
84483
|
+
const el = this.spreadsheetRef.el;
|
|
84484
|
+
if (!el) {
|
|
84485
|
+
return { width: 0, height: 0 };
|
|
84486
|
+
}
|
|
84487
|
+
const getHeight = (selector) => el.querySelector(selector)?.getBoundingClientRect().height || 0;
|
|
84488
|
+
const getWidth = (selector) => el.querySelector(selector)?.getBoundingClientRect().width || 0;
|
|
84489
|
+
const rect = el.getBoundingClientRect();
|
|
84490
|
+
const topBarHeight = getHeight(".o-spreadsheet-topbar-wrapper");
|
|
84491
|
+
const bottomBarHeight = getHeight(".o-spreadsheet-bottombar-wrapper");
|
|
84492
|
+
const colGroupHeight = getHeight(".o-column-groups");
|
|
84493
|
+
const gridWidth = getWidth(".o-grid");
|
|
84494
|
+
const width = Math.max(gridWidth - SCROLLBAR_WIDTH, 0);
|
|
84495
|
+
const height = Math.max(rect.height - topBarHeight - bottomBarHeight - colGroupHeight - SCROLLBAR_WIDTH, 0);
|
|
84496
|
+
return { width, height };
|
|
84438
84497
|
}
|
|
84439
84498
|
}
|
|
84440
84499
|
|
|
@@ -84447,7 +84506,7 @@ class ReadonlyTransportFilter {
|
|
|
84447
84506
|
if (message.type === "CLIENT_JOINED" ||
|
|
84448
84507
|
message.type === "CLIENT_LEFT" ||
|
|
84449
84508
|
message.type === "CLIENT_MOVED") {
|
|
84450
|
-
this.transportService.sendMessage(message);
|
|
84509
|
+
await this.transportService.sendMessage(message);
|
|
84451
84510
|
}
|
|
84452
84511
|
// ignore all other messages
|
|
84453
84512
|
}
|
|
@@ -89116,6 +89175,6 @@ exports.tokenColors = tokenColors;
|
|
|
89116
89175
|
exports.tokenize = tokenize;
|
|
89117
89176
|
|
|
89118
89177
|
|
|
89119
|
-
__info__.version = "19.0.
|
|
89120
|
-
__info__.date = "
|
|
89121
|
-
__info__.hash = "
|
|
89178
|
+
__info__.version = "19.0.17";
|
|
89179
|
+
__info__.date = "2026-01-14T10:01:24.044Z";
|
|
89180
|
+
__info__.hash = "2165bad";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -2290,14 +2290,18 @@ interface Pivot$1 {
|
|
|
2290
2290
|
definition: PivotCoreDefinition;
|
|
2291
2291
|
formulaId: string;
|
|
2292
2292
|
}
|
|
2293
|
+
interface MeasureState {
|
|
2294
|
+
formula: RangeCompiledFormula;
|
|
2295
|
+
dependencies: Range[];
|
|
2296
|
+
}
|
|
2293
2297
|
interface CoreState {
|
|
2294
2298
|
nextFormulaId: number;
|
|
2295
2299
|
pivots: Record<UID, Pivot$1 | undefined>;
|
|
2296
2300
|
formulaIds: Record<UID, string | undefined>;
|
|
2297
|
-
compiledMeasureFormulas: Record<UID, Record<string,
|
|
2301
|
+
compiledMeasureFormulas: Record<UID, Record<string, MeasureState | undefined>>;
|
|
2298
2302
|
}
|
|
2299
2303
|
declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState {
|
|
2300
|
-
static getters: readonly ["getPivotCoreDefinition", "getPivotDisplayName", "getPivotId", "getPivotFormulaId", "getPivotIds", "getMeasureCompiledFormula", "getPivotName", "isExistingPivot"];
|
|
2304
|
+
static getters: readonly ["getPivotCoreDefinition", "getPivotDisplayName", "getPivotId", "getPivotFormulaId", "getPivotIds", "getMeasureCompiledFormula", "getPivotName", "isExistingPivot", "getMeasureFullDependencies"];
|
|
2301
2305
|
readonly nextFormulaId: number;
|
|
2302
2306
|
readonly pivots: {
|
|
2303
2307
|
[pivotId: UID]: Pivot$1 | undefined;
|
|
@@ -2305,7 +2309,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
2305
2309
|
readonly formulaIds: {
|
|
2306
2310
|
[formulaId: UID]: UID | undefined;
|
|
2307
2311
|
};
|
|
2308
|
-
readonly compiledMeasureFormulas: Record<UID, Record<string,
|
|
2312
|
+
readonly compiledMeasureFormulas: Record<UID, Record<string, MeasureState>>;
|
|
2309
2313
|
allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
|
|
2310
2314
|
handle(cmd: CoreCommand): void;
|
|
2311
2315
|
adaptRanges(applyChange: ApplyRangeChange): void;
|
|
@@ -2324,9 +2328,11 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
2324
2328
|
getPivotFormulaId(pivotId: UID): string;
|
|
2325
2329
|
getPivotIds(): UID[];
|
|
2326
2330
|
isExistingPivot(pivotId: UID): boolean;
|
|
2327
|
-
getMeasureCompiledFormula(measure: PivotCoreMeasure): RangeCompiledFormula;
|
|
2331
|
+
getMeasureCompiledFormula(pivotId: UID, measure: PivotCoreMeasure): RangeCompiledFormula;
|
|
2332
|
+
getMeasureFullDependencies(pivotId: UID, measure: PivotCoreMeasure): Range[];
|
|
2328
2333
|
private addPivot;
|
|
2329
2334
|
private compileCalculatedMeasures;
|
|
2335
|
+
private computeMeasureFullDependencies;
|
|
2330
2336
|
private insertPivot;
|
|
2331
2337
|
private resizeSheet;
|
|
2332
2338
|
private getPivotCore;
|
|
@@ -4714,6 +4720,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
|
|
|
4714
4720
|
private onClientJoined;
|
|
4715
4721
|
private onClientLeft;
|
|
4716
4722
|
private sendUpdateMessage;
|
|
4723
|
+
private sendToTransport;
|
|
4717
4724
|
/**
|
|
4718
4725
|
* Send the next pending message
|
|
4719
4726
|
*/
|
|
@@ -10025,13 +10032,9 @@ interface Props$N {
|
|
|
10025
10032
|
onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
|
|
10026
10033
|
onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: GridClickModifiers, ev: PointerEvent | MouseEvent) => void;
|
|
10027
10034
|
onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
|
|
10028
|
-
onGridResized: (
|
|
10035
|
+
onGridResized: () => void;
|
|
10029
10036
|
onGridMoved: (deltaX: Pixel, deltaY: Pixel) => void;
|
|
10030
10037
|
gridOverlayDimensions: string;
|
|
10031
|
-
getGridSize: () => {
|
|
10032
|
-
width: number;
|
|
10033
|
-
height: number;
|
|
10034
|
-
};
|
|
10035
10038
|
}
|
|
10036
10039
|
declare class GridOverlay extends Component<Props$N, SpreadsheetChildEnv> {
|
|
10037
10040
|
static template: string;
|
|
@@ -10058,7 +10061,6 @@ declare class GridOverlay extends Component<Props$N, SpreadsheetChildEnv> {
|
|
|
10058
10061
|
type: ObjectConstructor;
|
|
10059
10062
|
optional: boolean;
|
|
10060
10063
|
};
|
|
10061
|
-
getGridSize: FunctionConstructor;
|
|
10062
10064
|
};
|
|
10063
10065
|
static components: {
|
|
10064
10066
|
FiguresContainer: typeof FiguresContainer;
|
|
@@ -10598,7 +10600,7 @@ declare class Grid extends Component<Props$E, SpreadsheetChildEnv> {
|
|
|
10598
10600
|
top: number;
|
|
10599
10601
|
};
|
|
10600
10602
|
get isAutofillVisible(): boolean;
|
|
10601
|
-
onGridResized(
|
|
10603
|
+
onGridResized(): void;
|
|
10602
10604
|
private moveCanvas;
|
|
10603
10605
|
private processSpaceKey;
|
|
10604
10606
|
getClientPositionKey(client: Client): string;
|
|
@@ -12502,6 +12504,7 @@ declare class ClickableCellsStore extends SpreadsheetStore {
|
|
|
12502
12504
|
}
|
|
12503
12505
|
|
|
12504
12506
|
interface Props$4 {
|
|
12507
|
+
getGridSize: () => DOMDimension;
|
|
12505
12508
|
}
|
|
12506
12509
|
declare class SpreadsheetDashboard extends Component<Props$4, SpreadsheetChildEnv> {
|
|
12507
12510
|
static template: string;
|
|
@@ -12534,9 +12537,10 @@ declare class SpreadsheetDashboard extends Component<Props$4, SpreadsheetChildEn
|
|
|
12534
12537
|
getClickableCells(): ClickableCell[];
|
|
12535
12538
|
selectClickableCell(ev: MouseEvent, clickableCell: ClickableCell): void;
|
|
12536
12539
|
onClosePopover(): void;
|
|
12537
|
-
onGridResized(
|
|
12540
|
+
onGridResized(): void;
|
|
12538
12541
|
private moveCanvas;
|
|
12539
12542
|
private getGridRect;
|
|
12543
|
+
private getMaxSheetWidth;
|
|
12540
12544
|
}
|
|
12541
12545
|
|
|
12542
12546
|
interface Props$3 {
|