@odoo/o-spreadsheet 18.4.42 → 18.4.46

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.4.42
6
- * @date 2026-06-06T06:21:28.088Z
7
- * @hash bae6e25
5
+ * @version 18.4.46
6
+ * @date 2026-07-01T05:02:56.676Z
7
+ * @hash 26297b3
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -215,7 +215,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
215
215
  const GRAY_200 = "#E7E9ED";
216
216
  const GRAY_100 = "#F9FAFB";
217
217
  const TEXT_BODY = "#374151";
218
- const TEXT_BODY_MUTED = TEXT_BODY + "C2";
218
+ const TEXT_BODY_MUTED = "#374151C2";
219
219
  const TEXT_HEADING = "#111827";
220
220
  const PRIMARY_BUTTON_BG = "#714B67";
221
221
  const PRIMARY_BUTTON_HOVER_BG = "#624159";
@@ -322,9 +322,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
322
322
  ];
323
323
  const DEFAULT_CELL_HEIGHT = 23;
324
324
  const FOOTER_HEIGHT = 2 * 23;
325
- const MENU_SEPARATOR_BORDER_WIDTH = 1;
326
- const MENU_SEPARATOR_PADDING = 5;
327
- const MENU_SEPARATOR_HEIGHT = 1 + 2 * 5;
328
325
  const DEFAULT_STYLE = {
329
326
  align: "left",
330
327
  verticalAlign: "bottom",
@@ -344,7 +341,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
344
341
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
345
342
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
346
343
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
347
- const DEFAULT_FONT = "'Roboto', arial";
344
+ const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
348
345
  const DEFAULT_BORDER_DESC = {
349
346
  style: "thin",
350
347
  color: "#000000"
@@ -1626,7 +1623,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1626
1623
  function isZoneDependent(cmd) {
1627
1624
  return "sheetId" in cmd && "zone" in cmd;
1628
1625
  }
1629
- const invalidateEvaluationCommands = new Set([
1626
+ const invalidateEvaluationCommands = /* @__PURE__ */ new Set([
1630
1627
  "RENAME_SHEET",
1631
1628
  "DELETE_SHEET",
1632
1629
  "CREATE_SHEET",
@@ -1645,7 +1642,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1645
1642
  "REMOVE_PIVOT",
1646
1643
  "DUPLICATE_PIVOT"
1647
1644
  ]);
1648
- const invalidateChartEvaluationCommands = new Set([
1645
+ const invalidateChartEvaluationCommands = /* @__PURE__ */ new Set([
1649
1646
  "EVALUATE_CELLS",
1650
1647
  "EVALUATE_CHARTS",
1651
1648
  "UPDATE_CELL",
@@ -1664,20 +1661,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1664
1661
  "UNDO",
1665
1662
  "REDO"
1666
1663
  ]);
1667
- const invalidateDependenciesCommands = new Set(["MOVE_RANGES"]);
1668
- const invalidateCFEvaluationCommands = new Set([
1664
+ const invalidateDependenciesCommands = /* @__PURE__ */ new Set(["MOVE_RANGES"]);
1665
+ const invalidateCFEvaluationCommands = /* @__PURE__ */ new Set([
1669
1666
  "EVALUATE_CELLS",
1670
1667
  "ADD_CONDITIONAL_FORMAT",
1671
1668
  "REMOVE_CONDITIONAL_FORMAT",
1672
1669
  "CHANGE_CONDITIONAL_FORMAT_PRIORITY"
1673
1670
  ]);
1674
- const invalidateBordersCommands = new Set([
1671
+ const invalidateBordersCommands = /* @__PURE__ */ new Set([
1675
1672
  "AUTOFILL_CELL",
1676
1673
  "SET_BORDER",
1677
1674
  "SET_ZONE_BORDERS",
1678
1675
  "SET_BORDERS_ON_TARGET"
1679
1676
  ]);
1680
- const readonlyAllowedCommands = new Set([
1677
+ const readonlyAllowedCommands = /* @__PURE__ */ new Set([
1681
1678
  "START",
1682
1679
  "ACTIVATE_SHEET",
1683
1680
  "COPY",
@@ -1689,7 +1686,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1689
1686
  "UPDATE_FILTER",
1690
1687
  "UPDATE_CHART"
1691
1688
  ]);
1692
- const coreTypes = new Set([
1689
+ const coreTypes = /* @__PURE__ */ new Set([
1693
1690
  "UPDATE_CELL",
1694
1691
  "UPDATE_CELL_POSITION",
1695
1692
  "CLEAR_CELL",
@@ -1921,7 +1918,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1921
1918
 
1922
1919
  //#endregion
1923
1920
  //#region src/types/conditional_formatting.ts
1924
- const availableConditionalFormatOperators = new Set([
1921
+ const availableConditionalFormatOperators = /* @__PURE__ */ new Set([
1925
1922
  "containsText",
1926
1923
  "notContainsText",
1927
1924
  "isGreaterThan",
@@ -1940,7 +1937,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1940
1937
 
1941
1938
  //#endregion
1942
1939
  //#region src/types/data_validation.ts
1943
- const availableDataValidationOperators = new Set([
1940
+ const availableDataValidationOperators = /* @__PURE__ */ new Set([
1944
1941
  "containsText",
1945
1942
  "notContainsText",
1946
1943
  "isEqualText",
@@ -2665,12 +2662,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2665
2662
  const pIntegerAndDecimals = `(?:\\d+(?:${escapeRegExp(locale.thousandsSeparator || "")}\\d{3,})*(?:${decimalSeparator}\\d*)?)`;
2666
2663
  const pOnlyDecimals = `(?:${decimalSeparator}\\d+)`;
2667
2664
  const pNumber = "(?:\\s*" + pIntegerAndDecimals + "|" + pOnlyDecimals + ")(?:e(?:\\+|-)?\\d+)?(?:\\s*%)?";
2668
- const pMinus = "(?:\\s*-)?";
2669
- const pCurrencyFormat = "(?:\\s*[\\$€])?";
2670
2665
  const pNumberExp = "^(?:(?:" + [
2671
- pMinus + pCurrencyFormat + pNumber,
2672
- pMinus + pNumber + pCurrencyFormat,
2673
- pCurrencyFormat + pMinus + pNumber
2666
+ "(?:\\s*-)?(?:\\s*[\\$€])?" + pNumber,
2667
+ "(?:\\s*-)?" + pNumber + "(?:\\s*[\\$€])?",
2668
+ "(?:\\s*[\\$€])?(?:\\s*-)?" + pNumber
2674
2669
  ].join(")|(?:") + "))$";
2675
2670
  return new RegExp(pNumberExp, "i");
2676
2671
  });
@@ -4581,7 +4576,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4581
4576
  function recomputeZones(zones, zonesToRemove = []) {
4582
4577
  if (zones.length <= 1 && zonesToRemove.length === 0) return zones;
4583
4578
  const profilesStartingPosition = [0];
4584
- const profiles = new Map([[0, []]]);
4579
+ const profiles = /* @__PURE__ */ new Map([[0, []]]);
4585
4580
  modifyProfiles(profilesStartingPosition, profiles, zones, false);
4586
4581
  modifyProfiles(profilesStartingPosition, profiles, zonesToRemove, true);
4587
4582
  return constructZonesFromProfiles(profilesStartingPosition, profiles);
@@ -5320,7 +5315,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5320
5315
  //#region src/helpers/edge_scrolling.ts
5321
5316
  const MAX_DELAY = 140;
5322
5317
  const MIN_DELAY = 20;
5323
- const ACCELERATION = .035;
5324
5318
  /**
5325
5319
  * Decreasing exponential function used to determine the "speed" of edge-scrolling
5326
5320
  * as the timeout delay.
@@ -5328,7 +5322,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5328
5322
  * Returns a timeout delay in milliseconds.
5329
5323
  */
5330
5324
  function scrollDelay(value) {
5331
- return 20 + (140 - 20) * Math.exp(-ACCELERATION * (value - 1));
5325
+ return 20 + (140 - 20) * Math.exp(-.035 * (value - 1));
5332
5326
  }
5333
5327
 
5334
5328
  //#endregion
@@ -6154,7 +6148,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6154
6148
  smallUuid() {
6155
6149
  if (window.crypto) return "10000000-1000".replace(/[01]/g, (c) => {
6156
6150
  const n = Number(c);
6157
- return (n ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> n / 4).toString(16);
6151
+ return (n ^ crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(1))[0] & 15 >> n / 4).toString(16);
6158
6152
  });
6159
6153
  else return "xxxxxxxx-xxxx".replace(/[xy]/g, function(c) {
6160
6154
  const r = Math.random() * 16 | 0;
@@ -6168,7 +6162,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6168
6162
  uuidv4() {
6169
6163
  if (window.crypto) return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
6170
6164
  const n = Number(c);
6171
- return (n ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> n / 4).toString(16);
6165
+ return (n ^ crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(1))[0] & 15 >> n / 4).toString(16);
6172
6166
  });
6173
6167
  else return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
6174
6168
  const r = Math.random() * 16 | 0;
@@ -7612,10 +7606,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7612
7606
  type: dimension.type
7613
7607
  }));
7614
7608
  if (groupValueString.toLowerCase() === "false") return false;
7615
- return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension.granularity);
7609
+ return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension);
7616
7610
  }
7617
- function normalizeDateTime(value, granularity) {
7618
- return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
7611
+ function normalizeDateTime(value, dimension) {
7612
+ return pivotTimeAdapter(dimension.granularity ?? "month").normalizeFunctionValue(value);
7619
7613
  }
7620
7614
  function toFunctionPivotValue(value, dimension) {
7621
7615
  if (value === null) return `"null"`;
@@ -26263,11 +26257,11 @@ stores.inject(MyMetaStore, storeInstance);
26263
26257
  getResizerPosition(resizer) {
26264
26258
  const anchorCenteringOffset = (ANCHOR_SIZE - ACTIVE_BORDER_WIDTH) / 2;
26265
26259
  const style = {};
26266
- if (resizer.includes("top")) style.top = `${-anchorCenteringOffset}px`;
26267
- else if (resizer.includes("bottom")) style.bottom = `${-anchorCenteringOffset}px`;
26260
+ if (resizer.includes("top")) style.top = `-3px`;
26261
+ else if (resizer.includes("bottom")) style.bottom = `-3px`;
26268
26262
  else style.bottom = `calc(50% - ${anchorCenteringOffset}px)`;
26269
- if (resizer.includes("left")) style.left = `${-anchorCenteringOffset}px`;
26270
- else if (resizer.includes("right")) style.right = `${-anchorCenteringOffset}px`;
26263
+ if (resizer.includes("left")) style.left = `-3px`;
26264
+ else if (resizer.includes("right")) style.right = `-3px`;
26271
26265
  else style.right = `calc(50% - ${anchorCenteringOffset}px)`;
26272
26266
  return cssPropertiesToCss(style);
26273
26267
  }
@@ -29228,11 +29222,10 @@ stores.inject(MyMetaStore, storeInstance);
29228
29222
  const LINE_VERTICAL_PADDING = 1;
29229
29223
  const PICKER_PADDING = 8;
29230
29224
  const ITEM_BORDER_WIDTH = 1;
29231
- const ITEM_EDGE_LENGTH = 18;
29232
29225
  const ITEMS_PER_LINE = 10;
29233
29226
  const MAGNIFIER_EDGE = 16;
29234
29227
  const ITEM_GAP = 2;
29235
- const CONTENT_WIDTH = ITEMS_PER_LINE * (ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH) + (ITEMS_PER_LINE - 1) * ITEM_GAP;
29228
+ const CONTENT_WIDTH = 218;
29236
29229
  const INNER_GRADIENT_WIDTH = CONTENT_WIDTH - 2 * ITEM_BORDER_WIDTH;
29237
29230
  const INNER_GRADIENT_HEIGHT = CONTENT_WIDTH - 30 - 2 * ITEM_BORDER_WIDTH;
29238
29231
  css`
@@ -29244,7 +29237,7 @@ stores.inject(MyMetaStore, storeInstance);
29244
29237
  line-height: 1.2;
29245
29238
  overflow-y: auto;
29246
29239
  overflow-x: hidden;
29247
- width: ${CONTENT_WIDTH + 2 * PICKER_PADDING}px;
29240
+ width: ${234}px;
29248
29241
 
29249
29242
  .o-color-picker-section-name {
29250
29243
  margin: 0px ${ITEM_BORDER_WIDTH}px;
@@ -29270,8 +29263,8 @@ stores.inject(MyMetaStore, storeInstance);
29270
29263
  }
29271
29264
  }
29272
29265
  .o-color-picker-line-item {
29273
- width: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
29274
- height: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
29266
+ width: ${20}px;
29267
+ height: ${20}px;
29275
29268
  margin: 0px;
29276
29269
  border-radius: 50px;
29277
29270
  border: ${ITEM_BORDER_WIDTH}px solid #666666;
@@ -29315,13 +29308,13 @@ stores.inject(MyMetaStore, storeInstance);
29315
29308
  }
29316
29309
 
29317
29310
  .o-custom-selector {
29318
- padding: ${PICKER_PADDING + 2}px ${PICKER_PADDING}px;
29311
+ padding: ${10}px ${PICKER_PADDING}px;
29319
29312
  position: relative;
29320
29313
  .o-gradient {
29321
29314
  margin-bottom: ${MAGNIFIER_EDGE / 2}px;
29322
29315
  border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
29323
- width: ${INNER_GRADIENT_WIDTH + 2 * ITEM_BORDER_WIDTH}px;
29324
- height: ${INNER_GRADIENT_HEIGHT + 2 * ITEM_BORDER_WIDTH}px;
29316
+ width: ${218}px;
29317
+ height: ${188}px;
29325
29318
  position: relative;
29326
29319
  }
29327
29320
 
@@ -29459,8 +29452,8 @@ stores.inject(MyMetaStore, storeInstance);
29459
29452
  const left = Math.round(INNER_GRADIENT_WIDTH * clip(s / 100, 0, 1));
29460
29453
  const top = Math.round(INNER_GRADIENT_HEIGHT * clip(1 - 2 * l / (200 - s), 0, 1));
29461
29454
  return cssPropertiesToCss({
29462
- left: `${-MAGNIFIER_EDGE / 2 + left}px`,
29463
- top: `${-MAGNIFIER_EDGE / 2 + top}px`,
29455
+ left: `${-16 / 2 + left}px`,
29456
+ top: `${-16 / 2 + top}px`,
29464
29457
  background: hslaToHex(this.state.currentHslaColor)
29465
29458
  });
29466
29459
  }
@@ -31642,17 +31635,16 @@ stores.inject(MyMetaStore, storeInstance);
31642
31635
 
31643
31636
  //#endregion
31644
31637
  //#region src/components/link/link_editor/link_editor.ts
31645
- const PADDING = 12;
31646
31638
  css`
31647
31639
  .o-link-editor {
31648
31640
  font-size: 13px;
31649
31641
  background-color: white;
31650
31642
  box-shadow: 0 1px 4px 3px rgba(60, 64, 67, 0.15);
31651
- padding: ${PADDING}px;
31643
+ padding: ${12}px;
31652
31644
  display: flex;
31653
31645
  flex-direction: column;
31654
31646
  border-radius: 4px;
31655
- width: ${340 + 2 * PADDING}px;
31647
+ width: ${364}px;
31656
31648
 
31657
31649
  .o-section {
31658
31650
  .o-section-title {
@@ -39675,8 +39667,12 @@ stores.inject(MyMetaStore, storeInstance);
39675
39667
  }
39676
39668
  stopEdition(direction) {
39677
39669
  if (this.canStopEdition()) {
39670
+ const { col, row } = this.currentEditedCell;
39678
39671
  this._stopEdition();
39679
- if (direction) this.model.selection.moveAnchorCell(direction, 1);
39672
+ if (direction) {
39673
+ this.model.selection.selectCell(col, row);
39674
+ this.model.selection.moveAnchorCell(direction, 1);
39675
+ }
39680
39676
  return;
39681
39677
  }
39682
39678
  const editedCell = this.currentEditedCell;
@@ -47022,9 +47018,9 @@ stores.inject(MyMetaStore, storeInstance);
47022
47018
  allSheetsMatches = [];
47023
47019
  activeSheetMatches = [];
47024
47020
  specificRangeMatches = [];
47021
+ selectedMatchPosition = null;
47025
47022
  currentSearchRegex = null;
47026
47023
  initialShowFormulaState;
47027
- preserveSelectedMatchIndex = false;
47028
47024
  irreplaceableMatchCount = 0;
47029
47025
  isSearchDirty = false;
47030
47026
  shouldFinalizeUpdateSelection = false;
@@ -47146,7 +47142,10 @@ stores.inject(MyMetaStore, storeInstance);
47146
47142
  */
47147
47143
  _updateSearch(toSearch, searchOptions) {
47148
47144
  this.searchOptions = searchOptions;
47149
- if (toSearch !== this.toSearch) this.selectedMatchIndex = null;
47145
+ if (toSearch !== this.toSearch) {
47146
+ this.selectedMatchIndex = null;
47147
+ this.selectedMatchPosition = null;
47148
+ }
47150
47149
  this.toSearch = toSearch;
47151
47150
  this.currentSearchRegex = getSearchRegex(this.toSearch, this.searchOptions);
47152
47151
  this.refreshSearch({
@@ -47158,8 +47157,14 @@ stores.inject(MyMetaStore, storeInstance);
47158
47157
  * refresh the matches according to the current search options
47159
47158
  */
47160
47159
  refreshSearch(options) {
47161
- if (!this.preserveSelectedMatchIndex) this.selectedMatchIndex = null;
47162
47160
  this.findMatches();
47161
+ if (this.selectedMatchPosition) if (this.selectedMatchPosition.sheetId !== this.getters.getActiveSheetId()) {
47162
+ this.selectedMatchIndex = null;
47163
+ this.selectedMatchPosition = null;
47164
+ } else {
47165
+ const index = this.searchMatches.findIndex((match) => match.sheetId === this.selectedMatchPosition?.sheetId && match.col === this.selectedMatchPosition?.col && match.row === this.selectedMatchPosition?.row);
47166
+ if (index !== -1) this.selectedMatchIndex = index;
47167
+ }
47163
47168
  this.selectNextCell(0, options);
47164
47169
  }
47165
47170
  getSheetsInSearchOrder() {
@@ -47227,6 +47232,7 @@ stores.inject(MyMetaStore, storeInstance);
47227
47232
  const matches = this.searchMatches;
47228
47233
  if (!matches.length) {
47229
47234
  this.selectedMatchIndex = null;
47235
+ this.selectedMatchPosition = null;
47230
47236
  return;
47231
47237
  }
47232
47238
  let nextIndex;
@@ -47240,14 +47246,13 @@ stores.inject(MyMetaStore, storeInstance);
47240
47246
  } else nextIndex = this.selectedMatchIndex + indexChange;
47241
47247
  nextIndex = (nextIndex + matches.length) % matches.length;
47242
47248
  this.selectedMatchIndex = nextIndex;
47249
+ this.selectedMatchPosition = matches[this.selectedMatchIndex];
47243
47250
  const selectedMatch = matches[nextIndex];
47244
47251
  if (options.jumpToMatchSheet && this.getters.getActiveSheetId() !== selectedMatch.sheetId) {
47245
- this.preserveSelectedMatchIndex = true;
47246
47252
  this.model.dispatch("ACTIVATE_SHEET", {
47247
47253
  sheetIdFrom: this.getters.getActiveSheetId(),
47248
47254
  sheetIdTo: selectedMatch.sheetId
47249
47255
  });
47250
- this.preserveSelectedMatchIndex = false;
47251
47256
  this.isSearchDirty = false;
47252
47257
  }
47253
47258
  this.model.selection.getBackToDefault();
@@ -47258,7 +47263,6 @@ stores.inject(MyMetaStore, storeInstance);
47258
47263
  */
47259
47264
  replace() {
47260
47265
  if (this.selectedMatchIndex === null) return;
47261
- this.preserveSelectedMatchIndex = true;
47262
47266
  this.shouldFinalizeUpdateSelection = true;
47263
47267
  this.model.dispatch("REPLACE_SEARCH", {
47264
47268
  searchString: this.toSearch,
@@ -47266,7 +47270,6 @@ stores.inject(MyMetaStore, storeInstance);
47266
47270
  matches: [this.searchMatches[this.selectedMatchIndex]],
47267
47271
  searchOptions: this.searchOptions
47268
47272
  });
47269
- this.preserveSelectedMatchIndex = false;
47270
47273
  }
47271
47274
  /**
47272
47275
  * Apply the replace function to all the matches one time.
@@ -48692,8 +48695,8 @@ stores.inject(MyMetaStore, storeInstance);
48692
48695
  collapsedDomains;
48693
48696
  constructor(definition, fields) {
48694
48697
  this.measures = definition.measures.map((measure) => createMeasure(fields, measure));
48695
- this.columns = definition.columns.map((dimension) => createPivotDimension(fields, dimension));
48696
- this.rows = definition.rows.map((dimension) => createPivotDimension(fields, dimension));
48698
+ this.columns = definition.columns.map((dimension) => this.createPivotDimension(fields, dimension));
48699
+ this.rows = definition.rows.map((dimension) => this.createPivotDimension(fields, dimension));
48697
48700
  this.sortedColumn = definition.sortedColumn;
48698
48701
  this.collapsedDomains = definition.collapsedDomains;
48699
48702
  }
@@ -48707,6 +48710,40 @@ stores.inject(MyMetaStore, storeInstance);
48707
48710
  if (!measure) throw new EvaluationError(_t("Field %s is not a measure", id));
48708
48711
  return measure;
48709
48712
  }
48713
+ createPivotDimension(fields, dimension) {
48714
+ const field = fields[dimension.fieldName];
48715
+ const type = field?.type ?? "integer";
48716
+ const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
48717
+ return {
48718
+ /**
48719
+ * Get the display name of the dimension
48720
+ * e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
48721
+ */
48722
+ displayName: field?.string ?? dimension.fieldName,
48723
+ /**
48724
+ * Get the name of the dimension, as it is stored in the pivot formula
48725
+ * e.g. "stage_id", "create_date:month"
48726
+ */
48727
+ nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
48728
+ /**
48729
+ * Get the name of the field of the dimension
48730
+ * e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
48731
+ */
48732
+ fieldName: dimension.fieldName,
48733
+ /**
48734
+ * Get the aggregate operator of the dimension
48735
+ * e.g. "stage_id" -> undefined, "create_date:month" -> "month"
48736
+ */
48737
+ granularity,
48738
+ /**
48739
+ * Get the type of the field of the dimension
48740
+ * e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
48741
+ */
48742
+ type,
48743
+ order: dimension.order,
48744
+ isValid: !!field
48745
+ };
48746
+ }
48710
48747
  };
48711
48748
  function createMeasure(fields, measure) {
48712
48749
  const fieldName = measure.fieldName;
@@ -48750,40 +48787,6 @@ stores.inject(MyMetaStore, storeInstance);
48750
48787
  display: measure.display
48751
48788
  };
48752
48789
  }
48753
- function createPivotDimension(fields, dimension) {
48754
- const field = fields[dimension.fieldName];
48755
- const type = field?.type ?? "integer";
48756
- const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
48757
- return {
48758
- /**
48759
- * Get the display name of the dimension
48760
- * e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
48761
- */
48762
- displayName: field?.string ?? dimension.fieldName,
48763
- /**
48764
- * Get the name of the dimension, as it is stored in the pivot formula
48765
- * e.g. "stage_id", "create_date:month"
48766
- */
48767
- nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
48768
- /**
48769
- * Get the name of the field of the dimension
48770
- * e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
48771
- */
48772
- fieldName: dimension.fieldName,
48773
- /**
48774
- * Get the aggregate operator of the dimension
48775
- * e.g. "stage_id" -> undefined, "create_date:month" -> "month"
48776
- */
48777
- granularity,
48778
- /**
48779
- * Get the type of the field of the dimension
48780
- * e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
48781
- */
48782
- type,
48783
- order: dimension.order,
48784
- isValid: !!field
48785
- };
48786
- }
48787
48790
 
48788
48791
  //#endregion
48789
48792
  //#region src/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.ts
@@ -51900,7 +51903,7 @@ stores.inject(MyMetaStore, storeInstance);
51900
51903
  ev.preventDefault();
51901
51904
  const clipboardData = ev.clipboardData;
51902
51905
  if (!clipboardData) return;
51903
- const image = [...clipboardData.files]?.find((file) => AllowedImageMimeTypes.includes(file.type));
51906
+ const image = [...clipboardData.files].find((file) => AllowedImageMimeTypes.includes(file.type));
51904
51907
  const osClipboard = { content: {
51905
51908
  ["text/plain"]: clipboardData?.getData("text/plain"),
51906
51909
  ["text/html"]: clipboardData?.getData("text/html")
@@ -58661,6 +58664,9 @@ stores.inject(MyMetaStore, storeInstance);
58661
58664
  case "CREATE_CHART":
58662
58665
  this.tryToAddColors(this.getChartColors(cmd.figureId));
58663
58666
  break;
58667
+ case "COLOR_SHEET":
58668
+ if (cmd.color) this.tryToAddColors([cmd.color]);
58669
+ break;
58664
58670
  case "UPDATE_CELL":
58665
58671
  case "ADD_CONDITIONAL_FORMAT":
58666
58672
  case "SET_BORDER":
@@ -58683,8 +58689,12 @@ stores.inject(MyMetaStore, storeInstance);
58683
58689
  }
58684
58690
  computeCustomColors() {
58685
58691
  let usedColors = [];
58686
- for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
58687
- return [...new Set([...usedColors])];
58692
+ for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getSheetColors(sheetId), this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
58693
+ return [.../* @__PURE__ */ new Set([...usedColors])];
58694
+ }
58695
+ getSheetColors(sheetId) {
58696
+ const sheet = this.getters.getSheet(sheetId);
58697
+ return sheet.color ? [sheet.color] : [];
58688
58698
  }
58689
58699
  getColorsFromCells(sheetId) {
58690
58700
  const cells = Object.values(this.getters.getCells(sheetId));
@@ -59344,7 +59354,7 @@ stores.inject(MyMetaStore, storeInstance);
59344
59354
  const definition = getters.getPivotCoreDefinition(pivotId);
59345
59355
  const isDashboard = getters.isDashboard();
59346
59356
  const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
59347
- const hasIcon = !isDashboard && pivotCell.domain.length !== fields.length;
59357
+ const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
59348
59358
  const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
59349
59359
  const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * 15 : 0;
59350
59360
  return {
@@ -63655,7 +63665,7 @@ stores.inject(MyMetaStore, storeInstance);
63655
63665
  };
63656
63666
  }
63657
63667
  };
63658
- const invalidateTableStyleCommandsSet = new Set([
63668
+ const invalidateTableStyleCommandsSet = /* @__PURE__ */ new Set([
63659
63669
  "HIDE_COLUMNS_ROWS",
63660
63670
  "UNHIDE_COLUMNS_ROWS",
63661
63671
  "UNFOLD_HEADER_GROUP",
@@ -65911,14 +65921,14 @@ stores.inject(MyMetaStore, storeInstance);
65911
65921
  adjustPositionX(targetCol) {
65912
65922
  const sheetId = this.sheetId;
65913
65923
  const { start, end } = this.getters.getColDimensions(sheetId, targetCol);
65914
- if (this.offsetX + this.viewportWidth + this.offsetCorrectionX < end) this.offsetX = end - this.viewportWidth;
65924
+ if (this.offsetX + this.viewportWidth + this.offsetCorrectionX < end) this.offsetX = end - this.viewportWidth - this.offsetCorrectionX;
65915
65925
  else if (this.offsetX + this.offsetCorrectionX > start) this.offsetX = start - this.offsetCorrectionX;
65916
65926
  this.adjustViewportZoneX();
65917
65927
  }
65918
65928
  adjustPositionY(targetRow) {
65919
65929
  const sheetId = this.sheetId;
65920
65930
  const { start, end } = this.getters.getRowDimensions(sheetId, targetRow);
65921
- if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) this.offsetY = end - this.viewportHeight;
65931
+ if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) this.offsetY = end - this.viewportHeight - this.offsetCorrectionY;
65922
65932
  else if (this.offsetY + this.offsetCorrectionY > start) this.offsetY = start - this.offsetCorrectionY;
65923
65933
  this.adjustViewportZoneY();
65924
65934
  }
@@ -68331,11 +68341,14 @@ stores.inject(MyMetaStore, storeInstance);
68331
68341
  }
68332
68342
  });
68333
68343
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
68334
- (0, _odoo_owl.useExternalListener)(window, "click", () => this.state.pickerOpened = false);
68344
+ (0, _odoo_owl.useExternalListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
68335
68345
  (0, _odoo_owl.useEffect)((sheetId) => {
68336
68346
  if (this.props.sheetId === sheetId) this.scrollToSheet();
68337
68347
  }, () => [this.env.model.getters.getActiveSheetId()]);
68338
68348
  }
68349
+ onExternalClick(ev) {
68350
+ if (!ev.target.closest(".o-color-picker")) this.state.pickerOpened = false;
68351
+ }
68339
68352
  focusInputAndSelectContent() {
68340
68353
  if (!this.state.isEditing || !this.sheetNameRef.el) return;
68341
68354
  this.sheetNameRef.el.focus();
@@ -68437,6 +68450,8 @@ stores.inject(MyMetaStore, storeInstance);
68437
68450
  },
68438
68451
  openSheetColorPickerCallback: () => {
68439
68452
  this.state.pickerOpened = true;
68453
+ const sheet = this.env.model.getters.getSheet(this.props.sheetId);
68454
+ this.state.currentPickerColor = sheet.color;
68440
68455
  }
68441
68456
  });
68442
68457
  }
@@ -72964,11 +72979,11 @@ stores.inject(MyMetaStore, storeInstance);
72964
72979
  <!-- each data marker in the series does not have a different color -->
72965
72980
  <c:varyColors val="0"/>
72966
72981
  ${joinXmlNodes(rightDataSetsNodes)}
72967
- <c:axId val="${catAxId + 1}" />
72968
- <c:axId val="${valAxId + 1}" />
72982
+ <c:axId val="${17781238}" />
72983
+ <c:axId val="${88853994}" />
72969
72984
  </c:barChart>
72970
- ${addAx("b", "c:catAx", catAxId + 1, valAxId + 1, chart.axesDesign?.x?.title, chart.fontColor, leftDataSetsNodes.length ? 1 : 0)}
72971
- ${addAx("r", "c:valAx", valAxId + 1, catAxId + 1, chart.axesDesign?.y1?.title, chart.fontColor)}
72985
+ ${addAx("b", "c:catAx", 17781238, 88853994, chart.axesDesign?.x?.title, chart.fontColor, leftDataSetsNodes.length ? 1 : 0)}
72986
+ ${addAx("r", "c:valAx", 88853994, 17781238, chart.axesDesign?.y1?.title, chart.fontColor)}
72972
72987
  ` : ""}`;
72973
72988
  }
72974
72989
  function addComboChart(chart) {
@@ -73126,11 +73141,11 @@ stores.inject(MyMetaStore, storeInstance);
73126
73141
  <!-- each data marker in the series does not have a different color -->
73127
73142
  <c:varyColors val="0"/>
73128
73143
  ${joinXmlNodes(rightDataSetsNodes)}
73129
- <c:axId val="${catAxId + 1}" />
73130
- <c:axId val="${valAxId + 1}" />
73144
+ <c:axId val="${17781238}" />
73145
+ <c:axId val="${88853994}" />
73131
73146
  </c:lineChart>
73132
- ${addAx("b", "c:catAx", catAxId + 1, valAxId + 1, chart.axesDesign?.x?.title, chart.fontColor, leftDataSetsNodes.length ? 1 : 0)}
73133
- ${addAx("r", "c:valAx", valAxId + 1, catAxId + 1, chart.axesDesign?.y1?.title, chart.fontColor)}
73147
+ ${addAx("b", "c:catAx", 17781238, 88853994, chart.axesDesign?.x?.title, chart.fontColor, leftDataSetsNodes.length ? 1 : 0)}
73148
+ ${addAx("r", "c:valAx", 88853994, 17781238, chart.axesDesign?.y1?.title, chart.fontColor)}
73134
73149
  ` : ""}
73135
73150
  `;
73136
73151
  }
@@ -73193,11 +73208,11 @@ stores.inject(MyMetaStore, storeInstance);
73193
73208
  <c:varyColors val="0"/>
73194
73209
  <c:scatterStyle val="lineMarker"/>
73195
73210
  ${joinXmlNodes(rightDataSetsNodes)}
73196
- <c:axId val="${catAxId + 1}" />
73197
- <c:axId val="${valAxId + 1}" />
73211
+ <c:axId val="${17781238}" />
73212
+ <c:axId val="${88853994}" />
73198
73213
  </c:scatterChart>
73199
- ${addAx("b", "c:valAx", catAxId + 1, valAxId + 1, chart.axesDesign?.x?.title, chart.fontColor, leftDataSetsNodes.length ? 1 : 0)}
73200
- ${addAx("r", "c:valAx", valAxId + 1, catAxId + 1, chart.axesDesign?.y1?.title, chart.fontColor)}
73214
+ ${addAx("b", "c:valAx", 17781238, 88853994, chart.axesDesign?.x?.title, chart.fontColor, leftDataSetsNodes.length ? 1 : 0)}
73215
+ ${addAx("r", "c:valAx", 88853994, 17781238, chart.axesDesign?.y1?.title, chart.fontColor)}
73201
73216
  ` : ""}`;
73202
73217
  }
73203
73218
  function addRadarChart(chart) {
@@ -75415,8 +75430,8 @@ exports.stores = stores;
75415
75430
  exports.tokenColors = tokenColors;
75416
75431
  exports.tokenize = tokenize;
75417
75432
 
75418
- __info__.version = "18.4.42";
75419
- __info__.date = "2026-06-06T06:21:28.088Z";
75420
- __info__.hash = "bae6e25";
75433
+ __info__.version = "18.4.46";
75434
+ __info__.date = "2026-07-01T05:02:56.676Z";
75435
+ __info__.hash = "26297b3";
75421
75436
 
75422
75437
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);