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