@odoo/o-spreadsheet 18.2.18 → 18.2.19

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.18
6
- * @date 2025-06-19T18:24:41.051Z
7
- * @hash 024c134
5
+ * @version 18.2.19
6
+ * @date 2025-06-23T15:07:13.023Z
7
+ * @hash 430d931
8
8
  */
9
9
 
10
10
  'use strict';
@@ -6827,6 +6827,63 @@ function parseOSClipboardContent(content) {
6827
6827
  data: spreadsheetContent,
6828
6828
  };
6829
6829
  }
6830
+ /**
6831
+ * Applies each clipboard handler to paste its corresponding data into the target.
6832
+ */
6833
+ const applyClipboardHandlersPaste = (handlers, copiedData, target, options) => {
6834
+ handlers.forEach(({ handlerName, handler }) => {
6835
+ const data = copiedData[handlerName];
6836
+ if (data) {
6837
+ handler.paste(target, data, options);
6838
+ }
6839
+ });
6840
+ };
6841
+ /**
6842
+ * Returns the paste target based on clipboard handlers.
6843
+ * Also includes the full affected zone and the list of pasted zones for selection.
6844
+ */
6845
+ function getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options) {
6846
+ let zone = undefined;
6847
+ let selectedZones = [];
6848
+ let target = {
6849
+ sheetId,
6850
+ zones,
6851
+ };
6852
+ for (const { handlerName, handler } of handlers) {
6853
+ const handlerData = copiedData[handlerName];
6854
+ if (!handlerData) {
6855
+ continue;
6856
+ }
6857
+ const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
6858
+ if (currentTarget.figureId) {
6859
+ target.figureId = currentTarget.figureId;
6860
+ }
6861
+ for (const targetZone of currentTarget.zones) {
6862
+ selectedZones.push(targetZone);
6863
+ if (zone === undefined) {
6864
+ zone = targetZone;
6865
+ continue;
6866
+ }
6867
+ zone = union(zone, targetZone);
6868
+ }
6869
+ }
6870
+ return {
6871
+ target,
6872
+ zone,
6873
+ selectedZones,
6874
+ };
6875
+ }
6876
+ /**
6877
+ * Updates the selection after a paste operation.
6878
+ */
6879
+ const selectPastedZone = (selection, sourceZones, pastedZones) => {
6880
+ const anchorCell = {
6881
+ col: sourceZones[0].left,
6882
+ row: sourceZones[0].top,
6883
+ };
6884
+ selection.getBackToDefault();
6885
+ selection.selectZone({ cell: anchorCell, zone: union(...pastedZones) }, { scrollIntoView: false });
6886
+ };
6830
6887
 
6831
6888
  class ClipboardHandler {
6832
6889
  getters;
@@ -47107,7 +47164,7 @@ class SpreadsheetPivot {
47107
47164
  }
47108
47165
  getTypeFromZone(sheetId, zone) {
47109
47166
  const cells = this.getters.getEvaluatedCellsInZone(sheetId, zone);
47110
- const nonEmptyCells = cells.filter((cell) => cell.type !== CellValueType.empty);
47167
+ const nonEmptyCells = cells.filter((cell) => !(cell.type === CellValueType.empty || cell.value === ""));
47111
47168
  if (nonEmptyCells.length === 0) {
47112
47169
  return "integer";
47113
47170
  }
@@ -50657,15 +50714,16 @@ class GridAddRowsFooter extends owl.Component {
50657
50714
  }
50658
50715
  }
50659
50716
 
50717
+ const PAINT_FORMAT_HANDLER_KEYS = [
50718
+ "cell",
50719
+ "border",
50720
+ "table",
50721
+ "conditionalFormat",
50722
+ "merge",
50723
+ ];
50660
50724
  class PaintFormatStore extends SpreadsheetStore {
50661
50725
  mutators = ["activate", "cancel", "pasteFormat"];
50662
50726
  highlightStore = this.get(HighlightStore);
50663
- clipboardHandlers = [
50664
- new CellClipboardHandler(this.getters, this.model.dispatch),
50665
- new BorderClipboardHandler(this.getters, this.model.dispatch),
50666
- new TableClipboardHandler(this.getters, this.model.dispatch),
50667
- new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
50668
- ];
50669
50727
  status = "inactive";
50670
50728
  copiedData;
50671
50729
  constructor(get) {
@@ -50696,24 +50754,38 @@ class PaintFormatStore extends SpreadsheetStore {
50696
50754
  get isActive() {
50697
50755
  return this.status !== "inactive";
50698
50756
  }
50757
+ get clipboardHandlers() {
50758
+ return PAINT_FORMAT_HANDLER_KEYS.map((handlerName) => {
50759
+ const HandlerClass = clipboardHandlersRegistries.cellHandlers.get(handlerName);
50760
+ return {
50761
+ handlerName,
50762
+ handler: new HandlerClass(this.getters, this.model.dispatch),
50763
+ };
50764
+ });
50765
+ }
50699
50766
  copyFormats() {
50700
50767
  const sheetId = this.getters.getActiveSheetId();
50701
50768
  const zones = this.getters.getSelectedZones();
50702
- const copiedData = {};
50703
- for (const handler of this.clipboardHandlers) {
50704
- Object.assign(copiedData, handler.copy(getClipboardDataPositions(sheetId, zones)));
50769
+ const copiedData = { zones, sheetId };
50770
+ for (const { handlerName, handler } of this.clipboardHandlers) {
50771
+ const handlerResult = handler.copy(getClipboardDataPositions(sheetId, zones));
50772
+ if (handlerResult !== undefined) {
50773
+ copiedData[handlerName] = handlerResult;
50774
+ }
50705
50775
  }
50706
50776
  return copiedData;
50707
50777
  }
50708
50778
  paintFormat(sheetId, target) {
50709
- if (this.copiedData) {
50710
- for (const handler of this.clipboardHandlers) {
50711
- handler.paste({ zones: target, sheetId }, this.copiedData, {
50712
- isCutOperation: false,
50713
- pasteOption: "onlyFormat",
50714
- });
50715
- }
50779
+ if (!this.copiedData) {
50780
+ return;
50716
50781
  }
50782
+ const options = {
50783
+ isCutOperation: false,
50784
+ pasteOption: "onlyFormat",
50785
+ };
50786
+ const { target: pasteTarget, selectedZones } = getPasteTargetFromHandlers(sheetId, target, this.copiedData, this.clipboardHandlers, options);
50787
+ applyClipboardHandlersPaste(this.clipboardHandlers, this.copiedData, pasteTarget, options);
50788
+ selectPastedZone(this.model.selection, target, selectedZones);
50717
50789
  if (this.status === "oneOff") {
50718
50790
  this.cancel();
50719
50791
  }
@@ -56014,7 +56086,7 @@ class DataValidationPlugin extends CorePlugin {
56014
56086
  else if (newRule.criterion.type === "isValueInList") {
56015
56087
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
56016
56088
  }
56017
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
56089
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
56018
56090
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
56019
56091
  if (ruleIndex !== -1) {
56020
56092
  adaptedRules[ruleIndex] = newRule;
@@ -56024,9 +56096,12 @@ class DataValidationPlugin extends CorePlugin {
56024
56096
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
56025
56097
  }
56026
56098
  }
56027
- removeRangesFromRules(sheetId, ranges, rules) {
56099
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
56028
56100
  rules = deepCopy(rules);
56029
56101
  for (const rule of rules) {
56102
+ if (rule.id === editingRuleId) {
56103
+ continue; // Skip the rule being edited to preserve its place in the list
56104
+ }
56030
56105
  rule.ranges = this.getters.recomputeRanges(rule.ranges, ranges);
56031
56106
  }
56032
56107
  return rules.filter((rule) => rule.ranges.length > 0);
@@ -67784,49 +67859,17 @@ class ClipboardPlugin extends UIPlugin {
67784
67859
  if (!copiedData) {
67785
67860
  return;
67786
67861
  }
67787
- let zone = undefined;
67788
- let selectedZones = [];
67789
67862
  const sheetId = this.getters.getActiveSheetId();
67790
- let target = {
67791
- sheetId,
67792
- zones,
67793
- };
67794
67863
  const handlers = this.selectClipboardHandlers(copiedData);
67795
- for (const { handlerName, handler } of handlers) {
67796
- const handlerData = copiedData[handlerName];
67797
- if (!handlerData) {
67798
- continue;
67799
- }
67800
- const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
67801
- if (currentTarget.figureId) {
67802
- target.figureId = currentTarget.figureId;
67803
- }
67804
- for (const targetZone of currentTarget.zones) {
67805
- selectedZones.push(targetZone);
67806
- if (zone === undefined) {
67807
- zone = targetZone;
67808
- continue;
67809
- }
67810
- zone = union(zone, targetZone);
67811
- }
67812
- }
67864
+ const { target, zone, selectedZones } = getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options);
67813
67865
  if (zone !== undefined) {
67814
- this.addMissingDimensions(this.getters.getActiveSheetId(), zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67866
+ this.addMissingDimensions(sheetId, zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67815
67867
  }
67816
- handlers.forEach(({ handlerName, handler }) => {
67817
- const handlerData = copiedData[handlerName];
67818
- if (handlerData) {
67819
- handler.paste(target, handlerData, options);
67820
- }
67821
- });
67868
+ applyClipboardHandlersPaste(handlers, copiedData, target, options);
67822
67869
  if (!options?.selectTarget) {
67823
67870
  return;
67824
67871
  }
67825
- const selection = zones[0];
67826
- const col = selection.left;
67827
- const row = selection.top;
67828
- this.selection.getBackToDefault();
67829
- this.selection.selectZone({ cell: { col, row }, zone: union(...selectedZones) }, { scrollIntoView: false });
67872
+ selectPastedZone(this.selection, zones, selectedZones);
67830
67873
  }
67831
67874
  /**
67832
67875
  * Add columns and/or rows to ensure that col + width and row + height are still
@@ -77052,6 +77095,6 @@ exports.tokenColors = tokenColors;
77052
77095
  exports.tokenize = tokenize;
77053
77096
 
77054
77097
 
77055
- __info__.version = "18.2.18";
77056
- __info__.date = "2025-06-19T18:24:41.051Z";
77057
- __info__.hash = "024c134";
77098
+ __info__.version = "18.2.19";
77099
+ __info__.date = "2025-06-23T15:07:13.023Z";
77100
+ __info__.hash = "430d931";
@@ -1918,13 +1918,6 @@ declare class UIPlugin<State = any> extends BasePlugin<State, Command> {
1918
1918
  drawLayer(ctx: GridRenderingContext, layer: LayerName): void;
1919
1919
  }
1920
1920
 
1921
- type MinimalClipboardData = {
1922
- sheetId?: UID;
1923
- cells?: ClipboardCell[][];
1924
- zones?: Zone[];
1925
- figureId?: UID;
1926
- [key: string]: unknown;
1927
- };
1928
1921
  interface SpreadsheetClipboardData extends MinimalClipboardData {
1929
1922
  version?: number;
1930
1923
  clipboardId?: string;
@@ -2362,6 +2355,13 @@ type ClipboardPasteTarget = {
2362
2355
  zones: Zone[];
2363
2356
  figureId?: UID;
2364
2357
  };
2358
+ type MinimalClipboardData = {
2359
+ sheetId?: UID;
2360
+ cells?: ClipboardCell[][];
2361
+ zones?: Zone[];
2362
+ figureId?: UID;
2363
+ [key: string]: unknown;
2364
+ };
2365
2365
 
2366
2366
  /**
2367
2367
  * There are two kinds of commands: CoreCommands and LocalCommands
@@ -13500,4 +13500,4 @@ declare const chartHelpers: {
13500
13500
  WaterfallChart: typeof WaterfallChart;
13501
13501
  };
13502
13502
 
13503
- 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, 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, CoreViewPlugin, 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, 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 };
13503
+ 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, 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, CoreViewPlugin, 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, 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.2.18
6
- * @date 2025-06-19T18:24:41.051Z
7
- * @hash 024c134
5
+ * @version 18.2.19
6
+ * @date 2025-06-23T15:07:13.023Z
7
+ * @hash 430d931
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';
@@ -6825,6 +6825,63 @@ function parseOSClipboardContent(content) {
6825
6825
  data: spreadsheetContent,
6826
6826
  };
6827
6827
  }
6828
+ /**
6829
+ * Applies each clipboard handler to paste its corresponding data into the target.
6830
+ */
6831
+ const applyClipboardHandlersPaste = (handlers, copiedData, target, options) => {
6832
+ handlers.forEach(({ handlerName, handler }) => {
6833
+ const data = copiedData[handlerName];
6834
+ if (data) {
6835
+ handler.paste(target, data, options);
6836
+ }
6837
+ });
6838
+ };
6839
+ /**
6840
+ * Returns the paste target based on clipboard handlers.
6841
+ * Also includes the full affected zone and the list of pasted zones for selection.
6842
+ */
6843
+ function getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options) {
6844
+ let zone = undefined;
6845
+ let selectedZones = [];
6846
+ let target = {
6847
+ sheetId,
6848
+ zones,
6849
+ };
6850
+ for (const { handlerName, handler } of handlers) {
6851
+ const handlerData = copiedData[handlerName];
6852
+ if (!handlerData) {
6853
+ continue;
6854
+ }
6855
+ const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
6856
+ if (currentTarget.figureId) {
6857
+ target.figureId = currentTarget.figureId;
6858
+ }
6859
+ for (const targetZone of currentTarget.zones) {
6860
+ selectedZones.push(targetZone);
6861
+ if (zone === undefined) {
6862
+ zone = targetZone;
6863
+ continue;
6864
+ }
6865
+ zone = union(zone, targetZone);
6866
+ }
6867
+ }
6868
+ return {
6869
+ target,
6870
+ zone,
6871
+ selectedZones,
6872
+ };
6873
+ }
6874
+ /**
6875
+ * Updates the selection after a paste operation.
6876
+ */
6877
+ const selectPastedZone = (selection, sourceZones, pastedZones) => {
6878
+ const anchorCell = {
6879
+ col: sourceZones[0].left,
6880
+ row: sourceZones[0].top,
6881
+ };
6882
+ selection.getBackToDefault();
6883
+ selection.selectZone({ cell: anchorCell, zone: union(...pastedZones) }, { scrollIntoView: false });
6884
+ };
6828
6885
 
6829
6886
  class ClipboardHandler {
6830
6887
  getters;
@@ -47105,7 +47162,7 @@ class SpreadsheetPivot {
47105
47162
  }
47106
47163
  getTypeFromZone(sheetId, zone) {
47107
47164
  const cells = this.getters.getEvaluatedCellsInZone(sheetId, zone);
47108
- const nonEmptyCells = cells.filter((cell) => cell.type !== CellValueType.empty);
47165
+ const nonEmptyCells = cells.filter((cell) => !(cell.type === CellValueType.empty || cell.value === ""));
47109
47166
  if (nonEmptyCells.length === 0) {
47110
47167
  return "integer";
47111
47168
  }
@@ -50655,15 +50712,16 @@ class GridAddRowsFooter extends Component {
50655
50712
  }
50656
50713
  }
50657
50714
 
50715
+ const PAINT_FORMAT_HANDLER_KEYS = [
50716
+ "cell",
50717
+ "border",
50718
+ "table",
50719
+ "conditionalFormat",
50720
+ "merge",
50721
+ ];
50658
50722
  class PaintFormatStore extends SpreadsheetStore {
50659
50723
  mutators = ["activate", "cancel", "pasteFormat"];
50660
50724
  highlightStore = this.get(HighlightStore);
50661
- clipboardHandlers = [
50662
- new CellClipboardHandler(this.getters, this.model.dispatch),
50663
- new BorderClipboardHandler(this.getters, this.model.dispatch),
50664
- new TableClipboardHandler(this.getters, this.model.dispatch),
50665
- new ConditionalFormatClipboardHandler(this.getters, this.model.dispatch),
50666
- ];
50667
50725
  status = "inactive";
50668
50726
  copiedData;
50669
50727
  constructor(get) {
@@ -50694,24 +50752,38 @@ class PaintFormatStore extends SpreadsheetStore {
50694
50752
  get isActive() {
50695
50753
  return this.status !== "inactive";
50696
50754
  }
50755
+ get clipboardHandlers() {
50756
+ return PAINT_FORMAT_HANDLER_KEYS.map((handlerName) => {
50757
+ const HandlerClass = clipboardHandlersRegistries.cellHandlers.get(handlerName);
50758
+ return {
50759
+ handlerName,
50760
+ handler: new HandlerClass(this.getters, this.model.dispatch),
50761
+ };
50762
+ });
50763
+ }
50697
50764
  copyFormats() {
50698
50765
  const sheetId = this.getters.getActiveSheetId();
50699
50766
  const zones = this.getters.getSelectedZones();
50700
- const copiedData = {};
50701
- for (const handler of this.clipboardHandlers) {
50702
- Object.assign(copiedData, handler.copy(getClipboardDataPositions(sheetId, zones)));
50767
+ const copiedData = { zones, sheetId };
50768
+ for (const { handlerName, handler } of this.clipboardHandlers) {
50769
+ const handlerResult = handler.copy(getClipboardDataPositions(sheetId, zones));
50770
+ if (handlerResult !== undefined) {
50771
+ copiedData[handlerName] = handlerResult;
50772
+ }
50703
50773
  }
50704
50774
  return copiedData;
50705
50775
  }
50706
50776
  paintFormat(sheetId, target) {
50707
- if (this.copiedData) {
50708
- for (const handler of this.clipboardHandlers) {
50709
- handler.paste({ zones: target, sheetId }, this.copiedData, {
50710
- isCutOperation: false,
50711
- pasteOption: "onlyFormat",
50712
- });
50713
- }
50777
+ if (!this.copiedData) {
50778
+ return;
50714
50779
  }
50780
+ const options = {
50781
+ isCutOperation: false,
50782
+ pasteOption: "onlyFormat",
50783
+ };
50784
+ const { target: pasteTarget, selectedZones } = getPasteTargetFromHandlers(sheetId, target, this.copiedData, this.clipboardHandlers, options);
50785
+ applyClipboardHandlersPaste(this.clipboardHandlers, this.copiedData, pasteTarget, options);
50786
+ selectPastedZone(this.model.selection, target, selectedZones);
50715
50787
  if (this.status === "oneOff") {
50716
50788
  this.cancel();
50717
50789
  }
@@ -56012,7 +56084,7 @@ class DataValidationPlugin extends CorePlugin {
56012
56084
  else if (newRule.criterion.type === "isValueInList") {
56013
56085
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
56014
56086
  }
56015
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
56087
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
56016
56088
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
56017
56089
  if (ruleIndex !== -1) {
56018
56090
  adaptedRules[ruleIndex] = newRule;
@@ -56022,9 +56094,12 @@ class DataValidationPlugin extends CorePlugin {
56022
56094
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
56023
56095
  }
56024
56096
  }
56025
- removeRangesFromRules(sheetId, ranges, rules) {
56097
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
56026
56098
  rules = deepCopy(rules);
56027
56099
  for (const rule of rules) {
56100
+ if (rule.id === editingRuleId) {
56101
+ continue; // Skip the rule being edited to preserve its place in the list
56102
+ }
56028
56103
  rule.ranges = this.getters.recomputeRanges(rule.ranges, ranges);
56029
56104
  }
56030
56105
  return rules.filter((rule) => rule.ranges.length > 0);
@@ -67782,49 +67857,17 @@ class ClipboardPlugin extends UIPlugin {
67782
67857
  if (!copiedData) {
67783
67858
  return;
67784
67859
  }
67785
- let zone = undefined;
67786
- let selectedZones = [];
67787
67860
  const sheetId = this.getters.getActiveSheetId();
67788
- let target = {
67789
- sheetId,
67790
- zones,
67791
- };
67792
67861
  const handlers = this.selectClipboardHandlers(copiedData);
67793
- for (const { handlerName, handler } of handlers) {
67794
- const handlerData = copiedData[handlerName];
67795
- if (!handlerData) {
67796
- continue;
67797
- }
67798
- const currentTarget = handler.getPasteTarget(sheetId, zones, handlerData, options);
67799
- if (currentTarget.figureId) {
67800
- target.figureId = currentTarget.figureId;
67801
- }
67802
- for (const targetZone of currentTarget.zones) {
67803
- selectedZones.push(targetZone);
67804
- if (zone === undefined) {
67805
- zone = targetZone;
67806
- continue;
67807
- }
67808
- zone = union(zone, targetZone);
67809
- }
67810
- }
67862
+ const { target, zone, selectedZones } = getPasteTargetFromHandlers(sheetId, zones, copiedData, handlers, options);
67811
67863
  if (zone !== undefined) {
67812
- this.addMissingDimensions(this.getters.getActiveSheetId(), zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67864
+ this.addMissingDimensions(sheetId, zone.right - zone.left + 1, zone.bottom - zone.top + 1, zone.left, zone.top);
67813
67865
  }
67814
- handlers.forEach(({ handlerName, handler }) => {
67815
- const handlerData = copiedData[handlerName];
67816
- if (handlerData) {
67817
- handler.paste(target, handlerData, options);
67818
- }
67819
- });
67866
+ applyClipboardHandlersPaste(handlers, copiedData, target, options);
67820
67867
  if (!options?.selectTarget) {
67821
67868
  return;
67822
67869
  }
67823
- const selection = zones[0];
67824
- const col = selection.left;
67825
- const row = selection.top;
67826
- this.selection.getBackToDefault();
67827
- this.selection.selectZone({ cell: { col, row }, zone: union(...selectedZones) }, { scrollIntoView: false });
67870
+ selectPastedZone(this.selection, zones, selectedZones);
67828
67871
  }
67829
67872
  /**
67830
67873
  * Add columns and/or rows to ensure that col + width and row + height are still
@@ -77005,6 +77048,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
77005
77048
  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 };
77006
77049
 
77007
77050
 
77008
- __info__.version = "18.2.18";
77009
- __info__.date = "2025-06-19T18:24:41.051Z";
77010
- __info__.hash = "024c134";
77051
+ __info__.version = "18.2.19";
77052
+ __info__.date = "2025-06-23T15:07:13.023Z";
77053
+ __info__.hash = "430d931";