@odoo/o-spreadsheet 19.3.14 → 19.3.15
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 +118 -30
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.esm.js +118 -30
- package/dist/o_spreadsheet.iife.js +118 -30
- package/dist/o_spreadsheet.min.iife.js +30 -30
- package/dist/o_spreadsheet.xml +3 -3
- package/dist/types/components/figures/chart/chartJs/chartjs_geo_projection_plugin.d.ts +12 -0
- package/package.json +1 -1
|
@@ -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 19.3.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.3.15
|
|
6
|
+
* @date 2026-08-10T12:32:40.247Z
|
|
7
|
+
* @hash 25f760e
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -4260,19 +4260,58 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
4260
4260
|
}
|
|
4261
4261
|
}
|
|
4262
4262
|
if (countVectorizedCol === 1 && countVectorizedRow === 1) return formula(...args);
|
|
4263
|
-
const
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4263
|
+
const argsBuffer = new Array(args.length);
|
|
4264
|
+
const argGetters = [];
|
|
4265
|
+
const vectorizedIndices = [];
|
|
4266
|
+
for (let k = 0; k < args.length; k++) {
|
|
4267
|
+
const arg = args[k];
|
|
4268
|
+
switch (vectorArgsType?.[k]) {
|
|
4269
|
+
case "matrix":
|
|
4270
|
+
argGetters.push((i, j) => arg[i][j]);
|
|
4271
|
+
vectorizedIndices.push(k);
|
|
4272
|
+
break;
|
|
4273
|
+
case "horizontal":
|
|
4274
|
+
argGetters.push((i) => arg[i][0]);
|
|
4275
|
+
vectorizedIndices.push(k);
|
|
4276
|
+
break;
|
|
4277
|
+
case "vertical":
|
|
4278
|
+
argGetters.push((_i, j) => arg[0][j]);
|
|
4279
|
+
vectorizedIndices.push(k);
|
|
4280
|
+
break;
|
|
4281
|
+
case void 0:
|
|
4282
|
+
argsBuffer[k] = arg;
|
|
4283
|
+
break;
|
|
4269
4284
|
}
|
|
4270
|
-
}
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4285
|
+
}
|
|
4286
|
+
const nbVectorized = vectorizedIndices.length;
|
|
4287
|
+
let callFormula;
|
|
4288
|
+
switch (argsBuffer.length) {
|
|
4289
|
+
case 1:
|
|
4290
|
+
callFormula = () => formula(argsBuffer[0]);
|
|
4291
|
+
break;
|
|
4292
|
+
case 2:
|
|
4293
|
+
callFormula = () => formula(argsBuffer[0], argsBuffer[1]);
|
|
4294
|
+
break;
|
|
4295
|
+
case 3:
|
|
4296
|
+
callFormula = () => formula(argsBuffer[0], argsBuffer[1], argsBuffer[2]);
|
|
4297
|
+
break;
|
|
4298
|
+
default: callFormula = () => formula(...argsBuffer);
|
|
4299
|
+
}
|
|
4300
|
+
const result = new Array(countVectorizedCol);
|
|
4301
|
+
for (let col = 0; col < countVectorizedCol; col++) {
|
|
4302
|
+
const column = new Array(countVectorizedRow);
|
|
4303
|
+
result[col] = column;
|
|
4304
|
+
for (let row = 0; row < countVectorizedRow; row++) {
|
|
4305
|
+
if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) {
|
|
4306
|
+
column[row] = new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
|
|
4307
|
+
continue;
|
|
4308
|
+
}
|
|
4309
|
+
for (let k = 0; k < nbVectorized; k++) argsBuffer[vectorizedIndices[k]] = argGetters[k](col, row);
|
|
4310
|
+
const singleCellComputeResult = callFormula();
|
|
4311
|
+
column[row] = isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
return result;
|
|
4276
4315
|
}
|
|
4277
4316
|
/**
|
|
4278
4317
|
* This function allows to visit arguments and stop the visit if necessary.
|
|
@@ -4619,12 +4658,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
4619
4658
|
//#endregion
|
|
4620
4659
|
//#region src/functions/create_compute_function.ts
|
|
4621
4660
|
function createComputeFunction(descr) {
|
|
4661
|
+
let currentArgDefinitions = [];
|
|
4622
4662
|
function vectorizedCompute(...args) {
|
|
4623
4663
|
const acceptToVectorize = [];
|
|
4664
|
+
currentArgDefinitions = new Array(args.length);
|
|
4624
4665
|
const argsToFocus = argTargeting(descr, args.length);
|
|
4625
4666
|
for (let i = 0; i < args.length; i++) {
|
|
4626
4667
|
const argIndex = argsToFocus[i].index;
|
|
4627
4668
|
const argDefinition = descr.args[argIndex];
|
|
4669
|
+
currentArgDefinitions[i] = argDefinition;
|
|
4628
4670
|
const arg = args[i];
|
|
4629
4671
|
if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) throw new BadExpressionError(_t("Function %s expects the parameter '%s' to be reference to a cell or range.", descr.name, (i + 1).toString()));
|
|
4630
4672
|
acceptToVectorize.push(!argDefinition.acceptMatrix);
|
|
@@ -4637,10 +4679,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
4637
4679
|
return result;
|
|
4638
4680
|
}
|
|
4639
4681
|
function errorHandlingCompute(...args) {
|
|
4640
|
-
const argsToFocus = argTargeting(descr, args.length);
|
|
4641
4682
|
for (let i = 0; i < args.length; i++) {
|
|
4642
4683
|
const arg = args[i];
|
|
4643
|
-
if (!
|
|
4684
|
+
if (!currentArgDefinitions[i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
|
|
4644
4685
|
}
|
|
4645
4686
|
try {
|
|
4646
4687
|
return computeFunctionToObject.apply(this, args);
|
|
@@ -8969,6 +9010,25 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8969
9010
|
};
|
|
8970
9011
|
};
|
|
8971
9012
|
|
|
9013
|
+
//#endregion
|
|
9014
|
+
//#region src/components/figures/chart/chartJs/chartjs_geo_projection_plugin.ts
|
|
9015
|
+
/**
|
|
9016
|
+
* ChartJS plugin to apply custom changes to a d3 projection.
|
|
9017
|
+
*
|
|
9018
|
+
* We pass the projection as a string instead of a customized d3 object so
|
|
9019
|
+
* Chart.js creates a fresh projection instance. Custom changes (e.g. rotation)
|
|
9020
|
+
* are then applied in `beforeUpdate`.
|
|
9021
|
+
*
|
|
9022
|
+
* This is important because Chart.js mutates the projection instance at runtime,
|
|
9023
|
+
* and a customize d3 projection object would not be copied during deepCopy.
|
|
9024
|
+
*/
|
|
9025
|
+
const geoProjectionPlugin = {
|
|
9026
|
+
id: "geoProjection",
|
|
9027
|
+
beforeUpdate(chart) {
|
|
9028
|
+
if (chart.options?.scales?.projection?.projection === "conicConformal") chart.scales?.projection?.projection?.rotate([100, 0]);
|
|
9029
|
+
}
|
|
9030
|
+
};
|
|
9031
|
+
|
|
8972
9032
|
//#endregion
|
|
8973
9033
|
//#region src/components/figures/chart/chartJs/chartjs_minor_grid_plugin.ts
|
|
8974
9034
|
const chartMinorGridPlugin = {
|
|
@@ -10026,7 +10086,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10026
10086
|
const format = axisFormats?.y || axisFormats?.y1;
|
|
10027
10087
|
return {
|
|
10028
10088
|
projection: {
|
|
10029
|
-
projection:
|
|
10089
|
+
projection: region?.defaultProjection || "mercator",
|
|
10030
10090
|
axis: "x"
|
|
10031
10091
|
},
|
|
10032
10092
|
color: {
|
|
@@ -10078,10 +10138,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10078
10138
|
}
|
|
10079
10139
|
};
|
|
10080
10140
|
}
|
|
10081
|
-
function getGeoChartProjection(projection) {
|
|
10082
|
-
if (projection === "conicConformal") return globalThis.ChartGeo.geoConicConformal().rotate([100, 0]);
|
|
10083
|
-
return projection;
|
|
10084
|
-
}
|
|
10085
10141
|
function getChartAxisTitleRuntime(design) {
|
|
10086
10142
|
if (design?.title?.text) {
|
|
10087
10143
|
const { text, color, align, italic, bold } = design.title;
|
|
@@ -10966,6 +11022,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10966
11022
|
register: (Chart) => Chart.register(chartBackgroundPlugin),
|
|
10967
11023
|
unregister: (Chart) => Chart.unregister(chartBackgroundPlugin)
|
|
10968
11024
|
});
|
|
11025
|
+
chartJsExtensionRegistry.add("geoProjectionPlugin", {
|
|
11026
|
+
register: (Chart) => Chart.register(geoProjectionPlugin),
|
|
11027
|
+
unregister: (Chart) => Chart.unregister(geoProjectionPlugin)
|
|
11028
|
+
});
|
|
10969
11029
|
var ChartJsComponent = class extends _odoo_owl.Component {
|
|
10970
11030
|
static template = "o-spreadsheet-ChartJsComponent";
|
|
10971
11031
|
static props = {
|
|
@@ -18293,7 +18353,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18293
18353
|
case "ArrowLeft":
|
|
18294
18354
|
case "ArrowRight":
|
|
18295
18355
|
case "ArrowUp":
|
|
18296
|
-
const { col, row, offset } = this.postionInBoundary(this.props.figureUI, ev.key);
|
|
18356
|
+
const { col, row, offset } = this.postionInBoundary(this.env.model.getters.getActiveSheetId(), this.props.figureUI, ev.key);
|
|
18297
18357
|
this.env.model.dispatch("UPDATE_FIGURE", {
|
|
18298
18358
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
18299
18359
|
figureId: this.props.figureUI.id,
|
|
@@ -18317,34 +18377,52 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18317
18377
|
break;
|
|
18318
18378
|
}
|
|
18319
18379
|
}
|
|
18320
|
-
postionInBoundary(
|
|
18321
|
-
|
|
18322
|
-
let { col, row, offset } = position;
|
|
18380
|
+
postionInBoundary(sheetId, figure, key) {
|
|
18381
|
+
let { col, row, offset } = figure;
|
|
18323
18382
|
offset = { ...offset };
|
|
18383
|
+
const maxAnchor = this.env.model.getters.getMaxAnchorOffset(sheetId, figure.height, figure.width);
|
|
18324
18384
|
switch (key) {
|
|
18325
18385
|
case "ArrowUp":
|
|
18326
18386
|
if (offset.y === 0) {
|
|
18327
18387
|
row--;
|
|
18388
|
+
while (row > 0 && this.env.model.getters.isRowHiddenByUser(sheetId, row)) row--;
|
|
18328
18389
|
offset.y = this.env.model.getters.getRowSize(sheetId, row) - 1;
|
|
18329
18390
|
} else offset.y--;
|
|
18330
18391
|
break;
|
|
18331
18392
|
case "ArrowLeft":
|
|
18332
18393
|
if (offset.x === 0) {
|
|
18333
18394
|
col--;
|
|
18395
|
+
while (col > 0 && this.env.model.getters.isColHiddenByUser(sheetId, col)) col--;
|
|
18334
18396
|
offset.x = this.env.model.getters.getColSize(sheetId, col) - 1;
|
|
18335
18397
|
} else offset.x--;
|
|
18336
18398
|
break;
|
|
18337
18399
|
case "ArrowDown":
|
|
18338
18400
|
if (offset.y === this.env.model.getters.getRowSize(sheetId, row)) {
|
|
18339
18401
|
row++;
|
|
18402
|
+
while (row <= maxAnchor.row && this.env.model.getters.isRowHiddenByUser(sheetId, row)) row++;
|
|
18340
18403
|
offset.y = 0;
|
|
18341
18404
|
} else offset.y++;
|
|
18342
18405
|
break;
|
|
18343
18406
|
case "ArrowRight": if (offset.x === this.env.model.getters.getColSize(sheetId, row)) {
|
|
18344
18407
|
col++;
|
|
18408
|
+
while (col <= maxAnchor.col && this.env.model.getters.isColHiddenByUser(sheetId, col)) col++;
|
|
18345
18409
|
offset.x = 0;
|
|
18346
18410
|
} else offset.x++;
|
|
18347
18411
|
}
|
|
18412
|
+
if (col < 0) {
|
|
18413
|
+
col = 0;
|
|
18414
|
+
offset.x = 0;
|
|
18415
|
+
} else if (col > maxAnchor.col || col === maxAnchor.col && offset.x > maxAnchor.offset.x) {
|
|
18416
|
+
col = maxAnchor.col;
|
|
18417
|
+
offset.x = maxAnchor.offset.x;
|
|
18418
|
+
}
|
|
18419
|
+
if (row < 0) {
|
|
18420
|
+
row = 0;
|
|
18421
|
+
offset.y = 0;
|
|
18422
|
+
} else if (row > maxAnchor.row || row === maxAnchor.row && offset.y > maxAnchor.offset.y) {
|
|
18423
|
+
row = maxAnchor.row;
|
|
18424
|
+
offset.y = maxAnchor.offset.y;
|
|
18425
|
+
}
|
|
18348
18426
|
return {
|
|
18349
18427
|
col,
|
|
18350
18428
|
row,
|
|
@@ -44684,7 +44762,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44684
44762
|
const cell = this.getters.getEvaluatedCell(position);
|
|
44685
44763
|
if (cell.link && !isFormula(content)) content = markdownLink(content, cell.link.url);
|
|
44686
44764
|
const currentFormat = this.getters.getCell(position)?.format;
|
|
44687
|
-
const
|
|
44765
|
+
const isCurrentFormatDate = currentFormat && isDateTimeFormat(currentFormat);
|
|
44766
|
+
const contentDateFormat = detectDateFormat(content, this.getters.getLocale());
|
|
44767
|
+
let afterFormat;
|
|
44768
|
+
if (currentFormat !== "@") {
|
|
44769
|
+
if (contentDateFormat && !isCurrentFormatDate) afterFormat = contentDateFormat;
|
|
44770
|
+
else if (isCurrentFormatDate && isNumber(content, this.getters.getLocale())) afterFormat = "";
|
|
44771
|
+
}
|
|
44688
44772
|
this.addHeadersForSpreadingFormula(content);
|
|
44689
44773
|
result = this.model.dispatch("UPDATE_CELL", {
|
|
44690
44774
|
...this.currentEditedCell,
|
|
@@ -66214,6 +66298,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66214
66298
|
}
|
|
66215
66299
|
function inverseCreateChart(cmd) {
|
|
66216
66300
|
return [{
|
|
66301
|
+
type: "DELETE_CHART",
|
|
66302
|
+
chartId: cmd.chartId,
|
|
66303
|
+
sheetId: cmd.sheetId
|
|
66304
|
+
}, {
|
|
66217
66305
|
type: "DELETE_FIGURE",
|
|
66218
66306
|
figureId: cmd.figureId,
|
|
66219
66307
|
sheetId: cmd.sheetId
|
|
@@ -84678,8 +84766,8 @@ exports.stores = stores;
|
|
|
84678
84766
|
exports.tokenColors = tokenColors;
|
|
84679
84767
|
exports.tokenize = tokenize;
|
|
84680
84768
|
|
|
84681
|
-
__info__.version = "19.3.
|
|
84682
|
-
__info__.date = "2026-
|
|
84683
|
-
__info__.hash = "
|
|
84769
|
+
__info__.version = "19.3.15";
|
|
84770
|
+
__info__.date = "2026-08-10T12:32:40.247Z";
|
|
84771
|
+
__info__.hash = "25f760e";
|
|
84684
84772
|
|
|
84685
84773
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|