@odoo/o-spreadsheet 17.1.0-alpha.6 → 17.1.0

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.1.0-alpha.6
6
- * @date 2024-01-04T12:22:45.921Z
7
- * @hash 56dbdc9
5
+ * @version 17.1.0
6
+ * @date 2024-01-16T07:47:15.054Z
7
+ * @hash 87253c7
8
8
  */
9
9
 
10
10
  'use strict';
@@ -480,7 +480,7 @@ function isBoolean(str) {
480
480
  const upperCased = str.toUpperCase();
481
481
  return upperCased === "TRUE" || upperCased === "FALSE";
482
482
  }
483
- const MARKDOWN_LINK_REGEX = /^\[([^\[]+)\]\((.+)\)$/;
483
+ const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
484
484
  //link must start with http or https
485
485
  //https://stackoverflow.com/a/3809435/4760614
486
486
  const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
@@ -1202,16 +1202,84 @@ function toXC(col, row, rangePart = { colFixed: false, rowFixed: false }) {
1202
1202
  // -----------------------------------------------------------------------------
1203
1203
  // Date Type
1204
1204
  // -----------------------------------------------------------------------------
1205
+ /**
1206
+ * A DateTime object that can be used to manipulate spreadsheet dates.
1207
+ * Conceptually, a spreadsheet date is simply a number with a date format,
1208
+ * and it is timezone-agnostic.
1209
+ * This DateTime object consistently uses UTC time to represent a naive date and time.
1210
+ */
1211
+ class DateTime {
1212
+ jsDate;
1213
+ constructor(year, month, day, hours = 0, minutes = 0, seconds = 0) {
1214
+ this.jsDate = new Date(Date.UTC(year, month, day, hours, minutes, seconds, 0));
1215
+ }
1216
+ static fromTimestamp(timestamp) {
1217
+ const date = new Date(timestamp);
1218
+ return new DateTime(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
1219
+ }
1220
+ static now() {
1221
+ const now = new Date();
1222
+ return new DateTime(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());
1223
+ }
1224
+ toString() {
1225
+ return this.jsDate.toString();
1226
+ }
1227
+ toLocaleDateString() {
1228
+ return this.jsDate.toLocaleDateString();
1229
+ }
1230
+ getTime() {
1231
+ return this.jsDate.getTime();
1232
+ }
1233
+ getFullYear() {
1234
+ return this.jsDate.getUTCFullYear();
1235
+ }
1236
+ getMonth() {
1237
+ return this.jsDate.getUTCMonth();
1238
+ }
1239
+ getDate() {
1240
+ return this.jsDate.getUTCDate();
1241
+ }
1242
+ getDay() {
1243
+ return this.jsDate.getUTCDay();
1244
+ }
1245
+ getHours() {
1246
+ return this.jsDate.getUTCHours();
1247
+ }
1248
+ getMinutes() {
1249
+ return this.jsDate.getUTCMinutes();
1250
+ }
1251
+ getSeconds() {
1252
+ return this.jsDate.getUTCSeconds();
1253
+ }
1254
+ setFullYear(year) {
1255
+ return this.jsDate.setUTCFullYear(year);
1256
+ }
1257
+ setMonth(month) {
1258
+ return this.jsDate.setUTCMonth(month);
1259
+ }
1260
+ setDate(date) {
1261
+ return this.jsDate.setUTCDate(date);
1262
+ }
1263
+ setHours(hours) {
1264
+ return this.jsDate.setUTCHours(hours);
1265
+ }
1266
+ setMinutes(minutes) {
1267
+ return this.jsDate.setUTCMinutes(minutes);
1268
+ }
1269
+ setSeconds(seconds) {
1270
+ return this.jsDate.setUTCSeconds(seconds);
1271
+ }
1272
+ }
1205
1273
  // -----------------------------------------------------------------------------
1206
1274
  // Parsing
1207
1275
  // -----------------------------------------------------------------------------
1208
- const INITIAL_1900_DAY = new Date(1899, 11, 30);
1276
+ const INITIAL_1900_DAY = new DateTime(1899, 11, 30);
1209
1277
  const MS_PER_DAY = 24 * 60 * 60 * 1000;
1210
1278
  const CURRENT_MILLENIAL = 2000; // note: don't forget to update this in 2999
1211
- const CURRENT_YEAR = new Date().getFullYear();
1212
- const CURRENT_MONTH = new Date().getMonth();
1213
- const INITIAL_JS_DAY = new Date(0);
1214
- const DATE_JS_1900_OFFSET = INITIAL_JS_DAY - INITIAL_1900_DAY;
1279
+ const CURRENT_YEAR = DateTime.now().getFullYear();
1280
+ const CURRENT_MONTH = DateTime.now().getMonth();
1281
+ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
1282
+ const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
1215
1283
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
1216
1284
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
1217
1285
  const dateSeparatorsRegex = /\/|-|\s/;
@@ -1272,7 +1340,7 @@ function _parseDateTime(str, locale) {
1272
1340
  return {
1273
1341
  value: date.value + time.value,
1274
1342
  format: date.format + " " + (time.format === "hhhh:mm:ss" ? "hh:mm:ss" : time.format),
1275
- jsDate: new Date(date.jsDate.getFullYear() + time.jsDate.getFullYear() - 1899, date.jsDate.getMonth() + time.jsDate.getMonth() - 11, date.jsDate.getDate() + time.jsDate.getDate() - 30, date.jsDate.getHours() + time.jsDate.getHours(), date.jsDate.getMinutes() + time.jsDate.getMinutes(), date.jsDate.getSeconds() + time.jsDate.getSeconds()),
1343
+ jsDate: new DateTime(date.jsDate.getFullYear() + time.jsDate.getFullYear() - 1899, date.jsDate.getMonth() + time.jsDate.getMonth() - 11, date.jsDate.getDate() + time.jsDate.getDate() - 30, date.jsDate.getHours() + time.jsDate.getHours(), date.jsDate.getMinutes() + time.jsDate.getMinutes(), date.jsDate.getSeconds() + time.jsDate.getSeconds()),
1276
1344
  };
1277
1345
  }
1278
1346
  return date || time;
@@ -1348,12 +1416,12 @@ function parseDate(parts, separator) {
1348
1416
  // month + 1: months are 0-indexed in JS
1349
1417
  const leadingZero = (monthStr?.length === 2 && month + 1 < 10) || (dayStr?.length === 2 && day < 10);
1350
1418
  const fullYear = yearStr?.length !== 2;
1351
- const jsDate = new Date(year, month, day);
1419
+ const jsDate = new DateTime(year, month, day);
1352
1420
  if (jsDate.getMonth() !== month || jsDate.getDate() !== day) {
1353
1421
  // invalid date
1354
1422
  return null;
1355
1423
  }
1356
- const delta = jsDate - INITIAL_1900_DAY;
1424
+ const delta = jsDate.getTime() - INITIAL_1900_DAY.getTime();
1357
1425
  const format = getFormatFromDateParts(parts, separator, leadingZero, fullYear);
1358
1426
  return {
1359
1427
  value: Math.round(delta / MS_PER_DAY),
@@ -1444,7 +1512,7 @@ function parseTime(str) {
1444
1512
  if (hours >= 24) {
1445
1513
  format = "hhhh:mm:ss";
1446
1514
  }
1447
- const jsDate = new Date(1899, 11, 30, hours, minutes, seconds);
1515
+ const jsDate = new DateTime(1899, 11, 30, hours, minutes, seconds);
1448
1516
  return {
1449
1517
  value: hours / 24 + minutes / 1440 + seconds / 86400,
1450
1518
  format: format,
@@ -1458,7 +1526,7 @@ function parseTime(str) {
1458
1526
  // -----------------------------------------------------------------------------
1459
1527
  function numberToJsDate(value) {
1460
1528
  const truncValue = Math.trunc(value);
1461
- let date = new Date(truncValue * MS_PER_DAY - DATE_JS_1900_OFFSET);
1529
+ let date = DateTime.fromTimestamp(truncValue * MS_PER_DAY - DATE_JS_1900_OFFSET);
1462
1530
  let time = value - truncValue;
1463
1531
  time = time < 0 ? 1 + time : time;
1464
1532
  const hours = Math.round(time * 24);
@@ -1478,7 +1546,7 @@ function jsDateToNumber(date) {
1478
1546
  }
1479
1547
  /** Return the number of days in the current month of the given date */
1480
1548
  function getDaysInMonth(date) {
1481
- return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
1549
+ return new DateTime(date.getFullYear(), date.getMonth() + 1, 0).getDate();
1482
1550
  }
1483
1551
  function isLastDayOfMonth(date) {
1484
1552
  return getDaysInMonth(date) === date.getDate();
@@ -1496,7 +1564,7 @@ function addMonthsToDate(date, months, keepEndOfMonth) {
1496
1564
  const yStart = date.getFullYear();
1497
1565
  const mStart = date.getMonth();
1498
1566
  const dStart = date.getDate();
1499
- const jsDate = new Date(yStart, mStart + months);
1567
+ const jsDate = new DateTime(yStart, mStart + months, 1);
1500
1568
  if (keepEndOfMonth && dStart === getDaysInMonth(date)) {
1501
1569
  jsDate.setDate(getDaysInMonth(jsDate));
1502
1570
  }
@@ -1807,12 +1875,8 @@ const invalidateEvaluationCommands = new Set([
1807
1875
  "ADD_MERGE",
1808
1876
  "UPDATE_LOCALE",
1809
1877
  ]);
1810
- const invalidateDependenciesCommands = new Set([
1811
- ...invalidateEvaluationCommands,
1812
- "MOVE_RANGES",
1813
- ]);
1878
+ const invalidateDependenciesCommands = new Set(["MOVE_RANGES"]);
1814
1879
  const invalidateCFEvaluationCommands = new Set([
1815
- ...invalidateEvaluationCommands,
1816
1880
  "DUPLICATE_SHEET",
1817
1881
  "EVALUATE_CELLS",
1818
1882
  "ADD_CONDITIONAL_FORMAT",
@@ -2721,20 +2785,20 @@ function flattenRowFirst(items, callback) {
2721
2785
  }
2722
2786
 
2723
2787
  function toCriterionDateNumber(dateValue) {
2724
- const today = new Date();
2788
+ const today = DateTime.now();
2725
2789
  switch (dateValue) {
2726
2790
  case "today":
2727
2791
  return jsDateToNumber(today);
2728
2792
  case "yesterday":
2729
- return jsDateToNumber(new Date(today.setDate(today.getDate() - 1)));
2793
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() - 1)));
2730
2794
  case "tomorrow":
2731
- return jsDateToNumber(new Date(today.setDate(today.getDate() + 1)));
2795
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() + 1)));
2732
2796
  case "lastWeek":
2733
- return jsDateToNumber(new Date(today.setDate(today.getDate() - 7)));
2797
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() - 7)));
2734
2798
  case "lastMonth":
2735
- return jsDateToNumber(new Date(today.setMonth(today.getMonth() - 1)));
2799
+ return jsDateToNumber(DateTime.fromTimestamp(today.setMonth(today.getMonth() - 1)));
2736
2800
  case "lastYear":
2737
- return jsDateToNumber(new Date(today.setFullYear(today.getFullYear() - 1)));
2801
+ return jsDateToNumber(DateTime.fromTimestamp(today.setFullYear(today.getFullYear() - 1)));
2738
2802
  }
2739
2803
  }
2740
2804
  /** Get all the dates values of a criterion converted to numbers, converting date values such as "today" to actual dates */
@@ -3095,7 +3159,7 @@ function formatJSTime(jsDate, format) {
3095
3159
  .map((p) => {
3096
3160
  switch (p) {
3097
3161
  case "hhhh":
3098
- const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY) / (60 * 60 * 1000));
3162
+ const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY.getTime()) / (60 * 60 * 1000));
3099
3163
  return helapsedHours.toString();
3100
3164
  case "hh":
3101
3165
  return hours.toString().padStart(2, "0");
@@ -4663,6 +4727,9 @@ function transformRangeData(range, executed) {
4663
4727
 
4664
4728
  class ChartJsComponent extends owl.Component {
4665
4729
  static template = "o-spreadsheet-ChartJsComponent";
4730
+ static props = {
4731
+ figure: Object,
4732
+ };
4666
4733
  canvas = owl.useRef("graphContainer");
4667
4734
  chart;
4668
4735
  get background() {
@@ -4715,9 +4782,6 @@ class ChartJsComponent extends owl.Component {
4715
4782
  this.chart.update("active");
4716
4783
  }
4717
4784
  }
4718
- ChartJsComponent.props = {
4719
- figure: Object,
4720
- };
4721
4785
 
4722
4786
  /**
4723
4787
  * AbstractChart is the class from which every Chart should inherit.
@@ -5568,6 +5632,9 @@ class KeyValueElement extends ScorecardScalableElement {
5568
5632
 
5569
5633
  class ScorecardChart extends owl.Component {
5570
5634
  static template = "o-spreadsheet-ScorecardChart";
5635
+ static props = {
5636
+ figure: Object,
5637
+ };
5571
5638
  canvas = owl.useRef("chartContainer");
5572
5639
  get runtime() {
5573
5640
  return this.env.model.getters.getChartRuntime(this.props.figure.id);
@@ -5585,9 +5652,6 @@ class ScorecardChart extends owl.Component {
5585
5652
  drawScoreChart(config, canvas);
5586
5653
  }
5587
5654
  }
5588
- ScorecardChart.props = {
5589
- figure: Object,
5590
- };
5591
5655
 
5592
5656
  /**
5593
5657
  * Registry
@@ -6266,11 +6330,11 @@ css /* scss */ `
6266
6330
  class ErrorToolTip extends owl.Component {
6267
6331
  static maxSize = { maxHeight: ERROR_TOOLTIP_MAX_HEIGHT };
6268
6332
  static template = "o-spreadsheet-ErrorToolTip";
6333
+ static props = {
6334
+ errors: Array,
6335
+ onClosed: { type: Function, optional: true },
6336
+ };
6269
6337
  }
6270
- ErrorToolTip.props = {
6271
- errors: Array,
6272
- onClosed: { type: Function, optional: true },
6273
- };
6274
6338
  const ErrorToolTipPopoverBuilder = {
6275
6339
  onHover: (position, getters) => {
6276
6340
  const cell = getters.getEvaluatedCell(position);
@@ -6312,6 +6376,14 @@ css /*SCSS*/ `
6312
6376
  `;
6313
6377
  class FilterMenuValueItem extends owl.Component {
6314
6378
  static template = "o-spreadsheet-FilterMenuValueItem";
6379
+ static props = {
6380
+ value: String,
6381
+ isChecked: Boolean,
6382
+ isSelected: Boolean,
6383
+ onMouseMove: Function,
6384
+ onClick: Function,
6385
+ scrolledTo: { type: String, optional: true },
6386
+ };
6315
6387
  itemRef = owl.useRef("menuValueItem");
6316
6388
  setup() {
6317
6389
  owl.onWillPatch(() => {
@@ -6329,17 +6401,9 @@ class FilterMenuValueItem extends owl.Component {
6329
6401
  });
6330
6402
  }
6331
6403
  }
6332
- FilterMenuValueItem.props = {
6333
- value: String,
6334
- isChecked: Boolean,
6335
- isSelected: Boolean,
6336
- onMouseMove: Function,
6337
- onClick: Function,
6338
- scrolledTo: { type: String, optional: true },
6339
- };
6340
6404
 
6341
6405
  const FILTER_MENU_HEIGHT = 295;
6342
- const CSS$2 = css /* scss */ `
6406
+ const CSS = css /* scss */ `
6343
6407
  .o-filter-menu {
6344
6408
  box-sizing: border-box;
6345
6409
  padding: 8px 16px;
@@ -6435,9 +6499,12 @@ const CSS$2 = css /* scss */ `
6435
6499
  }
6436
6500
  `;
6437
6501
  class FilterMenu extends owl.Component {
6438
- static size = { width: MENU_WIDTH, height: FILTER_MENU_HEIGHT };
6439
6502
  static template = "o-spreadsheet-FilterMenu";
6440
- static style = CSS$2;
6503
+ static props = {
6504
+ filterPosition: Object,
6505
+ onClosed: { type: Function, optional: true },
6506
+ };
6507
+ static style = CSS;
6441
6508
  static components = { FilterMenuValueItem };
6442
6509
  state = owl.useState({
6443
6510
  values: [],
@@ -6589,10 +6656,6 @@ class FilterMenu extends owl.Component {
6589
6656
  this.props.onClosed?.();
6590
6657
  }
6591
6658
  }
6592
- FilterMenu.props = {
6593
- filterPosition: Object,
6594
- onClosed: { type: Function, optional: true },
6595
- };
6596
6659
  const FilterMenuPopoverBuilder = {
6597
6660
  onOpen: (position, getters) => {
6598
6661
  return {
@@ -6794,6 +6857,19 @@ css /* scss */ `
6794
6857
  `;
6795
6858
  class Popover extends owl.Component {
6796
6859
  static template = "o-spreadsheet-Popover";
6860
+ static props = {
6861
+ anchorRect: Object,
6862
+ containerRect: { type: Object, optional: true },
6863
+ positioning: { type: String, optional: true },
6864
+ maxWidth: { type: Number, optional: true },
6865
+ maxHeight: { type: Number, optional: true },
6866
+ verticalOffset: { type: Number, optional: true },
6867
+ onMouseWheel: { type: Function, optional: true },
6868
+ onPopoverHidden: { type: Function, optional: true },
6869
+ onPopoverMoved: { type: Function, optional: true },
6870
+ zIndex: { type: Number, optional: true },
6871
+ slots: Object,
6872
+ };
6797
6873
  static defaultProps = {
6798
6874
  positioning: "BottomLeft",
6799
6875
  verticalOffset: 0,
@@ -6850,19 +6926,6 @@ class Popover extends owl.Component {
6850
6926
  });
6851
6927
  }
6852
6928
  }
6853
- Popover.props = {
6854
- anchorRect: Object,
6855
- containerRect: { type: Object, optional: true },
6856
- positioning: { type: String, optional: true },
6857
- maxWidth: { type: Number, optional: true },
6858
- maxHeight: { type: Number, optional: true },
6859
- verticalOffset: { type: Number, optional: true },
6860
- onMouseWheel: { type: Function, optional: true },
6861
- onPopoverHidden: { type: Function, optional: true },
6862
- onPopoverMoved: { type: Function, optional: true },
6863
- zIndex: { type: Number, optional: true },
6864
- slots: Object,
6865
- };
6866
6929
  class PopoverPositionContext {
6867
6930
  anchorRect;
6868
6931
  containerRect;
@@ -7044,6 +7107,15 @@ css /* scss */ `
7044
7107
  `;
7045
7108
  class Menu extends owl.Component {
7046
7109
  static template = "o-spreadsheet-Menu";
7110
+ static props = {
7111
+ position: Object,
7112
+ menuItems: Array,
7113
+ depth: { type: Number, optional: true },
7114
+ maxHeight: { type: Number, optional: true },
7115
+ onClose: Function,
7116
+ onMenuClicked: { type: Function, optional: true },
7117
+ menuId: { type: String, optional: true },
7118
+ };
7047
7119
  static components = { Menu, Popover };
7048
7120
  static defaultProps = {
7049
7121
  depth: 1,
@@ -7200,15 +7272,6 @@ class Menu extends owl.Component {
7200
7272
  }
7201
7273
  }
7202
7274
  }
7203
- Menu.props = {
7204
- position: Object,
7205
- menuItems: Array,
7206
- depth: { type: Number, optional: true },
7207
- maxHeight: { type: Number, optional: true },
7208
- onClose: Function,
7209
- onMenuClicked: { type: Function, optional: true },
7210
- menuId: { type: String, optional: true },
7211
- };
7212
7275
 
7213
7276
  const LINK_TOOLTIP_HEIGHT = 32;
7214
7277
  const LINK_TOOLTIP_WIDTH = 220;
@@ -7261,8 +7324,12 @@ css /* scss */ `
7261
7324
  }
7262
7325
  `;
7263
7326
  class LinkDisplay extends owl.Component {
7264
- static components = { Menu };
7265
7327
  static template = "o-spreadsheet-LinkDisplay";
7328
+ static props = {
7329
+ cellPosition: Object,
7330
+ onClosed: { type: Function, optional: true },
7331
+ };
7332
+ static components = { Menu };
7266
7333
  get cell() {
7267
7334
  const { col, row } = this.props.cellPosition;
7268
7335
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -7317,10 +7384,6 @@ const LinkCellPopoverBuilder = {
7317
7384
  };
7318
7385
  },
7319
7386
  };
7320
- LinkDisplay.props = {
7321
- cellPosition: Object,
7322
- onClosed: { type: Function, optional: true },
7323
- };
7324
7387
 
7325
7388
  /**
7326
7389
  * Tokenizer
@@ -7954,6 +8017,10 @@ css /* scss */ `
7954
8017
  `;
7955
8018
  class LinkEditor extends owl.Component {
7956
8019
  static template = "o-spreadsheet-LinkEditor";
8020
+ static props = {
8021
+ cellPosition: Object,
8022
+ onClosed: { type: Function, optional: true },
8023
+ };
7957
8024
  static components = { Menu };
7958
8025
  menuItems = linkMenuRegistry.getMenuItems();
7959
8026
  link = owl.useState(this.defaultState);
@@ -8051,10 +8118,6 @@ const LinkEditorPopoverBuilder = {
8051
8118
  };
8052
8119
  },
8053
8120
  };
8054
- LinkEditor.props = {
8055
- cellPosition: Object,
8056
- onClosed: { type: Function, optional: true },
8057
- };
8058
8121
 
8059
8122
  const cellPopoverRegistry = new Registry();
8060
8123
  cellPopoverRegistry
@@ -8337,6 +8400,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale })
8337
8400
  labels: labels.map(truncateLabel),
8338
8401
  datasets: [],
8339
8402
  },
8403
+ platform: undefined,
8340
8404
  plugins: [],
8341
8405
  };
8342
8406
  }
@@ -9641,6 +9705,10 @@ css /* scss */ `
9641
9705
  `;
9642
9706
  class ChartFigure extends owl.Component {
9643
9707
  static template = "o-spreadsheet-ChartFigure";
9708
+ static props = {
9709
+ figure: Object,
9710
+ onFigureDeleted: Function,
9711
+ };
9644
9712
  static components = {};
9645
9713
  onDoubleClick() {
9646
9714
  this.env.model.dispatch("SELECT_FIGURE", { id: this.props.figure.id });
@@ -9658,13 +9726,13 @@ class ChartFigure extends owl.Component {
9658
9726
  return component;
9659
9727
  }
9660
9728
  }
9661
- ChartFigure.props = {
9662
- figure: Object,
9663
- onFigureDeleted: Function,
9664
- };
9665
9729
 
9666
9730
  class ImageFigure extends owl.Component {
9667
9731
  static template = "o-spreadsheet-ImageFigure";
9732
+ static props = {
9733
+ figure: Object,
9734
+ onFigureDeleted: Function,
9735
+ };
9668
9736
  static components = {};
9669
9737
  // ---------------------------------------------------------------------------
9670
9738
  // Getters
@@ -9676,10 +9744,6 @@ class ImageFigure extends owl.Component {
9676
9744
  return this.env.model.getters.getImagePath(this.figureId);
9677
9745
  }
9678
9746
  }
9679
- ImageFigure.props = {
9680
- figure: Object,
9681
- onFigureDeleted: Function,
9682
- };
9683
9747
 
9684
9748
  function centerFigurePosition(getters, size) {
9685
9749
  const { x: offsetCorrectionX, y: offsetCorrectionY } = getters.getMainViewportCoordinates();
@@ -10967,6 +11031,9 @@ function arg(definition, description = "") {
10967
11031
  function makeArg(str, description) {
10968
11032
  let parts = str.match(ARG_REGEXP);
10969
11033
  let name = parts[1].trim();
11034
+ if (!name) {
11035
+ throw new Error(`Function argument definition is missing a name: '${str}'.`);
11036
+ }
10970
11037
  let types = [];
10971
11038
  let isOptional = false;
10972
11039
  let isRepeating = false;
@@ -14689,7 +14756,7 @@ const DATE = {
14689
14756
  if (_year < 1900) {
14690
14757
  _year += 1900;
14691
14758
  }
14692
- const jsDate = new Date(_year, _month - 1, _day);
14759
+ const jsDate = new DateTime(_year, _month - 1, _day);
14693
14760
  const result = jsDateToRoundNumber(jsDate);
14694
14761
  assert(() => result >= 0, _t("The function [[FUNCTION_NAME]] result must be greater than or equal 01/01/1900."));
14695
14762
  return result;
@@ -14732,7 +14799,7 @@ const DATEDIF = {
14732
14799
  // See: https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c
14733
14800
  let days = jsEndDate.getDate() - jsStartDate.getDate();
14734
14801
  if (days < 0) {
14735
- const monthBeforeEndMonth = new Date(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
14802
+ const monthBeforeEndMonth = new DateTime(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
14736
14803
  const daysInMonthBeforeEndMonth = getDaysInMonth(monthBeforeEndMonth);
14737
14804
  days = daysInMonthBeforeEndMonth - Math.abs(days);
14738
14805
  }
@@ -14741,7 +14808,7 @@ const DATEDIF = {
14741
14808
  if (areTwoDatesWithinOneYear(_startDate, _endDate)) {
14742
14809
  return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
14743
14810
  }
14744
- const endDateWithinOneYear = new Date(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
14811
+ const endDateWithinOneYear = new DateTime(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
14745
14812
  let days = getTimeDifferenceInWholeDays(jsStartDate, endDateWithinOneYear);
14746
14813
  if (days < 0) {
14747
14814
  endDateWithinOneYear.setFullYear(jsStartDate.getFullYear() + 1);
@@ -14858,7 +14925,7 @@ const EOMONTH = {
14858
14925
  const _months = Math.trunc(toNumber(months, this.locale));
14859
14926
  const yStart = _startDate.getFullYear();
14860
14927
  const mStart = _startDate.getMonth();
14861
- const jsDate = new Date(yStart, mStart + _months + 1, 0);
14928
+ const jsDate = new DateTime(yStart, mStart + _months + 1, 0);
14862
14929
  return jsDateToRoundNumber(jsDate);
14863
14930
  },
14864
14931
  isExported: true,
@@ -14895,17 +14962,17 @@ const ISOWEEKNUM = {
14895
14962
  // The first week of the year is the week that contains the first
14896
14963
  // Thursday of the year.
14897
14964
  let firstThursday = 1;
14898
- while (new Date(y, 0, firstThursday).getDay() !== 4) {
14965
+ while (new DateTime(y, 0, firstThursday).getDay() !== 4) {
14899
14966
  firstThursday += 1;
14900
14967
  }
14901
- const firstDayOfFirstWeek = new Date(y, 0, firstThursday - 3);
14968
+ const firstDayOfFirstWeek = new DateTime(y, 0, firstThursday - 3);
14902
14969
  // The last week of the year is the week that contains the last Thursday of
14903
14970
  // the year.
14904
14971
  let lastThursday = 31;
14905
- while (new Date(y, 11, lastThursday).getDay() !== 4) {
14972
+ while (new DateTime(y, 11, lastThursday).getDay() !== 4) {
14906
14973
  lastThursday -= 1;
14907
14974
  }
14908
- const lastDayOfLastWeek = new Date(y, 11, lastThursday + 3);
14975
+ const lastDayOfLastWeek = new DateTime(y, 11, lastThursday + 3);
14909
14976
  // B - If our date > lastDayOfLastWeek then it's in the weeks of the year after
14910
14977
  // If our date < firstDayOfFirstWeek then it's in the weeks of the year before
14911
14978
  let offsetYear;
@@ -14931,17 +14998,17 @@ const ISOWEEKNUM = {
14931
14998
  case 1:
14932
14999
  // firstDay is the 1st day of the 1st week of the year after
14933
15000
  // firstDay = lastDayOfLastWeek + 1 Day
14934
- firstDay = new Date(y, 11, lastThursday + 3 + 1);
15001
+ firstDay = new DateTime(y, 11, lastThursday + 3 + 1);
14935
15002
  break;
14936
15003
  case -1:
14937
15004
  // firstDay is the 1st day of the 1st week of the previous year.
14938
15005
  // The first week of the previous year is the week that contains the
14939
15006
  // first Thursday of the previous year.
14940
15007
  let firstThursdayPreviousYear = 1;
14941
- while (new Date(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
15008
+ while (new DateTime(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
14942
15009
  firstThursdayPreviousYear += 1;
14943
15010
  }
14944
- firstDay = new Date(y - 1, 0, firstThursdayPreviousYear - 3);
15011
+ firstDay = new DateTime(y - 1, 0, firstThursdayPreviousYear - 3);
14945
15012
  break;
14946
15013
  }
14947
15014
  const diff = (_date.getTime() - firstDay.getTime()) / MS_PER_DAY;
@@ -15076,8 +15143,8 @@ const NETWORKDAYS_INTL = {
15076
15143
  });
15077
15144
  }
15078
15145
  const invertDate = _startDate.getTime() > _endDate.getTime();
15079
- const stopDate = new Date((invertDate ? _startDate : _endDate).getTime());
15080
- let stepDate = new Date((invertDate ? _endDate : _startDate).getTime());
15146
+ const stopDate = DateTime.fromTimestamp((invertDate ? _startDate : _endDate).getTime());
15147
+ let stepDate = DateTime.fromTimestamp((invertDate ? _endDate : _startDate).getTime());
15081
15148
  const timeStopDate = stopDate.getTime();
15082
15149
  let timeStepDate = stepDate.getTime();
15083
15150
  let netWorkingDay = 0;
@@ -15103,8 +15170,7 @@ const NOW = {
15103
15170
  return getDateTimeFormat(this.locale);
15104
15171
  },
15105
15172
  compute: function () {
15106
- let today = new Date();
15107
- today.setMilliseconds(0);
15173
+ let today = DateTime.now();
15108
15174
  const delta = today.getTime() - INITIAL_1900_DAY.getTime();
15109
15175
  const time = today.getHours() / 24 + today.getMinutes() / 1440 + today.getSeconds() / 86400;
15110
15176
  return Math.floor(delta / MS_PER_DAY) + time;
@@ -15178,8 +15244,8 @@ const TODAY = {
15178
15244
  return this.locale.dateFormat;
15179
15245
  },
15180
15246
  compute: function () {
15181
- const today = new Date();
15182
- const jsDate = new Date(today.getFullYear(), today.getMonth(), today.getDate());
15247
+ const today = DateTime.now();
15248
+ const jsDate = new DateTime(today.getFullYear(), today.getMonth(), today.getDate());
15183
15249
  return jsDateToRoundNumber(jsDate);
15184
15250
  },
15185
15251
  isExported: true,
@@ -15234,10 +15300,10 @@ const WEEKNUM = {
15234
15300
  }
15235
15301
  const y = _date.getFullYear();
15236
15302
  let dayStart = 1;
15237
- let startDayOfFirstWeek = new Date(y, 0, dayStart);
15303
+ let startDayOfFirstWeek = new DateTime(y, 0, dayStart);
15238
15304
  while (startDayOfFirstWeek.getDay() !== startDayOfWeek) {
15239
15305
  dayStart += 1;
15240
- startDayOfFirstWeek = new Date(y, 0, dayStart);
15306
+ startDayOfFirstWeek = new DateTime(y, 0, dayStart);
15241
15307
  }
15242
15308
  const dif = (_date.getTime() - startDayOfFirstWeek.getTime()) / MS_PER_DAY;
15243
15309
  if (dif < 0) {
@@ -15295,7 +15361,7 @@ const WORKDAY_INTL = {
15295
15361
  timesHoliday.add(holiday.getTime());
15296
15362
  });
15297
15363
  }
15298
- let stepDate = new Date(_startDate.getTime());
15364
+ let stepDate = DateTime.fromTimestamp(_startDate.getTime());
15299
15365
  let timeStepDate = stepDate.getTime();
15300
15366
  const unitDay = Math.sign(_numDays);
15301
15367
  let stepDay = Math.abs(_numDays);
@@ -15359,7 +15425,7 @@ const MONTH_START = {
15359
15425
  const _startDate = toJsDate(date, this.locale);
15360
15426
  const yStart = _startDate.getFullYear();
15361
15427
  const mStart = _startDate.getMonth();
15362
- const jsDate = new Date(yStart, mStart, 1);
15428
+ const jsDate = new DateTime(yStart, mStart, 1);
15363
15429
  return jsDateToRoundNumber(jsDate);
15364
15430
  },
15365
15431
  };
@@ -15401,7 +15467,7 @@ const QUARTER_START = {
15401
15467
  compute: function (date) {
15402
15468
  const quarter = QUARTER.compute.bind(this)(date);
15403
15469
  const year = YEAR.compute.bind(this)(date);
15404
- const jsDate = new Date(year, (quarter - 1) * 3, 1);
15470
+ const jsDate = new DateTime(year, (quarter - 1) * 3, 1);
15405
15471
  return jsDateToRoundNumber(jsDate);
15406
15472
  },
15407
15473
  };
@@ -15418,7 +15484,7 @@ const QUARTER_END = {
15418
15484
  compute: function (date) {
15419
15485
  const quarter = QUARTER.compute.bind(this)(date);
15420
15486
  const year = YEAR.compute.bind(this)(date);
15421
- const jsDate = new Date(year, quarter * 3, 0);
15487
+ const jsDate = new DateTime(year, quarter * 3, 0);
15422
15488
  return jsDateToRoundNumber(jsDate);
15423
15489
  },
15424
15490
  };
@@ -15434,7 +15500,7 @@ const YEAR_START = {
15434
15500
  },
15435
15501
  compute: function (date) {
15436
15502
  const year = YEAR.compute.bind(this)(date);
15437
- const jsDate = new Date(year, 0, 1);
15503
+ const jsDate = new DateTime(year, 0, 1);
15438
15504
  return jsDateToRoundNumber(jsDate);
15439
15505
  },
15440
15506
  };
@@ -15450,7 +15516,7 @@ const YEAR_END = {
15450
15516
  },
15451
15517
  compute: function (date) {
15452
15518
  const year = YEAR.compute.bind(this)(date);
15453
- const jsDate = new Date(year + 1, 0, 0);
15519
+ const jsDate = new DateTime(year + 1, 0, 0);
15454
15520
  return jsDateToRoundNumber(jsDate);
15455
15521
  },
15456
15522
  };
@@ -15498,8 +15564,8 @@ const DEFAULT_DELTA_ARG = 0;
15498
15564
  const DELTA = {
15499
15565
  description: _t("Compare two numeric values, returning 1 if they're equal."),
15500
15566
  args: [
15501
- arg(" (number)", _t("The first number to compare.")),
15502
- arg(` (number, default=${DEFAULT_DELTA_ARG})`, _t("The second number to compare.")),
15567
+ arg("number1 (number)", _t("The first number to compare.")),
15568
+ arg(`number2 (number, default=${DEFAULT_DELTA_ARG})`, _t("The second number to compare.")),
15503
15569
  ],
15504
15570
  returns: ["NUMBER"],
15505
15571
  compute: function (number1, number2 = DEFAULT_DELTA_ARG) {
@@ -15926,7 +15992,7 @@ function assertDeprecationFactorStrictlyPositive(factor) {
15926
15992
  function assertSettlementLessThanOneYearBeforeMaturity(settlement, maturity, locale) {
15927
15993
  const startDate = toJsDate(settlement, locale);
15928
15994
  const endDate = toJsDate(maturity, locale);
15929
- const startDatePlusOneYear = new Date(startDate);
15995
+ const startDatePlusOneYear = toJsDate(settlement, locale);
15930
15996
  startDatePlusOneYear.setFullYear(startDate.getFullYear() + 1);
15931
15997
  assert(() => endDate.getTime() <= startDatePlusOneYear.getTime(), _t("The settlement date (%s) must at most one year after the maturity date (%s).", settlement.toString(), maturity.toString()));
15932
15998
  }
@@ -16061,7 +16127,7 @@ const AMORLINC = {
16061
16127
  arg("salvage (number)", _t("The value of the asset at the end of depreciation.")),
16062
16128
  arg("period (number)", _t("The single period within life for which to calculate depreciation.")),
16063
16129
  arg("rate (number)", _t("The deprecation rate.")),
16064
- arg(" (number, optional)", _t("An indicator of what day count method to use.")),
16130
+ arg("day_count_convention (number, optional)", _t("An indicator of what day count method to use.")),
16065
16131
  ],
16066
16132
  returns: ["NUMBER"],
16067
16133
  compute: function (cost, purchaseDate, firstPeriodEnd, salvage, period, rate, dayCountConvention = DEFAULT_DAY_COUNT_CONVENTION) {
@@ -19233,8 +19299,8 @@ const MID = {
19233
19299
  description: _t("A segment of a string."),
19234
19300
  args: [
19235
19301
  arg("text (string)", _t("The string to extract a segment from.")),
19236
- arg(" (number)", _t("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),
19237
- arg(" (number)", _t("The length of the segment to extract.")),
19302
+ arg("starting_at (number)", _t("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),
19303
+ arg("extract_length (number)", _t("The length of the segment to extract.")),
19238
19304
  ],
19239
19305
  returns: ["STRING"],
19240
19306
  compute: function (text, starting_at, extract_length) {
@@ -21517,6 +21583,15 @@ css /* scss */ `
21517
21583
  */
21518
21584
  class SelectionInput extends owl.Component {
21519
21585
  static template = "o-spreadsheet-SelectionInput";
21586
+ static props = {
21587
+ ranges: Function,
21588
+ hasSingleRange: { type: Boolean, optional: true },
21589
+ required: { type: Boolean, optional: true },
21590
+ isInvalid: { type: Boolean, optional: true },
21591
+ class: { type: String, optional: true },
21592
+ onSelectionChanged: { type: Function, optional: true },
21593
+ onSelectionConfirmed: { type: Function, optional: true },
21594
+ };
21520
21595
  id = uuidGenerator$1.uuidv4();
21521
21596
  previousRanges = this.props.ranges() || [];
21522
21597
  originSheet = this.env.model.getters.getActiveSheetId();
@@ -21679,15 +21754,6 @@ class SelectionInput extends owl.Component {
21679
21754
  this.env.model.dispatch("UNFOCUS_SELECTION_INPUT");
21680
21755
  }
21681
21756
  }
21682
- SelectionInput.props = {
21683
- ranges: Function,
21684
- hasSingleRange: { type: Boolean, optional: true },
21685
- required: { type: Boolean, optional: true },
21686
- isInvalid: { type: Boolean, optional: true },
21687
- class: { type: String, optional: true },
21688
- onSelectionChanged: { type: Function, optional: true },
21689
- onSelectionConfirmed: { type: Function, optional: true },
21690
- };
21691
21757
 
21692
21758
  css /* scss */ `
21693
21759
  .o-validation-error,
@@ -21703,6 +21769,10 @@ css /* scss */ `
21703
21769
  `;
21704
21770
  class ValidationMessages extends owl.Component {
21705
21771
  static template = "o-spreadsheet-ValidationMessages";
21772
+ static props = {
21773
+ messages: Array,
21774
+ msgType: String,
21775
+ };
21706
21776
  get divClasses() {
21707
21777
  if (this.props.msgType === "warning") {
21708
21778
  return "o-validation-warning text-warning";
@@ -21710,14 +21780,96 @@ class ValidationMessages extends owl.Component {
21710
21780
  return "o-validation-error text-danger";
21711
21781
  }
21712
21782
  }
21713
- ValidationMessages.props = {
21714
- messages: Array,
21715
- msgType: String,
21716
- };
21783
+
21784
+ css /* scss */ `
21785
+ .o-checkbox {
21786
+ display: flex;
21787
+ justify-items: center;
21788
+ input {
21789
+ margin-right: 5px;
21790
+ }
21791
+ }
21792
+ `;
21793
+ class Checkbox extends owl.Component {
21794
+ static template = "o-spreadsheet.Checkbox";
21795
+ static props = {
21796
+ label: { type: String, optional: true },
21797
+ value: { type: Boolean, optional: true },
21798
+ className: { type: String, optional: true },
21799
+ name: { type: String, optional: true },
21800
+ onChange: Function,
21801
+ };
21802
+ static defaultProps = { value: false };
21803
+ onChange(ev) {
21804
+ const value = ev.target.checked;
21805
+ this.props.onChange(value);
21806
+ }
21807
+ }
21808
+
21809
+ class Section extends owl.Component {
21810
+ static template = "o_spreadsheet.Section";
21811
+ static props = {
21812
+ class: { type: String, optional: true },
21813
+ slots: Object,
21814
+ };
21815
+ }
21816
+
21817
+ class ChartDataSeries extends owl.Component {
21818
+ static template = "o-spreadsheet.ChartDataSeries";
21819
+ static components = { SelectionInput, Section };
21820
+ static props = {
21821
+ ranges: Function,
21822
+ hasSingleRange: { type: Boolean, optional: true },
21823
+ onSelectionChanged: Function,
21824
+ onSelectionConfirmed: Function,
21825
+ };
21826
+ get title() {
21827
+ return this.props.hasSingleRange ? _t("Data range") : _t("Data series");
21828
+ }
21829
+ }
21830
+
21831
+ class ChartErrorSection extends owl.Component {
21832
+ static template = "o-spreadsheet.ChartErrorSection";
21833
+ static components = { Section, ValidationMessages };
21834
+ static props = { messages: { type: Array, element: String } };
21835
+ }
21836
+
21837
+ class ChartLabelRange extends owl.Component {
21838
+ static template = "o-spreadsheet.ChartLabelRange";
21839
+ static components = { SelectionInput, Checkbox, Section };
21840
+ static props = {
21841
+ title: { type: String, optional: true },
21842
+ range: Function,
21843
+ isInvalid: Boolean,
21844
+ required: { type: Boolean, optional: true },
21845
+ onSelectionChanged: Function,
21846
+ onSelectionConfirmed: Function,
21847
+ options: { type: Array, optional: true },
21848
+ };
21849
+ static defaultProps = {
21850
+ title: _t("Categories / Labels"),
21851
+ options: [],
21852
+ required: false,
21853
+ };
21854
+ }
21717
21855
 
21718
21856
  class LineBarPieConfigPanel extends owl.Component {
21719
21857
  static template = "o-spreadsheet-LineBarPieConfigPanel";
21720
- static components = { SelectionInput, ValidationMessages };
21858
+ static components = {
21859
+ SelectionInput,
21860
+ ValidationMessages,
21861
+ ChartDataSeries,
21862
+ ChartLabelRange,
21863
+ Section,
21864
+ Checkbox,
21865
+ ChartErrorSection,
21866
+ };
21867
+ static props = {
21868
+ figureId: String,
21869
+ definition: Object,
21870
+ updateChart: Function,
21871
+ canUpdateChart: Function,
21872
+ };
21721
21873
  state = owl.useState({
21722
21874
  datasetDispatchResult: undefined,
21723
21875
  labelsDispatchResult: undefined,
@@ -21741,9 +21893,22 @@ class LineBarPieConfigPanel extends owl.Component {
21741
21893
  get isLabelInvalid() {
21742
21894
  return !!this.state.labelsDispatchResult?.isCancelledBecause("InvalidLabelRange" /* CommandResult.InvalidLabelRange */);
21743
21895
  }
21744
- onUpdateDataSetsHaveTitle(ev) {
21896
+ get dataSetsHaveTitleLabel() {
21897
+ return _t("Use row %s as headers", this.calculateHeaderPosition() || "");
21898
+ }
21899
+ getLabelRangeOptions() {
21900
+ return [
21901
+ {
21902
+ name: "aggregated",
21903
+ label: _t("Aggregate"),
21904
+ value: this.props.definition.aggregated,
21905
+ onChange: this.onUpdateAggregated.bind(this),
21906
+ },
21907
+ ];
21908
+ }
21909
+ onUpdateDataSetsHaveTitle(dataSetsHaveTitle) {
21745
21910
  this.props.updateChart(this.props.figureId, {
21746
- dataSetsHaveTitle: ev.target.checked,
21911
+ dataSetsHaveTitle,
21747
21912
  });
21748
21913
  }
21749
21914
  /**
@@ -21783,9 +21948,9 @@ class LineBarPieConfigPanel extends owl.Component {
21783
21948
  getLabelRange() {
21784
21949
  return this.labelRange || "";
21785
21950
  }
21786
- onUpdateAggregated(ev) {
21951
+ onUpdateAggregated(aggregated) {
21787
21952
  this.props.updateChart(this.props.figureId, {
21788
- aggregated: ev.target.checked,
21953
+ aggregated,
21789
21954
  });
21790
21955
  }
21791
21956
  calculateHeaderPosition() {
@@ -21805,23 +21970,20 @@ class LineBarPieConfigPanel extends owl.Component {
21805
21970
  return undefined;
21806
21971
  }
21807
21972
  }
21808
- LineBarPieConfigPanel.props = {
21809
- figureId: String,
21810
- definition: Object,
21811
- updateChart: Function,
21812
- canUpdateChart: Function,
21813
- };
21814
21973
 
21815
21974
  class BarConfigPanel extends LineBarPieConfigPanel {
21816
21975
  static template = "o-spreadsheet-BarConfigPanel";
21817
- onUpdateStacked(ev) {
21976
+ get stackedLabel() {
21977
+ return _t("Stacked barchart");
21978
+ }
21979
+ onUpdateStacked(stacked) {
21818
21980
  this.props.updateChart(this.props.figureId, {
21819
- stacked: ev.target.checked,
21981
+ stacked,
21820
21982
  });
21821
21983
  }
21822
- onUpdateAggregated(ev) {
21984
+ onUpdateAggregated(aggregated) {
21823
21985
  this.props.updateChart(this.props.figureId, {
21824
- aggregated: ev.target.checked,
21986
+ aggregated,
21825
21987
  });
21826
21988
  }
21827
21989
  }
@@ -22149,6 +22311,12 @@ css /* scss */ `
22149
22311
  `;
22150
22312
  class ColorPicker extends owl.Component {
22151
22313
  static template = "o-spreadsheet-ColorPicker";
22314
+ static props = {
22315
+ onColorPicked: Function,
22316
+ currentColor: { type: String, optional: true },
22317
+ maxHeight: { type: Number, optional: true },
22318
+ anchorRect: Object,
22319
+ };
22152
22320
  static defaultProps = { currentColor: "" };
22153
22321
  static components = { Popover };
22154
22322
  COLORS = COLOR_PICKER_DEFAULTS;
@@ -22284,12 +22452,6 @@ class ColorPicker extends owl.Component {
22284
22452
  return isSameColor(color1, color2);
22285
22453
  }
22286
22454
  }
22287
- ColorPicker.props = {
22288
- onColorPicked: Function,
22289
- currentColor: { type: String, optional: true },
22290
- maxHeight: { type: Number, optional: true },
22291
- anchorRect: Object,
22292
- };
22293
22455
 
22294
22456
  css /* scss */ `
22295
22457
  .o-color-picker-widget {
@@ -22327,6 +22489,17 @@ css /* scss */ `
22327
22489
  `;
22328
22490
  class ColorPickerWidget extends owl.Component {
22329
22491
  static template = "o-spreadsheet-ColorPickerWidget";
22492
+ static props = {
22493
+ currentColor: { type: String, optional: true },
22494
+ toggleColorPicker: Function,
22495
+ showColorPicker: Boolean,
22496
+ onColorPicked: Function,
22497
+ icon: String,
22498
+ title: { type: String, optional: true },
22499
+ disabled: { type: Boolean, optional: true },
22500
+ dropdownMaxHeight: { type: Number, optional: true },
22501
+ class: { type: String, optional: true },
22502
+ };
22330
22503
  static components = { ColorPicker };
22331
22504
  colorPickerButtonRef = owl.useRef("colorPickerButton");
22332
22505
  get iconStyle() {
@@ -22345,44 +22518,55 @@ class ColorPickerWidget extends owl.Component {
22345
22518
  };
22346
22519
  }
22347
22520
  }
22348
- ColorPickerWidget.props = {
22349
- currentColor: { type: String, optional: true },
22350
- toggleColorPicker: Function,
22351
- showColorPicker: Boolean,
22352
- onColorPicked: Function,
22353
- icon: String,
22354
- title: { type: String, optional: true },
22355
- disabled: { type: Boolean, optional: true },
22356
- dropdownMaxHeight: { type: Number, optional: true },
22357
- class: { type: String, optional: true },
22358
- };
22359
22521
 
22360
- class LineBarPieDesignPanel extends owl.Component {
22361
- static template = "o-spreadsheet-LineBarPieDesignPanel";
22362
- static components = { ColorPickerWidget };
22363
- state = owl.useState({
22364
- title: "",
22365
- fillColorTool: false,
22366
- });
22367
- onClick(ev) {
22368
- this.state.fillColorTool = false;
22369
- }
22522
+ class ChartColor extends owl.Component {
22523
+ static template = "o-spreadsheet.ChartColor";
22524
+ static components = { ColorPickerWidget, Section };
22525
+ static props = {
22526
+ currentColor: { type: String, optional: true },
22527
+ onColorPicked: Function,
22528
+ };
22529
+ state;
22370
22530
  setup() {
22371
- this.state.title = _t(this.props.definition.title);
22372
- owl.useExternalListener(window, "click", this.onClick);
22531
+ this.state = owl.useState({ pickerOpened: false });
22532
+ owl.useExternalListener(window, "click", this.closePicker);
22373
22533
  }
22374
- toggleColorPicker() {
22375
- this.state.fillColorTool = !this.state.fillColorTool;
22534
+ closePicker() {
22535
+ this.state.pickerOpened = false;
22536
+ }
22537
+ togglePicker() {
22538
+ this.state.pickerOpened = !this.state.pickerOpened;
22539
+ }
22540
+ }
22541
+
22542
+ class ChartTitle extends owl.Component {
22543
+ static template = "o-spreadsheet.ChartTitle";
22544
+ static components = { ColorPickerWidget, Section };
22545
+ static props = { title: String, update: Function };
22546
+ updateTitle(ev) {
22547
+ this.props.update(ev.target.value);
22548
+ }
22549
+ }
22550
+
22551
+ class LineBarPieDesignPanel extends owl.Component {
22552
+ static template = "o-spreadsheet-LineBarPieDesignPanel";
22553
+ static components = { ChartColor, ColorPickerWidget, ChartTitle, Section };
22554
+ static props = {
22555
+ figureId: String,
22556
+ definition: Object,
22557
+ updateChart: Function,
22558
+ canUpdateChart: Function,
22559
+ };
22560
+ get title() {
22561
+ return _t(this.props.definition.title);
22376
22562
  }
22377
22563
  updateBackgroundColor(color) {
22378
22564
  this.props.updateChart(this.props.figureId, {
22379
22565
  background: color,
22380
22566
  });
22381
22567
  }
22382
- updateTitle() {
22383
- this.props.updateChart(this.props.figureId, {
22384
- title: this.state.title,
22385
- });
22568
+ updateTitle(title) {
22569
+ this.props.updateChart(this.props.figureId, { title });
22386
22570
  }
22387
22571
  updateSelect(attr, ev) {
22388
22572
  this.props.updateChart(this.props.figureId, {
@@ -22390,12 +22574,6 @@ class LineBarPieDesignPanel extends owl.Component {
22390
22574
  });
22391
22575
  }
22392
22576
  }
22393
- LineBarPieDesignPanel.props = {
22394
- figureId: String,
22395
- definition: Object,
22396
- updateChart: Function,
22397
- canUpdateChart: Function,
22398
- };
22399
22577
 
22400
22578
  class BarChartDesignPanel extends LineBarPieDesignPanel {
22401
22579
  static template = "o-spreadsheet-BarChartDesignPanel";
@@ -22403,7 +22581,13 @@ class BarChartDesignPanel extends LineBarPieDesignPanel {
22403
22581
 
22404
22582
  class GaugeChartConfigPanel extends owl.Component {
22405
22583
  static template = "o-spreadsheet-GaugeChartConfigPanel";
22406
- static components = { SelectionInput, ValidationMessages };
22584
+ static components = { SelectionInput, ChartErrorSection, ChartDataSeries };
22585
+ static props = {
22586
+ figureId: String,
22587
+ definition: Object,
22588
+ updateChart: Function,
22589
+ canUpdateChart: Function,
22590
+ };
22407
22591
  state = owl.useState({
22408
22592
  dataRangeDispatchResult: undefined,
22409
22593
  });
@@ -22430,12 +22614,6 @@ class GaugeChartConfigPanel extends owl.Component {
22430
22614
  return this.dataRange || "";
22431
22615
  }
22432
22616
  }
22433
- GaugeChartConfigPanel.props = {
22434
- figureId: String,
22435
- definition: Object,
22436
- updateChart: Function,
22437
- canUpdateChart: Function,
22438
- };
22439
22617
 
22440
22618
  css /* scss */ `
22441
22619
  .o-gauge-color-set {
@@ -22470,31 +22648,35 @@ css /* scss */ `
22470
22648
  `;
22471
22649
  class GaugeChartDesignPanel extends owl.Component {
22472
22650
  static template = "o-spreadsheet-GaugeChartDesignPanel";
22473
- static components = { ColorPickerWidget, ValidationMessages };
22651
+ static components = { ColorPickerWidget, ChartErrorSection, ChartColor, ChartTitle, Section };
22652
+ static props = {
22653
+ figureId: String,
22654
+ definition: Object,
22655
+ updateChart: Function,
22656
+ canUpdateChart: Function,
22657
+ };
22474
22658
  state = owl.useState({
22475
- title: "",
22476
22659
  openedMenu: undefined,
22477
22660
  sectionRuleDispatchResult: undefined,
22478
22661
  sectionRule: deepCopy(this.props.definition.sectionRule),
22479
22662
  });
22480
22663
  setup() {
22481
- this.state.title = _t(this.props.definition.title);
22482
22664
  owl.useExternalListener(window, "click", this.closeMenus);
22483
22665
  }
22666
+ get title() {
22667
+ return _t(this.props.definition.title);
22668
+ }
22484
22669
  get designErrorMessages() {
22485
22670
  const cancelledReasons = [...(this.state.sectionRuleDispatchResult?.reasons || [])];
22486
22671
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
22487
22672
  }
22488
22673
  updateBackgroundColor(color) {
22489
- this.state.openedMenu = undefined;
22490
22674
  this.props.updateChart(this.props.figureId, {
22491
22675
  background: color,
22492
22676
  });
22493
22677
  }
22494
- updateTitle() {
22495
- this.props.updateChart(this.props.figureId, {
22496
- title: this.state.title,
22497
- });
22678
+ updateTitle(title) {
22679
+ this.props.updateChart(this.props.figureId, { title });
22498
22680
  }
22499
22681
  isRangeMinInvalid() {
22500
22682
  return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMin" /* CommandResult.EmptyGaugeRangeMin */) ||
@@ -22544,12 +22726,6 @@ class GaugeChartDesignPanel extends owl.Component {
22544
22726
  this.state.openedMenu = undefined;
22545
22727
  }
22546
22728
  }
22547
- GaugeChartDesignPanel.props = {
22548
- figureId: String,
22549
- definition: Object,
22550
- updateChart: Function,
22551
- canUpdateChart: Function,
22552
- };
22553
22729
 
22554
22730
  class LineConfigPanel extends LineBarPieConfigPanel {
22555
22731
  static template = "o-spreadsheet-LineConfigPanel";
@@ -22560,24 +22736,42 @@ class LineConfigPanel extends LineBarPieConfigPanel {
22560
22736
  }
22561
22737
  return false;
22562
22738
  }
22563
- onUpdateLabelsAsText(ev) {
22739
+ get stackedLabel() {
22740
+ return _t("Stacked linechart");
22741
+ }
22742
+ get cumulativeLabel() {
22743
+ return _t("Cumulative data");
22744
+ }
22745
+ getLabelRangeOptions() {
22746
+ const options = super.getLabelRangeOptions();
22747
+ if (this.canTreatLabelsAsText) {
22748
+ options.push({
22749
+ name: "labelsAsText",
22750
+ value: this.props.definition.labelsAsText,
22751
+ label: _t("Treat labels as text"),
22752
+ onChange: this.onUpdateLabelsAsText.bind(this),
22753
+ });
22754
+ }
22755
+ return options;
22756
+ }
22757
+ onUpdateLabelsAsText(labelsAsText) {
22564
22758
  this.props.updateChart(this.props.figureId, {
22565
- labelsAsText: ev.target.checked,
22759
+ labelsAsText,
22566
22760
  });
22567
22761
  }
22568
- onUpdateStacked(ev) {
22762
+ onUpdateStacked(stacked) {
22569
22763
  this.props.updateChart(this.props.figureId, {
22570
- stacked: ev.target.checked,
22764
+ stacked,
22571
22765
  });
22572
22766
  }
22573
- onUpdateAggregated(ev) {
22767
+ onUpdateAggregated(aggregated) {
22574
22768
  this.props.updateChart(this.props.figureId, {
22575
- aggregated: ev.target.checked,
22769
+ aggregated,
22576
22770
  });
22577
22771
  }
22578
- onUpdateCumulative(ev) {
22772
+ onUpdateCumulative(cumulative) {
22579
22773
  this.props.updateChart(this.props.figureId, {
22580
- cumulative: ev.target.checked,
22774
+ cumulative,
22581
22775
  });
22582
22776
  }
22583
22777
  }
@@ -22588,7 +22782,13 @@ class LineChartDesignPanel extends LineBarPieDesignPanel {
22588
22782
 
22589
22783
  class ScorecardChartConfigPanel extends owl.Component {
22590
22784
  static template = "o-spreadsheet-ScorecardChartConfigPanel";
22591
- static components = { SelectionInput, ValidationMessages };
22785
+ static components = { SelectionInput, ValidationMessages, ChartErrorSection, Section };
22786
+ static props = {
22787
+ figureId: String,
22788
+ definition: Object,
22789
+ updateChart: Function,
22790
+ canUpdateChart: Function,
22791
+ };
22592
22792
  state = owl.useState({
22593
22793
  keyValueDispatchResult: undefined,
22594
22794
  baselineDispatchResult: undefined,
@@ -22640,28 +22840,27 @@ class ScorecardChartConfigPanel extends owl.Component {
22640
22840
  this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
22641
22841
  }
22642
22842
  }
22643
- ScorecardChartConfigPanel.props = {
22644
- figureId: String,
22645
- definition: Object,
22646
- updateChart: Function,
22647
- canUpdateChart: Function,
22648
- };
22649
22843
 
22650
22844
  class ScorecardChartDesignPanel extends owl.Component {
22651
22845
  static template = "o-spreadsheet-ScorecardChartDesignPanel";
22652
- static components = { ColorPickerWidget };
22846
+ static components = { ColorPickerWidget, ChartColor, ChartTitle, Section };
22847
+ static props = {
22848
+ figureId: String,
22849
+ definition: Object,
22850
+ updateChart: Function,
22851
+ canUpdateChart: Function,
22852
+ };
22653
22853
  state = owl.useState({
22654
- title: "",
22655
22854
  openedColorPicker: undefined,
22656
22855
  });
22657
22856
  setup() {
22658
- this.state.title = _t(this.props.definition.title);
22659
22857
  owl.useExternalListener(window, "click", this.closeMenus);
22660
22858
  }
22661
- updateTitle() {
22662
- this.props.updateChart(this.props.figureId, {
22663
- title: this.state.title,
22664
- });
22859
+ get title() {
22860
+ return _t(this.props.definition.title);
22861
+ }
22862
+ updateTitle(title) {
22863
+ this.props.updateChart(this.props.figureId, { title });
22665
22864
  }
22666
22865
  translate(term) {
22667
22866
  return _t(term);
@@ -22695,12 +22894,6 @@ class ScorecardChartDesignPanel extends owl.Component {
22695
22894
  this.state.openedColorPicker = undefined;
22696
22895
  }
22697
22896
  }
22698
- ScorecardChartDesignPanel.props = {
22699
- figureId: String,
22700
- definition: Object,
22701
- updateChart: Function,
22702
- canUpdateChart: Function,
22703
- };
22704
22897
 
22705
22898
  const chartSidePanelComponentRegistry = new Registry();
22706
22899
  chartSidePanelComponentRegistry
@@ -22751,6 +22944,8 @@ css /* scss */ `
22751
22944
  `;
22752
22945
  class ChartPanel extends owl.Component {
22753
22946
  static template = "o-spreadsheet-ChartPanel";
22947
+ static components = { Section };
22948
+ static props = { onCloseSidePanel: Function };
22754
22949
  state;
22755
22950
  get figureId() {
22756
22951
  return this.state.figureId;
@@ -22837,9 +23032,6 @@ class ChartPanel extends owl.Component {
22837
23032
  this.state.panel = panel;
22838
23033
  }
22839
23034
  }
22840
- ChartPanel.props = {
22841
- onCloseSidePanel: Function,
22842
- };
22843
23035
 
22844
23036
  css /* scss */ `
22845
23037
  .o-spreadsheet {
@@ -22950,6 +23142,9 @@ css /* scss */ `
22950
23142
  `;
22951
23143
  class IconPicker extends owl.Component {
22952
23144
  static template = "o-spreadsheet-IconPicker";
23145
+ static props = {
23146
+ onIconPicked: Function,
23147
+ };
22953
23148
  icons = ICONS;
22954
23149
  iconSets = ICON_SETS;
22955
23150
  onIconClick(icon) {
@@ -22958,9 +23153,6 @@ class IconPicker extends owl.Component {
22958
23153
  }
22959
23154
  }
22960
23155
  }
22961
- IconPicker.props = {
22962
- onIconPicked: Function,
22963
- };
22964
23156
 
22965
23157
  function useDragAndDropListItems() {
22966
23158
  let dndHelper;
@@ -23315,6 +23507,11 @@ css /* scss */ `
23315
23507
  `;
23316
23508
  class ConditionalFormatPreviewList extends owl.Component {
23317
23509
  static template = "o-spreadsheet-ConditionalFormatPreviewList";
23510
+ static props = {
23511
+ conditionalFormats: Array,
23512
+ onPreviewClick: Function,
23513
+ onAddConditionalFormat: Function,
23514
+ };
23318
23515
  icons = ICONS;
23319
23516
  dragAndDrop = useDragAndDropListItems();
23320
23517
  cfListRef = owl.useRef("cfList");
@@ -23395,11 +23592,6 @@ class ConditionalFormatPreviewList extends owl.Component {
23395
23592
  }
23396
23593
  }
23397
23594
  }
23398
- ConditionalFormatPreviewList.props = {
23399
- conditionalFormats: Array,
23400
- onPreviewClick: Function,
23401
- onAddConditionalFormat: Function,
23402
- };
23403
23595
 
23404
23596
  css /* scss */ `
23405
23597
  label {
@@ -23572,11 +23764,16 @@ css /* scss */ `
23572
23764
  `;
23573
23765
  class ConditionalFormattingEditor extends owl.Component {
23574
23766
  static template = "o-spreadsheet-ConditionalFormattingEditor";
23767
+ static props = {
23768
+ editedCf: { type: Object, optional: true },
23769
+ onExitEdition: Function,
23770
+ };
23575
23771
  static components = {
23576
23772
  SelectionInput,
23577
23773
  IconPicker,
23578
23774
  ColorPickerWidget,
23579
23775
  ConditionalFormatPreviewList,
23776
+ Section,
23580
23777
  };
23581
23778
  icons = ICONS;
23582
23779
  cellIsOperators = CellIsOperators;
@@ -23836,13 +24033,13 @@ class ConditionalFormattingEditor extends owl.Component {
23836
24033
  this.state.rules.iconSet.icons[target] = icon;
23837
24034
  }
23838
24035
  }
23839
- ConditionalFormattingEditor.props = {
23840
- editedCf: { type: Object, optional: true },
23841
- onExitEdition: Function,
23842
- };
23843
24036
 
23844
24037
  class ConditionalFormattingPanel extends owl.Component {
23845
24038
  static template = "o-spreadsheet-ConditionalFormattingPanel";
24039
+ static props = {
24040
+ selection: { type: Object, optional: true },
24041
+ onCloseSidePanel: Function,
24042
+ };
23846
24043
  static components = {
23847
24044
  ConditionalFormatPreviewList,
23848
24045
  ConditionalFormattingEditor,
@@ -23901,10 +24098,6 @@ class ConditionalFormattingPanel extends owl.Component {
23901
24098
  this.state.editedCf = cf;
23902
24099
  }
23903
24100
  }
23904
- ConditionalFormattingPanel.props = {
23905
- selection: { type: Object, optional: true },
23906
- onCloseSidePanel: Function,
23907
- };
23908
24101
 
23909
24102
  css /* scss */ `
23910
24103
  .o-custom-currency {
@@ -23915,6 +24108,8 @@ css /* scss */ `
23915
24108
  `;
23916
24109
  class CustomCurrencyPanel extends owl.Component {
23917
24110
  static template = "o-spreadsheet-CustomCurrencyPanel";
24111
+ static components = { Section };
24112
+ static props = { onCloseSidePanel: Function };
23918
24113
  availableCurrencies;
23919
24114
  state;
23920
24115
  setup() {
@@ -24037,9 +24232,6 @@ class CustomCurrencyPanel extends owl.Component {
24037
24232
  return currency.name + (currency.code ? ` (${currency.code})` : "");
24038
24233
  }
24039
24234
  }
24040
- CustomCurrencyPanel.props = {
24041
- onCloseSidePanel: Function,
24042
- };
24043
24235
 
24044
24236
  css /* scss */ `
24045
24237
  .o-find-and-replace {
@@ -24069,7 +24261,10 @@ css /* scss */ `
24069
24261
  `;
24070
24262
  class FindAndReplacePanel extends owl.Component {
24071
24263
  static template = "o-spreadsheet-FindAndReplacePanel";
24072
- static components = { SelectionInput };
24264
+ static components = { SelectionInput, Section, Checkbox };
24265
+ static props = {
24266
+ onCloseSidePanel: Function,
24267
+ };
24073
24268
  debounceTimeoutId;
24074
24269
  initialShowFormulaState = false;
24075
24270
  dataRange = "";
@@ -24144,19 +24339,16 @@ class FindAndReplacePanel extends owl.Component {
24144
24339
  this.replace();
24145
24340
  }
24146
24341
  }
24147
- searchFormulas(ev) {
24148
- const showFormula = ev.target.checked;
24342
+ searchFormulas(showFormula) {
24149
24343
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
24150
24344
  show: showFormula,
24151
24345
  });
24152
24346
  this.updateSearch({ searchFormulas: showFormula });
24153
24347
  }
24154
- searchExactMatch(ev) {
24155
- const exactMatch = ev.target.checked;
24348
+ searchExactMatch(exactMatch) {
24156
24349
  this.updateSearch({ exactMatch });
24157
24350
  }
24158
- searchMatchCase(ev) {
24159
- const matchCase = ev.target.checked;
24351
+ searchMatchCase(matchCase) {
24160
24352
  this.updateSearch({ matchCase });
24161
24353
  }
24162
24354
  changeSearchScope(ev) {
@@ -24209,9 +24401,6 @@ class FindAndReplacePanel extends owl.Component {
24209
24401
  });
24210
24402
  }
24211
24403
  }
24212
- FindAndReplacePanel.props = {
24213
- onCloseSidePanel: Function,
24214
- };
24215
24404
 
24216
24405
  css /* scss */ `
24217
24406
  .o-more-formats-panel {
@@ -24243,13 +24432,13 @@ const DATE_FORMAT_ACTIONS = createActions([
24243
24432
  ]);
24244
24433
  class MoreFormatsPanel extends owl.Component {
24245
24434
  static template = "o-spreadsheet-MoreFormatsPanel";
24435
+ static props = {
24436
+ onCloseSidePanel: Function,
24437
+ };
24246
24438
  get dateFormatsActions() {
24247
24439
  return DATE_FORMAT_ACTIONS;
24248
24440
  }
24249
24441
  }
24250
- MoreFormatsPanel.props = {
24251
- onCloseSidePanel: Function,
24252
- };
24253
24442
 
24254
24443
  css /* scss */ `
24255
24444
  .o-checkbox-selection {
@@ -24258,7 +24447,7 @@ css /* scss */ `
24258
24447
  `;
24259
24448
  class RemoveDuplicatesPanel extends owl.Component {
24260
24449
  static template = "o-spreadsheet-RemoveDuplicatesPanel";
24261
- static components = { ValidationMessages };
24450
+ static components = { ValidationMessages, Section, Checkbox };
24262
24451
  state = owl.useState({
24263
24452
  hasHeader: false,
24264
24453
  columns: {},
@@ -24347,6 +24536,8 @@ css /* scss */ `
24347
24536
  `;
24348
24537
  class SettingsPanel extends owl.Component {
24349
24538
  static template = "o-spreadsheet-SettingsPanel";
24539
+ static components = { Section };
24540
+ static props = { onCloseSidePanel: Function };
24350
24541
  loadedLocales = [];
24351
24542
  setup() {
24352
24543
  owl.onWillStart(() => this.loadLocales());
@@ -24395,9 +24586,6 @@ class SettingsPanel extends owl.Component {
24395
24586
  return this.loadedLocales;
24396
24587
  }
24397
24588
  }
24398
- SettingsPanel.props = {
24399
- onCloseSidePanel: Function,
24400
- };
24401
24589
 
24402
24590
  const SplitToColumnsInteractiveContent = {
24403
24591
  SplitIsDestructive: _t("This will overwrite data in the subsequent columns. Split anyway?"),
@@ -24493,7 +24681,7 @@ dataValidationEvaluatorRegistry.add("dateIs", {
24493
24681
  return false;
24494
24682
  }
24495
24683
  if (["lastWeek", "lastMonth", "lastYear"].includes(criterion.dateValue)) {
24496
- const today = jsDateToRoundNumber(new Date());
24684
+ const today = jsDateToRoundNumber(DateTime.now());
24497
24685
  return isDateBetween(dateValue, today, criterionValue);
24498
24686
  }
24499
24687
  return areDatesSameDay(dateValue, criterionValue);
@@ -24985,7 +25173,8 @@ const SEPARATORS = [
24985
25173
  ];
24986
25174
  class SplitIntoColumnsPanel extends owl.Component {
24987
25175
  static template = "o-spreadsheet-SplitIntoColumnsPanel";
24988
- static components = { ValidationMessages };
25176
+ static components = { ValidationMessages, Section, Checkbox };
25177
+ static props = { onCloseSidePanel: Function };
24989
25178
  state = owl.useState({ separatorValue: "auto", addNewColumns: false, customSeparator: "" });
24990
25179
  setup() {
24991
25180
  owl.onWillUpdateProps(() => {
@@ -25007,10 +25196,8 @@ class SplitIntoColumnsPanel extends owl.Component {
25007
25196
  return;
25008
25197
  this.state.customSeparator = ev.target.value;
25009
25198
  }
25010
- updateAddNewColumnsCheckbox(ev) {
25011
- if (!ev.target)
25012
- return;
25013
- this.state.addNewColumns = ev.target.checked;
25199
+ updateAddNewColumnsCheckbox(addNewColumns) {
25200
+ this.state.addNewColumns = addNewColumns;
25014
25201
  }
25015
25202
  confirm() {
25016
25203
  const result = interactiveSplitToColumns(this.env, this.separatorValue, this.state.addNewColumns);
@@ -25064,13 +25251,15 @@ class SplitIntoColumnsPanel extends owl.Component {
25064
25251
  return !this.separatorValue || this.errorMessages.length > 0;
25065
25252
  }
25066
25253
  }
25067
- SplitIntoColumnsPanel.props = {
25068
- onCloseSidePanel: Function,
25069
- };
25070
25254
 
25071
25255
  /** This component looks like a select input, but on click it opens a Menu with the items given as props instead of a dropdown */
25072
25256
  class SelectMenu extends owl.Component {
25073
25257
  static template = "o-spreadsheet-SelectMenu";
25258
+ static props = {
25259
+ menuItems: Array,
25260
+ selectedValue: String,
25261
+ class: { type: String, optional: true },
25262
+ };
25074
25263
  static components = { Menu };
25075
25264
  selectRef = owl.useRef("select");
25076
25265
  selectRect = useAbsoluteBoundingRect(this.selectRef);
@@ -25090,13 +25279,12 @@ class SelectMenu extends owl.Component {
25090
25279
  };
25091
25280
  }
25092
25281
  }
25093
- SelectMenu.props = {
25094
- menuItems: Array,
25095
- selectedValue: String,
25096
- class: { type: String, optional: true },
25097
- };
25098
25282
 
25099
25283
  class DataValidationCriterionForm extends owl.Component {
25284
+ static props = {
25285
+ criterion: Object,
25286
+ onCriterionChanged: Function,
25287
+ };
25100
25288
  setup() {
25101
25289
  owl.onMounted(() => {
25102
25290
  interactiveStopEdition(this.env);
@@ -25110,10 +25298,6 @@ class DataValidationCriterionForm extends owl.Component {
25110
25298
  this.props.onCriterionChanged(filteredCriterion);
25111
25299
  }
25112
25300
  }
25113
- DataValidationCriterionForm.props = {
25114
- criterion: Object,
25115
- onCriterionChanged: Function,
25116
- };
25117
25301
 
25118
25302
  css /* scss */ `
25119
25303
  .o-dv-input {
@@ -25128,6 +25312,15 @@ css /* scss */ `
25128
25312
  `;
25129
25313
  class DataValidationInput extends owl.Component {
25130
25314
  static template = "o-spreadsheet-DataValidationInput";
25315
+ static props = {
25316
+ value: { type: String, optional: true },
25317
+ criterionType: String,
25318
+ onValueChanged: Function,
25319
+ onKeyDown: { type: Function, optional: true },
25320
+ focused: { type: Boolean, optional: true },
25321
+ onBlur: { type: Function, optional: true },
25322
+ onFocus: { type: Function, optional: true },
25323
+ };
25131
25324
  static defaultProps = {
25132
25325
  value: "",
25133
25326
  onKeyDown: () => { },
@@ -25166,15 +25359,6 @@ class DataValidationInput extends owl.Component {
25166
25359
  return this.env.model.getters.getDataValidationInvalidCriterionValueMessage(this.props.criterionType, canonicalizeContent(this.props.value, this.env.model.getters.getLocale()));
25167
25360
  }
25168
25361
  }
25169
- DataValidationInput.props = {
25170
- value: { type: String, optional: true },
25171
- criterionType: String,
25172
- onValueChanged: Function,
25173
- onKeyDown: { type: Function, optional: true },
25174
- focused: { type: Boolean, optional: true },
25175
- onBlur: { type: Function, optional: true },
25176
- onFocus: { type: Function, optional: true },
25177
- };
25178
25362
 
25179
25363
  const DATES_VALUES = {
25180
25364
  today: _t("today"),
@@ -25510,7 +25694,11 @@ css /* scss */ `
25510
25694
  `;
25511
25695
  class DataValidationEditor extends owl.Component {
25512
25696
  static template = "o-spreadsheet-DataValidationEditor";
25513
- static components = { SelectionInput, SelectMenu };
25697
+ static components = { SelectionInput, SelectMenu, Section };
25698
+ static props = {
25699
+ rule: { type: Object, optional: true },
25700
+ onExit: Function,
25701
+ };
25514
25702
  state = owl.useState({ rule: this.defaultDataValidationRule });
25515
25703
  setup() {
25516
25704
  if (this.props.rule) {
@@ -25586,10 +25774,6 @@ class DataValidationEditor extends owl.Component {
25586
25774
  return dataValidationPanelCriteriaRegistry.get(this.state.rule.criterion.type).component;
25587
25775
  }
25588
25776
  }
25589
- DataValidationEditor.props = {
25590
- rule: { type: Object, optional: true },
25591
- onExit: Function,
25592
- };
25593
25777
 
25594
25778
  css /* scss */ `
25595
25779
  .o-sidePanel {
@@ -25619,6 +25803,10 @@ css /* scss */ `
25619
25803
  `;
25620
25804
  class DataValidationPreview extends owl.Component {
25621
25805
  static template = "o-spreadsheet-DataValidationPreview";
25806
+ static props = {
25807
+ onClick: Function,
25808
+ rule: Object,
25809
+ };
25622
25810
  deleteDataValidation() {
25623
25811
  const sheetId = this.env.model.getters.getActiveSheetId();
25624
25812
  this.env.model.dispatch("REMOVE_DATA_VALIDATION_RULE", { sheetId, id: this.props.rule.id });
@@ -25635,13 +25823,12 @@ class DataValidationPreview extends owl.Component {
25635
25823
  .getPreview(this.props.rule.criterion, this.env.model.getters);
25636
25824
  }
25637
25825
  }
25638
- DataValidationPreview.props = {
25639
- onClick: Function,
25640
- rule: Object,
25641
- };
25642
25826
 
25643
25827
  class DataValidationPanel extends owl.Component {
25644
25828
  static template = "o-spreadsheet-DataValidationPanel";
25829
+ static props = {
25830
+ onCloseSidePanel: Function,
25831
+ };
25645
25832
  static components = { DataValidationPreview, DataValidationEditor };
25646
25833
  state = owl.useState({ mode: "list", activeRule: undefined });
25647
25834
  onPreviewClick(id) {
@@ -25671,9 +25858,6 @@ class DataValidationPanel extends owl.Component {
25671
25858
  return this.env.model.getters.getDataValidationRules(sheetId);
25672
25859
  }
25673
25860
  }
25674
- DataValidationPanel.props = {
25675
- onCloseSidePanel: Function,
25676
- };
25677
25861
 
25678
25862
  const sidePanelRegistry = new Registry();
25679
25863
  sidePanelRegistry.add("ConditionalFormatting", {
@@ -25805,6 +25989,13 @@ css /*SCSS*/ `
25805
25989
  `;
25806
25990
  class FigureComponent extends owl.Component {
25807
25991
  static template = "o-spreadsheet-FigureComponent";
25992
+ static props = {
25993
+ figure: Object,
25994
+ style: { type: String, optional: true },
25995
+ onFigureDeleted: { type: Function, optional: true },
25996
+ onMouseDown: { type: Function, optional: true },
25997
+ onClickAnchor: { type: Function, optional: true },
25998
+ };
25808
25999
  static components = { Menu };
25809
26000
  static defaultProps = {
25810
26001
  onFigureDeleted: () => { },
@@ -25947,13 +26138,6 @@ class FigureComponent extends owl.Component {
25947
26138
  .menuBuilder(this.props.figure.id, this.props.onFigureDeleted, this.env);
25948
26139
  }
25949
26140
  }
25950
- FigureComponent.props = {
25951
- figure: Object,
25952
- style: { type: String, optional: true },
25953
- onFigureDeleted: { type: Function, optional: true },
25954
- onMouseDown: { type: Function, optional: true },
25955
- onClickAnchor: { type: Function, optional: true },
25956
- };
25957
26141
 
25958
26142
  const ToggleGroupInteractiveContent = {
25959
26143
  CannotHideAllRows: _t("Cannot hide all the rows of a sheet."),
@@ -26091,6 +26275,10 @@ css /* scss */ `
26091
26275
  `;
26092
26276
  class Autofill extends owl.Component {
26093
26277
  static template = "o-spreadsheet-Autofill";
26278
+ static props = {
26279
+ position: Object,
26280
+ isVisible: Boolean,
26281
+ };
26094
26282
  state = owl.useState({
26095
26283
  position: { left: 0, top: 0 },
26096
26284
  handler: false,
@@ -26159,18 +26347,14 @@ class Autofill extends owl.Component {
26159
26347
  this.env.model.dispatch("AUTOFILL_AUTO");
26160
26348
  }
26161
26349
  }
26162
- Autofill.props = {
26163
- position: Object,
26164
- isVisible: Boolean,
26165
- };
26166
26350
  class TooltipComponent extends owl.Component {
26351
+ static props = {
26352
+ content: String,
26353
+ };
26167
26354
  static template = owl.xml /* xml */ `
26168
26355
  <div t-esc="props.content"/>
26169
26356
  `;
26170
26357
  }
26171
- TooltipComponent.props = {
26172
- content: String,
26173
- };
26174
26358
 
26175
26359
  css /* scss */ `
26176
26360
  .o-client-tag {
@@ -26184,6 +26368,13 @@ css /* scss */ `
26184
26368
  `;
26185
26369
  class ClientTag extends owl.Component {
26186
26370
  static template = "o-spreadsheet-ClientTag";
26371
+ static props = {
26372
+ active: Boolean,
26373
+ name: String,
26374
+ color: String,
26375
+ col: Number,
26376
+ row: Number,
26377
+ };
26187
26378
  get tagStyle() {
26188
26379
  const { col, row, color } = this.props;
26189
26380
  const { height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
@@ -26201,13 +26392,6 @@ class ClientTag extends owl.Component {
26201
26392
  });
26202
26393
  }
26203
26394
  }
26204
- ClientTag.props = {
26205
- active: Boolean,
26206
- name: String,
26207
- color: String,
26208
- col: Number,
26209
- row: Number,
26210
- };
26211
26395
 
26212
26396
  function getHtmlContentFromPattern(pattern, value, highlightColor, className) {
26213
26397
  const pendingHtmlContent = [];
@@ -26247,14 +26431,14 @@ css /* scss */ `
26247
26431
  `;
26248
26432
  class TextValueProvider extends owl.Component {
26249
26433
  static template = "o-spreadsheet-TextValueProvider";
26434
+ static props = {
26435
+ values: Array,
26436
+ selectedIndex: { type: Number, optional: true },
26437
+ getHtmlContent: Function,
26438
+ onValueSelected: Function,
26439
+ onValueHovered: Function,
26440
+ };
26250
26441
  }
26251
- TextValueProvider.props = {
26252
- values: Array,
26253
- selectedIndex: { type: Number, optional: true },
26254
- getHtmlContent: Function,
26255
- onValueSelected: Function,
26256
- onValueHovered: Function,
26257
- };
26258
26442
 
26259
26443
  class ContentEditableHelper {
26260
26444
  // todo make el private and expose dedicated methods
@@ -26616,6 +26800,11 @@ css /* scss */ `
26616
26800
  `;
26617
26801
  class FunctionDescriptionProvider extends owl.Component {
26618
26802
  static template = "o-spreadsheet-FunctionDescriptionProvider";
26803
+ static props = {
26804
+ functionName: String,
26805
+ functionDescription: Object,
26806
+ argToFocus: Number,
26807
+ };
26619
26808
  assistantState = owl.useState({
26620
26809
  allowCellSelectionBehind: false,
26621
26810
  });
@@ -26640,11 +26829,6 @@ class FunctionDescriptionProvider extends owl.Component {
26640
26829
  }, 2000);
26641
26830
  }
26642
26831
  }
26643
- FunctionDescriptionProvider.props = {
26644
- functionName: String,
26645
- functionDescription: Object,
26646
- argToFocus: Number,
26647
- };
26648
26832
 
26649
26833
  const functions$2 = functionRegistry.content;
26650
26834
  const ASSISTANT_WIDTH = 300;
@@ -26710,6 +26894,16 @@ css /* scss */ `
26710
26894
  `;
26711
26895
  class Composer extends owl.Component {
26712
26896
  static template = "o-spreadsheet-Composer";
26897
+ static props = {
26898
+ focus: {
26899
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
26900
+ },
26901
+ onComposerContentFocused: Function,
26902
+ inputStyle: { type: String, optional: true },
26903
+ rect: { type: Object, optional: true },
26904
+ delimitation: { type: Object, optional: true },
26905
+ onComposerUnmounted: { type: Function, optional: true },
26906
+ };
26713
26907
  static components = { TextValueProvider, FunctionDescriptionProvider };
26714
26908
  static defaultProps = {
26715
26909
  inputStyle: "",
@@ -27266,14 +27460,6 @@ class Composer extends owl.Component {
27266
27460
  this.autoCompleteState.getHtmlContent = (value) => [{ value }];
27267
27461
  }
27268
27462
  }
27269
- Composer.props = {
27270
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
27271
- onComposerContentFocused: Function,
27272
- inputStyle: { type: String, optional: true },
27273
- rect: { type: Object, optional: true },
27274
- delimitation: { type: Object, optional: true },
27275
- onComposerUnmounted: { type: Function, optional: true },
27276
- };
27277
27463
 
27278
27464
  const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
27279
27465
  const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
@@ -27305,6 +27491,14 @@ css /* scss */ `
27305
27491
  */
27306
27492
  class GridComposer extends owl.Component {
27307
27493
  static template = "o-spreadsheet-GridComposer";
27494
+ static props = {
27495
+ focus: {
27496
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
27497
+ },
27498
+ onComposerUnmounted: Function,
27499
+ onComposerContentFocused: Function,
27500
+ gridDims: Object,
27501
+ };
27308
27502
  static components = { Composer };
27309
27503
  gridComposerRef;
27310
27504
  zone;
@@ -27411,22 +27605,22 @@ class GridComposer extends owl.Component {
27411
27605
  });
27412
27606
  }
27413
27607
  }
27414
- GridComposer.props = {
27415
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
27416
- onComposerUnmounted: Function,
27417
- onComposerContentFocused: Function,
27418
- gridDims: Object,
27419
- };
27420
27608
 
27421
- const CSS$1 = css /* scss */ `
27609
+ css /* scss */ `
27422
27610
  .o-grid-cell-icon {
27423
27611
  width: ${GRID_ICON_EDGE_LENGTH}px;
27424
27612
  height: ${GRID_ICON_EDGE_LENGTH}px;
27425
27613
  }
27426
27614
  `;
27427
27615
  class GridCellIcon extends owl.Component {
27428
- static style = CSS$1;
27429
27616
  static template = "o-spreadsheet-GridCellIcon";
27617
+ static props = {
27618
+ cellPosition: Object,
27619
+ horizontalAlign: { type: String, optional: true },
27620
+ verticalAlign: { type: String, optional: true },
27621
+ offset: { type: Object, optional: true },
27622
+ slots: Object,
27623
+ };
27430
27624
  get iconStyle() {
27431
27625
  const x = this.getIconHorizontalPosition();
27432
27626
  const y = this.getIconVerticalPosition();
@@ -27475,15 +27669,8 @@ class GridCellIcon extends owl.Component {
27475
27669
  return !(rect.width === 0 || rect.height === 0);
27476
27670
  }
27477
27671
  }
27478
- GridCellIcon.props = {
27479
- cellPosition: Object,
27480
- horizontalAlign: { type: String, optional: true },
27481
- verticalAlign: { type: String, optional: true },
27482
- offset: { type: Object, optional: true },
27483
- slots: Object,
27484
- };
27485
27672
 
27486
- const CSS = css /* scss */ `
27673
+ css /* scss */ `
27487
27674
  .o-filter-icon {
27488
27675
  color: ${FILTERS_COLOR};
27489
27676
  display: flex;
@@ -27498,8 +27685,10 @@ const CSS = css /* scss */ `
27498
27685
  }
27499
27686
  `;
27500
27687
  class FilterIcon extends owl.Component {
27501
- static style = CSS;
27502
27688
  static template = "o-spreadsheet-FilterIcon";
27689
+ static props = {
27690
+ cellPosition: Object,
27691
+ };
27503
27692
  onClick() {
27504
27693
  const position = this.props.cellPosition;
27505
27694
  const activePopoverType = this.env.model.getters.getPersistentPopoverTypeAtPosition(position);
@@ -27518,12 +27707,12 @@ class FilterIcon extends owl.Component {
27518
27707
  return this.env.model.getters.isFilterActive(this.props.cellPosition);
27519
27708
  }
27520
27709
  }
27521
- FilterIcon.props = {
27522
- cellPosition: Object,
27523
- };
27524
27710
 
27525
27711
  class FilterIconsOverlay extends owl.Component {
27526
27712
  static template = "o-spreadsheet-FilterIconsOverlay";
27713
+ static props = {
27714
+ gridPosition: { type: Object, optional: true },
27715
+ };
27527
27716
  static components = {
27528
27717
  GridCellIcon,
27529
27718
  FilterIcon,
@@ -27537,14 +27726,12 @@ class FilterIconsOverlay extends owl.Component {
27537
27726
  return headerPositions.map((position) => ({ sheetId, ...position }));
27538
27727
  }
27539
27728
  }
27540
- FilterIconsOverlay.props = {
27541
- gridPosition: { type: Object, optional: true },
27542
- };
27543
27729
 
27544
27730
  const CHECKBOX_WIDTH = 15;
27545
27731
  const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
27546
27732
  css /* scss */ `
27547
27733
  .o-dv-checkbox {
27734
+ box-sizing: border-box !important;
27548
27735
  width: ${CHECKBOX_WIDTH}px;
27549
27736
  height: ${CHECKBOX_WIDTH}px;
27550
27737
  accent-color: #808080;
@@ -27553,6 +27740,9 @@ css /* scss */ `
27553
27740
  `;
27554
27741
  class DataValidationCheckbox extends owl.Component {
27555
27742
  static template = "o-spreadsheet-DataValidationCheckbox";
27743
+ static props = {
27744
+ cellPosition: Object,
27745
+ };
27556
27746
  onCheckboxChange(ev) {
27557
27747
  const newValue = ev.target.checked;
27558
27748
  const { sheetId, col, row } = this.props.cellPosition;
@@ -27567,9 +27757,6 @@ class DataValidationCheckbox extends owl.Component {
27567
27757
  return !!cell?.isFormula;
27568
27758
  }
27569
27759
  }
27570
- DataValidationCheckbox.props = {
27571
- cellPosition: Object,
27572
- };
27573
27760
 
27574
27761
  const ICON_WIDTH = 13;
27575
27762
  css /* scss */ `
@@ -27592,18 +27779,19 @@ css /* scss */ `
27592
27779
  `;
27593
27780
  class DataValidationListIcon extends owl.Component {
27594
27781
  static template = "o-spreadsheet-DataValidationListIcon";
27782
+ static props = {
27783
+ cellPosition: Object,
27784
+ };
27595
27785
  onClick() {
27596
27786
  const { col, row } = this.props.cellPosition;
27597
27787
  this.env.model.selection.selectCell(col, row);
27598
27788
  this.env.startCellEdition();
27599
27789
  }
27600
27790
  }
27601
- DataValidationListIcon.props = {
27602
- cellPosition: Object,
27603
- };
27604
27791
 
27605
27792
  class DataValidationOverlay extends owl.Component {
27606
27793
  static template = "o-spreadsheet-DataValidationOverlay";
27794
+ static props = {};
27607
27795
  static components = { GridCellIcon, DataValidationCheckbox, DataValidationListIcon };
27608
27796
  get checkBoxCellPositions() {
27609
27797
  return this.env.model.getters.getDataValidationCheckBoxCellPositions();
@@ -27614,7 +27802,6 @@ class DataValidationOverlay extends owl.Component {
27614
27802
  : this.env.model.getters.getDataValidationListCellsPositions();
27615
27803
  }
27616
27804
  }
27617
- DataValidationOverlay.props = {};
27618
27805
 
27619
27806
  /**
27620
27807
  * Transform a figure with coordinates from the model, to coordinates as they are shown on the screen,
@@ -27950,6 +28137,9 @@ css /*SCSS*/ `
27950
28137
  */
27951
28138
  class FiguresContainer extends owl.Component {
27952
28139
  static template = "o-spreadsheet-FiguresContainer";
28140
+ static props = {
28141
+ onFigureDeleted: Function,
28142
+ };
27953
28143
  static components = { FigureComponent };
27954
28144
  dnd = owl.useState({
27955
28145
  draggedFigure: undefined,
@@ -28199,9 +28389,6 @@ class FiguresContainer extends owl.Component {
28199
28389
  }
28200
28390
  }
28201
28391
  }
28202
- FiguresContainer.props = {
28203
- onFigureDeleted: Function,
28204
- };
28205
28392
 
28206
28393
  css /* scss */ `
28207
28394
  .o-grid-add-rows {
@@ -28220,6 +28407,9 @@ css /* scss */ `
28220
28407
  `;
28221
28408
  class GridAddRowsFooter extends owl.Component {
28222
28409
  static template = "o-spreadsheet-GridAddRowsFooter";
28410
+ static props = {
28411
+ focusGrid: Function,
28412
+ };
28223
28413
  static components = { ValidationMessages };
28224
28414
  inputRef = owl.useRef("inputRef");
28225
28415
  state = owl.useState({
@@ -28286,9 +28476,6 @@ class GridAddRowsFooter extends owl.Component {
28286
28476
  this.props.focusGrid();
28287
28477
  }
28288
28478
  }
28289
- GridAddRowsFooter.props = {
28290
- focusGrid: Function,
28291
- };
28292
28479
 
28293
28480
  /**
28294
28481
  * Manages an event listener on a ref. Useful for hooks that want to manage
@@ -28444,6 +28631,16 @@ function useTouchMove(gridRef, handler, canMoveUp) {
28444
28631
  }
28445
28632
  class GridOverlay extends owl.Component {
28446
28633
  static template = "o-spreadsheet-GridOverlay";
28634
+ static props = {
28635
+ onCellHovered: { type: Function, optional: true },
28636
+ onCellDoubleClicked: { type: Function, optional: true },
28637
+ onCellClicked: { type: Function, optional: true },
28638
+ onCellRightClicked: { type: Function, optional: true },
28639
+ onGridResized: { type: Function, optional: true },
28640
+ onFigureDeleted: { type: Function, optional: true },
28641
+ onGridMoved: Function,
28642
+ gridOverlayDimensions: String,
28643
+ };
28447
28644
  static components = { FiguresContainer, DataValidationOverlay, GridAddRowsFooter };
28448
28645
  static defaultProps = {
28449
28646
  onCellHovered: () => { },
@@ -28517,19 +28714,15 @@ class GridOverlay extends owl.Component {
28517
28714
  return [colIndex, rowIndex];
28518
28715
  }
28519
28716
  }
28520
- GridOverlay.props = {
28521
- onCellHovered: { type: Function, optional: true },
28522
- onCellDoubleClicked: { type: Function, optional: true },
28523
- onCellClicked: { type: Function, optional: true },
28524
- onCellRightClicked: { type: Function, optional: true },
28525
- onGridResized: { type: Function, optional: true },
28526
- onFigureDeleted: { type: Function, optional: true },
28527
- onGridMoved: Function,
28528
- gridOverlayDimensions: String,
28529
- };
28530
28717
 
28531
28718
  class GridPopover extends owl.Component {
28532
28719
  static template = "o-spreadsheet-GridPopover";
28720
+ static props = {
28721
+ hoveredCell: Object,
28722
+ onClosePopover: Function,
28723
+ onMouseWheel: Function,
28724
+ gridRect: Object,
28725
+ };
28533
28726
  static components = { Popover };
28534
28727
  zIndex = ComponentsImportance.GridPopover;
28535
28728
  get cellPopover() {
@@ -28549,14 +28742,11 @@ class GridPopover extends owl.Component {
28549
28742
  };
28550
28743
  }
28551
28744
  }
28552
- GridPopover.props = {
28553
- hoveredCell: Object,
28554
- onClosePopover: Function,
28555
- onMouseWheel: Function,
28556
- gridRect: Object,
28557
- };
28558
28745
 
28559
28746
  class AbstractResizer extends owl.Component {
28747
+ static props = {
28748
+ onOpenContextMenu: Function,
28749
+ };
28560
28750
  PADDING = 0;
28561
28751
  MAX_SIZE_MARGIN = 0;
28562
28752
  MIN_ELEMENT_SIZE = 0;
@@ -28813,10 +29003,10 @@ css /* scss */ `
28813
29003
  }
28814
29004
  }
28815
29005
  `;
28816
- AbstractResizer.props = {
28817
- onOpenContextMenu: Function,
28818
- };
28819
29006
  class ColResizer extends AbstractResizer {
29007
+ static props = {
29008
+ onOpenContextMenu: Function,
29009
+ };
28820
29010
  static template = "o-spreadsheet-ColResizer";
28821
29011
  colResizerRef;
28822
29012
  setup() {
@@ -28978,10 +29168,10 @@ css /* scss */ `
28978
29168
  }
28979
29169
  }
28980
29170
  `;
28981
- ColResizer.props = {
28982
- onOpenContextMenu: Function,
28983
- };
28984
29171
  class RowResizer extends AbstractResizer {
29172
+ static props = {
29173
+ onOpenContextMenu: Function,
29174
+ };
28985
29175
  static template = "o-spreadsheet-RowResizer";
28986
29176
  setup() {
28987
29177
  super.setup();
@@ -29102,19 +29292,16 @@ css /* scss */ `
29102
29292
  }
29103
29293
  }
29104
29294
  `;
29105
- RowResizer.props = {
29106
- onOpenContextMenu: Function,
29107
- };
29108
29295
  class HeadersOverlay extends owl.Component {
29296
+ static props = {
29297
+ onOpenContextMenu: Function,
29298
+ };
29109
29299
  static template = "o-spreadsheet-HeadersOverlay";
29110
29300
  static components = { ColResizer, RowResizer };
29111
29301
  selectAll() {
29112
29302
  this.env.model.selection.selectAll();
29113
29303
  }
29114
29304
  }
29115
- HeadersOverlay.props = {
29116
- onOpenContextMenu: Function,
29117
- };
29118
29305
 
29119
29306
  function useGridDrawing(refName, model, canvasSize) {
29120
29307
  const canvasRef = owl.useRef(refName);
@@ -29172,6 +29359,12 @@ css /* scss */ `
29172
29359
  `;
29173
29360
  class Border extends owl.Component {
29174
29361
  static template = "o-spreadsheet-Border";
29362
+ static props = {
29363
+ zone: Object,
29364
+ orientation: String,
29365
+ isMoving: Boolean,
29366
+ onMoveHighlight: Function,
29367
+ };
29175
29368
  get style() {
29176
29369
  const isTop = ["n", "w", "e"].includes(this.props.orientation);
29177
29370
  const isLeft = ["n", "w", "s"].includes(this.props.orientation);
@@ -29200,12 +29393,6 @@ class Border extends owl.Component {
29200
29393
  this.props.onMoveHighlight(ev.clientX, ev.clientY);
29201
29394
  }
29202
29395
  }
29203
- Border.props = {
29204
- zone: Object,
29205
- orientation: String,
29206
- isMoving: Boolean,
29207
- onMoveHighlight: Function,
29208
- };
29209
29396
 
29210
29397
  css /* scss */ `
29211
29398
  .o-corner {
@@ -29232,6 +29419,13 @@ css /* scss */ `
29232
29419
  `;
29233
29420
  class Corner extends owl.Component {
29234
29421
  static template = "o-spreadsheet-Corner";
29422
+ static props = {
29423
+ zone: Object,
29424
+ color: String,
29425
+ orientation: String,
29426
+ isResizing: Boolean,
29427
+ onResizeHighlight: Function,
29428
+ };
29235
29429
  isTop = this.props.orientation[0] === "n";
29236
29430
  isLeft = this.props.orientation[1] === "w";
29237
29431
  get style() {
@@ -29260,13 +29454,6 @@ class Corner extends owl.Component {
29260
29454
  this.props.onResizeHighlight(this.isLeft, this.isTop);
29261
29455
  }
29262
29456
  }
29263
- Corner.props = {
29264
- zone: Object,
29265
- color: String,
29266
- orientation: String,
29267
- isResizing: Boolean,
29268
- onResizeHighlight: Function,
29269
- };
29270
29457
 
29271
29458
  css /*SCSS*/ `
29272
29459
  .o-highlight {
@@ -29275,6 +29462,10 @@ css /*SCSS*/ `
29275
29462
  `;
29276
29463
  class Highlight extends owl.Component {
29277
29464
  static template = "o-spreadsheet-Highlight";
29465
+ static props = {
29466
+ zone: Object,
29467
+ color: String,
29468
+ };
29278
29469
  static components = {
29279
29470
  Corner,
29280
29471
  Border,
@@ -29358,10 +29549,6 @@ class Highlight extends owl.Component {
29358
29549
  dragAndDropBeyondTheViewport(this.env, mouseMove, mouseUp);
29359
29550
  }
29360
29551
  }
29361
- Highlight.props = {
29362
- zone: Object,
29363
- color: String,
29364
- };
29365
29552
 
29366
29553
  let ScrollBar$1 = class ScrollBar {
29367
29554
  direction;
@@ -29401,6 +29588,14 @@ css /* scss */ `
29401
29588
  }
29402
29589
  `;
29403
29590
  class ScrollBar extends owl.Component {
29591
+ static props = {
29592
+ width: { type: Number, optional: true },
29593
+ height: { type: Number, optional: true },
29594
+ direction: String,
29595
+ position: Object,
29596
+ offset: Number,
29597
+ onScroll: Function,
29598
+ };
29404
29599
  static template = owl.xml /*xml*/ `
29405
29600
  <div
29406
29601
  t-attf-class="o-scrollbar {{props.direction}}"
@@ -29444,16 +29639,11 @@ class ScrollBar extends owl.Component {
29444
29639
  }
29445
29640
  }
29446
29641
  }
29447
- ScrollBar.props = {
29448
- width: { type: Number, optional: true },
29449
- height: { type: Number, optional: true },
29450
- direction: String,
29451
- position: Object,
29452
- offset: Number,
29453
- onScroll: Function,
29454
- };
29455
29642
 
29456
29643
  class HorizontalScrollBar extends owl.Component {
29644
+ static props = {
29645
+ leftOffset: { type: Number, optional: true },
29646
+ };
29457
29647
  static components = { ScrollBar };
29458
29648
  static template = owl.xml /*xml*/ `
29459
29649
  <ScrollBar
@@ -29494,11 +29684,11 @@ class HorizontalScrollBar extends owl.Component {
29494
29684
  });
29495
29685
  }
29496
29686
  }
29497
- HorizontalScrollBar.props = {
29498
- leftOffset: { type: Number, optional: true },
29499
- };
29500
29687
 
29501
29688
  class VerticalScrollBar extends owl.Component {
29689
+ static props = {
29690
+ topOffset: { type: Number, optional: true },
29691
+ };
29502
29692
  static components = { ScrollBar };
29503
29693
  static template = owl.xml /*xml*/ `
29504
29694
  <ScrollBar
@@ -29539,9 +29729,6 @@ class VerticalScrollBar extends owl.Component {
29539
29729
  });
29540
29730
  }
29541
29731
  }
29542
- VerticalScrollBar.props = {
29543
- topOffset: { type: Number, optional: true },
29544
- };
29545
29732
 
29546
29733
  const registries$1 = {
29547
29734
  ROW: rowMenuRegistry,
@@ -29555,6 +29742,13 @@ const registries$1 = {
29555
29742
  // -----------------------------------------------------------------------------
29556
29743
  class Grid extends owl.Component {
29557
29744
  static template = "o-spreadsheet-Grid";
29745
+ static props = {
29746
+ sidePanelIsOpen: Boolean,
29747
+ exposeFocus: Function,
29748
+ focusComposer: String,
29749
+ onComposerContentFocused: Function,
29750
+ onGridComposerCellFocused: Function,
29751
+ };
29558
29752
  static components = {
29559
29753
  GridComposer,
29560
29754
  GridOverlay,
@@ -30159,13 +30353,6 @@ class Grid extends owl.Component {
30159
30353
  }
30160
30354
  }
30161
30355
  }
30162
- Grid.props = {
30163
- sidePanelIsOpen: Boolean,
30164
- exposeFocus: Function,
30165
- focusComposer: String,
30166
- onComposerContentFocused: Function,
30167
- onGridComposerCellFocused: Function,
30168
- };
30169
30356
 
30170
30357
  /**
30171
30358
  * Represent a raw XML string
@@ -31586,20 +31773,26 @@ function convertFigures(sheetData) {
31586
31773
  .filter(isDefined$1);
31587
31774
  }
31588
31775
  function convertFigure(figure, id, sheetData) {
31589
- const x1 = getColPosition(figure.anchors[0].col, sheetData) +
31590
- convertEMUToDotValue(figure.anchors[0].colOffset);
31591
- const x2 = getColPosition(figure.anchors[1].col, sheetData) +
31592
- convertEMUToDotValue(figure.anchors[1].colOffset);
31593
- const y1 = getRowPosition(figure.anchors[0].row, sheetData) +
31594
- convertEMUToDotValue(figure.anchors[0].rowOffset);
31595
- const y2 = getRowPosition(figure.anchors[1].row, sheetData) +
31596
- convertEMUToDotValue(figure.anchors[1].rowOffset);
31776
+ let x1, y1;
31777
+ let height, width;
31778
+ if (figure.anchors.length === 1) {
31779
+ // one cell anchor
31780
+ ({ x: x1, y: y1 } = getPositionFromAnchor(figure.anchors[0], sheetData));
31781
+ width = convertEMUToDotValue(figure.figureSize.cx);
31782
+ height = convertEMUToDotValue(figure.figureSize.cy);
31783
+ }
31784
+ else {
31785
+ ({ x: x1, y: y1 } = getPositionFromAnchor(figure.anchors[0], sheetData));
31786
+ const { x: x2, y: y2 } = getPositionFromAnchor(figure.anchors[1], sheetData);
31787
+ width = x2 - x1;
31788
+ height = y2 - y1;
31789
+ }
31597
31790
  const figureData = { id, x: x1, y: y1 };
31598
31791
  if (isChartData(figure.data)) {
31599
31792
  return {
31600
31793
  ...figureData,
31601
- width: x2 - x1,
31602
- height: y2 - y1,
31794
+ width,
31795
+ height,
31603
31796
  tag: "chart",
31604
31797
  data: convertChartData(figure.data),
31605
31798
  };
@@ -31665,6 +31858,12 @@ function convertExcelRangeToSheetXC(range, dataSetsHaveTitle) {
31665
31858
  const dataXC = zoneToXc(zone);
31666
31859
  return getFullReference(sheetName, dataXC);
31667
31860
  }
31861
+ function getPositionFromAnchor(anchor, sheetData) {
31862
+ return {
31863
+ x: getColPosition(anchor.col, sheetData) + convertEMUToDotValue(anchor.colOffset),
31864
+ y: getRowPosition(anchor.row, sheetData) + convertEMUToDotValue(anchor.rowOffset),
31865
+ };
31866
+ }
31668
31867
 
31669
31868
  /**
31670
31869
  * Match external reference (ex. '[1]Sheet 3'!$B$4)
@@ -32788,27 +32987,50 @@ class XlsxChartExtractor extends XlsxBaseExtractor {
32788
32987
  }
32789
32988
  }
32790
32989
 
32990
+ const ONE_CELL_ANCHOR = "oneCellAnchor";
32991
+ const TWO_CELL_ANCHOR = "twoCellAnchor";
32791
32992
  class XlsxFigureExtractor extends XlsxBaseExtractor {
32792
32993
  extractFigures() {
32793
32994
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "xdr:wsDr", children: true }, (figureElement) => {
32794
32995
  const anchorType = removeTagEscapedNamespaces(figureElement.tagName);
32795
- if (anchorType !== "twoCellAnchor") {
32796
- throw new Error("Only twoCellAnchor are supported for xlsx drawings.");
32797
- }
32996
+ const anchors = this.extractFigureAnchorsByType(figureElement, anchorType);
32798
32997
  const chartElement = this.querySelector(figureElement, "c:chart");
32799
32998
  const imageElement = this.querySelector(figureElement, "a:blip");
32800
32999
  if (!chartElement && !imageElement) {
32801
33000
  throw new Error("Only chart and image figures are currently supported.");
32802
33001
  }
32803
33002
  return {
32804
- anchors: [
32805
- this.extractFigureAnchor("xdr:from", figureElement),
32806
- this.extractFigureAnchor("xdr:to", figureElement),
32807
- ],
33003
+ anchors,
32808
33004
  data: chartElement ? this.extractChart(chartElement) : this.extractImage(figureElement),
33005
+ figureSize: anchorType === ONE_CELL_ANCHOR
33006
+ ? this.extractFigureSizeFromSizeTag(figureElement, "xdr:ext")
33007
+ : undefined,
32809
33008
  };
32810
33009
  });
32811
33010
  }
33011
+ extractFigureAnchorsByType(figureElement, anchorType) {
33012
+ switch (anchorType) {
33013
+ case ONE_CELL_ANCHOR:
33014
+ return [this.extractFigureAnchor("xdr:from", figureElement)];
33015
+ case TWO_CELL_ANCHOR:
33016
+ return [
33017
+ this.extractFigureAnchor("xdr:from", figureElement),
33018
+ this.extractFigureAnchor("xdr:to", figureElement),
33019
+ ];
33020
+ default:
33021
+ throw new Error(`${anchorType} is not supported for xlsx drawings. `);
33022
+ }
33023
+ }
33024
+ extractFigureSizeFromSizeTag(figureElement, sizeTag) {
33025
+ const sizeElement = this.querySelector(figureElement, sizeTag);
33026
+ if (!sizeElement) {
33027
+ throw new Error(`Missing size element '${sizeTag}'`);
33028
+ }
33029
+ return {
33030
+ cx: this.extractAttr(sizeElement, "cx", { required: true }).asNum(),
33031
+ cy: this.extractAttr(sizeElement, "cy", { required: true }).asNum(),
33032
+ };
33033
+ }
32812
33034
  extractFigureAnchor(anchorTag, figureElement) {
32813
33035
  const anchor = this.querySelector(figureElement, anchorTag);
32814
33036
  if (!anchor) {
@@ -32837,15 +33059,15 @@ class XlsxFigureExtractor extends XlsxBaseExtractor {
32837
33059
  if (!image) {
32838
33060
  throw new Error("Unable to extract image");
32839
33061
  }
32840
- const shapePropertyElement = this.querySelector(figureElement, "a:xfrm");
32841
33062
  const extension = image.fileName.split(".").at(-1);
33063
+ const anchorType = removeTagEscapedNamespaces(figureElement.tagName);
33064
+ const sizeElement = anchorType === TWO_CELL_ANCHOR ? this.querySelector(figureElement, "a:xfrm") : figureElement;
33065
+ const sizeTag = anchorType === TWO_CELL_ANCHOR ? "a:ext" : "xdr:ext";
33066
+ const size = this.extractFigureSizeFromSizeTag(sizeElement, sizeTag);
32842
33067
  return {
32843
33068
  imageSrc: image.imageSrc,
32844
33069
  mimetype: extension ? IMAGE_EXTENSION_TO_MIMETYPE_MAPPING[extension] : undefined,
32845
- size: {
32846
- cx: this.extractChildAttr(shapePropertyElement, "a:ext", "cx", { required: true }).asNum(),
32847
- cy: this.extractChildAttr(shapePropertyElement, "a:ext", "cy", { required: true }).asNum(),
32848
- },
33070
+ size,
32849
33071
  };
32850
33072
  }
32851
33073
  }
@@ -41497,7 +41719,8 @@ class EvaluationPlugin extends UIPlugin {
41497
41719
  // Command Handling
41498
41720
  // ---------------------------------------------------------------------------
41499
41721
  beforeHandle(cmd) {
41500
- if (invalidateDependenciesCommands.has(cmd.type)) {
41722
+ if (invalidateEvaluationCommands.has(cmd.type) ||
41723
+ invalidateDependenciesCommands.has(cmd.type)) {
41501
41724
  this.shouldRebuildDependenciesGraph = true;
41502
41725
  }
41503
41726
  }
@@ -41918,7 +42141,8 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
41918
42141
  // Command Handling
41919
42142
  // ---------------------------------------------------------------------------
41920
42143
  handle(cmd) {
41921
- if (invalidateCFEvaluationCommands.has(cmd.type) ||
42144
+ if (invalidateEvaluationCommands.has(cmd.type) ||
42145
+ invalidateCFEvaluationCommands.has(cmd.type) ||
41922
42146
  (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
41923
42147
  this.isStale = true;
41924
42148
  }
@@ -50820,6 +51044,20 @@ css /* scss */ `
50820
51044
  `;
50821
51045
  class RippleEffect extends owl.Component {
50822
51046
  static template = "o-spreadsheet-RippleEffect";
51047
+ static props = {
51048
+ x: String,
51049
+ y: String,
51050
+ color: String,
51051
+ opacity: Number,
51052
+ duration: Number,
51053
+ width: Number,
51054
+ height: Number,
51055
+ offsetY: Number,
51056
+ offsetX: Number,
51057
+ allowOverflow: Boolean,
51058
+ onAnimationEnd: Function,
51059
+ style: String,
51060
+ };
50823
51061
  rippleRef = owl.useRef("ripple");
50824
51062
  setup() {
50825
51063
  let animation = undefined;
@@ -50855,22 +51093,23 @@ class RippleEffect extends owl.Component {
50855
51093
  });
50856
51094
  }
50857
51095
  }
50858
- RippleEffect.props = {
50859
- x: String,
50860
- y: String,
50861
- color: String,
50862
- opacity: Number,
50863
- duration: Number,
50864
- width: Number,
50865
- height: Number,
50866
- offsetY: Number,
50867
- offsetX: Number,
50868
- allowOverflow: Boolean,
50869
- onAnimationEnd: Function,
50870
- style: String,
50871
- };
50872
51096
  class Ripple extends owl.Component {
50873
51097
  static template = "o-spreadsheet-Ripple";
51098
+ static props = {
51099
+ color: { type: String, optional: true },
51100
+ opacity: { type: Number, optional: true },
51101
+ duration: { type: Number, optional: true },
51102
+ ignoreClickPosition: { type: Boolean, optional: true },
51103
+ width: { type: Number, optional: true },
51104
+ height: { type: Number, optional: true },
51105
+ offsetY: { type: Number, optional: true },
51106
+ offsetX: { type: Number, optional: true },
51107
+ allowOverflow: { type: Boolean, optional: true },
51108
+ enabled: { type: Boolean, optional: true },
51109
+ onAnimationEnd: { type: Function, optional: true },
51110
+ slots: Object,
51111
+ class: { type: String, optional: true },
51112
+ };
50874
51113
  static components = { RippleEffect };
50875
51114
  static defaultProps = {
50876
51115
  color: "#aaaaaa",
@@ -50956,21 +51195,6 @@ class Ripple extends owl.Component {
50956
51195
  };
50957
51196
  }
50958
51197
  }
50959
- Ripple.props = {
50960
- color: { type: String, optional: true },
50961
- opacity: { type: Number, optional: true },
50962
- duration: { type: Number, optional: true },
50963
- ignoreClickPosition: { type: Boolean, optional: true },
50964
- width: { type: Number, optional: true },
50965
- height: { type: Number, optional: true },
50966
- offsetY: { type: Number, optional: true },
50967
- offsetX: { type: Number, optional: true },
50968
- allowOverflow: { type: Boolean, optional: true },
50969
- enabled: { type: Boolean, optional: true },
50970
- onAnimationEnd: { type: Function, optional: true },
50971
- slots: Object,
50972
- class: { type: String, optional: true },
50973
- };
50974
51198
 
50975
51199
  function interactiveRenameSheet(env, sheetId, name, errorCallback) {
50976
51200
  const result = env.model.dispatch("RENAME_SHEET", { sheetId, name });
@@ -51028,6 +51252,12 @@ css /* scss */ `
51028
51252
  `;
51029
51253
  class BottomBarSheet extends owl.Component {
51030
51254
  static template = "o-spreadsheet-BottomBarSheet";
51255
+ static props = {
51256
+ sheetId: String,
51257
+ openContextMenu: Function,
51258
+ style: { type: String, optional: true },
51259
+ onMouseDown: { type: Function, optional: true },
51260
+ };
51031
51261
  static components = { Ripple };
51032
51262
  static defaultProps = {
51033
51263
  onMouseDown: () => { },
@@ -51149,12 +51379,6 @@ class BottomBarSheet extends owl.Component {
51149
51379
  return this.env.model.getters.getSheetName(this.props.sheetId);
51150
51380
  }
51151
51381
  }
51152
- BottomBarSheet.props = {
51153
- sheetId: String,
51154
- openContextMenu: Function,
51155
- style: { type: String, optional: true },
51156
- onMouseDown: { type: Function, optional: true },
51157
- };
51158
51382
 
51159
51383
  // -----------------------------------------------------------------------------
51160
51384
  // SpreadSheet
@@ -51172,6 +51396,10 @@ css /* scss */ `
51172
51396
  `;
51173
51397
  class BottomBarStatistic extends owl.Component {
51174
51398
  static template = "o-spreadsheet-BottomBarStatisic";
51399
+ static props = {
51400
+ openContextMenu: Function,
51401
+ closeContextMenu: Function,
51402
+ };
51175
51403
  static components = { Ripple };
51176
51404
  selectedStatisticFn = "";
51177
51405
  statisticFnResults = {};
@@ -51218,10 +51446,6 @@ class BottomBarStatistic extends owl.Component {
51218
51446
  return fnName + ": " + (fnValue !== undefined ? formatValue(fnValue, { locale }) : "__");
51219
51447
  }
51220
51448
  }
51221
- BottomBarStatistic.props = {
51222
- openContextMenu: Function,
51223
- closeContextMenu: Function,
51224
- };
51225
51449
 
51226
51450
  // -----------------------------------------------------------------------------
51227
51451
  // SpreadSheet
@@ -51272,6 +51496,9 @@ css /* scss */ `
51272
51496
  `;
51273
51497
  class BottomBar extends owl.Component {
51274
51498
  static template = "o-spreadsheet-BottomBar";
51499
+ static props = {
51500
+ onClick: Function,
51501
+ };
51275
51502
  static components = { Menu, Ripple, BottomBarSheet, BottomBarStatistic };
51276
51503
  bottomBarRef = owl.useRef("bottomBar");
51277
51504
  sheetListRef = owl.useRef("sheetList");
@@ -51457,9 +51684,6 @@ class BottomBar extends owl.Component {
51457
51684
  return this.sheetListRef.el.scrollWidth - this.sheetListRef.el.clientWidth;
51458
51685
  }
51459
51686
  }
51460
- BottomBar.props = {
51461
- onClick: Function,
51462
- };
51463
51687
 
51464
51688
  css /* scss */ `
51465
51689
  .o-dashboard-clickable-cell {
@@ -51470,6 +51694,7 @@ css /* scss */ `
51470
51694
  let tKey = 1;
51471
51695
  class SpreadsheetDashboard extends owl.Component {
51472
51696
  static template = "o-spreadsheet-SpreadsheetDashboard";
51697
+ static props = {};
51473
51698
  static components = {
51474
51699
  GridOverlay,
51475
51700
  GridPopover,
@@ -51588,7 +51813,6 @@ class SpreadsheetDashboard extends owl.Component {
51588
51813
  return { ...this.canvasPosition, ...this.env.model.getters.getSheetViewDimensionWithHeaders() };
51589
51814
  }
51590
51815
  }
51591
- SpreadsheetDashboard.props = {};
51592
51816
 
51593
51817
  css /* scss */ `
51594
51818
  .o-header-group {
@@ -51616,6 +51840,11 @@ css /* scss */ `
51616
51840
  `;
51617
51841
  class AbstractHeaderGroup extends owl.Component {
51618
51842
  static template = "o-spreadsheet-HeaderGroup";
51843
+ static props = {
51844
+ group: Object,
51845
+ layerOffset: Number,
51846
+ openContextMenu: Function,
51847
+ };
51619
51848
  toggleGroup() {
51620
51849
  const sheetId = this.env.model.getters.getActiveSheetId();
51621
51850
  const { start, end } = this.props.group;
@@ -51652,11 +51881,6 @@ class AbstractHeaderGroup extends owl.Component {
51652
51881
  this.props.openContextMenu(position, menuItems);
51653
51882
  }
51654
51883
  }
51655
- AbstractHeaderGroup.props = {
51656
- group: Object,
51657
- layerOffset: Number,
51658
- openContextMenu: Function,
51659
- };
51660
51884
  class RowGroup extends AbstractHeaderGroup {
51661
51885
  dimension = "ROW";
51662
51886
  get groupBorderStyle() {
@@ -51787,6 +52011,10 @@ css /* scss */ `
51787
52011
  `;
51788
52012
  class HeaderGroupContainer extends owl.Component {
51789
52013
  static template = "o-spreadsheet-HeaderGroupContainer";
52014
+ static props = {
52015
+ dimension: String,
52016
+ layers: Array,
52017
+ };
51790
52018
  static components = { RowGroup, ColGroup, Menu };
51791
52019
  menu = owl.useState({ isOpen: false, position: null, menuItems: [] });
51792
52020
  getLayerOffset(layerIndex) {
@@ -51849,10 +52077,6 @@ class HeaderGroupContainer extends owl.Component {
51849
52077
  }
51850
52078
  }
51851
52079
  }
51852
- HeaderGroupContainer.props = {
51853
- dimension: String,
51854
- layers: Array,
51855
- };
51856
52080
 
51857
52081
  css /* scss */ `
51858
52082
  .o-sidePanel {
@@ -51963,14 +52187,6 @@ css /* scss */ `
51963
52187
  text-align: left;
51964
52188
  }
51965
52189
 
51966
- .o-checkbox {
51967
- display: flex;
51968
- justify-items: center;
51969
- input {
51970
- margin-right: 5px;
51971
- }
51972
- }
51973
-
51974
52190
  .o-inflection {
51975
52191
  table {
51976
52192
  table-layout: fixed;
@@ -52011,6 +52227,11 @@ css /* scss */ `
52011
52227
  `;
52012
52228
  class SidePanel extends owl.Component {
52013
52229
  static template = "o-spreadsheet-SidePanel";
52230
+ static props = {
52231
+ component: String,
52232
+ panelProps: { type: Object, optional: true },
52233
+ onCloseSidePanel: Function,
52234
+ };
52014
52235
  state;
52015
52236
  setup() {
52016
52237
  this.state = owl.useState({
@@ -52024,11 +52245,6 @@ class SidePanel extends owl.Component {
52024
52245
  : this.state.panel.title;
52025
52246
  }
52026
52247
  }
52027
- SidePanel.props = {
52028
- component: String,
52029
- panelProps: { type: Object, optional: true },
52030
- onCloseSidePanel: Function,
52031
- };
52032
52248
 
52033
52249
  css /* scss */ `
52034
52250
  .o-menu-item-button {
@@ -52046,6 +52262,13 @@ css /* scss */ `
52046
52262
  `;
52047
52263
  class ActionButton extends owl.Component {
52048
52264
  static template = "o-spreadsheet-ActionButton";
52265
+ static props = {
52266
+ action: Object,
52267
+ hasTriangleDownIcon: { type: Boolean, optional: true },
52268
+ selectedColor: { type: String, optional: true },
52269
+ class: { type: String, optional: true },
52270
+ onClick: { type: Function, optional: true },
52271
+ };
52049
52272
  actionButton = createAction(this.props.action);
52050
52273
  setup() {
52051
52274
  owl.onWillUpdateProps((nextProps) => {
@@ -52088,13 +52311,6 @@ class ActionButton extends owl.Component {
52088
52311
  return "";
52089
52312
  }
52090
52313
  }
52091
- ActionButton.props = {
52092
- action: Object,
52093
- hasTriangleDownIcon: { type: Boolean, optional: true },
52094
- selectedColor: { type: String, optional: true },
52095
- class: { type: String, optional: true },
52096
- onClick: { type: Function, optional: true },
52097
- };
52098
52314
 
52099
52315
  /**
52100
52316
  * List the available borders positions and the corresponding icons.
@@ -52191,6 +52407,17 @@ css /* scss */ `
52191
52407
  `;
52192
52408
  class BorderEditor extends owl.Component {
52193
52409
  static template = "o-spreadsheet-BorderEditor";
52410
+ static props = {
52411
+ class: { type: String, optional: true },
52412
+ currentBorderColor: { type: String, optional: false },
52413
+ currentBorderStyle: { type: String, optional: false },
52414
+ currentBorderPosition: { type: String, optional: true },
52415
+ onBorderColorPicked: Function,
52416
+ onBorderStylePicked: Function,
52417
+ onBorderPositionPicked: Function,
52418
+ maxHeight: { type: Number, optional: true },
52419
+ anchorRect: Object,
52420
+ };
52194
52421
  static components = { ColorPickerWidget, Popover };
52195
52422
  BORDER_POSITIONS = BORDER_POSITIONS;
52196
52423
  lineStyleButtonRef = owl.useRef("lineStyleButton");
@@ -52246,20 +52473,16 @@ class BorderEditor extends owl.Component {
52246
52473
  };
52247
52474
  }
52248
52475
  }
52249
- BorderEditor.props = {
52250
- class: { type: String, optional: true },
52251
- currentBorderColor: { type: String, optional: false },
52252
- currentBorderStyle: { type: String, optional: false },
52253
- currentBorderPosition: { type: String, optional: true },
52254
- onBorderColorPicked: Function,
52255
- onBorderStylePicked: Function,
52256
- onBorderPositionPicked: Function,
52257
- maxHeight: { type: Number, optional: true },
52258
- anchorRect: Object,
52259
- };
52260
52476
 
52261
52477
  class BorderEditorWidget extends owl.Component {
52262
52478
  static template = "o-spreadsheet-BorderEditorWidget";
52479
+ static props = {
52480
+ toggleBorderEditor: Function,
52481
+ showBorderEditor: Boolean,
52482
+ disabled: { type: Boolean, optional: true },
52483
+ dropdownMaxHeight: { type: Number, optional: true },
52484
+ class: { type: String, optional: true },
52485
+ };
52263
52486
  static components = { BorderEditor };
52264
52487
  borderEditorButtonRef = owl.useRef("borderEditorButton");
52265
52488
  state = owl.useState({
@@ -52304,13 +52527,6 @@ class BorderEditorWidget extends owl.Component {
52304
52527
  });
52305
52528
  }
52306
52529
  }
52307
- BorderEditorWidget.props = {
52308
- toggleBorderEditor: Function,
52309
- showBorderEditor: Boolean,
52310
- disabled: { type: Boolean, optional: true },
52311
- dropdownMaxHeight: { type: Number, optional: true },
52312
- class: { type: String, optional: true },
52313
- };
52314
52530
 
52315
52531
  const COMPOSER_MAX_HEIGHT = 100;
52316
52532
  /* svg free of use from https://uxwing.com/formula-fx-icon/ */
@@ -52339,6 +52555,12 @@ css /* scss */ `
52339
52555
  `;
52340
52556
  class TopBarComposer extends owl.Component {
52341
52557
  static template = "o-spreadsheet-TopBarComposer";
52558
+ static props = {
52559
+ focus: {
52560
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
52561
+ },
52562
+ onComposerContentFocused: Function,
52563
+ };
52342
52564
  static components = { Composer };
52343
52565
  get composerStyle() {
52344
52566
  const style = {
@@ -52361,10 +52583,6 @@ class TopBarComposer extends owl.Component {
52361
52583
  });
52362
52584
  }
52363
52585
  }
52364
- TopBarComposer.props = {
52365
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
52366
- onComposerContentFocused: Function,
52367
- };
52368
52586
 
52369
52587
  css /* scss */ `
52370
52588
  .o-font-size-editor {
@@ -52393,6 +52611,11 @@ css /* scss */ `
52393
52611
  `;
52394
52612
  class FontSizeEditor extends owl.Component {
52395
52613
  static template = "o-spreadsheet-FontSizeEditor";
52614
+ static props = {
52615
+ onToggle: Function,
52616
+ dropdownStyle: String,
52617
+ class: String,
52618
+ };
52396
52619
  static components = {};
52397
52620
  fontSizes = FONT_SIZES;
52398
52621
  dropdown = owl.useState({ isOpen: false });
@@ -52449,14 +52672,12 @@ class FontSizeEditor extends owl.Component {
52449
52672
  }
52450
52673
  }
52451
52674
  }
52452
- FontSizeEditor.props = {
52453
- onToggle: Function,
52454
- dropdownStyle: String,
52455
- class: String,
52456
- };
52457
52675
 
52458
52676
  class PaintFormatButton extends owl.Component {
52459
52677
  static template = "o-spreadsheet-PaintFormatButton";
52678
+ static props = {
52679
+ class: { type: String, optional: true },
52680
+ };
52460
52681
  get isActive() {
52461
52682
  return this.env.model.getters.isPaintingFormat();
52462
52683
  }
@@ -52472,9 +52693,6 @@ class PaintFormatButton extends owl.Component {
52472
52693
  }
52473
52694
  }
52474
52695
  }
52475
- PaintFormatButton.props = {
52476
- class: { type: String, optional: true },
52477
- };
52478
52696
 
52479
52697
  // -----------------------------------------------------------------------------
52480
52698
  // TopBar
@@ -52567,6 +52785,12 @@ css /* scss */ `
52567
52785
  `;
52568
52786
  class TopBar extends owl.Component {
52569
52787
  static template = "o-spreadsheet-TopBar";
52788
+ static props = {
52789
+ onClick: Function,
52790
+ focusComposer: String,
52791
+ onComposerContentFocused: Function,
52792
+ dropdownMaxHeight: Number,
52793
+ };
52570
52794
  get dropdownStyle() {
52571
52795
  return `max-height:${this.props.dropdownMaxHeight}px`;
52572
52796
  }
@@ -52683,12 +52907,6 @@ class TopBar extends owl.Component {
52683
52907
  this.onClick();
52684
52908
  }
52685
52909
  }
52686
- TopBar.props = {
52687
- onClick: Function,
52688
- focusComposer: String,
52689
- onComposerContentFocused: Function,
52690
- dropdownMaxHeight: Number,
52691
- };
52692
52910
 
52693
52911
  function instantiateClipboard() {
52694
52912
  return new WebClipboardWrapper(navigator.clipboard);
@@ -52921,6 +53139,9 @@ css /* scss */ `
52921
53139
  `;
52922
53140
  class Spreadsheet extends owl.Component {
52923
53141
  static template = "o-spreadsheet-Spreadsheet";
53142
+ static props = {
53143
+ model: Object,
53144
+ };
52924
53145
  static components = {
52925
53146
  TopBar,
52926
53147
  Grid,
@@ -53133,9 +53354,6 @@ class Spreadsheet extends owl.Component {
53133
53354
  return this.env.model.getters.getVisibleGroupLayers(sheetId, "COL");
53134
53355
  }
53135
53356
  }
53136
- Spreadsheet.props = {
53137
- model: Object,
53138
- };
53139
53357
 
53140
53358
  class LocalTransportService {
53141
53359
  listeners = [];
@@ -56817,6 +57035,6 @@ exports.setTranslationMethod = setTranslationMethod;
56817
57035
  exports.tokenize = tokenize;
56818
57036
 
56819
57037
 
56820
- __info__.version = "17.1.0-alpha.6";
56821
- __info__.date = "2024-01-04T12:22:45.921Z";
56822
- __info__.hash = "56dbdc9";
57038
+ __info__.version = "17.1.0";
57039
+ __info__.date = "2024-01-16T07:47:15.054Z";
57040
+ __info__.hash = "87253c7";