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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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-alpha.7
6
+ * @date 2024-01-12T13:45:00.505Z
7
+ * @hash cbce1ed
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -1201,16 +1201,84 @@
1201
1201
  // -----------------------------------------------------------------------------
1202
1202
  // Date Type
1203
1203
  // -----------------------------------------------------------------------------
1204
+ /**
1205
+ * A DateTime object that can be used to manipulate spreadsheet dates.
1206
+ * Conceptually, a spreadsheet date is simply a number with a date format,
1207
+ * and it is timezone-agnostic.
1208
+ * This DateTime object consistently uses UTC time to represent a naive date and time.
1209
+ */
1210
+ class DateTime {
1211
+ jsDate;
1212
+ constructor(year, month, day, hours = 0, minutes = 0, seconds = 0) {
1213
+ this.jsDate = new Date(Date.UTC(year, month, day, hours, minutes, seconds, 0));
1214
+ }
1215
+ static fromTimestamp(timestamp) {
1216
+ const date = new Date(timestamp);
1217
+ return new DateTime(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
1218
+ }
1219
+ static now() {
1220
+ const now = new Date();
1221
+ return new DateTime(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());
1222
+ }
1223
+ toString() {
1224
+ return this.jsDate.toString();
1225
+ }
1226
+ toLocaleDateString() {
1227
+ return this.jsDate.toLocaleDateString();
1228
+ }
1229
+ getTime() {
1230
+ return this.jsDate.getTime();
1231
+ }
1232
+ getFullYear() {
1233
+ return this.jsDate.getUTCFullYear();
1234
+ }
1235
+ getMonth() {
1236
+ return this.jsDate.getUTCMonth();
1237
+ }
1238
+ getDate() {
1239
+ return this.jsDate.getUTCDate();
1240
+ }
1241
+ getDay() {
1242
+ return this.jsDate.getUTCDay();
1243
+ }
1244
+ getHours() {
1245
+ return this.jsDate.getUTCHours();
1246
+ }
1247
+ getMinutes() {
1248
+ return this.jsDate.getUTCMinutes();
1249
+ }
1250
+ getSeconds() {
1251
+ return this.jsDate.getUTCSeconds();
1252
+ }
1253
+ setFullYear(year) {
1254
+ return this.jsDate.setUTCFullYear(year);
1255
+ }
1256
+ setMonth(month) {
1257
+ return this.jsDate.setUTCMonth(month);
1258
+ }
1259
+ setDate(date) {
1260
+ return this.jsDate.setUTCDate(date);
1261
+ }
1262
+ setHours(hours) {
1263
+ return this.jsDate.setUTCHours(hours);
1264
+ }
1265
+ setMinutes(minutes) {
1266
+ return this.jsDate.setUTCMinutes(minutes);
1267
+ }
1268
+ setSeconds(seconds) {
1269
+ return this.jsDate.setUTCSeconds(seconds);
1270
+ }
1271
+ }
1204
1272
  // -----------------------------------------------------------------------------
1205
1273
  // Parsing
1206
1274
  // -----------------------------------------------------------------------------
1207
- const INITIAL_1900_DAY = new Date(1899, 11, 30);
1275
+ const INITIAL_1900_DAY = new DateTime(1899, 11, 30);
1208
1276
  const MS_PER_DAY = 24 * 60 * 60 * 1000;
1209
1277
  const CURRENT_MILLENIAL = 2000; // note: don't forget to update this in 2999
1210
- const CURRENT_YEAR = new Date().getFullYear();
1211
- const CURRENT_MONTH = new Date().getMonth();
1212
- const INITIAL_JS_DAY = new Date(0);
1213
- const DATE_JS_1900_OFFSET = INITIAL_JS_DAY - INITIAL_1900_DAY;
1278
+ const CURRENT_YEAR = DateTime.now().getFullYear();
1279
+ const CURRENT_MONTH = DateTime.now().getMonth();
1280
+ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
1281
+ const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
1214
1282
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
1215
1283
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
1216
1284
  const dateSeparatorsRegex = /\/|-|\s/;
@@ -1271,7 +1339,7 @@
1271
1339
  return {
1272
1340
  value: date.value + time.value,
1273
1341
  format: date.format + " " + (time.format === "hhhh:mm:ss" ? "hh:mm:ss" : time.format),
1274
- 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()),
1342
+ 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()),
1275
1343
  };
1276
1344
  }
1277
1345
  return date || time;
@@ -1347,12 +1415,12 @@
1347
1415
  // month + 1: months are 0-indexed in JS
1348
1416
  const leadingZero = (monthStr?.length === 2 && month + 1 < 10) || (dayStr?.length === 2 && day < 10);
1349
1417
  const fullYear = yearStr?.length !== 2;
1350
- const jsDate = new Date(year, month, day);
1418
+ const jsDate = new DateTime(year, month, day);
1351
1419
  if (jsDate.getMonth() !== month || jsDate.getDate() !== day) {
1352
1420
  // invalid date
1353
1421
  return null;
1354
1422
  }
1355
- const delta = jsDate - INITIAL_1900_DAY;
1423
+ const delta = jsDate.getTime() - INITIAL_1900_DAY.getTime();
1356
1424
  const format = getFormatFromDateParts(parts, separator, leadingZero, fullYear);
1357
1425
  return {
1358
1426
  value: Math.round(delta / MS_PER_DAY),
@@ -1443,7 +1511,7 @@
1443
1511
  if (hours >= 24) {
1444
1512
  format = "hhhh:mm:ss";
1445
1513
  }
1446
- const jsDate = new Date(1899, 11, 30, hours, minutes, seconds);
1514
+ const jsDate = new DateTime(1899, 11, 30, hours, minutes, seconds);
1447
1515
  return {
1448
1516
  value: hours / 24 + minutes / 1440 + seconds / 86400,
1449
1517
  format: format,
@@ -1457,7 +1525,7 @@
1457
1525
  // -----------------------------------------------------------------------------
1458
1526
  function numberToJsDate(value) {
1459
1527
  const truncValue = Math.trunc(value);
1460
- let date = new Date(truncValue * MS_PER_DAY - DATE_JS_1900_OFFSET);
1528
+ let date = DateTime.fromTimestamp(truncValue * MS_PER_DAY - DATE_JS_1900_OFFSET);
1461
1529
  let time = value - truncValue;
1462
1530
  time = time < 0 ? 1 + time : time;
1463
1531
  const hours = Math.round(time * 24);
@@ -1477,7 +1545,7 @@
1477
1545
  }
1478
1546
  /** Return the number of days in the current month of the given date */
1479
1547
  function getDaysInMonth(date) {
1480
- return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
1548
+ return new DateTime(date.getFullYear(), date.getMonth() + 1, 0).getDate();
1481
1549
  }
1482
1550
  function isLastDayOfMonth(date) {
1483
1551
  return getDaysInMonth(date) === date.getDate();
@@ -1495,7 +1563,7 @@
1495
1563
  const yStart = date.getFullYear();
1496
1564
  const mStart = date.getMonth();
1497
1565
  const dStart = date.getDate();
1498
- const jsDate = new Date(yStart, mStart + months);
1566
+ const jsDate = new DateTime(yStart, mStart + months, 1);
1499
1567
  if (keepEndOfMonth && dStart === getDaysInMonth(date)) {
1500
1568
  jsDate.setDate(getDaysInMonth(jsDate));
1501
1569
  }
@@ -2720,20 +2788,20 @@
2720
2788
  }
2721
2789
 
2722
2790
  function toCriterionDateNumber(dateValue) {
2723
- const today = new Date();
2791
+ const today = DateTime.now();
2724
2792
  switch (dateValue) {
2725
2793
  case "today":
2726
2794
  return jsDateToNumber(today);
2727
2795
  case "yesterday":
2728
- return jsDateToNumber(new Date(today.setDate(today.getDate() - 1)));
2796
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() - 1)));
2729
2797
  case "tomorrow":
2730
- return jsDateToNumber(new Date(today.setDate(today.getDate() + 1)));
2798
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() + 1)));
2731
2799
  case "lastWeek":
2732
- return jsDateToNumber(new Date(today.setDate(today.getDate() - 7)));
2800
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() - 7)));
2733
2801
  case "lastMonth":
2734
- return jsDateToNumber(new Date(today.setMonth(today.getMonth() - 1)));
2802
+ return jsDateToNumber(DateTime.fromTimestamp(today.setMonth(today.getMonth() - 1)));
2735
2803
  case "lastYear":
2736
- return jsDateToNumber(new Date(today.setFullYear(today.getFullYear() - 1)));
2804
+ return jsDateToNumber(DateTime.fromTimestamp(today.setFullYear(today.getFullYear() - 1)));
2737
2805
  }
2738
2806
  }
2739
2807
  /** Get all the dates values of a criterion converted to numbers, converting date values such as "today" to actual dates */
@@ -3094,7 +3162,7 @@
3094
3162
  .map((p) => {
3095
3163
  switch (p) {
3096
3164
  case "hhhh":
3097
- const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY) / (60 * 60 * 1000));
3165
+ const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY.getTime()) / (60 * 60 * 1000));
3098
3166
  return helapsedHours.toString();
3099
3167
  case "hh":
3100
3168
  return hours.toString().padStart(2, "0");
@@ -4662,6 +4730,9 @@
4662
4730
 
4663
4731
  class ChartJsComponent extends owl.Component {
4664
4732
  static template = "o-spreadsheet-ChartJsComponent";
4733
+ static props = {
4734
+ figure: Object,
4735
+ };
4665
4736
  canvas = owl.useRef("graphContainer");
4666
4737
  chart;
4667
4738
  get background() {
@@ -4714,9 +4785,6 @@
4714
4785
  this.chart.update("active");
4715
4786
  }
4716
4787
  }
4717
- ChartJsComponent.props = {
4718
- figure: Object,
4719
- };
4720
4788
 
4721
4789
  /**
4722
4790
  * AbstractChart is the class from which every Chart should inherit.
@@ -5567,6 +5635,9 @@
5567
5635
 
5568
5636
  class ScorecardChart extends owl.Component {
5569
5637
  static template = "o-spreadsheet-ScorecardChart";
5638
+ static props = {
5639
+ figure: Object,
5640
+ };
5570
5641
  canvas = owl.useRef("chartContainer");
5571
5642
  get runtime() {
5572
5643
  return this.env.model.getters.getChartRuntime(this.props.figure.id);
@@ -5584,9 +5655,6 @@
5584
5655
  drawScoreChart(config, canvas);
5585
5656
  }
5586
5657
  }
5587
- ScorecardChart.props = {
5588
- figure: Object,
5589
- };
5590
5658
 
5591
5659
  /**
5592
5660
  * Registry
@@ -6265,11 +6333,11 @@
6265
6333
  class ErrorToolTip extends owl.Component {
6266
6334
  static maxSize = { maxHeight: ERROR_TOOLTIP_MAX_HEIGHT };
6267
6335
  static template = "o-spreadsheet-ErrorToolTip";
6336
+ static props = {
6337
+ errors: Array,
6338
+ onClosed: { type: Function, optional: true },
6339
+ };
6268
6340
  }
6269
- ErrorToolTip.props = {
6270
- errors: Array,
6271
- onClosed: { type: Function, optional: true },
6272
- };
6273
6341
  const ErrorToolTipPopoverBuilder = {
6274
6342
  onHover: (position, getters) => {
6275
6343
  const cell = getters.getEvaluatedCell(position);
@@ -6311,6 +6379,14 @@
6311
6379
  `;
6312
6380
  class FilterMenuValueItem extends owl.Component {
6313
6381
  static template = "o-spreadsheet-FilterMenuValueItem";
6382
+ static props = {
6383
+ value: String,
6384
+ isChecked: Boolean,
6385
+ isSelected: Boolean,
6386
+ onMouseMove: Function,
6387
+ onClick: Function,
6388
+ scrolledTo: { type: String, optional: true },
6389
+ };
6314
6390
  itemRef = owl.useRef("menuValueItem");
6315
6391
  setup() {
6316
6392
  owl.onWillPatch(() => {
@@ -6328,17 +6404,9 @@
6328
6404
  });
6329
6405
  }
6330
6406
  }
6331
- FilterMenuValueItem.props = {
6332
- value: String,
6333
- isChecked: Boolean,
6334
- isSelected: Boolean,
6335
- onMouseMove: Function,
6336
- onClick: Function,
6337
- scrolledTo: { type: String, optional: true },
6338
- };
6339
6407
 
6340
6408
  const FILTER_MENU_HEIGHT = 295;
6341
- const CSS$2 = css /* scss */ `
6409
+ const CSS = css /* scss */ `
6342
6410
  .o-filter-menu {
6343
6411
  box-sizing: border-box;
6344
6412
  padding: 8px 16px;
@@ -6434,9 +6502,12 @@
6434
6502
  }
6435
6503
  `;
6436
6504
  class FilterMenu extends owl.Component {
6437
- static size = { width: MENU_WIDTH, height: FILTER_MENU_HEIGHT };
6438
6505
  static template = "o-spreadsheet-FilterMenu";
6439
- static style = CSS$2;
6506
+ static props = {
6507
+ filterPosition: Object,
6508
+ onClosed: { type: Function, optional: true },
6509
+ };
6510
+ static style = CSS;
6440
6511
  static components = { FilterMenuValueItem };
6441
6512
  state = owl.useState({
6442
6513
  values: [],
@@ -6588,10 +6659,6 @@
6588
6659
  this.props.onClosed?.();
6589
6660
  }
6590
6661
  }
6591
- FilterMenu.props = {
6592
- filterPosition: Object,
6593
- onClosed: { type: Function, optional: true },
6594
- };
6595
6662
  const FilterMenuPopoverBuilder = {
6596
6663
  onOpen: (position, getters) => {
6597
6664
  return {
@@ -6793,6 +6860,19 @@
6793
6860
  `;
6794
6861
  class Popover extends owl.Component {
6795
6862
  static template = "o-spreadsheet-Popover";
6863
+ static props = {
6864
+ anchorRect: Object,
6865
+ containerRect: { type: Object, optional: true },
6866
+ positioning: { type: String, optional: true },
6867
+ maxWidth: { type: Number, optional: true },
6868
+ maxHeight: { type: Number, optional: true },
6869
+ verticalOffset: { type: Number, optional: true },
6870
+ onMouseWheel: { type: Function, optional: true },
6871
+ onPopoverHidden: { type: Function, optional: true },
6872
+ onPopoverMoved: { type: Function, optional: true },
6873
+ zIndex: { type: Number, optional: true },
6874
+ slots: Object,
6875
+ };
6796
6876
  static defaultProps = {
6797
6877
  positioning: "BottomLeft",
6798
6878
  verticalOffset: 0,
@@ -6849,19 +6929,6 @@
6849
6929
  });
6850
6930
  }
6851
6931
  }
6852
- Popover.props = {
6853
- anchorRect: Object,
6854
- containerRect: { type: Object, optional: true },
6855
- positioning: { type: String, optional: true },
6856
- maxWidth: { type: Number, optional: true },
6857
- maxHeight: { type: Number, optional: true },
6858
- verticalOffset: { type: Number, optional: true },
6859
- onMouseWheel: { type: Function, optional: true },
6860
- onPopoverHidden: { type: Function, optional: true },
6861
- onPopoverMoved: { type: Function, optional: true },
6862
- zIndex: { type: Number, optional: true },
6863
- slots: Object,
6864
- };
6865
6932
  class PopoverPositionContext {
6866
6933
  anchorRect;
6867
6934
  containerRect;
@@ -7043,6 +7110,15 @@
7043
7110
  `;
7044
7111
  class Menu extends owl.Component {
7045
7112
  static template = "o-spreadsheet-Menu";
7113
+ static props = {
7114
+ position: Object,
7115
+ menuItems: Array,
7116
+ depth: { type: Number, optional: true },
7117
+ maxHeight: { type: Number, optional: true },
7118
+ onClose: Function,
7119
+ onMenuClicked: { type: Function, optional: true },
7120
+ menuId: { type: String, optional: true },
7121
+ };
7046
7122
  static components = { Menu, Popover };
7047
7123
  static defaultProps = {
7048
7124
  depth: 1,
@@ -7199,15 +7275,6 @@
7199
7275
  }
7200
7276
  }
7201
7277
  }
7202
- Menu.props = {
7203
- position: Object,
7204
- menuItems: Array,
7205
- depth: { type: Number, optional: true },
7206
- maxHeight: { type: Number, optional: true },
7207
- onClose: Function,
7208
- onMenuClicked: { type: Function, optional: true },
7209
- menuId: { type: String, optional: true },
7210
- };
7211
7278
 
7212
7279
  const LINK_TOOLTIP_HEIGHT = 32;
7213
7280
  const LINK_TOOLTIP_WIDTH = 220;
@@ -7260,8 +7327,12 @@
7260
7327
  }
7261
7328
  `;
7262
7329
  class LinkDisplay extends owl.Component {
7263
- static components = { Menu };
7264
7330
  static template = "o-spreadsheet-LinkDisplay";
7331
+ static props = {
7332
+ cellPosition: Object,
7333
+ onClosed: { type: Function, optional: true },
7334
+ };
7335
+ static components = { Menu };
7265
7336
  get cell() {
7266
7337
  const { col, row } = this.props.cellPosition;
7267
7338
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -7316,10 +7387,6 @@
7316
7387
  };
7317
7388
  },
7318
7389
  };
7319
- LinkDisplay.props = {
7320
- cellPosition: Object,
7321
- onClosed: { type: Function, optional: true },
7322
- };
7323
7390
 
7324
7391
  /**
7325
7392
  * Tokenizer
@@ -7953,6 +8020,10 @@
7953
8020
  `;
7954
8021
  class LinkEditor extends owl.Component {
7955
8022
  static template = "o-spreadsheet-LinkEditor";
8023
+ static props = {
8024
+ cellPosition: Object,
8025
+ onClosed: { type: Function, optional: true },
8026
+ };
7956
8027
  static components = { Menu };
7957
8028
  menuItems = linkMenuRegistry.getMenuItems();
7958
8029
  link = owl.useState(this.defaultState);
@@ -8050,10 +8121,6 @@
8050
8121
  };
8051
8122
  },
8052
8123
  };
8053
- LinkEditor.props = {
8054
- cellPosition: Object,
8055
- onClosed: { type: Function, optional: true },
8056
- };
8057
8124
 
8058
8125
  const cellPopoverRegistry = new Registry();
8059
8126
  cellPopoverRegistry
@@ -8336,6 +8403,7 @@
8336
8403
  labels: labels.map(truncateLabel),
8337
8404
  datasets: [],
8338
8405
  },
8406
+ platform: undefined,
8339
8407
  plugins: [],
8340
8408
  };
8341
8409
  }
@@ -9640,6 +9708,10 @@
9640
9708
  `;
9641
9709
  class ChartFigure extends owl.Component {
9642
9710
  static template = "o-spreadsheet-ChartFigure";
9711
+ static props = {
9712
+ figure: Object,
9713
+ onFigureDeleted: Function,
9714
+ };
9643
9715
  static components = {};
9644
9716
  onDoubleClick() {
9645
9717
  this.env.model.dispatch("SELECT_FIGURE", { id: this.props.figure.id });
@@ -9657,13 +9729,13 @@
9657
9729
  return component;
9658
9730
  }
9659
9731
  }
9660
- ChartFigure.props = {
9661
- figure: Object,
9662
- onFigureDeleted: Function,
9663
- };
9664
9732
 
9665
9733
  class ImageFigure extends owl.Component {
9666
9734
  static template = "o-spreadsheet-ImageFigure";
9735
+ static props = {
9736
+ figure: Object,
9737
+ onFigureDeleted: Function,
9738
+ };
9667
9739
  static components = {};
9668
9740
  // ---------------------------------------------------------------------------
9669
9741
  // Getters
@@ -9675,10 +9747,6 @@
9675
9747
  return this.env.model.getters.getImagePath(this.figureId);
9676
9748
  }
9677
9749
  }
9678
- ImageFigure.props = {
9679
- figure: Object,
9680
- onFigureDeleted: Function,
9681
- };
9682
9750
 
9683
9751
  function centerFigurePosition(getters, size) {
9684
9752
  const { x: offsetCorrectionX, y: offsetCorrectionY } = getters.getMainViewportCoordinates();
@@ -10966,6 +11034,9 @@
10966
11034
  function makeArg(str, description) {
10967
11035
  let parts = str.match(ARG_REGEXP);
10968
11036
  let name = parts[1].trim();
11037
+ if (!name) {
11038
+ throw new Error(`Function argument definition is missing a name: '${str}'.`);
11039
+ }
10969
11040
  let types = [];
10970
11041
  let isOptional = false;
10971
11042
  let isRepeating = false;
@@ -14688,7 +14759,7 @@
14688
14759
  if (_year < 1900) {
14689
14760
  _year += 1900;
14690
14761
  }
14691
- const jsDate = new Date(_year, _month - 1, _day);
14762
+ const jsDate = new DateTime(_year, _month - 1, _day);
14692
14763
  const result = jsDateToRoundNumber(jsDate);
14693
14764
  assert(() => result >= 0, _t("The function [[FUNCTION_NAME]] result must be greater than or equal 01/01/1900."));
14694
14765
  return result;
@@ -14731,7 +14802,7 @@
14731
14802
  // See: https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c
14732
14803
  let days = jsEndDate.getDate() - jsStartDate.getDate();
14733
14804
  if (days < 0) {
14734
- const monthBeforeEndMonth = new Date(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
14805
+ const monthBeforeEndMonth = new DateTime(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
14735
14806
  const daysInMonthBeforeEndMonth = getDaysInMonth(monthBeforeEndMonth);
14736
14807
  days = daysInMonthBeforeEndMonth - Math.abs(days);
14737
14808
  }
@@ -14740,7 +14811,7 @@
14740
14811
  if (areTwoDatesWithinOneYear(_startDate, _endDate)) {
14741
14812
  return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
14742
14813
  }
14743
- const endDateWithinOneYear = new Date(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
14814
+ const endDateWithinOneYear = new DateTime(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
14744
14815
  let days = getTimeDifferenceInWholeDays(jsStartDate, endDateWithinOneYear);
14745
14816
  if (days < 0) {
14746
14817
  endDateWithinOneYear.setFullYear(jsStartDate.getFullYear() + 1);
@@ -14857,7 +14928,7 @@
14857
14928
  const _months = Math.trunc(toNumber(months, this.locale));
14858
14929
  const yStart = _startDate.getFullYear();
14859
14930
  const mStart = _startDate.getMonth();
14860
- const jsDate = new Date(yStart, mStart + _months + 1, 0);
14931
+ const jsDate = new DateTime(yStart, mStart + _months + 1, 0);
14861
14932
  return jsDateToRoundNumber(jsDate);
14862
14933
  },
14863
14934
  isExported: true,
@@ -14894,17 +14965,17 @@
14894
14965
  // The first week of the year is the week that contains the first
14895
14966
  // Thursday of the year.
14896
14967
  let firstThursday = 1;
14897
- while (new Date(y, 0, firstThursday).getDay() !== 4) {
14968
+ while (new DateTime(y, 0, firstThursday).getDay() !== 4) {
14898
14969
  firstThursday += 1;
14899
14970
  }
14900
- const firstDayOfFirstWeek = new Date(y, 0, firstThursday - 3);
14971
+ const firstDayOfFirstWeek = new DateTime(y, 0, firstThursday - 3);
14901
14972
  // The last week of the year is the week that contains the last Thursday of
14902
14973
  // the year.
14903
14974
  let lastThursday = 31;
14904
- while (new Date(y, 11, lastThursday).getDay() !== 4) {
14975
+ while (new DateTime(y, 11, lastThursday).getDay() !== 4) {
14905
14976
  lastThursday -= 1;
14906
14977
  }
14907
- const lastDayOfLastWeek = new Date(y, 11, lastThursday + 3);
14978
+ const lastDayOfLastWeek = new DateTime(y, 11, lastThursday + 3);
14908
14979
  // B - If our date > lastDayOfLastWeek then it's in the weeks of the year after
14909
14980
  // If our date < firstDayOfFirstWeek then it's in the weeks of the year before
14910
14981
  let offsetYear;
@@ -14930,17 +15001,17 @@
14930
15001
  case 1:
14931
15002
  // firstDay is the 1st day of the 1st week of the year after
14932
15003
  // firstDay = lastDayOfLastWeek + 1 Day
14933
- firstDay = new Date(y, 11, lastThursday + 3 + 1);
15004
+ firstDay = new DateTime(y, 11, lastThursday + 3 + 1);
14934
15005
  break;
14935
15006
  case -1:
14936
15007
  // firstDay is the 1st day of the 1st week of the previous year.
14937
15008
  // The first week of the previous year is the week that contains the
14938
15009
  // first Thursday of the previous year.
14939
15010
  let firstThursdayPreviousYear = 1;
14940
- while (new Date(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
15011
+ while (new DateTime(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
14941
15012
  firstThursdayPreviousYear += 1;
14942
15013
  }
14943
- firstDay = new Date(y - 1, 0, firstThursdayPreviousYear - 3);
15014
+ firstDay = new DateTime(y - 1, 0, firstThursdayPreviousYear - 3);
14944
15015
  break;
14945
15016
  }
14946
15017
  const diff = (_date.getTime() - firstDay.getTime()) / MS_PER_DAY;
@@ -15075,8 +15146,8 @@
15075
15146
  });
15076
15147
  }
15077
15148
  const invertDate = _startDate.getTime() > _endDate.getTime();
15078
- const stopDate = new Date((invertDate ? _startDate : _endDate).getTime());
15079
- let stepDate = new Date((invertDate ? _endDate : _startDate).getTime());
15149
+ const stopDate = DateTime.fromTimestamp((invertDate ? _startDate : _endDate).getTime());
15150
+ let stepDate = DateTime.fromTimestamp((invertDate ? _endDate : _startDate).getTime());
15080
15151
  const timeStopDate = stopDate.getTime();
15081
15152
  let timeStepDate = stepDate.getTime();
15082
15153
  let netWorkingDay = 0;
@@ -15102,8 +15173,7 @@
15102
15173
  return getDateTimeFormat(this.locale);
15103
15174
  },
15104
15175
  compute: function () {
15105
- let today = new Date();
15106
- today.setMilliseconds(0);
15176
+ let today = DateTime.now();
15107
15177
  const delta = today.getTime() - INITIAL_1900_DAY.getTime();
15108
15178
  const time = today.getHours() / 24 + today.getMinutes() / 1440 + today.getSeconds() / 86400;
15109
15179
  return Math.floor(delta / MS_PER_DAY) + time;
@@ -15177,8 +15247,8 @@
15177
15247
  return this.locale.dateFormat;
15178
15248
  },
15179
15249
  compute: function () {
15180
- const today = new Date();
15181
- const jsDate = new Date(today.getFullYear(), today.getMonth(), today.getDate());
15250
+ const today = DateTime.now();
15251
+ const jsDate = new DateTime(today.getFullYear(), today.getMonth(), today.getDate());
15182
15252
  return jsDateToRoundNumber(jsDate);
15183
15253
  },
15184
15254
  isExported: true,
@@ -15233,10 +15303,10 @@
15233
15303
  }
15234
15304
  const y = _date.getFullYear();
15235
15305
  let dayStart = 1;
15236
- let startDayOfFirstWeek = new Date(y, 0, dayStart);
15306
+ let startDayOfFirstWeek = new DateTime(y, 0, dayStart);
15237
15307
  while (startDayOfFirstWeek.getDay() !== startDayOfWeek) {
15238
15308
  dayStart += 1;
15239
- startDayOfFirstWeek = new Date(y, 0, dayStart);
15309
+ startDayOfFirstWeek = new DateTime(y, 0, dayStart);
15240
15310
  }
15241
15311
  const dif = (_date.getTime() - startDayOfFirstWeek.getTime()) / MS_PER_DAY;
15242
15312
  if (dif < 0) {
@@ -15294,7 +15364,7 @@
15294
15364
  timesHoliday.add(holiday.getTime());
15295
15365
  });
15296
15366
  }
15297
- let stepDate = new Date(_startDate.getTime());
15367
+ let stepDate = DateTime.fromTimestamp(_startDate.getTime());
15298
15368
  let timeStepDate = stepDate.getTime();
15299
15369
  const unitDay = Math.sign(_numDays);
15300
15370
  let stepDay = Math.abs(_numDays);
@@ -15358,7 +15428,7 @@
15358
15428
  const _startDate = toJsDate(date, this.locale);
15359
15429
  const yStart = _startDate.getFullYear();
15360
15430
  const mStart = _startDate.getMonth();
15361
- const jsDate = new Date(yStart, mStart, 1);
15431
+ const jsDate = new DateTime(yStart, mStart, 1);
15362
15432
  return jsDateToRoundNumber(jsDate);
15363
15433
  },
15364
15434
  };
@@ -15400,7 +15470,7 @@
15400
15470
  compute: function (date) {
15401
15471
  const quarter = QUARTER.compute.bind(this)(date);
15402
15472
  const year = YEAR.compute.bind(this)(date);
15403
- const jsDate = new Date(year, (quarter - 1) * 3, 1);
15473
+ const jsDate = new DateTime(year, (quarter - 1) * 3, 1);
15404
15474
  return jsDateToRoundNumber(jsDate);
15405
15475
  },
15406
15476
  };
@@ -15417,7 +15487,7 @@
15417
15487
  compute: function (date) {
15418
15488
  const quarter = QUARTER.compute.bind(this)(date);
15419
15489
  const year = YEAR.compute.bind(this)(date);
15420
- const jsDate = new Date(year, quarter * 3, 0);
15490
+ const jsDate = new DateTime(year, quarter * 3, 0);
15421
15491
  return jsDateToRoundNumber(jsDate);
15422
15492
  },
15423
15493
  };
@@ -15433,7 +15503,7 @@
15433
15503
  },
15434
15504
  compute: function (date) {
15435
15505
  const year = YEAR.compute.bind(this)(date);
15436
- const jsDate = new Date(year, 0, 1);
15506
+ const jsDate = new DateTime(year, 0, 1);
15437
15507
  return jsDateToRoundNumber(jsDate);
15438
15508
  },
15439
15509
  };
@@ -15449,7 +15519,7 @@
15449
15519
  },
15450
15520
  compute: function (date) {
15451
15521
  const year = YEAR.compute.bind(this)(date);
15452
- const jsDate = new Date(year + 1, 0, 0);
15522
+ const jsDate = new DateTime(year + 1, 0, 0);
15453
15523
  return jsDateToRoundNumber(jsDate);
15454
15524
  },
15455
15525
  };
@@ -15497,8 +15567,8 @@
15497
15567
  const DELTA = {
15498
15568
  description: _t("Compare two numeric values, returning 1 if they're equal."),
15499
15569
  args: [
15500
- arg(" (number)", _t("The first number to compare.")),
15501
- arg(` (number, default=${DEFAULT_DELTA_ARG})`, _t("The second number to compare.")),
15570
+ arg("number1 (number)", _t("The first number to compare.")),
15571
+ arg(`number2 (number, default=${DEFAULT_DELTA_ARG})`, _t("The second number to compare.")),
15502
15572
  ],
15503
15573
  returns: ["NUMBER"],
15504
15574
  compute: function (number1, number2 = DEFAULT_DELTA_ARG) {
@@ -15925,7 +15995,7 @@
15925
15995
  function assertSettlementLessThanOneYearBeforeMaturity(settlement, maturity, locale) {
15926
15996
  const startDate = toJsDate(settlement, locale);
15927
15997
  const endDate = toJsDate(maturity, locale);
15928
- const startDatePlusOneYear = new Date(startDate);
15998
+ const startDatePlusOneYear = toJsDate(settlement, locale);
15929
15999
  startDatePlusOneYear.setFullYear(startDate.getFullYear() + 1);
15930
16000
  assert(() => endDate.getTime() <= startDatePlusOneYear.getTime(), _t("The settlement date (%s) must at most one year after the maturity date (%s).", settlement.toString(), maturity.toString()));
15931
16001
  }
@@ -16060,7 +16130,7 @@
16060
16130
  arg("salvage (number)", _t("The value of the asset at the end of depreciation.")),
16061
16131
  arg("period (number)", _t("The single period within life for which to calculate depreciation.")),
16062
16132
  arg("rate (number)", _t("The deprecation rate.")),
16063
- arg(" (number, optional)", _t("An indicator of what day count method to use.")),
16133
+ arg("day_count_convention (number, optional)", _t("An indicator of what day count method to use.")),
16064
16134
  ],
16065
16135
  returns: ["NUMBER"],
16066
16136
  compute: function (cost, purchaseDate, firstPeriodEnd, salvage, period, rate, dayCountConvention = DEFAULT_DAY_COUNT_CONVENTION) {
@@ -19232,8 +19302,8 @@
19232
19302
  description: _t("A segment of a string."),
19233
19303
  args: [
19234
19304
  arg("text (string)", _t("The string to extract a segment from.")),
19235
- arg(" (number)", _t("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),
19236
- arg(" (number)", _t("The length of the segment to extract.")),
19305
+ 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.")),
19306
+ arg("extract_length (number)", _t("The length of the segment to extract.")),
19237
19307
  ],
19238
19308
  returns: ["STRING"],
19239
19309
  compute: function (text, starting_at, extract_length) {
@@ -21516,6 +21586,15 @@
21516
21586
  */
21517
21587
  class SelectionInput extends owl.Component {
21518
21588
  static template = "o-spreadsheet-SelectionInput";
21589
+ static props = {
21590
+ ranges: Function,
21591
+ hasSingleRange: { type: Boolean, optional: true },
21592
+ required: { type: Boolean, optional: true },
21593
+ isInvalid: { type: Boolean, optional: true },
21594
+ class: { type: String, optional: true },
21595
+ onSelectionChanged: { type: Function, optional: true },
21596
+ onSelectionConfirmed: { type: Function, optional: true },
21597
+ };
21519
21598
  id = uuidGenerator$1.uuidv4();
21520
21599
  previousRanges = this.props.ranges() || [];
21521
21600
  originSheet = this.env.model.getters.getActiveSheetId();
@@ -21678,15 +21757,6 @@
21678
21757
  this.env.model.dispatch("UNFOCUS_SELECTION_INPUT");
21679
21758
  }
21680
21759
  }
21681
- SelectionInput.props = {
21682
- ranges: Function,
21683
- hasSingleRange: { type: Boolean, optional: true },
21684
- required: { type: Boolean, optional: true },
21685
- isInvalid: { type: Boolean, optional: true },
21686
- class: { type: String, optional: true },
21687
- onSelectionChanged: { type: Function, optional: true },
21688
- onSelectionConfirmed: { type: Function, optional: true },
21689
- };
21690
21760
 
21691
21761
  css /* scss */ `
21692
21762
  .o-validation-error,
@@ -21702,6 +21772,10 @@
21702
21772
  `;
21703
21773
  class ValidationMessages extends owl.Component {
21704
21774
  static template = "o-spreadsheet-ValidationMessages";
21775
+ static props = {
21776
+ messages: Array,
21777
+ msgType: String,
21778
+ };
21705
21779
  get divClasses() {
21706
21780
  if (this.props.msgType === "warning") {
21707
21781
  return "o-validation-warning text-warning";
@@ -21709,14 +21783,96 @@
21709
21783
  return "o-validation-error text-danger";
21710
21784
  }
21711
21785
  }
21712
- ValidationMessages.props = {
21713
- messages: Array,
21714
- msgType: String,
21715
- };
21786
+
21787
+ css /* scss */ `
21788
+ .o-checkbox {
21789
+ display: flex;
21790
+ justify-items: center;
21791
+ input {
21792
+ margin-right: 5px;
21793
+ }
21794
+ }
21795
+ `;
21796
+ class Checkbox extends owl.Component {
21797
+ static template = "o-spreadsheet.Checkbox";
21798
+ static props = {
21799
+ label: { type: String, optional: true },
21800
+ value: { type: Boolean, optional: true },
21801
+ className: { type: String, optional: true },
21802
+ name: { type: String, optional: true },
21803
+ onChange: Function,
21804
+ };
21805
+ static defaultProps = { value: false };
21806
+ onChange(ev) {
21807
+ const value = ev.target.checked;
21808
+ this.props.onChange(value);
21809
+ }
21810
+ }
21811
+
21812
+ class Section extends owl.Component {
21813
+ static template = "o_spreadsheet.Section";
21814
+ static props = {
21815
+ class: { type: String, optional: true },
21816
+ slots: Object,
21817
+ };
21818
+ }
21819
+
21820
+ class ChartDataSeries extends owl.Component {
21821
+ static template = "o-spreadsheet.ChartDataSeries";
21822
+ static components = { SelectionInput, Section };
21823
+ static props = {
21824
+ ranges: Function,
21825
+ hasSingleRange: { type: Boolean, optional: true },
21826
+ onSelectionChanged: Function,
21827
+ onSelectionConfirmed: Function,
21828
+ };
21829
+ get title() {
21830
+ return this.props.hasSingleRange ? _t("Data range") : _t("Data series");
21831
+ }
21832
+ }
21833
+
21834
+ class ChartErrorSection extends owl.Component {
21835
+ static template = "o-spreadsheet.ChartErrorSection";
21836
+ static components = { Section, ValidationMessages };
21837
+ static props = { messages: { type: Array, element: String } };
21838
+ }
21839
+
21840
+ class ChartLabelRange extends owl.Component {
21841
+ static template = "o-spreadsheet.ChartLabelRange";
21842
+ static components = { SelectionInput, Checkbox, Section };
21843
+ static props = {
21844
+ title: { type: String, optional: true },
21845
+ range: Function,
21846
+ isInvalid: Boolean,
21847
+ required: { type: Boolean, optional: true },
21848
+ onSelectionChanged: Function,
21849
+ onSelectionConfirmed: Function,
21850
+ options: { type: Array, optional: true },
21851
+ };
21852
+ static defaultProps = {
21853
+ title: _t("Categories / Labels"),
21854
+ options: [],
21855
+ required: false,
21856
+ };
21857
+ }
21716
21858
 
21717
21859
  class LineBarPieConfigPanel extends owl.Component {
21718
21860
  static template = "o-spreadsheet-LineBarPieConfigPanel";
21719
- static components = { SelectionInput, ValidationMessages };
21861
+ static components = {
21862
+ SelectionInput,
21863
+ ValidationMessages,
21864
+ ChartDataSeries,
21865
+ ChartLabelRange,
21866
+ Section,
21867
+ Checkbox,
21868
+ ChartErrorSection,
21869
+ };
21870
+ static props = {
21871
+ figureId: String,
21872
+ definition: Object,
21873
+ updateChart: Function,
21874
+ canUpdateChart: Function,
21875
+ };
21720
21876
  state = owl.useState({
21721
21877
  datasetDispatchResult: undefined,
21722
21878
  labelsDispatchResult: undefined,
@@ -21740,9 +21896,22 @@
21740
21896
  get isLabelInvalid() {
21741
21897
  return !!this.state.labelsDispatchResult?.isCancelledBecause("InvalidLabelRange" /* CommandResult.InvalidLabelRange */);
21742
21898
  }
21743
- onUpdateDataSetsHaveTitle(ev) {
21899
+ get dataSetsHaveTitleLabel() {
21900
+ return _t("Use row %s as headers", this.calculateHeaderPosition() || "");
21901
+ }
21902
+ getLabelRangeOptions() {
21903
+ return [
21904
+ {
21905
+ name: "aggregated",
21906
+ label: _t("Aggregate"),
21907
+ value: this.props.definition.aggregated,
21908
+ onChange: this.onUpdateAggregated.bind(this),
21909
+ },
21910
+ ];
21911
+ }
21912
+ onUpdateDataSetsHaveTitle(dataSetsHaveTitle) {
21744
21913
  this.props.updateChart(this.props.figureId, {
21745
- dataSetsHaveTitle: ev.target.checked,
21914
+ dataSetsHaveTitle,
21746
21915
  });
21747
21916
  }
21748
21917
  /**
@@ -21782,9 +21951,9 @@
21782
21951
  getLabelRange() {
21783
21952
  return this.labelRange || "";
21784
21953
  }
21785
- onUpdateAggregated(ev) {
21954
+ onUpdateAggregated(aggregated) {
21786
21955
  this.props.updateChart(this.props.figureId, {
21787
- aggregated: ev.target.checked,
21956
+ aggregated,
21788
21957
  });
21789
21958
  }
21790
21959
  calculateHeaderPosition() {
@@ -21804,23 +21973,20 @@
21804
21973
  return undefined;
21805
21974
  }
21806
21975
  }
21807
- LineBarPieConfigPanel.props = {
21808
- figureId: String,
21809
- definition: Object,
21810
- updateChart: Function,
21811
- canUpdateChart: Function,
21812
- };
21813
21976
 
21814
21977
  class BarConfigPanel extends LineBarPieConfigPanel {
21815
21978
  static template = "o-spreadsheet-BarConfigPanel";
21816
- onUpdateStacked(ev) {
21979
+ get stackedLabel() {
21980
+ return _t("Stacked barchart");
21981
+ }
21982
+ onUpdateStacked(stacked) {
21817
21983
  this.props.updateChart(this.props.figureId, {
21818
- stacked: ev.target.checked,
21984
+ stacked,
21819
21985
  });
21820
21986
  }
21821
- onUpdateAggregated(ev) {
21987
+ onUpdateAggregated(aggregated) {
21822
21988
  this.props.updateChart(this.props.figureId, {
21823
- aggregated: ev.target.checked,
21989
+ aggregated,
21824
21990
  });
21825
21991
  }
21826
21992
  }
@@ -22148,6 +22314,12 @@
22148
22314
  `;
22149
22315
  class ColorPicker extends owl.Component {
22150
22316
  static template = "o-spreadsheet-ColorPicker";
22317
+ static props = {
22318
+ onColorPicked: Function,
22319
+ currentColor: { type: String, optional: true },
22320
+ maxHeight: { type: Number, optional: true },
22321
+ anchorRect: Object,
22322
+ };
22151
22323
  static defaultProps = { currentColor: "" };
22152
22324
  static components = { Popover };
22153
22325
  COLORS = COLOR_PICKER_DEFAULTS;
@@ -22283,12 +22455,6 @@
22283
22455
  return isSameColor(color1, color2);
22284
22456
  }
22285
22457
  }
22286
- ColorPicker.props = {
22287
- onColorPicked: Function,
22288
- currentColor: { type: String, optional: true },
22289
- maxHeight: { type: Number, optional: true },
22290
- anchorRect: Object,
22291
- };
22292
22458
 
22293
22459
  css /* scss */ `
22294
22460
  .o-color-picker-widget {
@@ -22326,6 +22492,17 @@
22326
22492
  `;
22327
22493
  class ColorPickerWidget extends owl.Component {
22328
22494
  static template = "o-spreadsheet-ColorPickerWidget";
22495
+ static props = {
22496
+ currentColor: { type: String, optional: true },
22497
+ toggleColorPicker: Function,
22498
+ showColorPicker: Boolean,
22499
+ onColorPicked: Function,
22500
+ icon: String,
22501
+ title: { type: String, optional: true },
22502
+ disabled: { type: Boolean, optional: true },
22503
+ dropdownMaxHeight: { type: Number, optional: true },
22504
+ class: { type: String, optional: true },
22505
+ };
22329
22506
  static components = { ColorPicker };
22330
22507
  colorPickerButtonRef = owl.useRef("colorPickerButton");
22331
22508
  get iconStyle() {
@@ -22344,44 +22521,55 @@
22344
22521
  };
22345
22522
  }
22346
22523
  }
22347
- ColorPickerWidget.props = {
22348
- currentColor: { type: String, optional: true },
22349
- toggleColorPicker: Function,
22350
- showColorPicker: Boolean,
22351
- onColorPicked: Function,
22352
- icon: String,
22353
- title: { type: String, optional: true },
22354
- disabled: { type: Boolean, optional: true },
22355
- dropdownMaxHeight: { type: Number, optional: true },
22356
- class: { type: String, optional: true },
22357
- };
22358
22524
 
22359
- class LineBarPieDesignPanel extends owl.Component {
22360
- static template = "o-spreadsheet-LineBarPieDesignPanel";
22361
- static components = { ColorPickerWidget };
22362
- state = owl.useState({
22363
- title: "",
22364
- fillColorTool: false,
22365
- });
22366
- onClick(ev) {
22367
- this.state.fillColorTool = false;
22368
- }
22525
+ class ChartColor extends owl.Component {
22526
+ static template = "o-spreadsheet.ChartColor";
22527
+ static components = { ColorPickerWidget, Section };
22528
+ static props = {
22529
+ currentColor: { type: String, optional: true },
22530
+ onColorPicked: Function,
22531
+ };
22532
+ state;
22369
22533
  setup() {
22370
- this.state.title = _t(this.props.definition.title);
22371
- owl.useExternalListener(window, "click", this.onClick);
22534
+ this.state = owl.useState({ pickerOpened: false });
22535
+ owl.useExternalListener(window, "click", this.closePicker);
22372
22536
  }
22373
- toggleColorPicker() {
22374
- this.state.fillColorTool = !this.state.fillColorTool;
22537
+ closePicker() {
22538
+ this.state.pickerOpened = false;
22539
+ }
22540
+ togglePicker() {
22541
+ this.state.pickerOpened = !this.state.pickerOpened;
22542
+ }
22543
+ }
22544
+
22545
+ class ChartTitle extends owl.Component {
22546
+ static template = "o-spreadsheet.ChartTitle";
22547
+ static components = { ColorPickerWidget, Section };
22548
+ static props = { title: String, update: Function };
22549
+ updateTitle(ev) {
22550
+ this.props.update(ev.target.value);
22551
+ }
22552
+ }
22553
+
22554
+ class LineBarPieDesignPanel extends owl.Component {
22555
+ static template = "o-spreadsheet-LineBarPieDesignPanel";
22556
+ static components = { ChartColor, ColorPickerWidget, ChartTitle, Section };
22557
+ static props = {
22558
+ figureId: String,
22559
+ definition: Object,
22560
+ updateChart: Function,
22561
+ canUpdateChart: Function,
22562
+ };
22563
+ get title() {
22564
+ return _t(this.props.definition.title);
22375
22565
  }
22376
22566
  updateBackgroundColor(color) {
22377
22567
  this.props.updateChart(this.props.figureId, {
22378
22568
  background: color,
22379
22569
  });
22380
22570
  }
22381
- updateTitle() {
22382
- this.props.updateChart(this.props.figureId, {
22383
- title: this.state.title,
22384
- });
22571
+ updateTitle(title) {
22572
+ this.props.updateChart(this.props.figureId, { title });
22385
22573
  }
22386
22574
  updateSelect(attr, ev) {
22387
22575
  this.props.updateChart(this.props.figureId, {
@@ -22389,12 +22577,6 @@
22389
22577
  });
22390
22578
  }
22391
22579
  }
22392
- LineBarPieDesignPanel.props = {
22393
- figureId: String,
22394
- definition: Object,
22395
- updateChart: Function,
22396
- canUpdateChart: Function,
22397
- };
22398
22580
 
22399
22581
  class BarChartDesignPanel extends LineBarPieDesignPanel {
22400
22582
  static template = "o-spreadsheet-BarChartDesignPanel";
@@ -22402,7 +22584,13 @@
22402
22584
 
22403
22585
  class GaugeChartConfigPanel extends owl.Component {
22404
22586
  static template = "o-spreadsheet-GaugeChartConfigPanel";
22405
- static components = { SelectionInput, ValidationMessages };
22587
+ static components = { SelectionInput, ChartErrorSection, ChartDataSeries };
22588
+ static props = {
22589
+ figureId: String,
22590
+ definition: Object,
22591
+ updateChart: Function,
22592
+ canUpdateChart: Function,
22593
+ };
22406
22594
  state = owl.useState({
22407
22595
  dataRangeDispatchResult: undefined,
22408
22596
  });
@@ -22429,12 +22617,6 @@
22429
22617
  return this.dataRange || "";
22430
22618
  }
22431
22619
  }
22432
- GaugeChartConfigPanel.props = {
22433
- figureId: String,
22434
- definition: Object,
22435
- updateChart: Function,
22436
- canUpdateChart: Function,
22437
- };
22438
22620
 
22439
22621
  css /* scss */ `
22440
22622
  .o-gauge-color-set {
@@ -22469,31 +22651,35 @@
22469
22651
  `;
22470
22652
  class GaugeChartDesignPanel extends owl.Component {
22471
22653
  static template = "o-spreadsheet-GaugeChartDesignPanel";
22472
- static components = { ColorPickerWidget, ValidationMessages };
22654
+ static components = { ColorPickerWidget, ChartErrorSection, ChartColor, ChartTitle, Section };
22655
+ static props = {
22656
+ figureId: String,
22657
+ definition: Object,
22658
+ updateChart: Function,
22659
+ canUpdateChart: Function,
22660
+ };
22473
22661
  state = owl.useState({
22474
- title: "",
22475
22662
  openedMenu: undefined,
22476
22663
  sectionRuleDispatchResult: undefined,
22477
22664
  sectionRule: deepCopy(this.props.definition.sectionRule),
22478
22665
  });
22479
22666
  setup() {
22480
- this.state.title = _t(this.props.definition.title);
22481
22667
  owl.useExternalListener(window, "click", this.closeMenus);
22482
22668
  }
22669
+ get title() {
22670
+ return _t(this.props.definition.title);
22671
+ }
22483
22672
  get designErrorMessages() {
22484
22673
  const cancelledReasons = [...(this.state.sectionRuleDispatchResult?.reasons || [])];
22485
22674
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
22486
22675
  }
22487
22676
  updateBackgroundColor(color) {
22488
- this.state.openedMenu = undefined;
22489
22677
  this.props.updateChart(this.props.figureId, {
22490
22678
  background: color,
22491
22679
  });
22492
22680
  }
22493
- updateTitle() {
22494
- this.props.updateChart(this.props.figureId, {
22495
- title: this.state.title,
22496
- });
22681
+ updateTitle(title) {
22682
+ this.props.updateChart(this.props.figureId, { title });
22497
22683
  }
22498
22684
  isRangeMinInvalid() {
22499
22685
  return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMin" /* CommandResult.EmptyGaugeRangeMin */) ||
@@ -22543,12 +22729,6 @@
22543
22729
  this.state.openedMenu = undefined;
22544
22730
  }
22545
22731
  }
22546
- GaugeChartDesignPanel.props = {
22547
- figureId: String,
22548
- definition: Object,
22549
- updateChart: Function,
22550
- canUpdateChart: Function,
22551
- };
22552
22732
 
22553
22733
  class LineConfigPanel extends LineBarPieConfigPanel {
22554
22734
  static template = "o-spreadsheet-LineConfigPanel";
@@ -22559,24 +22739,42 @@
22559
22739
  }
22560
22740
  return false;
22561
22741
  }
22562
- onUpdateLabelsAsText(ev) {
22742
+ get stackedLabel() {
22743
+ return _t("Stacked linechart");
22744
+ }
22745
+ get cumulativeLabel() {
22746
+ return _t("Cumulative data");
22747
+ }
22748
+ getLabelRangeOptions() {
22749
+ const options = super.getLabelRangeOptions();
22750
+ if (this.canTreatLabelsAsText) {
22751
+ options.push({
22752
+ name: "labelsAsText",
22753
+ value: this.props.definition.labelsAsText,
22754
+ label: _t("Treat labels as text"),
22755
+ onChange: this.onUpdateLabelsAsText.bind(this),
22756
+ });
22757
+ }
22758
+ return options;
22759
+ }
22760
+ onUpdateLabelsAsText(labelsAsText) {
22563
22761
  this.props.updateChart(this.props.figureId, {
22564
- labelsAsText: ev.target.checked,
22762
+ labelsAsText,
22565
22763
  });
22566
22764
  }
22567
- onUpdateStacked(ev) {
22765
+ onUpdateStacked(stacked) {
22568
22766
  this.props.updateChart(this.props.figureId, {
22569
- stacked: ev.target.checked,
22767
+ stacked,
22570
22768
  });
22571
22769
  }
22572
- onUpdateAggregated(ev) {
22770
+ onUpdateAggregated(aggregated) {
22573
22771
  this.props.updateChart(this.props.figureId, {
22574
- aggregated: ev.target.checked,
22772
+ aggregated,
22575
22773
  });
22576
22774
  }
22577
- onUpdateCumulative(ev) {
22775
+ onUpdateCumulative(cumulative) {
22578
22776
  this.props.updateChart(this.props.figureId, {
22579
- cumulative: ev.target.checked,
22777
+ cumulative,
22580
22778
  });
22581
22779
  }
22582
22780
  }
@@ -22587,7 +22785,13 @@
22587
22785
 
22588
22786
  class ScorecardChartConfigPanel extends owl.Component {
22589
22787
  static template = "o-spreadsheet-ScorecardChartConfigPanel";
22590
- static components = { SelectionInput, ValidationMessages };
22788
+ static components = { SelectionInput, ValidationMessages, ChartErrorSection, Section };
22789
+ static props = {
22790
+ figureId: String,
22791
+ definition: Object,
22792
+ updateChart: Function,
22793
+ canUpdateChart: Function,
22794
+ };
22591
22795
  state = owl.useState({
22592
22796
  keyValueDispatchResult: undefined,
22593
22797
  baselineDispatchResult: undefined,
@@ -22639,28 +22843,27 @@
22639
22843
  this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
22640
22844
  }
22641
22845
  }
22642
- ScorecardChartConfigPanel.props = {
22643
- figureId: String,
22644
- definition: Object,
22645
- updateChart: Function,
22646
- canUpdateChart: Function,
22647
- };
22648
22846
 
22649
22847
  class ScorecardChartDesignPanel extends owl.Component {
22650
22848
  static template = "o-spreadsheet-ScorecardChartDesignPanel";
22651
- static components = { ColorPickerWidget };
22849
+ static components = { ColorPickerWidget, ChartColor, ChartTitle, Section };
22850
+ static props = {
22851
+ figureId: String,
22852
+ definition: Object,
22853
+ updateChart: Function,
22854
+ canUpdateChart: Function,
22855
+ };
22652
22856
  state = owl.useState({
22653
- title: "",
22654
22857
  openedColorPicker: undefined,
22655
22858
  });
22656
22859
  setup() {
22657
- this.state.title = _t(this.props.definition.title);
22658
22860
  owl.useExternalListener(window, "click", this.closeMenus);
22659
22861
  }
22660
- updateTitle() {
22661
- this.props.updateChart(this.props.figureId, {
22662
- title: this.state.title,
22663
- });
22862
+ get title() {
22863
+ return _t(this.props.definition.title);
22864
+ }
22865
+ updateTitle(title) {
22866
+ this.props.updateChart(this.props.figureId, { title });
22664
22867
  }
22665
22868
  translate(term) {
22666
22869
  return _t(term);
@@ -22694,12 +22897,6 @@
22694
22897
  this.state.openedColorPicker = undefined;
22695
22898
  }
22696
22899
  }
22697
- ScorecardChartDesignPanel.props = {
22698
- figureId: String,
22699
- definition: Object,
22700
- updateChart: Function,
22701
- canUpdateChart: Function,
22702
- };
22703
22900
 
22704
22901
  const chartSidePanelComponentRegistry = new Registry();
22705
22902
  chartSidePanelComponentRegistry
@@ -22750,6 +22947,8 @@
22750
22947
  `;
22751
22948
  class ChartPanel extends owl.Component {
22752
22949
  static template = "o-spreadsheet-ChartPanel";
22950
+ static components = { Section };
22951
+ static props = { onCloseSidePanel: Function };
22753
22952
  state;
22754
22953
  get figureId() {
22755
22954
  return this.state.figureId;
@@ -22836,9 +23035,6 @@
22836
23035
  this.state.panel = panel;
22837
23036
  }
22838
23037
  }
22839
- ChartPanel.props = {
22840
- onCloseSidePanel: Function,
22841
- };
22842
23038
 
22843
23039
  css /* scss */ `
22844
23040
  .o-spreadsheet {
@@ -22949,6 +23145,9 @@
22949
23145
  `;
22950
23146
  class IconPicker extends owl.Component {
22951
23147
  static template = "o-spreadsheet-IconPicker";
23148
+ static props = {
23149
+ onIconPicked: Function,
23150
+ };
22952
23151
  icons = ICONS;
22953
23152
  iconSets = ICON_SETS;
22954
23153
  onIconClick(icon) {
@@ -22957,9 +23156,6 @@
22957
23156
  }
22958
23157
  }
22959
23158
  }
22960
- IconPicker.props = {
22961
- onIconPicked: Function,
22962
- };
22963
23159
 
22964
23160
  function useDragAndDropListItems() {
22965
23161
  let dndHelper;
@@ -23314,6 +23510,11 @@
23314
23510
  `;
23315
23511
  class ConditionalFormatPreviewList extends owl.Component {
23316
23512
  static template = "o-spreadsheet-ConditionalFormatPreviewList";
23513
+ static props = {
23514
+ conditionalFormats: Array,
23515
+ onPreviewClick: Function,
23516
+ onAddConditionalFormat: Function,
23517
+ };
23317
23518
  icons = ICONS;
23318
23519
  dragAndDrop = useDragAndDropListItems();
23319
23520
  cfListRef = owl.useRef("cfList");
@@ -23394,11 +23595,6 @@
23394
23595
  }
23395
23596
  }
23396
23597
  }
23397
- ConditionalFormatPreviewList.props = {
23398
- conditionalFormats: Array,
23399
- onPreviewClick: Function,
23400
- onAddConditionalFormat: Function,
23401
- };
23402
23598
 
23403
23599
  css /* scss */ `
23404
23600
  label {
@@ -23571,11 +23767,16 @@
23571
23767
  `;
23572
23768
  class ConditionalFormattingEditor extends owl.Component {
23573
23769
  static template = "o-spreadsheet-ConditionalFormattingEditor";
23770
+ static props = {
23771
+ editedCf: { type: Object, optional: true },
23772
+ onExitEdition: Function,
23773
+ };
23574
23774
  static components = {
23575
23775
  SelectionInput,
23576
23776
  IconPicker,
23577
23777
  ColorPickerWidget,
23578
23778
  ConditionalFormatPreviewList,
23779
+ Section,
23579
23780
  };
23580
23781
  icons = ICONS;
23581
23782
  cellIsOperators = CellIsOperators;
@@ -23835,13 +24036,13 @@
23835
24036
  this.state.rules.iconSet.icons[target] = icon;
23836
24037
  }
23837
24038
  }
23838
- ConditionalFormattingEditor.props = {
23839
- editedCf: { type: Object, optional: true },
23840
- onExitEdition: Function,
23841
- };
23842
24039
 
23843
24040
  class ConditionalFormattingPanel extends owl.Component {
23844
24041
  static template = "o-spreadsheet-ConditionalFormattingPanel";
24042
+ static props = {
24043
+ selection: { type: Object, optional: true },
24044
+ onCloseSidePanel: Function,
24045
+ };
23845
24046
  static components = {
23846
24047
  ConditionalFormatPreviewList,
23847
24048
  ConditionalFormattingEditor,
@@ -23900,10 +24101,6 @@
23900
24101
  this.state.editedCf = cf;
23901
24102
  }
23902
24103
  }
23903
- ConditionalFormattingPanel.props = {
23904
- selection: { type: Object, optional: true },
23905
- onCloseSidePanel: Function,
23906
- };
23907
24104
 
23908
24105
  css /* scss */ `
23909
24106
  .o-custom-currency {
@@ -23914,6 +24111,8 @@
23914
24111
  `;
23915
24112
  class CustomCurrencyPanel extends owl.Component {
23916
24113
  static template = "o-spreadsheet-CustomCurrencyPanel";
24114
+ static components = { Section };
24115
+ static props = { onCloseSidePanel: Function };
23917
24116
  availableCurrencies;
23918
24117
  state;
23919
24118
  setup() {
@@ -24036,9 +24235,6 @@
24036
24235
  return currency.name + (currency.code ? ` (${currency.code})` : "");
24037
24236
  }
24038
24237
  }
24039
- CustomCurrencyPanel.props = {
24040
- onCloseSidePanel: Function,
24041
- };
24042
24238
 
24043
24239
  css /* scss */ `
24044
24240
  .o-find-and-replace {
@@ -24068,7 +24264,10 @@
24068
24264
  `;
24069
24265
  class FindAndReplacePanel extends owl.Component {
24070
24266
  static template = "o-spreadsheet-FindAndReplacePanel";
24071
- static components = { SelectionInput };
24267
+ static components = { SelectionInput, Section, Checkbox };
24268
+ static props = {
24269
+ onCloseSidePanel: Function,
24270
+ };
24072
24271
  debounceTimeoutId;
24073
24272
  initialShowFormulaState = false;
24074
24273
  dataRange = "";
@@ -24143,19 +24342,16 @@
24143
24342
  this.replace();
24144
24343
  }
24145
24344
  }
24146
- searchFormulas(ev) {
24147
- const showFormula = ev.target.checked;
24345
+ searchFormulas(showFormula) {
24148
24346
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
24149
24347
  show: showFormula,
24150
24348
  });
24151
24349
  this.updateSearch({ searchFormulas: showFormula });
24152
24350
  }
24153
- searchExactMatch(ev) {
24154
- const exactMatch = ev.target.checked;
24351
+ searchExactMatch(exactMatch) {
24155
24352
  this.updateSearch({ exactMatch });
24156
24353
  }
24157
- searchMatchCase(ev) {
24158
- const matchCase = ev.target.checked;
24354
+ searchMatchCase(matchCase) {
24159
24355
  this.updateSearch({ matchCase });
24160
24356
  }
24161
24357
  changeSearchScope(ev) {
@@ -24208,9 +24404,6 @@
24208
24404
  });
24209
24405
  }
24210
24406
  }
24211
- FindAndReplacePanel.props = {
24212
- onCloseSidePanel: Function,
24213
- };
24214
24407
 
24215
24408
  css /* scss */ `
24216
24409
  .o-more-formats-panel {
@@ -24242,13 +24435,13 @@
24242
24435
  ]);
24243
24436
  class MoreFormatsPanel extends owl.Component {
24244
24437
  static template = "o-spreadsheet-MoreFormatsPanel";
24438
+ static props = {
24439
+ onCloseSidePanel: Function,
24440
+ };
24245
24441
  get dateFormatsActions() {
24246
24442
  return DATE_FORMAT_ACTIONS;
24247
24443
  }
24248
24444
  }
24249
- MoreFormatsPanel.props = {
24250
- onCloseSidePanel: Function,
24251
- };
24252
24445
 
24253
24446
  css /* scss */ `
24254
24447
  .o-checkbox-selection {
@@ -24257,7 +24450,7 @@
24257
24450
  `;
24258
24451
  class RemoveDuplicatesPanel extends owl.Component {
24259
24452
  static template = "o-spreadsheet-RemoveDuplicatesPanel";
24260
- static components = { ValidationMessages };
24453
+ static components = { ValidationMessages, Section, Checkbox };
24261
24454
  state = owl.useState({
24262
24455
  hasHeader: false,
24263
24456
  columns: {},
@@ -24346,6 +24539,8 @@
24346
24539
  `;
24347
24540
  class SettingsPanel extends owl.Component {
24348
24541
  static template = "o-spreadsheet-SettingsPanel";
24542
+ static components = { Section };
24543
+ static props = { onCloseSidePanel: Function };
24349
24544
  loadedLocales = [];
24350
24545
  setup() {
24351
24546
  owl.onWillStart(() => this.loadLocales());
@@ -24394,9 +24589,6 @@
24394
24589
  return this.loadedLocales;
24395
24590
  }
24396
24591
  }
24397
- SettingsPanel.props = {
24398
- onCloseSidePanel: Function,
24399
- };
24400
24592
 
24401
24593
  const SplitToColumnsInteractiveContent = {
24402
24594
  SplitIsDestructive: _t("This will overwrite data in the subsequent columns. Split anyway?"),
@@ -24492,7 +24684,7 @@
24492
24684
  return false;
24493
24685
  }
24494
24686
  if (["lastWeek", "lastMonth", "lastYear"].includes(criterion.dateValue)) {
24495
- const today = jsDateToRoundNumber(new Date());
24687
+ const today = jsDateToRoundNumber(DateTime.now());
24496
24688
  return isDateBetween(dateValue, today, criterionValue);
24497
24689
  }
24498
24690
  return areDatesSameDay(dateValue, criterionValue);
@@ -24984,7 +25176,8 @@
24984
25176
  ];
24985
25177
  class SplitIntoColumnsPanel extends owl.Component {
24986
25178
  static template = "o-spreadsheet-SplitIntoColumnsPanel";
24987
- static components = { ValidationMessages };
25179
+ static components = { ValidationMessages, Section, Checkbox };
25180
+ static props = { onCloseSidePanel: Function };
24988
25181
  state = owl.useState({ separatorValue: "auto", addNewColumns: false, customSeparator: "" });
24989
25182
  setup() {
24990
25183
  owl.onWillUpdateProps(() => {
@@ -25006,10 +25199,8 @@
25006
25199
  return;
25007
25200
  this.state.customSeparator = ev.target.value;
25008
25201
  }
25009
- updateAddNewColumnsCheckbox(ev) {
25010
- if (!ev.target)
25011
- return;
25012
- this.state.addNewColumns = ev.target.checked;
25202
+ updateAddNewColumnsCheckbox(addNewColumns) {
25203
+ this.state.addNewColumns = addNewColumns;
25013
25204
  }
25014
25205
  confirm() {
25015
25206
  const result = interactiveSplitToColumns(this.env, this.separatorValue, this.state.addNewColumns);
@@ -25063,13 +25254,15 @@
25063
25254
  return !this.separatorValue || this.errorMessages.length > 0;
25064
25255
  }
25065
25256
  }
25066
- SplitIntoColumnsPanel.props = {
25067
- onCloseSidePanel: Function,
25068
- };
25069
25257
 
25070
25258
  /** This component looks like a select input, but on click it opens a Menu with the items given as props instead of a dropdown */
25071
25259
  class SelectMenu extends owl.Component {
25072
25260
  static template = "o-spreadsheet-SelectMenu";
25261
+ static props = {
25262
+ menuItems: Array,
25263
+ selectedValue: String,
25264
+ class: { type: String, optional: true },
25265
+ };
25073
25266
  static components = { Menu };
25074
25267
  selectRef = owl.useRef("select");
25075
25268
  selectRect = useAbsoluteBoundingRect(this.selectRef);
@@ -25089,13 +25282,12 @@
25089
25282
  };
25090
25283
  }
25091
25284
  }
25092
- SelectMenu.props = {
25093
- menuItems: Array,
25094
- selectedValue: String,
25095
- class: { type: String, optional: true },
25096
- };
25097
25285
 
25098
25286
  class DataValidationCriterionForm extends owl.Component {
25287
+ static props = {
25288
+ criterion: Object,
25289
+ onCriterionChanged: Function,
25290
+ };
25099
25291
  setup() {
25100
25292
  owl.onMounted(() => {
25101
25293
  interactiveStopEdition(this.env);
@@ -25109,10 +25301,6 @@
25109
25301
  this.props.onCriterionChanged(filteredCriterion);
25110
25302
  }
25111
25303
  }
25112
- DataValidationCriterionForm.props = {
25113
- criterion: Object,
25114
- onCriterionChanged: Function,
25115
- };
25116
25304
 
25117
25305
  css /* scss */ `
25118
25306
  .o-dv-input {
@@ -25127,6 +25315,15 @@
25127
25315
  `;
25128
25316
  class DataValidationInput extends owl.Component {
25129
25317
  static template = "o-spreadsheet-DataValidationInput";
25318
+ static props = {
25319
+ value: { type: String, optional: true },
25320
+ criterionType: String,
25321
+ onValueChanged: Function,
25322
+ onKeyDown: { type: Function, optional: true },
25323
+ focused: { type: Boolean, optional: true },
25324
+ onBlur: { type: Function, optional: true },
25325
+ onFocus: { type: Function, optional: true },
25326
+ };
25130
25327
  static defaultProps = {
25131
25328
  value: "",
25132
25329
  onKeyDown: () => { },
@@ -25165,15 +25362,6 @@
25165
25362
  return this.env.model.getters.getDataValidationInvalidCriterionValueMessage(this.props.criterionType, canonicalizeContent(this.props.value, this.env.model.getters.getLocale()));
25166
25363
  }
25167
25364
  }
25168
- DataValidationInput.props = {
25169
- value: { type: String, optional: true },
25170
- criterionType: String,
25171
- onValueChanged: Function,
25172
- onKeyDown: { type: Function, optional: true },
25173
- focused: { type: Boolean, optional: true },
25174
- onBlur: { type: Function, optional: true },
25175
- onFocus: { type: Function, optional: true },
25176
- };
25177
25365
 
25178
25366
  const DATES_VALUES = {
25179
25367
  today: _t("today"),
@@ -25509,7 +25697,11 @@
25509
25697
  `;
25510
25698
  class DataValidationEditor extends owl.Component {
25511
25699
  static template = "o-spreadsheet-DataValidationEditor";
25512
- static components = { SelectionInput, SelectMenu };
25700
+ static components = { SelectionInput, SelectMenu, Section };
25701
+ static props = {
25702
+ rule: { type: Object, optional: true },
25703
+ onExit: Function,
25704
+ };
25513
25705
  state = owl.useState({ rule: this.defaultDataValidationRule });
25514
25706
  setup() {
25515
25707
  if (this.props.rule) {
@@ -25585,10 +25777,6 @@
25585
25777
  return dataValidationPanelCriteriaRegistry.get(this.state.rule.criterion.type).component;
25586
25778
  }
25587
25779
  }
25588
- DataValidationEditor.props = {
25589
- rule: { type: Object, optional: true },
25590
- onExit: Function,
25591
- };
25592
25780
 
25593
25781
  css /* scss */ `
25594
25782
  .o-sidePanel {
@@ -25618,6 +25806,10 @@
25618
25806
  `;
25619
25807
  class DataValidationPreview extends owl.Component {
25620
25808
  static template = "o-spreadsheet-DataValidationPreview";
25809
+ static props = {
25810
+ onClick: Function,
25811
+ rule: Object,
25812
+ };
25621
25813
  deleteDataValidation() {
25622
25814
  const sheetId = this.env.model.getters.getActiveSheetId();
25623
25815
  this.env.model.dispatch("REMOVE_DATA_VALIDATION_RULE", { sheetId, id: this.props.rule.id });
@@ -25634,13 +25826,12 @@
25634
25826
  .getPreview(this.props.rule.criterion, this.env.model.getters);
25635
25827
  }
25636
25828
  }
25637
- DataValidationPreview.props = {
25638
- onClick: Function,
25639
- rule: Object,
25640
- };
25641
25829
 
25642
25830
  class DataValidationPanel extends owl.Component {
25643
25831
  static template = "o-spreadsheet-DataValidationPanel";
25832
+ static props = {
25833
+ onCloseSidePanel: Function,
25834
+ };
25644
25835
  static components = { DataValidationPreview, DataValidationEditor };
25645
25836
  state = owl.useState({ mode: "list", activeRule: undefined });
25646
25837
  onPreviewClick(id) {
@@ -25670,9 +25861,6 @@
25670
25861
  return this.env.model.getters.getDataValidationRules(sheetId);
25671
25862
  }
25672
25863
  }
25673
- DataValidationPanel.props = {
25674
- onCloseSidePanel: Function,
25675
- };
25676
25864
 
25677
25865
  const sidePanelRegistry = new Registry();
25678
25866
  sidePanelRegistry.add("ConditionalFormatting", {
@@ -25804,6 +25992,13 @@
25804
25992
  `;
25805
25993
  class FigureComponent extends owl.Component {
25806
25994
  static template = "o-spreadsheet-FigureComponent";
25995
+ static props = {
25996
+ figure: Object,
25997
+ style: { type: String, optional: true },
25998
+ onFigureDeleted: { type: Function, optional: true },
25999
+ onMouseDown: { type: Function, optional: true },
26000
+ onClickAnchor: { type: Function, optional: true },
26001
+ };
25807
26002
  static components = { Menu };
25808
26003
  static defaultProps = {
25809
26004
  onFigureDeleted: () => { },
@@ -25946,13 +26141,6 @@
25946
26141
  .menuBuilder(this.props.figure.id, this.props.onFigureDeleted, this.env);
25947
26142
  }
25948
26143
  }
25949
- FigureComponent.props = {
25950
- figure: Object,
25951
- style: { type: String, optional: true },
25952
- onFigureDeleted: { type: Function, optional: true },
25953
- onMouseDown: { type: Function, optional: true },
25954
- onClickAnchor: { type: Function, optional: true },
25955
- };
25956
26144
 
25957
26145
  const ToggleGroupInteractiveContent = {
25958
26146
  CannotHideAllRows: _t("Cannot hide all the rows of a sheet."),
@@ -26090,6 +26278,10 @@
26090
26278
  `;
26091
26279
  class Autofill extends owl.Component {
26092
26280
  static template = "o-spreadsheet-Autofill";
26281
+ static props = {
26282
+ position: Object,
26283
+ isVisible: Boolean,
26284
+ };
26093
26285
  state = owl.useState({
26094
26286
  position: { left: 0, top: 0 },
26095
26287
  handler: false,
@@ -26158,18 +26350,14 @@
26158
26350
  this.env.model.dispatch("AUTOFILL_AUTO");
26159
26351
  }
26160
26352
  }
26161
- Autofill.props = {
26162
- position: Object,
26163
- isVisible: Boolean,
26164
- };
26165
26353
  class TooltipComponent extends owl.Component {
26354
+ static props = {
26355
+ content: String,
26356
+ };
26166
26357
  static template = owl.xml /* xml */ `
26167
26358
  <div t-esc="props.content"/>
26168
26359
  `;
26169
26360
  }
26170
- TooltipComponent.props = {
26171
- content: String,
26172
- };
26173
26361
 
26174
26362
  css /* scss */ `
26175
26363
  .o-client-tag {
@@ -26183,6 +26371,13 @@
26183
26371
  `;
26184
26372
  class ClientTag extends owl.Component {
26185
26373
  static template = "o-spreadsheet-ClientTag";
26374
+ static props = {
26375
+ active: Boolean,
26376
+ name: String,
26377
+ color: String,
26378
+ col: Number,
26379
+ row: Number,
26380
+ };
26186
26381
  get tagStyle() {
26187
26382
  const { col, row, color } = this.props;
26188
26383
  const { height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
@@ -26200,13 +26395,6 @@
26200
26395
  });
26201
26396
  }
26202
26397
  }
26203
- ClientTag.props = {
26204
- active: Boolean,
26205
- name: String,
26206
- color: String,
26207
- col: Number,
26208
- row: Number,
26209
- };
26210
26398
 
26211
26399
  function getHtmlContentFromPattern(pattern, value, highlightColor, className) {
26212
26400
  const pendingHtmlContent = [];
@@ -26246,14 +26434,14 @@
26246
26434
  `;
26247
26435
  class TextValueProvider extends owl.Component {
26248
26436
  static template = "o-spreadsheet-TextValueProvider";
26437
+ static props = {
26438
+ values: Array,
26439
+ selectedIndex: { type: Number, optional: true },
26440
+ getHtmlContent: Function,
26441
+ onValueSelected: Function,
26442
+ onValueHovered: Function,
26443
+ };
26249
26444
  }
26250
- TextValueProvider.props = {
26251
- values: Array,
26252
- selectedIndex: { type: Number, optional: true },
26253
- getHtmlContent: Function,
26254
- onValueSelected: Function,
26255
- onValueHovered: Function,
26256
- };
26257
26445
 
26258
26446
  class ContentEditableHelper {
26259
26447
  // todo make el private and expose dedicated methods
@@ -26615,6 +26803,11 @@
26615
26803
  `;
26616
26804
  class FunctionDescriptionProvider extends owl.Component {
26617
26805
  static template = "o-spreadsheet-FunctionDescriptionProvider";
26806
+ static props = {
26807
+ functionName: String,
26808
+ functionDescription: Object,
26809
+ argToFocus: Number,
26810
+ };
26618
26811
  assistantState = owl.useState({
26619
26812
  allowCellSelectionBehind: false,
26620
26813
  });
@@ -26639,11 +26832,6 @@
26639
26832
  }, 2000);
26640
26833
  }
26641
26834
  }
26642
- FunctionDescriptionProvider.props = {
26643
- functionName: String,
26644
- functionDescription: Object,
26645
- argToFocus: Number,
26646
- };
26647
26835
 
26648
26836
  const functions$2 = functionRegistry.content;
26649
26837
  const ASSISTANT_WIDTH = 300;
@@ -26709,6 +26897,16 @@
26709
26897
  `;
26710
26898
  class Composer extends owl.Component {
26711
26899
  static template = "o-spreadsheet-Composer";
26900
+ static props = {
26901
+ focus: {
26902
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
26903
+ },
26904
+ onComposerContentFocused: Function,
26905
+ inputStyle: { type: String, optional: true },
26906
+ rect: { type: Object, optional: true },
26907
+ delimitation: { type: Object, optional: true },
26908
+ onComposerUnmounted: { type: Function, optional: true },
26909
+ };
26712
26910
  static components = { TextValueProvider, FunctionDescriptionProvider };
26713
26911
  static defaultProps = {
26714
26912
  inputStyle: "",
@@ -27265,14 +27463,6 @@
27265
27463
  this.autoCompleteState.getHtmlContent = (value) => [{ value }];
27266
27464
  }
27267
27465
  }
27268
- Composer.props = {
27269
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
27270
- onComposerContentFocused: Function,
27271
- inputStyle: { type: String, optional: true },
27272
- rect: { type: Object, optional: true },
27273
- delimitation: { type: Object, optional: true },
27274
- onComposerUnmounted: { type: Function, optional: true },
27275
- };
27276
27466
 
27277
27467
  const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
27278
27468
  const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
@@ -27304,6 +27494,14 @@
27304
27494
  */
27305
27495
  class GridComposer extends owl.Component {
27306
27496
  static template = "o-spreadsheet-GridComposer";
27497
+ static props = {
27498
+ focus: {
27499
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
27500
+ },
27501
+ onComposerUnmounted: Function,
27502
+ onComposerContentFocused: Function,
27503
+ gridDims: Object,
27504
+ };
27307
27505
  static components = { Composer };
27308
27506
  gridComposerRef;
27309
27507
  zone;
@@ -27410,22 +27608,22 @@
27410
27608
  });
27411
27609
  }
27412
27610
  }
27413
- GridComposer.props = {
27414
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
27415
- onComposerUnmounted: Function,
27416
- onComposerContentFocused: Function,
27417
- gridDims: Object,
27418
- };
27419
27611
 
27420
- const CSS$1 = css /* scss */ `
27612
+ css /* scss */ `
27421
27613
  .o-grid-cell-icon {
27422
27614
  width: ${GRID_ICON_EDGE_LENGTH}px;
27423
27615
  height: ${GRID_ICON_EDGE_LENGTH}px;
27424
27616
  }
27425
27617
  `;
27426
27618
  class GridCellIcon extends owl.Component {
27427
- static style = CSS$1;
27428
27619
  static template = "o-spreadsheet-GridCellIcon";
27620
+ static props = {
27621
+ cellPosition: Object,
27622
+ horizontalAlign: { type: String, optional: true },
27623
+ verticalAlign: { type: String, optional: true },
27624
+ offset: { type: Object, optional: true },
27625
+ slots: Object,
27626
+ };
27429
27627
  get iconStyle() {
27430
27628
  const x = this.getIconHorizontalPosition();
27431
27629
  const y = this.getIconVerticalPosition();
@@ -27474,15 +27672,8 @@
27474
27672
  return !(rect.width === 0 || rect.height === 0);
27475
27673
  }
27476
27674
  }
27477
- GridCellIcon.props = {
27478
- cellPosition: Object,
27479
- horizontalAlign: { type: String, optional: true },
27480
- verticalAlign: { type: String, optional: true },
27481
- offset: { type: Object, optional: true },
27482
- slots: Object,
27483
- };
27484
27675
 
27485
- const CSS = css /* scss */ `
27676
+ css /* scss */ `
27486
27677
  .o-filter-icon {
27487
27678
  color: ${FILTERS_COLOR};
27488
27679
  display: flex;
@@ -27497,8 +27688,10 @@
27497
27688
  }
27498
27689
  `;
27499
27690
  class FilterIcon extends owl.Component {
27500
- static style = CSS;
27501
27691
  static template = "o-spreadsheet-FilterIcon";
27692
+ static props = {
27693
+ cellPosition: Object,
27694
+ };
27502
27695
  onClick() {
27503
27696
  const position = this.props.cellPosition;
27504
27697
  const activePopoverType = this.env.model.getters.getPersistentPopoverTypeAtPosition(position);
@@ -27517,12 +27710,12 @@
27517
27710
  return this.env.model.getters.isFilterActive(this.props.cellPosition);
27518
27711
  }
27519
27712
  }
27520
- FilterIcon.props = {
27521
- cellPosition: Object,
27522
- };
27523
27713
 
27524
27714
  class FilterIconsOverlay extends owl.Component {
27525
27715
  static template = "o-spreadsheet-FilterIconsOverlay";
27716
+ static props = {
27717
+ gridPosition: { type: Object, optional: true },
27718
+ };
27526
27719
  static components = {
27527
27720
  GridCellIcon,
27528
27721
  FilterIcon,
@@ -27536,9 +27729,6 @@
27536
27729
  return headerPositions.map((position) => ({ sheetId, ...position }));
27537
27730
  }
27538
27731
  }
27539
- FilterIconsOverlay.props = {
27540
- gridPosition: { type: Object, optional: true },
27541
- };
27542
27732
 
27543
27733
  const CHECKBOX_WIDTH = 15;
27544
27734
  const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
@@ -27552,6 +27742,9 @@
27552
27742
  `;
27553
27743
  class DataValidationCheckbox extends owl.Component {
27554
27744
  static template = "o-spreadsheet-DataValidationCheckbox";
27745
+ static props = {
27746
+ cellPosition: Object,
27747
+ };
27555
27748
  onCheckboxChange(ev) {
27556
27749
  const newValue = ev.target.checked;
27557
27750
  const { sheetId, col, row } = this.props.cellPosition;
@@ -27566,9 +27759,6 @@
27566
27759
  return !!cell?.isFormula;
27567
27760
  }
27568
27761
  }
27569
- DataValidationCheckbox.props = {
27570
- cellPosition: Object,
27571
- };
27572
27762
 
27573
27763
  const ICON_WIDTH = 13;
27574
27764
  css /* scss */ `
@@ -27591,18 +27781,19 @@
27591
27781
  `;
27592
27782
  class DataValidationListIcon extends owl.Component {
27593
27783
  static template = "o-spreadsheet-DataValidationListIcon";
27784
+ static props = {
27785
+ cellPosition: Object,
27786
+ };
27594
27787
  onClick() {
27595
27788
  const { col, row } = this.props.cellPosition;
27596
27789
  this.env.model.selection.selectCell(col, row);
27597
27790
  this.env.startCellEdition();
27598
27791
  }
27599
27792
  }
27600
- DataValidationListIcon.props = {
27601
- cellPosition: Object,
27602
- };
27603
27793
 
27604
27794
  class DataValidationOverlay extends owl.Component {
27605
27795
  static template = "o-spreadsheet-DataValidationOverlay";
27796
+ static props = {};
27606
27797
  static components = { GridCellIcon, DataValidationCheckbox, DataValidationListIcon };
27607
27798
  get checkBoxCellPositions() {
27608
27799
  return this.env.model.getters.getDataValidationCheckBoxCellPositions();
@@ -27613,7 +27804,6 @@
27613
27804
  : this.env.model.getters.getDataValidationListCellsPositions();
27614
27805
  }
27615
27806
  }
27616
- DataValidationOverlay.props = {};
27617
27807
 
27618
27808
  /**
27619
27809
  * Transform a figure with coordinates from the model, to coordinates as they are shown on the screen,
@@ -27949,6 +28139,9 @@
27949
28139
  */
27950
28140
  class FiguresContainer extends owl.Component {
27951
28141
  static template = "o-spreadsheet-FiguresContainer";
28142
+ static props = {
28143
+ onFigureDeleted: Function,
28144
+ };
27952
28145
  static components = { FigureComponent };
27953
28146
  dnd = owl.useState({
27954
28147
  draggedFigure: undefined,
@@ -28198,9 +28391,6 @@
28198
28391
  }
28199
28392
  }
28200
28393
  }
28201
- FiguresContainer.props = {
28202
- onFigureDeleted: Function,
28203
- };
28204
28394
 
28205
28395
  css /* scss */ `
28206
28396
  .o-grid-add-rows {
@@ -28219,6 +28409,9 @@
28219
28409
  `;
28220
28410
  class GridAddRowsFooter extends owl.Component {
28221
28411
  static template = "o-spreadsheet-GridAddRowsFooter";
28412
+ static props = {
28413
+ focusGrid: Function,
28414
+ };
28222
28415
  static components = { ValidationMessages };
28223
28416
  inputRef = owl.useRef("inputRef");
28224
28417
  state = owl.useState({
@@ -28285,9 +28478,6 @@
28285
28478
  this.props.focusGrid();
28286
28479
  }
28287
28480
  }
28288
- GridAddRowsFooter.props = {
28289
- focusGrid: Function,
28290
- };
28291
28481
 
28292
28482
  /**
28293
28483
  * Manages an event listener on a ref. Useful for hooks that want to manage
@@ -28443,6 +28633,16 @@
28443
28633
  }
28444
28634
  class GridOverlay extends owl.Component {
28445
28635
  static template = "o-spreadsheet-GridOverlay";
28636
+ static props = {
28637
+ onCellHovered: { type: Function, optional: true },
28638
+ onCellDoubleClicked: { type: Function, optional: true },
28639
+ onCellClicked: { type: Function, optional: true },
28640
+ onCellRightClicked: { type: Function, optional: true },
28641
+ onGridResized: { type: Function, optional: true },
28642
+ onFigureDeleted: { type: Function, optional: true },
28643
+ onGridMoved: Function,
28644
+ gridOverlayDimensions: String,
28645
+ };
28446
28646
  static components = { FiguresContainer, DataValidationOverlay, GridAddRowsFooter };
28447
28647
  static defaultProps = {
28448
28648
  onCellHovered: () => { },
@@ -28516,19 +28716,15 @@
28516
28716
  return [colIndex, rowIndex];
28517
28717
  }
28518
28718
  }
28519
- GridOverlay.props = {
28520
- onCellHovered: { type: Function, optional: true },
28521
- onCellDoubleClicked: { type: Function, optional: true },
28522
- onCellClicked: { type: Function, optional: true },
28523
- onCellRightClicked: { type: Function, optional: true },
28524
- onGridResized: { type: Function, optional: true },
28525
- onFigureDeleted: { type: Function, optional: true },
28526
- onGridMoved: Function,
28527
- gridOverlayDimensions: String,
28528
- };
28529
28719
 
28530
28720
  class GridPopover extends owl.Component {
28531
28721
  static template = "o-spreadsheet-GridPopover";
28722
+ static props = {
28723
+ hoveredCell: Object,
28724
+ onClosePopover: Function,
28725
+ onMouseWheel: Function,
28726
+ gridRect: Object,
28727
+ };
28532
28728
  static components = { Popover };
28533
28729
  zIndex = ComponentsImportance.GridPopover;
28534
28730
  get cellPopover() {
@@ -28548,14 +28744,11 @@
28548
28744
  };
28549
28745
  }
28550
28746
  }
28551
- GridPopover.props = {
28552
- hoveredCell: Object,
28553
- onClosePopover: Function,
28554
- onMouseWheel: Function,
28555
- gridRect: Object,
28556
- };
28557
28747
 
28558
28748
  class AbstractResizer extends owl.Component {
28749
+ static props = {
28750
+ onOpenContextMenu: Function,
28751
+ };
28559
28752
  PADDING = 0;
28560
28753
  MAX_SIZE_MARGIN = 0;
28561
28754
  MIN_ELEMENT_SIZE = 0;
@@ -28812,10 +29005,10 @@
28812
29005
  }
28813
29006
  }
28814
29007
  `;
28815
- AbstractResizer.props = {
28816
- onOpenContextMenu: Function,
28817
- };
28818
29008
  class ColResizer extends AbstractResizer {
29009
+ static props = {
29010
+ onOpenContextMenu: Function,
29011
+ };
28819
29012
  static template = "o-spreadsheet-ColResizer";
28820
29013
  colResizerRef;
28821
29014
  setup() {
@@ -28977,10 +29170,10 @@
28977
29170
  }
28978
29171
  }
28979
29172
  `;
28980
- ColResizer.props = {
28981
- onOpenContextMenu: Function,
28982
- };
28983
29173
  class RowResizer extends AbstractResizer {
29174
+ static props = {
29175
+ onOpenContextMenu: Function,
29176
+ };
28984
29177
  static template = "o-spreadsheet-RowResizer";
28985
29178
  setup() {
28986
29179
  super.setup();
@@ -29101,19 +29294,16 @@
29101
29294
  }
29102
29295
  }
29103
29296
  `;
29104
- RowResizer.props = {
29105
- onOpenContextMenu: Function,
29106
- };
29107
29297
  class HeadersOverlay extends owl.Component {
29298
+ static props = {
29299
+ onOpenContextMenu: Function,
29300
+ };
29108
29301
  static template = "o-spreadsheet-HeadersOverlay";
29109
29302
  static components = { ColResizer, RowResizer };
29110
29303
  selectAll() {
29111
29304
  this.env.model.selection.selectAll();
29112
29305
  }
29113
29306
  }
29114
- HeadersOverlay.props = {
29115
- onOpenContextMenu: Function,
29116
- };
29117
29307
 
29118
29308
  function useGridDrawing(refName, model, canvasSize) {
29119
29309
  const canvasRef = owl.useRef(refName);
@@ -29171,6 +29361,12 @@
29171
29361
  `;
29172
29362
  class Border extends owl.Component {
29173
29363
  static template = "o-spreadsheet-Border";
29364
+ static props = {
29365
+ zone: Object,
29366
+ orientation: String,
29367
+ isMoving: Boolean,
29368
+ onMoveHighlight: Function,
29369
+ };
29174
29370
  get style() {
29175
29371
  const isTop = ["n", "w", "e"].includes(this.props.orientation);
29176
29372
  const isLeft = ["n", "w", "s"].includes(this.props.orientation);
@@ -29199,12 +29395,6 @@
29199
29395
  this.props.onMoveHighlight(ev.clientX, ev.clientY);
29200
29396
  }
29201
29397
  }
29202
- Border.props = {
29203
- zone: Object,
29204
- orientation: String,
29205
- isMoving: Boolean,
29206
- onMoveHighlight: Function,
29207
- };
29208
29398
 
29209
29399
  css /* scss */ `
29210
29400
  .o-corner {
@@ -29231,6 +29421,13 @@
29231
29421
  `;
29232
29422
  class Corner extends owl.Component {
29233
29423
  static template = "o-spreadsheet-Corner";
29424
+ static props = {
29425
+ zone: Object,
29426
+ color: String,
29427
+ orientation: String,
29428
+ isResizing: Boolean,
29429
+ onResizeHighlight: Function,
29430
+ };
29234
29431
  isTop = this.props.orientation[0] === "n";
29235
29432
  isLeft = this.props.orientation[1] === "w";
29236
29433
  get style() {
@@ -29259,13 +29456,6 @@
29259
29456
  this.props.onResizeHighlight(this.isLeft, this.isTop);
29260
29457
  }
29261
29458
  }
29262
- Corner.props = {
29263
- zone: Object,
29264
- color: String,
29265
- orientation: String,
29266
- isResizing: Boolean,
29267
- onResizeHighlight: Function,
29268
- };
29269
29459
 
29270
29460
  css /*SCSS*/ `
29271
29461
  .o-highlight {
@@ -29274,6 +29464,10 @@
29274
29464
  `;
29275
29465
  class Highlight extends owl.Component {
29276
29466
  static template = "o-spreadsheet-Highlight";
29467
+ static props = {
29468
+ zone: Object,
29469
+ color: String,
29470
+ };
29277
29471
  static components = {
29278
29472
  Corner,
29279
29473
  Border,
@@ -29357,10 +29551,6 @@
29357
29551
  dragAndDropBeyondTheViewport(this.env, mouseMove, mouseUp);
29358
29552
  }
29359
29553
  }
29360
- Highlight.props = {
29361
- zone: Object,
29362
- color: String,
29363
- };
29364
29554
 
29365
29555
  let ScrollBar$1 = class ScrollBar {
29366
29556
  direction;
@@ -29400,6 +29590,14 @@
29400
29590
  }
29401
29591
  `;
29402
29592
  class ScrollBar extends owl.Component {
29593
+ static props = {
29594
+ width: { type: Number, optional: true },
29595
+ height: { type: Number, optional: true },
29596
+ direction: String,
29597
+ position: Object,
29598
+ offset: Number,
29599
+ onScroll: Function,
29600
+ };
29403
29601
  static template = owl.xml /*xml*/ `
29404
29602
  <div
29405
29603
  t-attf-class="o-scrollbar {{props.direction}}"
@@ -29443,16 +29641,11 @@
29443
29641
  }
29444
29642
  }
29445
29643
  }
29446
- ScrollBar.props = {
29447
- width: { type: Number, optional: true },
29448
- height: { type: Number, optional: true },
29449
- direction: String,
29450
- position: Object,
29451
- offset: Number,
29452
- onScroll: Function,
29453
- };
29454
29644
 
29455
29645
  class HorizontalScrollBar extends owl.Component {
29646
+ static props = {
29647
+ leftOffset: { type: Number, optional: true },
29648
+ };
29456
29649
  static components = { ScrollBar };
29457
29650
  static template = owl.xml /*xml*/ `
29458
29651
  <ScrollBar
@@ -29493,11 +29686,11 @@
29493
29686
  });
29494
29687
  }
29495
29688
  }
29496
- HorizontalScrollBar.props = {
29497
- leftOffset: { type: Number, optional: true },
29498
- };
29499
29689
 
29500
29690
  class VerticalScrollBar extends owl.Component {
29691
+ static props = {
29692
+ topOffset: { type: Number, optional: true },
29693
+ };
29501
29694
  static components = { ScrollBar };
29502
29695
  static template = owl.xml /*xml*/ `
29503
29696
  <ScrollBar
@@ -29538,9 +29731,6 @@
29538
29731
  });
29539
29732
  }
29540
29733
  }
29541
- VerticalScrollBar.props = {
29542
- topOffset: { type: Number, optional: true },
29543
- };
29544
29734
 
29545
29735
  const registries$1 = {
29546
29736
  ROW: rowMenuRegistry,
@@ -29554,6 +29744,13 @@
29554
29744
  // -----------------------------------------------------------------------------
29555
29745
  class Grid extends owl.Component {
29556
29746
  static template = "o-spreadsheet-Grid";
29747
+ static props = {
29748
+ sidePanelIsOpen: Boolean,
29749
+ exposeFocus: Function,
29750
+ focusComposer: String,
29751
+ onComposerContentFocused: Function,
29752
+ onGridComposerCellFocused: Function,
29753
+ };
29557
29754
  static components = {
29558
29755
  GridComposer,
29559
29756
  GridOverlay,
@@ -30158,13 +30355,6 @@
30158
30355
  }
30159
30356
  }
30160
30357
  }
30161
- Grid.props = {
30162
- sidePanelIsOpen: Boolean,
30163
- exposeFocus: Function,
30164
- focusComposer: String,
30165
- onComposerContentFocused: Function,
30166
- onGridComposerCellFocused: Function,
30167
- };
30168
30358
 
30169
30359
  /**
30170
30360
  * Represent a raw XML string
@@ -31585,20 +31775,26 @@
31585
31775
  .filter(isDefined$1);
31586
31776
  }
31587
31777
  function convertFigure(figure, id, sheetData) {
31588
- const x1 = getColPosition(figure.anchors[0].col, sheetData) +
31589
- convertEMUToDotValue(figure.anchors[0].colOffset);
31590
- const x2 = getColPosition(figure.anchors[1].col, sheetData) +
31591
- convertEMUToDotValue(figure.anchors[1].colOffset);
31592
- const y1 = getRowPosition(figure.anchors[0].row, sheetData) +
31593
- convertEMUToDotValue(figure.anchors[0].rowOffset);
31594
- const y2 = getRowPosition(figure.anchors[1].row, sheetData) +
31595
- convertEMUToDotValue(figure.anchors[1].rowOffset);
31778
+ let x1, y1;
31779
+ let height, width;
31780
+ if (figure.anchors.length === 1) {
31781
+ // one cell anchor
31782
+ ({ x: x1, y: y1 } = getPositionFromAnchor(figure.anchors[0], sheetData));
31783
+ width = convertEMUToDotValue(figure.figureSize.cx);
31784
+ height = convertEMUToDotValue(figure.figureSize.cy);
31785
+ }
31786
+ else {
31787
+ ({ x: x1, y: y1 } = getPositionFromAnchor(figure.anchors[0], sheetData));
31788
+ const { x: x2, y: y2 } = getPositionFromAnchor(figure.anchors[1], sheetData);
31789
+ width = x2 - x1;
31790
+ height = y2 - y1;
31791
+ }
31596
31792
  const figureData = { id, x: x1, y: y1 };
31597
31793
  if (isChartData(figure.data)) {
31598
31794
  return {
31599
31795
  ...figureData,
31600
- width: x2 - x1,
31601
- height: y2 - y1,
31796
+ width,
31797
+ height,
31602
31798
  tag: "chart",
31603
31799
  data: convertChartData(figure.data),
31604
31800
  };
@@ -31664,6 +31860,12 @@
31664
31860
  const dataXC = zoneToXc(zone);
31665
31861
  return getFullReference(sheetName, dataXC);
31666
31862
  }
31863
+ function getPositionFromAnchor(anchor, sheetData) {
31864
+ return {
31865
+ x: getColPosition(anchor.col, sheetData) + convertEMUToDotValue(anchor.colOffset),
31866
+ y: getRowPosition(anchor.row, sheetData) + convertEMUToDotValue(anchor.rowOffset),
31867
+ };
31868
+ }
31667
31869
 
31668
31870
  /**
31669
31871
  * Match external reference (ex. '[1]Sheet 3'!$B$4)
@@ -32787,27 +32989,50 @@
32787
32989
  }
32788
32990
  }
32789
32991
 
32992
+ const ONE_CELL_ANCHOR = "oneCellAnchor";
32993
+ const TWO_CELL_ANCHOR = "twoCellAnchor";
32790
32994
  class XlsxFigureExtractor extends XlsxBaseExtractor {
32791
32995
  extractFigures() {
32792
32996
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "xdr:wsDr", children: true }, (figureElement) => {
32793
32997
  const anchorType = removeTagEscapedNamespaces(figureElement.tagName);
32794
- if (anchorType !== "twoCellAnchor") {
32795
- throw new Error("Only twoCellAnchor are supported for xlsx drawings.");
32796
- }
32998
+ const anchors = this.extractFigureAnchorsByType(figureElement, anchorType);
32797
32999
  const chartElement = this.querySelector(figureElement, "c:chart");
32798
33000
  const imageElement = this.querySelector(figureElement, "a:blip");
32799
33001
  if (!chartElement && !imageElement) {
32800
33002
  throw new Error("Only chart and image figures are currently supported.");
32801
33003
  }
32802
33004
  return {
32803
- anchors: [
32804
- this.extractFigureAnchor("xdr:from", figureElement),
32805
- this.extractFigureAnchor("xdr:to", figureElement),
32806
- ],
33005
+ anchors,
32807
33006
  data: chartElement ? this.extractChart(chartElement) : this.extractImage(figureElement),
33007
+ figureSize: anchorType === ONE_CELL_ANCHOR
33008
+ ? this.extractFigureSizeFromSizeTag(figureElement, "xdr:ext")
33009
+ : undefined,
32808
33010
  };
32809
33011
  });
32810
33012
  }
33013
+ extractFigureAnchorsByType(figureElement, anchorType) {
33014
+ switch (anchorType) {
33015
+ case ONE_CELL_ANCHOR:
33016
+ return [this.extractFigureAnchor("xdr:from", figureElement)];
33017
+ case TWO_CELL_ANCHOR:
33018
+ return [
33019
+ this.extractFigureAnchor("xdr:from", figureElement),
33020
+ this.extractFigureAnchor("xdr:to", figureElement),
33021
+ ];
33022
+ default:
33023
+ throw new Error(`${anchorType} is not supported for xlsx drawings. `);
33024
+ }
33025
+ }
33026
+ extractFigureSizeFromSizeTag(figureElement, sizeTag) {
33027
+ const sizeElement = this.querySelector(figureElement, sizeTag);
33028
+ if (!sizeElement) {
33029
+ throw new Error(`Missing size element '${sizeTag}'`);
33030
+ }
33031
+ return {
33032
+ cx: this.extractAttr(sizeElement, "cx", { required: true }).asNum(),
33033
+ cy: this.extractAttr(sizeElement, "cy", { required: true }).asNum(),
33034
+ };
33035
+ }
32811
33036
  extractFigureAnchor(anchorTag, figureElement) {
32812
33037
  const anchor = this.querySelector(figureElement, anchorTag);
32813
33038
  if (!anchor) {
@@ -32836,15 +33061,15 @@
32836
33061
  if (!image) {
32837
33062
  throw new Error("Unable to extract image");
32838
33063
  }
32839
- const shapePropertyElement = this.querySelector(figureElement, "a:xfrm");
32840
33064
  const extension = image.fileName.split(".").at(-1);
33065
+ const anchorType = removeTagEscapedNamespaces(figureElement.tagName);
33066
+ const sizeElement = anchorType === TWO_CELL_ANCHOR ? this.querySelector(figureElement, "a:xfrm") : figureElement;
33067
+ const sizeTag = anchorType === TWO_CELL_ANCHOR ? "a:ext" : "xdr:ext";
33068
+ const size = this.extractFigureSizeFromSizeTag(sizeElement, sizeTag);
32841
33069
  return {
32842
33070
  imageSrc: image.imageSrc,
32843
33071
  mimetype: extension ? IMAGE_EXTENSION_TO_MIMETYPE_MAPPING[extension] : undefined,
32844
- size: {
32845
- cx: this.extractChildAttr(shapePropertyElement, "a:ext", "cx", { required: true }).asNum(),
32846
- cy: this.extractChildAttr(shapePropertyElement, "a:ext", "cy", { required: true }).asNum(),
32847
- },
33072
+ size,
32848
33073
  };
32849
33074
  }
32850
33075
  }
@@ -50819,6 +51044,20 @@
50819
51044
  `;
50820
51045
  class RippleEffect extends owl.Component {
50821
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
+ };
50822
51061
  rippleRef = owl.useRef("ripple");
50823
51062
  setup() {
50824
51063
  let animation = undefined;
@@ -50854,22 +51093,23 @@
50854
51093
  });
50855
51094
  }
50856
51095
  }
50857
- RippleEffect.props = {
50858
- x: String,
50859
- y: String,
50860
- color: String,
50861
- opacity: Number,
50862
- duration: Number,
50863
- width: Number,
50864
- height: Number,
50865
- offsetY: Number,
50866
- offsetX: Number,
50867
- allowOverflow: Boolean,
50868
- onAnimationEnd: Function,
50869
- style: String,
50870
- };
50871
51096
  class Ripple extends owl.Component {
50872
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
+ };
50873
51113
  static components = { RippleEffect };
50874
51114
  static defaultProps = {
50875
51115
  color: "#aaaaaa",
@@ -50955,21 +51195,6 @@
50955
51195
  };
50956
51196
  }
50957
51197
  }
50958
- Ripple.props = {
50959
- color: { type: String, optional: true },
50960
- opacity: { type: Number, optional: true },
50961
- duration: { type: Number, optional: true },
50962
- ignoreClickPosition: { type: Boolean, optional: true },
50963
- width: { type: Number, optional: true },
50964
- height: { type: Number, optional: true },
50965
- offsetY: { type: Number, optional: true },
50966
- offsetX: { type: Number, optional: true },
50967
- allowOverflow: { type: Boolean, optional: true },
50968
- enabled: { type: Boolean, optional: true },
50969
- onAnimationEnd: { type: Function, optional: true },
50970
- slots: Object,
50971
- class: { type: String, optional: true },
50972
- };
50973
51198
 
50974
51199
  function interactiveRenameSheet(env, sheetId, name, errorCallback) {
50975
51200
  const result = env.model.dispatch("RENAME_SHEET", { sheetId, name });
@@ -51027,6 +51252,12 @@
51027
51252
  `;
51028
51253
  class BottomBarSheet extends owl.Component {
51029
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
+ };
51030
51261
  static components = { Ripple };
51031
51262
  static defaultProps = {
51032
51263
  onMouseDown: () => { },
@@ -51148,12 +51379,6 @@
51148
51379
  return this.env.model.getters.getSheetName(this.props.sheetId);
51149
51380
  }
51150
51381
  }
51151
- BottomBarSheet.props = {
51152
- sheetId: String,
51153
- openContextMenu: Function,
51154
- style: { type: String, optional: true },
51155
- onMouseDown: { type: Function, optional: true },
51156
- };
51157
51382
 
51158
51383
  // -----------------------------------------------------------------------------
51159
51384
  // SpreadSheet
@@ -51171,6 +51396,10 @@
51171
51396
  `;
51172
51397
  class BottomBarStatistic extends owl.Component {
51173
51398
  static template = "o-spreadsheet-BottomBarStatisic";
51399
+ static props = {
51400
+ openContextMenu: Function,
51401
+ closeContextMenu: Function,
51402
+ };
51174
51403
  static components = { Ripple };
51175
51404
  selectedStatisticFn = "";
51176
51405
  statisticFnResults = {};
@@ -51217,10 +51446,6 @@
51217
51446
  return fnName + ": " + (fnValue !== undefined ? formatValue(fnValue, { locale }) : "__");
51218
51447
  }
51219
51448
  }
51220
- BottomBarStatistic.props = {
51221
- openContextMenu: Function,
51222
- closeContextMenu: Function,
51223
- };
51224
51449
 
51225
51450
  // -----------------------------------------------------------------------------
51226
51451
  // SpreadSheet
@@ -51271,6 +51496,9 @@
51271
51496
  `;
51272
51497
  class BottomBar extends owl.Component {
51273
51498
  static template = "o-spreadsheet-BottomBar";
51499
+ static props = {
51500
+ onClick: Function,
51501
+ };
51274
51502
  static components = { Menu, Ripple, BottomBarSheet, BottomBarStatistic };
51275
51503
  bottomBarRef = owl.useRef("bottomBar");
51276
51504
  sheetListRef = owl.useRef("sheetList");
@@ -51456,9 +51684,6 @@
51456
51684
  return this.sheetListRef.el.scrollWidth - this.sheetListRef.el.clientWidth;
51457
51685
  }
51458
51686
  }
51459
- BottomBar.props = {
51460
- onClick: Function,
51461
- };
51462
51687
 
51463
51688
  css /* scss */ `
51464
51689
  .o-dashboard-clickable-cell {
@@ -51469,6 +51694,7 @@
51469
51694
  let tKey = 1;
51470
51695
  class SpreadsheetDashboard extends owl.Component {
51471
51696
  static template = "o-spreadsheet-SpreadsheetDashboard";
51697
+ static props = {};
51472
51698
  static components = {
51473
51699
  GridOverlay,
51474
51700
  GridPopover,
@@ -51587,7 +51813,6 @@
51587
51813
  return { ...this.canvasPosition, ...this.env.model.getters.getSheetViewDimensionWithHeaders() };
51588
51814
  }
51589
51815
  }
51590
- SpreadsheetDashboard.props = {};
51591
51816
 
51592
51817
  css /* scss */ `
51593
51818
  .o-header-group {
@@ -51615,6 +51840,11 @@
51615
51840
  `;
51616
51841
  class AbstractHeaderGroup extends owl.Component {
51617
51842
  static template = "o-spreadsheet-HeaderGroup";
51843
+ static props = {
51844
+ group: Object,
51845
+ layerOffset: Number,
51846
+ openContextMenu: Function,
51847
+ };
51618
51848
  toggleGroup() {
51619
51849
  const sheetId = this.env.model.getters.getActiveSheetId();
51620
51850
  const { start, end } = this.props.group;
@@ -51651,11 +51881,6 @@
51651
51881
  this.props.openContextMenu(position, menuItems);
51652
51882
  }
51653
51883
  }
51654
- AbstractHeaderGroup.props = {
51655
- group: Object,
51656
- layerOffset: Number,
51657
- openContextMenu: Function,
51658
- };
51659
51884
  class RowGroup extends AbstractHeaderGroup {
51660
51885
  dimension = "ROW";
51661
51886
  get groupBorderStyle() {
@@ -51786,6 +52011,10 @@
51786
52011
  `;
51787
52012
  class HeaderGroupContainer extends owl.Component {
51788
52013
  static template = "o-spreadsheet-HeaderGroupContainer";
52014
+ static props = {
52015
+ dimension: String,
52016
+ layers: Array,
52017
+ };
51789
52018
  static components = { RowGroup, ColGroup, Menu };
51790
52019
  menu = owl.useState({ isOpen: false, position: null, menuItems: [] });
51791
52020
  getLayerOffset(layerIndex) {
@@ -51848,10 +52077,6 @@
51848
52077
  }
51849
52078
  }
51850
52079
  }
51851
- HeaderGroupContainer.props = {
51852
- dimension: String,
51853
- layers: Array,
51854
- };
51855
52080
 
51856
52081
  css /* scss */ `
51857
52082
  .o-sidePanel {
@@ -51962,14 +52187,6 @@
51962
52187
  text-align: left;
51963
52188
  }
51964
52189
 
51965
- .o-checkbox {
51966
- display: flex;
51967
- justify-items: center;
51968
- input {
51969
- margin-right: 5px;
51970
- }
51971
- }
51972
-
51973
52190
  .o-inflection {
51974
52191
  table {
51975
52192
  table-layout: fixed;
@@ -52010,6 +52227,11 @@
52010
52227
  `;
52011
52228
  class SidePanel extends owl.Component {
52012
52229
  static template = "o-spreadsheet-SidePanel";
52230
+ static props = {
52231
+ component: String,
52232
+ panelProps: { type: Object, optional: true },
52233
+ onCloseSidePanel: Function,
52234
+ };
52013
52235
  state;
52014
52236
  setup() {
52015
52237
  this.state = owl.useState({
@@ -52023,11 +52245,6 @@
52023
52245
  : this.state.panel.title;
52024
52246
  }
52025
52247
  }
52026
- SidePanel.props = {
52027
- component: String,
52028
- panelProps: { type: Object, optional: true },
52029
- onCloseSidePanel: Function,
52030
- };
52031
52248
 
52032
52249
  css /* scss */ `
52033
52250
  .o-menu-item-button {
@@ -52045,6 +52262,13 @@
52045
52262
  `;
52046
52263
  class ActionButton extends owl.Component {
52047
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
+ };
52048
52272
  actionButton = createAction(this.props.action);
52049
52273
  setup() {
52050
52274
  owl.onWillUpdateProps((nextProps) => {
@@ -52087,13 +52311,6 @@
52087
52311
  return "";
52088
52312
  }
52089
52313
  }
52090
- ActionButton.props = {
52091
- action: Object,
52092
- hasTriangleDownIcon: { type: Boolean, optional: true },
52093
- selectedColor: { type: String, optional: true },
52094
- class: { type: String, optional: true },
52095
- onClick: { type: Function, optional: true },
52096
- };
52097
52314
 
52098
52315
  /**
52099
52316
  * List the available borders positions and the corresponding icons.
@@ -52190,6 +52407,17 @@
52190
52407
  `;
52191
52408
  class BorderEditor extends owl.Component {
52192
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
+ };
52193
52421
  static components = { ColorPickerWidget, Popover };
52194
52422
  BORDER_POSITIONS = BORDER_POSITIONS;
52195
52423
  lineStyleButtonRef = owl.useRef("lineStyleButton");
@@ -52245,20 +52473,16 @@
52245
52473
  };
52246
52474
  }
52247
52475
  }
52248
- BorderEditor.props = {
52249
- class: { type: String, optional: true },
52250
- currentBorderColor: { type: String, optional: false },
52251
- currentBorderStyle: { type: String, optional: false },
52252
- currentBorderPosition: { type: String, optional: true },
52253
- onBorderColorPicked: Function,
52254
- onBorderStylePicked: Function,
52255
- onBorderPositionPicked: Function,
52256
- maxHeight: { type: Number, optional: true },
52257
- anchorRect: Object,
52258
- };
52259
52476
 
52260
52477
  class BorderEditorWidget extends owl.Component {
52261
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
+ };
52262
52486
  static components = { BorderEditor };
52263
52487
  borderEditorButtonRef = owl.useRef("borderEditorButton");
52264
52488
  state = owl.useState({
@@ -52303,13 +52527,6 @@
52303
52527
  });
52304
52528
  }
52305
52529
  }
52306
- BorderEditorWidget.props = {
52307
- toggleBorderEditor: Function,
52308
- showBorderEditor: Boolean,
52309
- disabled: { type: Boolean, optional: true },
52310
- dropdownMaxHeight: { type: Number, optional: true },
52311
- class: { type: String, optional: true },
52312
- };
52313
52530
 
52314
52531
  const COMPOSER_MAX_HEIGHT = 100;
52315
52532
  /* svg free of use from https://uxwing.com/formula-fx-icon/ */
@@ -52338,6 +52555,12 @@
52338
52555
  `;
52339
52556
  class TopBarComposer extends owl.Component {
52340
52557
  static template = "o-spreadsheet-TopBarComposer";
52558
+ static props = {
52559
+ focus: {
52560
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
52561
+ },
52562
+ onComposerContentFocused: Function,
52563
+ };
52341
52564
  static components = { Composer };
52342
52565
  get composerStyle() {
52343
52566
  const style = {
@@ -52360,10 +52583,6 @@
52360
52583
  });
52361
52584
  }
52362
52585
  }
52363
- TopBarComposer.props = {
52364
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
52365
- onComposerContentFocused: Function,
52366
- };
52367
52586
 
52368
52587
  css /* scss */ `
52369
52588
  .o-font-size-editor {
@@ -52392,6 +52611,11 @@
52392
52611
  `;
52393
52612
  class FontSizeEditor extends owl.Component {
52394
52613
  static template = "o-spreadsheet-FontSizeEditor";
52614
+ static props = {
52615
+ onToggle: Function,
52616
+ dropdownStyle: String,
52617
+ class: String,
52618
+ };
52395
52619
  static components = {};
52396
52620
  fontSizes = FONT_SIZES;
52397
52621
  dropdown = owl.useState({ isOpen: false });
@@ -52448,14 +52672,12 @@
52448
52672
  }
52449
52673
  }
52450
52674
  }
52451
- FontSizeEditor.props = {
52452
- onToggle: Function,
52453
- dropdownStyle: String,
52454
- class: String,
52455
- };
52456
52675
 
52457
52676
  class PaintFormatButton extends owl.Component {
52458
52677
  static template = "o-spreadsheet-PaintFormatButton";
52678
+ static props = {
52679
+ class: { type: String, optional: true },
52680
+ };
52459
52681
  get isActive() {
52460
52682
  return this.env.model.getters.isPaintingFormat();
52461
52683
  }
@@ -52471,9 +52693,6 @@
52471
52693
  }
52472
52694
  }
52473
52695
  }
52474
- PaintFormatButton.props = {
52475
- class: { type: String, optional: true },
52476
- };
52477
52696
 
52478
52697
  // -----------------------------------------------------------------------------
52479
52698
  // TopBar
@@ -52566,6 +52785,12 @@
52566
52785
  `;
52567
52786
  class TopBar extends owl.Component {
52568
52787
  static template = "o-spreadsheet-TopBar";
52788
+ static props = {
52789
+ onClick: Function,
52790
+ focusComposer: String,
52791
+ onComposerContentFocused: Function,
52792
+ dropdownMaxHeight: Number,
52793
+ };
52569
52794
  get dropdownStyle() {
52570
52795
  return `max-height:${this.props.dropdownMaxHeight}px`;
52571
52796
  }
@@ -52682,12 +52907,6 @@
52682
52907
  this.onClick();
52683
52908
  }
52684
52909
  }
52685
- TopBar.props = {
52686
- onClick: Function,
52687
- focusComposer: String,
52688
- onComposerContentFocused: Function,
52689
- dropdownMaxHeight: Number,
52690
- };
52691
52910
 
52692
52911
  function instantiateClipboard() {
52693
52912
  return new WebClipboardWrapper(navigator.clipboard);
@@ -52920,6 +53139,9 @@
52920
53139
  `;
52921
53140
  class Spreadsheet extends owl.Component {
52922
53141
  static template = "o-spreadsheet-Spreadsheet";
53142
+ static props = {
53143
+ model: Object,
53144
+ };
52923
53145
  static components = {
52924
53146
  TopBar,
52925
53147
  Grid,
@@ -53132,9 +53354,6 @@
53132
53354
  return this.env.model.getters.getVisibleGroupLayers(sheetId, "COL");
53133
53355
  }
53134
53356
  }
53135
- Spreadsheet.props = {
53136
- model: Object,
53137
- };
53138
53357
 
53139
53358
  class LocalTransportService {
53140
53359
  listeners = [];
@@ -56816,9 +57035,9 @@
56816
57035
  exports.tokenize = tokenize;
56817
57036
 
56818
57037
 
56819
- __info__.version = "17.1.0-alpha.6";
56820
- __info__.date = "2024-01-04T12:22:45.921Z";
56821
- __info__.hash = "56dbdc9";
57038
+ __info__.version = "17.1.0-alpha.7";
57039
+ __info__.date = "2024-01-12T13:45:00.505Z";
57040
+ __info__.hash = "cbce1ed";
56822
57041
 
56823
57042
 
56824
57043
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);