|
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.32 |
6 |
| - * @date 2025-06-06T09:49:11.215Z |
7 |
| - * @hash bef1e2bd5 |
| 5 | + * @version 18.0.33 |
| 6 | + * @date 2025-06-12T10:52:55.981Z |
| 7 | + * @hash c1d64fba1 |
8 | 8 | */
|
9 | 9 |
|
10 | 10 | import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
@@ -5676,7 +5676,9 @@ function isTextFormat(format) {
|
5676 | 5676 | }
|
5677 | 5677 |
|
5678 | 5678 | function evaluateLiteral(literalCell, localeFormat) {
|
5679 |
| - const value = isTextFormat(localeFormat.format) ? literalCell.content : literalCell.parsedValue; |
| 5679 | + const value = isTextFormat(localeFormat.format) && literalCell.parsedValue !== null |
| 5680 | + ? literalCell.content |
| 5681 | + : literalCell.parsedValue; |
5680 | 5682 | const functionResult = { value, format: localeFormat.format };
|
5681 | 5683 | return createEvaluatedCell(functionResult, localeFormat.locale);
|
5682 | 5684 | }
|
@@ -5725,16 +5727,16 @@ function _createEvaluatedCell(functionResult, locale, cell) {
|
5725 | 5727 | if (isEvaluationError(value)) {
|
5726 | 5728 | return errorCell(value, message);
|
5727 | 5729 | }
|
| 5730 | + if (value === null) { |
| 5731 | + return emptyCell(format); |
| 5732 | + } |
5728 | 5733 | if (isTextFormat(format)) {
|
5729 | 5734 | // TO DO:
|
5730 | 5735 | // with the next line, the value of the cell is transformed depending on the format.
|
5731 | 5736 | // This shouldn't happen, by doing this, the formulas handling numbers are not able
|
5732 | 5737 | // to interpret the value as a number.
|
5733 | 5738 | return textCell(toString(value), format, formattedValue);
|
5734 | 5739 | }
|
5735 |
| - if (value === null) { |
5736 |
| - return emptyCell(format); |
5737 |
| - } |
5738 | 5740 | if (typeof value === "number") {
|
5739 | 5741 | if (isDateTimeFormat(format || "")) {
|
5740 | 5742 | return dateTimeCell(value, format, formattedValue);
|
@@ -10170,10 +10172,22 @@ function drawPieChartValues(chart, options, ctx) {
|
10170 | 10172 | const midAngle = (startAngle + endAngle) / 2;
|
10171 | 10173 | const midRadius = (innerRadius + outerRadius) / 2;
|
10172 | 10174 | const x = bar.x + midRadius * Math.cos(midAngle);
|
10173 |
| - const y = bar.y + midRadius * Math.sin(midAngle) + 7; |
| 10175 | + const y = bar.y + midRadius * Math.sin(midAngle); |
| 10176 | + const displayValue = options.callback(value, dataset, i); |
| 10177 | + const textHeight = 12; // ChartJS default |
| 10178 | + const textWidth = computeTextWidth(ctx, displayValue, { fontSize: textHeight }, "px"); |
| 10179 | + const radius = outerRadius - innerRadius; |
| 10180 | + // Check if the text fits in the slice. Not perfect, but good enough heuristic. |
| 10181 | + if (textWidth >= radius || radius < textHeight) { |
| 10182 | + continue; |
| 10183 | + } |
| 10184 | + const sliceAngle = endAngle - startAngle; |
| 10185 | + const midWidth = 2 * midRadius * Math.tan(sliceAngle / 2); |
| 10186 | + if (sliceAngle < Math.PI / 2 && (textWidth >= midWidth || midWidth < textHeight)) { |
| 10187 | + continue; |
| 10188 | + } |
10174 | 10189 | ctx.fillStyle = chartFontColor(options.background);
|
10175 | 10190 | ctx.strokeStyle = options.background || "#ffffff";
|
10176 |
| - const displayValue = options.callback(value, dataset, i); |
10177 | 10191 | drawTextWithBackground(displayValue, x, y, ctx);
|
10178 | 10192 | }
|
10179 | 10193 | }
|
@@ -13390,7 +13404,7 @@ class XlsxBaseExtractor {
|
13390 | 13404 | */
|
13391 | 13405 | handleMissingValue(parentElement, missingElementName, optionalArgs) {
|
13392 | 13406 | if (optionalArgs?.required) {
|
13393 |
| - if (optionalArgs?.default) { |
| 13407 | + if (optionalArgs?.default !== undefined) { |
13394 | 13408 | this.warningManager.addParsingWarning(`Missing required ${missingElementName} in element <${parentElement.tagName}> of ${this.currentFile}, replacing it by the default value ${optionalArgs.default}`);
|
13395 | 13409 | }
|
13396 | 13410 | else {
|
@@ -32516,19 +32530,26 @@ class FilterMenu extends Component {
|
32516 | 32530 | .filter(({ row }) => !this.env.model.getters.isRowHidden(sheetId, row))
|
32517 | 32531 | .map(({ col, row }) => this.env.model.getters.getEvaluatedCell({ sheetId, col, row }).formattedValue);
|
32518 | 32532 | const filterValues = this.env.model.getters.getFilterHiddenValues({ sheetId, ...position });
|
32519 |
| - const strValues = [...cellValues, ...filterValues]; |
32520 |
| - const normalizedFilteredValues = filterValues.map(toLowerCase); |
32521 |
| - // Set with lowercase values to avoid duplicates |
32522 |
| - const normalizedValues = [...new Set(strValues.map(toLowerCase))]; |
32523 |
| - const sortedValues = normalizedValues.sort((val1, val2) => val1.localeCompare(val2, undefined, { numeric: true, sensitivity: "base" })); |
32524 |
| - return sortedValues.map((normalizedValue) => { |
32525 |
| - const checked = normalizedFilteredValues.findIndex((filteredValue) => filteredValue === normalizedValue) === |
32526 |
| - -1; |
32527 |
| - return { |
32528 |
| - checked, |
32529 |
| - string: strValues.find((val) => toLowerCase(val) === normalizedValue) || "", |
32530 |
| - }; |
32531 |
| - }); |
| 32533 | + const normalizedFilteredValues = new Set(filterValues.map(toLowerCase)); |
| 32534 | + const set = new Set(); |
| 32535 | + const values = []; |
| 32536 | + const addValue = (value) => { |
| 32537 | + const normalizedValue = toLowerCase(value); |
| 32538 | + if (!set.has(normalizedValue)) { |
| 32539 | + values.push({ |
| 32540 | + string: value || "", |
| 32541 | + checked: !normalizedFilteredValues.has(normalizedValue), |
| 32542 | + normalizedValue, |
| 32543 | + }); |
| 32544 | + set.add(normalizedValue); |
| 32545 | + } |
| 32546 | + }; |
| 32547 | + cellValues.forEach(addValue); |
| 32548 | + filterValues.forEach(addValue); |
| 32549 | + return values.sort((val1, val2) => val1.normalizedValue.localeCompare(val2.normalizedValue, undefined, { |
| 32550 | + numeric: true, |
| 32551 | + sensitivity: "base", |
| 32552 | + })); |
32532 | 32553 | }
|
32533 | 32554 | checkValue(value) {
|
32534 | 32555 | this.state.selectedValue = value.string;
|
@@ -56027,7 +56048,9 @@ class TablePlugin extends CorePlugin {
|
56027 | 56048 | const ranges = cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData));
|
56028 | 56049 | const union = this.getters.getRangesUnion(ranges);
|
56029 | 56050 | const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, union.zone);
|
56030 |
| - this.dispatch("REMOVE_MERGE", { sheetId: cmd.sheetId, target: mergesInTarget }); |
| 56051 | + if (mergesInTarget.length) { |
| 56052 | + this.dispatch("REMOVE_MERGE", { sheetId: cmd.sheetId, target: mergesInTarget }); |
| 56053 | + } |
56031 | 56054 | const id = this.uuidGenerator.smallUuid();
|
56032 | 56055 | const config = cmd.config || DEFAULT_TABLE_CONFIG;
|
56033 | 56056 | const newTable = cmd.tableType === "dynamic"
|
@@ -56138,14 +56161,16 @@ class TablePlugin extends CorePlugin {
|
56138 | 56161 | const zoneToCheckIfEmpty = direction === "down"
|
56139 | 56162 | ? { ...zone, bottom: zone.bottom + 1, top: zone.bottom + 1 }
|
56140 | 56163 | : { ...zone, right: zone.right + 1, left: zone.right + 1 };
|
56141 |
| - for (const position of positions(zoneToCheckIfEmpty)) { |
56142 |
| - const cellPosition = { sheetId, ...position }; |
56143 |
| - // Since this plugin is loaded before CellPlugin, the getters still give us the old cell content |
56144 |
| - const cellContent = this.getters.getCell(cellPosition)?.content; |
56145 |
| - if (cellContent || |
56146 |
| - this.getters.isInMerge(cellPosition) || |
56147 |
| - this.getTablesOverlappingZones(sheetId, [positionToZone(position)]).length) { |
56148 |
| - return "none"; |
| 56164 | + for (let row = zoneToCheckIfEmpty.top; row <= zoneToCheckIfEmpty.bottom; row++) { |
| 56165 | + for (let col = zoneToCheckIfEmpty.left; col <= zoneToCheckIfEmpty.right; col++) { |
| 56166 | + const cellPosition = { sheetId, col, row }; |
| 56167 | + // Since this plugin is loaded before CellPlugin, the getters still give us the old cell content |
| 56168 | + const cellContent = this.getters.getCell(cellPosition)?.content; |
| 56169 | + if (cellContent || |
| 56170 | + this.getters.isInMerge(cellPosition) || |
| 56171 | + this.getTablesOverlappingZones(sheetId, [positionToZone(cellPosition)]).length) { |
| 56172 | + return "none"; |
| 56173 | + } |
56149 | 56174 | }
|
56150 | 56175 | }
|
56151 | 56176 | return direction;
|
@@ -65470,9 +65495,10 @@ class FilterEvaluationPlugin extends UIPlugin {
|
65470 | 65495 | const filteredZone = filter.filteredRange?.zone;
|
65471 | 65496 | if (!filteredValues || !filteredZone)
|
65472 | 65497 | continue;
|
| 65498 | + const filteredValuesSet = new Set(filteredValues); |
65473 | 65499 | for (let row = filteredZone.top; row <= filteredZone.bottom; row++) {
|
65474 | 65500 | const value = this.getCellValueAsString(sheetId, filter.col, row);
|
65475 |
| - if (filteredValues.includes(value)) { |
| 65501 | + if (filteredValuesSet.has(value)) { |
65476 | 65502 | hiddenRows.add(row);
|
65477 | 65503 | }
|
65478 | 65504 | }
|
@@ -74376,7 +74402,7 @@ const constants = {
|
74376 | 74402 | export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
74377 | 74403 |
|
74378 | 74404 |
|
74379 |
| -__info__.version = "18.0.32"; |
74380 |
| -__info__.date = "2025-06-06T09:49:11.215Z"; |
74381 |
| -__info__.hash = "bef1e2bd5"; |
| 74405 | +__info__.version = "18.0.33"; |
| 74406 | +__info__.date = "2025-06-12T10:52:55.981Z"; |
| 74407 | +__info__.hash = "c1d64fba1"; |
74382 | 74408 | //# sourceMappingURL=o_spreadsheet.js.map
|
0 commit comments