@odoo/o-spreadsheet 17.2.22 → 17.2.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 +76 -39
- package/dist/o-spreadsheet.d.ts +5 -4
- package/dist/o-spreadsheet.esm.js +76 -39
- package/dist/o-spreadsheet.iife.js +76 -39
- package/dist/o-spreadsheet.iife.min.js +16 -5
- package/dist/o_spreadsheet.xml +4 -4
- package/package.json +1 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
5
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.2.
|
|
7
|
-
* @date 2024-
|
|
8
|
-
* @hash
|
|
6
|
+
* @version 17.2.24
|
|
7
|
+
* @date 2024-10-14T07:49:56.845Z
|
|
8
|
+
* @hash 7e88bec
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
@@ -163,7 +163,7 @@ const DEFAULT_STYLE = {
|
|
|
163
163
|
underline: false,
|
|
164
164
|
fontSize: 10,
|
|
165
165
|
fillColor: "",
|
|
166
|
-
textColor: "
|
|
166
|
+
textColor: "",
|
|
167
167
|
};
|
|
168
168
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
169
169
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
@@ -5787,9 +5787,11 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
5787
5787
|
const targetCell = this.getters.getEvaluatedCell(target);
|
|
5788
5788
|
const originFormat = origin.cell?.format ?? origin.evaluatedCell.format;
|
|
5789
5789
|
if (clipboardOption?.pasteOption === "asValue") {
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5790
|
+
this.dispatch("UPDATE_CELL", {
|
|
5791
|
+
...target,
|
|
5792
|
+
content: origin.evaluatedCell.value?.toString() || "",
|
|
5793
|
+
format: originFormat,
|
|
5794
|
+
});
|
|
5793
5795
|
return;
|
|
5794
5796
|
}
|
|
5795
5797
|
if (clipboardOption?.pasteOption === "onlyFormat") {
|
|
@@ -6299,25 +6301,26 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
6299
6301
|
for (let col of columnsIndexes) {
|
|
6300
6302
|
const position = { col, row, sheetId };
|
|
6301
6303
|
const table = this.getters.getTable(position);
|
|
6302
|
-
if (!table
|
|
6304
|
+
if (!table) {
|
|
6303
6305
|
tableCellsInRow.push({});
|
|
6304
6306
|
continue;
|
|
6305
6307
|
}
|
|
6308
|
+
let copiedTable = undefined;
|
|
6306
6309
|
// Copy whole table
|
|
6307
|
-
if (
|
|
6310
|
+
if (!copiedTablesIds.has(table.id) &&
|
|
6311
|
+
zones.some((z) => isZoneInside(table.range.zone, z))) {
|
|
6308
6312
|
copiedTablesIds.add(table.id);
|
|
6309
6313
|
const values = [];
|
|
6310
6314
|
for (const col of range(table.range.zone.left, table.range.zone.right + 1)) {
|
|
6311
6315
|
values.push(this.getters.getFilterHiddenValues({ sheetId, col, row: table.range.zone.top }));
|
|
6312
6316
|
}
|
|
6313
|
-
|
|
6314
|
-
table: { filtersValues: values, range: table.range, config: table.config },
|
|
6315
|
-
});
|
|
6316
|
-
}
|
|
6317
|
-
// Copy only style of cell
|
|
6318
|
-
else {
|
|
6319
|
-
tableCellsInRow.push({ style: this.getTableStyleToCopy(position) });
|
|
6317
|
+
copiedTable = { filtersValues: values, range: table.range, config: table.config };
|
|
6320
6318
|
}
|
|
6319
|
+
tableCellsInRow.push({
|
|
6320
|
+
table: copiedTable,
|
|
6321
|
+
style: this.getTableStyleToCopy(position),
|
|
6322
|
+
isWholeTableCopied: copiedTablesIds.has(table.id),
|
|
6323
|
+
});
|
|
6321
6324
|
}
|
|
6322
6325
|
}
|
|
6323
6326
|
return {
|
|
@@ -6409,8 +6412,12 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
6409
6412
|
}
|
|
6410
6413
|
}
|
|
6411
6414
|
// Do not paste table style if we're inside another table
|
|
6412
|
-
if (
|
|
6413
|
-
|
|
6415
|
+
if (this.getters.getTable(position) || options?.pasteOption === "asValue") {
|
|
6416
|
+
return;
|
|
6417
|
+
}
|
|
6418
|
+
if ((!options?.pasteOption && !tableCell.isWholeTableCopied) ||
|
|
6419
|
+
options?.pasteOption === "onlyFormat") {
|
|
6420
|
+
if (tableCell.style?.style) {
|
|
6414
6421
|
this.dispatch("UPDATE_CELL", { ...position, style: tableCell.style.style });
|
|
6415
6422
|
}
|
|
6416
6423
|
if (tableCell.style?.border) {
|
|
@@ -37590,6 +37597,18 @@ function convertOperator(operator) {
|
|
|
37590
37597
|
// -------------------------------------
|
|
37591
37598
|
// WORKSHEET HELPERS
|
|
37592
37599
|
// -------------------------------------
|
|
37600
|
+
function getCellType(value) {
|
|
37601
|
+
switch (typeof value) {
|
|
37602
|
+
case "boolean":
|
|
37603
|
+
return "b";
|
|
37604
|
+
case "string":
|
|
37605
|
+
return "str";
|
|
37606
|
+
case "number":
|
|
37607
|
+
return "n";
|
|
37608
|
+
default:
|
|
37609
|
+
return undefined;
|
|
37610
|
+
}
|
|
37611
|
+
}
|
|
37593
37612
|
function convertHeightToExcel(height) {
|
|
37594
37613
|
return Math.round(HEIGHT_FACTOR * height * 100) / 100;
|
|
37595
37614
|
}
|
|
@@ -50425,9 +50444,9 @@ class Session extends EventBus {
|
|
|
50425
50444
|
/**
|
|
50426
50445
|
* Notify the server that the user client left the collaborative session
|
|
50427
50446
|
*/
|
|
50428
|
-
leave(data) {
|
|
50447
|
+
async leave(data) {
|
|
50429
50448
|
if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
|
|
50430
|
-
this.snapshot(data());
|
|
50449
|
+
await this.snapshot(data());
|
|
50431
50450
|
}
|
|
50432
50451
|
delete this.clients[this.clientId];
|
|
50433
50452
|
this.transportService.leave(this.clientId);
|
|
@@ -50440,12 +50459,12 @@ class Session extends EventBus {
|
|
|
50440
50459
|
/**
|
|
50441
50460
|
* Send a snapshot of the spreadsheet to the collaboration server
|
|
50442
50461
|
*/
|
|
50443
|
-
snapshot(data) {
|
|
50462
|
+
async snapshot(data) {
|
|
50444
50463
|
if (this.pendingMessages.length !== 0) {
|
|
50445
50464
|
return;
|
|
50446
50465
|
}
|
|
50447
50466
|
const snapshotId = this.uuidGenerator.uuidv4();
|
|
50448
|
-
this.transportService.sendMessage({
|
|
50467
|
+
await this.transportService.sendMessage({
|
|
50449
50468
|
type: "SNAPSHOT",
|
|
50450
50469
|
nextRevisionId: snapshotId,
|
|
50451
50470
|
serverRevisionId: this.serverRevisionId,
|
|
@@ -50659,6 +50678,7 @@ class Session extends EventBus {
|
|
|
50659
50678
|
case "REMOTE_REVISION":
|
|
50660
50679
|
case "REVISION_REDONE":
|
|
50661
50680
|
case "REVISION_UNDONE":
|
|
50681
|
+
case "SNAPSHOT_CREATED":
|
|
50662
50682
|
return this.processedRevisions.has(message.nextRevisionId);
|
|
50663
50683
|
default:
|
|
50664
50684
|
return false;
|
|
@@ -52125,6 +52145,9 @@ class TableStylePlugin extends UIPlugin {
|
|
|
52125
52145
|
case "FOLD_HEADER_GROUP":
|
|
52126
52146
|
case "FOLD_ALL_HEADER_GROUPS":
|
|
52127
52147
|
case "UNFOLD_ALL_HEADER_GROUPS":
|
|
52148
|
+
case "FOLD_HEADER_GROUPS_IN_ZONE":
|
|
52149
|
+
case "UNFOLD_HEADER_GROUPS_IN_ZONE":
|
|
52150
|
+
case "UNGROUP_HEADERS":
|
|
52128
52151
|
case "UPDATE_TABLE":
|
|
52129
52152
|
case "UPDATE_FILTER":
|
|
52130
52153
|
delete this.tableStyles[cmd.sheetId];
|
|
@@ -52820,6 +52843,8 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
52820
52843
|
case "UNFOLD_HEADER_GROUP":
|
|
52821
52844
|
case "FOLD_ALL_HEADER_GROUPS":
|
|
52822
52845
|
case "UNFOLD_ALL_HEADER_GROUPS":
|
|
52846
|
+
case "FOLD_HEADER_GROUPS_IN_ZONE":
|
|
52847
|
+
case "UNFOLD_HEADER_GROUPS_IN_ZONE":
|
|
52823
52848
|
this.updateHiddenRows(cmd.sheetId);
|
|
52824
52849
|
break;
|
|
52825
52850
|
case "UPDATE_FILTER":
|
|
@@ -53214,6 +53239,8 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
53214
53239
|
this.selectedFigureId = null;
|
|
53215
53240
|
break;
|
|
53216
53241
|
}
|
|
53242
|
+
}
|
|
53243
|
+
finalize() {
|
|
53217
53244
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
53218
53245
|
this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
|
|
53219
53246
|
}
|
|
@@ -54042,7 +54069,6 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
54042
54069
|
}
|
|
54043
54070
|
}
|
|
54044
54071
|
handle(cmd) {
|
|
54045
|
-
this.cleanViewports();
|
|
54046
54072
|
// changing the evaluation can hide/show rows because of data filters
|
|
54047
54073
|
if (invalidateEvaluationCommands.has(cmd.type)) {
|
|
54048
54074
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
@@ -54058,6 +54084,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
54058
54084
|
break;
|
|
54059
54085
|
case "UNDO":
|
|
54060
54086
|
case "REDO":
|
|
54087
|
+
this.cleanViewports();
|
|
54061
54088
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
54062
54089
|
this.sheetsWithDirtyViewports.add(sheetId);
|
|
54063
54090
|
}
|
|
@@ -54112,6 +54139,9 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
54112
54139
|
}
|
|
54113
54140
|
}
|
|
54114
54141
|
break;
|
|
54142
|
+
case "DELETE_SHEET":
|
|
54143
|
+
this.cleanViewports();
|
|
54144
|
+
break;
|
|
54115
54145
|
case "ACTIVATE_SHEET":
|
|
54116
54146
|
this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
|
|
54117
54147
|
break;
|
|
@@ -55272,6 +55302,17 @@ css /* scss */ `
|
|
|
55272
55302
|
.o-bottom-bar-fade-in {
|
|
55273
55303
|
background-image: linear-gradient(90deg, #cfcfcf, transparent 1%);
|
|
55274
55304
|
}
|
|
55305
|
+
|
|
55306
|
+
.o-sheet-list {
|
|
55307
|
+
overflow-y: hidden;
|
|
55308
|
+
overflow-x: auto;
|
|
55309
|
+
|
|
55310
|
+
&::-webkit-scrollbar {
|
|
55311
|
+
display: none; /* Chrome */
|
|
55312
|
+
}
|
|
55313
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
55314
|
+
scrollbar-width: none; /* Firefox */
|
|
55315
|
+
}
|
|
55275
55316
|
}
|
|
55276
55317
|
|
|
55277
55318
|
.o-bottom-bar-arrows {
|
|
@@ -57168,7 +57209,7 @@ class Spreadsheet extends owl.Component {
|
|
|
57168
57209
|
|
|
57169
57210
|
class LocalTransportService {
|
|
57170
57211
|
listeners = [];
|
|
57171
|
-
sendMessage(message) {
|
|
57212
|
+
async sendMessage(message) {
|
|
57172
57213
|
for (const { callback } of this.listeners) {
|
|
57173
57214
|
callback(message);
|
|
57174
57215
|
}
|
|
@@ -59005,17 +59046,13 @@ function addFormula(cell) {
|
|
|
59005
59046
|
if (!formula) {
|
|
59006
59047
|
return { attrs: [], node: escapeXml `` };
|
|
59007
59048
|
}
|
|
59008
|
-
const
|
|
59009
|
-
|
|
59010
|
-
|
|
59011
|
-
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
59012
|
-
// hack for cycles : if we don't set a value (be it 0 or #VALUE!), it will appear as invisible on excel,
|
|
59013
|
-
// Making it very hard for the client to find where the recursion is.
|
|
59014
|
-
if (cell.value === CellErrorType.CircularDependency) {
|
|
59015
|
-
attrs.push(["t", "str"]);
|
|
59016
|
-
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
59049
|
+
const type = getCellType(cell.value);
|
|
59050
|
+
if (type === undefined) {
|
|
59051
|
+
return { attrs: [], node: escapeXml `` };
|
|
59017
59052
|
}
|
|
59018
|
-
|
|
59053
|
+
const attrs = [["t", type]];
|
|
59054
|
+
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
59055
|
+
const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${cell.value}</v>`;
|
|
59019
59056
|
return { attrs, node };
|
|
59020
59057
|
}
|
|
59021
59058
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -60367,8 +60404,8 @@ class Model extends EventBus {
|
|
|
60367
60404
|
joinSession() {
|
|
60368
60405
|
this.session.join(this.config.client);
|
|
60369
60406
|
}
|
|
60370
|
-
leaveSession() {
|
|
60371
|
-
this.session.leave(lazy(() => this.exportData()));
|
|
60407
|
+
async leaveSession() {
|
|
60408
|
+
await this.session.leave(lazy(() => this.exportData()));
|
|
60372
60409
|
}
|
|
60373
60410
|
setupUiPlugin(Plugin) {
|
|
60374
60411
|
const plugin = new Plugin(this.uiPluginConfig);
|
|
@@ -60922,6 +60959,6 @@ exports.tokenColors = tokenColors;
|
|
|
60922
60959
|
exports.tokenize = tokenize;
|
|
60923
60960
|
|
|
60924
60961
|
|
|
60925
|
-
__info__.version = "17.2.
|
|
60926
|
-
__info__.date = "2024-
|
|
60927
|
-
__info__.hash = "
|
|
60962
|
+
__info__.version = "17.2.24";
|
|
60963
|
+
__info__.date = "2024-10-14T07:49:56.845Z";
|
|
60964
|
+
__info__.hash = "7e88bec";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -3354,7 +3354,7 @@ interface TransportService<T = any> {
|
|
|
3354
3354
|
/**
|
|
3355
3355
|
* Send a message to all clients
|
|
3356
3356
|
*/
|
|
3357
|
-
sendMessage: (message: T) => void
|
|
3357
|
+
sendMessage: (message: T) => Promise<void>;
|
|
3358
3358
|
/**
|
|
3359
3359
|
* Register a callback function which will be called each time
|
|
3360
3360
|
* a new message is received.
|
|
@@ -3451,11 +3451,11 @@ declare class Session extends EventBus<CollaborativeEvent> {
|
|
|
3451
3451
|
/**
|
|
3452
3452
|
* Notify the server that the user client left the collaborative session
|
|
3453
3453
|
*/
|
|
3454
|
-
leave(data: Lazy<WorkbookData>): void
|
|
3454
|
+
leave(data: Lazy<WorkbookData>): Promise<void>;
|
|
3455
3455
|
/**
|
|
3456
3456
|
* Send a snapshot of the spreadsheet to the collaboration server
|
|
3457
3457
|
*/
|
|
3458
|
-
snapshot(data: WorkbookData): void
|
|
3458
|
+
snapshot(data: WorkbookData): Promise<void>;
|
|
3459
3459
|
getClient(): Client;
|
|
3460
3460
|
getConnectedClients(): Set<Client>;
|
|
3461
3461
|
getRevisionId(): UID;
|
|
@@ -4227,6 +4227,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4227
4227
|
allowDispatch(cmd: LocalCommand): CommandResult;
|
|
4228
4228
|
private handleEvent;
|
|
4229
4229
|
handle(cmd: Command): void;
|
|
4230
|
+
finalize(): void;
|
|
4230
4231
|
isGridSelectionActive(): boolean;
|
|
4231
4232
|
getActiveSheet(): Readonly<Sheet>;
|
|
4232
4233
|
getActiveSheetId(): UID;
|
|
@@ -5167,7 +5168,7 @@ declare class Model extends EventBus<any> implements CommandDispatcher {
|
|
|
5167
5168
|
private readonly coreHandlers;
|
|
5168
5169
|
constructor(data?: any, config?: Partial<ModelConfig>, stateUpdateMessages?: StateUpdateMessage[], uuidGenerator?: UuidGenerator, verboseImport?: boolean);
|
|
5169
5170
|
joinSession(): void;
|
|
5170
|
-
leaveSession(): void
|
|
5171
|
+
leaveSession(): Promise<void>;
|
|
5171
5172
|
private setupUiPlugin;
|
|
5172
5173
|
/**
|
|
5173
5174
|
* Initialize and properly configure a plugin.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
5
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.2.
|
|
7
|
-
* @date 2024-
|
|
8
|
-
* @hash
|
|
6
|
+
* @version 17.2.24
|
|
7
|
+
* @date 2024-10-14T07:49:56.845Z
|
|
8
|
+
* @hash 7e88bec
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw } from '@odoo/owl';
|
|
@@ -161,7 +161,7 @@ const DEFAULT_STYLE = {
|
|
|
161
161
|
underline: false,
|
|
162
162
|
fontSize: 10,
|
|
163
163
|
fillColor: "",
|
|
164
|
-
textColor: "
|
|
164
|
+
textColor: "",
|
|
165
165
|
};
|
|
166
166
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
167
167
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
@@ -5785,9 +5785,11 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
5785
5785
|
const targetCell = this.getters.getEvaluatedCell(target);
|
|
5786
5786
|
const originFormat = origin.cell?.format ?? origin.evaluatedCell.format;
|
|
5787
5787
|
if (clipboardOption?.pasteOption === "asValue") {
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5788
|
+
this.dispatch("UPDATE_CELL", {
|
|
5789
|
+
...target,
|
|
5790
|
+
content: origin.evaluatedCell.value?.toString() || "",
|
|
5791
|
+
format: originFormat,
|
|
5792
|
+
});
|
|
5791
5793
|
return;
|
|
5792
5794
|
}
|
|
5793
5795
|
if (clipboardOption?.pasteOption === "onlyFormat") {
|
|
@@ -6297,25 +6299,26 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
6297
6299
|
for (let col of columnsIndexes) {
|
|
6298
6300
|
const position = { col, row, sheetId };
|
|
6299
6301
|
const table = this.getters.getTable(position);
|
|
6300
|
-
if (!table
|
|
6302
|
+
if (!table) {
|
|
6301
6303
|
tableCellsInRow.push({});
|
|
6302
6304
|
continue;
|
|
6303
6305
|
}
|
|
6306
|
+
let copiedTable = undefined;
|
|
6304
6307
|
// Copy whole table
|
|
6305
|
-
if (
|
|
6308
|
+
if (!copiedTablesIds.has(table.id) &&
|
|
6309
|
+
zones.some((z) => isZoneInside(table.range.zone, z))) {
|
|
6306
6310
|
copiedTablesIds.add(table.id);
|
|
6307
6311
|
const values = [];
|
|
6308
6312
|
for (const col of range(table.range.zone.left, table.range.zone.right + 1)) {
|
|
6309
6313
|
values.push(this.getters.getFilterHiddenValues({ sheetId, col, row: table.range.zone.top }));
|
|
6310
6314
|
}
|
|
6311
|
-
|
|
6312
|
-
table: { filtersValues: values, range: table.range, config: table.config },
|
|
6313
|
-
});
|
|
6314
|
-
}
|
|
6315
|
-
// Copy only style of cell
|
|
6316
|
-
else {
|
|
6317
|
-
tableCellsInRow.push({ style: this.getTableStyleToCopy(position) });
|
|
6315
|
+
copiedTable = { filtersValues: values, range: table.range, config: table.config };
|
|
6318
6316
|
}
|
|
6317
|
+
tableCellsInRow.push({
|
|
6318
|
+
table: copiedTable,
|
|
6319
|
+
style: this.getTableStyleToCopy(position),
|
|
6320
|
+
isWholeTableCopied: copiedTablesIds.has(table.id),
|
|
6321
|
+
});
|
|
6319
6322
|
}
|
|
6320
6323
|
}
|
|
6321
6324
|
return {
|
|
@@ -6407,8 +6410,12 @@ class TableClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
6407
6410
|
}
|
|
6408
6411
|
}
|
|
6409
6412
|
// Do not paste table style if we're inside another table
|
|
6410
|
-
if (
|
|
6411
|
-
|
|
6413
|
+
if (this.getters.getTable(position) || options?.pasteOption === "asValue") {
|
|
6414
|
+
return;
|
|
6415
|
+
}
|
|
6416
|
+
if ((!options?.pasteOption && !tableCell.isWholeTableCopied) ||
|
|
6417
|
+
options?.pasteOption === "onlyFormat") {
|
|
6418
|
+
if (tableCell.style?.style) {
|
|
6412
6419
|
this.dispatch("UPDATE_CELL", { ...position, style: tableCell.style.style });
|
|
6413
6420
|
}
|
|
6414
6421
|
if (tableCell.style?.border) {
|
|
@@ -37588,6 +37595,18 @@ function convertOperator(operator) {
|
|
|
37588
37595
|
// -------------------------------------
|
|
37589
37596
|
// WORKSHEET HELPERS
|
|
37590
37597
|
// -------------------------------------
|
|
37598
|
+
function getCellType(value) {
|
|
37599
|
+
switch (typeof value) {
|
|
37600
|
+
case "boolean":
|
|
37601
|
+
return "b";
|
|
37602
|
+
case "string":
|
|
37603
|
+
return "str";
|
|
37604
|
+
case "number":
|
|
37605
|
+
return "n";
|
|
37606
|
+
default:
|
|
37607
|
+
return undefined;
|
|
37608
|
+
}
|
|
37609
|
+
}
|
|
37591
37610
|
function convertHeightToExcel(height) {
|
|
37592
37611
|
return Math.round(HEIGHT_FACTOR * height * 100) / 100;
|
|
37593
37612
|
}
|
|
@@ -50423,9 +50442,9 @@ class Session extends EventBus {
|
|
|
50423
50442
|
/**
|
|
50424
50443
|
* Notify the server that the user client left the collaborative session
|
|
50425
50444
|
*/
|
|
50426
|
-
leave(data) {
|
|
50445
|
+
async leave(data) {
|
|
50427
50446
|
if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
|
|
50428
|
-
this.snapshot(data());
|
|
50447
|
+
await this.snapshot(data());
|
|
50429
50448
|
}
|
|
50430
50449
|
delete this.clients[this.clientId];
|
|
50431
50450
|
this.transportService.leave(this.clientId);
|
|
@@ -50438,12 +50457,12 @@ class Session extends EventBus {
|
|
|
50438
50457
|
/**
|
|
50439
50458
|
* Send a snapshot of the spreadsheet to the collaboration server
|
|
50440
50459
|
*/
|
|
50441
|
-
snapshot(data) {
|
|
50460
|
+
async snapshot(data) {
|
|
50442
50461
|
if (this.pendingMessages.length !== 0) {
|
|
50443
50462
|
return;
|
|
50444
50463
|
}
|
|
50445
50464
|
const snapshotId = this.uuidGenerator.uuidv4();
|
|
50446
|
-
this.transportService.sendMessage({
|
|
50465
|
+
await this.transportService.sendMessage({
|
|
50447
50466
|
type: "SNAPSHOT",
|
|
50448
50467
|
nextRevisionId: snapshotId,
|
|
50449
50468
|
serverRevisionId: this.serverRevisionId,
|
|
@@ -50657,6 +50676,7 @@ class Session extends EventBus {
|
|
|
50657
50676
|
case "REMOTE_REVISION":
|
|
50658
50677
|
case "REVISION_REDONE":
|
|
50659
50678
|
case "REVISION_UNDONE":
|
|
50679
|
+
case "SNAPSHOT_CREATED":
|
|
50660
50680
|
return this.processedRevisions.has(message.nextRevisionId);
|
|
50661
50681
|
default:
|
|
50662
50682
|
return false;
|
|
@@ -52123,6 +52143,9 @@ class TableStylePlugin extends UIPlugin {
|
|
|
52123
52143
|
case "FOLD_HEADER_GROUP":
|
|
52124
52144
|
case "FOLD_ALL_HEADER_GROUPS":
|
|
52125
52145
|
case "UNFOLD_ALL_HEADER_GROUPS":
|
|
52146
|
+
case "FOLD_HEADER_GROUPS_IN_ZONE":
|
|
52147
|
+
case "UNFOLD_HEADER_GROUPS_IN_ZONE":
|
|
52148
|
+
case "UNGROUP_HEADERS":
|
|
52126
52149
|
case "UPDATE_TABLE":
|
|
52127
52150
|
case "UPDATE_FILTER":
|
|
52128
52151
|
delete this.tableStyles[cmd.sheetId];
|
|
@@ -52818,6 +52841,8 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
52818
52841
|
case "UNFOLD_HEADER_GROUP":
|
|
52819
52842
|
case "FOLD_ALL_HEADER_GROUPS":
|
|
52820
52843
|
case "UNFOLD_ALL_HEADER_GROUPS":
|
|
52844
|
+
case "FOLD_HEADER_GROUPS_IN_ZONE":
|
|
52845
|
+
case "UNFOLD_HEADER_GROUPS_IN_ZONE":
|
|
52821
52846
|
this.updateHiddenRows(cmd.sheetId);
|
|
52822
52847
|
break;
|
|
52823
52848
|
case "UPDATE_FILTER":
|
|
@@ -53212,6 +53237,8 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
53212
53237
|
this.selectedFigureId = null;
|
|
53213
53238
|
break;
|
|
53214
53239
|
}
|
|
53240
|
+
}
|
|
53241
|
+
finalize() {
|
|
53215
53242
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
53216
53243
|
this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
|
|
53217
53244
|
}
|
|
@@ -54040,7 +54067,6 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
54040
54067
|
}
|
|
54041
54068
|
}
|
|
54042
54069
|
handle(cmd) {
|
|
54043
|
-
this.cleanViewports();
|
|
54044
54070
|
// changing the evaluation can hide/show rows because of data filters
|
|
54045
54071
|
if (invalidateEvaluationCommands.has(cmd.type)) {
|
|
54046
54072
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
@@ -54056,6 +54082,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
54056
54082
|
break;
|
|
54057
54083
|
case "UNDO":
|
|
54058
54084
|
case "REDO":
|
|
54085
|
+
this.cleanViewports();
|
|
54059
54086
|
for (const sheetId of this.getters.getSheetIds()) {
|
|
54060
54087
|
this.sheetsWithDirtyViewports.add(sheetId);
|
|
54061
54088
|
}
|
|
@@ -54110,6 +54137,9 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
54110
54137
|
}
|
|
54111
54138
|
}
|
|
54112
54139
|
break;
|
|
54140
|
+
case "DELETE_SHEET":
|
|
54141
|
+
this.cleanViewports();
|
|
54142
|
+
break;
|
|
54113
54143
|
case "ACTIVATE_SHEET":
|
|
54114
54144
|
this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
|
|
54115
54145
|
break;
|
|
@@ -55270,6 +55300,17 @@ css /* scss */ `
|
|
|
55270
55300
|
.o-bottom-bar-fade-in {
|
|
55271
55301
|
background-image: linear-gradient(90deg, #cfcfcf, transparent 1%);
|
|
55272
55302
|
}
|
|
55303
|
+
|
|
55304
|
+
.o-sheet-list {
|
|
55305
|
+
overflow-y: hidden;
|
|
55306
|
+
overflow-x: auto;
|
|
55307
|
+
|
|
55308
|
+
&::-webkit-scrollbar {
|
|
55309
|
+
display: none; /* Chrome */
|
|
55310
|
+
}
|
|
55311
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
55312
|
+
scrollbar-width: none; /* Firefox */
|
|
55313
|
+
}
|
|
55273
55314
|
}
|
|
55274
55315
|
|
|
55275
55316
|
.o-bottom-bar-arrows {
|
|
@@ -57166,7 +57207,7 @@ class Spreadsheet extends Component {
|
|
|
57166
57207
|
|
|
57167
57208
|
class LocalTransportService {
|
|
57168
57209
|
listeners = [];
|
|
57169
|
-
sendMessage(message) {
|
|
57210
|
+
async sendMessage(message) {
|
|
57170
57211
|
for (const { callback } of this.listeners) {
|
|
57171
57212
|
callback(message);
|
|
57172
57213
|
}
|
|
@@ -59003,17 +59044,13 @@ function addFormula(cell) {
|
|
|
59003
59044
|
if (!formula) {
|
|
59004
59045
|
return { attrs: [], node: escapeXml `` };
|
|
59005
59046
|
}
|
|
59006
|
-
const
|
|
59007
|
-
|
|
59008
|
-
|
|
59009
|
-
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
59010
|
-
// hack for cycles : if we don't set a value (be it 0 or #VALUE!), it will appear as invisible on excel,
|
|
59011
|
-
// Making it very hard for the client to find where the recursion is.
|
|
59012
|
-
if (cell.value === CellErrorType.CircularDependency) {
|
|
59013
|
-
attrs.push(["t", "str"]);
|
|
59014
|
-
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
59047
|
+
const type = getCellType(cell.value);
|
|
59048
|
+
if (type === undefined) {
|
|
59049
|
+
return { attrs: [], node: escapeXml `` };
|
|
59015
59050
|
}
|
|
59016
|
-
|
|
59051
|
+
const attrs = [["t", type]];
|
|
59052
|
+
const XlsxFormula = adaptFormulaToExcel(formula);
|
|
59053
|
+
const node = escapeXml /*xml*/ `<f>${XlsxFormula}</f><v>${cell.value}</v>`;
|
|
59017
59054
|
return { attrs, node };
|
|
59018
59055
|
}
|
|
59019
59056
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -60365,8 +60402,8 @@ class Model extends EventBus {
|
|
|
60365
60402
|
joinSession() {
|
|
60366
60403
|
this.session.join(this.config.client);
|
|
60367
60404
|
}
|
|
60368
|
-
leaveSession() {
|
|
60369
|
-
this.session.leave(lazy(() => this.exportData()));
|
|
60405
|
+
async leaveSession() {
|
|
60406
|
+
await this.session.leave(lazy(() => this.exportData()));
|
|
60370
60407
|
}
|
|
60371
60408
|
setupUiPlugin(Plugin) {
|
|
60372
60409
|
const plugin = new Plugin(this.uiPluginConfig);
|
|
@@ -60879,6 +60916,6 @@ const constants = {
|
|
|
60879
60916
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, 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 };
|
|
60880
60917
|
|
|
60881
60918
|
|
|
60882
|
-
__info__.version = "17.2.
|
|
60883
|
-
__info__.date = "2024-
|
|
60884
|
-
__info__.hash = "
|
|
60919
|
+
__info__.version = "17.2.24";
|
|
60920
|
+
__info__.date = "2024-10-14T07:49:56.845Z";
|
|
60921
|
+
__info__.hash = "7e88bec";
|