@odoo/o-spreadsheet 18.4.0-alpha.8 → 18.4.0-alpha.9

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.
@@ -4138,12 +4138,14 @@ type IsCheckboxCriterion = {
4138
4138
  type IsValueInListCriterion = {
4139
4139
  type: "isValueInList";
4140
4140
  values: string[];
4141
- displayStyle: "arrow" | "plainText";
4141
+ colors?: Record<string, Color | undefined>;
4142
+ displayStyle: "arrow" | "plainText" | "chip";
4142
4143
  };
4143
4144
  type IsValueInRangeCriterion = {
4144
4145
  type: "isValueInRange";
4145
4146
  values: string[];
4146
- displayStyle: "arrow" | "plainText";
4147
+ colors?: Record<string, Color | undefined>;
4148
+ displayStyle: "arrow" | "plainText" | "chip";
4147
4149
  };
4148
4150
  type CustomFormulaCriterion = {
4149
4151
  type: "customFormula";
@@ -5541,10 +5543,12 @@ type SheetValidationResult = {
5541
5543
  [col: HeaderIndex]: Array<Lazy<ValidationResult>>;
5542
5544
  };
5543
5545
  declare class EvaluationDataValidationPlugin extends CoreViewPlugin {
5544
- static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
5546
+ static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "getDataValidationRangeValues", "isCellValidCheckbox", "getDataValidationCellStyle", "getDataValidationChipStyle", "isDataValidationInvalid"];
5545
5547
  validationResults: Record<UID, SheetValidationResult>;
5546
5548
  handle(cmd: CoreViewCommand): void;
5547
5549
  isDataValidationInvalid(cellPosition: CellPosition): boolean;
5550
+ getDataValidationCellStyle(position: CellPosition): Style | undefined;
5551
+ getDataValidationChipStyle(position: CellPosition): Style | undefined;
5548
5552
  getInvalidDataValidationMessage(cellPosition: CellPosition): string | undefined;
5549
5553
  /**
5550
5554
  * Check if the value is valid for the given criterion, and return an error message if not.
@@ -5552,9 +5556,13 @@ declare class EvaluationDataValidationPlugin extends CoreViewPlugin {
5552
5556
  * The value must be canonicalized.
5553
5557
  */
5554
5558
  getDataValidationInvalidCriterionValueMessage(criterionType: DataValidationCriterionType, value: string): string | undefined;
5559
+ getDataValidationRangeValues(sheetId: UID, criterion: EvaluatedCriterion): string[];
5555
5560
  isCellValidCheckbox(cellPosition: CellPosition): boolean;
5556
5561
  /** Get the validation result if the cell on the given position had the given value */
5557
5562
  getValidationResultForCellValue(cellValue: CellValue, cellPosition: CellPosition): ValidationResult;
5563
+ private hasChip;
5564
+ private getDataValidationStyle;
5565
+ private getValueColor;
5558
5566
  private isValidFormula;
5559
5567
  private getValidationResultForCell;
5560
5568
  private computeSheetValidationResults;
@@ -6547,10 +6555,20 @@ interface BoxTextContent {
6547
6555
  textLines: string[];
6548
6556
  width: Pixel;
6549
6557
  align: Align;
6558
+ fontSizePx: number;
6559
+ x: Pixel;
6560
+ y: Pixel;
6550
6561
  }
6551
6562
  interface Box extends Rect {
6552
6563
  content?: BoxTextContent;
6553
6564
  style: Style;
6565
+ chip?: {
6566
+ x: number;
6567
+ y: number;
6568
+ width: Pixel;
6569
+ height: Pixel;
6570
+ color: Color;
6571
+ };
6554
6572
  dataBarFill?: DataBarFill;
6555
6573
  border?: Border$1;
6556
6574
  clipRect?: Rect;
@@ -8346,6 +8364,7 @@ declare class TextValueProvider extends Component<Props$W> {
8346
8364
  };
8347
8365
  private autoCompleteListRef;
8348
8366
  setup(): void;
8367
+ getCss(html: HtmlContent): string;
8349
8368
  }
8350
8369
 
8351
8370
  declare class ContentEditableHelper {
@@ -8599,6 +8618,7 @@ type HtmlContent = {
8599
8618
  onHover?: (rect: Rect) => void;
8600
8619
  onStopHover?: () => void;
8601
8620
  color?: Color;
8621
+ backgroundColor?: Color;
8602
8622
  classes?: string[];
8603
8623
  };
8604
8624
  interface CellComposerProps {
@@ -9256,6 +9276,7 @@ declare class Menu extends Component<MenuProps, SpreadsheetChildEnv> {
9256
9276
  get menuStyle(): string;
9257
9277
  onMouseEnter(menu: Action, ev: PointerEvent): void;
9258
9278
  onMouseLeave(menu: Action, ev: PointerEvent): void;
9279
+ onClickMenu(menu: Action, ev: CustomEvent): void;
9259
9280
  }
9260
9281
 
9261
9282
  interface Props$N {
@@ -9548,6 +9569,7 @@ declare class GridComposer extends Component<Props$I, SpreadsheetChildEnv> {
9548
9569
  private rect;
9549
9570
  private isEditing;
9550
9571
  private isCellReferenceVisible;
9572
+ private currentEditedCell;
9551
9573
  private composerStore;
9552
9574
  composerFocusStore: Store<ComposerFocusStore>;
9553
9575
  private composerInterface;