@extend-ai/react-xlsx 0.20.3 → 0.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{browser-B73UAN6E.cjs → browser-6MKX73CJ.cjs} +8 -28
- package/dist/browser-6MKX73CJ.cjs.map +1 -0
- package/dist/{browser-KWIEUO2X.js → browser-KJ6EVWLG.js} +8 -27
- package/dist/{browser-KWIEUO2X.js.map → browser-KJ6EVWLG.js.map} +1 -1
- package/dist/{chart-renderer-XBF7EPUS.js → chart-renderer-2BLFC2BD.js} +94 -180
- package/dist/chart-renderer-2BLFC2BD.js.map +1 -0
- package/dist/{chart-renderer-W7XW24JI.cjs → chart-renderer-2K7XSPVG.cjs} +321 -407
- package/dist/chart-renderer-2K7XSPVG.cjs.map +1 -0
- package/dist/{chart-renderer-2EKXNHUD.cjs → chart-renderer-2UJZRUSN.cjs} +324 -410
- package/dist/chart-renderer-2UJZRUSN.cjs.map +1 -0
- package/dist/{chart-renderer-ZLJVPLGN.js → chart-renderer-IYKCQENY.js} +86 -172
- package/dist/chart-renderer-IYKCQENY.js.map +1 -0
- package/dist/{chunk-WGRRI25I.cjs → chunk-5PBSOOA7.cjs} +22 -9
- package/dist/chunk-5PBSOOA7.cjs.map +1 -0
- package/dist/{chunk-VG4JELEQ.js → chunk-BFSDKYQU.js} +30 -15
- package/dist/chunk-BFSDKYQU.js.map +1 -0
- package/dist/chunk-IN7OU5PF.js +32 -0
- package/dist/chunk-IN7OU5PF.js.map +1 -0
- package/dist/{chunk-HKMFMIKE.js → chunk-KSXNNWAY.js} +16 -7
- package/dist/chunk-KSXNNWAY.js.map +1 -0
- package/dist/chunk-LY4EWUKF.js +22 -0
- package/dist/chunk-LY4EWUKF.js.map +1 -0
- package/dist/chunk-N6MMMGLF.cjs +32 -0
- package/dist/chunk-N6MMMGLF.cjs.map +1 -0
- package/dist/{chunk-HEEFCVWS.js → chunk-R5ERJ3BT.js} +404 -149
- package/dist/chunk-R5ERJ3BT.js.map +1 -0
- package/dist/chunk-RN27VSTN.cjs +108 -0
- package/dist/chunk-RN27VSTN.cjs.map +1 -0
- package/dist/{chunk-XISBYOD5.cjs → chunk-YPTGD7GK.cjs} +1172 -917
- package/dist/chunk-YPTGD7GK.cjs.map +1 -0
- package/dist/chunk-ZAUUKER4.cjs +22 -0
- package/dist/chunk-ZAUUKER4.cjs.map +1 -0
- package/dist/full-C7H4X2EX.cjs +212 -0
- package/dist/full-C7H4X2EX.cjs.map +1 -0
- package/dist/full-YT626I57.js +209 -0
- package/dist/full-YT626I57.js.map +1 -0
- package/dist/index.cjs +838 -620
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +350 -132
- package/dist/index.js.map +1 -1
- package/dist/{internal-BJsg5os3.d.cts → internal-Cks9H21d.d.cts} +56 -1
- package/dist/{internal-BJsg5os3.d.ts → internal-Cks9H21d.d.ts} +56 -1
- package/dist/internal.cjs +4 -3
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +3 -2
- package/dist/office_charts_bg.wasm +0 -0
- package/dist/office_charts_full_bg.wasm +0 -0
- package/dist/payload-7QT6NY6S.js +6 -0
- package/dist/payload-7QT6NY6S.js.map +1 -0
- package/dist/payload-BZGBW73P.cjs +8 -0
- package/dist/payload-BZGBW73P.cjs.map +1 -0
- package/dist/payload-H55PON66.js +6 -0
- package/dist/payload-H55PON66.js.map +1 -0
- package/dist/payload-RNKEYTQ4.cjs +8 -0
- package/dist/payload-RNKEYTQ4.cjs.map +1 -0
- package/dist/{shared-chart-DVC5S2P6.cjs → shared-chart-GCUFIUQL.cjs} +49 -20
- package/dist/shared-chart-GCUFIUQL.cjs.map +1 -0
- package/dist/{shared-chart-3STFRVWT.js → shared-chart-JV4MGKXX.js} +50 -20
- package/dist/shared-chart-JV4MGKXX.js.map +1 -0
- package/dist/{shared-chart-MFQSQG4K.cjs → shared-chart-OUC7EHFC.cjs} +49 -19
- package/dist/shared-chart-OUC7EHFC.cjs.map +1 -0
- package/dist/{shared-chart-BFQNYOIQ.js → shared-chart-PY47ED4I.js} +49 -20
- package/dist/shared-chart-PY47ED4I.js.map +1 -0
- package/dist/{surface-regl-R2N54JT2.js → surface-webgl-2ZZ6JQR2.js} +87 -151
- package/dist/surface-webgl-2ZZ6JQR2.js.map +1 -0
- package/dist/{surface-regl-BBJ6OIKK.cjs → surface-webgl-3HS6VBCK.cjs} +88 -152
- package/dist/surface-webgl-3HS6VBCK.cjs.map +1 -0
- package/dist/{surface-regl-7CDGGVDG.js → surface-webgl-4DQXDDXU.js} +87 -151
- package/dist/surface-webgl-4DQXDDXU.js.map +1 -0
- package/dist/{surface-regl-SUJ2TFZA.cjs → surface-webgl-SVYD564V.cjs} +88 -152
- package/dist/surface-webgl-SVYD564V.cjs.map +1 -0
- package/dist/vanilla.cjs +4 -3
- package/dist/vanilla.cjs.map +1 -1
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +3 -2
- package/dist/xlsx-worker.js +298 -92
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +6 -15
- package/dist/browser-B73UAN6E.cjs.map +0 -1
- package/dist/chart-renderer-2EKXNHUD.cjs.map +0 -1
- package/dist/chart-renderer-W7XW24JI.cjs.map +0 -1
- package/dist/chart-renderer-XBF7EPUS.js.map +0 -1
- package/dist/chart-renderer-ZLJVPLGN.js.map +0 -1
- package/dist/chunk-6IGWCJU5.cjs +0 -90
- package/dist/chunk-6IGWCJU5.cjs.map +0 -1
- package/dist/chunk-HEEFCVWS.js.map +0 -1
- package/dist/chunk-HKMFMIKE.js.map +0 -1
- package/dist/chunk-VG4JELEQ.js.map +0 -1
- package/dist/chunk-WGRRI25I.cjs.map +0 -1
- package/dist/chunk-XISBYOD5.cjs.map +0 -1
- package/dist/payload-JBPE7GEG.cjs +0 -8
- package/dist/payload-JBPE7GEG.cjs.map +0 -1
- package/dist/payload-KYNCVJT5.js +0 -6
- package/dist/payload-KYNCVJT5.js.map +0 -1
- package/dist/region-map-geography-24TXETDP.cjs +0 -184
- package/dist/region-map-geography-24TXETDP.cjs.map +0 -1
- package/dist/region-map-geography-OR6DHAF7.js +0 -182
- package/dist/region-map-geography-OR6DHAF7.js.map +0 -1
- package/dist/shared-chart-3STFRVWT.js.map +0 -1
- package/dist/shared-chart-BFQNYOIQ.js.map +0 -1
- package/dist/shared-chart-DVC5S2P6.cjs.map +0 -1
- package/dist/shared-chart-MFQSQG4K.cjs.map +0 -1
- package/dist/surface-regl-7CDGGVDG.js.map +0 -1
- package/dist/surface-regl-BBJ6OIKK.cjs.map +0 -1
- package/dist/surface-regl-R2N54JT2.js.map +0 -1
- package/dist/surface-regl-SUJ2TFZA.cjs.map +0 -1
- package/dist/world-atlas-LICENSE.txt +0 -13
- /package/dist/{us-atlas-LICENSE.txt → rust-office-charts-MAP-DATA-LICENSE.txt} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
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;
|
|
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;
|
|
2
|
+
|
|
3
|
+
var _chunkZAUUKER4cjs = require('./chunk-ZAUUKER4.cjs');
|
|
4
|
+
require('./chunk-5PBSOOA7.cjs');
|
|
2
5
|
|
|
3
6
|
|
|
4
7
|
|
|
@@ -71,29 +74,83 @@ function localizeCellNumber(worksheet, row, col, text, locale = "en-US") {
|
|
|
71
74
|
);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
// src/spreadsheet-fonts.ts
|
|
75
|
-
var fontLoadPromise;
|
|
76
|
-
var SPREADSHEET_FALLBACK_FONT = "React XLSX Carlito";
|
|
77
|
-
function loadSpreadsheetFonts() {
|
|
78
|
-
if (typeof document === "undefined" || typeof FontFace === "undefined") {
|
|
79
|
-
return Promise.resolve();
|
|
80
|
-
}
|
|
81
|
-
return fontLoadPromise ??= Promise.resolve().then(() => _interopRequireWildcard(require("./spreadsheet-font-assets-6FKCVICP.cjs"))).then(async ({ spreadsheetFontFaces }) => {
|
|
82
|
-
await Promise.allSettled(spreadsheetFontFaces.map(async ({ source, ...descriptors }) => {
|
|
83
|
-
const face = new FontFace(SPREADSHEET_FALLBACK_FONT, `url(${JSON.stringify(source)})`, descriptors);
|
|
84
|
-
await face.load();
|
|
85
|
-
document.fonts.add(face);
|
|
86
|
-
}));
|
|
87
|
-
}).catch(() => {
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
77
|
// src/controller.tsx
|
|
92
78
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
93
79
|
var _internal = require('@extend-ai/react-xlsx/internal');
|
|
94
80
|
|
|
95
81
|
var _fflate = require('fflate');
|
|
96
82
|
|
|
83
|
+
// src/chartsheet-payload.ts
|
|
84
|
+
|
|
85
|
+
var REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
86
|
+
function readXml(archive, path) {
|
|
87
|
+
const bytes = archive[path];
|
|
88
|
+
if (!bytes || typeof DOMParser === "undefined") return null;
|
|
89
|
+
const document2 = new DOMParser().parseFromString(_fflate.strFromU8.call(void 0, bytes), "application/xml");
|
|
90
|
+
return document2.getElementsByTagName("parsererror").length > 0 ? null : document2;
|
|
91
|
+
}
|
|
92
|
+
function relationshipPath(partPath) {
|
|
93
|
+
const separator = partPath.lastIndexOf("/");
|
|
94
|
+
return `${partPath.slice(0, separator + 1)}_rels/${partPath.slice(separator + 1)}.rels`;
|
|
95
|
+
}
|
|
96
|
+
function resolveTarget(partPath, target) {
|
|
97
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(target) || target.startsWith("//")) return null;
|
|
98
|
+
const segments = target.startsWith("/") ? [] : partPath.split("/").slice(0, -1);
|
|
99
|
+
for (const segment of target.replace(/\\/g, "/").split("/")) {
|
|
100
|
+
if (!segment || segment === ".") continue;
|
|
101
|
+
if (segment === "..") {
|
|
102
|
+
if (segments.length === 0) return null;
|
|
103
|
+
segments.pop();
|
|
104
|
+
} else {
|
|
105
|
+
segments.push(segment);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return segments.join("/");
|
|
109
|
+
}
|
|
110
|
+
function readRelationships(archive, partPath) {
|
|
111
|
+
const relationships = /* @__PURE__ */ new Map();
|
|
112
|
+
const document2 = readXml(archive, relationshipPath(partPath));
|
|
113
|
+
for (const element of Array.from(_nullishCoalesce(_optionalChain([document2, 'optionalAccess', _17 => _17.getElementsByTagNameNS, 'call', _18 => _18("*", "Relationship")]), () => ( [])))) {
|
|
114
|
+
if (element.getAttribute("TargetMode") === "External") continue;
|
|
115
|
+
const id = element.getAttribute("Id");
|
|
116
|
+
const rawTarget = element.getAttribute("Target");
|
|
117
|
+
const type = element.getAttribute("Type");
|
|
118
|
+
const target = rawTarget ? resolveTarget(partPath, rawTarget) : null;
|
|
119
|
+
if (id && type && target && archive[target]) relationships.set(id, { target, type });
|
|
120
|
+
}
|
|
121
|
+
return relationships;
|
|
122
|
+
}
|
|
123
|
+
function collectChartsheetDrawingOrigins(archive, chartsheets) {
|
|
124
|
+
const origins = /* @__PURE__ */ new Map();
|
|
125
|
+
if (chartsheets.length === 0) return origins;
|
|
126
|
+
const workbookPath = "xl/workbook.xml";
|
|
127
|
+
const workbookDocument = readXml(archive, workbookPath);
|
|
128
|
+
const workbookRelationships = readRelationships(archive, workbookPath);
|
|
129
|
+
for (const sheet of Array.from(_nullishCoalesce(_optionalChain([workbookDocument, 'optionalAccess', _19 => _19.getElementsByTagNameNS, 'call', _20 => _20("*", "sheet")]), () => ( [])))) {
|
|
130
|
+
const relationshipId = _nullishCoalesce(sheet.getAttributeNS(REL_NS, "id"), () => ( sheet.getAttribute("r:id")));
|
|
131
|
+
const relationship = relationshipId ? workbookRelationships.get(relationshipId) : null;
|
|
132
|
+
if (!_optionalChain([relationship, 'optionalAccess', _21 => _21.type, 'access', _22 => _22.endsWith, 'call', _23 => _23("/chartsheet")])) continue;
|
|
133
|
+
const chartsheet = chartsheets.find((entry) => entry.name === sheet.getAttribute("name"));
|
|
134
|
+
if (!chartsheet || chartsheet.workbookSheetIndex == null) continue;
|
|
135
|
+
const sheetDocument = readXml(archive, relationship.target);
|
|
136
|
+
const sheetRelationships = readRelationships(archive, relationship.target);
|
|
137
|
+
const attachments = [];
|
|
138
|
+
for (const drawing of Array.from(_nullishCoalesce(_optionalChain([sheetDocument, 'optionalAccess', _24 => _24.getElementsByTagNameNS, 'call', _25 => _25("*", "drawing")]), () => ( [])))) {
|
|
139
|
+
const drawingId = _nullishCoalesce(drawing.getAttributeNS(REL_NS, "id"), () => ( drawing.getAttribute("r:id")));
|
|
140
|
+
const drawingRelationship = drawingId ? sheetRelationships.get(drawingId) : null;
|
|
141
|
+
if (!_optionalChain([drawingRelationship, 'optionalAccess', _26 => _26.type, 'access', _27 => _27.endsWith, 'call', _28 => _28("/drawing")])) continue;
|
|
142
|
+
const drawingRelsPath = relationshipPath(drawingRelationship.target);
|
|
143
|
+
attachments.push({
|
|
144
|
+
drawingPath: drawingRelationship.target,
|
|
145
|
+
drawingRelsPath: archive[drawingRelsPath] ? drawingRelsPath : null,
|
|
146
|
+
mediaPaths: []
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
origins.set(chartsheet.index, { attachments, workbookSheetIndex: chartsheet.workbookSheetIndex });
|
|
150
|
+
}
|
|
151
|
+
return origins;
|
|
152
|
+
}
|
|
153
|
+
|
|
97
154
|
// src/charts.ts
|
|
98
155
|
|
|
99
156
|
var CHART_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
@@ -185,19 +242,19 @@ function splitTopLevelSeriesArguments(value) {
|
|
|
185
242
|
}
|
|
186
243
|
function readSeriesNameFormula(series) {
|
|
187
244
|
const raw = series.raw && typeof series.raw === "object" ? series.raw : null;
|
|
188
|
-
return typeof _optionalChain([raw, 'optionalAccess',
|
|
245
|
+
return typeof _optionalChain([raw, 'optionalAccess', _29 => _29.name]) === "string" && raw.name.length > 0 ? raw.name : null;
|
|
189
246
|
}
|
|
190
247
|
function buildChartSeriesFormula(chart, seriesIndex) {
|
|
191
|
-
const series = _optionalChain([chart, 'optionalAccess',
|
|
248
|
+
const series = _optionalChain([chart, 'optionalAccess', _30 => _30.series, 'access', _31 => _31[seriesIndex]]);
|
|
192
249
|
if (!chart || !series) {
|
|
193
250
|
return "";
|
|
194
251
|
}
|
|
195
252
|
const nameFormula = readSeriesNameFormula(series);
|
|
196
253
|
const nameArgument = _nullishCoalesce(nameFormula, () => ( quoteSeriesFormulaString(_nullishCoalesce(series.name, () => ( `Series ${seriesIndex + 1}`)))));
|
|
197
|
-
const categoryArgument = _nullishCoalesce(_optionalChain([series, 'access',
|
|
198
|
-
const valueArgument = _nullishCoalesce(_optionalChain([series, 'access',
|
|
254
|
+
const categoryArgument = _nullishCoalesce(_optionalChain([series, 'access', _32 => _32.categoriesRef, 'optionalAccess', _33 => _33.formula]), () => ( ""));
|
|
255
|
+
const valueArgument = _nullishCoalesce(_optionalChain([series, 'access', _34 => _34.valuesRef, 'optionalAccess', _35 => _35.formula]), () => ( ""));
|
|
199
256
|
const orderArgument = String(seriesIndex + 1);
|
|
200
|
-
const bubbleArgument = _optionalChain([series, 'access',
|
|
257
|
+
const bubbleArgument = _optionalChain([series, 'access', _36 => _36.bubbleSizeRef, 'optionalAccess', _37 => _37.formula]);
|
|
201
258
|
return [
|
|
202
259
|
`=SERIES(${nameArgument}`,
|
|
203
260
|
categoryArgument,
|
|
@@ -214,7 +271,7 @@ function parseChartSeriesFormula(formula, chart) {
|
|
|
214
271
|
return null;
|
|
215
272
|
}
|
|
216
273
|
const args = splitTopLevelSeriesArguments(match[1]);
|
|
217
|
-
const isBubble = _optionalChain([chart, 'optionalAccess',
|
|
274
|
+
const isBubble = _optionalChain([chart, 'optionalAccess', _38 => _38.chartType]) === "Bubble";
|
|
218
275
|
if (args.length < 4 || args.length > 5 || isBubble && args.length !== 5) {
|
|
219
276
|
return null;
|
|
220
277
|
}
|
|
@@ -244,18 +301,33 @@ function applyChartSeriesFormula(chart, seriesIndex, formula, workbook) {
|
|
|
244
301
|
}
|
|
245
302
|
const categoriesRef = {
|
|
246
303
|
..._nullishCoalesce(currentSeries.categoriesRef, () => ( {})),
|
|
247
|
-
formula: parsed.categoryFormula
|
|
304
|
+
formula: parsed.categoryFormula,
|
|
305
|
+
values: parsed.categoryFormula === _optionalChain([currentSeries, 'access', _39 => _39.categoriesRef, 'optionalAccess', _40 => _40.formula]) ? currentSeries.categoriesRef.values : void 0
|
|
248
306
|
};
|
|
249
307
|
const valuesRef = {
|
|
250
308
|
..._nullishCoalesce(currentSeries.valuesRef, () => ( {})),
|
|
251
|
-
formula: parsed.valueFormula
|
|
309
|
+
formula: parsed.valueFormula,
|
|
310
|
+
values: parsed.valueFormula === _optionalChain([currentSeries, 'access', _41 => _41.valuesRef, 'optionalAccess', _42 => _42.formula]) ? currentSeries.valuesRef.values : void 0
|
|
252
311
|
};
|
|
253
312
|
const bubbleSizeRef = chart.chartType === "Bubble" || parsed.bubbleSizeFormula ? {
|
|
254
313
|
..._nullishCoalesce(currentSeries.bubbleSizeRef, () => ( {})),
|
|
255
|
-
formula: parsed.bubbleSizeFormula
|
|
314
|
+
formula: parsed.bubbleSizeFormula,
|
|
315
|
+
values: parsed.bubbleSizeFormula === _optionalChain([currentSeries, 'access', _43 => _43.bubbleSizeRef, 'optionalAccess', _44 => _44.formula]) ? _optionalChain([currentSeries, 'access', _45 => _45.bubbleSizeRef, 'optionalAccess', _46 => _46.values]) : void 0
|
|
256
316
|
} : _nullishCoalesce(currentSeries.bubbleSizeRef, () => ( null));
|
|
317
|
+
const isUnresolved = (formula2) => Boolean(
|
|
318
|
+
workbook && formula2 && !resolveReferenceSheet(workbook, chart.workbookSheetIndex, formula2).sheet
|
|
319
|
+
);
|
|
320
|
+
const resolveEditedReference = (reference, currentReference, currentValues, mode) => {
|
|
321
|
+
if (!workbook) return currentValues;
|
|
322
|
+
if (_optionalChain([reference, 'optionalAccess', _47 => _47.formula]) === _optionalChain([currentReference, 'optionalAccess', _48 => _48.formula]) && isUnresolved(_optionalChain([reference, 'optionalAccess', _49 => _49.formula]))) return currentValues;
|
|
323
|
+
return resolveReferenceValues(workbook, chart.workbookSheetIndex, reference, mode);
|
|
324
|
+
};
|
|
257
325
|
const raw = {
|
|
258
|
-
..._nullishCoalesce(currentSeries.raw, () => ( {}))
|
|
326
|
+
..._nullishCoalesce(currentSeries.raw, () => ( {})),
|
|
327
|
+
unresolvedCategoriesReference: isUnresolved(categoriesRef.formula),
|
|
328
|
+
unresolvedValuesReference: isUnresolved(valuesRef.formula),
|
|
329
|
+
unresolvedBubbleSizeReference: isUnresolved(_optionalChain([bubbleSizeRef, 'optionalAccess', _50 => _50.formula])),
|
|
330
|
+
unresolvedNameReference: isUnresolved(parsed.nameFormula)
|
|
259
331
|
};
|
|
260
332
|
if (parsed.nameFormula) {
|
|
261
333
|
raw.name = parsed.nameFormula;
|
|
@@ -265,17 +337,21 @@ function applyChartSeriesFormula(chart, seriesIndex, formula, workbook) {
|
|
|
265
337
|
const nextSeries = {
|
|
266
338
|
...currentSeries,
|
|
267
339
|
bubbleSizeRef,
|
|
268
|
-
bubbleSizes:
|
|
269
|
-
categories:
|
|
340
|
+
bubbleSizes: resolveEditedReference(bubbleSizeRef, currentSeries.bubbleSizeRef, _nullishCoalesce(currentSeries.bubbleSizes, () => ( [])), "value").map((value) => typeof value === "number" && Number.isFinite(value) ? value : null),
|
|
341
|
+
categories: resolveEditedReference(categoriesRef, currentSeries.categoriesRef, currentSeries.categories, "category"),
|
|
270
342
|
categoriesRef,
|
|
271
|
-
name: _nullishCoalesce(parsed.nameLiteral, () => ( (parsed.nameFormula && workbook ? resolveSeriesName(workbook, chart.workbookSheetIndex, parsed.nameFormula) : _nullishCoalesce(parsed.nameFormula, () => ( currentSeries.name))))),
|
|
343
|
+
name: _nullishCoalesce(parsed.nameLiteral, () => ( (parsed.nameFormula === _optionalChain([currentSeries, 'access', _51 => _51.raw, 'optionalAccess', _52 => _52.name]) && isUnresolved(parsed.nameFormula) ? currentSeries.name : parsed.nameFormula && workbook ? resolveSeriesName(workbook, chart.workbookSheetIndex, parsed.nameFormula) : _nullishCoalesce(parsed.nameFormula, () => ( currentSeries.name))))),
|
|
272
344
|
raw,
|
|
273
|
-
values:
|
|
345
|
+
values: resolveEditedReference(valuesRef, currentSeries.valuesRef, currentSeries.values, "value").map((value) => typeof value === "number" && Number.isFinite(value) ? value : null),
|
|
274
346
|
valuesRef
|
|
275
347
|
};
|
|
276
348
|
return {
|
|
277
349
|
...chart,
|
|
278
|
-
series: chart.series.map((series, index) => index === seriesIndex ? nextSeries : series)
|
|
350
|
+
series: chart.series.map((series, index) => index === seriesIndex ? nextSeries : series),
|
|
351
|
+
typeGroups: _optionalChain([chart, 'access', _53 => _53.typeGroups, 'optionalAccess', _54 => _54.map, 'call', _55 => _55((group) => ({
|
|
352
|
+
...group,
|
|
353
|
+
series: group.series.map((series) => series.id === currentSeries.id ? nextSeries : series)
|
|
354
|
+
}))])
|
|
279
355
|
};
|
|
280
356
|
}
|
|
281
357
|
function normalizeWorksheetVisibility(value) {
|
|
@@ -339,11 +415,11 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
|
|
|
339
415
|
return void 0;
|
|
340
416
|
}
|
|
341
417
|
const srgbMatch = fragment.match(/<a:srgbClr\b[^>]*\bval="([0-9a-fA-F]{6,8})"/i);
|
|
342
|
-
if (_optionalChain([srgbMatch, 'optionalAccess',
|
|
418
|
+
if (_optionalChain([srgbMatch, 'optionalAccess', _56 => _56[1]])) {
|
|
343
419
|
return _nullishCoalesce(normalizeHexColor(srgbMatch[1]), () => ( void 0));
|
|
344
420
|
}
|
|
345
421
|
const schemeMatch = _nullishCoalesce(fragment.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*>([\s\S]*?)<\/a:schemeClr>/i), () => ( fragment.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*/i)));
|
|
346
|
-
if (!_optionalChain([schemeMatch, 'optionalAccess',
|
|
422
|
+
if (!_optionalChain([schemeMatch, 'optionalAccess', _57 => _57[1]])) {
|
|
347
423
|
return void 0;
|
|
348
424
|
}
|
|
349
425
|
const baseColor = resolveThemeColor(schemeMatch[1], themePalette);
|
|
@@ -354,7 +430,7 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
|
|
|
354
430
|
let lightnessModifier = 1;
|
|
355
431
|
let lightnessOffset = 0;
|
|
356
432
|
for (const match of transforms.matchAll(/<a:(lumMod|lumOff|tint|shade)\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/gi)) {
|
|
357
|
-
const transform = _optionalChain([match, 'access',
|
|
433
|
+
const transform = _optionalChain([match, 'access', _58 => _58[1], 'optionalAccess', _59 => _59.toLowerCase, 'call', _60 => _60()]);
|
|
358
434
|
const rawValue = Number(_nullishCoalesce(match[2], () => ( Number.NaN)));
|
|
359
435
|
if (!transform || !Number.isFinite(rawValue)) {
|
|
360
436
|
continue;
|
|
@@ -372,7 +448,7 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
|
|
|
372
448
|
return _nullishCoalesce(applyLightnessTransform(baseColor, lightnessModifier, lightnessOffset), () => ( void 0));
|
|
373
449
|
}
|
|
374
450
|
function readHexColorFromXmlFragment(fragment, preferLine = false, themePalette) {
|
|
375
|
-
const source = preferLine ? _nullishCoalesce(_optionalChain([fragment, 'access',
|
|
451
|
+
const source = preferLine ? _nullishCoalesce(_optionalChain([fragment, 'access', _61 => _61.match, 'call', _62 => _62(/<a:ln\b[\s\S]*?<\/a:ln>/i), 'optionalAccess', _63 => _63[0]]), () => ( "")) : _nullishCoalesce(_optionalChain([fragment, 'access', _64 => _64.match, 'call', _65 => _65(/<a:solidFill\b[\s\S]*?<\/a:solidFill>/i), 'optionalAccess', _66 => _66[0]]), () => ( ""));
|
|
376
452
|
return resolveColorFromXmlFragment(source, themePalette);
|
|
377
453
|
}
|
|
378
454
|
function parseFallbackSeriesStylesFromChartXml(chartXml, themePalette) {
|
|
@@ -381,7 +457,7 @@ function parseFallbackSeriesStylesFromChartXml(chartXml, themePalette) {
|
|
|
381
457
|
return [];
|
|
382
458
|
}
|
|
383
459
|
return seriesBlocks.map((seriesBlock) => {
|
|
384
|
-
const shapeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access',
|
|
460
|
+
const shapeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _67 => _67.match, 'call', _68 => _68(/<c:spPr\b[\s\S]*?<\/c:spPr>/i), 'optionalAccess', _69 => _69[0]]), () => ( ""));
|
|
385
461
|
return {
|
|
386
462
|
color: readHexColorFromXmlFragment(shapeBlock, false, themePalette),
|
|
387
463
|
lineColor: readHexColorFromXmlFragment(shapeBlock, true, themePalette)
|
|
@@ -425,12 +501,12 @@ function parseFallbackPointStylesFromChartXml(chartXml, themePalette) {
|
|
|
425
501
|
const styles = [];
|
|
426
502
|
for (const pointBlock of pointBlocks) {
|
|
427
503
|
const indexMatch = pointBlock.match(/<c:idx\b[^>]*\bval="(-?\d+)"/i);
|
|
428
|
-
const index = _optionalChain([indexMatch, 'optionalAccess',
|
|
504
|
+
const index = _optionalChain([indexMatch, 'optionalAccess', _70 => _70[1]]) ? Number(indexMatch[1]) : Number.NaN;
|
|
429
505
|
if (!Number.isFinite(index)) {
|
|
430
506
|
continue;
|
|
431
507
|
}
|
|
432
508
|
const explosionMatch = pointBlock.match(/<c:explosion\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/i);
|
|
433
|
-
const explosionValue = _optionalChain([explosionMatch, 'optionalAccess',
|
|
509
|
+
const explosionValue = _optionalChain([explosionMatch, 'optionalAccess', _71 => _71[1]]) ? Number(explosionMatch[1]) : Number.NaN;
|
|
434
510
|
styles.push({
|
|
435
511
|
color: readHexColorFromXmlFragment(pointBlock, false, themePalette),
|
|
436
512
|
explosion: Number.isFinite(explosionValue) ? explosionValue : void 0,
|
|
@@ -447,7 +523,7 @@ function parseNumericPointCacheFromXmlFragment(fragment) {
|
|
|
447
523
|
return [];
|
|
448
524
|
}
|
|
449
525
|
const explicitPointCountMatch = fragment.match(/<c:ptCount\b[^>]*\bval="(\d+)"/i);
|
|
450
|
-
const explicitPointCount = _optionalChain([explicitPointCountMatch, 'optionalAccess',
|
|
526
|
+
const explicitPointCount = _optionalChain([explicitPointCountMatch, 'optionalAccess', _72 => _72[1]]) ? Number(explicitPointCountMatch[1]) : Number.NaN;
|
|
451
527
|
const maxIndex = pointMatches.reduce((max, match) => {
|
|
452
528
|
const current = Number(_nullishCoalesce(match[1], () => ( Number.NaN)));
|
|
453
529
|
return Number.isFinite(current) ? Math.max(max, current) : max;
|
|
@@ -475,7 +551,7 @@ function parseFallbackBubbleSizesFromChartXml(chartXml) {
|
|
|
475
551
|
return [];
|
|
476
552
|
}
|
|
477
553
|
return seriesBlocks.map((seriesBlock) => {
|
|
478
|
-
const bubbleSizeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access',
|
|
554
|
+
const bubbleSizeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _73 => _73.match, 'call', _74 => _74(/<c:bubbleSize\b[\s\S]*?<\/c:bubbleSize>/i), 'optionalAccess', _75 => _75[0]]), () => ( ""));
|
|
479
555
|
if (!bubbleSizeBlock) {
|
|
480
556
|
return [];
|
|
481
557
|
}
|
|
@@ -597,17 +673,17 @@ function resolveThemeColor(name, themePalette) {
|
|
|
597
673
|
return null;
|
|
598
674
|
}
|
|
599
675
|
const index = THEME_COLOR_INDEX_BY_NAME[name];
|
|
600
|
-
return index === void 0 ? null : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
676
|
+
return index === void 0 ? null : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _76 => _76.colorsByIndex, 'access', _77 => _77[index]]), () => ( null));
|
|
601
677
|
}
|
|
602
678
|
function resolveThemeTypeface(typeface, themePalette) {
|
|
603
679
|
if (!typeface) {
|
|
604
680
|
return null;
|
|
605
681
|
}
|
|
606
682
|
if (typeface === "+mn-lt" || typeface === "+mn-ea" || typeface === "+mn-cs") {
|
|
607
|
-
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
683
|
+
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _78 => _78.minorLatinFont]), () => ( null));
|
|
608
684
|
}
|
|
609
685
|
if (typeface === "+mj-lt" || typeface === "+mj-ea" || typeface === "+mj-cs") {
|
|
610
|
-
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
686
|
+
return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _79 => _79.majorLatinFont]), () => ( null));
|
|
611
687
|
}
|
|
612
688
|
return typeface;
|
|
613
689
|
}
|
|
@@ -619,8 +695,8 @@ function readChartTextTypeface(textPropertiesNode, themePalette) {
|
|
|
619
695
|
if (!defaultRunProperties) {
|
|
620
696
|
return null;
|
|
621
697
|
}
|
|
622
|
-
const typeface = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
623
|
-
const resolved = _nullishCoalesce(_optionalChain([resolveThemeTypeface, 'call',
|
|
698
|
+
const typeface = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _80 => _80(defaultRunProperties, "latin"), 'optionalAccess', _81 => _81.getAttribute, 'call', _82 => _82("typeface")]), () => ( _optionalChain([getFirstLocalChild, 'call', _83 => _83(defaultRunProperties, "ea"), 'optionalAccess', _84 => _84.getAttribute, 'call', _85 => _85("typeface")]))), () => ( _optionalChain([getFirstLocalChild, 'call', _86 => _86(defaultRunProperties, "cs"), 'optionalAccess', _87 => _87.getAttribute, 'call', _88 => _88("typeface")]))), () => ( null));
|
|
699
|
+
const resolved = _nullishCoalesce(_optionalChain([resolveThemeTypeface, 'call', _89 => _89(typeface, themePalette), 'optionalAccess', _90 => _90.trim, 'call', _91 => _91()]), () => ( ""));
|
|
624
700
|
return resolved.length > 0 ? resolved : null;
|
|
625
701
|
}
|
|
626
702
|
function resolveChartColorNode(node, themePalette) {
|
|
@@ -702,7 +778,7 @@ function resolveChartFillColor(shapeNode, themePalette) {
|
|
|
702
778
|
return resolveChartColorNode(midpointStop.colorNode, themePalette);
|
|
703
779
|
}
|
|
704
780
|
function resolveChartLineStyle(shapeNode, themePalette) {
|
|
705
|
-
const lineNode = _optionalChain([shapeNode, 'optionalAccess',
|
|
781
|
+
const lineNode = _optionalChain([shapeNode, 'optionalAccess', _92 => _92.localName]) === "ln" ? shapeNode : shapeNode ? getFirstLocalChild(shapeNode, "ln") : null;
|
|
706
782
|
if (!lineNode) {
|
|
707
783
|
return { color: null, hidden: false, widthPx: void 0 };
|
|
708
784
|
}
|
|
@@ -748,7 +824,7 @@ function normalizeLegendPosition(position) {
|
|
|
748
824
|
}
|
|
749
825
|
function readChartNumericAttribute(parent, localName) {
|
|
750
826
|
const node = parent ? getFirstLocalChild(parent, localName) : null;
|
|
751
|
-
const value = Number(_nullishCoalesce(_optionalChain([node, 'optionalAccess',
|
|
827
|
+
const value = Number(_nullishCoalesce(_optionalChain([node, 'optionalAccess', _93 => _93.getAttribute, 'call', _94 => _94("val")]), () => ( Number.NaN)));
|
|
752
828
|
return Number.isFinite(value) ? value : void 0;
|
|
753
829
|
}
|
|
754
830
|
function readChartBooleanAttribute(parent, localName) {
|
|
@@ -773,7 +849,7 @@ function readChartLabelFontSizePt(textPropertiesNode) {
|
|
|
773
849
|
return void 0;
|
|
774
850
|
}
|
|
775
851
|
const runPropertiesNode = _nullishCoalesce(getFirstLocalDescendant(textPropertiesNode, "defRPr"), () => ( getFirstLocalDescendant(textPropertiesNode, "rPr")));
|
|
776
|
-
const rawSize = Number(_nullishCoalesce(_optionalChain([runPropertiesNode, 'optionalAccess',
|
|
852
|
+
const rawSize = Number(_nullishCoalesce(_optionalChain([runPropertiesNode, 'optionalAccess', _95 => _95.getAttribute, 'call', _96 => _96("sz")]), () => ( Number.NaN)));
|
|
777
853
|
if (!Number.isFinite(rawSize) || rawSize <= 0) {
|
|
778
854
|
return void 0;
|
|
779
855
|
}
|
|
@@ -819,7 +895,7 @@ function parseChartDataLabelsFromXml(labelsNode) {
|
|
|
819
895
|
showSeriesName: readChartBooleanAttribute(labelsNode, "showSerName"),
|
|
820
896
|
showValue: readChartBooleanAttribute(labelsNode, "showVal")
|
|
821
897
|
};
|
|
822
|
-
const hasValue = labels.showBubbleSize !== void 0 || labels.showCategoryName !== void 0 || labels.showLegendKey !== void 0 || labels.showPercent !== void 0 || (_nullishCoalesce(_optionalChain([labels, 'access',
|
|
898
|
+
const hasValue = labels.showBubbleSize !== void 0 || labels.showCategoryName !== void 0 || labels.showLegendKey !== void 0 || labels.showPercent !== void 0 || (_nullishCoalesce(_optionalChain([labels, 'access', _97 => _97.pointLabels, 'optionalAccess', _98 => _98.length]), () => ( 0))) > 0 || labels.showSeriesName !== void 0 || labels.showValue !== void 0;
|
|
823
899
|
return hasValue ? labels : null;
|
|
824
900
|
}
|
|
825
901
|
function readChartRelationships(archive, chartPath) {
|
|
@@ -849,7 +925,7 @@ function readChartColorPalette(archive, colorStylePath, themePalette) {
|
|
|
849
925
|
return [];
|
|
850
926
|
}
|
|
851
927
|
const colorStyleDocument = parseXml(colorStyleXml);
|
|
852
|
-
if (!_optionalChain([colorStyleDocument, 'optionalAccess',
|
|
928
|
+
if (!_optionalChain([colorStyleDocument, 'optionalAccess', _99 => _99.documentElement])) {
|
|
853
929
|
return [];
|
|
854
930
|
}
|
|
855
931
|
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");
|
|
@@ -865,7 +941,7 @@ function readChartStyleAppearance(archive, stylePath, themePalette) {
|
|
|
865
941
|
}
|
|
866
942
|
const dataPointNode = getFirstLocalDescendant(styleDocument, "dataPoint");
|
|
867
943
|
const fillRefNode = dataPointNode ? getFirstLocalChild(dataPointNode, "fillRef") : null;
|
|
868
|
-
const index = Number(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess',
|
|
944
|
+
const index = Number(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _100 => _100.getAttribute, 'call', _101 => _101("idx")]), () => ( Number.NaN)));
|
|
869
945
|
const chartAreaNode = getFirstLocalDescendant(styleDocument, "chartArea");
|
|
870
946
|
const chartAreaShapeProperties = chartAreaNode ? getFirstLocalChild(chartAreaNode, "spPr") : null;
|
|
871
947
|
const chartAreaFontRef = chartAreaNode ? getFirstLocalChild(chartAreaNode, "fontRef") : null;
|
|
@@ -889,29 +965,29 @@ function readChartStyleAppearance(archive, stylePath, themePalette) {
|
|
|
889
965
|
};
|
|
890
966
|
}
|
|
891
967
|
function buildThemeSeriesPalette(themePalette) {
|
|
892
|
-
const themeColors = [4, 5, 6, 7, 8, 9].map((index) => _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
968
|
+
const themeColors = [4, 5, 6, 7, 8, 9].map((index) => _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _102 => _102.colorsByIndex, 'access', _103 => _103[index]]), () => ( null))).filter((color) => Boolean(color));
|
|
893
969
|
return themeColors.length > 0 ? themeColors : SERIES_COLORS;
|
|
894
970
|
}
|
|
895
971
|
function applyBuiltinSurfaceDefaults(chart, themePalette) {
|
|
896
972
|
if (chart.chartType !== "Surface") {
|
|
897
973
|
return;
|
|
898
974
|
}
|
|
899
|
-
const builtin = _optionalChain([chart, 'access',
|
|
900
|
-
const colors = _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
901
|
-
const wallFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess',
|
|
902
|
-
const floorFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess',
|
|
903
|
-
const gridlineColor = _chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess',
|
|
975
|
+
const builtin = _optionalChain([chart, 'access', _104 => _104.raw, 'optionalAccess', _105 => _105.hasCustomChartColorStyle]) !== true ? _chunk5ERNVHSOcjs.getBuiltinChartSurfaceStyle.call(void 0, chart.chartStyleId) : void 0;
|
|
976
|
+
const colors = _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _106 => _106.colorsByIndex]), () => ( {}));
|
|
977
|
+
const wallFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _107 => _107.wall, 'access', _108 => _108.fill]), colors), () => ( (chart.wireframe ? "#d0d0d0" : "#d9d9df")));
|
|
978
|
+
const floorFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _109 => _109.floor, 'access', _110 => _110.fill]), colors), () => ( wallFill));
|
|
979
|
+
const gridlineColor = _chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _111 => _111.majorGridline]), colors);
|
|
904
980
|
for (const axis of [chart.categoryAxis, chart.valueAxis, chart.seriesAxis]) {
|
|
905
981
|
if (axis && !axis.majorGridlineColor) axis.majorGridlineColor = gridlineColor;
|
|
906
982
|
}
|
|
907
983
|
const wallLine = chart.wireframe ? "#a6a6a6" : "#a8adb7";
|
|
908
|
-
const previousDefaults = _optionalChain([chart, 'access',
|
|
984
|
+
const previousDefaults = _optionalChain([chart, 'access', _112 => _112.raw, 'optionalAccess', _113 => _113.builtinSurfaceDefaults]);
|
|
909
985
|
const nextDefaults = {};
|
|
910
986
|
for (const key of ["floor", "sideWall", "backWall"]) {
|
|
911
987
|
const wall = _nullishCoalesce(chart[key], () => ( {}));
|
|
912
|
-
const previous = _optionalChain([previousDefaults, 'optionalAccess',
|
|
913
|
-
const fillIsDefault = wall.fillColor === void 0 || wall.fillColor === _optionalChain([previous, 'optionalAccess',
|
|
914
|
-
const lineIsDefault = wall.lineColor === void 0 || wall.lineColor === _optionalChain([previous, 'optionalAccess',
|
|
988
|
+
const previous = _optionalChain([previousDefaults, 'optionalAccess', _114 => _114[key]]);
|
|
989
|
+
const fillIsDefault = wall.fillColor === void 0 || wall.fillColor === _optionalChain([previous, 'optionalAccess', _115 => _115.fillColor]);
|
|
990
|
+
const lineIsDefault = wall.lineColor === void 0 || wall.lineColor === _optionalChain([previous, 'optionalAccess', _116 => _116.lineColor]);
|
|
915
991
|
const fillColor = fillIsDefault ? key === "floor" ? floorFill : wallFill : wall.fillColor;
|
|
916
992
|
const lineColor = lineIsDefault ? wallLine : wall.lineColor;
|
|
917
993
|
chart[key] = { ...wall, fillColor, lineColor };
|
|
@@ -927,8 +1003,8 @@ function applyBuiltinSurfaceDefaults(chart, themePalette) {
|
|
|
927
1003
|
}
|
|
928
1004
|
function applyBuiltinChartDefaults(chart, themePalette) {
|
|
929
1005
|
const darkBuiltInStyle = typeof chart.chartStyleId === "number" && chart.chartStyleId >= 140 && chart.chartStyleId < 150;
|
|
930
|
-
const textColor = _nullishCoalesce(_nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
931
|
-
const minorTypeface = _optionalChain([themePalette, 'optionalAccess',
|
|
1006
|
+
const textColor = _nullishCoalesce(_nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _117 => _117.colorsByIndex, 'access', _118 => _118[1]]), () => ( _optionalChain([themePalette, 'optionalAccess', _119 => _119.colorsByIndex, 'access', _120 => _120[3]]))), () => ( null));
|
|
1007
|
+
const minorTypeface = _optionalChain([themePalette, 'optionalAccess', _121 => _121.minorLatinFont, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]) || void 0;
|
|
932
1008
|
const derivedAxisColor = textColor ? applyLightnessTransform(textColor, 0.35, 0.55) : null;
|
|
933
1009
|
const derivedBorderColor = textColor ? applyLightnessTransform(textColor, chart.is3d ? 0.28 : 0.22, chart.is3d ? 0.6 : 0.7) : null;
|
|
934
1010
|
if (darkBuiltInStyle) {
|
|
@@ -946,10 +1022,10 @@ function applyBuiltinChartDefaults(chart, themePalette) {
|
|
|
946
1022
|
chart.axisLineColor = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(chart.axisLineColor, () => ( derivedAxisColor)), () => ( textColor)), () => ( void 0));
|
|
947
1023
|
chart.fontFamily = _nullishCoalesce(chart.fontFamily, () => ( minorTypeface));
|
|
948
1024
|
chart.titleFontFamily = _nullishCoalesce(_nullishCoalesce(chart.titleFontFamily, () => ( chart.fontFamily)), () => ( minorTypeface));
|
|
949
|
-
const themeColors = _optionalChain([themePalette, 'optionalAccess',
|
|
950
|
-
const useBuiltin = _optionalChain([chart, 'access',
|
|
951
|
-
const colorCount = Math.max(1, chart.series.length, _nullishCoalesce(_optionalChain([chart, 'access',
|
|
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',
|
|
1025
|
+
const themeColors = _optionalChain([themePalette, 'optionalAccess', _124 => _124.colorsByIndex]);
|
|
1026
|
+
const useBuiltin = _optionalChain([chart, 'access', _125 => _125.raw, 'optionalAccess', _126 => _126.hasCustomChartColorStyle]) !== true && themeColors && _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, 0, 1) !== void 0;
|
|
1027
|
+
const colorCount = Math.max(1, chart.series.length, _nullishCoalesce(_optionalChain([chart, 'access', _127 => _127.typeGroups, 'optionalAccess', _128 => _128.reduce, 'call', _129 => _129((total, group) => total + group.series.length, 0)]), () => ( 0)));
|
|
1028
|
+
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', _130 => _130.chartColorPalette, 'optionalAccess', _131 => _131.length]) ? chart.chartColorPalette : buildThemeSeriesPalette(themePalette);
|
|
953
1029
|
chart.chartColorPalette = seriesPalette;
|
|
954
1030
|
chart.raw = { ...chart.raw, builtinThemeColors: useBuiltin ? themeColors : void 0 };
|
|
955
1031
|
const applySeriesDefaults = (series, index) => {
|
|
@@ -959,7 +1035,7 @@ function applyBuiltinChartDefaults(chart, themePalette) {
|
|
|
959
1035
|
const generated = {};
|
|
960
1036
|
const resolveColor = (key, explicit, fallback) => {
|
|
961
1037
|
const value = series[key];
|
|
962
|
-
if (!explicit && (value == null || value === _optionalChain([previous, 'optionalAccess',
|
|
1038
|
+
if (!explicit && (value == null || value === _optionalChain([previous, 'optionalAccess', _132 => _132[key]]) || (key === "color" || key === "lineColor") && useBuiltin && _optionalChain([chart, 'access', _133 => _133.raw, 'optionalAccess', _134 => _134.xmlChartType]))) {
|
|
963
1039
|
generated[key] = fallback;
|
|
964
1040
|
return fallback;
|
|
965
1041
|
}
|
|
@@ -981,9 +1057,10 @@ function applyBuiltinChartDefaults(chart, themePalette) {
|
|
|
981
1057
|
};
|
|
982
1058
|
};
|
|
983
1059
|
chart.series = chart.series.map(applySeriesDefaults);
|
|
1060
|
+
const canonicalSeries = chart.id.startsWith("chart-ex-") ? null : new Map(chart.series.map((series) => [series.id, series]));
|
|
984
1061
|
let groupSeriesOffset = 0;
|
|
985
|
-
chart.typeGroups = _optionalChain([chart, 'access',
|
|
986
|
-
const series = group.series.map((entry, index) => applySeriesDefaults(entry, groupSeriesOffset + index));
|
|
1062
|
+
chart.typeGroups = _optionalChain([chart, 'access', _135 => _135.typeGroups, 'optionalAccess', _136 => _136.map, 'call', _137 => _137((group) => {
|
|
1063
|
+
const series = group.series.map((entry, index) => _nullishCoalesce(_optionalChain([canonicalSeries, 'optionalAccess', _138 => _138.get, 'call', _139 => _139(entry.id)]), () => ( applySeriesDefaults(entry, groupSeriesOffset + index))));
|
|
987
1064
|
groupSeriesOffset += group.series.length;
|
|
988
1065
|
return { ...group, series };
|
|
989
1066
|
})]);
|
|
@@ -1036,7 +1113,7 @@ function parseChartCacheValues(parentNode, cacheName, mode) {
|
|
|
1036
1113
|
const rawIndex = Number(_nullishCoalesce(pointNode.getAttribute("idx"), () => ( Number.NaN)));
|
|
1037
1114
|
return {
|
|
1038
1115
|
index: Number.isFinite(rawIndex) ? rawIndex : 0,
|
|
1039
|
-
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1116
|
+
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _140 => _140(pointNode, "v"), 'optionalAccess', _141 => _141.textContent]), () => ( ""))
|
|
1040
1117
|
};
|
|
1041
1118
|
}).sort((left, right) => left.index - right.index);
|
|
1042
1119
|
if (pointNodes.length === 0) {
|
|
@@ -1077,7 +1154,7 @@ function parseChartMultiLevelCacheValues(parentNode, mode) {
|
|
|
1077
1154
|
const rawIndex = Number(_nullishCoalesce(pointNode.getAttribute("idx"), () => ( Number.NaN)));
|
|
1078
1155
|
return {
|
|
1079
1156
|
index: Number.isFinite(rawIndex) ? rawIndex : 0,
|
|
1080
|
-
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1157
|
+
value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _142 => _142(pointNode, "v"), 'optionalAccess', _143 => _143.textContent]), () => ( ""))
|
|
1081
1158
|
};
|
|
1082
1159
|
}).sort((left, right) => left.index - right.index);
|
|
1083
1160
|
if (pointNodes.length === 0) {
|
|
@@ -1114,7 +1191,7 @@ function applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette) {
|
|
|
1114
1191
|
const fillColor = resolveChartFillColor(shapeProperties, themePalette);
|
|
1115
1192
|
const markerSize = readChartNumericAttribute(markerNode, "size");
|
|
1116
1193
|
const markerSymbolNode = markerNode ? getFirstLocalChild(markerNode, "symbol") : null;
|
|
1117
|
-
const markerSymbol = _nullishCoalesce(_optionalChain([markerSymbolNode, 'optionalAccess',
|
|
1194
|
+
const markerSymbol = _nullishCoalesce(_optionalChain([markerSymbolNode, 'optionalAccess', _144 => _144.getAttribute, 'call', _145 => _145("val")]), () => ( (markerNode || chart.chartType === "Scatter" || ["marker", "lineMarker", "smoothMarker"].includes(_nullishCoalesce(chart.scatterStyle, () => ( ""))) || readChartBooleanAttribute(chartTypeNode, "marker") === true ? "auto" : series.markerSymbol)));
|
|
1118
1195
|
const pointStyles = parseChartPointStyles(seriesNode, themePalette);
|
|
1119
1196
|
const seriesExplosion = readChartNumericAttribute(seriesNode, "explosion");
|
|
1120
1197
|
const invertNegativeStyle = parseInvertNegativeStyle(seriesNode, themePalette);
|
|
@@ -1124,14 +1201,15 @@ function applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette) {
|
|
|
1124
1201
|
const cachedValues = isScatterChart ? parseChartCacheValues(getFirstLocalChild(seriesNode, "yVal"), "numCache", "value") : parseChartCacheValues(getFirstLocalChild(seriesNode, "val"), "numCache", "value");
|
|
1125
1202
|
const cachedBubbleSizes = chart.chartType === "Bubble" ? parseChartCacheValues(getFirstLocalChild(seriesNode, "bubbleSize"), "numCache", "value") : null;
|
|
1126
1203
|
const existingShapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : null;
|
|
1127
|
-
const rawFillColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess',
|
|
1128
|
-
const rawLineColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess',
|
|
1204
|
+
const rawFillColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _146 => _146.solidFillHex]) === "string" ? normalizeHexColor(existingShapeProperties.solidFillHex) : null;
|
|
1205
|
+
const rawLineColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _147 => _147.lineColorHex]) === "string" ? normalizeHexColor(existingShapeProperties.lineColorHex) : null;
|
|
1129
1206
|
const resolvedLineColor = lineStyle.hidden ? void 0 : _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( lineStyle.color)), () => ( rawFillColor)), () => ( fillColor)), () => ( series.lineColor)), () => ( series.color));
|
|
1130
|
-
const hasCategoryReference = typeof _optionalChain([series, 'access',
|
|
1131
|
-
const hasValueReference = typeof _optionalChain([series, 'access',
|
|
1132
|
-
const hasBubbleSizeReference = typeof _optionalChain([series, 'access',
|
|
1207
|
+
const hasCategoryReference = typeof _optionalChain([series, 'access', _148 => _148.categoriesRef, 'optionalAccess', _149 => _149.formula]) === "string" && series.categoriesRef.formula.length > 0 && !_optionalChain([series, 'access', _150 => _150.raw, 'optionalAccess', _151 => _151.unresolvedCategoriesReference]);
|
|
1208
|
+
const hasValueReference = typeof _optionalChain([series, 'access', _152 => _152.valuesRef, 'optionalAccess', _153 => _153.formula]) === "string" && series.valuesRef.formula.length > 0 && !_optionalChain([series, 'access', _154 => _154.raw, 'optionalAccess', _155 => _155.unresolvedValuesReference]);
|
|
1209
|
+
const hasBubbleSizeReference = typeof _optionalChain([series, 'access', _156 => _156.bubbleSizeRef, 'optionalAccess', _157 => _157.formula]) === "string" && series.bubbleSizeRef.formula.length > 0 && !_optionalChain([series, 'access', _158 => _158.raw, 'optionalAccess', _159 => _159.unresolvedBubbleSizeReference]);
|
|
1133
1210
|
return {
|
|
1134
1211
|
...series,
|
|
1212
|
+
name: _optionalChain([series, 'access', _160 => _160.raw, 'optionalAccess', _161 => _161.unresolvedNameReference]) ? _nullishCoalesce(_optionalChain([parseChartCacheValues, 'call', _162 => _162(getFirstLocalChild(seriesNode, "tx"), "strCache", "category"), 'optionalAccess', _163 => _163[0], 'optionalAccess', _164 => _164.toString, 'call', _165 => _165()]), () => ( series.name)) : series.name,
|
|
1135
1213
|
bubbleSizes: !hasBubbleSizeReference && cachedBubbleSizes ? cachedBubbleSizes.map((value) => typeof value === "number" && Number.isFinite(value) ? value : null) : series.bubbleSizes,
|
|
1136
1214
|
categories: !hasCategoryReference && cachedCategories ? cachedCategories : series.categories,
|
|
1137
1215
|
color: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(rawFillColor, () => ( rawLineColor)), () => ( fillColor)), () => ( lineStyle.color)), () => ( series.color)),
|
|
@@ -1206,10 +1284,10 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1206
1284
|
for (const fallbackStyle of fallbackPointStyles) {
|
|
1207
1285
|
const existing = existingByIndex.get(fallbackStyle.index);
|
|
1208
1286
|
existingByIndex.set(fallbackStyle.index, {
|
|
1209
|
-
color: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
1210
|
-
explosion: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
1287
|
+
color: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _166 => _166.color]), () => ( fallbackStyle.color)),
|
|
1288
|
+
explosion: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _167 => _167.explosion]), () => ( fallbackStyle.explosion)),
|
|
1211
1289
|
index: fallbackStyle.index,
|
|
1212
|
-
lineColor: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
1290
|
+
lineColor: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _168 => _168.lineColor]), () => ( fallbackStyle.lineColor))
|
|
1213
1291
|
});
|
|
1214
1292
|
}
|
|
1215
1293
|
return {
|
|
@@ -1237,7 +1315,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1237
1315
|
};
|
|
1238
1316
|
const applyRelationshipStyles = () => {
|
|
1239
1317
|
chart.chartColorPalette = readChartColorPalette(archive, relationships.get(CHART_COLOR_STYLE_REL_TYPE), themePalette);
|
|
1240
|
-
chart.raw = { ...chart.raw, hasCustomChartColorStyle: Boolean(_optionalChain([chart, 'access',
|
|
1318
|
+
chart.raw = { ...chart.raw, hasCustomChartColorStyle: Boolean(_optionalChain([chart, 'access', _169 => _169.chartColorPalette, 'optionalAccess', _170 => _170.length])) };
|
|
1241
1319
|
const styleAppearance2 = readChartStyleAppearance(
|
|
1242
1320
|
archive,
|
|
1243
1321
|
relationships.get(CHART_STYLE_REL_TYPE),
|
|
@@ -1253,7 +1331,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1253
1331
|
return styleAppearance2;
|
|
1254
1332
|
};
|
|
1255
1333
|
const applyModernChartExStyles = () => {
|
|
1256
|
-
const modernPlotAreaNode = _optionalChain([chartDocument, 'optionalAccess',
|
|
1334
|
+
const modernPlotAreaNode = _optionalChain([chartDocument, 'optionalAccess', _171 => _171.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "plotArea") : null;
|
|
1257
1335
|
if (!modernPlotAreaNode) {
|
|
1258
1336
|
return;
|
|
1259
1337
|
}
|
|
@@ -1335,12 +1413,12 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1335
1413
|
const nextTypeGroups = chart.typeGroups.map((group) => ({ ...group, series: [...group.series] }));
|
|
1336
1414
|
const columnGroupIndex = nextTypeGroups.findIndex((group) => group.chartType === "ColumnClustered");
|
|
1337
1415
|
if (columnGroupIndex >= 0) {
|
|
1338
|
-
const originalColumnSeries = _nullishCoalesce(_optionalChain([nextTypeGroups, 'access',
|
|
1416
|
+
const originalColumnSeries = _nullishCoalesce(_optionalChain([nextTypeGroups, 'access', _172 => _172[columnGroupIndex], 'optionalAccess', _173 => _173.series, 'access', _174 => _174[0]]), () => ( null));
|
|
1339
1417
|
const binnedColumnSeries = replaceColumnSeries(originalColumnSeries);
|
|
1340
1418
|
if (binnedColumnSeries) {
|
|
1341
1419
|
nextTypeGroups[columnGroupIndex].series = [binnedColumnSeries];
|
|
1342
1420
|
const lineGroupIndex = nextTypeGroups.findIndex((group) => group.chartType === "Line");
|
|
1343
|
-
if (lineGroupIndex >= 0 && _optionalChain([nextTypeGroups, 'access',
|
|
1421
|
+
if (lineGroupIndex >= 0 && _optionalChain([nextTypeGroups, 'access', _175 => _175[lineGroupIndex], 'optionalAccess', _176 => _176.series, 'access', _177 => _177[0]])) {
|
|
1344
1422
|
const originalLineSeries = nextTypeGroups[lineGroupIndex].series[0];
|
|
1345
1423
|
const recomputedLine = buildChartExParetoLineSeries(
|
|
1346
1424
|
binnedColumnSeries,
|
|
@@ -1383,7 +1461,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1383
1461
|
const chartDocument = parseXml(chartXml);
|
|
1384
1462
|
const chartNode = chartDocument ? getFirstLocalDescendant(chartDocument, "chart") : null;
|
|
1385
1463
|
const plotAreaNode = chartNode ? getFirstLocalChild(chartNode, "plotArea") : null;
|
|
1386
|
-
const styleIdNode = _optionalChain([chartDocument, 'optionalAccess',
|
|
1464
|
+
const styleIdNode = _optionalChain([chartDocument, 'optionalAccess', _178 => _178.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "style") : null;
|
|
1387
1465
|
const chartTypeNode = findPrimaryChartTypeNode(plotAreaNode);
|
|
1388
1466
|
if (!chartNode || !chartTypeNode) {
|
|
1389
1467
|
applyRelationshipStyles();
|
|
@@ -1391,6 +1469,23 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1391
1469
|
if (typeof fallbackStyleId === "number" && Number.isFinite(fallbackStyleId)) {
|
|
1392
1470
|
chart.chartStyleId = fallbackStyleId;
|
|
1393
1471
|
}
|
|
1472
|
+
const sourceSeries = _optionalChain([chart, 'access', _179 => _179.raw, 'optionalAccess', _180 => _180.officeSourceSeries]);
|
|
1473
|
+
if (sourceSeries && _optionalChain([chartDocument, 'optionalAccess', _181 => _181.documentElement, 'access', _182 => _182.namespaceURI]) === "http://schemas.microsoft.com/office/drawing/2014/chartex") {
|
|
1474
|
+
chart.renderSource = {
|
|
1475
|
+
kind: _nullishCoalesce(chart.chartExLayout, () => ( "")),
|
|
1476
|
+
seriesTypes: getLocalDescendants(chartNode, "series").map((node) => _nullishCoalesce(node.getAttribute("layoutId"), () => ( ""))),
|
|
1477
|
+
sourceSeries,
|
|
1478
|
+
experimental: true,
|
|
1479
|
+
xml: chartXml,
|
|
1480
|
+
themeColors: themePalette ? Object.fromEntries(Object.entries(THEME_COLOR_INDEX_BY_NAME).flatMap(([key, index]) => {
|
|
1481
|
+
const color = themePalette.colorsByIndex[index];
|
|
1482
|
+
return color ? [[key, color]] : [];
|
|
1483
|
+
})) : void 0,
|
|
1484
|
+
themeOverrideXml: _nullishCoalesce(readArchiveText(archive, relationships.get("http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride")), () => ( void 0)),
|
|
1485
|
+
styleXml: _nullishCoalesce(readArchiveText(archive, relationships.get(CHART_STYLE_REL_TYPE)), () => ( void 0)),
|
|
1486
|
+
colorStyleXml: _nullishCoalesce(readArchiveText(archive, relationships.get(CHART_COLOR_STYLE_REL_TYPE)), () => ( void 0))
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1394
1489
|
applyModernChartExStyles();
|
|
1395
1490
|
applyFallbackSeriesStyles();
|
|
1396
1491
|
applyBuiltinChartDefaults(chart, themePalette);
|
|
@@ -1406,8 +1501,8 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1406
1501
|
switch (chartTypeNode.localName) {
|
|
1407
1502
|
case "barChart":
|
|
1408
1503
|
case "bar3DChart": {
|
|
1409
|
-
const grouping = _optionalChain([getFirstLocalChild, 'call',
|
|
1410
|
-
const barDir = _optionalChain([getFirstLocalChild, 'call',
|
|
1504
|
+
const grouping = _optionalChain([getFirstLocalChild, 'call', _183 => _183(chartTypeNode, "grouping"), 'optionalAccess', _184 => _184.getAttribute, 'call', _185 => _185("val")]);
|
|
1505
|
+
const barDir = _optionalChain([getFirstLocalChild, 'call', _186 => _186(chartTypeNode, "barDir"), 'optionalAccess', _187 => _187.getAttribute, 'call', _188 => _188("val")]);
|
|
1411
1506
|
const isHorizontalBar = barDir === "bar";
|
|
1412
1507
|
chart.is3d = chartTypeNode.localName === "bar3DChart" ? true : chart.is3d;
|
|
1413
1508
|
if (grouping === "percentStacked") {
|
|
@@ -1421,7 +1516,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1421
1516
|
}
|
|
1422
1517
|
case "areaChart":
|
|
1423
1518
|
case "area3DChart": {
|
|
1424
|
-
const grouping = _optionalChain([getFirstLocalChild, 'call',
|
|
1519
|
+
const grouping = _optionalChain([getFirstLocalChild, 'call', _189 => _189(chartTypeNode, "grouping"), 'optionalAccess', _190 => _190.getAttribute, 'call', _191 => _191("val")]);
|
|
1425
1520
|
chart.is3d = chartTypeNode.localName === "area3DChart" ? true : chart.is3d;
|
|
1426
1521
|
if (grouping === "stacked") {
|
|
1427
1522
|
chart.chartType = "AreaStacked";
|
|
@@ -1434,7 +1529,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1434
1529
|
}
|
|
1435
1530
|
case "lineChart":
|
|
1436
1531
|
case "line3DChart": {
|
|
1437
|
-
const grouping = _optionalChain([getFirstLocalChild, 'call',
|
|
1532
|
+
const grouping = _optionalChain([getFirstLocalChild, 'call', _192 => _192(chartTypeNode, "grouping"), 'optionalAccess', _193 => _193.getAttribute, 'call', _194 => _194("val")]);
|
|
1438
1533
|
chart.is3d = chartTypeNode.localName === "line3DChart" ? true : chart.is3d;
|
|
1439
1534
|
if (grouping === "stacked") {
|
|
1440
1535
|
chart.chartType = "LineStacked";
|
|
@@ -1459,7 +1554,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1459
1554
|
chart.chartType = "BarOfPie";
|
|
1460
1555
|
break;
|
|
1461
1556
|
case "scatterChart":
|
|
1462
|
-
chart.chartType = resolveScatterChartType(_optionalChain([getFirstLocalChild, 'call',
|
|
1557
|
+
chart.chartType = resolveScatterChartType(_optionalChain([getFirstLocalChild, 'call', _195 => _195(chartTypeNode, "scatterStyle"), 'optionalAccess', _196 => _196.getAttribute, 'call', _197 => _197("val")]));
|
|
1463
1558
|
break;
|
|
1464
1559
|
case "radarChart":
|
|
1465
1560
|
chart.chartType = "Radar";
|
|
@@ -1482,19 +1577,19 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1482
1577
|
break;
|
|
1483
1578
|
}
|
|
1484
1579
|
const legendNode = getFirstLocalChild(chartNode, "legend");
|
|
1485
|
-
const legendPosition = legendNode ? _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1486
|
-
const legendOverlay = legendNode ? _optionalChain([getFirstLocalChild, 'call',
|
|
1580
|
+
const legendPosition = legendNode ? _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _198 => _198(legendNode, "legendPos"), 'optionalAccess', _199 => _199.getAttribute, 'call', _200 => _200("val")]), () => ( void 0)) : void 0;
|
|
1581
|
+
const legendOverlay = legendNode ? _optionalChain([getFirstLocalChild, 'call', _201 => _201(legendNode, "overlay"), 'optionalAccess', _202 => _202.getAttribute, 'call', _203 => _203("val")]) : void 0;
|
|
1487
1582
|
chart.legend = legendNode ? {
|
|
1488
1583
|
overlay: legendOverlay === "1",
|
|
1489
1584
|
position: normalizeLegendPosition(legendPosition),
|
|
1490
|
-
raw: _optionalChain([chart, 'access',
|
|
1585
|
+
raw: _optionalChain([chart, 'access', _204 => _204.legend, 'optionalAccess', _205 => _205.raw])
|
|
1491
1586
|
} : chart.legend;
|
|
1492
1587
|
const plotVisibleOnly = readChartBooleanAttribute(chartNode, "plotVisOnly");
|
|
1493
1588
|
if (plotVisibleOnly !== void 0) {
|
|
1494
1589
|
chart.plotVisibleOnly = plotVisibleOnly;
|
|
1495
1590
|
}
|
|
1496
|
-
chart.displayBlanksAs = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1497
|
-
const styleId = Number(_nullishCoalesce(_optionalChain([styleIdNode, 'optionalAccess',
|
|
1591
|
+
chart.displayBlanksAs = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _206 => _206(chartNode, "dispBlanksAs"), 'optionalAccess', _207 => _207.getAttribute, 'call', _208 => _208("val")]), () => ( chart.displayBlanksAs));
|
|
1592
|
+
const styleId = Number(_nullishCoalesce(_optionalChain([styleIdNode, 'optionalAccess', _209 => _209.getAttribute, 'call', _210 => _210("val")]), () => ( Number.NaN)));
|
|
1498
1593
|
chart.chartStyleId = Number.isFinite(styleId) ? styleId : chart.chartStyleId;
|
|
1499
1594
|
chart.firstSliceAngle = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "firstSliceAng"), () => ( chart.firstSliceAngle));
|
|
1500
1595
|
chart.gapWidth = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "gapWidth"), () => ( chart.gapWidth));
|
|
@@ -1504,9 +1599,9 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1504
1599
|
const bubble3dNode = getFirstLocalChild(chartTypeNode, "bubble3D");
|
|
1505
1600
|
chart.bubble3d = bubble3dNode ? bubble3dNode.getAttribute("val") !== "0" : chart.bubble3d;
|
|
1506
1601
|
chart.holeSize = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "holeSize"), () => ( chart.holeSize));
|
|
1507
|
-
chart.radarStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1508
|
-
chart.scatterStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1509
|
-
chart.shape3d = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1602
|
+
chart.radarStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _211 => _211(chartTypeNode, "radarStyle"), 'optionalAccess', _212 => _212.getAttribute, 'call', _213 => _213("val")]), () => ( chart.radarStyle));
|
|
1603
|
+
chart.scatterStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _214 => _214(chartTypeNode, "scatterStyle"), 'optionalAccess', _215 => _215.getAttribute, 'call', _216 => _216("val")]), () => ( chart.scatterStyle));
|
|
1604
|
+
chart.shape3d = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _217 => _217(chartTypeNode, "shape"), 'optionalAccess', _218 => _218.getAttribute, 'call', _219 => _219("val")]), () => ( chart.shape3d));
|
|
1510
1605
|
const wireframeNode = getFirstLocalChild(chartTypeNode, "wireframe");
|
|
1511
1606
|
chart.wireframe = wireframeNode ? wireframeNode.getAttribute("val") !== "0" : chart.wireframe;
|
|
1512
1607
|
const chartTypeDataLabels = parseChartDataLabelsFromXml(getFirstLocalChild(chartTypeNode, "dLbls"));
|
|
@@ -1514,7 +1609,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1514
1609
|
const seriesDataLabels = parseChartDataLabelsFromXml(getFirstLocalChild(firstSeriesNode, "dLbls"));
|
|
1515
1610
|
chart.dataLabels = _nullishCoalesce(_nullishCoalesce(chartTypeDataLabels, () => ( seriesDataLabels)), () => ( chart.dataLabels));
|
|
1516
1611
|
const seriesSp3dNode = firstSeriesNode ? getFirstLocalDescendant(firstSeriesNode, "sp3d") : null;
|
|
1517
|
-
chart.surfaceMaterial = _nullishCoalesce(_optionalChain([seriesSp3dNode, 'optionalAccess',
|
|
1612
|
+
chart.surfaceMaterial = _nullishCoalesce(_optionalChain([seriesSp3dNode, 'optionalAccess', _220 => _220.getAttribute, 'call', _221 => _221("prstMaterial")]), () => ( chart.surfaceMaterial));
|
|
1518
1613
|
const bandFormatsNode = _nullishCoalesce(getLocalChildren(chartTypeNode, "bandFmts")[0], () => ( null));
|
|
1519
1614
|
const bandFormatNodes = bandFormatsNode ? getLocalChildren(bandFormatsNode, "bandFmt") : [];
|
|
1520
1615
|
const bandFormatColors = /* @__PURE__ */ Object.create(null);
|
|
@@ -1529,7 +1624,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1529
1624
|
const fillColor = getFirstLocalChild(shapeProperties, "noFill") ? "transparent" : resolveChartFillColor(shapeProperties, themePalette);
|
|
1530
1625
|
const lineStyle = resolveChartLineStyle(shapeProperties, themePalette);
|
|
1531
1626
|
const lineColor = lineStyle.hidden ? "transparent" : lineStyle.color;
|
|
1532
|
-
const lineWidth = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1627
|
+
const lineWidth = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _222 => _222(shapeProperties, "ln"), 'optionalAccess', _223 => _223.getAttribute, 'call', _224 => _224("w")]), () => ( Number.NaN)));
|
|
1533
1628
|
if (fillColor) bandFormatColors[index] = fillColor;
|
|
1534
1629
|
if (lineColor) bandFormatLineColors[index] = lineColor;
|
|
1535
1630
|
if (Number.isFinite(lineWidth) && lineWidth >= 0) bandFormatLineWidths[index] = lineWidth / EMU_PER_PIXEL;
|
|
@@ -1539,16 +1634,16 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1539
1634
|
bandFormatColors: Object.keys(bandFormatColors).length > 0 ? bandFormatColors : void 0,
|
|
1540
1635
|
bandFormatLineColors: Object.keys(bandFormatLineColors).length > 0 ? bandFormatLineColors : void 0,
|
|
1541
1636
|
bandFormatLineWidths: Object.keys(bandFormatLineWidths).length > 0 ? bandFormatLineWidths : void 0,
|
|
1542
|
-
date1904: readChartBooleanAttribute(_nullishCoalesce(_optionalChain([chartDocument, 'optionalAccess',
|
|
1637
|
+
date1904: readChartBooleanAttribute(_nullishCoalesce(_optionalChain([chartDocument, 'optionalAccess', _225 => _225.documentElement]), () => ( null)), "date1904"),
|
|
1543
1638
|
titleOverlay: readChartBooleanAttribute(getFirstLocalChild(chartNode, "title"), "overlay"),
|
|
1544
1639
|
bubble3d: chart.bubble3d,
|
|
1545
|
-
grouping: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1546
|
-
ofPieType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1547
|
-
shape: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1640
|
+
grouping: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _226 => _226(chartTypeNode, "grouping"), 'optionalAccess', _227 => _227.getAttribute, 'call', _228 => _228("val")]), () => ( void 0)),
|
|
1641
|
+
ofPieType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _229 => _229(chartTypeNode, "ofPieType"), 'optionalAccess', _230 => _230.getAttribute, 'call', _231 => _231("val")]), () => ( void 0)),
|
|
1642
|
+
shape: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _232 => _232(chartTypeNode, "shape"), 'optionalAccess', _233 => _233.getAttribute, 'call', _234 => _234("val")]), () => ( void 0)),
|
|
1548
1643
|
secondPieSize: readChartNumericAttribute(chartTypeNode, "secondPieSize"),
|
|
1549
1644
|
scatterStyle: chart.scatterStyle,
|
|
1550
1645
|
splitPos: readChartNumericAttribute(chartTypeNode, "splitPos"),
|
|
1551
|
-
splitType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
1646
|
+
splitType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _235 => _235(chartTypeNode, "splitType"), 'optionalAccess', _236 => _236.getAttribute, 'call', _237 => _237("val")]), () => ( void 0)),
|
|
1552
1647
|
xmlChartType: chartTypeNode.localName
|
|
1553
1648
|
};
|
|
1554
1649
|
const view3dNode = getFirstLocalDescendant(chartNode, "view3D");
|
|
@@ -1557,7 +1652,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1557
1652
|
depthPercent: readChartNumericAttribute(view3dNode, "depthPercent"),
|
|
1558
1653
|
heightPercent: readChartNumericAttribute(view3dNode, "hPercent"),
|
|
1559
1654
|
perspective: readChartNumericAttribute(view3dNode, "perspective"),
|
|
1560
|
-
rAngAx: _optionalChain([getFirstLocalChild, 'call',
|
|
1655
|
+
rAngAx: _optionalChain([getFirstLocalChild, 'call', _238 => _238(view3dNode, "rAngAx"), 'optionalAccess', _239 => _239.getAttribute, 'call', _240 => _240("val")]) === "1",
|
|
1561
1656
|
rotX: readChartNumericAttribute(view3dNode, "rotX"),
|
|
1562
1657
|
rotY: readChartNumericAttribute(view3dNode, "rotY")
|
|
1563
1658
|
};
|
|
@@ -1566,7 +1661,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1566
1661
|
const wall = readChartWallFromXml(getFirstLocalChild(chartNode, key), themePalette);
|
|
1567
1662
|
if (wall) {
|
|
1568
1663
|
chart[key] = wall;
|
|
1569
|
-
const defaults = _optionalChain([chart, 'access',
|
|
1664
|
+
const defaults = _optionalChain([chart, 'access', _241 => _241.raw, 'optionalAccess', _242 => _242.builtinSurfaceDefaults]);
|
|
1570
1665
|
if (defaults) chart.raw = { ...chart.raw, builtinSurfaceDefaults: { ...defaults, [key]: void 0 } };
|
|
1571
1666
|
}
|
|
1572
1667
|
}
|
|
@@ -1575,7 +1670,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1575
1670
|
const titleTypeface = readChartTextTypeface(getFirstLocalDescendant(chartNode, "title"), themePalette);
|
|
1576
1671
|
chart.fontFamily = _nullishCoalesce(chartTextTypeface, () => ( chart.fontFamily));
|
|
1577
1672
|
chart.titleFontFamily = _nullishCoalesce(_nullishCoalesce(titleTypeface, () => ( chart.titleFontFamily)), () => ( chart.fontFamily));
|
|
1578
|
-
const chartAreaShapeProperties = _optionalChain([chartDocument, 'optionalAccess',
|
|
1673
|
+
const chartAreaShapeProperties = _optionalChain([chartDocument, 'optionalAccess', _243 => _243.documentElement]) ? getFirstLocalChild(chartDocument.documentElement, "spPr") : null;
|
|
1579
1674
|
const plotAreaShapeProperties = getFirstLocalChild(plotArea, "spPr");
|
|
1580
1675
|
const chartAreaNoFill = chartAreaShapeProperties ? getFirstLocalChild(chartAreaShapeProperties, "noFill") != null : false;
|
|
1581
1676
|
const plotAreaNoFill = plotAreaShapeProperties ? getFirstLocalChild(plotAreaShapeProperties, "noFill") != null : false;
|
|
@@ -1614,11 +1709,11 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1614
1709
|
let valueAxisNode = _nullishCoalesce(valueAxisNodes[0], () => ( null));
|
|
1615
1710
|
if (!categoryAxisNode && isScatterLikeChart && valueAxisNodes.length >= 2) {
|
|
1616
1711
|
categoryAxisNode = _nullishCoalesce(valueAxisNodes.find((axisNode) => {
|
|
1617
|
-
const position = _optionalChain([getFirstLocalChild, 'call',
|
|
1712
|
+
const position = _optionalChain([getFirstLocalChild, 'call', _244 => _244(axisNode, "axPos"), 'optionalAccess', _245 => _245.getAttribute, 'call', _246 => _246("val")]);
|
|
1618
1713
|
return position === "b" || position === "t";
|
|
1619
1714
|
}), () => ( valueAxisNodes[0]));
|
|
1620
1715
|
valueAxisNode = _nullishCoalesce(_nullishCoalesce(valueAxisNodes.find((axisNode) => {
|
|
1621
|
-
const position = _optionalChain([getFirstLocalChild, 'call',
|
|
1716
|
+
const position = _optionalChain([getFirstLocalChild, 'call', _247 => _247(axisNode, "axPos"), 'optionalAccess', _248 => _248.getAttribute, 'call', _249 => _249("val")]);
|
|
1622
1717
|
return position === "l" || position === "r";
|
|
1623
1718
|
}), () => ( valueAxisNodes[1])), () => ( valueAxisNodes[0]));
|
|
1624
1719
|
}
|
|
@@ -1632,11 +1727,22 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1632
1727
|
chart.axes = [...chart.axes, seriesAxis];
|
|
1633
1728
|
}
|
|
1634
1729
|
}
|
|
1635
|
-
const
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1730
|
+
const groups = Array.from(plotArea.children).filter((entry) => entry.localName.endsWith("Chart"));
|
|
1731
|
+
const seriesTypes = groups.flatMap((group) => getLocalChildren(group, "ser").map(() => group.localName.slice(0, -5)));
|
|
1732
|
+
const seriesNodes = groups.flatMap((group) => getLocalChildren(group, "ser"));
|
|
1733
|
+
const indexedXSeries = seriesNodes.map((series) => {
|
|
1734
|
+
const x = getFirstLocalChild(series, "xVal");
|
|
1735
|
+
return Boolean(x && (getFirstLocalChild(x, "multiLvlStrRef") || getFirstLocalChild(x, "strRef") || getFirstLocalChild(x, "strLit")));
|
|
1736
|
+
});
|
|
1737
|
+
const unsupportedHierarchy = getLocalDescendants(plotArea, "multiLvlStrRef").some((node) => _optionalChain([node, 'access', _250 => _250.parentElement, 'optionalAccess', _251 => _251.localName]) !== "xVal");
|
|
1738
|
+
const kind = chartTypeNode.localName.slice(0, -5);
|
|
1739
|
+
const stable = groups.length === 1 && !chart.is3d && (kind === "line" && chart.chartType === "Line" || kind === "bar" && chart.chartType === "ColumnClustered") && !plotArea.querySelector("trendline, errBars, dropLines, hiLowLines, upDownBars, dateAx, multiLvlStrRef, pictureOptions");
|
|
1740
|
+
if (seriesTypes.length === chart.series.length && !unsupportedHierarchy && !plotArea.querySelector("pictureOptions")) {
|
|
1638
1741
|
chart.renderSource = {
|
|
1639
1742
|
kind,
|
|
1743
|
+
seriesTypes,
|
|
1744
|
+
indexedXSeries,
|
|
1745
|
+
experimental: !stable,
|
|
1640
1746
|
xml: chartXml,
|
|
1641
1747
|
themeColors: themePalette ? Object.fromEntries(Object.entries(THEME_COLOR_INDEX_BY_NAME).flatMap(([key, index]) => {
|
|
1642
1748
|
const color = themePalette.colorsByIndex[index];
|
|
@@ -1647,7 +1753,21 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
|
|
|
1647
1753
|
colorStyleXml: _nullishCoalesce(readArchiveText(archive, relationships.get(CHART_COLOR_STYLE_REL_TYPE)), () => ( void 0))
|
|
1648
1754
|
};
|
|
1649
1755
|
}
|
|
1650
|
-
|
|
1756
|
+
if (groups.length > 1 && _optionalChain([chart, 'access', _252 => _252.typeGroups, 'optionalAccess', _253 => _253.length]) === groups.length) {
|
|
1757
|
+
let seriesOffset = 0;
|
|
1758
|
+
const hydratedSeries = [];
|
|
1759
|
+
chart.typeGroups = chart.typeGroups.map((group, index) => {
|
|
1760
|
+
const count = getLocalChildren(groups[index], "ser").length;
|
|
1761
|
+
const groupChart = { ...chart, chartType: group.chartType, series: chart.series.slice(seriesOffset, seriesOffset + count) };
|
|
1762
|
+
applyChartSeriesStyleFromXml(groupChart, groups[index], themePalette);
|
|
1763
|
+
seriesOffset += count;
|
|
1764
|
+
hydratedSeries.push(...groupChart.series);
|
|
1765
|
+
return { ...group, series: groupChart.series };
|
|
1766
|
+
});
|
|
1767
|
+
chart.series = [...hydratedSeries, ...chart.series.slice(seriesOffset)];
|
|
1768
|
+
} else {
|
|
1769
|
+
applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette);
|
|
1770
|
+
}
|
|
1651
1771
|
applyFallbackSeriesStyles();
|
|
1652
1772
|
applyBuiltinChartDefaults(chart, themePalette);
|
|
1653
1773
|
}
|
|
@@ -1714,15 +1834,15 @@ function serializeXml(document2) {
|
|
|
1714
1834
|
return new XMLSerializer().serializeToString(document2);
|
|
1715
1835
|
}
|
|
1716
1836
|
function getLocalChildren(parent, localName) {
|
|
1717
|
-
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
|
1837
|
+
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _254 => _254.childNodes]), () => ( []))).filter(
|
|
1718
1838
|
(node) => node.nodeType === Node.ELEMENT_NODE && node.localName === localName
|
|
1719
1839
|
);
|
|
1720
1840
|
}
|
|
1721
1841
|
function removeLocalChildren(parent, localName) {
|
|
1722
|
-
getLocalChildren(parent, localName).forEach((node) => _optionalChain([node, 'access',
|
|
1842
|
+
getLocalChildren(parent, localName).forEach((node) => _optionalChain([node, 'access', _255 => _255.parentNode, 'optionalAccess', _256 => _256.removeChild, 'call', _257 => _257(node)]));
|
|
1723
1843
|
}
|
|
1724
1844
|
function getLocalDescendants(parent, localName) {
|
|
1725
|
-
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
|
1845
|
+
return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _258 => _258.getElementsByTagName, 'call', _259 => _259("*")]), () => ( []))).filter(
|
|
1726
1846
|
(node) => node.localName === localName
|
|
1727
1847
|
);
|
|
1728
1848
|
}
|
|
@@ -1834,8 +1954,8 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
|
|
|
1834
1954
|
if (!formula) {
|
|
1835
1955
|
return {
|
|
1836
1956
|
range: null,
|
|
1837
|
-
sheet: workbook.getSheet(fallbackSheetIndex),
|
|
1838
|
-
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access',
|
|
1957
|
+
sheet: fallbackSheetIndex < workbook.sheetCount ? workbook.getSheet(fallbackSheetIndex) : null,
|
|
1958
|
+
sheetName: fallbackSheetIndex < workbook.sheetCount ? _nullishCoalesce(_optionalChain([workbook, 'access', _260 => _260.getSheet, 'call', _261 => _261(fallbackSheetIndex), 'optionalAccess', _262 => _262.name]), () => ( "")) : ""
|
|
1839
1959
|
};
|
|
1840
1960
|
}
|
|
1841
1961
|
const trimmedFormula = formula.trim();
|
|
@@ -1852,8 +1972,8 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
|
|
|
1852
1972
|
if (!split) {
|
|
1853
1973
|
return {
|
|
1854
1974
|
range: parseA1Range(trimmedFormula),
|
|
1855
|
-
sheet: workbook.getSheet(fallbackSheetIndex),
|
|
1856
|
-
sheetName: _nullishCoalesce(_optionalChain([workbook, 'access',
|
|
1975
|
+
sheet: fallbackSheetIndex < workbook.sheetCount ? workbook.getSheet(fallbackSheetIndex) : null,
|
|
1976
|
+
sheetName: fallbackSheetIndex < workbook.sheetCount ? _nullishCoalesce(_optionalChain([workbook, 'access', _263 => _263.getSheet, 'call', _264 => _264(fallbackSheetIndex), 'optionalAccess', _265 => _265.name]), () => ( "")) : ""
|
|
1857
1977
|
};
|
|
1858
1978
|
}
|
|
1859
1979
|
try {
|
|
@@ -1865,13 +1985,13 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
|
|
|
1865
1985
|
} catch (e3) {
|
|
1866
1986
|
return {
|
|
1867
1987
|
range: parseA1Range(split.range),
|
|
1868
|
-
sheet:
|
|
1869
|
-
sheetName:
|
|
1988
|
+
sheet: null,
|
|
1989
|
+
sheetName: split.sheetName
|
|
1870
1990
|
};
|
|
1871
1991
|
}
|
|
1872
1992
|
}
|
|
1873
1993
|
function resolveChartReferenceLabel(workbook, fallbackSheetIndex, reference, fallbackLabel) {
|
|
1874
|
-
if (!_optionalChain([reference, 'optionalAccess',
|
|
1994
|
+
if (!_optionalChain([reference, 'optionalAccess', _266 => _266.formula])) {
|
|
1875
1995
|
return fallbackLabel;
|
|
1876
1996
|
}
|
|
1877
1997
|
const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
|
|
@@ -1893,7 +2013,7 @@ function resolveChartReferenceLabel(workbook, fallbackSheetIndex, reference, fal
|
|
|
1893
2013
|
return firstDisplay.length > 0 ? firstDisplay : fallbackLabel;
|
|
1894
2014
|
}
|
|
1895
2015
|
function resolveReferenceRowPaths(workbook, fallbackSheetIndex, reference) {
|
|
1896
|
-
if (!_optionalChain([reference, 'optionalAccess',
|
|
2016
|
+
if (!_optionalChain([reference, 'optionalAccess', _267 => _267.formula])) {
|
|
1897
2017
|
return [];
|
|
1898
2018
|
}
|
|
1899
2019
|
const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
|
|
@@ -1947,11 +2067,11 @@ function normalizeChartExAxis(raw) {
|
|
|
1947
2067
|
id: typeof axis.id === "number" && Number.isFinite(axis.id) ? axis.id : void 0,
|
|
1948
2068
|
crossId: typeof axis.crossId === "number" && Number.isFinite(axis.crossId) ? axis.crossId : void 0,
|
|
1949
2069
|
majorGridlines: axis.majorGridlines != null ? true : void 0,
|
|
1950
|
-
majorUnit: typeof _optionalChain([scaling, 'optionalAccess',
|
|
1951
|
-
max: typeof _optionalChain([scaling, 'optionalAccess',
|
|
1952
|
-
min: typeof _optionalChain([scaling, 'optionalAccess',
|
|
2070
|
+
majorUnit: typeof _optionalChain([scaling, 'optionalAccess', _268 => _268.majorUnit]) === "number" ? scaling.majorUnit : void 0,
|
|
2071
|
+
max: typeof _optionalChain([scaling, 'optionalAccess', _269 => _269.max]) === "number" ? scaling.max : void 0,
|
|
2072
|
+
min: typeof _optionalChain([scaling, 'optionalAccess', _270 => _270.min]) === "number" ? scaling.min : void 0,
|
|
1953
2073
|
minorGridlines: axis.minorGridlines != null ? true : void 0,
|
|
1954
|
-
minorUnit: typeof _optionalChain([scaling, 'optionalAccess',
|
|
2074
|
+
minorUnit: typeof _optionalChain([scaling, 'optionalAccess', _271 => _271.minorUnit]) === "number" ? scaling.minorUnit : void 0,
|
|
1955
2075
|
numberFormat: numberFormat ? {
|
|
1956
2076
|
formatCode: typeof numberFormat.formatCode === "string" ? numberFormat.formatCode : void 0,
|
|
1957
2077
|
sourceLinked: typeof numberFormat.sourceLinked === "boolean" ? numberFormat.sourceLinked : void 0
|
|
@@ -2043,13 +2163,13 @@ function buildChartExHistogramBins(values, rawSeries, sortByFrequency) {
|
|
|
2043
2163
|
return [];
|
|
2044
2164
|
}
|
|
2045
2165
|
const rawRecord = rawSeries && typeof rawSeries === "object" ? rawSeries : null;
|
|
2046
|
-
const layoutProperties = _optionalChain([rawRecord, 'optionalAccess',
|
|
2047
|
-
const rawBinning = _optionalChain([layoutProperties, 'optionalAccess',
|
|
2166
|
+
const layoutProperties = _optionalChain([rawRecord, 'optionalAccess', _272 => _272.layoutProperties]) && typeof rawRecord.layoutProperties === "object" ? rawRecord.layoutProperties : null;
|
|
2167
|
+
const rawBinning = _optionalChain([layoutProperties, 'optionalAccess', _273 => _273.binning]) && typeof layoutProperties.binning === "object" ? layoutProperties.binning : null;
|
|
2048
2168
|
const minValue = Math.min(...values);
|
|
2049
2169
|
const maxValue = Math.max(...values);
|
|
2050
|
-
const explicitWidth = typeof _optionalChain([rawBinning, 'optionalAccess',
|
|
2051
|
-
const explicitCount = typeof _optionalChain([rawBinning, 'optionalAccess',
|
|
2052
|
-
const closedRight = _optionalChain([rawBinning, 'optionalAccess',
|
|
2170
|
+
const explicitWidth = typeof _optionalChain([rawBinning, 'optionalAccess', _274 => _274.binSize]) === "number" && Number.isFinite(rawBinning.binSize) && rawBinning.binSize > 0 ? rawBinning.binSize : void 0;
|
|
2171
|
+
const explicitCount = typeof _optionalChain([rawBinning, 'optionalAccess', _275 => _275.binCount]) === "number" && Number.isFinite(rawBinning.binCount) && rawBinning.binCount > 0 ? rawBinning.binCount : typeof _optionalChain([rawBinning, 'optionalAccess', _276 => _276.count]) === "number" && Number.isFinite(rawBinning.count) && rawBinning.count > 0 ? rawBinning.count : void 0;
|
|
2172
|
+
const closedRight = _optionalChain([rawBinning, 'optionalAccess', _277 => _277.intervalClosed]) === "r" || _optionalChain([rawBinning, 'optionalAccess', _278 => _278.intervalClosed]) === "right";
|
|
2053
2173
|
const mean = values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
2054
2174
|
const variance = values.reduce((sum, value) => sum + (value - mean) ** 2, 0) / Math.max(1, values.length);
|
|
2055
2175
|
const standardDeviation = Math.sqrt(Math.max(0, variance));
|
|
@@ -2100,7 +2220,7 @@ function buildChartExHistogramSeries(series, rawSeries, sortByFrequency) {
|
|
|
2100
2220
|
const layout = resolveChartExSeriesLayout(rawSeries);
|
|
2101
2221
|
const rawRecord = rawSeries && typeof rawSeries === "object" ? rawSeries : null;
|
|
2102
2222
|
const hasBinning = Boolean(
|
|
2103
|
-
layout === "clusteredColumn" && _optionalChain([rawRecord, 'optionalAccess',
|
|
2223
|
+
layout === "clusteredColumn" && _optionalChain([rawRecord, 'optionalAccess', _279 => _279.layoutProperties]) && typeof rawRecord.layoutProperties === "object" && rawRecord.layoutProperties.binning != null
|
|
2104
2224
|
);
|
|
2105
2225
|
if (!hasBinning) {
|
|
2106
2226
|
return series;
|
|
@@ -2135,13 +2255,14 @@ function buildChartExParetoLineSeries(series, sourceRaw, index) {
|
|
|
2135
2255
|
});
|
|
2136
2256
|
return {
|
|
2137
2257
|
...series,
|
|
2258
|
+
id: series.id.replace(/-series-\d+$/, `-series-${index}`),
|
|
2138
2259
|
color: void 0,
|
|
2139
2260
|
lineColor: void 0,
|
|
2140
2261
|
markerColor: void 0,
|
|
2141
2262
|
markerLineColor: void 0,
|
|
2142
2263
|
markerSize: 7,
|
|
2143
2264
|
markerSymbol: "circle",
|
|
2144
|
-
name: typeof _optionalChain([sourceRaw, 'optionalAccess',
|
|
2265
|
+
name: typeof _optionalChain([sourceRaw, 'optionalAccess', _280 => _280.text]) === "string" ? sourceRaw.text : "Pareto",
|
|
2145
2266
|
raw: {
|
|
2146
2267
|
..._nullishCoalesce(series.raw, () => ( {})),
|
|
2147
2268
|
chartExLayout: "paretoLine",
|
|
@@ -2212,11 +2333,11 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2212
2333
|
const series = raw && typeof raw === "object" ? raw : {};
|
|
2213
2334
|
const dataId = typeof series.dataId === "number" ? series.dataId : null;
|
|
2214
2335
|
const dataEntry = dataId != null ? _nullishCoalesce(dataById.get(dataId), () => ( null)) : null;
|
|
2215
|
-
const dimensions = Array.isArray(_optionalChain([dataEntry, 'optionalAccess',
|
|
2336
|
+
const dimensions = Array.isArray(_optionalChain([dataEntry, 'optionalAccess', _281 => _281.dimensions])) ? dataEntry.dimensions.filter((value) => Boolean(value && typeof value === "object")) : [];
|
|
2216
2337
|
const categoryDimension = _nullishCoalesce(_nullishCoalesce(dimensions.find((dimension) => dimension.dimType === "cat"), () => ( dimensions.find((dimension) => dimension.dimType === "name"))), () => ( null));
|
|
2217
2338
|
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));
|
|
2218
|
-
const categoryDimensionFormula = typeof _optionalChain([categoryDimension, 'optionalAccess',
|
|
2219
|
-
const valueDimensionFormula = typeof _optionalChain([valueDimension, 'optionalAccess',
|
|
2339
|
+
const categoryDimensionFormula = typeof _optionalChain([categoryDimension, 'optionalAccess', _282 => _282.formula]) === "string" ? categoryDimension.formula : void 0;
|
|
2340
|
+
const valueDimensionFormula = typeof _optionalChain([valueDimension, 'optionalAccess', _283 => _283.formula]) === "string" ? valueDimension.formula : void 0;
|
|
2220
2341
|
const fallbackCategoryRef = (chartType === "Sunburst" || chartType === "Treemap") && !categoryDimension && typeof valueDimensionFormula === "string" ? resolveChartExFallbackCategoryReference(workbook, workbookSheetIndex, valueDimensionFormula) : null;
|
|
2221
2342
|
const categoriesRef = categoryDimension ? normalizeChartReference({
|
|
2222
2343
|
formula: categoryDimensionFormula
|
|
@@ -2224,7 +2345,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2224
2345
|
const valuesRef = valueDimension ? normalizeChartReference({
|
|
2225
2346
|
formula: valueDimensionFormula
|
|
2226
2347
|
}) : null;
|
|
2227
|
-
const isCategoricalMap = chartType === "RegionMap" && _optionalChain([valueDimension, 'optionalAccess',
|
|
2348
|
+
const isCategoricalMap = chartType === "RegionMap" && _optionalChain([valueDimension, 'optionalAccess', _284 => _284.dimType]) === "colorStr";
|
|
2228
2349
|
const resolvedValueCells = resolveReferenceValues(workbook, workbookSheetIndex, valuesRef, isCategoricalMap ? "category" : "value");
|
|
2229
2350
|
const values = resolvedValueCells.map((value) => typeof value === "number" && Number.isFinite(value) ? value : null);
|
|
2230
2351
|
const colorStrings = isCategoricalMap ? resolvedValueCells.map((value) => {
|
|
@@ -2242,8 +2363,8 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2242
2363
|
const hierarchyCategories = chartType === "Sunburst" || chartType === "Treemap" ? resolveReferenceRowPaths(workbook, workbookSheetIndex, categoriesRef) : [];
|
|
2243
2364
|
const seriesTextFormula = resolveChartExTextFormula(series.text);
|
|
2244
2365
|
const shapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : void 0;
|
|
2245
|
-
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2246
|
-
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2366
|
+
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _285 => _285.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
|
|
2367
|
+
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _286 => _286.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
|
|
2247
2368
|
return {
|
|
2248
2369
|
bubbleSizeRef: null,
|
|
2249
2370
|
bubbleSizes: [],
|
|
@@ -2257,7 +2378,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2257
2378
|
id: `${chartId}-series-${index}`,
|
|
2258
2379
|
invertIfNegative: void 0,
|
|
2259
2380
|
lineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
|
|
2260
|
-
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2381
|
+
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _287 => _287.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
|
|
2261
2382
|
marker: void 0,
|
|
2262
2383
|
markerColor: _nullishCoalesce(rawFillColor, () => ( void 0)),
|
|
2263
2384
|
markerLineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
|
|
@@ -2271,7 +2392,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
|
|
|
2271
2392
|
chartExColorStrings: colorStrings,
|
|
2272
2393
|
chartExHierarchyCategories: hierarchyCategories,
|
|
2273
2394
|
data: dataEntry,
|
|
2274
|
-
dimType: typeof _optionalChain([valueDimension, 'optionalAccess',
|
|
2395
|
+
dimType: typeof _optionalChain([valueDimension, 'optionalAccess', _288 => _288.dimType]) === "string" ? valueDimension.dimType : void 0
|
|
2275
2396
|
},
|
|
2276
2397
|
shapeProperties,
|
|
2277
2398
|
smooth: void 0,
|
|
@@ -2283,7 +2404,7 @@ function collapseChartExPointSeries(chartType, series) {
|
|
|
2283
2404
|
if (chartType !== "Funnel" && chartType !== "Waterfall") {
|
|
2284
2405
|
if ((chartType === "Sunburst" || chartType === "Treemap") && series.length > 1 && series.every((entry) => {
|
|
2285
2406
|
const raw = entry.raw && typeof entry.raw === "object" ? entry.raw : null;
|
|
2286
|
-
return _optionalChain([raw, 'optionalAccess',
|
|
2407
|
+
return _optionalChain([raw, 'optionalAccess', _289 => _289.dimType]) === "size";
|
|
2287
2408
|
})) {
|
|
2288
2409
|
const primarySeries2 = _nullishCoalesce(_nullishCoalesce(series.find((entry) => entry.hidden !== true), () => ( series[0])), () => ( null));
|
|
2289
2410
|
if (!primarySeries2) {
|
|
@@ -2397,7 +2518,7 @@ function normalizeChartExChart(workbook, workbookSheetIndex, visibleSheetIndex,
|
|
|
2397
2518
|
name: typeof drawing.name === "string" ? drawing.name : chartTitle,
|
|
2398
2519
|
overlap: void 0,
|
|
2399
2520
|
plotVisibleOnly: void 0,
|
|
2400
|
-
raw: chart,
|
|
2521
|
+
raw: { ...chart, officeSourceSeries: normalizedSeries },
|
|
2401
2522
|
radarStyle: void 0,
|
|
2402
2523
|
scatterStyle: void 0,
|
|
2403
2524
|
roundedCorners: void 0,
|
|
@@ -2503,8 +2624,8 @@ function cellValueToDisplay(value) {
|
|
|
2503
2624
|
return String(value);
|
|
2504
2625
|
}
|
|
2505
2626
|
function resolveReferenceValues(workbook, fallbackSheetIndex, reference, mode) {
|
|
2506
|
-
if (!_optionalChain([reference, 'optionalAccess',
|
|
2507
|
-
return _nullishCoalesce(_optionalChain([reference, 'optionalAccess',
|
|
2627
|
+
if (!_optionalChain([reference, 'optionalAccess', _290 => _290.formula])) {
|
|
2628
|
+
return _nullishCoalesce(_optionalChain([reference, 'optionalAccess', _291 => _291.values]), () => ( []));
|
|
2508
2629
|
}
|
|
2509
2630
|
const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
|
|
2510
2631
|
if (!resolved.sheet || !resolved.range) {
|
|
@@ -2602,30 +2723,30 @@ function readChartAxisFromXml(axisNode, themePalette) {
|
|
|
2602
2723
|
const scalingNode = getFirstLocalChild(axisNode, "scaling");
|
|
2603
2724
|
return {
|
|
2604
2725
|
crossId: readChartNumericAttribute(axisNode, "crossAx"),
|
|
2605
|
-
crosses: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2606
|
-
crossBetween: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2607
|
-
delete: _optionalChain([getFirstLocalChild, 'call',
|
|
2726
|
+
crosses: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _292 => _292(axisNode, "crosses"), 'optionalAccess', _293 => _293.getAttribute, 'call', _294 => _294("val")]), () => ( void 0)),
|
|
2727
|
+
crossBetween: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _295 => _295(axisNode, "crossBetween"), 'optionalAccess', _296 => _296.getAttribute, 'call', _297 => _297("val")]), () => ( void 0)),
|
|
2728
|
+
delete: _optionalChain([getFirstLocalChild, 'call', _298 => _298(axisNode, "delete"), 'optionalAccess', _299 => _299.getAttribute, 'call', _300 => _300("val")]) === "1" ? true : _optionalChain([getFirstLocalChild, 'call', _301 => _301(axisNode, "delete"), 'optionalAccess', _302 => _302.getAttribute, 'call', _303 => _303("val")]) === "0" ? false : void 0,
|
|
2608
2729
|
id: readChartNumericAttribute(axisNode, "axId"),
|
|
2609
|
-
labelPosition: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2730
|
+
labelPosition: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _304 => _304(axisNode, "tickLblPos"), 'optionalAccess', _305 => _305.getAttribute, 'call', _306 => _306("val")]), () => ( void 0)),
|
|
2610
2731
|
logBase: readChartNumericAttribute(getFirstLocalChild(axisNode, "scaling"), "logBase"),
|
|
2611
|
-
orientation: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2732
|
+
orientation: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _307 => _307(_nullishCoalesce(scalingNode, () => ( axisNode)), "orientation"), 'optionalAccess', _308 => _308.getAttribute, 'call', _309 => _309("val")]), () => ( void 0)),
|
|
2612
2733
|
majorGridlines: Boolean(getFirstLocalChild(axisNode, "majorGridlines")),
|
|
2613
2734
|
majorGridlineColor: (() => {
|
|
2614
2735
|
const style = resolveChartLineStyle(getFirstLocalChild(getFirstLocalChild(axisNode, "majorGridlines"), "spPr"), themePalette);
|
|
2615
2736
|
return style.hidden ? "transparent" : _nullishCoalesce(style.color, () => ( void 0));
|
|
2616
2737
|
})(),
|
|
2617
|
-
majorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2738
|
+
majorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _310 => _310(axisNode, "majorTickMark"), 'optionalAccess', _311 => _311.getAttribute, 'call', _312 => _312("val")]), () => ( void 0)),
|
|
2618
2739
|
majorUnit: readChartNumericAttribute(axisNode, "majorUnit"),
|
|
2619
2740
|
max: readChartNumericAttribute(scalingNode, "max"),
|
|
2620
2741
|
min: readChartNumericAttribute(scalingNode, "min"),
|
|
2621
2742
|
minorGridlines: Boolean(getFirstLocalChild(axisNode, "minorGridlines")),
|
|
2622
|
-
minorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2743
|
+
minorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _313 => _313(axisNode, "minorTickMark"), 'optionalAccess', _314 => _314.getAttribute, 'call', _315 => _315("val")]), () => ( void 0)),
|
|
2623
2744
|
minorUnit: readChartNumericAttribute(axisNode, "minorUnit"),
|
|
2624
2745
|
numberFormat: numFmt ? {
|
|
2625
2746
|
formatCode: _nullishCoalesce(numFmt.getAttribute("formatCode"), () => ( void 0)),
|
|
2626
2747
|
sourceLinked: numFmt.getAttribute("sourceLinked") === "1" ? true : numFmt.getAttribute("sourceLinked") === "0" ? false : void 0
|
|
2627
2748
|
} : void 0,
|
|
2628
|
-
position: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2749
|
+
position: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _316 => _316(axisNode, "axPos"), 'optionalAccess', _317 => _317.getAttribute, 'call', _318 => _318("val")]), () => ( void 0)),
|
|
2629
2750
|
tickLabelSkip: readChartNumericAttribute(axisNode, "tickLblSkip"),
|
|
2630
2751
|
tickMarkSkip: readChartNumericAttribute(axisNode, "tickMarkSkip")
|
|
2631
2752
|
};
|
|
@@ -2715,10 +2836,10 @@ function normalizeChartAnchor(raw) {
|
|
|
2715
2836
|
if (anchor.type === "oneCell") {
|
|
2716
2837
|
return {
|
|
2717
2838
|
from: {
|
|
2718
|
-
col: typeof _optionalChain([from, 'optionalAccess',
|
|
2719
|
-
colOffsetEmu: typeof _optionalChain([from, 'optionalAccess',
|
|
2720
|
-
row: typeof _optionalChain([from, 'optionalAccess',
|
|
2721
|
-
rowOffsetEmu: typeof _optionalChain([from, 'optionalAccess',
|
|
2839
|
+
col: typeof _optionalChain([from, 'optionalAccess', _319 => _319.col]) === "number" ? from.col : 0,
|
|
2840
|
+
colOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _320 => _320.colOffsetEmu]) === "number" ? from.colOffsetEmu : 0,
|
|
2841
|
+
row: typeof _optionalChain([from, 'optionalAccess', _321 => _321.row]) === "number" ? from.row : 0,
|
|
2842
|
+
rowOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _322 => _322.rowOffsetEmu]) === "number" ? from.rowOffsetEmu : 0
|
|
2722
2843
|
},
|
|
2723
2844
|
kind: "one-cell",
|
|
2724
2845
|
sizeEmu: {
|
|
@@ -2741,14 +2862,14 @@ function normalizeChartAnchor(raw) {
|
|
|
2741
2862
|
};
|
|
2742
2863
|
}
|
|
2743
2864
|
const to = anchor.to && typeof anchor.to === "object" ? anchor.to : null;
|
|
2744
|
-
const fromColValue = _optionalChain([from, 'optionalAccess',
|
|
2745
|
-
const fromColOffsetValue = _optionalChain([from, 'optionalAccess',
|
|
2746
|
-
const fromRowValue = _optionalChain([from, 'optionalAccess',
|
|
2747
|
-
const fromRowOffsetValue = _optionalChain([from, 'optionalAccess',
|
|
2748
|
-
const toColValue = _optionalChain([to, 'optionalAccess',
|
|
2749
|
-
const toColOffsetValue = _optionalChain([to, 'optionalAccess',
|
|
2750
|
-
const toRowValue = _optionalChain([to, 'optionalAccess',
|
|
2751
|
-
const toRowOffsetValue = _optionalChain([to, 'optionalAccess',
|
|
2865
|
+
const fromColValue = _optionalChain([from, 'optionalAccess', _323 => _323.col]);
|
|
2866
|
+
const fromColOffsetValue = _optionalChain([from, 'optionalAccess', _324 => _324.colOffsetEmu]);
|
|
2867
|
+
const fromRowValue = _optionalChain([from, 'optionalAccess', _325 => _325.row]);
|
|
2868
|
+
const fromRowOffsetValue = _optionalChain([from, 'optionalAccess', _326 => _326.rowOffsetEmu]);
|
|
2869
|
+
const toColValue = _optionalChain([to, 'optionalAccess', _327 => _327.col]);
|
|
2870
|
+
const toColOffsetValue = _optionalChain([to, 'optionalAccess', _328 => _328.colOffsetEmu]);
|
|
2871
|
+
const toRowValue = _optionalChain([to, 'optionalAccess', _329 => _329.row]);
|
|
2872
|
+
const toRowOffsetValue = _optionalChain([to, 'optionalAccess', _330 => _330.rowOffsetEmu]);
|
|
2752
2873
|
const fromCol = typeof fromColValue === "number" ? fromColValue : 0;
|
|
2753
2874
|
const fromColOffsetEmu = typeof fromColOffsetValue === "number" ? fromColOffsetValue : 0;
|
|
2754
2875
|
const fromRow = typeof fromRowValue === "number" ? fromRowValue : 0;
|
|
@@ -2777,10 +2898,10 @@ function parseMarkerNode(node) {
|
|
|
2777
2898
|
if (!node) {
|
|
2778
2899
|
return null;
|
|
2779
2900
|
}
|
|
2780
|
-
const col = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2781
|
-
const row = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2782
|
-
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2783
|
-
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
2901
|
+
const col = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _331 => _331(node, "col"), 'optionalAccess', _332 => _332.textContent]), () => ( Number.NaN)));
|
|
2902
|
+
const row = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _333 => _333(node, "row"), 'optionalAccess', _334 => _334.textContent]), () => ( Number.NaN)));
|
|
2903
|
+
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _335 => _335(node, "colOff"), 'optionalAccess', _336 => _336.textContent]), () => ( 0)));
|
|
2904
|
+
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _337 => _337(node, "rowOff"), 'optionalAccess', _338 => _338.textContent]), () => ( 0)));
|
|
2784
2905
|
if (!Number.isFinite(col) || !Number.isFinite(row)) {
|
|
2785
2906
|
return null;
|
|
2786
2907
|
}
|
|
@@ -2800,8 +2921,8 @@ function parseChartAnchorNode(anchorNode) {
|
|
|
2800
2921
|
if (anchorNode.localName === "oneCellAnchor") {
|
|
2801
2922
|
const from = parseMarkerNode(getFirstLocalChild(anchorNode, "from"));
|
|
2802
2923
|
const ext2 = getFirstLocalChild(anchorNode, "ext");
|
|
2803
|
-
const cx2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess',
|
|
2804
|
-
const cy2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess',
|
|
2924
|
+
const cx2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _339 => _339.getAttribute, 'call', _340 => _340("cx")]), () => ( Number.NaN)));
|
|
2925
|
+
const cy2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _341 => _341.getAttribute, 'call', _342 => _342("cy")]), () => ( Number.NaN)));
|
|
2805
2926
|
return from && Number.isFinite(cx2) && Number.isFinite(cy2) ? {
|
|
2806
2927
|
from,
|
|
2807
2928
|
kind: "one-cell",
|
|
@@ -2813,10 +2934,10 @@ function parseChartAnchorNode(anchorNode) {
|
|
|
2813
2934
|
}
|
|
2814
2935
|
const pos = getFirstLocalChild(anchorNode, "pos");
|
|
2815
2936
|
const ext = getFirstLocalChild(anchorNode, "ext");
|
|
2816
|
-
const x = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
2817
|
-
const y = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
2818
|
-
const cx = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess',
|
|
2819
|
-
const cy = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess',
|
|
2937
|
+
const x = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _343 => _343.getAttribute, 'call', _344 => _344("x")]), () => ( Number.NaN)));
|
|
2938
|
+
const y = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _345 => _345.getAttribute, 'call', _346 => _346("y")]), () => ( Number.NaN)));
|
|
2939
|
+
const cx = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _347 => _347.getAttribute, 'call', _348 => _348("cx")]), () => ( Number.NaN)));
|
|
2940
|
+
const cy = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _349 => _349.getAttribute, 'call', _350 => _350("cy")]), () => ( Number.NaN)));
|
|
2820
2941
|
return Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(cx) && Number.isFinite(cy) ? {
|
|
2821
2942
|
kind: "absolute",
|
|
2822
2943
|
positionEmu: {
|
|
@@ -2842,8 +2963,8 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
|
|
|
2842
2963
|
const categoriesRef = normalizeChartReference(series.categories);
|
|
2843
2964
|
const valuesRef = normalizeChartReference(series.values);
|
|
2844
2965
|
const shapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : void 0;
|
|
2845
|
-
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2846
|
-
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2966
|
+
const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _351 => _351.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
|
|
2967
|
+
const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _352 => _352.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
|
|
2847
2968
|
const bubbleSizeRef = normalizeChartReference(_nullishCoalesce(_nullishCoalesce(series.bubbleSize, () => ( series.bubbleSizes)), () => ( series.bubbles)));
|
|
2848
2969
|
return {
|
|
2849
2970
|
bubbleSizeRef,
|
|
@@ -2856,7 +2977,7 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
|
|
|
2856
2977
|
id: `${chartId}-series-${index}`,
|
|
2857
2978
|
invertIfNegative: typeof series.invertIfNegative === "boolean" ? series.invertIfNegative : void 0,
|
|
2858
2979
|
lineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
|
|
2859
|
-
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess',
|
|
2980
|
+
lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _353 => _353.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
|
|
2860
2981
|
marker: series.marker && typeof series.marker === "object" ? series.marker : void 0,
|
|
2861
2982
|
markerColor: void 0,
|
|
2862
2983
|
markerLineColor: void 0,
|
|
@@ -2865,7 +2986,13 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
|
|
|
2865
2986
|
name: resolveSeriesName(workbook, workbookSheetIndex, series.name),
|
|
2866
2987
|
negativeColor: void 0,
|
|
2867
2988
|
negativeLineColor: void 0,
|
|
2868
|
-
raw:
|
|
2989
|
+
raw: {
|
|
2990
|
+
...series,
|
|
2991
|
+
unresolvedCategoriesReference: Boolean(_optionalChain([categoriesRef, 'optionalAccess', _354 => _354.formula]) && !resolveReferenceSheet(workbook, workbookSheetIndex, categoriesRef.formula).sheet),
|
|
2992
|
+
unresolvedValuesReference: Boolean(_optionalChain([valuesRef, 'optionalAccess', _355 => _355.formula]) && !resolveReferenceSheet(workbook, workbookSheetIndex, valuesRef.formula).sheet),
|
|
2993
|
+
unresolvedBubbleSizeReference: Boolean(_optionalChain([bubbleSizeRef, 'optionalAccess', _356 => _356.formula]) && !resolveReferenceSheet(workbook, workbookSheetIndex, bubbleSizeRef.formula).sheet),
|
|
2994
|
+
unresolvedNameReference: typeof series.name === "string" && series.name.includes("!") && !resolveReferenceSheet(workbook, workbookSheetIndex, series.name).sheet
|
|
2995
|
+
},
|
|
2869
2996
|
shapeProperties,
|
|
2870
2997
|
smooth: typeof series.smooth === "boolean" ? series.smooth : void 0,
|
|
2871
2998
|
values: resolveReferenceValues(workbook, workbookSheetIndex, valuesRef, "value").map((value) => typeof value === "number" && Number.isFinite(value) ? value : null),
|
|
@@ -2927,12 +3054,15 @@ function buildTabs(workbook, chartsheets, visibleSheetIndexByWorkbookSheetIndex,
|
|
|
2927
3054
|
const slotIndex = typeof entry.index === "number" ? entry.index : index;
|
|
2928
3055
|
if (slotType === "chartsheet") {
|
|
2929
3056
|
const chartsheet = chartsheets[slotIndex];
|
|
3057
|
+
const visibility2 = normalizeWorksheetVisibility(_optionalChain([chartsheet, 'optionalAccess', _357 => _357.raw, 'optionalAccess', _358 => _358.visibility]));
|
|
3058
|
+
if (!showHiddenSheets && visibility2 !== "visible") return [];
|
|
2930
3059
|
return chartsheet ? [{
|
|
2931
3060
|
chartsheetIndex: slotIndex,
|
|
2932
3061
|
id: `chartsheet-${slotIndex}`,
|
|
2933
3062
|
index,
|
|
2934
3063
|
kind: "chartsheet",
|
|
2935
|
-
name: chartsheet.name
|
|
3064
|
+
name: chartsheet.name,
|
|
3065
|
+
visibility: visibility2
|
|
2936
3066
|
}] : [];
|
|
2937
3067
|
}
|
|
2938
3068
|
const worksheet = workbook.getSheet(slotIndex);
|
|
@@ -2986,7 +3116,7 @@ function collectChartOriginsForSheet(archive, origin) {
|
|
|
2986
3116
|
for (const anchorNode of anchorNodes) {
|
|
2987
3117
|
const graphicFrame = getFirstLocalDescendant(anchorNode, "graphicFrame");
|
|
2988
3118
|
const chartNode = graphicFrame ? getFirstLocalDescendant(graphicFrame, "chart") : null;
|
|
2989
|
-
const relationshipId = _nullishCoalesce(_nullishCoalesce(_optionalChain([chartNode, 'optionalAccess',
|
|
3119
|
+
const relationshipId = _nullishCoalesce(_nullishCoalesce(_optionalChain([chartNode, 'optionalAccess', _359 => _359.getAttributeNS, 'call', _360 => _360("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id")]), () => ( _optionalChain([chartNode, 'optionalAccess', _361 => _361.getAttribute, 'call', _362 => _362("r:id")]))), () => ( _optionalChain([chartNode, 'optionalAccess', _363 => _363.getAttribute, 'call', _364 => _364("id")])));
|
|
2990
3120
|
if (!relationshipId) {
|
|
2991
3121
|
continue;
|
|
2992
3122
|
}
|
|
@@ -3036,9 +3166,24 @@ function applyChartOrigins(chartsByWorkbookSheetIndex, chartOriginsById, archive
|
|
|
3036
3166
|
});
|
|
3037
3167
|
}
|
|
3038
3168
|
}
|
|
3039
|
-
function hydrateWorkbookChartStyles(chartsByWorkbookSheetIndex, imageAssets) {
|
|
3169
|
+
function hydrateWorkbookChartStyles(chartsByWorkbookSheetIndex, imageAssets, chartsheets = []) {
|
|
3040
3170
|
const chartOriginsById = /* @__PURE__ */ new Map();
|
|
3041
3171
|
applyChartOrigins(chartsByWorkbookSheetIndex, chartOriginsById, imageAssets.archive, imageAssets.sheetOrigins);
|
|
3172
|
+
const chartsheetOrigins = collectChartsheetDrawingOrigins(imageAssets.archive, chartsheets);
|
|
3173
|
+
for (const chartsheet of chartsheets) {
|
|
3174
|
+
if (chartsheet.workbookSheetIndex == null) continue;
|
|
3175
|
+
const charts = _nullishCoalesce(chartsByWorkbookSheetIndex[chartsheet.workbookSheetIndex], () => ( []));
|
|
3176
|
+
const origins = collectChartOriginsForSheet(imageAssets.archive, _nullishCoalesce(chartsheetOrigins.get(chartsheet.index), () => ( null)));
|
|
3177
|
+
for (const chart of charts) {
|
|
3178
|
+
const kind = chart.id.startsWith("chart-ex-") ? "modern" : "classic";
|
|
3179
|
+
const origin = origins.find((entry) => entry.chartKind === kind);
|
|
3180
|
+
if (!origin) continue;
|
|
3181
|
+
if (origin.anchor) chart.anchor = origin.anchor;
|
|
3182
|
+
chart.chartPath = _nullishCoalesce(origin.chartPath, () => ( void 0));
|
|
3183
|
+
chartsheet.chartPath = chart.chartPath;
|
|
3184
|
+
chartOriginsById.set(chart.id, origin);
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3042
3187
|
for (const charts of chartsByWorkbookSheetIndex) {
|
|
3043
3188
|
for (const chart of charts) {
|
|
3044
3189
|
applyChartStyleFromXml(chart, chart.chartPath, imageAssets.archive, imageAssets.themePalette);
|
|
@@ -3047,6 +3192,84 @@ function hydrateWorkbookChartStyles(chartsByWorkbookSheetIndex, imageAssets) {
|
|
|
3047
3192
|
}
|
|
3048
3193
|
return chartOriginsById;
|
|
3049
3194
|
}
|
|
3195
|
+
function normalizeClassicChartDrawing(workbook, workbookSheetIndex, visibleSheetIndex, rawChart, chartIndex, chartId = `chart-${workbookSheetIndex}-${chartIndex}`) {
|
|
3196
|
+
const drawing = rawChart && typeof rawChart === "object" ? rawChart : {};
|
|
3197
|
+
const chart = drawing.chart && typeof drawing.chart === "object" ? drawing.chart : {};
|
|
3198
|
+
const rawView3d = chart.view3D && typeof chart.view3D === "object" ? chart.view3D : null;
|
|
3199
|
+
const rawSeries = Array.isArray(chart.series) ? chart.series : [];
|
|
3200
|
+
const typeGroups = Array.isArray(chart.typeGroups) ? chart.typeGroups.map((entry, groupIndex) => normalizeChartTypeGroup(workbook, workbookSheetIndex, chartId, entry, groupIndex)).filter((value) => value != null) : [];
|
|
3201
|
+
let seriesOrdinal = 0;
|
|
3202
|
+
const series = typeGroups.some((group) => group.series.length > 0) ? typeGroups.flatMap((group) => {
|
|
3203
|
+
group.series = group.series.map((entry) => ({ ...entry, id: `${chartId}-series-${seriesOrdinal++}` }));
|
|
3204
|
+
return group.series;
|
|
3205
|
+
}) : rawSeries.map((entry, seriesIndex) => normalizeChartSeries(workbook, workbookSheetIndex, chartId, entry, seriesIndex));
|
|
3206
|
+
const chartLevelDataLabels = normalizeChartDataLabels(chart.dataLabels);
|
|
3207
|
+
const firstSeriesDataLabels = rawSeries.length > 0 && rawSeries[0] && typeof rawSeries[0] === "object" ? normalizeChartDataLabels(rawSeries[0].dataLabels) : null;
|
|
3208
|
+
return {
|
|
3209
|
+
anchor: normalizeChartAnchor(drawing.anchor),
|
|
3210
|
+
autoTitleDeleted: typeof chart.autoTitleDeleted === "boolean" ? chart.autoTitleDeleted : void 0,
|
|
3211
|
+
axes: Array.isArray(chart.axes) ? chart.axes.map(normalizeChartAxis).filter((value) => Boolean(value)) : [],
|
|
3212
|
+
axisLabelColor: void 0,
|
|
3213
|
+
axisLineColor: void 0,
|
|
3214
|
+
categoryAxis: normalizeChartAxis(chart.categoryAxis),
|
|
3215
|
+
chartAreaBorderColor: void 0,
|
|
3216
|
+
chartAreaFillColor: void 0,
|
|
3217
|
+
chartColorPalette: void 0,
|
|
3218
|
+
chartColorPaletteOffset: void 0,
|
|
3219
|
+
chartPath: void 0,
|
|
3220
|
+
chartStyleId: void 0,
|
|
3221
|
+
chartType: typeof chart.chartType === "string" ? chart.chartType : "ColumnClustered",
|
|
3222
|
+
dataLabels: _nullishCoalesce(chartLevelDataLabels, () => ( firstSeriesDataLabels)),
|
|
3223
|
+
displayBlanksAs: typeof chart.displayBlanksAs === "string" ? chart.displayBlanksAs : void 0,
|
|
3224
|
+
editable: true,
|
|
3225
|
+
firstSliceAngle: typeof chart.firstSliceAngle === "number" ? chart.firstSliceAngle : void 0,
|
|
3226
|
+
fontFamily: void 0,
|
|
3227
|
+
gapWidth: typeof chart.gapWidth === "number" ? chart.gapWidth : void 0,
|
|
3228
|
+
holeSize: typeof chart.holeSize === "number" ? chart.holeSize : void 0,
|
|
3229
|
+
id: chartId,
|
|
3230
|
+
is3d: typeof chart.is3D === "boolean" ? chart.is3D : typeof chart.is3d === "boolean" ? chart.is3d : void 0,
|
|
3231
|
+
legend: normalizeLegend(chart.legend) ? {
|
|
3232
|
+
...normalizeLegend(chart.legend),
|
|
3233
|
+
position: normalizeLegendPosition(_optionalChain([normalizeLegend, 'call', _365 => _365(chart.legend), 'optionalAccess', _366 => _366.position]))
|
|
3234
|
+
} : null,
|
|
3235
|
+
name: typeof drawing.name === "string" ? drawing.name : void 0,
|
|
3236
|
+
overlap: typeof chart.overlap === "number" ? chart.overlap : void 0,
|
|
3237
|
+
plotVisibleOnly: typeof chart.plotVisibleOnly === "boolean" ? chart.plotVisibleOnly : void 0,
|
|
3238
|
+
raw: chart,
|
|
3239
|
+
radarStyle: typeof chart.radarStyle === "string" ? chart.radarStyle : void 0,
|
|
3240
|
+
scatterStyle: typeof chart.scatterStyle === "string" ? chart.scatterStyle : void 0,
|
|
3241
|
+
roundedCorners: typeof chart.roundedCorners === "boolean" ? chart.roundedCorners : void 0,
|
|
3242
|
+
shape3d: typeof chart.shape === "string" ? chart.shape : typeof chart.shape3d === "string" ? chart.shape3d : void 0,
|
|
3243
|
+
seriesAxis: null,
|
|
3244
|
+
series,
|
|
3245
|
+
sheetIndex: visibleSheetIndex,
|
|
3246
|
+
showDlblsOverMax: typeof chart.showDlblsOverMax === "boolean" ? chart.showDlblsOverMax : void 0,
|
|
3247
|
+
sideWall: null,
|
|
3248
|
+
backWall: null,
|
|
3249
|
+
bubbleScale: typeof chart.bubbleScale === "number" ? chart.bubbleScale : void 0,
|
|
3250
|
+
bubble3d: typeof chart.bubble3d === "boolean" ? chart.bubble3d : void 0,
|
|
3251
|
+
floor: null,
|
|
3252
|
+
surfaceMaterial: void 0,
|
|
3253
|
+
textColor: void 0,
|
|
3254
|
+
title: typeof chart.title === "string" ? chart.title : void 0,
|
|
3255
|
+
titleColor: void 0,
|
|
3256
|
+
titleFontFamily: void 0,
|
|
3257
|
+
typeGroups,
|
|
3258
|
+
valueAxis: normalizeChartAxis(chart.valueAxis),
|
|
3259
|
+
varyColors: typeof chart.varyColors === "boolean" ? chart.varyColors : void 0,
|
|
3260
|
+
view3d: rawView3d ? {
|
|
3261
|
+
depthPercent: typeof rawView3d.depthPercent === "number" ? rawView3d.depthPercent : void 0,
|
|
3262
|
+
heightPercent: typeof rawView3d.heightPercent === "number" ? rawView3d.heightPercent : void 0,
|
|
3263
|
+
perspective: typeof rawView3d.perspective === "number" ? rawView3d.perspective : void 0,
|
|
3264
|
+
rAngAx: typeof rawView3d.rAngAx === "boolean" ? rawView3d.rAngAx : typeof rawView3d.rightAngleAxes === "boolean" ? rawView3d.rightAngleAxes : void 0,
|
|
3265
|
+
rotX: typeof rawView3d.rotX === "number" ? rawView3d.rotX : typeof rawView3d.rotateX === "number" ? rawView3d.rotateX : void 0,
|
|
3266
|
+
rotY: typeof rawView3d.rotY === "number" ? rawView3d.rotY : typeof rawView3d.rotateY === "number" ? rawView3d.rotateY : void 0
|
|
3267
|
+
} : void 0,
|
|
3268
|
+
wireframe: typeof chart.wireframe === "boolean" ? chart.wireframe : void 0,
|
|
3269
|
+
workbookSheetIndex,
|
|
3270
|
+
zIndex: Array.isArray(drawing.drawingPath) && typeof drawing.drawingPath[0] === "number" ? drawing.drawingPath[0] + 1 : chartIndex + 1
|
|
3271
|
+
};
|
|
3272
|
+
}
|
|
3050
3273
|
function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkbookSheetIndex, showHiddenSheets = false) {
|
|
3051
3274
|
const excludedChartIds = /* @__PURE__ */ new Set();
|
|
3052
3275
|
const chartsByWorkbookSheetIndex = Array.from({ length: workbook.sheetCount }, (_, workbookSheetIndex) => {
|
|
@@ -3059,76 +3282,7 @@ function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkb
|
|
|
3059
3282
|
if (rawChart.hidden || !rawChart.anchor) {
|
|
3060
3283
|
excludedChartIds.add(chartId);
|
|
3061
3284
|
}
|
|
3062
|
-
|
|
3063
|
-
const chart = drawing.chart && typeof drawing.chart === "object" ? drawing.chart : {};
|
|
3064
|
-
const rawView3d = chart.view3D && typeof chart.view3D === "object" ? chart.view3D : null;
|
|
3065
|
-
const rawSeries = Array.isArray(chart.series) ? chart.series : [];
|
|
3066
|
-
const chartLevelDataLabels = normalizeChartDataLabels(chart.dataLabels);
|
|
3067
|
-
const firstSeriesDataLabels = rawSeries.length > 0 && rawSeries[0] && typeof rawSeries[0] === "object" ? normalizeChartDataLabels(rawSeries[0].dataLabels) : null;
|
|
3068
|
-
return {
|
|
3069
|
-
anchor: normalizeChartAnchor(drawing.anchor),
|
|
3070
|
-
autoTitleDeleted: typeof chart.autoTitleDeleted === "boolean" ? chart.autoTitleDeleted : void 0,
|
|
3071
|
-
axes: Array.isArray(chart.axes) ? chart.axes.map(normalizeChartAxis).filter((value) => Boolean(value)) : [],
|
|
3072
|
-
axisLabelColor: void 0,
|
|
3073
|
-
axisLineColor: void 0,
|
|
3074
|
-
categoryAxis: normalizeChartAxis(chart.categoryAxis),
|
|
3075
|
-
chartAreaBorderColor: void 0,
|
|
3076
|
-
chartAreaFillColor: void 0,
|
|
3077
|
-
chartColorPalette: void 0,
|
|
3078
|
-
chartColorPaletteOffset: void 0,
|
|
3079
|
-
chartPath: void 0,
|
|
3080
|
-
chartStyleId: void 0,
|
|
3081
|
-
chartType: typeof chart.chartType === "string" ? chart.chartType : "ColumnClustered",
|
|
3082
|
-
dataLabels: _nullishCoalesce(chartLevelDataLabels, () => ( firstSeriesDataLabels)),
|
|
3083
|
-
displayBlanksAs: typeof chart.displayBlanksAs === "string" ? chart.displayBlanksAs : void 0,
|
|
3084
|
-
editable: true,
|
|
3085
|
-
firstSliceAngle: typeof chart.firstSliceAngle === "number" ? chart.firstSliceAngle : void 0,
|
|
3086
|
-
fontFamily: void 0,
|
|
3087
|
-
gapWidth: typeof chart.gapWidth === "number" ? chart.gapWidth : void 0,
|
|
3088
|
-
holeSize: typeof chart.holeSize === "number" ? chart.holeSize : void 0,
|
|
3089
|
-
id: chartId,
|
|
3090
|
-
is3d: typeof chart.is3D === "boolean" ? chart.is3D : void 0,
|
|
3091
|
-
legend: normalizeLegend(chart.legend) ? {
|
|
3092
|
-
...normalizeLegend(chart.legend),
|
|
3093
|
-
position: normalizeLegendPosition(_optionalChain([normalizeLegend, 'call', _313 => _313(chart.legend), 'optionalAccess', _314 => _314.position]))
|
|
3094
|
-
} : null,
|
|
3095
|
-
name: typeof drawing.name === "string" ? drawing.name : void 0,
|
|
3096
|
-
overlap: typeof chart.overlap === "number" ? chart.overlap : void 0,
|
|
3097
|
-
plotVisibleOnly: typeof chart.plotVisibleOnly === "boolean" ? chart.plotVisibleOnly : void 0,
|
|
3098
|
-
raw: chart,
|
|
3099
|
-
radarStyle: typeof chart.radarStyle === "string" ? chart.radarStyle : void 0,
|
|
3100
|
-
scatterStyle: typeof chart.scatterStyle === "string" ? chart.scatterStyle : void 0,
|
|
3101
|
-
roundedCorners: typeof chart.roundedCorners === "boolean" ? chart.roundedCorners : void 0,
|
|
3102
|
-
shape3d: typeof chart.shape === "string" ? chart.shape : typeof chart.shape3d === "string" ? chart.shape3d : void 0,
|
|
3103
|
-
seriesAxis: null,
|
|
3104
|
-
series: rawSeries.map((entry, seriesIndex) => normalizeChartSeries(workbook, workbookSheetIndex, chartId, entry, seriesIndex)),
|
|
3105
|
-
sheetIndex: visibleSheetIndex,
|
|
3106
|
-
showDlblsOverMax: typeof chart.showDlblsOverMax === "boolean" ? chart.showDlblsOverMax : void 0,
|
|
3107
|
-
sideWall: null,
|
|
3108
|
-
backWall: null,
|
|
3109
|
-
bubbleScale: typeof chart.bubbleScale === "number" ? chart.bubbleScale : void 0,
|
|
3110
|
-
bubble3d: typeof chart.bubble3d === "boolean" ? chart.bubble3d : void 0,
|
|
3111
|
-
floor: null,
|
|
3112
|
-
surfaceMaterial: void 0,
|
|
3113
|
-
textColor: void 0,
|
|
3114
|
-
title: typeof chart.title === "string" ? chart.title : void 0,
|
|
3115
|
-
titleColor: void 0,
|
|
3116
|
-
titleFontFamily: void 0,
|
|
3117
|
-
typeGroups: Array.isArray(chart.typeGroups) ? chart.typeGroups.map((entry, groupIndex) => normalizeChartTypeGroup(workbook, workbookSheetIndex, chartId, entry, groupIndex)).filter((value) => value != null) : [],
|
|
3118
|
-
valueAxis: normalizeChartAxis(chart.valueAxis),
|
|
3119
|
-
varyColors: typeof chart.varyColors === "boolean" ? chart.varyColors : void 0,
|
|
3120
|
-
view3d: rawView3d ? {
|
|
3121
|
-
depthPercent: typeof rawView3d.depthPercent === "number" ? rawView3d.depthPercent : void 0,
|
|
3122
|
-
heightPercent: typeof rawView3d.heightPercent === "number" ? rawView3d.heightPercent : void 0,
|
|
3123
|
-
perspective: typeof rawView3d.perspective === "number" ? rawView3d.perspective : void 0,
|
|
3124
|
-
rAngAx: typeof rawView3d.rAngAx === "boolean" ? rawView3d.rAngAx : typeof rawView3d.rightAngleAxes === "boolean" ? rawView3d.rightAngleAxes : void 0,
|
|
3125
|
-
rotX: typeof rawView3d.rotX === "number" ? rawView3d.rotX : typeof rawView3d.rotateX === "number" ? rawView3d.rotateX : void 0,
|
|
3126
|
-
rotY: typeof rawView3d.rotY === "number" ? rawView3d.rotY : typeof rawView3d.rotateY === "number" ? rawView3d.rotateY : void 0
|
|
3127
|
-
} : void 0,
|
|
3128
|
-
wireframe: typeof chart.wireframe === "boolean" ? chart.wireframe : void 0,
|
|
3129
|
-
workbookSheetIndex,
|
|
3130
|
-
zIndex: Array.isArray(drawing.drawingPath) && typeof drawing.drawingPath[0] === "number" ? drawing.drawingPath[0] + 1 : chartIndex + 1
|
|
3131
|
-
};
|
|
3285
|
+
return normalizeClassicChartDrawing(workbook, workbookSheetIndex, visibleSheetIndex, rawChart, chartIndex, chartId);
|
|
3132
3286
|
});
|
|
3133
3287
|
const modernCharts = rawChartsEx.map((rawChartEx, chartExIndex) => {
|
|
3134
3288
|
const chartId = `chart-ex-${workbookSheetIndex}-${chartExIndex}`;
|
|
@@ -3141,14 +3295,42 @@ function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkb
|
|
|
3141
3295
|
visibleSheetIndex,
|
|
3142
3296
|
rawChartEx,
|
|
3143
3297
|
chartExIndex,
|
|
3144
|
-
_nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess',
|
|
3298
|
+
_nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess', _367 => _367.themePalette]), () => ( null))
|
|
3145
3299
|
);
|
|
3146
3300
|
});
|
|
3147
3301
|
return [...classicCharts, ...modernCharts];
|
|
3148
3302
|
});
|
|
3149
3303
|
const chartsheets = Array.isArray(workbook.chartsheets) ? workbook.chartsheets.map((entry, index) => normalizeChartsheet(entry, index)) : [];
|
|
3304
|
+
for (const chartsheet of chartsheets) {
|
|
3305
|
+
const workbookSheetIndex = workbook.sheetCount + chartsheet.index;
|
|
3306
|
+
const raw = chartsheet.raw;
|
|
3307
|
+
const charts = [];
|
|
3308
|
+
if (_optionalChain([raw, 'optionalAccess', _368 => _368.chart]) && typeof raw.chart === "object") {
|
|
3309
|
+
charts.push(normalizeClassicChartDrawing(
|
|
3310
|
+
workbook,
|
|
3311
|
+
workbookSheetIndex,
|
|
3312
|
+
workbookSheetIndex,
|
|
3313
|
+
raw,
|
|
3314
|
+
0,
|
|
3315
|
+
`${chartsheet.id}-chart-0`
|
|
3316
|
+
));
|
|
3317
|
+
}
|
|
3318
|
+
if (_optionalChain([raw, 'optionalAccess', _369 => _369.chartEx]) && typeof raw.chartEx === "object") {
|
|
3319
|
+
charts.push(normalizeChartExChart(
|
|
3320
|
+
workbook,
|
|
3321
|
+
workbookSheetIndex,
|
|
3322
|
+
workbookSheetIndex,
|
|
3323
|
+
raw,
|
|
3324
|
+
0,
|
|
3325
|
+
_nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess', _370 => _370.themePalette]), () => ( null))
|
|
3326
|
+
));
|
|
3327
|
+
}
|
|
3328
|
+
chartsByWorkbookSheetIndex[workbookSheetIndex] = charts;
|
|
3329
|
+
chartsheet.chartIds = charts.map((chart) => chart.id);
|
|
3330
|
+
chartsheet.workbookSheetIndex = workbookSheetIndex;
|
|
3331
|
+
}
|
|
3150
3332
|
const tabs = buildTabs(workbook, chartsheets, visibleSheetIndexByWorkbookSheetIndex, showHiddenSheets);
|
|
3151
|
-
const chartOriginsById = imageAssets ? hydrateWorkbookChartStyles(chartsByWorkbookSheetIndex, imageAssets) : /* @__PURE__ */ new Map();
|
|
3333
|
+
const chartOriginsById = imageAssets ? hydrateWorkbookChartStyles(chartsByWorkbookSheetIndex, imageAssets, chartsheets) : /* @__PURE__ */ new Map();
|
|
3152
3334
|
if (imageAssets) {
|
|
3153
3335
|
for (let index = 0; index < chartsByWorkbookSheetIndex.length; index += 1) {
|
|
3154
3336
|
chartsByWorkbookSheetIndex[index] = (_nullishCoalesce(chartsByWorkbookSheetIndex[index], () => ( []))).filter((chart) => !excludedChartIds.has(chart.id));
|
|
@@ -3219,7 +3401,7 @@ function updateAnchorNode(anchorNode, anchor) {
|
|
|
3219
3401
|
function setChartTitle(chartNode, value) {
|
|
3220
3402
|
const existing = getFirstLocalChild(chartNode, "title");
|
|
3221
3403
|
if (!value) {
|
|
3222
|
-
_optionalChain([existing, 'optionalAccess',
|
|
3404
|
+
_optionalChain([existing, 'optionalAccess', _371 => _371.remove, 'call', _372 => _372()]);
|
|
3223
3405
|
return;
|
|
3224
3406
|
}
|
|
3225
3407
|
const titleNode = _nullishCoalesce(existing, () => ( chartNode.insertBefore(
|
|
@@ -3253,7 +3435,7 @@ function setRefFormula(parent, refNodeName, formula) {
|
|
|
3253
3435
|
}
|
|
3254
3436
|
function setSeriesText(seriesNode, series) {
|
|
3255
3437
|
const raw = series.raw && typeof series.raw === "object" ? series.raw : null;
|
|
3256
|
-
const nameFormula = typeof _optionalChain([raw, 'optionalAccess',
|
|
3438
|
+
const nameFormula = typeof _optionalChain([raw, 'optionalAccess', _373 => _373.name]) === "string" && raw.name.length > 0 ? raw.name : void 0;
|
|
3257
3439
|
if (!nameFormula && series.name === void 0) {
|
|
3258
3440
|
return;
|
|
3259
3441
|
}
|
|
@@ -3278,12 +3460,12 @@ function updateSeriesNodes(plotAreaNode, chart) {
|
|
|
3278
3460
|
return;
|
|
3279
3461
|
}
|
|
3280
3462
|
setSeriesText(seriesNode, series);
|
|
3281
|
-
if (_optionalChain([series, 'access',
|
|
3463
|
+
if (_optionalChain([series, 'access', _374 => _374.categoriesRef, 'optionalAccess', _375 => _375.formula])) {
|
|
3282
3464
|
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"))));
|
|
3283
3465
|
const categoryRefName = target.localName === "xVal" || getFirstLocalChild(target, "numRef") ? "numRef" : "strRef";
|
|
3284
3466
|
setRefFormula(target, categoryRefName, series.categoriesRef.formula);
|
|
3285
3467
|
}
|
|
3286
|
-
if (_optionalChain([series, 'access',
|
|
3468
|
+
if (_optionalChain([series, 'access', _376 => _376.valuesRef, 'optionalAccess', _377 => _377.formula])) {
|
|
3287
3469
|
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"))));
|
|
3288
3470
|
setRefFormula(target, "numRef", series.valuesRef.formula);
|
|
3289
3471
|
}
|
|
@@ -3305,14 +3487,14 @@ function updateAxisNode(axisNode, axis) {
|
|
|
3305
3487
|
}
|
|
3306
3488
|
if (axis.position) {
|
|
3307
3489
|
setLeafValue(ensureChild(axisNode, "axPos"), "val", axis.position);
|
|
3308
|
-
_optionalChain([getFirstLocalChild, 'call',
|
|
3490
|
+
_optionalChain([getFirstLocalChild, 'call', _378 => _378(axisNode, "axPos"), 'optionalAccess', _379 => _379.setAttribute, 'call', _380 => _380("val", axis.position)]);
|
|
3309
3491
|
}
|
|
3310
3492
|
if (axis.majorGridlines !== void 0) {
|
|
3311
3493
|
const gridlines = getFirstLocalChild(axisNode, "majorGridlines");
|
|
3312
3494
|
if (axis.majorGridlines && !gridlines) {
|
|
3313
3495
|
axisNode.appendChild(axisNode.ownerDocument.createElementNS(CHART_NS, "c:majorGridlines"));
|
|
3314
3496
|
} else if (!axis.majorGridlines) {
|
|
3315
|
-
_optionalChain([gridlines, 'optionalAccess',
|
|
3497
|
+
_optionalChain([gridlines, 'optionalAccess', _381 => _381.remove, 'call', _382 => _382()]);
|
|
3316
3498
|
}
|
|
3317
3499
|
}
|
|
3318
3500
|
if (axis.minorGridlines !== void 0) {
|
|
@@ -3320,28 +3502,28 @@ function updateAxisNode(axisNode, axis) {
|
|
|
3320
3502
|
if (axis.minorGridlines && !gridlines) {
|
|
3321
3503
|
axisNode.appendChild(axisNode.ownerDocument.createElementNS(CHART_NS, "c:minorGridlines"));
|
|
3322
3504
|
} else if (!axis.minorGridlines) {
|
|
3323
|
-
_optionalChain([gridlines, 'optionalAccess',
|
|
3505
|
+
_optionalChain([gridlines, 'optionalAccess', _383 => _383.remove, 'call', _384 => _384()]);
|
|
3324
3506
|
}
|
|
3325
3507
|
}
|
|
3326
3508
|
if (axis.majorTickMark) {
|
|
3327
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3509
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _385 => _385(axisNode, "majorTickMark"), 'optionalAccess', _386 => _386.setAttribute, 'call', _387 => _387("val", axis.majorTickMark)]), () => ( setBooleanValue(axisNode, "majorTickMark", false).setAttribute("val", axis.majorTickMark)));
|
|
3328
3510
|
}
|
|
3329
3511
|
if (axis.minorTickMark) {
|
|
3330
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3512
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _388 => _388(axisNode, "minorTickMark"), 'optionalAccess', _389 => _389.setAttribute, 'call', _390 => _390("val", axis.minorTickMark)]), () => ( setBooleanValue(axisNode, "minorTickMark", false).setAttribute("val", axis.minorTickMark)));
|
|
3331
3513
|
}
|
|
3332
3514
|
if (axis.labelPosition) {
|
|
3333
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3515
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _391 => _391(axisNode, "tickLblPos"), 'optionalAccess', _392 => _392.setAttribute, 'call', _393 => _393("val", axis.labelPosition)]), () => ( setBooleanValue(axisNode, "tickLblPos", false).setAttribute("val", axis.labelPosition)));
|
|
3334
3516
|
}
|
|
3335
3517
|
if (axis.crosses) {
|
|
3336
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3518
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _394 => _394(axisNode, "crosses"), 'optionalAccess', _395 => _395.setAttribute, 'call', _396 => _396("val", axis.crosses)]), () => ( setBooleanValue(axisNode, "crosses", false).setAttribute("val", axis.crosses)));
|
|
3337
3519
|
}
|
|
3338
3520
|
if (axis.crossBetween) {
|
|
3339
|
-
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call',
|
|
3521
|
+
_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _397 => _397(axisNode, "crossBetween"), 'optionalAccess', _398 => _398.setAttribute, 'call', _399 => _399("val", axis.crossBetween)]), () => ( setBooleanValue(axisNode, "crossBetween", false).setAttribute("val", axis.crossBetween)));
|
|
3340
3522
|
}
|
|
3341
3523
|
if (axis.delete !== void 0) {
|
|
3342
3524
|
setBooleanValue(axisNode, "delete", axis.delete);
|
|
3343
3525
|
}
|
|
3344
|
-
if (_optionalChain([axis, 'access',
|
|
3526
|
+
if (_optionalChain([axis, 'access', _400 => _400.numberFormat, 'optionalAccess', _401 => _401.formatCode])) {
|
|
3345
3527
|
const numFmt = ensureChild(axisNode, "numFmt");
|
|
3346
3528
|
numFmt.setAttribute("formatCode", axis.numberFormat.formatCode);
|
|
3347
3529
|
if (axis.numberFormat.sourceLinked !== void 0) {
|
|
@@ -3397,7 +3579,7 @@ function updateWorkbookChartAnchor(imageAssets, chartAssets, chartId, anchor) {
|
|
|
3397
3579
|
}
|
|
3398
3580
|
function updateWorkbookChartDefinition(imageAssets, chartAssets, chartId, patch) {
|
|
3399
3581
|
const origin = chartAssets.chartOriginsById.get(chartId);
|
|
3400
|
-
if (!_optionalChain([origin, 'optionalAccess',
|
|
3582
|
+
if (!_optionalChain([origin, 'optionalAccess', _402 => _402.chartPath])) {
|
|
3401
3583
|
return false;
|
|
3402
3584
|
}
|
|
3403
3585
|
const chartXml = readArchiveText(imageAssets.archive, origin.chartPath);
|
|
@@ -3556,7 +3738,7 @@ function resolveWorkbookColor(color, themePalette) {
|
|
|
3556
3738
|
}
|
|
3557
3739
|
const themeValue = _nullishCoalesce(color.theme, () => ( color.themeIndex));
|
|
3558
3740
|
const numericTheme = typeof themeValue === "number" ? themeValue : typeof themeValue === "string" && themeValue.trim().length > 0 ? Number(themeValue) : Number.NaN;
|
|
3559
|
-
const themeColor = Number.isFinite(numericTheme) ? _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
3741
|
+
const themeColor = Number.isFinite(numericTheme) ? _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _403 => _403.colorsByIndex, 'access', _404 => _404[numericTheme]]), () => ( null)) : null;
|
|
3560
3742
|
if (!themeColor) {
|
|
3561
3743
|
return null;
|
|
3562
3744
|
}
|
|
@@ -3598,7 +3780,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
|
|
|
3598
3780
|
if (stops.length > 0) {
|
|
3599
3781
|
const gradientType = typeof fill.gradientType === "string" ? fill.gradientType : "linear";
|
|
3600
3782
|
if (gradientType === "path") {
|
|
3601
|
-
const backgroundColor = _nullishCoalesce(_optionalChain([stops, 'access',
|
|
3783
|
+
const backgroundColor = _nullishCoalesce(_optionalChain([stops, 'access', _405 => _405[stops.length - 1], 'optionalAccess', _406 => _406.color]), () => ( null));
|
|
3602
3784
|
return {
|
|
3603
3785
|
backgroundColor,
|
|
3604
3786
|
backgroundImage: `radial-gradient(circle at center, ${stops.map((stop) => `${stop.color} ${Math.max(0, Math.min(100, stop.position * 100))}%`).join(", ")})`
|
|
@@ -3607,7 +3789,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
|
|
|
3607
3789
|
const degree = typeof fill.degree === "number" ? fill.degree : Number(_nullishCoalesce(fill.degree, () => ( 0)));
|
|
3608
3790
|
const cssAngle = Number.isFinite(degree) ? 90 - degree : 90;
|
|
3609
3791
|
return {
|
|
3610
|
-
backgroundColor: _nullishCoalesce(_optionalChain([stops, 'access',
|
|
3792
|
+
backgroundColor: _nullishCoalesce(_optionalChain([stops, 'access', _407 => _407[stops.length - 1], 'optionalAccess', _408 => _408.color]), () => ( null)),
|
|
3611
3793
|
backgroundImage: `linear-gradient(${cssAngle}deg, ${stops.map((stop) => `${stop.color} ${Math.max(0, Math.min(100, stop.position * 100))}%`).join(", ")})`
|
|
3612
3794
|
};
|
|
3613
3795
|
}
|
|
@@ -3620,7 +3802,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
|
|
|
3620
3802
|
|
|
3621
3803
|
// src/images.ts
|
|
3622
3804
|
|
|
3623
|
-
var
|
|
3805
|
+
var REL_NS2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
3624
3806
|
var PKG_REL_NS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
3625
3807
|
var SPREADSHEET_NS = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
|
3626
3808
|
var CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
@@ -3669,6 +3851,19 @@ function measureColumnCharacterWidthPx(fontFamily, fontSizePt) {
|
|
|
3669
3851
|
columnCharacterWidthCache.set(cacheKey, width);
|
|
3670
3852
|
return width;
|
|
3671
3853
|
}
|
|
3854
|
+
function measureOfficeDigitWidthPt(fontFamily, fontSizePt) {
|
|
3855
|
+
const family = _optionalChain([fontFamily, 'optionalAccess', _409 => _409.trim, 'call', _410 => _410()]) || "Calibri";
|
|
3856
|
+
const size = typeof fontSizePt === "number" && fontSizePt > 0 ? fontSizePt : 11;
|
|
3857
|
+
const key = `office|${family}|${size}`;
|
|
3858
|
+
const cached = columnCharacterWidthCache.get(key);
|
|
3859
|
+
if (cached !== void 0) return cached;
|
|
3860
|
+
const context = typeof document !== "undefined" ? document.createElement("canvas").getContext("2d") : null;
|
|
3861
|
+
if (!context) return 6;
|
|
3862
|
+
context.font = `${size}px ${JSON.stringify(family)}, "React XLSX Carlito"`;
|
|
3863
|
+
const width = Math.max(1, Math.round(Math.max(...Array.from("0123456789", (digit) => context.measureText(digit).width))));
|
|
3864
|
+
columnCharacterWidthCache.set(key, width);
|
|
3865
|
+
return width;
|
|
3866
|
+
}
|
|
3672
3867
|
function sheetColumnWidthToPixels(width, columnCharacterWidthPx = DEFAULT_COLUMN_CHARACTER_WIDTH_PX) {
|
|
3673
3868
|
if (!Number.isFinite(width) || width <= 0) {
|
|
3674
3869
|
return MIN_COL_WIDTH_PX;
|
|
@@ -3904,7 +4099,7 @@ function readFeaturePropertyBagCheckboxComplements(archive) {
|
|
|
3904
4099
|
return /* @__PURE__ */ new Set();
|
|
3905
4100
|
}
|
|
3906
4101
|
const document2 = parseXml2(xml);
|
|
3907
|
-
if (!_optionalChain([document2, 'optionalAccess',
|
|
4102
|
+
if (!_optionalChain([document2, 'optionalAccess', _411 => _411.documentElement])) {
|
|
3908
4103
|
return /* @__PURE__ */ new Set();
|
|
3909
4104
|
}
|
|
3910
4105
|
const bagNodes = getChildElements(document2.documentElement, "bag");
|
|
@@ -3936,10 +4131,10 @@ function readFeaturePropertyBagCheckboxComplements(archive) {
|
|
|
3936
4131
|
return checkboxComplementIndices;
|
|
3937
4132
|
}
|
|
3938
4133
|
function getRelationshipId(element) {
|
|
3939
|
-
return _nullishCoalesce(_nullishCoalesce(element.getAttributeNS(
|
|
4134
|
+
return _nullishCoalesce(_nullishCoalesce(element.getAttributeNS(REL_NS2, "id"), () => ( element.getAttribute("r:id"))), () => ( element.getAttribute("id")));
|
|
3940
4135
|
}
|
|
3941
4136
|
function getEmbeddedRelationshipId(element) {
|
|
3942
|
-
return _nullishCoalesce(_nullishCoalesce(element.getAttributeNS(
|
|
4137
|
+
return _nullishCoalesce(_nullishCoalesce(element.getAttributeNS(REL_NS2, "embed"), () => ( element.getAttribute("r:embed"))), () => ( element.getAttribute("embed")));
|
|
3943
4138
|
}
|
|
3944
4139
|
function setChildText(parent, localName, value) {
|
|
3945
4140
|
const child = getFirstChild(parent, localName);
|
|
@@ -3989,7 +4184,7 @@ function resolveContentType(contentTypes, path) {
|
|
|
3989
4184
|
if (override) {
|
|
3990
4185
|
return override;
|
|
3991
4186
|
}
|
|
3992
|
-
const extension = _optionalChain([normalized, 'access',
|
|
4187
|
+
const extension = _optionalChain([normalized, 'access', _412 => _412.split, 'call', _413 => _413("."), 'access', _414 => _414.pop, 'call', _415 => _415(), 'optionalAccess', _416 => _416.toLowerCase, 'call', _417 => _417()]);
|
|
3993
4188
|
if (!extension) {
|
|
3994
4189
|
return "application/octet-stream";
|
|
3995
4190
|
}
|
|
@@ -4086,15 +4281,15 @@ function parseWorkbookTheme(archive) {
|
|
|
4086
4281
|
const key = colorNode.localName;
|
|
4087
4282
|
const srgbNode = getFirstChild(colorNode, "srgbClr");
|
|
4088
4283
|
const sysNode = getFirstChild(colorNode, "sysClr");
|
|
4089
|
-
const hex = _nullishCoalesce(_optionalChain([srgbNode, 'optionalAccess',
|
|
4284
|
+
const hex = _nullishCoalesce(_optionalChain([srgbNode, 'optionalAccess', _418 => _418.getAttribute, 'call', _419 => _419("val")]), () => ( _optionalChain([sysNode, 'optionalAccess', _420 => _420.getAttribute, 'call', _421 => _421("lastClr")])));
|
|
4090
4285
|
if (hex) {
|
|
4091
4286
|
colors.set(key, normalizeHexColor3(hex));
|
|
4092
4287
|
}
|
|
4093
4288
|
}
|
|
4094
4289
|
}
|
|
4095
4290
|
const fontSchemeNode = _nullishCoalesce(getLocalElements(themeDocument, "fontScheme")[0], () => ( null));
|
|
4096
|
-
const majorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4097
|
-
const minorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4291
|
+
const majorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _422 => _422(getFirstChild(fontSchemeNode, "majorFont"), "latin"), 'optionalAccess', _423 => _423.getAttribute, 'call', _424 => _424("typeface")]), () => ( null));
|
|
4292
|
+
const minorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _425 => _425(getFirstChild(fontSchemeNode, "minorFont"), "latin"), 'optionalAccess', _426 => _426.getAttribute, 'call', _427 => _427("typeface")]), () => ( null));
|
|
4098
4293
|
colors.set("bg1", _nullishCoalesce(_nullishCoalesce(colors.get("lt1"), () => ( defaultTheme.colors.get("bg1"))), () => ( "#ffffff")));
|
|
4099
4294
|
colors.set("tx1", _nullishCoalesce(_nullishCoalesce(colors.get("dk1"), () => ( defaultTheme.colors.get("tx1"))), () => ( "#000000")));
|
|
4100
4295
|
colors.set("bg2", _nullishCoalesce(_nullishCoalesce(colors.get("lt2"), () => ( defaultTheme.colors.get("bg2"))), () => ( "#e7e6e6")));
|
|
@@ -4154,8 +4349,8 @@ function parseSheetSparklines(document2, themePalette) {
|
|
|
4154
4349
|
continue;
|
|
4155
4350
|
}
|
|
4156
4351
|
for (const sparklineNode of getChildElements(sparklineCollectionNode, "sparkline")) {
|
|
4157
|
-
const formula = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4158
|
-
const targetReference = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4352
|
+
const formula = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _428 => _428(sparklineNode, "f"), 'optionalAccess', _429 => _429.textContent]), () => ( ""));
|
|
4353
|
+
const targetReference = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _430 => _430(sparklineNode, "sqref"), 'optionalAccess', _431 => _431.textContent]), () => ( ""));
|
|
4159
4354
|
const range = parseFormulaRangeReference(formula);
|
|
4160
4355
|
const target = parseFormulaCellReference(targetReference);
|
|
4161
4356
|
if (!range || !target) {
|
|
@@ -4190,15 +4385,15 @@ function parseSpreadsheetFont(node) {
|
|
|
4190
4385
|
font[property] = hasEnabledSpreadsheetFlag(flag);
|
|
4191
4386
|
}
|
|
4192
4387
|
}
|
|
4193
|
-
const size = _optionalChain([getFirstChild, 'call',
|
|
4194
|
-
const name = _optionalChain([getFirstChild, 'call',
|
|
4195
|
-
const family = _optionalChain([getFirstChild, 'call',
|
|
4196
|
-
const scheme = _optionalChain([getFirstChild, 'call',
|
|
4197
|
-
const charset = _optionalChain([getFirstChild, 'call',
|
|
4198
|
-
const verticalAlign = _optionalChain([getFirstChild, 'call',
|
|
4388
|
+
const size = _optionalChain([getFirstChild, 'call', _432 => _432(node, "sz"), 'optionalAccess', _433 => _433.getAttribute, 'call', _434 => _434("val")]);
|
|
4389
|
+
const name = _optionalChain([getFirstChild, 'call', _435 => _435(node, "name"), 'optionalAccess', _436 => _436.getAttribute, 'call', _437 => _437("val")]);
|
|
4390
|
+
const family = _optionalChain([getFirstChild, 'call', _438 => _438(node, "family"), 'optionalAccess', _439 => _439.getAttribute, 'call', _440 => _440("val")]);
|
|
4391
|
+
const scheme = _optionalChain([getFirstChild, 'call', _441 => _441(node, "scheme"), 'optionalAccess', _442 => _442.getAttribute, 'call', _443 => _443("val")]);
|
|
4392
|
+
const charset = _optionalChain([getFirstChild, 'call', _444 => _444(node, "charset"), 'optionalAccess', _445 => _445.getAttribute, 'call', _446 => _446("val")]);
|
|
4393
|
+
const verticalAlign = _optionalChain([getFirstChild, 'call', _447 => _447(node, "vertAlign"), 'optionalAccess', _448 => _448.getAttribute, 'call', _449 => _449("val")]);
|
|
4199
4394
|
const color = parseSpreadsheetColor(getFirstChild(node, "color"));
|
|
4200
4395
|
if (getFirstChild(node, "u")) {
|
|
4201
|
-
font.underline = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4396
|
+
font.underline = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _450 => _450(node, "u"), 'optionalAccess', _451 => _451.getAttribute, 'call', _452 => _452("val")]), () => ( "single"));
|
|
4202
4397
|
}
|
|
4203
4398
|
if (size !== null && size !== void 0) {
|
|
4204
4399
|
font.size = Number(size);
|
|
@@ -4389,8 +4584,8 @@ function parseResolvedXfStyle(xfNode, fonts, fills, borders, checkboxComplementI
|
|
|
4389
4584
|
style.alignment = alignment;
|
|
4390
4585
|
}
|
|
4391
4586
|
const xfComplementNode = getFirstDescendant(xfNode, "xfComplement");
|
|
4392
|
-
const xfComplementIndex = Number(_nullishCoalesce(_optionalChain([xfComplementNode, 'optionalAccess',
|
|
4393
|
-
if (Number.isFinite(xfComplementIndex) && _optionalChain([checkboxComplementIndices, 'optionalAccess',
|
|
4587
|
+
const xfComplementIndex = Number(_nullishCoalesce(_optionalChain([xfComplementNode, 'optionalAccess', _453 => _453.getAttribute, 'call', _454 => _454("i")]), () => ( Number.NaN)));
|
|
4588
|
+
if (Number.isFinite(xfComplementIndex) && _optionalChain([checkboxComplementIndices, 'optionalAccess', _455 => _455.has, 'call', _456 => _456(xfComplementIndex)])) {
|
|
4394
4589
|
style.cellControl = { kind: "checkbox" };
|
|
4395
4590
|
}
|
|
4396
4591
|
return style;
|
|
@@ -4484,7 +4679,7 @@ function parseWorkbookStyles(archive) {
|
|
|
4484
4679
|
});
|
|
4485
4680
|
tableStyleByName[name] = elements;
|
|
4486
4681
|
});
|
|
4487
|
-
const normalFont = _nullishCoalesce(_nullishCoalesce(_optionalChain([namedCellStyleByName, 'access',
|
|
4682
|
+
const normalFont = _nullishCoalesce(_nullishCoalesce(_optionalChain([namedCellStyleByName, 'access', _457 => _457.Normal, 'optionalAccess', _458 => _458.font]), () => ( _optionalChain([styleById, 'access', _459 => _459[0], 'optionalAccess', _460 => _460.font]))), () => ( fonts[0]));
|
|
4488
4683
|
const defaultFont = normalFont ? {
|
|
4489
4684
|
family: typeof normalFont.name === "string" ? normalFont.name : void 0,
|
|
4490
4685
|
sizePt: typeof normalFont.size === "number" ? normalFont.size : void 0
|
|
@@ -4514,7 +4709,7 @@ function parseConditionalFormatValueObject(node) {
|
|
|
4514
4709
|
if (!type) {
|
|
4515
4710
|
return null;
|
|
4516
4711
|
}
|
|
4517
|
-
const rawValue = _nullishCoalesce(_nullishCoalesce(node.getAttribute("val"), () => ( _optionalChain([getFirstChild, 'call',
|
|
4712
|
+
const rawValue = _nullishCoalesce(_nullishCoalesce(node.getAttribute("val"), () => ( _optionalChain([getFirstChild, 'call', _461 => _461(node, "f"), 'optionalAccess', _462 => _462.textContent]))), () => ( void 0));
|
|
4518
4713
|
const numericValue = rawValue !== void 0 ? Number(rawValue) : Number.NaN;
|
|
4519
4714
|
return {
|
|
4520
4715
|
type,
|
|
@@ -4563,7 +4758,7 @@ function parseStandardConditionalFormatRule(cfRuleNode, ranges, differentialStyl
|
|
|
4563
4758
|
if (cfvos.length === 0) {
|
|
4564
4759
|
return null;
|
|
4565
4760
|
}
|
|
4566
|
-
const extId = _optionalChain([getFirstDescendant, 'call',
|
|
4761
|
+
const extId = _optionalChain([getFirstDescendant, 'call', _463 => _463(cfRuleNode, "id"), 'optionalAccess', _464 => _464.textContent, 'optionalAccess', _465 => _465.trim, 'call', _466 => _466()]) || void 0;
|
|
4567
4762
|
return {
|
|
4568
4763
|
cfvos,
|
|
4569
4764
|
color: parseSpreadsheetColor(getFirstChild(dataBarNode, "color")),
|
|
@@ -4739,7 +4934,7 @@ function parseConditionalFormatRules(document2, differentialStyles = []) {
|
|
|
4739
4934
|
const extendedRules = [];
|
|
4740
4935
|
getLocalElements(document2, "conditionalFormatting").forEach((conditionalFormattingNode) => {
|
|
4741
4936
|
const isExtended = conditionalFormattingNode.namespaceURI !== SPREADSHEET_NS;
|
|
4742
|
-
const ranges = isExtended ? parseSqrefRanges(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
4937
|
+
const ranges = isExtended ? parseSqrefRanges(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _467 => _467(conditionalFormattingNode, "sqref"), 'optionalAccess', _468 => _468.textContent]), () => ( ""))) : parseSqrefRanges(conditionalFormattingNode.getAttribute("sqref"));
|
|
4743
4938
|
getChildElements(conditionalFormattingNode, "cfRule").forEach((cfRuleNode) => {
|
|
4744
4939
|
const parsedRule = isExtended ? parseExtendedConditionalFormatRule(cfRuleNode, ranges) : parseStandardConditionalFormatRule(cfRuleNode, ranges, differentialStyles);
|
|
4745
4940
|
if (parsedRule) {
|
|
@@ -4786,11 +4981,11 @@ function parseSheetState(archive, path, options) {
|
|
|
4786
4981
|
if (!document2) {
|
|
4787
4982
|
return null;
|
|
4788
4983
|
}
|
|
4789
|
-
const includeCachedFormulaValues = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4790
|
-
const autoFilterRanges = parseSqrefRanges(_optionalChain([getLocalElements, 'call',
|
|
4984
|
+
const includeCachedFormulaValues = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _469 => _469.includeCachedFormulaValues]), () => ( true));
|
|
4985
|
+
const autoFilterRanges = parseSqrefRanges(_optionalChain([getLocalElements, 'call', _470 => _470(document2, "autoFilter"), 'access', _471 => _471[0], 'optionalAccess', _472 => _472.getAttribute, 'call', _473 => _473("ref")]));
|
|
4791
4986
|
const cachedFormulaValues = {};
|
|
4792
|
-
const conditionalFormatRules = parseConditionalFormatRules(document2, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4793
|
-
const sparklines = parseSheetSparklines(document2, _optionalChain([options, 'optionalAccess',
|
|
4987
|
+
const conditionalFormatRules = parseConditionalFormatRules(document2, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _474 => _474.differentialStyles]), () => ( [])));
|
|
4988
|
+
const sparklines = parseSheetSparklines(document2, _optionalChain([options, 'optionalAccess', _475 => _475.themePalette]));
|
|
4794
4989
|
const sheetFormatNode = _nullishCoalesce(getLocalElements(document2, "sheetFormatPr")[0], () => ( null));
|
|
4795
4990
|
const sheetViewNode = _nullishCoalesce(getLocalElements(document2, "sheetView")[0], () => ( null));
|
|
4796
4991
|
const rowHeightOverridesPx = {};
|
|
@@ -4803,15 +4998,27 @@ function parseSheetState(archive, path, options) {
|
|
|
4803
4998
|
let maxContentCol = -1;
|
|
4804
4999
|
let maxContentRow = -1;
|
|
4805
5000
|
const columnWidthCharacterWidthPx = measureColumnCharacterWidthPx(
|
|
4806
|
-
_optionalChain([options, 'optionalAccess',
|
|
4807
|
-
_optionalChain([options, 'optionalAccess',
|
|
5001
|
+
_optionalChain([options, 'optionalAccess', _476 => _476.defaultFont, 'optionalAccess', _477 => _477.family]),
|
|
5002
|
+
_optionalChain([options, 'optionalAccess', _478 => _478.defaultFont, 'optionalAccess', _479 => _479.sizePt])
|
|
4808
5003
|
);
|
|
4809
|
-
const defaultRowHeight = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess',
|
|
5004
|
+
const defaultRowHeight = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _480 => _480.getAttribute, 'call', _481 => _481("defaultRowHeight")]), () => ( 15)));
|
|
5005
|
+
const digitWidthPt = measureOfficeDigitWidthPt(_optionalChain([options, 'optionalAccess', _482 => _482.defaultFont, 'optionalAccess', _483 => _483.family]), _optionalChain([options, 'optionalAccess', _484 => _484.defaultFont, 'optionalAccess', _485 => _485.sizePt]));
|
|
5006
|
+
const storedColumnPixels = (width) => Math.max(0, Math.floor(
|
|
5007
|
+
(256 * width + Math.floor(128 / digitWidthPt)) / 256 * digitWidthPt
|
|
5008
|
+
) * (4 / 3));
|
|
5009
|
+
const explicitDefaultWidth = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _486 => _486.getAttribute, 'call', _487 => _487("defaultColWidth")]), () => ( Number.NaN)));
|
|
5010
|
+
const baseWidth = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _488 => _488.getAttribute, 'call', _489 => _489("baseColWidth")]), () => ( 8)));
|
|
5011
|
+
const officeLayout = {
|
|
5012
|
+
defaultColumnPx: Number.isFinite(explicitDefaultWidth) && explicitDefaultWidth > 0 ? storedColumnPixels(explicitDefaultWidth) : ((Number.isFinite(baseWidth) && baseWidth > 0 ? baseWidth : 8) * digitWidthPt + 5) * (4 / 3),
|
|
5013
|
+
defaultRowPx: (Number.isFinite(defaultRowHeight) && defaultRowHeight > 0 ? defaultRowHeight : 15) * (4 / 3),
|
|
5014
|
+
columns: {},
|
|
5015
|
+
rows: {}
|
|
5016
|
+
};
|
|
4810
5017
|
const defaultColWidth = Number(
|
|
4811
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess',
|
|
5018
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _490 => _490.getAttribute, 'call', _491 => _491("defaultColWidth")]), () => ( _optionalChain([sheetFormatNode, 'optionalAccess', _492 => _492.getAttribute, 'call', _493 => _493("baseColWidth")]))), () => ( 8.43))
|
|
4812
5019
|
);
|
|
4813
5020
|
const rawZoomScale = Number(
|
|
4814
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess',
|
|
5021
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _494 => _494.getAttribute, 'call', _495 => _495("zoomScale")]), () => ( _optionalChain([sheetViewNode, 'optionalAccess', _496 => _496.getAttribute, 'call', _497 => _497("zoomScaleNormal")]))), () => ( Number.NaN))
|
|
4815
5022
|
);
|
|
4816
5023
|
const zoomScale = Number.isFinite(rawZoomScale) && rawZoomScale > 0 ? rawZoomScale : 100;
|
|
4817
5024
|
const trackContentCell = (cellRef) => {
|
|
@@ -4840,6 +5047,7 @@ function parseSheetState(archive, path, options) {
|
|
|
4840
5047
|
const styleId = Number(_nullishCoalesce(rowNode.getAttribute("s"), () => ( Number.NaN)));
|
|
4841
5048
|
if (rowIndex >= 0 && Number.isFinite(height)) {
|
|
4842
5049
|
rowHeightOverridesPx[rowIndex] = Math.max(MIN_ROW_HEIGHT_PX, Math.round(height * 1.33));
|
|
5050
|
+
officeLayout.rows[rowIndex] = { sourcePx: rowHeightOverridesPx[rowIndex], sizePx: Math.max(0, height * (4 / 3)) };
|
|
4843
5051
|
}
|
|
4844
5052
|
if (rowIndex >= 0 && Number.isFinite(styleId)) {
|
|
4845
5053
|
rowStyleIds[rowIndex] = styleId;
|
|
@@ -4878,6 +5086,7 @@ function parseSheetState(archive, path, options) {
|
|
|
4878
5086
|
if (Number.isFinite(width)) {
|
|
4879
5087
|
const widthPx = sheetColumnWidthToPixels(width, columnWidthCharacterWidthPx);
|
|
4880
5088
|
colWidthOverridesPx[col] = widthPx;
|
|
5089
|
+
officeLayout.columns[col] = { sourcePx: widthPx, sizePx: storedColumnPixels(width) };
|
|
4881
5090
|
}
|
|
4882
5091
|
if (Number.isFinite(styleId)) {
|
|
4883
5092
|
colStyleIds[col] = styleId;
|
|
@@ -4894,6 +5103,7 @@ function parseSheetState(archive, path, options) {
|
|
|
4894
5103
|
colStyleIds,
|
|
4895
5104
|
conditionalFormatRules,
|
|
4896
5105
|
defaultColWidthPx: sheetColumnWidthToPixels(defaultColWidth, columnWidthCharacterWidthPx),
|
|
5106
|
+
officeLayout,
|
|
4897
5107
|
defaultRowHeightPx: Math.max(MIN_ROW_HEIGHT_PX, Math.round(defaultRowHeight * 1.33)),
|
|
4898
5108
|
hasHorizontalMerges: false,
|
|
4899
5109
|
hasVerticalMerges: false,
|
|
@@ -4907,7 +5117,7 @@ function parseSheetState(archive, path, options) {
|
|
|
4907
5117
|
hiddenRows: [],
|
|
4908
5118
|
rowHeightOverridesPx,
|
|
4909
5119
|
rowStyleIds,
|
|
4910
|
-
showGridLines: (_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess',
|
|
5120
|
+
showGridLines: (_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _498 => _498.getAttribute, 'call', _499 => _499("showGridLines")]), () => ( "1"))) !== "0",
|
|
4911
5121
|
sparklines,
|
|
4912
5122
|
zoomScale
|
|
4913
5123
|
};
|
|
@@ -5042,9 +5252,9 @@ function resolvePreferredTextTypeface(node, theme) {
|
|
|
5042
5252
|
if (!node) {
|
|
5043
5253
|
return void 0;
|
|
5044
5254
|
}
|
|
5045
|
-
const latin = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5046
|
-
const eastAsian = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5047
|
-
const complexScript = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5255
|
+
const latin = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _500 => _500(node, "latin"), 'optionalAccess', _501 => _501.getAttribute, 'call', _502 => _502("typeface")]), () => ( null));
|
|
5256
|
+
const eastAsian = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _503 => _503(node, "ea"), 'optionalAccess', _504 => _504.getAttribute, 'call', _505 => _505("typeface")]), () => ( null));
|
|
5257
|
+
const complexScript = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _506 => _506(node, "cs"), 'optionalAccess', _507 => _507.getAttribute, 'call', _508 => _508("typeface")]), () => ( null));
|
|
5048
5258
|
const candidates = [latin, eastAsian, complexScript];
|
|
5049
5259
|
const explicit = candidates.find((candidate) => candidate && !isThemeTypeface(candidate));
|
|
5050
5260
|
if (explicit) {
|
|
@@ -5055,14 +5265,14 @@ function resolvePreferredTextTypeface(node, theme) {
|
|
|
5055
5265
|
function parseShapeTextStyle(node, theme, fallbackColor) {
|
|
5056
5266
|
if (!node) {
|
|
5057
5267
|
return {
|
|
5058
|
-
color: _optionalChain([fallbackColor, 'optionalAccess',
|
|
5268
|
+
color: _optionalChain([fallbackColor, 'optionalAccess', _509 => _509.color])
|
|
5059
5269
|
};
|
|
5060
5270
|
}
|
|
5061
5271
|
const fillColor = _nullishCoalesce(_nullishCoalesce(resolveFillColor(node, theme), () => ( fallbackColor)), () => ( null));
|
|
5062
5272
|
const underlineValue = node.getAttribute("u");
|
|
5063
5273
|
return {
|
|
5064
5274
|
bold: node.getAttribute("b") === "1" || void 0,
|
|
5065
|
-
color: _optionalChain([fillColor, 'optionalAccess',
|
|
5275
|
+
color: _optionalChain([fillColor, 'optionalAccess', _510 => _510.color]),
|
|
5066
5276
|
fontFamily: resolvePreferredTextTypeface(node, theme),
|
|
5067
5277
|
fontSizePt: node.getAttribute("sz") ? Number(node.getAttribute("sz")) / 100 : void 0,
|
|
5068
5278
|
italic: node.getAttribute("i") === "1" || void 0,
|
|
@@ -5088,10 +5298,10 @@ function parseMarker(node) {
|
|
|
5088
5298
|
if (!node) {
|
|
5089
5299
|
return null;
|
|
5090
5300
|
}
|
|
5091
|
-
const col = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5092
|
-
const row = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5093
|
-
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5094
|
-
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5301
|
+
const col = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _511 => _511(node, "col"), 'optionalAccess', _512 => _512.textContent]), () => ( 0)));
|
|
5302
|
+
const row = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _513 => _513(node, "row"), 'optionalAccess', _514 => _514.textContent]), () => ( 0)));
|
|
5303
|
+
const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _515 => _515(node, "colOff"), 'optionalAccess', _516 => _516.textContent]), () => ( 0)));
|
|
5304
|
+
const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _517 => _517(node, "rowOff"), 'optionalAccess', _518 => _518.textContent]), () => ( 0)));
|
|
5095
5305
|
return {
|
|
5096
5306
|
col,
|
|
5097
5307
|
colOffsetEmu,
|
|
@@ -5227,15 +5437,15 @@ function resolveDukeDrawingColor(color, themePalette) {
|
|
|
5227
5437
|
function resolveDukeDrawingText(text, themePalette) {
|
|
5228
5438
|
const caption = mapDukeDrawingText(text);
|
|
5229
5439
|
const label = normalizeControlLabel(text.runs.map((run) => run.text).join(""));
|
|
5230
|
-
const firstStyledRun = _optionalChain([text, 'access',
|
|
5440
|
+
const firstStyledRun = _optionalChain([text, 'access', _519 => _519.runs, 'access', _520 => _520.find, 'call', _521 => _521((run) => run.font), 'optionalAccess', _522 => _522.font]);
|
|
5231
5441
|
const horizontalAlignment = text.horizontalAlignment;
|
|
5232
5442
|
return {
|
|
5233
5443
|
caption,
|
|
5234
|
-
fontFamily: _optionalChain([firstStyledRun, 'optionalAccess',
|
|
5235
|
-
fontSizePt: _optionalChain([firstStyledRun, 'optionalAccess',
|
|
5444
|
+
fontFamily: _optionalChain([firstStyledRun, 'optionalAccess', _523 => _523.name]),
|
|
5445
|
+
fontSizePt: _optionalChain([firstStyledRun, 'optionalAccess', _524 => _524.size]),
|
|
5236
5446
|
label,
|
|
5237
5447
|
textAlign: horizontalAlignment === "left" || horizontalAlignment === "center" || horizontalAlignment === "right" ? horizontalAlignment : void 0,
|
|
5238
|
-
textColor: resolveDukeDrawingColor(_optionalChain([firstStyledRun, 'optionalAccess',
|
|
5448
|
+
textColor: resolveDukeDrawingColor(_optionalChain([firstStyledRun, 'optionalAccess', _525 => _525.color]), themePalette)
|
|
5239
5449
|
};
|
|
5240
5450
|
}
|
|
5241
5451
|
function mapDukeFormControlKind(kind, themePalette) {
|
|
@@ -5420,13 +5630,13 @@ function resolveSheetColumnWidthPx(sheetState, col) {
|
|
|
5420
5630
|
if (col < 0) {
|
|
5421
5631
|
return 0;
|
|
5422
5632
|
}
|
|
5423
|
-
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
5633
|
+
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _526 => _526.colWidthOverridesPx, 'access', _527 => _527[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _528 => _528.defaultColWidthPx]))), () => ( emuToPixels(DEFAULT_COL_WIDTH_EMU)));
|
|
5424
5634
|
}
|
|
5425
5635
|
function resolveSheetRowHeightPx(sheetState, row) {
|
|
5426
5636
|
if (row < 0) {
|
|
5427
5637
|
return 0;
|
|
5428
5638
|
}
|
|
5429
|
-
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
5639
|
+
return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _529 => _529.rowHeightOverridesPx, 'access', _530 => _530[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _531 => _531.defaultRowHeightPx]))), () => ( emuToPixels(DEFAULT_ROW_HEIGHT_EMU)));
|
|
5430
5640
|
}
|
|
5431
5641
|
function sumSheetColumnWidthsEmu(sheetState, beforeCol) {
|
|
5432
5642
|
let total = 0;
|
|
@@ -5516,10 +5726,10 @@ function parseGroupTransform(groupNode, parentGroup, fallbackAnchor, sheetState)
|
|
|
5516
5726
|
const rootScaleY = rect.cy !== 0 ? anchorRect.cy / rect.cy : 1;
|
|
5517
5727
|
const useRectFrameForRoot = !parentGroup && (rootScaleX < 0.85 || rootScaleX > 1.15 || rootScaleY < 0.85 || rootScaleY > 1.15);
|
|
5518
5728
|
const absoluteRect = parentGroup ? applyGroupTransform(rect, parentGroup) : rootRectMatchesAnchorOrigin ? rect : anchorRect;
|
|
5519
|
-
const childRectX = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess',
|
|
5520
|
-
const childRectY = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess',
|
|
5521
|
-
const childRectCx = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess',
|
|
5522
|
-
const childRectCy = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess',
|
|
5729
|
+
const childRectX = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _532 => _532.getAttribute, 'call', _533 => _533("x")]), () => ( 0))) : useRectFrameForRoot ? rect.x : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _534 => _534.getAttribute, 'call', _535 => _535("x")]), () => ( 0)));
|
|
5730
|
+
const childRectY = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _536 => _536.getAttribute, 'call', _537 => _537("y")]), () => ( 0))) : useRectFrameForRoot ? rect.y : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _538 => _538.getAttribute, 'call', _539 => _539("y")]), () => ( 0)));
|
|
5731
|
+
const childRectCx = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _540 => _540.getAttribute, 'call', _541 => _541("cx")]), () => ( rect.cx))) : useRectFrameForRoot ? rect.cx : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _542 => _542.getAttribute, 'call', _543 => _543("cx")]), () => ( rect.cx)));
|
|
5732
|
+
const childRectCy = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _544 => _544.getAttribute, 'call', _545 => _545("cy")]), () => ( rect.cy))) : useRectFrameForRoot ? rect.cy : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _546 => _546.getAttribute, 'call', _547 => _547("cy")]), () => ( rect.cy)));
|
|
5523
5733
|
return {
|
|
5524
5734
|
chCx: childRectCx,
|
|
5525
5735
|
chCy: childRectCy,
|
|
@@ -5527,8 +5737,8 @@ function parseGroupTransform(groupNode, parentGroup, fallbackAnchor, sheetState)
|
|
|
5527
5737
|
chY: childRectY,
|
|
5528
5738
|
cx: absoluteRect.cx,
|
|
5529
5739
|
cy: absoluteRect.cy,
|
|
5530
|
-
scaleX: childRectCx !== 0 ? absoluteRect.cx / childRectCx : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5531
|
-
scaleY: childRectCy !== 0 ? absoluteRect.cy / childRectCy : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5740
|
+
scaleX: childRectCx !== 0 ? absoluteRect.cx / childRectCx : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _548 => _548.scaleX]), () => ( 1)),
|
|
5741
|
+
scaleY: childRectCy !== 0 ? absoluteRect.cy / childRectCy : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _549 => _549.scaleY]), () => ( 1)),
|
|
5532
5742
|
x: absoluteRect.x,
|
|
5533
5743
|
y: absoluteRect.y
|
|
5534
5744
|
};
|
|
@@ -5537,8 +5747,8 @@ function anchorFromNodeOrFallback(node, fallbackAnchor, parentGroup) {
|
|
|
5537
5747
|
const xfrmNode = getFirstDescendant(node, "xfrm");
|
|
5538
5748
|
const rect = parseTransformRect(xfrmNode);
|
|
5539
5749
|
if (rect) {
|
|
5540
|
-
const scaleX = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5541
|
-
const scaleY = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5750
|
+
const scaleX = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _550 => _550.scaleX]), () => ( 1));
|
|
5751
|
+
const scaleY = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _551 => _551.scaleY]), () => ( 1));
|
|
5542
5752
|
return {
|
|
5543
5753
|
anchor: parentGroup ? rectToAbsoluteAnchor(applyGroupTransform(rect, parentGroup)) : fallbackAnchor,
|
|
5544
5754
|
flipH: rect.flipH,
|
|
@@ -5553,8 +5763,8 @@ function anchorFromNodeOrFallback(node, fallbackAnchor, parentGroup) {
|
|
|
5553
5763
|
flipH: false,
|
|
5554
5764
|
flipV: false,
|
|
5555
5765
|
rotationDeg: 0,
|
|
5556
|
-
scaleX: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5557
|
-
scaleY: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess',
|
|
5766
|
+
scaleX: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _552 => _552.scaleX]), () => ( 1)),
|
|
5767
|
+
scaleY: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _553 => _553.scaleY]), () => ( 1))
|
|
5558
5768
|
};
|
|
5559
5769
|
}
|
|
5560
5770
|
function mapParagraphAlign(value) {
|
|
@@ -5611,15 +5821,15 @@ function parseShapeStroke(node, styleNode, theme) {
|
|
|
5611
5821
|
if (lineNode && getFirstChild(lineNode, "noFill")) {
|
|
5612
5822
|
return { none: true };
|
|
5613
5823
|
}
|
|
5614
|
-
const color = _nullishCoalesce(resolveFillColor(lineNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([lineRefNode, 'optionalAccess',
|
|
5615
|
-
const widthEmu = Number(_nullishCoalesce(_optionalChain([lineNode, 'optionalAccess',
|
|
5824
|
+
const color = _nullishCoalesce(resolveFillColor(lineNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([lineRefNode, 'optionalAccess', _554 => _554.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
|
|
5825
|
+
const widthEmu = Number(_nullishCoalesce(_optionalChain([lineNode, 'optionalAccess', _555 => _555.getAttribute, 'call', _556 => _556("w")]), () => ( 0)));
|
|
5616
5826
|
return {
|
|
5617
|
-
color: _optionalChain([color, 'optionalAccess',
|
|
5618
|
-
dash: _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5619
|
-
headEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5827
|
+
color: _optionalChain([color, 'optionalAccess', _557 => _557.color]),
|
|
5828
|
+
dash: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _558 => _558(_nullishCoalesce(lineNode, () => ( node)), "prstDash"), 'optionalAccess', _559 => _559.getAttribute, 'call', _560 => _560("val")]), () => ( void 0)),
|
|
5829
|
+
headEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _561 => _561(_nullishCoalesce(lineNode, () => ( node)), "headEnd"), 'optionalAccess', _562 => _562.getAttribute, 'call', _563 => _563("type")]), () => ( void 0)),
|
|
5620
5830
|
none: false,
|
|
5621
|
-
opacity: _optionalChain([color, 'optionalAccess',
|
|
5622
|
-
tailEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5831
|
+
opacity: _optionalChain([color, 'optionalAccess', _564 => _564.opacity]),
|
|
5832
|
+
tailEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _565 => _565(_nullishCoalesce(lineNode, () => ( node)), "tailEnd"), 'optionalAccess', _566 => _566.getAttribute, 'call', _567 => _567("type")]), () => ( void 0)),
|
|
5623
5833
|
widthPx: widthEmu > 0 ? emuToPixels(widthEmu) : void 0
|
|
5624
5834
|
};
|
|
5625
5835
|
}
|
|
@@ -5633,7 +5843,7 @@ function parseShapeFill(node, styleNode, theme, geometry) {
|
|
|
5633
5843
|
return { none: true };
|
|
5634
5844
|
}
|
|
5635
5845
|
const fillRefNode = styleNode ? getFirstChild(styleNode, "fillRef") : null;
|
|
5636
|
-
const fillColor = _nullishCoalesce(resolveFillColor(shapePropsNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess',
|
|
5846
|
+
const fillColor = _nullishCoalesce(resolveFillColor(shapePropsNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _568 => _568.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
|
|
5637
5847
|
if (!fillColor) {
|
|
5638
5848
|
return void 0;
|
|
5639
5849
|
}
|
|
@@ -5730,12 +5940,12 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
|
|
|
5730
5940
|
return [];
|
|
5731
5941
|
}
|
|
5732
5942
|
const defaultFontRef = styleNode ? getFirstChild(styleNode, "fontRef") : null;
|
|
5733
|
-
const defaultFontColor = resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([defaultFontRef, 'optionalAccess',
|
|
5943
|
+
const defaultFontColor = resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([defaultFontRef, 'optionalAccess', _569 => _569.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme);
|
|
5734
5944
|
const listStyleNode = getFirstChild(txBodyNode, "lstStyle");
|
|
5735
5945
|
const paragraphs = [];
|
|
5736
5946
|
getChildElements(txBodyNode, "p").forEach((paragraphNode) => {
|
|
5737
5947
|
const paragraphProps = getFirstChild(paragraphNode, "pPr");
|
|
5738
|
-
const paragraphLevel = Number(_nullishCoalesce(_optionalChain([paragraphProps, 'optionalAccess',
|
|
5948
|
+
const paragraphLevel = Number(_nullishCoalesce(_optionalChain([paragraphProps, 'optionalAccess', _570 => _570.getAttribute, 'call', _571 => _571("lvl")]), () => ( 0)));
|
|
5739
5949
|
const listLevelProps = getFirstChild(_nullishCoalesce(listStyleNode, () => ( txBodyNode)), `lvl${paragraphLevel + 1}pPr`);
|
|
5740
5950
|
const inheritedStyle = mergeShapeTextStyles(
|
|
5741
5951
|
parseShapeTextStyle(getFirstChild(_nullishCoalesce(listLevelProps, () => ( txBodyNode)), "defRPr"), theme, defaultFontColor),
|
|
@@ -5753,7 +5963,7 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
|
|
|
5753
5963
|
return;
|
|
5754
5964
|
}
|
|
5755
5965
|
sawRenderableChild = true;
|
|
5756
|
-
const text = _nullishCoalesce(_optionalChain([getFirstChild, 'call',
|
|
5966
|
+
const text = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _572 => _572(child, "t"), 'optionalAccess', _573 => _573.textContent]), () => ( ""));
|
|
5757
5967
|
const runProps = getFirstChild(child, "rPr");
|
|
5758
5968
|
const runStyle = mergeShapeTextStyles(
|
|
5759
5969
|
inheritedStyle,
|
|
@@ -5784,7 +5994,7 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
|
|
|
5784
5994
|
});
|
|
5785
5995
|
}
|
|
5786
5996
|
paragraphs.push({
|
|
5787
|
-
align: mapParagraphAlign(_optionalChain([paragraphProps, 'optionalAccess',
|
|
5997
|
+
align: mapParagraphAlign(_optionalChain([paragraphProps, 'optionalAccess', _574 => _574.getAttribute, 'call', _575 => _575("algn")])),
|
|
5788
5998
|
runs
|
|
5789
5999
|
});
|
|
5790
6000
|
});
|
|
@@ -5796,26 +6006,26 @@ function parseTextBox(shapeNode) {
|
|
|
5796
6006
|
return void 0;
|
|
5797
6007
|
}
|
|
5798
6008
|
const bodyProps = getFirstChild(txBodyNode, "bodyPr");
|
|
5799
|
-
const leftInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5800
|
-
const rightInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5801
|
-
const topInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
5802
|
-
const bottomInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess',
|
|
6009
|
+
const leftInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _576 => _576.getAttribute, 'call', _577 => _577("lIns")]), () => ( 91440))));
|
|
6010
|
+
const rightInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _578 => _578.getAttribute, 'call', _579 => _579("rIns")]), () => ( 91440))));
|
|
6011
|
+
const topInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _580 => _580.getAttribute, 'call', _581 => _581("tIns")]), () => ( 45720))));
|
|
6012
|
+
const bottomInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _582 => _582.getAttribute, 'call', _583 => _583("bIns")]), () => ( 45720))));
|
|
5803
6013
|
return {
|
|
5804
|
-
horizontalAlign: _optionalChain([bodyProps, 'optionalAccess',
|
|
6014
|
+
horizontalAlign: _optionalChain([bodyProps, 'optionalAccess', _584 => _584.getAttribute, 'call', _585 => _585("anchorCtr")]) === "1" ? "center" : "left",
|
|
5805
6015
|
insetPx: {
|
|
5806
6016
|
bottom: bottomInset,
|
|
5807
6017
|
left: leftInset,
|
|
5808
6018
|
right: rightInset,
|
|
5809
6019
|
top: topInset
|
|
5810
6020
|
},
|
|
5811
|
-
verticalAlign: mapVerticalAnchor(_optionalChain([bodyProps, 'optionalAccess',
|
|
6021
|
+
verticalAlign: mapVerticalAnchor(_optionalChain([bodyProps, 'optionalAccess', _586 => _586.getAttribute, 'call', _587 => _587("anchor")]))
|
|
5812
6022
|
};
|
|
5813
6023
|
}
|
|
5814
6024
|
function getHyperlinkTarget(node, drawingRelationships) {
|
|
5815
6025
|
const hyperlinkNode = node ? getFirstDescendant(node, "hlinkClick") : null;
|
|
5816
6026
|
const hyperlinkTargetNode = _nullishCoalesce(hyperlinkNode, () => ( node));
|
|
5817
6027
|
const hyperlinkId = hyperlinkTargetNode ? getRelationshipId(hyperlinkTargetNode) : null;
|
|
5818
|
-
return hyperlinkId ? _nullishCoalesce(_optionalChain([drawingRelationships, 'access',
|
|
6028
|
+
return hyperlinkId ? _nullishCoalesce(_optionalChain([drawingRelationships, 'access', _588 => _588.get, 'call', _589 => _589(hyperlinkId), 'optionalAccess', _590 => _590.target]), () => ( void 0)) : void 0;
|
|
5819
6029
|
}
|
|
5820
6030
|
function parsePictureNode(pictureNode, fallbackAnchor, drawingRelationships, archive, contentTypes, objectUrls, workbookSheetIndex, imageId, zIndex, parentGroup) {
|
|
5821
6031
|
const blipNode = getFirstDescendant(pictureNode, "blip");
|
|
@@ -5837,12 +6047,12 @@ function parsePictureNode(pictureNode, fallbackAnchor, drawingRelationships, arc
|
|
|
5837
6047
|
return {
|
|
5838
6048
|
image: {
|
|
5839
6049
|
anchor: transform.anchor,
|
|
5840
|
-
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
6050
|
+
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _591 => _591.getAttribute, 'call', _592 => _592("descr")]), () => ( void 0)),
|
|
5841
6051
|
hyperlink: getHyperlinkTarget(_nullishCoalesce(nonVisualProps, () => ( pictureNode)), drawingRelationships),
|
|
5842
6052
|
id: imageId,
|
|
5843
6053
|
mediaPath: mediaRelationship.target,
|
|
5844
6054
|
mimeType: resolveContentType(contentTypes, mediaRelationship.target),
|
|
5845
|
-
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
6055
|
+
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _593 => _593.getAttribute, 'call', _594 => _594("name")]), () => ( void 0)),
|
|
5846
6056
|
sheetIndex: workbookSheetIndex,
|
|
5847
6057
|
src: createImageSource(mediaBytes, resolveContentType(contentTypes, mediaRelationship.target), objectUrls),
|
|
5848
6058
|
workbookSheetIndex,
|
|
@@ -5855,28 +6065,28 @@ function parseShapeNode(shapeNode, fallbackAnchor, drawingRelationships, theme,
|
|
|
5855
6065
|
const nonVisualProps = getFirstDescendant(shapeNode, "cNvPr");
|
|
5856
6066
|
const styleNode = getFirstChild(shapeNode, "style");
|
|
5857
6067
|
const transform = anchorFromNodeOrFallback(shapeNode, fallbackAnchor, parentGroup);
|
|
5858
|
-
const geometry = _nullishCoalesce(_optionalChain([getFirstDescendant, 'call',
|
|
6068
|
+
const geometry = _nullishCoalesce(_optionalChain([getFirstDescendant, 'call', _595 => _595(shapeNode, "prstGeom"), 'optionalAccess', _596 => _596.getAttribute, 'call', _597 => _597("prst")]), () => ( (getFirstDescendant(shapeNode, "custGeom") ? "custom" : "rect")));
|
|
5859
6069
|
const customPath = geometry === "custom" ? parseCustomGeometryPath(shapeNode) : void 0;
|
|
5860
6070
|
const geometryAdjustments = parseShapeGeometryAdjustments(shapeNode);
|
|
5861
6071
|
return {
|
|
5862
6072
|
anchor: transform.anchor,
|
|
5863
|
-
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
6073
|
+
description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _598 => _598.getAttribute, 'call', _599 => _599("descr")]), () => ( void 0)),
|
|
5864
6074
|
fill: parseShapeFill(shapeNode, styleNode, theme, geometry),
|
|
5865
6075
|
flipH: transform.flipH,
|
|
5866
6076
|
flipV: transform.flipV,
|
|
5867
6077
|
geometry,
|
|
5868
6078
|
geometryAdjustments,
|
|
5869
|
-
hidden: _optionalChain([nonVisualProps, 'optionalAccess',
|
|
6079
|
+
hidden: _optionalChain([nonVisualProps, 'optionalAccess', _600 => _600.getAttribute, 'call', _601 => _601("hidden")]) === "1" || void 0,
|
|
5870
6080
|
hyperlink: getHyperlinkTarget(_nullishCoalesce(nonVisualProps, () => ( shapeNode)), drawingRelationships),
|
|
5871
6081
|
id: shapeId,
|
|
5872
|
-
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess',
|
|
6082
|
+
name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _602 => _602.getAttribute, 'call', _603 => _603("name")]), () => ( void 0)),
|
|
5873
6083
|
paragraphs: parseShapeParagraphs(shapeNode, styleNode, theme),
|
|
5874
6084
|
rotationDeg: transform.rotationDeg,
|
|
5875
6085
|
scaleX: transform.scaleX,
|
|
5876
6086
|
scaleY: transform.scaleY,
|
|
5877
6087
|
sheetIndex: workbookSheetIndex,
|
|
5878
|
-
svgPath: _optionalChain([customPath, 'optionalAccess',
|
|
5879
|
-
svgViewBox: _optionalChain([customPath, 'optionalAccess',
|
|
6088
|
+
svgPath: _optionalChain([customPath, 'optionalAccess', _604 => _604.path]),
|
|
6089
|
+
svgViewBox: _optionalChain([customPath, 'optionalAccess', _605 => _605.viewBox]),
|
|
5880
6090
|
stroke: parseShapeStroke(shapeNode, styleNode, theme),
|
|
5881
6091
|
textBox: parseTextBox(shapeNode),
|
|
5882
6092
|
workbookSheetIndex,
|
|
@@ -6185,7 +6395,7 @@ function updateWorkbookImageAnchor(assets, imageId, anchor) {
|
|
|
6185
6395
|
if (!origin) {
|
|
6186
6396
|
return false;
|
|
6187
6397
|
}
|
|
6188
|
-
const attachments = _nullishCoalesce(_optionalChain([assets, 'access',
|
|
6398
|
+
const attachments = _nullishCoalesce(_optionalChain([assets, 'access', _606 => _606.sheetOrigins, 'access', _607 => _607[origin.workbookSheetIndex], 'optionalAccess', _608 => _608.attachments]), () => ( []));
|
|
6189
6399
|
for (const attachment of attachments) {
|
|
6190
6400
|
if (attachment.drawingPath !== origin.drawingPath) {
|
|
6191
6401
|
continue;
|
|
@@ -6295,7 +6505,7 @@ function mergeContentTypeForPath(targetDocument, originalDocument, partPath) {
|
|
|
6295
6505
|
return;
|
|
6296
6506
|
}
|
|
6297
6507
|
}
|
|
6298
|
-
const extension = _optionalChain([normalizedPartName, 'access',
|
|
6508
|
+
const extension = _optionalChain([normalizedPartName, 'access', _609 => _609.split, 'call', _610 => _610("."), 'access', _611 => _611.pop, 'call', _612 => _612(), 'optionalAccess', _613 => _613.toLowerCase, 'call', _614 => _614()]);
|
|
6299
6509
|
if (!extension) {
|
|
6300
6510
|
return;
|
|
6301
6511
|
}
|
|
@@ -6348,7 +6558,7 @@ function appendSheetDrawingReference(sheetDocument, relationshipId) {
|
|
|
6348
6558
|
return;
|
|
6349
6559
|
}
|
|
6350
6560
|
const drawingNode = sheetDocument.createElementNS(SPREADSHEET_NS, "drawing");
|
|
6351
|
-
drawingNode.setAttributeNS(
|
|
6561
|
+
drawingNode.setAttributeNS(REL_NS2, "r:id", relationshipId);
|
|
6352
6562
|
const successorNames = /* @__PURE__ */ new Set([
|
|
6353
6563
|
"legacyDrawing",
|
|
6354
6564
|
"legacyDrawingHF",
|
|
@@ -6398,7 +6608,7 @@ function mergeWorkbookImageAssets(savedBytes, sourceAssets, sheetOrigins) {
|
|
|
6398
6608
|
}
|
|
6399
6609
|
};
|
|
6400
6610
|
sheetOrigins.forEach((origin, workbookSheetIndex) => {
|
|
6401
|
-
if (!_optionalChain([origin, 'optionalAccess',
|
|
6611
|
+
if (!_optionalChain([origin, 'optionalAccess', _615 => _615.attachments, 'access', _616 => _616.length])) {
|
|
6402
6612
|
return;
|
|
6403
6613
|
}
|
|
6404
6614
|
const currentSheet = workbookSheets[workbookSheetIndex];
|
|
@@ -6427,7 +6637,7 @@ function mergeWorkbookImageAssets(savedBytes, sourceAssets, sheetOrigins) {
|
|
|
6427
6637
|
relationshipNode.setAttribute("Id", relationshipId);
|
|
6428
6638
|
relationshipNode.setAttribute("Type", DRAWING_REL_TYPE);
|
|
6429
6639
|
relationshipNode.setAttribute("Target", relativeArchivePath(currentSheet.path, attachment.drawingPath));
|
|
6430
|
-
_optionalChain([relDocument, 'access',
|
|
6640
|
+
_optionalChain([relDocument, 'access', _617 => _617.documentElement, 'optionalAccess', _618 => _618.appendChild, 'call', _619 => _619(relationshipNode)]);
|
|
6431
6641
|
appendSheetDrawingReference(sheetDocument, relationshipId);
|
|
6432
6642
|
});
|
|
6433
6643
|
archive[currentSheet.path] = _fflate.strToU8.call(void 0, serializeXml2(sheetDocument));
|
|
@@ -6598,7 +6808,7 @@ function collectReferencedSheetNames(workbook) {
|
|
|
6598
6808
|
continue;
|
|
6599
6809
|
}
|
|
6600
6810
|
for (const cell of cells) {
|
|
6601
|
-
const formula = _optionalChain([cell, 'optionalAccess',
|
|
6811
|
+
const formula = _optionalChain([cell, 'optionalAccess', _620 => _620.formula]);
|
|
6602
6812
|
if (!formula) {
|
|
6603
6813
|
continue;
|
|
6604
6814
|
}
|
|
@@ -6645,7 +6855,7 @@ function collectFormulaCellsWithSavedValues(workbook) {
|
|
|
6645
6855
|
continue;
|
|
6646
6856
|
}
|
|
6647
6857
|
for (const cell of cells) {
|
|
6648
|
-
if (typeof _optionalChain([cell, 'optionalAccess',
|
|
6858
|
+
if (typeof _optionalChain([cell, 'optionalAccess', _621 => _621.row]) !== "number" || typeof _optionalChain([cell, 'optionalAccess', _622 => _622.col]) !== "number") {
|
|
6649
6859
|
continue;
|
|
6650
6860
|
}
|
|
6651
6861
|
let saved;
|
|
@@ -7210,14 +7420,14 @@ function clampZoomScale(zoomScale) {
|
|
|
7210
7420
|
return Math.min(MAX_ZOOM_SCALE, Math.max(MIN_ZOOM_SCALE, Math.round(zoomScale)));
|
|
7211
7421
|
}
|
|
7212
7422
|
function resolveDefaultZoomScale(activeTab, activeSheet) {
|
|
7213
|
-
if (_optionalChain([activeTab, 'optionalAccess',
|
|
7423
|
+
if (_optionalChain([activeTab, 'optionalAccess', _623 => _623.kind]) !== "sheet") {
|
|
7214
7424
|
return DEFAULT_ZOOM_SCALE;
|
|
7215
7425
|
}
|
|
7216
|
-
return clampZoomScale(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
7426
|
+
return clampZoomScale(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _624 => _624.zoomScale]), () => ( DEFAULT_ZOOM_SCALE)));
|
|
7217
7427
|
}
|
|
7218
7428
|
function resolveWorksheetZoomScale(worksheet, sheetState) {
|
|
7219
7429
|
const candidates = [
|
|
7220
|
-
typeof _optionalChain([sheetState, 'optionalAccess',
|
|
7430
|
+
typeof _optionalChain([sheetState, 'optionalAccess', _625 => _625.zoomScale]) === "number" ? sheetState.zoomScale : void 0,
|
|
7221
7431
|
typeof worksheet.zoomScale === "number" ? worksheet.zoomScale : void 0
|
|
7222
7432
|
];
|
|
7223
7433
|
const value = candidates.find((entry) => typeof entry === "number" && Number.isFinite(entry) && entry > 0);
|
|
@@ -7336,18 +7546,18 @@ function resolveDisplayFileName(src, fileName) {
|
|
|
7336
7546
|
}
|
|
7337
7547
|
function resolveSheetDisplayUsedRange(usedRange, sheetState) {
|
|
7338
7548
|
const [minRow, minCol, maxRow, maxCol] = usedRange;
|
|
7339
|
-
const maxContentRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7340
|
-
const maxContentCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7341
|
-
const maxVerticalMergeEndRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7342
|
-
const maxHorizontalMergeEndCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7549
|
+
const maxContentRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _626 => _626.maxContentRow]), () => ( -1));
|
|
7550
|
+
const maxContentCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _627 => _627.maxContentCol]), () => ( -1));
|
|
7551
|
+
const maxVerticalMergeEndRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _628 => _628.maxVerticalMergeEndRow]), () => ( -1));
|
|
7552
|
+
const maxHorizontalMergeEndCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _629 => _629.maxHorizontalMergeEndCol]), () => ( -1));
|
|
7343
7553
|
const maxMeaningfulRow = Math.max(maxContentRow, maxVerticalMergeEndRow);
|
|
7344
7554
|
const maxMeaningfulCol = Math.max(maxContentCol, maxHorizontalMergeEndCol);
|
|
7345
7555
|
if (maxMeaningfulRow < 0 && maxMeaningfulCol < 0) {
|
|
7346
7556
|
return usedRange;
|
|
7347
7557
|
}
|
|
7348
7558
|
return [
|
|
7349
|
-
_optionalChain([sheetState, 'optionalAccess',
|
|
7350
|
-
_optionalChain([sheetState, 'optionalAccess',
|
|
7559
|
+
_optionalChain([sheetState, 'optionalAccess', _630 => _630.minContentRow]) !== void 0 && sheetState.minContentRow >= 0 ? Math.min(minRow, sheetState.minContentRow) : minRow,
|
|
7560
|
+
_optionalChain([sheetState, 'optionalAccess', _631 => _631.minContentCol]) !== void 0 && sheetState.minContentCol >= 0 ? Math.min(minCol, sheetState.minContentCol) : minCol,
|
|
7351
7561
|
maxMeaningfulRow >= 0 ? maxContentRow >= 0 ? Math.min(maxRow, maxMeaningfulRow) : Math.max(maxRow, maxMeaningfulRow) : maxRow,
|
|
7352
7562
|
maxMeaningfulCol >= 0 ? maxContentCol >= 0 ? Math.min(maxCol, maxMeaningfulCol) : Math.max(maxCol, maxMeaningfulCol) : maxCol
|
|
7353
7563
|
];
|
|
@@ -7356,18 +7566,18 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7356
7566
|
const sheets = [];
|
|
7357
7567
|
for (let index = 0; index < workbook.sheetCount; index += 1) {
|
|
7358
7568
|
const worksheet = workbook.getSheet(index);
|
|
7359
|
-
const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess',
|
|
7569
|
+
const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess', _632 => _632[index]]), () => ( null));
|
|
7360
7570
|
const mergeMetadata = resolveWorksheetMergeMetadata(worksheet);
|
|
7361
7571
|
const effectiveSheetState = {
|
|
7362
7572
|
...sheetState,
|
|
7363
7573
|
...mergeMetadata
|
|
7364
7574
|
};
|
|
7365
|
-
const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7575
|
+
const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _633 => _633.defaultColWidthPx]), () => ( resolveWorksheetDefaultColumnWidthPixels(
|
|
7366
7576
|
worksheet,
|
|
7367
|
-
_optionalChain([sheetState, 'optionalAccess',
|
|
7577
|
+
_optionalChain([sheetState, 'optionalAccess', _634 => _634.columnWidthCharacterWidthPx]),
|
|
7368
7578
|
DEFAULT_COL_WIDTH
|
|
7369
7579
|
)));
|
|
7370
|
-
const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7580
|
+
const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _635 => _635.defaultRowHeightPx]), () => ( resolveWorksheetDefaultRowHeightPixels(
|
|
7371
7581
|
worksheet,
|
|
7372
7582
|
DEFAULT_ROW_HEIGHT
|
|
7373
7583
|
)));
|
|
@@ -7378,27 +7588,28 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7378
7588
|
const resolveColumnWidthPx = (col) => {
|
|
7379
7589
|
const width = worksheet.getColumnWidth(col);
|
|
7380
7590
|
if (width !== void 0 && width !== null) {
|
|
7381
|
-
return resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess',
|
|
7591
|
+
return resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _636 => _636.columnWidthCharacterWidthPx]));
|
|
7382
7592
|
}
|
|
7383
|
-
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7593
|
+
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _637 => _637.colWidthOverridesPx, 'optionalAccess', _638 => _638[col]]), () => ( defaultColWidthPx));
|
|
7384
7594
|
};
|
|
7385
7595
|
const resolveRowHeightPx = (row) => {
|
|
7386
7596
|
const height = worksheet.getRowHeight(row);
|
|
7387
7597
|
if (height !== void 0 && height !== null) {
|
|
7388
7598
|
return Math.max(Math.round(height * 1.33), MIN_ROW_HEIGHT_PX2);
|
|
7389
7599
|
}
|
|
7390
|
-
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7600
|
+
return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _639 => _639.rowHeightOverridesPx, 'optionalAccess', _640 => _640[row]]), () => ( defaultRowHeightPx));
|
|
7391
7601
|
};
|
|
7392
7602
|
const usedRange = worksheet.usedRange();
|
|
7393
7603
|
if (!usedRange) {
|
|
7394
7604
|
sheets.push({
|
|
7395
|
-
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7396
|
-
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7397
|
-
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess',
|
|
7398
|
-
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7399
|
-
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7400
|
-
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7605
|
+
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _641 => _641.autoFilterRanges]), () => ( [])),
|
|
7606
|
+
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _642 => _642.cachedFormulaValues]), () => ( {})),
|
|
7607
|
+
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _643 => _643.columnWidthCharacterWidthPx]),
|
|
7608
|
+
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _644 => _644.colWidthOverridesPx]), () => ( {})),
|
|
7609
|
+
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _645 => _645.colStyleIds]), () => ( {})),
|
|
7610
|
+
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _646 => _646.conditionalFormatRules]), () => ( [])),
|
|
7401
7611
|
dataValidations: parseWorksheetDataValidations(worksheet),
|
|
7612
|
+
officeLayout: _optionalChain([sheetState, 'optionalAccess', _647 => _647.officeLayout]),
|
|
7402
7613
|
defaultColWidthPx,
|
|
7403
7614
|
defaultRowHeightPx,
|
|
7404
7615
|
freezePanes: parseWorksheetFreezePanes(worksheet),
|
|
@@ -7418,17 +7629,17 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7418
7629
|
namedCellStyleByName: _nullishCoalesce(namedCellStyleByName, () => ( {})),
|
|
7419
7630
|
rowCount: 0,
|
|
7420
7631
|
colCount: 0,
|
|
7421
|
-
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7422
|
-
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7423
|
-
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7632
|
+
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _648 => _648.rowHeightOverridesPx]), () => ( {})),
|
|
7633
|
+
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _649 => _649.rowStyleIds]), () => ( {})),
|
|
7634
|
+
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _650 => _650.cellStyleIds]), () => ( {})),
|
|
7424
7635
|
styleById: _nullishCoalesce(styleById, () => ( {})),
|
|
7425
|
-
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7636
|
+
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _651 => _651.sparklines]), () => ( [])),
|
|
7426
7637
|
tableStyleByName: _nullishCoalesce(tableStyleByName, () => ( {})),
|
|
7427
7638
|
visibleRows: [],
|
|
7428
7639
|
visibleCols: [],
|
|
7429
7640
|
colWidths: [],
|
|
7430
7641
|
rowHeights: [],
|
|
7431
|
-
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7642
|
+
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _652 => _652.showGridLines]), () => ( true)),
|
|
7432
7643
|
themePalette: _nullishCoalesce(themePalette, () => ( { colorsByIndex: {} })),
|
|
7433
7644
|
workbookSheetIndex: index,
|
|
7434
7645
|
zoomScale: resolveWorksheetZoomScale(worksheet, sheetState)
|
|
@@ -7481,13 +7692,14 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7481
7692
|
return colWidthsCache;
|
|
7482
7693
|
};
|
|
7483
7694
|
const sheet = {
|
|
7484
|
-
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7485
|
-
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7486
|
-
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess',
|
|
7487
|
-
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7488
|
-
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7489
|
-
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7695
|
+
autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _653 => _653.autoFilterRanges]), () => ( [])),
|
|
7696
|
+
cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _654 => _654.cachedFormulaValues]), () => ( {})),
|
|
7697
|
+
columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _655 => _655.columnWidthCharacterWidthPx]),
|
|
7698
|
+
colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _656 => _656.colWidthOverridesPx]), () => ( {})),
|
|
7699
|
+
colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _657 => _657.colStyleIds]), () => ( {})),
|
|
7700
|
+
conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _658 => _658.conditionalFormatRules]), () => ( [])),
|
|
7490
7701
|
dataValidations: parseWorksheetDataValidations(worksheet),
|
|
7702
|
+
officeLayout: _optionalChain([sheetState, 'optionalAccess', _659 => _659.officeLayout]),
|
|
7491
7703
|
defaultColWidthPx,
|
|
7492
7704
|
defaultRowHeightPx,
|
|
7493
7705
|
freezePanes: parseWorksheetFreezePanes(worksheet),
|
|
@@ -7505,12 +7717,12 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
|
|
|
7505
7717
|
name: worksheet.name,
|
|
7506
7718
|
visibility,
|
|
7507
7719
|
namedCellStyleByName: _nullishCoalesce(namedCellStyleByName, () => ( {})),
|
|
7508
|
-
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7509
|
-
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7510
|
-
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7511
|
-
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7720
|
+
rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _660 => _660.rowHeightOverridesPx]), () => ( {})),
|
|
7721
|
+
rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _661 => _661.rowStyleIds]), () => ( {})),
|
|
7722
|
+
cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _662 => _662.cellStyleIds]), () => ( {})),
|
|
7723
|
+
showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _663 => _663.showGridLines]), () => ( true)),
|
|
7512
7724
|
styleById: _nullishCoalesce(styleById, () => ( {})),
|
|
7513
|
-
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
7725
|
+
sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _664 => _664.sparklines]), () => ( [])),
|
|
7514
7726
|
tableStyleByName: _nullishCoalesce(tableStyleByName, () => ( {})),
|
|
7515
7727
|
themePalette: _nullishCoalesce(themePalette, () => ( { colorsByIndex: {} })),
|
|
7516
7728
|
workbookSheetIndex: index,
|
|
@@ -7631,15 +7843,15 @@ function resolveWorkbookReference(workbook, defaultWorkbookSheetIndex, rawRefere
|
|
|
7631
7843
|
}
|
|
7632
7844
|
}
|
|
7633
7845
|
function parseColorHex(hex) {
|
|
7634
|
-
const normalized = _optionalChain([hex, 'optionalAccess',
|
|
7846
|
+
const normalized = _optionalChain([hex, 'optionalAccess', _665 => _665.replace, 'call', _666 => _666(/^#/, "")]);
|
|
7635
7847
|
return normalized && /^[0-9a-f]{6}$/i.test(normalized) ? [0, 2, 4].map((offset) => Number.parseInt(normalized.slice(offset, offset + 2), 16)) : null;
|
|
7636
7848
|
}
|
|
7637
7849
|
function xlsxColorToDukeColor(color) {
|
|
7638
7850
|
if (!color) {
|
|
7639
7851
|
return void 0;
|
|
7640
7852
|
}
|
|
7641
|
-
const normalizedHex = _optionalChain([color, 'access',
|
|
7642
|
-
const colorType = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(color.colorType, () => ( (_optionalChain([normalizedHex, 'optionalAccess',
|
|
7853
|
+
const normalizedHex = _optionalChain([color, 'access', _667 => _667.hex, 'optionalAccess', _668 => _668.replace, 'call', _669 => _669(/^#/, "")]);
|
|
7854
|
+
const colorType = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(color.colorType, () => ( (_optionalChain([normalizedHex, 'optionalAccess', _670 => _670.length]) === 8 ? "argb" : _optionalChain([normalizedHex, 'optionalAccess', _671 => _671.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)));
|
|
7643
7855
|
switch (colorType) {
|
|
7644
7856
|
case "auto":
|
|
7645
7857
|
return { colorType: "auto" };
|
|
@@ -7648,7 +7860,7 @@ function xlsxColorToDukeColor(color) {
|
|
|
7648
7860
|
return channels ? { b: channels[2], colorType: "rgb", g: channels[1], r: channels[0] } : void 0;
|
|
7649
7861
|
}
|
|
7650
7862
|
case "argb": {
|
|
7651
|
-
const normalized = _optionalChain([color, 'access',
|
|
7863
|
+
const normalized = _optionalChain([color, 'access', _672 => _672.hex, 'optionalAccess', _673 => _673.replace, 'call', _674 => _674(/^#/, "")]);
|
|
7652
7864
|
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;
|
|
7653
7865
|
return channels ? { a: channels[0], b: channels[3], colorType: "argb", g: channels[2], r: channels[1] } : void 0;
|
|
7654
7866
|
}
|
|
@@ -7771,7 +7983,7 @@ function reconcileCheckedOptionButtons(worksheet) {
|
|
|
7771
7983
|
const checkedPaths = worksheet.formControls.flatMap((control) => control.formControl.kind.kind === "optionButton" && control.formControl.kind.state === "checked" ? [control.drawingPath] : []);
|
|
7772
7984
|
for (const path of checkedPaths) {
|
|
7773
7985
|
const current = worksheet.formControls.find((control) => control.drawingPath.length === path.length && control.drawingPath.every((segment, index) => segment === path[index]));
|
|
7774
|
-
if (_optionalChain([current, 'optionalAccess',
|
|
7986
|
+
if (_optionalChain([current, 'optionalAccess', _675 => _675.formControl, 'access', _676 => _676.kind, 'access', _677 => _677.kind]) === "optionButton" && current.formControl.kind.state === "checked") {
|
|
7775
7987
|
worksheet.setFormControlCheckState(current.drawingPath, "checked");
|
|
7776
7988
|
}
|
|
7777
7989
|
}
|
|
@@ -7800,8 +8012,8 @@ function formControlInteractionChanged(current, next) {
|
|
|
7800
8012
|
}
|
|
7801
8013
|
function parseWorksheetFreezePanes(worksheet) {
|
|
7802
8014
|
const rawFreezePanes = worksheet.freezePanes;
|
|
7803
|
-
const row = typeof _optionalChain([rawFreezePanes, 'optionalAccess',
|
|
7804
|
-
const col = typeof _optionalChain([rawFreezePanes, 'optionalAccess',
|
|
8015
|
+
const row = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _678 => _678.row]) === "number" && rawFreezePanes.row >= 0 ? rawFreezePanes.row : null;
|
|
8016
|
+
const col = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _679 => _679.col]) === "number" && rawFreezePanes.col >= 0 ? rawFreezePanes.col : null;
|
|
7805
8017
|
if (row === null && col === null) {
|
|
7806
8018
|
return null;
|
|
7807
8019
|
}
|
|
@@ -7868,7 +8080,7 @@ function rangesIntersect(a, b) {
|
|
|
7868
8080
|
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;
|
|
7869
8081
|
}
|
|
7870
8082
|
function mapWorksheetTables(worksheet, autoFilterRanges = []) {
|
|
7871
|
-
const rawTables = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess',
|
|
8083
|
+
const rawTables = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _680 => _680.tables]), () => ( []));
|
|
7872
8084
|
const mappedTables = rawTables.flatMap((table, index) => {
|
|
7873
8085
|
const rawColumns = Array.isArray(table.columns) ? table.columns : [];
|
|
7874
8086
|
const rawName = typeof table.name === "string" ? table.name : `Table${index + 1}`;
|
|
@@ -7965,7 +8177,7 @@ function pxToSheetRowHeight(heightPx) {
|
|
|
7965
8177
|
return Math.max(heightPx, MIN_ROW_HEIGHT_PX2) / 1.33;
|
|
7966
8178
|
}
|
|
7967
8179
|
function cssColor(color) {
|
|
7968
|
-
if (!_optionalChain([color, 'optionalAccess',
|
|
8180
|
+
if (!_optionalChain([color, 'optionalAccess', _681 => _681.hex])) {
|
|
7969
8181
|
return null;
|
|
7970
8182
|
}
|
|
7971
8183
|
const hex = String(color.hex);
|
|
@@ -8101,7 +8313,7 @@ function isAbortError(error) {
|
|
|
8101
8313
|
}
|
|
8102
8314
|
async function resolveWorkbookBuffer({ file, src }, signal) {
|
|
8103
8315
|
let buffer;
|
|
8104
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
8316
|
+
if (_optionalChain([signal, 'optionalAccess', _682 => _682.aborted])) {
|
|
8105
8317
|
throw createAbortError2();
|
|
8106
8318
|
}
|
|
8107
8319
|
if (file) {
|
|
@@ -8157,7 +8369,7 @@ function scheduleLowPriorityTask(task) {
|
|
|
8157
8369
|
task();
|
|
8158
8370
|
}, { timeout: 120 });
|
|
8159
8371
|
return () => {
|
|
8160
|
-
_optionalChain([idleWindow, 'access',
|
|
8372
|
+
_optionalChain([idleWindow, 'access', _683 => _683.cancelIdleCallback, 'optionalCall', _684 => _684(idleHandle)]);
|
|
8161
8373
|
};
|
|
8162
8374
|
}
|
|
8163
8375
|
const timeoutHandle = window.setTimeout(task, 0);
|
|
@@ -8170,7 +8382,7 @@ function inferImageMimeType(source) {
|
|
|
8170
8382
|
return source.slice(5, separatorIndex);
|
|
8171
8383
|
}
|
|
8172
8384
|
}
|
|
8173
|
-
const normalized = _nullishCoalesce(_optionalChain([source, 'access',
|
|
8385
|
+
const normalized = _nullishCoalesce(_optionalChain([source, 'access', _685 => _685.split, 'call', _686 => _686("?"), 'access', _687 => _687[0], 'optionalAccess', _688 => _688.toLowerCase, 'call', _689 => _689()]), () => ( ""));
|
|
8174
8386
|
if (normalized.endsWith(".gif")) {
|
|
8175
8387
|
return "image/gif";
|
|
8176
8388
|
}
|
|
@@ -8323,7 +8535,7 @@ function mergeParsedAndApiImages(parsedImages, apiImages, hiddenAnchorKeys) {
|
|
|
8323
8535
|
if (apiImages.length === 0) {
|
|
8324
8536
|
return visibleParsedImages;
|
|
8325
8537
|
}
|
|
8326
|
-
const normalizeTextKey = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
8538
|
+
const normalizeTextKey = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _690 => _690.trim, 'call', _691 => _691(), 'access', _692 => _692.toLowerCase, 'call', _693 => _693()]), () => ( ""));
|
|
8327
8539
|
const imageKeys = (image) => {
|
|
8328
8540
|
const keys = [
|
|
8329
8541
|
`${normalizeTextKey(image.mediaPath)}|${normalizeTextKey(image.name)}|${imageAnchorKey(image.anchor)}`,
|
|
@@ -8537,7 +8749,7 @@ function useXlsxViewerController(options) {
|
|
|
8537
8749
|
const shouldForceReadOnlyForBuffer = React.useCallback((bufferByteLength) => !requestedReadOnly && readOnlyAboveBytes > 0 && bufferByteLength > readOnlyAboveBytes, [readOnlyAboveBytes, requestedReadOnly]);
|
|
8538
8750
|
const shouldUseWorkerForReadOnlyLoad = React.useCallback((willForceReadOnly) => workerSupported && (willForceReadOnly || canUseWorkerForRequestedReadOnly), [canUseWorkerForRequestedReadOnly, workerSupported]);
|
|
8539
8751
|
const disposeWorkerClient = React.useCallback(() => {
|
|
8540
|
-
_optionalChain([workerClientRef, 'access',
|
|
8752
|
+
_optionalChain([workerClientRef, 'access', _694 => _694.current, 'optionalAccess', _695 => _695.dispose, 'call', _696 => _696()]);
|
|
8541
8753
|
workerClientRef.current = null;
|
|
8542
8754
|
}, []);
|
|
8543
8755
|
const getWorkerClient = React.useCallback(() => {
|
|
@@ -8556,7 +8768,7 @@ function useXlsxViewerController(options) {
|
|
|
8556
8768
|
}, []);
|
|
8557
8769
|
const clearChartAssets = React.useCallback(() => {
|
|
8558
8770
|
chartLoadRequestTokenRef.current += 1;
|
|
8559
|
-
_optionalChain([chartDisplayFallbackCleanupRef, 'access',
|
|
8771
|
+
_optionalChain([chartDisplayFallbackCleanupRef, 'access', _697 => _697.current, 'optionalCall', _698 => _698()]);
|
|
8560
8772
|
chartDisplayFallbackCleanupRef.current = null;
|
|
8561
8773
|
chartAssetsRef.current = null;
|
|
8562
8774
|
setChartsByWorkbookSheetIndex([]);
|
|
@@ -8567,16 +8779,16 @@ function useXlsxViewerController(options) {
|
|
|
8567
8779
|
const setImageAssets = React.useCallback((assets) => {
|
|
8568
8780
|
revokeWorkbookImageAssets(imageAssetsRef.current);
|
|
8569
8781
|
imageAssetsRef.current = assets;
|
|
8570
|
-
sheetOriginsRef.current = _nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8571
|
-
setFormControlsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8572
|
-
setImagesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8573
|
-
setShapesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8782
|
+
sheetOriginsRef.current = _nullishCoalesce(_optionalChain([assets, 'optionalAccess', _699 => _699.sheetOrigins, 'access', _700 => _700.slice, 'call', _701 => _701()]), () => ( []));
|
|
8783
|
+
setFormControlsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _702 => _702.formControlsByWorkbookSheetIndex]), () => ( [])));
|
|
8784
|
+
setImagesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _703 => _703.imagesByWorkbookSheetIndex]), () => ( [])));
|
|
8785
|
+
setShapesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _704 => _704.shapesByWorkbookSheetIndex]), () => ( [])));
|
|
8574
8786
|
}, []);
|
|
8575
8787
|
const setChartAssets = React.useCallback((assets) => {
|
|
8576
8788
|
chartAssetsRef.current = assets;
|
|
8577
|
-
setChartsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8578
|
-
setChartsheets(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8579
|
-
setTabs(_nullishCoalesce(_optionalChain([assets, 'optionalAccess',
|
|
8789
|
+
setChartsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _705 => _705.chartsByWorkbookSheetIndex]), () => ( [])));
|
|
8790
|
+
setChartsheets(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _706 => _706.chartsheets]), () => ( [])));
|
|
8791
|
+
setTabs(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _707 => _707.tabs]), () => ( [])));
|
|
8580
8792
|
setIsChartsLoading(false);
|
|
8581
8793
|
}, []);
|
|
8582
8794
|
const shouldFallbackFromWorkerError = React.useCallback((error2) => {
|
|
@@ -8638,7 +8850,7 @@ function useXlsxViewerController(options) {
|
|
|
8638
8850
|
setIsChartsLoading(true);
|
|
8639
8851
|
const requestToken = chartLoadRequestTokenRef.current + 1;
|
|
8640
8852
|
chartLoadRequestTokenRef.current = requestToken;
|
|
8641
|
-
_optionalChain([chartDisplayFallbackCleanupRef, 'access',
|
|
8853
|
+
_optionalChain([chartDisplayFallbackCleanupRef, 'access', _708 => _708.current, 'optionalCall', _709 => _709()]);
|
|
8642
8854
|
chartDisplayFallbackCleanupRef.current = null;
|
|
8643
8855
|
let fallbackTriggered = false;
|
|
8644
8856
|
const triggerFallback = () => {
|
|
@@ -8656,7 +8868,7 @@ function useXlsxViewerController(options) {
|
|
|
8656
8868
|
return;
|
|
8657
8869
|
}
|
|
8658
8870
|
if (imageAssetsRef.current && !effectiveSkipXmlParsing) {
|
|
8659
|
-
const chartOriginsById = hydrateWorkbookChartStyles(result.chartsByWorkbookSheetIndex, imageAssetsRef.current);
|
|
8871
|
+
const chartOriginsById = hydrateWorkbookChartStyles(result.chartsByWorkbookSheetIndex, imageAssetsRef.current, result.chartsheets);
|
|
8660
8872
|
chartAssetsRef.current = { ...result, chartOriginsById };
|
|
8661
8873
|
}
|
|
8662
8874
|
setChartsByWorkbookSheetIndex(result.chartsByWorkbookSheetIndex);
|
|
@@ -8737,11 +8949,11 @@ function useXlsxViewerController(options) {
|
|
|
8737
8949
|
};
|
|
8738
8950
|
}, [skipXmlParsing]);
|
|
8739
8951
|
const refreshWorkbookState = React.useCallback((targetWorkbook) => {
|
|
8740
|
-
const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access',
|
|
8952
|
+
const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _710 => _710.current, 'optionalAccess', _711 => _711.formControlsByWorkbookSheetIndex]), () => ( []));
|
|
8741
8953
|
const nextFormControls = refreshWorkbookFormControls(
|
|
8742
8954
|
targetWorkbook,
|
|
8743
8955
|
currentFormControls,
|
|
8744
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8956
|
+
_optionalChain([imageAssetsRef, 'access', _712 => _712.current, 'optionalAccess', _713 => _713.themePalette])
|
|
8745
8957
|
);
|
|
8746
8958
|
if (imageAssetsRef.current) {
|
|
8747
8959
|
imageAssetsRef.current.formControlsByWorkbookSheetIndex = nextFormControls;
|
|
@@ -8749,11 +8961,11 @@ function useXlsxViewerController(options) {
|
|
|
8749
8961
|
setFormControlsByWorkbookSheetIndex(nextFormControls);
|
|
8750
8962
|
const nextSheets = buildSheetList(
|
|
8751
8963
|
targetWorkbook,
|
|
8752
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8753
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8754
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8755
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8756
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
8964
|
+
_optionalChain([imageAssetsRef, 'access', _714 => _714.current, 'optionalAccess', _715 => _715.sheetStatesByWorkbookSheetIndex]),
|
|
8965
|
+
_optionalChain([imageAssetsRef, 'access', _716 => _716.current, 'optionalAccess', _717 => _717.themePalette]),
|
|
8966
|
+
_optionalChain([imageAssetsRef, 'access', _718 => _718.current, 'optionalAccess', _719 => _719.styleById]),
|
|
8967
|
+
_optionalChain([imageAssetsRef, 'access', _720 => _720.current, 'optionalAccess', _721 => _721.namedCellStyleByName]),
|
|
8968
|
+
_optionalChain([imageAssetsRef, 'access', _722 => _722.current, 'optionalAccess', _723 => _723.tableStyleByName]),
|
|
8757
8969
|
showHiddenSheets
|
|
8758
8970
|
);
|
|
8759
8971
|
setSheets(nextSheets);
|
|
@@ -8768,7 +8980,7 @@ function useXlsxViewerController(options) {
|
|
|
8768
8980
|
setRevision((current) => current + 1);
|
|
8769
8981
|
}, [setChartAssets, showHiddenSheets]);
|
|
8770
8982
|
React.useEffect(() => () => {
|
|
8771
|
-
_optionalChain([chartDisplayFallbackCleanupRef, 'access',
|
|
8983
|
+
_optionalChain([chartDisplayFallbackCleanupRef, 'access', _724 => _724.current, 'optionalCall', _725 => _725()]);
|
|
8772
8984
|
chartDisplayFallbackCleanupRef.current = null;
|
|
8773
8985
|
revokeWorkbookImageAssets(imageAssetsRef.current);
|
|
8774
8986
|
disposeWorkerClient();
|
|
@@ -8843,13 +9055,13 @@ function useXlsxViewerController(options) {
|
|
|
8843
9055
|
if (maxFileSizeBytes > 0 && buffer.byteLength > maxFileSizeBytes) {
|
|
8844
9056
|
throw new (0, _internal.XlsxFileSizeLimitExceededError)(buffer.byteLength, maxFileSizeBytes);
|
|
8845
9057
|
}
|
|
8846
|
-
await loadSpreadsheetFonts();
|
|
9058
|
+
await _chunkZAUUKER4cjs.loadSpreadsheetFonts.call(void 0, );
|
|
8847
9059
|
if (!isCurrent || abortController.signal.aborted) {
|
|
8848
9060
|
return;
|
|
8849
9061
|
}
|
|
8850
9062
|
buffer = normalizeWorkbookArrayBuffer(buffer);
|
|
8851
9063
|
const preflight = preflightWorkbookBuffer(buffer);
|
|
8852
|
-
if (_optionalChain([preflight, 'optionalAccess',
|
|
9064
|
+
if (_optionalChain([preflight, 'optionalAccess', _726 => _726.tooLarge])) {
|
|
8853
9065
|
throw createWorkbookTooLargeError(preflight);
|
|
8854
9066
|
}
|
|
8855
9067
|
const shouldForceReadOnly = shouldForceReadOnlyForBuffer(buffer.byteLength);
|
|
@@ -8881,10 +9093,10 @@ function useXlsxViewerController(options) {
|
|
|
8881
9093
|
return;
|
|
8882
9094
|
}
|
|
8883
9095
|
setImageAssets(workerImageAssets);
|
|
8884
|
-
const chartOriginsById = workerImageAssets ? hydrateWorkbookChartStyles(snapshot.chartsByWorkbookSheetIndex, workerImageAssets) : /* @__PURE__ */ new Map();
|
|
9096
|
+
const chartOriginsById = workerImageAssets ? hydrateWorkbookChartStyles(snapshot.chartsByWorkbookSheetIndex, workerImageAssets, snapshot.chartsheets) : /* @__PURE__ */ new Map();
|
|
8885
9097
|
setFormControlsByWorkbookSheetIndex(snapshot.formControlsByWorkbookSheetIndex);
|
|
8886
9098
|
setWorkbook(null);
|
|
8887
|
-
setSheets(snapshot.sheets);
|
|
9099
|
+
setSheets(snapshot.sheets.map((sheet) => ({ ...sheet, officeLayout: _optionalChain([workerImageAssets, 'optionalAccess', _727 => _727.sheetStatesByWorkbookSheetIndex, 'access', _728 => _728[sheet.workbookSheetIndex], 'optionalAccess', _729 => _729.officeLayout]) })));
|
|
8888
9100
|
setChartsByWorkbookSheetIndex(snapshot.chartsByWorkbookSheetIndex);
|
|
8889
9101
|
setChartsheets(snapshot.chartsheets);
|
|
8890
9102
|
setTabs(snapshot.tabs);
|
|
@@ -8969,10 +9181,10 @@ function useXlsxViewerController(options) {
|
|
|
8969
9181
|
showHiddenSheets
|
|
8970
9182
|
]);
|
|
8971
9183
|
const activeTab = _nullishCoalesce(tabs[activeTabIndex], () => ( null));
|
|
8972
|
-
const activeSheet = _optionalChain([activeTab, 'optionalAccess',
|
|
9184
|
+
const activeSheet = _optionalChain([activeTab, 'optionalAccess', _730 => _730.kind]) === "sheet" ? _nullishCoalesce(sheets[_nullishCoalesce(activeTab.sheetIndex, () => ( -1))], () => ( null)) : null;
|
|
8973
9185
|
const deferredMetadataCell = React.useDeferredValue(activeCell);
|
|
8974
9186
|
const deferredMetadataSheet = React.useDeferredValue(activeSheet);
|
|
8975
|
-
const activeZoomTabKey = _nullishCoalesce(_optionalChain([activeTab, 'optionalAccess',
|
|
9187
|
+
const activeZoomTabKey = _nullishCoalesce(_optionalChain([activeTab, 'optionalAccess', _731 => _731.id]), () => ( DEFAULT_ZOOM_TAB_KEY));
|
|
8976
9188
|
const defaultZoomScale = React.useMemo(
|
|
8977
9189
|
() => resolveDefaultZoomScale(activeTab, activeSheet),
|
|
8978
9190
|
[activeSheet, activeTab]
|
|
@@ -8998,7 +9210,7 @@ function useXlsxViewerController(options) {
|
|
|
8998
9210
|
return currentIndex;
|
|
8999
9211
|
}
|
|
9000
9212
|
const targetSheet = sheets[index];
|
|
9001
|
-
const tabIndex = tabs.findIndex((tab) => tab.kind === "sheet" && tab.workbookSheetIndex === _optionalChain([targetSheet, 'optionalAccess',
|
|
9213
|
+
const tabIndex = tabs.findIndex((tab) => tab.kind === "sheet" && tab.workbookSheetIndex === _optionalChain([targetSheet, 'optionalAccess', _732 => _732.workbookSheetIndex]));
|
|
9002
9214
|
if (tabIndex >= 0) {
|
|
9003
9215
|
setActiveTabIndexState(tabIndex);
|
|
9004
9216
|
}
|
|
@@ -9011,7 +9223,7 @@ function useXlsxViewerController(options) {
|
|
|
9011
9223
|
return currentIndex;
|
|
9012
9224
|
}
|
|
9013
9225
|
const targetTab = tabs[index];
|
|
9014
|
-
if (_optionalChain([targetTab, 'optionalAccess',
|
|
9226
|
+
if (_optionalChain([targetTab, 'optionalAccess', _733 => _733.kind]) === "sheet" && typeof targetTab.sheetIndex === "number") {
|
|
9015
9227
|
setActiveSheetIndexState(targetTab.sheetIndex);
|
|
9016
9228
|
}
|
|
9017
9229
|
return index;
|
|
@@ -9029,7 +9241,7 @@ function useXlsxViewerController(options) {
|
|
|
9029
9241
|
if (!parsed) {
|
|
9030
9242
|
return false;
|
|
9031
9243
|
}
|
|
9032
|
-
const requestedSheetName = _optionalChain([parsed, 'access',
|
|
9244
|
+
const requestedSheetName = _optionalChain([parsed, 'access', _734 => _734.sheetName, 'optionalAccess', _735 => _735.toLowerCase, 'call', _736 => _736()]);
|
|
9033
9245
|
const sheetIndex = requestedSheetName === void 0 ? _nullishCoalesce(options2.sheetIndex, () => ( activeSheetIndex)) : sheets.findIndex((sheet2) => sheet2.name.toLowerCase() === requestedSheetName);
|
|
9034
9246
|
const sheet = Number.isInteger(sheetIndex) ? sheets[sheetIndex] : void 0;
|
|
9035
9247
|
if (!sheet) {
|
|
@@ -9046,7 +9258,7 @@ function useXlsxViewerController(options) {
|
|
|
9046
9258
|
});
|
|
9047
9259
|
}
|
|
9048
9260
|
setHighlightedRanges(nextHighlights);
|
|
9049
|
-
if (_optionalChain([nextHighlights, 'access',
|
|
9261
|
+
if (_optionalChain([nextHighlights, 'access', _737 => _737[0], 'optionalAccess', _738 => _738.autoScroll])) {
|
|
9050
9262
|
setActiveSheetIndex(firstSheetIndex);
|
|
9051
9263
|
}
|
|
9052
9264
|
return true;
|
|
@@ -9111,7 +9323,7 @@ function useXlsxViewerController(options) {
|
|
|
9111
9323
|
return;
|
|
9112
9324
|
}
|
|
9113
9325
|
const preflight = preflightWorkbookBuffer(deferredBuffer);
|
|
9114
|
-
if (_optionalChain([preflight, 'optionalAccess',
|
|
9326
|
+
if (_optionalChain([preflight, 'optionalAccess', _739 => _739.tooLarge])) {
|
|
9115
9327
|
deferredBufferRef.current = null;
|
|
9116
9328
|
setDeferredLoadFileSize(null);
|
|
9117
9329
|
setWorkbook(null);
|
|
@@ -9137,11 +9349,11 @@ function useXlsxViewerController(options) {
|
|
|
9137
9349
|
}
|
|
9138
9350
|
const workerImageAssets = effectiveSkipXmlParsing ? null : parseWorkbookImageAssets(new Uint8Array(deferredBuffer));
|
|
9139
9351
|
setImageAssets(workerImageAssets);
|
|
9140
|
-
const chartOriginsById = workerImageAssets ? hydrateWorkbookChartStyles(snapshot.chartsByWorkbookSheetIndex, workerImageAssets) : /* @__PURE__ */ new Map();
|
|
9352
|
+
const chartOriginsById = workerImageAssets ? hydrateWorkbookChartStyles(snapshot.chartsByWorkbookSheetIndex, workerImageAssets, snapshot.chartsheets) : /* @__PURE__ */ new Map();
|
|
9141
9353
|
deferredBufferRef.current = null;
|
|
9142
9354
|
setDeferredLoadFileSize(null);
|
|
9143
9355
|
setWorkbook(null);
|
|
9144
|
-
setSheets(snapshot.sheets);
|
|
9356
|
+
setSheets(snapshot.sheets.map((sheet) => ({ ...sheet, officeLayout: _optionalChain([workerImageAssets, 'optionalAccess', _740 => _740.sheetStatesByWorkbookSheetIndex, 'access', _741 => _741[sheet.workbookSheetIndex], 'optionalAccess', _742 => _742.officeLayout]) })));
|
|
9145
9357
|
setChartsByWorkbookSheetIndex(snapshot.chartsByWorkbookSheetIndex);
|
|
9146
9358
|
setChartsheets(snapshot.chartsheets);
|
|
9147
9359
|
setTabs(snapshot.tabs);
|
|
@@ -9283,8 +9495,8 @@ function useXlsxViewerController(options) {
|
|
|
9283
9495
|
}
|
|
9284
9496
|
}, [activeSheetIndex, sheets, workbook]);
|
|
9285
9497
|
const tables = React.useMemo(
|
|
9286
|
-
() => isWorkerBacked ? _nullishCoalesce(workerTablesByWorkbookSheetIndex[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
9287
|
-
[_optionalChain([activeSheet, 'optionalAccess',
|
|
9498
|
+
() => isWorkerBacked ? _nullishCoalesce(workerTablesByWorkbookSheetIndex[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _743 => _743.workbookSheetIndex]), () => ( -1))], () => ( [])) : mapWorksheetTables(getActiveWorksheet(), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _744 => _744.autoFilterRanges]), () => ( []))),
|
|
9499
|
+
[_optionalChain([activeSheet, 'optionalAccess', _745 => _745.autoFilterRanges]), _optionalChain([activeSheet, 'optionalAccess', _746 => _746.workbookSheetIndex]), getActiveWorksheet, isWorkerBacked, revision, workerTablesByWorkbookSheetIndex]
|
|
9288
9500
|
);
|
|
9289
9501
|
const getCellSnapshotAsync = React.useCallback((workbookSheetIndex, row, col) => {
|
|
9290
9502
|
if (!isWorkerBacked) {
|
|
@@ -9351,9 +9563,9 @@ function useXlsxViewerController(options) {
|
|
|
9351
9563
|
}, [publicChartById]);
|
|
9352
9564
|
const getChartsheetById = React.useCallback((id) => _nullishCoalesce(chartsheets.find((chartsheet) => chartsheet.id === id), () => ( null)), [chartsheets]);
|
|
9353
9565
|
const charts = React.useMemo(() => {
|
|
9354
|
-
if (_optionalChain([activeTab, 'optionalAccess',
|
|
9566
|
+
if (_optionalChain([activeTab, 'optionalAccess', _747 => _747.kind]) === "chartsheet" && typeof activeTab.chartsheetIndex === "number") {
|
|
9355
9567
|
const chartsheet = chartsheets[activeTab.chartsheetIndex];
|
|
9356
|
-
return (_nullishCoalesce(_optionalChain([chartsheet, 'optionalAccess',
|
|
9568
|
+
return (_nullishCoalesce(_optionalChain([chartsheet, 'optionalAccess', _748 => _748.chartIds]), () => ( []))).map((id) => getChartById(id)).filter((value) => Boolean(value));
|
|
9357
9569
|
}
|
|
9358
9570
|
return getSheetCharts(activeSheetIndex);
|
|
9359
9571
|
}, [activeSheetIndex, activeTab, chartsheets, getChartById, getSheetCharts]);
|
|
@@ -9402,7 +9614,7 @@ function useXlsxViewerController(options) {
|
|
|
9402
9614
|
}, [selectedChartId]);
|
|
9403
9615
|
const selectChartElement = React.useCallback((selection2) => {
|
|
9404
9616
|
setSelectedImageId(null);
|
|
9405
|
-
setSelectedChartId(_nullishCoalesce(_optionalChain([selection2, 'optionalAccess',
|
|
9617
|
+
setSelectedChartId(_nullishCoalesce(_optionalChain([selection2, 'optionalAccess', _749 => _749.chartId]), () => ( null)));
|
|
9406
9618
|
setSelectedChartElement(selection2);
|
|
9407
9619
|
}, []);
|
|
9408
9620
|
const getSheetImages = React.useCallback((sheetIndex = activeSheetIndex) => {
|
|
@@ -9429,11 +9641,11 @@ function useXlsxViewerController(options) {
|
|
|
9429
9641
|
return [];
|
|
9430
9642
|
}
|
|
9431
9643
|
const control2 = (_nullishCoalesce(formControlsByWorkbookSheetIndex[targetSheet.workbookSheetIndex], () => ( []))).find((entry) => entry.controlIndex === controlIndex);
|
|
9432
|
-
return _nullishCoalesce(_optionalChain([control2, 'optionalAccess',
|
|
9644
|
+
return _nullishCoalesce(_optionalChain([control2, 'optionalAccess', _750 => _750.items, 'optionalAccess', _751 => _751.slice, 'call', _752 => _752()]), () => ( []));
|
|
9433
9645
|
}
|
|
9434
9646
|
const control = target.worksheet.formControls[controlIndex];
|
|
9435
|
-
const kind = _optionalChain([control, 'optionalAccess',
|
|
9436
|
-
const inputRange = _optionalChain([kind, 'optionalAccess',
|
|
9647
|
+
const kind = _optionalChain([control, 'optionalAccess', _753 => _753.formControl, 'access', _754 => _754.kind]);
|
|
9648
|
+
const inputRange = _optionalChain([kind, 'optionalAccess', _755 => _755.kind]) === "listBox" || _optionalChain([kind, 'optionalAccess', _756 => _756.kind]) === "dropdown" ? kind.inputRange : void 0;
|
|
9437
9649
|
if (!inputRange) {
|
|
9438
9650
|
return [];
|
|
9439
9651
|
}
|
|
@@ -9465,7 +9677,7 @@ function useXlsxViewerController(options) {
|
|
|
9465
9677
|
const shapes = React.useMemo(() => getSheetShapes(activeSheetIndex), [activeSheetIndex, getSheetShapes]);
|
|
9466
9678
|
const getImageById = React.useCallback((id) => {
|
|
9467
9679
|
for (const sheetImages of imagesByWorkbookSheetIndex) {
|
|
9468
|
-
const match = _optionalChain([sheetImages, 'optionalAccess',
|
|
9680
|
+
const match = _optionalChain([sheetImages, 'optionalAccess', _757 => _757.find, 'call', _758 => _758((image) => image.id === id)]);
|
|
9469
9681
|
if (match) {
|
|
9470
9682
|
return mapPublicImage(match);
|
|
9471
9683
|
}
|
|
@@ -9485,32 +9697,32 @@ function useXlsxViewerController(options) {
|
|
|
9485
9697
|
setSelectedImageId(null);
|
|
9486
9698
|
}, []);
|
|
9487
9699
|
const getColumnWidthPx = React.useCallback((worksheet, col) => {
|
|
9488
|
-
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access',
|
|
9700
|
+
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _759 => _759.current, 'optionalAccess', _760 => _760.sheetStatesByWorkbookSheetIndex, 'access', _761 => _761[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _762 => _762.workbookSheetIndex]), () => ( -1))]]), () => ( null));
|
|
9489
9701
|
const width = worksheet.getColumnWidth(col);
|
|
9490
|
-
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
9702
|
+
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _763 => _763.showGridLines]), () => ( true));
|
|
9491
9703
|
if (width !== void 0 && width !== null) {
|
|
9492
9704
|
return resolveRenderedSheetAxisPixels(
|
|
9493
|
-
resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess',
|
|
9705
|
+
resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _764 => _764.columnWidthCharacterWidthPx])),
|
|
9494
9706
|
showGridLines
|
|
9495
9707
|
);
|
|
9496
9708
|
}
|
|
9497
9709
|
return resolveRenderedSheetAxisPixels(
|
|
9498
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
9710
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _765 => _765.colWidthOverridesPx, 'optionalAccess', _766 => _766[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _767 => _767.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH)),
|
|
9499
9711
|
showGridLines
|
|
9500
9712
|
);
|
|
9501
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
9713
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _768 => _768.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _769 => _769.workbookSheetIndex])]);
|
|
9502
9714
|
const getRowHeightPx = React.useCallback((worksheet, row) => {
|
|
9503
|
-
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access',
|
|
9715
|
+
const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _770 => _770.current, 'optionalAccess', _771 => _771.sheetStatesByWorkbookSheetIndex, 'access', _772 => _772[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _773 => _773.workbookSheetIndex]), () => ( -1))]]), () => ( null));
|
|
9504
9716
|
const height = worksheet.getRowHeight(row);
|
|
9505
|
-
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
9717
|
+
const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _774 => _774.showGridLines]), () => ( true));
|
|
9506
9718
|
if (height !== void 0 && height !== null) {
|
|
9507
9719
|
return resolveRenderedSheetAxisPixels(resolveSheetRowHeightPixels(height), showGridLines);
|
|
9508
9720
|
}
|
|
9509
9721
|
return resolveRenderedSheetAxisPixels(
|
|
9510
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess',
|
|
9722
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _775 => _775.rowHeightOverridesPx, 'optionalAccess', _776 => _776[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _777 => _777.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT)),
|
|
9511
9723
|
showGridLines
|
|
9512
9724
|
);
|
|
9513
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
9725
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _778 => _778.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _779 => _779.workbookSheetIndex])]);
|
|
9514
9726
|
const getCellDisplayValue2 = React.useCallback((cell) => {
|
|
9515
9727
|
if (cell && activeSheet) {
|
|
9516
9728
|
const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${locale}:${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
|
|
@@ -9523,7 +9735,7 @@ function useXlsxViewerController(options) {
|
|
|
9523
9735
|
return "";
|
|
9524
9736
|
}
|
|
9525
9737
|
const formula = worksheet.getFormulaAt(cell.row, cell.col);
|
|
9526
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
9738
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _780 => _780.cachedFormulaValues, 'optionalAccess', _781 => _781[cellAddressToA1(cell)]]) : void 0;
|
|
9527
9739
|
const formatted = worksheet.getFormattedValueAt(cell.row, cell.col);
|
|
9528
9740
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
9529
9741
|
return localizeCellNumber(worksheet, cell.row, cell.col, decodeHtmlEntities(formatted), locale);
|
|
@@ -9585,9 +9797,9 @@ function useXlsxViewerController(options) {
|
|
|
9585
9797
|
"white-space:pre-wrap",
|
|
9586
9798
|
"vertical-align:top"
|
|
9587
9799
|
];
|
|
9588
|
-
const fill = _optionalChain([rawStyle, 'optionalAccess',
|
|
9800
|
+
const fill = _optionalChain([rawStyle, 'optionalAccess', _782 => _782.fill]);
|
|
9589
9801
|
if (fill) {
|
|
9590
|
-
const fillStyle = resolveWorkbookFillStyle(fill, _optionalChain([activeSheet, 'optionalAccess',
|
|
9802
|
+
const fillStyle = resolveWorkbookFillStyle(fill, _optionalChain([activeSheet, 'optionalAccess', _783 => _783.themePalette]));
|
|
9591
9803
|
if (fillStyle.backgroundColor && fillStyle.backgroundColor.toLowerCase() !== "#ffffff") {
|
|
9592
9804
|
cellStyles.push(`background-color:${fillStyle.backgroundColor}`);
|
|
9593
9805
|
}
|
|
@@ -9595,7 +9807,7 @@ function useXlsxViewerController(options) {
|
|
|
9595
9807
|
cellStyles.push(`background-image:${fillStyle.backgroundImage}`);
|
|
9596
9808
|
}
|
|
9597
9809
|
}
|
|
9598
|
-
const font = _optionalChain([rawStyle, 'optionalAccess',
|
|
9810
|
+
const font = _optionalChain([rawStyle, 'optionalAccess', _784 => _784.font]);
|
|
9599
9811
|
if (font) {
|
|
9600
9812
|
if (font.bold) {
|
|
9601
9813
|
cellStyles.push("font-weight:700");
|
|
@@ -9609,7 +9821,7 @@ function useXlsxViewerController(options) {
|
|
|
9609
9821
|
if (font.strikethrough) {
|
|
9610
9822
|
cellStyles.push("text-decoration:line-through");
|
|
9611
9823
|
}
|
|
9612
|
-
const fontColor = resolveWorkbookColor(font.color, _optionalChain([activeSheet, 'optionalAccess',
|
|
9824
|
+
const fontColor = resolveWorkbookColor(font.color, _optionalChain([activeSheet, 'optionalAccess', _785 => _785.themePalette]));
|
|
9613
9825
|
if (fontColor) {
|
|
9614
9826
|
cellStyles.push(`color:${fontColor}`);
|
|
9615
9827
|
}
|
|
@@ -9617,29 +9829,29 @@ function useXlsxViewerController(options) {
|
|
|
9617
9829
|
cellStyles.push(`font-size:${font.size}pt`);
|
|
9618
9830
|
}
|
|
9619
9831
|
}
|
|
9620
|
-
const alignment = _optionalChain([rawStyle, 'optionalAccess',
|
|
9621
|
-
if (_optionalChain([alignment, 'optionalAccess',
|
|
9832
|
+
const alignment = _optionalChain([rawStyle, 'optionalAccess', _786 => _786.alignment]);
|
|
9833
|
+
if (_optionalChain([alignment, 'optionalAccess', _787 => _787.horizontal]) && alignment.horizontal !== "general") {
|
|
9622
9834
|
cellStyles.push(`text-align:${String(alignment.horizontal)}`);
|
|
9623
9835
|
}
|
|
9624
|
-
if (_optionalChain([alignment, 'optionalAccess',
|
|
9836
|
+
if (_optionalChain([alignment, 'optionalAccess', _788 => _788.wrapText])) {
|
|
9625
9837
|
cellStyles.push("white-space:pre-wrap");
|
|
9626
9838
|
cellStyles.push("word-break:break-word");
|
|
9627
9839
|
}
|
|
9628
|
-
const border = _optionalChain([rawStyle, 'optionalAccess',
|
|
9629
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9840
|
+
const border = _optionalChain([rawStyle, 'optionalAccess', _789 => _789.border]);
|
|
9841
|
+
if (_optionalChain([border, 'optionalAccess', _790 => _790.top, 'optionalAccess', _791 => _791.style]) && border.top.style !== "none") {
|
|
9630
9842
|
cellStyles.push(`border-top:${mapBorder(border.top)}`);
|
|
9631
9843
|
}
|
|
9632
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9844
|
+
if (_optionalChain([border, 'optionalAccess', _792 => _792.right, 'optionalAccess', _793 => _793.style]) && border.right.style !== "none") {
|
|
9633
9845
|
cellStyles.push(`border-right:${mapBorder(border.right)}`);
|
|
9634
9846
|
}
|
|
9635
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9847
|
+
if (_optionalChain([border, 'optionalAccess', _794 => _794.bottom, 'optionalAccess', _795 => _795.style]) && border.bottom.style !== "none") {
|
|
9636
9848
|
cellStyles.push(`border-bottom:${mapBorder(border.bottom)}`);
|
|
9637
9849
|
}
|
|
9638
|
-
if (_optionalChain([border, 'optionalAccess',
|
|
9850
|
+
if (_optionalChain([border, 'optionalAccess', _796 => _796.left, 'optionalAccess', _797 => _797.style]) && border.left.style !== "none") {
|
|
9639
9851
|
cellStyles.push(`border-left:${mapBorder(border.left)}`);
|
|
9640
9852
|
}
|
|
9641
|
-
const rowSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess',
|
|
9642
|
-
const colSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess',
|
|
9853
|
+
const rowSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _798 => _798.rowSpan]), () => ( 1)), normalized.end.row - row + 1);
|
|
9854
|
+
const colSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _799 => _799.colSpan]), () => ( 1)), normalized.end.col - col + 1);
|
|
9643
9855
|
payload.cells.push({
|
|
9644
9856
|
colOffset: col - normalized.start.col,
|
|
9645
9857
|
formula,
|
|
@@ -9855,10 +10067,10 @@ function useXlsxViewerController(options) {
|
|
|
9855
10067
|
target.worksheet.addDrawing(xlsxFormControlInputToDukeDrawing(input));
|
|
9856
10068
|
const controlIndex = target.worksheet.formControlCount - 1;
|
|
9857
10069
|
const addedControl = target.worksheet.formControls[controlIndex];
|
|
9858
|
-
const addedKind = _optionalChain([addedControl, 'optionalAccess',
|
|
9859
|
-
if (addedControl && (_optionalChain([addedKind, 'optionalAccess',
|
|
10070
|
+
const addedKind = _optionalChain([addedControl, 'optionalAccess', _800 => _800.formControl, 'access', _801 => _801.kind]);
|
|
10071
|
+
if (addedControl && (_optionalChain([addedKind, 'optionalAccess', _802 => _802.kind]) === "checkbox" || _optionalChain([addedKind, 'optionalAccess', _803 => _803.kind]) === "optionButton")) {
|
|
9860
10072
|
target.worksheet.setFormControlCheckState(addedControl.drawingPath, addedKind.state);
|
|
9861
|
-
} else if (_optionalChain([addedKind, 'optionalAccess',
|
|
10073
|
+
} else if (_optionalChain([addedKind, 'optionalAccess', _804 => _804.kind]) === "groupBox") {
|
|
9862
10074
|
reconcileCheckedOptionButtons(target.worksheet);
|
|
9863
10075
|
} else if (addedKind && "cellLink" in addedKind && addedKind.cellLink) {
|
|
9864
10076
|
workbook.syncFormControls();
|
|
@@ -9869,7 +10081,7 @@ function useXlsxViewerController(options) {
|
|
|
9869
10081
|
}, [activeSheetIndex, getFormControlWorksheet, maybeRecalculateWorkbook, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
|
|
9870
10082
|
const updateFormControl = React.useCallback((controlIndex, patch, sheetIndex = activeSheetIndex) => {
|
|
9871
10083
|
const target = getFormControlWorksheet(sheetIndex);
|
|
9872
|
-
const currentControl = _optionalChain([target, 'optionalAccess',
|
|
10084
|
+
const currentControl = _optionalChain([target, 'optionalAccess', _805 => _805.worksheet, 'access', _806 => _806.formControls, 'access', _807 => _807[controlIndex]]);
|
|
9873
10085
|
if (readOnly || !workbook || !target || !currentControl) {
|
|
9874
10086
|
return false;
|
|
9875
10087
|
}
|
|
@@ -9889,8 +10101,8 @@ function useXlsxViewerController(options) {
|
|
|
9889
10101
|
legacyObjectType: _nullishCoalesce(nextKind.legacyObjectType, () => ( currentControl.formControl.kind.legacyObjectType))
|
|
9890
10102
|
};
|
|
9891
10103
|
}
|
|
9892
|
-
const patchedRawObj = _optionalChain([patch, 'access',
|
|
9893
|
-
const patchedRawProperties = _optionalChain([patch, 'access',
|
|
10104
|
+
const patchedRawObj = _optionalChain([patch, 'access', _808 => _808.kind, 'optionalAccess', _809 => _809.kind]) === "editbox" || _optionalChain([patch, 'access', _810 => _810.kind, 'optionalAccess', _811 => _811.kind]) === "unknown" ? patch.kind.rawObj : void 0;
|
|
10105
|
+
const patchedRawProperties = _optionalChain([patch, 'access', _812 => _812.kind, 'optionalAccess', _813 => _813.kind]) === "editbox" || _optionalChain([patch, 'access', _814 => _814.kind, 'optionalAccess', _815 => _815.kind]) === "unknown" ? patch.kind.rawProperties : void 0;
|
|
9894
10106
|
const nextInput = {
|
|
9895
10107
|
altText: "altText" in patch ? patch.altText : currentControl.altText,
|
|
9896
10108
|
anchor: nextAnchor,
|
|
@@ -9911,10 +10123,10 @@ function useXlsxViewerController(options) {
|
|
|
9911
10123
|
};
|
|
9912
10124
|
target.worksheet.setDrawing(currentControl.drawingPath, nextInput);
|
|
9913
10125
|
const updatedControl = target.worksheet.formControls[controlIndex];
|
|
9914
|
-
const updatedKind = _optionalChain([updatedControl, 'optionalAccess',
|
|
10126
|
+
const updatedKind = _optionalChain([updatedControl, 'optionalAccess', _816 => _816.formControl, 'access', _817 => _817.kind]);
|
|
9915
10127
|
const interactionChanged = updatedKind ? formControlInteractionChanged(currentControl.formControl.kind, updatedKind) : false;
|
|
9916
10128
|
const groupTopologyChanged = patch.anchor !== void 0 || updatedKind !== void 0 && updatedKind.kind !== currentControl.formControl.kind.kind && (updatedKind.kind === "groupBox" || currentControl.formControl.kind.kind === "groupBox");
|
|
9917
|
-
if (interactionChanged && updatedControl && (_optionalChain([updatedKind, 'optionalAccess',
|
|
10129
|
+
if (interactionChanged && updatedControl && (_optionalChain([updatedKind, 'optionalAccess', _818 => _818.kind]) === "checkbox" || _optionalChain([updatedKind, 'optionalAccess', _819 => _819.kind]) === "optionButton")) {
|
|
9918
10130
|
target.worksheet.setFormControlCheckState(updatedControl.drawingPath, updatedKind.state);
|
|
9919
10131
|
} else if (groupTopologyChanged) {
|
|
9920
10132
|
reconcileCheckedOptionButtons(target.worksheet);
|
|
@@ -10026,7 +10238,7 @@ function useXlsxViewerController(options) {
|
|
|
10026
10238
|
const comparedText = left.sortText.localeCompare(right.sortText, void 0, { numeric: true, sensitivity: "base" });
|
|
10027
10239
|
return direction === "ascending" ? comparedText : -comparedText;
|
|
10028
10240
|
});
|
|
10029
|
-
if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access',
|
|
10241
|
+
if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access', _820 => _820[index], 'optionalAccess', _821 => _821.index]))) {
|
|
10030
10242
|
setSortState({ columnIndex, direction, tableName: targetTable.name });
|
|
10031
10243
|
return;
|
|
10032
10244
|
}
|
|
@@ -10095,9 +10307,9 @@ function useXlsxViewerController(options) {
|
|
|
10095
10307
|
if (!workbook) {
|
|
10096
10308
|
return;
|
|
10097
10309
|
}
|
|
10098
|
-
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
10310
|
+
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _822 => _822.name]), () => ( "sheet"));
|
|
10099
10311
|
downloadText(workbook.saveCsvString(), `${fileStem(displayFileName)}-${activeSheetName}.csv`, CSV_MIME_TYPE);
|
|
10100
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
10312
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _823 => _823.name]), displayFileName, workbook]);
|
|
10101
10313
|
const recalculate = React.useCallback(() => {
|
|
10102
10314
|
if (!workbook) {
|
|
10103
10315
|
return;
|
|
@@ -10261,10 +10473,10 @@ function useXlsxViewerController(options) {
|
|
|
10261
10473
|
const currentChart = getChartById(id);
|
|
10262
10474
|
console.info("[react-xlsx debug] currentChart", {
|
|
10263
10475
|
activeWorkbookSheetIndex: activeSheet.workbookSheetIndex,
|
|
10264
|
-
editable: _optionalChain([currentChart, 'optionalAccess',
|
|
10476
|
+
editable: _optionalChain([currentChart, 'optionalAccess', _824 => _824.editable]),
|
|
10265
10477
|
found: Boolean(currentChart),
|
|
10266
10478
|
originCount: hydratedChartAssets.chartOriginsById.size,
|
|
10267
|
-
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess',
|
|
10479
|
+
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess', _825 => _825.workbookSheetIndex])
|
|
10268
10480
|
});
|
|
10269
10481
|
if (!currentChart || currentChart.editable === false || currentChart.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
|
|
10270
10482
|
return;
|
|
@@ -10272,8 +10484,8 @@ function useXlsxViewerController(options) {
|
|
|
10272
10484
|
const nextAnchor = rectToImageAnchor(rect, currentChart.anchor, {
|
|
10273
10485
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
10274
10486
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
10275
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10276
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10487
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _826 => _826.columnWidths, 'access', _827 => _827[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
10488
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _828 => _828.rowHeights, 'access', _829 => _829[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
10277
10489
|
});
|
|
10278
10490
|
recordHistoryBeforeMutation();
|
|
10279
10491
|
const didUpdateAnchor = updateWorkbookChartAnchor(imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
|
|
@@ -10304,8 +10516,8 @@ function useXlsxViewerController(options) {
|
|
|
10304
10516
|
const nextAnchor = rectToImageAnchor(rect, currentImage.anchor, {
|
|
10305
10517
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
10306
10518
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
10307
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10308
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
10519
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _830 => _830.columnWidths, 'access', _831 => _831[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
10520
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _832 => _832.rowHeights, 'access', _833 => _833[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
10309
10521
|
});
|
|
10310
10522
|
recordHistoryBeforeMutation();
|
|
10311
10523
|
if (!updateWorkbookImageAnchor(imageAssetsRef.current, id, nextAnchor)) {
|
|
@@ -10464,7 +10676,13 @@ function useXlsxViewerController(options) {
|
|
|
10464
10676
|
if (!nextChart) {
|
|
10465
10677
|
return false;
|
|
10466
10678
|
}
|
|
10467
|
-
|
|
10679
|
+
const source = chart.renderSource;
|
|
10680
|
+
const indexedCategoryFormulaChanged = _optionalChain([source, 'optionalAccess', _834 => _834.indexedXSeries, 'optionalAccess', _835 => _835[seriesIndex]]) && _optionalChain([chart, 'access', _836 => _836.series, 'access', _837 => _837[seriesIndex], 'optionalAccess', _838 => _838.categoriesRef, 'optionalAccess', _839 => _839.formula]) !== _optionalChain([nextChart, 'access', _840 => _840.series, 'access', _841 => _841[seriesIndex], 'optionalAccess', _842 => _842.categoriesRef, 'optionalAccess', _843 => _843.formula]);
|
|
10681
|
+
updateChart(chartId, {
|
|
10682
|
+
series: nextChart.series,
|
|
10683
|
+
typeGroups: nextChart.typeGroups,
|
|
10684
|
+
renderSource: _optionalChain([source, 'optionalAccess', _844 => _844.sourceSeries]) || indexedCategoryFormulaChanged ? void 0 : source
|
|
10685
|
+
});
|
|
10468
10686
|
const selectedSeries = nextChart.series[seriesIndex];
|
|
10469
10687
|
if (selectedSeries) {
|
|
10470
10688
|
setSelectedChartElement((current) => current && current.chartId === chartId && current.kind !== "chart" ? {
|
|
@@ -10480,7 +10698,7 @@ function useXlsxViewerController(options) {
|
|
|
10480
10698
|
setSelectedChartElement(null);
|
|
10481
10699
|
setSelectedImageId(null);
|
|
10482
10700
|
setActiveCell(cell);
|
|
10483
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
10701
|
+
if (_optionalChain([options2, 'optionalAccess', _845 => _845.extend]) && selectionAnchorRef.current) {
|
|
10484
10702
|
setSelection(normalizeRange({ start: selectionAnchorRef.current, end: cell }));
|
|
10485
10703
|
return;
|
|
10486
10704
|
}
|
|
@@ -10621,7 +10839,7 @@ function useXlsxViewerController(options) {
|
|
|
10621
10839
|
setCellFormula(activeCell, formula);
|
|
10622
10840
|
}, [activeCell, setCellFormula]);
|
|
10623
10841
|
const setSelectedFormula = React.useCallback((formula) => {
|
|
10624
|
-
if (_optionalChain([selectedFormulaTarget, 'optionalAccess',
|
|
10842
|
+
if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _846 => _846.kind]) === "chartSeries") {
|
|
10625
10843
|
return setChartSeriesFormula(selectedFormulaTarget.chartId, selectedFormulaTarget.seriesIndex, formula);
|
|
10626
10844
|
}
|
|
10627
10845
|
if (!activeCell) {
|
|
@@ -10783,7 +11001,7 @@ function useXlsxViewerController(options) {
|
|
|
10783
11001
|
return;
|
|
10784
11002
|
}
|
|
10785
11003
|
recordHistoryBeforeMutation();
|
|
10786
|
-
const baseName = _optionalChain([name, 'optionalAccess',
|
|
11004
|
+
const baseName = _optionalChain([name, 'optionalAccess', _847 => _847.trim, 'call', _848 => _848()]) || "Sheet";
|
|
10787
11005
|
let candidate = baseName;
|
|
10788
11006
|
let counter = 2;
|
|
10789
11007
|
while (workbook.sheetIndex(candidate) !== void 0) {
|
|
@@ -10803,11 +11021,11 @@ function useXlsxViewerController(options) {
|
|
|
10803
11021
|
}
|
|
10804
11022
|
const nextSheets = buildSheetList(
|
|
10805
11023
|
workbook,
|
|
10806
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10807
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10808
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10809
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10810
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11024
|
+
_optionalChain([imageAssetsRef, 'access', _849 => _849.current, 'optionalAccess', _850 => _850.sheetStatesByWorkbookSheetIndex]),
|
|
11025
|
+
_optionalChain([imageAssetsRef, 'access', _851 => _851.current, 'optionalAccess', _852 => _852.themePalette]),
|
|
11026
|
+
_optionalChain([imageAssetsRef, 'access', _853 => _853.current, 'optionalAccess', _854 => _854.styleById]),
|
|
11027
|
+
_optionalChain([imageAssetsRef, 'access', _855 => _855.current, 'optionalAccess', _856 => _856.namedCellStyleByName]),
|
|
11028
|
+
_optionalChain([imageAssetsRef, 'access', _857 => _857.current, 'optionalAccess', _858 => _858.tableStyleByName]),
|
|
10811
11029
|
showHiddenSheets
|
|
10812
11030
|
);
|
|
10813
11031
|
setSheets(nextSheets);
|
|
@@ -10817,7 +11035,7 @@ function useXlsxViewerController(options) {
|
|
|
10817
11035
|
}
|
|
10818
11036
|
const nextIndex = nextSheets.findIndex((sheet) => sheet.name === candidate);
|
|
10819
11037
|
setActiveSheetIndexState(nextIndex >= 0 ? nextIndex : 0);
|
|
10820
|
-
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess',
|
|
11038
|
+
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _859 => _859.tabs, 'access', _860 => _860.findIndex, 'call', _861 => _861((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
|
|
10821
11039
|
if (nextTabIndex >= 0) {
|
|
10822
11040
|
setActiveTabIndexState(nextTabIndex);
|
|
10823
11041
|
}
|
|
@@ -10843,11 +11061,11 @@ function useXlsxViewerController(options) {
|
|
|
10843
11061
|
}
|
|
10844
11062
|
const nextSheets = buildSheetList(
|
|
10845
11063
|
workbook,
|
|
10846
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10847
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10848
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10849
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
10850
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11064
|
+
_optionalChain([imageAssetsRef, 'access', _862 => _862.current, 'optionalAccess', _863 => _863.sheetStatesByWorkbookSheetIndex]),
|
|
11065
|
+
_optionalChain([imageAssetsRef, 'access', _864 => _864.current, 'optionalAccess', _865 => _865.themePalette]),
|
|
11066
|
+
_optionalChain([imageAssetsRef, 'access', _866 => _866.current, 'optionalAccess', _867 => _867.styleById]),
|
|
11067
|
+
_optionalChain([imageAssetsRef, 'access', _868 => _868.current, 'optionalAccess', _869 => _869.namedCellStyleByName]),
|
|
11068
|
+
_optionalChain([imageAssetsRef, 'access', _870 => _870.current, 'optionalAccess', _871 => _871.tableStyleByName]),
|
|
10851
11069
|
showHiddenSheets
|
|
10852
11070
|
);
|
|
10853
11071
|
setSheets(nextSheets);
|
|
@@ -10875,7 +11093,7 @@ function useXlsxViewerController(options) {
|
|
|
10875
11093
|
}, [readOnly, recordHistoryBeforeMutation, selection, workbook]);
|
|
10876
11094
|
const pasteText = React.useCallback((text) => {
|
|
10877
11095
|
const worksheet = getActiveWorksheet();
|
|
10878
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
11096
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _872 => _872.start]))), () => ( null));
|
|
10879
11097
|
if (readOnly || !worksheet || !workbook || !targetCell || !text) {
|
|
10880
11098
|
return false;
|
|
10881
11099
|
}
|
|
@@ -10939,7 +11157,7 @@ function useXlsxViewerController(options) {
|
|
|
10939
11157
|
}, [activeCell, captureCellMutationState, getActiveWorksheet, locale, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
|
|
10940
11158
|
const pasteStructuredClipboardData = React.useCallback((serializedPayload) => {
|
|
10941
11159
|
const worksheet = getActiveWorksheet();
|
|
10942
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
11160
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _873 => _873.start]))), () => ( null));
|
|
10943
11161
|
if (readOnly || !worksheet || !workbook || !targetCell || !serializedPayload) {
|
|
10944
11162
|
return false;
|
|
10945
11163
|
}
|
|
@@ -12014,7 +12232,7 @@ function parseCanvasGradientStops(value) {
|
|
|
12014
12232
|
if (!match) {
|
|
12015
12233
|
return null;
|
|
12016
12234
|
}
|
|
12017
|
-
const color = _optionalChain([match, 'access',
|
|
12235
|
+
const color = _optionalChain([match, 'access', _874 => _874[1], 'optionalAccess', _875 => _875.trim, 'call', _876 => _876()]);
|
|
12018
12236
|
const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
|
|
12019
12237
|
if (!color) {
|
|
12020
12238
|
return null;
|
|
@@ -12030,7 +12248,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
12030
12248
|
if (linearMatch) {
|
|
12031
12249
|
const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
|
|
12032
12250
|
if (parts.length >= 2) {
|
|
12033
|
-
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access',
|
|
12251
|
+
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _877 => _877[0], 'optionalAccess', _878 => _878.trim, 'call', _879 => _879()]), () => ( "180deg"));
|
|
12034
12252
|
const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
|
|
12035
12253
|
const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
|
|
12036
12254
|
const radians = (90 - cssAngle) * Math.PI / 180;
|
|
@@ -12060,7 +12278,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
12060
12278
|
const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
|
|
12061
12279
|
if (radialMatch) {
|
|
12062
12280
|
const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
|
|
12063
|
-
const stopParts = _optionalChain([parts, 'access',
|
|
12281
|
+
const stopParts = _optionalChain([parts, 'access', _880 => _880[0], 'optionalAccess', _881 => _881.startsWith, 'call', _882 => _882("circle")]) ? parts.slice(1) : parts;
|
|
12064
12282
|
const gradient = context.createRadialGradient(
|
|
12065
12283
|
rect.left + rect.width / 2,
|
|
12066
12284
|
rect.top + rect.height / 2,
|
|
@@ -12173,7 +12391,7 @@ function resolveDarkModeSurface(themePalette, palette) {
|
|
|
12173
12391
|
return "hsl(225 4% 6%)";
|
|
12174
12392
|
}
|
|
12175
12393
|
function resolveSheetSurface(sheet, palette) {
|
|
12176
|
-
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess',
|
|
12394
|
+
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _883 => _883.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _884 => _884.themePalette, 'access', _885 => _885.colorsByIndex, 'access', _886 => _886[0]]), () => ( SHEET_SURFACE));
|
|
12177
12395
|
}
|
|
12178
12396
|
function normalizeRange2(range) {
|
|
12179
12397
|
return {
|
|
@@ -12205,7 +12423,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
|
|
|
12205
12423
|
const visible2 = [];
|
|
12206
12424
|
const usedLimit = Math.min(displayLimit, Math.max(0, maxUsedIndex + 1));
|
|
12207
12425
|
for (let index = 0; index < usedLimit; index += 1) {
|
|
12208
|
-
if (!_optionalChain([hiddenIndices, 'optionalAccess',
|
|
12426
|
+
if (!_optionalChain([hiddenIndices, 'optionalAccess', _887 => _887.has, 'call', _888 => _888(index)])) {
|
|
12209
12427
|
visible2.push(index);
|
|
12210
12428
|
}
|
|
12211
12429
|
}
|
|
@@ -12247,7 +12465,7 @@ function clampPercent(value, fallback) {
|
|
|
12247
12465
|
return Math.max(0, Math.min(100, value));
|
|
12248
12466
|
}
|
|
12249
12467
|
function resolveShapeAdjustment(shape, name, fallback) {
|
|
12250
|
-
const rawValue = _optionalChain([shape, 'access',
|
|
12468
|
+
const rawValue = _optionalChain([shape, 'access', _889 => _889.geometryAdjustments, 'optionalAccess', _890 => _890[name]]);
|
|
12251
12469
|
if (typeof rawValue !== "number") {
|
|
12252
12470
|
return fallback;
|
|
12253
12471
|
}
|
|
@@ -13147,8 +13365,8 @@ function normalizeThumbnailResolution(resolution) {
|
|
|
13147
13365
|
}
|
|
13148
13366
|
const resolvedObject = typeof resolution === "object" && resolution ? resolution : void 0;
|
|
13149
13367
|
return {
|
|
13150
|
-
maxHeight: _optionalChain([resolvedObject, 'optionalAccess',
|
|
13151
|
-
maxWidth: _optionalChain([resolvedObject, 'optionalAccess',
|
|
13368
|
+
maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _891 => _891.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
|
|
13369
|
+
maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _892 => _892.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
|
|
13152
13370
|
};
|
|
13153
13371
|
}
|
|
13154
13372
|
function resolveThumbnailOutputSize(sourceWidth, sourceHeight, resolution) {
|
|
@@ -13467,24 +13685,24 @@ function escapeCssFontFamily(name) {
|
|
|
13467
13685
|
return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
|
|
13468
13686
|
}
|
|
13469
13687
|
function resolveSpreadsheetThemeFont(font, themePalette) {
|
|
13470
|
-
const scheme = typeof _optionalChain([font, 'optionalAccess',
|
|
13688
|
+
const scheme = typeof _optionalChain([font, 'optionalAccess', _893 => _893.scheme]) === "string" ? font.scheme : null;
|
|
13471
13689
|
if (scheme === "major") {
|
|
13472
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
13690
|
+
return _optionalChain([themePalette, 'optionalAccess', _894 => _894.majorLatinFont]);
|
|
13473
13691
|
}
|
|
13474
13692
|
if (scheme === "minor") {
|
|
13475
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
13693
|
+
return _optionalChain([themePalette, 'optionalAccess', _895 => _895.minorLatinFont]);
|
|
13476
13694
|
}
|
|
13477
13695
|
return void 0;
|
|
13478
13696
|
}
|
|
13479
13697
|
function buildSpreadsheetFontFamily(font, themePalette) {
|
|
13480
13698
|
const candidates = [
|
|
13481
|
-
typeof _optionalChain([font, 'optionalAccess',
|
|
13482
|
-
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call',
|
|
13699
|
+
typeof _optionalChain([font, 'optionalAccess', _896 => _896.name]) === "string" ? font.name.trim() : "",
|
|
13700
|
+
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _897 => _897(font, themePalette), 'optionalAccess', _898 => _898.trim, 'call', _899 => _899()]), () => ( ""))
|
|
13483
13701
|
].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
|
|
13484
13702
|
if (candidates.length === 0) {
|
|
13485
13703
|
return void 0;
|
|
13486
13704
|
}
|
|
13487
|
-
const primaryFont = _optionalChain([candidates, 'access',
|
|
13705
|
+
const primaryFont = _optionalChain([candidates, 'access', _900 => _900[0], 'optionalAccess', _901 => _901.toLowerCase, 'call', _902 => _902()]);
|
|
13488
13706
|
if (primaryFont === "calibri") {
|
|
13489
13707
|
return [
|
|
13490
13708
|
"Calibri",
|
|
@@ -13517,17 +13735,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
|
|
|
13517
13735
|
}
|
|
13518
13736
|
function buildGridlineShadow(color, options) {
|
|
13519
13737
|
const parts = [];
|
|
13520
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
13738
|
+
if (_optionalChain([options, 'optionalAccess', _903 => _903.right]) !== false) {
|
|
13521
13739
|
parts.push(`inset -1px 0 0 ${color}`);
|
|
13522
13740
|
}
|
|
13523
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
13741
|
+
if (_optionalChain([options, 'optionalAccess', _904 => _904.bottom]) !== false) {
|
|
13524
13742
|
parts.push(`inset 0 -1px 0 ${color}`);
|
|
13525
13743
|
}
|
|
13526
13744
|
return parts.join(", ");
|
|
13527
13745
|
}
|
|
13528
13746
|
function buildCellStyle(style, palette, themePalette, options) {
|
|
13529
|
-
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
13530
|
-
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
13747
|
+
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _905 => _905.showGridLines]), () => ( true));
|
|
13748
|
+
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _906 => _906.colorsByIndex, 'access', _907 => _907[0]]), () => ( SHEET_SURFACE));
|
|
13531
13749
|
const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
|
|
13532
13750
|
const css = {
|
|
13533
13751
|
backgroundColor: baseSurface,
|
|
@@ -13540,7 +13758,7 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
13540
13758
|
lineHeight: String(resolveSpreadsheetLineHeight(11)),
|
|
13541
13759
|
overflow: "hidden",
|
|
13542
13760
|
padding: DEFAULT_CELL_PADDING,
|
|
13543
|
-
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
13761
|
+
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _908 => _908.generalAlignment]), () => ( "left")),
|
|
13544
13762
|
textOverflow: "clip",
|
|
13545
13763
|
verticalAlign: "bottom",
|
|
13546
13764
|
whiteSpace: "nowrap"
|
|
@@ -13624,24 +13842,24 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
13624
13842
|
}
|
|
13625
13843
|
const border = style.border;
|
|
13626
13844
|
if (border) {
|
|
13627
|
-
const hasRightBorder = Boolean(_optionalChain([border, 'access',
|
|
13628
|
-
const hasBottomBorder = Boolean(_optionalChain([border, 'access',
|
|
13845
|
+
const hasRightBorder = Boolean(_optionalChain([border, 'access', _909 => _909.right, 'optionalAccess', _910 => _910.style]) && border.right.style !== "none");
|
|
13846
|
+
const hasBottomBorder = Boolean(_optionalChain([border, 'access', _911 => _911.bottom, 'optionalAccess', _912 => _912.style]) && border.bottom.style !== "none");
|
|
13629
13847
|
if (showGridLines && (hasRightBorder || hasBottomBorder)) {
|
|
13630
13848
|
css.boxShadow = buildGridlineShadow(palette.border, {
|
|
13631
13849
|
bottom: !hasBottomBorder,
|
|
13632
13850
|
right: !hasRightBorder
|
|
13633
13851
|
}) || void 0;
|
|
13634
13852
|
}
|
|
13635
|
-
if (_optionalChain([border, 'access',
|
|
13853
|
+
if (_optionalChain([border, 'access', _913 => _913.top, 'optionalAccess', _914 => _914.style]) && border.top.style !== "none") {
|
|
13636
13854
|
css.borderTop = mapBorder2(border.top, themePalette);
|
|
13637
13855
|
}
|
|
13638
|
-
if (_optionalChain([border, 'access',
|
|
13856
|
+
if (_optionalChain([border, 'access', _915 => _915.right, 'optionalAccess', _916 => _916.style]) && border.right.style !== "none") {
|
|
13639
13857
|
css.borderRight = mapBorder2(border.right, themePalette);
|
|
13640
13858
|
}
|
|
13641
|
-
if (_optionalChain([border, 'access',
|
|
13859
|
+
if (_optionalChain([border, 'access', _917 => _917.bottom, 'optionalAccess', _918 => _918.style]) && border.bottom.style !== "none") {
|
|
13642
13860
|
css.borderBottom = mapBorder2(border.bottom, themePalette);
|
|
13643
13861
|
}
|
|
13644
|
-
if (_optionalChain([border, 'access',
|
|
13862
|
+
if (_optionalChain([border, 'access', _919 => _919.left, 'optionalAccess', _920 => _920.style]) && border.left.style !== "none") {
|
|
13645
13863
|
css.borderLeft = mapBorder2(border.left, themePalette);
|
|
13646
13864
|
}
|
|
13647
13865
|
}
|
|
@@ -13668,7 +13886,7 @@ function measureTextWidth(value, style) {
|
|
|
13668
13886
|
}
|
|
13669
13887
|
function getCellDisplayValue(worksheet, row, col, activeSheet, locale = "en-US") {
|
|
13670
13888
|
const formula = worksheet.getFormulaAt(row, col);
|
|
13671
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
13889
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _921 => _921.cachedFormulaValues, 'optionalAccess', _922 => _922[cellAddressToA12({ row, col })]]) : void 0;
|
|
13672
13890
|
const formatted = worksheet.getFormattedValueAt(row, col);
|
|
13673
13891
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
13674
13892
|
return localizeCellNumber(worksheet, row, col, decodeHtmlEntities2(formatted), locale);
|
|
@@ -13915,7 +14133,7 @@ function normalizeBatchedMergeSpan(value) {
|
|
|
13915
14133
|
}
|
|
13916
14134
|
function normalizeBatchedCellValue(rawValue, formula, row, col, activeSheet) {
|
|
13917
14135
|
const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
|
|
13918
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
14136
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _923 => _923.cachedFormulaValues, 'optionalAccess', _924 => _924[cellAddressToA12({ row, col })]]) : void 0;
|
|
13919
14137
|
if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
|
|
13920
14138
|
return cachedFormulaValue;
|
|
13921
14139
|
}
|
|
@@ -13962,31 +14180,31 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
13962
14180
|
..._nullishCoalesce(base, () => ( {})),
|
|
13963
14181
|
..._nullishCoalesce(overlay, () => ( {}))
|
|
13964
14182
|
};
|
|
13965
|
-
const baseAlignment = _optionalChain([base, 'optionalAccess',
|
|
13966
|
-
const overlayAlignment = _optionalChain([overlay, 'optionalAccess',
|
|
14183
|
+
const baseAlignment = _optionalChain([base, 'optionalAccess', _925 => _925.alignment]);
|
|
14184
|
+
const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _926 => _926.alignment]);
|
|
13967
14185
|
if (baseAlignment || overlayAlignment) {
|
|
13968
14186
|
nextStyle.alignment = {
|
|
13969
14187
|
..._nullishCoalesce(baseAlignment, () => ( {})),
|
|
13970
14188
|
..._nullishCoalesce(overlayAlignment, () => ( {}))
|
|
13971
14189
|
};
|
|
13972
14190
|
}
|
|
13973
|
-
const baseBorder = _optionalChain([base, 'optionalAccess',
|
|
13974
|
-
const overlayBorder = _optionalChain([overlay, 'optionalAccess',
|
|
14191
|
+
const baseBorder = _optionalChain([base, 'optionalAccess', _927 => _927.border]);
|
|
14192
|
+
const overlayBorder = _optionalChain([overlay, 'optionalAccess', _928 => _928.border]);
|
|
13975
14193
|
if (baseBorder || overlayBorder) {
|
|
13976
|
-
nextStyle.border = _optionalChain([options, 'optionalAccess',
|
|
14194
|
+
nextStyle.border = _optionalChain([options, 'optionalAccess', _929 => _929.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
|
|
13977
14195
|
..._nullishCoalesce(baseBorder, () => ( {})),
|
|
13978
14196
|
..._nullishCoalesce(overlayBorder, () => ( {}))
|
|
13979
14197
|
};
|
|
13980
14198
|
}
|
|
13981
|
-
const baseFill = _optionalChain([base, 'optionalAccess',
|
|
13982
|
-
const overlayFill = _optionalChain([overlay, 'optionalAccess',
|
|
14199
|
+
const baseFill = _optionalChain([base, 'optionalAccess', _930 => _930.fill]);
|
|
14200
|
+
const overlayFill = _optionalChain([overlay, 'optionalAccess', _931 => _931.fill]);
|
|
13983
14201
|
if (baseFill || overlayFill) {
|
|
13984
|
-
nextStyle.fill = _optionalChain([options, 'optionalAccess',
|
|
14202
|
+
nextStyle.fill = _optionalChain([options, 'optionalAccess', _932 => _932.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
|
|
13985
14203
|
}
|
|
13986
|
-
const baseFont = _optionalChain([base, 'optionalAccess',
|
|
13987
|
-
const overlayFont = _optionalChain([overlay, 'optionalAccess',
|
|
14204
|
+
const baseFont = _optionalChain([base, 'optionalAccess', _933 => _933.font]);
|
|
14205
|
+
const overlayFont = _optionalChain([overlay, 'optionalAccess', _934 => _934.font]);
|
|
13988
14206
|
if (baseFont || overlayFont) {
|
|
13989
|
-
nextStyle.font = _optionalChain([options, 'optionalAccess',
|
|
14207
|
+
nextStyle.font = _optionalChain([options, 'optionalAccess', _935 => _935.replaceXfSubtrees]) && overlayFont ? overlayFont : {
|
|
13990
14208
|
..._nullishCoalesce(baseFont, () => ( {})),
|
|
13991
14209
|
..._nullishCoalesce(overlayFont, () => ( {}))
|
|
13992
14210
|
};
|
|
@@ -14342,11 +14560,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
|
|
|
14342
14560
|
return literal;
|
|
14343
14561
|
}
|
|
14344
14562
|
const splitReference = splitSheetFormulaReference(normalized);
|
|
14345
|
-
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
14346
|
-
if (targetSheetName && _optionalChain([sheet, 'optionalAccess',
|
|
14563
|
+
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _936 => _936.sheetName]), () => ( null));
|
|
14564
|
+
if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _937 => _937.name]) && targetSheetName !== sheet.name) {
|
|
14347
14565
|
return literal;
|
|
14348
14566
|
}
|
|
14349
|
-
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
14567
|
+
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _938 => _938.range]), () => ( normalized));
|
|
14350
14568
|
const cell = parseA1CellReference3(cellRef.replace(/\$/g, ""));
|
|
14351
14569
|
if (!cell) {
|
|
14352
14570
|
return literal;
|
|
@@ -14378,8 +14596,8 @@ function normalizeConditionalTextOperand(value) {
|
|
|
14378
14596
|
}
|
|
14379
14597
|
function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
|
|
14380
14598
|
const normalizedRuleType = rule.ruleType.trim().toLowerCase();
|
|
14381
|
-
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
14382
|
-
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
14599
|
+
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _939 => _939.formulas, 'optionalAccess', _940 => _940[0]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
14600
|
+
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _941 => _941.formulas, 'optionalAccess', _942 => _942[1]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
14383
14601
|
if (normalizedRuleType === "cellis") {
|
|
14384
14602
|
return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
|
|
14385
14603
|
}
|
|
@@ -14410,7 +14628,7 @@ function getStyledConditionalRules(rules) {
|
|
|
14410
14628
|
return styledRules;
|
|
14411
14629
|
}
|
|
14412
14630
|
function resolveConditionalCellStyleForCell(row, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
|
|
14413
|
-
const rules = _optionalChain([sheet, 'optionalAccess',
|
|
14631
|
+
const rules = _optionalChain([sheet, 'optionalAccess', _943 => _943.conditionalFormatRules]);
|
|
14414
14632
|
if (!sheet || !rules || rules.length === 0) {
|
|
14415
14633
|
return null;
|
|
14416
14634
|
}
|
|
@@ -14614,11 +14832,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14614
14832
|
if (shape.paragraphs.length === 0) {
|
|
14615
14833
|
return;
|
|
14616
14834
|
}
|
|
14617
|
-
const inset = _optionalChain([shape, 'access',
|
|
14618
|
-
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14619
|
-
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14620
|
-
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14621
|
-
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
14835
|
+
const inset = _optionalChain([shape, 'access', _944 => _944.textBox, 'optionalAccess', _945 => _945.insetPx]);
|
|
14836
|
+
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _946 => _946.left]), () => ( 6))) * zoomFactor;
|
|
14837
|
+
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _947 => _947.right]), () => ( 6))) * zoomFactor;
|
|
14838
|
+
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _948 => _948.top]), () => ( 4))) * zoomFactor;
|
|
14839
|
+
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _949 => _949.bottom]), () => ( 4))) * zoomFactor;
|
|
14622
14840
|
const textLeft = left + paddingLeft;
|
|
14623
14841
|
const textTop = top + paddingTop;
|
|
14624
14842
|
const textWidth = Math.max(0, width - paddingLeft - paddingRight);
|
|
@@ -14640,9 +14858,9 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14640
14858
|
});
|
|
14641
14859
|
const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
|
|
14642
14860
|
let y = textTop;
|
|
14643
|
-
if (_optionalChain([shape, 'access',
|
|
14861
|
+
if (_optionalChain([shape, 'access', _950 => _950.textBox, 'optionalAccess', _951 => _951.verticalAlign]) === "middle") {
|
|
14644
14862
|
y = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
|
|
14645
|
-
} else if (_optionalChain([shape, 'access',
|
|
14863
|
+
} else if (_optionalChain([shape, 'access', _952 => _952.textBox, 'optionalAccess', _953 => _953.verticalAlign]) === "bottom") {
|
|
14646
14864
|
y = textTop + Math.max(0, textHeight - totalTextHeight);
|
|
14647
14865
|
}
|
|
14648
14866
|
context.save();
|
|
@@ -14653,7 +14871,7 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14653
14871
|
shape.paragraphs.forEach((paragraph, paragraphIndex) => {
|
|
14654
14872
|
const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
|
|
14655
14873
|
let x = textLeft;
|
|
14656
|
-
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access',
|
|
14874
|
+
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _954 => _954.textBox, 'optionalAccess', _955 => _955.horizontalAlign]))), () => ( "left"));
|
|
14657
14875
|
if (align === "center") {
|
|
14658
14876
|
x = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
|
|
14659
14877
|
} else if (align === "right") {
|
|
@@ -14682,11 +14900,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
14682
14900
|
context.restore();
|
|
14683
14901
|
}
|
|
14684
14902
|
function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
14685
|
-
const fillColor = _optionalChain([shape, 'access',
|
|
14686
|
-
const strokeColor = _optionalChain([shape, 'access',
|
|
14687
|
-
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access',
|
|
14903
|
+
const fillColor = _optionalChain([shape, 'access', _956 => _956.fill, 'optionalAccess', _957 => _957.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _958 => _958.fill, 'optionalAccess', _959 => _959.color]), () => ( "transparent"));
|
|
14904
|
+
const strokeColor = _optionalChain([shape, 'access', _960 => _960.stroke, 'optionalAccess', _961 => _961.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _962 => _962.stroke, 'optionalAccess', _963 => _963.color]), () => ( "transparent"));
|
|
14905
|
+
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _964 => _964.stroke, 'optionalAccess', _965 => _965.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
|
|
14688
14906
|
const vectorShape = resolveShapeVector(shape);
|
|
14689
|
-
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access',
|
|
14907
|
+
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _966 => _966.fill, 'optionalAccess', _967 => _967.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _968 => _968.stroke, 'optionalAccess', _969 => _969.opacity]), () => ( 1)));
|
|
14690
14908
|
context.save();
|
|
14691
14909
|
context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
14692
14910
|
if (shape.rotationDeg) {
|
|
@@ -14697,7 +14915,7 @@ function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
|
14697
14915
|
context.lineWidth = lineWidth;
|
|
14698
14916
|
context.strokeStyle = strokeColor;
|
|
14699
14917
|
context.fillStyle = fillColor;
|
|
14700
|
-
applyCanvasShapeDash(context, _optionalChain([shape, 'access',
|
|
14918
|
+
applyCanvasShapeDash(context, _optionalChain([shape, 'access', _970 => _970.stroke, 'optionalAccess', _971 => _971.dash]), lineWidth);
|
|
14701
14919
|
const localLeft = -rect.width / 2;
|
|
14702
14920
|
const localTop = -rect.height / 2;
|
|
14703
14921
|
if (vectorShape && typeof Path2D !== "undefined") {
|
|
@@ -14834,7 +15052,7 @@ function drawStaticFormControl(context, control, rect, palette, zoomFactor, shee
|
|
|
14834
15052
|
context.restore();
|
|
14835
15053
|
}
|
|
14836
15054
|
function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCache) {
|
|
14837
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
15055
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _972 => _972.conditionalFormatRules]), () => ( []));
|
|
14838
15056
|
const matchingRule = rules.find(
|
|
14839
15057
|
(rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
14840
15058
|
);
|
|
@@ -14872,23 +15090,23 @@ function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCac
|
|
|
14872
15090
|
const span = maxValue - minValue;
|
|
14873
15091
|
const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
|
|
14874
15092
|
const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
|
|
14875
|
-
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess',
|
|
15093
|
+
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _973 => _973.themePalette]));
|
|
14876
15094
|
if (!color || widthPercent <= 0) {
|
|
14877
15095
|
return null;
|
|
14878
15096
|
}
|
|
14879
15097
|
return {
|
|
14880
|
-
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess',
|
|
15098
|
+
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _974 => _974.themePalette])), () => ( void 0)),
|
|
14881
15099
|
border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
|
|
14882
|
-
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess',
|
|
15100
|
+
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _975 => _975.themePalette])), () => ( void 0)),
|
|
14883
15101
|
color,
|
|
14884
15102
|
gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
|
|
14885
|
-
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess',
|
|
14886
|
-
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess',
|
|
15103
|
+
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _976 => _976.themePalette])), () => ( void 0)),
|
|
15104
|
+
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _977 => _977.themePalette])), () => ( void 0)),
|
|
14887
15105
|
widthPercent
|
|
14888
15106
|
};
|
|
14889
15107
|
}
|
|
14890
15108
|
function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metricsCache) {
|
|
14891
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
15109
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _978 => _978.conditionalFormatRules]), () => ( []));
|
|
14892
15110
|
const matchingRule = rules.find(
|
|
14893
15111
|
(rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
14894
15112
|
);
|
|
@@ -14916,7 +15134,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
14916
15134
|
});
|
|
14917
15135
|
metricsCache.set(cacheKey, ruleValues);
|
|
14918
15136
|
}
|
|
14919
|
-
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess',
|
|
15137
|
+
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _979 => _979.themePalette]))).filter((color) => typeof color === "string");
|
|
14920
15138
|
const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
14921
15139
|
if (colors.length < 2 || thresholds.length < 2) {
|
|
14922
15140
|
return null;
|
|
@@ -14935,7 +15153,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
14935
15153
|
return { color: resolvedColor };
|
|
14936
15154
|
}
|
|
14937
15155
|
function resolveConditionalIconForCell(row, col, worksheet, sheet, metricsCache) {
|
|
14938
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
15156
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _980 => _980.conditionalFormatRules]), () => ( []));
|
|
14939
15157
|
const matchingRule = rules.find(
|
|
14940
15158
|
(rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
14941
15159
|
);
|
|
@@ -15222,7 +15440,7 @@ function GridRow({
|
|
|
15222
15440
|
whiteSpace: "nowrap",
|
|
15223
15441
|
width: "max-content"
|
|
15224
15442
|
} : null;
|
|
15225
|
-
const title = [_optionalChain([cellData, 'access',
|
|
15443
|
+
const title = [_optionalChain([cellData, 'access', _981 => _981.hyperlink, 'optionalAccess', _982 => _982.tooltip]), _optionalChain([cellData, 'access', _983 => _983.validation, 'optionalAccess', _984 => _984.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
|
|
15226
15444
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
15227
15445
|
"td",
|
|
15228
15446
|
{
|
|
@@ -15406,8 +15624,8 @@ var MemoGridRow = React4.memo(GridRow, (prev, next) => {
|
|
|
15406
15624
|
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) {
|
|
15407
15625
|
return false;
|
|
15408
15626
|
}
|
|
15409
|
-
const prevEditingCol = _optionalChain([prev, 'access',
|
|
15410
|
-
const nextEditingCol = _optionalChain([next, 'access',
|
|
15627
|
+
const prevEditingCol = _optionalChain([prev, 'access', _985 => _985.editingCell, 'optionalAccess', _986 => _986.row]) === prev.actualRow ? prev.editingCell.col : -1;
|
|
15628
|
+
const nextEditingCol = _optionalChain([next, 'access', _987 => _987.editingCell, 'optionalAccess', _988 => _988.row]) === next.actualRow ? next.editingCell.col : -1;
|
|
15411
15629
|
if (prevEditingCol !== nextEditingCol) {
|
|
15412
15630
|
return false;
|
|
15413
15631
|
}
|
|
@@ -15874,8 +16092,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15874
16092
|
const pendingRequest = workerThumbnailRowBatchRequestRef.current.get(sheet);
|
|
15875
16093
|
if (!pendingRequest) {
|
|
15876
16094
|
const request = {
|
|
15877
|
-
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
15878
|
-
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
16095
|
+
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _989 => _989.endRow]), () => ( endRow))),
|
|
16096
|
+
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _990 => _990.startRow]), () => ( startRow)))
|
|
15879
16097
|
};
|
|
15880
16098
|
workerThumbnailRowBatchRequestRef.current.set(sheet, request);
|
|
15881
16099
|
void getRowsBatchAsync(
|
|
@@ -15939,7 +16157,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15939
16157
|
}, []);
|
|
15940
16158
|
const thumbnails = React4.useMemo(() => {
|
|
15941
16159
|
return sheets.map((sheet, sheetIndex) => {
|
|
15942
|
-
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess',
|
|
16160
|
+
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _991 => _991.getSheet, 'call', _992 => _992(sheet.workbookSheetIndex)]), () => ( null));
|
|
15943
16161
|
const sheetImages = getSheetImages(sheetIndex).filter((image) => image.src).sort((left, right) => left.zIndex - right.zIndex);
|
|
15944
16162
|
const sheetShapes = getSheetShapes(sheetIndex);
|
|
15945
16163
|
const sheetFormControls = getSheetFormControls(sheetIndex).filter((control) => !control.hidden);
|
|
@@ -15955,18 +16173,18 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
15955
16173
|
minRow: 0
|
|
15956
16174
|
}));
|
|
15957
16175
|
return {
|
|
15958
|
-
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15959
|
-
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15960
|
-
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
15961
|
-
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
16176
|
+
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _993 => _993.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
|
|
16177
|
+
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _994 => _994.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
|
|
16178
|
+
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _995 => _995.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
|
|
16179
|
+
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _996 => _996.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
|
|
15962
16180
|
};
|
|
15963
16181
|
}, null);
|
|
15964
16182
|
const sheetMinUsedRow = (_nullishCoalesce(sheet.maxUsedRow, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedRow, () => ( 0))) ? _nullishCoalesce(sheet.minUsedRow, () => ( 0)) : void 0;
|
|
15965
16183
|
const sheetMinUsedCol = (_nullishCoalesce(sheet.maxUsedCol, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedCol, () => ( 0))) ? _nullishCoalesce(sheet.minUsedCol, () => ( 0)) : void 0;
|
|
15966
|
-
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
15967
|
-
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
15968
|
-
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
15969
|
-
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
16184
|
+
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess', _997 => _997.minRow]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _998 => _998.minRow]), () => ( sheetMinUsedRow)), () => ( 0))));
|
|
16185
|
+
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess', _999 => _999.minCol]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1000 => _1000.minCol]), () => ( sheetMinUsedCol)), () => ( 0))));
|
|
16186
|
+
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1001 => _1001.maxRow]), () => ( -1)));
|
|
16187
|
+
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1002 => _1002.maxCol]), () => ( -1)));
|
|
15970
16188
|
const showGridLines = _nullishCoalesce(sheet.showGridLines, () => ( true));
|
|
15971
16189
|
const hiddenRowSet = new Set(_nullishCoalesce(sheet.hiddenRows, () => ( [])));
|
|
15972
16190
|
const hiddenColSet = new Set(_nullishCoalesce(sheet.hiddenCols, () => ( [])));
|
|
@@ -16179,8 +16397,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16179
16397
|
return cached;
|
|
16180
16398
|
}
|
|
16181
16399
|
const batchCoversRow = workerRowBatch ? row >= workerRowBatch.startRow && row <= workerRowBatch.endRow : false;
|
|
16182
|
-
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess',
|
|
16183
|
-
if (_optionalChain([batchedCell, 'optionalAccess',
|
|
16400
|
+
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _1003 => _1003.cells, 'access', _1004 => _1004.get, 'call', _1005 => _1005(cacheKey)]) : void 0;
|
|
16401
|
+
if (_optionalChain([batchedCell, 'optionalAccess', _1006 => _1006.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _1007 => _1007.isMergedSecondary, 'call', _1008 => _1008(row, col)])) {
|
|
16184
16402
|
const mergedSecondaryData = {
|
|
16185
16403
|
isMergedSecondary: true,
|
|
16186
16404
|
style: {},
|
|
@@ -16189,23 +16407,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16189
16407
|
cellRenderCache.set(cacheKey, mergedSecondaryData);
|
|
16190
16408
|
return mergedSecondaryData;
|
|
16191
16409
|
}
|
|
16192
|
-
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
16410
|
+
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _1009 => _1009.mergeSpan]);
|
|
16193
16411
|
const inheritedStyle = resolveInheritedCellStyle2(sheet, row, col);
|
|
16194
|
-
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
16412
|
+
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1010 => _1010.style]), () => ( null));
|
|
16195
16413
|
const mergedStyle = mergeResolvedCellStyle(inheritedStyle, worksheetStyle, { replaceXfSubtrees: true });
|
|
16196
16414
|
const conditionalCellStyle = resolveConditionalCellStyleForCell(
|
|
16197
16415
|
row,
|
|
16198
16416
|
col,
|
|
16199
16417
|
sheet,
|
|
16200
16418
|
() => worksheet ? getCellNumericValue(worksheet, row, col) : getBatchedCellNumericValue(batchedCell),
|
|
16201
|
-
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
16419
|
+
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1011 => _1011.value]), () => ( "")),
|
|
16202
16420
|
worksheet,
|
|
16203
|
-
_optionalChain([workerRowBatch, 'optionalAccess',
|
|
16421
|
+
_optionalChain([workerRowBatch, 'optionalAccess', _1012 => _1012.cells])
|
|
16204
16422
|
);
|
|
16205
16423
|
const finalResolvedStyle = mergeResolvedCellStyle(mergedStyle, conditionalCellStyle);
|
|
16206
|
-
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
16424
|
+
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _1013 => _1013.alignment]);
|
|
16207
16425
|
const sparkline = _nullishCoalesce(sparklineByCell.get(cacheKey), () => ( null));
|
|
16208
|
-
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess',
|
|
16426
|
+
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess', _1014 => _1014.cells, 'access', _1015 => _1015.get, 'call', _1016 => _1016(`${targetRow}:${targetCol}`)]));
|
|
16209
16427
|
const sparklineValues = sparkline ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
|
|
16210
16428
|
{ length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
|
|
16211
16429
|
(_, index) => getNumericValue(
|
|
@@ -16219,23 +16437,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16219
16437
|
sparkline.range.start.col
|
|
16220
16438
|
)
|
|
16221
16439
|
) : null;
|
|
16222
|
-
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
16440
|
+
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _1017 => _1017.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
|
|
16223
16441
|
const nextData = {
|
|
16224
16442
|
canvas: void 0,
|
|
16225
16443
|
checkboxState,
|
|
16226
|
-
colSpan: _optionalChain([merge, 'optionalAccess',
|
|
16444
|
+
colSpan: _optionalChain([merge, 'optionalAccess', _1018 => _1018.colSpan]),
|
|
16227
16445
|
conditionalColorScale: worksheet ? resolveConditionalColorScaleForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
16228
16446
|
conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
16229
16447
|
conditionalIcon: worksheet ? resolveConditionalIconForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
16230
16448
|
isMergedSecondary: false,
|
|
16231
|
-
rowSpan: _optionalChain([merge, 'optionalAccess',
|
|
16449
|
+
rowSpan: _optionalChain([merge, 'optionalAccess', _1019 => _1019.rowSpan]),
|
|
16232
16450
|
sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
|
|
16233
16451
|
style: buildCellStyle(finalResolvedStyle, palette, sheet.themePalette, {
|
|
16234
|
-
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
16452
|
+
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _1020 => _1020.generalAlignment]),
|
|
16235
16453
|
showGridLines
|
|
16236
16454
|
}),
|
|
16237
|
-
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess',
|
|
16238
|
-
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
16455
|
+
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1021 => _1021.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1022 => _1022.textRotation])))),
|
|
16456
|
+
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1023 => _1023.value]), () => ( ""))
|
|
16239
16457
|
};
|
|
16240
16458
|
nextData.canvas = buildCanvasCellStyleCache(nextData.style);
|
|
16241
16459
|
cellRenderCache.set(cacheKey, nextData);
|
|
@@ -16253,11 +16471,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16253
16471
|
let height = rowItem.size;
|
|
16254
16472
|
for (let colOffset = 1; colOffset < colSpan; colOffset += 1) {
|
|
16255
16473
|
const nextCol = colItemByActual.get(colItem.actualIndex + colOffset);
|
|
16256
|
-
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess',
|
|
16474
|
+
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _1024 => _1024.size]), () => ( 0));
|
|
16257
16475
|
}
|
|
16258
16476
|
for (let rowOffset = 1; rowOffset < rowSpan; rowOffset += 1) {
|
|
16259
16477
|
const nextRow = rowItemByActual.get(rowItem.actualIndex + rowOffset);
|
|
16260
|
-
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess',
|
|
16478
|
+
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _1025 => _1025.size]), () => ( 0));
|
|
16261
16479
|
}
|
|
16262
16480
|
const rect = {
|
|
16263
16481
|
height,
|
|
@@ -16267,7 +16485,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16267
16485
|
};
|
|
16268
16486
|
const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellData.style)));
|
|
16269
16487
|
const gradientFill = typeof cellData.style.backgroundImage === "string" ? resolveCanvasGradientFill(context, rect, cellData.style.backgroundImage) : null;
|
|
16270
|
-
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access',
|
|
16488
|
+
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _1026 => _1026.conditionalColorScale, 'optionalAccess', _1027 => _1027.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
|
|
16271
16489
|
context.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
|
|
16272
16490
|
context.fillRect(rect.left, rect.top, rect.width, rect.height);
|
|
16273
16491
|
if (cellData.conditionalDataBar) {
|
|
@@ -16511,7 +16729,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
16511
16729
|
workbook
|
|
16512
16730
|
]);
|
|
16513
16731
|
const paintThumbnail = React4.useCallback(
|
|
16514
|
-
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access',
|
|
16732
|
+
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _1028 => _1028[sheetIndex], 'optionalAccess', _1029 => _1029.paint, 'call', _1030 => _1030(canvas)]), () => ( false)),
|
|
16515
16733
|
[thumbnails]
|
|
16516
16734
|
);
|
|
16517
16735
|
return React4.useMemo(
|
|
@@ -16570,7 +16788,7 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
|
|
|
16570
16788
|
}
|
|
16571
16789
|
destroy() {
|
|
16572
16790
|
this.destroyed = true;
|
|
16573
|
-
_optionalChain([this, 'access',
|
|
16791
|
+
_optionalChain([this, 'access', _1031 => _1031.observer, 'optionalAccess', _1032 => _1032.disconnect, 'call', _1033 => _1033()]);
|
|
16574
16792
|
this.observer = null;
|
|
16575
16793
|
this.slots.clear();
|
|
16576
16794
|
this.listeners.clear();
|
|
@@ -16612,7 +16830,7 @@ function RuntimeContent({ content }) {
|
|
|
16612
16830
|
};
|
|
16613
16831
|
}, []);
|
|
16614
16832
|
React5.useLayoutEffect(() => {
|
|
16615
|
-
_optionalChain([rootRef, 'access',
|
|
16833
|
+
_optionalChain([rootRef, 'access', _1034 => _1034.current, 'optionalAccess', _1035 => _1035.update, 'call', _1036 => _1036(content)]);
|
|
16616
16834
|
}, [content]);
|
|
16617
16835
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref: hostRef, style: { display: "contents" } });
|
|
16618
16836
|
}
|
|
@@ -16674,7 +16892,7 @@ function BoundViewer({ props, controller }) {
|
|
|
16674
16892
|
}, [slots]);
|
|
16675
16893
|
React5.useLayoutEffect(() => {
|
|
16676
16894
|
const host = hostRef.current;
|
|
16677
|
-
if (host) _optionalChain([viewerRef, 'access',
|
|
16895
|
+
if (host) _optionalChain([viewerRef, 'access', _1037 => _1037.current, 'optionalAccess', _1038 => _1038.update, 'call', _1039 => _1039(renderOptions(props, controller, slots, host.ownerDocument))]);
|
|
16678
16896
|
}, [controller, props, slots]);
|
|
16679
16897
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ViewerAppearanceContext.Provider, { value: {
|
|
16680
16898
|
headerBackgroundColor: props.headerBackgroundColor,
|