@extend-ai/react-xlsx 0.13.0 → 0.13.1

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.js CHANGED
@@ -25230,15 +25230,19 @@ function XlsxGrid({
25230
25230
  }
25231
25231
  colHeaderCellRefs.current.delete(actualCol);
25232
25232
  }, [experimentalCanvas, palette.headerSurface]);
25233
- const applyPreviewOverlay = React4.useCallback((range) => {
25233
+ const applyPreviewOverlay = React4.useCallback((range, options) => {
25234
25234
  const overlay = selectionOverlayRef.current;
25235
25235
  if (!overlay || !range) {
25236
- applyHeaderSelection(range);
25236
+ if (options?.updateHeaderSelection !== false) {
25237
+ applyHeaderSelection(range);
25238
+ }
25237
25239
  return;
25238
25240
  }
25239
- const nextRect = selectionDragRef.current?.didDrag || fillDragRef.current ? resolveDragPreviewRect(range) ?? resolveGeometryOverlayRect(range) ?? resolveOverlayRect(range) : resolveOverlayRect(range);
25241
+ const nextRect = options?.preferGeometry ? resolveGeometryOverlayRect(range) ?? resolveOverlayRect(range) : selectionDragRef.current?.didDrag || fillDragRef.current ? resolveDragPreviewRect(range) ?? resolveGeometryOverlayRect(range) ?? resolveOverlayRect(range) : resolveOverlayRect(range);
25240
25242
  if (!nextRect) {
25241
- applyHeaderSelection(range);
25243
+ if (options?.updateHeaderSelection !== false) {
25244
+ applyHeaderSelection(range);
25245
+ }
25242
25246
  return;
25243
25247
  }
25244
25248
  overlay.style.left = `${nextRect.left}px`;
@@ -25252,7 +25256,9 @@ function XlsxGrid({
25252
25256
  fillHandle.style.left = `${nextRect.left + nextRect.width - 4 * zoomFactor}px`;
25253
25257
  fillHandle.style.top = `${nextRect.top + nextRect.height - 4 * zoomFactor}px`;
25254
25258
  }
25255
- applyHeaderSelection(range);
25259
+ if (options?.updateHeaderSelection !== false) {
25260
+ applyHeaderSelection(range);
25261
+ }
25256
25262
  }, [applyHeaderSelection, resolveDragPreviewRect, resolveGeometryOverlayRect, resolveOverlayRect, zoomFactor]);
25257
25263
  const applyPreviewOverlayFromElement = React4.useCallback((element, range) => {
25258
25264
  const overlay = selectionOverlayRef.current;
@@ -25364,6 +25370,9 @@ function XlsxGrid({
25364
25370
  if (preview.type === "column") {
25365
25371
  columnPreviewRef.current = { actualIndex: preview.actualIndex, size: preview.size };
25366
25372
  rowPreviewRef.current = null;
25373
+ if (displayedSelectionRef.current) {
25374
+ applyPreviewOverlay(displayedSelectionRef.current, { preferGeometry: true, updateHeaderSelection: false });
25375
+ }
25367
25376
  const position2 = resolveResizeGuidePositionFromClient("column", event.clientX);
25368
25377
  setResizeGuide(position2 === null ? null : { position: position2, type: "column" });
25369
25378
  setGlobalCursor("col-resize");
@@ -25371,6 +25380,9 @@ function XlsxGrid({
25371
25380
  }
25372
25381
  rowPreviewRef.current = { actualIndex: preview.actualIndex, size: preview.size };
25373
25382
  columnPreviewRef.current = null;
25383
+ if (displayedSelectionRef.current) {
25384
+ applyPreviewOverlay(displayedSelectionRef.current, { preferGeometry: true, updateHeaderSelection: false });
25385
+ }
25374
25386
  const position = resolveResizeGuidePositionFromClient("row", event.clientY);
25375
25387
  setResizeGuide(position === null ? null : { position, type: "row" });
25376
25388
  setGlobalCursor("row-resize");
@@ -25415,6 +25427,7 @@ function XlsxGrid({
25415
25427
  }
25416
25428
  };
25417
25429
  }, [
25430
+ applyPreviewOverlay,
25418
25431
  clearGlobalCursor,
25419
25432
  controller,
25420
25433
  displayDefaultColWidth,