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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.1.0-alpha.6
6
- * @date 2024-01-04T12:22:45.921Z
7
- * @hash 56dbdc9
5
+ * @version 17.1.0
6
+ * @date 2024-01-16T07:47:15.054Z
7
+ * @hash 87253c7
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -478,7 +478,7 @@ function isBoolean(str) {
478
478
  const upperCased = str.toUpperCase();
479
479
  return upperCased === "TRUE" || upperCased === "FALSE";
480
480
  }
481
- const MARKDOWN_LINK_REGEX = /^\[([^\[]+)\]\((.+)\)$/;
481
+ const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
482
482
  //link must start with http or https
483
483
  //https://stackoverflow.com/a/3809435/4760614
484
484
  const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
@@ -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
  }
@@ -1805,12 +1873,8 @@ const invalidateEvaluationCommands = new Set([
1805
1873
  "ADD_MERGE",
1806
1874
  "UPDATE_LOCALE",
1807
1875
  ]);
1808
- const invalidateDependenciesCommands = new Set([
1809
- ...invalidateEvaluationCommands,
1810
- "MOVE_RANGES",
1811
- ]);
1876
+ const invalidateDependenciesCommands = new Set(["MOVE_RANGES"]);
1812
1877
  const invalidateCFEvaluationCommands = new Set([
1813
- ...invalidateEvaluationCommands,
1814
1878
  "DUPLICATE_SHEET",
1815
1879
  "EVALUATE_CELLS",
1816
1880
  "ADD_CONDITIONAL_FORMAT",
@@ -2719,20 +2783,20 @@ function flattenRowFirst(items, callback) {
2719
2783
  }
2720
2784
 
2721
2785
  function toCriterionDateNumber(dateValue) {
2722
- const today = new Date();
2786
+ const today = DateTime.now();
2723
2787
  switch (dateValue) {
2724
2788
  case "today":
2725
2789
  return jsDateToNumber(today);
2726
2790
  case "yesterday":
2727
- return jsDateToNumber(new Date(today.setDate(today.getDate() - 1)));
2791
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() - 1)));
2728
2792
  case "tomorrow":
2729
- return jsDateToNumber(new Date(today.setDate(today.getDate() + 1)));
2793
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() + 1)));
2730
2794
  case "lastWeek":
2731
- return jsDateToNumber(new Date(today.setDate(today.getDate() - 7)));
2795
+ return jsDateToNumber(DateTime.fromTimestamp(today.setDate(today.getDate() - 7)));
2732
2796
  case "lastMonth":
2733
- return jsDateToNumber(new Date(today.setMonth(today.getMonth() - 1)));
2797
+ return jsDateToNumber(DateTime.fromTimestamp(today.setMonth(today.getMonth() - 1)));
2734
2798
  case "lastYear":
2735
- return jsDateToNumber(new Date(today.setFullYear(today.getFullYear() - 1)));
2799
+ return jsDateToNumber(DateTime.fromTimestamp(today.setFullYear(today.getFullYear() - 1)));
2736
2800
  }
2737
2801
  }
2738
2802
  /** Get all the dates values of a criterion converted to numbers, converting date values such as "today" to actual dates */
@@ -3093,7 +3157,7 @@ function formatJSTime(jsDate, format) {
3093
3157
  .map((p) => {
3094
3158
  switch (p) {
3095
3159
  case "hhhh":
3096
- const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY) / (60 * 60 * 1000));
3160
+ const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY.getTime()) / (60 * 60 * 1000));
3097
3161
  return helapsedHours.toString();
3098
3162
  case "hh":
3099
3163
  return hours.toString().padStart(2, "0");
@@ -4661,6 +4725,9 @@ function transformRangeData(range, executed) {
4661
4725
 
4662
4726
  class ChartJsComponent extends Component {
4663
4727
  static template = "o-spreadsheet-ChartJsComponent";
4728
+ static props = {
4729
+ figure: Object,
4730
+ };
4664
4731
  canvas = useRef("graphContainer");
4665
4732
  chart;
4666
4733
  get background() {
@@ -4713,9 +4780,6 @@ class ChartJsComponent extends Component {
4713
4780
  this.chart.update("active");
4714
4781
  }
4715
4782
  }
4716
- ChartJsComponent.props = {
4717
- figure: Object,
4718
- };
4719
4783
 
4720
4784
  /**
4721
4785
  * AbstractChart is the class from which every Chart should inherit.
@@ -5566,6 +5630,9 @@ class KeyValueElement extends ScorecardScalableElement {
5566
5630
 
5567
5631
  class ScorecardChart extends Component {
5568
5632
  static template = "o-spreadsheet-ScorecardChart";
5633
+ static props = {
5634
+ figure: Object,
5635
+ };
5569
5636
  canvas = useRef("chartContainer");
5570
5637
  get runtime() {
5571
5638
  return this.env.model.getters.getChartRuntime(this.props.figure.id);
@@ -5583,9 +5650,6 @@ class ScorecardChart extends Component {
5583
5650
  drawScoreChart(config, canvas);
5584
5651
  }
5585
5652
  }
5586
- ScorecardChart.props = {
5587
- figure: Object,
5588
- };
5589
5653
 
5590
5654
  /**
5591
5655
  * Registry
@@ -6264,11 +6328,11 @@ css /* scss */ `
6264
6328
  class ErrorToolTip extends Component {
6265
6329
  static maxSize = { maxHeight: ERROR_TOOLTIP_MAX_HEIGHT };
6266
6330
  static template = "o-spreadsheet-ErrorToolTip";
6331
+ static props = {
6332
+ errors: Array,
6333
+ onClosed: { type: Function, optional: true },
6334
+ };
6267
6335
  }
6268
- ErrorToolTip.props = {
6269
- errors: Array,
6270
- onClosed: { type: Function, optional: true },
6271
- };
6272
6336
  const ErrorToolTipPopoverBuilder = {
6273
6337
  onHover: (position, getters) => {
6274
6338
  const cell = getters.getEvaluatedCell(position);
@@ -6310,6 +6374,14 @@ css /*SCSS*/ `
6310
6374
  `;
6311
6375
  class FilterMenuValueItem extends Component {
6312
6376
  static template = "o-spreadsheet-FilterMenuValueItem";
6377
+ static props = {
6378
+ value: String,
6379
+ isChecked: Boolean,
6380
+ isSelected: Boolean,
6381
+ onMouseMove: Function,
6382
+ onClick: Function,
6383
+ scrolledTo: { type: String, optional: true },
6384
+ };
6313
6385
  itemRef = useRef("menuValueItem");
6314
6386
  setup() {
6315
6387
  onWillPatch(() => {
@@ -6327,17 +6399,9 @@ class FilterMenuValueItem extends Component {
6327
6399
  });
6328
6400
  }
6329
6401
  }
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
6402
 
6339
6403
  const FILTER_MENU_HEIGHT = 295;
6340
- const CSS$2 = css /* scss */ `
6404
+ const CSS = css /* scss */ `
6341
6405
  .o-filter-menu {
6342
6406
  box-sizing: border-box;
6343
6407
  padding: 8px 16px;
@@ -6433,9 +6497,12 @@ const CSS$2 = css /* scss */ `
6433
6497
  }
6434
6498
  `;
6435
6499
  class FilterMenu extends Component {
6436
- static size = { width: MENU_WIDTH, height: FILTER_MENU_HEIGHT };
6437
6500
  static template = "o-spreadsheet-FilterMenu";
6438
- static style = CSS$2;
6501
+ static props = {
6502
+ filterPosition: Object,
6503
+ onClosed: { type: Function, optional: true },
6504
+ };
6505
+ static style = CSS;
6439
6506
  static components = { FilterMenuValueItem };
6440
6507
  state = useState({
6441
6508
  values: [],
@@ -6587,10 +6654,6 @@ class FilterMenu extends Component {
6587
6654
  this.props.onClosed?.();
6588
6655
  }
6589
6656
  }
6590
- FilterMenu.props = {
6591
- filterPosition: Object,
6592
- onClosed: { type: Function, optional: true },
6593
- };
6594
6657
  const FilterMenuPopoverBuilder = {
6595
6658
  onOpen: (position, getters) => {
6596
6659
  return {
@@ -6792,6 +6855,19 @@ css /* scss */ `
6792
6855
  `;
6793
6856
  class Popover extends Component {
6794
6857
  static template = "o-spreadsheet-Popover";
6858
+ static props = {
6859
+ anchorRect: Object,
6860
+ containerRect: { type: Object, optional: true },
6861
+ positioning: { type: String, optional: true },
6862
+ maxWidth: { type: Number, optional: true },
6863
+ maxHeight: { type: Number, optional: true },
6864
+ verticalOffset: { type: Number, optional: true },
6865
+ onMouseWheel: { type: Function, optional: true },
6866
+ onPopoverHidden: { type: Function, optional: true },
6867
+ onPopoverMoved: { type: Function, optional: true },
6868
+ zIndex: { type: Number, optional: true },
6869
+ slots: Object,
6870
+ };
6795
6871
  static defaultProps = {
6796
6872
  positioning: "BottomLeft",
6797
6873
  verticalOffset: 0,
@@ -6848,19 +6924,6 @@ class Popover extends Component {
6848
6924
  });
6849
6925
  }
6850
6926
  }
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
6927
  class PopoverPositionContext {
6865
6928
  anchorRect;
6866
6929
  containerRect;
@@ -7042,6 +7105,15 @@ css /* scss */ `
7042
7105
  `;
7043
7106
  class Menu extends Component {
7044
7107
  static template = "o-spreadsheet-Menu";
7108
+ static props = {
7109
+ position: Object,
7110
+ menuItems: Array,
7111
+ depth: { type: Number, optional: true },
7112
+ maxHeight: { type: Number, optional: true },
7113
+ onClose: Function,
7114
+ onMenuClicked: { type: Function, optional: true },
7115
+ menuId: { type: String, optional: true },
7116
+ };
7045
7117
  static components = { Menu, Popover };
7046
7118
  static defaultProps = {
7047
7119
  depth: 1,
@@ -7198,15 +7270,6 @@ class Menu extends Component {
7198
7270
  }
7199
7271
  }
7200
7272
  }
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
7273
 
7211
7274
  const LINK_TOOLTIP_HEIGHT = 32;
7212
7275
  const LINK_TOOLTIP_WIDTH = 220;
@@ -7259,8 +7322,12 @@ css /* scss */ `
7259
7322
  }
7260
7323
  `;
7261
7324
  class LinkDisplay extends Component {
7262
- static components = { Menu };
7263
7325
  static template = "o-spreadsheet-LinkDisplay";
7326
+ static props = {
7327
+ cellPosition: Object,
7328
+ onClosed: { type: Function, optional: true },
7329
+ };
7330
+ static components = { Menu };
7264
7331
  get cell() {
7265
7332
  const { col, row } = this.props.cellPosition;
7266
7333
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -7315,10 +7382,6 @@ const LinkCellPopoverBuilder = {
7315
7382
  };
7316
7383
  },
7317
7384
  };
7318
- LinkDisplay.props = {
7319
- cellPosition: Object,
7320
- onClosed: { type: Function, optional: true },
7321
- };
7322
7385
 
7323
7386
  /**
7324
7387
  * Tokenizer
@@ -7952,6 +8015,10 @@ css /* scss */ `
7952
8015
  `;
7953
8016
  class LinkEditor extends Component {
7954
8017
  static template = "o-spreadsheet-LinkEditor";
8018
+ static props = {
8019
+ cellPosition: Object,
8020
+ onClosed: { type: Function, optional: true },
8021
+ };
7955
8022
  static components = { Menu };
7956
8023
  menuItems = linkMenuRegistry.getMenuItems();
7957
8024
  link = useState(this.defaultState);
@@ -8049,10 +8116,6 @@ const LinkEditorPopoverBuilder = {
8049
8116
  };
8050
8117
  },
8051
8118
  };
8052
- LinkEditor.props = {
8053
- cellPosition: Object,
8054
- onClosed: { type: Function, optional: true },
8055
- };
8056
8119
 
8057
8120
  const cellPopoverRegistry = new Registry();
8058
8121
  cellPopoverRegistry
@@ -8335,6 +8398,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale })
8335
8398
  labels: labels.map(truncateLabel),
8336
8399
  datasets: [],
8337
8400
  },
8401
+ platform: undefined,
8338
8402
  plugins: [],
8339
8403
  };
8340
8404
  }
@@ -9639,6 +9703,10 @@ css /* scss */ `
9639
9703
  `;
9640
9704
  class ChartFigure extends Component {
9641
9705
  static template = "o-spreadsheet-ChartFigure";
9706
+ static props = {
9707
+ figure: Object,
9708
+ onFigureDeleted: Function,
9709
+ };
9642
9710
  static components = {};
9643
9711
  onDoubleClick() {
9644
9712
  this.env.model.dispatch("SELECT_FIGURE", { id: this.props.figure.id });
@@ -9656,13 +9724,13 @@ class ChartFigure extends Component {
9656
9724
  return component;
9657
9725
  }
9658
9726
  }
9659
- ChartFigure.props = {
9660
- figure: Object,
9661
- onFigureDeleted: Function,
9662
- };
9663
9727
 
9664
9728
  class ImageFigure extends Component {
9665
9729
  static template = "o-spreadsheet-ImageFigure";
9730
+ static props = {
9731
+ figure: Object,
9732
+ onFigureDeleted: Function,
9733
+ };
9666
9734
  static components = {};
9667
9735
  // ---------------------------------------------------------------------------
9668
9736
  // Getters
@@ -9674,10 +9742,6 @@ class ImageFigure extends Component {
9674
9742
  return this.env.model.getters.getImagePath(this.figureId);
9675
9743
  }
9676
9744
  }
9677
- ImageFigure.props = {
9678
- figure: Object,
9679
- onFigureDeleted: Function,
9680
- };
9681
9745
 
9682
9746
  function centerFigurePosition(getters, size) {
9683
9747
  const { x: offsetCorrectionX, y: offsetCorrectionY } = getters.getMainViewportCoordinates();
@@ -10965,6 +11029,9 @@ function arg(definition, description = "") {
10965
11029
  function makeArg(str, description) {
10966
11030
  let parts = str.match(ARG_REGEXP);
10967
11031
  let name = parts[1].trim();
11032
+ if (!name) {
11033
+ throw new Error(`Function argument definition is missing a name: '${str}'.`);
11034
+ }
10968
11035
  let types = [];
10969
11036
  let isOptional = false;
10970
11037
  let isRepeating = false;
@@ -14687,7 +14754,7 @@ const DATE = {
14687
14754
  if (_year < 1900) {
14688
14755
  _year += 1900;
14689
14756
  }
14690
- const jsDate = new Date(_year, _month - 1, _day);
14757
+ const jsDate = new DateTime(_year, _month - 1, _day);
14691
14758
  const result = jsDateToRoundNumber(jsDate);
14692
14759
  assert(() => result >= 0, _t("The function [[FUNCTION_NAME]] result must be greater than or equal 01/01/1900."));
14693
14760
  return result;
@@ -14730,7 +14797,7 @@ const DATEDIF = {
14730
14797
  // See: https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c
14731
14798
  let days = jsEndDate.getDate() - jsStartDate.getDate();
14732
14799
  if (days < 0) {
14733
- const monthBeforeEndMonth = new Date(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
14800
+ const monthBeforeEndMonth = new DateTime(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
14734
14801
  const daysInMonthBeforeEndMonth = getDaysInMonth(monthBeforeEndMonth);
14735
14802
  days = daysInMonthBeforeEndMonth - Math.abs(days);
14736
14803
  }
@@ -14739,7 +14806,7 @@ const DATEDIF = {
14739
14806
  if (areTwoDatesWithinOneYear(_startDate, _endDate)) {
14740
14807
  return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
14741
14808
  }
14742
- const endDateWithinOneYear = new Date(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
14809
+ const endDateWithinOneYear = new DateTime(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
14743
14810
  let days = getTimeDifferenceInWholeDays(jsStartDate, endDateWithinOneYear);
14744
14811
  if (days < 0) {
14745
14812
  endDateWithinOneYear.setFullYear(jsStartDate.getFullYear() + 1);
@@ -14856,7 +14923,7 @@ const EOMONTH = {
14856
14923
  const _months = Math.trunc(toNumber(months, this.locale));
14857
14924
  const yStart = _startDate.getFullYear();
14858
14925
  const mStart = _startDate.getMonth();
14859
- const jsDate = new Date(yStart, mStart + _months + 1, 0);
14926
+ const jsDate = new DateTime(yStart, mStart + _months + 1, 0);
14860
14927
  return jsDateToRoundNumber(jsDate);
14861
14928
  },
14862
14929
  isExported: true,
@@ -14893,17 +14960,17 @@ const ISOWEEKNUM = {
14893
14960
  // The first week of the year is the week that contains the first
14894
14961
  // Thursday of the year.
14895
14962
  let firstThursday = 1;
14896
- while (new Date(y, 0, firstThursday).getDay() !== 4) {
14963
+ while (new DateTime(y, 0, firstThursday).getDay() !== 4) {
14897
14964
  firstThursday += 1;
14898
14965
  }
14899
- const firstDayOfFirstWeek = new Date(y, 0, firstThursday - 3);
14966
+ const firstDayOfFirstWeek = new DateTime(y, 0, firstThursday - 3);
14900
14967
  // The last week of the year is the week that contains the last Thursday of
14901
14968
  // the year.
14902
14969
  let lastThursday = 31;
14903
- while (new Date(y, 11, lastThursday).getDay() !== 4) {
14970
+ while (new DateTime(y, 11, lastThursday).getDay() !== 4) {
14904
14971
  lastThursday -= 1;
14905
14972
  }
14906
- const lastDayOfLastWeek = new Date(y, 11, lastThursday + 3);
14973
+ const lastDayOfLastWeek = new DateTime(y, 11, lastThursday + 3);
14907
14974
  // B - If our date > lastDayOfLastWeek then it's in the weeks of the year after
14908
14975
  // If our date < firstDayOfFirstWeek then it's in the weeks of the year before
14909
14976
  let offsetYear;
@@ -14929,17 +14996,17 @@ const ISOWEEKNUM = {
14929
14996
  case 1:
14930
14997
  // firstDay is the 1st day of the 1st week of the year after
14931
14998
  // firstDay = lastDayOfLastWeek + 1 Day
14932
- firstDay = new Date(y, 11, lastThursday + 3 + 1);
14999
+ firstDay = new DateTime(y, 11, lastThursday + 3 + 1);
14933
15000
  break;
14934
15001
  case -1:
14935
15002
  // firstDay is the 1st day of the 1st week of the previous year.
14936
15003
  // The first week of the previous year is the week that contains the
14937
15004
  // first Thursday of the previous year.
14938
15005
  let firstThursdayPreviousYear = 1;
14939
- while (new Date(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
15006
+ while (new DateTime(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
14940
15007
  firstThursdayPreviousYear += 1;
14941
15008
  }
14942
- firstDay = new Date(y - 1, 0, firstThursdayPreviousYear - 3);
15009
+ firstDay = new DateTime(y - 1, 0, firstThursdayPreviousYear - 3);
14943
15010
  break;
14944
15011
  }
14945
15012
  const diff = (_date.getTime() - firstDay.getTime()) / MS_PER_DAY;
@@ -15074,8 +15141,8 @@ const NETWORKDAYS_INTL = {
15074
15141
  });
15075
15142
  }
15076
15143
  const invertDate = _startDate.getTime() > _endDate.getTime();
15077
- const stopDate = new Date((invertDate ? _startDate : _endDate).getTime());
15078
- let stepDate = new Date((invertDate ? _endDate : _startDate).getTime());
15144
+ const stopDate = DateTime.fromTimestamp((invertDate ? _startDate : _endDate).getTime());
15145
+ let stepDate = DateTime.fromTimestamp((invertDate ? _endDate : _startDate).getTime());
15079
15146
  const timeStopDate = stopDate.getTime();
15080
15147
  let timeStepDate = stepDate.getTime();
15081
15148
  let netWorkingDay = 0;
@@ -15101,8 +15168,7 @@ const NOW = {
15101
15168
  return getDateTimeFormat(this.locale);
15102
15169
  },
15103
15170
  compute: function () {
15104
- let today = new Date();
15105
- today.setMilliseconds(0);
15171
+ let today = DateTime.now();
15106
15172
  const delta = today.getTime() - INITIAL_1900_DAY.getTime();
15107
15173
  const time = today.getHours() / 24 + today.getMinutes() / 1440 + today.getSeconds() / 86400;
15108
15174
  return Math.floor(delta / MS_PER_DAY) + time;
@@ -15176,8 +15242,8 @@ const TODAY = {
15176
15242
  return this.locale.dateFormat;
15177
15243
  },
15178
15244
  compute: function () {
15179
- const today = new Date();
15180
- const jsDate = new Date(today.getFullYear(), today.getMonth(), today.getDate());
15245
+ const today = DateTime.now();
15246
+ const jsDate = new DateTime(today.getFullYear(), today.getMonth(), today.getDate());
15181
15247
  return jsDateToRoundNumber(jsDate);
15182
15248
  },
15183
15249
  isExported: true,
@@ -15232,10 +15298,10 @@ const WEEKNUM = {
15232
15298
  }
15233
15299
  const y = _date.getFullYear();
15234
15300
  let dayStart = 1;
15235
- let startDayOfFirstWeek = new Date(y, 0, dayStart);
15301
+ let startDayOfFirstWeek = new DateTime(y, 0, dayStart);
15236
15302
  while (startDayOfFirstWeek.getDay() !== startDayOfWeek) {
15237
15303
  dayStart += 1;
15238
- startDayOfFirstWeek = new Date(y, 0, dayStart);
15304
+ startDayOfFirstWeek = new DateTime(y, 0, dayStart);
15239
15305
  }
15240
15306
  const dif = (_date.getTime() - startDayOfFirstWeek.getTime()) / MS_PER_DAY;
15241
15307
  if (dif < 0) {
@@ -15293,7 +15359,7 @@ const WORKDAY_INTL = {
15293
15359
  timesHoliday.add(holiday.getTime());
15294
15360
  });
15295
15361
  }
15296
- let stepDate = new Date(_startDate.getTime());
15362
+ let stepDate = DateTime.fromTimestamp(_startDate.getTime());
15297
15363
  let timeStepDate = stepDate.getTime();
15298
15364
  const unitDay = Math.sign(_numDays);
15299
15365
  let stepDay = Math.abs(_numDays);
@@ -15357,7 +15423,7 @@ const MONTH_START = {
15357
15423
  const _startDate = toJsDate(date, this.locale);
15358
15424
  const yStart = _startDate.getFullYear();
15359
15425
  const mStart = _startDate.getMonth();
15360
- const jsDate = new Date(yStart, mStart, 1);
15426
+ const jsDate = new DateTime(yStart, mStart, 1);
15361
15427
  return jsDateToRoundNumber(jsDate);
15362
15428
  },
15363
15429
  };
@@ -15399,7 +15465,7 @@ const QUARTER_START = {
15399
15465
  compute: function (date) {
15400
15466
  const quarter = QUARTER.compute.bind(this)(date);
15401
15467
  const year = YEAR.compute.bind(this)(date);
15402
- const jsDate = new Date(year, (quarter - 1) * 3, 1);
15468
+ const jsDate = new DateTime(year, (quarter - 1) * 3, 1);
15403
15469
  return jsDateToRoundNumber(jsDate);
15404
15470
  },
15405
15471
  };
@@ -15416,7 +15482,7 @@ const QUARTER_END = {
15416
15482
  compute: function (date) {
15417
15483
  const quarter = QUARTER.compute.bind(this)(date);
15418
15484
  const year = YEAR.compute.bind(this)(date);
15419
- const jsDate = new Date(year, quarter * 3, 0);
15485
+ const jsDate = new DateTime(year, quarter * 3, 0);
15420
15486
  return jsDateToRoundNumber(jsDate);
15421
15487
  },
15422
15488
  };
@@ -15432,7 +15498,7 @@ const YEAR_START = {
15432
15498
  },
15433
15499
  compute: function (date) {
15434
15500
  const year = YEAR.compute.bind(this)(date);
15435
- const jsDate = new Date(year, 0, 1);
15501
+ const jsDate = new DateTime(year, 0, 1);
15436
15502
  return jsDateToRoundNumber(jsDate);
15437
15503
  },
15438
15504
  };
@@ -15448,7 +15514,7 @@ const YEAR_END = {
15448
15514
  },
15449
15515
  compute: function (date) {
15450
15516
  const year = YEAR.compute.bind(this)(date);
15451
- const jsDate = new Date(year + 1, 0, 0);
15517
+ const jsDate = new DateTime(year + 1, 0, 0);
15452
15518
  return jsDateToRoundNumber(jsDate);
15453
15519
  },
15454
15520
  };
@@ -15496,8 +15562,8 @@ const DEFAULT_DELTA_ARG = 0;
15496
15562
  const DELTA = {
15497
15563
  description: _t("Compare two numeric values, returning 1 if they're equal."),
15498
15564
  args: [
15499
- arg(" (number)", _t("The first number to compare.")),
15500
- arg(` (number, default=${DEFAULT_DELTA_ARG})`, _t("The second number to compare.")),
15565
+ arg("number1 (number)", _t("The first number to compare.")),
15566
+ arg(`number2 (number, default=${DEFAULT_DELTA_ARG})`, _t("The second number to compare.")),
15501
15567
  ],
15502
15568
  returns: ["NUMBER"],
15503
15569
  compute: function (number1, number2 = DEFAULT_DELTA_ARG) {
@@ -15924,7 +15990,7 @@ function assertDeprecationFactorStrictlyPositive(factor) {
15924
15990
  function assertSettlementLessThanOneYearBeforeMaturity(settlement, maturity, locale) {
15925
15991
  const startDate = toJsDate(settlement, locale);
15926
15992
  const endDate = toJsDate(maturity, locale);
15927
- const startDatePlusOneYear = new Date(startDate);
15993
+ const startDatePlusOneYear = toJsDate(settlement, locale);
15928
15994
  startDatePlusOneYear.setFullYear(startDate.getFullYear() + 1);
15929
15995
  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
15996
  }
@@ -16059,7 +16125,7 @@ const AMORLINC = {
16059
16125
  arg("salvage (number)", _t("The value of the asset at the end of depreciation.")),
16060
16126
  arg("period (number)", _t("The single period within life for which to calculate depreciation.")),
16061
16127
  arg("rate (number)", _t("The deprecation rate.")),
16062
- arg(" (number, optional)", _t("An indicator of what day count method to use.")),
16128
+ arg("day_count_convention (number, optional)", _t("An indicator of what day count method to use.")),
16063
16129
  ],
16064
16130
  returns: ["NUMBER"],
16065
16131
  compute: function (cost, purchaseDate, firstPeriodEnd, salvage, period, rate, dayCountConvention = DEFAULT_DAY_COUNT_CONVENTION) {
@@ -19231,8 +19297,8 @@ const MID = {
19231
19297
  description: _t("A segment of a string."),
19232
19298
  args: [
19233
19299
  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.")),
19300
+ 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.")),
19301
+ arg("extract_length (number)", _t("The length of the segment to extract.")),
19236
19302
  ],
19237
19303
  returns: ["STRING"],
19238
19304
  compute: function (text, starting_at, extract_length) {
@@ -21515,6 +21581,15 @@ css /* scss */ `
21515
21581
  */
21516
21582
  class SelectionInput extends Component {
21517
21583
  static template = "o-spreadsheet-SelectionInput";
21584
+ static props = {
21585
+ ranges: Function,
21586
+ hasSingleRange: { type: Boolean, optional: true },
21587
+ required: { type: Boolean, optional: true },
21588
+ isInvalid: { type: Boolean, optional: true },
21589
+ class: { type: String, optional: true },
21590
+ onSelectionChanged: { type: Function, optional: true },
21591
+ onSelectionConfirmed: { type: Function, optional: true },
21592
+ };
21518
21593
  id = uuidGenerator$1.uuidv4();
21519
21594
  previousRanges = this.props.ranges() || [];
21520
21595
  originSheet = this.env.model.getters.getActiveSheetId();
@@ -21677,15 +21752,6 @@ class SelectionInput extends Component {
21677
21752
  this.env.model.dispatch("UNFOCUS_SELECTION_INPUT");
21678
21753
  }
21679
21754
  }
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
21755
 
21690
21756
  css /* scss */ `
21691
21757
  .o-validation-error,
@@ -21701,6 +21767,10 @@ css /* scss */ `
21701
21767
  `;
21702
21768
  class ValidationMessages extends Component {
21703
21769
  static template = "o-spreadsheet-ValidationMessages";
21770
+ static props = {
21771
+ messages: Array,
21772
+ msgType: String,
21773
+ };
21704
21774
  get divClasses() {
21705
21775
  if (this.props.msgType === "warning") {
21706
21776
  return "o-validation-warning text-warning";
@@ -21708,14 +21778,96 @@ class ValidationMessages extends Component {
21708
21778
  return "o-validation-error text-danger";
21709
21779
  }
21710
21780
  }
21711
- ValidationMessages.props = {
21712
- messages: Array,
21713
- msgType: String,
21714
- };
21781
+
21782
+ css /* scss */ `
21783
+ .o-checkbox {
21784
+ display: flex;
21785
+ justify-items: center;
21786
+ input {
21787
+ margin-right: 5px;
21788
+ }
21789
+ }
21790
+ `;
21791
+ class Checkbox extends Component {
21792
+ static template = "o-spreadsheet.Checkbox";
21793
+ static props = {
21794
+ label: { type: String, optional: true },
21795
+ value: { type: Boolean, optional: true },
21796
+ className: { type: String, optional: true },
21797
+ name: { type: String, optional: true },
21798
+ onChange: Function,
21799
+ };
21800
+ static defaultProps = { value: false };
21801
+ onChange(ev) {
21802
+ const value = ev.target.checked;
21803
+ this.props.onChange(value);
21804
+ }
21805
+ }
21806
+
21807
+ class Section extends Component {
21808
+ static template = "o_spreadsheet.Section";
21809
+ static props = {
21810
+ class: { type: String, optional: true },
21811
+ slots: Object,
21812
+ };
21813
+ }
21814
+
21815
+ class ChartDataSeries extends Component {
21816
+ static template = "o-spreadsheet.ChartDataSeries";
21817
+ static components = { SelectionInput, Section };
21818
+ static props = {
21819
+ ranges: Function,
21820
+ hasSingleRange: { type: Boolean, optional: true },
21821
+ onSelectionChanged: Function,
21822
+ onSelectionConfirmed: Function,
21823
+ };
21824
+ get title() {
21825
+ return this.props.hasSingleRange ? _t("Data range") : _t("Data series");
21826
+ }
21827
+ }
21828
+
21829
+ class ChartErrorSection extends Component {
21830
+ static template = "o-spreadsheet.ChartErrorSection";
21831
+ static components = { Section, ValidationMessages };
21832
+ static props = { messages: { type: Array, element: String } };
21833
+ }
21834
+
21835
+ class ChartLabelRange extends Component {
21836
+ static template = "o-spreadsheet.ChartLabelRange";
21837
+ static components = { SelectionInput, Checkbox, Section };
21838
+ static props = {
21839
+ title: { type: String, optional: true },
21840
+ range: Function,
21841
+ isInvalid: Boolean,
21842
+ required: { type: Boolean, optional: true },
21843
+ onSelectionChanged: Function,
21844
+ onSelectionConfirmed: Function,
21845
+ options: { type: Array, optional: true },
21846
+ };
21847
+ static defaultProps = {
21848
+ title: _t("Categories / Labels"),
21849
+ options: [],
21850
+ required: false,
21851
+ };
21852
+ }
21715
21853
 
21716
21854
  class LineBarPieConfigPanel extends Component {
21717
21855
  static template = "o-spreadsheet-LineBarPieConfigPanel";
21718
- static components = { SelectionInput, ValidationMessages };
21856
+ static components = {
21857
+ SelectionInput,
21858
+ ValidationMessages,
21859
+ ChartDataSeries,
21860
+ ChartLabelRange,
21861
+ Section,
21862
+ Checkbox,
21863
+ ChartErrorSection,
21864
+ };
21865
+ static props = {
21866
+ figureId: String,
21867
+ definition: Object,
21868
+ updateChart: Function,
21869
+ canUpdateChart: Function,
21870
+ };
21719
21871
  state = useState({
21720
21872
  datasetDispatchResult: undefined,
21721
21873
  labelsDispatchResult: undefined,
@@ -21739,9 +21891,22 @@ class LineBarPieConfigPanel extends Component {
21739
21891
  get isLabelInvalid() {
21740
21892
  return !!this.state.labelsDispatchResult?.isCancelledBecause("InvalidLabelRange" /* CommandResult.InvalidLabelRange */);
21741
21893
  }
21742
- onUpdateDataSetsHaveTitle(ev) {
21894
+ get dataSetsHaveTitleLabel() {
21895
+ return _t("Use row %s as headers", this.calculateHeaderPosition() || "");
21896
+ }
21897
+ getLabelRangeOptions() {
21898
+ return [
21899
+ {
21900
+ name: "aggregated",
21901
+ label: _t("Aggregate"),
21902
+ value: this.props.definition.aggregated,
21903
+ onChange: this.onUpdateAggregated.bind(this),
21904
+ },
21905
+ ];
21906
+ }
21907
+ onUpdateDataSetsHaveTitle(dataSetsHaveTitle) {
21743
21908
  this.props.updateChart(this.props.figureId, {
21744
- dataSetsHaveTitle: ev.target.checked,
21909
+ dataSetsHaveTitle,
21745
21910
  });
21746
21911
  }
21747
21912
  /**
@@ -21781,9 +21946,9 @@ class LineBarPieConfigPanel extends Component {
21781
21946
  getLabelRange() {
21782
21947
  return this.labelRange || "";
21783
21948
  }
21784
- onUpdateAggregated(ev) {
21949
+ onUpdateAggregated(aggregated) {
21785
21950
  this.props.updateChart(this.props.figureId, {
21786
- aggregated: ev.target.checked,
21951
+ aggregated,
21787
21952
  });
21788
21953
  }
21789
21954
  calculateHeaderPosition() {
@@ -21803,23 +21968,20 @@ class LineBarPieConfigPanel extends Component {
21803
21968
  return undefined;
21804
21969
  }
21805
21970
  }
21806
- LineBarPieConfigPanel.props = {
21807
- figureId: String,
21808
- definition: Object,
21809
- updateChart: Function,
21810
- canUpdateChart: Function,
21811
- };
21812
21971
 
21813
21972
  class BarConfigPanel extends LineBarPieConfigPanel {
21814
21973
  static template = "o-spreadsheet-BarConfigPanel";
21815
- onUpdateStacked(ev) {
21974
+ get stackedLabel() {
21975
+ return _t("Stacked barchart");
21976
+ }
21977
+ onUpdateStacked(stacked) {
21816
21978
  this.props.updateChart(this.props.figureId, {
21817
- stacked: ev.target.checked,
21979
+ stacked,
21818
21980
  });
21819
21981
  }
21820
- onUpdateAggregated(ev) {
21982
+ onUpdateAggregated(aggregated) {
21821
21983
  this.props.updateChart(this.props.figureId, {
21822
- aggregated: ev.target.checked,
21984
+ aggregated,
21823
21985
  });
21824
21986
  }
21825
21987
  }
@@ -22147,6 +22309,12 @@ css /* scss */ `
22147
22309
  `;
22148
22310
  class ColorPicker extends Component {
22149
22311
  static template = "o-spreadsheet-ColorPicker";
22312
+ static props = {
22313
+ onColorPicked: Function,
22314
+ currentColor: { type: String, optional: true },
22315
+ maxHeight: { type: Number, optional: true },
22316
+ anchorRect: Object,
22317
+ };
22150
22318
  static defaultProps = { currentColor: "" };
22151
22319
  static components = { Popover };
22152
22320
  COLORS = COLOR_PICKER_DEFAULTS;
@@ -22282,12 +22450,6 @@ class ColorPicker extends Component {
22282
22450
  return isSameColor(color1, color2);
22283
22451
  }
22284
22452
  }
22285
- ColorPicker.props = {
22286
- onColorPicked: Function,
22287
- currentColor: { type: String, optional: true },
22288
- maxHeight: { type: Number, optional: true },
22289
- anchorRect: Object,
22290
- };
22291
22453
 
22292
22454
  css /* scss */ `
22293
22455
  .o-color-picker-widget {
@@ -22325,6 +22487,17 @@ css /* scss */ `
22325
22487
  `;
22326
22488
  class ColorPickerWidget extends Component {
22327
22489
  static template = "o-spreadsheet-ColorPickerWidget";
22490
+ static props = {
22491
+ currentColor: { type: String, optional: true },
22492
+ toggleColorPicker: Function,
22493
+ showColorPicker: Boolean,
22494
+ onColorPicked: Function,
22495
+ icon: String,
22496
+ title: { type: String, optional: true },
22497
+ disabled: { type: Boolean, optional: true },
22498
+ dropdownMaxHeight: { type: Number, optional: true },
22499
+ class: { type: String, optional: true },
22500
+ };
22328
22501
  static components = { ColorPicker };
22329
22502
  colorPickerButtonRef = useRef("colorPickerButton");
22330
22503
  get iconStyle() {
@@ -22343,44 +22516,55 @@ class ColorPickerWidget extends Component {
22343
22516
  };
22344
22517
  }
22345
22518
  }
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
22519
 
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
- }
22520
+ class ChartColor extends Component {
22521
+ static template = "o-spreadsheet.ChartColor";
22522
+ static components = { ColorPickerWidget, Section };
22523
+ static props = {
22524
+ currentColor: { type: String, optional: true },
22525
+ onColorPicked: Function,
22526
+ };
22527
+ state;
22368
22528
  setup() {
22369
- this.state.title = _t(this.props.definition.title);
22370
- useExternalListener(window, "click", this.onClick);
22529
+ this.state = useState({ pickerOpened: false });
22530
+ useExternalListener(window, "click", this.closePicker);
22371
22531
  }
22372
- toggleColorPicker() {
22373
- this.state.fillColorTool = !this.state.fillColorTool;
22532
+ closePicker() {
22533
+ this.state.pickerOpened = false;
22534
+ }
22535
+ togglePicker() {
22536
+ this.state.pickerOpened = !this.state.pickerOpened;
22537
+ }
22538
+ }
22539
+
22540
+ class ChartTitle extends Component {
22541
+ static template = "o-spreadsheet.ChartTitle";
22542
+ static components = { ColorPickerWidget, Section };
22543
+ static props = { title: String, update: Function };
22544
+ updateTitle(ev) {
22545
+ this.props.update(ev.target.value);
22546
+ }
22547
+ }
22548
+
22549
+ class LineBarPieDesignPanel extends Component {
22550
+ static template = "o-spreadsheet-LineBarPieDesignPanel";
22551
+ static components = { ChartColor, ColorPickerWidget, ChartTitle, Section };
22552
+ static props = {
22553
+ figureId: String,
22554
+ definition: Object,
22555
+ updateChart: Function,
22556
+ canUpdateChart: Function,
22557
+ };
22558
+ get title() {
22559
+ return _t(this.props.definition.title);
22374
22560
  }
22375
22561
  updateBackgroundColor(color) {
22376
22562
  this.props.updateChart(this.props.figureId, {
22377
22563
  background: color,
22378
22564
  });
22379
22565
  }
22380
- updateTitle() {
22381
- this.props.updateChart(this.props.figureId, {
22382
- title: this.state.title,
22383
- });
22566
+ updateTitle(title) {
22567
+ this.props.updateChart(this.props.figureId, { title });
22384
22568
  }
22385
22569
  updateSelect(attr, ev) {
22386
22570
  this.props.updateChart(this.props.figureId, {
@@ -22388,12 +22572,6 @@ class LineBarPieDesignPanel extends Component {
22388
22572
  });
22389
22573
  }
22390
22574
  }
22391
- LineBarPieDesignPanel.props = {
22392
- figureId: String,
22393
- definition: Object,
22394
- updateChart: Function,
22395
- canUpdateChart: Function,
22396
- };
22397
22575
 
22398
22576
  class BarChartDesignPanel extends LineBarPieDesignPanel {
22399
22577
  static template = "o-spreadsheet-BarChartDesignPanel";
@@ -22401,7 +22579,13 @@ class BarChartDesignPanel extends LineBarPieDesignPanel {
22401
22579
 
22402
22580
  class GaugeChartConfigPanel extends Component {
22403
22581
  static template = "o-spreadsheet-GaugeChartConfigPanel";
22404
- static components = { SelectionInput, ValidationMessages };
22582
+ static components = { SelectionInput, ChartErrorSection, ChartDataSeries };
22583
+ static props = {
22584
+ figureId: String,
22585
+ definition: Object,
22586
+ updateChart: Function,
22587
+ canUpdateChart: Function,
22588
+ };
22405
22589
  state = useState({
22406
22590
  dataRangeDispatchResult: undefined,
22407
22591
  });
@@ -22428,12 +22612,6 @@ class GaugeChartConfigPanel extends Component {
22428
22612
  return this.dataRange || "";
22429
22613
  }
22430
22614
  }
22431
- GaugeChartConfigPanel.props = {
22432
- figureId: String,
22433
- definition: Object,
22434
- updateChart: Function,
22435
- canUpdateChart: Function,
22436
- };
22437
22615
 
22438
22616
  css /* scss */ `
22439
22617
  .o-gauge-color-set {
@@ -22468,31 +22646,35 @@ css /* scss */ `
22468
22646
  `;
22469
22647
  class GaugeChartDesignPanel extends Component {
22470
22648
  static template = "o-spreadsheet-GaugeChartDesignPanel";
22471
- static components = { ColorPickerWidget, ValidationMessages };
22649
+ static components = { ColorPickerWidget, ChartErrorSection, ChartColor, ChartTitle, Section };
22650
+ static props = {
22651
+ figureId: String,
22652
+ definition: Object,
22653
+ updateChart: Function,
22654
+ canUpdateChart: Function,
22655
+ };
22472
22656
  state = useState({
22473
- title: "",
22474
22657
  openedMenu: undefined,
22475
22658
  sectionRuleDispatchResult: undefined,
22476
22659
  sectionRule: deepCopy(this.props.definition.sectionRule),
22477
22660
  });
22478
22661
  setup() {
22479
- this.state.title = _t(this.props.definition.title);
22480
22662
  useExternalListener(window, "click", this.closeMenus);
22481
22663
  }
22664
+ get title() {
22665
+ return _t(this.props.definition.title);
22666
+ }
22482
22667
  get designErrorMessages() {
22483
22668
  const cancelledReasons = [...(this.state.sectionRuleDispatchResult?.reasons || [])];
22484
22669
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
22485
22670
  }
22486
22671
  updateBackgroundColor(color) {
22487
- this.state.openedMenu = undefined;
22488
22672
  this.props.updateChart(this.props.figureId, {
22489
22673
  background: color,
22490
22674
  });
22491
22675
  }
22492
- updateTitle() {
22493
- this.props.updateChart(this.props.figureId, {
22494
- title: this.state.title,
22495
- });
22676
+ updateTitle(title) {
22677
+ this.props.updateChart(this.props.figureId, { title });
22496
22678
  }
22497
22679
  isRangeMinInvalid() {
22498
22680
  return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMin" /* CommandResult.EmptyGaugeRangeMin */) ||
@@ -22542,12 +22724,6 @@ class GaugeChartDesignPanel extends Component {
22542
22724
  this.state.openedMenu = undefined;
22543
22725
  }
22544
22726
  }
22545
- GaugeChartDesignPanel.props = {
22546
- figureId: String,
22547
- definition: Object,
22548
- updateChart: Function,
22549
- canUpdateChart: Function,
22550
- };
22551
22727
 
22552
22728
  class LineConfigPanel extends LineBarPieConfigPanel {
22553
22729
  static template = "o-spreadsheet-LineConfigPanel";
@@ -22558,24 +22734,42 @@ class LineConfigPanel extends LineBarPieConfigPanel {
22558
22734
  }
22559
22735
  return false;
22560
22736
  }
22561
- onUpdateLabelsAsText(ev) {
22737
+ get stackedLabel() {
22738
+ return _t("Stacked linechart");
22739
+ }
22740
+ get cumulativeLabel() {
22741
+ return _t("Cumulative data");
22742
+ }
22743
+ getLabelRangeOptions() {
22744
+ const options = super.getLabelRangeOptions();
22745
+ if (this.canTreatLabelsAsText) {
22746
+ options.push({
22747
+ name: "labelsAsText",
22748
+ value: this.props.definition.labelsAsText,
22749
+ label: _t("Treat labels as text"),
22750
+ onChange: this.onUpdateLabelsAsText.bind(this),
22751
+ });
22752
+ }
22753
+ return options;
22754
+ }
22755
+ onUpdateLabelsAsText(labelsAsText) {
22562
22756
  this.props.updateChart(this.props.figureId, {
22563
- labelsAsText: ev.target.checked,
22757
+ labelsAsText,
22564
22758
  });
22565
22759
  }
22566
- onUpdateStacked(ev) {
22760
+ onUpdateStacked(stacked) {
22567
22761
  this.props.updateChart(this.props.figureId, {
22568
- stacked: ev.target.checked,
22762
+ stacked,
22569
22763
  });
22570
22764
  }
22571
- onUpdateAggregated(ev) {
22765
+ onUpdateAggregated(aggregated) {
22572
22766
  this.props.updateChart(this.props.figureId, {
22573
- aggregated: ev.target.checked,
22767
+ aggregated,
22574
22768
  });
22575
22769
  }
22576
- onUpdateCumulative(ev) {
22770
+ onUpdateCumulative(cumulative) {
22577
22771
  this.props.updateChart(this.props.figureId, {
22578
- cumulative: ev.target.checked,
22772
+ cumulative,
22579
22773
  });
22580
22774
  }
22581
22775
  }
@@ -22586,7 +22780,13 @@ class LineChartDesignPanel extends LineBarPieDesignPanel {
22586
22780
 
22587
22781
  class ScorecardChartConfigPanel extends Component {
22588
22782
  static template = "o-spreadsheet-ScorecardChartConfigPanel";
22589
- static components = { SelectionInput, ValidationMessages };
22783
+ static components = { SelectionInput, ValidationMessages, ChartErrorSection, Section };
22784
+ static props = {
22785
+ figureId: String,
22786
+ definition: Object,
22787
+ updateChart: Function,
22788
+ canUpdateChart: Function,
22789
+ };
22590
22790
  state = useState({
22591
22791
  keyValueDispatchResult: undefined,
22592
22792
  baselineDispatchResult: undefined,
@@ -22638,28 +22838,27 @@ class ScorecardChartConfigPanel extends Component {
22638
22838
  this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
22639
22839
  }
22640
22840
  }
22641
- ScorecardChartConfigPanel.props = {
22642
- figureId: String,
22643
- definition: Object,
22644
- updateChart: Function,
22645
- canUpdateChart: Function,
22646
- };
22647
22841
 
22648
22842
  class ScorecardChartDesignPanel extends Component {
22649
22843
  static template = "o-spreadsheet-ScorecardChartDesignPanel";
22650
- static components = { ColorPickerWidget };
22844
+ static components = { ColorPickerWidget, ChartColor, ChartTitle, Section };
22845
+ static props = {
22846
+ figureId: String,
22847
+ definition: Object,
22848
+ updateChart: Function,
22849
+ canUpdateChart: Function,
22850
+ };
22651
22851
  state = useState({
22652
- title: "",
22653
22852
  openedColorPicker: undefined,
22654
22853
  });
22655
22854
  setup() {
22656
- this.state.title = _t(this.props.definition.title);
22657
22855
  useExternalListener(window, "click", this.closeMenus);
22658
22856
  }
22659
- updateTitle() {
22660
- this.props.updateChart(this.props.figureId, {
22661
- title: this.state.title,
22662
- });
22857
+ get title() {
22858
+ return _t(this.props.definition.title);
22859
+ }
22860
+ updateTitle(title) {
22861
+ this.props.updateChart(this.props.figureId, { title });
22663
22862
  }
22664
22863
  translate(term) {
22665
22864
  return _t(term);
@@ -22693,12 +22892,6 @@ class ScorecardChartDesignPanel extends Component {
22693
22892
  this.state.openedColorPicker = undefined;
22694
22893
  }
22695
22894
  }
22696
- ScorecardChartDesignPanel.props = {
22697
- figureId: String,
22698
- definition: Object,
22699
- updateChart: Function,
22700
- canUpdateChart: Function,
22701
- };
22702
22895
 
22703
22896
  const chartSidePanelComponentRegistry = new Registry();
22704
22897
  chartSidePanelComponentRegistry
@@ -22749,6 +22942,8 @@ css /* scss */ `
22749
22942
  `;
22750
22943
  class ChartPanel extends Component {
22751
22944
  static template = "o-spreadsheet-ChartPanel";
22945
+ static components = { Section };
22946
+ static props = { onCloseSidePanel: Function };
22752
22947
  state;
22753
22948
  get figureId() {
22754
22949
  return this.state.figureId;
@@ -22835,9 +23030,6 @@ class ChartPanel extends Component {
22835
23030
  this.state.panel = panel;
22836
23031
  }
22837
23032
  }
22838
- ChartPanel.props = {
22839
- onCloseSidePanel: Function,
22840
- };
22841
23033
 
22842
23034
  css /* scss */ `
22843
23035
  .o-spreadsheet {
@@ -22948,6 +23140,9 @@ css /* scss */ `
22948
23140
  `;
22949
23141
  class IconPicker extends Component {
22950
23142
  static template = "o-spreadsheet-IconPicker";
23143
+ static props = {
23144
+ onIconPicked: Function,
23145
+ };
22951
23146
  icons = ICONS;
22952
23147
  iconSets = ICON_SETS;
22953
23148
  onIconClick(icon) {
@@ -22956,9 +23151,6 @@ class IconPicker extends Component {
22956
23151
  }
22957
23152
  }
22958
23153
  }
22959
- IconPicker.props = {
22960
- onIconPicked: Function,
22961
- };
22962
23154
 
22963
23155
  function useDragAndDropListItems() {
22964
23156
  let dndHelper;
@@ -23313,6 +23505,11 @@ css /* scss */ `
23313
23505
  `;
23314
23506
  class ConditionalFormatPreviewList extends Component {
23315
23507
  static template = "o-spreadsheet-ConditionalFormatPreviewList";
23508
+ static props = {
23509
+ conditionalFormats: Array,
23510
+ onPreviewClick: Function,
23511
+ onAddConditionalFormat: Function,
23512
+ };
23316
23513
  icons = ICONS;
23317
23514
  dragAndDrop = useDragAndDropListItems();
23318
23515
  cfListRef = useRef("cfList");
@@ -23393,11 +23590,6 @@ class ConditionalFormatPreviewList extends Component {
23393
23590
  }
23394
23591
  }
23395
23592
  }
23396
- ConditionalFormatPreviewList.props = {
23397
- conditionalFormats: Array,
23398
- onPreviewClick: Function,
23399
- onAddConditionalFormat: Function,
23400
- };
23401
23593
 
23402
23594
  css /* scss */ `
23403
23595
  label {
@@ -23570,11 +23762,16 @@ css /* scss */ `
23570
23762
  `;
23571
23763
  class ConditionalFormattingEditor extends Component {
23572
23764
  static template = "o-spreadsheet-ConditionalFormattingEditor";
23765
+ static props = {
23766
+ editedCf: { type: Object, optional: true },
23767
+ onExitEdition: Function,
23768
+ };
23573
23769
  static components = {
23574
23770
  SelectionInput,
23575
23771
  IconPicker,
23576
23772
  ColorPickerWidget,
23577
23773
  ConditionalFormatPreviewList,
23774
+ Section,
23578
23775
  };
23579
23776
  icons = ICONS;
23580
23777
  cellIsOperators = CellIsOperators;
@@ -23834,13 +24031,13 @@ class ConditionalFormattingEditor extends Component {
23834
24031
  this.state.rules.iconSet.icons[target] = icon;
23835
24032
  }
23836
24033
  }
23837
- ConditionalFormattingEditor.props = {
23838
- editedCf: { type: Object, optional: true },
23839
- onExitEdition: Function,
23840
- };
23841
24034
 
23842
24035
  class ConditionalFormattingPanel extends Component {
23843
24036
  static template = "o-spreadsheet-ConditionalFormattingPanel";
24037
+ static props = {
24038
+ selection: { type: Object, optional: true },
24039
+ onCloseSidePanel: Function,
24040
+ };
23844
24041
  static components = {
23845
24042
  ConditionalFormatPreviewList,
23846
24043
  ConditionalFormattingEditor,
@@ -23899,10 +24096,6 @@ class ConditionalFormattingPanel extends Component {
23899
24096
  this.state.editedCf = cf;
23900
24097
  }
23901
24098
  }
23902
- ConditionalFormattingPanel.props = {
23903
- selection: { type: Object, optional: true },
23904
- onCloseSidePanel: Function,
23905
- };
23906
24099
 
23907
24100
  css /* scss */ `
23908
24101
  .o-custom-currency {
@@ -23913,6 +24106,8 @@ css /* scss */ `
23913
24106
  `;
23914
24107
  class CustomCurrencyPanel extends Component {
23915
24108
  static template = "o-spreadsheet-CustomCurrencyPanel";
24109
+ static components = { Section };
24110
+ static props = { onCloseSidePanel: Function };
23916
24111
  availableCurrencies;
23917
24112
  state;
23918
24113
  setup() {
@@ -24035,9 +24230,6 @@ class CustomCurrencyPanel extends Component {
24035
24230
  return currency.name + (currency.code ? ` (${currency.code})` : "");
24036
24231
  }
24037
24232
  }
24038
- CustomCurrencyPanel.props = {
24039
- onCloseSidePanel: Function,
24040
- };
24041
24233
 
24042
24234
  css /* scss */ `
24043
24235
  .o-find-and-replace {
@@ -24067,7 +24259,10 @@ css /* scss */ `
24067
24259
  `;
24068
24260
  class FindAndReplacePanel extends Component {
24069
24261
  static template = "o-spreadsheet-FindAndReplacePanel";
24070
- static components = { SelectionInput };
24262
+ static components = { SelectionInput, Section, Checkbox };
24263
+ static props = {
24264
+ onCloseSidePanel: Function,
24265
+ };
24071
24266
  debounceTimeoutId;
24072
24267
  initialShowFormulaState = false;
24073
24268
  dataRange = "";
@@ -24142,19 +24337,16 @@ class FindAndReplacePanel extends Component {
24142
24337
  this.replace();
24143
24338
  }
24144
24339
  }
24145
- searchFormulas(ev) {
24146
- const showFormula = ev.target.checked;
24340
+ searchFormulas(showFormula) {
24147
24341
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
24148
24342
  show: showFormula,
24149
24343
  });
24150
24344
  this.updateSearch({ searchFormulas: showFormula });
24151
24345
  }
24152
- searchExactMatch(ev) {
24153
- const exactMatch = ev.target.checked;
24346
+ searchExactMatch(exactMatch) {
24154
24347
  this.updateSearch({ exactMatch });
24155
24348
  }
24156
- searchMatchCase(ev) {
24157
- const matchCase = ev.target.checked;
24349
+ searchMatchCase(matchCase) {
24158
24350
  this.updateSearch({ matchCase });
24159
24351
  }
24160
24352
  changeSearchScope(ev) {
@@ -24207,9 +24399,6 @@ class FindAndReplacePanel extends Component {
24207
24399
  });
24208
24400
  }
24209
24401
  }
24210
- FindAndReplacePanel.props = {
24211
- onCloseSidePanel: Function,
24212
- };
24213
24402
 
24214
24403
  css /* scss */ `
24215
24404
  .o-more-formats-panel {
@@ -24241,13 +24430,13 @@ const DATE_FORMAT_ACTIONS = createActions([
24241
24430
  ]);
24242
24431
  class MoreFormatsPanel extends Component {
24243
24432
  static template = "o-spreadsheet-MoreFormatsPanel";
24433
+ static props = {
24434
+ onCloseSidePanel: Function,
24435
+ };
24244
24436
  get dateFormatsActions() {
24245
24437
  return DATE_FORMAT_ACTIONS;
24246
24438
  }
24247
24439
  }
24248
- MoreFormatsPanel.props = {
24249
- onCloseSidePanel: Function,
24250
- };
24251
24440
 
24252
24441
  css /* scss */ `
24253
24442
  .o-checkbox-selection {
@@ -24256,7 +24445,7 @@ css /* scss */ `
24256
24445
  `;
24257
24446
  class RemoveDuplicatesPanel extends Component {
24258
24447
  static template = "o-spreadsheet-RemoveDuplicatesPanel";
24259
- static components = { ValidationMessages };
24448
+ static components = { ValidationMessages, Section, Checkbox };
24260
24449
  state = useState({
24261
24450
  hasHeader: false,
24262
24451
  columns: {},
@@ -24345,6 +24534,8 @@ css /* scss */ `
24345
24534
  `;
24346
24535
  class SettingsPanel extends Component {
24347
24536
  static template = "o-spreadsheet-SettingsPanel";
24537
+ static components = { Section };
24538
+ static props = { onCloseSidePanel: Function };
24348
24539
  loadedLocales = [];
24349
24540
  setup() {
24350
24541
  onWillStart(() => this.loadLocales());
@@ -24393,9 +24584,6 @@ class SettingsPanel extends Component {
24393
24584
  return this.loadedLocales;
24394
24585
  }
24395
24586
  }
24396
- SettingsPanel.props = {
24397
- onCloseSidePanel: Function,
24398
- };
24399
24587
 
24400
24588
  const SplitToColumnsInteractiveContent = {
24401
24589
  SplitIsDestructive: _t("This will overwrite data in the subsequent columns. Split anyway?"),
@@ -24491,7 +24679,7 @@ dataValidationEvaluatorRegistry.add("dateIs", {
24491
24679
  return false;
24492
24680
  }
24493
24681
  if (["lastWeek", "lastMonth", "lastYear"].includes(criterion.dateValue)) {
24494
- const today = jsDateToRoundNumber(new Date());
24682
+ const today = jsDateToRoundNumber(DateTime.now());
24495
24683
  return isDateBetween(dateValue, today, criterionValue);
24496
24684
  }
24497
24685
  return areDatesSameDay(dateValue, criterionValue);
@@ -24983,7 +25171,8 @@ const SEPARATORS = [
24983
25171
  ];
24984
25172
  class SplitIntoColumnsPanel extends Component {
24985
25173
  static template = "o-spreadsheet-SplitIntoColumnsPanel";
24986
- static components = { ValidationMessages };
25174
+ static components = { ValidationMessages, Section, Checkbox };
25175
+ static props = { onCloseSidePanel: Function };
24987
25176
  state = useState({ separatorValue: "auto", addNewColumns: false, customSeparator: "" });
24988
25177
  setup() {
24989
25178
  onWillUpdateProps(() => {
@@ -25005,10 +25194,8 @@ class SplitIntoColumnsPanel extends Component {
25005
25194
  return;
25006
25195
  this.state.customSeparator = ev.target.value;
25007
25196
  }
25008
- updateAddNewColumnsCheckbox(ev) {
25009
- if (!ev.target)
25010
- return;
25011
- this.state.addNewColumns = ev.target.checked;
25197
+ updateAddNewColumnsCheckbox(addNewColumns) {
25198
+ this.state.addNewColumns = addNewColumns;
25012
25199
  }
25013
25200
  confirm() {
25014
25201
  const result = interactiveSplitToColumns(this.env, this.separatorValue, this.state.addNewColumns);
@@ -25062,13 +25249,15 @@ class SplitIntoColumnsPanel extends Component {
25062
25249
  return !this.separatorValue || this.errorMessages.length > 0;
25063
25250
  }
25064
25251
  }
25065
- SplitIntoColumnsPanel.props = {
25066
- onCloseSidePanel: Function,
25067
- };
25068
25252
 
25069
25253
  /** 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
25254
  class SelectMenu extends Component {
25071
25255
  static template = "o-spreadsheet-SelectMenu";
25256
+ static props = {
25257
+ menuItems: Array,
25258
+ selectedValue: String,
25259
+ class: { type: String, optional: true },
25260
+ };
25072
25261
  static components = { Menu };
25073
25262
  selectRef = useRef("select");
25074
25263
  selectRect = useAbsoluteBoundingRect(this.selectRef);
@@ -25088,13 +25277,12 @@ class SelectMenu extends Component {
25088
25277
  };
25089
25278
  }
25090
25279
  }
25091
- SelectMenu.props = {
25092
- menuItems: Array,
25093
- selectedValue: String,
25094
- class: { type: String, optional: true },
25095
- };
25096
25280
 
25097
25281
  class DataValidationCriterionForm extends Component {
25282
+ static props = {
25283
+ criterion: Object,
25284
+ onCriterionChanged: Function,
25285
+ };
25098
25286
  setup() {
25099
25287
  onMounted(() => {
25100
25288
  interactiveStopEdition(this.env);
@@ -25108,10 +25296,6 @@ class DataValidationCriterionForm extends Component {
25108
25296
  this.props.onCriterionChanged(filteredCriterion);
25109
25297
  }
25110
25298
  }
25111
- DataValidationCriterionForm.props = {
25112
- criterion: Object,
25113
- onCriterionChanged: Function,
25114
- };
25115
25299
 
25116
25300
  css /* scss */ `
25117
25301
  .o-dv-input {
@@ -25126,6 +25310,15 @@ css /* scss */ `
25126
25310
  `;
25127
25311
  class DataValidationInput extends Component {
25128
25312
  static template = "o-spreadsheet-DataValidationInput";
25313
+ static props = {
25314
+ value: { type: String, optional: true },
25315
+ criterionType: String,
25316
+ onValueChanged: Function,
25317
+ onKeyDown: { type: Function, optional: true },
25318
+ focused: { type: Boolean, optional: true },
25319
+ onBlur: { type: Function, optional: true },
25320
+ onFocus: { type: Function, optional: true },
25321
+ };
25129
25322
  static defaultProps = {
25130
25323
  value: "",
25131
25324
  onKeyDown: () => { },
@@ -25164,15 +25357,6 @@ class DataValidationInput extends Component {
25164
25357
  return this.env.model.getters.getDataValidationInvalidCriterionValueMessage(this.props.criterionType, canonicalizeContent(this.props.value, this.env.model.getters.getLocale()));
25165
25358
  }
25166
25359
  }
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
25360
 
25177
25361
  const DATES_VALUES = {
25178
25362
  today: _t("today"),
@@ -25508,7 +25692,11 @@ css /* scss */ `
25508
25692
  `;
25509
25693
  class DataValidationEditor extends Component {
25510
25694
  static template = "o-spreadsheet-DataValidationEditor";
25511
- static components = { SelectionInput, SelectMenu };
25695
+ static components = { SelectionInput, SelectMenu, Section };
25696
+ static props = {
25697
+ rule: { type: Object, optional: true },
25698
+ onExit: Function,
25699
+ };
25512
25700
  state = useState({ rule: this.defaultDataValidationRule });
25513
25701
  setup() {
25514
25702
  if (this.props.rule) {
@@ -25584,10 +25772,6 @@ class DataValidationEditor extends Component {
25584
25772
  return dataValidationPanelCriteriaRegistry.get(this.state.rule.criterion.type).component;
25585
25773
  }
25586
25774
  }
25587
- DataValidationEditor.props = {
25588
- rule: { type: Object, optional: true },
25589
- onExit: Function,
25590
- };
25591
25775
 
25592
25776
  css /* scss */ `
25593
25777
  .o-sidePanel {
@@ -25617,6 +25801,10 @@ css /* scss */ `
25617
25801
  `;
25618
25802
  class DataValidationPreview extends Component {
25619
25803
  static template = "o-spreadsheet-DataValidationPreview";
25804
+ static props = {
25805
+ onClick: Function,
25806
+ rule: Object,
25807
+ };
25620
25808
  deleteDataValidation() {
25621
25809
  const sheetId = this.env.model.getters.getActiveSheetId();
25622
25810
  this.env.model.dispatch("REMOVE_DATA_VALIDATION_RULE", { sheetId, id: this.props.rule.id });
@@ -25633,13 +25821,12 @@ class DataValidationPreview extends Component {
25633
25821
  .getPreview(this.props.rule.criterion, this.env.model.getters);
25634
25822
  }
25635
25823
  }
25636
- DataValidationPreview.props = {
25637
- onClick: Function,
25638
- rule: Object,
25639
- };
25640
25824
 
25641
25825
  class DataValidationPanel extends Component {
25642
25826
  static template = "o-spreadsheet-DataValidationPanel";
25827
+ static props = {
25828
+ onCloseSidePanel: Function,
25829
+ };
25643
25830
  static components = { DataValidationPreview, DataValidationEditor };
25644
25831
  state = useState({ mode: "list", activeRule: undefined });
25645
25832
  onPreviewClick(id) {
@@ -25669,9 +25856,6 @@ class DataValidationPanel extends Component {
25669
25856
  return this.env.model.getters.getDataValidationRules(sheetId);
25670
25857
  }
25671
25858
  }
25672
- DataValidationPanel.props = {
25673
- onCloseSidePanel: Function,
25674
- };
25675
25859
 
25676
25860
  const sidePanelRegistry = new Registry();
25677
25861
  sidePanelRegistry.add("ConditionalFormatting", {
@@ -25803,6 +25987,13 @@ css /*SCSS*/ `
25803
25987
  `;
25804
25988
  class FigureComponent extends Component {
25805
25989
  static template = "o-spreadsheet-FigureComponent";
25990
+ static props = {
25991
+ figure: Object,
25992
+ style: { type: String, optional: true },
25993
+ onFigureDeleted: { type: Function, optional: true },
25994
+ onMouseDown: { type: Function, optional: true },
25995
+ onClickAnchor: { type: Function, optional: true },
25996
+ };
25806
25997
  static components = { Menu };
25807
25998
  static defaultProps = {
25808
25999
  onFigureDeleted: () => { },
@@ -25945,13 +26136,6 @@ class FigureComponent extends Component {
25945
26136
  .menuBuilder(this.props.figure.id, this.props.onFigureDeleted, this.env);
25946
26137
  }
25947
26138
  }
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
26139
 
25956
26140
  const ToggleGroupInteractiveContent = {
25957
26141
  CannotHideAllRows: _t("Cannot hide all the rows of a sheet."),
@@ -26089,6 +26273,10 @@ css /* scss */ `
26089
26273
  `;
26090
26274
  class Autofill extends Component {
26091
26275
  static template = "o-spreadsheet-Autofill";
26276
+ static props = {
26277
+ position: Object,
26278
+ isVisible: Boolean,
26279
+ };
26092
26280
  state = useState({
26093
26281
  position: { left: 0, top: 0 },
26094
26282
  handler: false,
@@ -26157,18 +26345,14 @@ class Autofill extends Component {
26157
26345
  this.env.model.dispatch("AUTOFILL_AUTO");
26158
26346
  }
26159
26347
  }
26160
- Autofill.props = {
26161
- position: Object,
26162
- isVisible: Boolean,
26163
- };
26164
26348
  class TooltipComponent extends Component {
26349
+ static props = {
26350
+ content: String,
26351
+ };
26165
26352
  static template = xml /* xml */ `
26166
26353
  <div t-esc="props.content"/>
26167
26354
  `;
26168
26355
  }
26169
- TooltipComponent.props = {
26170
- content: String,
26171
- };
26172
26356
 
26173
26357
  css /* scss */ `
26174
26358
  .o-client-tag {
@@ -26182,6 +26366,13 @@ css /* scss */ `
26182
26366
  `;
26183
26367
  class ClientTag extends Component {
26184
26368
  static template = "o-spreadsheet-ClientTag";
26369
+ static props = {
26370
+ active: Boolean,
26371
+ name: String,
26372
+ color: String,
26373
+ col: Number,
26374
+ row: Number,
26375
+ };
26185
26376
  get tagStyle() {
26186
26377
  const { col, row, color } = this.props;
26187
26378
  const { height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
@@ -26199,13 +26390,6 @@ class ClientTag extends Component {
26199
26390
  });
26200
26391
  }
26201
26392
  }
26202
- ClientTag.props = {
26203
- active: Boolean,
26204
- name: String,
26205
- color: String,
26206
- col: Number,
26207
- row: Number,
26208
- };
26209
26393
 
26210
26394
  function getHtmlContentFromPattern(pattern, value, highlightColor, className) {
26211
26395
  const pendingHtmlContent = [];
@@ -26245,14 +26429,14 @@ css /* scss */ `
26245
26429
  `;
26246
26430
  class TextValueProvider extends Component {
26247
26431
  static template = "o-spreadsheet-TextValueProvider";
26432
+ static props = {
26433
+ values: Array,
26434
+ selectedIndex: { type: Number, optional: true },
26435
+ getHtmlContent: Function,
26436
+ onValueSelected: Function,
26437
+ onValueHovered: Function,
26438
+ };
26248
26439
  }
26249
- TextValueProvider.props = {
26250
- values: Array,
26251
- selectedIndex: { type: Number, optional: true },
26252
- getHtmlContent: Function,
26253
- onValueSelected: Function,
26254
- onValueHovered: Function,
26255
- };
26256
26440
 
26257
26441
  class ContentEditableHelper {
26258
26442
  // todo make el private and expose dedicated methods
@@ -26614,6 +26798,11 @@ css /* scss */ `
26614
26798
  `;
26615
26799
  class FunctionDescriptionProvider extends Component {
26616
26800
  static template = "o-spreadsheet-FunctionDescriptionProvider";
26801
+ static props = {
26802
+ functionName: String,
26803
+ functionDescription: Object,
26804
+ argToFocus: Number,
26805
+ };
26617
26806
  assistantState = useState({
26618
26807
  allowCellSelectionBehind: false,
26619
26808
  });
@@ -26638,11 +26827,6 @@ class FunctionDescriptionProvider extends Component {
26638
26827
  }, 2000);
26639
26828
  }
26640
26829
  }
26641
- FunctionDescriptionProvider.props = {
26642
- functionName: String,
26643
- functionDescription: Object,
26644
- argToFocus: Number,
26645
- };
26646
26830
 
26647
26831
  const functions$2 = functionRegistry.content;
26648
26832
  const ASSISTANT_WIDTH = 300;
@@ -26708,6 +26892,16 @@ css /* scss */ `
26708
26892
  `;
26709
26893
  class Composer extends Component {
26710
26894
  static template = "o-spreadsheet-Composer";
26895
+ static props = {
26896
+ focus: {
26897
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
26898
+ },
26899
+ onComposerContentFocused: Function,
26900
+ inputStyle: { type: String, optional: true },
26901
+ rect: { type: Object, optional: true },
26902
+ delimitation: { type: Object, optional: true },
26903
+ onComposerUnmounted: { type: Function, optional: true },
26904
+ };
26711
26905
  static components = { TextValueProvider, FunctionDescriptionProvider };
26712
26906
  static defaultProps = {
26713
26907
  inputStyle: "",
@@ -27264,14 +27458,6 @@ class Composer extends Component {
27264
27458
  this.autoCompleteState.getHtmlContent = (value) => [{ value }];
27265
27459
  }
27266
27460
  }
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
27461
 
27276
27462
  const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
27277
27463
  const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
@@ -27303,6 +27489,14 @@ css /* scss */ `
27303
27489
  */
27304
27490
  class GridComposer extends Component {
27305
27491
  static template = "o-spreadsheet-GridComposer";
27492
+ static props = {
27493
+ focus: {
27494
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
27495
+ },
27496
+ onComposerUnmounted: Function,
27497
+ onComposerContentFocused: Function,
27498
+ gridDims: Object,
27499
+ };
27306
27500
  static components = { Composer };
27307
27501
  gridComposerRef;
27308
27502
  zone;
@@ -27409,22 +27603,22 @@ class GridComposer extends Component {
27409
27603
  });
27410
27604
  }
27411
27605
  }
27412
- GridComposer.props = {
27413
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
27414
- onComposerUnmounted: Function,
27415
- onComposerContentFocused: Function,
27416
- gridDims: Object,
27417
- };
27418
27606
 
27419
- const CSS$1 = css /* scss */ `
27607
+ css /* scss */ `
27420
27608
  .o-grid-cell-icon {
27421
27609
  width: ${GRID_ICON_EDGE_LENGTH}px;
27422
27610
  height: ${GRID_ICON_EDGE_LENGTH}px;
27423
27611
  }
27424
27612
  `;
27425
27613
  class GridCellIcon extends Component {
27426
- static style = CSS$1;
27427
27614
  static template = "o-spreadsheet-GridCellIcon";
27615
+ static props = {
27616
+ cellPosition: Object,
27617
+ horizontalAlign: { type: String, optional: true },
27618
+ verticalAlign: { type: String, optional: true },
27619
+ offset: { type: Object, optional: true },
27620
+ slots: Object,
27621
+ };
27428
27622
  get iconStyle() {
27429
27623
  const x = this.getIconHorizontalPosition();
27430
27624
  const y = this.getIconVerticalPosition();
@@ -27473,15 +27667,8 @@ class GridCellIcon extends Component {
27473
27667
  return !(rect.width === 0 || rect.height === 0);
27474
27668
  }
27475
27669
  }
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
27670
 
27484
- const CSS = css /* scss */ `
27671
+ css /* scss */ `
27485
27672
  .o-filter-icon {
27486
27673
  color: ${FILTERS_COLOR};
27487
27674
  display: flex;
@@ -27496,8 +27683,10 @@ const CSS = css /* scss */ `
27496
27683
  }
27497
27684
  `;
27498
27685
  class FilterIcon extends Component {
27499
- static style = CSS;
27500
27686
  static template = "o-spreadsheet-FilterIcon";
27687
+ static props = {
27688
+ cellPosition: Object,
27689
+ };
27501
27690
  onClick() {
27502
27691
  const position = this.props.cellPosition;
27503
27692
  const activePopoverType = this.env.model.getters.getPersistentPopoverTypeAtPosition(position);
@@ -27516,12 +27705,12 @@ class FilterIcon extends Component {
27516
27705
  return this.env.model.getters.isFilterActive(this.props.cellPosition);
27517
27706
  }
27518
27707
  }
27519
- FilterIcon.props = {
27520
- cellPosition: Object,
27521
- };
27522
27708
 
27523
27709
  class FilterIconsOverlay extends Component {
27524
27710
  static template = "o-spreadsheet-FilterIconsOverlay";
27711
+ static props = {
27712
+ gridPosition: { type: Object, optional: true },
27713
+ };
27525
27714
  static components = {
27526
27715
  GridCellIcon,
27527
27716
  FilterIcon,
@@ -27535,14 +27724,12 @@ class FilterIconsOverlay extends Component {
27535
27724
  return headerPositions.map((position) => ({ sheetId, ...position }));
27536
27725
  }
27537
27726
  }
27538
- FilterIconsOverlay.props = {
27539
- gridPosition: { type: Object, optional: true },
27540
- };
27541
27727
 
27542
27728
  const CHECKBOX_WIDTH = 15;
27543
27729
  const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
27544
27730
  css /* scss */ `
27545
27731
  .o-dv-checkbox {
27732
+ box-sizing: border-box !important;
27546
27733
  width: ${CHECKBOX_WIDTH}px;
27547
27734
  height: ${CHECKBOX_WIDTH}px;
27548
27735
  accent-color: #808080;
@@ -27551,6 +27738,9 @@ css /* scss */ `
27551
27738
  `;
27552
27739
  class DataValidationCheckbox extends Component {
27553
27740
  static template = "o-spreadsheet-DataValidationCheckbox";
27741
+ static props = {
27742
+ cellPosition: Object,
27743
+ };
27554
27744
  onCheckboxChange(ev) {
27555
27745
  const newValue = ev.target.checked;
27556
27746
  const { sheetId, col, row } = this.props.cellPosition;
@@ -27565,9 +27755,6 @@ class DataValidationCheckbox extends Component {
27565
27755
  return !!cell?.isFormula;
27566
27756
  }
27567
27757
  }
27568
- DataValidationCheckbox.props = {
27569
- cellPosition: Object,
27570
- };
27571
27758
 
27572
27759
  const ICON_WIDTH = 13;
27573
27760
  css /* scss */ `
@@ -27590,18 +27777,19 @@ css /* scss */ `
27590
27777
  `;
27591
27778
  class DataValidationListIcon extends Component {
27592
27779
  static template = "o-spreadsheet-DataValidationListIcon";
27780
+ static props = {
27781
+ cellPosition: Object,
27782
+ };
27593
27783
  onClick() {
27594
27784
  const { col, row } = this.props.cellPosition;
27595
27785
  this.env.model.selection.selectCell(col, row);
27596
27786
  this.env.startCellEdition();
27597
27787
  }
27598
27788
  }
27599
- DataValidationListIcon.props = {
27600
- cellPosition: Object,
27601
- };
27602
27789
 
27603
27790
  class DataValidationOverlay extends Component {
27604
27791
  static template = "o-spreadsheet-DataValidationOverlay";
27792
+ static props = {};
27605
27793
  static components = { GridCellIcon, DataValidationCheckbox, DataValidationListIcon };
27606
27794
  get checkBoxCellPositions() {
27607
27795
  return this.env.model.getters.getDataValidationCheckBoxCellPositions();
@@ -27612,7 +27800,6 @@ class DataValidationOverlay extends Component {
27612
27800
  : this.env.model.getters.getDataValidationListCellsPositions();
27613
27801
  }
27614
27802
  }
27615
- DataValidationOverlay.props = {};
27616
27803
 
27617
27804
  /**
27618
27805
  * Transform a figure with coordinates from the model, to coordinates as they are shown on the screen,
@@ -27948,6 +28135,9 @@ css /*SCSS*/ `
27948
28135
  */
27949
28136
  class FiguresContainer extends Component {
27950
28137
  static template = "o-spreadsheet-FiguresContainer";
28138
+ static props = {
28139
+ onFigureDeleted: Function,
28140
+ };
27951
28141
  static components = { FigureComponent };
27952
28142
  dnd = useState({
27953
28143
  draggedFigure: undefined,
@@ -28197,9 +28387,6 @@ class FiguresContainer extends Component {
28197
28387
  }
28198
28388
  }
28199
28389
  }
28200
- FiguresContainer.props = {
28201
- onFigureDeleted: Function,
28202
- };
28203
28390
 
28204
28391
  css /* scss */ `
28205
28392
  .o-grid-add-rows {
@@ -28218,6 +28405,9 @@ css /* scss */ `
28218
28405
  `;
28219
28406
  class GridAddRowsFooter extends Component {
28220
28407
  static template = "o-spreadsheet-GridAddRowsFooter";
28408
+ static props = {
28409
+ focusGrid: Function,
28410
+ };
28221
28411
  static components = { ValidationMessages };
28222
28412
  inputRef = useRef("inputRef");
28223
28413
  state = useState({
@@ -28284,9 +28474,6 @@ class GridAddRowsFooter extends Component {
28284
28474
  this.props.focusGrid();
28285
28475
  }
28286
28476
  }
28287
- GridAddRowsFooter.props = {
28288
- focusGrid: Function,
28289
- };
28290
28477
 
28291
28478
  /**
28292
28479
  * Manages an event listener on a ref. Useful for hooks that want to manage
@@ -28442,6 +28629,16 @@ function useTouchMove(gridRef, handler, canMoveUp) {
28442
28629
  }
28443
28630
  class GridOverlay extends Component {
28444
28631
  static template = "o-spreadsheet-GridOverlay";
28632
+ static props = {
28633
+ onCellHovered: { type: Function, optional: true },
28634
+ onCellDoubleClicked: { type: Function, optional: true },
28635
+ onCellClicked: { type: Function, optional: true },
28636
+ onCellRightClicked: { type: Function, optional: true },
28637
+ onGridResized: { type: Function, optional: true },
28638
+ onFigureDeleted: { type: Function, optional: true },
28639
+ onGridMoved: Function,
28640
+ gridOverlayDimensions: String,
28641
+ };
28445
28642
  static components = { FiguresContainer, DataValidationOverlay, GridAddRowsFooter };
28446
28643
  static defaultProps = {
28447
28644
  onCellHovered: () => { },
@@ -28515,19 +28712,15 @@ class GridOverlay extends Component {
28515
28712
  return [colIndex, rowIndex];
28516
28713
  }
28517
28714
  }
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
28715
 
28529
28716
  class GridPopover extends Component {
28530
28717
  static template = "o-spreadsheet-GridPopover";
28718
+ static props = {
28719
+ hoveredCell: Object,
28720
+ onClosePopover: Function,
28721
+ onMouseWheel: Function,
28722
+ gridRect: Object,
28723
+ };
28531
28724
  static components = { Popover };
28532
28725
  zIndex = ComponentsImportance.GridPopover;
28533
28726
  get cellPopover() {
@@ -28547,14 +28740,11 @@ class GridPopover extends Component {
28547
28740
  };
28548
28741
  }
28549
28742
  }
28550
- GridPopover.props = {
28551
- hoveredCell: Object,
28552
- onClosePopover: Function,
28553
- onMouseWheel: Function,
28554
- gridRect: Object,
28555
- };
28556
28743
 
28557
28744
  class AbstractResizer extends Component {
28745
+ static props = {
28746
+ onOpenContextMenu: Function,
28747
+ };
28558
28748
  PADDING = 0;
28559
28749
  MAX_SIZE_MARGIN = 0;
28560
28750
  MIN_ELEMENT_SIZE = 0;
@@ -28811,10 +29001,10 @@ css /* scss */ `
28811
29001
  }
28812
29002
  }
28813
29003
  `;
28814
- AbstractResizer.props = {
28815
- onOpenContextMenu: Function,
28816
- };
28817
29004
  class ColResizer extends AbstractResizer {
29005
+ static props = {
29006
+ onOpenContextMenu: Function,
29007
+ };
28818
29008
  static template = "o-spreadsheet-ColResizer";
28819
29009
  colResizerRef;
28820
29010
  setup() {
@@ -28976,10 +29166,10 @@ css /* scss */ `
28976
29166
  }
28977
29167
  }
28978
29168
  `;
28979
- ColResizer.props = {
28980
- onOpenContextMenu: Function,
28981
- };
28982
29169
  class RowResizer extends AbstractResizer {
29170
+ static props = {
29171
+ onOpenContextMenu: Function,
29172
+ };
28983
29173
  static template = "o-spreadsheet-RowResizer";
28984
29174
  setup() {
28985
29175
  super.setup();
@@ -29100,19 +29290,16 @@ css /* scss */ `
29100
29290
  }
29101
29291
  }
29102
29292
  `;
29103
- RowResizer.props = {
29104
- onOpenContextMenu: Function,
29105
- };
29106
29293
  class HeadersOverlay extends Component {
29294
+ static props = {
29295
+ onOpenContextMenu: Function,
29296
+ };
29107
29297
  static template = "o-spreadsheet-HeadersOverlay";
29108
29298
  static components = { ColResizer, RowResizer };
29109
29299
  selectAll() {
29110
29300
  this.env.model.selection.selectAll();
29111
29301
  }
29112
29302
  }
29113
- HeadersOverlay.props = {
29114
- onOpenContextMenu: Function,
29115
- };
29116
29303
 
29117
29304
  function useGridDrawing(refName, model, canvasSize) {
29118
29305
  const canvasRef = useRef(refName);
@@ -29170,6 +29357,12 @@ css /* scss */ `
29170
29357
  `;
29171
29358
  class Border extends Component {
29172
29359
  static template = "o-spreadsheet-Border";
29360
+ static props = {
29361
+ zone: Object,
29362
+ orientation: String,
29363
+ isMoving: Boolean,
29364
+ onMoveHighlight: Function,
29365
+ };
29173
29366
  get style() {
29174
29367
  const isTop = ["n", "w", "e"].includes(this.props.orientation);
29175
29368
  const isLeft = ["n", "w", "s"].includes(this.props.orientation);
@@ -29198,12 +29391,6 @@ class Border extends Component {
29198
29391
  this.props.onMoveHighlight(ev.clientX, ev.clientY);
29199
29392
  }
29200
29393
  }
29201
- Border.props = {
29202
- zone: Object,
29203
- orientation: String,
29204
- isMoving: Boolean,
29205
- onMoveHighlight: Function,
29206
- };
29207
29394
 
29208
29395
  css /* scss */ `
29209
29396
  .o-corner {
@@ -29230,6 +29417,13 @@ css /* scss */ `
29230
29417
  `;
29231
29418
  class Corner extends Component {
29232
29419
  static template = "o-spreadsheet-Corner";
29420
+ static props = {
29421
+ zone: Object,
29422
+ color: String,
29423
+ orientation: String,
29424
+ isResizing: Boolean,
29425
+ onResizeHighlight: Function,
29426
+ };
29233
29427
  isTop = this.props.orientation[0] === "n";
29234
29428
  isLeft = this.props.orientation[1] === "w";
29235
29429
  get style() {
@@ -29258,13 +29452,6 @@ class Corner extends Component {
29258
29452
  this.props.onResizeHighlight(this.isLeft, this.isTop);
29259
29453
  }
29260
29454
  }
29261
- Corner.props = {
29262
- zone: Object,
29263
- color: String,
29264
- orientation: String,
29265
- isResizing: Boolean,
29266
- onResizeHighlight: Function,
29267
- };
29268
29455
 
29269
29456
  css /*SCSS*/ `
29270
29457
  .o-highlight {
@@ -29273,6 +29460,10 @@ css /*SCSS*/ `
29273
29460
  `;
29274
29461
  class Highlight extends Component {
29275
29462
  static template = "o-spreadsheet-Highlight";
29463
+ static props = {
29464
+ zone: Object,
29465
+ color: String,
29466
+ };
29276
29467
  static components = {
29277
29468
  Corner,
29278
29469
  Border,
@@ -29356,10 +29547,6 @@ class Highlight extends Component {
29356
29547
  dragAndDropBeyondTheViewport(this.env, mouseMove, mouseUp);
29357
29548
  }
29358
29549
  }
29359
- Highlight.props = {
29360
- zone: Object,
29361
- color: String,
29362
- };
29363
29550
 
29364
29551
  let ScrollBar$1 = class ScrollBar {
29365
29552
  direction;
@@ -29399,6 +29586,14 @@ css /* scss */ `
29399
29586
  }
29400
29587
  `;
29401
29588
  class ScrollBar extends Component {
29589
+ static props = {
29590
+ width: { type: Number, optional: true },
29591
+ height: { type: Number, optional: true },
29592
+ direction: String,
29593
+ position: Object,
29594
+ offset: Number,
29595
+ onScroll: Function,
29596
+ };
29402
29597
  static template = xml /*xml*/ `
29403
29598
  <div
29404
29599
  t-attf-class="o-scrollbar {{props.direction}}"
@@ -29442,16 +29637,11 @@ class ScrollBar extends Component {
29442
29637
  }
29443
29638
  }
29444
29639
  }
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
29640
 
29454
29641
  class HorizontalScrollBar extends Component {
29642
+ static props = {
29643
+ leftOffset: { type: Number, optional: true },
29644
+ };
29455
29645
  static components = { ScrollBar };
29456
29646
  static template = xml /*xml*/ `
29457
29647
  <ScrollBar
@@ -29492,11 +29682,11 @@ class HorizontalScrollBar extends Component {
29492
29682
  });
29493
29683
  }
29494
29684
  }
29495
- HorizontalScrollBar.props = {
29496
- leftOffset: { type: Number, optional: true },
29497
- };
29498
29685
 
29499
29686
  class VerticalScrollBar extends Component {
29687
+ static props = {
29688
+ topOffset: { type: Number, optional: true },
29689
+ };
29500
29690
  static components = { ScrollBar };
29501
29691
  static template = xml /*xml*/ `
29502
29692
  <ScrollBar
@@ -29537,9 +29727,6 @@ class VerticalScrollBar extends Component {
29537
29727
  });
29538
29728
  }
29539
29729
  }
29540
- VerticalScrollBar.props = {
29541
- topOffset: { type: Number, optional: true },
29542
- };
29543
29730
 
29544
29731
  const registries$1 = {
29545
29732
  ROW: rowMenuRegistry,
@@ -29553,6 +29740,13 @@ const registries$1 = {
29553
29740
  // -----------------------------------------------------------------------------
29554
29741
  class Grid extends Component {
29555
29742
  static template = "o-spreadsheet-Grid";
29743
+ static props = {
29744
+ sidePanelIsOpen: Boolean,
29745
+ exposeFocus: Function,
29746
+ focusComposer: String,
29747
+ onComposerContentFocused: Function,
29748
+ onGridComposerCellFocused: Function,
29749
+ };
29556
29750
  static components = {
29557
29751
  GridComposer,
29558
29752
  GridOverlay,
@@ -30157,13 +30351,6 @@ class Grid extends Component {
30157
30351
  }
30158
30352
  }
30159
30353
  }
30160
- Grid.props = {
30161
- sidePanelIsOpen: Boolean,
30162
- exposeFocus: Function,
30163
- focusComposer: String,
30164
- onComposerContentFocused: Function,
30165
- onGridComposerCellFocused: Function,
30166
- };
30167
30354
 
30168
30355
  /**
30169
30356
  * Represent a raw XML string
@@ -31584,20 +31771,26 @@ function convertFigures(sheetData) {
31584
31771
  .filter(isDefined$1);
31585
31772
  }
31586
31773
  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);
31774
+ let x1, y1;
31775
+ let height, width;
31776
+ if (figure.anchors.length === 1) {
31777
+ // one cell anchor
31778
+ ({ x: x1, y: y1 } = getPositionFromAnchor(figure.anchors[0], sheetData));
31779
+ width = convertEMUToDotValue(figure.figureSize.cx);
31780
+ height = convertEMUToDotValue(figure.figureSize.cy);
31781
+ }
31782
+ else {
31783
+ ({ x: x1, y: y1 } = getPositionFromAnchor(figure.anchors[0], sheetData));
31784
+ const { x: x2, y: y2 } = getPositionFromAnchor(figure.anchors[1], sheetData);
31785
+ width = x2 - x1;
31786
+ height = y2 - y1;
31787
+ }
31595
31788
  const figureData = { id, x: x1, y: y1 };
31596
31789
  if (isChartData(figure.data)) {
31597
31790
  return {
31598
31791
  ...figureData,
31599
- width: x2 - x1,
31600
- height: y2 - y1,
31792
+ width,
31793
+ height,
31601
31794
  tag: "chart",
31602
31795
  data: convertChartData(figure.data),
31603
31796
  };
@@ -31663,6 +31856,12 @@ function convertExcelRangeToSheetXC(range, dataSetsHaveTitle) {
31663
31856
  const dataXC = zoneToXc(zone);
31664
31857
  return getFullReference(sheetName, dataXC);
31665
31858
  }
31859
+ function getPositionFromAnchor(anchor, sheetData) {
31860
+ return {
31861
+ x: getColPosition(anchor.col, sheetData) + convertEMUToDotValue(anchor.colOffset),
31862
+ y: getRowPosition(anchor.row, sheetData) + convertEMUToDotValue(anchor.rowOffset),
31863
+ };
31864
+ }
31666
31865
 
31667
31866
  /**
31668
31867
  * Match external reference (ex. '[1]Sheet 3'!$B$4)
@@ -32786,27 +32985,50 @@ class XlsxChartExtractor extends XlsxBaseExtractor {
32786
32985
  }
32787
32986
  }
32788
32987
 
32988
+ const ONE_CELL_ANCHOR = "oneCellAnchor";
32989
+ const TWO_CELL_ANCHOR = "twoCellAnchor";
32789
32990
  class XlsxFigureExtractor extends XlsxBaseExtractor {
32790
32991
  extractFigures() {
32791
32992
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "xdr:wsDr", children: true }, (figureElement) => {
32792
32993
  const anchorType = removeTagEscapedNamespaces(figureElement.tagName);
32793
- if (anchorType !== "twoCellAnchor") {
32794
- throw new Error("Only twoCellAnchor are supported for xlsx drawings.");
32795
- }
32994
+ const anchors = this.extractFigureAnchorsByType(figureElement, anchorType);
32796
32995
  const chartElement = this.querySelector(figureElement, "c:chart");
32797
32996
  const imageElement = this.querySelector(figureElement, "a:blip");
32798
32997
  if (!chartElement && !imageElement) {
32799
32998
  throw new Error("Only chart and image figures are currently supported.");
32800
32999
  }
32801
33000
  return {
32802
- anchors: [
32803
- this.extractFigureAnchor("xdr:from", figureElement),
32804
- this.extractFigureAnchor("xdr:to", figureElement),
32805
- ],
33001
+ anchors,
32806
33002
  data: chartElement ? this.extractChart(chartElement) : this.extractImage(figureElement),
33003
+ figureSize: anchorType === ONE_CELL_ANCHOR
33004
+ ? this.extractFigureSizeFromSizeTag(figureElement, "xdr:ext")
33005
+ : undefined,
32807
33006
  };
32808
33007
  });
32809
33008
  }
33009
+ extractFigureAnchorsByType(figureElement, anchorType) {
33010
+ switch (anchorType) {
33011
+ case ONE_CELL_ANCHOR:
33012
+ return [this.extractFigureAnchor("xdr:from", figureElement)];
33013
+ case TWO_CELL_ANCHOR:
33014
+ return [
33015
+ this.extractFigureAnchor("xdr:from", figureElement),
33016
+ this.extractFigureAnchor("xdr:to", figureElement),
33017
+ ];
33018
+ default:
33019
+ throw new Error(`${anchorType} is not supported for xlsx drawings. `);
33020
+ }
33021
+ }
33022
+ extractFigureSizeFromSizeTag(figureElement, sizeTag) {
33023
+ const sizeElement = this.querySelector(figureElement, sizeTag);
33024
+ if (!sizeElement) {
33025
+ throw new Error(`Missing size element '${sizeTag}'`);
33026
+ }
33027
+ return {
33028
+ cx: this.extractAttr(sizeElement, "cx", { required: true }).asNum(),
33029
+ cy: this.extractAttr(sizeElement, "cy", { required: true }).asNum(),
33030
+ };
33031
+ }
32810
33032
  extractFigureAnchor(anchorTag, figureElement) {
32811
33033
  const anchor = this.querySelector(figureElement, anchorTag);
32812
33034
  if (!anchor) {
@@ -32835,15 +33057,15 @@ class XlsxFigureExtractor extends XlsxBaseExtractor {
32835
33057
  if (!image) {
32836
33058
  throw new Error("Unable to extract image");
32837
33059
  }
32838
- const shapePropertyElement = this.querySelector(figureElement, "a:xfrm");
32839
33060
  const extension = image.fileName.split(".").at(-1);
33061
+ const anchorType = removeTagEscapedNamespaces(figureElement.tagName);
33062
+ const sizeElement = anchorType === TWO_CELL_ANCHOR ? this.querySelector(figureElement, "a:xfrm") : figureElement;
33063
+ const sizeTag = anchorType === TWO_CELL_ANCHOR ? "a:ext" : "xdr:ext";
33064
+ const size = this.extractFigureSizeFromSizeTag(sizeElement, sizeTag);
32840
33065
  return {
32841
33066
  imageSrc: image.imageSrc,
32842
33067
  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
- },
33068
+ size,
32847
33069
  };
32848
33070
  }
32849
33071
  }
@@ -41495,7 +41717,8 @@ class EvaluationPlugin extends UIPlugin {
41495
41717
  // Command Handling
41496
41718
  // ---------------------------------------------------------------------------
41497
41719
  beforeHandle(cmd) {
41498
- if (invalidateDependenciesCommands.has(cmd.type)) {
41720
+ if (invalidateEvaluationCommands.has(cmd.type) ||
41721
+ invalidateDependenciesCommands.has(cmd.type)) {
41499
41722
  this.shouldRebuildDependenciesGraph = true;
41500
41723
  }
41501
41724
  }
@@ -41916,7 +42139,8 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
41916
42139
  // Command Handling
41917
42140
  // ---------------------------------------------------------------------------
41918
42141
  handle(cmd) {
41919
- if (invalidateCFEvaluationCommands.has(cmd.type) ||
42142
+ if (invalidateEvaluationCommands.has(cmd.type) ||
42143
+ invalidateCFEvaluationCommands.has(cmd.type) ||
41920
42144
  (cmd.type === "UPDATE_CELL" && ("content" in cmd || "format" in cmd))) {
41921
42145
  this.isStale = true;
41922
42146
  }
@@ -50818,6 +51042,20 @@ css /* scss */ `
50818
51042
  `;
50819
51043
  class RippleEffect extends Component {
50820
51044
  static template = "o-spreadsheet-RippleEffect";
51045
+ static props = {
51046
+ x: String,
51047
+ y: String,
51048
+ color: String,
51049
+ opacity: Number,
51050
+ duration: Number,
51051
+ width: Number,
51052
+ height: Number,
51053
+ offsetY: Number,
51054
+ offsetX: Number,
51055
+ allowOverflow: Boolean,
51056
+ onAnimationEnd: Function,
51057
+ style: String,
51058
+ };
50821
51059
  rippleRef = useRef("ripple");
50822
51060
  setup() {
50823
51061
  let animation = undefined;
@@ -50853,22 +51091,23 @@ class RippleEffect extends Component {
50853
51091
  });
50854
51092
  }
50855
51093
  }
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
51094
  class Ripple extends Component {
50871
51095
  static template = "o-spreadsheet-Ripple";
51096
+ static props = {
51097
+ color: { type: String, optional: true },
51098
+ opacity: { type: Number, optional: true },
51099
+ duration: { type: Number, optional: true },
51100
+ ignoreClickPosition: { type: Boolean, optional: true },
51101
+ width: { type: Number, optional: true },
51102
+ height: { type: Number, optional: true },
51103
+ offsetY: { type: Number, optional: true },
51104
+ offsetX: { type: Number, optional: true },
51105
+ allowOverflow: { type: Boolean, optional: true },
51106
+ enabled: { type: Boolean, optional: true },
51107
+ onAnimationEnd: { type: Function, optional: true },
51108
+ slots: Object,
51109
+ class: { type: String, optional: true },
51110
+ };
50872
51111
  static components = { RippleEffect };
50873
51112
  static defaultProps = {
50874
51113
  color: "#aaaaaa",
@@ -50954,21 +51193,6 @@ class Ripple extends Component {
50954
51193
  };
50955
51194
  }
50956
51195
  }
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
51196
 
50973
51197
  function interactiveRenameSheet(env, sheetId, name, errorCallback) {
50974
51198
  const result = env.model.dispatch("RENAME_SHEET", { sheetId, name });
@@ -51026,6 +51250,12 @@ css /* scss */ `
51026
51250
  `;
51027
51251
  class BottomBarSheet extends Component {
51028
51252
  static template = "o-spreadsheet-BottomBarSheet";
51253
+ static props = {
51254
+ sheetId: String,
51255
+ openContextMenu: Function,
51256
+ style: { type: String, optional: true },
51257
+ onMouseDown: { type: Function, optional: true },
51258
+ };
51029
51259
  static components = { Ripple };
51030
51260
  static defaultProps = {
51031
51261
  onMouseDown: () => { },
@@ -51147,12 +51377,6 @@ class BottomBarSheet extends Component {
51147
51377
  return this.env.model.getters.getSheetName(this.props.sheetId);
51148
51378
  }
51149
51379
  }
51150
- BottomBarSheet.props = {
51151
- sheetId: String,
51152
- openContextMenu: Function,
51153
- style: { type: String, optional: true },
51154
- onMouseDown: { type: Function, optional: true },
51155
- };
51156
51380
 
51157
51381
  // -----------------------------------------------------------------------------
51158
51382
  // SpreadSheet
@@ -51170,6 +51394,10 @@ css /* scss */ `
51170
51394
  `;
51171
51395
  class BottomBarStatistic extends Component {
51172
51396
  static template = "o-spreadsheet-BottomBarStatisic";
51397
+ static props = {
51398
+ openContextMenu: Function,
51399
+ closeContextMenu: Function,
51400
+ };
51173
51401
  static components = { Ripple };
51174
51402
  selectedStatisticFn = "";
51175
51403
  statisticFnResults = {};
@@ -51216,10 +51444,6 @@ class BottomBarStatistic extends Component {
51216
51444
  return fnName + ": " + (fnValue !== undefined ? formatValue(fnValue, { locale }) : "__");
51217
51445
  }
51218
51446
  }
51219
- BottomBarStatistic.props = {
51220
- openContextMenu: Function,
51221
- closeContextMenu: Function,
51222
- };
51223
51447
 
51224
51448
  // -----------------------------------------------------------------------------
51225
51449
  // SpreadSheet
@@ -51270,6 +51494,9 @@ css /* scss */ `
51270
51494
  `;
51271
51495
  class BottomBar extends Component {
51272
51496
  static template = "o-spreadsheet-BottomBar";
51497
+ static props = {
51498
+ onClick: Function,
51499
+ };
51273
51500
  static components = { Menu, Ripple, BottomBarSheet, BottomBarStatistic };
51274
51501
  bottomBarRef = useRef("bottomBar");
51275
51502
  sheetListRef = useRef("sheetList");
@@ -51455,9 +51682,6 @@ class BottomBar extends Component {
51455
51682
  return this.sheetListRef.el.scrollWidth - this.sheetListRef.el.clientWidth;
51456
51683
  }
51457
51684
  }
51458
- BottomBar.props = {
51459
- onClick: Function,
51460
- };
51461
51685
 
51462
51686
  css /* scss */ `
51463
51687
  .o-dashboard-clickable-cell {
@@ -51468,6 +51692,7 @@ css /* scss */ `
51468
51692
  let tKey = 1;
51469
51693
  class SpreadsheetDashboard extends Component {
51470
51694
  static template = "o-spreadsheet-SpreadsheetDashboard";
51695
+ static props = {};
51471
51696
  static components = {
51472
51697
  GridOverlay,
51473
51698
  GridPopover,
@@ -51586,7 +51811,6 @@ class SpreadsheetDashboard extends Component {
51586
51811
  return { ...this.canvasPosition, ...this.env.model.getters.getSheetViewDimensionWithHeaders() };
51587
51812
  }
51588
51813
  }
51589
- SpreadsheetDashboard.props = {};
51590
51814
 
51591
51815
  css /* scss */ `
51592
51816
  .o-header-group {
@@ -51614,6 +51838,11 @@ css /* scss */ `
51614
51838
  `;
51615
51839
  class AbstractHeaderGroup extends Component {
51616
51840
  static template = "o-spreadsheet-HeaderGroup";
51841
+ static props = {
51842
+ group: Object,
51843
+ layerOffset: Number,
51844
+ openContextMenu: Function,
51845
+ };
51617
51846
  toggleGroup() {
51618
51847
  const sheetId = this.env.model.getters.getActiveSheetId();
51619
51848
  const { start, end } = this.props.group;
@@ -51650,11 +51879,6 @@ class AbstractHeaderGroup extends Component {
51650
51879
  this.props.openContextMenu(position, menuItems);
51651
51880
  }
51652
51881
  }
51653
- AbstractHeaderGroup.props = {
51654
- group: Object,
51655
- layerOffset: Number,
51656
- openContextMenu: Function,
51657
- };
51658
51882
  class RowGroup extends AbstractHeaderGroup {
51659
51883
  dimension = "ROW";
51660
51884
  get groupBorderStyle() {
@@ -51785,6 +52009,10 @@ css /* scss */ `
51785
52009
  `;
51786
52010
  class HeaderGroupContainer extends Component {
51787
52011
  static template = "o-spreadsheet-HeaderGroupContainer";
52012
+ static props = {
52013
+ dimension: String,
52014
+ layers: Array,
52015
+ };
51788
52016
  static components = { RowGroup, ColGroup, Menu };
51789
52017
  menu = useState({ isOpen: false, position: null, menuItems: [] });
51790
52018
  getLayerOffset(layerIndex) {
@@ -51847,10 +52075,6 @@ class HeaderGroupContainer extends Component {
51847
52075
  }
51848
52076
  }
51849
52077
  }
51850
- HeaderGroupContainer.props = {
51851
- dimension: String,
51852
- layers: Array,
51853
- };
51854
52078
 
51855
52079
  css /* scss */ `
51856
52080
  .o-sidePanel {
@@ -51961,14 +52185,6 @@ css /* scss */ `
51961
52185
  text-align: left;
51962
52186
  }
51963
52187
 
51964
- .o-checkbox {
51965
- display: flex;
51966
- justify-items: center;
51967
- input {
51968
- margin-right: 5px;
51969
- }
51970
- }
51971
-
51972
52188
  .o-inflection {
51973
52189
  table {
51974
52190
  table-layout: fixed;
@@ -52009,6 +52225,11 @@ css /* scss */ `
52009
52225
  `;
52010
52226
  class SidePanel extends Component {
52011
52227
  static template = "o-spreadsheet-SidePanel";
52228
+ static props = {
52229
+ component: String,
52230
+ panelProps: { type: Object, optional: true },
52231
+ onCloseSidePanel: Function,
52232
+ };
52012
52233
  state;
52013
52234
  setup() {
52014
52235
  this.state = useState({
@@ -52022,11 +52243,6 @@ class SidePanel extends Component {
52022
52243
  : this.state.panel.title;
52023
52244
  }
52024
52245
  }
52025
- SidePanel.props = {
52026
- component: String,
52027
- panelProps: { type: Object, optional: true },
52028
- onCloseSidePanel: Function,
52029
- };
52030
52246
 
52031
52247
  css /* scss */ `
52032
52248
  .o-menu-item-button {
@@ -52044,6 +52260,13 @@ css /* scss */ `
52044
52260
  `;
52045
52261
  class ActionButton extends Component {
52046
52262
  static template = "o-spreadsheet-ActionButton";
52263
+ static props = {
52264
+ action: Object,
52265
+ hasTriangleDownIcon: { type: Boolean, optional: true },
52266
+ selectedColor: { type: String, optional: true },
52267
+ class: { type: String, optional: true },
52268
+ onClick: { type: Function, optional: true },
52269
+ };
52047
52270
  actionButton = createAction(this.props.action);
52048
52271
  setup() {
52049
52272
  onWillUpdateProps((nextProps) => {
@@ -52086,13 +52309,6 @@ class ActionButton extends Component {
52086
52309
  return "";
52087
52310
  }
52088
52311
  }
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
52312
 
52097
52313
  /**
52098
52314
  * List the available borders positions and the corresponding icons.
@@ -52189,6 +52405,17 @@ css /* scss */ `
52189
52405
  `;
52190
52406
  class BorderEditor extends Component {
52191
52407
  static template = "o-spreadsheet-BorderEditor";
52408
+ static props = {
52409
+ class: { type: String, optional: true },
52410
+ currentBorderColor: { type: String, optional: false },
52411
+ currentBorderStyle: { type: String, optional: false },
52412
+ currentBorderPosition: { type: String, optional: true },
52413
+ onBorderColorPicked: Function,
52414
+ onBorderStylePicked: Function,
52415
+ onBorderPositionPicked: Function,
52416
+ maxHeight: { type: Number, optional: true },
52417
+ anchorRect: Object,
52418
+ };
52192
52419
  static components = { ColorPickerWidget, Popover };
52193
52420
  BORDER_POSITIONS = BORDER_POSITIONS;
52194
52421
  lineStyleButtonRef = useRef("lineStyleButton");
@@ -52244,20 +52471,16 @@ class BorderEditor extends Component {
52244
52471
  };
52245
52472
  }
52246
52473
  }
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
52474
 
52259
52475
  class BorderEditorWidget extends Component {
52260
52476
  static template = "o-spreadsheet-BorderEditorWidget";
52477
+ static props = {
52478
+ toggleBorderEditor: Function,
52479
+ showBorderEditor: Boolean,
52480
+ disabled: { type: Boolean, optional: true },
52481
+ dropdownMaxHeight: { type: Number, optional: true },
52482
+ class: { type: String, optional: true },
52483
+ };
52261
52484
  static components = { BorderEditor };
52262
52485
  borderEditorButtonRef = useRef("borderEditorButton");
52263
52486
  state = useState({
@@ -52302,13 +52525,6 @@ class BorderEditorWidget extends Component {
52302
52525
  });
52303
52526
  }
52304
52527
  }
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
52528
 
52313
52529
  const COMPOSER_MAX_HEIGHT = 100;
52314
52530
  /* svg free of use from https://uxwing.com/formula-fx-icon/ */
@@ -52337,6 +52553,12 @@ css /* scss */ `
52337
52553
  `;
52338
52554
  class TopBarComposer extends Component {
52339
52555
  static template = "o-spreadsheet-TopBarComposer";
52556
+ static props = {
52557
+ focus: {
52558
+ validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value),
52559
+ },
52560
+ onComposerContentFocused: Function,
52561
+ };
52340
52562
  static components = { Composer };
52341
52563
  get composerStyle() {
52342
52564
  const style = {
@@ -52359,10 +52581,6 @@ class TopBarComposer extends Component {
52359
52581
  });
52360
52582
  }
52361
52583
  }
52362
- TopBarComposer.props = {
52363
- focus: { validate: (value) => ["inactive", "cellFocus", "contentFocus"].includes(value) },
52364
- onComposerContentFocused: Function,
52365
- };
52366
52584
 
52367
52585
  css /* scss */ `
52368
52586
  .o-font-size-editor {
@@ -52391,6 +52609,11 @@ css /* scss */ `
52391
52609
  `;
52392
52610
  class FontSizeEditor extends Component {
52393
52611
  static template = "o-spreadsheet-FontSizeEditor";
52612
+ static props = {
52613
+ onToggle: Function,
52614
+ dropdownStyle: String,
52615
+ class: String,
52616
+ };
52394
52617
  static components = {};
52395
52618
  fontSizes = FONT_SIZES;
52396
52619
  dropdown = useState({ isOpen: false });
@@ -52447,14 +52670,12 @@ class FontSizeEditor extends Component {
52447
52670
  }
52448
52671
  }
52449
52672
  }
52450
- FontSizeEditor.props = {
52451
- onToggle: Function,
52452
- dropdownStyle: String,
52453
- class: String,
52454
- };
52455
52673
 
52456
52674
  class PaintFormatButton extends Component {
52457
52675
  static template = "o-spreadsheet-PaintFormatButton";
52676
+ static props = {
52677
+ class: { type: String, optional: true },
52678
+ };
52458
52679
  get isActive() {
52459
52680
  return this.env.model.getters.isPaintingFormat();
52460
52681
  }
@@ -52470,9 +52691,6 @@ class PaintFormatButton extends Component {
52470
52691
  }
52471
52692
  }
52472
52693
  }
52473
- PaintFormatButton.props = {
52474
- class: { type: String, optional: true },
52475
- };
52476
52694
 
52477
52695
  // -----------------------------------------------------------------------------
52478
52696
  // TopBar
@@ -52565,6 +52783,12 @@ css /* scss */ `
52565
52783
  `;
52566
52784
  class TopBar extends Component {
52567
52785
  static template = "o-spreadsheet-TopBar";
52786
+ static props = {
52787
+ onClick: Function,
52788
+ focusComposer: String,
52789
+ onComposerContentFocused: Function,
52790
+ dropdownMaxHeight: Number,
52791
+ };
52568
52792
  get dropdownStyle() {
52569
52793
  return `max-height:${this.props.dropdownMaxHeight}px`;
52570
52794
  }
@@ -52681,12 +52905,6 @@ class TopBar extends Component {
52681
52905
  this.onClick();
52682
52906
  }
52683
52907
  }
52684
- TopBar.props = {
52685
- onClick: Function,
52686
- focusComposer: String,
52687
- onComposerContentFocused: Function,
52688
- dropdownMaxHeight: Number,
52689
- };
52690
52908
 
52691
52909
  function instantiateClipboard() {
52692
52910
  return new WebClipboardWrapper(navigator.clipboard);
@@ -52919,6 +53137,9 @@ css /* scss */ `
52919
53137
  `;
52920
53138
  class Spreadsheet extends Component {
52921
53139
  static template = "o-spreadsheet-Spreadsheet";
53140
+ static props = {
53141
+ model: Object,
53142
+ };
52922
53143
  static components = {
52923
53144
  TopBar,
52924
53145
  Grid,
@@ -53131,9 +53352,6 @@ class Spreadsheet extends Component {
53131
53352
  return this.env.model.getters.getVisibleGroupLayers(sheetId, "COL");
53132
53353
  }
53133
53354
  }
53134
- Spreadsheet.props = {
53135
- model: Object,
53136
- };
53137
53355
 
53138
53356
  class LocalTransportService {
53139
53357
  listeners = [];
@@ -56780,6 +56998,6 @@ const constants = {
56780
56998
  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
56999
 
56782
57000
 
56783
- __info__.version = "17.1.0-alpha.6";
56784
- __info__.date = "2024-01-04T12:22:45.921Z";
56785
- __info__.hash = "56dbdc9";
57001
+ __info__.version = "17.1.0";
57002
+ __info__.date = "2024-01-16T07:47:15.054Z";
57003
+ __info__.hash = "87253c7";