@odoo/o-spreadsheet 17.2.25 → 17.2.26

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.
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.25
7
- * @date 2024-11-08T12:13:19.966Z
8
- * @hash 40d42f8
6
+ * @version 17.2.26
7
+ * @date 2024-11-13T15:04:03.710Z
8
+ * @hash 19b7478
9
9
  */
10
10
 
11
11
  'use strict';
@@ -19695,11 +19695,14 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
19695
19695
  function getChartLabelFormat(getters, range) {
19696
19696
  if (!range)
19697
19697
  return undefined;
19698
- return getters.getEvaluatedCell({
19699
- sheetId: range.sheetId,
19700
- col: range.zone.left,
19701
- row: range.zone.top,
19702
- }).format;
19698
+ const { sheetId, zone: { left, top, bottom }, } = range;
19699
+ for (let row = top; row <= bottom; row++) {
19700
+ const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
19701
+ if (format) {
19702
+ return format;
19703
+ }
19704
+ }
19705
+ return undefined;
19703
19706
  }
19704
19707
  function getChartLabelValues(getters, dataSets, labelRange) {
19705
19708
  let labels = { values: [], formattedValues: [] };
@@ -20415,11 +20418,7 @@ function canBeDateChart(labelRange, getters) {
20415
20418
  if (!labelRange || !canBeLinearChart(labelRange, getters)) {
20416
20419
  return false;
20417
20420
  }
20418
- const labelFormat = getters.getEvaluatedCell({
20419
- sheetId: labelRange.sheetId,
20420
- col: labelRange.zone.left,
20421
- row: labelRange.zone.top,
20422
- }).format;
20421
+ const labelFormat = getChartLabelFormat(getters, labelRange);
20423
20422
  return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
20424
20423
  }
20425
20424
  function canBeLinearChart(labelRange, getters) {
@@ -27218,6 +27217,7 @@ class ColorPicker extends owl.Component {
27218
27217
  currentColor: { type: String, optional: true },
27219
27218
  maxHeight: { type: Number, optional: true },
27220
27219
  anchorRect: Object,
27220
+ disableNoColor: { type: Boolean, optional: true },
27221
27221
  };
27222
27222
  static defaultProps = { currentColor: "" };
27223
27223
  static components = { Popover };
@@ -27401,6 +27401,7 @@ class ColorPickerWidget extends owl.Component {
27401
27401
  disabled: { type: Boolean, optional: true },
27402
27402
  dropdownMaxHeight: { type: Number, optional: true },
27403
27403
  class: { type: String, optional: true },
27404
+ disableNoColor: { type: Boolean, optional: true },
27404
27405
  };
27405
27406
  static components = { ColorPicker };
27406
27407
  colorPickerButtonRef = owl.useRef("colorPickerButton");
@@ -28959,6 +28960,9 @@ class ConditionalFormattingEditor extends owl.Component {
28959
28960
  }
28960
28961
  }
28961
28962
  setColorScaleColor(target, color) {
28963
+ if (!isColorValid(color)) {
28964
+ return;
28965
+ }
28962
28966
  const point = this.state.rules.colorScale[target];
28963
28967
  if (point) {
28964
28968
  point.color = Number.parseInt(color.substr(1), 16);
@@ -60969,6 +60973,6 @@ exports.tokenColors = tokenColors;
60969
60973
  exports.tokenize = tokenize;
60970
60974
 
60971
60975
 
60972
- __info__.version = "17.2.25";
60973
- __info__.date = "2024-11-08T12:13:19.966Z";
60974
- __info__.hash = "40d42f8";
60976
+ __info__.version = "17.2.26";
60977
+ __info__.date = "2024-11-13T15:04:03.710Z";
60978
+ __info__.hash = "19b7478";
@@ -5932,6 +5932,7 @@ interface ColorPickerProps {
5932
5932
  maxHeight?: Pixel;
5933
5933
  onColorPicked: (color: Color) => void;
5934
5934
  currentColor: Color;
5935
+ disableNoColor?: boolean;
5935
5936
  }
5936
5937
  declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEnv> {
5937
5938
  static template: string;
@@ -5946,6 +5947,10 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5946
5947
  optional: boolean;
5947
5948
  };
5948
5949
  anchorRect: ObjectConstructor;
5950
+ disableNoColor: {
5951
+ type: BooleanConstructor;
5952
+ optional: boolean;
5953
+ };
5949
5954
  };
5950
5955
  static defaultProps: {
5951
5956
  currentColor: string;
@@ -5986,6 +5991,7 @@ interface Props$I {
5986
5991
  disabled?: boolean;
5987
5992
  dropdownMaxHeight?: Pixel;
5988
5993
  class?: string;
5994
+ disableNoColor?: boolean;
5989
5995
  }
5990
5996
  declare class ColorPickerWidget extends Component<Props$I, SpreadsheetChildEnv> {
5991
5997
  static template: string;
@@ -6014,6 +6020,10 @@ declare class ColorPickerWidget extends Component<Props$I, SpreadsheetChildEnv>
6014
6020
  type: StringConstructor;
6015
6021
  optional: boolean;
6016
6022
  };
6023
+ disableNoColor: {
6024
+ type: BooleanConstructor;
6025
+ optional: boolean;
6026
+ };
6017
6027
  };
6018
6028
  static components: {
6019
6029
  ColorPicker: typeof ColorPicker;
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.25
7
- * @date 2024-11-08T12:13:19.966Z
8
- * @hash 40d42f8
6
+ * @version 17.2.26
7
+ * @date 2024-11-13T15:04:03.710Z
8
+ * @hash 19b7478
9
9
  */
10
10
 
11
11
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw } from '@odoo/owl';
@@ -19693,11 +19693,14 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
19693
19693
  function getChartLabelFormat(getters, range) {
19694
19694
  if (!range)
19695
19695
  return undefined;
19696
- return getters.getEvaluatedCell({
19697
- sheetId: range.sheetId,
19698
- col: range.zone.left,
19699
- row: range.zone.top,
19700
- }).format;
19696
+ const { sheetId, zone: { left, top, bottom }, } = range;
19697
+ for (let row = top; row <= bottom; row++) {
19698
+ const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
19699
+ if (format) {
19700
+ return format;
19701
+ }
19702
+ }
19703
+ return undefined;
19701
19704
  }
19702
19705
  function getChartLabelValues(getters, dataSets, labelRange) {
19703
19706
  let labels = { values: [], formattedValues: [] };
@@ -20413,11 +20416,7 @@ function canBeDateChart(labelRange, getters) {
20413
20416
  if (!labelRange || !canBeLinearChart(labelRange, getters)) {
20414
20417
  return false;
20415
20418
  }
20416
- const labelFormat = getters.getEvaluatedCell({
20417
- sheetId: labelRange.sheetId,
20418
- col: labelRange.zone.left,
20419
- row: labelRange.zone.top,
20420
- }).format;
20419
+ const labelFormat = getChartLabelFormat(getters, labelRange);
20421
20420
  return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
20422
20421
  }
20423
20422
  function canBeLinearChart(labelRange, getters) {
@@ -27216,6 +27215,7 @@ class ColorPicker extends Component {
27216
27215
  currentColor: { type: String, optional: true },
27217
27216
  maxHeight: { type: Number, optional: true },
27218
27217
  anchorRect: Object,
27218
+ disableNoColor: { type: Boolean, optional: true },
27219
27219
  };
27220
27220
  static defaultProps = { currentColor: "" };
27221
27221
  static components = { Popover };
@@ -27399,6 +27399,7 @@ class ColorPickerWidget extends Component {
27399
27399
  disabled: { type: Boolean, optional: true },
27400
27400
  dropdownMaxHeight: { type: Number, optional: true },
27401
27401
  class: { type: String, optional: true },
27402
+ disableNoColor: { type: Boolean, optional: true },
27402
27403
  };
27403
27404
  static components = { ColorPicker };
27404
27405
  colorPickerButtonRef = useRef("colorPickerButton");
@@ -28957,6 +28958,9 @@ class ConditionalFormattingEditor extends Component {
28957
28958
  }
28958
28959
  }
28959
28960
  setColorScaleColor(target, color) {
28961
+ if (!isColorValid(color)) {
28962
+ return;
28963
+ }
28960
28964
  const point = this.state.rules.colorScale[target];
28961
28965
  if (point) {
28962
28966
  point.color = Number.parseInt(color.substr(1), 16);
@@ -60926,6 +60930,6 @@ const constants = {
60926
60930
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, 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 };
60927
60931
 
60928
60932
 
60929
- __info__.version = "17.2.25";
60930
- __info__.date = "2024-11-08T12:13:19.966Z";
60931
- __info__.hash = "40d42f8";
60933
+ __info__.version = "17.2.26";
60934
+ __info__.date = "2024-11-13T15:04:03.710Z";
60935
+ __info__.hash = "19b7478";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.25
7
- * @date 2024-11-08T12:13:19.966Z
8
- * @hash 40d42f8
6
+ * @version 17.2.26
7
+ * @date 2024-11-13T15:04:03.710Z
8
+ * @hash 19b7478
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -19694,11 +19694,14 @@ stores.inject(MyMetaStore, storeInstance);
19694
19694
  function getChartLabelFormat(getters, range) {
19695
19695
  if (!range)
19696
19696
  return undefined;
19697
- return getters.getEvaluatedCell({
19698
- sheetId: range.sheetId,
19699
- col: range.zone.left,
19700
- row: range.zone.top,
19701
- }).format;
19697
+ const { sheetId, zone: { left, top, bottom }, } = range;
19698
+ for (let row = top; row <= bottom; row++) {
19699
+ const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
19700
+ if (format) {
19701
+ return format;
19702
+ }
19703
+ }
19704
+ return undefined;
19702
19705
  }
19703
19706
  function getChartLabelValues(getters, dataSets, labelRange) {
19704
19707
  let labels = { values: [], formattedValues: [] };
@@ -20414,11 +20417,7 @@ stores.inject(MyMetaStore, storeInstance);
20414
20417
  if (!labelRange || !canBeLinearChart(labelRange, getters)) {
20415
20418
  return false;
20416
20419
  }
20417
- const labelFormat = getters.getEvaluatedCell({
20418
- sheetId: labelRange.sheetId,
20419
- col: labelRange.zone.left,
20420
- row: labelRange.zone.top,
20421
- }).format;
20420
+ const labelFormat = getChartLabelFormat(getters, labelRange);
20422
20421
  return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
20423
20422
  }
20424
20423
  function canBeLinearChart(labelRange, getters) {
@@ -27217,6 +27216,7 @@ stores.inject(MyMetaStore, storeInstance);
27217
27216
  currentColor: { type: String, optional: true },
27218
27217
  maxHeight: { type: Number, optional: true },
27219
27218
  anchorRect: Object,
27219
+ disableNoColor: { type: Boolean, optional: true },
27220
27220
  };
27221
27221
  static defaultProps = { currentColor: "" };
27222
27222
  static components = { Popover };
@@ -27400,6 +27400,7 @@ stores.inject(MyMetaStore, storeInstance);
27400
27400
  disabled: { type: Boolean, optional: true },
27401
27401
  dropdownMaxHeight: { type: Number, optional: true },
27402
27402
  class: { type: String, optional: true },
27403
+ disableNoColor: { type: Boolean, optional: true },
27403
27404
  };
27404
27405
  static components = { ColorPicker };
27405
27406
  colorPickerButtonRef = owl.useRef("colorPickerButton");
@@ -28958,6 +28959,9 @@ stores.inject(MyMetaStore, storeInstance);
28958
28959
  }
28959
28960
  }
28960
28961
  setColorScaleColor(target, color) {
28962
+ if (!isColorValid(color)) {
28963
+ return;
28964
+ }
28961
28965
  const point = this.state.rules.colorScale[target];
28962
28966
  if (point) {
28963
28967
  point.color = Number.parseInt(color.substr(1), 16);
@@ -60968,9 +60972,9 @@ stores.inject(MyMetaStore, storeInstance);
60968
60972
  exports.tokenize = tokenize;
60969
60973
 
60970
60974
 
60971
- __info__.version = "17.2.25";
60972
- __info__.date = "2024-11-08T12:13:19.966Z";
60973
- __info__.hash = "40d42f8";
60975
+ __info__.version = "17.2.26";
60976
+ __info__.date = "2024-11-13T15:04:03.710Z";
60977
+ __info__.hash = "19b7478";
60974
60978
 
60975
60979
 
60976
60980
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);