@odoo/o-spreadsheet 16.2.6 → 16.2.7

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.
@@ -16950,6 +16950,18 @@ css /* scss */ `
16950
16950
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
16951
16951
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
16952
16952
  }
16953
+ .o-color-picker-toggler {
16954
+ display: flex;
16955
+ .o-color-picker-toggler-sign {
16956
+ margin: auto auto;
16957
+ width: 55%;
16958
+ height: 55%;
16959
+ .o-icon {
16960
+ width: 100%;
16961
+ height: 100%;
16962
+ }
16963
+ }
16964
+ }
16953
16965
  .o-color-picker-line-item {
16954
16966
  width: ${ITEM_EDGE_LENGTH}px;
16955
16967
  height: ${ITEM_EDGE_LENGTH}px;
@@ -19542,7 +19554,14 @@ class ContentEditableHelper {
19542
19554
  current = it.next();
19543
19555
  }
19544
19556
  if (current.value !== nodeToFind) {
19545
- throw new Error("Cannot find the node in the children of the element");
19557
+ /** This situation can happen if the code is called while the selection is not currently on the ContentEditableHelper.
19558
+ * In this case, we return 0 because we don't know the size of the text before the selection.
19559
+ *
19560
+ * A known occurence is triggered since the introduction of commit d4663158 (PR #2038).
19561
+ *
19562
+ * FIXME: find a way to test eventhough the selection API is not available in jsDOM.
19563
+ */
19564
+ return 0;
19546
19565
  }
19547
19566
  else {
19548
19567
  if (!current.value.hasChildNodes()) {
@@ -37078,7 +37097,8 @@ class SheetUIPlugin extends UIPlugin {
37078
37097
  getCellWidth(position) {
37079
37098
  const text = this.getCellText(position);
37080
37099
  const style = this.getters.getCellComputedStyle(position);
37081
- let contentWidth = this.getTextWidth(text, style);
37100
+ const multiLineText = text.split(NEWLINE);
37101
+ let contentWidth = Math.max(...multiLineText.map((line) => this.getTextWidth(line, style)));
37082
37102
  const icon = this.getters.getConditionalIcon(position);
37083
37103
  if (icon) {
37084
37104
  contentWidth += computeIconWidth(this.getters.getCellStyle(position));
@@ -45319,6 +45339,6 @@ exports.setTranslationMethod = setTranslationMethod;
45319
45339
  exports.tokenize = tokenize;
45320
45340
 
45321
45341
 
45322
- __info__.version = '16.2.6';
45323
- __info__.date = '2023-05-12T10:58:25.815Z';
45324
- __info__.hash = '6848d25';
45342
+ __info__.version = '16.2.7';
45343
+ __info__.date = '2023-05-25T12:56:32.163Z';
45344
+ __info__.hash = '047a6d5';
@@ -16946,6 +16946,18 @@ css /* scss */ `
16946
16946
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
16947
16947
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
16948
16948
  }
16949
+ .o-color-picker-toggler {
16950
+ display: flex;
16951
+ .o-color-picker-toggler-sign {
16952
+ margin: auto auto;
16953
+ width: 55%;
16954
+ height: 55%;
16955
+ .o-icon {
16956
+ width: 100%;
16957
+ height: 100%;
16958
+ }
16959
+ }
16960
+ }
16949
16961
  .o-color-picker-line-item {
16950
16962
  width: ${ITEM_EDGE_LENGTH}px;
16951
16963
  height: ${ITEM_EDGE_LENGTH}px;
@@ -19538,7 +19550,14 @@ class ContentEditableHelper {
19538
19550
  current = it.next();
19539
19551
  }
19540
19552
  if (current.value !== nodeToFind) {
19541
- throw new Error("Cannot find the node in the children of the element");
19553
+ /** This situation can happen if the code is called while the selection is not currently on the ContentEditableHelper.
19554
+ * In this case, we return 0 because we don't know the size of the text before the selection.
19555
+ *
19556
+ * A known occurence is triggered since the introduction of commit d4663158 (PR #2038).
19557
+ *
19558
+ * FIXME: find a way to test eventhough the selection API is not available in jsDOM.
19559
+ */
19560
+ return 0;
19542
19561
  }
19543
19562
  else {
19544
19563
  if (!current.value.hasChildNodes()) {
@@ -37074,7 +37093,8 @@ class SheetUIPlugin extends UIPlugin {
37074
37093
  getCellWidth(position) {
37075
37094
  const text = this.getCellText(position);
37076
37095
  const style = this.getters.getCellComputedStyle(position);
37077
- let contentWidth = this.getTextWidth(text, style);
37096
+ const multiLineText = text.split(NEWLINE);
37097
+ let contentWidth = Math.max(...multiLineText.map((line) => this.getTextWidth(line, style)));
37078
37098
  const icon = this.getters.getConditionalIcon(position);
37079
37099
  if (icon) {
37080
37100
  contentWidth += computeIconWidth(this.getters.getCellStyle(position));
@@ -45287,6 +45307,6 @@ function addFunction(functionName, functionDescription) {
45287
45307
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
45288
45308
 
45289
45309
 
45290
- __info__.version = '16.2.6';
45291
- __info__.date = '2023-05-12T10:58:25.815Z';
45292
- __info__.hash = '6848d25';
45310
+ __info__.version = '16.2.7';
45311
+ __info__.date = '2023-05-25T12:56:32.163Z';
45312
+ __info__.hash = '047a6d5';
@@ -16947,6 +16947,18 @@
16947
16947
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
16948
16948
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
16949
16949
  }
16950
+ .o-color-picker-toggler {
16951
+ display: flex;
16952
+ .o-color-picker-toggler-sign {
16953
+ margin: auto auto;
16954
+ width: 55%;
16955
+ height: 55%;
16956
+ .o-icon {
16957
+ width: 100%;
16958
+ height: 100%;
16959
+ }
16960
+ }
16961
+ }
16950
16962
  .o-color-picker-line-item {
16951
16963
  width: ${ITEM_EDGE_LENGTH}px;
16952
16964
  height: ${ITEM_EDGE_LENGTH}px;
@@ -19539,7 +19551,14 @@
19539
19551
  current = it.next();
19540
19552
  }
19541
19553
  if (current.value !== nodeToFind) {
19542
- throw new Error("Cannot find the node in the children of the element");
19554
+ /** This situation can happen if the code is called while the selection is not currently on the ContentEditableHelper.
19555
+ * In this case, we return 0 because we don't know the size of the text before the selection.
19556
+ *
19557
+ * A known occurence is triggered since the introduction of commit d4663158 (PR #2038).
19558
+ *
19559
+ * FIXME: find a way to test eventhough the selection API is not available in jsDOM.
19560
+ */
19561
+ return 0;
19543
19562
  }
19544
19563
  else {
19545
19564
  if (!current.value.hasChildNodes()) {
@@ -37075,7 +37094,8 @@
37075
37094
  getCellWidth(position) {
37076
37095
  const text = this.getCellText(position);
37077
37096
  const style = this.getters.getCellComputedStyle(position);
37078
- let contentWidth = this.getTextWidth(text, style);
37097
+ const multiLineText = text.split(NEWLINE);
37098
+ let contentWidth = Math.max(...multiLineText.map((line) => this.getTextWidth(line, style)));
37079
37099
  const icon = this.getters.getConditionalIcon(position);
37080
37100
  if (icon) {
37081
37101
  contentWidth += computeIconWidth(this.getters.getCellStyle(position));
@@ -45318,9 +45338,9 @@
45318
45338
  Object.defineProperty(exports, '__esModule', { value: true });
45319
45339
 
45320
45340
 
45321
- __info__.version = '16.2.6';
45322
- __info__.date = '2023-05-12T10:58:25.815Z';
45323
- __info__.hash = '6848d25';
45341
+ __info__.version = '16.2.7';
45342
+ __info__.date = '2023-05-25T12:56:32.163Z';
45343
+ __info__.hash = '047a6d5';
45324
45344
 
45325
45345
 
45326
45346
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);