@odoo/o-spreadsheet 18.0.8 → 18.0.10
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 +188 -71
- package/dist/o-spreadsheet.d.ts +22 -2
- package/dist/o-spreadsheet.esm.js +188 -71
- package/dist/o-spreadsheet.iife.js +188 -71
- package/dist/o-spreadsheet.iife.min.js +348 -344
- package/dist/o_spreadsheet.xml +8 -8
- package/package.json +3 -3
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.10
|
|
6
|
+
* @date 2025-01-15T08:05:47.616Z
|
|
7
|
+
* @hash 94c45c7
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -3541,6 +3541,7 @@
|
|
|
3541
3541
|
CommandResult["SheetIsHidden"] = "SheetIsHidden";
|
|
3542
3542
|
CommandResult["InvalidTableResize"] = "InvalidTableResize";
|
|
3543
3543
|
CommandResult["PivotIdNotFound"] = "PivotIdNotFound";
|
|
3544
|
+
CommandResult["PivotInError"] = "PivotInError";
|
|
3544
3545
|
CommandResult["EmptyName"] = "EmptyName";
|
|
3545
3546
|
CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
|
|
3546
3547
|
CommandResult["InvalidDefinition"] = "InvalidDefinition";
|
|
@@ -9387,9 +9388,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9387
9388
|
if (!newValues.length) {
|
|
9388
9389
|
return;
|
|
9389
9390
|
}
|
|
9390
|
-
return getFullTrendingLineDataSet(dataset, config, newValues);
|
|
9391
|
+
return getFullTrendingLineDataSet(dataset, config, newValues, newLabels);
|
|
9391
9392
|
}
|
|
9392
|
-
function getFullTrendingLineDataSet(dataset, config, data) {
|
|
9393
|
+
function getFullTrendingLineDataSet(dataset, config, data, labels) {
|
|
9393
9394
|
const defaultBorderColor = colorToRGBA(dataset.backgroundColor);
|
|
9394
9395
|
defaultBorderColor.a = 1;
|
|
9395
9396
|
const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), 0.5);
|
|
@@ -9398,7 +9399,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9398
9399
|
xAxisID: TREND_LINE_XAXIS_ID,
|
|
9399
9400
|
yAxisID: dataset.yAxisID,
|
|
9400
9401
|
label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
|
|
9401
|
-
data,
|
|
9402
|
+
data: data.map((v, i) => ({ x: labels[i], y: v })),
|
|
9402
9403
|
order: -1,
|
|
9403
9404
|
showLine: true,
|
|
9404
9405
|
pointRadius: 0,
|
|
@@ -19569,6 +19570,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19569
19570
|
},
|
|
19570
19571
|
isExported: true,
|
|
19571
19572
|
};
|
|
19573
|
+
// -----------------------------------------------------------------------------
|
|
19574
|
+
// VALUE
|
|
19575
|
+
// -----------------------------------------------------------------------------
|
|
19576
|
+
const VALUE = {
|
|
19577
|
+
description: _t("Converts a string to a numeric value."),
|
|
19578
|
+
args: [arg("value (number)", _t("the string to be converted"))],
|
|
19579
|
+
compute: function (value) {
|
|
19580
|
+
return toNumber(value, this.locale);
|
|
19581
|
+
},
|
|
19582
|
+
isExported: true,
|
|
19583
|
+
};
|
|
19572
19584
|
|
|
19573
19585
|
var text = /*#__PURE__*/Object.freeze({
|
|
19574
19586
|
__proto__: null,
|
|
@@ -19591,7 +19603,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19591
19603
|
TEXT: TEXT,
|
|
19592
19604
|
TEXTJOIN: TEXTJOIN,
|
|
19593
19605
|
TRIM: TRIM,
|
|
19594
|
-
UPPER: UPPER
|
|
19606
|
+
UPPER: UPPER,
|
|
19607
|
+
VALUE: VALUE
|
|
19595
19608
|
});
|
|
19596
19609
|
|
|
19597
19610
|
// -----------------------------------------------------------------------------
|
|
@@ -19855,14 +19868,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19855
19868
|
});
|
|
19856
19869
|
|
|
19857
19870
|
class DOMFocusableElementStore {
|
|
19858
|
-
mutators = ["setFocusableElement"
|
|
19871
|
+
mutators = ["setFocusableElement"];
|
|
19859
19872
|
focusableElement = undefined;
|
|
19860
19873
|
setFocusableElement(element) {
|
|
19861
19874
|
this.focusableElement = element;
|
|
19862
19875
|
}
|
|
19863
|
-
focus() {
|
|
19864
|
-
this.focusableElement?.focus();
|
|
19865
|
-
}
|
|
19866
19876
|
}
|
|
19867
19877
|
|
|
19868
19878
|
/**
|
|
@@ -20827,7 +20837,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20827
20837
|
if (document.activeElement === this.contentHelper.el &&
|
|
20828
20838
|
this.props.composerStore.editionMode === "inactive" &&
|
|
20829
20839
|
!this.props.isDefaultFocus) {
|
|
20830
|
-
this.DOMFocusableElementStore.focus();
|
|
20840
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
20831
20841
|
}
|
|
20832
20842
|
});
|
|
20833
20843
|
owl.useEffect(() => {
|
|
@@ -24411,7 +24421,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24411
24421
|
vertical: style.verticalAlign
|
|
24412
24422
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
24413
24423
|
: undefined,
|
|
24414
|
-
wrapText: style.wrapping === "wrap" || undefined,
|
|
24424
|
+
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
|
|
24415
24425
|
},
|
|
24416
24426
|
};
|
|
24417
24427
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -24634,7 +24644,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24634
24644
|
return undefined;
|
|
24635
24645
|
}
|
|
24636
24646
|
function isChartData(data) {
|
|
24637
|
-
return "dataSets" in data;
|
|
24647
|
+
return "dataSets" in data && data.dataSets.length > 0;
|
|
24638
24648
|
}
|
|
24639
24649
|
function isImageData(data) {
|
|
24640
24650
|
return "imageSrc" in data;
|
|
@@ -24873,9 +24883,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24873
24883
|
}
|
|
24874
24884
|
return rows;
|
|
24875
24885
|
}
|
|
24876
|
-
/** Remove newlines (\n) in shared strings, We do not support them */
|
|
24877
24886
|
function convertSharedStrings(xlsxSharedStrings) {
|
|
24878
|
-
return xlsxSharedStrings.map(
|
|
24887
|
+
return xlsxSharedStrings.map(replaceNewLines);
|
|
24879
24888
|
}
|
|
24880
24889
|
function convertCells(sheet, data, sheetDims, warningManager) {
|
|
24881
24890
|
const cells = {};
|
|
@@ -25976,15 +25985,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25976
25985
|
getSharedStrings() {
|
|
25977
25986
|
return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
|
|
25978
25987
|
// Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
|
|
25979
|
-
if (ssElement.children[0].tagName === "t") {
|
|
25980
|
-
return this.extractTextContent(ssElement) || "";
|
|
25981
|
-
}
|
|
25982
25988
|
// We don't support rich text formatting, we'll only extract the text
|
|
25983
|
-
|
|
25984
|
-
return this.
|
|
25985
|
-
|
|
25986
|
-
}).join("");
|
|
25987
|
-
}
|
|
25989
|
+
return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
|
|
25990
|
+
return this.extractTextContent(textElement) || "";
|
|
25991
|
+
}).join("");
|
|
25988
25992
|
});
|
|
25989
25993
|
}
|
|
25990
25994
|
}
|
|
@@ -28337,7 +28341,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28337
28341
|
// then using the classical aggregation method to sum the values.
|
|
28338
28342
|
data.fill(1);
|
|
28339
28343
|
}
|
|
28340
|
-
else if (data.every((cell) => cell === undefined || cell === null || !isNumber(cell.toString(),
|
|
28344
|
+
else if (data.every((cell) => cell === undefined || cell === null || !isNumber(cell.toString(), DEFAULT_LOCALE))) {
|
|
28341
28345
|
continue;
|
|
28342
28346
|
}
|
|
28343
28347
|
datasetValues.push({ data, label });
|
|
@@ -28913,12 +28917,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28913
28917
|
}
|
|
28914
28918
|
const numberOfStep = 5 * labels.length;
|
|
28915
28919
|
const step = (xmax - xmin) / numberOfStep;
|
|
28916
|
-
const
|
|
28917
|
-
const
|
|
28918
|
-
if (!
|
|
28920
|
+
const trendLabels = range(xmin, xmax + step / 2, step);
|
|
28921
|
+
const trendValues = interpolateData(config, filteredValues, filteredLabels, trendLabels);
|
|
28922
|
+
if (!trendValues.length) {
|
|
28919
28923
|
return;
|
|
28920
28924
|
}
|
|
28921
|
-
return getFullTrendingLineDataSet(dataset, config,
|
|
28925
|
+
return getFullTrendingLineDataSet(dataset, config, trendValues, trendLabels);
|
|
28922
28926
|
}
|
|
28923
28927
|
function createLineOrScatterChartRuntime(chart, getters) {
|
|
28924
28928
|
const axisType = getChartAxisType(chart, getters);
|
|
@@ -29035,8 +29039,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29035
29039
|
config.options.scales.x.type = "linear";
|
|
29036
29040
|
config.options.scales.x.ticks.callback = (value) => formatValue(value, { format: labelFormat, locale });
|
|
29037
29041
|
config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
|
|
29038
|
-
|
|
29039
|
-
let label
|
|
29042
|
+
let dataSetPoint;
|
|
29043
|
+
let label;
|
|
29044
|
+
if (tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
29045
|
+
dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex].y;
|
|
29046
|
+
label = "";
|
|
29047
|
+
}
|
|
29048
|
+
else {
|
|
29049
|
+
dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex];
|
|
29050
|
+
label = labelValues.values[tooltipItem.dataIndex];
|
|
29051
|
+
}
|
|
29040
29052
|
if (isNumber(label, locale)) {
|
|
29041
29053
|
label = toNumber(label, locale);
|
|
29042
29054
|
}
|
|
@@ -29107,16 +29119,18 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29107
29119
|
}
|
|
29108
29120
|
}
|
|
29109
29121
|
if (trendDatasets.length) {
|
|
29110
|
-
/* We add a second x axis here to draw the trend lines, with the labels length being
|
|
29111
|
-
* set so that the second axis points match the classical x axis
|
|
29112
|
-
*/
|
|
29113
29122
|
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
29114
29123
|
...xAxis,
|
|
29115
|
-
type: "category",
|
|
29116
|
-
labels: range(0, maxLength).map((x) => x.toString()),
|
|
29117
|
-
offset: false,
|
|
29118
29124
|
display: false,
|
|
29119
29125
|
};
|
|
29126
|
+
if (axisType === "category" || axisType === "time") {
|
|
29127
|
+
/* We add a second x axis here to draw the trend lines, with the labels length being
|
|
29128
|
+
* set so that the second axis points match the classical x axis
|
|
29129
|
+
*/
|
|
29130
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
29131
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
29132
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
29133
|
+
}
|
|
29120
29134
|
/* These datasets must be inserted after the original datasets to ensure the way we
|
|
29121
29135
|
* distinguish the originals and trendLine datasets after
|
|
29122
29136
|
*/
|
|
@@ -29607,7 +29621,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29607
29621
|
colors.push(chartColors.upperColor);
|
|
29608
29622
|
return {
|
|
29609
29623
|
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
29610
|
-
title:
|
|
29624
|
+
title: {
|
|
29625
|
+
...chart.title,
|
|
29626
|
+
// chart titles are extracted from .json files and they are translated at runtime here
|
|
29627
|
+
text: _t(chart.title.text ?? ""),
|
|
29628
|
+
},
|
|
29611
29629
|
minValue: {
|
|
29612
29630
|
value: minValue,
|
|
29613
29631
|
label: formatValue(minValue, { locale, format }),
|
|
@@ -34288,12 +34306,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34288
34306
|
});
|
|
34289
34307
|
}
|
|
34290
34308
|
function isAutomaticFormatSelected(env) {
|
|
34291
|
-
const
|
|
34292
|
-
|
|
34309
|
+
const activePosition = env.model.getters.getActivePosition();
|
|
34310
|
+
const pivotCell = env.model.getters.getPivotCellFromPosition(activePosition);
|
|
34311
|
+
if (pivotCell.type === "VALUE") {
|
|
34312
|
+
return !env.model.getters.getEvaluatedCell(activePosition).format;
|
|
34313
|
+
}
|
|
34314
|
+
return !env.model.getters.getCell(activePosition)?.format;
|
|
34293
34315
|
}
|
|
34294
34316
|
function isFormatSelected(env, format) {
|
|
34295
|
-
const
|
|
34296
|
-
|
|
34317
|
+
const activePosition = env.model.getters.getActivePosition();
|
|
34318
|
+
const pivotCell = env.model.getters.getPivotCellFromPosition(activePosition);
|
|
34319
|
+
if (pivotCell.type === "VALUE") {
|
|
34320
|
+
return env.model.getters.getEvaluatedCell(activePosition).format === format;
|
|
34321
|
+
}
|
|
34322
|
+
return env.model.getters.getCell(activePosition)?.format === format;
|
|
34297
34323
|
}
|
|
34298
34324
|
function isFontSizeSelected(env, fontSize) {
|
|
34299
34325
|
const currentFontSize = env.model.getters.getCurrentStyle().fontSize || DEFAULT_FONT_SIZE;
|
|
@@ -39976,6 +40002,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39976
40002
|
border: 1px solid #d8dadd;
|
|
39977
40003
|
color: #374151;
|
|
39978
40004
|
}
|
|
40005
|
+
|
|
40006
|
+
table {
|
|
40007
|
+
table-layout: fixed;
|
|
40008
|
+
}
|
|
39979
40009
|
}
|
|
39980
40010
|
`;
|
|
39981
40011
|
class CustomCurrencyPanel extends owl.Component {
|
|
@@ -42211,16 +42241,21 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42211
42241
|
}
|
|
42212
42242
|
this.inputRef.el?.blur();
|
|
42213
42243
|
}
|
|
42214
|
-
|
|
42215
|
-
|
|
42216
|
-
if (
|
|
42217
|
-
|
|
42218
|
-
|
|
42219
|
-
|
|
42220
|
-
|
|
42221
|
-
|
|
42222
|
-
|
|
42223
|
-
|
|
42244
|
+
onMouseDown(ev) {
|
|
42245
|
+
// Stop the event if the input is not focused, we handle everything in onMouseUp
|
|
42246
|
+
if (ev.target !== document.activeElement) {
|
|
42247
|
+
ev.preventDefault();
|
|
42248
|
+
ev.stopPropagation();
|
|
42249
|
+
}
|
|
42250
|
+
}
|
|
42251
|
+
onMouseUp(ev) {
|
|
42252
|
+
const target = ev.target;
|
|
42253
|
+
if (target !== document.activeElement) {
|
|
42254
|
+
target.focus();
|
|
42255
|
+
target.select();
|
|
42256
|
+
ev.preventDefault();
|
|
42257
|
+
ev.stopPropagation();
|
|
42258
|
+
}
|
|
42224
42259
|
}
|
|
42225
42260
|
}
|
|
42226
42261
|
|
|
@@ -42698,7 +42733,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42698
42733
|
newPivotId,
|
|
42699
42734
|
newSheetId,
|
|
42700
42735
|
});
|
|
42701
|
-
|
|
42736
|
+
let text;
|
|
42737
|
+
if (result.isSuccessful) {
|
|
42738
|
+
text = _t("Pivot duplicated.");
|
|
42739
|
+
}
|
|
42740
|
+
else if (result.isCancelledBecause("PivotInError" /* CommandResult.PivotInError */)) {
|
|
42741
|
+
text = _t("Cannot duplicate a pivot in error.");
|
|
42742
|
+
}
|
|
42743
|
+
else {
|
|
42744
|
+
text = _t("Pivot duplication failed.");
|
|
42745
|
+
}
|
|
42702
42746
|
const type = result.isSuccessful ? "success" : "danger";
|
|
42703
42747
|
this.env.notifyUser({
|
|
42704
42748
|
text,
|
|
@@ -43996,7 +44040,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43996
44040
|
pivot: this.draft,
|
|
43997
44041
|
});
|
|
43998
44042
|
this.draft = null;
|
|
43999
|
-
if (!this.alreadyNotified &&
|
|
44043
|
+
if (!this.alreadyNotified &&
|
|
44044
|
+
!this.isDynamicPivotInViewport() &&
|
|
44045
|
+
this.isStaticPivotInViewport()) {
|
|
44000
44046
|
const formulaId = this.getters.getPivotFormulaId(this.pivotId);
|
|
44001
44047
|
const pivotExample = `=PIVOT(${formulaId})`;
|
|
44002
44048
|
this.alreadyNotified = true;
|
|
@@ -44063,6 +44109,18 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44063
44109
|
}
|
|
44064
44110
|
return false;
|
|
44065
44111
|
}
|
|
44112
|
+
isStaticPivotInViewport() {
|
|
44113
|
+
for (const position of this.getters.getVisibleCellPositions()) {
|
|
44114
|
+
const cell = this.getters.getCell(position);
|
|
44115
|
+
if (cell?.isFormula) {
|
|
44116
|
+
const pivotFunction = getFirstPivotFunction(cell.compiledFormula.tokens);
|
|
44117
|
+
if (pivotFunction && pivotFunction.functionName !== "PIVOT") {
|
|
44118
|
+
return true;
|
|
44119
|
+
}
|
|
44120
|
+
}
|
|
44121
|
+
}
|
|
44122
|
+
return false;
|
|
44123
|
+
}
|
|
44066
44124
|
addDefaultDateTimeGranularity(fields, definition) {
|
|
44067
44125
|
const { columns, rows } = definition;
|
|
44068
44126
|
const columnsWithGranularity = deepCopy(columns);
|
|
@@ -49449,7 +49507,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49449
49507
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
49450
49508
|
owl.useEffect(() => {
|
|
49451
49509
|
if (!this.sidePanel.isOpen) {
|
|
49452
|
-
this.DOMFocusableElementStore.focus();
|
|
49510
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
49453
49511
|
}
|
|
49454
49512
|
}, () => [this.sidePanel.isOpen]);
|
|
49455
49513
|
}
|
|
@@ -49653,7 +49711,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49653
49711
|
focusDefaultElement() {
|
|
49654
49712
|
if (!this.env.model.getters.getSelectedFigureId() &&
|
|
49655
49713
|
this.composerFocusStore.activeComposer.editionMode === "inactive") {
|
|
49656
|
-
this.DOMFocusableElementStore.focus();
|
|
49714
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
49657
49715
|
}
|
|
49658
49716
|
}
|
|
49659
49717
|
get gridEl() {
|
|
@@ -50217,10 +50275,34 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50217
50275
|
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
50218
50276
|
for (const group of groupConsecutive(elements)) {
|
|
50219
50277
|
if (cmd.dimension === "COL") {
|
|
50220
|
-
|
|
50278
|
+
if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
|
|
50279
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
50280
|
+
this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
|
|
50281
|
+
}
|
|
50282
|
+
}
|
|
50283
|
+
if (group[group.length - 1] === 0) {
|
|
50284
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
50285
|
+
this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
|
|
50286
|
+
}
|
|
50287
|
+
}
|
|
50288
|
+
const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
50289
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
50290
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
|
|
50221
50291
|
}
|
|
50222
50292
|
else {
|
|
50223
|
-
|
|
50293
|
+
if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
|
|
50294
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
50295
|
+
this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
|
|
50296
|
+
}
|
|
50297
|
+
}
|
|
50298
|
+
if (group[group.length - 1] === 0) {
|
|
50299
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
50300
|
+
this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
|
|
50301
|
+
}
|
|
50302
|
+
}
|
|
50303
|
+
const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
50304
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
50305
|
+
this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
|
|
50224
50306
|
}
|
|
50225
50307
|
}
|
|
50226
50308
|
break;
|
|
@@ -50527,6 +50609,18 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50527
50609
|
}
|
|
50528
50610
|
}
|
|
50529
50611
|
}
|
|
50612
|
+
/**
|
|
50613
|
+
* Remove the borders inside of a zone
|
|
50614
|
+
*/
|
|
50615
|
+
clearInsideBorders(sheetId, zones) {
|
|
50616
|
+
for (let zone of zones) {
|
|
50617
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
50618
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
50619
|
+
this.history.update("borders", sheetId, col, row, undefined);
|
|
50620
|
+
}
|
|
50621
|
+
}
|
|
50622
|
+
}
|
|
50623
|
+
}
|
|
50530
50624
|
/**
|
|
50531
50625
|
* Add a border to the existing one to a cell
|
|
50532
50626
|
*/
|
|
@@ -61768,6 +61862,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61768
61862
|
|
|
61769
61863
|
class InsertPivotPlugin extends UIPlugin {
|
|
61770
61864
|
static getters = [];
|
|
61865
|
+
allowDispatch(cmd) {
|
|
61866
|
+
switch (cmd.type) {
|
|
61867
|
+
case "DUPLICATE_PIVOT_IN_NEW_SHEET":
|
|
61868
|
+
if (!this.getters.isExistingPivot(cmd.pivotId)) {
|
|
61869
|
+
return "PivotIdNotFound" /* CommandResult.PivotIdNotFound */;
|
|
61870
|
+
}
|
|
61871
|
+
if (!this.getters.getPivot(cmd.pivotId).isValid()) {
|
|
61872
|
+
return "PivotInError" /* CommandResult.PivotInError */;
|
|
61873
|
+
}
|
|
61874
|
+
break;
|
|
61875
|
+
}
|
|
61876
|
+
return "Success" /* CommandResult.Success */;
|
|
61877
|
+
}
|
|
61771
61878
|
handle(cmd) {
|
|
61772
61879
|
switch (cmd.type) {
|
|
61773
61880
|
case "INSERT_NEW_PIVOT":
|
|
@@ -65996,11 +66103,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65996
66103
|
editionState = "initializing";
|
|
65997
66104
|
DOMFocusableElementStore;
|
|
65998
66105
|
setup() {
|
|
65999
|
-
owl.onMounted(() => {
|
|
66000
|
-
if (this.isSheetActive) {
|
|
66001
|
-
this.scrollToSheet();
|
|
66002
|
-
}
|
|
66003
|
-
});
|
|
66004
66106
|
owl.onPatched(() => {
|
|
66005
66107
|
if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
|
|
66006
66108
|
this.editionState = "editing";
|
|
@@ -66009,6 +66111,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66009
66111
|
});
|
|
66010
66112
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
66011
66113
|
owl.useExternalListener(window, "click", () => (this.state.pickerOpened = false));
|
|
66114
|
+
owl.useEffect((sheetId) => {
|
|
66115
|
+
if (this.props.sheetId === sheetId) {
|
|
66116
|
+
this.scrollToSheet();
|
|
66117
|
+
}
|
|
66118
|
+
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
66012
66119
|
}
|
|
66013
66120
|
focusInputAndSelectContent() {
|
|
66014
66121
|
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
@@ -66020,7 +66127,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66020
66127
|
}
|
|
66021
66128
|
}
|
|
66022
66129
|
scrollToSheet() {
|
|
66023
|
-
this.sheetDivRef.el?.scrollIntoView?.(
|
|
66130
|
+
this.sheetDivRef.el?.scrollIntoView?.({
|
|
66131
|
+
behavior: "smooth",
|
|
66132
|
+
inline: "nearest",
|
|
66133
|
+
});
|
|
66024
66134
|
}
|
|
66025
66135
|
onFocusOut() {
|
|
66026
66136
|
if (this.state.isEditing && this.editionState !== "initializing") {
|
|
@@ -66050,11 +66160,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66050
66160
|
if (ev.key === "Enter") {
|
|
66051
66161
|
ev.preventDefault();
|
|
66052
66162
|
this.stopEdition();
|
|
66053
|
-
this.DOMFocusableElementStore.focus();
|
|
66163
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
66054
66164
|
}
|
|
66055
66165
|
if (ev.key === "Escape") {
|
|
66056
66166
|
this.cancelEdition();
|
|
66057
|
-
this.DOMFocusableElementStore.focus();
|
|
66167
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
66058
66168
|
}
|
|
66059
66169
|
}
|
|
66060
66170
|
onMouseEventSheetName(ev) {
|
|
@@ -71678,7 +71788,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71678
71788
|
["count", strings.length],
|
|
71679
71789
|
["uniqueCount", strings.length],
|
|
71680
71790
|
];
|
|
71681
|
-
const stringNodes = strings.map((string) =>
|
|
71791
|
+
const stringNodes = strings.map((string) => {
|
|
71792
|
+
if (string.trim() !== string) {
|
|
71793
|
+
return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
|
|
71794
|
+
}
|
|
71795
|
+
return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
|
|
71796
|
+
});
|
|
71682
71797
|
const xml = escapeXml /*xml*/ `
|
|
71683
71798
|
<sst ${formatAttributes(namespaces)}>
|
|
71684
71799
|
${joinXmlNodes(stringNodes)}
|
|
@@ -71923,7 +72038,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71923
72038
|
// events
|
|
71924
72039
|
this.setupSessionEvents();
|
|
71925
72040
|
this.joinSession();
|
|
71926
|
-
if (config.snapshotRequested) {
|
|
72041
|
+
if (config.snapshotRequested || (data["[Content_Types].xml"] && !this.getters.isReadonly())) {
|
|
71927
72042
|
const startSnapshot = performance.now();
|
|
71928
72043
|
console.debug("Snapshot requested");
|
|
71929
72044
|
this.session.snapshot(this.exportData());
|
|
@@ -72421,6 +72536,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
72421
72536
|
splitReference,
|
|
72422
72537
|
formatTickValue,
|
|
72423
72538
|
sanitizeSheetName,
|
|
72539
|
+
isNumber,
|
|
72540
|
+
isDateTime,
|
|
72424
72541
|
};
|
|
72425
72542
|
const links = {
|
|
72426
72543
|
isMarkdownLink,
|
|
@@ -72556,9 +72673,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
72556
72673
|
exports.tokenize = tokenize;
|
|
72557
72674
|
|
|
72558
72675
|
|
|
72559
|
-
__info__.version = "18.0.
|
|
72560
|
-
__info__.date = "
|
|
72561
|
-
__info__.hash = "
|
|
72676
|
+
__info__.version = "18.0.10";
|
|
72677
|
+
__info__.date = "2025-01-15T08:05:47.616Z";
|
|
72678
|
+
__info__.hash = "94c45c7";
|
|
72562
72679
|
|
|
72563
72680
|
|
|
72564
72681
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|