@odoo/o-spreadsheet 18.3.3 → 18.3.4
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 +160 -137
- package/dist/o-spreadsheet.d.ts +46 -45
- package/dist/o-spreadsheet.esm.js +160 -137
- package/dist/o-spreadsheet.iife.js +160 -137
- package/dist/o-spreadsheet.iife.min.js +384 -384
- package/dist/o_spreadsheet.xml +4 -3
- 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 18.3.
|
|
6
|
-
* @date 2025-05-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.4
|
|
6
|
+
* @date 2025-05-20T05:57:03.751Z
|
|
7
|
+
* @hash 28f4521
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -1625,18 +1625,53 @@ function lettersToNumber(letters) {
|
|
|
1625
1625
|
let result = 0;
|
|
1626
1626
|
const l = letters.length;
|
|
1627
1627
|
for (let i = 0; i < l; i++) {
|
|
1628
|
-
const
|
|
1629
|
-
const colIndex = charCode >= 65 && charCode <= 90 ? charCode - 64 : charCode - 96;
|
|
1628
|
+
const colIndex = charToNumber(letters[i]);
|
|
1630
1629
|
result = result * 26 + colIndex;
|
|
1631
1630
|
}
|
|
1632
1631
|
return result - 1;
|
|
1633
1632
|
}
|
|
1633
|
+
function charToNumber(char) {
|
|
1634
|
+
const charCode = char.charCodeAt(0);
|
|
1635
|
+
return charCode >= 65 && charCode <= 90 ? charCode - 64 : charCode - 96;
|
|
1636
|
+
}
|
|
1634
1637
|
function isCharALetter(char) {
|
|
1635
1638
|
return (char >= "A" && char <= "Z") || (char >= "a" && char <= "z");
|
|
1636
1639
|
}
|
|
1637
1640
|
function isCharADigit(char) {
|
|
1638
1641
|
return char >= "0" && char <= "9";
|
|
1639
1642
|
}
|
|
1643
|
+
// we limit the max column to 3 letters and max row to 7 digits for performance reasons
|
|
1644
|
+
const MAX_COL = lettersToNumber("ZZZ");
|
|
1645
|
+
const MAX_ROW = 9999998;
|
|
1646
|
+
function consumeSpaces(chars) {
|
|
1647
|
+
while (chars.current === " ") {
|
|
1648
|
+
chars.advanceBy(1);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
function consumeLetters(chars) {
|
|
1652
|
+
if (chars.current === "$")
|
|
1653
|
+
chars.advanceBy(1);
|
|
1654
|
+
if (!chars.current || !isCharALetter(chars.current)) {
|
|
1655
|
+
return -1;
|
|
1656
|
+
}
|
|
1657
|
+
let colCoordinate = 0;
|
|
1658
|
+
while (chars.current && isCharALetter(chars.current)) {
|
|
1659
|
+
colCoordinate = colCoordinate * 26 + charToNumber(chars.shift());
|
|
1660
|
+
}
|
|
1661
|
+
return colCoordinate;
|
|
1662
|
+
}
|
|
1663
|
+
function consumeDigits(chars) {
|
|
1664
|
+
if (chars.current === "$")
|
|
1665
|
+
chars.advanceBy(1);
|
|
1666
|
+
if (!chars.current || !isCharADigit(chars.current)) {
|
|
1667
|
+
return -1;
|
|
1668
|
+
}
|
|
1669
|
+
let num = 0;
|
|
1670
|
+
while (chars.current && isCharADigit(chars.current)) {
|
|
1671
|
+
num = num * 10 + Number(chars.shift());
|
|
1672
|
+
}
|
|
1673
|
+
return num;
|
|
1674
|
+
}
|
|
1640
1675
|
/**
|
|
1641
1676
|
* Convert a "XC" coordinate to cartesian coordinates.
|
|
1642
1677
|
*
|
|
@@ -1647,33 +1682,17 @@ function isCharADigit(char) {
|
|
|
1647
1682
|
* Note: it also accepts lowercase coordinates, but not fixed references
|
|
1648
1683
|
*/
|
|
1649
1684
|
function toCartesian(xc) {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
// Process letter part
|
|
1655
|
-
if (xc[i] === "$")
|
|
1656
|
-
i++;
|
|
1657
|
-
while (i < xc.length && isCharALetter(xc[i])) {
|
|
1658
|
-
letterPart += xc[i++];
|
|
1659
|
-
}
|
|
1660
|
-
if (letterPart.length === 0 || letterPart.length > 3) {
|
|
1661
|
-
// limit to max 3 letters for performance reasons
|
|
1685
|
+
const chars = new TokenizingChars(xc);
|
|
1686
|
+
consumeSpaces(chars);
|
|
1687
|
+
const letterPart = consumeLetters(chars);
|
|
1688
|
+
if (letterPart === -1 || !chars.current) {
|
|
1662
1689
|
throw new Error(`Invalid cell description: ${xc}`);
|
|
1663
1690
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
}
|
|
1670
|
-
if (i !== xc.length || numberPart.length === 0 || numberPart.length > 7) {
|
|
1671
|
-
// limit to max 7 numbers for performance reasons
|
|
1672
|
-
throw new Error(`Invalid cell description: ${xc}`);
|
|
1673
|
-
}
|
|
1674
|
-
const col = lettersToNumber(letterPart);
|
|
1675
|
-
const row = Number(numberPart) - 1;
|
|
1676
|
-
if (isNaN(row)) {
|
|
1691
|
+
const num = consumeDigits(chars);
|
|
1692
|
+
consumeSpaces(chars);
|
|
1693
|
+
const col = letterPart - 1;
|
|
1694
|
+
const row = num - 1;
|
|
1695
|
+
if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) {
|
|
1677
1696
|
throw new Error(`Invalid cell description: ${xc}`);
|
|
1678
1697
|
}
|
|
1679
1698
|
return { col, row };
|
|
@@ -2028,67 +2047,6 @@ function binarySuccessorSearch(arr, val, start = 0, matchEqual = true) {
|
|
|
2028
2047
|
return result;
|
|
2029
2048
|
}
|
|
2030
2049
|
|
|
2031
|
-
/** Reference of a cell (eg. A1, $B$5) */
|
|
2032
|
-
const cellReference = new RegExp(/\$?([A-Z]{1,3})\$?([0-9]{1,7})/, "i");
|
|
2033
|
-
// Same as above, but matches the exact string (nothing before or after)
|
|
2034
|
-
const singleCellReference = new RegExp(/^\$?([A-Z]{1,3})\$?([0-9]{1,7})$/, "i");
|
|
2035
|
-
/** Reference of a column header (eg. A, AB, $A) */
|
|
2036
|
-
const colHeader = new RegExp(/^\$?([A-Z]{1,3})+$/, "i");
|
|
2037
|
-
/** Reference of a row header (eg. 1, $1) */
|
|
2038
|
-
const rowHeader = new RegExp(/^\$?([0-9]{1,7})+$/, "i");
|
|
2039
|
-
/** Reference of a column (eg. A, $CA, Sheet1!B) */
|
|
2040
|
-
const colReference = new RegExp(/^\s*('.+'!|[^']+!)?\$?([A-Z]{1,3})$/, "i");
|
|
2041
|
-
/** Reference of a row (eg. 1, 59, Sheet1!9) */
|
|
2042
|
-
const rowReference = new RegExp(/^\s*('.+'!|[^']+!)?\$?([0-9]{1,7})$/, "i");
|
|
2043
|
-
/** Reference of a normal range or a full row range (eg. A1:B1, 1:$5, $A2:5) */
|
|
2044
|
-
const fullRowXc = /(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*:\s*(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*/i;
|
|
2045
|
-
/** Reference of a normal range or a column row range (eg. A1:B1, A:$B, $A1:C) */
|
|
2046
|
-
const fullColXc = /\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*:\s*\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*/i;
|
|
2047
|
-
/** Reference of a cell or a range, it can be a bounded range, a full row or a full column */
|
|
2048
|
-
const rangeReference = new RegExp(/^\s*('.+'!|[^']+!)?/.source +
|
|
2049
|
-
"(" +
|
|
2050
|
-
[cellReference.source, fullRowXc.source, fullColXc.source].join("|") +
|
|
2051
|
-
")" +
|
|
2052
|
-
/$/.source, "i");
|
|
2053
|
-
/**
|
|
2054
|
-
* Return true if the given xc is the reference of a column (e.g. A or AC or Sheet1!A)
|
|
2055
|
-
*/
|
|
2056
|
-
function isColReference(xc) {
|
|
2057
|
-
return colReference.test(xc);
|
|
2058
|
-
}
|
|
2059
|
-
/**
|
|
2060
|
-
* Return true if the given xc is the reference of a column (e.g. 1 or Sheet1!1)
|
|
2061
|
-
*/
|
|
2062
|
-
function isRowReference(xc) {
|
|
2063
|
-
return rowReference.test(xc);
|
|
2064
|
-
}
|
|
2065
|
-
function isColHeader(str) {
|
|
2066
|
-
return colHeader.test(str);
|
|
2067
|
-
}
|
|
2068
|
-
function isRowHeader(str) {
|
|
2069
|
-
return rowHeader.test(str);
|
|
2070
|
-
}
|
|
2071
|
-
/**
|
|
2072
|
-
* Return true if the given xc is the reference of a single cell,
|
|
2073
|
-
* without any specified sheet (e.g. A1)
|
|
2074
|
-
*/
|
|
2075
|
-
function isSingleCellReference(xc) {
|
|
2076
|
-
return singleCellReference.test(xc);
|
|
2077
|
-
}
|
|
2078
|
-
function splitReference(ref) {
|
|
2079
|
-
if (!ref.includes("!")) {
|
|
2080
|
-
return { xc: ref };
|
|
2081
|
-
}
|
|
2082
|
-
const parts = ref.split("!");
|
|
2083
|
-
const xc = parts.pop();
|
|
2084
|
-
const sheetName = getUnquotedSheetName(parts.join("!")) || undefined;
|
|
2085
|
-
return { sheetName, xc };
|
|
2086
|
-
}
|
|
2087
|
-
/** Return a reference SheetName!xc from the given arguments */
|
|
2088
|
-
function getFullReference(sheetName, xc) {
|
|
2089
|
-
return sheetName !== undefined ? `${getCanonicalSymbolName(sheetName)}!${xc}` : xc;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
2050
|
/**
|
|
2093
2051
|
* Convert from a cartesian reference to a Zone
|
|
2094
2052
|
* The range boundaries will be kept in the same order as the
|
|
@@ -2106,63 +2064,55 @@ function getFullReference(sheetName, xc) {
|
|
|
2106
2064
|
*
|
|
2107
2065
|
*/
|
|
2108
2066
|
function toZoneWithoutBoundaryChanges(xc) {
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
if (
|
|
2113
|
-
|
|
2114
|
-
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
if (xc.includes(":")) {
|
|
2118
|
-
[firstRangePart, secondRangePart] = xc.split(":");
|
|
2119
|
-
firstRangePart = firstRangePart.trim();
|
|
2120
|
-
secondRangePart = secondRangePart.trim();
|
|
2121
|
-
}
|
|
2122
|
-
else {
|
|
2123
|
-
firstRangePart = xc.trim();
|
|
2124
|
-
}
|
|
2067
|
+
const chars = new TokenizingChars(xc);
|
|
2068
|
+
consumeSpaces(chars);
|
|
2069
|
+
const sheetSeparatorIndex = xc.indexOf("!");
|
|
2070
|
+
if (sheetSeparatorIndex !== -1) {
|
|
2071
|
+
chars.advanceBy(sheetSeparatorIndex + 1);
|
|
2072
|
+
}
|
|
2073
|
+
const leftLetters = consumeLetters(chars);
|
|
2074
|
+
const leftNumbers = consumeDigits(chars);
|
|
2125
2075
|
let top, bottom, left, right;
|
|
2126
2076
|
let fullCol = false;
|
|
2127
2077
|
let fullRow = false;
|
|
2128
2078
|
let hasHeader = false;
|
|
2129
|
-
if (
|
|
2130
|
-
left = right =
|
|
2079
|
+
if (leftNumbers === -1) {
|
|
2080
|
+
left = right = leftLetters - 1;
|
|
2131
2081
|
top = bottom = 0;
|
|
2132
2082
|
fullCol = true;
|
|
2133
2083
|
}
|
|
2134
|
-
else if (
|
|
2135
|
-
top = bottom =
|
|
2084
|
+
else if (leftLetters === -1) {
|
|
2085
|
+
top = bottom = leftNumbers - 1;
|
|
2136
2086
|
left = right = 0;
|
|
2137
2087
|
fullRow = true;
|
|
2138
2088
|
}
|
|
2139
2089
|
else {
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
top = bottom = c.row;
|
|
2090
|
+
left = right = leftLetters - 1;
|
|
2091
|
+
top = bottom = leftNumbers - 1;
|
|
2143
2092
|
hasHeader = true;
|
|
2144
2093
|
}
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2094
|
+
consumeSpaces(chars);
|
|
2095
|
+
if (chars.current === ":") {
|
|
2096
|
+
chars.advanceBy(1);
|
|
2097
|
+
consumeSpaces(chars);
|
|
2098
|
+
const rightLetters = consumeLetters(chars);
|
|
2099
|
+
const rightNumbers = consumeDigits(chars);
|
|
2100
|
+
if (rightNumbers === -1) {
|
|
2101
|
+
right = rightLetters - 1;
|
|
2148
2102
|
fullCol = true;
|
|
2149
2103
|
}
|
|
2150
|
-
else if (
|
|
2151
|
-
bottom =
|
|
2104
|
+
else if (rightLetters === -1) {
|
|
2105
|
+
bottom = rightNumbers - 1;
|
|
2152
2106
|
fullRow = true;
|
|
2153
2107
|
}
|
|
2154
2108
|
else {
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
bottom = c.row;
|
|
2109
|
+
right = rightLetters - 1;
|
|
2110
|
+
bottom = rightNumbers - 1;
|
|
2158
2111
|
top = fullCol ? bottom : top;
|
|
2159
2112
|
left = fullRow ? right : left;
|
|
2160
2113
|
hasHeader = true;
|
|
2161
2114
|
}
|
|
2162
2115
|
}
|
|
2163
|
-
if (fullCol && fullRow) {
|
|
2164
|
-
throw new Error("Wrong zone xc. The zone cannot be at the same time a full column and a full row");
|
|
2165
|
-
}
|
|
2166
2116
|
const zone = {
|
|
2167
2117
|
top,
|
|
2168
2118
|
left,
|
|
@@ -2191,7 +2141,16 @@ function toZoneWithoutBoundaryChanges(xc) {
|
|
|
2191
2141
|
*/
|
|
2192
2142
|
function toUnboundedZone(xc) {
|
|
2193
2143
|
const zone = toZoneWithoutBoundaryChanges(xc);
|
|
2194
|
-
|
|
2144
|
+
const orderedZone = reorderZone(zone);
|
|
2145
|
+
const bottom = orderedZone.bottom;
|
|
2146
|
+
const right = orderedZone.right;
|
|
2147
|
+
if ((bottom !== undefined && bottom > MAX_ROW) || (right !== undefined && right > MAX_COL)) {
|
|
2148
|
+
throw new Error(`Range string out of bounds: ${xc}`); // limit the size of the zone for performance
|
|
2149
|
+
}
|
|
2150
|
+
if (bottom === undefined && right === undefined) {
|
|
2151
|
+
throw new Error("Wrong zone xc. The zone cannot be at the same time a full column and a full row");
|
|
2152
|
+
}
|
|
2153
|
+
return orderedZone;
|
|
2195
2154
|
}
|
|
2196
2155
|
/**
|
|
2197
2156
|
* Convert from a cartesian reference to a Zone.
|
|
@@ -6002,6 +5961,67 @@ function scrollDelay(value) {
|
|
|
6002
5961
|
return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-ACCELERATION * (value - 1));
|
|
6003
5962
|
}
|
|
6004
5963
|
|
|
5964
|
+
/** Reference of a cell (eg. A1, $B$5) */
|
|
5965
|
+
const cellReference = new RegExp(/\$?([A-Z]{1,3})\$?([0-9]{1,7})/, "i");
|
|
5966
|
+
// Same as above, but matches the exact string (nothing before or after)
|
|
5967
|
+
const singleCellReference = new RegExp(/^\$?([A-Z]{1,3})\$?([0-9]{1,7})$/, "i");
|
|
5968
|
+
/** Reference of a column header (eg. A, AB, $A) */
|
|
5969
|
+
const colHeader = new RegExp(/^\$?([A-Z]{1,3})+$/, "i");
|
|
5970
|
+
/** Reference of a row header (eg. 1, $1) */
|
|
5971
|
+
const rowHeader = new RegExp(/^\$?([0-9]{1,7})+$/, "i");
|
|
5972
|
+
/** Reference of a column (eg. A, $CA, Sheet1!B) */
|
|
5973
|
+
const colReference = new RegExp(/^\s*('.+'!|[^']+!)?\$?([A-Z]{1,3})$/, "i");
|
|
5974
|
+
/** Reference of a row (eg. 1, 59, Sheet1!9) */
|
|
5975
|
+
const rowReference = new RegExp(/^\s*('.+'!|[^']+!)?\$?([0-9]{1,7})$/, "i");
|
|
5976
|
+
/** Reference of a normal range or a full row range (eg. A1:B1, 1:$5, $A2:5) */
|
|
5977
|
+
const fullRowXc = /(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*:\s*(\$?[A-Z]{1,3})?\$?[0-9]{1,7}\s*/i;
|
|
5978
|
+
/** Reference of a normal range or a column row range (eg. A1:B1, A:$B, $A1:C) */
|
|
5979
|
+
const fullColXc = /\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*:\s*\$?[A-Z]{1,3}(\$?[0-9]{1,7})?\s*/i;
|
|
5980
|
+
/** Reference of a cell or a range, it can be a bounded range, a full row or a full column */
|
|
5981
|
+
const rangeReference = new RegExp(/^\s*('.+'!|[^']+!)?/.source +
|
|
5982
|
+
"(" +
|
|
5983
|
+
[cellReference.source, fullRowXc.source, fullColXc.source].join("|") +
|
|
5984
|
+
")" +
|
|
5985
|
+
/$/.source, "i");
|
|
5986
|
+
/**
|
|
5987
|
+
* Return true if the given xc is the reference of a column (e.g. A or AC or Sheet1!A)
|
|
5988
|
+
*/
|
|
5989
|
+
function isColReference(xc) {
|
|
5990
|
+
return colReference.test(xc);
|
|
5991
|
+
}
|
|
5992
|
+
/**
|
|
5993
|
+
* Return true if the given xc is the reference of a column (e.g. 1 or Sheet1!1)
|
|
5994
|
+
*/
|
|
5995
|
+
function isRowReference(xc) {
|
|
5996
|
+
return rowReference.test(xc);
|
|
5997
|
+
}
|
|
5998
|
+
function isColHeader(str) {
|
|
5999
|
+
return colHeader.test(str);
|
|
6000
|
+
}
|
|
6001
|
+
function isRowHeader(str) {
|
|
6002
|
+
return rowHeader.test(str);
|
|
6003
|
+
}
|
|
6004
|
+
/**
|
|
6005
|
+
* Return true if the given xc is the reference of a single cell,
|
|
6006
|
+
* without any specified sheet (e.g. A1)
|
|
6007
|
+
*/
|
|
6008
|
+
function isSingleCellReference(xc) {
|
|
6009
|
+
return singleCellReference.test(xc);
|
|
6010
|
+
}
|
|
6011
|
+
function splitReference(ref) {
|
|
6012
|
+
if (!ref.includes("!")) {
|
|
6013
|
+
return { xc: ref };
|
|
6014
|
+
}
|
|
6015
|
+
const parts = ref.split("!");
|
|
6016
|
+
const xc = parts.pop();
|
|
6017
|
+
const sheetName = getUnquotedSheetName(parts.join("!")) || undefined;
|
|
6018
|
+
return { sheetName, xc };
|
|
6019
|
+
}
|
|
6020
|
+
/** Return a reference SheetName!xc from the given arguments */
|
|
6021
|
+
function getFullReference(sheetName, xc) {
|
|
6022
|
+
return sheetName !== undefined ? `${getCanonicalSymbolName(sheetName)}!${xc}` : xc;
|
|
6023
|
+
}
|
|
6024
|
+
|
|
6005
6025
|
function createDefaultRows(rowNumber) {
|
|
6006
6026
|
const rows = [];
|
|
6007
6027
|
for (let i = 0; i < rowNumber; i++) {
|
|
@@ -43610,12 +43630,13 @@ class StandaloneComposerStore extends AbstractComposerStore {
|
|
|
43610
43630
|
return res;
|
|
43611
43631
|
}
|
|
43612
43632
|
getComposerContent() {
|
|
43633
|
+
let content = this._currentContent;
|
|
43613
43634
|
if (this.editionMode === "inactive") {
|
|
43614
43635
|
// References in the content might not be linked to the current active sheet
|
|
43615
43636
|
// We here force the sheet name prefix for all references that are not in
|
|
43616
43637
|
// the current active sheet
|
|
43617
43638
|
const defaultRangeSheetId = this.args().defaultRangeSheetId;
|
|
43618
|
-
|
|
43639
|
+
content = rangeTokenize(this.args().content)
|
|
43619
43640
|
.map((token) => {
|
|
43620
43641
|
if (token.type === "REFERENCE") {
|
|
43621
43642
|
const range = this.getters.getRangeFromSheetXC(defaultRangeSheetId, token.value);
|
|
@@ -43625,7 +43646,7 @@ class StandaloneComposerStore extends AbstractComposerStore {
|
|
|
43625
43646
|
})
|
|
43626
43647
|
.join("");
|
|
43627
43648
|
}
|
|
43628
|
-
return this.
|
|
43649
|
+
return localizeContent(content, this.getters.getLocale());
|
|
43629
43650
|
}
|
|
43630
43651
|
stopEdition() {
|
|
43631
43652
|
this._stopEdition();
|
|
@@ -48090,6 +48111,9 @@ class PivotMeasureEditor extends owl.Component {
|
|
|
48090
48111
|
}
|
|
48091
48112
|
return undefined;
|
|
48092
48113
|
}
|
|
48114
|
+
get isCalculatedMeasureInvalid() {
|
|
48115
|
+
return this.env.model.getters.getMeasureCompiledFormula(this.props.measure).isBadExpression;
|
|
48116
|
+
}
|
|
48093
48117
|
}
|
|
48094
48118
|
|
|
48095
48119
|
css /* scss */ `
|
|
@@ -52527,14 +52551,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
52527
52551
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX + scrollX - initialScrollX), width - minFigSize);
|
|
52528
52552
|
const deltaY = Math.min(dirY * (mouseInitialY - mouseY + scrollY - initialScrollY), height - minFigSize);
|
|
52529
52553
|
const fraction = Math.min(deltaX / width, deltaY / height);
|
|
52530
|
-
width = width * (1 - fraction);
|
|
52531
|
-
height = height * (1 - fraction);
|
|
52532
52554
|
if (dirX < 0) {
|
|
52533
52555
|
x = x + width * fraction;
|
|
52534
52556
|
}
|
|
52535
52557
|
if (dirY < 0) {
|
|
52536
52558
|
y = y + height * fraction;
|
|
52537
52559
|
}
|
|
52560
|
+
width = width * (1 - fraction);
|
|
52561
|
+
height = height * (1 - fraction);
|
|
52538
52562
|
}
|
|
52539
52563
|
else {
|
|
52540
52564
|
const deltaX = Math.max(dirX * (mouseX - mouseInitialX + scrollX - initialScrollX), minFigSize - width);
|
|
@@ -63776,10 +63800,9 @@ class Evaluator {
|
|
|
63776
63800
|
return this.evaluatedCells.keysForSheet(sheetId);
|
|
63777
63801
|
}
|
|
63778
63802
|
getArrayFormulaSpreadingOn(position) {
|
|
63779
|
-
const
|
|
63780
|
-
|
|
63781
|
-
|
|
63782
|
-
return this.spreadingRelations.isArrayFormula(position) ? position : undefined;
|
|
63803
|
+
const isEmpty = this.getEvaluatedCell(position).type === CellValueType.empty;
|
|
63804
|
+
if (isEmpty) {
|
|
63805
|
+
return undefined;
|
|
63783
63806
|
}
|
|
63784
63807
|
const arrayFormulas = this.spreadingRelations.searchFormulaPositionsSpreadingOn(position.sheetId, positionToZone(position));
|
|
63785
63808
|
return Array.from(arrayFormulas).find((position) => !this.blockedArrayFormulas.has(position));
|
|
@@ -80439,6 +80462,6 @@ exports.tokenColors = tokenColors;
|
|
|
80439
80462
|
exports.tokenize = tokenize;
|
|
80440
80463
|
|
|
80441
80464
|
|
|
80442
|
-
__info__.version = "18.3.
|
|
80443
|
-
__info__.date = "2025-05-
|
|
80444
|
-
__info__.hash = "
|
|
80465
|
+
__info__.version = "18.3.4";
|
|
80466
|
+
__info__.date = "2025-05-20T05:57:03.751Z";
|
|
80467
|
+
__info__.hash = "28f4521";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1494,6 +1494,51 @@ declare class ColorGenerator {
|
|
|
1494
1494
|
next(): string;
|
|
1495
1495
|
}
|
|
1496
1496
|
|
|
1497
|
+
interface SearchOptions {
|
|
1498
|
+
matchCase: boolean;
|
|
1499
|
+
exactMatch: boolean;
|
|
1500
|
+
searchFormulas: boolean;
|
|
1501
|
+
searchScope: "allSheets" | "activeSheet" | "specificRange";
|
|
1502
|
+
specificRange?: Range;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
/**
|
|
1506
|
+
* Deep copy arrays, plain objects and primitive values.
|
|
1507
|
+
* Throws an error for other types such as class instances.
|
|
1508
|
+
* Sparse arrays remain sparse.
|
|
1509
|
+
*/
|
|
1510
|
+
declare function deepCopy<T>(obj: T): T;
|
|
1511
|
+
declare function unquote(string: string, quoteChar?: "'" | '"'): string;
|
|
1512
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
1513
|
+
declare function sanitizeSheetName(sheetName: string, replacementChar?: string): string;
|
|
1514
|
+
declare function isMarkdownLink(str: string): boolean;
|
|
1515
|
+
/**
|
|
1516
|
+
* Build a markdown link from a label and an url
|
|
1517
|
+
*/
|
|
1518
|
+
declare function markdownLink(label: string, url: string): string;
|
|
1519
|
+
declare function parseMarkdownLink(str: string): {
|
|
1520
|
+
url: string;
|
|
1521
|
+
label: string;
|
|
1522
|
+
};
|
|
1523
|
+
/**
|
|
1524
|
+
* This helper function can be used as a type guard when filtering arrays.
|
|
1525
|
+
* const foo: number[] = [1, 2, undefined, 4].filter(isDefined)
|
|
1526
|
+
*/
|
|
1527
|
+
declare function isDefined<T>(argument: T | undefined): argument is T;
|
|
1528
|
+
/**
|
|
1529
|
+
* Lazy value computed by the provided function.
|
|
1530
|
+
*/
|
|
1531
|
+
declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Compares two objects.
|
|
1534
|
+
*/
|
|
1535
|
+
declare function deepEquals(o1: any, o2: any): boolean;
|
|
1536
|
+
declare function getUniqueText(text: string, texts: string[], options?: {
|
|
1537
|
+
compute?: (text: string, increment: number) => string;
|
|
1538
|
+
start?: number;
|
|
1539
|
+
computeFirstOne?: boolean;
|
|
1540
|
+
}): string;
|
|
1541
|
+
|
|
1497
1542
|
/**
|
|
1498
1543
|
* Convert a (col) number to the corresponding letter.
|
|
1499
1544
|
*
|
|
@@ -1570,51 +1615,6 @@ declare function formatValue(value: CellValue, { format, locale, formatWidth }:
|
|
|
1570
1615
|
}): FormattedValue;
|
|
1571
1616
|
declare function createCurrencyFormat(currency: Partial<Currency>): Format;
|
|
1572
1617
|
|
|
1573
|
-
interface SearchOptions {
|
|
1574
|
-
matchCase: boolean;
|
|
1575
|
-
exactMatch: boolean;
|
|
1576
|
-
searchFormulas: boolean;
|
|
1577
|
-
searchScope: "allSheets" | "activeSheet" | "specificRange";
|
|
1578
|
-
specificRange?: Range;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
/**
|
|
1582
|
-
* Deep copy arrays, plain objects and primitive values.
|
|
1583
|
-
* Throws an error for other types such as class instances.
|
|
1584
|
-
* Sparse arrays remain sparse.
|
|
1585
|
-
*/
|
|
1586
|
-
declare function deepCopy<T>(obj: T): T;
|
|
1587
|
-
declare function unquote(string: string, quoteChar?: "'" | '"'): string;
|
|
1588
|
-
/** Replace the excel-excluded characters of a sheetName */
|
|
1589
|
-
declare function sanitizeSheetName(sheetName: string, replacementChar?: string): string;
|
|
1590
|
-
declare function isMarkdownLink(str: string): boolean;
|
|
1591
|
-
/**
|
|
1592
|
-
* Build a markdown link from a label and an url
|
|
1593
|
-
*/
|
|
1594
|
-
declare function markdownLink(label: string, url: string): string;
|
|
1595
|
-
declare function parseMarkdownLink(str: string): {
|
|
1596
|
-
url: string;
|
|
1597
|
-
label: string;
|
|
1598
|
-
};
|
|
1599
|
-
/**
|
|
1600
|
-
* This helper function can be used as a type guard when filtering arrays.
|
|
1601
|
-
* const foo: number[] = [1, 2, undefined, 4].filter(isDefined)
|
|
1602
|
-
*/
|
|
1603
|
-
declare function isDefined<T>(argument: T | undefined): argument is T;
|
|
1604
|
-
/**
|
|
1605
|
-
* Lazy value computed by the provided function.
|
|
1606
|
-
*/
|
|
1607
|
-
declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
|
|
1608
|
-
/**
|
|
1609
|
-
* Compares two objects.
|
|
1610
|
-
*/
|
|
1611
|
-
declare function deepEquals(o1: any, o2: any): boolean;
|
|
1612
|
-
declare function getUniqueText(text: string, texts: string[], options?: {
|
|
1613
|
-
compute?: (text: string, increment: number) => string;
|
|
1614
|
-
start?: number;
|
|
1615
|
-
computeFirstOne?: boolean;
|
|
1616
|
-
}): string;
|
|
1617
|
-
|
|
1618
1618
|
/**
|
|
1619
1619
|
* Return true if the argument is a "number string".
|
|
1620
1620
|
*
|
|
@@ -10526,6 +10526,7 @@ declare class PivotMeasureEditor extends Component<Props$h> {
|
|
|
10526
10526
|
toggleMeasureVisibility(): void;
|
|
10527
10527
|
openShowValuesAs(): void;
|
|
10528
10528
|
getColoredSymbolToken(token: Token): Color | undefined;
|
|
10529
|
+
get isCalculatedMeasureInvalid(): boolean;
|
|
10529
10530
|
}
|
|
10530
10531
|
|
|
10531
10532
|
interface Props$g {
|