@extend-ai/react-xlsx 0.19.0 → 0.20.1
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 +2 -1
- package/dist/{chart-renderer-LHXMRBGR.cjs → chart-renderer-K2VM257E.cjs} +44 -39
- package/dist/chart-renderer-K2VM257E.cjs.map +1 -0
- package/dist/{chart-renderer-HVOEAQXK.cjs → chart-renderer-K6GORT3R.cjs} +44 -39
- package/dist/chart-renderer-K6GORT3R.cjs.map +1 -0
- package/dist/{chart-renderer-R2B4I2HL.js → chart-renderer-KGLAI4DN.js} +25 -20
- package/dist/chart-renderer-KGLAI4DN.js.map +1 -0
- package/dist/{chart-renderer-3K2VKB5I.js → chart-renderer-RXO7WP4Q.js} +25 -20
- package/dist/chart-renderer-RXO7WP4Q.js.map +1 -0
- package/dist/{chunk-ZIO47YMT.cjs → chunk-2MVEKDY2.cjs} +4 -4
- package/dist/{chunk-ZIO47YMT.cjs.map → chunk-2MVEKDY2.cjs.map} +1 -1
- package/dist/{chunk-3O2QY6LA.js → chunk-3JTCYAUX.js} +3 -3
- package/dist/{chunk-4VX5HTCF.cjs → chunk-54YBFWL3.cjs} +4 -4
- package/dist/{chunk-4VX5HTCF.cjs.map → chunk-54YBFWL3.cjs.map} +1 -1
- package/dist/{chunk-T5WZHPIN.cjs → chunk-AD4CGQN2.cjs} +2 -2
- package/dist/{chunk-T5WZHPIN.cjs.map → chunk-AD4CGQN2.cjs.map} +1 -1
- package/dist/{chunk-Y737JKUG.js → chunk-GXJO6CK6.js} +136 -33
- package/dist/chunk-GXJO6CK6.js.map +1 -0
- package/dist/{chunk-TYJLNPNE.cjs → chunk-HAHCVXCU.cjs} +922 -819
- package/dist/chunk-HAHCVXCU.cjs.map +1 -0
- package/dist/{chunk-E2VSYCP2.cjs → chunk-O3V2MCOC.cjs} +18 -2
- package/dist/chunk-O3V2MCOC.cjs.map +1 -0
- package/dist/{chunk-BAAMDEDS.js → chunk-VXBNYHW5.js} +18 -2
- package/dist/{chunk-BAAMDEDS.js.map → chunk-VXBNYHW5.js.map} +1 -1
- package/dist/{chunk-O7S3Y6II.js → chunk-WSQDFXDW.js} +3 -3
- package/dist/index.cjs +617 -530
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +115 -28
- package/dist/index.js.map +1 -1
- package/dist/{internal-DSz8QMhK.d.cts → internal-trWFv9In.d.cts} +5 -0
- package/dist/{internal-DSz8QMhK.d.ts → internal-trWFv9In.d.ts} +5 -0
- package/dist/internal.cjs +4 -4
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +2 -2
- package/dist/{region-map-geography-6TGXBY3V.cjs → region-map-geography-VEN5CPRS.cjs} +2 -2
- package/dist/{region-map-geography-6TGXBY3V.cjs.map → region-map-geography-VEN5CPRS.cjs.map} +1 -1
- package/dist/{spreadsheet-font-assets-4AHYDTAQ.cjs → spreadsheet-font-assets-6FKCVICP.cjs} +2 -2
- package/dist/{spreadsheet-font-assets-4AHYDTAQ.cjs.map → spreadsheet-font-assets-6FKCVICP.cjs.map} +1 -1
- package/dist/{surface-regl-MAPCPD7W.cjs → surface-regl-2NNG62KS.cjs} +18 -15
- package/dist/surface-regl-2NNG62KS.cjs.map +1 -0
- package/dist/{surface-regl-NWR5ZZ5D.js → surface-regl-7CDGGVDG.js} +10 -7
- package/dist/surface-regl-7CDGGVDG.js.map +1 -0
- package/dist/{surface-regl-PWTZWQQS.cjs → surface-regl-SUJ2TFZA.cjs} +18 -15
- package/dist/surface-regl-SUJ2TFZA.cjs.map +1 -0
- package/dist/{surface-regl-KW4JL325.js → surface-regl-TJUWTLAZ.js} +10 -7
- package/dist/surface-regl-TJUWTLAZ.js.map +1 -0
- package/dist/vanilla.cjs +4 -4
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +2 -2
- package/dist/xlsx-worker.js +67 -1
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chart-renderer-3K2VKB5I.js.map +0 -1
- package/dist/chart-renderer-HVOEAQXK.cjs.map +0 -1
- package/dist/chart-renderer-LHXMRBGR.cjs.map +0 -1
- package/dist/chart-renderer-R2B4I2HL.js.map +0 -1
- package/dist/chunk-E2VSYCP2.cjs.map +0 -1
- package/dist/chunk-TYJLNPNE.cjs.map +0 -1
- package/dist/chunk-Y737JKUG.js.map +0 -1
- package/dist/surface-regl-KW4JL325.js.map +0 -1
- package/dist/surface-regl-MAPCPD7W.cjs.map +0 -1
- package/dist/surface-regl-NWR5ZZ5D.js.map +0 -1
- package/dist/surface-regl-PWTZWQQS.cjs.map +0 -1
- /package/dist/{chunk-3O2QY6LA.js.map → chunk-3JTCYAUX.js.map} +0 -0
- /package/dist/{chunk-O7S3Y6II.js.map → chunk-WSQDFXDW.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;require('./chunk-54YBFWL3.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -6,7 +6,70 @@
|
|
|
6
6
|
var _chunk5ERNVHSOcjs = require('./chunk-5ERNVHSO.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkAD4CGQN2cjs = require('./chunk-AD4CGQN2.cjs');
|
|
10
|
+
|
|
11
|
+
// src/number-locale.ts
|
|
12
|
+
var separators = /* @__PURE__ */ new Map();
|
|
13
|
+
function parseLocaleNumber(text, locale) {
|
|
14
|
+
if (locale === "en-US") return void 0;
|
|
15
|
+
const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);
|
|
16
|
+
const decimal = _nullishCoalesce(_optionalChain([parts, 'access', _2 => _2.find, 'call', _3 => _3((part) => part.type === "decimal"), 'optionalAccess', _4 => _4.value]), () => ( "."));
|
|
17
|
+
const group = _nullishCoalesce(_optionalChain([parts, 'access', _5 => _5.find, 'call', _6 => _6((part) => part.type === "group"), 'optionalAccess', _7 => _7.value]), () => ( ","));
|
|
18
|
+
let normalized = text.trim();
|
|
19
|
+
const percent = normalized.endsWith("%");
|
|
20
|
+
if (percent) normalized = normalized.slice(0, -1).trim();
|
|
21
|
+
normalized = group.trim() === "" ? normalized.replace(/[ \u00a0\u202f]/g, "") : normalized.split(group).join("");
|
|
22
|
+
normalized = normalized.replace(decimal, ".");
|
|
23
|
+
if (!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(normalized)) return void 0;
|
|
24
|
+
const value = Number(normalized) / (percent ? 100 : 1);
|
|
25
|
+
return Number.isFinite(value) ? value : void 0;
|
|
26
|
+
}
|
|
27
|
+
function localizeCellNumber(worksheet, row, col, text, locale = "en-US") {
|
|
28
|
+
if (locale === "en-US" || !text) return text;
|
|
29
|
+
const value = worksheet.getCalculatedValueAt(row, col);
|
|
30
|
+
try {
|
|
31
|
+
if (!value.is_number) return text;
|
|
32
|
+
} finally {
|
|
33
|
+
value.free();
|
|
34
|
+
}
|
|
35
|
+
const style = worksheet.getCellStyleAt(row, col);
|
|
36
|
+
const format = _optionalChain([style, 'optionalAccess', _8 => _8.numberFormat]);
|
|
37
|
+
if (_optionalChain([format, 'optionalAccess', _9 => _9.isDateFormat])) return text;
|
|
38
|
+
let symbols = separators.get(locale);
|
|
39
|
+
if (!symbols) {
|
|
40
|
+
const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);
|
|
41
|
+
symbols = {
|
|
42
|
+
decimal: _nullishCoalesce(_optionalChain([parts, 'access', _10 => _10.find, 'call', _11 => _11((part) => part.type === "decimal"), 'optionalAccess', _12 => _12.value]), () => ( ".")),
|
|
43
|
+
group: _nullishCoalesce(_optionalChain([parts, 'access', _13 => _13.find, 'call', _14 => _14((part) => part.type === "group"), 'optionalAccess', _15 => _15.value]), () => ( ","))
|
|
44
|
+
};
|
|
45
|
+
if (separators.size >= 100) separators.clear();
|
|
46
|
+
separators.set(locale, symbols);
|
|
47
|
+
}
|
|
48
|
+
if (symbols.decimal === "." && symbols.group === ",") return text;
|
|
49
|
+
const protectedPositions = /* @__PURE__ */ new Set();
|
|
50
|
+
const code = _nullishCoalesce(_optionalChain([format, 'optionalAccess', _16 => _16.formatString]), () => ( ""));
|
|
51
|
+
const literalPattern = /"[^"]*"|\\.|\[[^\]]*\]/g;
|
|
52
|
+
const firstPlaceholder = code.replace(literalPattern, (token) => " ".repeat(token.length)).search(/[0#?]/);
|
|
53
|
+
const literals = [...code.matchAll(literalPattern)];
|
|
54
|
+
let suffixEnd = text.length;
|
|
55
|
+
let prefixStart = 0;
|
|
56
|
+
const protect = (token, suffix) => {
|
|
57
|
+
const literal = token.startsWith('"') ? token.slice(1, -1) : token.startsWith("\\") ? token.slice(1) : token.startsWith("[$") ? token.slice(2, -1).split("-")[0] : "";
|
|
58
|
+
if (!literal) return;
|
|
59
|
+
const offset = suffix ? text.lastIndexOf(literal, suffixEnd - literal.length) : text.indexOf(literal, prefixStart);
|
|
60
|
+
if (offset >= 0) {
|
|
61
|
+
for (let i = offset; i < offset + literal.length; i++) protectedPositions.add(i);
|
|
62
|
+
if (suffix) suffixEnd = offset;
|
|
63
|
+
else prefixStart = offset + literal.length;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
for (const token of literals.filter((token2) => token2.index < firstPlaceholder)) protect(token[0], false);
|
|
67
|
+
for (const token of literals.filter((token2) => token2.index >= firstPlaceholder).reverse()) protect(token[0], true);
|
|
68
|
+
return text.replace(
|
|
69
|
+
/\d[\d,]*(?:\.\d*)?|\.\d+/g,
|
|
70
|
+
(number, offset) => number.replace(/[.,]/g, (separator, index) => protectedPositions.has(offset + index) ? separator : separator === "." ? symbols.decimal : symbols.group)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
10
73
|
|
|
11
74
|
// src/spreadsheet-fonts.ts
|
|
12
75
|
var fontLoadPromise;
|
|
@@ -15,7 +78,7 @@ function loadSpreadsheetFonts() {
|
|
|
15
78
|
if (typeof document === "undefined" || typeof FontFace === "undefined") {
|
|
16
79
|
return Promise.resolve();
|
|
17
80
|
}
|
|
18
|
-
return fontLoadPromise ??= Promise.resolve().then(() => _interopRequireWildcard(require("./spreadsheet-font-assets-
|
|
81
|
+
return fontLoadPromise ??= Promise.resolve().then(() => _interopRequireWildcard(require("./spreadsheet-font-assets-6FKCVICP.cjs"))).then(async ({ spreadsheetFontFaces }) => {
|
|
19
82
|
await Promise.allSettled(spreadsheetFontFaces.map(async ({ source, ...descriptors }) => {
|
|
20
83
|
const face = new FontFace(SPREADSHEET_FALLBACK_FONT, `url(${JSON.stringify(source)})`, descriptors);
|
|
21
84
|
await face.load();
|
|
@@ -122,19 +185,19 @@ function splitTopLevelSeriesArguments(value) {
|
|
|
122
185
|
}
|
|
123
186
|
function readSeriesNameFormula(series) {
|
|
124
187
|
const raw = series.raw && typeof series.raw === "object" ? series.raw : null;
|
|
125
|
-
return typeof _optionalChain([raw, 'optionalAccess',
|
|
188
|
+
return typeof _optionalChain([raw, 'optionalAccess', _17 => _17.name]) === "string" && raw.name.length > 0 ? raw.name : null;
|
|
126
189
|
}
|
|
127
190
|
function buildChartSeriesFormula(chart, seriesIndex) {
|
|
128
|
-
const series = _optionalChain([chart, 'optionalAccess',
|
|
191
|
+
const series = _optionalChain([chart, 'optionalAccess', _18 => _18.series, 'access', _19 => _19[seriesIndex]]);
|
|
129
192
|
if (!chart || !series) {
|
|
130
193
|
return "";
|
|
131
194
|
}
|
|
132
195
|
const nameFormula = readSeriesNameFormula(series);
|
|
133
196
|
const nameArgument = _nullishCoalesce(nameFormula, () => ( quoteSeriesFormulaString(_nullishCoalesce(series.name, () => ( `Series ${seriesIndex + 1}`)))));
|
|
134
|
-
const categoryArgument = _nullishCoalesce(_optionalChain([series, 'access',
|
|
135
|
-
const valueArgument = _nullishCoalesce(_optionalChain([series, 'access',
|
|
197
|
+
const categoryArgument = _nullishCoalesce(_optionalChain([series, 'access', _20 => _20.categoriesRef, 'optionalAccess', _21 => _21.formula]), () => ( ""));
|
|
198
|
+
const valueArgument = _nullishCoalesce(_optionalChain([series, 'access', _22 => _22.valuesRef, 'optionalAccess', _23 => _23.formula]), () => ( ""));
|
|
136
199
|
const orderArgument = String(seriesIndex + 1);
|
|
137
|
-
const bubbleArgument = _optionalChain([series, 'access',
|
|
200
|
+
const bubbleArgument = _optionalChain([series, 'access', _24 => _24.bubbleSizeRef, 'optionalAccess', _25 => _25.formula]);
|
|
138
201
|
return [
|
|
139
202
|
`=SERIES(${nameArgument}`,
|
|
140
203
|
categoryArgument,
|
|
@@ -151,7 +214,7 @@ function parseChartSeriesFormula(formula, chart) {
|
|
|
151
214
|
return null;
|
|
152
215
|
}
|
|
153
216
|
const args = splitTopLevelSeriesArguments(match[1]);
|
|
154
|
-
const isBubble = _optionalChain([chart, 'optionalAccess',
|
|
217
|
+
const isBubble = _optionalChain([chart, 'optionalAccess', _26 => _26.chartType]) === "Bubble";
|
|
155
218
|
if (args.length < 4 || args.length > 5 || isBubble && args.length !== 5) {
|
|
156
219
|
return null;
|
|
157
220
|
}
|
|
@@ -202,7 +265,7 @@ function applyChartSeriesFormula(chart, seriesIndex, formula, workbook) {
|
|
|
202
265
|
const nextSeries = {
|
|
203
266
|
...currentSeries,
|
|
204
267
|
bubbleSizeRef,
|
|
205
|
-
bubbleSizes: workbook && _optionalChain([bubbleSizeRef, 'optionalAccess',
|
|
268
|
+
bubbleSizes: workbook && _optionalChain([bubbleSizeRef, 'optionalAccess', _27 => _27.formula]) ? resolveReferenceValues(workbook, chart.workbookSheetIndex, bubbleSizeRef, "value").map((value) => typeof value === "number" && Number.isFinite(value) ? value : null) : currentSeries.bubbleSizes,
|
|
206
269
|
categories: workbook ? resolveReferenceValues(workbook, chart.workbookSheetIndex, categoriesRef, "category") : currentSeries.categories,
|
|
207
270
|
categoriesRef,
|
|
208
271
|
name: _nullishCoalesce(parsed.nameLiteral, () => ( (parsed.nameFormula && workbook ? resolveSeriesName(workbook, chart.workbookSheetIndex, parsed.nameFormula) : _nullishCoalesce(parsed.nameFormula, () => ( currentSeries.name))))),
|
|
@@ -276,11 +339,11 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
|
|
|
276
339
|
return void 0;
|
|
277
340
|
}
|
|
278
341
|
const srgbMatch = fragment.match(/<a:srgbClr\b[^>]*\bval="([0-9a-fA-F]{6,8})"/i);
|
|
279
|
-
if (_optionalChain([srgbMatch, 'optionalAccess',
|
|
342
|
+
if (_optionalChain([srgbMatch, 'optionalAccess', _28 => _28[1]])) {
|
|
280
343
|
return _nullishCoalesce(normalizeHexColor(srgbMatch[1]), () => ( void 0));
|
|
281
344
|
}
|
|
282
345
|
const schemeMatch = _nullishCoalesce(fragment.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*>([\s\S]*?)<\/a:schemeClr>/i), () => ( fragment.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*/i)));
|
|
283
|
-
if (!_optionalChain([schemeMatch, 'optionalAccess',
|
|
346
|
+
if (!_optionalChain([schemeMatch, 'optionalAccess', _29 => _29[1]])) {
|
|
284
347
|
return void 0;
|
|
285
348
|
}
|
|
286
349
|
const baseColor = resolveThemeColor(schemeMatch[1], themePalette);
|
|
@@ -291,7 +354,7 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
|
|
|
291
354
|
let lightnessModifier = 1;
|
|
292
355
|
let lightnessOffset = 0;
|
|
293
356
|
for (const match of transforms.matchAll(/<a:(lumMod|lumOff|tint|shade)\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/gi)) {
|
|
294
|
-
const transform = _optionalChain([match, 'access',
|
|
357
|
+
const transform = _optionalChain([match, 'access', _30 => _30[1], 'optionalAccess', _31 => _31.toLowerCase, 'call', _32 => _32()]);
|
|
295
358
|
const rawValue = Number(_nullishCoalesce(match[2], () => ( Number.NaN)));
|
|
296
359
|
if (!transform || !Number.isFinite(rawValue)) {
|
|
297
360
|
continue;
|
|
@@ -309,7 +372,7 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
|
|
|
309
372
|
return _nullishCoalesce(applyLightnessTransform(baseColor, lightnessModifier, lightnessOffset), () => ( void 0));
|
|
310
373
|
}
|
|
311
374
|
function readHexColorFromXmlFragment(fragment, preferLine = false, themePalette) {
|
|
312
|
-
const source = preferLine ? _nullishCoalesce(_optionalChain([fragment, 'access',
|
|
375
|
+
const source = preferLine ? _nullishCoalesce(_optionalChain([fragment, 'access', _33 => _33.match, 'call', _34 => _34(/<a:ln\b[\s\S]*?<\/a:ln>/i), 'optionalAccess', _35 => _35[0]]), () => ( "")) : _nullishCoalesce(_optionalChain([fragment, 'access', _36 => _36.match, 'call', _37 => _37(/<a:solidFill\b[\s\S]*?<\/a:solidFill>/i), 'optionalAccess', _38 => _38[0]]), () => ( ""));
|
|
313
376
|
return resolveColorFromXmlFragment(source, themePalette);
|
|
314
377
|
}
|
|
315
378
|
function parseFallbackSeriesStylesFromChartXml(chartXml, themePalette) {
|
|
@@ -318,7 +381,7 @@ function parseFallbackSeriesStylesFromChartXml(chartXml, themePalette) {
|
|
|
318
381
|
return [];
|
|
319
382
|
}
|
|
320
383
|
return seriesBlocks.map((seriesBlock) => {
|
|
321
|
-
const shapeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access',
|
|
384
|
+
const shapeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _39 => _39.match, 'call', _40 => _40(/<c:spPr\b[\s\S]*?<\/c:spPr>/i), 'optionalAccess', _41 => _41[0]]), () => ( ""));
|
|
322
385
|
return {
|
|
323
386
|
color: readHexColorFromXmlFragment(shapeBlock, false, themePalette),
|
|
324
387
|
lineColor: readHexColorFromXmlFragment(shapeBlock, true, themePalette)
|
|
@@ -362,12 +425,12 @@ function parseFallbackPointStylesFromChartXml(chartXml, themePalette) {
|
|
|
362
425
|
const styles = [];
|
|
363
426
|
for (const pointBlock of pointBlocks) {
|
|
364
427
|
const indexMatch = pointBlock.match(/<c:idx\b[^>]*\bval="(-?\d+)"/i);
|
|
365
|
-
const index = _optionalChain([indexMatch, 'optionalAccess',
|
|
428
|
+
const index = _optionalChain([indexMatch, 'optionalAccess', _42 => _42[1]]) ? Number(indexMatch[1]) : Number.NaN;
|
|
366
429
|
if (!Number.isFinite(index)) {
|
|
367
430
|
continue;
|
|
368
431
|
}
|
|
369
432
|
const explosionMatch = pointBlock.match(/<c:explosion\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/i);
|
|
370
|
-
const explosionValue = _optionalChain([explosionMatch, 'optionalAccess',
|
|
433
|
+
const explosionValue = _optionalChain([explosionMatch, 'optionalAccess', _43 => _43[1]]) ? Number(explosionMatch[1]) : Number.NaN;
|
|
371
434
|
styles.push({
|
|
372
435
|
color: readHexColorFromXmlFragment(pointBlock, false, themePalette),
|
|
373
436
|
explosion: Number.isFinite(explosionValue) ? explosionValue : void 0,
|
|
@@ -384,7 +447,7 @@ function parseNumericPointCacheFromXmlFragment(fragment) {
|
|
|
384
447
|
return [];
|
|
385
448
|
}
|
|
386
449
|
const explicitPointCountMatch = fragment.match(/<c:ptCount\b[^>]*\bval="(\d+)"/i);
|
|
387
|
-
const explicitPointCount = _optionalChain([explicitPointCountMatch, 'optionalAccess',
|
|
450
|
+
const explicitPointCount = _optionalChain([explicitPointCountMatch, 'optionalAccess', _44 => _44[1]]) ? Number(explicitPointCountMatch[1]) : Number.NaN;
|
|
388
451
|
const maxIndex = pointMatches.reduce((max, match) => {
|
|
389
452
|
const current = Number(_nullishCoalesce(match[1], () => ( Number.NaN)));
|
|
390
453
|
return Number.isFinite(current) ? Math.max(max, current) : max;
|
|
@@ -412,7 +475,7 @@ function parseFallbackBubbleSizesFromChartXml(chartXml) {
|
|
|
412
475
|
return [];
|
|
413
476
|
}
|
|
414
477
|
return seriesBlocks.map((seriesBlock) => {
|
|
415
|
-
const bubbleSizeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access',
|
|
478
|
+
const bubbleSizeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _45 => _45.match, 'call', _46 => _46(/<c:bubbleSize\b[\s\S]*?<\/c:bubbleSize>/i), 'optionalAccess', _47 => _47[0]]), () => ( ""));
|
|
416
479
|
if (!bubbleSizeBlock) {
|
|
417
480
|
return [];
|
|
418
481
|
}
|
|
@@ -534,17 +597,17 @@ function resolveThemeColor(name, themePalette) {
|
|
|
534
597
|
return null;
|
|
535
598
|
}
|
|
536
599
|
const index = THEME_COLOR_INDEX_BY_NAME[name];
|
|
537
|
-
return index === void 0 ? null : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
600
|
+
return index === void 0 ? null : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _48 => _48.colorsByIndex, 'access', _49 => _49[index]]), () => ( null));
|
|
538
601
|
}
|
|
539
602
|
function resolveThemeTypeface(typeface, themePalette) {
|
|
540
603
|
if (!typeface) {
|
|
541
604
|
return null;
|
|
542
605
|
}
|
|
543
606
|
if (typeface === "+mn-lt" || typeface === "+mn-ea" || typeface === "+mn-cs") {
|
|
544
|
-
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
607
|
+
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _50 => _50.minorLatinFont]), () => ( null));
|
|
545
608
|
}
|
|
546
609
|
if (typeface === "+mj-lt" || typeface === "+mj-ea" || typeface === "+mj-cs") {
|
|
547
|
-
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
610
|
+
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _51 => _51.majorLatinFont]), () => ( null));
|
|
548
611
|
}
|
|
549
612
|
return typeface;
|
|
550
613
|
}
|
|
@@ -556,8 +619,8 @@ function readChartTextTypeface(textPropertiesNode, themePalette) {
|
|
|
556
619
|
if (!defaultRunProperties) {
|
|
557
620
|
return null;
|
|
558
621
|
}
|
|
559
|
-
const typeface = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
560
|
-
const resolved = _nullishCoalesce(_optionalChain([resolveThemeTypeface, 'call',
|
|
622
|
+
const typeface = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _52 => _52(defaultRunProperties, "latin"), 'optionalAccess', _53 => _53.getAttribute, 'call', _54 => _54("typeface")]), () => ( _optionalChain([getFirstLocalChild, 'call', _55 => _55(defaultRunProperties, "ea"), 'optionalAccess', _56 => _56.getAttribute, 'call', _57 => _57("typeface")]))), () => ( _optionalChain([getFirstLocalChild, 'call', _58 => _58(defaultRunProperties, "cs"), 'optionalAccess', _59 => _59.getAttribute, 'call', _60 => _60("typeface")]))), () => ( null));
|
|
623
|
+
const resolved = _nullishCoalesce(_optionalChain([resolveThemeTypeface, 'call', _61 => _61(typeface, themePalette), 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]), () => ( ""));
|
|
561
624
|
return resolved.length > 0 ? resolved : null;
|
|
562
625
|
}
|
|
563
626
|
function resolveChartColorNode(node, themePalette) {
|
|
@@ -639,7 +702,7 @@ function resolveChartFillColor(shapeNode, themePalette) {
|
|
|
639
702
|
return resolveChartColorNode(midpointStop.colorNode, themePalette);
|
|
640
703
|
}
|
|
641
704
|
function resolveChartLineStyle(shapeNode, themePalette) {
|
|
642
|
-
const lineNode = _optionalChain([shapeNode, 'optionalAccess',
|
|
705
|
+
const lineNode = _optionalChain([shapeNode, 'optionalAccess', _64 => _64.localName]) === "ln" ? shapeNode : shapeNode ? getFirstLocalChild(shapeNode, "ln") : null;
|
|
643
706
|
if (!lineNode) {
|
|
644
707
|
return { color: null, hidden: false, widthPx: void 0 };
|
|
645
708
|
}
|
|
@@ -685,7 +748,7 @@ function normalizeLegendPosition(position) {
|
|
|
685
748
|
}
|
|
686
749
|
function readChartNumericAttribute(parent, localName) {
|
|
687
750
|
const node = parent ? getFirstLocalChild(parent, localName) : null;
|
|
688
|
-
const value = Number(_nullishCoalesce(_optionalChain([node, 'optionalAccess',
|
|
751
|
+
const value = Number(_nullishCoalesce(_optionalChain([node, 'optionalAccess', _65 => _65.getAttribute, 'call', _66 => _66("val")]), () => ( Number.NaN)));
|
|
689
752
|
return Number.isFinite(value) ? value : void 0;
|
|
690
753
|
}
|
|
691
754
|
function readChartBooleanAttribute(parent, localName) {
|
|
@@ -710,7 +773,7 @@ function readChartLabelFontSizePt(textPropertiesNode) {
|
|
|
710
773
|
return void 0;
|
|
711
774
|
}
|
|
712
775
|
const runPropertiesNode = _nullishCoalesce(getFirstLocalDescendant(textPropertiesNode, "defRPr"), () => ( getFirstLocalDescendant(textPropertiesNode, "rPr")));
|
|
713
|
-
const rawSize = Number(_nullishCoalesce(_optionalChain([runPropertiesNode, 'optionalAccess',
|
|
776
|
+
const rawSize = Number(_nullishCoalesce(_optionalChain([runPropertiesNode, 'optionalAccess', _67 => _67.getAttribute, 'call', _68 => _68("sz")]), () => ( Number.NaN)));
|
|
714
777
|
if (!Number.isFinite(rawSize) || rawSize <= 0) {
|
|
715
778
|
return void 0;
|
|
716
779
|
}
|
|
@@ -756,7 +819,7 @@ function parseChartDataLabelsFromXml(labelsNode) {
|
|
|
756
819
|
showSeriesName: readChartBooleanAttribute(labelsNode, "showSerName"),
|
|
757
820
|
showValue: readChartBooleanAttribute(labelsNode, "showVal")
|
|
758
821
|
};
|
|
759
|
-
const hasValue = labels.showBubbleSize !== void 0 || labels.showCategoryName !== void 0 || labels.showLegendKey !== void 0 || labels.showPercent !== void 0 || (_nullishCoalesce(_optionalChain([labels, 'access',
|
|
822
|
+
const hasValue = labels.showBubbleSize !== void 0 || labels.showCategoryName !== void 0 || labels.showLegendKey !== void 0 || labels.showPercent !== void 0 || (_nullishCoalesce(_optionalChain([labels, 'access', _69 => _69.pointLabels, 'optionalAccess', _70 => _70.length]), () => ( 0))) > 0 || labels.showSeriesName !== void 0 || labels.showValue !== void 0;
|
|
760
823
|
return hasValue ? labels : null;
|
|
761
824
|
}
|
|
762
825
|
function readChartRelationships(archive, chartPath) {
|
|
@@ -786,7 +849,7 @@ function readChartColorPalette(archive, colorStylePath, themePalette) {
|
|
|
786
849
|
return [];
|
|
787
850
|
}
|
|
788
851
|
const colorStyleDocument = parseXml(colorStyleXml);
|
|
789
|
-
if (!_optionalChain([colorStyleDocument, 'optionalAccess',
|
|
852
|
+
if (!_optionalChain([colorStyleDocument, 'optionalAccess', _71 => _71.documentElement])) {
|
|
790
853
|
return [];
|
|
791
854
|
}
|
|
792
855
|
return Array.from(colorStyleDocument.documentElement.childNodes).filter((child) => isElementNode(child) && child.localName !== "variation").map((child) => _nullishCoalesce(resolveChartColorNode(child, themePalette), () => ( resolveChartColorNode(findFirstChartColorElement(child), themePalette)))).filter((color) => typeof color === "string");
|
|
@@ -802,7 +865,7 @@ function readChartStyleAppearance(archive, stylePath, themePalette) {
|
|
|
802
865
|
}
|
|
803
866
|
const dataPointNode = getFirstLocalDescendant(styleDocument, "dataPoint");
|
|
804
867
|
const fillRefNode = dataPointNode ? getFirstLocalChild(dataPointNode, "fillRef") : null;
|
|
805
|
-
const index = Number(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess',
|
|
868
|
+
const index = Number(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _72 => _72.getAttribute, 'call', _73 => _73("idx")]), () => ( Number.NaN)));
|
|
806
869
|
const chartAreaNode = getFirstLocalDescendant(styleDocument, "chartArea");
|
|
807
870
|
const chartAreaShapeProperties = chartAreaNode ? getFirstLocalChild(chartAreaNode, "spPr") : null;
|
|
808
871
|
const chartAreaFontRef = chartAreaNode ? getFirstLocalChild(chartAreaNode, "fontRef") : null;
|
|
@@ -826,29 +889,29 @@ function readChartStyleAppearance(archive, stylePath, themePalette) {
|
|
|
826
889
|
};
|
|
827
890
|
}
|
|
828
891
|
function buildThemeSeriesPalette(themePalette) {
|
|
829
|
-
const themeColors = [4, 5, 6, 7, 8, 9].map((index) => _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
892
|
+
const themeColors = [4, 5, 6, 7, 8, 9].map((index) => _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _74 => _74.colorsByIndex, 'access', _75 => _75[index]]), () => ( null))).filter((color) => Boolean(color));
|
|
830
893
|
return themeColors.length > 0 ? themeColors : SERIES_COLORS;
|
|
831
894
|
}
|
|
832
895
|
function applyBuiltinSurfaceDefaults(chart, themePalette) {
|
|
833
896
|
if (chart.chartType !== "Surface") {
|
|
834
897
|
return;
|
|
835
898
|
}
|
|
836
|
-
const builtin = _optionalChain([chart, 'access',
|
|
837
|
-
const colors = _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
838
|
-
const wallFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess',
|
|
839
|
-
const floorFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess',
|
|
840
|
-
const gridlineColor = _chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess',
|
|
899
|
+
const builtin = _optionalChain([chart, 'access', _76 => _76.raw, 'optionalAccess', _77 => _77.hasCustomChartColorStyle]) !== true ? _chunk5ERNVHSOcjs.getBuiltinChartSurfaceStyle.call(void 0, chart.chartStyleId) : void 0;
|
|
900
|
+
const colors = _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _78 => _78.colorsByIndex]), () => ( {}));
|
|
901
|
+
const wallFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _79 => _79.wall, 'access', _80 => _80.fill]), colors), () => ( (chart.wireframe ? "#d0d0d0" : "#d9d9df")));
|
|
902
|
+
const floorFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _81 => _81.floor, 'access', _82 => _82.fill]), colors), () => ( wallFill));
|
|
903
|
+
const gridlineColor = _chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _83 => _83.majorGridline]), colors);
|
|
841
904
|
for (const axis of [chart.categoryAxis, chart.valueAxis, chart.seriesAxis]) {
|
|
842
905
|
if (axis && !axis.majorGridlineColor) axis.majorGridlineColor = gridlineColor;
|
|
843
906
|
}
|
|
844
907
|
const wallLine = chart.wireframe ? "#a6a6a6" : "#a8adb7";
|
|
845
|
-
const previousDefaults = _optionalChain([chart, 'access',
|
|
908
|
+
const previousDefaults = _optionalChain([chart, 'access', _84 => _84.raw, 'optionalAccess', _85 => _85.builtinSurfaceDefaults]);
|
|
846
909
|
const nextDefaults = {};
|
|
847
910
|
for (const key of ["floor", "sideWall", "backWall"]) {
|
|
848
911
|
const wall = _nullishCoalesce(chart[key], () => ( {}));
|
|
849
|
-
const previous = _optionalChain([previousDefaults, 'optionalAccess',
|
|
850
|
-
const fillIsDefault = wall.fillColor === void 0 || wall.fillColor === _optionalChain([previous, 'optionalAccess',
|
|
851
|
-
const lineIsDefault = wall.lineColor === void 0 || wall.lineColor === _optionalChain([previous, 'optionalAccess',
|
|
912
|
+
const previous = _optionalChain([previousDefaults, 'optionalAccess', _86 => _86[key]]);
|
|
913
|
+
const fillIsDefault = wall.fillColor === void 0 || wall.fillColor === _optionalChain([previous, 'optionalAccess', _87 => _87.fillColor]);
|
|
914
|
+
const lineIsDefault = wall.lineColor === void 0 || wall.lineColor === _optionalChain([previous, 'optionalAccess', _88 => _88.lineColor]);
|
|
852
915
|
const fillColor = fillIsDefault ? key === "floor" ? floorFill : wallFill : wall.fillColor;
|
|
853
916
|
const lineColor = lineIsDefault ? wallLine : wall.lineColor;
|
|
854
917
|
chart[key] = { ...wall, fillColor, lineColor };
|
|
@@ -864,8 +927,8 @@ function applyBuiltinSurfaceDefaults(chart, themePalette) {
|
|
|
864
927
|
}
|
|
865
928
|
function applyBuiltinChartDefaults(chart, themePalette) {
|
|
866
929
|
const darkBuiltInStyle = typeof chart.chartStyleId === "number" && chart.chartStyleId >= 140 && chart.chartStyleId < 150;
|
|
867
|
-
const textColor = _nullishCoalesce(_nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
868
|
-
const minorTypeface = _optionalChain([themePalette, 'optionalAccess',
|
|
930
|
+
const textColor = _nullishCoalesce(_nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _89 => _89.colorsByIndex, 'access', _90 => _90[1]]), () => ( _optionalChain([themePalette, 'optionalAccess', _91 => _91.colorsByIndex, 'access', _92 => _92[3]]))), () => ( null));
|
|
931
|
+
const minorTypeface = _optionalChain([themePalette, 'optionalAccess', _93 => _93.minorLatinFont, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]) || void 0;
|
|
869
932
|
const derivedAxisColor = textColor ? applyLightnessTransform(textColor, 0.35, 0.55) : null;
|
|
870
933
|
const derivedBorderColor = textColor ? applyLightnessTransform(textColor, chart.is3d ? 0.28 : 0.22, chart.is3d ? 0.6 : 0.7) : null;
|
|
871
934
|
if (darkBuiltInStyle) {
|
|
@@ -883,10 +946,10 @@ function applyBuiltinChartDefaults(chart, themePalette) {
|
|
|
883
946
|
chart.axisLineColor = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(chart.axisLineColor, () => ( derivedAxisColor)), () => ( textColor)), () => ( void 0));
|
|
884
947
|
chart.fontFamily = _nullishCoalesce(chart.fontFamily, () => ( minorTypeface));
|
|
885
948
|
chart.titleFontFamily = _nullishCoalesce(_nullishCoalesce(chart.titleFontFamily, () => ( chart.fontFamily)), () => ( minorTypeface));
|
|
886
|
-
const themeColors = _optionalChain([themePalette, 'optionalAccess',
|
|
887
|
-
const useBuiltin = _optionalChain([chart, 'access',
|
|
888
|
-
const colorCount = Math.max(1, chart.series.length, _nullishCoalesce(_optionalChain([chart, 'access',
|
|
889
|
-
const seriesPalette = useBuiltin && chart.chartType !== "Surface" ? Array.from({ length: colorCount }, (_, index) => _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, index, colorCount), themeColors), () => ( SERIES_COLORS[index % SERIES_COLORS.length]))) : _optionalChain([chart, 'access',
|
|
949
|
+
const themeColors = _optionalChain([themePalette, 'optionalAccess', _96 => _96.colorsByIndex]);
|
|
950
|
+
const useBuiltin = _optionalChain([chart, 'access', _97 => _97.raw, 'optionalAccess', _98 => _98.hasCustomChartColorStyle]) !== true && themeColors && _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, 0, 1) !== void 0;
|
|
951
|
+
const colorCount = Math.max(1, chart.series.length, _nullishCoalesce(_optionalChain([chart, 'access', _99 => _99.typeGroups, 'optionalAccess', _100 => _100.reduce, 'call', _101 => _101((total, group) => total + group.series.length, 0)]), () => ( 0)));
|
|
952
|
+
const seriesPalette = useBuiltin && chart.chartType !== "Surface" ? Array.from({ length: colorCount }, (_, index) => _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, index, colorCount), themeColors), () => ( SERIES_COLORS[index % SERIES_COLORS.length]))) : _optionalChain([chart, 'access', _102 => _102.chartColorPalette, 'optionalAccess', _103 => _103.length]) ? chart.chartColorPalette : buildThemeSeriesPalette(themePalette);
|
|
890
953
|
chart.chartColorPalette = seriesPalette;
|
|
891
954
|
chart.raw = { ...chart.raw, builtinThemeColors: useBuiltin ? themeColors : void 0 };
|
|
892
955
|
const applySeriesDefaults = (series, index) => {
|
|
@@ -896,7 +959,7 @@ function applyBuiltinChartDefaults(chart, themePalette) {
|
|
|
896
959
|
const generated = {};
|
|
897
960
|
const resolveColor = (key, explicit, fallback) => {
|
|
898
961
|
const value = series[key];
|
|
899
|
-
if (!explicit && (value == null || value === _optionalChain([previous, 'optionalAccess',
|
|
962
|
+
if (!explicit && (value == null || value === _optionalChain([previous, 'optionalAccess', _104 => _104[key]]) || (key === "color" || key === "lineColor") && useBuiltin && _optionalChain([chart, 'access', _105 => _105.raw, 'optionalAccess', _106 => _106.xmlChartType]))) {
|
|
900
963
|
generated[key] = fallback;
|
|
901
964
|
return fallback;
|
|
902
965
|
}
|
|
@@ -919,7 +982,7 @@ function applyBuiltinChartDefaults(chart, themePalette) {
|
|
|
919
982
|
};
|
|
920
983
|
chart.series = chart.series.map(applySeriesDefaults);
|
|
921
984
|
let groupSeriesOffset = 0;
|
|
922
|
-
chart.typeGroups = _optionalChain([chart, 'access',
|
|
985
|
+
chart.typeGroups = _optionalChain([chart, 'access', _107 => _107.typeGroups, 'optionalAccess', _108 => _108.map, 'call', _109 => _109((group) => {
|
|
923
986
|
const series = group.series.map((entry, index) => applySeriesDefaults(entry, groupSeriesOffset + index));
|
|
924
987
|
groupSeriesOffset += group.series.length;
|
|
925
988
|
return { ...group, series };
|
|
@@ -973,7 +1036,7 @@ function parseChartCacheValues(parentNode, cacheName, mode) {
|
|
|
973
1036
|
const rawIndex = Number(_nullishCoalesce(pointNode.getAttribute("idx"), () => ( Number.NaN)));
|
|
974
1037
|
return {
|
|
975
1038
|
index: Number.isFinite(rawIndex) ? rawIndex : 0,
|
|
976
|
-
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1039
|
+
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _110 => _110(pointNode, "v"), 'optionalAccess', _111 => _111.textContent]), () => ( ""))
|
|
977
1040
|
};
|
|
978
1041
|
}).sort((left, right) => left.index - right.index);
|
|
979
1042
|
if (pointNodes.length === 0) {
|
|
@@ -1014,7 +1077,7 @@ function parseChartMultiLevelCacheValues(parentNode, mode) {
|
|
|
1014
1077
|
const rawIndex = Number(_nullishCoalesce(pointNode.getAttribute("idx"), () => ( Number.NaN)));
|
|
1015
1078
|
return {
|
|
1016
1079
|
index: Number.isFinite(rawIndex) ? rawIndex : 0,
|
|
1017
|
-
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1080
|
+
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _112 => _112(pointNode, "v"), 'optionalAccess', _113 => _113.textContent]), () => ( ""))
|
|
1018
1081
|
};
|
|
1019
1082
|
}).sort((left, right) => left.index - right.index);
|
|
1020
1083
|
if (pointNodes.length === 0) {
|
|
@@ -1051,7 +1114,7 @@ function applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette) {
|
|
|
1051
1114
|
const fillColor = resolveChartFillColor(shapeProperties, themePalette);
|
|
1052
1115
|
const markerSize = readChartNumericAttribute(markerNode, "size");
|
|
1053
1116
|
const markerSymbolNode = markerNode ? getFirstLocalChild(markerNode, "symbol") : null;
|
|
1054
|
-
const markerSymbol = _nullishCoalesce(_optionalChain([markerSymbolNode, 'optionalAccess',
|
|
1117
|
+
const markerSymbol = _nullishCoalesce(_optionalChain([markerSymbolNode, 'optionalAccess', _114 => _114.getAttribute, 'call', _115 => _115("val")]), () => ( (markerNode || chart.chartType === "Scatter" || ["marker", "lineMarker", "smoothMarker"].includes(_nullishCoalesce(chart.scatterStyle, () => ( ""))) || readChartBooleanAttribute(chartTypeNode, "marker") === true ? "auto" : series.markerSymbol)));
|
|
1055
1118
|
const pointStyles = parseChartPointStyles(seriesNode, themePalette);
|
|
1056
1119
|
const seriesExplosion = readChartNumericAttribute(seriesNode, "explosion");
|
|
1057
1120
|
const invertNegativeStyle = parseInvertNegativeStyle(seriesNode, themePalette);
|
|
@@ -1061,12 +1124,12 @@ function applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette) {
|
|
|
1061
1124
|
const cachedValues = isScatterChart ? parseChartCacheValues(getFirstLocalChild(seriesNode, "yVal"), "numCache", "value") : parseChartCacheValues(getFirstLocalChild(seriesNode, "val"), "numCache", "value");
|
|
1062
1125
|
const cachedBubbleSizes = chart.chartType === "Bubble" ? parseChartCacheValues(getFirstLocalChild(seriesNode, "bubbleSize"), "numCache", "value") : null;
|
|
1063
1126
|
const existingShapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : null;
|
|
1064
|
-
const rawFillColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess',
|
|
1065
|
-
const rawLineColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess',
|
|
1127
|
+
const rawFillColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _116 => _116.solidFillHex]) === "string" ? normalizeHexColor(existingShapeProperties.solidFillHex) : null;
|
|
1128
|
+
const rawLineColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _117 => _117.lineColorHex]) === "string" ? normalizeHexColor(existingShapeProperties.lineColorHex) : null;
|
|
1066
1129
|
const resolvedLineColor = lineStyle.hidden ? void 0 : _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( lineStyle.color)), () => ( rawFillColor)), () => ( fillColor)), () => ( series.lineColor)), () => ( series.color));
|
|
1067
|
-
const hasCategoryReference = typeof _optionalChain([series, 'access',
|
|
1068
|
-
const hasValueReference = typeof _optionalChain([series, 'access',
|
|
1069
|
-
const hasBubbleSizeReference = typeof _optionalChain([series, 'access',
|
|
1130
|
+
const hasCategoryReference = typeof _optionalChain([series, 'access', _118 => _118.categoriesRef, 'optionalAccess', _119 => _119.formula]) === "string" && series.categoriesRef.formula.length > 0;
|
|
1131
|
+
const hasValueReference = typeof _optionalChain([series, 'access', _120 => _120.valuesRef, 'optionalAccess', _121 => _121.formula]) === "string" && series.valuesRef.formula.length > 0;
|
|
1132
|
+
const hasBubbleSizeReference = typeof _optionalChain([series, 'access', _122 => _122.bubbleSizeRef, 'optionalAccess', _123 => _123.formula]) === "string" && series.bubbleSizeRef.formula.length > 0;
|
|
1070
1133
|
return {
|
|
1071
1134
|
...series,
|
|
1072
1135
|
bubbleSizes: !hasBubbleSizeReference && cachedBubbleSizes ? cachedBubbleSizes.map((value) => typeof value === "number" && Number.isFinite(value) ? value : null) : series.bubbleSizes,
|
|
@@ -1143,10 +1206,10 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1143
1206
|
for (const fallbackStyle of fallbackPointStyles) {
|
|
1144
1207
|
const existing = existingByIndex.get(fallbackStyle.index);
|
|
1145
1208
|
existingByIndex.set(fallbackStyle.index, {
|
|
1146
|
-
color: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
1147
|
-
explosion: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
1209
|
+
color: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _124 => _124.color]), () => ( fallbackStyle.color)),
|
|
1210
|
+
explosion: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _125 => _125.explosion]), () => ( fallbackStyle.explosion)),
|
|
1148
1211
|
index: fallbackStyle.index,
|
|
1149
|
-
lineColor: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
1212
|
+
lineColor: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _126 => _126.lineColor]), () => ( fallbackStyle.lineColor))
|
|
1150
1213
|
});
|
|
1151
1214
|
}
|
|
1152
1215
|
return {
|
|
@@ -1174,7 +1237,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1174
1237
|
};
|
|
1175
1238
|
const applyRelationshipStyles = () => {
|
|
1176
1239
|
chart.chartColorPalette = readChartColorPalette(archive, relationships.get(CHART_COLOR_STYLE_REL_TYPE), themePalette);
|
|
1177
|
-
chart.raw = { ...chart.raw, hasCustomChartColorStyle: Boolean(_optionalChain([chart, 'access',
|
|
1240
|
+
chart.raw = { ...chart.raw, hasCustomChartColorStyle: Boolean(_optionalChain([chart, 'access', _127 => _127.chartColorPalette, 'optionalAccess', _128 => _128.length])) };
|
|
1178
1241
|
const styleAppearance2 = readChartStyleAppearance(
|
|
1179
1242
|
archive,
|
|
1180
1243
|
relationships.get(CHART_STYLE_REL_TYPE),
|
|
@@ -1190,7 +1253,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1190
1253
|
return styleAppearance2;
|
|
1191
1254
|
};
|
|
1192
1255
|
const applyModernChartExStyles = () => {
|
|
1193
|
-
const modernPlotAreaNode = _optionalChain([chartDocument, 'optionalAccess',
|
|
1256
|
+
const modernPlotAreaNode = _optionalChain([chartDocument, 'optionalAccess', _129 => _129.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "plotArea") : null;
|
|
1194
1257
|
if (!modernPlotAreaNode) {
|
|
1195
1258
|
return;
|
|
1196
1259
|
}
|
|
@@ -1272,12 +1335,12 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1272
1335
|
const nextTypeGroups = chart.typeGroups.map((group) => ({ ...group, series: [...group.series] }));
|
|
1273
1336
|
const columnGroupIndex = nextTypeGroups.findIndex((group) => group.chartType === "ColumnClustered");
|
|
1274
1337
|
if (columnGroupIndex >= 0) {
|
|
1275
|
-
const originalColumnSeries = _nullishCoalesce(_optionalChain([nextTypeGroups, 'access',
|
|
1338
|
+
const originalColumnSeries = _nullishCoalesce(_optionalChain([nextTypeGroups, 'access', _130 => _130[columnGroupIndex], 'optionalAccess', _131 => _131.series, 'access', _132 => _132[0]]), () => ( null));
|
|
1276
1339
|
const binnedColumnSeries = replaceColumnSeries(originalColumnSeries);
|
|
1277
1340
|
if (binnedColumnSeries) {
|
|
1278
1341
|
nextTypeGroups[columnGroupIndex].series = [binnedColumnSeries];
|
|
1279
1342
|
const lineGroupIndex = nextTypeGroups.findIndex((group) => group.chartType === "Line");
|
|
1280
|
-
if (lineGroupIndex >= 0 && _optionalChain([nextTypeGroups, 'access',
|
|
1343
|
+
if (lineGroupIndex >= 0 && _optionalChain([nextTypeGroups, 'access', _133 => _133[lineGroupIndex], 'optionalAccess', _134 => _134.series, 'access', _135 => _135[0]])) {
|
|
1281
1344
|
const originalLineSeries = nextTypeGroups[lineGroupIndex].series[0];
|
|
1282
1345
|
const recomputedLine = buildChartExParetoLineSeries(
|
|
1283
1346
|
binnedColumnSeries,
|
|
@@ -1320,7 +1383,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1320
1383
|
const chartDocument = parseXml(chartXml);
|
|
1321
1384
|
const chartNode = chartDocument ? getFirstLocalDescendant(chartDocument, "chart") : null;
|
|
1322
1385
|
const plotAreaNode = chartNode ? getFirstLocalChild(chartNode, "plotArea") : null;
|
|
1323
|
-
const styleIdNode = _optionalChain([chartDocument, 'optionalAccess',
|
|
1386
|
+
const styleIdNode = _optionalChain([chartDocument, 'optionalAccess', _136 => _136.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "style") : null;
|
|
1324
1387
|
const chartTypeNode = findPrimaryChartTypeNode(plotAreaNode);
|
|
1325
1388
|
if (!chartNode || !chartTypeNode) {
|
|
1326
1389
|
applyRelationshipStyles();
|
|
@@ -1343,8 +1406,8 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1343
1406
|
switch (chartTypeNode.localName) {
|
|
1344
1407
|
case "barChart":
|
|
1345
1408
|
case "bar3DChart": {
|
|
1346
|
-
const grouping = _optionalChain([getFirstLocalChild, 'call',
|
|
1347
|
-
const barDir = _optionalChain([getFirstLocalChild, 'call',
|
|
1409
|
+
const grouping = _optionalChain([getFirstLocalChild, 'call', _137 => _137(chartTypeNode, "grouping"), 'optionalAccess', _138 => _138.getAttribute, 'call', _139 => _139("val")]);
|
|
1410
|
+
const barDir = _optionalChain([getFirstLocalChild, 'call', _140 => _140(chartTypeNode, "barDir"), 'optionalAccess', _141 => _141.getAttribute, 'call', _142 => _142("val")]);
|
|
1348
1411
|
const isHorizontalBar = barDir === "bar";
|
|
1349
1412
|
chart.is3d = chartTypeNode.localName === "bar3DChart" ? true : chart.is3d;
|
|
1350
1413
|
if (grouping === "percentStacked") {
|
|
@@ -1358,7 +1421,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1358
1421
|
}
|
|
1359
1422
|
case "areaChart":
|
|
1360
1423
|
case "area3DChart": {
|
|
1361
|
-
const grouping = _optionalChain([getFirstLocalChild, 'call',
|
|
1424
|
+
const grouping = _optionalChain([getFirstLocalChild, 'call', _143 => _143(chartTypeNode, "grouping"), 'optionalAccess', _144 => _144.getAttribute, 'call', _145 => _145("val")]);
|
|
1362
1425
|
chart.is3d = chartTypeNode.localName === "area3DChart" ? true : chart.is3d;
|
|
1363
1426
|
if (grouping === "stacked") {
|
|
1364
1427
|
chart.chartType = "AreaStacked";
|
|
@@ -1371,7 +1434,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1371
1434
|
}
|
|
1372
1435
|
case "lineChart":
|
|
1373
1436
|
case "line3DChart": {
|
|
1374
|
-
const grouping = _optionalChain([getFirstLocalChild, 'call',
|
|
1437
|
+
const grouping = _optionalChain([getFirstLocalChild, 'call', _146 => _146(chartTypeNode, "grouping"), 'optionalAccess', _147 => _147.getAttribute, 'call', _148 => _148("val")]);
|
|
1375
1438
|
chart.is3d = chartTypeNode.localName === "line3DChart" ? true : chart.is3d;
|
|
1376
1439
|
if (grouping === "stacked") {
|
|
1377
1440
|
chart.chartType = "LineStacked";
|
|
@@ -1396,7 +1459,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1396
1459
|
chart.chartType = "BarOfPie";
|
|
1397
1460
|
break;
|
|
1398
1461
|
case "scatterChart":
|
|
1399
|
-
chart.chartType = resolveScatterChartType(_optionalChain([getFirstLocalChild, 'call',
|
|
1462
|
+
chart.chartType = resolveScatterChartType(_optionalChain([getFirstLocalChild, 'call', _149 => _149(chartTypeNode, "scatterStyle"), 'optionalAccess', _150 => _150.getAttribute, 'call', _151 => _151("val")]));
|
|
1400
1463
|
break;
|
|
1401
1464
|
case "radarChart":
|
|
1402
1465
|
chart.chartType = "Radar";
|
|
@@ -1419,19 +1482,19 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1419
1482
|
break;
|
|
1420
1483
|
}
|
|
1421
1484
|
const legendNode = getFirstLocalChild(chartNode, "legend");
|
|
1422
|
-
const legendPosition = legendNode ? _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1423
|
-
const legendOverlay = legendNode ? _optionalChain([getFirstLocalChild, 'call',
|
|
1485
|
+
const legendPosition = legendNode ? _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _152 => _152(legendNode, "legendPos"), 'optionalAccess', _153 => _153.getAttribute, 'call', _154 => _154("val")]), () => ( void 0)) : void 0;
|
|
1486
|
+
const legendOverlay = legendNode ? _optionalChain([getFirstLocalChild, 'call', _155 => _155(legendNode, "overlay"), 'optionalAccess', _156 => _156.getAttribute, 'call', _157 => _157("val")]) : void 0;
|
|
1424
1487
|
chart.legend = legendNode ? {
|
|
1425
1488
|
overlay: legendOverlay === "1",
|
|
1426
1489
|
position: normalizeLegendPosition(legendPosition),
|
|
1427
|
-
raw: _optionalChain([chart, 'access',
|
|
1490
|
+
raw: _optionalChain([chart, 'access', _158 => _158.legend, 'optionalAccess', _159 => _159.raw])
|
|
1428
1491
|
} : chart.legend;
|
|
1429
1492
|
const plotVisibleOnly = readChartBooleanAttribute(chartNode, "plotVisOnly");
|
|
1430
1493
|
if (plotVisibleOnly !== void 0) {
|
|
1431
1494
|
chart.plotVisibleOnly = plotVisibleOnly;
|
|
1432
1495
|
}
|
|
1433
|
-
chart.displayBlanksAs = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1434
|
-
const styleId = Number(_nullishCoalesce(_optionalChain([styleIdNode, 'optionalAccess',
|
|
1496
|
+
chart.displayBlanksAs = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _160 => _160(chartNode, "dispBlanksAs"), 'optionalAccess', _161 => _161.getAttribute, 'call', _162 => _162("val")]), () => ( chart.displayBlanksAs));
|
|
1497
|
+
const styleId = Number(_nullishCoalesce(_optionalChain([styleIdNode, 'optionalAccess', _163 => _163.getAttribute, 'call', _164 => _164("val")]), () => ( Number.NaN)));
|
|
1435
1498
|
chart.chartStyleId = Number.isFinite(styleId) ? styleId : chart.chartStyleId;
|
|
1436
1499
|
chart.firstSliceAngle = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "firstSliceAng"), () => ( chart.firstSliceAngle));
|
|
1437
1500
|
chart.gapWidth = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "gapWidth"), () => ( chart.gapWidth));
|
|
@@ -1441,9 +1504,9 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1441
1504
|
const bubble3dNode = getFirstLocalChild(chartTypeNode, "bubble3D");
|
|
1442
1505
|
chart.bubble3d = bubble3dNode ? bubble3dNode.getAttribute("val") !== "0" : chart.bubble3d;
|
|
1443
1506
|
chart.holeSize = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "holeSize"), () => ( chart.holeSize));
|
|
1444
|
-
chart.radarStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1445
|
-
chart.scatterStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1446
|
-
chart.shape3d = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1507
|
+
chart.radarStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _165 => _165(chartTypeNode, "radarStyle"), 'optionalAccess', _166 => _166.getAttribute, 'call', _167 => _167("val")]), () => ( chart.radarStyle));
|
|
1508
|
+
chart.scatterStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _168 => _168(chartTypeNode, "scatterStyle"), 'optionalAccess', _169 => _169.getAttribute, 'call', _170 => _170("val")]), () => ( chart.scatterStyle));
|
|
1509
|
+
chart.shape3d = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _171 => _171(chartTypeNode, "shape"), 'optionalAccess', _172 => _172.getAttribute, 'call', _173 => _173("val")]), () => ( chart.shape3d));
|
|
1447
1510
|
const wireframeNode = getFirstLocalChild(chartTypeNode, "wireframe");
|
|
1448
1511
|
chart.wireframe = wireframeNode ? wireframeNode.getAttribute("val") !== "0" : chart.wireframe;
|
|
1449
1512
|
const chartTypeDataLabels = parseChartDataLabelsFromXml(getFirstLocalChild(chartTypeNode, "dLbls"));
|
|
@@ -1451,7 +1514,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1451
1514
|
const seriesDataLabels = parseChartDataLabelsFromXml(getFirstLocalChild(firstSeriesNode, "dLbls"));
|
|
1452
1515
|
chart.dataLabels = _nullishCoalesce(_nullishCoalesce(chartTypeDataLabels, () => ( seriesDataLabels)), () => ( chart.dataLabels));
|
|
1453
1516
|
const seriesSp3dNode = firstSeriesNode ? getFirstLocalDescendant(firstSeriesNode, "sp3d") : null;
|
|
1454
|
-
chart.surfaceMaterial = _nullishCoalesce(_optionalChain([seriesSp3dNode, 'optionalAccess',
|
|
1517
|
+
chart.surfaceMaterial = _nullishCoalesce(_optionalChain([seriesSp3dNode, 'optionalAccess', _174 => _174.getAttribute, 'call', _175 => _175("prstMaterial")]), () => ( chart.surfaceMaterial));
|
|
1455
1518
|
const bandFormatsNode = _nullishCoalesce(getLocalChildren(chartTypeNode, "bandFmts")[0], () => ( null));
|
|
1456
1519
|
const bandFormatNodes = bandFormatsNode ? getLocalChildren(bandFormatsNode, "bandFmt") : [];
|
|
1457
1520
|
const bandFormatColors = /* @__PURE__ */ Object.create(null);
|
|
@@ -1466,7 +1529,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1466
1529
|
const fillColor = getFirstLocalChild(shapeProperties, "noFill") ? "transparent" : resolveChartFillColor(shapeProperties, themePalette);
|
|
1467
1530
|
const lineStyle = resolveChartLineStyle(shapeProperties, themePalette);
|
|
1468
1531
|
const lineColor = lineStyle.hidden ? "transparent" : lineStyle.color;
|
|
1469
|
-
const lineWidth = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1532
|
+
const lineWidth = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _176 => _176(shapeProperties, "ln"), 'optionalAccess', _177 => _177.getAttribute, 'call', _178 => _178("w")]), () => ( Number.NaN)));
|
|
1470
1533
|
if (fillColor) bandFormatColors[index] = fillColor;
|
|
1471
1534
|
if (lineColor) bandFormatLineColors[index] = lineColor;
|
|
1472
1535
|
if (Number.isFinite(lineWidth) && lineWidth >= 0) bandFormatLineWidths[index] = lineWidth / EMU_PER_PIXEL;
|
|
@@ -1476,16 +1539,16 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1476
1539
|
bandFormatColors: Object.keys(bandFormatColors).length > 0 ? bandFormatColors : void 0,
|
|
1477
1540
|
bandFormatLineColors: Object.keys(bandFormatLineColors).length > 0 ? bandFormatLineColors : void 0,
|
|
1478
1541
|
bandFormatLineWidths: Object.keys(bandFormatLineWidths).length > 0 ? bandFormatLineWidths : void 0,
|
|
1479
|
-
date1904: readChartBooleanAttribute(_nullishCoalesce(_optionalChain([chartDocument, 'optionalAccess',
|
|
1542
|
+
date1904: readChartBooleanAttribute(_nullishCoalesce(_optionalChain([chartDocument, 'optionalAccess', _179 => _179.documentElement]), () => ( null)), "date1904"),
|
|
1480
1543
|
titleOverlay: readChartBooleanAttribute(getFirstLocalChild(chartNode, "title"), "overlay"),
|
|
1481
1544
|
bubble3d: chart.bubble3d,
|
|
1482
|
-
grouping: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1483
|
-
ofPieType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1484
|
-
shape: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1545
|
+
grouping: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _180 => _180(chartTypeNode, "grouping"), 'optionalAccess', _181 => _181.getAttribute, 'call', _182 => _182("val")]), () => ( void 0)),
|
|
1546
|
+
ofPieType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _183 => _183(chartTypeNode, "ofPieType"), 'optionalAccess', _184 => _184.getAttribute, 'call', _185 => _185("val")]), () => ( void 0)),
|
|
1547
|
+
shape: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _186 => _186(chartTypeNode, "shape"), 'optionalAccess', _187 => _187.getAttribute, 'call', _188 => _188("val")]), () => ( void 0)),
|
|
1485
1548
|
secondPieSize: readChartNumericAttribute(chartTypeNode, "secondPieSize"),
|
|
1486
1549
|
scatterStyle: chart.scatterStyle,
|
|
1487
1550
|
splitPos: readChartNumericAttribute(chartTypeNode, "splitPos"),
|
|
1488
|
-
splitType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1551
|
+
splitType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _189 => _189(chartTypeNode, "splitType"), 'optionalAccess', _190 => _190.getAttribute, 'call', _191 => _191("val")]), () => ( void 0)),
|
|
1489
1552
|
xmlChartType: chartTypeNode.localName
|
|
1490
1553
|
};
|
|
1491
1554
|
const view3dNode = getFirstLocalDescendant(chartNode, "view3D");
|
|
@@ -1494,7 +1557,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1494
1557
|
depthPercent: readChartNumericAttribute(view3dNode, "depthPercent"),
|
|
1495
1558
|
heightPercent: readChartNumericAttribute(view3dNode, "hPercent"),
|
|
1496
1559
|
perspective: readChartNumericAttribute(view3dNode, "perspective"),
|
|
1497
|
-
rAngAx: _optionalChain([getFirstLocalChild, 'call',
|
|
1560
|
+
rAngAx: _optionalChain([getFirstLocalChild, 'call', _192 => _192(view3dNode, "rAngAx"), 'optionalAccess', _193 => _193.getAttribute, 'call', _194 => _194("val")]) === "1",
|
|
1498
1561
|
rotX: readChartNumericAttribute(view3dNode, "rotX"),
|
|
1499
1562
|
rotY: readChartNumericAttribute(view3dNode, "rotY")
|
|
1500
1563
|
};
|
|
@@ -1503,7 +1566,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1503
1566
|
const wall = readChartWallFromXml(getFirstLocalChild(chartNode, key), themePalette);
|
|
1504
1567
|
if (wall) {
|
|
1505
1568
|
chart[key] = wall;
|
|
1506
|
-
const defaults = _optionalChain([chart, 'access',
|
|
1569
|
+
const defaults = _optionalChain([chart, 'access', _195 => _195.raw, 'optionalAccess', _196 => _196.builtinSurfaceDefaults]);
|
|
1507
1570
|
if (defaults) chart.raw = { ...chart.raw, builtinSurfaceDefaults: { ...defaults, [key]: void 0 } };
|
|
1508
1571
|
}
|
|
1509
1572
|
}
|
|
@@ -1512,7 +1575,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1512
1575
|
const titleTypeface = readChartTextTypeface(getFirstLocalDescendant(chartNode, "title"), themePalette);
|
|
1513
1576
|
chart.fontFamily = _nullishCoalesce(chartTextTypeface, () => ( chart.fontFamily));
|
|
1514
1577
|
chart.titleFontFamily = _nullishCoalesce(_nullishCoalesce(titleTypeface, () => ( chart.titleFontFamily)), () => ( chart.fontFamily));
|
|
1515
|
-
const chartAreaShapeProperties = _optionalChain([chartDocument, 'optionalAccess',
|
|
1578
|
+
const chartAreaShapeProperties = _optionalChain([chartDocument, 'optionalAccess', _197 => _197.documentElement]) ? getFirstLocalChild(chartDocument.documentElement, "spPr") : null;
|
|
1516
1579
|
const plotAreaShapeProperties = getFirstLocalChild(plotArea, "spPr");
|
|
1517
1580
|
const chartAreaNoFill = chartAreaShapeProperties ? getFirstLocalChild(chartAreaShapeProperties, "noFill") != null : false;
|
|
1518
1581
|
const plotAreaNoFill = plotAreaShapeProperties ? getFirstLocalChild(plotAreaShapeProperties, "noFill") != null : false;
|
|
@@ -1551,11 +1614,11 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1551
1614
|
let valueAxisNode = _nullishCoalesce(valueAxisNodes[0], () => ( null));
|
|
1552
1615
|
if (!categoryAxisNode && isScatterLikeChart && valueAxisNodes.length >= 2) {
|
|
1553
1616
|
categoryAxisNode = _nullishCoalesce(valueAxisNodes.find((axisNode) => {
|
|
1554
|
-
const position = _optionalChain([getFirstLocalChild, 'call',
|
|
1617
|
+
const position = _optionalChain([getFirstLocalChild, 'call', _198 => _198(axisNode, "axPos"), 'optionalAccess', _199 => _199.getAttribute, 'call', _200 => _200("val")]);
|
|
1555
1618
|
return position === "b" || position === "t";
|
|
1556
1619
|
}), () => ( valueAxisNodes[0]));
|
|
1557
1620
|
valueAxisNode = _nullishCoalesce(_nullishCoalesce(valueAxisNodes.find((axisNode) => {
|
|
1558
|
-
const position = _optionalChain([getFirstLocalChild, 'call',
|
|
1621
|
+
const position = _optionalChain([getFirstLocalChild, 'call', _201 => _201(axisNode, "axPos"), 'optionalAccess', _202 => _202.getAttribute, 'call', _203 => _203("val")]);
|
|
1559
1622
|
return position === "l" || position === "r";
|
|
1560
1623
|
}), () => ( valueAxisNodes[1])), () => ( valueAxisNodes[0]));
|
|
1561
1624
|
}
|
|
@@ -1636,15 +1699,15 @@ function serializeXml(document2) {
|
|
|
1636
1699
|
return new XMLSerializer().serializeToString(document2);
|
|
1637
1700
|
}
|
|
1638
1701
|
function getLocalChildren(parent, localName) {
|
|
1639
|
-
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
|
1702
|
+
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _204 => _204.childNodes]), () => ( []))).filter(
|
|
1640
1703
|
(node) => node.nodeType === Node.ELEMENT_NODE && node.localName === localName
|
|
1641
1704
|
);
|
|
1642
1705
|
}
|
|
1643
1706
|
function removeLocalChildren(parent, localName) {
|
|
1644
|
-
getLocalChildren(parent, localName).forEach((node) => _optionalChain([node, 'access',
|
|
1707
|
+
getLocalChildren(parent, localName).forEach((node) => _optionalChain([node, 'access', _205 => _205.parentNode, 'optionalAccess', _206 => _206.removeChild, 'call', _207 => _207(node)]));
|
|
1645
1708
|
}
|
|
1646
1709
|
function getLocalDescendants(parent, localName) {
|
|
1647
|
-
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
|
1710
|
+
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _208 => _208.getElementsByTagName, 'call', _209 => _209("*")]), () => ( []))).filter(
|
|
1648
1711
|
(node) => node.localName === localName
|
|
1649
1712
|
);
|
|
1650
1713
|
}
|
|
@@ -1757,7 +1820,7 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
|
|
|
1757
1820
|
return {
|
|
1758
1821
|
range: null,
|
|
1759
1822
|
sheet: workbook.getSheet(fallbackSheetIndex),
|
|
1760
|
-
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access',
|
|
1823
|
+
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _210 => _210.getSheet, 'call', _211 => _211(fallbackSheetIndex), 'optionalAccess', _212 => _212.name]), () => ( ""))
|
|
1761
1824
|
};
|
|
1762
1825
|
}
|
|
1763
1826
|
const trimmedFormula = formula.trim();
|
|
@@ -1775,7 +1838,7 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
|
|
|
1775
1838
|
return {
|
|
1776
1839
|
range: parseA1Range(trimmedFormula),
|
|
1777
1840
|
sheet: workbook.getSheet(fallbackSheetIndex),
|
|
1778
|
-
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access',
|
|
1841
|
+
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _213 => _213.getSheet, 'call', _214 => _214(fallbackSheetIndex), 'optionalAccess', _215 => _215.name]), () => ( ""))
|
|
1779
1842
|
};
|
|
1780
1843
|
}
|
|
1781
1844
|
try {
|
|
@@ -1788,12 +1851,12 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
|
|
|
1788
1851
|
return {
|
|
1789
1852
|
range: parseA1Range(split.range),
|
|
1790
1853
|
sheet: workbook.getSheet(fallbackSheetIndex),
|
|
1791
|
-
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access',
|
|
1854
|
+
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _216 => _216.getSheet, 'call', _217 => _217(fallbackSheetIndex), 'optionalAccess', _218 => _218.name]), () => ( ""))
|
|
1792
1855
|
};
|
|
1793
1856
|
}
|
|
1794
1857
|
}
|
|
1795
1858
|
function resolveChartReferenceLabel(workbook, fallbackSheetIndex, reference, fallbackLabel) {
|
|
1796
|
-
if (!_optionalChain([reference, 'optionalAccess',
|
|
1859
|
+
if (!_optionalChain([reference, 'optionalAccess', _219 => _219.formula])) {
|
|
1797
1860
|
return fallbackLabel;
|
|
1798
1861
|
}
|
|
1799
1862
|
const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
|
|
@@ -1815,7 +1878,7 @@ function resolveChartReferenceLabel(workbook, fallbackSheetIndex, reference, fal
|
|
|
1815
1878
|
return firstDisplay.length > 0 ? firstDisplay : fallbackLabel;
|
|
1816
1879
|
}
|
|
1817
1880
|
function resolveReferenceRowPaths(workbook, fallbackSheetIndex, reference) {
|
|
1818
|
-
if (!_optionalChain([reference, 'optionalAccess',
|
|
1881
|
+
if (!_optionalChain([reference, 'optionalAccess', _220 => _220.formula])) {
|
|
1819
1882
|
return [];
|
|
1820
1883
|
}
|
|
1821
1884
|
const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
|
|
@@ -1869,11 +1932,11 @@ function normalizeChartExAxis(raw) {
|
|
|
1869
1932
|
id: typeof axis.id === "number" && Number.isFinite(axis.id) ? axis.id : void 0,
|
|
1870
1933
|
crossId: typeof axis.crossId === "number" && Number.isFinite(axis.crossId) ? axis.crossId : void 0,
|
|
1871
1934
|
majorGridlines: axis.majorGridlines != null ? true : void 0,
|
|
1872
|
-
majorUnit: typeof _optionalChain([scaling, 'optionalAccess',
|
|
1873
|
-
max: typeof _optionalChain([scaling, 'optionalAccess',
|
|
1874
|
-
min: typeof _optionalChain([scaling, 'optionalAccess',
|
|
1935
|
+
majorUnit: typeof _optionalChain([scaling, 'optionalAccess', _221 => _221.majorUnit]) === "number" ? scaling.majorUnit : void 0,
|
|
1936
|
+
max: typeof _optionalChain([scaling, 'optionalAccess', _222 => _222.max]) === "number" ? scaling.max : void 0,
|
|
1937
|
+
min: typeof _optionalChain([scaling, 'optionalAccess', _223 => _223.min]) === "number" ? scaling.min : void 0,
|
|
1875
1938
|
minorGridlines: axis.minorGridlines != null ? true : void 0,
|
|
1876
|
-
minorUnit: typeof _optionalChain([scaling, 'optionalAccess',
|
|
1939
|
+
minorUnit: typeof _optionalChain([scaling, 'optionalAccess', _224 => _224.minorUnit]) === "number" ? scaling.minorUnit : void 0,
|
|
1877
1940
|
numberFormat: numberFormat ? {
|
|
1878
1941
|
formatCode: typeof numberFormat.formatCode === "string" ? numberFormat.formatCode : void 0,
|
|
1879
1942
|
sourceLinked: typeof numberFormat.sourceLinked === "boolean" ? numberFormat.sourceLinked : void 0
|
|
@@ -1965,13 +2028,13 @@ function buildChartExHistogramBins(values, rawSeries, sortByFrequency) {
|
|
|
1965
2028
|
return [];
|
|
1966
2029
|
}
|
|
1967
2030
|
const rawRecord = rawSeries && typeof rawSeries === "object" ? rawSeries : null;
|
|
1968
|
-
const layoutProperties = _optionalChain([rawRecord, 'optionalAccess',
|
|
1969
|
-
const rawBinning = _optionalChain([layoutProperties, 'optionalAccess',
|
|
2031
|
+
const layoutProperties = _optionalChain([rawRecord, 'optionalAccess', _225 => _225.layoutProperties]) && typeof rawRecord.layoutProperties === "object" ? rawRecord.layoutProperties : null;
|
|
2032
|
+
const rawBinning = _optionalChain([layoutProperties, 'optionalAccess', _226 => _226.binning]) && typeof layoutProperties.binning === "object" ? layoutProperties.binning : null;
|
|
1970
2033
|
const minValue = Math.min(...values);
|
|
1971
2034
|
const maxValue = Math.max(...values);
|
|
1972
|
-
const explicitWidth = typeof _optionalChain([rawBinning, 'optionalAccess',
|
|
1973
|
-
const explicitCount = typeof _optionalChain([rawBinning, 'optionalAccess',
|
|
1974
|
-
const closedRight = _optionalChain([rawBinning, 'optionalAccess',
|
|
2035
|
+
const explicitWidth = typeof _optionalChain([rawBinning, 'optionalAccess', _227 => _227.binSize]) === "number" && Number.isFinite(rawBinning.binSize) && rawBinning.binSize > 0 ? rawBinning.binSize : void 0;
|
|
2036
|
+
const explicitCount = typeof _optionalChain([rawBinning, 'optionalAccess', _228 => _228.binCount]) === "number" && Number.isFinite(rawBinning.binCount) && rawBinning.binCount > 0 ? rawBinning.binCount : typeof _optionalChain([rawBinning, 'optionalAccess', _229 => _229.count]) === "number" && Number.isFinite(rawBinning.count) && rawBinning.count > 0 ? rawBinning.count : void 0;
|
|
2037
|
+
const closedRight = _optionalChain([rawBinning, 'optionalAccess', _230 => _230.intervalClosed]) === "r" || _optionalChain([rawBinning, 'optionalAccess', _231 => _231.intervalClosed]) === "right";
|
|
1975
2038
|
const mean = values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
1976
2039
|
const variance = values.reduce((sum, value) => sum + (value - mean) ** 2, 0) / Math.max(1, values.length);
|
|
1977
2040
|
const standardDeviation = Math.sqrt(Math.max(0, variance));
|
|
@@ -2022,7 +2085,7 @@ function buildChartExHistogramSeries(series, rawSeries, sortByFrequency) {
|
|
|
2022
2085
|
const layout = resolveChartExSeriesLayout(rawSeries);
|
|
2023
2086
|
const rawRecord = rawSeries && typeof rawSeries === "object" ? rawSeries : null;
|
|
2024
2087
|
const hasBinning = Boolean(
|
|
2025
|
-
layout === "clusteredColumn" && _optionalChain([rawRecord, 'optionalAccess',
|
|
2088
|
+
layout === "clusteredColumn" && _optionalChain([rawRecord, 'optionalAccess', _232 => _232.layoutProperties]) && typeof rawRecord.layoutProperties === "object" && rawRecord.layoutProperties.binning != null
|
|
2026
2089
|
);
|
|
2027
2090
|
if (!hasBinning) {
|
|
2028
2091
|
return series;
|
|
@@ -2063,7 +2126,7 @@ function buildChartExParetoLineSeries(series, sourceRaw, index) {
|
|
|
2063
2126
|
markerLineColor: void 0,
|
|
2064
2127
|
markerSize: 7,
|
|
2065
2128
|
markerSymbol: "circle",
|
|
2066
|
-
name: typeof _optionalChain([sourceRaw, 'optionalAccess',
|
|
2129
|
+
name: typeof _optionalChain([sourceRaw, 'optionalAccess', _233 => _233.text]) === "string" ? sourceRaw.text : "Pareto",
|
|
2067
2130
|
raw: {
|
|
2068
2131
|
..._nullishCoalesce(series.raw, () => ( {})),
|
|
2069
2132
|
chartExLayout: "paretoLine",
|
|
@@ -2134,11 +2197,11 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2134
2197
|
const series = raw && typeof raw === "object" ? raw : {};
|
|
2135
2198
|
const dataId = typeof series.dataId === "number" ? series.dataId : null;
|
|
2136
2199
|
const dataEntry = dataId != null ? _nullishCoalesce(dataById.get(dataId), () => ( null)) : null;
|
|
2137
|
-
const dimensions = Array.isArray(_optionalChain([dataEntry, 'optionalAccess',
|
|
2200
|
+
const dimensions = Array.isArray(_optionalChain([dataEntry, 'optionalAccess', _234 => _234.dimensions])) ? dataEntry.dimensions.filter((value) => Boolean(value && typeof value === "object")) : [];
|
|
2138
2201
|
const categoryDimension = _nullishCoalesce(_nullishCoalesce(dimensions.find((dimension) => dimension.dimType === "cat"), () => ( dimensions.find((dimension) => dimension.dimType === "name"))), () => ( null));
|
|
2139
2202
|
const valueDimension = _nullishCoalesce(_nullishCoalesce(dimensions.find((dimension) => dimension.dimType === "val" || dimension.dimType === "y" || dimension.dimType === "colorVal" || dimension.dimType === "size"), () => ( dimensions.find((dimension) => dimension !== categoryDimension))), () => ( categoryDimension));
|
|
2140
|
-
const categoryDimensionFormula = typeof _optionalChain([categoryDimension, 'optionalAccess',
|
|
2141
|
-
const valueDimensionFormula = typeof _optionalChain([valueDimension, 'optionalAccess',
|
|
2203
|
+
const categoryDimensionFormula = typeof _optionalChain([categoryDimension, 'optionalAccess', _235 => _235.formula]) === "string" ? categoryDimension.formula : void 0;
|
|
2204
|
+
const valueDimensionFormula = typeof _optionalChain([valueDimension, 'optionalAccess', _236 => _236.formula]) === "string" ? valueDimension.formula : void 0;
|
|
2142
2205
|
const fallbackCategoryRef = (chartType === "Sunburst" || chartType === "Treemap") && !categoryDimension && typeof valueDimensionFormula === "string" ? resolveChartExFallbackCategoryReference(workbook, workbookSheetIndex, valueDimensionFormula) : null;
|
|
2143
2206
|
const categoriesRef = categoryDimension ? normalizeChartReference({
|
|
2144
2207
|
formula: categoryDimensionFormula
|
|
@@ -2146,7 +2209,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2146
2209
|
const valuesRef = valueDimension ? normalizeChartReference({
|
|
2147
2210
|
formula: valueDimensionFormula
|
|
2148
2211
|
}) : null;
|
|
2149
|
-
const isCategoricalMap = chartType === "RegionMap" && _optionalChain([valueDimension, 'optionalAccess',
|
|
2212
|
+
const isCategoricalMap = chartType === "RegionMap" && _optionalChain([valueDimension, 'optionalAccess', _237 => _237.dimType]) === "colorStr";
|
|
2150
2213
|
const resolvedValueCells = resolveReferenceValues(workbook, workbookSheetIndex, valuesRef, isCategoricalMap ? "category" : "value");
|
|
2151
2214
|
const values = resolvedValueCells.map((value) => typeof value === "number" && Number.isFinite(value) ? value : null);
|
|
2152
2215
|
const colorStrings = isCategoricalMap ? resolvedValueCells.map((value) => {
|
|
@@ -2164,8 +2227,8 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2164
2227
|
const hierarchyCategories = chartType === "Sunburst" || chartType === "Treemap" ? resolveReferenceRowPaths(workbook, workbookSheetIndex, categoriesRef) : [];
|
|
2165
2228
|
const seriesTextFormula = resolveChartExTextFormula(series.text);
|
|
2166
2229
|
const shapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : void 0;
|
|
2167
|
-
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2168
|
-
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2230
|
+
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _238 => _238.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
|
|
2231
|
+
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _239 => _239.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
|
|
2169
2232
|
return {
|
|
2170
2233
|
bubbleSizeRef: null,
|
|
2171
2234
|
bubbleSizes: [],
|
|
@@ -2179,7 +2242,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2179
2242
|
id: `${chartId}-series-${index}`,
|
|
2180
2243
|
invertIfNegative: void 0,
|
|
2181
2244
|
lineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
|
|
2182
|
-
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2245
|
+
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _240 => _240.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
|
|
2183
2246
|
marker: void 0,
|
|
2184
2247
|
markerColor: _nullishCoalesce(rawFillColor, () => ( void 0)),
|
|
2185
2248
|
markerLineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
|
|
@@ -2193,7 +2256,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2193
2256
|
chartExColorStrings: colorStrings,
|
|
2194
2257
|
chartExHierarchyCategories: hierarchyCategories,
|
|
2195
2258
|
data: dataEntry,
|
|
2196
|
-
dimType: typeof _optionalChain([valueDimension, 'optionalAccess',
|
|
2259
|
+
dimType: typeof _optionalChain([valueDimension, 'optionalAccess', _241 => _241.dimType]) === "string" ? valueDimension.dimType : void 0
|
|
2197
2260
|
},
|
|
2198
2261
|
shapeProperties,
|
|
2199
2262
|
smooth: void 0,
|
|
@@ -2205,7 +2268,7 @@ function collapseChartExPointSeries(chartType, series) {
|
|
|
2205
2268
|
if (chartType !== "Funnel" && chartType !== "Waterfall") {
|
|
2206
2269
|
if ((chartType === "Sunburst" || chartType === "Treemap") && series.length > 1 && series.every((entry) => {
|
|
2207
2270
|
const raw = entry.raw && typeof entry.raw === "object" ? entry.raw : null;
|
|
2208
|
-
return _optionalChain([raw, 'optionalAccess',
|
|
2271
|
+
return _optionalChain([raw, 'optionalAccess', _242 => _242.dimType]) === "size";
|
|
2209
2272
|
})) {
|
|
2210
2273
|
const primarySeries2 = _nullishCoalesce(_nullishCoalesce(series.find((entry) => entry.hidden !== true), () => ( series[0])), () => ( null));
|
|
2211
2274
|
if (!primarySeries2) {
|
|
@@ -2425,8 +2488,8 @@ function cellValueToDisplay(value) {
|
|
|
2425
2488
|
return String(value);
|
|
2426
2489
|
}
|
|
2427
2490
|
function resolveReferenceValues(workbook, fallbackSheetIndex, reference, mode) {
|
|
2428
|
-
if (!_optionalChain([reference, 'optionalAccess',
|
|
2429
|
-
return _nullishCoalesce(_optionalChain([reference, 'optionalAccess',
|
|
2491
|
+
if (!_optionalChain([reference, 'optionalAccess', _243 => _243.formula])) {
|
|
2492
|
+
return _nullishCoalesce(_optionalChain([reference, 'optionalAccess', _244 => _244.values]), () => ( []));
|
|
2430
2493
|
}
|
|
2431
2494
|
const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
|
|
2432
2495
|
if (!resolved.sheet || !resolved.range) {
|
|
@@ -2524,30 +2587,30 @@ function readChartAxisFromXml(axisNode, themePalette) {
|
|
|
2524
2587
|
const scalingNode = getFirstLocalChild(axisNode, "scaling");
|
|
2525
2588
|
return {
|
|
2526
2589
|
crossId: readChartNumericAttribute(axisNode, "crossAx"),
|
|
2527
|
-
crosses: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2528
|
-
crossBetween: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2529
|
-
delete: _optionalChain([getFirstLocalChild, 'call',
|
|
2590
|
+
crosses: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _245 => _245(axisNode, "crosses"), 'optionalAccess', _246 => _246.getAttribute, 'call', _247 => _247("val")]), () => ( void 0)),
|
|
2591
|
+
crossBetween: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _248 => _248(axisNode, "crossBetween"), 'optionalAccess', _249 => _249.getAttribute, 'call', _250 => _250("val")]), () => ( void 0)),
|
|
2592
|
+
delete: _optionalChain([getFirstLocalChild, 'call', _251 => _251(axisNode, "delete"), 'optionalAccess', _252 => _252.getAttribute, 'call', _253 => _253("val")]) === "1" ? true : _optionalChain([getFirstLocalChild, 'call', _254 => _254(axisNode, "delete"), 'optionalAccess', _255 => _255.getAttribute, 'call', _256 => _256("val")]) === "0" ? false : void 0,
|
|
2530
2593
|
id: readChartNumericAttribute(axisNode, "axId"),
|
|
2531
|
-
labelPosition: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2594
|
+
labelPosition: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _257 => _257(axisNode, "tickLblPos"), 'optionalAccess', _258 => _258.getAttribute, 'call', _259 => _259("val")]), () => ( void 0)),
|
|
2532
2595
|
logBase: readChartNumericAttribute(getFirstLocalChild(axisNode, "scaling"), "logBase"),
|
|
2533
|
-
orientation: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2596
|
+
orientation: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _260 => _260(_nullishCoalesce(scalingNode, () => ( axisNode)), "orientation"), 'optionalAccess', _261 => _261.getAttribute, 'call', _262 => _262("val")]), () => ( void 0)),
|
|
2534
2597
|
majorGridlines: Boolean(getFirstLocalChild(axisNode, "majorGridlines")),
|
|
2535
2598
|
majorGridlineColor: (() => {
|
|
2536
2599
|
const style = resolveChartLineStyle(getFirstLocalChild(getFirstLocalChild(axisNode, "majorGridlines"), "spPr"), themePalette);
|
|
2537
2600
|
return style.hidden ? "transparent" : _nullishCoalesce(style.color, () => ( void 0));
|
|
2538
2601
|
})(),
|
|
2539
|
-
majorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2602
|
+
majorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _263 => _263(axisNode, "majorTickMark"), 'optionalAccess', _264 => _264.getAttribute, 'call', _265 => _265("val")]), () => ( void 0)),
|
|
2540
2603
|
majorUnit: readChartNumericAttribute(axisNode, "majorUnit"),
|
|
2541
2604
|
max: readChartNumericAttribute(scalingNode, "max"),
|
|
2542
2605
|
min: readChartNumericAttribute(scalingNode, "min"),
|
|
2543
2606
|
minorGridlines: Boolean(getFirstLocalChild(axisNode, "minorGridlines")),
|
|
2544
|
-
minorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2607
|
+
minorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _266 => _266(axisNode, "minorTickMark"), 'optionalAccess', _267 => _267.getAttribute, 'call', _268 => _268("val")]), () => ( void 0)),
|
|
2545
2608
|
minorUnit: readChartNumericAttribute(axisNode, "minorUnit"),
|
|
2546
2609
|
numberFormat: numFmt ? {
|
|
2547
2610
|
formatCode: _nullishCoalesce(numFmt.getAttribute("formatCode"), () => ( void 0)),
|
|
2548
2611
|
sourceLinked: numFmt.getAttribute("sourceLinked") === "1" ? true : numFmt.getAttribute("sourceLinked") === "0" ? false : void 0
|
|
2549
2612
|
} : void 0,
|
|
2550
|
-
position: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2613
|
+
position: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _269 => _269(axisNode, "axPos"), 'optionalAccess', _270 => _270.getAttribute, 'call', _271 => _271("val")]), () => ( void 0)),
|
|
2551
2614
|
tickLabelSkip: readChartNumericAttribute(axisNode, "tickLblSkip"),
|
|
2552
2615
|
tickMarkSkip: readChartNumericAttribute(axisNode, "tickMarkSkip")
|
|
2553
2616
|
};
|
|
@@ -2637,10 +2700,10 @@ function normalizeChartAnchor(raw) {
|
|
|
2637
2700
|
if (anchor.type === "oneCell") {
|
|
2638
2701
|
return {
|
|
2639
2702
|
from: {
|
|
2640
|
-
col: typeof _optionalChain([from, 'optionalAccess',
|
|
2641
|
-
colOffsetEmu: typeof _optionalChain([from, 'optionalAccess',
|
|
2642
|
-
row: typeof _optionalChain([from, 'optionalAccess',
|
|
2643
|
-
rowOffsetEmu: typeof _optionalChain([from, 'optionalAccess',
|
|
2703
|
+
col: typeof _optionalChain([from, 'optionalAccess', _272 => _272.col]) === "number" ? from.col : 0,
|
|
2704
|
+
colOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _273 => _273.colOffsetEmu]) === "number" ? from.colOffsetEmu : 0,
|
|
2705
|
+
row: typeof _optionalChain([from, 'optionalAccess', _274 => _274.row]) === "number" ? from.row : 0,
|
|
2706
|
+
rowOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _275 => _275.rowOffsetEmu]) === "number" ? from.rowOffsetEmu : 0
|
|
2644
2707
|
},
|
|
2645
2708
|
kind: "one-cell",
|
|
2646
2709
|
sizeEmu: {
|
|
@@ -2663,14 +2726,14 @@ function normalizeChartAnchor(raw) {
|
|
|
2663
2726
|
};
|
|
2664
2727
|
}
|
|
2665
2728
|
const to = anchor.to && typeof anchor.to === "object" ? anchor.to : null;
|
|
2666
|
-
const fromColValue = _optionalChain([from, 'optionalAccess',
|
|
2667
|
-
const fromColOffsetValue = _optionalChain([from, 'optionalAccess',
|
|
2668
|
-
const fromRowValue = _optionalChain([from, 'optionalAccess',
|
|
2669
|
-
const fromRowOffsetValue = _optionalChain([from, 'optionalAccess',
|
|
2670
|
-
const toColValue = _optionalChain([to, 'optionalAccess',
|
|
2671
|
-
const toColOffsetValue = _optionalChain([to, 'optionalAccess',
|
|
2672
|
-
const toRowValue = _optionalChain([to, 'optionalAccess',
|
|
2673
|
-
const toRowOffsetValue = _optionalChain([to, 'optionalAccess',
|
|
2729
|
+
const fromColValue = _optionalChain([from, 'optionalAccess', _276 => _276.col]);
|
|
2730
|
+
const fromColOffsetValue = _optionalChain([from, 'optionalAccess', _277 => _277.colOffsetEmu]);
|
|
2731
|
+
const fromRowValue = _optionalChain([from, 'optionalAccess', _278 => _278.row]);
|
|
2732
|
+
const fromRowOffsetValue = _optionalChain([from, 'optionalAccess', _279 => _279.rowOffsetEmu]);
|
|
2733
|
+
const toColValue = _optionalChain([to, 'optionalAccess', _280 => _280.col]);
|
|
2734
|
+
const toColOffsetValue = _optionalChain([to, 'optionalAccess', _281 => _281.colOffsetEmu]);
|
|
2735
|
+
const toRowValue = _optionalChain([to, 'optionalAccess', _282 => _282.row]);
|
|
2736
|
+
const toRowOffsetValue = _optionalChain([to, 'optionalAccess', _283 => _283.rowOffsetEmu]);
|
|
2674
2737
|
const fromCol = typeof fromColValue === "number" ? fromColValue : 0;
|
|
2675
2738
|
const fromColOffsetEmu = typeof fromColOffsetValue === "number" ? fromColOffsetValue : 0;
|
|
2676
2739
|
const fromRow = typeof fromRowValue === "number" ? fromRowValue : 0;
|
|
@@ -2699,10 +2762,10 @@ function parseMarkerNode(node) {
|
|
|
2699
2762
|
if (!node) {
|
|
2700
2763
|
return null;
|
|
2701
2764
|
}
|
|
2702
|
-
const col = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2703
|
-
const row = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2704
|
-
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2705
|
-
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2765
|
+
const col = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _284 => _284(node, "col"), 'optionalAccess', _285 => _285.textContent]), () => ( Number.NaN)));
|
|
2766
|
+
const row = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _286 => _286(node, "row"), 'optionalAccess', _287 => _287.textContent]), () => ( Number.NaN)));
|
|
2767
|
+
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _288 => _288(node, "colOff"), 'optionalAccess', _289 => _289.textContent]), () => ( 0)));
|
|
2768
|
+
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _290 => _290(node, "rowOff"), 'optionalAccess', _291 => _291.textContent]), () => ( 0)));
|
|
2706
2769
|
if (!Number.isFinite(col) || !Number.isFinite(row)) {
|
|
2707
2770
|
return null;
|
|
2708
2771
|
}
|
|
@@ -2722,8 +2785,8 @@ function parseChartAnchorNode(anchorNode) {
|
|
|
2722
2785
|
if (anchorNode.localName === "oneCellAnchor") {
|
|
2723
2786
|
const from = parseMarkerNode(getFirstLocalChild(anchorNode, "from"));
|
|
2724
2787
|
const ext2 = getFirstLocalChild(anchorNode, "ext");
|
|
2725
|
-
const cx2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess',
|
|
2726
|
-
const cy2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess',
|
|
2788
|
+
const cx2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _292 => _292.getAttribute, 'call', _293 => _293("cx")]), () => ( Number.NaN)));
|
|
2789
|
+
const cy2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _294 => _294.getAttribute, 'call', _295 => _295("cy")]), () => ( Number.NaN)));
|
|
2727
2790
|
return from && Number.isFinite(cx2) && Number.isFinite(cy2) ? {
|
|
2728
2791
|
from,
|
|
2729
2792
|
kind: "one-cell",
|
|
@@ -2735,10 +2798,10 @@ function parseChartAnchorNode(anchorNode) {
|
|
|
2735
2798
|
}
|
|
2736
2799
|
const pos = getFirstLocalChild(anchorNode, "pos");
|
|
2737
2800
|
const ext = getFirstLocalChild(anchorNode, "ext");
|
|
2738
|
-
const x = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
2739
|
-
const y = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
2740
|
-
const cx = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess',
|
|
2741
|
-
const cy = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess',
|
|
2801
|
+
const x = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _296 => _296.getAttribute, 'call', _297 => _297("x")]), () => ( Number.NaN)));
|
|
2802
|
+
const y = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _298 => _298.getAttribute, 'call', _299 => _299("y")]), () => ( Number.NaN)));
|
|
2803
|
+
const cx = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _300 => _300.getAttribute, 'call', _301 => _301("cx")]), () => ( Number.NaN)));
|
|
2804
|
+
const cy = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _302 => _302.getAttribute, 'call', _303 => _303("cy")]), () => ( Number.NaN)));
|
|
2742
2805
|
return Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(cx) && Number.isFinite(cy) ? {
|
|
2743
2806
|
kind: "absolute",
|
|
2744
2807
|
positionEmu: {
|
|
@@ -2764,8 +2827,8 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
|
|
|
2764
2827
|
const categoriesRef = normalizeChartReference(series.categories);
|
|
2765
2828
|
const valuesRef = normalizeChartReference(series.values);
|
|
2766
2829
|
const shapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : void 0;
|
|
2767
|
-
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2768
|
-
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2830
|
+
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _304 => _304.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
|
|
2831
|
+
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _305 => _305.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
|
|
2769
2832
|
const bubbleSizeRef = normalizeChartReference(_nullishCoalesce(_nullishCoalesce(series.bubbleSize, () => ( series.bubbleSizes)), () => ( series.bubbles)));
|
|
2770
2833
|
return {
|
|
2771
2834
|
bubbleSizeRef,
|
|
@@ -2778,7 +2841,7 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
|
|
|
2778
2841
|
id: `${chartId}-series-${index}`,
|
|
2779
2842
|
invertIfNegative: typeof series.invertIfNegative === "boolean" ? series.invertIfNegative : void 0,
|
|
2780
2843
|
lineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
|
|
2781
|
-
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2844
|
+
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _306 => _306.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
|
|
2782
2845
|
marker: series.marker && typeof series.marker === "object" ? series.marker : void 0,
|
|
2783
2846
|
markerColor: void 0,
|
|
2784
2847
|
markerLineColor: void 0,
|
|
@@ -2908,7 +2971,7 @@ function collectChartOriginsForSheet(archive, origin) {
|
|
|
2908
2971
|
for (const anchorNode of anchorNodes) {
|
|
2909
2972
|
const graphicFrame = getFirstLocalDescendant(anchorNode, "graphicFrame");
|
|
2910
2973
|
const chartNode = graphicFrame ? getFirstLocalDescendant(graphicFrame, "chart") : null;
|
|
2911
|
-
const relationshipId = _nullishCoalesce(_nullishCoalesce(_optionalChain([chartNode, 'optionalAccess',
|
|
2974
|
+
const relationshipId = _nullishCoalesce(_nullishCoalesce(_optionalChain([chartNode, 'optionalAccess', _307 => _307.getAttributeNS, 'call', _308 => _308("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id")]), () => ( _optionalChain([chartNode, 'optionalAccess', _309 => _309.getAttribute, 'call', _310 => _310("r:id")]))), () => ( _optionalChain([chartNode, 'optionalAccess', _311 => _311.getAttribute, 'call', _312 => _312("id")])));
|
|
2912
2975
|
if (!relationshipId) {
|
|
2913
2976
|
continue;
|
|
2914
2977
|
}
|
|
@@ -3012,7 +3075,7 @@ function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkb
|
|
|
3012
3075
|
is3d: typeof chart.is3D === "boolean" ? chart.is3D : void 0,
|
|
3013
3076
|
legend: normalizeLegend(chart.legend) ? {
|
|
3014
3077
|
...normalizeLegend(chart.legend),
|
|
3015
|
-
position: normalizeLegendPosition(_optionalChain([normalizeLegend, 'call',
|
|
3078
|
+
position: normalizeLegendPosition(_optionalChain([normalizeLegend, 'call', _313 => _313(chart.legend), 'optionalAccess', _314 => _314.position]))
|
|
3016
3079
|
} : null,
|
|
3017
3080
|
name: typeof drawing.name === "string" ? drawing.name : void 0,
|
|
3018
3081
|
overlap: typeof chart.overlap === "number" ? chart.overlap : void 0,
|
|
@@ -3063,7 +3126,7 @@ function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkb
|
|
|
3063
3126
|
visibleSheetIndex,
|
|
3064
3127
|
rawChartEx,
|
|
3065
3128
|
chartExIndex,
|
|
3066
|
-
_nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess',
|
|
3129
|
+
_nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess', _315 => _315.themePalette]), () => ( null))
|
|
3067
3130
|
);
|
|
3068
3131
|
});
|
|
3069
3132
|
return [...classicCharts, ...modernCharts];
|
|
@@ -3141,7 +3204,7 @@ function updateAnchorNode(anchorNode, anchor) {
|
|
|
3141
3204
|
function setChartTitle(chartNode, value) {
|
|
3142
3205
|
const existing = getFirstLocalChild(chartNode, "title");
|
|
3143
3206
|
if (!value) {
|
|
3144
|
-
_optionalChain([existing, 'optionalAccess',
|
|
3207
|
+
_optionalChain([existing, 'optionalAccess', _316 => _316.remove, 'call', _317 => _317()]);
|
|
3145
3208
|
return;
|
|
3146
3209
|
}
|
|
3147
3210
|
const titleNode = _nullishCoalesce(existing, () => ( chartNode.insertBefore(
|
|
@@ -3175,7 +3238,7 @@ function setRefFormula(parent, refNodeName, formula) {
|
|
|
3175
3238
|
}
|
|
3176
3239
|
function setSeriesText(seriesNode, series) {
|
|
3177
3240
|
const raw = series.raw && typeof series.raw === "object" ? series.raw : null;
|
|
3178
|
-
const nameFormula = typeof _optionalChain([raw, 'optionalAccess',
|
|
3241
|
+
const nameFormula = typeof _optionalChain([raw, 'optionalAccess', _318 => _318.name]) === "string" && raw.name.length > 0 ? raw.name : void 0;
|
|
3179
3242
|
if (!nameFormula && series.name === void 0) {
|
|
3180
3243
|
return;
|
|
3181
3244
|
}
|
|
@@ -3200,12 +3263,12 @@ function updateSeriesNodes(plotAreaNode, chart) {
|
|
|
3200
3263
|
return;
|
|
3201
3264
|
}
|
|
3202
3265
|
setSeriesText(seriesNode, series);
|
|
3203
|
-
if (_optionalChain([series, 'access',
|
|
3266
|
+
if (_optionalChain([series, 'access', _319 => _319.categoriesRef, 'optionalAccess', _320 => _320.formula])) {
|
|
3204
3267
|
const target = _nullishCoalesce(_nullishCoalesce(getFirstLocalChild(seriesNode, "xVal"), () => ( getFirstLocalChild(seriesNode, "cat"))), () => ( (chart.chartType === "Scatter" || chart.chartType === "ScatterLines" || chart.chartType === "ScatterSmooth" || chart.chartType === "Bubble" ? ensureChild(seriesNode, "xVal") : ensureChild(seriesNode, "cat"))));
|
|
3205
3268
|
const categoryRefName = target.localName === "xVal" || getFirstLocalChild(target, "numRef") ? "numRef" : "strRef";
|
|
3206
3269
|
setRefFormula(target, categoryRefName, series.categoriesRef.formula);
|
|
3207
3270
|
}
|
|
3208
|
-
if (_optionalChain([series, 'access',
|
|
3271
|
+
if (_optionalChain([series, 'access', _321 => _321.valuesRef, 'optionalAccess', _322 => _322.formula])) {
|
|
3209
3272
|
const target = _nullishCoalesce(_nullishCoalesce(getFirstLocalChild(seriesNode, "yVal"), () => ( getFirstLocalChild(seriesNode, "val"))), () => ( (chart.chartType === "Scatter" || chart.chartType === "ScatterLines" || chart.chartType === "ScatterSmooth" || chart.chartType === "Bubble" ? ensureChild(seriesNode, "yVal") : ensureChild(seriesNode, "val"))));
|
|
3210
3273
|
setRefFormula(target, "numRef", series.valuesRef.formula);
|
|
3211
3274
|
}
|
|
@@ -3227,14 +3290,14 @@ function updateAxisNode(axisNode, axis) {
|
|
|
3227
3290
|
}
|
|
3228
3291
|
if (axis.position) {
|
|
3229
3292
|
setLeafValue(ensureChild(axisNode, "axPos"), "val", axis.position);
|
|
3230
|
-
_optionalChain([getFirstLocalChild, 'call',
|
|
3293
|
+
_optionalChain([getFirstLocalChild, 'call', _323 => _323(axisNode, "axPos"), 'optionalAccess', _324 => _324.setAttribute, 'call', _325 => _325("val", axis.position)]);
|
|
3231
3294
|
}
|
|
3232
3295
|
if (axis.majorGridlines !== void 0) {
|
|
3233
3296
|
const gridlines = getFirstLocalChild(axisNode, "majorGridlines");
|
|
3234
3297
|
if (axis.majorGridlines && !gridlines) {
|
|
3235
3298
|
axisNode.appendChild(axisNode.ownerDocument.createElementNS(CHART_NS, "c:majorGridlines"));
|
|
3236
3299
|
} else if (!axis.majorGridlines) {
|
|
3237
|
-
_optionalChain([gridlines, 'optionalAccess',
|
|
3300
|
+
_optionalChain([gridlines, 'optionalAccess', _326 => _326.remove, 'call', _327 => _327()]);
|
|
3238
3301
|
}
|
|
3239
3302
|
}
|
|
3240
3303
|
if (axis.minorGridlines !== void 0) {
|
|
@@ -3242,28 +3305,28 @@ function updateAxisNode(axisNode, axis) {
|
|
|
3242
3305
|
if (axis.minorGridlines && !gridlines) {
|
|
3243
3306
|
axisNode.appendChild(axisNode.ownerDocument.createElementNS(CHART_NS, "c:minorGridlines"));
|
|
3244
3307
|
} else if (!axis.minorGridlines) {
|
|
3245
|
-
_optionalChain([gridlines, 'optionalAccess',
|
|
3308
|
+
_optionalChain([gridlines, 'optionalAccess', _328 => _328.remove, 'call', _329 => _329()]);
|
|
3246
3309
|
}
|
|
3247
3310
|
}
|
|
3248
3311
|
if (axis.majorTickMark) {
|
|
3249
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3312
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _330 => _330(axisNode, "majorTickMark"), 'optionalAccess', _331 => _331.setAttribute, 'call', _332 => _332("val", axis.majorTickMark)]), () => ( setBooleanValue(axisNode, "majorTickMark", false).setAttribute("val", axis.majorTickMark)));
|
|
3250
3313
|
}
|
|
3251
3314
|
if (axis.minorTickMark) {
|
|
3252
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3315
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _333 => _333(axisNode, "minorTickMark"), 'optionalAccess', _334 => _334.setAttribute, 'call', _335 => _335("val", axis.minorTickMark)]), () => ( setBooleanValue(axisNode, "minorTickMark", false).setAttribute("val", axis.minorTickMark)));
|
|
3253
3316
|
}
|
|
3254
3317
|
if (axis.labelPosition) {
|
|
3255
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3318
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _336 => _336(axisNode, "tickLblPos"), 'optionalAccess', _337 => _337.setAttribute, 'call', _338 => _338("val", axis.labelPosition)]), () => ( setBooleanValue(axisNode, "tickLblPos", false).setAttribute("val", axis.labelPosition)));
|
|
3256
3319
|
}
|
|
3257
3320
|
if (axis.crosses) {
|
|
3258
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3321
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _339 => _339(axisNode, "crosses"), 'optionalAccess', _340 => _340.setAttribute, 'call', _341 => _341("val", axis.crosses)]), () => ( setBooleanValue(axisNode, "crosses", false).setAttribute("val", axis.crosses)));
|
|
3259
3322
|
}
|
|
3260
3323
|
if (axis.crossBetween) {
|
|
3261
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3324
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _342 => _342(axisNode, "crossBetween"), 'optionalAccess', _343 => _343.setAttribute, 'call', _344 => _344("val", axis.crossBetween)]), () => ( setBooleanValue(axisNode, "crossBetween", false).setAttribute("val", axis.crossBetween)));
|
|
3262
3325
|
}
|
|
3263
3326
|
if (axis.delete !== void 0) {
|
|
3264
3327
|
setBooleanValue(axisNode, "delete", axis.delete);
|
|
3265
3328
|
}
|
|
3266
|
-
if (_optionalChain([axis, 'access',
|
|
3329
|
+
if (_optionalChain([axis, 'access', _345 => _345.numberFormat, 'optionalAccess', _346 => _346.formatCode])) {
|
|
3267
3330
|
const numFmt = ensureChild(axisNode, "numFmt");
|
|
3268
3331
|
numFmt.setAttribute("formatCode", axis.numberFormat.formatCode);
|
|
3269
3332
|
if (axis.numberFormat.sourceLinked !== void 0) {
|
|
@@ -3319,7 +3382,7 @@ function updateWorkbookChartAnchor(imageAssets, chartAssets, chartId, anchor) {
|
|
|
3319
3382
|
}
|
|
3320
3383
|
function updateWorkbookChartDefinition(imageAssets, chartAssets, chartId, patch) {
|
|
3321
3384
|
const origin = chartAssets.chartOriginsById.get(chartId);
|
|
3322
|
-
if (!_optionalChain([origin, 'optionalAccess',
|
|
3385
|
+
if (!_optionalChain([origin, 'optionalAccess', _347 => _347.chartPath])) {
|
|
3323
3386
|
return false;
|
|
3324
3387
|
}
|
|
3325
3388
|
const chartXml = readArchiveText(imageAssets.archive, origin.chartPath);
|
|
@@ -3478,7 +3541,7 @@ function resolveWorkbookColor(color, themePalette) {
|
|
|
3478
3541
|
}
|
|
3479
3542
|
const themeValue = _nullishCoalesce(color.theme, () => ( color.themeIndex));
|
|
3480
3543
|
const numericTheme = typeof themeValue === "number" ? themeValue : typeof themeValue === "string" && themeValue.trim().length > 0 ? Number(themeValue) : Number.NaN;
|
|
3481
|
-
const themeColor = Number.isFinite(numericTheme) ? _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
3544
|
+
const themeColor = Number.isFinite(numericTheme) ? _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _348 => _348.colorsByIndex, 'access', _349 => _349[numericTheme]]), () => ( null)) : null;
|
|
3482
3545
|
if (!themeColor) {
|
|
3483
3546
|
return null;
|
|
3484
3547
|
}
|
|
@@ -3520,7 +3583,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
|
|
|
3520
3583
|
if (stops.length > 0) {
|
|
3521
3584
|
const gradientType = typeof fill.gradientType === "string" ? fill.gradientType : "linear";
|
|
3522
3585
|
if (gradientType === "path") {
|
|
3523
|
-
const backgroundColor = _nullishCoalesce(_optionalChain([stops, 'access',
|
|
3586
|
+
const backgroundColor = _nullishCoalesce(_optionalChain([stops, 'access', _350 => _350[stops.length - 1], 'optionalAccess', _351 => _351.color]), () => ( null));
|
|
3524
3587
|
return {
|
|
3525
3588
|
backgroundColor,
|
|
3526
3589
|
backgroundImage: `radial-gradient(circle at center, ${stops.map((stop) => `${stop.color} ${Math.max(0, Math.min(100, stop.position * 100))}%`).join(", ")})`
|
|
@@ -3529,7 +3592,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
|
|
|
3529
3592
|
const degree = typeof fill.degree === "number" ? fill.degree : Number(_nullishCoalesce(fill.degree, () => ( 0)));
|
|
3530
3593
|
const cssAngle = Number.isFinite(degree) ? 90 - degree : 90;
|
|
3531
3594
|
return {
|
|
3532
|
-
backgroundColor: _nullishCoalesce(_optionalChain([stops, 'access',
|
|
3595
|
+
backgroundColor: _nullishCoalesce(_optionalChain([stops, 'access', _352 => _352[stops.length - 1], 'optionalAccess', _353 => _353.color]), () => ( null)),
|
|
3533
3596
|
backgroundImage: `linear-gradient(${cssAngle}deg, ${stops.map((stop) => `${stop.color} ${Math.max(0, Math.min(100, stop.position * 100))}%`).join(", ")})`
|
|
3534
3597
|
};
|
|
3535
3598
|
}
|
|
@@ -3826,7 +3889,7 @@ function readFeaturePropertyBagCheckboxComplements(archive) {
|
|
|
3826
3889
|
return /* @__PURE__ */ new Set();
|
|
3827
3890
|
}
|
|
3828
3891
|
const document2 = parseXml2(xml);
|
|
3829
|
-
if (!_optionalChain([document2, 'optionalAccess',
|
|
3892
|
+
if (!_optionalChain([document2, 'optionalAccess', _354 => _354.documentElement])) {
|
|
3830
3893
|
return /* @__PURE__ */ new Set();
|
|
3831
3894
|
}
|
|
3832
3895
|
const bagNodes = getChildElements(document2.documentElement, "bag");
|
|
@@ -3911,7 +3974,7 @@ function resolveContentType(contentTypes, path) {
|
|
|
3911
3974
|
if (override) {
|
|
3912
3975
|
return override;
|
|
3913
3976
|
}
|
|
3914
|
-
const extension = _optionalChain([normalized, 'access',
|
|
3977
|
+
const extension = _optionalChain([normalized, 'access', _355 => _355.split, 'call', _356 => _356("."), 'access', _357 => _357.pop, 'call', _358 => _358(), 'optionalAccess', _359 => _359.toLowerCase, 'call', _360 => _360()]);
|
|
3915
3978
|
if (!extension) {
|
|
3916
3979
|
return "application/octet-stream";
|
|
3917
3980
|
}
|
|
@@ -4008,15 +4071,15 @@ function parseWorkbookTheme(archive) {
|
|
|
4008
4071
|
const key = colorNode.localName;
|
|
4009
4072
|
const srgbNode = getFirstChild(colorNode, "srgbClr");
|
|
4010
4073
|
const sysNode = getFirstChild(colorNode, "sysClr");
|
|
4011
|
-
const hex = _nullishCoalesce(_optionalChain([srgbNode, 'optionalAccess',
|
|
4074
|
+
const hex = _nullishCoalesce(_optionalChain([srgbNode, 'optionalAccess', _361 => _361.getAttribute, 'call', _362 => _362("val")]), () => ( _optionalChain([sysNode, 'optionalAccess', _363 => _363.getAttribute, 'call', _364 => _364("lastClr")])));
|
|
4012
4075
|
if (hex) {
|
|
4013
4076
|
colors.set(key, normalizeHexColor3(hex));
|
|
4014
4077
|
}
|
|
4015
4078
|
}
|
|
4016
4079
|
}
|
|
4017
4080
|
const fontSchemeNode = _nullishCoalesce(getLocalElements(themeDocument, "fontScheme")[0], () => ( null));
|
|
4018
|
-
const majorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4019
|
-
const minorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4081
|
+
const majorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _365 => _365(getFirstChild(fontSchemeNode, "majorFont"), "latin"), 'optionalAccess', _366 => _366.getAttribute, 'call', _367 => _367("typeface")]), () => ( null));
|
|
4082
|
+
const minorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _368 => _368(getFirstChild(fontSchemeNode, "minorFont"), "latin"), 'optionalAccess', _369 => _369.getAttribute, 'call', _370 => _370("typeface")]), () => ( null));
|
|
4020
4083
|
colors.set("bg1", _nullishCoalesce(_nullishCoalesce(colors.get("lt1"), () => ( defaultTheme.colors.get("bg1"))), () => ( "#ffffff")));
|
|
4021
4084
|
colors.set("tx1", _nullishCoalesce(_nullishCoalesce(colors.get("dk1"), () => ( defaultTheme.colors.get("tx1"))), () => ( "#000000")));
|
|
4022
4085
|
colors.set("bg2", _nullishCoalesce(_nullishCoalesce(colors.get("lt2"), () => ( defaultTheme.colors.get("bg2"))), () => ( "#e7e6e6")));
|
|
@@ -4076,8 +4139,8 @@ function parseSheetSparklines(document2, themePalette) {
|
|
|
4076
4139
|
continue;
|
|
4077
4140
|
}
|
|
4078
4141
|
for (const sparklineNode of getChildElements(sparklineCollectionNode, "sparkline")) {
|
|
4079
|
-
const formula = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4080
|
-
const targetReference = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4142
|
+
const formula = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _371 => _371(sparklineNode, "f"), 'optionalAccess', _372 => _372.textContent]), () => ( ""));
|
|
4143
|
+
const targetReference = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _373 => _373(sparklineNode, "sqref"), 'optionalAccess', _374 => _374.textContent]), () => ( ""));
|
|
4081
4144
|
const range = parseFormulaRangeReference(formula);
|
|
4082
4145
|
const target = parseFormulaCellReference(targetReference);
|
|
4083
4146
|
if (!range || !target) {
|
|
@@ -4112,15 +4175,15 @@ function parseSpreadsheetFont(node) {
|
|
|
4112
4175
|
font[property] = hasEnabledSpreadsheetFlag(flag);
|
|
4113
4176
|
}
|
|
4114
4177
|
}
|
|
4115
|
-
const size = _optionalChain([getFirstChild, 'call',
|
|
4116
|
-
const name = _optionalChain([getFirstChild, 'call',
|
|
4117
|
-
const family = _optionalChain([getFirstChild, 'call',
|
|
4118
|
-
const scheme = _optionalChain([getFirstChild, 'call',
|
|
4119
|
-
const charset = _optionalChain([getFirstChild, 'call',
|
|
4120
|
-
const verticalAlign = _optionalChain([getFirstChild, 'call',
|
|
4178
|
+
const size = _optionalChain([getFirstChild, 'call', _375 => _375(node, "sz"), 'optionalAccess', _376 => _376.getAttribute, 'call', _377 => _377("val")]);
|
|
4179
|
+
const name = _optionalChain([getFirstChild, 'call', _378 => _378(node, "name"), 'optionalAccess', _379 => _379.getAttribute, 'call', _380 => _380("val")]);
|
|
4180
|
+
const family = _optionalChain([getFirstChild, 'call', _381 => _381(node, "family"), 'optionalAccess', _382 => _382.getAttribute, 'call', _383 => _383("val")]);
|
|
4181
|
+
const scheme = _optionalChain([getFirstChild, 'call', _384 => _384(node, "scheme"), 'optionalAccess', _385 => _385.getAttribute, 'call', _386 => _386("val")]);
|
|
4182
|
+
const charset = _optionalChain([getFirstChild, 'call', _387 => _387(node, "charset"), 'optionalAccess', _388 => _388.getAttribute, 'call', _389 => _389("val")]);
|
|
4183
|
+
const verticalAlign = _optionalChain([getFirstChild, 'call', _390 => _390(node, "vertAlign"), 'optionalAccess', _391 => _391.getAttribute, 'call', _392 => _392("val")]);
|
|
4121
4184
|
const color = parseSpreadsheetColor(getFirstChild(node, "color"));
|
|
4122
4185
|
if (getFirstChild(node, "u")) {
|
|
4123
|
-
font.underline = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4186
|
+
font.underline = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _393 => _393(node, "u"), 'optionalAccess', _394 => _394.getAttribute, 'call', _395 => _395("val")]), () => ( "single"));
|
|
4124
4187
|
}
|
|
4125
4188
|
if (size !== null && size !== void 0) {
|
|
4126
4189
|
font.size = Number(size);
|
|
@@ -4311,8 +4374,8 @@ function parseResolvedXfStyle(xfNode, fonts, fills, borders, checkboxComplementI
|
|
|
4311
4374
|
style.alignment = alignment;
|
|
4312
4375
|
}
|
|
4313
4376
|
const xfComplementNode = getFirstDescendant(xfNode, "xfComplement");
|
|
4314
|
-
const xfComplementIndex = Number(_nullishCoalesce(_optionalChain([xfComplementNode, 'optionalAccess',
|
|
4315
|
-
if (Number.isFinite(xfComplementIndex) && _optionalChain([checkboxComplementIndices, 'optionalAccess',
|
|
4377
|
+
const xfComplementIndex = Number(_nullishCoalesce(_optionalChain([xfComplementNode, 'optionalAccess', _396 => _396.getAttribute, 'call', _397 => _397("i")]), () => ( Number.NaN)));
|
|
4378
|
+
if (Number.isFinite(xfComplementIndex) && _optionalChain([checkboxComplementIndices, 'optionalAccess', _398 => _398.has, 'call', _399 => _399(xfComplementIndex)])) {
|
|
4316
4379
|
style.cellControl = { kind: "checkbox" };
|
|
4317
4380
|
}
|
|
4318
4381
|
return style;
|
|
@@ -4406,7 +4469,7 @@ function parseWorkbookStyles(archive) {
|
|
|
4406
4469
|
});
|
|
4407
4470
|
tableStyleByName[name] = elements;
|
|
4408
4471
|
});
|
|
4409
|
-
const normalFont = _nullishCoalesce(_nullishCoalesce(_optionalChain([namedCellStyleByName, 'access',
|
|
4472
|
+
const normalFont = _nullishCoalesce(_nullishCoalesce(_optionalChain([namedCellStyleByName, 'access', _400 => _400.Normal, 'optionalAccess', _401 => _401.font]), () => ( _optionalChain([styleById, 'access', _402 => _402[0], 'optionalAccess', _403 => _403.font]))), () => ( fonts[0]));
|
|
4410
4473
|
const defaultFont = normalFont ? {
|
|
4411
4474
|
family: typeof normalFont.name === "string" ? normalFont.name : void 0,
|
|
4412
4475
|
sizePt: typeof normalFont.size === "number" ? normalFont.size : void 0
|
|
@@ -4436,7 +4499,7 @@ function parseConditionalFormatValueObject(node) {
|
|
|
4436
4499
|
if (!type) {
|
|
4437
4500
|
return null;
|
|
4438
4501
|
}
|
|
4439
|
-
const rawValue = _nullishCoalesce(_nullishCoalesce(node.getAttribute("val"), () => ( _optionalChain([getFirstChild, 'call',
|
|
4502
|
+
const rawValue = _nullishCoalesce(_nullishCoalesce(node.getAttribute("val"), () => ( _optionalChain([getFirstChild, 'call', _404 => _404(node, "f"), 'optionalAccess', _405 => _405.textContent]))), () => ( void 0));
|
|
4440
4503
|
const numericValue = rawValue !== void 0 ? Number(rawValue) : Number.NaN;
|
|
4441
4504
|
return {
|
|
4442
4505
|
type,
|
|
@@ -4485,7 +4548,7 @@ function parseStandardConditionalFormatRule(cfRuleNode, ranges, differentialStyl
|
|
|
4485
4548
|
if (cfvos.length === 0) {
|
|
4486
4549
|
return null;
|
|
4487
4550
|
}
|
|
4488
|
-
const extId = _optionalChain([getFirstDescendant, 'call',
|
|
4551
|
+
const extId = _optionalChain([getFirstDescendant, 'call', _406 => _406(cfRuleNode, "id"), 'optionalAccess', _407 => _407.textContent, 'optionalAccess', _408 => _408.trim, 'call', _409 => _409()]) || void 0;
|
|
4489
4552
|
return {
|
|
4490
4553
|
cfvos,
|
|
4491
4554
|
color: parseSpreadsheetColor(getFirstChild(dataBarNode, "color")),
|
|
@@ -4661,7 +4724,7 @@ function parseConditionalFormatRules(document2, differentialStyles = []) {
|
|
|
4661
4724
|
const extendedRules = [];
|
|
4662
4725
|
getLocalElements(document2, "conditionalFormatting").forEach((conditionalFormattingNode) => {
|
|
4663
4726
|
const isExtended = conditionalFormattingNode.namespaceURI !== SPREADSHEET_NS;
|
|
4664
|
-
const ranges = isExtended ? parseSqrefRanges(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4727
|
+
const ranges = isExtended ? parseSqrefRanges(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _410 => _410(conditionalFormattingNode, "sqref"), 'optionalAccess', _411 => _411.textContent]), () => ( ""))) : parseSqrefRanges(conditionalFormattingNode.getAttribute("sqref"));
|
|
4665
4728
|
getChildElements(conditionalFormattingNode, "cfRule").forEach((cfRuleNode) => {
|
|
4666
4729
|
const parsedRule = isExtended ? parseExtendedConditionalFormatRule(cfRuleNode, ranges) : parseStandardConditionalFormatRule(cfRuleNode, ranges, differentialStyles);
|
|
4667
4730
|
if (parsedRule) {
|
|
@@ -4708,11 +4771,11 @@ function parseSheetState(archive, path, options) {
|
|
|
4708
4771
|
if (!document2) {
|
|
4709
4772
|
return null;
|
|
4710
4773
|
}
|
|
4711
|
-
const includeCachedFormulaValues = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4712
|
-
const autoFilterRanges = parseSqrefRanges(_optionalChain([getLocalElements, 'call',
|
|
4774
|
+
const includeCachedFormulaValues = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _412 => _412.includeCachedFormulaValues]), () => ( true));
|
|
4775
|
+
const autoFilterRanges = parseSqrefRanges(_optionalChain([getLocalElements, 'call', _413 => _413(document2, "autoFilter"), 'access', _414 => _414[0], 'optionalAccess', _415 => _415.getAttribute, 'call', _416 => _416("ref")]));
|
|
4713
4776
|
const cachedFormulaValues = {};
|
|
4714
|
-
const conditionalFormatRules = parseConditionalFormatRules(document2, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4715
|
-
const sparklines = parseSheetSparklines(document2, _optionalChain([options, 'optionalAccess',
|
|
4777
|
+
const conditionalFormatRules = parseConditionalFormatRules(document2, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _417 => _417.differentialStyles]), () => ( [])));
|
|
4778
|
+
const sparklines = parseSheetSparklines(document2, _optionalChain([options, 'optionalAccess', _418 => _418.themePalette]));
|
|
4716
4779
|
const sheetFormatNode = _nullishCoalesce(getLocalElements(document2, "sheetFormatPr")[0], () => ( null));
|
|
4717
4780
|
const sheetViewNode = _nullishCoalesce(getLocalElements(document2, "sheetView")[0], () => ( null));
|
|
4718
4781
|
const rowHeightOverridesPx = {};
|
|
@@ -4725,15 +4788,15 @@ function parseSheetState(archive, path, options) {
|
|
|
4725
4788
|
let maxContentCol = -1;
|
|
4726
4789
|
let maxContentRow = -1;
|
|
4727
4790
|
const columnWidthCharacterWidthPx = measureColumnCharacterWidthPx(
|
|
4728
|
-
_optionalChain([options, 'optionalAccess',
|
|
4729
|
-
_optionalChain([options, 'optionalAccess',
|
|
4791
|
+
_optionalChain([options, 'optionalAccess', _419 => _419.defaultFont, 'optionalAccess', _420 => _420.family]),
|
|
4792
|
+
_optionalChain([options, 'optionalAccess', _421 => _421.defaultFont, 'optionalAccess', _422 => _422.sizePt])
|
|
4730
4793
|
);
|
|
4731
|
-
const defaultRowHeight = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess',
|
|
4794
|
+
const defaultRowHeight = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _423 => _423.getAttribute, 'call', _424 => _424("defaultRowHeight")]), () => ( 15)));
|
|
4732
4795
|
const defaultColWidth = Number(
|
|
4733
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess',
|
|
4796
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _425 => _425.getAttribute, 'call', _426 => _426("defaultColWidth")]), () => ( _optionalChain([sheetFormatNode, 'optionalAccess', _427 => _427.getAttribute, 'call', _428 => _428("baseColWidth")]))), () => ( 8.43))
|
|
4734
4797
|
);
|
|
4735
4798
|
const rawZoomScale = Number(
|
|
4736
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess',
|
|
4799
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _429 => _429.getAttribute, 'call', _430 => _430("zoomScale")]), () => ( _optionalChain([sheetViewNode, 'optionalAccess', _431 => _431.getAttribute, 'call', _432 => _432("zoomScaleNormal")]))), () => ( Number.NaN))
|
|
4737
4800
|
);
|
|
4738
4801
|
const zoomScale = Number.isFinite(rawZoomScale) && rawZoomScale > 0 ? rawZoomScale : 100;
|
|
4739
4802
|
const trackContentCell = (cellRef) => {
|
|
@@ -4829,7 +4892,7 @@ function parseSheetState(archive, path, options) {
|
|
|
4829
4892
|
hiddenRows: [],
|
|
4830
4893
|
rowHeightOverridesPx,
|
|
4831
4894
|
rowStyleIds,
|
|
4832
|
-
showGridLines: (_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess',
|
|
4895
|
+
showGridLines: (_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _433 => _433.getAttribute, 'call', _434 => _434("showGridLines")]), () => ( "1"))) !== "0",
|
|
4833
4896
|
sparklines,
|
|
4834
4897
|
zoomScale
|
|
4835
4898
|
};
|
|
@@ -4964,9 +5027,9 @@ function resolvePreferredTextTypeface(node, theme) {
|
|
|
4964
5027
|
if (!node) {
|
|
4965
5028
|
return void 0;
|
|
4966
5029
|
}
|
|
4967
|
-
const latin = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4968
|
-
const eastAsian = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4969
|
-
const complexScript = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5030
|
+
const latin = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _435 => _435(node, "latin"), 'optionalAccess', _436 => _436.getAttribute, 'call', _437 => _437("typeface")]), () => ( null));
|
|
5031
|
+
const eastAsian = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _438 => _438(node, "ea"), 'optionalAccess', _439 => _439.getAttribute, 'call', _440 => _440("typeface")]), () => ( null));
|
|
5032
|
+
const complexScript = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _441 => _441(node, "cs"), 'optionalAccess', _442 => _442.getAttribute, 'call', _443 => _443("typeface")]), () => ( null));
|
|
4970
5033
|
const candidates = [latin, eastAsian, complexScript];
|
|
4971
5034
|
const explicit = candidates.find((candidate) => candidate && !isThemeTypeface(candidate));
|
|
4972
5035
|
if (explicit) {
|
|
@@ -4977,14 +5040,14 @@ function resolvePreferredTextTypeface(node, theme) {
|
|
|
4977
5040
|
function parseShapeTextStyle(node, theme, fallbackColor) {
|
|
4978
5041
|
if (!node) {
|
|
4979
5042
|
return {
|
|
4980
|
-
color: _optionalChain([fallbackColor, 'optionalAccess',
|
|
5043
|
+
color: _optionalChain([fallbackColor, 'optionalAccess', _444 => _444.color])
|
|
4981
5044
|
};
|
|
4982
5045
|
}
|
|
4983
5046
|
const fillColor = _nullishCoalesce(_nullishCoalesce(resolveFillColor(node, theme), () => ( fallbackColor)), () => ( null));
|
|
4984
5047
|
const underlineValue = node.getAttribute("u");
|
|
4985
5048
|
return {
|
|
4986
5049
|
bold: node.getAttribute("b") === "1" || void 0,
|
|
4987
|
-
color: _optionalChain([fillColor, 'optionalAccess',
|
|
5050
|
+
color: _optionalChain([fillColor, 'optionalAccess', _445 => _445.color]),
|
|
4988
5051
|
fontFamily: resolvePreferredTextTypeface(node, theme),
|
|
4989
5052
|
fontSizePt: node.getAttribute("sz") ? Number(node.getAttribute("sz")) / 100 : void 0,
|
|
4990
5053
|
italic: node.getAttribute("i") === "1" || void 0,
|
|
@@ -5010,10 +5073,10 @@ function parseMarker(node) {
|
|
|
5010
5073
|
if (!node) {
|
|
5011
5074
|
return null;
|
|
5012
5075
|
}
|
|
5013
|
-
const col = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5014
|
-
const row = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5015
|
-
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5016
|
-
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5076
|
+
const col = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _446 => _446(node, "col"), 'optionalAccess', _447 => _447.textContent]), () => ( 0)));
|
|
5077
|
+
const row = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _448 => _448(node, "row"), 'optionalAccess', _449 => _449.textContent]), () => ( 0)));
|
|
5078
|
+
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _450 => _450(node, "colOff"), 'optionalAccess', _451 => _451.textContent]), () => ( 0)));
|
|
5079
|
+
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _452 => _452(node, "rowOff"), 'optionalAccess', _453 => _453.textContent]), () => ( 0)));
|
|
5017
5080
|
return {
|
|
5018
5081
|
col,
|
|
5019
5082
|
colOffsetEmu,
|
|
@@ -5149,15 +5212,15 @@ function resolveDukeDrawingColor(color, themePalette) {
|
|
|
5149
5212
|
function resolveDukeDrawingText(text, themePalette) {
|
|
5150
5213
|
const caption = mapDukeDrawingText(text);
|
|
5151
5214
|
const label = normalizeControlLabel(text.runs.map((run) => run.text).join(""));
|
|
5152
|
-
const firstStyledRun = _optionalChain([text, 'access',
|
|
5215
|
+
const firstStyledRun = _optionalChain([text, 'access', _454 => _454.runs, 'access', _455 => _455.find, 'call', _456 => _456((run) => run.font), 'optionalAccess', _457 => _457.font]);
|
|
5153
5216
|
const horizontalAlignment = text.horizontalAlignment;
|
|
5154
5217
|
return {
|
|
5155
5218
|
caption,
|
|
5156
|
-
fontFamily: _optionalChain([firstStyledRun, 'optionalAccess',
|
|
5157
|
-
fontSizePt: _optionalChain([firstStyledRun, 'optionalAccess',
|
|
5219
|
+
fontFamily: _optionalChain([firstStyledRun, 'optionalAccess', _458 => _458.name]),
|
|
5220
|
+
fontSizePt: _optionalChain([firstStyledRun, 'optionalAccess', _459 => _459.size]),
|
|
5158
5221
|
label,
|
|
5159
5222
|
textAlign: horizontalAlignment === "left" || horizontalAlignment === "center" || horizontalAlignment === "right" ? horizontalAlignment : void 0,
|
|
5160
|
-
textColor: resolveDukeDrawingColor(_optionalChain([firstStyledRun, 'optionalAccess',
|
|
5223
|
+
textColor: resolveDukeDrawingColor(_optionalChain([firstStyledRun, 'optionalAccess', _460 => _460.color]), themePalette)
|
|
5161
5224
|
};
|
|
5162
5225
|
}
|
|
5163
5226
|
function mapDukeFormControlKind(kind, themePalette) {
|
|
@@ -5342,13 +5405,13 @@ function resolveSheetColumnWidthPx(sheetState, col) {
|
|
|
5342
5405
|
if (col < 0) {
|
|
5343
5406
|
return 0;
|
|
5344
5407
|
}
|
|
5345
|
-
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
5408
|
+
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _461 => _461.colWidthOverridesPx, 'access', _462 => _462[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _463 => _463.defaultColWidthPx]))), () => ( emuToPixels(DEFAULT_COL_WIDTH_EMU)));
|
|
5346
5409
|
}
|
|
5347
5410
|
function resolveSheetRowHeightPx(sheetState, row) {
|
|
5348
5411
|
if (row < 0) {
|
|
5349
5412
|
return 0;
|
|
5350
5413
|
}
|
|
5351
|
-
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
5414
|
+
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _464 => _464.rowHeightOverridesPx, 'access', _465 => _465[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _466 => _466.defaultRowHeightPx]))), () => ( emuToPixels(DEFAULT_ROW_HEIGHT_EMU)));
|
|
5352
5415
|
}
|
|
5353
5416
|
function sumSheetColumnWidthsEmu(sheetState, beforeCol) {
|
|
5354
5417
|
let total = 0;
|
|
@@ -5438,10 +5501,10 @@ function parseGroupTransform(groupNode, parentGroup, fallbackAnchor, sheetState)
|
|
|
5438
5501
|
const rootScaleY = rect.cy !== 0 ? anchorRect.cy / rect.cy : 1;
|
|
5439
5502
|
const useRectFrameForRoot = !parentGroup && (rootScaleX < 0.85 || rootScaleX > 1.15 || rootScaleY < 0.85 || rootScaleY > 1.15);
|
|
5440
5503
|
const absoluteRect = parentGroup ? applyGroupTransform(rect, parentGroup) : rootRectMatchesAnchorOrigin ? rect : anchorRect;
|
|
5441
|
-
const childRectX = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess',
|
|
5442
|
-
const childRectY = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess',
|
|
5443
|
-
const childRectCx = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess',
|
|
5444
|
-
const childRectCy = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess',
|
|
5504
|
+
const childRectX = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _467 => _467.getAttribute, 'call', _468 => _468("x")]), () => ( 0))) : useRectFrameForRoot ? rect.x : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _469 => _469.getAttribute, 'call', _470 => _470("x")]), () => ( 0)));
|
|
5505
|
+
const childRectY = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _471 => _471.getAttribute, 'call', _472 => _472("y")]), () => ( 0))) : useRectFrameForRoot ? rect.y : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _473 => _473.getAttribute, 'call', _474 => _474("y")]), () => ( 0)));
|
|
5506
|
+
const childRectCx = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _475 => _475.getAttribute, 'call', _476 => _476("cx")]), () => ( rect.cx))) : useRectFrameForRoot ? rect.cx : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _477 => _477.getAttribute, 'call', _478 => _478("cx")]), () => ( rect.cx)));
|
|
5507
|
+
const childRectCy = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _479 => _479.getAttribute, 'call', _480 => _480("cy")]), () => ( rect.cy))) : useRectFrameForRoot ? rect.cy : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _481 => _481.getAttribute, 'call', _482 => _482("cy")]), () => ( rect.cy)));
|
|
5445
5508
|
return {
|
|
5446
5509
|
chCx: childRectCx,
|
|
5447
5510
|
chCy: childRectCy,
|
|
@@ -5449,8 +5512,8 @@ function parseGroupTransform(groupNode, parentGroup, fallbackAnchor, sheetState)
|
|
|
5449
5512
|
chY: childRectY,
|
|
5450
5513
|
cx: absoluteRect.cx,
|
|
5451
5514
|
cy: absoluteRect.cy,
|
|
5452
|
-
scaleX: childRectCx !== 0 ? absoluteRect.cx / childRectCx : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5453
|
-
scaleY: childRectCy !== 0 ? absoluteRect.cy / childRectCy : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5515
|
+
scaleX: childRectCx !== 0 ? absoluteRect.cx / childRectCx : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _483 => _483.scaleX]), () => ( 1)),
|
|
5516
|
+
scaleY: childRectCy !== 0 ? absoluteRect.cy / childRectCy : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _484 => _484.scaleY]), () => ( 1)),
|
|
5454
5517
|
x: absoluteRect.x,
|
|
5455
5518
|
y: absoluteRect.y
|
|
5456
5519
|
};
|
|
@@ -5459,8 +5522,8 @@ function anchorFromNodeOrFallback(node, fallbackAnchor, parentGroup) {
|
|
|
5459
5522
|
const xfrmNode = getFirstDescendant(node, "xfrm");
|
|
5460
5523
|
const rect = parseTransformRect(xfrmNode);
|
|
5461
5524
|
if (rect) {
|
|
5462
|
-
const scaleX = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5463
|
-
const scaleY = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5525
|
+
const scaleX = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _485 => _485.scaleX]), () => ( 1));
|
|
5526
|
+
const scaleY = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _486 => _486.scaleY]), () => ( 1));
|
|
5464
5527
|
return {
|
|
5465
5528
|
anchor: parentGroup ? rectToAbsoluteAnchor(applyGroupTransform(rect, parentGroup)) : fallbackAnchor,
|
|
5466
5529
|
flipH: rect.flipH,
|
|
@@ -5475,8 +5538,8 @@ function anchorFromNodeOrFallback(node, fallbackAnchor, parentGroup) {
|
|
|
5475
5538
|
flipH: false,
|
|
5476
5539
|
flipV: false,
|
|
5477
5540
|
rotationDeg: 0,
|
|
5478
|
-
scaleX: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5479
|
-
scaleY: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5541
|
+
scaleX: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _487 => _487.scaleX]), () => ( 1)),
|
|
5542
|
+
scaleY: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _488 => _488.scaleY]), () => ( 1))
|
|
5480
5543
|
};
|
|
5481
5544
|
}
|
|
5482
5545
|
function mapParagraphAlign(value) {
|
|
@@ -5533,15 +5596,15 @@ function parseShapeStroke(node, styleNode, theme) {
|
|
|
5533
5596
|
if (lineNode && getFirstChild(lineNode, "noFill")) {
|
|
5534
5597
|
return { none: true };
|
|
5535
5598
|
}
|
|
5536
|
-
const color = _nullishCoalesce(resolveFillColor(lineNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([lineRefNode, 'optionalAccess',
|
|
5537
|
-
const widthEmu = Number(_nullishCoalesce(_optionalChain([lineNode, 'optionalAccess',
|
|
5599
|
+
const color = _nullishCoalesce(resolveFillColor(lineNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([lineRefNode, 'optionalAccess', _489 => _489.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
|
|
5600
|
+
const widthEmu = Number(_nullishCoalesce(_optionalChain([lineNode, 'optionalAccess', _490 => _490.getAttribute, 'call', _491 => _491("w")]), () => ( 0)));
|
|
5538
5601
|
return {
|
|
5539
|
-
color: _optionalChain([color, 'optionalAccess',
|
|
5540
|
-
dash: _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5541
|
-
headEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5602
|
+
color: _optionalChain([color, 'optionalAccess', _492 => _492.color]),
|
|
5603
|
+
dash: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _493 => _493(_nullishCoalesce(lineNode, () => ( node)), "prstDash"), 'optionalAccess', _494 => _494.getAttribute, 'call', _495 => _495("val")]), () => ( void 0)),
|
|
5604
|
+
headEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _496 => _496(_nullishCoalesce(lineNode, () => ( node)), "headEnd"), 'optionalAccess', _497 => _497.getAttribute, 'call', _498 => _498("type")]), () => ( void 0)),
|
|
5542
5605
|
none: false,
|
|
5543
|
-
opacity: _optionalChain([color, 'optionalAccess',
|
|
5544
|
-
tailEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5606
|
+
opacity: _optionalChain([color, 'optionalAccess', _499 => _499.opacity]),
|
|
5607
|
+
tailEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _500 => _500(_nullishCoalesce(lineNode, () => ( node)), "tailEnd"), 'optionalAccess', _501 => _501.getAttribute, 'call', _502 => _502("type")]), () => ( void 0)),
|
|
5545
5608
|
widthPx: widthEmu > 0 ? emuToPixels(widthEmu) : void 0
|
|
5546
5609
|
};
|
|
5547
5610
|
}
|
|
@@ -5555,7 +5618,7 @@ function parseShapeFill(node, styleNode, theme, geometry) {
|
|
|
5555
5618
|
return { none: true };
|
|
5556
5619
|
}
|
|
5557
5620
|
const fillRefNode = styleNode ? getFirstChild(styleNode, "fillRef") : null;
|
|
5558
|
-
const fillColor = _nullishCoalesce(resolveFillColor(shapePropsNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess',
|
|
5621
|
+
const fillColor = _nullishCoalesce(resolveFillColor(shapePropsNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _503 => _503.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
|
|
5559
5622
|
if (!fillColor) {
|
|
5560
5623
|
return void 0;
|
|
5561
5624
|
}
|
|
@@ -5652,12 +5715,12 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
|
|
|
5652
5715
|
return [];
|
|
5653
5716
|
}
|
|
5654
5717
|
const defaultFontRef = styleNode ? getFirstChild(styleNode, "fontRef") : null;
|
|
5655
|
-
const defaultFontColor = resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([defaultFontRef, 'optionalAccess',
|
|
5718
|
+
const defaultFontColor = resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([defaultFontRef, 'optionalAccess', _504 => _504.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme);
|
|
5656
5719
|
const listStyleNode = getFirstChild(txBodyNode, "lstStyle");
|
|
5657
5720
|
const paragraphs = [];
|
|
5658
5721
|
getChildElements(txBodyNode, "p").forEach((paragraphNode) => {
|
|
5659
5722
|
const paragraphProps = getFirstChild(paragraphNode, "pPr");
|
|
5660
|
-
const paragraphLevel = Number(_nullishCoalesce(_optionalChain([paragraphProps, 'optionalAccess',
|
|
5723
|
+
const paragraphLevel = Number(_nullishCoalesce(_optionalChain([paragraphProps, 'optionalAccess', _505 => _505.getAttribute, 'call', _506 => _506("lvl")]), () => ( 0)));
|
|
5661
5724
|
const listLevelProps = getFirstChild(_nullishCoalesce(listStyleNode, () => ( txBodyNode)), `lvl${paragraphLevel + 1}pPr`);
|
|
5662
5725
|
const inheritedStyle = mergeShapeTextStyles(
|
|
5663
5726
|
parseShapeTextStyle(getFirstChild(_nullishCoalesce(listLevelProps, () => ( txBodyNode)), "defRPr"), theme, defaultFontColor),
|
|
@@ -5675,7 +5738,7 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
|
|
|
5675
5738
|
return;
|
|
5676
5739
|
}
|
|
5677
5740
|
sawRenderableChild = true;
|
|
5678
|
-
const text = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5741
|
+
const text = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _507 => _507(child, "t"), 'optionalAccess', _508 => _508.textContent]), () => ( ""));
|
|
5679
5742
|
const runProps = getFirstChild(child, "rPr");
|
|
5680
5743
|
const runStyle = mergeShapeTextStyles(
|
|
5681
5744
|
inheritedStyle,
|
|
@@ -5706,7 +5769,7 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
|
|
|
5706
5769
|
});
|
|
5707
5770
|
}
|
|
5708
5771
|
paragraphs.push({
|
|
5709
|
-
align: mapParagraphAlign(_optionalChain([paragraphProps, 'optionalAccess',
|
|
5772
|
+
align: mapParagraphAlign(_optionalChain([paragraphProps, 'optionalAccess', _509 => _509.getAttribute, 'call', _510 => _510("algn")])),
|
|
5710
5773
|
runs
|
|
5711
5774
|
});
|
|
5712
5775
|
});
|
|
@@ -5718,26 +5781,26 @@ function parseTextBox(shapeNode) {
|
|
|
5718
5781
|
return void 0;
|
|
5719
5782
|
}
|
|
5720
5783
|
const bodyProps = getFirstChild(txBodyNode, "bodyPr");
|
|
5721
|
-
const leftInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5722
|
-
const rightInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5723
|
-
const topInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5724
|
-
const bottomInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5784
|
+
const leftInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _511 => _511.getAttribute, 'call', _512 => _512("lIns")]), () => ( 91440))));
|
|
5785
|
+
const rightInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _513 => _513.getAttribute, 'call', _514 => _514("rIns")]), () => ( 91440))));
|
|
5786
|
+
const topInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _515 => _515.getAttribute, 'call', _516 => _516("tIns")]), () => ( 45720))));
|
|
5787
|
+
const bottomInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _517 => _517.getAttribute, 'call', _518 => _518("bIns")]), () => ( 45720))));
|
|
5725
5788
|
return {
|
|
5726
|
-
horizontalAlign: _optionalChain([bodyProps, 'optionalAccess',
|
|
5789
|
+
horizontalAlign: _optionalChain([bodyProps, 'optionalAccess', _519 => _519.getAttribute, 'call', _520 => _520("anchorCtr")]) === "1" ? "center" : "left",
|
|
5727
5790
|
insetPx: {
|
|
5728
5791
|
bottom: bottomInset,
|
|
5729
5792
|
left: leftInset,
|
|
5730
5793
|
right: rightInset,
|
|
5731
5794
|
top: topInset
|
|
5732
5795
|
},
|
|
5733
|
-
verticalAlign: mapVerticalAnchor(_optionalChain([bodyProps, 'optionalAccess',
|
|
5796
|
+
verticalAlign: mapVerticalAnchor(_optionalChain([bodyProps, 'optionalAccess', _521 => _521.getAttribute, 'call', _522 => _522("anchor")]))
|
|
5734
5797
|
};
|
|
5735
5798
|
}
|
|
5736
5799
|
function getHyperlinkTarget(node, drawingRelationships) {
|
|
5737
5800
|
const hyperlinkNode = node ? getFirstDescendant(node, "hlinkClick") : null;
|
|
5738
5801
|
const hyperlinkTargetNode = _nullishCoalesce(hyperlinkNode, () => ( node));
|
|
5739
5802
|
const hyperlinkId = hyperlinkTargetNode ? getRelationshipId(hyperlinkTargetNode) : null;
|
|
5740
|
-
return hyperlinkId ? _nullishCoalesce(_optionalChain([drawingRelationships, 'access',
|
|
5803
|
+
return hyperlinkId ? _nullishCoalesce(_optionalChain([drawingRelationships, 'access', _523 => _523.get, 'call', _524 => _524(hyperlinkId), 'optionalAccess', _525 => _525.target]), () => ( void 0)) : void 0;
|
|
5741
5804
|
}
|
|
5742
5805
|
function parsePictureNode(pictureNode, fallbackAnchor, drawingRelationships, archive, contentTypes, objectUrls, workbookSheetIndex, imageId, zIndex, parentGroup) {
|
|
5743
5806
|
const blipNode = getFirstDescendant(pictureNode, "blip");
|
|
@@ -5759,12 +5822,12 @@ function parsePictureNode(pictureNode, fallbackAnchor, drawingRelationships, arc
|
|
|
5759
5822
|
return {
|
|
5760
5823
|
image: {
|
|
5761
5824
|
anchor: transform.anchor,
|
|
5762
|
-
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
5825
|
+
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _526 => _526.getAttribute, 'call', _527 => _527("descr")]), () => ( void 0)),
|
|
5763
5826
|
hyperlink: getHyperlinkTarget(_nullishCoalesce(nonVisualProps, () => ( pictureNode)), drawingRelationships),
|
|
5764
5827
|
id: imageId,
|
|
5765
5828
|
mediaPath: mediaRelationship.target,
|
|
5766
5829
|
mimeType: resolveContentType(contentTypes, mediaRelationship.target),
|
|
5767
|
-
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
5830
|
+
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _528 => _528.getAttribute, 'call', _529 => _529("name")]), () => ( void 0)),
|
|
5768
5831
|
sheetIndex: workbookSheetIndex,
|
|
5769
5832
|
src: createImageSource(mediaBytes, resolveContentType(contentTypes, mediaRelationship.target), objectUrls),
|
|
5770
5833
|
workbookSheetIndex,
|
|
@@ -5777,28 +5840,28 @@ function parseShapeNode(shapeNode, fallbackAnchor, drawingRelationships, theme,
|
|
|
5777
5840
|
const nonVisualProps = getFirstDescendant(shapeNode, "cNvPr");
|
|
5778
5841
|
const styleNode = getFirstChild(shapeNode, "style");
|
|
5779
5842
|
const transform = anchorFromNodeOrFallback(shapeNode, fallbackAnchor, parentGroup);
|
|
5780
|
-
const geometry = _nullishCoalesce(_optionalChain([getFirstDescendant, 'call',
|
|
5843
|
+
const geometry = _nullishCoalesce(_optionalChain([getFirstDescendant, 'call', _530 => _530(shapeNode, "prstGeom"), 'optionalAccess', _531 => _531.getAttribute, 'call', _532 => _532("prst")]), () => ( (getFirstDescendant(shapeNode, "custGeom") ? "custom" : "rect")));
|
|
5781
5844
|
const customPath = geometry === "custom" ? parseCustomGeometryPath(shapeNode) : void 0;
|
|
5782
5845
|
const geometryAdjustments = parseShapeGeometryAdjustments(shapeNode);
|
|
5783
5846
|
return {
|
|
5784
5847
|
anchor: transform.anchor,
|
|
5785
|
-
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
5848
|
+
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _533 => _533.getAttribute, 'call', _534 => _534("descr")]), () => ( void 0)),
|
|
5786
5849
|
fill: parseShapeFill(shapeNode, styleNode, theme, geometry),
|
|
5787
5850
|
flipH: transform.flipH,
|
|
5788
5851
|
flipV: transform.flipV,
|
|
5789
5852
|
geometry,
|
|
5790
5853
|
geometryAdjustments,
|
|
5791
|
-
hidden: _optionalChain([nonVisualProps, 'optionalAccess',
|
|
5854
|
+
hidden: _optionalChain([nonVisualProps, 'optionalAccess', _535 => _535.getAttribute, 'call', _536 => _536("hidden")]) === "1" || void 0,
|
|
5792
5855
|
hyperlink: getHyperlinkTarget(_nullishCoalesce(nonVisualProps, () => ( shapeNode)), drawingRelationships),
|
|
5793
5856
|
id: shapeId,
|
|
5794
|
-
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
5857
|
+
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _537 => _537.getAttribute, 'call', _538 => _538("name")]), () => ( void 0)),
|
|
5795
5858
|
paragraphs: parseShapeParagraphs(shapeNode, styleNode, theme),
|
|
5796
5859
|
rotationDeg: transform.rotationDeg,
|
|
5797
5860
|
scaleX: transform.scaleX,
|
|
5798
5861
|
scaleY: transform.scaleY,
|
|
5799
5862
|
sheetIndex: workbookSheetIndex,
|
|
5800
|
-
svgPath: _optionalChain([customPath, 'optionalAccess',
|
|
5801
|
-
svgViewBox: _optionalChain([customPath, 'optionalAccess',
|
|
5863
|
+
svgPath: _optionalChain([customPath, 'optionalAccess', _539 => _539.path]),
|
|
5864
|
+
svgViewBox: _optionalChain([customPath, 'optionalAccess', _540 => _540.viewBox]),
|
|
5802
5865
|
stroke: parseShapeStroke(shapeNode, styleNode, theme),
|
|
5803
5866
|
textBox: parseTextBox(shapeNode),
|
|
5804
5867
|
workbookSheetIndex,
|
|
@@ -6107,7 +6170,7 @@ function updateWorkbookImageAnchor(assets, imageId, anchor) {
|
|
|
6107
6170
|
if (!origin) {
|
|
6108
6171
|
return false;
|
|
6109
6172
|
}
|
|
6110
|
-
const attachments = _nullishCoalesce(_optionalChain([assets, 'access',
|
|
6173
|
+
const attachments = _nullishCoalesce(_optionalChain([assets, 'access', _541 => _541.sheetOrigins, 'access', _542 => _542[origin.workbookSheetIndex], 'optionalAccess', _543 => _543.attachments]), () => ( []));
|
|
6111
6174
|
for (const attachment of attachments) {
|
|
6112
6175
|
if (attachment.drawingPath !== origin.drawingPath) {
|
|
6113
6176
|
continue;
|
|
@@ -6217,7 +6280,7 @@ function mergeContentTypeForPath(targetDocument, originalDocument, partPath) {
|
|
|
6217
6280
|
return;
|
|
6218
6281
|
}
|
|
6219
6282
|
}
|
|
6220
|
-
const extension = _optionalChain([normalizedPartName, 'access',
|
|
6283
|
+
const extension = _optionalChain([normalizedPartName, 'access', _544 => _544.split, 'call', _545 => _545("."), 'access', _546 => _546.pop, 'call', _547 => _547(), 'optionalAccess', _548 => _548.toLowerCase, 'call', _549 => _549()]);
|
|
6221
6284
|
if (!extension) {
|
|
6222
6285
|
return;
|
|
6223
6286
|
}
|
|
@@ -6320,7 +6383,7 @@ function mergeWorkbookImageAssets(savedBytes, sourceAssets, sheetOrigins) {
|
|
|
6320
6383
|
}
|
|
6321
6384
|
};
|
|
6322
6385
|
sheetOrigins.forEach((origin, workbookSheetIndex) => {
|
|
6323
|
-
if (!_optionalChain([origin, 'optionalAccess',
|
|
6386
|
+
if (!_optionalChain([origin, 'optionalAccess', _550 => _550.attachments, 'access', _551 => _551.length])) {
|
|
6324
6387
|
return;
|
|
6325
6388
|
}
|
|
6326
6389
|
const currentSheet = workbookSheets[workbookSheetIndex];
|
|
@@ -6349,7 +6412,7 @@ function mergeWorkbookImageAssets(savedBytes, sourceAssets, sheetOrigins) {
|
|
|
6349
6412
|
relationshipNode.setAttribute("Id", relationshipId);
|
|
6350
6413
|
relationshipNode.setAttribute("Type", DRAWING_REL_TYPE);
|
|
6351
6414
|
relationshipNode.setAttribute("Target", relativeArchivePath(currentSheet.path, attachment.drawingPath));
|
|
6352
|
-
_optionalChain([relDocument, 'access',
|
|
6415
|
+
_optionalChain([relDocument, 'access', _552 => _552.documentElement, 'optionalAccess', _553 => _553.appendChild, 'call', _554 => _554(relationshipNode)]);
|
|
6353
6416
|
appendSheetDrawingReference(sheetDocument, relationshipId);
|
|
6354
6417
|
});
|
|
6355
6418
|
archive[currentSheet.path] = _fflate.strToU8.call(void 0, serializeXml2(sheetDocument));
|
|
@@ -6520,7 +6583,7 @@ function collectReferencedSheetNames(workbook) {
|
|
|
6520
6583
|
continue;
|
|
6521
6584
|
}
|
|
6522
6585
|
for (const cell of cells) {
|
|
6523
|
-
const formula = _optionalChain([cell, 'optionalAccess',
|
|
6586
|
+
const formula = _optionalChain([cell, 'optionalAccess', _555 => _555.formula]);
|
|
6524
6587
|
if (!formula) {
|
|
6525
6588
|
continue;
|
|
6526
6589
|
}
|
|
@@ -6567,7 +6630,7 @@ function collectFormulaCellsWithSavedValues(workbook) {
|
|
|
6567
6630
|
continue;
|
|
6568
6631
|
}
|
|
6569
6632
|
for (const cell of cells) {
|
|
6570
|
-
if (typeof _optionalChain([cell, 'optionalAccess',
|
|
6633
|
+
if (typeof _optionalChain([cell, 'optionalAccess', _556 => _556.row]) !== "number" || typeof _optionalChain([cell, 'optionalAccess', _557 => _557.col]) !== "number") {
|
|
6571
6634
|
continue;
|
|
6572
6635
|
}
|
|
6573
6636
|
let saved;
|
|
@@ -6777,7 +6840,7 @@ var XlsxWorkerClient = (_class = class {
|
|
|
6777
6840
|
__init5() {this.startupTimer = null}
|
|
6778
6841
|
constructor() {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
|
|
6779
6842
|
try {
|
|
6780
|
-
this.worker = new Worker(new URL("./xlsx-worker.js",
|
|
6843
|
+
this.worker = new Worker(new URL("./xlsx-worker.js", _chunkAD4CGQN2cjs.importMetaUrl), { type: "module" });
|
|
6781
6844
|
} catch (e12) {
|
|
6782
6845
|
throw new XlsxWorkerUnavailableError("The workbook worker could not be started.");
|
|
6783
6846
|
}
|
|
@@ -6821,10 +6884,10 @@ var XlsxWorkerClient = (_class = class {
|
|
|
6821
6884
|
type: "load"
|
|
6822
6885
|
}, [workerBuffer]);
|
|
6823
6886
|
}
|
|
6824
|
-
getCellSnapshot(workbookSheetIndex, row, col) {
|
|
6887
|
+
getCellSnapshot(workbookSheetIndex, row, col, locale) {
|
|
6825
6888
|
return this.request({
|
|
6826
6889
|
id: 0,
|
|
6827
|
-
payload: { col, row, workbookSheetIndex },
|
|
6890
|
+
payload: { col, row, workbookSheetIndex, locale },
|
|
6828
6891
|
type: "getCellSnapshot"
|
|
6829
6892
|
});
|
|
6830
6893
|
}
|
|
@@ -6841,10 +6904,10 @@ var XlsxWorkerClient = (_class = class {
|
|
|
6841
6904
|
type: "parseCharts"
|
|
6842
6905
|
}, [workerBuffer]);
|
|
6843
6906
|
}
|
|
6844
|
-
getRowsBatch(workbookSheetIndex, startRow, rowCount) {
|
|
6907
|
+
getRowsBatch(workbookSheetIndex, startRow, rowCount, locale) {
|
|
6845
6908
|
return this.request({
|
|
6846
6909
|
id: 0,
|
|
6847
|
-
payload: { rowCount, startRow, workbookSheetIndex },
|
|
6910
|
+
payload: { rowCount, startRow, workbookSheetIndex, locale },
|
|
6848
6911
|
type: "getRowsBatch"
|
|
6849
6912
|
});
|
|
6850
6913
|
}
|
|
@@ -7132,14 +7195,14 @@ function clampZoomScale(zoomScale) {
|
|
|
7132
7195
|
return Math.min(MAX_ZOOM_SCALE, Math.max(MIN_ZOOM_SCALE, Math.round(zoomScale)));
|
|
7133
7196
|
}
|
|
7134
7197
|
function resolveDefaultZoomScale(activeTab, activeSheet) {
|
|
7135
|
-
if (_optionalChain([activeTab, 'optionalAccess',
|
|
7198
|
+
if (_optionalChain([activeTab, 'optionalAccess', _558 => _558.kind]) !== "sheet") {
|
|
7136
7199
|
return DEFAULT_ZOOM_SCALE;
|
|
7137
7200
|
}
|
|
7138
|
-
return clampZoomScale(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
7201
|
+
return clampZoomScale(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _559 => _559.zoomScale]), () => ( DEFAULT_ZOOM_SCALE)));
|
|
7139
7202
|
}
|
|
7140
7203
|
function resolveWorksheetZoomScale(worksheet, sheetState) {
|
|
7141
7204
|
const candidates = [
|
|
7142
|
-
typeof _optionalChain([sheetState, 'optionalAccess',
|
|
7205
|
+
typeof _optionalChain([sheetState, 'optionalAccess', _560 => _560.zoomScale]) === "number" ? sheetState.zoomScale : void 0,
|
|
7143
7206
|
typeof worksheet.zoomScale === "number" ? worksheet.zoomScale : void 0
|
|
7144
7207
|
];
|
|
7145
7208
|
const value = candidates.find((entry) => typeof entry === "number" && Number.isFinite(entry) && entry > 0);
|
|
@@ -7258,18 +7321,18 @@ function resolveDisplayFileName(src, fileName) {
|
|
|
7258
7321
|
}
|
|
7259
7322
|
function resolveSheetDisplayUsedRange(usedRange, sheetState) {
|
|
7260
7323
|
const [minRow, minCol, maxRow, maxCol] = usedRange;
|
|
7261
|
-
const maxContentRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7262
|
-
const maxContentCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7263
|
-
const maxVerticalMergeEndRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7264
|
-
const maxHorizontalMergeEndCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7324
|
+
const maxContentRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _561 => _561.maxContentRow]), () => ( -1));
|
|
7325
|
+
const maxContentCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _562 => _562.maxContentCol]), () => ( -1));
|
|
7326
|
+
const maxVerticalMergeEndRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _563 => _563.maxVerticalMergeEndRow]), () => ( -1));
|
|
7327
|
+
const maxHorizontalMergeEndCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _564 => _564.maxHorizontalMergeEndCol]), () => ( -1));
|
|
7265
7328
|
const maxMeaningfulRow = Math.max(maxContentRow, maxVerticalMergeEndRow);
|
|
7266
7329
|
const maxMeaningfulCol = Math.max(maxContentCol, maxHorizontalMergeEndCol);
|
|
7267
7330
|
if (maxMeaningfulRow < 0 && maxMeaningfulCol < 0) {
|
|
7268
7331
|
return usedRange;
|
|
7269
7332
|
}
|
|
7270
7333
|
return [
|
|
7271
|
-
_optionalChain([sheetState, 'optionalAccess',
|
|
7272
|
-
_optionalChain([sheetState, 'optionalAccess',
|
|
7334
|
+
_optionalChain([sheetState, 'optionalAccess', _565 => _565.minContentRow]) !== void 0 && sheetState.minContentRow >= 0 ? Math.min(minRow, sheetState.minContentRow) : minRow,
|
|
7335
|
+
_optionalChain([sheetState, 'optionalAccess', _566 => _566.minContentCol]) !== void 0 && sheetState.minContentCol >= 0 ? Math.min(minCol, sheetState.minContentCol) : minCol,
|
|
7273
7336
|
maxMeaningfulRow >= 0 ? maxContentRow >= 0 ? Math.min(maxRow, maxMeaningfulRow) : Math.max(maxRow, maxMeaningfulRow) : maxRow,
|
|
7274
7337
|
maxMeaningfulCol >= 0 ? maxContentCol >= 0 ? Math.min(maxCol, maxMeaningfulCol) : Math.max(maxCol, maxMeaningfulCol) : maxCol
|
|
7275
7338
|
];
|
|
@@ -7278,18 +7341,18 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7278
7341
|
const sheets = [];
|
|
7279
7342
|
for (let index = 0; index < workbook.sheetCount; index += 1) {
|
|
7280
7343
|
const worksheet = workbook.getSheet(index);
|
|
7281
|
-
const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess',
|
|
7344
|
+
const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess', _567 => _567[index]]), () => ( null));
|
|
7282
7345
|
const mergeMetadata = resolveWorksheetMergeMetadata(worksheet);
|
|
7283
7346
|
const effectiveSheetState = {
|
|
7284
7347
|
...sheetState,
|
|
7285
7348
|
...mergeMetadata
|
|
7286
7349
|
};
|
|
7287
|
-
const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7350
|
+
const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _568 => _568.defaultColWidthPx]), () => ( resolveWorksheetDefaultColumnWidthPixels(
|
|
7288
7351
|
worksheet,
|
|
7289
|
-
_optionalChain([sheetState, 'optionalAccess',
|
|
7352
|
+
_optionalChain([sheetState, 'optionalAccess', _569 => _569.columnWidthCharacterWidthPx]),
|
|
7290
7353
|
DEFAULT_COL_WIDTH
|
|
7291
7354
|
)));
|
|
7292
|
-
const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7355
|
+
const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _570 => _570.defaultRowHeightPx]), () => ( resolveWorksheetDefaultRowHeightPixels(
|
|
7293
7356
|
worksheet,
|
|
7294
7357
|
DEFAULT_ROW_HEIGHT
|
|
7295
7358
|
)));
|
|
@@ -7300,26 +7363,26 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7300
7363
|
const resolveColumnWidthPx = (col) => {
|
|
7301
7364
|
const width = worksheet.getColumnWidth(col);
|
|
7302
7365
|
if (width !== void 0 && width !== null) {
|
|
7303
|
-
return resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess',
|
|
7366
|
+
return resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _571 => _571.columnWidthCharacterWidthPx]));
|
|
7304
7367
|
}
|
|
7305
|
-
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7368
|
+
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _572 => _572.colWidthOverridesPx, 'optionalAccess', _573 => _573[col]]), () => ( defaultColWidthPx));
|
|
7306
7369
|
};
|
|
7307
7370
|
const resolveRowHeightPx = (row) => {
|
|
7308
7371
|
const height = worksheet.getRowHeight(row);
|
|
7309
7372
|
if (height !== void 0 && height !== null) {
|
|
7310
7373
|
return Math.max(Math.round(height * 1.33), MIN_ROW_HEIGHT_PX2);
|
|
7311
7374
|
}
|
|
7312
|
-
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7375
|
+
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _574 => _574.rowHeightOverridesPx, 'optionalAccess', _575 => _575[row]]), () => ( defaultRowHeightPx));
|
|
7313
7376
|
};
|
|
7314
7377
|
const usedRange = worksheet.usedRange();
|
|
7315
7378
|
if (!usedRange) {
|
|
7316
7379
|
sheets.push({
|
|
7317
|
-
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7318
|
-
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7319
|
-
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess',
|
|
7320
|
-
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7321
|
-
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7322
|
-
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7380
|
+
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _576 => _576.autoFilterRanges]), () => ( [])),
|
|
7381
|
+
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _577 => _577.cachedFormulaValues]), () => ( {})),
|
|
7382
|
+
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _578 => _578.columnWidthCharacterWidthPx]),
|
|
7383
|
+
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _579 => _579.colWidthOverridesPx]), () => ( {})),
|
|
7384
|
+
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _580 => _580.colStyleIds]), () => ( {})),
|
|
7385
|
+
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _581 => _581.conditionalFormatRules]), () => ( [])),
|
|
7323
7386
|
dataValidations: parseWorksheetDataValidations(worksheet),
|
|
7324
7387
|
defaultColWidthPx,
|
|
7325
7388
|
defaultRowHeightPx,
|
|
@@ -7340,17 +7403,17 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7340
7403
|
namedCellStyleByName: _nullishCoalesce(namedCellStyleByName, () => ( {})),
|
|
7341
7404
|
rowCount: 0,
|
|
7342
7405
|
colCount: 0,
|
|
7343
|
-
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7344
|
-
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7345
|
-
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7406
|
+
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _582 => _582.rowHeightOverridesPx]), () => ( {})),
|
|
7407
|
+
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _583 => _583.rowStyleIds]), () => ( {})),
|
|
7408
|
+
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _584 => _584.cellStyleIds]), () => ( {})),
|
|
7346
7409
|
styleById: _nullishCoalesce(styleById, () => ( {})),
|
|
7347
|
-
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7410
|
+
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _585 => _585.sparklines]), () => ( [])),
|
|
7348
7411
|
tableStyleByName: _nullishCoalesce(tableStyleByName, () => ( {})),
|
|
7349
7412
|
visibleRows: [],
|
|
7350
7413
|
visibleCols: [],
|
|
7351
7414
|
colWidths: [],
|
|
7352
7415
|
rowHeights: [],
|
|
7353
|
-
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7416
|
+
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _586 => _586.showGridLines]), () => ( true)),
|
|
7354
7417
|
themePalette: _nullishCoalesce(themePalette, () => ( { colorsByIndex: {} })),
|
|
7355
7418
|
workbookSheetIndex: index,
|
|
7356
7419
|
zoomScale: resolveWorksheetZoomScale(worksheet, sheetState)
|
|
@@ -7403,12 +7466,12 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7403
7466
|
return colWidthsCache;
|
|
7404
7467
|
};
|
|
7405
7468
|
const sheet = {
|
|
7406
|
-
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7407
|
-
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7408
|
-
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess',
|
|
7409
|
-
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7410
|
-
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7411
|
-
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7469
|
+
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _587 => _587.autoFilterRanges]), () => ( [])),
|
|
7470
|
+
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _588 => _588.cachedFormulaValues]), () => ( {})),
|
|
7471
|
+
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _589 => _589.columnWidthCharacterWidthPx]),
|
|
7472
|
+
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _590 => _590.colWidthOverridesPx]), () => ( {})),
|
|
7473
|
+
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _591 => _591.colStyleIds]), () => ( {})),
|
|
7474
|
+
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _592 => _592.conditionalFormatRules]), () => ( [])),
|
|
7412
7475
|
dataValidations: parseWorksheetDataValidations(worksheet),
|
|
7413
7476
|
defaultColWidthPx,
|
|
7414
7477
|
defaultRowHeightPx,
|
|
@@ -7427,12 +7490,12 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7427
7490
|
name: worksheet.name,
|
|
7428
7491
|
visibility,
|
|
7429
7492
|
namedCellStyleByName: _nullishCoalesce(namedCellStyleByName, () => ( {})),
|
|
7430
|
-
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7431
|
-
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7432
|
-
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7433
|
-
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7493
|
+
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _593 => _593.rowHeightOverridesPx]), () => ( {})),
|
|
7494
|
+
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _594 => _594.rowStyleIds]), () => ( {})),
|
|
7495
|
+
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _595 => _595.cellStyleIds]), () => ( {})),
|
|
7496
|
+
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _596 => _596.showGridLines]), () => ( true)),
|
|
7434
7497
|
styleById: _nullishCoalesce(styleById, () => ( {})),
|
|
7435
|
-
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7498
|
+
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _597 => _597.sparklines]), () => ( [])),
|
|
7436
7499
|
tableStyleByName: _nullishCoalesce(tableStyleByName, () => ( {})),
|
|
7437
7500
|
themePalette: _nullishCoalesce(themePalette, () => ( { colorsByIndex: {} })),
|
|
7438
7501
|
workbookSheetIndex: index,
|
|
@@ -7553,15 +7616,15 @@ function resolveWorkbookReference(workbook, defaultWorkbookSheetIndex, rawRefere
|
|
|
7553
7616
|
}
|
|
7554
7617
|
}
|
|
7555
7618
|
function parseColorHex(hex) {
|
|
7556
|
-
const normalized = _optionalChain([hex, 'optionalAccess',
|
|
7619
|
+
const normalized = _optionalChain([hex, 'optionalAccess', _598 => _598.replace, 'call', _599 => _599(/^#/, "")]);
|
|
7557
7620
|
return normalized && /^[0-9a-f]{6}$/i.test(normalized) ? [0, 2, 4].map((offset) => Number.parseInt(normalized.slice(offset, offset + 2), 16)) : null;
|
|
7558
7621
|
}
|
|
7559
7622
|
function xlsxColorToDukeColor(color) {
|
|
7560
7623
|
if (!color) {
|
|
7561
7624
|
return void 0;
|
|
7562
7625
|
}
|
|
7563
|
-
const normalizedHex = _optionalChain([color, 'access',
|
|
7564
|
-
const colorType = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(color.colorType, () => ( (_optionalChain([normalizedHex, 'optionalAccess',
|
|
7626
|
+
const normalizedHex = _optionalChain([color, 'access', _600 => _600.hex, 'optionalAccess', _601 => _601.replace, 'call', _602 => _602(/^#/, "")]);
|
|
7627
|
+
const colorType = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(color.colorType, () => ( (_optionalChain([normalizedHex, 'optionalAccess', _603 => _603.length]) === 8 ? "argb" : _optionalChain([normalizedHex, 'optionalAccess', _604 => _604.length]) === 6 ? "rgb" : void 0))), () => ( (color.r !== void 0 && color.g !== void 0 && color.b !== void 0 ? color.a !== void 0 ? "argb" : "rgb" : void 0))), () => ( (color.themeIndex !== void 0 ? "theme" : color.paletteIndex !== void 0 ? "indexed" : void 0)));
|
|
7565
7628
|
switch (colorType) {
|
|
7566
7629
|
case "auto":
|
|
7567
7630
|
return { colorType: "auto" };
|
|
@@ -7570,7 +7633,7 @@ function xlsxColorToDukeColor(color) {
|
|
|
7570
7633
|
return channels ? { b: channels[2], colorType: "rgb", g: channels[1], r: channels[0] } : void 0;
|
|
7571
7634
|
}
|
|
7572
7635
|
case "argb": {
|
|
7573
|
-
const normalized = _optionalChain([color, 'access',
|
|
7636
|
+
const normalized = _optionalChain([color, 'access', _605 => _605.hex, 'optionalAccess', _606 => _606.replace, 'call', _607 => _607(/^#/, "")]);
|
|
7574
7637
|
const channels = normalized && /^[0-9a-f]{8}$/i.test(normalized) ? [0, 2, 4, 6].map((offset) => Number.parseInt(normalized.slice(offset, offset + 2), 16)) : color.a !== void 0 && color.r !== void 0 && color.g !== void 0 && color.b !== void 0 ? [color.a, color.r, color.g, color.b] : null;
|
|
7575
7638
|
return channels ? { a: channels[0], b: channels[3], colorType: "argb", g: channels[2], r: channels[1] } : void 0;
|
|
7576
7639
|
}
|
|
@@ -7693,7 +7756,7 @@ function reconcileCheckedOptionButtons(worksheet) {
|
|
|
7693
7756
|
const checkedPaths = worksheet.formControls.flatMap((control) => control.formControl.kind.kind === "optionButton" && control.formControl.kind.state === "checked" ? [control.drawingPath] : []);
|
|
7694
7757
|
for (const path of checkedPaths) {
|
|
7695
7758
|
const current = worksheet.formControls.find((control) => control.drawingPath.length === path.length && control.drawingPath.every((segment, index) => segment === path[index]));
|
|
7696
|
-
if (_optionalChain([current, 'optionalAccess',
|
|
7759
|
+
if (_optionalChain([current, 'optionalAccess', _608 => _608.formControl, 'access', _609 => _609.kind, 'access', _610 => _610.kind]) === "optionButton" && current.formControl.kind.state === "checked") {
|
|
7697
7760
|
worksheet.setFormControlCheckState(current.drawingPath, "checked");
|
|
7698
7761
|
}
|
|
7699
7762
|
}
|
|
@@ -7722,8 +7785,8 @@ function formControlInteractionChanged(current, next) {
|
|
|
7722
7785
|
}
|
|
7723
7786
|
function parseWorksheetFreezePanes(worksheet) {
|
|
7724
7787
|
const rawFreezePanes = worksheet.freezePanes;
|
|
7725
|
-
const row = typeof _optionalChain([rawFreezePanes, 'optionalAccess',
|
|
7726
|
-
const col = typeof _optionalChain([rawFreezePanes, 'optionalAccess',
|
|
7788
|
+
const row = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _611 => _611.row]) === "number" && rawFreezePanes.row >= 0 ? rawFreezePanes.row : null;
|
|
7789
|
+
const col = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _612 => _612.col]) === "number" && rawFreezePanes.col >= 0 ? rawFreezePanes.col : null;
|
|
7727
7790
|
if (row === null && col === null) {
|
|
7728
7791
|
return null;
|
|
7729
7792
|
}
|
|
@@ -7790,7 +7853,7 @@ function rangesIntersect(a, b) {
|
|
|
7790
7853
|
return a.start.row <= b.end.row && a.end.row >= b.start.row && a.start.col <= b.end.col && a.end.col >= b.start.col;
|
|
7791
7854
|
}
|
|
7792
7855
|
function mapWorksheetTables(worksheet, autoFilterRanges = []) {
|
|
7793
|
-
const rawTables = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess',
|
|
7856
|
+
const rawTables = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _613 => _613.tables]), () => ( []));
|
|
7794
7857
|
const mappedTables = rawTables.flatMap((table, index) => {
|
|
7795
7858
|
const rawColumns = Array.isArray(table.columns) ? table.columns : [];
|
|
7796
7859
|
const rawName = typeof table.name === "string" ? table.name : `Table${index + 1}`;
|
|
@@ -7887,7 +7950,7 @@ function pxToSheetRowHeight(heightPx) {
|
|
|
7887
7950
|
return Math.max(heightPx, MIN_ROW_HEIGHT_PX2) / 1.33;
|
|
7888
7951
|
}
|
|
7889
7952
|
function cssColor(color) {
|
|
7890
|
-
if (!_optionalChain([color, 'optionalAccess',
|
|
7953
|
+
if (!_optionalChain([color, 'optionalAccess', _614 => _614.hex])) {
|
|
7891
7954
|
return null;
|
|
7892
7955
|
}
|
|
7893
7956
|
const hex = String(color.hex);
|
|
@@ -7968,7 +8031,7 @@ function cloneCellStyle(style) {
|
|
|
7968
8031
|
return style;
|
|
7969
8032
|
}
|
|
7970
8033
|
}
|
|
7971
|
-
function coerceUserEnteredValue(value) {
|
|
8034
|
+
function coerceUserEnteredValue(value, locale = "en-US") {
|
|
7972
8035
|
const trimmed = value.trim();
|
|
7973
8036
|
if (!trimmed) {
|
|
7974
8037
|
return "";
|
|
@@ -7979,6 +8042,8 @@ function coerceUserEnteredValue(value) {
|
|
|
7979
8042
|
if (/^(true|false)$/i.test(trimmed)) {
|
|
7980
8043
|
return trimmed.toLowerCase() === "true";
|
|
7981
8044
|
}
|
|
8045
|
+
const localizedNumber = parseLocaleNumber(trimmed, locale);
|
|
8046
|
+
if (localizedNumber !== void 0) return localizedNumber;
|
|
7982
8047
|
if (/^[+-]?(?:\d+\.?\d*|\.\d+)$/.test(trimmed)) {
|
|
7983
8048
|
const parsed = Number(trimmed);
|
|
7984
8049
|
if (Number.isFinite(parsed)) {
|
|
@@ -8021,7 +8086,7 @@ function isAbortError(error) {
|
|
|
8021
8086
|
}
|
|
8022
8087
|
async function resolveWorkbookBuffer({ file, src }, signal) {
|
|
8023
8088
|
let buffer;
|
|
8024
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
8089
|
+
if (_optionalChain([signal, 'optionalAccess', _615 => _615.aborted])) {
|
|
8025
8090
|
throw createAbortError2();
|
|
8026
8091
|
}
|
|
8027
8092
|
if (file) {
|
|
@@ -8077,7 +8142,7 @@ function scheduleLowPriorityTask(task) {
|
|
|
8077
8142
|
task();
|
|
8078
8143
|
}, { timeout: 120 });
|
|
8079
8144
|
return () => {
|
|
8080
|
-
_optionalChain([idleWindow, 'access',
|
|
8145
|
+
_optionalChain([idleWindow, 'access', _616 => _616.cancelIdleCallback, 'optionalCall', _617 => _617(idleHandle)]);
|
|
8081
8146
|
};
|
|
8082
8147
|
}
|
|
8083
8148
|
const timeoutHandle = window.setTimeout(task, 0);
|
|
@@ -8090,7 +8155,7 @@ function inferImageMimeType(source) {
|
|
|
8090
8155
|
return source.slice(5, separatorIndex);
|
|
8091
8156
|
}
|
|
8092
8157
|
}
|
|
8093
|
-
const normalized = _nullishCoalesce(_optionalChain([source, 'access',
|
|
8158
|
+
const normalized = _nullishCoalesce(_optionalChain([source, 'access', _618 => _618.split, 'call', _619 => _619("?"), 'access', _620 => _620[0], 'optionalAccess', _621 => _621.toLowerCase, 'call', _622 => _622()]), () => ( ""));
|
|
8094
8159
|
if (normalized.endsWith(".gif")) {
|
|
8095
8160
|
return "image/gif";
|
|
8096
8161
|
}
|
|
@@ -8243,7 +8308,7 @@ function mergeParsedAndApiImages(parsedImages, apiImages, hiddenAnchorKeys) {
|
|
|
8243
8308
|
if (apiImages.length === 0) {
|
|
8244
8309
|
return visibleParsedImages;
|
|
8245
8310
|
}
|
|
8246
|
-
const normalizeTextKey = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
8311
|
+
const normalizeTextKey = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _623 => _623.trim, 'call', _624 => _624(), 'access', _625 => _625.toLowerCase, 'call', _626 => _626()]), () => ( ""));
|
|
8247
8312
|
const imageKeys = (image) => {
|
|
8248
8313
|
const keys = [
|
|
8249
8314
|
`${normalizeTextKey(image.mediaPath)}|${normalizeTextKey(image.name)}|${imageAnchorKey(image.anchor)}`,
|
|
@@ -8398,6 +8463,7 @@ function useXlsxViewerController(options) {
|
|
|
8398
8463
|
deferLoadingAboveBytes = DEFAULT_DEFER_LOADING_ABOVE_BYTES,
|
|
8399
8464
|
file,
|
|
8400
8465
|
fileName,
|
|
8466
|
+
locale = "en-US",
|
|
8401
8467
|
maxFileSizeBytes = DEFAULT_MAX_FILE_SIZE_BYTES,
|
|
8402
8468
|
readOnly: requestedReadOnly = false,
|
|
8403
8469
|
readOnlyAboveBytes = 0,
|
|
@@ -8456,7 +8522,7 @@ function useXlsxViewerController(options) {
|
|
|
8456
8522
|
const shouldForceReadOnlyForBuffer = React.useCallback((bufferByteLength) => !requestedReadOnly && readOnlyAboveBytes > 0 && bufferByteLength > readOnlyAboveBytes, [readOnlyAboveBytes, requestedReadOnly]);
|
|
8457
8523
|
const shouldUseWorkerForReadOnlyLoad = React.useCallback((willForceReadOnly) => workerSupported && (willForceReadOnly || canUseWorkerForRequestedReadOnly), [canUseWorkerForRequestedReadOnly, workerSupported]);
|
|
8458
8524
|
const disposeWorkerClient = React.useCallback(() => {
|
|
8459
|
-
_optionalChain([workerClientRef, 'access',
|
|
8525
|
+
_optionalChain([workerClientRef, 'access', _627 => _627.current, 'optionalAccess', _628 => _628.dispose, 'call', _629 => _629()]);
|
|
8460
8526
|
workerClientRef.current = null;
|
|
8461
8527
|
}, []);
|
|
8462
8528
|
const getWorkerClient = React.useCallback(() => {
|
|
@@ -8475,7 +8541,7 @@ function useXlsxViewerController(options) {
|
|
|
8475
8541
|
}, []);
|
|
8476
8542
|
const clearChartAssets = React.useCallback(() => {
|
|
8477
8543
|
chartLoadRequestTokenRef.current += 1;
|
|
8478
|
-
_optionalChain([chartDisplayFallbackCleanupRef, 'access',
|
|
8544
|
+
_optionalChain([chartDisplayFallbackCleanupRef, 'access', _630 => _630.current, 'optionalCall', _631 => _631()]);
|
|
8479
8545
|
chartDisplayFallbackCleanupRef.current = null;
|
|
8480
8546
|
chartAssetsRef.current = null;
|
|
8481
8547
|
setChartsByWorkbookSheetIndex([]);
|
|
@@ -8486,16 +8552,16 @@ function useXlsxViewerController(options) {
|
|
|
8486
8552
|
const setImageAssets = React.useCallback((assets) => {
|
|
8487
8553
|
revokeWorkbookImageAssets(imageAssetsRef.current);
|
|
8488
8554
|
imageAssetsRef.current = assets;
|
|
8489
|
-
sheetOriginsRef.current = _nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8490
|
-
setFormControlsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8491
|
-
setImagesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8492
|
-
setShapesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8555
|
+
sheetOriginsRef.current = _nullishCoalesce(_optionalChain([assets, 'optionalAccess', _632 => _632.sheetOrigins, 'access', _633 => _633.slice, 'call', _634 => _634()]), () => ( []));
|
|
8556
|
+
setFormControlsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _635 => _635.formControlsByWorkbookSheetIndex]), () => ( [])));
|
|
8557
|
+
setImagesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _636 => _636.imagesByWorkbookSheetIndex]), () => ( [])));
|
|
8558
|
+
setShapesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _637 => _637.shapesByWorkbookSheetIndex]), () => ( [])));
|
|
8493
8559
|
}, []);
|
|
8494
8560
|
const setChartAssets = React.useCallback((assets) => {
|
|
8495
8561
|
chartAssetsRef.current = assets;
|
|
8496
|
-
setChartsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8497
|
-
setChartsheets(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8498
|
-
setTabs(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8562
|
+
setChartsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _638 => _638.chartsByWorkbookSheetIndex]), () => ( [])));
|
|
8563
|
+
setChartsheets(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _639 => _639.chartsheets]), () => ( [])));
|
|
8564
|
+
setTabs(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _640 => _640.tabs]), () => ( [])));
|
|
8499
8565
|
setIsChartsLoading(false);
|
|
8500
8566
|
}, []);
|
|
8501
8567
|
const shouldFallbackFromWorkerError = React.useCallback((error2) => {
|
|
@@ -8557,7 +8623,7 @@ function useXlsxViewerController(options) {
|
|
|
8557
8623
|
setIsChartsLoading(true);
|
|
8558
8624
|
const requestToken = chartLoadRequestTokenRef.current + 1;
|
|
8559
8625
|
chartLoadRequestTokenRef.current = requestToken;
|
|
8560
|
-
_optionalChain([chartDisplayFallbackCleanupRef, 'access',
|
|
8626
|
+
_optionalChain([chartDisplayFallbackCleanupRef, 'access', _641 => _641.current, 'optionalCall', _642 => _642()]);
|
|
8561
8627
|
chartDisplayFallbackCleanupRef.current = null;
|
|
8562
8628
|
let fallbackTriggered = false;
|
|
8563
8629
|
const triggerFallback = () => {
|
|
@@ -8656,11 +8722,11 @@ function useXlsxViewerController(options) {
|
|
|
8656
8722
|
};
|
|
8657
8723
|
}, [skipXmlParsing]);
|
|
8658
8724
|
const refreshWorkbookState = React.useCallback((targetWorkbook) => {
|
|
8659
|
-
const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access',
|
|
8725
|
+
const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _643 => _643.current, 'optionalAccess', _644 => _644.formControlsByWorkbookSheetIndex]), () => ( []));
|
|
8660
8726
|
const nextFormControls = refreshWorkbookFormControls(
|
|
8661
8727
|
targetWorkbook,
|
|
8662
8728
|
currentFormControls,
|
|
8663
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8729
|
+
_optionalChain([imageAssetsRef, 'access', _645 => _645.current, 'optionalAccess', _646 => _646.themePalette])
|
|
8664
8730
|
);
|
|
8665
8731
|
if (imageAssetsRef.current) {
|
|
8666
8732
|
imageAssetsRef.current.formControlsByWorkbookSheetIndex = nextFormControls;
|
|
@@ -8668,11 +8734,11 @@ function useXlsxViewerController(options) {
|
|
|
8668
8734
|
setFormControlsByWorkbookSheetIndex(nextFormControls);
|
|
8669
8735
|
const nextSheets = buildSheetList(
|
|
8670
8736
|
targetWorkbook,
|
|
8671
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8672
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8673
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8674
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8675
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8737
|
+
_optionalChain([imageAssetsRef, 'access', _647 => _647.current, 'optionalAccess', _648 => _648.sheetStatesByWorkbookSheetIndex]),
|
|
8738
|
+
_optionalChain([imageAssetsRef, 'access', _649 => _649.current, 'optionalAccess', _650 => _650.themePalette]),
|
|
8739
|
+
_optionalChain([imageAssetsRef, 'access', _651 => _651.current, 'optionalAccess', _652 => _652.styleById]),
|
|
8740
|
+
_optionalChain([imageAssetsRef, 'access', _653 => _653.current, 'optionalAccess', _654 => _654.namedCellStyleByName]),
|
|
8741
|
+
_optionalChain([imageAssetsRef, 'access', _655 => _655.current, 'optionalAccess', _656 => _656.tableStyleByName]),
|
|
8676
8742
|
showHiddenSheets
|
|
8677
8743
|
);
|
|
8678
8744
|
setSheets(nextSheets);
|
|
@@ -8687,7 +8753,7 @@ function useXlsxViewerController(options) {
|
|
|
8687
8753
|
setRevision((current) => current + 1);
|
|
8688
8754
|
}, [setChartAssets, showHiddenSheets]);
|
|
8689
8755
|
React.useEffect(() => () => {
|
|
8690
|
-
_optionalChain([chartDisplayFallbackCleanupRef, 'access',
|
|
8756
|
+
_optionalChain([chartDisplayFallbackCleanupRef, 'access', _657 => _657.current, 'optionalCall', _658 => _658()]);
|
|
8691
8757
|
chartDisplayFallbackCleanupRef.current = null;
|
|
8692
8758
|
revokeWorkbookImageAssets(imageAssetsRef.current);
|
|
8693
8759
|
disposeWorkerClient();
|
|
@@ -8768,7 +8834,7 @@ function useXlsxViewerController(options) {
|
|
|
8768
8834
|
}
|
|
8769
8835
|
buffer = normalizeWorkbookArrayBuffer(buffer);
|
|
8770
8836
|
const preflight = preflightWorkbookBuffer(buffer);
|
|
8771
|
-
if (_optionalChain([preflight, 'optionalAccess',
|
|
8837
|
+
if (_optionalChain([preflight, 'optionalAccess', _659 => _659.tooLarge])) {
|
|
8772
8838
|
throw createWorkbookTooLargeError(preflight);
|
|
8773
8839
|
}
|
|
8774
8840
|
const shouldForceReadOnly = shouldForceReadOnlyForBuffer(buffer.byteLength);
|
|
@@ -8888,10 +8954,10 @@ function useXlsxViewerController(options) {
|
|
|
8888
8954
|
showHiddenSheets
|
|
8889
8955
|
]);
|
|
8890
8956
|
const activeTab = _nullishCoalesce(tabs[activeTabIndex], () => ( null));
|
|
8891
|
-
const activeSheet = _optionalChain([activeTab, 'optionalAccess',
|
|
8957
|
+
const activeSheet = _optionalChain([activeTab, 'optionalAccess', _660 => _660.kind]) === "sheet" ? _nullishCoalesce(sheets[_nullishCoalesce(activeTab.sheetIndex, () => ( -1))], () => ( null)) : null;
|
|
8892
8958
|
const deferredMetadataCell = React.useDeferredValue(activeCell);
|
|
8893
8959
|
const deferredMetadataSheet = React.useDeferredValue(activeSheet);
|
|
8894
|
-
const activeZoomTabKey = _nullishCoalesce(_optionalChain([activeTab, 'optionalAccess',
|
|
8960
|
+
const activeZoomTabKey = _nullishCoalesce(_optionalChain([activeTab, 'optionalAccess', _661 => _661.id]), () => ( DEFAULT_ZOOM_TAB_KEY));
|
|
8895
8961
|
const defaultZoomScale = React.useMemo(
|
|
8896
8962
|
() => resolveDefaultZoomScale(activeTab, activeSheet),
|
|
8897
8963
|
[activeSheet, activeTab]
|
|
@@ -8917,7 +8983,7 @@ function useXlsxViewerController(options) {
|
|
|
8917
8983
|
return currentIndex;
|
|
8918
8984
|
}
|
|
8919
8985
|
const targetSheet = sheets[index];
|
|
8920
|
-
const tabIndex = tabs.findIndex((tab) => tab.kind === "sheet" && tab.workbookSheetIndex === _optionalChain([targetSheet, 'optionalAccess',
|
|
8986
|
+
const tabIndex = tabs.findIndex((tab) => tab.kind === "sheet" && tab.workbookSheetIndex === _optionalChain([targetSheet, 'optionalAccess', _662 => _662.workbookSheetIndex]));
|
|
8921
8987
|
if (tabIndex >= 0) {
|
|
8922
8988
|
setActiveTabIndexState(tabIndex);
|
|
8923
8989
|
}
|
|
@@ -8930,7 +8996,7 @@ function useXlsxViewerController(options) {
|
|
|
8930
8996
|
return currentIndex;
|
|
8931
8997
|
}
|
|
8932
8998
|
const targetTab = tabs[index];
|
|
8933
|
-
if (_optionalChain([targetTab, 'optionalAccess',
|
|
8999
|
+
if (_optionalChain([targetTab, 'optionalAccess', _663 => _663.kind]) === "sheet" && typeof targetTab.sheetIndex === "number") {
|
|
8934
9000
|
setActiveSheetIndexState(targetTab.sheetIndex);
|
|
8935
9001
|
}
|
|
8936
9002
|
return index;
|
|
@@ -8948,7 +9014,7 @@ function useXlsxViewerController(options) {
|
|
|
8948
9014
|
if (!parsed) {
|
|
8949
9015
|
return false;
|
|
8950
9016
|
}
|
|
8951
|
-
const requestedSheetName = _optionalChain([parsed, 'access',
|
|
9017
|
+
const requestedSheetName = _optionalChain([parsed, 'access', _664 => _664.sheetName, 'optionalAccess', _665 => _665.toLowerCase, 'call', _666 => _666()]);
|
|
8952
9018
|
const sheetIndex = requestedSheetName === void 0 ? _nullishCoalesce(options2.sheetIndex, () => ( activeSheetIndex)) : sheets.findIndex((sheet2) => sheet2.name.toLowerCase() === requestedSheetName);
|
|
8953
9019
|
const sheet = Number.isInteger(sheetIndex) ? sheets[sheetIndex] : void 0;
|
|
8954
9020
|
if (!sheet) {
|
|
@@ -8965,7 +9031,7 @@ function useXlsxViewerController(options) {
|
|
|
8965
9031
|
});
|
|
8966
9032
|
}
|
|
8967
9033
|
setHighlightedRanges(nextHighlights);
|
|
8968
|
-
if (_optionalChain([nextHighlights, 'access',
|
|
9034
|
+
if (_optionalChain([nextHighlights, 'access', _667 => _667[0], 'optionalAccess', _668 => _668.autoScroll])) {
|
|
8969
9035
|
setActiveSheetIndex(firstSheetIndex);
|
|
8970
9036
|
}
|
|
8971
9037
|
return true;
|
|
@@ -9030,7 +9096,7 @@ function useXlsxViewerController(options) {
|
|
|
9030
9096
|
return;
|
|
9031
9097
|
}
|
|
9032
9098
|
const preflight = preflightWorkbookBuffer(deferredBuffer);
|
|
9033
|
-
if (_optionalChain([preflight, 'optionalAccess',
|
|
9099
|
+
if (_optionalChain([preflight, 'optionalAccess', _669 => _669.tooLarge])) {
|
|
9034
9100
|
deferredBufferRef.current = null;
|
|
9035
9101
|
setDeferredLoadFileSize(null);
|
|
9036
9102
|
setWorkbook(null);
|
|
@@ -9202,8 +9268,8 @@ function useXlsxViewerController(options) {
|
|
|
9202
9268
|
}
|
|
9203
9269
|
}, [activeSheetIndex, sheets, workbook]);
|
|
9204
9270
|
const tables = React.useMemo(
|
|
9205
|
-
() => isWorkerBacked ? _nullishCoalesce(workerTablesByWorkbookSheetIndex[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
9206
|
-
[_optionalChain([activeSheet, 'optionalAccess',
|
|
9271
|
+
() => isWorkerBacked ? _nullishCoalesce(workerTablesByWorkbookSheetIndex[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _670 => _670.workbookSheetIndex]), () => ( -1))], () => ( [])) : mapWorksheetTables(getActiveWorksheet(), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _671 => _671.autoFilterRanges]), () => ( []))),
|
|
9272
|
+
[_optionalChain([activeSheet, 'optionalAccess', _672 => _672.autoFilterRanges]), _optionalChain([activeSheet, 'optionalAccess', _673 => _673.workbookSheetIndex]), getActiveWorksheet, isWorkerBacked, revision, workerTablesByWorkbookSheetIndex]
|
|
9207
9273
|
);
|
|
9208
9274
|
const getCellSnapshotAsync = React.useCallback((workbookSheetIndex, row, col) => {
|
|
9209
9275
|
if (!isWorkerBacked) {
|
|
@@ -9212,14 +9278,14 @@ function useXlsxViewerController(options) {
|
|
|
9212
9278
|
formula: ""
|
|
9213
9279
|
});
|
|
9214
9280
|
}
|
|
9215
|
-
return getWorkerClient().getCellSnapshot(workbookSheetIndex, row, col);
|
|
9216
|
-
}, [getWorkerClient, isWorkerBacked]);
|
|
9281
|
+
return getWorkerClient().getCellSnapshot(workbookSheetIndex, row, col, locale);
|
|
9282
|
+
}, [getWorkerClient, isWorkerBacked, locale]);
|
|
9217
9283
|
const getRowsBatchAsync = React.useCallback((workbookSheetIndex, startRow, rowCount) => {
|
|
9218
9284
|
if (!isWorkerBacked) {
|
|
9219
9285
|
return Promise.resolve(null);
|
|
9220
9286
|
}
|
|
9221
|
-
return getWorkerClient().getRowsBatch(workbookSheetIndex, startRow, rowCount);
|
|
9222
|
-
}, [getWorkerClient, isWorkerBacked]);
|
|
9287
|
+
return getWorkerClient().getRowsBatch(workbookSheetIndex, startRow, rowCount, locale);
|
|
9288
|
+
}, [getWorkerClient, isWorkerBacked, locale]);
|
|
9223
9289
|
const visibleSheetIndexByWorkbookSheetIndex = React.useMemo(
|
|
9224
9290
|
() => new Map(sheets.map((sheet, index) => [sheet.workbookSheetIndex, index])),
|
|
9225
9291
|
[sheets]
|
|
@@ -9270,9 +9336,9 @@ function useXlsxViewerController(options) {
|
|
|
9270
9336
|
}, [publicChartById]);
|
|
9271
9337
|
const getChartsheetById = React.useCallback((id) => _nullishCoalesce(chartsheets.find((chartsheet) => chartsheet.id === id), () => ( null)), [chartsheets]);
|
|
9272
9338
|
const charts = React.useMemo(() => {
|
|
9273
|
-
if (_optionalChain([activeTab, 'optionalAccess',
|
|
9339
|
+
if (_optionalChain([activeTab, 'optionalAccess', _674 => _674.kind]) === "chartsheet" && typeof activeTab.chartsheetIndex === "number") {
|
|
9274
9340
|
const chartsheet = chartsheets[activeTab.chartsheetIndex];
|
|
9275
|
-
return (_nullishCoalesce(_optionalChain([chartsheet, 'optionalAccess',
|
|
9341
|
+
return (_nullishCoalesce(_optionalChain([chartsheet, 'optionalAccess', _675 => _675.chartIds]), () => ( []))).map((id) => getChartById(id)).filter((value) => Boolean(value));
|
|
9276
9342
|
}
|
|
9277
9343
|
return getSheetCharts(activeSheetIndex);
|
|
9278
9344
|
}, [activeSheetIndex, activeTab, chartsheets, getChartById, getSheetCharts]);
|
|
@@ -9321,7 +9387,7 @@ function useXlsxViewerController(options) {
|
|
|
9321
9387
|
}, [selectedChartId]);
|
|
9322
9388
|
const selectChartElement = React.useCallback((selection2) => {
|
|
9323
9389
|
setSelectedImageId(null);
|
|
9324
|
-
setSelectedChartId(_nullishCoalesce(_optionalChain([selection2, 'optionalAccess',
|
|
9390
|
+
setSelectedChartId(_nullishCoalesce(_optionalChain([selection2, 'optionalAccess', _676 => _676.chartId]), () => ( null)));
|
|
9325
9391
|
setSelectedChartElement(selection2);
|
|
9326
9392
|
}, []);
|
|
9327
9393
|
const getSheetImages = React.useCallback((sheetIndex = activeSheetIndex) => {
|
|
@@ -9348,11 +9414,11 @@ function useXlsxViewerController(options) {
|
|
|
9348
9414
|
return [];
|
|
9349
9415
|
}
|
|
9350
9416
|
const control2 = (_nullishCoalesce(formControlsByWorkbookSheetIndex[targetSheet.workbookSheetIndex], () => ( []))).find((entry) => entry.controlIndex === controlIndex);
|
|
9351
|
-
return _nullishCoalesce(_optionalChain([control2, 'optionalAccess',
|
|
9417
|
+
return _nullishCoalesce(_optionalChain([control2, 'optionalAccess', _677 => _677.items, 'optionalAccess', _678 => _678.slice, 'call', _679 => _679()]), () => ( []));
|
|
9352
9418
|
}
|
|
9353
9419
|
const control = target.worksheet.formControls[controlIndex];
|
|
9354
|
-
const kind = _optionalChain([control, 'optionalAccess',
|
|
9355
|
-
const inputRange = _optionalChain([kind, 'optionalAccess',
|
|
9420
|
+
const kind = _optionalChain([control, 'optionalAccess', _680 => _680.formControl, 'access', _681 => _681.kind]);
|
|
9421
|
+
const inputRange = _optionalChain([kind, 'optionalAccess', _682 => _682.kind]) === "listBox" || _optionalChain([kind, 'optionalAccess', _683 => _683.kind]) === "dropdown" ? kind.inputRange : void 0;
|
|
9356
9422
|
if (!inputRange) {
|
|
9357
9423
|
return [];
|
|
9358
9424
|
}
|
|
@@ -9384,7 +9450,7 @@ function useXlsxViewerController(options) {
|
|
|
9384
9450
|
const shapes = React.useMemo(() => getSheetShapes(activeSheetIndex), [activeSheetIndex, getSheetShapes]);
|
|
9385
9451
|
const getImageById = React.useCallback((id) => {
|
|
9386
9452
|
for (const sheetImages of imagesByWorkbookSheetIndex) {
|
|
9387
|
-
const match = _optionalChain([sheetImages, 'optionalAccess',
|
|
9453
|
+
const match = _optionalChain([sheetImages, 'optionalAccess', _684 => _684.find, 'call', _685 => _685((image) => image.id === id)]);
|
|
9388
9454
|
if (match) {
|
|
9389
9455
|
return mapPublicImage(match);
|
|
9390
9456
|
}
|
|
@@ -9404,35 +9470,35 @@ function useXlsxViewerController(options) {
|
|
|
9404
9470
|
setSelectedImageId(null);
|
|
9405
9471
|
}, []);
|
|
9406
9472
|
const getColumnWidthPx = React.useCallback((worksheet, col) => {
|
|
9407
|
-
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access',
|
|
9473
|
+
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _686 => _686.current, 'optionalAccess', _687 => _687.sheetStatesByWorkbookSheetIndex, 'access', _688 => _688[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _689 => _689.workbookSheetIndex]), () => ( -1))]]), () => ( null));
|
|
9408
9474
|
const width = worksheet.getColumnWidth(col);
|
|
9409
|
-
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
9475
|
+
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _690 => _690.showGridLines]), () => ( true));
|
|
9410
9476
|
if (width !== void 0 && width !== null) {
|
|
9411
9477
|
return resolveRenderedSheetAxisPixels(
|
|
9412
|
-
resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess',
|
|
9478
|
+
resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _691 => _691.columnWidthCharacterWidthPx])),
|
|
9413
9479
|
showGridLines
|
|
9414
9480
|
);
|
|
9415
9481
|
}
|
|
9416
9482
|
return resolveRenderedSheetAxisPixels(
|
|
9417
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
9483
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _692 => _692.colWidthOverridesPx, 'optionalAccess', _693 => _693[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _694 => _694.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH)),
|
|
9418
9484
|
showGridLines
|
|
9419
9485
|
);
|
|
9420
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
9486
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _695 => _695.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _696 => _696.workbookSheetIndex])]);
|
|
9421
9487
|
const getRowHeightPx = React.useCallback((worksheet, row) => {
|
|
9422
|
-
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access',
|
|
9488
|
+
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _697 => _697.current, 'optionalAccess', _698 => _698.sheetStatesByWorkbookSheetIndex, 'access', _699 => _699[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _700 => _700.workbookSheetIndex]), () => ( -1))]]), () => ( null));
|
|
9423
9489
|
const height = worksheet.getRowHeight(row);
|
|
9424
|
-
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
9490
|
+
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _701 => _701.showGridLines]), () => ( true));
|
|
9425
9491
|
if (height !== void 0 && height !== null) {
|
|
9426
9492
|
return resolveRenderedSheetAxisPixels(resolveSheetRowHeightPixels(height), showGridLines);
|
|
9427
9493
|
}
|
|
9428
9494
|
return resolveRenderedSheetAxisPixels(
|
|
9429
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
9495
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _702 => _702.rowHeightOverridesPx, 'optionalAccess', _703 => _703[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _704 => _704.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT)),
|
|
9430
9496
|
showGridLines
|
|
9431
9497
|
);
|
|
9432
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
9498
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _705 => _705.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _706 => _706.workbookSheetIndex])]);
|
|
9433
9499
|
const getCellDisplayValue2 = React.useCallback((cell) => {
|
|
9434
9500
|
if (cell && activeSheet) {
|
|
9435
|
-
const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
|
|
9501
|
+
const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${locale}:${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
|
|
9436
9502
|
if (workerSnapshot) {
|
|
9437
9503
|
return workerSnapshot.displayValue;
|
|
9438
9504
|
}
|
|
@@ -9442,10 +9508,10 @@ function useXlsxViewerController(options) {
|
|
|
9442
9508
|
return "";
|
|
9443
9509
|
}
|
|
9444
9510
|
const formula = worksheet.getFormulaAt(cell.row, cell.col);
|
|
9445
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
9511
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _707 => _707.cachedFormulaValues, 'optionalAccess', _708 => _708[cellAddressToA1(cell)]]) : void 0;
|
|
9446
9512
|
const formatted = worksheet.getFormattedValueAt(cell.row, cell.col);
|
|
9447
9513
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
9448
|
-
return decodeHtmlEntities(formatted);
|
|
9514
|
+
return localizeCellNumber(worksheet, cell.row, cell.col, decodeHtmlEntities(formatted), locale);
|
|
9449
9515
|
}
|
|
9450
9516
|
const calculated = worksheet.getCalculatedValueAt(cell.row, cell.col);
|
|
9451
9517
|
if (formula && cachedFormulaValue !== void 0 && calculated.is_error) {
|
|
@@ -9458,10 +9524,10 @@ function useXlsxViewerController(options) {
|
|
|
9458
9524
|
return "";
|
|
9459
9525
|
}
|
|
9460
9526
|
return calculated.toString();
|
|
9461
|
-
}, [activeSheet, getActiveWorksheet]);
|
|
9527
|
+
}, [activeSheet, getActiveWorksheet, locale]);
|
|
9462
9528
|
const getCellFormula = React.useCallback((cell) => {
|
|
9463
9529
|
if (cell && activeSheet) {
|
|
9464
|
-
const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
|
|
9530
|
+
const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${locale}:${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
|
|
9465
9531
|
if (workerSnapshot) {
|
|
9466
9532
|
return workerSnapshot.formula;
|
|
9467
9533
|
}
|
|
@@ -9471,7 +9537,7 @@ function useXlsxViewerController(options) {
|
|
|
9471
9537
|
return "";
|
|
9472
9538
|
}
|
|
9473
9539
|
return _nullishCoalesce(worksheet.getFormulaAt(cell.row, cell.col), () => ( ""));
|
|
9474
|
-
}, [activeSheet, getActiveWorksheet]);
|
|
9540
|
+
}, [activeSheet, getActiveWorksheet, locale]);
|
|
9475
9541
|
const getClipboardData = React.useCallback(() => {
|
|
9476
9542
|
const worksheet = getActiveWorksheet();
|
|
9477
9543
|
const targetRange = _nullishCoalesce(selection, () => ( (activeCell ? { start: activeCell, end: activeCell } : null)));
|
|
@@ -9504,9 +9570,9 @@ function useXlsxViewerController(options) {
|
|
|
9504
9570
|
"white-space:pre-wrap",
|
|
9505
9571
|
"vertical-align:top"
|
|
9506
9572
|
];
|
|
9507
|
-
const fill = _optionalChain([rawStyle, 'optionalAccess',
|
|
9573
|
+
const fill = _optionalChain([rawStyle, 'optionalAccess', _709 => _709.fill]);
|
|
9508
9574
|
if (fill) {
|
|
9509
|
-
const fillStyle = resolveWorkbookFillStyle(fill, _optionalChain([activeSheet, 'optionalAccess',
|
|
9575
|
+
const fillStyle = resolveWorkbookFillStyle(fill, _optionalChain([activeSheet, 'optionalAccess', _710 => _710.themePalette]));
|
|
9510
9576
|
if (fillStyle.backgroundColor && fillStyle.backgroundColor.toLowerCase() !== "#ffffff") {
|
|
9511
9577
|
cellStyles.push(`background-color:${fillStyle.backgroundColor}`);
|
|
9512
9578
|
}
|
|
@@ -9514,7 +9580,7 @@ function useXlsxViewerController(options) {
|
|
|
9514
9580
|
cellStyles.push(`background-image:${fillStyle.backgroundImage}`);
|
|
9515
9581
|
}
|
|
9516
9582
|
}
|
|
9517
|
-
const font = _optionalChain([rawStyle, 'optionalAccess',
|
|
9583
|
+
const font = _optionalChain([rawStyle, 'optionalAccess', _711 => _711.font]);
|
|
9518
9584
|
if (font) {
|
|
9519
9585
|
if (font.bold) {
|
|
9520
9586
|
cellStyles.push("font-weight:700");
|
|
@@ -9528,7 +9594,7 @@ function useXlsxViewerController(options) {
|
|
|
9528
9594
|
if (font.strikethrough) {
|
|
9529
9595
|
cellStyles.push("text-decoration:line-through");
|
|
9530
9596
|
}
|
|
9531
|
-
const fontColor = resolveWorkbookColor(font.color, _optionalChain([activeSheet, 'optionalAccess',
|
|
9597
|
+
const fontColor = resolveWorkbookColor(font.color, _optionalChain([activeSheet, 'optionalAccess', _712 => _712.themePalette]));
|
|
9532
9598
|
if (fontColor) {
|
|
9533
9599
|
cellStyles.push(`color:${fontColor}`);
|
|
9534
9600
|
}
|
|
@@ -9536,29 +9602,29 @@ function useXlsxViewerController(options) {
|
|
|
9536
9602
|
cellStyles.push(`font-size:${font.size}pt`);
|
|
9537
9603
|
}
|
|
9538
9604
|
}
|
|
9539
|
-
const alignment = _optionalChain([rawStyle, 'optionalAccess',
|
|
9540
|
-
if (_optionalChain([alignment, 'optionalAccess',
|
|
9605
|
+
const alignment = _optionalChain([rawStyle, 'optionalAccess', _713 => _713.alignment]);
|
|
9606
|
+
if (_optionalChain([alignment, 'optionalAccess', _714 => _714.horizontal]) && alignment.horizontal !== "general") {
|
|
9541
9607
|
cellStyles.push(`text-align:${String(alignment.horizontal)}`);
|
|
9542
9608
|
}
|
|
9543
|
-
if (_optionalChain([alignment, 'optionalAccess',
|
|
9609
|
+
if (_optionalChain([alignment, 'optionalAccess', _715 => _715.wrapText])) {
|
|
9544
9610
|
cellStyles.push("white-space:pre-wrap");
|
|
9545
9611
|
cellStyles.push("word-break:break-word");
|
|
9546
9612
|
}
|
|
9547
|
-
const border = _optionalChain([rawStyle, 'optionalAccess',
|
|
9548
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9613
|
+
const border = _optionalChain([rawStyle, 'optionalAccess', _716 => _716.border]);
|
|
9614
|
+
if (_optionalChain([border, 'optionalAccess', _717 => _717.top, 'optionalAccess', _718 => _718.style]) && border.top.style !== "none") {
|
|
9549
9615
|
cellStyles.push(`border-top:${mapBorder(border.top)}`);
|
|
9550
9616
|
}
|
|
9551
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9617
|
+
if (_optionalChain([border, 'optionalAccess', _719 => _719.right, 'optionalAccess', _720 => _720.style]) && border.right.style !== "none") {
|
|
9552
9618
|
cellStyles.push(`border-right:${mapBorder(border.right)}`);
|
|
9553
9619
|
}
|
|
9554
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9620
|
+
if (_optionalChain([border, 'optionalAccess', _721 => _721.bottom, 'optionalAccess', _722 => _722.style]) && border.bottom.style !== "none") {
|
|
9555
9621
|
cellStyles.push(`border-bottom:${mapBorder(border.bottom)}`);
|
|
9556
9622
|
}
|
|
9557
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9623
|
+
if (_optionalChain([border, 'optionalAccess', _723 => _723.left, 'optionalAccess', _724 => _724.style]) && border.left.style !== "none") {
|
|
9558
9624
|
cellStyles.push(`border-left:${mapBorder(border.left)}`);
|
|
9559
9625
|
}
|
|
9560
|
-
const rowSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess',
|
|
9561
|
-
const colSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess',
|
|
9626
|
+
const rowSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _725 => _725.rowSpan]), () => ( 1)), normalized.end.row - row + 1);
|
|
9627
|
+
const colSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _726 => _726.colSpan]), () => ( 1)), normalized.end.col - col + 1);
|
|
9562
9628
|
payload.cells.push({
|
|
9563
9629
|
colOffset: col - normalized.start.col,
|
|
9564
9630
|
formula,
|
|
@@ -9591,7 +9657,7 @@ function useXlsxViewerController(options) {
|
|
|
9591
9657
|
if (!isWorkerBacked || !deferredMetadataSheet || !deferredMetadataCell) {
|
|
9592
9658
|
return;
|
|
9593
9659
|
}
|
|
9594
|
-
const cacheKey = `${deferredMetadataSheet.workbookSheetIndex}:${deferredMetadataCell.row}:${deferredMetadataCell.col}`;
|
|
9660
|
+
const cacheKey = `${locale}:${deferredMetadataSheet.workbookSheetIndex}:${deferredMetadataCell.row}:${deferredMetadataCell.col}`;
|
|
9595
9661
|
if (workerCellSnapshotCacheRef.current.has(cacheKey)) {
|
|
9596
9662
|
return;
|
|
9597
9663
|
}
|
|
@@ -9615,7 +9681,7 @@ function useXlsxViewerController(options) {
|
|
|
9615
9681
|
return () => {
|
|
9616
9682
|
isCurrent = false;
|
|
9617
9683
|
};
|
|
9618
|
-
}, [deferredMetadataCell, deferredMetadataSheet, getCellSnapshotAsync, isWorkerBacked]);
|
|
9684
|
+
}, [deferredMetadataCell, deferredMetadataSheet, getCellSnapshotAsync, isWorkerBacked, locale]);
|
|
9619
9685
|
const activeCellAddress = React.useMemo(() => activeCell ? cellAddressToA1(activeCell) : null, [activeCell]);
|
|
9620
9686
|
const selectedRangeAddress = React.useMemo(() => selection ? rangeToA1(selection) : null, [selection]);
|
|
9621
9687
|
const selectedValue = React.useMemo(
|
|
@@ -9774,10 +9840,10 @@ function useXlsxViewerController(options) {
|
|
|
9774
9840
|
target.worksheet.addDrawing(xlsxFormControlInputToDukeDrawing(input));
|
|
9775
9841
|
const controlIndex = target.worksheet.formControlCount - 1;
|
|
9776
9842
|
const addedControl = target.worksheet.formControls[controlIndex];
|
|
9777
|
-
const addedKind = _optionalChain([addedControl, 'optionalAccess',
|
|
9778
|
-
if (addedControl && (_optionalChain([addedKind, 'optionalAccess',
|
|
9843
|
+
const addedKind = _optionalChain([addedControl, 'optionalAccess', _727 => _727.formControl, 'access', _728 => _728.kind]);
|
|
9844
|
+
if (addedControl && (_optionalChain([addedKind, 'optionalAccess', _729 => _729.kind]) === "checkbox" || _optionalChain([addedKind, 'optionalAccess', _730 => _730.kind]) === "optionButton")) {
|
|
9779
9845
|
target.worksheet.setFormControlCheckState(addedControl.drawingPath, addedKind.state);
|
|
9780
|
-
} else if (_optionalChain([addedKind, 'optionalAccess',
|
|
9846
|
+
} else if (_optionalChain([addedKind, 'optionalAccess', _731 => _731.kind]) === "groupBox") {
|
|
9781
9847
|
reconcileCheckedOptionButtons(target.worksheet);
|
|
9782
9848
|
} else if (addedKind && "cellLink" in addedKind && addedKind.cellLink) {
|
|
9783
9849
|
workbook.syncFormControls();
|
|
@@ -9788,7 +9854,7 @@ function useXlsxViewerController(options) {
|
|
|
9788
9854
|
}, [activeSheetIndex, getFormControlWorksheet, maybeRecalculateWorkbook, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
|
|
9789
9855
|
const updateFormControl = React.useCallback((controlIndex, patch, sheetIndex = activeSheetIndex) => {
|
|
9790
9856
|
const target = getFormControlWorksheet(sheetIndex);
|
|
9791
|
-
const currentControl = _optionalChain([target, 'optionalAccess',
|
|
9857
|
+
const currentControl = _optionalChain([target, 'optionalAccess', _732 => _732.worksheet, 'access', _733 => _733.formControls, 'access', _734 => _734[controlIndex]]);
|
|
9792
9858
|
if (readOnly || !workbook || !target || !currentControl) {
|
|
9793
9859
|
return false;
|
|
9794
9860
|
}
|
|
@@ -9808,8 +9874,8 @@ function useXlsxViewerController(options) {
|
|
|
9808
9874
|
legacyObjectType: _nullishCoalesce(nextKind.legacyObjectType, () => ( currentControl.formControl.kind.legacyObjectType))
|
|
9809
9875
|
};
|
|
9810
9876
|
}
|
|
9811
|
-
const patchedRawObj = _optionalChain([patch, 'access',
|
|
9812
|
-
const patchedRawProperties = _optionalChain([patch, 'access',
|
|
9877
|
+
const patchedRawObj = _optionalChain([patch, 'access', _735 => _735.kind, 'optionalAccess', _736 => _736.kind]) === "editbox" || _optionalChain([patch, 'access', _737 => _737.kind, 'optionalAccess', _738 => _738.kind]) === "unknown" ? patch.kind.rawObj : void 0;
|
|
9878
|
+
const patchedRawProperties = _optionalChain([patch, 'access', _739 => _739.kind, 'optionalAccess', _740 => _740.kind]) === "editbox" || _optionalChain([patch, 'access', _741 => _741.kind, 'optionalAccess', _742 => _742.kind]) === "unknown" ? patch.kind.rawProperties : void 0;
|
|
9813
9879
|
const nextInput = {
|
|
9814
9880
|
altText: "altText" in patch ? patch.altText : currentControl.altText,
|
|
9815
9881
|
anchor: nextAnchor,
|
|
@@ -9830,10 +9896,10 @@ function useXlsxViewerController(options) {
|
|
|
9830
9896
|
};
|
|
9831
9897
|
target.worksheet.setDrawing(currentControl.drawingPath, nextInput);
|
|
9832
9898
|
const updatedControl = target.worksheet.formControls[controlIndex];
|
|
9833
|
-
const updatedKind = _optionalChain([updatedControl, 'optionalAccess',
|
|
9899
|
+
const updatedKind = _optionalChain([updatedControl, 'optionalAccess', _743 => _743.formControl, 'access', _744 => _744.kind]);
|
|
9834
9900
|
const interactionChanged = updatedKind ? formControlInteractionChanged(currentControl.formControl.kind, updatedKind) : false;
|
|
9835
9901
|
const groupTopologyChanged = patch.anchor !== void 0 || updatedKind !== void 0 && updatedKind.kind !== currentControl.formControl.kind.kind && (updatedKind.kind === "groupBox" || currentControl.formControl.kind.kind === "groupBox");
|
|
9836
|
-
if (interactionChanged && updatedControl && (_optionalChain([updatedKind, 'optionalAccess',
|
|
9902
|
+
if (interactionChanged && updatedControl && (_optionalChain([updatedKind, 'optionalAccess', _745 => _745.kind]) === "checkbox" || _optionalChain([updatedKind, 'optionalAccess', _746 => _746.kind]) === "optionButton")) {
|
|
9837
9903
|
target.worksheet.setFormControlCheckState(updatedControl.drawingPath, updatedKind.state);
|
|
9838
9904
|
} else if (groupTopologyChanged) {
|
|
9839
9905
|
reconcileCheckedOptionButtons(target.worksheet);
|
|
@@ -9945,7 +10011,7 @@ function useXlsxViewerController(options) {
|
|
|
9945
10011
|
const comparedText = left.sortText.localeCompare(right.sortText, void 0, { numeric: true, sensitivity: "base" });
|
|
9946
10012
|
return direction === "ascending" ? comparedText : -comparedText;
|
|
9947
10013
|
});
|
|
9948
|
-
if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access',
|
|
10014
|
+
if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access', _747 => _747[index], 'optionalAccess', _748 => _748.index]))) {
|
|
9949
10015
|
setSortState({ columnIndex, direction, tableName: targetTable.name });
|
|
9950
10016
|
return;
|
|
9951
10017
|
}
|
|
@@ -9997,19 +10063,26 @@ function useXlsxViewerController(options) {
|
|
|
9997
10063
|
downloadUrl(src, displayFileName);
|
|
9998
10064
|
}
|
|
9999
10065
|
}, [displayFileName, file, src]);
|
|
10000
|
-
const
|
|
10066
|
+
const getXlsxBytes = React.useCallback(() => {
|
|
10001
10067
|
if (!workbook) {
|
|
10068
|
+
return null;
|
|
10069
|
+
}
|
|
10070
|
+
return createSavedWorkbookBytes(workbook);
|
|
10071
|
+
}, [createSavedWorkbookBytes, workbook]);
|
|
10072
|
+
const exportXlsx = React.useCallback(() => {
|
|
10073
|
+
const bytes = getXlsxBytes();
|
|
10074
|
+
if (!bytes) {
|
|
10002
10075
|
return;
|
|
10003
10076
|
}
|
|
10004
|
-
downloadBytes(
|
|
10005
|
-
}, [
|
|
10077
|
+
downloadBytes(bytes, `${fileStem(displayFileName)}.xlsx`, XLSX_MIME_TYPE);
|
|
10078
|
+
}, [displayFileName, getXlsxBytes]);
|
|
10006
10079
|
const exportCsv = React.useCallback(() => {
|
|
10007
10080
|
if (!workbook) {
|
|
10008
10081
|
return;
|
|
10009
10082
|
}
|
|
10010
|
-
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
10083
|
+
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _749 => _749.name]), () => ( "sheet"));
|
|
10011
10084
|
downloadText(workbook.saveCsvString(), `${fileStem(displayFileName)}-${activeSheetName}.csv`, CSV_MIME_TYPE);
|
|
10012
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
10085
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _750 => _750.name]), displayFileName, workbook]);
|
|
10013
10086
|
const recalculate = React.useCallback(() => {
|
|
10014
10087
|
if (!workbook) {
|
|
10015
10088
|
return;
|
|
@@ -10173,10 +10246,10 @@ function useXlsxViewerController(options) {
|
|
|
10173
10246
|
const currentChart = getChartById(id);
|
|
10174
10247
|
console.info("[react-xlsx debug] currentChart", {
|
|
10175
10248
|
activeWorkbookSheetIndex: activeSheet.workbookSheetIndex,
|
|
10176
|
-
editable: _optionalChain([currentChart, 'optionalAccess',
|
|
10249
|
+
editable: _optionalChain([currentChart, 'optionalAccess', _751 => _751.editable]),
|
|
10177
10250
|
found: Boolean(currentChart),
|
|
10178
10251
|
originCount: hydratedChartAssets.chartOriginsById.size,
|
|
10179
|
-
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess',
|
|
10252
|
+
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess', _752 => _752.workbookSheetIndex])
|
|
10180
10253
|
});
|
|
10181
10254
|
if (!currentChart || currentChart.editable === false || currentChart.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
|
|
10182
10255
|
return;
|
|
@@ -10184,8 +10257,8 @@ function useXlsxViewerController(options) {
|
|
|
10184
10257
|
const nextAnchor = rectToImageAnchor(rect, currentChart.anchor, {
|
|
10185
10258
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
10186
10259
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
10187
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10188
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10260
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _753 => _753.columnWidths, 'access', _754 => _754[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
10261
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _755 => _755.rowHeights, 'access', _756 => _756[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
10189
10262
|
});
|
|
10190
10263
|
recordHistoryBeforeMutation();
|
|
10191
10264
|
const didUpdateAnchor = updateWorkbookChartAnchor(imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
|
|
@@ -10216,8 +10289,8 @@ function useXlsxViewerController(options) {
|
|
|
10216
10289
|
const nextAnchor = rectToImageAnchor(rect, currentImage.anchor, {
|
|
10217
10290
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
10218
10291
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
10219
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10220
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10292
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _757 => _757.columnWidths, 'access', _758 => _758[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
10293
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _759 => _759.rowHeights, 'access', _760 => _760[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
10221
10294
|
});
|
|
10222
10295
|
recordHistoryBeforeMutation();
|
|
10223
10296
|
if (!updateWorkbookImageAnchor(imageAssetsRef.current, id, nextAnchor)) {
|
|
@@ -10388,7 +10461,7 @@ function useXlsxViewerController(options) {
|
|
|
10388
10461
|
setSelectedChartElement(null);
|
|
10389
10462
|
setSelectedImageId(null);
|
|
10390
10463
|
setActiveCell(cell);
|
|
10391
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
10464
|
+
if (_optionalChain([options2, 'optionalAccess', _761 => _761.extend]) && selectionAnchorRef.current) {
|
|
10392
10465
|
setSelection(normalizeRange({ start: selectionAnchorRef.current, end: cell }));
|
|
10393
10466
|
return;
|
|
10394
10467
|
}
|
|
@@ -10465,7 +10538,8 @@ function useXlsxViewerController(options) {
|
|
|
10465
10538
|
if (!before) {
|
|
10466
10539
|
return;
|
|
10467
10540
|
}
|
|
10468
|
-
|
|
10541
|
+
if (locale !== "en-US" && value === getCellDisplayValue2(cell)) return;
|
|
10542
|
+
const nextValue = coerceUserEnteredValue(value, locale);
|
|
10469
10543
|
worksheet.setCell(cellAddressToA1(cell), nextValue);
|
|
10470
10544
|
const after = captureCellMutationState(cell);
|
|
10471
10545
|
if (!after) {
|
|
@@ -10474,7 +10548,7 @@ function useXlsxViewerController(options) {
|
|
|
10474
10548
|
maybeRecalculateWorkbook(workbook);
|
|
10475
10549
|
refreshWorkbookState(workbook);
|
|
10476
10550
|
recordCellEditHistory(cell, before, after);
|
|
10477
|
-
}, [captureCellMutationState, getActiveWorksheet, maybeRecalculateWorkbook, readOnly, recordCellEditHistory, refreshWorkbookState, workbook]);
|
|
10551
|
+
}, [captureCellMutationState, getActiveWorksheet, getCellDisplayValue2, locale, maybeRecalculateWorkbook, readOnly, recordCellEditHistory, refreshWorkbookState, workbook]);
|
|
10478
10552
|
const setCellFormula = React.useCallback((cell, formula) => {
|
|
10479
10553
|
const worksheet = getActiveWorksheet();
|
|
10480
10554
|
if (readOnly || !worksheet || !workbook) {
|
|
@@ -10528,7 +10602,7 @@ function useXlsxViewerController(options) {
|
|
|
10528
10602
|
setCellFormula(activeCell, formula);
|
|
10529
10603
|
}, [activeCell, setCellFormula]);
|
|
10530
10604
|
const setSelectedFormula = React.useCallback((formula) => {
|
|
10531
|
-
if (_optionalChain([selectedFormulaTarget, 'optionalAccess',
|
|
10605
|
+
if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _762 => _762.kind]) === "chartSeries") {
|
|
10532
10606
|
return setChartSeriesFormula(selectedFormulaTarget.chartId, selectedFormulaTarget.seriesIndex, formula);
|
|
10533
10607
|
}
|
|
10534
10608
|
if (!activeCell) {
|
|
@@ -10690,7 +10764,7 @@ function useXlsxViewerController(options) {
|
|
|
10690
10764
|
return;
|
|
10691
10765
|
}
|
|
10692
10766
|
recordHistoryBeforeMutation();
|
|
10693
|
-
const baseName = _optionalChain([name, 'optionalAccess',
|
|
10767
|
+
const baseName = _optionalChain([name, 'optionalAccess', _763 => _763.trim, 'call', _764 => _764()]) || "Sheet";
|
|
10694
10768
|
let candidate = baseName;
|
|
10695
10769
|
let counter = 2;
|
|
10696
10770
|
while (workbook.sheetIndex(candidate) !== void 0) {
|
|
@@ -10710,11 +10784,11 @@ function useXlsxViewerController(options) {
|
|
|
10710
10784
|
}
|
|
10711
10785
|
const nextSheets = buildSheetList(
|
|
10712
10786
|
workbook,
|
|
10713
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10714
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10715
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10716
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10717
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10787
|
+
_optionalChain([imageAssetsRef, 'access', _765 => _765.current, 'optionalAccess', _766 => _766.sheetStatesByWorkbookSheetIndex]),
|
|
10788
|
+
_optionalChain([imageAssetsRef, 'access', _767 => _767.current, 'optionalAccess', _768 => _768.themePalette]),
|
|
10789
|
+
_optionalChain([imageAssetsRef, 'access', _769 => _769.current, 'optionalAccess', _770 => _770.styleById]),
|
|
10790
|
+
_optionalChain([imageAssetsRef, 'access', _771 => _771.current, 'optionalAccess', _772 => _772.namedCellStyleByName]),
|
|
10791
|
+
_optionalChain([imageAssetsRef, 'access', _773 => _773.current, 'optionalAccess', _774 => _774.tableStyleByName]),
|
|
10718
10792
|
showHiddenSheets
|
|
10719
10793
|
);
|
|
10720
10794
|
setSheets(nextSheets);
|
|
@@ -10724,7 +10798,7 @@ function useXlsxViewerController(options) {
|
|
|
10724
10798
|
}
|
|
10725
10799
|
const nextIndex = nextSheets.findIndex((sheet) => sheet.name === candidate);
|
|
10726
10800
|
setActiveSheetIndexState(nextIndex >= 0 ? nextIndex : 0);
|
|
10727
|
-
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess',
|
|
10801
|
+
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _775 => _775.tabs, 'access', _776 => _776.findIndex, 'call', _777 => _777((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
|
|
10728
10802
|
if (nextTabIndex >= 0) {
|
|
10729
10803
|
setActiveTabIndexState(nextTabIndex);
|
|
10730
10804
|
}
|
|
@@ -10750,11 +10824,11 @@ function useXlsxViewerController(options) {
|
|
|
10750
10824
|
}
|
|
10751
10825
|
const nextSheets = buildSheetList(
|
|
10752
10826
|
workbook,
|
|
10753
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10754
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10755
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10756
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10757
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10827
|
+
_optionalChain([imageAssetsRef, 'access', _778 => _778.current, 'optionalAccess', _779 => _779.sheetStatesByWorkbookSheetIndex]),
|
|
10828
|
+
_optionalChain([imageAssetsRef, 'access', _780 => _780.current, 'optionalAccess', _781 => _781.themePalette]),
|
|
10829
|
+
_optionalChain([imageAssetsRef, 'access', _782 => _782.current, 'optionalAccess', _783 => _783.styleById]),
|
|
10830
|
+
_optionalChain([imageAssetsRef, 'access', _784 => _784.current, 'optionalAccess', _785 => _785.namedCellStyleByName]),
|
|
10831
|
+
_optionalChain([imageAssetsRef, 'access', _786 => _786.current, 'optionalAccess', _787 => _787.tableStyleByName]),
|
|
10758
10832
|
showHiddenSheets
|
|
10759
10833
|
);
|
|
10760
10834
|
setSheets(nextSheets);
|
|
@@ -10782,7 +10856,7 @@ function useXlsxViewerController(options) {
|
|
|
10782
10856
|
}, [readOnly, recordHistoryBeforeMutation, selection, workbook]);
|
|
10783
10857
|
const pasteText = React.useCallback((text) => {
|
|
10784
10858
|
const worksheet = getActiveWorksheet();
|
|
10785
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
10859
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _788 => _788.start]))), () => ( null));
|
|
10786
10860
|
if (readOnly || !worksheet || !workbook || !targetCell || !text) {
|
|
10787
10861
|
return false;
|
|
10788
10862
|
}
|
|
@@ -10815,7 +10889,7 @@ function useXlsxViewerController(options) {
|
|
|
10815
10889
|
cell: nextCell
|
|
10816
10890
|
});
|
|
10817
10891
|
} else {
|
|
10818
|
-
const nextValue = coerceUserEnteredValue(rawValue);
|
|
10892
|
+
const nextValue = coerceUserEnteredValue(rawValue, locale);
|
|
10819
10893
|
worksheet.setCell(cellAddressToA1(nextCell), nextValue);
|
|
10820
10894
|
const after = captureCellMutationState(nextCell);
|
|
10821
10895
|
if (!after) {
|
|
@@ -10843,10 +10917,10 @@ function useXlsxViewerController(options) {
|
|
|
10843
10917
|
selectionAnchorRef.current = targetCell;
|
|
10844
10918
|
recordRangeEditHistory(mutations, nextRange, targetCell);
|
|
10845
10919
|
return true;
|
|
10846
|
-
}, [activeCell, captureCellMutationState, getActiveWorksheet, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
|
|
10920
|
+
}, [activeCell, captureCellMutationState, getActiveWorksheet, locale, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
|
|
10847
10921
|
const pasteStructuredClipboardData = React.useCallback((serializedPayload) => {
|
|
10848
10922
|
const worksheet = getActiveWorksheet();
|
|
10849
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
10923
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _789 => _789.start]))), () => ( null));
|
|
10850
10924
|
if (readOnly || !worksheet || !workbook || !targetCell || !serializedPayload) {
|
|
10851
10925
|
return false;
|
|
10852
10926
|
}
|
|
@@ -11116,9 +11190,11 @@ function useXlsxViewerController(options) {
|
|
|
11116
11190
|
deferredLoadFileSize,
|
|
11117
11191
|
defineNamedRange,
|
|
11118
11192
|
displayFileName,
|
|
11193
|
+
locale,
|
|
11119
11194
|
download,
|
|
11120
11195
|
exportCsv,
|
|
11121
11196
|
exportXlsx,
|
|
11197
|
+
getXlsxBytes,
|
|
11122
11198
|
error,
|
|
11123
11199
|
fillSelection,
|
|
11124
11200
|
formControls,
|
|
@@ -11238,10 +11314,12 @@ function useXlsxViewerController(options) {
|
|
|
11238
11314
|
deferredLoadFileSize,
|
|
11239
11315
|
defineNamedRange,
|
|
11240
11316
|
displayFileName,
|
|
11317
|
+
locale,
|
|
11241
11318
|
download,
|
|
11242
11319
|
error,
|
|
11243
11320
|
exportCsv,
|
|
11244
11321
|
exportXlsx,
|
|
11322
|
+
getXlsxBytes,
|
|
11245
11323
|
file,
|
|
11246
11324
|
fillSelection,
|
|
11247
11325
|
formControls,
|
|
@@ -11917,7 +11995,7 @@ function parseCanvasGradientStops(value) {
|
|
|
11917
11995
|
if (!match) {
|
|
11918
11996
|
return null;
|
|
11919
11997
|
}
|
|
11920
|
-
const color = _optionalChain([match, 'access',
|
|
11998
|
+
const color = _optionalChain([match, 'access', _790 => _790[1], 'optionalAccess', _791 => _791.trim, 'call', _792 => _792()]);
|
|
11921
11999
|
const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
|
|
11922
12000
|
if (!color) {
|
|
11923
12001
|
return null;
|
|
@@ -11933,7 +12011,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
11933
12011
|
if (linearMatch) {
|
|
11934
12012
|
const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
|
|
11935
12013
|
if (parts.length >= 2) {
|
|
11936
|
-
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access',
|
|
12014
|
+
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _793 => _793[0], 'optionalAccess', _794 => _794.trim, 'call', _795 => _795()]), () => ( "180deg"));
|
|
11937
12015
|
const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
|
|
11938
12016
|
const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
|
|
11939
12017
|
const radians = (90 - cssAngle) * Math.PI / 180;
|
|
@@ -11963,7 +12041,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
11963
12041
|
const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
|
|
11964
12042
|
if (radialMatch) {
|
|
11965
12043
|
const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
|
|
11966
|
-
const stopParts = _optionalChain([parts, 'access',
|
|
12044
|
+
const stopParts = _optionalChain([parts, 'access', _796 => _796[0], 'optionalAccess', _797 => _797.startsWith, 'call', _798 => _798("circle")]) ? parts.slice(1) : parts;
|
|
11967
12045
|
const gradient = context.createRadialGradient(
|
|
11968
12046
|
rect.left + rect.width / 2,
|
|
11969
12047
|
rect.top + rect.height / 2,
|
|
@@ -12076,7 +12154,7 @@ function resolveDarkModeSurface(themePalette, palette) {
|
|
|
12076
12154
|
return "hsl(225 4% 6%)";
|
|
12077
12155
|
}
|
|
12078
12156
|
function resolveSheetSurface(sheet, palette) {
|
|
12079
|
-
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess',
|
|
12157
|
+
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _799 => _799.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _800 => _800.themePalette, 'access', _801 => _801.colorsByIndex, 'access', _802 => _802[0]]), () => ( SHEET_SURFACE));
|
|
12080
12158
|
}
|
|
12081
12159
|
function normalizeRange2(range) {
|
|
12082
12160
|
return {
|
|
@@ -12108,7 +12186,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
|
|
|
12108
12186
|
const visible2 = [];
|
|
12109
12187
|
const usedLimit = Math.min(displayLimit, Math.max(0, maxUsedIndex + 1));
|
|
12110
12188
|
for (let index = 0; index < usedLimit; index += 1) {
|
|
12111
|
-
if (!_optionalChain([hiddenIndices, 'optionalAccess',
|
|
12189
|
+
if (!_optionalChain([hiddenIndices, 'optionalAccess', _803 => _803.has, 'call', _804 => _804(index)])) {
|
|
12112
12190
|
visible2.push(index);
|
|
12113
12191
|
}
|
|
12114
12192
|
}
|
|
@@ -12150,7 +12228,7 @@ function clampPercent(value, fallback) {
|
|
|
12150
12228
|
return Math.max(0, Math.min(100, value));
|
|
12151
12229
|
}
|
|
12152
12230
|
function resolveShapeAdjustment(shape, name, fallback) {
|
|
12153
|
-
const rawValue = _optionalChain([shape, 'access',
|
|
12231
|
+
const rawValue = _optionalChain([shape, 'access', _805 => _805.geometryAdjustments, 'optionalAccess', _806 => _806[name]]);
|
|
12154
12232
|
if (typeof rawValue !== "number") {
|
|
12155
12233
|
return fallback;
|
|
12156
12234
|
}
|
|
@@ -13050,8 +13128,8 @@ function normalizeThumbnailResolution(resolution) {
|
|
|
13050
13128
|
}
|
|
13051
13129
|
const resolvedObject = typeof resolution === "object" && resolution ? resolution : void 0;
|
|
13052
13130
|
return {
|
|
13053
|
-
maxHeight: _optionalChain([resolvedObject, 'optionalAccess',
|
|
13054
|
-
maxWidth: _optionalChain([resolvedObject, 'optionalAccess',
|
|
13131
|
+
maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _807 => _807.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
|
|
13132
|
+
maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _808 => _808.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
|
|
13055
13133
|
};
|
|
13056
13134
|
}
|
|
13057
13135
|
function resolveThumbnailOutputSize(sourceWidth, sourceHeight, resolution) {
|
|
@@ -13370,24 +13448,24 @@ function escapeCssFontFamily(name) {
|
|
|
13370
13448
|
return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
|
|
13371
13449
|
}
|
|
13372
13450
|
function resolveSpreadsheetThemeFont(font, themePalette) {
|
|
13373
|
-
const scheme = typeof _optionalChain([font, 'optionalAccess',
|
|
13451
|
+
const scheme = typeof _optionalChain([font, 'optionalAccess', _809 => _809.scheme]) === "string" ? font.scheme : null;
|
|
13374
13452
|
if (scheme === "major") {
|
|
13375
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
13453
|
+
return _optionalChain([themePalette, 'optionalAccess', _810 => _810.majorLatinFont]);
|
|
13376
13454
|
}
|
|
13377
13455
|
if (scheme === "minor") {
|
|
13378
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
13456
|
+
return _optionalChain([themePalette, 'optionalAccess', _811 => _811.minorLatinFont]);
|
|
13379
13457
|
}
|
|
13380
13458
|
return void 0;
|
|
13381
13459
|
}
|
|
13382
13460
|
function buildSpreadsheetFontFamily(font, themePalette) {
|
|
13383
13461
|
const candidates = [
|
|
13384
|
-
typeof _optionalChain([font, 'optionalAccess',
|
|
13385
|
-
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call',
|
|
13462
|
+
typeof _optionalChain([font, 'optionalAccess', _812 => _812.name]) === "string" ? font.name.trim() : "",
|
|
13463
|
+
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _813 => _813(font, themePalette), 'optionalAccess', _814 => _814.trim, 'call', _815 => _815()]), () => ( ""))
|
|
13386
13464
|
].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
|
|
13387
13465
|
if (candidates.length === 0) {
|
|
13388
13466
|
return void 0;
|
|
13389
13467
|
}
|
|
13390
|
-
const primaryFont = _optionalChain([candidates, 'access',
|
|
13468
|
+
const primaryFont = _optionalChain([candidates, 'access', _816 => _816[0], 'optionalAccess', _817 => _817.toLowerCase, 'call', _818 => _818()]);
|
|
13391
13469
|
if (primaryFont === "calibri") {
|
|
13392
13470
|
return [
|
|
13393
13471
|
"Calibri",
|
|
@@ -13420,17 +13498,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
|
|
|
13420
13498
|
}
|
|
13421
13499
|
function buildGridlineShadow(color, options) {
|
|
13422
13500
|
const parts = [];
|
|
13423
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
13501
|
+
if (_optionalChain([options, 'optionalAccess', _819 => _819.right]) !== false) {
|
|
13424
13502
|
parts.push(`inset -1px 0 0 ${color}`);
|
|
13425
13503
|
}
|
|
13426
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
13504
|
+
if (_optionalChain([options, 'optionalAccess', _820 => _820.bottom]) !== false) {
|
|
13427
13505
|
parts.push(`inset 0 -1px 0 ${color}`);
|
|
13428
13506
|
}
|
|
13429
13507
|
return parts.join(", ");
|
|
13430
13508
|
}
|
|
13431
13509
|
function buildCellStyle(style, palette, themePalette, options) {
|
|
13432
|
-
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
13433
|
-
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
13510
|
+
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _821 => _821.showGridLines]), () => ( true));
|
|
13511
|
+
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _822 => _822.colorsByIndex, 'access', _823 => _823[0]]), () => ( SHEET_SURFACE));
|
|
13434
13512
|
const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
|
|
13435
13513
|
const css = {
|
|
13436
13514
|
backgroundColor: baseSurface,
|
|
@@ -13443,7 +13521,7 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
13443
13521
|
lineHeight: String(resolveSpreadsheetLineHeight(11)),
|
|
13444
13522
|
overflow: "hidden",
|
|
13445
13523
|
padding: DEFAULT_CELL_PADDING,
|
|
13446
|
-
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
13524
|
+
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _824 => _824.generalAlignment]), () => ( "left")),
|
|
13447
13525
|
textOverflow: "clip",
|
|
13448
13526
|
verticalAlign: "bottom",
|
|
13449
13527
|
whiteSpace: "nowrap"
|
|
@@ -13527,24 +13605,24 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
13527
13605
|
}
|
|
13528
13606
|
const border = style.border;
|
|
13529
13607
|
if (border) {
|
|
13530
|
-
const hasRightBorder = Boolean(_optionalChain([border, 'access',
|
|
13531
|
-
const hasBottomBorder = Boolean(_optionalChain([border, 'access',
|
|
13608
|
+
const hasRightBorder = Boolean(_optionalChain([border, 'access', _825 => _825.right, 'optionalAccess', _826 => _826.style]) && border.right.style !== "none");
|
|
13609
|
+
const hasBottomBorder = Boolean(_optionalChain([border, 'access', _827 => _827.bottom, 'optionalAccess', _828 => _828.style]) && border.bottom.style !== "none");
|
|
13532
13610
|
if (showGridLines && (hasRightBorder || hasBottomBorder)) {
|
|
13533
13611
|
css.boxShadow = buildGridlineShadow(palette.border, {
|
|
13534
13612
|
bottom: !hasBottomBorder,
|
|
13535
13613
|
right: !hasRightBorder
|
|
13536
13614
|
}) || void 0;
|
|
13537
13615
|
}
|
|
13538
|
-
if (_optionalChain([border, 'access',
|
|
13616
|
+
if (_optionalChain([border, 'access', _829 => _829.top, 'optionalAccess', _830 => _830.style]) && border.top.style !== "none") {
|
|
13539
13617
|
css.borderTop = mapBorder2(border.top, themePalette);
|
|
13540
13618
|
}
|
|
13541
|
-
if (_optionalChain([border, 'access',
|
|
13619
|
+
if (_optionalChain([border, 'access', _831 => _831.right, 'optionalAccess', _832 => _832.style]) && border.right.style !== "none") {
|
|
13542
13620
|
css.borderRight = mapBorder2(border.right, themePalette);
|
|
13543
13621
|
}
|
|
13544
|
-
if (_optionalChain([border, 'access',
|
|
13622
|
+
if (_optionalChain([border, 'access', _833 => _833.bottom, 'optionalAccess', _834 => _834.style]) && border.bottom.style !== "none") {
|
|
13545
13623
|
css.borderBottom = mapBorder2(border.bottom, themePalette);
|
|
13546
13624
|
}
|
|
13547
|
-
if (_optionalChain([border, 'access',
|
|
13625
|
+
if (_optionalChain([border, 'access', _835 => _835.left, 'optionalAccess', _836 => _836.style]) && border.left.style !== "none") {
|
|
13548
13626
|
css.borderLeft = mapBorder2(border.left, themePalette);
|
|
13549
13627
|
}
|
|
13550
13628
|
}
|
|
@@ -13569,12 +13647,12 @@ function measureTextWidth(value, style) {
|
|
|
13569
13647
|
context.font = buildCanvasFont(style);
|
|
13570
13648
|
return measureCanvasTextWidth(context, value);
|
|
13571
13649
|
}
|
|
13572
|
-
function getCellDisplayValue(worksheet, row, col, activeSheet) {
|
|
13650
|
+
function getCellDisplayValue(worksheet, row, col, activeSheet, locale = "en-US") {
|
|
13573
13651
|
const formula = worksheet.getFormulaAt(row, col);
|
|
13574
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
13652
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _837 => _837.cachedFormulaValues, 'optionalAccess', _838 => _838[cellAddressToA12({ row, col })]]) : void 0;
|
|
13575
13653
|
const formatted = worksheet.getFormattedValueAt(row, col);
|
|
13576
13654
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
13577
|
-
return decodeHtmlEntities2(formatted);
|
|
13655
|
+
return localizeCellNumber(worksheet, row, col, decodeHtmlEntities2(formatted), locale);
|
|
13578
13656
|
}
|
|
13579
13657
|
const cellValue = worksheet.getCalculatedValueAt(row, col);
|
|
13580
13658
|
if (formula && cachedFormulaValue !== void 0 && cellValue.is_error) {
|
|
@@ -13624,6 +13702,7 @@ function getBatchedCellNumericValue(cell) {
|
|
|
13624
13702
|
if (!cell) {
|
|
13625
13703
|
return null;
|
|
13626
13704
|
}
|
|
13705
|
+
if (cell.numericValue !== void 0) return cell.numericValue;
|
|
13627
13706
|
const text = cell.value.trim();
|
|
13628
13707
|
if (text.length === 0) {
|
|
13629
13708
|
return null;
|
|
@@ -13817,7 +13896,7 @@ function normalizeBatchedMergeSpan(value) {
|
|
|
13817
13896
|
}
|
|
13818
13897
|
function normalizeBatchedCellValue(rawValue, formula, row, col, activeSheet) {
|
|
13819
13898
|
const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
|
|
13820
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
13899
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _839 => _839.cachedFormulaValues, 'optionalAccess', _840 => _840[cellAddressToA12({ row, col })]]) : void 0;
|
|
13821
13900
|
if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
|
|
13822
13901
|
return cachedFormulaValue;
|
|
13823
13902
|
}
|
|
@@ -13839,6 +13918,7 @@ function buildWorksheetBatchWindow(rows, activeSheet, startRow, endRow) {
|
|
|
13839
13918
|
const formula = typeof cellEntry.formula === "string" ? cellEntry.formula : null;
|
|
13840
13919
|
cells.set(`${row}:${col}`, {
|
|
13841
13920
|
formula,
|
|
13921
|
+
numericValue: typeof cellEntry.numericValue === "number" ? cellEntry.numericValue : cellEntry.numericValue === null ? null : void 0,
|
|
13842
13922
|
generalAlignment: cellEntry.generalAlignment === "right" || cellEntry.generalAlignment === "center" ? cellEntry.generalAlignment : "left",
|
|
13843
13923
|
hyperlink: normalizeBatchedHyperlink(cellEntry.hyperlink),
|
|
13844
13924
|
isMergedSecondary: cellEntry.isMergedSecondary === true,
|
|
@@ -13863,31 +13943,31 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
13863
13943
|
..._nullishCoalesce(base, () => ( {})),
|
|
13864
13944
|
..._nullishCoalesce(overlay, () => ( {}))
|
|
13865
13945
|
};
|
|
13866
|
-
const baseAlignment = _optionalChain([base, 'optionalAccess',
|
|
13867
|
-
const overlayAlignment = _optionalChain([overlay, 'optionalAccess',
|
|
13946
|
+
const baseAlignment = _optionalChain([base, 'optionalAccess', _841 => _841.alignment]);
|
|
13947
|
+
const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _842 => _842.alignment]);
|
|
13868
13948
|
if (baseAlignment || overlayAlignment) {
|
|
13869
13949
|
nextStyle.alignment = {
|
|
13870
13950
|
..._nullishCoalesce(baseAlignment, () => ( {})),
|
|
13871
13951
|
..._nullishCoalesce(overlayAlignment, () => ( {}))
|
|
13872
13952
|
};
|
|
13873
13953
|
}
|
|
13874
|
-
const baseBorder = _optionalChain([base, 'optionalAccess',
|
|
13875
|
-
const overlayBorder = _optionalChain([overlay, 'optionalAccess',
|
|
13954
|
+
const baseBorder = _optionalChain([base, 'optionalAccess', _843 => _843.border]);
|
|
13955
|
+
const overlayBorder = _optionalChain([overlay, 'optionalAccess', _844 => _844.border]);
|
|
13876
13956
|
if (baseBorder || overlayBorder) {
|
|
13877
|
-
nextStyle.border = _optionalChain([options, 'optionalAccess',
|
|
13957
|
+
nextStyle.border = _optionalChain([options, 'optionalAccess', _845 => _845.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
|
|
13878
13958
|
..._nullishCoalesce(baseBorder, () => ( {})),
|
|
13879
13959
|
..._nullishCoalesce(overlayBorder, () => ( {}))
|
|
13880
13960
|
};
|
|
13881
13961
|
}
|
|
13882
|
-
const baseFill = _optionalChain([base, 'optionalAccess',
|
|
13883
|
-
const overlayFill = _optionalChain([overlay, 'optionalAccess',
|
|
13962
|
+
const baseFill = _optionalChain([base, 'optionalAccess', _846 => _846.fill]);
|
|
13963
|
+
const overlayFill = _optionalChain([overlay, 'optionalAccess', _847 => _847.fill]);
|
|
13884
13964
|
if (baseFill || overlayFill) {
|
|
13885
|
-
nextStyle.fill = _optionalChain([options, 'optionalAccess',
|
|
13965
|
+
nextStyle.fill = _optionalChain([options, 'optionalAccess', _848 => _848.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
|
|
13886
13966
|
}
|
|
13887
|
-
const baseFont = _optionalChain([base, 'optionalAccess',
|
|
13888
|
-
const overlayFont = _optionalChain([overlay, 'optionalAccess',
|
|
13967
|
+
const baseFont = _optionalChain([base, 'optionalAccess', _849 => _849.font]);
|
|
13968
|
+
const overlayFont = _optionalChain([overlay, 'optionalAccess', _850 => _850.font]);
|
|
13889
13969
|
if (baseFont || overlayFont) {
|
|
13890
|
-
nextStyle.font = _optionalChain([options, 'optionalAccess',
|
|
13970
|
+
nextStyle.font = _optionalChain([options, 'optionalAccess', _851 => _851.replaceXfSubtrees]) && overlayFont ? overlayFont : {
|
|
13891
13971
|
..._nullishCoalesce(baseFont, () => ( {})),
|
|
13892
13972
|
..._nullishCoalesce(overlayFont, () => ( {}))
|
|
13893
13973
|
};
|
|
@@ -14243,11 +14323,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
|
|
|
14243
14323
|
return literal;
|
|
14244
14324
|
}
|
|
14245
14325
|
const splitReference = splitSheetFormulaReference(normalized);
|
|
14246
|
-
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
14247
|
-
if (targetSheetName && _optionalChain([sheet, 'optionalAccess',
|
|
14326
|
+
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _852 => _852.sheetName]), () => ( null));
|
|
14327
|
+
if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _853 => _853.name]) && targetSheetName !== sheet.name) {
|
|
14248
14328
|
return literal;
|
|
14249
14329
|
}
|
|
14250
|
-
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
14330
|
+
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _854 => _854.range]), () => ( normalized));
|
|
14251
14331
|
const cell = parseA1CellReference3(cellRef.replace(/\$/g, ""));
|
|
14252
14332
|
if (!cell) {
|
|
14253
14333
|
return literal;
|
|
@@ -14279,8 +14359,8 @@ function normalizeConditionalTextOperand(value) {
|
|
|
14279
14359
|
}
|
|
14280
14360
|
function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
|
|
14281
14361
|
const normalizedRuleType = rule.ruleType.trim().toLowerCase();
|
|
14282
|
-
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
14283
|
-
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
14362
|
+
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _855 => _855.formulas, 'optionalAccess', _856 => _856[0]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
14363
|
+
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _857 => _857.formulas, 'optionalAccess', _858 => _858[1]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
14284
14364
|
if (normalizedRuleType === "cellis") {
|
|
14285
14365
|
return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
|
|
14286
14366
|
}
|
|
@@ -14311,7 +14391,7 @@ function getStyledConditionalRules(rules) {
|
|
|
14311
14391
|
return styledRules;
|
|
14312
14392
|
}
|
|
14313
14393
|
function resolveConditionalCellStyleForCell(row, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
|
|
14314
|
-
const rules = _optionalChain([sheet, 'optionalAccess',
|
|
14394
|
+
const rules = _optionalChain([sheet, 'optionalAccess', _859 => _859.conditionalFormatRules]);
|
|
14315
14395
|
if (!sheet || !rules || rules.length === 0) {
|
|
14316
14396
|
return null;
|
|
14317
14397
|
}
|
|
@@ -14515,11 +14595,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14515
14595
|
if (shape.paragraphs.length === 0) {
|
|
14516
14596
|
return;
|
|
14517
14597
|
}
|
|
14518
|
-
const inset = _optionalChain([shape, 'access',
|
|
14519
|
-
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14520
|
-
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14521
|
-
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14522
|
-
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14598
|
+
const inset = _optionalChain([shape, 'access', _860 => _860.textBox, 'optionalAccess', _861 => _861.insetPx]);
|
|
14599
|
+
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _862 => _862.left]), () => ( 6))) * zoomFactor;
|
|
14600
|
+
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _863 => _863.right]), () => ( 6))) * zoomFactor;
|
|
14601
|
+
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _864 => _864.top]), () => ( 4))) * zoomFactor;
|
|
14602
|
+
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _865 => _865.bottom]), () => ( 4))) * zoomFactor;
|
|
14523
14603
|
const textLeft = left + paddingLeft;
|
|
14524
14604
|
const textTop = top + paddingTop;
|
|
14525
14605
|
const textWidth = Math.max(0, width - paddingLeft - paddingRight);
|
|
@@ -14541,9 +14621,9 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14541
14621
|
});
|
|
14542
14622
|
const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
|
|
14543
14623
|
let y = textTop;
|
|
14544
|
-
if (_optionalChain([shape, 'access',
|
|
14624
|
+
if (_optionalChain([shape, 'access', _866 => _866.textBox, 'optionalAccess', _867 => _867.verticalAlign]) === "middle") {
|
|
14545
14625
|
y = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
|
|
14546
|
-
} else if (_optionalChain([shape, 'access',
|
|
14626
|
+
} else if (_optionalChain([shape, 'access', _868 => _868.textBox, 'optionalAccess', _869 => _869.verticalAlign]) === "bottom") {
|
|
14547
14627
|
y = textTop + Math.max(0, textHeight - totalTextHeight);
|
|
14548
14628
|
}
|
|
14549
14629
|
context.save();
|
|
@@ -14554,7 +14634,7 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14554
14634
|
shape.paragraphs.forEach((paragraph, paragraphIndex) => {
|
|
14555
14635
|
const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
|
|
14556
14636
|
let x = textLeft;
|
|
14557
|
-
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access',
|
|
14637
|
+
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _870 => _870.textBox, 'optionalAccess', _871 => _871.horizontalAlign]))), () => ( "left"));
|
|
14558
14638
|
if (align === "center") {
|
|
14559
14639
|
x = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
|
|
14560
14640
|
} else if (align === "right") {
|
|
@@ -14583,11 +14663,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14583
14663
|
context.restore();
|
|
14584
14664
|
}
|
|
14585
14665
|
function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
14586
|
-
const fillColor = _optionalChain([shape, 'access',
|
|
14587
|
-
const strokeColor = _optionalChain([shape, 'access',
|
|
14588
|
-
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access',
|
|
14666
|
+
const fillColor = _optionalChain([shape, 'access', _872 => _872.fill, 'optionalAccess', _873 => _873.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _874 => _874.fill, 'optionalAccess', _875 => _875.color]), () => ( "transparent"));
|
|
14667
|
+
const strokeColor = _optionalChain([shape, 'access', _876 => _876.stroke, 'optionalAccess', _877 => _877.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _878 => _878.stroke, 'optionalAccess', _879 => _879.color]), () => ( "transparent"));
|
|
14668
|
+
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _880 => _880.stroke, 'optionalAccess', _881 => _881.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
|
|
14589
14669
|
const vectorShape = resolveShapeVector(shape);
|
|
14590
|
-
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access',
|
|
14670
|
+
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _882 => _882.fill, 'optionalAccess', _883 => _883.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _884 => _884.stroke, 'optionalAccess', _885 => _885.opacity]), () => ( 1)));
|
|
14591
14671
|
context.save();
|
|
14592
14672
|
context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
14593
14673
|
if (shape.rotationDeg) {
|
|
@@ -14598,7 +14678,7 @@ function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
|
14598
14678
|
context.lineWidth = lineWidth;
|
|
14599
14679
|
context.strokeStyle = strokeColor;
|
|
14600
14680
|
context.fillStyle = fillColor;
|
|
14601
|
-
applyCanvasShapeDash(context, _optionalChain([shape, 'access',
|
|
14681
|
+
applyCanvasShapeDash(context, _optionalChain([shape, 'access', _886 => _886.stroke, 'optionalAccess', _887 => _887.dash]), lineWidth);
|
|
14602
14682
|
const localLeft = -rect.width / 2;
|
|
14603
14683
|
const localTop = -rect.height / 2;
|
|
14604
14684
|
if (vectorShape && typeof Path2D !== "undefined") {
|
|
@@ -14735,7 +14815,7 @@ function drawStaticFormControl(context, control, rect, palette, zoomFactor, shee
|
|
|
14735
14815
|
context.restore();
|
|
14736
14816
|
}
|
|
14737
14817
|
function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCache) {
|
|
14738
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
14818
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _888 => _888.conditionalFormatRules]), () => ( []));
|
|
14739
14819
|
const matchingRule = rules.find(
|
|
14740
14820
|
(rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
14741
14821
|
);
|
|
@@ -14773,23 +14853,23 @@ function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCac
|
|
|
14773
14853
|
const span = maxValue - minValue;
|
|
14774
14854
|
const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
|
|
14775
14855
|
const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
|
|
14776
|
-
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess',
|
|
14856
|
+
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _889 => _889.themePalette]));
|
|
14777
14857
|
if (!color || widthPercent <= 0) {
|
|
14778
14858
|
return null;
|
|
14779
14859
|
}
|
|
14780
14860
|
return {
|
|
14781
|
-
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess',
|
|
14861
|
+
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _890 => _890.themePalette])), () => ( void 0)),
|
|
14782
14862
|
border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
|
|
14783
|
-
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess',
|
|
14863
|
+
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _891 => _891.themePalette])), () => ( void 0)),
|
|
14784
14864
|
color,
|
|
14785
14865
|
gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
|
|
14786
|
-
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess',
|
|
14787
|
-
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess',
|
|
14866
|
+
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _892 => _892.themePalette])), () => ( void 0)),
|
|
14867
|
+
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _893 => _893.themePalette])), () => ( void 0)),
|
|
14788
14868
|
widthPercent
|
|
14789
14869
|
};
|
|
14790
14870
|
}
|
|
14791
14871
|
function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metricsCache) {
|
|
14792
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
14872
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _894 => _894.conditionalFormatRules]), () => ( []));
|
|
14793
14873
|
const matchingRule = rules.find(
|
|
14794
14874
|
(rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
14795
14875
|
);
|
|
@@ -14817,7 +14897,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
14817
14897
|
});
|
|
14818
14898
|
metricsCache.set(cacheKey, ruleValues);
|
|
14819
14899
|
}
|
|
14820
|
-
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess',
|
|
14900
|
+
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _895 => _895.themePalette]))).filter((color) => typeof color === "string");
|
|
14821
14901
|
const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
14822
14902
|
if (colors.length < 2 || thresholds.length < 2) {
|
|
14823
14903
|
return null;
|
|
@@ -14836,7 +14916,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
14836
14916
|
return { color: resolvedColor };
|
|
14837
14917
|
}
|
|
14838
14918
|
function resolveConditionalIconForCell(row, col, worksheet, sheet, metricsCache) {
|
|
14839
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
14919
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _896 => _896.conditionalFormatRules]), () => ( []));
|
|
14840
14920
|
const matchingRule = rules.find(
|
|
14841
14921
|
(rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
14842
14922
|
);
|
|
@@ -15123,7 +15203,7 @@ function GridRow({
|
|
|
15123
15203
|
whiteSpace: "nowrap",
|
|
15124
15204
|
width: "max-content"
|
|
15125
15205
|
} : null;
|
|
15126
|
-
const title = [_optionalChain([cellData, 'access',
|
|
15206
|
+
const title = [_optionalChain([cellData, 'access', _897 => _897.hyperlink, 'optionalAccess', _898 => _898.tooltip]), _optionalChain([cellData, 'access', _899 => _899.validation, 'optionalAccess', _900 => _900.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
|
|
15127
15207
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
15128
15208
|
"td",
|
|
15129
15209
|
{
|
|
@@ -15307,8 +15387,8 @@ var MemoGridRow = React4.memo(GridRow, (prev, next) => {
|
|
|
15307
15387
|
if (prev.actualRow !== next.actualRow || prev.rowHeight !== next.rowHeight || prev.headerLabelLiveScale !== next.headerLabelLiveScale || prev.palette !== next.palette || prev.readOnly !== next.readOnly || prev.visibleCols !== next.visibleCols || prev.leadingSpacerWidth !== next.leadingSpacerWidth || prev.rowHeaderWidth !== next.rowHeaderWidth || prev.stickyLeftByCol !== next.stickyLeftByCol || prev.stickyTop !== next.stickyTop || prev.trailingSpacerWidth !== next.trailingSpacerWidth || prev.zoomFactor !== next.zoomFactor || prev.getCellData !== next.getCellData || prev.onCellClick !== next.onCellClick || prev.onCellDoubleClick !== next.onCellDoubleClick || prev.onCellPointerDown !== next.onCellPointerDown || prev.onEditingBlur !== next.onEditingBlur || prev.onEditingCancel !== next.onEditingCancel || prev.onEditingCommit !== next.onEditingCommit || prev.onEditingNavigate !== next.onEditingNavigate || prev.onEditingValueChange !== next.onEditingValueChange || prev.onRowHeaderRef !== next.onRowHeaderRef || prev.onRowPointerDown !== next.onRowPointerDown || prev.onRowResizePointerDown !== next.onRowResizePointerDown || prev.renderCellAdornment !== next.renderCellAdornment) {
|
|
15308
15388
|
return false;
|
|
15309
15389
|
}
|
|
15310
|
-
const prevEditingCol = _optionalChain([prev, 'access',
|
|
15311
|
-
const nextEditingCol = _optionalChain([next, 'access',
|
|
15390
|
+
const prevEditingCol = _optionalChain([prev, 'access', _901 => _901.editingCell, 'optionalAccess', _902 => _902.row]) === prev.actualRow ? prev.editingCell.col : -1;
|
|
15391
|
+
const nextEditingCol = _optionalChain([next, 'access', _903 => _903.editingCell, 'optionalAccess', _904 => _904.row]) === next.actualRow ? next.editingCell.col : -1;
|
|
15312
15392
|
if (prevEditingCol !== nextEditingCol) {
|
|
15313
15393
|
return false;
|
|
15314
15394
|
}
|
|
@@ -15724,6 +15804,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15724
15804
|
getSheetFormControls,
|
|
15725
15805
|
getSheetImages,
|
|
15726
15806
|
getSheetShapes,
|
|
15807
|
+
locale,
|
|
15727
15808
|
workbook,
|
|
15728
15809
|
sheets
|
|
15729
15810
|
} = useXlsxViewer();
|
|
@@ -15745,6 +15826,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15745
15826
|
isMountedRef.current = false;
|
|
15746
15827
|
};
|
|
15747
15828
|
}, []);
|
|
15829
|
+
React4.useEffect(() => {
|
|
15830
|
+
workerThumbnailRowBatchCacheRef.current.clear();
|
|
15831
|
+
workerThumbnailRowBatchRequestRef.current.clear();
|
|
15832
|
+
setWorkerThumbnailRowBatchVersion((version) => version + 1);
|
|
15833
|
+
}, [locale]);
|
|
15748
15834
|
React4.useEffect(() => {
|
|
15749
15835
|
const currentSheets = new Set(sheets);
|
|
15750
15836
|
for (const sheet of workerThumbnailRowBatchCacheRef.current.keys()) {
|
|
@@ -15769,8 +15855,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15769
15855
|
const pendingRequest = workerThumbnailRowBatchRequestRef.current.get(sheet);
|
|
15770
15856
|
if (!pendingRequest) {
|
|
15771
15857
|
const request = {
|
|
15772
|
-
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
15773
|
-
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
15858
|
+
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _905 => _905.endRow]), () => ( endRow))),
|
|
15859
|
+
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _906 => _906.startRow]), () => ( startRow)))
|
|
15774
15860
|
};
|
|
15775
15861
|
workerThumbnailRowBatchRequestRef.current.set(sheet, request);
|
|
15776
15862
|
void getRowsBatchAsync(
|
|
@@ -15834,7 +15920,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15834
15920
|
}, []);
|
|
15835
15921
|
const thumbnails = React4.useMemo(() => {
|
|
15836
15922
|
return sheets.map((sheet, sheetIndex) => {
|
|
15837
|
-
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess',
|
|
15923
|
+
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _907 => _907.getSheet, 'call', _908 => _908(sheet.workbookSheetIndex)]), () => ( null));
|
|
15838
15924
|
const sheetImages = getSheetImages(sheetIndex).filter((image) => image.src).sort((left, right) => left.zIndex - right.zIndex);
|
|
15839
15925
|
const sheetShapes = getSheetShapes(sheetIndex);
|
|
15840
15926
|
const sheetFormControls = getSheetFormControls(sheetIndex).filter((control) => !control.hidden);
|
|
@@ -15850,18 +15936,18 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15850
15936
|
minRow: 0
|
|
15851
15937
|
}));
|
|
15852
15938
|
return {
|
|
15853
|
-
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15854
|
-
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15855
|
-
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15856
|
-
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15939
|
+
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _909 => _909.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
|
|
15940
|
+
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _910 => _910.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
|
|
15941
|
+
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _911 => _911.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
|
|
15942
|
+
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _912 => _912.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
|
|
15857
15943
|
};
|
|
15858
15944
|
}, null);
|
|
15859
15945
|
const sheetMinUsedRow = (_nullishCoalesce(sheet.maxUsedRow, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedRow, () => ( 0))) ? _nullishCoalesce(sheet.minUsedRow, () => ( 0)) : void 0;
|
|
15860
15946
|
const sheetMinUsedCol = (_nullishCoalesce(sheet.maxUsedCol, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedCol, () => ( 0))) ? _nullishCoalesce(sheet.minUsedCol, () => ( 0)) : void 0;
|
|
15861
|
-
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
15862
|
-
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
15863
|
-
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
15864
|
-
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
15947
|
+
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess', _913 => _913.minRow]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _914 => _914.minRow]), () => ( sheetMinUsedRow)), () => ( 0))));
|
|
15948
|
+
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess', _915 => _915.minCol]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _916 => _916.minCol]), () => ( sheetMinUsedCol)), () => ( 0))));
|
|
15949
|
+
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _917 => _917.maxRow]), () => ( -1)));
|
|
15950
|
+
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _918 => _918.maxCol]), () => ( -1)));
|
|
15865
15951
|
const showGridLines = _nullishCoalesce(sheet.showGridLines, () => ( true));
|
|
15866
15952
|
const hiddenRowSet = new Set(_nullishCoalesce(sheet.hiddenRows, () => ( [])));
|
|
15867
15953
|
const hiddenColSet = new Set(_nullishCoalesce(sheet.hiddenCols, () => ( [])));
|
|
@@ -16074,8 +16160,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16074
16160
|
return cached;
|
|
16075
16161
|
}
|
|
16076
16162
|
const batchCoversRow = workerRowBatch ? row >= workerRowBatch.startRow && row <= workerRowBatch.endRow : false;
|
|
16077
|
-
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess',
|
|
16078
|
-
if (_optionalChain([batchedCell, 'optionalAccess',
|
|
16163
|
+
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _919 => _919.cells, 'access', _920 => _920.get, 'call', _921 => _921(cacheKey)]) : void 0;
|
|
16164
|
+
if (_optionalChain([batchedCell, 'optionalAccess', _922 => _922.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _923 => _923.isMergedSecondary, 'call', _924 => _924(row, col)])) {
|
|
16079
16165
|
const mergedSecondaryData = {
|
|
16080
16166
|
isMergedSecondary: true,
|
|
16081
16167
|
style: {},
|
|
@@ -16084,23 +16170,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16084
16170
|
cellRenderCache.set(cacheKey, mergedSecondaryData);
|
|
16085
16171
|
return mergedSecondaryData;
|
|
16086
16172
|
}
|
|
16087
|
-
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
16173
|
+
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _925 => _925.mergeSpan]);
|
|
16088
16174
|
const inheritedStyle = resolveInheritedCellStyle2(sheet, row, col);
|
|
16089
|
-
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
16175
|
+
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _926 => _926.style]), () => ( null));
|
|
16090
16176
|
const mergedStyle = mergeResolvedCellStyle(inheritedStyle, worksheetStyle, { replaceXfSubtrees: true });
|
|
16091
16177
|
const conditionalCellStyle = resolveConditionalCellStyleForCell(
|
|
16092
16178
|
row,
|
|
16093
16179
|
col,
|
|
16094
16180
|
sheet,
|
|
16095
16181
|
() => worksheet ? getCellNumericValue(worksheet, row, col) : getBatchedCellNumericValue(batchedCell),
|
|
16096
|
-
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
16182
|
+
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _927 => _927.value]), () => ( "")),
|
|
16097
16183
|
worksheet,
|
|
16098
|
-
_optionalChain([workerRowBatch, 'optionalAccess',
|
|
16184
|
+
_optionalChain([workerRowBatch, 'optionalAccess', _928 => _928.cells])
|
|
16099
16185
|
);
|
|
16100
16186
|
const finalResolvedStyle = mergeResolvedCellStyle(mergedStyle, conditionalCellStyle);
|
|
16101
|
-
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
16187
|
+
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _929 => _929.alignment]);
|
|
16102
16188
|
const sparkline = _nullishCoalesce(sparklineByCell.get(cacheKey), () => ( null));
|
|
16103
|
-
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess',
|
|
16189
|
+
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess', _930 => _930.cells, 'access', _931 => _931.get, 'call', _932 => _932(`${targetRow}:${targetCol}`)]));
|
|
16104
16190
|
const sparklineValues = sparkline ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
|
|
16105
16191
|
{ length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
|
|
16106
16192
|
(_, index) => getNumericValue(
|
|
@@ -16114,23 +16200,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16114
16200
|
sparkline.range.start.col
|
|
16115
16201
|
)
|
|
16116
16202
|
) : null;
|
|
16117
|
-
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
16203
|
+
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _933 => _933.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
|
|
16118
16204
|
const nextData = {
|
|
16119
16205
|
canvas: void 0,
|
|
16120
16206
|
checkboxState,
|
|
16121
|
-
colSpan: _optionalChain([merge, 'optionalAccess',
|
|
16207
|
+
colSpan: _optionalChain([merge, 'optionalAccess', _934 => _934.colSpan]),
|
|
16122
16208
|
conditionalColorScale: worksheet ? resolveConditionalColorScaleForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
16123
16209
|
conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
16124
16210
|
conditionalIcon: worksheet ? resolveConditionalIconForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
16125
16211
|
isMergedSecondary: false,
|
|
16126
|
-
rowSpan: _optionalChain([merge, 'optionalAccess',
|
|
16212
|
+
rowSpan: _optionalChain([merge, 'optionalAccess', _935 => _935.rowSpan]),
|
|
16127
16213
|
sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
|
|
16128
16214
|
style: buildCellStyle(finalResolvedStyle, palette, sheet.themePalette, {
|
|
16129
|
-
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
16215
|
+
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _936 => _936.generalAlignment]),
|
|
16130
16216
|
showGridLines
|
|
16131
16217
|
}),
|
|
16132
|
-
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess',
|
|
16133
|
-
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
16218
|
+
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _937 => _937.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _938 => _938.textRotation])))),
|
|
16219
|
+
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _939 => _939.value]), () => ( ""))
|
|
16134
16220
|
};
|
|
16135
16221
|
nextData.canvas = buildCanvasCellStyleCache(nextData.style);
|
|
16136
16222
|
cellRenderCache.set(cacheKey, nextData);
|
|
@@ -16148,11 +16234,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16148
16234
|
let height = rowItem.size;
|
|
16149
16235
|
for (let colOffset = 1; colOffset < colSpan; colOffset += 1) {
|
|
16150
16236
|
const nextCol = colItemByActual.get(colItem.actualIndex + colOffset);
|
|
16151
|
-
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess',
|
|
16237
|
+
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _940 => _940.size]), () => ( 0));
|
|
16152
16238
|
}
|
|
16153
16239
|
for (let rowOffset = 1; rowOffset < rowSpan; rowOffset += 1) {
|
|
16154
16240
|
const nextRow = rowItemByActual.get(rowItem.actualIndex + rowOffset);
|
|
16155
|
-
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess',
|
|
16241
|
+
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _941 => _941.size]), () => ( 0));
|
|
16156
16242
|
}
|
|
16157
16243
|
const rect = {
|
|
16158
16244
|
height,
|
|
@@ -16162,7 +16248,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16162
16248
|
};
|
|
16163
16249
|
const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellData.style)));
|
|
16164
16250
|
const gradientFill = typeof cellData.style.backgroundImage === "string" ? resolveCanvasGradientFill(context, rect, cellData.style.backgroundImage) : null;
|
|
16165
|
-
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access',
|
|
16251
|
+
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _942 => _942.conditionalColorScale, 'optionalAccess', _943 => _943.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
|
|
16166
16252
|
context.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
|
|
16167
16253
|
context.fillRect(rect.left, rect.top, rect.width, rect.height);
|
|
16168
16254
|
if (cellData.conditionalDataBar) {
|
|
@@ -16402,10 +16488,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16402
16488
|
sheets,
|
|
16403
16489
|
thumbnailImageLoadVersion,
|
|
16404
16490
|
workerThumbnailRowBatchVersion,
|
|
16491
|
+
locale,
|
|
16405
16492
|
workbook
|
|
16406
16493
|
]);
|
|
16407
16494
|
const paintThumbnail = React4.useCallback(
|
|
16408
|
-
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access',
|
|
16495
|
+
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _944 => _944[sheetIndex], 'optionalAccess', _945 => _945.paint, 'call', _946 => _946(canvas)]), () => ( false)),
|
|
16409
16496
|
[thumbnails]
|
|
16410
16497
|
);
|
|
16411
16498
|
return React4.useMemo(
|
|
@@ -16464,7 +16551,7 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
|
|
|
16464
16551
|
}
|
|
16465
16552
|
destroy() {
|
|
16466
16553
|
this.destroyed = true;
|
|
16467
|
-
_optionalChain([this, 'access',
|
|
16554
|
+
_optionalChain([this, 'access', _947 => _947.observer, 'optionalAccess', _948 => _948.disconnect, 'call', _949 => _949()]);
|
|
16468
16555
|
this.observer = null;
|
|
16469
16556
|
this.slots.clear();
|
|
16470
16557
|
this.listeners.clear();
|
|
@@ -16506,7 +16593,7 @@ function RuntimeContent({ content }) {
|
|
|
16506
16593
|
};
|
|
16507
16594
|
}, []);
|
|
16508
16595
|
React5.useLayoutEffect(() => {
|
|
16509
|
-
_optionalChain([rootRef, 'access',
|
|
16596
|
+
_optionalChain([rootRef, 'access', _950 => _950.current, 'optionalAccess', _951 => _951.update, 'call', _952 => _952(content)]);
|
|
16510
16597
|
}, [content]);
|
|
16511
16598
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref: hostRef, style: { display: "contents" } });
|
|
16512
16599
|
}
|
|
@@ -16568,7 +16655,7 @@ function BoundViewer({ props, controller }) {
|
|
|
16568
16655
|
}, [slots]);
|
|
16569
16656
|
React5.useLayoutEffect(() => {
|
|
16570
16657
|
const host = hostRef.current;
|
|
16571
|
-
if (host) _optionalChain([viewerRef, 'access',
|
|
16658
|
+
if (host) _optionalChain([viewerRef, 'access', _953 => _953.current, 'optionalAccess', _954 => _954.update, 'call', _955 => _955(renderOptions(props, controller, slots, host.ownerDocument))]);
|
|
16572
16659
|
}, [controller, props, slots]);
|
|
16573
16660
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ViewerAppearanceContext.Provider, { value: {
|
|
16574
16661
|
headerBackgroundColor: props.headerBackgroundColor,
|