@extend-ai/react-xlsx 0.20.10 → 0.20.11
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/{chunk-DWBPSBJ5.cjs → chunk-SXHHFUXA.cjs} +494 -453
- package/dist/chunk-SXHHFUXA.cjs.map +1 -0
- package/dist/{chunk-2QENCJUT.js → chunk-VSM7WKLM.js} +59 -18
- package/dist/chunk-VSM7WKLM.js.map +1 -0
- package/dist/index.cjs +151 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +2 -2
- package/dist/internal.js +1 -1
- package/dist/vanilla.cjs +2 -2
- package/dist/vanilla.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2QENCJUT.js.map +0 -1
- package/dist/chunk-DWBPSBJ5.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -10695,9 +10695,10 @@ function useXlsxViewerController(options) {
|
|
|
10695
10695
|
activeCell,
|
|
10696
10696
|
activeSheetIndex,
|
|
10697
10697
|
bytes: createSavedWorkbookBytes(workbook),
|
|
10698
|
-
selection
|
|
10698
|
+
selection,
|
|
10699
|
+
sortState
|
|
10699
10700
|
};
|
|
10700
|
-
}, [activeCell, activeSheetIndex, createSavedWorkbookBytes, selection, workbook]);
|
|
10701
|
+
}, [activeCell, activeSheetIndex, createSavedWorkbookBytes, selection, sortState, workbook]);
|
|
10701
10702
|
const captureCellMutationState = React.useCallback((cell) => {
|
|
10702
10703
|
const worksheet = getActiveWorksheet();
|
|
10703
10704
|
if (!worksheet) {
|
|
@@ -10737,6 +10738,7 @@ function useXlsxViewerController(options) {
|
|
|
10737
10738
|
}
|
|
10738
10739
|
setActiveCell(entry.activeCell);
|
|
10739
10740
|
setSelection(entry.selection);
|
|
10741
|
+
setSortState(entry.sortState);
|
|
10740
10742
|
selectionAnchorRef.current = entry.selection ? normalizeRange(entry.selection).start : entry.activeCell;
|
|
10741
10743
|
setRevision((current) => current + 1);
|
|
10742
10744
|
}, [setChartAssets, setImageAssets]);
|
|
@@ -10771,6 +10773,7 @@ function useXlsxViewerController(options) {
|
|
|
10771
10773
|
for (const mutation of entry.mutations) {
|
|
10772
10774
|
applyCellMutationState(worksheet, mutation.cell, direction === "undo" ? mutation.before : mutation.after);
|
|
10773
10775
|
}
|
|
10776
|
+
setSortState(direction === "undo" ? entry.sortStateBefore : entry.sortStateAfter);
|
|
10774
10777
|
maybeRecalculateWorkbook(workbook);
|
|
10775
10778
|
refreshWorkbookState(workbook);
|
|
10776
10779
|
const nextActiveCell = direction === "undo" ? entry.activeCellBefore : entry.activeCellAfter;
|
|
@@ -10908,8 +10911,8 @@ function useXlsxViewerController(options) {
|
|
|
10908
10911
|
redoStackRef.current = [];
|
|
10909
10912
|
setHistoryRevision((current) => current + 1);
|
|
10910
10913
|
}, [activeCell, activeSheet, selection]);
|
|
10911
|
-
const recordRangeEditHistory = React.useCallback((mutations, selectionAfter, activeCellAfter) => {
|
|
10912
|
-
if (!activeSheet || isApplyingHistoryRef.current || mutations.length === 0) {
|
|
10914
|
+
const recordRangeEditHistory = React.useCallback((mutations, selectionAfter, activeCellAfter, sortStateAfter = sortState) => {
|
|
10915
|
+
if (!activeSheet || isApplyingHistoryRef.current || mutations.length === 0 && sortStateAfter === sortState) {
|
|
10913
10916
|
return;
|
|
10914
10917
|
}
|
|
10915
10918
|
pushHistoryEntry(undoStackRef.current, {
|
|
@@ -10919,11 +10922,13 @@ function useXlsxViewerController(options) {
|
|
|
10919
10922
|
mutations,
|
|
10920
10923
|
selectionAfter,
|
|
10921
10924
|
selectionBefore: selection,
|
|
10922
|
-
sheetIndex: activeSheet.workbookSheetIndex
|
|
10925
|
+
sheetIndex: activeSheet.workbookSheetIndex,
|
|
10926
|
+
sortStateAfter,
|
|
10927
|
+
sortStateBefore: sortState
|
|
10923
10928
|
});
|
|
10924
10929
|
redoStackRef.current = [];
|
|
10925
10930
|
setHistoryRevision((current) => current + 1);
|
|
10926
|
-
}, [activeCell, activeSheet, selection]);
|
|
10931
|
+
}, [activeCell, activeSheet, selection, sortState]);
|
|
10927
10932
|
const sortTable = React.useCallback((tableName, columnIndex, direction) => {
|
|
10928
10933
|
const worksheet = getActiveWorksheet();
|
|
10929
10934
|
const targetTable = tables.find((table) => table.name === tableName || table.displayName === tableName);
|
|
@@ -10975,8 +10980,13 @@ function useXlsxViewerController(options) {
|
|
|
10975
10980
|
const comparedText = left.sortText.localeCompare(right.sortText, void 0, { numeric: true, sensitivity: "base" });
|
|
10976
10981
|
return direction === "ascending" ? comparedText : -comparedText;
|
|
10977
10982
|
});
|
|
10983
|
+
const nextSortState = { columnIndex, direction, tableName: targetTable.name };
|
|
10978
10984
|
if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access', _1026 => _1026[index], 'optionalAccess', _1027 => _1027.index]))) {
|
|
10979
|
-
|
|
10985
|
+
if (_optionalChain([sortState, 'optionalAccess', _1028 => _1028.tableName]) === targetTable.name && sortState.columnIndex === columnIndex && sortState.direction === direction) {
|
|
10986
|
+
return;
|
|
10987
|
+
}
|
|
10988
|
+
setSortState(nextSortState);
|
|
10989
|
+
recordRangeEditHistory([], selection, activeCell, nextSortState);
|
|
10980
10990
|
return;
|
|
10981
10991
|
}
|
|
10982
10992
|
const mutations = [];
|
|
@@ -11004,8 +11014,8 @@ function useXlsxViewerController(options) {
|
|
|
11004
11014
|
}
|
|
11005
11015
|
maybeRecalculateWorkbook(workbook);
|
|
11006
11016
|
refreshWorkbookState(workbook);
|
|
11007
|
-
setSortState(
|
|
11008
|
-
recordRangeEditHistory(mutations, selection, activeCell);
|
|
11017
|
+
setSortState(nextSortState);
|
|
11018
|
+
recordRangeEditHistory(mutations, selection, activeCell, nextSortState);
|
|
11009
11019
|
}, [
|
|
11010
11020
|
activeCell,
|
|
11011
11021
|
activeSheet,
|
|
@@ -11015,6 +11025,7 @@ function useXlsxViewerController(options) {
|
|
|
11015
11025
|
recordRangeEditHistory,
|
|
11016
11026
|
refreshWorkbookState,
|
|
11017
11027
|
selection,
|
|
11028
|
+
sortState,
|
|
11018
11029
|
tables,
|
|
11019
11030
|
workbook
|
|
11020
11031
|
]);
|
|
@@ -11044,9 +11055,9 @@ function useXlsxViewerController(options) {
|
|
|
11044
11055
|
if (!workbook) {
|
|
11045
11056
|
return;
|
|
11046
11057
|
}
|
|
11047
|
-
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
11058
|
+
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1029 => _1029.name]), () => ( "sheet"));
|
|
11048
11059
|
downloadText(workbook.saveCsvString(), `${fileStem(displayFileName)}-${activeSheetName}.csv`, CSV_MIME_TYPE);
|
|
11049
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
11060
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _1030 => _1030.name]), displayFileName, workbook]);
|
|
11050
11061
|
const recalculate = React.useCallback(() => {
|
|
11051
11062
|
if (!workbook) {
|
|
11052
11063
|
return;
|
|
@@ -11210,10 +11221,10 @@ function useXlsxViewerController(options) {
|
|
|
11210
11221
|
const currentChart = getChartById(id);
|
|
11211
11222
|
console.info("[react-xlsx debug] currentChart", {
|
|
11212
11223
|
activeWorkbookSheetIndex: activeSheet.workbookSheetIndex,
|
|
11213
|
-
editable: _optionalChain([currentChart, 'optionalAccess',
|
|
11224
|
+
editable: _optionalChain([currentChart, 'optionalAccess', _1031 => _1031.editable]),
|
|
11214
11225
|
found: Boolean(currentChart),
|
|
11215
11226
|
originCount: hydratedChartAssets.chartOriginsById.size,
|
|
11216
|
-
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess',
|
|
11227
|
+
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess', _1032 => _1032.workbookSheetIndex])
|
|
11217
11228
|
});
|
|
11218
11229
|
if (!currentChart || currentChart.editable === false || currentChart.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
|
|
11219
11230
|
return;
|
|
@@ -11221,8 +11232,8 @@ function useXlsxViewerController(options) {
|
|
|
11221
11232
|
const nextAnchor = rectToImageAnchor(rect, currentChart.anchor, {
|
|
11222
11233
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
11223
11234
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
11224
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11225
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11235
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1033 => _1033.columnWidths, 'access', _1034 => _1034[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
11236
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1035 => _1035.rowHeights, 'access', _1036 => _1036[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
11226
11237
|
});
|
|
11227
11238
|
recordHistoryBeforeMutation();
|
|
11228
11239
|
const didUpdateAnchor = updateWorkbookChartAnchor(imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
|
|
@@ -11253,8 +11264,8 @@ function useXlsxViewerController(options) {
|
|
|
11253
11264
|
const nextAnchor = rectToImageAnchor(rect, currentImage.anchor, {
|
|
11254
11265
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
11255
11266
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
11256
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11257
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11267
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1037 => _1037.columnWidths, 'access', _1038 => _1038[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
11268
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1039 => _1039.rowHeights, 'access', _1040 => _1040[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
11258
11269
|
});
|
|
11259
11270
|
recordHistoryBeforeMutation();
|
|
11260
11271
|
if (!updateWorkbookImageAnchor(imageAssetsRef.current, id, nextAnchor)) {
|
|
@@ -11433,7 +11444,7 @@ function useXlsxViewerController(options) {
|
|
|
11433
11444
|
setSelectedChartElement(null);
|
|
11434
11445
|
setSelectedImageId(null);
|
|
11435
11446
|
setActiveCell(cell);
|
|
11436
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
11447
|
+
if (_optionalChain([options2, 'optionalAccess', _1041 => _1041.extend]) && selectionAnchorRef.current) {
|
|
11437
11448
|
setSelection(normalizeRange({ start: selectionAnchorRef.current, end: cell }));
|
|
11438
11449
|
return;
|
|
11439
11450
|
}
|
|
@@ -11576,7 +11587,7 @@ function useXlsxViewerController(options) {
|
|
|
11576
11587
|
setCellFormula(activeCell, formula);
|
|
11577
11588
|
}, [activeCell, setCellFormula]);
|
|
11578
11589
|
const setSelectedFormula = React.useCallback((formula) => {
|
|
11579
|
-
if (_optionalChain([selectedFormulaTarget, 'optionalAccess',
|
|
11590
|
+
if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _1042 => _1042.kind]) === "chartSeries") {
|
|
11580
11591
|
return setChartSeriesFormula(selectedFormulaTarget.chartId, selectedFormulaTarget.seriesIndex, formula);
|
|
11581
11592
|
}
|
|
11582
11593
|
if (!activeCell) {
|
|
@@ -11738,7 +11749,7 @@ function useXlsxViewerController(options) {
|
|
|
11738
11749
|
return;
|
|
11739
11750
|
}
|
|
11740
11751
|
recordHistoryBeforeMutation();
|
|
11741
|
-
const baseName = _optionalChain([name, 'optionalAccess',
|
|
11752
|
+
const baseName = _optionalChain([name, 'optionalAccess', _1043 => _1043.trim, 'call', _1044 => _1044()]) || "Sheet";
|
|
11742
11753
|
let candidate = baseName;
|
|
11743
11754
|
let counter = 2;
|
|
11744
11755
|
while (workbook.sheetIndex(candidate) !== void 0) {
|
|
@@ -11758,11 +11769,11 @@ function useXlsxViewerController(options) {
|
|
|
11758
11769
|
}
|
|
11759
11770
|
const nextSheets = buildSheetList(
|
|
11760
11771
|
workbook,
|
|
11761
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11762
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11763
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11764
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11765
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11772
|
+
_optionalChain([imageAssetsRef, 'access', _1045 => _1045.current, 'optionalAccess', _1046 => _1046.sheetStatesByWorkbookSheetIndex]),
|
|
11773
|
+
_optionalChain([imageAssetsRef, 'access', _1047 => _1047.current, 'optionalAccess', _1048 => _1048.themePalette]),
|
|
11774
|
+
_optionalChain([imageAssetsRef, 'access', _1049 => _1049.current, 'optionalAccess', _1050 => _1050.styleById]),
|
|
11775
|
+
_optionalChain([imageAssetsRef, 'access', _1051 => _1051.current, 'optionalAccess', _1052 => _1052.namedCellStyleByName]),
|
|
11776
|
+
_optionalChain([imageAssetsRef, 'access', _1053 => _1053.current, 'optionalAccess', _1054 => _1054.tableStyleByName]),
|
|
11766
11777
|
showHiddenSheets
|
|
11767
11778
|
);
|
|
11768
11779
|
setSheets(nextSheets);
|
|
@@ -11772,7 +11783,7 @@ function useXlsxViewerController(options) {
|
|
|
11772
11783
|
}
|
|
11773
11784
|
const nextIndex = nextSheets.findIndex((sheet) => sheet.name === candidate);
|
|
11774
11785
|
setActiveSheetIndexState(nextIndex >= 0 ? nextIndex : 0);
|
|
11775
|
-
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess',
|
|
11786
|
+
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _1055 => _1055.tabs, 'access', _1056 => _1056.findIndex, 'call', _1057 => _1057((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
|
|
11776
11787
|
if (nextTabIndex >= 0) {
|
|
11777
11788
|
setActiveTabIndexState(nextTabIndex);
|
|
11778
11789
|
}
|
|
@@ -11798,11 +11809,11 @@ function useXlsxViewerController(options) {
|
|
|
11798
11809
|
}
|
|
11799
11810
|
const nextSheets = buildSheetList(
|
|
11800
11811
|
workbook,
|
|
11801
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11802
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11803
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11804
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11805
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11812
|
+
_optionalChain([imageAssetsRef, 'access', _1058 => _1058.current, 'optionalAccess', _1059 => _1059.sheetStatesByWorkbookSheetIndex]),
|
|
11813
|
+
_optionalChain([imageAssetsRef, 'access', _1060 => _1060.current, 'optionalAccess', _1061 => _1061.themePalette]),
|
|
11814
|
+
_optionalChain([imageAssetsRef, 'access', _1062 => _1062.current, 'optionalAccess', _1063 => _1063.styleById]),
|
|
11815
|
+
_optionalChain([imageAssetsRef, 'access', _1064 => _1064.current, 'optionalAccess', _1065 => _1065.namedCellStyleByName]),
|
|
11816
|
+
_optionalChain([imageAssetsRef, 'access', _1066 => _1066.current, 'optionalAccess', _1067 => _1067.tableStyleByName]),
|
|
11806
11817
|
showHiddenSheets
|
|
11807
11818
|
);
|
|
11808
11819
|
setSheets(nextSheets);
|
|
@@ -11830,7 +11841,7 @@ function useXlsxViewerController(options) {
|
|
|
11830
11841
|
}, [readOnly, recordHistoryBeforeMutation, selection, workbook]);
|
|
11831
11842
|
const pasteText = React.useCallback((text) => {
|
|
11832
11843
|
const worksheet = getActiveWorksheet();
|
|
11833
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
11844
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _1068 => _1068.start]))), () => ( null));
|
|
11834
11845
|
if (readOnly || !worksheet || !workbook || !targetCell || !text) {
|
|
11835
11846
|
return false;
|
|
11836
11847
|
}
|
|
@@ -11898,7 +11909,7 @@ function useXlsxViewerController(options) {
|
|
|
11898
11909
|
}, [activeCell, captureCellMutationState, getActiveWorksheet, locale, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
|
|
11899
11910
|
const pasteStructuredClipboardData = React.useCallback((serializedPayload) => {
|
|
11900
11911
|
const worksheet = getActiveWorksheet();
|
|
11901
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
11912
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _1069 => _1069.start]))), () => ( null));
|
|
11902
11913
|
if (readOnly || !worksheet || !workbook || !targetCell || !serializedPayload) {
|
|
11903
11914
|
return false;
|
|
11904
11915
|
}
|
|
@@ -12430,8 +12441,8 @@ function CellEditor({
|
|
|
12430
12441
|
const [bounds, setBounds] = React2.useState({ width: 0, height: 0 });
|
|
12431
12442
|
React2.useLayoutEffect(() => {
|
|
12432
12443
|
const root = rootRef.current;
|
|
12433
|
-
const anchor = _optionalChain([root, 'optionalAccess',
|
|
12434
|
-
const viewport = _optionalChain([root, 'optionalAccess',
|
|
12444
|
+
const anchor = _optionalChain([root, 'optionalAccess', _1070 => _1070.parentElement]);
|
|
12445
|
+
const viewport = _optionalChain([root, 'optionalAccess', _1071 => _1071.closest, 'call', _1072 => _1072('[role="grid"]')]);
|
|
12435
12446
|
if (!root || !anchor || !viewport) {
|
|
12436
12447
|
return;
|
|
12437
12448
|
}
|
|
@@ -12494,8 +12505,8 @@ function CellEditor({
|
|
|
12494
12505
|
const canvas = canvasRef.current;
|
|
12495
12506
|
if (canvas && paintCanvasText) {
|
|
12496
12507
|
const dpr = window.devicePixelRatio || 1;
|
|
12497
|
-
const offsetX = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess',
|
|
12498
|
-
const offsetY = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess',
|
|
12508
|
+
const offsetX = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _1073 => _1073.left]), () => ( 0))) * dpr % 1 / dpr;
|
|
12509
|
+
const offsetY = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _1074 => _1074.top]), () => ( 0))) * dpr % 1 / dpr;
|
|
12499
12510
|
const width = rootRect.width / scale;
|
|
12500
12511
|
const height = rootRect.height / scale;
|
|
12501
12512
|
canvas.width = Math.ceil((width + offsetX) * dpr);
|
|
@@ -12506,11 +12517,11 @@ function CellEditor({
|
|
|
12506
12517
|
canvas.style.top = `${-offsetY}px`;
|
|
12507
12518
|
const context = canvas.getContext("2d");
|
|
12508
12519
|
if (context) {
|
|
12509
|
-
const node = _optionalChain([plainTextRef, 'access',
|
|
12520
|
+
const node = _optionalChain([plainTextRef, 'access', _1075 => _1075.current, 'optionalAccess', _1076 => _1076.firstChild]);
|
|
12510
12521
|
const lines = [];
|
|
12511
12522
|
if (node) {
|
|
12512
12523
|
const range = document.createRange();
|
|
12513
|
-
const length = _nullishCoalesce(_optionalChain([node, 'access',
|
|
12524
|
+
const length = _nullishCoalesce(_optionalChain([node, 'access', _1077 => _1077.textContent, 'optionalAccess', _1078 => _1078.length]), () => ( 0));
|
|
12514
12525
|
let start = 0;
|
|
12515
12526
|
while (start < length) {
|
|
12516
12527
|
range.setStart(node, start);
|
|
@@ -13294,7 +13305,7 @@ function parseCanvasGradientStops(value) {
|
|
|
13294
13305
|
if (!match) {
|
|
13295
13306
|
return null;
|
|
13296
13307
|
}
|
|
13297
|
-
const color = _optionalChain([match, 'access',
|
|
13308
|
+
const color = _optionalChain([match, 'access', _1079 => _1079[1], 'optionalAccess', _1080 => _1080.trim, 'call', _1081 => _1081()]);
|
|
13298
13309
|
const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
|
|
13299
13310
|
if (!color) {
|
|
13300
13311
|
return null;
|
|
@@ -13310,7 +13321,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
13310
13321
|
if (linearMatch) {
|
|
13311
13322
|
const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
|
|
13312
13323
|
if (parts.length >= 2) {
|
|
13313
|
-
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access',
|
|
13324
|
+
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _1082 => _1082[0], 'optionalAccess', _1083 => _1083.trim, 'call', _1084 => _1084()]), () => ( "180deg"));
|
|
13314
13325
|
const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
|
|
13315
13326
|
const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
|
|
13316
13327
|
const radians = (90 - cssAngle) * Math.PI / 180;
|
|
@@ -13340,7 +13351,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
13340
13351
|
const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
|
|
13341
13352
|
if (radialMatch) {
|
|
13342
13353
|
const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
|
|
13343
|
-
const stopParts = _optionalChain([parts, 'access',
|
|
13354
|
+
const stopParts = _optionalChain([parts, 'access', _1085 => _1085[0], 'optionalAccess', _1086 => _1086.startsWith, 'call', _1087 => _1087("circle")]) ? parts.slice(1) : parts;
|
|
13344
13355
|
const gradient = context.createRadialGradient(
|
|
13345
13356
|
rect.left + rect.width / 2,
|
|
13346
13357
|
rect.top + rect.height / 2,
|
|
@@ -13464,7 +13475,7 @@ function resolveDarkModeSurface(themePalette, palette) {
|
|
|
13464
13475
|
return "hsl(225 4% 6%)";
|
|
13465
13476
|
}
|
|
13466
13477
|
function resolveSheetSurface(sheet, palette) {
|
|
13467
|
-
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess',
|
|
13478
|
+
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _1088 => _1088.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1089 => _1089.themePalette, 'access', _1090 => _1090.colorsByIndex, 'access', _1091 => _1091[0]]), () => ( SHEET_SURFACE));
|
|
13468
13479
|
}
|
|
13469
13480
|
function normalizeRange2(range) {
|
|
13470
13481
|
return {
|
|
@@ -13496,7 +13507,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
|
|
|
13496
13507
|
const visible2 = [];
|
|
13497
13508
|
const usedLimit = Math.min(displayLimit, Math.max(0, maxUsedIndex + 1));
|
|
13498
13509
|
for (let index = 0; index < usedLimit; index += 1) {
|
|
13499
|
-
if (!_optionalChain([hiddenIndices, 'optionalAccess',
|
|
13510
|
+
if (!_optionalChain([hiddenIndices, 'optionalAccess', _1092 => _1092.has, 'call', _1093 => _1093(index)])) {
|
|
13500
13511
|
visible2.push(index);
|
|
13501
13512
|
}
|
|
13502
13513
|
}
|
|
@@ -13538,7 +13549,7 @@ function clampPercent(value, fallback) {
|
|
|
13538
13549
|
return Math.max(0, Math.min(100, value));
|
|
13539
13550
|
}
|
|
13540
13551
|
function resolveShapeAdjustment(shape, name, fallback) {
|
|
13541
|
-
const rawValue = _optionalChain([shape, 'access',
|
|
13552
|
+
const rawValue = _optionalChain([shape, 'access', _1094 => _1094.geometryAdjustments, 'optionalAccess', _1095 => _1095[name]]);
|
|
13542
13553
|
if (typeof rawValue !== "number") {
|
|
13543
13554
|
return fallback;
|
|
13544
13555
|
}
|
|
@@ -14438,8 +14449,8 @@ function normalizeThumbnailResolution(resolution) {
|
|
|
14438
14449
|
}
|
|
14439
14450
|
const resolvedObject = typeof resolution === "object" && resolution ? resolution : void 0;
|
|
14440
14451
|
return {
|
|
14441
|
-
maxHeight: _optionalChain([resolvedObject, 'optionalAccess',
|
|
14442
|
-
maxWidth: _optionalChain([resolvedObject, 'optionalAccess',
|
|
14452
|
+
maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _1096 => _1096.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
|
|
14453
|
+
maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _1097 => _1097.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
|
|
14443
14454
|
};
|
|
14444
14455
|
}
|
|
14445
14456
|
function resolveThumbnailOutputSize(sourceWidth, sourceHeight, resolution) {
|
|
@@ -14758,24 +14769,24 @@ function escapeCssFontFamily(name) {
|
|
|
14758
14769
|
return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
|
|
14759
14770
|
}
|
|
14760
14771
|
function resolveSpreadsheetThemeFont(font, themePalette) {
|
|
14761
|
-
const scheme = typeof _optionalChain([font, 'optionalAccess',
|
|
14772
|
+
const scheme = typeof _optionalChain([font, 'optionalAccess', _1098 => _1098.scheme]) === "string" ? font.scheme : null;
|
|
14762
14773
|
if (scheme === "major") {
|
|
14763
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
14774
|
+
return _optionalChain([themePalette, 'optionalAccess', _1099 => _1099.majorLatinFont]);
|
|
14764
14775
|
}
|
|
14765
14776
|
if (scheme === "minor") {
|
|
14766
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
14777
|
+
return _optionalChain([themePalette, 'optionalAccess', _1100 => _1100.minorLatinFont]);
|
|
14767
14778
|
}
|
|
14768
14779
|
return void 0;
|
|
14769
14780
|
}
|
|
14770
14781
|
function buildSpreadsheetFontFamily(font, themePalette) {
|
|
14771
14782
|
const candidates = [
|
|
14772
|
-
typeof _optionalChain([font, 'optionalAccess',
|
|
14773
|
-
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call',
|
|
14783
|
+
typeof _optionalChain([font, 'optionalAccess', _1101 => _1101.name]) === "string" ? font.name.trim() : "",
|
|
14784
|
+
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _1102 => _1102(font, themePalette), 'optionalAccess', _1103 => _1103.trim, 'call', _1104 => _1104()]), () => ( ""))
|
|
14774
14785
|
].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
|
|
14775
14786
|
if (candidates.length === 0) {
|
|
14776
14787
|
return void 0;
|
|
14777
14788
|
}
|
|
14778
|
-
const primaryFont = _optionalChain([candidates, 'access',
|
|
14789
|
+
const primaryFont = _optionalChain([candidates, 'access', _1105 => _1105[0], 'optionalAccess', _1106 => _1106.toLowerCase, 'call', _1107 => _1107()]);
|
|
14779
14790
|
if (primaryFont === "calibri") {
|
|
14780
14791
|
return [
|
|
14781
14792
|
"Calibri",
|
|
@@ -14808,17 +14819,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
|
|
|
14808
14819
|
}
|
|
14809
14820
|
function buildGridlineShadow(color, options) {
|
|
14810
14821
|
const parts = [];
|
|
14811
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
14822
|
+
if (_optionalChain([options, 'optionalAccess', _1108 => _1108.right]) !== false) {
|
|
14812
14823
|
parts.push(`inset -1px 0 0 ${color}`);
|
|
14813
14824
|
}
|
|
14814
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
14825
|
+
if (_optionalChain([options, 'optionalAccess', _1109 => _1109.bottom]) !== false) {
|
|
14815
14826
|
parts.push(`inset 0 -1px 0 ${color}`);
|
|
14816
14827
|
}
|
|
14817
14828
|
return parts.join(", ");
|
|
14818
14829
|
}
|
|
14819
14830
|
function buildCellStyle(style, palette, themePalette, options) {
|
|
14820
|
-
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
14821
|
-
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess',
|
|
14831
|
+
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1110 => _1110.showGridLines]), () => ( true));
|
|
14832
|
+
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _1111 => _1111.colorsByIndex, 'access', _1112 => _1112[0]]), () => ( SHEET_SURFACE));
|
|
14822
14833
|
const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
|
|
14823
14834
|
const css = {
|
|
14824
14835
|
backgroundColor: baseSurface,
|
|
@@ -14831,7 +14842,7 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
14831
14842
|
lineHeight: String(resolveSpreadsheetLineHeight(11)),
|
|
14832
14843
|
overflow: "hidden",
|
|
14833
14844
|
padding: DEFAULT_CELL_PADDING,
|
|
14834
|
-
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
14845
|
+
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1113 => _1113.generalAlignment]), () => ( "left")),
|
|
14835
14846
|
textOverflow: "clip",
|
|
14836
14847
|
verticalAlign: "bottom",
|
|
14837
14848
|
whiteSpace: "nowrap"
|
|
@@ -14915,24 +14926,24 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
14915
14926
|
}
|
|
14916
14927
|
const border = style.border;
|
|
14917
14928
|
if (border) {
|
|
14918
|
-
const hasRightBorder = Boolean(_optionalChain([border, 'access',
|
|
14919
|
-
const hasBottomBorder = Boolean(_optionalChain([border, 'access',
|
|
14929
|
+
const hasRightBorder = Boolean(_optionalChain([border, 'access', _1114 => _1114.right, 'optionalAccess', _1115 => _1115.style]) && border.right.style !== "none");
|
|
14930
|
+
const hasBottomBorder = Boolean(_optionalChain([border, 'access', _1116 => _1116.bottom, 'optionalAccess', _1117 => _1117.style]) && border.bottom.style !== "none");
|
|
14920
14931
|
if (showGridLines && (hasRightBorder || hasBottomBorder)) {
|
|
14921
14932
|
css.boxShadow = buildGridlineShadow(palette.border, {
|
|
14922
14933
|
bottom: !hasBottomBorder,
|
|
14923
14934
|
right: !hasRightBorder
|
|
14924
14935
|
}) || void 0;
|
|
14925
14936
|
}
|
|
14926
|
-
if (_optionalChain([border, 'access',
|
|
14937
|
+
if (_optionalChain([border, 'access', _1118 => _1118.top, 'optionalAccess', _1119 => _1119.style]) && border.top.style !== "none") {
|
|
14927
14938
|
css.borderTop = mapBorder2(border.top, themePalette);
|
|
14928
14939
|
}
|
|
14929
|
-
if (_optionalChain([border, 'access',
|
|
14940
|
+
if (_optionalChain([border, 'access', _1120 => _1120.right, 'optionalAccess', _1121 => _1121.style]) && border.right.style !== "none") {
|
|
14930
14941
|
css.borderRight = mapBorder2(border.right, themePalette);
|
|
14931
14942
|
}
|
|
14932
|
-
if (_optionalChain([border, 'access',
|
|
14943
|
+
if (_optionalChain([border, 'access', _1122 => _1122.bottom, 'optionalAccess', _1123 => _1123.style]) && border.bottom.style !== "none") {
|
|
14933
14944
|
css.borderBottom = mapBorder2(border.bottom, themePalette);
|
|
14934
14945
|
}
|
|
14935
|
-
if (_optionalChain([border, 'access',
|
|
14946
|
+
if (_optionalChain([border, 'access', _1124 => _1124.left, 'optionalAccess', _1125 => _1125.style]) && border.left.style !== "none") {
|
|
14936
14947
|
css.borderLeft = mapBorder2(border.left, themePalette);
|
|
14937
14948
|
}
|
|
14938
14949
|
}
|
|
@@ -14978,7 +14989,7 @@ function measureTextWidth(value, style) {
|
|
|
14978
14989
|
}
|
|
14979
14990
|
function getCellDisplayValue(worksheet, row, col, activeSheet, locale = "en-US") {
|
|
14980
14991
|
const formula = worksheet.getFormulaAt(row, col);
|
|
14981
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
14992
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _1126 => _1126.cachedFormulaValues, 'optionalAccess', _1127 => _1127[cellAddressToA12({ row, col })]]) : void 0;
|
|
14982
14993
|
const formatted = worksheet.getFormattedValueAt(row, col);
|
|
14983
14994
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
14984
14995
|
return localizeCellNumber(worksheet, row, col, decodeHtmlEntities2(formatted), locale);
|
|
@@ -15225,7 +15236,7 @@ function normalizeBatchedMergeSpan(value) {
|
|
|
15225
15236
|
}
|
|
15226
15237
|
function normalizeBatchedCellValue(rawValue, formula, row, col, activeSheet) {
|
|
15227
15238
|
const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
|
|
15228
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
15239
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _1128 => _1128.cachedFormulaValues, 'optionalAccess', _1129 => _1129[cellAddressToA12({ row, col })]]) : void 0;
|
|
15229
15240
|
if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
|
|
15230
15241
|
return cachedFormulaValue;
|
|
15231
15242
|
}
|
|
@@ -15272,31 +15283,31 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
15272
15283
|
..._nullishCoalesce(base, () => ( {})),
|
|
15273
15284
|
..._nullishCoalesce(overlay, () => ( {}))
|
|
15274
15285
|
};
|
|
15275
|
-
const baseAlignment = _optionalChain([base, 'optionalAccess',
|
|
15276
|
-
const overlayAlignment = _optionalChain([overlay, 'optionalAccess',
|
|
15286
|
+
const baseAlignment = _optionalChain([base, 'optionalAccess', _1130 => _1130.alignment]);
|
|
15287
|
+
const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _1131 => _1131.alignment]);
|
|
15277
15288
|
if (baseAlignment || overlayAlignment) {
|
|
15278
15289
|
nextStyle.alignment = {
|
|
15279
15290
|
..._nullishCoalesce(baseAlignment, () => ( {})),
|
|
15280
15291
|
..._nullishCoalesce(overlayAlignment, () => ( {}))
|
|
15281
15292
|
};
|
|
15282
15293
|
}
|
|
15283
|
-
const baseBorder = _optionalChain([base, 'optionalAccess',
|
|
15284
|
-
const overlayBorder = _optionalChain([overlay, 'optionalAccess',
|
|
15294
|
+
const baseBorder = _optionalChain([base, 'optionalAccess', _1132 => _1132.border]);
|
|
15295
|
+
const overlayBorder = _optionalChain([overlay, 'optionalAccess', _1133 => _1133.border]);
|
|
15285
15296
|
if (baseBorder || overlayBorder) {
|
|
15286
|
-
nextStyle.border = _optionalChain([options, 'optionalAccess',
|
|
15297
|
+
nextStyle.border = _optionalChain([options, 'optionalAccess', _1134 => _1134.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
|
|
15287
15298
|
..._nullishCoalesce(baseBorder, () => ( {})),
|
|
15288
15299
|
..._nullishCoalesce(overlayBorder, () => ( {}))
|
|
15289
15300
|
};
|
|
15290
15301
|
}
|
|
15291
|
-
const baseFill = _optionalChain([base, 'optionalAccess',
|
|
15292
|
-
const overlayFill = _optionalChain([overlay, 'optionalAccess',
|
|
15302
|
+
const baseFill = _optionalChain([base, 'optionalAccess', _1135 => _1135.fill]);
|
|
15303
|
+
const overlayFill = _optionalChain([overlay, 'optionalAccess', _1136 => _1136.fill]);
|
|
15293
15304
|
if (baseFill || overlayFill) {
|
|
15294
|
-
nextStyle.fill = _optionalChain([options, 'optionalAccess',
|
|
15305
|
+
nextStyle.fill = _optionalChain([options, 'optionalAccess', _1137 => _1137.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
|
|
15295
15306
|
}
|
|
15296
|
-
const baseFont = _optionalChain([base, 'optionalAccess',
|
|
15297
|
-
const overlayFont = _optionalChain([overlay, 'optionalAccess',
|
|
15307
|
+
const baseFont = _optionalChain([base, 'optionalAccess', _1138 => _1138.font]);
|
|
15308
|
+
const overlayFont = _optionalChain([overlay, 'optionalAccess', _1139 => _1139.font]);
|
|
15298
15309
|
if (baseFont || overlayFont) {
|
|
15299
|
-
nextStyle.font = _optionalChain([options, 'optionalAccess',
|
|
15310
|
+
nextStyle.font = _optionalChain([options, 'optionalAccess', _1140 => _1140.replaceXfSubtrees]) && overlayFont ? overlayFont : {
|
|
15300
15311
|
..._nullishCoalesce(baseFont, () => ( {})),
|
|
15301
15312
|
..._nullishCoalesce(overlayFont, () => ( {}))
|
|
15302
15313
|
};
|
|
@@ -15652,11 +15663,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
|
|
|
15652
15663
|
return literal;
|
|
15653
15664
|
}
|
|
15654
15665
|
const splitReference = splitSheetFormulaReference(normalized);
|
|
15655
|
-
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
15656
|
-
if (targetSheetName && _optionalChain([sheet, 'optionalAccess',
|
|
15666
|
+
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _1141 => _1141.sheetName]), () => ( null));
|
|
15667
|
+
if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _1142 => _1142.name]) && targetSheetName !== sheet.name) {
|
|
15657
15668
|
return literal;
|
|
15658
15669
|
}
|
|
15659
|
-
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
15670
|
+
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _1143 => _1143.range]), () => ( normalized));
|
|
15660
15671
|
const cell = parseA1CellReference3(cellRef.replace(/\$/g, ""));
|
|
15661
15672
|
if (!cell) {
|
|
15662
15673
|
return literal;
|
|
@@ -15688,8 +15699,8 @@ function normalizeConditionalTextOperand(value) {
|
|
|
15688
15699
|
}
|
|
15689
15700
|
function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
|
|
15690
15701
|
const normalizedRuleType = rule.ruleType.trim().toLowerCase();
|
|
15691
|
-
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
15692
|
-
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
15702
|
+
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _1144 => _1144.formulas, 'optionalAccess', _1145 => _1145[0]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
15703
|
+
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _1146 => _1146.formulas, 'optionalAccess', _1147 => _1147[1]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
15693
15704
|
if (normalizedRuleType === "cellis") {
|
|
15694
15705
|
return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
|
|
15695
15706
|
}
|
|
@@ -15720,7 +15731,7 @@ function getStyledConditionalRules(rules) {
|
|
|
15720
15731
|
return styledRules;
|
|
15721
15732
|
}
|
|
15722
15733
|
function resolveConditionalCellStyleForCell(row, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
|
|
15723
|
-
const rules = _optionalChain([sheet, 'optionalAccess',
|
|
15734
|
+
const rules = _optionalChain([sheet, 'optionalAccess', _1148 => _1148.conditionalFormatRules]);
|
|
15724
15735
|
if (!sheet || !rules || rules.length === 0) {
|
|
15725
15736
|
return null;
|
|
15726
15737
|
}
|
|
@@ -15924,11 +15935,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15924
15935
|
if (shape.paragraphs.length === 0) {
|
|
15925
15936
|
return;
|
|
15926
15937
|
}
|
|
15927
|
-
const inset = _optionalChain([shape, 'access',
|
|
15928
|
-
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15929
|
-
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15930
|
-
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15931
|
-
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess',
|
|
15938
|
+
const inset = _optionalChain([shape, 'access', _1149 => _1149.textBox, 'optionalAccess', _1150 => _1150.insetPx]);
|
|
15939
|
+
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1151 => _1151.left]), () => ( 6))) * zoomFactor;
|
|
15940
|
+
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1152 => _1152.right]), () => ( 6))) * zoomFactor;
|
|
15941
|
+
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1153 => _1153.top]), () => ( 4))) * zoomFactor;
|
|
15942
|
+
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1154 => _1154.bottom]), () => ( 4))) * zoomFactor;
|
|
15932
15943
|
const textLeft = left + paddingLeft;
|
|
15933
15944
|
const textTop = top + paddingTop;
|
|
15934
15945
|
const textWidth = Math.max(0, width - paddingLeft - paddingRight);
|
|
@@ -15950,9 +15961,9 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15950
15961
|
});
|
|
15951
15962
|
const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
|
|
15952
15963
|
let y = textTop;
|
|
15953
|
-
if (_optionalChain([shape, 'access',
|
|
15964
|
+
if (_optionalChain([shape, 'access', _1155 => _1155.textBox, 'optionalAccess', _1156 => _1156.verticalAlign]) === "middle") {
|
|
15954
15965
|
y = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
|
|
15955
|
-
} else if (_optionalChain([shape, 'access',
|
|
15966
|
+
} else if (_optionalChain([shape, 'access', _1157 => _1157.textBox, 'optionalAccess', _1158 => _1158.verticalAlign]) === "bottom") {
|
|
15956
15967
|
y = textTop + Math.max(0, textHeight - totalTextHeight);
|
|
15957
15968
|
}
|
|
15958
15969
|
context.save();
|
|
@@ -15963,7 +15974,7 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15963
15974
|
shape.paragraphs.forEach((paragraph, paragraphIndex) => {
|
|
15964
15975
|
const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
|
|
15965
15976
|
let x = textLeft;
|
|
15966
|
-
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access',
|
|
15977
|
+
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _1159 => _1159.textBox, 'optionalAccess', _1160 => _1160.horizontalAlign]))), () => ( "left"));
|
|
15967
15978
|
if (align === "center") {
|
|
15968
15979
|
x = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
|
|
15969
15980
|
} else if (align === "right") {
|
|
@@ -15992,11 +16003,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15992
16003
|
context.restore();
|
|
15993
16004
|
}
|
|
15994
16005
|
function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
15995
|
-
const fillColor = _optionalChain([shape, 'access',
|
|
15996
|
-
const strokeColor = _optionalChain([shape, 'access',
|
|
15997
|
-
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access',
|
|
16006
|
+
const fillColor = _optionalChain([shape, 'access', _1161 => _1161.fill, 'optionalAccess', _1162 => _1162.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1163 => _1163.fill, 'optionalAccess', _1164 => _1164.color]), () => ( "transparent"));
|
|
16007
|
+
const strokeColor = _optionalChain([shape, 'access', _1165 => _1165.stroke, 'optionalAccess', _1166 => _1166.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1167 => _1167.stroke, 'optionalAccess', _1168 => _1168.color]), () => ( "transparent"));
|
|
16008
|
+
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _1169 => _1169.stroke, 'optionalAccess', _1170 => _1170.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
|
|
15998
16009
|
const vectorShape = resolveShapeVector(shape);
|
|
15999
|
-
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access',
|
|
16010
|
+
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _1171 => _1171.fill, 'optionalAccess', _1172 => _1172.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _1173 => _1173.stroke, 'optionalAccess', _1174 => _1174.opacity]), () => ( 1)));
|
|
16000
16011
|
context.save();
|
|
16001
16012
|
context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
16002
16013
|
if (shape.rotationDeg) {
|
|
@@ -16007,7 +16018,7 @@ function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
|
16007
16018
|
context.lineWidth = lineWidth;
|
|
16008
16019
|
context.strokeStyle = strokeColor;
|
|
16009
16020
|
context.fillStyle = fillColor;
|
|
16010
|
-
applyCanvasShapeDash(context, _optionalChain([shape, 'access',
|
|
16021
|
+
applyCanvasShapeDash(context, _optionalChain([shape, 'access', _1175 => _1175.stroke, 'optionalAccess', _1176 => _1176.dash]), lineWidth);
|
|
16011
16022
|
const localLeft = -rect.width / 2;
|
|
16012
16023
|
const localTop = -rect.height / 2;
|
|
16013
16024
|
if (vectorShape && typeof Path2D !== "undefined") {
|
|
@@ -16144,7 +16155,7 @@ function drawStaticFormControl(context, control, rect, palette, zoomFactor, shee
|
|
|
16144
16155
|
context.restore();
|
|
16145
16156
|
}
|
|
16146
16157
|
function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16147
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16158
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1177 => _1177.conditionalFormatRules]), () => ( []));
|
|
16148
16159
|
const matchingRule = rules.find(
|
|
16149
16160
|
(rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16150
16161
|
);
|
|
@@ -16182,23 +16193,23 @@ function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCac
|
|
|
16182
16193
|
const span = maxValue - minValue;
|
|
16183
16194
|
const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
|
|
16184
16195
|
const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
|
|
16185
|
-
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess',
|
|
16196
|
+
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _1178 => _1178.themePalette]));
|
|
16186
16197
|
if (!color || widthPercent <= 0) {
|
|
16187
16198
|
return null;
|
|
16188
16199
|
}
|
|
16189
16200
|
return {
|
|
16190
|
-
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess',
|
|
16201
|
+
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _1179 => _1179.themePalette])), () => ( void 0)),
|
|
16191
16202
|
border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
|
|
16192
|
-
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess',
|
|
16203
|
+
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _1180 => _1180.themePalette])), () => ( void 0)),
|
|
16193
16204
|
color,
|
|
16194
16205
|
gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
|
|
16195
|
-
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess',
|
|
16196
|
-
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess',
|
|
16206
|
+
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _1181 => _1181.themePalette])), () => ( void 0)),
|
|
16207
|
+
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _1182 => _1182.themePalette])), () => ( void 0)),
|
|
16197
16208
|
widthPercent
|
|
16198
16209
|
};
|
|
16199
16210
|
}
|
|
16200
16211
|
function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16201
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16212
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1183 => _1183.conditionalFormatRules]), () => ( []));
|
|
16202
16213
|
const matchingRule = rules.find(
|
|
16203
16214
|
(rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16204
16215
|
);
|
|
@@ -16226,7 +16237,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
16226
16237
|
});
|
|
16227
16238
|
metricsCache.set(cacheKey, ruleValues);
|
|
16228
16239
|
}
|
|
16229
|
-
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess',
|
|
16240
|
+
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _1184 => _1184.themePalette]))).filter((color) => typeof color === "string");
|
|
16230
16241
|
const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
16231
16242
|
if (colors.length < 2 || thresholds.length < 2) {
|
|
16232
16243
|
return null;
|
|
@@ -16245,7 +16256,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
16245
16256
|
return { color: resolvedColor };
|
|
16246
16257
|
}
|
|
16247
16258
|
function resolveConditionalIconForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16248
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16259
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1185 => _1185.conditionalFormatRules]), () => ( []));
|
|
16249
16260
|
const matchingRule = rules.find(
|
|
16250
16261
|
(rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16251
16262
|
);
|
|
@@ -16537,7 +16548,7 @@ function GridRow({
|
|
|
16537
16548
|
whiteSpace: "nowrap",
|
|
16538
16549
|
width: "max-content"
|
|
16539
16550
|
} : null;
|
|
16540
|
-
const title = [_optionalChain([cellData, 'access',
|
|
16551
|
+
const title = [_optionalChain([cellData, 'access', _1186 => _1186.hyperlink, 'optionalAccess', _1187 => _1187.tooltip]), _optionalChain([cellData, 'access', _1188 => _1188.validation, 'optionalAccess', _1189 => _1189.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
|
|
16541
16552
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
16542
16553
|
"td",
|
|
16543
16554
|
{
|
|
@@ -16724,8 +16735,8 @@ var MemoGridRow = React6.memo(GridRow, (prev, next) => {
|
|
|
16724
16735
|
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) {
|
|
16725
16736
|
return false;
|
|
16726
16737
|
}
|
|
16727
|
-
const prevEditingCol = _optionalChain([prev, 'access',
|
|
16728
|
-
const nextEditingCol = _optionalChain([next, 'access',
|
|
16738
|
+
const prevEditingCol = _optionalChain([prev, 'access', _1190 => _1190.editingCell, 'optionalAccess', _1191 => _1191.row]) === prev.actualRow ? prev.editingCell.col : -1;
|
|
16739
|
+
const nextEditingCol = _optionalChain([next, 'access', _1192 => _1192.editingCell, 'optionalAccess', _1193 => _1193.row]) === next.actualRow ? next.editingCell.col : -1;
|
|
16729
16740
|
if (prevEditingCol !== nextEditingCol) {
|
|
16730
16741
|
return false;
|
|
16731
16742
|
}
|
|
@@ -17192,8 +17203,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17192
17203
|
const pendingRequest = workerThumbnailRowBatchRequestRef.current.get(sheet);
|
|
17193
17204
|
if (!pendingRequest) {
|
|
17194
17205
|
const request = {
|
|
17195
|
-
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
17196
|
-
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
17206
|
+
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _1194 => _1194.endRow]), () => ( endRow))),
|
|
17207
|
+
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _1195 => _1195.startRow]), () => ( startRow)))
|
|
17197
17208
|
};
|
|
17198
17209
|
workerThumbnailRowBatchRequestRef.current.set(sheet, request);
|
|
17199
17210
|
void getRowsBatchAsync(
|
|
@@ -17257,7 +17268,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17257
17268
|
}, []);
|
|
17258
17269
|
const thumbnails = React6.useMemo(() => {
|
|
17259
17270
|
return sheets.map((sheet, sheetIndex) => {
|
|
17260
|
-
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess',
|
|
17271
|
+
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _1196 => _1196.getSheet, 'call', _1197 => _1197(sheet.workbookSheetIndex)]), () => ( null));
|
|
17261
17272
|
const sheetImages = getSheetImages(sheetIndex).filter((image) => image.src).sort((left, right) => left.zIndex - right.zIndex);
|
|
17262
17273
|
const sheetShapes = getSheetShapes(sheetIndex);
|
|
17263
17274
|
const sheetFormControls = getSheetFormControls(sheetIndex).filter((control) => !control.hidden);
|
|
@@ -17273,18 +17284,18 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17273
17284
|
minRow: 0
|
|
17274
17285
|
}));
|
|
17275
17286
|
return {
|
|
17276
|
-
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17277
|
-
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17278
|
-
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17279
|
-
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess',
|
|
17287
|
+
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1198 => _1198.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
|
|
17288
|
+
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1199 => _1199.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
|
|
17289
|
+
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1200 => _1200.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
|
|
17290
|
+
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1201 => _1201.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
|
|
17280
17291
|
};
|
|
17281
17292
|
}, null);
|
|
17282
17293
|
const sheetMinUsedRow = (_nullishCoalesce(sheet.maxUsedRow, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedRow, () => ( 0))) ? _nullishCoalesce(sheet.minUsedRow, () => ( 0)) : void 0;
|
|
17283
17294
|
const sheetMinUsedCol = (_nullishCoalesce(sheet.maxUsedCol, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedCol, () => ( 0))) ? _nullishCoalesce(sheet.minUsedCol, () => ( 0)) : void 0;
|
|
17284
|
-
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
17285
|
-
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess',
|
|
17286
|
-
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
17287
|
-
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess',
|
|
17295
|
+
const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess', _1202 => _1202.minRow]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1203 => _1203.minRow]), () => ( sheetMinUsedRow)), () => ( 0))));
|
|
17296
|
+
const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess', _1204 => _1204.minCol]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1205 => _1205.minCol]), () => ( sheetMinUsedCol)), () => ( 0))));
|
|
17297
|
+
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1206 => _1206.maxRow]), () => ( -1)));
|
|
17298
|
+
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1207 => _1207.maxCol]), () => ( -1)));
|
|
17288
17299
|
const showGridLines = _nullishCoalesce(sheet.showGridLines, () => ( true));
|
|
17289
17300
|
const hiddenRowSet = new Set(_nullishCoalesce(sheet.hiddenRows, () => ( [])));
|
|
17290
17301
|
const hiddenColSet = new Set(_nullishCoalesce(sheet.hiddenCols, () => ( [])));
|
|
@@ -17497,8 +17508,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17497
17508
|
return cached;
|
|
17498
17509
|
}
|
|
17499
17510
|
const batchCoversRow = workerRowBatch ? row >= workerRowBatch.startRow && row <= workerRowBatch.endRow : false;
|
|
17500
|
-
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess',
|
|
17501
|
-
if (_optionalChain([batchedCell, 'optionalAccess',
|
|
17511
|
+
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _1208 => _1208.cells, 'access', _1209 => _1209.get, 'call', _1210 => _1210(cacheKey)]) : void 0;
|
|
17512
|
+
if (_optionalChain([batchedCell, 'optionalAccess', _1211 => _1211.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _1212 => _1212.isMergedSecondary, 'call', _1213 => _1213(row, col)])) {
|
|
17502
17513
|
const mergedSecondaryData = {
|
|
17503
17514
|
isMergedSecondary: true,
|
|
17504
17515
|
style: {},
|
|
@@ -17507,23 +17518,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17507
17518
|
cellRenderCache.set(cacheKey, mergedSecondaryData);
|
|
17508
17519
|
return mergedSecondaryData;
|
|
17509
17520
|
}
|
|
17510
|
-
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
17521
|
+
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _1214 => _1214.mergeSpan]);
|
|
17511
17522
|
const inheritedStyle = resolveInheritedCellStyle2(sheet, row, col);
|
|
17512
|
-
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17523
|
+
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1215 => _1215.style]), () => ( null));
|
|
17513
17524
|
const mergedStyle = mergeResolvedCellStyle(inheritedStyle, worksheetStyle, { replaceXfSubtrees: true });
|
|
17514
17525
|
const conditionalCellStyle = resolveConditionalCellStyleForCell(
|
|
17515
17526
|
row,
|
|
17516
17527
|
col,
|
|
17517
17528
|
sheet,
|
|
17518
17529
|
() => worksheet ? getCellNumericValue(worksheet, row, col) : getBatchedCellNumericValue(batchedCell),
|
|
17519
|
-
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17530
|
+
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1216 => _1216.value]), () => ( "")),
|
|
17520
17531
|
worksheet,
|
|
17521
|
-
_optionalChain([workerRowBatch, 'optionalAccess',
|
|
17532
|
+
_optionalChain([workerRowBatch, 'optionalAccess', _1217 => _1217.cells])
|
|
17522
17533
|
);
|
|
17523
17534
|
const finalResolvedStyle = mergeResolvedCellStyle(mergedStyle, conditionalCellStyle);
|
|
17524
|
-
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
17535
|
+
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _1218 => _1218.alignment]);
|
|
17525
17536
|
const sparkline = _nullishCoalesce(sparklineByCell.get(cacheKey), () => ( null));
|
|
17526
|
-
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess',
|
|
17537
|
+
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess', _1219 => _1219.cells, 'access', _1220 => _1220.get, 'call', _1221 => _1221(`${targetRow}:${targetCol}`)]));
|
|
17527
17538
|
const sparklineValues = sparkline ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
|
|
17528
17539
|
{ length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
|
|
17529
17540
|
(_, index) => getNumericValue(
|
|
@@ -17537,23 +17548,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17537
17548
|
sparkline.range.start.col
|
|
17538
17549
|
)
|
|
17539
17550
|
) : null;
|
|
17540
|
-
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
17551
|
+
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _1222 => _1222.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
|
|
17541
17552
|
const nextData = {
|
|
17542
17553
|
canvas: void 0,
|
|
17543
17554
|
checkboxState,
|
|
17544
|
-
colSpan: _optionalChain([merge, 'optionalAccess',
|
|
17555
|
+
colSpan: _optionalChain([merge, 'optionalAccess', _1223 => _1223.colSpan]),
|
|
17545
17556
|
conditionalColorScale: worksheet ? resolveConditionalColorScaleForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17546
17557
|
conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17547
17558
|
conditionalIcon: worksheet ? resolveConditionalIconForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17548
17559
|
isMergedSecondary: false,
|
|
17549
|
-
rowSpan: _optionalChain([merge, 'optionalAccess',
|
|
17560
|
+
rowSpan: _optionalChain([merge, 'optionalAccess', _1224 => _1224.rowSpan]),
|
|
17550
17561
|
sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
|
|
17551
17562
|
style: buildCellStyle(finalResolvedStyle, palette, sheet.themePalette, {
|
|
17552
|
-
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
17563
|
+
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _1225 => _1225.generalAlignment]),
|
|
17553
17564
|
showGridLines
|
|
17554
17565
|
}),
|
|
17555
|
-
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess',
|
|
17556
|
-
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17566
|
+
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1226 => _1226.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1227 => _1227.textRotation])))),
|
|
17567
|
+
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1228 => _1228.value]), () => ( ""))
|
|
17557
17568
|
};
|
|
17558
17569
|
nextData.canvas = buildCanvasCellStyleCache(nextData.style);
|
|
17559
17570
|
cellRenderCache.set(cacheKey, nextData);
|
|
@@ -17571,11 +17582,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17571
17582
|
let height = rowItem.size;
|
|
17572
17583
|
for (let colOffset = 1; colOffset < colSpan; colOffset += 1) {
|
|
17573
17584
|
const nextCol = colItemByActual.get(colItem.actualIndex + colOffset);
|
|
17574
|
-
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess',
|
|
17585
|
+
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _1229 => _1229.size]), () => ( 0));
|
|
17575
17586
|
}
|
|
17576
17587
|
for (let rowOffset = 1; rowOffset < rowSpan; rowOffset += 1) {
|
|
17577
17588
|
const nextRow = rowItemByActual.get(rowItem.actualIndex + rowOffset);
|
|
17578
|
-
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess',
|
|
17589
|
+
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _1230 => _1230.size]), () => ( 0));
|
|
17579
17590
|
}
|
|
17580
17591
|
const rect = {
|
|
17581
17592
|
height,
|
|
@@ -17585,7 +17596,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17585
17596
|
};
|
|
17586
17597
|
const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellData.style)));
|
|
17587
17598
|
const gradientFill = typeof cellData.style.backgroundImage === "string" ? resolveCanvasGradientFill(context, rect, cellData.style.backgroundImage) : null;
|
|
17588
|
-
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access',
|
|
17599
|
+
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _1231 => _1231.conditionalColorScale, 'optionalAccess', _1232 => _1232.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
|
|
17589
17600
|
context.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
|
|
17590
17601
|
context.fillRect(rect.left, rect.top, rect.width, rect.height);
|
|
17591
17602
|
if (cellData.conditionalDataBar) {
|
|
@@ -17830,7 +17841,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17830
17841
|
workbook
|
|
17831
17842
|
]);
|
|
17832
17843
|
const paintThumbnail = React6.useCallback(
|
|
17833
|
-
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access',
|
|
17844
|
+
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _1233 => _1233[sheetIndex], 'optionalAccess', _1234 => _1234.paint, 'call', _1235 => _1235(canvas)]), () => ( false)),
|
|
17834
17845
|
[thumbnails]
|
|
17835
17846
|
);
|
|
17836
17847
|
return React6.useMemo(
|
|
@@ -17889,7 +17900,7 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
|
|
|
17889
17900
|
}
|
|
17890
17901
|
destroy() {
|
|
17891
17902
|
this.destroyed = true;
|
|
17892
|
-
_optionalChain([this, 'access',
|
|
17903
|
+
_optionalChain([this, 'access', _1236 => _1236.observer, 'optionalAccess', _1237 => _1237.disconnect, 'call', _1238 => _1238()]);
|
|
17893
17904
|
this.observer = null;
|
|
17894
17905
|
this.slots.clear();
|
|
17895
17906
|
this.listeners.clear();
|
|
@@ -17931,7 +17942,7 @@ function RuntimeContent({ content }) {
|
|
|
17931
17942
|
};
|
|
17932
17943
|
}, []);
|
|
17933
17944
|
React7.useLayoutEffect(() => {
|
|
17934
|
-
_optionalChain([rootRef, 'access',
|
|
17945
|
+
_optionalChain([rootRef, 'access', _1239 => _1239.current, 'optionalAccess', _1240 => _1240.update, 'call', _1241 => _1241(content)]);
|
|
17935
17946
|
}, [content]);
|
|
17936
17947
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref: hostRef, style: { display: "contents" } });
|
|
17937
17948
|
}
|
|
@@ -17993,7 +18004,7 @@ function BoundViewer({ props, controller }) {
|
|
|
17993
18004
|
}, [slots]);
|
|
17994
18005
|
React7.useLayoutEffect(() => {
|
|
17995
18006
|
const host = hostRef.current;
|
|
17996
|
-
if (host) _optionalChain([viewerRef, 'access',
|
|
18007
|
+
if (host) _optionalChain([viewerRef, 'access', _1242 => _1242.current, 'optionalAccess', _1243 => _1243.update, 'call', _1244 => _1244(renderOptions(props, controller, slots, host.ownerDocument))]);
|
|
17997
18008
|
}, [controller, props, slots]);
|
|
17998
18009
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ViewerAppearanceContext.Provider, { value: {
|
|
17999
18010
|
headerBackgroundColor: props.headerBackgroundColor,
|