@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.cjs CHANGED
@@ -25264,15 +25264,19 @@ function XlsxGrid({
25264
25264
  }
25265
25265
  colHeaderCellRefs.current.delete(actualCol);
25266
25266
  }, [experimentalCanvas, palette.headerSurface]);
25267
- const applyPreviewOverlay = React4.useCallback((range) => {
25267
+ const applyPreviewOverlay = React4.useCallback((range, options) => {
25268
25268
  const overlay = selectionOverlayRef.current;
25269
25269
  if (!overlay || !range) {
25270
- applyHeaderSelection(range);
25270
+ if (options?.updateHeaderSelection !== false) {
25271
+ applyHeaderSelection(range);
25272
+ }
25271
25273
  return;
25272
25274
  }
25273
- const nextRect = selectionDragRef.current?.didDrag || fillDragRef.current ? resolveDragPreviewRect(range) ?? resolveGeometryOverlayRect(range) ?? resolveOverlayRect(range) : resolveOverlayRect(range);
25275
+ const nextRect = options?.preferGeometry ? resolveGeometryOverlayRect(range) ?? resolveOverlayRect(range) : selectionDragRef.current?.didDrag || fillDragRef.current ? resolveDragPreviewRect(range) ?? resolveGeometryOverlayRect(range) ?? resolveOverlayRect(range) : resolveOverlayRect(range);
25274
25276
  if (!nextRect) {
25275
- applyHeaderSelection(range);
25277
+ if (options?.updateHeaderSelection !== false) {
25278
+ applyHeaderSelection(range);
25279
+ }
25276
25280
  return;
25277
25281
  }
25278
25282
  overlay.style.left = `${nextRect.left}px`;
@@ -25286,7 +25290,9 @@ function XlsxGrid({
25286
25290
  fillHandle.style.left = `${nextRect.left + nextRect.width - 4 * zoomFactor}px`;
25287
25291
  fillHandle.style.top = `${nextRect.top + nextRect.height - 4 * zoomFactor}px`;
25288
25292
  }
25289
- applyHeaderSelection(range);
25293
+ if (options?.updateHeaderSelection !== false) {
25294
+ applyHeaderSelection(range);
25295
+ }
25290
25296
  }, [applyHeaderSelection, resolveDragPreviewRect, resolveGeometryOverlayRect, resolveOverlayRect, zoomFactor]);
25291
25297
  const applyPreviewOverlayFromElement = React4.useCallback((element, range) => {
25292
25298
  const overlay = selectionOverlayRef.current;
@@ -25398,6 +25404,9 @@ function XlsxGrid({
25398
25404
  if (preview.type === "column") {
25399
25405
  columnPreviewRef.current = { actualIndex: preview.actualIndex, size: preview.size };
25400
25406
  rowPreviewRef.current = null;
25407
+ if (displayedSelectionRef.current) {
25408
+ applyPreviewOverlay(displayedSelectionRef.current, { preferGeometry: true, updateHeaderSelection: false });
25409
+ }
25401
25410
  const position2 = resolveResizeGuidePositionFromClient("column", event.clientX);
25402
25411
  setResizeGuide(position2 === null ? null : { position: position2, type: "column" });
25403
25412
  setGlobalCursor("col-resize");
@@ -25405,6 +25414,9 @@ function XlsxGrid({
25405
25414
  }
25406
25415
  rowPreviewRef.current = { actualIndex: preview.actualIndex, size: preview.size };
25407
25416
  columnPreviewRef.current = null;
25417
+ if (displayedSelectionRef.current) {
25418
+ applyPreviewOverlay(displayedSelectionRef.current, { preferGeometry: true, updateHeaderSelection: false });
25419
+ }
25408
25420
  const position = resolveResizeGuidePositionFromClient("row", event.clientY);
25409
25421
  setResizeGuide(position === null ? null : { position, type: "row" });
25410
25422
  setGlobalCursor("row-resize");
@@ -25449,6 +25461,7 @@ function XlsxGrid({
25449
25461
  }
25450
25462
  };
25451
25463
  }, [
25464
+ applyPreviewOverlay,
25452
25465
  clearGlobalCursor,
25453
25466
  controller,
25454
25467
  displayDefaultColWidth,