@sheetxl/io-xlsx 0.8.0-beta.7 → 1.0.0
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/LICENSE.md +8 -7
- package/browser/esm/7rZlWcm56hn3Jmnk.mjs +7021 -0
- package/browser/esm/AZus_5slvoIVhf1u.mjs +10323 -0
- package/browser/esm/B9QfzGvsvg-V3utu.mjs +4632 -0
- package/browser/esm/{CX3yVwe-BnhCk4FY.mjs → BIR_Si489gIkGOnc.mjs} +194 -144
- package/browser/esm/BJFvc-i40R4rPZ5y.mjs +2433 -0
- package/browser/esm/{CGXxwkCRWLc0gcRQ.mjs → BX8Ebx4NC5zp7_3J.mjs} +3 -3
- package/browser/esm/{B4eKxNwxJjHLN126.mjs → Bnxw38IvtA04zXEE.mjs} +2 -2
- package/browser/esm/{DwcLXqv8-6Tl1zLO.mjs → CfVhYH77KdrR3fEK.mjs} +3 -3
- package/browser/esm/index.mjs +3 -4
- package/browser/esm/jIQks3Crw6jehdDU.mjs +2474 -0
- package/browser/esm/{DUi-V-E_AJwTIqlO.mjs → qc9hnuR2z-whY8YO.mjs} +3 -3
- package/browser/esm/wZGpmkMUubNjClhG.mjs +104 -0
- package/licenses/dependencies.txt +2 -2
- package/node/esm/{C51yFT2l-6il_xXO.mjs → BNLHWJHyy5eB0P_4.mjs} +2 -2
- package/node/esm/CVtsY2F9A9NzEGLk.mjs +2478 -0
- package/node/esm/CoeQ0LO-nNXiowwv.mjs +7284 -0
- package/node/esm/CxY3iIYLXVhCebeV.mjs +4746 -0
- package/node/esm/D2CZy9TQM9h2uqBh.mjs +2562 -0
- package/node/esm/{CMq7eF1vxibUumqT.mjs → Dm0hvKcR4xb0TV_N.mjs} +3 -3
- package/node/esm/_IA1gQ-zFQYQSZSs.mjs +6957 -0
- package/node/esm/index.mjs +65 -28
- package/node/esm/{DLBm8l0jyL2fVlxg.mjs → zZFe3mW0xjmobowq.mjs} +3 -3
- package/package.json +9 -10
- package/types/src/AutoFilterRules.d.ts +85 -22
- package/types/src/ConditionalFormatRules.d.ts +2 -2
- package/types/src/DataTableFormula.d.ts +26 -0
- package/types/src/DataValidationRules.d.ts +0 -5
- package/types/src/DefinedNameAttributes.d.ts +8 -0
- package/types/src/ExcelCalcStamp.d.ts +0 -36
- package/types/src/ExcelCompat.d.ts +15 -143
- package/types/src/ExcelFunctionFacts.d.ts +0 -272
- package/types/src/ExcelReservedNames.d.ts +0 -65
- package/types/src/KnownFonts.d.ts +37 -0
- package/types/src/LegacyFormula.d.ts +1 -46
- package/types/src/OOXMLExtensions.d.ts +30 -2
- package/types/src/PageLayoutAttributes.d.ts +8 -0
- package/types/src/Plugin.d.ts +15 -3
- package/types/src/ProtectionAttributes.d.ts +2 -2
- package/types/src/SheetKinds.d.ts +42 -0
- package/types/src/SheetViewAttributes.d.ts +4 -0
- package/types/src/SortExtent.d.ts +16 -0
- package/types/src/SourcePackage.d.ts +0 -44
- package/types/src/SparklineGroups.d.ts +52 -0
- package/types/src/Types.d.ts +13 -3
- package/types/src/XlsxHeader.d.ts +19 -0
- package/types/src/chart/ChartExXml.d.ts +38 -0
- package/types/src/chart/ChartPartXml.d.ts +47 -0
- package/types/src/chart/ChartSpaceXml.d.ts +37 -0
- package/types/src/chart/_XmlTree.d.ts +34 -0
- package/types/src/chart/_chartCodecs.d.ts +12 -0
- package/types/src/chart/_chartExCodecs.d.ts +7 -0
- package/types/src/chart/_chartExFold.d.ts +14 -0
- package/types/src/chart/_chartExMarkup.d.ts +236 -0
- package/types/src/chart/_chartExStyle.d.ts +13 -0
- package/types/src/chart/_codec.d.ts +78 -0
- package/types/src/chart/_drawingml.d.ts +10 -0
- package/types/src/chart/_xml.d.ts +70 -0
- package/types/src/pivot/PivotArea.d.ts +20 -0
- package/types/src/pivot/PivotCacheRead.d.ts +30 -0
- package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
- package/types/src/pivot/PivotFilters.d.ts +29 -0
- package/types/src/pivot/PivotFormats.d.ts +60 -0
- package/types/src/pivot/PivotTableRead.d.ts +44 -0
- package/types/src/pivot/PivotTableWrite.d.ts +13 -0
- package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
- package/types/src/pivot/_PivotTableXml.d.ts +23 -0
- package/types/src/reader/CellControls.d.ts +18 -0
- package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
- package/types/src/reader/HeaderStyles.d.ts +15 -0
- package/types/src/reader/IsoDateCell.d.ts +20 -0
- package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
- package/types/src/reader/PivotButtons.d.ts +14 -0
- package/types/src/reader/PivotCellFormats.d.ts +22 -0
- package/types/src/reader/SlicerJoin.d.ts +26 -0
- package/types/src/reader/ZipReader.d.ts +1 -1
- package/types/src/reader/_SlicerRecord.d.ts +59 -0
- package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +30 -1
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
- package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
- package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
- package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
- package/types/src/reader/domVisitors/index.d.ts +10 -36
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
- package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
- package/types/src/richValue/IRichValueHandler.d.ts +109 -0
- package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
- package/types/src/richValue/RichDataParts.d.ts +69 -0
- package/types/src/richValue/RichRecordWriter.d.ts +61 -0
- package/types/src/richValue/RichValueHandlers.d.ts +25 -0
- package/types/src/richValue/RichValueResolver.d.ts +54 -0
- package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
- package/types/src/richValue/index.d.ts +7 -0
- package/types/src/utils/DrawingMLText.d.ts +39 -0
- package/types/src/utils/FormControls.d.ts +170 -0
- package/types/src/utils/SharedNames.d.ts +13 -0
- package/types/src/utils/SpreadsheetFont.d.ts +38 -0
- package/types/src/utils/VmlNoteShapes.d.ts +25 -32
- package/types/src/utils/VmlNoteStyle.d.ts +25 -0
- package/types/src/utils/VmlPrefixes.d.ts +24 -0
- package/types/src/vba/VBAProject.d.ts +0 -19
- package/types/src/writer/EvaluationSheet.d.ts +5 -0
- package/types/src/writer/builder/Emitter.d.ts +5 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
- package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
- package/types/src/writer/builder/Types.d.ts +28 -28
- package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
- package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
- package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
- package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
- package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
- package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
- package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
- package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
- package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
- package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
- package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
- package/types/src/writer/utils/AutoFilter.d.ts +3 -3
- package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
- package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
- package/types/src/writer/utils/DateSystem.d.ts +6 -0
- package/types/src/writer/utils/DefaultRows.d.ts +22 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
- package/types/src/writer/utils/DummyFunction.d.ts +0 -25
- package/types/src/writer/utils/DxfCollector.d.ts +14 -11
- package/types/src/writer/utils/PrstGeomUtils.d.ts +14 -0
- package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
- package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
- package/types/src/writer/utils/TextUtils.d.ts +26 -2
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
- package/types/src/writer/utils/XfVariants.d.ts +61 -0
- package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
- package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
- package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
- package/browser/cjs/CDs8etXnw0kbBKKv.cjs +0 -1
- package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
- package/browser/cjs/CycnxkfuKrDdwoJN.cjs +0 -5
- package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
- package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
- package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
- package/browser/cjs/index.cjs +0 -1
- package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
- package/browser/esm/9n64lXAgZUe3aThr.mjs +0 -159
- package/browser/esm/BsNoW41d6hdpxTTS.mjs +0 -67
- package/browser/esm/BvAptAMpZVyBCx6-.mjs +0 -2402
- package/browser/esm/CjKioy-GzeSf08f8.mjs +0 -3326
- package/browser/esm/cJxidonaVNZHAXiZ.mjs +0 -4532
- package/browser/esm/dsVZVtt5w_yLb967.mjs +0 -5300
- package/node/esm/BRQYaMYO4UfhjJHw.mjs +0 -170
- package/node/esm/BlbtH3EvAf3K4foF.mjs +0 -2450
- package/node/esm/DhSPOg9wN0kD87Tb.mjs +0 -3051
- package/node/esm/KeV-N47eTyh5YE70.mjs +0 -4642
- package/node/esm/s_yVG0m9KB14YKeN.mjs +0 -3412
- package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
- package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
- package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
package/node/esm/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel -
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v1.0.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
7
|
import { defineLazyModule as e } from "@sheetxl/utils";
|
|
8
|
-
var
|
|
8
|
+
var a = [
|
|
9
9
|
208,
|
|
10
10
|
207,
|
|
11
11
|
17,
|
|
@@ -14,54 +14,91 @@ var t = [
|
|
|
14
14
|
177,
|
|
15
15
|
26,
|
|
16
16
|
225
|
|
17
|
-
],
|
|
17
|
+
], t = async () => (await import("./Dm0hvKcR4xb0TV_N.mjs")).OffCryptoEncryption, r = {
|
|
18
18
|
key: "offcrypto",
|
|
19
19
|
description: "Office Document Encryption",
|
|
20
20
|
detect: async (e) => !!((e) => {
|
|
21
|
-
if (e.byteLength <
|
|
22
|
-
const
|
|
23
|
-
for (let e = 0; e <
|
|
21
|
+
if (e.byteLength < a.length) return !1;
|
|
22
|
+
const t = new Uint8Array(e, 0, a.length);
|
|
23
|
+
for (let e = 0; e < a.length; e++) if (t[e] !== a[e]) return !1;
|
|
24
24
|
return !0;
|
|
25
|
-
})(e) && (await
|
|
26
|
-
decode: async (e,
|
|
27
|
-
encode: async (e,
|
|
28
|
-
},
|
|
29
|
-
|
|
25
|
+
})(e) && (await t()).detect(e),
|
|
26
|
+
decode: async (e, a) => (await t()).decode(e, a),
|
|
27
|
+
encode: async (e, a) => (await t()).encode(e, a)
|
|
28
|
+
}, i = e("io-xlsx:reader", () => import("./CxY3iIYLXVhCebeV.mjs").then((e) => e.t)), o = e("io-xlsx:writer", () => import("./CoeQ0LO-nNXiowwv.mjs")), l = "Excel", n = "ExcelMacro", c = "ExcelTemplate", m = "ExcelMacroTemplate", s = [
|
|
29
|
+
l,
|
|
30
|
+
n,
|
|
31
|
+
c,
|
|
32
|
+
m
|
|
33
|
+
], d = {
|
|
34
|
+
key: l,
|
|
30
35
|
description: "Excel Workbook",
|
|
31
36
|
mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
32
37
|
exts: ["xlsx", "xls"],
|
|
33
|
-
handler: async (e,
|
|
34
|
-
},
|
|
35
|
-
key:
|
|
38
|
+
handler: async (e, a) => (await i.load()).readXLSX(e, a)
|
|
39
|
+
}, p = {
|
|
40
|
+
key: n,
|
|
36
41
|
description: "Excel Macro-Enabled Workbook",
|
|
37
42
|
mimeType: "application/vnd.ms-excel.sheet.macroEnabled.12",
|
|
38
43
|
exts: ["xlsm"],
|
|
39
|
-
handler: async (e,
|
|
40
|
-
},
|
|
41
|
-
key:
|
|
44
|
+
handler: async (e, a) => (await i.load()).readXLSX(e, a)
|
|
45
|
+
}, x = {
|
|
46
|
+
key: c,
|
|
47
|
+
description: "Excel Template",
|
|
48
|
+
mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
49
|
+
exts: ["xltx"],
|
|
50
|
+
handler: async (e, a) => (await i.load()).readXLSX(e, a)
|
|
51
|
+
}, y = {
|
|
52
|
+
key: m,
|
|
53
|
+
description: "Excel Macro-Enabled Template",
|
|
54
|
+
mimeType: "application/vnd.ms-excel.template.macroEnabled.12",
|
|
55
|
+
exts: ["xltm"],
|
|
56
|
+
handler: async (e, a) => (await i.load()).readXLSX(e, a)
|
|
57
|
+
}, w = {
|
|
58
|
+
key: l,
|
|
42
59
|
mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
43
60
|
description: "Excel Workbook",
|
|
44
61
|
exts: ["xlsx"],
|
|
45
|
-
handler: async (e,
|
|
46
|
-
...
|
|
62
|
+
handler: async (e, a) => (await o.load()).writeXLSX(e, {
|
|
63
|
+
...a,
|
|
47
64
|
macroEnabled: !1
|
|
48
65
|
})
|
|
49
|
-
},
|
|
50
|
-
key:
|
|
66
|
+
}, E = {
|
|
67
|
+
key: n,
|
|
51
68
|
mimeType: "application/vnd.ms-excel.sheet.macroEnabled.12",
|
|
52
69
|
description: "Excel Macro-Enabled Workbook",
|
|
53
70
|
exts: ["xlsm"],
|
|
54
|
-
handler: async (e,
|
|
55
|
-
...
|
|
71
|
+
handler: async (e, a) => (await o.load()).writeXLSX(e, {
|
|
72
|
+
...a,
|
|
56
73
|
macroEnabled: !0
|
|
57
74
|
})
|
|
58
|
-
},
|
|
75
|
+
}, h = {
|
|
76
|
+
key: c,
|
|
77
|
+
mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
78
|
+
description: "Excel Template",
|
|
79
|
+
exts: ["xltx"],
|
|
80
|
+
handler: async (e, a) => (await o.load()).writeXLSX(e, {
|
|
81
|
+
...a,
|
|
82
|
+
macroEnabled: !1,
|
|
83
|
+
template: !0
|
|
84
|
+
})
|
|
85
|
+
}, f = {
|
|
86
|
+
key: m,
|
|
87
|
+
mimeType: "application/vnd.ms-excel.template.macroEnabled.12",
|
|
88
|
+
description: "Excel Macro-Enabled Template",
|
|
89
|
+
exts: ["xltm"],
|
|
90
|
+
handler: async (e, a) => (await o.load()).writeXLSX(e, {
|
|
91
|
+
...a,
|
|
92
|
+
macroEnabled: !0,
|
|
93
|
+
template: !0
|
|
94
|
+
})
|
|
95
|
+
}, X = {
|
|
59
96
|
name: "@sheetxl/io-xlsx",
|
|
60
|
-
version: "0.
|
|
97
|
+
version: "1.0.0",
|
|
61
98
|
description: "XLSX I/O formats for SheetXL",
|
|
62
99
|
author: "SheetXL",
|
|
63
100
|
async register(e) {
|
|
64
|
-
await e.registerReadFormat(
|
|
101
|
+
await e.registerReadFormat(d), await e.registerReadFormat(p), await e.registerReadFormat(x), await e.registerReadFormat(y), await e.registerWriteFormat(w), await e.registerWriteFormat(E), await e.registerWriteFormat(h), await e.registerWriteFormat(f), await e.registerEncryption(r);
|
|
65
102
|
}
|
|
66
103
|
};
|
|
67
|
-
export {
|
|
104
|
+
export { s as EXCEL_FORMAT_KEYS, X as IOPlugin, n as XLSM_FORMAT_KEY, l as XLSX_FORMAT_KEY, m as XLTM_FORMAT_KEY, c as XLTX_FORMAT_KEY };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel -
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v1.0.0
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { t } from "./
|
|
7
|
+
import { t } from "./BNLHWJHyy5eB0P_4.mjs";
|
|
8
8
|
var e, r;
|
|
9
9
|
function n(t, e) {
|
|
10
10
|
if (e < 0 || e + 1 >= t.length) throw new RangeError(`toUInt16LE: Offset ${e} is out of bounds for buffer length ${t.length}. Needed 2 bytes.`);
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/io-xlsx",
|
|
3
3
|
"description": "SheetXL - Import/Export from/to Excel",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"license": "SEE LICENSE IN
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./types/index.d.ts",
|
|
10
10
|
"browser": "./browser/esm/index.mjs",
|
|
11
11
|
"node": "./node/esm/index.mjs",
|
|
12
|
-
"
|
|
13
|
-
"require": "./browser/cjs/index.cjs"
|
|
12
|
+
"default": "./browser/esm/index.mjs"
|
|
14
13
|
}
|
|
15
14
|
},
|
|
16
15
|
"types": "./types/index.d.ts",
|
|
17
16
|
"module": "./browser/esm/index.mjs",
|
|
18
|
-
"main": "./browser/
|
|
17
|
+
"main": "./browser/esm/index.mjs",
|
|
19
18
|
"sideEffects": false,
|
|
20
19
|
"engines": {
|
|
21
20
|
"node": ">=22"
|
|
@@ -45,11 +44,11 @@
|
|
|
45
44
|
"utilities"
|
|
46
45
|
],
|
|
47
46
|
"dependencies": {
|
|
48
|
-
"@sheetxl/sdk": "^0.
|
|
49
|
-
"@sheetxl/utils": "^0.
|
|
50
|
-
"@xmldom/xmldom": "^0.9.
|
|
51
|
-
"@zip.js/zip.js": "^2.
|
|
52
|
-
"web-streams-polyfill": "^4.
|
|
47
|
+
"@sheetxl/sdk": "^1.0.0",
|
|
48
|
+
"@sheetxl/utils": "^1.0.0",
|
|
49
|
+
"@xmldom/xmldom": "^0.9.12",
|
|
50
|
+
"@zip.js/zip.js": "^2.24.0",
|
|
51
|
+
"web-streams-polyfill": "^4.5.1",
|
|
53
52
|
"xml-formatter": "^3.7.0"
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import { ICondition } from '@sheetxl/sdk';
|
|
1
|
+
import { ICondition, ISort } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
3
|
+
* The `dynamicFilter/@type` values that are a period (ST_DynamicFilterType less the two averages
|
|
4
|
+
* and `null`). The SDK's `last7Days` is not among them.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DYNAMIC_FILTER_PERIODS: ReadonlySet<string>;
|
|
7
|
+
/**
|
|
8
|
+
* The condition a `dynamicFilter` means: `aboveAverage` / `belowAverage` are the Average operator,
|
|
9
|
+
* everything else a TimePeriod of that name. A period's `val` / `maxVal` are the window it was last
|
|
10
|
+
* evaluated over, which Excel holds until the filter is applied again
|
|
11
|
+
* (`probe-filter-dynamic-later-day`), so they read as its `anchorDate` ({@link periodAnchorOf}). An
|
|
12
|
+
* average's `val` is the average it last found, a cache that is not read.
|
|
13
|
+
*/
|
|
14
|
+
export declare function dynamicFilterToJSON(type: string | null | undefined, val?: string | null, maxVal?: string | null): ICondition.JSON;
|
|
15
|
+
/**
|
|
16
|
+
* The day a relative period was evaluated on, from the window a `dynamicFilter` spells it was
|
|
17
|
+
* evaluated over (`val`, its first day, and `maxVal`, the day after its last); `undefined` for a
|
|
18
|
+
* period the same whatever the day (`Q1`, `M10`), or a window not spelled.
|
|
4
19
|
*
|
|
5
20
|
* @remarks
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* Not handled here, deliberately: the wildcards Excel packs into `@val` for its text filters
|
|
17
|
-
* (`val="abc*"` under `equal` is "begins with abc"). Those need `*`/`?`/`~` escaping settled in
|
|
18
|
-
* both directions before `startsWith`/`contains`/`endsWith` can be inferred, and a half-done
|
|
19
|
-
* inference would turn a literal asterisk into a pattern.
|
|
21
|
+
* Any day of the period holding that day gives the same window, so the day is one of them: the
|
|
22
|
+
* first of a `this` period, the day after a `last` one, the day before a `next` one, and the last
|
|
23
|
+
* of `yearToDate`, which ends on it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function periodAnchorOf(type: string, val: string | undefined, maxVal: string | undefined): number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The window a relative period covers when evaluated on `anchor`, as a `dynamicFilter` spells it:
|
|
28
|
+
* its first day and the day after its last, as serials in the workbook's date system; `null` for a
|
|
29
|
+
* period the same whatever the day. Weeks start on Sunday.
|
|
20
30
|
*/
|
|
31
|
+
export declare function periodWindowOf(type: string, anchor: number, date1904: boolean): {
|
|
32
|
+
val: number;
|
|
33
|
+
maxVal: number;
|
|
34
|
+
} | null;
|
|
21
35
|
/** A `customFilter` in OOXML's own shape. Reader input, writer output — never persisted. */
|
|
22
36
|
export interface OOXMLCustomFilter {
|
|
23
37
|
operator?: string | null;
|
|
@@ -33,18 +47,29 @@ export declare const FilterOperator: {
|
|
|
33
47
|
readonly LessThanOrEqual: "lessThanOrEqual";
|
|
34
48
|
};
|
|
35
49
|
export type FilterOperator = typeof FilterOperator[keyof typeof FilterOperator];
|
|
36
|
-
/** Whether a condition operator is one this border can spell as a `customFilter`. */
|
|
37
|
-
export declare function isComparison(operator: unknown): boolean;
|
|
38
50
|
/**
|
|
39
|
-
*
|
|
51
|
+
* Whether a condition can be spelled as one `customFilter`: a comparison or a text operator, plain
|
|
52
|
+
* or under `not`, or an OOXML spelling carried from a file.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isCustomFilter(condition: ICondition.JSON | undefined | null): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The one string of an `inSet` that is Excel's `equal` criterion: under Display, one item, no
|
|
57
|
+
* date groups, no blanks entry and no other part to the set. `null` for any other list.
|
|
58
|
+
*/
|
|
59
|
+
export declare function displayListItem(condition: ICondition.JSON | undefined | null): string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Text as a pattern that matches only itself: `~` goes before each `*`, `?` and `~`.
|
|
62
|
+
*/
|
|
63
|
+
export declare function escapeWildcards(text: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* `@val` ↦ the param of an ordering comparison.
|
|
40
66
|
*
|
|
41
67
|
* @remarks
|
|
42
68
|
* `@val` is an attribute, so it always arrives as text, but a numeric spelling means the number:
|
|
43
|
-
* `
|
|
44
|
-
*
|
|
69
|
+
* `greaterThan` orders values, and text never orders against a number. `equal` and `notEqual` are
|
|
70
|
+
* not read through here — they are a one-item values list, whose item is text.
|
|
45
71
|
*/
|
|
46
72
|
export declare function valToParam(val: string | null | undefined): string | number | undefined;
|
|
47
|
-
/** The inverse of {@link valToParam}. */
|
|
48
73
|
export declare function paramToVal(param: unknown): string | undefined;
|
|
49
74
|
/**
|
|
50
75
|
* Reads a `customFilter` as a condition.
|
|
@@ -52,6 +77,21 @@ export declare function paramToVal(param: unknown): string | undefined;
|
|
|
52
77
|
* @returns The condition, or `null` when the element carries nothing to compare against.
|
|
53
78
|
*/
|
|
54
79
|
export declare function toCondition(filter: OOXMLCustomFilter, warn?: (message: string) => void): ICondition.JSON | null;
|
|
80
|
+
/**
|
|
81
|
+
* The value test Excel can spell: `and(>= x, <= x)` is `EqualTo x`, and `or(< x, > x)` is
|
|
82
|
+
* `not(EqualTo x)`, for one number `x`. Anything else is returned as it came.
|
|
83
|
+
*/
|
|
84
|
+
export declare function foldComparisonPair(condition: ICondition.JSON): ICondition.JSON;
|
|
85
|
+
/**
|
|
86
|
+
* The inverse of {@link foldComparisonPair}: a value `EqualTo` on a number as the two
|
|
87
|
+
* `customFilter` elements of its `customFilters`, with the `and` the pair needs.
|
|
88
|
+
*
|
|
89
|
+
* @returns `null` when the condition is not a value equality on a number, plain or negated.
|
|
90
|
+
*/
|
|
91
|
+
export declare function toComparisonPair(condition: ICondition.JSON | undefined | null): {
|
|
92
|
+
and: boolean;
|
|
93
|
+
filters: [OOXMLCustomFilter, OOXMLCustomFilter];
|
|
94
|
+
} | null;
|
|
55
95
|
/**
|
|
56
96
|
* The inverse of {@link toCondition}.
|
|
57
97
|
*
|
|
@@ -59,4 +99,27 @@ export declare function toCondition(filter: OOXMLCustomFilter, warn?: (message:
|
|
|
59
99
|
* skips it rather than writing an element Excel would reject.
|
|
60
100
|
*/
|
|
61
101
|
export declare function fromCondition(condition: ICondition.JSON | undefined | null, warn?: (message: string) => void): OOXMLCustomFilter | null;
|
|
102
|
+
/**
|
|
103
|
+
* The values-list item a condition is written as, when Excel writes it that way.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Excel keeps `customFilter` for a pattern and for an ordering comparison. A plain "equals" has
|
|
107
|
+
* neither, and its file holds `<filters><filter val="…"/></filters>`: the text itself, with no
|
|
108
|
+
* escapes, since a values-list item is never a pattern.
|
|
109
|
+
*
|
|
110
|
+
* A number is not written this way: a value `EqualTo` on a number is {@link toComparisonPair},
|
|
111
|
+
* since `<filter val>` would compare the text a cell shows.
|
|
112
|
+
*
|
|
113
|
+
* @returns The item's text (`''` for "equals nothing", which is the blanks entry), or `null` when
|
|
114
|
+
* the condition is not a plain `equalTo` over text or a boolean, under no selector or
|
|
115
|
+
* under Display.
|
|
116
|
+
*/
|
|
117
|
+
export declare function toFilterItem(condition: ICondition.JSON | undefined | null): string | null;
|
|
118
|
+
/**
|
|
119
|
+
* The `sortCondition/@sortBy` for a sort's `sortOn`. Excel spells the fill `cellColor`; the other
|
|
120
|
+
* kinds are spelled the same. `value`, the default, is not written.
|
|
121
|
+
*/
|
|
122
|
+
export declare function toSortBy(sortOn: ISort.SortOn | undefined): string | undefined;
|
|
123
|
+
/** The `sortOn` a `sortCondition/@sortBy` means; see {@link toSortBy}. */
|
|
124
|
+
export declare function fromSortBy(sortBy: string | null | undefined): ISort.SortOn | undefined;
|
|
62
125
|
//# sourceMappingURL=AutoFilterRules.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICondition, IConditionalFormat,
|
|
1
|
+
import { ICondition, IConditionalFormat, ICellStyle } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* The border between OOXML's `cfRule` and the SDK's condition-canonical conditional format.
|
|
4
4
|
*
|
|
@@ -29,7 +29,7 @@ export interface OOXMLCfRule {
|
|
|
29
29
|
* and blank/error rules.
|
|
30
30
|
*/
|
|
31
31
|
formulas?: string[];
|
|
32
|
-
style?:
|
|
32
|
+
style?: ICellStyle.JSON;
|
|
33
33
|
scale?: IConditionalFormat.Scale;
|
|
34
34
|
stopIfTrue?: boolean;
|
|
35
35
|
pivot?: boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IRange } from '@sheetxl/sdk';
|
|
2
|
+
export interface DataTableDefinition {
|
|
3
|
+
/** The result cells. */
|
|
4
|
+
ref: IRange.Coords;
|
|
5
|
+
/** The row input's address; absent for a one-input table down a column. */
|
|
6
|
+
rowInput?: string;
|
|
7
|
+
/** The column input's address; absent for a one-input table along a row. */
|
|
8
|
+
columnInput?: string;
|
|
9
|
+
/** The row input was deleted: the argument is `#REF!`. `rowInput` is its last address, if known. */
|
|
10
|
+
rowInputDeleted?: boolean;
|
|
11
|
+
/** The column input was deleted. */
|
|
12
|
+
columnInputDeleted?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** The `TABLE(...)` formula a definition is in the model, without the `=`, placed at `ref`'s top-left. */
|
|
15
|
+
export declare const toDataTableFormula: (table: DataTableDefinition) => string;
|
|
16
|
+
/**
|
|
17
|
+
* The definition a formula is, when the whole formula is one `TABLE(...)` call a file can hold as
|
|
18
|
+
* Excel's tag: two inputs that are each empty, `#REF!` or an unqualified cell, and two literal
|
|
19
|
+
* counts. `null` otherwise (a `TABLE` inside an expression, a computed count).
|
|
20
|
+
*
|
|
21
|
+
* @param text The formula text at the anchor, with or without the `=`.
|
|
22
|
+
* @param anchor The cell the formula sits in: the results' top-left.
|
|
23
|
+
*/
|
|
24
|
+
export declare const parseDataTableFormula: (text: string, anchor: IRange.CellCoords) => DataTableDefinition | null;
|
|
25
|
+
export declare const dataTableAttributes: (table: DataTableDefinition) => Record<string, string>;
|
|
26
|
+
//# sourceMappingURL=DataTableFormula.d.ts.map
|
|
@@ -43,11 +43,6 @@ export type DvType = typeof DvType[keyof typeof DvType];
|
|
|
43
43
|
* `$A$1:$A$5` are formula text by type, carried verbatim with no marker.
|
|
44
44
|
*/
|
|
45
45
|
export declare function formulaToParam(text: string, type: string | undefined): Scalar;
|
|
46
|
-
/**
|
|
47
|
-
* The most characters Excel reads from a `dataValidation`'s `prompt`, `error`, `promptTitle` or
|
|
48
|
-
* `errorTitle`. One more and Excel refuses to open the workbook at all (probe P5). Excel's own
|
|
49
|
-
* authoring stops sooner (titles 32, prompt 254, error 225); the file is what matters here.
|
|
50
|
-
*/
|
|
51
46
|
export declare const MAX_MESSAGE_LENGTH = 255;
|
|
52
47
|
/**
|
|
53
48
|
* `text` cut to {@link MAX_MESSAGE_LENGTH}, never splitting a surrogate pair; `warn` names the
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `CT_DefinedName`'s attributes that SheetXL carries as `INamed.FileAttributes`, in schema order.
|
|
3
|
+
* `functionGroupId` is the one number among them.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFINED_NAME_TEXT_ATTRIBUTES: readonly ["customMenu", "description", "help", "statusBar", "shortcutKey"];
|
|
6
|
+
/** The boolean ones, in schema order. Only a set flag is kept or written; each defaults to off. */
|
|
7
|
+
export declare const DEFINED_NAME_FLAG_ATTRIBUTES: readonly ["function", "vbProcedure", "xlm", "publishToServer", "workbookParameter"];
|
|
8
|
+
//# sourceMappingURL=DefinedNameAttributes.d.ts.map
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Excel calculation-engine stamp this package is verified against.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* The writer stamps a workbook that has no source of its own with these, and the reader's
|
|
6
|
-
* calc-on-load policy compares a file's `calcId` against the same build. Raise the two together,
|
|
7
|
-
* and only alongside the oracle they name.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* The `calcPr@calcId` of the Excel build this engine's results are verified against.
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* `calcId` is the version of the Excel calculation engine that last calculated a file. On open,
|
|
14
|
-
* Excel trusts the stored values when the id is its own or newer and performs a FULL
|
|
15
|
-
* recalculation when it is older or absent — which turns every citation of a closed external
|
|
16
|
-
* book into `#REF!` (DESIGN-EXTERNAL-LINKS phase D). So a written workbook is stamped with the id
|
|
17
|
-
* of the build this engine's results are verified against — the COM oracle, Excel 16.0, which
|
|
18
|
-
* writes `191029` (`externalLinksNames.xlsx`, authored by it 2026-09-11) — and a source file's own
|
|
19
|
-
* id is carried through unchanged, so a resave keeps exactly the trust the original had. A later
|
|
20
|
-
* Excel, whose id is higher, recalculates on open as it does for its own older files.
|
|
21
|
-
*
|
|
22
|
-
* On read, a file whose id is absent or below this one is recalculated as Excel would.
|
|
23
|
-
*/
|
|
24
1
|
export declare const EXCEL_CALC_ID_VERIFIED = "191029";
|
|
25
|
-
/**
|
|
26
|
-
* The `xcalcf:calcFeatures` extension written for a workbook that has no source list of its own —
|
|
27
|
-
* the other half of the trust {@link EXCEL_CALC_ID_VERIFIED} buys.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Since 2018 Excel also records which calculation FEATURES the engine that last calculated the
|
|
31
|
-
* file had (`microsoft.com:RD`, `Single`, `LET_WF`, …), and recalculates a file on open whose
|
|
32
|
-
* list lacks any of its own — measured 2026-09-11 through the COM oracle: Excel's own resave of
|
|
33
|
-
* `externalLinksNames.xlsx` opens with its stored values, and the same file with ONLY this
|
|
34
|
-
* extension removed opens recalculated (`#REF!`, `#NAME?`), while removing `calcChain.xml` or
|
|
35
|
-
* spelling a legacy cell `_xlfn.SINGLE(...)` changes nothing. The list is the one that Excel
|
|
36
|
-
* build writes; a source file's own is carried through unchanged.
|
|
37
|
-
*/
|
|
38
2
|
export declare const EXCEL_CALC_FEATURES_VERIFIED: string;
|
|
39
3
|
//# sourceMappingURL=ExcelCalcStamp.d.ts.map
|
|
@@ -1,74 +1,8 @@
|
|
|
1
|
-
import { IFunction, IRange, INamed,
|
|
2
|
-
/**
|
|
3
|
-
* The implicit-intersection translation between the modern (dynamic) formula model and what a
|
|
4
|
-
* legacy xlsx `<f>` means — item 47's `ExcelCompat.ts`, born in io-xlsx
|
|
5
|
-
* (DESIGN-FORMULA-DIALECT.md §3).
|
|
6
|
-
*
|
|
7
|
-
* Both directions live here, built on ONE site rule so they cannot drift (FORMULA-SEMANTICS §6.1
|
|
8
|
-
* — after the read transform a divergence is a wrong VALUE, not non-canonical XML):
|
|
9
|
-
*
|
|
10
|
-
* - READ (rules 1/2): a plain `<f>` — no `t="array"`, no `cm` — has legacy semantics whatever its
|
|
11
|
-
* age, and loading it means putting the `@` back where Excel would
|
|
12
|
-
* (`=ABS(A1:A5)` → `=ABS(@A1:A5)`). The decision is per CELL, and the bit rides BESIDE the
|
|
13
|
-
* formula exactly as it does on disk, never inside it: `cm=`/`t="array"` are cell attributes,
|
|
14
|
-
* the reader records their extents in `sheet.formulaArray`, and the load asks per formula which
|
|
15
|
-
* of {@link createCompatReadTransforms}' two transforms to run
|
|
16
|
-
* (`ICalculation.FormulaTransformContext`).
|
|
17
|
-
* - WRITE: the `cm="1"` + `t="array"` marker goes on every formula legacy intersection would
|
|
18
|
-
* change — {@link hasIntersectionSite}, answered beside the formula by the dialect's `annotate`
|
|
19
|
-
* ({@link registerXlsxFormulaDialect}) and read by `WorksheetEmitter`. On a formula written
|
|
20
|
-
* PLAIN, an `@` the legacy read would put back is not spelled at all — Excel elides it and
|
|
21
|
-
* spells `_xlfn.SINGLE` only where the read would not re-insert it
|
|
22
|
-
* ({@link createCompatWriteTransform}).
|
|
23
|
-
*
|
|
24
|
-
* ### An unknown function is a range
|
|
25
|
-
*
|
|
26
|
-
* A call to a function Excel does not know (an add-in or user-defined function — `CASCADESPARKLINE`
|
|
27
|
-
* from SpreadJS, `FOO`) has an unknown return, and Excel treats that as range-VALUED: the call
|
|
28
|
-
* takes an `@` at the root and at every scalar site holding it, never on its own arguments, and
|
|
29
|
-
* never inside a range-accepting slot. Measured `probe-unknown-function-intersect.ps1`
|
|
30
|
-
* (2026-09-03): `=FOO(1)` opens as `=@FOO(1)`, `=ABS(FOO(1))` as `=ABS(@FOO(1))`,
|
|
31
|
-
* `=IF(TRUE,FOO(1),2)` as `=@IF(TRUE,FOO(1),2)`, `=FOO(A1:A5)` as `=@FOO(A1:A5)`, while
|
|
32
|
-
* `=SUM(FOO(1))`, `=SUMPRODUCT(FOO(A1:A5))` and `=N(FOO(1))` stay plain. The value is `#NAME?`
|
|
33
|
-
* either way — what the rule decides is whether the file round-trips to the same TEXT, which
|
|
34
|
-
* matters the day the function exists (the same file opened by the application that wrote it).
|
|
35
|
-
*
|
|
36
|
-
* ### Two kinds of arrayness, and only one of them is a site
|
|
37
|
-
*
|
|
38
|
-
* Being an array is not the same question as being intersected. Arrayness that comes from a
|
|
39
|
-
* REFERENCE — a range, a spill anchor, a table reference, a defined name, an array-returning or
|
|
40
|
-
* `valueReturn` call — is a site wherever a value-typed slot holds it, whatever encloses it.
|
|
41
|
-
* Arrayness that comes from an inline array CONSTANT is not: legacy Excel LIFTS `{…}` and only
|
|
42
|
-
* collapses it where one value is genuinely wanted, which is the cell root and whatever the root's
|
|
43
|
-
* demand reaches through ({@link _childDemand}). That is the split `constants` carries through
|
|
44
|
-
* {@link _isRangeValued}.
|
|
45
|
-
*
|
|
46
|
-
* Measured on plain-`<f>` opens, `probe-array-constant-intersection{,2}.ps1` (40 rows, 2026-08-17):
|
|
47
|
-
* `={1,2,3}` opens as `=@{1,2,3}` and `=ABS({-1,-2,-3})` as `=ABS(@{-1,-2,-3})`, while
|
|
48
|
-
* `=SUM(ABS({-1,-2,-3}))` opens UNTOUCHED at 6 — where the same shape over a range,
|
|
49
|
-
* `=SUM(ABS(H1:H3))`, opens as `=SUM(ABS(@H1:H3))`. A name is reference-derived even when its body
|
|
50
|
-
* is a constant, which is the pair that kills the simpler reading: `=SUM(ArrConst&0)` opens as
|
|
51
|
-
* `=SUM(@ArrConst&0)` = 10 against `=SUM({1,2,3}&0)` = 0.
|
|
52
|
-
*
|
|
53
|
-
* ### Everything measured; facts OVERRIDE declarations
|
|
54
|
-
*
|
|
55
|
-
* Every per-function fact the rules below consult lives in the measured `ExcelFunctionFacts` map
|
|
56
|
-
* (one row per name, probe provenance and slot addressing documented there). The registry's
|
|
57
|
-
* declarations state what a BODY needs and serve as the DEFAULT; wherever Excel measurably
|
|
58
|
-
* disagrees, the fact wins (CALC-ISSUES item 44: "use the measured list, not a derived
|
|
59
|
-
* predicate"). Re-run the probes when adding a function — no test can detect a new function Excel
|
|
60
|
-
* happens to disagree with.
|
|
61
|
-
*/
|
|
1
|
+
import { IFunction, IRange, INamed, IWorksheet, ICalculation } from '@sheetxl/sdk';
|
|
62
2
|
/** Does any call in this tree name a function on Excel's volatile list
|
|
63
3
|
* (`ExcelFunctionFact.volatile`)? (Defined-name bodies are not chased: Excel's `ca` reflects the
|
|
64
4
|
* CELL's own formula text.) */
|
|
65
5
|
export declare const hasVolatileCall: (root: ICalculation.FormulaNode | undefined) => boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Does this tree call a function the registry does not know? An unknown call is what Excel's
|
|
68
|
-
* `ca="1"` records on a cell that reached a user-defined function during its last calculation
|
|
69
|
-
* (measured on every `FOO` cell of `probe-unknown-function-intersect.ps1`) — static here where
|
|
70
|
-
* Excel's is a runtime fact, so a call on an untaken lazy branch is flagged too.
|
|
71
|
-
*/
|
|
72
6
|
export declare const hasUnknownCall: (root: ICalculation.FormulaNode | undefined, ctx: CompatContext) => boolean;
|
|
73
7
|
/** What the walks read of a function: its declared slots and return, and whether it is a built-in. */
|
|
74
8
|
export interface CompatFunction {
|
|
@@ -110,31 +44,6 @@ export interface CompatContext {
|
|
|
110
44
|
* every rule above traces to Excel's own insertion, not our reading of it.
|
|
111
45
|
*/
|
|
112
46
|
export declare const insertImplicitIntersection: (root: ICalculation.FormulaNode, ctx: CompatContext) => ICalculation.FormulaNode;
|
|
113
|
-
/**
|
|
114
|
-
* The WRITE decision — whether legacy implicit intersection would change this formula's meaning,
|
|
115
|
-
* which is the exact condition under which Excel writes `cm="1"` + `t="array"`.
|
|
116
|
-
*
|
|
117
|
-
* @remarks
|
|
118
|
-
* A STATIC property of the formula, not the value: `=IF(FALSE,H1:H3,5)` computes `5` and is still
|
|
119
|
-
* marked. The same rule as {@link insertImplicitIntersection} by construction: a formula is
|
|
120
|
-
* marked exactly when the insertion would change it — plus one clause the insertion rule does not
|
|
121
|
-
* share: a `call` node ANYWHERE marks, because immediate application does not exist in the legacy
|
|
122
|
-
* dialect at all. Measured (`probe-lambda-call.xlsx`, every accepted case): Excel puts
|
|
123
|
-
* `cm="1"` + `t="array"` on `SUM(LAMBDA(x,x+1)(3),1)` (call in an argument slot, scalar root),
|
|
124
|
-
* `MyLam(3)`, `A1(3)`, `-LAMBDA(x,-x)(1)`, the curried and partial forms — all of them. Without
|
|
125
|
-
* the marker Excel reads the cell back as a LEGACY formula and re-inserts `@` at the root and on
|
|
126
|
-
* the lambda parameters (`=@LAMBDA(a,b,@a+@b)(1,2)`), which is exactly what the Excel-open gate
|
|
127
|
-
* caught (verify-lambda-call-opens.ps1, 2026-08-13).
|
|
128
|
-
*
|
|
129
|
-
* "Marked exactly when the insertion would change it" is OUR rule, and Excel's marker is not
|
|
130
|
-
* only that — measured `probe-sumproduct-monthyear.ps1` + `probe-slot-class-intersect2.ps1`
|
|
131
|
-
* (2026-08-14): the same text entered through legacy `.Formula` saves PLAIN and through modern
|
|
132
|
-
* `.Formula2` saves `cm="1" t="array"`, at identical values, on every array-scope shape here. So
|
|
133
|
-
* Excel's marker also records the ENTRY CHANNEL, which we do not persist. We write the legacy
|
|
134
|
-
* channel's answer, which is the self-consistent one: the file we emit reads back — by Excel and
|
|
135
|
-
* by us — to the tree we emitted it from. Carrying a read-side "was marked" bit instead is the
|
|
136
|
-
* open alternative.
|
|
137
|
-
*/
|
|
138
47
|
export declare const hasIntersectionSite: (root: ICalculation.FormulaNode, ctx: CompatContext) => boolean;
|
|
139
48
|
/** The reader's two READ transforms — see {@link createCompatReadTransforms}. */
|
|
140
49
|
export interface CompatReadTransforms {
|
|
@@ -178,29 +87,6 @@ export interface XlsxFormulaAnnotation {
|
|
|
178
87
|
}
|
|
179
88
|
/** Where a save's emitters find the workbook's dialect (`EmitContext.getSharedStates`). */
|
|
180
89
|
export declare const SHARED_STATE_XLSX_FORMULA_DIALECT = "xlsxFormulaDialect";
|
|
181
|
-
/**
|
|
182
|
-
* The xlsx formula dialect for one workbook: how this format spells formulas, applied to formula
|
|
183
|
-
* TEXT, with no calculation involved (DESIGN-CALC-SERVICE §9).
|
|
184
|
-
*
|
|
185
|
-
* - READ: the on-disk legacy spellings (`_xlfn.`, `_xlws.`, `_xleta.`, `_xlpm.`, `SINGLE`,
|
|
186
|
-
* `ANCHORARRAY`, `_TRO_*`, `_LONGTEXT`) unwrapped, and for a plain cell the implicit-intersection
|
|
187
|
-
* `@` operators Excel would show, exactly where it would ({@link CompatReadTransforms.legacy});
|
|
188
|
-
* an array anchor and a detached formula take the unwrap alone.
|
|
189
|
-
* - WRITE: the legacy spellings on every formula, plus, for a plain cell, the elision of each `@`
|
|
190
|
-
* the read would put back ({@link createCompatWriteTransform}).
|
|
191
|
-
* - ANNOTATE: an {@link XlsxFormulaAnnotation}.
|
|
192
|
-
*
|
|
193
|
-
* Functions are answered from the built-in declarations, defined names from the workbook's names
|
|
194
|
-
* as text; neither needs an engine.
|
|
195
|
-
*
|
|
196
|
-
* A DETACHED formula is one with no cell of its own: a defined name, a conditional format or data
|
|
197
|
-
* validation operand, a cfvo value. Excel evaluates a condition body in CSE mode (nothing
|
|
198
|
-
* intersects, measured `probe-cf-intersect.ps1`) and writes it plain with no `cm=`, so the
|
|
199
|
-
* plain-cell `@` insertion and elision never apply to it — only the spelling does. That spelling
|
|
200
|
-
* needs no names, so a dialect built with none ({@link createXlsxFormulaDialect}) answers
|
|
201
|
-
* {@link readDetached} completely; it is what the reader hands the worksheet visitors before the
|
|
202
|
-
* workbook's names have been read.
|
|
203
|
-
*/
|
|
204
90
|
export interface XlsxFormulaDialect {
|
|
205
91
|
/**
|
|
206
92
|
* The tree of the model's canonical text written at `anchor`, in the shape the compiled tree
|
|
@@ -230,6 +116,15 @@ export interface XlsxFormulaDialect {
|
|
|
230
116
|
/** A defined name's canonical text spelled for the file. */
|
|
231
117
|
writeName(text: string): string;
|
|
232
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* The external links a save writes, for {@link createXlsxFormulaDialect}.
|
|
121
|
+
*/
|
|
122
|
+
export interface XlsxExternalBooks {
|
|
123
|
+
/** How many `<externalReference>` positions the file will have. */
|
|
124
|
+
count: number;
|
|
125
|
+
/** Called for each citation of a position past {@link count}, as it is written `#REF!`. */
|
|
126
|
+
onDangling?: (n: number) => void;
|
|
127
|
+
}
|
|
233
128
|
/**
|
|
234
129
|
* Builds the dialect for a workbook.
|
|
235
130
|
*
|
|
@@ -239,14 +134,17 @@ export interface XlsxFormulaDialect {
|
|
|
239
134
|
* @param tables The workbook's table names. A bare table name (`=Sales`) parses as a name; the
|
|
240
135
|
* file spells it as the table's data body (`Sales[]`), so the writer has to know which names are
|
|
241
136
|
* tables.
|
|
137
|
+
* @param externalBooks The links a save writes. With it, {@link XlsxFormulaDialect.spell} and
|
|
138
|
+
* {@link XlsxFormulaDialect.writeName} write a citation of any other position as `#REF!`; a reader
|
|
139
|
+
* omits it.
|
|
242
140
|
*/
|
|
243
|
-
export declare function createXlsxFormulaDialect(names?: readonly INamed.JSON[] | null, tables?: readonly string[] | null): XlsxFormulaDialect;
|
|
141
|
+
export declare function createXlsxFormulaDialect(names?: readonly INamed.JSON[] | null, tables?: readonly string[] | null, externalBooks?: XlsxExternalBooks | null): XlsxFormulaDialect;
|
|
244
142
|
/**
|
|
245
143
|
* Rewrites a sheet's formulas, as the reader recorded them, into canonical text in place. Plain
|
|
246
144
|
* versus marked is a per-CELL fact on disk (`cm=` / `t="array"` are cell attributes), answered
|
|
247
145
|
* from the `formulaArray` extents the reader recorded.
|
|
248
146
|
*/
|
|
249
|
-
export declare function readSheetFormulas(sheet:
|
|
147
|
+
export declare function readSheetFormulas(sheet: IWorksheet.JSON, dialect: XlsxFormulaDialect): void;
|
|
250
148
|
/**
|
|
251
149
|
* The `@` nodes of a modern tree that the legacy read would put back on its own — the ones a
|
|
252
150
|
* PLAIN `<f>` does not need to spell.
|
|
@@ -267,31 +165,5 @@ export declare function readSheetFormulas(sheet: ISheet.JSON, dialect: XlsxFormu
|
|
|
267
165
|
* takes no insertion on read, so every `@` on it has to be explicit.
|
|
268
166
|
*/
|
|
269
167
|
export declare const impliedIntersections: (root: ICalculation.FormulaNode, ctx: CompatContext) => Set<ICalculation.FormulaNode>;
|
|
270
|
-
/**
|
|
271
|
-
* The writer's complete WRITE transform for a CELL formula: the legacy spelling on every node
|
|
272
|
-
* (`createLegacyWriteTransform`), plus — at the root of a formula that will be written plain —
|
|
273
|
-
* the elision of every `@` the legacy read would put back.
|
|
274
|
-
*
|
|
275
|
-
* @remarks
|
|
276
|
-
* Excel's own spelling of a modern `@`, measured `probe-at-elision.ps1` (2026-09-03): `=@A1:A5`
|
|
277
|
-
* saves as `A1:A5`, `=ABS(@A1:A5)` as `ABS(A1:A5)`, `=@FOO(1)` as `FOO(1)`, `=@SEQUENCE(5)` as
|
|
278
|
-
* `_xlfn.SEQUENCE(5)`; `_xlfn.SINGLE` appears only where the read would NOT re-insert —
|
|
279
|
-
* `SUM(_xlfn.SINGLE(A1:A5))`, `SUMPRODUCT(ABS(_xlfn.SINGLE(A1:A5)))`, `_xlfn.SINGLE(SUM(1))`,
|
|
280
|
-
* `_xlfn.SINGLE((A1:A5))`. A formula that still has a site after its `@`s are honored is a
|
|
281
|
-
* MARKED cell (`cm="1"`) and keeps every `@` explicit (`=@ABS(A1:A5)` →
|
|
282
|
-
* `_xlfn.SINGLE(ABS(A1:A5))` under `cm="1"`), because no insertion runs on it. The text is
|
|
283
|
-
* therefore self-consistent in both readers: what comes back is the tree that went out.
|
|
284
|
-
*
|
|
285
|
-
* This is why the SpreadJS/add-in round trip closes: `=@CASCADESPARKLINE(...)` — the modern
|
|
286
|
-
* form of the plain `<f>` the authoring application wrote — goes back out as that same plain
|
|
287
|
-
* `<f>`, which is the only spelling the authoring application knows.
|
|
288
|
-
*
|
|
289
|
-
* Mechanics: the spelling runs in the SDK's own post-order walk (fresh nodes keep their trivia
|
|
290
|
-
* that way), so by the root every `@` is already a `SINGLE` call. The root pass unwraps a VIEW of
|
|
291
|
-
* the spelled tree to ask the modern-tree questions, maps each implied `@` of the view back to
|
|
292
|
-
* the `SINGLE` node it came from, and drops those nodes copy-on-write — every untouched node
|
|
293
|
-
* keeps its identity, and its whitespace. Defined names and array-anchored cells take the
|
|
294
|
-
* spelling pass only (`WorkbookEmitter`'s write provider decides per block; names never run this).
|
|
295
|
-
*/
|
|
296
168
|
export declare function createCompatWriteTransform(legacy: ICalculation.FormulaTransform, ctx: CompatContext): ICalculation.FormulaTransform;
|
|
297
169
|
//# sourceMappingURL=ExcelCompat.d.ts.map
|