@odoo/o-spreadsheet 18.2.0-alpha.7 → 18.2.0-alpha.8

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.2.0-alpha.7
6
- * @date 2025-02-10T09:01:19.353Z
7
- * @hash 0432f17
5
+ * @version 18.2.0-alpha.8
6
+ * @date 2025-02-14T08:40:13.286Z
7
+ * @hash 19d45d9
8
8
  */
9
9
 
10
10
  'use strict';
@@ -6490,6 +6490,33 @@ function drawDecoratedText(context, text, position, underline = false, strikethr
6490
6490
  * https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
6491
6491
  * */
6492
6492
  class UuidGenerator {
6493
+ /**
6494
+ * Generates a custom UUID using a simple 36^12 method (8-character alphanumeric string with lowercase letters)
6495
+ * This has a higher chance of collision than a UUIDv4, but not only faster to generate than an UUIDV4,
6496
+ * it also has a smaller size, which is preferable to alleviate the overall data size.
6497
+ *
6498
+ * This method is preferable when generating uuids for the core data (sheetId, figureId, etc)
6499
+ * as they will appear several times in the revisions and local history.
6500
+ *
6501
+ */
6502
+ smallUuid() {
6503
+ //@ts-ignore
6504
+ if (window.crypto && window.crypto.getRandomValues) {
6505
+ //@ts-ignore
6506
+ return ([1e7] + -1e3).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
6507
+ }
6508
+ else {
6509
+ // mainly for jest and other browsers that do not have the crypto functionality
6510
+ return "xxxxxxxx-xxxx".replace(/[xy]/g, function (c) {
6511
+ const r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
6512
+ return v.toString(16);
6513
+ });
6514
+ }
6515
+ }
6516
+ /**
6517
+ * Generates an UUIDV4, has astronomically low chance of collision, but is larger in size than the smallUuid.
6518
+ * This method should be used when you need to avoid collisions at all costs, like the id of a revision.
6519
+ */
6493
6520
  uuidv4() {
6494
6521
  //@ts-ignore
6495
6522
  if (window.crypto && window.crypto.getRandomValues) {
@@ -8525,7 +8552,7 @@ class ChartClipboardHandler extends AbstractFigureClipboardHandler {
8525
8552
  };
8526
8553
  }
8527
8554
  getPasteTarget(sheetId, target, content, options) {
8528
- const newId = new UuidGenerator().uuidv4();
8555
+ const newId = new UuidGenerator().smallUuid();
8529
8556
  return { zones: [], figureId: newId, sheetId };
8530
8557
  }
8531
8558
  paste(target, clippedContent, options) {
@@ -8691,7 +8718,7 @@ class ConditionalFormatClipboardHandler extends AbstractCellClipboardHandler {
8691
8718
  if (!targetCF && queuedCfs) {
8692
8719
  targetCF = queuedCfs.find((queued) => queued.cf.stopIfTrue === originCF.stopIfTrue && deepEquals(queued.cf.rule, originCF.rule))?.cf;
8693
8720
  }
8694
- return targetCF || { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
8721
+ return targetCF || { ...originCF, id: this.uuidGenerator.smallUuid(), ranges: [] };
8695
8722
  }
8696
8723
  }
8697
8724
 
@@ -8784,7 +8811,7 @@ class DataValidationClipboardHandler extends AbstractCellClipboardHandler {
8784
8811
  }
8785
8812
  return (targetRule || {
8786
8813
  ...originRule,
8787
- id: newId ? this.uuidGenerator.uuidv4() : originRule.id,
8814
+ id: newId ? this.uuidGenerator.smallUuid() : originRule.id,
8788
8815
  ranges: [],
8789
8816
  });
8790
8817
  }
@@ -8846,7 +8873,7 @@ class ImageClipboardHandler extends AbstractFigureClipboardHandler {
8846
8873
  };
8847
8874
  }
8848
8875
  getPasteTarget(sheetId, target, content, options) {
8849
- const newId = new UuidGenerator().uuidv4();
8876
+ const newId = new UuidGenerator().smallUuid();
8850
8877
  return { sheetId, zones: [], figureId: newId };
8851
8878
  }
8852
8879
  paste(target, clippedContent, options) {
@@ -10181,9 +10208,6 @@ css /* scss */ `
10181
10208
  font-size: 12px;
10182
10209
  background-color: #fff;
10183
10210
  z-index: ${ComponentsImportance.FigureTooltip};
10184
- table td span {
10185
- box-sizing: border-box;
10186
- }
10187
10211
  }
10188
10212
  }
10189
10213
  `;
@@ -15287,7 +15311,7 @@ const SORTN = {
15287
15311
  }
15288
15312
  }
15289
15313
  },
15290
- isExported: true,
15314
+ isExported: false,
15291
15315
  };
15292
15316
  // -----------------------------------------------------------------------------
15293
15317
  // UNIQUE
@@ -22875,6 +22899,10 @@ const DRAWING_NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main";
22875
22899
  const DRAWING_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
22876
22900
  const CONTENT_TYPES = {
22877
22901
  workbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
22902
+ macroEnabledWorkbook: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
22903
+ templateWorkbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml",
22904
+ macroEnabledTemplateWorkbook: "application/vnd.ms-excel.template.macroEnabled.main+xml",
22905
+ excelAddInWorkbook: "application/vnd.ms-excel.addin.macroEnabled.main+xml",
22878
22906
  sheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
22879
22907
  sharedStrings: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
22880
22908
  styles: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
@@ -26946,7 +26974,11 @@ class XlsxReader {
26946
26974
  buildXlsxFileStructure() {
26947
26975
  const xlsxFileStructure = {
26948
26976
  sheets: getXLSXFilesOfType(CONTENT_TYPES.sheet, this.xmls),
26949
- workbook: getXLSXFilesOfType(CONTENT_TYPES.workbook, this.xmls)[0],
26977
+ workbook: getXLSXFilesOfType(CONTENT_TYPES.workbook, this.xmls)[0] ||
26978
+ getXLSXFilesOfType(CONTENT_TYPES.macroEnabledWorkbook, this.xmls)[0] ||
26979
+ getXLSXFilesOfType(CONTENT_TYPES.templateWorkbook, this.xmls)[0] ||
26980
+ getXLSXFilesOfType(CONTENT_TYPES.macroEnabledTemplateWorkbook, this.xmls)[0] ||
26981
+ getXLSXFilesOfType(CONTENT_TYPES.excelAddInWorkbook, this.xmls)[0],
26950
26982
  styles: getXLSXFilesOfType(CONTENT_TYPES.styles, this.xmls)[0],
26951
26983
  sharedStrings: getXLSXFilesOfType(CONTENT_TYPES.sharedStrings, this.xmls)[0],
26952
26984
  theme: getXLSXFilesOfType(CONTENT_TYPES.themes, this.xmls)[0],
@@ -27644,7 +27676,7 @@ function forceUnicityOfFigure(data) {
27644
27676
  for (const sheet of data.sheets || []) {
27645
27677
  for (const figure of sheet.figures || []) {
27646
27678
  if (figureIds.has(figure.id)) {
27647
- figure.id += uuidGenerator.uuidv4();
27679
+ figure.id += uuidGenerator.smallUuid();
27648
27680
  }
27649
27681
  figureIds.add(figure.id);
27650
27682
  }
@@ -28228,9 +28260,7 @@ function getBarChartData(definition, dataSets, labelRange, getters) {
28228
28260
  const labelValues = getChartLabelValues(getters, dataSets, labelRange);
28229
28261
  let labels = labelValues.formattedValues;
28230
28262
  let dataSetsValues = getChartDatasetValues(getters, dataSets);
28231
- if (definition.dataSetsHaveTitle &&
28232
- dataSetsValues[0] &&
28233
- labels.length > dataSetsValues[0].data.length) {
28263
+ if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
28234
28264
  labels.shift();
28235
28265
  }
28236
28266
  ({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
@@ -28279,13 +28309,12 @@ function getPyramidChartData(definition, dataSets, labelRange, getters) {
28279
28309
  };
28280
28310
  }
28281
28311
  function getLineChartData(definition, dataSets, labelRange, getters) {
28282
- const axisType = getChartAxisType(definition, labelRange, getters);
28312
+ const axisType = getChartAxisType(definition, dataSets, labelRange, getters);
28283
28313
  const labelValues = getChartLabelValues(getters, dataSets, labelRange);
28284
28314
  let labels = axisType === "linear" ? labelValues.values : labelValues.formattedValues;
28285
28315
  let dataSetsValues = getChartDatasetValues(getters, dataSets);
28286
- if (definition.dataSetsHaveTitle &&
28287
- dataSetsValues[0] &&
28288
- labels.length > dataSetsValues[0].data.length) {
28316
+ const removeFirstLabel = shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false);
28317
+ if (removeFirstLabel) {
28289
28318
  labels.shift();
28290
28319
  }
28291
28320
  ({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
@@ -28297,7 +28326,7 @@ function getLineChartData(definition, dataSets, labelRange, getters) {
28297
28326
  }
28298
28327
  const leftAxisFormat = getChartDatasetFormat(getters, dataSets, "left");
28299
28328
  const rightAxisFormat = getChartDatasetFormat(getters, dataSets, "right");
28300
- const labelsFormat = getChartLabelFormat(getters, labelRange);
28329
+ const labelsFormat = getChartLabelFormat(getters, labelRange, removeFirstLabel);
28301
28330
  const axisFormats = { y: leftAxisFormat, y1: rightAxisFormat, x: labelsFormat };
28302
28331
  const trendDataSetsValues = [];
28303
28332
  for (const index in dataSetsValues) {
@@ -28333,9 +28362,7 @@ function getPieChartData(definition, dataSets, labelRange, getters) {
28333
28362
  const labelValues = getChartLabelValues(getters, dataSets, labelRange);
28334
28363
  let labels = labelValues.formattedValues;
28335
28364
  let dataSetsValues = getChartDatasetValues(getters, dataSets);
28336
- if (definition.dataSetsHaveTitle &&
28337
- dataSetsValues[0] &&
28338
- labels.length > dataSetsValues[0].data.length) {
28365
+ if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
28339
28366
  labels.shift();
28340
28367
  }
28341
28368
  ({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
@@ -28355,9 +28382,7 @@ function getRadarChartData(definition, dataSets, labelRange, getters) {
28355
28382
  const labelValues = getChartLabelValues(getters, dataSets, labelRange);
28356
28383
  let labels = labelValues.formattedValues;
28357
28384
  let dataSetsValues = getChartDatasetValues(getters, dataSets);
28358
- if (definition.dataSetsHaveTitle &&
28359
- dataSetsValues[0] &&
28360
- labels.length > dataSetsValues[0].data.length) {
28385
+ if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
28361
28386
  labels.shift();
28362
28387
  }
28363
28388
  ({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
@@ -28377,7 +28402,7 @@ function getRadarChartData(definition, dataSets, labelRange, getters) {
28377
28402
  function getGeoChartData(definition, dataSets, labelRange, getters) {
28378
28403
  const labelValues = getChartLabelValues(getters, dataSets, labelRange);
28379
28404
  let labels = labelValues.formattedValues;
28380
- if (definition.dataSetsHaveTitle) {
28405
+ if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
28381
28406
  labels.shift();
28382
28407
  }
28383
28408
  let dataSetsValues = getChartDatasetValues(getters, dataSets);
@@ -28538,36 +28563,41 @@ function normalizeLabels(labels, newLabels, config) {
28538
28563
  }
28539
28564
  return { normalizedLabels, normalizedNewLabels };
28540
28565
  }
28541
- function getChartAxisType(chart, labelRange, getters) {
28542
- if (isDateChart(chart, labelRange, getters) && isLuxonTimeAdapterInstalled()) {
28566
+ function getChartAxisType(definition, dataSets, labelRange, getters) {
28567
+ if (isDateChart(definition, dataSets, labelRange, getters) && isLuxonTimeAdapterInstalled()) {
28543
28568
  return "time";
28544
28569
  }
28545
- if (isLinearChart(chart, labelRange, getters)) {
28570
+ if (isLinearChart(definition, dataSets, labelRange, getters)) {
28546
28571
  return "linear";
28547
28572
  }
28548
28573
  return "category";
28549
28574
  }
28550
- function isDateChart(definition, labelRange, getters) {
28551
- return !definition.labelsAsText && canBeDateChart(labelRange, getters);
28575
+ function isDateChart(definition, dataSets, labelRange, getters) {
28576
+ return !definition.labelsAsText && canBeDateChart(definition, dataSets, labelRange, getters);
28552
28577
  }
28553
- function isLinearChart(definition, labelRange, getters) {
28554
- return !definition.labelsAsText && canBeLinearChart(labelRange, getters);
28578
+ function isLinearChart(definition, dataSets, labelRange, getters) {
28579
+ return !definition.labelsAsText && canBeLinearChart(definition, dataSets, labelRange, getters);
28555
28580
  }
28556
- function canChartParseLabels(labelRange, getters) {
28557
- return canBeDateChart(labelRange, getters) || canBeLinearChart(labelRange, getters);
28581
+ function canChartParseLabels(definition, dataSets, labelRange, getters) {
28582
+ return (canBeDateChart(definition, dataSets, labelRange, getters) ||
28583
+ canBeLinearChart(definition, dataSets, labelRange, getters));
28558
28584
  }
28559
- function canBeDateChart(labelRange, getters) {
28560
- if (!labelRange || !canBeLinearChart(labelRange, getters)) {
28585
+ function canBeDateChart(definition, dataSets, labelRange, getters) {
28586
+ if (!labelRange || !canBeLinearChart(definition, dataSets, labelRange, getters)) {
28561
28587
  return false;
28562
28588
  }
28563
- const labelFormat = getChartLabelFormat(getters, labelRange);
28589
+ const removeFirstLabel = shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false);
28590
+ const labelFormat = getChartLabelFormat(getters, labelRange, removeFirstLabel);
28564
28591
  return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
28565
28592
  }
28566
- function canBeLinearChart(labelRange, getters) {
28593
+ function canBeLinearChart(definition, dataSets, labelRange, getters) {
28567
28594
  if (!labelRange) {
28568
28595
  return false;
28569
28596
  }
28570
28597
  const labels = getters.getRangeValues(labelRange);
28598
+ if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
28599
+ labels.shift();
28600
+ }
28571
28601
  if (labels.some((label) => isNaN(Number(label)) && label)) {
28572
28602
  return false;
28573
28603
  }
@@ -28676,17 +28706,15 @@ function aggregateDataForLabels(labels, datasets) {
28676
28706
  })),
28677
28707
  };
28678
28708
  }
28679
- function getChartLabelFormat(getters, range) {
28709
+ function getChartLabelFormat(getters, range, shouldRemoveFirstLabel) {
28680
28710
  if (!range)
28681
28711
  return undefined;
28682
- const { sheetId, zone: { left, top, bottom }, } = range;
28683
- for (let row = top; row <= bottom; row++) {
28684
- const format = getters.getEvaluatedCell({ sheetId, col: left, row }).format;
28685
- if (format) {
28686
- return format;
28687
- }
28712
+ const { sheetId, zone } = range;
28713
+ const formats = positions(zone).map((position) => getters.getEvaluatedCell({ sheetId, ...position }).format);
28714
+ if (shouldRemoveFirstLabel) {
28715
+ formats.shift();
28688
28716
  }
28689
- return undefined;
28717
+ return formats.find((format) => format !== undefined);
28690
28718
  }
28691
28719
  function getChartLabelValues(getters, dataSets, labelRange) {
28692
28720
  let labels = { values: [], formattedValues: [] };
@@ -32593,7 +32621,6 @@ css /* scss */ `
32593
32621
  border-left: 3px solid red;
32594
32622
  padding: 10px;
32595
32623
  width: ${ERROR_TOOLTIP_WIDTH}px;
32596
- box-sizing: border-box !important;
32597
32624
  overflow-wrap: break-word;
32598
32625
 
32599
32626
  .o-error-tooltip-message {
@@ -32676,7 +32703,6 @@ css /* scss */ `
32676
32703
  width: ${CHECKBOX_WIDTH}px;
32677
32704
  height: ${CHECKBOX_WIDTH}px;
32678
32705
  vertical-align: top;
32679
- box-sizing: border-box;
32680
32706
  outline: none;
32681
32707
  border: 1px solid ${GRAY_300};
32682
32708
  cursor: pointer;
@@ -32749,14 +32775,12 @@ class FilterMenuValueItem extends owl.Component {
32749
32775
  const FILTER_MENU_HEIGHT = 295;
32750
32776
  const CSS = css /* scss */ `
32751
32777
  .o-filter-menu {
32752
- box-sizing: border-box;
32753
32778
  padding: 8px 16px;
32754
32779
  height: ${FILTER_MENU_HEIGHT}px;
32755
32780
  line-height: 1;
32756
32781
 
32757
32782
  .o-filter-menu-item {
32758
32783
  display: flex;
32759
- box-sizing: border-box;
32760
32784
  cursor: pointer;
32761
32785
  user-select: none;
32762
32786
 
@@ -32986,7 +33010,6 @@ css /* scss */ `
32986
33010
  justify-content: space-between;
32987
33011
  height: ${LINK_TOOLTIP_HEIGHT}px;
32988
33012
  width: ${LINK_TOOLTIP_WIDTH}px;
32989
- box-sizing: border-box !important;
32990
33013
 
32991
33014
  img {
32992
33015
  margin-right: 3px;
@@ -33103,7 +33126,7 @@ const linkSheet = {
33103
33126
  const deleteSheet = {
33104
33127
  name: _t("Delete"),
33105
33128
  isVisible: (env) => {
33106
- return env.model.getters.getSheetIds().length > 1;
33129
+ return env.model.getters.getVisibleSheetIds().length > 1;
33107
33130
  },
33108
33131
  execute: (env) => env.askConfirmation(_t("Are you sure you want to delete this sheet?"), () => {
33109
33132
  env.model.dispatch("DELETE_SHEET", { sheetId: env.model.getters.getActiveSheetId() });
@@ -33114,7 +33137,7 @@ const duplicateSheet = {
33114
33137
  name: _t("Duplicate"),
33115
33138
  execute: (env) => {
33116
33139
  const sheetIdFrom = env.model.getters.getActiveSheetId();
33117
- const sheetIdTo = env.model.uuidGenerator.uuidv4();
33140
+ const sheetIdTo = env.model.uuidGenerator.smallUuid();
33118
33141
  env.model.dispatch("DUPLICATE_SHEET", {
33119
33142
  sheetId: sheetIdFrom,
33120
33143
  sheetIdTo,
@@ -33403,11 +33426,9 @@ css /* scss */ `
33403
33426
  background-color: white;
33404
33427
  padding: ${MENU_VERTICAL_PADDING}px 0px;
33405
33428
  width: ${MENU_WIDTH}px;
33406
- box-sizing: border-box !important;
33407
33429
  user-select: none;
33408
33430
 
33409
33431
  .o-menu-item {
33410
- box-sizing: border-box;
33411
33432
  height: ${MENU_ITEM_HEIGHT}px;
33412
33433
  padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
33413
33434
  cursor: pointer;
@@ -33659,7 +33680,7 @@ class Menu extends owl.Component {
33659
33680
  const MENU_OFFSET_X = 320;
33660
33681
  const MENU_OFFSET_Y = 100;
33661
33682
  const PADDING = 12;
33662
- const LINK_EDITOR_WIDTH = 340;
33683
+ const LINK_EDITOR_WIDTH = 340 + 2 * PADDING;
33663
33684
  css /* scss */ `
33664
33685
  .o-link-editor {
33665
33686
  font-size: 13px;
@@ -33683,7 +33704,6 @@ css /* scss */ `
33683
33704
  text-align: right;
33684
33705
  }
33685
33706
  input.o-input {
33686
- box-sizing: border-box;
33687
33707
  width: 100%;
33688
33708
  padding: 0 23px 4px 0;
33689
33709
  }
@@ -33911,20 +33931,21 @@ function getSmartChartDefinition(zone, getters) {
33911
33931
  }
33912
33932
  // Only display legend for several datasets.
33913
33933
  const newLegendPos = dataSetZone.right === dataSetZone.left ? "none" : "top";
33914
- const labelRange = labelRangeXc ? getters.getRangeFromSheetXC(sheetId, labelRangeXc) : undefined;
33915
- if (canChartParseLabels(labelRange, getters)) {
33916
- return {
33917
- title: {},
33918
- dataSets,
33919
- labelsAsText: false,
33920
- stacked: false,
33921
- aggregated: false,
33922
- cumulative: false,
33923
- labelRange: labelRangeXc,
33924
- type: "line",
33925
- dataSetsHaveTitle,
33926
- legendPosition: newLegendPos,
33927
- };
33934
+ const lineChartDefinition = {
33935
+ title: {},
33936
+ dataSets,
33937
+ labelsAsText: false,
33938
+ stacked: false,
33939
+ aggregated: false,
33940
+ cumulative: false,
33941
+ labelRange: labelRangeXc,
33942
+ type: "line",
33943
+ dataSetsHaveTitle,
33944
+ legendPosition: newLegendPos,
33945
+ };
33946
+ const chart = new LineChart(lineChartDefinition, sheetId, getters);
33947
+ if (canChartParseLabels(lineChartDefinition, chart.dataSets, chart.labelRange, getters)) {
33948
+ return lineChartDefinition;
33928
33949
  }
33929
33950
  const _dataSets = createDataSets(getters, dataSets, sheetId, dataSetsHaveTitle);
33930
33951
  if (singleColumn &&
@@ -34338,7 +34359,7 @@ const HIDE_ROWS_NAME = (env) => {
34338
34359
  //------------------------------------------------------------------------------
34339
34360
  const CREATE_CHART = (env) => {
34340
34361
  const getters = env.model.getters;
34341
- const id = env.model.uuidGenerator.uuidv4();
34362
+ const id = env.model.uuidGenerator.smallUuid();
34342
34363
  const sheetId = getters.getActiveSheetId();
34343
34364
  if (getZoneArea(env.model.getters.getSelectedZone()) === 1) {
34344
34365
  env.model.selection.selectTableAroundSelection();
@@ -34361,8 +34382,8 @@ const CREATE_CHART = (env) => {
34361
34382
  // Pivots
34362
34383
  //------------------------------------------------------------------------------
34363
34384
  const CREATE_PIVOT = (env) => {
34364
- const pivotId = env.model.uuidGenerator.uuidv4();
34365
- const newSheetId = env.model.uuidGenerator.uuidv4();
34385
+ const pivotId = env.model.uuidGenerator.smallUuid();
34386
+ const newSheetId = env.model.uuidGenerator.smallUuid();
34366
34387
  const result = env.model.dispatch("INSERT_NEW_PIVOT", { pivotId, newSheetId });
34367
34388
  if (result.isSuccessful) {
34368
34389
  env.openSidePanel("PivotSidePanel", { pivotId });
@@ -34421,7 +34442,7 @@ async function requestImage(env) {
34421
34442
  const CREATE_IMAGE = async (env) => {
34422
34443
  if (env.imageProvider) {
34423
34444
  const sheetId = env.model.getters.getActiveSheetId();
34424
- const figureId = env.model.uuidGenerator.uuidv4();
34445
+ const figureId = env.model.uuidGenerator.smallUuid();
34425
34446
  const image = await requestImage(env);
34426
34447
  if (!image) {
34427
34448
  throw new Error("No image provider was given to the environment");
@@ -34974,7 +34995,7 @@ const insertCheckbox = {
34974
34995
  ranges,
34975
34996
  sheetId,
34976
34997
  rule: {
34977
- id: env.model.uuidGenerator.uuidv4(),
34998
+ id: env.model.uuidGenerator.smallUuid(),
34978
34999
  criterion: {
34979
35000
  type: "isBoolean",
34980
35001
  values: [],
@@ -34990,7 +35011,7 @@ const insertDropdown = {
34990
35011
  const zones = env.model.getters.getSelectedZones();
34991
35012
  const sheetId = env.model.getters.getActiveSheetId();
34992
35013
  const ranges = zones.map((zone) => env.model.getters.getRangeDataFromZone(sheetId, zone));
34993
- const ruleID = env.model.uuidGenerator.uuidv4();
35014
+ const ruleID = env.model.uuidGenerator.smallUuid();
34994
35015
  env.model.dispatch("ADD_DATA_VALIDATION_RULE", {
34995
35016
  ranges,
34996
35017
  sheetId,
@@ -35021,7 +35042,7 @@ const insertSheet = {
35021
35042
  execute: (env) => {
35022
35043
  const activeSheetId = env.model.getters.getActiveSheetId();
35023
35044
  const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;
35024
- const sheetId = env.model.uuidGenerator.uuidv4();
35045
+ const sheetId = env.model.uuidGenerator.smallUuid();
35025
35046
  env.model.dispatch("CREATE_SHEET", { sheetId, position });
35026
35047
  env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
35027
35048
  },
@@ -37999,7 +38020,6 @@ css /* scss */ `
37999
38020
  }
38000
38021
  }
38001
38022
  .o-button {
38002
- height: 28px;
38003
38023
  flex-grow: 0;
38004
38024
  }
38005
38025
 
@@ -38556,8 +38576,8 @@ css /* scss */ `
38556
38576
  }
38557
38577
  }
38558
38578
  .o-color-picker-line-item {
38559
- width: ${ITEM_EDGE_LENGTH}px;
38560
- height: ${ITEM_EDGE_LENGTH}px;
38579
+ width: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
38580
+ height: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
38561
38581
  margin: 0px;
38562
38582
  border-radius: 50px;
38563
38583
  border: ${ITEM_BORDER_WIDTH}px solid #666666;
@@ -38580,7 +38600,6 @@ css /* scss */ `
38580
38600
  font-size: 14px;
38581
38601
  background: white;
38582
38602
  border-radius: 4px;
38583
- box-sizing: border-box;
38584
38603
  &:hover:enabled {
38585
38604
  background-color: rgba(0, 0, 0, 0.08);
38586
38605
  }
@@ -38607,7 +38626,6 @@ css /* scss */ `
38607
38626
  .o-gradient {
38608
38627
  margin-bottom: ${MAGNIFIER_EDGE / 2}px;
38609
38628
  border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
38610
- box-sizing: border-box;
38611
38629
  width: ${INNER_GRADIENT_WIDTH + 2 * ITEM_BORDER_WIDTH}px;
38612
38630
  height: ${INNER_GRADIENT_HEIGHT + 2 * ITEM_BORDER_WIDTH}px;
38613
38631
  position: relative;
@@ -38616,7 +38634,6 @@ css /* scss */ `
38616
38634
  .magnifier {
38617
38635
  height: ${MAGNIFIER_EDGE}px;
38618
38636
  width: ${MAGNIFIER_EDGE}px;
38619
- box-sizing: border-box;
38620
38637
  border-radius: 50%;
38621
38638
  border: 2px solid #fff;
38622
38639
  box-shadow: 0px 0px 3px #c0c0c0;
@@ -38631,7 +38648,6 @@ css /* scss */ `
38631
38648
  }
38632
38649
  .o-hue-picker {
38633
38650
  border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
38634
- box-sizing: border-box;
38635
38651
  width: 100%;
38636
38652
  height: 12px;
38637
38653
  border-radius: 4px;
@@ -38658,7 +38674,6 @@ css /* scss */ `
38658
38674
  padding: 2px 0px;
38659
38675
  display: flex;
38660
38676
  input {
38661
- box-sizing: border-box;
38662
38677
  width: 50%;
38663
38678
  border-radius: 4px;
38664
38679
  padding: 4px 23px 4px 10px;
@@ -38857,7 +38872,7 @@ css /* scss */ `
38857
38872
  .o-color-picker-button {
38858
38873
  > span {
38859
38874
  border-bottom: 4px solid;
38860
- height: 16px;
38875
+ height: 20px;
38861
38876
  margin-top: 2px;
38862
38877
  display: block;
38863
38878
  }
@@ -39186,8 +39201,8 @@ const TRANSPARENT_BACKGROUND_SVG = /*xml*/ `
39186
39201
  `;
39187
39202
  css /* scss */ `
39188
39203
  .o-round-color-picker-button {
39189
- width: 18px;
39190
- height: 18px;
39204
+ width: 20px;
39205
+ height: 20px;
39191
39206
  cursor: pointer;
39192
39207
  border: 1px solid ${GRAY_300};
39193
39208
  background-position: 1px 1px;
@@ -39334,7 +39349,6 @@ css /* scss */ `
39334
39349
  width: 14px;
39335
39350
  height: 14px;
39336
39351
  border: 1px solid ${GRAY_300};
39337
- box-sizing: border-box;
39338
39352
  outline: none;
39339
39353
  border-radius: 8px;
39340
39354
 
@@ -40050,8 +40064,6 @@ css /* scss */ `
40050
40064
  word-break: break-all;
40051
40065
  padding-right: 2px;
40052
40066
 
40053
- box-sizing: border-box;
40054
-
40055
40067
  caret-color: black;
40056
40068
  padding-left: 3px;
40057
40069
  padding-right: 3px;
@@ -40707,7 +40719,6 @@ css /* scss */ `
40707
40719
  .o-spreadsheet {
40708
40720
  .o-standalone-composer {
40709
40721
  min-height: 24px;
40710
- box-sizing: border-box;
40711
40722
 
40712
40723
  border-bottom: 1px solid;
40713
40724
  border-color: ${GRAY_300};
@@ -40809,7 +40820,6 @@ css /* scss */ `
40809
40820
  }
40810
40821
 
40811
40822
  td {
40812
- box-sizing: border-box;
40813
40823
  height: 30px;
40814
40824
  padding: 6px 0;
40815
40825
  }
@@ -40832,7 +40842,6 @@ css /* scss */ `
40832
40842
  select {
40833
40843
  width: 100%;
40834
40844
  height: 100%;
40835
- box-sizing: border-box;
40836
40845
  }
40837
40846
  }
40838
40847
  `;
@@ -41062,7 +41071,7 @@ class LineConfigPanel extends GenericChartConfigPanel {
41062
41071
  get canTreatLabelsAsText() {
41063
41072
  const chart = this.env.model.getters.getChart(this.props.figureId);
41064
41073
  if (chart && chart instanceof LineChart) {
41065
- return canChartParseLabels(chart.labelRange, this.env.model.getters);
41074
+ return canChartParseLabels(chart.getDefinition(), chart.dataSets, chart.labelRange, this.env.model.getters);
41066
41075
  }
41067
41076
  return false;
41068
41077
  }
@@ -41139,7 +41148,7 @@ class ScatterConfigPanel extends GenericChartConfigPanel {
41139
41148
  get canTreatLabelsAsText() {
41140
41149
  const chart = this.env.model.getters.getChart(this.props.figureId);
41141
41150
  if (chart && chart instanceof ScatterChart) {
41142
- return canChartParseLabels(chart.labelRange, this.env.model.getters);
41151
+ return canChartParseLabels(chart.getDefinition(), chart.dataSets, chart.labelRange, this.env.model.getters);
41143
41152
  }
41144
41153
  return false;
41145
41154
  }
@@ -41392,7 +41401,6 @@ css /* scss */ `
41392
41401
  }
41393
41402
 
41394
41403
  .o-popover .o-chart-select-popover {
41395
- box-sizing: border-box;
41396
41404
  background: #fff;
41397
41405
  .o-chart-type-item {
41398
41406
  cursor: pointer;
@@ -41692,7 +41700,7 @@ css /* scss */ `
41692
41700
  }
41693
41701
 
41694
41702
  border-bottom: 1px solid ${GRAY_300};
41695
- height: 60px;
41703
+ height: 80px;
41696
41704
  padding: 10px;
41697
41705
  position: relative;
41698
41706
  cursor: pointer;
@@ -42426,7 +42434,7 @@ class ConditionalFormattingPanel extends owl.Component {
42426
42434
  this.originalEditedCf = undefined;
42427
42435
  }
42428
42436
  addConditionalFormat() {
42429
- const cfId = this.env.model.uuidGenerator.uuidv4();
42437
+ const cfId = this.env.model.uuidGenerator.smallUuid();
42430
42438
  this.env.model.dispatch("ADD_CONDITIONAL_FORMAT", {
42431
42439
  sheetId: this.activeSheetId,
42432
42440
  ranges: this.env.model.getters
@@ -43696,7 +43704,7 @@ class DataValidationEditor extends owl.Component {
43696
43704
  .getSelectedZones()
43697
43705
  .map((zone) => zoneToXc(this.env.model.getters.getUnboundedZone(sheetId, zone)));
43698
43706
  return {
43699
- id: this.env.model.uuidGenerator.uuidv4(),
43707
+ id: this.env.model.uuidGenerator.smallUuid(),
43700
43708
  criterion: { type: "textContains", values: [""] },
43701
43709
  ranges,
43702
43710
  };
@@ -43713,7 +43721,6 @@ css /* scss */ `
43713
43721
  .o-sidePanel {
43714
43722
  .o-dv-preview {
43715
43723
  height: 70px;
43716
- box-sizing: border-box;
43717
43724
  cursor: pointer;
43718
43725
  border-bottom: 1px solid ${FIGURE_BORDER_COLOR};
43719
43726
 
@@ -44329,7 +44336,7 @@ class FindAndReplacePanel extends owl.Component {
44329
44336
  css /* scss */ `
44330
44337
  .o-more-formats-panel {
44331
44338
  .format-preview {
44332
- height: 48px;
44339
+ height: 49px;
44333
44340
  background-color: white;
44334
44341
  cursor: pointer;
44335
44342
 
@@ -44501,7 +44508,6 @@ css /* scss */ `
44501
44508
  .o-sidePanel {
44502
44509
  .o-pivot-measure-display-field,
44503
44510
  .o-pivot-measure-display-value {
44504
- box-sizing: border-box;
44505
44511
  border: solid 1px ${GRAY_300};
44506
44512
  border-radius: 3px;
44507
44513
  }
@@ -44544,7 +44550,7 @@ class PivotMeasureDisplayPanel extends owl.Component {
44544
44550
 
44545
44551
  css /* scss */ `
44546
44552
  .pivot-defer-update {
44547
- min-height: 35px;
44553
+ min-height: 40px;
44548
44554
  }
44549
44555
  `;
44550
44556
  class PivotDeferUpdate extends owl.Component {
@@ -44690,7 +44696,6 @@ class AddDimensionButton extends owl.Component {
44690
44696
  css /* scss */ `
44691
44697
  .o-spreadsheet {
44692
44698
  .os-input {
44693
- box-sizing: border-box;
44694
44699
  border-width: 0 0 1px 0;
44695
44700
  border-color: transparent;
44696
44701
  outline: none;
@@ -45314,8 +45319,8 @@ class PivotTitleSection extends owl.Component {
45314
45319
  return this.env.model.getters.getPivotDisplayName(this.props.pivotId);
45315
45320
  }
45316
45321
  duplicatePivot() {
45317
- const newPivotId = this.env.model.uuidGenerator.uuidv4();
45318
- const newSheetId = this.env.model.uuidGenerator.uuidv4();
45322
+ const newPivotId = this.env.model.uuidGenerator.smallUuid();
45323
+ const newSheetId = this.env.model.uuidGenerator.smallUuid();
45319
45324
  const result = this.env.model.dispatch("DUPLICATE_PIVOT_IN_NEW_SHEET", {
45320
45325
  pivotId: this.props.pivotId,
45321
45326
  newPivotId,
@@ -47659,7 +47664,6 @@ class TableStylesPopover extends owl.Component {
47659
47664
 
47660
47665
  css /* scss */ `
47661
47666
  .o-table-style-picker {
47662
- box-sizing: border-box;
47663
47667
  border: 1px solid ${GRAY_300};
47664
47668
  border-radius: 3px;
47665
47669
 
@@ -47938,7 +47942,7 @@ class TableStyleEditorPanel extends owl.Component {
47938
47942
  this.state.selectedTemplateName = templateName;
47939
47943
  }
47940
47944
  onConfirm() {
47941
- const tableStyleId = this.props.styleId || this.env.model.uuidGenerator.uuidv4();
47945
+ const tableStyleId = this.props.styleId || this.env.model.uuidGenerator.smallUuid();
47942
47946
  this.env.model.dispatch("CREATE_TABLE_STYLE", {
47943
47947
  tableStyleId,
47944
47948
  tableStyleName: this.state.styleName,
@@ -48111,7 +48115,6 @@ const BORDER_WIDTH = 1;
48111
48115
  const ACTIVE_BORDER_WIDTH = 2;
48112
48116
  css /*SCSS*/ `
48113
48117
  div.o-figure {
48114
- box-sizing: border-box;
48115
48118
  position: absolute;
48116
48119
  width: 100%;
48117
48120
  height: 100%;
@@ -48123,7 +48126,6 @@ css /*SCSS*/ `
48123
48126
  }
48124
48127
 
48125
48128
  div.o-figure-border {
48126
- box-sizing: border-box;
48127
48129
  z-index: 1;
48128
48130
  }
48129
48131
 
@@ -48497,7 +48499,6 @@ css /* scss */ `
48497
48499
  height: ${AUTOFILL_EDGE_LENGTH}px;
48498
48500
  width: ${AUTOFILL_EDGE_LENGTH}px;
48499
48501
  border: 1px solid white;
48500
- box-sizing: border-box !important;
48501
48502
  background-color: #1a73e8;
48502
48503
  }
48503
48504
 
@@ -48874,7 +48875,6 @@ const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
48874
48875
  css /* scss */ `
48875
48876
  div.o-grid-composer {
48876
48877
  z-index: ${ComponentsImportance.GridComposer};
48877
- box-sizing: border-box;
48878
48878
  position: absolute;
48879
48879
  border: ${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR};
48880
48880
  font-family: ${DEFAULT_FONT};
@@ -49123,8 +49123,6 @@ class GridCellIcon extends owl.Component {
49123
49123
  const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
49124
49124
  css /* scss */ `
49125
49125
  .o-dv-checkbox {
49126
- box-sizing: border-box !important;
49127
- accent-color: #808080;
49128
49126
  margin: ${MARGIN}px;
49129
49127
  /* required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
49130
49128
  position: absolute;
@@ -49884,7 +49882,6 @@ class FilterIconsOverlay extends owl.Component {
49884
49882
  css /* scss */ `
49885
49883
  .o-grid-add-rows {
49886
49884
  input.o-input {
49887
- box-sizing: border-box;
49888
49885
  width: 60px;
49889
49886
  height: 30px;
49890
49887
  }
@@ -51812,6 +51809,7 @@ css /* scss */ `
51812
51809
  background-color: ${BACKGROUND_GRAY_COLOR};
51813
51810
 
51814
51811
  &.corner {
51812
+ box-sizing: content-box;
51815
51813
  right: 0px;
51816
51814
  bottom: 0px;
51817
51815
  height: ${SCROLLBAR_WIDTH}px;
@@ -52047,8 +52045,8 @@ const SIZE = 3;
52047
52045
  const COLOR = "#777";
52048
52046
  css /* scss */ `
52049
52047
  .o-table-resizer {
52050
- width: ${SIZE}px;
52051
- height: ${SIZE}px;
52048
+ width: ${SIZE * 2}px;
52049
+ height: ${SIZE * 2}px;
52052
52050
  border-bottom: ${SIZE}px solid ${COLOR};
52053
52051
  border-right: ${SIZE}px solid ${COLOR};
52054
52052
  cursor: nwse-resize;
@@ -56564,7 +56562,7 @@ class SheetPlugin extends CorePlugin {
56564
56562
  ? "Success" /* CommandResult.Success */
56565
56563
  : "InvalidColor" /* CommandResult.InvalidColor */;
56566
56564
  case "DELETE_SHEET":
56567
- return this.orderedSheetIds.length > 1
56565
+ return this.getVisibleSheetIds().length > 1
56568
56566
  ? "Success" /* CommandResult.Success */
56569
56567
  : "NotEnoughSheets" /* CommandResult.NotEnoughSheets */;
56570
56568
  case "ADD_COLUMNS_ROWS":
@@ -63926,6 +63924,15 @@ class Session extends EventBus {
63926
63924
  }
63927
63925
  this.sendPendingMessage();
63928
63926
  }
63927
+ dropPendingRevision(revisionId) {
63928
+ this.revisions.drop(revisionId);
63929
+ const revisionIds = this.pendingMessages
63930
+ .filter((message) => message.type === "REMOTE_REVISION")
63931
+ .map((message) => message.nextRevisionId);
63932
+ this.trigger("pending-revisions-dropped", { revisionIds });
63933
+ this.waitingAck = false;
63934
+ this.waitingUndoRedoAck = false;
63935
+ }
63929
63936
  /**
63930
63937
  * Send the next pending message
63931
63938
  */
@@ -63940,13 +63947,7 @@ class Session extends EventBus {
63940
63947
  * The command is empty, we have to drop all the next local revisions
63941
63948
  * to avoid issues with undo/redo
63942
63949
  */
63943
- this.revisions.drop(revision.id);
63944
- const revisionIds = this.pendingMessages
63945
- .filter((message) => message.type === "REMOTE_REVISION")
63946
- .map((message) => message.nextRevisionId);
63947
- this.trigger("pending-revisions-dropped", { revisionIds });
63948
- this.waitingAck = false;
63949
- this.waitingUndoRedoAck = false;
63950
+ this.dropPendingRevision(revision.id);
63950
63951
  this.pendingMessages = [];
63951
63952
  return;
63952
63953
  }
@@ -63973,7 +63974,6 @@ class Session extends EventBus {
63973
63974
  switch (message.type) {
63974
63975
  case "REMOTE_REVISION":
63975
63976
  case "REVISION_REDONE":
63976
- case "REVISION_UNDONE":
63977
63977
  case "SNAPSHOT_CREATED":
63978
63978
  this.waitingAck = false;
63979
63979
  this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
@@ -63982,6 +63982,27 @@ class Session extends EventBus {
63982
63982
  this.lastRevisionMessage = message;
63983
63983
  this.sendPendingMessage();
63984
63984
  break;
63985
+ case "REVISION_UNDONE": {
63986
+ this.waitingAck = false;
63987
+ this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
63988
+ const pendingRemoteRevisions = this.pendingMessages.filter((message) => message.type === "REMOTE_REVISION");
63989
+ const firstTransformedRevisionIndex = pendingRemoteRevisions.findIndex((message) => !deepEquals(message.commands, this.revisions.get(message.nextRevisionId).commands));
63990
+ if (firstTransformedRevisionIndex !== -1) {
63991
+ /**
63992
+ * Some revisions undergo transformations that may cause issues with
63993
+ * undo/redo if the transformation is destructive (we don't get back
63994
+ * the original command by transforming it with the inverse).
63995
+ * To prevent these problems, we must discard all subsequent local
63996
+ * revisions.
63997
+ */
63998
+ this.dropPendingRevision(this.pendingMessages[firstTransformedRevisionIndex].nextRevisionId);
63999
+ this.pendingMessages = this.pendingMessages.slice(0, firstTransformedRevisionIndex);
64000
+ }
64001
+ this.serverRevisionId = message.nextRevisionId;
64002
+ this.processedRevisions.add(message.nextRevisionId);
64003
+ this.sendPendingMessage();
64004
+ break;
64005
+ }
63985
64006
  }
63986
64007
  }
63987
64008
  isAlreadyProcessed(message) {
@@ -65446,23 +65467,23 @@ const uuidGenerator = new UuidGenerator();
65446
65467
  function repeatCreateChartCommand(getters, cmd) {
65447
65468
  return {
65448
65469
  ...repeatSheetDependantCommand(getters, cmd),
65449
- id: uuidGenerator.uuidv4(),
65470
+ id: uuidGenerator.smallUuid(),
65450
65471
  };
65451
65472
  }
65452
65473
  function repeatCreateImageCommand(getters, cmd) {
65453
65474
  return {
65454
65475
  ...repeatSheetDependantCommand(getters, cmd),
65455
- figureId: uuidGenerator.uuidv4(),
65476
+ figureId: uuidGenerator.smallUuid(),
65456
65477
  };
65457
65478
  }
65458
65479
  function repeatCreateFigureCommand(getters, cmd) {
65459
65480
  const newCmd = repeatSheetDependantCommand(getters, cmd);
65460
- newCmd.figure.id = uuidGenerator.uuidv4();
65481
+ newCmd.figure.id = uuidGenerator.smallUuid();
65461
65482
  return newCmd;
65462
65483
  }
65463
65484
  function repeatCreateSheetCommand(getters, cmd) {
65464
65485
  const newCmd = deepCopy(cmd);
65465
- newCmd.sheetId = uuidGenerator.uuidv4();
65486
+ newCmd.sheetId = uuidGenerator.smallUuid();
65466
65487
  const sheetName = cmd.name || getters.getSheet(getters.getActiveSheetId()).name;
65467
65488
  // Extract the prefix of the sheet name (everything before the number at the end of the name)
65468
65489
  const namePrefix = sheetName.match(/(.+?)\d*$/)?.[1] || sheetName;
@@ -66922,23 +66943,7 @@ class GridSelectionPlugin extends UIPlugin {
66922
66943
  gridSelection: deepCopy(gridSelection),
66923
66944
  };
66924
66945
  }
66925
- if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
66926
- const currentSheetIds = this.getters.getVisibleSheetIds();
66927
- this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
66928
- if (this.activeSheet.id in this.sheetsData) {
66929
- const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
66930
- this.selectCell(anchor.cell.col, anchor.cell.row);
66931
- }
66932
- else {
66933
- this.selectCell(0, 0);
66934
- }
66935
- const { col, row } = this.gridSelection.anchor.cell;
66936
- this.moveClient({
66937
- sheetId: this.getters.getActiveSheetId(),
66938
- col,
66939
- row,
66940
- });
66941
- }
66946
+ this.fallbackToVisibleSheet();
66942
66947
  const sheetId = this.getters.getActiveSheetId();
66943
66948
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
66944
66949
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
@@ -66948,6 +66953,7 @@ class GridSelectionPlugin extends UIPlugin {
66948
66953
  }
66949
66954
  }
66950
66955
  finalize() {
66956
+ this.fallbackToVisibleSheet();
66951
66957
  /** Any change to the selection has to be reflected in the selection processor. */
66952
66958
  this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
66953
66959
  }
@@ -67258,6 +67264,25 @@ class GridSelectionPlugin extends UIPlugin {
67258
67264
  }
67259
67265
  return "Success" /* CommandResult.Success */;
67260
67266
  }
67267
+ fallbackToVisibleSheet() {
67268
+ if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
67269
+ const currentSheetIds = this.getters.getVisibleSheetIds();
67270
+ this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
67271
+ if (this.activeSheet.id in this.sheetsData) {
67272
+ const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
67273
+ this.selectCell(anchor.cell.col, anchor.cell.row);
67274
+ }
67275
+ else {
67276
+ this.selectCell(0, 0);
67277
+ }
67278
+ const { col, row } = this.gridSelection.anchor.cell;
67279
+ this.moveClient({
67280
+ sheetId: this.getters.getActiveSheetId(),
67281
+ col,
67282
+ row,
67283
+ });
67284
+ }
67285
+ }
67261
67286
  //-------------------------------------------
67262
67287
  // Helpers for extensions
67263
67288
  // ------------------------------------------
@@ -69232,7 +69257,7 @@ class BottomBar extends owl.Component {
69232
69257
  clickAddSheet(ev) {
69233
69258
  const activeSheetId = this.env.model.getters.getActiveSheetId();
69234
69259
  const position = this.env.model.getters.getSheetIds().findIndex((sheetId) => sheetId === activeSheetId) + 1;
69235
- const sheetId = this.env.model.uuidGenerator.uuidv4();
69260
+ const sheetId = this.env.model.uuidGenerator.smallUuid();
69236
69261
  const name = this.env.model.getters.getNextSheetName(_t("Sheet"));
69237
69262
  this.env.model.dispatch("CREATE_SHEET", { sheetId, position, name });
69238
69263
  this.env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
@@ -69548,8 +69573,8 @@ css /* scss */ `
69548
69573
  z-index: ${ComponentsImportance.HeaderGroupingButton};
69549
69574
  .o-group-fold-button {
69550
69575
  cursor: pointer;
69551
- width: 13px;
69552
- height: 13px;
69576
+ width: 15px;
69577
+ height: 15px;
69553
69578
  border: 1px solid ${HEADER_GROUPING_BORDER_COLOR};
69554
69579
  .o-icon {
69555
69580
  width: 7px;
@@ -69561,9 +69586,6 @@ css /* scss */ `
69561
69586
  }
69562
69587
  }
69563
69588
  }
69564
- .o-group-border {
69565
- box-sizing: border-box;
69566
- }
69567
69589
  }
69568
69590
  `;
69569
69591
  class AbstractHeaderGroup extends owl.Component {
@@ -69958,7 +69980,7 @@ css /* scss */ `
69958
69980
  margin: 2px 1px;
69959
69981
  padding: 0px 1px;
69960
69982
  border-radius: 2px;
69961
- min-width: 20px;
69983
+ min-width: 22px;
69962
69984
  }
69963
69985
  .o-disabled {
69964
69986
  opacity: 0.6;
@@ -70057,8 +70079,8 @@ css /* scss */ `
70057
70079
  margin: 1px;
70058
70080
  .o-line-item {
70059
70081
  padding: 4px;
70060
- width: 18px;
70061
- height: 18px;
70082
+ width: 26px;
70083
+ height: 26px;
70062
70084
  &.active {
70063
70085
  background-color: ${BUTTON_ACTIVE_BG};
70064
70086
  }
@@ -70739,7 +70761,6 @@ css /* scss */ `
70739
70761
  *,
70740
70762
  *:before,
70741
70763
  *:after {
70742
- box-sizing: content-box;
70743
70764
  /* rtl not supported ATM */
70744
70765
  direction: ltr;
70745
70766
  }
@@ -70798,7 +70819,6 @@ css /* scss */ `
70798
70819
  .o-input {
70799
70820
  min-width: 0px;
70800
70821
  padding: 1px 0;
70801
- box-sizing: border-box;
70802
70822
  width: 100%;
70803
70823
  outline: none;
70804
70824
  border-color: ${GRAY_300};
@@ -70869,18 +70889,9 @@ css /* scss */ `
70869
70889
  }
70870
70890
 
70871
70891
  > canvas {
70892
+ box-sizing: content-box;
70872
70893
  border-bottom: 1px solid #e2e3e3;
70873
70894
  }
70874
- .o-scrollbar {
70875
- &.corner {
70876
- right: 0px;
70877
- bottom: 0px;
70878
- height: ${SCROLLBAR_WIDTH}px;
70879
- width: ${SCROLLBAR_WIDTH}px;
70880
- border-top: 1px solid #e2e3e3;
70881
- border-left: 1px solid #e2e3e3;
70882
- }
70883
- }
70884
70895
 
70885
70896
  .o-grid-overlay {
70886
70897
  position: absolute;
@@ -70893,7 +70904,7 @@ css /* scss */ `
70893
70904
  border-radius: 4px;
70894
70905
  font-weight: 500;
70895
70906
  font-size: 14px;
70896
- height: 30px;
70907
+ height: 32px;
70897
70908
  line-height: 16px;
70898
70909
  flex-grow: 1;
70899
70910
  background-color: ${BUTTON_BG};
@@ -71521,7 +71532,7 @@ class Tree {
71521
71532
  }
71522
71533
  /**
71523
71534
  * Drop the operation and all following operations in every
71524
- * branch
71535
+ * branches
71525
71536
  */
71526
71537
  drop(operationId) {
71527
71538
  for (const branch of this.branches) {
@@ -74983,7 +74994,7 @@ class Model extends EventBus {
74983
74994
  }
74984
74995
  setupConfig(config) {
74985
74996
  const client = config.client || {
74986
- id: this.uuidGenerator.uuidv4(),
74997
+ id: this.uuidGenerator.smallUuid(),
74987
74998
  name: _t("Anonymous").toString(),
74988
74999
  };
74989
75000
  const transportService = config.transportService || new LocalTransportService();
@@ -75522,6 +75533,6 @@ exports.tokenColors = tokenColors;
75522
75533
  exports.tokenize = tokenize;
75523
75534
 
75524
75535
 
75525
- __info__.version = "18.2.0-alpha.7";
75526
- __info__.date = "2025-02-10T09:01:19.353Z";
75527
- __info__.hash = "0432f17";
75536
+ __info__.version = "18.2.0-alpha.8";
75537
+ __info__.date = "2025-02-14T08:40:13.286Z";
75538
+ __info__.hash = "19d45d9";