@odoo/o-spreadsheet 15.0.20 → 15.0.22
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 +26 -41
- package/dist/o-spreadsheet.esm.js +26 -41
- package/dist/o-spreadsheet.iife.js +26 -41
- package/dist/o-spreadsheet.iife.min.js +39 -39
- package/package.json +1 -1
|
@@ -2975,7 +2975,7 @@ function deepEquals(o1, o2) {
|
|
|
2975
2975
|
if (typeof o1 !== typeof o2)
|
|
2976
2976
|
return false;
|
|
2977
2977
|
if (typeof o1 !== "object")
|
|
2978
|
-
return
|
|
2978
|
+
return false;
|
|
2979
2979
|
// Objects can have different keys if the values are undefined
|
|
2980
2980
|
const keys = new Set();
|
|
2981
2981
|
Object.keys(o1).forEach((key) => keys.add(key));
|
|
@@ -16764,7 +16764,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
16764
16764
|
return 0 /* Success */;
|
|
16765
16765
|
}
|
|
16766
16766
|
handle(cmd) {
|
|
16767
|
-
var _a, _b;
|
|
16767
|
+
var _a, _b, _c, _d;
|
|
16768
16768
|
switch (cmd.type) {
|
|
16769
16769
|
case "COPY":
|
|
16770
16770
|
case "CUT":
|
|
@@ -16819,7 +16819,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
16819
16819
|
case "ADD_COLUMNS_ROWS": {
|
|
16820
16820
|
this.status = "invisible";
|
|
16821
16821
|
// If we add a col/row inside or before the cut area, we invalidate the clipboard
|
|
16822
|
-
if (((_a = this.state) === null || _a === void 0 ? void 0 : _a.operation) !== "CUT") {
|
|
16822
|
+
if (((_a = this.state) === null || _a === void 0 ? void 0 : _a.operation) !== "CUT" || cmd.sheetId !== ((_b = this.state) === null || _b === void 0 ? void 0 : _b.sheetId)) {
|
|
16823
16823
|
return;
|
|
16824
16824
|
}
|
|
16825
16825
|
const isClipboardDirty = this.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
|
|
@@ -16831,7 +16831,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
16831
16831
|
case "REMOVE_COLUMNS_ROWS": {
|
|
16832
16832
|
this.status = "invisible";
|
|
16833
16833
|
// If we remove a col/row inside or before the cut area, we invalidate the clipboard
|
|
16834
|
-
if (((
|
|
16834
|
+
if (((_c = this.state) === null || _c === void 0 ? void 0 : _c.operation) !== "CUT" || cmd.sheetId !== ((_d = this.state) === null || _d === void 0 ? void 0 : _d.sheetId)) {
|
|
16835
16835
|
return;
|
|
16836
16836
|
}
|
|
16837
16837
|
for (let el of cmd.elements) {
|
|
@@ -24307,10 +24307,6 @@ function extractStyle(cell, data) {
|
|
|
24307
24307
|
if (cell.style) {
|
|
24308
24308
|
style = data.styles[cell.style];
|
|
24309
24309
|
}
|
|
24310
|
-
let border = {};
|
|
24311
|
-
if (cell.border) {
|
|
24312
|
-
border = data.borders[cell.border];
|
|
24313
|
-
}
|
|
24314
24310
|
const styles = {
|
|
24315
24311
|
font: {
|
|
24316
24312
|
size: (style === null || style === void 0 ? void 0 : style.fontSize) || DEFAULT_FONT_SIZE,
|
|
@@ -24324,7 +24320,7 @@ function extractStyle(cell, data) {
|
|
|
24324
24320
|
}
|
|
24325
24321
|
: { reservedAttribute: "none" },
|
|
24326
24322
|
numFmt: cell.format,
|
|
24327
|
-
border: border ||
|
|
24323
|
+
border: cell.border || 0,
|
|
24328
24324
|
verticalAlignment: "center",
|
|
24329
24325
|
horizontalAlignment: style === null || style === void 0 ? void 0 : style.align,
|
|
24330
24326
|
};
|
|
@@ -24335,21 +24331,17 @@ function extractStyle(cell, data) {
|
|
|
24335
24331
|
return styles;
|
|
24336
24332
|
}
|
|
24337
24333
|
function normalizeStyle(construct, styles) {
|
|
24338
|
-
const { id: fontId } = pushElement(styles["font"], construct.fonts);
|
|
24339
|
-
const { id: fillId } = pushElement(styles["fill"], construct.fills);
|
|
24340
|
-
const { id: borderId } = pushElement(styles["border"], construct.borders);
|
|
24341
24334
|
// Normalize this
|
|
24342
24335
|
const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
|
|
24343
24336
|
const style = {
|
|
24344
|
-
fontId,
|
|
24345
|
-
fillId,
|
|
24346
|
-
borderId,
|
|
24337
|
+
fontId: pushElement(styles.font, construct.fonts),
|
|
24338
|
+
fillId: pushElement(styles.fill, construct.fills),
|
|
24339
|
+
borderId: styles.border,
|
|
24347
24340
|
numFmtId,
|
|
24348
24341
|
verticalAlignment: styles["verticalAlignment"],
|
|
24349
24342
|
horizontalAlignment: styles["horizontalAlignment"],
|
|
24350
24343
|
};
|
|
24351
|
-
|
|
24352
|
-
return id;
|
|
24344
|
+
return pushElement(style, construct.styles);
|
|
24353
24345
|
}
|
|
24354
24346
|
function convertFormat(format, numFmtStructure) {
|
|
24355
24347
|
if (!format) {
|
|
@@ -24357,8 +24349,7 @@ function convertFormat(format, numFmtStructure) {
|
|
|
24357
24349
|
}
|
|
24358
24350
|
let formatId = XLSX_FORMAT_MAP[format];
|
|
24359
24351
|
if (!formatId) {
|
|
24360
|
-
|
|
24361
|
-
formatId = id + FIRST_NUMFMT_ID;
|
|
24352
|
+
formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
24362
24353
|
}
|
|
24363
24354
|
return formatId;
|
|
24364
24355
|
}
|
|
@@ -24383,20 +24374,15 @@ function addRelsToFile(relsFiles, path, rel) {
|
|
|
24383
24374
|
return id;
|
|
24384
24375
|
}
|
|
24385
24376
|
function pushElement(property, propertyList) {
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24377
|
+
let len = propertyList.length;
|
|
24378
|
+
const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
|
|
24379
|
+
for (let i = 0; i < len; i++) {
|
|
24380
|
+
if (operator(property, propertyList[i])) {
|
|
24381
|
+
return i;
|
|
24389
24382
|
}
|
|
24390
24383
|
}
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
propertyList.push(property);
|
|
24394
|
-
elemId = propertyList.length - 1;
|
|
24395
|
-
}
|
|
24396
|
-
return {
|
|
24397
|
-
id: elemId,
|
|
24398
|
-
list: propertyList,
|
|
24399
|
-
};
|
|
24384
|
+
propertyList[propertyList.length] = property;
|
|
24385
|
+
return propertyList.length - 1;
|
|
24400
24386
|
}
|
|
24401
24387
|
const chartIds = [];
|
|
24402
24388
|
/**
|
|
@@ -24477,7 +24463,8 @@ function parseXML(xmlString) {
|
|
|
24477
24463
|
}
|
|
24478
24464
|
return document;
|
|
24479
24465
|
}
|
|
24480
|
-
function getDefaultXLSXStructure() {
|
|
24466
|
+
function getDefaultXLSXStructure(data) {
|
|
24467
|
+
const borders = [{}, ...Object.values(data.borders)];
|
|
24481
24468
|
return {
|
|
24482
24469
|
relsFiles: [],
|
|
24483
24470
|
sharedStrings: [],
|
|
@@ -24500,7 +24487,7 @@ function getDefaultXLSXStructure() {
|
|
|
24500
24487
|
},
|
|
24501
24488
|
],
|
|
24502
24489
|
fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
|
|
24503
|
-
borders
|
|
24490
|
+
borders,
|
|
24504
24491
|
numFmts: [],
|
|
24505
24492
|
dxfs: [],
|
|
24506
24493
|
};
|
|
@@ -24927,8 +24914,7 @@ function addContent(content, sharedStrings) {
|
|
|
24927
24914
|
attrs.push(["t", "b"]);
|
|
24928
24915
|
}
|
|
24929
24916
|
else if (!isNumber(value)) {
|
|
24930
|
-
|
|
24931
|
-
value = id.toString();
|
|
24917
|
+
value = pushElement(content, sharedStrings);
|
|
24932
24918
|
attrs.push(["t", "s"]);
|
|
24933
24919
|
}
|
|
24934
24920
|
return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
|
|
@@ -25053,8 +25039,7 @@ function addCellIsRule(cf, rule, dxfs) {
|
|
|
25053
25039
|
if (rule.style.fillColor) {
|
|
25054
25040
|
dxf.fill = { fgColor: rule.style.fillColor };
|
|
25055
25041
|
}
|
|
25056
|
-
|
|
25057
|
-
ruleAttributes.push(["dxfId", id]);
|
|
25042
|
+
ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
|
|
25058
25043
|
return escapeXml /*xml*/ `
|
|
25059
25044
|
<conditionalFormatting sqref="${cf.ranges.join(" ")}">
|
|
25060
25045
|
<cfRule ${formatAttributes(ruleAttributes)}>
|
|
@@ -25663,7 +25648,7 @@ function addMerges(merges) {
|
|
|
25663
25648
|
*/
|
|
25664
25649
|
function getXLSX(data) {
|
|
25665
25650
|
const files = [];
|
|
25666
|
-
const construct = getDefaultXLSXStructure();
|
|
25651
|
+
const construct = getDefaultXLSXStructure(data);
|
|
25667
25652
|
files.push(createWorkbook(data, construct));
|
|
25668
25653
|
files.push(...createWorksheets(data, construct));
|
|
25669
25654
|
files.push(createStylesSheet(construct));
|
|
@@ -31538,6 +31523,6 @@ exports.registries = registries;
|
|
|
31538
31523
|
exports.setTranslationMethod = setTranslationMethod;
|
|
31539
31524
|
|
|
31540
31525
|
|
|
31541
|
-
__info__.version = '15.0.
|
|
31542
|
-
__info__.date = '2024-
|
|
31543
|
-
__info__.hash = '
|
|
31526
|
+
__info__.version = '15.0.22';
|
|
31527
|
+
__info__.date = '2024-05-15T09:09:48.401Z';
|
|
31528
|
+
__info__.hash = '431bca3';
|
|
@@ -2952,7 +2952,7 @@ function deepEquals(o1, o2) {
|
|
|
2952
2952
|
if (typeof o1 !== typeof o2)
|
|
2953
2953
|
return false;
|
|
2954
2954
|
if (typeof o1 !== "object")
|
|
2955
|
-
return
|
|
2955
|
+
return false;
|
|
2956
2956
|
// Objects can have different keys if the values are undefined
|
|
2957
2957
|
const keys = new Set();
|
|
2958
2958
|
Object.keys(o1).forEach((key) => keys.add(key));
|
|
@@ -16741,7 +16741,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
16741
16741
|
return 0 /* Success */;
|
|
16742
16742
|
}
|
|
16743
16743
|
handle(cmd) {
|
|
16744
|
-
var _a, _b;
|
|
16744
|
+
var _a, _b, _c, _d;
|
|
16745
16745
|
switch (cmd.type) {
|
|
16746
16746
|
case "COPY":
|
|
16747
16747
|
case "CUT":
|
|
@@ -16796,7 +16796,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
16796
16796
|
case "ADD_COLUMNS_ROWS": {
|
|
16797
16797
|
this.status = "invisible";
|
|
16798
16798
|
// If we add a col/row inside or before the cut area, we invalidate the clipboard
|
|
16799
|
-
if (((_a = this.state) === null || _a === void 0 ? void 0 : _a.operation) !== "CUT") {
|
|
16799
|
+
if (((_a = this.state) === null || _a === void 0 ? void 0 : _a.operation) !== "CUT" || cmd.sheetId !== ((_b = this.state) === null || _b === void 0 ? void 0 : _b.sheetId)) {
|
|
16800
16800
|
return;
|
|
16801
16801
|
}
|
|
16802
16802
|
const isClipboardDirty = this.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
|
|
@@ -16808,7 +16808,7 @@ class ClipboardPlugin extends UIPlugin {
|
|
|
16808
16808
|
case "REMOVE_COLUMNS_ROWS": {
|
|
16809
16809
|
this.status = "invisible";
|
|
16810
16810
|
// If we remove a col/row inside or before the cut area, we invalidate the clipboard
|
|
16811
|
-
if (((
|
|
16811
|
+
if (((_c = this.state) === null || _c === void 0 ? void 0 : _c.operation) !== "CUT" || cmd.sheetId !== ((_d = this.state) === null || _d === void 0 ? void 0 : _d.sheetId)) {
|
|
16812
16812
|
return;
|
|
16813
16813
|
}
|
|
16814
16814
|
for (let el of cmd.elements) {
|
|
@@ -24284,10 +24284,6 @@ function extractStyle(cell, data) {
|
|
|
24284
24284
|
if (cell.style) {
|
|
24285
24285
|
style = data.styles[cell.style];
|
|
24286
24286
|
}
|
|
24287
|
-
let border = {};
|
|
24288
|
-
if (cell.border) {
|
|
24289
|
-
border = data.borders[cell.border];
|
|
24290
|
-
}
|
|
24291
24287
|
const styles = {
|
|
24292
24288
|
font: {
|
|
24293
24289
|
size: (style === null || style === void 0 ? void 0 : style.fontSize) || DEFAULT_FONT_SIZE,
|
|
@@ -24301,7 +24297,7 @@ function extractStyle(cell, data) {
|
|
|
24301
24297
|
}
|
|
24302
24298
|
: { reservedAttribute: "none" },
|
|
24303
24299
|
numFmt: cell.format,
|
|
24304
|
-
border: border ||
|
|
24300
|
+
border: cell.border || 0,
|
|
24305
24301
|
verticalAlignment: "center",
|
|
24306
24302
|
horizontalAlignment: style === null || style === void 0 ? void 0 : style.align,
|
|
24307
24303
|
};
|
|
@@ -24312,21 +24308,17 @@ function extractStyle(cell, data) {
|
|
|
24312
24308
|
return styles;
|
|
24313
24309
|
}
|
|
24314
24310
|
function normalizeStyle(construct, styles) {
|
|
24315
|
-
const { id: fontId } = pushElement(styles["font"], construct.fonts);
|
|
24316
|
-
const { id: fillId } = pushElement(styles["fill"], construct.fills);
|
|
24317
|
-
const { id: borderId } = pushElement(styles["border"], construct.borders);
|
|
24318
24311
|
// Normalize this
|
|
24319
24312
|
const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
|
|
24320
24313
|
const style = {
|
|
24321
|
-
fontId,
|
|
24322
|
-
fillId,
|
|
24323
|
-
borderId,
|
|
24314
|
+
fontId: pushElement(styles.font, construct.fonts),
|
|
24315
|
+
fillId: pushElement(styles.fill, construct.fills),
|
|
24316
|
+
borderId: styles.border,
|
|
24324
24317
|
numFmtId,
|
|
24325
24318
|
verticalAlignment: styles["verticalAlignment"],
|
|
24326
24319
|
horizontalAlignment: styles["horizontalAlignment"],
|
|
24327
24320
|
};
|
|
24328
|
-
|
|
24329
|
-
return id;
|
|
24321
|
+
return pushElement(style, construct.styles);
|
|
24330
24322
|
}
|
|
24331
24323
|
function convertFormat(format, numFmtStructure) {
|
|
24332
24324
|
if (!format) {
|
|
@@ -24334,8 +24326,7 @@ function convertFormat(format, numFmtStructure) {
|
|
|
24334
24326
|
}
|
|
24335
24327
|
let formatId = XLSX_FORMAT_MAP[format];
|
|
24336
24328
|
if (!formatId) {
|
|
24337
|
-
|
|
24338
|
-
formatId = id + FIRST_NUMFMT_ID;
|
|
24329
|
+
formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
24339
24330
|
}
|
|
24340
24331
|
return formatId;
|
|
24341
24332
|
}
|
|
@@ -24360,20 +24351,15 @@ function addRelsToFile(relsFiles, path, rel) {
|
|
|
24360
24351
|
return id;
|
|
24361
24352
|
}
|
|
24362
24353
|
function pushElement(property, propertyList) {
|
|
24363
|
-
|
|
24364
|
-
|
|
24365
|
-
|
|
24354
|
+
let len = propertyList.length;
|
|
24355
|
+
const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
|
|
24356
|
+
for (let i = 0; i < len; i++) {
|
|
24357
|
+
if (operator(property, propertyList[i])) {
|
|
24358
|
+
return i;
|
|
24366
24359
|
}
|
|
24367
24360
|
}
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
propertyList.push(property);
|
|
24371
|
-
elemId = propertyList.length - 1;
|
|
24372
|
-
}
|
|
24373
|
-
return {
|
|
24374
|
-
id: elemId,
|
|
24375
|
-
list: propertyList,
|
|
24376
|
-
};
|
|
24361
|
+
propertyList[propertyList.length] = property;
|
|
24362
|
+
return propertyList.length - 1;
|
|
24377
24363
|
}
|
|
24378
24364
|
const chartIds = [];
|
|
24379
24365
|
/**
|
|
@@ -24454,7 +24440,8 @@ function parseXML(xmlString) {
|
|
|
24454
24440
|
}
|
|
24455
24441
|
return document;
|
|
24456
24442
|
}
|
|
24457
|
-
function getDefaultXLSXStructure() {
|
|
24443
|
+
function getDefaultXLSXStructure(data) {
|
|
24444
|
+
const borders = [{}, ...Object.values(data.borders)];
|
|
24458
24445
|
return {
|
|
24459
24446
|
relsFiles: [],
|
|
24460
24447
|
sharedStrings: [],
|
|
@@ -24477,7 +24464,7 @@ function getDefaultXLSXStructure() {
|
|
|
24477
24464
|
},
|
|
24478
24465
|
],
|
|
24479
24466
|
fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
|
|
24480
|
-
borders
|
|
24467
|
+
borders,
|
|
24481
24468
|
numFmts: [],
|
|
24482
24469
|
dxfs: [],
|
|
24483
24470
|
};
|
|
@@ -24904,8 +24891,7 @@ function addContent(content, sharedStrings) {
|
|
|
24904
24891
|
attrs.push(["t", "b"]);
|
|
24905
24892
|
}
|
|
24906
24893
|
else if (!isNumber(value)) {
|
|
24907
|
-
|
|
24908
|
-
value = id.toString();
|
|
24894
|
+
value = pushElement(content, sharedStrings);
|
|
24909
24895
|
attrs.push(["t", "s"]);
|
|
24910
24896
|
}
|
|
24911
24897
|
return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
|
|
@@ -25030,8 +25016,7 @@ function addCellIsRule(cf, rule, dxfs) {
|
|
|
25030
25016
|
if (rule.style.fillColor) {
|
|
25031
25017
|
dxf.fill = { fgColor: rule.style.fillColor };
|
|
25032
25018
|
}
|
|
25033
|
-
|
|
25034
|
-
ruleAttributes.push(["dxfId", id]);
|
|
25019
|
+
ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
|
|
25035
25020
|
return escapeXml /*xml*/ `
|
|
25036
25021
|
<conditionalFormatting sqref="${cf.ranges.join(" ")}">
|
|
25037
25022
|
<cfRule ${formatAttributes(ruleAttributes)}>
|
|
@@ -25640,7 +25625,7 @@ function addMerges(merges) {
|
|
|
25640
25625
|
*/
|
|
25641
25626
|
function getXLSX(data) {
|
|
25642
25627
|
const files = [];
|
|
25643
|
-
const construct = getDefaultXLSXStructure();
|
|
25628
|
+
const construct = getDefaultXLSXStructure(data);
|
|
25644
25629
|
files.push(createWorkbook(data, construct));
|
|
25645
25630
|
files.push(...createWorksheets(data, construct));
|
|
25646
25631
|
files.push(createStylesSheet(construct));
|
|
@@ -31493,6 +31478,6 @@ const helpers = {
|
|
|
31493
31478
|
export { CommandResult, CorePlugin, DATETIME_FORMAT, DataSource, DispatchResult, Model, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, DEBUG as __DEBUG__, __info__, astToFormula, cellTypes, convertAstNodes, coreTypes, functionCache, helpers, invalidateEvaluationCommands, normalize, parse, readonlyAllowedCommands, registries, setTranslationMethod };
|
|
31494
31479
|
|
|
31495
31480
|
|
|
31496
|
-
__info__.version = '15.0.
|
|
31497
|
-
__info__.date = '2024-
|
|
31498
|
-
__info__.hash = '
|
|
31481
|
+
__info__.version = '15.0.22';
|
|
31482
|
+
__info__.date = '2024-05-15T09:09:48.401Z';
|
|
31483
|
+
__info__.hash = '431bca3';
|
|
@@ -2972,7 +2972,7 @@
|
|
|
2972
2972
|
if (typeof o1 !== typeof o2)
|
|
2973
2973
|
return false;
|
|
2974
2974
|
if (typeof o1 !== "object")
|
|
2975
|
-
return
|
|
2975
|
+
return false;
|
|
2976
2976
|
// Objects can have different keys if the values are undefined
|
|
2977
2977
|
const keys = new Set();
|
|
2978
2978
|
Object.keys(o1).forEach((key) => keys.add(key));
|
|
@@ -16761,7 +16761,7 @@
|
|
|
16761
16761
|
return 0 /* Success */;
|
|
16762
16762
|
}
|
|
16763
16763
|
handle(cmd) {
|
|
16764
|
-
var _a, _b;
|
|
16764
|
+
var _a, _b, _c, _d;
|
|
16765
16765
|
switch (cmd.type) {
|
|
16766
16766
|
case "COPY":
|
|
16767
16767
|
case "CUT":
|
|
@@ -16816,7 +16816,7 @@
|
|
|
16816
16816
|
case "ADD_COLUMNS_ROWS": {
|
|
16817
16817
|
this.status = "invisible";
|
|
16818
16818
|
// If we add a col/row inside or before the cut area, we invalidate the clipboard
|
|
16819
|
-
if (((_a = this.state) === null || _a === void 0 ? void 0 : _a.operation) !== "CUT") {
|
|
16819
|
+
if (((_a = this.state) === null || _a === void 0 ? void 0 : _a.operation) !== "CUT" || cmd.sheetId !== ((_b = this.state) === null || _b === void 0 ? void 0 : _b.sheetId)) {
|
|
16820
16820
|
return;
|
|
16821
16821
|
}
|
|
16822
16822
|
const isClipboardDirty = this.isColRowDirtyingClipboard(cmd.position === "before" ? cmd.base : cmd.base + 1, cmd.dimension);
|
|
@@ -16828,7 +16828,7 @@
|
|
|
16828
16828
|
case "REMOVE_COLUMNS_ROWS": {
|
|
16829
16829
|
this.status = "invisible";
|
|
16830
16830
|
// If we remove a col/row inside or before the cut area, we invalidate the clipboard
|
|
16831
|
-
if (((
|
|
16831
|
+
if (((_c = this.state) === null || _c === void 0 ? void 0 : _c.operation) !== "CUT" || cmd.sheetId !== ((_d = this.state) === null || _d === void 0 ? void 0 : _d.sheetId)) {
|
|
16832
16832
|
return;
|
|
16833
16833
|
}
|
|
16834
16834
|
for (let el of cmd.elements) {
|
|
@@ -24304,10 +24304,6 @@
|
|
|
24304
24304
|
if (cell.style) {
|
|
24305
24305
|
style = data.styles[cell.style];
|
|
24306
24306
|
}
|
|
24307
|
-
let border = {};
|
|
24308
|
-
if (cell.border) {
|
|
24309
|
-
border = data.borders[cell.border];
|
|
24310
|
-
}
|
|
24311
24307
|
const styles = {
|
|
24312
24308
|
font: {
|
|
24313
24309
|
size: (style === null || style === void 0 ? void 0 : style.fontSize) || DEFAULT_FONT_SIZE,
|
|
@@ -24321,7 +24317,7 @@
|
|
|
24321
24317
|
}
|
|
24322
24318
|
: { reservedAttribute: "none" },
|
|
24323
24319
|
numFmt: cell.format,
|
|
24324
|
-
border: border ||
|
|
24320
|
+
border: cell.border || 0,
|
|
24325
24321
|
verticalAlignment: "center",
|
|
24326
24322
|
horizontalAlignment: style === null || style === void 0 ? void 0 : style.align,
|
|
24327
24323
|
};
|
|
@@ -24332,21 +24328,17 @@
|
|
|
24332
24328
|
return styles;
|
|
24333
24329
|
}
|
|
24334
24330
|
function normalizeStyle(construct, styles) {
|
|
24335
|
-
const { id: fontId } = pushElement(styles["font"], construct.fonts);
|
|
24336
|
-
const { id: fillId } = pushElement(styles["fill"], construct.fills);
|
|
24337
|
-
const { id: borderId } = pushElement(styles["border"], construct.borders);
|
|
24338
24331
|
// Normalize this
|
|
24339
24332
|
const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
|
|
24340
24333
|
const style = {
|
|
24341
|
-
fontId,
|
|
24342
|
-
fillId,
|
|
24343
|
-
borderId,
|
|
24334
|
+
fontId: pushElement(styles.font, construct.fonts),
|
|
24335
|
+
fillId: pushElement(styles.fill, construct.fills),
|
|
24336
|
+
borderId: styles.border,
|
|
24344
24337
|
numFmtId,
|
|
24345
24338
|
verticalAlignment: styles["verticalAlignment"],
|
|
24346
24339
|
horizontalAlignment: styles["horizontalAlignment"],
|
|
24347
24340
|
};
|
|
24348
|
-
|
|
24349
|
-
return id;
|
|
24341
|
+
return pushElement(style, construct.styles);
|
|
24350
24342
|
}
|
|
24351
24343
|
function convertFormat(format, numFmtStructure) {
|
|
24352
24344
|
if (!format) {
|
|
@@ -24354,8 +24346,7 @@
|
|
|
24354
24346
|
}
|
|
24355
24347
|
let formatId = XLSX_FORMAT_MAP[format];
|
|
24356
24348
|
if (!formatId) {
|
|
24357
|
-
|
|
24358
|
-
formatId = id + FIRST_NUMFMT_ID;
|
|
24349
|
+
formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
24359
24350
|
}
|
|
24360
24351
|
return formatId;
|
|
24361
24352
|
}
|
|
@@ -24380,20 +24371,15 @@
|
|
|
24380
24371
|
return id;
|
|
24381
24372
|
}
|
|
24382
24373
|
function pushElement(property, propertyList) {
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24374
|
+
let len = propertyList.length;
|
|
24375
|
+
const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
|
|
24376
|
+
for (let i = 0; i < len; i++) {
|
|
24377
|
+
if (operator(property, propertyList[i])) {
|
|
24378
|
+
return i;
|
|
24386
24379
|
}
|
|
24387
24380
|
}
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
propertyList.push(property);
|
|
24391
|
-
elemId = propertyList.length - 1;
|
|
24392
|
-
}
|
|
24393
|
-
return {
|
|
24394
|
-
id: elemId,
|
|
24395
|
-
list: propertyList,
|
|
24396
|
-
};
|
|
24381
|
+
propertyList[propertyList.length] = property;
|
|
24382
|
+
return propertyList.length - 1;
|
|
24397
24383
|
}
|
|
24398
24384
|
const chartIds = [];
|
|
24399
24385
|
/**
|
|
@@ -24474,7 +24460,8 @@
|
|
|
24474
24460
|
}
|
|
24475
24461
|
return document;
|
|
24476
24462
|
}
|
|
24477
|
-
function getDefaultXLSXStructure() {
|
|
24463
|
+
function getDefaultXLSXStructure(data) {
|
|
24464
|
+
const borders = [{}, ...Object.values(data.borders)];
|
|
24478
24465
|
return {
|
|
24479
24466
|
relsFiles: [],
|
|
24480
24467
|
sharedStrings: [],
|
|
@@ -24497,7 +24484,7 @@
|
|
|
24497
24484
|
},
|
|
24498
24485
|
],
|
|
24499
24486
|
fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
|
|
24500
|
-
borders
|
|
24487
|
+
borders,
|
|
24501
24488
|
numFmts: [],
|
|
24502
24489
|
dxfs: [],
|
|
24503
24490
|
};
|
|
@@ -24924,8 +24911,7 @@
|
|
|
24924
24911
|
attrs.push(["t", "b"]);
|
|
24925
24912
|
}
|
|
24926
24913
|
else if (!isNumber(value)) {
|
|
24927
|
-
|
|
24928
|
-
value = id.toString();
|
|
24914
|
+
value = pushElement(content, sharedStrings);
|
|
24929
24915
|
attrs.push(["t", "s"]);
|
|
24930
24916
|
}
|
|
24931
24917
|
return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
|
|
@@ -25050,8 +25036,7 @@
|
|
|
25050
25036
|
if (rule.style.fillColor) {
|
|
25051
25037
|
dxf.fill = { fgColor: rule.style.fillColor };
|
|
25052
25038
|
}
|
|
25053
|
-
|
|
25054
|
-
ruleAttributes.push(["dxfId", id]);
|
|
25039
|
+
ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
|
|
25055
25040
|
return escapeXml /*xml*/ `
|
|
25056
25041
|
<conditionalFormatting sqref="${cf.ranges.join(" ")}">
|
|
25057
25042
|
<cfRule ${formatAttributes(ruleAttributes)}>
|
|
@@ -25660,7 +25645,7 @@
|
|
|
25660
25645
|
*/
|
|
25661
25646
|
function getXLSX(data) {
|
|
25662
25647
|
const files = [];
|
|
25663
|
-
const construct = getDefaultXLSXStructure();
|
|
25648
|
+
const construct = getDefaultXLSXStructure(data);
|
|
25664
25649
|
files.push(createWorkbook(data, construct));
|
|
25665
25650
|
files.push(...createWorksheets(data, construct));
|
|
25666
25651
|
files.push(createStylesSheet(construct));
|
|
@@ -31537,9 +31522,9 @@
|
|
|
31537
31522
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
31538
31523
|
|
|
31539
31524
|
|
|
31540
|
-
__info__.version = '15.0.
|
|
31541
|
-
__info__.date = '2024-
|
|
31542
|
-
__info__.hash = '
|
|
31525
|
+
__info__.version = '15.0.22';
|
|
31526
|
+
__info__.date = '2024-05-15T09:09:48.401Z';
|
|
31527
|
+
__info__.hash = '431bca3';
|
|
31543
31528
|
|
|
31544
31529
|
|
|
31545
31530
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|