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