@odoo/o-spreadsheet 17.0.7 → 17.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.7
6
- * @date 2024-01-12T13:42:04.654Z
7
- * @hash cadb817
5
+ * @version 17.0.9
6
+ * @date 2024-01-29T13:53:22.963Z
7
+ * @hash 3c1209a
8
8
  */
9
9
 
10
10
  'use strict';
@@ -481,7 +481,7 @@ function isBoolean(str) {
481
481
  const upperCased = str.toUpperCase();
482
482
  return upperCased === "TRUE" || upperCased === "FALSE";
483
483
  }
484
- const MARKDOWN_LINK_REGEX = /^\[([^\[]+)\]\((.+)\)$/;
484
+ const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
485
485
  //link must start with http or https
486
486
  //https://stackoverflow.com/a/3809435/4760614
487
487
  const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
@@ -2122,6 +2122,7 @@ exports.CommandResult = void 0;
2122
2122
  CommandResult["BlockingValidationRule"] = "BlockingValidationRule";
2123
2123
  CommandResult["InvalidCopyPasteSelection"] = "InvalidCopyPasteSelection";
2124
2124
  CommandResult["NoChanges"] = "NoChanges";
2125
+ CommandResult["InvalidInputId"] = "InvalidInputId";
2125
2126
  })(exports.CommandResult || (exports.CommandResult = {}));
2126
2127
 
2127
2128
  const DEFAULT_LOCALES = [
@@ -3266,27 +3267,30 @@ function roundFormat(format) {
3266
3267
  }
3267
3268
  function createLargeNumberFormat(format, magnitude, postFix, locale) {
3268
3269
  const internalFormat = parseFormat(format || "#,##0");
3269
- const largeNumberFormat = internalFormat
3270
- .map((formatPart) => {
3271
- if (formatPart.type === "NUMBER") {
3272
- return [
3273
- {
3274
- ...formatPart,
3275
- format: {
3276
- ...formatPart.format,
3277
- magnitude,
3278
- decimalPart: undefined,
3279
- },
3280
- },
3281
- {
3282
- type: "STRING",
3283
- format: postFix,
3284
- },
3285
- ];
3270
+ const largeNumberFormat = [];
3271
+ for (let i = 0; i < internalFormat.length; i++) {
3272
+ const formatPart = internalFormat[i];
3273
+ if (formatPart.type !== "NUMBER") {
3274
+ largeNumberFormat.push(formatPart);
3275
+ continue;
3286
3276
  }
3287
- return formatPart;
3288
- })
3289
- .flat();
3277
+ largeNumberFormat.push({
3278
+ ...formatPart,
3279
+ format: {
3280
+ ...formatPart.format,
3281
+ magnitude,
3282
+ decimalPart: undefined,
3283
+ },
3284
+ });
3285
+ largeNumberFormat.push({
3286
+ type: "STRING",
3287
+ format: postFix,
3288
+ });
3289
+ const nextFormatPart = internalFormat[i + 1];
3290
+ if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
3291
+ i++;
3292
+ }
3293
+ }
3290
3294
  return convertInternalFormatToFormat(largeNumberFormat);
3291
3295
  }
3292
3296
  function changeDecimalPlaces(format, step, locale) {
@@ -26808,6 +26812,9 @@ class Composer extends owl.Component {
26808
26812
  const token = tokens.filter((token) => token.value.includes(currentSelectedText) &&
26809
26813
  token.start <= currentSelection.start &&
26810
26814
  token.end >= currentSelection.end)[0];
26815
+ if (!token) {
26816
+ return;
26817
+ }
26811
26818
  if (token.type === "REFERENCE") {
26812
26819
  this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", {
26813
26820
  start: token.start,
@@ -27324,6 +27331,7 @@ const CHECKBOX_WIDTH = 15;
27324
27331
  const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
27325
27332
  css /* scss */ `
27326
27333
  .o-dv-checkbox {
27334
+ box-sizing: border-box !important;
27327
27335
  width: ${CHECKBOX_WIDTH}px;
27328
27336
  height: ${CHECKBOX_WIDTH}px;
27329
27337
  accent-color: #808080;
@@ -38403,9 +38411,9 @@ class RangeAdapter {
38403
38411
  * Get a Xc string that represent a part of a range
38404
38412
  */
38405
38413
  getRangePartString(range, part) {
38406
- const colFixed = range.parts && range.parts[part].colFixed ? "$" : "";
38414
+ const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
38407
38415
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
38408
- const rowFixed = range.parts && range.parts[part].rowFixed ? "$" : "";
38416
+ const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
38409
38417
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
38410
38418
  let str = "";
38411
38419
  if (range.isFullCol) {
@@ -39837,22 +39845,17 @@ class CompilationParametersBuilder {
39837
39845
  * The `compute` of the formula's function must process it completely
39838
39846
  */
39839
39847
  refFn(range, isMeta, functionName, paramNumber) {
39848
+ this.assertRangeValid(range);
39840
39849
  if (isMeta) {
39841
39850
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
39842
39851
  return { value: zoneToXc(range.zone) };
39843
39852
  }
39844
- if (!isZoneValid(range.zone)) {
39845
- throw new InvalidReferenceError();
39846
- }
39847
39853
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
39848
39854
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
39849
39855
  throw new Error(paramNumber
39850
39856
  ? _t("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
39851
39857
  : _t("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
39852
39858
  }
39853
- if (range.invalidSheetName) {
39854
- throw new Error(_t("Invalid sheet name: %s", range.invalidSheetName));
39855
- }
39856
39859
  const position = { sheetId: range.sheetId, col: range.zone.left, row: range.zone.top };
39857
39860
  return this.readCell(position);
39858
39861
  }
@@ -39887,10 +39890,10 @@ class CompilationParametersBuilder {
39887
39890
  * Note that each col is possibly sparse: it only contain the values of cells
39888
39891
  * that are actually present in the grid.
39889
39892
  */
39890
- range({ sheetId, zone }) {
39891
- if (!isZoneValid(zone)) {
39892
- throw new InvalidReferenceError();
39893
- }
39893
+ range(range) {
39894
+ this.assertRangeValid(range);
39895
+ const sheetId = range.sheetId;
39896
+ const zone = range.zone;
39894
39897
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
39895
39898
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
39896
39899
  const sheetZone = this.getters.getSheetZone(sheetId);
@@ -39927,6 +39930,14 @@ class CompilationParametersBuilder {
39927
39930
  this.rangeCache[cacheKey] = matrix;
39928
39931
  return matrix;
39929
39932
  }
39933
+ assertRangeValid(range) {
39934
+ if (!isZoneValid(range.zone)) {
39935
+ throw new InvalidReferenceError();
39936
+ }
39937
+ if (range.invalidSheetName) {
39938
+ throw new Error(_t("Invalid sheet name: %s", range.invalidSheetName));
39939
+ }
39940
+ }
39930
39941
  }
39931
39942
 
39932
39943
  function quickselect(arr, k, left, right, compare) {
@@ -45999,27 +46010,6 @@ class SelectionInputPlugin extends UIPlugin {
45999
46010
  // ---------------------------------------------------------------------------
46000
46011
  // Command Handling
46001
46012
  // ---------------------------------------------------------------------------
46002
- allowDispatch(cmd) {
46003
- switch (cmd.type) {
46004
- case "ADD_RANGE":
46005
- case "ADD_EMPTY_RANGE":
46006
- if (this.inputHasSingleRange && this.ranges.length === 1) {
46007
- return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46008
- }
46009
- break;
46010
- case "REMOVE_RANGE":
46011
- if (this.ranges.length === 1) {
46012
- return "MinimumRangesReached" /* CommandResult.MinimumRangesReached */;
46013
- }
46014
- break;
46015
- case "CHANGE_RANGE":
46016
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
46017
- return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46018
- }
46019
- break;
46020
- }
46021
- return "Success" /* CommandResult.Success */;
46022
- }
46023
46013
  handleEvent(event) {
46024
46014
  if (this.focusedRangeIndex === null) {
46025
46015
  return;
@@ -46257,6 +46247,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
46257
46247
  // Command Handling
46258
46248
  // ---------------------------------------------------------------------------
46259
46249
  allowDispatch(cmd) {
46250
+ switch (cmd.type) {
46251
+ case "FOCUS_RANGE":
46252
+ case "CHANGE_RANGE":
46253
+ case "ADD_EMPTY_RANGE":
46254
+ case "REMOVE_RANGE":
46255
+ if (!this.inputs[cmd.id]) {
46256
+ return "InvalidInputId" /* CommandResult.InvalidInputId */;
46257
+ }
46258
+ }
46260
46259
  switch (cmd.type) {
46261
46260
  case "FOCUS_RANGE":
46262
46261
  const index = this.currentInput?.getIndex(cmd.rangeId);
@@ -46264,9 +46263,25 @@ class SelectionInputsManagerPlugin extends UIPlugin {
46264
46263
  return "InputAlreadyFocused" /* CommandResult.InputAlreadyFocused */;
46265
46264
  }
46266
46265
  break;
46267
- }
46268
- if (this.currentInput) {
46269
- return this.currentInput.allowDispatch(cmd);
46266
+ case "ADD_RANGE":
46267
+ case "ADD_EMPTY_RANGE":
46268
+ const input = this.inputs[cmd.id];
46269
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
46270
+ return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46271
+ }
46272
+ break;
46273
+ case "REMOVE_RANGE":
46274
+ if (this.inputs[cmd.id].ranges.length === 1) {
46275
+ return "MinimumRangesReached" /* CommandResult.MinimumRangesReached */;
46276
+ }
46277
+ break;
46278
+ case "CHANGE_RANGE": {
46279
+ const input = this.inputs[cmd.id];
46280
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
46281
+ return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46282
+ }
46283
+ break;
46284
+ }
46270
46285
  }
46271
46286
  return "Success" /* CommandResult.Success */;
46272
46287
  }
@@ -48575,9 +48590,10 @@ class EditionPlugin extends UIPlugin {
48575
48590
  */
48576
48591
  getReferencedRanges() {
48577
48592
  const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
48578
- return this.currentTokens
48593
+ const referenceRanges = this.currentTokens
48579
48594
  .filter((token) => token.type === "REFERENCE")
48580
48595
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
48596
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
48581
48597
  }
48582
48598
  getAutoCompleteDataValidationValues() {
48583
48599
  if (this.mode === "inactive") {
@@ -56769,6 +56785,6 @@ exports.setTranslationMethod = setTranslationMethod;
56769
56785
  exports.tokenize = tokenize;
56770
56786
 
56771
56787
 
56772
- __info__.version = "17.0.7";
56773
- __info__.date = "2024-01-12T13:42:04.654Z";
56774
- __info__.hash = "cadb817";
56788
+ __info__.version = "17.0.9";
56789
+ __info__.date = "2024-01-29T13:53:22.963Z";
56790
+ __info__.hash = "3c1209a";
@@ -2531,7 +2531,8 @@ declare const enum CommandResult {
2531
2531
  InvalidNumberOfCriterionValues = "InvalidNumberOfCriterionValues",
2532
2532
  BlockingValidationRule = "BlockingValidationRule",
2533
2533
  InvalidCopyPasteSelection = "InvalidCopyPasteSelection",
2534
- NoChanges = "NoChanges"
2534
+ NoChanges = "NoChanges",
2535
+ InvalidInputId = "InvalidInputId"
2535
2536
  }
2536
2537
  interface CommandHandler<T> {
2537
2538
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -4603,14 +4604,13 @@ interface RangeInputValue {
4603
4604
  * This plugin handles this internal state.
4604
4605
  */
4605
4606
  declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<SelectionEvent> {
4606
- private readonly inputHasSingleRange;
4607
+ readonly inputHasSingleRange: boolean;
4607
4608
  static layers: LAYERS[];
4608
4609
  static getters: never[];
4609
4610
  ranges: RangeInputValue[];
4610
4611
  focusedRangeIndex: number | null;
4611
4612
  private inputSheetId;
4612
4613
  constructor(config: UIPluginConfig, initialRanges: string[], inputHasSingleRange: boolean);
4613
- allowDispatch(cmd: LocalCommand): CommandResult;
4614
4614
  handleEvent(event: SelectionEvent): void;
4615
4615
  handle(cmd: Command): void;
4616
4616
  getSelectionInputValue(): string[];
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.7
6
- * @date 2024-01-12T13:42:04.654Z
7
- * @hash cadb817
5
+ * @version 17.0.9
6
+ * @date 2024-01-29T13:53:22.963Z
7
+ * @hash 3c1209a
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -479,7 +479,7 @@ function isBoolean(str) {
479
479
  const upperCased = str.toUpperCase();
480
480
  return upperCased === "TRUE" || upperCased === "FALSE";
481
481
  }
482
- const MARKDOWN_LINK_REGEX = /^\[([^\[]+)\]\((.+)\)$/;
482
+ const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
483
483
  //link must start with http or https
484
484
  //https://stackoverflow.com/a/3809435/4760614
485
485
  const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
@@ -2120,6 +2120,7 @@ var CommandResult;
2120
2120
  CommandResult["BlockingValidationRule"] = "BlockingValidationRule";
2121
2121
  CommandResult["InvalidCopyPasteSelection"] = "InvalidCopyPasteSelection";
2122
2122
  CommandResult["NoChanges"] = "NoChanges";
2123
+ CommandResult["InvalidInputId"] = "InvalidInputId";
2123
2124
  })(CommandResult || (CommandResult = {}));
2124
2125
 
2125
2126
  const DEFAULT_LOCALES = [
@@ -3264,27 +3265,30 @@ function roundFormat(format) {
3264
3265
  }
3265
3266
  function createLargeNumberFormat(format, magnitude, postFix, locale) {
3266
3267
  const internalFormat = parseFormat(format || "#,##0");
3267
- const largeNumberFormat = internalFormat
3268
- .map((formatPart) => {
3269
- if (formatPart.type === "NUMBER") {
3270
- return [
3271
- {
3272
- ...formatPart,
3273
- format: {
3274
- ...formatPart.format,
3275
- magnitude,
3276
- decimalPart: undefined,
3277
- },
3278
- },
3279
- {
3280
- type: "STRING",
3281
- format: postFix,
3282
- },
3283
- ];
3268
+ const largeNumberFormat = [];
3269
+ for (let i = 0; i < internalFormat.length; i++) {
3270
+ const formatPart = internalFormat[i];
3271
+ if (formatPart.type !== "NUMBER") {
3272
+ largeNumberFormat.push(formatPart);
3273
+ continue;
3284
3274
  }
3285
- return formatPart;
3286
- })
3287
- .flat();
3275
+ largeNumberFormat.push({
3276
+ ...formatPart,
3277
+ format: {
3278
+ ...formatPart.format,
3279
+ magnitude,
3280
+ decimalPart: undefined,
3281
+ },
3282
+ });
3283
+ largeNumberFormat.push({
3284
+ type: "STRING",
3285
+ format: postFix,
3286
+ });
3287
+ const nextFormatPart = internalFormat[i + 1];
3288
+ if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
3289
+ i++;
3290
+ }
3291
+ }
3288
3292
  return convertInternalFormatToFormat(largeNumberFormat);
3289
3293
  }
3290
3294
  function changeDecimalPlaces(format, step, locale) {
@@ -26806,6 +26810,9 @@ class Composer extends Component {
26806
26810
  const token = tokens.filter((token) => token.value.includes(currentSelectedText) &&
26807
26811
  token.start <= currentSelection.start &&
26808
26812
  token.end >= currentSelection.end)[0];
26813
+ if (!token) {
26814
+ return;
26815
+ }
26809
26816
  if (token.type === "REFERENCE") {
26810
26817
  this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", {
26811
26818
  start: token.start,
@@ -27322,6 +27329,7 @@ const CHECKBOX_WIDTH = 15;
27322
27329
  const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
27323
27330
  css /* scss */ `
27324
27331
  .o-dv-checkbox {
27332
+ box-sizing: border-box !important;
27325
27333
  width: ${CHECKBOX_WIDTH}px;
27326
27334
  height: ${CHECKBOX_WIDTH}px;
27327
27335
  accent-color: #808080;
@@ -38401,9 +38409,9 @@ class RangeAdapter {
38401
38409
  * Get a Xc string that represent a part of a range
38402
38410
  */
38403
38411
  getRangePartString(range, part) {
38404
- const colFixed = range.parts && range.parts[part].colFixed ? "$" : "";
38412
+ const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
38405
38413
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
38406
- const rowFixed = range.parts && range.parts[part].rowFixed ? "$" : "";
38414
+ const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
38407
38415
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
38408
38416
  let str = "";
38409
38417
  if (range.isFullCol) {
@@ -39835,22 +39843,17 @@ class CompilationParametersBuilder {
39835
39843
  * The `compute` of the formula's function must process it completely
39836
39844
  */
39837
39845
  refFn(range, isMeta, functionName, paramNumber) {
39846
+ this.assertRangeValid(range);
39838
39847
  if (isMeta) {
39839
39848
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
39840
39849
  return { value: zoneToXc(range.zone) };
39841
39850
  }
39842
- if (!isZoneValid(range.zone)) {
39843
- throw new InvalidReferenceError();
39844
- }
39845
39851
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
39846
39852
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
39847
39853
  throw new Error(paramNumber
39848
39854
  ? _t("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
39849
39855
  : _t("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
39850
39856
  }
39851
- if (range.invalidSheetName) {
39852
- throw new Error(_t("Invalid sheet name: %s", range.invalidSheetName));
39853
- }
39854
39857
  const position = { sheetId: range.sheetId, col: range.zone.left, row: range.zone.top };
39855
39858
  return this.readCell(position);
39856
39859
  }
@@ -39885,10 +39888,10 @@ class CompilationParametersBuilder {
39885
39888
  * Note that each col is possibly sparse: it only contain the values of cells
39886
39889
  * that are actually present in the grid.
39887
39890
  */
39888
- range({ sheetId, zone }) {
39889
- if (!isZoneValid(zone)) {
39890
- throw new InvalidReferenceError();
39891
- }
39891
+ range(range) {
39892
+ this.assertRangeValid(range);
39893
+ const sheetId = range.sheetId;
39894
+ const zone = range.zone;
39892
39895
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
39893
39896
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
39894
39897
  const sheetZone = this.getters.getSheetZone(sheetId);
@@ -39925,6 +39928,14 @@ class CompilationParametersBuilder {
39925
39928
  this.rangeCache[cacheKey] = matrix;
39926
39929
  return matrix;
39927
39930
  }
39931
+ assertRangeValid(range) {
39932
+ if (!isZoneValid(range.zone)) {
39933
+ throw new InvalidReferenceError();
39934
+ }
39935
+ if (range.invalidSheetName) {
39936
+ throw new Error(_t("Invalid sheet name: %s", range.invalidSheetName));
39937
+ }
39938
+ }
39928
39939
  }
39929
39940
 
39930
39941
  function quickselect(arr, k, left, right, compare) {
@@ -45997,27 +46008,6 @@ class SelectionInputPlugin extends UIPlugin {
45997
46008
  // ---------------------------------------------------------------------------
45998
46009
  // Command Handling
45999
46010
  // ---------------------------------------------------------------------------
46000
- allowDispatch(cmd) {
46001
- switch (cmd.type) {
46002
- case "ADD_RANGE":
46003
- case "ADD_EMPTY_RANGE":
46004
- if (this.inputHasSingleRange && this.ranges.length === 1) {
46005
- return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46006
- }
46007
- break;
46008
- case "REMOVE_RANGE":
46009
- if (this.ranges.length === 1) {
46010
- return "MinimumRangesReached" /* CommandResult.MinimumRangesReached */;
46011
- }
46012
- break;
46013
- case "CHANGE_RANGE":
46014
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
46015
- return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46016
- }
46017
- break;
46018
- }
46019
- return "Success" /* CommandResult.Success */;
46020
- }
46021
46011
  handleEvent(event) {
46022
46012
  if (this.focusedRangeIndex === null) {
46023
46013
  return;
@@ -46255,6 +46245,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
46255
46245
  // Command Handling
46256
46246
  // ---------------------------------------------------------------------------
46257
46247
  allowDispatch(cmd) {
46248
+ switch (cmd.type) {
46249
+ case "FOCUS_RANGE":
46250
+ case "CHANGE_RANGE":
46251
+ case "ADD_EMPTY_RANGE":
46252
+ case "REMOVE_RANGE":
46253
+ if (!this.inputs[cmd.id]) {
46254
+ return "InvalidInputId" /* CommandResult.InvalidInputId */;
46255
+ }
46256
+ }
46258
46257
  switch (cmd.type) {
46259
46258
  case "FOCUS_RANGE":
46260
46259
  const index = this.currentInput?.getIndex(cmd.rangeId);
@@ -46262,9 +46261,25 @@ class SelectionInputsManagerPlugin extends UIPlugin {
46262
46261
  return "InputAlreadyFocused" /* CommandResult.InputAlreadyFocused */;
46263
46262
  }
46264
46263
  break;
46265
- }
46266
- if (this.currentInput) {
46267
- return this.currentInput.allowDispatch(cmd);
46264
+ case "ADD_RANGE":
46265
+ case "ADD_EMPTY_RANGE":
46266
+ const input = this.inputs[cmd.id];
46267
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
46268
+ return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46269
+ }
46270
+ break;
46271
+ case "REMOVE_RANGE":
46272
+ if (this.inputs[cmd.id].ranges.length === 1) {
46273
+ return "MinimumRangesReached" /* CommandResult.MinimumRangesReached */;
46274
+ }
46275
+ break;
46276
+ case "CHANGE_RANGE": {
46277
+ const input = this.inputs[cmd.id];
46278
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
46279
+ return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
46280
+ }
46281
+ break;
46282
+ }
46268
46283
  }
46269
46284
  return "Success" /* CommandResult.Success */;
46270
46285
  }
@@ -48573,9 +48588,10 @@ class EditionPlugin extends UIPlugin {
48573
48588
  */
48574
48589
  getReferencedRanges() {
48575
48590
  const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
48576
- return this.currentTokens
48591
+ const referenceRanges = this.currentTokens
48577
48592
  .filter((token) => token.type === "REFERENCE")
48578
48593
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
48594
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
48579
48595
  }
48580
48596
  getAutoCompleteDataValidationValues() {
48581
48597
  if (this.mode === "inactive") {
@@ -56732,6 +56748,6 @@ const constants = {
56732
56748
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
56733
56749
 
56734
56750
 
56735
- __info__.version = "17.0.7";
56736
- __info__.date = "2024-01-12T13:42:04.654Z";
56737
- __info__.hash = "cadb817";
56751
+ __info__.version = "17.0.9";
56752
+ __info__.date = "2024-01-29T13:53:22.963Z";
56753
+ __info__.hash = "3c1209a";