@odoo/o-spreadsheet 18.1.0-alpha.8 → 18.1.1
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 +208 -80
- package/dist/o-spreadsheet.d.ts +22 -5
- package/dist/o-spreadsheet.esm.js +208 -80
- package/dist/o-spreadsheet.iife.js +208 -80
- package/dist/o-spreadsheet.iife.min.js +377 -373
- 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.1.
|
|
6
|
-
* @date
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.1
|
|
6
|
+
* @date 2025-01-14T11:43:19.116Z
|
|
7
|
+
* @hash d0fa5de
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -3711,6 +3711,7 @@ exports.CommandResult = void 0;
|
|
|
3711
3711
|
CommandResult["SheetIsHidden"] = "SheetIsHidden";
|
|
3712
3712
|
CommandResult["InvalidTableResize"] = "InvalidTableResize";
|
|
3713
3713
|
CommandResult["PivotIdNotFound"] = "PivotIdNotFound";
|
|
3714
|
+
CommandResult["PivotInError"] = "PivotInError";
|
|
3714
3715
|
CommandResult["EmptyName"] = "EmptyName";
|
|
3715
3716
|
CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
|
|
3716
3717
|
CommandResult["InvalidDefinition"] = "InvalidDefinition";
|
|
@@ -7479,18 +7480,18 @@ function predictLinearValues(Y, X, newX, computeIntercept) {
|
|
|
7479
7480
|
});
|
|
7480
7481
|
return newY.length === newX.length ? newY : transposeMatrix(newY);
|
|
7481
7482
|
}
|
|
7482
|
-
function getMovingAverageValues(dataset, windowSize = DEFAULT_WINDOW_SIZE) {
|
|
7483
|
+
function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
|
|
7483
7484
|
const values = [];
|
|
7484
7485
|
// Fill the starting values with null until we have a full window
|
|
7485
7486
|
for (let i = 0; i < windowSize - 1; i++) {
|
|
7486
|
-
values.push(
|
|
7487
|
+
values.push({ x: labels[i], y: NaN });
|
|
7487
7488
|
}
|
|
7488
7489
|
for (let i = 0; i <= dataset.length - windowSize; i++) {
|
|
7489
7490
|
let sum = 0;
|
|
7490
7491
|
for (let j = i; j < i + windowSize; j++) {
|
|
7491
7492
|
sum += dataset[j];
|
|
7492
7493
|
}
|
|
7493
|
-
values.push(sum / windowSize);
|
|
7494
|
+
values.push({ x: labels[i + windowSize - 1], y: sum / windowSize });
|
|
7494
7495
|
}
|
|
7495
7496
|
return values;
|
|
7496
7497
|
}
|
|
@@ -19932,6 +19933,17 @@ const TEXT = {
|
|
|
19932
19933
|
},
|
|
19933
19934
|
isExported: true,
|
|
19934
19935
|
};
|
|
19936
|
+
// -----------------------------------------------------------------------------
|
|
19937
|
+
// VALUE
|
|
19938
|
+
// -----------------------------------------------------------------------------
|
|
19939
|
+
const VALUE = {
|
|
19940
|
+
description: _t("Converts a string to a numeric value."),
|
|
19941
|
+
args: [arg("value (number)", _t("the string to be converted"))],
|
|
19942
|
+
compute: function (value) {
|
|
19943
|
+
return toNumber(value, this.locale);
|
|
19944
|
+
},
|
|
19945
|
+
isExported: true,
|
|
19946
|
+
};
|
|
19935
19947
|
|
|
19936
19948
|
var text = /*#__PURE__*/Object.freeze({
|
|
19937
19949
|
__proto__: null,
|
|
@@ -19954,7 +19966,8 @@ var text = /*#__PURE__*/Object.freeze({
|
|
|
19954
19966
|
TEXT: TEXT,
|
|
19955
19967
|
TEXTJOIN: TEXTJOIN,
|
|
19956
19968
|
TRIM: TRIM,
|
|
19957
|
-
UPPER: UPPER
|
|
19969
|
+
UPPER: UPPER,
|
|
19970
|
+
VALUE: VALUE
|
|
19958
19971
|
});
|
|
19959
19972
|
|
|
19960
19973
|
// -----------------------------------------------------------------------------
|
|
@@ -24142,7 +24155,7 @@ function convertWidthFromExcel(width) {
|
|
|
24142
24155
|
return width;
|
|
24143
24156
|
return Math.round((width / WIDTH_FACTOR) * 100) / 100;
|
|
24144
24157
|
}
|
|
24145
|
-
function extractStyle(data, styleId, formatId, borderId) {
|
|
24158
|
+
function extractStyle(data, content, styleId, formatId, borderId) {
|
|
24146
24159
|
const style = styleId ? data.styles[styleId] : {};
|
|
24147
24160
|
const format = formatId ? data.formats[formatId] : undefined;
|
|
24148
24161
|
const styles = {
|
|
@@ -24164,7 +24177,7 @@ function extractStyle(data, styleId, formatId, borderId) {
|
|
|
24164
24177
|
vertical: style.verticalAlign
|
|
24165
24178
|
? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
|
|
24166
24179
|
: undefined,
|
|
24167
|
-
wrapText: style.wrapping === "wrap" || undefined,
|
|
24180
|
+
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
|
|
24168
24181
|
},
|
|
24169
24182
|
};
|
|
24170
24183
|
styles.font["strike"] = !!style?.strikethrough || undefined;
|
|
@@ -24395,7 +24408,7 @@ function convertFigure(figure, id, sheetData) {
|
|
|
24395
24408
|
return undefined;
|
|
24396
24409
|
}
|
|
24397
24410
|
function isChartData(data) {
|
|
24398
|
-
return "dataSets" in data;
|
|
24411
|
+
return "dataSets" in data && data.dataSets.length > 0;
|
|
24399
24412
|
}
|
|
24400
24413
|
function isImageData(data) {
|
|
24401
24414
|
return "imageSrc" in data;
|
|
@@ -24741,9 +24754,8 @@ function convertRows(sheet, numberOfRows, headerGroups) {
|
|
|
24741
24754
|
}
|
|
24742
24755
|
return rows;
|
|
24743
24756
|
}
|
|
24744
|
-
/** Remove newlines (\n) in shared strings, We do not support them */
|
|
24745
24757
|
function convertSharedStrings(xlsxSharedStrings) {
|
|
24746
|
-
return xlsxSharedStrings.map(
|
|
24758
|
+
return xlsxSharedStrings.map(replaceNewLines);
|
|
24747
24759
|
}
|
|
24748
24760
|
function convertCells(sheet, data, sheetDims, warningManager) {
|
|
24749
24761
|
const cells = {};
|
|
@@ -25831,15 +25843,10 @@ class XlsxMiscExtractor extends XlsxBaseExtractor {
|
|
|
25831
25843
|
getSharedStrings() {
|
|
25832
25844
|
return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
|
|
25833
25845
|
// Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
|
|
25834
|
-
if (ssElement.children[0].tagName === "t") {
|
|
25835
|
-
return this.extractTextContent(ssElement) || "";
|
|
25836
|
-
}
|
|
25837
25846
|
// We don't support rich text formatting, we'll only extract the text
|
|
25838
|
-
|
|
25839
|
-
return this.
|
|
25840
|
-
|
|
25841
|
-
}).join("");
|
|
25842
|
-
}
|
|
25847
|
+
return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
|
|
25848
|
+
return this.extractTextContent(textElement) || "";
|
|
25849
|
+
}).join("");
|
|
25843
25850
|
});
|
|
25844
25851
|
}
|
|
25845
25852
|
}
|
|
@@ -27480,6 +27487,13 @@ migrationStepRegistry
|
|
|
27480
27487
|
}
|
|
27481
27488
|
return data;
|
|
27482
27489
|
},
|
|
27490
|
+
})
|
|
27491
|
+
.add("migration_24", {
|
|
27492
|
+
// Empty migration to allow odoo migrate pivot custom sorting.
|
|
27493
|
+
versionFrom: "24",
|
|
27494
|
+
migrate(data) {
|
|
27495
|
+
return data;
|
|
27496
|
+
},
|
|
27483
27497
|
});
|
|
27484
27498
|
function fixOverlappingFilters(data) {
|
|
27485
27499
|
for (let sheet of data.sheets || []) {
|
|
@@ -27507,7 +27521,7 @@ function fixOverlappingFilters(data) {
|
|
|
27507
27521
|
* a breaking change is made in the way the state is handled, and an upgrade
|
|
27508
27522
|
* function should be defined
|
|
27509
27523
|
*/
|
|
27510
|
-
const CURRENT_VERSION =
|
|
27524
|
+
const CURRENT_VERSION = 25;
|
|
27511
27525
|
const INITIAL_SHEET_ID = "Sheet1";
|
|
27512
27526
|
/**
|
|
27513
27527
|
* This function tries to load anything that could look like a valid
|
|
@@ -28408,12 +28422,12 @@ function getTrendDatasetForLineChart(config, data, labels, axisType, locale) {
|
|
|
28408
28422
|
}
|
|
28409
28423
|
const numberOfStep = 5 * trendLabels.length;
|
|
28410
28424
|
const step = (xmax - xmin) / numberOfStep;
|
|
28411
|
-
const
|
|
28412
|
-
const
|
|
28413
|
-
if (!
|
|
28425
|
+
const trendNewLabels = range(xmin, xmax + step / 2, step);
|
|
28426
|
+
const trendValues = interpolateData(config, filteredValues, filteredLabels, trendNewLabels);
|
|
28427
|
+
if (!trendValues.length) {
|
|
28414
28428
|
return;
|
|
28415
28429
|
}
|
|
28416
|
-
return
|
|
28430
|
+
return trendValues;
|
|
28417
28431
|
}
|
|
28418
28432
|
function interpolateData(config, values, labels, newLabels) {
|
|
28419
28433
|
if (values.length < 2 || labels.length < 2 || newLabels.length === 0) {
|
|
@@ -28429,13 +28443,16 @@ function interpolateData(config, values, labels, newLabels) {
|
|
|
28429
28443
|
case "polynomial": {
|
|
28430
28444
|
const order = config.order;
|
|
28431
28445
|
if (!order) {
|
|
28432
|
-
return
|
|
28446
|
+
return newLabels.map((x) => ({ x, y: NaN }));
|
|
28433
28447
|
}
|
|
28434
28448
|
if (order === 1) {
|
|
28435
|
-
return predictLinearValues([values], [normalizedLabels], [normalizedNewLabels], true)[0];
|
|
28449
|
+
return predictLinearValues([values], [normalizedLabels], [normalizedNewLabels], true)[0].map((y, i) => ({ x: newLabels[i], y }));
|
|
28436
28450
|
}
|
|
28437
28451
|
const coeffs = polynomialRegression(values, normalizedLabels, order, true).flat();
|
|
28438
|
-
return normalizedNewLabels.map((
|
|
28452
|
+
return normalizedNewLabels.map((x, i) => ({
|
|
28453
|
+
x: newLabels[i],
|
|
28454
|
+
y: evaluatePolynomial(coeffs, x, order),
|
|
28455
|
+
}));
|
|
28439
28456
|
}
|
|
28440
28457
|
case "exponential": {
|
|
28441
28458
|
const positiveLogValues = [];
|
|
@@ -28447,22 +28464,22 @@ function interpolateData(config, values, labels, newLabels) {
|
|
|
28447
28464
|
}
|
|
28448
28465
|
}
|
|
28449
28466
|
if (!filteredLabels.length) {
|
|
28450
|
-
return
|
|
28467
|
+
return newLabels.map((x) => ({ x, y: NaN }));
|
|
28451
28468
|
}
|
|
28452
|
-
return expM(predictLinearValues([positiveLogValues], [filteredLabels], [normalizedNewLabels], true))[0];
|
|
28469
|
+
return expM(predictLinearValues([positiveLogValues], [filteredLabels], [normalizedNewLabels], true))[0].map((y, i) => ({ x: newLabels[i], y }));
|
|
28453
28470
|
}
|
|
28454
28471
|
case "logarithmic": {
|
|
28455
|
-
return predictLinearValues([values], logM([normalizedLabels]), logM([normalizedNewLabels]), true)[0];
|
|
28472
|
+
return predictLinearValues([values], logM([normalizedLabels]), logM([normalizedNewLabels]), true)[0].map((y, i) => ({ x: newLabels[i], y }));
|
|
28456
28473
|
}
|
|
28457
28474
|
case "trailingMovingAverage": {
|
|
28458
|
-
return getMovingAverageValues(values, config.window);
|
|
28475
|
+
return getMovingAverageValues(values, labels, config.window);
|
|
28459
28476
|
}
|
|
28460
28477
|
default:
|
|
28461
|
-
return
|
|
28478
|
+
return newLabels.map((x) => ({ x, y: NaN }));
|
|
28462
28479
|
}
|
|
28463
28480
|
}
|
|
28464
28481
|
catch (e) {
|
|
28465
|
-
return
|
|
28482
|
+
return newLabels.map((x) => ({ x, y: NaN }));
|
|
28466
28483
|
}
|
|
28467
28484
|
}
|
|
28468
28485
|
function getChartAxisType(chart, labelRange, getters) {
|
|
@@ -28698,7 +28715,7 @@ function getChartDatasetValues(getters, dataSets) {
|
|
|
28698
28715
|
// then using the classical aggregation method to sum the values.
|
|
28699
28716
|
data.fill(1);
|
|
28700
28717
|
}
|
|
28701
|
-
else if (data.every((cell) => cell === undefined || cell === null || !isNumber(cell.toString(),
|
|
28718
|
+
else if (data.every((cell) => cell === undefined || cell === null || !isNumber(cell.toString(), DEFAULT_LOCALE))) {
|
|
28702
28719
|
continue;
|
|
28703
28720
|
}
|
|
28704
28721
|
datasetValues.push({ data, label });
|
|
@@ -29092,6 +29109,7 @@ function getWaterfallChartLegend(definition, args) {
|
|
|
29092
29109
|
return legendValues;
|
|
29093
29110
|
},
|
|
29094
29111
|
},
|
|
29112
|
+
onClick: () => { }, // Disables click interaction with the waterfall chart legend items
|
|
29095
29113
|
};
|
|
29096
29114
|
}
|
|
29097
29115
|
function getRadarChartLegend(definition, args) {
|
|
@@ -29233,14 +29251,19 @@ function getLineChartScales(definition, args) {
|
|
|
29233
29251
|
/* We add a second x axis here to draw the trend lines, with the labels length being
|
|
29234
29252
|
* set so that the second axis points match the classical x axis
|
|
29235
29253
|
*/
|
|
29236
|
-
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
29237
29254
|
scales[TREND_LINE_XAXIS_ID] = {
|
|
29238
29255
|
...scales.x,
|
|
29239
|
-
type: "category",
|
|
29240
|
-
labels: range(0, maxLength).map((x) => x.toString()),
|
|
29241
|
-
offset: false,
|
|
29242
29256
|
display: false,
|
|
29243
29257
|
};
|
|
29258
|
+
if (axisType === "category" || axisType === "time") {
|
|
29259
|
+
/* We add a second x axis here to draw the trend lines, with the labels length being
|
|
29260
|
+
* set so that the second axis points match the classical x axis
|
|
29261
|
+
*/
|
|
29262
|
+
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
29263
|
+
scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
29264
|
+
scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
29265
|
+
scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
29266
|
+
}
|
|
29244
29267
|
}
|
|
29245
29268
|
return scales;
|
|
29246
29269
|
}
|
|
@@ -29510,7 +29533,9 @@ function getLineChartTooltip(definition, args) {
|
|
|
29510
29533
|
if (axisType === "linear") {
|
|
29511
29534
|
tooltip.callbacks.label = (tooltipItem) => {
|
|
29512
29535
|
const dataSetPoint = tooltipItem.parsed.y;
|
|
29513
|
-
let label = tooltipItem.
|
|
29536
|
+
let label = tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID
|
|
29537
|
+
? ""
|
|
29538
|
+
: tooltipItem.parsed.x;
|
|
29514
29539
|
if (typeof label === "string" && isNumber(label, locale)) {
|
|
29515
29540
|
label = toNumber(label, locale);
|
|
29516
29541
|
}
|
|
@@ -30203,7 +30228,11 @@ function createGaugeChartRuntime(chart, getters) {
|
|
|
30203
30228
|
colors.push(chartColors.upperColor);
|
|
30204
30229
|
return {
|
|
30205
30230
|
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
30206
|
-
title:
|
|
30231
|
+
title: {
|
|
30232
|
+
...chart.title,
|
|
30233
|
+
// chart titles are extracted from .json files and they are translated at runtime here
|
|
30234
|
+
text: _t(chart.title.text ?? ""),
|
|
30235
|
+
},
|
|
30207
30236
|
minValue: {
|
|
30208
30237
|
value: minValue,
|
|
30209
30238
|
label: formatValue(minValue, { locale, format }),
|
|
@@ -35334,12 +35363,20 @@ function fontSizeMenuBuilder() {
|
|
|
35334
35363
|
});
|
|
35335
35364
|
}
|
|
35336
35365
|
function isAutomaticFormatSelected(env) {
|
|
35337
|
-
const
|
|
35338
|
-
|
|
35366
|
+
const activePosition = env.model.getters.getActivePosition();
|
|
35367
|
+
const pivotCell = env.model.getters.getPivotCellFromPosition(activePosition);
|
|
35368
|
+
if (pivotCell.type === "VALUE") {
|
|
35369
|
+
return !env.model.getters.getEvaluatedCell(activePosition).format;
|
|
35370
|
+
}
|
|
35371
|
+
return !env.model.getters.getCell(activePosition)?.format;
|
|
35339
35372
|
}
|
|
35340
35373
|
function isFormatSelected(env, format) {
|
|
35341
|
-
const
|
|
35342
|
-
|
|
35374
|
+
const activePosition = env.model.getters.getActivePosition();
|
|
35375
|
+
const pivotCell = env.model.getters.getPivotCellFromPosition(activePosition);
|
|
35376
|
+
if (pivotCell.type === "VALUE") {
|
|
35377
|
+
return env.model.getters.getEvaluatedCell(activePosition).format === format;
|
|
35378
|
+
}
|
|
35379
|
+
return env.model.getters.getCell(activePosition)?.format === format;
|
|
35343
35380
|
}
|
|
35344
35381
|
function isFontSizeSelected(env, fontSize) {
|
|
35345
35382
|
const currentFontSize = env.model.getters.getCurrentStyle().fontSize || DEFAULT_FONT_SIZE;
|
|
@@ -39678,14 +39715,11 @@ class ChartPanel extends owl.Component {
|
|
|
39678
39715
|
}
|
|
39679
39716
|
|
|
39680
39717
|
class DOMFocusableElementStore {
|
|
39681
|
-
mutators = ["setFocusableElement"
|
|
39718
|
+
mutators = ["setFocusableElement"];
|
|
39682
39719
|
focusableElement = undefined;
|
|
39683
39720
|
setFocusableElement(element) {
|
|
39684
39721
|
this.focusableElement = element;
|
|
39685
39722
|
}
|
|
39686
|
-
focus() {
|
|
39687
|
-
this.focusableElement?.focus();
|
|
39688
|
-
}
|
|
39689
39723
|
}
|
|
39690
39724
|
|
|
39691
39725
|
css /* scss */ `
|
|
@@ -40333,7 +40367,7 @@ class Composer extends owl.Component {
|
|
|
40333
40367
|
if (document.activeElement === this.contentHelper.el &&
|
|
40334
40368
|
this.props.composerStore.editionMode === "inactive" &&
|
|
40335
40369
|
!this.props.isDefaultFocus) {
|
|
40336
|
-
this.DOMFocusableElementStore.focus();
|
|
40370
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
40337
40371
|
}
|
|
40338
40372
|
});
|
|
40339
40373
|
owl.useEffect(() => {
|
|
@@ -42046,6 +42080,10 @@ css /* scss */ `
|
|
|
42046
42080
|
border: 1px solid #d8dadd;
|
|
42047
42081
|
color: #374151;
|
|
42048
42082
|
}
|
|
42083
|
+
|
|
42084
|
+
table {
|
|
42085
|
+
table-layout: fixed;
|
|
42086
|
+
}
|
|
42049
42087
|
}
|
|
42050
42088
|
`;
|
|
42051
42089
|
class CustomCurrencyPanel extends owl.Component {
|
|
@@ -44310,16 +44348,21 @@ class TextInput extends owl.Component {
|
|
|
44310
44348
|
}
|
|
44311
44349
|
this.inputRef.el?.blur();
|
|
44312
44350
|
}
|
|
44313
|
-
|
|
44314
|
-
|
|
44315
|
-
if (
|
|
44316
|
-
|
|
44317
|
-
|
|
44318
|
-
|
|
44319
|
-
|
|
44320
|
-
|
|
44321
|
-
|
|
44322
|
-
|
|
44351
|
+
onMouseDown(ev) {
|
|
44352
|
+
// Stop the event if the input is not focused, we handle everything in onMouseUp
|
|
44353
|
+
if (ev.target !== document.activeElement) {
|
|
44354
|
+
ev.preventDefault();
|
|
44355
|
+
ev.stopPropagation();
|
|
44356
|
+
}
|
|
44357
|
+
}
|
|
44358
|
+
onMouseUp(ev) {
|
|
44359
|
+
const target = ev.target;
|
|
44360
|
+
if (target !== document.activeElement) {
|
|
44361
|
+
target.focus();
|
|
44362
|
+
target.select();
|
|
44363
|
+
ev.preventDefault();
|
|
44364
|
+
ev.stopPropagation();
|
|
44365
|
+
}
|
|
44323
44366
|
}
|
|
44324
44367
|
}
|
|
44325
44368
|
|
|
@@ -44872,7 +44915,16 @@ class PivotTitleSection extends owl.Component {
|
|
|
44872
44915
|
newPivotId,
|
|
44873
44916
|
newSheetId,
|
|
44874
44917
|
});
|
|
44875
|
-
|
|
44918
|
+
let text;
|
|
44919
|
+
if (result.isSuccessful) {
|
|
44920
|
+
text = _t("Pivot duplicated.");
|
|
44921
|
+
}
|
|
44922
|
+
else if (result.isCancelledBecause("PivotInError" /* CommandResult.PivotInError */)) {
|
|
44923
|
+
text = _t("Cannot duplicate a pivot in error.");
|
|
44924
|
+
}
|
|
44925
|
+
else {
|
|
44926
|
+
text = _t("Pivot duplication failed.");
|
|
44927
|
+
}
|
|
44876
44928
|
const type = result.isSuccessful ? "success" : "danger";
|
|
44877
44929
|
this.env.notifyUser({
|
|
44878
44930
|
text,
|
|
@@ -46211,7 +46263,9 @@ class PivotSidePanelStore extends SpreadsheetStore {
|
|
|
46211
46263
|
pivot: this.draft,
|
|
46212
46264
|
});
|
|
46213
46265
|
this.draft = null;
|
|
46214
|
-
if (!this.alreadyNotified &&
|
|
46266
|
+
if (!this.alreadyNotified &&
|
|
46267
|
+
!this.isDynamicPivotInViewport() &&
|
|
46268
|
+
this.isStaticPivotInViewport()) {
|
|
46215
46269
|
const formulaId = this.getters.getPivotFormulaId(this.pivotId);
|
|
46216
46270
|
const pivotExample = `=PIVOT(${formulaId})`;
|
|
46217
46271
|
this.alreadyNotified = true;
|
|
@@ -46279,6 +46333,18 @@ class PivotSidePanelStore extends SpreadsheetStore {
|
|
|
46279
46333
|
}
|
|
46280
46334
|
return false;
|
|
46281
46335
|
}
|
|
46336
|
+
isStaticPivotInViewport() {
|
|
46337
|
+
for (const position of this.getters.getVisibleCellPositions()) {
|
|
46338
|
+
const cell = this.getters.getCell(position);
|
|
46339
|
+
if (cell?.isFormula) {
|
|
46340
|
+
const pivotFunction = getFirstPivotFunction(cell.compiledFormula.tokens);
|
|
46341
|
+
if (pivotFunction && pivotFunction.functionName !== "PIVOT") {
|
|
46342
|
+
return true;
|
|
46343
|
+
}
|
|
46344
|
+
}
|
|
46345
|
+
}
|
|
46346
|
+
return false;
|
|
46347
|
+
}
|
|
46282
46348
|
addDefaultDateTimeGranularity(fields, definition) {
|
|
46283
46349
|
const { columns, rows } = definition;
|
|
46284
46350
|
const columnsWithGranularity = deepCopy(columns);
|
|
@@ -51691,7 +51757,7 @@ class Grid extends owl.Component {
|
|
|
51691
51757
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
51692
51758
|
owl.useEffect(() => {
|
|
51693
51759
|
if (!this.sidePanel.isOpen) {
|
|
51694
|
-
this.DOMFocusableElementStore.focus();
|
|
51760
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
51695
51761
|
}
|
|
51696
51762
|
}, () => [this.sidePanel.isOpen]);
|
|
51697
51763
|
}
|
|
@@ -51897,7 +51963,7 @@ class Grid extends owl.Component {
|
|
|
51897
51963
|
focusDefaultElement() {
|
|
51898
51964
|
if (!this.env.model.getters.getSelectedFigureId() &&
|
|
51899
51965
|
this.composerFocusStore.activeComposer.editionMode === "inactive") {
|
|
51900
|
-
this.DOMFocusableElementStore.focus();
|
|
51966
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
51901
51967
|
}
|
|
51902
51968
|
}
|
|
51903
51969
|
get gridEl() {
|
|
@@ -52434,10 +52500,34 @@ class BordersPlugin extends CorePlugin {
|
|
|
52434
52500
|
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
52435
52501
|
for (const group of groupConsecutive(elements)) {
|
|
52436
52502
|
if (cmd.dimension === "COL") {
|
|
52437
|
-
|
|
52503
|
+
if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
|
|
52504
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
52505
|
+
this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
|
|
52506
|
+
}
|
|
52507
|
+
}
|
|
52508
|
+
if (group[group.length - 1] === 0) {
|
|
52509
|
+
for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
|
|
52510
|
+
this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
|
|
52511
|
+
}
|
|
52512
|
+
}
|
|
52513
|
+
const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
52514
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
52515
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
|
|
52438
52516
|
}
|
|
52439
52517
|
else {
|
|
52440
|
-
|
|
52518
|
+
if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
|
|
52519
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
52520
|
+
this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
|
|
52521
|
+
}
|
|
52522
|
+
}
|
|
52523
|
+
if (group[group.length - 1] === 0) {
|
|
52524
|
+
for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
|
|
52525
|
+
this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
|
|
52526
|
+
}
|
|
52527
|
+
}
|
|
52528
|
+
const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
|
|
52529
|
+
this.clearInsideBorders(cmd.sheetId, [zone]);
|
|
52530
|
+
this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
|
|
52441
52531
|
}
|
|
52442
52532
|
}
|
|
52443
52533
|
break;
|
|
@@ -52744,6 +52834,18 @@ class BordersPlugin extends CorePlugin {
|
|
|
52744
52834
|
}
|
|
52745
52835
|
}
|
|
52746
52836
|
}
|
|
52837
|
+
/**
|
|
52838
|
+
* Remove the borders inside of a zone
|
|
52839
|
+
*/
|
|
52840
|
+
clearInsideBorders(sheetId, zones) {
|
|
52841
|
+
for (let zone of zones) {
|
|
52842
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
52843
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
52844
|
+
this.history.update("borders", sheetId, col, row, undefined);
|
|
52845
|
+
}
|
|
52846
|
+
}
|
|
52847
|
+
}
|
|
52848
|
+
}
|
|
52747
52849
|
/**
|
|
52748
52850
|
* Add a border to the existing one to a cell
|
|
52749
52851
|
*/
|
|
@@ -63290,6 +63392,9 @@ class Session extends EventBus {
|
|
|
63290
63392
|
}
|
|
63291
63393
|
}
|
|
63292
63394
|
this.acknowledge(message);
|
|
63395
|
+
if (message.type === "REMOTE_REVISION" && message.clientId === this.clientId) {
|
|
63396
|
+
return;
|
|
63397
|
+
}
|
|
63293
63398
|
this.trigger("collaborative-event-received");
|
|
63294
63399
|
}
|
|
63295
63400
|
onClientMoved(message) {
|
|
@@ -63940,6 +64045,19 @@ class HeaderVisibilityUIPlugin extends UIPlugin {
|
|
|
63940
64045
|
|
|
63941
64046
|
class InsertPivotPlugin extends UIPlugin {
|
|
63942
64047
|
static getters = [];
|
|
64048
|
+
allowDispatch(cmd) {
|
|
64049
|
+
switch (cmd.type) {
|
|
64050
|
+
case "DUPLICATE_PIVOT_IN_NEW_SHEET":
|
|
64051
|
+
if (!this.getters.isExistingPivot(cmd.pivotId)) {
|
|
64052
|
+
return "PivotIdNotFound" /* CommandResult.PivotIdNotFound */;
|
|
64053
|
+
}
|
|
64054
|
+
if (!this.getters.getPivot(cmd.pivotId).isValid()) {
|
|
64055
|
+
return "PivotInError" /* CommandResult.PivotInError */;
|
|
64056
|
+
}
|
|
64057
|
+
break;
|
|
64058
|
+
}
|
|
64059
|
+
return "Success" /* CommandResult.Success */;
|
|
64060
|
+
}
|
|
63943
64061
|
handle(cmd) {
|
|
63944
64062
|
switch (cmd.type) {
|
|
63945
64063
|
case "INSERT_NEW_PIVOT":
|
|
@@ -68176,11 +68294,6 @@ class BottomBarSheet extends owl.Component {
|
|
|
68176
68294
|
editionState = "initializing";
|
|
68177
68295
|
DOMFocusableElementStore;
|
|
68178
68296
|
setup() {
|
|
68179
|
-
owl.onMounted(() => {
|
|
68180
|
-
if (this.isSheetActive) {
|
|
68181
|
-
this.scrollToSheet();
|
|
68182
|
-
}
|
|
68183
|
-
});
|
|
68184
68297
|
owl.onPatched(() => {
|
|
68185
68298
|
if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
|
|
68186
68299
|
this.editionState = "editing";
|
|
@@ -68189,6 +68302,11 @@ class BottomBarSheet extends owl.Component {
|
|
|
68189
68302
|
});
|
|
68190
68303
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
68191
68304
|
owl.useExternalListener(window, "click", () => (this.state.pickerOpened = false));
|
|
68305
|
+
owl.useEffect((sheetId) => {
|
|
68306
|
+
if (this.props.sheetId === sheetId) {
|
|
68307
|
+
this.scrollToSheet();
|
|
68308
|
+
}
|
|
68309
|
+
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
68192
68310
|
}
|
|
68193
68311
|
focusInputAndSelectContent() {
|
|
68194
68312
|
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
@@ -68200,7 +68318,10 @@ class BottomBarSheet extends owl.Component {
|
|
|
68200
68318
|
}
|
|
68201
68319
|
}
|
|
68202
68320
|
scrollToSheet() {
|
|
68203
|
-
this.sheetDivRef.el?.scrollIntoView?.(
|
|
68321
|
+
this.sheetDivRef.el?.scrollIntoView?.({
|
|
68322
|
+
behavior: "smooth",
|
|
68323
|
+
inline: "nearest",
|
|
68324
|
+
});
|
|
68204
68325
|
}
|
|
68205
68326
|
onFocusOut() {
|
|
68206
68327
|
if (this.state.isEditing && this.editionState !== "initializing") {
|
|
@@ -68230,11 +68351,11 @@ class BottomBarSheet extends owl.Component {
|
|
|
68230
68351
|
if (ev.key === "Enter") {
|
|
68231
68352
|
ev.preventDefault();
|
|
68232
68353
|
this.stopEdition();
|
|
68233
|
-
this.DOMFocusableElementStore.focus();
|
|
68354
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
68234
68355
|
}
|
|
68235
68356
|
if (ev.key === "Escape") {
|
|
68236
68357
|
this.cancelEdition();
|
|
68237
|
-
this.DOMFocusableElementStore.focus();
|
|
68358
|
+
this.DOMFocusableElementStore.focusableElement?.focus();
|
|
68238
68359
|
}
|
|
68239
68360
|
}
|
|
68240
68361
|
onMouseEventSheetName(ev) {
|
|
@@ -73610,7 +73731,7 @@ function addRows(construct, data, sheet) {
|
|
|
73610
73731
|
if (content || styleId || formatId || borderId || value !== undefined) {
|
|
73611
73732
|
const attributes = [["r", xc]];
|
|
73612
73733
|
// style
|
|
73613
|
-
const id = normalizeStyle(construct, extractStyle(data, styleId, formatId, borderId));
|
|
73734
|
+
const id = normalizeStyle(construct, extractStyle(data, content, styleId, formatId, borderId));
|
|
73614
73735
|
// don't add style if default
|
|
73615
73736
|
if (id) {
|
|
73616
73737
|
attributes.push(["s", id]);
|
|
@@ -73964,7 +74085,12 @@ function createSharedStrings(strings) {
|
|
|
73964
74085
|
["count", strings.length],
|
|
73965
74086
|
["uniqueCount", strings.length],
|
|
73966
74087
|
];
|
|
73967
|
-
const stringNodes = strings.map((string) =>
|
|
74088
|
+
const stringNodes = strings.map((string) => {
|
|
74089
|
+
if (string.trim() !== string) {
|
|
74090
|
+
return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
|
|
74091
|
+
}
|
|
74092
|
+
return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
|
|
74093
|
+
});
|
|
73968
74094
|
const xml = escapeXml /*xml*/ `
|
|
73969
74095
|
<sst ${formatAttributes(namespaces)}>
|
|
73970
74096
|
${joinXmlNodes(stringNodes)}
|
|
@@ -74204,7 +74330,7 @@ class Model extends EventBus {
|
|
|
74204
74330
|
// events
|
|
74205
74331
|
this.setupSessionEvents();
|
|
74206
74332
|
this.joinSession();
|
|
74207
|
-
if (config.snapshotRequested) {
|
|
74333
|
+
if (config.snapshotRequested || (data["[Content_Types].xml"] && !this.getters.isReadonly())) {
|
|
74208
74334
|
const startSnapshot = performance.now();
|
|
74209
74335
|
console.debug("Snapshot requested");
|
|
74210
74336
|
this.session.snapshot(this.exportData());
|
|
@@ -74691,6 +74817,8 @@ const helpers = {
|
|
|
74691
74817
|
areDomainArgsFieldsValid,
|
|
74692
74818
|
splitReference,
|
|
74693
74819
|
sanitizeSheetName,
|
|
74820
|
+
isNumber,
|
|
74821
|
+
isDateTime,
|
|
74694
74822
|
};
|
|
74695
74823
|
const links = {
|
|
74696
74824
|
isMarkdownLink,
|
|
@@ -74829,6 +74957,6 @@ exports.tokenColors = tokenColors;
|
|
|
74829
74957
|
exports.tokenize = tokenize;
|
|
74830
74958
|
|
|
74831
74959
|
|
|
74832
|
-
__info__.version = "18.1.
|
|
74833
|
-
__info__.date = "
|
|
74834
|
-
__info__.hash = "
|
|
74960
|
+
__info__.version = "18.1.1";
|
|
74961
|
+
__info__.date = "2025-01-14T11:43:19.116Z";
|
|
74962
|
+
__info__.hash = "d0fa5de";
|