@odoo/o-spreadsheet 18.0.37 → 18.0.39
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 +114 -56
- package/dist/o-spreadsheet.d.ts +5 -0
- package/dist/o-spreadsheet.esm.js +114 -56
- package/dist/o-spreadsheet.iife.js +114 -56
- 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.39
|
|
6
|
+
* @date 2025-07-30T11:19:58.267Z
|
|
7
|
+
* @hash 997e25a
|
|
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 [];
|
|
@@ -17382,31 +17383,40 @@ autoCompleteProviders.add("dataValidation", {
|
|
|
17382
17383
|
if (!this.composer.currentEditedCell) {
|
|
17383
17384
|
return [];
|
|
17384
17385
|
}
|
|
17385
|
-
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17390
|
-
}
|
|
17391
|
-
let values;
|
|
17392
|
-
if (rule.criterion.type === "isValueInList") {
|
|
17393
|
-
values = rule.criterion.values;
|
|
17394
|
-
}
|
|
17395
|
-
else {
|
|
17396
|
-
const range = this.getters.getRangeFromSheetXC(position.sheetId, rule.criterion.values[0]);
|
|
17397
|
-
values = Array.from(new Set(this.getters
|
|
17398
|
-
.getRangeValues(range)
|
|
17399
|
-
.filter(isNotNull)
|
|
17400
|
-
.map((value) => value.toString())
|
|
17401
|
-
.filter((val) => val !== "")));
|
|
17402
|
-
}
|
|
17403
|
-
return values.map((value) => ({ text: value }));
|
|
17386
|
+
return getProposedValues(this.getters, this.composer.currentEditedCell).map((value) => ({
|
|
17387
|
+
text: value.value?.toString() || "",
|
|
17388
|
+
htmlContent: [{ value: value.label }],
|
|
17389
|
+
fuzzySearchKey: value.label,
|
|
17390
|
+
}));
|
|
17404
17391
|
},
|
|
17405
17392
|
selectProposal(tokenAtCursor, value) {
|
|
17406
17393
|
this.composer.setCurrentContent(value);
|
|
17407
17394
|
this.composer.stopEdition();
|
|
17408
17395
|
},
|
|
17409
17396
|
});
|
|
17397
|
+
function getProposedValues(getters, position) {
|
|
17398
|
+
const rule = getters.getValidationRuleForCell(position);
|
|
17399
|
+
if (!rule ||
|
|
17400
|
+
(rule.criterion.type !== "isValueInList" && rule.criterion.type !== "isValueInRange")) {
|
|
17401
|
+
return [];
|
|
17402
|
+
}
|
|
17403
|
+
let values = [];
|
|
17404
|
+
if (rule.criterion.type === "isValueInList") {
|
|
17405
|
+
values = rule.criterion.values.map((value) => ({ label: value, value }));
|
|
17406
|
+
}
|
|
17407
|
+
else {
|
|
17408
|
+
const labelsSet = new Set();
|
|
17409
|
+
const range = getters.getRangeFromSheetXC(position.sheetId, rule.criterion.values[0]);
|
|
17410
|
+
for (const p of positions(range.zone)) {
|
|
17411
|
+
const cell = getters.getEvaluatedCell({ ...p, sheetId: range.sheetId });
|
|
17412
|
+
if (cell.formattedValue && !labelsSet.has(cell.formattedValue)) {
|
|
17413
|
+
labelsSet.add(cell.formattedValue);
|
|
17414
|
+
values.push({ label: cell.formattedValue, value: cell.value });
|
|
17415
|
+
}
|
|
17416
|
+
}
|
|
17417
|
+
}
|
|
17418
|
+
return values;
|
|
17419
|
+
}
|
|
17410
17420
|
|
|
17411
17421
|
function getHtmlContentFromPattern(pattern, value, highlightColor, className) {
|
|
17412
17422
|
const pendingHtmlContent = [];
|
|
@@ -25030,11 +25040,17 @@ const COLUMN = {
|
|
|
25030
25040
|
if (isEvaluationError(cellReference?.value)) {
|
|
25031
25041
|
return cellReference;
|
|
25032
25042
|
}
|
|
25033
|
-
|
|
25034
|
-
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25043
|
+
if (cellReference === undefined) {
|
|
25044
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25045
|
+
return this.__originCellPosition.col + 1;
|
|
25046
|
+
}
|
|
25047
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25048
|
+
if (zone.left === zone.right) {
|
|
25049
|
+
return zone.left + 1;
|
|
25050
|
+
}
|
|
25051
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
25052
|
+
value: zone.left + col + 1,
|
|
25053
|
+
}));
|
|
25038
25054
|
},
|
|
25039
25055
|
isExported: true,
|
|
25040
25056
|
};
|
|
@@ -25253,11 +25269,17 @@ const ROW = {
|
|
|
25253
25269
|
if (isEvaluationError(cellReference?.value)) {
|
|
25254
25270
|
return cellReference;
|
|
25255
25271
|
}
|
|
25256
|
-
|
|
25257
|
-
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25272
|
+
if (cellReference === undefined) {
|
|
25273
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25274
|
+
return this.__originCellPosition.row + 1;
|
|
25275
|
+
}
|
|
25276
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25277
|
+
if (zone.top === zone.bottom) {
|
|
25278
|
+
return zone.top + 1;
|
|
25279
|
+
}
|
|
25280
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
25281
|
+
value: zone.top + row + 1,
|
|
25282
|
+
}));
|
|
25261
25283
|
},
|
|
25262
25284
|
isExported: true,
|
|
25263
25285
|
};
|
|
@@ -27913,9 +27935,13 @@ class Composer extends Component {
|
|
|
27913
27935
|
}
|
|
27914
27936
|
}
|
|
27915
27937
|
closeAssistant() {
|
|
27938
|
+
if (!this.canBeToggled)
|
|
27939
|
+
return;
|
|
27916
27940
|
this.assistant.forcedClosed = true;
|
|
27917
27941
|
}
|
|
27918
27942
|
openAssistant() {
|
|
27943
|
+
if (!this.canBeToggled)
|
|
27944
|
+
return;
|
|
27919
27945
|
this.assistant.forcedClosed = false;
|
|
27920
27946
|
}
|
|
27921
27947
|
onWheel(event) {
|
|
@@ -27925,6 +27951,9 @@ class Composer extends Component {
|
|
|
27925
27951
|
event.stopPropagation();
|
|
27926
27952
|
}
|
|
27927
27953
|
}
|
|
27954
|
+
get canBeToggled() {
|
|
27955
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
27956
|
+
}
|
|
27928
27957
|
// ---------------------------------------------------------------------------
|
|
27929
27958
|
// Private
|
|
27930
27959
|
// ---------------------------------------------------------------------------
|
|
@@ -28107,7 +28136,7 @@ class Composer extends Component {
|
|
|
28107
28136
|
}
|
|
28108
28137
|
}
|
|
28109
28138
|
autoComplete(value) {
|
|
28110
|
-
if (!value || this.assistant.forcedClosed) {
|
|
28139
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
28111
28140
|
return;
|
|
28112
28141
|
}
|
|
28113
28142
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -39679,6 +39708,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39679
39708
|
proposals,
|
|
39680
39709
|
selectProposal: provider.selectProposal,
|
|
39681
39710
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39711
|
+
canBeToggled: provider.canBeToggled,
|
|
39682
39712
|
};
|
|
39683
39713
|
}
|
|
39684
39714
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -39701,6 +39731,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39701
39731
|
proposals,
|
|
39702
39732
|
selectProposal: provider.selectProposal,
|
|
39703
39733
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39734
|
+
canBeToggled: provider.canBeToggled,
|
|
39704
39735
|
};
|
|
39705
39736
|
}
|
|
39706
39737
|
}
|
|
@@ -44740,9 +44771,15 @@ class SpreadsheetPivot {
|
|
|
44740
44771
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
44741
44772
|
}
|
|
44742
44773
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
44743
|
-
const { field, value } = domain;
|
|
44774
|
+
const { field, value, type } = domain;
|
|
44744
44775
|
const { nameWithGranularity } = this.getDimension(field);
|
|
44745
|
-
return dataEntries.filter((entry) =>
|
|
44776
|
+
return dataEntries.filter((entry) => {
|
|
44777
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
44778
|
+
if (type === "char") {
|
|
44779
|
+
return String(cellValue) === String(value);
|
|
44780
|
+
}
|
|
44781
|
+
return cellValue === value;
|
|
44782
|
+
});
|
|
44746
44783
|
}
|
|
44747
44784
|
getDimension(nameWithGranularity) {
|
|
44748
44785
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -47217,6 +47254,11 @@ class GridComposer extends Component {
|
|
|
47217
47254
|
rect = this.defaultRect;
|
|
47218
47255
|
isEditing = false;
|
|
47219
47256
|
isCellReferenceVisible = false;
|
|
47257
|
+
currentEditedCell = {
|
|
47258
|
+
col: 0,
|
|
47259
|
+
row: 0,
|
|
47260
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
47261
|
+
};
|
|
47220
47262
|
composerStore;
|
|
47221
47263
|
composerFocusStore;
|
|
47222
47264
|
composerInterface;
|
|
@@ -47246,7 +47288,7 @@ class GridComposer extends Component {
|
|
|
47246
47288
|
return this.isCellReferenceVisible;
|
|
47247
47289
|
}
|
|
47248
47290
|
get cellReference() {
|
|
47249
|
-
const { col, row, sheetId } = this.
|
|
47291
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
47250
47292
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
47251
47293
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
47252
47294
|
}
|
|
@@ -47339,12 +47381,17 @@ class GridComposer extends Component {
|
|
|
47339
47381
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
47340
47382
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
47341
47383
|
}
|
|
47384
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
47342
47385
|
if (this.isEditing !== isEditing) {
|
|
47343
47386
|
this.isEditing = isEditing;
|
|
47344
47387
|
if (!isEditing) {
|
|
47345
47388
|
this.rect = this.defaultRect;
|
|
47346
47389
|
return;
|
|
47347
47390
|
}
|
|
47391
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
47392
|
+
shouldRecomputeRect = true;
|
|
47393
|
+
}
|
|
47394
|
+
if (shouldRecomputeRect) {
|
|
47348
47395
|
const position = this.env.model.getters.getActivePosition();
|
|
47349
47396
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
47350
47397
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -60411,6 +60458,23 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60411
60458
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
60412
60459
|
tallestCellInRow = {};
|
|
60413
60460
|
ctx = document.createElement("canvas").getContext("2d");
|
|
60461
|
+
beforeHandle(cmd) {
|
|
60462
|
+
switch (cmd.type) {
|
|
60463
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
60464
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
60465
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
60466
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
60467
|
+
case "ADD_COLUMNS_ROWS":
|
|
60468
|
+
if (cmd.dimension === "COL") {
|
|
60469
|
+
return;
|
|
60470
|
+
}
|
|
60471
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60472
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60473
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60474
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60475
|
+
break;
|
|
60476
|
+
}
|
|
60477
|
+
}
|
|
60414
60478
|
handle(cmd) {
|
|
60415
60479
|
switch (cmd.type) {
|
|
60416
60480
|
case "START":
|
|
@@ -60440,16 +60504,6 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60440
60504
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
60441
60505
|
break;
|
|
60442
60506
|
}
|
|
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
60507
|
case "RESIZE_COLUMNS_ROWS":
|
|
60454
60508
|
{
|
|
60455
60509
|
const sheetId = cmd.sheetId;
|
|
@@ -66138,6 +66192,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66138
66192
|
const isBasedBefore = cmd.base < start;
|
|
66139
66193
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
66140
66194
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
66195
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66196
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
66197
|
+
const size = isCol
|
|
66198
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
66199
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
66200
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
66201
|
+
return [element, isDefaultCol || size === undefined ? null : size];
|
|
66202
|
+
}));
|
|
66141
66203
|
const target = [
|
|
66142
66204
|
{
|
|
66143
66205
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -66168,14 +66230,12 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66168
66230
|
const col = selection.left;
|
|
66169
66231
|
const row = selection.top;
|
|
66170
66232
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
66171
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66172
66233
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
66173
66234
|
for (const element of toRemove) {
|
|
66174
|
-
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
66175
66235
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
66176
66236
|
dimension: cmd.dimension,
|
|
66177
66237
|
sheetId: cmd.sheetId,
|
|
66178
|
-
size,
|
|
66238
|
+
size: originalSize[element],
|
|
66179
66239
|
elements: [currentIndex],
|
|
66180
66240
|
});
|
|
66181
66241
|
currentIndex += 1;
|
|
@@ -67887,14 +67947,12 @@ class BottomBarSheet extends Component {
|
|
|
67887
67947
|
this.editionState = "initializing";
|
|
67888
67948
|
}
|
|
67889
67949
|
stopEdition() {
|
|
67890
|
-
|
|
67891
|
-
if (!this.state.isEditing || !input)
|
|
67950
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
67892
67951
|
return;
|
|
67893
67952
|
this.state.isEditing = false;
|
|
67894
67953
|
this.editionState = "initializing";
|
|
67895
|
-
|
|
67954
|
+
this.sheetNameRef.el.blur();
|
|
67896
67955
|
const inputValue = this.getInputContent() || "";
|
|
67897
|
-
input.innerText = inputValue;
|
|
67898
67956
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
67899
67957
|
}
|
|
67900
67958
|
cancelEdition() {
|
|
@@ -74546,6 +74604,6 @@ const constants = {
|
|
|
74546
74604
|
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
74605
|
|
|
74548
74606
|
|
|
74549
|
-
__info__.version = "18.0.
|
|
74550
|
-
__info__.date = "2025-07-
|
|
74551
|
-
__info__.hash = "
|
|
74607
|
+
__info__.version = "18.0.39";
|
|
74608
|
+
__info__.date = "2025-07-30T11:19:58.267Z";
|
|
74609
|
+
__info__.hash = "997e25a";
|
|
@@ -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.39
|
|
6
|
+
* @date 2025-07-30T11:19:58.267Z
|
|
7
|
+
* @hash 997e25a
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -17376,6 +17376,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17376
17376
|
|
|
17377
17377
|
autoCompleteProviders.add("dataValidation", {
|
|
17378
17378
|
displayAllOnInitialContent: true,
|
|
17379
|
+
canBeToggled: false,
|
|
17379
17380
|
getProposals(tokenAtCursor, content) {
|
|
17380
17381
|
if (content.startsWith("=")) {
|
|
17381
17382
|
return [];
|
|
@@ -17383,31 +17384,40 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17383
17384
|
if (!this.composer.currentEditedCell) {
|
|
17384
17385
|
return [];
|
|
17385
17386
|
}
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17390
|
-
|
|
17391
|
-
}
|
|
17392
|
-
let values;
|
|
17393
|
-
if (rule.criterion.type === "isValueInList") {
|
|
17394
|
-
values = rule.criterion.values;
|
|
17395
|
-
}
|
|
17396
|
-
else {
|
|
17397
|
-
const range = this.getters.getRangeFromSheetXC(position.sheetId, rule.criterion.values[0]);
|
|
17398
|
-
values = Array.from(new Set(this.getters
|
|
17399
|
-
.getRangeValues(range)
|
|
17400
|
-
.filter(isNotNull)
|
|
17401
|
-
.map((value) => value.toString())
|
|
17402
|
-
.filter((val) => val !== "")));
|
|
17403
|
-
}
|
|
17404
|
-
return values.map((value) => ({ text: value }));
|
|
17387
|
+
return getProposedValues(this.getters, this.composer.currentEditedCell).map((value) => ({
|
|
17388
|
+
text: value.value?.toString() || "",
|
|
17389
|
+
htmlContent: [{ value: value.label }],
|
|
17390
|
+
fuzzySearchKey: value.label,
|
|
17391
|
+
}));
|
|
17405
17392
|
},
|
|
17406
17393
|
selectProposal(tokenAtCursor, value) {
|
|
17407
17394
|
this.composer.setCurrentContent(value);
|
|
17408
17395
|
this.composer.stopEdition();
|
|
17409
17396
|
},
|
|
17410
17397
|
});
|
|
17398
|
+
function getProposedValues(getters, position) {
|
|
17399
|
+
const rule = getters.getValidationRuleForCell(position);
|
|
17400
|
+
if (!rule ||
|
|
17401
|
+
(rule.criterion.type !== "isValueInList" && rule.criterion.type !== "isValueInRange")) {
|
|
17402
|
+
return [];
|
|
17403
|
+
}
|
|
17404
|
+
let values = [];
|
|
17405
|
+
if (rule.criterion.type === "isValueInList") {
|
|
17406
|
+
values = rule.criterion.values.map((value) => ({ label: value, value }));
|
|
17407
|
+
}
|
|
17408
|
+
else {
|
|
17409
|
+
const labelsSet = new Set();
|
|
17410
|
+
const range = getters.getRangeFromSheetXC(position.sheetId, rule.criterion.values[0]);
|
|
17411
|
+
for (const p of positions(range.zone)) {
|
|
17412
|
+
const cell = getters.getEvaluatedCell({ ...p, sheetId: range.sheetId });
|
|
17413
|
+
if (cell.formattedValue && !labelsSet.has(cell.formattedValue)) {
|
|
17414
|
+
labelsSet.add(cell.formattedValue);
|
|
17415
|
+
values.push({ label: cell.formattedValue, value: cell.value });
|
|
17416
|
+
}
|
|
17417
|
+
}
|
|
17418
|
+
}
|
|
17419
|
+
return values;
|
|
17420
|
+
}
|
|
17411
17421
|
|
|
17412
17422
|
function getHtmlContentFromPattern(pattern, value, highlightColor, className) {
|
|
17413
17423
|
const pendingHtmlContent = [];
|
|
@@ -25031,11 +25041,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25031
25041
|
if (isEvaluationError(cellReference?.value)) {
|
|
25032
25042
|
return cellReference;
|
|
25033
25043
|
}
|
|
25034
|
-
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25038
|
-
|
|
25044
|
+
if (cellReference === undefined) {
|
|
25045
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25046
|
+
return this.__originCellPosition.col + 1;
|
|
25047
|
+
}
|
|
25048
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25049
|
+
if (zone.left === zone.right) {
|
|
25050
|
+
return zone.left + 1;
|
|
25051
|
+
}
|
|
25052
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
25053
|
+
value: zone.left + col + 1,
|
|
25054
|
+
}));
|
|
25039
25055
|
},
|
|
25040
25056
|
isExported: true,
|
|
25041
25057
|
};
|
|
@@ -25254,11 +25270,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25254
25270
|
if (isEvaluationError(cellReference?.value)) {
|
|
25255
25271
|
return cellReference;
|
|
25256
25272
|
}
|
|
25257
|
-
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25261
|
-
|
|
25273
|
+
if (cellReference === undefined) {
|
|
25274
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25275
|
+
return this.__originCellPosition.row + 1;
|
|
25276
|
+
}
|
|
25277
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25278
|
+
if (zone.top === zone.bottom) {
|
|
25279
|
+
return zone.top + 1;
|
|
25280
|
+
}
|
|
25281
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
25282
|
+
value: zone.top + row + 1,
|
|
25283
|
+
}));
|
|
25262
25284
|
},
|
|
25263
25285
|
isExported: true,
|
|
25264
25286
|
};
|
|
@@ -27914,9 +27936,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27914
27936
|
}
|
|
27915
27937
|
}
|
|
27916
27938
|
closeAssistant() {
|
|
27939
|
+
if (!this.canBeToggled)
|
|
27940
|
+
return;
|
|
27917
27941
|
this.assistant.forcedClosed = true;
|
|
27918
27942
|
}
|
|
27919
27943
|
openAssistant() {
|
|
27944
|
+
if (!this.canBeToggled)
|
|
27945
|
+
return;
|
|
27920
27946
|
this.assistant.forcedClosed = false;
|
|
27921
27947
|
}
|
|
27922
27948
|
onWheel(event) {
|
|
@@ -27926,6 +27952,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27926
27952
|
event.stopPropagation();
|
|
27927
27953
|
}
|
|
27928
27954
|
}
|
|
27955
|
+
get canBeToggled() {
|
|
27956
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
27957
|
+
}
|
|
27929
27958
|
// ---------------------------------------------------------------------------
|
|
27930
27959
|
// Private
|
|
27931
27960
|
// ---------------------------------------------------------------------------
|
|
@@ -28108,7 +28137,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28108
28137
|
}
|
|
28109
28138
|
}
|
|
28110
28139
|
autoComplete(value) {
|
|
28111
|
-
if (!value || this.assistant.forcedClosed) {
|
|
28140
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
28112
28141
|
return;
|
|
28113
28142
|
}
|
|
28114
28143
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -39680,6 +39709,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39680
39709
|
proposals,
|
|
39681
39710
|
selectProposal: provider.selectProposal,
|
|
39682
39711
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39712
|
+
canBeToggled: provider.canBeToggled,
|
|
39683
39713
|
};
|
|
39684
39714
|
}
|
|
39685
39715
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -39702,6 +39732,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39702
39732
|
proposals,
|
|
39703
39733
|
selectProposal: provider.selectProposal,
|
|
39704
39734
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39735
|
+
canBeToggled: provider.canBeToggled,
|
|
39705
39736
|
};
|
|
39706
39737
|
}
|
|
39707
39738
|
}
|
|
@@ -44741,9 +44772,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44741
44772
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
44742
44773
|
}
|
|
44743
44774
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
44744
|
-
const { field, value } = domain;
|
|
44775
|
+
const { field, value, type } = domain;
|
|
44745
44776
|
const { nameWithGranularity } = this.getDimension(field);
|
|
44746
|
-
return dataEntries.filter((entry) =>
|
|
44777
|
+
return dataEntries.filter((entry) => {
|
|
44778
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
44779
|
+
if (type === "char") {
|
|
44780
|
+
return String(cellValue) === String(value);
|
|
44781
|
+
}
|
|
44782
|
+
return cellValue === value;
|
|
44783
|
+
});
|
|
44747
44784
|
}
|
|
44748
44785
|
getDimension(nameWithGranularity) {
|
|
44749
44786
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -47218,6 +47255,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47218
47255
|
rect = this.defaultRect;
|
|
47219
47256
|
isEditing = false;
|
|
47220
47257
|
isCellReferenceVisible = false;
|
|
47258
|
+
currentEditedCell = {
|
|
47259
|
+
col: 0,
|
|
47260
|
+
row: 0,
|
|
47261
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
47262
|
+
};
|
|
47221
47263
|
composerStore;
|
|
47222
47264
|
composerFocusStore;
|
|
47223
47265
|
composerInterface;
|
|
@@ -47247,7 +47289,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47247
47289
|
return this.isCellReferenceVisible;
|
|
47248
47290
|
}
|
|
47249
47291
|
get cellReference() {
|
|
47250
|
-
const { col, row, sheetId } = this.
|
|
47292
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
47251
47293
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
47252
47294
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
47253
47295
|
}
|
|
@@ -47340,12 +47382,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47340
47382
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
47341
47383
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
47342
47384
|
}
|
|
47385
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
47343
47386
|
if (this.isEditing !== isEditing) {
|
|
47344
47387
|
this.isEditing = isEditing;
|
|
47345
47388
|
if (!isEditing) {
|
|
47346
47389
|
this.rect = this.defaultRect;
|
|
47347
47390
|
return;
|
|
47348
47391
|
}
|
|
47392
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
47393
|
+
shouldRecomputeRect = true;
|
|
47394
|
+
}
|
|
47395
|
+
if (shouldRecomputeRect) {
|
|
47349
47396
|
const position = this.env.model.getters.getActivePosition();
|
|
47350
47397
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
47351
47398
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -60412,6 +60459,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60412
60459
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
60413
60460
|
tallestCellInRow = {};
|
|
60414
60461
|
ctx = document.createElement("canvas").getContext("2d");
|
|
60462
|
+
beforeHandle(cmd) {
|
|
60463
|
+
switch (cmd.type) {
|
|
60464
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
60465
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
60466
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
60467
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
60468
|
+
case "ADD_COLUMNS_ROWS":
|
|
60469
|
+
if (cmd.dimension === "COL") {
|
|
60470
|
+
return;
|
|
60471
|
+
}
|
|
60472
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60473
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60474
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60475
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60476
|
+
break;
|
|
60477
|
+
}
|
|
60478
|
+
}
|
|
60415
60479
|
handle(cmd) {
|
|
60416
60480
|
switch (cmd.type) {
|
|
60417
60481
|
case "START":
|
|
@@ -60441,16 +60505,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60441
60505
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
60442
60506
|
break;
|
|
60443
60507
|
}
|
|
60444
|
-
case "ADD_COLUMNS_ROWS": {
|
|
60445
|
-
if (cmd.dimension === "COL") {
|
|
60446
|
-
return;
|
|
60447
|
-
}
|
|
60448
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60449
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60450
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60451
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60452
|
-
break;
|
|
60453
|
-
}
|
|
60454
60508
|
case "RESIZE_COLUMNS_ROWS":
|
|
60455
60509
|
{
|
|
60456
60510
|
const sheetId = cmd.sheetId;
|
|
@@ -66139,6 +66193,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66139
66193
|
const isBasedBefore = cmd.base < start;
|
|
66140
66194
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
66141
66195
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
66196
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66197
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
66198
|
+
const size = isCol
|
|
66199
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
66200
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
66201
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
66202
|
+
return [element, isDefaultCol || size === undefined ? null : size];
|
|
66203
|
+
}));
|
|
66142
66204
|
const target = [
|
|
66143
66205
|
{
|
|
66144
66206
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -66169,14 +66231,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66169
66231
|
const col = selection.left;
|
|
66170
66232
|
const row = selection.top;
|
|
66171
66233
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
66172
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66173
66234
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
66174
66235
|
for (const element of toRemove) {
|
|
66175
|
-
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
66176
66236
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
66177
66237
|
dimension: cmd.dimension,
|
|
66178
66238
|
sheetId: cmd.sheetId,
|
|
66179
|
-
size,
|
|
66239
|
+
size: originalSize[element],
|
|
66180
66240
|
elements: [currentIndex],
|
|
66181
66241
|
});
|
|
66182
66242
|
currentIndex += 1;
|
|
@@ -67888,14 +67948,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
67888
67948
|
this.editionState = "initializing";
|
|
67889
67949
|
}
|
|
67890
67950
|
stopEdition() {
|
|
67891
|
-
|
|
67892
|
-
if (!this.state.isEditing || !input)
|
|
67951
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
67893
67952
|
return;
|
|
67894
67953
|
this.state.isEditing = false;
|
|
67895
67954
|
this.editionState = "initializing";
|
|
67896
|
-
|
|
67955
|
+
this.sheetNameRef.el.blur();
|
|
67897
67956
|
const inputValue = this.getInputContent() || "";
|
|
67898
|
-
input.innerText = inputValue;
|
|
67899
67957
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
67900
67958
|
}
|
|
67901
67959
|
cancelEdition() {
|
|
@@ -74590,9 +74648,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74590
74648
|
exports.tokenize = tokenize;
|
|
74591
74649
|
|
|
74592
74650
|
|
|
74593
|
-
__info__.version = "18.0.
|
|
74594
|
-
__info__.date = "2025-07-
|
|
74595
|
-
__info__.hash = "
|
|
74651
|
+
__info__.version = "18.0.39";
|
|
74652
|
+
__info__.date = "2025-07-30T11:19:58.267Z";
|
|
74653
|
+
__info__.hash = "997e25a";
|
|
74596
74654
|
|
|
74597
74655
|
|
|
74598
74656
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|