@odoo/o-spreadsheet 16.4.32 → 16.4.34

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.
@@ -14838,7 +14838,7 @@ const machine = {
14838
14838
  function matchReference(tokens) {
14839
14839
  let head = 0;
14840
14840
  let transitions = machine[State.LeftRef];
14841
- const matchedTokens = [];
14841
+ let matchedTokens = "";
14842
14842
  while (transitions !== undefined) {
14843
14843
  const token = tokens[head++];
14844
14844
  if (!token) {
@@ -14850,15 +14850,15 @@ function matchReference(tokens) {
14850
14850
  case undefined:
14851
14851
  return null;
14852
14852
  case State.Found:
14853
- matchedTokens.push(token);
14853
+ matchedTokens += token.value;
14854
14854
  tokens.splice(0, head);
14855
14855
  return {
14856
14856
  type: "REFERENCE",
14857
- value: concat(matchedTokens.map((token) => token.value)),
14857
+ value: matchedTokens,
14858
14858
  };
14859
14859
  default:
14860
14860
  transitions = machine[nextState];
14861
- matchedTokens.push(token);
14861
+ matchedTokens += token.value;
14862
14862
  break;
14863
14863
  }
14864
14864
  }
@@ -24170,7 +24170,7 @@ class Composer extends owl.Component {
24170
24170
  Enter: this.processEnterKey,
24171
24171
  Escape: this.processEscapeKey,
24172
24172
  F2: () => console.warn("Not implemented"),
24173
- F4: this.processF4Key,
24173
+ F4: (ev) => this.processF4Key(ev),
24174
24174
  Tab: (ev) => this.processTabKey(ev),
24175
24175
  };
24176
24176
  keyCodeMapping = {
@@ -24272,9 +24272,10 @@ class Composer extends owl.Component {
24272
24272
  processEscapeKey() {
24273
24273
  this.env.model.dispatch("STOP_EDITION", { cancel: true });
24274
24274
  }
24275
- processF4Key() {
24275
+ processF4Key(ev) {
24276
24276
  this.env.model.dispatch("CYCLE_EDITION_REFERENCES");
24277
24277
  this.processContent();
24278
+ ev.stopPropagation();
24278
24279
  }
24279
24280
  processNumpadDecimal(ev) {
24280
24281
  ev.stopPropagation();
@@ -33990,7 +33991,12 @@ class MergePlugin extends CorePlugin {
33990
33991
  * if they have at least a common cell
33991
33992
  */
33992
33993
  doesIntersectMerge(sheetId, zone) {
33993
- return positions(zone).some(({ col, row }) => this.getMerge({ sheetId, col, row }) !== undefined);
33994
+ for (const merge of this.getMerges(sheetId)) {
33995
+ if (overlap(zone, merge)) {
33996
+ return true;
33997
+ }
33998
+ }
33999
+ return false;
33994
34000
  }
33995
34001
  /**
33996
34002
  * Returns true if two columns have at least one merge in common
@@ -43431,7 +43437,7 @@ class ClipboardPlugin extends UIPlugin {
43431
43437
  case "ADD_COLUMNS_ROWS": {
43432
43438
  this.status = "invisible";
43433
43439
  // If we add a col/row inside or before the cut area, we invalidate the clipboard
43434
- if (this.state?.operation !== "CUT") {
43440
+ if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
43435
43441
  return;
43436
43442
  }
43437
43443
  const isClipboardDirty = this.state.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
@@ -43443,7 +43449,7 @@ class ClipboardPlugin extends UIPlugin {
43443
43449
  case "REMOVE_COLUMNS_ROWS": {
43444
43450
  this.status = "invisible";
43445
43451
  // If we remove a col/row inside or before the cut area, we invalidate the clipboard
43446
- if (this.state?.operation !== "CUT") {
43452
+ if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
43447
43453
  return;
43448
43454
  }
43449
43455
  for (let el of cmd.elements) {
@@ -48282,6 +48288,10 @@ class Spreadsheet extends owl.Component {
48282
48288
  });
48283
48289
  owl.useExternalListener(window, "resize", () => this.render(true));
48284
48290
  owl.useExternalListener(window, "beforeunload", this.unbindModelEvents.bind(this));
48291
+ // For some reason, the wheel event is not properly registered inside templates
48292
+ // in Chromium-based browsers based on chromium 125
48293
+ // This hack ensures the event declared in the template is properly registered/working
48294
+ owl.useExternalListener(document.body, "wheel", () => { });
48285
48295
  this.bindModelEvents();
48286
48296
  owl.onMounted(() => {
48287
48297
  this.checkViewportSize();
@@ -52127,6 +52137,6 @@ exports.setTranslationMethod = setTranslationMethod;
52127
52137
  exports.tokenize = tokenize;
52128
52138
 
52129
52139
 
52130
- __info__.version = '16.4.32';
52131
- __info__.date = '2024-05-07T10:38:24.733Z';
52132
- __info__.hash = '314d75d';
52140
+ __info__.version = '16.4.34';
52141
+ __info__.date = '2024-05-24T11:27:29.421Z';
52142
+ __info__.hash = '5e74805';
@@ -14834,7 +14834,7 @@ const machine = {
14834
14834
  function matchReference(tokens) {
14835
14835
  let head = 0;
14836
14836
  let transitions = machine[State.LeftRef];
14837
- const matchedTokens = [];
14837
+ let matchedTokens = "";
14838
14838
  while (transitions !== undefined) {
14839
14839
  const token = tokens[head++];
14840
14840
  if (!token) {
@@ -14846,15 +14846,15 @@ function matchReference(tokens) {
14846
14846
  case undefined:
14847
14847
  return null;
14848
14848
  case State.Found:
14849
- matchedTokens.push(token);
14849
+ matchedTokens += token.value;
14850
14850
  tokens.splice(0, head);
14851
14851
  return {
14852
14852
  type: "REFERENCE",
14853
- value: concat(matchedTokens.map((token) => token.value)),
14853
+ value: matchedTokens,
14854
14854
  };
14855
14855
  default:
14856
14856
  transitions = machine[nextState];
14857
- matchedTokens.push(token);
14857
+ matchedTokens += token.value;
14858
14858
  break;
14859
14859
  }
14860
14860
  }
@@ -24166,7 +24166,7 @@ class Composer extends Component {
24166
24166
  Enter: this.processEnterKey,
24167
24167
  Escape: this.processEscapeKey,
24168
24168
  F2: () => console.warn("Not implemented"),
24169
- F4: this.processF4Key,
24169
+ F4: (ev) => this.processF4Key(ev),
24170
24170
  Tab: (ev) => this.processTabKey(ev),
24171
24171
  };
24172
24172
  keyCodeMapping = {
@@ -24268,9 +24268,10 @@ class Composer extends Component {
24268
24268
  processEscapeKey() {
24269
24269
  this.env.model.dispatch("STOP_EDITION", { cancel: true });
24270
24270
  }
24271
- processF4Key() {
24271
+ processF4Key(ev) {
24272
24272
  this.env.model.dispatch("CYCLE_EDITION_REFERENCES");
24273
24273
  this.processContent();
24274
+ ev.stopPropagation();
24274
24275
  }
24275
24276
  processNumpadDecimal(ev) {
24276
24277
  ev.stopPropagation();
@@ -33986,7 +33987,12 @@ class MergePlugin extends CorePlugin {
33986
33987
  * if they have at least a common cell
33987
33988
  */
33988
33989
  doesIntersectMerge(sheetId, zone) {
33989
- return positions(zone).some(({ col, row }) => this.getMerge({ sheetId, col, row }) !== undefined);
33990
+ for (const merge of this.getMerges(sheetId)) {
33991
+ if (overlap(zone, merge)) {
33992
+ return true;
33993
+ }
33994
+ }
33995
+ return false;
33990
33996
  }
33991
33997
  /**
33992
33998
  * Returns true if two columns have at least one merge in common
@@ -43427,7 +43433,7 @@ class ClipboardPlugin extends UIPlugin {
43427
43433
  case "ADD_COLUMNS_ROWS": {
43428
43434
  this.status = "invisible";
43429
43435
  // If we add a col/row inside or before the cut area, we invalidate the clipboard
43430
- if (this.state?.operation !== "CUT") {
43436
+ if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
43431
43437
  return;
43432
43438
  }
43433
43439
  const isClipboardDirty = this.state.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
@@ -43439,7 +43445,7 @@ class ClipboardPlugin extends UIPlugin {
43439
43445
  case "REMOVE_COLUMNS_ROWS": {
43440
43446
  this.status = "invisible";
43441
43447
  // If we remove a col/row inside or before the cut area, we invalidate the clipboard
43442
- if (this.state?.operation !== "CUT") {
43448
+ if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
43443
43449
  return;
43444
43450
  }
43445
43451
  for (let el of cmd.elements) {
@@ -48278,6 +48284,10 @@ class Spreadsheet extends Component {
48278
48284
  });
48279
48285
  useExternalListener(window, "resize", () => this.render(true));
48280
48286
  useExternalListener(window, "beforeunload", this.unbindModelEvents.bind(this));
48287
+ // For some reason, the wheel event is not properly registered inside templates
48288
+ // in Chromium-based browsers based on chromium 125
48289
+ // This hack ensures the event declared in the template is properly registered/working
48290
+ useExternalListener(document.body, "wheel", () => { });
48281
48291
  this.bindModelEvents();
48282
48292
  onMounted(() => {
48283
48293
  this.checkViewportSize();
@@ -52091,6 +52101,6 @@ const constants = {
52091
52101
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
52092
52102
 
52093
52103
 
52094
- __info__.version = '16.4.32';
52095
- __info__.date = '2024-05-07T10:38:24.733Z';
52096
- __info__.hash = '314d75d';
52104
+ __info__.version = '16.4.34';
52105
+ __info__.date = '2024-05-24T11:27:29.421Z';
52106
+ __info__.hash = '5e74805';
@@ -14835,7 +14835,7 @@
14835
14835
  function matchReference(tokens) {
14836
14836
  let head = 0;
14837
14837
  let transitions = machine[State.LeftRef];
14838
- const matchedTokens = [];
14838
+ let matchedTokens = "";
14839
14839
  while (transitions !== undefined) {
14840
14840
  const token = tokens[head++];
14841
14841
  if (!token) {
@@ -14847,15 +14847,15 @@
14847
14847
  case undefined:
14848
14848
  return null;
14849
14849
  case State.Found:
14850
- matchedTokens.push(token);
14850
+ matchedTokens += token.value;
14851
14851
  tokens.splice(0, head);
14852
14852
  return {
14853
14853
  type: "REFERENCE",
14854
- value: concat(matchedTokens.map((token) => token.value)),
14854
+ value: matchedTokens,
14855
14855
  };
14856
14856
  default:
14857
14857
  transitions = machine[nextState];
14858
- matchedTokens.push(token);
14858
+ matchedTokens += token.value;
14859
14859
  break;
14860
14860
  }
14861
14861
  }
@@ -24167,7 +24167,7 @@
24167
24167
  Enter: this.processEnterKey,
24168
24168
  Escape: this.processEscapeKey,
24169
24169
  F2: () => console.warn("Not implemented"),
24170
- F4: this.processF4Key,
24170
+ F4: (ev) => this.processF4Key(ev),
24171
24171
  Tab: (ev) => this.processTabKey(ev),
24172
24172
  };
24173
24173
  keyCodeMapping = {
@@ -24269,9 +24269,10 @@
24269
24269
  processEscapeKey() {
24270
24270
  this.env.model.dispatch("STOP_EDITION", { cancel: true });
24271
24271
  }
24272
- processF4Key() {
24272
+ processF4Key(ev) {
24273
24273
  this.env.model.dispatch("CYCLE_EDITION_REFERENCES");
24274
24274
  this.processContent();
24275
+ ev.stopPropagation();
24275
24276
  }
24276
24277
  processNumpadDecimal(ev) {
24277
24278
  ev.stopPropagation();
@@ -33987,7 +33988,12 @@
33987
33988
  * if they have at least a common cell
33988
33989
  */
33989
33990
  doesIntersectMerge(sheetId, zone) {
33990
- return positions(zone).some(({ col, row }) => this.getMerge({ sheetId, col, row }) !== undefined);
33991
+ for (const merge of this.getMerges(sheetId)) {
33992
+ if (overlap(zone, merge)) {
33993
+ return true;
33994
+ }
33995
+ }
33996
+ return false;
33991
33997
  }
33992
33998
  /**
33993
33999
  * Returns true if two columns have at least one merge in common
@@ -43428,7 +43434,7 @@
43428
43434
  case "ADD_COLUMNS_ROWS": {
43429
43435
  this.status = "invisible";
43430
43436
  // If we add a col/row inside or before the cut area, we invalidate the clipboard
43431
- if (this.state?.operation !== "CUT") {
43437
+ if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
43432
43438
  return;
43433
43439
  }
43434
43440
  const isClipboardDirty = this.state.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
@@ -43440,7 +43446,7 @@
43440
43446
  case "REMOVE_COLUMNS_ROWS": {
43441
43447
  this.status = "invisible";
43442
43448
  // If we remove a col/row inside or before the cut area, we invalidate the clipboard
43443
- if (this.state?.operation !== "CUT") {
43449
+ if (this.state?.operation !== "CUT" || cmd.sheetId !== this.state?.sheetId) {
43444
43450
  return;
43445
43451
  }
43446
43452
  for (let el of cmd.elements) {
@@ -48279,6 +48285,10 @@
48279
48285
  });
48280
48286
  owl.useExternalListener(window, "resize", () => this.render(true));
48281
48287
  owl.useExternalListener(window, "beforeunload", this.unbindModelEvents.bind(this));
48288
+ // For some reason, the wheel event is not properly registered inside templates
48289
+ // in Chromium-based browsers based on chromium 125
48290
+ // This hack ensures the event declared in the template is properly registered/working
48291
+ owl.useExternalListener(document.body, "wheel", () => { });
48282
48292
  this.bindModelEvents();
48283
48293
  owl.onMounted(() => {
48284
48294
  this.checkViewportSize();
@@ -52126,9 +52136,9 @@
52126
52136
  Object.defineProperty(exports, '__esModule', { value: true });
52127
52137
 
52128
52138
 
52129
- __info__.version = '16.4.32';
52130
- __info__.date = '2024-05-07T10:38:24.733Z';
52131
- __info__.hash = '314d75d';
52139
+ __info__.version = '16.4.34';
52140
+ __info__.date = '2024-05-24T11:27:29.421Z';
52141
+ __info__.hash = '5e74805';
52132
52142
 
52133
52143
 
52134
52144
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);