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