@extend-ai/react-xlsx 0.20.10 → 0.20.12
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 +27 -3
- package/dist/{chunk-OGZ6ROZC.cjs → chunk-A3S3QKJN.cjs} +445 -3
- package/dist/chunk-A3S3QKJN.cjs.map +1 -0
- package/dist/chunk-IRC7BQ6E.js +538 -0
- package/dist/chunk-IRC7BQ6E.js.map +1 -0
- package/dist/{chunk-DWBPSBJ5.cjs → chunk-NIN5D556.cjs} +1387 -1322
- package/dist/chunk-NIN5D556.cjs.map +1 -0
- package/dist/{chunk-2QENCJUT.js → chunk-O4S5CRDM.js} +192 -127
- package/dist/chunk-O4S5CRDM.js.map +1 -0
- package/dist/{chunk-CVMHJO5H.js → chunk-WHTV6N6S.js} +443 -1
- package/dist/chunk-WHTV6N6S.js.map +1 -0
- package/dist/chunk-ZPDHTVL6.cjs +538 -0
- package/dist/chunk-ZPDHTVL6.cjs.map +1 -0
- package/dist/index.cjs +183 -154
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -2
- package/dist/index.d.ts +60 -2
- package/dist/index.js +52 -23
- package/dist/index.js.map +1 -1
- package/dist/{internal-BBaC9yCh.d.cts → internal-D_np3R-w.d.cts} +60 -2
- package/dist/{internal-BBaC9yCh.d.ts → internal-D_np3R-w.d.ts} +60 -2
- package/dist/internal.cjs +3 -3
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +2 -2
- package/dist/{shared-chart-XOCTF7KQ.js → shared-chart-7RUN5IKZ.js} +6 -4
- package/dist/shared-chart-7RUN5IKZ.js.map +1 -0
- package/dist/{shared-chart-CIRSCWTO.cjs → shared-chart-P3KU6TQR.cjs} +15 -13
- package/dist/shared-chart-P3KU6TQR.cjs.map +1 -0
- package/dist/{shared-chart-BLOOGI7S.js → shared-chart-UTUK46E4.js} +6 -4
- package/dist/shared-chart-UTUK46E4.js.map +1 -0
- package/dist/{shared-chart-4LUQQI2B.cjs → shared-chart-VRXD57MU.cjs} +6 -4
- package/dist/shared-chart-VRXD57MU.cjs.map +1 -0
- package/dist/vanilla.cjs +3 -3
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2QENCJUT.js.map +0 -1
- package/dist/chunk-7GBCRNGO.js +0 -94
- package/dist/chunk-7GBCRNGO.js.map +0 -1
- package/dist/chunk-CVMHJO5H.js.map +0 -1
- package/dist/chunk-DWBPSBJ5.cjs.map +0 -1
- package/dist/chunk-MFOGLSFJ.cjs +0 -94
- package/dist/chunk-MFOGLSFJ.cjs.map +0 -1
- package/dist/chunk-OGZ6ROZC.cjs.map +0 -1
- package/dist/shared-chart-4LUQQI2B.cjs.map +0 -1
- package/dist/shared-chart-BLOOGI7S.js.map +0 -1
- package/dist/shared-chart-CIRSCWTO.cjs.map +0 -1
- package/dist/shared-chart-XOCTF7KQ.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkZPDHTVL6cjs = require('./chunk-ZPDHTVL6.cjs');
|
|
4
8
|
|
|
5
9
|
|
|
6
10
|
var _chunkAD4CGQN2cjs = require('./chunk-AD4CGQN2.cjs');
|
|
@@ -326,7 +330,7 @@ async function loadSpreadsheetFonts(buffer) {
|
|
|
326
330
|
}
|
|
327
331
|
} catch (e) {
|
|
328
332
|
}
|
|
329
|
-
await
|
|
333
|
+
await _chunkZPDHTVL6cjs.loadOfficeFonts.call(void 0, void 0, families).catch(() => void 0);
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
// src/controller.tsx
|
|
@@ -9430,6 +9434,7 @@ function useXlsxViewerController(options) {
|
|
|
9430
9434
|
file,
|
|
9431
9435
|
fileName,
|
|
9432
9436
|
locale = "en-US",
|
|
9437
|
+
messages: messageOverrides,
|
|
9433
9438
|
maxFileSizeBytes = DEFAULT_MAX_FILE_SIZE_BYTES,
|
|
9434
9439
|
readOnly: requestedReadOnly = false,
|
|
9435
9440
|
readOnlyAboveBytes = 0,
|
|
@@ -9438,6 +9443,7 @@ function useXlsxViewerController(options) {
|
|
|
9438
9443
|
src,
|
|
9439
9444
|
useWorker = true
|
|
9440
9445
|
} = options;
|
|
9446
|
+
const messages = React.useMemo(() => _chunkZPDHTVL6cjs.resolveMessages.call(void 0, locale, messageOverrides), [locale, messageOverrides]);
|
|
9441
9447
|
const [isLoading, setIsLoading] = React.useState(Boolean(_nullishCoalesce(file, () => ( src))));
|
|
9442
9448
|
const [error, setError] = React.useState(null);
|
|
9443
9449
|
const [workbook, setWorkbook] = React.useState(null);
|
|
@@ -10695,9 +10701,10 @@ function useXlsxViewerController(options) {
|
|
|
10695
10701
|
activeCell,
|
|
10696
10702
|
activeSheetIndex,
|
|
10697
10703
|
bytes: createSavedWorkbookBytes(workbook),
|
|
10698
|
-
selection
|
|
10704
|
+
selection,
|
|
10705
|
+
sortState
|
|
10699
10706
|
};
|
|
10700
|
-
}, [activeCell, activeSheetIndex, createSavedWorkbookBytes, selection, workbook]);
|
|
10707
|
+
}, [activeCell, activeSheetIndex, createSavedWorkbookBytes, selection, sortState, workbook]);
|
|
10701
10708
|
const captureCellMutationState = React.useCallback((cell) => {
|
|
10702
10709
|
const worksheet = getActiveWorksheet();
|
|
10703
10710
|
if (!worksheet) {
|
|
@@ -10737,6 +10744,7 @@ function useXlsxViewerController(options) {
|
|
|
10737
10744
|
}
|
|
10738
10745
|
setActiveCell(entry.activeCell);
|
|
10739
10746
|
setSelection(entry.selection);
|
|
10747
|
+
setSortState(entry.sortState);
|
|
10740
10748
|
selectionAnchorRef.current = entry.selection ? normalizeRange(entry.selection).start : entry.activeCell;
|
|
10741
10749
|
setRevision((current) => current + 1);
|
|
10742
10750
|
}, [setChartAssets, setImageAssets]);
|
|
@@ -10771,6 +10779,7 @@ function useXlsxViewerController(options) {
|
|
|
10771
10779
|
for (const mutation of entry.mutations) {
|
|
10772
10780
|
applyCellMutationState(worksheet, mutation.cell, direction === "undo" ? mutation.before : mutation.after);
|
|
10773
10781
|
}
|
|
10782
|
+
setSortState(direction === "undo" ? entry.sortStateBefore : entry.sortStateAfter);
|
|
10774
10783
|
maybeRecalculateWorkbook(workbook);
|
|
10775
10784
|
refreshWorkbookState(workbook);
|
|
10776
10785
|
const nextActiveCell = direction === "undo" ? entry.activeCellBefore : entry.activeCellAfter;
|
|
@@ -10908,8 +10917,8 @@ function useXlsxViewerController(options) {
|
|
|
10908
10917
|
redoStackRef.current = [];
|
|
10909
10918
|
setHistoryRevision((current) => current + 1);
|
|
10910
10919
|
}, [activeCell, activeSheet, selection]);
|
|
10911
|
-
const recordRangeEditHistory = React.useCallback((mutations, selectionAfter, activeCellAfter) => {
|
|
10912
|
-
if (!activeSheet || isApplyingHistoryRef.current || mutations.length === 0) {
|
|
10920
|
+
const recordRangeEditHistory = React.useCallback((mutations, selectionAfter, activeCellAfter, sortStateAfter = sortState) => {
|
|
10921
|
+
if (!activeSheet || isApplyingHistoryRef.current || mutations.length === 0 && sortStateAfter === sortState) {
|
|
10913
10922
|
return;
|
|
10914
10923
|
}
|
|
10915
10924
|
pushHistoryEntry(undoStackRef.current, {
|
|
@@ -10919,11 +10928,13 @@ function useXlsxViewerController(options) {
|
|
|
10919
10928
|
mutations,
|
|
10920
10929
|
selectionAfter,
|
|
10921
10930
|
selectionBefore: selection,
|
|
10922
|
-
sheetIndex: activeSheet.workbookSheetIndex
|
|
10931
|
+
sheetIndex: activeSheet.workbookSheetIndex,
|
|
10932
|
+
sortStateAfter,
|
|
10933
|
+
sortStateBefore: sortState
|
|
10923
10934
|
});
|
|
10924
10935
|
redoStackRef.current = [];
|
|
10925
10936
|
setHistoryRevision((current) => current + 1);
|
|
10926
|
-
}, [activeCell, activeSheet, selection]);
|
|
10937
|
+
}, [activeCell, activeSheet, selection, sortState]);
|
|
10927
10938
|
const sortTable = React.useCallback((tableName, columnIndex, direction) => {
|
|
10928
10939
|
const worksheet = getActiveWorksheet();
|
|
10929
10940
|
const targetTable = tables.find((table) => table.name === tableName || table.displayName === tableName);
|
|
@@ -10975,8 +10986,13 @@ function useXlsxViewerController(options) {
|
|
|
10975
10986
|
const comparedText = left.sortText.localeCompare(right.sortText, void 0, { numeric: true, sensitivity: "base" });
|
|
10976
10987
|
return direction === "ascending" ? comparedText : -comparedText;
|
|
10977
10988
|
});
|
|
10989
|
+
const nextSortState = { columnIndex, direction, tableName: targetTable.name };
|
|
10978
10990
|
if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access', _1026 => _1026[index], 'optionalAccess', _1027 => _1027.index]))) {
|
|
10979
|
-
|
|
10991
|
+
if (_optionalChain([sortState, 'optionalAccess', _1028 => _1028.tableName]) === targetTable.name && sortState.columnIndex === columnIndex && sortState.direction === direction) {
|
|
10992
|
+
return;
|
|
10993
|
+
}
|
|
10994
|
+
setSortState(nextSortState);
|
|
10995
|
+
recordRangeEditHistory([], selection, activeCell, nextSortState);
|
|
10980
10996
|
return;
|
|
10981
10997
|
}
|
|
10982
10998
|
const mutations = [];
|
|
@@ -11004,8 +11020,8 @@ function useXlsxViewerController(options) {
|
|
|
11004
11020
|
}
|
|
11005
11021
|
maybeRecalculateWorkbook(workbook);
|
|
11006
11022
|
refreshWorkbookState(workbook);
|
|
11007
|
-
setSortState(
|
|
11008
|
-
recordRangeEditHistory(mutations, selection, activeCell);
|
|
11023
|
+
setSortState(nextSortState);
|
|
11024
|
+
recordRangeEditHistory(mutations, selection, activeCell, nextSortState);
|
|
11009
11025
|
}, [
|
|
11010
11026
|
activeCell,
|
|
11011
11027
|
activeSheet,
|
|
@@ -11015,6 +11031,7 @@ function useXlsxViewerController(options) {
|
|
|
11015
11031
|
recordRangeEditHistory,
|
|
11016
11032
|
refreshWorkbookState,
|
|
11017
11033
|
selection,
|
|
11034
|
+
sortState,
|
|
11018
11035
|
tables,
|
|
11019
11036
|
workbook
|
|
11020
11037
|
]);
|
|
@@ -11044,9 +11061,9 @@ function useXlsxViewerController(options) {
|
|
|
11044
11061
|
if (!workbook) {
|
|
11045
11062
|
return;
|
|
11046
11063
|
}
|
|
11047
|
-
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess',
|
|
11064
|
+
const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1029 => _1029.name]), () => ( "sheet"));
|
|
11048
11065
|
downloadText(workbook.saveCsvString(), `${fileStem(displayFileName)}-${activeSheetName}.csv`, CSV_MIME_TYPE);
|
|
11049
|
-
}, [_optionalChain([activeSheet, 'optionalAccess',
|
|
11066
|
+
}, [_optionalChain([activeSheet, 'optionalAccess', _1030 => _1030.name]), displayFileName, workbook]);
|
|
11050
11067
|
const recalculate = React.useCallback(() => {
|
|
11051
11068
|
if (!workbook) {
|
|
11052
11069
|
return;
|
|
@@ -11210,10 +11227,10 @@ function useXlsxViewerController(options) {
|
|
|
11210
11227
|
const currentChart = getChartById(id);
|
|
11211
11228
|
console.info("[react-xlsx debug] currentChart", {
|
|
11212
11229
|
activeWorkbookSheetIndex: activeSheet.workbookSheetIndex,
|
|
11213
|
-
editable: _optionalChain([currentChart, 'optionalAccess',
|
|
11230
|
+
editable: _optionalChain([currentChart, 'optionalAccess', _1031 => _1031.editable]),
|
|
11214
11231
|
found: Boolean(currentChart),
|
|
11215
11232
|
originCount: hydratedChartAssets.chartOriginsById.size,
|
|
11216
|
-
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess',
|
|
11233
|
+
workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess', _1032 => _1032.workbookSheetIndex])
|
|
11217
11234
|
});
|
|
11218
11235
|
if (!currentChart || currentChart.editable === false || currentChart.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
|
|
11219
11236
|
return;
|
|
@@ -11221,8 +11238,8 @@ function useXlsxViewerController(options) {
|
|
|
11221
11238
|
const nextAnchor = rectToImageAnchor(rect, currentChart.anchor, {
|
|
11222
11239
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
11223
11240
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
11224
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11225
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11241
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1033 => _1033.columnWidths, 'access', _1034 => _1034[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
11242
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1035 => _1035.rowHeights, 'access', _1036 => _1036[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
11226
11243
|
});
|
|
11227
11244
|
recordHistoryBeforeMutation();
|
|
11228
11245
|
const didUpdateAnchor = updateWorkbookChartAnchor(imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
|
|
@@ -11253,8 +11270,8 @@ function useXlsxViewerController(options) {
|
|
|
11253
11270
|
const nextAnchor = rectToImageAnchor(rect, currentImage.anchor, {
|
|
11254
11271
|
contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
|
|
11255
11272
|
contentOffsetTop: GRID_HEADER_HEIGHT,
|
|
11256
|
-
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11257
|
-
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess',
|
|
11273
|
+
getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1037 => _1037.columnWidths, 'access', _1038 => _1038[col]]), () => ( getColumnWidthPx(worksheet, col))),
|
|
11274
|
+
getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _1039 => _1039.rowHeights, 'access', _1040 => _1040[row]]), () => ( getRowHeightPx(worksheet, row)))
|
|
11258
11275
|
});
|
|
11259
11276
|
recordHistoryBeforeMutation();
|
|
11260
11277
|
if (!updateWorkbookImageAnchor(imageAssetsRef.current, id, nextAnchor)) {
|
|
@@ -11433,7 +11450,7 @@ function useXlsxViewerController(options) {
|
|
|
11433
11450
|
setSelectedChartElement(null);
|
|
11434
11451
|
setSelectedImageId(null);
|
|
11435
11452
|
setActiveCell(cell);
|
|
11436
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
11453
|
+
if (_optionalChain([options2, 'optionalAccess', _1041 => _1041.extend]) && selectionAnchorRef.current) {
|
|
11437
11454
|
setSelection(normalizeRange({ start: selectionAnchorRef.current, end: cell }));
|
|
11438
11455
|
return;
|
|
11439
11456
|
}
|
|
@@ -11576,7 +11593,7 @@ function useXlsxViewerController(options) {
|
|
|
11576
11593
|
setCellFormula(activeCell, formula);
|
|
11577
11594
|
}, [activeCell, setCellFormula]);
|
|
11578
11595
|
const setSelectedFormula = React.useCallback((formula) => {
|
|
11579
|
-
if (_optionalChain([selectedFormulaTarget, 'optionalAccess',
|
|
11596
|
+
if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _1042 => _1042.kind]) === "chartSeries") {
|
|
11580
11597
|
return setChartSeriesFormula(selectedFormulaTarget.chartId, selectedFormulaTarget.seriesIndex, formula);
|
|
11581
11598
|
}
|
|
11582
11599
|
if (!activeCell) {
|
|
@@ -11738,7 +11755,7 @@ function useXlsxViewerController(options) {
|
|
|
11738
11755
|
return;
|
|
11739
11756
|
}
|
|
11740
11757
|
recordHistoryBeforeMutation();
|
|
11741
|
-
const baseName = _optionalChain([name, 'optionalAccess',
|
|
11758
|
+
const baseName = _optionalChain([name, 'optionalAccess', _1043 => _1043.trim, 'call', _1044 => _1044()]) || "Sheet";
|
|
11742
11759
|
let candidate = baseName;
|
|
11743
11760
|
let counter = 2;
|
|
11744
11761
|
while (workbook.sheetIndex(candidate) !== void 0) {
|
|
@@ -11758,11 +11775,11 @@ function useXlsxViewerController(options) {
|
|
|
11758
11775
|
}
|
|
11759
11776
|
const nextSheets = buildSheetList(
|
|
11760
11777
|
workbook,
|
|
11761
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11762
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11763
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11764
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11765
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11778
|
+
_optionalChain([imageAssetsRef, 'access', _1045 => _1045.current, 'optionalAccess', _1046 => _1046.sheetStatesByWorkbookSheetIndex]),
|
|
11779
|
+
_optionalChain([imageAssetsRef, 'access', _1047 => _1047.current, 'optionalAccess', _1048 => _1048.themePalette]),
|
|
11780
|
+
_optionalChain([imageAssetsRef, 'access', _1049 => _1049.current, 'optionalAccess', _1050 => _1050.styleById]),
|
|
11781
|
+
_optionalChain([imageAssetsRef, 'access', _1051 => _1051.current, 'optionalAccess', _1052 => _1052.namedCellStyleByName]),
|
|
11782
|
+
_optionalChain([imageAssetsRef, 'access', _1053 => _1053.current, 'optionalAccess', _1054 => _1054.tableStyleByName]),
|
|
11766
11783
|
showHiddenSheets
|
|
11767
11784
|
);
|
|
11768
11785
|
setSheets(nextSheets);
|
|
@@ -11772,7 +11789,7 @@ function useXlsxViewerController(options) {
|
|
|
11772
11789
|
}
|
|
11773
11790
|
const nextIndex = nextSheets.findIndex((sheet) => sheet.name === candidate);
|
|
11774
11791
|
setActiveSheetIndexState(nextIndex >= 0 ? nextIndex : 0);
|
|
11775
|
-
const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess',
|
|
11792
|
+
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
11793
|
if (nextTabIndex >= 0) {
|
|
11777
11794
|
setActiveTabIndexState(nextTabIndex);
|
|
11778
11795
|
}
|
|
@@ -11798,11 +11815,11 @@ function useXlsxViewerController(options) {
|
|
|
11798
11815
|
}
|
|
11799
11816
|
const nextSheets = buildSheetList(
|
|
11800
11817
|
workbook,
|
|
11801
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11802
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11803
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11804
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11805
|
-
_optionalChain([imageAssetsRef, 'access',
|
|
11818
|
+
_optionalChain([imageAssetsRef, 'access', _1058 => _1058.current, 'optionalAccess', _1059 => _1059.sheetStatesByWorkbookSheetIndex]),
|
|
11819
|
+
_optionalChain([imageAssetsRef, 'access', _1060 => _1060.current, 'optionalAccess', _1061 => _1061.themePalette]),
|
|
11820
|
+
_optionalChain([imageAssetsRef, 'access', _1062 => _1062.current, 'optionalAccess', _1063 => _1063.styleById]),
|
|
11821
|
+
_optionalChain([imageAssetsRef, 'access', _1064 => _1064.current, 'optionalAccess', _1065 => _1065.namedCellStyleByName]),
|
|
11822
|
+
_optionalChain([imageAssetsRef, 'access', _1066 => _1066.current, 'optionalAccess', _1067 => _1067.tableStyleByName]),
|
|
11806
11823
|
showHiddenSheets
|
|
11807
11824
|
);
|
|
11808
11825
|
setSheets(nextSheets);
|
|
@@ -11830,7 +11847,7 @@ function useXlsxViewerController(options) {
|
|
|
11830
11847
|
}, [readOnly, recordHistoryBeforeMutation, selection, workbook]);
|
|
11831
11848
|
const pasteText = React.useCallback((text) => {
|
|
11832
11849
|
const worksheet = getActiveWorksheet();
|
|
11833
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
11850
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _1068 => _1068.start]))), () => ( null));
|
|
11834
11851
|
if (readOnly || !worksheet || !workbook || !targetCell || !text) {
|
|
11835
11852
|
return false;
|
|
11836
11853
|
}
|
|
@@ -11898,7 +11915,7 @@ function useXlsxViewerController(options) {
|
|
|
11898
11915
|
}, [activeCell, captureCellMutationState, getActiveWorksheet, locale, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
|
|
11899
11916
|
const pasteStructuredClipboardData = React.useCallback((serializedPayload) => {
|
|
11900
11917
|
const worksheet = getActiveWorksheet();
|
|
11901
|
-
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess',
|
|
11918
|
+
const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _1069 => _1069.start]))), () => ( null));
|
|
11902
11919
|
if (readOnly || !worksheet || !workbook || !targetCell || !serializedPayload) {
|
|
11903
11920
|
return false;
|
|
11904
11921
|
}
|
|
@@ -12169,6 +12186,7 @@ function useXlsxViewerController(options) {
|
|
|
12169
12186
|
defineNamedRange,
|
|
12170
12187
|
displayFileName,
|
|
12171
12188
|
locale,
|
|
12189
|
+
messages,
|
|
12172
12190
|
download,
|
|
12173
12191
|
exportCsv,
|
|
12174
12192
|
exportXlsx,
|
|
@@ -12293,6 +12311,7 @@ function useXlsxViewerController(options) {
|
|
|
12293
12311
|
defineNamedRange,
|
|
12294
12312
|
displayFileName,
|
|
12295
12313
|
locale,
|
|
12314
|
+
messages,
|
|
12296
12315
|
download,
|
|
12297
12316
|
error,
|
|
12298
12317
|
exportCsv,
|
|
@@ -12419,6 +12438,7 @@ function CellEditor({
|
|
|
12419
12438
|
onNavigate
|
|
12420
12439
|
}) {
|
|
12421
12440
|
const rootRef = React2.useRef(null);
|
|
12441
|
+
const messages = _chunkZPDHTVL6cjs.useXlsxMessages.call(void 0, );
|
|
12422
12442
|
const mirrorRef = React2.useRef(null);
|
|
12423
12443
|
const textRef = React2.useRef(null);
|
|
12424
12444
|
const baselineRef = React2.useRef(null);
|
|
@@ -12430,8 +12450,8 @@ function CellEditor({
|
|
|
12430
12450
|
const [bounds, setBounds] = React2.useState({ width: 0, height: 0 });
|
|
12431
12451
|
React2.useLayoutEffect(() => {
|
|
12432
12452
|
const root = rootRef.current;
|
|
12433
|
-
const anchor = _optionalChain([root, 'optionalAccess',
|
|
12434
|
-
const viewport = _optionalChain([root, 'optionalAccess',
|
|
12453
|
+
const anchor = _optionalChain([root, 'optionalAccess', _1070 => _1070.parentElement]);
|
|
12454
|
+
const viewport = _optionalChain([root, 'optionalAccess', _1071 => _1071.closest, 'call', _1072 => _1072('[role="grid"]')]);
|
|
12435
12455
|
if (!root || !anchor || !viewport) {
|
|
12436
12456
|
return;
|
|
12437
12457
|
}
|
|
@@ -12494,8 +12514,8 @@ function CellEditor({
|
|
|
12494
12514
|
const canvas = canvasRef.current;
|
|
12495
12515
|
if (canvas && paintCanvasText) {
|
|
12496
12516
|
const dpr = window.devicePixelRatio || 1;
|
|
12497
|
-
const offsetX = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess',
|
|
12498
|
-
const offsetY = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess',
|
|
12517
|
+
const offsetX = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _1073 => _1073.left]), () => ( 0))) * dpr % 1 / dpr;
|
|
12518
|
+
const offsetY = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _1074 => _1074.top]), () => ( 0))) * dpr % 1 / dpr;
|
|
12499
12519
|
const width = rootRect.width / scale;
|
|
12500
12520
|
const height = rootRect.height / scale;
|
|
12501
12521
|
canvas.width = Math.ceil((width + offsetX) * dpr);
|
|
@@ -12506,11 +12526,11 @@ function CellEditor({
|
|
|
12506
12526
|
canvas.style.top = `${-offsetY}px`;
|
|
12507
12527
|
const context = canvas.getContext("2d");
|
|
12508
12528
|
if (context) {
|
|
12509
|
-
const node = _optionalChain([plainTextRef, 'access',
|
|
12529
|
+
const node = _optionalChain([plainTextRef, 'access', _1075 => _1075.current, 'optionalAccess', _1076 => _1076.firstChild]);
|
|
12510
12530
|
const lines = [];
|
|
12511
12531
|
if (node) {
|
|
12512
12532
|
const range = document.createRange();
|
|
12513
|
-
const length = _nullishCoalesce(_optionalChain([node, 'access',
|
|
12533
|
+
const length = _nullishCoalesce(_optionalChain([node, 'access', _1077 => _1077.textContent, 'optionalAccess', _1078 => _1078.length]), () => ( 0));
|
|
12514
12534
|
let start = 0;
|
|
12515
12535
|
while (start < length) {
|
|
12516
12536
|
range.setStart(node, start);
|
|
@@ -12604,7 +12624,7 @@ function CellEditor({
|
|
|
12604
12624
|
if (typeof inputRef === "function") inputRef(element);
|
|
12605
12625
|
else if (inputRef) inputRef.current = element;
|
|
12606
12626
|
},
|
|
12607
|
-
"aria-label":
|
|
12627
|
+
"aria-label": messages.editCell,
|
|
12608
12628
|
autoFocus: true,
|
|
12609
12629
|
autoComplete: "off",
|
|
12610
12630
|
spellCheck: false,
|
|
@@ -12778,18 +12798,18 @@ function createChartModule(importModule) {
|
|
|
12778
12798
|
var officeChartRenderer = createChartModule(async () => {
|
|
12779
12799
|
const [{ loadOfficeCharts }, { SharedChartSvg }] = await Promise.all([
|
|
12780
12800
|
Promise.resolve().then(() => _interopRequireWildcard(require("./browser-E3IVCNDO.cjs"))),
|
|
12781
|
-
Promise.resolve().then(() => _interopRequireWildcard(require("./shared-chart-
|
|
12801
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./shared-chart-VRXD57MU.cjs")))
|
|
12782
12802
|
]);
|
|
12783
12803
|
return { renderer: await loadOfficeCharts(), SharedChartSvg };
|
|
12784
12804
|
});
|
|
12785
12805
|
var suppliedOfficeChartRenderer = createChartModule(async () => {
|
|
12786
|
-
const { SharedChartSvg } = await Promise.resolve().then(() => _interopRequireWildcard(require("./shared-chart-
|
|
12806
|
+
const { SharedChartSvg } = await Promise.resolve().then(() => _interopRequireWildcard(require("./shared-chart-VRXD57MU.cjs")));
|
|
12787
12807
|
return { renderer: null, SharedChartSvg };
|
|
12788
12808
|
});
|
|
12789
12809
|
var officeExtendedChartRenderer = createChartModule(async () => {
|
|
12790
12810
|
const [{ loadOfficeCharts }, { SharedChartSvg }] = await Promise.all([
|
|
12791
12811
|
Promise.resolve().then(() => _interopRequireWildcard(require("./full-V7S6GLRU.cjs"))),
|
|
12792
|
-
Promise.resolve().then(() => _interopRequireWildcard(require("./shared-chart-
|
|
12812
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./shared-chart-VRXD57MU.cjs")))
|
|
12793
12813
|
]);
|
|
12794
12814
|
return { renderer: await loadOfficeCharts(typeof DecompressionStream === "function" ? void 0 : new URL("./office_charts_full_bg.wasm", _chunkAD4CGQN2cjs.importMetaUrl)), SharedChartSvg };
|
|
12795
12815
|
});
|
|
@@ -13294,7 +13314,7 @@ function parseCanvasGradientStops(value) {
|
|
|
13294
13314
|
if (!match) {
|
|
13295
13315
|
return null;
|
|
13296
13316
|
}
|
|
13297
|
-
const color = _optionalChain([match, 'access',
|
|
13317
|
+
const color = _optionalChain([match, 'access', _1079 => _1079[1], 'optionalAccess', _1080 => _1080.trim, 'call', _1081 => _1081()]);
|
|
13298
13318
|
const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
|
|
13299
13319
|
if (!color) {
|
|
13300
13320
|
return null;
|
|
@@ -13310,7 +13330,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
13310
13330
|
if (linearMatch) {
|
|
13311
13331
|
const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
|
|
13312
13332
|
if (parts.length >= 2) {
|
|
13313
|
-
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access',
|
|
13333
|
+
const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _1082 => _1082[0], 'optionalAccess', _1083 => _1083.trim, 'call', _1084 => _1084()]), () => ( "180deg"));
|
|
13314
13334
|
const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
|
|
13315
13335
|
const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
|
|
13316
13336
|
const radians = (90 - cssAngle) * Math.PI / 180;
|
|
@@ -13340,7 +13360,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
|
|
|
13340
13360
|
const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
|
|
13341
13361
|
if (radialMatch) {
|
|
13342
13362
|
const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
|
|
13343
|
-
const stopParts = _optionalChain([parts, 'access',
|
|
13363
|
+
const stopParts = _optionalChain([parts, 'access', _1085 => _1085[0], 'optionalAccess', _1086 => _1086.startsWith, 'call', _1087 => _1087("circle")]) ? parts.slice(1) : parts;
|
|
13344
13364
|
const gradient = context.createRadialGradient(
|
|
13345
13365
|
rect.left + rect.width / 2,
|
|
13346
13366
|
rect.top + rect.height / 2,
|
|
@@ -13413,8 +13433,8 @@ function drawCanvasConditionalIcon(context, icon, centerX, centerY, size) {
|
|
|
13413
13433
|
context.fill();
|
|
13414
13434
|
context.restore();
|
|
13415
13435
|
}
|
|
13416
|
-
function formatZoomScale(zoomScale) {
|
|
13417
|
-
return
|
|
13436
|
+
function formatZoomScale(zoomScale, locale) {
|
|
13437
|
+
return new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 0 }).format(zoomScale / 100);
|
|
13418
13438
|
}
|
|
13419
13439
|
function parseRgbColor(color) {
|
|
13420
13440
|
const match = /^#?([0-9a-f]{6})$/i.exec(color);
|
|
@@ -13464,7 +13484,7 @@ function resolveDarkModeSurface(themePalette, palette) {
|
|
|
13464
13484
|
return "hsl(225 4% 6%)";
|
|
13465
13485
|
}
|
|
13466
13486
|
function resolveSheetSurface(sheet, palette) {
|
|
13467
|
-
return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess',
|
|
13487
|
+
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
13488
|
}
|
|
13469
13489
|
function normalizeRange2(range) {
|
|
13470
13490
|
return {
|
|
@@ -13496,7 +13516,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
|
|
|
13496
13516
|
const visible2 = [];
|
|
13497
13517
|
const usedLimit = Math.min(displayLimit, Math.max(0, maxUsedIndex + 1));
|
|
13498
13518
|
for (let index = 0; index < usedLimit; index += 1) {
|
|
13499
|
-
if (!_optionalChain([hiddenIndices, 'optionalAccess',
|
|
13519
|
+
if (!_optionalChain([hiddenIndices, 'optionalAccess', _1092 => _1092.has, 'call', _1093 => _1093(index)])) {
|
|
13500
13520
|
visible2.push(index);
|
|
13501
13521
|
}
|
|
13502
13522
|
}
|
|
@@ -13538,7 +13558,7 @@ function clampPercent(value, fallback) {
|
|
|
13538
13558
|
return Math.max(0, Math.min(100, value));
|
|
13539
13559
|
}
|
|
13540
13560
|
function resolveShapeAdjustment(shape, name, fallback) {
|
|
13541
|
-
const rawValue = _optionalChain([shape, 'access',
|
|
13561
|
+
const rawValue = _optionalChain([shape, 'access', _1094 => _1094.geometryAdjustments, 'optionalAccess', _1095 => _1095[name]]);
|
|
13542
13562
|
if (typeof rawValue !== "number") {
|
|
13543
13563
|
return fallback;
|
|
13544
13564
|
}
|
|
@@ -14438,8 +14458,8 @@ function normalizeThumbnailResolution(resolution) {
|
|
|
14438
14458
|
}
|
|
14439
14459
|
const resolvedObject = typeof resolution === "object" && resolution ? resolution : void 0;
|
|
14440
14460
|
return {
|
|
14441
|
-
maxHeight: _optionalChain([resolvedObject, 'optionalAccess',
|
|
14442
|
-
maxWidth: _optionalChain([resolvedObject, 'optionalAccess',
|
|
14461
|
+
maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _1096 => _1096.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
|
|
14462
|
+
maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _1097 => _1097.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
|
|
14443
14463
|
};
|
|
14444
14464
|
}
|
|
14445
14465
|
function resolveThumbnailOutputSize(sourceWidth, sourceHeight, resolution) {
|
|
@@ -14758,24 +14778,24 @@ function escapeCssFontFamily(name) {
|
|
|
14758
14778
|
return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
|
|
14759
14779
|
}
|
|
14760
14780
|
function resolveSpreadsheetThemeFont(font, themePalette) {
|
|
14761
|
-
const scheme = typeof _optionalChain([font, 'optionalAccess',
|
|
14781
|
+
const scheme = typeof _optionalChain([font, 'optionalAccess', _1098 => _1098.scheme]) === "string" ? font.scheme : null;
|
|
14762
14782
|
if (scheme === "major") {
|
|
14763
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
14783
|
+
return _optionalChain([themePalette, 'optionalAccess', _1099 => _1099.majorLatinFont]);
|
|
14764
14784
|
}
|
|
14765
14785
|
if (scheme === "minor") {
|
|
14766
|
-
return _optionalChain([themePalette, 'optionalAccess',
|
|
14786
|
+
return _optionalChain([themePalette, 'optionalAccess', _1100 => _1100.minorLatinFont]);
|
|
14767
14787
|
}
|
|
14768
14788
|
return void 0;
|
|
14769
14789
|
}
|
|
14770
14790
|
function buildSpreadsheetFontFamily(font, themePalette) {
|
|
14771
14791
|
const candidates = [
|
|
14772
|
-
typeof _optionalChain([font, 'optionalAccess',
|
|
14773
|
-
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call',
|
|
14792
|
+
typeof _optionalChain([font, 'optionalAccess', _1101 => _1101.name]) === "string" ? font.name.trim() : "",
|
|
14793
|
+
_nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _1102 => _1102(font, themePalette), 'optionalAccess', _1103 => _1103.trim, 'call', _1104 => _1104()]), () => ( ""))
|
|
14774
14794
|
].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
|
|
14775
14795
|
if (candidates.length === 0) {
|
|
14776
14796
|
return void 0;
|
|
14777
14797
|
}
|
|
14778
|
-
const primaryFont = _optionalChain([candidates, 'access',
|
|
14798
|
+
const primaryFont = _optionalChain([candidates, 'access', _1105 => _1105[0], 'optionalAccess', _1106 => _1106.toLowerCase, 'call', _1107 => _1107()]);
|
|
14779
14799
|
if (primaryFont === "calibri") {
|
|
14780
14800
|
return [
|
|
14781
14801
|
"Calibri",
|
|
@@ -14808,17 +14828,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
|
|
|
14808
14828
|
}
|
|
14809
14829
|
function buildGridlineShadow(color, options) {
|
|
14810
14830
|
const parts = [];
|
|
14811
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
14831
|
+
if (_optionalChain([options, 'optionalAccess', _1108 => _1108.right]) !== false) {
|
|
14812
14832
|
parts.push(`inset -1px 0 0 ${color}`);
|
|
14813
14833
|
}
|
|
14814
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
14834
|
+
if (_optionalChain([options, 'optionalAccess', _1109 => _1109.bottom]) !== false) {
|
|
14815
14835
|
parts.push(`inset 0 -1px 0 ${color}`);
|
|
14816
14836
|
}
|
|
14817
14837
|
return parts.join(", ");
|
|
14818
14838
|
}
|
|
14819
14839
|
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',
|
|
14840
|
+
const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1110 => _1110.showGridLines]), () => ( true));
|
|
14841
|
+
const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _1111 => _1111.colorsByIndex, 'access', _1112 => _1112[0]]), () => ( SHEET_SURFACE));
|
|
14822
14842
|
const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
|
|
14823
14843
|
const css = {
|
|
14824
14844
|
backgroundColor: baseSurface,
|
|
@@ -14831,7 +14851,7 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
14831
14851
|
lineHeight: String(resolveSpreadsheetLineHeight(11)),
|
|
14832
14852
|
overflow: "hidden",
|
|
14833
14853
|
padding: DEFAULT_CELL_PADDING,
|
|
14834
|
-
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
14854
|
+
textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1113 => _1113.generalAlignment]), () => ( "left")),
|
|
14835
14855
|
textOverflow: "clip",
|
|
14836
14856
|
verticalAlign: "bottom",
|
|
14837
14857
|
whiteSpace: "nowrap"
|
|
@@ -14915,24 +14935,24 @@ function buildCellStyle(style, palette, themePalette, options) {
|
|
|
14915
14935
|
}
|
|
14916
14936
|
const border = style.border;
|
|
14917
14937
|
if (border) {
|
|
14918
|
-
const hasRightBorder = Boolean(_optionalChain([border, 'access',
|
|
14919
|
-
const hasBottomBorder = Boolean(_optionalChain([border, 'access',
|
|
14938
|
+
const hasRightBorder = Boolean(_optionalChain([border, 'access', _1114 => _1114.right, 'optionalAccess', _1115 => _1115.style]) && border.right.style !== "none");
|
|
14939
|
+
const hasBottomBorder = Boolean(_optionalChain([border, 'access', _1116 => _1116.bottom, 'optionalAccess', _1117 => _1117.style]) && border.bottom.style !== "none");
|
|
14920
14940
|
if (showGridLines && (hasRightBorder || hasBottomBorder)) {
|
|
14921
14941
|
css.boxShadow = buildGridlineShadow(palette.border, {
|
|
14922
14942
|
bottom: !hasBottomBorder,
|
|
14923
14943
|
right: !hasRightBorder
|
|
14924
14944
|
}) || void 0;
|
|
14925
14945
|
}
|
|
14926
|
-
if (_optionalChain([border, 'access',
|
|
14946
|
+
if (_optionalChain([border, 'access', _1118 => _1118.top, 'optionalAccess', _1119 => _1119.style]) && border.top.style !== "none") {
|
|
14927
14947
|
css.borderTop = mapBorder2(border.top, themePalette);
|
|
14928
14948
|
}
|
|
14929
|
-
if (_optionalChain([border, 'access',
|
|
14949
|
+
if (_optionalChain([border, 'access', _1120 => _1120.right, 'optionalAccess', _1121 => _1121.style]) && border.right.style !== "none") {
|
|
14930
14950
|
css.borderRight = mapBorder2(border.right, themePalette);
|
|
14931
14951
|
}
|
|
14932
|
-
if (_optionalChain([border, 'access',
|
|
14952
|
+
if (_optionalChain([border, 'access', _1122 => _1122.bottom, 'optionalAccess', _1123 => _1123.style]) && border.bottom.style !== "none") {
|
|
14933
14953
|
css.borderBottom = mapBorder2(border.bottom, themePalette);
|
|
14934
14954
|
}
|
|
14935
|
-
if (_optionalChain([border, 'access',
|
|
14955
|
+
if (_optionalChain([border, 'access', _1124 => _1124.left, 'optionalAccess', _1125 => _1125.style]) && border.left.style !== "none") {
|
|
14936
14956
|
css.borderLeft = mapBorder2(border.left, themePalette);
|
|
14937
14957
|
}
|
|
14938
14958
|
}
|
|
@@ -14978,7 +14998,7 @@ function measureTextWidth(value, style) {
|
|
|
14978
14998
|
}
|
|
14979
14999
|
function getCellDisplayValue(worksheet, row, col, activeSheet, locale = "en-US") {
|
|
14980
15000
|
const formula = worksheet.getFormulaAt(row, col);
|
|
14981
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
15001
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _1126 => _1126.cachedFormulaValues, 'optionalAccess', _1127 => _1127[cellAddressToA12({ row, col })]]) : void 0;
|
|
14982
15002
|
const formatted = worksheet.getFormattedValueAt(row, col);
|
|
14983
15003
|
if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
|
|
14984
15004
|
return localizeCellNumber(worksheet, row, col, decodeHtmlEntities2(formatted), locale);
|
|
@@ -15225,7 +15245,7 @@ function normalizeBatchedMergeSpan(value) {
|
|
|
15225
15245
|
}
|
|
15226
15246
|
function normalizeBatchedCellValue(rawValue, formula, row, col, activeSheet) {
|
|
15227
15247
|
const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
|
|
15228
|
-
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess',
|
|
15248
|
+
const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _1128 => _1128.cachedFormulaValues, 'optionalAccess', _1129 => _1129[cellAddressToA12({ row, col })]]) : void 0;
|
|
15229
15249
|
if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
|
|
15230
15250
|
return cachedFormulaValue;
|
|
15231
15251
|
}
|
|
@@ -15272,31 +15292,31 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
15272
15292
|
..._nullishCoalesce(base, () => ( {})),
|
|
15273
15293
|
..._nullishCoalesce(overlay, () => ( {}))
|
|
15274
15294
|
};
|
|
15275
|
-
const baseAlignment = _optionalChain([base, 'optionalAccess',
|
|
15276
|
-
const overlayAlignment = _optionalChain([overlay, 'optionalAccess',
|
|
15295
|
+
const baseAlignment = _optionalChain([base, 'optionalAccess', _1130 => _1130.alignment]);
|
|
15296
|
+
const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _1131 => _1131.alignment]);
|
|
15277
15297
|
if (baseAlignment || overlayAlignment) {
|
|
15278
15298
|
nextStyle.alignment = {
|
|
15279
15299
|
..._nullishCoalesce(baseAlignment, () => ( {})),
|
|
15280
15300
|
..._nullishCoalesce(overlayAlignment, () => ( {}))
|
|
15281
15301
|
};
|
|
15282
15302
|
}
|
|
15283
|
-
const baseBorder = _optionalChain([base, 'optionalAccess',
|
|
15284
|
-
const overlayBorder = _optionalChain([overlay, 'optionalAccess',
|
|
15303
|
+
const baseBorder = _optionalChain([base, 'optionalAccess', _1132 => _1132.border]);
|
|
15304
|
+
const overlayBorder = _optionalChain([overlay, 'optionalAccess', _1133 => _1133.border]);
|
|
15285
15305
|
if (baseBorder || overlayBorder) {
|
|
15286
|
-
nextStyle.border = _optionalChain([options, 'optionalAccess',
|
|
15306
|
+
nextStyle.border = _optionalChain([options, 'optionalAccess', _1134 => _1134.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
|
|
15287
15307
|
..._nullishCoalesce(baseBorder, () => ( {})),
|
|
15288
15308
|
..._nullishCoalesce(overlayBorder, () => ( {}))
|
|
15289
15309
|
};
|
|
15290
15310
|
}
|
|
15291
|
-
const baseFill = _optionalChain([base, 'optionalAccess',
|
|
15292
|
-
const overlayFill = _optionalChain([overlay, 'optionalAccess',
|
|
15311
|
+
const baseFill = _optionalChain([base, 'optionalAccess', _1135 => _1135.fill]);
|
|
15312
|
+
const overlayFill = _optionalChain([overlay, 'optionalAccess', _1136 => _1136.fill]);
|
|
15293
15313
|
if (baseFill || overlayFill) {
|
|
15294
|
-
nextStyle.fill = _optionalChain([options, 'optionalAccess',
|
|
15314
|
+
nextStyle.fill = _optionalChain([options, 'optionalAccess', _1137 => _1137.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
|
|
15295
15315
|
}
|
|
15296
|
-
const baseFont = _optionalChain([base, 'optionalAccess',
|
|
15297
|
-
const overlayFont = _optionalChain([overlay, 'optionalAccess',
|
|
15316
|
+
const baseFont = _optionalChain([base, 'optionalAccess', _1138 => _1138.font]);
|
|
15317
|
+
const overlayFont = _optionalChain([overlay, 'optionalAccess', _1139 => _1139.font]);
|
|
15298
15318
|
if (baseFont || overlayFont) {
|
|
15299
|
-
nextStyle.font = _optionalChain([options, 'optionalAccess',
|
|
15319
|
+
nextStyle.font = _optionalChain([options, 'optionalAccess', _1140 => _1140.replaceXfSubtrees]) && overlayFont ? overlayFont : {
|
|
15300
15320
|
..._nullishCoalesce(baseFont, () => ( {})),
|
|
15301
15321
|
..._nullishCoalesce(overlayFont, () => ( {}))
|
|
15302
15322
|
};
|
|
@@ -15305,6 +15325,7 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
15305
15325
|
}
|
|
15306
15326
|
function SegmentedControl({
|
|
15307
15327
|
items,
|
|
15328
|
+
messages,
|
|
15308
15329
|
onValueChange,
|
|
15309
15330
|
palette,
|
|
15310
15331
|
value
|
|
@@ -15312,7 +15333,7 @@ function SegmentedControl({
|
|
|
15312
15333
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15313
15334
|
"div",
|
|
15314
15335
|
{
|
|
15315
|
-
"aria-label":
|
|
15336
|
+
"aria-label": messages.workbookSheets,
|
|
15316
15337
|
role: "tablist",
|
|
15317
15338
|
style: {
|
|
15318
15339
|
alignItems: "center",
|
|
@@ -15364,6 +15385,8 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15364
15385
|
canZoomIn,
|
|
15365
15386
|
canZoomOut,
|
|
15366
15387
|
defaultZoomScale,
|
|
15388
|
+
locale,
|
|
15389
|
+
messages,
|
|
15367
15390
|
displayFileName,
|
|
15368
15391
|
download,
|
|
15369
15392
|
resetZoom,
|
|
@@ -15419,6 +15442,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15419
15442
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15420
15443
|
"button",
|
|
15421
15444
|
{
|
|
15445
|
+
"aria-label": messages.zoomOut,
|
|
15422
15446
|
disabled: !canZoomOut,
|
|
15423
15447
|
onClick: zoomOut,
|
|
15424
15448
|
style: {
|
|
@@ -15437,6 +15461,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15437
15461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15438
15462
|
"button",
|
|
15439
15463
|
{
|
|
15464
|
+
"aria-label": messages.resetZoom,
|
|
15440
15465
|
onClick: resetZoom,
|
|
15441
15466
|
style: {
|
|
15442
15467
|
background: Math.round(zoomScale) === Math.round(defaultZoomScale) ? "transparent" : palette.subtleSurface,
|
|
@@ -15451,12 +15476,13 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15451
15476
|
padding: "6px 10px"
|
|
15452
15477
|
},
|
|
15453
15478
|
type: "button",
|
|
15454
|
-
children: formatZoomScale(zoomScale)
|
|
15479
|
+
children: formatZoomScale(zoomScale, locale)
|
|
15455
15480
|
}
|
|
15456
15481
|
),
|
|
15457
15482
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15458
15483
|
"button",
|
|
15459
15484
|
{
|
|
15485
|
+
"aria-label": messages.zoomIn,
|
|
15460
15486
|
disabled: !canZoomIn,
|
|
15461
15487
|
onClick: zoomIn,
|
|
15462
15488
|
style: {
|
|
@@ -15478,7 +15504,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15478
15504
|
canDownload ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15479
15505
|
"button",
|
|
15480
15506
|
{
|
|
15481
|
-
"aria-label":
|
|
15507
|
+
"aria-label": messages.downloadWorkbook,
|
|
15482
15508
|
onClick: download,
|
|
15483
15509
|
style: {
|
|
15484
15510
|
alignItems: "center",
|
|
@@ -15495,7 +15521,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15495
15521
|
padding: 0,
|
|
15496
15522
|
width: 32
|
|
15497
15523
|
},
|
|
15498
|
-
title:
|
|
15524
|
+
title: messages.downloadWorkbook,
|
|
15499
15525
|
type: "button",
|
|
15500
15526
|
children: "\u2193"
|
|
15501
15527
|
}
|
|
@@ -15516,10 +15542,11 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15516
15542
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15517
15543
|
SegmentedControl,
|
|
15518
15544
|
{
|
|
15545
|
+
messages,
|
|
15519
15546
|
items: tabs.map((tab, index) => ({
|
|
15520
15547
|
id: String(index),
|
|
15521
15548
|
label: tab.name,
|
|
15522
|
-
title: tab.visibility === "hidden" ?
|
|
15549
|
+
title: tab.visibility === "hidden" ? _chunkZPDHTVL6cjs.formatMessage.call(void 0, messages.hiddenSheet, { sheet: tab.name }) : tab.visibility === "veryHidden" ? _chunkZPDHTVL6cjs.formatMessage.call(void 0, messages.veryHiddenSheet, { sheet: tab.name }) : tab.name,
|
|
15523
15550
|
visibility: tab.visibility
|
|
15524
15551
|
})),
|
|
15525
15552
|
onValueChange: (value) => setActiveTabIndex(Number(value)),
|
|
@@ -15652,11 +15679,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
|
|
|
15652
15679
|
return literal;
|
|
15653
15680
|
}
|
|
15654
15681
|
const splitReference = splitSheetFormulaReference(normalized);
|
|
15655
|
-
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
15656
|
-
if (targetSheetName && _optionalChain([sheet, 'optionalAccess',
|
|
15682
|
+
const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _1141 => _1141.sheetName]), () => ( null));
|
|
15683
|
+
if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _1142 => _1142.name]) && targetSheetName !== sheet.name) {
|
|
15657
15684
|
return literal;
|
|
15658
15685
|
}
|
|
15659
|
-
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess',
|
|
15686
|
+
const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _1143 => _1143.range]), () => ( normalized));
|
|
15660
15687
|
const cell = parseA1CellReference3(cellRef.replace(/\$/g, ""));
|
|
15661
15688
|
if (!cell) {
|
|
15662
15689
|
return literal;
|
|
@@ -15688,8 +15715,8 @@ function normalizeConditionalTextOperand(value) {
|
|
|
15688
15715
|
}
|
|
15689
15716
|
function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
|
|
15690
15717
|
const normalizedRuleType = rule.ruleType.trim().toLowerCase();
|
|
15691
|
-
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
15692
|
-
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access',
|
|
15718
|
+
const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _1144 => _1144.formulas, 'optionalAccess', _1145 => _1145[0]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
15719
|
+
const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _1146 => _1146.formulas, 'optionalAccess', _1147 => _1147[1]]), () => ( "")), worksheet, sheet, batchedCells);
|
|
15693
15720
|
if (normalizedRuleType === "cellis") {
|
|
15694
15721
|
return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
|
|
15695
15722
|
}
|
|
@@ -15720,7 +15747,7 @@ function getStyledConditionalRules(rules) {
|
|
|
15720
15747
|
return styledRules;
|
|
15721
15748
|
}
|
|
15722
15749
|
function resolveConditionalCellStyleForCell(row, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
|
|
15723
|
-
const rules = _optionalChain([sheet, 'optionalAccess',
|
|
15750
|
+
const rules = _optionalChain([sheet, 'optionalAccess', _1148 => _1148.conditionalFormatRules]);
|
|
15724
15751
|
if (!sheet || !rules || rules.length === 0) {
|
|
15725
15752
|
return null;
|
|
15726
15753
|
}
|
|
@@ -15924,11 +15951,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15924
15951
|
if (shape.paragraphs.length === 0) {
|
|
15925
15952
|
return;
|
|
15926
15953
|
}
|
|
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',
|
|
15954
|
+
const inset = _optionalChain([shape, 'access', _1149 => _1149.textBox, 'optionalAccess', _1150 => _1150.insetPx]);
|
|
15955
|
+
const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1151 => _1151.left]), () => ( 6))) * zoomFactor;
|
|
15956
|
+
const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1152 => _1152.right]), () => ( 6))) * zoomFactor;
|
|
15957
|
+
const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1153 => _1153.top]), () => ( 4))) * zoomFactor;
|
|
15958
|
+
const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1154 => _1154.bottom]), () => ( 4))) * zoomFactor;
|
|
15932
15959
|
const textLeft = left + paddingLeft;
|
|
15933
15960
|
const textTop = top + paddingTop;
|
|
15934
15961
|
const textWidth = Math.max(0, width - paddingLeft - paddingRight);
|
|
@@ -15950,9 +15977,9 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15950
15977
|
});
|
|
15951
15978
|
const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
|
|
15952
15979
|
let y = textTop;
|
|
15953
|
-
if (_optionalChain([shape, 'access',
|
|
15980
|
+
if (_optionalChain([shape, 'access', _1155 => _1155.textBox, 'optionalAccess', _1156 => _1156.verticalAlign]) === "middle") {
|
|
15954
15981
|
y = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
|
|
15955
|
-
} else if (_optionalChain([shape, 'access',
|
|
15982
|
+
} else if (_optionalChain([shape, 'access', _1157 => _1157.textBox, 'optionalAccess', _1158 => _1158.verticalAlign]) === "bottom") {
|
|
15956
15983
|
y = textTop + Math.max(0, textHeight - totalTextHeight);
|
|
15957
15984
|
}
|
|
15958
15985
|
context.save();
|
|
@@ -15963,7 +15990,7 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15963
15990
|
shape.paragraphs.forEach((paragraph, paragraphIndex) => {
|
|
15964
15991
|
const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
|
|
15965
15992
|
let x = textLeft;
|
|
15966
|
-
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access',
|
|
15993
|
+
const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _1159 => _1159.textBox, 'optionalAccess', _1160 => _1160.horizontalAlign]))), () => ( "left"));
|
|
15967
15994
|
if (align === "center") {
|
|
15968
15995
|
x = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
|
|
15969
15996
|
} else if (align === "right") {
|
|
@@ -15992,11 +16019,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
|
|
|
15992
16019
|
context.restore();
|
|
15993
16020
|
}
|
|
15994
16021
|
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',
|
|
16022
|
+
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"));
|
|
16023
|
+
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"));
|
|
16024
|
+
const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _1169 => _1169.stroke, 'optionalAccess', _1170 => _1170.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
|
|
15998
16025
|
const vectorShape = resolveShapeVector(shape);
|
|
15999
|
-
const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access',
|
|
16026
|
+
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
16027
|
context.save();
|
|
16001
16028
|
context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
16002
16029
|
if (shape.rotationDeg) {
|
|
@@ -16007,7 +16034,7 @@ function drawStaticShape(context, shape, rect, zoomFactor) {
|
|
|
16007
16034
|
context.lineWidth = lineWidth;
|
|
16008
16035
|
context.strokeStyle = strokeColor;
|
|
16009
16036
|
context.fillStyle = fillColor;
|
|
16010
|
-
applyCanvasShapeDash(context, _optionalChain([shape, 'access',
|
|
16037
|
+
applyCanvasShapeDash(context, _optionalChain([shape, 'access', _1175 => _1175.stroke, 'optionalAccess', _1176 => _1176.dash]), lineWidth);
|
|
16011
16038
|
const localLeft = -rect.width / 2;
|
|
16012
16039
|
const localTop = -rect.height / 2;
|
|
16013
16040
|
if (vectorShape && typeof Path2D !== "undefined") {
|
|
@@ -16144,7 +16171,7 @@ function drawStaticFormControl(context, control, rect, palette, zoomFactor, shee
|
|
|
16144
16171
|
context.restore();
|
|
16145
16172
|
}
|
|
16146
16173
|
function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16147
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16174
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1177 => _1177.conditionalFormatRules]), () => ( []));
|
|
16148
16175
|
const matchingRule = rules.find(
|
|
16149
16176
|
(rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16150
16177
|
);
|
|
@@ -16182,23 +16209,23 @@ function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCac
|
|
|
16182
16209
|
const span = maxValue - minValue;
|
|
16183
16210
|
const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
|
|
16184
16211
|
const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
|
|
16185
|
-
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess',
|
|
16212
|
+
const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _1178 => _1178.themePalette]));
|
|
16186
16213
|
if (!color || widthPercent <= 0) {
|
|
16187
16214
|
return null;
|
|
16188
16215
|
}
|
|
16189
16216
|
return {
|
|
16190
|
-
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess',
|
|
16217
|
+
axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _1179 => _1179.themePalette])), () => ( void 0)),
|
|
16191
16218
|
border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
|
|
16192
|
-
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess',
|
|
16219
|
+
borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _1180 => _1180.themePalette])), () => ( void 0)),
|
|
16193
16220
|
color,
|
|
16194
16221
|
gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
|
|
16195
|
-
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess',
|
|
16196
|
-
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess',
|
|
16222
|
+
negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _1181 => _1181.themePalette])), () => ( void 0)),
|
|
16223
|
+
negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _1182 => _1182.themePalette])), () => ( void 0)),
|
|
16197
16224
|
widthPercent
|
|
16198
16225
|
};
|
|
16199
16226
|
}
|
|
16200
16227
|
function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16201
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16228
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1183 => _1183.conditionalFormatRules]), () => ( []));
|
|
16202
16229
|
const matchingRule = rules.find(
|
|
16203
16230
|
(rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16204
16231
|
);
|
|
@@ -16226,7 +16253,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
16226
16253
|
});
|
|
16227
16254
|
metricsCache.set(cacheKey, ruleValues);
|
|
16228
16255
|
}
|
|
16229
|
-
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess',
|
|
16256
|
+
const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _1184 => _1184.themePalette]))).filter((color) => typeof color === "string");
|
|
16230
16257
|
const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
16231
16258
|
if (colors.length < 2 || thresholds.length < 2) {
|
|
16232
16259
|
return null;
|
|
@@ -16245,7 +16272,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
|
|
|
16245
16272
|
return { color: resolvedColor };
|
|
16246
16273
|
}
|
|
16247
16274
|
function resolveConditionalIconForCell(row, col, worksheet, sheet, metricsCache) {
|
|
16248
|
-
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess',
|
|
16275
|
+
const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _1185 => _1185.conditionalFormatRules]), () => ( []));
|
|
16249
16276
|
const matchingRule = rules.find(
|
|
16250
16277
|
(rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
|
|
16251
16278
|
);
|
|
@@ -16537,7 +16564,7 @@ function GridRow({
|
|
|
16537
16564
|
whiteSpace: "nowrap",
|
|
16538
16565
|
width: "max-content"
|
|
16539
16566
|
} : null;
|
|
16540
|
-
const title = [_optionalChain([cellData, 'access',
|
|
16567
|
+
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
16568
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
16542
16569
|
"td",
|
|
16543
16570
|
{
|
|
@@ -16724,8 +16751,8 @@ var MemoGridRow = React6.memo(GridRow, (prev, next) => {
|
|
|
16724
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) {
|
|
16725
16752
|
return false;
|
|
16726
16753
|
}
|
|
16727
|
-
const prevEditingCol = _optionalChain([prev, 'access',
|
|
16728
|
-
const nextEditingCol = _optionalChain([next, 'access',
|
|
16754
|
+
const prevEditingCol = _optionalChain([prev, 'access', _1190 => _1190.editingCell, 'optionalAccess', _1191 => _1191.row]) === prev.actualRow ? prev.editingCell.col : -1;
|
|
16755
|
+
const nextEditingCol = _optionalChain([next, 'access', _1192 => _1192.editingCell, 'optionalAccess', _1193 => _1193.row]) === next.actualRow ? next.editingCell.col : -1;
|
|
16729
16756
|
if (prevEditingCol !== nextEditingCol) {
|
|
16730
16757
|
return false;
|
|
16731
16758
|
}
|
|
@@ -17192,8 +17219,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17192
17219
|
const pendingRequest = workerThumbnailRowBatchRequestRef.current.get(sheet);
|
|
17193
17220
|
if (!pendingRequest) {
|
|
17194
17221
|
const request = {
|
|
17195
|
-
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
17196
|
-
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess',
|
|
17222
|
+
endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _1194 => _1194.endRow]), () => ( endRow))),
|
|
17223
|
+
startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _1195 => _1195.startRow]), () => ( startRow)))
|
|
17197
17224
|
};
|
|
17198
17225
|
workerThumbnailRowBatchRequestRef.current.set(sheet, request);
|
|
17199
17226
|
void getRowsBatchAsync(
|
|
@@ -17257,7 +17284,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17257
17284
|
}, []);
|
|
17258
17285
|
const thumbnails = React6.useMemo(() => {
|
|
17259
17286
|
return sheets.map((sheet, sheetIndex) => {
|
|
17260
|
-
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess',
|
|
17287
|
+
const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _1196 => _1196.getSheet, 'call', _1197 => _1197(sheet.workbookSheetIndex)]), () => ( null));
|
|
17261
17288
|
const sheetImages = getSheetImages(sheetIndex).filter((image) => image.src).sort((left, right) => left.zIndex - right.zIndex);
|
|
17262
17289
|
const sheetShapes = getSheetShapes(sheetIndex);
|
|
17263
17290
|
const sheetFormControls = getSheetFormControls(sheetIndex).filter((control) => !control.hidden);
|
|
@@ -17273,18 +17300,18 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17273
17300
|
minRow: 0
|
|
17274
17301
|
}));
|
|
17275
17302
|
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',
|
|
17303
|
+
maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1198 => _1198.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
|
|
17304
|
+
maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1199 => _1199.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
|
|
17305
|
+
minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1200 => _1200.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
|
|
17306
|
+
minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _1201 => _1201.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
|
|
17280
17307
|
};
|
|
17281
17308
|
}, null);
|
|
17282
17309
|
const sheetMinUsedRow = (_nullishCoalesce(sheet.maxUsedRow, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedRow, () => ( 0))) ? _nullishCoalesce(sheet.minUsedRow, () => ( 0)) : void 0;
|
|
17283
17310
|
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',
|
|
17311
|
+
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))));
|
|
17312
|
+
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))));
|
|
17313
|
+
const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1206 => _1206.maxRow]), () => ( -1)));
|
|
17314
|
+
const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _1207 => _1207.maxCol]), () => ( -1)));
|
|
17288
17315
|
const showGridLines = _nullishCoalesce(sheet.showGridLines, () => ( true));
|
|
17289
17316
|
const hiddenRowSet = new Set(_nullishCoalesce(sheet.hiddenRows, () => ( [])));
|
|
17290
17317
|
const hiddenColSet = new Set(_nullishCoalesce(sheet.hiddenCols, () => ( [])));
|
|
@@ -17497,8 +17524,8 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17497
17524
|
return cached;
|
|
17498
17525
|
}
|
|
17499
17526
|
const batchCoversRow = workerRowBatch ? row >= workerRowBatch.startRow && row <= workerRowBatch.endRow : false;
|
|
17500
|
-
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess',
|
|
17501
|
-
if (_optionalChain([batchedCell, 'optionalAccess',
|
|
17527
|
+
const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _1208 => _1208.cells, 'access', _1209 => _1209.get, 'call', _1210 => _1210(cacheKey)]) : void 0;
|
|
17528
|
+
if (_optionalChain([batchedCell, 'optionalAccess', _1211 => _1211.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _1212 => _1212.isMergedSecondary, 'call', _1213 => _1213(row, col)])) {
|
|
17502
17529
|
const mergedSecondaryData = {
|
|
17503
17530
|
isMergedSecondary: true,
|
|
17504
17531
|
style: {},
|
|
@@ -17507,23 +17534,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17507
17534
|
cellRenderCache.set(cacheKey, mergedSecondaryData);
|
|
17508
17535
|
return mergedSecondaryData;
|
|
17509
17536
|
}
|
|
17510
|
-
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
17537
|
+
const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _1214 => _1214.mergeSpan]);
|
|
17511
17538
|
const inheritedStyle = resolveInheritedCellStyle2(sheet, row, col);
|
|
17512
|
-
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17539
|
+
const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1215 => _1215.style]), () => ( null));
|
|
17513
17540
|
const mergedStyle = mergeResolvedCellStyle(inheritedStyle, worksheetStyle, { replaceXfSubtrees: true });
|
|
17514
17541
|
const conditionalCellStyle = resolveConditionalCellStyleForCell(
|
|
17515
17542
|
row,
|
|
17516
17543
|
col,
|
|
17517
17544
|
sheet,
|
|
17518
17545
|
() => worksheet ? getCellNumericValue(worksheet, row, col) : getBatchedCellNumericValue(batchedCell),
|
|
17519
|
-
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17546
|
+
() => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1216 => _1216.value]), () => ( "")),
|
|
17520
17547
|
worksheet,
|
|
17521
|
-
_optionalChain([workerRowBatch, 'optionalAccess',
|
|
17548
|
+
_optionalChain([workerRowBatch, 'optionalAccess', _1217 => _1217.cells])
|
|
17522
17549
|
);
|
|
17523
17550
|
const finalResolvedStyle = mergeResolvedCellStyle(mergedStyle, conditionalCellStyle);
|
|
17524
|
-
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
17551
|
+
const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _1218 => _1218.alignment]);
|
|
17525
17552
|
const sparkline = _nullishCoalesce(sparklineByCell.get(cacheKey), () => ( null));
|
|
17526
|
-
const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess',
|
|
17553
|
+
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
17554
|
const sparklineValues = sparkline ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
|
|
17528
17555
|
{ length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
|
|
17529
17556
|
(_, index) => getNumericValue(
|
|
@@ -17537,23 +17564,23 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17537
17564
|
sparkline.range.start.col
|
|
17538
17565
|
)
|
|
17539
17566
|
) : null;
|
|
17540
|
-
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess',
|
|
17567
|
+
const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _1222 => _1222.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
|
|
17541
17568
|
const nextData = {
|
|
17542
17569
|
canvas: void 0,
|
|
17543
17570
|
checkboxState,
|
|
17544
|
-
colSpan: _optionalChain([merge, 'optionalAccess',
|
|
17571
|
+
colSpan: _optionalChain([merge, 'optionalAccess', _1223 => _1223.colSpan]),
|
|
17545
17572
|
conditionalColorScale: worksheet ? resolveConditionalColorScaleForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17546
17573
|
conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17547
17574
|
conditionalIcon: worksheet ? resolveConditionalIconForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
|
|
17548
17575
|
isMergedSecondary: false,
|
|
17549
|
-
rowSpan: _optionalChain([merge, 'optionalAccess',
|
|
17576
|
+
rowSpan: _optionalChain([merge, 'optionalAccess', _1224 => _1224.rowSpan]),
|
|
17550
17577
|
sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
|
|
17551
17578
|
style: buildCellStyle(finalResolvedStyle, palette, sheet.themePalette, {
|
|
17552
|
-
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess',
|
|
17579
|
+
generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _1225 => _1225.generalAlignment]),
|
|
17553
17580
|
showGridLines
|
|
17554
17581
|
}),
|
|
17555
|
-
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess',
|
|
17556
|
-
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess',
|
|
17582
|
+
textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1226 => _1226.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1227 => _1227.textRotation])))),
|
|
17583
|
+
value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1228 => _1228.value]), () => ( ""))
|
|
17557
17584
|
};
|
|
17558
17585
|
nextData.canvas = buildCanvasCellStyleCache(nextData.style);
|
|
17559
17586
|
cellRenderCache.set(cacheKey, nextData);
|
|
@@ -17571,11 +17598,11 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17571
17598
|
let height = rowItem.size;
|
|
17572
17599
|
for (let colOffset = 1; colOffset < colSpan; colOffset += 1) {
|
|
17573
17600
|
const nextCol = colItemByActual.get(colItem.actualIndex + colOffset);
|
|
17574
|
-
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess',
|
|
17601
|
+
width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _1229 => _1229.size]), () => ( 0));
|
|
17575
17602
|
}
|
|
17576
17603
|
for (let rowOffset = 1; rowOffset < rowSpan; rowOffset += 1) {
|
|
17577
17604
|
const nextRow = rowItemByActual.get(rowItem.actualIndex + rowOffset);
|
|
17578
|
-
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess',
|
|
17605
|
+
height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _1230 => _1230.size]), () => ( 0));
|
|
17579
17606
|
}
|
|
17580
17607
|
const rect = {
|
|
17581
17608
|
height,
|
|
@@ -17585,7 +17612,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17585
17612
|
};
|
|
17586
17613
|
const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellData.style)));
|
|
17587
17614
|
const gradientFill = typeof cellData.style.backgroundImage === "string" ? resolveCanvasGradientFill(context, rect, cellData.style.backgroundImage) : null;
|
|
17588
|
-
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access',
|
|
17615
|
+
const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _1231 => _1231.conditionalColorScale, 'optionalAccess', _1232 => _1232.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
|
|
17589
17616
|
context.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
|
|
17590
17617
|
context.fillRect(rect.left, rect.top, rect.width, rect.height);
|
|
17591
17618
|
if (cellData.conditionalDataBar) {
|
|
@@ -17830,7 +17857,7 @@ function useXlsxViewerThumbnails(options = {}) {
|
|
|
17830
17857
|
workbook
|
|
17831
17858
|
]);
|
|
17832
17859
|
const paintThumbnail = React6.useCallback(
|
|
17833
|
-
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access',
|
|
17860
|
+
(sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _1233 => _1233[sheetIndex], 'optionalAccess', _1234 => _1234.paint, 'call', _1235 => _1235(canvas)]), () => ( false)),
|
|
17834
17861
|
[thumbnails]
|
|
17835
17862
|
);
|
|
17836
17863
|
return React6.useMemo(
|
|
@@ -17889,7 +17916,7 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
|
|
|
17889
17916
|
}
|
|
17890
17917
|
destroy() {
|
|
17891
17918
|
this.destroyed = true;
|
|
17892
|
-
_optionalChain([this, 'access',
|
|
17919
|
+
_optionalChain([this, 'access', _1236 => _1236.observer, 'optionalAccess', _1237 => _1237.disconnect, 'call', _1238 => _1238()]);
|
|
17893
17920
|
this.observer = null;
|
|
17894
17921
|
this.slots.clear();
|
|
17895
17922
|
this.listeners.clear();
|
|
@@ -17931,7 +17958,7 @@ function RuntimeContent({ content }) {
|
|
|
17931
17958
|
};
|
|
17932
17959
|
}, []);
|
|
17933
17960
|
React7.useLayoutEffect(() => {
|
|
17934
|
-
_optionalChain([rootRef, 'access',
|
|
17961
|
+
_optionalChain([rootRef, 'access', _1239 => _1239.current, 'optionalAccess', _1240 => _1240.update, 'call', _1241 => _1241(content)]);
|
|
17935
17962
|
}, [content]);
|
|
17936
17963
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref: hostRef, style: { display: "contents" } });
|
|
17937
17964
|
}
|
|
@@ -17974,7 +18001,9 @@ function renderOptions(props, controller, slots, owner) {
|
|
|
17974
18001
|
renderTableHeaderMenu: renderTableHeaderMenu ? (value) => slot(`table:${value.table.name}:${value.cell.row}:${value.cell.col}`, renderTableHeaderMenu(value)) : void 0
|
|
17975
18002
|
};
|
|
17976
18003
|
}
|
|
17977
|
-
function BoundViewer({ props, controller }) {
|
|
18004
|
+
function BoundViewer({ props, controller: sourceController }) {
|
|
18005
|
+
const messages = React7.useMemo(() => _chunkZPDHTVL6cjs.mergeMessages.call(void 0, sourceController.messages, props.messages), [sourceController.messages, props.messages]);
|
|
18006
|
+
const controller = React7.useMemo(() => ({ ...sourceController, messages }), [sourceController, messages]);
|
|
17978
18007
|
const hostRef = React7.useRef(null);
|
|
17979
18008
|
const viewerRef = React7.useRef(null);
|
|
17980
18009
|
const slots = React7.useMemo(() => new SlotStore(), []);
|
|
@@ -17993,7 +18022,7 @@ function BoundViewer({ props, controller }) {
|
|
|
17993
18022
|
}, [slots]);
|
|
17994
18023
|
React7.useLayoutEffect(() => {
|
|
17995
18024
|
const host = hostRef.current;
|
|
17996
|
-
if (host) _optionalChain([viewerRef, 'access',
|
|
18025
|
+
if (host) _optionalChain([viewerRef, 'access', _1242 => _1242.current, 'optionalAccess', _1243 => _1243.update, 'call', _1244 => _1244(renderOptions(props, controller, slots, host.ownerDocument))]);
|
|
17997
18026
|
}, [controller, props, slots]);
|
|
17998
18027
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ViewerAppearanceContext.Provider, { value: {
|
|
17999
18028
|
headerBackgroundColor: props.headerBackgroundColor,
|