@odoo/o-spreadsheet 16.0.4 → 16.0.5

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.
@@ -9963,6 +9963,7 @@ const CHART_PADDING_RATIO = 0.02;
9963
9963
  const LINE_HEIGHT = 1.2;
9964
9964
  css /* scss */ `
9965
9965
  div.o-scorecard {
9966
+ font-family: ${DEFAULT_FONT};
9966
9967
  user-select: none;
9967
9968
  background-color: white;
9968
9969
  display: flex;
@@ -19372,6 +19373,7 @@ class EditionPlugin extends UIPlugin {
19372
19373
  this.setContent(this.initialContent || "");
19373
19374
  }
19374
19375
  setContent(text, selection, raise) {
19376
+ text = text.replace(/[\r\n]/g, "");
19375
19377
  const isNewCurrentContent = this.currentContent !== text;
19376
19378
  this.currentContent = text;
19377
19379
  if (selection) {
@@ -19701,6 +19703,8 @@ class ContentEditableHelper {
19701
19703
  start = 0;
19702
19704
  if (end > this.el.textContent.length)
19703
19705
  end = this.el.textContent.length;
19706
+ if (start > this.el.textContent.length)
19707
+ start = this.el.textContent.length;
19704
19708
  }
19705
19709
  let startNode = this.findChildAtCharacterIndex(start);
19706
19710
  let endNode = this.findChildAtCharacterIndex(end);
@@ -19926,6 +19930,7 @@ css /* scss */ `
19926
19930
  flex-grow: 1;
19927
19931
  max-height: inherit;
19928
19932
  .o-composer {
19933
+ font-family: ${DEFAULT_FONT};
19929
19934
  caret-color: black;
19930
19935
  padding-left: 3px;
19931
19936
  padding-right: 3px;
@@ -22512,6 +22517,10 @@ class Grid extends owl.Component {
22512
22517
  }
22513
22518
  }
22514
22519
  onInput(ev) {
22520
+ // the user meant to paste in the sheet, not open the composer with the pasted content
22521
+ if (!ev.isComposing && ev.inputType === "insertFromPaste") {
22522
+ return;
22523
+ }
22515
22524
  if (ev.data) {
22516
22525
  // if the user types a character on the grid, it means he wants to start composing the selected cell with that
22517
22526
  // character
@@ -38359,9 +38368,6 @@ css /* scss */ `
38359
38368
  color: #333;
38360
38369
  }
38361
38370
 
38362
- * {
38363
- font-family: "Roboto", "RobotoDraft", Helvetica, Arial, sans-serif;
38364
- }
38365
38371
  &,
38366
38372
  *,
38367
38373
  *:before,
@@ -39537,6 +39543,7 @@ class RangeAdapter {
39537
39543
  }
39538
39544
  else if (range.zone[start] >= min && range.zone[end] <= max) {
39539
39545
  changeType = "REMOVE";
39546
+ newRange = range.clone({ ...this.getInvalidRange() });
39540
39547
  }
39541
39548
  else if (range.zone[start] <= max && range.zone[end] >= max) {
39542
39549
  const toRemove = max - range.zone[start] + 1;
@@ -39602,8 +39609,10 @@ class RangeAdapter {
39602
39609
  return { changeType: "NONE" };
39603
39610
  }
39604
39611
  const invalidSheetName = this.getters.getSheetName(cmd.sheetId);
39605
- const sheetId = "";
39606
- range = range.clone({ sheetId, invalidSheetName });
39612
+ range = range.clone({
39613
+ ...this.getInvalidRange(),
39614
+ invalidSheetName,
39615
+ });
39607
39616
  return { changeType: "REMOVE", range };
39608
39617
  }, cmd.sheetId);
39609
39618
  break;
@@ -39867,6 +39876,15 @@ class RangeAdapter {
39867
39876
  }
39868
39877
  return str;
39869
39878
  }
39879
+ getInvalidRange() {
39880
+ return {
39881
+ parts: [],
39882
+ prefixSheet: false,
39883
+ zone: { left: -1, top: -1, right: -1, bottom: -1 },
39884
+ sheetId: "",
39885
+ invalidXc: INCORRECT_RANGE_STRING,
39886
+ };
39887
+ }
39870
39888
  }
39871
39889
  RangeAdapter.getters = [
39872
39890
  "getRangeString",
@@ -42471,6 +42489,6 @@ exports.setTranslationMethod = setTranslationMethod;
42471
42489
  exports.tokenize = tokenize;
42472
42490
 
42473
42491
 
42474
- __info__.version = '16.0.4';
42475
- __info__.date = '2023-03-16T12:11:01.007Z';
42476
- __info__.hash = 'ebbb1f0';
42492
+ __info__.version = '16.0.5';
42493
+ __info__.date = '2023-03-23T11:35:22.974Z';
42494
+ __info__.hash = '53150ef';
@@ -2894,6 +2894,7 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2894
2894
  * Get a Xc string that represent a part of a range
2895
2895
  */
2896
2896
  private getRangePartString;
2897
+ private getInvalidRange;
2897
2898
  }
2898
2899
 
2899
2900
  interface CorePluginConstructor {
@@ -9959,6 +9959,7 @@ const CHART_PADDING_RATIO = 0.02;
9959
9959
  const LINE_HEIGHT = 1.2;
9960
9960
  css /* scss */ `
9961
9961
  div.o-scorecard {
9962
+ font-family: ${DEFAULT_FONT};
9962
9963
  user-select: none;
9963
9964
  background-color: white;
9964
9965
  display: flex;
@@ -19368,6 +19369,7 @@ class EditionPlugin extends UIPlugin {
19368
19369
  this.setContent(this.initialContent || "");
19369
19370
  }
19370
19371
  setContent(text, selection, raise) {
19372
+ text = text.replace(/[\r\n]/g, "");
19371
19373
  const isNewCurrentContent = this.currentContent !== text;
19372
19374
  this.currentContent = text;
19373
19375
  if (selection) {
@@ -19697,6 +19699,8 @@ class ContentEditableHelper {
19697
19699
  start = 0;
19698
19700
  if (end > this.el.textContent.length)
19699
19701
  end = this.el.textContent.length;
19702
+ if (start > this.el.textContent.length)
19703
+ start = this.el.textContent.length;
19700
19704
  }
19701
19705
  let startNode = this.findChildAtCharacterIndex(start);
19702
19706
  let endNode = this.findChildAtCharacterIndex(end);
@@ -19922,6 +19926,7 @@ css /* scss */ `
19922
19926
  flex-grow: 1;
19923
19927
  max-height: inherit;
19924
19928
  .o-composer {
19929
+ font-family: ${DEFAULT_FONT};
19925
19930
  caret-color: black;
19926
19931
  padding-left: 3px;
19927
19932
  padding-right: 3px;
@@ -22508,6 +22513,10 @@ class Grid extends Component {
22508
22513
  }
22509
22514
  }
22510
22515
  onInput(ev) {
22516
+ // the user meant to paste in the sheet, not open the composer with the pasted content
22517
+ if (!ev.isComposing && ev.inputType === "insertFromPaste") {
22518
+ return;
22519
+ }
22511
22520
  if (ev.data) {
22512
22521
  // if the user types a character on the grid, it means he wants to start composing the selected cell with that
22513
22522
  // character
@@ -38355,9 +38364,6 @@ css /* scss */ `
38355
38364
  color: #333;
38356
38365
  }
38357
38366
 
38358
- * {
38359
- font-family: "Roboto", "RobotoDraft", Helvetica, Arial, sans-serif;
38360
- }
38361
38367
  &,
38362
38368
  *,
38363
38369
  *:before,
@@ -39533,6 +39539,7 @@ class RangeAdapter {
39533
39539
  }
39534
39540
  else if (range.zone[start] >= min && range.zone[end] <= max) {
39535
39541
  changeType = "REMOVE";
39542
+ newRange = range.clone({ ...this.getInvalidRange() });
39536
39543
  }
39537
39544
  else if (range.zone[start] <= max && range.zone[end] >= max) {
39538
39545
  const toRemove = max - range.zone[start] + 1;
@@ -39598,8 +39605,10 @@ class RangeAdapter {
39598
39605
  return { changeType: "NONE" };
39599
39606
  }
39600
39607
  const invalidSheetName = this.getters.getSheetName(cmd.sheetId);
39601
- const sheetId = "";
39602
- range = range.clone({ sheetId, invalidSheetName });
39608
+ range = range.clone({
39609
+ ...this.getInvalidRange(),
39610
+ invalidSheetName,
39611
+ });
39603
39612
  return { changeType: "REMOVE", range };
39604
39613
  }, cmd.sheetId);
39605
39614
  break;
@@ -39863,6 +39872,15 @@ class RangeAdapter {
39863
39872
  }
39864
39873
  return str;
39865
39874
  }
39875
+ getInvalidRange() {
39876
+ return {
39877
+ parts: [],
39878
+ prefixSheet: false,
39879
+ zone: { left: -1, top: -1, right: -1, bottom: -1 },
39880
+ sheetId: "",
39881
+ invalidXc: INCORRECT_RANGE_STRING,
39882
+ };
39883
+ }
39866
39884
  }
39867
39885
  RangeAdapter.getters = [
39868
39886
  "getRangeString",
@@ -42439,6 +42457,6 @@ function addFunction(functionName, functionDescription) {
42439
42457
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
42440
42458
 
42441
42459
 
42442
- __info__.version = '16.0.4';
42443
- __info__.date = '2023-03-16T12:11:01.007Z';
42444
- __info__.hash = 'ebbb1f0';
42460
+ __info__.version = '16.0.5';
42461
+ __info__.date = '2023-03-23T11:35:22.974Z';
42462
+ __info__.hash = '53150ef';
@@ -9960,6 +9960,7 @@
9960
9960
  const LINE_HEIGHT = 1.2;
9961
9961
  css /* scss */ `
9962
9962
  div.o-scorecard {
9963
+ font-family: ${DEFAULT_FONT};
9963
9964
  user-select: none;
9964
9965
  background-color: white;
9965
9966
  display: flex;
@@ -19369,6 +19370,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19369
19370
  this.setContent(this.initialContent || "");
19370
19371
  }
19371
19372
  setContent(text, selection, raise) {
19373
+ text = text.replace(/[\r\n]/g, "");
19372
19374
  const isNewCurrentContent = this.currentContent !== text;
19373
19375
  this.currentContent = text;
19374
19376
  if (selection) {
@@ -19698,6 +19700,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19698
19700
  start = 0;
19699
19701
  if (end > this.el.textContent.length)
19700
19702
  end = this.el.textContent.length;
19703
+ if (start > this.el.textContent.length)
19704
+ start = this.el.textContent.length;
19701
19705
  }
19702
19706
  let startNode = this.findChildAtCharacterIndex(start);
19703
19707
  let endNode = this.findChildAtCharacterIndex(end);
@@ -19923,6 +19927,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19923
19927
  flex-grow: 1;
19924
19928
  max-height: inherit;
19925
19929
  .o-composer {
19930
+ font-family: ${DEFAULT_FONT};
19926
19931
  caret-color: black;
19927
19932
  padding-left: 3px;
19928
19933
  padding-right: 3px;
@@ -22509,6 +22514,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
22509
22514
  }
22510
22515
  }
22511
22516
  onInput(ev) {
22517
+ // the user meant to paste in the sheet, not open the composer with the pasted content
22518
+ if (!ev.isComposing && ev.inputType === "insertFromPaste") {
22519
+ return;
22520
+ }
22512
22521
  if (ev.data) {
22513
22522
  // if the user types a character on the grid, it means he wants to start composing the selected cell with that
22514
22523
  // character
@@ -38356,9 +38365,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38356
38365
  color: #333;
38357
38366
  }
38358
38367
 
38359
- * {
38360
- font-family: "Roboto", "RobotoDraft", Helvetica, Arial, sans-serif;
38361
- }
38362
38368
  &,
38363
38369
  *,
38364
38370
  *:before,
@@ -39534,6 +39540,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39534
39540
  }
39535
39541
  else if (range.zone[start] >= min && range.zone[end] <= max) {
39536
39542
  changeType = "REMOVE";
39543
+ newRange = range.clone({ ...this.getInvalidRange() });
39537
39544
  }
39538
39545
  else if (range.zone[start] <= max && range.zone[end] >= max) {
39539
39546
  const toRemove = max - range.zone[start] + 1;
@@ -39599,8 +39606,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39599
39606
  return { changeType: "NONE" };
39600
39607
  }
39601
39608
  const invalidSheetName = this.getters.getSheetName(cmd.sheetId);
39602
- const sheetId = "";
39603
- range = range.clone({ sheetId, invalidSheetName });
39609
+ range = range.clone({
39610
+ ...this.getInvalidRange(),
39611
+ invalidSheetName,
39612
+ });
39604
39613
  return { changeType: "REMOVE", range };
39605
39614
  }, cmd.sheetId);
39606
39615
  break;
@@ -39864,6 +39873,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39864
39873
  }
39865
39874
  return str;
39866
39875
  }
39876
+ getInvalidRange() {
39877
+ return {
39878
+ parts: [],
39879
+ prefixSheet: false,
39880
+ zone: { left: -1, top: -1, right: -1, bottom: -1 },
39881
+ sheetId: "",
39882
+ invalidXc: INCORRECT_RANGE_STRING,
39883
+ };
39884
+ }
39867
39885
  }
39868
39886
  RangeAdapter.getters = [
39869
39887
  "getRangeString",
@@ -42470,9 +42488,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42470
42488
  Object.defineProperty(exports, '__esModule', { value: true });
42471
42489
 
42472
42490
 
42473
- __info__.version = '16.0.4';
42474
- __info__.date = '2023-03-16T12:11:01.007Z';
42475
- __info__.hash = 'ebbb1f0';
42491
+ __info__.version = '16.0.5';
42492
+ __info__.date = '2023-03-23T11:35:22.974Z';
42493
+ __info__.hash = '53150ef';
42476
42494
 
42477
42495
 
42478
42496
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);