@odoo/o-spreadsheet 18.1.26 → 18.1.27

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.1.26
6
- * @date 2025-06-19T18:21:37.648Z
7
- * @hash 06479d4
5
+ * @version 18.1.27
6
+ * @date 2025-06-23T15:04:51.792Z
7
+ * @hash b25bcc7
8
8
  */
9
9
 
10
10
  'use strict';
@@ -6818,6 +6818,63 @@ function parseOSClipboardContent(content) {
6818
6818
  data: spreadsheetContent,
6819
6819
  };
6820
6820
  }
6821
+ /**
6822
+ * Applies each clipboard handler to paste its corresponding data into the target.
6823
+ */
6824
+ const applyClipboardHandlersPaste = (handlers, copiedData, target, options) => {
6825
+ handlers.forEach(({ handlerName, handler }) => {
6826
+ const data = copiedData[handlerName];
6827
+ if (data) {
6828
+ handler.paste(target, data, options);
6829
+ }
6830
+ });
6831
+ };
6832
+ /**
6833
+ * Returns the paste target based on clipboard handlers.
6834
+ * Also includes the full affected zone and the list of pasted zones for selection.
6835
+ */
6836
+ function getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options) {
6837
+ let zone = undefined;
6838
+ let selectedZones = [];
6839
+ let target = {
6840
+ sheetId,
6841
+ zones,
6842
+ };
6843
+ for (const { handlerName, handler } of handlers) {
6844
+ const handlerData = copiedData[handlerName];
6845
+ if (!handlerData) {
6846
+ continue;
6847
+ }
6848
+ const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
6849
+ if (currentTarget.figureId) {
6850
+ target.figureId = currentTarget.figureId;
6851
+ }
6852
+ for (const targetZone of currentTarget.zones) {
6853
+ selectedZones.push(targetZone);
6854
+ if (zone === undefined) {
6855
+ zone = targetZone;
6856
+ continue;
6857
+ }
6858
+ zone = union(zone, targetZone);
6859
+ }
6860
+ }
6861
+ return {
6862
+ target,
6863
+ zone,
6864
+ selectedZones,
6865
+ };
6866
+ }
6867
+ /**
6868
+ * Updates the selection after a paste operation.
6869
+ */
6870
+ const selectPastedZone = (selection, sourceZones, pastedZones) => {
6871
+ const anchorCell = {
6872
+ col: sourceZones[0].left,
6873
+ row: sourceZones[0].top,
6874
+ };
6875
+ selection.getBackToDefault();
6876
+ selection.selectZone({ cell: anchorCell, zone: union(...pastedZones) }, { scrollIntoView: false });
6877
+ };
6821
6878
 
6822
6879
  class ClipboardHandler {
6823
6880
  getters;
@@ -46765,7 +46822,7 @@ class SpreadsheetPivot {
46765
46822
  }
46766
46823
  getTypeFromZone(sheetId, zone) {
46767
46824
  const cells = this.getters.getEvaluatedCellsInZone(sheetId, zone);
46768
- const nonEmptyCells = cells.filter((cell) => cell.type !== CellValueType.empty);
46825
+ const nonEmptyCells = cells.filter((cell) => !(cell.type === CellValueType.empty || cell.value === ""));
46769
46826
  if (nonEmptyCells.length === 0) {
46770
46827
  return "integer";
46771
46828
  }
@@ -50322,15 +50379,16 @@ class GridAddRowsFooter extends owl.Component {
50322
50379
  }
50323
50380
  }
50324
50381
 
50382
+ const PAINT_FORMAT_HANDLER_KEYS = [
50383
+ "cell",
50384
+ "border",
50385
+ "table",
50386
+ "conditionalFormat",
50387
+ "merge",
50388
+ ];
50325
50389
  class PaintFormatStore extends SpreadsheetStore {
50326
50390
  mutators = ["activate", "cancel", "pasteFormat"];
50327
50391
  highlightStore = this.get(HighlightStore);
50328
- clipboardHandlers = [
50329
- new CellClipboardHandler(this.getters, this.model.dispatch),
50330
- new BorderClipboardHandler(this.getters, this.model.dispatch),
50331
- new TableClipboardHandler(this.getters, this.model.dispatch),
50332
- new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
50333
- ];
50334
50392
  status = "inactive";
50335
50393
  copiedData;
50336
50394
  constructor(get) {
@@ -50361,24 +50419,38 @@ class PaintFormatStore extends SpreadsheetStore {
50361
50419
  get isActive() {
50362
50420
  return this.status !== "inactive";
50363
50421
  }
50422
+ get clipboardHandlers() {
50423
+ return PAINT_FORMAT_HANDLER_KEYS.map((handlerName) => {
50424
+ const HandlerClass = clipboardHandlersRegistries.cellHandlers.get(handlerName);
50425
+ return {
50426
+ handlerName,
50427
+ handler: new HandlerClass(this.getters, this.model.dispatch),
50428
+ };
50429
+ });
50430
+ }
50364
50431
  copyFormats() {
50365
50432
  const sheetId = this.getters.getActiveSheetId();
50366
50433
  const zones = this.getters.getSelectedZones();
50367
- const copiedData = {};
50368
- for (const handler of this.clipboardHandlers) {
50369
- Object.assign(copiedData, handler.copy(getClipboardDataPositions(sheetId, zones)));
50434
+ const copiedData = { zones, sheetId };
50435
+ for (const { handlerName, handler } of this.clipboardHandlers) {
50436
+ const handlerResult = handler.copy(getClipboardDataPositions(sheetId, zones));
50437
+ if (handlerResult !== undefined) {
50438
+ copiedData[handlerName] = handlerResult;
50439
+ }
50370
50440
  }
50371
50441
  return copiedData;
50372
50442
  }
50373
50443
  paintFormat(sheetId, target) {
50374
- if (this.copiedData) {
50375
- for (const handler of this.clipboardHandlers) {
50376
- handler.paste({ zones: target, sheetId }, this.copiedData, {
50377
- isCutOperation: false,
50378
- pasteOption: "onlyFormat",
50379
- });
50380
- }
50444
+ if (!this.copiedData) {
50445
+ return;
50381
50446
  }
50447
+ const options = {
50448
+ isCutOperation: false,
50449
+ pasteOption: "onlyFormat",
50450
+ };
50451
+ const { target: pasteTarget, selectedZones } = getPasteTargetFromHandlers(sheetId, target, this.copiedData, this.clipboardHandlers, options);
50452
+ applyClipboardHandlersPaste(this.clipboardHandlers, this.copiedData, pasteTarget, options);
50453
+ selectPastedZone(this.model.selection, target, selectedZones);
50382
50454
  if (this.status === "oneOff") {
50383
50455
  this.cancel();
50384
50456
  }
@@ -55544,7 +55616,7 @@ class DataValidationPlugin extends CorePlugin {
55544
55616
  else if (newRule.criterion.type === "isValueInList") {
55545
55617
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
55546
55618
  }
55547
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
55619
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
55548
55620
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
55549
55621
  if (ruleIndex !== -1) {
55550
55622
  adaptedRules[ruleIndex] = newRule;
@@ -55554,9 +55626,12 @@ class DataValidationPlugin extends CorePlugin {
55554
55626
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
55555
55627
  }
55556
55628
  }
55557
- removeRangesFromRules(sheetId, ranges, rules) {
55629
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
55558
55630
  rules = deepCopy(rules);
55559
55631
  for (const rule of rules) {
55632
+ if (rule.id === editingRuleId) {
55633
+ continue; // Skip the rule being edited to preserve its place in the list
55634
+ }
55560
55635
  rule.ranges = this.getters.recomputeRanges(rule.ranges, ranges);
55561
55636
  }
55562
55637
  return rules.filter((rule) => rule.ranges.length > 0);
@@ -67290,49 +67365,17 @@ class ClipboardPlugin extends UIPlugin {
67290
67365
  if (!copiedData) {
67291
67366
  return;
67292
67367
  }
67293
- let zone = undefined;
67294
- let selectedZones = [];
67295
67368
  const sheetId = this.getters.getActiveSheetId();
67296
- let target = {
67297
- sheetId,
67298
- zones,
67299
- };
67300
67369
  const handlers = this.selectClipboardHandlers(copiedData);
67301
- for (const { handlerName, handler } of handlers) {
67302
- const handlerData = copiedData[handlerName];
67303
- if (!handlerData) {
67304
- continue;
67305
- }
67306
- const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
67307
- if (currentTarget.figureId) {
67308
- target.figureId = currentTarget.figureId;
67309
- }
67310
- for (const targetZone of currentTarget.zones) {
67311
- selectedZones.push(targetZone);
67312
- if (zone === undefined) {
67313
- zone = targetZone;
67314
- continue;
67315
- }
67316
- zone = union(zone, targetZone);
67317
- }
67318
- }
67370
+ const { target, zone, selectedZones } = getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options);
67319
67371
  if (zone !== undefined) {
67320
- this.addMissingDimensions(this.getters.getActiveSheetId(), zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67372
+ this.addMissingDimensions(sheetId, zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67321
67373
  }
67322
- handlers.forEach(({ handlerName, handler }) => {
67323
- const handlerData = copiedData[handlerName];
67324
- if (handlerData) {
67325
- handler.paste(target, handlerData, options);
67326
- }
67327
- });
67374
+ applyClipboardHandlersPaste(handlers, copiedData, target, options);
67328
67375
  if (!options?.selectTarget) {
67329
67376
  return;
67330
67377
  }
67331
- const selection = zones[0];
67332
- const col = selection.left;
67333
- const row = selection.top;
67334
- this.selection.getBackToDefault();
67335
- this.selection.selectZone({ cell: { col, row }, zone: union(...selectedZones) }, { scrollIntoView: false });
67378
+ selectPastedZone(this.selection, zones, selectedZones);
67336
67379
  }
67337
67380
  /**
67338
67381
  * Add columns and/or rows to ensure that col + width and row + height are still
@@ -76574,6 +76617,6 @@ exports.tokenColors = tokenColors;
76574
76617
  exports.tokenize = tokenize;
76575
76618
 
76576
76619
 
76577
- __info__.version = "18.1.26";
76578
- __info__.date = "2025-06-19T18:21:37.648Z";
76579
- __info__.hash = "06479d4";
76620
+ __info__.version = "18.1.27";
76621
+ __info__.date = "2025-06-23T15:04:51.792Z";
76622
+ __info__.hash = "b25bcc7";
@@ -1910,13 +1910,6 @@ declare class UIPlugin<State = any> extends BasePlugin<State, Command> {
1910
1910
  drawLayer(ctx: GridRenderingContext, layer: LayerName): void;
1911
1911
  }
1912
1912
 
1913
- type MinimalClipboardData = {
1914
- sheetId?: UID;
1915
- cells?: ClipboardCell[][];
1916
- zones?: Zone[];
1917
- figureId?: UID;
1918
- [key: string]: unknown;
1919
- };
1920
1913
  interface SpreadsheetClipboardData extends MinimalClipboardData {
1921
1914
  version?: number;
1922
1915
  clipboardId?: string;
@@ -2357,6 +2350,13 @@ type ClipboardPasteTarget = {
2357
2350
  zones: Zone[];
2358
2351
  figureId?: UID;
2359
2352
  };
2353
+ type MinimalClipboardData = {
2354
+ sheetId?: UID;
2355
+ cells?: ClipboardCell[][];
2356
+ zones?: Zone[];
2357
+ figureId?: UID;
2358
+ [key: string]: unknown;
2359
+ };
2360
2360
 
2361
2361
  /**
2362
2362
  * There are two kinds of commands: CoreCommands and LocalCommands
@@ -13343,4 +13343,4 @@ declare const chartHelpers: {
13343
13343
  WaterfallChart: typeof WaterfallChart;
13344
13344
  };
13345
13345
 
13346
- export { AST, ASTFuncall, AboveAverageRule, AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, ActivateNextSheetCommand, ActivatePreviousSheetCommand, ActivateSheetCommand, AddColumnsRowsCommand, AddConditionalFormatCommand, AddDataValidationCommand, AddFunctionDescription, AddMergeCommand, AddPivotCommand, Aggregator, Alias, Align, AlphanumericIncrementModifier, AnchorZone, ApplyRangeChange, ApplyRangeChangeResult, Arg, ArgDefinition, ArgType, AutoFillCellCommand, AutofillAutoCommand, AutofillCellData, AutofillCommand, AutofillData, AutofillModifier, AutofillModifierImplementation, AutofillResult, AutofillSelectCommand, AutofillTableCommand, AutoresizeColumnsCommand, AutoresizeRowsCommand, AxesDesign, AxisDesign, AxisType, BeginsWithRule, BooleanCell, Border$1 as Border, BorderData, BorderDescr, BorderDescription, BorderPosition, BorderStyle, Box, BoxTextContent, CHART_TYPES, CSSProperties, CancelledReason, Cell, CellErrorType, CellIsRule, CellPosition, CellValue, CellValueType, ChangeType, ChartAxisFormats, ChartCreationContext, ChartDefinition, ChartJSRuntime, ChartRuntime, ChartRuntimeGenerationArgs, ChartType, ChartWithDataSetDefinition, CleanClipBoardHighlightCommand, ClearCellCommand, ClearCellsCommand, ClearFormattingCommand, Client, ClientId, ClientJoinedMessage, ClientLeftMessage, ClientMovedMessage, ClientPosition, ClipboardCell, ClipboardCellData, ClipboardData, ClipboardFigureData, ClipboardMIMEType, ClipboardOperation, ClipboardOptions, ClipboardPasteOptions, ClipboardPasteTarget, Cloneable, CollaborationMessage, CollaborativeEvent, CollaborativeEventReceived, CollaborativeEventTypes, Color, ColorScaleMidPointThreshold, ColorScaleRule, ColorScaleThreshold, ColorSheetCommand, Command, CommandDispatcher, CommandHandler, CommandResult, CommandTypes, CommonPivotCoreDefinition, CompiledFormula, ComposerFocusType, ComputeFunction, ComputedTableStyle, ConditionalFormat, ConditionalFormatInternal, ConditionalFormatRule, ConditionalFormatRuleInternal, ConditionalFormattingOperatorValues, ConsecutiveIndexes, ContainsTextRule, CopyCommand, CopyModifier, CopyPasteCellsAboveCommand, CopyPasteCellsOnLeftCommand, CoreCommand, CoreCommandDispatcher, CoreCommandTypes, CoreGetters, CorePlugin, CoreTable, CoreTableType, CoreViewCommand, CoreViewCommandTypes, CreateChartCommand, CreateFigureCommand, CreateImageOverCommand, CreateRevisionOptions, CreateSheetCommand, CreateTableCommand, CreateTableStyleCommand, Currency, CustomFormulaCriterion, CustomizedDataSet, CutCommand, DEFAULT_LOCALE, DEFAULT_LOCALES, DIRECTION, DOMCoordinates, DOMDimension, DataBarFill, DataBarRule, DataBarRuleInternal, DataSet, DataValidationCriterion, DataValidationCriterionType, DataValidationDateCriterion, DataValidationRule, DataValidationRuleData, DatasetDesign, DatasetValues, DateCriterionValue, DateIncrementModifier, DateIsAfterCriterion, DateIsBeforeCriterion, DateIsBetweenCriterion, DateIsCriterion, DateIsNotBetweenCriterion, DateIsOnOrAfterCriterion, DateIsOnOrBeforeCriterion, DateIsValidCriterion, DebouncedFunction, DeleteCellCommand, DeleteContentCommand, DeleteFigureCommand, DeleteSheetCommand, Dependencies, Dimension, DimensionTree, DimensionTreeNode, Direction$1 as Direction, DispatchResult, DuplicatePivotCommand, DuplicatePivotInNewSheetCommand, DuplicateSheetCommand, DynamicTable, EdgeScrollInfo, EditTextOptions, EditionMode, EmptyCell, EndsWithRule, EnrichedToken, EnsureRange, ErrorCell, EvalContext, EvaluateCellsCommand, EvaluateChartsCommand, EvaluatedCell, EvaluationError, ExcelChartDataset, ExcelChartDefinition, ExcelChartType, ExcelFigureSize, ExcelFilterData, ExcelHeaderData, ExcelSheetData, ExcelTableData, ExcelWorkbookData, ExpressionRule, Figure, FigureData, FigureSize, Filter, FilterId, FoldAllHeaderGroupsCommand, FoldHeaderGroupCommand, FoldHeaderGroupsInZoneCommand, Format, FormattedValue, FormulaCell, FormulaModifier, FormulaToExecute, FreezeColumnsCommand, FreezeRowsCommand, FunctionDescription, FunctionRegistry, FunctionResultNumber, FunctionResultObject, GeneratorCell, GenericDefinition, GetSymbolValue, Getters, Granularity, GridClickModifiers, GridRenderingContext, GroupHeadersCommand, HSLA, HeaderData, HeaderDimensions, HeaderGroup, HeaderIndex, HeadersDependentCommand, HideColumnsRowsCommand, HideSheetCommand, Highlight$1 as Highlight, HistoryChange, IconSet, IconSetRule, IconThreshold, Image, Immutable, Increment, IncrementModifier, InformationNotification, InitPivotParams, InsertCellCommand, InsertNewPivotCommand, InsertPivotCommand, InsertPivotWithTableCommand, IsBetweenCriterion, IsCheckboxCriterion, IsEqualCriterion, IsGreaterOrEqualToCriterion, IsGreaterThanCriterion, IsLessOrEqualToCriterion, IsLessThanCriterion, IsNotBetweenCriterion, IsNotEqualCriterion, IsValueInListCriterion, IsValueInRangeCriterion, LabelValues, LayerName, Lazy, Link, LiteralCell, LocalCommand, Locale, LocaleCode, LocaleFormat, LookupCaches, Matrix, Maybe, MenuMouseEvent, Merge, Model, MoveColumnsRowsCommand, MoveConditionalFormatCommand, MoveRangeCommand, MoveSheetCommand, MoveViewportDownCommand, MoveViewportToCellCommand, MoveViewportUpCommand, NewLocalStateUpdateEvent, NotContainsTextRule, NotificationType, NumberCell, OSClipboardContent, Offset, OperationSequenceNode, OrderedLayers, PaintFormat, PaneDivision, ParsedOSClipboardContent, PasteCommand, PasteFromOSClipboardCommand, Pivot, PivotColRowDomain, PivotCoreDefinition, PivotCoreDimension, PivotCoreMeasure, PivotDimension$1 as PivotDimension, PivotDomain, PivotEmptyCell, PivotField, PivotFields, PivotHeaderCell, PivotMeasure, PivotMeasureDisplay, PivotMeasureDisplayType, PivotMeasureHeaderCell, PivotNode, PivotRuntimeDefinition, PivotSortedColumn, PivotStartPresenceTracking, PivotStopPresenceTracking, PivotTableCell, PivotTableColumn, PivotTableData, PivotTableRow, PivotTimeAdapter, PivotTimeAdapterNotNull, PivotValueCell, Pixel, PixelPosition, Position$1 as Position, PositionDependentCommand, PropsOf, RGBA, Range, RangeCompiledFormula, RangeData, RangePart, RangeProvider, RangesDependentCommand, Rect, RedoCommand, Ref, ReferenceDenormalizer, RefreshPivotCommand, Registry, RemoteRevisionMessage, RemoteRevisionReceivedEvent, RemoveColumnsRowsCommand, RemoveConditionalFormatCommand, RemoveDataValidationCommand, RemoveDuplicatesCommand, RemoveMergeCommand, RemovePivotCommand, RemoveTableCommand, RemoveTableStyleCommand, RenamePivotCommand, RenameSheetCommand, RepeatPasteCommand, ReplaceSearchCommand, RequestRedoCommand, RequestUndoCommand, ResizeColumnsRowsCommand, ResizeDirection, ResizeTableCommand, ResizeViewportCommand, Revision, RevisionAcknowledgedEvent, RevisionData, RevisionRedone, RevisionRedoneMessage, RevisionUndone, RevisionUndoneMessage, Row, SPREADSHEET_DIMENSIONS, ScrollDirection$1 as ScrollDirection, SelectFigureCommand, Selection, SelectionStep, SetBorderCommand, SetBorderTargetCommand, SetContextualFormatCommand, SetDecimalCommand, SetDecimalStep, SetFormattingCommand, SetGridLinesVisibilityCommand, SetViewportOffsetCommand, SetZoneBordersCommand, Sheet, SheetDOMScrollInfo, SheetData, SheetDependentCommand, SheetScrollInfo, ShowFormulaCommand, ShowSheetCommand, SingleColorRule, SingleColorRules, SnapshotEvent, SortCommand, SortDirection, SortOptions, SplitPivotFormulaCommand, SplitTextIntoColumnsCommand, Spreadsheet, SpreadsheetChildEnv, SpreadsheetPivotCoreDefinition, SpreadsheetPivotTable, StartChangeHighlightCommand, StartCommand, StaticTable, StoreConstructor, StoreParams, Style, SumSelectionCommand, Table, TableBorder, TableConfig, TableData$1 as TableData, TableElementStyle, TableId, TableStyle, TableStyleData, TableStyleTemplateName, TargetDependentCommand, TechnicalName, TextCell, TextContainsCriterion, TextIsCriterion, TextIsEmailCriterion, TextIsLinkCriterion, TextNotContainsCriterion, TextRule, ThresholdType, TimePeriodRule, TitleDesign, Token, Tooltip, Top10Rule, Transformation, TransformationFactory, TransportService, TrendConfiguration, TrendType, TrimWhitespaceCommand, UID, UIPlugin, UnGroupHeadersCommand, UnboundedZone, UndoCommand, UnexpectedRevisionIdEvent, UnfoldAllHeaderGroupsCommand, UnfoldHeaderGroupCommand, UnfoldHeaderGroupsInZoneCommand, UnfreezeColumnsCommand, UnfreezeColumnsRowsCommand, UnfreezeRowsCommand, UnhideColumnsRowsCommand, UpdateCellCommand, UpdateCellData, UpdateCellPositionCommand, UpdateChartCommand, UpdateFigureCommand, UpdateFilterCommand, UpdateLocaleCommand, UpdatePivotCommand, UpdateTableCommand, Validation, VerticalAlign, Viewport, WorkbookData, WorkbookHistory, Wrapping, Zone, ZoneDependentCommand, ZoneDimension, __info__, addFunction, addRenderingLayer, astToFormula, borderStyles, canExecuteInReadonly, chartHelpers, compile, compileTokens, components, constants, containsBlanksRule, containsErrorsRule, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateBordersCommands, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isHeadersDependant, isMatrix, isPositionDependent, isRangeDependant, isSheetDependent, isTargetDependent, isZoneDependent, iterateAstNodes, links, load, notContainsBlanksRule, notContainsErrorsRule, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
13346
+ export { AST, ASTFuncall, AboveAverageRule, AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, ActivateNextSheetCommand, ActivatePreviousSheetCommand, ActivateSheetCommand, AddColumnsRowsCommand, AddConditionalFormatCommand, AddDataValidationCommand, AddFunctionDescription, AddMergeCommand, AddPivotCommand, Aggregator, Alias, Align, AlphanumericIncrementModifier, AnchorZone, ApplyRangeChange, ApplyRangeChangeResult, Arg, ArgDefinition, ArgType, AutoFillCellCommand, AutofillAutoCommand, AutofillCellData, AutofillCommand, AutofillData, AutofillModifier, AutofillModifierImplementation, AutofillResult, AutofillSelectCommand, AutofillTableCommand, AutoresizeColumnsCommand, AutoresizeRowsCommand, AxesDesign, AxisDesign, AxisType, BeginsWithRule, BooleanCell, Border$1 as Border, BorderData, BorderDescr, BorderDescription, BorderPosition, BorderStyle, Box, BoxTextContent, CHART_TYPES, CSSProperties, CancelledReason, Cell, CellErrorType, CellIsRule, CellPosition, CellValue, CellValueType, ChangeType, ChartAxisFormats, ChartCreationContext, ChartDefinition, ChartJSRuntime, ChartRuntime, ChartRuntimeGenerationArgs, ChartType, ChartWithDataSetDefinition, CleanClipBoardHighlightCommand, ClearCellCommand, ClearCellsCommand, ClearFormattingCommand, Client, ClientId, ClientJoinedMessage, ClientLeftMessage, ClientMovedMessage, ClientPosition, ClipboardCell, ClipboardCellData, ClipboardData, ClipboardFigureData, ClipboardMIMEType, ClipboardOperation, ClipboardOptions, ClipboardPasteOptions, ClipboardPasteTarget, Cloneable, CollaborationMessage, CollaborativeEvent, CollaborativeEventReceived, CollaborativeEventTypes, Color, ColorScaleMidPointThreshold, ColorScaleRule, ColorScaleThreshold, ColorSheetCommand, Command, CommandDispatcher, CommandHandler, CommandResult, CommandTypes, CommonPivotCoreDefinition, CompiledFormula, ComposerFocusType, ComputeFunction, ComputedTableStyle, ConditionalFormat, ConditionalFormatInternal, ConditionalFormatRule, ConditionalFormatRuleInternal, ConditionalFormattingOperatorValues, ConsecutiveIndexes, ContainsTextRule, CopyCommand, CopyModifier, CopyPasteCellsAboveCommand, CopyPasteCellsOnLeftCommand, CoreCommand, CoreCommandDispatcher, CoreCommandTypes, CoreGetters, CorePlugin, CoreTable, CoreTableType, CoreViewCommand, CoreViewCommandTypes, CreateChartCommand, CreateFigureCommand, CreateImageOverCommand, CreateRevisionOptions, CreateSheetCommand, CreateTableCommand, CreateTableStyleCommand, Currency, CustomFormulaCriterion, CustomizedDataSet, CutCommand, DEFAULT_LOCALE, DEFAULT_LOCALES, DIRECTION, DOMCoordinates, DOMDimension, DataBarFill, DataBarRule, DataBarRuleInternal, DataSet, DataValidationCriterion, DataValidationCriterionType, DataValidationDateCriterion, DataValidationRule, DataValidationRuleData, DatasetDesign, DatasetValues, DateCriterionValue, DateIncrementModifier, DateIsAfterCriterion, DateIsBeforeCriterion, DateIsBetweenCriterion, DateIsCriterion, DateIsNotBetweenCriterion, DateIsOnOrAfterCriterion, DateIsOnOrBeforeCriterion, DateIsValidCriterion, DebouncedFunction, DeleteCellCommand, DeleteContentCommand, DeleteFigureCommand, DeleteSheetCommand, Dependencies, Dimension, DimensionTree, DimensionTreeNode, Direction$1 as Direction, DispatchResult, DuplicatePivotCommand, DuplicatePivotInNewSheetCommand, DuplicateSheetCommand, DynamicTable, EdgeScrollInfo, EditTextOptions, EditionMode, EmptyCell, EndsWithRule, EnrichedToken, EnsureRange, ErrorCell, EvalContext, EvaluateCellsCommand, EvaluateChartsCommand, EvaluatedCell, EvaluationError, ExcelChartDataset, ExcelChartDefinition, ExcelChartType, ExcelFigureSize, ExcelFilterData, ExcelHeaderData, ExcelSheetData, ExcelTableData, ExcelWorkbookData, ExpressionRule, Figure, FigureData, FigureSize, Filter, FilterId, FoldAllHeaderGroupsCommand, FoldHeaderGroupCommand, FoldHeaderGroupsInZoneCommand, Format, FormattedValue, FormulaCell, FormulaModifier, FormulaToExecute, FreezeColumnsCommand, FreezeRowsCommand, FunctionDescription, FunctionRegistry, FunctionResultNumber, FunctionResultObject, GeneratorCell, GenericDefinition, GetSymbolValue, Getters, Granularity, GridClickModifiers, GridRenderingContext, GroupHeadersCommand, HSLA, HeaderData, HeaderDimensions, HeaderGroup, HeaderIndex, HeadersDependentCommand, HideColumnsRowsCommand, HideSheetCommand, Highlight$1 as Highlight, HistoryChange, IconSet, IconSetRule, IconThreshold, Image, Immutable, Increment, IncrementModifier, InformationNotification, InitPivotParams, InsertCellCommand, InsertNewPivotCommand, InsertPivotCommand, InsertPivotWithTableCommand, IsBetweenCriterion, IsCheckboxCriterion, IsEqualCriterion, IsGreaterOrEqualToCriterion, IsGreaterThanCriterion, IsLessOrEqualToCriterion, IsLessThanCriterion, IsNotBetweenCriterion, IsNotEqualCriterion, IsValueInListCriterion, IsValueInRangeCriterion, LabelValues, LayerName, Lazy, Link, LiteralCell, LocalCommand, Locale, LocaleCode, LocaleFormat, LookupCaches, Matrix, Maybe, MenuMouseEvent, Merge, MinimalClipboardData, Model, MoveColumnsRowsCommand, MoveConditionalFormatCommand, MoveRangeCommand, MoveSheetCommand, MoveViewportDownCommand, MoveViewportToCellCommand, MoveViewportUpCommand, NewLocalStateUpdateEvent, NotContainsTextRule, NotificationType, NumberCell, OSClipboardContent, Offset, OperationSequenceNode, OrderedLayers, PaintFormat, PaneDivision, ParsedOSClipboardContent, PasteCommand, PasteFromOSClipboardCommand, Pivot, PivotColRowDomain, PivotCoreDefinition, PivotCoreDimension, PivotCoreMeasure, PivotDimension$1 as PivotDimension, PivotDomain, PivotEmptyCell, PivotField, PivotFields, PivotHeaderCell, PivotMeasure, PivotMeasureDisplay, PivotMeasureDisplayType, PivotMeasureHeaderCell, PivotNode, PivotRuntimeDefinition, PivotSortedColumn, PivotStartPresenceTracking, PivotStopPresenceTracking, PivotTableCell, PivotTableColumn, PivotTableData, PivotTableRow, PivotTimeAdapter, PivotTimeAdapterNotNull, PivotValueCell, Pixel, PixelPosition, Position$1 as Position, PositionDependentCommand, PropsOf, RGBA, Range, RangeCompiledFormula, RangeData, RangePart, RangeProvider, RangesDependentCommand, Rect, RedoCommand, Ref, ReferenceDenormalizer, RefreshPivotCommand, Registry, RemoteRevisionMessage, RemoteRevisionReceivedEvent, RemoveColumnsRowsCommand, RemoveConditionalFormatCommand, RemoveDataValidationCommand, RemoveDuplicatesCommand, RemoveMergeCommand, RemovePivotCommand, RemoveTableCommand, RemoveTableStyleCommand, RenamePivotCommand, RenameSheetCommand, RepeatPasteCommand, ReplaceSearchCommand, RequestRedoCommand, RequestUndoCommand, ResizeColumnsRowsCommand, ResizeDirection, ResizeTableCommand, ResizeViewportCommand, Revision, RevisionAcknowledgedEvent, RevisionData, RevisionRedone, RevisionRedoneMessage, RevisionUndone, RevisionUndoneMessage, Row, SPREADSHEET_DIMENSIONS, ScrollDirection$1 as ScrollDirection, SelectFigureCommand, Selection, SelectionStep, SetBorderCommand, SetBorderTargetCommand, SetContextualFormatCommand, SetDecimalCommand, SetDecimalStep, SetFormattingCommand, SetGridLinesVisibilityCommand, SetViewportOffsetCommand, SetZoneBordersCommand, Sheet, SheetDOMScrollInfo, SheetData, SheetDependentCommand, SheetScrollInfo, ShowFormulaCommand, ShowSheetCommand, SingleColorRule, SingleColorRules, SnapshotEvent, SortCommand, SortDirection, SortOptions, SplitPivotFormulaCommand, SplitTextIntoColumnsCommand, Spreadsheet, SpreadsheetChildEnv, SpreadsheetPivotCoreDefinition, SpreadsheetPivotTable, StartChangeHighlightCommand, StartCommand, StaticTable, StoreConstructor, StoreParams, Style, SumSelectionCommand, Table, TableBorder, TableConfig, TableData$1 as TableData, TableElementStyle, TableId, TableStyle, TableStyleData, TableStyleTemplateName, TargetDependentCommand, TechnicalName, TextCell, TextContainsCriterion, TextIsCriterion, TextIsEmailCriterion, TextIsLinkCriterion, TextNotContainsCriterion, TextRule, ThresholdType, TimePeriodRule, TitleDesign, Token, Tooltip, Top10Rule, Transformation, TransformationFactory, TransportService, TrendConfiguration, TrendType, TrimWhitespaceCommand, UID, UIPlugin, UnGroupHeadersCommand, UnboundedZone, UndoCommand, UnexpectedRevisionIdEvent, UnfoldAllHeaderGroupsCommand, UnfoldHeaderGroupCommand, UnfoldHeaderGroupsInZoneCommand, UnfreezeColumnsCommand, UnfreezeColumnsRowsCommand, UnfreezeRowsCommand, UnhideColumnsRowsCommand, UpdateCellCommand, UpdateCellData, UpdateCellPositionCommand, UpdateChartCommand, UpdateFigureCommand, UpdateFilterCommand, UpdateLocaleCommand, UpdatePivotCommand, UpdateTableCommand, Validation, VerticalAlign, Viewport, WorkbookData, WorkbookHistory, Wrapping, Zone, ZoneDependentCommand, ZoneDimension, __info__, addFunction, addRenderingLayer, astToFormula, borderStyles, canExecuteInReadonly, chartHelpers, compile, compileTokens, components, constants, containsBlanksRule, containsErrorsRule, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateBordersCommands, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isHeadersDependant, isMatrix, isPositionDependent, isRangeDependant, isSheetDependent, isTargetDependent, isZoneDependent, iterateAstNodes, links, load, notContainsBlanksRule, notContainsErrorsRule, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
@@ -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.1.26
6
- * @date 2025-06-19T18:21:37.648Z
7
- * @hash 06479d4
5
+ * @version 18.1.27
6
+ * @date 2025-06-23T15:04:51.792Z
7
+ * @hash b25bcc7
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';
@@ -6816,6 +6816,63 @@ function parseOSClipboardContent(content) {
6816
6816
  data: spreadsheetContent,
6817
6817
  };
6818
6818
  }
6819
+ /**
6820
+ * Applies each clipboard handler to paste its corresponding data into the target.
6821
+ */
6822
+ const applyClipboardHandlersPaste = (handlers, copiedData, target, options) => {
6823
+ handlers.forEach(({ handlerName, handler }) => {
6824
+ const data = copiedData[handlerName];
6825
+ if (data) {
6826
+ handler.paste(target, data, options);
6827
+ }
6828
+ });
6829
+ };
6830
+ /**
6831
+ * Returns the paste target based on clipboard handlers.
6832
+ * Also includes the full affected zone and the list of pasted zones for selection.
6833
+ */
6834
+ function getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options) {
6835
+ let zone = undefined;
6836
+ let selectedZones = [];
6837
+ let target = {
6838
+ sheetId,
6839
+ zones,
6840
+ };
6841
+ for (const { handlerName, handler } of handlers) {
6842
+ const handlerData = copiedData[handlerName];
6843
+ if (!handlerData) {
6844
+ continue;
6845
+ }
6846
+ const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
6847
+ if (currentTarget.figureId) {
6848
+ target.figureId = currentTarget.figureId;
6849
+ }
6850
+ for (const targetZone of currentTarget.zones) {
6851
+ selectedZones.push(targetZone);
6852
+ if (zone === undefined) {
6853
+ zone = targetZone;
6854
+ continue;
6855
+ }
6856
+ zone = union(zone, targetZone);
6857
+ }
6858
+ }
6859
+ return {
6860
+ target,
6861
+ zone,
6862
+ selectedZones,
6863
+ };
6864
+ }
6865
+ /**
6866
+ * Updates the selection after a paste operation.
6867
+ */
6868
+ const selectPastedZone = (selection, sourceZones, pastedZones) => {
6869
+ const anchorCell = {
6870
+ col: sourceZones[0].left,
6871
+ row: sourceZones[0].top,
6872
+ };
6873
+ selection.getBackToDefault();
6874
+ selection.selectZone({ cell: anchorCell, zone: union(...pastedZones) }, { scrollIntoView: false });
6875
+ };
6819
6876
 
6820
6877
  class ClipboardHandler {
6821
6878
  getters;
@@ -46763,7 +46820,7 @@ class SpreadsheetPivot {
46763
46820
  }
46764
46821
  getTypeFromZone(sheetId, zone) {
46765
46822
  const cells = this.getters.getEvaluatedCellsInZone(sheetId, zone);
46766
- const nonEmptyCells = cells.filter((cell) => cell.type !== CellValueType.empty);
46823
+ const nonEmptyCells = cells.filter((cell) => !(cell.type === CellValueType.empty || cell.value === ""));
46767
46824
  if (nonEmptyCells.length === 0) {
46768
46825
  return "integer";
46769
46826
  }
@@ -50320,15 +50377,16 @@ class GridAddRowsFooter extends Component {
50320
50377
  }
50321
50378
  }
50322
50379
 
50380
+ const PAINT_FORMAT_HANDLER_KEYS = [
50381
+ "cell",
50382
+ "border",
50383
+ "table",
50384
+ "conditionalFormat",
50385
+ "merge",
50386
+ ];
50323
50387
  class PaintFormatStore extends SpreadsheetStore {
50324
50388
  mutators = ["activate", "cancel", "pasteFormat"];
50325
50389
  highlightStore = this.get(HighlightStore);
50326
- clipboardHandlers = [
50327
- new CellClipboardHandler(this.getters, this.model.dispatch),
50328
- new BorderClipboardHandler(this.getters, this.model.dispatch),
50329
- new TableClipboardHandler(this.getters, this.model.dispatch),
50330
- new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
50331
- ];
50332
50390
  status = "inactive";
50333
50391
  copiedData;
50334
50392
  constructor(get) {
@@ -50359,24 +50417,38 @@ class PaintFormatStore extends SpreadsheetStore {
50359
50417
  get isActive() {
50360
50418
  return this.status !== "inactive";
50361
50419
  }
50420
+ get clipboardHandlers() {
50421
+ return PAINT_FORMAT_HANDLER_KEYS.map((handlerName) => {
50422
+ const HandlerClass = clipboardHandlersRegistries.cellHandlers.get(handlerName);
50423
+ return {
50424
+ handlerName,
50425
+ handler: new HandlerClass(this.getters, this.model.dispatch),
50426
+ };
50427
+ });
50428
+ }
50362
50429
  copyFormats() {
50363
50430
  const sheetId = this.getters.getActiveSheetId();
50364
50431
  const zones = this.getters.getSelectedZones();
50365
- const copiedData = {};
50366
- for (const handler of this.clipboardHandlers) {
50367
- Object.assign(copiedData, handler.copy(getClipboardDataPositions(sheetId, zones)));
50432
+ const copiedData = { zones, sheetId };
50433
+ for (const { handlerName, handler } of this.clipboardHandlers) {
50434
+ const handlerResult = handler.copy(getClipboardDataPositions(sheetId, zones));
50435
+ if (handlerResult !== undefined) {
50436
+ copiedData[handlerName] = handlerResult;
50437
+ }
50368
50438
  }
50369
50439
  return copiedData;
50370
50440
  }
50371
50441
  paintFormat(sheetId, target) {
50372
- if (this.copiedData) {
50373
- for (const handler of this.clipboardHandlers) {
50374
- handler.paste({ zones: target, sheetId }, this.copiedData, {
50375
- isCutOperation: false,
50376
- pasteOption: "onlyFormat",
50377
- });
50378
- }
50442
+ if (!this.copiedData) {
50443
+ return;
50379
50444
  }
50445
+ const options = {
50446
+ isCutOperation: false,
50447
+ pasteOption: "onlyFormat",
50448
+ };
50449
+ const { target: pasteTarget, selectedZones } = getPasteTargetFromHandlers(sheetId, target, this.copiedData, this.clipboardHandlers, options);
50450
+ applyClipboardHandlersPaste(this.clipboardHandlers, this.copiedData, pasteTarget, options);
50451
+ selectPastedZone(this.model.selection, target, selectedZones);
50380
50452
  if (this.status === "oneOff") {
50381
50453
  this.cancel();
50382
50454
  }
@@ -55542,7 +55614,7 @@ class DataValidationPlugin extends CorePlugin {
55542
55614
  else if (newRule.criterion.type === "isValueInList") {
55543
55615
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
55544
55616
  }
55545
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
55617
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
55546
55618
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
55547
55619
  if (ruleIndex !== -1) {
55548
55620
  adaptedRules[ruleIndex] = newRule;
@@ -55552,9 +55624,12 @@ class DataValidationPlugin extends CorePlugin {
55552
55624
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
55553
55625
  }
55554
55626
  }
55555
- removeRangesFromRules(sheetId, ranges, rules) {
55627
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
55556
55628
  rules = deepCopy(rules);
55557
55629
  for (const rule of rules) {
55630
+ if (rule.id === editingRuleId) {
55631
+ continue; // Skip the rule being edited to preserve its place in the list
55632
+ }
55558
55633
  rule.ranges = this.getters.recomputeRanges(rule.ranges, ranges);
55559
55634
  }
55560
55635
  return rules.filter((rule) => rule.ranges.length > 0);
@@ -67288,49 +67363,17 @@ class ClipboardPlugin extends UIPlugin {
67288
67363
  if (!copiedData) {
67289
67364
  return;
67290
67365
  }
67291
- let zone = undefined;
67292
- let selectedZones = [];
67293
67366
  const sheetId = this.getters.getActiveSheetId();
67294
- let target = {
67295
- sheetId,
67296
- zones,
67297
- };
67298
67367
  const handlers = this.selectClipboardHandlers(copiedData);
67299
- for (const { handlerName, handler } of handlers) {
67300
- const handlerData = copiedData[handlerName];
67301
- if (!handlerData) {
67302
- continue;
67303
- }
67304
- const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
67305
- if (currentTarget.figureId) {
67306
- target.figureId = currentTarget.figureId;
67307
- }
67308
- for (const targetZone of currentTarget.zones) {
67309
- selectedZones.push(targetZone);
67310
- if (zone === undefined) {
67311
- zone = targetZone;
67312
- continue;
67313
- }
67314
- zone = union(zone, targetZone);
67315
- }
67316
- }
67368
+ const { target, zone, selectedZones } = getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options);
67317
67369
  if (zone !== undefined) {
67318
- this.addMissingDimensions(this.getters.getActiveSheetId(), zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67370
+ this.addMissingDimensions(sheetId, zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67319
67371
  }
67320
- handlers.forEach(({ handlerName, handler }) => {
67321
- const handlerData = copiedData[handlerName];
67322
- if (handlerData) {
67323
- handler.paste(target, handlerData, options);
67324
- }
67325
- });
67372
+ applyClipboardHandlersPaste(handlers, copiedData, target, options);
67326
67373
  if (!options?.selectTarget) {
67327
67374
  return;
67328
67375
  }
67329
- const selection = zones[0];
67330
- const col = selection.left;
67331
- const row = selection.top;
67332
- this.selection.getBackToDefault();
67333
- this.selection.selectZone({ cell: { col, row }, zone: union(...selectedZones) }, { scrollIntoView: false });
67376
+ selectPastedZone(this.selection, zones, selectedZones);
67334
67377
  }
67335
67378
  /**
67336
67379
  * Add columns and/or rows to ensure that col + width and row + height are still
@@ -76528,6 +76571,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
76528
76571
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, 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 };
76529
76572
 
76530
76573
 
76531
- __info__.version = "18.1.26";
76532
- __info__.date = "2025-06-19T18:21:37.648Z";
76533
- __info__.hash = "06479d4";
76574
+ __info__.version = "18.1.27";
76575
+ __info__.date = "2025-06-23T15:04:51.792Z";
76576
+ __info__.hash = "b25bcc7";