@extend-ai/react-xlsx 0.20.12 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -1
- package/dist/{chunk-O4S5CRDM.js → chunk-2UFSVI5Z.js} +432 -33
- package/dist/chunk-2UFSVI5Z.js.map +1 -0
- package/dist/{chunk-NIN5D556.cjs → chunk-7IL4KLCD.cjs} +837 -438
- package/dist/chunk-7IL4KLCD.cjs.map +1 -0
- package/dist/index.cjs +215 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -1
- package/dist/index.d.ts +76 -1
- package/dist/index.js +173 -105
- package/dist/index.js.map +1 -1
- package/dist/{internal-D_np3R-w.d.cts → internal-BO70EPFy.d.cts} +71 -1
- package/dist/{internal-D_np3R-w.d.ts → internal-BO70EPFy.d.ts} +71 -1
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/vanilla.cjs +2 -2
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-NIN5D556.cjs.map +0 -1
- package/dist/chunk-O4S5CRDM.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -334,7 +334,7 @@ async function loadSpreadsheetFonts(buffer) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
// src/controller.tsx
|
|
337
|
-
var _react = require('react'); var React = _interopRequireWildcard(_react); var
|
|
337
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react); var React10 = _interopRequireWildcard(_react); var React9 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React8 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react);
|
|
338
338
|
var _internal = require('@extend-ai/react-xlsx/internal');
|
|
339
339
|
|
|
340
340
|
|
|
@@ -11580,6 +11580,28 @@ function useXlsxViewerController(options) {
|
|
|
11580
11580
|
refreshWorkbookState(workbook);
|
|
11581
11581
|
recordCellEditHistory(cell, before, after);
|
|
11582
11582
|
}, [captureCellMutationState, getActiveWorksheet, readOnly, recordCellEditHistory, refreshWorkbookState, workbook]);
|
|
11583
|
+
const setCellStyles = React.useCallback((updates) => {
|
|
11584
|
+
const worksheet = getActiveWorksheet();
|
|
11585
|
+
if (readOnly || !worksheet || !workbook) return;
|
|
11586
|
+
const beforeStates = /* @__PURE__ */ new Map();
|
|
11587
|
+
for (const { cell, style } of updates) {
|
|
11588
|
+
const key = `${cell.row}:${cell.col}`;
|
|
11589
|
+
if (!beforeStates.has(key)) {
|
|
11590
|
+
const before = captureCellMutationState(cell);
|
|
11591
|
+
if (!before) continue;
|
|
11592
|
+
beforeStates.set(key, { cell: { ...cell }, before });
|
|
11593
|
+
}
|
|
11594
|
+
worksheet.setCellStyleAt(cell.row, cell.col, style);
|
|
11595
|
+
}
|
|
11596
|
+
if (!beforeStates.size) return;
|
|
11597
|
+
const mutations = [];
|
|
11598
|
+
for (const { cell, before } of beforeStates.values()) {
|
|
11599
|
+
const after = captureCellMutationState(cell);
|
|
11600
|
+
if (after) mutations.push({ cell, before, after });
|
|
11601
|
+
}
|
|
11602
|
+
refreshWorkbookState(workbook);
|
|
11603
|
+
recordRangeEditHistory(mutations, selection, activeCell);
|
|
11604
|
+
}, [activeCell, captureCellMutationState, getActiveWorksheet, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
|
|
11583
11605
|
const setSelectedCellValue = React.useCallback((value) => {
|
|
11584
11606
|
if (!activeCell) {
|
|
11585
11607
|
return;
|
|
@@ -12236,6 +12258,7 @@ function useXlsxViewerController(options) {
|
|
|
12236
12258
|
resizeRow,
|
|
12237
12259
|
setCellFormula,
|
|
12238
12260
|
setCellStyle,
|
|
12261
|
+
setCellStyles,
|
|
12239
12262
|
setCellValue,
|
|
12240
12263
|
setRangeStyle,
|
|
12241
12264
|
setSelectedFormula,
|
|
@@ -12360,6 +12383,7 @@ function useXlsxViewerController(options) {
|
|
|
12360
12383
|
resizeRow,
|
|
12361
12384
|
setCellFormula,
|
|
12362
12385
|
setCellStyle,
|
|
12386
|
+
setCellStyles,
|
|
12363
12387
|
setCellValue,
|
|
12364
12388
|
setRangeStyle,
|
|
12365
12389
|
setSelectedFormula,
|
|
@@ -12427,6 +12451,8 @@ function CellEditor({
|
|
|
12427
12451
|
value,
|
|
12428
12452
|
references,
|
|
12429
12453
|
inputRef,
|
|
12454
|
+
editorRef,
|
|
12455
|
+
onFocusOverlay,
|
|
12430
12456
|
canvasText = false,
|
|
12431
12457
|
canvasOffset,
|
|
12432
12458
|
paintCanvasText,
|
|
@@ -12566,7 +12592,12 @@ function CellEditor({
|
|
|
12566
12592
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
12567
12593
|
"div",
|
|
12568
12594
|
{
|
|
12569
|
-
ref:
|
|
12595
|
+
ref: (element) => {
|
|
12596
|
+
rootRef.current = element;
|
|
12597
|
+
if (typeof editorRef === "function") editorRef(element);
|
|
12598
|
+
else if (editorRef) editorRef.current = element;
|
|
12599
|
+
},
|
|
12600
|
+
"data-xlsx-cell-editor": "",
|
|
12570
12601
|
onPointerDown: (event) => event.stopPropagation(),
|
|
12571
12602
|
onClick: (event) => event.stopPropagation(),
|
|
12572
12603
|
onDoubleClick: (event) => event.stopPropagation(),
|
|
@@ -12615,7 +12646,7 @@ function CellEditor({
|
|
|
12615
12646
|
] })
|
|
12616
12647
|
}
|
|
12617
12648
|
),
|
|
12618
|
-
paintCanvasText ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "canvas", { ref: canvasRef, "aria-hidden": "true", style: { position: "absolute", pointerEvents: "none" } }) : null,
|
|
12649
|
+
paintCanvasText ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "canvas", { ref: canvasRef, "data-xlsx-formula-text": "", "aria-hidden": "true", style: { position: "absolute", pointerEvents: "none" } }) : null,
|
|
12619
12650
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
12620
12651
|
"textarea",
|
|
12621
12652
|
{
|
|
@@ -12625,6 +12656,7 @@ function CellEditor({
|
|
|
12625
12656
|
else if (inputRef) inputRef.current = element;
|
|
12626
12657
|
},
|
|
12627
12658
|
"aria-label": messages.editCell,
|
|
12659
|
+
"aria-keyshortcuts": onFocusOverlay ? "Alt+ArrowDown" : void 0,
|
|
12628
12660
|
autoFocus: true,
|
|
12629
12661
|
autoComplete: "off",
|
|
12630
12662
|
spellCheck: false,
|
|
@@ -12638,7 +12670,9 @@ function CellEditor({
|
|
|
12638
12670
|
onKeyDown: (event) => {
|
|
12639
12671
|
event.stopPropagation();
|
|
12640
12672
|
if (event.nativeEvent.isComposing) return;
|
|
12641
|
-
if (event.key === "
|
|
12673
|
+
if (event.key === "ArrowDown" && event.altKey && _optionalChain([onFocusOverlay, 'optionalCall', _1079 => _1079()])) {
|
|
12674
|
+
event.preventDefault();
|
|
12675
|
+
} else if (event.key === "Enter" && !event.altKey) {
|
|
12642
12676
|
event.preventDefault();
|
|
12643
12677
|
onCommit();
|
|
12644
12678
|
} else if (event.key === "Escape") {
|
|
@@ -12684,6 +12718,19 @@ function CellEditor({
|
|
|
12684
12718
|
);
|
|
12685
12719
|
}
|
|
12686
12720
|
|
|
12721
|
+
// src/cell-editor-overlay.tsx
|
|
12722
|
+
|
|
12723
|
+
|
|
12724
|
+
|
|
12725
|
+
|
|
12726
|
+
// src/selection-popover.tsx
|
|
12727
|
+
|
|
12728
|
+
|
|
12729
|
+
|
|
12730
|
+
|
|
12731
|
+
// src/cell-editor-session.ts
|
|
12732
|
+
|
|
12733
|
+
|
|
12687
12734
|
// src/cell-alignment.ts
|
|
12688
12735
|
function getCellGeneralAlignment(worksheet, row, col) {
|
|
12689
12736
|
const value = worksheet.getCalculatedValueAt(row, col);
|
|
@@ -13314,7 +13361,7 @@ function parseCanvasGradientStops(value) {
|
|
|
13314
13361
|
if (!match) {
|
|
13315
13362
|
return null;
|
|
13316
13363
|
}
|
|
13317
|
-
const color = _optionalChain([match, 'access',
|
|
13364
|
+
const color = _optionalChain([match, 'access', _1080 => _1080[1], 'optionalAccess', _1081 => _1081.trim, 'call', _1082 => _1082()]);
|
|
13318
13365
|
const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
|
|
13319
13366
|
if (!color) {
|
|
13320
13367
|
return null;
|
|
@@ -13330,7 +13377,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
13330
13377
|
if (linearMatch) {
|
|
13331
13378
|
const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
|
|
13332
13379
|
if (parts.length >= 2) {
|
|
13333
|
-
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access',
|
|
13380
|
+
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _1083 => _1083[0], 'optionalAccess', _1084 => _1084.trim, 'call', _1085 => _1085()]), () => ( "180deg"));
|
|
13334
13381
|
const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
|
|
13335
13382
|
const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
|
|
13336
13383
|
const radians = (90 - cssAngle) * Math.PI / 180;
|
|
@@ -13360,7 +13407,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
13360
13407
|
const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
|
|
13361
13408
|
if (radialMatch) {
|
|
13362
13409
|
const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
|
|
13363
|
-
const stopParts = _optionalChain([parts, 'access',
|
|
13410
|
+
const stopParts = _optionalChain([parts, 'access', _1086 => _1086[0], 'optionalAccess', _1087 => _1087.startsWith, 'call', _1088 => _1088("circle")]) ? parts.slice(1) : parts;
|
|
13364
13411
|
const gradient = context.createRadialGradient(
|
|
13365
13412
|
rect.left + rect.width / 2,
|
|
13366
13413
|
rect.top + rect.height / 2,
|
|
@@ -13467,8 +13514,8 @@ function lightenColor(color, ratio) {
|
|
|
13467
13514
|
function darkenColor(color, ratio) {
|
|
13468
13515
|
return mixRgbColor(color, "#000000", ratio);
|
|
13469
13516
|
}
|
|
13470
|
-
var ViewerContext =
|
|
13471
|
-
var ViewerAppearanceContext =
|
|
13517
|
+
var ViewerContext = React9.createContext(null);
|
|
13518
|
+
var ViewerAppearanceContext = React9.createContext({ isDark: false });
|
|
13472
13519
|
function ReferenceRangeHandles({ color, top = true, bottom = true, left = true, right = true }) {
|
|
13473
13520
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: [top && "top", bottom && "bottom"].flatMap((vertical) => vertical ? [left && "left", right && "right"].map((horizontal) => horizontal ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: {
|
|
13474
13521
|
position: "absolute",
|
|
@@ -13484,7 +13531,7 @@ function resolveDarkModeSurface(themePalette, palette) {
|
|
|
13484
13531
|
return "hsl(225 4% 6%)";
|
|
13485
13532
|
}
|
|
13486
13533
|
function resolveSheetSurface(sheet, palette) {
|
|
13487
|
-
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess',
|
|
13534
|
+
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _1089 => _1089.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1090 => _1090.themePalette, 'access', _1091 => _1091.colorsByIndex, 'access', _1092 => _1092[0]]), () => ( SHEET_SURFACE));
|
|
13488
13535
|
}
|
|
13489
13536
|
function normalizeRange2(range) {
|
|
13490
13537
|
return {
|
|
@@ -13516,7 +13563,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
|
|
|
13516
13563
|
const visible2 = [];
|
|
13517
13564
|
const usedLimit = Math.min(displayLimit, Math.max(0, maxUsedIndex + 1));
|
|
13518
13565
|
for (let index = 0; index < usedLimit; index += 1) {
|
|
13519
|
-
if (!_optionalChain([hiddenIndices, 'optionalAccess',
|
|
13566
|
+
if (!_optionalChain([hiddenIndices, 'optionalAccess', _1093 => _1093.has, 'call', _1094 => _1094(index)])) {
|
|
13520
13567
|
visible2.push(index);
|
|
13521
13568
|
}
|
|
13522
13569
|
}
|
|
@@ -13558,7 +13605,7 @@ function clampPercent(value, fallback) {
|
|
|
13558
13605
|
return Math.max(0, Math.min(100, value));
|
|
13559
13606
|
}
|
|
13560
13607
|
function resolveShapeAdjustment(shape, name, fallback) {
|
|
13561
|
-
const rawValue = _optionalChain([shape, 'access',
|
|
13608
|
+
const rawValue = _optionalChain([shape, 'access', _1095 => _1095.geometryAdjustments, 'optionalAccess', _1096 => _1096[name]]);
|
|
13562
13609
|
if (typeof rawValue !== "number") {
|
|
13563
13610
|
return fallback;
|
|
13564
13611
|
}
|
|
@@ -14444,7 +14491,7 @@ function applyCanvasShapeDash(context, dash, lineWidth) {
|
|
|
14444
14491
|
}
|
|
14445
14492
|
}
|
|
14446
14493
|
function useViewerPalette(isDark = false, headerBackgroundColor, headerTextColor) {
|
|
14447
|
-
return
|
|
14494
|
+
return React9.useMemo(
|
|
14448
14495
|
() => resolveViewerPalette(isDark, headerBackgroundColor, headerTextColor),
|
|
14449
14496
|
[headerBackgroundColor, headerTextColor, isDark]
|
|
14450
14497
|
);
|
|
@@ -14458,8 +14505,8 @@ function normalizeThumbnailResolution(resolution) {
|
|
|
14458
14505
|
}
|
|
14459
14506
|
const resolvedObject = typeof resolution === "object" && resolution ? resolution : void 0;
|
|
14460
14507
|
return {
|
|
14461
|
-
maxHeight: _optionalChain([resolvedObject, 'optionalAccess',
|
|
14462
|
-
maxWidth: _optionalChain([resolvedObject, 'optionalAccess',
|
|
14508
|
+
maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _1097 => _1097.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
|
|
14509
|
+
maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _1098 => _1098.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
|
|
14463
14510
|
};
|
|
14464
14511
|
}
|
|
14465
14512
|
function resolveThumbnailOutputSize(sourceWidth, sourceHeight, resolution) {
|
|
@@ -14778,24 +14825,24 @@ function escapeCssFontFamily(name) {
|
|
|
14778
14825
|
return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
|
|
14779
14826
|
}
|
|
14780
14827
|
function resolveSpreadsheetThemeFont(font, themePalette) {
|
|
14781
|
-
const scheme = typeof _optionalChain([font, 'optionalAccess',
|
|
14828
|
+
const scheme = typeof _optionalChain([font, 'optionalAccess', _1099 => _1099.scheme]) === "string" ? font.scheme : null;
|
|
14782
14829
|
if (scheme === "major") {
|
|
14783
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
14830
|
+
return _optionalChain([themePalette, 'optionalAccess', _1100 => _1100.majorLatinFont]);
|
|
14784
14831
|
}
|
|
14785
14832
|
if (scheme === "minor") {
|
|
14786
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
14833
|
+
return _optionalChain([themePalette, 'optionalAccess', _1101 => _1101.minorLatinFont]);
|
|
14787
14834
|
}
|
|
14788
14835
|
return void 0;
|
|
14789
14836
|
}
|
|
14790
14837
|
function buildSpreadsheetFontFamily(font, themePalette) {
|
|
14791
14838
|
const candidates = [
|
|
14792
|
-
typeof _optionalChain([font, 'optionalAccess',
|
|
14793
|
-
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call',
|
|
14839
|
+
typeof _optionalChain([font, 'optionalAccess', _1102 => _1102.name]) === "string" ? font.name.trim() : "",
|
|
14840
|
+
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _1103 => _1103(font, themePalette), 'optionalAccess', _1104 => _1104.trim, 'call', _1105 => _1105()]), () => ( ""))
|
|
14794
14841
|
].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
|
|
14795
14842
|
if (candidates.length === 0) {
|
|
14796
14843
|
return void 0;
|
|
14797
14844
|
}
|
|
14798
|
-
const primaryFont = _optionalChain([candidates, 'access',
|
|
14845
|
+
const primaryFont = _optionalChain([candidates, 'access', _1106 => _1106[0], 'optionalAccess', _1107 => _1107.toLowerCase, 'call', _1108 => _1108()]);
|
|
14799
14846
|
if (primaryFont === "calibri") {
|
|
14800
14847
|
return [
|
|
14801
14848
|
"Calibri",
|
|
@@ -14828,17 +14875,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
|
|
|
14828
14875
|
}
|
|
14829
14876
|
function buildGridlineShadow(color, options) {
|
|
14830
14877
|
const parts = [];
|
|
14831
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
14878
|
+
if (_optionalChain([options, 'optionalAccess', _1109 => _1109.right]) !== false) {
|
|
14832
14879
|
parts.push(`inset -1px 0 0 ${color}`);
|
|
14833
14880
|
}
|
|
14834
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
14881
|
+
if (_optionalChain([options, 'optionalAccess', _1110 => _1110.bottom]) !== false) {
|
|
14835
14882
|
parts.push(`inset 0 -1px 0 ${color}`);
|
|
14836
14883
|
}
|
|
14837
14884
|
return parts.join(", ");
|
|
14838
14885
|
}
|
|
14839
14886
|
function buildCellStyle(style, palette, themePalette, options) {
|
|
14840
|
-
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
14841
|
-
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
14887
|
+
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1111 => _1111.showGridLines]), () => ( true));
|
|
14888
|
+
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _1112 => _1112.colorsByIndex, 'access', _1113 => _1113[0]]), () => ( SHEET_SURFACE));
|
|
14842
14889
|
const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
|
|
14843
14890
|
const css = {
|
|
14844
14891
|
backgroundColor: baseSurface,
|
|
@@ -14851,7 +14898,7 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
14851
14898
|
lineHeight: String(resolveSpreadsheetLineHeight(11)),
|
|
14852
14899
|
overflow: "hidden",
|
|
14853
14900
|
padding: DEFAULT_CELL_PADDING,
|
|
14854
|
-
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
14901
|
+
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1114 => _1114.generalAlignment]), () => ( "left")),
|
|
14855
14902
|
textOverflow: "clip",
|
|
14856
14903
|
verticalAlign: "bottom",
|
|
14857
14904
|
whiteSpace: "nowrap"
|
|
@@ -14935,24 +14982,24 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
14935
14982
|
}
|
|
14936
14983
|
const border = style.border;
|
|
14937
14984
|
if (border) {
|
|
14938
|
-
const hasRightBorder = Boolean(_optionalChain([border, 'access',
|
|
14939
|
-
const hasBottomBorder = Boolean(_optionalChain([border, 'access',
|
|
14985
|
+
const hasRightBorder = Boolean(_optionalChain([border, 'access', _1115 => _1115.right, 'optionalAccess', _1116 => _1116.style]) && border.right.style !== "none");
|
|
14986
|
+
const hasBottomBorder = Boolean(_optionalChain([border, 'access', _1117 => _1117.bottom, 'optionalAccess', _1118 => _1118.style]) && border.bottom.style !== "none");
|
|
14940
14987
|
if (showGridLines && (hasRightBorder || hasBottomBorder)) {
|
|
14941
14988
|
css.boxShadow = buildGridlineShadow(palette.border, {
|
|
14942
14989
|
bottom: !hasBottomBorder,
|
|
14943
14990
|
right: !hasRightBorder
|
|
14944
14991
|
}) || void 0;
|
|
14945
14992
|
}
|
|
14946
|
-
if (_optionalChain([border, 'access',
|
|
14993
|
+
if (_optionalChain([border, 'access', _1119 => _1119.top, 'optionalAccess', _1120 => _1120.style]) && border.top.style !== "none") {
|
|
14947
14994
|
css.borderTop = mapBorder2(border.top, themePalette);
|
|
14948
14995
|
}
|
|
14949
|
-
if (_optionalChain([border, 'access',
|
|
14996
|
+
if (_optionalChain([border, 'access', _1121 => _1121.right, 'optionalAccess', _1122 => _1122.style]) && border.right.style !== "none") {
|
|
14950
14997
|
css.borderRight = mapBorder2(border.right, themePalette);
|
|
14951
14998
|
}
|
|
14952
|
-
if (_optionalChain([border, 'access',
|
|
14999
|
+
if (_optionalChain([border, 'access', _1123 => _1123.bottom, 'optionalAccess', _1124 => _1124.style]) && border.bottom.style !== "none") {
|
|
14953
15000
|
css.borderBottom = mapBorder2(border.bottom, themePalette);
|
|
14954
15001
|
}
|
|
14955
|
-
if (_optionalChain([border, 'access',
|
|
15002
|
+
if (_optionalChain([border, 'access', _1125 => _1125.left, 'optionalAccess', _1126 => _1126.style]) && border.left.style !== "none") {
|
|
14956
15003
|
css.borderLeft = mapBorder2(border.left, themePalette);
|
|
14957
15004
|
}
|
|
14958
15005
|
}
|
|
@@ -14998,7 +15045,7 @@ function measureTextWidth(value, style) {
|
|
|
14998
15045
|
}
|
|
14999
15046
|
function getCellDisplayValue(worksheet, row, col, activeSheet, locale = "en-US") {
|
|
15000
15047
|
const formula = worksheet.getFormulaAt(row, col);
|
|
15001
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
15048
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _1127 => _1127.cachedFormulaValues, 'optionalAccess', _1128 => _1128[cellAddressToA12({ row, col })]]) : void 0;
|
|
15002
15049
|
const formatted = worksheet.getFormattedValueAt(row, col);
|
|
15003
15050
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
15004
15051
|
return localizeCellNumber(worksheet, row, col, decodeHtmlEntities2(formatted), locale);
|
|
@@ -15245,7 +15292,7 @@ function normalizeBatchedMergeSpan(value) {
|
|
|
15245
15292
|
}
|
|
15246
15293
|
function normalizeBatchedCellValue(rawValue, formula, row, col, activeSheet) {
|
|
15247
15294
|
const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
|
|
15248
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
15295
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _1129 => _1129.cachedFormulaValues, 'optionalAccess', _1130 => _1130[cellAddressToA12({ row, col })]]) : void 0;
|
|
15249
15296
|
if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
|
|
15250
15297
|
return cachedFormulaValue;
|
|
15251
15298
|
}
|
|
@@ -15292,31 +15339,31 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
15292
15339
|
..._nullishCoalesce(base, () => ( {})),
|
|
15293
15340
|
..._nullishCoalesce(overlay, () => ( {}))
|
|
15294
15341
|
};
|
|
15295
|
-
const baseAlignment = _optionalChain([base, 'optionalAccess',
|
|
15296
|
-
const overlayAlignment = _optionalChain([overlay, 'optionalAccess',
|
|
15342
|
+
const baseAlignment = _optionalChain([base, 'optionalAccess', _1131 => _1131.alignment]);
|
|
15343
|
+
const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _1132 => _1132.alignment]);
|
|
15297
15344
|
if (baseAlignment || overlayAlignment) {
|
|
15298
15345
|
nextStyle.alignment = {
|
|
15299
15346
|
..._nullishCoalesce(baseAlignment, () => ( {})),
|
|
15300
15347
|
..._nullishCoalesce(overlayAlignment, () => ( {}))
|
|
15301
15348
|
};
|
|
15302
15349
|
}
|
|
15303
|
-
const baseBorder = _optionalChain([base, 'optionalAccess',
|
|
15304
|
-
const overlayBorder = _optionalChain([overlay, 'optionalAccess',
|
|
15350
|
+
const baseBorder = _optionalChain([base, 'optionalAccess', _1133 => _1133.border]);
|
|
15351
|
+
const overlayBorder = _optionalChain([overlay, 'optionalAccess', _1134 => _1134.border]);
|
|
15305
15352
|
if (baseBorder || overlayBorder) {
|
|
15306
|
-
nextStyle.border = _optionalChain([options, 'optionalAccess',
|
|
15353
|
+
nextStyle.border = _optionalChain([options, 'optionalAccess', _1135 => _1135.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
|
|
15307
15354
|
..._nullishCoalesce(baseBorder, () => ( {})),
|
|
15308
15355
|
..._nullishCoalesce(overlayBorder, () => ( {}))
|
|
15309
15356
|
};
|
|
15310
15357
|
}
|
|
15311
|
-
const baseFill = _optionalChain([base, 'optionalAccess',
|
|
15312
|
-
const overlayFill = _optionalChain([overlay, 'optionalAccess',
|
|
15358
|
+
const baseFill = _optionalChain([base, 'optionalAccess', _1136 => _1136.fill]);
|
|
15359
|
+
const overlayFill = _optionalChain([overlay, 'optionalAccess', _1137 => _1137.fill]);
|
|
15313
15360
|
if (baseFill || overlayFill) {
|
|
15314
|
-
nextStyle.fill = _optionalChain([options, 'optionalAccess',
|
|
15361
|
+
nextStyle.fill = _optionalChain([options, 'optionalAccess', _1138 => _1138.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
|
|
15315
15362
|
}
|
|
15316
|
-
const baseFont = _optionalChain([base, 'optionalAccess',
|
|
15317
|
-
const overlayFont = _optionalChain([overlay, 'optionalAccess',
|
|
15363
|
+
const baseFont = _optionalChain([base, 'optionalAccess', _1139 => _1139.font]);
|
|
15364
|
+
const overlayFont = _optionalChain([overlay, 'optionalAccess', _1140 => _1140.font]);
|
|
15318
15365
|
if (baseFont || overlayFont) {
|
|
15319
|
-
nextStyle.font = _optionalChain([options, 'optionalAccess',
|
|
15366
|
+
nextStyle.font = _optionalChain([options, 'optionalAccess', _1141 => _1141.replaceXfSubtrees]) && overlayFont ? overlayFont : {
|
|
15320
15367
|
..._nullishCoalesce(baseFont, () => ( {})),
|
|
15321
15368
|
..._nullishCoalesce(overlayFont, () => ( {}))
|
|
15322
15369
|
};
|
|
@@ -15679,11 +15726,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
|
|
|
15679
15726
|
return literal;
|
|
15680
15727
|
}
|
|
15681
15728
|
const splitReference = splitSheetFormulaReference(normalized);
|
|
15682
|
-
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
15683
|
-
if (targetSheetName && _optionalChain([sheet, 'optionalAccess',
|
|
15729
|
+
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _1142 => _1142.sheetName]), () => ( null));
|
|
15730
|
+
if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _1143 => _1143.name]) && targetSheetName !== sheet.name) {
|
|
15684
15731
|
return literal;
|
|
15685
15732
|
}
|
|
15686
|
-
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
15733
|
+
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _1144 => _1144.range]), () => ( normalized));
|
|
15687
15734
|
const cell = parseA1CellReference3(cellRef.replace(/\$/g, ""));
|
|
15688
15735
|
if (!cell) {
|
|
15689
15736
|
return literal;
|
|
@@ -15715,8 +15762,8 @@ function normalizeConditionalTextOperand(value) {
|
|
|
15715
15762
|
}
|
|
15716
15763
|
function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
|
|
15717
15764
|
const normalizedRuleType = rule.ruleType.trim().toLowerCase();
|
|
15718
|
-
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
15719
|
-
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
15765
|
+
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _1145 => _1145.formulas, 'optionalAccess', _1146 => _1146[0]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
15766
|
+
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _1147 => _1147.formulas, 'optionalAccess', _1148 => _1148[1]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
15720
15767
|
if (normalizedRuleType === "cellis") {
|
|
15721
15768
|
return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
|
|
15722
15769
|
}
|
|
@@ -15747,7 +15794,7 @@ function getStyledConditionalRules(rules) {
|
|
|
15747
15794
|
return styledRules;
|
|
15748
15795
|
}
|
|
15749
15796
|
function resolveConditionalCellStyleForCell(row, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
|
|
15750
|
-
const rules = _optionalChain([sheet, 'optionalAccess',
|
|
15797
|
+
const rules = _optionalChain([sheet, 'optionalAccess', _1149 => _1149.conditionalFormatRules]);
|
|
15751
15798
|
if (!sheet || !rules || rules.length === 0) {
|
|
15752
15799
|
return null;
|
|
15753
15800
|
}
|
|
@@ -15951,11 +15998,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15951
15998
|
if (shape.paragraphs.length === 0) {
|
|
15952
15999
|
return;
|
|
15953
16000
|
}
|
|
15954
|
-
const inset = _optionalChain([shape, 'access',
|
|
15955
|
-
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15956
|
-
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15957
|
-
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15958
|
-
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
16001
|
+
const inset = _optionalChain([shape, 'access', _1150 => _1150.textBox, 'optionalAccess', _1151 => _1151.insetPx]);
|
|
16002
|
+
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1152 => _1152.left]), () => ( 6))) * zoomFactor;
|
|
16003
|
+
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1153 => _1153.right]), () => ( 6))) * zoomFactor;
|
|
16004
|
+
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1154 => _1154.top]), () => ( 4))) * zoomFactor;
|
|
16005
|
+
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1155 => _1155.bottom]), () => ( 4))) * zoomFactor;
|
|
15959
16006
|
const textLeft = left + paddingLeft;
|
|
15960
16007
|
const textTop = top + paddingTop;
|
|
15961
16008
|
const textWidth = Math.max(0, width - paddingLeft - paddingRight);
|
|
@@ -15977,9 +16024,9 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15977
16024
|
});
|
|
15978
16025
|
const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
|
|
15979
16026
|
let y = textTop;
|
|
15980
|
-
if (_optionalChain([shape, 'access',
|
|
16027
|
+
if (_optionalChain([shape, 'access', _1156 => _1156.textBox, 'optionalAccess', _1157 => _1157.verticalAlign]) === "middle") {
|
|
15981
16028
|
y = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
|
|
15982
|
-
} else if (_optionalChain([shape, 'access',
|
|
16029
|
+
} else if (_optionalChain([shape, 'access', _1158 => _1158.textBox, 'optionalAccess', _1159 => _1159.verticalAlign]) === "bottom") {
|
|
15983
16030
|
y = textTop + Math.max(0, textHeight - totalTextHeight);
|
|
15984
16031
|
}
|
|
15985
16032
|
context.save();
|
|
@@ -15990,7 +16037,7 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15990
16037
|
shape.paragraphs.forEach((paragraph, paragraphIndex) => {
|
|
15991
16038
|
const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
|
|
15992
16039
|
let x = textLeft;
|
|
15993
|
-
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access',
|
|
16040
|
+
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _1160 => _1160.textBox, 'optionalAccess', _1161 => _1161.horizontalAlign]))), () => ( "left"));
|
|
15994
16041
|
if (align === "center") {
|
|
15995
16042
|
x = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
|
|
15996
16043
|
} else if (align === "right") {
|
|
@@ -16019,11 +16066,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
16019
16066
|
context.restore();
|
|
16020
16067
|
}
|
|
16021
16068
|
function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
16022
|
-
const fillColor = _optionalChain([shape, 'access',
|
|
16023
|
-
const strokeColor = _optionalChain([shape, 'access',
|
|
16024
|
-
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access',
|
|
16069
|
+
const fillColor = _optionalChain([shape, 'access', _1162 => _1162.fill, 'optionalAccess', _1163 => _1163.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1164 => _1164.fill, 'optionalAccess', _1165 => _1165.color]), () => ( "transparent"));
|
|
16070
|
+
const strokeColor = _optionalChain([shape, 'access', _1166 => _1166.stroke, 'optionalAccess', _1167 => _1167.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1168 => _1168.stroke, 'optionalAccess', _1169 => _1169.color]), () => ( "transparent"));
|
|
16071
|
+
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _1170 => _1170.stroke, 'optionalAccess', _1171 => _1171.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
|
|
16025
16072
|
const vectorShape = resolveShapeVector(shape);
|
|
16026
|
-
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access',
|
|
16073
|
+
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _1172 => _1172.fill, 'optionalAccess', _1173 => _1173.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _1174 => _1174.stroke, 'optionalAccess', _1175 => _1175.opacity]), () => ( 1)));
|
|
16027
16074
|
context.save();
|
|
16028
16075
|
context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
16029
16076
|
if (shape.rotationDeg) {
|
|
@@ -16034,7 +16081,7 @@ function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
|
16034
16081
|
context.lineWidth = lineWidth;
|
|
16035
16082
|
context.strokeStyle = strokeColor;
|
|
16036
16083
|
context.fillStyle = fillColor;
|
|
16037
|
-
applyCanvasShapeDash(context, _optionalChain([shape, 'access',
|
|
16084
|
+
applyCanvasShapeDash(context, _optionalChain([shape, 'access', _1176 => _1176.stroke, 'optionalAccess', _1177 => _1177.dash]), lineWidth);
|
|
16038
16085
|
const localLeft = -rect.width / 2;
|
|
16039
16086
|
const localTop = -rect.height / 2;
|
|
16040
16087
|
if (vectorShape && typeof Path2D !== "undefined") {
|
|
@@ -16171,7 +16218,7 @@ function drawStaticFormControl(context, control, rect, palette, zoomFactor, shee
|
|
|
16171
16218
|
context.restore();
|
|
16172
16219
|
}
|
|
16173
16220
|
function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16174
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16221
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1178 => _1178.conditionalFormatRules]), () => ( []));
|
|
16175
16222
|
const matchingRule = rules.find(
|
|
16176
16223
|
(rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16177
16224
|
);
|
|
@@ -16209,23 +16256,23 @@ function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCac
|
|
|
16209
16256
|
const span = maxValue - minValue;
|
|
16210
16257
|
const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
|
|
16211
16258
|
const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
|
|
16212
|
-
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess',
|
|
16259
|
+
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _1179 => _1179.themePalette]));
|
|
16213
16260
|
if (!color || widthPercent <= 0) {
|
|
16214
16261
|
return null;
|
|
16215
16262
|
}
|
|
16216
16263
|
return {
|
|
16217
|
-
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess',
|
|
16264
|
+
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _1180 => _1180.themePalette])), () => ( void 0)),
|
|
16218
16265
|
border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
|
|
16219
|
-
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess',
|
|
16266
|
+
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _1181 => _1181.themePalette])), () => ( void 0)),
|
|
16220
16267
|
color,
|
|
16221
16268
|
gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
|
|
16222
|
-
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess',
|
|
16223
|
-
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess',
|
|
16269
|
+
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _1182 => _1182.themePalette])), () => ( void 0)),
|
|
16270
|
+
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _1183 => _1183.themePalette])), () => ( void 0)),
|
|
16224
16271
|
widthPercent
|
|
16225
16272
|
};
|
|
16226
16273
|
}
|
|
16227
16274
|
function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16228
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16275
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1184 => _1184.conditionalFormatRules]), () => ( []));
|
|
16229
16276
|
const matchingRule = rules.find(
|
|
16230
16277
|
(rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16231
16278
|
);
|
|
@@ -16253,7 +16300,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
16253
16300
|
});
|
|
16254
16301
|
metricsCache.set(cacheKey, ruleValues);
|
|
16255
16302
|
}
|
|
16256
|
-
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess',
|
|
16303
|
+
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _1185 => _1185.themePalette]))).filter((color) => typeof color === "string");
|
|
16257
16304
|
const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
16258
16305
|
if (colors.length < 2 || thresholds.length < 2) {
|
|
16259
16306
|
return null;
|
|
@@ -16272,7 +16319,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
16272
16319
|
return { color: resolvedColor };
|
|
16273
16320
|
}
|
|
16274
16321
|
function resolveConditionalIconForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16275
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16322
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1186 => _1186.conditionalFormatRules]), () => ( []));
|
|
16276
16323
|
const matchingRule = rules.find(
|
|
16277
16324
|
(rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16278
16325
|
);
|
|
@@ -16335,6 +16382,10 @@ function GridRow({
|
|
|
16335
16382
|
editingValue,
|
|
16336
16383
|
formulaReferences,
|
|
16337
16384
|
editorBoxShadow,
|
|
16385
|
+
editorRef,
|
|
16386
|
+
editorInputRef,
|
|
16387
|
+
cellEditorStyle,
|
|
16388
|
+
onFocusEditorOverlay,
|
|
16338
16389
|
frozenRowHeaderZIndex,
|
|
16339
16390
|
getCellData,
|
|
16340
16391
|
headerLabelLiveScale,
|
|
@@ -16564,7 +16615,7 @@ function GridRow({
|
|
|
16564
16615
|
whiteSpace: "nowrap",
|
|
16565
16616
|
width: "max-content"
|
|
16566
16617
|
} : null;
|
|
16567
|
-
const title = [_optionalChain([cellData, 'access',
|
|
16618
|
+
const title = [_optionalChain([cellData, 'access', _1187 => _1187.hyperlink, 'optionalAccess', _1188 => _1188.tooltip]), _optionalChain([cellData, 'access', _1189 => _1189.validation, 'optionalAccess', _1190 => _1190.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
|
|
16568
16619
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
16569
16620
|
"td",
|
|
16570
16621
|
{
|
|
@@ -16670,6 +16721,9 @@ function GridRow({
|
|
|
16670
16721
|
isEditing ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
16671
16722
|
CellEditor,
|
|
16672
16723
|
{
|
|
16724
|
+
editorRef,
|
|
16725
|
+
inputRef: editorInputRef,
|
|
16726
|
+
onFocusOverlay: onFocusEditorOverlay,
|
|
16673
16727
|
value: editingValue,
|
|
16674
16728
|
references: formulaReferences,
|
|
16675
16729
|
onBlur: onEditingBlur,
|
|
@@ -16684,7 +16738,8 @@ function GridRow({
|
|
|
16684
16738
|
font: "inherit",
|
|
16685
16739
|
lineHeight: cellData.style.lineHeight,
|
|
16686
16740
|
verticalAlign: cellData.style.verticalAlign,
|
|
16687
|
-
padding: cellData.style.padding
|
|
16741
|
+
padding: cellData.style.padding,
|
|
16742
|
+
...cellEditorStyle
|
|
16688
16743
|
}
|
|
16689
16744
|
}
|
|
16690
16745
|
) : isSpilling ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -16747,12 +16802,12 @@ function GridRow({
|
|
|
16747
16802
|
) : null
|
|
16748
16803
|
] });
|
|
16749
16804
|
}
|
|
16750
|
-
var MemoGridRow =
|
|
16751
|
-
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) {
|
|
16805
|
+
var MemoGridRow = React9.memo(GridRow, (prev, next) => {
|
|
16806
|
+
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 || prev.cellEditorStyle !== next.cellEditorStyle || prev.onFocusEditorOverlay !== next.onFocusEditorOverlay) {
|
|
16752
16807
|
return false;
|
|
16753
16808
|
}
|
|
16754
|
-
const prevEditingCol = _optionalChain([prev, 'access',
|
|
16755
|
-
const nextEditingCol = _optionalChain([next, 'access',
|
|
16809
|
+
const prevEditingCol = _optionalChain([prev, 'access', _1191 => _1191.editingCell, 'optionalAccess', _1192 => _1192.row]) === prev.actualRow ? prev.editingCell.col : -1;
|
|
16810
|
+
const nextEditingCol = _optionalChain([next, 'access', _1193 => _1193.editingCell, 'optionalAccess', _1194 => _1194.row]) === next.actualRow ? next.editingCell.col : -1;
|
|
16756
16811
|
if (prevEditingCol !== nextEditingCol) {
|
|
16757
16812
|
return false;
|
|
16758
16813
|
}
|
|
@@ -16776,7 +16831,7 @@ function XlsxViewerProvider({ children, controller, isDark = false, ...options }
|
|
|
16776
16831
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, XlsxViewerProviderWithInlineController, { ...options, isDark, children });
|
|
16777
16832
|
}
|
|
16778
16833
|
function useXlsxViewer() {
|
|
16779
|
-
const context =
|
|
16834
|
+
const context = React9.useContext(ViewerContext);
|
|
16780
16835
|
if (!context) {
|
|
16781
16836
|
throw new Error("useXlsxViewer must be used inside XlsxViewer or XlsxViewerProvider.");
|
|
16782
16837
|
}
|
|
@@ -16792,7 +16847,7 @@ function useXlsxViewerSelection() {
|
|
|
16792
16847
|
selectRange,
|
|
16793
16848
|
selection
|
|
16794
16849
|
} = useXlsxViewer();
|
|
16795
|
-
return
|
|
16850
|
+
return React9.useMemo(
|
|
16796
16851
|
() => ({
|
|
16797
16852
|
activeCell,
|
|
16798
16853
|
activeCellAddress,
|
|
@@ -16818,7 +16873,7 @@ function useXlsxViewerZoom() {
|
|
|
16818
16873
|
zoomOut,
|
|
16819
16874
|
zoomScale
|
|
16820
16875
|
} = useXlsxViewer();
|
|
16821
|
-
return
|
|
16876
|
+
return React9.useMemo(
|
|
16822
16877
|
() => ({
|
|
16823
16878
|
canZoomIn,
|
|
16824
16879
|
canZoomOut,
|
|
@@ -16876,6 +16931,7 @@ function useXlsxViewerEditing() {
|
|
|
16876
16931
|
selectedValue,
|
|
16877
16932
|
setCellFormula,
|
|
16878
16933
|
setCellStyle,
|
|
16934
|
+
setCellStyles,
|
|
16879
16935
|
setCellValue,
|
|
16880
16936
|
setRangeStyle,
|
|
16881
16937
|
setSelectedFormula,
|
|
@@ -16886,7 +16942,7 @@ function useXlsxViewerEditing() {
|
|
|
16886
16942
|
unmergeSelection,
|
|
16887
16943
|
updateFormControl
|
|
16888
16944
|
} = useXlsxViewer();
|
|
16889
|
-
return
|
|
16945
|
+
return React9.useMemo(
|
|
16890
16946
|
() => ({
|
|
16891
16947
|
addFormControl,
|
|
16892
16948
|
addSheet,
|
|
@@ -16917,6 +16973,7 @@ function useXlsxViewerEditing() {
|
|
|
16917
16973
|
selectedValue,
|
|
16918
16974
|
setCellFormula,
|
|
16919
16975
|
setCellStyle,
|
|
16976
|
+
setCellStyles,
|
|
16920
16977
|
setCellValue,
|
|
16921
16978
|
setRangeStyle,
|
|
16922
16979
|
setSelectedFormula,
|
|
@@ -16957,6 +17014,7 @@ function useXlsxViewerEditing() {
|
|
|
16957
17014
|
selectedValue,
|
|
16958
17015
|
setCellFormula,
|
|
16959
17016
|
setCellStyle,
|
|
17017
|
+
setCellStyles,
|
|
16960
17018
|
setCellValue,
|
|
16961
17019
|
setRangeStyle,
|
|
16962
17020
|
setSelectedFormula,
|
|
@@ -16971,7 +17029,7 @@ function useXlsxViewerEditing() {
|
|
|
16971
17029
|
}
|
|
16972
17030
|
function useXlsxViewerTables() {
|
|
16973
17031
|
const { sortState, sortTable, tables } = useXlsxViewer();
|
|
16974
|
-
return
|
|
17032
|
+
return React9.useMemo(
|
|
16975
17033
|
() => ({
|
|
16976
17034
|
sortState,
|
|
16977
17035
|
sortTable,
|
|
@@ -17012,7 +17070,7 @@ function useXlsxViewerImages() {
|
|
|
17012
17070
|
setImageRect,
|
|
17013
17071
|
updateChart
|
|
17014
17072
|
} = useXlsxViewer();
|
|
17015
|
-
return
|
|
17073
|
+
return React9.useMemo(
|
|
17016
17074
|
() => ({
|
|
17017
17075
|
charts,
|
|
17018
17076
|
clearSelectedChart,
|
|
@@ -17105,7 +17163,7 @@ function useXlsxViewerCharts() {
|
|
|
17105
17163
|
tabs,
|
|
17106
17164
|
updateChart
|
|
17107
17165
|
} = useXlsxViewer();
|
|
17108
|
-
return
|
|
17166
|
+
return React9.useMemo(
|
|
17109
17167
|
() => ({
|
|
17110
17168
|
activeTab,
|
|
17111
17169
|
activeTabIndex,
|
|
@@ -17172,30 +17230,30 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17172
17230
|
workbook,
|
|
17173
17231
|
sheets
|
|
17174
17232
|
} = useXlsxViewer();
|
|
17175
|
-
const { headerBackgroundColor, headerTextColor, isDark } =
|
|
17233
|
+
const { headerBackgroundColor, headerTextColor, isDark } = React9.useContext(ViewerAppearanceContext);
|
|
17176
17234
|
const palette = useViewerPalette(isDark, headerBackgroundColor, headerTextColor);
|
|
17177
17235
|
const includeHeaders = _nullishCoalesce(options.includeHeaders, () => ( true));
|
|
17178
17236
|
const resolution = options.resolution;
|
|
17179
|
-
const thumbnailImageCacheRef =
|
|
17180
|
-
const workerThumbnailRowBatchCacheRef =
|
|
17181
|
-
const workerThumbnailRowBatchRequestRef =
|
|
17237
|
+
const thumbnailImageCacheRef = React9.useRef(/* @__PURE__ */ new Map());
|
|
17238
|
+
const workerThumbnailRowBatchCacheRef = React9.useRef(/* @__PURE__ */ new Map());
|
|
17239
|
+
const workerThumbnailRowBatchRequestRef = React9.useRef(
|
|
17182
17240
|
/* @__PURE__ */ new Map()
|
|
17183
17241
|
);
|
|
17184
|
-
const isMountedRef =
|
|
17185
|
-
const [thumbnailImageLoadVersion, setThumbnailImageLoadVersion] =
|
|
17186
|
-
const [workerThumbnailRowBatchVersion, setWorkerThumbnailRowBatchVersion] =
|
|
17187
|
-
|
|
17242
|
+
const isMountedRef = React9.useRef(false);
|
|
17243
|
+
const [thumbnailImageLoadVersion, setThumbnailImageLoadVersion] = React9.useState(0);
|
|
17244
|
+
const [workerThumbnailRowBatchVersion, setWorkerThumbnailRowBatchVersion] = React9.useState(0);
|
|
17245
|
+
React9.useEffect(() => {
|
|
17188
17246
|
isMountedRef.current = true;
|
|
17189
17247
|
return () => {
|
|
17190
17248
|
isMountedRef.current = false;
|
|
17191
17249
|
};
|
|
17192
17250
|
}, []);
|
|
17193
|
-
|
|
17251
|
+
React9.useEffect(() => {
|
|
17194
17252
|
workerThumbnailRowBatchCacheRef.current.clear();
|
|
17195
17253
|
workerThumbnailRowBatchRequestRef.current.clear();
|
|
17196
17254
|
setWorkerThumbnailRowBatchVersion((version) => version + 1);
|
|
17197
17255
|
}, [locale]);
|
|
17198
|
-
|
|
17256
|
+
React9.useEffect(() => {
|
|
17199
17257
|
const currentSheets = new Set(sheets);
|
|
17200
17258
|
for (const sheet of workerThumbnailRowBatchCacheRef.current.keys()) {
|
|
17201
17259
|
if (!currentSheets.has(sheet)) {
|
|
@@ -17208,7 +17266,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17208
17266
|
}
|
|
17209
17267
|
}
|
|
17210
17268
|
}, [sheets]);
|
|
17211
|
-
const getWorkerThumbnailRowBatch =
|
|
17269
|
+
const getWorkerThumbnailRowBatch = React9.useCallback((sheet, startRow, endRow) => {
|
|
17212
17270
|
const cachedBatch = workerThumbnailRowBatchCacheRef.current.get(sheet);
|
|
17213
17271
|
if (cachedBatch && startRow >= cachedBatch.startRow && endRow <= cachedBatch.endRow) {
|
|
17214
17272
|
return cachedBatch;
|
|
@@ -17219,8 +17277,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17219
17277
|
const pendingRequest = workerThumbnailRowBatchRequestRef.current.get(sheet);
|
|
17220
17278
|
if (!pendingRequest) {
|
|
17221
17279
|
const request = {
|
|
17222
|
-
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
17223
|
-
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
17280
|
+
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _1195 => _1195.endRow]), () => ( endRow))),
|
|
17281
|
+
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _1196 => _1196.startRow]), () => ( startRow)))
|
|
17224
17282
|
};
|
|
17225
17283
|
workerThumbnailRowBatchRequestRef.current.set(sheet, request);
|
|
17226
17284
|
void getRowsBatchAsync(
|
|
@@ -17250,7 +17308,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17250
17308
|
}
|
|
17251
17309
|
return null;
|
|
17252
17310
|
}, [getRowsBatchAsync]);
|
|
17253
|
-
const getThumbnailImage =
|
|
17311
|
+
const getThumbnailImage = React9.useCallback((image) => {
|
|
17254
17312
|
if (typeof Image === "undefined") {
|
|
17255
17313
|
return null;
|
|
17256
17314
|
}
|
|
@@ -17282,9 +17340,9 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17282
17340
|
imageElement.src = image.src;
|
|
17283
17341
|
return null;
|
|
17284
17342
|
}, []);
|
|
17285
|
-
const thumbnails =
|
|
17343
|
+
const thumbnails = React9.useMemo(() => {
|
|
17286
17344
|
return sheets.map((sheet, sheetIndex) => {
|
|
17287
|
-
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess',
|
|
17345
|
+
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _1197 => _1197.getSheet, 'call', _1198 => _1198(sheet.workbookSheetIndex)]), () => ( null));
|
|
17288
17346
|
const sheetImages = getSheetImages(sheetIndex).filter((image) => image.src).sort((left, right) => left.zIndex - right.zIndex);
|
|
17289
17347
|
const sheetShapes = getSheetShapes(sheetIndex);
|
|
17290
17348
|
const sheetFormControls = getSheetFormControls(sheetIndex).filter((control) => !control.hidden);
|
|
@@ -17300,18 +17358,18 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17300
17358
|
minRow: 0
|
|
17301
17359
|
}));
|
|
17302
17360
|
return {
|
|
17303
|
-
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17304
|
-
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17305
|
-
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17306
|
-
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17361
|
+
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1199 => _1199.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
|
|
17362
|
+
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1200 => _1200.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
|
|
17363
|
+
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1201 => _1201.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
|
|
17364
|
+
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1202 => _1202.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
|
|
17307
17365
|
};
|
|
17308
17366
|
}, null);
|
|
17309
17367
|
const sheetMinUsedRow = (_nullishCoalesce(sheet.maxUsedRow, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedRow, () => ( 0))) ? _nullishCoalesce(sheet.minUsedRow, () => ( 0)) : void 0;
|
|
17310
17368
|
const sheetMinUsedCol = (_nullishCoalesce(sheet.maxUsedCol, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedCol, () => ( 0))) ? _nullishCoalesce(sheet.minUsedCol, () => ( 0)) : void 0;
|
|
17311
|
-
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
17312
|
-
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
17313
|
-
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
17314
|
-
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
17369
|
+
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess', _1203 => _1203.minRow]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1204 => _1204.minRow]), () => ( sheetMinUsedRow)), () => ( 0))));
|
|
17370
|
+
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess', _1205 => _1205.minCol]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1206 => _1206.minCol]), () => ( sheetMinUsedCol)), () => ( 0))));
|
|
17371
|
+
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1207 => _1207.maxRow]), () => ( -1)));
|
|
17372
|
+
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1208 => _1208.maxCol]), () => ( -1)));
|
|
17315
17373
|
const showGridLines = _nullishCoalesce(sheet.showGridLines, () => ( true));
|
|
17316
17374
|
const hiddenRowSet = new Set(_nullishCoalesce(sheet.hiddenRows, () => ( [])));
|
|
17317
17375
|
const hiddenColSet = new Set(_nullishCoalesce(sheet.hiddenCols, () => ( [])));
|
|
@@ -17524,8 +17582,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17524
17582
|
return cached;
|
|
17525
17583
|
}
|
|
17526
17584
|
const batchCoversRow = workerRowBatch ? row >= workerRowBatch.startRow && row <= workerRowBatch.endRow : false;
|
|
17527
|
-
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess',
|
|
17528
|
-
if (_optionalChain([batchedCell, 'optionalAccess',
|
|
17585
|
+
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _1209 => _1209.cells, 'access', _1210 => _1210.get, 'call', _1211 => _1211(cacheKey)]) : void 0;
|
|
17586
|
+
if (_optionalChain([batchedCell, 'optionalAccess', _1212 => _1212.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _1213 => _1213.isMergedSecondary, 'call', _1214 => _1214(row, col)])) {
|
|
17529
17587
|
const mergedSecondaryData = {
|
|
17530
17588
|
isMergedSecondary: true,
|
|
17531
17589
|
style: {},
|
|
@@ -17534,23 +17592,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17534
17592
|
cellRenderCache.set(cacheKey, mergedSecondaryData);
|
|
17535
17593
|
return mergedSecondaryData;
|
|
17536
17594
|
}
|
|
17537
|
-
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
17595
|
+
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _1215 => _1215.mergeSpan]);
|
|
17538
17596
|
const inheritedStyle = resolveInheritedCellStyle2(sheet, row, col);
|
|
17539
|
-
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17597
|
+
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1216 => _1216.style]), () => ( null));
|
|
17540
17598
|
const mergedStyle = mergeResolvedCellStyle(inheritedStyle, worksheetStyle, { replaceXfSubtrees: true });
|
|
17541
17599
|
const conditionalCellStyle = resolveConditionalCellStyleForCell(
|
|
17542
17600
|
row,
|
|
17543
17601
|
col,
|
|
17544
17602
|
sheet,
|
|
17545
17603
|
() => worksheet ? getCellNumericValue(worksheet, row, col) : getBatchedCellNumericValue(batchedCell),
|
|
17546
|
-
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17604
|
+
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1217 => _1217.value]), () => ( "")),
|
|
17547
17605
|
worksheet,
|
|
17548
|
-
_optionalChain([workerRowBatch, 'optionalAccess',
|
|
17606
|
+
_optionalChain([workerRowBatch, 'optionalAccess', _1218 => _1218.cells])
|
|
17549
17607
|
);
|
|
17550
17608
|
const finalResolvedStyle = mergeResolvedCellStyle(mergedStyle, conditionalCellStyle);
|
|
17551
|
-
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
17609
|
+
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _1219 => _1219.alignment]);
|
|
17552
17610
|
const sparkline = _nullishCoalesce(sparklineByCell.get(cacheKey), () => ( null));
|
|
17553
|
-
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess',
|
|
17611
|
+
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess', _1220 => _1220.cells, 'access', _1221 => _1221.get, 'call', _1222 => _1222(`${targetRow}:${targetCol}`)]));
|
|
17554
17612
|
const sparklineValues = sparkline ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
|
|
17555
17613
|
{ length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
|
|
17556
17614
|
(_, index) => getNumericValue(
|
|
@@ -17564,23 +17622,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17564
17622
|
sparkline.range.start.col
|
|
17565
17623
|
)
|
|
17566
17624
|
) : null;
|
|
17567
|
-
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
17625
|
+
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _1223 => _1223.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
|
|
17568
17626
|
const nextData = {
|
|
17569
17627
|
canvas: void 0,
|
|
17570
17628
|
checkboxState,
|
|
17571
|
-
colSpan: _optionalChain([merge, 'optionalAccess',
|
|
17629
|
+
colSpan: _optionalChain([merge, 'optionalAccess', _1224 => _1224.colSpan]),
|
|
17572
17630
|
conditionalColorScale: worksheet ? resolveConditionalColorScaleForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17573
17631
|
conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17574
17632
|
conditionalIcon: worksheet ? resolveConditionalIconForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17575
17633
|
isMergedSecondary: false,
|
|
17576
|
-
rowSpan: _optionalChain([merge, 'optionalAccess',
|
|
17634
|
+
rowSpan: _optionalChain([merge, 'optionalAccess', _1225 => _1225.rowSpan]),
|
|
17577
17635
|
sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
|
|
17578
17636
|
style: buildCellStyle(finalResolvedStyle, palette, sheet.themePalette, {
|
|
17579
|
-
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
17637
|
+
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _1226 => _1226.generalAlignment]),
|
|
17580
17638
|
showGridLines
|
|
17581
17639
|
}),
|
|
17582
|
-
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess',
|
|
17583
|
-
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17640
|
+
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1227 => _1227.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1228 => _1228.textRotation])))),
|
|
17641
|
+
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1229 => _1229.value]), () => ( ""))
|
|
17584
17642
|
};
|
|
17585
17643
|
nextData.canvas = buildCanvasCellStyleCache(nextData.style);
|
|
17586
17644
|
cellRenderCache.set(cacheKey, nextData);
|
|
@@ -17598,11 +17656,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17598
17656
|
let height = rowItem.size;
|
|
17599
17657
|
for (let colOffset = 1; colOffset < colSpan; colOffset += 1) {
|
|
17600
17658
|
const nextCol = colItemByActual.get(colItem.actualIndex + colOffset);
|
|
17601
|
-
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess',
|
|
17659
|
+
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _1230 => _1230.size]), () => ( 0));
|
|
17602
17660
|
}
|
|
17603
17661
|
for (let rowOffset = 1; rowOffset < rowSpan; rowOffset += 1) {
|
|
17604
17662
|
const nextRow = rowItemByActual.get(rowItem.actualIndex + rowOffset);
|
|
17605
|
-
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess',
|
|
17663
|
+
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _1231 => _1231.size]), () => ( 0));
|
|
17606
17664
|
}
|
|
17607
17665
|
const rect = {
|
|
17608
17666
|
height,
|
|
@@ -17612,7 +17670,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17612
17670
|
};
|
|
17613
17671
|
const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellData.style)));
|
|
17614
17672
|
const gradientFill = typeof cellData.style.backgroundImage === "string" ? resolveCanvasGradientFill(context, rect, cellData.style.backgroundImage) : null;
|
|
17615
|
-
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access',
|
|
17673
|
+
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _1232 => _1232.conditionalColorScale, 'optionalAccess', _1233 => _1233.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
|
|
17616
17674
|
context.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
|
|
17617
17675
|
context.fillRect(rect.left, rect.top, rect.width, rect.height);
|
|
17618
17676
|
if (cellData.conditionalDataBar) {
|
|
@@ -17856,11 +17914,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17856
17914
|
locale,
|
|
17857
17915
|
workbook
|
|
17858
17916
|
]);
|
|
17859
|
-
const paintThumbnail =
|
|
17860
|
-
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access',
|
|
17917
|
+
const paintThumbnail = React9.useCallback(
|
|
17918
|
+
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _1234 => _1234[sheetIndex], 'optionalAccess', _1235 => _1235.paint, 'call', _1236 => _1236(canvas)]), () => ( false)),
|
|
17861
17919
|
[thumbnails]
|
|
17862
17920
|
);
|
|
17863
|
-
return
|
|
17921
|
+
return React9.useMemo(
|
|
17864
17922
|
() => ({
|
|
17865
17923
|
paintThumbnail,
|
|
17866
17924
|
thumbnails
|
|
@@ -17870,7 +17928,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17870
17928
|
}
|
|
17871
17929
|
function DefaultXlsxToolbar() {
|
|
17872
17930
|
const controller = useXlsxViewer();
|
|
17873
|
-
const { headerBackgroundColor, headerTextColor, isDark } =
|
|
17931
|
+
const { headerBackgroundColor, headerTextColor, isDark } = React9.useContext(ViewerAppearanceContext);
|
|
17874
17932
|
const palette = useViewerPalette(isDark, headerBackgroundColor, headerTextColor);
|
|
17875
17933
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DefaultToolbar, { controller, palette });
|
|
17876
17934
|
}
|
|
@@ -17916,7 +17974,7 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
|
|
|
17916
17974
|
}
|
|
17917
17975
|
destroy() {
|
|
17918
17976
|
this.destroyed = true;
|
|
17919
|
-
_optionalChain([this, 'access',
|
|
17977
|
+
_optionalChain([this, 'access', _1237 => _1237.observer, 'optionalAccess', _1238 => _1238.disconnect, 'call', _1239 => _1239()]);
|
|
17920
17978
|
this.observer = null;
|
|
17921
17979
|
this.slots.clear();
|
|
17922
17980
|
this.listeners.clear();
|
|
@@ -17945,9 +18003,9 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
|
|
|
17945
18003
|
}
|
|
17946
18004
|
}, _class2);
|
|
17947
18005
|
function RuntimeContent({ content }) {
|
|
17948
|
-
const hostRef =
|
|
17949
|
-
const rootRef =
|
|
17950
|
-
|
|
18006
|
+
const hostRef = React10.useRef(null);
|
|
18007
|
+
const rootRef = React10.useRef(null);
|
|
18008
|
+
React10.useLayoutEffect(() => {
|
|
17951
18009
|
const host = hostRef.current;
|
|
17952
18010
|
if (!host) return;
|
|
17953
18011
|
const root = _internal.__createContentRoot.call(void 0, host);
|
|
@@ -17957,8 +18015,8 @@ function RuntimeContent({ content }) {
|
|
|
17957
18015
|
root.destroy();
|
|
17958
18016
|
};
|
|
17959
18017
|
}, []);
|
|
17960
|
-
|
|
17961
|
-
_optionalChain([rootRef, 'access',
|
|
18018
|
+
React10.useLayoutEffect(() => {
|
|
18019
|
+
_optionalChain([rootRef, 'access', _1240 => _1240.current, 'optionalAccess', _1241 => _1241.update, 'call', _1242 => _1242(content)]);
|
|
17962
18020
|
}, [content]);
|
|
17963
18021
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref: hostRef, style: { display: "contents" } });
|
|
17964
18022
|
}
|
|
@@ -17972,6 +18030,8 @@ function renderOptions(props, controller, slots, owner) {
|
|
|
17972
18030
|
loadingComponent,
|
|
17973
18031
|
loadingState,
|
|
17974
18032
|
renderActiveCellOverlay,
|
|
18033
|
+
renderCellEditorOverlay,
|
|
18034
|
+
renderSelectionPopover,
|
|
17975
18035
|
renderChartLoading,
|
|
17976
18036
|
renderContextMenu,
|
|
17977
18037
|
renderFormControl,
|
|
@@ -17992,6 +18052,14 @@ function renderOptions(props, controller, slots, owner) {
|
|
|
17992
18052
|
fileTooLargeState: fileTooLargeState === void 0 ? void 0 : typeof fileTooLargeState === "function" ? ({ defaultNode, ...rest }) => slot("too-large", fileTooLargeState({ ...rest, defaultNode: runtime(defaultNode) })) : slot("too-large", fileTooLargeState),
|
|
17993
18053
|
toolbar: toolbar === void 0 ? void 0 : typeof toolbar === "function" ? (current) => slot("toolbar", toolbar(current)) : slot("toolbar", toolbar),
|
|
17994
18054
|
renderActiveCellOverlay: renderActiveCellOverlay ? (value) => slot(`active:${value.cell.row}:${value.cell.col}`, renderActiveCellOverlay(value)) : void 0,
|
|
18055
|
+
renderSelectionPopover: renderSelectionPopover ? (value) => {
|
|
18056
|
+
const content = renderSelectionPopover(value);
|
|
18057
|
+
return content == null || content === false ? null : slot("selection-popover", content);
|
|
18058
|
+
} : void 0,
|
|
18059
|
+
renderCellEditorOverlay: renderCellEditorOverlay ? (value) => {
|
|
18060
|
+
const content = renderCellEditorOverlay(value);
|
|
18061
|
+
return content == null || content === false ? null : slot("cell-editor-overlay", content);
|
|
18062
|
+
} : void 0,
|
|
17995
18063
|
renderChartLoading: renderChartLoading ? ({ defaultNode, ...value }) => slot(`chart:${value.chart.id}`, renderChartLoading({ ...value, defaultNode: runtime(defaultNode) })) : void 0,
|
|
17996
18064
|
renderContextMenu: renderContextMenu ? ({ defaultNode, ...value }) => slot("context-menu", renderContextMenu({ ...value, defaultNode: runtime(defaultNode) })) : void 0,
|
|
17997
18065
|
renderFormControl: renderFormControl ? (value) => slot(`control:${value.control.id}`, renderFormControl(value)) : void 0,
|
|
@@ -18002,13 +18070,13 @@ function renderOptions(props, controller, slots, owner) {
|
|
|
18002
18070
|
};
|
|
18003
18071
|
}
|
|
18004
18072
|
function BoundViewer({ props, controller: sourceController }) {
|
|
18005
|
-
const messages =
|
|
18006
|
-
const controller =
|
|
18007
|
-
const hostRef =
|
|
18008
|
-
const viewerRef =
|
|
18009
|
-
const slots =
|
|
18010
|
-
|
|
18011
|
-
|
|
18073
|
+
const messages = React10.useMemo(() => _chunkZPDHTVL6cjs.mergeMessages.call(void 0, sourceController.messages, props.messages), [sourceController.messages, props.messages]);
|
|
18074
|
+
const controller = React10.useMemo(() => ({ ...sourceController, messages }), [sourceController, messages]);
|
|
18075
|
+
const hostRef = React10.useRef(null);
|
|
18076
|
+
const viewerRef = React10.useRef(null);
|
|
18077
|
+
const slots = React10.useMemo(() => new SlotStore(), []);
|
|
18078
|
+
React10.useSyncExternalStore(slots.subscribe, slots.getSnapshot, slots.getServerSnapshot);
|
|
18079
|
+
React10.useLayoutEffect(() => {
|
|
18012
18080
|
const host = hostRef.current;
|
|
18013
18081
|
if (!host) return;
|
|
18014
18082
|
slots.observe(host);
|
|
@@ -18020,9 +18088,9 @@ function BoundViewer({ props, controller: sourceController }) {
|
|
|
18020
18088
|
slots.destroy();
|
|
18021
18089
|
};
|
|
18022
18090
|
}, [slots]);
|
|
18023
|
-
|
|
18091
|
+
React10.useLayoutEffect(() => {
|
|
18024
18092
|
const host = hostRef.current;
|
|
18025
|
-
if (host) _optionalChain([viewerRef, 'access',
|
|
18093
|
+
if (host) _optionalChain([viewerRef, 'access', _1243 => _1243.current, 'optionalAccess', _1244 => _1244.update, 'call', _1245 => _1245(renderOptions(props, controller, slots, host.ownerDocument))]);
|
|
18026
18094
|
}, [controller, props, slots]);
|
|
18027
18095
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ViewerAppearanceContext.Provider, { value: {
|
|
18028
18096
|
headerBackgroundColor: props.headerBackgroundColor,
|
|
@@ -18038,7 +18106,7 @@ function UncontrolledViewer(props) {
|
|
|
18038
18106
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BoundViewer, { props, controller });
|
|
18039
18107
|
}
|
|
18040
18108
|
function XlsxViewer(props) {
|
|
18041
|
-
const context =
|
|
18109
|
+
const context = React10.useContext(ViewerContext);
|
|
18042
18110
|
const controller = _nullishCoalesce(props.controller, () => ( context));
|
|
18043
18111
|
return controller ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BoundViewer, { props, controller }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UncontrolledViewer, { ...props });
|
|
18044
18112
|
}
|