@odoo/o-spreadsheet 16.3.15 → 16.3.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 +50 -40
- package/dist/o-spreadsheet.d.ts +7 -9
- package/dist/o-spreadsheet.esm.js +50 -40
- package/dist/o-spreadsheet.iife.js +50 -40
- package/dist/o-spreadsheet.iife.min.js +76 -75
- package/dist/o_spreadsheet.xml +3882 -0
- package/package.json +3 -2
|
@@ -7345,7 +7345,7 @@
|
|
|
7345
7345
|
});
|
|
7346
7346
|
return {
|
|
7347
7347
|
chartJsConfig: config,
|
|
7348
|
-
background: getters.
|
|
7348
|
+
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
7349
7349
|
};
|
|
7350
7350
|
}
|
|
7351
7351
|
|
|
@@ -8066,7 +8066,7 @@
|
|
|
8066
8066
|
};
|
|
8067
8067
|
baselineCell = getters.getEvaluatedCell(baselinePosition);
|
|
8068
8068
|
}
|
|
8069
|
-
const background = getters.
|
|
8069
|
+
const { background, fontColor } = getters.getStyleOfSingleCellChart(chart.background, chart.keyValue);
|
|
8070
8070
|
return {
|
|
8071
8071
|
title: _t(chart.title),
|
|
8072
8072
|
keyValue: formattedKeyValue || keyValue,
|
|
@@ -8074,7 +8074,7 @@
|
|
|
8074
8074
|
baselineArrow: getBaselineArrowDirection(baselineCell, keyValueCell, chart.baselineMode),
|
|
8075
8075
|
baselineColor: getBaselineColor(baselineCell, chart.baselineMode, keyValueCell, chart.baselineColorUp, chart.baselineColorDown),
|
|
8076
8076
|
baselineDescr: chart.baselineDescr ? _t(chart.baselineDescr) : "",
|
|
8077
|
-
fontColor
|
|
8077
|
+
fontColor,
|
|
8078
8078
|
background,
|
|
8079
8079
|
baselineStyle: chart.baselineMode !== "percentage" && baseline
|
|
8080
8080
|
? getters.getCellStyle({
|
|
@@ -9385,6 +9385,17 @@
|
|
|
9385
9385
|
};
|
|
9386
9386
|
const IS_ONLY_ONE_RANGE = (env) => {
|
|
9387
9387
|
return env.model.getters.getSelectedZones().length === 1;
|
|
9388
|
+
};
|
|
9389
|
+
const CAN_INSERT_HEADER = (env, dimension) => {
|
|
9390
|
+
if (!IS_ONLY_ONE_RANGE(env)) {
|
|
9391
|
+
return false;
|
|
9392
|
+
}
|
|
9393
|
+
const activeHeaders = dimension === "COL" ? env.model.getters.getActiveCols() : env.model.getters.getActiveRows();
|
|
9394
|
+
const ortogonalActiveHeaders = dimension === "COL" ? env.model.getters.getActiveRows() : env.model.getters.getActiveCols();
|
|
9395
|
+
const sheetId = env.model.getters.getActiveSheetId();
|
|
9396
|
+
const zone = env.model.getters.getSelectedZone();
|
|
9397
|
+
const allSheetSelected = isEqual(zone, env.model.getters.getSheetZone(sheetId));
|
|
9398
|
+
return isConsecutive(activeHeaders) && (ortogonalActiveHeaders.size === 0 || allSheetSelected);
|
|
9388
9399
|
};
|
|
9389
9400
|
|
|
9390
9401
|
const undo = {
|
|
@@ -16319,17 +16330,13 @@
|
|
|
16319
16330
|
|
|
16320
16331
|
const insertRow = {
|
|
16321
16332
|
name: MENU_INSERT_ROWS_NAME,
|
|
16322
|
-
isVisible: (env) =>
|
|
16323
|
-
IS_ONLY_ONE_RANGE(env) &&
|
|
16324
|
-
env.model.getters.getActiveCols().size === 0,
|
|
16333
|
+
isVisible: (env) => CAN_INSERT_HEADER(env, "ROW"),
|
|
16325
16334
|
icon: "o-spreadsheet-Icon.INSERT_ROW",
|
|
16326
16335
|
};
|
|
16327
16336
|
const rowInsertRowBefore = {
|
|
16328
16337
|
name: ROW_INSERT_ROWS_BEFORE_NAME,
|
|
16329
16338
|
execute: INSERT_ROWS_BEFORE_ACTION,
|
|
16330
|
-
isVisible: (env) =>
|
|
16331
|
-
IS_ONLY_ONE_RANGE(env) &&
|
|
16332
|
-
env.model.getters.getActiveCols().size === 0,
|
|
16339
|
+
isVisible: (env) => CAN_INSERT_HEADER(env, "ROW"),
|
|
16333
16340
|
icon: "o-spreadsheet-Icon.INSERT_ROW_BEFORE",
|
|
16334
16341
|
};
|
|
16335
16342
|
const topBarInsertRowsBefore = {
|
|
@@ -16345,9 +16352,7 @@
|
|
|
16345
16352
|
const rowInsertRowsAfter = {
|
|
16346
16353
|
execute: INSERT_ROWS_AFTER_ACTION,
|
|
16347
16354
|
name: ROW_INSERT_ROWS_AFTER_NAME,
|
|
16348
|
-
isVisible: (env) =>
|
|
16349
|
-
IS_ONLY_ONE_RANGE(env) &&
|
|
16350
|
-
env.model.getters.getActiveCols().size === 0,
|
|
16355
|
+
isVisible: (env) => CAN_INSERT_HEADER(env, "ROW"),
|
|
16351
16356
|
icon: "o-spreadsheet-Icon.INSERT_ROW_AFTER",
|
|
16352
16357
|
};
|
|
16353
16358
|
const topBarInsertRowsAfter = {
|
|
@@ -16356,17 +16361,13 @@
|
|
|
16356
16361
|
};
|
|
16357
16362
|
const insertCol = {
|
|
16358
16363
|
name: MENU_INSERT_COLUMNS_NAME,
|
|
16359
|
-
isVisible: (env) =>
|
|
16360
|
-
IS_ONLY_ONE_RANGE(env) &&
|
|
16361
|
-
env.model.getters.getActiveRows().size === 0,
|
|
16364
|
+
isVisible: (env) => CAN_INSERT_HEADER(env, "COL"),
|
|
16362
16365
|
icon: "o-spreadsheet-Icon.INSERT_COL",
|
|
16363
16366
|
};
|
|
16364
16367
|
const colInsertColsBefore = {
|
|
16365
16368
|
name: COLUMN_INSERT_COLUMNS_BEFORE_NAME,
|
|
16366
16369
|
execute: INSERT_COLUMNS_BEFORE_ACTION,
|
|
16367
|
-
isVisible: (env) =>
|
|
16368
|
-
IS_ONLY_ONE_RANGE(env) &&
|
|
16369
|
-
env.model.getters.getActiveRows().size === 0,
|
|
16370
|
+
isVisible: (env) => CAN_INSERT_HEADER(env, "COL"),
|
|
16370
16371
|
icon: "o-spreadsheet-Icon.INSERT_COL_BEFORE",
|
|
16371
16372
|
};
|
|
16372
16373
|
const topBarInsertColsBefore = {
|
|
@@ -16382,9 +16383,7 @@
|
|
|
16382
16383
|
const colInsertColsAfter = {
|
|
16383
16384
|
name: COLUMN_INSERT_COLUMNS_AFTER_NAME,
|
|
16384
16385
|
execute: INSERT_COLUMNS_AFTER_ACTION,
|
|
16385
|
-
isVisible: (env) =>
|
|
16386
|
-
IS_ONLY_ONE_RANGE(env) &&
|
|
16387
|
-
env.model.getters.getActiveRows().size === 0,
|
|
16386
|
+
isVisible: (env) => CAN_INSERT_HEADER(env, "COL"),
|
|
16388
16387
|
icon: "o-spreadsheet-Icon.INSERT_COL_AFTER",
|
|
16389
16388
|
};
|
|
16390
16389
|
const topBarInsertColsAfter = {
|
|
@@ -19711,7 +19710,7 @@
|
|
|
19711
19710
|
}
|
|
19712
19711
|
.o-input-count {
|
|
19713
19712
|
width: fit-content;
|
|
19714
|
-
padding:
|
|
19713
|
+
padding: 4px 0 4px 4px;
|
|
19715
19714
|
}
|
|
19716
19715
|
}
|
|
19717
19716
|
}
|
|
@@ -30845,6 +30844,13 @@
|
|
|
30845
30844
|
}
|
|
30846
30845
|
onDeleteColumnsRows(cmd) {
|
|
30847
30846
|
for (const table of this.getFilterTables(cmd.sheetId)) {
|
|
30847
|
+
// Remove the filter tables whose data filter headers are in the removed rows.
|
|
30848
|
+
if (cmd.dimension === "ROW" && cmd.elements.includes(table.zone.top)) {
|
|
30849
|
+
const tables = { ...this.tables[cmd.sheetId] };
|
|
30850
|
+
delete tables[table.id];
|
|
30851
|
+
this.history.update("tables", cmd.sheetId, tables);
|
|
30852
|
+
continue;
|
|
30853
|
+
}
|
|
30848
30854
|
const zone = reduceZoneOnDeletion(table.zone, cmd.dimension === "COL" ? "left" : "top", cmd.elements);
|
|
30849
30855
|
if (!zone) {
|
|
30850
30856
|
const tables = { ...this.tables[cmd.sheetId] };
|
|
@@ -33725,7 +33731,7 @@
|
|
|
33725
33731
|
}
|
|
33726
33732
|
|
|
33727
33733
|
class EvaluationChartPlugin extends UIPlugin {
|
|
33728
|
-
static getters = ["getChartRuntime", "
|
|
33734
|
+
static getters = ["getChartRuntime", "getStyleOfSingleCellChart"];
|
|
33729
33735
|
charts = {};
|
|
33730
33736
|
createRuntimeChart = chartRuntimeFactory(this.getters);
|
|
33731
33737
|
handle(cmd) {
|
|
@@ -33763,25 +33769,26 @@
|
|
|
33763
33769
|
return this.charts[figureId];
|
|
33764
33770
|
}
|
|
33765
33771
|
/**
|
|
33766
|
-
* Get the background
|
|
33767
|
-
* of the chart. In order of priority, it will return :
|
|
33768
|
-
*
|
|
33769
|
-
* - the chart background color if one is defined
|
|
33770
|
-
* - the fill color of the cell if one is defined
|
|
33771
|
-
* - the fill color of the cell from conditional formats if one is defined
|
|
33772
|
-
* - the default chart color if no other color is defined
|
|
33772
|
+
* Get the background and textColor of a chart based on the color of the first cell of the main range of the chart.
|
|
33773
33773
|
*/
|
|
33774
|
-
|
|
33774
|
+
getStyleOfSingleCellChart(chartBackground, mainRange) {
|
|
33775
33775
|
if (chartBackground)
|
|
33776
|
-
return chartBackground;
|
|
33776
|
+
return { background: chartBackground, fontColor: chartFontColor(chartBackground) };
|
|
33777
33777
|
if (!mainRange) {
|
|
33778
|
-
return
|
|
33778
|
+
return {
|
|
33779
|
+
background: BACKGROUND_CHART_COLOR,
|
|
33780
|
+
fontColor: chartFontColor(BACKGROUND_CHART_COLOR),
|
|
33781
|
+
};
|
|
33779
33782
|
}
|
|
33780
33783
|
const col = mainRange.zone.left;
|
|
33781
33784
|
const row = mainRange.zone.top;
|
|
33782
33785
|
const sheetId = mainRange.sheetId;
|
|
33783
33786
|
const style = this.getters.getCellComputedStyle({ sheetId, col, row });
|
|
33784
|
-
|
|
33787
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
33788
|
+
return {
|
|
33789
|
+
background,
|
|
33790
|
+
fontColor: style.textColor || chartFontColor(background),
|
|
33791
|
+
};
|
|
33785
33792
|
}
|
|
33786
33793
|
}
|
|
33787
33794
|
|
|
@@ -34192,6 +34199,8 @@
|
|
|
34192
34199
|
case "EVALUATE_CELLS":
|
|
34193
34200
|
case "ACTIVATE_SHEET":
|
|
34194
34201
|
case "REMOVE_FILTER_TABLE":
|
|
34202
|
+
case "ADD_COLUMNS_ROWS":
|
|
34203
|
+
case "REMOVE_COLUMNS_ROWS":
|
|
34195
34204
|
this.isEvaluationDirty = true;
|
|
34196
34205
|
break;
|
|
34197
34206
|
case "START":
|
|
@@ -43562,6 +43571,7 @@
|
|
|
43562
43571
|
line-height: 1.2;
|
|
43563
43572
|
font-size: 13px;
|
|
43564
43573
|
font-weight: 500;
|
|
43574
|
+
background-color: #fff;
|
|
43565
43575
|
|
|
43566
43576
|
.o-topbar-top {
|
|
43567
43577
|
border-bottom: 1px solid ${SEPARATOR_COLOR};
|
|
@@ -46408,14 +46418,14 @@
|
|
|
46408
46418
|
*/
|
|
46409
46419
|
function figureCoordinates(headers, position) {
|
|
46410
46420
|
let currentPosition = 0;
|
|
46411
|
-
for (const [headerIndex, header] of
|
|
46421
|
+
for (const [headerIndex, header] of headers.entries()) {
|
|
46412
46422
|
if (currentPosition <= position && position < currentPosition + header.size) {
|
|
46413
46423
|
return {
|
|
46414
|
-
index:
|
|
46424
|
+
index: headerIndex,
|
|
46415
46425
|
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH),
|
|
46416
46426
|
};
|
|
46417
46427
|
}
|
|
46418
|
-
else {
|
|
46428
|
+
else if (headerIndex < headers.length - 1) {
|
|
46419
46429
|
currentPosition += header.size;
|
|
46420
46430
|
}
|
|
46421
46431
|
}
|
|
@@ -47794,9 +47804,9 @@
|
|
|
47794
47804
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47795
47805
|
|
|
47796
47806
|
|
|
47797
|
-
__info__.version = '16.3.
|
|
47798
|
-
__info__.date = '2023-
|
|
47799
|
-
__info__.hash = '
|
|
47807
|
+
__info__.version = '16.3.17';
|
|
47808
|
+
__info__.date = '2023-11-16T11:59:29.130Z';
|
|
47809
|
+
__info__.hash = '4049460';
|
|
47800
47810
|
|
|
47801
47811
|
|
|
47802
47812
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|