@odoo/o-spreadsheet 18.0.33 → 18.0.35
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 +129 -72
- package/dist/o-spreadsheet.d.ts +8 -8
- package/dist/o-spreadsheet.esm.js +129 -72
- package/dist/o-spreadsheet.iife.js +129 -72
- package/dist/o-spreadsheet.iife.min.js +169 -169
- package/dist/o_spreadsheet.xml +3 -3
- 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-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.35
|
|
6
|
+
* @date 2025-06-23T15:06:32.032Z
|
|
7
|
+
* @hash a38db25
|
|
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';
|
|
@@ -6661,6 +6661,63 @@ function parseOSClipboardContent(content) {
|
|
|
6661
6661
|
data: spreadsheetContent,
|
|
6662
6662
|
};
|
|
6663
6663
|
}
|
|
6664
|
+
/**
|
|
6665
|
+
* Applies each clipboard handler to paste its corresponding data into the target.
|
|
6666
|
+
*/
|
|
6667
|
+
const applyClipboardHandlersPaste = (handlers, copiedData, target, options) => {
|
|
6668
|
+
handlers.forEach(({ handlerName, handler }) => {
|
|
6669
|
+
const data = copiedData[handlerName];
|
|
6670
|
+
if (data) {
|
|
6671
|
+
handler.paste(target, data, options);
|
|
6672
|
+
}
|
|
6673
|
+
});
|
|
6674
|
+
};
|
|
6675
|
+
/**
|
|
6676
|
+
* Returns the paste target based on clipboard handlers.
|
|
6677
|
+
* Also includes the full affected zone and the list of pasted zones for selection.
|
|
6678
|
+
*/
|
|
6679
|
+
function getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options) {
|
|
6680
|
+
let zone = undefined;
|
|
6681
|
+
let selectedZones = [];
|
|
6682
|
+
let target = {
|
|
6683
|
+
sheetId,
|
|
6684
|
+
zones,
|
|
6685
|
+
};
|
|
6686
|
+
for (const { handlerName, handler } of handlers) {
|
|
6687
|
+
const handlerData = copiedData[handlerName];
|
|
6688
|
+
if (!handlerData) {
|
|
6689
|
+
continue;
|
|
6690
|
+
}
|
|
6691
|
+
const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
|
|
6692
|
+
if (currentTarget.figureId) {
|
|
6693
|
+
target.figureId = currentTarget.figureId;
|
|
6694
|
+
}
|
|
6695
|
+
for (const targetZone of currentTarget.zones) {
|
|
6696
|
+
selectedZones.push(targetZone);
|
|
6697
|
+
if (zone === undefined) {
|
|
6698
|
+
zone = targetZone;
|
|
6699
|
+
continue;
|
|
6700
|
+
}
|
|
6701
|
+
zone = union(zone, targetZone);
|
|
6702
|
+
}
|
|
6703
|
+
}
|
|
6704
|
+
return {
|
|
6705
|
+
target,
|
|
6706
|
+
zone,
|
|
6707
|
+
selectedZones,
|
|
6708
|
+
};
|
|
6709
|
+
}
|
|
6710
|
+
/**
|
|
6711
|
+
* Updates the selection after a paste operation.
|
|
6712
|
+
*/
|
|
6713
|
+
const selectPastedZone = (selection, sourceZones, pastedZones) => {
|
|
6714
|
+
const anchorCell = {
|
|
6715
|
+
col: sourceZones[0].left,
|
|
6716
|
+
row: sourceZones[0].top,
|
|
6717
|
+
};
|
|
6718
|
+
selection.getBackToDefault();
|
|
6719
|
+
selection.selectZone({ cell: anchorCell, zone: union(...pastedZones) }, { scrollIntoView: false });
|
|
6720
|
+
};
|
|
6664
6721
|
|
|
6665
6722
|
class ClipboardHandler {
|
|
6666
6723
|
getters;
|
|
@@ -33668,6 +33725,10 @@ const REMOVE_ROWS_ACTION = (env) => {
|
|
|
33668
33725
|
});
|
|
33669
33726
|
};
|
|
33670
33727
|
const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
|
|
33728
|
+
if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
|
|
33729
|
+
(dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
|
|
33730
|
+
return false;
|
|
33731
|
+
}
|
|
33671
33732
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
33672
33733
|
const selectedElements = env.model.getters.getElementsFromSelection(dimension);
|
|
33673
33734
|
const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
|
|
@@ -36388,11 +36449,11 @@ class OTRegistry extends Registry {
|
|
|
36388
36449
|
* transformation function given
|
|
36389
36450
|
*/
|
|
36390
36451
|
addTransformation(executed, toTransforms, fn) {
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
this.content[
|
|
36452
|
+
if (!this.content[executed]) {
|
|
36453
|
+
this.content[executed] = new Map();
|
|
36454
|
+
}
|
|
36455
|
+
for (const toTransform of toTransforms) {
|
|
36456
|
+
this.content[executed].set(toTransform, fn);
|
|
36396
36457
|
}
|
|
36397
36458
|
return this;
|
|
36398
36459
|
}
|
|
@@ -36401,7 +36462,7 @@ class OTRegistry extends Registry {
|
|
|
36401
36462
|
* that the executed command happened.
|
|
36402
36463
|
*/
|
|
36403
36464
|
getTransformation(toTransform, executed) {
|
|
36404
|
-
return this.content[
|
|
36465
|
+
return this.content[executed] && this.content[executed].get(toTransform);
|
|
36405
36466
|
}
|
|
36406
36467
|
}
|
|
36407
36468
|
const otRegistry = new OTRegistry();
|
|
@@ -44610,7 +44671,7 @@ class SpreadsheetPivot {
|
|
|
44610
44671
|
}
|
|
44611
44672
|
getTypeFromZone(sheetId, zone) {
|
|
44612
44673
|
const cells = this.getters.getEvaluatedCellsInZone(sheetId, zone);
|
|
44613
|
-
const nonEmptyCells = cells.filter((cell) => cell.type
|
|
44674
|
+
const nonEmptyCells = cells.filter((cell) => !(cell.type === CellValueType.empty || cell.value === ""));
|
|
44614
44675
|
if (nonEmptyCells.length === 0) {
|
|
44615
44676
|
return "integer";
|
|
44616
44677
|
}
|
|
@@ -48143,15 +48204,16 @@ class GridAddRowsFooter extends Component {
|
|
|
48143
48204
|
}
|
|
48144
48205
|
}
|
|
48145
48206
|
|
|
48207
|
+
const PAINT_FORMAT_HANDLER_KEYS = [
|
|
48208
|
+
"cell",
|
|
48209
|
+
"border",
|
|
48210
|
+
"table",
|
|
48211
|
+
"conditionalFormat",
|
|
48212
|
+
"merge",
|
|
48213
|
+
];
|
|
48146
48214
|
class PaintFormatStore extends SpreadsheetStore {
|
|
48147
48215
|
mutators = ["activate", "cancel", "pasteFormat"];
|
|
48148
48216
|
highlightStore = this.get(HighlightStore);
|
|
48149
|
-
clipboardHandlers = [
|
|
48150
|
-
new CellClipboardHandler(this.getters, this.model.dispatch),
|
|
48151
|
-
new BorderClipboardHandler(this.getters, this.model.dispatch),
|
|
48152
|
-
new TableClipboardHandler(this.getters, this.model.dispatch),
|
|
48153
|
-
new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
|
|
48154
|
-
];
|
|
48155
48217
|
status = "inactive";
|
|
48156
48218
|
copiedData;
|
|
48157
48219
|
constructor(get) {
|
|
@@ -48182,24 +48244,38 @@ class PaintFormatStore extends SpreadsheetStore {
|
|
|
48182
48244
|
get isActive() {
|
|
48183
48245
|
return this.status !== "inactive";
|
|
48184
48246
|
}
|
|
48247
|
+
get clipboardHandlers() {
|
|
48248
|
+
return PAINT_FORMAT_HANDLER_KEYS.map((handlerName) => {
|
|
48249
|
+
const HandlerClass = clipboardHandlersRegistries.cellHandlers.get(handlerName);
|
|
48250
|
+
return {
|
|
48251
|
+
handlerName,
|
|
48252
|
+
handler: new HandlerClass(this.getters, this.model.dispatch),
|
|
48253
|
+
};
|
|
48254
|
+
});
|
|
48255
|
+
}
|
|
48185
48256
|
copyFormats() {
|
|
48186
48257
|
const sheetId = this.getters.getActiveSheetId();
|
|
48187
48258
|
const zones = this.getters.getSelectedZones();
|
|
48188
|
-
const copiedData = {};
|
|
48189
|
-
for (const handler of this.clipboardHandlers) {
|
|
48190
|
-
|
|
48259
|
+
const copiedData = { zones, sheetId };
|
|
48260
|
+
for (const { handlerName, handler } of this.clipboardHandlers) {
|
|
48261
|
+
const handlerResult = handler.copy(getClipboardDataPositions(sheetId, zones));
|
|
48262
|
+
if (handlerResult !== undefined) {
|
|
48263
|
+
copiedData[handlerName] = handlerResult;
|
|
48264
|
+
}
|
|
48191
48265
|
}
|
|
48192
48266
|
return copiedData;
|
|
48193
48267
|
}
|
|
48194
48268
|
paintFormat(sheetId, target) {
|
|
48195
|
-
if (this.copiedData) {
|
|
48196
|
-
|
|
48197
|
-
handler.paste({ zones: target, sheetId }, this.copiedData, {
|
|
48198
|
-
isCutOperation: false,
|
|
48199
|
-
pasteOption: "onlyFormat",
|
|
48200
|
-
});
|
|
48201
|
-
}
|
|
48269
|
+
if (!this.copiedData) {
|
|
48270
|
+
return;
|
|
48202
48271
|
}
|
|
48272
|
+
const options = {
|
|
48273
|
+
isCutOperation: false,
|
|
48274
|
+
pasteOption: "onlyFormat",
|
|
48275
|
+
};
|
|
48276
|
+
const { target: pasteTarget, selectedZones } = getPasteTargetFromHandlers(sheetId, target, this.copiedData, this.clipboardHandlers, options);
|
|
48277
|
+
applyClipboardHandlersPaste(this.clipboardHandlers, this.copiedData, pasteTarget, options);
|
|
48278
|
+
selectPastedZone(this.model.selection, target, selectedZones);
|
|
48203
48279
|
if (this.status === "oneOff") {
|
|
48204
48280
|
this.cancel();
|
|
48205
48281
|
}
|
|
@@ -53457,7 +53533,7 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
53457
53533
|
else if (newRule.criterion.type === "isValueInList") {
|
|
53458
53534
|
newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
|
|
53459
53535
|
}
|
|
53460
|
-
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
|
|
53536
|
+
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
|
|
53461
53537
|
const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
|
|
53462
53538
|
if (ruleIndex !== -1) {
|
|
53463
53539
|
adaptedRules[ruleIndex] = newRule;
|
|
@@ -53467,9 +53543,12 @@ class DataValidationPlugin extends CorePlugin {
|
|
|
53467
53543
|
this.history.update("rules", sheetId, [...adaptedRules, newRule]);
|
|
53468
53544
|
}
|
|
53469
53545
|
}
|
|
53470
|
-
removeRangesFromRules(sheetId, ranges, rules) {
|
|
53546
|
+
removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
|
|
53471
53547
|
rules = deepCopy(rules);
|
|
53472
53548
|
for (const rule of rules) {
|
|
53549
|
+
if (rule.id === editingRuleId) {
|
|
53550
|
+
continue; // Skip the rule being edited to preserve its place in the list
|
|
53551
|
+
}
|
|
53473
53552
|
rule.ranges = this.getters.recomputeRanges(rule.ranges, ranges);
|
|
53474
53553
|
}
|
|
53475
53554
|
return rules.filter((rule) => rule.ranges.length > 0);
|
|
@@ -62200,10 +62279,20 @@ function transform(toTransform, executed) {
|
|
|
62200
62279
|
*/
|
|
62201
62280
|
function transformAll(toTransform, executed) {
|
|
62202
62281
|
let transformedCommands = [...toTransform];
|
|
62282
|
+
const possibleTransformations = new Set(otRegistry.getKeys());
|
|
62203
62283
|
for (const executedCommand of executed) {
|
|
62204
|
-
|
|
62205
|
-
|
|
62206
|
-
|
|
62284
|
+
// If the executed command is not in the registry, we skip it
|
|
62285
|
+
// because we know there won't be any transformation impacting the
|
|
62286
|
+
// commands to transform.
|
|
62287
|
+
if (possibleTransformations.has(executedCommand.type)) {
|
|
62288
|
+
transformedCommands = transformedCommands.reduce((acc, cmd) => {
|
|
62289
|
+
const transformed = transform(cmd, executedCommand);
|
|
62290
|
+
if (transformed) {
|
|
62291
|
+
acc.push(transformed);
|
|
62292
|
+
}
|
|
62293
|
+
return acc;
|
|
62294
|
+
}, []);
|
|
62295
|
+
}
|
|
62207
62296
|
}
|
|
62208
62297
|
return transformedCommands;
|
|
62209
62298
|
}
|
|
@@ -62689,7 +62778,6 @@ class Session extends EventBus {
|
|
|
62689
62778
|
if (this.waitingAck) {
|
|
62690
62779
|
return;
|
|
62691
62780
|
}
|
|
62692
|
-
this.waitingAck = true;
|
|
62693
62781
|
this.sendPendingMessage();
|
|
62694
62782
|
}
|
|
62695
62783
|
/**
|
|
@@ -62719,6 +62807,7 @@ class Session extends EventBus {
|
|
|
62719
62807
|
throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
|
|
62720
62808
|
${JSON.stringify(message)}`);
|
|
62721
62809
|
}
|
|
62810
|
+
this.waitingAck = true;
|
|
62722
62811
|
this.transportService.sendMessage({
|
|
62723
62812
|
...message,
|
|
62724
62813
|
serverRevisionId: this.serverRevisionId,
|
|
@@ -63859,7 +63948,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
63859
63948
|
}
|
|
63860
63949
|
const position = this.getters.getCellPosition(cell.id);
|
|
63861
63950
|
const colSize = this.getters.getColSize(sheetId, position.col);
|
|
63862
|
-
if (cell.isFormula) {
|
|
63951
|
+
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
63863
63952
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
63864
63953
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
63865
63954
|
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
|
|
@@ -65144,49 +65233,17 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
65144
65233
|
if (!copiedData) {
|
|
65145
65234
|
return;
|
|
65146
65235
|
}
|
|
65147
|
-
let zone = undefined;
|
|
65148
|
-
let selectedZones = [];
|
|
65149
65236
|
const sheetId = this.getters.getActiveSheetId();
|
|
65150
|
-
let target = {
|
|
65151
|
-
sheetId,
|
|
65152
|
-
zones,
|
|
65153
|
-
};
|
|
65154
65237
|
const handlers = this.selectClipboardHandlers(copiedData);
|
|
65155
|
-
|
|
65156
|
-
const handlerData = copiedData[handlerName];
|
|
65157
|
-
if (!handlerData) {
|
|
65158
|
-
continue;
|
|
65159
|
-
}
|
|
65160
|
-
const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
|
|
65161
|
-
if (currentTarget.figureId) {
|
|
65162
|
-
target.figureId = currentTarget.figureId;
|
|
65163
|
-
}
|
|
65164
|
-
for (const targetZone of currentTarget.zones) {
|
|
65165
|
-
selectedZones.push(targetZone);
|
|
65166
|
-
if (zone === undefined) {
|
|
65167
|
-
zone = targetZone;
|
|
65168
|
-
continue;
|
|
65169
|
-
}
|
|
65170
|
-
zone = union(zone, targetZone);
|
|
65171
|
-
}
|
|
65172
|
-
}
|
|
65238
|
+
const { target, zone, selectedZones } = getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options);
|
|
65173
65239
|
if (zone !== undefined) {
|
|
65174
|
-
this.addMissingDimensions(
|
|
65240
|
+
this.addMissingDimensions(sheetId, zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
|
|
65175
65241
|
}
|
|
65176
|
-
handlers
|
|
65177
|
-
const handlerData = copiedData[handlerName];
|
|
65178
|
-
if (handlerData) {
|
|
65179
|
-
handler.paste(target, handlerData, options);
|
|
65180
|
-
}
|
|
65181
|
-
});
|
|
65242
|
+
applyClipboardHandlersPaste(handlers, copiedData, target, options);
|
|
65182
65243
|
if (!options?.selectTarget) {
|
|
65183
65244
|
return;
|
|
65184
65245
|
}
|
|
65185
|
-
|
|
65186
|
-
const col = selection.left;
|
|
65187
|
-
const row = selection.top;
|
|
65188
|
-
this.selection.getBackToDefault();
|
|
65189
|
-
this.selection.selectZone({ cell: { col, row }, zone: union(...selectedZones) }, { scrollIntoView: false });
|
|
65246
|
+
selectPastedZone(this.selection, zones, selectedZones);
|
|
65190
65247
|
}
|
|
65191
65248
|
/**
|
|
65192
65249
|
* Add columns and/or rows to ensure that col + width and row + height are still
|
|
@@ -74402,6 +74459,6 @@ const constants = {
|
|
|
74402
74459
|
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 };
|
|
74403
74460
|
|
|
74404
74461
|
|
|
74405
|
-
__info__.version = "18.0.
|
|
74406
|
-
__info__.date = "2025-06-
|
|
74407
|
-
__info__.hash = "
|
|
74462
|
+
__info__.version = "18.0.35";
|
|
74463
|
+
__info__.date = "2025-06-23T15:06:32.032Z";
|
|
74464
|
+
__info__.hash = "a38db25";
|
|
@@ -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-06-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.35
|
|
6
|
+
* @date 2025-06-23T15:06:32.032Z
|
|
7
|
+
* @hash a38db25
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -6662,6 +6662,63 @@
|
|
|
6662
6662
|
data: spreadsheetContent,
|
|
6663
6663
|
};
|
|
6664
6664
|
}
|
|
6665
|
+
/**
|
|
6666
|
+
* Applies each clipboard handler to paste its corresponding data into the target.
|
|
6667
|
+
*/
|
|
6668
|
+
const applyClipboardHandlersPaste = (handlers, copiedData, target, options) => {
|
|
6669
|
+
handlers.forEach(({ handlerName, handler }) => {
|
|
6670
|
+
const data = copiedData[handlerName];
|
|
6671
|
+
if (data) {
|
|
6672
|
+
handler.paste(target, data, options);
|
|
6673
|
+
}
|
|
6674
|
+
});
|
|
6675
|
+
};
|
|
6676
|
+
/**
|
|
6677
|
+
* Returns the paste target based on clipboard handlers.
|
|
6678
|
+
* Also includes the full affected zone and the list of pasted zones for selection.
|
|
6679
|
+
*/
|
|
6680
|
+
function getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options) {
|
|
6681
|
+
let zone = undefined;
|
|
6682
|
+
let selectedZones = [];
|
|
6683
|
+
let target = {
|
|
6684
|
+
sheetId,
|
|
6685
|
+
zones,
|
|
6686
|
+
};
|
|
6687
|
+
for (const { handlerName, handler } of handlers) {
|
|
6688
|
+
const handlerData = copiedData[handlerName];
|
|
6689
|
+
if (!handlerData) {
|
|
6690
|
+
continue;
|
|
6691
|
+
}
|
|
6692
|
+
const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
|
|
6693
|
+
if (currentTarget.figureId) {
|
|
6694
|
+
target.figureId = currentTarget.figureId;
|
|
6695
|
+
}
|
|
6696
|
+
for (const targetZone of currentTarget.zones) {
|
|
6697
|
+
selectedZones.push(targetZone);
|
|
6698
|
+
if (zone === undefined) {
|
|
6699
|
+
zone = targetZone;
|
|
6700
|
+
continue;
|
|
6701
|
+
}
|
|
6702
|
+
zone = union(zone, targetZone);
|
|
6703
|
+
}
|
|
6704
|
+
}
|
|
6705
|
+
return {
|
|
6706
|
+
target,
|
|
6707
|
+
zone,
|
|
6708
|
+
selectedZones,
|
|
6709
|
+
};
|
|
6710
|
+
}
|
|
6711
|
+
/**
|
|
6712
|
+
* Updates the selection after a paste operation.
|
|
6713
|
+
*/
|
|
6714
|
+
const selectPastedZone = (selection, sourceZones, pastedZones) => {
|
|
6715
|
+
const anchorCell = {
|
|
6716
|
+
col: sourceZones[0].left,
|
|
6717
|
+
row: sourceZones[0].top,
|
|
6718
|
+
};
|
|
6719
|
+
selection.getBackToDefault();
|
|
6720
|
+
selection.selectZone({ cell: anchorCell, zone: union(...pastedZones) }, { scrollIntoView: false });
|
|
6721
|
+
};
|
|
6665
6722
|
|
|
6666
6723
|
class ClipboardHandler {
|
|
6667
6724
|
getters;
|
|
@@ -33669,6 +33726,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33669
33726
|
});
|
|
33670
33727
|
};
|
|
33671
33728
|
const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
|
|
33729
|
+
if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
|
|
33730
|
+
(dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
|
|
33731
|
+
return false;
|
|
33732
|
+
}
|
|
33672
33733
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
33673
33734
|
const selectedElements = env.model.getters.getElementsFromSelection(dimension);
|
|
33674
33735
|
const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
|
|
@@ -36389,11 +36450,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
36389
36450
|
* transformation function given
|
|
36390
36451
|
*/
|
|
36391
36452
|
addTransformation(executed, toTransforms, fn) {
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
this.content[
|
|
36453
|
+
if (!this.content[executed]) {
|
|
36454
|
+
this.content[executed] = new Map();
|
|
36455
|
+
}
|
|
36456
|
+
for (const toTransform of toTransforms) {
|
|
36457
|
+
this.content[executed].set(toTransform, fn);
|
|
36397
36458
|
}
|
|
36398
36459
|
return this;
|
|
36399
36460
|
}
|
|
@@ -36402,7 +36463,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
36402
36463
|
* that the executed command happened.
|
|
36403
36464
|
*/
|
|
36404
36465
|
getTransformation(toTransform, executed) {
|
|
36405
|
-
return this.content[
|
|
36466
|
+
return this.content[executed] && this.content[executed].get(toTransform);
|
|
36406
36467
|
}
|
|
36407
36468
|
}
|
|
36408
36469
|
const otRegistry = new OTRegistry();
|
|
@@ -44611,7 +44672,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44611
44672
|
}
|
|
44612
44673
|
getTypeFromZone(sheetId, zone) {
|
|
44613
44674
|
const cells = this.getters.getEvaluatedCellsInZone(sheetId, zone);
|
|
44614
|
-
const nonEmptyCells = cells.filter((cell) => cell.type
|
|
44675
|
+
const nonEmptyCells = cells.filter((cell) => !(cell.type === CellValueType.empty || cell.value === ""));
|
|
44615
44676
|
if (nonEmptyCells.length === 0) {
|
|
44616
44677
|
return "integer";
|
|
44617
44678
|
}
|
|
@@ -48144,15 +48205,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48144
48205
|
}
|
|
48145
48206
|
}
|
|
48146
48207
|
|
|
48208
|
+
const PAINT_FORMAT_HANDLER_KEYS = [
|
|
48209
|
+
"cell",
|
|
48210
|
+
"border",
|
|
48211
|
+
"table",
|
|
48212
|
+
"conditionalFormat",
|
|
48213
|
+
"merge",
|
|
48214
|
+
];
|
|
48147
48215
|
class PaintFormatStore extends SpreadsheetStore {
|
|
48148
48216
|
mutators = ["activate", "cancel", "pasteFormat"];
|
|
48149
48217
|
highlightStore = this.get(HighlightStore);
|
|
48150
|
-
clipboardHandlers = [
|
|
48151
|
-
new CellClipboardHandler(this.getters, this.model.dispatch),
|
|
48152
|
-
new BorderClipboardHandler(this.getters, this.model.dispatch),
|
|
48153
|
-
new TableClipboardHandler(this.getters, this.model.dispatch),
|
|
48154
|
-
new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
|
|
48155
|
-
];
|
|
48156
48218
|
status = "inactive";
|
|
48157
48219
|
copiedData;
|
|
48158
48220
|
constructor(get) {
|
|
@@ -48183,24 +48245,38 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48183
48245
|
get isActive() {
|
|
48184
48246
|
return this.status !== "inactive";
|
|
48185
48247
|
}
|
|
48248
|
+
get clipboardHandlers() {
|
|
48249
|
+
return PAINT_FORMAT_HANDLER_KEYS.map((handlerName) => {
|
|
48250
|
+
const HandlerClass = clipboardHandlersRegistries.cellHandlers.get(handlerName);
|
|
48251
|
+
return {
|
|
48252
|
+
handlerName,
|
|
48253
|
+
handler: new HandlerClass(this.getters, this.model.dispatch),
|
|
48254
|
+
};
|
|
48255
|
+
});
|
|
48256
|
+
}
|
|
48186
48257
|
copyFormats() {
|
|
48187
48258
|
const sheetId = this.getters.getActiveSheetId();
|
|
48188
48259
|
const zones = this.getters.getSelectedZones();
|
|
48189
|
-
const copiedData = {};
|
|
48190
|
-
for (const handler of this.clipboardHandlers) {
|
|
48191
|
-
|
|
48260
|
+
const copiedData = { zones, sheetId };
|
|
48261
|
+
for (const { handlerName, handler } of this.clipboardHandlers) {
|
|
48262
|
+
const handlerResult = handler.copy(getClipboardDataPositions(sheetId, zones));
|
|
48263
|
+
if (handlerResult !== undefined) {
|
|
48264
|
+
copiedData[handlerName] = handlerResult;
|
|
48265
|
+
}
|
|
48192
48266
|
}
|
|
48193
48267
|
return copiedData;
|
|
48194
48268
|
}
|
|
48195
48269
|
paintFormat(sheetId, target) {
|
|
48196
|
-
if (this.copiedData) {
|
|
48197
|
-
|
|
48198
|
-
handler.paste({ zones: target, sheetId }, this.copiedData, {
|
|
48199
|
-
isCutOperation: false,
|
|
48200
|
-
pasteOption: "onlyFormat",
|
|
48201
|
-
});
|
|
48202
|
-
}
|
|
48270
|
+
if (!this.copiedData) {
|
|
48271
|
+
return;
|
|
48203
48272
|
}
|
|
48273
|
+
const options = {
|
|
48274
|
+
isCutOperation: false,
|
|
48275
|
+
pasteOption: "onlyFormat",
|
|
48276
|
+
};
|
|
48277
|
+
const { target: pasteTarget, selectedZones } = getPasteTargetFromHandlers(sheetId, target, this.copiedData, this.clipboardHandlers, options);
|
|
48278
|
+
applyClipboardHandlersPaste(this.clipboardHandlers, this.copiedData, pasteTarget, options);
|
|
48279
|
+
selectPastedZone(this.model.selection, target, selectedZones);
|
|
48204
48280
|
if (this.status === "oneOff") {
|
|
48205
48281
|
this.cancel();
|
|
48206
48282
|
}
|
|
@@ -53458,7 +53534,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53458
53534
|
else if (newRule.criterion.type === "isValueInList") {
|
|
53459
53535
|
newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
|
|
53460
53536
|
}
|
|
53461
|
-
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
|
|
53537
|
+
const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
|
|
53462
53538
|
const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
|
|
53463
53539
|
if (ruleIndex !== -1) {
|
|
53464
53540
|
adaptedRules[ruleIndex] = newRule;
|
|
@@ -53468,9 +53544,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53468
53544
|
this.history.update("rules", sheetId, [...adaptedRules, newRule]);
|
|
53469
53545
|
}
|
|
53470
53546
|
}
|
|
53471
|
-
removeRangesFromRules(sheetId, ranges, rules) {
|
|
53547
|
+
removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
|
|
53472
53548
|
rules = deepCopy(rules);
|
|
53473
53549
|
for (const rule of rules) {
|
|
53550
|
+
if (rule.id === editingRuleId) {
|
|
53551
|
+
continue; // Skip the rule being edited to preserve its place in the list
|
|
53552
|
+
}
|
|
53474
53553
|
rule.ranges = this.getters.recomputeRanges(rule.ranges, ranges);
|
|
53475
53554
|
}
|
|
53476
53555
|
return rules.filter((rule) => rule.ranges.length > 0);
|
|
@@ -62201,10 +62280,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62201
62280
|
*/
|
|
62202
62281
|
function transformAll(toTransform, executed) {
|
|
62203
62282
|
let transformedCommands = [...toTransform];
|
|
62283
|
+
const possibleTransformations = new Set(otRegistry.getKeys());
|
|
62204
62284
|
for (const executedCommand of executed) {
|
|
62205
|
-
|
|
62206
|
-
|
|
62207
|
-
|
|
62285
|
+
// If the executed command is not in the registry, we skip it
|
|
62286
|
+
// because we know there won't be any transformation impacting the
|
|
62287
|
+
// commands to transform.
|
|
62288
|
+
if (possibleTransformations.has(executedCommand.type)) {
|
|
62289
|
+
transformedCommands = transformedCommands.reduce((acc, cmd) => {
|
|
62290
|
+
const transformed = transform(cmd, executedCommand);
|
|
62291
|
+
if (transformed) {
|
|
62292
|
+
acc.push(transformed);
|
|
62293
|
+
}
|
|
62294
|
+
return acc;
|
|
62295
|
+
}, []);
|
|
62296
|
+
}
|
|
62208
62297
|
}
|
|
62209
62298
|
return transformedCommands;
|
|
62210
62299
|
}
|
|
@@ -62690,7 +62779,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62690
62779
|
if (this.waitingAck) {
|
|
62691
62780
|
return;
|
|
62692
62781
|
}
|
|
62693
|
-
this.waitingAck = true;
|
|
62694
62782
|
this.sendPendingMessage();
|
|
62695
62783
|
}
|
|
62696
62784
|
/**
|
|
@@ -62720,6 +62808,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62720
62808
|
throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
|
|
62721
62809
|
${JSON.stringify(message)}`);
|
|
62722
62810
|
}
|
|
62811
|
+
this.waitingAck = true;
|
|
62723
62812
|
this.transportService.sendMessage({
|
|
62724
62813
|
...message,
|
|
62725
62814
|
serverRevisionId: this.serverRevisionId,
|
|
@@ -63860,7 +63949,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63860
63949
|
}
|
|
63861
63950
|
const position = this.getters.getCellPosition(cell.id);
|
|
63862
63951
|
const colSize = this.getters.getColSize(sheetId, position.col);
|
|
63863
|
-
if (cell.isFormula) {
|
|
63952
|
+
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
63864
63953
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
63865
63954
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
63866
63955
|
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
|
|
@@ -65145,49 +65234,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65145
65234
|
if (!copiedData) {
|
|
65146
65235
|
return;
|
|
65147
65236
|
}
|
|
65148
|
-
let zone = undefined;
|
|
65149
|
-
let selectedZones = [];
|
|
65150
65237
|
const sheetId = this.getters.getActiveSheetId();
|
|
65151
|
-
let target = {
|
|
65152
|
-
sheetId,
|
|
65153
|
-
zones,
|
|
65154
|
-
};
|
|
65155
65238
|
const handlers = this.selectClipboardHandlers(copiedData);
|
|
65156
|
-
|
|
65157
|
-
const handlerData = copiedData[handlerName];
|
|
65158
|
-
if (!handlerData) {
|
|
65159
|
-
continue;
|
|
65160
|
-
}
|
|
65161
|
-
const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
|
|
65162
|
-
if (currentTarget.figureId) {
|
|
65163
|
-
target.figureId = currentTarget.figureId;
|
|
65164
|
-
}
|
|
65165
|
-
for (const targetZone of currentTarget.zones) {
|
|
65166
|
-
selectedZones.push(targetZone);
|
|
65167
|
-
if (zone === undefined) {
|
|
65168
|
-
zone = targetZone;
|
|
65169
|
-
continue;
|
|
65170
|
-
}
|
|
65171
|
-
zone = union(zone, targetZone);
|
|
65172
|
-
}
|
|
65173
|
-
}
|
|
65239
|
+
const { target, zone, selectedZones } = getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options);
|
|
65174
65240
|
if (zone !== undefined) {
|
|
65175
|
-
this.addMissingDimensions(
|
|
65241
|
+
this.addMissingDimensions(sheetId, zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
|
|
65176
65242
|
}
|
|
65177
|
-
handlers
|
|
65178
|
-
const handlerData = copiedData[handlerName];
|
|
65179
|
-
if (handlerData) {
|
|
65180
|
-
handler.paste(target, handlerData, options);
|
|
65181
|
-
}
|
|
65182
|
-
});
|
|
65243
|
+
applyClipboardHandlersPaste(handlers, copiedData, target, options);
|
|
65183
65244
|
if (!options?.selectTarget) {
|
|
65184
65245
|
return;
|
|
65185
65246
|
}
|
|
65186
|
-
|
|
65187
|
-
const col = selection.left;
|
|
65188
|
-
const row = selection.top;
|
|
65189
|
-
this.selection.getBackToDefault();
|
|
65190
|
-
this.selection.selectZone({ cell: { col, row }, zone: union(...selectedZones) }, { scrollIntoView: false });
|
|
65247
|
+
selectPastedZone(this.selection, zones, selectedZones);
|
|
65191
65248
|
}
|
|
65192
65249
|
/**
|
|
65193
65250
|
* Add columns and/or rows to ensure that col + width and row + height are still
|
|
@@ -74446,9 +74503,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74446
74503
|
exports.tokenize = tokenize;
|
|
74447
74504
|
|
|
74448
74505
|
|
|
74449
|
-
__info__.version = "18.0.
|
|
74450
|
-
__info__.date = "2025-06-
|
|
74451
|
-
__info__.hash = "
|
|
74506
|
+
__info__.version = "18.0.35";
|
|
74507
|
+
__info__.date = "2025-06-23T15:06:32.032Z";
|
|
74508
|
+
__info__.hash = "a38db25";
|
|
74452
74509
|
|
|
74453
74510
|
|
|
74454
74511
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|