@sheetxl/react 0.6.11 → 0.6.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.11
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.11
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -2185,7 +2185,7 @@ const Rt = (e2, t2, o2 = null) => {
2185
2185
  Ce2.current = true;
2186
2186
  const e3 = Q.lazy(async () => {
2187
2187
  try {
2188
- const e4 = await import("./2YYfgC6POiYmyAI_.mjs");
2188
+ const e4 = await import("./C3hCC79Qlha_hRMg.mjs");
2189
2189
  return Ce2.current = false, be2.current = true, R2([...k2]), e4;
2190
2190
  } catch (e4) {
2191
2191
  return console.warn(e4), _2.current?.(false), null;
@@ -2713,60 +2713,64 @@ const eo = ee(ne((e2, t2) => {
2713
2713
  return await ke2.current?.scrollCellCoordsIntoView(o3, t3?.scroll), true;
2714
2714
  }, onRequestFocus: () => K.whenFocus(Kt2.current) }, uo);
2715
2715
  const Gt2 = le(false), Zt2 = te(() => {
2716
- const e3 = (e4, t4) => {
2717
- Vt2.current = true, Nt2([(l3) => {
2718
- if (!l3.toClipBounds(l3.getRangeCoordsBounds({ rowStart: 0, rowEnd: Ne2.height, colStart: e4, colEnd: e4 }))) return;
2719
- const r3 = l3.getLayout(), i2 = Math.max(0, r3.getColOffset(e4)), a2 = l3.getBounds(), s3 = Math.min(a2.x + a2.width, r3.getColOffset(e4 + 1)), d2 = l3.getAnchor();
2720
- if (null !== t4 && (d2 === X.Left || d2 === X.Center || d2 === X.Right)) {
2721
- const e5 = K.roundAccurately(t4 * K.getDPI(), 0), n3 = K.roundAccurately(o2?.getColumnWidthAsFontUnit(t4 / ze2), 2).toFixed(2), l4 = "Width: " + (t4 ? n3 + " (" + e5 + " pixels)" : "Hidden"), r4 = yo2.current.getGridElement().getRelativePointFromClient(0, 0), d3 = 0 - r4.y, c4 = 0 - r4.y + Be2, g4 = { x: i2 - (r4.x - a2.x), y: d3, width: s3 - i2, height: c4 - d3 };
2722
- requestAnimationFrame(() => {
2723
- Vt2.current && ge2?.({ anchor: g4, display: l4 });
2724
- });
2716
+ const e3 = K.debounce((e4) => {
2717
+ requestAnimationFrame(() => {
2718
+ Vt2.current && ge2?.(e4);
2719
+ });
2720
+ }, 32), t3 = (t4, l4) => {
2721
+ Vt2.current = true, Nt2([(r3) => {
2722
+ if (!r3.toClipBounds(r3.getRangeCoordsBounds({ rowStart: 0, rowEnd: Ne2.height, colStart: t4, colEnd: t4 }))) return;
2723
+ const i2 = r3.getLayout(), a2 = Math.max(0, i2.getColOffset(t4)), s3 = r3.getBounds(), d2 = Math.min(s3.x + s3.width, i2.getColOffset(t4 + 1)), c3 = r3.getAnchor();
2724
+ if (null !== l4 && (c3 === X.Left || c3 === X.Center || c3 === X.Right)) {
2725
+ const t5 = K.roundAccurately(l4 * K.getDPI(), 0), n3 = K.roundAccurately(o2?.getColumnWidthAsFontUnit(l4 / ze2), 2).toFixed(2), r4 = "Width: " + (l4 ? n3 + " (" + t5 + " pixels)" : "Hidden"), i3 = yo2.current.getGridElement().getRelativePointFromClient(0, 0), c4 = 0 - i3.y, g4 = 0 - i3.y + Be2, u4 = i3.x - s3.x;
2726
+ e3({ anchor: { x: a2 - u4, y: c4, width: d2 - a2, height: g4 - c4 }, display: r4 });
2725
2727
  }
2726
- const c3 = [0, 0, 0, a2.height], g3 = { style: { boxShadow: `0.5px 0px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, u3 = { x: i2 - 1, y: 0, width: 1, height: a2.height }, h3 = { style: { boxShadow: `-0.5px 0px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, m2 = { x: s3 - 1, y: 0, width: 1, height: a2.height };
2727
- return Z(Q.Fragment, { children: [G(xe, { linePoints: c3, bounds: u3, ...g3 }), G(xe, { linePoints: c3, bounds: m2, ...h3 })] }, "resize-dividers");
2728
+ const g3 = [0, 0, 0, s3.height], u3 = { style: { boxShadow: `0.5px 0px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, h3 = { x: a2 - 1, y: 0, width: 1, height: s3.height }, m2 = { style: { boxShadow: `-0.5px 0px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, p3 = { x: d2 - 1, y: 0, width: 1, height: s3.height };
2729
+ return Z(Q.Fragment, { children: [G(xe, { linePoints: g3, bounds: h3, ...u3 }), G(xe, { linePoints: g3, bounds: p3, ...m2 })] }, "resize-dividers");
2728
2730
  }]);
2729
2731
  };
2730
- let t3 = null;
2731
- return { onResizeHeadersStart: (n3, l3, r3) => {
2732
- t3 = o2.beginCommit(r3), Gt2.current = false, e3(n3, l3);
2733
- }, onResizeHeaders: (t4, o3, n3) => {
2734
- Gt2.current = false, e3(t4, o3);
2735
- }, onResizeHeadersDown: (t4, o3) => {
2732
+ let l3 = null;
2733
+ return { onResizeHeadersStart: (e4, n3, r3) => {
2734
+ l3 = o2.beginCommit(r3), Gt2.current = false, t3(e4, n3);
2735
+ }, onResizeHeaders: (e4, o3, n3) => {
2736
+ Gt2.current = false, t3(e4, o3);
2737
+ }, onResizeHeadersDown: (e4, o3) => {
2736
2738
  Gt2.current = true, setTimeout(() => {
2737
- Gt2.current && e3(t4, o3);
2739
+ Gt2.current && t3(e4, o3);
2738
2740
  }, 360);
2739
- }, onResizeHeadersEnd: (e4, o3, n3) => {
2740
- t3?.commit({ description: n3 }), t3 = null, Gt2.current = false, requestAnimationFrame(() => he2?.()), Vt2.current = false, Nt2(null);
2741
+ }, onResizeHeadersEnd: (e4, t4, o3) => {
2742
+ l3?.commit({ description: o3 }), l3 = null, Gt2.current = false, requestAnimationFrame(() => he2?.()), Vt2.current = false, Nt2(null);
2741
2743
  }, onResizeHeadersUp: (e4) => {
2742
2744
  Gt2.current = false, requestAnimationFrame(() => he2?.()), Vt2.current = false, Nt2(null);
2743
2745
  }, ...c2 };
2744
2746
  }, [o2, c2, Be2, It2]), jt2 = te(() => {
2745
- const e3 = (e4, t4) => {
2746
- Vt2.current = true, Nt2([(l3) => {
2747
- if (!l3.toClipBounds(l3.getRangeCoordsBounds({ rowStart: e4, rowEnd: e4, colStart: 0, colEnd: Ne2.width }))) return;
2748
- const r3 = l3.getLayout(), i2 = Math.max(0, r3.getRowOffset(e4)), a2 = l3.getBounds(), s3 = Math.min(a2.y + a2.height, r3.getRowOffset(e4 + 1)), d2 = l3.getAnchor();
2749
- if (null !== t4 && (d2 === X.Top || d2 === X.Center || d2 === X.Bottom)) {
2750
- const e5 = Math.floor(10 * K.getDPI()) / 10, n3 = K.roundAccurately(t4 * e5, 0), l4 = K.roundAccurately(n3 / ze2 / (o2?.getRowHeaders().getScaleFactor() * K.getDPI()), 2).toFixed(2), r4 = "Height: " + (t4 ? l4 + " (" + n3 + " pixels)" : "Hidden"), d3 = qo2.current.getGridElement().getRelativePointFromClient(0, 0), c4 = 0 - d3.x, g4 = 0 - d3.x + He2, u4 = { x: c4, y: i2 - (d3.y - a2.y), width: g4 - c4, height: s3 - i2 };
2751
- requestAnimationFrame(() => {
2752
- Vt2.current && ue2?.({ anchor: u4, display: r4 });
2753
- });
2747
+ const e3 = K.debounce((e4) => {
2748
+ requestAnimationFrame(() => {
2749
+ Vt2.current && ue2?.(e4);
2750
+ });
2751
+ }, 32), t3 = (t4, l4) => {
2752
+ Vt2.current = true, Nt2([(r3) => {
2753
+ if (!r3.toClipBounds(r3.getRangeCoordsBounds({ rowStart: t4, rowEnd: t4, colStart: 0, colEnd: Ne2.width }))) return;
2754
+ const i2 = r3.getLayout(), a2 = Math.max(0, i2.getRowOffset(t4)), s3 = r3.getBounds(), d2 = Math.min(s3.y + s3.height, i2.getRowOffset(t4 + 1)), c3 = r3.getAnchor();
2755
+ if (null !== l4 && (c3 === X.Top || c3 === X.Center || c3 === X.Bottom)) {
2756
+ const t5 = Math.floor(10 * K.getDPI()) / 10, n3 = K.roundAccurately(l4 * t5, 0), r4 = K.roundAccurately(n3 / ze2 / (o2?.getRowHeaders().getScaleFactor() * K.getDPI()), 2).toFixed(2), i3 = "Height: " + (l4 ? r4 + " (" + n3 + " pixels)" : "Hidden"), c4 = qo2.current.getGridElement().getRelativePointFromClient(0, 0), g4 = 0 - c4.x, u4 = 0 - c4.x + He2, h4 = c4.y - s3.y;
2757
+ e3({ anchor: { x: g4, y: a2 - h4, width: u4 - g4, height: d2 - a2 }, display: i3 });
2754
2758
  }
2755
- const c3 = [0, 0, a2.width, 0], g3 = { style: { boxShadow: `0px 0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, u3 = { x: 0, y: i2 - 1, width: a2.width, height: 1 }, h3 = { style: { boxShadow: `0px -0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, m2 = { x: 0, y: s3 - 1, width: a2.width, height: 1 };
2756
- return Z(Q.Fragment, { children: [G(xe, { linePoints: c3, bounds: u3, ...g3 }), G(xe, { linePoints: c3, bounds: m2, ...h3 })] }, "resize-dividers");
2759
+ const g3 = [0, 0, s3.width, 0], u3 = { style: { boxShadow: `0px 0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, h3 = { x: 0, y: a2 - 1, width: s3.width, height: 1 }, m2 = { style: { boxShadow: `0px -0.5px 0px 0px ${n2?.body?.fill}` }, pathProps: { stroke: Je2 } }, p3 = { x: 0, y: d2 - 1, width: s3.width, height: 1 };
2760
+ return Z(Q.Fragment, { children: [G(xe, { linePoints: g3, bounds: h3, ...u3 }), G(xe, { linePoints: g3, bounds: p3, ...m2 })] }, "resize-dividers");
2757
2761
  }]);
2758
2762
  };
2759
- let t3 = null;
2760
- return { onResizeHeadersStart: (n3, l3, r3) => {
2761
- t3 = o2.beginCommit(r3), Gt2.current = false, e3(n3, l3);
2762
- }, onResizeHeaders: (t4, o3, n3) => {
2763
- Gt2.current = false, e3(t4, o3);
2764
- }, onResizeHeadersDown: (t4, o3) => {
2763
+ let l3 = null;
2764
+ return { onResizeHeadersStart: (e4, n3, r3) => {
2765
+ l3 = o2.beginCommit(r3), Gt2.current = false, t3(e4, n3);
2766
+ }, onResizeHeaders: (e4, o3, n3) => {
2767
+ Gt2.current = false, t3(e4, o3);
2768
+ }, onResizeHeadersDown: (e4, o3) => {
2765
2769
  Gt2.current = true, setTimeout(() => {
2766
- Gt2.current && e3(t4, o3);
2770
+ Gt2.current && t3(e4, o3);
2767
2771
  }, 360);
2768
- }, onResizeHeadersEnd: (e4, o3, n3) => {
2769
- t3?.commit({ description: n3 }), t3 = null, Gt2.current = false, requestAnimationFrame(() => he2?.()), Vt2.current = false, Nt2(null);
2772
+ }, onResizeHeadersEnd: (e4, t4, o3) => {
2773
+ l3?.commit({ description: o3 }), l3 = null, Gt2.current = false, requestAnimationFrame(() => he2?.()), Vt2.current = false, Nt2(null);
2770
2774
  }, onResizeHeadersUp: (e4) => {
2771
2775
  Gt2.current = false, requestAnimationFrame(() => he2?.()), Vt2.current = false, Nt2(null);
2772
2776
  }, ...u2 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/react",
3
3
  "description": "React - React components needed to build advanced grid and spreadsheet UIs.",
4
- "version": "0.6.11",
4
+ "version": "0.6.12",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -37,10 +37,10 @@
37
37
  "@dnd-kit/sortable": "^10.0.0",
38
38
  "@dnd-kit/utilities": "^3.2.2",
39
39
  "@monaco-editor/react": "^4.6.0",
40
- "@sheetxl/grid-react": "^0.6.11",
41
- "@sheetxl/sdk": "^0.6.11",
42
- "@sheetxl/utils": "^0.6.11",
43
- "@sheetxl/utils-react": "^0.6.11",
40
+ "@sheetxl/grid-react": "^0.6.12",
41
+ "@sheetxl/sdk": "^0.6.12",
42
+ "@sheetxl/utils": "^0.6.12",
43
+ "@sheetxl/utils-react": "^0.6.12",
44
44
  "clsx": "^2.1.1",
45
45
  "monaco-editor-auto-typings": "^0.4.6",
46
46
  "react-merge-refs": "^3.0.2",