@odoo/o-spreadsheet 16.0.42 → 16.0.44
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 +88 -32
- package/dist/o-spreadsheet.esm.js +88 -32
- package/dist/o-spreadsheet.iife.js +88 -32
- package/dist/o-spreadsheet.iife.min.js +241 -241
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2301,8 +2301,11 @@ function copyRangeWithNewSheetId(sheetIdFrom, sheetIdTo, range) {
|
|
|
2301
2301
|
/**
|
|
2302
2302
|
* Create a range from a xc. If the xc is empty, this function returns undefined.
|
|
2303
2303
|
*/
|
|
2304
|
-
function
|
|
2305
|
-
|
|
2304
|
+
function createValidRange(getters, sheetId, xc) {
|
|
2305
|
+
if (!xc)
|
|
2306
|
+
return;
|
|
2307
|
+
const range = getters.getRangeFromSheetXC(sheetId, xc);
|
|
2308
|
+
return !(range.invalidSheetName || range.invalidXc) ? range : undefined;
|
|
2306
2309
|
}
|
|
2307
2310
|
|
|
2308
2311
|
/** Methods from Odoo Web Utils */
|
|
@@ -4023,6 +4026,7 @@ function getMenuDescription(node) {
|
|
|
4023
4026
|
}
|
|
4024
4027
|
|
|
4025
4028
|
const macRegex = /Mac/i;
|
|
4029
|
+
const MODIFIER_KEYS = ["Shift", "Control", "Alt", "Meta"];
|
|
4026
4030
|
/**
|
|
4027
4031
|
* Return true if the event was triggered from
|
|
4028
4032
|
* a child element.
|
|
@@ -4041,6 +4045,31 @@ function gridOverlayPosition() {
|
|
|
4041
4045
|
function getOpenedMenus() {
|
|
4042
4046
|
return Array.from(document.querySelectorAll(".o-spreadsheet .o-menu"));
|
|
4043
4047
|
}
|
|
4048
|
+
const letterRegex = /^[a-zA-Z]$/;
|
|
4049
|
+
/**
|
|
4050
|
+
* Transform a keyboard event into a shortcut string that represent this event. The letters keys will be uppercased.
|
|
4051
|
+
*
|
|
4052
|
+
* @argument ev - The keyboard event to transform
|
|
4053
|
+
* @argument mode - Use either ev.key of ev.code to get the string shortcut
|
|
4054
|
+
*
|
|
4055
|
+
* @example
|
|
4056
|
+
* event : { ctrlKey: true, key: "a" } => "Ctrl+A"
|
|
4057
|
+
* event : { shift: true, alt: true, key: "Home" } => "Alt+Shift+Home"
|
|
4058
|
+
*/
|
|
4059
|
+
function keyboardEventToShortcutString(ev, mode = "key") {
|
|
4060
|
+
let keyDownString = "";
|
|
4061
|
+
if (!MODIFIER_KEYS.includes(ev.key)) {
|
|
4062
|
+
if (isCtrlKey(ev))
|
|
4063
|
+
keyDownString += "Ctrl+";
|
|
4064
|
+
if (ev.altKey)
|
|
4065
|
+
keyDownString += "Alt+";
|
|
4066
|
+
if (ev.shiftKey)
|
|
4067
|
+
keyDownString += "Shift+";
|
|
4068
|
+
}
|
|
4069
|
+
const key = mode === "key" ? ev.key : ev.code;
|
|
4070
|
+
keyDownString += letterRegex.test(key) ? key.toUpperCase() : key;
|
|
4071
|
+
return keyDownString;
|
|
4072
|
+
}
|
|
4044
4073
|
function isMacOS() {
|
|
4045
4074
|
return Boolean(macRegex.test(navigator.userAgent));
|
|
4046
4075
|
}
|
|
@@ -6975,8 +7004,8 @@ function createDataSets(getters, dataSetsString, sheetId, dataSetsHaveTitle) {
|
|
|
6975
7004
|
const dataSets = [];
|
|
6976
7005
|
for (const sheetXC of dataSetsString) {
|
|
6977
7006
|
const dataRange = getters.getRangeFromSheetXC(sheetId, sheetXC);
|
|
6978
|
-
const { unboundedZone: zone, sheetId: dataSetSheetId, invalidSheetName } = dataRange;
|
|
6979
|
-
if (invalidSheetName) {
|
|
7007
|
+
const { unboundedZone: zone, sheetId: dataSetSheetId, invalidSheetName, invalidXc } = dataRange;
|
|
7008
|
+
if (invalidSheetName || invalidXc) {
|
|
6980
7009
|
continue;
|
|
6981
7010
|
}
|
|
6982
7011
|
// It's a rectangle. We treat all columns (arbitrary) as different data series.
|
|
@@ -7369,7 +7398,7 @@ class BarChart extends AbstractChart {
|
|
|
7369
7398
|
super(definition, sheetId, getters);
|
|
7370
7399
|
this.type = "bar";
|
|
7371
7400
|
this.dataSets = createDataSets(getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
7372
|
-
this.labelRange =
|
|
7401
|
+
this.labelRange = createValidRange(getters, sheetId, definition.labelRange);
|
|
7373
7402
|
this.background = definition.background;
|
|
7374
7403
|
this.verticalAxisPosition = definition.verticalAxisPosition;
|
|
7375
7404
|
this.legendPosition = definition.legendPosition;
|
|
@@ -7665,7 +7694,7 @@ class GaugeChart extends AbstractChart {
|
|
|
7665
7694
|
constructor(definition, sheetId, getters) {
|
|
7666
7695
|
super(definition, sheetId, getters);
|
|
7667
7696
|
this.type = "gauge";
|
|
7668
|
-
this.dataRange =
|
|
7697
|
+
this.dataRange = createValidRange(this.getters, this.sheetId, definition.dataRange);
|
|
7669
7698
|
this.sectionRule = definition.sectionRule;
|
|
7670
7699
|
this.background = definition.background;
|
|
7671
7700
|
}
|
|
@@ -7996,7 +8025,7 @@ class LineChart extends AbstractChart {
|
|
|
7996
8025
|
super(definition, sheetId, getters);
|
|
7997
8026
|
this.type = "line";
|
|
7998
8027
|
this.dataSets = createDataSets(this.getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
7999
|
-
this.labelRange =
|
|
8028
|
+
this.labelRange = createValidRange(this.getters, sheetId, definition.labelRange);
|
|
8000
8029
|
this.background = definition.background;
|
|
8001
8030
|
this.verticalAxisPosition = definition.verticalAxisPosition;
|
|
8002
8031
|
this.legendPosition = definition.legendPosition;
|
|
@@ -8270,7 +8299,7 @@ class PieChart extends AbstractChart {
|
|
|
8270
8299
|
super(definition, sheetId, getters);
|
|
8271
8300
|
this.type = "pie";
|
|
8272
8301
|
this.dataSets = createDataSets(getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
8273
|
-
this.labelRange =
|
|
8302
|
+
this.labelRange = createValidRange(getters, sheetId, definition.labelRange);
|
|
8274
8303
|
this.background = definition.background;
|
|
8275
8304
|
this.legendPosition = definition.legendPosition;
|
|
8276
8305
|
}
|
|
@@ -8428,8 +8457,8 @@ class ScorecardChart$1 extends AbstractChart {
|
|
|
8428
8457
|
constructor(definition, sheetId, getters) {
|
|
8429
8458
|
super(definition, sheetId, getters);
|
|
8430
8459
|
this.type = "scorecard";
|
|
8431
|
-
this.keyValue =
|
|
8432
|
-
this.baseline =
|
|
8460
|
+
this.keyValue = createValidRange(getters, sheetId, definition.keyValue);
|
|
8461
|
+
this.baseline = createValidRange(getters, sheetId, definition.baseline);
|
|
8433
8462
|
this.baselineMode = definition.baselineMode;
|
|
8434
8463
|
this.baselineDescr = definition.baselineDescr;
|
|
8435
8464
|
this.background = definition.background;
|
|
@@ -20582,8 +20611,15 @@ class Composer extends owl.Component {
|
|
|
20582
20611
|
}
|
|
20583
20612
|
onPaste(ev) {
|
|
20584
20613
|
if (this.env.model.getters.getEditionMode() !== "inactive") {
|
|
20614
|
+
// let the browser clipboard work
|
|
20585
20615
|
ev.stopPropagation();
|
|
20586
20616
|
}
|
|
20617
|
+
else {
|
|
20618
|
+
// the user meant to paste in the sheet, not open the composer with the pasted content
|
|
20619
|
+
// While we're not editing, we still have the focus and should therefore prevent
|
|
20620
|
+
// the native "paste" to occur.
|
|
20621
|
+
ev.preventDefault();
|
|
20622
|
+
}
|
|
20587
20623
|
}
|
|
20588
20624
|
/*
|
|
20589
20625
|
* Triggered automatically by the content-editable between the keydown and key up
|
|
@@ -20593,10 +20629,6 @@ class Composer extends owl.Component {
|
|
|
20593
20629
|
if (!this.shouldProcessInputEvents) {
|
|
20594
20630
|
return;
|
|
20595
20631
|
}
|
|
20596
|
-
if (ev.inputType === "insertFromPaste" &&
|
|
20597
|
-
this.env.model.getters.getEditionMode() === "inactive") {
|
|
20598
|
-
return;
|
|
20599
|
-
}
|
|
20600
20632
|
ev.stopPropagation();
|
|
20601
20633
|
let content;
|
|
20602
20634
|
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
@@ -20913,10 +20945,7 @@ class GridComposer extends owl.Component {
|
|
|
20913
20945
|
}
|
|
20914
20946
|
get containerStyle() {
|
|
20915
20947
|
if (this.env.model.getters.getEditionMode() === "inactive" || !this.rect) {
|
|
20916
|
-
return `
|
|
20917
|
-
position: absolute;
|
|
20918
|
-
z-index: -1000;
|
|
20919
|
-
`;
|
|
20948
|
+
return `z-index: -1000;`;
|
|
20920
20949
|
}
|
|
20921
20950
|
const isFormula = this.env.model.getters.getCurrentContent().startsWith("=");
|
|
20922
20951
|
const cell = this.env.model.getters.getActiveCell();
|
|
@@ -21202,7 +21231,8 @@ class FigureComponent extends owl.Component {
|
|
|
21202
21231
|
}
|
|
21203
21232
|
onKeyDown(ev) {
|
|
21204
21233
|
const figure = this.props.figure;
|
|
21205
|
-
|
|
21234
|
+
const keyDownShortcut = keyboardEventToShortcutString(ev);
|
|
21235
|
+
switch (keyDownShortcut) {
|
|
21206
21236
|
case "Delete":
|
|
21207
21237
|
this.env.model.dispatch("DELETE_FIGURE", {
|
|
21208
21238
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
@@ -21232,6 +21262,22 @@ class FigureComponent extends owl.Component {
|
|
|
21232
21262
|
ev.preventDefault();
|
|
21233
21263
|
ev.stopPropagation();
|
|
21234
21264
|
break;
|
|
21265
|
+
case "Ctrl+A":
|
|
21266
|
+
// Maybe in the future we will implement a way to select all figures
|
|
21267
|
+
ev.preventDefault();
|
|
21268
|
+
ev.stopPropagation();
|
|
21269
|
+
break;
|
|
21270
|
+
case "Ctrl+Y":
|
|
21271
|
+
case "Ctrl+Z":
|
|
21272
|
+
if (keyDownShortcut === "Ctrl+Y") {
|
|
21273
|
+
this.env.model.dispatch("REQUEST_REDO");
|
|
21274
|
+
}
|
|
21275
|
+
else if (keyDownShortcut === "Ctrl+Z") {
|
|
21276
|
+
this.env.model.dispatch("REQUEST_UNDO");
|
|
21277
|
+
}
|
|
21278
|
+
ev.preventDefault();
|
|
21279
|
+
ev.stopPropagation();
|
|
21280
|
+
break;
|
|
21235
21281
|
}
|
|
21236
21282
|
}
|
|
21237
21283
|
}
|
|
@@ -23254,15 +23300,7 @@ class DateTimeCell extends NumberCell {
|
|
|
23254
23300
|
}
|
|
23255
23301
|
class LinkCell extends AbstractCell {
|
|
23256
23302
|
constructor(id, content, properties = {}) {
|
|
23257
|
-
var _a;
|
|
23258
23303
|
const link = parseMarkdownLink(content);
|
|
23259
|
-
properties = {
|
|
23260
|
-
...properties,
|
|
23261
|
-
style: {
|
|
23262
|
-
...properties.style,
|
|
23263
|
-
textColor: ((_a = properties.style) === null || _a === void 0 ? void 0 : _a.textColor) || LINK_COLOR,
|
|
23264
|
-
},
|
|
23265
|
-
};
|
|
23266
23304
|
link.label = _t(link.label);
|
|
23267
23305
|
super(id, lazy({ value: link.label, type: CellValueType.text }), properties);
|
|
23268
23306
|
this.link = link;
|
|
@@ -27828,6 +27866,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
27828
27866
|
BordersPlugin.getters = ["getCellBorder"];
|
|
27829
27867
|
|
|
27830
27868
|
const nbspRegexp = new RegExp(String.fromCharCode(160), "g");
|
|
27869
|
+
const LINK_STYLE = { textColor: LINK_COLOR };
|
|
27831
27870
|
/**
|
|
27832
27871
|
* Core Plugin
|
|
27833
27872
|
*
|
|
@@ -28062,7 +28101,11 @@ class CellPlugin extends CorePlugin {
|
|
|
28062
28101
|
return this.buildFormulaContent(sheetId, cell);
|
|
28063
28102
|
}
|
|
28064
28103
|
getCellStyle(cell) {
|
|
28065
|
-
|
|
28104
|
+
if (!cell) {
|
|
28105
|
+
return {};
|
|
28106
|
+
}
|
|
28107
|
+
const linkStyle = cell.isLink() ? LINK_STYLE : {};
|
|
28108
|
+
return { ...linkStyle, ...cell.style };
|
|
28066
28109
|
}
|
|
28067
28110
|
/**
|
|
28068
28111
|
* Converts a zone to a XC coordinate system
|
|
@@ -40631,6 +40674,9 @@ class RangeAdapter {
|
|
|
40631
40674
|
if (range.invalidXc) {
|
|
40632
40675
|
return range.invalidXc;
|
|
40633
40676
|
}
|
|
40677
|
+
if (!this.getters.tryGetSheet(range.sheetId)) {
|
|
40678
|
+
return INCORRECT_RANGE_STRING;
|
|
40679
|
+
}
|
|
40634
40680
|
if (range.zone.bottom - range.zone.top < 0 || range.zone.right - range.zone.left < 0) {
|
|
40635
40681
|
return INCORRECT_RANGE_STRING;
|
|
40636
40682
|
}
|
|
@@ -41769,6 +41815,12 @@ function addFormula(cell) {
|
|
|
41769
41815
|
else {
|
|
41770
41816
|
// Shouldn't we always output the value then ?
|
|
41771
41817
|
const value = cell.value;
|
|
41818
|
+
// If the cell contains a non-exported formula and that is evaluates to
|
|
41819
|
+
// nothing* ,we don't export it.
|
|
41820
|
+
// * non-falsy value are relevant and so are 0 and FALSE, which only leaves
|
|
41821
|
+
// the empty string.
|
|
41822
|
+
if (value === "")
|
|
41823
|
+
return undefined;
|
|
41772
41824
|
const type = getCellType(value);
|
|
41773
41825
|
attrs.push(["t", type]);
|
|
41774
41826
|
node = escapeXml /*xml*/ `<v>${value}</v>`;
|
|
@@ -42491,7 +42543,11 @@ function addRows(construct, data, sheet) {
|
|
|
42491
42543
|
let cellNode = escapeXml ``;
|
|
42492
42544
|
// Either formula or static value inside the cell
|
|
42493
42545
|
if (cell.isFormula) {
|
|
42494
|
-
|
|
42546
|
+
const res = addFormula(cell);
|
|
42547
|
+
if (!res) {
|
|
42548
|
+
continue;
|
|
42549
|
+
}
|
|
42550
|
+
({ attrs: additionalAttrs, node: cellNode } = res);
|
|
42495
42551
|
}
|
|
42496
42552
|
else if (cell.content && isMarkdownLink(cell.content)) {
|
|
42497
42553
|
const { label } = parseMarkdownLink(cell.content);
|
|
@@ -43327,6 +43383,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
43327
43383
|
exports.tokenize = tokenize;
|
|
43328
43384
|
|
|
43329
43385
|
|
|
43330
|
-
__info__.version = '16.0.
|
|
43331
|
-
__info__.date = '2024-
|
|
43332
|
-
__info__.hash = '
|
|
43386
|
+
__info__.version = '16.0.44';
|
|
43387
|
+
__info__.date = '2024-06-10T09:32:19.116Z';
|
|
43388
|
+
__info__.hash = '25d16f6';
|
|
@@ -2297,8 +2297,11 @@ function copyRangeWithNewSheetId(sheetIdFrom, sheetIdTo, range) {
|
|
|
2297
2297
|
/**
|
|
2298
2298
|
* Create a range from a xc. If the xc is empty, this function returns undefined.
|
|
2299
2299
|
*/
|
|
2300
|
-
function
|
|
2301
|
-
|
|
2300
|
+
function createValidRange(getters, sheetId, xc) {
|
|
2301
|
+
if (!xc)
|
|
2302
|
+
return;
|
|
2303
|
+
const range = getters.getRangeFromSheetXC(sheetId, xc);
|
|
2304
|
+
return !(range.invalidSheetName || range.invalidXc) ? range : undefined;
|
|
2302
2305
|
}
|
|
2303
2306
|
|
|
2304
2307
|
/** Methods from Odoo Web Utils */
|
|
@@ -4019,6 +4022,7 @@ function getMenuDescription(node) {
|
|
|
4019
4022
|
}
|
|
4020
4023
|
|
|
4021
4024
|
const macRegex = /Mac/i;
|
|
4025
|
+
const MODIFIER_KEYS = ["Shift", "Control", "Alt", "Meta"];
|
|
4022
4026
|
/**
|
|
4023
4027
|
* Return true if the event was triggered from
|
|
4024
4028
|
* a child element.
|
|
@@ -4037,6 +4041,31 @@ function gridOverlayPosition() {
|
|
|
4037
4041
|
function getOpenedMenus() {
|
|
4038
4042
|
return Array.from(document.querySelectorAll(".o-spreadsheet .o-menu"));
|
|
4039
4043
|
}
|
|
4044
|
+
const letterRegex = /^[a-zA-Z]$/;
|
|
4045
|
+
/**
|
|
4046
|
+
* Transform a keyboard event into a shortcut string that represent this event. The letters keys will be uppercased.
|
|
4047
|
+
*
|
|
4048
|
+
* @argument ev - The keyboard event to transform
|
|
4049
|
+
* @argument mode - Use either ev.key of ev.code to get the string shortcut
|
|
4050
|
+
*
|
|
4051
|
+
* @example
|
|
4052
|
+
* event : { ctrlKey: true, key: "a" } => "Ctrl+A"
|
|
4053
|
+
* event : { shift: true, alt: true, key: "Home" } => "Alt+Shift+Home"
|
|
4054
|
+
*/
|
|
4055
|
+
function keyboardEventToShortcutString(ev, mode = "key") {
|
|
4056
|
+
let keyDownString = "";
|
|
4057
|
+
if (!MODIFIER_KEYS.includes(ev.key)) {
|
|
4058
|
+
if (isCtrlKey(ev))
|
|
4059
|
+
keyDownString += "Ctrl+";
|
|
4060
|
+
if (ev.altKey)
|
|
4061
|
+
keyDownString += "Alt+";
|
|
4062
|
+
if (ev.shiftKey)
|
|
4063
|
+
keyDownString += "Shift+";
|
|
4064
|
+
}
|
|
4065
|
+
const key = mode === "key" ? ev.key : ev.code;
|
|
4066
|
+
keyDownString += letterRegex.test(key) ? key.toUpperCase() : key;
|
|
4067
|
+
return keyDownString;
|
|
4068
|
+
}
|
|
4040
4069
|
function isMacOS() {
|
|
4041
4070
|
return Boolean(macRegex.test(navigator.userAgent));
|
|
4042
4071
|
}
|
|
@@ -6971,8 +7000,8 @@ function createDataSets(getters, dataSetsString, sheetId, dataSetsHaveTitle) {
|
|
|
6971
7000
|
const dataSets = [];
|
|
6972
7001
|
for (const sheetXC of dataSetsString) {
|
|
6973
7002
|
const dataRange = getters.getRangeFromSheetXC(sheetId, sheetXC);
|
|
6974
|
-
const { unboundedZone: zone, sheetId: dataSetSheetId, invalidSheetName } = dataRange;
|
|
6975
|
-
if (invalidSheetName) {
|
|
7003
|
+
const { unboundedZone: zone, sheetId: dataSetSheetId, invalidSheetName, invalidXc } = dataRange;
|
|
7004
|
+
if (invalidSheetName || invalidXc) {
|
|
6976
7005
|
continue;
|
|
6977
7006
|
}
|
|
6978
7007
|
// It's a rectangle. We treat all columns (arbitrary) as different data series.
|
|
@@ -7365,7 +7394,7 @@ class BarChart extends AbstractChart {
|
|
|
7365
7394
|
super(definition, sheetId, getters);
|
|
7366
7395
|
this.type = "bar";
|
|
7367
7396
|
this.dataSets = createDataSets(getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
7368
|
-
this.labelRange =
|
|
7397
|
+
this.labelRange = createValidRange(getters, sheetId, definition.labelRange);
|
|
7369
7398
|
this.background = definition.background;
|
|
7370
7399
|
this.verticalAxisPosition = definition.verticalAxisPosition;
|
|
7371
7400
|
this.legendPosition = definition.legendPosition;
|
|
@@ -7661,7 +7690,7 @@ class GaugeChart extends AbstractChart {
|
|
|
7661
7690
|
constructor(definition, sheetId, getters) {
|
|
7662
7691
|
super(definition, sheetId, getters);
|
|
7663
7692
|
this.type = "gauge";
|
|
7664
|
-
this.dataRange =
|
|
7693
|
+
this.dataRange = createValidRange(this.getters, this.sheetId, definition.dataRange);
|
|
7665
7694
|
this.sectionRule = definition.sectionRule;
|
|
7666
7695
|
this.background = definition.background;
|
|
7667
7696
|
}
|
|
@@ -7992,7 +8021,7 @@ class LineChart extends AbstractChart {
|
|
|
7992
8021
|
super(definition, sheetId, getters);
|
|
7993
8022
|
this.type = "line";
|
|
7994
8023
|
this.dataSets = createDataSets(this.getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
7995
|
-
this.labelRange =
|
|
8024
|
+
this.labelRange = createValidRange(this.getters, sheetId, definition.labelRange);
|
|
7996
8025
|
this.background = definition.background;
|
|
7997
8026
|
this.verticalAxisPosition = definition.verticalAxisPosition;
|
|
7998
8027
|
this.legendPosition = definition.legendPosition;
|
|
@@ -8266,7 +8295,7 @@ class PieChart extends AbstractChart {
|
|
|
8266
8295
|
super(definition, sheetId, getters);
|
|
8267
8296
|
this.type = "pie";
|
|
8268
8297
|
this.dataSets = createDataSets(getters, definition.dataSets, sheetId, definition.dataSetsHaveTitle);
|
|
8269
|
-
this.labelRange =
|
|
8298
|
+
this.labelRange = createValidRange(getters, sheetId, definition.labelRange);
|
|
8270
8299
|
this.background = definition.background;
|
|
8271
8300
|
this.legendPosition = definition.legendPosition;
|
|
8272
8301
|
}
|
|
@@ -8424,8 +8453,8 @@ class ScorecardChart$1 extends AbstractChart {
|
|
|
8424
8453
|
constructor(definition, sheetId, getters) {
|
|
8425
8454
|
super(definition, sheetId, getters);
|
|
8426
8455
|
this.type = "scorecard";
|
|
8427
|
-
this.keyValue =
|
|
8428
|
-
this.baseline =
|
|
8456
|
+
this.keyValue = createValidRange(getters, sheetId, definition.keyValue);
|
|
8457
|
+
this.baseline = createValidRange(getters, sheetId, definition.baseline);
|
|
8429
8458
|
this.baselineMode = definition.baselineMode;
|
|
8430
8459
|
this.baselineDescr = definition.baselineDescr;
|
|
8431
8460
|
this.background = definition.background;
|
|
@@ -20578,8 +20607,15 @@ class Composer extends Component {
|
|
|
20578
20607
|
}
|
|
20579
20608
|
onPaste(ev) {
|
|
20580
20609
|
if (this.env.model.getters.getEditionMode() !== "inactive") {
|
|
20610
|
+
// let the browser clipboard work
|
|
20581
20611
|
ev.stopPropagation();
|
|
20582
20612
|
}
|
|
20613
|
+
else {
|
|
20614
|
+
// the user meant to paste in the sheet, not open the composer with the pasted content
|
|
20615
|
+
// While we're not editing, we still have the focus and should therefore prevent
|
|
20616
|
+
// the native "paste" to occur.
|
|
20617
|
+
ev.preventDefault();
|
|
20618
|
+
}
|
|
20583
20619
|
}
|
|
20584
20620
|
/*
|
|
20585
20621
|
* Triggered automatically by the content-editable between the keydown and key up
|
|
@@ -20589,10 +20625,6 @@ class Composer extends Component {
|
|
|
20589
20625
|
if (!this.shouldProcessInputEvents) {
|
|
20590
20626
|
return;
|
|
20591
20627
|
}
|
|
20592
|
-
if (ev.inputType === "insertFromPaste" &&
|
|
20593
|
-
this.env.model.getters.getEditionMode() === "inactive") {
|
|
20594
|
-
return;
|
|
20595
|
-
}
|
|
20596
20628
|
ev.stopPropagation();
|
|
20597
20629
|
let content;
|
|
20598
20630
|
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
@@ -20909,10 +20941,7 @@ class GridComposer extends Component {
|
|
|
20909
20941
|
}
|
|
20910
20942
|
get containerStyle() {
|
|
20911
20943
|
if (this.env.model.getters.getEditionMode() === "inactive" || !this.rect) {
|
|
20912
|
-
return `
|
|
20913
|
-
position: absolute;
|
|
20914
|
-
z-index: -1000;
|
|
20915
|
-
`;
|
|
20944
|
+
return `z-index: -1000;`;
|
|
20916
20945
|
}
|
|
20917
20946
|
const isFormula = this.env.model.getters.getCurrentContent().startsWith("=");
|
|
20918
20947
|
const cell = this.env.model.getters.getActiveCell();
|
|
@@ -21198,7 +21227,8 @@ class FigureComponent extends Component {
|
|
|
21198
21227
|
}
|
|
21199
21228
|
onKeyDown(ev) {
|
|
21200
21229
|
const figure = this.props.figure;
|
|
21201
|
-
|
|
21230
|
+
const keyDownShortcut = keyboardEventToShortcutString(ev);
|
|
21231
|
+
switch (keyDownShortcut) {
|
|
21202
21232
|
case "Delete":
|
|
21203
21233
|
this.env.model.dispatch("DELETE_FIGURE", {
|
|
21204
21234
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
@@ -21228,6 +21258,22 @@ class FigureComponent extends Component {
|
|
|
21228
21258
|
ev.preventDefault();
|
|
21229
21259
|
ev.stopPropagation();
|
|
21230
21260
|
break;
|
|
21261
|
+
case "Ctrl+A":
|
|
21262
|
+
// Maybe in the future we will implement a way to select all figures
|
|
21263
|
+
ev.preventDefault();
|
|
21264
|
+
ev.stopPropagation();
|
|
21265
|
+
break;
|
|
21266
|
+
case "Ctrl+Y":
|
|
21267
|
+
case "Ctrl+Z":
|
|
21268
|
+
if (keyDownShortcut === "Ctrl+Y") {
|
|
21269
|
+
this.env.model.dispatch("REQUEST_REDO");
|
|
21270
|
+
}
|
|
21271
|
+
else if (keyDownShortcut === "Ctrl+Z") {
|
|
21272
|
+
this.env.model.dispatch("REQUEST_UNDO");
|
|
21273
|
+
}
|
|
21274
|
+
ev.preventDefault();
|
|
21275
|
+
ev.stopPropagation();
|
|
21276
|
+
break;
|
|
21231
21277
|
}
|
|
21232
21278
|
}
|
|
21233
21279
|
}
|
|
@@ -23250,15 +23296,7 @@ class DateTimeCell extends NumberCell {
|
|
|
23250
23296
|
}
|
|
23251
23297
|
class LinkCell extends AbstractCell {
|
|
23252
23298
|
constructor(id, content, properties = {}) {
|
|
23253
|
-
var _a;
|
|
23254
23299
|
const link = parseMarkdownLink(content);
|
|
23255
|
-
properties = {
|
|
23256
|
-
...properties,
|
|
23257
|
-
style: {
|
|
23258
|
-
...properties.style,
|
|
23259
|
-
textColor: ((_a = properties.style) === null || _a === void 0 ? void 0 : _a.textColor) || LINK_COLOR,
|
|
23260
|
-
},
|
|
23261
|
-
};
|
|
23262
23300
|
link.label = _t(link.label);
|
|
23263
23301
|
super(id, lazy({ value: link.label, type: CellValueType.text }), properties);
|
|
23264
23302
|
this.link = link;
|
|
@@ -27824,6 +27862,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
27824
27862
|
BordersPlugin.getters = ["getCellBorder"];
|
|
27825
27863
|
|
|
27826
27864
|
const nbspRegexp = new RegExp(String.fromCharCode(160), "g");
|
|
27865
|
+
const LINK_STYLE = { textColor: LINK_COLOR };
|
|
27827
27866
|
/**
|
|
27828
27867
|
* Core Plugin
|
|
27829
27868
|
*
|
|
@@ -28058,7 +28097,11 @@ class CellPlugin extends CorePlugin {
|
|
|
28058
28097
|
return this.buildFormulaContent(sheetId, cell);
|
|
28059
28098
|
}
|
|
28060
28099
|
getCellStyle(cell) {
|
|
28061
|
-
|
|
28100
|
+
if (!cell) {
|
|
28101
|
+
return {};
|
|
28102
|
+
}
|
|
28103
|
+
const linkStyle = cell.isLink() ? LINK_STYLE : {};
|
|
28104
|
+
return { ...linkStyle, ...cell.style };
|
|
28062
28105
|
}
|
|
28063
28106
|
/**
|
|
28064
28107
|
* Converts a zone to a XC coordinate system
|
|
@@ -40627,6 +40670,9 @@ class RangeAdapter {
|
|
|
40627
40670
|
if (range.invalidXc) {
|
|
40628
40671
|
return range.invalidXc;
|
|
40629
40672
|
}
|
|
40673
|
+
if (!this.getters.tryGetSheet(range.sheetId)) {
|
|
40674
|
+
return INCORRECT_RANGE_STRING;
|
|
40675
|
+
}
|
|
40630
40676
|
if (range.zone.bottom - range.zone.top < 0 || range.zone.right - range.zone.left < 0) {
|
|
40631
40677
|
return INCORRECT_RANGE_STRING;
|
|
40632
40678
|
}
|
|
@@ -41765,6 +41811,12 @@ function addFormula(cell) {
|
|
|
41765
41811
|
else {
|
|
41766
41812
|
// Shouldn't we always output the value then ?
|
|
41767
41813
|
const value = cell.value;
|
|
41814
|
+
// If the cell contains a non-exported formula and that is evaluates to
|
|
41815
|
+
// nothing* ,we don't export it.
|
|
41816
|
+
// * non-falsy value are relevant and so are 0 and FALSE, which only leaves
|
|
41817
|
+
// the empty string.
|
|
41818
|
+
if (value === "")
|
|
41819
|
+
return undefined;
|
|
41768
41820
|
const type = getCellType(value);
|
|
41769
41821
|
attrs.push(["t", type]);
|
|
41770
41822
|
node = escapeXml /*xml*/ `<v>${value}</v>`;
|
|
@@ -42487,7 +42539,11 @@ function addRows(construct, data, sheet) {
|
|
|
42487
42539
|
let cellNode = escapeXml ``;
|
|
42488
42540
|
// Either formula or static value inside the cell
|
|
42489
42541
|
if (cell.isFormula) {
|
|
42490
|
-
|
|
42542
|
+
const res = addFormula(cell);
|
|
42543
|
+
if (!res) {
|
|
42544
|
+
continue;
|
|
42545
|
+
}
|
|
42546
|
+
({ attrs: additionalAttrs, node: cellNode } = res);
|
|
42491
42547
|
}
|
|
42492
42548
|
else if (cell.content && isMarkdownLink(cell.content)) {
|
|
42493
42549
|
const { label } = parseMarkdownLink(cell.content);
|
|
@@ -43295,6 +43351,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
43295
43351
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
43296
43352
|
|
|
43297
43353
|
|
|
43298
|
-
__info__.version = '16.0.
|
|
43299
|
-
__info__.date = '2024-
|
|
43300
|
-
__info__.hash = '
|
|
43354
|
+
__info__.version = '16.0.44';
|
|
43355
|
+
__info__.date = '2024-06-10T09:32:19.116Z';
|
|
43356
|
+
__info__.hash = '25d16f6';
|