@odoo/o-spreadsheet 18.0.37 → 18.0.38
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 +86 -37
- package/dist/o-spreadsheet.d.ts +5 -0
- package/dist/o-spreadsheet.esm.js +86 -37
- package/dist/o-spreadsheet.iife.js +86 -37
- package/dist/o-spreadsheet.iife.min.js +74 -74
- package/dist/o_spreadsheet.xml +8 -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.0.
|
|
6
|
-
* @date 2025-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.38
|
|
6
|
+
* @date 2025-07-28T13:29:40.841Z
|
|
7
|
+
* @hash 0f3b11a
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -17377,6 +17377,7 @@ const autoCompleteProviders = new Registry();
|
|
|
17377
17377
|
|
|
17378
17378
|
autoCompleteProviders.add("dataValidation", {
|
|
17379
17379
|
displayAllOnInitialContent: true,
|
|
17380
|
+
canBeToggled: false,
|
|
17380
17381
|
getProposals(tokenAtCursor, content) {
|
|
17381
17382
|
if (content.startsWith("=")) {
|
|
17382
17383
|
return [];
|
|
@@ -25032,11 +25033,17 @@ const COLUMN = {
|
|
|
25032
25033
|
if (isEvaluationError(cellReference?.value)) {
|
|
25033
25034
|
return cellReference;
|
|
25034
25035
|
}
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25038
|
-
|
|
25039
|
-
|
|
25036
|
+
if (cellReference === undefined) {
|
|
25037
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25038
|
+
return this.__originCellPosition.col + 1;
|
|
25039
|
+
}
|
|
25040
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25041
|
+
if (zone.left === zone.right) {
|
|
25042
|
+
return zone.left + 1;
|
|
25043
|
+
}
|
|
25044
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
25045
|
+
value: zone.left + col + 1,
|
|
25046
|
+
}));
|
|
25040
25047
|
},
|
|
25041
25048
|
isExported: true,
|
|
25042
25049
|
};
|
|
@@ -25255,11 +25262,17 @@ const ROW = {
|
|
|
25255
25262
|
if (isEvaluationError(cellReference?.value)) {
|
|
25256
25263
|
return cellReference;
|
|
25257
25264
|
}
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25261
|
-
|
|
25262
|
-
|
|
25265
|
+
if (cellReference === undefined) {
|
|
25266
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25267
|
+
return this.__originCellPosition.row + 1;
|
|
25268
|
+
}
|
|
25269
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25270
|
+
if (zone.top === zone.bottom) {
|
|
25271
|
+
return zone.top + 1;
|
|
25272
|
+
}
|
|
25273
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
25274
|
+
value: zone.top + row + 1,
|
|
25275
|
+
}));
|
|
25263
25276
|
},
|
|
25264
25277
|
isExported: true,
|
|
25265
25278
|
};
|
|
@@ -27915,9 +27928,13 @@ class Composer extends owl.Component {
|
|
|
27915
27928
|
}
|
|
27916
27929
|
}
|
|
27917
27930
|
closeAssistant() {
|
|
27931
|
+
if (!this.canBeToggled)
|
|
27932
|
+
return;
|
|
27918
27933
|
this.assistant.forcedClosed = true;
|
|
27919
27934
|
}
|
|
27920
27935
|
openAssistant() {
|
|
27936
|
+
if (!this.canBeToggled)
|
|
27937
|
+
return;
|
|
27921
27938
|
this.assistant.forcedClosed = false;
|
|
27922
27939
|
}
|
|
27923
27940
|
onWheel(event) {
|
|
@@ -27927,6 +27944,9 @@ class Composer extends owl.Component {
|
|
|
27927
27944
|
event.stopPropagation();
|
|
27928
27945
|
}
|
|
27929
27946
|
}
|
|
27947
|
+
get canBeToggled() {
|
|
27948
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
27949
|
+
}
|
|
27930
27950
|
// ---------------------------------------------------------------------------
|
|
27931
27951
|
// Private
|
|
27932
27952
|
// ---------------------------------------------------------------------------
|
|
@@ -28109,7 +28129,7 @@ class Composer extends owl.Component {
|
|
|
28109
28129
|
}
|
|
28110
28130
|
}
|
|
28111
28131
|
autoComplete(value) {
|
|
28112
|
-
if (!value || this.assistant.forcedClosed) {
|
|
28132
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
28113
28133
|
return;
|
|
28114
28134
|
}
|
|
28115
28135
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -39681,6 +39701,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39681
39701
|
proposals,
|
|
39682
39702
|
selectProposal: provider.selectProposal,
|
|
39683
39703
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39704
|
+
canBeToggled: provider.canBeToggled,
|
|
39684
39705
|
};
|
|
39685
39706
|
}
|
|
39686
39707
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -39703,6 +39724,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39703
39724
|
proposals,
|
|
39704
39725
|
selectProposal: provider.selectProposal,
|
|
39705
39726
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39727
|
+
canBeToggled: provider.canBeToggled,
|
|
39706
39728
|
};
|
|
39707
39729
|
}
|
|
39708
39730
|
}
|
|
@@ -44742,9 +44764,15 @@ class SpreadsheetPivot {
|
|
|
44742
44764
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
44743
44765
|
}
|
|
44744
44766
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
44745
|
-
const { field, value } = domain;
|
|
44767
|
+
const { field, value, type } = domain;
|
|
44746
44768
|
const { nameWithGranularity } = this.getDimension(field);
|
|
44747
|
-
return dataEntries.filter((entry) =>
|
|
44769
|
+
return dataEntries.filter((entry) => {
|
|
44770
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
44771
|
+
if (type === "char") {
|
|
44772
|
+
return String(cellValue) === String(value);
|
|
44773
|
+
}
|
|
44774
|
+
return cellValue === value;
|
|
44775
|
+
});
|
|
44748
44776
|
}
|
|
44749
44777
|
getDimension(nameWithGranularity) {
|
|
44750
44778
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -47219,6 +47247,11 @@ class GridComposer extends owl.Component {
|
|
|
47219
47247
|
rect = this.defaultRect;
|
|
47220
47248
|
isEditing = false;
|
|
47221
47249
|
isCellReferenceVisible = false;
|
|
47250
|
+
currentEditedCell = {
|
|
47251
|
+
col: 0,
|
|
47252
|
+
row: 0,
|
|
47253
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
47254
|
+
};
|
|
47222
47255
|
composerStore;
|
|
47223
47256
|
composerFocusStore;
|
|
47224
47257
|
composerInterface;
|
|
@@ -47248,7 +47281,7 @@ class GridComposer extends owl.Component {
|
|
|
47248
47281
|
return this.isCellReferenceVisible;
|
|
47249
47282
|
}
|
|
47250
47283
|
get cellReference() {
|
|
47251
|
-
const { col, row, sheetId } = this.
|
|
47284
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
47252
47285
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
47253
47286
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
47254
47287
|
}
|
|
@@ -47341,12 +47374,17 @@ class GridComposer extends owl.Component {
|
|
|
47341
47374
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
47342
47375
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
47343
47376
|
}
|
|
47377
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
47344
47378
|
if (this.isEditing !== isEditing) {
|
|
47345
47379
|
this.isEditing = isEditing;
|
|
47346
47380
|
if (!isEditing) {
|
|
47347
47381
|
this.rect = this.defaultRect;
|
|
47348
47382
|
return;
|
|
47349
47383
|
}
|
|
47384
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
47385
|
+
shouldRecomputeRect = true;
|
|
47386
|
+
}
|
|
47387
|
+
if (shouldRecomputeRect) {
|
|
47350
47388
|
const position = this.env.model.getters.getActivePosition();
|
|
47351
47389
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
47352
47390
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -60413,6 +60451,23 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60413
60451
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
60414
60452
|
tallestCellInRow = {};
|
|
60415
60453
|
ctx = document.createElement("canvas").getContext("2d");
|
|
60454
|
+
beforeHandle(cmd) {
|
|
60455
|
+
switch (cmd.type) {
|
|
60456
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
60457
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
60458
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
60459
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
60460
|
+
case "ADD_COLUMNS_ROWS":
|
|
60461
|
+
if (cmd.dimension === "COL") {
|
|
60462
|
+
return;
|
|
60463
|
+
}
|
|
60464
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60465
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60466
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60467
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60468
|
+
break;
|
|
60469
|
+
}
|
|
60470
|
+
}
|
|
60416
60471
|
handle(cmd) {
|
|
60417
60472
|
switch (cmd.type) {
|
|
60418
60473
|
case "START":
|
|
@@ -60442,16 +60497,6 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60442
60497
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
60443
60498
|
break;
|
|
60444
60499
|
}
|
|
60445
|
-
case "ADD_COLUMNS_ROWS": {
|
|
60446
|
-
if (cmd.dimension === "COL") {
|
|
60447
|
-
return;
|
|
60448
|
-
}
|
|
60449
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60450
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60451
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60452
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60453
|
-
break;
|
|
60454
|
-
}
|
|
60455
60500
|
case "RESIZE_COLUMNS_ROWS":
|
|
60456
60501
|
{
|
|
60457
60502
|
const sheetId = cmd.sheetId;
|
|
@@ -66140,6 +66185,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66140
66185
|
const isBasedBefore = cmd.base < start;
|
|
66141
66186
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
66142
66187
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
66188
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66189
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
66190
|
+
const size = isCol
|
|
66191
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
66192
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
66193
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
66194
|
+
return [element, isDefaultCol || size === undefined ? null : size];
|
|
66195
|
+
}));
|
|
66143
66196
|
const target = [
|
|
66144
66197
|
{
|
|
66145
66198
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -66170,14 +66223,12 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66170
66223
|
const col = selection.left;
|
|
66171
66224
|
const row = selection.top;
|
|
66172
66225
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
66173
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66174
66226
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
66175
66227
|
for (const element of toRemove) {
|
|
66176
|
-
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
66177
66228
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
66178
66229
|
dimension: cmd.dimension,
|
|
66179
66230
|
sheetId: cmd.sheetId,
|
|
66180
|
-
size,
|
|
66231
|
+
size: originalSize[element],
|
|
66181
66232
|
elements: [currentIndex],
|
|
66182
66233
|
});
|
|
66183
66234
|
currentIndex += 1;
|
|
@@ -67889,14 +67940,12 @@ class BottomBarSheet extends owl.Component {
|
|
|
67889
67940
|
this.editionState = "initializing";
|
|
67890
67941
|
}
|
|
67891
67942
|
stopEdition() {
|
|
67892
|
-
|
|
67893
|
-
if (!this.state.isEditing || !input)
|
|
67943
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
67894
67944
|
return;
|
|
67895
67945
|
this.state.isEditing = false;
|
|
67896
67946
|
this.editionState = "initializing";
|
|
67897
|
-
|
|
67947
|
+
this.sheetNameRef.el.blur();
|
|
67898
67948
|
const inputValue = this.getInputContent() || "";
|
|
67899
|
-
input.innerText = inputValue;
|
|
67900
67949
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
67901
67950
|
}
|
|
67902
67951
|
cancelEdition() {
|
|
@@ -74591,6 +74640,6 @@ exports.tokenColors = tokenColors;
|
|
|
74591
74640
|
exports.tokenize = tokenize;
|
|
74592
74641
|
|
|
74593
74642
|
|
|
74594
|
-
__info__.version = "18.0.
|
|
74595
|
-
__info__.date = "2025-07-
|
|
74596
|
-
__info__.hash = "
|
|
74643
|
+
__info__.version = "18.0.38";
|
|
74644
|
+
__info__.date = "2025-07-28T13:29:40.841Z";
|
|
74645
|
+
__info__.hash = "0f3b11a";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -4750,6 +4750,7 @@ declare class HeaderSizeUIPlugin extends UIPlugin<HeaderSizeState> implements He
|
|
|
4750
4750
|
static getters: readonly ["getRowSize", "getHeaderSize"];
|
|
4751
4751
|
readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
|
|
4752
4752
|
private ctx;
|
|
4753
|
+
beforeHandle(cmd: Command): void;
|
|
4753
4754
|
handle(cmd: Command): void;
|
|
4754
4755
|
getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
|
|
4755
4756
|
getHeaderSize(sheetId: UID, dimension: Dimension, index: HeaderIndex): Pixel;
|
|
@@ -8193,6 +8194,7 @@ declare class Composer extends Component<CellComposerProps, SpreadsheetChildEnv>
|
|
|
8193
8194
|
closeAssistant(): void;
|
|
8194
8195
|
openAssistant(): void;
|
|
8195
8196
|
onWheel(event: WheelEvent): void;
|
|
8197
|
+
get canBeToggled(): boolean;
|
|
8196
8198
|
private processContent;
|
|
8197
8199
|
/**
|
|
8198
8200
|
* Get the HTML content corresponding to the current composer token, divided by lines.
|
|
@@ -8234,6 +8236,7 @@ interface AutoCompleteProvider {
|
|
|
8234
8236
|
proposals: AutoCompleteProposal[];
|
|
8235
8237
|
selectProposal(text: string): void;
|
|
8236
8238
|
autoSelectFirstProposal: boolean;
|
|
8239
|
+
canBeToggled?: boolean;
|
|
8237
8240
|
}
|
|
8238
8241
|
interface ComposerStoreInterface {
|
|
8239
8242
|
currentEditedCell?: CellPosition;
|
|
@@ -8253,6 +8256,7 @@ interface ComposerStoreInterface {
|
|
|
8253
8256
|
interface AutoCompleteProviderDefinition {
|
|
8254
8257
|
sequence?: number;
|
|
8255
8258
|
autoSelectFirstProposal?: boolean;
|
|
8259
|
+
canBeToggled?: boolean;
|
|
8256
8260
|
displayAllOnInitialContent?: boolean;
|
|
8257
8261
|
maxDisplayedProposals?: number;
|
|
8258
8262
|
getProposals(this: {
|
|
@@ -8560,6 +8564,7 @@ declare class GridComposer extends Component<Props$H, SpreadsheetChildEnv> {
|
|
|
8560
8564
|
private rect;
|
|
8561
8565
|
private isEditing;
|
|
8562
8566
|
private isCellReferenceVisible;
|
|
8567
|
+
private currentEditedCell;
|
|
8563
8568
|
private composerStore;
|
|
8564
8569
|
composerFocusStore: Store<ComposerFocusStore>;
|
|
8565
8570
|
private composerInterface;
|
|
@@ -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-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.38
|
|
6
|
+
* @date 2025-07-28T13:29:40.841Z
|
|
7
|
+
* @hash 0f3b11a
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -17375,6 +17375,7 @@ const autoCompleteProviders = new Registry();
|
|
|
17375
17375
|
|
|
17376
17376
|
autoCompleteProviders.add("dataValidation", {
|
|
17377
17377
|
displayAllOnInitialContent: true,
|
|
17378
|
+
canBeToggled: false,
|
|
17378
17379
|
getProposals(tokenAtCursor, content) {
|
|
17379
17380
|
if (content.startsWith("=")) {
|
|
17380
17381
|
return [];
|
|
@@ -25030,11 +25031,17 @@ const COLUMN = {
|
|
|
25030
25031
|
if (isEvaluationError(cellReference?.value)) {
|
|
25031
25032
|
return cellReference;
|
|
25032
25033
|
}
|
|
25033
|
-
|
|
25034
|
-
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25034
|
+
if (cellReference === undefined) {
|
|
25035
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25036
|
+
return this.__originCellPosition.col + 1;
|
|
25037
|
+
}
|
|
25038
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25039
|
+
if (zone.left === zone.right) {
|
|
25040
|
+
return zone.left + 1;
|
|
25041
|
+
}
|
|
25042
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
25043
|
+
value: zone.left + col + 1,
|
|
25044
|
+
}));
|
|
25038
25045
|
},
|
|
25039
25046
|
isExported: true,
|
|
25040
25047
|
};
|
|
@@ -25253,11 +25260,17 @@ const ROW = {
|
|
|
25253
25260
|
if (isEvaluationError(cellReference?.value)) {
|
|
25254
25261
|
return cellReference;
|
|
25255
25262
|
}
|
|
25256
|
-
|
|
25257
|
-
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25263
|
+
if (cellReference === undefined) {
|
|
25264
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25265
|
+
return this.__originCellPosition.row + 1;
|
|
25266
|
+
}
|
|
25267
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25268
|
+
if (zone.top === zone.bottom) {
|
|
25269
|
+
return zone.top + 1;
|
|
25270
|
+
}
|
|
25271
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
25272
|
+
value: zone.top + row + 1,
|
|
25273
|
+
}));
|
|
25261
25274
|
},
|
|
25262
25275
|
isExported: true,
|
|
25263
25276
|
};
|
|
@@ -27913,9 +27926,13 @@ class Composer extends Component {
|
|
|
27913
27926
|
}
|
|
27914
27927
|
}
|
|
27915
27928
|
closeAssistant() {
|
|
27929
|
+
if (!this.canBeToggled)
|
|
27930
|
+
return;
|
|
27916
27931
|
this.assistant.forcedClosed = true;
|
|
27917
27932
|
}
|
|
27918
27933
|
openAssistant() {
|
|
27934
|
+
if (!this.canBeToggled)
|
|
27935
|
+
return;
|
|
27919
27936
|
this.assistant.forcedClosed = false;
|
|
27920
27937
|
}
|
|
27921
27938
|
onWheel(event) {
|
|
@@ -27925,6 +27942,9 @@ class Composer extends Component {
|
|
|
27925
27942
|
event.stopPropagation();
|
|
27926
27943
|
}
|
|
27927
27944
|
}
|
|
27945
|
+
get canBeToggled() {
|
|
27946
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
27947
|
+
}
|
|
27928
27948
|
// ---------------------------------------------------------------------------
|
|
27929
27949
|
// Private
|
|
27930
27950
|
// ---------------------------------------------------------------------------
|
|
@@ -28107,7 +28127,7 @@ class Composer extends Component {
|
|
|
28107
28127
|
}
|
|
28108
28128
|
}
|
|
28109
28129
|
autoComplete(value) {
|
|
28110
|
-
if (!value || this.assistant.forcedClosed) {
|
|
28130
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
28111
28131
|
return;
|
|
28112
28132
|
}
|
|
28113
28133
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -39679,6 +39699,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39679
39699
|
proposals,
|
|
39680
39700
|
selectProposal: provider.selectProposal,
|
|
39681
39701
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39702
|
+
canBeToggled: provider.canBeToggled,
|
|
39682
39703
|
};
|
|
39683
39704
|
}
|
|
39684
39705
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -39701,6 +39722,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39701
39722
|
proposals,
|
|
39702
39723
|
selectProposal: provider.selectProposal,
|
|
39703
39724
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39725
|
+
canBeToggled: provider.canBeToggled,
|
|
39704
39726
|
};
|
|
39705
39727
|
}
|
|
39706
39728
|
}
|
|
@@ -44740,9 +44762,15 @@ class SpreadsheetPivot {
|
|
|
44740
44762
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
44741
44763
|
}
|
|
44742
44764
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
44743
|
-
const { field, value } = domain;
|
|
44765
|
+
const { field, value, type } = domain;
|
|
44744
44766
|
const { nameWithGranularity } = this.getDimension(field);
|
|
44745
|
-
return dataEntries.filter((entry) =>
|
|
44767
|
+
return dataEntries.filter((entry) => {
|
|
44768
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
44769
|
+
if (type === "char") {
|
|
44770
|
+
return String(cellValue) === String(value);
|
|
44771
|
+
}
|
|
44772
|
+
return cellValue === value;
|
|
44773
|
+
});
|
|
44746
44774
|
}
|
|
44747
44775
|
getDimension(nameWithGranularity) {
|
|
44748
44776
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -47217,6 +47245,11 @@ class GridComposer extends Component {
|
|
|
47217
47245
|
rect = this.defaultRect;
|
|
47218
47246
|
isEditing = false;
|
|
47219
47247
|
isCellReferenceVisible = false;
|
|
47248
|
+
currentEditedCell = {
|
|
47249
|
+
col: 0,
|
|
47250
|
+
row: 0,
|
|
47251
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
47252
|
+
};
|
|
47220
47253
|
composerStore;
|
|
47221
47254
|
composerFocusStore;
|
|
47222
47255
|
composerInterface;
|
|
@@ -47246,7 +47279,7 @@ class GridComposer extends Component {
|
|
|
47246
47279
|
return this.isCellReferenceVisible;
|
|
47247
47280
|
}
|
|
47248
47281
|
get cellReference() {
|
|
47249
|
-
const { col, row, sheetId } = this.
|
|
47282
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
47250
47283
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
47251
47284
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
47252
47285
|
}
|
|
@@ -47339,12 +47372,17 @@ class GridComposer extends Component {
|
|
|
47339
47372
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
47340
47373
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
47341
47374
|
}
|
|
47375
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
47342
47376
|
if (this.isEditing !== isEditing) {
|
|
47343
47377
|
this.isEditing = isEditing;
|
|
47344
47378
|
if (!isEditing) {
|
|
47345
47379
|
this.rect = this.defaultRect;
|
|
47346
47380
|
return;
|
|
47347
47381
|
}
|
|
47382
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
47383
|
+
shouldRecomputeRect = true;
|
|
47384
|
+
}
|
|
47385
|
+
if (shouldRecomputeRect) {
|
|
47348
47386
|
const position = this.env.model.getters.getActivePosition();
|
|
47349
47387
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
47350
47388
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -60411,6 +60449,23 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60411
60449
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
60412
60450
|
tallestCellInRow = {};
|
|
60413
60451
|
ctx = document.createElement("canvas").getContext("2d");
|
|
60452
|
+
beforeHandle(cmd) {
|
|
60453
|
+
switch (cmd.type) {
|
|
60454
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
60455
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
60456
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
60457
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
60458
|
+
case "ADD_COLUMNS_ROWS":
|
|
60459
|
+
if (cmd.dimension === "COL") {
|
|
60460
|
+
return;
|
|
60461
|
+
}
|
|
60462
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60463
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60464
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60465
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60466
|
+
break;
|
|
60467
|
+
}
|
|
60468
|
+
}
|
|
60414
60469
|
handle(cmd) {
|
|
60415
60470
|
switch (cmd.type) {
|
|
60416
60471
|
case "START":
|
|
@@ -60440,16 +60495,6 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60440
60495
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
60441
60496
|
break;
|
|
60442
60497
|
}
|
|
60443
|
-
case "ADD_COLUMNS_ROWS": {
|
|
60444
|
-
if (cmd.dimension === "COL") {
|
|
60445
|
-
return;
|
|
60446
|
-
}
|
|
60447
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60448
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60449
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60450
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60451
|
-
break;
|
|
60452
|
-
}
|
|
60453
60498
|
case "RESIZE_COLUMNS_ROWS":
|
|
60454
60499
|
{
|
|
60455
60500
|
const sheetId = cmd.sheetId;
|
|
@@ -66138,6 +66183,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66138
66183
|
const isBasedBefore = cmd.base < start;
|
|
66139
66184
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
66140
66185
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
66186
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66187
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
66188
|
+
const size = isCol
|
|
66189
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
66190
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
66191
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
66192
|
+
return [element, isDefaultCol || size === undefined ? null : size];
|
|
66193
|
+
}));
|
|
66141
66194
|
const target = [
|
|
66142
66195
|
{
|
|
66143
66196
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -66168,14 +66221,12 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66168
66221
|
const col = selection.left;
|
|
66169
66222
|
const row = selection.top;
|
|
66170
66223
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
66171
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66172
66224
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
66173
66225
|
for (const element of toRemove) {
|
|
66174
|
-
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
66175
66226
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
66176
66227
|
dimension: cmd.dimension,
|
|
66177
66228
|
sheetId: cmd.sheetId,
|
|
66178
|
-
size,
|
|
66229
|
+
size: originalSize[element],
|
|
66179
66230
|
elements: [currentIndex],
|
|
66180
66231
|
});
|
|
66181
66232
|
currentIndex += 1;
|
|
@@ -67887,14 +67938,12 @@ class BottomBarSheet extends Component {
|
|
|
67887
67938
|
this.editionState = "initializing";
|
|
67888
67939
|
}
|
|
67889
67940
|
stopEdition() {
|
|
67890
|
-
|
|
67891
|
-
if (!this.state.isEditing || !input)
|
|
67941
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
67892
67942
|
return;
|
|
67893
67943
|
this.state.isEditing = false;
|
|
67894
67944
|
this.editionState = "initializing";
|
|
67895
|
-
|
|
67945
|
+
this.sheetNameRef.el.blur();
|
|
67896
67946
|
const inputValue = this.getInputContent() || "";
|
|
67897
|
-
input.innerText = inputValue;
|
|
67898
67947
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
67899
67948
|
}
|
|
67900
67949
|
cancelEdition() {
|
|
@@ -74546,6 +74595,6 @@ const constants = {
|
|
|
74546
74595
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
74547
74596
|
|
|
74548
74597
|
|
|
74549
|
-
__info__.version = "18.0.
|
|
74550
|
-
__info__.date = "2025-07-
|
|
74551
|
-
__info__.hash = "
|
|
74598
|
+
__info__.version = "18.0.38";
|
|
74599
|
+
__info__.date = "2025-07-28T13:29:40.841Z";
|
|
74600
|
+
__info__.hash = "0f3b11a";
|