@office-kit/xlsx 0.11.0 → 0.12.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/README.md +11 -1
- package/dist/cell/cell.d.ts +45 -10
- package/dist/cell/index.d.ts +4 -4
- package/dist/cell/rich-text.d.ts +1 -1
- package/dist/{cell-BucgGwl3.mjs → cell-Df3cKRIl.mjs} +72 -30
- package/dist/cell-Df3cKRIl.mjs.map +1 -0
- package/dist/{cell-style-DuvS_Lsg.mjs → cell-style-BFmJOmcx.mjs} +130 -93
- package/dist/cell-style-BFmJOmcx.mjs.map +1 -0
- package/dist/cell.mjs +2 -2
- package/dist/chart/chart-xml.d.ts +1 -1
- package/dist/chart/chart.d.ts +3 -3
- package/dist/chart/cx/chartex-xml.d.ts +1 -1
- package/dist/chart/cx/chartex.d.ts +2 -2
- package/dist/chart/index.d.ts +6 -6
- package/dist/chart/user-shapes-xml.d.ts +1 -1
- package/dist/chart/user-shapes.d.ts +2 -2
- package/dist/chart.mjs.map +1 -1
- package/dist/chartsheet/chartsheet-xml.d.ts +1 -1
- package/dist/chartsheet/chartsheet.d.ts +4 -4
- package/dist/chartsheet/index.d.ts +2 -2
- package/dist/chartsheet-C3-tqkPy.mjs.map +1 -1
- package/dist/{coordinate-96Ecci4d.mjs → coordinate-Bt5Gni2I.mjs} +19 -8
- package/dist/coordinate-Bt5Gni2I.mjs.map +1 -0
- package/dist/datetime-B2ySVlXt.mjs.map +1 -1
- package/dist/{defined-names-CviWmtQg.mjs → defined-names-Ctu3F6ls.mjs} +4 -3
- package/dist/defined-names-Ctu3F6ls.mjs.map +1 -0
- package/dist/{differential-DvKU8fJt.mjs → differential-H9SjEeIU.mjs} +2 -2
- package/dist/differential-H9SjEeIU.mjs.map +1 -0
- package/dist/drawing/dml/dml-xml.d.ts +8 -8
- package/dist/drawing/dml/effect.d.ts +2 -2
- package/dist/drawing/dml/fill.d.ts +1 -1
- package/dist/drawing/dml/geometry.d.ts +1 -1
- package/dist/drawing/dml/line.d.ts +1 -1
- package/dist/drawing/dml/shape-properties.d.ts +5 -5
- package/dist/drawing/dml/text.d.ts +4 -4
- package/dist/drawing/drawing-xml.d.ts +1 -1
- package/dist/drawing/drawing.d.ts +9 -9
- package/dist/drawing/index.d.ts +14 -14
- package/dist/{drawing-BxzLuryn.mjs → drawing-ZJ3h4VHD.mjs} +2 -2
- package/dist/drawing-ZJ3h4VHD.mjs.map +1 -0
- package/dist/drawing.mjs +1 -1
- package/dist/drawing.mjs.map +1 -1
- package/dist/{escape-DFTE7ZJc.mjs → escape-rnWSPpWY.mjs} +4 -6
- package/dist/{escape-DFTE7ZJc.mjs.map → escape-rnWSPpWY.mjs.map} +1 -1
- package/dist/formula/tokenizer.d.ts +1 -1
- package/dist/formula/translate.d.ts +2 -2
- package/dist/{inference-BrI9uIY4.mjs → inference-BMvv9cUY.mjs} +18 -3
- package/dist/inference-BMvv9cUY.mjs.map +1 -0
- package/dist/io/browser.d.ts +2 -2
- package/dist/io/index.d.ts +7 -7
- package/dist/io/load.d.ts +4 -4
- package/dist/io/node-fs.d.ts +2 -2
- package/dist/io/node-save.d.ts +2 -2
- package/dist/io/node.d.ts +2 -2
- package/dist/io/save.d.ts +2 -2
- package/dist/io.mjs +2 -2
- package/dist/io.mjs.map +1 -1
- package/dist/{load-MyOIjtrU.mjs → load-CJdGh50R.mjs} +8 -8
- package/dist/load-CJdGh50R.mjs.map +1 -0
- package/dist/{manifest-Cm9K7D62.mjs → manifest-pLmx7KYh.mjs} +3 -3
- package/dist/manifest-pLmx7KYh.mjs.map +1 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.mjs +1 -1
- package/dist/node.mjs.map +1 -1
- package/dist/packaging/core.d.ts +1 -1
- package/dist/packaging/custom.d.ts +2 -2
- package/dist/packaging/extended.d.ts +2 -2
- package/dist/packaging/index.d.ts +10 -10
- package/dist/packaging.mjs +1 -1
- package/dist/{parser-D3SLaOFe.mjs → parser-By6RWZVW.mjs} +39 -10
- package/dist/parser-By6RWZVW.mjs.map +1 -0
- package/dist/reader-BNaUTVCy.mjs.map +1 -1
- package/dist/{save-2moCT3Af.mjs → save-a0InIbtJ.mjs} +10 -8
- package/dist/save-a0InIbtJ.mjs.map +1 -0
- package/dist/schema/core.d.ts +1 -1
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/serialize.d.ts +2 -2
- package/dist/serialize-BC2Wu3bR.mjs.map +1 -1
- package/dist/{serializer-BtO2TrI7.mjs → serializer-C6nm0mRJ.mjs} +2 -2
- package/dist/serializer-C6nm0mRJ.mjs.map +1 -0
- package/dist/streaming/index.d.ts +2 -2
- package/dist/streaming/read-only.d.ts +4 -4
- package/dist/streaming/write-only.d.ts +9 -15
- package/dist/streaming.mjs +19 -49
- package/dist/streaming.mjs.map +1 -1
- package/dist/styles/alignment.schema.d.ts +2 -2
- package/dist/styles/borders.d.ts +1 -1
- package/dist/styles/borders.schema.d.ts +2 -2
- package/dist/styles/cell-style.d.ts +86 -40
- package/dist/styles/colors.schema.d.ts +2 -2
- package/dist/styles/differential.d.ts +7 -7
- package/dist/styles/fills.d.ts +1 -1
- package/dist/styles/fills.schema.d.ts +2 -2
- package/dist/styles/fonts.d.ts +11 -2
- package/dist/styles/fonts.schema.d.ts +2 -2
- package/dist/styles/index.d.ts +21 -21
- package/dist/styles/named-styles.d.ts +6 -6
- package/dist/styles/numbers.schema.d.ts +2 -2
- package/dist/styles/protection.schema.d.ts +2 -2
- package/dist/styles/stylesheet-reader.d.ts +1 -1
- package/dist/styles/stylesheet-writer.d.ts +1 -1
- package/dist/styles/stylesheet.d.ts +34 -8
- package/dist/styles.mjs +4 -4
- package/dist/{stylesheet-writer-BrOw4jMY.mjs → stylesheet-writer-D7Uug85X.mjs} +35 -22
- package/dist/stylesheet-writer-D7Uug85X.mjs.map +1 -0
- package/dist/{table-1P8we2gS.mjs → table-Ccro4rrz.mjs} +11 -9
- package/dist/table-Ccro4rrz.mjs.map +1 -0
- package/dist/tree-BX-sRRVp.mjs.map +1 -1
- package/dist/user-shapes-DfmCGKB0.mjs.map +1 -1
- package/dist/utf8-Tn3nzyik.mjs.map +1 -1
- package/dist/utils/coordinate.d.ts +30 -4
- package/dist/utils/escape.d.ts +3 -5
- package/dist/utils/formula-text.d.ts +7 -0
- package/dist/utils/index.d.ts +11 -11
- package/dist/utils.mjs +3 -3
- package/dist/workbook/calc-properties.d.ts +9 -2
- package/dist/workbook/defined-names.d.ts +3 -3
- package/dist/workbook/index.d.ts +24 -24
- package/dist/workbook/protection.d.ts +1 -1
- package/dist/workbook/shared-strings.d.ts +2 -2
- package/dist/workbook/views.d.ts +1 -1
- package/dist/workbook/workbook-properties.d.ts +1 -1
- package/dist/workbook/workbook.d.ts +46 -46
- package/dist/{workbook-CARZS94U.mjs → workbook-B15-T4cs.mjs} +8 -8
- package/dist/workbook-B15-T4cs.mjs.map +1 -0
- package/dist/workbook.mjs +45 -3
- package/dist/workbook.mjs.map +1 -1
- package/dist/worksheet/auto-filter.d.ts +1 -1
- package/dist/worksheet/cell-range.d.ts +11 -4
- package/dist/worksheet/comments-xml.d.ts +1 -1
- package/dist/worksheet/conditional-formatting.d.ts +2 -2
- package/dist/worksheet/custom-sheet-views.d.ts +2 -2
- package/dist/worksheet/data-validations.d.ts +3 -3
- package/dist/worksheet/errors.d.ts +1 -1
- package/dist/worksheet/hyperlinks.d.ts +1 -1
- package/dist/worksheet/index.d.ts +46 -46
- package/dist/worksheet/ole-objects.d.ts +1 -1
- package/dist/worksheet/page-setup.d.ts +1 -1
- package/dist/worksheet/properties.d.ts +1 -1
- package/dist/worksheet/protected-ranges.d.ts +1 -1
- package/dist/worksheet/protection.d.ts +1 -1
- package/dist/worksheet/reader.d.ts +9 -9
- package/dist/worksheet/scenarios.d.ts +1 -1
- package/dist/worksheet/table-validate.d.ts +7 -0
- package/dist/worksheet/table-xml.d.ts +1 -1
- package/dist/worksheet/table.d.ts +6 -3
- package/dist/worksheet/views.d.ts +5 -0
- package/dist/worksheet/worksheet.d.ts +135 -94
- package/dist/worksheet/writer.d.ts +16 -9
- package/dist/{worksheet-C5Ensf_j.mjs → worksheet-4xW-i8j9.mjs} +235 -51
- package/dist/worksheet-4xW-i8j9.mjs.map +1 -0
- package/dist/worksheet.mjs +3 -3
- package/dist/worksheet.mjs.map +1 -1
- package/dist/writer-IyFccCRJ.mjs.map +1 -1
- package/dist/xml/index.d.ts +10 -10
- package/dist/xml/parser.d.ts +1 -1
- package/dist/xml/serializer.d.ts +1 -1
- package/dist/xml/stream-writer.d.ts +1 -1
- package/dist/xml.mjs +3 -3
- package/dist/xml.mjs.map +1 -1
- package/dist/zip/decompression-guard.d.ts +1 -1
- package/dist/zip/index.d.ts +6 -6
- package/dist/zip/random-access-reader.d.ts +2 -2
- package/dist/zip/reader.d.ts +2 -2
- package/dist/zip/writer.d.ts +1 -1
- package/package.json +4 -1
- package/dist/cell-BucgGwl3.mjs.map +0 -1
- package/dist/cell-style-DuvS_Lsg.mjs.map +0 -1
- package/dist/coordinate-96Ecci4d.mjs.map +0 -1
- package/dist/defined-names-CviWmtQg.mjs.map +0 -1
- package/dist/differential-DvKU8fJt.mjs.map +0 -1
- package/dist/drawing-BxzLuryn.mjs.map +0 -1
- package/dist/inference-BrI9uIY4.mjs.map +0 -1
- package/dist/load-MyOIjtrU.mjs.map +0 -1
- package/dist/manifest-Cm9K7D62.mjs.map +0 -1
- package/dist/parser-D3SLaOFe.mjs.map +0 -1
- package/dist/save-2moCT3Af.mjs.map +0 -1
- package/dist/serializer-BtO2TrI7.mjs.map +0 -1
- package/dist/stylesheet-writer-BrOw4jMY.mjs.map +0 -1
- package/dist/table-1P8we2gS.mjs.map +0 -1
- package/dist/workbook-CARZS94U.mjs.map +0 -1
- package/dist/worksheet-C5Ensf_j.mjs.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type Schema } from '../schema/core';
|
|
2
|
-
import type { Protection } from './protection';
|
|
1
|
+
import { type Schema } from '../schema/core.js';
|
|
2
|
+
import type { Protection } from './protection.js';
|
|
3
3
|
export declare const ProtectionSchema: Schema<Protection>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Alignment } from './alignment';
|
|
2
|
-
import type { Border } from './borders';
|
|
3
|
-
import type { Fill } from './fills';
|
|
4
|
-
import type { Font } from './fonts';
|
|
5
|
-
import type { Protection } from './protection';
|
|
1
|
+
import type { Alignment } from './alignment.js';
|
|
2
|
+
import type { Border } from './borders.js';
|
|
3
|
+
import type { Fill } from './fills.js';
|
|
4
|
+
import type { Font } from './fonts.js';
|
|
5
|
+
import type { Protection } from './protection.js';
|
|
6
6
|
/**
|
|
7
7
|
* One entry in the cellXfs / cellStyleXfs pool. Represents the union of
|
|
8
8
|
* indexes-into-other-pools that a cell or named style points at.
|
|
@@ -38,7 +38,7 @@ export interface Stylesheet {
|
|
|
38
38
|
cellXfs: CellXf[];
|
|
39
39
|
cellStyleXfs: CellXf[];
|
|
40
40
|
/** Named styles (Excel's "Cell Styles" gallery; populated by addNamedStyle). */
|
|
41
|
-
namedStyles?: Array<import('./named-styles').StylesheetNamedStyle>;
|
|
41
|
+
namedStyles?: Array<import('./named-styles.js').StylesheetNamedStyle>;
|
|
42
42
|
/**
|
|
43
43
|
* The tail of `<styleSheet>` this model doesn't cover — `<tableStyles>`,
|
|
44
44
|
* `<colors>` and `<extLst>` (which is where Excel keeps its x14/x15 slicer
|
|
@@ -46,14 +46,14 @@ export interface Stylesheet {
|
|
|
46
46
|
* loaded workbook keeps them; CT_Stylesheet puts all three after `<dxfs>`,
|
|
47
47
|
* so the writer appends them there.
|
|
48
48
|
*/
|
|
49
|
-
stylesXmlTail?: Array<import('../xml/tree').XmlNode>;
|
|
49
|
+
stylesXmlTail?: Array<import('../xml/tree.js').XmlNode>;
|
|
50
50
|
_fontIdByKey: Map<string, number>;
|
|
51
51
|
_fillIdByKey: Map<string, number>;
|
|
52
52
|
_borderIdByKey: Map<string, number>;
|
|
53
53
|
_xfIdByKey: Map<string, number>;
|
|
54
54
|
_styleXfIdByKey: Map<string, number>;
|
|
55
55
|
_numFmtIdByCode: Map<string, number>;
|
|
56
|
-
_namedStyleByName?: Map<string, import('./named-styles').StylesheetNamedStyle>;
|
|
56
|
+
_namedStyleByName?: Map<string, import('./named-styles.js').StylesheetNamedStyle>;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Build a fresh Stylesheet pre-populated with Excel's required default entries.
|
|
@@ -101,3 +101,29 @@ export declare function listCellStyleXfs(ss: Stylesheet): ReadonlyArray<CellXf>;
|
|
|
101
101
|
* workbook's font 0 / fill 0 / border 0 / numFmtId 0 (General).
|
|
102
102
|
*/
|
|
103
103
|
export declare function defaultCellXf(): CellXf;
|
|
104
|
+
/**
|
|
105
|
+
* A cell's look expressed across every style axis at once. Each axis is
|
|
106
|
+
* independent: pass any subset, and the axes you leave out are decided by
|
|
107
|
+
* whichever function consumes the spec.
|
|
108
|
+
*/
|
|
109
|
+
export interface CellStyleSpec {
|
|
110
|
+
font?: Font;
|
|
111
|
+
fill?: Fill;
|
|
112
|
+
border?: Border;
|
|
113
|
+
alignment?: Alignment;
|
|
114
|
+
protection?: Protection;
|
|
115
|
+
numberFormat?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Resolve a style spec to the CellXf fields it sets, registering each component
|
|
119
|
+
* in its pool. The result is a patch, not a whole xf: axes absent from `spec`
|
|
120
|
+
* are absent here too, so a caller can either spread it over
|
|
121
|
+
* {@link defaultCellXf} for a complete style or over an existing xf to merge.
|
|
122
|
+
*
|
|
123
|
+
* Every path that turns a user-facing style spec into an xf goes through this,
|
|
124
|
+
* so a new axis on {@link CellStyleSpec} reaches the modelled writer and the
|
|
125
|
+
* streaming write-only writer together.
|
|
126
|
+
*/
|
|
127
|
+
export declare function buildXfPatch(ss: Stylesheet, spec: CellStyleSpec): {
|
|
128
|
+
-readonly [K in keyof CellXf]?: CellXf[K];
|
|
129
|
+
};
|
package/dist/styles.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as
|
|
2
|
-
import { $ as
|
|
3
|
-
import { r as makeDifferentialStyle, t as addDxf } from "./differential-
|
|
4
|
-
export { BUILTIN_FORMATS, BUILTIN_FORMATS_MAX_SIZE, BUILTIN_NAMED_STYLES, DEFAULT_FONT, FORMAT_DATE_DATETIME, FORMAT_DATE_TIMEDELTA, FORMAT_DATE_YYYYMMDD2, FORMAT_GENERAL, FORMAT_NUMBER, FORMAT_NUMBER_00, FORMAT_PERCENTAGE, FORMAT_PERCENTAGE_00, FORMAT_TEXT, addBorder, addCellStyleXf, addCellXf, addDxf, addFill, addFont, addNamedStyle, addNumFmt, adjustLightness, adjustSaturation, alignCellHorizontal, alignCellVertical, alignmentToCss, applyBuiltinStyle, applyNamedStyle, borderToCss, builtinFormatCode, builtinFormatId, cellStyleToCss, centerCell, classifyDateFormat, clearCellBackground, clearCellStyle, clearRangeStyle, cloneCellStyle, colorToHex, contrastRatio, copyCellStyle, darken, defaultCellXf, ensureBuiltinStyle, fillToCss, fontToCss, formatAsHeader, getCellAlignment, getCellBorder, getCellFill, getCellFont, getCellNumberFormat, getCellProtection, hexToHsl, hslToHex, indentCell, isBuiltinFormat, isDateFormat, isTimedeltaFormat, lighten, listBorders, listCellStyleXfs, listCellXfs, listFills, listFonts, luminance, makeAlignment, makeBorder, makeColor, makeDifferentialStyle, makeFill, makeFont, makeGradientFill, makeGradientStop, makeNumberFormat, makePatternFill, makeProtection, makeSide, makeStylesheet, mixColors, normaliseRgb, pickReadableTextColor, resolveIndexedColor, rgbColor, rotateCellText, rotateHue, setBold, setCellAlignment, setCellAsCurrency, setCellAsDate, setCellAsNumber, setCellAsPercent, setCellBackgroundColor, setCellBorder, setCellBorderAll, setCellFill, setCellFont, setCellNumberFormat, setCellProtection, setCellStyle, setFontColor, setFontName, setFontSize, setItalic, setRangeAlignment, setRangeBackgroundColor, setRangeBorderBox, setRangeFont, setRangeNumberFormat, setRangeProtection, setRangeStyle, setRangeWrapText, setStrikethrough, setUnderline, wrapCellText };
|
|
1
|
+
import { An as rgbColor, Cn as lighten, Dn as normaliseRgb, En as mixColors, On as pickReadableTextColor, Sn as hslToHex, Tn as makeColor, _n as adjustSaturation, bn as darken, gn as adjustLightness, jn as rotateHue, kn as resolveIndexedColor, vn as colorToHex, wn as luminance, xn as hexToHsl, yn as contrastRatio } from "./worksheet-4xW-i8j9.mjs";
|
|
2
|
+
import { $ as BUILTIN_NAMED_STYLES, $t as makeAlignment, A as setCellBorder, At as isBuiltinFormat, B as setItalic, C as setBold, Ct as FORMAT_NUMBER_00, D as setCellAsNumber, Dt as builtinFormatCode, E as setCellAsDate, Et as FORMAT_TEXT, F as setCellProtection, G as setRangeNumberFormat, Gt as makePatternFill, H as setRangeBackgroundColor, Ht as makeFill, I as setCellStyle, J as setRangeWrapText, Jt as makeBorder, K as setRangeProtection, L as setFontColor, M as setCellFill, Mt as isTimedeltaFormat, N as setCellFont, Nt as makeNumberFormat, O as setCellAsPercent, Ot as builtinFormatId, P as setCellNumberFormat, Pt as DEFAULT_FONT, Q as makeProtection, Qt as alignmentToCss, R as setFontName, Rt as fontToCss, S as rotateCellText, St as FORMAT_NUMBER, T as setCellAsCurrency, Tt as FORMAT_PERCENTAGE_00, U as setRangeBorderBox, Ut as makeGradientFill, V as setRangeAlignment, Vt as fillToCss, W as setRangeFont, Wt as makeGradientStop, X as setUnderline, Y as setStrikethrough, Yt as makeSide, Z as wrapCellText, _ as getCellNumberFormat, _t as BUILTIN_FORMATS_MAX_SIZE, a as cellStyleToCss, at as addFill, b as patchCellFont, bt as FORMAT_DATE_YYYYMMDD2, c as clearCellStyle, d as copyCellStyle, dt as listCellStyleXfs, et as addNamedStyle, f as formatAsHeader, ft as listCellXfs, g as getCellFont, gt as BUILTIN_FORMATS, h as getCellFill, ht as makeStylesheet, i as applyNamedStyle, it as addCellXf, j as setCellBorderAll, jt as isDateFormat, k as setCellBackgroundColor, kt as classifyDateFormat, l as clearRangeStyle, lt as defaultCellXf, m as getCellBorder, mt as listFonts, n as alignCellVertical, nt as addBorder, o as centerCell, ot as addFont, p as getCellAlignment, pt as listFills, q as setRangeStyle, qt as borderToCss, r as applyBuiltinStyle, rt as addCellStyleXf, s as clearCellBackground, st as addNumFmt, t as alignCellHorizontal, tt as ensureBuiltinStyle, u as cloneCellStyle, ut as listBorders, v as getCellProtection, vt as FORMAT_DATE_DATETIME, w as setCellAlignment, wt as FORMAT_PERCENTAGE, x as registerCellStyle, xt as FORMAT_GENERAL, y as indentCell, yt as FORMAT_DATE_TIMEDELTA, z as setFontSize, zt as makeFont } from "./cell-style-BFmJOmcx.mjs";
|
|
3
|
+
import { r as makeDifferentialStyle, t as addDxf } from "./differential-H9SjEeIU.mjs";
|
|
4
|
+
export { BUILTIN_FORMATS, BUILTIN_FORMATS_MAX_SIZE, BUILTIN_NAMED_STYLES, DEFAULT_FONT, FORMAT_DATE_DATETIME, FORMAT_DATE_TIMEDELTA, FORMAT_DATE_YYYYMMDD2, FORMAT_GENERAL, FORMAT_NUMBER, FORMAT_NUMBER_00, FORMAT_PERCENTAGE, FORMAT_PERCENTAGE_00, FORMAT_TEXT, addBorder, addCellStyleXf, addCellXf, addDxf, addFill, addFont, addNamedStyle, addNumFmt, adjustLightness, adjustSaturation, alignCellHorizontal, alignCellVertical, alignmentToCss, applyBuiltinStyle, applyNamedStyle, borderToCss, builtinFormatCode, builtinFormatId, cellStyleToCss, centerCell, classifyDateFormat, clearCellBackground, clearCellStyle, clearRangeStyle, cloneCellStyle, colorToHex, contrastRatio, copyCellStyle, darken, defaultCellXf, ensureBuiltinStyle, fillToCss, fontToCss, formatAsHeader, getCellAlignment, getCellBorder, getCellFill, getCellFont, getCellNumberFormat, getCellProtection, hexToHsl, hslToHex, indentCell, isBuiltinFormat, isDateFormat, isTimedeltaFormat, lighten, listBorders, listCellStyleXfs, listCellXfs, listFills, listFonts, luminance, makeAlignment, makeBorder, makeColor, makeDifferentialStyle, makeFill, makeFont, makeGradientFill, makeGradientStop, makeNumberFormat, makePatternFill, makeProtection, makeSide, makeStylesheet, mixColors, normaliseRgb, patchCellFont, pickReadableTextColor, registerCellStyle, resolveIndexedColor, rgbColor, rotateCellText, rotateHue, setBold, setCellAlignment, setCellAsCurrency, setCellAsDate, setCellAsNumber, setCellAsPercent, setCellBackgroundColor, setCellBorder, setCellBorderAll, setCellFill, setCellFont, setCellNumberFormat, setCellProtection, setCellStyle, setFontColor, setFontName, setFontSize, setItalic, setRangeAlignment, setRangeBackgroundColor, setRangeBorderBox, setRangeFont, setRangeNumberFormat, setRangeProtection, setRangeStyle, setRangeWrapText, setStrikethrough, setUnderline, wrapCellText };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { n as OpenXmlError, o as OpenXmlSchemaError } from "./exceptions-D-CFwxgm.mjs";
|
|
2
|
-
import { a as columnLetterFromIndex, g as tupleToCoordinate, i as columnIndexFromLetter, s as coordinateToTuple } from "./coordinate-
|
|
3
|
-
import { t as ERROR_CODES$1 } from "./inference-
|
|
4
|
-
import {
|
|
2
|
+
import { a as columnLetterFromIndex, g as tupleToCoordinate, i as columnIndexFromLetter, s as coordinateToTuple } from "./coordinate-Bt5Gni2I.mjs";
|
|
3
|
+
import { r as normalizeFormulaText, t as ERROR_CODES$1 } from "./inference-BMvv9cUY.mjs";
|
|
4
|
+
import { A as setSharedFormula, E as setArrayFormula, O as setDataTableFormula, c as getCoordinate, k as setFormula } from "./cell-Df3cKRIl.mjs";
|
|
5
5
|
import { C as makeSurface3DChart, S as makeStockChart, _ as makePie3DChart, a as makeArea3DChart, b as makeScatterChart, c as makeBarChart, d as makeBubbleSeries, f as makeChartSpace, g as makeOfPieChart, h as makeLineChart, l as makeBarSeries, m as makeLine3DChart, n as makeChartDrawing, o as makeAreaChart, p as makeDoughnutChart, s as makeBar3DChart, u as makeBubbleChart, v as makePieChart, w as makeSurfaceChart, x as makeScatterSeries, y as makeRadarChart } from "./user-shapes-DfmCGKB0.mjs";
|
|
6
6
|
import { t as makeChartsheet } from "./chartsheet-C3-tqkPy.mjs";
|
|
7
|
-
import { o as makeDrawing } from "./drawing-
|
|
7
|
+
import { o as makeDrawing } from "./drawing-ZJ3h4VHD.mjs";
|
|
8
8
|
import { n as VALUED_COLOR_MOD_KINDS, r as VALUELESS_COLOR_MOD_KINDS, t as SCHEME_COLOR_NAMES } from "./colors-ovWAwnZI.mjs";
|
|
9
|
-
import { n as escapeXmlAttr$1, r as escapeXmlText$1, t as escapeCellString } from "./escape-
|
|
9
|
+
import { n as escapeXmlAttr$1, r as escapeXmlText$1, t as escapeCellString } from "./escape-rnWSPpWY.mjs";
|
|
10
10
|
import { H as DRAWING_NS, I as CX_NS, T as CHART_NS, a as findChildren, bt as X14_NS, dt as SHEET_DRAWING_NS, ft as SHEET_MAIN_NS, i as findChild, jt as qname, lt as REL_NS, n as el, q as MARKUP_COMPAT_NS, w as CHART_DRAWING_NS } from "./tree-BX-sRRVp.mjs";
|
|
11
|
-
import { t as parseXml } from "./parser-
|
|
11
|
+
import { t as parseXml } from "./parser-By6RWZVW.mjs";
|
|
12
12
|
import { n as toTree, r as defineSchema, t as fromTree } from "./serialize-BC2Wu3bR.mjs";
|
|
13
|
-
import { t as serializeXml } from "./serializer-
|
|
14
|
-
import { Q as findById } from "./manifest-
|
|
15
|
-
import { $t as
|
|
16
|
-
import {
|
|
17
|
-
import { C as addSharedRichText, O as parseRichString, w as addSharedString } from "./workbook-
|
|
18
|
-
import { a as makeCfRule, i as makeDataValidation, n as makeTableColumn, o as makeConditionalFormatting, r as makeTableDefinition } from "./table-
|
|
13
|
+
import { t as serializeXml } from "./serializer-C6nm0mRJ.mjs";
|
|
14
|
+
import { Q as findById } from "./manifest-pLmx7KYh.mjs";
|
|
15
|
+
import { $t as makeColumnDimension, Qt as makeSheetView, Tn as makeColor, Yt as makeLegacyComment, cn as parseRange, en as makeRowDimension, fn as rangeToString, on as multiCellRangeToString, ot as makeWorksheet, sn as parseMultiCellRange, xt as setCell } from "./worksheet-4xW-i8j9.mjs";
|
|
16
|
+
import { Bt as PATTERN_TYPES, Ft as FONT_SCHEMES, It as UNDERLINE_STYLES, Kt as SIDE_STYLES, Lt as VERT_ALIGNS, Xt as HORIZONTAL_ALIGNMENTS, Zt as VERTICAL_ALIGNMENTS } from "./cell-style-BFmJOmcx.mjs";
|
|
17
|
+
import { C as addSharedRichText, O as parseRichString, w as addSharedString } from "./workbook-B15-T4cs.mjs";
|
|
18
|
+
import { a as makeCfRule, i as makeDataValidation, n as makeTableColumn, o as makeConditionalFormatting, r as makeTableDefinition } from "./table-Ccro4rrz.mjs";
|
|
19
19
|
import { i as durationToExcel, r as dateToExcel } from "./datetime-B2ySVlXt.mjs";
|
|
20
|
-
import { n as getDxfs } from "./differential-
|
|
20
|
+
import { n as getDxfs } from "./differential-H9SjEeIU.mjs";
|
|
21
21
|
//#region src/drawing/dml/effect.ts
|
|
22
22
|
const PRESET_SHADOW_NAMES = [
|
|
23
23
|
"shdw1",
|
|
@@ -6156,10 +6156,11 @@ const decodeCachedValue = (raw, t) => {
|
|
|
6156
6156
|
};
|
|
6157
6157
|
const handleFormula = (cell, fNode, coord, cached, sharedFormulas) => {
|
|
6158
6158
|
const tAttr = fNode.attrs["t"] ?? "normal";
|
|
6159
|
-
const formula = fNode.text ?? "";
|
|
6159
|
+
const formula = normalizeFormulaText(fNode.text ?? "");
|
|
6160
6160
|
const opts = cached !== void 0 ? { cachedValue: cached } : void 0;
|
|
6161
6161
|
switch (tAttr) {
|
|
6162
6162
|
case "normal":
|
|
6163
|
+
if (formula.length === 0) throw new OpenXmlSchemaError(`worksheet: <f> at ${tupleToCoordinate(coord.col, coord.row)} has no formula text`);
|
|
6163
6164
|
setFormula(cell, formula, opts);
|
|
6164
6165
|
return;
|
|
6165
6166
|
case "array": {
|
|
@@ -6185,8 +6186,7 @@ const handleFormula = (cell, fNode, coord, cached, sharedFormulas) => {
|
|
|
6185
6186
|
const cache = sharedFormulas.get(si);
|
|
6186
6187
|
if (!cache) throw new OpenXmlSchemaError(`worksheet: <f t="shared" si="${si}"/> with no preceding origin formula`);
|
|
6187
6188
|
const dest = tupleToCoordinate(coord.col, coord.row);
|
|
6188
|
-
|
|
6189
|
-
setSharedFormula(cell, si, translated.startsWith("=") ? translated.slice(1) : translated, void 0, opts);
|
|
6189
|
+
setSharedFormula(cell, si, translateFormula(`=${cache.formula}`, cache.origin, { dest }), void 0, opts);
|
|
6190
6190
|
return;
|
|
6191
6191
|
}
|
|
6192
6192
|
case "dataTable": {
|
|
@@ -6489,7 +6489,9 @@ function serializeWorksheet(ws, ctx) {
|
|
|
6489
6489
|
parts.push(`<row r="${rowIdx}"${dimAttrs}>`);
|
|
6490
6490
|
for (const colIdx of colKeys) {
|
|
6491
6491
|
const cell = row.get(colIdx);
|
|
6492
|
-
if (cell)
|
|
6492
|
+
if (!cell) continue;
|
|
6493
|
+
if (cell.styleId !== 0 && (!Number.isInteger(cell.styleId) || cell.styleId < 0 || cell.styleId >= ctx.styles.cellXfs.length)) throw unknownStyleId(cell, ws.title, ctx.styles.cellXfs.length);
|
|
6494
|
+
parts.push(serializeCell(cell, ctx));
|
|
6493
6495
|
}
|
|
6494
6496
|
parts.push("</row>");
|
|
6495
6497
|
}
|
|
@@ -6587,6 +6589,15 @@ const serializeDimension = (ws) => {
|
|
|
6587
6589
|
const col2 = colLetters(maxCol);
|
|
6588
6590
|
return `<dimension ref="${minRow === maxRow && minCol === maxCol ? `${col1}${minRow}` : `${col1}${minRow}:${col2}${maxRow}`}"/>`;
|
|
6589
6591
|
};
|
|
6592
|
+
/**
|
|
6593
|
+
* Excel resolves `<c s="n">` against `cellXfs`, and refuses to open a sheet
|
|
6594
|
+
* whose `n` names no entry: the file loads with the repair dialog and the sheet
|
|
6595
|
+
* is dropped. A `styleId` that leaves the pool it came from is the way to get
|
|
6596
|
+
* there, most often an id from `registerCellStyle` applied to a cell in a
|
|
6597
|
+
* different workbook, so refuse to emit rather than write a file Excel will
|
|
6598
|
+
* reject.
|
|
6599
|
+
*/
|
|
6600
|
+
const unknownStyleId = (cell, sheetTitle, xfCount) => new OpenXmlSchemaError(`Cell ${getCoordinate(cell)} on sheet "${sheetTitle}" has styleId ${cell.styleId}, outside this workbook's cellXfs pool [0, ${xfCount}). A styleId is an index into one workbook's stylesheet; ids from registerCellStyle are valid only for the workbook that produced them.`);
|
|
6590
6601
|
const colLetters = (n) => {
|
|
6591
6602
|
let m = n;
|
|
6592
6603
|
let out = "";
|
|
@@ -6651,7 +6662,9 @@ const serializeFormulaCell = (ref, styleAttr, f) => {
|
|
|
6651
6662
|
if (f.aca) fAttrs.push("aca=\"1\"");
|
|
6652
6663
|
if (f.ca) fAttrs.push("ca=\"1\"");
|
|
6653
6664
|
const fAttrStr = fAttrs.length > 0 ? ` ${fAttrs.join(" ")}` : "";
|
|
6654
|
-
const
|
|
6665
|
+
const normalized = normalizeFormulaText(f.formula);
|
|
6666
|
+
if ((f.t === "normal" || f.t === "array") && normalized.length === 0) throw new OpenXmlSchemaError(`worksheet: ${f.t} formula must not be empty at ${ref}`);
|
|
6667
|
+
const formulaText = escapeXmlText(escapeCellString(normalized));
|
|
6655
6668
|
const fEl = formulaText.length > 0 ? `<f${fAttrStr}>${formulaText}</f>` : `<f${fAttrStr}/>`;
|
|
6656
6669
|
let valueAttr = "";
|
|
6657
6670
|
let vEl = "";
|
|
@@ -6798,7 +6811,7 @@ const serializeCfRule = (rule) => {
|
|
|
6798
6811
|
if (rule.stdDev !== void 0) attrs += ` stdDev="${rule.stdDev}"`;
|
|
6799
6812
|
if (rule.timePeriod !== void 0) attrs += ` timePeriod="${rule.timePeriod}"`;
|
|
6800
6813
|
const inner = [];
|
|
6801
|
-
for (const f of rule.formulas) inner.push(`<formula>${escapeXmlText(f)}</formula>`);
|
|
6814
|
+
for (const f of rule.formulas) inner.push(`<formula>${escapeXmlText(normalizeFormulaText(f))}</formula>`);
|
|
6802
6815
|
if (rule.innerXml) inner.push(rule.innerXml);
|
|
6803
6816
|
if (inner.length === 0) return `<cfRule${attrs}/>`;
|
|
6804
6817
|
return `<cfRule${attrs}>${inner.join("")}</cfRule>`;
|
|
@@ -6823,8 +6836,8 @@ const serializeDataValidation = (dv) => {
|
|
|
6823
6836
|
if (dv.prompt !== void 0) attrs += ` prompt="${escapeXmlAttr(dv.prompt)}"`;
|
|
6824
6837
|
attrs += ` sqref="${escapeXmlAttr(multiCellRangeToString(dv.sqref))}"`;
|
|
6825
6838
|
const formulas = [];
|
|
6826
|
-
if (dv.formula1 !== void 0) formulas.push(`<formula1>${escapeXmlText(dv.formula1)}</formula1>`);
|
|
6827
|
-
if (dv.formula2 !== void 0) formulas.push(`<formula2>${escapeXmlText(dv.formula2)}</formula2>`);
|
|
6839
|
+
if (dv.formula1 !== void 0) formulas.push(`<formula1>${escapeXmlText(normalizeFormulaText(dv.formula1))}</formula1>`);
|
|
6840
|
+
if (dv.formula2 !== void 0) formulas.push(`<formula2>${escapeXmlText(normalizeFormulaText(dv.formula2))}</formula2>`);
|
|
6828
6841
|
if (formulas.length === 0) return `<dataValidation${attrs}/>`;
|
|
6829
6842
|
return `<dataValidation${attrs}>${formulas.join("")}</dataValidation>`;
|
|
6830
6843
|
};
|
|
@@ -8709,4 +8722,4 @@ const cellXfToTree = (xf) => {
|
|
|
8709
8722
|
//#endregion
|
|
8710
8723
|
export { chartExToBytes as C, findUserShapesRId as D, chartToBytes as E, parseChartXml as O, userShapesToBytes as S, parseChartExXml as T, parseChartsheetXml as _, parseCommentsXml as a, parseWorksheetXml as b, NumberFormatSchema as c, BorderSchema as d, AlignmentSchema as f, chartsheetToBytes as g, parseDrawingXml as h, commentsToBytes as i, FontSchema as l, drawingToBytes as m, parseTableXml as n, placeholderVmlDrawing as o, collectRawRelIds as p, tableToBytes as r, ProtectionSchema as s, stylesheetToBytes as t, fillFromTree as u, serializeCell as v, isChartExBytes as w, parseUserShapesXml as x, worksheetToBytes as y };
|
|
8711
8724
|
|
|
8712
|
-
//# sourceMappingURL=stylesheet-writer-
|
|
8725
|
+
//# sourceMappingURL=stylesheet-writer-D7Uug85X.mjs.map
|