@odoo/o-spreadsheet 18.5.0-alpha.0 → 18.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.
@@ -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.5.0-alpha.0
6
- * @date 2025-06-24T12:26:38.163Z
7
- * @hash ed0f325
5
+ * @version 18.5.0-alpha.2
6
+ * @date 2025-07-11T11:13:53.317Z
7
+ * @hash 6d42178
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -853,6 +853,7 @@
853
853
  ];
854
854
  const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
855
855
  const newLineRegexp = /(\r\n|\r)/g;
856
+ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
856
857
  /**
857
858
  * Replace all different newlines characters by \n
858
859
  */
@@ -1989,8 +1990,9 @@
1989
1990
  const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
1990
1991
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
1991
1992
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
1992
- const dateSeparatorsRegex = /\/|-|\s/;
1993
- const dateRegexp = /^(\d{1,4})[\/-\s](\d{1,4})([\/-\s](\d{1,4}))?$/;
1993
+ const whiteSpaceChars = whiteSpaceCharacters.join("");
1994
+ const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
1995
+ const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
1994
1996
  const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
1995
1997
  /** Convert a value number representing a date, or return undefined if it isn't possible */
1996
1998
  function valueToDateNumber(value, locale) {
@@ -6925,6 +6927,8 @@
6925
6927
  function splitTextToWidth(ctx, text, style, width) {
6926
6928
  if (!style)
6927
6929
  style = {};
6930
+ if (isMarkdownLink(text))
6931
+ text = parseMarkdownLink(text).label;
6928
6932
  const brokenText = [];
6929
6933
  // Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
6930
6934
  // but 5-10x faster if it doesn't
@@ -8765,6 +8769,10 @@
8765
8769
  if (groupValue === null || groupValue === "null") {
8766
8770
  return null;
8767
8771
  }
8772
+ const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
8773
+ if (isEvaluationError(extractedGroupValue)) {
8774
+ return extractedGroupValue;
8775
+ }
8768
8776
  const groupValueString = typeof groupValue === "boolean"
8769
8777
  ? toString(groupValue).toLocaleLowerCase()
8770
8778
  : toString(groupValue);
@@ -26509,6 +26517,51 @@ stores.inject(MyMetaStore, storeInstance);
26509
26517
  Object.assign(animatedBox.style, style);
26510
26518
  },
26511
26519
  });
26520
+ cellAnimationRegistry.add("iconFadeIn", {
26521
+ id: "iconFadeIn",
26522
+ easingFn: "easeInCubic",
26523
+ hasAnimation: (oldBox, newBox) => {
26524
+ return Boolean((!oldBox?.icons?.left && newBox?.icons?.left) ||
26525
+ (!oldBox?.icons?.right && newBox?.icons?.right) ||
26526
+ (!oldBox?.icons?.center && newBox?.icons?.center));
26527
+ },
26528
+ updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26529
+ const iconOpacity = EASING_FN[this.easingFn](progress);
26530
+ if (animatedBox.icons.left && newBox.icons.left && !oldBox.icons.left) {
26531
+ animatedBox.icons.left.opacity = iconOpacity;
26532
+ }
26533
+ if (animatedBox.icons.right && newBox.icons.right && !oldBox.icons.right) {
26534
+ animatedBox.icons.right.opacity = iconOpacity;
26535
+ }
26536
+ if (animatedBox.icons.center && newBox.icons.center && !oldBox.icons.center) {
26537
+ animatedBox.icons.center.opacity = iconOpacity;
26538
+ }
26539
+ },
26540
+ });
26541
+ cellAnimationRegistry.add("iconFadeOut", {
26542
+ id: "iconFadeOut",
26543
+ easingFn: "easeOutCubic",
26544
+ hasAnimation: (oldBox, newBox) => {
26545
+ return Boolean((oldBox?.icons?.left && !newBox?.icons?.left) ||
26546
+ (oldBox?.icons?.right && !newBox?.icons?.right) ||
26547
+ (oldBox?.icons?.center && !newBox?.icons?.center));
26548
+ },
26549
+ updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26550
+ const iconOpacity = 1 - EASING_FN[this.easingFn](progress);
26551
+ if (!animatedBox.icons) {
26552
+ animatedBox.icons = {};
26553
+ }
26554
+ if (oldBox.icons.left && !newBox.icons.left) {
26555
+ animatedBox.icons.left = { ...oldBox.icons.left, opacity: iconOpacity };
26556
+ }
26557
+ if (oldBox.icons.right && !newBox.icons.right) {
26558
+ animatedBox.icons.right = { ...oldBox.icons.right, opacity: iconOpacity };
26559
+ }
26560
+ if (oldBox.icons.center && !newBox.icons.center) {
26561
+ animatedBox.icons.center = { ...oldBox.icons.center, opacity: iconOpacity };
26562
+ }
26563
+ },
26564
+ });
26512
26565
  cellAnimationRegistry.add("textChange", {
26513
26566
  id: "textChange",
26514
26567
  easingFn: "easeOutCubic",
@@ -26517,7 +26570,7 @@ stores.inject(MyMetaStore, storeInstance);
26517
26570
  const newText = newBox?.content?.textLines?.join("\n");
26518
26571
  // Note: here, we also animate changes to icons layout (margins/size change, or icon appearing/disappearing)
26519
26572
  // because a change to the icon layout will impact where the text is positioned.
26520
- return (Boolean(oldText && newText && oldText !== newText) || hasIconLayoutChange(newBox, oldBox));
26573
+ return Boolean(oldText && newText && (oldText !== newText || hasIconLayoutChange(newBox, oldBox)));
26521
26574
  },
26522
26575
  updateAnimation: function (progress, animatedBox, oldBox, newBox) {
26523
26576
  const value = EASING_FN[this.easingFn](progress);
@@ -26532,7 +26585,7 @@ stores.inject(MyMetaStore, storeInstance);
26532
26585
  height: newBox.height,
26533
26586
  style: { ...newBox.style },
26534
26587
  skipCellGridLines: true,
26535
- content: newBox.content,
26588
+ content: newBox.content ? { ...newBox.content } : undefined,
26536
26589
  clipRect: newBox.clipRect || {
26537
26590
  ...newBox,
26538
26591
  // large width to avoid clipping the text it it didn't have a clipRect before,
@@ -26552,7 +26605,7 @@ stores.inject(MyMetaStore, storeInstance);
26552
26605
  height: newBox.height,
26553
26606
  style: { ...oldBox.style },
26554
26607
  skipCellGridLines: true,
26555
- content: oldBox.content,
26608
+ content: oldBox.content ? { ...oldBox.content } : undefined,
26556
26609
  clipRect: oldBox.clipRect || {
26557
26610
  ...newBox,
26558
26611
  x: Math.max(0, newBox.x - (oldBox.content?.width || 0)),
@@ -27402,7 +27455,9 @@ stores.inject(MyMetaStore, storeInstance);
27402
27455
  }
27403
27456
  function getFormulaNumberValue(sheetId, formula, getters) {
27404
27457
  const value = getters.evaluateFormula(sheetId, formula);
27405
- return isMatrix(value) ? undefined : tryToNumber(value, getters.getLocale());
27458
+ return isMultipleElementMatrix(value)
27459
+ ? undefined
27460
+ : tryToNumber(toScalar(value), getters.getLocale());
27406
27461
  }
27407
27462
  function getInvalidGaugeRuntime(chart, getters) {
27408
27463
  return {
@@ -31027,6 +31082,9 @@ stores.inject(MyMetaStore, storeInstance);
31027
31082
  return undefined;
31028
31083
  }
31029
31084
  get errorOriginPositionString() {
31085
+ if (this.env.model.getters.isDashboard()) {
31086
+ return "";
31087
+ }
31030
31088
  const evaluationError = this.evaluationError;
31031
31089
  const position = evaluationError?.errorOriginPosition;
31032
31090
  if (!position || deepEquals(position, this.props.cellPosition)) {
@@ -32664,7 +32722,7 @@ stores.inject(MyMetaStore, storeInstance);
32664
32722
  }
32665
32723
  captureSelection(zone, col, row) {
32666
32724
  this.model.selection.capture(this, {
32667
- cell: { col: col || zone.left, row: row || zone.right },
32725
+ cell: { col: col ?? zone.left, row: row ?? zone.right },
32668
32726
  zone,
32669
32727
  }, {
32670
32728
  handleEvent: this.handleEvent.bind(this),
@@ -39175,40 +39233,112 @@ stores.inject(MyMetaStore, storeInstance);
39175
39233
  * In all the sheets, replace the table-only references in the formula cells with standard references.
39176
39234
  */
39177
39235
  function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
39236
+ let deconstructedSheets = null;
39178
39237
  for (const tableSheet of convertedSheets) {
39179
39238
  const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
39239
+ if (!tables || tables.length === 0) {
39240
+ continue;
39241
+ }
39242
+ // Only deconstruct sheets if we are sure there are tables to process
39243
+ if (!deconstructedSheets) {
39244
+ deconstructedSheets = deconstructSheets(convertedSheets);
39245
+ }
39180
39246
  for (const table of tables) {
39181
- const tabRef = table.name + "[";
39182
- for (const sheet of convertedSheets) {
39183
- for (const xc in sheet.cells) {
39184
- const cell = sheet.cells[xc];
39185
- let cellContent = sheet.cells[xc];
39186
- if (cell && cellContent && cellContent.startsWith("=")) {
39187
- let refIndex;
39188
- while ((refIndex = cellContent.indexOf(tabRef)) !== -1) {
39189
- let endIndex = refIndex + tabRef.length;
39190
- let openBrackets = 1;
39191
- while (openBrackets > 0 && endIndex < cellContent.length) {
39192
- if (cellContent[endIndex] === "[") {
39193
- openBrackets++;
39194
- }
39195
- else if (cellContent[endIndex] === "]") {
39196
- openBrackets--;
39197
- }
39198
- endIndex++;
39199
- }
39200
- const reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
39201
- const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
39202
- const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
39203
- cellContent =
39204
- cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
39247
+ for (const sheetId in deconstructedSheets) {
39248
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
39249
+ for (const xc in deconstructedSheets[sheetId]) {
39250
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
39251
+ for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
39252
+ const possibleTable = deconstructedSheets[sheetId][xc][i];
39253
+ if (!possibleTable.endsWith(table.name)) {
39254
+ continue;
39205
39255
  }
39256
+ const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
39257
+ const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
39258
+ const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
39259
+ deconstructedSheets[sheetId][xc][i + 2] =
39260
+ possibleTable.slice(0, possibleTable.indexOf(table.name)) +
39261
+ convertedRef +
39262
+ deconstructedSheets[sheetId][xc][i + 2];
39263
+ deconstructedSheets[sheetId][xc].splice(i, 2);
39206
39264
  }
39207
- sheet.cells[xc] = cellContent;
39265
+ // sheet.cells[xc] = cellContent;
39208
39266
  }
39209
39267
  }
39210
39268
  }
39211
39269
  }
39270
+ if (!deconstructedSheets) {
39271
+ return;
39272
+ }
39273
+ for (const sheetId in deconstructedSheets) {
39274
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
39275
+ for (const xc in deconstructedSheets[sheetId]) {
39276
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
39277
+ if (deconstructedCell.length === 1) {
39278
+ sheet.cells[xc] = deconstructedCell[0];
39279
+ continue;
39280
+ }
39281
+ let newContent = "";
39282
+ for (let i = 0; i < deconstructedCell.length; i += 2) {
39283
+ newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
39284
+ }
39285
+ newContent += deconstructedCell[deconstructedCell.length - 1];
39286
+ sheet.cells[xc] = newContent;
39287
+ }
39288
+ }
39289
+ }
39290
+ /**
39291
+ * Deconstruct the content of the cells in the sheets to extract possible table references.
39292
+ * Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
39293
+ * return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
39294
+ */
39295
+ function deconstructSheets(convertedSheets) {
39296
+ const deconstructedSheets = {};
39297
+ for (const sheet of convertedSheets) {
39298
+ for (const xc in sheet.cells) {
39299
+ const cellContent = sheet.cells[xc];
39300
+ if (!cellContent || !cellContent.startsWith("=")) {
39301
+ continue;
39302
+ }
39303
+ const startIndex = cellContent.indexOf("[");
39304
+ if (startIndex === -1) {
39305
+ continue;
39306
+ }
39307
+ const deconstructedCell = [];
39308
+ let possibleTable = cellContent.slice(0, startIndex);
39309
+ let possibleRef = "";
39310
+ let openBrackets = 1;
39311
+ let mainPossibleTableIndex = 0;
39312
+ let mainOpenBracketIndex = startIndex;
39313
+ for (let index = startIndex + 1; index < cellContent.length; index++) {
39314
+ if (cellContent[index] === "[") {
39315
+ if (openBrackets === 0) {
39316
+ possibleTable = cellContent.slice(mainPossibleTableIndex, index);
39317
+ mainOpenBracketIndex = index;
39318
+ }
39319
+ openBrackets++;
39320
+ continue;
39321
+ }
39322
+ if (cellContent[index] === "]") {
39323
+ openBrackets--;
39324
+ if (openBrackets === 0) {
39325
+ possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
39326
+ deconstructedCell.push(possibleTable);
39327
+ deconstructedCell.push(possibleRef);
39328
+ mainPossibleTableIndex = index + 1;
39329
+ }
39330
+ }
39331
+ }
39332
+ if (deconstructedCell.length) {
39333
+ if (!deconstructedSheets[sheet.id]) {
39334
+ deconstructedSheets[sheet.id] = {};
39335
+ }
39336
+ deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
39337
+ deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
39338
+ }
39339
+ }
39340
+ }
39341
+ return deconstructedSheets;
39212
39342
  }
39213
39343
  /**
39214
39344
  * Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
@@ -45520,10 +45650,10 @@ stores.inject(MyMetaStore, storeInstance);
45520
45650
  const cellValue = isFormula(content)
45521
45651
  ? this.getters.evaluateFormula(this.sheetId, content)
45522
45652
  : parseLiteral(content, this.getters.getLocale());
45523
- if (isMatrix(cellValue)) {
45653
+ if (isMultipleElementMatrix(cellValue)) {
45524
45654
  return true;
45525
45655
  }
45526
- const validationResult = this.getters.getValidationResultForCellValue(cellValue, cellPosition);
45656
+ const validationResult = this.getters.getValidationResultForCellValue(toScalar(cellValue), cellPosition);
45527
45657
  if (!validationResult.isValid && validationResult.rule.isBlocking) {
45528
45658
  return false;
45529
45659
  }
@@ -47944,6 +48074,7 @@ stores.inject(MyMetaStore, storeInstance);
47944
48074
  continue;
47945
48075
  }
47946
48076
  ctx.save();
48077
+ ctx.globalAlpha = icon.opacity ?? 1;
47947
48078
  ctx.beginPath();
47948
48079
  const clipRect = icon.clipRect || box;
47949
48080
  ctx.rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
@@ -50634,10 +50765,10 @@ stores.inject(MyMetaStore, storeInstance);
50634
50765
  return tryToNumber(value, locale) !== undefined;
50635
50766
  }
50636
50767
  const evaluatedValue = this.env.model.getters.evaluateFormula(this.sheetId, value);
50637
- if (isMatrix(evaluatedValue)) {
50768
+ if (isMultipleElementMatrix(evaluatedValue)) {
50638
50769
  return false;
50639
50770
  }
50640
- return tryToNumber(evaluatedValue, locale) !== undefined;
50771
+ return tryToNumber(toScalar(evaluatedValue), locale) !== undefined;
50641
50772
  }
50642
50773
  get sheetId() {
50643
50774
  const chart = this.env.model.getters.getChart(this.props.figureId);
@@ -51491,12 +51622,32 @@ stores.inject(MyMetaStore, storeInstance);
51491
51622
  static template = "o-spreadsheet-ChartPanel";
51492
51623
  static components = { Section, ChartTypePicker };
51493
51624
  static props = { onCloseSidePanel: Function, figureId: String };
51625
+ panelContentRef;
51626
+ scrollPositions = {
51627
+ configuration: 0,
51628
+ design: 0,
51629
+ };
51494
51630
  store;
51495
51631
  get figureId() {
51496
51632
  return this.props.figureId;
51497
51633
  }
51498
51634
  setup() {
51499
51635
  this.store = useLocalStore(MainChartPanelStore);
51636
+ this.panelContentRef = owl.useRef("panelContent");
51637
+ owl.useEffect(() => {
51638
+ const el = this.panelContentRef.el;
51639
+ const activePanel = this.store.panel;
51640
+ if (el) {
51641
+ el.scrollTop = this.scrollPositions[activePanel];
51642
+ }
51643
+ }, () => [this.store.panel]);
51644
+ }
51645
+ switchPanel(panel) {
51646
+ const el = this.panelContentRef.el;
51647
+ if (el) {
51648
+ this.scrollPositions[this.store.panel] = el.scrollTop;
51649
+ }
51650
+ this.store.activatePanel(panel);
51500
51651
  }
51501
51652
  updateChart(figureId, updateDefinition) {
51502
51653
  if (figureId !== this.figureId) {
@@ -52332,6 +52483,9 @@ stores.inject(MyMetaStore, storeInstance);
52332
52483
  this.switchToList();
52333
52484
  }
52334
52485
  }
52486
+ else if (!this.editedCF) {
52487
+ this.switchToList();
52488
+ }
52335
52489
  });
52336
52490
  }
52337
52491
  get conditionalFormats() {
@@ -55445,10 +55599,7 @@ stores.inject(MyMetaStore, storeInstance);
55445
55599
  if (finalCell.value === null) {
55446
55600
  return { value: _t("(Undefined)") };
55447
55601
  }
55448
- return {
55449
- value: finalCell.value,
55450
- format: finalCell.format,
55451
- };
55602
+ return finalCell;
55452
55603
  }
55453
55604
  getPivotCellValueAndFormat(measureId, domain) {
55454
55605
  const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
@@ -55686,7 +55837,6 @@ stores.inject(MyMetaStore, storeInstance);
55686
55837
  ui: SpreadsheetPivot,
55687
55838
  definition: SpreadsheetPivotRuntimeDefinition,
55688
55839
  externalData: false,
55689
- onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
55690
55840
  dateGranularities: [...dateGranularities],
55691
55841
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
55692
55842
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -64337,7 +64487,7 @@ stores.inject(MyMetaStore, storeInstance);
64337
64487
  onIterationEndEvaluationRegistry.add("pivots", (getters) => {
64338
64488
  for (const pivotId of getters.getPivotIds()) {
64339
64489
  const pivot = getters.getPivot(pivotId);
64340
- pivotRegistry.get(pivot.type).onIterationEndEvaluation(pivot);
64490
+ pivot.markAsDirtyForEvaluation?.();
64341
64491
  }
64342
64492
  });
64343
64493
 
@@ -66801,12 +66951,12 @@ stores.inject(MyMetaStore, storeInstance);
66801
66951
  }
66802
66952
  return this.getters.evaluateFormula(sheetId, value) ?? "";
66803
66953
  });
66804
- if (evaluatedCriterionValues.some(isMatrix)) {
66954
+ if (evaluatedCriterionValues.some(isMultipleElementMatrix)) {
66805
66955
  return false;
66806
66956
  }
66807
66957
  const evaluatedCriterion = {
66808
66958
  type: rule.operator,
66809
- values: evaluatedCriterionValues,
66959
+ values: evaluatedCriterionValues.map(toScalar),
66810
66960
  };
66811
66961
  return evaluator.isValueValid(cell.value ?? "", evaluatedCriterion, this.getters, sheetId);
66812
66962
  }
@@ -66966,10 +67116,10 @@ stores.inject(MyMetaStore, storeInstance);
66966
67116
  const evaluator = criterionEvaluatorRegistry.get(criterion.type);
66967
67117
  const offset = this.getCellOffsetInRule(cellPosition, rule);
66968
67118
  const evaluatedCriterionValues = this.getEvaluatedCriterionValues(sheetId, offset, criterion);
66969
- if (evaluatedCriterionValues.some(isMatrix)) {
67119
+ if (evaluatedCriterionValues.some(isMultipleElementMatrix)) {
66970
67120
  return undefined;
66971
67121
  }
66972
- const evaluatedCriterion = { ...criterion, values: evaluatedCriterionValues };
67122
+ const evaluatedCriterion = { ...criterion, values: evaluatedCriterionValues.map(toScalar) };
66973
67123
  if (evaluator.isValueValid(cellValue, evaluatedCriterion, this.getters, sheetId)) {
66974
67124
  return undefined;
66975
67125
  }
@@ -67612,13 +67762,13 @@ stores.inject(MyMetaStore, storeInstance);
67612
67762
  super(custom, params);
67613
67763
  this.getters = params.getters;
67614
67764
  }
67615
- init(params) {
67765
+ markAsDirtyForEvaluation() {
67616
67766
  this.cache = {};
67617
67767
  this.rankAsc = {};
67618
67768
  this.rankDesc = {};
67619
67769
  this.runningTotal = {};
67620
67770
  this.runningTotalInPercent = {};
67621
- super.init(params);
67771
+ super.markAsDirtyForEvaluation?.();
67622
67772
  }
67623
67773
  getPivotCellValueAndFormat(measureName, domain) {
67624
67774
  return this.getMeasureDisplayValue(measureName, domain);
@@ -67743,7 +67893,7 @@ stores.inject(MyMetaStore, storeInstance);
67743
67893
  return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
67744
67894
  }
67745
67895
  }
67746
- return tree;
67896
+ return [];
67747
67897
  }
67748
67898
  treeToLeafDomains(tree, parentDomain = []) {
67749
67899
  const domains = [];
@@ -68431,9 +68581,9 @@ stores.inject(MyMetaStore, storeInstance);
68431
68581
  .add("ALPHANUMERIC_INCREMENT_MODIFIER", {
68432
68582
  apply: (rule, data) => {
68433
68583
  rule.current += rule.increment;
68434
- const content = `${rule.prefix}${rule.current
68435
- .toString()
68436
- .padStart(rule.numberPostfixLength || 0, "0")}`;
68584
+ let value = Math.abs(rule.current).toString();
68585
+ value = "0".repeat(Math.max(rule.numberPostfixLength - value.length, 0)) + value;
68586
+ const content = `${rule.prefix}${value}`;
68437
68587
  return {
68438
68588
  cellData: {
68439
68589
  border: data.border,
@@ -68551,6 +68701,7 @@ stores.inject(MyMetaStore, storeInstance);
68551
68701
  const numberPostfixRegExp = /(\d+)$/;
68552
68702
  const stringPrefixRegExp = /^(.*\D+)/;
68553
68703
  const alphaNumericValueRegExp = /^(.*\D+)(\d+)$/;
68704
+ const leadingZerosRegex = /^0*/;
68554
68705
  /**
68555
68706
  * Get the consecutive evaluated cells that can pass the filter function (e.g. certain type filter).
68556
68707
  * Return the one which contains the given cell
@@ -68682,12 +68833,18 @@ stores.inject(MyMetaStore, storeInstance);
68682
68833
  generateRule: (cell, cells, direction) => {
68683
68834
  const numberPostfix = parseInt(cell.content.match(numberPostfixRegExp)[0]);
68684
68835
  const prefix = cell.content.match(stringPrefixRegExp)[0];
68685
- const numberPostfixLength = cell.content.length - prefix.length;
68686
68836
  const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === CellValueType.text &&
68687
- alphaNumericValueRegExp.test(evaluatedCell.value)) // get consecutive alphanumeric cells, no matter what the prefix is
68837
+ alphaNumericValueRegExp.test(evaluatedCell.value))
68838
+ // get consecutive alphanumeric cells, no matter what the prefix is
68688
68839
  .filter((cell) => prefix === (cell.value ?? "").toString().match(stringPrefixRegExp)[0])
68689
- .map((cell) => parseInt((cell.value ?? "").toString().match(numberPostfixRegExp)[0]));
68690
- let increment = calculateIncrementBasedOnGroup(group);
68840
+ .map((cell) => (cell.value ?? "").toString().match(numberPostfixRegExp)[0]);
68841
+ // find the length of number with the most leading zeros
68842
+ const mostLeadingZeros = group.reduce((candidate, current) => {
68843
+ const currentLength = current.match(leadingZerosRegex)[0].length;
68844
+ return currentLength > candidate[1] ? [current, currentLength] : candidate;
68845
+ }, [group[0], 0]);
68846
+ const numberPostfixLength = mostLeadingZeros[1] ? mostLeadingZeros[0].length : 0;
68847
+ let increment = calculateIncrementBasedOnGroup(group.map((x) => parseInt(x)));
68691
68848
  if (["up", "left"].includes(direction) && group.length === 1) {
68692
68849
  increment = -increment;
68693
68850
  }
@@ -73475,12 +73632,12 @@ stores.inject(MyMetaStore, storeInstance);
73475
73632
  }
73476
73633
  return this.getters.evaluateFormula(sheetId, value) ?? "";
73477
73634
  });
73478
- if (evaluatedCriterionValues.some(isMatrix)) {
73635
+ if (evaluatedCriterionValues.some(isMultipleElementMatrix)) {
73479
73636
  continue;
73480
73637
  }
73481
73638
  const evaluatedCriterion = {
73482
73639
  type: filterValue.type,
73483
- values: evaluatedCriterionValues,
73640
+ values: evaluatedCriterionValues.map(toScalar),
73484
73641
  dateValue: filterValue.dateValue,
73485
73642
  };
73486
73643
  for (let row = filteredZone.top; row <= filteredZone.bottom; row++) {
@@ -80982,26 +81139,28 @@ stores.inject(MyMetaStore, storeInstance);
80982
81139
  bottom: Math.min(this.getters.getNumberRows(sheetId) - 1, bottom),
80983
81140
  };
80984
81141
  };
80985
- const { col: refCol, row: refRow } = this.getReferencePosition();
81142
+ const { cell: refCell, zone: refZone } = this.getReferenceAnchor();
81143
+ const { col: refCol, row: refRow } = refCell;
80986
81144
  // check if we can shrink selection
80987
81145
  let n = 0;
80988
81146
  while (result !== null) {
80989
81147
  n++;
80990
81148
  if (deltaCol < 0) {
80991
81149
  const newRight = this.getNextAvailableCol(deltaCol, right - (n - 1), refRow);
80992
- result = refCol <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
81150
+ result = refZone.right <= right - n ? expand({ top, left, bottom, right: newRight }) : null;
80993
81151
  }
80994
81152
  if (deltaCol > 0) {
80995
81153
  const newLeft = this.getNextAvailableCol(deltaCol, left + (n - 1), refRow);
80996
- result = left + n <= refCol ? expand({ top, left: newLeft, bottom, right }) : null;
81154
+ result = left + n <= refZone.left ? expand({ top, left: newLeft, bottom, right }) : null;
80997
81155
  }
80998
81156
  if (deltaRow < 0) {
80999
81157
  const newBottom = this.getNextAvailableRow(deltaRow, refCol, bottom - (n - 1));
81000
- result = refRow <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
81158
+ result =
81159
+ refZone.bottom <= bottom - n ? expand({ top, left, bottom: newBottom, right }) : null;
81001
81160
  }
81002
81161
  if (deltaRow > 0) {
81003
81162
  const newTop = this.getNextAvailableRow(deltaRow, refCol, top + (n - 1));
81004
- result = top + n <= refRow ? expand({ top: newTop, left, bottom, right }) : null;
81163
+ result = top + n <= refZone.top ? expand({ top: newTop, left, bottom, right }) : null;
81005
81164
  }
81006
81165
  result = result ? reorderZone(result) : result;
81007
81166
  if (result && !isEqual(result, anchor.zone)) {
@@ -81231,18 +81390,26 @@ stores.inject(MyMetaStore, storeInstance);
81231
81390
  * If the anchor is hidden, browses from left to right and top to bottom to
81232
81391
  * find a visible cell.
81233
81392
  */
81234
- getReferencePosition() {
81393
+ getReferenceAnchor() {
81235
81394
  const sheetId = this.getters.getActiveSheetId();
81236
81395
  const anchor = this.anchor;
81237
81396
  const { left, right, top, bottom } = anchor.zone;
81238
81397
  const { col: anchorCol, row: anchorRow } = anchor.cell;
81398
+ const col = this.getters.isColHidden(sheetId, anchorCol)
81399
+ ? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
81400
+ : anchorCol;
81401
+ const row = this.getters.isRowHidden(sheetId, anchorRow)
81402
+ ? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
81403
+ : anchorRow;
81404
+ const zone = this.getters.expandZone(sheetId, {
81405
+ left: col,
81406
+ right: col,
81407
+ top: row,
81408
+ bottom: row,
81409
+ });
81239
81410
  return {
81240
- col: this.getters.isColHidden(sheetId, anchorCol)
81241
- ? this.getters.findVisibleHeader(sheetId, "COL", left, right) || anchorCol
81242
- : anchorCol,
81243
- row: this.getters.isRowHidden(sheetId, anchorRow)
81244
- ? this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) || anchorRow
81245
- : anchorRow,
81411
+ cell: { col, row },
81412
+ zone,
81246
81413
  };
81247
81414
  }
81248
81415
  deltaToTarget(position, direction, step) {
@@ -84398,6 +84565,7 @@ stores.inject(MyMetaStore, storeInstance);
84398
84565
  PivotSidePanelStore,
84399
84566
  PivotMeasureDisplayPanelStore,
84400
84567
  ClientFocusStore,
84568
+ GridRenderer,
84401
84569
  };
84402
84570
  function addFunction(functionName, functionDescription) {
84403
84571
  functionRegistry.add(functionName, functionDescription);
@@ -84464,9 +84632,9 @@ stores.inject(MyMetaStore, storeInstance);
84464
84632
  exports.tokenize = tokenize;
84465
84633
 
84466
84634
 
84467
- __info__.version = "18.5.0-alpha.0";
84468
- __info__.date = "2025-06-24T12:26:38.163Z";
84469
- __info__.hash = "ed0f325";
84635
+ __info__.version = "18.5.0-alpha.2";
84636
+ __info__.date = "2025-07-11T11:13:53.317Z";
84637
+ __info__.hash = "6d42178";
84470
84638
 
84471
84639
 
84472
84640
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);