@odoo/o-spreadsheet 17.4.15 → 17.4.17
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 +135 -58
- package/dist/o-spreadsheet.d.ts +15 -0
- package/dist/o-spreadsheet.esm.js +135 -58
- package/dist/o-spreadsheet.iife.js +135 -58
- package/dist/o-spreadsheet.iife.min.js +353 -354
- package/dist/o_spreadsheet.xml +8 -4
- package/package.json +2 -2
|
@@ -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.4.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.17
|
|
6
|
+
* @date 2025-01-14T11:34:44.930Z
|
|
7
|
+
* @hash fd2a7ab
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -768,6 +768,7 @@ function removeFalsyAttributes(obj) {
|
|
|
768
768
|
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes
|
|
769
769
|
*/
|
|
770
770
|
const whiteSpaceSpecialCharacters = [
|
|
771
|
+
" ",
|
|
771
772
|
"\t",
|
|
772
773
|
"\f",
|
|
773
774
|
"\v",
|
|
@@ -782,17 +783,15 @@ const whiteSpaceSpecialCharacters = [
|
|
|
782
783
|
String.fromCharCode(parseInt("3000", 16)),
|
|
783
784
|
String.fromCharCode(parseInt("feff", 16)),
|
|
784
785
|
];
|
|
785
|
-
const whiteSpaceRegexp = new RegExp(whiteSpaceSpecialCharacters.join("|")
|
|
786
|
+
const whiteSpaceRegexp = new RegExp(whiteSpaceSpecialCharacters.join("|"), "g");
|
|
787
|
+
const newLineRegexp = /(\r\n|\r)/g;
|
|
786
788
|
/**
|
|
787
|
-
* Replace all
|
|
788
|
-
* different newlines types by \n.
|
|
789
|
+
* Replace all different newlines characters by \n
|
|
789
790
|
*/
|
|
790
|
-
function
|
|
791
|
+
function replaceNewLines(text) {
|
|
791
792
|
if (!text)
|
|
792
793
|
return "";
|
|
793
|
-
|
|
794
|
-
return text;
|
|
795
|
-
return text.replace(whiteSpaceRegexp, (match, newLine) => (newLine ? NEWLINE : " "));
|
|
794
|
+
return text.replace(newLineRegexp, NEWLINE);
|
|
796
795
|
}
|
|
797
796
|
/**
|
|
798
797
|
* Determine if the numbers are consecutive.
|
|
@@ -5684,7 +5683,7 @@ class BorderClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
5684
5683
|
const POSTFIX_UNARY_OPERATORS = ["%"];
|
|
5685
5684
|
const OPERATORS = "+,-,*,/,:,=,<>,>=,>,<=,<,^,&".split(",").concat(POSTFIX_UNARY_OPERATORS);
|
|
5686
5685
|
function tokenize(str, locale = DEFAULT_LOCALE) {
|
|
5687
|
-
str =
|
|
5686
|
+
str = replaceNewLines(str);
|
|
5688
5687
|
const chars = new TokenizingChars(str);
|
|
5689
5688
|
const result = [];
|
|
5690
5689
|
while (!chars.isOver()) {
|
|
@@ -5831,12 +5830,12 @@ function tokenizeSpace(chars) {
|
|
|
5831
5830
|
if (length) {
|
|
5832
5831
|
return { type: "SPACE", value: NEWLINE.repeat(length) };
|
|
5833
5832
|
}
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
chars.shift();
|
|
5833
|
+
let spaces = "";
|
|
5834
|
+
while (chars.current && chars.current.match(whiteSpaceRegexp)) {
|
|
5835
|
+
spaces += chars.shift();
|
|
5837
5836
|
}
|
|
5838
|
-
if (
|
|
5839
|
-
return { type: "SPACE", value:
|
|
5837
|
+
if (spaces) {
|
|
5838
|
+
return { type: "SPACE", value: spaces };
|
|
5840
5839
|
}
|
|
5841
5840
|
return null;
|
|
5842
5841
|
}
|
|
@@ -20368,6 +20367,17 @@ const TEXT = {
|
|
|
20368
20367
|
},
|
|
20369
20368
|
isExported: true,
|
|
20370
20369
|
};
|
|
20370
|
+
// -----------------------------------------------------------------------------
|
|
20371
|
+
// VALUE
|
|
20372
|
+
// -----------------------------------------------------------------------------
|
|
20373
|
+
const VALUE = {
|
|
20374
|
+
description: _t("Converts a string to a numeric value."),
|
|
20375
|
+
args: [arg("value (number)", _t("the string to be converted"))],
|
|
20376
|
+
compute: function (value) {
|
|
20377
|
+
return toNumber(value, this.locale);
|
|
20378
|
+
},
|
|
20379
|
+
isExported: true,
|
|
20380
|
+
};
|
|
20371
20381
|
|
|
20372
20382
|
var text = /*#__PURE__*/Object.freeze({
|
|
20373
20383
|
__proto__: null,
|
|
@@ -20390,7 +20400,8 @@ var text = /*#__PURE__*/Object.freeze({
|
|
|
20390
20400
|
TEXT: TEXT,
|
|
20391
20401
|
TEXTJOIN: TEXTJOIN,
|
|
20392
20402
|
TRIM: TRIM,
|
|
20393
|
-
UPPER: UPPER
|
|
20403
|
+
UPPER: UPPER,
|
|
20404
|
+
VALUE: VALUE
|
|
20394
20405
|
});
|
|
20395
20406
|
|
|
20396
20407
|
// -----------------------------------------------------------------------------
|
|
@@ -20647,14 +20658,11 @@ autoCompleteProviders.add("functions", {
|
|
|
20647
20658
|
});
|
|
20648
20659
|
|
|
20649
20660
|
class DOMFocusableElementStore {
|
|
20650
|
-
mutators = ["setFocusableElement"
|
|
20661
|
+
mutators = ["setFocusableElement"];
|
|
20651
20662
|
focusableElement = undefined;
|
|
20652
20663
|
setFocusableElement(element) {
|
|
20653
20664
|
this.focusableElement = element;
|
|
20654
20665
|
}
|
|
20655
|
-
focus() {
|
|
20656
|
-
this.focusableElement?.focus();
|
|
20657
|
-
}
|
|
20658
20666
|
}
|
|
20659
20667
|
|
|
20660
20668
|
/**
|
|
@@ -24682,7 +24690,11 @@ function createGaugeChartRuntime(chart, getters) {
|
|
|
24682
24690
|
colors.push(chartColors.upperColor);
|
|
24683
24691
|
return {
|
|
24684
24692
|
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
24685
|
-
title:
|
|
24693
|
+
title: {
|
|
24694
|
+
...chart.title,
|
|
24695
|
+
// chart titles are extracted from .json files and they are translated at runtime here
|
|
24696
|
+
text: _t(chart.title.text ?? ""),
|
|
24697
|
+
},
|
|
24686
24698
|
minValue: {
|
|
24687
24699
|
value: minValue,
|
|
24688
24700
|
label: formatValue(minValue, { locale, format }),
|
|
@@ -38566,6 +38578,7 @@ css /* scss */ `
|
|
|
38566
38578
|
}
|
|
38567
38579
|
}
|
|
38568
38580
|
`;
|
|
38581
|
+
const DEFAULT_TABLE_STYLE_COLOR = "#3C78D8";
|
|
38569
38582
|
class TableStyleEditorPanel extends owl.Component {
|
|
38570
38583
|
static template = "o-spreadsheet-TableStyleEditorPanel";
|
|
38571
38584
|
static components = { Section, RoundColorPicker, TableStylePreview };
|
|
@@ -38584,7 +38597,7 @@ class TableStyleEditorPanel extends owl.Component {
|
|
|
38584
38597
|
: null;
|
|
38585
38598
|
return {
|
|
38586
38599
|
pickerOpened: false,
|
|
38587
|
-
primaryColor: editedStyle?.primaryColor ||
|
|
38600
|
+
primaryColor: editedStyle?.primaryColor || DEFAULT_TABLE_STYLE_COLOR,
|
|
38588
38601
|
selectedTemplateName: editedStyle?.templateName || "lightColoredText",
|
|
38589
38602
|
styleName: editedStyle?.displayName || this.env.model.getters.getNewCustomTableStyleName(),
|
|
38590
38603
|
};
|
|
@@ -38593,7 +38606,7 @@ class TableStyleEditorPanel extends owl.Component {
|
|
|
38593
38606
|
this.state.pickerOpened = !this.state.pickerOpened;
|
|
38594
38607
|
}
|
|
38595
38608
|
onColorPicked(color) {
|
|
38596
|
-
this.state.primaryColor = color;
|
|
38609
|
+
this.state.primaryColor = isColorValid(color) ? color : DEFAULT_TABLE_STYLE_COLOR;
|
|
38597
38610
|
this.state.pickerOpened = false;
|
|
38598
38611
|
}
|
|
38599
38612
|
onTemplatePicked(templateName) {
|
|
@@ -39421,7 +39434,7 @@ class GridComposer extends owl.Component {
|
|
|
39421
39434
|
this.isEditing = isEditing;
|
|
39422
39435
|
if (!isEditing) {
|
|
39423
39436
|
this.rect = this.defaultRect;
|
|
39424
|
-
this.DOMFocusableElementStore.focus();
|
|
39437
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
39425
39438
|
return;
|
|
39426
39439
|
}
|
|
39427
39440
|
const position = this.env.model.getters.getActivePosition();
|
|
@@ -39940,6 +39953,7 @@ class FiguresContainer extends owl.Component {
|
|
|
39940
39953
|
draggedFigure: undefined,
|
|
39941
39954
|
horizontalSnap: undefined,
|
|
39942
39955
|
verticalSnap: undefined,
|
|
39956
|
+
cancelDnd: undefined,
|
|
39943
39957
|
});
|
|
39944
39958
|
setup() {
|
|
39945
39959
|
owl.onMounted(() => {
|
|
@@ -39952,12 +39966,28 @@ class FiguresContainer extends owl.Component {
|
|
|
39952
39966
|
// new rendering
|
|
39953
39967
|
this.render();
|
|
39954
39968
|
});
|
|
39969
|
+
owl.onWillUpdateProps(() => {
|
|
39970
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
39971
|
+
const draggedFigureId = this.dnd.draggedFigure?.id;
|
|
39972
|
+
if (draggedFigureId && !this.env.model.getters.getFigure(sheetId, draggedFigureId)) {
|
|
39973
|
+
if (this.dnd.cancelDnd) {
|
|
39974
|
+
this.dnd.cancelDnd();
|
|
39975
|
+
}
|
|
39976
|
+
this.dnd.draggedFigure = undefined;
|
|
39977
|
+
this.dnd.horizontalSnap = undefined;
|
|
39978
|
+
this.dnd.verticalSnap = undefined;
|
|
39979
|
+
this.dnd.cancelDnd = undefined;
|
|
39980
|
+
}
|
|
39981
|
+
});
|
|
39955
39982
|
}
|
|
39956
39983
|
getVisibleFigures() {
|
|
39957
39984
|
const visibleFigures = this.env.model.getters.getVisibleFigures();
|
|
39958
39985
|
if (this.dnd.draggedFigure &&
|
|
39959
39986
|
!visibleFigures.some((figure) => figure.id === this.dnd.draggedFigure?.id)) {
|
|
39960
|
-
|
|
39987
|
+
const draggedFigure = this.env.model.getters.getFigure(this.env.model.getters.getActiveSheetId(), this.dnd.draggedFigure?.id);
|
|
39988
|
+
if (draggedFigure) {
|
|
39989
|
+
visibleFigures.push(draggedFigure);
|
|
39990
|
+
}
|
|
39961
39991
|
}
|
|
39962
39992
|
return visibleFigures;
|
|
39963
39993
|
}
|
|
@@ -40076,7 +40106,7 @@ class FiguresContainer extends owl.Component {
|
|
|
40076
40106
|
this.dnd.verticalSnap = undefined;
|
|
40077
40107
|
this.env.model.dispatch("UPDATE_FIGURE", { sheetId, id: figure.id, x, y });
|
|
40078
40108
|
};
|
|
40079
|
-
startDnd(onMouseMove, onMouseUp);
|
|
40109
|
+
this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
|
|
40080
40110
|
}
|
|
40081
40111
|
/**
|
|
40082
40112
|
* Initialize the resize of a figure with mouse movements
|
|
@@ -40124,7 +40154,7 @@ class FiguresContainer extends owl.Component {
|
|
|
40124
40154
|
this.dnd.horizontalSnap = undefined;
|
|
40125
40155
|
this.dnd.verticalSnap = undefined;
|
|
40126
40156
|
};
|
|
40127
|
-
startDnd(onMouseMove, onMouseUp);
|
|
40157
|
+
this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
|
|
40128
40158
|
}
|
|
40129
40159
|
getOtherFigures(figId) {
|
|
40130
40160
|
return this.getVisibleFigures().filter((f) => f.id !== figId);
|
|
@@ -42444,7 +42474,7 @@ class Grid extends owl.Component {
|
|
|
42444
42474
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
42445
42475
|
owl.useEffect(() => {
|
|
42446
42476
|
if (!this.sidePanel.isOpen) {
|
|
42447
|
-
this.DOMFocusableElementStore.focus();
|
|
42477
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
42448
42478
|
}
|
|
42449
42479
|
}, () => [this.sidePanel.isOpen]);
|
|
42450
42480
|
}
|
|
@@ -42648,7 +42678,7 @@ class Grid extends owl.Component {
|
|
|
42648
42678
|
focusDefaultElement() {
|
|
42649
42679
|
if (!this.env.model.getters.getSelectedFigureId() &&
|
|
42650
42680
|
this.composerStore.editionMode === "inactive") {
|
|
42651
|
-
this.DOMFocusableElementStore.focus();
|
|
42681
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
42652
42682
|
}
|
|
42653
42683
|
}
|
|
42654
42684
|
get gridEl() {
|
|
@@ -44265,7 +44295,7 @@ function extractStyle(cell, data) {
|
|
|
44265
44295
|
vertical: style.verticalAlign
|
|
44266
44296
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
44267
44297
|
: undefined,
|
|
44268
|
-
wrapText: style.wrapping === "wrap" || undefined,
|
|
44298
|
+
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
|
|
44269
44299
|
},
|
|
44270
44300
|
};
|
|
44271
44301
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -44488,7 +44518,7 @@ function convertFigure(figure, id, sheetData) {
|
|
|
44488
44518
|
return undefined;
|
|
44489
44519
|
}
|
|
44490
44520
|
function isChartData(data) {
|
|
44491
|
-
return "dataSets" in data;
|
|
44521
|
+
return "dataSets" in data && data.dataSets.length > 0;
|
|
44492
44522
|
}
|
|
44493
44523
|
function isImageData(data) {
|
|
44494
44524
|
return "imageSrc" in data;
|
|
@@ -44726,9 +44756,8 @@ function convertRows(sheet, numberOfRows, headerGroups) {
|
|
|
44726
44756
|
}
|
|
44727
44757
|
return rows;
|
|
44728
44758
|
}
|
|
44729
|
-
/** Remove newlines (\n) in shared strings, We do not support them */
|
|
44730
44759
|
function convertSharedStrings(xlsxSharedStrings) {
|
|
44731
|
-
return xlsxSharedStrings.map(
|
|
44760
|
+
return xlsxSharedStrings.map(replaceNewLines);
|
|
44732
44761
|
}
|
|
44733
44762
|
function convertCells(sheet, data, sheetDims, warningManager) {
|
|
44734
44763
|
const cells = {};
|
|
@@ -45497,15 +45526,10 @@ class XlsxMiscExtractor extends XlsxBaseExtractor {
|
|
|
45497
45526
|
getSharedStrings() {
|
|
45498
45527
|
return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
|
|
45499
45528
|
// Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
|
|
45500
|
-
if (ssElement.children[0].tagName === "t") {
|
|
45501
|
-
return this.extractTextContent(ssElement) || "";
|
|
45502
|
-
}
|
|
45503
45529
|
// We don't support rich text formatting, we'll only extract the text
|
|
45504
|
-
|
|
45505
|
-
return this.
|
|
45506
|
-
|
|
45507
|
-
}).join("");
|
|
45508
|
-
}
|
|
45530
|
+
return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
|
|
45531
|
+
return this.extractTextContent(textElement) || "";
|
|
45532
|
+
}).join("");
|
|
45509
45533
|
});
|
|
45510
45534
|
}
|
|
45511
45535
|
}
|
|
@@ -47379,10 +47403,34 @@ class BordersPlugin extends CorePlugin {
|
|
|
47379
47403
|
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
47380
47404
|
for (const group of groupConsecutive(elements)) {
|
|
47381
47405
|
if (cmd.dimension === "COL") {
|
|
47382
|
-
|
|
47406
|
+
if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
|
|
47407
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
47408
|
+
this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
|
|
47409
|
+
}
|
|
47410
|
+
}
|
|
47411
|
+
if (group[group.length - 1] === 0) {
|
|
47412
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
47413
|
+
this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
|
|
47414
|
+
}
|
|
47415
|
+
}
|
|
47416
|
+
const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
47417
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
47418
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
|
|
47383
47419
|
}
|
|
47384
47420
|
else {
|
|
47385
|
-
|
|
47421
|
+
if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
|
|
47422
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
47423
|
+
this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
|
|
47424
|
+
}
|
|
47425
|
+
}
|
|
47426
|
+
if (group[group.length - 1] === 0) {
|
|
47427
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
47428
|
+
this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
|
|
47429
|
+
}
|
|
47430
|
+
}
|
|
47431
|
+
const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
47432
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
47433
|
+
this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
|
|
47386
47434
|
}
|
|
47387
47435
|
}
|
|
47388
47436
|
break;
|
|
@@ -47689,6 +47737,18 @@ class BordersPlugin extends CorePlugin {
|
|
|
47689
47737
|
}
|
|
47690
47738
|
}
|
|
47691
47739
|
}
|
|
47740
|
+
/**
|
|
47741
|
+
* Remove the borders inside of a zone
|
|
47742
|
+
*/
|
|
47743
|
+
clearInsideBorders(sheetId, zones) {
|
|
47744
|
+
for (let zone of zones) {
|
|
47745
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
47746
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
47747
|
+
this.history.update("borders", sheetId, col, row, undefined);
|
|
47748
|
+
}
|
|
47749
|
+
}
|
|
47750
|
+
}
|
|
47751
|
+
}
|
|
47692
47752
|
/**
|
|
47693
47753
|
* Add a border to the existing one to a cell
|
|
47694
47754
|
*/
|
|
@@ -48236,7 +48296,7 @@ class CellPlugin extends CorePlugin {
|
|
|
48236
48296
|
const before = this.getters.getCell({ sheetId, col, row });
|
|
48237
48297
|
const hasContent = "content" in after || "formula" in after;
|
|
48238
48298
|
// Compute the new cell properties
|
|
48239
|
-
const afterContent = hasContent ?
|
|
48299
|
+
const afterContent = hasContent ? replaceNewLines(after?.content) : before?.content || "";
|
|
48240
48300
|
let style;
|
|
48241
48301
|
if (after.style !== undefined) {
|
|
48242
48302
|
style = after.style || undefined;
|
|
@@ -51097,6 +51157,9 @@ class SheetPlugin extends CorePlugin {
|
|
|
51097
51157
|
};
|
|
51098
51158
|
}
|
|
51099
51159
|
getUnboundedZone(sheetId, zone) {
|
|
51160
|
+
if (zone.bottom === undefined || zone.right === undefined) {
|
|
51161
|
+
return zone;
|
|
51162
|
+
}
|
|
51100
51163
|
const isFullRow = zone.left === 0 && zone.right === this.getNumberCols(sheetId) - 1;
|
|
51101
51164
|
const isFullCol = zone.top === 0 && zone.bottom === this.getNumberRows(sheetId) - 1;
|
|
51102
51165
|
return {
|
|
@@ -57515,6 +57578,9 @@ class Session extends EventBus {
|
|
|
57515
57578
|
}
|
|
57516
57579
|
}
|
|
57517
57580
|
this.acknowledge(message);
|
|
57581
|
+
if (message.type === "REMOTE_REVISION" && message.clientId === this.clientId) {
|
|
57582
|
+
return;
|
|
57583
|
+
}
|
|
57518
57584
|
this.trigger("collaborative-event-received");
|
|
57519
57585
|
}
|
|
57520
57586
|
onClientMoved(message) {
|
|
@@ -61306,6 +61372,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
61306
61372
|
break;
|
|
61307
61373
|
case "DELETE_SHEET":
|
|
61308
61374
|
this.cleanViewports();
|
|
61375
|
+
this.sheetsWithDirtyViewports.delete(cmd.sheetId);
|
|
61309
61376
|
break;
|
|
61310
61377
|
case "ACTIVATE_SHEET":
|
|
61311
61378
|
this.sheetsWithDirtyViewports.add(cmd.sheetIdTo);
|
|
@@ -62267,11 +62334,6 @@ class BottomBarSheet extends owl.Component {
|
|
|
62267
62334
|
editionState = "initializing";
|
|
62268
62335
|
DOMFocusableElementStore;
|
|
62269
62336
|
setup() {
|
|
62270
|
-
owl.onMounted(() => {
|
|
62271
|
-
if (this.isSheetActive) {
|
|
62272
|
-
this.scrollToSheet();
|
|
62273
|
-
}
|
|
62274
|
-
});
|
|
62275
62337
|
owl.onPatched(() => {
|
|
62276
62338
|
if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
|
|
62277
62339
|
this.editionState = "editing";
|
|
@@ -62279,6 +62341,11 @@ class BottomBarSheet extends owl.Component {
|
|
|
62279
62341
|
}
|
|
62280
62342
|
});
|
|
62281
62343
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
62344
|
+
owl.useEffect((sheetId) => {
|
|
62345
|
+
if (this.props.sheetId === sheetId) {
|
|
62346
|
+
this.scrollToSheet();
|
|
62347
|
+
}
|
|
62348
|
+
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
62282
62349
|
}
|
|
62283
62350
|
focusInputAndSelectContent() {
|
|
62284
62351
|
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
@@ -62290,7 +62357,10 @@ class BottomBarSheet extends owl.Component {
|
|
|
62290
62357
|
}
|
|
62291
62358
|
}
|
|
62292
62359
|
scrollToSheet() {
|
|
62293
|
-
this.sheetDivRef.el?.scrollIntoView?.(
|
|
62360
|
+
this.sheetDivRef.el?.scrollIntoView?.({
|
|
62361
|
+
behavior: "smooth",
|
|
62362
|
+
inline: "nearest",
|
|
62363
|
+
});
|
|
62294
62364
|
}
|
|
62295
62365
|
onFocusOut() {
|
|
62296
62366
|
if (this.state.isEditing && this.editionState !== "initializing") {
|
|
@@ -62320,11 +62390,11 @@ class BottomBarSheet extends owl.Component {
|
|
|
62320
62390
|
if (ev.key === "Enter") {
|
|
62321
62391
|
ev.preventDefault();
|
|
62322
62392
|
this.stopEdition();
|
|
62323
|
-
this.DOMFocusableElementStore.focus();
|
|
62393
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
62324
62394
|
}
|
|
62325
62395
|
if (ev.key === "Escape") {
|
|
62326
62396
|
this.cancelEdition();
|
|
62327
|
-
this.DOMFocusableElementStore.focus();
|
|
62397
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
62328
62398
|
}
|
|
62329
62399
|
}
|
|
62330
62400
|
onMouseEventSheetName(ev) {
|
|
@@ -63729,7 +63799,6 @@ css /* scss */ `
|
|
|
63729
63799
|
height: fit-content;
|
|
63730
63800
|
margin-top: -1px;
|
|
63731
63801
|
border: 1px solid;
|
|
63732
|
-
z-index: ${ComponentsImportance.TopBarComposer};
|
|
63733
63802
|
|
|
63734
63803
|
.o-composer:empty:not(:focus):not(.active)::before {
|
|
63735
63804
|
content: url("data:image/svg+xml,${encodeURIComponent(FX_SVG)}");
|
|
@@ -63771,6 +63840,7 @@ class TopBarComposer extends owl.Component {
|
|
|
63771
63840
|
}
|
|
63772
63841
|
return cssPropertiesToCss({
|
|
63773
63842
|
"border-color": SELECTION_BORDER_COLOR,
|
|
63843
|
+
"z-index": String(ComponentsImportance.TopBarComposer),
|
|
63774
63844
|
});
|
|
63775
63845
|
}
|
|
63776
63846
|
get delimitation() {
|
|
@@ -67859,7 +67929,12 @@ function createSharedStrings(strings) {
|
|
|
67859
67929
|
["count", strings.length],
|
|
67860
67930
|
["uniqueCount", strings.length],
|
|
67861
67931
|
];
|
|
67862
|
-
const stringNodes = strings.map((string) =>
|
|
67932
|
+
const stringNodes = strings.map((string) => {
|
|
67933
|
+
if (string.trim() !== string) {
|
|
67934
|
+
return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
|
|
67935
|
+
}
|
|
67936
|
+
return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
|
|
67937
|
+
});
|
|
67863
67938
|
const xml = escapeXml /*xml*/ `
|
|
67864
67939
|
<sst ${formatAttributes(namespaces)}>
|
|
67865
67940
|
${joinXmlNodes(stringNodes)}
|
|
@@ -68596,6 +68671,8 @@ const helpers = {
|
|
|
68596
68671
|
areDomainArgsFieldsValid,
|
|
68597
68672
|
formatTickValue,
|
|
68598
68673
|
sanitizeSheetName,
|
|
68674
|
+
isNumber,
|
|
68675
|
+
isDateTime,
|
|
68599
68676
|
};
|
|
68600
68677
|
const links = {
|
|
68601
68678
|
isMarkdownLink,
|
|
@@ -68726,6 +68803,6 @@ exports.tokenColors = tokenColors;
|
|
|
68726
68803
|
exports.tokenize = tokenize;
|
|
68727
68804
|
|
|
68728
68805
|
|
|
68729
|
-
__info__.version = "17.4.
|
|
68730
|
-
__info__.date = "
|
|
68731
|
-
__info__.hash = "
|
|
68806
|
+
__info__.version = "17.4.17";
|
|
68807
|
+
__info__.date = "2025-01-14T11:34:44.930Z";
|
|
68808
|
+
__info__.hash = "fd2a7ab";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -2671,6 +2671,10 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
|
|
|
2671
2671
|
* Remove the borders of a zone
|
|
2672
2672
|
*/
|
|
2673
2673
|
private clearBorders;
|
|
2674
|
+
/**
|
|
2675
|
+
* Remove the borders inside of a zone
|
|
2676
|
+
*/
|
|
2677
|
+
private clearInsideBorders;
|
|
2674
2678
|
/**
|
|
2675
2679
|
* Add a border to the existing one to a cell
|
|
2676
2680
|
*/
|
|
@@ -5534,6 +5538,7 @@ declare class DateTime {
|
|
|
5534
5538
|
setMinutes(minutes: number): number;
|
|
5535
5539
|
setSeconds(seconds: number): number;
|
|
5536
5540
|
}
|
|
5541
|
+
declare function isDateTime(str: string, locale: Locale): boolean;
|
|
5537
5542
|
|
|
5538
5543
|
/**
|
|
5539
5544
|
* Formats a cell value with its format.
|
|
@@ -5573,6 +5578,13 @@ declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
|
|
|
5573
5578
|
*/
|
|
5574
5579
|
declare function deepEquals(o1: any, o2: any): boolean;
|
|
5575
5580
|
|
|
5581
|
+
/**
|
|
5582
|
+
* Return true if the argument is a "number string".
|
|
5583
|
+
*
|
|
5584
|
+
* Note that "" (empty string) does not count as a number string
|
|
5585
|
+
*/
|
|
5586
|
+
declare function isNumber(value: string | undefined, locale: Locale): boolean;
|
|
5587
|
+
|
|
5576
5588
|
interface ConstructorArgs {
|
|
5577
5589
|
readonly zone: Readonly<Zone | UnboundedZone>;
|
|
5578
5590
|
readonly parts: readonly RangePart[];
|
|
@@ -8285,6 +8297,7 @@ interface DndState {
|
|
|
8285
8297
|
draggedFigure?: Figure;
|
|
8286
8298
|
horizontalSnap?: Snap<HFigureAxisType>;
|
|
8287
8299
|
verticalSnap?: Snap<VFigureAxisType>;
|
|
8300
|
+
cancelDnd: (() => void) | undefined;
|
|
8288
8301
|
}
|
|
8289
8302
|
/**
|
|
8290
8303
|
* Each figure ⭐ is positioned inside a container `div` placed and sized
|
|
@@ -11534,6 +11547,8 @@ declare const helpers: {
|
|
|
11534
11547
|
areDomainArgsFieldsValid: typeof areDomainArgsFieldsValid;
|
|
11535
11548
|
formatTickValue: typeof formatTickValue;
|
|
11536
11549
|
sanitizeSheetName: typeof sanitizeSheetName;
|
|
11550
|
+
isNumber: typeof isNumber;
|
|
11551
|
+
isDateTime: typeof isDateTime;
|
|
11537
11552
|
};
|
|
11538
11553
|
declare const links: {
|
|
11539
11554
|
isMarkdownLink: typeof isMarkdownLink;
|