@odoo/o-spreadsheet 18.4.22 → 18.4.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 +123 -77
- package/dist/o-spreadsheet.d.ts +15 -12
- package/dist/o-spreadsheet.esm.js +123 -77
- package/dist/o-spreadsheet.iife.js +123 -77
- package/dist/o-spreadsheet.iife.min.js +10 -10
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.xml +6 -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 18.4.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.4.24
|
|
6
|
+
* @date 2026-01-14T10:00:55.867Z
|
|
7
|
+
* @hash 0364f56
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -19070,9 +19070,10 @@ function assertDomainLength(domain) {
|
|
|
19070
19070
|
throw new EvaluationError(_t("Function PIVOT takes an even number of arguments."));
|
|
19071
19071
|
}
|
|
19072
19072
|
}
|
|
19073
|
-
function addPivotDependencies(evalContext,
|
|
19073
|
+
function addPivotDependencies(evalContext, pivotId, forMeasures) {
|
|
19074
19074
|
//TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
|
|
19075
19075
|
const dependencies = [];
|
|
19076
|
+
const coreDefinition = evalContext.getters.getPivotCoreDefinition(pivotId);
|
|
19076
19077
|
if (coreDefinition.type === "SPREADSHEET" && coreDefinition.dataSet) {
|
|
19077
19078
|
const { sheetId, zone } = coreDefinition.dataSet;
|
|
19078
19079
|
const xc = zoneToXc(zone);
|
|
@@ -19089,8 +19090,7 @@ function addPivotDependencies(evalContext, coreDefinition, forMeasures) {
|
|
|
19089
19090
|
}
|
|
19090
19091
|
for (const measure of forMeasures) {
|
|
19091
19092
|
if (measure.computedBy) {
|
|
19092
|
-
|
|
19093
|
-
dependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
19093
|
+
dependencies.push(...evalContext.getters.getMeasureFullDependencies(pivotId, measure));
|
|
19094
19094
|
}
|
|
19095
19095
|
}
|
|
19096
19096
|
const originPosition = evalContext.__originCellPosition;
|
|
@@ -19559,7 +19559,7 @@ const PIVOT_VALUE = {
|
|
|
19559
19559
|
assertDomainLength(domainArgs);
|
|
19560
19560
|
const pivot = this.getters.getPivot(pivotId);
|
|
19561
19561
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19562
|
-
addPivotDependencies(this,
|
|
19562
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures.filter((m) => m.id === _measure));
|
|
19563
19563
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19564
19564
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19565
19565
|
if (error) {
|
|
@@ -19592,8 +19592,7 @@ const PIVOT_HEADER = {
|
|
|
19592
19592
|
const _pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19593
19593
|
assertDomainLength(domainArgs);
|
|
19594
19594
|
const pivot = this.getters.getPivot(_pivotId);
|
|
19595
|
-
|
|
19596
|
-
addPivotDependencies(this, coreDefinition, []);
|
|
19595
|
+
addPivotDependencies(this, _pivotId, []);
|
|
19597
19596
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19598
19597
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19599
19598
|
if (error) {
|
|
@@ -19651,7 +19650,7 @@ const PIVOT = {
|
|
|
19651
19650
|
const pivotId = getPivotId(_pivotFormulaId, this.getters);
|
|
19652
19651
|
const pivot = this.getters.getPivot(pivotId);
|
|
19653
19652
|
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
|
|
19654
|
-
addPivotDependencies(this,
|
|
19653
|
+
addPivotDependencies(this, pivotId, coreDefinition.measures);
|
|
19655
19654
|
pivot.init({ reload: pivot.needsReevaluation });
|
|
19656
19655
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
19657
19656
|
if (error) {
|
|
@@ -32905,7 +32904,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
32905
32904
|
}
|
|
32906
32905
|
captureSelection(zone, col, row) {
|
|
32907
32906
|
this.model.selection.capture(this, {
|
|
32908
|
-
cell: { col: col ?? zone.left, row: row ?? zone.
|
|
32907
|
+
cell: { col: col ?? zone.left, row: row ?? zone.top },
|
|
32909
32908
|
zone,
|
|
32910
32909
|
}, {
|
|
32911
32910
|
handleEvent: this.handleEvent.bind(this),
|
|
@@ -47106,7 +47105,6 @@ class GridOverlay extends owl.Component {
|
|
|
47106
47105
|
onGridMoved: Function,
|
|
47107
47106
|
gridOverlayDimensions: String,
|
|
47108
47107
|
slots: { type: Object, optional: true },
|
|
47109
|
-
getGridSize: Function,
|
|
47110
47108
|
};
|
|
47111
47109
|
static components = {
|
|
47112
47110
|
FiguresContainer,
|
|
@@ -47125,14 +47123,7 @@ class GridOverlay extends owl.Component {
|
|
|
47125
47123
|
setup() {
|
|
47126
47124
|
useCellHovered(this.env, this.gridOverlay);
|
|
47127
47125
|
const resizeObserver = new ResizeObserver(() => {
|
|
47128
|
-
|
|
47129
|
-
const { width, height } = this.props.getGridSize();
|
|
47130
|
-
this.props.onGridResized({
|
|
47131
|
-
x: boundingRect.left,
|
|
47132
|
-
y: boundingRect.top,
|
|
47133
|
-
height: height,
|
|
47134
|
-
width: width,
|
|
47135
|
-
});
|
|
47126
|
+
this.props.onGridResized();
|
|
47136
47127
|
});
|
|
47137
47128
|
owl.onMounted(() => {
|
|
47138
47129
|
resizeObserver.observe(this.gridOverlayEl);
|
|
@@ -53213,6 +53204,12 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
53213
53204
|
case "ACTIVATE_SHEET":
|
|
53214
53205
|
this.isSearchDirty = true;
|
|
53215
53206
|
this.shouldFinalizeUpdateSelection = true;
|
|
53207
|
+
if (this.searchOptions.specificRange) {
|
|
53208
|
+
this.searchOptions.specificRange = {
|
|
53209
|
+
...this.searchOptions.specificRange,
|
|
53210
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
53211
|
+
};
|
|
53212
|
+
}
|
|
53216
53213
|
break;
|
|
53217
53214
|
case "REPLACE_SEARCH":
|
|
53218
53215
|
for (const match of cmd.matches) {
|
|
@@ -53632,9 +53629,20 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
53632
53629
|
const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
|
|
53633
53630
|
this.store.updateSearchOptions({ specificRange });
|
|
53634
53631
|
}
|
|
53632
|
+
get specificRange() {
|
|
53633
|
+
const range = this.store.searchOptions.specificRange;
|
|
53634
|
+
return range ? this.env.model.getters.getRangeString(range, "forceSheetReference") : "";
|
|
53635
|
+
}
|
|
53635
53636
|
get pendingSearch() {
|
|
53636
53637
|
return this.updateSearchContent.isDebouncePending();
|
|
53637
53638
|
}
|
|
53639
|
+
get selectionInputKey() {
|
|
53640
|
+
// Selections input are made to work with objects linked to a sheet id. They store the active sheet id at their creation,
|
|
53641
|
+
// and have specific behaviour linked to it (eg. go back to the initial sheet after confirmation).
|
|
53642
|
+
// We don't want all those behaviors here, so we force the recreation of the component when the active sheet changes.
|
|
53643
|
+
// The only drawback is that the input loses focus when changing sheet.
|
|
53644
|
+
return this.env.model.getters.getActiveSheetId();
|
|
53645
|
+
}
|
|
53638
53646
|
}
|
|
53639
53647
|
|
|
53640
53648
|
css /* scss */ `
|
|
@@ -58068,7 +58076,8 @@ class Grid extends owl.Component {
|
|
|
58068
58076
|
});
|
|
58069
58077
|
return !(rect.width === 0 || rect.height === 0);
|
|
58070
58078
|
}
|
|
58071
|
-
onGridResized(
|
|
58079
|
+
onGridResized() {
|
|
58080
|
+
const { height, width } = this.props.getGridSize();
|
|
58072
58081
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
58073
58082
|
width: width - HEADER_WIDTH,
|
|
58074
58083
|
height: height - HEADER_HEIGHT,
|
|
@@ -64260,6 +64269,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64260
64269
|
"getMeasureCompiledFormula",
|
|
64261
64270
|
"getPivotName",
|
|
64262
64271
|
"isExistingPivot",
|
|
64272
|
+
"getMeasureFullDependencies",
|
|
64263
64273
|
];
|
|
64264
64274
|
nextFormulaId = 1;
|
|
64265
64275
|
pivots = {};
|
|
@@ -64342,7 +64352,7 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64342
64352
|
}
|
|
64343
64353
|
case "UPDATE_PIVOT": {
|
|
64344
64354
|
this.history.update("pivots", cmd.pivotId, "definition", deepCopy(cmd.pivot));
|
|
64345
|
-
this.compileCalculatedMeasures(cmd.pivot.measures);
|
|
64355
|
+
this.compileCalculatedMeasures(cmd.pivotId, cmd.pivot.measures);
|
|
64346
64356
|
break;
|
|
64347
64357
|
}
|
|
64348
64358
|
}
|
|
@@ -64360,9 +64370,14 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64360
64370
|
this.history.update("pivots", pivotId, "definition", newDefinition);
|
|
64361
64371
|
}
|
|
64362
64372
|
}
|
|
64363
|
-
for (const
|
|
64364
|
-
for (const
|
|
64365
|
-
const
|
|
64373
|
+
for (const pivotId in this.compiledMeasureFormulas) {
|
|
64374
|
+
for (const measureId in this.compiledMeasureFormulas[pivotId]) {
|
|
64375
|
+
const measure = this.pivots[pivotId]?.definition.measures.find((m) => m.id === measureId);
|
|
64376
|
+
if (!measure || !measure.computedBy) {
|
|
64377
|
+
continue;
|
|
64378
|
+
}
|
|
64379
|
+
const sheetId = measure.computedBy.sheetId;
|
|
64380
|
+
const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId].formula;
|
|
64366
64381
|
const newDependencies = [];
|
|
64367
64382
|
for (const range of compiledFormula.dependencies) {
|
|
64368
64383
|
const change = applyChange(range);
|
|
@@ -64374,8 +64389,9 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64374
64389
|
}
|
|
64375
64390
|
}
|
|
64376
64391
|
const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
|
|
64377
|
-
|
|
64378
|
-
|
|
64392
|
+
const oldFormulaString = measure.computedBy.formula;
|
|
64393
|
+
if (newFormulaString !== oldFormulaString) {
|
|
64394
|
+
this.replaceMeasureFormula(pivotId, measure, newFormulaString);
|
|
64379
64395
|
}
|
|
64380
64396
|
}
|
|
64381
64397
|
}
|
|
@@ -64413,31 +64429,60 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64413
64429
|
isExistingPivot(pivotId) {
|
|
64414
64430
|
return pivotId in this.pivots;
|
|
64415
64431
|
}
|
|
64416
|
-
getMeasureCompiledFormula(measure) {
|
|
64432
|
+
getMeasureCompiledFormula(pivotId, measure) {
|
|
64417
64433
|
if (!measure.computedBy) {
|
|
64418
64434
|
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
64419
64435
|
}
|
|
64420
|
-
|
|
64421
|
-
|
|
64436
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].formula;
|
|
64437
|
+
}
|
|
64438
|
+
getMeasureFullDependencies(pivotId, measure) {
|
|
64439
|
+
if (!measure.computedBy) {
|
|
64440
|
+
throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
|
|
64441
|
+
}
|
|
64442
|
+
return this.compiledMeasureFormulas[pivotId][measure.id].dependencies;
|
|
64422
64443
|
}
|
|
64423
64444
|
// -------------------------------------------------------------------------
|
|
64424
64445
|
// Private
|
|
64425
64446
|
// -------------------------------------------------------------------------
|
|
64426
64447
|
addPivot(pivotId, pivot, formulaId = this.nextFormulaId.toString()) {
|
|
64427
64448
|
this.history.update("pivots", pivotId, { definition: deepCopy(pivot), formulaId });
|
|
64428
|
-
this.compileCalculatedMeasures(pivot.measures);
|
|
64449
|
+
this.compileCalculatedMeasures(pivotId, pivot.measures);
|
|
64429
64450
|
this.history.update("formulaIds", formulaId, pivotId);
|
|
64430
64451
|
this.history.update("nextFormulaId", this.nextFormulaId + 1);
|
|
64431
64452
|
}
|
|
64432
|
-
compileCalculatedMeasures(measures) {
|
|
64453
|
+
compileCalculatedMeasures(pivotId, measures) {
|
|
64433
64454
|
for (const measure of measures) {
|
|
64434
64455
|
if (measure.computedBy) {
|
|
64435
|
-
const sheetId = measure.computedBy.sheetId;
|
|
64436
64456
|
const compiledFormula = this.compileMeasureFormula(measure.computedBy.sheetId, measure.computedBy.formula);
|
|
64437
|
-
this.history.update("compiledMeasureFormulas",
|
|
64457
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "formula", compiledFormula);
|
|
64458
|
+
}
|
|
64459
|
+
}
|
|
64460
|
+
for (const measure of measures) {
|
|
64461
|
+
if (measure.computedBy) {
|
|
64462
|
+
const dependencies = this.computeMeasureFullDependencies(pivotId, measure);
|
|
64463
|
+
this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", dependencies);
|
|
64438
64464
|
}
|
|
64439
64465
|
}
|
|
64440
64466
|
}
|
|
64467
|
+
computeMeasureFullDependencies(pivotId, measure, exploredMeasures = new Set()) {
|
|
64468
|
+
const rangeDependencies = [];
|
|
64469
|
+
const definition = this.getPivotCoreDefinition(pivotId);
|
|
64470
|
+
const formula = this.getMeasureCompiledFormula(pivotId, measure);
|
|
64471
|
+
exploredMeasures.add(measure.id);
|
|
64472
|
+
for (const token of formula.tokens) {
|
|
64473
|
+
if (token.type !== "SYMBOL") {
|
|
64474
|
+
continue;
|
|
64475
|
+
}
|
|
64476
|
+
const otherMeasure = definition.measures.find((measureCandidate) => getCanonicalSymbolName(measureCandidate.id) === token.value &&
|
|
64477
|
+
measure.id !== measureCandidate.id);
|
|
64478
|
+
if (!otherMeasure || exploredMeasures.has(otherMeasure.id) || !otherMeasure.computedBy) {
|
|
64479
|
+
continue;
|
|
64480
|
+
}
|
|
64481
|
+
rangeDependencies.push(...this.computeMeasureFullDependencies(pivotId, otherMeasure, exploredMeasures));
|
|
64482
|
+
}
|
|
64483
|
+
rangeDependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
|
|
64484
|
+
return rangeDependencies;
|
|
64485
|
+
}
|
|
64441
64486
|
insertPivot(position, formulaId, table) {
|
|
64442
64487
|
this.resizeSheet(position.sheetId, position, table);
|
|
64443
64488
|
const pivotCells = table.getPivotCells();
|
|
@@ -64496,21 +64541,17 @@ class PivotCorePlugin extends CorePlugin {
|
|
|
64496
64541
|
dependencies: rangeDependencies,
|
|
64497
64542
|
};
|
|
64498
64543
|
}
|
|
64499
|
-
replaceMeasureFormula(
|
|
64500
|
-
|
|
64501
|
-
|
|
64502
|
-
|
|
64503
|
-
const pivot = this.pivots[pivotId];
|
|
64504
|
-
if (!pivot) {
|
|
64505
|
-
continue;
|
|
64506
|
-
}
|
|
64507
|
-
for (const measure of pivot.definition.measures) {
|
|
64508
|
-
if (measure.computedBy?.formula === formulaString) {
|
|
64509
|
-
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
64510
|
-
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
|
|
64511
|
-
}
|
|
64512
|
-
}
|
|
64544
|
+
replaceMeasureFormula(pivotId, measure, newFormulaString) {
|
|
64545
|
+
const pivot = this.pivots[pivotId];
|
|
64546
|
+
if (!pivot) {
|
|
64547
|
+
return;
|
|
64513
64548
|
}
|
|
64549
|
+
const measureIndex = pivot.definition.measures.indexOf(measure);
|
|
64550
|
+
this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", {
|
|
64551
|
+
formula: newFormulaString,
|
|
64552
|
+
sheetId: measure.computedBy.sheetId,
|
|
64553
|
+
});
|
|
64554
|
+
this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
|
|
64514
64555
|
}
|
|
64515
64556
|
checkSortedColumnInMeasures(definition) {
|
|
64516
64557
|
const measures = definition.measures.map((measure) => measure.id);
|
|
@@ -68038,14 +68079,16 @@ const PERCENT_FORMAT = "0.00%";
|
|
|
68038
68079
|
function withPivotPresentationLayer (PivotClass) {
|
|
68039
68080
|
class PivotPresentationLayer extends PivotClass {
|
|
68040
68081
|
getters;
|
|
68082
|
+
pivotId;
|
|
68041
68083
|
cache = {};
|
|
68042
68084
|
rankAsc = {};
|
|
68043
68085
|
rankDesc = {};
|
|
68044
68086
|
runningTotal = {};
|
|
68045
68087
|
runningTotalInPercent = {};
|
|
68046
|
-
constructor(custom, params) {
|
|
68088
|
+
constructor(pivotId, custom, params) {
|
|
68047
68089
|
super(custom, params);
|
|
68048
68090
|
this.getters = params.getters;
|
|
68091
|
+
this.pivotId = pivotId;
|
|
68049
68092
|
}
|
|
68050
68093
|
markAsDirtyForEvaluation() {
|
|
68051
68094
|
this.cache = {};
|
|
@@ -68095,7 +68138,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
68095
68138
|
return handleError(error, measure.aggregator.toUpperCase());
|
|
68096
68139
|
}
|
|
68097
68140
|
}
|
|
68098
|
-
const formula = this.getters.getMeasureCompiledFormula(measure);
|
|
68141
|
+
const formula = this.getters.getMeasureCompiledFormula(this.pivotId, measure);
|
|
68099
68142
|
const getSymbolValue = (symbolName) => {
|
|
68100
68143
|
const { columns, rows } = this.definition;
|
|
68101
68144
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
@@ -68835,7 +68878,7 @@ class PivotUIPlugin extends CoreViewPlugin {
|
|
|
68835
68878
|
const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
|
|
68836
68879
|
if (!(pivotId in this.pivots)) {
|
|
68837
68880
|
const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
|
|
68838
|
-
this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
|
|
68881
|
+
this.pivots[pivotId] = new Pivot(pivotId, this.custom, { definition, getters: this.getters });
|
|
68839
68882
|
}
|
|
68840
68883
|
else if (recreate) {
|
|
68841
68884
|
this.pivots[pivotId].onDefinitionChange(definition);
|
|
@@ -78174,10 +78217,8 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
78174
78217
|
});
|
|
78175
78218
|
}
|
|
78176
78219
|
get gridContainer() {
|
|
78177
|
-
const
|
|
78178
|
-
|
|
78179
|
-
const { end } = this.env.model.getters.getColDimensions(sheetId, right);
|
|
78180
|
-
return cssPropertiesToCss({ "max-width": `${end}px` });
|
|
78220
|
+
const maxWidth = this.getMaxSheetWidth();
|
|
78221
|
+
return cssPropertiesToCss({ "max-width": `${maxWidth}px` });
|
|
78181
78222
|
}
|
|
78182
78223
|
get gridOverlayDimensions() {
|
|
78183
78224
|
return cssPropertiesToCss({
|
|
@@ -78209,10 +78250,12 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
78209
78250
|
onClosePopover() {
|
|
78210
78251
|
this.cellPopovers.close();
|
|
78211
78252
|
}
|
|
78212
|
-
onGridResized(
|
|
78253
|
+
onGridResized() {
|
|
78254
|
+
const { height, width } = this.props.getGridSize();
|
|
78255
|
+
const maxWidth = this.getMaxSheetWidth();
|
|
78213
78256
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
78214
|
-
width: width,
|
|
78215
|
-
height
|
|
78257
|
+
width: Math.min(maxWidth, width),
|
|
78258
|
+
height,
|
|
78216
78259
|
gridOffsetX: 0,
|
|
78217
78260
|
gridOffsetY: 0,
|
|
78218
78261
|
});
|
|
@@ -78230,6 +78273,11 @@ class SpreadsheetDashboard extends owl.Component {
|
|
|
78230
78273
|
...this.env.model.getters.getSheetViewDimensionWithHeaders(),
|
|
78231
78274
|
};
|
|
78232
78275
|
}
|
|
78276
|
+
getMaxSheetWidth() {
|
|
78277
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
78278
|
+
const { right } = this.env.model.getters.getSheetZone(sheetId);
|
|
78279
|
+
return this.env.model.getters.getColDimensions(sheetId, right).end;
|
|
78280
|
+
}
|
|
78233
78281
|
}
|
|
78234
78282
|
|
|
78235
78283
|
css /* scss */ `
|
|
@@ -80470,22 +80518,20 @@ class Spreadsheet extends owl.Component {
|
|
|
80470
80518
|
return this.env.model.getters.getVisibleGroupLayers(sheetId, "COL");
|
|
80471
80519
|
}
|
|
80472
80520
|
getGridSize() {
|
|
80473
|
-
const
|
|
80474
|
-
|
|
80475
|
-
|
|
80476
|
-
|
|
80477
|
-
|
|
80478
|
-
|
|
80479
|
-
const
|
|
80480
|
-
const
|
|
80481
|
-
|
|
80482
|
-
|
|
80483
|
-
|
|
80484
|
-
|
|
80485
|
-
|
|
80486
|
-
|
|
80487
|
-
height: Math.max(gridHeight - SCROLLBAR_WIDTH, 0),
|
|
80488
|
-
};
|
|
80521
|
+
const el = this.spreadsheetRef.el;
|
|
80522
|
+
if (!el) {
|
|
80523
|
+
return { width: 0, height: 0 };
|
|
80524
|
+
}
|
|
80525
|
+
const getHeight = (selector) => el.querySelector(selector)?.getBoundingClientRect().height || 0;
|
|
80526
|
+
const getWidth = (selector) => el.querySelector(selector)?.getBoundingClientRect().width || 0;
|
|
80527
|
+
const rect = el.getBoundingClientRect();
|
|
80528
|
+
const topBarHeight = getHeight(".o-spreadsheet-topbar-wrapper");
|
|
80529
|
+
const bottomBarHeight = getHeight(".o-spreadsheet-bottombar-wrapper");
|
|
80530
|
+
const colGroupHeight = getHeight(".o-column-groups");
|
|
80531
|
+
const gridWidth = getWidth(".o-grid");
|
|
80532
|
+
const width = Math.max(gridWidth - SCROLLBAR_WIDTH, 0);
|
|
80533
|
+
const height = Math.max(rect.height - topBarHeight - bottomBarHeight - colGroupHeight - SCROLLBAR_WIDTH, 0);
|
|
80534
|
+
return { width, height };
|
|
80489
80535
|
}
|
|
80490
80536
|
}
|
|
80491
80537
|
|
|
@@ -85018,6 +85064,6 @@ exports.tokenColors = tokenColors;
|
|
|
85018
85064
|
exports.tokenize = tokenize;
|
|
85019
85065
|
|
|
85020
85066
|
|
|
85021
|
-
__info__.version = "18.4.
|
|
85022
|
-
__info__.date = "
|
|
85023
|
-
__info__.hash = "
|
|
85067
|
+
__info__.version = "18.4.24";
|
|
85068
|
+
__info__.date = "2026-01-14T10:00:55.867Z";
|
|
85069
|
+
__info__.hash = "0364f56";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -5151,14 +5151,18 @@ interface Pivot$1 {
|
|
|
5151
5151
|
definition: PivotCoreDefinition;
|
|
5152
5152
|
formulaId: string;
|
|
5153
5153
|
}
|
|
5154
|
+
interface MeasureState {
|
|
5155
|
+
formula: RangeCompiledFormula;
|
|
5156
|
+
dependencies: Range[];
|
|
5157
|
+
}
|
|
5154
5158
|
interface CoreState {
|
|
5155
5159
|
nextFormulaId: number;
|
|
5156
5160
|
pivots: Record<UID, Pivot$1 | undefined>;
|
|
5157
5161
|
formulaIds: Record<UID, string | undefined>;
|
|
5158
|
-
compiledMeasureFormulas: Record<UID, Record<string,
|
|
5162
|
+
compiledMeasureFormulas: Record<UID, Record<string, MeasureState | undefined>>;
|
|
5159
5163
|
}
|
|
5160
5164
|
declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState {
|
|
5161
|
-
static getters: readonly ["getPivotCoreDefinition", "getPivotDisplayName", "getPivotId", "getPivotFormulaId", "getPivotIds", "getMeasureCompiledFormula", "getPivotName", "isExistingPivot"];
|
|
5165
|
+
static getters: readonly ["getPivotCoreDefinition", "getPivotDisplayName", "getPivotId", "getPivotFormulaId", "getPivotIds", "getMeasureCompiledFormula", "getPivotName", "isExistingPivot", "getMeasureFullDependencies"];
|
|
5162
5166
|
readonly nextFormulaId: number;
|
|
5163
5167
|
readonly pivots: {
|
|
5164
5168
|
[pivotId: UID]: Pivot$1 | undefined;
|
|
@@ -5166,7 +5170,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
5166
5170
|
readonly formulaIds: {
|
|
5167
5171
|
[formulaId: UID]: UID | undefined;
|
|
5168
5172
|
};
|
|
5169
|
-
readonly compiledMeasureFormulas: Record<UID, Record<string,
|
|
5173
|
+
readonly compiledMeasureFormulas: Record<UID, Record<string, MeasureState>>;
|
|
5170
5174
|
allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
|
|
5171
5175
|
handle(cmd: CoreCommand): void;
|
|
5172
5176
|
adaptRanges(applyChange: ApplyRangeChange): void;
|
|
@@ -5185,9 +5189,11 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
|
|
|
5185
5189
|
getPivotFormulaId(pivotId: UID): string;
|
|
5186
5190
|
getPivotIds(): UID[];
|
|
5187
5191
|
isExistingPivot(pivotId: UID): boolean;
|
|
5188
|
-
getMeasureCompiledFormula(measure: PivotCoreMeasure): RangeCompiledFormula;
|
|
5192
|
+
getMeasureCompiledFormula(pivotId: UID, measure: PivotCoreMeasure): RangeCompiledFormula;
|
|
5193
|
+
getMeasureFullDependencies(pivotId: UID, measure: PivotCoreMeasure): Range[];
|
|
5189
5194
|
private addPivot;
|
|
5190
5195
|
private compileCalculatedMeasures;
|
|
5196
|
+
private computeMeasureFullDependencies;
|
|
5191
5197
|
private insertPivot;
|
|
5192
5198
|
private resizeSheet;
|
|
5193
5199
|
private getPivotCore;
|
|
@@ -9825,13 +9831,9 @@ interface Props$F {
|
|
|
9825
9831
|
onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
|
|
9826
9832
|
onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: GridClickModifiers, ev: PointerEvent | MouseEvent) => void;
|
|
9827
9833
|
onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
|
|
9828
|
-
onGridResized: (
|
|
9834
|
+
onGridResized: () => void;
|
|
9829
9835
|
onGridMoved: (deltaX: Pixel, deltaY: Pixel) => void;
|
|
9830
9836
|
gridOverlayDimensions: string;
|
|
9831
|
-
getGridSize: () => {
|
|
9832
|
-
width: number;
|
|
9833
|
-
height: number;
|
|
9834
|
-
};
|
|
9835
9837
|
}
|
|
9836
9838
|
declare class GridOverlay extends Component<Props$F, SpreadsheetChildEnv> {
|
|
9837
9839
|
static template: string;
|
|
@@ -9858,7 +9860,6 @@ declare class GridOverlay extends Component<Props$F, SpreadsheetChildEnv> {
|
|
|
9858
9860
|
type: ObjectConstructor;
|
|
9859
9861
|
optional: boolean;
|
|
9860
9862
|
};
|
|
9861
|
-
getGridSize: FunctionConstructor;
|
|
9862
9863
|
};
|
|
9863
9864
|
static components: {
|
|
9864
9865
|
FiguresContainer: typeof FiguresContainer;
|
|
@@ -10398,7 +10399,7 @@ declare class Grid extends Component<Props$w, SpreadsheetChildEnv> {
|
|
|
10398
10399
|
top: number;
|
|
10399
10400
|
};
|
|
10400
10401
|
get isAutofillVisible(): boolean;
|
|
10401
|
-
onGridResized(
|
|
10402
|
+
onGridResized(): void;
|
|
10402
10403
|
private moveCanvas;
|
|
10403
10404
|
private processSpaceKey;
|
|
10404
10405
|
getClientPositionKey(client: Client): string;
|
|
@@ -11978,6 +11979,7 @@ declare class ClickableCellsStore extends SpreadsheetStore {
|
|
|
11978
11979
|
}
|
|
11979
11980
|
|
|
11980
11981
|
interface Props$4 {
|
|
11982
|
+
getGridSize: () => DOMDimension;
|
|
11981
11983
|
}
|
|
11982
11984
|
declare class SpreadsheetDashboard extends Component<Props$4, SpreadsheetChildEnv> {
|
|
11983
11985
|
static template: string;
|
|
@@ -12010,9 +12012,10 @@ declare class SpreadsheetDashboard extends Component<Props$4, SpreadsheetChildEn
|
|
|
12010
12012
|
getClickableCells(): ClickableCell[];
|
|
12011
12013
|
selectClickableCell(ev: MouseEvent, clickableCell: ClickableCell): void;
|
|
12012
12014
|
onClosePopover(): void;
|
|
12013
|
-
onGridResized(
|
|
12015
|
+
onGridResized(): void;
|
|
12014
12016
|
private moveCanvas;
|
|
12015
12017
|
private getGridRect;
|
|
12018
|
+
private getMaxSheetWidth;
|
|
12016
12019
|
}
|
|
12017
12020
|
|
|
12018
12021
|
interface Props$3 {
|