@odoo/o-spreadsheet 17.0.17 → 17.0.18
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 +65 -56
- package/dist/o-spreadsheet.d.ts +3 -0
- package/dist/o-spreadsheet.esm.js +65 -56
- package/dist/o-spreadsheet.iife.js +65 -56
- package/dist/o-spreadsheet.iife.min.js +176 -176
- package/dist/o_spreadsheet.xml +5 -4
- 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 17.0.
|
|
6
|
-
* @date 2024-04-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.18
|
|
6
|
+
* @date 2024-04-10T13:28:23.664Z
|
|
7
|
+
* @hash 6294758
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -650,7 +650,7 @@ function deepEquals(o1, o2) {
|
|
|
650
650
|
if (typeof o1 !== typeof o2)
|
|
651
651
|
return false;
|
|
652
652
|
if (typeof o1 !== "object")
|
|
653
|
-
return
|
|
653
|
+
return false;
|
|
654
654
|
// Objects can have different keys if the values are undefined
|
|
655
655
|
for (const key in o2) {
|
|
656
656
|
if (!(key in o1) && o2[key] !== undefined) {
|
|
@@ -26964,6 +26964,11 @@ class Composer extends owl.Component {
|
|
|
26964
26964
|
}
|
|
26965
26965
|
}
|
|
26966
26966
|
}
|
|
26967
|
+
onContextMenu(ev) {
|
|
26968
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
26969
|
+
this.props.onInputContextMenu?.(ev);
|
|
26970
|
+
}
|
|
26971
|
+
}
|
|
26967
26972
|
// ---------------------------------------------------------------------------
|
|
26968
26973
|
// Private
|
|
26969
26974
|
// ---------------------------------------------------------------------------
|
|
@@ -27201,6 +27206,7 @@ Composer.props = {
|
|
|
27201
27206
|
onComposerCellFocused: { type: Function, optional: true },
|
|
27202
27207
|
onComposerContentFocused: Function,
|
|
27203
27208
|
isDefaultFocus: { type: Boolean, optional: true },
|
|
27209
|
+
onInputContextMenu: { type: Function, optional: true },
|
|
27204
27210
|
};
|
|
27205
27211
|
|
|
27206
27212
|
const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
|
|
@@ -27276,6 +27282,7 @@ class GridComposer extends owl.Component {
|
|
|
27276
27282
|
isDefaultFocus: true,
|
|
27277
27283
|
onComposerContentFocused: this.props.onComposerContentFocused,
|
|
27278
27284
|
onComposerCellFocused: this.props.onComposerCellFocused,
|
|
27285
|
+
onInputContextMenu: this.props.onInputContextMenu,
|
|
27279
27286
|
};
|
|
27280
27287
|
}
|
|
27281
27288
|
get containerStyle() {
|
|
@@ -27364,6 +27371,7 @@ GridComposer.props = {
|
|
|
27364
27371
|
onComposerContentFocused: Function,
|
|
27365
27372
|
gridDims: Object,
|
|
27366
27373
|
onComposerCellFocused: Function,
|
|
27374
|
+
onInputContextMenu: Function,
|
|
27367
27375
|
};
|
|
27368
27376
|
|
|
27369
27377
|
const CSS$1 = css /* scss */ `
|
|
@@ -31317,29 +31325,12 @@ function convertWidthFromExcel(width) {
|
|
|
31317
31325
|
return width;
|
|
31318
31326
|
return Math.round((width / WIDTH_FACTOR) * 100) / 100;
|
|
31319
31327
|
}
|
|
31320
|
-
function convertBorderDescr(descr) {
|
|
31321
|
-
if (!descr) {
|
|
31322
|
-
return undefined;
|
|
31323
|
-
}
|
|
31324
|
-
return {
|
|
31325
|
-
style: descr.style,
|
|
31326
|
-
color: { rgb: descr.color },
|
|
31327
|
-
};
|
|
31328
|
-
}
|
|
31329
31328
|
function extractStyle(cell, data) {
|
|
31330
31329
|
let style = {};
|
|
31331
31330
|
if (cell.style) {
|
|
31332
31331
|
style = data.styles[cell.style];
|
|
31333
31332
|
}
|
|
31334
31333
|
const format = extractFormat(cell, data);
|
|
31335
|
-
const exportedBorder = {};
|
|
31336
|
-
if (cell.border) {
|
|
31337
|
-
const border = data.borders[cell.border];
|
|
31338
|
-
exportedBorder.left = convertBorderDescr(border.left);
|
|
31339
|
-
exportedBorder.right = convertBorderDescr(border.right);
|
|
31340
|
-
exportedBorder.bottom = convertBorderDescr(border.bottom);
|
|
31341
|
-
exportedBorder.top = convertBorderDescr(border.top);
|
|
31342
|
-
}
|
|
31343
31334
|
const styles = {
|
|
31344
31335
|
font: {
|
|
31345
31336
|
size: style?.fontSize || DEFAULT_FONT_SIZE,
|
|
@@ -31353,7 +31344,7 @@ function extractStyle(cell, data) {
|
|
|
31353
31344
|
}
|
|
31354
31345
|
: { reservedAttribute: "none" },
|
|
31355
31346
|
numFmt: format ? { format: format, id: 0 /* id not used for export */ } : undefined,
|
|
31356
|
-
border:
|
|
31347
|
+
border: cell.border || 0,
|
|
31357
31348
|
alignment: {
|
|
31358
31349
|
horizontal: style.align,
|
|
31359
31350
|
vertical: style.verticalAlign
|
|
@@ -31375,15 +31366,12 @@ function extractFormat(cell, data) {
|
|
|
31375
31366
|
return undefined;
|
|
31376
31367
|
}
|
|
31377
31368
|
function normalizeStyle(construct, styles) {
|
|
31378
|
-
const { id: fontId } = pushElement(styles["font"], construct.fonts);
|
|
31379
|
-
const { id: fillId } = pushElement(styles["fill"], construct.fills);
|
|
31380
|
-
const { id: borderId } = pushElement(styles["border"], construct.borders);
|
|
31381
31369
|
// Normalize this
|
|
31382
31370
|
const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
|
|
31383
31371
|
const style = {
|
|
31384
|
-
fontId,
|
|
31385
|
-
fillId,
|
|
31386
|
-
borderId,
|
|
31372
|
+
fontId: pushElement(styles.font, construct.fonts),
|
|
31373
|
+
fillId: pushElement(styles.fill, construct.fills),
|
|
31374
|
+
borderId: styles.border,
|
|
31387
31375
|
numFmtId,
|
|
31388
31376
|
alignment: {
|
|
31389
31377
|
vertical: styles.alignment.vertical,
|
|
@@ -31391,8 +31379,7 @@ function normalizeStyle(construct, styles) {
|
|
|
31391
31379
|
wrapText: styles.alignment.wrapText,
|
|
31392
31380
|
},
|
|
31393
31381
|
};
|
|
31394
|
-
|
|
31395
|
-
return id;
|
|
31382
|
+
return pushElement(style, construct.styles);
|
|
31396
31383
|
}
|
|
31397
31384
|
function convertFormat(format, numFmtStructure) {
|
|
31398
31385
|
if (!format) {
|
|
@@ -31400,8 +31387,7 @@ function convertFormat(format, numFmtStructure) {
|
|
|
31400
31387
|
}
|
|
31401
31388
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
31402
31389
|
if (!formatId) {
|
|
31403
|
-
|
|
31404
|
-
formatId = id + FIRST_NUMFMT_ID;
|
|
31390
|
+
formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
31405
31391
|
}
|
|
31406
31392
|
return formatId;
|
|
31407
31393
|
}
|
|
@@ -31426,20 +31412,15 @@ function addRelsToFile(relsFiles, path, rel) {
|
|
|
31426
31412
|
return id;
|
|
31427
31413
|
}
|
|
31428
31414
|
function pushElement(property, propertyList) {
|
|
31429
|
-
|
|
31430
|
-
|
|
31431
|
-
|
|
31415
|
+
let len = propertyList.length;
|
|
31416
|
+
const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
|
|
31417
|
+
for (let i = 0; i < len; i++) {
|
|
31418
|
+
if (operator(property, propertyList[i])) {
|
|
31419
|
+
return i;
|
|
31432
31420
|
}
|
|
31433
31421
|
}
|
|
31434
|
-
|
|
31435
|
-
|
|
31436
|
-
propertyList.push(property);
|
|
31437
|
-
elemId = propertyList.length - 1;
|
|
31438
|
-
}
|
|
31439
|
-
return {
|
|
31440
|
-
id: elemId,
|
|
31441
|
-
list: propertyList,
|
|
31442
|
-
};
|
|
31422
|
+
propertyList[propertyList.length] = property;
|
|
31423
|
+
return propertyList.length - 1;
|
|
31443
31424
|
}
|
|
31444
31425
|
const chartIds = [];
|
|
31445
31426
|
/**
|
|
@@ -32160,7 +32141,25 @@ function parseXML(xmlString, mimeType = "text/xml") {
|
|
|
32160
32141
|
}
|
|
32161
32142
|
return document;
|
|
32162
32143
|
}
|
|
32163
|
-
function
|
|
32144
|
+
function convertBorderDescr(descr) {
|
|
32145
|
+
if (!descr) {
|
|
32146
|
+
return undefined;
|
|
32147
|
+
}
|
|
32148
|
+
return {
|
|
32149
|
+
style: descr.style,
|
|
32150
|
+
color: { rgb: descr.color },
|
|
32151
|
+
};
|
|
32152
|
+
}
|
|
32153
|
+
function getDefaultXLSXStructure(data) {
|
|
32154
|
+
const xlsxBorders = Object.values(data.borders).map((border) => {
|
|
32155
|
+
return {
|
|
32156
|
+
left: convertBorderDescr(border.left),
|
|
32157
|
+
right: convertBorderDescr(border.right),
|
|
32158
|
+
bottom: convertBorderDescr(border.bottom),
|
|
32159
|
+
top: convertBorderDescr(border.top),
|
|
32160
|
+
};
|
|
32161
|
+
});
|
|
32162
|
+
const borders = [{}, ...xlsxBorders];
|
|
32164
32163
|
return {
|
|
32165
32164
|
relsFiles: [],
|
|
32166
32165
|
sharedStrings: [],
|
|
@@ -32183,7 +32182,7 @@ function getDefaultXLSXStructure() {
|
|
|
32183
32182
|
},
|
|
32184
32183
|
],
|
|
32185
32184
|
fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
|
|
32186
|
-
borders
|
|
32185
|
+
borders,
|
|
32187
32186
|
numFmts: [],
|
|
32188
32187
|
dxfs: [],
|
|
32189
32188
|
};
|
|
@@ -37369,7 +37368,17 @@ class FiltersPlugin extends CorePlugin {
|
|
|
37369
37368
|
}
|
|
37370
37369
|
}
|
|
37371
37370
|
exportForExcel(data) {
|
|
37372
|
-
|
|
37371
|
+
for (const sheet of data.sheets) {
|
|
37372
|
+
for (const filterTable of this.getFilterTables(sheet.id)) {
|
|
37373
|
+
if (zoneToDimension(filterTable.zone).numberOfRows === 1) {
|
|
37374
|
+
continue;
|
|
37375
|
+
}
|
|
37376
|
+
sheet.filterTables.push({
|
|
37377
|
+
range: zoneToXc(filterTable.zone),
|
|
37378
|
+
filters: [],
|
|
37379
|
+
});
|
|
37380
|
+
}
|
|
37381
|
+
}
|
|
37373
37382
|
}
|
|
37374
37383
|
}
|
|
37375
37384
|
|
|
@@ -41098,7 +41107,9 @@ class Evaluator {
|
|
|
41098
41107
|
this.blockedArrayFormulas = new Set();
|
|
41099
41108
|
this.spreadingRelations = new SpreadingRelation();
|
|
41100
41109
|
this.formulaDependencies = lazy(() => {
|
|
41101
|
-
const dependencies = [...this.getAllCells()].flatMap((positionId) => this.getDirectDependencies(positionId)
|
|
41110
|
+
const dependencies = [...this.getAllCells()].flatMap((positionId) => this.getDirectDependencies(positionId)
|
|
41111
|
+
.filter((range) => !range.invalidSheetName && !range.invalidXc)
|
|
41112
|
+
.map((range) => ({
|
|
41102
41113
|
data: positionId,
|
|
41103
41114
|
boundingBox: {
|
|
41104
41115
|
zone: range.zone,
|
|
@@ -55236,8 +55247,7 @@ function addContent(content, sharedStrings, forceString = false) {
|
|
|
55236
55247
|
attrs.push(["t", "b"]);
|
|
55237
55248
|
}
|
|
55238
55249
|
else if (forceString || !isNumber(value, DEFAULT_LOCALE)) {
|
|
55239
|
-
|
|
55240
|
-
value = id.toString();
|
|
55250
|
+
value = pushElement(content, sharedStrings);
|
|
55241
55251
|
attrs.push(["t", "s"]);
|
|
55242
55252
|
}
|
|
55243
55253
|
return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
|
|
@@ -55362,8 +55372,7 @@ function addCellIsRule(cf, rule, dxfs) {
|
|
|
55362
55372
|
if (rule.style.fillColor) {
|
|
55363
55373
|
dxf.fill = { fgColor: { rgb: rule.style.fillColor } };
|
|
55364
55374
|
}
|
|
55365
|
-
|
|
55366
|
-
ruleAttributes.push(["dxfId", id]);
|
|
55375
|
+
ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
|
|
55367
55376
|
return escapeXml /*xml*/ `
|
|
55368
55377
|
<conditionalFormatting sqref="${cf.ranges.join(" ")}">
|
|
55369
55378
|
<cfRule ${formatAttributes(ruleAttributes)}>
|
|
@@ -56172,7 +56181,7 @@ function addSheetViews(sheet) {
|
|
|
56172
56181
|
*/
|
|
56173
56182
|
function getXLSX(data) {
|
|
56174
56183
|
const files = [];
|
|
56175
|
-
const construct = getDefaultXLSXStructure();
|
|
56184
|
+
const construct = getDefaultXLSXStructure(data);
|
|
56176
56185
|
files.push(createWorkbook(data, construct));
|
|
56177
56186
|
files.push(...createWorksheets(data, construct));
|
|
56178
56187
|
files.push(createStylesSheet(construct));
|
|
@@ -57052,6 +57061,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
57052
57061
|
exports.tokenize = tokenize;
|
|
57053
57062
|
|
|
57054
57063
|
|
|
57055
|
-
__info__.version = "17.0.
|
|
57056
|
-
__info__.date = "2024-04-
|
|
57057
|
-
__info__.hash = "
|
|
57064
|
+
__info__.version = "17.0.18";
|
|
57065
|
+
__info__.date = "2024-04-10T13:28:23.664Z";
|
|
57066
|
+
__info__.hash = "6294758";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -7207,6 +7207,7 @@ interface ComposerProps {
|
|
|
7207
7207
|
delimitation?: DOMDimension;
|
|
7208
7208
|
onComposerContentFocused: () => void;
|
|
7209
7209
|
onComposerCellFocused?: (content: String) => void;
|
|
7210
|
+
onInputContextMenu?: (event: MouseEvent) => void;
|
|
7210
7211
|
isDefaultFocus?: boolean;
|
|
7211
7212
|
}
|
|
7212
7213
|
interface ComposerState$1 {
|
|
@@ -7280,6 +7281,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
7280
7281
|
onMousedown(ev: MouseEvent): void;
|
|
7281
7282
|
onClick(): void;
|
|
7282
7283
|
onDblClick(): void;
|
|
7284
|
+
onContextMenu(ev: MouseEvent): void;
|
|
7283
7285
|
private processContent;
|
|
7284
7286
|
/**
|
|
7285
7287
|
* Get the HTML content corresponding to the current composer token, divided by lines.
|
|
@@ -7461,6 +7463,7 @@ interface Props$5 {
|
|
|
7461
7463
|
onComposerContentFocused: () => void;
|
|
7462
7464
|
onComposerCellFocused: () => void;
|
|
7463
7465
|
gridDims: DOMDimension;
|
|
7466
|
+
onInputContextMenu: (event: MouseEvent) => void;
|
|
7464
7467
|
}
|
|
7465
7468
|
/**
|
|
7466
7469
|
* This component is a composer which positions itself on the grid at the anchor cell.
|
|
@@ -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 17.0.
|
|
6
|
-
* @date 2024-04-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.18
|
|
6
|
+
* @date 2024-04-10T13:28:23.664Z
|
|
7
|
+
* @hash 6294758
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
|
|
@@ -648,7 +648,7 @@ function deepEquals(o1, o2) {
|
|
|
648
648
|
if (typeof o1 !== typeof o2)
|
|
649
649
|
return false;
|
|
650
650
|
if (typeof o1 !== "object")
|
|
651
|
-
return
|
|
651
|
+
return false;
|
|
652
652
|
// Objects can have different keys if the values are undefined
|
|
653
653
|
for (const key in o2) {
|
|
654
654
|
if (!(key in o1) && o2[key] !== undefined) {
|
|
@@ -26962,6 +26962,11 @@ class Composer extends Component {
|
|
|
26962
26962
|
}
|
|
26963
26963
|
}
|
|
26964
26964
|
}
|
|
26965
|
+
onContextMenu(ev) {
|
|
26966
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
26967
|
+
this.props.onInputContextMenu?.(ev);
|
|
26968
|
+
}
|
|
26969
|
+
}
|
|
26965
26970
|
// ---------------------------------------------------------------------------
|
|
26966
26971
|
// Private
|
|
26967
26972
|
// ---------------------------------------------------------------------------
|
|
@@ -27199,6 +27204,7 @@ Composer.props = {
|
|
|
27199
27204
|
onComposerCellFocused: { type: Function, optional: true },
|
|
27200
27205
|
onComposerContentFocused: Function,
|
|
27201
27206
|
isDefaultFocus: { type: Boolean, optional: true },
|
|
27207
|
+
onInputContextMenu: { type: Function, optional: true },
|
|
27202
27208
|
};
|
|
27203
27209
|
|
|
27204
27210
|
const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
|
|
@@ -27274,6 +27280,7 @@ class GridComposer extends Component {
|
|
|
27274
27280
|
isDefaultFocus: true,
|
|
27275
27281
|
onComposerContentFocused: this.props.onComposerContentFocused,
|
|
27276
27282
|
onComposerCellFocused: this.props.onComposerCellFocused,
|
|
27283
|
+
onInputContextMenu: this.props.onInputContextMenu,
|
|
27277
27284
|
};
|
|
27278
27285
|
}
|
|
27279
27286
|
get containerStyle() {
|
|
@@ -27362,6 +27369,7 @@ GridComposer.props = {
|
|
|
27362
27369
|
onComposerContentFocused: Function,
|
|
27363
27370
|
gridDims: Object,
|
|
27364
27371
|
onComposerCellFocused: Function,
|
|
27372
|
+
onInputContextMenu: Function,
|
|
27365
27373
|
};
|
|
27366
27374
|
|
|
27367
27375
|
const CSS$1 = css /* scss */ `
|
|
@@ -31315,29 +31323,12 @@ function convertWidthFromExcel(width) {
|
|
|
31315
31323
|
return width;
|
|
31316
31324
|
return Math.round((width / WIDTH_FACTOR) * 100) / 100;
|
|
31317
31325
|
}
|
|
31318
|
-
function convertBorderDescr(descr) {
|
|
31319
|
-
if (!descr) {
|
|
31320
|
-
return undefined;
|
|
31321
|
-
}
|
|
31322
|
-
return {
|
|
31323
|
-
style: descr.style,
|
|
31324
|
-
color: { rgb: descr.color },
|
|
31325
|
-
};
|
|
31326
|
-
}
|
|
31327
31326
|
function extractStyle(cell, data) {
|
|
31328
31327
|
let style = {};
|
|
31329
31328
|
if (cell.style) {
|
|
31330
31329
|
style = data.styles[cell.style];
|
|
31331
31330
|
}
|
|
31332
31331
|
const format = extractFormat(cell, data);
|
|
31333
|
-
const exportedBorder = {};
|
|
31334
|
-
if (cell.border) {
|
|
31335
|
-
const border = data.borders[cell.border];
|
|
31336
|
-
exportedBorder.left = convertBorderDescr(border.left);
|
|
31337
|
-
exportedBorder.right = convertBorderDescr(border.right);
|
|
31338
|
-
exportedBorder.bottom = convertBorderDescr(border.bottom);
|
|
31339
|
-
exportedBorder.top = convertBorderDescr(border.top);
|
|
31340
|
-
}
|
|
31341
31332
|
const styles = {
|
|
31342
31333
|
font: {
|
|
31343
31334
|
size: style?.fontSize || DEFAULT_FONT_SIZE,
|
|
@@ -31351,7 +31342,7 @@ function extractStyle(cell, data) {
|
|
|
31351
31342
|
}
|
|
31352
31343
|
: { reservedAttribute: "none" },
|
|
31353
31344
|
numFmt: format ? { format: format, id: 0 /* id not used for export */ } : undefined,
|
|
31354
|
-
border:
|
|
31345
|
+
border: cell.border || 0,
|
|
31355
31346
|
alignment: {
|
|
31356
31347
|
horizontal: style.align,
|
|
31357
31348
|
vertical: style.verticalAlign
|
|
@@ -31373,15 +31364,12 @@ function extractFormat(cell, data) {
|
|
|
31373
31364
|
return undefined;
|
|
31374
31365
|
}
|
|
31375
31366
|
function normalizeStyle(construct, styles) {
|
|
31376
|
-
const { id: fontId } = pushElement(styles["font"], construct.fonts);
|
|
31377
|
-
const { id: fillId } = pushElement(styles["fill"], construct.fills);
|
|
31378
|
-
const { id: borderId } = pushElement(styles["border"], construct.borders);
|
|
31379
31367
|
// Normalize this
|
|
31380
31368
|
const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
|
|
31381
31369
|
const style = {
|
|
31382
|
-
fontId,
|
|
31383
|
-
fillId,
|
|
31384
|
-
borderId,
|
|
31370
|
+
fontId: pushElement(styles.font, construct.fonts),
|
|
31371
|
+
fillId: pushElement(styles.fill, construct.fills),
|
|
31372
|
+
borderId: styles.border,
|
|
31385
31373
|
numFmtId,
|
|
31386
31374
|
alignment: {
|
|
31387
31375
|
vertical: styles.alignment.vertical,
|
|
@@ -31389,8 +31377,7 @@ function normalizeStyle(construct, styles) {
|
|
|
31389
31377
|
wrapText: styles.alignment.wrapText,
|
|
31390
31378
|
},
|
|
31391
31379
|
};
|
|
31392
|
-
|
|
31393
|
-
return id;
|
|
31380
|
+
return pushElement(style, construct.styles);
|
|
31394
31381
|
}
|
|
31395
31382
|
function convertFormat(format, numFmtStructure) {
|
|
31396
31383
|
if (!format) {
|
|
@@ -31398,8 +31385,7 @@ function convertFormat(format, numFmtStructure) {
|
|
|
31398
31385
|
}
|
|
31399
31386
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
31400
31387
|
if (!formatId) {
|
|
31401
|
-
|
|
31402
|
-
formatId = id + FIRST_NUMFMT_ID;
|
|
31388
|
+
formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
31403
31389
|
}
|
|
31404
31390
|
return formatId;
|
|
31405
31391
|
}
|
|
@@ -31424,20 +31410,15 @@ function addRelsToFile(relsFiles, path, rel) {
|
|
|
31424
31410
|
return id;
|
|
31425
31411
|
}
|
|
31426
31412
|
function pushElement(property, propertyList) {
|
|
31427
|
-
|
|
31428
|
-
|
|
31429
|
-
|
|
31413
|
+
let len = propertyList.length;
|
|
31414
|
+
const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
|
|
31415
|
+
for (let i = 0; i < len; i++) {
|
|
31416
|
+
if (operator(property, propertyList[i])) {
|
|
31417
|
+
return i;
|
|
31430
31418
|
}
|
|
31431
31419
|
}
|
|
31432
|
-
|
|
31433
|
-
|
|
31434
|
-
propertyList.push(property);
|
|
31435
|
-
elemId = propertyList.length - 1;
|
|
31436
|
-
}
|
|
31437
|
-
return {
|
|
31438
|
-
id: elemId,
|
|
31439
|
-
list: propertyList,
|
|
31440
|
-
};
|
|
31420
|
+
propertyList[propertyList.length] = property;
|
|
31421
|
+
return propertyList.length - 1;
|
|
31441
31422
|
}
|
|
31442
31423
|
const chartIds = [];
|
|
31443
31424
|
/**
|
|
@@ -32158,7 +32139,25 @@ function parseXML(xmlString, mimeType = "text/xml") {
|
|
|
32158
32139
|
}
|
|
32159
32140
|
return document;
|
|
32160
32141
|
}
|
|
32161
|
-
function
|
|
32142
|
+
function convertBorderDescr(descr) {
|
|
32143
|
+
if (!descr) {
|
|
32144
|
+
return undefined;
|
|
32145
|
+
}
|
|
32146
|
+
return {
|
|
32147
|
+
style: descr.style,
|
|
32148
|
+
color: { rgb: descr.color },
|
|
32149
|
+
};
|
|
32150
|
+
}
|
|
32151
|
+
function getDefaultXLSXStructure(data) {
|
|
32152
|
+
const xlsxBorders = Object.values(data.borders).map((border) => {
|
|
32153
|
+
return {
|
|
32154
|
+
left: convertBorderDescr(border.left),
|
|
32155
|
+
right: convertBorderDescr(border.right),
|
|
32156
|
+
bottom: convertBorderDescr(border.bottom),
|
|
32157
|
+
top: convertBorderDescr(border.top),
|
|
32158
|
+
};
|
|
32159
|
+
});
|
|
32160
|
+
const borders = [{}, ...xlsxBorders];
|
|
32162
32161
|
return {
|
|
32163
32162
|
relsFiles: [],
|
|
32164
32163
|
sharedStrings: [],
|
|
@@ -32181,7 +32180,7 @@ function getDefaultXLSXStructure() {
|
|
|
32181
32180
|
},
|
|
32182
32181
|
],
|
|
32183
32182
|
fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
|
|
32184
|
-
borders
|
|
32183
|
+
borders,
|
|
32185
32184
|
numFmts: [],
|
|
32186
32185
|
dxfs: [],
|
|
32187
32186
|
};
|
|
@@ -37367,7 +37366,17 @@ class FiltersPlugin extends CorePlugin {
|
|
|
37367
37366
|
}
|
|
37368
37367
|
}
|
|
37369
37368
|
exportForExcel(data) {
|
|
37370
|
-
|
|
37369
|
+
for (const sheet of data.sheets) {
|
|
37370
|
+
for (const filterTable of this.getFilterTables(sheet.id)) {
|
|
37371
|
+
if (zoneToDimension(filterTable.zone).numberOfRows === 1) {
|
|
37372
|
+
continue;
|
|
37373
|
+
}
|
|
37374
|
+
sheet.filterTables.push({
|
|
37375
|
+
range: zoneToXc(filterTable.zone),
|
|
37376
|
+
filters: [],
|
|
37377
|
+
});
|
|
37378
|
+
}
|
|
37379
|
+
}
|
|
37371
37380
|
}
|
|
37372
37381
|
}
|
|
37373
37382
|
|
|
@@ -41096,7 +41105,9 @@ class Evaluator {
|
|
|
41096
41105
|
this.blockedArrayFormulas = new Set();
|
|
41097
41106
|
this.spreadingRelations = new SpreadingRelation();
|
|
41098
41107
|
this.formulaDependencies = lazy(() => {
|
|
41099
|
-
const dependencies = [...this.getAllCells()].flatMap((positionId) => this.getDirectDependencies(positionId)
|
|
41108
|
+
const dependencies = [...this.getAllCells()].flatMap((positionId) => this.getDirectDependencies(positionId)
|
|
41109
|
+
.filter((range) => !range.invalidSheetName && !range.invalidXc)
|
|
41110
|
+
.map((range) => ({
|
|
41100
41111
|
data: positionId,
|
|
41101
41112
|
boundingBox: {
|
|
41102
41113
|
zone: range.zone,
|
|
@@ -55234,8 +55245,7 @@ function addContent(content, sharedStrings, forceString = false) {
|
|
|
55234
55245
|
attrs.push(["t", "b"]);
|
|
55235
55246
|
}
|
|
55236
55247
|
else if (forceString || !isNumber(value, DEFAULT_LOCALE)) {
|
|
55237
|
-
|
|
55238
|
-
value = id.toString();
|
|
55248
|
+
value = pushElement(content, sharedStrings);
|
|
55239
55249
|
attrs.push(["t", "s"]);
|
|
55240
55250
|
}
|
|
55241
55251
|
return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
|
|
@@ -55360,8 +55370,7 @@ function addCellIsRule(cf, rule, dxfs) {
|
|
|
55360
55370
|
if (rule.style.fillColor) {
|
|
55361
55371
|
dxf.fill = { fgColor: { rgb: rule.style.fillColor } };
|
|
55362
55372
|
}
|
|
55363
|
-
|
|
55364
|
-
ruleAttributes.push(["dxfId", id]);
|
|
55373
|
+
ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
|
|
55365
55374
|
return escapeXml /*xml*/ `
|
|
55366
55375
|
<conditionalFormatting sqref="${cf.ranges.join(" ")}">
|
|
55367
55376
|
<cfRule ${formatAttributes(ruleAttributes)}>
|
|
@@ -56170,7 +56179,7 @@ function addSheetViews(sheet) {
|
|
|
56170
56179
|
*/
|
|
56171
56180
|
function getXLSX(data) {
|
|
56172
56181
|
const files = [];
|
|
56173
|
-
const construct = getDefaultXLSXStructure();
|
|
56182
|
+
const construct = getDefaultXLSXStructure(data);
|
|
56174
56183
|
files.push(createWorkbook(data, construct));
|
|
56175
56184
|
files.push(...createWorksheets(data, construct));
|
|
56176
56185
|
files.push(createStylesSheet(construct));
|
|
@@ -57015,6 +57024,6 @@ const constants = {
|
|
|
57015
57024
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
57016
57025
|
|
|
57017
57026
|
|
|
57018
|
-
__info__.version = "17.0.
|
|
57019
|
-
__info__.date = "2024-04-
|
|
57020
|
-
__info__.hash = "
|
|
57027
|
+
__info__.version = "17.0.18";
|
|
57028
|
+
__info__.date = "2024-04-10T13:28:23.664Z";
|
|
57029
|
+
__info__.hash = "6294758";
|