@extend-ai/react-xlsx 0.8.1 → 0.8.3

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/index.cjs CHANGED
@@ -6309,6 +6309,84 @@ function resizeImageRect(rect, handle, deltaX, deltaY, minimumSize = 16) {
6309
6309
  return { height, left, top, width };
6310
6310
  }
6311
6311
 
6312
+ // src/safe-calculate.ts
6313
+ var SHEET_REF_REGEX = /'((?:[^']|'')+)'!|([A-Za-z_\u0080-\uFFFF][\w.\u0080-\uFFFF]*)!/g;
6314
+ function collectReferencedSheetNames(workbook) {
6315
+ const referenced = /* @__PURE__ */ new Set();
6316
+ for (let sheetIdx = 0; sheetIdx < workbook.sheetCount; sheetIdx += 1) {
6317
+ let sheet;
6318
+ try {
6319
+ sheet = workbook.getSheet(sheetIdx);
6320
+ } catch {
6321
+ continue;
6322
+ }
6323
+ const cells = sheet.formulaCells;
6324
+ if (!Array.isArray(cells)) {
6325
+ continue;
6326
+ }
6327
+ for (const cell of cells) {
6328
+ const formula = cell?.formula;
6329
+ if (!formula) {
6330
+ continue;
6331
+ }
6332
+ SHEET_REF_REGEX.lastIndex = 0;
6333
+ let match;
6334
+ while ((match = SHEET_REF_REGEX.exec(formula)) !== null) {
6335
+ const raw = match[1] ?? match[2];
6336
+ if (!raw) {
6337
+ continue;
6338
+ }
6339
+ referenced.add(raw.replace(/''/g, "'"));
6340
+ }
6341
+ }
6342
+ }
6343
+ return referenced;
6344
+ }
6345
+ function hasUnresolvedSheetReferences(workbook) {
6346
+ let names;
6347
+ try {
6348
+ names = workbook.sheetNames;
6349
+ } catch {
6350
+ return false;
6351
+ }
6352
+ const known = new Set(names);
6353
+ const referenced = collectReferencedSheetNames(workbook);
6354
+ for (const name of referenced) {
6355
+ if (!known.has(name)) {
6356
+ return true;
6357
+ }
6358
+ }
6359
+ return false;
6360
+ }
6361
+ function safeCalculate(workbook, options = {}) {
6362
+ if (hasUnresolvedSheetReferences(workbook)) {
6363
+ return { workbook, calculated: false, skipReason: "unresolved-sheet-refs" };
6364
+ }
6365
+ try {
6366
+ workbook.calculate();
6367
+ return { workbook, calculated: true, skipReason: null };
6368
+ } catch (err) {
6369
+ console.warn("[react-xlsx] workbook.calculate() trapped; falling back to cached formula values", err);
6370
+ if (options.reparse) {
6371
+ try {
6372
+ return { workbook: options.reparse(), calculated: false, skipReason: "calculate-trapped" };
6373
+ } catch (reparseErr) {
6374
+ console.warn("[react-xlsx] workbook reparse after calculate trap failed", reparseErr);
6375
+ }
6376
+ }
6377
+ return { workbook, calculated: false, skipReason: "calculate-trapped" };
6378
+ }
6379
+ }
6380
+ function tryRecalculate(workbook) {
6381
+ try {
6382
+ workbook.calculate();
6383
+ return { calculated: true, error: null };
6384
+ } catch (err) {
6385
+ console.warn("[react-xlsx] workbook.calculate() trapped during recalculation", err);
6386
+ return { calculated: false, error: err };
6387
+ }
6388
+ }
6389
+
6312
6390
  // src/wasm.ts
6313
6391
  var wasmModulePromise = null;
6314
6392
  function getSheetsWasmModule() {
@@ -7117,18 +7195,21 @@ async function resolveWorkbookBuffer({ file, src }, signal) {
7117
7195
  }
7118
7196
  async function parseWorkbookBuffer(buffer) {
7119
7197
  const wasmModule = await getSheetsWasmModule();
7120
- const workbook = wasmModule.Workbook.fromBytes(new Uint8Array(buffer));
7198
+ const initialWorkbook = wasmModule.Workbook.fromBytes(new Uint8Array(buffer));
7121
7199
  let totalFormulas = 0;
7122
- for (let index = 0; index < workbook.sheetCount; index += 1) {
7123
- totalFormulas += workbook.getSheet(index).formulaCount;
7200
+ for (let index = 0; index < initialWorkbook.sheetCount; index += 1) {
7201
+ totalFormulas += initialWorkbook.getSheet(index).formulaCount;
7124
7202
  }
7125
7203
  const shouldAutoCalculate = totalFormulas <= FORMULA_COUNT_THRESHOLD;
7126
- if (shouldAutoCalculate) {
7127
- workbook.calculate();
7204
+ if (!shouldAutoCalculate) {
7205
+ return { shouldAutoCalculate, workbook: initialWorkbook };
7128
7206
  }
7207
+ const result = safeCalculate(initialWorkbook, {
7208
+ reparse: () => wasmModule.Workbook.fromBytes(new Uint8Array(buffer))
7209
+ });
7129
7210
  return {
7130
- shouldAutoCalculate,
7131
- workbook
7211
+ shouldAutoCalculate: result.calculated,
7212
+ workbook: result.workbook
7132
7213
  };
7133
7214
  }
7134
7215
  function scheduleLowPriorityTask(task) {
@@ -8369,7 +8450,10 @@ function useXlsxViewerController(options) {
8369
8450
  if (!shouldAutoCalculate) {
8370
8451
  return;
8371
8452
  }
8372
- targetWorkbook.calculate();
8453
+ const result = tryRecalculate(targetWorkbook);
8454
+ if (!result.calculated) {
8455
+ setShouldAutoCalculate(false);
8456
+ }
8373
8457
  }, [shouldAutoCalculate]);
8374
8458
  const getActiveWorksheet = React.useCallback(() => {
8375
8459
  if (!workbook || !activeSheet) {
@@ -9006,8 +9090,12 @@ function useXlsxViewerController(options) {
9006
9090
  if (!workbook) {
9007
9091
  return;
9008
9092
  }
9009
- workbook.calculate();
9010
- refreshWorkbookState(workbook);
9093
+ const result = tryRecalculate(workbook);
9094
+ if (result.calculated) {
9095
+ refreshWorkbookState(workbook);
9096
+ return;
9097
+ }
9098
+ setShouldAutoCalculate(false);
9011
9099
  }, [refreshWorkbookState, workbook]);
9012
9100
  const resizeColumn = React.useCallback((col, widthPx) => {
9013
9101
  if (readOnly && !canResizeReadOnly || !workbook || !activeSheet) {
@@ -20491,6 +20579,7 @@ function GridRow({
20491
20579
  actualRow,
20492
20580
  editingCell,
20493
20581
  editingValue,
20582
+ frozenRowHeaderZIndex,
20494
20583
  getCellData,
20495
20584
  headerLabelLiveScale,
20496
20585
  leadingSpacerWidth,
@@ -20507,6 +20596,7 @@ function GridRow({
20507
20596
  readOnly,
20508
20597
  renderCellAdornment,
20509
20598
  rowHeight,
20599
+ rowHeaderZIndex,
20510
20600
  rowHeaderWidth,
20511
20601
  stickyLeftByCol,
20512
20602
  stickyTop,
@@ -20539,7 +20629,7 @@ function GridRow({
20539
20629
  textAlign: "center",
20540
20630
  userSelect: "none",
20541
20631
  width: rowHeaderWidth,
20542
- zIndex: stickyTop !== void 0 ? 45 : 35
20632
+ zIndex: stickyTop !== void 0 ? frozenRowHeaderZIndex : rowHeaderZIndex
20543
20633
  },
20544
20634
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { position: "relative" }, children: [
20545
20635
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -20898,7 +20988,7 @@ function XlsxGrid({
20898
20988
  renderImageSelection,
20899
20989
  renderTableHeaderMenu,
20900
20990
  enableGestureZoom = true,
20901
- experimentalCanvas = false,
20991
+ experimentalCanvas = true,
20902
20992
  selectionColor,
20903
20993
  selectionFillColor,
20904
20994
  selectionHeaderColor,
@@ -22338,16 +22428,16 @@ function XlsxGrid({
22338
22428
  }, []);
22339
22429
  const resolvePointerCellFromClient = React4.useCallback((clientX, clientY) => {
22340
22430
  const geometryCell = resolvePointerCellFromGeometry(clientX, clientY);
22341
- if (geometryCell && !worksheet?.isMergedSecondary(geometryCell.row, geometryCell.col)) {
22342
- return resolveMergeAnchorCell(geometryCell);
22431
+ if (geometryCell) {
22432
+ return geometryCell;
22343
22433
  }
22344
- const resolvedCell = resolvePointerCellFromHitTest(clientX, clientY) ?? geometryCell;
22434
+ const resolvedCell = resolvePointerCellFromHitTest(clientX, clientY);
22345
22435
  return resolvedCell ? resolveMergeAnchorCell(resolvedCell) : null;
22346
- }, [resolveMergeAnchorCell, resolvePointerCellFromGeometry, resolvePointerCellFromHitTest, worksheet]);
22436
+ }, [resolveMergeAnchorCell, resolvePointerCellFromGeometry, resolvePointerCellFromHitTest]);
22347
22437
  const resolveDraggedSelectionCell = React4.useCallback((dragState, clientX, clientY) => {
22348
22438
  const geometryCell = resolvePointerCellFromGeometry(clientX, clientY);
22349
22439
  const hitCell = resolvePointerCellFromHitTest(clientX, clientY);
22350
- const actualRow = hitCell && rowIndexByActual.has(hitCell.row) ? hitCell.row : geometryCell?.row;
22440
+ const actualRow = geometryCell?.row ?? (hitCell && rowIndexByActual.has(hitCell.row) ? hitCell.row : void 0);
22351
22441
  const actualCol = geometryCell?.col ?? hitCell?.col;
22352
22442
  if (actualRow === void 0 || actualCol === void 0) {
22353
22443
  return null;
@@ -22358,8 +22448,8 @@ function XlsxGrid({
22358
22448
  if (dragState.axis === "column") {
22359
22449
  return { row: dragState.originCell.row, col: actualCol };
22360
22450
  }
22361
- return resolveMergeAnchorCell({ row: actualRow, col: actualCol });
22362
- }, [resolveMergeAnchorCell, resolvePointerCellFromGeometry, resolvePointerCellFromHitTest, rowIndexByActual]);
22451
+ return { row: actualRow, col: actualCol };
22452
+ }, [resolvePointerCellFromGeometry, resolvePointerCellFromHitTest, rowIndexByActual]);
22363
22453
  const resolveCellPointerOrigin = React4.useCallback((cell, rect, clientX, clientY) => {
22364
22454
  const rowIndex = rowIndexByActual.get(cell.row);
22365
22455
  const colIndex = colIndexByActual.get(cell.col);
@@ -22377,6 +22467,40 @@ function XlsxGrid({
22377
22467
  originContentY: (rowPrefixSums[rowIndex] ?? 0) + clampContentOffset((clientY - rect.top) / contentScaleY, displayHeight)
22378
22468
  };
22379
22469
  }, [colIndexByActual, colPrefixSums, displayDefaultColWidth, displayDefaultRowHeight, displayEffectiveColWidths, displayEffectiveRowHeights, rowIndexByActual, rowPrefixSums]);
22470
+ const resolveCellPointerOriginFromClient = React4.useCallback((cell, clientX, clientY) => {
22471
+ const scroller = scrollRef.current;
22472
+ const rowIndex = rowIndexByActual.get(cell.row);
22473
+ const colIndex = colIndexByActual.get(cell.col);
22474
+ if (!scroller || rowIndex === void 0 || colIndex === void 0) {
22475
+ return null;
22476
+ }
22477
+ const scrollerRect = cachedScrollerRectRef.current ?? scroller.getBoundingClientRect();
22478
+ const pointerOffsetX = clientX - scrollerRect.left;
22479
+ const pointerOffsetY = clientY - scrollerRect.top;
22480
+ const localX = pointerOffsetX + (pointerOffsetX >= frozenPaneRight ? scroller.scrollLeft : 0);
22481
+ const localY = pointerOffsetY + (pointerOffsetY >= frozenPaneBottom ? scroller.scrollTop : 0);
22482
+ const displayWidth = displayEffectiveColWidths[colIndex] ?? displayDefaultColWidth;
22483
+ const displayHeight = displayEffectiveRowHeights[rowIndex] ?? displayDefaultRowHeight;
22484
+ return {
22485
+ contentScaleX: 1,
22486
+ contentScaleY: 1,
22487
+ originContentX: (colPrefixSums[colIndex] ?? 0) + clampContentOffset(localX - displayRowHeaderWidth - (colPrefixSums[colIndex] ?? 0), displayWidth),
22488
+ originContentY: (rowPrefixSums[rowIndex] ?? 0) + clampContentOffset(localY - displayHeaderHeight - (rowPrefixSums[rowIndex] ?? 0), displayHeight)
22489
+ };
22490
+ }, [
22491
+ colIndexByActual,
22492
+ colPrefixSums,
22493
+ displayDefaultColWidth,
22494
+ displayDefaultRowHeight,
22495
+ displayEffectiveColWidths,
22496
+ displayEffectiveRowHeights,
22497
+ displayHeaderHeight,
22498
+ displayRowHeaderWidth,
22499
+ frozenPaneBottom,
22500
+ frozenPaneRight,
22501
+ rowIndexByActual,
22502
+ rowPrefixSums
22503
+ ]);
22380
22504
  const resolveRowPointerOrigin = React4.useCallback((actualRow, rect, clientY) => {
22381
22505
  const rowIndex = rowIndexByActual.get(actualRow);
22382
22506
  if (rowIndex === void 0) {
@@ -23125,10 +23249,11 @@ function XlsxGrid({
23125
23249
  }, [resolveMountedCellOverlayRect]);
23126
23250
  const resolveGeometryOverlayRect = React4.useCallback((range) => {
23127
23251
  const normalized = normalizeRange2(range);
23128
- const startCell = resolveMergeAnchorCell(normalized.start);
23129
23252
  const isSingleCellSelection = normalized.start.row === normalized.end.row && normalized.start.col === normalized.end.col;
23130
- const merge = isSingleCellSelection ? worksheet?.getMergeSpan(startCell.row, startCell.col) : null;
23131
- const endCell = isSingleCellSelection ? {
23253
+ const isMergedSecondarySelection = isSingleCellSelection ? worksheet?.isMergedSecondary(normalized.start.row, normalized.start.col) === true : false;
23254
+ const startCell = isSingleCellSelection && !isMergedSecondarySelection ? resolveMergeAnchorCell(normalized.start) : normalized.start;
23255
+ const merge = isSingleCellSelection && !isMergedSecondarySelection ? worksheet?.getMergeSpan(startCell.row, startCell.col) : null;
23256
+ const endCell = isSingleCellSelection && !isMergedSecondarySelection ? {
23132
23257
  row: startCell.row + Math.max(1, merge?.rowSpan ?? 1) - 1,
23133
23258
  col: startCell.col + Math.max(1, merge?.colSpan ?? 1) - 1
23134
23259
  } : normalized.end;
@@ -23760,13 +23885,14 @@ function XlsxGrid({
23760
23885
  }
23761
23886
  event.preventDefault();
23762
23887
  focusGrid();
23888
+ const targetCell = event.currentTarget.colSpan > 1 || event.currentTarget.rowSpan > 1 ? resolvePointerCellFromGeometry(event.clientX, event.clientY) ?? cell : cell;
23763
23889
  const currentSelection = selectionRef.current;
23764
- const anchor = event.shiftKey && currentSelection ? currentSelection.start : cell;
23765
- const initialRange = normalizeRange2({ start: anchor, end: cell });
23766
- const isActive = isSameCell(activeCellRef.current, cell);
23890
+ const anchor = event.shiftKey && currentSelection ? currentSelection.start : targetCell;
23891
+ const initialRange = normalizeRange2({ start: anchor, end: targetCell });
23892
+ const isActive = isSameCell(activeCellRef.current, targetCell);
23767
23893
  const committedOnPointerDown = !isActive || !editingCellRef.current;
23768
- const pointerOrigin = resolveCellPointerOrigin(cell, event.currentTarget.getBoundingClientRect(), event.clientX, event.clientY);
23769
- const originOverlayRect = resolveMountedCellOverlayRect(event.currentTarget);
23894
+ const pointerOrigin = targetCell.row === cell.row && targetCell.col === cell.col ? resolveCellPointerOrigin(cell, event.currentTarget.getBoundingClientRect(), event.clientX, event.clientY) : resolveCellPointerOriginFromClient(targetCell, event.clientX, event.clientY);
23895
+ const originOverlayRect = targetCell.row === cell.row && targetCell.col === cell.col ? resolveMountedCellOverlayRect(event.currentTarget) : resolveOverlayRect(initialRange);
23770
23896
  if (!pointerOrigin) {
23771
23897
  return;
23772
23898
  }
@@ -23774,7 +23900,7 @@ function XlsxGrid({
23774
23900
  event.pointerId,
23775
23901
  anchor,
23776
23902
  "cell",
23777
- cell,
23903
+ targetCell,
23778
23904
  pointerOrigin,
23779
23905
  originOverlayRect,
23780
23906
  committedOnPointerDown,
@@ -23782,11 +23908,25 @@ function XlsxGrid({
23782
23908
  event.clientX,
23783
23909
  event.clientY
23784
23910
  );
23785
- applyPreviewOverlayFromElement(event.currentTarget, initialRange);
23911
+ if (targetCell.row === cell.row && targetCell.col === cell.col) {
23912
+ applyPreviewOverlayFromElement(event.currentTarget, initialRange);
23913
+ } else {
23914
+ applyPreviewOverlay(initialRange);
23915
+ }
23786
23916
  if (committedOnPointerDown) {
23787
23917
  commitSelectionRange(initialRange);
23788
23918
  }
23789
- }, [applyPreviewOverlayFromElement, commitSelectionRange, focusGrid, resolveCellPointerOrigin, resolveMountedCellOverlayRect]);
23919
+ }, [
23920
+ applyPreviewOverlay,
23921
+ applyPreviewOverlayFromElement,
23922
+ commitSelectionRange,
23923
+ focusGrid,
23924
+ resolveCellPointerOrigin,
23925
+ resolveCellPointerOriginFromClient,
23926
+ resolveMountedCellOverlayRect,
23927
+ resolveOverlayRect,
23928
+ resolvePointerCellFromGeometry
23929
+ ]);
23790
23930
  const handleRowPointerDown = React4.useCallback((event, actualRow) => {
23791
23931
  if (event.button !== 0 || firstVisibleCol === void 0 || lastVisibleCol === void 0) {
23792
23932
  return;
@@ -25003,7 +25143,7 @@ function XlsxGrid({
25003
25143
  paneContext.textBaseline = "middle";
25004
25144
  paneContext.fillText(`${row.actualRow + 1}`, rowHeaderWidth / 2, row.localTop + row.height / 2);
25005
25145
  }
25006
- cornerContext.fillStyle = palette.rowHeaderSurface;
25146
+ cornerContext.fillStyle = palette.headerSurface;
25007
25147
  cornerContext.fillRect(0, 0, rowHeaderWidth, headerHeight);
25008
25148
  cornerContext.strokeStyle = palette.border;
25009
25149
  cornerContext.lineWidth = 1;
@@ -25286,7 +25426,18 @@ function XlsxGrid({
25286
25426
  const canvasSelectionTransition = shouldAnimateCanvasSelection ? "left 120ms cubic-bezier(0.22, 1, 0.36, 1), top 120ms cubic-bezier(0.22, 1, 0.36, 1), width 120ms cubic-bezier(0.22, 1, 0.36, 1), height 120ms cubic-bezier(0.22, 1, 0.36, 1), opacity 100ms linear" : "none";
25287
25427
  const rowColSpan = renderedCols.length + 1 + (leadingColumnSpacerWidth > 0 ? 1 : 0) + (trailingColumnSpacerWidth > 0 ? 1 : 0);
25288
25428
  const gutterSeparatorShadow = `inset -1px 0 0 ${palette.border}, inset 0 -1px 0 ${palette.border}`;
25289
- const canvasHeaderOverlayZIndex = 1e5;
25429
+ const maxDrawingOverlayZIndex = Math.max(
25430
+ 0,
25431
+ ...shapes.map((shape) => shape.zIndex + 20),
25432
+ ...formControls.map((control) => control.zIndex + 20),
25433
+ ...images.map((image) => image.zIndex + 22),
25434
+ ...charts.map((chart) => chart.zIndex + 22)
25435
+ );
25436
+ const rowHeaderOverlayZIndex = Math.max(35, maxDrawingOverlayZIndex + 1);
25437
+ const canvasHeaderOverlayZIndex = Math.max(50, rowHeaderOverlayZIndex + 1);
25438
+ const stickyHeaderOverlayZIndex = canvasHeaderOverlayZIndex + 1;
25439
+ const cornerHeaderOverlayZIndex = canvasHeaderOverlayZIndex + 2;
25440
+ const frozenRowHeaderOverlayZIndex = rowHeaderOverlayZIndex;
25290
25441
  const headerCellStyle = scaleCssProperties({
25291
25442
  backgroundColor: palette.headerSurface,
25292
25443
  borderBottom: "none",
@@ -25303,7 +25454,7 @@ function XlsxGrid({
25303
25454
  top: 0,
25304
25455
  userSelect: "none",
25305
25456
  whiteSpace: "nowrap",
25306
- zIndex: 50
25457
+ zIndex: canvasHeaderOverlayZIndex
25307
25458
  }, zoomFactor);
25308
25459
  const columnResizeHandleStyle = scaleCssProperties({
25309
25460
  backgroundColor: "transparent",
@@ -25392,7 +25543,7 @@ function XlsxGrid({
25392
25543
  display: topFrozenHeaderCanvasWidth > 0 && drawingViewport.height > 0 ? "block" : "none",
25393
25544
  left: displayRowHeaderWidth,
25394
25545
  top: 0,
25395
- zIndex: canvasHeaderOverlayZIndex + 1
25546
+ zIndex: stickyHeaderOverlayZIndex
25396
25547
  };
25397
25548
  const canvasTopScrollHeaderStyle = {
25398
25549
  ...canvasHeaderBaseStyle,
@@ -25406,7 +25557,7 @@ function XlsxGrid({
25406
25557
  display: leftFrozenHeaderCanvasHeight > 0 && drawingViewport.width > 0 ? "block" : "none",
25407
25558
  left: 0,
25408
25559
  top: displayHeaderHeight,
25409
- zIndex: canvasHeaderOverlayZIndex + 1
25560
+ zIndex: stickyHeaderOverlayZIndex
25410
25561
  };
25411
25562
  const canvasLeftScrollHeaderStyle = {
25412
25563
  ...canvasHeaderBaseStyle,
@@ -25422,7 +25573,7 @@ function XlsxGrid({
25422
25573
  position: "absolute",
25423
25574
  top: 0,
25424
25575
  transformOrigin: "0 0",
25425
- zIndex: canvasHeaderOverlayZIndex + 1
25576
+ zIndex: cornerHeaderOverlayZIndex
25426
25577
  };
25427
25578
  const editingOverlayRect = experimentalCanvas && editingCell ? resolveCellDisplayRect(editingCell) : null;
25428
25579
  const activeCellAdornment = experimentalCanvas && activeCell ? renderCellAdornment(activeCell) : null;
@@ -26756,7 +26907,7 @@ function XlsxGrid({
26756
26907
  )),
26757
26908
  trailingColumnSpacerWidth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("col", { style: { width: trailingColumnSpacerWidth } }) : null
26758
26909
  ] }),
26759
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { style: { position: "sticky", top: 0, zIndex: 50 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { children: [
26910
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { style: { position: "sticky", top: 0, zIndex: canvasHeaderOverlayZIndex }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { children: [
26760
26911
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
26761
26912
  "th",
26762
26913
  {
@@ -26765,7 +26916,7 @@ function XlsxGrid({
26765
26916
  backgroundColor: palette.headerSurface,
26766
26917
  left: 0,
26767
26918
  width: displayRowHeaderWidth,
26768
- zIndex: 60
26919
+ zIndex: cornerHeaderOverlayZIndex
26769
26920
  }
26770
26921
  }
26771
26922
  ),
@@ -26779,7 +26930,7 @@ function XlsxGrid({
26779
26930
  style: {
26780
26931
  ...headerCellStyle,
26781
26932
  left: stickyLeftByCol.get(column.actualCol),
26782
- zIndex: stickyLeftByCol.has(column.actualCol) ? 55 : headerCellStyle.zIndex
26933
+ zIndex: stickyLeftByCol.has(column.actualCol) ? stickyHeaderOverlayZIndex : headerCellStyle.zIndex
26783
26934
  },
26784
26935
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { position: "relative" }, children: [
26785
26936
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -26834,6 +26985,7 @@ function XlsxGrid({
26834
26985
  actualRow,
26835
26986
  editingCell,
26836
26987
  editingValue,
26988
+ frozenRowHeaderZIndex: frozenRowHeaderOverlayZIndex,
26837
26989
  getCellData,
26838
26990
  leadingSpacerWidth: leadingColumnSpacerWidth,
26839
26991
  onCellClick: handleCellClick,
@@ -26850,6 +27002,7 @@ function XlsxGrid({
26850
27002
  readOnly,
26851
27003
  renderCellAdornment,
26852
27004
  rowHeight: virtualRow.size,
27005
+ rowHeaderZIndex: rowHeaderOverlayZIndex,
26853
27006
  rowHeaderWidth: displayRowHeaderWidth,
26854
27007
  stickyLeftByCol,
26855
27008
  stickyTop: stickyTopByRow.get(actualRow),
@@ -27018,7 +27171,7 @@ function XlsxViewerInner({
27018
27171
  enableCanvasSelectionAnimation = true,
27019
27172
  enableGestureZoom = true,
27020
27173
  errorState,
27021
- experimentalCanvas = false,
27174
+ experimentalCanvas = true,
27022
27175
  fileTooLargeState,
27023
27176
  height,
27024
27177
  isDark = false,