@odoo/o-spreadsheet 19.5.0-alpha.0 → 19.5.0-alpha.2

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.
@@ -1,9 +1,9 @@
1
1
  <!--
2
2
  This file is generated by o-spreadsheet build tools. Do not edit it.
3
3
  @see https://github.com/odoo/o-spreadsheet
4
- @version 19.5.0-alpha.0
5
- @date 2026-06-29T09:01:27.380Z
6
- @hash 2437c0b
4
+ @version 19.5.0-alpha.2
5
+ @date 2026-07-13T06:26:21.365Z
6
+ @hash a4d2f90
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ValidationMessages">
@@ -2227,19 +2227,33 @@
2227
2227
  </t>
2228
2228
 
2229
2229
  <t t-name="o-spreadsheet-DoubleInputCriterionForm">
2230
- <CriterionInput
2231
- value="this.props.criterion.values[0]"
2232
- onValueChanged.bind="this.onFirstValueChanged"
2233
- criterionType="this.props.criterion.type"
2234
- disableFormulas="this.props.disableFormulas"
2235
- focused="this.props.autofocus"
2236
- />
2237
- <CriterionInput
2238
- value="this.props.criterion.values[1]"
2239
- onValueChanged.bind="this.onSecondValueChanged"
2240
- criterionType="this.props.criterion.type"
2241
- disableFormulas="this.props.disableFormulas"
2242
- />
2230
+ <div class="d-flex align-items-center m-2">
2231
+ <CriterionInput
2232
+ value="this.props.criterion.values[0]"
2233
+ onValueChanged.bind="this.onFirstValueChanged"
2234
+ criterionType="this.props.criterion.type"
2235
+ disableFormulas="this.props.disableFormulas"
2236
+ focused="this.props.autofocus"
2237
+ />
2238
+ <CalendarButton
2239
+ t-if="this.isDateType"
2240
+ onChange.bind="this.onFirstValueChanged"
2241
+ value="this.props.criterion.values[0]"
2242
+ />
2243
+ </div>
2244
+ <div class="d-flex align-items-center m-2">
2245
+ <CriterionInput
2246
+ value="this.props.criterion.values[1]"
2247
+ onValueChanged.bind="this.onSecondValueChanged"
2248
+ criterionType="this.props.criterion.type"
2249
+ disableFormulas="this.props.disableFormulas"
2250
+ />
2251
+ <CalendarButton
2252
+ t-if="this.isDateType"
2253
+ onChange.bind="this.onSecondValueChanged"
2254
+ value="this.props.criterion.values[1]"
2255
+ />
2256
+ </div>
2243
2257
  </t>
2244
2258
 
2245
2259
  <t t-name="o-spreadsheet-DataValidationDateCriterion">
@@ -2249,15 +2263,16 @@
2249
2263
  selectedValue="this.currentDateValue"
2250
2264
  onChange.bind="this.onDateValueChanged"
2251
2265
  />
2252
-
2253
- <CriterionInput
2254
- t-if="this.currentDateValue === 'exactDate'"
2255
- value="this.props.criterion.values[0]"
2256
- onValueChanged.bind="this.onValueChanged"
2257
- criterionType="this.props.criterion.type"
2258
- disableFormulas="this.props.disableFormulas"
2259
- focused="this.props.autofocus"
2260
- />
2266
+ <div class="d-flex align-items-center" t-if="this.currentDateValue === 'exactDate'">
2267
+ <CriterionInput
2268
+ value="this.props.criterion.values[0]"
2269
+ onValueChanged.bind="this.onValueChanged"
2270
+ criterionType="this.props.criterion.type"
2271
+ disableFormulas="this.props.disableFormulas"
2272
+ focused="this.props.autofocus"
2273
+ />
2274
+ <CalendarButton onChange.bind="this.onValueChanged" value="this.props.criterion.values[0]"/>
2275
+ </div>
2261
2276
  </t>
2262
2277
 
2263
2278
  <t t-name="o-spreadsheet-CriterionInput">
@@ -2280,7 +2295,10 @@
2280
2295
  />
2281
2296
  </t>
2282
2297
  <t t-else="">
2283
- <StandaloneComposer t-props="this.getDataValidationRuleInputComposerProps()"/>
2298
+ <StandaloneComposer
2299
+ t-props="this.getDataValidationRuleInputComposerProps()"
2300
+ t-key="this.props.value"
2301
+ />
2284
2302
  </t>
2285
2303
  <span
2286
2304
  t-if="this.errorMessage"
@@ -2291,6 +2309,21 @@
2291
2309
  </div>
2292
2310
  </t>
2293
2311
 
2312
+ <t t-name="o-spreadsheet-CalendarButton">
2313
+ <div class="o-calendar-button ms-1">
2314
+ <button type="button" class="o-button btn" t-on-click="this.openCalendar">
2315
+ <i class="fa fa-calendar"/>
2316
+ </button>
2317
+ <input
2318
+ type="date"
2319
+ class="o-calendar-input"
2320
+ t-att-value="this.formatDateForInput(this.props.value)"
2321
+ t-ref="this.datePickerRef"
2322
+ t-on-change="(ev) => this.onDateInputValueChanged(ev.target.value)"
2323
+ />
2324
+ </div>
2325
+ </t>
2326
+
2294
2327
  <t t-name="o-spreadsheet-ConditionalFormatPreviewList">
2295
2328
  <div class="o-cf-preview-list h-100 overflow-auto" t-ref="this.cfListRef">
2296
2329
  <t t-foreach="this.conditionalFormats" t-as="cf" t-key="cf.id">
@@ -1,5 +1,6 @@
1
1
  import { Component } from "../../../../owl3_compatibility_layer";
2
2
  import { ScorecardChartRuntime } from "../../../../types/chart/scorecard_chart";
3
+ import { Rect } from "../../../../types/rendering";
3
4
  import { SpreadsheetChildEnv } from "../../../../types/spreadsheet_env";
4
5
  export declare class ScorecardChart extends Component<SpreadsheetChildEnv> {
5
6
  static template: string;
@@ -11,5 +12,6 @@ export declare class ScorecardChart extends Component<SpreadsheetChildEnv> {
11
12
  get runtime(): ScorecardChartRuntime;
12
13
  get title(): string;
13
14
  setup(): void;
15
+ config(canvasRect: Rect, zoom: number): import("../../../../helpers/figures/charts/scorecard_chart_config_builder").ScorecardChartConfig;
14
16
  private createChart;
15
17
  }
@@ -23,7 +23,7 @@ interface DndState {
23
23
  horizontalSnap?: Snap<HFigureAxisType>;
24
24
  verticalSnap?: Snap<VFigureAxisType>;
25
25
  cancelDnd: (() => void) | undefined;
26
- overlappingCarousel?: FigureUI;
26
+ overlappingChartOrCarousel?: FigureUI;
27
27
  }
28
28
  /**
29
29
  * Each figure ⭐ is positioned inside a container `div` placed and sized
@@ -119,6 +119,6 @@ export declare class FiguresContainer extends Component<SpreadsheetChildEnv> {
119
119
  getFigureClass(figureUI: FigureUI): string;
120
120
  private getSnap;
121
121
  private getSnapLineStyle;
122
- private getCarouselOverlappingChart;
122
+ private getOverlappingFigure;
123
123
  }
124
124
  export {};
@@ -0,0 +1,13 @@
1
+ import { Component } from "../../../../owl3_compatibility_layer";
2
+ import { SpreadsheetChildEnv } from "../../../../types/spreadsheet_env";
3
+ export declare class CalendarButton extends Component<SpreadsheetChildEnv> {
4
+ static template: string;
5
+ protected props: import("@odoo/owl").PropsWithDefaults<{
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ }, "value">;
9
+ datePickerRef: import("@odoo/owl").Signal<HTMLInputElement | null>;
10
+ openCalendar(): void;
11
+ formatDateForInput(value: string): "" | import("../../../..").FormattedValue;
12
+ onDateInputValueChanged(value: string): void;
13
+ }
@@ -1,6 +1,7 @@
1
1
  import { DateCriterionValue, GenericDateCriterion } from "../../../../types/generic_criterion";
2
2
  import { ValueAndLabel } from "../../../../types/misc";
3
3
  import { Select } from "../../../select/select";
4
+ import { CalendarButton } from "../calendar_button/calendar_button";
4
5
  import { CriterionForm } from "../criterion_form";
5
6
  import { CriterionInput } from "../criterion_input/criterion_input";
6
7
  export declare class DateCriterionForm extends CriterionForm<GenericDateCriterion> {
@@ -8,6 +9,7 @@ export declare class DateCriterionForm extends CriterionForm<GenericDateCriterio
8
9
  static components: {
9
10
  CriterionInput: typeof CriterionInput;
10
11
  Select: typeof Select;
12
+ CalendarButton: typeof CalendarButton;
11
13
  };
12
14
  get currentDateValue(): DateCriterionValue;
13
15
  onValueChanged(value: string): void;
@@ -1,10 +1,13 @@
1
+ import { CalendarButton } from "../calendar_button/calendar_button";
1
2
  import { CriterionForm } from "../criterion_form";
2
3
  import { CriterionInput } from "../criterion_input/criterion_input";
3
4
  export declare class DoubleInputCriterionForm extends CriterionForm {
4
5
  static template: string;
5
6
  static components: {
6
7
  CriterionInput: typeof CriterionInput;
8
+ CalendarButton: typeof CalendarButton;
7
9
  };
8
10
  onFirstValueChanged(value: string): void;
9
11
  onSecondValueChanged(value: string): void;
12
+ get isDateType(): boolean;
10
13
  }
@@ -95,6 +95,7 @@ export declare const DEFAULT_NUMBER_STYLE: {
95
95
  };
96
96
  export declare const DEFAULT_VERTICAL_ALIGN: "bottom";
97
97
  export declare const DEFAULT_WRAPPING_MODE: "overflow";
98
+ export declare const DEFAULT_TEXT_HIGHLIGHT_PERCENT = 0.25;
98
99
  export declare const DEFAULT_FONT_WEIGHT = "400";
99
100
  export declare const DEFAULT_FONT_SIZE: number;
100
101
  export declare const HEADER_FONT_SIZE = 11;
@@ -8,6 +8,7 @@ type ScorecardChartElement = {
8
8
  color: Color;
9
9
  strikethrough?: boolean;
10
10
  underline?: boolean;
11
+ highlightText?: boolean;
11
12
  };
12
13
  position: PixelPosition;
13
14
  };
@@ -23,6 +24,7 @@ export type ScorecardChartConfig = {
23
24
  style: {
24
25
  size: Pixel;
25
26
  color: Color;
27
+ highlight?: boolean;
26
28
  };
27
29
  position: PixelPosition;
28
30
  };
@@ -49,6 +49,7 @@ export declare class InternalViewport {
49
49
  willNewOffsetScrollViewport(offsetX: Pixel, offsetY: Pixel): boolean;
50
50
  setViewportOffset(offsetX: Pixel, offsetY: Pixel): void;
51
51
  adjustViewportZone(): void;
52
+ isZoneVisible(zone: Zone): boolean;
52
53
  /**
53
54
  *
54
55
  * Computes the visible coordinates & dimensions of a given zone inside the viewport
@@ -2,7 +2,7 @@ import { Registry } from "../../registries/registry";
2
2
  import { CellValue } from "../../types/cells";
3
3
  import { Locale } from "../../types/locale";
4
4
  import { CellPosition, FunctionResultObject, Matrix, Maybe } from "../../types/misc";
5
- import { Granularity, PivotCoreDefinition, PivotCoreDimension, PivotCoreMeasure, PivotCustomGroupedField, PivotDimension, PivotDomain, PivotField, PivotFields, PivotSortedColumn, PivotStyle, PivotTableCell } from "../../types/pivot";
5
+ import { PivotCoreDefinition, PivotCoreDimension, PivotCoreMeasure, PivotCustomGroupedField, PivotDimension, PivotDomain, PivotField, PivotFields, PivotSortedColumn, PivotStyle, PivotTableCell } from "../../types/pivot";
6
6
  import { Pivot } from "../../types/pivot_runtime";
7
7
  import { SpreadsheetChildEnv } from "../../types/spreadsheet_env";
8
8
  import { PivotRuntimeDefinition } from "./pivot_runtime_definition";
@@ -53,7 +53,7 @@ export declare function createPivotFormula(formulaId: string, cell: PivotTableCe
53
53
  */
54
54
  export declare function toNormalizedPivotValue(dimension: Pick<PivotDimension, "type" | "displayName" | "granularity">, groupValue: Maybe<CellValue | FunctionResultObject>): CellValue;
55
55
  export declare function toFunctionPivotValue(value: CellValue, dimension: Pick<PivotDimension, "type" | "granularity">): string;
56
- export declare const pivotNormalizationValueRegistry: Registry<(value: string, granularity?: Granularity | string) => CellValue>;
56
+ export declare const pivotNormalizationValueRegistry: Registry<(value: string, dimension: Pick<PivotDimension, "type" | "displayName" | "granularity">) => CellValue>;
57
57
  export declare const pivotToFunctionValueRegistry: Registry<(value: CellValue, granularity?: string) => string>;
58
58
  export declare function getFieldDisplayName(field: PivotDimension): string;
59
59
  export declare function addAlignFormatToPivotHeader(domain: PivotDomain, functionResult: FunctionResultObject): FunctionResultObject;
@@ -19,6 +19,10 @@ export declare function computeTextDimension(context: Canvas2DContext, text: str
19
19
  width: number;
20
20
  height: number;
21
21
  };
22
+ export declare function computeCachedTextDimension(context: Canvas2DContext, text: string, font: string): {
23
+ width: number;
24
+ height: number;
25
+ };
22
26
  export declare function fontSizeInPixels(fontSize: number): number;
23
27
  export declare function computeTextFont(style: Style, fontUnit?: "px" | "pt"): string;
24
28
  export declare function computeTextFontSizeInPixels(style?: Style): number;
@@ -38,7 +42,8 @@ export declare function getFontSizeMatchingWidth(lineWidth: number, maxFontSize:
38
42
  export declare function toTrimmedLowerCase(str: string | undefined): string;
39
43
  export declare function getContextFontSize(font: string): Pixel;
40
44
  export declare function clipTextWithEllipsis(ctx: Canvas2DContext, text: string, maxWidth: number): string;
41
- export declare function drawDecoratedText(context: Canvas2DContext, text: string, position: PixelPosition, underline?: boolean | undefined, strikethrough?: boolean | undefined, strokeWidth?: number): void;
45
+ export declare function drawDecoratedText(context: Canvas2DContext, text: string, position: PixelPosition, underline?: boolean | undefined, strikethrough?: boolean | undefined, strokeWidth?: number, //This value is defined to get a good looking stroke
46
+ highlightText?: boolean | undefined): void;
42
47
  export declare function sliceTextToFitWidth(context: Canvas2DContext, width: number, text: string, style: Style, fontUnit?: "px" | "pt"): string;
43
48
  /**
44
49
  * Return the position to draw text on a rotated canvas to ensure that the rotated text alignment correspond
@@ -94,6 +94,7 @@ export declare class ViewportCollection {
94
94
  * Check if a given position is visible in the viewport.
95
95
  */
96
96
  isVisibleInViewport({ sheetId, col, row }: CellPosition): boolean;
97
+ isZoneVisibleInViewport(sheetId: UID, zone: Zone): boolean;
97
98
  getScrollBarWidth(): Pixel;
98
99
  getEdgeScrollCol(sheetId: UID, x: number, previousX: number, startingX: number): EdgeScrollInfo;
99
100
  getEdgeScrollRow(sheetId: UID, y: number, previousY: number, startingY: number): EdgeScrollInfo;
@@ -55,8 +55,8 @@ import { openLink, urlRepresentation } from "./helpers/links";
55
55
  import { deepCopy, deepEquals, doesCellContainFunction, getCanonicalSymbolName, getUniqueText, isDefined, isFormula, isMarkdownLink, lazy, markdownLink, parseMarkdownLink, sanitizeSheetName, unquote } from "./helpers/misc";
56
56
  import { isNumber } from "./helpers/numbers";
57
57
  import { insertTokenAfterArgSeparator, insertTokenAfterLeftParenthesis, makeFieldProposal } from "./helpers/pivot/pivot_composer_helpers";
58
- import { splitReference } from "./helpers/references";
59
- import { computeTextWidth } from "./helpers/text_helper";
58
+ import { isSingleCellReference, splitReference } from "./helpers/references";
59
+ import { computeCachedTextDimension, computeTextWidth } from "./helpers/text_helper";
60
60
  import { UuidGenerator } from "./helpers/uuid";
61
61
  import { expandZoneOnInsertion, isInside, mergeContiguousZones, overlap, positionToZone, reduceZoneOnDeletion, toUnboundedZone, toZone, union } from "./helpers/zones";
62
62
  import { Component } from "./owl3_compatibility_layer";
@@ -198,7 +198,7 @@ export declare const registries: {
198
198
  pivotRegistry: import(".").Registry<import("./helpers/pivot/pivot_registry").PivotRegistryItem>;
199
199
  pivotTimeAdapterRegistry: import(".").Registry<import(".").PivotTimeAdapter<import(".").CellValue>>;
200
200
  pivotSidePanelRegistry: import(".").Registry<import("./helpers/pivot/pivot_side_panel_registry").PivotRegistryItem>;
201
- pivotNormalizationValueRegistry: import(".").Registry<(value: string, granularity?: import(".").Granularity | string) => import(".").CellValue>;
201
+ pivotNormalizationValueRegistry: import(".").Registry<(value: string, dimension: Pick<import(".").PivotDimension, "type" | "displayName" | "granularity">) => import(".").CellValue>;
202
202
  supportedPivotPositionalFormulaRegistry: import(".").Registry<boolean>;
203
203
  pivotToFunctionValueRegistry: import(".").Registry<(value: import(".").CellValue, granularity?: string) => string>;
204
204
  migrationStepRegistry: import(".").Registry<import("./migrations/migration_steps").MigrationStep>;
@@ -232,6 +232,7 @@ import { Composer } from "./components/composer/composer/composer";
232
232
  import { StandaloneComposer } from "./components/composer/standalone_composer/standalone_composer";
233
233
  import { Select } from "./components/select/select";
234
234
  import { ChartRangeDataSourceComponent } from "./components/side_panel/chart/building_blocks/range_data_source/range_data_source";
235
+ import { CalendarButton } from "./components/side_panel/criterion_form/calendar_button/calendar_button";
235
236
  import { TopBar } from "./components/top_bar/top_bar";
236
237
  import { parseFormat } from "./helpers/format/format_parser";
237
238
  import { replaceSymbolInFormula } from "./helpers/formulas";
@@ -313,6 +314,8 @@ export declare const helpers: {
313
314
  getCanonicalSymbolName: typeof getCanonicalSymbolName;
314
315
  fuzzyLookup: typeof fuzzyLookup;
315
316
  replaceSymbolInFormula: typeof replaceSymbolInFormula;
317
+ isSingleCellReference: typeof isSingleCellReference;
318
+ computeCachedTextDimension: typeof computeCachedTextDimension;
316
319
  };
317
320
  export declare const links: {
318
321
  isMarkdownLink: typeof isMarkdownLink;
@@ -383,6 +386,7 @@ export declare const components: {
383
386
  NumberInput: typeof NumberInput;
384
387
  TopBar: typeof TopBar;
385
388
  Composer: typeof Composer;
389
+ CalendarButton: typeof CalendarButton;
386
390
  };
387
391
  export declare const hooks: {
388
392
  useDragAndDropListItems: typeof useDragAndDropListItems;
@@ -22,10 +22,12 @@ export interface ScorecardChartRuntime {
22
22
  readonly title: TitleDesign;
23
23
  readonly keyValue: string;
24
24
  readonly keyDescr: string;
25
+ readonly keyHighlight?: boolean;
25
26
  readonly baselineDisplay: string;
26
27
  readonly baselineColor?: string;
27
28
  readonly baselineArrow: BaselineArrowDirection;
28
29
  readonly baselineDescr?: string;
30
+ readonly baselineHighlight?: boolean;
29
31
  readonly background: Color;
30
32
  readonly fontColor: Color;
31
33
  readonly keyValueStyle?: Style;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "19.5.0-alpha.0",
3
+ "version": "19.5.0-alpha.2",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o_spreadsheet.cjs",