@odoo/o-spreadsheet 16.3.2 → 16.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 +90 -54
- package/dist/o-spreadsheet.d.ts +168 -165
- package/dist/o-spreadsheet.esm.js +90 -54
- package/dist/o-spreadsheet.iife.js +90 -54
- package/dist/o-spreadsheet.iife.min.js +266 -264
- package/package.json +4 -4
- package/readme.md +8 -7
|
@@ -750,12 +750,20 @@ function getDefaultCellHeight(cell) {
|
|
|
750
750
|
return computeTextLinesHeight(fontSize, numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
751
751
|
}
|
|
752
752
|
function computeTextWidth(context, text, style) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
753
|
+
const font = computeTextFont(style);
|
|
754
|
+
if (!textWidthCache[font]) {
|
|
755
|
+
textWidthCache[font] = {};
|
|
756
|
+
}
|
|
757
|
+
if (textWidthCache[font][text] === undefined) {
|
|
758
|
+
context.save();
|
|
759
|
+
context.font = font;
|
|
760
|
+
const textWidth = context.measureText(text).width;
|
|
761
|
+
context.restore();
|
|
762
|
+
textWidthCache[font][text] = textWidth;
|
|
763
|
+
}
|
|
764
|
+
return textWidthCache[font][text];
|
|
758
765
|
}
|
|
766
|
+
const textWidthCache = {};
|
|
759
767
|
function fontSizeInPixels(fontSize) {
|
|
760
768
|
return Math.round((fontSize * 96) / 72);
|
|
761
769
|
}
|
|
@@ -1773,6 +1781,7 @@ function removeTrailingZeroes(numberString) {
|
|
|
1773
1781
|
}
|
|
1774
1782
|
return numberString.slice(0, i + 1) || undefined;
|
|
1775
1783
|
}
|
|
1784
|
+
const leadingZeroesRegexp = /^0+/;
|
|
1776
1785
|
/**
|
|
1777
1786
|
* Limit the size of the decimal part of a number to the given number of digits.
|
|
1778
1787
|
*/
|
|
@@ -1783,17 +1792,24 @@ function limitDecimalDigits(decimalDigits, maxDecimals) {
|
|
|
1783
1792
|
// but it has very strange behaviour. Ex: 12.345.toFixed(2) => "12.35", but 1.345.toFixed(2) => "1.34"
|
|
1784
1793
|
let slicedDecimalDigits = decimalDigits.slice(0, maxDecimals);
|
|
1785
1794
|
const i = maxDecimals;
|
|
1786
|
-
if (Number(
|
|
1795
|
+
if (Number(decimalDigits[i]) < 5) {
|
|
1787
1796
|
return { integerDigits, decimalDigits: slicedDecimalDigits };
|
|
1788
1797
|
}
|
|
1789
1798
|
// round up
|
|
1799
|
+
const leadingZeroes = slicedDecimalDigits.match(leadingZeroesRegexp)?.[0] || "";
|
|
1790
1800
|
const slicedRoundedUp = (Number(slicedDecimalDigits) + 1).toString();
|
|
1791
|
-
|
|
1792
|
-
|
|
1801
|
+
const withoutLeadingZeroes = slicedDecimalDigits.slice(leadingZeroes.length);
|
|
1802
|
+
// e.g. carry over from 99 to 100
|
|
1803
|
+
const carryOver = slicedRoundedUp.length > withoutLeadingZeroes.length;
|
|
1804
|
+
if (carryOver && !leadingZeroes) {
|
|
1805
|
+
integerDigits = "1";
|
|
1793
1806
|
resultDecimalDigits = undefined;
|
|
1794
1807
|
}
|
|
1808
|
+
else if (carryOver) {
|
|
1809
|
+
resultDecimalDigits = leadingZeroes.slice(0, -1) + slicedRoundedUp;
|
|
1810
|
+
}
|
|
1795
1811
|
else {
|
|
1796
|
-
resultDecimalDigits = slicedRoundedUp;
|
|
1812
|
+
resultDecimalDigits = leadingZeroes + slicedRoundedUp;
|
|
1797
1813
|
}
|
|
1798
1814
|
return { integerDigits, decimalDigits: resultDecimalDigits };
|
|
1799
1815
|
}
|
|
@@ -9507,9 +9523,9 @@ const ARG_TYPES = [
|
|
|
9507
9523
|
"META",
|
|
9508
9524
|
];
|
|
9509
9525
|
function arg(definition, description = "") {
|
|
9510
|
-
return makeArg(
|
|
9526
|
+
return makeArg(definition, description);
|
|
9511
9527
|
}
|
|
9512
|
-
function makeArg(str) {
|
|
9528
|
+
function makeArg(str, description) {
|
|
9513
9529
|
let parts = str.match(ARG_REGEXP);
|
|
9514
9530
|
let name = parts[1].trim();
|
|
9515
9531
|
let types = [];
|
|
@@ -9539,7 +9555,6 @@ function makeArg(str) {
|
|
|
9539
9555
|
defaultValue = param.trim().slice(8);
|
|
9540
9556
|
}
|
|
9541
9557
|
}
|
|
9542
|
-
let description = parts[3].trim();
|
|
9543
9558
|
const result = {
|
|
9544
9559
|
name,
|
|
9545
9560
|
description,
|
|
@@ -17944,6 +17959,7 @@ css /* scss */ `
|
|
|
17944
17959
|
.o-color-picker-toggler-button {
|
|
17945
17960
|
display: flex;
|
|
17946
17961
|
.o-color-picker-toggler-sign {
|
|
17962
|
+
display: flex;
|
|
17947
17963
|
margin: auto auto;
|
|
17948
17964
|
width: 55%;
|
|
17949
17965
|
height: 55%;
|
|
@@ -20919,6 +20935,7 @@ class Composer extends Component {
|
|
|
20919
20935
|
(this.autoCompleteState.selectedIndex + 1) % this.autoCompleteState.values.length;
|
|
20920
20936
|
}
|
|
20921
20937
|
}
|
|
20938
|
+
this.updateCursorIfNeeded();
|
|
20922
20939
|
}
|
|
20923
20940
|
processTabKey(ev) {
|
|
20924
20941
|
ev.preventDefault();
|
|
@@ -20987,10 +21004,12 @@ class Composer extends Component {
|
|
|
20987
21004
|
}
|
|
20988
21005
|
else {
|
|
20989
21006
|
ev.stopPropagation();
|
|
21007
|
+
this.updateCursorIfNeeded();
|
|
20990
21008
|
}
|
|
20991
|
-
|
|
20992
|
-
|
|
20993
|
-
|
|
21009
|
+
}
|
|
21010
|
+
updateCursorIfNeeded() {
|
|
21011
|
+
if (!this.env.model.getters.isSelectingForComposer()) {
|
|
21012
|
+
const { start, end } = this.contentHelper.getCurrentSelection();
|
|
20994
21013
|
this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", { start, end });
|
|
20995
21014
|
this.isKeyStillDown = true;
|
|
20996
21015
|
}
|
|
@@ -21048,7 +21067,12 @@ class Composer extends Component {
|
|
|
21048
21067
|
};
|
|
21049
21068
|
});
|
|
21050
21069
|
if (searchTerm) {
|
|
21051
|
-
|
|
21070
|
+
if (searchTerm.toLowerCase() === "true" || searchTerm.toLowerCase() === "false") {
|
|
21071
|
+
values = [];
|
|
21072
|
+
}
|
|
21073
|
+
else {
|
|
21074
|
+
values = fuzzyLookup(searchTerm, values, (t) => t.text);
|
|
21075
|
+
}
|
|
21052
21076
|
}
|
|
21053
21077
|
else {
|
|
21054
21078
|
// alphabetical order
|
|
@@ -30631,7 +30655,14 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30631
30655
|
this.history.update("tables", filterTables);
|
|
30632
30656
|
break;
|
|
30633
30657
|
case "DUPLICATE_SHEET":
|
|
30634
|
-
|
|
30658
|
+
const tables = {};
|
|
30659
|
+
for (const filterTable of Object.values(this.tables[cmd.sheetId] || {})) {
|
|
30660
|
+
if (filterTable) {
|
|
30661
|
+
const newFilterTable = deepCopy(filterTable);
|
|
30662
|
+
tables[newFilterTable.id] = newFilterTable;
|
|
30663
|
+
}
|
|
30664
|
+
}
|
|
30665
|
+
this.history.update("tables", cmd.sheetIdTo, tables);
|
|
30635
30666
|
break;
|
|
30636
30667
|
case "ADD_COLUMNS_ROWS":
|
|
30637
30668
|
this.onAddColumnsRows(cmd);
|
|
@@ -34180,6 +34211,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
34180
34211
|
}
|
|
34181
34212
|
exportForExcel(data) {
|
|
34182
34213
|
for (const sheetData of data.sheets) {
|
|
34214
|
+
const sheetId = sheetData.id;
|
|
34183
34215
|
for (const tableData of sheetData.filterTables) {
|
|
34184
34216
|
const tableZone = toZone(tableData.range);
|
|
34185
34217
|
const filters = [];
|
|
@@ -34195,20 +34227,20 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
34195
34227
|
if (!filter)
|
|
34196
34228
|
continue;
|
|
34197
34229
|
const valuesInFilterZone = filter.filteredZone
|
|
34198
|
-
? positions(filter.filteredZone)
|
|
34199
|
-
.map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId: sheetData.id, col, row }))
|
|
34200
|
-
.filter((cell) => cell.type !== CellValueType.empty)
|
|
34201
|
-
.map((cell) => cell.formattedValue)
|
|
34230
|
+
? positions(filter.filteredZone).map((position) => this.getters.getEvaluatedCell({ sheetId, ...position }).formattedValue)
|
|
34202
34231
|
: [];
|
|
34203
|
-
|
|
34204
|
-
|
|
34205
|
-
|
|
34206
|
-
|
|
34207
|
-
|
|
34208
|
-
|
|
34209
|
-
|
|
34210
|
-
|
|
34211
|
-
|
|
34232
|
+
if (filteredValues.length) {
|
|
34233
|
+
const xlsxDisplayedValues = valuesInFilterZone
|
|
34234
|
+
.filter((val) => val)
|
|
34235
|
+
.filter((val) => !filteredValues.includes(val));
|
|
34236
|
+
filters.push({
|
|
34237
|
+
colId: i,
|
|
34238
|
+
displayedValues: [...new Set(xlsxDisplayedValues)],
|
|
34239
|
+
displayBlanks: !filteredValues.includes("") && valuesInFilterZone.some((val) => !val),
|
|
34240
|
+
});
|
|
34241
|
+
}
|
|
34242
|
+
// In xlsx, filter header should ALWAYS be a string and should be unique in the table
|
|
34243
|
+
const headerPosition = { col: filter.col, row: filter.zoneWithHeaders.top, sheetId };
|
|
34212
34244
|
const headerString = this.getters.getEvaluatedCell(headerPosition).formattedValue;
|
|
34213
34245
|
const headerName = this.getUniqueColNameForExcel(i, headerString, headerNames);
|
|
34214
34246
|
headerNames.push(headerName);
|
|
@@ -43280,11 +43312,9 @@ TopBarComposer.props = {
|
|
|
43280
43312
|
onComposerContentFocused: Function,
|
|
43281
43313
|
};
|
|
43282
43314
|
|
|
43283
|
-
// -----------------------------------------------------------------------------
|
|
43284
|
-
// TopBar
|
|
43285
|
-
// -----------------------------------------------------------------------------
|
|
43286
43315
|
css /* scss */ `
|
|
43287
43316
|
.o-font-size-editor {
|
|
43317
|
+
height: calc(100% - 4px);
|
|
43288
43318
|
input.o-font-size {
|
|
43289
43319
|
outline-color: ${SELECTION_BORDER_COLOR};
|
|
43290
43320
|
height: 20px;
|
|
@@ -43297,13 +43327,13 @@ css /* scss */ `
|
|
|
43297
43327
|
input::-webkit-inner-spin-button {
|
|
43298
43328
|
-webkit-appearance: none;
|
|
43299
43329
|
}
|
|
43300
|
-
|
|
43301
|
-
|
|
43302
|
-
|
|
43303
|
-
|
|
43304
|
-
|
|
43305
|
-
|
|
43306
|
-
|
|
43330
|
+
}
|
|
43331
|
+
.o-text-options > div {
|
|
43332
|
+
cursor: pointer;
|
|
43333
|
+
line-height: 26px;
|
|
43334
|
+
padding: 3px 12px;
|
|
43335
|
+
&:hover {
|
|
43336
|
+
background-color: rgba(0, 0, 0, 0.08);
|
|
43307
43337
|
}
|
|
43308
43338
|
}
|
|
43309
43339
|
`;
|
|
@@ -43368,6 +43398,7 @@ class FontSizeEditor extends Component {
|
|
|
43368
43398
|
FontSizeEditor.props = {
|
|
43369
43399
|
onToggle: Function,
|
|
43370
43400
|
dropdownStyle: String,
|
|
43401
|
+
class: String,
|
|
43371
43402
|
};
|
|
43372
43403
|
|
|
43373
43404
|
// -----------------------------------------------------------------------------
|
|
@@ -46536,15 +46567,10 @@ function addAutoFilter(table) {
|
|
|
46536
46567
|
`;
|
|
46537
46568
|
}
|
|
46538
46569
|
function addFilterColumns(table) {
|
|
46539
|
-
const tableZone = toZone(table.range);
|
|
46540
46570
|
const columns = [];
|
|
46541
|
-
for (const
|
|
46542
|
-
const filter = table.filters[i];
|
|
46543
|
-
if (!filter || !filter.filteredValues.length) {
|
|
46544
|
-
continue;
|
|
46545
|
-
}
|
|
46571
|
+
for (const filter of table.filters) {
|
|
46546
46572
|
const colXml = escapeXml /*xml*/ `
|
|
46547
|
-
<filterColumn ${formatAttributes([["colId",
|
|
46573
|
+
<filterColumn ${formatAttributes([["colId", filter.colId]])}>
|
|
46548
46574
|
${addFilter(filter)}
|
|
46549
46575
|
</filterColumn>
|
|
46550
46576
|
`;
|
|
@@ -46553,9 +46579,10 @@ function addFilterColumns(table) {
|
|
|
46553
46579
|
return columns;
|
|
46554
46580
|
}
|
|
46555
46581
|
function addFilter(filter) {
|
|
46556
|
-
const filterValues = filter.
|
|
46582
|
+
const filterValues = filter.displayedValues.map((val) => escapeXml /*xml*/ `<filter ${formatAttributes([["val", val]])}/>`);
|
|
46583
|
+
const filterAttributes = filter.displayBlanks ? [["blank", 1]] : [];
|
|
46557
46584
|
return escapeXml /*xml*/ `
|
|
46558
|
-
<filters>
|
|
46585
|
+
<filters ${formatAttributes(filterAttributes)}>
|
|
46559
46586
|
${joinXmlNodes(filterValues)}
|
|
46560
46587
|
</filters>
|
|
46561
46588
|
`;
|
|
@@ -46674,8 +46701,13 @@ function addHyperlinks(construct, data, sheetIndex) {
|
|
|
46674
46701
|
const sheetId = parseSheetUrl(url);
|
|
46675
46702
|
const sheet = data.sheets.find((sheet) => sheet.id === sheetId);
|
|
46676
46703
|
const location = sheet ? `${sheet.name}!A1` : INCORRECT_RANGE_STRING;
|
|
46704
|
+
const hyperlinkAttributes = [
|
|
46705
|
+
["display", label],
|
|
46706
|
+
["location", location],
|
|
46707
|
+
["ref", xc],
|
|
46708
|
+
];
|
|
46677
46709
|
linkNodes.push(escapeXml /*xml*/ `
|
|
46678
|
-
<hyperlink
|
|
46710
|
+
<hyperlink ${formatAttributes(hyperlinkAttributes)}/>
|
|
46679
46711
|
`);
|
|
46680
46712
|
}
|
|
46681
46713
|
else {
|
|
@@ -46684,8 +46716,12 @@ function addHyperlinks(construct, data, sheetIndex) {
|
|
|
46684
46716
|
type: XLSX_RELATION_TYPE.hyperlink,
|
|
46685
46717
|
targetMode: "External",
|
|
46686
46718
|
});
|
|
46719
|
+
const hyperlinkAttributes = [
|
|
46720
|
+
["r:id", linkRelId],
|
|
46721
|
+
["ref", xc],
|
|
46722
|
+
];
|
|
46687
46723
|
linkNodes.push(escapeXml /*xml*/ `
|
|
46688
|
-
<hyperlink
|
|
46724
|
+
<hyperlink ${formatAttributes(hyperlinkAttributes)}/>
|
|
46689
46725
|
`);
|
|
46690
46726
|
}
|
|
46691
46727
|
}
|
|
@@ -47565,6 +47601,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
47565
47601
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
47566
47602
|
|
|
47567
47603
|
|
|
47568
|
-
__info__.version = '16.3.
|
|
47569
|
-
__info__.date = '2023-06-
|
|
47570
|
-
__info__.hash = '
|
|
47604
|
+
__info__.version = '16.3.4';
|
|
47605
|
+
__info__.date = '2023-06-26T14:34:27.019Z';
|
|
47606
|
+
__info__.hash = '94f9dcd';
|
|
@@ -751,12 +751,20 @@
|
|
|
751
751
|
return computeTextLinesHeight(fontSize, numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
752
752
|
}
|
|
753
753
|
function computeTextWidth(context, text, style) {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
754
|
+
const font = computeTextFont(style);
|
|
755
|
+
if (!textWidthCache[font]) {
|
|
756
|
+
textWidthCache[font] = {};
|
|
757
|
+
}
|
|
758
|
+
if (textWidthCache[font][text] === undefined) {
|
|
759
|
+
context.save();
|
|
760
|
+
context.font = font;
|
|
761
|
+
const textWidth = context.measureText(text).width;
|
|
762
|
+
context.restore();
|
|
763
|
+
textWidthCache[font][text] = textWidth;
|
|
764
|
+
}
|
|
765
|
+
return textWidthCache[font][text];
|
|
759
766
|
}
|
|
767
|
+
const textWidthCache = {};
|
|
760
768
|
function fontSizeInPixels(fontSize) {
|
|
761
769
|
return Math.round((fontSize * 96) / 72);
|
|
762
770
|
}
|
|
@@ -1774,6 +1782,7 @@
|
|
|
1774
1782
|
}
|
|
1775
1783
|
return numberString.slice(0, i + 1) || undefined;
|
|
1776
1784
|
}
|
|
1785
|
+
const leadingZeroesRegexp = /^0+/;
|
|
1777
1786
|
/**
|
|
1778
1787
|
* Limit the size of the decimal part of a number to the given number of digits.
|
|
1779
1788
|
*/
|
|
@@ -1784,17 +1793,24 @@
|
|
|
1784
1793
|
// but it has very strange behaviour. Ex: 12.345.toFixed(2) => "12.35", but 1.345.toFixed(2) => "1.34"
|
|
1785
1794
|
let slicedDecimalDigits = decimalDigits.slice(0, maxDecimals);
|
|
1786
1795
|
const i = maxDecimals;
|
|
1787
|
-
if (Number(
|
|
1796
|
+
if (Number(decimalDigits[i]) < 5) {
|
|
1788
1797
|
return { integerDigits, decimalDigits: slicedDecimalDigits };
|
|
1789
1798
|
}
|
|
1790
1799
|
// round up
|
|
1800
|
+
const leadingZeroes = slicedDecimalDigits.match(leadingZeroesRegexp)?.[0] || "";
|
|
1791
1801
|
const slicedRoundedUp = (Number(slicedDecimalDigits) + 1).toString();
|
|
1792
|
-
|
|
1793
|
-
|
|
1802
|
+
const withoutLeadingZeroes = slicedDecimalDigits.slice(leadingZeroes.length);
|
|
1803
|
+
// e.g. carry over from 99 to 100
|
|
1804
|
+
const carryOver = slicedRoundedUp.length > withoutLeadingZeroes.length;
|
|
1805
|
+
if (carryOver && !leadingZeroes) {
|
|
1806
|
+
integerDigits = "1";
|
|
1794
1807
|
resultDecimalDigits = undefined;
|
|
1795
1808
|
}
|
|
1809
|
+
else if (carryOver) {
|
|
1810
|
+
resultDecimalDigits = leadingZeroes.slice(0, -1) + slicedRoundedUp;
|
|
1811
|
+
}
|
|
1796
1812
|
else {
|
|
1797
|
-
resultDecimalDigits = slicedRoundedUp;
|
|
1813
|
+
resultDecimalDigits = leadingZeroes + slicedRoundedUp;
|
|
1798
1814
|
}
|
|
1799
1815
|
return { integerDigits, decimalDigits: resultDecimalDigits };
|
|
1800
1816
|
}
|
|
@@ -9508,9 +9524,9 @@
|
|
|
9508
9524
|
"META",
|
|
9509
9525
|
];
|
|
9510
9526
|
function arg(definition, description = "") {
|
|
9511
|
-
return makeArg(
|
|
9527
|
+
return makeArg(definition, description);
|
|
9512
9528
|
}
|
|
9513
|
-
function makeArg(str) {
|
|
9529
|
+
function makeArg(str, description) {
|
|
9514
9530
|
let parts = str.match(ARG_REGEXP);
|
|
9515
9531
|
let name = parts[1].trim();
|
|
9516
9532
|
let types = [];
|
|
@@ -9540,7 +9556,6 @@
|
|
|
9540
9556
|
defaultValue = param.trim().slice(8);
|
|
9541
9557
|
}
|
|
9542
9558
|
}
|
|
9543
|
-
let description = parts[3].trim();
|
|
9544
9559
|
const result = {
|
|
9545
9560
|
name,
|
|
9546
9561
|
description,
|
|
@@ -17945,6 +17960,7 @@
|
|
|
17945
17960
|
.o-color-picker-toggler-button {
|
|
17946
17961
|
display: flex;
|
|
17947
17962
|
.o-color-picker-toggler-sign {
|
|
17963
|
+
display: flex;
|
|
17948
17964
|
margin: auto auto;
|
|
17949
17965
|
width: 55%;
|
|
17950
17966
|
height: 55%;
|
|
@@ -20920,6 +20936,7 @@
|
|
|
20920
20936
|
(this.autoCompleteState.selectedIndex + 1) % this.autoCompleteState.values.length;
|
|
20921
20937
|
}
|
|
20922
20938
|
}
|
|
20939
|
+
this.updateCursorIfNeeded();
|
|
20923
20940
|
}
|
|
20924
20941
|
processTabKey(ev) {
|
|
20925
20942
|
ev.preventDefault();
|
|
@@ -20988,10 +21005,12 @@
|
|
|
20988
21005
|
}
|
|
20989
21006
|
else {
|
|
20990
21007
|
ev.stopPropagation();
|
|
21008
|
+
this.updateCursorIfNeeded();
|
|
20991
21009
|
}
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
21010
|
+
}
|
|
21011
|
+
updateCursorIfNeeded() {
|
|
21012
|
+
if (!this.env.model.getters.isSelectingForComposer()) {
|
|
21013
|
+
const { start, end } = this.contentHelper.getCurrentSelection();
|
|
20995
21014
|
this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", { start, end });
|
|
20996
21015
|
this.isKeyStillDown = true;
|
|
20997
21016
|
}
|
|
@@ -21049,7 +21068,12 @@
|
|
|
21049
21068
|
};
|
|
21050
21069
|
});
|
|
21051
21070
|
if (searchTerm) {
|
|
21052
|
-
|
|
21071
|
+
if (searchTerm.toLowerCase() === "true" || searchTerm.toLowerCase() === "false") {
|
|
21072
|
+
values = [];
|
|
21073
|
+
}
|
|
21074
|
+
else {
|
|
21075
|
+
values = fuzzyLookup(searchTerm, values, (t) => t.text);
|
|
21076
|
+
}
|
|
21053
21077
|
}
|
|
21054
21078
|
else {
|
|
21055
21079
|
// alphabetical order
|
|
@@ -30632,7 +30656,14 @@
|
|
|
30632
30656
|
this.history.update("tables", filterTables);
|
|
30633
30657
|
break;
|
|
30634
30658
|
case "DUPLICATE_SHEET":
|
|
30635
|
-
|
|
30659
|
+
const tables = {};
|
|
30660
|
+
for (const filterTable of Object.values(this.tables[cmd.sheetId] || {})) {
|
|
30661
|
+
if (filterTable) {
|
|
30662
|
+
const newFilterTable = deepCopy(filterTable);
|
|
30663
|
+
tables[newFilterTable.id] = newFilterTable;
|
|
30664
|
+
}
|
|
30665
|
+
}
|
|
30666
|
+
this.history.update("tables", cmd.sheetIdTo, tables);
|
|
30636
30667
|
break;
|
|
30637
30668
|
case "ADD_COLUMNS_ROWS":
|
|
30638
30669
|
this.onAddColumnsRows(cmd);
|
|
@@ -34181,6 +34212,7 @@
|
|
|
34181
34212
|
}
|
|
34182
34213
|
exportForExcel(data) {
|
|
34183
34214
|
for (const sheetData of data.sheets) {
|
|
34215
|
+
const sheetId = sheetData.id;
|
|
34184
34216
|
for (const tableData of sheetData.filterTables) {
|
|
34185
34217
|
const tableZone = toZone(tableData.range);
|
|
34186
34218
|
const filters = [];
|
|
@@ -34196,20 +34228,20 @@
|
|
|
34196
34228
|
if (!filter)
|
|
34197
34229
|
continue;
|
|
34198
34230
|
const valuesInFilterZone = filter.filteredZone
|
|
34199
|
-
? positions(filter.filteredZone)
|
|
34200
|
-
.map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId: sheetData.id, col, row }))
|
|
34201
|
-
.filter((cell) => cell.type !== CellValueType.empty)
|
|
34202
|
-
.map((cell) => cell.formattedValue)
|
|
34231
|
+
? positions(filter.filteredZone).map((position) => this.getters.getEvaluatedCell({ sheetId, ...position }).formattedValue)
|
|
34203
34232
|
: [];
|
|
34204
|
-
|
|
34205
|
-
|
|
34206
|
-
|
|
34207
|
-
|
|
34208
|
-
|
|
34209
|
-
|
|
34210
|
-
|
|
34211
|
-
|
|
34212
|
-
|
|
34233
|
+
if (filteredValues.length) {
|
|
34234
|
+
const xlsxDisplayedValues = valuesInFilterZone
|
|
34235
|
+
.filter((val) => val)
|
|
34236
|
+
.filter((val) => !filteredValues.includes(val));
|
|
34237
|
+
filters.push({
|
|
34238
|
+
colId: i,
|
|
34239
|
+
displayedValues: [...new Set(xlsxDisplayedValues)],
|
|
34240
|
+
displayBlanks: !filteredValues.includes("") && valuesInFilterZone.some((val) => !val),
|
|
34241
|
+
});
|
|
34242
|
+
}
|
|
34243
|
+
// In xlsx, filter header should ALWAYS be a string and should be unique in the table
|
|
34244
|
+
const headerPosition = { col: filter.col, row: filter.zoneWithHeaders.top, sheetId };
|
|
34213
34245
|
const headerString = this.getters.getEvaluatedCell(headerPosition).formattedValue;
|
|
34214
34246
|
const headerName = this.getUniqueColNameForExcel(i, headerString, headerNames);
|
|
34215
34247
|
headerNames.push(headerName);
|
|
@@ -43281,11 +43313,9 @@
|
|
|
43281
43313
|
onComposerContentFocused: Function,
|
|
43282
43314
|
};
|
|
43283
43315
|
|
|
43284
|
-
// -----------------------------------------------------------------------------
|
|
43285
|
-
// TopBar
|
|
43286
|
-
// -----------------------------------------------------------------------------
|
|
43287
43316
|
css /* scss */ `
|
|
43288
43317
|
.o-font-size-editor {
|
|
43318
|
+
height: calc(100% - 4px);
|
|
43289
43319
|
input.o-font-size {
|
|
43290
43320
|
outline-color: ${SELECTION_BORDER_COLOR};
|
|
43291
43321
|
height: 20px;
|
|
@@ -43298,13 +43328,13 @@
|
|
|
43298
43328
|
input::-webkit-inner-spin-button {
|
|
43299
43329
|
-webkit-appearance: none;
|
|
43300
43330
|
}
|
|
43301
|
-
|
|
43302
|
-
|
|
43303
|
-
|
|
43304
|
-
|
|
43305
|
-
|
|
43306
|
-
|
|
43307
|
-
|
|
43331
|
+
}
|
|
43332
|
+
.o-text-options > div {
|
|
43333
|
+
cursor: pointer;
|
|
43334
|
+
line-height: 26px;
|
|
43335
|
+
padding: 3px 12px;
|
|
43336
|
+
&:hover {
|
|
43337
|
+
background-color: rgba(0, 0, 0, 0.08);
|
|
43308
43338
|
}
|
|
43309
43339
|
}
|
|
43310
43340
|
`;
|
|
@@ -43369,6 +43399,7 @@
|
|
|
43369
43399
|
FontSizeEditor.props = {
|
|
43370
43400
|
onToggle: Function,
|
|
43371
43401
|
dropdownStyle: String,
|
|
43402
|
+
class: String,
|
|
43372
43403
|
};
|
|
43373
43404
|
|
|
43374
43405
|
// -----------------------------------------------------------------------------
|
|
@@ -46537,15 +46568,10 @@
|
|
|
46537
46568
|
`;
|
|
46538
46569
|
}
|
|
46539
46570
|
function addFilterColumns(table) {
|
|
46540
|
-
const tableZone = toZone(table.range);
|
|
46541
46571
|
const columns = [];
|
|
46542
|
-
for (const
|
|
46543
|
-
const filter = table.filters[i];
|
|
46544
|
-
if (!filter || !filter.filteredValues.length) {
|
|
46545
|
-
continue;
|
|
46546
|
-
}
|
|
46572
|
+
for (const filter of table.filters) {
|
|
46547
46573
|
const colXml = escapeXml /*xml*/ `
|
|
46548
|
-
<filterColumn ${formatAttributes([["colId",
|
|
46574
|
+
<filterColumn ${formatAttributes([["colId", filter.colId]])}>
|
|
46549
46575
|
${addFilter(filter)}
|
|
46550
46576
|
</filterColumn>
|
|
46551
46577
|
`;
|
|
@@ -46554,9 +46580,10 @@
|
|
|
46554
46580
|
return columns;
|
|
46555
46581
|
}
|
|
46556
46582
|
function addFilter(filter) {
|
|
46557
|
-
const filterValues = filter.
|
|
46583
|
+
const filterValues = filter.displayedValues.map((val) => escapeXml /*xml*/ `<filter ${formatAttributes([["val", val]])}/>`);
|
|
46584
|
+
const filterAttributes = filter.displayBlanks ? [["blank", 1]] : [];
|
|
46558
46585
|
return escapeXml /*xml*/ `
|
|
46559
|
-
<filters>
|
|
46586
|
+
<filters ${formatAttributes(filterAttributes)}>
|
|
46560
46587
|
${joinXmlNodes(filterValues)}
|
|
46561
46588
|
</filters>
|
|
46562
46589
|
`;
|
|
@@ -46675,8 +46702,13 @@
|
|
|
46675
46702
|
const sheetId = parseSheetUrl(url);
|
|
46676
46703
|
const sheet = data.sheets.find((sheet) => sheet.id === sheetId);
|
|
46677
46704
|
const location = sheet ? `${sheet.name}!A1` : INCORRECT_RANGE_STRING;
|
|
46705
|
+
const hyperlinkAttributes = [
|
|
46706
|
+
["display", label],
|
|
46707
|
+
["location", location],
|
|
46708
|
+
["ref", xc],
|
|
46709
|
+
];
|
|
46678
46710
|
linkNodes.push(escapeXml /*xml*/ `
|
|
46679
|
-
<hyperlink
|
|
46711
|
+
<hyperlink ${formatAttributes(hyperlinkAttributes)}/>
|
|
46680
46712
|
`);
|
|
46681
46713
|
}
|
|
46682
46714
|
else {
|
|
@@ -46685,8 +46717,12 @@
|
|
|
46685
46717
|
type: XLSX_RELATION_TYPE.hyperlink,
|
|
46686
46718
|
targetMode: "External",
|
|
46687
46719
|
});
|
|
46720
|
+
const hyperlinkAttributes = [
|
|
46721
|
+
["r:id", linkRelId],
|
|
46722
|
+
["ref", xc],
|
|
46723
|
+
];
|
|
46688
46724
|
linkNodes.push(escapeXml /*xml*/ `
|
|
46689
|
-
<hyperlink
|
|
46725
|
+
<hyperlink ${formatAttributes(hyperlinkAttributes)}/>
|
|
46690
46726
|
`);
|
|
46691
46727
|
}
|
|
46692
46728
|
}
|
|
@@ -47596,9 +47632,9 @@
|
|
|
47596
47632
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47597
47633
|
|
|
47598
47634
|
|
|
47599
|
-
__info__.version = '16.3.
|
|
47600
|
-
__info__.date = '2023-06-
|
|
47601
|
-
__info__.hash = '
|
|
47635
|
+
__info__.version = '16.3.4';
|
|
47636
|
+
__info__.date = '2023-06-26T14:34:27.019Z';
|
|
47637
|
+
__info__.hash = '94f9dcd';
|
|
47602
47638
|
|
|
47603
47639
|
|
|
47604
47640
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|