@odoo/o-spreadsheet 17.4.30 → 17.4.32

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 17.4.30
6
- * @date 2025-04-14T17:17:01.767Z
7
- * @hash e4cf37d
5
+ * @version 17.4.32
6
+ * @date 2025-04-25T08:06:59.937Z
7
+ * @hash c370ddf
8
8
  */
9
9
 
10
10
  'use strict';
@@ -5828,6 +5828,12 @@ function tokenizeString(chars) {
5828
5828
  }
5829
5829
  return null;
5830
5830
  }
5831
+ /**
5832
+ - \p{L} is for any letter (from any language)
5833
+ - \p{N} is for any number
5834
+ - the u flag at the end is for unicode, which enables the `\p{...}` syntax
5835
+ */
5836
+ const unicodeSymbolCharRegexp = /\p{L}|\p{N}|_|\.|!|\$/u;
5831
5837
  const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
5832
5838
  /**
5833
5839
  * A "Symbol" is just basically any word-like element that can appear in a
@@ -5868,7 +5874,8 @@ function tokenizeSymbol(chars) {
5868
5874
  };
5869
5875
  }
5870
5876
  }
5871
- while (chars.current && SYMBOL_CHARS.has(chars.current)) {
5877
+ while (chars.current &&
5878
+ (SYMBOL_CHARS.has(chars.current) || chars.current.match(unicodeSymbolCharRegexp))) {
5872
5879
  result += chars.shift();
5873
5880
  }
5874
5881
  if (result.length) {
@@ -7555,7 +7562,7 @@ function transformZone(zone, executed) {
7555
7562
  if (executed.type === "ADD_COLUMNS_ROWS") {
7556
7563
  return expandZoneOnInsertion(zone, executed.dimension === "COL" ? "left" : "top", executed.base, executed.position, executed.quantity);
7557
7564
  }
7558
- return { ...zone };
7565
+ return zone;
7559
7566
  }
7560
7567
  function transformRangeData(range, executed) {
7561
7568
  const deletedSheet = executed.type === "DELETE_SHEET" && executed.sheetId;
@@ -10940,9 +10947,11 @@ const GAUGE_TITLE_PADDING_LEFT = DEFAULT_CHART_PADDING;
10940
10947
  const GAUGE_TITLE_PADDING_TOP = DEFAULT_CHART_PADDING;
10941
10948
  function drawGaugeChart(canvas, runtime) {
10942
10949
  const canvasBoundingRect = canvas.getBoundingClientRect();
10943
- canvas.width = canvasBoundingRect.width;
10944
- canvas.height = canvasBoundingRect.height;
10950
+ const dpr = window.devicePixelRatio || 1;
10951
+ canvas.width = dpr * canvasBoundingRect.width;
10952
+ canvas.height = dpr * canvasBoundingRect.height;
10945
10953
  const ctx = canvas.getContext("2d");
10954
+ ctx.scale(dpr, dpr);
10946
10955
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
10947
10956
  drawBackground(ctx, config);
10948
10957
  drawGauge(ctx, config);
@@ -11499,9 +11508,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
11499
11508
  };
11500
11509
  function drawScoreChart(structure, canvas) {
11501
11510
  const ctx = canvas.getContext("2d");
11502
- canvas.width = structure.canvas.width;
11503
- const availableWidth = canvas.width - DEFAULT_CHART_PADDING;
11504
- canvas.height = structure.canvas.height;
11511
+ const dpr = window.devicePixelRatio || 1;
11512
+ canvas.width = dpr * structure.canvas.width;
11513
+ canvas.height = dpr * structure.canvas.height;
11514
+ ctx.scale(dpr, dpr);
11515
+ const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
11505
11516
  ctx.fillStyle = structure.canvas.backgroundColor;
11506
11517
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
11507
11518
  if (structure.title) {
@@ -12266,6 +12277,10 @@ class ChartJsComponent extends owl.Component {
12266
12277
  this.currentRuntime = runtime;
12267
12278
  }
12268
12279
  });
12280
+ owl.useEffect(() => {
12281
+ this.currentRuntime = this.chartRuntime;
12282
+ this.updateChartJs(deepCopy(this.currentRuntime));
12283
+ }, () => [window.devicePixelRatio]);
12269
12284
  }
12270
12285
  createChart(chartData) {
12271
12286
  const canvas = this.canvas.el;
@@ -12307,7 +12322,7 @@ class ScorecardChart extends owl.Component {
12307
12322
  owl.useEffect(this.createChart.bind(this), () => {
12308
12323
  const canvas = this.canvas.el;
12309
12324
  const rect = canvas.getBoundingClientRect();
12310
- return [rect.width, rect.height, this.runtime, this.canvas.el];
12325
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
12311
12326
  });
12312
12327
  }
12313
12328
  createChart() {
@@ -25196,7 +25211,7 @@ class GaugeChartComponent extends owl.Component {
25196
25211
  owl.useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
25197
25212
  const canvas = this.canvas.el;
25198
25213
  const rect = canvas.getBoundingClientRect();
25199
- return [rect.width, rect.height, this.runtime, this.canvas.el];
25214
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
25200
25215
  });
25201
25216
  }
25202
25217
  }
@@ -32362,7 +32377,7 @@ class ColorPicker extends owl.Component {
32362
32377
  }
32363
32378
  setHexColor(ev) {
32364
32379
  // only support HEX code input
32365
- const val = ev.target.value.slice(0, 7);
32380
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
32366
32381
  this.state.customHexColor = val;
32367
32382
  if (!isColorValid(val)) ;
32368
32383
  else {
@@ -57384,10 +57399,8 @@ function mergeTransformation(toTransform, executed) {
57384
57399
  }
57385
57400
  const target = [];
57386
57401
  for (const zone1 of toTransform.target) {
57387
- for (const zone2 of executed.target) {
57388
- if (!overlap(zone1, zone2)) {
57389
- target.push({ ...zone1 });
57390
- }
57402
+ if (executed.target.every((zone2) => !overlap(zone1, zone2))) {
57403
+ target.push(zone1);
57391
57404
  }
57392
57405
  }
57393
57406
  if (target.length) {
@@ -69376,6 +69389,6 @@ exports.tokenColors = tokenColors;
69376
69389
  exports.tokenize = tokenize;
69377
69390
 
69378
69391
 
69379
- __info__.version = "17.4.30";
69380
- __info__.date = "2025-04-14T17:17:01.767Z";
69381
- __info__.hash = "e4cf37d";
69392
+ __info__.version = "17.4.32";
69393
+ __info__.date = "2025-04-25T08:06:59.937Z";
69394
+ __info__.hash = "c370ddf";
@@ -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 17.4.30
6
- * @date 2025-04-14T17:17:01.767Z
7
- * @hash e4cf37d
5
+ * @version 17.4.32
6
+ * @date 2025-04-25T08:06:59.937Z
7
+ * @hash c370ddf
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';
@@ -5826,6 +5826,12 @@ function tokenizeString(chars) {
5826
5826
  }
5827
5827
  return null;
5828
5828
  }
5829
+ /**
5830
+ - \p{L} is for any letter (from any language)
5831
+ - \p{N} is for any number
5832
+ - the u flag at the end is for unicode, which enables the `\p{...}` syntax
5833
+ */
5834
+ const unicodeSymbolCharRegexp = /\p{L}|\p{N}|_|\.|!|\$/u;
5829
5835
  const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
5830
5836
  /**
5831
5837
  * A "Symbol" is just basically any word-like element that can appear in a
@@ -5866,7 +5872,8 @@ function tokenizeSymbol(chars) {
5866
5872
  };
5867
5873
  }
5868
5874
  }
5869
- while (chars.current && SYMBOL_CHARS.has(chars.current)) {
5875
+ while (chars.current &&
5876
+ (SYMBOL_CHARS.has(chars.current) || chars.current.match(unicodeSymbolCharRegexp))) {
5870
5877
  result += chars.shift();
5871
5878
  }
5872
5879
  if (result.length) {
@@ -7553,7 +7560,7 @@ function transformZone(zone, executed) {
7553
7560
  if (executed.type === "ADD_COLUMNS_ROWS") {
7554
7561
  return expandZoneOnInsertion(zone, executed.dimension === "COL" ? "left" : "top", executed.base, executed.position, executed.quantity);
7555
7562
  }
7556
- return { ...zone };
7563
+ return zone;
7557
7564
  }
7558
7565
  function transformRangeData(range, executed) {
7559
7566
  const deletedSheet = executed.type === "DELETE_SHEET" && executed.sheetId;
@@ -10938,9 +10945,11 @@ const GAUGE_TITLE_PADDING_LEFT = DEFAULT_CHART_PADDING;
10938
10945
  const GAUGE_TITLE_PADDING_TOP = DEFAULT_CHART_PADDING;
10939
10946
  function drawGaugeChart(canvas, runtime) {
10940
10947
  const canvasBoundingRect = canvas.getBoundingClientRect();
10941
- canvas.width = canvasBoundingRect.width;
10942
- canvas.height = canvasBoundingRect.height;
10948
+ const dpr = window.devicePixelRatio || 1;
10949
+ canvas.width = dpr * canvasBoundingRect.width;
10950
+ canvas.height = dpr * canvasBoundingRect.height;
10943
10951
  const ctx = canvas.getContext("2d");
10952
+ ctx.scale(dpr, dpr);
10944
10953
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
10945
10954
  drawBackground(ctx, config);
10946
10955
  drawGauge(ctx, config);
@@ -11497,9 +11506,11 @@ let ScorecardChart$1 = class ScorecardChart extends AbstractChart {
11497
11506
  };
11498
11507
  function drawScoreChart(structure, canvas) {
11499
11508
  const ctx = canvas.getContext("2d");
11500
- canvas.width = structure.canvas.width;
11501
- const availableWidth = canvas.width - DEFAULT_CHART_PADDING;
11502
- canvas.height = structure.canvas.height;
11509
+ const dpr = window.devicePixelRatio || 1;
11510
+ canvas.width = dpr * structure.canvas.width;
11511
+ canvas.height = dpr * structure.canvas.height;
11512
+ ctx.scale(dpr, dpr);
11513
+ const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
11503
11514
  ctx.fillStyle = structure.canvas.backgroundColor;
11504
11515
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
11505
11516
  if (structure.title) {
@@ -12264,6 +12275,10 @@ class ChartJsComponent extends Component {
12264
12275
  this.currentRuntime = runtime;
12265
12276
  }
12266
12277
  });
12278
+ useEffect(() => {
12279
+ this.currentRuntime = this.chartRuntime;
12280
+ this.updateChartJs(deepCopy(this.currentRuntime));
12281
+ }, () => [window.devicePixelRatio]);
12267
12282
  }
12268
12283
  createChart(chartData) {
12269
12284
  const canvas = this.canvas.el;
@@ -12305,7 +12320,7 @@ class ScorecardChart extends Component {
12305
12320
  useEffect(this.createChart.bind(this), () => {
12306
12321
  const canvas = this.canvas.el;
12307
12322
  const rect = canvas.getBoundingClientRect();
12308
- return [rect.width, rect.height, this.runtime, this.canvas.el];
12323
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
12309
12324
  });
12310
12325
  }
12311
12326
  createChart() {
@@ -25194,7 +25209,7 @@ class GaugeChartComponent extends Component {
25194
25209
  useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
25195
25210
  const canvas = this.canvas.el;
25196
25211
  const rect = canvas.getBoundingClientRect();
25197
- return [rect.width, rect.height, this.runtime, this.canvas.el];
25212
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
25198
25213
  });
25199
25214
  }
25200
25215
  }
@@ -32360,7 +32375,7 @@ class ColorPicker extends Component {
32360
32375
  }
32361
32376
  setHexColor(ev) {
32362
32377
  // only support HEX code input
32363
- const val = ev.target.value.slice(0, 7);
32378
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
32364
32379
  this.state.customHexColor = val;
32365
32380
  if (!isColorValid(val)) ;
32366
32381
  else {
@@ -57382,10 +57397,8 @@ function mergeTransformation(toTransform, executed) {
57382
57397
  }
57383
57398
  const target = [];
57384
57399
  for (const zone1 of toTransform.target) {
57385
- for (const zone2 of executed.target) {
57386
- if (!overlap(zone1, zone2)) {
57387
- target.push({ ...zone1 });
57388
- }
57400
+ if (executed.target.every((zone2) => !overlap(zone1, zone2))) {
57401
+ target.push(zone1);
57389
57402
  }
57390
57403
  }
57391
57404
  if (target.length) {
@@ -69331,6 +69344,6 @@ const constants = {
69331
69344
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
69332
69345
 
69333
69346
 
69334
- __info__.version = "17.4.30";
69335
- __info__.date = "2025-04-14T17:17:01.767Z";
69336
- __info__.hash = "e4cf37d";
69347
+ __info__.version = "17.4.32";
69348
+ __info__.date = "2025-04-25T08:06:59.937Z";
69349
+ __info__.hash = "c370ddf";
@@ -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 17.4.30
6
- * @date 2025-04-14T17:17:01.767Z
7
- * @hash e4cf37d
5
+ * @version 17.4.32
6
+ * @date 2025-04-25T08:06:59.937Z
7
+ * @hash c370ddf
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -5827,6 +5827,12 @@
5827
5827
  }
5828
5828
  return null;
5829
5829
  }
5830
+ /**
5831
+ - \p{L} is for any letter (from any language)
5832
+ - \p{N} is for any number
5833
+ - the u flag at the end is for unicode, which enables the `\p{...}` syntax
5834
+ */
5835
+ const unicodeSymbolCharRegexp = /\p{L}|\p{N}|_|\.|!|\$/u;
5830
5836
  const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
5831
5837
  /**
5832
5838
  * A "Symbol" is just basically any word-like element that can appear in a
@@ -5867,7 +5873,8 @@
5867
5873
  };
5868
5874
  }
5869
5875
  }
5870
- while (chars.current && SYMBOL_CHARS.has(chars.current)) {
5876
+ while (chars.current &&
5877
+ (SYMBOL_CHARS.has(chars.current) || chars.current.match(unicodeSymbolCharRegexp))) {
5871
5878
  result += chars.shift();
5872
5879
  }
5873
5880
  if (result.length) {
@@ -7554,7 +7561,7 @@
7554
7561
  if (executed.type === "ADD_COLUMNS_ROWS") {
7555
7562
  return expandZoneOnInsertion(zone, executed.dimension === "COL" ? "left" : "top", executed.base, executed.position, executed.quantity);
7556
7563
  }
7557
- return { ...zone };
7564
+ return zone;
7558
7565
  }
7559
7566
  function transformRangeData(range, executed) {
7560
7567
  const deletedSheet = executed.type === "DELETE_SHEET" && executed.sheetId;
@@ -10939,9 +10946,11 @@ stores.inject(MyMetaStore, storeInstance);
10939
10946
  const GAUGE_TITLE_PADDING_TOP = DEFAULT_CHART_PADDING;
10940
10947
  function drawGaugeChart(canvas, runtime) {
10941
10948
  const canvasBoundingRect = canvas.getBoundingClientRect();
10942
- canvas.width = canvasBoundingRect.width;
10943
- canvas.height = canvasBoundingRect.height;
10949
+ const dpr = window.devicePixelRatio || 1;
10950
+ canvas.width = dpr * canvasBoundingRect.width;
10951
+ canvas.height = dpr * canvasBoundingRect.height;
10944
10952
  const ctx = canvas.getContext("2d");
10953
+ ctx.scale(dpr, dpr);
10945
10954
  const config = getGaugeRenderingConfig(canvasBoundingRect, runtime, ctx);
10946
10955
  drawBackground(ctx, config);
10947
10956
  drawGauge(ctx, config);
@@ -11498,9 +11507,11 @@ stores.inject(MyMetaStore, storeInstance);
11498
11507
  };
11499
11508
  function drawScoreChart(structure, canvas) {
11500
11509
  const ctx = canvas.getContext("2d");
11501
- canvas.width = structure.canvas.width;
11502
- const availableWidth = canvas.width - DEFAULT_CHART_PADDING;
11503
- canvas.height = structure.canvas.height;
11510
+ const dpr = window.devicePixelRatio || 1;
11511
+ canvas.width = dpr * structure.canvas.width;
11512
+ canvas.height = dpr * structure.canvas.height;
11513
+ ctx.scale(dpr, dpr);
11514
+ const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
11504
11515
  ctx.fillStyle = structure.canvas.backgroundColor;
11505
11516
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
11506
11517
  if (structure.title) {
@@ -12265,6 +12276,10 @@ stores.inject(MyMetaStore, storeInstance);
12265
12276
  this.currentRuntime = runtime;
12266
12277
  }
12267
12278
  });
12279
+ owl.useEffect(() => {
12280
+ this.currentRuntime = this.chartRuntime;
12281
+ this.updateChartJs(deepCopy(this.currentRuntime));
12282
+ }, () => [window.devicePixelRatio]);
12268
12283
  }
12269
12284
  createChart(chartData) {
12270
12285
  const canvas = this.canvas.el;
@@ -12306,7 +12321,7 @@ stores.inject(MyMetaStore, storeInstance);
12306
12321
  owl.useEffect(this.createChart.bind(this), () => {
12307
12322
  const canvas = this.canvas.el;
12308
12323
  const rect = canvas.getBoundingClientRect();
12309
- return [rect.width, rect.height, this.runtime, this.canvas.el];
12324
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
12310
12325
  });
12311
12326
  }
12312
12327
  createChart() {
@@ -25195,7 +25210,7 @@ stores.inject(MyMetaStore, storeInstance);
25195
25210
  owl.useEffect(() => drawGaugeChart(this.canvas.el, this.runtime), () => {
25196
25211
  const canvas = this.canvas.el;
25197
25212
  const rect = canvas.getBoundingClientRect();
25198
- return [rect.width, rect.height, this.runtime, this.canvas.el];
25213
+ return [rect.width, rect.height, this.runtime, this.canvas.el, window.devicePixelRatio];
25199
25214
  });
25200
25215
  }
25201
25216
  }
@@ -32361,7 +32376,7 @@ stores.inject(MyMetaStore, storeInstance);
32361
32376
  }
32362
32377
  setHexColor(ev) {
32363
32378
  // only support HEX code input
32364
- const val = ev.target.value.slice(0, 7);
32379
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
32365
32380
  this.state.customHexColor = val;
32366
32381
  if (!isColorValid(val)) ;
32367
32382
  else {
@@ -57383,10 +57398,8 @@ stores.inject(MyMetaStore, storeInstance);
57383
57398
  }
57384
57399
  const target = [];
57385
57400
  for (const zone1 of toTransform.target) {
57386
- for (const zone2 of executed.target) {
57387
- if (!overlap(zone1, zone2)) {
57388
- target.push({ ...zone1 });
57389
- }
57401
+ if (executed.target.every((zone2) => !overlap(zone1, zone2))) {
57402
+ target.push(zone1);
57390
57403
  }
57391
57404
  }
57392
57405
  if (target.length) {
@@ -69375,9 +69388,9 @@ stores.inject(MyMetaStore, storeInstance);
69375
69388
  exports.tokenize = tokenize;
69376
69389
 
69377
69390
 
69378
- __info__.version = "17.4.30";
69379
- __info__.date = "2025-04-14T17:17:01.767Z";
69380
- __info__.hash = "e4cf37d";
69391
+ __info__.version = "17.4.32";
69392
+ __info__.date = "2025-04-25T08:06:59.937Z";
69393
+ __info__.hash = "c370ddf";
69381
69394
 
69382
69395
 
69383
69396
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);