@odoo/o-spreadsheet 18.2.0-alpha.3 → 18.2.0-alpha.4
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.
|
@@ -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.2.0-alpha.
|
|
6
|
-
* @date 2025-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.0-alpha.4
|
|
6
|
+
* @date 2025-01-29T06:30:12.773Z
|
|
7
|
+
* @hash 6838c26
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -40096,14 +40096,21 @@ class ChartTypePicker extends owl.Component {
|
|
|
40096
40096
|
class MainChartPanelStore extends SpreadsheetStore {
|
|
40097
40097
|
mutators = ["activatePanel", "changeChartType"];
|
|
40098
40098
|
panel = "configuration";
|
|
40099
|
-
|
|
40099
|
+
creationContexts = {};
|
|
40100
40100
|
activatePanel(panel) {
|
|
40101
40101
|
this.panel = panel;
|
|
40102
40102
|
}
|
|
40103
40103
|
changeChartType(figureId, newDisplayType) {
|
|
40104
|
-
|
|
40105
|
-
|
|
40106
|
-
|
|
40104
|
+
const currentCreationContext = this.getters.getContextCreationChart(figureId);
|
|
40105
|
+
const savedCreationContext = this.creationContexts[figureId] || {};
|
|
40106
|
+
let newRanges = currentCreationContext?.range;
|
|
40107
|
+
if (newRanges?.every((range, i) => deepEquals(range, savedCreationContext.range?.[i]))) {
|
|
40108
|
+
newRanges = Object.assign([], savedCreationContext.range, currentCreationContext?.range);
|
|
40109
|
+
}
|
|
40110
|
+
this.creationContexts[figureId] = {
|
|
40111
|
+
...savedCreationContext,
|
|
40112
|
+
...currentCreationContext,
|
|
40113
|
+
range: newRanges,
|
|
40107
40114
|
};
|
|
40108
40115
|
const sheetId = this.getters.getFigureSheetId(figureId);
|
|
40109
40116
|
if (!sheetId) {
|
|
@@ -40119,12 +40126,8 @@ class MainChartPanelStore extends SpreadsheetStore {
|
|
|
40119
40126
|
getChartDefinitionFromContextCreation(figureId, newDisplayType) {
|
|
40120
40127
|
const newChartInfo = chartSubtypeRegistry.get(newDisplayType);
|
|
40121
40128
|
const ChartClass = chartRegistry.get(newChartInfo.chartType);
|
|
40122
|
-
const contextCreation = {
|
|
40123
|
-
...this.creationContext,
|
|
40124
|
-
...this.getters.getContextCreationChart(figureId),
|
|
40125
|
-
};
|
|
40126
40129
|
return {
|
|
40127
|
-
...ChartClass.getChartDefinitionFromContextCreation(
|
|
40130
|
+
...ChartClass.getChartDefinitionFromContextCreation(this.creationContexts[figureId]),
|
|
40128
40131
|
...newChartInfo.subtypeDefinition,
|
|
40129
40132
|
};
|
|
40130
40133
|
}
|
|
@@ -54685,10 +54688,20 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
54685
54688
|
for (const sheet of data.sheets) {
|
|
54686
54689
|
sheet.dataValidationRules = [];
|
|
54687
54690
|
for (const rule of this.rules[sheet.id]) {
|
|
54688
|
-
|
|
54689
|
-
...rule,
|
|
54691
|
+
const excelRule = {
|
|
54692
|
+
...deepCopy(rule),
|
|
54690
54693
|
ranges: rule.ranges.map((range) => this.getters.getRangeString(range, sheet.id, { useBoundedReference: true })),
|
|
54691
|
-
}
|
|
54694
|
+
};
|
|
54695
|
+
if (rule.criterion.type === "isValueInRange") {
|
|
54696
|
+
excelRule.criterion.values = rule.criterion.values.map((value) => {
|
|
54697
|
+
const range = this.getters.getRangeFromSheetXC(sheet.id, value);
|
|
54698
|
+
return this.getters.getRangeString(range, sheet.id, {
|
|
54699
|
+
useBoundedReference: true,
|
|
54700
|
+
useFixedReference: true,
|
|
54701
|
+
});
|
|
54702
|
+
});
|
|
54703
|
+
}
|
|
54704
|
+
sheet.dataValidationRules.push(excelRule);
|
|
54692
54705
|
}
|
|
54693
54706
|
}
|
|
54694
54707
|
}
|
|
@@ -56109,9 +56122,10 @@ class RangeAdapter {
|
|
|
56109
56122
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
56110
56123
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
56111
56124
|
* @param options
|
|
56112
|
-
* @param options.useBoundedReference if true, the range will be returned with
|
|
56125
|
+
* @param options.useBoundedReference if true, the range will be returned with bounded row and column
|
|
56126
|
+
* @param options.useFixedReference if true, the range will be returned with fixed row and column
|
|
56113
56127
|
*/
|
|
56114
|
-
getRangeString(range, forSheetId, options = { useBoundedReference: false }) {
|
|
56128
|
+
getRangeString(range, forSheetId, options = { useBoundedReference: false, useFixedReference: false }) {
|
|
56115
56129
|
if (!range) {
|
|
56116
56130
|
return CellErrorType.InvalidReference;
|
|
56117
56131
|
}
|
|
@@ -56214,10 +56228,10 @@ class RangeAdapter {
|
|
|
56214
56228
|
/**
|
|
56215
56229
|
* Get a Xc string that represent a part of a range
|
|
56216
56230
|
*/
|
|
56217
|
-
getRangePartString(range, part, options = { useBoundedReference: false }) {
|
|
56218
|
-
const colFixed = range.parts
|
|
56231
|
+
getRangePartString(range, part, options = { useBoundedReference: false, useFixedReference: false }) {
|
|
56232
|
+
const colFixed = range.parts[part]?.colFixed || options.useFixedReference ? "$" : "";
|
|
56219
56233
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
56220
|
-
const rowFixed = range.parts
|
|
56234
|
+
const rowFixed = range.parts[part]?.rowFixed || options.useFixedReference ? "$" : "";
|
|
56221
56235
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
56222
56236
|
let str = "";
|
|
56223
56237
|
if (range.isFullCol && !options.useBoundedReference) {
|
|
@@ -63403,6 +63417,7 @@ class Session extends EventBus {
|
|
|
63403
63417
|
waitingUndoRedoAck = false;
|
|
63404
63418
|
isReplayingInitialRevisions = false;
|
|
63405
63419
|
processedRevisions = new Set();
|
|
63420
|
+
lastRevisionMessage = undefined;
|
|
63406
63421
|
uuidGenerator = new UuidGenerator();
|
|
63407
63422
|
lastLocalOperation;
|
|
63408
63423
|
/**
|
|
@@ -63503,7 +63518,10 @@ class Session extends EventBus {
|
|
|
63503
63518
|
* Notify the server that the user client left the collaborative session
|
|
63504
63519
|
*/
|
|
63505
63520
|
async leave(data) {
|
|
63506
|
-
if (data &&
|
|
63521
|
+
if (data &&
|
|
63522
|
+
Object.keys(this.clients).length === 1 &&
|
|
63523
|
+
this.lastRevisionMessage &&
|
|
63524
|
+
this.lastRevisionMessage?.type !== "SNAPSHOT_CREATED") {
|
|
63507
63525
|
await this.snapshot(data());
|
|
63508
63526
|
}
|
|
63509
63527
|
delete this.clients[this.clientId];
|
|
@@ -63724,6 +63742,7 @@ class Session extends EventBus {
|
|
|
63724
63742
|
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
63725
63743
|
this.serverRevisionId = message.nextRevisionId;
|
|
63726
63744
|
this.processedRevisions.add(message.nextRevisionId);
|
|
63745
|
+
this.lastRevisionMessage = message;
|
|
63727
63746
|
this.sendPendingMessage();
|
|
63728
63747
|
break;
|
|
63729
63748
|
}
|
|
@@ -75255,6 +75274,6 @@ exports.tokenColors = tokenColors;
|
|
|
75255
75274
|
exports.tokenize = tokenize;
|
|
75256
75275
|
|
|
75257
75276
|
|
|
75258
|
-
__info__.version = "18.2.0-alpha.
|
|
75259
|
-
__info__.date = "2025-01-
|
|
75260
|
-
__info__.hash = "
|
|
75277
|
+
__info__.version = "18.2.0-alpha.4";
|
|
75278
|
+
__info__.date = "2025-01-29T06:30:12.773Z";
|
|
75279
|
+
__info__.hash = "6838c26";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1186,6 +1186,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
|
|
|
1186
1186
|
private waitingUndoRedoAck;
|
|
1187
1187
|
private isReplayingInitialRevisions;
|
|
1188
1188
|
private processedRevisions;
|
|
1189
|
+
private lastRevisionMessage;
|
|
1189
1190
|
private uuidGenerator;
|
|
1190
1191
|
private lastLocalOperation;
|
|
1191
1192
|
/**
|
|
@@ -3985,6 +3986,10 @@ interface SpreadsheetChildEnv extends NotificationStoreMethods {
|
|
|
3985
3986
|
getStore: Get;
|
|
3986
3987
|
}
|
|
3987
3988
|
|
|
3989
|
+
interface RangeStringOptions {
|
|
3990
|
+
useBoundedReference?: boolean;
|
|
3991
|
+
useFixedReference?: boolean;
|
|
3992
|
+
}
|
|
3988
3993
|
declare class RangeAdapter implements CommandHandler<CoreCommand> {
|
|
3989
3994
|
private getters;
|
|
3990
3995
|
private providers;
|
|
@@ -4032,11 +4037,10 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
|
|
|
4032
4037
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
4033
4038
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
4034
4039
|
* @param options
|
|
4035
|
-
* @param options.useBoundedReference if true, the range will be returned with
|
|
4040
|
+
* @param options.useBoundedReference if true, the range will be returned with bounded row and column
|
|
4041
|
+
* @param options.useFixedReference if true, the range will be returned with fixed row and column
|
|
4036
4042
|
*/
|
|
4037
|
-
getRangeString(range: Range, forSheetId: UID, options?:
|
|
4038
|
-
useBoundedReference: boolean;
|
|
4039
|
-
}): string;
|
|
4043
|
+
getRangeString(range: Range, forSheetId: UID, options?: RangeStringOptions): string;
|
|
4040
4044
|
getRangeDataFromXc(sheetId: UID, xc: string): RangeData;
|
|
4041
4045
|
getRangeDataFromZone(sheetId: UID, zone: Zone | UnboundedZone): RangeData;
|
|
4042
4046
|
getRangeFromZone(sheetId: UID, zone: Zone | UnboundedZone): Range;
|
|
@@ -9635,7 +9639,7 @@ declare function useHighlights(highlightProvider: HighlightProvider): void;
|
|
|
9635
9639
|
declare class MainChartPanelStore extends SpreadsheetStore {
|
|
9636
9640
|
mutators: readonly ["activatePanel", "changeChartType"];
|
|
9637
9641
|
panel: "configuration" | "design";
|
|
9638
|
-
private
|
|
9642
|
+
private creationContexts;
|
|
9639
9643
|
activatePanel(panel: "configuration" | "design"): void;
|
|
9640
9644
|
changeChartType(figureId: UID, newDisplayType: string): void;
|
|
9641
9645
|
private getChartDefinitionFromContextCreation;
|
|
@@ -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.2.0-alpha.
|
|
6
|
-
* @date 2025-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.0-alpha.4
|
|
6
|
+
* @date 2025-01-29T06:30:12.773Z
|
|
7
|
+
* @hash 6838c26
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -40094,14 +40094,21 @@ class ChartTypePicker extends Component {
|
|
|
40094
40094
|
class MainChartPanelStore extends SpreadsheetStore {
|
|
40095
40095
|
mutators = ["activatePanel", "changeChartType"];
|
|
40096
40096
|
panel = "configuration";
|
|
40097
|
-
|
|
40097
|
+
creationContexts = {};
|
|
40098
40098
|
activatePanel(panel) {
|
|
40099
40099
|
this.panel = panel;
|
|
40100
40100
|
}
|
|
40101
40101
|
changeChartType(figureId, newDisplayType) {
|
|
40102
|
-
|
|
40103
|
-
|
|
40104
|
-
|
|
40102
|
+
const currentCreationContext = this.getters.getContextCreationChart(figureId);
|
|
40103
|
+
const savedCreationContext = this.creationContexts[figureId] || {};
|
|
40104
|
+
let newRanges = currentCreationContext?.range;
|
|
40105
|
+
if (newRanges?.every((range, i) => deepEquals(range, savedCreationContext.range?.[i]))) {
|
|
40106
|
+
newRanges = Object.assign([], savedCreationContext.range, currentCreationContext?.range);
|
|
40107
|
+
}
|
|
40108
|
+
this.creationContexts[figureId] = {
|
|
40109
|
+
...savedCreationContext,
|
|
40110
|
+
...currentCreationContext,
|
|
40111
|
+
range: newRanges,
|
|
40105
40112
|
};
|
|
40106
40113
|
const sheetId = this.getters.getFigureSheetId(figureId);
|
|
40107
40114
|
if (!sheetId) {
|
|
@@ -40117,12 +40124,8 @@ class MainChartPanelStore extends SpreadsheetStore {
|
|
|
40117
40124
|
getChartDefinitionFromContextCreation(figureId, newDisplayType) {
|
|
40118
40125
|
const newChartInfo = chartSubtypeRegistry.get(newDisplayType);
|
|
40119
40126
|
const ChartClass = chartRegistry.get(newChartInfo.chartType);
|
|
40120
|
-
const contextCreation = {
|
|
40121
|
-
...this.creationContext,
|
|
40122
|
-
...this.getters.getContextCreationChart(figureId),
|
|
40123
|
-
};
|
|
40124
40127
|
return {
|
|
40125
|
-
...ChartClass.getChartDefinitionFromContextCreation(
|
|
40128
|
+
...ChartClass.getChartDefinitionFromContextCreation(this.creationContexts[figureId]),
|
|
40126
40129
|
...newChartInfo.subtypeDefinition,
|
|
40127
40130
|
};
|
|
40128
40131
|
}
|
|
@@ -54683,10 +54686,20 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
54683
54686
|
for (const sheet of data.sheets) {
|
|
54684
54687
|
sheet.dataValidationRules = [];
|
|
54685
54688
|
for (const rule of this.rules[sheet.id]) {
|
|
54686
|
-
|
|
54687
|
-
...rule,
|
|
54689
|
+
const excelRule = {
|
|
54690
|
+
...deepCopy(rule),
|
|
54688
54691
|
ranges: rule.ranges.map((range) => this.getters.getRangeString(range, sheet.id, { useBoundedReference: true })),
|
|
54689
|
-
}
|
|
54692
|
+
};
|
|
54693
|
+
if (rule.criterion.type === "isValueInRange") {
|
|
54694
|
+
excelRule.criterion.values = rule.criterion.values.map((value) => {
|
|
54695
|
+
const range = this.getters.getRangeFromSheetXC(sheet.id, value);
|
|
54696
|
+
return this.getters.getRangeString(range, sheet.id, {
|
|
54697
|
+
useBoundedReference: true,
|
|
54698
|
+
useFixedReference: true,
|
|
54699
|
+
});
|
|
54700
|
+
});
|
|
54701
|
+
}
|
|
54702
|
+
sheet.dataValidationRules.push(excelRule);
|
|
54690
54703
|
}
|
|
54691
54704
|
}
|
|
54692
54705
|
}
|
|
@@ -56107,9 +56120,10 @@ class RangeAdapter {
|
|
|
56107
56120
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
56108
56121
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
56109
56122
|
* @param options
|
|
56110
|
-
* @param options.useBoundedReference if true, the range will be returned with
|
|
56123
|
+
* @param options.useBoundedReference if true, the range will be returned with bounded row and column
|
|
56124
|
+
* @param options.useFixedReference if true, the range will be returned with fixed row and column
|
|
56111
56125
|
*/
|
|
56112
|
-
getRangeString(range, forSheetId, options = { useBoundedReference: false }) {
|
|
56126
|
+
getRangeString(range, forSheetId, options = { useBoundedReference: false, useFixedReference: false }) {
|
|
56113
56127
|
if (!range) {
|
|
56114
56128
|
return CellErrorType.InvalidReference;
|
|
56115
56129
|
}
|
|
@@ -56212,10 +56226,10 @@ class RangeAdapter {
|
|
|
56212
56226
|
/**
|
|
56213
56227
|
* Get a Xc string that represent a part of a range
|
|
56214
56228
|
*/
|
|
56215
|
-
getRangePartString(range, part, options = { useBoundedReference: false }) {
|
|
56216
|
-
const colFixed = range.parts
|
|
56229
|
+
getRangePartString(range, part, options = { useBoundedReference: false, useFixedReference: false }) {
|
|
56230
|
+
const colFixed = range.parts[part]?.colFixed || options.useFixedReference ? "$" : "";
|
|
56217
56231
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
56218
|
-
const rowFixed = range.parts
|
|
56232
|
+
const rowFixed = range.parts[part]?.rowFixed || options.useFixedReference ? "$" : "";
|
|
56219
56233
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
56220
56234
|
let str = "";
|
|
56221
56235
|
if (range.isFullCol && !options.useBoundedReference) {
|
|
@@ -63401,6 +63415,7 @@ class Session extends EventBus {
|
|
|
63401
63415
|
waitingUndoRedoAck = false;
|
|
63402
63416
|
isReplayingInitialRevisions = false;
|
|
63403
63417
|
processedRevisions = new Set();
|
|
63418
|
+
lastRevisionMessage = undefined;
|
|
63404
63419
|
uuidGenerator = new UuidGenerator();
|
|
63405
63420
|
lastLocalOperation;
|
|
63406
63421
|
/**
|
|
@@ -63501,7 +63516,10 @@ class Session extends EventBus {
|
|
|
63501
63516
|
* Notify the server that the user client left the collaborative session
|
|
63502
63517
|
*/
|
|
63503
63518
|
async leave(data) {
|
|
63504
|
-
if (data &&
|
|
63519
|
+
if (data &&
|
|
63520
|
+
Object.keys(this.clients).length === 1 &&
|
|
63521
|
+
this.lastRevisionMessage &&
|
|
63522
|
+
this.lastRevisionMessage?.type !== "SNAPSHOT_CREATED") {
|
|
63505
63523
|
await this.snapshot(data());
|
|
63506
63524
|
}
|
|
63507
63525
|
delete this.clients[this.clientId];
|
|
@@ -63722,6 +63740,7 @@ class Session extends EventBus {
|
|
|
63722
63740
|
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
63723
63741
|
this.serverRevisionId = message.nextRevisionId;
|
|
63724
63742
|
this.processedRevisions.add(message.nextRevisionId);
|
|
63743
|
+
this.lastRevisionMessage = message;
|
|
63725
63744
|
this.sendPendingMessage();
|
|
63726
63745
|
break;
|
|
63727
63746
|
}
|
|
@@ -75208,6 +75227,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
75208
75227
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, 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 };
|
|
75209
75228
|
|
|
75210
75229
|
|
|
75211
|
-
__info__.version = "18.2.0-alpha.
|
|
75212
|
-
__info__.date = "2025-01-
|
|
75213
|
-
__info__.hash = "
|
|
75230
|
+
__info__.version = "18.2.0-alpha.4";
|
|
75231
|
+
__info__.date = "2025-01-29T06:30:12.773Z";
|
|
75232
|
+
__info__.hash = "6838c26";
|
|
@@ -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.2.0-alpha.
|
|
6
|
-
* @date 2025-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.0-alpha.4
|
|
6
|
+
* @date 2025-01-29T06:30:12.773Z
|
|
7
|
+
* @hash 6838c26
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -40095,14 +40095,21 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40095
40095
|
class MainChartPanelStore extends SpreadsheetStore {
|
|
40096
40096
|
mutators = ["activatePanel", "changeChartType"];
|
|
40097
40097
|
panel = "configuration";
|
|
40098
|
-
|
|
40098
|
+
creationContexts = {};
|
|
40099
40099
|
activatePanel(panel) {
|
|
40100
40100
|
this.panel = panel;
|
|
40101
40101
|
}
|
|
40102
40102
|
changeChartType(figureId, newDisplayType) {
|
|
40103
|
-
|
|
40104
|
-
|
|
40105
|
-
|
|
40103
|
+
const currentCreationContext = this.getters.getContextCreationChart(figureId);
|
|
40104
|
+
const savedCreationContext = this.creationContexts[figureId] || {};
|
|
40105
|
+
let newRanges = currentCreationContext?.range;
|
|
40106
|
+
if (newRanges?.every((range, i) => deepEquals(range, savedCreationContext.range?.[i]))) {
|
|
40107
|
+
newRanges = Object.assign([], savedCreationContext.range, currentCreationContext?.range);
|
|
40108
|
+
}
|
|
40109
|
+
this.creationContexts[figureId] = {
|
|
40110
|
+
...savedCreationContext,
|
|
40111
|
+
...currentCreationContext,
|
|
40112
|
+
range: newRanges,
|
|
40106
40113
|
};
|
|
40107
40114
|
const sheetId = this.getters.getFigureSheetId(figureId);
|
|
40108
40115
|
if (!sheetId) {
|
|
@@ -40118,12 +40125,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40118
40125
|
getChartDefinitionFromContextCreation(figureId, newDisplayType) {
|
|
40119
40126
|
const newChartInfo = chartSubtypeRegistry.get(newDisplayType);
|
|
40120
40127
|
const ChartClass = chartRegistry.get(newChartInfo.chartType);
|
|
40121
|
-
const contextCreation = {
|
|
40122
|
-
...this.creationContext,
|
|
40123
|
-
...this.getters.getContextCreationChart(figureId),
|
|
40124
|
-
};
|
|
40125
40128
|
return {
|
|
40126
|
-
...ChartClass.getChartDefinitionFromContextCreation(
|
|
40129
|
+
...ChartClass.getChartDefinitionFromContextCreation(this.creationContexts[figureId]),
|
|
40127
40130
|
...newChartInfo.subtypeDefinition,
|
|
40128
40131
|
};
|
|
40129
40132
|
}
|
|
@@ -54684,10 +54687,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54684
54687
|
for (const sheet of data.sheets) {
|
|
54685
54688
|
sheet.dataValidationRules = [];
|
|
54686
54689
|
for (const rule of this.rules[sheet.id]) {
|
|
54687
|
-
|
|
54688
|
-
...rule,
|
|
54690
|
+
const excelRule = {
|
|
54691
|
+
...deepCopy(rule),
|
|
54689
54692
|
ranges: rule.ranges.map((range) => this.getters.getRangeString(range, sheet.id, { useBoundedReference: true })),
|
|
54690
|
-
}
|
|
54693
|
+
};
|
|
54694
|
+
if (rule.criterion.type === "isValueInRange") {
|
|
54695
|
+
excelRule.criterion.values = rule.criterion.values.map((value) => {
|
|
54696
|
+
const range = this.getters.getRangeFromSheetXC(sheet.id, value);
|
|
54697
|
+
return this.getters.getRangeString(range, sheet.id, {
|
|
54698
|
+
useBoundedReference: true,
|
|
54699
|
+
useFixedReference: true,
|
|
54700
|
+
});
|
|
54701
|
+
});
|
|
54702
|
+
}
|
|
54703
|
+
sheet.dataValidationRules.push(excelRule);
|
|
54691
54704
|
}
|
|
54692
54705
|
}
|
|
54693
54706
|
}
|
|
@@ -56108,9 +56121,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56108
56121
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
56109
56122
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
56110
56123
|
* @param options
|
|
56111
|
-
* @param options.useBoundedReference if true, the range will be returned with
|
|
56124
|
+
* @param options.useBoundedReference if true, the range will be returned with bounded row and column
|
|
56125
|
+
* @param options.useFixedReference if true, the range will be returned with fixed row and column
|
|
56112
56126
|
*/
|
|
56113
|
-
getRangeString(range, forSheetId, options = { useBoundedReference: false }) {
|
|
56127
|
+
getRangeString(range, forSheetId, options = { useBoundedReference: false, useFixedReference: false }) {
|
|
56114
56128
|
if (!range) {
|
|
56115
56129
|
return CellErrorType.InvalidReference;
|
|
56116
56130
|
}
|
|
@@ -56213,10 +56227,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56213
56227
|
/**
|
|
56214
56228
|
* Get a Xc string that represent a part of a range
|
|
56215
56229
|
*/
|
|
56216
|
-
getRangePartString(range, part, options = { useBoundedReference: false }) {
|
|
56217
|
-
const colFixed = range.parts
|
|
56230
|
+
getRangePartString(range, part, options = { useBoundedReference: false, useFixedReference: false }) {
|
|
56231
|
+
const colFixed = range.parts[part]?.colFixed || options.useFixedReference ? "$" : "";
|
|
56218
56232
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
56219
|
-
const rowFixed = range.parts
|
|
56233
|
+
const rowFixed = range.parts[part]?.rowFixed || options.useFixedReference ? "$" : "";
|
|
56220
56234
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
56221
56235
|
let str = "";
|
|
56222
56236
|
if (range.isFullCol && !options.useBoundedReference) {
|
|
@@ -63402,6 +63416,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63402
63416
|
waitingUndoRedoAck = false;
|
|
63403
63417
|
isReplayingInitialRevisions = false;
|
|
63404
63418
|
processedRevisions = new Set();
|
|
63419
|
+
lastRevisionMessage = undefined;
|
|
63405
63420
|
uuidGenerator = new UuidGenerator();
|
|
63406
63421
|
lastLocalOperation;
|
|
63407
63422
|
/**
|
|
@@ -63502,7 +63517,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63502
63517
|
* Notify the server that the user client left the collaborative session
|
|
63503
63518
|
*/
|
|
63504
63519
|
async leave(data) {
|
|
63505
|
-
if (data &&
|
|
63520
|
+
if (data &&
|
|
63521
|
+
Object.keys(this.clients).length === 1 &&
|
|
63522
|
+
this.lastRevisionMessage &&
|
|
63523
|
+
this.lastRevisionMessage?.type !== "SNAPSHOT_CREATED") {
|
|
63506
63524
|
await this.snapshot(data());
|
|
63507
63525
|
}
|
|
63508
63526
|
delete this.clients[this.clientId];
|
|
@@ -63723,6 +63741,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63723
63741
|
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
63724
63742
|
this.serverRevisionId = message.nextRevisionId;
|
|
63725
63743
|
this.processedRevisions.add(message.nextRevisionId);
|
|
63744
|
+
this.lastRevisionMessage = message;
|
|
63726
63745
|
this.sendPendingMessage();
|
|
63727
63746
|
break;
|
|
63728
63747
|
}
|
|
@@ -75254,9 +75273,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75254
75273
|
exports.tokenize = tokenize;
|
|
75255
75274
|
|
|
75256
75275
|
|
|
75257
|
-
__info__.version = "18.2.0-alpha.
|
|
75258
|
-
__info__.date = "2025-01-
|
|
75259
|
-
__info__.hash = "
|
|
75276
|
+
__info__.version = "18.2.0-alpha.4";
|
|
75277
|
+
__info__.date = "2025-01-29T06:30:12.773Z";
|
|
75278
|
+
__info__.hash = "6838c26";
|
|
75260
75279
|
|
|
75261
75280
|
|
|
75262
75281
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|