@odoo/o-spreadsheet 19.4.3 → 19.4.5
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 +75 -36
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.esm.js +75 -36
- package/dist/o_spreadsheet.iife.js +75 -36
- package/dist/o_spreadsheet.min.iife.js +257 -257
- package/dist/o_spreadsheet.xml +7 -12
- package/dist/types/components/grid/grid.d.ts +1 -0
- package/dist/types/components/helpers/dom_helpers.d.ts +2 -0
- package/dist/types/components/side_panel/pivot/pivot_layout_configurator/pivot_layout_configurator.d.ts +0 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/plugins/ui_core_views/pivot_ui.d.ts +3 -0
- package/dist/types/plugins/ui_feature/collaborative.d.ts +2 -1
- 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.4.
|
|
6
|
-
* @date 2026-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.4.5
|
|
6
|
+
* @date 2026-07-30T06:55:39.923Z
|
|
7
|
+
* @hash 9308e17
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -349,6 +349,19 @@ _odoo_owl = __toESM(_odoo_owl, 1);
|
|
|
349
349
|
function isMobileOS() {
|
|
350
350
|
return isAndroid() || isIOS() || isOtherMobileOS();
|
|
351
351
|
}
|
|
352
|
+
const INTERACTIVE_ELEMENT_SELECTOR = "select, input, textarea, button, .o-select, .os-input, .o-input, .o-button, .o-button-icon, .o-button-link, .o-composer";
|
|
353
|
+
/** Check if there is an interactive element (input, select, button, ...) between the event.target and event.currentTarget (inclusive)*/
|
|
354
|
+
function hasInteractiveElementInEventTree(event) {
|
|
355
|
+
const target = event.target;
|
|
356
|
+
const root = event.currentTarget;
|
|
357
|
+
if (!root || !target || !root.contains(target)) return false;
|
|
358
|
+
let node = target;
|
|
359
|
+
while (node && node !== root) {
|
|
360
|
+
if (node.matches(INTERACTIVE_ELEMENT_SELECTOR)) return true;
|
|
361
|
+
node = node.parentElement;
|
|
362
|
+
}
|
|
363
|
+
return root.matches(INTERACTIVE_ELEMENT_SELECTOR);
|
|
364
|
+
}
|
|
352
365
|
|
|
353
366
|
//#endregion
|
|
354
367
|
//#region src/actions/action.ts
|
|
@@ -10964,7 +10977,7 @@ set(value) {
|
|
|
10964
10977
|
borderWidth: 1,
|
|
10965
10978
|
barPercentage: 1,
|
|
10966
10979
|
categoryPercentage: 1,
|
|
10967
|
-
values: dataSetValues.data.map((cell) => isNumberResult(cell) ? cell.value :
|
|
10980
|
+
values: dataSetValues.data.map((cell) => isNumberResult(cell) ? cell.value : void 0)
|
|
10968
10981
|
});
|
|
10969
10982
|
return {
|
|
10970
10983
|
labels,
|
|
@@ -39316,13 +39329,9 @@ set(value) {
|
|
|
39316
39329
|
dimensionsRef = (0, _odoo_owl.signal)(null);
|
|
39317
39330
|
dragAndDrop = useDragAndDropListItems();
|
|
39318
39331
|
AGGREGATORS = AGGREGATORS;
|
|
39319
|
-
composerFocus;
|
|
39320
39332
|
isDateOrDatetimeField = isDateOrDatetimeField;
|
|
39321
|
-
setup() {
|
|
39322
|
-
this.composerFocus = useStore(ComposerFocusStore);
|
|
39323
|
-
}
|
|
39324
39333
|
startDragAndDrop(dimension, event) {
|
|
39325
|
-
if (event.button !== 0 || event
|
|
39334
|
+
if (event.button !== 0 || hasInteractiveElementInEventTree(event)) return;
|
|
39326
39335
|
const rects = this.getDimensionElementsRects();
|
|
39327
39336
|
const { columns, rows } = this.props.definition;
|
|
39328
39337
|
const draggableIds = [
|
|
@@ -39362,7 +39371,7 @@ set(value) {
|
|
|
39362
39371
|
return field.type === "date" ? this.props.dateGranularities : this.props.datetimeGranularities;
|
|
39363
39372
|
}
|
|
39364
39373
|
startDragAndDropMeasures(measure, event) {
|
|
39365
|
-
if (event.button !== 0 || event
|
|
39374
|
+
if (event.button !== 0 || hasInteractiveElementInEventTree(event)) return;
|
|
39366
39375
|
const rects = this.getDimensionElementsRects();
|
|
39367
39376
|
const { measures, columns, rows } = this.props.definition;
|
|
39368
39377
|
const draggableIds = measures.map((m) => m.id);
|
|
@@ -45495,7 +45504,8 @@ set(value) {
|
|
|
45495
45504
|
const { x, y } = this.state.handler ? this.state.position : this.props.position;
|
|
45496
45505
|
return cssPropertiesToCss({
|
|
45497
45506
|
top: `${y}px`,
|
|
45498
|
-
left: `${x}px
|
|
45507
|
+
left: `${x}px`,
|
|
45508
|
+
visibility: this.props.isVisible ? "visible" : "hidden"
|
|
45499
45509
|
});
|
|
45500
45510
|
}
|
|
45501
45511
|
get styleNextValue() {
|
|
@@ -45916,7 +45926,7 @@ set(value) {
|
|
|
45916
45926
|
this._cancelEdition();
|
|
45917
45927
|
this.resetContent();
|
|
45918
45928
|
}
|
|
45919
|
-
if (cmd.sheetIdFrom !== cmd.sheetIdTo) {
|
|
45929
|
+
if (this.model.selection.isListening(this) && cmd.sheetIdFrom !== cmd.sheetIdTo) {
|
|
45920
45930
|
const activePosition = this.getters.getActivePosition();
|
|
45921
45931
|
const { col, row } = this.getters.getNextVisibleCellPosition({
|
|
45922
45932
|
sheetId: cmd.sheetIdTo,
|
|
@@ -50087,6 +50097,10 @@ set(value) {
|
|
|
50087
50097
|
get displaySelectionHandler() {
|
|
50088
50098
|
return this.env.isMobile() && this.composerFocusStore.activeComposer.editionMode === "inactive";
|
|
50089
50099
|
}
|
|
50100
|
+
get clientsToDisplay() {
|
|
50101
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
50102
|
+
return this.env.model.getters.getClientsToDisplay(sheetId);
|
|
50103
|
+
}
|
|
50090
50104
|
};
|
|
50091
50105
|
|
|
50092
50106
|
//#endregion
|
|
@@ -51715,7 +51729,7 @@ set(value) {
|
|
|
51715
51729
|
positionsByStyle[styleId] ??= [];
|
|
51716
51730
|
positionsByStyle[styleId].push(position);
|
|
51717
51731
|
}
|
|
51718
|
-
if (cell.format) {
|
|
51732
|
+
if (cell.format !== void 0) {
|
|
51719
51733
|
const formatId = getItemId(cell.format, formats);
|
|
51720
51734
|
positionsByFormat[formatId] ??= [];
|
|
51721
51735
|
positionsByFormat[formatId].push(position);
|
|
@@ -52892,22 +52906,19 @@ set(value) {
|
|
|
52892
52906
|
getDefaultFormatInCell(sheetId, zones, priorities) {
|
|
52893
52907
|
const defaults = [];
|
|
52894
52908
|
for (const position of zones.flatMap((zone) => cellPositions(sheetId, zone))) {
|
|
52895
|
-
if (this.getters.getCell(position)?.format) continue;
|
|
52909
|
+
if (this.getters.getCell(position)?.format !== void 0) continue;
|
|
52896
52910
|
const rowDefault = this.format[sheetId]?.rowDefault?.[position.row];
|
|
52897
|
-
if (rowDefault) {
|
|
52911
|
+
if (rowDefault !== void 0) {
|
|
52898
52912
|
if (priorities.shouldUseDefaultRow) defaults.push([position, rowDefault]);
|
|
52899
52913
|
continue;
|
|
52900
52914
|
}
|
|
52901
52915
|
const colDefault = this.format[sheetId]?.colDefault?.[position.col];
|
|
52902
|
-
if (colDefault) {
|
|
52916
|
+
if (colDefault !== void 0) {
|
|
52903
52917
|
if (priorities.shouldUseDefaultCol) defaults.push([position, colDefault]);
|
|
52904
52918
|
continue;
|
|
52905
52919
|
}
|
|
52906
|
-
const sheetDefault = this.format[sheetId]?.sheetDefault;
|
|
52907
|
-
if (sheetDefault)
|
|
52908
|
-
if (priorities.shouldUseDefaultSheet) defaults.push([position, sheetDefault]);
|
|
52909
|
-
continue;
|
|
52910
|
-
}
|
|
52920
|
+
const sheetDefault = this.format[sheetId]?.sheetDefault ?? "";
|
|
52921
|
+
if (priorities.shouldUseDefaultSheet) defaults.push([position, sheetDefault]);
|
|
52911
52922
|
}
|
|
52912
52923
|
return defaults;
|
|
52913
52924
|
}
|
|
@@ -59675,6 +59686,8 @@ set(value) {
|
|
|
59675
59686
|
pivots = {};
|
|
59676
59687
|
unusedPivotsInFormulas;
|
|
59677
59688
|
custom;
|
|
59689
|
+
pivotPositionCache = new PositionMap();
|
|
59690
|
+
shouldInvalidateCache = false;
|
|
59678
59691
|
constructor(config) {
|
|
59679
59692
|
super(config);
|
|
59680
59693
|
this.custom = config.custom;
|
|
@@ -59685,7 +59698,11 @@ set(value) {
|
|
|
59685
59698
|
}
|
|
59686
59699
|
}
|
|
59687
59700
|
handle(cmd) {
|
|
59688
|
-
if (invalidateEvaluationCommands.has(cmd.type))
|
|
59701
|
+
if (invalidateEvaluationCommands.has(cmd.type)) {
|
|
59702
|
+
this.shouldInvalidateCache = true;
|
|
59703
|
+
for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
|
|
59704
|
+
}
|
|
59705
|
+
if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
|
|
59689
59706
|
switch (cmd.type) {
|
|
59690
59707
|
case "REFRESH_PIVOT":
|
|
59691
59708
|
this.refreshPivot(cmd.id);
|
|
@@ -59725,6 +59742,12 @@ set(value) {
|
|
|
59725
59742
|
break;
|
|
59726
59743
|
}
|
|
59727
59744
|
}
|
|
59745
|
+
finalize() {
|
|
59746
|
+
if (this.shouldInvalidateCache) {
|
|
59747
|
+
this.pivotPositionCache = new PositionMap();
|
|
59748
|
+
this.shouldInvalidateCache = false;
|
|
59749
|
+
}
|
|
59750
|
+
}
|
|
59728
59751
|
/**
|
|
59729
59752
|
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
59730
59753
|
* is no pivot at this position
|
|
@@ -59736,9 +59759,14 @@ set(value) {
|
|
|
59736
59759
|
* Get all of the ids of the pivot present in the formula at the given position.
|
|
59737
59760
|
*/
|
|
59738
59761
|
getPivotIdsFromPosition(position) {
|
|
59739
|
-
|
|
59740
|
-
|
|
59741
|
-
|
|
59762
|
+
if (!this.pivotPositionCache.has(position)) {
|
|
59763
|
+
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
59764
|
+
if (cell && cell.isFormula) {
|
|
59765
|
+
const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
|
|
59766
|
+
this.pivotPositionCache.set(position, pivotIds);
|
|
59767
|
+
}
|
|
59768
|
+
}
|
|
59769
|
+
return this.pivotPositionCache.get(position) || [];
|
|
59742
59770
|
}
|
|
59743
59771
|
getPivotIdsFromFormula(sheetId, formula) {
|
|
59744
59772
|
return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
|
|
@@ -61103,12 +61131,22 @@ set(value) {
|
|
|
61103
61131
|
getCellTableStyle(position) {
|
|
61104
61132
|
const table = this.getters.getTable(position);
|
|
61105
61133
|
if (!table) return;
|
|
61106
|
-
|
|
61134
|
+
try {
|
|
61135
|
+
return this.tableStyles[position.sheetId][table.id]().styles[position.col]?.[position.row];
|
|
61136
|
+
} catch (e) {
|
|
61137
|
+
if (isEvaluationError(e) || e instanceof EvaluationError) return;
|
|
61138
|
+
throw e;
|
|
61139
|
+
}
|
|
61107
61140
|
}
|
|
61108
61141
|
getCellTableBorder(position) {
|
|
61109
61142
|
const table = this.getters.getTable(position);
|
|
61110
61143
|
if (!table) return;
|
|
61111
|
-
|
|
61144
|
+
try {
|
|
61145
|
+
return this.tableStyles[position.sheetId][table.id]().borders[position.col]?.[position.row];
|
|
61146
|
+
} catch (e) {
|
|
61147
|
+
if (isEvaluationError(e) || e instanceof EvaluationError) return;
|
|
61148
|
+
throw e;
|
|
61149
|
+
}
|
|
61112
61150
|
}
|
|
61113
61151
|
computeTableStyle(sheetId, table) {
|
|
61114
61152
|
return lazy(() => {
|
|
@@ -62451,14 +62489,13 @@ set(value) {
|
|
|
62451
62489
|
* Get the list of others connected clients which are present in the same sheet
|
|
62452
62490
|
* and with a valid position
|
|
62453
62491
|
*/
|
|
62454
|
-
getClientsToDisplay() {
|
|
62492
|
+
getClientsToDisplay(sheetId) {
|
|
62455
62493
|
try {
|
|
62456
62494
|
this.getters.getCurrentClient();
|
|
62457
62495
|
} catch (e) {
|
|
62458
62496
|
if (e instanceof ClientDisconnectedError) return [];
|
|
62459
62497
|
else throw e;
|
|
62460
62498
|
}
|
|
62461
|
-
const sheetId = this.getters.getActiveSheetId();
|
|
62462
62499
|
const clients = [];
|
|
62463
62500
|
for (const client of this.getters.getConnectedClients()) if (client.id !== this.getters.getCurrentClient().id && client.position && client.position.sheetId === sheetId && this.isPositionValid(client.position)) clients.push({
|
|
62464
62501
|
...client,
|
|
@@ -62469,7 +62506,7 @@ set(value) {
|
|
|
62469
62506
|
drawLayer(renderingContext) {
|
|
62470
62507
|
if (this.getters.isDashboard()) return;
|
|
62471
62508
|
const { ctx, thinLineWidth, viewports, sheetId } = renderingContext;
|
|
62472
|
-
for (const client of this.getClientsToDisplay()) {
|
|
62509
|
+
for (const client of this.getClientsToDisplay(sheetId)) {
|
|
62473
62510
|
const { row, col } = client.position;
|
|
62474
62511
|
const zone = this.getters.expandZone(sheetId, {
|
|
62475
62512
|
top: row,
|
|
@@ -63277,8 +63314,8 @@ set(value) {
|
|
|
63277
63314
|
getNextVisibleCellPosition({ sheetId, col, row }) {
|
|
63278
63315
|
return {
|
|
63279
63316
|
sheetId,
|
|
63280
|
-
col: this.findVisibleHeader(sheetId, "COL", col, this.getters.getNumberCols(sheetId) - 1),
|
|
63281
|
-
row: this.findVisibleHeader(sheetId, "ROW", row, this.getters.getNumberRows(sheetId) - 1)
|
|
63317
|
+
col: this.findVisibleHeader(sheetId, "COL", col, this.getters.getNumberCols(sheetId) - 1) || this.findVisibleHeader(sheetId, "COL", col, 0) || 0,
|
|
63318
|
+
row: this.findVisibleHeader(sheetId, "ROW", row, this.getters.getNumberRows(sheetId) - 1) || this.findVisibleHeader(sheetId, "ROW", row, 0) || 0
|
|
63282
63319
|
};
|
|
63283
63320
|
}
|
|
63284
63321
|
/**
|
|
@@ -64290,7 +64327,7 @@ set(value) {
|
|
|
64290
64327
|
if (contentWidth === 0) return 0;
|
|
64291
64328
|
contentWidth += 2 * 4;
|
|
64292
64329
|
if (style.wrapping === "wrap") {
|
|
64293
|
-
const colWidth = this.getters.getColSize(
|
|
64330
|
+
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
64294
64331
|
return Math.min(colWidth, contentWidth);
|
|
64295
64332
|
}
|
|
64296
64333
|
return contentWidth;
|
|
@@ -69533,6 +69570,7 @@ set(value) {
|
|
|
69533
69570
|
return (0, _odoo_owl.toRaw)(this.clickableCellsStore.clickableCells);
|
|
69534
69571
|
}
|
|
69535
69572
|
selectClickableCell(ev, clickableCell) {
|
|
69573
|
+
if (![0, 1].includes(ev.button)) return;
|
|
69536
69574
|
const { position, action } = clickableCell;
|
|
69537
69575
|
action(position, this.env, isMiddleClickOrCtrlClick(ev));
|
|
69538
69576
|
}
|
|
@@ -87420,6 +87458,7 @@ set(value) {
|
|
|
87420
87458
|
collapseHierarchicalDisplayName,
|
|
87421
87459
|
getCanonicalSymbolName,
|
|
87422
87460
|
fuzzyLookup,
|
|
87461
|
+
PositionMap,
|
|
87423
87462
|
replaceSymbolInFormula
|
|
87424
87463
|
};
|
|
87425
87464
|
const links = {
|
|
@@ -87644,8 +87683,8 @@ exports.stores = stores;
|
|
|
87644
87683
|
exports.tokenColors = tokenColors;
|
|
87645
87684
|
exports.tokenize = tokenize;
|
|
87646
87685
|
|
|
87647
|
-
__info__.version = "19.4.
|
|
87648
|
-
__info__.date = "2026-07-
|
|
87649
|
-
__info__.hash = "
|
|
87686
|
+
__info__.version = "19.4.5";
|
|
87687
|
+
__info__.date = "2026-07-30T06:55:39.923Z";
|
|
87688
|
+
__info__.hash = "9308e17";
|
|
87650
87689
|
|
|
87651
87690
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|