@odoo/o-spreadsheet 18.2.56 → 18.2.58

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.56
6
- * @date 2026-06-17T08:50:17.274Z
7
- * @hash 17ea4a6
5
+ * @version 18.2.58
6
+ * @date 2026-07-01T05:02:56.953Z
7
+ * @hash 90648bf
8
8
  */
9
9
  /* Originates from src/components/spreadsheet/spreadsheet.scss */
10
10
  .o-spreadsheet {
@@ -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.56
6
- * @date 2026-06-17T08:50:15.644Z
7
- * @hash 17ea4a6
5
+ * @version 18.2.58
6
+ * @date 2026-07-01T05:02:55.458Z
7
+ * @hash 90648bf
8
8
  */
9
9
 
10
10
  import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
@@ -314,7 +314,7 @@ const DEFAULT_NUMBER_STYLE = {
314
314
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
315
315
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
316
316
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
317
- const DEFAULT_FONT = "'Roboto', arial";
317
+ const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
318
318
  const DEFAULT_BORDER_DESC = {
319
319
  style: "thin",
320
320
  color: "#000000"
@@ -7314,10 +7314,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
7314
7314
  type: dimension.type
7315
7315
  }));
7316
7316
  if (groupValueString.toLowerCase() === "false") return false;
7317
- return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension.granularity);
7317
+ return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension);
7318
7318
  }
7319
- function normalizeDateTime(value, granularity) {
7320
- return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
7319
+ function normalizeDateTime(value, dimension) {
7320
+ return pivotTimeAdapter(dimension.granularity ?? "month").normalizeFunctionValue(value);
7321
7321
  }
7322
7322
  function toFunctionPivotValue(value, dimension) {
7323
7323
  if (value === null) return `"null"`;
@@ -41025,8 +41025,8 @@ var PivotRuntimeDefinition = class {
41025
41025
  sortedColumn;
41026
41026
  constructor(definition, fields) {
41027
41027
  this.measures = definition.measures.map((measure) => createMeasure(fields, measure));
41028
- this.columns = definition.columns.map((dimension) => createPivotDimension(fields, dimension));
41029
- this.rows = definition.rows.map((dimension) => createPivotDimension(fields, dimension));
41028
+ this.columns = definition.columns.map((dimension) => this.createPivotDimension(fields, dimension));
41029
+ this.rows = definition.rows.map((dimension) => this.createPivotDimension(fields, dimension));
41030
41030
  this.sortedColumn = definition.sortedColumn;
41031
41031
  }
41032
41032
  getDimension(nameWithGranularity) {
@@ -41039,6 +41039,40 @@ var PivotRuntimeDefinition = class {
41039
41039
  if (!measure) throw new EvaluationError(_t("Field %s is not a measure", id));
41040
41040
  return measure;
41041
41041
  }
41042
+ createPivotDimension(fields, dimension) {
41043
+ const field = fields[dimension.fieldName];
41044
+ const type = field?.type ?? "integer";
41045
+ const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
41046
+ return {
41047
+ /**
41048
+ * Get the display name of the dimension
41049
+ * e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
41050
+ */
41051
+ displayName: field?.string ?? dimension.fieldName,
41052
+ /**
41053
+ * Get the name of the dimension, as it is stored in the pivot formula
41054
+ * e.g. "stage_id", "create_date:month"
41055
+ */
41056
+ nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
41057
+ /**
41058
+ * Get the name of the field of the dimension
41059
+ * e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
41060
+ */
41061
+ fieldName: dimension.fieldName,
41062
+ /**
41063
+ * Get the aggregate operator of the dimension
41064
+ * e.g. "stage_id" -> undefined, "create_date:month" -> "month"
41065
+ */
41066
+ granularity,
41067
+ /**
41068
+ * Get the type of the field of the dimension
41069
+ * e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
41070
+ */
41071
+ type,
41072
+ order: dimension.order,
41073
+ isValid: !!field
41074
+ };
41075
+ }
41042
41076
  };
41043
41077
  function createMeasure(fields, measure) {
41044
41078
  const fieldName = measure.fieldName;
@@ -41082,40 +41116,6 @@ function createMeasure(fields, measure) {
41082
41116
  display: measure.display
41083
41117
  };
41084
41118
  }
41085
- function createPivotDimension(fields, dimension) {
41086
- const field = fields[dimension.fieldName];
41087
- const type = field?.type ?? "integer";
41088
- const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
41089
- return {
41090
- /**
41091
- * Get the display name of the dimension
41092
- * e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
41093
- */
41094
- displayName: field?.string ?? dimension.fieldName,
41095
- /**
41096
- * Get the name of the dimension, as it is stored in the pivot formula
41097
- * e.g. "stage_id", "create_date:month"
41098
- */
41099
- nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
41100
- /**
41101
- * Get the name of the field of the dimension
41102
- * e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
41103
- */
41104
- fieldName: dimension.fieldName,
41105
- /**
41106
- * Get the aggregate operator of the dimension
41107
- * e.g. "stage_id" -> undefined, "create_date:month" -> "month"
41108
- */
41109
- granularity,
41110
- /**
41111
- * Get the type of the field of the dimension
41112
- * e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
41113
- */
41114
- type,
41115
- order: dimension.order,
41116
- isValid: !!field
41117
- };
41118
- }
41119
41119
 
41120
41120
  //#endregion
41121
41121
  //#region src/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.ts
@@ -55014,6 +55014,9 @@ var CustomColorsPlugin = class extends CoreViewPlugin {
55014
55014
  case "CREATE_CHART":
55015
55015
  this.tryToAddColors(this.getChartColors(cmd.id));
55016
55016
  break;
55017
+ case "COLOR_SHEET":
55018
+ if (cmd.color) this.tryToAddColors([cmd.color]);
55019
+ break;
55017
55020
  case "UPDATE_CELL":
55018
55021
  case "ADD_CONDITIONAL_FORMAT":
55019
55022
  case "SET_BORDER":
@@ -55036,9 +55039,13 @@ var CustomColorsPlugin = class extends CoreViewPlugin {
55036
55039
  }
55037
55040
  computeCustomColors() {
55038
55041
  let usedColors = [];
55039
- for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
55042
+ for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getSheetColors(sheetId), this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
55040
55043
  return [...new Set([...usedColors])];
55041
55044
  }
55045
+ getSheetColors(sheetId) {
55046
+ const sheet = this.getters.getSheet(sheetId);
55047
+ return sheet.color ? [sheet.color] : [];
55048
+ }
55042
55049
  getColorsFromCells(sheetId) {
55043
55050
  const cells = Object.values(this.getters.getCells(sheetId));
55044
55051
  const colors = /* @__PURE__ */ new Set();
@@ -62613,11 +62620,14 @@ var BottomBarSheet = class extends Component {
62613
62620
  }
62614
62621
  });
62615
62622
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
62616
- useExternalListener(window, "click", () => this.state.pickerOpened = false);
62623
+ useExternalListener(window, "click", this.onExternalClick.bind(this), { capture: true });
62617
62624
  useEffect((sheetId) => {
62618
62625
  if (this.props.sheetId === sheetId) this.scrollToSheet();
62619
62626
  }, () => [this.env.model.getters.getActiveSheetId()]);
62620
62627
  }
62628
+ onExternalClick(ev) {
62629
+ if (!ev.target.closest(".o-color-picker")) this.state.pickerOpened = false;
62630
+ }
62621
62631
  focusInputAndSelectContent() {
62622
62632
  if (!this.state.isEditing || !this.sheetNameRef.el) return;
62623
62633
  this.sheetNameRef.el.focus();
@@ -62714,6 +62724,8 @@ var BottomBarSheet = class extends Component {
62714
62724
  },
62715
62725
  openSheetColorPickerCallback: () => {
62716
62726
  this.state.pickerOpened = true;
62727
+ const sheet = this.env.model.getters.getSheet(this.props.sheetId);
62728
+ this.state.currentPickerColor = sheet.color;
62717
62729
  }
62718
62730
  });
62719
62731
  }
@@ -68948,6 +68960,6 @@ const chartHelpers = {
68948
68960
  //#endregion
68949
68961
  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 };
68950
68962
 
68951
- __info__.version = "18.2.56";
68952
- __info__.date = "2026-06-17T08:50:15.644Z";
68953
- __info__.hash = "17ea4a6";
68963
+ __info__.version = "18.2.58";
68964
+ __info__.date = "2026-07-01T05:02:55.458Z";
68965
+ __info__.hash = "90648bf";
@@ -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.56
6
- * @date 2026-06-17T08:50:15.644Z
7
- * @hash 17ea4a6
5
+ * @version 18.2.58
6
+ * @date 2026-07-01T05:02:55.458Z
7
+ * @hash 90648bf
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -316,7 +316,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
316
316
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
317
317
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
318
318
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
319
- const DEFAULT_FONT = "'Roboto', arial";
319
+ const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
320
320
  const DEFAULT_BORDER_DESC = {
321
321
  style: "thin",
322
322
  color: "#000000"
@@ -7316,10 +7316,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7316
7316
  type: dimension.type
7317
7317
  }));
7318
7318
  if (groupValueString.toLowerCase() === "false") return false;
7319
- return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension.granularity);
7319
+ return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension);
7320
7320
  }
7321
- function normalizeDateTime(value, granularity) {
7322
- return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
7321
+ function normalizeDateTime(value, dimension) {
7322
+ return pivotTimeAdapter(dimension.granularity ?? "month").normalizeFunctionValue(value);
7323
7323
  }
7324
7324
  function toFunctionPivotValue(value, dimension) {
7325
7325
  if (value === null) return `"null"`;
@@ -41027,8 +41027,8 @@ stores.inject(MyMetaStore, storeInstance);
41027
41027
  sortedColumn;
41028
41028
  constructor(definition, fields) {
41029
41029
  this.measures = definition.measures.map((measure) => createMeasure(fields, measure));
41030
- this.columns = definition.columns.map((dimension) => createPivotDimension(fields, dimension));
41031
- this.rows = definition.rows.map((dimension) => createPivotDimension(fields, dimension));
41030
+ this.columns = definition.columns.map((dimension) => this.createPivotDimension(fields, dimension));
41031
+ this.rows = definition.rows.map((dimension) => this.createPivotDimension(fields, dimension));
41032
41032
  this.sortedColumn = definition.sortedColumn;
41033
41033
  }
41034
41034
  getDimension(nameWithGranularity) {
@@ -41041,6 +41041,40 @@ stores.inject(MyMetaStore, storeInstance);
41041
41041
  if (!measure) throw new EvaluationError(_t("Field %s is not a measure", id));
41042
41042
  return measure;
41043
41043
  }
41044
+ createPivotDimension(fields, dimension) {
41045
+ const field = fields[dimension.fieldName];
41046
+ const type = field?.type ?? "integer";
41047
+ const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
41048
+ return {
41049
+ /**
41050
+ * Get the display name of the dimension
41051
+ * e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
41052
+ */
41053
+ displayName: field?.string ?? dimension.fieldName,
41054
+ /**
41055
+ * Get the name of the dimension, as it is stored in the pivot formula
41056
+ * e.g. "stage_id", "create_date:month"
41057
+ */
41058
+ nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
41059
+ /**
41060
+ * Get the name of the field of the dimension
41061
+ * e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
41062
+ */
41063
+ fieldName: dimension.fieldName,
41064
+ /**
41065
+ * Get the aggregate operator of the dimension
41066
+ * e.g. "stage_id" -> undefined, "create_date:month" -> "month"
41067
+ */
41068
+ granularity,
41069
+ /**
41070
+ * Get the type of the field of the dimension
41071
+ * e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
41072
+ */
41073
+ type,
41074
+ order: dimension.order,
41075
+ isValid: !!field
41076
+ };
41077
+ }
41044
41078
  };
41045
41079
  function createMeasure(fields, measure) {
41046
41080
  const fieldName = measure.fieldName;
@@ -41084,40 +41118,6 @@ stores.inject(MyMetaStore, storeInstance);
41084
41118
  display: measure.display
41085
41119
  };
41086
41120
  }
41087
- function createPivotDimension(fields, dimension) {
41088
- const field = fields[dimension.fieldName];
41089
- const type = field?.type ?? "integer";
41090
- const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
41091
- return {
41092
- /**
41093
- * Get the display name of the dimension
41094
- * e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
41095
- */
41096
- displayName: field?.string ?? dimension.fieldName,
41097
- /**
41098
- * Get the name of the dimension, as it is stored in the pivot formula
41099
- * e.g. "stage_id", "create_date:month"
41100
- */
41101
- nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
41102
- /**
41103
- * Get the name of the field of the dimension
41104
- * e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
41105
- */
41106
- fieldName: dimension.fieldName,
41107
- /**
41108
- * Get the aggregate operator of the dimension
41109
- * e.g. "stage_id" -> undefined, "create_date:month" -> "month"
41110
- */
41111
- granularity,
41112
- /**
41113
- * Get the type of the field of the dimension
41114
- * e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
41115
- */
41116
- type,
41117
- order: dimension.order,
41118
- isValid: !!field
41119
- };
41120
- }
41121
41121
 
41122
41122
  //#endregion
41123
41123
  //#region src/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.ts
@@ -55016,6 +55016,9 @@ stores.inject(MyMetaStore, storeInstance);
55016
55016
  case "CREATE_CHART":
55017
55017
  this.tryToAddColors(this.getChartColors(cmd.id));
55018
55018
  break;
55019
+ case "COLOR_SHEET":
55020
+ if (cmd.color) this.tryToAddColors([cmd.color]);
55021
+ break;
55019
55022
  case "UPDATE_CELL":
55020
55023
  case "ADD_CONDITIONAL_FORMAT":
55021
55024
  case "SET_BORDER":
@@ -55038,9 +55041,13 @@ stores.inject(MyMetaStore, storeInstance);
55038
55041
  }
55039
55042
  computeCustomColors() {
55040
55043
  let usedColors = [];
55041
- for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
55044
+ for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getSheetColors(sheetId), this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
55042
55045
  return [...new Set([...usedColors])];
55043
55046
  }
55047
+ getSheetColors(sheetId) {
55048
+ const sheet = this.getters.getSheet(sheetId);
55049
+ return sheet.color ? [sheet.color] : [];
55050
+ }
55044
55051
  getColorsFromCells(sheetId) {
55045
55052
  const cells = Object.values(this.getters.getCells(sheetId));
55046
55053
  const colors = /* @__PURE__ */ new Set();
@@ -62615,11 +62622,14 @@ stores.inject(MyMetaStore, storeInstance);
62615
62622
  }
62616
62623
  });
62617
62624
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
62618
- (0, _odoo_owl.useExternalListener)(window, "click", () => this.state.pickerOpened = false);
62625
+ (0, _odoo_owl.useExternalListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
62619
62626
  (0, _odoo_owl.useEffect)((sheetId) => {
62620
62627
  if (this.props.sheetId === sheetId) this.scrollToSheet();
62621
62628
  }, () => [this.env.model.getters.getActiveSheetId()]);
62622
62629
  }
62630
+ onExternalClick(ev) {
62631
+ if (!ev.target.closest(".o-color-picker")) this.state.pickerOpened = false;
62632
+ }
62623
62633
  focusInputAndSelectContent() {
62624
62634
  if (!this.state.isEditing || !this.sheetNameRef.el) return;
62625
62635
  this.sheetNameRef.el.focus();
@@ -62716,6 +62726,8 @@ stores.inject(MyMetaStore, storeInstance);
62716
62726
  },
62717
62727
  openSheetColorPickerCallback: () => {
62718
62728
  this.state.pickerOpened = true;
62729
+ const sheet = this.env.model.getters.getSheet(this.props.sheetId);
62730
+ this.state.currentPickerColor = sheet.color;
62719
62731
  }
62720
62732
  });
62721
62733
  }
@@ -68996,8 +69008,8 @@ exports.stores = stores;
68996
69008
  exports.tokenColors = tokenColors;
68997
69009
  exports.tokenize = tokenize;
68998
69010
 
68999
- __info__.version = "18.2.56";
69000
- __info__.date = "2026-06-17T08:50:15.644Z";
69001
- __info__.hash = "17ea4a6";
69011
+ __info__.version = "18.2.58";
69012
+ __info__.date = "2026-07-01T05:02:55.458Z";
69013
+ __info__.hash = "90648bf";
69002
69014
 
69003
69015
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);